@vpdev2/metakyc-sdk 1.0.7 → 1.0.9
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/context/MetaKYCProvider.d.ts.map +1 -1
- package/dist/hooks/useApplicant.d.ts.map +1 -1
- package/dist/hooks/useAppropriatenessTest.d.ts.map +1 -1
- package/dist/hooks/useOverview.d.ts.map +1 -1
- package/dist/hooks/useQuestionnaire.d.ts.map +1 -1
- package/dist/hooks/useRiskScoring.d.ts.map +1 -1
- package/dist/hooks/useUploadDocument.d.ts.map +1 -1
- package/dist/index.cjs +12 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1214 -1184
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,12 +2,12 @@ var Je = Object.defineProperty;
|
|
|
2
2
|
var Xe = (t, e, r) => e in t ? Je(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
3
|
var K = (t, e, r) => Xe(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
4
|
import et from "axios";
|
|
5
|
-
import * as
|
|
6
|
-
import
|
|
5
|
+
import * as Me from "react";
|
|
6
|
+
import ie, { createContext as tt, useState as N, useMemo as Re, useEffect as Y, useContext as rt, useRef as H, useCallback as q, forwardRef as Le } from "react";
|
|
7
7
|
import { jsx as n, jsxs as o, Fragment as nt } from "react/jsx-runtime";
|
|
8
|
-
import { get as
|
|
9
|
-
import { z as
|
|
10
|
-
var U = /* @__PURE__ */ ((t) => (t[t.IdentitySdk = 0] = "IdentitySdk", t[t.RiskScoring = 1] = "RiskScoring", t[t.Questionaries = 2] = "Questionaries", t[t.AdditionalData = 3] = "AdditionalData", t[t.AppropriatenessTest = 4] = "AppropriatenessTest", t[t.UploadDocument = 5] = "UploadDocument", t[t.ManualReview = 6] = "ManualReview", t[t.Overview = 7] = "Overview", t[t.InvestorCategorization = 8] = "InvestorCategorization", t))(U || {}),
|
|
8
|
+
import { get as De, set as Ee, appendErrors as _e, useForm as Te, Controller as J } from "react-hook-form";
|
|
9
|
+
import { z as ue } from "zod";
|
|
10
|
+
var U = /* @__PURE__ */ ((t) => (t[t.IdentitySdk = 0] = "IdentitySdk", t[t.RiskScoring = 1] = "RiskScoring", t[t.Questionaries = 2] = "Questionaries", t[t.AdditionalData = 3] = "AdditionalData", t[t.AppropriatenessTest = 4] = "AppropriatenessTest", t[t.UploadDocument = 5] = "UploadDocument", t[t.ManualReview = 6] = "ManualReview", t[t.Overview = 7] = "Overview", t[t.InvestorCategorization = 8] = "InvestorCategorization", t))(U || {}), Ne = /* @__PURE__ */ ((t) => (t[t.NotStarted = 0] = "NotStarted", t[t.InProgress = 1] = "InProgress", t[t.Success = 2] = "Success", t[t.PartialSuccess = 3] = "PartialSuccess", t[t.Failed = 4] = "Failed", t[t.Skipped = 5] = "Skipped", t[t.AdminReview = 6] = "AdminReview", t[t.SkippedAndAdminReview = 7] = "SkippedAndAdminReview", t))(Ne || {}), le = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.InProgress = 1] = "InProgress", t[t.Finished = 2] = "Finished", t[t.OnHold = 3] = "OnHold", t[t.IdentityPending = 4] = "IdentityPending", t))(le || {}), st = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.RepresentativeKYC = 1] = "RepresentativeKYC", t[t.ManualRiskCriteria = 2] = "ManualRiskCriteria", t[t.UploadDocumentReview = 3] = "UploadDocumentReview", t[t.AdminReview = 4] = "AdminReview", t))(st || {}), at = /* @__PURE__ */ ((t) => (t[t.LowRisk = 0] = "LowRisk", t[t.MediumRisk = 1] = "MediumRisk", t[t.HighRisk = 2] = "HighRisk", t[t.Alert = 3] = "Alert", t))(at || {}), pe = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.Pending = 1] = "Pending", t[t.Approved = 2] = "Approved", t[t.Rejected = 3] = "Rejected", t[t.ResendRequested = 4] = "ResendRequested", t[t.Unknown = 5] = "Unknown", t[t.InProgress = 6] = "InProgress", t))(pe || {}), ge = /* @__PURE__ */ ((t) => (t[t.Approved = 0] = "Approved", t[t.Reject = 1] = "Reject", t[t.UnderReview = 2] = "UnderReview", t[t.Closed = 3] = "Closed", t[t.AdminReview = 4] = "AdminReview", t[t.New = 5] = "New", t[t.InProgress = 6] = "InProgress", t))(ge || {}), it = /* @__PURE__ */ ((t) => (t[t.ProviderResultPending = 0] = "ProviderResultPending", t[t.ProviderResultReceived = 1] = "ProviderResultReceived", t[t.Canceled = 2] = "Canceled", t[t.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", t))(it || {}), ot = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.ProviderResultPending = 1] = "ProviderResultPending", t[t.ProviderResultReceived = 2] = "ProviderResultReceived", t[t.Canceled = 3] = "Canceled", t))(ot || {}), oe = /* @__PURE__ */ ((t) => (t[t.Onfido = 0] = "Onfido", t[t.Sumsub = 2] = "Sumsub", t[t.SardinAI = 3] = "SardinAI", t))(oe || {}), lt = /* @__PURE__ */ ((t) => (t[t.Individual = 0] = "Individual", t[t.Company = 1] = "Company", t))(lt || {}), Se = /* @__PURE__ */ ((t) => (t[t.Male = 0] = "Male", t[t.Female = 1] = "Female", t[t.Other = 2] = "Other", t))(Se || {}), ct = /* @__PURE__ */ ((t) => (t[t.Image = 0] = "Image", t[t.Video = 1] = "Video", t[t.PDF = 2] = "PDF", t[t.OfficePDF = 3] = "OfficePDF", t[t.Custom = 4] = "Custom", t))(ct || {}), dt = /* @__PURE__ */ ((t) => (t[t.Pending = 0] = "Pending", t[t.Approved = 1] = "Approved", t[t.Rejected = 2] = "Rejected", t[t.RequiresRevision = 3] = "RequiresRevision", t))(dt || {}), ut = /* @__PURE__ */ ((t) => (t[t.SingleChoice = 0] = "SingleChoice", t[t.MultipleChoice = 1] = "MultipleChoice", t[t.Text = 2] = "Text", t))(ut || {}), Pe = /* @__PURE__ */ ((t) => (t[t.String = 0] = "String", t[t.Integer = 1] = "Integer", t[t.Decimal = 2] = "Decimal", t[t.Boolean = 3] = "Boolean", t[t.Date = 4] = "Date", t[t.Country = 5] = "Country", t[t.DigitOnly = 6] = "DigitOnly", t))(Pe || {}), mt = /* @__PURE__ */ ((t) => (t[t.Text = 0] = "Text", t[t.Radio = 1] = "Radio", t[t.Checkbox = 2] = "Checkbox", t[t.Dropdown = 3] = "Dropdown", t[t.Country = 4] = "Country", t))(mt || {}), ht = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.Country = 1] = "Country", t))(ht || {}), re = /* @__PURE__ */ ((t) => (t[t.Individual = 0] = "Individual", t[t.Sophisticated = 1] = "Sophisticated", t[t.HighNetWorth = 2] = "HighNetWorth", t[t.Business = 3] = "Business", t))(re || {}), pt = /* @__PURE__ */ ((t) => (t[t.Retail = 0] = "Retail", t[t.Professional = 1] = "Professional", t[t.EligibleCounterparty = 2] = "EligibleCounterparty", t))(pt || {});
|
|
11
11
|
const gt = [
|
|
12
12
|
"firstName",
|
|
13
13
|
"lastName",
|
|
@@ -71,7 +71,7 @@ const gt = [
|
|
|
71
71
|
taxNumber: { label: "Tax Number", type: "text" },
|
|
72
72
|
externalRefId: { label: "External Reference ID", type: "text" }
|
|
73
73
|
};
|
|
74
|
-
var
|
|
74
|
+
var W = /* @__PURE__ */ ((t) => (t.Default = "default", t.Corporate = "corporate", t.Fintech = "fintech", t.Healthcare = "healthcare", t.Modern = "modern", t.Minimal = "minimal", t))(W || {});
|
|
75
75
|
const ft = {
|
|
76
76
|
timeout: 3e4,
|
|
77
77
|
retries: 3,
|
|
@@ -120,19 +120,19 @@ class bt {
|
|
|
120
120
|
}[e] || e;
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
-
class
|
|
124
|
-
constructor(r, s, a, i,
|
|
123
|
+
class de extends Error {
|
|
124
|
+
constructor(r, s, a, i, l) {
|
|
125
125
|
super(r);
|
|
126
126
|
K(this, "response");
|
|
127
|
-
this.code = s, this.details = a, this.validationErrors = i, this.name = "MetaKYCError", this.response =
|
|
127
|
+
this.code = s, this.details = a, this.validationErrors = i, this.name = "MetaKYCError", this.response = l, Object.setPrototypeOf(this, de.prototype);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
class
|
|
130
|
+
class ve {
|
|
131
131
|
/**
|
|
132
132
|
* Process an error from the API response
|
|
133
133
|
*/
|
|
134
134
|
static handleApiError(e) {
|
|
135
|
-
return new
|
|
135
|
+
return new de(
|
|
136
136
|
e.message || "An unknown error occurred",
|
|
137
137
|
e.code,
|
|
138
138
|
e.details || void 0,
|
|
@@ -145,39 +145,39 @@ class be {
|
|
|
145
145
|
static handleAxiosError(e) {
|
|
146
146
|
if (e.response) {
|
|
147
147
|
const r = e.response.data;
|
|
148
|
-
return r && r.error ? new
|
|
148
|
+
return r && r.error ? new de(
|
|
149
149
|
r.error.message || "An unknown error occurred",
|
|
150
150
|
r.error.code,
|
|
151
151
|
r.error.details || void 0,
|
|
152
152
|
r.error.validationErrors || void 0,
|
|
153
153
|
e.response
|
|
154
|
-
) : r && r.result && r.result.message ? new
|
|
154
|
+
) : r && r.result && r.result.message ? new de(
|
|
155
155
|
r.result.message,
|
|
156
156
|
e.response.status,
|
|
157
157
|
`HTTP ${e.response.status}: ${e.response.statusText}`,
|
|
158
158
|
void 0,
|
|
159
159
|
e.response
|
|
160
|
-
) : new
|
|
160
|
+
) : new de(
|
|
161
161
|
(r == null ? void 0 : r.message) || e.message || "Request failed",
|
|
162
162
|
e.response.status,
|
|
163
163
|
`HTTP ${e.response.status}: ${e.response.statusText}`,
|
|
164
164
|
void 0,
|
|
165
165
|
e.response
|
|
166
166
|
);
|
|
167
|
-
} else return e.request ? new
|
|
167
|
+
} else return e.request ? new de(
|
|
168
168
|
"No response from server",
|
|
169
169
|
0,
|
|
170
170
|
"The request was made but no response was received. Please check your network connection."
|
|
171
|
-
) : new
|
|
171
|
+
) : new de(e.message || "An unexpected error occurred", 0, e.toString());
|
|
172
172
|
}
|
|
173
173
|
/**
|
|
174
174
|
* Check if an error is a MetaKYCError
|
|
175
175
|
*/
|
|
176
176
|
static isMetaKYCError(e) {
|
|
177
|
-
return e instanceof
|
|
177
|
+
return e instanceof de;
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
|
-
class
|
|
180
|
+
class vt {
|
|
181
181
|
constructor(e) {
|
|
182
182
|
K(this, "axiosInstance");
|
|
183
183
|
K(this, "endpointBuilder");
|
|
@@ -218,7 +218,7 @@ class xt {
|
|
|
218
218
|
});
|
|
219
219
|
return this.handleResponse(i);
|
|
220
220
|
} catch (a) {
|
|
221
|
-
throw
|
|
221
|
+
throw ve.handleAxiosError(a);
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
224
|
/**
|
|
@@ -229,7 +229,7 @@ class xt {
|
|
|
229
229
|
const a = this.buildEndpoint(e, r), i = await this.axiosInstance.post(a, s);
|
|
230
230
|
return this.handleResponse(i);
|
|
231
231
|
} catch (a) {
|
|
232
|
-
throw
|
|
232
|
+
throw ve.handleAxiosError(a);
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
235
|
/**
|
|
@@ -240,7 +240,7 @@ class xt {
|
|
|
240
240
|
const a = this.buildEndpoint(e, r), i = await this.axiosInstance.put(a, s);
|
|
241
241
|
return this.handleResponse(i);
|
|
242
242
|
} catch (a) {
|
|
243
|
-
throw
|
|
243
|
+
throw ve.handleAxiosError(a);
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
/**
|
|
@@ -253,7 +253,7 @@ class xt {
|
|
|
253
253
|
});
|
|
254
254
|
return this.handleResponse(i);
|
|
255
255
|
} catch (a) {
|
|
256
|
-
throw
|
|
256
|
+
throw ve.handleAxiosError(a);
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
259
|
/**
|
|
@@ -262,7 +262,7 @@ class xt {
|
|
|
262
262
|
handleResponse(e) {
|
|
263
263
|
const r = e.data;
|
|
264
264
|
if (!r.success && r.error)
|
|
265
|
-
throw
|
|
265
|
+
throw ve.handleApiError(r.error);
|
|
266
266
|
return r;
|
|
267
267
|
}
|
|
268
268
|
/**
|
|
@@ -272,7 +272,7 @@ class xt {
|
|
|
272
272
|
return this.axiosInstance;
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
|
-
class
|
|
275
|
+
class xt {
|
|
276
276
|
constructor(e) {
|
|
277
277
|
this.httpClient = e;
|
|
278
278
|
}
|
|
@@ -646,7 +646,7 @@ class It {
|
|
|
646
646
|
)).result;
|
|
647
647
|
}
|
|
648
648
|
}
|
|
649
|
-
const
|
|
649
|
+
const Z = {
|
|
650
650
|
name: "Default",
|
|
651
651
|
title: "KYC Verification",
|
|
652
652
|
logo: {
|
|
@@ -880,15 +880,15 @@ const Q = {
|
|
|
880
880
|
inputHeight: "2.25rem"
|
|
881
881
|
}
|
|
882
882
|
}, Tt = {
|
|
883
|
-
[
|
|
884
|
-
[
|
|
885
|
-
[
|
|
886
|
-
[
|
|
887
|
-
[
|
|
888
|
-
[
|
|
883
|
+
[W.Default]: Z,
|
|
884
|
+
[W.Corporate]: Rt,
|
|
885
|
+
[W.Fintech]: Dt,
|
|
886
|
+
[W.Healthcare]: Pt,
|
|
887
|
+
[W.Modern]: Ft,
|
|
888
|
+
[W.Minimal]: Lt
|
|
889
889
|
};
|
|
890
890
|
function xe(t) {
|
|
891
|
-
return Tt[t] ||
|
|
891
|
+
return Tt[t] || Z;
|
|
892
892
|
}
|
|
893
893
|
class Mt {
|
|
894
894
|
constructor(e) {
|
|
@@ -905,8 +905,8 @@ class Mt {
|
|
|
905
905
|
"GetThemeConfiguration"
|
|
906
906
|
);
|
|
907
907
|
if (!r.result.isEnabled)
|
|
908
|
-
return xe(
|
|
909
|
-
let s = r.result.preset ? xe(r.result.preset) : xe(
|
|
908
|
+
return xe(W.Default);
|
|
909
|
+
let s = r.result.preset ? xe(r.result.preset) : xe(W.Default);
|
|
910
910
|
return r.result.title && (s.title = r.result.title), r.result.logo && (s.logo = { ...s.logo, ...r.result.logo }), r.result.colors && (s.colors = { ...s.colors, ...r.result.colors }), r.result.typography && (s.typography = { ...s.typography, ...r.result.typography }), r.result.spacing && (s.spacing = { ...s.spacing, ...r.result.spacing }), r.result.customCSS && (s.customCSS = r.result.customCSS), r.result.darkMode && (s.darkMode = {
|
|
911
911
|
colors: {
|
|
912
912
|
...(e = s.darkMode) == null ? void 0 : e.colors,
|
|
@@ -914,7 +914,7 @@ class Mt {
|
|
|
914
914
|
}
|
|
915
915
|
}), s;
|
|
916
916
|
} catch (r) {
|
|
917
|
-
return console.warn("[ThemeService] Failed to fetch theme configuration:", r), xe(
|
|
917
|
+
return console.warn("[ThemeService] Failed to fetch theme configuration:", r), xe(W.Default);
|
|
918
918
|
}
|
|
919
919
|
}
|
|
920
920
|
/**
|
|
@@ -928,12 +928,12 @@ class Mt {
|
|
|
928
928
|
*/
|
|
929
929
|
getAvailablePresets() {
|
|
930
930
|
return [
|
|
931
|
-
{ id:
|
|
932
|
-
{ id:
|
|
933
|
-
{ id:
|
|
934
|
-
{ id:
|
|
935
|
-
{ id:
|
|
936
|
-
{ id:
|
|
931
|
+
{ id: W.Default, name: "Default" },
|
|
932
|
+
{ id: W.Corporate, name: "Corporate" },
|
|
933
|
+
{ id: W.Fintech, name: "Fintech" },
|
|
934
|
+
{ id: W.Healthcare, name: "Healthcare" },
|
|
935
|
+
{ id: W.Modern, name: "Modern" },
|
|
936
|
+
{ id: W.Minimal, name: "Minimal" }
|
|
937
937
|
];
|
|
938
938
|
}
|
|
939
939
|
/**
|
|
@@ -1034,7 +1034,7 @@ class Ot {
|
|
|
1034
1034
|
*/
|
|
1035
1035
|
get status() {
|
|
1036
1036
|
var e;
|
|
1037
|
-
return ((e = this._progress) == null ? void 0 : e.status) ||
|
|
1037
|
+
return ((e = this._progress) == null ? void 0 : e.status) || le.None;
|
|
1038
1038
|
}
|
|
1039
1039
|
/**
|
|
1040
1040
|
* Get workflow result
|
|
@@ -1053,19 +1053,19 @@ class Ot {
|
|
|
1053
1053
|
* Check if workflow is complete
|
|
1054
1054
|
*/
|
|
1055
1055
|
get isComplete() {
|
|
1056
|
-
return this.status ===
|
|
1056
|
+
return this.status === le.Finished;
|
|
1057
1057
|
}
|
|
1058
1058
|
/**
|
|
1059
1059
|
* Check if workflow is on hold
|
|
1060
1060
|
*/
|
|
1061
1061
|
get isOnHold() {
|
|
1062
|
-
return this.status ===
|
|
1062
|
+
return this.status === le.OnHold;
|
|
1063
1063
|
}
|
|
1064
1064
|
/**
|
|
1065
1065
|
* Check if workflow is in progress
|
|
1066
1066
|
*/
|
|
1067
1067
|
get isInProgress() {
|
|
1068
|
-
return this.status ===
|
|
1068
|
+
return this.status === le.InProgress;
|
|
1069
1069
|
}
|
|
1070
1070
|
/**
|
|
1071
1071
|
* Set applicant ID
|
|
@@ -1079,7 +1079,7 @@ class Ot {
|
|
|
1079
1079
|
updateProgress(e) {
|
|
1080
1080
|
var s, a;
|
|
1081
1081
|
const r = (s = this._progress) == null ? void 0 : s.currentStep;
|
|
1082
|
-
this._progress = e, this._applicantId = e.applicantId, this._error = null, this.events.emit("progressUpdated", e), (r == null ? void 0 : r.order) !== ((a = e.currentStep) == null ? void 0 : a.order) && this.events.emit("stepChanged", e.currentStep), this.events.emit("statusChanged", e.status), e.status ===
|
|
1082
|
+
this._progress = e, this._applicantId = e.applicantId, this._error = null, this.events.emit("progressUpdated", e), (r == null ? void 0 : r.order) !== ((a = e.currentStep) == null ? void 0 : a.order) && this.events.emit("stepChanged", e.currentStep), this.events.emit("statusChanged", e.status), e.status === le.Finished && e.workflowResult && this.events.emit("completed", e.workflowResult);
|
|
1083
1083
|
}
|
|
1084
1084
|
/**
|
|
1085
1085
|
* Set error
|
|
@@ -1178,10 +1178,10 @@ class zt {
|
|
|
1178
1178
|
}
|
|
1179
1179
|
}
|
|
1180
1180
|
class $t {
|
|
1181
|
-
constructor(e, r, s, a, i,
|
|
1181
|
+
constructor(e, r, s, a, i, l, c, d) {
|
|
1182
1182
|
K(this, "state");
|
|
1183
1183
|
K(this, "stepRouter");
|
|
1184
|
-
this.applicantService = e, this.questionnaireService = r, this.uploadDocumentService = s, this.appropriatenessTestService = a, this.overviewService = i, this.riskScoringService =
|
|
1184
|
+
this.applicantService = e, this.questionnaireService = r, this.uploadDocumentService = s, this.appropriatenessTestService = a, this.overviewService = i, this.riskScoringService = l, this.investorCategorizationService = d, this.state = new Ot(), this.stepRouter = new zt(), this.registerStepHandlers();
|
|
1185
1185
|
}
|
|
1186
1186
|
/**
|
|
1187
1187
|
* Register all step handlers
|
|
@@ -1519,7 +1519,7 @@ class Kt {
|
|
|
1519
1519
|
try {
|
|
1520
1520
|
if (await this.loadSDK(), !window._Sardine)
|
|
1521
1521
|
throw new Error("SardinAI SDK not available after loading");
|
|
1522
|
-
const e = this.getSardineHost(), { clientId: r, environment: s, flow: a, enableBiometrics: i, enablePortScanning:
|
|
1522
|
+
const e = this.getSardineHost(), { clientId: r, environment: s, flow: a, enableBiometrics: i, enablePortScanning: l } = this.config;
|
|
1523
1523
|
this.sardineContext = window._Sardine.createContext({
|
|
1524
1524
|
clientId: r,
|
|
1525
1525
|
sessionKey: this.sessionKey,
|
|
@@ -1530,16 +1530,16 @@ class Kt {
|
|
|
1530
1530
|
parentElement: document.body,
|
|
1531
1531
|
enableBiometrics: i !== !1,
|
|
1532
1532
|
// Default true
|
|
1533
|
-
enablePortScanning:
|
|
1533
|
+
enablePortScanning: l === !0,
|
|
1534
1534
|
// Default false
|
|
1535
1535
|
region: this.config.region,
|
|
1536
1536
|
// Callback for device response (deprecated but kept for compatibility)
|
|
1537
|
-
onDeviceResponse: (
|
|
1538
|
-
console.log(`[SardinAI] Device ID: ${
|
|
1537
|
+
onDeviceResponse: (c) => {
|
|
1538
|
+
console.log(`[SardinAI] Device ID: ${c.deviceId}`);
|
|
1539
1539
|
},
|
|
1540
1540
|
// New callback for session updates
|
|
1541
|
-
onConfigUpdate: (
|
|
1542
|
-
switch (
|
|
1541
|
+
onConfigUpdate: (c, d, u) => {
|
|
1542
|
+
switch (c) {
|
|
1543
1543
|
case "SESSION_UPDATE_FAILED":
|
|
1544
1544
|
console.error("[SardinAI] Session update failed:", u);
|
|
1545
1545
|
break;
|
|
@@ -1550,7 +1550,7 @@ class Kt {
|
|
|
1550
1550
|
console.log("[SardinAI] No session update");
|
|
1551
1551
|
break;
|
|
1552
1552
|
default:
|
|
1553
|
-
console.warn("[SardinAI] Unknown event:",
|
|
1553
|
+
console.warn("[SardinAI] Unknown event:", c);
|
|
1554
1554
|
}
|
|
1555
1555
|
}
|
|
1556
1556
|
}), this.addNoScriptFallback(e), console.log("[SardinAI] SDK initialized with sessionKey:", this.sessionKey);
|
|
@@ -1603,17 +1603,17 @@ class Kt {
|
|
|
1603
1603
|
this.sardineContext && (this.sardineContext = null);
|
|
1604
1604
|
}
|
|
1605
1605
|
}
|
|
1606
|
-
class
|
|
1606
|
+
class fe {
|
|
1607
1607
|
/**
|
|
1608
1608
|
* Create a provider instance
|
|
1609
1609
|
*/
|
|
1610
1610
|
static createProvider(e, r) {
|
|
1611
1611
|
switch (e) {
|
|
1612
|
-
case
|
|
1612
|
+
case oe.Sumsub:
|
|
1613
1613
|
return new jt(r);
|
|
1614
|
-
case
|
|
1614
|
+
case oe.Onfido:
|
|
1615
1615
|
return new _t(r);
|
|
1616
|
-
case
|
|
1616
|
+
case oe.SardinAI:
|
|
1617
1617
|
return new Kt(r);
|
|
1618
1618
|
default:
|
|
1619
1619
|
throw new Error(`Unsupported identity provider: ${e}`);
|
|
@@ -1625,7 +1625,7 @@ class ye {
|
|
|
1625
1625
|
static parseProviderConfig(e, r, s) {
|
|
1626
1626
|
var a;
|
|
1627
1627
|
switch (e) {
|
|
1628
|
-
case
|
|
1628
|
+
case oe.Sumsub:
|
|
1629
1629
|
return {
|
|
1630
1630
|
accessToken: r.accessToken || r.token,
|
|
1631
1631
|
applicantEmail: r.email,
|
|
@@ -1633,11 +1633,11 @@ class ye {
|
|
|
1633
1633
|
externalUserId: r.externalUserId,
|
|
1634
1634
|
lang: r.lang || "en"
|
|
1635
1635
|
};
|
|
1636
|
-
case
|
|
1636
|
+
case oe.Onfido:
|
|
1637
1637
|
return {
|
|
1638
1638
|
token: r.token || r.sdkToken
|
|
1639
1639
|
};
|
|
1640
|
-
case
|
|
1640
|
+
case oe.SardinAI:
|
|
1641
1641
|
const i = ((a = s == null ? void 0 : s.identityProviders) == null ? void 0 : a.sardinai) || {};
|
|
1642
1642
|
return {
|
|
1643
1643
|
clientId: i.clientId || r.clientId,
|
|
@@ -1655,7 +1655,7 @@ class ye {
|
|
|
1655
1655
|
}
|
|
1656
1656
|
class Ut {
|
|
1657
1657
|
constructor(e) {
|
|
1658
|
-
K(this, "currentTheme",
|
|
1658
|
+
K(this, "currentTheme", Z);
|
|
1659
1659
|
K(this, "customStyleElement", null);
|
|
1660
1660
|
K(this, "container");
|
|
1661
1661
|
this.container = e || document.documentElement;
|
|
@@ -1735,19 +1735,19 @@ class Ut {
|
|
|
1735
1735
|
mergeWithDefault(e) {
|
|
1736
1736
|
var r;
|
|
1737
1737
|
return {
|
|
1738
|
-
name: e.name ||
|
|
1739
|
-
title: e.title ||
|
|
1740
|
-
logo: { ...
|
|
1741
|
-
colors: { ...
|
|
1742
|
-
typography: e.typography ? { ...
|
|
1743
|
-
spacing: e.spacing ? { ...
|
|
1738
|
+
name: e.name || Z.name,
|
|
1739
|
+
title: e.title || Z.title,
|
|
1740
|
+
logo: { ...Z.logo, ...e.logo },
|
|
1741
|
+
colors: { ...Z.colors, ...e.colors },
|
|
1742
|
+
typography: e.typography ? { ...Z.typography, ...e.typography } : Z.typography,
|
|
1743
|
+
spacing: e.spacing ? { ...Z.spacing, ...e.spacing } : Z.spacing,
|
|
1744
1744
|
customCSS: e.customCSS,
|
|
1745
1745
|
darkMode: e.darkMode ? {
|
|
1746
1746
|
colors: {
|
|
1747
|
-
...(r =
|
|
1747
|
+
...(r = Z.darkMode) == null ? void 0 : r.colors,
|
|
1748
1748
|
...e.darkMode.colors
|
|
1749
1749
|
}
|
|
1750
|
-
} :
|
|
1750
|
+
} : Z.darkMode
|
|
1751
1751
|
};
|
|
1752
1752
|
}
|
|
1753
1753
|
/**
|
|
@@ -1760,7 +1760,7 @@ class Ut {
|
|
|
1760
1760
|
* Reset to default theme
|
|
1761
1761
|
*/
|
|
1762
1762
|
resetTheme() {
|
|
1763
|
-
this.applyTheme(
|
|
1763
|
+
this.applyTheme(Z);
|
|
1764
1764
|
}
|
|
1765
1765
|
/**
|
|
1766
1766
|
* Remove all custom styles
|
|
@@ -1776,59 +1776,61 @@ class Ut {
|
|
|
1776
1776
|
}
|
|
1777
1777
|
}
|
|
1778
1778
|
const Ue = tt(null), Or = ({ config: t, children: e }) => {
|
|
1779
|
-
const [r, s] =
|
|
1780
|
-
const
|
|
1779
|
+
const [r, s] = N(null), a = ie.useRef(!1), i = ie.useRef(!1), l = Re(() => {
|
|
1780
|
+
const d = new vt(t), u = new xt(d), y = new wt(d), x = new kt(d), g = new Nt(d), b = new St(d), m = new Ct(d), f = new At(d), k = new Et(d), h = new It(d), A = new Mt(d), v = new Ut();
|
|
1781
1781
|
return {
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
uploadDocumentService: u,
|
|
1782
|
+
httpClient: d,
|
|
1783
|
+
applicantService: u,
|
|
1784
|
+
questionnaireService: y,
|
|
1785
|
+
uploadDocumentService: x,
|
|
1787
1786
|
appropriatenessTestService: g,
|
|
1788
|
-
overviewService:
|
|
1787
|
+
overviewService: b,
|
|
1789
1788
|
riskScoringService: m,
|
|
1790
|
-
identityService:
|
|
1791
|
-
baseInformationService:
|
|
1792
|
-
investorCategorizationService:
|
|
1793
|
-
themeService:
|
|
1794
|
-
themeManager:
|
|
1795
|
-
currentTheme: r,
|
|
1796
|
-
createOrchestrator: () => new $t(
|
|
1797
|
-
l,
|
|
1798
|
-
d,
|
|
1799
|
-
u,
|
|
1800
|
-
g,
|
|
1801
|
-
p,
|
|
1802
|
-
m,
|
|
1803
|
-
v,
|
|
1804
|
-
y
|
|
1805
|
-
)
|
|
1789
|
+
identityService: f,
|
|
1790
|
+
baseInformationService: k,
|
|
1791
|
+
investorCategorizationService: h,
|
|
1792
|
+
themeService: A,
|
|
1793
|
+
themeManager: v
|
|
1806
1794
|
};
|
|
1807
|
-
}, [t,
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1795
|
+
}, [t]), c = Re(() => ({
|
|
1796
|
+
config: t,
|
|
1797
|
+
...l,
|
|
1798
|
+
currentTheme: r,
|
|
1799
|
+
createOrchestrator: () => new $t(
|
|
1800
|
+
l.applicantService,
|
|
1801
|
+
l.questionnaireService,
|
|
1802
|
+
l.uploadDocumentService,
|
|
1803
|
+
l.appropriatenessTestService,
|
|
1804
|
+
l.overviewService,
|
|
1805
|
+
l.riskScoringService,
|
|
1806
|
+
l.identityService,
|
|
1807
|
+
l.investorCategorizationService
|
|
1808
|
+
)
|
|
1809
|
+
}), [t, l, r]);
|
|
1810
|
+
return Y(() => ((async () => {
|
|
1811
|
+
if (a.current || i.current) {
|
|
1812
|
+
console.log("[MetaKYC] Theme already loading or loaded, skipping...");
|
|
1811
1813
|
return;
|
|
1812
1814
|
}
|
|
1813
1815
|
a.current = !0;
|
|
1814
1816
|
try {
|
|
1815
1817
|
if (t.theme) {
|
|
1816
|
-
console.log("[MetaKYC] Applying static theme from config"),
|
|
1818
|
+
console.log("[MetaKYC] Applying static theme from config"), l.themeManager.applyTheme(t.theme), s(l.themeManager.getCurrentTheme()), i.current = !0;
|
|
1817
1819
|
return;
|
|
1818
1820
|
}
|
|
1819
1821
|
console.log("[MetaKYC] Fetching theme from backend...");
|
|
1820
|
-
const
|
|
1821
|
-
|
|
1822
|
-
} catch (
|
|
1823
|
-
console.warn("[MetaKYC] Failed to load theme, using default:",
|
|
1822
|
+
const u = await l.themeService.getThemeConfiguration();
|
|
1823
|
+
l.themeManager.applyTheme(u), s(l.themeManager.getCurrentTheme()), i.current = !0, console.log("[MetaKYC] Theme loaded and applied", u);
|
|
1824
|
+
} catch (u) {
|
|
1825
|
+
console.warn("[MetaKYC] Failed to load theme, using default:", u), s(l.themeManager.getCurrentTheme()), i.current = !0;
|
|
1824
1826
|
} finally {
|
|
1825
1827
|
a.current = !1;
|
|
1826
1828
|
}
|
|
1827
1829
|
})(), () => {
|
|
1828
|
-
|
|
1829
|
-
}), [
|
|
1830
|
+
l.themeManager.cleanup();
|
|
1831
|
+
}), []), /* @__PURE__ */ n(Ue.Provider, { value: c, children: e });
|
|
1830
1832
|
};
|
|
1831
|
-
function
|
|
1833
|
+
function se() {
|
|
1832
1834
|
const t = rt(Ue);
|
|
1833
1835
|
if (!t)
|
|
1834
1836
|
throw new Error("useMetaKYC must be used within a MetaKYCProvider");
|
|
@@ -1855,7 +1857,7 @@ function $r(t, e) {
|
|
|
1855
1857
|
return t.type === s;
|
|
1856
1858
|
});
|
|
1857
1859
|
}
|
|
1858
|
-
function
|
|
1860
|
+
function Ie(t) {
|
|
1859
1861
|
if (t === 0) return "0 Bytes";
|
|
1860
1862
|
const e = 1024, r = ["Bytes", "KB", "MB", "GB"], s = Math.floor(Math.log(t) / Math.log(e));
|
|
1861
1863
|
return Math.round(t / Math.pow(e, s) * 100) / 100 + " " + r[s];
|
|
@@ -1863,23 +1865,23 @@ function Ee(t) {
|
|
|
1863
1865
|
function jr(t) {
|
|
1864
1866
|
return t;
|
|
1865
1867
|
}
|
|
1866
|
-
function
|
|
1868
|
+
function te(...t) {
|
|
1867
1869
|
return t.filter(Boolean).join(" ");
|
|
1868
1870
|
}
|
|
1869
|
-
const
|
|
1871
|
+
const be = {
|
|
1870
1872
|
APPLICANT_ID: "metakyc_applicant_id",
|
|
1871
1873
|
WORKFLOW_STATE: "metakyc_workflow_state"
|
|
1872
1874
|
};
|
|
1873
1875
|
function Ht(t) {
|
|
1874
1876
|
try {
|
|
1875
|
-
localStorage.setItem(
|
|
1877
|
+
localStorage.setItem(be.APPLICANT_ID, t.toString());
|
|
1876
1878
|
} catch (e) {
|
|
1877
1879
|
console.warn("Failed to save applicant ID to storage:", e);
|
|
1878
1880
|
}
|
|
1879
1881
|
}
|
|
1880
1882
|
function Vt() {
|
|
1881
1883
|
try {
|
|
1882
|
-
const t = localStorage.getItem(
|
|
1884
|
+
const t = localStorage.getItem(be.APPLICANT_ID);
|
|
1883
1885
|
return t ? parseInt(t, 10) : null;
|
|
1884
1886
|
} catch (t) {
|
|
1885
1887
|
return console.warn("Failed to retrieve applicant ID from storage:", t), null;
|
|
@@ -1887,21 +1889,21 @@ function Vt() {
|
|
|
1887
1889
|
}
|
|
1888
1890
|
function Yt() {
|
|
1889
1891
|
try {
|
|
1890
|
-
localStorage.removeItem(
|
|
1892
|
+
localStorage.removeItem(be.APPLICANT_ID);
|
|
1891
1893
|
} catch (t) {
|
|
1892
1894
|
console.warn("Failed to clear applicant ID from storage:", t);
|
|
1893
1895
|
}
|
|
1894
1896
|
}
|
|
1895
1897
|
function Wt(t) {
|
|
1896
1898
|
try {
|
|
1897
|
-
localStorage.setItem(
|
|
1899
|
+
localStorage.setItem(be.WORKFLOW_STATE, JSON.stringify(t));
|
|
1898
1900
|
} catch (e) {
|
|
1899
1901
|
console.warn("Failed to save workflow state to storage:", e);
|
|
1900
1902
|
}
|
|
1901
1903
|
}
|
|
1902
1904
|
function _r() {
|
|
1903
1905
|
try {
|
|
1904
|
-
const t = localStorage.getItem(
|
|
1906
|
+
const t = localStorage.getItem(be.WORKFLOW_STATE);
|
|
1905
1907
|
return t ? JSON.parse(t) : null;
|
|
1906
1908
|
} catch (t) {
|
|
1907
1909
|
return console.warn("Failed to retrieve workflow state from storage:", t), null;
|
|
@@ -1909,7 +1911,7 @@ function _r() {
|
|
|
1909
1911
|
}
|
|
1910
1912
|
function Qt() {
|
|
1911
1913
|
try {
|
|
1912
|
-
localStorage.removeItem(
|
|
1914
|
+
localStorage.removeItem(be.WORKFLOW_STATE);
|
|
1913
1915
|
} catch (t) {
|
|
1914
1916
|
console.warn("Failed to clear workflow state from storage:", t);
|
|
1915
1917
|
}
|
|
@@ -1918,141 +1920,145 @@ function Kr() {
|
|
|
1918
1920
|
Yt(), Qt();
|
|
1919
1921
|
}
|
|
1920
1922
|
function Gt(t) {
|
|
1921
|
-
const { createOrchestrator: e } =
|
|
1922
|
-
|
|
1923
|
+
const { createOrchestrator: e } = se(), [r, s] = N(null), [a, i] = N(!1), [l, c] = N(null), d = H(null), u = t || Vt();
|
|
1924
|
+
Y(() => {
|
|
1923
1925
|
d.current || (d.current = e());
|
|
1924
|
-
}, [e]),
|
|
1925
|
-
var
|
|
1926
|
+
}, [e]), Y(() => {
|
|
1927
|
+
var v;
|
|
1926
1928
|
r && u && (Ht(u), Wt({
|
|
1927
1929
|
applicantId: u,
|
|
1928
|
-
currentStepOrder: (
|
|
1930
|
+
currentStepOrder: (v = r.currentStep) == null ? void 0 : v.order,
|
|
1929
1931
|
status: r.status,
|
|
1930
1932
|
lastUpdated: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1931
1933
|
workflowKey: r.workFlowKey,
|
|
1932
1934
|
nextWorkflowKey: r.nextWorkflowKey
|
|
1933
1935
|
}));
|
|
1934
1936
|
}, [r, u]);
|
|
1935
|
-
const
|
|
1937
|
+
const y = H(!1), x = H(!1), g = q(async () => {
|
|
1936
1938
|
if (!(!u || !d.current)) {
|
|
1937
|
-
if (
|
|
1939
|
+
if (y.current) {
|
|
1938
1940
|
console.log("[Workflow] Load already in progress, skipping...");
|
|
1939
1941
|
return;
|
|
1940
1942
|
}
|
|
1941
|
-
|
|
1943
|
+
y.current = !0, i(!0), c(null);
|
|
1942
1944
|
try {
|
|
1943
|
-
const
|
|
1944
|
-
s(
|
|
1945
|
-
} catch (
|
|
1946
|
-
|
|
1945
|
+
const v = await d.current.initialize(u);
|
|
1946
|
+
s(v), x.current = !0;
|
|
1947
|
+
} catch (v) {
|
|
1948
|
+
c(v);
|
|
1947
1949
|
} finally {
|
|
1948
|
-
i(!1),
|
|
1950
|
+
i(!1), y.current = !1;
|
|
1949
1951
|
}
|
|
1950
1952
|
}
|
|
1951
1953
|
}, [u]);
|
|
1952
|
-
|
|
1953
|
-
u && !
|
|
1954
|
-
}, [u,
|
|
1955
|
-
const
|
|
1954
|
+
Y(() => {
|
|
1955
|
+
u && !x.current && g();
|
|
1956
|
+
}, [u, g]);
|
|
1957
|
+
const b = q(async () => {
|
|
1956
1958
|
if (d.current) {
|
|
1957
|
-
if (
|
|
1959
|
+
if (y.current) {
|
|
1958
1960
|
console.log("[Workflow] Refresh already in progress, skipping...");
|
|
1959
1961
|
return;
|
|
1960
1962
|
}
|
|
1961
|
-
|
|
1963
|
+
y.current = !0, i(!0), c(null);
|
|
1962
1964
|
try {
|
|
1963
|
-
const
|
|
1964
|
-
s(
|
|
1965
|
-
} catch (
|
|
1966
|
-
|
|
1965
|
+
const v = await d.current.refreshProgress();
|
|
1966
|
+
s(v);
|
|
1967
|
+
} catch (v) {
|
|
1968
|
+
c(v);
|
|
1967
1969
|
} finally {
|
|
1968
|
-
i(!1),
|
|
1970
|
+
i(!1), y.current = !1;
|
|
1969
1971
|
}
|
|
1970
1972
|
}
|
|
1971
|
-
}, []),
|
|
1973
|
+
}, []), m = q(async () => {
|
|
1972
1974
|
if (d.current) {
|
|
1973
|
-
i(!0),
|
|
1975
|
+
i(!0), c(null);
|
|
1974
1976
|
try {
|
|
1975
|
-
const
|
|
1976
|
-
s(
|
|
1977
|
-
} catch (
|
|
1978
|
-
|
|
1977
|
+
const v = await d.current.moveToNextStep();
|
|
1978
|
+
s(v);
|
|
1979
|
+
} catch (v) {
|
|
1980
|
+
c(v);
|
|
1979
1981
|
} finally {
|
|
1980
1982
|
i(!1);
|
|
1981
1983
|
}
|
|
1982
1984
|
}
|
|
1983
|
-
}, []),
|
|
1985
|
+
}, []), f = q(async () => {
|
|
1984
1986
|
if (d.current) {
|
|
1985
|
-
i(!0),
|
|
1987
|
+
i(!0), c(null);
|
|
1986
1988
|
try {
|
|
1987
|
-
const
|
|
1988
|
-
s(
|
|
1989
|
-
} catch (
|
|
1990
|
-
|
|
1989
|
+
const v = await d.current.moveToPreviousStep();
|
|
1990
|
+
s(v);
|
|
1991
|
+
} catch (v) {
|
|
1992
|
+
c(v);
|
|
1991
1993
|
} finally {
|
|
1992
1994
|
i(!1);
|
|
1993
1995
|
}
|
|
1994
1996
|
}
|
|
1995
|
-
}, []),
|
|
1997
|
+
}, []), k = q(async (v) => {
|
|
1996
1998
|
if (d.current) {
|
|
1997
|
-
i(!0),
|
|
1999
|
+
i(!0), c(null);
|
|
1998
2000
|
try {
|
|
1999
|
-
await d.current.submitCurrentStep(
|
|
2000
|
-
const
|
|
2001
|
-
s(
|
|
2002
|
-
} catch (
|
|
2003
|
-
throw
|
|
2001
|
+
await d.current.submitCurrentStep(v);
|
|
2002
|
+
const S = await d.current.refreshProgress();
|
|
2003
|
+
s(S);
|
|
2004
|
+
} catch (S) {
|
|
2005
|
+
throw c(S), S;
|
|
2004
2006
|
} finally {
|
|
2005
2007
|
i(!1);
|
|
2006
2008
|
}
|
|
2007
2009
|
}
|
|
2008
|
-
}, []),
|
|
2010
|
+
}, []), h = Me.useMemo(() => r != null && r.stepInfoList ? [...r.stepInfoList].sort((v, S) => v.order - S.order) : [], [r == null ? void 0 : r.stepInfoList]), A = Me.useMemo(() => r ? r.nextWorkflowKey && r.nextWorkflowKey !== r.workFlowKey : !1, [r]);
|
|
2009
2011
|
return {
|
|
2010
2012
|
progress: r,
|
|
2011
2013
|
applicantId: u,
|
|
2012
2014
|
currentStep: (r == null ? void 0 : r.currentStep) || null,
|
|
2013
|
-
steps:
|
|
2014
|
-
status: (r == null ? void 0 : r.status) ||
|
|
2015
|
+
steps: h,
|
|
2016
|
+
status: (r == null ? void 0 : r.status) || le.None,
|
|
2015
2017
|
workflowResult: (r == null ? void 0 : r.workflowResult) || null,
|
|
2016
2018
|
workflowKey: r == null ? void 0 : r.workFlowKey,
|
|
2017
2019
|
nextWorkflowKey: r == null ? void 0 : r.nextWorkflowKey,
|
|
2018
|
-
hasWorkflowChanged:
|
|
2020
|
+
hasWorkflowChanged: A,
|
|
2019
2021
|
isLoading: a,
|
|
2020
|
-
error:
|
|
2021
|
-
isComplete: (r == null ? void 0 : r.status) ===
|
|
2022
|
-
isOnHold: (r == null ? void 0 : r.status) ===
|
|
2023
|
-
refreshProgress:
|
|
2024
|
-
moveToNext:
|
|
2025
|
-
moveBack:
|
|
2026
|
-
submitCurrentStep:
|
|
2022
|
+
error: l,
|
|
2023
|
+
isComplete: (r == null ? void 0 : r.status) === le.Finished,
|
|
2024
|
+
isOnHold: (r == null ? void 0 : r.status) === le.OnHold,
|
|
2025
|
+
refreshProgress: b,
|
|
2026
|
+
moveToNext: m,
|
|
2027
|
+
moveBack: f,
|
|
2028
|
+
submitCurrentStep: k,
|
|
2027
2029
|
orchestrator: d.current
|
|
2028
2030
|
};
|
|
2029
2031
|
}
|
|
2030
2032
|
function Zt(t) {
|
|
2031
|
-
const { questionnaireService: e } =
|
|
2033
|
+
const { questionnaireService: e } = se(), [r, s] = N(null), [a, i] = N(!1), [l, c] = N(!1), [d, u] = N(null), y = H(!1), x = H(null), g = q(async () => {
|
|
2032
2034
|
if (t) {
|
|
2033
|
-
|
|
2035
|
+
if (y.current) {
|
|
2036
|
+
console.log("[Questionnaire] Load already in progress, skipping...");
|
|
2037
|
+
return;
|
|
2038
|
+
}
|
|
2039
|
+
y.current = !0, i(!0), u(null);
|
|
2034
2040
|
try {
|
|
2035
2041
|
const m = await e.getQuestionnaire(t);
|
|
2036
|
-
s(m);
|
|
2042
|
+
s(m), x.current = t;
|
|
2037
2043
|
} catch (m) {
|
|
2038
2044
|
u(m);
|
|
2039
2045
|
} finally {
|
|
2040
|
-
i(!1);
|
|
2046
|
+
i(!1), y.current = !1;
|
|
2041
2047
|
}
|
|
2042
2048
|
}
|
|
2043
2049
|
}, [t, e]);
|
|
2044
|
-
|
|
2045
|
-
t && g();
|
|
2046
|
-
}, [t
|
|
2047
|
-
const
|
|
2050
|
+
Y(() => {
|
|
2051
|
+
t && x.current !== t && g();
|
|
2052
|
+
}, [t]);
|
|
2053
|
+
const b = q(
|
|
2048
2054
|
async (m) => {
|
|
2049
|
-
|
|
2055
|
+
c(!0), u(null);
|
|
2050
2056
|
try {
|
|
2051
2057
|
return await e.fillQuestionnaire(m);
|
|
2052
|
-
} catch (
|
|
2053
|
-
throw u(
|
|
2058
|
+
} catch (f) {
|
|
2059
|
+
throw u(f), f;
|
|
2054
2060
|
} finally {
|
|
2055
|
-
|
|
2061
|
+
c(!1);
|
|
2056
2062
|
}
|
|
2057
2063
|
},
|
|
2058
2064
|
[e]
|
|
@@ -2060,38 +2066,42 @@ function Zt(t) {
|
|
|
2060
2066
|
return {
|
|
2061
2067
|
questionnaire: r,
|
|
2062
2068
|
isLoading: a,
|
|
2063
|
-
isSubmitting:
|
|
2069
|
+
isSubmitting: l,
|
|
2064
2070
|
error: d,
|
|
2065
2071
|
load: g,
|
|
2066
|
-
submit:
|
|
2072
|
+
submit: b
|
|
2067
2073
|
};
|
|
2068
2074
|
}
|
|
2069
2075
|
function Jt(t) {
|
|
2070
|
-
const { uploadDocumentService: e } =
|
|
2076
|
+
const { uploadDocumentService: e } = se(), [r, s] = N(null), [a, i] = N(!1), [l, c] = N(!1), [d, u] = N(0), [y, x] = N(null), g = H(!1), b = H(null), m = q(async () => {
|
|
2071
2077
|
if (t) {
|
|
2072
|
-
|
|
2078
|
+
if (g.current) {
|
|
2079
|
+
console.log("[UploadDocument] Load already in progress, skipping...");
|
|
2080
|
+
return;
|
|
2081
|
+
}
|
|
2082
|
+
g.current = !0, i(!0), x(null);
|
|
2073
2083
|
try {
|
|
2074
|
-
const
|
|
2075
|
-
s(b
|
|
2076
|
-
} catch (
|
|
2077
|
-
|
|
2084
|
+
const k = await e.getUploadDocument(t);
|
|
2085
|
+
s(k), b.current = t;
|
|
2086
|
+
} catch (k) {
|
|
2087
|
+
x(k);
|
|
2078
2088
|
} finally {
|
|
2079
|
-
i(!1);
|
|
2089
|
+
i(!1), g.current = !1;
|
|
2080
2090
|
}
|
|
2081
2091
|
}
|
|
2082
2092
|
}, [t, e]);
|
|
2083
|
-
|
|
2084
|
-
t && m();
|
|
2085
|
-
}, [t
|
|
2086
|
-
const
|
|
2087
|
-
async (
|
|
2088
|
-
|
|
2093
|
+
Y(() => {
|
|
2094
|
+
t && b.current !== t && m();
|
|
2095
|
+
}, [t]);
|
|
2096
|
+
const f = q(
|
|
2097
|
+
async (k) => {
|
|
2098
|
+
c(!0), u(0), x(null);
|
|
2089
2099
|
try {
|
|
2090
|
-
await e.fillUploadDocument(
|
|
2091
|
-
} catch (
|
|
2092
|
-
throw
|
|
2100
|
+
await e.fillUploadDocument(k), u(100);
|
|
2101
|
+
} catch (h) {
|
|
2102
|
+
throw x(h), h;
|
|
2093
2103
|
} finally {
|
|
2094
|
-
|
|
2104
|
+
c(!1);
|
|
2095
2105
|
}
|
|
2096
2106
|
},
|
|
2097
2107
|
[e]
|
|
@@ -2099,162 +2109,170 @@ function Jt(t) {
|
|
|
2099
2109
|
return {
|
|
2100
2110
|
uploadDocument: r,
|
|
2101
2111
|
isLoading: a,
|
|
2102
|
-
isSubmitting:
|
|
2112
|
+
isSubmitting: l,
|
|
2103
2113
|
uploadProgress: d,
|
|
2104
|
-
error:
|
|
2114
|
+
error: y,
|
|
2105
2115
|
load: m,
|
|
2106
|
-
submit:
|
|
2116
|
+
submit: f
|
|
2107
2117
|
};
|
|
2108
2118
|
}
|
|
2109
2119
|
function Ur(t) {
|
|
2110
|
-
const { appropriatenessTestService: e } =
|
|
2120
|
+
const { appropriatenessTestService: e } = se(), [r, s] = N(null), [a, i] = N(!1), [l, c] = N(!1), [d, u] = N(null), [y, x] = N(null), g = H(!1), b = H(null), m = q(async () => {
|
|
2111
2121
|
if (t) {
|
|
2112
|
-
|
|
2122
|
+
if (g.current) {
|
|
2123
|
+
console.log("[AppropriatenessTest] Load already in progress, skipping...");
|
|
2124
|
+
return;
|
|
2125
|
+
}
|
|
2126
|
+
g.current = !0, i(!0), u(null);
|
|
2113
2127
|
try {
|
|
2114
|
-
const
|
|
2115
|
-
s(b
|
|
2116
|
-
} catch (
|
|
2117
|
-
u(
|
|
2128
|
+
const k = await e.getAppropriatenessTest(t);
|
|
2129
|
+
s(k), b.current = t;
|
|
2130
|
+
} catch (k) {
|
|
2131
|
+
u(k);
|
|
2118
2132
|
} finally {
|
|
2119
|
-
i(!1);
|
|
2133
|
+
i(!1), g.current = !1;
|
|
2120
2134
|
}
|
|
2121
2135
|
}
|
|
2122
2136
|
}, [t, e]);
|
|
2123
|
-
|
|
2124
|
-
t && m();
|
|
2125
|
-
}, [t
|
|
2126
|
-
const
|
|
2127
|
-
async (
|
|
2128
|
-
|
|
2137
|
+
Y(() => {
|
|
2138
|
+
t && b.current !== t && m();
|
|
2139
|
+
}, [t]);
|
|
2140
|
+
const f = q(
|
|
2141
|
+
async (k) => {
|
|
2142
|
+
c(!0), u(null);
|
|
2129
2143
|
try {
|
|
2130
|
-
const
|
|
2131
|
-
return
|
|
2132
|
-
} catch (
|
|
2133
|
-
throw u(
|
|
2144
|
+
const h = await e.fillAppropriatenessTest(k);
|
|
2145
|
+
return x(h), h;
|
|
2146
|
+
} catch (h) {
|
|
2147
|
+
throw u(h), h;
|
|
2134
2148
|
} finally {
|
|
2135
|
-
|
|
2149
|
+
c(!1);
|
|
2136
2150
|
}
|
|
2137
2151
|
},
|
|
2138
2152
|
[e]
|
|
2139
2153
|
);
|
|
2140
2154
|
return {
|
|
2141
2155
|
test: r,
|
|
2142
|
-
result:
|
|
2156
|
+
result: y,
|
|
2143
2157
|
isLoading: a,
|
|
2144
|
-
isSubmitting:
|
|
2158
|
+
isSubmitting: l,
|
|
2145
2159
|
error: d,
|
|
2146
2160
|
load: m,
|
|
2147
|
-
submit:
|
|
2161
|
+
submit: f
|
|
2148
2162
|
};
|
|
2149
2163
|
}
|
|
2150
2164
|
function Xt(t) {
|
|
2151
|
-
const { overviewService: e } =
|
|
2165
|
+
const { overviewService: e } = se(), [r, s] = N(null), [a, i] = N(!1), [l, c] = N(!1), [d, u] = N(null), y = H(!1), x = H(null), g = q(async () => {
|
|
2152
2166
|
if (t) {
|
|
2153
|
-
|
|
2167
|
+
if (y.current) {
|
|
2168
|
+
console.log("[Overview] Load already in progress, skipping...");
|
|
2169
|
+
return;
|
|
2170
|
+
}
|
|
2171
|
+
y.current = !0, i(!0), u(null);
|
|
2154
2172
|
try {
|
|
2155
2173
|
const m = await e.getOverviewData(t);
|
|
2156
|
-
s(m);
|
|
2174
|
+
s(m), x.current = t;
|
|
2157
2175
|
} catch (m) {
|
|
2158
2176
|
u(m);
|
|
2159
2177
|
} finally {
|
|
2160
|
-
i(!1);
|
|
2178
|
+
i(!1), y.current = !1;
|
|
2161
2179
|
}
|
|
2162
2180
|
}
|
|
2163
2181
|
}, [t, e]);
|
|
2164
|
-
|
|
2165
|
-
t && g();
|
|
2166
|
-
}, [t
|
|
2167
|
-
const
|
|
2182
|
+
Y(() => {
|
|
2183
|
+
t && x.current !== t && g();
|
|
2184
|
+
}, [t]);
|
|
2185
|
+
const b = q(async () => {
|
|
2168
2186
|
if (t) {
|
|
2169
|
-
|
|
2187
|
+
c(!0), u(null);
|
|
2170
2188
|
try {
|
|
2171
2189
|
await e.passOverview(t);
|
|
2172
2190
|
} catch (m) {
|
|
2173
2191
|
throw u(m), m;
|
|
2174
2192
|
} finally {
|
|
2175
|
-
|
|
2193
|
+
c(!1);
|
|
2176
2194
|
}
|
|
2177
2195
|
}
|
|
2178
2196
|
}, [t, e]);
|
|
2179
2197
|
return {
|
|
2180
2198
|
overview: r,
|
|
2181
2199
|
isLoading: a,
|
|
2182
|
-
isSubmitting:
|
|
2200
|
+
isSubmitting: l,
|
|
2183
2201
|
error: d,
|
|
2184
2202
|
load: g,
|
|
2185
|
-
passOverview:
|
|
2203
|
+
passOverview: b
|
|
2186
2204
|
};
|
|
2187
2205
|
}
|
|
2188
2206
|
function er(t) {
|
|
2189
|
-
const { identityService: e } =
|
|
2207
|
+
const { identityService: e } = se(), [r, s] = N(
|
|
2190
2208
|
null
|
|
2191
|
-
), [a, i] =
|
|
2192
|
-
async (
|
|
2209
|
+
), [a, i] = N(!1), [l, c] = N(null), d = H(!1), u = q(
|
|
2210
|
+
async (g, b) => {
|
|
2193
2211
|
if (t) {
|
|
2194
2212
|
if (d.current) {
|
|
2195
2213
|
console.log("[Identity] Request already in progress, skipping...");
|
|
2196
2214
|
return;
|
|
2197
2215
|
}
|
|
2198
|
-
d.current = !0, i(!0),
|
|
2216
|
+
d.current = !0, i(!0), c(null);
|
|
2199
2217
|
try {
|
|
2200
|
-
const
|
|
2218
|
+
const m = {
|
|
2201
2219
|
applicantId: t,
|
|
2202
2220
|
restart: !1,
|
|
2203
|
-
redirectUrl:
|
|
2204
|
-
ttl:
|
|
2221
|
+
redirectUrl: g || "",
|
|
2222
|
+
ttl: b || 604800
|
|
2205
2223
|
// Default: 7 days
|
|
2206
2224
|
};
|
|
2207
|
-
console.log("Identity request input:",
|
|
2208
|
-
const
|
|
2209
|
-
return console.log("Identity request result:",
|
|
2210
|
-
} catch (
|
|
2211
|
-
throw
|
|
2225
|
+
console.log("Identity request input:", m);
|
|
2226
|
+
const f = await e.identityRequest(m);
|
|
2227
|
+
return console.log("Identity request result:", f), s(f), f;
|
|
2228
|
+
} catch (m) {
|
|
2229
|
+
throw c(m), m;
|
|
2212
2230
|
} finally {
|
|
2213
2231
|
i(!1), d.current = !1;
|
|
2214
2232
|
}
|
|
2215
2233
|
}
|
|
2216
2234
|
},
|
|
2217
2235
|
[t, e]
|
|
2218
|
-
),
|
|
2219
|
-
async (
|
|
2236
|
+
), y = q(
|
|
2237
|
+
async (g, b) => {
|
|
2220
2238
|
if (t) {
|
|
2221
|
-
i(!0),
|
|
2239
|
+
i(!0), c(null);
|
|
2222
2240
|
try {
|
|
2223
|
-
const
|
|
2241
|
+
const m = {
|
|
2224
2242
|
applicantId: t,
|
|
2225
2243
|
restart: !1,
|
|
2226
|
-
redirectUrl:
|
|
2227
|
-
ttl:
|
|
2228
|
-
},
|
|
2229
|
-
return s(
|
|
2230
|
-
} catch (
|
|
2231
|
-
throw
|
|
2244
|
+
redirectUrl: g,
|
|
2245
|
+
ttl: b
|
|
2246
|
+
}, f = await e.identityCompanyRequest(m);
|
|
2247
|
+
return s(f), f;
|
|
2248
|
+
} catch (m) {
|
|
2249
|
+
throw c(m), m;
|
|
2232
2250
|
} finally {
|
|
2233
2251
|
i(!1);
|
|
2234
2252
|
}
|
|
2235
2253
|
}
|
|
2236
2254
|
},
|
|
2237
2255
|
[t, e]
|
|
2238
|
-
),
|
|
2256
|
+
), x = q(async () => {
|
|
2239
2257
|
if (t) {
|
|
2240
2258
|
if (d.current) {
|
|
2241
2259
|
console.log("[Identity] Restart already in progress, skipping...");
|
|
2242
2260
|
return;
|
|
2243
2261
|
}
|
|
2244
|
-
d.current = !0, i(!0),
|
|
2262
|
+
d.current = !0, i(!0), c(null);
|
|
2245
2263
|
try {
|
|
2246
|
-
const
|
|
2264
|
+
const g = {
|
|
2247
2265
|
applicantId: t,
|
|
2248
2266
|
restart: !0,
|
|
2249
2267
|
redirectUrl: "",
|
|
2250
2268
|
ttl: 604800
|
|
2251
2269
|
// 7 days
|
|
2252
2270
|
};
|
|
2253
|
-
console.log("Restarting identity with input:",
|
|
2254
|
-
const
|
|
2255
|
-
return console.log("Restart identity result:",
|
|
2256
|
-
} catch (
|
|
2257
|
-
throw
|
|
2271
|
+
console.log("Restarting identity with input:", g);
|
|
2272
|
+
const b = await e.identityRequest(g);
|
|
2273
|
+
return console.log("Restart identity result:", b), s(b), b;
|
|
2274
|
+
} catch (g) {
|
|
2275
|
+
throw c(g), g;
|
|
2258
2276
|
} finally {
|
|
2259
2277
|
i(!1), d.current = !1;
|
|
2260
2278
|
}
|
|
@@ -2265,82 +2283,88 @@ function er(t) {
|
|
|
2265
2283
|
provider: (r == null ? void 0 : r.provider) || null,
|
|
2266
2284
|
token: (r == null ? void 0 : r.publicProviderTokenObject) || null,
|
|
2267
2285
|
isLoading: a,
|
|
2268
|
-
error:
|
|
2286
|
+
error: l,
|
|
2269
2287
|
requestIdentity: u,
|
|
2270
|
-
requestCompanyIdentity:
|
|
2271
|
-
restartIdentity:
|
|
2288
|
+
requestCompanyIdentity: y,
|
|
2289
|
+
restartIdentity: x
|
|
2272
2290
|
};
|
|
2273
2291
|
}
|
|
2274
2292
|
function tr(t) {
|
|
2275
|
-
const { riskScoringService: e } =
|
|
2293
|
+
const { riskScoringService: e } = se(), [r, s] = N(null), [a, i] = N(!1), [l, c] = N(!1), [d, u] = N(null), [y, x] = N(null), g = H(!1), b = H(null), m = q(async () => {
|
|
2276
2294
|
if (t) {
|
|
2277
|
-
|
|
2295
|
+
if (g.current) {
|
|
2296
|
+
console.log("[RiskScoring] Load already in progress, skipping...");
|
|
2297
|
+
return;
|
|
2298
|
+
}
|
|
2299
|
+
g.current = !0, i(!0), u(null);
|
|
2278
2300
|
try {
|
|
2279
|
-
const
|
|
2280
|
-
s(b
|
|
2281
|
-
} catch (
|
|
2282
|
-
u(
|
|
2301
|
+
const k = await e.getRiskCriterias(t);
|
|
2302
|
+
s(k), b.current = t;
|
|
2303
|
+
} catch (k) {
|
|
2304
|
+
u(k);
|
|
2283
2305
|
} finally {
|
|
2284
|
-
i(!1);
|
|
2306
|
+
i(!1), g.current = !1;
|
|
2285
2307
|
}
|
|
2286
2308
|
}
|
|
2287
2309
|
}, [t, e]);
|
|
2288
|
-
|
|
2289
|
-
t && m();
|
|
2290
|
-
}, [t
|
|
2291
|
-
const
|
|
2292
|
-
async (
|
|
2293
|
-
|
|
2310
|
+
Y(() => {
|
|
2311
|
+
t && b.current !== t && m();
|
|
2312
|
+
}, [t]);
|
|
2313
|
+
const f = q(
|
|
2314
|
+
async (k) => {
|
|
2315
|
+
c(!0), u(null);
|
|
2294
2316
|
try {
|
|
2295
|
-
const
|
|
2296
|
-
return
|
|
2297
|
-
} catch (
|
|
2298
|
-
throw u(
|
|
2317
|
+
const h = await e.submitRiskScoring(k);
|
|
2318
|
+
return x(h), h;
|
|
2319
|
+
} catch (h) {
|
|
2320
|
+
throw u(h), h;
|
|
2299
2321
|
} finally {
|
|
2300
|
-
|
|
2322
|
+
c(!1);
|
|
2301
2323
|
}
|
|
2302
2324
|
},
|
|
2303
2325
|
[e]
|
|
2304
2326
|
);
|
|
2305
2327
|
return {
|
|
2306
2328
|
criteria: r,
|
|
2307
|
-
result:
|
|
2329
|
+
result: y,
|
|
2308
2330
|
isLoading: a,
|
|
2309
|
-
isSubmitting:
|
|
2331
|
+
isSubmitting: l,
|
|
2310
2332
|
error: d,
|
|
2311
2333
|
load: m,
|
|
2312
|
-
submit:
|
|
2334
|
+
submit: f
|
|
2313
2335
|
};
|
|
2314
2336
|
}
|
|
2315
2337
|
function rr() {
|
|
2316
|
-
const { applicantService: t, config: e } =
|
|
2338
|
+
const { applicantService: t, config: e } = se(), [r, s] = N(!1), [a, i] = N(null), l = H(!1), c = H(!1), d = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(b) {
|
|
2317
2339
|
const m = Math.random() * 16 | 0;
|
|
2318
|
-
return (
|
|
2319
|
-
}),
|
|
2320
|
-
async (
|
|
2340
|
+
return (b === "x" ? m : m & 3 | 8).toString(16);
|
|
2341
|
+
}), u = q(
|
|
2342
|
+
async (b) => {
|
|
2321
2343
|
var m;
|
|
2322
|
-
|
|
2344
|
+
if (l.current)
|
|
2345
|
+
throw console.log("[Applicant] Create already in progress, skipping..."), new Error("Creation already in progress");
|
|
2346
|
+
l.current = !0, s(!0), i(null);
|
|
2323
2347
|
try {
|
|
2324
|
-
if (
|
|
2325
|
-
const
|
|
2326
|
-
console.log("[SardinAI] Generated session key:",
|
|
2348
|
+
if (b.applicantAdditionalDatas || (b.applicantAdditionalDatas = []), (m = e.identityProviders) != null && m.sardinai) {
|
|
2349
|
+
const k = d();
|
|
2350
|
+
console.log("[SardinAI] Generated session key:", k), b.applicantAdditionalDatas.push({
|
|
2327
2351
|
paramName: "sessionKey",
|
|
2328
|
-
value:
|
|
2352
|
+
value: k
|
|
2329
2353
|
});
|
|
2330
2354
|
}
|
|
2331
|
-
return await t.createApplicant(
|
|
2332
|
-
} catch (
|
|
2333
|
-
throw i(
|
|
2355
|
+
return await t.createApplicant(b);
|
|
2356
|
+
} catch (f) {
|
|
2357
|
+
throw i(f), f;
|
|
2334
2358
|
} finally {
|
|
2335
|
-
s(!1);
|
|
2359
|
+
s(!1), l.current = !1;
|
|
2336
2360
|
}
|
|
2337
2361
|
},
|
|
2338
2362
|
[t, e]
|
|
2339
|
-
),
|
|
2340
|
-
async (
|
|
2363
|
+
), y = q(
|
|
2364
|
+
async (b) => {
|
|
2341
2365
|
s(!0), i(null);
|
|
2342
2366
|
try {
|
|
2343
|
-
return await t.createCompanyApplicant(
|
|
2367
|
+
return await t.createCompanyApplicant(b);
|
|
2344
2368
|
} catch (m) {
|
|
2345
2369
|
throw i(m), m;
|
|
2346
2370
|
} finally {
|
|
@@ -2348,23 +2372,25 @@ function rr() {
|
|
|
2348
2372
|
}
|
|
2349
2373
|
},
|
|
2350
2374
|
[t]
|
|
2351
|
-
),
|
|
2352
|
-
async (
|
|
2353
|
-
|
|
2375
|
+
), x = q(
|
|
2376
|
+
async (b) => {
|
|
2377
|
+
if (c.current)
|
|
2378
|
+
throw console.log("[Applicant] Data load already in progress, skipping..."), new Error("Data load already in progress");
|
|
2379
|
+
c.current = !0, s(!0), i(null);
|
|
2354
2380
|
try {
|
|
2355
|
-
return await t.getApplicantData(
|
|
2381
|
+
return await t.getApplicantData(b);
|
|
2356
2382
|
} catch (m) {
|
|
2357
2383
|
throw i(m), m;
|
|
2358
2384
|
} finally {
|
|
2359
|
-
s(!1);
|
|
2385
|
+
s(!1), c.current = !1;
|
|
2360
2386
|
}
|
|
2361
2387
|
},
|
|
2362
2388
|
[t]
|
|
2363
2389
|
), g = q(
|
|
2364
|
-
async (
|
|
2390
|
+
async (b) => {
|
|
2365
2391
|
s(!0), i(null);
|
|
2366
2392
|
try {
|
|
2367
|
-
await t.stopProgress(
|
|
2393
|
+
await t.stopProgress(b);
|
|
2368
2394
|
} catch (m) {
|
|
2369
2395
|
throw i(m), m;
|
|
2370
2396
|
} finally {
|
|
@@ -2376,9 +2402,9 @@ function rr() {
|
|
|
2376
2402
|
return {
|
|
2377
2403
|
isLoading: r,
|
|
2378
2404
|
error: a,
|
|
2379
|
-
createApplicant:
|
|
2380
|
-
createCompanyApplicant:
|
|
2381
|
-
getApplicantData:
|
|
2405
|
+
createApplicant: u,
|
|
2406
|
+
createCompanyApplicant: y,
|
|
2407
|
+
getApplicantData: x,
|
|
2382
2408
|
stopProgress: g
|
|
2383
2409
|
};
|
|
2384
2410
|
}
|
|
@@ -2389,9 +2415,9 @@ const j = ({
|
|
|
2389
2415
|
isLoading: s = !1,
|
|
2390
2416
|
disabled: a,
|
|
2391
2417
|
className: i,
|
|
2392
|
-
...
|
|
2418
|
+
...l
|
|
2393
2419
|
}) => {
|
|
2394
|
-
const
|
|
2420
|
+
const c = "inline-flex items-center justify-center rounded-lg font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed", d = {
|
|
2395
2421
|
primary: "bg-primary-500 text-white hover:bg-primary-600 focus:ring-primary-500",
|
|
2396
2422
|
secondary: "bg-gray-200 text-gray-900 hover:bg-gray-300 focus:ring-gray-400",
|
|
2397
2423
|
outline: "border-2 border-primary-500 text-primary-500 hover:bg-primary-50 focus:ring-primary-500",
|
|
@@ -2405,9 +2431,9 @@ const j = ({
|
|
|
2405
2431
|
return /* @__PURE__ */ o(
|
|
2406
2432
|
"button",
|
|
2407
2433
|
{
|
|
2408
|
-
className:
|
|
2434
|
+
className: te(c, d[e], u[r], i),
|
|
2409
2435
|
disabled: a || s,
|
|
2410
|
-
...
|
|
2436
|
+
...l,
|
|
2411
2437
|
children: [
|
|
2412
2438
|
s && /* @__PURE__ */ o(
|
|
2413
2439
|
"svg",
|
|
@@ -2443,19 +2469,19 @@ const j = ({
|
|
|
2443
2469
|
]
|
|
2444
2470
|
}
|
|
2445
2471
|
);
|
|
2446
|
-
},
|
|
2447
|
-
({ label: t, error: e, helperText: r, leftIcon: s, rightIcon: a, className: i, ...
|
|
2472
|
+
}, X = Le(
|
|
2473
|
+
({ label: t, error: e, helperText: r, leftIcon: s, rightIcon: a, className: i, ...l }, c) => /* @__PURE__ */ o("div", { className: "w-full", children: [
|
|
2448
2474
|
t && /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
|
|
2449
2475
|
t,
|
|
2450
|
-
|
|
2476
|
+
l.required && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
|
|
2451
2477
|
] }),
|
|
2452
2478
|
/* @__PURE__ */ o("div", { className: "relative", children: [
|
|
2453
2479
|
s && /* @__PURE__ */ n("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none", children: s }),
|
|
2454
2480
|
/* @__PURE__ */ n(
|
|
2455
2481
|
"input",
|
|
2456
2482
|
{
|
|
2457
|
-
ref:
|
|
2458
|
-
className:
|
|
2483
|
+
ref: c,
|
|
2484
|
+
className: te(
|
|
2459
2485
|
"block w-full rounded-lg border px-3 py-2 text-sm transition-colors",
|
|
2460
2486
|
"focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",
|
|
2461
2487
|
"disabled:bg-gray-100 disabled:cursor-not-allowed",
|
|
@@ -2465,7 +2491,7 @@ const j = ({
|
|
|
2465
2491
|
a ? "pr-10" : "",
|
|
2466
2492
|
i
|
|
2467
2493
|
),
|
|
2468
|
-
...
|
|
2494
|
+
...l
|
|
2469
2495
|
}
|
|
2470
2496
|
),
|
|
2471
2497
|
a && /* @__PURE__ */ n("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none", children: a })
|
|
@@ -2474,11 +2500,11 @@ const j = ({
|
|
|
2474
2500
|
!e && r && /* @__PURE__ */ n("p", { className: "mt-1 text-sm text-gray-500", children: r })
|
|
2475
2501
|
] })
|
|
2476
2502
|
);
|
|
2477
|
-
|
|
2478
|
-
const
|
|
2503
|
+
X.displayName = "Input";
|
|
2504
|
+
const L = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
2479
2505
|
"div",
|
|
2480
2506
|
{
|
|
2481
|
-
className:
|
|
2507
|
+
className: te(
|
|
2482
2508
|
"rounded-xl shadow-sm border",
|
|
2483
2509
|
e
|
|
2484
2510
|
),
|
|
@@ -2489,30 +2515,30 @@ const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
|
2489
2515
|
...r,
|
|
2490
2516
|
children: t
|
|
2491
2517
|
}
|
|
2492
|
-
),
|
|
2518
|
+
), ee = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
2493
2519
|
"div",
|
|
2494
2520
|
{
|
|
2495
|
-
className:
|
|
2521
|
+
className: te("px-6 py-4 border-b", e),
|
|
2496
2522
|
style: {
|
|
2497
2523
|
borderColor: "var(--metakyc-border, #e5e7eb)"
|
|
2498
2524
|
},
|
|
2499
2525
|
...r,
|
|
2500
2526
|
children: t
|
|
2501
2527
|
}
|
|
2502
|
-
),
|
|
2528
|
+
), T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n("div", { className: te("px-6 py-4", e), ...r, children: t }), ne = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
2503
2529
|
"div",
|
|
2504
2530
|
{
|
|
2505
|
-
className:
|
|
2531
|
+
className: te("px-6 py-4 border-t", e),
|
|
2506
2532
|
style: {
|
|
2507
2533
|
borderColor: "var(--metakyc-border, #e5e7eb)"
|
|
2508
2534
|
},
|
|
2509
2535
|
...r,
|
|
2510
2536
|
children: t
|
|
2511
2537
|
}
|
|
2512
|
-
),
|
|
2538
|
+
), he = ({ children: t, variant: e = "default", className: r, ...s }) => /* @__PURE__ */ n(
|
|
2513
2539
|
"span",
|
|
2514
2540
|
{
|
|
2515
|
-
className:
|
|
2541
|
+
className: te(
|
|
2516
2542
|
"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",
|
|
2517
2543
|
{
|
|
2518
2544
|
default: "bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300",
|
|
@@ -2526,16 +2552,16 @@ const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
|
2526
2552
|
...s,
|
|
2527
2553
|
children: t
|
|
2528
2554
|
}
|
|
2529
|
-
),
|
|
2555
|
+
), ce = ({ size: t = "md", className: e, ...r }) => {
|
|
2530
2556
|
const s = {
|
|
2531
2557
|
sm: "h-4 w-4",
|
|
2532
2558
|
md: "h-8 w-8",
|
|
2533
2559
|
lg: "h-12 w-12"
|
|
2534
2560
|
};
|
|
2535
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2561
|
+
return /* @__PURE__ */ n("div", { className: te("flex items-center justify-center", e), ...r, children: /* @__PURE__ */ o(
|
|
2536
2562
|
"svg",
|
|
2537
2563
|
{
|
|
2538
|
-
className:
|
|
2564
|
+
className: te("animate-spin text-primary-500", s[t]),
|
|
2539
2565
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2540
2566
|
fill: "none",
|
|
2541
2567
|
viewBox: "0 0 24 24",
|
|
@@ -2562,17 +2588,17 @@ const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
|
2562
2588
|
]
|
|
2563
2589
|
}
|
|
2564
2590
|
) });
|
|
2565
|
-
},
|
|
2566
|
-
({ label: t, error: e, helperText: r, options: s, placeholder: a, className: i, ...
|
|
2591
|
+
}, ye = Le(
|
|
2592
|
+
({ label: t, error: e, helperText: r, options: s, placeholder: a, className: i, ...l }, c) => /* @__PURE__ */ o("div", { className: "w-full", children: [
|
|
2567
2593
|
t && /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
|
|
2568
2594
|
t,
|
|
2569
|
-
|
|
2595
|
+
l.required && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
|
|
2570
2596
|
] }),
|
|
2571
2597
|
/* @__PURE__ */ o(
|
|
2572
2598
|
"select",
|
|
2573
2599
|
{
|
|
2574
|
-
ref:
|
|
2575
|
-
className:
|
|
2600
|
+
ref: c,
|
|
2601
|
+
className: te(
|
|
2576
2602
|
"block w-full rounded-lg border px-3 py-2 text-sm transition-colors",
|
|
2577
2603
|
"focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",
|
|
2578
2604
|
"disabled:bg-gray-100 disabled:cursor-not-allowed",
|
|
@@ -2580,7 +2606,7 @@ const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
|
2580
2606
|
"dark:bg-gray-800 dark:text-white",
|
|
2581
2607
|
i
|
|
2582
2608
|
),
|
|
2583
|
-
...
|
|
2609
|
+
...l,
|
|
2584
2610
|
children: [
|
|
2585
2611
|
a && /* @__PURE__ */ n("option", { value: "", disabled: !0, children: a }, "__placeholder__"),
|
|
2586
2612
|
s.map((d, u) => /* @__PURE__ */ n(
|
|
@@ -2599,7 +2625,7 @@ const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
|
2599
2625
|
!e && r && /* @__PURE__ */ n("p", { className: "mt-1 text-sm text-gray-500", children: r })
|
|
2600
2626
|
] })
|
|
2601
2627
|
);
|
|
2602
|
-
|
|
2628
|
+
ye.displayName = "Select";
|
|
2603
2629
|
const nr = ({
|
|
2604
2630
|
label: t,
|
|
2605
2631
|
error: e,
|
|
@@ -2607,55 +2633,55 @@ const nr = ({
|
|
|
2607
2633
|
multiple: s = !1,
|
|
2608
2634
|
maxSize: a,
|
|
2609
2635
|
onChange: i,
|
|
2610
|
-
value:
|
|
2611
|
-
className:
|
|
2636
|
+
value: l = [],
|
|
2637
|
+
className: c
|
|
2612
2638
|
}) => {
|
|
2613
|
-
const [d, u] =
|
|
2614
|
-
if (!
|
|
2615
|
-
const
|
|
2616
|
-
if (a &&
|
|
2617
|
-
const
|
|
2618
|
-
alert(`Some files exceed the maximum size of ${
|
|
2639
|
+
const [d, u] = N(!1), y = H(null), x = (h) => {
|
|
2640
|
+
if (!h) return;
|
|
2641
|
+
const A = Array.from(h);
|
|
2642
|
+
if (a && A.filter((S) => S.size > a).length > 0) {
|
|
2643
|
+
const S = Ie(a);
|
|
2644
|
+
alert(`Some files exceed the maximum size of ${S}`);
|
|
2619
2645
|
return;
|
|
2620
2646
|
}
|
|
2621
|
-
i == null || i(s ? [...
|
|
2622
|
-
},
|
|
2623
|
-
|
|
2624
|
-
},
|
|
2647
|
+
i == null || i(s ? [...l, ...A] : [A[0]]);
|
|
2648
|
+
}, g = (h) => {
|
|
2649
|
+
h.preventDefault(), u(!0);
|
|
2650
|
+
}, b = () => {
|
|
2625
2651
|
u(!1);
|
|
2626
|
-
},
|
|
2627
|
-
|
|
2628
|
-
},
|
|
2629
|
-
var
|
|
2630
|
-
(
|
|
2631
|
-
},
|
|
2632
|
-
const
|
|
2633
|
-
i == null || i(
|
|
2652
|
+
}, m = (h) => {
|
|
2653
|
+
h.preventDefault(), u(!1), x(h.dataTransfer.files);
|
|
2654
|
+
}, f = () => {
|
|
2655
|
+
var h;
|
|
2656
|
+
(h = y.current) == null || h.click();
|
|
2657
|
+
}, k = (h) => {
|
|
2658
|
+
const A = l.filter((v, S) => S !== h);
|
|
2659
|
+
i == null || i(A);
|
|
2634
2660
|
};
|
|
2635
|
-
return /* @__PURE__ */ o("div", { className:
|
|
2661
|
+
return /* @__PURE__ */ o("div", { className: te("w-full", c), children: [
|
|
2636
2662
|
t && /* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: t }),
|
|
2637
2663
|
/* @__PURE__ */ o(
|
|
2638
2664
|
"div",
|
|
2639
2665
|
{
|
|
2640
|
-
className:
|
|
2666
|
+
className: te(
|
|
2641
2667
|
"border-2 border-dashed rounded-lg p-6 text-center cursor-pointer transition-colors",
|
|
2642
2668
|
d ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-300 dark:border-gray-600 hover:border-primary-500",
|
|
2643
2669
|
e && "border-danger-500"
|
|
2644
2670
|
),
|
|
2645
|
-
onDragOver:
|
|
2646
|
-
onDragLeave:
|
|
2647
|
-
onDrop:
|
|
2648
|
-
onClick:
|
|
2671
|
+
onDragOver: g,
|
|
2672
|
+
onDragLeave: b,
|
|
2673
|
+
onDrop: m,
|
|
2674
|
+
onClick: f,
|
|
2649
2675
|
children: [
|
|
2650
2676
|
/* @__PURE__ */ n(
|
|
2651
2677
|
"input",
|
|
2652
2678
|
{
|
|
2653
|
-
ref:
|
|
2679
|
+
ref: y,
|
|
2654
2680
|
type: "file",
|
|
2655
2681
|
className: "hidden",
|
|
2656
2682
|
accept: r,
|
|
2657
2683
|
multiple: s,
|
|
2658
|
-
onChange: (
|
|
2684
|
+
onChange: (h) => x(h.target.files)
|
|
2659
2685
|
}
|
|
2660
2686
|
),
|
|
2661
2687
|
/* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
@@ -2683,13 +2709,13 @@ const nr = ({
|
|
|
2683
2709
|
] }),
|
|
2684
2710
|
a && /* @__PURE__ */ o("p", { className: "text-xs text-gray-500", children: [
|
|
2685
2711
|
"Maximum file size: ",
|
|
2686
|
-
|
|
2712
|
+
Ie(a)
|
|
2687
2713
|
] })
|
|
2688
2714
|
] })
|
|
2689
2715
|
]
|
|
2690
2716
|
}
|
|
2691
2717
|
),
|
|
2692
|
-
|
|
2718
|
+
l.length > 0 && /* @__PURE__ */ n("div", { className: "mt-3 space-y-2", children: l.map((h, A) => /* @__PURE__ */ o(
|
|
2693
2719
|
"div",
|
|
2694
2720
|
{
|
|
2695
2721
|
className: "flex items-center justify-between px-3 py-2 bg-gray-50 dark:bg-gray-700 rounded-lg",
|
|
@@ -2711,10 +2737,10 @@ const nr = ({
|
|
|
2711
2737
|
)
|
|
2712
2738
|
}
|
|
2713
2739
|
),
|
|
2714
|
-
/* @__PURE__ */ n("span", { className: "text-sm text-gray-700 dark:text-gray-300 truncate", children:
|
|
2740
|
+
/* @__PURE__ */ n("span", { className: "text-sm text-gray-700 dark:text-gray-300 truncate", children: h.name }),
|
|
2715
2741
|
/* @__PURE__ */ o("span", { className: "text-xs text-gray-500", children: [
|
|
2716
2742
|
"(",
|
|
2717
|
-
|
|
2743
|
+
Ie(h.size),
|
|
2718
2744
|
")"
|
|
2719
2745
|
] })
|
|
2720
2746
|
] }),
|
|
@@ -2722,8 +2748,8 @@ const nr = ({
|
|
|
2722
2748
|
"button",
|
|
2723
2749
|
{
|
|
2724
2750
|
type: "button",
|
|
2725
|
-
onClick: (
|
|
2726
|
-
|
|
2751
|
+
onClick: (v) => {
|
|
2752
|
+
v.stopPropagation(), k(A);
|
|
2727
2753
|
},
|
|
2728
2754
|
className: "ml-2 text-danger-500 hover:text-danger-700 focus:outline-none",
|
|
2729
2755
|
children: /* @__PURE__ */ n("svg", { className: "h-5 w-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ n(
|
|
@@ -2738,11 +2764,11 @@ const nr = ({
|
|
|
2738
2764
|
)
|
|
2739
2765
|
]
|
|
2740
2766
|
},
|
|
2741
|
-
|
|
2767
|
+
A
|
|
2742
2768
|
)) }),
|
|
2743
2769
|
e && /* @__PURE__ */ n("p", { className: "mt-1 text-sm text-danger-500", children: e })
|
|
2744
2770
|
] });
|
|
2745
|
-
}, sr =
|
|
2771
|
+
}, sr = Le(
|
|
2746
2772
|
({ countryCode: t = "+1", onCountryCodeChange: e, className: r, ...s }, a) => /* @__PURE__ */ o("div", { className: "w-full", children: [
|
|
2747
2773
|
s.label && /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
|
|
2748
2774
|
s.label,
|
|
@@ -2755,7 +2781,7 @@ const nr = ({
|
|
|
2755
2781
|
type: "text",
|
|
2756
2782
|
value: t,
|
|
2757
2783
|
onChange: (i) => e == null ? void 0 : e(i.target.value),
|
|
2758
|
-
className:
|
|
2784
|
+
className: te(
|
|
2759
2785
|
"w-20 rounded-lg border px-3 py-2 text-sm",
|
|
2760
2786
|
"focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",
|
|
2761
2787
|
"border-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:text-white"
|
|
@@ -2764,11 +2790,11 @@ const nr = ({
|
|
|
2764
2790
|
}
|
|
2765
2791
|
),
|
|
2766
2792
|
/* @__PURE__ */ n(
|
|
2767
|
-
|
|
2793
|
+
X,
|
|
2768
2794
|
{
|
|
2769
2795
|
ref: a,
|
|
2770
2796
|
type: "tel",
|
|
2771
|
-
className:
|
|
2797
|
+
className: te("flex-1", r),
|
|
2772
2798
|
...s,
|
|
2773
2799
|
label: ""
|
|
2774
2800
|
}
|
|
@@ -2778,63 +2804,63 @@ const nr = ({
|
|
|
2778
2804
|
] })
|
|
2779
2805
|
);
|
|
2780
2806
|
sr.displayName = "PhoneInput";
|
|
2781
|
-
const
|
|
2807
|
+
const Be = (t, e, r) => {
|
|
2782
2808
|
if (t && "reportValidity" in t) {
|
|
2783
|
-
const s =
|
|
2809
|
+
const s = De(r, e);
|
|
2784
2810
|
t.setCustomValidity(s && s.message || ""), t.reportValidity();
|
|
2785
2811
|
}
|
|
2786
|
-
},
|
|
2812
|
+
}, Fe = (t, e) => {
|
|
2787
2813
|
for (const r in e.fields) {
|
|
2788
2814
|
const s = e.fields[r];
|
|
2789
|
-
s && s.ref && "reportValidity" in s.ref ?
|
|
2815
|
+
s && s.ref && "reportValidity" in s.ref ? Be(s.ref, r, t) : s && s.refs && s.refs.forEach((a) => Be(a, r, t));
|
|
2790
2816
|
}
|
|
2791
|
-
},
|
|
2792
|
-
e.shouldUseNativeValidation &&
|
|
2817
|
+
}, Oe = (t, e) => {
|
|
2818
|
+
e.shouldUseNativeValidation && Fe(t, e);
|
|
2793
2819
|
const r = {};
|
|
2794
2820
|
for (const s in t) {
|
|
2795
|
-
const a =
|
|
2821
|
+
const a = De(e.fields, s), i = Object.assign(t[s] || {}, { ref: a && a.ref });
|
|
2796
2822
|
if (ar(e.names || Object.keys(t), s)) {
|
|
2797
|
-
const
|
|
2798
|
-
|
|
2799
|
-
} else
|
|
2823
|
+
const l = Object.assign({}, De(r, s));
|
|
2824
|
+
Ee(l, "root", i), Ee(r, s, l);
|
|
2825
|
+
} else Ee(r, s, i);
|
|
2800
2826
|
}
|
|
2801
2827
|
return r;
|
|
2802
2828
|
}, ar = (t, e) => {
|
|
2803
|
-
const r =
|
|
2804
|
-
return t.some((s) =>
|
|
2829
|
+
const r = ze(e);
|
|
2830
|
+
return t.some((s) => ze(s).match(`^${r}\\.\\d+`));
|
|
2805
2831
|
};
|
|
2806
|
-
function
|
|
2832
|
+
function ze(t) {
|
|
2807
2833
|
return t.replace(/\]|\[/g, "");
|
|
2808
2834
|
}
|
|
2809
2835
|
function qe(t, e, r) {
|
|
2810
|
-
function s(
|
|
2836
|
+
function s(c, d) {
|
|
2811
2837
|
var u;
|
|
2812
|
-
Object.defineProperty(
|
|
2813
|
-
value:
|
|
2838
|
+
Object.defineProperty(c, "_zod", {
|
|
2839
|
+
value: c._zod ?? {},
|
|
2814
2840
|
enumerable: !1
|
|
2815
|
-
}), (u =
|
|
2816
|
-
for (const
|
|
2817
|
-
|
|
2818
|
-
|
|
2841
|
+
}), (u = c._zod).traits ?? (u.traits = /* @__PURE__ */ new Set()), c._zod.traits.add(t), e(c, d);
|
|
2842
|
+
for (const y in l.prototype)
|
|
2843
|
+
y in c || Object.defineProperty(c, y, { value: l.prototype[y].bind(c) });
|
|
2844
|
+
c._zod.constr = l, c._zod.def = d;
|
|
2819
2845
|
}
|
|
2820
2846
|
const a = (r == null ? void 0 : r.Parent) ?? Object;
|
|
2821
2847
|
class i extends a {
|
|
2822
2848
|
}
|
|
2823
2849
|
Object.defineProperty(i, "name", { value: t });
|
|
2824
|
-
function c
|
|
2850
|
+
function l(c) {
|
|
2825
2851
|
var d;
|
|
2826
2852
|
const u = r != null && r.Parent ? new i() : this;
|
|
2827
|
-
s(u,
|
|
2828
|
-
for (const
|
|
2829
|
-
|
|
2853
|
+
s(u, c), (d = u._zod).deferred ?? (d.deferred = []);
|
|
2854
|
+
for (const y of u._zod.deferred)
|
|
2855
|
+
y();
|
|
2830
2856
|
return u;
|
|
2831
2857
|
}
|
|
2832
|
-
return Object.defineProperty(
|
|
2833
|
-
value: (
|
|
2858
|
+
return Object.defineProperty(l, "init", { value: s }), Object.defineProperty(l, Symbol.hasInstance, {
|
|
2859
|
+
value: (c) => {
|
|
2834
2860
|
var d, u;
|
|
2835
|
-
return r != null && r.Parent &&
|
|
2861
|
+
return r != null && r.Parent && c instanceof r.Parent ? !0 : (u = (d = c == null ? void 0 : c._zod) == null ? void 0 : d.traits) == null ? void 0 : u.has(t);
|
|
2836
2862
|
}
|
|
2837
|
-
}), Object.defineProperty(
|
|
2863
|
+
}), Object.defineProperty(l, "name", { value: t }), l;
|
|
2838
2864
|
}
|
|
2839
2865
|
class ir extends Error {
|
|
2840
2866
|
constructor() {
|
|
@@ -2850,15 +2876,15 @@ function lr(t, e) {
|
|
|
2850
2876
|
}
|
|
2851
2877
|
const Ve = Error.captureStackTrace ? Error.captureStackTrace : (...t) => {
|
|
2852
2878
|
};
|
|
2853
|
-
function
|
|
2879
|
+
function ke(t) {
|
|
2854
2880
|
return typeof t == "string" ? t : t == null ? void 0 : t.message;
|
|
2855
2881
|
}
|
|
2856
2882
|
function Ye(t, e, r) {
|
|
2857
|
-
var a, i,
|
|
2883
|
+
var a, i, l, c, d, u;
|
|
2858
2884
|
const s = { ...t, path: t.path ?? [] };
|
|
2859
2885
|
if (!t.message) {
|
|
2860
|
-
const
|
|
2861
|
-
s.message =
|
|
2886
|
+
const y = ke((l = (i = (a = t.inst) == null ? void 0 : a._zod.def) == null ? void 0 : i.error) == null ? void 0 : l.call(i, t)) ?? ke((c = e == null ? void 0 : e.error) == null ? void 0 : c.call(e, t)) ?? ke((d = r.customError) == null ? void 0 : d.call(r, t)) ?? ke((u = r.localeError) == null ? void 0 : u.call(r, t)) ?? "Invalid input";
|
|
2887
|
+
s.message = y;
|
|
2862
2888
|
}
|
|
2863
2889
|
return delete s.inst, delete s.continue, e != null && e.reportInput || delete s.input, s;
|
|
2864
2890
|
}
|
|
@@ -2880,24 +2906,24 @@ const We = (t, e) => {
|
|
|
2880
2906
|
enumerable: !1
|
|
2881
2907
|
});
|
|
2882
2908
|
}, cr = qe("$ZodError", We), Qe = qe("$ZodError", We, { Parent: Error }), dr = (t) => (e, r, s, a) => {
|
|
2883
|
-
const i = s ? Object.assign(s, { async: !1 }) : { async: !1 },
|
|
2884
|
-
if (
|
|
2909
|
+
const i = s ? Object.assign(s, { async: !1 }) : { async: !1 }, l = e._zod.run({ value: r, issues: [] }, i);
|
|
2910
|
+
if (l instanceof Promise)
|
|
2885
2911
|
throw new ir();
|
|
2886
|
-
if (
|
|
2887
|
-
const
|
|
2888
|
-
throw Ve(
|
|
2912
|
+
if (l.issues.length) {
|
|
2913
|
+
const c = new ((a == null ? void 0 : a.Err) ?? t)(l.issues.map((d) => Ye(d, i, He())));
|
|
2914
|
+
throw Ve(c, a == null ? void 0 : a.callee), c;
|
|
2889
2915
|
}
|
|
2890
|
-
return
|
|
2916
|
+
return l.value;
|
|
2891
2917
|
}, ur = /* @__PURE__ */ dr(Qe), mr = (t) => async (e, r, s, a) => {
|
|
2892
2918
|
const i = s ? Object.assign(s, { async: !0 }) : { async: !0 };
|
|
2893
|
-
let
|
|
2894
|
-
if (
|
|
2895
|
-
const
|
|
2896
|
-
throw Ve(
|
|
2919
|
+
let l = e._zod.run({ value: r, issues: [] }, i);
|
|
2920
|
+
if (l instanceof Promise && (l = await l), l.issues.length) {
|
|
2921
|
+
const c = new ((a == null ? void 0 : a.Err) ?? t)(l.issues.map((d) => Ye(d, i, He())));
|
|
2922
|
+
throw Ve(c, a == null ? void 0 : a.callee), c;
|
|
2897
2923
|
}
|
|
2898
|
-
return
|
|
2924
|
+
return l.value;
|
|
2899
2925
|
}, hr = /* @__PURE__ */ mr(Qe);
|
|
2900
|
-
function
|
|
2926
|
+
function $e(t, e) {
|
|
2901
2927
|
try {
|
|
2902
2928
|
var r = t();
|
|
2903
2929
|
} catch (s) {
|
|
@@ -2907,18 +2933,18 @@ function ze(t, e) {
|
|
|
2907
2933
|
}
|
|
2908
2934
|
function pr(t, e) {
|
|
2909
2935
|
for (var r = {}; t.length; ) {
|
|
2910
|
-
var s = t[0], a = s.code, i = s.message,
|
|
2911
|
-
if (!r[
|
|
2912
|
-
var
|
|
2913
|
-
r[
|
|
2914
|
-
} else r[
|
|
2915
|
-
if ("unionErrors" in s && s.unionErrors.forEach(function(
|
|
2916
|
-
return
|
|
2917
|
-
return t.push(
|
|
2936
|
+
var s = t[0], a = s.code, i = s.message, l = s.path.join(".");
|
|
2937
|
+
if (!r[l]) if ("unionErrors" in s) {
|
|
2938
|
+
var c = s.unionErrors[0].errors[0];
|
|
2939
|
+
r[l] = { message: c.message, type: c.code };
|
|
2940
|
+
} else r[l] = { message: i, type: a };
|
|
2941
|
+
if ("unionErrors" in s && s.unionErrors.forEach(function(y) {
|
|
2942
|
+
return y.errors.forEach(function(x) {
|
|
2943
|
+
return t.push(x);
|
|
2918
2944
|
});
|
|
2919
2945
|
}), e) {
|
|
2920
|
-
var d = r[
|
|
2921
|
-
r[
|
|
2946
|
+
var d = r[l].types, u = d && d[s.code];
|
|
2947
|
+
r[l] = _e(l, e, r, a, u ? [].concat(u, s.message) : s.message);
|
|
2922
2948
|
}
|
|
2923
2949
|
t.shift();
|
|
2924
2950
|
}
|
|
@@ -2926,18 +2952,18 @@ function pr(t, e) {
|
|
|
2926
2952
|
}
|
|
2927
2953
|
function gr(t, e) {
|
|
2928
2954
|
for (var r = {}; t.length; ) {
|
|
2929
|
-
var s = t[0], a = s.code, i = s.message,
|
|
2930
|
-
if (!r[
|
|
2931
|
-
var
|
|
2932
|
-
r[
|
|
2933
|
-
} else r[
|
|
2934
|
-
if (s.code === "invalid_union" && s.errors.forEach(function(
|
|
2935
|
-
return
|
|
2936
|
-
return t.push(
|
|
2955
|
+
var s = t[0], a = s.code, i = s.message, l = s.path.join(".");
|
|
2956
|
+
if (!r[l]) if (s.code === "invalid_union" && s.errors.length > 0) {
|
|
2957
|
+
var c = s.errors[0][0];
|
|
2958
|
+
r[l] = { message: c.message, type: c.code };
|
|
2959
|
+
} else r[l] = { message: i, type: a };
|
|
2960
|
+
if (s.code === "invalid_union" && s.errors.forEach(function(y) {
|
|
2961
|
+
return y.forEach(function(x) {
|
|
2962
|
+
return t.push(x);
|
|
2937
2963
|
});
|
|
2938
2964
|
}), e) {
|
|
2939
|
-
var d = r[
|
|
2940
|
-
r[
|
|
2965
|
+
var d = r[l].types, u = d && d[s.code];
|
|
2966
|
+
r[l] = _e(l, e, r, a, u ? [].concat(u, s.message) : s.message);
|
|
2941
2967
|
}
|
|
2942
2968
|
t.shift();
|
|
2943
2969
|
}
|
|
@@ -2948,47 +2974,47 @@ function Ge(t, e, r) {
|
|
|
2948
2974
|
return "_def" in s && typeof s._def == "object" && "typeName" in s._def;
|
|
2949
2975
|
}(t)) return function(s, a, i) {
|
|
2950
2976
|
try {
|
|
2951
|
-
return Promise.resolve(
|
|
2952
|
-
return Promise.resolve(t[r.mode === "sync" ? "parse" : "parseAsync"](s, e)).then(function(
|
|
2953
|
-
return i.shouldUseNativeValidation &&
|
|
2977
|
+
return Promise.resolve($e(function() {
|
|
2978
|
+
return Promise.resolve(t[r.mode === "sync" ? "parse" : "parseAsync"](s, e)).then(function(l) {
|
|
2979
|
+
return i.shouldUseNativeValidation && Fe({}, i), { errors: {}, values: r.raw ? Object.assign({}, s) : l };
|
|
2954
2980
|
});
|
|
2955
|
-
}, function(
|
|
2956
|
-
if (function(
|
|
2957
|
-
return Array.isArray(
|
|
2958
|
-
}(
|
|
2959
|
-
throw
|
|
2981
|
+
}, function(l) {
|
|
2982
|
+
if (function(c) {
|
|
2983
|
+
return Array.isArray(c == null ? void 0 : c.issues);
|
|
2984
|
+
}(l)) return { values: {}, errors: Oe(pr(l.errors, !i.shouldUseNativeValidation && i.criteriaMode === "all"), i) };
|
|
2985
|
+
throw l;
|
|
2960
2986
|
}));
|
|
2961
|
-
} catch (
|
|
2962
|
-
return Promise.reject(
|
|
2987
|
+
} catch (l) {
|
|
2988
|
+
return Promise.reject(l);
|
|
2963
2989
|
}
|
|
2964
2990
|
};
|
|
2965
2991
|
if (function(s) {
|
|
2966
2992
|
return "_zod" in s && typeof s._zod == "object";
|
|
2967
2993
|
}(t)) return function(s, a, i) {
|
|
2968
2994
|
try {
|
|
2969
|
-
return Promise.resolve(
|
|
2970
|
-
return Promise.resolve((r.mode === "sync" ? ur : hr)(t, s, e)).then(function(
|
|
2971
|
-
return i.shouldUseNativeValidation &&
|
|
2995
|
+
return Promise.resolve($e(function() {
|
|
2996
|
+
return Promise.resolve((r.mode === "sync" ? ur : hr)(t, s, e)).then(function(l) {
|
|
2997
|
+
return i.shouldUseNativeValidation && Fe({}, i), { errors: {}, values: r.raw ? Object.assign({}, s) : l };
|
|
2972
2998
|
});
|
|
2973
|
-
}, function(
|
|
2974
|
-
if (function(
|
|
2975
|
-
return
|
|
2976
|
-
}(
|
|
2977
|
-
throw
|
|
2999
|
+
}, function(l) {
|
|
3000
|
+
if (function(c) {
|
|
3001
|
+
return c instanceof cr;
|
|
3002
|
+
}(l)) return { values: {}, errors: Oe(gr(l.issues, !i.shouldUseNativeValidation && i.criteriaMode === "all"), i) };
|
|
3003
|
+
throw l;
|
|
2978
3004
|
}));
|
|
2979
|
-
} catch (
|
|
2980
|
-
return Promise.reject(
|
|
3005
|
+
} catch (l) {
|
|
3006
|
+
return Promise.reject(l);
|
|
2981
3007
|
}
|
|
2982
3008
|
};
|
|
2983
3009
|
throw new Error("Invalid input: not a Zod schema");
|
|
2984
3010
|
}
|
|
2985
3011
|
function yr(t) {
|
|
2986
|
-
return
|
|
2987
|
-
questionResults:
|
|
3012
|
+
return ue.object({
|
|
3013
|
+
questionResults: ue.any()
|
|
2988
3014
|
}).passthrough();
|
|
2989
3015
|
}
|
|
2990
3016
|
function fr(t) {
|
|
2991
|
-
let e =
|
|
3017
|
+
let e = ue.array(ue.instanceof(File));
|
|
2992
3018
|
if (t.isRequired ? e = e.min(
|
|
2993
3019
|
1,
|
|
2994
3020
|
`${t.displayName} is required`
|
|
@@ -3014,132 +3040,132 @@ function qr(t) {
|
|
|
3014
3040
|
return t.uploadDocumentFiles.forEach((r) => {
|
|
3015
3041
|
const s = `file_${r.id}`;
|
|
3016
3042
|
e[s] = fr(r);
|
|
3017
|
-
}),
|
|
3043
|
+
}), ue.object(e);
|
|
3018
3044
|
}
|
|
3019
3045
|
function br(t) {
|
|
3020
|
-
return
|
|
3046
|
+
return ue.any();
|
|
3021
3047
|
}
|
|
3022
|
-
function
|
|
3023
|
-
return
|
|
3048
|
+
function vr(t) {
|
|
3049
|
+
return ue.string().min(1, "This question is required");
|
|
3024
3050
|
}
|
|
3025
3051
|
function Hr(t) {
|
|
3026
3052
|
const e = {};
|
|
3027
3053
|
return t.appropriatenessQuestions.forEach((r) => {
|
|
3028
3054
|
const s = `question_${r.id}`;
|
|
3029
|
-
e[s] =
|
|
3030
|
-
}),
|
|
3055
|
+
e[s] = vr();
|
|
3056
|
+
}), ue.object(e);
|
|
3031
3057
|
}
|
|
3032
|
-
const Vr =
|
|
3058
|
+
const Vr = ue.any(), xr = ({
|
|
3033
3059
|
applicantId: t,
|
|
3034
3060
|
onComplete: e,
|
|
3035
3061
|
onBack: r
|
|
3036
3062
|
}) => {
|
|
3037
|
-
const { questionnaire: s, isLoading: a, isSubmitting: i, error:
|
|
3038
|
-
(
|
|
3039
|
-
questionId:
|
|
3063
|
+
const { questionnaire: s, isLoading: a, isSubmitting: i, error: l, submit: c } = Zt(t), d = Re(() => s ? { questionResults: s.questionGroups.map(
|
|
3064
|
+
(f) => f.questions.map((k) => ({
|
|
3065
|
+
questionId: k.id,
|
|
3040
3066
|
values: []
|
|
3041
3067
|
}))
|
|
3042
3068
|
) } : { questionResults: [] }, [s]), u = s ? yr() : null, {
|
|
3043
|
-
control:
|
|
3044
|
-
handleSubmit:
|
|
3045
|
-
formState: { errors:
|
|
3046
|
-
} =
|
|
3069
|
+
control: y,
|
|
3070
|
+
handleSubmit: x,
|
|
3071
|
+
formState: { errors: g }
|
|
3072
|
+
} = Te({
|
|
3047
3073
|
resolver: u ? Ge(u) : void 0,
|
|
3048
3074
|
defaultValues: d
|
|
3049
|
-
}),
|
|
3075
|
+
}), b = async (m) => {
|
|
3050
3076
|
if (s)
|
|
3051
3077
|
try {
|
|
3052
|
-
console.log("Form submitted with data:",
|
|
3053
|
-
const
|
|
3054
|
-
(
|
|
3055
|
-
var
|
|
3078
|
+
console.log("Form submitted with data:", m);
|
|
3079
|
+
const f = s.questionGroups.flatMap(
|
|
3080
|
+
(h, A) => h.questions.map((v, S) => {
|
|
3081
|
+
var I, P, C;
|
|
3056
3082
|
return {
|
|
3057
|
-
questionId:
|
|
3058
|
-
values: ((
|
|
3083
|
+
questionId: v.id,
|
|
3084
|
+
values: ((C = (P = (I = m.questionResults) == null ? void 0 : I[A]) == null ? void 0 : P[S]) == null ? void 0 : C.values) || []
|
|
3059
3085
|
};
|
|
3060
3086
|
})
|
|
3061
3087
|
);
|
|
3062
|
-
console.log("Question results to submit:",
|
|
3063
|
-
const
|
|
3088
|
+
console.log("Question results to submit:", f);
|
|
3089
|
+
const k = {
|
|
3064
3090
|
applicantId: t,
|
|
3065
3091
|
questionnarieId: s.id,
|
|
3066
|
-
questionResults:
|
|
3092
|
+
questionResults: f
|
|
3067
3093
|
};
|
|
3068
|
-
console.log("Final input:",
|
|
3069
|
-
} catch (
|
|
3070
|
-
console.error("Error submitting questionnaire:",
|
|
3094
|
+
console.log("Final input:", k), await c(k), e == null || e();
|
|
3095
|
+
} catch (f) {
|
|
3096
|
+
console.error("Error submitting questionnaire:", f);
|
|
3071
3097
|
}
|
|
3072
3098
|
};
|
|
3073
|
-
return a ? /* @__PURE__ */ n(
|
|
3099
|
+
return a ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(ce, { className: "my-8" }) }) }) : l ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
3074
3100
|
"Error loading questionnaire: ",
|
|
3075
|
-
|
|
3076
|
-
] }) }) }) : s ? /* @__PURE__ */ n("form", { onSubmit:
|
|
3077
|
-
/* @__PURE__ */ o(
|
|
3101
|
+
l.message
|
|
3102
|
+
] }) }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: x(b), children: /* @__PURE__ */ o(L, { children: [
|
|
3103
|
+
/* @__PURE__ */ o(ee, { children: [
|
|
3078
3104
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: s.displayName }),
|
|
3079
3105
|
s.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: s.subtitle })
|
|
3080
3106
|
] }),
|
|
3081
|
-
/* @__PURE__ */ n(
|
|
3082
|
-
(
|
|
3083
|
-
const
|
|
3107
|
+
/* @__PURE__ */ n(T, { className: "space-y-8", children: s.questionGroups.flatMap(
|
|
3108
|
+
(m, f) => m.questions.map((k, h) => {
|
|
3109
|
+
const v = k.defaultAnswers && k.defaultAnswers.length > 0 ? k.showAsDropdown ? k.canMultipleAnswer ? "multi-select" : "single-select" : k.canMultipleAnswer ? "checkbox" : "radio" : "text";
|
|
3084
3110
|
return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
3085
3111
|
/* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300", children: [
|
|
3086
|
-
|
|
3087
|
-
|
|
3112
|
+
k.text,
|
|
3113
|
+
k.isRequired && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
|
|
3088
3114
|
] }),
|
|
3089
|
-
|
|
3090
|
-
|
|
3115
|
+
v === "text" && /* @__PURE__ */ n(
|
|
3116
|
+
J,
|
|
3091
3117
|
{
|
|
3092
|
-
control:
|
|
3093
|
-
name: `questionResults.${
|
|
3094
|
-
render: ({ field:
|
|
3095
|
-
var
|
|
3118
|
+
control: y,
|
|
3119
|
+
name: `questionResults.${f}.${h}.values.0`,
|
|
3120
|
+
render: ({ field: S }) => {
|
|
3121
|
+
var I, P, C, E;
|
|
3096
3122
|
return /* @__PURE__ */ n(
|
|
3097
|
-
|
|
3123
|
+
X,
|
|
3098
3124
|
{
|
|
3099
|
-
value:
|
|
3100
|
-
onChange:
|
|
3101
|
-
onBlur:
|
|
3102
|
-
name:
|
|
3125
|
+
value: S.value || "",
|
|
3126
|
+
onChange: S.onChange,
|
|
3127
|
+
onBlur: S.onBlur,
|
|
3128
|
+
name: S.name,
|
|
3103
3129
|
placeholder: "Enter your answer...",
|
|
3104
|
-
error: (
|
|
3130
|
+
error: (E = (C = (P = (I = g.questionResults) == null ? void 0 : I[f]) == null ? void 0 : P[h]) == null ? void 0 : C.values) == null ? void 0 : E.message
|
|
3105
3131
|
}
|
|
3106
3132
|
);
|
|
3107
3133
|
}
|
|
3108
3134
|
}
|
|
3109
3135
|
),
|
|
3110
|
-
(
|
|
3111
|
-
|
|
3136
|
+
(v === "single-select" || v === "radio") && /* @__PURE__ */ n(
|
|
3137
|
+
J,
|
|
3112
3138
|
{
|
|
3113
|
-
control:
|
|
3114
|
-
name: `questionResults.${
|
|
3115
|
-
render: ({ field:
|
|
3116
|
-
var
|
|
3139
|
+
control: y,
|
|
3140
|
+
name: `questionResults.${f}.${h}.values.0`,
|
|
3141
|
+
render: ({ field: S }) => {
|
|
3142
|
+
var I, P, C, E;
|
|
3117
3143
|
return /* @__PURE__ */ n(
|
|
3118
|
-
|
|
3144
|
+
ye,
|
|
3119
3145
|
{
|
|
3120
|
-
value:
|
|
3121
|
-
onChange:
|
|
3122
|
-
onBlur:
|
|
3123
|
-
name:
|
|
3124
|
-
options:
|
|
3125
|
-
value:
|
|
3126
|
-
label:
|
|
3146
|
+
value: S.value || "",
|
|
3147
|
+
onChange: S.onChange,
|
|
3148
|
+
onBlur: S.onBlur,
|
|
3149
|
+
name: S.name,
|
|
3150
|
+
options: k.defaultAnswers.map((M) => ({
|
|
3151
|
+
value: M,
|
|
3152
|
+
label: M
|
|
3127
3153
|
})),
|
|
3128
3154
|
placeholder: "Select an option...",
|
|
3129
|
-
error: (
|
|
3155
|
+
error: (E = (C = (P = (I = g.questionResults) == null ? void 0 : I[f]) == null ? void 0 : P[h]) == null ? void 0 : C.values) == null ? void 0 : E.message
|
|
3130
3156
|
}
|
|
3131
3157
|
);
|
|
3132
3158
|
}
|
|
3133
3159
|
}
|
|
3134
3160
|
),
|
|
3135
|
-
(
|
|
3161
|
+
(v === "checkbox" || v === "multi-select") && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
3136
3162
|
/* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400 mb-2", children: "Choose one or more options" }),
|
|
3137
3163
|
/* @__PURE__ */ n(
|
|
3138
|
-
|
|
3164
|
+
J,
|
|
3139
3165
|
{
|
|
3140
|
-
control:
|
|
3141
|
-
name: `questionResults.${
|
|
3142
|
-
render: ({ field: { value:
|
|
3166
|
+
control: y,
|
|
3167
|
+
name: `questionResults.${f}.${h}.values`,
|
|
3168
|
+
render: ({ field: { value: S = [], onChange: I } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: k.defaultAnswers.map((P, C) => /* @__PURE__ */ o(
|
|
3143
3169
|
"label",
|
|
3144
3170
|
{
|
|
3145
3171
|
className: "flex items-center space-x-2 cursor-pointer",
|
|
@@ -3148,26 +3174,26 @@ const Vr = de.any(), vr = ({
|
|
|
3148
3174
|
"input",
|
|
3149
3175
|
{
|
|
3150
3176
|
type: "checkbox",
|
|
3151
|
-
checked: Array.isArray(
|
|
3152
|
-
onChange: (
|
|
3153
|
-
const
|
|
3154
|
-
|
|
3177
|
+
checked: Array.isArray(S) && S.includes(P),
|
|
3178
|
+
onChange: (E) => {
|
|
3179
|
+
const M = Array.isArray(S) ? S : [], B = E.target.checked ? [...M, P] : M.filter((Q) => Q !== P);
|
|
3180
|
+
I(B);
|
|
3155
3181
|
},
|
|
3156
3182
|
className: "h-4 w-4 text-primary-500 rounded border-gray-300 focus:ring-primary-500"
|
|
3157
3183
|
}
|
|
3158
3184
|
),
|
|
3159
|
-
/* @__PURE__ */ n("span", { className: "text-sm", children:
|
|
3185
|
+
/* @__PURE__ */ n("span", { className: "text-sm", children: P })
|
|
3160
3186
|
]
|
|
3161
3187
|
},
|
|
3162
|
-
`answer-${
|
|
3188
|
+
`answer-${f}-${h}-${C}`
|
|
3163
3189
|
)) })
|
|
3164
3190
|
}
|
|
3165
3191
|
)
|
|
3166
3192
|
] })
|
|
3167
|
-
] },
|
|
3193
|
+
] }, k.id);
|
|
3168
3194
|
})
|
|
3169
3195
|
) }),
|
|
3170
|
-
/* @__PURE__ */ o(
|
|
3196
|
+
/* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
|
|
3171
3197
|
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3172
3198
|
/* @__PURE__ */ n(
|
|
3173
3199
|
j,
|
|
@@ -3175,15 +3201,15 @@ const Vr = de.any(), vr = ({
|
|
|
3175
3201
|
type: "submit",
|
|
3176
3202
|
isLoading: i,
|
|
3177
3203
|
onClick: () => {
|
|
3178
|
-
console.log("Continue button clicked"), console.log("Form errors:",
|
|
3204
|
+
console.log("Continue button clicked"), console.log("Form errors:", g);
|
|
3179
3205
|
},
|
|
3180
3206
|
children: "Continue"
|
|
3181
3207
|
}
|
|
3182
3208
|
)
|
|
3183
3209
|
] }),
|
|
3184
|
-
|
|
3210
|
+
l && /* @__PURE__ */ n("div", { className: "mt-4 p-4 bg-red-50 border border-red-200 rounded", children: /* @__PURE__ */ o("p", { className: "text-red-600 text-sm", children: [
|
|
3185
3211
|
"Error: ",
|
|
3186
|
-
|
|
3212
|
+
l.message
|
|
3187
3213
|
] }) })
|
|
3188
3214
|
] }) }) : null;
|
|
3189
3215
|
}, wr = ({
|
|
@@ -3191,69 +3217,69 @@ const Vr = de.any(), vr = ({
|
|
|
3191
3217
|
onComplete: e,
|
|
3192
3218
|
onBack: r
|
|
3193
3219
|
}) => {
|
|
3194
|
-
const { uploadDocument: s, isLoading: a, isSubmitting: i, error:
|
|
3195
|
-
if (
|
|
3196
|
-
const
|
|
3197
|
-
s.uploadDocumentFiles.map(async (
|
|
3198
|
-
const
|
|
3199
|
-
|
|
3200
|
-
fileName:
|
|
3201
|
-
fileData: await qt(
|
|
3220
|
+
const { uploadDocument: s, isLoading: a, isSubmitting: i, error: l, submit: c } = Jt(t), [d, u] = N({}), y = async (x) => {
|
|
3221
|
+
if (x.preventDefault(), !s) return;
|
|
3222
|
+
const g = await Promise.all(
|
|
3223
|
+
s.uploadDocumentFiles.map(async (m) => {
|
|
3224
|
+
const f = d[m.id] || [], k = await Promise.all(
|
|
3225
|
+
f.map(async (h) => ({
|
|
3226
|
+
fileName: h.name,
|
|
3227
|
+
fileData: await qt(h)
|
|
3202
3228
|
}))
|
|
3203
3229
|
);
|
|
3204
3230
|
return {
|
|
3205
|
-
uploadDocumentFileId:
|
|
3206
|
-
valueList:
|
|
3231
|
+
uploadDocumentFileId: m.id,
|
|
3232
|
+
valueList: k
|
|
3207
3233
|
};
|
|
3208
3234
|
})
|
|
3209
|
-
),
|
|
3235
|
+
), b = {
|
|
3210
3236
|
applicantId: t,
|
|
3211
3237
|
uploadDocumentId: s.id,
|
|
3212
|
-
uploadDocumentResults:
|
|
3238
|
+
uploadDocumentResults: g
|
|
3213
3239
|
};
|
|
3214
|
-
await
|
|
3240
|
+
await c(b), e == null || e();
|
|
3215
3241
|
};
|
|
3216
|
-
return a ? /* @__PURE__ */ n(
|
|
3242
|
+
return a ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(ce, { className: "my-8" }) }) }) : l ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
3217
3243
|
"Error loading document requirements: ",
|
|
3218
|
-
|
|
3219
|
-
] }) }) }) : s ? /* @__PURE__ */ n("form", { onSubmit:
|
|
3220
|
-
/* @__PURE__ */ o(
|
|
3244
|
+
l.message
|
|
3245
|
+
] }) }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: y, children: /* @__PURE__ */ o(L, { children: [
|
|
3246
|
+
/* @__PURE__ */ o(ee, { children: [
|
|
3221
3247
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: s.displayName }),
|
|
3222
3248
|
s.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: s.subtitle })
|
|
3223
3249
|
] }),
|
|
3224
|
-
/* @__PURE__ */ n(
|
|
3250
|
+
/* @__PURE__ */ n(T, { className: "space-y-6", children: s.uploadDocumentFiles.map((x) => /* @__PURE__ */ n(
|
|
3225
3251
|
nr,
|
|
3226
3252
|
{
|
|
3227
|
-
label:
|
|
3228
|
-
accept:
|
|
3229
|
-
multiple:
|
|
3230
|
-
maxSize:
|
|
3231
|
-
value: d[
|
|
3232
|
-
onChange: (
|
|
3233
|
-
u((
|
|
3253
|
+
label: x.displayName,
|
|
3254
|
+
accept: x.allowedTypes,
|
|
3255
|
+
multiple: x.multipleFile,
|
|
3256
|
+
maxSize: x.maxEachFileSizeByte,
|
|
3257
|
+
value: d[x.id] || [],
|
|
3258
|
+
onChange: (g) => {
|
|
3259
|
+
u((b) => ({ ...b, [x.id]: g }));
|
|
3234
3260
|
}
|
|
3235
3261
|
},
|
|
3236
|
-
|
|
3262
|
+
x.id
|
|
3237
3263
|
)) }),
|
|
3238
|
-
/* @__PURE__ */ o(
|
|
3264
|
+
/* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
|
|
3239
3265
|
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3240
3266
|
/* @__PURE__ */ n(j, { type: "submit", isLoading: i, children: "Continue" })
|
|
3241
3267
|
] })
|
|
3242
3268
|
] }) }) : null;
|
|
3243
3269
|
}, kr = ({ applicantId: t, onComplete: e, onBack: r }) => {
|
|
3244
|
-
const { overview: s, isLoading: a, isSubmitting: i, error:
|
|
3245
|
-
await
|
|
3270
|
+
const { overview: s, isLoading: a, isSubmitting: i, error: l, passOverview: c } = Xt(t), d = async () => {
|
|
3271
|
+
await c(), e == null || e();
|
|
3246
3272
|
};
|
|
3247
|
-
return a ? /* @__PURE__ */ n(
|
|
3273
|
+
return a ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(ce, { className: "my-8" }) }) }) : l ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
3248
3274
|
"Error loading overview: ",
|
|
3249
|
-
|
|
3250
|
-
] }) }) }) : s ? /* @__PURE__ */ o(
|
|
3251
|
-
/* @__PURE__ */ o(
|
|
3275
|
+
l.message
|
|
3276
|
+
] }) }) }) : s ? /* @__PURE__ */ o(L, { children: [
|
|
3277
|
+
/* @__PURE__ */ o(ee, { children: [
|
|
3252
3278
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: s.title || "Overview" }),
|
|
3253
3279
|
s.description && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: s.description })
|
|
3254
3280
|
] }),
|
|
3255
|
-
/* @__PURE__ */ o(
|
|
3256
|
-
s.steps && s.steps.length > 0 ? /* @__PURE__ */ n("div", { className: "space-y-4", children: s.steps.sort((u,
|
|
3281
|
+
/* @__PURE__ */ o(T, { className: "space-y-6", children: [
|
|
3282
|
+
s.steps && s.steps.length > 0 ? /* @__PURE__ */ n("div", { className: "space-y-4", children: s.steps.sort((u, y) => u.order - y.order).map((u) => /* @__PURE__ */ n(
|
|
3257
3283
|
"div",
|
|
3258
3284
|
{
|
|
3259
3285
|
className: "border border-gray-200 dark:border-gray-700 rounded-lg p-4 bg-gray-50 dark:bg-gray-800",
|
|
@@ -3272,7 +3298,7 @@ const Vr = de.any(), vr = ({
|
|
|
3272
3298
|
" Review the information above and confirm to proceed."
|
|
3273
3299
|
] }) })
|
|
3274
3300
|
] }),
|
|
3275
|
-
/* @__PURE__ */ o(
|
|
3301
|
+
/* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
|
|
3276
3302
|
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3277
3303
|
/* @__PURE__ */ n(j, { onClick: d, isLoading: i, children: "Confirm and Continue" })
|
|
3278
3304
|
] })
|
|
@@ -3282,148 +3308,148 @@ const Vr = de.any(), vr = ({
|
|
|
3282
3308
|
onComplete: e,
|
|
3283
3309
|
onBack: r
|
|
3284
3310
|
}) => {
|
|
3285
|
-
const { criteria: s, isLoading: a, isSubmitting: i, error:
|
|
3286
|
-
criteriaValueInputs: s.map((
|
|
3287
|
-
riskCriteriaId:
|
|
3311
|
+
const { criteria: s, isLoading: a, isSubmitting: i, error: l, submit: c } = tr(t), [d, u] = ie.useState(!1), y = ie.useMemo(() => !s || s.length === 0 ? { criteriaValueInputs: [] } : {
|
|
3312
|
+
criteriaValueInputs: s.map((h) => ({
|
|
3313
|
+
riskCriteriaId: h.id,
|
|
3288
3314
|
values: [""]
|
|
3289
3315
|
// Initialize with empty string to prevent uncontrolled input warning
|
|
3290
3316
|
}))
|
|
3291
|
-
}, [s]),
|
|
3292
|
-
control:
|
|
3293
|
-
handleSubmit:
|
|
3294
|
-
formState: { errors:
|
|
3295
|
-
} =
|
|
3296
|
-
resolver:
|
|
3297
|
-
defaultValues:
|
|
3317
|
+
}, [s]), x = s && s.length > 0 ? br() : null, {
|
|
3318
|
+
control: g,
|
|
3319
|
+
handleSubmit: b,
|
|
3320
|
+
formState: { errors: m }
|
|
3321
|
+
} = Te({
|
|
3322
|
+
resolver: x ? Ge(x) : void 0,
|
|
3323
|
+
defaultValues: y
|
|
3298
3324
|
});
|
|
3299
|
-
|
|
3300
|
-
!a && s && s.length === 0 && !d && !i && (u(!0),
|
|
3301
|
-
}, [a, s, d, i,
|
|
3302
|
-
const
|
|
3325
|
+
ie.useEffect(() => {
|
|
3326
|
+
!a && s && s.length === 0 && !d && !i && (u(!0), c({ applicantId: t, criteriaValueInputs: [] }).then(() => e == null ? void 0 : e()).catch(console.error));
|
|
3327
|
+
}, [a, s, d, i, c, t, e]);
|
|
3328
|
+
const f = async (h) => {
|
|
3303
3329
|
if (s)
|
|
3304
3330
|
try {
|
|
3305
|
-
console.log("Risk scoring form submitted:",
|
|
3306
|
-
const
|
|
3307
|
-
const
|
|
3308
|
-
return
|
|
3309
|
-
riskCriteriaId: s[
|
|
3310
|
-
values:
|
|
3331
|
+
console.log("Risk scoring form submitted:", h), console.log("Criteria metadata:", s);
|
|
3332
|
+
const A = h.criteriaValueInputs.map((S, I) => {
|
|
3333
|
+
const P = S.values || [], C = Array.isArray(P) ? P.filter((E) => E && E.trim()) : P && P.toString().trim() ? [P.toString()] : [];
|
|
3334
|
+
return C.length === 0 ? null : {
|
|
3335
|
+
riskCriteriaId: s[I].id,
|
|
3336
|
+
values: C
|
|
3311
3337
|
};
|
|
3312
|
-
}).filter((
|
|
3313
|
-
console.log("Risk scoring criteriaValueInputs to submit:",
|
|
3314
|
-
const
|
|
3338
|
+
}).filter((S) => S !== null);
|
|
3339
|
+
console.log("Risk scoring criteriaValueInputs to submit:", A);
|
|
3340
|
+
const v = {
|
|
3315
3341
|
applicantId: t,
|
|
3316
|
-
criteriaValueInputs:
|
|
3342
|
+
criteriaValueInputs: A
|
|
3317
3343
|
};
|
|
3318
|
-
console.log("Final risk scoring input:",
|
|
3319
|
-
} catch (
|
|
3320
|
-
throw console.error("Error submitting risk scoring:",
|
|
3344
|
+
console.log("Final risk scoring input:", v), await c(v), console.log("Risk scoring submitted successfully!"), e == null || e();
|
|
3345
|
+
} catch (A) {
|
|
3346
|
+
throw console.error("Error submitting risk scoring:", A), A;
|
|
3321
3347
|
}
|
|
3322
|
-
},
|
|
3323
|
-
return a ? /* @__PURE__ */ n(
|
|
3324
|
-
/* @__PURE__ */ n(
|
|
3348
|
+
}, k = (h) => h.builtInType === 1 ? "country" : !h.defaultValues || h.defaultValues.length === 0 ? "text" : h.multipleValue ? "checkbox" : "radio";
|
|
3349
|
+
return a ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
|
|
3350
|
+
/* @__PURE__ */ n(ce, { className: "my-8" }),
|
|
3325
3351
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading risk scoring criteria..." })
|
|
3326
|
-
] }) }) :
|
|
3352
|
+
] }) }) : l ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
3327
3353
|
"Error loading criteria: ",
|
|
3328
|
-
|
|
3329
|
-
] }) }) }) : !a && s && s.length === 0 ? /* @__PURE__ */ n(
|
|
3330
|
-
/* @__PURE__ */ n(
|
|
3354
|
+
l.message
|
|
3355
|
+
] }) }) }) : !a && s && s.length === 0 ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
|
|
3356
|
+
/* @__PURE__ */ n(ce, { className: "my-8" }),
|
|
3331
3357
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400", children: "No risk scoring criteria required. Moving to next step..." })
|
|
3332
|
-
] }) }) : s ? /* @__PURE__ */ n("form", { onSubmit:
|
|
3333
|
-
/* @__PURE__ */ o(
|
|
3358
|
+
] }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: b(f), children: /* @__PURE__ */ o(L, { children: [
|
|
3359
|
+
/* @__PURE__ */ o(ee, { children: [
|
|
3334
3360
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Risk Assessment" }),
|
|
3335
3361
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please answer the following questions for risk evaluation" })
|
|
3336
3362
|
] }),
|
|
3337
|
-
/* @__PURE__ */ n(
|
|
3338
|
-
var
|
|
3339
|
-
const
|
|
3363
|
+
/* @__PURE__ */ n(T, { className: "space-y-8", children: s.map((h, A) => {
|
|
3364
|
+
var S, I, P;
|
|
3365
|
+
const v = k(h);
|
|
3340
3366
|
return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
3341
3367
|
/* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300", children: [
|
|
3342
|
-
|
|
3343
|
-
|
|
3368
|
+
h.displayName,
|
|
3369
|
+
h.isRequired && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
|
|
3344
3370
|
] }),
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3371
|
+
h.description && /* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: h.description }),
|
|
3372
|
+
v === "text" && /* @__PURE__ */ n(
|
|
3373
|
+
J,
|
|
3348
3374
|
{
|
|
3349
|
-
control:
|
|
3350
|
-
name: `criteriaValueInputs.${
|
|
3351
|
-
render: ({ field:
|
|
3352
|
-
var
|
|
3375
|
+
control: g,
|
|
3376
|
+
name: `criteriaValueInputs.${A}.values.0`,
|
|
3377
|
+
render: ({ field: C }) => {
|
|
3378
|
+
var E, M, B;
|
|
3353
3379
|
return /* @__PURE__ */ n(
|
|
3354
|
-
|
|
3380
|
+
X,
|
|
3355
3381
|
{
|
|
3356
|
-
...
|
|
3357
|
-
value:
|
|
3358
|
-
type:
|
|
3382
|
+
...C,
|
|
3383
|
+
value: C.value || "",
|
|
3384
|
+
type: h.valueDataType === Pe.DigitOnly ? "number" : "text",
|
|
3359
3385
|
placeholder: "Enter your answer...",
|
|
3360
|
-
error: (
|
|
3361
|
-
onKeyDown: (
|
|
3362
|
-
|
|
3386
|
+
error: (B = (M = (E = m.criteriaValueInputs) == null ? void 0 : E[A]) == null ? void 0 : M.values) == null ? void 0 : B.message,
|
|
3387
|
+
onKeyDown: (Q) => {
|
|
3388
|
+
h.valueDataType === Pe.DigitOnly && ["e", "E", "+", "-", "."].includes(Q.key) && Q.preventDefault();
|
|
3363
3389
|
}
|
|
3364
3390
|
}
|
|
3365
3391
|
);
|
|
3366
3392
|
}
|
|
3367
3393
|
}
|
|
3368
3394
|
),
|
|
3369
|
-
|
|
3395
|
+
v === "radio" && h.defaultValues && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
3370
3396
|
/* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: "Choose one option" }),
|
|
3371
3397
|
/* @__PURE__ */ n(
|
|
3372
|
-
|
|
3398
|
+
J,
|
|
3373
3399
|
{
|
|
3374
|
-
control:
|
|
3375
|
-
name: `criteriaValueInputs.${
|
|
3376
|
-
render: ({ field: { value:
|
|
3400
|
+
control: g,
|
|
3401
|
+
name: `criteriaValueInputs.${A}.values.0`,
|
|
3402
|
+
render: ({ field: { value: C, onChange: E } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: h.defaultValues.map((M, B) => /* @__PURE__ */ o("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
|
|
3377
3403
|
/* @__PURE__ */ n(
|
|
3378
3404
|
"input",
|
|
3379
3405
|
{
|
|
3380
3406
|
type: "radio",
|
|
3381
|
-
checked:
|
|
3382
|
-
onChange: () =>
|
|
3407
|
+
checked: C === M,
|
|
3408
|
+
onChange: () => E(M),
|
|
3383
3409
|
className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3384
3410
|
}
|
|
3385
3411
|
),
|
|
3386
|
-
/* @__PURE__ */ n("span", { className: "text-sm", children:
|
|
3387
|
-
] }, `${
|
|
3412
|
+
/* @__PURE__ */ n("span", { className: "text-sm", children: M })
|
|
3413
|
+
] }, `${A}-${B}`)) })
|
|
3388
3414
|
}
|
|
3389
3415
|
)
|
|
3390
3416
|
] }),
|
|
3391
|
-
|
|
3417
|
+
v === "checkbox" && h.defaultValues && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
3392
3418
|
/* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: "Choose one or more options" }),
|
|
3393
3419
|
/* @__PURE__ */ n(
|
|
3394
|
-
|
|
3420
|
+
J,
|
|
3395
3421
|
{
|
|
3396
|
-
control:
|
|
3397
|
-
name: `criteriaValueInputs.${
|
|
3398
|
-
render: ({ field: { value:
|
|
3422
|
+
control: g,
|
|
3423
|
+
name: `criteriaValueInputs.${A}.values`,
|
|
3424
|
+
render: ({ field: { value: C = [], onChange: E } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: h.defaultValues.map((M, B) => /* @__PURE__ */ o("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
|
|
3399
3425
|
/* @__PURE__ */ n(
|
|
3400
3426
|
"input",
|
|
3401
3427
|
{
|
|
3402
3428
|
type: "checkbox",
|
|
3403
|
-
checked: Array.isArray(
|
|
3404
|
-
onChange: (
|
|
3405
|
-
const
|
|
3406
|
-
|
|
3429
|
+
checked: Array.isArray(C) && C.includes(M),
|
|
3430
|
+
onChange: (Q) => {
|
|
3431
|
+
const _ = Array.isArray(C) ? C : [], p = Q.target.checked ? [..._, M] : _.filter((w) => w !== M);
|
|
3432
|
+
E(p);
|
|
3407
3433
|
},
|
|
3408
3434
|
className: "h-4 w-4 text-primary-500 rounded border-gray-300 focus:ring-primary-500"
|
|
3409
3435
|
}
|
|
3410
3436
|
),
|
|
3411
|
-
/* @__PURE__ */ n("span", { className: "text-sm", children:
|
|
3412
|
-
] }, `${
|
|
3437
|
+
/* @__PURE__ */ n("span", { className: "text-sm", children: M })
|
|
3438
|
+
] }, `${A}-${B}`)) })
|
|
3413
3439
|
}
|
|
3414
3440
|
)
|
|
3415
3441
|
] }),
|
|
3416
|
-
|
|
3417
|
-
|
|
3442
|
+
v === "country" && /* @__PURE__ */ n(
|
|
3443
|
+
J,
|
|
3418
3444
|
{
|
|
3419
|
-
control:
|
|
3420
|
-
name: `criteriaValueInputs.${
|
|
3421
|
-
render: ({ field:
|
|
3422
|
-
var
|
|
3445
|
+
control: g,
|
|
3446
|
+
name: `criteriaValueInputs.${A}.values.0`,
|
|
3447
|
+
render: ({ field: C }) => {
|
|
3448
|
+
var E, M, B;
|
|
3423
3449
|
return /* @__PURE__ */ n(
|
|
3424
|
-
|
|
3450
|
+
ye,
|
|
3425
3451
|
{
|
|
3426
|
-
...
|
|
3452
|
+
...C,
|
|
3427
3453
|
options: [
|
|
3428
3454
|
{ value: "US", label: "United States" },
|
|
3429
3455
|
{ value: "GB", label: "United Kingdom" },
|
|
@@ -3431,16 +3457,16 @@ const Vr = de.any(), vr = ({
|
|
|
3431
3457
|
// TODO: Load from base information service
|
|
3432
3458
|
],
|
|
3433
3459
|
placeholder: "Select a country...",
|
|
3434
|
-
error: (
|
|
3460
|
+
error: (B = (M = (E = m.criteriaValueInputs) == null ? void 0 : E[A]) == null ? void 0 : M.values) == null ? void 0 : B.message
|
|
3435
3461
|
}
|
|
3436
3462
|
);
|
|
3437
3463
|
}
|
|
3438
3464
|
}
|
|
3439
3465
|
),
|
|
3440
|
-
((
|
|
3441
|
-
] },
|
|
3466
|
+
((P = (I = (S = m.criteriaValueInputs) == null ? void 0 : S[A]) == null ? void 0 : I.values) == null ? void 0 : P.message) && /* @__PURE__ */ n("p", { className: "text-sm text-danger-500 mt-1", children: m.criteriaValueInputs[A].values.message })
|
|
3467
|
+
] }, h.id);
|
|
3442
3468
|
}) }),
|
|
3443
|
-
/* @__PURE__ */ o(
|
|
3469
|
+
/* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
|
|
3444
3470
|
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3445
3471
|
/* @__PURE__ */ n(
|
|
3446
3472
|
j,
|
|
@@ -3448,15 +3474,15 @@ const Vr = de.any(), vr = ({
|
|
|
3448
3474
|
type: "submit",
|
|
3449
3475
|
isLoading: i,
|
|
3450
3476
|
onClick: () => {
|
|
3451
|
-
console.log("Risk scoring submit button clicked"), console.log("Form errors:",
|
|
3477
|
+
console.log("Risk scoring submit button clicked"), console.log("Form errors:", m);
|
|
3452
3478
|
},
|
|
3453
3479
|
children: "Continue"
|
|
3454
3480
|
}
|
|
3455
3481
|
)
|
|
3456
3482
|
] }),
|
|
3457
|
-
|
|
3483
|
+
l && /* @__PURE__ */ n("div", { className: "mt-4 p-4 bg-red-50 border border-red-200 rounded", children: /* @__PURE__ */ o("p", { className: "text-red-600 text-sm", children: [
|
|
3458
3484
|
"Error: ",
|
|
3459
|
-
|
|
3485
|
+
l.message
|
|
3460
3486
|
] }) })
|
|
3461
3487
|
] }) }) : null;
|
|
3462
3488
|
}, Sr = ({
|
|
@@ -3464,39 +3490,39 @@ const Vr = de.any(), vr = ({
|
|
|
3464
3490
|
onComplete: e,
|
|
3465
3491
|
onBack: r
|
|
3466
3492
|
}) => {
|
|
3467
|
-
const { investorCategorizationService: s } =
|
|
3468
|
-
return /* @__PURE__ */ n("form", { onSubmit: async (
|
|
3469
|
-
if (
|
|
3493
|
+
const { investorCategorizationService: s } = se(), [a, i] = N(null), [l, c] = N(!1), [d, u] = N(null);
|
|
3494
|
+
return /* @__PURE__ */ n("form", { onSubmit: async (x) => {
|
|
3495
|
+
if (x.preventDefault(), a === null) {
|
|
3470
3496
|
u("Please select an investor type");
|
|
3471
3497
|
return;
|
|
3472
3498
|
}
|
|
3473
|
-
|
|
3499
|
+
c(!0), u(null);
|
|
3474
3500
|
try {
|
|
3475
|
-
const
|
|
3501
|
+
const g = {
|
|
3476
3502
|
applicantId: t,
|
|
3477
3503
|
investorType: a
|
|
3478
3504
|
};
|
|
3479
|
-
console.log("Submitting investor categorization:",
|
|
3480
|
-
const
|
|
3481
|
-
console.log("Investor categorization result:",
|
|
3482
|
-
} catch (
|
|
3483
|
-
console.error("Error submitting investor categorization:",
|
|
3505
|
+
console.log("Submitting investor categorization:", g);
|
|
3506
|
+
const b = await s.setInvestorCategorization(g);
|
|
3507
|
+
console.log("Investor categorization result:", b), e == null || e();
|
|
3508
|
+
} catch (g) {
|
|
3509
|
+
console.error("Error submitting investor categorization:", g), u(g.message || "Failed to submit investor categorization");
|
|
3484
3510
|
} finally {
|
|
3485
|
-
|
|
3511
|
+
c(!1);
|
|
3486
3512
|
}
|
|
3487
|
-
}, children: /* @__PURE__ */ o(
|
|
3488
|
-
/* @__PURE__ */ o(
|
|
3513
|
+
}, children: /* @__PURE__ */ o(L, { children: [
|
|
3514
|
+
/* @__PURE__ */ o(ee, { children: [
|
|
3489
3515
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Which statement best describes you?" }),
|
|
3490
3516
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-2", 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" })
|
|
3491
3517
|
] }),
|
|
3492
|
-
/* @__PURE__ */ o(
|
|
3518
|
+
/* @__PURE__ */ o(T, { className: "space-y-4", children: [
|
|
3493
3519
|
/* @__PURE__ */ n("p", { className: "text-sm font-medium text-gray-700 dark:text-gray-300 mb-3", children: "Choose one" }),
|
|
3494
3520
|
/* @__PURE__ */ n(
|
|
3495
3521
|
"label",
|
|
3496
3522
|
{
|
|
3497
3523
|
className: `
|
|
3498
3524
|
block p-4 border-2 rounded-lg cursor-pointer transition-all
|
|
3499
|
-
${a ===
|
|
3525
|
+
${a === re.Individual ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
|
|
3500
3526
|
`,
|
|
3501
3527
|
children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
|
|
3502
3528
|
/* @__PURE__ */ n(
|
|
@@ -3504,9 +3530,9 @@ const Vr = de.any(), vr = ({
|
|
|
3504
3530
|
{
|
|
3505
3531
|
type: "radio",
|
|
3506
3532
|
name: "investorType",
|
|
3507
|
-
value:
|
|
3508
|
-
checked: a ===
|
|
3509
|
-
onChange: () => i(
|
|
3533
|
+
value: re.Individual,
|
|
3534
|
+
checked: a === re.Individual,
|
|
3535
|
+
onChange: () => i(re.Individual),
|
|
3510
3536
|
className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3511
3537
|
}
|
|
3512
3538
|
),
|
|
@@ -3522,7 +3548,7 @@ const Vr = de.any(), vr = ({
|
|
|
3522
3548
|
{
|
|
3523
3549
|
className: `
|
|
3524
3550
|
block p-4 border-2 rounded-lg cursor-pointer transition-all
|
|
3525
|
-
${a ===
|
|
3551
|
+
${a === re.Sophisticated ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
|
|
3526
3552
|
`,
|
|
3527
3553
|
children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
|
|
3528
3554
|
/* @__PURE__ */ n(
|
|
@@ -3530,9 +3556,9 @@ const Vr = de.any(), vr = ({
|
|
|
3530
3556
|
{
|
|
3531
3557
|
type: "radio",
|
|
3532
3558
|
name: "investorType",
|
|
3533
|
-
value:
|
|
3534
|
-
checked: a ===
|
|
3535
|
-
onChange: () => i(
|
|
3559
|
+
value: re.Sophisticated,
|
|
3560
|
+
checked: a === re.Sophisticated,
|
|
3561
|
+
onChange: () => i(re.Sophisticated),
|
|
3536
3562
|
className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3537
3563
|
}
|
|
3538
3564
|
),
|
|
@@ -3553,7 +3579,7 @@ const Vr = de.any(), vr = ({
|
|
|
3553
3579
|
{
|
|
3554
3580
|
className: `
|
|
3555
3581
|
block p-4 border-2 rounded-lg cursor-pointer transition-all
|
|
3556
|
-
${a ===
|
|
3582
|
+
${a === re.HighNetWorth ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
|
|
3557
3583
|
`,
|
|
3558
3584
|
children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
|
|
3559
3585
|
/* @__PURE__ */ n(
|
|
@@ -3561,9 +3587,9 @@ const Vr = de.any(), vr = ({
|
|
|
3561
3587
|
{
|
|
3562
3588
|
type: "radio",
|
|
3563
3589
|
name: "investorType",
|
|
3564
|
-
value:
|
|
3565
|
-
checked: a ===
|
|
3566
|
-
onChange: () => i(
|
|
3590
|
+
value: re.HighNetWorth,
|
|
3591
|
+
checked: a === re.HighNetWorth,
|
|
3592
|
+
onChange: () => i(re.HighNetWorth),
|
|
3567
3593
|
className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3568
3594
|
}
|
|
3569
3595
|
),
|
|
@@ -3584,13 +3610,13 @@ const Vr = de.any(), vr = ({
|
|
|
3584
3610
|
d
|
|
3585
3611
|
] }) })
|
|
3586
3612
|
] }),
|
|
3587
|
-
/* @__PURE__ */ o(
|
|
3613
|
+
/* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
|
|
3588
3614
|
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3589
3615
|
/* @__PURE__ */ n(
|
|
3590
3616
|
j,
|
|
3591
3617
|
{
|
|
3592
3618
|
type: "submit",
|
|
3593
|
-
isLoading:
|
|
3619
|
+
isLoading: l,
|
|
3594
3620
|
disabled: a === null,
|
|
3595
3621
|
children: "Submit"
|
|
3596
3622
|
}
|
|
@@ -3602,135 +3628,135 @@ const Vr = de.any(), vr = ({
|
|
|
3602
3628
|
onComplete: e,
|
|
3603
3629
|
onBack: r
|
|
3604
3630
|
}) => {
|
|
3605
|
-
const { appropriatenessTestService: s } =
|
|
3606
|
-
|
|
3631
|
+
const { appropriatenessTestService: s } = se(), [a, i] = N(null), [l, c] = N(!0), [d, u] = N(!1), [y, x] = N(null), [g, b] = N({}), [m, f] = N(0), [k, h] = N(!1), [A, v] = N(!1), [S, I] = N(0);
|
|
3632
|
+
Y(() => {
|
|
3607
3633
|
(async () => {
|
|
3608
3634
|
try {
|
|
3609
|
-
|
|
3610
|
-
const
|
|
3611
|
-
if (console.log("Appropriateness test data:",
|
|
3612
|
-
const
|
|
3613
|
-
|
|
3635
|
+
c(!0), x(null), console.log("Loading appropriateness test for applicant:", t);
|
|
3636
|
+
const w = await s.getAppropriatenessTest(t);
|
|
3637
|
+
if (console.log("Appropriateness test data:", w), i(w), w.waitTimeSpanForNextTry && w.waitTimeSpanForNextTry !== "00:00:00") {
|
|
3638
|
+
const O = P(w.waitTimeSpanForNextTry);
|
|
3639
|
+
O > 0 && I(O);
|
|
3614
3640
|
}
|
|
3615
|
-
} catch (
|
|
3616
|
-
console.error("Error loading appropriateness test:",
|
|
3641
|
+
} catch (w) {
|
|
3642
|
+
console.error("Error loading appropriateness test:", w), x(w.message || "Failed to load appropriateness test");
|
|
3617
3643
|
} finally {
|
|
3618
|
-
|
|
3644
|
+
c(!1);
|
|
3619
3645
|
}
|
|
3620
3646
|
})();
|
|
3621
3647
|
}, [t, s]);
|
|
3622
|
-
const
|
|
3623
|
-
const
|
|
3624
|
-
if (
|
|
3625
|
-
const [
|
|
3626
|
-
return
|
|
3648
|
+
const P = (p) => {
|
|
3649
|
+
const w = p.split(":").map(Number);
|
|
3650
|
+
if (w.length === 3) {
|
|
3651
|
+
const [O, z, R] = w;
|
|
3652
|
+
return O * 3600 + z * 60 + R;
|
|
3627
3653
|
}
|
|
3628
3654
|
return 0;
|
|
3629
|
-
},
|
|
3630
|
-
const
|
|
3631
|
-
return `${
|
|
3655
|
+
}, C = (p) => {
|
|
3656
|
+
const w = Math.floor(p / 60), O = p % 60;
|
|
3657
|
+
return `${w.toString().padStart(2, "0")}:${O.toString().padStart(2, "0")}`;
|
|
3632
3658
|
};
|
|
3633
|
-
|
|
3634
|
-
if (!
|
|
3635
|
-
const
|
|
3636
|
-
|
|
3659
|
+
Y(() => {
|
|
3660
|
+
if (!k || m <= 0) return;
|
|
3661
|
+
const p = setInterval(() => {
|
|
3662
|
+
f((w) => w <= 1 ? (v(!0), 0) : w - 1);
|
|
3637
3663
|
}, 1e3);
|
|
3638
|
-
return () => clearInterval(
|
|
3639
|
-
}, [
|
|
3640
|
-
if (
|
|
3641
|
-
const
|
|
3642
|
-
|
|
3664
|
+
return () => clearInterval(p);
|
|
3665
|
+
}, [k, m]), Y(() => {
|
|
3666
|
+
if (S <= 0) return;
|
|
3667
|
+
const p = setInterval(() => {
|
|
3668
|
+
I((w) => w <= 1 ? 0 : w - 1);
|
|
3643
3669
|
}, 1e3);
|
|
3644
|
-
return () => clearInterval(
|
|
3645
|
-
}, [
|
|
3646
|
-
|
|
3647
|
-
}, [
|
|
3648
|
-
const
|
|
3649
|
-
a && (
|
|
3650
|
-
},
|
|
3651
|
-
|
|
3652
|
-
...
|
|
3653
|
-
[
|
|
3670
|
+
return () => clearInterval(p);
|
|
3671
|
+
}, [S]), Y(() => {
|
|
3672
|
+
A && !d && B();
|
|
3673
|
+
}, [A]);
|
|
3674
|
+
const E = () => {
|
|
3675
|
+
a && (h(!0), f(a.testDurationSec));
|
|
3676
|
+
}, M = (p, w) => {
|
|
3677
|
+
b((O) => ({
|
|
3678
|
+
...O,
|
|
3679
|
+
[p]: w
|
|
3654
3680
|
}));
|
|
3655
|
-
},
|
|
3656
|
-
if (
|
|
3657
|
-
if (!
|
|
3658
|
-
const
|
|
3659
|
-
if (
|
|
3660
|
-
|
|
3681
|
+
}, B = async (p) => {
|
|
3682
|
+
if (p && p.preventDefault(), !!a) {
|
|
3683
|
+
if (!A) {
|
|
3684
|
+
const w = a.appropriatenessQuestions.length - Object.keys(g).length;
|
|
3685
|
+
if (w > 0) {
|
|
3686
|
+
x(`Please answer all questions. ${w} question(s) remaining.`);
|
|
3661
3687
|
return;
|
|
3662
3688
|
}
|
|
3663
3689
|
}
|
|
3664
|
-
u(!0),
|
|
3690
|
+
u(!0), x(null);
|
|
3665
3691
|
try {
|
|
3666
|
-
const
|
|
3667
|
-
(
|
|
3668
|
-
appropriatenessQuestionId:
|
|
3669
|
-
value:
|
|
3692
|
+
const w = a.appropriatenessQuestions.map(
|
|
3693
|
+
(z) => ({
|
|
3694
|
+
appropriatenessQuestionId: z.id,
|
|
3695
|
+
value: g[z.id] || ""
|
|
3670
3696
|
// Empty string if not answered
|
|
3671
3697
|
})
|
|
3672
|
-
),
|
|
3698
|
+
), O = {
|
|
3673
3699
|
applicantId: t,
|
|
3674
3700
|
appropriatenessTestId: a.id,
|
|
3675
|
-
appropriatenessQuestionResults:
|
|
3701
|
+
appropriatenessQuestionResults: w
|
|
3676
3702
|
};
|
|
3677
|
-
console.log("Submitting appropriateness test:",
|
|
3703
|
+
console.log("Submitting appropriateness test:", O);
|
|
3678
3704
|
try {
|
|
3679
|
-
const
|
|
3680
|
-
console.log("Appropriateness test result:",
|
|
3681
|
-
} catch (
|
|
3682
|
-
if (
|
|
3683
|
-
const
|
|
3684
|
-
console.log("Test failed:",
|
|
3705
|
+
const z = await s.fillAppropriatenessTest(O);
|
|
3706
|
+
console.log("Appropriateness test result:", z), z.message && (z.message.toLowerCase().includes("pass") || z.message.toLowerCase().includes("success") || z.message.toLowerCase().includes("congratulations")) ? e == null || e() : (x(z.message || "Test completed. Please check the result."), h(!1), v(!1), b({}), setTimeout(() => Q(), 1e3));
|
|
3707
|
+
} catch (z) {
|
|
3708
|
+
if (z.code === 400 && z.message) {
|
|
3709
|
+
const R = z.message;
|
|
3710
|
+
console.log("Test failed:", R), x(R), h(!1), v(!1), b({}), setTimeout(() => Q(), 1500);
|
|
3685
3711
|
} else
|
|
3686
|
-
throw
|
|
3712
|
+
throw z;
|
|
3687
3713
|
}
|
|
3688
|
-
} catch (
|
|
3689
|
-
console.error("Error submitting appropriateness test:",
|
|
3714
|
+
} catch (w) {
|
|
3715
|
+
console.error("Error submitting appropriateness test:", w), x(w.message || "Failed to submit test. Please try again."), h(!1), v(!1), b({});
|
|
3690
3716
|
} finally {
|
|
3691
3717
|
u(!1);
|
|
3692
3718
|
}
|
|
3693
3719
|
}
|
|
3694
|
-
},
|
|
3720
|
+
}, Q = async () => {
|
|
3695
3721
|
try {
|
|
3696
|
-
const
|
|
3697
|
-
if (console.log("Reloaded test data:",
|
|
3698
|
-
const
|
|
3699
|
-
|
|
3722
|
+
const p = await s.getAppropriatenessTest(t);
|
|
3723
|
+
if (console.log("Reloaded test data:", p), i(p), p.waitTimeSpanForNextTry && p.waitTimeSpanForNextTry !== "00:00:00") {
|
|
3724
|
+
const w = P(p.waitTimeSpanForNextTry);
|
|
3725
|
+
w > 0 && I(w);
|
|
3700
3726
|
}
|
|
3701
|
-
} catch (
|
|
3702
|
-
console.error("Error reloading test data:",
|
|
3727
|
+
} catch (p) {
|
|
3728
|
+
console.error("Error reloading test data:", p), x((w) => w + `
|
|
3703
3729
|
|
|
3704
3730
|
Failed to reload test data. Please refresh the page.`);
|
|
3705
3731
|
}
|
|
3706
3732
|
};
|
|
3707
|
-
if (
|
|
3708
|
-
return /* @__PURE__ */ n(
|
|
3709
|
-
/* @__PURE__ */ n(
|
|
3733
|
+
if (l)
|
|
3734
|
+
return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
|
|
3735
|
+
/* @__PURE__ */ n(ce, { className: "my-8" }),
|
|
3710
3736
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading appropriateness test..." })
|
|
3711
3737
|
] }) });
|
|
3712
3738
|
if (!a)
|
|
3713
|
-
return /* @__PURE__ */ n(
|
|
3739
|
+
return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { className: "py-12 text-center", children: [
|
|
3714
3740
|
/* @__PURE__ */ n("p", { className: "text-danger-500 text-lg mb-4", children: "No test data available" }),
|
|
3715
|
-
|
|
3741
|
+
y && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: y })
|
|
3716
3742
|
] }) });
|
|
3717
|
-
if (
|
|
3718
|
-
return /* @__PURE__ */ o(
|
|
3719
|
-
/* @__PURE__ */ o(
|
|
3743
|
+
if (S > 0)
|
|
3744
|
+
return /* @__PURE__ */ o(L, { children: [
|
|
3745
|
+
/* @__PURE__ */ o(ee, { children: [
|
|
3720
3746
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: a.displayName }),
|
|
3721
3747
|
a.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: a.subtitle })
|
|
3722
3748
|
] }),
|
|
3723
|
-
/* @__PURE__ */ o(
|
|
3749
|
+
/* @__PURE__ */ o(T, { className: "py-12 text-center", children: [
|
|
3724
3750
|
/* @__PURE__ */ o("div", { className: "mb-6", children: [
|
|
3725
|
-
/* @__PURE__ */ n("div", { className: "text-6xl font-bold text-primary-500 mb-2", children:
|
|
3751
|
+
/* @__PURE__ */ n("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: C(S) }),
|
|
3726
3752
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait before attempting the test again" })
|
|
3727
3753
|
] }),
|
|
3728
|
-
|
|
3754
|
+
y && /* @__PURE__ */ n("div", { className: "mt-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ n("p", { className: "text-red-600 dark:text-red-400 text-sm", children: y }) })
|
|
3729
3755
|
] })
|
|
3730
3756
|
] });
|
|
3731
|
-
const
|
|
3732
|
-
return
|
|
3733
|
-
/* @__PURE__ */ n(
|
|
3757
|
+
const _ = a.testAllowedMaxTry - a.totalFailedTries;
|
|
3758
|
+
return k ? /* @__PURE__ */ n("form", { onSubmit: B, children: /* @__PURE__ */ o(L, { children: [
|
|
3759
|
+
/* @__PURE__ */ n(ee, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
|
|
3734
3760
|
/* @__PURE__ */ o("div", { children: [
|
|
3735
3761
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: a.displayName }),
|
|
3736
3762
|
a.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.subtitle })
|
|
@@ -3739,29 +3765,29 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3739
3765
|
/* @__PURE__ */ n(
|
|
3740
3766
|
"div",
|
|
3741
3767
|
{
|
|
3742
|
-
className: `text-3xl font-bold ${
|
|
3743
|
-
children:
|
|
3768
|
+
className: `text-3xl font-bold ${m <= 60 ? "text-danger-500" : "text-primary-500"}`,
|
|
3769
|
+
children: C(m)
|
|
3744
3770
|
}
|
|
3745
3771
|
),
|
|
3746
3772
|
/* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Time Remaining" })
|
|
3747
3773
|
] })
|
|
3748
3774
|
] }) }),
|
|
3749
|
-
/* @__PURE__ */ o(
|
|
3775
|
+
/* @__PURE__ */ o(T, { className: "space-y-6", children: [
|
|
3750
3776
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between mb-4", children: [
|
|
3751
|
-
/* @__PURE__ */ o(
|
|
3777
|
+
/* @__PURE__ */ o(he, { variant: "info", children: [
|
|
3752
3778
|
"Question ",
|
|
3753
|
-
Object.keys(
|
|
3779
|
+
Object.keys(g).length,
|
|
3754
3780
|
" of ",
|
|
3755
3781
|
a.totalQuestionCount
|
|
3756
3782
|
] }),
|
|
3757
|
-
/* @__PURE__ */ o(
|
|
3758
|
-
|
|
3783
|
+
/* @__PURE__ */ o(he, { variant: _ > 1 ? "success" : "warning", children: [
|
|
3784
|
+
_,
|
|
3759
3785
|
" attempt",
|
|
3760
|
-
|
|
3786
|
+
_ !== 1 ? "s" : "",
|
|
3761
3787
|
" remaining"
|
|
3762
3788
|
] })
|
|
3763
3789
|
] }),
|
|
3764
|
-
a.appropriatenessQuestions.map((
|
|
3790
|
+
a.appropriatenessQuestions.map((p, w) => /* @__PURE__ */ o(
|
|
3765
3791
|
"div",
|
|
3766
3792
|
{
|
|
3767
3793
|
className: "p-4 border border-gray-200 dark:border-gray-700 rounded-lg",
|
|
@@ -3769,51 +3795,51 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3769
3795
|
/* @__PURE__ */ o("div", { className: "mb-4", children: [
|
|
3770
3796
|
/* @__PURE__ */ o("span", { className: "inline-block px-2 py-1 text-xs font-semibold text-primary-700 bg-primary-100 dark:text-primary-300 dark:bg-primary-900/30 rounded mb-2", children: [
|
|
3771
3797
|
"Question ",
|
|
3772
|
-
|
|
3798
|
+
w + 1
|
|
3773
3799
|
] }),
|
|
3774
|
-
|
|
3775
|
-
/* @__PURE__ */ n("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children:
|
|
3800
|
+
p.groupName && /* @__PURE__ */ n("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: p.groupName }),
|
|
3801
|
+
/* @__PURE__ */ n("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children: p.question })
|
|
3776
3802
|
] }),
|
|
3777
|
-
/* @__PURE__ */ n("div", { className: "space-y-2", children:
|
|
3803
|
+
/* @__PURE__ */ n("div", { className: "space-y-2", children: p.answers.map((O, z) => /* @__PURE__ */ o(
|
|
3778
3804
|
"label",
|
|
3779
3805
|
{
|
|
3780
3806
|
className: `
|
|
3781
3807
|
flex items-center p-3 border-2 rounded-lg cursor-pointer transition-all
|
|
3782
|
-
${
|
|
3808
|
+
${g[p.id] === O ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
|
|
3783
3809
|
`,
|
|
3784
3810
|
children: [
|
|
3785
3811
|
/* @__PURE__ */ n(
|
|
3786
3812
|
"input",
|
|
3787
3813
|
{
|
|
3788
3814
|
type: "radio",
|
|
3789
|
-
name: `question-${
|
|
3790
|
-
value:
|
|
3791
|
-
checked:
|
|
3792
|
-
onChange: (
|
|
3815
|
+
name: `question-${p.id}`,
|
|
3816
|
+
value: O,
|
|
3817
|
+
checked: g[p.id] === O,
|
|
3818
|
+
onChange: (R) => M(p.id, R.target.value),
|
|
3793
3819
|
className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500",
|
|
3794
3820
|
disabled: d
|
|
3795
3821
|
}
|
|
3796
3822
|
),
|
|
3797
|
-
/* @__PURE__ */ n("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children:
|
|
3823
|
+
/* @__PURE__ */ n("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children: O })
|
|
3798
3824
|
]
|
|
3799
3825
|
},
|
|
3800
|
-
|
|
3826
|
+
z
|
|
3801
3827
|
)) })
|
|
3802
3828
|
]
|
|
3803
3829
|
},
|
|
3804
|
-
|
|
3830
|
+
p.id
|
|
3805
3831
|
)),
|
|
3806
|
-
|
|
3832
|
+
y && !A && /* @__PURE__ */ n("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
|
|
3807
3833
|
/* @__PURE__ */ n("strong", { children: "Error:" }),
|
|
3808
3834
|
" ",
|
|
3809
|
-
|
|
3835
|
+
y
|
|
3810
3836
|
] }) }),
|
|
3811
|
-
|
|
3837
|
+
A && /* @__PURE__ */ n("div", { className: "p-4 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-700 dark:text-yellow-400 text-sm", children: [
|
|
3812
3838
|
/* @__PURE__ */ n("strong", { children: "Time's up!" }),
|
|
3813
3839
|
" Your answers are being submitted automatically."
|
|
3814
3840
|
] }) })
|
|
3815
3841
|
] }),
|
|
3816
|
-
/* @__PURE__ */ o(
|
|
3842
|
+
/* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
|
|
3817
3843
|
/* @__PURE__ */ n(
|
|
3818
3844
|
j,
|
|
3819
3845
|
{
|
|
@@ -3829,51 +3855,51 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3829
3855
|
{
|
|
3830
3856
|
type: "submit",
|
|
3831
3857
|
isLoading: d,
|
|
3832
|
-
disabled: Object.keys(
|
|
3833
|
-
children:
|
|
3858
|
+
disabled: Object.keys(g).length < a.totalQuestionCount,
|
|
3859
|
+
children: A ? "Submitting..." : "Submit Test"
|
|
3834
3860
|
}
|
|
3835
3861
|
)
|
|
3836
3862
|
] })
|
|
3837
|
-
] }) }) : /* @__PURE__ */ o(
|
|
3838
|
-
/* @__PURE__ */ o(
|
|
3863
|
+
] }) }) : /* @__PURE__ */ o(L, { children: [
|
|
3864
|
+
/* @__PURE__ */ o(ee, { children: [
|
|
3839
3865
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: a.displayName }),
|
|
3840
3866
|
a.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: a.subtitle })
|
|
3841
3867
|
] }),
|
|
3842
|
-
/* @__PURE__ */ o(
|
|
3868
|
+
/* @__PURE__ */ o(T, { children: [
|
|
3843
3869
|
a.description && /* @__PURE__ */ n("div", { className: "mb-6 p-4 bg-gray-50 dark:bg-gray-800 rounded-lg", children: /* @__PURE__ */ n("p", { className: "text-gray-700 dark:text-gray-300", children: a.description }) }),
|
|
3844
3870
|
/* @__PURE__ */ o("div", { className: "space-y-4 mb-6", children: [
|
|
3845
3871
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
3846
3872
|
/* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Total Questions:" }),
|
|
3847
|
-
/* @__PURE__ */ n(
|
|
3873
|
+
/* @__PURE__ */ n(he, { variant: "info", children: a.totalQuestionCount })
|
|
3848
3874
|
] }),
|
|
3849
3875
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
3850
3876
|
/* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Time Limit:" }),
|
|
3851
|
-
/* @__PURE__ */ n(
|
|
3877
|
+
/* @__PURE__ */ n(he, { variant: "info", children: C(a.testDurationSec) })
|
|
3852
3878
|
] }),
|
|
3853
3879
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
3854
3880
|
/* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Correct Answers Required:" }),
|
|
3855
|
-
/* @__PURE__ */ n(
|
|
3881
|
+
/* @__PURE__ */ n(he, { variant: "info", children: a.testCorrectAnswerPassLimit })
|
|
3856
3882
|
] }),
|
|
3857
3883
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
3858
3884
|
/* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Attempts Remaining:" }),
|
|
3859
|
-
/* @__PURE__ */ n(
|
|
3885
|
+
/* @__PURE__ */ n(he, { variant: _ > 1 ? "success" : "warning", children: _ })
|
|
3860
3886
|
] })
|
|
3861
3887
|
] }),
|
|
3862
|
-
|
|
3888
|
+
y && /* @__PURE__ */ n("div", { className: "mb-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
|
|
3863
3889
|
/* @__PURE__ */ n("strong", { children: "Previous Attempt:" }),
|
|
3864
3890
|
" ",
|
|
3865
|
-
|
|
3891
|
+
y
|
|
3866
3892
|
] }) }),
|
|
3867
|
-
|
|
3893
|
+
_ <= 0 && /* @__PURE__ */ n("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ n("p", { className: "text-red-600 dark:text-red-400", children: "You have used all your attempts. Please contact support for assistance." }) })
|
|
3868
3894
|
] }),
|
|
3869
|
-
/* @__PURE__ */ o(
|
|
3895
|
+
/* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
|
|
3870
3896
|
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3871
3897
|
/* @__PURE__ */ n(
|
|
3872
3898
|
j,
|
|
3873
3899
|
{
|
|
3874
3900
|
type: "button",
|
|
3875
|
-
onClick:
|
|
3876
|
-
disabled:
|
|
3901
|
+
onClick: E,
|
|
3902
|
+
disabled: _ <= 0,
|
|
3877
3903
|
children: "Start Test"
|
|
3878
3904
|
}
|
|
3879
3905
|
)
|
|
@@ -3884,8 +3910,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3884
3910
|
onComplete: e,
|
|
3885
3911
|
onBack: r
|
|
3886
3912
|
}) => {
|
|
3887
|
-
var
|
|
3888
|
-
const { applicantService: s, baseInformationService: a, config: i } =
|
|
3913
|
+
var O, z, R, we;
|
|
3914
|
+
const { applicantService: s, baseInformationService: a, config: i } = se(), { identityData: l, provider: c, token: d, isLoading: u, error: y, requestIdentity: x, restartIdentity: g } = er(t), [b, m] = N(null), [f, k] = N(null), [h, A] = N([]), [v, S] = N(!0), [I, P] = N(!1), [C, E] = N(null), [M, B] = N(!1), Q = ie.useRef(!1), _ = Te({
|
|
3889
3915
|
defaultValues: {
|
|
3890
3916
|
street: "",
|
|
3891
3917
|
streetNumber: "",
|
|
@@ -3896,21 +3922,21 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3896
3922
|
phonenumber: ""
|
|
3897
3923
|
}
|
|
3898
3924
|
});
|
|
3899
|
-
|
|
3925
|
+
Y(() => {
|
|
3900
3926
|
(async () => {
|
|
3901
3927
|
try {
|
|
3902
|
-
const [D,
|
|
3928
|
+
const [D, G] = await Promise.all([
|
|
3903
3929
|
s.getApplicantData(t),
|
|
3904
3930
|
a.getCountries("", "en")
|
|
3905
3931
|
]);
|
|
3906
|
-
|
|
3907
|
-
const
|
|
3908
|
-
const
|
|
3909
|
-
return !
|
|
3932
|
+
k(D);
|
|
3933
|
+
const V = /* @__PURE__ */ new Set(), ae = G.filter((me) => {
|
|
3934
|
+
const Ae = me.abbreviation3 || me.abbreviation;
|
|
3935
|
+
return !Ae || V.has(Ae) ? !1 : (V.add(Ae), !0);
|
|
3910
3936
|
});
|
|
3911
|
-
|
|
3937
|
+
A(ae);
|
|
3912
3938
|
const $ = D.applicantRequestData;
|
|
3913
|
-
if (
|
|
3939
|
+
if (_.reset({
|
|
3914
3940
|
street: ($ == null ? void 0 : $.street) || "",
|
|
3915
3941
|
streetNumber: ($ == null ? void 0 : $.streetNumber) || "",
|
|
3916
3942
|
city: ($ == null ? void 0 : $.city) || "",
|
|
@@ -3918,28 +3944,28 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3918
3944
|
country: ($ == null ? void 0 : $.country) || "",
|
|
3919
3945
|
nationality: ($ == null ? void 0 : $.nationality) || "",
|
|
3920
3946
|
phonenumber: ($ == null ? void 0 : $.phonenumber) || ""
|
|
3921
|
-
}), D.kycRecords && D.kycRecords.length > 0 && D.kycRecords[0].providerTokenObject !== null && !
|
|
3922
|
-
console.log("[Identity] Found existing identity verification, auto-requesting..."),
|
|
3947
|
+
}), D.kycRecords && D.kycRecords.length > 0 && D.kycRecords[0].providerTokenObject !== null && !Q.current) {
|
|
3948
|
+
console.log("[Identity] Found existing identity verification, auto-requesting..."), Q.current = !0;
|
|
3923
3949
|
try {
|
|
3924
|
-
await
|
|
3925
|
-
} catch (
|
|
3926
|
-
console.error("[Identity] Auto-request failed:",
|
|
3950
|
+
await x(), P(!0);
|
|
3951
|
+
} catch (me) {
|
|
3952
|
+
console.error("[Identity] Auto-request failed:", me);
|
|
3927
3953
|
}
|
|
3928
3954
|
}
|
|
3929
3955
|
} catch (D) {
|
|
3930
3956
|
console.error("Error loading applicant data:", D);
|
|
3931
3957
|
} finally {
|
|
3932
|
-
|
|
3958
|
+
S(!1);
|
|
3933
3959
|
}
|
|
3934
3960
|
})();
|
|
3935
|
-
}, [t]),
|
|
3936
|
-
|
|
3937
|
-
}, [
|
|
3961
|
+
}, [t]), Y(() => {
|
|
3962
|
+
l && !I && (console.log("[Identity] Identity data already loaded, showing provider"), P(!0));
|
|
3963
|
+
}, [l, I]), Y(() => {
|
|
3938
3964
|
if (d) {
|
|
3939
3965
|
if (d.expiresAt) {
|
|
3940
|
-
const
|
|
3941
|
-
if (Date.now() >=
|
|
3942
|
-
console.warn("[Identity] Token has expired (expiresAt)"),
|
|
3966
|
+
const F = new Date(d.expiresAt).getTime();
|
|
3967
|
+
if (Date.now() >= F) {
|
|
3968
|
+
console.warn("[Identity] Token has expired (expiresAt)"), B(!0), E("Your verification session has expired. Please restart.");
|
|
3943
3969
|
return;
|
|
3944
3970
|
}
|
|
3945
3971
|
}
|
|
@@ -3947,112 +3973,112 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3947
3973
|
try {
|
|
3948
3974
|
const D = new URL(d.url).toString().toLowerCase();
|
|
3949
3975
|
if (D.includes("expired") || D.includes("invalid") || D.includes("error")) {
|
|
3950
|
-
console.warn("[Identity] Token URL indicates expiration"),
|
|
3976
|
+
console.warn("[Identity] Token URL indicates expiration"), B(!0), E("Your verification link has expired. Please restart.");
|
|
3951
3977
|
return;
|
|
3952
3978
|
}
|
|
3953
3979
|
} catch {
|
|
3954
3980
|
console.error("[Identity] Invalid token URL");
|
|
3955
3981
|
}
|
|
3956
3982
|
if (d.status === "expired" || d.error === "expired" || d.expired === !0) {
|
|
3957
|
-
console.warn("[Identity] Token object indicates expiration"),
|
|
3983
|
+
console.warn("[Identity] Token object indicates expiration"), B(!0), E("Your verification session has expired. Please restart.");
|
|
3958
3984
|
return;
|
|
3959
3985
|
}
|
|
3960
3986
|
}
|
|
3961
|
-
}, [d]),
|
|
3962
|
-
if (
|
|
3963
|
-
const
|
|
3987
|
+
}, [d]), Y(() => {
|
|
3988
|
+
if (c !== null && d && !b && I && !M) {
|
|
3989
|
+
const F = c;
|
|
3964
3990
|
if (d.url) {
|
|
3965
|
-
console.log("[Identity] Loading provider URL for user verification:", d.url),
|
|
3991
|
+
console.log("[Identity] Loading provider URL for user verification:", d.url), E(null);
|
|
3966
3992
|
try {
|
|
3967
|
-
if (new URL(d.url),
|
|
3993
|
+
if (new URL(d.url), F === oe.SardinAI) {
|
|
3968
3994
|
console.log("[SardinAI] Initializing Risk SDK in background...");
|
|
3969
3995
|
try {
|
|
3970
|
-
const D =
|
|
3971
|
-
|
|
3996
|
+
const D = fe.parseProviderConfig(c, d, i);
|
|
3997
|
+
fe.createProvider(c, D).initialize().then(() => {
|
|
3972
3998
|
console.log("[SardinAI] Risk SDK initialized successfully in background");
|
|
3973
|
-
}).catch((
|
|
3974
|
-
console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):",
|
|
3999
|
+
}).catch((V) => {
|
|
4000
|
+
console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):", V);
|
|
3975
4001
|
});
|
|
3976
4002
|
} catch (D) {
|
|
3977
4003
|
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", D);
|
|
3978
4004
|
}
|
|
3979
4005
|
}
|
|
3980
|
-
|
|
4006
|
+
m({ type: "url", url: d.url });
|
|
3981
4007
|
} catch (D) {
|
|
3982
|
-
console.error("[Identity] Invalid URL:", D),
|
|
4008
|
+
console.error("[Identity] Invalid URL:", D), E("Invalid verification URL. Please restart."), B(!0);
|
|
3983
4009
|
}
|
|
3984
4010
|
return;
|
|
3985
4011
|
}
|
|
3986
|
-
if (
|
|
3987
|
-
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."),
|
|
4012
|
+
if (F === oe.SardinAI) {
|
|
4013
|
+
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), E(null);
|
|
3988
4014
|
try {
|
|
3989
|
-
const D =
|
|
3990
|
-
|
|
3991
|
-
console.log("[SardinAI] Risk SDK initialized successfully"),
|
|
4015
|
+
const D = fe.parseProviderConfig(c, d, i), G = fe.createProvider(c, D);
|
|
4016
|
+
G.initialize().then(() => {
|
|
4017
|
+
console.log("[SardinAI] Risk SDK initialized successfully"), m(G), setTimeout(() => {
|
|
3992
4018
|
e == null || e();
|
|
3993
4019
|
}, 2e3);
|
|
3994
|
-
}).catch((
|
|
4020
|
+
}).catch((V) => {
|
|
3995
4021
|
var $;
|
|
3996
|
-
console.error("[SardinAI] Failed to initialize:",
|
|
3997
|
-
const
|
|
3998
|
-
|
|
4022
|
+
console.error("[SardinAI] Failed to initialize:", V);
|
|
4023
|
+
const ae = (($ = V.message) == null ? void 0 : $.toLowerCase()) || "";
|
|
4024
|
+
ae.includes("expired") || ae.includes("invalid") || ae.includes("401") || ae.includes("400") ? (B(!0), E("Session expired or invalid. Please restart verification.")) : E(`Failed to initialize: ${V.message}`);
|
|
3999
4025
|
});
|
|
4000
4026
|
} catch (D) {
|
|
4001
|
-
console.error("[SardinAI] Error creating provider:", D),
|
|
4027
|
+
console.error("[SardinAI] Error creating provider:", D), E(`Configuration error: ${D.message}`);
|
|
4002
4028
|
}
|
|
4003
4029
|
return;
|
|
4004
4030
|
}
|
|
4005
4031
|
try {
|
|
4006
|
-
|
|
4007
|
-
const D =
|
|
4008
|
-
|
|
4009
|
-
var
|
|
4010
|
-
console.error("[Sumsub] Initialization error:",
|
|
4011
|
-
}),
|
|
4032
|
+
E(null);
|
|
4033
|
+
const D = fe.parseProviderConfig(c, d, i), G = fe.createProvider(c, D);
|
|
4034
|
+
F === oe.Sumsub ? (G.initialize("identity-container").catch((V) => {
|
|
4035
|
+
var ae;
|
|
4036
|
+
console.error("[Sumsub] Initialization error:", V), E(`Failed to initialize: ${V.message}`), (ae = V.message) != null && ae.toLowerCase().includes("expired") && B(!0);
|
|
4037
|
+
}), G.onComplete && G.onComplete(() => {
|
|
4012
4038
|
e == null || e();
|
|
4013
|
-
})) :
|
|
4014
|
-
console.error("[Onfido] Initialization error:",
|
|
4015
|
-
}),
|
|
4039
|
+
})) : F === oe.Onfido && G.initialize("identity-container").catch((V) => {
|
|
4040
|
+
console.error("[Onfido] Initialization error:", V), E(`Failed to initialize: ${V.message}`);
|
|
4041
|
+
}), m(G);
|
|
4016
4042
|
} catch (D) {
|
|
4017
|
-
console.error("[Identity] Provider setup error:", D),
|
|
4043
|
+
console.error("[Identity] Provider setup error:", D), E(`Setup error: ${D.message}`);
|
|
4018
4044
|
}
|
|
4019
4045
|
}
|
|
4020
4046
|
return () => {
|
|
4021
|
-
if (
|
|
4047
|
+
if (b && b.destroy)
|
|
4022
4048
|
try {
|
|
4023
|
-
|
|
4024
|
-
} catch (
|
|
4025
|
-
console.error("[Identity] Error destroying provider:",
|
|
4049
|
+
b.destroy();
|
|
4050
|
+
} catch (F) {
|
|
4051
|
+
console.error("[Identity] Error destroying provider:", F);
|
|
4026
4052
|
}
|
|
4027
4053
|
};
|
|
4028
|
-
}, [
|
|
4029
|
-
const
|
|
4054
|
+
}, [c, d, b, I, e, M]);
|
|
4055
|
+
const p = async () => {
|
|
4030
4056
|
try {
|
|
4031
|
-
|
|
4032
|
-
} catch (
|
|
4033
|
-
console.error("Error starting identity verification:",
|
|
4057
|
+
E(null), B(!1), await x(), P(!0);
|
|
4058
|
+
} catch (F) {
|
|
4059
|
+
console.error("Error starting identity verification:", F);
|
|
4034
4060
|
}
|
|
4035
|
-
},
|
|
4061
|
+
}, w = async () => {
|
|
4036
4062
|
try {
|
|
4037
|
-
|
|
4038
|
-
} catch (
|
|
4039
|
-
console.error("Error restarting identity verification:",
|
|
4063
|
+
E(null), B(!1), m(null), console.log("[Identity] Restarting verification..."), await g(), P(!0);
|
|
4064
|
+
} catch (F) {
|
|
4065
|
+
console.error("Error restarting identity verification:", F), E(F.message || "Failed to restart verification");
|
|
4040
4066
|
}
|
|
4041
4067
|
};
|
|
4042
|
-
if (
|
|
4043
|
-
return /* @__PURE__ */ n(
|
|
4044
|
-
/* @__PURE__ */ n(
|
|
4068
|
+
if (v || u)
|
|
4069
|
+
return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
|
|
4070
|
+
/* @__PURE__ */ n(ce, { className: "my-8" }),
|
|
4045
4071
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading identity verification..." })
|
|
4046
4072
|
] }) });
|
|
4047
|
-
if (
|
|
4048
|
-
return /* @__PURE__ */ n(
|
|
4073
|
+
if (y)
|
|
4074
|
+
return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
4049
4075
|
"Error: ",
|
|
4050
|
-
|
|
4076
|
+
y.message
|
|
4051
4077
|
] }) }) });
|
|
4052
|
-
if (
|
|
4053
|
-
return /* @__PURE__ */ o(
|
|
4054
|
-
/* @__PURE__ */ n(
|
|
4055
|
-
/* @__PURE__ */ o(
|
|
4078
|
+
if (I && (C || M))
|
|
4079
|
+
return /* @__PURE__ */ o(L, { children: [
|
|
4080
|
+
/* @__PURE__ */ n(ee, { children: /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
|
|
4081
|
+
/* @__PURE__ */ o(T, { children: [
|
|
4056
4082
|
/* @__PURE__ */ n("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: [
|
|
4057
4083
|
/* @__PURE__ */ n(
|
|
4058
4084
|
"svg",
|
|
@@ -4073,8 +4099,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4073
4099
|
}
|
|
4074
4100
|
),
|
|
4075
4101
|
/* @__PURE__ */ o("div", { children: [
|
|
4076
|
-
/* @__PURE__ */ n("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children:
|
|
4077
|
-
/* @__PURE__ */ n("p", { className: "text-red-800 dark:text-red-200 text-sm", children:
|
|
4102
|
+
/* @__PURE__ */ n("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children: M ? "Session Expired" : "Verification Error" }),
|
|
4103
|
+
/* @__PURE__ */ n("p", { className: "text-red-800 dark:text-red-200 text-sm", children: C || "Your verification session has expired and needs to be restarted." })
|
|
4078
4104
|
] })
|
|
4079
4105
|
] }) }),
|
|
4080
4106
|
/* @__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: [
|
|
@@ -4086,15 +4112,15 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4086
4112
|
] })
|
|
4087
4113
|
] })
|
|
4088
4114
|
] }),
|
|
4089
|
-
/* @__PURE__ */ o(
|
|
4115
|
+
/* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
|
|
4090
4116
|
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
4091
|
-
/* @__PURE__ */ n(j, { type: "button", onClick:
|
|
4117
|
+
/* @__PURE__ */ n(j, { type: "button", onClick: w, disabled: u, children: u ? "Restarting..." : "Restart Verification" })
|
|
4092
4118
|
] })
|
|
4093
4119
|
] });
|
|
4094
|
-
if (
|
|
4095
|
-
const
|
|
4096
|
-
return d != null && d.url ? /* @__PURE__ */ o(
|
|
4097
|
-
/* @__PURE__ */ n(
|
|
4120
|
+
if (I && l) {
|
|
4121
|
+
const F = c;
|
|
4122
|
+
return d != null && d.url ? /* @__PURE__ */ o(L, { children: [
|
|
4123
|
+
/* @__PURE__ */ n(ee, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
|
|
4098
4124
|
/* @__PURE__ */ o("div", { children: [
|
|
4099
4125
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
|
|
4100
4126
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
|
|
@@ -4105,13 +4131,13 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4105
4131
|
type: "button",
|
|
4106
4132
|
variant: "outline",
|
|
4107
4133
|
size: "sm",
|
|
4108
|
-
onClick:
|
|
4134
|
+
onClick: w,
|
|
4109
4135
|
disabled: u,
|
|
4110
4136
|
children: "Restart"
|
|
4111
4137
|
}
|
|
4112
4138
|
)
|
|
4113
4139
|
] }) }),
|
|
4114
|
-
/* @__PURE__ */ o(
|
|
4140
|
+
/* @__PURE__ */ o(T, { children: [
|
|
4115
4141
|
/* @__PURE__ */ n("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: [
|
|
4116
4142
|
/* @__PURE__ */ n("strong", { children: "Important:" }),
|
|
4117
4143
|
' If you see an "expired" or "invalid link" message below, click the "Restart" button above to generate a new verification session.'
|
|
@@ -4124,13 +4150,13 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4124
4150
|
allow: "camera; microphone; geolocation",
|
|
4125
4151
|
title: "Identity Verification",
|
|
4126
4152
|
onLoad: (D) => {
|
|
4127
|
-
var
|
|
4153
|
+
var G, V, ae;
|
|
4128
4154
|
console.log("[Identity] Iframe loaded");
|
|
4129
4155
|
try {
|
|
4130
|
-
const $ = D.target,
|
|
4131
|
-
if (
|
|
4132
|
-
const
|
|
4133
|
-
(
|
|
4156
|
+
const $ = D.target, Ce = $.contentDocument || ((G = $.contentWindow) == null ? void 0 : G.document);
|
|
4157
|
+
if (Ce) {
|
|
4158
|
+
const me = ((ae = (V = Ce.body) == null ? void 0 : V.textContent) == null ? void 0 : ae.toLowerCase()) || "";
|
|
4159
|
+
(me.includes("expired") || me.includes("invalid") || me.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), B(!0), E("Your verification link has expired."));
|
|
4134
4160
|
}
|
|
4135
4161
|
} catch {
|
|
4136
4162
|
console.log("[Identity] Cannot check iframe content (CORS)");
|
|
@@ -4139,66 +4165,66 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4139
4165
|
}
|
|
4140
4166
|
) })
|
|
4141
4167
|
] }),
|
|
4142
|
-
r && /* @__PURE__ */ n(
|
|
4143
|
-
] }) :
|
|
4144
|
-
/* @__PURE__ */ o(
|
|
4168
|
+
r && /* @__PURE__ */ n(ne, { children: /* @__PURE__ */ n(j, { variant: "outline", onClick: r, children: "Back" }) })
|
|
4169
|
+
] }) : F === oe.SardinAI ? /* @__PURE__ */ o(L, { children: [
|
|
4170
|
+
/* @__PURE__ */ o(ee, { children: [
|
|
4145
4171
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Device Risk Assessment" }),
|
|
4146
4172
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Analyzing device security and behavioral patterns..." })
|
|
4147
4173
|
] }),
|
|
4148
|
-
/* @__PURE__ */ n(
|
|
4149
|
-
/* @__PURE__ */ n(
|
|
4174
|
+
/* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("div", { className: "text-center py-12", children: [
|
|
4175
|
+
/* @__PURE__ */ n(ce, { className: "mb-4" }),
|
|
4150
4176
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait while we verify your device security" }),
|
|
4151
4177
|
/* @__PURE__ */ n("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" })
|
|
4152
4178
|
] }) })
|
|
4153
|
-
] }) : /* @__PURE__ */ o(
|
|
4154
|
-
/* @__PURE__ */ o(
|
|
4179
|
+
] }) : /* @__PURE__ */ o(L, { children: [
|
|
4180
|
+
/* @__PURE__ */ o(ee, { children: [
|
|
4155
4181
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
|
|
4156
4182
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
|
|
4157
4183
|
] }),
|
|
4158
|
-
/* @__PURE__ */ n(
|
|
4159
|
-
r && /* @__PURE__ */ n(
|
|
4184
|
+
/* @__PURE__ */ n(T, { children: /* @__PURE__ */ n("div", { id: "identity-container", className: "min-h-[400px]" }) }),
|
|
4185
|
+
r && /* @__PURE__ */ n(ne, { children: /* @__PURE__ */ n(j, { variant: "outline", onClick: r, children: "Back" }) })
|
|
4160
4186
|
] });
|
|
4161
4187
|
}
|
|
4162
|
-
return /* @__PURE__ */ n("form", { onSubmit:
|
|
4163
|
-
/* @__PURE__ */ o(
|
|
4188
|
+
return /* @__PURE__ */ n("form", { onSubmit: _.handleSubmit(p), children: /* @__PURE__ */ o(L, { children: [
|
|
4189
|
+
/* @__PURE__ */ o(ee, { children: [
|
|
4164
4190
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Review Your Information" }),
|
|
4165
4191
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please review and confirm your information before starting identity verification" })
|
|
4166
4192
|
] }),
|
|
4167
|
-
/* @__PURE__ */ o(
|
|
4193
|
+
/* @__PURE__ */ o(T, { className: "space-y-6", children: [
|
|
4168
4194
|
/* @__PURE__ */ o("div", { className: "space-y-4 pb-4 border-b border-gray-200 dark:border-gray-700", children: [
|
|
4169
4195
|
/* @__PURE__ */ o("div", { children: [
|
|
4170
4196
|
/* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Name" }),
|
|
4171
4197
|
/* @__PURE__ */ o("p", { className: "mt-1 text-base", children: [
|
|
4172
|
-
(
|
|
4198
|
+
(O = f == null ? void 0 : f.applicantRequestData) == null ? void 0 : O.firstName,
|
|
4173
4199
|
" ",
|
|
4174
|
-
(
|
|
4200
|
+
(z = f == null ? void 0 : f.applicantRequestData) == null ? void 0 : z.lastName
|
|
4175
4201
|
] })
|
|
4176
4202
|
] }),
|
|
4177
4203
|
/* @__PURE__ */ o("div", { children: [
|
|
4178
4204
|
/* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Email" }),
|
|
4179
|
-
/* @__PURE__ */ n("p", { className: "mt-1 text-base", children: (
|
|
4205
|
+
/* @__PURE__ */ n("p", { className: "mt-1 text-base", children: (R = f == null ? void 0 : f.applicantRequestData) == null ? void 0 : R.email })
|
|
4180
4206
|
] }),
|
|
4181
4207
|
/* @__PURE__ */ o("div", { children: [
|
|
4182
4208
|
/* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Date of Birth" }),
|
|
4183
|
-
/* @__PURE__ */ n("p", { className: "mt-1 text-base", children: ((
|
|
4209
|
+
/* @__PURE__ */ n("p", { className: "mt-1 text-base", children: ((we = f == null ? void 0 : f.applicantRequestData) == null ? void 0 : we.dateOfBirth) || "Not provided" })
|
|
4184
4210
|
] })
|
|
4185
4211
|
] }),
|
|
4186
4212
|
/* @__PURE__ */ o("div", { className: "space-y-4", children: [
|
|
4187
4213
|
/* @__PURE__ */ n("h3", { className: "text-lg font-semibold", children: "Address Information" }),
|
|
4188
4214
|
/* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
4189
4215
|
/* @__PURE__ */ n(
|
|
4190
|
-
|
|
4216
|
+
J,
|
|
4191
4217
|
{
|
|
4192
|
-
control:
|
|
4218
|
+
control: _.control,
|
|
4193
4219
|
name: "country",
|
|
4194
|
-
render: ({ field:
|
|
4195
|
-
|
|
4220
|
+
render: ({ field: F }) => /* @__PURE__ */ n(
|
|
4221
|
+
ye,
|
|
4196
4222
|
{
|
|
4197
|
-
...
|
|
4223
|
+
...F,
|
|
4198
4224
|
label: "Country",
|
|
4199
4225
|
options: [
|
|
4200
4226
|
{ value: "", label: "Select country..." },
|
|
4201
|
-
...
|
|
4227
|
+
...h.map((D) => ({
|
|
4202
4228
|
value: D.abbreviation3 || D.abbreviation,
|
|
4203
4229
|
label: D.name
|
|
4204
4230
|
}))
|
|
@@ -4208,18 +4234,18 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4208
4234
|
}
|
|
4209
4235
|
),
|
|
4210
4236
|
/* @__PURE__ */ n(
|
|
4211
|
-
|
|
4237
|
+
J,
|
|
4212
4238
|
{
|
|
4213
|
-
control:
|
|
4239
|
+
control: _.control,
|
|
4214
4240
|
name: "nationality",
|
|
4215
|
-
render: ({ field:
|
|
4216
|
-
|
|
4241
|
+
render: ({ field: F }) => /* @__PURE__ */ n(
|
|
4242
|
+
ye,
|
|
4217
4243
|
{
|
|
4218
|
-
...
|
|
4244
|
+
...F,
|
|
4219
4245
|
label: "Nationality",
|
|
4220
4246
|
options: [
|
|
4221
4247
|
{ value: "", label: "Select nationality..." },
|
|
4222
|
-
...
|
|
4248
|
+
...h.map((D) => ({
|
|
4223
4249
|
value: D.abbreviation3 || D.abbreviation,
|
|
4224
4250
|
label: D.name
|
|
4225
4251
|
}))
|
|
@@ -4231,56 +4257,56 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4231
4257
|
] }),
|
|
4232
4258
|
/* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
4233
4259
|
/* @__PURE__ */ n(
|
|
4234
|
-
|
|
4260
|
+
J,
|
|
4235
4261
|
{
|
|
4236
|
-
control:
|
|
4262
|
+
control: _.control,
|
|
4237
4263
|
name: "street",
|
|
4238
|
-
render: ({ field:
|
|
4264
|
+
render: ({ field: F }) => /* @__PURE__ */ n(X, { ...F, label: "Street" })
|
|
4239
4265
|
}
|
|
4240
4266
|
),
|
|
4241
4267
|
/* @__PURE__ */ n(
|
|
4242
|
-
|
|
4268
|
+
J,
|
|
4243
4269
|
{
|
|
4244
|
-
control:
|
|
4270
|
+
control: _.control,
|
|
4245
4271
|
name: "streetNumber",
|
|
4246
|
-
render: ({ field:
|
|
4272
|
+
render: ({ field: F }) => /* @__PURE__ */ n(X, { ...F, label: "Street Number" })
|
|
4247
4273
|
}
|
|
4248
4274
|
)
|
|
4249
4275
|
] }),
|
|
4250
4276
|
/* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
4251
4277
|
/* @__PURE__ */ n(
|
|
4252
|
-
|
|
4278
|
+
J,
|
|
4253
4279
|
{
|
|
4254
|
-
control:
|
|
4280
|
+
control: _.control,
|
|
4255
4281
|
name: "city",
|
|
4256
|
-
render: ({ field:
|
|
4282
|
+
render: ({ field: F }) => /* @__PURE__ */ n(X, { ...F, label: "City" })
|
|
4257
4283
|
}
|
|
4258
4284
|
),
|
|
4259
4285
|
/* @__PURE__ */ n(
|
|
4260
|
-
|
|
4286
|
+
J,
|
|
4261
4287
|
{
|
|
4262
|
-
control:
|
|
4288
|
+
control: _.control,
|
|
4263
4289
|
name: "zip",
|
|
4264
|
-
render: ({ field:
|
|
4290
|
+
render: ({ field: F }) => /* @__PURE__ */ n(X, { ...F, label: "ZIP/Postal Code" })
|
|
4265
4291
|
}
|
|
4266
4292
|
)
|
|
4267
4293
|
] }),
|
|
4268
4294
|
/* @__PURE__ */ n(
|
|
4269
|
-
|
|
4295
|
+
J,
|
|
4270
4296
|
{
|
|
4271
|
-
control:
|
|
4297
|
+
control: _.control,
|
|
4272
4298
|
name: "phonenumber",
|
|
4273
|
-
render: ({ field:
|
|
4299
|
+
render: ({ field: F }) => /* @__PURE__ */ n(X, { ...F, label: "Phone Number", type: "tel" })
|
|
4274
4300
|
}
|
|
4275
4301
|
)
|
|
4276
4302
|
] })
|
|
4277
4303
|
] }),
|
|
4278
|
-
/* @__PURE__ */ o(
|
|
4304
|
+
/* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
|
|
4279
4305
|
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
4280
4306
|
/* @__PURE__ */ n(j, { type: "submit", isLoading: u, children: "Confirm and Start Verification" })
|
|
4281
4307
|
] })
|
|
4282
4308
|
] }) });
|
|
4283
|
-
},
|
|
4309
|
+
}, je = ({
|
|
4284
4310
|
kycStatus: t,
|
|
4285
4311
|
reviewStatus: e,
|
|
4286
4312
|
workflowResult: r,
|
|
@@ -4288,63 +4314,63 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4288
4314
|
onContinue: a,
|
|
4289
4315
|
onContactSupport: i
|
|
4290
4316
|
}) => {
|
|
4291
|
-
const
|
|
4317
|
+
const c = t === pe.Approved ? {
|
|
4292
4318
|
type: "success",
|
|
4293
4319
|
title: "Verification Approved",
|
|
4294
4320
|
icon: "✓",
|
|
4295
4321
|
iconBg: "bg-green-100 dark:bg-green-900/30",
|
|
4296
4322
|
iconColor: "text-green-600 dark:text-green-400",
|
|
4297
4323
|
message: "Your identity verification has been successfully approved."
|
|
4298
|
-
} : t ===
|
|
4324
|
+
} : t === pe.Rejected ? {
|
|
4299
4325
|
type: "error",
|
|
4300
4326
|
title: "Verification Rejected",
|
|
4301
4327
|
icon: "✕",
|
|
4302
4328
|
iconBg: "bg-red-100 dark:bg-red-900/30",
|
|
4303
4329
|
iconColor: "text-red-600 dark:text-red-400",
|
|
4304
4330
|
message: "Unfortunately, your identity verification was not approved."
|
|
4305
|
-
} : t ===
|
|
4331
|
+
} : t === pe.Pending || t === pe.InProgress ? {
|
|
4306
4332
|
type: "pending",
|
|
4307
4333
|
title: "Verification Pending",
|
|
4308
4334
|
icon: "⏱",
|
|
4309
4335
|
iconBg: "bg-blue-100 dark:bg-blue-900/30",
|
|
4310
4336
|
iconColor: "text-blue-600 dark:text-blue-400",
|
|
4311
4337
|
message: "Your identity verification is currently being processed."
|
|
4312
|
-
} : e ===
|
|
4338
|
+
} : e === ge.Approved ? {
|
|
4313
4339
|
type: "success",
|
|
4314
4340
|
title: "Application Approved",
|
|
4315
4341
|
icon: "✓",
|
|
4316
4342
|
iconBg: "bg-green-100 dark:bg-green-900/30",
|
|
4317
4343
|
iconColor: "text-green-600 dark:text-green-400",
|
|
4318
4344
|
message: "Your application has been approved."
|
|
4319
|
-
} : e ===
|
|
4345
|
+
} : e === ge.Reject ? {
|
|
4320
4346
|
type: "error",
|
|
4321
4347
|
title: "Application Rejected",
|
|
4322
4348
|
icon: "✕",
|
|
4323
4349
|
iconBg: "bg-red-100 dark:bg-red-900/30",
|
|
4324
4350
|
iconColor: "text-red-600 dark:text-red-400",
|
|
4325
4351
|
message: "Your application has been rejected."
|
|
4326
|
-
} : e ===
|
|
4352
|
+
} : e === ge.UnderReview || e === ge.AdminReview ? {
|
|
4327
4353
|
type: "pending",
|
|
4328
4354
|
title: "Under Review",
|
|
4329
4355
|
icon: "📋",
|
|
4330
4356
|
iconBg: "bg-yellow-100 dark:bg-yellow-900/30",
|
|
4331
4357
|
iconColor: "text-yellow-700 dark:text-yellow-400",
|
|
4332
4358
|
message: "Your application is currently under manual review."
|
|
4333
|
-
} : r ===
|
|
4359
|
+
} : r === Ne.Success ? {
|
|
4334
4360
|
type: "success",
|
|
4335
4361
|
title: "Process Complete",
|
|
4336
4362
|
icon: "✓",
|
|
4337
4363
|
iconBg: "bg-green-100 dark:bg-green-900/30",
|
|
4338
4364
|
iconColor: "text-green-600 dark:text-green-400",
|
|
4339
4365
|
message: "Your verification process has been completed successfully."
|
|
4340
|
-
} : r ===
|
|
4366
|
+
} : r === Ne.Failed ? {
|
|
4341
4367
|
type: "error",
|
|
4342
4368
|
title: "Process Failed",
|
|
4343
4369
|
icon: "✕",
|
|
4344
4370
|
iconBg: "bg-red-100 dark:bg-red-900/30",
|
|
4345
4371
|
iconColor: "text-red-600 dark:text-red-400",
|
|
4346
4372
|
message: "The verification process could not be completed."
|
|
4347
|
-
} : r ===
|
|
4373
|
+
} : r === Ne.AdminReview ? {
|
|
4348
4374
|
type: "pending",
|
|
4349
4375
|
title: "Admin Review Required",
|
|
4350
4376
|
icon: "📋",
|
|
@@ -4359,25 +4385,25 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4359
4385
|
iconColor: "text-blue-600 dark:text-blue-400",
|
|
4360
4386
|
message: "Your application is being reviewed."
|
|
4361
4387
|
};
|
|
4362
|
-
return /* @__PURE__ */ o(
|
|
4363
|
-
/* @__PURE__ */ o(
|
|
4388
|
+
return /* @__PURE__ */ o(L, { children: [
|
|
4389
|
+
/* @__PURE__ */ o(T, { className: "py-12", children: [
|
|
4364
4390
|
/* @__PURE__ */ n("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ n(
|
|
4365
4391
|
"div",
|
|
4366
4392
|
{
|
|
4367
|
-
className: `w-24 h-24 rounded-full flex items-center justify-center ${
|
|
4368
|
-
children: /* @__PURE__ */ n("span", { className: `text-5xl ${
|
|
4393
|
+
className: `w-24 h-24 rounded-full flex items-center justify-center ${c.iconBg}`,
|
|
4394
|
+
children: /* @__PURE__ */ n("span", { className: `text-5xl ${c.iconColor}`, children: c.icon })
|
|
4369
4395
|
}
|
|
4370
4396
|
) }),
|
|
4371
|
-
/* @__PURE__ */ n("h2", { className: "text-3xl font-bold text-center text-gray-900 dark:text-white mb-4", children:
|
|
4397
|
+
/* @__PURE__ */ n("h2", { className: "text-3xl font-bold text-center text-gray-900 dark:text-white mb-4", children: c.title }),
|
|
4372
4398
|
/* @__PURE__ */ n("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ n(
|
|
4373
|
-
|
|
4399
|
+
he,
|
|
4374
4400
|
{
|
|
4375
|
-
variant:
|
|
4376
|
-
children: t != null ?
|
|
4401
|
+
variant: c.type === "success" ? "success" : c.type === "error" ? "danger" : c.type === "pending" ? "warning" : "info",
|
|
4402
|
+
children: t != null ? pe[t] : ge[e]
|
|
4377
4403
|
}
|
|
4378
4404
|
) }),
|
|
4379
|
-
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mb-6 max-w-md mx-auto", children: s ||
|
|
4380
|
-
|
|
4405
|
+
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mb-6 max-w-md mx-auto", children: s || c.message }),
|
|
4406
|
+
c.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: [
|
|
4381
4407
|
/* @__PURE__ */ n("h3", { className: "font-semibold text-green-900 dark:text-green-100 mb-2", children: "What's Next?" }),
|
|
4382
4408
|
/* @__PURE__ */ o("ul", { className: "text-sm text-green-800 dark:text-green-200 space-y-1", children: [
|
|
4383
4409
|
/* @__PURE__ */ n("li", { children: "✓ Your identity has been verified" }),
|
|
@@ -4385,7 +4411,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4385
4411
|
/* @__PURE__ */ n("li", { children: "✓ All features are now accessible" })
|
|
4386
4412
|
] })
|
|
4387
4413
|
] }),
|
|
4388
|
-
|
|
4414
|
+
c.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: [
|
|
4389
4415
|
/* @__PURE__ */ n("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-2", children: "What Can You Do?" }),
|
|
4390
4416
|
/* @__PURE__ */ o("ul", { className: "text-sm text-red-800 dark:text-red-200 space-y-2", children: [
|
|
4391
4417
|
/* @__PURE__ */ n("li", { children: "• Review the requirements and ensure all information is correct" }),
|
|
@@ -4393,7 +4419,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4393
4419
|
/* @__PURE__ */ n("li", { children: "• You may be able to resubmit your application" })
|
|
4394
4420
|
] })
|
|
4395
4421
|
] }),
|
|
4396
|
-
|
|
4422
|
+
c.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: [
|
|
4397
4423
|
/* @__PURE__ */ n("h3", { className: "font-semibold text-blue-900 dark:text-blue-100 mb-2", children: "What Happens Next?" }),
|
|
4398
4424
|
/* @__PURE__ */ o("ul", { className: "text-sm text-blue-800 dark:text-blue-200 space-y-2", children: [
|
|
4399
4425
|
/* @__PURE__ */ n("li", { children: "• Our team is reviewing your information" }),
|
|
@@ -4405,21 +4431,21 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4405
4431
|
/* @__PURE__ */ n("div", { className: "mt-6 pt-6 border-t border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ o("div", { className: "grid grid-cols-2 gap-4 text-sm", children: [
|
|
4406
4432
|
/* @__PURE__ */ o("div", { children: [
|
|
4407
4433
|
/* @__PURE__ */ n("span", { className: "text-gray-500 dark:text-gray-400", children: "KYC Status:" }),
|
|
4408
|
-
/* @__PURE__ */ n("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: t != null ?
|
|
4434
|
+
/* @__PURE__ */ n("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: t != null ? pe[t] : "Not Available" })
|
|
4409
4435
|
] }),
|
|
4410
4436
|
/* @__PURE__ */ o("div", { children: [
|
|
4411
4437
|
/* @__PURE__ */ n("span", { className: "text-gray-500 dark:text-gray-400", children: "Review Status:" }),
|
|
4412
|
-
/* @__PURE__ */ n("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children:
|
|
4438
|
+
/* @__PURE__ */ n("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: ge[e] })
|
|
4413
4439
|
] })
|
|
4414
4440
|
] }) })
|
|
4415
4441
|
] }),
|
|
4416
|
-
/* @__PURE__ */ o(
|
|
4417
|
-
|
|
4418
|
-
|
|
4442
|
+
/* @__PURE__ */ o(ne, { className: "flex justify-center gap-4", children: [
|
|
4443
|
+
c.type === "success" && a && /* @__PURE__ */ n(j, { onClick: a, size: "lg", children: "Continue" }),
|
|
4444
|
+
c.type === "error" && /* @__PURE__ */ o(nt, { children: [
|
|
4419
4445
|
i && /* @__PURE__ */ n(j, { variant: "outline", onClick: i, children: "Contact Support" }),
|
|
4420
4446
|
a && /* @__PURE__ */ n(j, { onClick: a, children: "Try Again" })
|
|
4421
4447
|
] }),
|
|
4422
|
-
|
|
4448
|
+
c.type === "pending" && /* @__PURE__ */ n("div", { className: "text-center", children: /* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Please check back later or wait for our email notification" }) })
|
|
4423
4449
|
] })
|
|
4424
4450
|
] });
|
|
4425
4451
|
}, Er = ({ config: t, className: e = "" }) => !(t != null && t.visible) || !(t != null && t.url) ? null : /* @__PURE__ */ n("div", { className: `metakyc-logo ${e}`, children: /* @__PURE__ */ n(
|
|
@@ -4442,7 +4468,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4442
4468
|
subtitle: e,
|
|
4443
4469
|
className: r = ""
|
|
4444
4470
|
}) => {
|
|
4445
|
-
const { currentTheme: s } =
|
|
4471
|
+
const { currentTheme: s } = se(), a = t || (s == null ? void 0 : s.title) || "KYC Verification";
|
|
4446
4472
|
return /* @__PURE__ */ o("div", { className: `metakyc-header ${r}`, children: [
|
|
4447
4473
|
(s == null ? void 0 : s.logo) && s.logo.visible && /* @__PURE__ */ n("div", { className: "mb-3", children: /* @__PURE__ */ n(Er, { config: s.logo }) }),
|
|
4448
4474
|
/* @__PURE__ */ o("div", { children: [
|
|
@@ -4456,21 +4482,21 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4456
4482
|
onSuccess: r,
|
|
4457
4483
|
onCancel: s
|
|
4458
4484
|
}) => {
|
|
4459
|
-
var
|
|
4460
|
-
const { config: a, baseInformationService: i } =
|
|
4461
|
-
if (!
|
|
4485
|
+
var B, Q, _;
|
|
4486
|
+
const { config: a, baseInformationService: i } = se(), { createApplicant: l, isLoading: c } = rr(), [d, u] = N([]), [y, x] = N(!0), [g, b] = N(!1), [m, f] = N(null), k = H(!1), h = H(!1), A = t || ((B = a.applicantForm) == null ? void 0 : B.workflowKey);
|
|
4487
|
+
if (!A)
|
|
4462
4488
|
throw new Error(
|
|
4463
4489
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
4464
4490
|
);
|
|
4465
|
-
const
|
|
4466
|
-
workflowKey:
|
|
4491
|
+
const v = e || ((Q = a.applicantForm) == null ? void 0 : Q.externalRefId) || "", S = ((_ = a.applicantForm) == null ? void 0 : _.visibleFields) || gt, [I, P] = N({
|
|
4492
|
+
workflowKey: A,
|
|
4467
4493
|
firstName: "",
|
|
4468
4494
|
lastName: "",
|
|
4469
4495
|
title: "",
|
|
4470
4496
|
email: "",
|
|
4471
4497
|
dateOfBirth: "",
|
|
4472
4498
|
phonenumber: "",
|
|
4473
|
-
externalRefId:
|
|
4499
|
+
externalRefId: v,
|
|
4474
4500
|
// Set from config or prop
|
|
4475
4501
|
mobileCountryCode: "",
|
|
4476
4502
|
street: "",
|
|
@@ -4489,170 +4515,174 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4489
4515
|
occupation: "",
|
|
4490
4516
|
taxNumber: ""
|
|
4491
4517
|
});
|
|
4492
|
-
|
|
4518
|
+
Y(() => {
|
|
4493
4519
|
(async () => {
|
|
4520
|
+
if (k.current || h.current) {
|
|
4521
|
+
console.log("[CreateApplicant] Countries already loading or loaded, skipping...");
|
|
4522
|
+
return;
|
|
4523
|
+
}
|
|
4524
|
+
k.current = !0, x(!0);
|
|
4494
4525
|
try {
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
console.error("Failed to load countries:", I);
|
|
4526
|
+
const w = await i.getCountries("", a.locale || "en"), O = /* @__PURE__ */ new Set(), z = w.map((R) => ({
|
|
4527
|
+
value: R.abbreviation3 || R.abbreviation,
|
|
4528
|
+
label: R.name
|
|
4529
|
+
})).filter((R) => !R.value || O.has(R.value) ? !1 : (O.add(R.value), !0));
|
|
4530
|
+
u(z), h.current = !0;
|
|
4531
|
+
} catch (w) {
|
|
4532
|
+
console.error("Failed to load countries:", w);
|
|
4503
4533
|
} finally {
|
|
4504
|
-
|
|
4534
|
+
x(!1), k.current = !1;
|
|
4505
4535
|
}
|
|
4506
4536
|
})();
|
|
4507
|
-
}, [
|
|
4508
|
-
const
|
|
4509
|
-
|
|
4510
|
-
},
|
|
4511
|
-
|
|
4537
|
+
}, []);
|
|
4538
|
+
const C = (p, w) => {
|
|
4539
|
+
P((O) => ({ ...O, [p]: w }));
|
|
4540
|
+
}, E = async (p) => {
|
|
4541
|
+
p.preventDefault(), b(!0), f(null);
|
|
4512
4542
|
try {
|
|
4513
|
-
if (!
|
|
4514
|
-
|
|
4543
|
+
if (!I.externalRefId || I.externalRefId.trim() === "") {
|
|
4544
|
+
f("External Reference ID is required and cannot be empty"), b(!1);
|
|
4515
4545
|
return;
|
|
4516
4546
|
}
|
|
4517
|
-
const
|
|
4518
|
-
workflowKey:
|
|
4519
|
-
externalRefId:
|
|
4547
|
+
const w = {
|
|
4548
|
+
workflowKey: I.workflowKey,
|
|
4549
|
+
externalRefId: I.externalRefId.trim()
|
|
4520
4550
|
// Always include, never empty
|
|
4521
4551
|
};
|
|
4522
|
-
|
|
4523
|
-
if (
|
|
4524
|
-
const
|
|
4525
|
-
|
|
4526
|
-
}), console.log("Creating applicant with data:",
|
|
4527
|
-
const
|
|
4528
|
-
|
|
4552
|
+
S.forEach((z) => {
|
|
4553
|
+
if (z === "externalRefId") return;
|
|
4554
|
+
const R = I[z];
|
|
4555
|
+
R != null && R !== "" && !(Array.isArray(R) && R.length === 0) && (w[z] = R);
|
|
4556
|
+
}), console.log("Creating applicant with data:", w);
|
|
4557
|
+
const O = await l(
|
|
4558
|
+
w
|
|
4529
4559
|
);
|
|
4530
|
-
console.log("Applicant created:",
|
|
4531
|
-
} catch (
|
|
4532
|
-
console.error("Error creating applicant:",
|
|
4560
|
+
console.log("Applicant created:", O), r(O.applicantId);
|
|
4561
|
+
} catch (w) {
|
|
4562
|
+
console.error("Error creating applicant:", w), f(w.message || "Failed to create applicant");
|
|
4533
4563
|
} finally {
|
|
4534
|
-
|
|
4564
|
+
b(!1);
|
|
4535
4565
|
}
|
|
4536
|
-
},
|
|
4537
|
-
var
|
|
4538
|
-
const
|
|
4539
|
-
switch (
|
|
4566
|
+
}, M = (p) => {
|
|
4567
|
+
var O, z;
|
|
4568
|
+
const w = yt[p];
|
|
4569
|
+
switch (w.type) {
|
|
4540
4570
|
case "select":
|
|
4541
|
-
return
|
|
4542
|
-
|
|
4571
|
+
return p === "country" || p === "nationality" || p === "taxCountry" || p === "countryOfBirth" ? /* @__PURE__ */ n(
|
|
4572
|
+
ye,
|
|
4543
4573
|
{
|
|
4544
|
-
label:
|
|
4545
|
-
value:
|
|
4546
|
-
onChange: (
|
|
4574
|
+
label: w.label,
|
|
4575
|
+
value: I[p] || "",
|
|
4576
|
+
onChange: (R) => C(p, R.target.value),
|
|
4547
4577
|
options: [
|
|
4548
|
-
{ value: "", label: `Select ${
|
|
4578
|
+
{ value: "", label: `Select ${w.label.toLowerCase()}...` },
|
|
4549
4579
|
...d
|
|
4550
4580
|
],
|
|
4551
|
-
disabled:
|
|
4581
|
+
disabled: y
|
|
4552
4582
|
},
|
|
4553
|
-
|
|
4554
|
-
) :
|
|
4555
|
-
|
|
4583
|
+
p
|
|
4584
|
+
) : p === "salutation" ? /* @__PURE__ */ n(
|
|
4585
|
+
ye,
|
|
4556
4586
|
{
|
|
4557
|
-
label:
|
|
4558
|
-
value: ((
|
|
4559
|
-
onChange: (
|
|
4587
|
+
label: w.label,
|
|
4588
|
+
value: ((O = I[p]) == null ? void 0 : O.toString()) || "",
|
|
4589
|
+
onChange: (R) => C(p, R.target.value ? Number(R.target.value) : null),
|
|
4560
4590
|
options: [
|
|
4561
4591
|
{ value: "", label: "Select salutation..." },
|
|
4562
|
-
{ value:
|
|
4563
|
-
{ value:
|
|
4564
|
-
{ value:
|
|
4592
|
+
{ value: Se.Male.toString(), label: "Male" },
|
|
4593
|
+
{ value: Se.Female.toString(), label: "Female" },
|
|
4594
|
+
{ value: Se.Other.toString(), label: "Other" }
|
|
4565
4595
|
]
|
|
4566
4596
|
},
|
|
4567
|
-
|
|
4597
|
+
p
|
|
4568
4598
|
) : null;
|
|
4569
4599
|
case "multiselect":
|
|
4570
|
-
return
|
|
4571
|
-
|
|
4600
|
+
return p === "otherNationality" ? /* @__PURE__ */ n(
|
|
4601
|
+
X,
|
|
4572
4602
|
{
|
|
4573
4603
|
type: "text",
|
|
4574
|
-
label:
|
|
4575
|
-
value: ((
|
|
4576
|
-
onChange: (
|
|
4577
|
-
const
|
|
4578
|
-
|
|
4604
|
+
label: w.label,
|
|
4605
|
+
value: ((z = I[p]) == null ? void 0 : z.join(", ")) || "",
|
|
4606
|
+
onChange: (R) => {
|
|
4607
|
+
const we = R.target.value.split(",").map((F) => F.trim()).filter(Boolean);
|
|
4608
|
+
C(p, we);
|
|
4579
4609
|
},
|
|
4580
4610
|
placeholder: "Enter countries separated by commas"
|
|
4581
4611
|
},
|
|
4582
|
-
|
|
4612
|
+
p
|
|
4583
4613
|
) : null;
|
|
4584
4614
|
case "date":
|
|
4585
4615
|
return /* @__PURE__ */ n(
|
|
4586
|
-
|
|
4616
|
+
X,
|
|
4587
4617
|
{
|
|
4588
4618
|
type: "date",
|
|
4589
|
-
label:
|
|
4590
|
-
value:
|
|
4591
|
-
onChange: (
|
|
4619
|
+
label: w.label,
|
|
4620
|
+
value: I[p] || "",
|
|
4621
|
+
onChange: (R) => C(p, R.target.value)
|
|
4592
4622
|
},
|
|
4593
|
-
|
|
4623
|
+
p
|
|
4594
4624
|
);
|
|
4595
4625
|
case "email":
|
|
4596
4626
|
return /* @__PURE__ */ n(
|
|
4597
|
-
|
|
4627
|
+
X,
|
|
4598
4628
|
{
|
|
4599
4629
|
type: "email",
|
|
4600
|
-
label:
|
|
4601
|
-
value:
|
|
4602
|
-
onChange: (
|
|
4603
|
-
required:
|
|
4630
|
+
label: w.label,
|
|
4631
|
+
value: I[p] || "",
|
|
4632
|
+
onChange: (R) => C(p, R.target.value),
|
|
4633
|
+
required: p === "email"
|
|
4604
4634
|
},
|
|
4605
|
-
|
|
4635
|
+
p
|
|
4606
4636
|
);
|
|
4607
4637
|
case "tel":
|
|
4608
4638
|
return /* @__PURE__ */ n(
|
|
4609
|
-
|
|
4639
|
+
X,
|
|
4610
4640
|
{
|
|
4611
4641
|
type: "tel",
|
|
4612
|
-
label:
|
|
4613
|
-
value:
|
|
4614
|
-
onChange: (
|
|
4615
|
-
required:
|
|
4642
|
+
label: w.label,
|
|
4643
|
+
value: I[p] || "",
|
|
4644
|
+
onChange: (R) => C(p, R.target.value),
|
|
4645
|
+
required: p === "phonenumber"
|
|
4616
4646
|
},
|
|
4617
|
-
|
|
4647
|
+
p
|
|
4618
4648
|
);
|
|
4619
4649
|
case "text":
|
|
4620
4650
|
default:
|
|
4621
4651
|
return /* @__PURE__ */ n(
|
|
4622
|
-
|
|
4652
|
+
X,
|
|
4623
4653
|
{
|
|
4624
4654
|
type: "text",
|
|
4625
|
-
label:
|
|
4626
|
-
value:
|
|
4627
|
-
onChange: (
|
|
4628
|
-
required:
|
|
4655
|
+
label: w.label,
|
|
4656
|
+
value: I[p] || "",
|
|
4657
|
+
onChange: (R) => C(p, R.target.value),
|
|
4658
|
+
required: p === "firstName" || p === "lastName" || p === "externalRefId"
|
|
4629
4659
|
},
|
|
4630
|
-
|
|
4660
|
+
p
|
|
4631
4661
|
);
|
|
4632
4662
|
}
|
|
4633
4663
|
};
|
|
4634
|
-
return
|
|
4635
|
-
/* @__PURE__ */ n(
|
|
4664
|
+
return y ? /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
|
|
4665
|
+
/* @__PURE__ */ n(ce, { className: "my-8" }),
|
|
4636
4666
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading form..." })
|
|
4637
|
-
] }) }) }) : /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n("form", { onSubmit:
|
|
4638
|
-
/* @__PURE__ */ n(
|
|
4667
|
+
] }) }) }) : /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n("form", { onSubmit: E, children: /* @__PURE__ */ o(L, { children: [
|
|
4668
|
+
/* @__PURE__ */ n(ee, { children: /* @__PURE__ */ n(
|
|
4639
4669
|
Ze,
|
|
4640
4670
|
{
|
|
4641
4671
|
title: "Create Applicant",
|
|
4642
4672
|
subtitle: "Please fill in the required information to begin the KYC verification process."
|
|
4643
4673
|
}
|
|
4644
4674
|
) }),
|
|
4645
|
-
/* @__PURE__ */ o(
|
|
4646
|
-
|
|
4675
|
+
/* @__PURE__ */ o(T, { children: [
|
|
4676
|
+
m && /* @__PURE__ */ n("div", { className: "mb-6 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
|
|
4647
4677
|
/* @__PURE__ */ n("strong", { children: "Error:" }),
|
|
4648
4678
|
" ",
|
|
4649
|
-
|
|
4679
|
+
m
|
|
4650
4680
|
] }) }),
|
|
4651
|
-
/* @__PURE__ */ n("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children:
|
|
4681
|
+
/* @__PURE__ */ n("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: S.map((p) => M(p)) })
|
|
4652
4682
|
] }),
|
|
4653
|
-
/* @__PURE__ */ o(
|
|
4654
|
-
s && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: s, disabled:
|
|
4655
|
-
/* @__PURE__ */ n(j, { type: "submit", isLoading:
|
|
4683
|
+
/* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
|
|
4684
|
+
s && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: s, disabled: g || c, children: "Cancel" }),
|
|
4685
|
+
/* @__PURE__ */ n(j, { type: "submit", isLoading: g || c, children: "Create Applicant" })
|
|
4656
4686
|
] })
|
|
4657
4687
|
] }) }) });
|
|
4658
4688
|
}, Wr = ({
|
|
@@ -4664,36 +4694,36 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4664
4694
|
}) => {
|
|
4665
4695
|
const {
|
|
4666
4696
|
progress: i,
|
|
4667
|
-
currentStep:
|
|
4668
|
-
steps:
|
|
4697
|
+
currentStep: l,
|
|
4698
|
+
steps: c,
|
|
4669
4699
|
workflowKey: d,
|
|
4670
4700
|
nextWorkflowKey: u,
|
|
4671
|
-
hasWorkflowChanged:
|
|
4672
|
-
isLoading:
|
|
4673
|
-
error:
|
|
4674
|
-
moveBack:
|
|
4675
|
-
refreshProgress:
|
|
4676
|
-
} = Gt(t), [
|
|
4677
|
-
if (
|
|
4678
|
-
|
|
4679
|
-
}, [
|
|
4701
|
+
hasWorkflowChanged: y,
|
|
4702
|
+
isLoading: x,
|
|
4703
|
+
error: g,
|
|
4704
|
+
moveBack: b,
|
|
4705
|
+
refreshProgress: m
|
|
4706
|
+
} = Gt(t), [f, k] = ie.useState(!1);
|
|
4707
|
+
if (ie.useEffect(() => {
|
|
4708
|
+
g && r && r(g);
|
|
4709
|
+
}, [g, r]), ie.useEffect(() => {
|
|
4680
4710
|
i != null && i.workflowResult && e && e(i.workflowResult);
|
|
4681
|
-
}, [i == null ? void 0 : i.workflowResult, e]),
|
|
4711
|
+
}, [i == null ? void 0 : i.workflowResult, e]), ie.useEffect(() => {
|
|
4682
4712
|
s === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
|
|
4683
|
-
}, [s]),
|
|
4684
|
-
|
|
4685
|
-
}, [
|
|
4686
|
-
return /* @__PURE__ */ n("div", { className: a, children: /* @__PURE__ */ n(
|
|
4687
|
-
/* @__PURE__ */ n(
|
|
4713
|
+
}, [s]), ie.useEffect(() => {
|
|
4714
|
+
y && k(!1);
|
|
4715
|
+
}, [y]), x || !i)
|
|
4716
|
+
return /* @__PURE__ */ n("div", { className: a, children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
|
|
4717
|
+
/* @__PURE__ */ n(ce, { className: "my-8" }),
|
|
4688
4718
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading workflow..." })
|
|
4689
4719
|
] }) }) });
|
|
4690
|
-
if (
|
|
4691
|
-
return /* @__PURE__ */ n("div", { className: a, children: /* @__PURE__ */ n(
|
|
4720
|
+
if (g)
|
|
4721
|
+
return /* @__PURE__ */ n("div", { className: a, children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
|
|
4692
4722
|
/* @__PURE__ */ n("p", { className: "text-danger-500 text-lg mb-4", children: "An error occurred" }),
|
|
4693
|
-
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children:
|
|
4723
|
+
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: g.message })
|
|
4694
4724
|
] }) }) }) });
|
|
4695
|
-
if (
|
|
4696
|
-
return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ n(
|
|
4725
|
+
if (y && !f)
|
|
4726
|
+
return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
|
|
4697
4727
|
/* @__PURE__ */ n("div", { className: "mb-6", children: /* @__PURE__ */ n("div", { className: "inline-flex items-center justify-center w-16 h-16 rounded-full bg-blue-100 dark:bg-blue-900 mb-4", children: /* @__PURE__ */ n("svg", { className: "w-8 h-8 text-blue-600 dark:text-blue-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("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" }) }) }) }),
|
|
4698
4728
|
/* @__PURE__ */ n("h3", { className: "text-xl font-semibold text-gray-900 dark:text-white mb-2", children: "Workflow Transition" }),
|
|
4699
4729
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mb-6", children: "Your application workflow has been updated based on your progress." }),
|
|
@@ -4714,15 +4744,15 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4714
4744
|
/* @__PURE__ */ n(
|
|
4715
4745
|
"button",
|
|
4716
4746
|
{
|
|
4717
|
-
onClick: () =>
|
|
4747
|
+
onClick: () => k(!0),
|
|
4718
4748
|
className: "px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-lg transition-colors",
|
|
4719
4749
|
children: "Continue with New Workflow"
|
|
4720
4750
|
}
|
|
4721
4751
|
)
|
|
4722
4752
|
] }) }) }) });
|
|
4723
|
-
if (i.status ===
|
|
4753
|
+
if (i.status === le.Finished || i.status === le.OnHold)
|
|
4724
4754
|
return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ n(
|
|
4725
|
-
|
|
4755
|
+
je,
|
|
4726
4756
|
{
|
|
4727
4757
|
kycStatus: i.kycStatus,
|
|
4728
4758
|
reviewStatus: i.reviewStatus,
|
|
@@ -4734,81 +4764,81 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4734
4764
|
}
|
|
4735
4765
|
}
|
|
4736
4766
|
) });
|
|
4737
|
-
if (!
|
|
4738
|
-
return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ n(
|
|
4739
|
-
/* @__PURE__ */ n(
|
|
4740
|
-
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: i.status ===
|
|
4767
|
+
if (!l)
|
|
4768
|
+
return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
|
|
4769
|
+
/* @__PURE__ */ n(ce, { className: "my-8" }),
|
|
4770
|
+
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: i.status === le.IdentityPending ? "Loading identity verification..." : "Loading current step..." })
|
|
4741
4771
|
] }) }) });
|
|
4742
|
-
const
|
|
4743
|
-
const
|
|
4772
|
+
const h = () => {
|
|
4773
|
+
const v = c.filter((C) => C.visibility !== !1), S = v.findIndex((C) => C.order === l.order), I = S >= 0 ? S + 1 : 1, P = v.length;
|
|
4744
4774
|
return /* @__PURE__ */ o("div", { className: "mb-6", children: [
|
|
4745
4775
|
/* @__PURE__ */ o("div", { className: "flex items-start justify-between mb-4", children: [
|
|
4746
4776
|
/* @__PURE__ */ n(Ze, {}),
|
|
4747
|
-
/* @__PURE__ */ o(
|
|
4777
|
+
/* @__PURE__ */ o(he, { variant: i.status === 1 ? "info" : "success", children: [
|
|
4748
4778
|
"Step ",
|
|
4749
|
-
|
|
4779
|
+
I,
|
|
4750
4780
|
" of ",
|
|
4751
|
-
|
|
4781
|
+
P
|
|
4752
4782
|
] })
|
|
4753
4783
|
] }),
|
|
4754
|
-
/* @__PURE__ */ n("div", { className: "flex items-center", children:
|
|
4755
|
-
const
|
|
4756
|
-
return /* @__PURE__ */ o(
|
|
4784
|
+
/* @__PURE__ */ n("div", { className: "flex items-center", children: v.map((C, E) => {
|
|
4785
|
+
const M = E < S, B = C.order === l.order;
|
|
4786
|
+
return /* @__PURE__ */ o(ie.Fragment, { children: [
|
|
4757
4787
|
/* @__PURE__ */ o("div", { className: "flex items-center", children: [
|
|
4758
4788
|
/* @__PURE__ */ n(
|
|
4759
4789
|
"div",
|
|
4760
4790
|
{
|
|
4761
4791
|
className: `
|
|
4762
4792
|
w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium
|
|
4763
|
-
${
|
|
4793
|
+
${M || B ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
|
|
4764
4794
|
`,
|
|
4765
|
-
children:
|
|
4795
|
+
children: E + 1
|
|
4766
4796
|
}
|
|
4767
4797
|
),
|
|
4768
4798
|
/* @__PURE__ */ n(
|
|
4769
4799
|
"span",
|
|
4770
4800
|
{
|
|
4771
|
-
className: `ml-2 text-sm ${
|
|
4772
|
-
children:
|
|
4801
|
+
className: `ml-2 text-sm ${B ? "font-semibold text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`,
|
|
4802
|
+
children: C.displayName
|
|
4773
4803
|
}
|
|
4774
4804
|
)
|
|
4775
4805
|
] }),
|
|
4776
|
-
|
|
4806
|
+
E < v.length - 1 && /* @__PURE__ */ n(
|
|
4777
4807
|
"div",
|
|
4778
4808
|
{
|
|
4779
|
-
className: `flex-1 h-0.5 mx-4 ${
|
|
4809
|
+
className: `flex-1 h-0.5 mx-4 ${M ? "bg-primary-500" : "bg-gray-200 dark:bg-gray-700"}`
|
|
4780
4810
|
}
|
|
4781
4811
|
)
|
|
4782
|
-
] },
|
|
4812
|
+
] }, C.order);
|
|
4783
4813
|
}) })
|
|
4784
4814
|
] });
|
|
4785
|
-
},
|
|
4786
|
-
const
|
|
4815
|
+
}, A = () => {
|
|
4816
|
+
const v = {
|
|
4787
4817
|
applicantId: t,
|
|
4788
4818
|
onComplete: async () => {
|
|
4789
|
-
await
|
|
4819
|
+
await m();
|
|
4790
4820
|
},
|
|
4791
|
-
onBack:
|
|
4821
|
+
onBack: l.order > 0 ? b : void 0
|
|
4792
4822
|
};
|
|
4793
|
-
switch (
|
|
4823
|
+
switch (l.action) {
|
|
4794
4824
|
case U.Questionaries:
|
|
4795
|
-
return /* @__PURE__ */ n(
|
|
4825
|
+
return /* @__PURE__ */ n(xr, { ...v });
|
|
4796
4826
|
case U.UploadDocument:
|
|
4797
|
-
return /* @__PURE__ */ n(wr, { ...
|
|
4827
|
+
return /* @__PURE__ */ n(wr, { ...v });
|
|
4798
4828
|
case U.Overview:
|
|
4799
|
-
return /* @__PURE__ */ n(kr, { ...
|
|
4829
|
+
return /* @__PURE__ */ n(kr, { ...v });
|
|
4800
4830
|
case U.IdentitySdk:
|
|
4801
|
-
return /* @__PURE__ */ n(Ar, { ...
|
|
4831
|
+
return /* @__PURE__ */ n(Ar, { ...v });
|
|
4802
4832
|
case U.RiskScoring:
|
|
4803
|
-
return /* @__PURE__ */ n(Nr, { ...
|
|
4833
|
+
return /* @__PURE__ */ n(Nr, { ...v });
|
|
4804
4834
|
case U.AdditionalData:
|
|
4805
4835
|
case U.InvestorCategorization:
|
|
4806
|
-
return /* @__PURE__ */ n(Sr, { ...
|
|
4836
|
+
return /* @__PURE__ */ n(Sr, { ...v });
|
|
4807
4837
|
case U.AppropriatenessTest:
|
|
4808
|
-
return /* @__PURE__ */ n(Cr, { ...
|
|
4838
|
+
return /* @__PURE__ */ n(Cr, { ...v });
|
|
4809
4839
|
case U.ManualReview:
|
|
4810
4840
|
return /* @__PURE__ */ n(
|
|
4811
|
-
|
|
4841
|
+
je,
|
|
4812
4842
|
{
|
|
4813
4843
|
kycStatus: i.kycStatus,
|
|
4814
4844
|
reviewStatus: i.reviewStatus,
|
|
@@ -4817,108 +4847,108 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4817
4847
|
}
|
|
4818
4848
|
);
|
|
4819
4849
|
default:
|
|
4820
|
-
return /* @__PURE__ */ n(
|
|
4821
|
-
/* @__PURE__ */ n("div", { className: "mb-4", children: /* @__PURE__ */ n(
|
|
4850
|
+
return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { className: "py-12 text-center", children: [
|
|
4851
|
+
/* @__PURE__ */ n("div", { className: "mb-4", children: /* @__PURE__ */ n(ce, {}) }),
|
|
4822
4852
|
/* @__PURE__ */ o("p", { className: "text-gray-600 dark:text-gray-400 mb-2", children: [
|
|
4823
4853
|
"Processing step: ",
|
|
4824
|
-
|
|
4854
|
+
l.title || l.name
|
|
4825
4855
|
] }),
|
|
4826
4856
|
/* @__PURE__ */ o("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: [
|
|
4827
4857
|
"Action type: ",
|
|
4828
|
-
U[
|
|
4858
|
+
U[l.action]
|
|
4829
4859
|
] })
|
|
4830
4860
|
] }) });
|
|
4831
4861
|
}
|
|
4832
4862
|
};
|
|
4833
4863
|
return /* @__PURE__ */ o("div", { className: `metakyc-sdk ${a || ""}`, children: [
|
|
4834
|
-
|
|
4835
|
-
|
|
4864
|
+
h(),
|
|
4865
|
+
A()
|
|
4836
4866
|
] });
|
|
4837
4867
|
};
|
|
4838
4868
|
export {
|
|
4839
4869
|
Tr as ALL_APPLICANT_FIELDS,
|
|
4840
4870
|
st as ApplicantProgressOnHoldReason,
|
|
4841
|
-
|
|
4842
|
-
|
|
4871
|
+
le as ApplicantProgressStatus,
|
|
4872
|
+
xt as ApplicantService,
|
|
4843
4873
|
it as ApplicantStatus,
|
|
4844
4874
|
ut as AppropriatenessQuestionType,
|
|
4845
4875
|
Nt as AppropriatenessTestService,
|
|
4846
4876
|
Cr as AppropriatenessTestStep,
|
|
4847
|
-
|
|
4877
|
+
he as Badge,
|
|
4848
4878
|
Et as BaseInformationService,
|
|
4849
4879
|
j as Button,
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4880
|
+
L as Card,
|
|
4881
|
+
T as CardContent,
|
|
4882
|
+
ne as CardFooter,
|
|
4883
|
+
ee as CardHeader,
|
|
4854
4884
|
Yr as CreateApplicantForm,
|
|
4855
4885
|
ht as CriteriaBuiltInType,
|
|
4856
4886
|
gt as DEFAULT_VISIBLE_FIELDS,
|
|
4857
4887
|
dt as DocumentReviewStatus,
|
|
4858
4888
|
bt as EndpointBuilder,
|
|
4859
|
-
|
|
4889
|
+
ve as ErrorHandler,
|
|
4860
4890
|
Bt as EventEmitter,
|
|
4861
4891
|
yt as FIELD_METADATA,
|
|
4862
4892
|
ct as FileType,
|
|
4863
4893
|
nr as FileUpload,
|
|
4864
|
-
|
|
4894
|
+
Se as GenderType,
|
|
4865
4895
|
Ze as Header,
|
|
4866
|
-
|
|
4867
|
-
|
|
4896
|
+
vt as HttpClient,
|
|
4897
|
+
fe as IdentityProviderManager,
|
|
4868
4898
|
At as IdentityService,
|
|
4869
|
-
|
|
4899
|
+
oe as IdentityVerificationProvider,
|
|
4870
4900
|
Ar as IdentityVerificationStep,
|
|
4871
|
-
|
|
4901
|
+
X as Input,
|
|
4872
4902
|
It as InvestorCategorizationService,
|
|
4873
4903
|
Sr as InvestorCategorizationStep,
|
|
4874
|
-
|
|
4904
|
+
re as InvestorCategorizationType,
|
|
4875
4905
|
pt as InvestorCategoryType,
|
|
4876
4906
|
ot as KycProcessStatus,
|
|
4877
|
-
|
|
4878
|
-
|
|
4907
|
+
pe as KycStatus,
|
|
4908
|
+
je as KycStatusDisplay,
|
|
4879
4909
|
Wr as KycWorkflow,
|
|
4880
4910
|
Er as Logo,
|
|
4881
4911
|
Ue as MetaKYCContext,
|
|
4882
|
-
|
|
4912
|
+
de as MetaKYCError,
|
|
4883
4913
|
Or as MetaKYCProvider,
|
|
4884
4914
|
_t as OnfidoProvider,
|
|
4885
4915
|
St as OverviewService,
|
|
4886
4916
|
kr as OverviewStep,
|
|
4887
4917
|
sr as PhoneInput,
|
|
4888
4918
|
wt as QuestionnaireService,
|
|
4889
|
-
|
|
4890
|
-
|
|
4919
|
+
xr as QuestionnaireStep,
|
|
4920
|
+
ge as ReviewStatus,
|
|
4891
4921
|
mt as RiskCriteriaType,
|
|
4892
4922
|
at as RiskLevel,
|
|
4893
4923
|
Ct as RiskScoringService,
|
|
4894
4924
|
Nr as RiskScoringStep,
|
|
4895
4925
|
Kt as SardinAIProvider,
|
|
4896
|
-
|
|
4897
|
-
|
|
4926
|
+
ye as Select,
|
|
4927
|
+
ce as Spinner,
|
|
4898
4928
|
zt as StepRouter,
|
|
4899
4929
|
jt as SumsubProvider,
|
|
4900
4930
|
Ut as ThemeManager,
|
|
4901
|
-
|
|
4931
|
+
W as ThemePreset,
|
|
4902
4932
|
Mt as ThemeService,
|
|
4903
4933
|
kt as UploadDocumentService,
|
|
4904
4934
|
wr as UploadDocumentStep,
|
|
4905
4935
|
lt as UserType,
|
|
4906
|
-
|
|
4936
|
+
Pe as ValueDataType,
|
|
4907
4937
|
$t as WorkflowOrchestrator,
|
|
4908
|
-
|
|
4938
|
+
Ne as WorkflowResultType,
|
|
4909
4939
|
Ot as WorkflowState,
|
|
4910
4940
|
U as WorkflowStepAction,
|
|
4911
4941
|
Vr as appropriatenessTestSchema,
|
|
4912
4942
|
Kr as clearAllStorage,
|
|
4913
4943
|
Yt as clearApplicantId,
|
|
4914
4944
|
Qt as clearWorkflowState,
|
|
4915
|
-
|
|
4945
|
+
te as cn,
|
|
4916
4946
|
Rt as corporateTheme,
|
|
4917
4947
|
ft as defaultConfig,
|
|
4918
|
-
|
|
4948
|
+
Z as defaultTheme,
|
|
4919
4949
|
qt as fileToBase64,
|
|
4920
4950
|
Dt as fintechTheme,
|
|
4921
|
-
|
|
4951
|
+
Ie as formatFileSize,
|
|
4922
4952
|
Hr as generateAppropriatenessSchema,
|
|
4923
4953
|
yr as generateQuestionnaireSchema,
|
|
4924
4954
|
br as generateRiskScoringSchema,
|
|
@@ -4940,7 +4970,7 @@ export {
|
|
|
4940
4970
|
Ur as useAppropriatenessTest,
|
|
4941
4971
|
er as useIdentityVerification,
|
|
4942
4972
|
Gt as useKycWorkflow,
|
|
4943
|
-
|
|
4973
|
+
se as useMetaKYC,
|
|
4944
4974
|
Xt as useOverview,
|
|
4945
4975
|
Zt as useQuestionnaire,
|
|
4946
4976
|
tr as useRiskScoring,
|