@vpdev2/metakyc 1.0.1 → 1.0.2
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/Button.d.ts.map +1 -1
- package/dist/components/core/Card.d.ts.map +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +930 -883
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,13 +2,13 @@ var Ut = Object.defineProperty;
|
|
|
2
2
|
var Kt = (e, t, n) => t in e ? Ut(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var he = (e, t, n) => Kt(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import qt from "axios";
|
|
5
|
-
import * as
|
|
5
|
+
import * as It from "react";
|
|
6
6
|
import we, { createContext as Vt, useState as k, useMemo as De, useEffect as ge, useContext as Yt, useRef as de, useCallback as ae, forwardRef as yt, createElement as wt } from "react";
|
|
7
|
-
import { jsx as r, jsxs as
|
|
7
|
+
import { jsx as r, jsxs as o, Fragment as lt } from "react/jsx-runtime";
|
|
8
8
|
import Qt, { createPortal as St } from "react-dom";
|
|
9
9
|
import { useForm as Gt, Controller as et } from "react-hook-form";
|
|
10
10
|
import { z as Ve } from "zod";
|
|
11
|
-
var ce = /* @__PURE__ */ ((e) => (e[e.IdentitySdk = 0] = "IdentitySdk", e[e.RiskScoring = 1] = "RiskScoring", e[e.Questionaries = 2] = "Questionaries", e[e.AdditionalData = 3] = "AdditionalData", e[e.AppropriatenessTest = 4] = "AppropriatenessTest", e[e.UploadDocument = 5] = "UploadDocument", e[e.ManualReview = 6] = "ManualReview", e[e.Overview = 7] = "Overview", e[e.InvestorCategorization = 8] = "InvestorCategorization", e))(ce || {}), gt = /* @__PURE__ */ ((e) => (e[e.NotStarted = 0] = "NotStarted", e[e.InProgress = 1] = "InProgress", e[e.Success = 2] = "Success", e[e.PartialSuccess = 3] = "PartialSuccess", e[e.Failed = 4] = "Failed", e[e.Skipped = 5] = "Skipped", e[e.AdminReview = 6] = "AdminReview", e[e.SkippedAndAdminReview = 7] = "SkippedAndAdminReview", e))(gt || {}), ze = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.InProgress = 1] = "InProgress", e[e.Finished = 2] = "Finished", e[e.OnHold = 3] = "OnHold", e[e.IdentityPending = 4] = "IdentityPending", e))(ze || {}), Jt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.RepresentativeKYC = 1] = "RepresentativeKYC", e[e.ManualRiskCriteria = 2] = "ManualRiskCriteria", e[e.UploadDocumentReview = 3] = "UploadDocumentReview", e[e.AdminReview = 4] = "AdminReview", e))(Jt || {}), Zt = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(Zt || {}), tt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Pending = 1] = "Pending", e[e.Approved = 2] = "Approved", e[e.Rejected = 3] = "Rejected", e[e.ResendRequested = 4] = "ResendRequested", e[e.Unknown = 5] = "Unknown", e[e.InProgress = 6] = "InProgress", e))(tt || {}), rt = /* @__PURE__ */ ((e) => (e[e.Approved = 0] = "Approved", e[e.Reject = 1] = "Reject", e[e.UnderReview = 2] = "UnderReview", e[e.Closed = 3] = "Closed", e[e.AdminReview = 4] = "AdminReview", e[e.New = 5] = "New", e[e.InProgress = 6] = "InProgress", e))(rt || {}), Xt = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(Xt || {}), er = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(er || {}), Oe = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(Oe || {}), tr = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(tr || {}), bt = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(bt || {}), rr = /* @__PURE__ */ ((e) => (e[e.Image = 0] = "Image", e[e.Video = 1] = "Video", e[e.PDF = 2] = "PDF", e[e.OfficePDF = 3] = "OfficePDF", e[e.Custom = 4] = "Custom", e))(rr || {}), nr = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(nr || {}), ar = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(ar || {}), Ke = /* @__PURE__ */ ((e) => (e[e.String = 0] = "String", e[e.Integer = 1] = "Integer", e[e.Money = 2] = "Money", e[e.Boolean = 3] = "Boolean", e[e.Date = 4] = "Date", e[e.Country = 5] = "Country", e[e.DigitOnly = 6] = "DigitOnly", e))(Ke || {}), ir = /* @__PURE__ */ ((e) => (e[e.Text = 0] = "Text", e[e.Radio = 1] = "Radio", e[e.Checkbox = 2] = "Checkbox", e[e.Dropdown = 3] = "Dropdown", e[e.Country = 4] = "Country", e))(ir || {}),
|
|
11
|
+
var ce = /* @__PURE__ */ ((e) => (e[e.IdentitySdk = 0] = "IdentitySdk", e[e.RiskScoring = 1] = "RiskScoring", e[e.Questionaries = 2] = "Questionaries", e[e.AdditionalData = 3] = "AdditionalData", e[e.AppropriatenessTest = 4] = "AppropriatenessTest", e[e.UploadDocument = 5] = "UploadDocument", e[e.ManualReview = 6] = "ManualReview", e[e.Overview = 7] = "Overview", e[e.InvestorCategorization = 8] = "InvestorCategorization", e))(ce || {}), gt = /* @__PURE__ */ ((e) => (e[e.NotStarted = 0] = "NotStarted", e[e.InProgress = 1] = "InProgress", e[e.Success = 2] = "Success", e[e.PartialSuccess = 3] = "PartialSuccess", e[e.Failed = 4] = "Failed", e[e.Skipped = 5] = "Skipped", e[e.AdminReview = 6] = "AdminReview", e[e.SkippedAndAdminReview = 7] = "SkippedAndAdminReview", e))(gt || {}), ze = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.InProgress = 1] = "InProgress", e[e.Finished = 2] = "Finished", e[e.OnHold = 3] = "OnHold", e[e.IdentityPending = 4] = "IdentityPending", e))(ze || {}), Jt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.RepresentativeKYC = 1] = "RepresentativeKYC", e[e.ManualRiskCriteria = 2] = "ManualRiskCriteria", e[e.UploadDocumentReview = 3] = "UploadDocumentReview", e[e.AdminReview = 4] = "AdminReview", e))(Jt || {}), Zt = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(Zt || {}), tt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Pending = 1] = "Pending", e[e.Approved = 2] = "Approved", e[e.Rejected = 3] = "Rejected", e[e.ResendRequested = 4] = "ResendRequested", e[e.Unknown = 5] = "Unknown", e[e.InProgress = 6] = "InProgress", e))(tt || {}), rt = /* @__PURE__ */ ((e) => (e[e.Approved = 0] = "Approved", e[e.Reject = 1] = "Reject", e[e.UnderReview = 2] = "UnderReview", e[e.Closed = 3] = "Closed", e[e.AdminReview = 4] = "AdminReview", e[e.New = 5] = "New", e[e.InProgress = 6] = "InProgress", e))(rt || {}), Xt = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(Xt || {}), er = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(er || {}), Oe = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(Oe || {}), tr = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(tr || {}), bt = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(bt || {}), rr = /* @__PURE__ */ ((e) => (e[e.Image = 0] = "Image", e[e.Video = 1] = "Video", e[e.PDF = 2] = "PDF", e[e.OfficePDF = 3] = "OfficePDF", e[e.Custom = 4] = "Custom", e))(rr || {}), nr = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(nr || {}), ar = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(ar || {}), Ke = /* @__PURE__ */ ((e) => (e[e.String = 0] = "String", e[e.Integer = 1] = "Integer", e[e.Money = 2] = "Money", e[e.Boolean = 3] = "Boolean", e[e.Date = 4] = "Date", e[e.Country = 5] = "Country", e[e.DigitOnly = 6] = "DigitOnly", e))(Ke || {}), ir = /* @__PURE__ */ ((e) => (e[e.Text = 0] = "Text", e[e.Radio = 1] = "Radio", e[e.Checkbox = 2] = "Checkbox", e[e.Dropdown = 3] = "Dropdown", e[e.Country = 4] = "Country", e))(ir || {}), or = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(or || {}), 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 || {}), sr = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))(sr || {});
|
|
12
12
|
const Je = {
|
|
13
13
|
Nationality: 10,
|
|
14
14
|
Address: 20,
|
|
@@ -38,7 +38,7 @@ const Je = {
|
|
|
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
|
+
}, ot = {
|
|
42
42
|
companyName: { label: "Company Name", type: "text" },
|
|
43
43
|
email: { label: "Email", type: "email" },
|
|
44
44
|
phone: { label: "Phone", type: "tel" },
|
|
@@ -69,7 +69,7 @@ const Je = {
|
|
|
69
69
|
"email",
|
|
70
70
|
"phonenumber",
|
|
71
71
|
"dateOfBirth"
|
|
72
|
-
],
|
|
72
|
+
], Rt = [
|
|
73
73
|
{ value: "EN", label: "English" },
|
|
74
74
|
{ value: "DE", label: "German" },
|
|
75
75
|
{ value: "FR", label: "French" },
|
|
@@ -138,10 +138,10 @@ class ur {
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
class Ue extends Error {
|
|
141
|
-
constructor(n, a, i,
|
|
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 =
|
|
144
|
+
this.code = a, this.details = i, this.validationErrors = s, this.name = "MetaKYCError", this.response = c, Object.setPrototypeOf(this, Ue.prototype);
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
class dt {
|
|
@@ -220,7 +220,7 @@ class pr {
|
|
|
220
220
|
var i;
|
|
221
221
|
const a = n.config;
|
|
222
222
|
return ((i = n.response) == null ? void 0 : i.status) >= 500 && !a._retry && (a._retry = !0, a._retryCount = (a._retryCount || 0) + 1, a._retryCount < (this.config.retries || 3)) ? (await new Promise(
|
|
223
|
-
(
|
|
223
|
+
(s) => setTimeout(s, 1e3 * a._retryCount)
|
|
224
224
|
), this.axiosInstance(a)) : Promise.reject(n);
|
|
225
225
|
}
|
|
226
226
|
);
|
|
@@ -236,10 +236,10 @@ class pr {
|
|
|
236
236
|
*/
|
|
237
237
|
async get(t, n, a) {
|
|
238
238
|
try {
|
|
239
|
-
const i = this.buildEndpoint(t, n),
|
|
239
|
+
const i = this.buildEndpoint(t, n), s = await this.axiosInstance.get(i, {
|
|
240
240
|
params: a
|
|
241
241
|
});
|
|
242
|
-
return this.handleResponse(
|
|
242
|
+
return this.handleResponse(s);
|
|
243
243
|
} catch (i) {
|
|
244
244
|
throw dt.handleAxiosError(i);
|
|
245
245
|
}
|
|
@@ -249,8 +249,8 @@ class pr {
|
|
|
249
249
|
*/
|
|
250
250
|
async post(t, n, a) {
|
|
251
251
|
try {
|
|
252
|
-
const i = this.buildEndpoint(t, n),
|
|
253
|
-
return this.handleResponse(
|
|
252
|
+
const i = this.buildEndpoint(t, n), s = await this.axiosInstance.post(i, a);
|
|
253
|
+
return this.handleResponse(s);
|
|
254
254
|
} catch (i) {
|
|
255
255
|
throw dt.handleAxiosError(i);
|
|
256
256
|
}
|
|
@@ -260,8 +260,8 @@ class pr {
|
|
|
260
260
|
*/
|
|
261
261
|
async put(t, n, a) {
|
|
262
262
|
try {
|
|
263
|
-
const i = this.buildEndpoint(t, n),
|
|
264
|
-
return this.handleResponse(
|
|
263
|
+
const i = this.buildEndpoint(t, n), s = await this.axiosInstance.put(i, a);
|
|
264
|
+
return this.handleResponse(s);
|
|
265
265
|
} catch (i) {
|
|
266
266
|
throw dt.handleAxiosError(i);
|
|
267
267
|
}
|
|
@@ -271,10 +271,10 @@ class pr {
|
|
|
271
271
|
*/
|
|
272
272
|
async delete(t, n, a) {
|
|
273
273
|
try {
|
|
274
|
-
const i = this.buildEndpoint(t, n),
|
|
274
|
+
const i = this.buildEndpoint(t, n), s = await this.axiosInstance.delete(i, {
|
|
275
275
|
params: a
|
|
276
276
|
});
|
|
277
|
-
return this.handleResponse(
|
|
277
|
+
return this.handleResponse(s);
|
|
278
278
|
} catch (i) {
|
|
279
279
|
throw dt.handleAxiosError(i);
|
|
280
280
|
}
|
|
@@ -882,7 +882,7 @@ const Le = {
|
|
|
882
882
|
cardPadding: "2rem",
|
|
883
883
|
inputHeight: "3rem"
|
|
884
884
|
}
|
|
885
|
-
},
|
|
885
|
+
}, Ir = {
|
|
886
886
|
name: "Minimal",
|
|
887
887
|
logo: {
|
|
888
888
|
url: "",
|
|
@@ -915,16 +915,16 @@ const Le = {
|
|
|
915
915
|
cardPadding: "1.25rem",
|
|
916
916
|
inputHeight: "2.25rem"
|
|
917
917
|
}
|
|
918
|
-
},
|
|
918
|
+
}, Rr = {
|
|
919
919
|
[Fe.Default]: Le,
|
|
920
920
|
[Fe.Corporate]: wr,
|
|
921
921
|
[Fe.Fintech]: Sr,
|
|
922
922
|
[Fe.Healthcare]: Cr,
|
|
923
923
|
[Fe.Modern]: Nr,
|
|
924
|
-
[Fe.Minimal]:
|
|
924
|
+
[Fe.Minimal]: Ir
|
|
925
925
|
};
|
|
926
926
|
function ut(e) {
|
|
927
|
-
return
|
|
927
|
+
return Rr[e] || Le;
|
|
928
928
|
}
|
|
929
929
|
class Er {
|
|
930
930
|
constructor(t) {
|
|
@@ -951,11 +951,11 @@ class Er {
|
|
|
951
951
|
}), n.result.applicantFormVisibleFields && n.result.applicantFormVisibleFields.length > 0 && (a.applicantFormVisibleFields = n.result.applicantFormVisibleFields), n.result.applicantFormRequiredFields && n.result.applicantFormRequiredFields.length > 0 && (a.applicantFormRequiredFields = n.result.applicantFormRequiredFields), n.result.allowedLanguages && n.result.allowedLanguages.length > 0 && (a.allowedLanguages = n.result.allowedLanguages), n.result.applicantFormPages)
|
|
952
952
|
try {
|
|
953
953
|
const i = typeof n.result.applicantFormPages == "string" ? JSON.parse(n.result.applicantFormPages) : n.result.applicantFormPages;
|
|
954
|
-
Array.isArray(i) && i.length > 0 && (a.applicantFormPages = i.map((
|
|
955
|
-
const c = !
|
|
954
|
+
Array.isArray(i) && i.length > 0 && (a.applicantFormPages = i.map((s) => {
|
|
955
|
+
const c = !s._v || s._v < 4;
|
|
956
956
|
return {
|
|
957
|
-
...
|
|
958
|
-
fields: (
|
|
957
|
+
...s,
|
|
958
|
+
fields: (s.fields || []).map((d) => ({
|
|
959
959
|
...d,
|
|
960
960
|
colSpan: c ? d.colSpan === 1 ? 2 : 4 : Math.min(4, Math.max(1, d.colSpan ?? 4))
|
|
961
961
|
}))
|
|
@@ -972,11 +972,11 @@ class Er {
|
|
|
972
972
|
if (n.result.reviewPageDisabled && (a.reviewPageDisabled = !0), n.result.fieldLabelMode === "placeholder" && (a.fieldLabelMode = "placeholder"), n.result.companyFormVisibleFields && n.result.companyFormVisibleFields.length > 0 && (a.companyFormVisibleFields = n.result.companyFormVisibleFields), n.result.companyFormRequiredFields && n.result.companyFormRequiredFields.length > 0 && (a.companyFormRequiredFields = n.result.companyFormRequiredFields), n.result.companyFormPages)
|
|
973
973
|
try {
|
|
974
974
|
const i = typeof n.result.companyFormPages == "string" ? JSON.parse(n.result.companyFormPages) : n.result.companyFormPages;
|
|
975
|
-
Array.isArray(i) && i.length > 0 && (a.companyFormPages = i.map((
|
|
976
|
-
const c = !
|
|
975
|
+
Array.isArray(i) && i.length > 0 && (a.companyFormPages = i.map((s) => {
|
|
976
|
+
const c = !s._v || s._v < 4;
|
|
977
977
|
return {
|
|
978
|
-
...
|
|
979
|
-
fields: (
|
|
978
|
+
...s,
|
|
979
|
+
fields: (s.fields || []).map((d) => ({
|
|
980
980
|
...d,
|
|
981
981
|
colSpan: c ? d.colSpan === 1 ? 2 : 4 : Math.min(4, Math.max(1, d.colSpan ?? 4))
|
|
982
982
|
}))
|
|
@@ -1056,8 +1056,8 @@ class Fr {
|
|
|
1056
1056
|
a && a.forEach((i) => {
|
|
1057
1057
|
try {
|
|
1058
1058
|
i(n);
|
|
1059
|
-
} catch (
|
|
1060
|
-
console.error(`Error in event listener for "${t}":`,
|
|
1059
|
+
} catch (s) {
|
|
1060
|
+
console.error(`Error in event listener for "${t}":`, s);
|
|
1061
1061
|
}
|
|
1062
1062
|
});
|
|
1063
1063
|
}
|
|
@@ -1256,10 +1256,10 @@ class Tr {
|
|
|
1256
1256
|
}
|
|
1257
1257
|
}
|
|
1258
1258
|
class Pr {
|
|
1259
|
-
constructor(t, n, a, i,
|
|
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 =
|
|
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 Ar(), this.stepRouter = new Tr(), this.registerStepHandlers();
|
|
1263
1263
|
}
|
|
1264
1264
|
/**
|
|
1265
1265
|
* Register all step handlers
|
|
@@ -1425,7 +1425,7 @@ function We(e, t) {
|
|
|
1425
1425
|
}
|
|
1426
1426
|
}
|
|
1427
1427
|
function Dr() {
|
|
1428
|
-
const e = We("--metakyc-primary", "#2563eb"), t = We("--metakyc-primary-hover", "#1d4ed8"), n = We("--metakyc-background", "#ffffff"), a = We("--metakyc-surface", "#f9fafb"), i = We("--metakyc-text-primary", "#111827"),
|
|
1428
|
+
const e = We("--metakyc-primary", "#2563eb"), t = We("--metakyc-primary-hover", "#1d4ed8"), n = We("--metakyc-background", "#ffffff"), a = We("--metakyc-surface", "#f9fafb"), i = We("--metakyc-text-primary", "#111827"), s = We("--metakyc-text-secondary", "#6b7280"), c = We("--metakyc-text-muted", "#9ca3af"), d = We("--metakyc-border", "#e5e7eb");
|
|
1429
1429
|
return `
|
|
1430
1430
|
body, html { font-family: ${We(
|
|
1431
1431
|
"--metakyc-font-family",
|
|
@@ -1433,7 +1433,7 @@ body, html { font-family: ${We(
|
|
|
1433
1433
|
)} !important; background-color: ${n} !important; }
|
|
1434
1434
|
p, span, label, div { color: ${i}; }
|
|
1435
1435
|
h1, h2, h3, h4 { color: ${i}; }
|
|
1436
|
-
.step-desc { color: ${
|
|
1436
|
+
.step-desc { color: ${s}; }
|
|
1437
1437
|
section.content { background-color: ${a}; color: ${i}; padding: 32px 32px 16px; box-shadow: none; border-radius: 10px; border: 1px solid ${d}; }
|
|
1438
1438
|
input { color: ${i}; font-weight: 500; outline: none; background-color: ${n}; border: 1px solid ${d}; border-radius: 6px; }
|
|
1439
1439
|
input:focus { border-color: ${e}; box-shadow: 0 0 0 2px ${e}33; }
|
|
@@ -1445,7 +1445,7 @@ button.back:hover { background-color: ${a}; }
|
|
|
1445
1445
|
.round-icon { background-color: ${e} !important; background-image: none !important; }
|
|
1446
1446
|
.upload-item, .document-status { border-color: ${d} !important; }
|
|
1447
1447
|
select { background-color: ${n}; color: ${i}; border: 1px solid ${d}; border-radius: 6px; }
|
|
1448
|
-
.description { color: ${
|
|
1448
|
+
.description { color: ${s}; }
|
|
1449
1449
|
.subtitle { color: ${c}; }
|
|
1450
1450
|
a { color: ${e}; }
|
|
1451
1451
|
a:hover { color: ${t}; }
|
|
@@ -1481,14 +1481,14 @@ class Mr {
|
|
|
1481
1481
|
}).on("idCheck.onStepCompleted", (i) => {
|
|
1482
1482
|
console.log("[Sumsub] Step completed:", i);
|
|
1483
1483
|
}).on("idCheck.applicantStatus", (i) => {
|
|
1484
|
-
var
|
|
1485
|
-
console.log("[Sumsub] Applicant status:", i), ((i == null ? void 0 : i.reviewStatus) === "completed" || ((
|
|
1484
|
+
var s, c;
|
|
1485
|
+
console.log("[Sumsub] Applicant status:", i), ((i == null ? void 0 : i.reviewStatus) === "completed" || ((s = i == null ? void 0 : i.reviewResult) == null ? void 0 : s.reviewAnswer) === "GREEN") && ((c = this.completeCallback) == null || c.call(this, i));
|
|
1486
1486
|
}).on("idCheck.onError", (i) => {
|
|
1487
|
-
var
|
|
1488
|
-
console.error("[Sumsub] Error:", i), (
|
|
1489
|
-
}).onMessage((i,
|
|
1487
|
+
var s;
|
|
1488
|
+
console.error("[Sumsub] Error:", i), (s = this.errorCallback) == null || s.call(this, i);
|
|
1489
|
+
}).onMessage((i, s) => {
|
|
1490
1490
|
var c;
|
|
1491
|
-
console.log("[Sumsub] Message:", i,
|
|
1491
|
+
console.log("[Sumsub] Message:", i, s), i === "idCheck.onApplicantSubmitted" && ((c = this.completeCallback) == null || c.call(this, s));
|
|
1492
1492
|
});
|
|
1493
1493
|
this.sdk = a.build(), this.sdk.launch(`#${t}`);
|
|
1494
1494
|
}
|
|
@@ -1623,8 +1623,8 @@ class zr {
|
|
|
1623
1623
|
}, i.onerror = () => {
|
|
1624
1624
|
n(new Error("Failed to load SardinAI SDK"));
|
|
1625
1625
|
};
|
|
1626
|
-
const
|
|
1627
|
-
|
|
1626
|
+
const s = document.getElementsByTagName("script")[0];
|
|
1627
|
+
s && s.parentNode ? s.parentNode.insertBefore(i, s) : document.head.appendChild(i);
|
|
1628
1628
|
});
|
|
1629
1629
|
}
|
|
1630
1630
|
/**
|
|
@@ -1634,7 +1634,7 @@ class zr {
|
|
|
1634
1634
|
try {
|
|
1635
1635
|
if (await this.loadSDK(), !window._Sardine)
|
|
1636
1636
|
throw new Error("SardinAI SDK not available after loading");
|
|
1637
|
-
const t = this.getSardineHost(), { clientId: n, environment: a, flow: i, enableBiometrics:
|
|
1637
|
+
const t = this.getSardineHost(), { clientId: n, environment: a, flow: i, enableBiometrics: s, enablePortScanning: c } = this.config;
|
|
1638
1638
|
this.sardineContext = window._Sardine.createContext({
|
|
1639
1639
|
clientId: n,
|
|
1640
1640
|
sessionKey: this.sessionKey,
|
|
@@ -1643,7 +1643,7 @@ class zr {
|
|
|
1643
1643
|
flow: i || window.location.pathname,
|
|
1644
1644
|
environment: a || "production",
|
|
1645
1645
|
parentElement: document.body,
|
|
1646
|
-
enableBiometrics:
|
|
1646
|
+
enableBiometrics: s !== !1,
|
|
1647
1647
|
// Default true
|
|
1648
1648
|
enablePortScanning: c === !0,
|
|
1649
1649
|
// Default false
|
|
@@ -1677,8 +1677,8 @@ class zr {
|
|
|
1677
1677
|
* Add noscript fallback for cases where JS is disabled
|
|
1678
1678
|
*/
|
|
1679
1679
|
addNoScriptFallback(t) {
|
|
1680
|
-
const n = document.createElement("noscript"), a = document.createElement("img"), { clientId: i, flow:
|
|
1681
|
-
a.src = `https://${t}/v1/a.png?clientId=${i}&sessionKey=${this.sessionKey}&flow=${
|
|
1680
|
+
const n = document.createElement("noscript"), a = document.createElement("img"), { clientId: i, flow: s } = this.config;
|
|
1681
|
+
a.src = `https://${t}/v1/a.png?clientId=${i}&sessionKey=${this.sessionKey}&flow=${s || "kyc"}&ns=1`, a.style.display = "none", n.appendChild(a), document.body.appendChild(n);
|
|
1682
1682
|
}
|
|
1683
1683
|
/**
|
|
1684
1684
|
* Update configuration (e.g., set userIdHash after login)
|
|
@@ -1738,7 +1738,7 @@ class Ge {
|
|
|
1738
1738
|
* Get provider configuration from API token object
|
|
1739
1739
|
*/
|
|
1740
1740
|
static parseProviderConfig(t, n, a) {
|
|
1741
|
-
var i,
|
|
1741
|
+
var i, s;
|
|
1742
1742
|
switch (t) {
|
|
1743
1743
|
case Oe.Sumsub:
|
|
1744
1744
|
const c = ((i = a == null ? void 0 : a.identityProviders) == null ? void 0 : i.sumsub) || {};
|
|
@@ -1758,7 +1758,7 @@ class Ge {
|
|
|
1758
1758
|
token: n.token || n.sdkToken
|
|
1759
1759
|
};
|
|
1760
1760
|
case Oe.SardinAI:
|
|
1761
|
-
const d = ((
|
|
1761
|
+
const d = ((s = a == null ? void 0 : a.identityProviders) == null ? void 0 : s.sardinai) || {};
|
|
1762
1762
|
return {
|
|
1763
1763
|
clientId: d.clientId || n.clientId,
|
|
1764
1764
|
sessionKey: d.sessionKey || n.sessionKey,
|
|
@@ -1851,8 +1851,8 @@ class Br {
|
|
|
1851
1851
|
"input-border-focus": t.inputBorderFocus || t.primary,
|
|
1852
1852
|
"input-placeholder": t.inputPlaceholder || t.textMuted
|
|
1853
1853
|
};
|
|
1854
|
-
Object.entries(n).forEach(([i,
|
|
1855
|
-
|
|
1854
|
+
Object.entries(n).forEach(([i, s]) => {
|
|
1855
|
+
s && this.container.style.setProperty(`--metakyc-${i}`, s);
|
|
1856
1856
|
}), this.injectInputColors(), (a = this.currentTheme.darkMode) != null && a.colors && this.applyDarkModeColors(this.currentTheme.darkMode.colors);
|
|
1857
1857
|
}
|
|
1858
1858
|
/**
|
|
@@ -1956,12 +1956,12 @@ class Br {
|
|
|
1956
1956
|
}
|
|
1957
1957
|
}
|
|
1958
1958
|
const Ot = Vt(null), Kn = ({ config: e, children: t }) => {
|
|
1959
|
-
const [n, a] = k(null), i = we.useRef(!1),
|
|
1960
|
-
const y = new pr(e), p = new mr(y),
|
|
1959
|
+
const [n, a] = k(null), i = we.useRef(!1), s = we.useRef(!1), c = De(() => {
|
|
1960
|
+
const y = new pr(e), p = new mr(y), b = new yr(y), P = new hr(y), v = new fr(y), A = new gr(y), T = new br(y), w = new xr(y), N = new vr(y), z = new kr(y), Q = new Er(y), M = new Br();
|
|
1961
1961
|
return {
|
|
1962
1962
|
httpClient: y,
|
|
1963
1963
|
applicantService: p,
|
|
1964
|
-
questionnaireService:
|
|
1964
|
+
questionnaireService: b,
|
|
1965
1965
|
uploadDocumentService: P,
|
|
1966
1966
|
appropriatenessTestService: v,
|
|
1967
1967
|
overviewService: A,
|
|
@@ -1988,21 +1988,21 @@ const Ot = Vt(null), Kn = ({ config: e, children: t }) => {
|
|
|
1988
1988
|
)
|
|
1989
1989
|
}), [e, c, n]);
|
|
1990
1990
|
return ge(() => ((async () => {
|
|
1991
|
-
if (i.current ||
|
|
1991
|
+
if (i.current || s.current) {
|
|
1992
1992
|
console.log("[MetaKYC] Theme already loading or loaded, skipping...");
|
|
1993
1993
|
return;
|
|
1994
1994
|
}
|
|
1995
1995
|
i.current = !0;
|
|
1996
1996
|
try {
|
|
1997
1997
|
if (e.theme) {
|
|
1998
|
-
console.log("[MetaKYC] Applying static theme from config"), c.themeManager.applyTheme(e.theme), a(c.themeManager.getCurrentTheme()),
|
|
1998
|
+
console.log("[MetaKYC] Applying static theme from config"), c.themeManager.applyTheme(e.theme), a(c.themeManager.getCurrentTheme()), s.current = !0;
|
|
1999
1999
|
return;
|
|
2000
2000
|
}
|
|
2001
2001
|
console.log("[MetaKYC] Fetching theme from backend...");
|
|
2002
2002
|
const p = await c.themeService.getThemeConfiguration();
|
|
2003
|
-
c.themeManager.applyTheme(p), a(c.themeManager.getCurrentTheme()),
|
|
2003
|
+
c.themeManager.applyTheme(p), a(c.themeManager.getCurrentTheme()), s.current = !0, console.log("[MetaKYC] Theme loaded and applied", p);
|
|
2004
2004
|
} catch (p) {
|
|
2005
|
-
console.warn("[MetaKYC] Failed to load theme, using default:", p), a(c.themeManager.getCurrentTheme()),
|
|
2005
|
+
console.warn("[MetaKYC] Failed to load theme, using default:", p), a(c.themeManager.getCurrentTheme()), s.current = !0;
|
|
2006
2006
|
} finally {
|
|
2007
2007
|
i.current = !1;
|
|
2008
2008
|
}
|
|
@@ -2020,8 +2020,8 @@ async function _r(e) {
|
|
|
2020
2020
|
return new Promise((t, n) => {
|
|
2021
2021
|
const a = new FileReader();
|
|
2022
2022
|
a.readAsDataURL(e), a.onload = () => {
|
|
2023
|
-
const
|
|
2024
|
-
t(
|
|
2023
|
+
const s = a.result.split(",")[1];
|
|
2024
|
+
t(s);
|
|
2025
2025
|
}, a.onerror = (i) => n(i);
|
|
2026
2026
|
});
|
|
2027
2027
|
}
|
|
@@ -2100,7 +2100,7 @@ function Gn() {
|
|
|
2100
2100
|
Wr(), Kr();
|
|
2101
2101
|
}
|
|
2102
2102
|
function qr(e) {
|
|
2103
|
-
const { createOrchestrator: t } = Te(), [n, a] = k(null), [i,
|
|
2103
|
+
const { createOrchestrator: t } = Te(), [n, a] = k(null), [i, s] = k(!1), [c, d] = k(null), y = de(null), p = e || Hr();
|
|
2104
2104
|
ge(() => {
|
|
2105
2105
|
y.current || (y.current = t());
|
|
2106
2106
|
}, [t]), ge(() => {
|
|
@@ -2114,20 +2114,20 @@ function qr(e) {
|
|
|
2114
2114
|
nextWorkflowKey: n.nextWorkflowKey
|
|
2115
2115
|
}));
|
|
2116
2116
|
}, [n, p]);
|
|
2117
|
-
const
|
|
2117
|
+
const b = de(!1), P = de(!1), v = ae(async () => {
|
|
2118
2118
|
if (!(!p || !y.current)) {
|
|
2119
|
-
if (
|
|
2119
|
+
if (b.current) {
|
|
2120
2120
|
console.log("[Workflow] Load already in progress, skipping...");
|
|
2121
2121
|
return;
|
|
2122
2122
|
}
|
|
2123
|
-
|
|
2123
|
+
b.current = !0, s(!0), d(null);
|
|
2124
2124
|
try {
|
|
2125
2125
|
const M = await y.current.initialize(p);
|
|
2126
2126
|
a(M), P.current = !0;
|
|
2127
2127
|
} catch (M) {
|
|
2128
2128
|
d(M);
|
|
2129
2129
|
} finally {
|
|
2130
|
-
|
|
2130
|
+
s(!1), b.current = !1;
|
|
2131
2131
|
}
|
|
2132
2132
|
}
|
|
2133
2133
|
}, [p]);
|
|
@@ -2136,47 +2136,47 @@ function qr(e) {
|
|
|
2136
2136
|
}, [p, v]);
|
|
2137
2137
|
const A = ae(async () => {
|
|
2138
2138
|
if (y.current) {
|
|
2139
|
-
if (
|
|
2139
|
+
if (b.current) {
|
|
2140
2140
|
console.log("[Workflow] Refresh already in progress, skipping...");
|
|
2141
2141
|
return;
|
|
2142
2142
|
}
|
|
2143
|
-
|
|
2143
|
+
b.current = !0, s(!0), d(null);
|
|
2144
2144
|
try {
|
|
2145
2145
|
const M = await y.current.refreshProgress();
|
|
2146
2146
|
a(M);
|
|
2147
2147
|
} catch (M) {
|
|
2148
2148
|
d(M);
|
|
2149
2149
|
} finally {
|
|
2150
|
-
|
|
2150
|
+
s(!1), b.current = !1;
|
|
2151
2151
|
}
|
|
2152
2152
|
}
|
|
2153
2153
|
}, []), T = ae(async () => {
|
|
2154
2154
|
if (y.current) {
|
|
2155
|
-
|
|
2155
|
+
s(!0), d(null);
|
|
2156
2156
|
try {
|
|
2157
2157
|
const M = await y.current.moveToNextStep();
|
|
2158
2158
|
a(M);
|
|
2159
2159
|
} catch (M) {
|
|
2160
2160
|
d(M);
|
|
2161
2161
|
} finally {
|
|
2162
|
-
|
|
2162
|
+
s(!1);
|
|
2163
2163
|
}
|
|
2164
2164
|
}
|
|
2165
2165
|
}, []), w = ae(async () => {
|
|
2166
2166
|
if (y.current) {
|
|
2167
|
-
|
|
2167
|
+
s(!0), d(null);
|
|
2168
2168
|
try {
|
|
2169
2169
|
const M = await y.current.moveToPreviousStep();
|
|
2170
2170
|
a(M);
|
|
2171
2171
|
} catch (M) {
|
|
2172
2172
|
d(M);
|
|
2173
2173
|
} finally {
|
|
2174
|
-
|
|
2174
|
+
s(!1);
|
|
2175
2175
|
}
|
|
2176
2176
|
}
|
|
2177
2177
|
}, []), N = ae(async (M) => {
|
|
2178
2178
|
if (y.current) {
|
|
2179
|
-
|
|
2179
|
+
s(!0), d(null);
|
|
2180
2180
|
try {
|
|
2181
2181
|
await y.current.submitCurrentStep(M);
|
|
2182
2182
|
const j = await y.current.refreshProgress();
|
|
@@ -2184,10 +2184,10 @@ function qr(e) {
|
|
|
2184
2184
|
} catch (j) {
|
|
2185
2185
|
throw d(j), j;
|
|
2186
2186
|
} finally {
|
|
2187
|
-
|
|
2187
|
+
s(!1);
|
|
2188
2188
|
}
|
|
2189
2189
|
}
|
|
2190
|
-
}, []), z =
|
|
2190
|
+
}, []), z = It.useMemo(() => n != null && n.stepInfoList ? [...n.stepInfoList].sort((M, j) => M.order - j.order) : [], [n == null ? void 0 : n.stepInfoList]), Q = It.useMemo(() => n ? n.nextWorkflowKey && n.nextWorkflowKey !== n.workFlowKey : !1, [n]);
|
|
2191
2191
|
return {
|
|
2192
2192
|
progress: n,
|
|
2193
2193
|
applicantId: p,
|
|
@@ -2210,7 +2210,7 @@ function qr(e) {
|
|
|
2210
2210
|
};
|
|
2211
2211
|
}
|
|
2212
2212
|
function Vr(e) {
|
|
2213
|
-
const { questionnaireService: t, applicantService: n } = Te(), [a, i] = k(null), [
|
|
2213
|
+
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 () => {
|
|
2214
2214
|
var z, Q;
|
|
2215
2215
|
if (e) {
|
|
2216
2216
|
if (A.current) {
|
|
@@ -2247,20 +2247,20 @@ function Vr(e) {
|
|
|
2247
2247
|
}, [e]);
|
|
2248
2248
|
const N = ae(
|
|
2249
2249
|
async (z) => {
|
|
2250
|
-
|
|
2250
|
+
b(!0), v(null);
|
|
2251
2251
|
try {
|
|
2252
2252
|
return await t.fillQuestionnaire(z);
|
|
2253
2253
|
} catch (Q) {
|
|
2254
2254
|
throw v(Q), Q;
|
|
2255
2255
|
} finally {
|
|
2256
|
-
|
|
2256
|
+
b(!1);
|
|
2257
2257
|
}
|
|
2258
2258
|
},
|
|
2259
2259
|
[t]
|
|
2260
2260
|
);
|
|
2261
2261
|
return {
|
|
2262
2262
|
questionnaire: a,
|
|
2263
|
-
initialAnswers:
|
|
2263
|
+
initialAnswers: s,
|
|
2264
2264
|
isLoading: d,
|
|
2265
2265
|
isSubmitting: p,
|
|
2266
2266
|
error: P,
|
|
@@ -2269,20 +2269,20 @@ function Vr(e) {
|
|
|
2269
2269
|
};
|
|
2270
2270
|
}
|
|
2271
2271
|
function Yr(e) {
|
|
2272
|
-
const { uploadDocumentService: t } = Te(), [n, a] = k(null), [i,
|
|
2272
|
+
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 () => {
|
|
2273
2273
|
if (e) {
|
|
2274
2274
|
if (v.current) {
|
|
2275
2275
|
console.log("[UploadDocument] Load already in progress, skipping...");
|
|
2276
2276
|
return;
|
|
2277
2277
|
}
|
|
2278
|
-
v.current = !0,
|
|
2278
|
+
v.current = !0, s(!0), P(null);
|
|
2279
2279
|
try {
|
|
2280
2280
|
const N = await t.getUploadDocument(e);
|
|
2281
2281
|
a(N), A.current = e;
|
|
2282
2282
|
} catch (N) {
|
|
2283
2283
|
P(N);
|
|
2284
2284
|
} finally {
|
|
2285
|
-
|
|
2285
|
+
s(!1), v.current = !1;
|
|
2286
2286
|
}
|
|
2287
2287
|
}
|
|
2288
2288
|
}, [e, t]);
|
|
@@ -2307,26 +2307,26 @@ function Yr(e) {
|
|
|
2307
2307
|
isLoading: i,
|
|
2308
2308
|
isSubmitting: c,
|
|
2309
2309
|
uploadProgress: y,
|
|
2310
|
-
error:
|
|
2310
|
+
error: b,
|
|
2311
2311
|
load: T,
|
|
2312
2312
|
submit: w
|
|
2313
2313
|
};
|
|
2314
2314
|
}
|
|
2315
2315
|
function Jn(e) {
|
|
2316
|
-
const { appropriatenessTestService: t } = Te(), [n, a] = k(null), [i,
|
|
2316
|
+
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 () => {
|
|
2317
2317
|
if (e) {
|
|
2318
2318
|
if (v.current) {
|
|
2319
2319
|
console.log("[AppropriatenessTest] Load already in progress, skipping...");
|
|
2320
2320
|
return;
|
|
2321
2321
|
}
|
|
2322
|
-
v.current = !0,
|
|
2322
|
+
v.current = !0, s(!0), p(null);
|
|
2323
2323
|
try {
|
|
2324
2324
|
const N = await t.getAppropriatenessTest(e);
|
|
2325
2325
|
a(N), A.current = e;
|
|
2326
2326
|
} catch (N) {
|
|
2327
2327
|
p(N);
|
|
2328
2328
|
} finally {
|
|
2329
|
-
|
|
2329
|
+
s(!1), v.current = !1;
|
|
2330
2330
|
}
|
|
2331
2331
|
}
|
|
2332
2332
|
}, [e, t]);
|
|
@@ -2349,7 +2349,7 @@ function Jn(e) {
|
|
|
2349
2349
|
);
|
|
2350
2350
|
return {
|
|
2351
2351
|
test: n,
|
|
2352
|
-
result:
|
|
2352
|
+
result: b,
|
|
2353
2353
|
isLoading: i,
|
|
2354
2354
|
isSubmitting: c,
|
|
2355
2355
|
error: y,
|
|
@@ -2358,20 +2358,20 @@ function Jn(e) {
|
|
|
2358
2358
|
};
|
|
2359
2359
|
}
|
|
2360
2360
|
function Qr(e) {
|
|
2361
|
-
const { overviewService: t } = Te(), [n, a] = k(null), [i,
|
|
2361
|
+
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 () => {
|
|
2362
2362
|
if (e) {
|
|
2363
|
-
if (
|
|
2363
|
+
if (b.current) {
|
|
2364
2364
|
console.log("[Overview] Load already in progress, skipping...");
|
|
2365
2365
|
return;
|
|
2366
2366
|
}
|
|
2367
|
-
|
|
2367
|
+
b.current = !0, s(!0), p(null);
|
|
2368
2368
|
try {
|
|
2369
2369
|
const T = await t.getOverviewData(e);
|
|
2370
2370
|
a(T), P.current = e;
|
|
2371
2371
|
} catch (T) {
|
|
2372
2372
|
p(T);
|
|
2373
2373
|
} finally {
|
|
2374
|
-
|
|
2374
|
+
s(!1), b.current = !1;
|
|
2375
2375
|
}
|
|
2376
2376
|
}
|
|
2377
2377
|
}, [e, t]);
|
|
@@ -2402,14 +2402,14 @@ function Qr(e) {
|
|
|
2402
2402
|
function Gr(e) {
|
|
2403
2403
|
const { identityService: t } = Te(), [n, a] = k(
|
|
2404
2404
|
null
|
|
2405
|
-
), [i,
|
|
2405
|
+
), [i, s] = k(!1), [c, d] = k(null), y = de(!1), p = ae(
|
|
2406
2406
|
async (v, A) => {
|
|
2407
2407
|
if (e) {
|
|
2408
2408
|
if (y.current) {
|
|
2409
2409
|
console.log("[Identity] Request already in progress, skipping...");
|
|
2410
2410
|
return;
|
|
2411
2411
|
}
|
|
2412
|
-
y.current = !0,
|
|
2412
|
+
y.current = !0, s(!0), d(null);
|
|
2413
2413
|
try {
|
|
2414
2414
|
const T = {
|
|
2415
2415
|
applicantId: e,
|
|
@@ -2424,15 +2424,15 @@ function Gr(e) {
|
|
|
2424
2424
|
} catch (T) {
|
|
2425
2425
|
throw d(T), T;
|
|
2426
2426
|
} finally {
|
|
2427
|
-
|
|
2427
|
+
s(!1), y.current = !1;
|
|
2428
2428
|
}
|
|
2429
2429
|
}
|
|
2430
2430
|
},
|
|
2431
2431
|
[e, t]
|
|
2432
|
-
),
|
|
2432
|
+
), b = ae(
|
|
2433
2433
|
async (v, A) => {
|
|
2434
2434
|
if (e) {
|
|
2435
|
-
|
|
2435
|
+
s(!0), d(null);
|
|
2436
2436
|
try {
|
|
2437
2437
|
const T = {
|
|
2438
2438
|
applicantId: e,
|
|
@@ -2444,7 +2444,7 @@ function Gr(e) {
|
|
|
2444
2444
|
} catch (T) {
|
|
2445
2445
|
throw d(T), T;
|
|
2446
2446
|
} finally {
|
|
2447
|
-
|
|
2447
|
+
s(!1);
|
|
2448
2448
|
}
|
|
2449
2449
|
}
|
|
2450
2450
|
},
|
|
@@ -2455,7 +2455,7 @@ function Gr(e) {
|
|
|
2455
2455
|
console.log("[Identity] Restart already in progress, skipping...");
|
|
2456
2456
|
return;
|
|
2457
2457
|
}
|
|
2458
|
-
y.current = !0,
|
|
2458
|
+
y.current = !0, s(!0), d(null);
|
|
2459
2459
|
try {
|
|
2460
2460
|
const v = {
|
|
2461
2461
|
applicantId: e,
|
|
@@ -2470,7 +2470,7 @@ function Gr(e) {
|
|
|
2470
2470
|
} catch (v) {
|
|
2471
2471
|
throw d(v), v;
|
|
2472
2472
|
} finally {
|
|
2473
|
-
|
|
2473
|
+
s(!1), y.current = !1;
|
|
2474
2474
|
}
|
|
2475
2475
|
}
|
|
2476
2476
|
}, [e, t]);
|
|
@@ -2481,12 +2481,12 @@ function Gr(e) {
|
|
|
2481
2481
|
isLoading: i,
|
|
2482
2482
|
error: c,
|
|
2483
2483
|
requestIdentity: p,
|
|
2484
|
-
requestCompanyIdentity:
|
|
2484
|
+
requestCompanyIdentity: b,
|
|
2485
2485
|
restartIdentity: P
|
|
2486
2486
|
};
|
|
2487
2487
|
}
|
|
2488
2488
|
function Jr(e) {
|
|
2489
|
-
const { riskScoringService: t, applicantService: n } = Te(), [a, i] = k(null), [
|
|
2489
|
+
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 () => {
|
|
2490
2490
|
var M;
|
|
2491
2491
|
if (e) {
|
|
2492
2492
|
if (w.current) {
|
|
@@ -2523,21 +2523,21 @@ function Jr(e) {
|
|
|
2523
2523
|
}, [e]);
|
|
2524
2524
|
const Q = ae(
|
|
2525
2525
|
async (M) => {
|
|
2526
|
-
|
|
2526
|
+
b(!0), v(null);
|
|
2527
2527
|
try {
|
|
2528
2528
|
const j = await t.submitRiskScoring(M);
|
|
2529
2529
|
return T(j), j;
|
|
2530
2530
|
} catch (j) {
|
|
2531
2531
|
throw v(j), j;
|
|
2532
2532
|
} finally {
|
|
2533
|
-
|
|
2533
|
+
b(!1);
|
|
2534
2534
|
}
|
|
2535
2535
|
},
|
|
2536
2536
|
[t]
|
|
2537
2537
|
);
|
|
2538
2538
|
return {
|
|
2539
2539
|
criteria: a,
|
|
2540
|
-
initialAnswers:
|
|
2540
|
+
initialAnswers: s,
|
|
2541
2541
|
result: A,
|
|
2542
2542
|
isLoading: d,
|
|
2543
2543
|
isSubmitting: p,
|
|
@@ -2547,7 +2547,7 @@ function Jr(e) {
|
|
|
2547
2547
|
};
|
|
2548
2548
|
}
|
|
2549
2549
|
function zt() {
|
|
2550
|
-
const { applicantService: e, config: t } = Te(), [n, a] = k(!1), [i,
|
|
2550
|
+
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) {
|
|
2551
2551
|
const T = Math.random() * 16 | 0;
|
|
2552
2552
|
return (A === "x" ? T : T & 3 | 8).toString(16);
|
|
2553
2553
|
}), p = ae(
|
|
@@ -2555,7 +2555,7 @@ function zt() {
|
|
|
2555
2555
|
var T;
|
|
2556
2556
|
if (c.current)
|
|
2557
2557
|
throw console.log("[Applicant] Create already in progress, skipping..."), new Error("Creation already in progress");
|
|
2558
|
-
c.current = !0, a(!0),
|
|
2558
|
+
c.current = !0, a(!0), s(null);
|
|
2559
2559
|
try {
|
|
2560
2560
|
if (A.applicantAdditionalDatas || (A.applicantAdditionalDatas = []), (T = t.identityProviders) != null && T.sardinai) {
|
|
2561
2561
|
const N = y();
|
|
@@ -2566,19 +2566,19 @@ function zt() {
|
|
|
2566
2566
|
}
|
|
2567
2567
|
return await e.createApplicant(A);
|
|
2568
2568
|
} catch (w) {
|
|
2569
|
-
throw
|
|
2569
|
+
throw s(w), w;
|
|
2570
2570
|
} finally {
|
|
2571
2571
|
a(!1), c.current = !1;
|
|
2572
2572
|
}
|
|
2573
2573
|
},
|
|
2574
2574
|
[e, t]
|
|
2575
|
-
),
|
|
2575
|
+
), b = ae(
|
|
2576
2576
|
async (A) => {
|
|
2577
|
-
a(!0),
|
|
2577
|
+
a(!0), s(null);
|
|
2578
2578
|
try {
|
|
2579
2579
|
return await e.createCompanyApplicant(A);
|
|
2580
2580
|
} catch (T) {
|
|
2581
|
-
throw
|
|
2581
|
+
throw s(T), T;
|
|
2582
2582
|
} finally {
|
|
2583
2583
|
a(!1);
|
|
2584
2584
|
}
|
|
@@ -2588,11 +2588,11 @@ function zt() {
|
|
|
2588
2588
|
async (A) => {
|
|
2589
2589
|
if (d.current)
|
|
2590
2590
|
throw console.log("[Applicant] Data load already in progress, skipping..."), new Error("Data load already in progress");
|
|
2591
|
-
d.current = !0, a(!0),
|
|
2591
|
+
d.current = !0, a(!0), s(null);
|
|
2592
2592
|
try {
|
|
2593
2593
|
return await e.getApplicantData(A);
|
|
2594
2594
|
} catch (T) {
|
|
2595
|
-
throw
|
|
2595
|
+
throw s(T), T;
|
|
2596
2596
|
} finally {
|
|
2597
2597
|
a(!1), d.current = !1;
|
|
2598
2598
|
}
|
|
@@ -2600,11 +2600,11 @@ function zt() {
|
|
|
2600
2600
|
[e]
|
|
2601
2601
|
), v = ae(
|
|
2602
2602
|
async (A) => {
|
|
2603
|
-
a(!0),
|
|
2603
|
+
a(!0), s(null);
|
|
2604
2604
|
try {
|
|
2605
2605
|
await e.stopProgress(A);
|
|
2606
2606
|
} catch (T) {
|
|
2607
|
-
throw
|
|
2607
|
+
throw s(T), T;
|
|
2608
2608
|
} finally {
|
|
2609
2609
|
a(!1);
|
|
2610
2610
|
}
|
|
@@ -2615,7 +2615,7 @@ function zt() {
|
|
|
2615
2615
|
isLoading: n,
|
|
2616
2616
|
error: i,
|
|
2617
2617
|
createApplicant: p,
|
|
2618
|
-
createCompanyApplicant:
|
|
2618
|
+
createCompanyApplicant: b,
|
|
2619
2619
|
getApplicantData: P,
|
|
2620
2620
|
stopProgress: v
|
|
2621
2621
|
};
|
|
@@ -2652,57 +2652,78 @@ const Zr = {
|
|
|
2652
2652
|
size: n = "md",
|
|
2653
2653
|
isLoading: a = !1,
|
|
2654
2654
|
disabled: i,
|
|
2655
|
-
className:
|
|
2655
|
+
className: s,
|
|
2656
2656
|
style: c,
|
|
2657
2657
|
...d
|
|
2658
|
-
}) =>
|
|
2659
|
-
"
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2658
|
+
}) => {
|
|
2659
|
+
const y = "inline-flex items-center justify-center rounded-lg font-medium transition-opacity border focus:outline-none focus:ring-2 focus:ring-offset-1 disabled:opacity-50 disabled:cursor-not-allowed", p = {
|
|
2660
|
+
sm: "px-3 py-1.5 text-sm",
|
|
2661
|
+
md: "px-4 py-2 text-sm",
|
|
2662
|
+
lg: "px-6 py-3 text-base"
|
|
2663
|
+
}, b = {
|
|
2664
|
+
sm: { padding: "0.375rem 0.75rem", fontSize: "0.875rem" },
|
|
2665
|
+
md: { padding: "0.5rem 1rem", fontSize: "0.875rem" },
|
|
2666
|
+
lg: { padding: "0.75rem 1.5rem", fontSize: "1rem" }
|
|
2667
|
+
};
|
|
2668
|
+
return /* @__PURE__ */ o(
|
|
2669
|
+
"button",
|
|
2670
|
+
{
|
|
2671
|
+
className: Ae(y, p[n], s),
|
|
2672
|
+
style: {
|
|
2673
|
+
display: "inline-flex",
|
|
2674
|
+
alignItems: "center",
|
|
2675
|
+
justifyContent: "center",
|
|
2676
|
+
borderRadius: "0.5rem",
|
|
2677
|
+
fontWeight: 500,
|
|
2678
|
+
borderWidth: "1px",
|
|
2679
|
+
borderStyle: "solid",
|
|
2680
|
+
cursor: i || a ? "not-allowed" : "pointer",
|
|
2681
|
+
opacity: i || a ? 0.5 : 1,
|
|
2682
|
+
lineHeight: "1.25rem",
|
|
2683
|
+
...b[n],
|
|
2684
|
+
...Zr[t],
|
|
2685
|
+
...c
|
|
2686
|
+
},
|
|
2687
|
+
disabled: i || a,
|
|
2688
|
+
...d,
|
|
2689
|
+
children: [
|
|
2690
|
+
a && /* @__PURE__ */ o(
|
|
2691
|
+
"svg",
|
|
2692
|
+
{
|
|
2693
|
+
className: "animate-spin -ml-1 mr-2 h-4 w-4",
|
|
2694
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2695
|
+
fill: "none",
|
|
2696
|
+
viewBox: "0 0 24 24",
|
|
2697
|
+
children: [
|
|
2698
|
+
/* @__PURE__ */ r(
|
|
2699
|
+
"circle",
|
|
2700
|
+
{
|
|
2701
|
+
className: "opacity-25",
|
|
2702
|
+
cx: "12",
|
|
2703
|
+
cy: "12",
|
|
2704
|
+
r: "10",
|
|
2705
|
+
stroke: "currentColor",
|
|
2706
|
+
strokeWidth: "4"
|
|
2707
|
+
}
|
|
2708
|
+
),
|
|
2709
|
+
/* @__PURE__ */ r(
|
|
2710
|
+
"path",
|
|
2711
|
+
{
|
|
2712
|
+
className: "opacity-75",
|
|
2713
|
+
fill: "currentColor",
|
|
2714
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
2715
|
+
}
|
|
2716
|
+
)
|
|
2717
|
+
]
|
|
2718
|
+
}
|
|
2719
|
+
),
|
|
2720
|
+
e
|
|
2721
|
+
]
|
|
2722
|
+
}
|
|
2723
|
+
);
|
|
2724
|
+
}, xe = yt(
|
|
2725
|
+
({ label: e, error: t, helperText: n, leftIcon: a, rightIcon: i, className: s, style: c, ...d }, y) => /* @__PURE__ */ o("div", { className: "w-full", children: [
|
|
2726
|
+
e && /* @__PURE__ */ o(
|
|
2706
2727
|
"label",
|
|
2707
2728
|
{
|
|
2708
2729
|
className: "block text-sm font-medium mb-1",
|
|
@@ -2713,7 +2734,7 @@ const Zr = {
|
|
|
2713
2734
|
]
|
|
2714
2735
|
}
|
|
2715
2736
|
),
|
|
2716
|
-
/* @__PURE__ */
|
|
2737
|
+
/* @__PURE__ */ o("div", { className: "relative", children: [
|
|
2717
2738
|
a && /* @__PURE__ */ r("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none", children: a }),
|
|
2718
2739
|
/* @__PURE__ */ r(
|
|
2719
2740
|
"input",
|
|
@@ -2725,7 +2746,7 @@ const Zr = {
|
|
|
2725
2746
|
"disabled:opacity-60 disabled:cursor-not-allowed",
|
|
2726
2747
|
a ? "pl-10" : "",
|
|
2727
2748
|
i ? "pr-10" : "",
|
|
2728
|
-
|
|
2749
|
+
s
|
|
2729
2750
|
),
|
|
2730
2751
|
style: {
|
|
2731
2752
|
minHeight: "38px",
|
|
@@ -2745,38 +2766,56 @@ const Zr = {
|
|
|
2745
2766
|
] })
|
|
2746
2767
|
);
|
|
2747
2768
|
xe.displayName = "Input";
|
|
2748
|
-
const re = ({ children: e, className: t,
|
|
2769
|
+
const re = ({ children: e, className: t, style: n, ...a }) => /* @__PURE__ */ r(
|
|
2749
2770
|
"div",
|
|
2750
2771
|
{
|
|
2751
|
-
className: Ae(
|
|
2752
|
-
"metakyc-card rounded-xl shadow-sm border",
|
|
2753
|
-
t
|
|
2754
|
-
),
|
|
2772
|
+
className: Ae("metakyc-card rounded-xl shadow-sm border", t),
|
|
2755
2773
|
style: {
|
|
2756
2774
|
backgroundColor: "var(--metakyc-surface, #ffffff)",
|
|
2757
|
-
borderColor: "var(--metakyc-border, #e5e7eb)"
|
|
2775
|
+
borderColor: "var(--metakyc-border, #e5e7eb)",
|
|
2776
|
+
borderWidth: "1px",
|
|
2777
|
+
borderStyle: "solid",
|
|
2778
|
+
borderRadius: "0.75rem",
|
|
2779
|
+
overflow: "hidden",
|
|
2780
|
+
...n
|
|
2758
2781
|
},
|
|
2759
|
-
...
|
|
2782
|
+
...a,
|
|
2760
2783
|
children: e
|
|
2761
2784
|
}
|
|
2762
|
-
), Se = ({ children: e, className: t,
|
|
2785
|
+
), Se = ({ children: e, className: t, style: n, ...a }) => /* @__PURE__ */ r(
|
|
2763
2786
|
"div",
|
|
2764
2787
|
{
|
|
2765
2788
|
className: Ae("px-6 py-4 border-b", t),
|
|
2766
2789
|
style: {
|
|
2767
|
-
|
|
2790
|
+
padding: "1rem 1.5rem",
|
|
2791
|
+
borderBottomWidth: "1px",
|
|
2792
|
+
borderBottomStyle: "solid",
|
|
2793
|
+
borderBottomColor: "var(--metakyc-border, #e5e7eb)",
|
|
2794
|
+
...n
|
|
2768
2795
|
},
|
|
2769
|
-
...
|
|
2796
|
+
...a,
|
|
2797
|
+
children: e
|
|
2798
|
+
}
|
|
2799
|
+
), ne = ({ children: e, className: t, style: n, ...a }) => /* @__PURE__ */ r(
|
|
2800
|
+
"div",
|
|
2801
|
+
{
|
|
2802
|
+
className: Ae("px-6 py-4", t),
|
|
2803
|
+
style: { padding: "1rem 1.5rem", ...n },
|
|
2804
|
+
...a,
|
|
2770
2805
|
children: e
|
|
2771
2806
|
}
|
|
2772
|
-
),
|
|
2807
|
+
), Ce = ({ children: e, className: t, style: n, ...a }) => /* @__PURE__ */ r(
|
|
2773
2808
|
"div",
|
|
2774
2809
|
{
|
|
2775
2810
|
className: Ae("px-6 py-4 border-t", t),
|
|
2776
2811
|
style: {
|
|
2777
|
-
|
|
2812
|
+
padding: "1rem 1.5rem",
|
|
2813
|
+
borderTopWidth: "1px",
|
|
2814
|
+
borderTopStyle: "solid",
|
|
2815
|
+
borderTopColor: "var(--metakyc-border, #e5e7eb)",
|
|
2816
|
+
...n
|
|
2778
2817
|
},
|
|
2779
|
-
...
|
|
2818
|
+
...a,
|
|
2780
2819
|
children: e
|
|
2781
2820
|
}
|
|
2782
2821
|
), Xr = {
|
|
@@ -2819,7 +2858,7 @@ const re = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2819
2858
|
md: "h-8 w-8",
|
|
2820
2859
|
lg: "h-12 w-12"
|
|
2821
2860
|
};
|
|
2822
|
-
return /* @__PURE__ */ r("div", { className: Ae("flex items-center justify-center", t), ...n, children: /* @__PURE__ */
|
|
2861
|
+
return /* @__PURE__ */ r("div", { className: Ae("flex items-center justify-center", t), ...n, children: /* @__PURE__ */ o(
|
|
2823
2862
|
"svg",
|
|
2824
2863
|
{
|
|
2825
2864
|
className: Ae("animate-spin text-primary-500", a[e]),
|
|
@@ -2850,8 +2889,8 @@ const re = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2850
2889
|
}
|
|
2851
2890
|
) });
|
|
2852
2891
|
}, Ct = yt(
|
|
2853
|
-
({ label: e, error: t, helperText: n, options: a, placeholder: i, className:
|
|
2854
|
-
e && /* @__PURE__ */
|
|
2892
|
+
({ label: e, error: t, helperText: n, options: a, placeholder: i, className: s, style: c, ...d }, y) => /* @__PURE__ */ o("div", { className: "w-full", children: [
|
|
2893
|
+
e && /* @__PURE__ */ o(
|
|
2855
2894
|
"label",
|
|
2856
2895
|
{
|
|
2857
2896
|
className: "block text-sm font-medium mb-1",
|
|
@@ -2862,7 +2901,7 @@ const re = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2862
2901
|
]
|
|
2863
2902
|
}
|
|
2864
2903
|
),
|
|
2865
|
-
/* @__PURE__ */
|
|
2904
|
+
/* @__PURE__ */ o(
|
|
2866
2905
|
"select",
|
|
2867
2906
|
{
|
|
2868
2907
|
ref: y,
|
|
@@ -2871,7 +2910,7 @@ const re = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2871
2910
|
"focus:outline-none focus:ring-2 focus:ring-offset-0",
|
|
2872
2911
|
"disabled:opacity-60 disabled:cursor-not-allowed",
|
|
2873
2912
|
t ? "border-danger-500" : "",
|
|
2874
|
-
|
|
2913
|
+
s
|
|
2875
2914
|
),
|
|
2876
2915
|
style: {
|
|
2877
2916
|
minHeight: "38px",
|
|
@@ -2895,7 +2934,7 @@ const re = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2895
2934
|
},
|
|
2896
2935
|
"__placeholder__"
|
|
2897
2936
|
),
|
|
2898
|
-
a.map((p,
|
|
2937
|
+
a.map((p, b) => /* @__PURE__ */ r(
|
|
2899
2938
|
"option",
|
|
2900
2939
|
{
|
|
2901
2940
|
value: p.value,
|
|
@@ -2906,7 +2945,7 @@ const re = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2906
2945
|
},
|
|
2907
2946
|
children: p.label
|
|
2908
2947
|
},
|
|
2909
|
-
p.value || `option-${
|
|
2948
|
+
p.value || `option-${b}`
|
|
2910
2949
|
))
|
|
2911
2950
|
]
|
|
2912
2951
|
}
|
|
@@ -2922,11 +2961,11 @@ const Et = 280, en = ({
|
|
|
2922
2961
|
onChange: n,
|
|
2923
2962
|
options: a,
|
|
2924
2963
|
placeholder: i = "Select...",
|
|
2925
|
-
disabled:
|
|
2964
|
+
disabled: s = !1,
|
|
2926
2965
|
readOnly: c = !1,
|
|
2927
2966
|
required: d = !1
|
|
2928
2967
|
}) => {
|
|
2929
|
-
const y =
|
|
2968
|
+
const y = s || c, [p, b] = k(!1), [P, v] = k(""), [A, T] = k(null), [w, N] = k({
|
|
2930
2969
|
bg: "#ffffff",
|
|
2931
2970
|
borderColor: "#d1d5db",
|
|
2932
2971
|
textPrimary: "#111827",
|
|
@@ -2953,9 +2992,9 @@ const Et = 280, en = ({
|
|
|
2953
2992
|
if (y) return;
|
|
2954
2993
|
K();
|
|
2955
2994
|
const F = j();
|
|
2956
|
-
F && T(F),
|
|
2995
|
+
F && T(F), b(!0);
|
|
2957
2996
|
}, [y, j, K]), E = ae(() => {
|
|
2958
|
-
|
|
2997
|
+
b(!1), v("");
|
|
2959
2998
|
}, []);
|
|
2960
2999
|
ge(() => {
|
|
2961
3000
|
if (!p) return;
|
|
@@ -2984,7 +3023,7 @@ const Et = 280, en = ({
|
|
|
2984
3023
|
}, G = (F) => {
|
|
2985
3024
|
var U;
|
|
2986
3025
|
return ((U = a.find((B) => B.value === F)) == null ? void 0 : U.label) || F;
|
|
2987
|
-
}, { bg: _, borderColor: J, textPrimary:
|
|
3026
|
+
}, { bg: _, borderColor: J, textPrimary: ie, textSecondary: Y, primaryColor: ve, primaryLight: pe, hoverBg: me } = w, ke = p && A && /* @__PURE__ */ o(
|
|
2988
3027
|
"div",
|
|
2989
3028
|
{
|
|
2990
3029
|
ref: M,
|
|
@@ -3021,22 +3060,22 @@ const Et = 280, en = ({
|
|
|
3021
3060
|
borderRadius: "6px",
|
|
3022
3061
|
border: `1px solid ${J}`,
|
|
3023
3062
|
backgroundColor: _,
|
|
3024
|
-
color:
|
|
3063
|
+
color: ie,
|
|
3025
3064
|
outline: "none",
|
|
3026
3065
|
boxSizing: "border-box"
|
|
3027
3066
|
},
|
|
3028
3067
|
onFocus: (F) => {
|
|
3029
3068
|
const U = getComputedStyle(document.documentElement), B = U.getPropertyValue("--metakyc-input-border-focus").trim() || U.getPropertyValue("--metakyc-primary").trim() || "#2563eb";
|
|
3030
|
-
F.currentTarget.style.backgroundColor = _, F.currentTarget.style.color =
|
|
3069
|
+
F.currentTarget.style.backgroundColor = _, F.currentTarget.style.color = ie, F.currentTarget.style.borderColor = B, F.currentTarget.style.outline = "none", F.currentTarget.style.boxShadow = `0 0 0 2px ${B}33`;
|
|
3031
3070
|
},
|
|
3032
3071
|
onBlur: (F) => {
|
|
3033
|
-
F.currentTarget.style.backgroundColor = _, F.currentTarget.style.color =
|
|
3072
|
+
F.currentTarget.style.backgroundColor = _, F.currentTarget.style.color = ie, F.currentTarget.style.borderColor = J, F.currentTarget.style.outline = "none", F.currentTarget.style.boxShadow = "none";
|
|
3034
3073
|
}
|
|
3035
3074
|
}
|
|
3036
3075
|
) }),
|
|
3037
3076
|
/* @__PURE__ */ r("ul", { style: { listStyle: "none", margin: 0, padding: "4px 0", maxHeight: "192px", overflowY: "auto" }, children: g.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: Y }, children: "No results" }) : g.map((F) => {
|
|
3038
3077
|
const U = t.includes(F.value);
|
|
3039
|
-
return /* @__PURE__ */
|
|
3078
|
+
return /* @__PURE__ */ o(
|
|
3040
3079
|
"li",
|
|
3041
3080
|
{
|
|
3042
3081
|
onClick: () => $(F.value),
|
|
@@ -3048,8 +3087,8 @@ const Et = 280, en = ({
|
|
|
3048
3087
|
padding: "8px 12px",
|
|
3049
3088
|
fontSize: "13px",
|
|
3050
3089
|
cursor: "pointer",
|
|
3051
|
-
backgroundColor: U ?
|
|
3052
|
-
color: U ? ve :
|
|
3090
|
+
backgroundColor: U ? pe : "transparent",
|
|
3091
|
+
color: U ? ve : ie,
|
|
3053
3092
|
userSelect: "none"
|
|
3054
3093
|
},
|
|
3055
3094
|
onMouseEnter: (B) => {
|
|
@@ -3074,7 +3113,7 @@ const Et = 280, en = ({
|
|
|
3074
3113
|
F.value
|
|
3075
3114
|
);
|
|
3076
3115
|
}) }),
|
|
3077
|
-
t.length > 0 && /* @__PURE__ */ r("div", { style: { padding: "6px 12px", borderTop: `1px solid ${J}` }, children: /* @__PURE__ */
|
|
3116
|
+
t.length > 0 && /* @__PURE__ */ r("div", { style: { padding: "6px 12px", borderTop: `1px solid ${J}` }, children: /* @__PURE__ */ o(
|
|
3078
3117
|
"button",
|
|
3079
3118
|
{
|
|
3080
3119
|
type: "button",
|
|
@@ -3092,8 +3131,8 @@ const Et = 280, en = ({
|
|
|
3092
3131
|
]
|
|
3093
3132
|
}
|
|
3094
3133
|
);
|
|
3095
|
-
return /* @__PURE__ */
|
|
3096
|
-
e && /* @__PURE__ */
|
|
3134
|
+
return /* @__PURE__ */ o("div", { className: "w-full metakyc-multiselect", ref: z, children: [
|
|
3135
|
+
e && /* @__PURE__ */ o(
|
|
3097
3136
|
"label",
|
|
3098
3137
|
{
|
|
3099
3138
|
className: "block text-sm font-medium mb-1",
|
|
@@ -3104,7 +3143,7 @@ const Et = 280, en = ({
|
|
|
3104
3143
|
]
|
|
3105
3144
|
}
|
|
3106
3145
|
),
|
|
3107
|
-
/* @__PURE__ */
|
|
3146
|
+
/* @__PURE__ */ o(
|
|
3108
3147
|
"div",
|
|
3109
3148
|
{
|
|
3110
3149
|
ref: Q,
|
|
@@ -3129,7 +3168,7 @@ const Et = 280, en = ({
|
|
|
3129
3168
|
style: { color: "var(--metakyc-text-secondary, #9ca3af)" },
|
|
3130
3169
|
children: i
|
|
3131
3170
|
}
|
|
3132
|
-
) : /* @__PURE__ */ r("div", { className: "flex flex-wrap gap-1 pr-6", children: t.map((F) => /* @__PURE__ */
|
|
3171
|
+
) : /* @__PURE__ */ r("div", { className: "flex flex-wrap gap-1 pr-6", children: t.map((F) => /* @__PURE__ */ o(
|
|
3133
3172
|
"span",
|
|
3134
3173
|
{
|
|
3135
3174
|
className: "metakyc-multiselect-chip inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs font-medium",
|
|
@@ -3190,12 +3229,12 @@ const Et = 280, en = ({
|
|
|
3190
3229
|
helperText: n,
|
|
3191
3230
|
options: a,
|
|
3192
3231
|
placeholder: i = "Select...",
|
|
3193
|
-
value:
|
|
3232
|
+
value: s,
|
|
3194
3233
|
onChange: c,
|
|
3195
3234
|
disabled: d = !1,
|
|
3196
3235
|
readOnly: y = !1,
|
|
3197
3236
|
required: p = !1,
|
|
3198
|
-
className:
|
|
3237
|
+
className: b
|
|
3199
3238
|
}) => {
|
|
3200
3239
|
var fe;
|
|
3201
3240
|
const P = d || y, [v, A] = k(!1), [T, w] = k(""), [N, z] = k(null), [Q, M] = k({
|
|
@@ -3207,7 +3246,7 @@ const Et = 280, en = ({
|
|
|
3207
3246
|
primaryLight: "#eff6ff",
|
|
3208
3247
|
hoverBg: "#f9fafb"
|
|
3209
3248
|
}), j = ae(() => {
|
|
3210
|
-
const
|
|
3249
|
+
const R = getComputedStyle(document.documentElement), te = (oe, Ne) => R.getPropertyValue(oe).trim() || Ne, ye = te("--metakyc-input-bg", te("--metakyc-background", "#ffffff"));
|
|
3211
3250
|
M({
|
|
3212
3251
|
bg: ye,
|
|
3213
3252
|
border: te("--metakyc-input-border", te("--metakyc-border", "#d1d5db")),
|
|
@@ -3219,49 +3258,49 @@ const Et = 280, en = ({
|
|
|
3219
3258
|
});
|
|
3220
3259
|
}, []), K = de(null), ee = de(null), E = de(null), g = de(null), $ = ae(() => {
|
|
3221
3260
|
if (!ee.current) return null;
|
|
3222
|
-
const
|
|
3261
|
+
const R = ee.current.getBoundingClientRect(), ye = window.innerHeight - R.bottom < Ft && R.top > Ft;
|
|
3223
3262
|
return {
|
|
3224
|
-
top: ye ?
|
|
3225
|
-
left:
|
|
3226
|
-
width:
|
|
3263
|
+
top: ye ? R.top : R.bottom + 4,
|
|
3264
|
+
left: R.left,
|
|
3265
|
+
width: R.width,
|
|
3227
3266
|
openUp: ye
|
|
3228
3267
|
};
|
|
3229
3268
|
}, []), V = ae(() => {
|
|
3230
3269
|
if (P) return;
|
|
3231
3270
|
j();
|
|
3232
|
-
const
|
|
3233
|
-
|
|
3271
|
+
const R = $();
|
|
3272
|
+
R && z(R), A(!0);
|
|
3234
3273
|
}, [P, $, j]), G = ae(() => {
|
|
3235
3274
|
A(!1), w("");
|
|
3236
3275
|
}, []), _ = () => v ? G() : V();
|
|
3237
3276
|
ge(() => {
|
|
3238
3277
|
if (!v) return;
|
|
3239
|
-
const
|
|
3278
|
+
const R = (te) => {
|
|
3240
3279
|
var oe, Ne;
|
|
3241
3280
|
const ye = te.target;
|
|
3242
3281
|
!((oe = K.current) != null && oe.contains(ye)) && !((Ne = E.current) != null && Ne.contains(ye)) && G();
|
|
3243
3282
|
};
|
|
3244
|
-
return document.addEventListener("mousedown",
|
|
3283
|
+
return document.addEventListener("mousedown", R), () => document.removeEventListener("mousedown", R);
|
|
3245
3284
|
}, [v, G]), ge(() => {
|
|
3246
3285
|
if (!v) return;
|
|
3247
|
-
const
|
|
3286
|
+
const R = () => {
|
|
3248
3287
|
const te = $();
|
|
3249
3288
|
te && z(te);
|
|
3250
3289
|
};
|
|
3251
|
-
return window.addEventListener("scroll",
|
|
3252
|
-
window.removeEventListener("scroll",
|
|
3290
|
+
return window.addEventListener("scroll", R, !0), window.addEventListener("resize", R), () => {
|
|
3291
|
+
window.removeEventListener("scroll", R, !0), window.removeEventListener("resize", R);
|
|
3253
3292
|
};
|
|
3254
3293
|
}, [v, $]), ge(() => {
|
|
3255
3294
|
v && g.current && setTimeout(() => {
|
|
3256
|
-
var
|
|
3257
|
-
return (
|
|
3295
|
+
var R;
|
|
3296
|
+
return (R = g.current) == null ? void 0 : R.focus();
|
|
3258
3297
|
}, 0);
|
|
3259
3298
|
}, [v]);
|
|
3260
3299
|
const J = a.filter(
|
|
3261
|
-
(
|
|
3262
|
-
),
|
|
3263
|
-
P || te || (c(
|
|
3264
|
-
}, { bg: ve, border:
|
|
3300
|
+
(R) => R.label.toLowerCase().includes(T.toLowerCase()) || R.value.toLowerCase().includes(T.toLowerCase())
|
|
3301
|
+
), ie = (fe = a.find((R) => R.value === s)) == null ? void 0 : fe.label, Y = (R, te) => {
|
|
3302
|
+
P || te || (c(R), G());
|
|
3303
|
+
}, { bg: ve, border: pe, text: me, textSecondary: ke, primary: F, primaryLight: U, hoverBg: B } = Q, H = v && N && /* @__PURE__ */ o(
|
|
3265
3304
|
"div",
|
|
3266
3305
|
{
|
|
3267
3306
|
ref: E,
|
|
@@ -3275,20 +3314,20 @@ const Et = 280, en = ({
|
|
|
3275
3314
|
zIndex: 99999,
|
|
3276
3315
|
borderRadius: "8px",
|
|
3277
3316
|
boxShadow: "0 4px 16px rgba(0,0,0,0.18)",
|
|
3278
|
-
border: `1px solid ${
|
|
3317
|
+
border: `1px solid ${pe}`,
|
|
3279
3318
|
backgroundColor: ve,
|
|
3280
3319
|
overflow: "hidden"
|
|
3281
3320
|
},
|
|
3282
3321
|
children: [
|
|
3283
|
-
/* @__PURE__ */ r("div", { style: { padding: "8px", borderBottom: `1px solid ${
|
|
3322
|
+
/* @__PURE__ */ r("div", { style: { padding: "8px", borderBottom: `1px solid ${pe}` }, children: /* @__PURE__ */ r(
|
|
3284
3323
|
"input",
|
|
3285
3324
|
{
|
|
3286
3325
|
ref: g,
|
|
3287
3326
|
type: "text",
|
|
3288
3327
|
value: T,
|
|
3289
|
-
onChange: (
|
|
3328
|
+
onChange: (R) => w(R.target.value),
|
|
3290
3329
|
placeholder: "Search...",
|
|
3291
|
-
onClick: (
|
|
3330
|
+
onClick: (R) => R.stopPropagation(),
|
|
3292
3331
|
className: "metakyc-searchable-select-search w-full",
|
|
3293
3332
|
style: {
|
|
3294
3333
|
display: "block",
|
|
@@ -3296,18 +3335,18 @@ const Et = 280, en = ({
|
|
|
3296
3335
|
padding: "6px 8px",
|
|
3297
3336
|
fontSize: "13px",
|
|
3298
3337
|
borderRadius: "6px",
|
|
3299
|
-
border: `1px solid ${
|
|
3338
|
+
border: `1px solid ${pe}`,
|
|
3300
3339
|
backgroundColor: ve,
|
|
3301
3340
|
color: me,
|
|
3302
3341
|
outline: "none",
|
|
3303
3342
|
boxSizing: "border-box"
|
|
3304
3343
|
},
|
|
3305
|
-
onFocus: (
|
|
3344
|
+
onFocus: (R) => {
|
|
3306
3345
|
const te = getComputedStyle(document.documentElement), ye = te.getPropertyValue("--metakyc-input-border-focus").trim() || te.getPropertyValue("--metakyc-primary").trim() || "#2563eb";
|
|
3307
|
-
|
|
3346
|
+
R.currentTarget.style.backgroundColor = ve, 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`;
|
|
3308
3347
|
},
|
|
3309
|
-
onBlur: (
|
|
3310
|
-
|
|
3348
|
+
onBlur: (R) => {
|
|
3349
|
+
R.currentTarget.style.backgroundColor = ve, R.currentTarget.style.color = me, R.currentTarget.style.borderColor = pe, R.currentTarget.style.outline = "none", R.currentTarget.style.boxShadow = "none";
|
|
3311
3350
|
}
|
|
3312
3351
|
}
|
|
3313
3352
|
) }),
|
|
@@ -3321,31 +3360,31 @@ const Et = 280, en = ({
|
|
|
3321
3360
|
maxHeight: "208px",
|
|
3322
3361
|
overflowY: "auto"
|
|
3323
3362
|
},
|
|
3324
|
-
children: J.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: ke }, children: "No results" }) : J.map((
|
|
3325
|
-
const te =
|
|
3363
|
+
children: J.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: ke }, children: "No results" }) : J.map((R) => {
|
|
3364
|
+
const te = R.value === s;
|
|
3326
3365
|
return /* @__PURE__ */ r(
|
|
3327
3366
|
"li",
|
|
3328
3367
|
{
|
|
3329
3368
|
className: "metakyc-searchable-select-option",
|
|
3330
|
-
onClick: () => Y(
|
|
3369
|
+
onClick: () => Y(R.value, R.disabled),
|
|
3331
3370
|
style: {
|
|
3332
3371
|
padding: "8px 12px",
|
|
3333
3372
|
fontSize: "13px",
|
|
3334
|
-
cursor:
|
|
3335
|
-
opacity:
|
|
3373
|
+
cursor: R.disabled ? "not-allowed" : "pointer",
|
|
3374
|
+
opacity: R.disabled ? 0.4 : 1,
|
|
3336
3375
|
backgroundColor: te ? U : "transparent",
|
|
3337
3376
|
color: te ? F : me,
|
|
3338
3377
|
userSelect: "none"
|
|
3339
3378
|
},
|
|
3340
3379
|
onMouseEnter: (ye) => {
|
|
3341
|
-
!te && !
|
|
3380
|
+
!te && !R.disabled && (ye.currentTarget.style.backgroundColor = B);
|
|
3342
3381
|
},
|
|
3343
3382
|
onMouseLeave: (ye) => {
|
|
3344
3383
|
te || (ye.currentTarget.style.backgroundColor = "transparent");
|
|
3345
3384
|
},
|
|
3346
|
-
children:
|
|
3385
|
+
children: R.label
|
|
3347
3386
|
},
|
|
3348
|
-
|
|
3387
|
+
R.value
|
|
3349
3388
|
);
|
|
3350
3389
|
})
|
|
3351
3390
|
}
|
|
@@ -3353,13 +3392,13 @@ const Et = 280, en = ({
|
|
|
3353
3392
|
]
|
|
3354
3393
|
}
|
|
3355
3394
|
);
|
|
3356
|
-
return /* @__PURE__ */
|
|
3395
|
+
return /* @__PURE__ */ o(
|
|
3357
3396
|
"div",
|
|
3358
3397
|
{
|
|
3359
|
-
className: Ae("w-full metakyc-searchable-select",
|
|
3398
|
+
className: Ae("w-full metakyc-searchable-select", b),
|
|
3360
3399
|
ref: K,
|
|
3361
3400
|
children: [
|
|
3362
|
-
e && /* @__PURE__ */
|
|
3401
|
+
e && /* @__PURE__ */ o(
|
|
3363
3402
|
"label",
|
|
3364
3403
|
{
|
|
3365
3404
|
className: "block text-sm font-medium mb-1",
|
|
@@ -3370,15 +3409,15 @@ const Et = 280, en = ({
|
|
|
3370
3409
|
]
|
|
3371
3410
|
}
|
|
3372
3411
|
),
|
|
3373
|
-
/* @__PURE__ */
|
|
3412
|
+
/* @__PURE__ */ o(
|
|
3374
3413
|
"div",
|
|
3375
3414
|
{
|
|
3376
3415
|
ref: ee,
|
|
3377
3416
|
role: "button",
|
|
3378
3417
|
tabIndex: P ? -1 : 0,
|
|
3379
3418
|
onClick: _,
|
|
3380
|
-
onKeyDown: (
|
|
3381
|
-
(
|
|
3419
|
+
onKeyDown: (R) => {
|
|
3420
|
+
(R.key === "Enter" || R.key === " ") && (R.preventDefault(), _()), R.key === "Escape" && G();
|
|
3382
3421
|
},
|
|
3383
3422
|
className: Ae(
|
|
3384
3423
|
"metakyc-searchable-select-trigger",
|
|
@@ -3389,14 +3428,14 @@ const Et = 280, en = ({
|
|
|
3389
3428
|
),
|
|
3390
3429
|
style: {
|
|
3391
3430
|
backgroundColor: "var(--metakyc-input-bg, #ffffff)",
|
|
3392
|
-
color:
|
|
3431
|
+
color: ie ? "var(--metakyc-input-text, var(--metakyc-text-primary, #111827))" : "var(--metakyc-input-placeholder, var(--metakyc-text-muted, #9ca3af))",
|
|
3393
3432
|
borderColor: t ? "var(--metakyc-danger, #ef4444)" : v ? "var(--metakyc-input-border-focus, var(--metakyc-primary, #2563eb))" : "var(--metakyc-input-border, var(--metakyc-border, #d1d5db))",
|
|
3394
3433
|
minHeight: "38px",
|
|
3395
3434
|
outline: v ? "2px solid var(--metakyc-input-border-focus, var(--metakyc-primary, #2563eb))" : "none",
|
|
3396
3435
|
outlineOffset: "-1px"
|
|
3397
3436
|
},
|
|
3398
3437
|
children: [
|
|
3399
|
-
/* @__PURE__ */ r("span", { className: "truncate flex-1", children:
|
|
3438
|
+
/* @__PURE__ */ r("span", { className: "truncate flex-1", children: ie || i }),
|
|
3400
3439
|
/* @__PURE__ */ r(
|
|
3401
3440
|
"span",
|
|
3402
3441
|
{
|
|
@@ -3426,22 +3465,22 @@ const rn = ({
|
|
|
3426
3465
|
error: n,
|
|
3427
3466
|
accept: a,
|
|
3428
3467
|
multiple: i = !1,
|
|
3429
|
-
maxSize:
|
|
3468
|
+
maxSize: s,
|
|
3430
3469
|
required: c,
|
|
3431
3470
|
onChange: d,
|
|
3432
3471
|
value: y = [],
|
|
3433
3472
|
className: p
|
|
3434
3473
|
}) => {
|
|
3435
|
-
const [
|
|
3474
|
+
const [b, P] = k(!1), [v, A] = k(null), T = de(null), w = ae((E) => {
|
|
3436
3475
|
if (!E) return;
|
|
3437
3476
|
A(null);
|
|
3438
3477
|
const g = Array.from(E);
|
|
3439
|
-
if (
|
|
3440
|
-
A(`File exceeds the maximum size of ${xt(
|
|
3478
|
+
if (s && g.filter((V) => V.size > s).length > 0) {
|
|
3479
|
+
A(`File exceeds the maximum size of ${xt(s)}`);
|
|
3441
3480
|
return;
|
|
3442
3481
|
}
|
|
3443
3482
|
d == null || d(i ? [...y, ...g] : [g[0]]);
|
|
3444
|
-
}, [
|
|
3483
|
+
}, [s, i, d, y]), N = ae((E) => {
|
|
3445
3484
|
E.preventDefault(), E.stopPropagation(), P(!0);
|
|
3446
3485
|
}, []), z = ae((E) => {
|
|
3447
3486
|
E.preventDefault(), E.stopPropagation(), P(!1);
|
|
@@ -3455,9 +3494,9 @@ const rn = ({
|
|
|
3455
3494
|
const g = y.filter(($, V) => V !== E);
|
|
3456
3495
|
d == null || d(g);
|
|
3457
3496
|
}, K = n || v, ee = y.length > 0;
|
|
3458
|
-
return /* @__PURE__ */
|
|
3459
|
-
e && /* @__PURE__ */
|
|
3460
|
-
/* @__PURE__ */
|
|
3497
|
+
return /* @__PURE__ */ o("div", { className: Ae("metakyc-file-upload", p), style: { width: "100%" }, children: [
|
|
3498
|
+
e && /* @__PURE__ */ o("div", { style: { marginBottom: "8px" }, children: [
|
|
3499
|
+
/* @__PURE__ */ o(
|
|
3461
3500
|
"label",
|
|
3462
3501
|
{
|
|
3463
3502
|
style: {
|
|
@@ -3474,7 +3513,7 @@ const rn = ({
|
|
|
3474
3513
|
),
|
|
3475
3514
|
t && /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "2px" }, children: t })
|
|
3476
3515
|
] }),
|
|
3477
|
-
/* @__PURE__ */
|
|
3516
|
+
/* @__PURE__ */ o(
|
|
3478
3517
|
"div",
|
|
3479
3518
|
{
|
|
3480
3519
|
className: "metakyc-file-dropzone",
|
|
@@ -3483,13 +3522,13 @@ const rn = ({
|
|
|
3483
3522
|
onDragLeave: z,
|
|
3484
3523
|
onDrop: Q,
|
|
3485
3524
|
style: {
|
|
3486
|
-
border: `2px dashed ${K ? "var(--metakyc-danger, #ef4444)" :
|
|
3525
|
+
border: `2px dashed ${K ? "var(--metakyc-danger, #ef4444)" : b ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #d1d5db)"}`,
|
|
3487
3526
|
borderRadius: "12px",
|
|
3488
3527
|
padding: ee ? "20px" : "32px 20px",
|
|
3489
3528
|
textAlign: "center",
|
|
3490
3529
|
cursor: "pointer",
|
|
3491
3530
|
transition: "all 0.2s ease",
|
|
3492
|
-
backgroundColor:
|
|
3531
|
+
backgroundColor: b ? "color-mix(in srgb, var(--metakyc-primary, #2563eb) 5%, var(--metakyc-background, #ffffff))" : "var(--metakyc-background, #ffffff)"
|
|
3493
3532
|
},
|
|
3494
3533
|
children: [
|
|
3495
3534
|
/* @__PURE__ */ r(
|
|
@@ -3505,7 +3544,7 @@ const rn = ({
|
|
|
3505
3544
|
}
|
|
3506
3545
|
}
|
|
3507
3546
|
),
|
|
3508
|
-
/* @__PURE__ */
|
|
3547
|
+
/* @__PURE__ */ o("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", gap: "12px" }, children: [
|
|
3509
3548
|
/* @__PURE__ */ r(
|
|
3510
3549
|
"div",
|
|
3511
3550
|
{
|
|
@@ -3516,17 +3555,17 @@ const rn = ({
|
|
|
3516
3555
|
display: "flex",
|
|
3517
3556
|
alignItems: "center",
|
|
3518
3557
|
justifyContent: "center",
|
|
3519
|
-
backgroundColor:
|
|
3558
|
+
backgroundColor: b ? "color-mix(in srgb, var(--metakyc-primary, #2563eb) 15%, transparent)" : "var(--metakyc-surface, #f9fafb)",
|
|
3520
3559
|
transition: "background-color 0.2s ease"
|
|
3521
3560
|
},
|
|
3522
|
-
children: /* @__PURE__ */
|
|
3561
|
+
children: /* @__PURE__ */ o(
|
|
3523
3562
|
"svg",
|
|
3524
3563
|
{
|
|
3525
3564
|
width: "24",
|
|
3526
3565
|
height: "24",
|
|
3527
3566
|
viewBox: "0 0 24 24",
|
|
3528
3567
|
fill: "none",
|
|
3529
|
-
stroke:
|
|
3568
|
+
stroke: b ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-text-muted, #9ca3af)",
|
|
3530
3569
|
strokeWidth: "2",
|
|
3531
3570
|
strokeLinecap: "round",
|
|
3532
3571
|
strokeLinejoin: "round",
|
|
@@ -3540,18 +3579,18 @@ const rn = ({
|
|
|
3540
3579
|
)
|
|
3541
3580
|
}
|
|
3542
3581
|
),
|
|
3543
|
-
/* @__PURE__ */
|
|
3544
|
-
/* @__PURE__ */
|
|
3582
|
+
/* @__PURE__ */ o("div", { children: [
|
|
3583
|
+
/* @__PURE__ */ o("p", { style: { fontSize: "14px", color: "var(--metakyc-text-secondary, #6b7280)", margin: 0 }, children: [
|
|
3545
3584
|
/* @__PURE__ */ r("span", { style: { fontWeight: 600, color: "var(--metakyc-primary, #2563eb)" }, children: "Click to upload" }),
|
|
3546
3585
|
" ",
|
|
3547
3586
|
"or drag and drop"
|
|
3548
3587
|
] }),
|
|
3549
|
-
(a ||
|
|
3588
|
+
(a || s) && /* @__PURE__ */ o("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "4px" }, children: [
|
|
3550
3589
|
a && /* @__PURE__ */ r("span", { children: a }),
|
|
3551
|
-
a &&
|
|
3552
|
-
|
|
3590
|
+
a && s && /* @__PURE__ */ r("span", { children: " · " }),
|
|
3591
|
+
s && /* @__PURE__ */ o("span", { children: [
|
|
3553
3592
|
"Max ",
|
|
3554
|
-
xt(
|
|
3593
|
+
xt(s)
|
|
3555
3594
|
] })
|
|
3556
3595
|
] })
|
|
3557
3596
|
] })
|
|
@@ -3561,7 +3600,7 @@ const rn = ({
|
|
|
3561
3600
|
),
|
|
3562
3601
|
ee && /* @__PURE__ */ r("div", { style: { marginTop: "12px", display: "flex", flexDirection: "column", gap: "8px" }, children: y.map((E, g) => {
|
|
3563
3602
|
const $ = tn(E), V = $ === "image", G = V ? URL.createObjectURL(E) : null;
|
|
3564
|
-
return /* @__PURE__ */
|
|
3603
|
+
return /* @__PURE__ */ o(
|
|
3565
3604
|
"div",
|
|
3566
3605
|
{
|
|
3567
3606
|
className: "metakyc-file-item",
|
|
@@ -3597,19 +3636,19 @@ const rn = ({
|
|
|
3597
3636
|
alt: E.name,
|
|
3598
3637
|
style: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "8px" }
|
|
3599
3638
|
}
|
|
3600
|
-
) : $ === "pdf" ? /* @__PURE__ */
|
|
3639
|
+
) : $ === "pdf" ? /* @__PURE__ */ o("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "var(--metakyc-danger, #ef4444)", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
3601
3640
|
/* @__PURE__ */ r("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
3602
3641
|
/* @__PURE__ */ r("polyline", { points: "14 2 14 8 20 8" }),
|
|
3603
3642
|
/* @__PURE__ */ r("line", { x1: "16", y1: "13", x2: "8", y2: "13" }),
|
|
3604
3643
|
/* @__PURE__ */ r("line", { x1: "16", y1: "17", x2: "8", y2: "17" }),
|
|
3605
3644
|
/* @__PURE__ */ r("polyline", { points: "10 9 9 9 8 9" })
|
|
3606
|
-
] }) : /* @__PURE__ */
|
|
3645
|
+
] }) : /* @__PURE__ */ o("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "var(--metakyc-primary, #2563eb)", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
3607
3646
|
/* @__PURE__ */ r("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
3608
3647
|
/* @__PURE__ */ r("polyline", { points: "14 2 14 8 20 8" })
|
|
3609
3648
|
] })
|
|
3610
3649
|
}
|
|
3611
3650
|
),
|
|
3612
|
-
/* @__PURE__ */
|
|
3651
|
+
/* @__PURE__ */ o("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
3613
3652
|
/* @__PURE__ */ r("p", { style: {
|
|
3614
3653
|
fontSize: "13px",
|
|
3615
3654
|
fontWeight: 500,
|
|
@@ -3649,7 +3688,7 @@ const rn = ({
|
|
|
3649
3688
|
onMouseLeave: (_) => {
|
|
3650
3689
|
_.currentTarget.style.backgroundColor = "transparent", _.currentTarget.style.color = "var(--metakyc-text-muted, #9ca3af)";
|
|
3651
3690
|
},
|
|
3652
|
-
children: /* @__PURE__ */
|
|
3691
|
+
children: /* @__PURE__ */ o("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
3653
3692
|
/* @__PURE__ */ r("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
3654
3693
|
/* @__PURE__ */ r("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
3655
3694
|
] })
|
|
@@ -3663,8 +3702,8 @@ const rn = ({
|
|
|
3663
3702
|
K && /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", marginTop: "6px" }, children: K })
|
|
3664
3703
|
] });
|
|
3665
3704
|
}, nn = yt(
|
|
3666
|
-
({ countryCode: e = "+1", onCountryCodeChange: t, className: n, ...a }, i) => /* @__PURE__ */
|
|
3667
|
-
a.label && /* @__PURE__ */
|
|
3705
|
+
({ countryCode: e = "+1", onCountryCodeChange: t, className: n, ...a }, i) => /* @__PURE__ */ o("div", { className: "w-full", children: [
|
|
3706
|
+
a.label && /* @__PURE__ */ o(
|
|
3668
3707
|
"label",
|
|
3669
3708
|
{
|
|
3670
3709
|
className: "block text-sm font-medium mb-1",
|
|
@@ -3675,13 +3714,13 @@ const rn = ({
|
|
|
3675
3714
|
]
|
|
3676
3715
|
}
|
|
3677
3716
|
),
|
|
3678
|
-
/* @__PURE__ */
|
|
3717
|
+
/* @__PURE__ */ o("div", { className: "flex gap-2", children: [
|
|
3679
3718
|
/* @__PURE__ */ r(
|
|
3680
3719
|
"input",
|
|
3681
3720
|
{
|
|
3682
3721
|
type: "text",
|
|
3683
3722
|
value: e,
|
|
3684
|
-
onChange: (
|
|
3723
|
+
onChange: (s) => t == null ? void 0 : t(s.target.value),
|
|
3685
3724
|
className: Ae(
|
|
3686
3725
|
"w-20 rounded-lg border px-3 py-2 text-sm",
|
|
3687
3726
|
"focus:outline-none focus:ring-2 focus:ring-offset-0"
|
|
@@ -3730,7 +3769,7 @@ const an = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
|
3730
3769
|
* This source code is licensed under the ISC license.
|
|
3731
3770
|
* See the LICENSE file in the root directory of this source tree.
|
|
3732
3771
|
*/
|
|
3733
|
-
const
|
|
3772
|
+
const on = (e) => e.replace(
|
|
3734
3773
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
3735
3774
|
(t, n, a) => a ? a.toUpperCase() : n.toLowerCase()
|
|
3736
3775
|
);
|
|
@@ -3741,7 +3780,7 @@ const sn = (e) => e.replace(
|
|
|
3741
3780
|
* See the LICENSE file in the root directory of this source tree.
|
|
3742
3781
|
*/
|
|
3743
3782
|
const At = (e) => {
|
|
3744
|
-
const t =
|
|
3783
|
+
const t = on(e);
|
|
3745
3784
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
3746
3785
|
};
|
|
3747
3786
|
/**
|
|
@@ -3750,7 +3789,7 @@ const At = (e) => {
|
|
|
3750
3789
|
* This source code is licensed under the ISC license.
|
|
3751
3790
|
* See the LICENSE file in the root directory of this source tree.
|
|
3752
3791
|
*/
|
|
3753
|
-
var
|
|
3792
|
+
var sn = {
|
|
3754
3793
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3755
3794
|
width: 24,
|
|
3756
3795
|
height: 24,
|
|
@@ -3786,25 +3825,25 @@ const cn = yt(
|
|
|
3786
3825
|
strokeWidth: n = 2,
|
|
3787
3826
|
absoluteStrokeWidth: a,
|
|
3788
3827
|
className: i = "",
|
|
3789
|
-
children:
|
|
3828
|
+
children: s,
|
|
3790
3829
|
iconNode: c,
|
|
3791
3830
|
...d
|
|
3792
3831
|
}, y) => wt(
|
|
3793
3832
|
"svg",
|
|
3794
3833
|
{
|
|
3795
3834
|
ref: y,
|
|
3796
|
-
...
|
|
3835
|
+
...sn,
|
|
3797
3836
|
width: t,
|
|
3798
3837
|
height: t,
|
|
3799
3838
|
stroke: e,
|
|
3800
3839
|
strokeWidth: a ? Number(n) * 24 / Number(t) : n,
|
|
3801
3840
|
className: Bt("lucide", i),
|
|
3802
|
-
...!
|
|
3841
|
+
...!s && !ln(d) && { "aria-hidden": "true" },
|
|
3803
3842
|
...d
|
|
3804
3843
|
},
|
|
3805
3844
|
[
|
|
3806
|
-
...c.map(([p,
|
|
3807
|
-
...Array.isArray(
|
|
3845
|
+
...c.map(([p, b]) => wt(p, b)),
|
|
3846
|
+
...Array.isArray(s) ? s : [s]
|
|
3808
3847
|
]
|
|
3809
3848
|
)
|
|
3810
3849
|
);
|
|
@@ -3816,8 +3855,8 @@ const cn = yt(
|
|
|
3816
3855
|
*/
|
|
3817
3856
|
const _t = (e, t) => {
|
|
3818
3857
|
const n = yt(
|
|
3819
|
-
({ className: a, ...i },
|
|
3820
|
-
ref:
|
|
3858
|
+
({ className: a, ...i }, s) => wt(cn, {
|
|
3859
|
+
ref: s,
|
|
3821
3860
|
iconNode: t,
|
|
3822
3861
|
className: Bt(
|
|
3823
3862
|
`lucide-${an(At(e))}`,
|
|
@@ -3874,7 +3913,7 @@ function pn(e, t) {
|
|
|
3874
3913
|
}
|
|
3875
3914
|
function mn(e) {
|
|
3876
3915
|
const t = e.flatMap(
|
|
3877
|
-
(a, i) => (a.questions ?? []).map((
|
|
3916
|
+
(a, i) => (a.questions ?? []).map((s, c) => ({ question: s, groupIndex: i, qIdx: c }))
|
|
3878
3917
|
), n = /* @__PURE__ */ new Map();
|
|
3879
3918
|
for (const a of t) {
|
|
3880
3919
|
const i = a.question.pageNumber != null && a.question.pageNumber > 0 ? a.question.pageNumber : 1;
|
|
@@ -3887,15 +3926,15 @@ const yn = ({
|
|
|
3887
3926
|
onComplete: t,
|
|
3888
3927
|
onBack: n
|
|
3889
3928
|
}) => {
|
|
3890
|
-
const { questionnaire: a, initialAnswers: i, isLoading:
|
|
3929
|
+
const { questionnaire: a, initialAnswers: i, isLoading: s, isSubmitting: c, error: d, submit: y } = Vr(e), [p, b] = k({}), [P, v] = k({}), [A, T] = k(0);
|
|
3891
3930
|
we.useEffect(() => {
|
|
3892
|
-
i && Object.keys(i).length > 0 && Object.keys(p).length === 0 &&
|
|
3931
|
+
i && Object.keys(i).length > 0 && Object.keys(p).length === 0 && b(i);
|
|
3893
3932
|
}, [i]);
|
|
3894
3933
|
const w = De(
|
|
3895
3934
|
() => a ? mn(a.questionGroups) : [],
|
|
3896
3935
|
[a]
|
|
3897
3936
|
), N = A === w.length - 1, z = w[A] ?? [], Q = ae((E, g) => {
|
|
3898
|
-
|
|
3937
|
+
b(($) => ({ ...$, [E]: g })), v(($) => {
|
|
3899
3938
|
const V = { ...$ };
|
|
3900
3939
|
return delete V[E], V;
|
|
3901
3940
|
});
|
|
@@ -3928,15 +3967,15 @@ const yn = ({
|
|
|
3928
3967
|
console.error("Questionnaire submit error:", E);
|
|
3929
3968
|
}
|
|
3930
3969
|
};
|
|
3931
|
-
return
|
|
3970
|
+
return s ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ r(Me, { className: "my-8" }) }) }) : d ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
3932
3971
|
"Error loading questionnaire: ",
|
|
3933
3972
|
d.message
|
|
3934
|
-
] }) }) }) : a ? /* @__PURE__ */
|
|
3935
|
-
/* @__PURE__ */
|
|
3973
|
+
] }) }) }) : a ? /* @__PURE__ */ o(re, { children: [
|
|
3974
|
+
/* @__PURE__ */ o(Se, { children: [
|
|
3936
3975
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: a.displayName }),
|
|
3937
3976
|
a.subtitle && /* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: a.subtitle }),
|
|
3938
|
-
w.length > 1 && /* @__PURE__ */
|
|
3939
|
-
/* @__PURE__ */
|
|
3977
|
+
w.length > 1 && /* @__PURE__ */ o("div", { className: "flex items-center justify-between mt-3", children: [
|
|
3978
|
+
/* @__PURE__ */ o("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
|
|
3940
3979
|
"Page ",
|
|
3941
3980
|
A + 1,
|
|
3942
3981
|
" of ",
|
|
@@ -3966,8 +4005,8 @@ const yn = ({
|
|
|
3966
4005
|
},
|
|
3967
4006
|
E.id
|
|
3968
4007
|
)) }),
|
|
3969
|
-
/* @__PURE__ */
|
|
3970
|
-
/* @__PURE__ */
|
|
4008
|
+
/* @__PURE__ */ o(Ce, { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
|
|
4009
|
+
/* @__PURE__ */ o(
|
|
3971
4010
|
Z,
|
|
3972
4011
|
{
|
|
3973
4012
|
type: "button",
|
|
@@ -3988,7 +4027,7 @@ const yn = ({
|
|
|
3988
4027
|
onClick: ee,
|
|
3989
4028
|
children: "Continue"
|
|
3990
4029
|
}
|
|
3991
|
-
) : /* @__PURE__ */
|
|
4030
|
+
) : /* @__PURE__ */ o(
|
|
3992
4031
|
Z,
|
|
3993
4032
|
{
|
|
3994
4033
|
type: "button",
|
|
@@ -4005,15 +4044,15 @@ const yn = ({
|
|
|
4005
4044
|
] }) : null;
|
|
4006
4045
|
}, hn = ({ question: e, value: t, error: n, onChange: a }) => {
|
|
4007
4046
|
var c;
|
|
4008
|
-
const
|
|
4009
|
-
return /* @__PURE__ */
|
|
4010
|
-
/* @__PURE__ */
|
|
4047
|
+
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";
|
|
4048
|
+
return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
4049
|
+
/* @__PURE__ */ o("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: [
|
|
4011
4050
|
e.text,
|
|
4012
4051
|
e.isRequired && /* @__PURE__ */ r("span", { className: "text-danger-500 ml-1", children: "*" })
|
|
4013
4052
|
] }),
|
|
4014
4053
|
e.subtitle && /* @__PURE__ */ r("p", { className: "text-xs", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: e.subtitle }),
|
|
4015
4054
|
e.description && /* @__PURE__ */ r("p", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: e.description }),
|
|
4016
|
-
|
|
4055
|
+
s === "text" && /* @__PURE__ */ r(
|
|
4017
4056
|
xe,
|
|
4018
4057
|
{
|
|
4019
4058
|
value: t[0] ?? "",
|
|
@@ -4023,7 +4062,7 @@ const yn = ({
|
|
|
4023
4062
|
required: e.isRequired
|
|
4024
4063
|
}
|
|
4025
4064
|
),
|
|
4026
|
-
|
|
4065
|
+
s === "single-select" && /* @__PURE__ */ r(
|
|
4027
4066
|
Ct,
|
|
4028
4067
|
{
|
|
4029
4068
|
value: t[0] ?? "",
|
|
@@ -4034,8 +4073,8 @@ const yn = ({
|
|
|
4034
4073
|
required: e.isRequired
|
|
4035
4074
|
}
|
|
4036
4075
|
),
|
|
4037
|
-
|
|
4038
|
-
(e.defaultAnswers ?? []).map((d) => /* @__PURE__ */
|
|
4076
|
+
s === "radio" && /* @__PURE__ */ o("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
|
|
4077
|
+
(e.defaultAnswers ?? []).map((d) => /* @__PURE__ */ o(
|
|
4039
4078
|
"label",
|
|
4040
4079
|
{
|
|
4041
4080
|
className: "metakyc-option-label",
|
|
@@ -4070,8 +4109,8 @@ const yn = ({
|
|
|
4070
4109
|
)),
|
|
4071
4110
|
n && /* @__PURE__ */ r("p", { className: "text-sm text-danger-500", children: n })
|
|
4072
4111
|
] }),
|
|
4073
|
-
(
|
|
4074
|
-
(e.defaultAnswers ?? []).map((d) => /* @__PURE__ */
|
|
4112
|
+
(s === "checkbox" || s === "multi-select") && /* @__PURE__ */ o("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
|
|
4113
|
+
(e.defaultAnswers ?? []).map((d) => /* @__PURE__ */ o(
|
|
4075
4114
|
"label",
|
|
4076
4115
|
{
|
|
4077
4116
|
className: "metakyc-option-label",
|
|
@@ -4108,7 +4147,7 @@ const yn = ({
|
|
|
4108
4147
|
)),
|
|
4109
4148
|
n && /* @__PURE__ */ r("p", { className: "text-sm text-danger-500", children: n })
|
|
4110
4149
|
] }),
|
|
4111
|
-
n &&
|
|
4150
|
+
n && s === "text" && null
|
|
4112
4151
|
] });
|
|
4113
4152
|
};
|
|
4114
4153
|
function fn(e) {
|
|
@@ -4124,7 +4163,7 @@ const gn = ({
|
|
|
4124
4163
|
onComplete: t,
|
|
4125
4164
|
onBack: n
|
|
4126
4165
|
}) => {
|
|
4127
|
-
const { uploadDocument: a, isLoading: i, isSubmitting:
|
|
4166
|
+
const { uploadDocument: a, isLoading: i, isSubmitting: s, error: c, submit: d } = Yr(e), [y, p] = k({}), [b, P] = k(null), [v, A] = k(0), [T, w] = k({}), N = De(
|
|
4128
4167
|
() => a ? fn(a.uploadDocumentFiles) : [],
|
|
4129
4168
|
[a]
|
|
4130
4169
|
), z = N[v] ?? [], Q = v === N.length - 1, M = N.length, j = ae(() => {
|
|
@@ -4164,10 +4203,10 @@ const gn = ({
|
|
|
4164
4203
|
}
|
|
4165
4204
|
}
|
|
4166
4205
|
};
|
|
4167
|
-
return i ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */
|
|
4206
|
+
return i ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ o("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", padding: "48px 0", gap: "16px" }, children: [
|
|
4168
4207
|
/* @__PURE__ */ r(Me, { className: "my-8" }),
|
|
4169
4208
|
/* @__PURE__ */ r("p", { style: { fontSize: "14px", color: "var(--metakyc-text-muted, #9ca3af)" }, children: "Loading document requirements..." })
|
|
4170
|
-
] }) }) }) : c ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */
|
|
4209
|
+
] }) }) }) : c ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ o("div", { style: {
|
|
4171
4210
|
display: "flex",
|
|
4172
4211
|
flexDirection: "column",
|
|
4173
4212
|
alignItems: "center",
|
|
@@ -4183,15 +4222,15 @@ const gn = ({
|
|
|
4183
4222
|
display: "flex",
|
|
4184
4223
|
alignItems: "center",
|
|
4185
4224
|
justifyContent: "center"
|
|
4186
|
-
}, children: /* @__PURE__ */
|
|
4225
|
+
}, children: /* @__PURE__ */ o("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "var(--metakyc-danger, #ef4444)", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
4187
4226
|
/* @__PURE__ */ r("circle", { cx: "12", cy: "12", r: "10" }),
|
|
4188
4227
|
/* @__PURE__ */ r("line", { x1: "15", y1: "9", x2: "9", y2: "15" }),
|
|
4189
4228
|
/* @__PURE__ */ r("line", { x1: "9", y1: "9", x2: "15", y2: "15" })
|
|
4190
4229
|
] }) }),
|
|
4191
4230
|
/* @__PURE__ */ r("p", { style: { fontSize: "14px", color: "var(--metakyc-danger, #ef4444)", fontWeight: 500 }, children: "Error loading document requirements" }),
|
|
4192
4231
|
/* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-text-muted, #9ca3af)" }, children: c.message })
|
|
4193
|
-
] }) }) }) : a ? /* @__PURE__ */
|
|
4194
|
-
/* @__PURE__ */
|
|
4232
|
+
] }) }) }) : a ? /* @__PURE__ */ o(re, { children: [
|
|
4233
|
+
/* @__PURE__ */ o(Se, { children: [
|
|
4195
4234
|
/* @__PURE__ */ r("h2", { style: {
|
|
4196
4235
|
fontSize: "18px",
|
|
4197
4236
|
fontWeight: 700,
|
|
@@ -4203,13 +4242,13 @@ const gn = ({
|
|
|
4203
4242
|
color: "var(--metakyc-text-secondary, #6b7280)",
|
|
4204
4243
|
marginTop: "4px"
|
|
4205
4244
|
}, children: a.subtitle }),
|
|
4206
|
-
M > 1 && /* @__PURE__ */
|
|
4245
|
+
M > 1 && /* @__PURE__ */ o("div", { style: {
|
|
4207
4246
|
display: "flex",
|
|
4208
4247
|
alignItems: "center",
|
|
4209
4248
|
justifyContent: "space-between",
|
|
4210
4249
|
marginTop: "12px"
|
|
4211
4250
|
}, children: [
|
|
4212
|
-
/* @__PURE__ */
|
|
4251
|
+
/* @__PURE__ */ o("span", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
|
|
4213
4252
|
"Page ",
|
|
4214
4253
|
v + 1,
|
|
4215
4254
|
" of ",
|
|
@@ -4230,7 +4269,7 @@ const gn = ({
|
|
|
4230
4269
|
)) })
|
|
4231
4270
|
] })
|
|
4232
4271
|
] }),
|
|
4233
|
-
a.description && v === 0 && /* @__PURE__ */
|
|
4272
|
+
a.description && v === 0 && /* @__PURE__ */ o("div", { style: {
|
|
4234
4273
|
margin: "0 24px",
|
|
4235
4274
|
marginTop: "4px",
|
|
4236
4275
|
display: "flex",
|
|
@@ -4240,7 +4279,7 @@ const gn = ({
|
|
|
4240
4279
|
backgroundColor: "color-mix(in srgb, var(--metakyc-primary, #2563eb) 5%, var(--metakyc-background, #ffffff))",
|
|
4241
4280
|
border: "1px solid color-mix(in srgb, var(--metakyc-primary, #2563eb) 15%, transparent)"
|
|
4242
4281
|
}, children: [
|
|
4243
|
-
/* @__PURE__ */
|
|
4282
|
+
/* @__PURE__ */ o(
|
|
4244
4283
|
"svg",
|
|
4245
4284
|
{
|
|
4246
4285
|
width: "18",
|
|
@@ -4286,7 +4325,7 @@ const gn = ({
|
|
|
4286
4325
|
},
|
|
4287
4326
|
g.id
|
|
4288
4327
|
)) }) }),
|
|
4289
|
-
|
|
4328
|
+
b && /* @__PURE__ */ o("div", { style: {
|
|
4290
4329
|
margin: "0 24px",
|
|
4291
4330
|
padding: "10px 14px",
|
|
4292
4331
|
borderRadius: "8px",
|
|
@@ -4296,14 +4335,14 @@ const gn = ({
|
|
|
4296
4335
|
alignItems: "center",
|
|
4297
4336
|
gap: "8px"
|
|
4298
4337
|
}, children: [
|
|
4299
|
-
/* @__PURE__ */
|
|
4338
|
+
/* @__PURE__ */ o("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "var(--metakyc-danger, #ef4444)", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", style: { flexShrink: 0 }, children: [
|
|
4300
4339
|
/* @__PURE__ */ r("path", { d: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" }),
|
|
4301
4340
|
/* @__PURE__ */ r("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
|
|
4302
4341
|
/* @__PURE__ */ r("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
|
|
4303
4342
|
] }),
|
|
4304
|
-
/* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children:
|
|
4343
|
+
/* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children: b })
|
|
4305
4344
|
] }),
|
|
4306
|
-
/* @__PURE__ */ r(Ce, { children: /* @__PURE__ */
|
|
4345
|
+
/* @__PURE__ */ r(Ce, { children: /* @__PURE__ */ o("div", { style: {
|
|
4307
4346
|
display: "flex",
|
|
4308
4347
|
alignItems: "center",
|
|
4309
4348
|
justifyContent: "space-between",
|
|
@@ -4322,9 +4361,9 @@ const gn = ({
|
|
|
4322
4361
|
Z,
|
|
4323
4362
|
{
|
|
4324
4363
|
type: "button",
|
|
4325
|
-
isLoading:
|
|
4364
|
+
isLoading: s,
|
|
4326
4365
|
onClick: E,
|
|
4327
|
-
children:
|
|
4366
|
+
children: s ? "Uploading..." : "Continue"
|
|
4328
4367
|
}
|
|
4329
4368
|
) : /* @__PURE__ */ r(
|
|
4330
4369
|
Z,
|
|
@@ -4337,18 +4376,18 @@ const gn = ({
|
|
|
4337
4376
|
] }) })
|
|
4338
4377
|
] }) : null;
|
|
4339
4378
|
}, bn = ({ applicantId: e, onComplete: t, onBack: n }) => {
|
|
4340
|
-
const { overview: a, isLoading: i, isSubmitting:
|
|
4379
|
+
const { overview: a, isLoading: i, isSubmitting: s, error: c, passOverview: d } = Qr(e), y = async () => {
|
|
4341
4380
|
await d(), t == null || t();
|
|
4342
4381
|
};
|
|
4343
|
-
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__ */
|
|
4382
|
+
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: [
|
|
4344
4383
|
"Error loading overview: ",
|
|
4345
4384
|
c.message
|
|
4346
|
-
] }) }) }) : a ? /* @__PURE__ */
|
|
4347
|
-
/* @__PURE__ */
|
|
4385
|
+
] }) }) }) : a ? /* @__PURE__ */ o(re, { children: [
|
|
4386
|
+
/* @__PURE__ */ o(Se, { children: [
|
|
4348
4387
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: a.title || "Overview" }),
|
|
4349
4388
|
a.description && /* @__PURE__ */ r("p", { className: "mt-1", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: a.description })
|
|
4350
4389
|
] }),
|
|
4351
|
-
/* @__PURE__ */ r(ne, { className: "space-y-8", children: a.steps && a.steps.length > 0 ? a.steps.sort((p,
|
|
4390
|
+
/* @__PURE__ */ r(ne, { className: "space-y-8", children: a.steps && a.steps.length > 0 ? a.steps.sort((p, b) => p.order - b.order).map((p) => /* @__PURE__ */ o("div", { className: "metakyc-overview-step-item flex items-center space-x-3", children: [
|
|
4352
4391
|
/* @__PURE__ */ r("div", { className: "metakyc-step-icon flex-shrink-0", children: /* @__PURE__ */ r(
|
|
4353
4392
|
"div",
|
|
4354
4393
|
{
|
|
@@ -4357,7 +4396,7 @@ const gn = ({
|
|
|
4357
4396
|
children: p.order + 1
|
|
4358
4397
|
}
|
|
4359
4398
|
) }),
|
|
4360
|
-
/* @__PURE__ */
|
|
4399
|
+
/* @__PURE__ */ o(
|
|
4361
4400
|
"div",
|
|
4362
4401
|
{
|
|
4363
4402
|
className: "metakyc-step-content",
|
|
@@ -4374,9 +4413,9 @@ const gn = ({
|
|
|
4374
4413
|
}
|
|
4375
4414
|
)
|
|
4376
4415
|
] }, p.order)) : /* @__PURE__ */ r("div", { className: "text-center py-8", children: /* @__PURE__ */ r("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading overview data..." }) }) }),
|
|
4377
|
-
/* @__PURE__ */
|
|
4416
|
+
/* @__PURE__ */ o(Ce, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
4378
4417
|
n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
4379
|
-
/* @__PURE__ */ r(Z, { onClick: y, isLoading:
|
|
4418
|
+
/* @__PURE__ */ r(Z, { onClick: y, isLoading: s, children: "Continue" })
|
|
4380
4419
|
] })
|
|
4381
4420
|
] }) : null;
|
|
4382
4421
|
};
|
|
@@ -4415,11 +4454,11 @@ function wn(e, t) {
|
|
|
4415
4454
|
}
|
|
4416
4455
|
const i = e.valueDataType === Ke.Integer || e.valueDataType === Ke.Money || e.valueDataType === Ke.DigitOnly;
|
|
4417
4456
|
if (i && a.trim() !== "") {
|
|
4418
|
-
const
|
|
4419
|
-
if (!isNaN(
|
|
4420
|
-
if (e.min !== void 0 && e.min !== null &&
|
|
4457
|
+
const s = Number(a);
|
|
4458
|
+
if (!isNaN(s)) {
|
|
4459
|
+
if (e.min !== void 0 && e.min !== null && s < e.min)
|
|
4421
4460
|
return `Minimum value is ${e.min}`;
|
|
4422
|
-
if (e.max !== void 0 && e.max !== null &&
|
|
4461
|
+
if (e.max !== void 0 && e.max !== null && s > e.max)
|
|
4423
4462
|
return `Maximum value is ${e.max}`;
|
|
4424
4463
|
}
|
|
4425
4464
|
} else if (!i && a !== "") {
|
|
@@ -4446,21 +4485,21 @@ const Nn = ({
|
|
|
4446
4485
|
onComplete: t,
|
|
4447
4486
|
onBack: n
|
|
4448
4487
|
}) => {
|
|
4449
|
-
const { config: a } = Te(), i = a.locale ?? "en", { criteria:
|
|
4488
|
+
const { config: a } = Te(), i = a.locale ?? "en", { criteria: s, initialAnswers: c, isLoading: d, isSubmitting: y, error: p, submit: b } = Jr(e), [P, v] = k({}), [A, T] = k({}), [w, N] = k(0), [z, Q] = k(!1);
|
|
4450
4489
|
we.useEffect(() => {
|
|
4451
4490
|
c && Object.keys(c).length > 0 && Object.keys(P).length === 0 && v(c);
|
|
4452
4491
|
}, [c]);
|
|
4453
4492
|
const M = De(
|
|
4454
|
-
() =>
|
|
4455
|
-
[
|
|
4493
|
+
() => s && s.length > 0 ? Sn(s) : [],
|
|
4494
|
+
[s]
|
|
4456
4495
|
), j = w === M.length - 1, K = M[w] ?? [];
|
|
4457
4496
|
we.useEffect(() => {
|
|
4458
|
-
!d &&
|
|
4459
|
-
}, [d,
|
|
4497
|
+
!d && s && s.length === 0 && !z && !y && (Q(!0), b({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
|
|
4498
|
+
}, [d, s, z, y, b, e, t]);
|
|
4460
4499
|
const ee = ae((G, _) => {
|
|
4461
4500
|
v((J) => ({ ...J, [G]: _ })), T((J) => {
|
|
4462
|
-
const
|
|
4463
|
-
return delete
|
|
4501
|
+
const ie = { ...J };
|
|
4502
|
+
return delete ie[G], ie;
|
|
4464
4503
|
});
|
|
4465
4504
|
}, []), E = ae(() => {
|
|
4466
4505
|
const G = {};
|
|
@@ -4474,32 +4513,32 @@ const Nn = ({
|
|
|
4474
4513
|
}, $ = () => {
|
|
4475
4514
|
w > 0 ? N((G) => G - 1) : n == null || n();
|
|
4476
4515
|
}, V = async () => {
|
|
4477
|
-
if (!(!E() || !
|
|
4516
|
+
if (!(!E() || !s))
|
|
4478
4517
|
try {
|
|
4479
|
-
const G =
|
|
4480
|
-
const
|
|
4481
|
-
return
|
|
4518
|
+
const G = s.map((J) => {
|
|
4519
|
+
const ie = (P[J.id] ?? []).filter((Y) => Y && Y.trim());
|
|
4520
|
+
return ie.length > 0 ? { riskCriteriaId: J.id, values: ie } : null;
|
|
4482
4521
|
}).filter((J) => J !== null);
|
|
4483
|
-
await
|
|
4522
|
+
await b({ applicantId: e, criteriaValueInputs: G }), t == null || t();
|
|
4484
4523
|
} catch (G) {
|
|
4485
4524
|
console.error("Risk scoring submit error:", G);
|
|
4486
4525
|
}
|
|
4487
4526
|
};
|
|
4488
|
-
return d ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */
|
|
4527
|
+
return d ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ o(ne, { children: [
|
|
4489
4528
|
/* @__PURE__ */ r(Me, { className: "my-8" }),
|
|
4490
4529
|
/* @__PURE__ */ r("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading risk scoring criteria…" })
|
|
4491
|
-
] }) }) : !d &&
|
|
4530
|
+
] }) }) : !d && s && s.length === 0 ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ o(ne, { children: [
|
|
4492
4531
|
/* @__PURE__ */ r(Me, { className: "my-8" }),
|
|
4493
4532
|
/* @__PURE__ */ r("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "No criteria required. Moving to next step…" })
|
|
4494
|
-
] }) }) : p ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */
|
|
4533
|
+
] }) }) : p ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
4495
4534
|
"Error loading criteria: ",
|
|
4496
4535
|
p.message
|
|
4497
|
-
] }) }) }) :
|
|
4498
|
-
/* @__PURE__ */
|
|
4536
|
+
] }) }) }) : s ? /* @__PURE__ */ o(re, { children: [
|
|
4537
|
+
/* @__PURE__ */ o(Se, { children: [
|
|
4499
4538
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: "Risk Assessment" }),
|
|
4500
4539
|
/* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Please answer the following questions for risk evaluation" }),
|
|
4501
|
-
M.length > 1 && /* @__PURE__ */
|
|
4502
|
-
/* @__PURE__ */
|
|
4540
|
+
M.length > 1 && /* @__PURE__ */ o("div", { className: "flex items-center justify-between mt-3", children: [
|
|
4541
|
+
/* @__PURE__ */ o("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
|
|
4503
4542
|
"Page ",
|
|
4504
4543
|
w + 1,
|
|
4505
4544
|
" of ",
|
|
@@ -4520,7 +4559,7 @@ const Nn = ({
|
|
|
4520
4559
|
] })
|
|
4521
4560
|
] }),
|
|
4522
4561
|
/* @__PURE__ */ r(ne, { className: "space-y-6", children: K.map(({ criterion: G }) => /* @__PURE__ */ r(
|
|
4523
|
-
|
|
4562
|
+
In,
|
|
4524
4563
|
{
|
|
4525
4564
|
criterion: G,
|
|
4526
4565
|
value: P[G.id] ?? [],
|
|
@@ -4530,8 +4569,8 @@ const Nn = ({
|
|
|
4530
4569
|
},
|
|
4531
4570
|
G.id
|
|
4532
4571
|
)) }),
|
|
4533
|
-
/* @__PURE__ */
|
|
4534
|
-
/* @__PURE__ */
|
|
4572
|
+
/* @__PURE__ */ o(Ce, { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
|
|
4573
|
+
/* @__PURE__ */ o(
|
|
4535
4574
|
Z,
|
|
4536
4575
|
{
|
|
4537
4576
|
type: "button",
|
|
@@ -4544,7 +4583,7 @@ const Nn = ({
|
|
|
4544
4583
|
]
|
|
4545
4584
|
}
|
|
4546
4585
|
),
|
|
4547
|
-
j ? /* @__PURE__ */ r(Z, { type: "button", isLoading: y, onClick: V, children: "Continue" }) : /* @__PURE__ */
|
|
4586
|
+
j ? /* @__PURE__ */ r(Z, { type: "button", isLoading: y, onClick: V, children: "Continue" }) : /* @__PURE__ */ o(
|
|
4548
4587
|
Z,
|
|
4549
4588
|
{
|
|
4550
4589
|
type: "button",
|
|
@@ -4559,16 +4598,16 @@ const Nn = ({
|
|
|
4559
4598
|
] }),
|
|
4560
4599
|
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 }) })
|
|
4561
4600
|
] }) : null;
|
|
4562
|
-
},
|
|
4563
|
-
const
|
|
4564
|
-
return /* @__PURE__ */
|
|
4565
|
-
/* @__PURE__ */
|
|
4601
|
+
}, In = ({ criterion: e, value: t, error: n, locale: a, onChange: i }) => {
|
|
4602
|
+
const s = Cn(e), c = e.valueDataType === Ke.Integer || e.valueDataType === Ke.Money || e.valueDataType === Ke.DigitOnly, d = vn(e), y = (p) => d ? kn(p, a) : p;
|
|
4603
|
+
return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
4604
|
+
/* @__PURE__ */ o("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: [
|
|
4566
4605
|
e.displayName,
|
|
4567
4606
|
e.isRequired && /* @__PURE__ */ r("span", { className: "text-danger-500 ml-1", children: "*" })
|
|
4568
4607
|
] }),
|
|
4569
4608
|
e.description && /* @__PURE__ */ r("p", { className: "text-xs", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: e.description }),
|
|
4570
4609
|
c && (e.min !== void 0 || e.max !== void 0) && /* @__PURE__ */ r("p", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: e.min !== void 0 && e.max !== void 0 ? `Range: ${e.min} – ${e.max}` : e.min !== void 0 ? `Minimum: ${e.min}` : `Maximum: ${e.max}` }),
|
|
4571
|
-
|
|
4610
|
+
s === "text" && /* @__PURE__ */ r(
|
|
4572
4611
|
xe,
|
|
4573
4612
|
{
|
|
4574
4613
|
value: t[0] ?? "",
|
|
@@ -4584,8 +4623,8 @@ const Nn = ({
|
|
|
4584
4623
|
}
|
|
4585
4624
|
}
|
|
4586
4625
|
),
|
|
4587
|
-
|
|
4588
|
-
(e.defaultValues ?? []).map((p) => /* @__PURE__ */
|
|
4626
|
+
s === "radio" && /* @__PURE__ */ o("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
|
|
4627
|
+
(e.defaultValues ?? []).map((p) => /* @__PURE__ */ o(
|
|
4589
4628
|
"label",
|
|
4590
4629
|
{
|
|
4591
4630
|
className: "metakyc-option-label",
|
|
@@ -4620,8 +4659,8 @@ const Nn = ({
|
|
|
4620
4659
|
)),
|
|
4621
4660
|
n && /* @__PURE__ */ r("p", { className: "text-sm text-danger-500", children: n })
|
|
4622
4661
|
] }),
|
|
4623
|
-
|
|
4624
|
-
(e.defaultValues ?? []).map((p) => /* @__PURE__ */
|
|
4662
|
+
s === "checkbox" && /* @__PURE__ */ o("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
|
|
4663
|
+
(e.defaultValues ?? []).map((p) => /* @__PURE__ */ o(
|
|
4625
4664
|
"label",
|
|
4626
4665
|
{
|
|
4627
4666
|
className: "metakyc-option-label",
|
|
@@ -4632,8 +4671,8 @@ const Nn = ({
|
|
|
4632
4671
|
{
|
|
4633
4672
|
type: "checkbox",
|
|
4634
4673
|
checked: t.includes(p),
|
|
4635
|
-
onChange: (
|
|
4636
|
-
|
|
4674
|
+
onChange: (b) => {
|
|
4675
|
+
b.target.checked ? i([...t, p]) : i(t.filter((P) => P !== p));
|
|
4637
4676
|
},
|
|
4638
4677
|
className: "metakyc-option-input",
|
|
4639
4678
|
style: {
|
|
@@ -4658,7 +4697,7 @@ const Nn = ({
|
|
|
4658
4697
|
)),
|
|
4659
4698
|
n && /* @__PURE__ */ r("p", { className: "text-sm text-danger-500", children: n })
|
|
4660
4699
|
] }),
|
|
4661
|
-
|
|
4700
|
+
s === "country" && /* @__PURE__ */ r(
|
|
4662
4701
|
Ct,
|
|
4663
4702
|
{
|
|
4664
4703
|
value: t[0] ?? "",
|
|
@@ -4676,12 +4715,12 @@ const Nn = ({
|
|
|
4676
4715
|
}
|
|
4677
4716
|
)
|
|
4678
4717
|
] });
|
|
4679
|
-
},
|
|
4718
|
+
}, Rn = ({
|
|
4680
4719
|
applicantId: e,
|
|
4681
4720
|
onComplete: t,
|
|
4682
4721
|
onBack: n
|
|
4683
4722
|
}) => {
|
|
4684
|
-
const { investorCategorizationService: a } = Te(), [i,
|
|
4723
|
+
const { investorCategorizationService: a } = Te(), [i, s] = k(null), [c, d] = k(!1), [y, p] = k(null);
|
|
4685
4724
|
return /* @__PURE__ */ r("form", { onSubmit: async (P) => {
|
|
4686
4725
|
if (P.preventDefault(), i === null) {
|
|
4687
4726
|
p("Please select an investor type");
|
|
@@ -4701,12 +4740,12 @@ const Nn = ({
|
|
|
4701
4740
|
} finally {
|
|
4702
4741
|
d(!1);
|
|
4703
4742
|
}
|
|
4704
|
-
}, children: /* @__PURE__ */
|
|
4705
|
-
/* @__PURE__ */
|
|
4743
|
+
}, children: /* @__PURE__ */ o(re, { children: [
|
|
4744
|
+
/* @__PURE__ */ o(Se, { children: [
|
|
4706
4745
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Which statement best describes you?" }),
|
|
4707
4746
|
/* @__PURE__ */ r("p", { className: "mt-2", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "All Tokenise clients are treated as Retail Investors under EU regulation, which gives you the highest level of investor protection. For our internal purposes, we ask you to select the description that best matches your situation" })
|
|
4708
4747
|
] }),
|
|
4709
|
-
/* @__PURE__ */
|
|
4748
|
+
/* @__PURE__ */ o(ne, { className: "space-y-4", children: [
|
|
4710
4749
|
/* @__PURE__ */ r("p", { className: "text-sm font-medium mb-3", style: { color: "var(--metakyc-text-secondary, #374151)" }, children: "Choose one" }),
|
|
4711
4750
|
/* @__PURE__ */ r(
|
|
4712
4751
|
"label",
|
|
@@ -4716,7 +4755,7 @@ const Nn = ({
|
|
|
4716
4755
|
borderColor: i === Ee.Individual ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)",
|
|
4717
4756
|
backgroundColor: i === Ee.Individual ? "var(--metakyc-primary-light, #dbeafe)" : "transparent"
|
|
4718
4757
|
},
|
|
4719
|
-
children: /* @__PURE__ */
|
|
4758
|
+
children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
|
|
4720
4759
|
/* @__PURE__ */ r(
|
|
4721
4760
|
"input",
|
|
4722
4761
|
{
|
|
@@ -4724,11 +4763,11 @@ const Nn = ({
|
|
|
4724
4763
|
name: "investorType",
|
|
4725
4764
|
value: Ee.Individual,
|
|
4726
4765
|
checked: i === Ee.Individual,
|
|
4727
|
-
onChange: () =>
|
|
4766
|
+
onChange: () => s(Ee.Individual),
|
|
4728
4767
|
className: "mt-1"
|
|
4729
4768
|
}
|
|
4730
4769
|
),
|
|
4731
|
-
/* @__PURE__ */
|
|
4770
|
+
/* @__PURE__ */ o("div", { className: "ml-3", children: [
|
|
4732
4771
|
/* @__PURE__ */ r("div", { className: "text-base font-semibold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Individual investor" }),
|
|
4733
4772
|
/* @__PURE__ */ r("div", { className: "text-sm mt-1", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "(Recommended) Most of our clients choose this option. Provides the strongest protection and aligns with our mission to make investing accessible to everyone." })
|
|
4734
4773
|
] })
|
|
@@ -4743,7 +4782,7 @@ const Nn = ({
|
|
|
4743
4782
|
borderColor: i === Ee.Sophisticated ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)",
|
|
4744
4783
|
backgroundColor: i === Ee.Sophisticated ? "var(--metakyc-primary-light, #dbeafe)" : "transparent"
|
|
4745
4784
|
},
|
|
4746
|
-
children: /* @__PURE__ */
|
|
4785
|
+
children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
|
|
4747
4786
|
/* @__PURE__ */ r(
|
|
4748
4787
|
"input",
|
|
4749
4788
|
{
|
|
@@ -4751,14 +4790,14 @@ const Nn = ({
|
|
|
4751
4790
|
name: "investorType",
|
|
4752
4791
|
value: Ee.Sophisticated,
|
|
4753
4792
|
checked: i === Ee.Sophisticated,
|
|
4754
|
-
onChange: () =>
|
|
4793
|
+
onChange: () => s(Ee.Sophisticated),
|
|
4755
4794
|
className: "mt-1"
|
|
4756
4795
|
}
|
|
4757
4796
|
),
|
|
4758
|
-
/* @__PURE__ */
|
|
4797
|
+
/* @__PURE__ */ o("div", { className: "ml-3", children: [
|
|
4759
4798
|
/* @__PURE__ */ r("div", { className: "text-base font-semibold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Sophisticated investor" }),
|
|
4760
4799
|
/* @__PURE__ */ r("div", { className: "text-sm mt-1", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "In the last 2 years, I have done one or more of the following:" }),
|
|
4761
|
-
/* @__PURE__ */
|
|
4800
|
+
/* @__PURE__ */ o("ul", { className: "text-sm mt-2 space-y-1 list-none", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: [
|
|
4762
4801
|
/* @__PURE__ */ r("li", { children: "Worked in private equity or provided capital to small and medium enterprises, and/or" }),
|
|
4763
4802
|
/* @__PURE__ */ r("li", { children: "Been the director of a company with an annual turnover of at least (USD) $2m million, and/or" }),
|
|
4764
4803
|
/* @__PURE__ */ r("li", { children: "Invested directly in at least 2 private (not listed) companies." })
|
|
@@ -4775,7 +4814,7 @@ const Nn = ({
|
|
|
4775
4814
|
borderColor: i === Ee.HighNetWorth ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)",
|
|
4776
4815
|
backgroundColor: i === Ee.HighNetWorth ? "var(--metakyc-primary-light, #dbeafe)" : "transparent"
|
|
4777
4816
|
},
|
|
4778
|
-
children: /* @__PURE__ */
|
|
4817
|
+
children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
|
|
4779
4818
|
/* @__PURE__ */ r(
|
|
4780
4819
|
"input",
|
|
4781
4820
|
{
|
|
@@ -4783,13 +4822,13 @@ const Nn = ({
|
|
|
4783
4822
|
name: "investorType",
|
|
4784
4823
|
value: Ee.HighNetWorth,
|
|
4785
4824
|
checked: i === Ee.HighNetWorth,
|
|
4786
|
-
onChange: () =>
|
|
4825
|
+
onChange: () => s(Ee.HighNetWorth),
|
|
4787
4826
|
className: "mt-1"
|
|
4788
4827
|
}
|
|
4789
4828
|
),
|
|
4790
|
-
/* @__PURE__ */
|
|
4829
|
+
/* @__PURE__ */ o("div", { className: "ml-3", children: [
|
|
4791
4830
|
/* @__PURE__ */ r("div", { className: "text-base font-semibold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "High networth investor" }),
|
|
4792
|
-
/* @__PURE__ */
|
|
4831
|
+
/* @__PURE__ */ o("div", { className: "text-sm mt-1", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: [
|
|
4793
4832
|
"I earn more than (USD/EUR) $150,000 per year, and/or",
|
|
4794
4833
|
/* @__PURE__ */ r("br", {}),
|
|
4795
4834
|
"I have net assets (excluding my main property) of at least $/EUR 300,000"
|
|
@@ -4798,13 +4837,13 @@ const Nn = ({
|
|
|
4798
4837
|
] })
|
|
4799
4838
|
}
|
|
4800
4839
|
),
|
|
4801
|
-
y && /* @__PURE__ */ r("div", { className: "p-4 rounded-lg", style: { backgroundColor: "#fee2e2", border: "1px solid #fca5a5" }, children: /* @__PURE__ */
|
|
4840
|
+
y && /* @__PURE__ */ r("div", { className: "p-4 rounded-lg", style: { backgroundColor: "#fee2e2", border: "1px solid #fca5a5" }, children: /* @__PURE__ */ o("p", { className: "text-sm", style: { color: "#991b1b" }, children: [
|
|
4802
4841
|
/* @__PURE__ */ r("strong", { children: "Error:" }),
|
|
4803
4842
|
" ",
|
|
4804
4843
|
y
|
|
4805
4844
|
] }) })
|
|
4806
4845
|
] }),
|
|
4807
|
-
/* @__PURE__ */
|
|
4846
|
+
/* @__PURE__ */ o(Ce, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
4808
4847
|
n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
4809
4848
|
/* @__PURE__ */ r(
|
|
4810
4849
|
Z,
|
|
@@ -4831,13 +4870,13 @@ const En = ({
|
|
|
4831
4870
|
onComplete: t,
|
|
4832
4871
|
onBack: n
|
|
4833
4872
|
}) => {
|
|
4834
|
-
const { appropriatenessTestService: a } = Te(), [i,
|
|
4873
|
+
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);
|
|
4835
4874
|
ge(() => {
|
|
4836
4875
|
(async () => {
|
|
4837
4876
|
try {
|
|
4838
4877
|
d(!0), P(null);
|
|
4839
4878
|
const B = await a.getAppropriatenessTest(e);
|
|
4840
|
-
if (
|
|
4879
|
+
if (s(B), B.waitTimeSpanForNextTry && B.waitTimeSpanForNextTry !== "00:00:00") {
|
|
4841
4880
|
const H = Tt(B.waitTimeSpanForNextTry);
|
|
4842
4881
|
H > 0 && K(H);
|
|
4843
4882
|
}
|
|
@@ -4869,7 +4908,7 @@ const En = ({
|
|
|
4869
4908
|
}, _ = ae(async () => {
|
|
4870
4909
|
try {
|
|
4871
4910
|
const B = await a.getAppropriatenessTest(e);
|
|
4872
|
-
if (
|
|
4911
|
+
if (s(B), B.waitTimeSpanForNextTry && B.waitTimeSpanForNextTry !== "00:00:00") {
|
|
4873
4912
|
const H = Tt(B.waitTimeSpanForNextTry);
|
|
4874
4913
|
H > 0 && K(H);
|
|
4875
4914
|
}
|
|
@@ -4887,45 +4926,45 @@ const En = ({
|
|
|
4887
4926
|
p(!0), P(null);
|
|
4888
4927
|
try {
|
|
4889
4928
|
const H = i.appropriatenessQuestions.map(
|
|
4890
|
-
(
|
|
4929
|
+
(R) => ({ appropriatenessQuestionId: R.id, value: v[R.id] || "" })
|
|
4891
4930
|
), fe = {
|
|
4892
4931
|
applicantId: e,
|
|
4893
4932
|
appropriatenessTestId: i.id,
|
|
4894
4933
|
appropriatenessQuestionResults: H
|
|
4895
4934
|
};
|
|
4896
4935
|
try {
|
|
4897
|
-
const
|
|
4898
|
-
|
|
4899
|
-
} catch (
|
|
4900
|
-
if (
|
|
4901
|
-
$({ success: !1, message:
|
|
4936
|
+
const R = await a.fillAppropriatenessTest(fe);
|
|
4937
|
+
R.isSuccess ? $({ success: !0, message: R.message || "Congratulations! You have passed the test." }) : ($({ success: !1, message: R.message || "You did not pass the test." }), setTimeout(() => _(), 1e3));
|
|
4938
|
+
} catch (R) {
|
|
4939
|
+
if (R.code === 400 && R.message)
|
|
4940
|
+
$({ success: !1, message: R.message }), setTimeout(() => _(), 1500);
|
|
4902
4941
|
else
|
|
4903
|
-
throw
|
|
4942
|
+
throw R;
|
|
4904
4943
|
}
|
|
4905
4944
|
} catch (H) {
|
|
4906
|
-
P(H.message || "Failed to submit test. Please try again."),
|
|
4945
|
+
P(H.message || "Failed to submit test. Please try again."), ie();
|
|
4907
4946
|
} finally {
|
|
4908
4947
|
p(!1);
|
|
4909
4948
|
}
|
|
4910
4949
|
}
|
|
4911
|
-
},
|
|
4950
|
+
}, ie = () => {
|
|
4912
4951
|
z(!1), M(!1), A({}), E(0);
|
|
4913
4952
|
};
|
|
4914
4953
|
if (c)
|
|
4915
|
-
return /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */
|
|
4954
|
+
return /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ o("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", padding: "48px 0", gap: "16px" }, children: [
|
|
4916
4955
|
/* @__PURE__ */ r(Me, { className: "my-8" }),
|
|
4917
4956
|
/* @__PURE__ */ r("p", { style: { fontSize: "14px", color: "var(--metakyc-text-muted, #9ca3af)" }, children: "Loading test..." })
|
|
4918
4957
|
] }) }) });
|
|
4919
4958
|
if (!i)
|
|
4920
|
-
return /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */
|
|
4959
|
+
return /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ o("div", { style: { textAlign: "center", padding: "48px 0" }, children: [
|
|
4921
4960
|
/* @__PURE__ */ r("p", { style: { fontSize: "16px", fontWeight: 600, color: "var(--metakyc-danger, #ef4444)" }, children: "No test data available" }),
|
|
4922
|
-
|
|
4961
|
+
b && /* @__PURE__ */ r("p", { style: { fontSize: "14px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "8px" }, children: b })
|
|
4923
4962
|
] }) }) });
|
|
4924
|
-
const Y = i.testAllowedMaxTry - i.totalFailedTries, ve = i.appropriatenessQuestions.length,
|
|
4963
|
+
const Y = i.testAllowedMaxTry - i.totalFailedTries, ve = i.appropriatenessQuestions.length, pe = Object.keys(v).length;
|
|
4925
4964
|
if (j > 0)
|
|
4926
|
-
return /* @__PURE__ */
|
|
4965
|
+
return /* @__PURE__ */ o(re, { children: [
|
|
4927
4966
|
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r("h2", { style: { fontSize: "18px", fontWeight: 700, color: "var(--metakyc-text-primary, #111827)", margin: 0 }, children: i.displayName }) }),
|
|
4928
|
-
/* @__PURE__ */ r(ne, { children: /* @__PURE__ */
|
|
4967
|
+
/* @__PURE__ */ r(ne, { children: /* @__PURE__ */ o("div", { style: { textAlign: "center", padding: "32px 0" }, children: [
|
|
4929
4968
|
/* @__PURE__ */ r("div", { style: {
|
|
4930
4969
|
width: "100px",
|
|
4931
4970
|
height: "100px",
|
|
@@ -4943,21 +4982,21 @@ const En = ({
|
|
|
4943
4982
|
}, children: vt(j) }) }),
|
|
4944
4983
|
/* @__PURE__ */ r("p", { style: { fontSize: "15px", fontWeight: 500, color: "var(--metakyc-text-primary, #111827)" }, children: "Please wait before retrying" }),
|
|
4945
4984
|
/* @__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" }),
|
|
4946
|
-
|
|
4985
|
+
b && /* @__PURE__ */ r("div", { style: {
|
|
4947
4986
|
marginTop: "20px",
|
|
4948
4987
|
padding: "12px 16px",
|
|
4949
4988
|
borderRadius: "10px",
|
|
4950
4989
|
backgroundColor: "color-mix(in srgb, var(--metakyc-danger, #ef4444) 8%, transparent)",
|
|
4951
4990
|
border: "1px solid color-mix(in srgb, var(--metakyc-danger, #ef4444) 20%, transparent)"
|
|
4952
|
-
}, children: /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children:
|
|
4991
|
+
}, children: /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children: b }) })
|
|
4953
4992
|
] }) })
|
|
4954
4993
|
] });
|
|
4955
4994
|
if (g) {
|
|
4956
4995
|
const B = () => {
|
|
4957
|
-
$(null),
|
|
4996
|
+
$(null), ie(), P(null);
|
|
4958
4997
|
};
|
|
4959
|
-
return /* @__PURE__ */
|
|
4960
|
-
/* @__PURE__ */ r(ne, { children: /* @__PURE__ */
|
|
4998
|
+
return /* @__PURE__ */ o(re, { children: [
|
|
4999
|
+
/* @__PURE__ */ r(ne, { children: /* @__PURE__ */ o("div", { style: {
|
|
4961
5000
|
display: "flex",
|
|
4962
5001
|
flexDirection: "column",
|
|
4963
5002
|
alignItems: "center",
|
|
@@ -4973,10 +5012,10 @@ const En = ({
|
|
|
4973
5012
|
alignItems: "center",
|
|
4974
5013
|
justifyContent: "center",
|
|
4975
5014
|
backgroundColor: g.success ? "color-mix(in srgb, var(--metakyc-success, #10b981) 12%, transparent)" : "color-mix(in srgb, var(--metakyc-danger, #ef4444) 10%, transparent)"
|
|
4976
|
-
}, children: g.success ? /* @__PURE__ */
|
|
5015
|
+
}, children: g.success ? /* @__PURE__ */ o("svg", { width: "36", height: "36", viewBox: "0 0 24 24", fill: "none", stroke: "var(--metakyc-success, #10b981)", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
4977
5016
|
/* @__PURE__ */ r("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }),
|
|
4978
5017
|
/* @__PURE__ */ r("polyline", { points: "22 4 12 14.01 9 11.01" })
|
|
4979
|
-
] }) : /* @__PURE__ */
|
|
5018
|
+
] }) : /* @__PURE__ */ o("svg", { width: "36", height: "36", viewBox: "0 0 24 24", fill: "none", stroke: "var(--metakyc-danger, #ef4444)", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
4980
5019
|
/* @__PURE__ */ r("circle", { cx: "12", cy: "12", r: "10" }),
|
|
4981
5020
|
/* @__PURE__ */ r("line", { x1: "15", y1: "9", x2: "9", y2: "15" }),
|
|
4982
5021
|
/* @__PURE__ */ r("line", { x1: "9", y1: "9", x2: "15", y2: "15" })
|
|
@@ -5001,7 +5040,7 @@ const En = ({
|
|
|
5001
5040
|
borderRadius: "10px",
|
|
5002
5041
|
backgroundColor: "var(--metakyc-surface, #f9fafb)",
|
|
5003
5042
|
border: "1px solid var(--metakyc-border, #e5e7eb)"
|
|
5004
|
-
}, children: /* @__PURE__ */
|
|
5043
|
+
}, children: /* @__PURE__ */ o("p", { style: {
|
|
5005
5044
|
fontSize: "13px",
|
|
5006
5045
|
color: "var(--metakyc-text-muted, #9ca3af)",
|
|
5007
5046
|
margin: 0
|
|
@@ -5024,7 +5063,7 @@ const En = ({
|
|
|
5024
5063
|
margin: 0
|
|
5025
5064
|
}, children: "No attempts remaining. Please contact support for assistance." }) })
|
|
5026
5065
|
] }) }),
|
|
5027
|
-
/* @__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__ */
|
|
5066
|
+
/* @__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(lt, { children: [
|
|
5028
5067
|
Y > 0 && j <= 0 && /* @__PURE__ */ r(Z, { type: "button", onClick: B, children: "Retake Test" }),
|
|
5029
5068
|
Y > 0 && j > 0 && /* @__PURE__ */ r(Z, { type: "button", onClick: B, children: "OK" }),
|
|
5030
5069
|
Y <= 0 && n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" })
|
|
@@ -5032,13 +5071,13 @@ const En = ({
|
|
|
5032
5071
|
] });
|
|
5033
5072
|
}
|
|
5034
5073
|
if (!N)
|
|
5035
|
-
return /* @__PURE__ */
|
|
5036
|
-
/* @__PURE__ */
|
|
5074
|
+
return /* @__PURE__ */ o(re, { children: [
|
|
5075
|
+
/* @__PURE__ */ o(Se, { children: [
|
|
5037
5076
|
/* @__PURE__ */ r("h2", { style: { fontSize: "18px", fontWeight: 700, color: "var(--metakyc-text-primary, #111827)", margin: 0 }, children: i.displayName }),
|
|
5038
5077
|
i.subtitle && /* @__PURE__ */ r("p", { style: { fontSize: "14px", color: "var(--metakyc-text-secondary, #6b7280)", marginTop: "4px" }, children: i.subtitle })
|
|
5039
5078
|
] }),
|
|
5040
|
-
/* @__PURE__ */
|
|
5041
|
-
i.description && /* @__PURE__ */
|
|
5079
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
5080
|
+
i.description && /* @__PURE__ */ o("div", { style: {
|
|
5042
5081
|
marginBottom: "20px",
|
|
5043
5082
|
padding: "12px 14px",
|
|
5044
5083
|
borderRadius: "10px",
|
|
@@ -5047,14 +5086,14 @@ const En = ({
|
|
|
5047
5086
|
display: "flex",
|
|
5048
5087
|
gap: "10px"
|
|
5049
5088
|
}, children: [
|
|
5050
|
-
/* @__PURE__ */
|
|
5089
|
+
/* @__PURE__ */ o("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "var(--metakyc-primary, #2563eb)", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", style: { flexShrink: 0, marginTop: "1px" }, children: [
|
|
5051
5090
|
/* @__PURE__ */ r("circle", { cx: "12", cy: "12", r: "10" }),
|
|
5052
5091
|
/* @__PURE__ */ r("line", { x1: "12", y1: "16", x2: "12", y2: "12" }),
|
|
5053
5092
|
/* @__PURE__ */ r("line", { x1: "12", y1: "8", x2: "12.01", y2: "8" })
|
|
5054
5093
|
] }),
|
|
5055
5094
|
/* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-text-secondary, #374151)", margin: 0, lineHeight: 1.5 }, children: i.description })
|
|
5056
5095
|
] }),
|
|
5057
|
-
/* @__PURE__ */
|
|
5096
|
+
/* @__PURE__ */ o("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: "12px", marginBottom: "20px" }, children: [
|
|
5058
5097
|
/* @__PURE__ */ r(ht, { icon: "questions", label: "Questions", value: String(i.totalQuestionCount) }),
|
|
5059
5098
|
/* @__PURE__ */ r(ht, { icon: "time", label: "Time Limit", value: vt(i.testDurationSec) }),
|
|
5060
5099
|
/* @__PURE__ */ r(ht, { icon: "target", label: "Pass Requirement", value: `${i.testCorrectAnswerPassLimit} correct` }),
|
|
@@ -5068,7 +5107,7 @@ const En = ({
|
|
|
5068
5107
|
}
|
|
5069
5108
|
)
|
|
5070
5109
|
] }),
|
|
5071
|
-
|
|
5110
|
+
b && /* @__PURE__ */ o("div", { style: {
|
|
5072
5111
|
marginBottom: "16px",
|
|
5073
5112
|
padding: "12px 14px",
|
|
5074
5113
|
borderRadius: "10px",
|
|
@@ -5077,15 +5116,15 @@ const En = ({
|
|
|
5077
5116
|
display: "flex",
|
|
5078
5117
|
gap: "10px"
|
|
5079
5118
|
}, children: [
|
|
5080
|
-
/* @__PURE__ */
|
|
5119
|
+
/* @__PURE__ */ o("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "var(--metakyc-danger, #ef4444)", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", style: { flexShrink: 0, marginTop: "1px" }, children: [
|
|
5081
5120
|
/* @__PURE__ */ r("path", { d: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" }),
|
|
5082
5121
|
/* @__PURE__ */ r("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
|
|
5083
5122
|
/* @__PURE__ */ r("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
|
|
5084
5123
|
] }),
|
|
5085
|
-
/* @__PURE__ */
|
|
5124
|
+
/* @__PURE__ */ o("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0, lineHeight: 1.5 }, children: [
|
|
5086
5125
|
/* @__PURE__ */ r("strong", { children: "Previous attempt:" }),
|
|
5087
5126
|
" ",
|
|
5088
|
-
|
|
5127
|
+
b
|
|
5089
5128
|
] })
|
|
5090
5129
|
] }),
|
|
5091
5130
|
Y <= 0 && /* @__PURE__ */ r("div", { style: {
|
|
@@ -5095,25 +5134,25 @@ const En = ({
|
|
|
5095
5134
|
border: "1px solid color-mix(in srgb, var(--metakyc-danger, #ef4444) 20%, transparent)"
|
|
5096
5135
|
}, children: /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children: "You have used all your attempts. Please contact support for assistance." }) })
|
|
5097
5136
|
] }),
|
|
5098
|
-
/* @__PURE__ */ r(Ce, { children: /* @__PURE__ */
|
|
5137
|
+
/* @__PURE__ */ r(Ce, { children: /* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "center", justifyContent: n ? "space-between" : "flex-end", width: "100%" }, children: [
|
|
5099
5138
|
n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
5100
5139
|
/* @__PURE__ */ r(Z, { type: "button", onClick: V, disabled: Y <= 0, children: "Start Test" })
|
|
5101
5140
|
] }) })
|
|
5102
5141
|
] });
|
|
5103
|
-
const me = i.appropriatenessQuestions[ee], ke = ee === ve - 1, F =
|
|
5104
|
-
return /* @__PURE__ */
|
|
5105
|
-
/* @__PURE__ */
|
|
5106
|
-
/* @__PURE__ */
|
|
5107
|
-
/* @__PURE__ */
|
|
5142
|
+
const me = i.appropriatenessQuestions[ee], ke = ee === ve - 1, F = pe === ve, U = T <= 60;
|
|
5143
|
+
return /* @__PURE__ */ o(re, { children: [
|
|
5144
|
+
/* @__PURE__ */ o(Se, { children: [
|
|
5145
|
+
/* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
|
|
5146
|
+
/* @__PURE__ */ o("div", { children: [
|
|
5108
5147
|
/* @__PURE__ */ r("h2", { style: { fontSize: "18px", fontWeight: 700, color: "var(--metakyc-text-primary, #111827)", margin: 0 }, children: i.displayName }),
|
|
5109
|
-
/* @__PURE__ */
|
|
5148
|
+
/* @__PURE__ */ o("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "2px" }, children: [
|
|
5110
5149
|
"Question ",
|
|
5111
5150
|
ee + 1,
|
|
5112
5151
|
" of ",
|
|
5113
5152
|
ve
|
|
5114
5153
|
] })
|
|
5115
5154
|
] }),
|
|
5116
|
-
/* @__PURE__ */
|
|
5155
|
+
/* @__PURE__ */ o("div", { style: {
|
|
5117
5156
|
display: "flex",
|
|
5118
5157
|
alignItems: "center",
|
|
5119
5158
|
gap: "8px",
|
|
@@ -5122,7 +5161,7 @@ const En = ({
|
|
|
5122
5161
|
backgroundColor: U ? "color-mix(in srgb, var(--metakyc-danger, #ef4444) 10%, transparent)" : "var(--metakyc-surface, #f3f4f6)",
|
|
5123
5162
|
transition: "all 0.3s ease"
|
|
5124
5163
|
}, children: [
|
|
5125
|
-
/* @__PURE__ */
|
|
5164
|
+
/* @__PURE__ */ o(
|
|
5126
5165
|
"svg",
|
|
5127
5166
|
{
|
|
5128
5167
|
width: "16",
|
|
@@ -5148,7 +5187,7 @@ const En = ({
|
|
|
5148
5187
|
}, children: vt(T) })
|
|
5149
5188
|
] })
|
|
5150
5189
|
] }),
|
|
5151
|
-
/* @__PURE__ */
|
|
5190
|
+
/* @__PURE__ */ o("div", { style: { marginTop: "12px" }, children: [
|
|
5152
5191
|
/* @__PURE__ */ r("div", { style: {
|
|
5153
5192
|
height: "4px",
|
|
5154
5193
|
borderRadius: "999px",
|
|
@@ -5158,19 +5197,19 @@ const En = ({
|
|
|
5158
5197
|
height: "100%",
|
|
5159
5198
|
borderRadius: "999px",
|
|
5160
5199
|
backgroundColor: "var(--metakyc-primary, #2563eb)",
|
|
5161
|
-
width: `${
|
|
5200
|
+
width: `${pe / ve * 100}%`,
|
|
5162
5201
|
transition: "width 0.3s ease"
|
|
5163
5202
|
} }) }),
|
|
5164
|
-
/* @__PURE__ */
|
|
5203
|
+
/* @__PURE__ */ o("div", { style: {
|
|
5165
5204
|
display: "flex",
|
|
5166
5205
|
justifyContent: "space-between",
|
|
5167
5206
|
marginTop: "4px"
|
|
5168
5207
|
}, children: [
|
|
5169
|
-
/* @__PURE__ */
|
|
5170
|
-
|
|
5208
|
+
/* @__PURE__ */ o("span", { style: { fontSize: "11px", color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
|
|
5209
|
+
pe,
|
|
5171
5210
|
" answered"
|
|
5172
5211
|
] }),
|
|
5173
|
-
/* @__PURE__ */
|
|
5212
|
+
/* @__PURE__ */ o("span", { style: { fontSize: "11px", color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
|
|
5174
5213
|
Y,
|
|
5175
5214
|
" attempt",
|
|
5176
5215
|
Y !== 1 ? "s" : "",
|
|
@@ -5179,7 +5218,7 @@ const En = ({
|
|
|
5179
5218
|
] })
|
|
5180
5219
|
] })
|
|
5181
5220
|
] }),
|
|
5182
|
-
/* @__PURE__ */
|
|
5221
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
5183
5222
|
me && /* @__PURE__ */ r(
|
|
5184
5223
|
An,
|
|
5185
5224
|
{
|
|
@@ -5221,7 +5260,7 @@ const En = ({
|
|
|
5221
5260
|
},
|
|
5222
5261
|
B.id
|
|
5223
5262
|
)) }),
|
|
5224
|
-
Q && /* @__PURE__ */
|
|
5263
|
+
Q && /* @__PURE__ */ o("div", { style: {
|
|
5225
5264
|
marginTop: "16px",
|
|
5226
5265
|
padding: "12px 14px",
|
|
5227
5266
|
borderRadius: "10px",
|
|
@@ -5231,21 +5270,21 @@ const En = ({
|
|
|
5231
5270
|
alignItems: "center",
|
|
5232
5271
|
gap: "10px"
|
|
5233
5272
|
}, children: [
|
|
5234
|
-
/* @__PURE__ */
|
|
5273
|
+
/* @__PURE__ */ o("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "#f59e0b", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", style: { flexShrink: 0 }, children: [
|
|
5235
5274
|
/* @__PURE__ */ r("circle", { cx: "12", cy: "12", r: "10" }),
|
|
5236
5275
|
/* @__PURE__ */ r("polyline", { points: "12 6 12 12 16 14" })
|
|
5237
5276
|
] }),
|
|
5238
5277
|
/* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "#b45309", margin: 0, fontWeight: 500 }, children: "Time's up! Your answers are being submitted." })
|
|
5239
5278
|
] }),
|
|
5240
|
-
|
|
5279
|
+
b && !Q && /* @__PURE__ */ r("div", { style: {
|
|
5241
5280
|
marginTop: "16px",
|
|
5242
5281
|
padding: "12px 14px",
|
|
5243
5282
|
borderRadius: "10px",
|
|
5244
5283
|
backgroundColor: "color-mix(in srgb, var(--metakyc-danger, #ef4444) 8%, transparent)",
|
|
5245
5284
|
border: "1px solid color-mix(in srgb, var(--metakyc-danger, #ef4444) 20%, transparent)"
|
|
5246
|
-
}, children: /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children:
|
|
5285
|
+
}, children: /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children: b }) })
|
|
5247
5286
|
] }),
|
|
5248
|
-
/* @__PURE__ */ r(Ce, { children: /* @__PURE__ */
|
|
5287
|
+
/* @__PURE__ */ r(Ce, { children: /* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%" }, children: [
|
|
5249
5288
|
/* @__PURE__ */ r(
|
|
5250
5289
|
Z,
|
|
5251
5290
|
{
|
|
@@ -5258,7 +5297,7 @@ const En = ({
|
|
|
5258
5297
|
children: ee > 0 ? "Previous" : "Cancel"
|
|
5259
5298
|
}
|
|
5260
5299
|
),
|
|
5261
|
-
/* @__PURE__ */
|
|
5300
|
+
/* @__PURE__ */ o("div", { style: { display: "flex", gap: "8px" }, children: [
|
|
5262
5301
|
!ke && /* @__PURE__ */ r(
|
|
5263
5302
|
Z,
|
|
5264
5303
|
{
|
|
@@ -5282,26 +5321,26 @@ const En = ({
|
|
|
5282
5321
|
] }) })
|
|
5283
5322
|
] });
|
|
5284
5323
|
}, Fn = {
|
|
5285
|
-
questions: /* @__PURE__ */
|
|
5324
|
+
questions: /* @__PURE__ */ o("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
5286
5325
|
/* @__PURE__ */ r("path", { d: "M9 11l3 3L22 4" }),
|
|
5287
5326
|
/* @__PURE__ */ r("path", { d: "M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11" })
|
|
5288
5327
|
] }),
|
|
5289
|
-
time: /* @__PURE__ */
|
|
5328
|
+
time: /* @__PURE__ */ o("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
5290
5329
|
/* @__PURE__ */ r("circle", { cx: "12", cy: "12", r: "10" }),
|
|
5291
5330
|
/* @__PURE__ */ r("polyline", { points: "12 6 12 12 16 14" })
|
|
5292
5331
|
] }),
|
|
5293
|
-
target: /* @__PURE__ */
|
|
5332
|
+
target: /* @__PURE__ */ o("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
5294
5333
|
/* @__PURE__ */ r("circle", { cx: "12", cy: "12", r: "10" }),
|
|
5295
5334
|
/* @__PURE__ */ r("circle", { cx: "12", cy: "12", r: "6" }),
|
|
5296
5335
|
/* @__PURE__ */ r("circle", { cx: "12", cy: "12", r: "2" })
|
|
5297
5336
|
] }),
|
|
5298
|
-
retry: /* @__PURE__ */
|
|
5337
|
+
retry: /* @__PURE__ */ o("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
5299
5338
|
/* @__PURE__ */ r("polyline", { points: "23 4 23 10 17 10" }),
|
|
5300
5339
|
/* @__PURE__ */ r("path", { d: "M20.49 15a9 9 0 1 1-2.12-9.36L23 10" })
|
|
5301
5340
|
] })
|
|
5302
5341
|
}, ht = ({ icon: e, label: t, value: n, variant: a = "default" }) => {
|
|
5303
5342
|
const i = a === "warning";
|
|
5304
|
-
return /* @__PURE__ */
|
|
5343
|
+
return /* @__PURE__ */ o("div", { style: {
|
|
5305
5344
|
display: "flex",
|
|
5306
5345
|
alignItems: "center",
|
|
5307
5346
|
gap: "12px",
|
|
@@ -5314,7 +5353,7 @@ const En = ({
|
|
|
5314
5353
|
color: i ? "#f59e0b" : "var(--metakyc-primary, #2563eb)",
|
|
5315
5354
|
flexShrink: 0
|
|
5316
5355
|
}, children: Fn[e] }),
|
|
5317
|
-
/* @__PURE__ */
|
|
5356
|
+
/* @__PURE__ */ o("div", { children: [
|
|
5318
5357
|
/* @__PURE__ */ r("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", margin: 0 }, children: t }),
|
|
5319
5358
|
/* @__PURE__ */ r("p", { style: {
|
|
5320
5359
|
fontSize: "15px",
|
|
@@ -5325,8 +5364,8 @@ const En = ({
|
|
|
5325
5364
|
}, children: n })
|
|
5326
5365
|
] })
|
|
5327
5366
|
] });
|
|
5328
|
-
}, An = ({ question: e, selectedAnswer: t, onSelect: n, disabled: a }) => /* @__PURE__ */
|
|
5329
|
-
/* @__PURE__ */
|
|
5367
|
+
}, An = ({ question: e, selectedAnswer: t, onSelect: n, disabled: a }) => /* @__PURE__ */ o("div", { children: [
|
|
5368
|
+
/* @__PURE__ */ o("div", { style: { marginBottom: "16px" }, children: [
|
|
5330
5369
|
e.groupName && /* @__PURE__ */ r("span", { style: {
|
|
5331
5370
|
display: "inline-block",
|
|
5332
5371
|
fontSize: "11px",
|
|
@@ -5344,9 +5383,9 @@ const En = ({
|
|
|
5344
5383
|
lineHeight: 1.5
|
|
5345
5384
|
}, children: e.question })
|
|
5346
5385
|
] }),
|
|
5347
|
-
/* @__PURE__ */ r("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: e.answers.map((i,
|
|
5386
|
+
/* @__PURE__ */ r("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: e.answers.map((i, s) => {
|
|
5348
5387
|
const c = t === i;
|
|
5349
|
-
return /* @__PURE__ */
|
|
5388
|
+
return /* @__PURE__ */ o(
|
|
5350
5389
|
"label",
|
|
5351
5390
|
{
|
|
5352
5391
|
style: {
|
|
@@ -5404,7 +5443,7 @@ const En = ({
|
|
|
5404
5443
|
}, children: i })
|
|
5405
5444
|
]
|
|
5406
5445
|
},
|
|
5407
|
-
|
|
5446
|
+
s
|
|
5408
5447
|
);
|
|
5409
5448
|
}) })
|
|
5410
5449
|
] }), Tn = ({
|
|
@@ -5413,7 +5452,7 @@ const En = ({
|
|
|
5413
5452
|
onBack: n
|
|
5414
5453
|
}) => {
|
|
5415
5454
|
var Ze, je, it, Ye;
|
|
5416
|
-
const { applicantService: a, baseInformationService: i, identityService:
|
|
5455
|
+
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 } = Gr(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 = we.useRef(!1), [ve, pe] = k({}), [me, ke] = k({}), F = d != null && d.reviewPageFields && d.reviewPageFields.length > 0 ? d.reviewPageFields[0] : null, U = !!(d != null && d.reviewPageDisabled), B = de(!1);
|
|
5417
5456
|
B.current = U;
|
|
5418
5457
|
const H = Gt({
|
|
5419
5458
|
defaultValues: {
|
|
@@ -5442,10 +5481,10 @@ const En = ({
|
|
|
5442
5481
|
Q(O);
|
|
5443
5482
|
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));
|
|
5444
5483
|
j(m);
|
|
5445
|
-
const
|
|
5484
|
+
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));
|
|
5446
5485
|
ee(L);
|
|
5447
5486
|
const u = O.applicantRequestData;
|
|
5448
|
-
if (
|
|
5487
|
+
if (pe({
|
|
5449
5488
|
firstName: (u == null ? void 0 : u.firstName) || "",
|
|
5450
5489
|
lastName: (u == null ? void 0 : u.lastName) || "",
|
|
5451
5490
|
email: (u == null ? void 0 : u.email) || "",
|
|
@@ -5492,80 +5531,80 @@ const En = ({
|
|
|
5492
5531
|
}, [e]), ge(() => {
|
|
5493
5532
|
y && !$ && B.current && (console.log("[Identity] Review page disabled — showing cached provider"), V(!0));
|
|
5494
5533
|
}, [y, $]), ge(() => {
|
|
5495
|
-
if (
|
|
5496
|
-
if (
|
|
5497
|
-
const h = new Date(
|
|
5534
|
+
if (b) {
|
|
5535
|
+
if (b.expiresAt) {
|
|
5536
|
+
const h = new Date(b.expiresAt).getTime();
|
|
5498
5537
|
if (Date.now() >= h) {
|
|
5499
|
-
console.warn("[Identity] Token has expired (expiresAt)"),
|
|
5538
|
+
console.warn("[Identity] Token has expired (expiresAt)"), ie(!0), _("Your verification session has expired. Please restart.");
|
|
5500
5539
|
return;
|
|
5501
5540
|
}
|
|
5502
5541
|
}
|
|
5503
|
-
if (
|
|
5542
|
+
if (b.url)
|
|
5504
5543
|
try {
|
|
5505
|
-
const O = new URL(
|
|
5544
|
+
const O = new URL(b.url).toString().toLowerCase();
|
|
5506
5545
|
if (O.includes("expired") || O.includes("invalid") || O.includes("error")) {
|
|
5507
|
-
console.warn("[Identity] Token URL indicates expiration"),
|
|
5546
|
+
console.warn("[Identity] Token URL indicates expiration"), ie(!0), _("Your verification link has expired. Please restart.");
|
|
5508
5547
|
return;
|
|
5509
5548
|
}
|
|
5510
5549
|
} catch {
|
|
5511
5550
|
console.error("[Identity] Invalid token URL");
|
|
5512
5551
|
}
|
|
5513
|
-
if (
|
|
5514
|
-
console.warn("[Identity] Token object indicates expiration"),
|
|
5552
|
+
if (b.status === "expired" || b.error === "expired" || b.expired === !0) {
|
|
5553
|
+
console.warn("[Identity] Token object indicates expiration"), ie(!0), _("Your verification session has expired. Please restart.");
|
|
5515
5554
|
return;
|
|
5516
5555
|
}
|
|
5517
5556
|
}
|
|
5518
|
-
}, [
|
|
5557
|
+
}, [b]);
|
|
5519
5558
|
const fe = p !== null && p === Oe.Sumsub;
|
|
5520
5559
|
ge(() => {
|
|
5521
|
-
if (p !== null &&
|
|
5560
|
+
if (p !== null && b && !w && $ && !J) {
|
|
5522
5561
|
const h = p;
|
|
5523
5562
|
if (fe) {
|
|
5524
5563
|
console.log("[Sumsub] Fetching access token for Web SDK…"), _(null), (async () => {
|
|
5525
5564
|
try {
|
|
5526
|
-
const O = await
|
|
5527
|
-
q.accessToken = O, q.onTokenRefresh = () =>
|
|
5565
|
+
const O = await s.refreshSumsubToken(e), q = Ge.parseProviderConfig(p, b, c);
|
|
5566
|
+
q.accessToken = O, q.onTokenRefresh = () => s.refreshSumsubToken(e);
|
|
5528
5567
|
const W = Ge.createProvider(p, q);
|
|
5529
5568
|
W.onComplete((X) => {
|
|
5530
5569
|
console.log("[Sumsub] Verification complete:", X), t == null || t();
|
|
5531
5570
|
}), W.onError((X) => {
|
|
5532
|
-
console.error("[Sumsub] SDK error:", X), (typeof X == "string" ? X : (X == null ? void 0 : X.message) || "Unknown error").toLowerCase().includes("expired") && (
|
|
5571
|
+
console.error("[Sumsub] SDK error:", X), (typeof X == "string" ? X : (X == null ? void 0 : X.message) || "Unknown error").toLowerCase().includes("expired") && (ie(!0), _("Session expired. Please restart."));
|
|
5533
5572
|
}), await W.initialize("sumsub-websdk-container"), console.log("[Sumsub] Web SDK launched"), N(W);
|
|
5534
5573
|
} catch (O) {
|
|
5535
|
-
console.error("[Sumsub] Initialization error:", O), _(`Failed to initialize: ${O.message || O}`), String(O.message || O).toLowerCase().includes("expired") &&
|
|
5574
|
+
console.error("[Sumsub] Initialization error:", O), _(`Failed to initialize: ${O.message || O}`), String(O.message || O).toLowerCase().includes("expired") && ie(!0);
|
|
5536
5575
|
}
|
|
5537
5576
|
})();
|
|
5538
5577
|
return;
|
|
5539
5578
|
}
|
|
5540
|
-
if (
|
|
5541
|
-
console.log("[Identity] Loading provider URL for user verification:",
|
|
5579
|
+
if (b.url) {
|
|
5580
|
+
console.log("[Identity] Loading provider URL for user verification:", b.url), _(null);
|
|
5542
5581
|
try {
|
|
5543
|
-
if (new URL(
|
|
5582
|
+
if (new URL(b.url), h === Oe.SardinAI) {
|
|
5544
5583
|
console.log("[SardinAI] Initializing Risk SDK in background...");
|
|
5545
5584
|
try {
|
|
5546
|
-
const O = Ge.parseProviderConfig(p,
|
|
5585
|
+
const O = Ge.parseProviderConfig(p, b, c);
|
|
5547
5586
|
Ge.createProvider(p, O).initialize().then(() => console.log("[SardinAI] Risk SDK initialized in background")).catch((W) => console.warn("[SardinAI] Risk SDK init failed (non-blocking):", W));
|
|
5548
5587
|
} catch (O) {
|
|
5549
5588
|
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", O);
|
|
5550
5589
|
}
|
|
5551
5590
|
}
|
|
5552
|
-
N({ type: "url", url:
|
|
5591
|
+
N({ type: "url", url: b.url });
|
|
5553
5592
|
} catch (O) {
|
|
5554
|
-
console.error("[Identity] Invalid URL:", O), _("Invalid verification URL. Please restart."),
|
|
5593
|
+
console.error("[Identity] Invalid URL:", O), _("Invalid verification URL. Please restart."), ie(!0);
|
|
5555
5594
|
}
|
|
5556
5595
|
return;
|
|
5557
5596
|
}
|
|
5558
5597
|
if (h === Oe.SardinAI) {
|
|
5559
5598
|
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), _(null);
|
|
5560
5599
|
try {
|
|
5561
|
-
const O = Ge.parseProviderConfig(p,
|
|
5600
|
+
const O = Ge.parseProviderConfig(p, b, c), q = Ge.createProvider(p, O);
|
|
5562
5601
|
q.initialize().then(() => {
|
|
5563
5602
|
console.log("[SardinAI] Risk SDK initialized successfully"), N(q), setTimeout(() => t == null ? void 0 : t(), 2e3);
|
|
5564
5603
|
}).catch((W) => {
|
|
5565
5604
|
var m;
|
|
5566
5605
|
console.error("[SardinAI] Failed to initialize:", W);
|
|
5567
5606
|
const X = ((m = W.message) == null ? void 0 : m.toLowerCase()) || "";
|
|
5568
|
-
X.includes("expired") || X.includes("invalid") || X.includes("401") || X.includes("400") ? (
|
|
5607
|
+
X.includes("expired") || X.includes("invalid") || X.includes("401") || X.includes("400") ? (ie(!0), _("Session expired or invalid. Please restart verification.")) : _(`Failed to initialize: ${W.message}`);
|
|
5569
5608
|
});
|
|
5570
5609
|
} catch (O) {
|
|
5571
5610
|
console.error("[SardinAI] Error creating provider:", O), _(`Configuration error: ${O.message}`);
|
|
@@ -5574,7 +5613,7 @@ const En = ({
|
|
|
5574
5613
|
}
|
|
5575
5614
|
try {
|
|
5576
5615
|
_(null);
|
|
5577
|
-
const O = Ge.parseProviderConfig(p,
|
|
5616
|
+
const O = Ge.parseProviderConfig(p, b, c), q = Ge.createProvider(p, O);
|
|
5578
5617
|
h === Oe.Onfido && q.initialize("identity-container").catch((W) => {
|
|
5579
5618
|
console.error("[Onfido] Initialization error:", W), _(`Failed to initialize: ${W.message}`);
|
|
5580
5619
|
}), N(q);
|
|
@@ -5590,35 +5629,35 @@ const En = ({
|
|
|
5590
5629
|
console.error("[Identity] Error destroying provider:", h);
|
|
5591
5630
|
}
|
|
5592
5631
|
};
|
|
5593
|
-
}, [p,
|
|
5594
|
-
const
|
|
5632
|
+
}, [p, b, w, $, t, J, fe, e, c, s]);
|
|
5633
|
+
const R = async () => {
|
|
5595
5634
|
try {
|
|
5596
|
-
_(null),
|
|
5635
|
+
_(null), ie(!1), await A(), V(!0);
|
|
5597
5636
|
} catch (h) {
|
|
5598
5637
|
console.error("Error starting identity verification:", h);
|
|
5599
5638
|
}
|
|
5600
5639
|
}, te = async () => {
|
|
5601
5640
|
try {
|
|
5602
|
-
_(null),
|
|
5641
|
+
_(null), ie(!1), N(null), console.log("[Identity] Restarting verification..."), await T(), V(!0);
|
|
5603
5642
|
} catch (h) {
|
|
5604
5643
|
console.error("Error restarting identity verification:", h), _(h.message || "Failed to restart verification");
|
|
5605
5644
|
}
|
|
5606
5645
|
};
|
|
5607
5646
|
if (E || P)
|
|
5608
|
-
return /* @__PURE__ */ r(re, { children: /* @__PURE__ */
|
|
5647
|
+
return /* @__PURE__ */ r(re, { children: /* @__PURE__ */ o(ne, { children: [
|
|
5609
5648
|
/* @__PURE__ */ r(Me, { className: "my-8" }),
|
|
5610
5649
|
/* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading identity verification..." })
|
|
5611
5650
|
] }) });
|
|
5612
5651
|
if (v)
|
|
5613
|
-
return /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */
|
|
5652
|
+
return /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
5614
5653
|
"Error: ",
|
|
5615
5654
|
v.message
|
|
5616
5655
|
] }) }) });
|
|
5617
5656
|
if ($ && (G || J))
|
|
5618
|
-
return /* @__PURE__ */
|
|
5657
|
+
return /* @__PURE__ */ o(re, { children: [
|
|
5619
5658
|
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
|
|
5620
|
-
/* @__PURE__ */
|
|
5621
|
-
/* @__PURE__ */ r("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg mb-6", children: /* @__PURE__ */
|
|
5659
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
5660
|
+
/* @__PURE__ */ r("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg mb-6", children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
|
|
5622
5661
|
/* @__PURE__ */ r(
|
|
5623
5662
|
"svg",
|
|
5624
5663
|
{
|
|
@@ -5637,41 +5676,41 @@ const En = ({
|
|
|
5637
5676
|
)
|
|
5638
5677
|
}
|
|
5639
5678
|
),
|
|
5640
|
-
/* @__PURE__ */
|
|
5679
|
+
/* @__PURE__ */ o("div", { children: [
|
|
5641
5680
|
/* @__PURE__ */ r("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children: J ? "Session Expired" : "Verification Error" }),
|
|
5642
5681
|
/* @__PURE__ */ r("p", { className: "text-red-800 dark:text-red-200 text-sm", children: G || "Your verification session has expired and needs to be restarted." })
|
|
5643
5682
|
] })
|
|
5644
5683
|
] }) }),
|
|
5645
|
-
/* @__PURE__ */
|
|
5684
|
+
/* @__PURE__ */ o("div", { className: "bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4", children: [
|
|
5646
5685
|
/* @__PURE__ */ r("h3", { className: "font-semibold text-blue-900 dark:text-blue-100 mb-2", children: "What to do next:" }),
|
|
5647
|
-
/* @__PURE__ */
|
|
5686
|
+
/* @__PURE__ */ o("ul", { className: "text-blue-800 dark:text-blue-200 text-sm space-y-1 list-disc list-inside", children: [
|
|
5648
5687
|
/* @__PURE__ */ r("li", { children: 'Click "Restart Verification" below to generate a new session' }),
|
|
5649
5688
|
/* @__PURE__ */ r("li", { children: "Complete the verification process without delays" }),
|
|
5650
5689
|
/* @__PURE__ */ r("li", { children: "If issues persist, contact support" })
|
|
5651
5690
|
] })
|
|
5652
5691
|
] })
|
|
5653
5692
|
] }),
|
|
5654
|
-
/* @__PURE__ */
|
|
5693
|
+
/* @__PURE__ */ o(Ce, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
5655
5694
|
n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
5656
5695
|
/* @__PURE__ */ r(Z, { type: "button", onClick: te, disabled: P, children: P ? "Restarting..." : "Restart Verification" })
|
|
5657
5696
|
] })
|
|
5658
5697
|
] });
|
|
5659
5698
|
if ($ && y) {
|
|
5660
5699
|
const h = p;
|
|
5661
|
-
return fe ? /* @__PURE__ */
|
|
5700
|
+
return fe ? /* @__PURE__ */ o("div", { style: {
|
|
5662
5701
|
background: "var(--metakyc-background, #ffffff)",
|
|
5663
5702
|
borderRadius: "12px",
|
|
5664
5703
|
border: "1px solid var(--metakyc-border, #e5e7eb)",
|
|
5665
5704
|
overflow: "hidden"
|
|
5666
5705
|
}, children: [
|
|
5667
|
-
/* @__PURE__ */
|
|
5706
|
+
/* @__PURE__ */ o("div", { style: {
|
|
5668
5707
|
display: "flex",
|
|
5669
5708
|
alignItems: "center",
|
|
5670
5709
|
justifyContent: "space-between",
|
|
5671
5710
|
padding: "20px 24px",
|
|
5672
5711
|
borderBottom: "1px solid var(--metakyc-border, #e5e7eb)"
|
|
5673
5712
|
}, children: [
|
|
5674
|
-
/* @__PURE__ */
|
|
5713
|
+
/* @__PURE__ */ o("div", { children: [
|
|
5675
5714
|
/* @__PURE__ */ r("h2", { style: {
|
|
5676
5715
|
margin: 0,
|
|
5677
5716
|
fontSize: "20px",
|
|
@@ -5721,9 +5760,9 @@ const En = ({
|
|
|
5721
5760
|
padding: "16px 24px",
|
|
5722
5761
|
borderTop: "1px solid var(--metakyc-border, #e5e7eb)"
|
|
5723
5762
|
}, children: /* @__PURE__ */ r(Z, { variant: "outline", onClick: n, children: "Back" }) })
|
|
5724
|
-
] }) :
|
|
5725
|
-
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */
|
|
5726
|
-
/* @__PURE__ */
|
|
5763
|
+
] }) : b != null && b.url ? /* @__PURE__ */ o(re, { children: [
|
|
5764
|
+
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
|
|
5765
|
+
/* @__PURE__ */ o("div", { children: [
|
|
5727
5766
|
/* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
|
|
5728
5767
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
|
|
5729
5768
|
] }),
|
|
@@ -5739,15 +5778,15 @@ const En = ({
|
|
|
5739
5778
|
}
|
|
5740
5779
|
)
|
|
5741
5780
|
] }) }),
|
|
5742
|
-
/* @__PURE__ */
|
|
5743
|
-
/* @__PURE__ */ r("div", { className: "mb-4 p-3 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg", children: /* @__PURE__ */
|
|
5781
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
5782
|
+
/* @__PURE__ */ r("div", { className: "mb-4 p-3 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-yellow-800 dark:text-yellow-200 text-sm", children: [
|
|
5744
5783
|
/* @__PURE__ */ r("strong", { children: "Important:" }),
|
|
5745
5784
|
' If you see an "expired" or "invalid link" message below, click the "Restart" button above to generate a new verification session.'
|
|
5746
5785
|
] }) }),
|
|
5747
5786
|
/* @__PURE__ */ r("div", { className: "w-full", style: { height: "600px" }, children: /* @__PURE__ */ r(
|
|
5748
5787
|
"iframe",
|
|
5749
5788
|
{
|
|
5750
|
-
src:
|
|
5789
|
+
src: b.url,
|
|
5751
5790
|
className: "w-full h-full border-0 rounded-lg",
|
|
5752
5791
|
allow: "camera; microphone; geolocation",
|
|
5753
5792
|
title: "Identity Verification",
|
|
@@ -5755,10 +5794,10 @@ const En = ({
|
|
|
5755
5794
|
var q, W, X;
|
|
5756
5795
|
console.log("[Identity] Iframe loaded");
|
|
5757
5796
|
try {
|
|
5758
|
-
const m = O.target,
|
|
5759
|
-
if (
|
|
5760
|
-
const L = ((X = (W =
|
|
5761
|
-
(L.includes("expired") || L.includes("invalid") || L.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"),
|
|
5797
|
+
const m = O.target, I = m.contentDocument || ((q = m.contentWindow) == null ? void 0 : q.document);
|
|
5798
|
+
if (I) {
|
|
5799
|
+
const L = ((X = (W = I.body) == null ? void 0 : W.textContent) == null ? void 0 : X.toLowerCase()) || "";
|
|
5800
|
+
(L.includes("expired") || L.includes("invalid") || L.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), ie(!0), _("Your verification link has expired."));
|
|
5762
5801
|
}
|
|
5763
5802
|
} catch {
|
|
5764
5803
|
console.log("[Identity] Cannot check iframe content (CORS)");
|
|
@@ -5768,18 +5807,18 @@ const En = ({
|
|
|
5768
5807
|
) })
|
|
5769
5808
|
] }),
|
|
5770
5809
|
n && /* @__PURE__ */ r(Ce, { children: /* @__PURE__ */ r(Z, { variant: "outline", onClick: n, children: "Back" }) })
|
|
5771
|
-
] }) : h === Oe.SardinAI ? /* @__PURE__ */
|
|
5772
|
-
/* @__PURE__ */
|
|
5810
|
+
] }) : h === Oe.SardinAI ? /* @__PURE__ */ o(re, { children: [
|
|
5811
|
+
/* @__PURE__ */ o(Se, { children: [
|
|
5773
5812
|
/* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: "Device Risk Assessment" }),
|
|
5774
5813
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Analyzing device security and behavioral patterns..." })
|
|
5775
5814
|
] }),
|
|
5776
|
-
/* @__PURE__ */ r(ne, { children: /* @__PURE__ */
|
|
5815
|
+
/* @__PURE__ */ r(ne, { children: /* @__PURE__ */ o("div", { className: "text-center py-12", children: [
|
|
5777
5816
|
/* @__PURE__ */ r(Me, { className: "mb-4" }),
|
|
5778
5817
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait while we verify your device security" }),
|
|
5779
5818
|
/* @__PURE__ */ r("p", { className: "text-sm text-gray-500 dark:text-gray-500 mt-2", children: "This process is automatic and will complete in a few seconds" })
|
|
5780
5819
|
] }) })
|
|
5781
|
-
] }) : /* @__PURE__ */
|
|
5782
|
-
/* @__PURE__ */
|
|
5820
|
+
] }) : /* @__PURE__ */ o(re, { children: [
|
|
5821
|
+
/* @__PURE__ */ o(Se, { children: [
|
|
5783
5822
|
/* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
|
|
5784
5823
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
|
|
5785
5824
|
] }),
|
|
@@ -5799,7 +5838,7 @@ const En = ({
|
|
|
5799
5838
|
return String(O);
|
|
5800
5839
|
}, $e = ({ helpText: h }) => {
|
|
5801
5840
|
const [O, q] = k(!1), W = de(null), [, X] = k({ top: 0, left: 0 });
|
|
5802
|
-
return /* @__PURE__ */
|
|
5841
|
+
return /* @__PURE__ */ o(lt, { children: [
|
|
5803
5842
|
/* @__PURE__ */ r(
|
|
5804
5843
|
"button",
|
|
5805
5844
|
{
|
|
@@ -5808,8 +5847,8 @@ const En = ({
|
|
|
5808
5847
|
ref: W,
|
|
5809
5848
|
onClick: () => {
|
|
5810
5849
|
if (W.current) {
|
|
5811
|
-
const
|
|
5812
|
-
X({ top:
|
|
5850
|
+
const I = W.current.getBoundingClientRect();
|
|
5851
|
+
X({ top: I.bottom + window.scrollY + 6, left: I.left + window.scrollX });
|
|
5813
5852
|
}
|
|
5814
5853
|
q(!0);
|
|
5815
5854
|
},
|
|
@@ -5850,10 +5889,10 @@ const En = ({
|
|
|
5850
5889
|
justifyContent: "center"
|
|
5851
5890
|
},
|
|
5852
5891
|
onClick: () => q(!1),
|
|
5853
|
-
children: /* @__PURE__ */
|
|
5892
|
+
children: /* @__PURE__ */ o(
|
|
5854
5893
|
"div",
|
|
5855
5894
|
{
|
|
5856
|
-
onClick: (
|
|
5895
|
+
onClick: (I) => I.stopPropagation(),
|
|
5857
5896
|
style: {
|
|
5858
5897
|
background: "var(--metakyc-surface, var(--metakyc-background, #ffffff))",
|
|
5859
5898
|
border: "1px solid var(--metakyc-border, #e5e7eb)",
|
|
@@ -5891,7 +5930,7 @@ const En = ({
|
|
|
5891
5930
|
document.body
|
|
5892
5931
|
)
|
|
5893
5932
|
] });
|
|
5894
|
-
},
|
|
5933
|
+
}, Ie = (h, O) => O ? /* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "flex-start", gap: 5, flexWrap: "nowrap" }, children: [
|
|
5895
5934
|
/* @__PURE__ */ r("div", { style: { flex: 1, minWidth: 0 }, children: h }),
|
|
5896
5935
|
/* @__PURE__ */ r("div", { style: { paddingTop: 24 }, children: /* @__PURE__ */ r($e, { helpText: O }) })
|
|
5897
5936
|
] }) : h, _e = (h, O) => {
|
|
@@ -5917,7 +5956,7 @@ const En = ({
|
|
|
5917
5956
|
q
|
|
5918
5957
|
);
|
|
5919
5958
|
if (h.customType === "link")
|
|
5920
|
-
return /* @__PURE__ */ r("div", { style: oe(h.colSpan), children:
|
|
5959
|
+
return /* @__PURE__ */ r("div", { style: oe(h.colSpan), children: Ie(
|
|
5921
5960
|
/* @__PURE__ */ r(
|
|
5922
5961
|
"a",
|
|
5923
5962
|
{
|
|
@@ -5933,14 +5972,14 @@ const En = ({
|
|
|
5933
5972
|
) }, q);
|
|
5934
5973
|
if (h.customType === "checkbox" || h.customType === "link_checkbox") {
|
|
5935
5974
|
const m = X === "true" || X === !0;
|
|
5936
|
-
return /* @__PURE__ */ r("div", { style: oe(h.colSpan), children:
|
|
5937
|
-
/* @__PURE__ */
|
|
5975
|
+
return /* @__PURE__ */ r("div", { style: oe(h.colSpan), children: Ie(
|
|
5976
|
+
/* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
|
|
5938
5977
|
/* @__PURE__ */ r(
|
|
5939
5978
|
"input",
|
|
5940
5979
|
{
|
|
5941
5980
|
type: "checkbox",
|
|
5942
5981
|
checked: !!m,
|
|
5943
|
-
onChange: (
|
|
5982
|
+
onChange: (I) => ke((L) => ({ ...L, [W]: String(I.target.checked) })),
|
|
5944
5983
|
style: {
|
|
5945
5984
|
width: 16,
|
|
5946
5985
|
height: 16,
|
|
@@ -5950,7 +5989,7 @@ const En = ({
|
|
|
5950
5989
|
}
|
|
5951
5990
|
}
|
|
5952
5991
|
),
|
|
5953
|
-
/* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: h.customType === "link_checkbox" && h.linkUrl ? /* @__PURE__ */
|
|
5992
|
+
/* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: h.customType === "link_checkbox" && h.linkUrl ? /* @__PURE__ */ o(lt, { children: [
|
|
5954
5993
|
/* @__PURE__ */ r("a", { href: h.linkUrl, target: "_blank", rel: "noopener noreferrer", style: { color: "var(--metakyc-primary, #6366f1)", textDecoration: "underline" }, children: h.linkText || h.label }),
|
|
5955
5994
|
h.label && h.linkText ? ` ${h.label}` : ""
|
|
5956
5995
|
] }) : h.displayText || h.label })
|
|
@@ -5959,22 +5998,22 @@ const En = ({
|
|
|
5959
5998
|
) }, q);
|
|
5960
5999
|
}
|
|
5961
6000
|
if (h.customType === "group_checkbox") {
|
|
5962
|
-
const m = Array.isArray(X) ? X : X ? [X] : [],
|
|
6001
|
+
const m = Array.isArray(X) ? X : X ? [X] : [], I = (L) => {
|
|
5963
6002
|
h.singleSelect ? ke((u) => ({ ...u, [W]: m[0] === L ? [] : [L] })) : ke((u) => ({
|
|
5964
6003
|
...u,
|
|
5965
6004
|
[W]: m.includes(L) ? m.filter((l) => l !== L) : [...m, L]
|
|
5966
6005
|
}));
|
|
5967
6006
|
};
|
|
5968
|
-
return /* @__PURE__ */ r("div", { style: oe(h.colSpan), children:
|
|
5969
|
-
/* @__PURE__ */
|
|
6007
|
+
return /* @__PURE__ */ r("div", { style: oe(h.colSpan), children: Ie(
|
|
6008
|
+
/* @__PURE__ */ o("div", { className: "space-y-1.5", children: [
|
|
5970
6009
|
h.label && /* @__PURE__ */ r("p", { className: "text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: h.displayText || h.label }),
|
|
5971
|
-
(h.options || []).map((L) => /* @__PURE__ */
|
|
6010
|
+
(h.options || []).map((L) => /* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
|
|
5972
6011
|
/* @__PURE__ */ r(
|
|
5973
6012
|
"input",
|
|
5974
6013
|
{
|
|
5975
6014
|
type: "checkbox",
|
|
5976
6015
|
checked: m.includes(L.value),
|
|
5977
|
-
onChange: () =>
|
|
6016
|
+
onChange: () => I(L.value),
|
|
5978
6017
|
style: { width: 16, height: 16, flexShrink: 0, marginTop: 2, accentColor: "var(--metakyc-primary, #6366f1)" }
|
|
5979
6018
|
}
|
|
5980
6019
|
),
|
|
@@ -5984,10 +6023,10 @@ const En = ({
|
|
|
5984
6023
|
h.helpText
|
|
5985
6024
|
) }, q);
|
|
5986
6025
|
}
|
|
5987
|
-
return h.customType === "radio_group" ? /* @__PURE__ */ r("div", { style: oe(h.colSpan), children:
|
|
5988
|
-
/* @__PURE__ */
|
|
6026
|
+
return h.customType === "radio_group" ? /* @__PURE__ */ r("div", { style: oe(h.colSpan), children: Ie(
|
|
6027
|
+
/* @__PURE__ */ o("div", { className: "space-y-1.5", children: [
|
|
5989
6028
|
h.label && /* @__PURE__ */ r("p", { className: "text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: h.displayText || h.label }),
|
|
5990
|
-
(h.options || []).map((m) => /* @__PURE__ */
|
|
6029
|
+
(h.options || []).map((m) => /* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
|
|
5991
6030
|
/* @__PURE__ */ r(
|
|
5992
6031
|
"input",
|
|
5993
6032
|
{
|
|
@@ -5995,7 +6034,7 @@ const En = ({
|
|
|
5995
6034
|
name: `rg-${W}`,
|
|
5996
6035
|
value: m.value,
|
|
5997
6036
|
checked: X === m.value,
|
|
5998
|
-
onChange: () => ke((
|
|
6037
|
+
onChange: () => ke((I) => ({ ...I, [W]: m.value })),
|
|
5999
6038
|
style: { width: 16, height: 16, flexShrink: 0, marginTop: 2, accentColor: "var(--metakyc-primary, #6366f1)" }
|
|
6000
6039
|
}
|
|
6001
6040
|
),
|
|
@@ -6003,55 +6042,55 @@ const En = ({
|
|
|
6003
6042
|
] }, m.value))
|
|
6004
6043
|
] }),
|
|
6005
6044
|
h.helpText
|
|
6006
|
-
) }, q) : /* @__PURE__ */ r("div", { style: oe(h.colSpan), children:
|
|
6045
|
+
) }, q) : /* @__PURE__ */ r("div", { style: oe(h.colSpan), children: Ie(
|
|
6007
6046
|
/* @__PURE__ */ r(
|
|
6008
6047
|
xe,
|
|
6009
6048
|
{
|
|
6010
6049
|
label: h.displayText || h.label || W,
|
|
6011
6050
|
value: String(X ?? ""),
|
|
6012
|
-
onChange: (m) => ke((
|
|
6051
|
+
onChange: (m) => ke((I) => ({ ...I, [W]: m.target.value }))
|
|
6013
6052
|
}
|
|
6014
6053
|
),
|
|
6015
6054
|
h.helpText
|
|
6016
6055
|
) }, q);
|
|
6017
6056
|
}, at = (h, O) => {
|
|
6018
6057
|
if (h.isCustom) return _e(h, O);
|
|
6019
|
-
const q = h.name ?? "", W = nt[q], X = h.displayText || (W == null ? void 0 : W.label) || q, m = ve[q] ?? "",
|
|
6020
|
-
return h.editable ?
|
|
6058
|
+
const q = h.name ?? "", W = nt[q], X = h.displayText || (W == null ? void 0 : W.label) || q, m = ve[q] ?? "", I = q === "mobileCountryCode", L = !!(W != null && W.countriesType) && !I;
|
|
6059
|
+
return h.editable ? I ? /* @__PURE__ */ r("div", { style: oe(h.colSpan ?? 2), children: Ie(
|
|
6021
6060
|
/* @__PURE__ */ r(
|
|
6022
6061
|
qe,
|
|
6023
6062
|
{
|
|
6024
6063
|
label: X,
|
|
6025
6064
|
value: String(m),
|
|
6026
|
-
onChange: (u) =>
|
|
6065
|
+
onChange: (u) => pe((l) => ({ ...l, [q]: u })),
|
|
6027
6066
|
options: [{ value: "", label: "Select country code…" }, ...K]
|
|
6028
6067
|
}
|
|
6029
6068
|
),
|
|
6030
6069
|
h.helpText
|
|
6031
|
-
) }, `epc-${O}`) : L ? /* @__PURE__ */ r("div", { style: oe(h.colSpan ?? 2), children:
|
|
6070
|
+
) }, `epc-${O}`) : L ? /* @__PURE__ */ r("div", { style: oe(h.colSpan ?? 2), children: Ie(
|
|
6032
6071
|
/* @__PURE__ */ r(
|
|
6033
6072
|
qe,
|
|
6034
6073
|
{
|
|
6035
6074
|
label: X,
|
|
6036
6075
|
value: String(m),
|
|
6037
|
-
onChange: (u) =>
|
|
6076
|
+
onChange: (u) => pe((l) => ({ ...l, [q]: u })),
|
|
6038
6077
|
options: [{ value: "", label: `Select ${X.toLowerCase()}…` }, ...M]
|
|
6039
6078
|
}
|
|
6040
6079
|
),
|
|
6041
6080
|
h.helpText
|
|
6042
|
-
) }, `ec-${O}`) : /* @__PURE__ */ r("div", { style: oe(h.colSpan ?? 2), children:
|
|
6081
|
+
) }, `ec-${O}`) : /* @__PURE__ */ r("div", { style: oe(h.colSpan ?? 2), children: Ie(
|
|
6043
6082
|
/* @__PURE__ */ r(
|
|
6044
6083
|
xe,
|
|
6045
6084
|
{
|
|
6046
6085
|
label: X,
|
|
6047
6086
|
type: (W == null ? void 0 : W.type) === "date" ? "date" : (W == null ? void 0 : W.type) === "email" ? "email" : "text",
|
|
6048
6087
|
value: String(m),
|
|
6049
|
-
onChange: (u) =>
|
|
6088
|
+
onChange: (u) => pe((l) => ({ ...l, [q]: u.target.value }))
|
|
6050
6089
|
}
|
|
6051
6090
|
),
|
|
6052
6091
|
h.helpText
|
|
6053
|
-
) }, `ei-${O}`) : /* @__PURE__ */ r("div", { style: oe(h.colSpan ?? 2), children:
|
|
6054
|
-
/* @__PURE__ */
|
|
6092
|
+
) }, `ei-${O}`) : /* @__PURE__ */ r("div", { style: oe(h.colSpan ?? 2), children: Ie(
|
|
6093
|
+
/* @__PURE__ */ o(lt, { children: [
|
|
6055
6094
|
/* @__PURE__ */ r("label", { className: "block text-sm font-medium mb-0.5", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: X }),
|
|
6056
6095
|
/* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)", minHeight: "1.5rem" }, children: Ne(q, m) })
|
|
6057
6096
|
] }),
|
|
@@ -6061,36 +6100,36 @@ const En = ({
|
|
|
6061
6100
|
if (F) {
|
|
6062
6101
|
const h = F.title || "Review Your Information", O = F.subtitle || "Please review and confirm your information before starting identity verification";
|
|
6063
6102
|
return /* @__PURE__ */ r("form", { onSubmit: (q) => {
|
|
6064
|
-
q.preventDefault(),
|
|
6065
|
-
}, children: /* @__PURE__ */
|
|
6066
|
-
/* @__PURE__ */
|
|
6103
|
+
q.preventDefault(), R();
|
|
6104
|
+
}, children: /* @__PURE__ */ o(re, { children: [
|
|
6105
|
+
/* @__PURE__ */ o(Se, { children: [
|
|
6067
6106
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: h }),
|
|
6068
6107
|
/* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: O })
|
|
6069
6108
|
] }),
|
|
6070
6109
|
/* @__PURE__ */ r(ne, { children: /* @__PURE__ */ r("div", { style: { display: "grid", gridTemplateColumns: "repeat(4, minmax(0, 1fr))", gap: "1rem" }, children: F.fields.map((q, W) => at(q, W)) }) }),
|
|
6071
|
-
/* @__PURE__ */
|
|
6110
|
+
/* @__PURE__ */ o(Ce, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
6072
6111
|
n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
6073
6112
|
/* @__PURE__ */ r(Z, { type: "submit", isLoading: P, children: "Confirm and Start Verification" })
|
|
6074
6113
|
] })
|
|
6075
6114
|
] }) });
|
|
6076
6115
|
}
|
|
6077
|
-
return /* @__PURE__ */ r("form", { onSubmit: H.handleSubmit(
|
|
6078
|
-
/* @__PURE__ */
|
|
6116
|
+
return /* @__PURE__ */ r("form", { onSubmit: H.handleSubmit(R), children: /* @__PURE__ */ o(re, { children: [
|
|
6117
|
+
/* @__PURE__ */ o(Se, { children: [
|
|
6079
6118
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Review Your Information" }),
|
|
6080
6119
|
/* @__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" })
|
|
6081
6120
|
] }),
|
|
6082
|
-
/* @__PURE__ */
|
|
6121
|
+
/* @__PURE__ */ o(ne, { className: "space-y-6", children: [
|
|
6083
6122
|
/* @__PURE__ */ r("div", { className: "space-y-4 pb-4", style: { borderBottom: "1px solid var(--metakyc-border, #e5e7eb)" }, children: [
|
|
6084
6123
|
{ label: "Name", value: `${((Ze = z == null ? void 0 : z.applicantRequestData) == null ? void 0 : Ze.firstName) || ""} ${((je = z == null ? void 0 : z.applicantRequestData) == null ? void 0 : je.lastName) || ""}`.trim() },
|
|
6085
6124
|
{ label: "Email", value: (it = z == null ? void 0 : z.applicantRequestData) == null ? void 0 : it.email },
|
|
6086
6125
|
{ label: "Date of Birth", value: ((Ye = z == null ? void 0 : z.applicantRequestData) == null ? void 0 : Ye.dateOfBirth) || "Not provided" }
|
|
6087
|
-
].map(({ label: h, value: O }) => /* @__PURE__ */
|
|
6126
|
+
].map(({ label: h, value: O }) => /* @__PURE__ */ o("div", { children: [
|
|
6088
6127
|
/* @__PURE__ */ r("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: h }),
|
|
6089
6128
|
/* @__PURE__ */ r("p", { className: "mt-1 text-base", style: { color: "var(--metakyc-text-primary, #111827)" }, children: O })
|
|
6090
6129
|
] }, h)) }),
|
|
6091
|
-
/* @__PURE__ */
|
|
6130
|
+
/* @__PURE__ */ o("div", { className: "space-y-4", children: [
|
|
6092
6131
|
/* @__PURE__ */ r("h3", { className: "text-base font-semibold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Address Information" }),
|
|
6093
|
-
/* @__PURE__ */
|
|
6132
|
+
/* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
6094
6133
|
/* @__PURE__ */ r(
|
|
6095
6134
|
et,
|
|
6096
6135
|
{
|
|
@@ -6124,18 +6163,18 @@ const En = ({
|
|
|
6124
6163
|
}
|
|
6125
6164
|
)
|
|
6126
6165
|
] }),
|
|
6127
|
-
/* @__PURE__ */
|
|
6166
|
+
/* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
6128
6167
|
/* @__PURE__ */ r(et, { control: H.control, name: "street", render: ({ field: h }) => /* @__PURE__ */ r(xe, { ...h, label: "Street" }) }),
|
|
6129
6168
|
/* @__PURE__ */ r(et, { control: H.control, name: "streetNumber", render: ({ field: h }) => /* @__PURE__ */ r(xe, { ...h, label: "Street Number" }) })
|
|
6130
6169
|
] }),
|
|
6131
|
-
/* @__PURE__ */
|
|
6170
|
+
/* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
6132
6171
|
/* @__PURE__ */ r(et, { control: H.control, name: "city", render: ({ field: h }) => /* @__PURE__ */ r(xe, { ...h, label: "City" }) }),
|
|
6133
6172
|
/* @__PURE__ */ r(et, { control: H.control, name: "zip", render: ({ field: h }) => /* @__PURE__ */ r(xe, { ...h, label: "ZIP / Postal Code" }) })
|
|
6134
6173
|
] }),
|
|
6135
6174
|
/* @__PURE__ */ r(et, { control: H.control, name: "phonenumber", render: ({ field: h }) => /* @__PURE__ */ r(xe, { ...h, label: "Phone Number", type: "tel" }) })
|
|
6136
6175
|
] })
|
|
6137
6176
|
] }),
|
|
6138
|
-
/* @__PURE__ */
|
|
6177
|
+
/* @__PURE__ */ o(Ce, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
6139
6178
|
n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
6140
6179
|
/* @__PURE__ */ r(Z, { type: "submit", isLoading: P, children: "Confirm and Start Verification" })
|
|
6141
6180
|
] })
|
|
@@ -6146,7 +6185,7 @@ const En = ({
|
|
|
6146
6185
|
workflowResult: n,
|
|
6147
6186
|
customMessage: a,
|
|
6148
6187
|
onContinue: i,
|
|
6149
|
-
onContactSupport:
|
|
6188
|
+
onContactSupport: s
|
|
6150
6189
|
}) => {
|
|
6151
6190
|
const d = e === tt.Approved ? {
|
|
6152
6191
|
type: "success",
|
|
@@ -6219,8 +6258,8 @@ const En = ({
|
|
|
6219
6258
|
iconColor: "text-blue-600 dark:text-blue-400",
|
|
6220
6259
|
message: "Your application is being reviewed."
|
|
6221
6260
|
};
|
|
6222
|
-
return /* @__PURE__ */
|
|
6223
|
-
/* @__PURE__ */
|
|
6261
|
+
return /* @__PURE__ */ o(re, { children: [
|
|
6262
|
+
/* @__PURE__ */ o(ne, { className: "py-12", children: [
|
|
6224
6263
|
/* @__PURE__ */ r("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ r(
|
|
6225
6264
|
"div",
|
|
6226
6265
|
{
|
|
@@ -6237,46 +6276,46 @@ const En = ({
|
|
|
6237
6276
|
}
|
|
6238
6277
|
) }),
|
|
6239
6278
|
/* @__PURE__ */ r("p", { className: "text-center mb-6 max-w-md mx-auto", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: a || d.message }),
|
|
6240
|
-
d.type === "success" && /* @__PURE__ */
|
|
6279
|
+
d.type === "success" && /* @__PURE__ */ o("div", { className: "bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg p-4 mb-6", children: [
|
|
6241
6280
|
/* @__PURE__ */ r("h3", { className: "font-semibold text-green-900 dark:text-green-100 mb-2", children: "What's Next?" }),
|
|
6242
|
-
/* @__PURE__ */
|
|
6281
|
+
/* @__PURE__ */ o("ul", { className: "text-sm text-green-800 dark:text-green-200 space-y-1", children: [
|
|
6243
6282
|
/* @__PURE__ */ r("li", { children: "✓ Your identity has been verified" }),
|
|
6244
6283
|
/* @__PURE__ */ r("li", { children: "✓ You can now proceed with your application" }),
|
|
6245
6284
|
/* @__PURE__ */ r("li", { children: "✓ All features are now accessible" })
|
|
6246
6285
|
] })
|
|
6247
6286
|
] }),
|
|
6248
|
-
d.type === "error" && /* @__PURE__ */
|
|
6287
|
+
d.type === "error" && /* @__PURE__ */ o("div", { className: "bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4 mb-6", children: [
|
|
6249
6288
|
/* @__PURE__ */ r("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-2", children: "What Can You Do?" }),
|
|
6250
|
-
/* @__PURE__ */
|
|
6289
|
+
/* @__PURE__ */ o("ul", { className: "text-sm text-red-800 dark:text-red-200 space-y-2", children: [
|
|
6251
6290
|
/* @__PURE__ */ r("li", { children: "• Review the requirements and ensure all information is correct" }),
|
|
6252
6291
|
/* @__PURE__ */ r("li", { children: "• Contact our support team for assistance" }),
|
|
6253
6292
|
/* @__PURE__ */ r("li", { children: "• You may be able to resubmit your application" })
|
|
6254
6293
|
] })
|
|
6255
6294
|
] }),
|
|
6256
|
-
d.type === "pending" && /* @__PURE__ */
|
|
6295
|
+
d.type === "pending" && /* @__PURE__ */ o("div", { className: "bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4 mb-6", children: [
|
|
6257
6296
|
/* @__PURE__ */ r("h3", { className: "font-semibold text-blue-900 dark:text-blue-100 mb-2", children: "What Happens Next?" }),
|
|
6258
|
-
/* @__PURE__ */
|
|
6297
|
+
/* @__PURE__ */ o("ul", { className: "text-sm text-blue-800 dark:text-blue-200 space-y-2", children: [
|
|
6259
6298
|
/* @__PURE__ */ r("li", { children: "• Our team is reviewing your information" }),
|
|
6260
6299
|
/* @__PURE__ */ r("li", { children: "• You will be notified via email once the review is complete" }),
|
|
6261
6300
|
/* @__PURE__ */ r("li", { children: "• This typically takes 24-48 hours" }),
|
|
6262
6301
|
/* @__PURE__ */ r("li", { children: "• No action is required from you at this time" })
|
|
6263
6302
|
] })
|
|
6264
6303
|
] }),
|
|
6265
|
-
/* @__PURE__ */ r("div", { className: "mt-6 pt-6", style: { borderTop: "1px solid var(--metakyc-border, #e5e7eb)" }, children: /* @__PURE__ */
|
|
6266
|
-
/* @__PURE__ */
|
|
6304
|
+
/* @__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: [
|
|
6305
|
+
/* @__PURE__ */ o("div", { children: [
|
|
6267
6306
|
/* @__PURE__ */ r("span", { style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: "KYC Status:" }),
|
|
6268
6307
|
/* @__PURE__ */ r("div", { className: "font-medium mt-1", style: { color: "var(--metakyc-text-primary, #111827)" }, children: e != null ? tt[e] : "Not Available" })
|
|
6269
6308
|
] }),
|
|
6270
|
-
/* @__PURE__ */
|
|
6309
|
+
/* @__PURE__ */ o("div", { children: [
|
|
6271
6310
|
/* @__PURE__ */ r("span", { style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: "Review Status:" }),
|
|
6272
6311
|
/* @__PURE__ */ r("div", { className: "font-medium mt-1", style: { color: "var(--metakyc-text-primary, #111827)" }, children: rt[t] })
|
|
6273
6312
|
] })
|
|
6274
6313
|
] }) })
|
|
6275
6314
|
] }),
|
|
6276
|
-
/* @__PURE__ */
|
|
6315
|
+
/* @__PURE__ */ o(Ce, { style: { display: "flex", justifyContent: "center", gap: "1rem" }, children: [
|
|
6277
6316
|
d.type === "success" && i && /* @__PURE__ */ r(Z, { onClick: i, size: "lg", children: "Continue" }),
|
|
6278
|
-
d.type === "error" && /* @__PURE__ */
|
|
6279
|
-
|
|
6317
|
+
d.type === "error" && /* @__PURE__ */ o(lt, { children: [
|
|
6318
|
+
s && /* @__PURE__ */ r(Z, { variant: "outline", onClick: s, children: "Contact Support" }),
|
|
6280
6319
|
i && /* @__PURE__ */ r(Z, { onClick: i, children: "Try Again" })
|
|
6281
6320
|
] }),
|
|
6282
6321
|
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" }) })
|
|
@@ -6302,16 +6341,16 @@ const En = ({
|
|
|
6302
6341
|
subtitle: t,
|
|
6303
6342
|
className: n = ""
|
|
6304
6343
|
}) => {
|
|
6305
|
-
const { currentTheme: a } = Te(), i = e || (a == null ? void 0 : a.title) || "",
|
|
6306
|
-
return !
|
|
6307
|
-
/* @__PURE__ */
|
|
6344
|
+
const { currentTheme: a } = Te(), i = e || (a == null ? void 0 : a.title) || "", s = !!(a != null && a.logo && a.logo.visible && a.logo.url), c = !!i;
|
|
6345
|
+
return !s && !c ? null : /* @__PURE__ */ o("div", { className: `metakyc-header ${n}`, children: [
|
|
6346
|
+
/* @__PURE__ */ o(
|
|
6308
6347
|
"div",
|
|
6309
6348
|
{
|
|
6310
6349
|
className: "metakyc-header-title flex items-center text-xl font-bold",
|
|
6311
6350
|
style: { color: "var(--metakyc-text-primary, #111827)" },
|
|
6312
6351
|
children: [
|
|
6313
|
-
|
|
6314
|
-
|
|
6352
|
+
s && /* @__PURE__ */ r(Pn, { config: a.logo }),
|
|
6353
|
+
s && c && /* @__PURE__ */ r(
|
|
6315
6354
|
"span",
|
|
6316
6355
|
{
|
|
6317
6356
|
style: { fontSize: "1.5rem", fontWeight: 300, color: "var(--metakyc-text-muted, #9ca3af)", margin: "0 12px" },
|
|
@@ -6325,7 +6364,7 @@ const En = ({
|
|
|
6325
6364
|
t && /* @__PURE__ */ r("p", { className: "text-sm mt-1", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: t })
|
|
6326
6365
|
] });
|
|
6327
6366
|
}, ft = ["firstName", "lastName", "email", "phonenumber", "dateOfBirth"];
|
|
6328
|
-
function
|
|
6367
|
+
function st(e) {
|
|
6329
6368
|
return e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
6330
6369
|
}
|
|
6331
6370
|
const pt = {
|
|
@@ -6361,10 +6400,10 @@ const pt = {
|
|
|
6361
6400
|
justifyContent: "center",
|
|
6362
6401
|
padding: "16px"
|
|
6363
6402
|
},
|
|
6364
|
-
children: /* @__PURE__ */
|
|
6403
|
+
children: /* @__PURE__ */ o(
|
|
6365
6404
|
"div",
|
|
6366
6405
|
{
|
|
6367
|
-
onClick: (
|
|
6406
|
+
onClick: (s) => s.stopPropagation(),
|
|
6368
6407
|
style: {
|
|
6369
6408
|
background: "var(--metakyc-surface, var(--metakyc-background, #ffffff))",
|
|
6370
6409
|
border: "1px solid var(--metakyc-border, #e5e7eb)",
|
|
@@ -6420,7 +6459,7 @@ const pt = {
|
|
|
6420
6459
|
)
|
|
6421
6460
|
}
|
|
6422
6461
|
) : null;
|
|
6423
|
-
return /* @__PURE__ */
|
|
6462
|
+
return /* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "flex-start", gap: "5px", flexWrap: "nowrap" }, children: [
|
|
6424
6463
|
t,
|
|
6425
6464
|
/* @__PURE__ */ r(
|
|
6426
6465
|
"button",
|
|
@@ -6450,11 +6489,11 @@ const pt = {
|
|
|
6450
6489
|
zIndex: 2,
|
|
6451
6490
|
transition: "background 0.15s, color 0.15s"
|
|
6452
6491
|
},
|
|
6453
|
-
onMouseEnter: (
|
|
6454
|
-
|
|
6492
|
+
onMouseEnter: (s) => {
|
|
6493
|
+
s.currentTarget.style.background = "var(--metakyc-primary, #2563eb)", s.currentTarget.style.color = "#ffffff";
|
|
6455
6494
|
},
|
|
6456
|
-
onMouseLeave: (
|
|
6457
|
-
|
|
6495
|
+
onMouseLeave: (s) => {
|
|
6496
|
+
s.currentTarget.style.background = "transparent", s.currentTarget.style.color = "var(--metakyc-primary, #2563eb)";
|
|
6458
6497
|
},
|
|
6459
6498
|
children: "?"
|
|
6460
6499
|
}
|
|
@@ -6467,13 +6506,13 @@ const pt = {
|
|
|
6467
6506
|
onSuccess: n,
|
|
6468
6507
|
onCancel: a
|
|
6469
6508
|
}) => {
|
|
6470
|
-
var q, W, X, m,
|
|
6471
|
-
const { config: i, baseInformationService:
|
|
6509
|
+
var q, W, X, m, I, L, u;
|
|
6510
|
+
const { config: i, baseInformationService: s, currentTheme: c } = Te(), { createApplicant: d, isLoading: y } = zt(), p = e || ((q = i.applicantForm) == null ? void 0 : q.workflowKey);
|
|
6472
6511
|
if (!p)
|
|
6473
6512
|
throw new Error(
|
|
6474
6513
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
6475
6514
|
);
|
|
6476
|
-
const
|
|
6515
|
+
const b = t || ((W = i.applicantForm) == null ? void 0 : W.externalRefId) || "", P = ((X = i.applicantForm) == null ? void 0 : X.email) || "", v = ((m = i.applicantForm) == null ? void 0 : m.hiddenValues) || {}, A = ((I = i.applicantForm) == null ? void 0 : I.initialValues) || {}, w = (((L = i.applicantForm) == null ? void 0 : L.fieldLabelMode) || (c == null ? void 0 : c.fieldLabelMode) || "label") !== "placeholder", N = De(
|
|
6477
6516
|
() => c != null && c.applicantFormPages && c.applicantFormPages.length > 0 ? c.applicantFormPages : null,
|
|
6478
6517
|
[c == null ? void 0 : c.applicantFormPages]
|
|
6479
6518
|
), z = De(() => {
|
|
@@ -6481,20 +6520,20 @@ const pt = {
|
|
|
6481
6520
|
if (f) for (const D of f) l.add(D);
|
|
6482
6521
|
if (N)
|
|
6483
6522
|
for (const D of N)
|
|
6484
|
-
for (const
|
|
6485
|
-
!
|
|
6523
|
+
for (const x of D.fields)
|
|
6524
|
+
!x.isCustom && x.name && x.required && l.add(x.name);
|
|
6486
6525
|
return Array.from(l);
|
|
6487
6526
|
}, [c == null ? void 0 : c.applicantFormRequiredFields, N]), Q = De(() => {
|
|
6488
6527
|
var D;
|
|
6489
6528
|
if (N) {
|
|
6490
|
-
const
|
|
6529
|
+
const x = N.flatMap((S) => S.fields).filter((S) => !S.isCustom && S.name).map((S) => S.name), C = new Set(x);
|
|
6491
6530
|
for (const S of ft) C.add(S);
|
|
6492
6531
|
return Array.from(C);
|
|
6493
6532
|
}
|
|
6494
6533
|
let l;
|
|
6495
6534
|
(D = i.applicantForm) != null && D.visibleFields ? l = i.applicantForm.visibleFields : c != null && c.applicantFormVisibleFields && c.applicantFormVisibleFields.length > 0 ? l = c.applicantFormVisibleFields : l = cr;
|
|
6496
6535
|
const f = new Set(l);
|
|
6497
|
-
for (const
|
|
6536
|
+
for (const x of ft) f.add(x);
|
|
6498
6537
|
return Array.from(f);
|
|
6499
6538
|
}, [(u = i.applicantForm) == null ? void 0 : u.visibleFields, c == null ? void 0 : c.applicantFormVisibleFields, N]), M = /* @__PURE__ */ new Set([
|
|
6500
6539
|
"country",
|
|
@@ -6507,18 +6546,18 @@ const pt = {
|
|
|
6507
6546
|
var f, D;
|
|
6508
6547
|
const l = /* @__PURE__ */ new Set();
|
|
6509
6548
|
if (N)
|
|
6510
|
-
for (const
|
|
6511
|
-
for (const C of
|
|
6549
|
+
for (const x of N)
|
|
6550
|
+
for (const C of x.fields)
|
|
6512
6551
|
!C.isCustom && C.name && M.has(C.name) && l.add(C.countriesType ?? ((f = nt[C.name]) == null ? void 0 : f.countriesType));
|
|
6513
6552
|
else
|
|
6514
|
-
for (const
|
|
6515
|
-
M.has(
|
|
6553
|
+
for (const x of Q)
|
|
6554
|
+
M.has(x) && l.add((D = nt[x]) == null ? void 0 : D.countriesType);
|
|
6516
6555
|
return l.size === 0 && l.add(void 0), Array.from(l);
|
|
6517
6556
|
}, [Q, N]), [K, ee] = k({}), [E, g] = k(!0), $ = de(/* @__PURE__ */ new Set()), V = de(/* @__PURE__ */ new Set());
|
|
6518
6557
|
ge(() => {
|
|
6519
6558
|
if (!c) return;
|
|
6520
|
-
const l = j.filter((
|
|
6521
|
-
const C =
|
|
6559
|
+
const l = j.filter((x) => {
|
|
6560
|
+
const C = x != null ? String(x) : "all";
|
|
6522
6561
|
return !V.current.has(C) && !$.current.has(C);
|
|
6523
6562
|
});
|
|
6524
6563
|
if (l.length === 0) {
|
|
@@ -6529,21 +6568,21 @@ const pt = {
|
|
|
6529
6568
|
return;
|
|
6530
6569
|
}
|
|
6531
6570
|
g(!0);
|
|
6532
|
-
const f = l.map((
|
|
6533
|
-
f.forEach((
|
|
6571
|
+
const f = l.map((x) => x != null ? String(x) : "all");
|
|
6572
|
+
f.forEach((x) => $.current.add(x)), (async () => {
|
|
6534
6573
|
try {
|
|
6535
|
-
const
|
|
6574
|
+
const x = await Promise.all(
|
|
6536
6575
|
l.map(async (C) => {
|
|
6537
|
-
const S = C != null ? String(C) : "all",
|
|
6576
|
+
const S = C != null ? String(C) : "all", ue = await s.getCountries("", i.locale || "en", C), se = C === 40, be = /* @__PURE__ */ new Set(), Pe = ue.map((le) => se && le.countryCode ? {
|
|
6538
6577
|
value: le.countryCode,
|
|
6539
6578
|
label: `${le.countryCode} – ${le.name}`
|
|
6540
6579
|
} : { value: le.abbreviation3 || le.abbreviation, label: le.name }).filter((le) => !le.value || be.has(le.value) ? !1 : (be.add(le.value), !0));
|
|
6541
6580
|
return V.current.add(S), $.current.delete(S), [S, Pe];
|
|
6542
6581
|
})
|
|
6543
6582
|
);
|
|
6544
|
-
ee((C) => ({ ...C, ...Object.fromEntries(
|
|
6545
|
-
} catch (
|
|
6546
|
-
f.forEach((C) => $.current.delete(C)), console.error("Failed to load countries:",
|
|
6583
|
+
ee((C) => ({ ...C, ...Object.fromEntries(x) }));
|
|
6584
|
+
} catch (x) {
|
|
6585
|
+
f.forEach((C) => $.current.delete(C)), console.error("Failed to load countries:", x);
|
|
6547
6586
|
} finally {
|
|
6548
6587
|
j.every((C) => {
|
|
6549
6588
|
const S = C != null ? String(C) : "all";
|
|
@@ -6554,8 +6593,8 @@ const pt = {
|
|
|
6554
6593
|
}, [j, c]);
|
|
6555
6594
|
const G = (l, f) => {
|
|
6556
6595
|
var C;
|
|
6557
|
-
const D = f ?? ((C = nt[l]) == null ? void 0 : C.countriesType),
|
|
6558
|
-
return K[
|
|
6596
|
+
const D = f ?? ((C = nt[l]) == null ? void 0 : C.countriesType), x = D != null ? String(D) : "all";
|
|
6597
|
+
return K[x] || [];
|
|
6559
6598
|
}, _ = {
|
|
6560
6599
|
firstName: 1,
|
|
6561
6600
|
lastName: 1,
|
|
@@ -6581,7 +6620,7 @@ const pt = {
|
|
|
6581
6620
|
taxNumber: 1
|
|
6582
6621
|
}, J = Object.fromEntries(
|
|
6583
6622
|
Object.entries(v).filter(([l]) => l in _)
|
|
6584
|
-
),
|
|
6623
|
+
), ie = Object.fromEntries(
|
|
6585
6624
|
Object.entries(A).filter(([l]) => l in _)
|
|
6586
6625
|
), [Y, ve] = k({
|
|
6587
6626
|
workflowKey: p,
|
|
@@ -6591,7 +6630,7 @@ const pt = {
|
|
|
6591
6630
|
email: P,
|
|
6592
6631
|
dateOfBirth: "",
|
|
6593
6632
|
phonenumber: "",
|
|
6594
|
-
externalRefId:
|
|
6633
|
+
externalRefId: b,
|
|
6595
6634
|
mobileCountryCode: "",
|
|
6596
6635
|
street: "",
|
|
6597
6636
|
streetNumber: "",
|
|
@@ -6609,23 +6648,23 @@ const pt = {
|
|
|
6609
6648
|
occupation: "",
|
|
6610
6649
|
taxNumber: "",
|
|
6611
6650
|
...J,
|
|
6612
|
-
...
|
|
6613
|
-
}),
|
|
6651
|
+
...ie
|
|
6652
|
+
}), pe = Object.fromEntries(
|
|
6614
6653
|
Object.entries(v).filter(([l]) => !(l in J) && l !== "externalRefId" && l !== "workflowKey")
|
|
6615
|
-
), [me, ke] = k({ ...
|
|
6654
|
+
), [me, ke] = k({ ...pe }), [F, U] = k(0), [B, H] = k({}), [fe, R] = k(null), [te, ye] = k(!1), oe = (l, f) => ve((D) => ({ ...D, [l]: f })), Ne = (l, f) => ke((D) => ({ ...D, [l]: f })), $e = (l) => !l.conditionalOn || me[l.conditionalOn] === "true", Ie = N && F < N.length - 1 ? F + 1 : -1, _e = N && F > 0 ? F - 1 : -1, at = (l) => {
|
|
6616
6655
|
var D;
|
|
6617
6656
|
const f = {};
|
|
6618
|
-
for (const
|
|
6619
|
-
if (
|
|
6620
|
-
if (
|
|
6621
|
-
if (
|
|
6622
|
-
const C = me[
|
|
6623
|
-
|
|
6657
|
+
for (const x of l.fields)
|
|
6658
|
+
if (x.isCustom) {
|
|
6659
|
+
if (x.customType === "paragraph" || x.customType === "html" || x.customType === "br" || x.customType === "link") continue;
|
|
6660
|
+
if (x.required && x.paramName) {
|
|
6661
|
+
const C = me[x.paramName], S = x.displayText || x.label || x.paramName;
|
|
6662
|
+
x.customType === "checkbox" || x.customType === "link_checkbox" ? C !== "true" && (f[x.paramName] = `${S} is required.`) : (!C || C.trim() === "") && (f[x.paramName] = `${S} is required.`);
|
|
6624
6663
|
}
|
|
6625
|
-
} else if (
|
|
6626
|
-
const C =
|
|
6627
|
-
if (z.includes(C) &&
|
|
6628
|
-
const S =
|
|
6664
|
+
} else if (x.name) {
|
|
6665
|
+
const C = x.name;
|
|
6666
|
+
if (z.includes(C) && st(Y[C])) {
|
|
6667
|
+
const S = x.displayText || ((D = nt[C]) == null ? void 0 : D.label) || C;
|
|
6629
6668
|
f[C] = `${S} is required.`;
|
|
6630
6669
|
}
|
|
6631
6670
|
}
|
|
@@ -6634,7 +6673,7 @@ const pt = {
|
|
|
6634
6673
|
if (!N) return;
|
|
6635
6674
|
const l = N[F];
|
|
6636
6675
|
if (l.conditionalOn && !$e(l)) {
|
|
6637
|
-
H({}),
|
|
6676
|
+
H({}), Ie >= 0 ? U(Ie) : await je();
|
|
6638
6677
|
return;
|
|
6639
6678
|
}
|
|
6640
6679
|
const f = at(l);
|
|
@@ -6642,7 +6681,7 @@ const pt = {
|
|
|
6642
6681
|
H(f);
|
|
6643
6682
|
return;
|
|
6644
6683
|
}
|
|
6645
|
-
H({}),
|
|
6684
|
+
H({}), Ie >= 0 ? U(Ie) : await je();
|
|
6646
6685
|
}, je = async () => {
|
|
6647
6686
|
if (N) {
|
|
6648
6687
|
let l = {};
|
|
@@ -6653,10 +6692,10 @@ const pt = {
|
|
|
6653
6692
|
return;
|
|
6654
6693
|
}
|
|
6655
6694
|
}
|
|
6656
|
-
ye(!0),
|
|
6695
|
+
ye(!0), R(null);
|
|
6657
6696
|
try {
|
|
6658
6697
|
if (!Y.externalRefId || Y.externalRefId.trim() === "") {
|
|
6659
|
-
|
|
6698
|
+
R("External Reference ID is required. Please pass it via config.applicantForm.externalRefId.");
|
|
6660
6699
|
return;
|
|
6661
6700
|
}
|
|
6662
6701
|
const l = {
|
|
@@ -6668,20 +6707,20 @@ const pt = {
|
|
|
6668
6707
|
if ($e(C)) {
|
|
6669
6708
|
for (const S of C.fields)
|
|
6670
6709
|
if (!S.isCustom && S.name) {
|
|
6671
|
-
const
|
|
6672
|
-
|
|
6710
|
+
const ue = S.name, se = Y[ue];
|
|
6711
|
+
st(se) || (l[ue] = se);
|
|
6673
6712
|
}
|
|
6674
6713
|
}
|
|
6675
6714
|
for (const C of ft)
|
|
6676
6715
|
if (l[C] === void 0) {
|
|
6677
6716
|
const S = Y[C];
|
|
6678
|
-
|
|
6717
|
+
st(S) || (l[C] = S);
|
|
6679
6718
|
}
|
|
6680
6719
|
} else
|
|
6681
6720
|
Q.forEach((C) => {
|
|
6682
6721
|
if (C === "externalRefId") return;
|
|
6683
6722
|
const S = Y[C];
|
|
6684
|
-
|
|
6723
|
+
st(S) || (l[C] = S);
|
|
6685
6724
|
});
|
|
6686
6725
|
const f = [];
|
|
6687
6726
|
if (N) {
|
|
@@ -6689,24 +6728,24 @@ const pt = {
|
|
|
6689
6728
|
if ($e(C))
|
|
6690
6729
|
for (const S of C.fields) {
|
|
6691
6730
|
if (!S.isCustom || !S.paramName || S.customType === "paragraph" || S.customType === "html" || S.customType === "br" || S.customType === "link") continue;
|
|
6692
|
-
const
|
|
6693
|
-
let
|
|
6731
|
+
const ue = me[S.paramName] ?? "";
|
|
6732
|
+
let se;
|
|
6694
6733
|
if (S.customType === "checkbox" || S.customType === "link_checkbox")
|
|
6695
|
-
|
|
6696
|
-
else if (
|
|
6697
|
-
f.push({ paramName: S.paramName, value:
|
|
6734
|
+
se = ue === "true" ? "yes" : "no";
|
|
6735
|
+
else if (se = ue, !se && !S.required) continue;
|
|
6736
|
+
f.push({ paramName: S.paramName, value: se });
|
|
6698
6737
|
}
|
|
6699
6738
|
}
|
|
6700
6739
|
for (const [C, S] of Object.entries(J))
|
|
6701
|
-
l[C] === void 0 && !
|
|
6740
|
+
l[C] === void 0 && !st(S) && (l[C] = S);
|
|
6702
6741
|
const D = new Set(f.map((C) => C.paramName));
|
|
6703
|
-
for (const [C, S] of Object.entries(
|
|
6742
|
+
for (const [C, S] of Object.entries(pe))
|
|
6704
6743
|
!D.has(C) && S && f.push({ paramName: C, value: S });
|
|
6705
6744
|
f.length > 0 && (l.applicantAdditionalDatas = f);
|
|
6706
|
-
const
|
|
6707
|
-
n(
|
|
6745
|
+
const x = await d(l);
|
|
6746
|
+
n(x.applicantId);
|
|
6708
6747
|
} catch (l) {
|
|
6709
|
-
console.error("Error creating applicant:", l),
|
|
6748
|
+
console.error("Error creating applicant:", l), R(l.message || "Failed to create applicant");
|
|
6710
6749
|
} finally {
|
|
6711
6750
|
ye(!1);
|
|
6712
6751
|
}
|
|
@@ -6714,21 +6753,21 @@ const pt = {
|
|
|
6714
6753
|
var f;
|
|
6715
6754
|
l.preventDefault();
|
|
6716
6755
|
for (const D of z)
|
|
6717
|
-
if (
|
|
6718
|
-
const
|
|
6719
|
-
|
|
6756
|
+
if (st(Y[D])) {
|
|
6757
|
+
const x = ((f = nt[D]) == null ? void 0 : f.label) || D;
|
|
6758
|
+
R(`${x} is required.`);
|
|
6720
6759
|
return;
|
|
6721
6760
|
}
|
|
6722
6761
|
await je();
|
|
6723
|
-
}, Ye = (l, f, D,
|
|
6762
|
+
}, Ye = (l, f, D, x, C) => {
|
|
6724
6763
|
var Nt;
|
|
6725
6764
|
const S = nt[l];
|
|
6726
6765
|
if (!S) return null;
|
|
6727
|
-
const
|
|
6766
|
+
const ue = z.includes(l), se = B[l], be = D || S.label, Pe = l in ie, le = f ?? l, Be = { required: ue }, He = C ? C !== "placeholder" : w, Qe = He ? be : void 0, Wt = He ? "..." : be;
|
|
6728
6767
|
switch (S.type) {
|
|
6729
6768
|
case "select":
|
|
6730
6769
|
if (l === "country" || l === "nationality" || l === "taxCountry" || l === "countryOfBirth" || l === "mobileCountryCode") {
|
|
6731
|
-
const
|
|
6770
|
+
const Re = G(l, x);
|
|
6732
6771
|
return /* @__PURE__ */ r(
|
|
6733
6772
|
qe,
|
|
6734
6773
|
{
|
|
@@ -6736,10 +6775,10 @@ const pt = {
|
|
|
6736
6775
|
label: Qe,
|
|
6737
6776
|
value: Y[l] || "",
|
|
6738
6777
|
onChange: (Xe) => oe(l, Xe),
|
|
6739
|
-
options: [{ value: "", label: `Select ${Wt.toLowerCase()}` }, ...
|
|
6778
|
+
options: [{ value: "", label: `Select ${Wt.toLowerCase()}` }, ...Re],
|
|
6740
6779
|
disabled: E,
|
|
6741
6780
|
readOnly: Pe,
|
|
6742
|
-
error:
|
|
6781
|
+
error: se
|
|
6743
6782
|
},
|
|
6744
6783
|
le
|
|
6745
6784
|
);
|
|
@@ -6751,7 +6790,7 @@ const pt = {
|
|
|
6751
6790
|
...Be,
|
|
6752
6791
|
label: Qe,
|
|
6753
6792
|
value: ((Nt = Y[l]) == null ? void 0 : Nt.toString()) || "",
|
|
6754
|
-
onChange: (
|
|
6793
|
+
onChange: (Re) => oe(l, Re ? Number(Re) : null),
|
|
6755
6794
|
options: [
|
|
6756
6795
|
{ value: "", label: He ? "Select salutation..." : be },
|
|
6757
6796
|
{ value: bt.Male.toString(), label: "Male" },
|
|
@@ -6759,12 +6798,12 @@ const pt = {
|
|
|
6759
6798
|
{ value: bt.Other.toString(), label: "Other" }
|
|
6760
6799
|
],
|
|
6761
6800
|
readOnly: Pe,
|
|
6762
|
-
error:
|
|
6801
|
+
error: se
|
|
6763
6802
|
},
|
|
6764
6803
|
le
|
|
6765
6804
|
);
|
|
6766
6805
|
if (l === "defaultLanguage") {
|
|
6767
|
-
const
|
|
6806
|
+
const Re = c != null && c.allowedLanguages && c.allowedLanguages.length > 0 ? Rt.filter((Xe) => c.allowedLanguages.includes(Xe.value)) : Rt;
|
|
6768
6807
|
return /* @__PURE__ */ r(
|
|
6769
6808
|
qe,
|
|
6770
6809
|
{
|
|
@@ -6772,9 +6811,9 @@ const pt = {
|
|
|
6772
6811
|
label: Qe,
|
|
6773
6812
|
value: Y[l] || "",
|
|
6774
6813
|
onChange: (Xe) => oe(l, Xe),
|
|
6775
|
-
options: [{ value: "", label: He ? "Select language..." : be }, ...
|
|
6814
|
+
options: [{ value: "", label: He ? "Select language..." : be }, ...Re],
|
|
6776
6815
|
readOnly: Pe,
|
|
6777
|
-
error:
|
|
6816
|
+
error: se
|
|
6778
6817
|
},
|
|
6779
6818
|
le
|
|
6780
6819
|
);
|
|
@@ -6782,7 +6821,7 @@ const pt = {
|
|
|
6782
6821
|
return null;
|
|
6783
6822
|
case "multiselect":
|
|
6784
6823
|
if (l === "otherNationality") {
|
|
6785
|
-
const
|
|
6824
|
+
const Re = G(l, x);
|
|
6786
6825
|
return /* @__PURE__ */ r(
|
|
6787
6826
|
en,
|
|
6788
6827
|
{
|
|
@@ -6790,7 +6829,7 @@ const pt = {
|
|
|
6790
6829
|
label: Qe,
|
|
6791
6830
|
value: Y[l] || [],
|
|
6792
6831
|
onChange: (Xe) => oe(l, Xe),
|
|
6793
|
-
options:
|
|
6832
|
+
options: Re,
|
|
6794
6833
|
placeholder: He ? "Select other nationalities..." : be,
|
|
6795
6834
|
disabled: E,
|
|
6796
6835
|
readOnly: Pe
|
|
@@ -6808,9 +6847,9 @@ const pt = {
|
|
|
6808
6847
|
label: Qe,
|
|
6809
6848
|
placeholder: He ? void 0 : be,
|
|
6810
6849
|
value: Y[l] || "",
|
|
6811
|
-
onChange: (
|
|
6850
|
+
onChange: (Re) => oe(l, Re.target.value),
|
|
6812
6851
|
readOnly: Pe,
|
|
6813
|
-
error:
|
|
6852
|
+
error: se
|
|
6814
6853
|
},
|
|
6815
6854
|
le
|
|
6816
6855
|
);
|
|
@@ -6823,9 +6862,9 @@ const pt = {
|
|
|
6823
6862
|
label: Qe,
|
|
6824
6863
|
placeholder: He ? void 0 : be,
|
|
6825
6864
|
value: Y[l] || "",
|
|
6826
|
-
onChange: (
|
|
6865
|
+
onChange: (Re) => oe(l, Re.target.value),
|
|
6827
6866
|
readOnly: Pe,
|
|
6828
|
-
error:
|
|
6867
|
+
error: se
|
|
6829
6868
|
},
|
|
6830
6869
|
le
|
|
6831
6870
|
);
|
|
@@ -6838,9 +6877,9 @@ const pt = {
|
|
|
6838
6877
|
label: Qe,
|
|
6839
6878
|
placeholder: He ? void 0 : be,
|
|
6840
6879
|
value: Y[l] || "",
|
|
6841
|
-
onChange: (
|
|
6880
|
+
onChange: (Re) => oe(l, Re.target.value),
|
|
6842
6881
|
readOnly: Pe,
|
|
6843
|
-
error:
|
|
6882
|
+
error: se
|
|
6844
6883
|
},
|
|
6845
6884
|
le
|
|
6846
6885
|
);
|
|
@@ -6853,9 +6892,9 @@ const pt = {
|
|
|
6853
6892
|
label: Qe,
|
|
6854
6893
|
placeholder: He ? void 0 : be,
|
|
6855
6894
|
value: Y[l] || "",
|
|
6856
|
-
onChange: (
|
|
6895
|
+
onChange: (Re) => oe(l, Re.target.value),
|
|
6857
6896
|
readOnly: Pe,
|
|
6858
|
-
error:
|
|
6897
|
+
error: se
|
|
6859
6898
|
},
|
|
6860
6899
|
le
|
|
6861
6900
|
);
|
|
@@ -6891,7 +6930,7 @@ const pt = {
|
|
|
6891
6930
|
return /* @__PURE__ */ r("div", { style: { height: "12px" } }, `custom-${f}`);
|
|
6892
6931
|
if (l.customType === "link") {
|
|
6893
6932
|
const S = l.displayText || l.label || l.linkText || l.linkUrl || "";
|
|
6894
|
-
return /* @__PURE__ */ r("div", { className: "metakyc-link-field", children: /* @__PURE__ */
|
|
6933
|
+
return /* @__PURE__ */ r("div", { className: "metakyc-link-field", children: /* @__PURE__ */ o(
|
|
6895
6934
|
"a",
|
|
6896
6935
|
{
|
|
6897
6936
|
href: l.linkUrl || "#",
|
|
@@ -6914,10 +6953,10 @@ const pt = {
|
|
|
6914
6953
|
) }, `custom-${f}`);
|
|
6915
6954
|
}
|
|
6916
6955
|
if (!l.paramName) return null;
|
|
6917
|
-
const
|
|
6956
|
+
const x = B[l.paramName], C = l.displayText || l.label || l.paramName;
|
|
6918
6957
|
if (l.customType === "checkbox")
|
|
6919
|
-
return /* @__PURE__ */
|
|
6920
|
-
/* @__PURE__ */
|
|
6958
|
+
return /* @__PURE__ */ o("div", { className: "flex flex-col gap-1", children: [
|
|
6959
|
+
/* @__PURE__ */ o(
|
|
6921
6960
|
"label",
|
|
6922
6961
|
{
|
|
6923
6962
|
className: "metakyc-option-label",
|
|
@@ -6933,7 +6972,7 @@ const pt = {
|
|
|
6933
6972
|
style: pt
|
|
6934
6973
|
}
|
|
6935
6974
|
),
|
|
6936
|
-
/* @__PURE__ */
|
|
6975
|
+
/* @__PURE__ */ o(
|
|
6937
6976
|
"span",
|
|
6938
6977
|
{
|
|
6939
6978
|
className: "metakyc-option-text",
|
|
@@ -6947,11 +6986,11 @@ const pt = {
|
|
|
6947
6986
|
]
|
|
6948
6987
|
}
|
|
6949
6988
|
),
|
|
6950
|
-
|
|
6989
|
+
x && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: x })
|
|
6951
6990
|
] }, `custom-${f}`);
|
|
6952
6991
|
if (l.customType === "link_checkbox")
|
|
6953
|
-
return /* @__PURE__ */
|
|
6954
|
-
/* @__PURE__ */
|
|
6992
|
+
return /* @__PURE__ */ o("div", { className: "flex flex-col gap-1", children: [
|
|
6993
|
+
/* @__PURE__ */ o(
|
|
6955
6994
|
"label",
|
|
6956
6995
|
{
|
|
6957
6996
|
className: "metakyc-option-label",
|
|
@@ -6967,7 +7006,7 @@ const pt = {
|
|
|
6967
7006
|
style: { ...pt, alignSelf: "flex-start", marginTop: "2px" }
|
|
6968
7007
|
}
|
|
6969
7008
|
),
|
|
6970
|
-
/* @__PURE__ */
|
|
7009
|
+
/* @__PURE__ */ o(
|
|
6971
7010
|
"span",
|
|
6972
7011
|
{
|
|
6973
7012
|
className: "metakyc-option-text",
|
|
@@ -6994,12 +7033,12 @@ const pt = {
|
|
|
6994
7033
|
]
|
|
6995
7034
|
}
|
|
6996
7035
|
),
|
|
6997
|
-
|
|
7036
|
+
x && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: x })
|
|
6998
7037
|
] }, `custom-${f}`);
|
|
6999
7038
|
if (l.customType === "group_checkbox") {
|
|
7000
7039
|
const S = (me[l.paramName] || "").split(",").filter(Boolean);
|
|
7001
|
-
return /* @__PURE__ */
|
|
7002
|
-
D && /* @__PURE__ */
|
|
7040
|
+
return /* @__PURE__ */ o("div", { className: "flex flex-col gap-1.5", children: [
|
|
7041
|
+
D && /* @__PURE__ */ o(
|
|
7003
7042
|
"div",
|
|
7004
7043
|
{
|
|
7005
7044
|
className: "text-sm font-medium",
|
|
@@ -7010,9 +7049,9 @@ const pt = {
|
|
|
7010
7049
|
]
|
|
7011
7050
|
}
|
|
7012
7051
|
),
|
|
7013
|
-
/* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (l.options || []).map((
|
|
7014
|
-
const
|
|
7015
|
-
return /* @__PURE__ */
|
|
7052
|
+
/* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (l.options || []).map((ue) => {
|
|
7053
|
+
const se = l.singleSelect ? me[l.paramName] === ue.value : S.includes(ue.value);
|
|
7054
|
+
return /* @__PURE__ */ o(
|
|
7016
7055
|
"label",
|
|
7017
7056
|
{
|
|
7018
7057
|
className: "metakyc-option-label",
|
|
@@ -7022,12 +7061,12 @@ const pt = {
|
|
|
7022
7061
|
"input",
|
|
7023
7062
|
{
|
|
7024
7063
|
type: "checkbox",
|
|
7025
|
-
checked:
|
|
7064
|
+
checked: se,
|
|
7026
7065
|
onChange: (be) => {
|
|
7027
7066
|
if (l.singleSelect)
|
|
7028
|
-
Ne(l.paramName, be.target.checked ?
|
|
7067
|
+
Ne(l.paramName, be.target.checked ? ue.value : "");
|
|
7029
7068
|
else {
|
|
7030
|
-
const Pe = be.target.checked ? [...S,
|
|
7069
|
+
const Pe = be.target.checked ? [...S, ue.value] : S.filter((le) => le !== ue.value);
|
|
7031
7070
|
Ne(l.paramName, Pe.join(","));
|
|
7032
7071
|
}
|
|
7033
7072
|
},
|
|
@@ -7040,19 +7079,19 @@ const pt = {
|
|
|
7040
7079
|
{
|
|
7041
7080
|
className: "metakyc-option-text",
|
|
7042
7081
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
7043
|
-
children:
|
|
7082
|
+
children: ue.label
|
|
7044
7083
|
}
|
|
7045
7084
|
)
|
|
7046
7085
|
]
|
|
7047
7086
|
},
|
|
7048
|
-
|
|
7087
|
+
ue.value
|
|
7049
7088
|
);
|
|
7050
7089
|
}) }),
|
|
7051
|
-
|
|
7090
|
+
x && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: x })
|
|
7052
7091
|
] }, `custom-${f}`);
|
|
7053
7092
|
}
|
|
7054
|
-
return l.customType === "radio_group" ? /* @__PURE__ */
|
|
7055
|
-
D && /* @__PURE__ */
|
|
7093
|
+
return l.customType === "radio_group" ? /* @__PURE__ */ o("div", { className: "flex flex-col gap-1.5", children: [
|
|
7094
|
+
D && /* @__PURE__ */ o(
|
|
7056
7095
|
"div",
|
|
7057
7096
|
{
|
|
7058
7097
|
className: "text-sm font-medium",
|
|
@@ -7063,7 +7102,7 @@ const pt = {
|
|
|
7063
7102
|
]
|
|
7064
7103
|
}
|
|
7065
7104
|
),
|
|
7066
|
-
/* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (l.options || []).map((S) => /* @__PURE__ */
|
|
7105
|
+
/* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (l.options || []).map((S) => /* @__PURE__ */ o(
|
|
7067
7106
|
"label",
|
|
7068
7107
|
{
|
|
7069
7108
|
className: "metakyc-option-label",
|
|
@@ -7092,7 +7131,7 @@ const pt = {
|
|
|
7092
7131
|
},
|
|
7093
7132
|
S.value
|
|
7094
7133
|
)) }),
|
|
7095
|
-
|
|
7134
|
+
x && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: x })
|
|
7096
7135
|
] }, `custom-${f}`) : /* @__PURE__ */ r(
|
|
7097
7136
|
xe,
|
|
7098
7137
|
{
|
|
@@ -7102,14 +7141,14 @@ const pt = {
|
|
|
7102
7141
|
value: me[l.paramName] || "",
|
|
7103
7142
|
onChange: (S) => Ne(l.paramName, S.target.value),
|
|
7104
7143
|
required: l.required,
|
|
7105
|
-
error:
|
|
7144
|
+
error: x
|
|
7106
7145
|
},
|
|
7107
7146
|
`custom-${f}`
|
|
7108
7147
|
);
|
|
7109
7148
|
}, O = (l, f) => {
|
|
7110
7149
|
const D = $e(l);
|
|
7111
|
-
return /* @__PURE__ */
|
|
7112
|
-
l.conditionalOn && /* @__PURE__ */ r(Lt, { helpText: l.conditionalHelpText, children: /* @__PURE__ */
|
|
7150
|
+
return /* @__PURE__ */ o("div", { className: "space-y-4", children: [
|
|
7151
|
+
l.conditionalOn && /* @__PURE__ */ r(Lt, { helpText: l.conditionalHelpText, children: /* @__PURE__ */ o(
|
|
7113
7152
|
"label",
|
|
7114
7153
|
{
|
|
7115
7154
|
className: "metakyc-option-label",
|
|
@@ -7120,7 +7159,7 @@ const pt = {
|
|
|
7120
7159
|
{
|
|
7121
7160
|
type: "checkbox",
|
|
7122
7161
|
checked: D,
|
|
7123
|
-
onChange: (
|
|
7162
|
+
onChange: (x) => Ne(l.conditionalOn, x.target.checked ? "true" : "false"),
|
|
7124
7163
|
className: "metakyc-option-input",
|
|
7125
7164
|
style: pt
|
|
7126
7165
|
}
|
|
@@ -7136,23 +7175,23 @@ const pt = {
|
|
|
7136
7175
|
]
|
|
7137
7176
|
}
|
|
7138
7177
|
) }),
|
|
7139
|
-
D && /* @__PURE__ */ r("div", { style: { display: "grid", gridTemplateColumns: "repeat(4, minmax(0, 1fr))", gap: "1rem" }, children: l.fields.map((
|
|
7140
|
-
const S = Math.min(4, Math.max(1, Number(
|
|
7141
|
-
return /* @__PURE__ */ r("div", { style: { gridColumn: `span ${S} / span ${S}` }, children: /* @__PURE__ */ r(Lt, { helpText:
|
|
7178
|
+
D && /* @__PURE__ */ r("div", { style: { display: "grid", gridTemplateColumns: "repeat(4, minmax(0, 1fr))", gap: "1rem" }, children: l.fields.map((x, C) => {
|
|
7179
|
+
const S = Math.min(4, Math.max(1, Number(x.colSpan) || 4)), ue = x.isCustom ? `custom-${C}-${x.paramName}` : `builtin-${x.name}-${C}`;
|
|
7180
|
+
return /* @__PURE__ */ r("div", { style: { gridColumn: `span ${S} / span ${S}` }, children: /* @__PURE__ */ r(Lt, { helpText: x.helpText, children: x.isCustom ? h(x, C) : Ye(x.name, ue, x.displayText, x.countriesType, x.labelMode) }) }, ue);
|
|
7142
7181
|
}) })
|
|
7143
7182
|
] });
|
|
7144
7183
|
};
|
|
7145
7184
|
if (!c || E)
|
|
7146
|
-
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */
|
|
7185
|
+
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */ o(ne, { children: [
|
|
7147
7186
|
/* @__PURE__ */ r(Me, { className: "my-8" }),
|
|
7148
7187
|
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: "Loading form…" })
|
|
7149
7188
|
] }) }) });
|
|
7150
7189
|
if (N) {
|
|
7151
|
-
const l = N[F] ?? N[0], f = _e === -1, D =
|
|
7152
|
-
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */
|
|
7190
|
+
const l = N[F] ?? N[0], f = _e === -1, D = Ie === -1, x = N.length, C = $e(l), S = Object.values(B);
|
|
7191
|
+
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ o(re, { children: [
|
|
7153
7192
|
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r(mt, { title: (c == null ? void 0 : c.title) || "Create Applicant" }) }),
|
|
7154
|
-
/* @__PURE__ */
|
|
7155
|
-
(l.title || l.subtitle || l.description) && /* @__PURE__ */
|
|
7193
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
7194
|
+
(l.title || l.subtitle || l.description) && /* @__PURE__ */ o("div", { className: "mb-4", children: [
|
|
7156
7195
|
l.title && /* @__PURE__ */ r(
|
|
7157
7196
|
"h3",
|
|
7158
7197
|
{
|
|
@@ -7178,33 +7217,37 @@ const pt = {
|
|
|
7178
7217
|
}
|
|
7179
7218
|
)
|
|
7180
7219
|
] }),
|
|
7181
|
-
(fe || S.length > 0) && /* @__PURE__ */
|
|
7182
|
-
fe && /* @__PURE__ */
|
|
7220
|
+
(fe || S.length > 0) && /* @__PURE__ */ o("div", { className: "mb-4 p-3 bg-red-50 border border-red-200 rounded-lg", children: [
|
|
7221
|
+
fe && /* @__PURE__ */ o("p", { className: "text-red-600 text-sm", children: [
|
|
7183
7222
|
/* @__PURE__ */ r("strong", { children: "Error:" }),
|
|
7184
7223
|
" ",
|
|
7185
7224
|
fe
|
|
7186
7225
|
] }),
|
|
7187
|
-
S.map((
|
|
7226
|
+
S.map((ue, se) => /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: ue }, se))
|
|
7188
7227
|
] }),
|
|
7189
|
-
|
|
7190
|
-
N.map((
|
|
7228
|
+
x > 1 && /* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "center", gap: "0.5rem", marginBottom: "1rem" }, children: [
|
|
7229
|
+
N.map((ue, se) => /* @__PURE__ */ r(
|
|
7191
7230
|
"div",
|
|
7192
7231
|
{
|
|
7193
|
-
|
|
7194
|
-
|
|
7232
|
+
style: {
|
|
7233
|
+
height: "0.375rem",
|
|
7234
|
+
borderRadius: "9999px",
|
|
7235
|
+
transition: "all 150ms",
|
|
7236
|
+
...se === F ? { flex: "1 1 0%", backgroundColor: "var(--metakyc-primary, #2563eb)" } : se < F ? { width: "2rem", backgroundColor: "var(--metakyc-primary-light, #93c5fd)", opacity: 0.7 } : { width: "2rem", backgroundColor: "#e5e7eb" }
|
|
7237
|
+
}
|
|
7195
7238
|
},
|
|
7196
|
-
|
|
7239
|
+
se
|
|
7197
7240
|
)),
|
|
7198
|
-
/* @__PURE__ */
|
|
7241
|
+
/* @__PURE__ */ o("span", { style: { fontSize: "0.75rem", color: "var(--metakyc-text-muted, #9ca3af)", flexShrink: 0 }, children: [
|
|
7199
7242
|
F + 1,
|
|
7200
7243
|
" / ",
|
|
7201
|
-
|
|
7244
|
+
x
|
|
7202
7245
|
] })
|
|
7203
7246
|
] }),
|
|
7204
7247
|
O(l)
|
|
7205
7248
|
] }),
|
|
7206
|
-
/* @__PURE__ */
|
|
7207
|
-
/* @__PURE__ */
|
|
7249
|
+
/* @__PURE__ */ o(Ce, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
7250
|
+
/* @__PURE__ */ o("div", { children: [
|
|
7208
7251
|
!f && /* @__PURE__ */ r(
|
|
7209
7252
|
Z,
|
|
7210
7253
|
{
|
|
@@ -7231,17 +7274,17 @@ const pt = {
|
|
|
7231
7274
|
] })
|
|
7232
7275
|
] }) });
|
|
7233
7276
|
}
|
|
7234
|
-
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: it, children: /* @__PURE__ */
|
|
7277
|
+
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: it, children: /* @__PURE__ */ o(re, { children: [
|
|
7235
7278
|
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r(mt, { title: (c == null ? void 0 : c.title) || "Create Applicant" }) }),
|
|
7236
|
-
/* @__PURE__ */
|
|
7237
|
-
fe && /* @__PURE__ */ r("div", { className: "mb-6 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */
|
|
7279
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
7280
|
+
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: [
|
|
7238
7281
|
/* @__PURE__ */ r("strong", { children: "Error:" }),
|
|
7239
7282
|
" ",
|
|
7240
7283
|
fe
|
|
7241
7284
|
] }) }),
|
|
7242
7285
|
/* @__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: Ye(l) }, l)) })
|
|
7243
7286
|
] }),
|
|
7244
|
-
/* @__PURE__ */
|
|
7287
|
+
/* @__PURE__ */ o(Ce, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
7245
7288
|
a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: te || y, children: "Cancel" }),
|
|
7246
7289
|
/* @__PURE__ */ r(Z, { type: "submit", isLoading: te || y, children: "Create Applicant" })
|
|
7247
7290
|
] })
|
|
@@ -7257,17 +7300,17 @@ const Xn = ({
|
|
|
7257
7300
|
onCancel: a
|
|
7258
7301
|
}) => {
|
|
7259
7302
|
var Ye, h, O, q, W, X;
|
|
7260
|
-
const { config: i, baseInformationService:
|
|
7303
|
+
const { config: i, baseInformationService: s, currentTheme: c } = Te(), { createCompanyApplicant: d, isLoading: y } = zt(), p = e || ((Ye = i.applicantForm) == null ? void 0 : Ye.workflowKey);
|
|
7261
7304
|
if (!p)
|
|
7262
7305
|
throw new Error(
|
|
7263
7306
|
"workflowKey is required. Provide it either as a prop to CreateCompanyApplicantForm or set it in config.applicantForm.workflowKey"
|
|
7264
7307
|
);
|
|
7265
|
-
const
|
|
7308
|
+
const b = t || ((h = i.applicantForm) == null ? void 0 : h.externalRefId) || "", P = ((O = i.applicantForm) == null ? void 0 : O.email) || "", v = ((q = i.applicantForm) == null ? void 0 : q.initialValues) || {}, T = (((W = i.applicantForm) == null ? void 0 : W.fieldLabelMode) || (c == null ? void 0 : c.fieldLabelMode) || "label") !== "placeholder", w = De(
|
|
7266
7309
|
() => c != null && c.companyFormPages && c.companyFormPages.length > 0 ? c.companyFormPages : null,
|
|
7267
7310
|
[c == null ? void 0 : c.companyFormPages]
|
|
7268
7311
|
), N = De(() => {
|
|
7269
|
-
const m = new Set(Dt),
|
|
7270
|
-
if (
|
|
7312
|
+
const m = new Set(Dt), I = c == null ? void 0 : c.companyFormRequiredFields;
|
|
7313
|
+
if (I) for (const L of I) m.add(L);
|
|
7271
7314
|
if (w)
|
|
7272
7315
|
for (const L of w)
|
|
7273
7316
|
for (const u of L.fields)
|
|
@@ -7276,21 +7319,21 @@ const Xn = ({
|
|
|
7276
7319
|
}, [c == null ? void 0 : c.companyFormRequiredFields, w]), z = De(() => {
|
|
7277
7320
|
var m;
|
|
7278
7321
|
if (w) {
|
|
7279
|
-
const
|
|
7322
|
+
const I = w.flatMap((u) => u.fields).filter((u) => !u.isCustom && u.name).map((u) => u.name), L = new Set(I);
|
|
7280
7323
|
for (const u of Dt) L.add(u);
|
|
7281
7324
|
return Array.from(L);
|
|
7282
7325
|
}
|
|
7283
7326
|
return (m = i.applicantForm) != null && m.visibleFields ? i.applicantForm.visibleFields : c != null && c.companyFormVisibleFields && c.companyFormVisibleFields.length > 0 ? c.companyFormVisibleFields : lr;
|
|
7284
7327
|
}, [(X = i.applicantForm) == null ? void 0 : X.visibleFields, c == null ? void 0 : c.companyFormVisibleFields, w]), Q = /* @__PURE__ */ new Set(["countryResidence", "addressCountry"]), M = De(() => {
|
|
7285
|
-
var
|
|
7328
|
+
var I, L;
|
|
7286
7329
|
const m = /* @__PURE__ */ new Set();
|
|
7287
7330
|
if (w)
|
|
7288
7331
|
for (const u of w)
|
|
7289
7332
|
for (const l of u.fields)
|
|
7290
|
-
!l.isCustom && l.name && Q.has(l.name) && m.add(l.countriesType ?? ((
|
|
7333
|
+
!l.isCustom && l.name && Q.has(l.name) && m.add(l.countriesType ?? ((I = ot[l.name]) == null ? void 0 : I.countriesType));
|
|
7291
7334
|
else
|
|
7292
7335
|
for (const u of z)
|
|
7293
|
-
Q.has(u) && m.add((L =
|
|
7336
|
+
Q.has(u) && m.add((L = ot[u]) == null ? void 0 : L.countriesType);
|
|
7294
7337
|
return m.size === 0 && m.add(void 0), Array.from(m);
|
|
7295
7338
|
}, [z, w]), [j, K] = k({}), [ee, E] = k(!0), g = de(/* @__PURE__ */ new Set()), $ = de(/* @__PURE__ */ new Set());
|
|
7296
7339
|
ge(() => {
|
|
@@ -7304,26 +7347,26 @@ const Xn = ({
|
|
|
7304
7347
|
return;
|
|
7305
7348
|
}
|
|
7306
7349
|
E(!0);
|
|
7307
|
-
const
|
|
7308
|
-
|
|
7350
|
+
const I = m.map((u) => u != null ? String(u) : "all");
|
|
7351
|
+
I.forEach((u) => g.current.add(u)), (async () => {
|
|
7309
7352
|
try {
|
|
7310
7353
|
const u = await Promise.all(
|
|
7311
7354
|
m.map(async (l) => {
|
|
7312
|
-
const f = l != null ? String(l) : "all", D = await
|
|
7355
|
+
const f = l != null ? String(l) : "all", D = await s.getCountries("", i.locale || "en", l), x = /* @__PURE__ */ new Set(), C = D.map((S) => ({ value: S.abbreviation3 || S.abbreviation, label: S.name })).filter((S) => !S.value || x.has(S.value) ? !1 : (x.add(S.value), !0));
|
|
7313
7356
|
return $.current.add(f), g.current.delete(f), [f, C];
|
|
7314
7357
|
})
|
|
7315
7358
|
);
|
|
7316
7359
|
K((l) => ({ ...l, ...Object.fromEntries(u) }));
|
|
7317
7360
|
} catch (u) {
|
|
7318
|
-
|
|
7361
|
+
I.forEach((l) => g.current.delete(l)), console.error("Failed to load countries:", u);
|
|
7319
7362
|
} finally {
|
|
7320
7363
|
M.every((l) => $.current.has(l != null ? String(l) : "all")) && E(!1);
|
|
7321
7364
|
}
|
|
7322
7365
|
})();
|
|
7323
7366
|
}, [M, c]);
|
|
7324
|
-
const V = (m,
|
|
7367
|
+
const V = (m, I) => {
|
|
7325
7368
|
var l;
|
|
7326
|
-
const L =
|
|
7369
|
+
const L = I ?? ((l = ot[m]) == null ? void 0 : l.countriesType), u = L != null ? String(L) : "all";
|
|
7327
7370
|
return j[u] || [];
|
|
7328
7371
|
}, G = {
|
|
7329
7372
|
companyName: 1,
|
|
@@ -7347,7 +7390,7 @@ const Xn = ({
|
|
|
7347
7390
|
lei: 1
|
|
7348
7391
|
}, _ = Object.fromEntries(
|
|
7349
7392
|
Object.entries(v).filter(([m]) => m in G)
|
|
7350
|
-
), [J,
|
|
7393
|
+
), [J, ie] = k({
|
|
7351
7394
|
workflowKey: p,
|
|
7352
7395
|
companyName: "",
|
|
7353
7396
|
email: P,
|
|
@@ -7368,53 +7411,53 @@ const Xn = ({
|
|
|
7368
7411
|
postalCode: "",
|
|
7369
7412
|
addressCountry: "",
|
|
7370
7413
|
lei: "",
|
|
7371
|
-
externalRefId:
|
|
7414
|
+
externalRefId: b,
|
|
7372
7415
|
..._
|
|
7373
|
-
}), [Y, ve] = k({}), [
|
|
7416
|
+
}), [Y, ve] = k({}), [pe, me] = k(0), [ke, F] = k({}), [U, B] = k(null), [H, fe] = k(!1), R = (m, I) => ie((L) => ({ ...L, [m]: I })), te = (m, I) => ve((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) => {
|
|
7374
7417
|
var L;
|
|
7375
|
-
const
|
|
7418
|
+
const I = {};
|
|
7376
7419
|
for (const u of m.fields)
|
|
7377
7420
|
if (u.isCustom) {
|
|
7378
7421
|
if (u.customType === "paragraph" || u.customType === "html" || u.customType === "br" || u.customType === "link") continue;
|
|
7379
7422
|
if (u.required && u.paramName) {
|
|
7380
7423
|
const l = Y[u.paramName], f = u.displayText || u.label || u.paramName;
|
|
7381
|
-
u.customType === "checkbox" || u.customType === "link_checkbox" ? l !== "true" && (
|
|
7424
|
+
u.customType === "checkbox" || u.customType === "link_checkbox" ? l !== "true" && (I[u.paramName] = `${f} is required.`) : (!l || l.trim() === "") && (I[u.paramName] = `${f} is required.`);
|
|
7382
7425
|
}
|
|
7383
7426
|
} else if (u.name) {
|
|
7384
7427
|
const l = u.name;
|
|
7385
7428
|
if (N.includes(l) && kt(J[l])) {
|
|
7386
|
-
const f = u.displayText || ((L =
|
|
7387
|
-
|
|
7429
|
+
const f = u.displayText || ((L = ot[l]) == null ? void 0 : L.label) || l;
|
|
7430
|
+
I[l] = `${f} is required.`;
|
|
7388
7431
|
}
|
|
7389
7432
|
}
|
|
7390
|
-
return
|
|
7391
|
-
},
|
|
7433
|
+
return I;
|
|
7434
|
+
}, Ie = async () => {
|
|
7392
7435
|
if (!w) return;
|
|
7393
|
-
const m = w[
|
|
7436
|
+
const m = w[pe];
|
|
7394
7437
|
if (m.conditionalOn && !ye(m)) {
|
|
7395
7438
|
F({}), oe >= 0 ? me(oe) : await _e();
|
|
7396
7439
|
return;
|
|
7397
7440
|
}
|
|
7398
|
-
const
|
|
7399
|
-
if (Object.keys(
|
|
7400
|
-
F(
|
|
7441
|
+
const I = $e(m);
|
|
7442
|
+
if (Object.keys(I).length > 0) {
|
|
7443
|
+
F(I);
|
|
7401
7444
|
return;
|
|
7402
7445
|
}
|
|
7403
7446
|
F({}), oe >= 0 ? me(oe) : await _e();
|
|
7404
7447
|
}, _e = async () => {
|
|
7405
7448
|
var m;
|
|
7406
7449
|
if (w) {
|
|
7407
|
-
let
|
|
7450
|
+
let I = {};
|
|
7408
7451
|
for (const L of w)
|
|
7409
|
-
ye(L) && (
|
|
7410
|
-
if (Object.keys(
|
|
7411
|
-
F(
|
|
7452
|
+
ye(L) && (I = { ...I, ...$e(L) });
|
|
7453
|
+
if (Object.keys(I).length > 0) {
|
|
7454
|
+
F(I);
|
|
7412
7455
|
return;
|
|
7413
7456
|
}
|
|
7414
7457
|
}
|
|
7415
7458
|
fe(!0), B(null);
|
|
7416
7459
|
try {
|
|
7417
|
-
const
|
|
7460
|
+
const I = {
|
|
7418
7461
|
workflowKey: J.workflowKey,
|
|
7419
7462
|
externalRefId: ((m = J.externalRefId) == null ? void 0 : m.trim()) || void 0
|
|
7420
7463
|
}, L = w ? w.filter((f) => ye(f)).flatMap((f) => f.fields).filter((f) => !f.isCustom && f.name).map((f) => f.name) : z;
|
|
@@ -7423,31 +7466,31 @@ const Xn = ({
|
|
|
7423
7466
|
if (!kt(D))
|
|
7424
7467
|
switch (f) {
|
|
7425
7468
|
case "companyName":
|
|
7426
|
-
|
|
7469
|
+
I.companyName = D;
|
|
7427
7470
|
break;
|
|
7428
7471
|
case "email":
|
|
7429
|
-
|
|
7472
|
+
I.companyEmail = D;
|
|
7430
7473
|
break;
|
|
7431
7474
|
case "phone":
|
|
7432
|
-
|
|
7475
|
+
I.companyPhone = D;
|
|
7433
7476
|
break;
|
|
7434
7477
|
case "registrationNumber":
|
|
7435
|
-
|
|
7478
|
+
I.companyRegistrationNumber = D;
|
|
7436
7479
|
break;
|
|
7437
7480
|
case "countryResidence":
|
|
7438
|
-
|
|
7481
|
+
I.companyCountry = D;
|
|
7439
7482
|
break;
|
|
7440
7483
|
case "city":
|
|
7441
|
-
|
|
7484
|
+
I.companyCity = D;
|
|
7442
7485
|
break;
|
|
7443
7486
|
case "street":
|
|
7444
|
-
|
|
7487
|
+
I.companyStreet = D;
|
|
7445
7488
|
break;
|
|
7446
7489
|
case "postalCode":
|
|
7447
|
-
|
|
7490
|
+
I.companyZip = D;
|
|
7448
7491
|
break;
|
|
7449
7492
|
default:
|
|
7450
|
-
|
|
7493
|
+
I[f] = D;
|
|
7451
7494
|
break;
|
|
7452
7495
|
}
|
|
7453
7496
|
}
|
|
@@ -7457,36 +7500,36 @@ const Xn = ({
|
|
|
7457
7500
|
if (ye(f))
|
|
7458
7501
|
for (const D of f.fields) {
|
|
7459
7502
|
if (!D.isCustom || !D.paramName || D.customType === "paragraph" || D.customType === "html" || D.customType === "br" || D.customType === "link") continue;
|
|
7460
|
-
const
|
|
7503
|
+
const x = Y[D.paramName] ?? "";
|
|
7461
7504
|
let C;
|
|
7462
7505
|
if (D.customType === "checkbox" || D.customType === "link_checkbox")
|
|
7463
|
-
C =
|
|
7464
|
-
else if (C =
|
|
7506
|
+
C = x === "true" ? "yes" : "no";
|
|
7507
|
+
else if (C = x, !C && !D.required) continue;
|
|
7465
7508
|
u.push({ paramName: D.paramName, value: C });
|
|
7466
7509
|
}
|
|
7467
7510
|
}
|
|
7468
|
-
u.length > 0 && (
|
|
7469
|
-
const l = await d(
|
|
7511
|
+
u.length > 0 && (I.applicantAdditionalDatas = u);
|
|
7512
|
+
const l = await d(I);
|
|
7470
7513
|
n(l.applicantId);
|
|
7471
|
-
} catch (
|
|
7472
|
-
console.error("Error creating company applicant:",
|
|
7514
|
+
} catch (I) {
|
|
7515
|
+
console.error("Error creating company applicant:", I), B(I.message || "Failed to create company applicant");
|
|
7473
7516
|
} finally {
|
|
7474
7517
|
fe(!1);
|
|
7475
7518
|
}
|
|
7476
7519
|
}, at = async (m) => {
|
|
7477
|
-
var
|
|
7520
|
+
var I;
|
|
7478
7521
|
m.preventDefault();
|
|
7479
7522
|
for (const L of N)
|
|
7480
7523
|
if (kt(J[L])) {
|
|
7481
|
-
const u = ((
|
|
7524
|
+
const u = ((I = ot[L]) == null ? void 0 : I.label) || L;
|
|
7482
7525
|
B(`${u} is required.`);
|
|
7483
7526
|
return;
|
|
7484
7527
|
}
|
|
7485
7528
|
await _e();
|
|
7486
|
-
}, Ze = (m,
|
|
7487
|
-
const f =
|
|
7529
|
+
}, Ze = (m, I, L, u, l) => {
|
|
7530
|
+
const f = ot[m];
|
|
7488
7531
|
if (!f) return null;
|
|
7489
|
-
const D = N.includes(m),
|
|
7532
|
+
const D = N.includes(m), x = ke[m], C = L || f.label, S = m in _, ue = I ?? m, se = l ? l !== "placeholder" : T, be = se ? C : void 0, Pe = se ? "..." : C;
|
|
7490
7533
|
switch (f.type) {
|
|
7491
7534
|
case "select":
|
|
7492
7535
|
if (m === "countryResidence" || m === "addressCountry") {
|
|
@@ -7497,13 +7540,13 @@ const Xn = ({
|
|
|
7497
7540
|
required: D,
|
|
7498
7541
|
label: be,
|
|
7499
7542
|
value: J[m] || "",
|
|
7500
|
-
onChange: (Be) =>
|
|
7543
|
+
onChange: (Be) => R(m, Be),
|
|
7501
7544
|
options: [{ value: "", label: `Select ${Pe.toLowerCase()}` }, ...le],
|
|
7502
7545
|
disabled: ee,
|
|
7503
7546
|
readOnly: S,
|
|
7504
|
-
error:
|
|
7547
|
+
error: x
|
|
7505
7548
|
},
|
|
7506
|
-
|
|
7549
|
+
ue
|
|
7507
7550
|
);
|
|
7508
7551
|
}
|
|
7509
7552
|
return null;
|
|
@@ -7514,13 +7557,13 @@ const Xn = ({
|
|
|
7514
7557
|
required: D,
|
|
7515
7558
|
type: "date",
|
|
7516
7559
|
label: be,
|
|
7517
|
-
placeholder:
|
|
7560
|
+
placeholder: se ? void 0 : C,
|
|
7518
7561
|
value: J[m] || "",
|
|
7519
|
-
onChange: (le) =>
|
|
7562
|
+
onChange: (le) => R(m, le.target.value),
|
|
7520
7563
|
readOnly: S,
|
|
7521
|
-
error:
|
|
7564
|
+
error: x
|
|
7522
7565
|
},
|
|
7523
|
-
|
|
7566
|
+
ue
|
|
7524
7567
|
);
|
|
7525
7568
|
case "email":
|
|
7526
7569
|
return /* @__PURE__ */ r(
|
|
@@ -7529,13 +7572,13 @@ const Xn = ({
|
|
|
7529
7572
|
required: D,
|
|
7530
7573
|
type: "email",
|
|
7531
7574
|
label: be,
|
|
7532
|
-
placeholder:
|
|
7575
|
+
placeholder: se ? void 0 : C,
|
|
7533
7576
|
value: J[m] || "",
|
|
7534
|
-
onChange: (le) =>
|
|
7577
|
+
onChange: (le) => R(m, le.target.value),
|
|
7535
7578
|
readOnly: S,
|
|
7536
|
-
error:
|
|
7579
|
+
error: x
|
|
7537
7580
|
},
|
|
7538
|
-
|
|
7581
|
+
ue
|
|
7539
7582
|
);
|
|
7540
7583
|
case "tel":
|
|
7541
7584
|
return /* @__PURE__ */ r(
|
|
@@ -7544,13 +7587,13 @@ const Xn = ({
|
|
|
7544
7587
|
required: D,
|
|
7545
7588
|
type: "tel",
|
|
7546
7589
|
label: be,
|
|
7547
|
-
placeholder:
|
|
7590
|
+
placeholder: se ? void 0 : C,
|
|
7548
7591
|
value: J[m] || "",
|
|
7549
|
-
onChange: (le) =>
|
|
7592
|
+
onChange: (le) => R(m, le.target.value),
|
|
7550
7593
|
readOnly: S,
|
|
7551
|
-
error:
|
|
7594
|
+
error: x
|
|
7552
7595
|
},
|
|
7553
|
-
|
|
7596
|
+
ue
|
|
7554
7597
|
);
|
|
7555
7598
|
default:
|
|
7556
7599
|
return /* @__PURE__ */ r(
|
|
@@ -7559,16 +7602,16 @@ const Xn = ({
|
|
|
7559
7602
|
required: D,
|
|
7560
7603
|
type: "text",
|
|
7561
7604
|
label: be,
|
|
7562
|
-
placeholder:
|
|
7605
|
+
placeholder: se ? void 0 : C,
|
|
7563
7606
|
value: J[m] || "",
|
|
7564
|
-
onChange: (le) =>
|
|
7607
|
+
onChange: (le) => R(m, le.target.value),
|
|
7565
7608
|
readOnly: S,
|
|
7566
|
-
error:
|
|
7609
|
+
error: x
|
|
7567
7610
|
},
|
|
7568
|
-
|
|
7611
|
+
ue
|
|
7569
7612
|
);
|
|
7570
7613
|
}
|
|
7571
|
-
}, je = (m,
|
|
7614
|
+
}, je = (m, I) => {
|
|
7572
7615
|
if (m.customType === "paragraph")
|
|
7573
7616
|
return /* @__PURE__ */ r(
|
|
7574
7617
|
"p",
|
|
@@ -7576,12 +7619,12 @@ const Xn = ({
|
|
|
7576
7619
|
style: { fontSize: "14px", lineHeight: "1.7", margin: 0, color: "var(--metakyc-text-secondary, #6b7280)" },
|
|
7577
7620
|
dangerouslySetInnerHTML: { __html: m.displayText || m.label || "" }
|
|
7578
7621
|
},
|
|
7579
|
-
`custom-${
|
|
7622
|
+
`custom-${I}`
|
|
7580
7623
|
);
|
|
7581
7624
|
if (m.customType === "html")
|
|
7582
|
-
return /* @__PURE__ */ r("div", { dangerouslySetInnerHTML: { __html: m.label || "" } }, `custom-${
|
|
7625
|
+
return /* @__PURE__ */ r("div", { dangerouslySetInnerHTML: { __html: m.label || "" } }, `custom-${I}`);
|
|
7583
7626
|
if (m.customType === "br")
|
|
7584
|
-
return /* @__PURE__ */ r("div", { style: { height: "12px" } }, `custom-${
|
|
7627
|
+
return /* @__PURE__ */ r("div", { style: { height: "12px" } }, `custom-${I}`);
|
|
7585
7628
|
if (m.customType === "link")
|
|
7586
7629
|
return /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
|
|
7587
7630
|
"a",
|
|
@@ -7592,11 +7635,11 @@ const Xn = ({
|
|
|
7592
7635
|
style: { color: "var(--metakyc-primary, #2563eb)", fontSize: "14px", textDecoration: "underline" },
|
|
7593
7636
|
children: m.displayText || m.label || m.linkText || m.linkUrl || ""
|
|
7594
7637
|
}
|
|
7595
|
-
) }, `custom-${
|
|
7638
|
+
) }, `custom-${I}`);
|
|
7596
7639
|
if (!m.paramName) return null;
|
|
7597
7640
|
const L = ke[m.paramName], u = m.displayText || m.label || m.paramName, l = m.labelMode ? m.labelMode !== "placeholder" : T;
|
|
7598
|
-
return m.customType === "checkbox" ? /* @__PURE__ */
|
|
7599
|
-
/* @__PURE__ */
|
|
7641
|
+
return m.customType === "checkbox" ? /* @__PURE__ */ o("div", { className: "flex flex-col gap-1", children: [
|
|
7642
|
+
/* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer" }, children: [
|
|
7600
7643
|
/* @__PURE__ */ r(
|
|
7601
7644
|
"input",
|
|
7602
7645
|
{
|
|
@@ -7606,13 +7649,13 @@ const Xn = ({
|
|
|
7606
7649
|
style: { width: "16px", height: "16px", accentColor: "var(--metakyc-primary, #2563eb)" }
|
|
7607
7650
|
}
|
|
7608
7651
|
),
|
|
7609
|
-
/* @__PURE__ */
|
|
7652
|
+
/* @__PURE__ */ o("span", { style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)" }, children: [
|
|
7610
7653
|
u,
|
|
7611
7654
|
m.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
|
|
7612
7655
|
] })
|
|
7613
7656
|
] }),
|
|
7614
7657
|
L && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: L })
|
|
7615
|
-
] }, `custom-${
|
|
7658
|
+
] }, `custom-${I}`) : /* @__PURE__ */ r(
|
|
7616
7659
|
xe,
|
|
7617
7660
|
{
|
|
7618
7661
|
type: "text",
|
|
@@ -7623,71 +7666,75 @@ const Xn = ({
|
|
|
7623
7666
|
required: m.required,
|
|
7624
7667
|
error: L
|
|
7625
7668
|
},
|
|
7626
|
-
`custom-${
|
|
7669
|
+
`custom-${I}`
|
|
7627
7670
|
);
|
|
7628
7671
|
}, it = (m) => {
|
|
7629
|
-
const
|
|
7630
|
-
return /* @__PURE__ */
|
|
7631
|
-
m.conditionalOn && /* @__PURE__ */
|
|
7672
|
+
const I = ye(m);
|
|
7673
|
+
return /* @__PURE__ */ o("div", { className: "space-y-4", children: [
|
|
7674
|
+
m.conditionalOn && /* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer" }, children: [
|
|
7632
7675
|
/* @__PURE__ */ r(
|
|
7633
7676
|
"input",
|
|
7634
7677
|
{
|
|
7635
7678
|
type: "checkbox",
|
|
7636
|
-
checked:
|
|
7679
|
+
checked: I,
|
|
7637
7680
|
onChange: (L) => te(m.conditionalOn, L.target.checked ? "true" : "false"),
|
|
7638
7681
|
style: { width: "16px", height: "16px", accentColor: "var(--metakyc-primary, #2563eb)" }
|
|
7639
7682
|
}
|
|
7640
7683
|
),
|
|
7641
7684
|
/* @__PURE__ */ r("span", { style: { fontSize: "14px", fontWeight: 500 }, children: m.conditionalOn })
|
|
7642
7685
|
] }),
|
|
7643
|
-
|
|
7686
|
+
I && /* @__PURE__ */ r("div", { style: { display: "grid", gridTemplateColumns: "repeat(4, minmax(0, 1fr))", gap: "1rem" }, children: m.fields.map((L, u) => {
|
|
7644
7687
|
const l = Math.min(4, Math.max(1, Number(L.colSpan) || 4)), f = L.isCustom ? `custom-${u}-${L.paramName}` : `builtin-${L.name}-${u}`;
|
|
7645
7688
|
return /* @__PURE__ */ r("div", { style: { gridColumn: `span ${l} / span ${l}` }, children: L.isCustom ? je(L, u) : Ze(L.name, f, L.displayText, L.countriesType, L.labelMode) }, f);
|
|
7646
7689
|
}) })
|
|
7647
7690
|
] });
|
|
7648
7691
|
};
|
|
7649
7692
|
if (!c || ee)
|
|
7650
|
-
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */
|
|
7693
|
+
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */ o(ne, { children: [
|
|
7651
7694
|
/* @__PURE__ */ r(Me, { className: "my-8" }),
|
|
7652
7695
|
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: "Loading form…" })
|
|
7653
7696
|
] }) }) });
|
|
7654
7697
|
if (w) {
|
|
7655
|
-
const m = w[
|
|
7656
|
-
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */
|
|
7698
|
+
const m = w[pe] ?? w[0], I = Ne === -1, L = oe === -1, u = w.length, l = ye(m), f = Object.values(ke);
|
|
7699
|
+
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ o(re, { children: [
|
|
7657
7700
|
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r(mt, { title: (c == null ? void 0 : c.title) || "Company Registration" }) }),
|
|
7658
|
-
/* @__PURE__ */
|
|
7659
|
-
(m.title || m.subtitle) && /* @__PURE__ */
|
|
7701
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
7702
|
+
(m.title || m.subtitle) && /* @__PURE__ */ o("div", { className: "mb-4", children: [
|
|
7660
7703
|
m.title && /* @__PURE__ */ r("h3", { className: "font-semibold text-base", style: { color: "var(--metakyc-text-primary, #111827)" }, children: m.title }),
|
|
7661
7704
|
m.subtitle && /* @__PURE__ */ r("p", { className: "text-sm mt-0.5", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: m.subtitle })
|
|
7662
7705
|
] }),
|
|
7663
|
-
(U || f.length > 0) && /* @__PURE__ */
|
|
7664
|
-
U && /* @__PURE__ */
|
|
7706
|
+
(U || f.length > 0) && /* @__PURE__ */ o("div", { className: "mb-4 p-3 bg-red-50 border border-red-200 rounded-lg", children: [
|
|
7707
|
+
U && /* @__PURE__ */ o("p", { className: "text-red-600 text-sm", children: [
|
|
7665
7708
|
/* @__PURE__ */ r("strong", { children: "Error:" }),
|
|
7666
7709
|
" ",
|
|
7667
7710
|
U
|
|
7668
7711
|
] }),
|
|
7669
|
-
f.map((D,
|
|
7712
|
+
f.map((D, x) => /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: D }, x))
|
|
7670
7713
|
] }),
|
|
7671
|
-
u > 1 && /* @__PURE__ */
|
|
7672
|
-
w.map((D,
|
|
7714
|
+
u > 1 && /* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "center", gap: "0.5rem", marginBottom: "1rem" }, children: [
|
|
7715
|
+
w.map((D, x) => /* @__PURE__ */ r(
|
|
7673
7716
|
"div",
|
|
7674
7717
|
{
|
|
7675
|
-
|
|
7676
|
-
|
|
7718
|
+
style: {
|
|
7719
|
+
height: "0.375rem",
|
|
7720
|
+
borderRadius: "9999px",
|
|
7721
|
+
transition: "all 150ms",
|
|
7722
|
+
...x === pe ? { flex: "1 1 0%", backgroundColor: "var(--metakyc-primary, #2563eb)" } : x < pe ? { width: "2rem", backgroundColor: "var(--metakyc-primary-light, #93c5fd)", opacity: 0.7 } : { width: "2rem", backgroundColor: "#e5e7eb" }
|
|
7723
|
+
}
|
|
7677
7724
|
},
|
|
7678
|
-
|
|
7725
|
+
x
|
|
7679
7726
|
)),
|
|
7680
|
-
/* @__PURE__ */
|
|
7681
|
-
|
|
7727
|
+
/* @__PURE__ */ o("span", { style: { fontSize: "0.75rem", color: "var(--metakyc-text-muted, #9ca3af)", flexShrink: 0 }, children: [
|
|
7728
|
+
pe + 1,
|
|
7682
7729
|
" / ",
|
|
7683
7730
|
u
|
|
7684
7731
|
] })
|
|
7685
7732
|
] }),
|
|
7686
7733
|
it(m)
|
|
7687
7734
|
] }),
|
|
7688
|
-
/* @__PURE__ */
|
|
7689
|
-
/* @__PURE__ */
|
|
7690
|
-
!
|
|
7735
|
+
/* @__PURE__ */ o(Ce, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
7736
|
+
/* @__PURE__ */ o("div", { children: [
|
|
7737
|
+
!I && /* @__PURE__ */ r(
|
|
7691
7738
|
Z,
|
|
7692
7739
|
{
|
|
7693
7740
|
type: "button",
|
|
@@ -7699,23 +7746,23 @@ const Xn = ({
|
|
|
7699
7746
|
children: "Previous"
|
|
7700
7747
|
}
|
|
7701
7748
|
),
|
|
7702
|
-
|
|
7749
|
+
I && a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: H || y, children: "Cancel" })
|
|
7703
7750
|
] }),
|
|
7704
|
-
/* @__PURE__ */ r(Z, { type: "button", isLoading: H || y, onClick: L ? _e :
|
|
7751
|
+
/* @__PURE__ */ r(Z, { type: "button", isLoading: H || y, onClick: L ? _e : Ie, children: L ? m.conditionalOn && !l ? "Skip & Submit" : "Submit" : m.conditionalOn && !l ? "Skip" : "Next" })
|
|
7705
7752
|
] })
|
|
7706
7753
|
] }) });
|
|
7707
7754
|
}
|
|
7708
|
-
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: at, children: /* @__PURE__ */
|
|
7755
|
+
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: at, children: /* @__PURE__ */ o(re, { children: [
|
|
7709
7756
|
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r(mt, { title: (c == null ? void 0 : c.title) || "Company Registration" }) }),
|
|
7710
|
-
/* @__PURE__ */
|
|
7711
|
-
U && /* @__PURE__ */ r("div", { className: "mb-6 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */
|
|
7757
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
7758
|
+
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: [
|
|
7712
7759
|
/* @__PURE__ */ r("strong", { children: "Error:" }),
|
|
7713
7760
|
" ",
|
|
7714
7761
|
U
|
|
7715
7762
|
] }) }),
|
|
7716
7763
|
/* @__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: Ze(m) }, m)) })
|
|
7717
7764
|
] }),
|
|
7718
|
-
/* @__PURE__ */
|
|
7765
|
+
/* @__PURE__ */ o(Ce, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
7719
7766
|
a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: H || y, children: "Cancel" }),
|
|
7720
7767
|
/* @__PURE__ */ r(Z, { type: "submit", isLoading: H || y, children: "Register Company" })
|
|
7721
7768
|
] })
|
|
@@ -7728,12 +7775,12 @@ const Xn = ({
|
|
|
7728
7775
|
className: i
|
|
7729
7776
|
}) => {
|
|
7730
7777
|
const {
|
|
7731
|
-
progress:
|
|
7778
|
+
progress: s,
|
|
7732
7779
|
currentStep: c,
|
|
7733
7780
|
steps: d,
|
|
7734
7781
|
workflowKey: y,
|
|
7735
7782
|
nextWorkflowKey: p,
|
|
7736
|
-
hasWorkflowChanged:
|
|
7783
|
+
hasWorkflowChanged: b,
|
|
7737
7784
|
isLoading: P,
|
|
7738
7785
|
error: v,
|
|
7739
7786
|
moveBack: A,
|
|
@@ -7742,39 +7789,39 @@ const Xn = ({
|
|
|
7742
7789
|
if (we.useEffect(() => {
|
|
7743
7790
|
v && n && n(v);
|
|
7744
7791
|
}, [v, n]), we.useEffect(() => {
|
|
7745
|
-
|
|
7746
|
-
}, [
|
|
7792
|
+
s != null && s.workflowResult && t && t(s.workflowResult);
|
|
7793
|
+
}, [s == null ? void 0 : s.workflowResult, t]), we.useEffect(() => {
|
|
7747
7794
|
a === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
|
|
7748
7795
|
}, [a]), we.useEffect(() => {
|
|
7749
|
-
|
|
7750
|
-
}, [
|
|
7751
|
-
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */
|
|
7796
|
+
b && N(!1);
|
|
7797
|
+
}, [b]), P || !s)
|
|
7798
|
+
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */ o(ne, { children: [
|
|
7752
7799
|
/* @__PURE__ */ r(Me, { className: "my-8" }),
|
|
7753
7800
|
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading workflow..." })
|
|
7754
7801
|
] }) }) });
|
|
7755
7802
|
if (v)
|
|
7756
|
-
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */
|
|
7803
|
+
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
|
|
7757
7804
|
/* @__PURE__ */ r("p", { className: "text-lg mb-4", style: { color: "var(--metakyc-danger, #ef4444)" }, children: "An error occurred" }),
|
|
7758
7805
|
/* @__PURE__ */ r("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: v.message })
|
|
7759
7806
|
] }) }) }) });
|
|
7760
|
-
if (
|
|
7761
|
-
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */
|
|
7807
|
+
if (b && !w)
|
|
7808
|
+
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
|
|
7762
7809
|
/* @__PURE__ */ r("div", { className: "mb-6", children: /* @__PURE__ */ r("div", { className: "inline-flex items-center justify-center w-16 h-16 rounded-full mb-4", style: { backgroundColor: "var(--metakyc-primary-light, #dbeafe)" }, children: /* @__PURE__ */ r("svg", { className: "w-8 h-8", style: { color: "var(--metakyc-primary, #2563eb)" }, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }) }) }),
|
|
7763
7810
|
/* @__PURE__ */ r("h3", { className: "text-xl font-semibold mb-2", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Workflow Transition" }),
|
|
7764
7811
|
/* @__PURE__ */ r("p", { className: "mb-6", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Your application workflow has been updated based on your progress." }),
|
|
7765
|
-
/* @__PURE__ */
|
|
7766
|
-
/* @__PURE__ */
|
|
7767
|
-
/* @__PURE__ */
|
|
7812
|
+
/* @__PURE__ */ o("div", { className: "rounded-lg p-4 mb-6 max-w-md mx-auto", style: { backgroundColor: "var(--metakyc-surface, #f9fafb)" }, children: [
|
|
7813
|
+
/* @__PURE__ */ o("div", { className: "flex items-center justify-between text-sm", children: [
|
|
7814
|
+
/* @__PURE__ */ o("div", { className: "text-left", children: [
|
|
7768
7815
|
/* @__PURE__ */ r("p", { className: "mb-1", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: "Previous Workflow" }),
|
|
7769
7816
|
/* @__PURE__ */ r("p", { className: "font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: y })
|
|
7770
7817
|
] }),
|
|
7771
7818
|
/* @__PURE__ */ r("svg", { className: "w-6 h-6 mx-4", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 7l5 5m0 0l-5 5m5-5H6" }) }),
|
|
7772
|
-
/* @__PURE__ */
|
|
7819
|
+
/* @__PURE__ */ o("div", { className: "text-right", children: [
|
|
7773
7820
|
/* @__PURE__ */ r("p", { className: "mb-1", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: "New Workflow" }),
|
|
7774
7821
|
/* @__PURE__ */ r("p", { className: "font-medium", style: { color: "var(--metakyc-primary, #2563eb)" }, children: p })
|
|
7775
7822
|
] })
|
|
7776
7823
|
] }),
|
|
7777
|
-
|
|
7824
|
+
s.nextWorkflowName && /* @__PURE__ */ r("p", { className: "text-center mt-2 text-xs", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: s.nextWorkflowName })
|
|
7778
7825
|
] }),
|
|
7779
7826
|
/* @__PURE__ */ r(
|
|
7780
7827
|
"button",
|
|
@@ -7786,24 +7833,24 @@ const Xn = ({
|
|
|
7786
7833
|
}
|
|
7787
7834
|
)
|
|
7788
7835
|
] }) }) }) });
|
|
7789
|
-
if (
|
|
7836
|
+
if (s.status === ze.Finished || s.status === ze.OnHold)
|
|
7790
7837
|
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(
|
|
7791
7838
|
Pt,
|
|
7792
7839
|
{
|
|
7793
|
-
kycStatus:
|
|
7794
|
-
reviewStatus:
|
|
7795
|
-
workflowResult:
|
|
7796
|
-
customMessage:
|
|
7797
|
-
onContinue: t &&
|
|
7840
|
+
kycStatus: s.kycStatus,
|
|
7841
|
+
reviewStatus: s.reviewStatus,
|
|
7842
|
+
workflowResult: s.workflowResult,
|
|
7843
|
+
customMessage: s.customMessage,
|
|
7844
|
+
onContinue: t && s.workflowResult ? () => t(s.workflowResult) : void 0,
|
|
7798
7845
|
onContactSupport: () => {
|
|
7799
7846
|
typeof window < "u" && (window.location.href = "mailto:support@example.com");
|
|
7800
7847
|
}
|
|
7801
7848
|
}
|
|
7802
7849
|
) });
|
|
7803
7850
|
if (!c)
|
|
7804
|
-
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */
|
|
7851
|
+
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */ o(ne, { children: [
|
|
7805
7852
|
/* @__PURE__ */ r(Me, { className: "my-8" }),
|
|
7806
|
-
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children:
|
|
7853
|
+
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: s.status === ze.IdentityPending ? "Loading identity verification..." : "Loading current step..." })
|
|
7807
7854
|
] }) }) });
|
|
7808
7855
|
const Q = (K) => {
|
|
7809
7856
|
switch (K) {
|
|
@@ -7830,10 +7877,10 @@ const Xn = ({
|
|
|
7830
7877
|
}
|
|
7831
7878
|
}, M = () => {
|
|
7832
7879
|
const K = d.filter((V) => V.visibility !== !1), ee = K.findIndex((V) => V.order === c.order), E = ee >= 0 ? ee + 1 : 1, g = K.length, $ = g > 1 ? ee / (g - 1) * 100 : 100;
|
|
7833
|
-
return /* @__PURE__ */
|
|
7834
|
-
/* @__PURE__ */
|
|
7880
|
+
return /* @__PURE__ */ o("div", { style: { marginBottom: "24px" }, children: [
|
|
7881
|
+
/* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", marginBottom: "16px" }, children: [
|
|
7835
7882
|
/* @__PURE__ */ r(mt, {}),
|
|
7836
|
-
/* @__PURE__ */
|
|
7883
|
+
/* @__PURE__ */ o($t, { variant: s.status === 1 ? "info" : "success", children: [
|
|
7837
7884
|
"Step ",
|
|
7838
7885
|
E,
|
|
7839
7886
|
" of ",
|
|
@@ -7883,43 +7930,43 @@ const Xn = ({
|
|
|
7883
7930
|
return /* @__PURE__ */ r(Nn, { ...K });
|
|
7884
7931
|
case ce.AdditionalData:
|
|
7885
7932
|
case ce.InvestorCategorization:
|
|
7886
|
-
return /* @__PURE__ */ r(
|
|
7933
|
+
return /* @__PURE__ */ r(Rn, { ...K });
|
|
7887
7934
|
case ce.AppropriatenessTest:
|
|
7888
7935
|
return /* @__PURE__ */ r(En, { ...K });
|
|
7889
7936
|
case ce.ManualReview:
|
|
7890
7937
|
return /* @__PURE__ */ r(
|
|
7891
7938
|
Pt,
|
|
7892
7939
|
{
|
|
7893
|
-
kycStatus:
|
|
7894
|
-
reviewStatus:
|
|
7895
|
-
workflowResult:
|
|
7896
|
-
customMessage:
|
|
7940
|
+
kycStatus: s.kycStatus,
|
|
7941
|
+
reviewStatus: s.reviewStatus,
|
|
7942
|
+
workflowResult: s.workflowResult,
|
|
7943
|
+
customMessage: s.customMessage
|
|
7897
7944
|
}
|
|
7898
7945
|
);
|
|
7899
7946
|
default:
|
|
7900
|
-
return /* @__PURE__ */ r(re, { children: /* @__PURE__ */
|
|
7947
|
+
return /* @__PURE__ */ r(re, { children: /* @__PURE__ */ o(ne, { className: "py-12 text-center", children: [
|
|
7901
7948
|
/* @__PURE__ */ r("div", { className: "mb-4", children: /* @__PURE__ */ r(Me, {}) }),
|
|
7902
|
-
/* @__PURE__ */
|
|
7949
|
+
/* @__PURE__ */ o("p", { className: "text-gray-600 dark:text-gray-400 mb-2", children: [
|
|
7903
7950
|
"Processing step: ",
|
|
7904
7951
|
c.title || c.name
|
|
7905
7952
|
] }),
|
|
7906
|
-
/* @__PURE__ */
|
|
7953
|
+
/* @__PURE__ */ o("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: [
|
|
7907
7954
|
"Action type: ",
|
|
7908
7955
|
ce[c.action]
|
|
7909
7956
|
] })
|
|
7910
7957
|
] }) });
|
|
7911
7958
|
}
|
|
7912
7959
|
};
|
|
7913
|
-
return /* @__PURE__ */
|
|
7960
|
+
return /* @__PURE__ */ o("div", { className: `metakyc-sdk ${i || ""}`, children: [
|
|
7914
7961
|
M(),
|
|
7915
7962
|
j()
|
|
7916
7963
|
] });
|
|
7917
7964
|
}, Ln = we.forwardRef(
|
|
7918
7965
|
({ visibleSteps: e, currentVisibleStepIndex: t, getStepFallbackName: n }, a) => {
|
|
7919
|
-
const i = we.useRef(null),
|
|
7966
|
+
const i = we.useRef(null), s = we.useRef(null);
|
|
7920
7967
|
return we.useImperativeHandle(a, () => i.current), we.useEffect(() => {
|
|
7921
|
-
if (
|
|
7922
|
-
const c = i.current, d =
|
|
7968
|
+
if (s.current && i.current) {
|
|
7969
|
+
const c = i.current, d = s.current, y = d.offsetLeft - c.offsetWidth / 2 + d.offsetWidth / 2;
|
|
7923
7970
|
c.scrollTo({ left: Math.max(0, y), behavior: "smooth" });
|
|
7924
7971
|
}
|
|
7925
7972
|
}, [t]), /* @__PURE__ */ r(
|
|
@@ -7939,12 +7986,12 @@ const Xn = ({
|
|
|
7939
7986
|
gap: "0"
|
|
7940
7987
|
},
|
|
7941
7988
|
children: e.map((c, d) => {
|
|
7942
|
-
const y = d < t, p = d === t,
|
|
7943
|
-
return /* @__PURE__ */
|
|
7944
|
-
/* @__PURE__ */
|
|
7989
|
+
const y = d < t, p = d === t, b = y || p, P = c.displayName || c.name || n(c.action) || `Step ${d + 1}`;
|
|
7990
|
+
return /* @__PURE__ */ o(we.Fragment, { children: [
|
|
7991
|
+
/* @__PURE__ */ o(
|
|
7945
7992
|
"div",
|
|
7946
7993
|
{
|
|
7947
|
-
ref: p ?
|
|
7994
|
+
ref: p ? s : void 0,
|
|
7948
7995
|
style: {
|
|
7949
7996
|
display: "flex",
|
|
7950
7997
|
alignItems: "center",
|
|
@@ -7962,7 +8009,7 @@ const Xn = ({
|
|
|
7962
8009
|
fontWeight: 600,
|
|
7963
8010
|
flexShrink: 0,
|
|
7964
8011
|
transition: "all 0.2s ease",
|
|
7965
|
-
...
|
|
8012
|
+
...b ? {
|
|
7966
8013
|
backgroundColor: "var(--metakyc-primary, #2563eb)",
|
|
7967
8014
|
color: "#ffffff",
|
|
7968
8015
|
border: "none"
|
|
@@ -8019,7 +8066,7 @@ function Dn(e) {
|
|
|
8019
8066
|
const n = e.allowedTypes.split(",").map((a) => a.trim());
|
|
8020
8067
|
t = t.refine(
|
|
8021
8068
|
(a) => a ? a.every(
|
|
8022
|
-
(i) => n.some((
|
|
8069
|
+
(i) => n.some((s) => s.endsWith("/*") ? i.type.startsWith(s.slice(0, -2)) : i.type === s)
|
|
8023
8070
|
) : !0,
|
|
8024
8071
|
{ message: "Invalid file type" }
|
|
8025
8072
|
);
|
|
@@ -8048,7 +8095,7 @@ function aa(e) {
|
|
|
8048
8095
|
}
|
|
8049
8096
|
const ia = Ve.any();
|
|
8050
8097
|
export {
|
|
8051
|
-
|
|
8098
|
+
Rt as ALLOWED_LANGUAGES,
|
|
8052
8099
|
Jt as ApplicantProgressOnHoldReason,
|
|
8053
8100
|
ze as ApplicantProgressStatus,
|
|
8054
8101
|
mr as ApplicantService,
|
|
@@ -8059,7 +8106,7 @@ export {
|
|
|
8059
8106
|
$t as Badge,
|
|
8060
8107
|
vr as BaseInformationService,
|
|
8061
8108
|
Z as Button,
|
|
8062
|
-
|
|
8109
|
+
ot as COMPANY_FIELD_METADATA,
|
|
8063
8110
|
re as Card,
|
|
8064
8111
|
ne as CardContent,
|
|
8065
8112
|
Ce as CardFooter,
|
|
@@ -8067,7 +8114,7 @@ export {
|
|
|
8067
8114
|
Je as CountriesType,
|
|
8068
8115
|
Zn as CreateApplicantForm,
|
|
8069
8116
|
Xn as CreateCompanyApplicantForm,
|
|
8070
|
-
|
|
8117
|
+
or as CriteriaBuiltInType,
|
|
8071
8118
|
lr as DEFAULT_COMPANY_VISIBLE_FIELDS,
|
|
8072
8119
|
cr as DEFAULT_VISIBLE_FIELDS,
|
|
8073
8120
|
nr as DocumentReviewStatus,
|
|
@@ -8086,9 +8133,9 @@ export {
|
|
|
8086
8133
|
Tn as IdentityVerificationStep,
|
|
8087
8134
|
xe as Input,
|
|
8088
8135
|
kr as InvestorCategorizationService,
|
|
8089
|
-
|
|
8136
|
+
Rn as InvestorCategorizationStep,
|
|
8090
8137
|
Ee as InvestorCategorizationType,
|
|
8091
|
-
|
|
8138
|
+
sr as InvestorCategoryType,
|
|
8092
8139
|
er as KycProcessStatus,
|
|
8093
8140
|
tt as KycStatus,
|
|
8094
8141
|
Pt as KycStatusDisplay,
|
|
@@ -8148,12 +8195,12 @@ export {
|
|
|
8148
8195
|
Cr as healthcareTheme,
|
|
8149
8196
|
Wn as isScriptLoaded,
|
|
8150
8197
|
Mt as loadScript,
|
|
8151
|
-
|
|
8198
|
+
Ir as minimalTheme,
|
|
8152
8199
|
Nr as modernTheme,
|
|
8153
8200
|
Un as removeScript,
|
|
8154
8201
|
jr as saveApplicantId,
|
|
8155
8202
|
Ur as saveWorkflowState,
|
|
8156
|
-
|
|
8203
|
+
Rr as themePresets,
|
|
8157
8204
|
zt as useApplicant,
|
|
8158
8205
|
Jn as useAppropriatenessTest,
|
|
8159
8206
|
Gr as useIdentityVerification,
|