@vpdev2/metakyc-sdk 1.0.26 → 1.0.28
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/index.cjs +7 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +782 -773
- package/dist/index.js.map +1 -1
- package/dist/services/theme.service.d.ts.map +1 -1
- package/dist/theme/theme-manager.d.ts.map +1 -1
- package/dist/types/theme.d.ts +3 -0
- package/dist/types/theme.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,11 +3,11 @@ var Xe = (t, e, r) => e in t ? Je(t, e, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var K = (t, e, r) => Xe(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
4
|
import et from "axios";
|
|
5
5
|
import * as Me from "react";
|
|
6
|
-
import
|
|
6
|
+
import se, { 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 De, set as Ee, appendErrors as
|
|
9
|
-
import { z as
|
|
10
|
-
var
|
|
8
|
+
import { get as De, set as Ee, appendErrors as je, useForm as Te, Controller as J } from "react-hook-form";
|
|
9
|
+
import { z as me } from "zod";
|
|
10
|
+
var O = /* @__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))(O || {}), 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 || {}), ce = /* @__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))(ce || {}), 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 || {}), ge = /* @__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))(ge || {}), ye = /* @__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))(ye || {}), 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 || {}), le = /* @__PURE__ */ ((t) => (t[t.Onfido = 0] = "Onfido", t[t.Sumsub = 2] = "Sumsub", t[t.SardinAI = 3] = "SardinAI", t))(le || {}), 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 || {}), ne = /* @__PURE__ */ ((t) => (t[t.Individual = 0] = "Individual", t[t.Sophisticated = 1] = "Sophisticated", t[t.HighNetWorth = 2] = "HighNetWorth", t[t.Business = 3] = "Business", t))(ne || {}), 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 G = /* @__PURE__ */ ((t) => (t.Default = "default", t.Corporate = "corporate", t.Fintech = "fintech", t.Healthcare = "healthcare", t.Modern = "modern", t.Minimal = "minimal", t))(G || {});
|
|
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
|
|
123
|
+
class ue extends Error {
|
|
124
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 = l, Object.setPrototypeOf(this,
|
|
127
|
+
this.code = s, this.details = a, this.validationErrors = i, this.name = "MetaKYCError", this.response = l, Object.setPrototypeOf(this, ue.prototype);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
class
|
|
130
|
+
class xe {
|
|
131
131
|
/**
|
|
132
132
|
* Process an error from the API response
|
|
133
133
|
*/
|
|
134
134
|
static handleApiError(e) {
|
|
135
|
-
return new
|
|
135
|
+
return new ue(
|
|
136
136
|
e.message || "An unknown error occurred",
|
|
137
137
|
e.code,
|
|
138
138
|
e.details || void 0,
|
|
@@ -145,36 +145,36 @@ class ve {
|
|
|
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 ue(
|
|
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 ue(
|
|
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 ue(
|
|
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 ue(
|
|
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 ue(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 ue;
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
180
|
class vt {
|
|
@@ -218,7 +218,7 @@ class vt {
|
|
|
218
218
|
});
|
|
219
219
|
return this.handleResponse(i);
|
|
220
220
|
} catch (a) {
|
|
221
|
-
throw
|
|
221
|
+
throw xe.handleAxiosError(a);
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
224
|
/**
|
|
@@ -229,7 +229,7 @@ class vt {
|
|
|
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 xe.handleAxiosError(a);
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
235
|
/**
|
|
@@ -240,7 +240,7 @@ class vt {
|
|
|
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 xe.handleAxiosError(a);
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
/**
|
|
@@ -253,7 +253,7 @@ class vt {
|
|
|
253
253
|
});
|
|
254
254
|
return this.handleResponse(i);
|
|
255
255
|
} catch (a) {
|
|
256
|
-
throw
|
|
256
|
+
throw xe.handleAxiosError(a);
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
259
|
/**
|
|
@@ -262,7 +262,7 @@ class vt {
|
|
|
262
262
|
handleResponse(e) {
|
|
263
263
|
const r = e.data;
|
|
264
264
|
if (!r.success && r.error)
|
|
265
|
-
throw
|
|
265
|
+
throw xe.handleApiError(r.error);
|
|
266
266
|
return r;
|
|
267
267
|
}
|
|
268
268
|
/**
|
|
@@ -880,14 +880,14 @@ const Z = {
|
|
|
880
880
|
inputHeight: "2.25rem"
|
|
881
881
|
}
|
|
882
882
|
}, Tt = {
|
|
883
|
-
[
|
|
884
|
-
[
|
|
885
|
-
[
|
|
886
|
-
[
|
|
887
|
-
[
|
|
888
|
-
[
|
|
883
|
+
[G.Default]: Z,
|
|
884
|
+
[G.Corporate]: Rt,
|
|
885
|
+
[G.Fintech]: Dt,
|
|
886
|
+
[G.Healthcare]: Pt,
|
|
887
|
+
[G.Modern]: Ft,
|
|
888
|
+
[G.Minimal]: Lt
|
|
889
889
|
};
|
|
890
|
-
function
|
|
890
|
+
function we(t) {
|
|
891
891
|
return Tt[t] || Z;
|
|
892
892
|
}
|
|
893
893
|
class Mt {
|
|
@@ -905,16 +905,16 @@ class Mt {
|
|
|
905
905
|
"GetThemeConfiguration"
|
|
906
906
|
);
|
|
907
907
|
if (!r.result.isEnabled)
|
|
908
|
-
return
|
|
909
|
-
let s = r.result.preset ?
|
|
908
|
+
return we(G.Default);
|
|
909
|
+
let s = r.result.preset ? we(r.result.preset) : we(G.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,
|
|
913
913
|
...r.result.darkMode.colors
|
|
914
914
|
}
|
|
915
|
-
}), s;
|
|
915
|
+
}), r.result.applicantFormVisibleFields && r.result.applicantFormVisibleFields.length > 0 && (s.applicantFormVisibleFields = r.result.applicantFormVisibleFields), s;
|
|
916
916
|
} catch (r) {
|
|
917
|
-
return console.warn("[ThemeService] Failed to fetch theme configuration:", r),
|
|
917
|
+
return console.warn("[ThemeService] Failed to fetch theme configuration:", r), we(G.Default);
|
|
918
918
|
}
|
|
919
919
|
}
|
|
920
920
|
/**
|
|
@@ -928,19 +928,19 @@ class Mt {
|
|
|
928
928
|
*/
|
|
929
929
|
getAvailablePresets() {
|
|
930
930
|
return [
|
|
931
|
-
{ id:
|
|
932
|
-
{ id:
|
|
933
|
-
{ id:
|
|
934
|
-
{ id:
|
|
935
|
-
{ id:
|
|
936
|
-
{ id:
|
|
931
|
+
{ id: G.Default, name: "Default" },
|
|
932
|
+
{ id: G.Corporate, name: "Corporate" },
|
|
933
|
+
{ id: G.Fintech, name: "Fintech" },
|
|
934
|
+
{ id: G.Healthcare, name: "Healthcare" },
|
|
935
|
+
{ id: G.Modern, name: "Modern" },
|
|
936
|
+
{ id: G.Minimal, name: "Minimal" }
|
|
937
937
|
];
|
|
938
938
|
}
|
|
939
939
|
/**
|
|
940
940
|
* Preview theme (doesn't save)
|
|
941
941
|
*/
|
|
942
942
|
getPreviewTheme(e, r) {
|
|
943
|
-
const s =
|
|
943
|
+
const s = we(e);
|
|
944
944
|
return r ? {
|
|
945
945
|
...s,
|
|
946
946
|
...r,
|
|
@@ -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) || ce.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 === ce.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 === ce.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 === ce.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 === ce.Finished && e.workflowResult && this.events.emit("completed", e.workflowResult);
|
|
1083
1083
|
}
|
|
1084
1084
|
/**
|
|
1085
1085
|
* Set error
|
|
@@ -1164,7 +1164,7 @@ class zt {
|
|
|
1164
1164
|
async loadStepData(e, r) {
|
|
1165
1165
|
const s = this.getHandler(e);
|
|
1166
1166
|
if (!s)
|
|
1167
|
-
throw new Error(`No handler registered for step action: ${
|
|
1167
|
+
throw new Error(`No handler registered for step action: ${O[e]}`);
|
|
1168
1168
|
return s.loadData(r);
|
|
1169
1169
|
}
|
|
1170
1170
|
/**
|
|
@@ -1173,7 +1173,7 @@ class zt {
|
|
|
1173
1173
|
async submitStepData(e, r) {
|
|
1174
1174
|
const s = this.getHandler(e);
|
|
1175
1175
|
if (!s)
|
|
1176
|
-
throw new Error(`No handler registered for step action: ${
|
|
1176
|
+
throw new Error(`No handler registered for step action: ${O[e]}`);
|
|
1177
1177
|
return s.submitData(r);
|
|
1178
1178
|
}
|
|
1179
1179
|
}
|
|
@@ -1187,47 +1187,47 @@ class $t {
|
|
|
1187
1187
|
* Register all step handlers
|
|
1188
1188
|
*/
|
|
1189
1189
|
registerStepHandlers() {
|
|
1190
|
-
this.stepRouter.registerHandler(
|
|
1190
|
+
this.stepRouter.registerHandler(O.Questionaries, {
|
|
1191
1191
|
loadData: (e) => this.questionnaireService.getQuestionnaire(e),
|
|
1192
1192
|
submitData: async (e) => {
|
|
1193
1193
|
await this.questionnaireService.fillQuestionnaire(e);
|
|
1194
1194
|
}
|
|
1195
|
-
}), this.stepRouter.registerHandler(
|
|
1195
|
+
}), this.stepRouter.registerHandler(O.UploadDocument, {
|
|
1196
1196
|
loadData: (e) => this.uploadDocumentService.getUploadDocument(e),
|
|
1197
1197
|
submitData: (e) => this.uploadDocumentService.fillUploadDocument(e)
|
|
1198
|
-
}), this.stepRouter.registerHandler(
|
|
1198
|
+
}), this.stepRouter.registerHandler(O.AppropriatenessTest, {
|
|
1199
1199
|
loadData: (e) => this.appropriatenessTestService.getAppropriatenessTest(e),
|
|
1200
1200
|
submitData: async (e) => {
|
|
1201
1201
|
await this.appropriatenessTestService.fillAppropriatenessTest(e);
|
|
1202
1202
|
}
|
|
1203
|
-
}), this.stepRouter.registerHandler(
|
|
1203
|
+
}), this.stepRouter.registerHandler(O.Overview, {
|
|
1204
1204
|
loadData: (e) => this.overviewService.getOverviewData(e),
|
|
1205
1205
|
submitData: (e) => this.overviewService.passOverview(e.applicantId)
|
|
1206
|
-
}), this.stepRouter.registerHandler(
|
|
1206
|
+
}), this.stepRouter.registerHandler(O.RiskScoring, {
|
|
1207
1207
|
loadData: (e) => this.riskScoringService.getRiskCriterias(e),
|
|
1208
1208
|
submitData: async (e) => {
|
|
1209
1209
|
await this.riskScoringService.submitRiskScoring(e);
|
|
1210
1210
|
}
|
|
1211
|
-
}), this.stepRouter.registerHandler(
|
|
1211
|
+
}), this.stepRouter.registerHandler(O.IdentitySdk, {
|
|
1212
1212
|
loadData: async (e) => ({
|
|
1213
1213
|
applicantId: e,
|
|
1214
1214
|
message: "Identity verification required"
|
|
1215
1215
|
}),
|
|
1216
1216
|
submitData: async () => {
|
|
1217
1217
|
}
|
|
1218
|
-
}), this.stepRouter.registerHandler(
|
|
1218
|
+
}), this.stepRouter.registerHandler(O.InvestorCategorization, {
|
|
1219
1219
|
loadData: (e) => this.investorCategorizationService.getInvestorCategorization(e),
|
|
1220
1220
|
submitData: async (e) => {
|
|
1221
1221
|
await this.investorCategorizationService.setInvestorCategorization(e);
|
|
1222
1222
|
}
|
|
1223
|
-
}), this.stepRouter.registerHandler(
|
|
1223
|
+
}), this.stepRouter.registerHandler(O.ManualReview, {
|
|
1224
1224
|
loadData: async (e) => ({
|
|
1225
1225
|
applicantId: e,
|
|
1226
1226
|
message: "Your application is under manual review"
|
|
1227
1227
|
}),
|
|
1228
1228
|
submitData: async () => {
|
|
1229
1229
|
}
|
|
1230
|
-
}), this.stepRouter.registerHandler(
|
|
1230
|
+
}), this.stepRouter.registerHandler(O.AdditionalData, {
|
|
1231
1231
|
loadData: async (e) => ({
|
|
1232
1232
|
applicantId: e,
|
|
1233
1233
|
message: "Additional data required"
|
|
@@ -1338,7 +1338,7 @@ function Br(t) {
|
|
|
1338
1338
|
const e = document.getElementById(t);
|
|
1339
1339
|
e && e.remove();
|
|
1340
1340
|
}
|
|
1341
|
-
class
|
|
1341
|
+
class _t {
|
|
1342
1342
|
constructor(e) {
|
|
1343
1343
|
K(this, "sdk", null);
|
|
1344
1344
|
K(this, "config");
|
|
@@ -1393,7 +1393,7 @@ class jt {
|
|
|
1393
1393
|
this.sdk && this.sdk.on("idCheck.onError", e);
|
|
1394
1394
|
}
|
|
1395
1395
|
}
|
|
1396
|
-
class
|
|
1396
|
+
class jt {
|
|
1397
1397
|
constructor(e) {
|
|
1398
1398
|
K(this, "sdk", null);
|
|
1399
1399
|
K(this, "config");
|
|
@@ -1603,17 +1603,17 @@ class Ut {
|
|
|
1603
1603
|
this.sardineContext && (this.sardineContext = null);
|
|
1604
1604
|
}
|
|
1605
1605
|
}
|
|
1606
|
-
class
|
|
1606
|
+
class be {
|
|
1607
1607
|
/**
|
|
1608
1608
|
* Create a provider instance
|
|
1609
1609
|
*/
|
|
1610
1610
|
static createProvider(e, r) {
|
|
1611
1611
|
switch (e) {
|
|
1612
|
-
case
|
|
1613
|
-
return new jt(r);
|
|
1614
|
-
case oe.Onfido:
|
|
1612
|
+
case le.Sumsub:
|
|
1615
1613
|
return new _t(r);
|
|
1616
|
-
case
|
|
1614
|
+
case le.Onfido:
|
|
1615
|
+
return new jt(r);
|
|
1616
|
+
case le.SardinAI:
|
|
1617
1617
|
return new Ut(r);
|
|
1618
1618
|
default:
|
|
1619
1619
|
throw new Error(`Unsupported identity provider: ${e}`);
|
|
@@ -1625,7 +1625,7 @@ class fe {
|
|
|
1625
1625
|
static parseProviderConfig(e, r, s) {
|
|
1626
1626
|
var a;
|
|
1627
1627
|
switch (e) {
|
|
1628
|
-
case
|
|
1628
|
+
case le.Sumsub:
|
|
1629
1629
|
return {
|
|
1630
1630
|
accessToken: r.accessToken || r.token,
|
|
1631
1631
|
applicantEmail: r.email,
|
|
@@ -1633,11 +1633,11 @@ class fe {
|
|
|
1633
1633
|
externalUserId: r.externalUserId,
|
|
1634
1634
|
lang: r.lang || "en"
|
|
1635
1635
|
};
|
|
1636
|
-
case
|
|
1636
|
+
case le.Onfido:
|
|
1637
1637
|
return {
|
|
1638
1638
|
token: r.token || r.sdkToken
|
|
1639
1639
|
};
|
|
1640
|
-
case
|
|
1640
|
+
case le.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,
|
|
@@ -1747,7 +1747,8 @@ class Kt {
|
|
|
1747
1747
|
...(r = Z.darkMode) == null ? void 0 : r.colors,
|
|
1748
1748
|
...e.darkMode.colors
|
|
1749
1749
|
}
|
|
1750
|
-
} : Z.darkMode
|
|
1750
|
+
} : Z.darkMode,
|
|
1751
|
+
applicantFormVisibleFields: e.applicantFormVisibleFields
|
|
1751
1752
|
};
|
|
1752
1753
|
}
|
|
1753
1754
|
/**
|
|
@@ -1776,20 +1777,20 @@ class Kt {
|
|
|
1776
1777
|
}
|
|
1777
1778
|
}
|
|
1778
1779
|
const Ke = tt(null), Or = ({ config: t, children: e }) => {
|
|
1779
|
-
const [r, s] = N(null), a =
|
|
1780
|
-
const d = new vt(t), u = new xt(d),
|
|
1780
|
+
const [r, s] = N(null), a = se.useRef(!1), i = se.useRef(!1), l = Re(() => {
|
|
1781
|
+
const d = new vt(t), u = new xt(d), g = new wt(d), v = new kt(d), p = new Nt(d), f = new St(d), m = new Ct(d), y = new At(d), k = new Et(d), h = new It(d), I = new Mt(d), S = new Kt();
|
|
1781
1782
|
return {
|
|
1782
1783
|
httpClient: d,
|
|
1783
1784
|
applicantService: u,
|
|
1784
|
-
questionnaireService:
|
|
1785
|
+
questionnaireService: g,
|
|
1785
1786
|
uploadDocumentService: v,
|
|
1786
|
-
appropriatenessTestService:
|
|
1787
|
-
overviewService:
|
|
1787
|
+
appropriatenessTestService: p,
|
|
1788
|
+
overviewService: f,
|
|
1788
1789
|
riskScoringService: m,
|
|
1789
|
-
identityService:
|
|
1790
|
+
identityService: y,
|
|
1790
1791
|
baseInformationService: k,
|
|
1791
1792
|
investorCategorizationService: h,
|
|
1792
|
-
themeService:
|
|
1793
|
+
themeService: I,
|
|
1793
1794
|
themeManager: S
|
|
1794
1795
|
};
|
|
1795
1796
|
}, [t]), c = Re(() => ({
|
|
@@ -1807,7 +1808,7 @@ const Ke = tt(null), Or = ({ config: t, children: e }) => {
|
|
|
1807
1808
|
l.investorCategorizationService
|
|
1808
1809
|
)
|
|
1809
1810
|
}), [t, l, r]);
|
|
1810
|
-
return
|
|
1811
|
+
return Y(() => ((async () => {
|
|
1811
1812
|
if (a.current || i.current) {
|
|
1812
1813
|
console.log("[MetaKYC] Theme already loading or loaded, skipping...");
|
|
1813
1814
|
return;
|
|
@@ -1830,7 +1831,7 @@ const Ke = tt(null), Or = ({ config: t, children: e }) => {
|
|
|
1830
1831
|
l.themeManager.cleanup();
|
|
1831
1832
|
}), []), /* @__PURE__ */ n(Ke.Provider, { value: c, children: e });
|
|
1832
1833
|
};
|
|
1833
|
-
function
|
|
1834
|
+
function ie() {
|
|
1834
1835
|
const t = rt(Ke);
|
|
1835
1836
|
if (!t)
|
|
1836
1837
|
throw new Error("useMetaKYC must be used within a MetaKYCProvider");
|
|
@@ -1862,26 +1863,26 @@ function Ie(t) {
|
|
|
1862
1863
|
const e = 1024, r = ["Bytes", "KB", "MB", "GB"], s = Math.floor(Math.log(t) / Math.log(e));
|
|
1863
1864
|
return Math.round(t / Math.pow(e, s) * 100) / 100 + " " + r[s];
|
|
1864
1865
|
}
|
|
1865
|
-
function
|
|
1866
|
+
function _r(t) {
|
|
1866
1867
|
return t;
|
|
1867
1868
|
}
|
|
1868
1869
|
function te(...t) {
|
|
1869
1870
|
return t.filter(Boolean).join(" ");
|
|
1870
1871
|
}
|
|
1871
|
-
const
|
|
1872
|
+
const ve = {
|
|
1872
1873
|
APPLICANT_ID: "metakyc_applicant_id",
|
|
1873
1874
|
WORKFLOW_STATE: "metakyc_workflow_state"
|
|
1874
1875
|
};
|
|
1875
1876
|
function Ht(t) {
|
|
1876
1877
|
try {
|
|
1877
|
-
localStorage.setItem(
|
|
1878
|
+
localStorage.setItem(ve.APPLICANT_ID, t.toString());
|
|
1878
1879
|
} catch (e) {
|
|
1879
1880
|
console.warn("Failed to save applicant ID to storage:", e);
|
|
1880
1881
|
}
|
|
1881
1882
|
}
|
|
1882
1883
|
function Vt() {
|
|
1883
1884
|
try {
|
|
1884
|
-
const t = localStorage.getItem(
|
|
1885
|
+
const t = localStorage.getItem(ve.APPLICANT_ID);
|
|
1885
1886
|
return t ? parseInt(t, 10) : null;
|
|
1886
1887
|
} catch (t) {
|
|
1887
1888
|
return console.warn("Failed to retrieve applicant ID from storage:", t), null;
|
|
@@ -1889,21 +1890,21 @@ function Vt() {
|
|
|
1889
1890
|
}
|
|
1890
1891
|
function Yt() {
|
|
1891
1892
|
try {
|
|
1892
|
-
localStorage.removeItem(
|
|
1893
|
+
localStorage.removeItem(ve.APPLICANT_ID);
|
|
1893
1894
|
} catch (t) {
|
|
1894
1895
|
console.warn("Failed to clear applicant ID from storage:", t);
|
|
1895
1896
|
}
|
|
1896
1897
|
}
|
|
1897
1898
|
function Wt(t) {
|
|
1898
1899
|
try {
|
|
1899
|
-
localStorage.setItem(
|
|
1900
|
+
localStorage.setItem(ve.WORKFLOW_STATE, JSON.stringify(t));
|
|
1900
1901
|
} catch (e) {
|
|
1901
1902
|
console.warn("Failed to save workflow state to storage:", e);
|
|
1902
1903
|
}
|
|
1903
1904
|
}
|
|
1904
|
-
function
|
|
1905
|
+
function jr() {
|
|
1905
1906
|
try {
|
|
1906
|
-
const t = localStorage.getItem(
|
|
1907
|
+
const t = localStorage.getItem(ve.WORKFLOW_STATE);
|
|
1907
1908
|
return t ? JSON.parse(t) : null;
|
|
1908
1909
|
} catch (t) {
|
|
1909
1910
|
return console.warn("Failed to retrieve workflow state from storage:", t), null;
|
|
@@ -1911,7 +1912,7 @@ function _r() {
|
|
|
1911
1912
|
}
|
|
1912
1913
|
function Qt() {
|
|
1913
1914
|
try {
|
|
1914
|
-
localStorage.removeItem(
|
|
1915
|
+
localStorage.removeItem(ve.WORKFLOW_STATE);
|
|
1915
1916
|
} catch (t) {
|
|
1916
1917
|
console.warn("Failed to clear workflow state from storage:", t);
|
|
1917
1918
|
}
|
|
@@ -1920,10 +1921,10 @@ function Ur() {
|
|
|
1920
1921
|
Yt(), Qt();
|
|
1921
1922
|
}
|
|
1922
1923
|
function Gt(t) {
|
|
1923
|
-
const { createOrchestrator: e } =
|
|
1924
|
-
|
|
1924
|
+
const { createOrchestrator: e } = ie(), [r, s] = N(null), [a, i] = N(!1), [l, c] = N(null), d = H(null), u = t || Vt();
|
|
1925
|
+
Y(() => {
|
|
1925
1926
|
d.current || (d.current = e());
|
|
1926
|
-
}, [e]),
|
|
1927
|
+
}, [e]), Y(() => {
|
|
1927
1928
|
var S;
|
|
1928
1929
|
r && u && (Ht(u), Wt({
|
|
1929
1930
|
applicantId: u,
|
|
@@ -1934,40 +1935,40 @@ function Gt(t) {
|
|
|
1934
1935
|
nextWorkflowKey: r.nextWorkflowKey
|
|
1935
1936
|
}));
|
|
1936
1937
|
}, [r, u]);
|
|
1937
|
-
const
|
|
1938
|
+
const g = H(!1), v = H(!1), p = q(async () => {
|
|
1938
1939
|
if (!(!u || !d.current)) {
|
|
1939
|
-
if (
|
|
1940
|
+
if (g.current) {
|
|
1940
1941
|
console.log("[Workflow] Load already in progress, skipping...");
|
|
1941
1942
|
return;
|
|
1942
1943
|
}
|
|
1943
|
-
|
|
1944
|
+
g.current = !0, i(!0), c(null);
|
|
1944
1945
|
try {
|
|
1945
1946
|
const S = await d.current.initialize(u);
|
|
1946
1947
|
s(S), v.current = !0;
|
|
1947
1948
|
} catch (S) {
|
|
1948
1949
|
c(S);
|
|
1949
1950
|
} finally {
|
|
1950
|
-
i(!1),
|
|
1951
|
+
i(!1), g.current = !1;
|
|
1951
1952
|
}
|
|
1952
1953
|
}
|
|
1953
1954
|
}, [u]);
|
|
1954
|
-
|
|
1955
|
-
u && !v.current &&
|
|
1956
|
-
}, [u,
|
|
1957
|
-
const
|
|
1955
|
+
Y(() => {
|
|
1956
|
+
u && !v.current && p();
|
|
1957
|
+
}, [u, p]);
|
|
1958
|
+
const f = q(async () => {
|
|
1958
1959
|
if (d.current) {
|
|
1959
|
-
if (
|
|
1960
|
+
if (g.current) {
|
|
1960
1961
|
console.log("[Workflow] Refresh already in progress, skipping...");
|
|
1961
1962
|
return;
|
|
1962
1963
|
}
|
|
1963
|
-
|
|
1964
|
+
g.current = !0, i(!0), c(null);
|
|
1964
1965
|
try {
|
|
1965
1966
|
const S = await d.current.refreshProgress();
|
|
1966
1967
|
s(S);
|
|
1967
1968
|
} catch (S) {
|
|
1968
1969
|
c(S);
|
|
1969
1970
|
} finally {
|
|
1970
|
-
i(!1),
|
|
1971
|
+
i(!1), g.current = !1;
|
|
1971
1972
|
}
|
|
1972
1973
|
}
|
|
1973
1974
|
}, []), m = q(async () => {
|
|
@@ -1982,7 +1983,7 @@ function Gt(t) {
|
|
|
1982
1983
|
i(!1);
|
|
1983
1984
|
}
|
|
1984
1985
|
}
|
|
1985
|
-
}, []),
|
|
1986
|
+
}, []), y = q(async () => {
|
|
1986
1987
|
if (d.current) {
|
|
1987
1988
|
i(!0), c(null);
|
|
1988
1989
|
try {
|
|
@@ -2007,56 +2008,56 @@ function Gt(t) {
|
|
|
2007
2008
|
i(!1);
|
|
2008
2009
|
}
|
|
2009
2010
|
}
|
|
2010
|
-
}, []), h = Me.useMemo(() => r != null && r.stepInfoList ? [...r.stepInfoList].sort((S, w) => S.order - w.order) : [], [r == null ? void 0 : r.stepInfoList]),
|
|
2011
|
+
}, []), h = Me.useMemo(() => r != null && r.stepInfoList ? [...r.stepInfoList].sort((S, w) => S.order - w.order) : [], [r == null ? void 0 : r.stepInfoList]), I = Me.useMemo(() => r ? r.nextWorkflowKey && r.nextWorkflowKey !== r.workFlowKey : !1, [r]);
|
|
2011
2012
|
return {
|
|
2012
2013
|
progress: r,
|
|
2013
2014
|
applicantId: u,
|
|
2014
2015
|
currentStep: (r == null ? void 0 : r.currentStep) || null,
|
|
2015
2016
|
steps: h,
|
|
2016
|
-
status: (r == null ? void 0 : r.status) ||
|
|
2017
|
+
status: (r == null ? void 0 : r.status) || ce.None,
|
|
2017
2018
|
workflowResult: (r == null ? void 0 : r.workflowResult) || null,
|
|
2018
2019
|
workflowKey: r == null ? void 0 : r.workFlowKey,
|
|
2019
2020
|
nextWorkflowKey: r == null ? void 0 : r.nextWorkflowKey,
|
|
2020
|
-
hasWorkflowChanged:
|
|
2021
|
+
hasWorkflowChanged: I,
|
|
2021
2022
|
isLoading: a,
|
|
2022
2023
|
error: l,
|
|
2023
|
-
isComplete: (r == null ? void 0 : r.status) ===
|
|
2024
|
-
isOnHold: (r == null ? void 0 : r.status) ===
|
|
2025
|
-
refreshProgress:
|
|
2024
|
+
isComplete: (r == null ? void 0 : r.status) === ce.Finished,
|
|
2025
|
+
isOnHold: (r == null ? void 0 : r.status) === ce.OnHold,
|
|
2026
|
+
refreshProgress: f,
|
|
2026
2027
|
moveToNext: m,
|
|
2027
|
-
moveBack:
|
|
2028
|
+
moveBack: y,
|
|
2028
2029
|
submitCurrentStep: k,
|
|
2029
2030
|
orchestrator: d.current
|
|
2030
2031
|
};
|
|
2031
2032
|
}
|
|
2032
2033
|
function Zt(t) {
|
|
2033
|
-
const { questionnaireService: e } =
|
|
2034
|
+
const { questionnaireService: e } = ie(), [r, s] = N(null), [a, i] = N(!1), [l, c] = N(!1), [d, u] = N(null), g = H(!1), v = H(null), p = q(async () => {
|
|
2034
2035
|
if (t) {
|
|
2035
|
-
if (
|
|
2036
|
+
if (g.current) {
|
|
2036
2037
|
console.log("[Questionnaire] Load already in progress, skipping...");
|
|
2037
2038
|
return;
|
|
2038
2039
|
}
|
|
2039
|
-
|
|
2040
|
+
g.current = !0, i(!0), u(null);
|
|
2040
2041
|
try {
|
|
2041
2042
|
const m = await e.getQuestionnaire(t);
|
|
2042
2043
|
s(m), v.current = t;
|
|
2043
2044
|
} catch (m) {
|
|
2044
2045
|
u(m);
|
|
2045
2046
|
} finally {
|
|
2046
|
-
i(!1),
|
|
2047
|
+
i(!1), g.current = !1;
|
|
2047
2048
|
}
|
|
2048
2049
|
}
|
|
2049
2050
|
}, [t, e]);
|
|
2050
|
-
|
|
2051
|
-
t && v.current !== t &&
|
|
2051
|
+
Y(() => {
|
|
2052
|
+
t && v.current !== t && p();
|
|
2052
2053
|
}, [t]);
|
|
2053
|
-
const
|
|
2054
|
+
const f = q(
|
|
2054
2055
|
async (m) => {
|
|
2055
2056
|
c(!0), u(null);
|
|
2056
2057
|
try {
|
|
2057
2058
|
return await e.fillQuestionnaire(m);
|
|
2058
|
-
} catch (
|
|
2059
|
-
throw u(
|
|
2059
|
+
} catch (y) {
|
|
2060
|
+
throw u(y), y;
|
|
2060
2061
|
} finally {
|
|
2061
2062
|
c(!1);
|
|
2062
2063
|
}
|
|
@@ -2068,32 +2069,32 @@ function Zt(t) {
|
|
|
2068
2069
|
isLoading: a,
|
|
2069
2070
|
isSubmitting: l,
|
|
2070
2071
|
error: d,
|
|
2071
|
-
load:
|
|
2072
|
-
submit:
|
|
2072
|
+
load: p,
|
|
2073
|
+
submit: f
|
|
2073
2074
|
};
|
|
2074
2075
|
}
|
|
2075
2076
|
function Jt(t) {
|
|
2076
|
-
const { uploadDocumentService: e } =
|
|
2077
|
+
const { uploadDocumentService: e } = ie(), [r, s] = N(null), [a, i] = N(!1), [l, c] = N(!1), [d, u] = N(0), [g, v] = N(null), p = H(!1), f = H(null), m = q(async () => {
|
|
2077
2078
|
if (t) {
|
|
2078
|
-
if (
|
|
2079
|
+
if (p.current) {
|
|
2079
2080
|
console.log("[UploadDocument] Load already in progress, skipping...");
|
|
2080
2081
|
return;
|
|
2081
2082
|
}
|
|
2082
|
-
|
|
2083
|
+
p.current = !0, i(!0), v(null);
|
|
2083
2084
|
try {
|
|
2084
2085
|
const k = await e.getUploadDocument(t);
|
|
2085
|
-
s(k),
|
|
2086
|
+
s(k), f.current = t;
|
|
2086
2087
|
} catch (k) {
|
|
2087
2088
|
v(k);
|
|
2088
2089
|
} finally {
|
|
2089
|
-
i(!1),
|
|
2090
|
+
i(!1), p.current = !1;
|
|
2090
2091
|
}
|
|
2091
2092
|
}
|
|
2092
2093
|
}, [t, e]);
|
|
2093
|
-
|
|
2094
|
-
t &&
|
|
2094
|
+
Y(() => {
|
|
2095
|
+
t && f.current !== t && m();
|
|
2095
2096
|
}, [t]);
|
|
2096
|
-
const
|
|
2097
|
+
const y = q(
|
|
2097
2098
|
async (k) => {
|
|
2098
2099
|
c(!0), u(0), v(null);
|
|
2099
2100
|
try {
|
|
@@ -2111,33 +2112,33 @@ function Jt(t) {
|
|
|
2111
2112
|
isLoading: a,
|
|
2112
2113
|
isSubmitting: l,
|
|
2113
2114
|
uploadProgress: d,
|
|
2114
|
-
error:
|
|
2115
|
+
error: g,
|
|
2115
2116
|
load: m,
|
|
2116
|
-
submit:
|
|
2117
|
+
submit: y
|
|
2117
2118
|
};
|
|
2118
2119
|
}
|
|
2119
2120
|
function Kr(t) {
|
|
2120
|
-
const { appropriatenessTestService: e } =
|
|
2121
|
+
const { appropriatenessTestService: e } = ie(), [r, s] = N(null), [a, i] = N(!1), [l, c] = N(!1), [d, u] = N(null), [g, v] = N(null), p = H(!1), f = H(null), m = q(async () => {
|
|
2121
2122
|
if (t) {
|
|
2122
|
-
if (
|
|
2123
|
+
if (p.current) {
|
|
2123
2124
|
console.log("[AppropriatenessTest] Load already in progress, skipping...");
|
|
2124
2125
|
return;
|
|
2125
2126
|
}
|
|
2126
|
-
|
|
2127
|
+
p.current = !0, i(!0), u(null);
|
|
2127
2128
|
try {
|
|
2128
2129
|
const k = await e.getAppropriatenessTest(t);
|
|
2129
|
-
s(k),
|
|
2130
|
+
s(k), f.current = t;
|
|
2130
2131
|
} catch (k) {
|
|
2131
2132
|
u(k);
|
|
2132
2133
|
} finally {
|
|
2133
|
-
i(!1),
|
|
2134
|
+
i(!1), p.current = !1;
|
|
2134
2135
|
}
|
|
2135
2136
|
}
|
|
2136
2137
|
}, [t, e]);
|
|
2137
|
-
|
|
2138
|
-
t &&
|
|
2138
|
+
Y(() => {
|
|
2139
|
+
t && f.current !== t && m();
|
|
2139
2140
|
}, [t]);
|
|
2140
|
-
const
|
|
2141
|
+
const y = q(
|
|
2141
2142
|
async (k) => {
|
|
2142
2143
|
c(!0), u(null);
|
|
2143
2144
|
try {
|
|
@@ -2153,36 +2154,36 @@ function Kr(t) {
|
|
|
2153
2154
|
);
|
|
2154
2155
|
return {
|
|
2155
2156
|
test: r,
|
|
2156
|
-
result:
|
|
2157
|
+
result: g,
|
|
2157
2158
|
isLoading: a,
|
|
2158
2159
|
isSubmitting: l,
|
|
2159
2160
|
error: d,
|
|
2160
2161
|
load: m,
|
|
2161
|
-
submit:
|
|
2162
|
+
submit: y
|
|
2162
2163
|
};
|
|
2163
2164
|
}
|
|
2164
2165
|
function Xt(t) {
|
|
2165
|
-
const { overviewService: e } =
|
|
2166
|
+
const { overviewService: e } = ie(), [r, s] = N(null), [a, i] = N(!1), [l, c] = N(!1), [d, u] = N(null), g = H(!1), v = H(null), p = q(async () => {
|
|
2166
2167
|
if (t) {
|
|
2167
|
-
if (
|
|
2168
|
+
if (g.current) {
|
|
2168
2169
|
console.log("[Overview] Load already in progress, skipping...");
|
|
2169
2170
|
return;
|
|
2170
2171
|
}
|
|
2171
|
-
|
|
2172
|
+
g.current = !0, i(!0), u(null);
|
|
2172
2173
|
try {
|
|
2173
2174
|
const m = await e.getOverviewData(t);
|
|
2174
2175
|
s(m), v.current = t;
|
|
2175
2176
|
} catch (m) {
|
|
2176
2177
|
u(m);
|
|
2177
2178
|
} finally {
|
|
2178
|
-
i(!1),
|
|
2179
|
+
i(!1), g.current = !1;
|
|
2179
2180
|
}
|
|
2180
2181
|
}
|
|
2181
2182
|
}, [t, e]);
|
|
2182
|
-
|
|
2183
|
-
t && v.current !== t &&
|
|
2183
|
+
Y(() => {
|
|
2184
|
+
t && v.current !== t && p();
|
|
2184
2185
|
}, [t]);
|
|
2185
|
-
const
|
|
2186
|
+
const f = q(async () => {
|
|
2186
2187
|
if (t) {
|
|
2187
2188
|
c(!0), u(null);
|
|
2188
2189
|
try {
|
|
@@ -2199,15 +2200,15 @@ function Xt(t) {
|
|
|
2199
2200
|
isLoading: a,
|
|
2200
2201
|
isSubmitting: l,
|
|
2201
2202
|
error: d,
|
|
2202
|
-
load:
|
|
2203
|
-
passOverview:
|
|
2203
|
+
load: p,
|
|
2204
|
+
passOverview: f
|
|
2204
2205
|
};
|
|
2205
2206
|
}
|
|
2206
2207
|
function er(t) {
|
|
2207
|
-
const { identityService: e } =
|
|
2208
|
+
const { identityService: e } = ie(), [r, s] = N(
|
|
2208
2209
|
null
|
|
2209
2210
|
), [a, i] = N(!1), [l, c] = N(null), d = H(!1), u = q(
|
|
2210
|
-
async (
|
|
2211
|
+
async (p, f) => {
|
|
2211
2212
|
if (t) {
|
|
2212
2213
|
if (d.current) {
|
|
2213
2214
|
console.log("[Identity] Request already in progress, skipping...");
|
|
@@ -2218,13 +2219,13 @@ function er(t) {
|
|
|
2218
2219
|
const m = {
|
|
2219
2220
|
applicantId: t,
|
|
2220
2221
|
restart: !1,
|
|
2221
|
-
redirectUrl:
|
|
2222
|
-
ttl:
|
|
2222
|
+
redirectUrl: p || "",
|
|
2223
|
+
ttl: f || 604800
|
|
2223
2224
|
// Default: 7 days
|
|
2224
2225
|
};
|
|
2225
2226
|
console.log("Identity request input:", m);
|
|
2226
|
-
const
|
|
2227
|
-
return console.log("Identity request result:",
|
|
2227
|
+
const y = await e.identityRequest(m);
|
|
2228
|
+
return console.log("Identity request result:", y), s(y), y;
|
|
2228
2229
|
} catch (m) {
|
|
2229
2230
|
throw c(m), m;
|
|
2230
2231
|
} finally {
|
|
@@ -2233,18 +2234,18 @@ function er(t) {
|
|
|
2233
2234
|
}
|
|
2234
2235
|
},
|
|
2235
2236
|
[t, e]
|
|
2236
|
-
),
|
|
2237
|
-
async (
|
|
2237
|
+
), g = q(
|
|
2238
|
+
async (p, f) => {
|
|
2238
2239
|
if (t) {
|
|
2239
2240
|
i(!0), c(null);
|
|
2240
2241
|
try {
|
|
2241
2242
|
const m = {
|
|
2242
2243
|
applicantId: t,
|
|
2243
2244
|
restart: !1,
|
|
2244
|
-
redirectUrl:
|
|
2245
|
-
ttl:
|
|
2246
|
-
},
|
|
2247
|
-
return s(
|
|
2245
|
+
redirectUrl: p,
|
|
2246
|
+
ttl: f
|
|
2247
|
+
}, y = await e.identityCompanyRequest(m);
|
|
2248
|
+
return s(y), y;
|
|
2248
2249
|
} catch (m) {
|
|
2249
2250
|
throw c(m), m;
|
|
2250
2251
|
} finally {
|
|
@@ -2261,18 +2262,18 @@ function er(t) {
|
|
|
2261
2262
|
}
|
|
2262
2263
|
d.current = !0, i(!0), c(null);
|
|
2263
2264
|
try {
|
|
2264
|
-
const
|
|
2265
|
+
const p = {
|
|
2265
2266
|
applicantId: t,
|
|
2266
2267
|
restart: !0,
|
|
2267
2268
|
redirectUrl: "",
|
|
2268
2269
|
ttl: 604800
|
|
2269
2270
|
// 7 days
|
|
2270
2271
|
};
|
|
2271
|
-
console.log("Restarting identity with input:",
|
|
2272
|
-
const
|
|
2273
|
-
return console.log("Restart identity result:",
|
|
2274
|
-
} catch (
|
|
2275
|
-
throw c(
|
|
2272
|
+
console.log("Restarting identity with input:", p);
|
|
2273
|
+
const f = await e.identityRequest(p);
|
|
2274
|
+
return console.log("Restart identity result:", f), s(f), f;
|
|
2275
|
+
} catch (p) {
|
|
2276
|
+
throw c(p), p;
|
|
2276
2277
|
} finally {
|
|
2277
2278
|
i(!1), d.current = !1;
|
|
2278
2279
|
}
|
|
@@ -2285,32 +2286,32 @@ function er(t) {
|
|
|
2285
2286
|
isLoading: a,
|
|
2286
2287
|
error: l,
|
|
2287
2288
|
requestIdentity: u,
|
|
2288
|
-
requestCompanyIdentity:
|
|
2289
|
+
requestCompanyIdentity: g,
|
|
2289
2290
|
restartIdentity: v
|
|
2290
2291
|
};
|
|
2291
2292
|
}
|
|
2292
2293
|
function tr(t) {
|
|
2293
|
-
const { riskScoringService: e } =
|
|
2294
|
+
const { riskScoringService: e } = ie(), [r, s] = N(null), [a, i] = N(!1), [l, c] = N(!1), [d, u] = N(null), [g, v] = N(null), p = H(!1), f = H(null), m = q(async () => {
|
|
2294
2295
|
if (t) {
|
|
2295
|
-
if (
|
|
2296
|
+
if (p.current) {
|
|
2296
2297
|
console.log("[RiskScoring] Load already in progress, skipping...");
|
|
2297
2298
|
return;
|
|
2298
2299
|
}
|
|
2299
|
-
|
|
2300
|
+
p.current = !0, i(!0), u(null);
|
|
2300
2301
|
try {
|
|
2301
2302
|
const k = await e.getRiskCriterias(t);
|
|
2302
|
-
s(k),
|
|
2303
|
+
s(k), f.current = t;
|
|
2303
2304
|
} catch (k) {
|
|
2304
2305
|
u(k);
|
|
2305
2306
|
} finally {
|
|
2306
|
-
i(!1),
|
|
2307
|
+
i(!1), p.current = !1;
|
|
2307
2308
|
}
|
|
2308
2309
|
}
|
|
2309
2310
|
}, [t, e]);
|
|
2310
|
-
|
|
2311
|
-
t &&
|
|
2311
|
+
Y(() => {
|
|
2312
|
+
t && f.current !== t && m();
|
|
2312
2313
|
}, [t]);
|
|
2313
|
-
const
|
|
2314
|
+
const y = q(
|
|
2314
2315
|
async (k) => {
|
|
2315
2316
|
c(!0), u(null);
|
|
2316
2317
|
try {
|
|
@@ -2326,45 +2327,45 @@ function tr(t) {
|
|
|
2326
2327
|
);
|
|
2327
2328
|
return {
|
|
2328
2329
|
criteria: r,
|
|
2329
|
-
result:
|
|
2330
|
+
result: g,
|
|
2330
2331
|
isLoading: a,
|
|
2331
2332
|
isSubmitting: l,
|
|
2332
2333
|
error: d,
|
|
2333
2334
|
load: m,
|
|
2334
|
-
submit:
|
|
2335
|
+
submit: y
|
|
2335
2336
|
};
|
|
2336
2337
|
}
|
|
2337
2338
|
function rr() {
|
|
2338
|
-
const { applicantService: t, config: e } =
|
|
2339
|
+
const { applicantService: t, config: e } = ie(), [r, s] = N(!1), [a, i] = N(null), l = H(!1), c = H(!1), d = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(f) {
|
|
2339
2340
|
const m = Math.random() * 16 | 0;
|
|
2340
|
-
return (
|
|
2341
|
+
return (f === "x" ? m : m & 3 | 8).toString(16);
|
|
2341
2342
|
}), u = q(
|
|
2342
|
-
async (
|
|
2343
|
+
async (f) => {
|
|
2343
2344
|
var m;
|
|
2344
2345
|
if (l.current)
|
|
2345
2346
|
throw console.log("[Applicant] Create already in progress, skipping..."), new Error("Creation already in progress");
|
|
2346
2347
|
l.current = !0, s(!0), i(null);
|
|
2347
2348
|
try {
|
|
2348
|
-
if (
|
|
2349
|
+
if (f.applicantAdditionalDatas || (f.applicantAdditionalDatas = []), (m = e.identityProviders) != null && m.sardinai) {
|
|
2349
2350
|
const k = d();
|
|
2350
|
-
console.log("[SardinAI] Generated session key:", k),
|
|
2351
|
+
console.log("[SardinAI] Generated session key:", k), f.applicantAdditionalDatas.push({
|
|
2351
2352
|
paramName: "sessionKey",
|
|
2352
2353
|
value: k
|
|
2353
2354
|
});
|
|
2354
2355
|
}
|
|
2355
|
-
return await t.createApplicant(
|
|
2356
|
-
} catch (
|
|
2357
|
-
throw i(
|
|
2356
|
+
return await t.createApplicant(f);
|
|
2357
|
+
} catch (y) {
|
|
2358
|
+
throw i(y), y;
|
|
2358
2359
|
} finally {
|
|
2359
2360
|
s(!1), l.current = !1;
|
|
2360
2361
|
}
|
|
2361
2362
|
},
|
|
2362
2363
|
[t, e]
|
|
2363
|
-
),
|
|
2364
|
-
async (
|
|
2364
|
+
), g = q(
|
|
2365
|
+
async (f) => {
|
|
2365
2366
|
s(!0), i(null);
|
|
2366
2367
|
try {
|
|
2367
|
-
return await t.createCompanyApplicant(
|
|
2368
|
+
return await t.createCompanyApplicant(f);
|
|
2368
2369
|
} catch (m) {
|
|
2369
2370
|
throw i(m), m;
|
|
2370
2371
|
} finally {
|
|
@@ -2373,12 +2374,12 @@ function rr() {
|
|
|
2373
2374
|
},
|
|
2374
2375
|
[t]
|
|
2375
2376
|
), v = q(
|
|
2376
|
-
async (
|
|
2377
|
+
async (f) => {
|
|
2377
2378
|
if (c.current)
|
|
2378
2379
|
throw console.log("[Applicant] Data load already in progress, skipping..."), new Error("Data load already in progress");
|
|
2379
2380
|
c.current = !0, s(!0), i(null);
|
|
2380
2381
|
try {
|
|
2381
|
-
return await t.getApplicantData(
|
|
2382
|
+
return await t.getApplicantData(f);
|
|
2382
2383
|
} catch (m) {
|
|
2383
2384
|
throw i(m), m;
|
|
2384
2385
|
} finally {
|
|
@@ -2386,11 +2387,11 @@ function rr() {
|
|
|
2386
2387
|
}
|
|
2387
2388
|
},
|
|
2388
2389
|
[t]
|
|
2389
|
-
),
|
|
2390
|
-
async (
|
|
2390
|
+
), p = q(
|
|
2391
|
+
async (f) => {
|
|
2391
2392
|
s(!0), i(null);
|
|
2392
2393
|
try {
|
|
2393
|
-
await t.stopProgress(
|
|
2394
|
+
await t.stopProgress(f);
|
|
2394
2395
|
} catch (m) {
|
|
2395
2396
|
throw i(m), m;
|
|
2396
2397
|
} finally {
|
|
@@ -2403,9 +2404,9 @@ function rr() {
|
|
|
2403
2404
|
isLoading: r,
|
|
2404
2405
|
error: a,
|
|
2405
2406
|
createApplicant: u,
|
|
2406
|
-
createCompanyApplicant:
|
|
2407
|
+
createCompanyApplicant: g,
|
|
2407
2408
|
getApplicantData: v,
|
|
2408
|
-
stopProgress:
|
|
2409
|
+
stopProgress: p
|
|
2409
2410
|
};
|
|
2410
2411
|
}
|
|
2411
2412
|
const _ = ({
|
|
@@ -2525,7 +2526,7 @@ const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
|
2525
2526
|
...r,
|
|
2526
2527
|
children: t
|
|
2527
2528
|
}
|
|
2528
|
-
), M = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n("div", { className: te("px-6 py-4", e), ...r, children: t }),
|
|
2529
|
+
), M = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n("div", { className: te("px-6 py-4", e), ...r, children: t }), ae = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
2529
2530
|
"div",
|
|
2530
2531
|
{
|
|
2531
2532
|
className: te("px-6 py-4 border-t", e),
|
|
@@ -2535,7 +2536,7 @@ const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
|
2535
2536
|
...r,
|
|
2536
2537
|
children: t
|
|
2537
2538
|
}
|
|
2538
|
-
),
|
|
2539
|
+
), pe = ({ children: t, variant: e = "default", className: r, ...s }) => /* @__PURE__ */ n(
|
|
2539
2540
|
"span",
|
|
2540
2541
|
{
|
|
2541
2542
|
className: te(
|
|
@@ -2552,7 +2553,7 @@ const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
|
2552
2553
|
...s,
|
|
2553
2554
|
children: t
|
|
2554
2555
|
}
|
|
2555
|
-
),
|
|
2556
|
+
), de = ({ size: t = "md", className: e, ...r }) => {
|
|
2556
2557
|
const s = {
|
|
2557
2558
|
sm: "h-4 w-4",
|
|
2558
2559
|
md: "h-8 w-8",
|
|
@@ -2588,7 +2589,7 @@ const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
|
2588
2589
|
]
|
|
2589
2590
|
}
|
|
2590
2591
|
) });
|
|
2591
|
-
},
|
|
2592
|
+
}, fe = Le(
|
|
2592
2593
|
({ label: t, error: e, helperText: r, options: s, placeholder: a, className: i, ...l }, c) => /* @__PURE__ */ o("div", { className: "w-full", children: [
|
|
2593
2594
|
t && /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
|
|
2594
2595
|
t,
|
|
@@ -2625,7 +2626,7 @@ const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
|
2625
2626
|
!e && r && /* @__PURE__ */ n("p", { className: "mt-1 text-sm text-gray-500", children: r })
|
|
2626
2627
|
] })
|
|
2627
2628
|
);
|
|
2628
|
-
|
|
2629
|
+
fe.displayName = "Select";
|
|
2629
2630
|
const nr = ({
|
|
2630
2631
|
label: t,
|
|
2631
2632
|
error: e,
|
|
@@ -2636,27 +2637,27 @@ const nr = ({
|
|
|
2636
2637
|
value: l = [],
|
|
2637
2638
|
className: c
|
|
2638
2639
|
}) => {
|
|
2639
|
-
const [d, u] = N(!1),
|
|
2640
|
+
const [d, u] = N(!1), g = H(null), v = (h) => {
|
|
2640
2641
|
if (!h) return;
|
|
2641
|
-
const
|
|
2642
|
-
if (a &&
|
|
2642
|
+
const I = Array.from(h);
|
|
2643
|
+
if (a && I.filter((w) => w.size > a).length > 0) {
|
|
2643
2644
|
const w = Ie(a);
|
|
2644
2645
|
alert(`Some files exceed the maximum size of ${w}`);
|
|
2645
2646
|
return;
|
|
2646
2647
|
}
|
|
2647
|
-
i == null || i(s ? [...l, ...
|
|
2648
|
-
},
|
|
2648
|
+
i == null || i(s ? [...l, ...I] : [I[0]]);
|
|
2649
|
+
}, p = (h) => {
|
|
2649
2650
|
h.preventDefault(), u(!0);
|
|
2650
|
-
},
|
|
2651
|
+
}, f = () => {
|
|
2651
2652
|
u(!1);
|
|
2652
2653
|
}, m = (h) => {
|
|
2653
2654
|
h.preventDefault(), u(!1), v(h.dataTransfer.files);
|
|
2654
|
-
},
|
|
2655
|
+
}, y = () => {
|
|
2655
2656
|
var h;
|
|
2656
|
-
(h =
|
|
2657
|
+
(h = g.current) == null || h.click();
|
|
2657
2658
|
}, k = (h) => {
|
|
2658
|
-
const
|
|
2659
|
-
i == null || i(
|
|
2659
|
+
const I = l.filter((S, w) => w !== h);
|
|
2660
|
+
i == null || i(I);
|
|
2660
2661
|
};
|
|
2661
2662
|
return /* @__PURE__ */ o("div", { className: te("w-full", c), children: [
|
|
2662
2663
|
t && /* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: t }),
|
|
@@ -2668,15 +2669,15 @@ const nr = ({
|
|
|
2668
2669
|
d ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-300 dark:border-gray-600 hover:border-primary-500",
|
|
2669
2670
|
e && "border-danger-500"
|
|
2670
2671
|
),
|
|
2671
|
-
onDragOver:
|
|
2672
|
-
onDragLeave:
|
|
2672
|
+
onDragOver: p,
|
|
2673
|
+
onDragLeave: f,
|
|
2673
2674
|
onDrop: m,
|
|
2674
|
-
onClick:
|
|
2675
|
+
onClick: y,
|
|
2675
2676
|
children: [
|
|
2676
2677
|
/* @__PURE__ */ n(
|
|
2677
2678
|
"input",
|
|
2678
2679
|
{
|
|
2679
|
-
ref:
|
|
2680
|
+
ref: g,
|
|
2680
2681
|
type: "file",
|
|
2681
2682
|
className: "hidden",
|
|
2682
2683
|
accept: r,
|
|
@@ -2715,7 +2716,7 @@ const nr = ({
|
|
|
2715
2716
|
]
|
|
2716
2717
|
}
|
|
2717
2718
|
),
|
|
2718
|
-
l.length > 0 && /* @__PURE__ */ n("div", { className: "mt-3 space-y-2", children: l.map((h,
|
|
2719
|
+
l.length > 0 && /* @__PURE__ */ n("div", { className: "mt-3 space-y-2", children: l.map((h, I) => /* @__PURE__ */ o(
|
|
2719
2720
|
"div",
|
|
2720
2721
|
{
|
|
2721
2722
|
className: "flex items-center justify-between px-3 py-2 bg-gray-50 dark:bg-gray-700 rounded-lg",
|
|
@@ -2749,7 +2750,7 @@ const nr = ({
|
|
|
2749
2750
|
{
|
|
2750
2751
|
type: "button",
|
|
2751
2752
|
onClick: (S) => {
|
|
2752
|
-
S.stopPropagation(), k(
|
|
2753
|
+
S.stopPropagation(), k(I);
|
|
2753
2754
|
},
|
|
2754
2755
|
className: "ml-2 text-danger-500 hover:text-danger-700 focus:outline-none",
|
|
2755
2756
|
children: /* @__PURE__ */ n("svg", { className: "h-5 w-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ n(
|
|
@@ -2764,7 +2765,7 @@ const nr = ({
|
|
|
2764
2765
|
)
|
|
2765
2766
|
]
|
|
2766
2767
|
},
|
|
2767
|
-
|
|
2768
|
+
I
|
|
2768
2769
|
)) }),
|
|
2769
2770
|
e && /* @__PURE__ */ n("p", { className: "mt-1 text-sm text-danger-500", children: e })
|
|
2770
2771
|
] });
|
|
@@ -2839,8 +2840,8 @@ function qe(t, e, r) {
|
|
|
2839
2840
|
value: c._zod ?? {},
|
|
2840
2841
|
enumerable: !1
|
|
2841
2842
|
}), (u = c._zod).traits ?? (u.traits = /* @__PURE__ */ new Set()), c._zod.traits.add(t), e(c, d);
|
|
2842
|
-
for (const
|
|
2843
|
-
|
|
2843
|
+
for (const g in l.prototype)
|
|
2844
|
+
g in c || Object.defineProperty(c, g, { value: l.prototype[g].bind(c) });
|
|
2844
2845
|
c._zod.constr = l, c._zod.def = d;
|
|
2845
2846
|
}
|
|
2846
2847
|
const a = (r == null ? void 0 : r.Parent) ?? Object;
|
|
@@ -2851,8 +2852,8 @@ function qe(t, e, r) {
|
|
|
2851
2852
|
var d;
|
|
2852
2853
|
const u = r != null && r.Parent ? new i() : this;
|
|
2853
2854
|
s(u, c), (d = u._zod).deferred ?? (d.deferred = []);
|
|
2854
|
-
for (const
|
|
2855
|
-
|
|
2855
|
+
for (const g of u._zod.deferred)
|
|
2856
|
+
g();
|
|
2856
2857
|
return u;
|
|
2857
2858
|
}
|
|
2858
2859
|
return Object.defineProperty(l, "init", { value: s }), Object.defineProperty(l, Symbol.hasInstance, {
|
|
@@ -2883,8 +2884,8 @@ function Ye(t, e, r) {
|
|
|
2883
2884
|
var a, i, l, c, d, u;
|
|
2884
2885
|
const s = { ...t, path: t.path ?? [] };
|
|
2885
2886
|
if (!t.message) {
|
|
2886
|
-
const
|
|
2887
|
-
s.message =
|
|
2887
|
+
const g = 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";
|
|
2888
|
+
s.message = g;
|
|
2888
2889
|
}
|
|
2889
2890
|
return delete s.inst, delete s.continue, e != null && e.reportInput || delete s.input, s;
|
|
2890
2891
|
}
|
|
@@ -2938,13 +2939,13 @@ function pr(t, e) {
|
|
|
2938
2939
|
var c = s.unionErrors[0].errors[0];
|
|
2939
2940
|
r[l] = { message: c.message, type: c.code };
|
|
2940
2941
|
} else r[l] = { message: i, type: a };
|
|
2941
|
-
if ("unionErrors" in s && s.unionErrors.forEach(function(
|
|
2942
|
-
return
|
|
2942
|
+
if ("unionErrors" in s && s.unionErrors.forEach(function(g) {
|
|
2943
|
+
return g.errors.forEach(function(v) {
|
|
2943
2944
|
return t.push(v);
|
|
2944
2945
|
});
|
|
2945
2946
|
}), e) {
|
|
2946
2947
|
var d = r[l].types, u = d && d[s.code];
|
|
2947
|
-
r[l] =
|
|
2948
|
+
r[l] = je(l, e, r, a, u ? [].concat(u, s.message) : s.message);
|
|
2948
2949
|
}
|
|
2949
2950
|
t.shift();
|
|
2950
2951
|
}
|
|
@@ -2957,13 +2958,13 @@ function gr(t, e) {
|
|
|
2957
2958
|
var c = s.errors[0][0];
|
|
2958
2959
|
r[l] = { message: c.message, type: c.code };
|
|
2959
2960
|
} else r[l] = { message: i, type: a };
|
|
2960
|
-
if (s.code === "invalid_union" && s.errors.forEach(function(
|
|
2961
|
-
return
|
|
2961
|
+
if (s.code === "invalid_union" && s.errors.forEach(function(g) {
|
|
2962
|
+
return g.forEach(function(v) {
|
|
2962
2963
|
return t.push(v);
|
|
2963
2964
|
});
|
|
2964
2965
|
}), e) {
|
|
2965
2966
|
var d = r[l].types, u = d && d[s.code];
|
|
2966
|
-
r[l] =
|
|
2967
|
+
r[l] = je(l, e, r, a, u ? [].concat(u, s.message) : s.message);
|
|
2967
2968
|
}
|
|
2968
2969
|
t.shift();
|
|
2969
2970
|
}
|
|
@@ -3009,12 +3010,12 @@ function Ge(t, e, r) {
|
|
|
3009
3010
|
throw new Error("Invalid input: not a Zod schema");
|
|
3010
3011
|
}
|
|
3011
3012
|
function yr(t) {
|
|
3012
|
-
return
|
|
3013
|
-
questionResults:
|
|
3013
|
+
return me.object({
|
|
3014
|
+
questionResults: me.any()
|
|
3014
3015
|
}).passthrough();
|
|
3015
3016
|
}
|
|
3016
3017
|
function fr(t) {
|
|
3017
|
-
let e =
|
|
3018
|
+
let e = me.array(me.instanceof(File));
|
|
3018
3019
|
if (t.isRequired ? e = e.min(
|
|
3019
3020
|
1,
|
|
3020
3021
|
`${t.displayName} is required`
|
|
@@ -3040,72 +3041,72 @@ function qr(t) {
|
|
|
3040
3041
|
return t.uploadDocumentFiles.forEach((r) => {
|
|
3041
3042
|
const s = `file_${r.id}`;
|
|
3042
3043
|
e[s] = fr(r);
|
|
3043
|
-
}),
|
|
3044
|
+
}), me.object(e);
|
|
3044
3045
|
}
|
|
3045
3046
|
function br(t) {
|
|
3046
|
-
return
|
|
3047
|
+
return me.any();
|
|
3047
3048
|
}
|
|
3048
3049
|
function vr(t) {
|
|
3049
|
-
return
|
|
3050
|
+
return me.string().min(1, "This question is required");
|
|
3050
3051
|
}
|
|
3051
3052
|
function Hr(t) {
|
|
3052
3053
|
const e = {};
|
|
3053
3054
|
return t.appropriatenessQuestions.forEach((r) => {
|
|
3054
3055
|
const s = `question_${r.id}`;
|
|
3055
3056
|
e[s] = vr();
|
|
3056
|
-
}),
|
|
3057
|
+
}), me.object(e);
|
|
3057
3058
|
}
|
|
3058
|
-
const Vr =
|
|
3059
|
+
const Vr = me.any(), xr = ({
|
|
3059
3060
|
applicantId: t,
|
|
3060
3061
|
onComplete: e,
|
|
3061
3062
|
onBack: r
|
|
3062
3063
|
}) => {
|
|
3063
3064
|
const { questionnaire: s, isLoading: a, isSubmitting: i, error: l, submit: c } = Zt(t), d = Re(() => s ? { questionResults: s.questionGroups.map(
|
|
3064
|
-
(
|
|
3065
|
+
(y) => y.questions.map((k) => ({
|
|
3065
3066
|
questionId: k.id,
|
|
3066
3067
|
values: []
|
|
3067
3068
|
}))
|
|
3068
3069
|
) } : { questionResults: [] }, [s]), u = s ? yr() : null, {
|
|
3069
|
-
control:
|
|
3070
|
+
control: g,
|
|
3070
3071
|
handleSubmit: v,
|
|
3071
|
-
formState: { errors:
|
|
3072
|
+
formState: { errors: p }
|
|
3072
3073
|
} = Te({
|
|
3073
3074
|
resolver: u ? Ge(u) : void 0,
|
|
3074
3075
|
defaultValues: d
|
|
3075
|
-
}),
|
|
3076
|
+
}), f = async (m) => {
|
|
3076
3077
|
if (s)
|
|
3077
3078
|
try {
|
|
3078
3079
|
console.log("Form submitted with data:", m);
|
|
3079
|
-
const
|
|
3080
|
-
(h,
|
|
3081
|
-
var
|
|
3080
|
+
const y = s.questionGroups.flatMap(
|
|
3081
|
+
(h, I) => h.questions.map((S, w) => {
|
|
3082
|
+
var B, L, A;
|
|
3082
3083
|
return {
|
|
3083
3084
|
questionId: S.id,
|
|
3084
|
-
values: ((
|
|
3085
|
+
values: ((A = (L = (B = m.questionResults) == null ? void 0 : B[I]) == null ? void 0 : L[w]) == null ? void 0 : A.values) || []
|
|
3085
3086
|
};
|
|
3086
3087
|
})
|
|
3087
3088
|
);
|
|
3088
|
-
console.log("Question results to submit:",
|
|
3089
|
+
console.log("Question results to submit:", y);
|
|
3089
3090
|
const k = {
|
|
3090
3091
|
applicantId: t,
|
|
3091
3092
|
questionnarieId: s.id,
|
|
3092
|
-
questionResults:
|
|
3093
|
+
questionResults: y
|
|
3093
3094
|
};
|
|
3094
3095
|
console.log("Final input:", k), await c(k), e == null || e();
|
|
3095
|
-
} catch (
|
|
3096
|
-
console.error("Error submitting questionnaire:",
|
|
3096
|
+
} catch (y) {
|
|
3097
|
+
console.error("Error submitting questionnaire:", y);
|
|
3097
3098
|
}
|
|
3098
3099
|
};
|
|
3099
|
-
return a ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(
|
|
3100
|
+
return a ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(de, { className: "my-8" }) }) }) : l ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
3100
3101
|
"Error loading questionnaire: ",
|
|
3101
3102
|
l.message
|
|
3102
|
-
] }) }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: v(
|
|
3103
|
+
] }) }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: v(f), children: /* @__PURE__ */ o(T, { children: [
|
|
3103
3104
|
/* @__PURE__ */ o(ee, { children: [
|
|
3104
3105
|
/* @__PURE__ */ n("h2", { className: "text-lg font-bold", children: s.displayName }),
|
|
3105
3106
|
s.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: s.subtitle })
|
|
3106
3107
|
] }),
|
|
3107
3108
|
/* @__PURE__ */ n(M, { className: "space-y-8", children: s.questionGroups.flatMap(
|
|
3108
|
-
(m,
|
|
3109
|
+
(m, y) => m.questions.map((k, h) => {
|
|
3109
3110
|
const S = k.defaultAnswers && k.defaultAnswers.length > 0 ? k.showAsDropdown ? k.canMultipleAnswer ? "multi-select" : "single-select" : k.canMultipleAnswer ? "checkbox" : "radio" : "text";
|
|
3110
3111
|
return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
3111
3112
|
/* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300", children: [
|
|
@@ -3115,10 +3116,10 @@ const Vr = ue.any(), xr = ({
|
|
|
3115
3116
|
S === "text" && /* @__PURE__ */ n(
|
|
3116
3117
|
J,
|
|
3117
3118
|
{
|
|
3118
|
-
control:
|
|
3119
|
-
name: `questionResults.${
|
|
3119
|
+
control: g,
|
|
3120
|
+
name: `questionResults.${y}.${h}.values.0`,
|
|
3120
3121
|
render: ({ field: w }) => {
|
|
3121
|
-
var
|
|
3122
|
+
var B, L, A, C;
|
|
3122
3123
|
return /* @__PURE__ */ n(
|
|
3123
3124
|
X,
|
|
3124
3125
|
{
|
|
@@ -3127,7 +3128,7 @@ const Vr = ue.any(), xr = ({
|
|
|
3127
3128
|
onBlur: w.onBlur,
|
|
3128
3129
|
name: w.name,
|
|
3129
3130
|
placeholder: "Enter your answer...",
|
|
3130
|
-
error: (C = (
|
|
3131
|
+
error: (C = (A = (L = (B = p.questionResults) == null ? void 0 : B[y]) == null ? void 0 : L[h]) == null ? void 0 : A.values) == null ? void 0 : C.message
|
|
3131
3132
|
}
|
|
3132
3133
|
);
|
|
3133
3134
|
}
|
|
@@ -3136,23 +3137,23 @@ const Vr = ue.any(), xr = ({
|
|
|
3136
3137
|
(S === "single-select" || S === "radio") && /* @__PURE__ */ n(
|
|
3137
3138
|
J,
|
|
3138
3139
|
{
|
|
3139
|
-
control:
|
|
3140
|
-
name: `questionResults.${
|
|
3140
|
+
control: g,
|
|
3141
|
+
name: `questionResults.${y}.${h}.values.0`,
|
|
3141
3142
|
render: ({ field: w }) => {
|
|
3142
|
-
var
|
|
3143
|
+
var B, L, A, C;
|
|
3143
3144
|
return /* @__PURE__ */ n(
|
|
3144
|
-
|
|
3145
|
+
fe,
|
|
3145
3146
|
{
|
|
3146
3147
|
value: w.value || "",
|
|
3147
3148
|
onChange: w.onChange,
|
|
3148
3149
|
onBlur: w.onBlur,
|
|
3149
3150
|
name: w.name,
|
|
3150
|
-
options: k.defaultAnswers.map((
|
|
3151
|
-
value:
|
|
3152
|
-
label:
|
|
3151
|
+
options: k.defaultAnswers.map((D) => ({
|
|
3152
|
+
value: D,
|
|
3153
|
+
label: D
|
|
3153
3154
|
})),
|
|
3154
3155
|
placeholder: "Select an option...",
|
|
3155
|
-
error: (C = (
|
|
3156
|
+
error: (C = (A = (L = (B = p.questionResults) == null ? void 0 : B[y]) == null ? void 0 : L[h]) == null ? void 0 : A.values) == null ? void 0 : C.message
|
|
3156
3157
|
}
|
|
3157
3158
|
);
|
|
3158
3159
|
}
|
|
@@ -3163,9 +3164,9 @@ const Vr = ue.any(), xr = ({
|
|
|
3163
3164
|
/* @__PURE__ */ n(
|
|
3164
3165
|
J,
|
|
3165
3166
|
{
|
|
3166
|
-
control:
|
|
3167
|
-
name: `questionResults.${
|
|
3168
|
-
render: ({ field: { value: w = [], onChange:
|
|
3167
|
+
control: g,
|
|
3168
|
+
name: `questionResults.${y}.${h}.values`,
|
|
3169
|
+
render: ({ field: { value: w = [], onChange: B } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: k.defaultAnswers.map((L, A) => /* @__PURE__ */ o(
|
|
3169
3170
|
"label",
|
|
3170
3171
|
{
|
|
3171
3172
|
className: "flex items-center space-x-2 cursor-pointer",
|
|
@@ -3174,18 +3175,18 @@ const Vr = ue.any(), xr = ({
|
|
|
3174
3175
|
"input",
|
|
3175
3176
|
{
|
|
3176
3177
|
type: "checkbox",
|
|
3177
|
-
checked: Array.isArray(w) && w.includes(
|
|
3178
|
+
checked: Array.isArray(w) && w.includes(L),
|
|
3178
3179
|
onChange: (C) => {
|
|
3179
|
-
const
|
|
3180
|
-
|
|
3180
|
+
const D = Array.isArray(w) ? w : [], z = C.target.checked ? [...D, L] : D.filter((W) => W !== L);
|
|
3181
|
+
B(z);
|
|
3181
3182
|
},
|
|
3182
3183
|
className: "h-4 w-4 text-primary-500 rounded border-gray-300 focus:ring-primary-500"
|
|
3183
3184
|
}
|
|
3184
3185
|
),
|
|
3185
|
-
/* @__PURE__ */ n("span", { className: "text-sm", children:
|
|
3186
|
+
/* @__PURE__ */ n("span", { className: "text-sm", children: L })
|
|
3186
3187
|
]
|
|
3187
3188
|
},
|
|
3188
|
-
`answer-${
|
|
3189
|
+
`answer-${y}-${h}-${A}`
|
|
3189
3190
|
)) })
|
|
3190
3191
|
}
|
|
3191
3192
|
)
|
|
@@ -3193,7 +3194,7 @@ const Vr = ue.any(), xr = ({
|
|
|
3193
3194
|
] }, k.id);
|
|
3194
3195
|
})
|
|
3195
3196
|
) }),
|
|
3196
|
-
/* @__PURE__ */ o(
|
|
3197
|
+
/* @__PURE__ */ o(ae, { className: "flex justify-between", children: [
|
|
3197
3198
|
r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3198
3199
|
/* @__PURE__ */ n(
|
|
3199
3200
|
_,
|
|
@@ -3201,7 +3202,7 @@ const Vr = ue.any(), xr = ({
|
|
|
3201
3202
|
type: "submit",
|
|
3202
3203
|
isLoading: i,
|
|
3203
3204
|
onClick: () => {
|
|
3204
|
-
console.log("Continue button clicked"), console.log("Form errors:",
|
|
3205
|
+
console.log("Continue button clicked"), console.log("Form errors:", p);
|
|
3205
3206
|
},
|
|
3206
3207
|
children: "Continue"
|
|
3207
3208
|
}
|
|
@@ -3217,12 +3218,12 @@ const Vr = ue.any(), xr = ({
|
|
|
3217
3218
|
onComplete: e,
|
|
3218
3219
|
onBack: r
|
|
3219
3220
|
}) => {
|
|
3220
|
-
const { uploadDocument: s, isLoading: a, isSubmitting: i, error: l, submit: c } = Jt(t), [d, u] = N({}),
|
|
3221
|
+
const { uploadDocument: s, isLoading: a, isSubmitting: i, error: l, submit: c } = Jt(t), [d, u] = N({}), g = async (v) => {
|
|
3221
3222
|
if (v.preventDefault(), !s) return;
|
|
3222
|
-
const
|
|
3223
|
+
const p = await Promise.all(
|
|
3223
3224
|
s.uploadDocumentFiles.map(async (m) => {
|
|
3224
|
-
const
|
|
3225
|
-
|
|
3225
|
+
const y = d[m.id] || [], k = await Promise.all(
|
|
3226
|
+
y.map(async (h) => ({
|
|
3226
3227
|
fileName: h.name,
|
|
3227
3228
|
fileData: await qt(h)
|
|
3228
3229
|
}))
|
|
@@ -3232,17 +3233,17 @@ const Vr = ue.any(), xr = ({
|
|
|
3232
3233
|
valueList: k
|
|
3233
3234
|
};
|
|
3234
3235
|
})
|
|
3235
|
-
),
|
|
3236
|
+
), f = {
|
|
3236
3237
|
applicantId: t,
|
|
3237
3238
|
uploadDocumentId: s.id,
|
|
3238
|
-
uploadDocumentResults:
|
|
3239
|
+
uploadDocumentResults: p
|
|
3239
3240
|
};
|
|
3240
|
-
await c(
|
|
3241
|
+
await c(f), e == null || e();
|
|
3241
3242
|
};
|
|
3242
|
-
return a ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(
|
|
3243
|
+
return a ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(de, { className: "my-8" }) }) }) : l ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
3243
3244
|
"Error loading document requirements: ",
|
|
3244
3245
|
l.message
|
|
3245
|
-
] }) }) }) : s ? /* @__PURE__ */ n("form", { onSubmit:
|
|
3246
|
+
] }) }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: g, children: /* @__PURE__ */ o(T, { children: [
|
|
3246
3247
|
/* @__PURE__ */ o(ee, { children: [
|
|
3247
3248
|
/* @__PURE__ */ n("h2", { className: "text-lg font-bold", children: s.displayName }),
|
|
3248
3249
|
s.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: s.subtitle })
|
|
@@ -3255,13 +3256,13 @@ const Vr = ue.any(), xr = ({
|
|
|
3255
3256
|
multiple: v.multipleFile,
|
|
3256
3257
|
maxSize: v.maxEachFileSizeByte,
|
|
3257
3258
|
value: d[v.id] || [],
|
|
3258
|
-
onChange: (
|
|
3259
|
-
u((
|
|
3259
|
+
onChange: (p) => {
|
|
3260
|
+
u((f) => ({ ...f, [v.id]: p }));
|
|
3260
3261
|
}
|
|
3261
3262
|
},
|
|
3262
3263
|
v.id
|
|
3263
3264
|
)) }),
|
|
3264
|
-
/* @__PURE__ */ o(
|
|
3265
|
+
/* @__PURE__ */ o(ae, { className: "flex justify-between", children: [
|
|
3265
3266
|
r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3266
3267
|
/* @__PURE__ */ n(_, { type: "submit", isLoading: i, children: "Continue" })
|
|
3267
3268
|
] })
|
|
@@ -3270,7 +3271,7 @@ const Vr = ue.any(), xr = ({
|
|
|
3270
3271
|
const { overview: s, isLoading: a, isSubmitting: i, error: l, passOverview: c } = Xt(t), d = async () => {
|
|
3271
3272
|
await c(), e == null || e();
|
|
3272
3273
|
};
|
|
3273
|
-
return a ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(
|
|
3274
|
+
return a ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(de, { className: "my-8" }) }) }) : l ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
3274
3275
|
"Error loading overview: ",
|
|
3275
3276
|
l.message
|
|
3276
3277
|
] }) }) }) : s ? /* @__PURE__ */ o(T, { children: [
|
|
@@ -3278,7 +3279,7 @@ const Vr = ue.any(), xr = ({
|
|
|
3278
3279
|
/* @__PURE__ */ n("h2", { className: "text-lg font-bold", children: s.title || "Overview" }),
|
|
3279
3280
|
s.description && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: s.description })
|
|
3280
3281
|
] }),
|
|
3281
|
-
/* @__PURE__ */ n(M, { className: "space-y-8", children: s.steps && s.steps.length > 0 ? s.steps.sort((u,
|
|
3282
|
+
/* @__PURE__ */ n(M, { className: "space-y-8", children: s.steps && s.steps.length > 0 ? s.steps.sort((u, g) => u.order - g.order).map((u) => /* @__PURE__ */ o("div", { className: "metakyc-overview-step-item flex items-center space-x-3", children: [
|
|
3282
3283
|
/* @__PURE__ */ n("div", { className: "metakyc-step-icon flex-shrink-0", children: /* @__PURE__ */ n("div", { className: "w-8 h-8 rounded-full bg-primary-500 text-white flex items-center justify-center font-medium text-sm", children: u.order + 1 }) }),
|
|
3283
3284
|
/* @__PURE__ */ o(
|
|
3284
3285
|
"div",
|
|
@@ -3297,7 +3298,7 @@ const Vr = ue.any(), xr = ({
|
|
|
3297
3298
|
}
|
|
3298
3299
|
)
|
|
3299
3300
|
] }, u.order)) : /* @__PURE__ */ n("div", { className: "text-center py-8", children: /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Loading overview data..." }) }) }),
|
|
3300
|
-
/* @__PURE__ */ o(
|
|
3301
|
+
/* @__PURE__ */ o(ae, { className: "flex justify-between", children: [
|
|
3301
3302
|
r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3302
3303
|
/* @__PURE__ */ n(_, { onClick: d, isLoading: i, children: "Continue" })
|
|
3303
3304
|
] })
|
|
@@ -3307,60 +3308,60 @@ const Vr = ue.any(), xr = ({
|
|
|
3307
3308
|
onComplete: e,
|
|
3308
3309
|
onBack: r
|
|
3309
3310
|
}) => {
|
|
3310
|
-
const { criteria: s, isLoading: a, isSubmitting: i, error: l, submit: c } = tr(t), [d, u] =
|
|
3311
|
+
const { criteria: s, isLoading: a, isSubmitting: i, error: l, submit: c } = tr(t), [d, u] = se.useState(!1), g = se.useMemo(() => !s || s.length === 0 ? { criteriaValueInputs: [] } : {
|
|
3311
3312
|
criteriaValueInputs: s.map((h) => ({
|
|
3312
3313
|
riskCriteriaId: h.id,
|
|
3313
3314
|
values: [""]
|
|
3314
3315
|
// Initialize with empty string to prevent uncontrolled input warning
|
|
3315
3316
|
}))
|
|
3316
3317
|
}, [s]), v = s && s.length > 0 ? br() : null, {
|
|
3317
|
-
control:
|
|
3318
|
-
handleSubmit:
|
|
3318
|
+
control: p,
|
|
3319
|
+
handleSubmit: f,
|
|
3319
3320
|
formState: { errors: m }
|
|
3320
3321
|
} = Te({
|
|
3321
3322
|
resolver: v ? Ge(v) : void 0,
|
|
3322
|
-
defaultValues:
|
|
3323
|
+
defaultValues: g
|
|
3323
3324
|
});
|
|
3324
|
-
|
|
3325
|
+
se.useEffect(() => {
|
|
3325
3326
|
!a && s && s.length === 0 && !d && !i && (u(!0), c({ applicantId: t, criteriaValueInputs: [] }).then(() => e == null ? void 0 : e()).catch(console.error));
|
|
3326
3327
|
}, [a, s, d, i, c, t, e]);
|
|
3327
|
-
const
|
|
3328
|
+
const y = async (h) => {
|
|
3328
3329
|
if (s)
|
|
3329
3330
|
try {
|
|
3330
3331
|
console.log("Risk scoring form submitted:", h), console.log("Criteria metadata:", s);
|
|
3331
|
-
const
|
|
3332
|
-
const
|
|
3333
|
-
return
|
|
3334
|
-
riskCriteriaId: s[
|
|
3335
|
-
values:
|
|
3332
|
+
const I = h.criteriaValueInputs.map((w, B) => {
|
|
3333
|
+
const L = w.values || [], A = Array.isArray(L) ? L.filter((C) => C && C.trim()) : L && L.toString().trim() ? [L.toString()] : [];
|
|
3334
|
+
return A.length === 0 ? null : {
|
|
3335
|
+
riskCriteriaId: s[B].id,
|
|
3336
|
+
values: A
|
|
3336
3337
|
};
|
|
3337
3338
|
}).filter((w) => w !== null);
|
|
3338
|
-
console.log("Risk scoring criteriaValueInputs to submit:",
|
|
3339
|
+
console.log("Risk scoring criteriaValueInputs to submit:", I);
|
|
3339
3340
|
const S = {
|
|
3340
3341
|
applicantId: t,
|
|
3341
|
-
criteriaValueInputs:
|
|
3342
|
+
criteriaValueInputs: I
|
|
3342
3343
|
};
|
|
3343
3344
|
console.log("Final risk scoring input:", S), await c(S), console.log("Risk scoring submitted successfully!"), e == null || e();
|
|
3344
|
-
} catch (
|
|
3345
|
-
throw console.error("Error submitting risk scoring:",
|
|
3345
|
+
} catch (I) {
|
|
3346
|
+
throw console.error("Error submitting risk scoring:", I), I;
|
|
3346
3347
|
}
|
|
3347
3348
|
}, k = (h) => h.builtInType === 1 ? "country" : !h.defaultValues || h.defaultValues.length === 0 ? "text" : h.multipleValue ? "checkbox" : "radio";
|
|
3348
3349
|
return a ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
|
|
3349
|
-
/* @__PURE__ */ n(
|
|
3350
|
+
/* @__PURE__ */ n(de, { className: "my-8" }),
|
|
3350
3351
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading risk scoring criteria..." })
|
|
3351
3352
|
] }) }) : l ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
3352
3353
|
"Error loading criteria: ",
|
|
3353
3354
|
l.message
|
|
3354
3355
|
] }) }) }) : !a && s && s.length === 0 ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
|
|
3355
|
-
/* @__PURE__ */ n(
|
|
3356
|
+
/* @__PURE__ */ n(de, { className: "my-8" }),
|
|
3356
3357
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400", children: "No risk scoring criteria required. Moving to next step..." })
|
|
3357
|
-
] }) }) : s ? /* @__PURE__ */ n("form", { onSubmit:
|
|
3358
|
+
] }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: f(y), children: /* @__PURE__ */ o(T, { children: [
|
|
3358
3359
|
/* @__PURE__ */ o(ee, { children: [
|
|
3359
3360
|
/* @__PURE__ */ n("h2", { className: "text-lg font-bold", children: "Risk Assessment" }),
|
|
3360
3361
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please answer the following questions for risk evaluation" })
|
|
3361
3362
|
] }),
|
|
3362
|
-
/* @__PURE__ */ n(M, { className: "space-y-8", children: s.map((h,
|
|
3363
|
-
var w,
|
|
3363
|
+
/* @__PURE__ */ n(M, { className: "space-y-8", children: s.map((h, I) => {
|
|
3364
|
+
var w, B, L;
|
|
3364
3365
|
const S = k(h);
|
|
3365
3366
|
return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
3366
3367
|
/* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300", children: [
|
|
@@ -3371,20 +3372,20 @@ const Vr = ue.any(), xr = ({
|
|
|
3371
3372
|
S === "text" && /* @__PURE__ */ n(
|
|
3372
3373
|
J,
|
|
3373
3374
|
{
|
|
3374
|
-
control:
|
|
3375
|
-
name: `criteriaValueInputs.${
|
|
3376
|
-
render: ({ field:
|
|
3377
|
-
var C,
|
|
3375
|
+
control: p,
|
|
3376
|
+
name: `criteriaValueInputs.${I}.values.0`,
|
|
3377
|
+
render: ({ field: A }) => {
|
|
3378
|
+
var C, D, z;
|
|
3378
3379
|
return /* @__PURE__ */ n(
|
|
3379
3380
|
X,
|
|
3380
3381
|
{
|
|
3381
|
-
...
|
|
3382
|
-
value:
|
|
3382
|
+
...A,
|
|
3383
|
+
value: A.value || "",
|
|
3383
3384
|
type: h.valueDataType === Pe.DigitOnly ? "number" : "text",
|
|
3384
3385
|
placeholder: "Enter your answer...",
|
|
3385
|
-
error: (
|
|
3386
|
-
onKeyDown: (
|
|
3387
|
-
h.valueDataType === Pe.DigitOnly && ["e", "E", "+", "-", "."].includes(
|
|
3386
|
+
error: (z = (D = (C = m.criteriaValueInputs) == null ? void 0 : C[I]) == null ? void 0 : D.values) == null ? void 0 : z.message,
|
|
3387
|
+
onKeyDown: (W) => {
|
|
3388
|
+
h.valueDataType === Pe.DigitOnly && ["e", "E", "+", "-", "."].includes(W.key) && W.preventDefault();
|
|
3388
3389
|
}
|
|
3389
3390
|
}
|
|
3390
3391
|
);
|
|
@@ -3396,20 +3397,20 @@ const Vr = ue.any(), xr = ({
|
|
|
3396
3397
|
/* @__PURE__ */ n(
|
|
3397
3398
|
J,
|
|
3398
3399
|
{
|
|
3399
|
-
control:
|
|
3400
|
-
name: `criteriaValueInputs.${
|
|
3401
|
-
render: ({ field: { value:
|
|
3400
|
+
control: p,
|
|
3401
|
+
name: `criteriaValueInputs.${I}.values.0`,
|
|
3402
|
+
render: ({ field: { value: A, onChange: C } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: h.defaultValues.map((D, z) => /* @__PURE__ */ o("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
|
|
3402
3403
|
/* @__PURE__ */ n(
|
|
3403
3404
|
"input",
|
|
3404
3405
|
{
|
|
3405
3406
|
type: "radio",
|
|
3406
|
-
checked:
|
|
3407
|
-
onChange: () => C(
|
|
3407
|
+
checked: A === D,
|
|
3408
|
+
onChange: () => C(D),
|
|
3408
3409
|
className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3409
3410
|
}
|
|
3410
3411
|
),
|
|
3411
|
-
/* @__PURE__ */ n("span", { className: "text-sm", children:
|
|
3412
|
-
] }, `${
|
|
3412
|
+
/* @__PURE__ */ n("span", { className: "text-sm", children: D })
|
|
3413
|
+
] }, `${I}-${z}`)) })
|
|
3413
3414
|
}
|
|
3414
3415
|
)
|
|
3415
3416
|
] }),
|
|
@@ -3418,37 +3419,37 @@ const Vr = ue.any(), xr = ({
|
|
|
3418
3419
|
/* @__PURE__ */ n(
|
|
3419
3420
|
J,
|
|
3420
3421
|
{
|
|
3421
|
-
control:
|
|
3422
|
-
name: `criteriaValueInputs.${
|
|
3423
|
-
render: ({ field: { value:
|
|
3422
|
+
control: p,
|
|
3423
|
+
name: `criteriaValueInputs.${I}.values`,
|
|
3424
|
+
render: ({ field: { value: A = [], onChange: C } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: h.defaultValues.map((D, z) => /* @__PURE__ */ o("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
|
|
3424
3425
|
/* @__PURE__ */ n(
|
|
3425
3426
|
"input",
|
|
3426
3427
|
{
|
|
3427
3428
|
type: "checkbox",
|
|
3428
|
-
checked: Array.isArray(
|
|
3429
|
-
onChange: (
|
|
3430
|
-
const
|
|
3431
|
-
C(
|
|
3429
|
+
checked: Array.isArray(A) && A.includes(D),
|
|
3430
|
+
onChange: (W) => {
|
|
3431
|
+
const j = Array.isArray(A) ? A : [], F = W.target.checked ? [...j, D] : j.filter((R) => R !== D);
|
|
3432
|
+
C(F);
|
|
3432
3433
|
},
|
|
3433
3434
|
className: "h-4 w-4 text-primary-500 rounded border-gray-300 focus:ring-primary-500"
|
|
3434
3435
|
}
|
|
3435
3436
|
),
|
|
3436
|
-
/* @__PURE__ */ n("span", { className: "text-sm", children:
|
|
3437
|
-
] }, `${
|
|
3437
|
+
/* @__PURE__ */ n("span", { className: "text-sm", children: D })
|
|
3438
|
+
] }, `${I}-${z}`)) })
|
|
3438
3439
|
}
|
|
3439
3440
|
)
|
|
3440
3441
|
] }),
|
|
3441
3442
|
S === "country" && /* @__PURE__ */ n(
|
|
3442
3443
|
J,
|
|
3443
3444
|
{
|
|
3444
|
-
control:
|
|
3445
|
-
name: `criteriaValueInputs.${
|
|
3446
|
-
render: ({ field:
|
|
3447
|
-
var C,
|
|
3445
|
+
control: p,
|
|
3446
|
+
name: `criteriaValueInputs.${I}.values.0`,
|
|
3447
|
+
render: ({ field: A }) => {
|
|
3448
|
+
var C, D, z;
|
|
3448
3449
|
return /* @__PURE__ */ n(
|
|
3449
|
-
|
|
3450
|
+
fe,
|
|
3450
3451
|
{
|
|
3451
|
-
...
|
|
3452
|
+
...A,
|
|
3452
3453
|
options: [
|
|
3453
3454
|
{ value: "US", label: "United States" },
|
|
3454
3455
|
{ value: "GB", label: "United Kingdom" },
|
|
@@ -3456,16 +3457,16 @@ const Vr = ue.any(), xr = ({
|
|
|
3456
3457
|
// TODO: Load from base information service
|
|
3457
3458
|
],
|
|
3458
3459
|
placeholder: "Select a country...",
|
|
3459
|
-
error: (
|
|
3460
|
+
error: (z = (D = (C = m.criteriaValueInputs) == null ? void 0 : C[I]) == null ? void 0 : D.values) == null ? void 0 : z.message
|
|
3460
3461
|
}
|
|
3461
3462
|
);
|
|
3462
3463
|
}
|
|
3463
3464
|
}
|
|
3464
3465
|
),
|
|
3465
|
-
((
|
|
3466
|
+
((L = (B = (w = m.criteriaValueInputs) == null ? void 0 : w[I]) == null ? void 0 : B.values) == null ? void 0 : L.message) && /* @__PURE__ */ n("p", { className: "text-sm text-danger-500 mt-1", children: m.criteriaValueInputs[I].values.message })
|
|
3466
3467
|
] }, h.id);
|
|
3467
3468
|
}) }),
|
|
3468
|
-
/* @__PURE__ */ o(
|
|
3469
|
+
/* @__PURE__ */ o(ae, { className: "flex justify-between", children: [
|
|
3469
3470
|
r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3470
3471
|
/* @__PURE__ */ n(
|
|
3471
3472
|
_,
|
|
@@ -3489,7 +3490,7 @@ const Vr = ue.any(), xr = ({
|
|
|
3489
3490
|
onComplete: e,
|
|
3490
3491
|
onBack: r
|
|
3491
3492
|
}) => {
|
|
3492
|
-
const { investorCategorizationService: s } =
|
|
3493
|
+
const { investorCategorizationService: s } = ie(), [a, i] = N(null), [l, c] = N(!1), [d, u] = N(null);
|
|
3493
3494
|
return /* @__PURE__ */ n("form", { onSubmit: async (v) => {
|
|
3494
3495
|
if (v.preventDefault(), a === null) {
|
|
3495
3496
|
u("Please select an investor type");
|
|
@@ -3497,15 +3498,15 @@ const Vr = ue.any(), xr = ({
|
|
|
3497
3498
|
}
|
|
3498
3499
|
c(!0), u(null);
|
|
3499
3500
|
try {
|
|
3500
|
-
const
|
|
3501
|
+
const p = {
|
|
3501
3502
|
applicantId: t,
|
|
3502
3503
|
investorType: a
|
|
3503
3504
|
};
|
|
3504
|
-
console.log("Submitting investor categorization:",
|
|
3505
|
-
const
|
|
3506
|
-
console.log("Investor categorization result:",
|
|
3507
|
-
} catch (
|
|
3508
|
-
console.error("Error submitting investor categorization:",
|
|
3505
|
+
console.log("Submitting investor categorization:", p);
|
|
3506
|
+
const f = await s.setInvestorCategorization(p);
|
|
3507
|
+
console.log("Investor categorization result:", f), e == null || e();
|
|
3508
|
+
} catch (p) {
|
|
3509
|
+
console.error("Error submitting investor categorization:", p), u(p.message || "Failed to submit investor categorization");
|
|
3509
3510
|
} finally {
|
|
3510
3511
|
c(!1);
|
|
3511
3512
|
}
|
|
@@ -3521,7 +3522,7 @@ const Vr = ue.any(), xr = ({
|
|
|
3521
3522
|
{
|
|
3522
3523
|
className: `
|
|
3523
3524
|
block p-4 border-2 rounded-lg cursor-pointer transition-all
|
|
3524
|
-
${a ===
|
|
3525
|
+
${a === ne.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"}
|
|
3525
3526
|
`,
|
|
3526
3527
|
children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
|
|
3527
3528
|
/* @__PURE__ */ n(
|
|
@@ -3529,9 +3530,9 @@ const Vr = ue.any(), xr = ({
|
|
|
3529
3530
|
{
|
|
3530
3531
|
type: "radio",
|
|
3531
3532
|
name: "investorType",
|
|
3532
|
-
value:
|
|
3533
|
-
checked: a ===
|
|
3534
|
-
onChange: () => i(
|
|
3533
|
+
value: ne.Individual,
|
|
3534
|
+
checked: a === ne.Individual,
|
|
3535
|
+
onChange: () => i(ne.Individual),
|
|
3535
3536
|
className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3536
3537
|
}
|
|
3537
3538
|
),
|
|
@@ -3547,7 +3548,7 @@ const Vr = ue.any(), xr = ({
|
|
|
3547
3548
|
{
|
|
3548
3549
|
className: `
|
|
3549
3550
|
block p-4 border-2 rounded-lg cursor-pointer transition-all
|
|
3550
|
-
${a ===
|
|
3551
|
+
${a === ne.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"}
|
|
3551
3552
|
`,
|
|
3552
3553
|
children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
|
|
3553
3554
|
/* @__PURE__ */ n(
|
|
@@ -3555,9 +3556,9 @@ const Vr = ue.any(), xr = ({
|
|
|
3555
3556
|
{
|
|
3556
3557
|
type: "radio",
|
|
3557
3558
|
name: "investorType",
|
|
3558
|
-
value:
|
|
3559
|
-
checked: a ===
|
|
3560
|
-
onChange: () => i(
|
|
3559
|
+
value: ne.Sophisticated,
|
|
3560
|
+
checked: a === ne.Sophisticated,
|
|
3561
|
+
onChange: () => i(ne.Sophisticated),
|
|
3561
3562
|
className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3562
3563
|
}
|
|
3563
3564
|
),
|
|
@@ -3578,7 +3579,7 @@ const Vr = ue.any(), xr = ({
|
|
|
3578
3579
|
{
|
|
3579
3580
|
className: `
|
|
3580
3581
|
block p-4 border-2 rounded-lg cursor-pointer transition-all
|
|
3581
|
-
${a ===
|
|
3582
|
+
${a === ne.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"}
|
|
3582
3583
|
`,
|
|
3583
3584
|
children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
|
|
3584
3585
|
/* @__PURE__ */ n(
|
|
@@ -3586,9 +3587,9 @@ const Vr = ue.any(), xr = ({
|
|
|
3586
3587
|
{
|
|
3587
3588
|
type: "radio",
|
|
3588
3589
|
name: "investorType",
|
|
3589
|
-
value:
|
|
3590
|
-
checked: a ===
|
|
3591
|
-
onChange: () => i(
|
|
3590
|
+
value: ne.HighNetWorth,
|
|
3591
|
+
checked: a === ne.HighNetWorth,
|
|
3592
|
+
onChange: () => i(ne.HighNetWorth),
|
|
3592
3593
|
className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3593
3594
|
}
|
|
3594
3595
|
),
|
|
@@ -3609,7 +3610,7 @@ const Vr = ue.any(), xr = ({
|
|
|
3609
3610
|
d
|
|
3610
3611
|
] }) })
|
|
3611
3612
|
] }),
|
|
3612
|
-
/* @__PURE__ */ o(
|
|
3613
|
+
/* @__PURE__ */ o(ae, { className: "flex justify-between", children: [
|
|
3613
3614
|
r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3614
3615
|
/* @__PURE__ */ n(
|
|
3615
3616
|
_,
|
|
@@ -3627,117 +3628,117 @@ const Vr = ue.any(), xr = ({
|
|
|
3627
3628
|
onComplete: e,
|
|
3628
3629
|
onBack: r
|
|
3629
3630
|
}) => {
|
|
3630
|
-
const { appropriatenessTestService: s } =
|
|
3631
|
-
|
|
3631
|
+
const { appropriatenessTestService: s } = ie(), [a, i] = N(null), [l, c] = N(!0), [d, u] = N(!1), [g, v] = N(null), [p, f] = N({}), [m, y] = N(0), [k, h] = N(!1), [I, S] = N(!1), [w, B] = N(0);
|
|
3632
|
+
Y(() => {
|
|
3632
3633
|
(async () => {
|
|
3633
3634
|
try {
|
|
3634
3635
|
c(!0), v(null), console.log("Loading appropriateness test for applicant:", t);
|
|
3635
|
-
const
|
|
3636
|
-
if (console.log("Appropriateness test data:",
|
|
3637
|
-
const
|
|
3638
|
-
|
|
3636
|
+
const R = await s.getAppropriatenessTest(t);
|
|
3637
|
+
if (console.log("Appropriateness test data:", R), i(R), R.waitTimeSpanForNextTry && R.waitTimeSpanForNextTry !== "00:00:00") {
|
|
3638
|
+
const b = L(R.waitTimeSpanForNextTry);
|
|
3639
|
+
b > 0 && B(b);
|
|
3639
3640
|
}
|
|
3640
|
-
} catch (
|
|
3641
|
-
console.error("Error loading appropriateness test:",
|
|
3641
|
+
} catch (R) {
|
|
3642
|
+
console.error("Error loading appropriateness test:", R), v(R.message || "Failed to load appropriateness test");
|
|
3642
3643
|
} finally {
|
|
3643
3644
|
c(!1);
|
|
3644
3645
|
}
|
|
3645
3646
|
})();
|
|
3646
3647
|
}, [t, s]);
|
|
3647
|
-
const
|
|
3648
|
-
const
|
|
3649
|
-
if (
|
|
3650
|
-
const [
|
|
3651
|
-
return
|
|
3648
|
+
const L = (F) => {
|
|
3649
|
+
const R = F.split(":").map(Number);
|
|
3650
|
+
if (R.length === 3) {
|
|
3651
|
+
const [b, E, U] = R;
|
|
3652
|
+
return b * 3600 + E * 60 + U;
|
|
3652
3653
|
}
|
|
3653
3654
|
return 0;
|
|
3654
|
-
},
|
|
3655
|
-
const
|
|
3656
|
-
return `${
|
|
3655
|
+
}, A = (F) => {
|
|
3656
|
+
const R = Math.floor(F / 60), b = F % 60;
|
|
3657
|
+
return `${R.toString().padStart(2, "0")}:${b.toString().padStart(2, "0")}`;
|
|
3657
3658
|
};
|
|
3658
|
-
|
|
3659
|
+
Y(() => {
|
|
3659
3660
|
if (!k || m <= 0) return;
|
|
3660
|
-
const
|
|
3661
|
-
|
|
3661
|
+
const F = setInterval(() => {
|
|
3662
|
+
y((R) => R <= 1 ? (S(!0), 0) : R - 1);
|
|
3662
3663
|
}, 1e3);
|
|
3663
|
-
return () => clearInterval(
|
|
3664
|
-
}, [k, m]),
|
|
3664
|
+
return () => clearInterval(F);
|
|
3665
|
+
}, [k, m]), Y(() => {
|
|
3665
3666
|
if (w <= 0) return;
|
|
3666
|
-
const
|
|
3667
|
-
|
|
3667
|
+
const F = setInterval(() => {
|
|
3668
|
+
B((R) => R <= 1 ? 0 : R - 1);
|
|
3668
3669
|
}, 1e3);
|
|
3669
|
-
return () => clearInterval(
|
|
3670
|
-
}, [w]),
|
|
3671
|
-
|
|
3672
|
-
}, [
|
|
3670
|
+
return () => clearInterval(F);
|
|
3671
|
+
}, [w]), Y(() => {
|
|
3672
|
+
I && !d && z();
|
|
3673
|
+
}, [I]);
|
|
3673
3674
|
const C = () => {
|
|
3674
|
-
a && (h(!0),
|
|
3675
|
-
},
|
|
3676
|
-
|
|
3677
|
-
...
|
|
3678
|
-
[
|
|
3675
|
+
a && (h(!0), y(a.testDurationSec));
|
|
3676
|
+
}, D = (F, R) => {
|
|
3677
|
+
f((b) => ({
|
|
3678
|
+
...b,
|
|
3679
|
+
[F]: R
|
|
3679
3680
|
}));
|
|
3680
|
-
},
|
|
3681
|
-
if (
|
|
3682
|
-
if (!
|
|
3683
|
-
const
|
|
3684
|
-
if (
|
|
3685
|
-
v(`Please answer all questions. ${
|
|
3681
|
+
}, z = async (F) => {
|
|
3682
|
+
if (F && F.preventDefault(), !!a) {
|
|
3683
|
+
if (!I) {
|
|
3684
|
+
const R = a.appropriatenessQuestions.length - Object.keys(p).length;
|
|
3685
|
+
if (R > 0) {
|
|
3686
|
+
v(`Please answer all questions. ${R} question(s) remaining.`);
|
|
3686
3687
|
return;
|
|
3687
3688
|
}
|
|
3688
3689
|
}
|
|
3689
3690
|
u(!0), v(null);
|
|
3690
3691
|
try {
|
|
3691
|
-
const
|
|
3692
|
-
(
|
|
3693
|
-
appropriatenessQuestionId:
|
|
3694
|
-
value:
|
|
3692
|
+
const R = a.appropriatenessQuestions.map(
|
|
3693
|
+
(E) => ({
|
|
3694
|
+
appropriatenessQuestionId: E.id,
|
|
3695
|
+
value: p[E.id] || ""
|
|
3695
3696
|
// Empty string if not answered
|
|
3696
3697
|
})
|
|
3697
|
-
),
|
|
3698
|
+
), b = {
|
|
3698
3699
|
applicantId: t,
|
|
3699
3700
|
appropriatenessTestId: a.id,
|
|
3700
|
-
appropriatenessQuestionResults:
|
|
3701
|
+
appropriatenessQuestionResults: R
|
|
3701
3702
|
};
|
|
3702
|
-
console.log("Submitting appropriateness test:",
|
|
3703
|
+
console.log("Submitting appropriateness test:", b);
|
|
3703
3704
|
try {
|
|
3704
|
-
const
|
|
3705
|
-
console.log("Appropriateness test result:",
|
|
3706
|
-
} catch (
|
|
3707
|
-
if (
|
|
3708
|
-
const
|
|
3709
|
-
console.log("Test failed:",
|
|
3705
|
+
const E = await s.fillAppropriatenessTest(b);
|
|
3706
|
+
console.log("Appropriateness test result:", E), E.message && (E.message.toLowerCase().includes("pass") || E.message.toLowerCase().includes("success") || E.message.toLowerCase().includes("congratulations")) ? e == null || e() : (v(E.message || "Test completed. Please check the result."), h(!1), S(!1), f({}), setTimeout(() => W(), 1e3));
|
|
3707
|
+
} catch (E) {
|
|
3708
|
+
if (E.code === 400 && E.message) {
|
|
3709
|
+
const U = E.message;
|
|
3710
|
+
console.log("Test failed:", U), v(U), h(!1), S(!1), f({}), setTimeout(() => W(), 1500);
|
|
3710
3711
|
} else
|
|
3711
|
-
throw
|
|
3712
|
+
throw E;
|
|
3712
3713
|
}
|
|
3713
|
-
} catch (
|
|
3714
|
-
console.error("Error submitting appropriateness test:",
|
|
3714
|
+
} catch (R) {
|
|
3715
|
+
console.error("Error submitting appropriateness test:", R), v(R.message || "Failed to submit test. Please try again."), h(!1), S(!1), f({});
|
|
3715
3716
|
} finally {
|
|
3716
3717
|
u(!1);
|
|
3717
3718
|
}
|
|
3718
3719
|
}
|
|
3719
|
-
},
|
|
3720
|
+
}, W = async () => {
|
|
3720
3721
|
try {
|
|
3721
|
-
const
|
|
3722
|
-
if (console.log("Reloaded test data:",
|
|
3723
|
-
const
|
|
3724
|
-
|
|
3722
|
+
const F = await s.getAppropriatenessTest(t);
|
|
3723
|
+
if (console.log("Reloaded test data:", F), i(F), F.waitTimeSpanForNextTry && F.waitTimeSpanForNextTry !== "00:00:00") {
|
|
3724
|
+
const R = L(F.waitTimeSpanForNextTry);
|
|
3725
|
+
R > 0 && B(R);
|
|
3725
3726
|
}
|
|
3726
|
-
} catch (
|
|
3727
|
-
console.error("Error reloading test data:",
|
|
3727
|
+
} catch (F) {
|
|
3728
|
+
console.error("Error reloading test data:", F), v((R) => R + `
|
|
3728
3729
|
|
|
3729
3730
|
Failed to reload test data. Please refresh the page.`);
|
|
3730
3731
|
}
|
|
3731
3732
|
};
|
|
3732
3733
|
if (l)
|
|
3733
3734
|
return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
|
|
3734
|
-
/* @__PURE__ */ n(
|
|
3735
|
+
/* @__PURE__ */ n(de, { className: "my-8" }),
|
|
3735
3736
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading appropriateness test..." })
|
|
3736
3737
|
] }) });
|
|
3737
3738
|
if (!a)
|
|
3738
3739
|
return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { className: "py-12 text-center", children: [
|
|
3739
3740
|
/* @__PURE__ */ n("p", { className: "text-danger-500 text-lg mb-4", children: "No test data available" }),
|
|
3740
|
-
|
|
3741
|
+
g && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: g })
|
|
3741
3742
|
] }) });
|
|
3742
3743
|
if (w > 0)
|
|
3743
3744
|
return /* @__PURE__ */ o(T, { children: [
|
|
@@ -3747,14 +3748,14 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3747
3748
|
] }),
|
|
3748
3749
|
/* @__PURE__ */ o(M, { className: "py-12 text-center", children: [
|
|
3749
3750
|
/* @__PURE__ */ o("div", { className: "mb-6", children: [
|
|
3750
|
-
/* @__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: A(w) }),
|
|
3751
3752
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait before attempting the test again" })
|
|
3752
3753
|
] }),
|
|
3753
|
-
|
|
3754
|
+
g && /* @__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: g }) })
|
|
3754
3755
|
] })
|
|
3755
3756
|
] });
|
|
3756
|
-
const
|
|
3757
|
-
return k ? /* @__PURE__ */ n("form", { onSubmit:
|
|
3757
|
+
const j = a.testAllowedMaxTry - a.totalFailedTries;
|
|
3758
|
+
return k ? /* @__PURE__ */ n("form", { onSubmit: z, children: /* @__PURE__ */ o(T, { children: [
|
|
3758
3759
|
/* @__PURE__ */ n(ee, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
|
|
3759
3760
|
/* @__PURE__ */ o("div", { children: [
|
|
3760
3761
|
/* @__PURE__ */ n("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: a.displayName }),
|
|
@@ -3765,7 +3766,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3765
3766
|
"div",
|
|
3766
3767
|
{
|
|
3767
3768
|
className: `text-3xl font-bold ${m <= 60 ? "text-danger-500" : "text-primary-500"}`,
|
|
3768
|
-
children:
|
|
3769
|
+
children: A(m)
|
|
3769
3770
|
}
|
|
3770
3771
|
),
|
|
3771
3772
|
/* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Time Remaining" })
|
|
@@ -3773,20 +3774,20 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3773
3774
|
] }) }),
|
|
3774
3775
|
/* @__PURE__ */ o(M, { className: "space-y-6", children: [
|
|
3775
3776
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between mb-4", children: [
|
|
3776
|
-
/* @__PURE__ */ o(
|
|
3777
|
+
/* @__PURE__ */ o(pe, { variant: "info", children: [
|
|
3777
3778
|
"Question ",
|
|
3778
|
-
Object.keys(
|
|
3779
|
+
Object.keys(p).length,
|
|
3779
3780
|
" of ",
|
|
3780
3781
|
a.totalQuestionCount
|
|
3781
3782
|
] }),
|
|
3782
|
-
/* @__PURE__ */ o(
|
|
3783
|
-
|
|
3783
|
+
/* @__PURE__ */ o(pe, { variant: j > 1 ? "success" : "warning", children: [
|
|
3784
|
+
j,
|
|
3784
3785
|
" attempt",
|
|
3785
|
-
|
|
3786
|
+
j !== 1 ? "s" : "",
|
|
3786
3787
|
" remaining"
|
|
3787
3788
|
] })
|
|
3788
3789
|
] }),
|
|
3789
|
-
a.appropriatenessQuestions.map((
|
|
3790
|
+
a.appropriatenessQuestions.map((F, R) => /* @__PURE__ */ o(
|
|
3790
3791
|
"div",
|
|
3791
3792
|
{
|
|
3792
3793
|
className: "p-4 border border-gray-200 dark:border-gray-700 rounded-lg",
|
|
@@ -3794,51 +3795,51 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3794
3795
|
/* @__PURE__ */ o("div", { className: "mb-4", children: [
|
|
3795
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: [
|
|
3796
3797
|
"Question ",
|
|
3797
|
-
|
|
3798
|
+
R + 1
|
|
3798
3799
|
] }),
|
|
3799
|
-
|
|
3800
|
-
/* @__PURE__ */ n("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children:
|
|
3800
|
+
F.groupName && /* @__PURE__ */ n("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: F.groupName }),
|
|
3801
|
+
/* @__PURE__ */ n("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children: F.question })
|
|
3801
3802
|
] }),
|
|
3802
|
-
/* @__PURE__ */ n("div", { className: "space-y-2", children:
|
|
3803
|
+
/* @__PURE__ */ n("div", { className: "space-y-2", children: F.answers.map((b, E) => /* @__PURE__ */ o(
|
|
3803
3804
|
"label",
|
|
3804
3805
|
{
|
|
3805
3806
|
className: `
|
|
3806
3807
|
flex items-center p-3 border-2 rounded-lg cursor-pointer transition-all
|
|
3807
|
-
${
|
|
3808
|
+
${p[F.id] === b ? "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"}
|
|
3808
3809
|
`,
|
|
3809
3810
|
children: [
|
|
3810
3811
|
/* @__PURE__ */ n(
|
|
3811
3812
|
"input",
|
|
3812
3813
|
{
|
|
3813
3814
|
type: "radio",
|
|
3814
|
-
name: `question-${
|
|
3815
|
-
value:
|
|
3816
|
-
checked:
|
|
3817
|
-
onChange: (
|
|
3815
|
+
name: `question-${F.id}`,
|
|
3816
|
+
value: b,
|
|
3817
|
+
checked: p[F.id] === b,
|
|
3818
|
+
onChange: (U) => D(F.id, U.target.value),
|
|
3818
3819
|
className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500",
|
|
3819
3820
|
disabled: d
|
|
3820
3821
|
}
|
|
3821
3822
|
),
|
|
3822
|
-
/* @__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: b })
|
|
3823
3824
|
]
|
|
3824
3825
|
},
|
|
3825
|
-
|
|
3826
|
+
E
|
|
3826
3827
|
)) })
|
|
3827
3828
|
]
|
|
3828
3829
|
},
|
|
3829
|
-
|
|
3830
|
+
F.id
|
|
3830
3831
|
)),
|
|
3831
|
-
|
|
3832
|
+
g && !I && /* @__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: [
|
|
3832
3833
|
/* @__PURE__ */ n("strong", { children: "Error:" }),
|
|
3833
3834
|
" ",
|
|
3834
|
-
|
|
3835
|
+
g
|
|
3835
3836
|
] }) }),
|
|
3836
|
-
|
|
3837
|
+
I && /* @__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: [
|
|
3837
3838
|
/* @__PURE__ */ n("strong", { children: "Time's up!" }),
|
|
3838
3839
|
" Your answers are being submitted automatically."
|
|
3839
3840
|
] }) })
|
|
3840
3841
|
] }),
|
|
3841
|
-
/* @__PURE__ */ o(
|
|
3842
|
+
/* @__PURE__ */ o(ae, { className: "flex justify-between", children: [
|
|
3842
3843
|
/* @__PURE__ */ n(
|
|
3843
3844
|
_,
|
|
3844
3845
|
{
|
|
@@ -3854,8 +3855,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3854
3855
|
{
|
|
3855
3856
|
type: "submit",
|
|
3856
3857
|
isLoading: d,
|
|
3857
|
-
disabled: Object.keys(
|
|
3858
|
-
children:
|
|
3858
|
+
disabled: Object.keys(p).length < a.totalQuestionCount,
|
|
3859
|
+
children: I ? "Submitting..." : "Submit Test"
|
|
3859
3860
|
}
|
|
3860
3861
|
)
|
|
3861
3862
|
] })
|
|
@@ -3869,36 +3870,36 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3869
3870
|
/* @__PURE__ */ o("div", { className: "space-y-4 mb-6", children: [
|
|
3870
3871
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
3871
3872
|
/* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Total Questions:" }),
|
|
3872
|
-
/* @__PURE__ */ n(
|
|
3873
|
+
/* @__PURE__ */ n(pe, { variant: "info", children: a.totalQuestionCount })
|
|
3873
3874
|
] }),
|
|
3874
3875
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
3875
3876
|
/* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Time Limit:" }),
|
|
3876
|
-
/* @__PURE__ */ n(
|
|
3877
|
+
/* @__PURE__ */ n(pe, { variant: "info", children: A(a.testDurationSec) })
|
|
3877
3878
|
] }),
|
|
3878
3879
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
3879
3880
|
/* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Correct Answers Required:" }),
|
|
3880
|
-
/* @__PURE__ */ n(
|
|
3881
|
+
/* @__PURE__ */ n(pe, { variant: "info", children: a.testCorrectAnswerPassLimit })
|
|
3881
3882
|
] }),
|
|
3882
3883
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
3883
3884
|
/* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Attempts Remaining:" }),
|
|
3884
|
-
/* @__PURE__ */ n(
|
|
3885
|
+
/* @__PURE__ */ n(pe, { variant: j > 1 ? "success" : "warning", children: j })
|
|
3885
3886
|
] })
|
|
3886
3887
|
] }),
|
|
3887
|
-
|
|
3888
|
+
g && /* @__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: [
|
|
3888
3889
|
/* @__PURE__ */ n("strong", { children: "Previous Attempt:" }),
|
|
3889
3890
|
" ",
|
|
3890
|
-
|
|
3891
|
+
g
|
|
3891
3892
|
] }) }),
|
|
3892
|
-
|
|
3893
|
+
j <= 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." }) })
|
|
3893
3894
|
] }),
|
|
3894
|
-
/* @__PURE__ */ o(
|
|
3895
|
+
/* @__PURE__ */ o(ae, { className: "flex justify-between", children: [
|
|
3895
3896
|
r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3896
3897
|
/* @__PURE__ */ n(
|
|
3897
3898
|
_,
|
|
3898
3899
|
{
|
|
3899
3900
|
type: "button",
|
|
3900
3901
|
onClick: C,
|
|
3901
|
-
disabled:
|
|
3902
|
+
disabled: j <= 0,
|
|
3902
3903
|
children: "Start Test"
|
|
3903
3904
|
}
|
|
3904
3905
|
)
|
|
@@ -3909,8 +3910,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3909
3910
|
onComplete: e,
|
|
3910
3911
|
onBack: r
|
|
3911
3912
|
}) => {
|
|
3912
|
-
var
|
|
3913
|
-
const { applicantService: s, baseInformationService: a, config: i } =
|
|
3913
|
+
var b, E, U, re;
|
|
3914
|
+
const { applicantService: s, baseInformationService: a, config: i } = ie(), { identityData: l, provider: c, token: d, isLoading: u, error: g, requestIdentity: v, restartIdentity: p } = er(t), [f, m] = N(null), [y, k] = N(null), [h, I] = N([]), [S, w] = N(!0), [B, L] = N(!1), [A, C] = N(null), [D, z] = N(!1), W = se.useRef(!1), j = Te({
|
|
3914
3915
|
defaultValues: {
|
|
3915
3916
|
street: "",
|
|
3916
3917
|
streetNumber: "",
|
|
@@ -3921,160 +3922,160 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3921
3922
|
phonenumber: ""
|
|
3922
3923
|
}
|
|
3923
3924
|
});
|
|
3924
|
-
|
|
3925
|
+
Y(() => {
|
|
3925
3926
|
(async () => {
|
|
3926
3927
|
try {
|
|
3927
|
-
const [
|
|
3928
|
+
const [P, Q] = await Promise.all([
|
|
3928
3929
|
s.getApplicantData(t),
|
|
3929
3930
|
a.getCountries("", "en")
|
|
3930
3931
|
]);
|
|
3931
|
-
k(
|
|
3932
|
-
const
|
|
3933
|
-
const Ae =
|
|
3934
|
-
return !Ae ||
|
|
3932
|
+
k(P);
|
|
3933
|
+
const V = /* @__PURE__ */ new Set(), oe = Q.filter((he) => {
|
|
3934
|
+
const Ae = he.abbreviation3 || he.abbreviation;
|
|
3935
|
+
return !Ae || V.has(Ae) ? !1 : (V.add(Ae), !0);
|
|
3935
3936
|
});
|
|
3936
|
-
|
|
3937
|
-
const
|
|
3938
|
-
if (
|
|
3939
|
-
street: (
|
|
3940
|
-
streetNumber: (
|
|
3941
|
-
city: (
|
|
3942
|
-
zip: (
|
|
3943
|
-
country: (
|
|
3944
|
-
nationality: (
|
|
3945
|
-
phonenumber: (
|
|
3946
|
-
}),
|
|
3947
|
-
console.log("[Identity] Found existing identity verification, auto-requesting..."),
|
|
3937
|
+
I(oe);
|
|
3938
|
+
const $ = P.applicantRequestData;
|
|
3939
|
+
if (j.reset({
|
|
3940
|
+
street: ($ == null ? void 0 : $.street) || "",
|
|
3941
|
+
streetNumber: ($ == null ? void 0 : $.streetNumber) || "",
|
|
3942
|
+
city: ($ == null ? void 0 : $.city) || "",
|
|
3943
|
+
zip: ($ == null ? void 0 : $.zip) || "",
|
|
3944
|
+
country: ($ == null ? void 0 : $.country) || "",
|
|
3945
|
+
nationality: ($ == null ? void 0 : $.nationality) || "",
|
|
3946
|
+
phonenumber: ($ == null ? void 0 : $.phonenumber) || ""
|
|
3947
|
+
}), P.kycRecords && P.kycRecords.length > 0 && P.kycRecords[0].providerTokenObject !== null && !W.current) {
|
|
3948
|
+
console.log("[Identity] Found existing identity verification, auto-requesting..."), W.current = !0;
|
|
3948
3949
|
try {
|
|
3949
|
-
await v(),
|
|
3950
|
-
} catch (
|
|
3951
|
-
console.error("[Identity] Auto-request failed:",
|
|
3950
|
+
await v(), L(!0);
|
|
3951
|
+
} catch (he) {
|
|
3952
|
+
console.error("[Identity] Auto-request failed:", he);
|
|
3952
3953
|
}
|
|
3953
3954
|
}
|
|
3954
|
-
} catch (
|
|
3955
|
-
console.error("Error loading applicant data:",
|
|
3955
|
+
} catch (P) {
|
|
3956
|
+
console.error("Error loading applicant data:", P);
|
|
3956
3957
|
} finally {
|
|
3957
3958
|
w(!1);
|
|
3958
3959
|
}
|
|
3959
3960
|
})();
|
|
3960
|
-
}, [t]),
|
|
3961
|
-
l && !
|
|
3962
|
-
}, [l,
|
|
3961
|
+
}, [t]), Y(() => {
|
|
3962
|
+
l && !B && (console.log("[Identity] Identity data already loaded, showing provider"), L(!0));
|
|
3963
|
+
}, [l, B]), Y(() => {
|
|
3963
3964
|
if (d) {
|
|
3964
3965
|
if (d.expiresAt) {
|
|
3965
|
-
const
|
|
3966
|
-
if (Date.now() >=
|
|
3967
|
-
console.warn("[Identity] Token has expired (expiresAt)"),
|
|
3966
|
+
const x = new Date(d.expiresAt).getTime();
|
|
3967
|
+
if (Date.now() >= x) {
|
|
3968
|
+
console.warn("[Identity] Token has expired (expiresAt)"), z(!0), C("Your verification session has expired. Please restart.");
|
|
3968
3969
|
return;
|
|
3969
3970
|
}
|
|
3970
3971
|
}
|
|
3971
3972
|
if (d.url)
|
|
3972
3973
|
try {
|
|
3973
|
-
const
|
|
3974
|
-
if (
|
|
3975
|
-
console.warn("[Identity] Token URL indicates expiration"),
|
|
3974
|
+
const P = new URL(d.url).toString().toLowerCase();
|
|
3975
|
+
if (P.includes("expired") || P.includes("invalid") || P.includes("error")) {
|
|
3976
|
+
console.warn("[Identity] Token URL indicates expiration"), z(!0), C("Your verification link has expired. Please restart.");
|
|
3976
3977
|
return;
|
|
3977
3978
|
}
|
|
3978
3979
|
} catch {
|
|
3979
3980
|
console.error("[Identity] Invalid token URL");
|
|
3980
3981
|
}
|
|
3981
3982
|
if (d.status === "expired" || d.error === "expired" || d.expired === !0) {
|
|
3982
|
-
console.warn("[Identity] Token object indicates expiration"),
|
|
3983
|
+
console.warn("[Identity] Token object indicates expiration"), z(!0), C("Your verification session has expired. Please restart.");
|
|
3983
3984
|
return;
|
|
3984
3985
|
}
|
|
3985
3986
|
}
|
|
3986
|
-
}, [d]),
|
|
3987
|
-
if (c !== null && d && !
|
|
3988
|
-
const
|
|
3987
|
+
}, [d]), Y(() => {
|
|
3988
|
+
if (c !== null && d && !f && B && !D) {
|
|
3989
|
+
const x = c;
|
|
3989
3990
|
if (d.url) {
|
|
3990
3991
|
console.log("[Identity] Loading provider URL for user verification:", d.url), C(null);
|
|
3991
3992
|
try {
|
|
3992
|
-
if (new URL(d.url),
|
|
3993
|
+
if (new URL(d.url), x === le.SardinAI) {
|
|
3993
3994
|
console.log("[SardinAI] Initializing Risk SDK in background...");
|
|
3994
3995
|
try {
|
|
3995
|
-
const
|
|
3996
|
-
|
|
3996
|
+
const P = be.parseProviderConfig(c, d, i);
|
|
3997
|
+
be.createProvider(c, P).initialize().then(() => {
|
|
3997
3998
|
console.log("[SardinAI] Risk SDK initialized successfully in background");
|
|
3998
|
-
}).catch((
|
|
3999
|
-
console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):",
|
|
3999
|
+
}).catch((V) => {
|
|
4000
|
+
console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):", V);
|
|
4000
4001
|
});
|
|
4001
|
-
} catch (
|
|
4002
|
-
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):",
|
|
4002
|
+
} catch (P) {
|
|
4003
|
+
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", P);
|
|
4003
4004
|
}
|
|
4004
4005
|
}
|
|
4005
4006
|
m({ type: "url", url: d.url });
|
|
4006
|
-
} catch (
|
|
4007
|
-
console.error("[Identity] Invalid URL:",
|
|
4007
|
+
} catch (P) {
|
|
4008
|
+
console.error("[Identity] Invalid URL:", P), C("Invalid verification URL. Please restart."), z(!0);
|
|
4008
4009
|
}
|
|
4009
4010
|
return;
|
|
4010
4011
|
}
|
|
4011
|
-
if (
|
|
4012
|
+
if (x === le.SardinAI) {
|
|
4012
4013
|
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), C(null);
|
|
4013
4014
|
try {
|
|
4014
|
-
const
|
|
4015
|
-
|
|
4016
|
-
console.log("[SardinAI] Risk SDK initialized successfully"), m(
|
|
4015
|
+
const P = be.parseProviderConfig(c, d, i), Q = be.createProvider(c, P);
|
|
4016
|
+
Q.initialize().then(() => {
|
|
4017
|
+
console.log("[SardinAI] Risk SDK initialized successfully"), m(Q), setTimeout(() => {
|
|
4017
4018
|
e == null || e();
|
|
4018
4019
|
}, 2e3);
|
|
4019
|
-
}).catch((
|
|
4020
|
-
var
|
|
4021
|
-
console.error("[SardinAI] Failed to initialize:",
|
|
4022
|
-
const
|
|
4023
|
-
|
|
4020
|
+
}).catch((V) => {
|
|
4021
|
+
var $;
|
|
4022
|
+
console.error("[SardinAI] Failed to initialize:", V);
|
|
4023
|
+
const oe = (($ = V.message) == null ? void 0 : $.toLowerCase()) || "";
|
|
4024
|
+
oe.includes("expired") || oe.includes("invalid") || oe.includes("401") || oe.includes("400") ? (z(!0), C("Session expired or invalid. Please restart verification.")) : C(`Failed to initialize: ${V.message}`);
|
|
4024
4025
|
});
|
|
4025
|
-
} catch (
|
|
4026
|
-
console.error("[SardinAI] Error creating provider:",
|
|
4026
|
+
} catch (P) {
|
|
4027
|
+
console.error("[SardinAI] Error creating provider:", P), C(`Configuration error: ${P.message}`);
|
|
4027
4028
|
}
|
|
4028
4029
|
return;
|
|
4029
4030
|
}
|
|
4030
4031
|
try {
|
|
4031
4032
|
C(null);
|
|
4032
|
-
const
|
|
4033
|
-
|
|
4034
|
-
var
|
|
4035
|
-
console.error("[Sumsub] Initialization error:",
|
|
4036
|
-
}),
|
|
4033
|
+
const P = be.parseProviderConfig(c, d, i), Q = be.createProvider(c, P);
|
|
4034
|
+
x === le.Sumsub ? (Q.initialize("identity-container").catch((V) => {
|
|
4035
|
+
var oe;
|
|
4036
|
+
console.error("[Sumsub] Initialization error:", V), C(`Failed to initialize: ${V.message}`), (oe = V.message) != null && oe.toLowerCase().includes("expired") && z(!0);
|
|
4037
|
+
}), Q.onComplete && Q.onComplete(() => {
|
|
4037
4038
|
e == null || e();
|
|
4038
|
-
})) :
|
|
4039
|
-
console.error("[Onfido] Initialization error:",
|
|
4040
|
-
}), m(
|
|
4041
|
-
} catch (
|
|
4042
|
-
console.error("[Identity] Provider setup error:",
|
|
4039
|
+
})) : x === le.Onfido && Q.initialize("identity-container").catch((V) => {
|
|
4040
|
+
console.error("[Onfido] Initialization error:", V), C(`Failed to initialize: ${V.message}`);
|
|
4041
|
+
}), m(Q);
|
|
4042
|
+
} catch (P) {
|
|
4043
|
+
console.error("[Identity] Provider setup error:", P), C(`Setup error: ${P.message}`);
|
|
4043
4044
|
}
|
|
4044
4045
|
}
|
|
4045
4046
|
return () => {
|
|
4046
|
-
if (
|
|
4047
|
+
if (f && f.destroy)
|
|
4047
4048
|
try {
|
|
4048
|
-
|
|
4049
|
-
} catch (
|
|
4050
|
-
console.error("[Identity] Error destroying provider:",
|
|
4049
|
+
f.destroy();
|
|
4050
|
+
} catch (x) {
|
|
4051
|
+
console.error("[Identity] Error destroying provider:", x);
|
|
4051
4052
|
}
|
|
4052
4053
|
};
|
|
4053
|
-
}, [c, d,
|
|
4054
|
-
const
|
|
4054
|
+
}, [c, d, f, B, e, D]);
|
|
4055
|
+
const F = async () => {
|
|
4055
4056
|
try {
|
|
4056
|
-
C(null),
|
|
4057
|
-
} catch (
|
|
4058
|
-
console.error("Error starting identity verification:",
|
|
4057
|
+
C(null), z(!1), await v(), L(!0);
|
|
4058
|
+
} catch (x) {
|
|
4059
|
+
console.error("Error starting identity verification:", x);
|
|
4059
4060
|
}
|
|
4060
|
-
},
|
|
4061
|
+
}, R = async () => {
|
|
4061
4062
|
try {
|
|
4062
|
-
C(null),
|
|
4063
|
-
} catch (
|
|
4064
|
-
console.error("Error restarting identity verification:",
|
|
4063
|
+
C(null), z(!1), m(null), console.log("[Identity] Restarting verification..."), await p(), L(!0);
|
|
4064
|
+
} catch (x) {
|
|
4065
|
+
console.error("Error restarting identity verification:", x), C(x.message || "Failed to restart verification");
|
|
4065
4066
|
}
|
|
4066
4067
|
};
|
|
4067
4068
|
if (S || u)
|
|
4068
4069
|
return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
|
|
4069
|
-
/* @__PURE__ */ n(
|
|
4070
|
+
/* @__PURE__ */ n(de, { className: "my-8" }),
|
|
4070
4071
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading identity verification..." })
|
|
4071
4072
|
] }) });
|
|
4072
|
-
if (
|
|
4073
|
+
if (g)
|
|
4073
4074
|
return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
4074
4075
|
"Error: ",
|
|
4075
|
-
|
|
4076
|
+
g.message
|
|
4076
4077
|
] }) }) });
|
|
4077
|
-
if (
|
|
4078
|
+
if (B && (A || D))
|
|
4078
4079
|
return /* @__PURE__ */ o(T, { children: [
|
|
4079
4080
|
/* @__PURE__ */ n(ee, { children: /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
|
|
4080
4081
|
/* @__PURE__ */ o(M, { children: [
|
|
@@ -4098,8 +4099,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4098
4099
|
}
|
|
4099
4100
|
),
|
|
4100
4101
|
/* @__PURE__ */ o("div", { children: [
|
|
4101
|
-
/* @__PURE__ */ n("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children:
|
|
4102
|
-
/* @__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: D ? "Session Expired" : "Verification Error" }),
|
|
4103
|
+
/* @__PURE__ */ n("p", { className: "text-red-800 dark:text-red-200 text-sm", children: A || "Your verification session has expired and needs to be restarted." })
|
|
4103
4104
|
] })
|
|
4104
4105
|
] }) }),
|
|
4105
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: [
|
|
@@ -4111,13 +4112,13 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4111
4112
|
] })
|
|
4112
4113
|
] })
|
|
4113
4114
|
] }),
|
|
4114
|
-
/* @__PURE__ */ o(
|
|
4115
|
+
/* @__PURE__ */ o(ae, { className: "flex justify-between", children: [
|
|
4115
4116
|
r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
4116
|
-
/* @__PURE__ */ n(_, { type: "button", onClick:
|
|
4117
|
+
/* @__PURE__ */ n(_, { type: "button", onClick: R, disabled: u, children: u ? "Restarting..." : "Restart Verification" })
|
|
4117
4118
|
] })
|
|
4118
4119
|
] });
|
|
4119
|
-
if (
|
|
4120
|
-
const
|
|
4120
|
+
if (B && l) {
|
|
4121
|
+
const x = c;
|
|
4121
4122
|
return d != null && d.url ? /* @__PURE__ */ o(T, { children: [
|
|
4122
4123
|
/* @__PURE__ */ n(ee, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
|
|
4123
4124
|
/* @__PURE__ */ o("div", { children: [
|
|
@@ -4130,7 +4131,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4130
4131
|
type: "button",
|
|
4131
4132
|
variant: "outline",
|
|
4132
4133
|
size: "sm",
|
|
4133
|
-
onClick:
|
|
4134
|
+
onClick: R,
|
|
4134
4135
|
disabled: u,
|
|
4135
4136
|
children: "Restart"
|
|
4136
4137
|
}
|
|
@@ -4148,14 +4149,14 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4148
4149
|
className: "w-full h-full border-0 rounded-lg",
|
|
4149
4150
|
allow: "camera; microphone; geolocation",
|
|
4150
4151
|
title: "Identity Verification",
|
|
4151
|
-
onLoad: (
|
|
4152
|
-
var
|
|
4152
|
+
onLoad: (P) => {
|
|
4153
|
+
var Q, V, oe;
|
|
4153
4154
|
console.log("[Identity] Iframe loaded");
|
|
4154
4155
|
try {
|
|
4155
|
-
const
|
|
4156
|
+
const $ = P.target, Ce = $.contentDocument || ((Q = $.contentWindow) == null ? void 0 : Q.document);
|
|
4156
4157
|
if (Ce) {
|
|
4157
|
-
const
|
|
4158
|
-
(
|
|
4158
|
+
const he = ((oe = (V = Ce.body) == null ? void 0 : V.textContent) == null ? void 0 : oe.toLowerCase()) || "";
|
|
4159
|
+
(he.includes("expired") || he.includes("invalid") || he.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), z(!0), C("Your verification link has expired."));
|
|
4159
4160
|
}
|
|
4160
4161
|
} catch {
|
|
4161
4162
|
console.log("[Identity] Cannot check iframe content (CORS)");
|
|
@@ -4164,14 +4165,14 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4164
4165
|
}
|
|
4165
4166
|
) })
|
|
4166
4167
|
] }),
|
|
4167
|
-
r && /* @__PURE__ */ n(
|
|
4168
|
-
] }) :
|
|
4168
|
+
r && /* @__PURE__ */ n(ae, { children: /* @__PURE__ */ n(_, { variant: "outline", onClick: r, children: "Back" }) })
|
|
4169
|
+
] }) : x === le.SardinAI ? /* @__PURE__ */ o(T, { children: [
|
|
4169
4170
|
/* @__PURE__ */ o(ee, { children: [
|
|
4170
4171
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Device Risk Assessment" }),
|
|
4171
4172
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Analyzing device security and behavioral patterns..." })
|
|
4172
4173
|
] }),
|
|
4173
4174
|
/* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("div", { className: "text-center py-12", children: [
|
|
4174
|
-
/* @__PURE__ */ n(
|
|
4175
|
+
/* @__PURE__ */ n(de, { className: "mb-4" }),
|
|
4175
4176
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait while we verify your device security" }),
|
|
4176
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" })
|
|
4177
4178
|
] }) })
|
|
@@ -4181,10 +4182,10 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4181
4182
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
|
|
4182
4183
|
] }),
|
|
4183
4184
|
/* @__PURE__ */ n(M, { children: /* @__PURE__ */ n("div", { id: "identity-container", className: "min-h-[400px]" }) }),
|
|
4184
|
-
r && /* @__PURE__ */ n(
|
|
4185
|
+
r && /* @__PURE__ */ n(ae, { children: /* @__PURE__ */ n(_, { variant: "outline", onClick: r, children: "Back" }) })
|
|
4185
4186
|
] });
|
|
4186
4187
|
}
|
|
4187
|
-
return /* @__PURE__ */ n("form", { onSubmit:
|
|
4188
|
+
return /* @__PURE__ */ n("form", { onSubmit: j.handleSubmit(F), children: /* @__PURE__ */ o(T, { children: [
|
|
4188
4189
|
/* @__PURE__ */ o(ee, { children: [
|
|
4189
4190
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Review Your Information" }),
|
|
4190
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" })
|
|
@@ -4194,18 +4195,18 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4194
4195
|
/* @__PURE__ */ o("div", { children: [
|
|
4195
4196
|
/* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Name" }),
|
|
4196
4197
|
/* @__PURE__ */ o("p", { className: "mt-1 text-base", children: [
|
|
4197
|
-
(
|
|
4198
|
+
(b = y == null ? void 0 : y.applicantRequestData) == null ? void 0 : b.firstName,
|
|
4198
4199
|
" ",
|
|
4199
|
-
(
|
|
4200
|
+
(E = y == null ? void 0 : y.applicantRequestData) == null ? void 0 : E.lastName
|
|
4200
4201
|
] })
|
|
4201
4202
|
] }),
|
|
4202
4203
|
/* @__PURE__ */ o("div", { children: [
|
|
4203
4204
|
/* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Email" }),
|
|
4204
|
-
/* @__PURE__ */ n("p", { className: "mt-1 text-base", children: (
|
|
4205
|
+
/* @__PURE__ */ n("p", { className: "mt-1 text-base", children: (U = y == null ? void 0 : y.applicantRequestData) == null ? void 0 : U.email })
|
|
4205
4206
|
] }),
|
|
4206
4207
|
/* @__PURE__ */ o("div", { children: [
|
|
4207
4208
|
/* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Date of Birth" }),
|
|
4208
|
-
/* @__PURE__ */ n("p", { className: "mt-1 text-base", children: ((
|
|
4209
|
+
/* @__PURE__ */ n("p", { className: "mt-1 text-base", children: ((re = y == null ? void 0 : y.applicantRequestData) == null ? void 0 : re.dateOfBirth) || "Not provided" })
|
|
4209
4210
|
] })
|
|
4210
4211
|
] }),
|
|
4211
4212
|
/* @__PURE__ */ o("div", { className: "space-y-4", children: [
|
|
@@ -4214,18 +4215,18 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4214
4215
|
/* @__PURE__ */ n(
|
|
4215
4216
|
J,
|
|
4216
4217
|
{
|
|
4217
|
-
control:
|
|
4218
|
+
control: j.control,
|
|
4218
4219
|
name: "country",
|
|
4219
|
-
render: ({ field:
|
|
4220
|
-
|
|
4220
|
+
render: ({ field: x }) => /* @__PURE__ */ n(
|
|
4221
|
+
fe,
|
|
4221
4222
|
{
|
|
4222
|
-
...
|
|
4223
|
+
...x,
|
|
4223
4224
|
label: "Country",
|
|
4224
4225
|
options: [
|
|
4225
4226
|
{ value: "", label: "Select country..." },
|
|
4226
|
-
...h.map((
|
|
4227
|
-
value:
|
|
4228
|
-
label:
|
|
4227
|
+
...h.map((P) => ({
|
|
4228
|
+
value: P.abbreviation3 || P.abbreviation,
|
|
4229
|
+
label: P.name
|
|
4229
4230
|
}))
|
|
4230
4231
|
]
|
|
4231
4232
|
}
|
|
@@ -4235,18 +4236,18 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4235
4236
|
/* @__PURE__ */ n(
|
|
4236
4237
|
J,
|
|
4237
4238
|
{
|
|
4238
|
-
control:
|
|
4239
|
+
control: j.control,
|
|
4239
4240
|
name: "nationality",
|
|
4240
|
-
render: ({ field:
|
|
4241
|
-
|
|
4241
|
+
render: ({ field: x }) => /* @__PURE__ */ n(
|
|
4242
|
+
fe,
|
|
4242
4243
|
{
|
|
4243
|
-
...
|
|
4244
|
+
...x,
|
|
4244
4245
|
label: "Nationality",
|
|
4245
4246
|
options: [
|
|
4246
4247
|
{ value: "", label: "Select nationality..." },
|
|
4247
|
-
...h.map((
|
|
4248
|
-
value:
|
|
4249
|
-
label:
|
|
4248
|
+
...h.map((P) => ({
|
|
4249
|
+
value: P.abbreviation3 || P.abbreviation,
|
|
4250
|
+
label: P.name
|
|
4250
4251
|
}))
|
|
4251
4252
|
]
|
|
4252
4253
|
}
|
|
@@ -4258,17 +4259,17 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4258
4259
|
/* @__PURE__ */ n(
|
|
4259
4260
|
J,
|
|
4260
4261
|
{
|
|
4261
|
-
control:
|
|
4262
|
+
control: j.control,
|
|
4262
4263
|
name: "street",
|
|
4263
|
-
render: ({ field:
|
|
4264
|
+
render: ({ field: x }) => /* @__PURE__ */ n(X, { ...x, label: "Street" })
|
|
4264
4265
|
}
|
|
4265
4266
|
),
|
|
4266
4267
|
/* @__PURE__ */ n(
|
|
4267
4268
|
J,
|
|
4268
4269
|
{
|
|
4269
|
-
control:
|
|
4270
|
+
control: j.control,
|
|
4270
4271
|
name: "streetNumber",
|
|
4271
|
-
render: ({ field:
|
|
4272
|
+
render: ({ field: x }) => /* @__PURE__ */ n(X, { ...x, label: "Street Number" })
|
|
4272
4273
|
}
|
|
4273
4274
|
)
|
|
4274
4275
|
] }),
|
|
@@ -4276,36 +4277,36 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4276
4277
|
/* @__PURE__ */ n(
|
|
4277
4278
|
J,
|
|
4278
4279
|
{
|
|
4279
|
-
control:
|
|
4280
|
+
control: j.control,
|
|
4280
4281
|
name: "city",
|
|
4281
|
-
render: ({ field:
|
|
4282
|
+
render: ({ field: x }) => /* @__PURE__ */ n(X, { ...x, label: "City" })
|
|
4282
4283
|
}
|
|
4283
4284
|
),
|
|
4284
4285
|
/* @__PURE__ */ n(
|
|
4285
4286
|
J,
|
|
4286
4287
|
{
|
|
4287
|
-
control:
|
|
4288
|
+
control: j.control,
|
|
4288
4289
|
name: "zip",
|
|
4289
|
-
render: ({ field:
|
|
4290
|
+
render: ({ field: x }) => /* @__PURE__ */ n(X, { ...x, label: "ZIP/Postal Code" })
|
|
4290
4291
|
}
|
|
4291
4292
|
)
|
|
4292
4293
|
] }),
|
|
4293
4294
|
/* @__PURE__ */ n(
|
|
4294
4295
|
J,
|
|
4295
4296
|
{
|
|
4296
|
-
control:
|
|
4297
|
+
control: j.control,
|
|
4297
4298
|
name: "phonenumber",
|
|
4298
|
-
render: ({ field:
|
|
4299
|
+
render: ({ field: x }) => /* @__PURE__ */ n(X, { ...x, label: "Phone Number", type: "tel" })
|
|
4299
4300
|
}
|
|
4300
4301
|
)
|
|
4301
4302
|
] })
|
|
4302
4303
|
] }),
|
|
4303
|
-
/* @__PURE__ */ o(
|
|
4304
|
+
/* @__PURE__ */ o(ae, { className: "flex justify-between", children: [
|
|
4304
4305
|
r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
4305
4306
|
/* @__PURE__ */ n(_, { type: "submit", isLoading: u, children: "Confirm and Start Verification" })
|
|
4306
4307
|
] })
|
|
4307
4308
|
] }) });
|
|
4308
|
-
},
|
|
4309
|
+
}, _e = ({
|
|
4309
4310
|
kycStatus: t,
|
|
4310
4311
|
reviewStatus: e,
|
|
4311
4312
|
workflowResult: r,
|
|
@@ -4313,42 +4314,42 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4313
4314
|
onContinue: a,
|
|
4314
4315
|
onContactSupport: i
|
|
4315
4316
|
}) => {
|
|
4316
|
-
const c = t ===
|
|
4317
|
+
const c = t === ge.Approved ? {
|
|
4317
4318
|
type: "success",
|
|
4318
4319
|
title: "Verification Approved",
|
|
4319
4320
|
icon: "✓",
|
|
4320
4321
|
iconBg: "bg-green-100 dark:bg-green-900/30",
|
|
4321
4322
|
iconColor: "text-green-600 dark:text-green-400",
|
|
4322
4323
|
message: "Your identity verification has been successfully approved."
|
|
4323
|
-
} : t ===
|
|
4324
|
+
} : t === ge.Rejected ? {
|
|
4324
4325
|
type: "error",
|
|
4325
4326
|
title: "Verification Rejected",
|
|
4326
4327
|
icon: "✕",
|
|
4327
4328
|
iconBg: "bg-red-100 dark:bg-red-900/30",
|
|
4328
4329
|
iconColor: "text-red-600 dark:text-red-400",
|
|
4329
4330
|
message: "Unfortunately, your identity verification was not approved."
|
|
4330
|
-
} : t ===
|
|
4331
|
+
} : t === ge.Pending || t === ge.InProgress ? {
|
|
4331
4332
|
type: "pending",
|
|
4332
4333
|
title: "Verification Pending",
|
|
4333
4334
|
icon: "⏱",
|
|
4334
4335
|
iconBg: "bg-blue-100 dark:bg-blue-900/30",
|
|
4335
4336
|
iconColor: "text-blue-600 dark:text-blue-400",
|
|
4336
4337
|
message: "Your identity verification is currently being processed."
|
|
4337
|
-
} : e ===
|
|
4338
|
+
} : e === ye.Approved ? {
|
|
4338
4339
|
type: "success",
|
|
4339
4340
|
title: "Application Approved",
|
|
4340
4341
|
icon: "✓",
|
|
4341
4342
|
iconBg: "bg-green-100 dark:bg-green-900/30",
|
|
4342
4343
|
iconColor: "text-green-600 dark:text-green-400",
|
|
4343
4344
|
message: "Your application has been approved."
|
|
4344
|
-
} : e ===
|
|
4345
|
+
} : e === ye.Reject ? {
|
|
4345
4346
|
type: "error",
|
|
4346
4347
|
title: "Application Rejected",
|
|
4347
4348
|
icon: "✕",
|
|
4348
4349
|
iconBg: "bg-red-100 dark:bg-red-900/30",
|
|
4349
4350
|
iconColor: "text-red-600 dark:text-red-400",
|
|
4350
4351
|
message: "Your application has been rejected."
|
|
4351
|
-
} : e ===
|
|
4352
|
+
} : e === ye.UnderReview || e === ye.AdminReview ? {
|
|
4352
4353
|
type: "pending",
|
|
4353
4354
|
title: "Under Review",
|
|
4354
4355
|
icon: "📋",
|
|
@@ -4395,10 +4396,10 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4395
4396
|
) }),
|
|
4396
4397
|
/* @__PURE__ */ n("h2", { className: "text-3xl font-bold text-center text-gray-900 dark:text-white mb-4", children: c.title }),
|
|
4397
4398
|
/* @__PURE__ */ n("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ n(
|
|
4398
|
-
|
|
4399
|
+
pe,
|
|
4399
4400
|
{
|
|
4400
4401
|
variant: c.type === "success" ? "success" : c.type === "error" ? "danger" : c.type === "pending" ? "warning" : "info",
|
|
4401
|
-
children: t != null ?
|
|
4402
|
+
children: t != null ? ge[t] : ye[e]
|
|
4402
4403
|
}
|
|
4403
4404
|
) }),
|
|
4404
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 }),
|
|
@@ -4430,15 +4431,15 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4430
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: [
|
|
4431
4432
|
/* @__PURE__ */ o("div", { children: [
|
|
4432
4433
|
/* @__PURE__ */ n("span", { className: "text-gray-500 dark:text-gray-400", children: "KYC Status:" }),
|
|
4433
|
-
/* @__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 ? ge[t] : "Not Available" })
|
|
4434
4435
|
] }),
|
|
4435
4436
|
/* @__PURE__ */ o("div", { children: [
|
|
4436
4437
|
/* @__PURE__ */ n("span", { className: "text-gray-500 dark:text-gray-400", children: "Review Status:" }),
|
|
4437
|
-
/* @__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: ye[e] })
|
|
4438
4439
|
] })
|
|
4439
4440
|
] }) })
|
|
4440
4441
|
] }),
|
|
4441
|
-
/* @__PURE__ */ o(
|
|
4442
|
+
/* @__PURE__ */ o(ae, { className: "flex justify-center gap-4", children: [
|
|
4442
4443
|
c.type === "success" && a && /* @__PURE__ */ n(_, { onClick: a, size: "lg", children: "Continue" }),
|
|
4443
4444
|
c.type === "error" && /* @__PURE__ */ o(nt, { children: [
|
|
4444
4445
|
i && /* @__PURE__ */ n(_, { variant: "outline", onClick: i, children: "Contact Support" }),
|
|
@@ -4467,7 +4468,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4467
4468
|
subtitle: e,
|
|
4468
4469
|
className: r = ""
|
|
4469
4470
|
}) => {
|
|
4470
|
-
const { currentTheme: s } =
|
|
4471
|
+
const { currentTheme: s } = ie(), a = t || (s == null ? void 0 : s.title) || "", i = !!(s != null && s.logo && s.logo.visible && s.logo.url), l = !!a;
|
|
4471
4472
|
return !i && !l ? null : /* @__PURE__ */ o("div", { className: `metakyc-header ${r}`, children: [
|
|
4472
4473
|
/* @__PURE__ */ o("div", { className: "metakyc-header-title flex items-center text-xl font-bold text-gray-900 dark:text-white", children: [
|
|
4473
4474
|
i && /* @__PURE__ */ n(Er, { config: s.logo }),
|
|
@@ -4489,21 +4490,29 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4489
4490
|
onSuccess: r,
|
|
4490
4491
|
onCancel: s
|
|
4491
4492
|
}) => {
|
|
4492
|
-
var
|
|
4493
|
-
const { config: a, baseInformationService: i } =
|
|
4494
|
-
if (!
|
|
4493
|
+
var j, F, R;
|
|
4494
|
+
const { config: a, baseInformationService: i, currentTheme: l } = ie(), { createApplicant: c, isLoading: d } = rr(), [u, g] = N([]), [v, p] = N(!0), [f, m] = N(!1), [y, k] = N(null), h = H(!1), I = H(!1), S = t || ((j = a.applicantForm) == null ? void 0 : j.workflowKey);
|
|
4495
|
+
if (!S)
|
|
4495
4496
|
throw new Error(
|
|
4496
4497
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
4497
4498
|
);
|
|
4498
|
-
const
|
|
4499
|
-
|
|
4499
|
+
const w = e || ((F = a.applicantForm) == null ? void 0 : F.externalRefId) || "", B = ["firstName", "lastName", "email", "phonenumber", "externalRefId"], L = se.useMemo(() => {
|
|
4500
|
+
var U;
|
|
4501
|
+
let b;
|
|
4502
|
+
(U = a.applicantForm) != null && U.visibleFields ? b = a.applicantForm.visibleFields : l != null && l.applicantFormVisibleFields && l.applicantFormVisibleFields.length > 0 ? b = l.applicantFormVisibleFields : b = gt;
|
|
4503
|
+
const E = new Set(b);
|
|
4504
|
+
for (const re of B)
|
|
4505
|
+
E.add(re);
|
|
4506
|
+
return Array.from(E);
|
|
4507
|
+
}, [(R = a.applicantForm) == null ? void 0 : R.visibleFields, l == null ? void 0 : l.applicantFormVisibleFields]), [A, C] = N({
|
|
4508
|
+
workflowKey: S,
|
|
4500
4509
|
firstName: "",
|
|
4501
4510
|
lastName: "",
|
|
4502
4511
|
title: "",
|
|
4503
4512
|
email: "",
|
|
4504
4513
|
dateOfBirth: "",
|
|
4505
4514
|
phonenumber: "",
|
|
4506
|
-
externalRefId:
|
|
4515
|
+
externalRefId: w,
|
|
4507
4516
|
// Set from config or prop
|
|
4508
4517
|
mobileCountryCode: "",
|
|
4509
4518
|
street: "",
|
|
@@ -4522,78 +4531,78 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4522
4531
|
occupation: "",
|
|
4523
4532
|
taxNumber: ""
|
|
4524
4533
|
});
|
|
4525
|
-
|
|
4534
|
+
Y(() => {
|
|
4526
4535
|
(async () => {
|
|
4527
|
-
if (
|
|
4536
|
+
if (h.current || I.current) {
|
|
4528
4537
|
console.log("[CreateApplicant] Countries already loading or loaded, skipping...");
|
|
4529
4538
|
return;
|
|
4530
4539
|
}
|
|
4531
|
-
|
|
4540
|
+
h.current = !0, p(!0);
|
|
4532
4541
|
try {
|
|
4533
|
-
const
|
|
4534
|
-
value:
|
|
4535
|
-
label:
|
|
4536
|
-
})).filter((
|
|
4537
|
-
|
|
4538
|
-
} catch (
|
|
4539
|
-
console.error("Failed to load countries:",
|
|
4542
|
+
const E = await i.getCountries("", a.locale || "en"), U = /* @__PURE__ */ new Set(), re = E.map((x) => ({
|
|
4543
|
+
value: x.abbreviation3 || x.abbreviation,
|
|
4544
|
+
label: x.name
|
|
4545
|
+
})).filter((x) => !x.value || U.has(x.value) ? !1 : (U.add(x.value), !0));
|
|
4546
|
+
g(re), I.current = !0;
|
|
4547
|
+
} catch (E) {
|
|
4548
|
+
console.error("Failed to load countries:", E);
|
|
4540
4549
|
} finally {
|
|
4541
|
-
|
|
4550
|
+
p(!1), h.current = !1;
|
|
4542
4551
|
}
|
|
4543
4552
|
})();
|
|
4544
4553
|
}, []);
|
|
4545
|
-
const
|
|
4546
|
-
|
|
4547
|
-
},
|
|
4548
|
-
|
|
4554
|
+
const D = (b, E) => {
|
|
4555
|
+
C((U) => ({ ...U, [b]: E }));
|
|
4556
|
+
}, z = async (b) => {
|
|
4557
|
+
b.preventDefault(), m(!0), k(null);
|
|
4549
4558
|
try {
|
|
4550
|
-
if (!
|
|
4551
|
-
|
|
4559
|
+
if (!A.externalRefId || A.externalRefId.trim() === "") {
|
|
4560
|
+
k("External Reference ID is required and cannot be empty"), m(!1);
|
|
4552
4561
|
return;
|
|
4553
4562
|
}
|
|
4554
|
-
const
|
|
4555
|
-
workflowKey:
|
|
4556
|
-
externalRefId:
|
|
4563
|
+
const E = {
|
|
4564
|
+
workflowKey: A.workflowKey,
|
|
4565
|
+
externalRefId: A.externalRefId.trim()
|
|
4557
4566
|
// Always include, never empty
|
|
4558
4567
|
};
|
|
4559
|
-
|
|
4560
|
-
if (
|
|
4561
|
-
const
|
|
4562
|
-
|
|
4563
|
-
}), console.log("Creating applicant with data:",
|
|
4564
|
-
const
|
|
4565
|
-
|
|
4568
|
+
L.forEach((re) => {
|
|
4569
|
+
if (re === "externalRefId") return;
|
|
4570
|
+
const x = A[re];
|
|
4571
|
+
x != null && x !== "" && !(Array.isArray(x) && x.length === 0) && (E[re] = x);
|
|
4572
|
+
}), console.log("Creating applicant with data:", E);
|
|
4573
|
+
const U = await c(
|
|
4574
|
+
E
|
|
4566
4575
|
);
|
|
4567
|
-
console.log("Applicant created:",
|
|
4568
|
-
} catch (
|
|
4569
|
-
console.error("Error creating applicant:",
|
|
4576
|
+
console.log("Applicant created:", U), r(U.applicantId);
|
|
4577
|
+
} catch (E) {
|
|
4578
|
+
console.error("Error creating applicant:", E), k(E.message || "Failed to create applicant");
|
|
4570
4579
|
} finally {
|
|
4571
|
-
|
|
4580
|
+
m(!1);
|
|
4572
4581
|
}
|
|
4573
|
-
},
|
|
4574
|
-
var
|
|
4575
|
-
const
|
|
4576
|
-
switch (
|
|
4582
|
+
}, W = (b) => {
|
|
4583
|
+
var U, re;
|
|
4584
|
+
const E = yt[b];
|
|
4585
|
+
switch (E.type) {
|
|
4577
4586
|
case "select":
|
|
4578
|
-
return
|
|
4579
|
-
|
|
4587
|
+
return b === "country" || b === "nationality" || b === "taxCountry" || b === "countryOfBirth" ? /* @__PURE__ */ n(
|
|
4588
|
+
fe,
|
|
4580
4589
|
{
|
|
4581
|
-
label:
|
|
4582
|
-
value:
|
|
4583
|
-
onChange: (
|
|
4590
|
+
label: E.label,
|
|
4591
|
+
value: A[b] || "",
|
|
4592
|
+
onChange: (x) => D(b, x.target.value),
|
|
4584
4593
|
options: [
|
|
4585
|
-
{ value: "", label: `Select ${
|
|
4586
|
-
...
|
|
4594
|
+
{ value: "", label: `Select ${E.label.toLowerCase()}...` },
|
|
4595
|
+
...u
|
|
4587
4596
|
],
|
|
4588
|
-
disabled:
|
|
4597
|
+
disabled: v
|
|
4589
4598
|
},
|
|
4590
|
-
|
|
4591
|
-
) :
|
|
4592
|
-
|
|
4599
|
+
b
|
|
4600
|
+
) : b === "salutation" ? /* @__PURE__ */ n(
|
|
4601
|
+
fe,
|
|
4593
4602
|
{
|
|
4594
|
-
label:
|
|
4595
|
-
value: ((
|
|
4596
|
-
onChange: (
|
|
4603
|
+
label: E.label,
|
|
4604
|
+
value: ((U = A[b]) == null ? void 0 : U.toString()) || "",
|
|
4605
|
+
onChange: (x) => D(b, x.target.value ? Number(x.target.value) : null),
|
|
4597
4606
|
options: [
|
|
4598
4607
|
{ value: "", label: "Select salutation..." },
|
|
4599
4608
|
{ value: Se.Male.toString(), label: "Male" },
|
|
@@ -4601,57 +4610,57 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4601
4610
|
{ value: Se.Other.toString(), label: "Other" }
|
|
4602
4611
|
]
|
|
4603
4612
|
},
|
|
4604
|
-
|
|
4613
|
+
b
|
|
4605
4614
|
) : null;
|
|
4606
4615
|
case "multiselect":
|
|
4607
|
-
return
|
|
4616
|
+
return b === "otherNationality" ? /* @__PURE__ */ n(
|
|
4608
4617
|
X,
|
|
4609
4618
|
{
|
|
4610
4619
|
type: "text",
|
|
4611
|
-
label:
|
|
4612
|
-
value: ((
|
|
4613
|
-
onChange: (
|
|
4614
|
-
const
|
|
4615
|
-
|
|
4620
|
+
label: E.label,
|
|
4621
|
+
value: ((re = A[b]) == null ? void 0 : re.join(", ")) || "",
|
|
4622
|
+
onChange: (x) => {
|
|
4623
|
+
const P = x.target.value.split(",").map((Q) => Q.trim()).filter(Boolean);
|
|
4624
|
+
D(b, P);
|
|
4616
4625
|
},
|
|
4617
4626
|
placeholder: "Enter countries separated by commas"
|
|
4618
4627
|
},
|
|
4619
|
-
|
|
4628
|
+
b
|
|
4620
4629
|
) : null;
|
|
4621
4630
|
case "date":
|
|
4622
4631
|
return /* @__PURE__ */ n(
|
|
4623
4632
|
X,
|
|
4624
4633
|
{
|
|
4625
4634
|
type: "date",
|
|
4626
|
-
label:
|
|
4627
|
-
value:
|
|
4628
|
-
onChange: (
|
|
4635
|
+
label: E.label,
|
|
4636
|
+
value: A[b] || "",
|
|
4637
|
+
onChange: (x) => D(b, x.target.value)
|
|
4629
4638
|
},
|
|
4630
|
-
|
|
4639
|
+
b
|
|
4631
4640
|
);
|
|
4632
4641
|
case "email":
|
|
4633
4642
|
return /* @__PURE__ */ n(
|
|
4634
4643
|
X,
|
|
4635
4644
|
{
|
|
4636
4645
|
type: "email",
|
|
4637
|
-
label:
|
|
4638
|
-
value:
|
|
4639
|
-
onChange: (
|
|
4640
|
-
required:
|
|
4646
|
+
label: E.label,
|
|
4647
|
+
value: A[b] || "",
|
|
4648
|
+
onChange: (x) => D(b, x.target.value),
|
|
4649
|
+
required: b === "email"
|
|
4641
4650
|
},
|
|
4642
|
-
|
|
4651
|
+
b
|
|
4643
4652
|
);
|
|
4644
4653
|
case "tel":
|
|
4645
4654
|
return /* @__PURE__ */ n(
|
|
4646
4655
|
X,
|
|
4647
4656
|
{
|
|
4648
4657
|
type: "tel",
|
|
4649
|
-
label:
|
|
4650
|
-
value:
|
|
4651
|
-
onChange: (
|
|
4652
|
-
required:
|
|
4658
|
+
label: E.label,
|
|
4659
|
+
value: A[b] || "",
|
|
4660
|
+
onChange: (x) => D(b, x.target.value),
|
|
4661
|
+
required: b === "phonenumber"
|
|
4653
4662
|
},
|
|
4654
|
-
|
|
4663
|
+
b
|
|
4655
4664
|
);
|
|
4656
4665
|
case "text":
|
|
4657
4666
|
default:
|
|
@@ -4659,19 +4668,19 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4659
4668
|
X,
|
|
4660
4669
|
{
|
|
4661
4670
|
type: "text",
|
|
4662
|
-
label:
|
|
4663
|
-
value:
|
|
4664
|
-
onChange: (
|
|
4665
|
-
required:
|
|
4671
|
+
label: E.label,
|
|
4672
|
+
value: A[b] || "",
|
|
4673
|
+
onChange: (x) => D(b, x.target.value),
|
|
4674
|
+
required: b === "firstName" || b === "lastName" || b === "externalRefId"
|
|
4666
4675
|
},
|
|
4667
|
-
|
|
4676
|
+
b
|
|
4668
4677
|
);
|
|
4669
4678
|
}
|
|
4670
4679
|
};
|
|
4671
|
-
return
|
|
4672
|
-
/* @__PURE__ */ n(
|
|
4680
|
+
return v ? /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
|
|
4681
|
+
/* @__PURE__ */ n(de, { className: "my-8" }),
|
|
4673
4682
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading form..." })
|
|
4674
|
-
] }) }) }) : /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n("form", { onSubmit:
|
|
4683
|
+
] }) }) }) : /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n("form", { onSubmit: z, children: /* @__PURE__ */ o(T, { children: [
|
|
4675
4684
|
/* @__PURE__ */ n(ee, { children: /* @__PURE__ */ n(
|
|
4676
4685
|
Ze,
|
|
4677
4686
|
{
|
|
@@ -4680,16 +4689,16 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4680
4689
|
}
|
|
4681
4690
|
) }),
|
|
4682
4691
|
/* @__PURE__ */ o(M, { children: [
|
|
4683
|
-
|
|
4692
|
+
y && /* @__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: [
|
|
4684
4693
|
/* @__PURE__ */ n("strong", { children: "Error:" }),
|
|
4685
4694
|
" ",
|
|
4686
|
-
|
|
4695
|
+
y
|
|
4687
4696
|
] }) }),
|
|
4688
|
-
/* @__PURE__ */ n("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children:
|
|
4697
|
+
/* @__PURE__ */ n("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: L.map((b) => W(b)) })
|
|
4689
4698
|
] }),
|
|
4690
|
-
/* @__PURE__ */ o(
|
|
4691
|
-
s && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: s, disabled:
|
|
4692
|
-
/* @__PURE__ */ n(_, { type: "submit", isLoading:
|
|
4699
|
+
/* @__PURE__ */ o(ae, { className: "flex justify-between", children: [
|
|
4700
|
+
s && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: s, disabled: f || d, children: "Cancel" }),
|
|
4701
|
+
/* @__PURE__ */ n(_, { type: "submit", isLoading: f || d, children: "Create Applicant" })
|
|
4693
4702
|
] })
|
|
4694
4703
|
] }) }) });
|
|
4695
4704
|
}, Wr = ({
|
|
@@ -4705,31 +4714,31 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4705
4714
|
steps: c,
|
|
4706
4715
|
workflowKey: d,
|
|
4707
4716
|
nextWorkflowKey: u,
|
|
4708
|
-
hasWorkflowChanged:
|
|
4717
|
+
hasWorkflowChanged: g,
|
|
4709
4718
|
isLoading: v,
|
|
4710
|
-
error:
|
|
4711
|
-
moveBack:
|
|
4719
|
+
error: p,
|
|
4720
|
+
moveBack: f,
|
|
4712
4721
|
refreshProgress: m
|
|
4713
|
-
} = Gt(t), [
|
|
4714
|
-
if (
|
|
4715
|
-
|
|
4716
|
-
}, [
|
|
4722
|
+
} = Gt(t), [y, k] = se.useState(!1);
|
|
4723
|
+
if (se.useEffect(() => {
|
|
4724
|
+
p && r && r(p);
|
|
4725
|
+
}, [p, r]), se.useEffect(() => {
|
|
4717
4726
|
i != null && i.workflowResult && e && e(i.workflowResult);
|
|
4718
|
-
}, [i == null ? void 0 : i.workflowResult, e]),
|
|
4727
|
+
}, [i == null ? void 0 : i.workflowResult, e]), se.useEffect(() => {
|
|
4719
4728
|
s === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
|
|
4720
|
-
}, [s]),
|
|
4721
|
-
|
|
4722
|
-
}, [
|
|
4729
|
+
}, [s]), se.useEffect(() => {
|
|
4730
|
+
g && k(!1);
|
|
4731
|
+
}, [g]), v || !i)
|
|
4723
4732
|
return /* @__PURE__ */ n("div", { className: a, children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
|
|
4724
|
-
/* @__PURE__ */ n(
|
|
4733
|
+
/* @__PURE__ */ n(de, { className: "my-8" }),
|
|
4725
4734
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading workflow..." })
|
|
4726
4735
|
] }) }) });
|
|
4727
|
-
if (
|
|
4736
|
+
if (p)
|
|
4728
4737
|
return /* @__PURE__ */ n("div", { className: a, children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
|
|
4729
4738
|
/* @__PURE__ */ n("p", { className: "text-danger-500 text-lg mb-4", children: "An error occurred" }),
|
|
4730
|
-
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children:
|
|
4739
|
+
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: p.message })
|
|
4731
4740
|
] }) }) }) });
|
|
4732
|
-
if (
|
|
4741
|
+
if (g && !y)
|
|
4733
4742
|
return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
|
|
4734
4743
|
/* @__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" }) }) }) }),
|
|
4735
4744
|
/* @__PURE__ */ n("h3", { className: "text-xl font-semibold text-gray-900 dark:text-white mb-2", children: "Workflow Transition" }),
|
|
@@ -4757,9 +4766,9 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4757
4766
|
}
|
|
4758
4767
|
)
|
|
4759
4768
|
] }) }) }) });
|
|
4760
|
-
if (i.status ===
|
|
4769
|
+
if (i.status === ce.Finished || i.status === ce.OnHold)
|
|
4761
4770
|
return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ n(
|
|
4762
|
-
|
|
4771
|
+
_e,
|
|
4763
4772
|
{
|
|
4764
4773
|
kycStatus: i.kycStatus,
|
|
4765
4774
|
reviewStatus: i.reviewStatus,
|
|
@@ -4773,70 +4782,70 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4773
4782
|
) });
|
|
4774
4783
|
if (!l)
|
|
4775
4784
|
return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
|
|
4776
|
-
/* @__PURE__ */ n(
|
|
4777
|
-
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: i.status ===
|
|
4785
|
+
/* @__PURE__ */ n(de, { className: "my-8" }),
|
|
4786
|
+
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: i.status === ce.IdentityPending ? "Loading identity verification..." : "Loading current step..." })
|
|
4778
4787
|
] }) }) });
|
|
4779
4788
|
const h = (w) => {
|
|
4780
4789
|
switch (w) {
|
|
4781
|
-
case
|
|
4790
|
+
case O.Overview:
|
|
4782
4791
|
return "Overview";
|
|
4783
|
-
case
|
|
4792
|
+
case O.Questionaries:
|
|
4784
4793
|
return "Questionnaire";
|
|
4785
|
-
case
|
|
4794
|
+
case O.UploadDocument:
|
|
4786
4795
|
return "Documents";
|
|
4787
|
-
case
|
|
4796
|
+
case O.IdentitySdk:
|
|
4788
4797
|
return "Identity";
|
|
4789
|
-
case
|
|
4798
|
+
case O.RiskScoring:
|
|
4790
4799
|
return "Risk Assessment";
|
|
4791
|
-
case
|
|
4800
|
+
case O.InvestorCategorization:
|
|
4792
4801
|
return "Investor Categorization";
|
|
4793
|
-
case
|
|
4802
|
+
case O.AppropriatenessTest:
|
|
4794
4803
|
return "Appropriateness Test";
|
|
4795
|
-
case
|
|
4804
|
+
case O.AdditionalData:
|
|
4796
4805
|
return "Additional Data";
|
|
4797
|
-
case
|
|
4806
|
+
case O.ManualReview:
|
|
4798
4807
|
return "Review";
|
|
4799
4808
|
default:
|
|
4800
4809
|
return "";
|
|
4801
4810
|
}
|
|
4802
|
-
},
|
|
4803
|
-
const w = c.filter((C) => C.visibility !== !1),
|
|
4811
|
+
}, I = () => {
|
|
4812
|
+
const w = c.filter((C) => C.visibility !== !1), B = w.findIndex((C) => C.order === l.order), L = B >= 0 ? B + 1 : 1, A = w.length;
|
|
4804
4813
|
return /* @__PURE__ */ o("div", { className: "mb-6", children: [
|
|
4805
4814
|
/* @__PURE__ */ o("div", { className: "flex items-start justify-between mb-4", children: [
|
|
4806
4815
|
/* @__PURE__ */ n(Ze, {}),
|
|
4807
|
-
/* @__PURE__ */ o(
|
|
4816
|
+
/* @__PURE__ */ o(pe, { variant: i.status === 1 ? "info" : "success", children: [
|
|
4808
4817
|
"Step ",
|
|
4809
|
-
|
|
4818
|
+
L,
|
|
4810
4819
|
" of ",
|
|
4811
|
-
|
|
4820
|
+
A
|
|
4812
4821
|
] })
|
|
4813
4822
|
] }),
|
|
4814
|
-
/* @__PURE__ */ n("div", { className: "flex items-center", children: w.map((C,
|
|
4815
|
-
const
|
|
4816
|
-
return /* @__PURE__ */ o(
|
|
4823
|
+
/* @__PURE__ */ n("div", { className: "flex items-center", children: w.map((C, D) => {
|
|
4824
|
+
const z = D < B, W = C.order === l.order;
|
|
4825
|
+
return /* @__PURE__ */ o(se.Fragment, { children: [
|
|
4817
4826
|
/* @__PURE__ */ o("div", { className: "flex items-center", children: [
|
|
4818
4827
|
/* @__PURE__ */ n(
|
|
4819
4828
|
"div",
|
|
4820
4829
|
{
|
|
4821
4830
|
className: `
|
|
4822
4831
|
w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium
|
|
4823
|
-
${
|
|
4832
|
+
${z || W ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
|
|
4824
4833
|
`,
|
|
4825
|
-
children:
|
|
4834
|
+
children: D + 1
|
|
4826
4835
|
}
|
|
4827
4836
|
),
|
|
4828
4837
|
/* @__PURE__ */ n(
|
|
4829
4838
|
"span",
|
|
4830
4839
|
{
|
|
4831
|
-
className: `ml-2 text-sm ${
|
|
4832
|
-
children: C.displayName || C.name || h(C.action) || `Step ${
|
|
4840
|
+
className: `ml-2 text-sm ${W ? "font-semibold text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`,
|
|
4841
|
+
children: C.displayName || C.name || h(C.action) || `Step ${D + 1}`
|
|
4833
4842
|
}
|
|
4834
4843
|
)
|
|
4835
4844
|
] }),
|
|
4836
|
-
|
|
4845
|
+
D < w.length - 1 && /* @__PURE__ */ n(
|
|
4837
4846
|
"div",
|
|
4838
4847
|
{
|
|
4839
|
-
className: `flex-1 h-0.5 mx-4 ${
|
|
4848
|
+
className: `flex-1 h-0.5 mx-4 ${z ? "bg-primary-500" : "bg-gray-200 dark:bg-gray-700"}`
|
|
4840
4849
|
}
|
|
4841
4850
|
)
|
|
4842
4851
|
] }, C.order);
|
|
@@ -4848,27 +4857,27 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4848
4857
|
onComplete: async () => {
|
|
4849
4858
|
await m();
|
|
4850
4859
|
},
|
|
4851
|
-
onBack: l.order > 0 ?
|
|
4860
|
+
onBack: l.order > 0 ? f : void 0
|
|
4852
4861
|
};
|
|
4853
4862
|
switch (l.action) {
|
|
4854
|
-
case
|
|
4863
|
+
case O.Questionaries:
|
|
4855
4864
|
return /* @__PURE__ */ n(xr, { ...w });
|
|
4856
|
-
case
|
|
4865
|
+
case O.UploadDocument:
|
|
4857
4866
|
return /* @__PURE__ */ n(wr, { ...w });
|
|
4858
|
-
case
|
|
4867
|
+
case O.Overview:
|
|
4859
4868
|
return /* @__PURE__ */ n(kr, { ...w });
|
|
4860
|
-
case
|
|
4869
|
+
case O.IdentitySdk:
|
|
4861
4870
|
return /* @__PURE__ */ n(Ar, { ...w });
|
|
4862
|
-
case
|
|
4871
|
+
case O.RiskScoring:
|
|
4863
4872
|
return /* @__PURE__ */ n(Nr, { ...w });
|
|
4864
|
-
case
|
|
4865
|
-
case
|
|
4873
|
+
case O.AdditionalData:
|
|
4874
|
+
case O.InvestorCategorization:
|
|
4866
4875
|
return /* @__PURE__ */ n(Sr, { ...w });
|
|
4867
|
-
case
|
|
4876
|
+
case O.AppropriatenessTest:
|
|
4868
4877
|
return /* @__PURE__ */ n(Cr, { ...w });
|
|
4869
|
-
case
|
|
4878
|
+
case O.ManualReview:
|
|
4870
4879
|
return /* @__PURE__ */ n(
|
|
4871
|
-
|
|
4880
|
+
_e,
|
|
4872
4881
|
{
|
|
4873
4882
|
kycStatus: i.kycStatus,
|
|
4874
4883
|
reviewStatus: i.reviewStatus,
|
|
@@ -4878,45 +4887,45 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4878
4887
|
);
|
|
4879
4888
|
default:
|
|
4880
4889
|
return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { className: "py-12 text-center", children: [
|
|
4881
|
-
/* @__PURE__ */ n("div", { className: "mb-4", children: /* @__PURE__ */ n(
|
|
4890
|
+
/* @__PURE__ */ n("div", { className: "mb-4", children: /* @__PURE__ */ n(de, {}) }),
|
|
4882
4891
|
/* @__PURE__ */ o("p", { className: "text-gray-600 dark:text-gray-400 mb-2", children: [
|
|
4883
4892
|
"Processing step: ",
|
|
4884
4893
|
l.title || l.name
|
|
4885
4894
|
] }),
|
|
4886
4895
|
/* @__PURE__ */ o("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: [
|
|
4887
4896
|
"Action type: ",
|
|
4888
|
-
|
|
4897
|
+
O[l.action]
|
|
4889
4898
|
] })
|
|
4890
4899
|
] }) });
|
|
4891
4900
|
}
|
|
4892
4901
|
};
|
|
4893
4902
|
return /* @__PURE__ */ o("div", { className: `metakyc-sdk ${a || ""}`, children: [
|
|
4894
|
-
|
|
4903
|
+
I(),
|
|
4895
4904
|
S()
|
|
4896
4905
|
] });
|
|
4897
4906
|
};
|
|
4898
4907
|
export {
|
|
4899
4908
|
Tr as ALL_APPLICANT_FIELDS,
|
|
4900
4909
|
st as ApplicantProgressOnHoldReason,
|
|
4901
|
-
|
|
4910
|
+
ce as ApplicantProgressStatus,
|
|
4902
4911
|
xt as ApplicantService,
|
|
4903
4912
|
it as ApplicantStatus,
|
|
4904
4913
|
ut as AppropriatenessQuestionType,
|
|
4905
4914
|
Nt as AppropriatenessTestService,
|
|
4906
4915
|
Cr as AppropriatenessTestStep,
|
|
4907
|
-
|
|
4916
|
+
pe as Badge,
|
|
4908
4917
|
Et as BaseInformationService,
|
|
4909
4918
|
_ as Button,
|
|
4910
4919
|
T as Card,
|
|
4911
4920
|
M as CardContent,
|
|
4912
|
-
|
|
4921
|
+
ae as CardFooter,
|
|
4913
4922
|
ee as CardHeader,
|
|
4914
4923
|
Yr as CreateApplicantForm,
|
|
4915
4924
|
ht as CriteriaBuiltInType,
|
|
4916
4925
|
gt as DEFAULT_VISIBLE_FIELDS,
|
|
4917
4926
|
dt as DocumentReviewStatus,
|
|
4918
4927
|
bt as EndpointBuilder,
|
|
4919
|
-
|
|
4928
|
+
xe as ErrorHandler,
|
|
4920
4929
|
Bt as EventEmitter,
|
|
4921
4930
|
yt as FIELD_METADATA,
|
|
4922
4931
|
ct as FileType,
|
|
@@ -4924,41 +4933,41 @@ export {
|
|
|
4924
4933
|
Se as GenderType,
|
|
4925
4934
|
Ze as Header,
|
|
4926
4935
|
vt as HttpClient,
|
|
4927
|
-
|
|
4936
|
+
be as IdentityProviderManager,
|
|
4928
4937
|
At as IdentityService,
|
|
4929
|
-
|
|
4938
|
+
le as IdentityVerificationProvider,
|
|
4930
4939
|
Ar as IdentityVerificationStep,
|
|
4931
4940
|
X as Input,
|
|
4932
4941
|
It as InvestorCategorizationService,
|
|
4933
4942
|
Sr as InvestorCategorizationStep,
|
|
4934
|
-
|
|
4943
|
+
ne as InvestorCategorizationType,
|
|
4935
4944
|
pt as InvestorCategoryType,
|
|
4936
4945
|
ot as KycProcessStatus,
|
|
4937
|
-
|
|
4938
|
-
|
|
4946
|
+
ge as KycStatus,
|
|
4947
|
+
_e as KycStatusDisplay,
|
|
4939
4948
|
Wr as KycWorkflow,
|
|
4940
4949
|
Er as Logo,
|
|
4941
4950
|
Ke as MetaKYCContext,
|
|
4942
|
-
|
|
4951
|
+
ue as MetaKYCError,
|
|
4943
4952
|
Or as MetaKYCProvider,
|
|
4944
|
-
|
|
4953
|
+
jt as OnfidoProvider,
|
|
4945
4954
|
St as OverviewService,
|
|
4946
4955
|
kr as OverviewStep,
|
|
4947
4956
|
sr as PhoneInput,
|
|
4948
4957
|
wt as QuestionnaireService,
|
|
4949
4958
|
xr as QuestionnaireStep,
|
|
4950
|
-
|
|
4959
|
+
ye as ReviewStatus,
|
|
4951
4960
|
mt as RiskCriteriaType,
|
|
4952
4961
|
at as RiskLevel,
|
|
4953
4962
|
Ct as RiskScoringService,
|
|
4954
4963
|
Nr as RiskScoringStep,
|
|
4955
4964
|
Ut as SardinAIProvider,
|
|
4956
|
-
|
|
4957
|
-
|
|
4965
|
+
fe as Select,
|
|
4966
|
+
de as Spinner,
|
|
4958
4967
|
zt as StepRouter,
|
|
4959
|
-
|
|
4968
|
+
_t as SumsubProvider,
|
|
4960
4969
|
Kt as ThemeManager,
|
|
4961
|
-
|
|
4970
|
+
G as ThemePreset,
|
|
4962
4971
|
Mt as ThemeService,
|
|
4963
4972
|
kt as UploadDocumentService,
|
|
4964
4973
|
wr as UploadDocumentStep,
|
|
@@ -4967,7 +4976,7 @@ export {
|
|
|
4967
4976
|
$t as WorkflowOrchestrator,
|
|
4968
4977
|
Ne as WorkflowResultType,
|
|
4969
4978
|
Ot as WorkflowState,
|
|
4970
|
-
|
|
4979
|
+
O as WorkflowStepAction,
|
|
4971
4980
|
Vr as appropriatenessTestSchema,
|
|
4972
4981
|
Ur as clearAllStorage,
|
|
4973
4982
|
Yt as clearApplicantId,
|
|
@@ -4983,10 +4992,10 @@ export {
|
|
|
4983
4992
|
yr as generateQuestionnaireSchema,
|
|
4984
4993
|
br as generateRiskScoringSchema,
|
|
4985
4994
|
qr as generateUploadDocumentSchema,
|
|
4986
|
-
|
|
4995
|
+
_r as getAcceptString,
|
|
4987
4996
|
Vt as getApplicantId,
|
|
4988
|
-
|
|
4989
|
-
|
|
4997
|
+
we as getThemePreset,
|
|
4998
|
+
jr as getWorkflowState,
|
|
4990
4999
|
Pt as healthcareTheme,
|
|
4991
5000
|
Mr as isScriptLoaded,
|
|
4992
5001
|
Ue as loadScript,
|
|
@@ -5000,7 +5009,7 @@ export {
|
|
|
5000
5009
|
Kr as useAppropriatenessTest,
|
|
5001
5010
|
er as useIdentityVerification,
|
|
5002
5011
|
Gt as useKycWorkflow,
|
|
5003
|
-
|
|
5012
|
+
ie as useMetaKYC,
|
|
5004
5013
|
Xt as useOverview,
|
|
5005
5014
|
Zt as useQuestionnaire,
|
|
5006
5015
|
tr as useRiskScoring,
|