@vpdev2/metakyc 1.0.65 → 1.0.67
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/KycWorkflow.d.ts.map +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +492 -485
- package/dist/index.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -316,13 +316,13 @@ class Ji {
|
|
|
316
316
|
const d = (async () => {
|
|
317
317
|
var u;
|
|
318
318
|
try {
|
|
319
|
-
const
|
|
319
|
+
const g = await this.axiosInstance.get(n, {
|
|
320
320
|
params: r
|
|
321
321
|
}), p = Math.round(performance.now() - c);
|
|
322
|
-
return H.response("GET", n,
|
|
323
|
-
} catch (
|
|
322
|
+
return H.response("GET", n, g.status, p, (u = g.data) == null ? void 0 : u.result), this.handleResponse(g);
|
|
323
|
+
} catch (g) {
|
|
324
324
|
const p = Math.round(performance.now() - c);
|
|
325
|
-
throw H.error("GET", n,
|
|
325
|
+
throw H.error("GET", n, g, p), Ct.handleAxiosError(g);
|
|
326
326
|
} finally {
|
|
327
327
|
setTimeout(() => this.inflightGets.delete(o), ti);
|
|
328
328
|
}
|
|
@@ -379,7 +379,7 @@ class Ji {
|
|
|
379
379
|
}
|
|
380
380
|
class pn {
|
|
381
381
|
static async createToken(t) {
|
|
382
|
-
const { baseUrl: a, apiKey: r, secretKey: n, tenantId: o, clientId: l, externalRefId: c, workflowKey: d, email: u, isCompany:
|
|
382
|
+
const { baseUrl: a, apiKey: r, secretKey: n, tenantId: o, clientId: l, externalRefId: c, workflowKey: d, email: u, isCompany: g, applicant: p } = t;
|
|
383
383
|
if (!o && !l)
|
|
384
384
|
throw new Error("Either tenantId or clientId must be provided.");
|
|
385
385
|
if (!c)
|
|
@@ -395,7 +395,7 @@ class pn {
|
|
|
395
395
|
workflowKey: d,
|
|
396
396
|
email: u
|
|
397
397
|
};
|
|
398
|
-
o != null && (C.tenantId = o), l && (C.clientId = l),
|
|
398
|
+
o != null && (C.tenantId = o), l && (C.clientId = l), g != null && (C.isCompany = g), p && (C.applicant = p);
|
|
399
399
|
const x = (await ki.post(
|
|
400
400
|
`${a.replace(/\/+$/, "")}/api/SdkSession/CreateToken`,
|
|
401
401
|
C,
|
|
@@ -6909,7 +6909,7 @@ function xi(e) {
|
|
|
6909
6909
|
};
|
|
6910
6910
|
}
|
|
6911
6911
|
const $r = /^t\(['"](.+?)['"]\)$/, ni = "$t:";
|
|
6912
|
-
function
|
|
6912
|
+
function oe(e, t) {
|
|
6913
6913
|
if (!e) return "";
|
|
6914
6914
|
const a = e.trim();
|
|
6915
6915
|
if (a.startsWith(ni))
|
|
@@ -6917,7 +6917,7 @@ function ne(e, t) {
|
|
|
6917
6917
|
const r = $r.exec(a);
|
|
6918
6918
|
return r ? t(r[1]) : e;
|
|
6919
6919
|
}
|
|
6920
|
-
const $t = "1.0.
|
|
6920
|
+
const $t = "1.0.67", wi = Ht(null), oi = `metakyc-translations-${$t}-`, Yr = ({
|
|
6921
6921
|
locale: e,
|
|
6922
6922
|
fetchTranslations: t,
|
|
6923
6923
|
children: a
|
|
@@ -6942,7 +6942,7 @@ const $t = "1.0.65", wi = Ht(null), oi = `metakyc-translations-${$t}-`, Yr = ({
|
|
|
6942
6942
|
return;
|
|
6943
6943
|
}
|
|
6944
6944
|
H.debug(`Remote translation overrides loaded for locale: ${r}`);
|
|
6945
|
-
const
|
|
6945
|
+
const g = Wt(r), p = ri(g, u);
|
|
6946
6946
|
l(p);
|
|
6947
6947
|
try {
|
|
6948
6948
|
localStorage.setItem(oi + r, JSON.stringify(u));
|
|
@@ -6984,7 +6984,7 @@ const li = "metakyc-theme-cache", yn = ({ config: e, children: t }) => {
|
|
|
6984
6984
|
_r();
|
|
6985
6985
|
const [a, r] = w(null), n = we.useRef(!1), o = we.useRef(!1), l = Ye(() => {
|
|
6986
6986
|
H.setLevel(e.debug ?? e.logLevel ?? "none"), H.info(`SDK v${$t} initializing — baseUrl=${e.baseUrl}`);
|
|
6987
|
-
const u = new Ji(e),
|
|
6987
|
+
const u = new Ji(e), g = new er(u), p = new tr(u), C = new ir(u), N = new rr(u), x = new ar(u), F = new nr(u), T = new or(u), $ = new sr(u), U = new lr(u), P = new fr(u), D = new yr(u), B = new Tr();
|
|
6988
6988
|
if (typeof document < "u")
|
|
6989
6989
|
if (e.theme)
|
|
6990
6990
|
B.applyTheme(e.theme);
|
|
@@ -6997,7 +6997,7 @@ const li = "metakyc-theme-cache", yn = ({ config: e, children: t }) => {
|
|
|
6997
6997
|
}
|
|
6998
6998
|
return {
|
|
6999
6999
|
httpClient: u,
|
|
7000
|
-
applicantService:
|
|
7000
|
+
applicantService: g,
|
|
7001
7001
|
questionnaireService: p,
|
|
7002
7002
|
uploadDocumentService: C,
|
|
7003
7003
|
appropriatenessTestService: N,
|
|
@@ -7037,10 +7037,10 @@ const li = "metakyc-theme-cache", yn = ({ config: e, children: t }) => {
|
|
|
7037
7037
|
return;
|
|
7038
7038
|
}
|
|
7039
7039
|
H.debug("Fetching theme from backend...");
|
|
7040
|
-
const
|
|
7041
|
-
l.themeManager.applyTheme(
|
|
7040
|
+
const g = await l.themeService.getThemeConfiguration(e.configVersion);
|
|
7041
|
+
l.themeManager.applyTheme(g), r(l.themeManager.getCurrentTheme()), o.current = !0;
|
|
7042
7042
|
try {
|
|
7043
|
-
localStorage.setItem(li, JSON.stringify(
|
|
7043
|
+
localStorage.setItem(li, JSON.stringify(g));
|
|
7044
7044
|
} catch {
|
|
7045
7045
|
}
|
|
7046
7046
|
H.info("Theme loaded and applied");
|
|
@@ -7166,40 +7166,40 @@ function Sn() {
|
|
|
7166
7166
|
Qr(), Zr();
|
|
7167
7167
|
}
|
|
7168
7168
|
function Jr(e) {
|
|
7169
|
-
const { createOrchestrator: t, config: a } = Ee(), [r, n] = w(null), [o, l] = w(!1), [c, d] = w(null), u = be(null),
|
|
7169
|
+
const { createOrchestrator: t, config: a } = Ee(), [r, n] = w(null), [o, l] = w(!1), [c, d] = w(null), u = be(null), g = e || a.applicantId || void 0;
|
|
7170
7170
|
Ne(() => {
|
|
7171
7171
|
u.current || (u.current = t());
|
|
7172
7172
|
}, [t]), Ne(() => {
|
|
7173
7173
|
var D;
|
|
7174
|
-
r &&
|
|
7175
|
-
applicantId:
|
|
7174
|
+
r && g && Xr({
|
|
7175
|
+
applicantId: g,
|
|
7176
7176
|
currentStepOrder: (D = r.currentStep) == null ? void 0 : D.order,
|
|
7177
7177
|
status: r.status,
|
|
7178
7178
|
lastUpdated: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7179
7179
|
workflowKey: r.workFlowKey,
|
|
7180
7180
|
nextWorkflowKey: r.nextWorkflowKey
|
|
7181
7181
|
});
|
|
7182
|
-
}, [r,
|
|
7183
|
-
const p = be(!1), C = be(
|
|
7184
|
-
if (!(!
|
|
7182
|
+
}, [r, g]);
|
|
7183
|
+
const p = be(!1), C = be(void 0), N = ee(async () => {
|
|
7184
|
+
if (!(!g || !u.current)) {
|
|
7185
7185
|
if (p.current) {
|
|
7186
7186
|
H.debug("Workflow load already in progress, skipping");
|
|
7187
7187
|
return;
|
|
7188
7188
|
}
|
|
7189
7189
|
p.current = !0, l(!0), d(null);
|
|
7190
7190
|
try {
|
|
7191
|
-
const D = await u.current.initialize(
|
|
7192
|
-
n(D), C.current =
|
|
7191
|
+
const D = await u.current.initialize(g);
|
|
7192
|
+
n(D), C.current = g;
|
|
7193
7193
|
} catch (D) {
|
|
7194
7194
|
d(D);
|
|
7195
7195
|
} finally {
|
|
7196
7196
|
l(!1), p.current = !1;
|
|
7197
7197
|
}
|
|
7198
7198
|
}
|
|
7199
|
-
}, [
|
|
7199
|
+
}, [g]);
|
|
7200
7200
|
Ne(() => {
|
|
7201
|
-
|
|
7202
|
-
}, [
|
|
7201
|
+
g && C.current !== g && N();
|
|
7202
|
+
}, [g, N]);
|
|
7203
7203
|
const x = ee(async () => {
|
|
7204
7204
|
if (u.current) {
|
|
7205
7205
|
if (p.current) {
|
|
@@ -7256,7 +7256,7 @@ function Jr(e) {
|
|
|
7256
7256
|
}, []), U = Zt.useMemo(() => r != null && r.stepInfoList ? [...r.stepInfoList].sort((D, B) => D.order - B.order) : [], [r == null ? void 0 : r.stepInfoList]), P = Zt.useMemo(() => r ? r.nextWorkflowKey && r.nextWorkflowKey !== r.workFlowKey : !1, [r]);
|
|
7257
7257
|
return {
|
|
7258
7258
|
progress: r,
|
|
7259
|
-
applicantId:
|
|
7259
|
+
applicantId: g,
|
|
7260
7260
|
currentStep: (r == null ? void 0 : r.currentStep) || null,
|
|
7261
7261
|
steps: U,
|
|
7262
7262
|
status: (r == null ? void 0 : r.status) || Xe.None,
|
|
@@ -7277,7 +7277,7 @@ function Jr(e) {
|
|
|
7277
7277
|
}
|
|
7278
7278
|
function ea(e) {
|
|
7279
7279
|
var B;
|
|
7280
|
-
const { applicantService: t, config: a } = Ee(), [r, n] = w(null), [o, l] = w(!0), [c, d] = w(null), [u,
|
|
7280
|
+
const { applicantService: t, config: a } = Ee(), [r, n] = w(null), [o, l] = w(!0), [c, d] = w(null), [u, g] = w(), [p, C] = w(), N = be(!1), x = ee(async () => {
|
|
7281
7281
|
try {
|
|
7282
7282
|
l(!0), d(null);
|
|
7283
7283
|
const _ = await t.getSdkState();
|
|
@@ -7292,9 +7292,9 @@ function ea(e) {
|
|
|
7292
7292
|
N.current || x();
|
|
7293
7293
|
}, [x]);
|
|
7294
7294
|
const F = ee((_) => {
|
|
7295
|
-
H.info(`Transitioning to workflow → applicantId=${_}`),
|
|
7295
|
+
H.info(`Transitioning to workflow → applicantId=${_}`), g(_), C("workflow");
|
|
7296
7296
|
}, []), T = ee((_) => {
|
|
7297
|
-
H.info(`Switching applicant → newApplicantId=${_}`),
|
|
7297
|
+
H.info(`Switching applicant → newApplicantId=${_}`), g(_), C("workflow");
|
|
7298
7298
|
}, []), $ = p || (r == null ? void 0 : r.phase) || "loading", U = u || (r == null ? void 0 : r.applicantId), P = e ?? (r == null ? void 0 : r.isCompany) ?? !1, D = (r == null ? void 0 : r.workflowKey) || ((B = a.applicantForm) == null ? void 0 : B.workflowKey);
|
|
7299
7299
|
return {
|
|
7300
7300
|
phase: c ? "error" : o ? "loading" : $,
|
|
@@ -7309,7 +7309,7 @@ function ea(e) {
|
|
|
7309
7309
|
};
|
|
7310
7310
|
}
|
|
7311
7311
|
function ta(e) {
|
|
7312
|
-
const { questionnaireService: t, applicantService: a } = Ee(), [r, n] = w(null), [o, l] = w({}), [c, d] = w(!1), [u,
|
|
7312
|
+
const { questionnaireService: t, applicantService: a } = Ee(), [r, n] = w(null), [o, l] = w({}), [c, d] = w(!1), [u, g] = w(!1), [p, C] = w(null), N = be(!1), x = be(null), F = ee(async () => {
|
|
7313
7313
|
var $, U;
|
|
7314
7314
|
if (e) {
|
|
7315
7315
|
if (N.current) {
|
|
@@ -7346,13 +7346,13 @@ function ta(e) {
|
|
|
7346
7346
|
}, [e]);
|
|
7347
7347
|
const T = ee(
|
|
7348
7348
|
async ($) => {
|
|
7349
|
-
|
|
7349
|
+
g(!0), C(null);
|
|
7350
7350
|
try {
|
|
7351
7351
|
return await t.fillQuestionnaire($);
|
|
7352
7352
|
} catch (U) {
|
|
7353
7353
|
throw C(U), U;
|
|
7354
7354
|
} finally {
|
|
7355
|
-
|
|
7355
|
+
g(!1);
|
|
7356
7356
|
}
|
|
7357
7357
|
},
|
|
7358
7358
|
[t]
|
|
@@ -7368,7 +7368,7 @@ function ta(e) {
|
|
|
7368
7368
|
};
|
|
7369
7369
|
}
|
|
7370
7370
|
function ia(e) {
|
|
7371
|
-
const { uploadDocumentService: t } = Ee(), [a, r] = w(null), [n, o] = w(!1), [l, c] = w(!1), [d, u] = w(0), [
|
|
7371
|
+
const { uploadDocumentService: t } = Ee(), [a, r] = w(null), [n, o] = w(!1), [l, c] = w(!1), [d, u] = w(0), [g, p] = w(null), C = be(!1), N = be(null), x = ee(async () => {
|
|
7372
7372
|
if (e) {
|
|
7373
7373
|
if (C.current) {
|
|
7374
7374
|
H.debug("UploadDocument load already in progress, skipping");
|
|
@@ -7406,13 +7406,13 @@ function ia(e) {
|
|
|
7406
7406
|
isLoading: n,
|
|
7407
7407
|
isSubmitting: l,
|
|
7408
7408
|
uploadProgress: d,
|
|
7409
|
-
error:
|
|
7409
|
+
error: g,
|
|
7410
7410
|
load: x,
|
|
7411
7411
|
submit: F
|
|
7412
7412
|
};
|
|
7413
7413
|
}
|
|
7414
7414
|
function Cn(e) {
|
|
7415
|
-
const { appropriatenessTestService: t } = Ee(), [a, r] = w(null), [n, o] = w(!1), [l, c] = w(!1), [d, u] = w(null), [
|
|
7415
|
+
const { appropriatenessTestService: t } = Ee(), [a, r] = w(null), [n, o] = w(!1), [l, c] = w(!1), [d, u] = w(null), [g, p] = w(null), C = be(!1), N = be(null), x = ee(async () => {
|
|
7416
7416
|
if (e) {
|
|
7417
7417
|
if (C.current) {
|
|
7418
7418
|
H.debug("AppropriatenessTest load already in progress, skipping");
|
|
@@ -7448,7 +7448,7 @@ function Cn(e) {
|
|
|
7448
7448
|
);
|
|
7449
7449
|
return {
|
|
7450
7450
|
test: a,
|
|
7451
|
-
result:
|
|
7451
|
+
result: g,
|
|
7452
7452
|
isLoading: n,
|
|
7453
7453
|
isSubmitting: l,
|
|
7454
7454
|
error: d,
|
|
@@ -7457,20 +7457,20 @@ function Cn(e) {
|
|
|
7457
7457
|
};
|
|
7458
7458
|
}
|
|
7459
7459
|
function ra(e) {
|
|
7460
|
-
const { overviewService: t } = Ee(), [a, r] = w(null), [n, o] = w(!1), [l, c] = w(!1), [d, u] = w(null),
|
|
7460
|
+
const { overviewService: t } = Ee(), [a, r] = w(null), [n, o] = w(!1), [l, c] = w(!1), [d, u] = w(null), g = be(!1), p = be(null), C = ee(async () => {
|
|
7461
7461
|
if (e) {
|
|
7462
|
-
if (
|
|
7462
|
+
if (g.current) {
|
|
7463
7463
|
H.debug("Overview load already in progress, skipping");
|
|
7464
7464
|
return;
|
|
7465
7465
|
}
|
|
7466
|
-
|
|
7466
|
+
g.current = !0, o(!0), u(null);
|
|
7467
7467
|
try {
|
|
7468
7468
|
const x = await t.getOverviewData(e);
|
|
7469
7469
|
r(x), p.current = e;
|
|
7470
7470
|
} catch (x) {
|
|
7471
7471
|
u(x);
|
|
7472
7472
|
} finally {
|
|
7473
|
-
o(!1),
|
|
7473
|
+
o(!1), g.current = !1;
|
|
7474
7474
|
}
|
|
7475
7475
|
}
|
|
7476
7476
|
}, [e, t]);
|
|
@@ -7527,7 +7527,7 @@ function aa(e) {
|
|
|
7527
7527
|
}
|
|
7528
7528
|
},
|
|
7529
7529
|
[e, t]
|
|
7530
|
-
),
|
|
7530
|
+
), g = ee(
|
|
7531
7531
|
async (C, N) => {
|
|
7532
7532
|
if (e) {
|
|
7533
7533
|
o(!0), c(null);
|
|
@@ -7578,12 +7578,12 @@ function aa(e) {
|
|
|
7578
7578
|
isLoading: n,
|
|
7579
7579
|
error: l,
|
|
7580
7580
|
requestIdentity: u,
|
|
7581
|
-
requestCompanyIdentity:
|
|
7581
|
+
requestCompanyIdentity: g,
|
|
7582
7582
|
restartIdentity: p
|
|
7583
7583
|
};
|
|
7584
7584
|
}
|
|
7585
7585
|
function na(e) {
|
|
7586
|
-
const { riskScoringService: t, applicantService: a } = Ee(), [r, n] = w(null), [o, l] = w({}), [c, d] = w(!1), [u,
|
|
7586
|
+
const { riskScoringService: t, applicantService: a } = Ee(), [r, n] = w(null), [o, l] = w({}), [c, d] = w(!1), [u, g] = w(!1), [p, C] = w(null), [N, x] = w(null), F = be(!1), T = be(null), $ = ee(async () => {
|
|
7587
7587
|
var P;
|
|
7588
7588
|
if (e) {
|
|
7589
7589
|
if (F.current) {
|
|
@@ -7620,14 +7620,14 @@ function na(e) {
|
|
|
7620
7620
|
}, [e]);
|
|
7621
7621
|
const U = ee(
|
|
7622
7622
|
async (P) => {
|
|
7623
|
-
|
|
7623
|
+
g(!0), C(null);
|
|
7624
7624
|
try {
|
|
7625
7625
|
const D = await t.submitRiskScoring(P);
|
|
7626
7626
|
return x(D), D;
|
|
7627
7627
|
} catch (D) {
|
|
7628
7628
|
throw C(D), D;
|
|
7629
7629
|
} finally {
|
|
7630
|
-
|
|
7630
|
+
g(!1);
|
|
7631
7631
|
}
|
|
7632
7632
|
},
|
|
7633
7633
|
[t]
|
|
@@ -7669,7 +7669,7 @@ function Ci() {
|
|
|
7669
7669
|
}
|
|
7670
7670
|
},
|
|
7671
7671
|
[e, t]
|
|
7672
|
-
),
|
|
7672
|
+
), g = ee(
|
|
7673
7673
|
async (N) => {
|
|
7674
7674
|
r(!0), o(null);
|
|
7675
7675
|
try {
|
|
@@ -7710,7 +7710,7 @@ function Ci() {
|
|
|
7710
7710
|
isLoading: a,
|
|
7711
7711
|
error: n,
|
|
7712
7712
|
createApplicant: u,
|
|
7713
|
-
createCompanyApplicant:
|
|
7713
|
+
createCompanyApplicant: g,
|
|
7714
7714
|
getApplicantData: p,
|
|
7715
7715
|
stopProgress: C
|
|
7716
7716
|
};
|
|
@@ -7755,7 +7755,7 @@ const oa = {
|
|
|
7755
7755
|
sm: "px-3 py-1.5 text-sm",
|
|
7756
7756
|
md: "px-4 py-2 text-sm",
|
|
7757
7757
|
lg: "px-6 py-3 text-base"
|
|
7758
|
-
},
|
|
7758
|
+
}, g = {
|
|
7759
7759
|
sm: { padding: "0.375rem 0.75rem", fontSize: "0.875rem" },
|
|
7760
7760
|
md: { padding: "0.5rem 1rem", fontSize: "0.875rem" },
|
|
7761
7761
|
lg: { padding: "0.75rem 1.5rem", fontSize: "1rem" }
|
|
@@ -7775,7 +7775,7 @@ const oa = {
|
|
|
7775
7775
|
cursor: n || r ? "not-allowed" : "pointer",
|
|
7776
7776
|
opacity: n || r ? 0.5 : 1,
|
|
7777
7777
|
lineHeight: "1.25rem",
|
|
7778
|
-
...
|
|
7778
|
+
...g[a],
|
|
7779
7779
|
...oa[t],
|
|
7780
7780
|
...l
|
|
7781
7781
|
},
|
|
@@ -8095,7 +8095,7 @@ const me = ({ children: e, className: t, style: a, ...r }) => /* @__PURE__ */ i(
|
|
|
8095
8095
|
},
|
|
8096
8096
|
"__placeholder__"
|
|
8097
8097
|
),
|
|
8098
|
-
r.map((u,
|
|
8098
|
+
r.map((u, g) => /* @__PURE__ */ i(
|
|
8099
8099
|
"option",
|
|
8100
8100
|
{
|
|
8101
8101
|
value: u.value,
|
|
@@ -8106,7 +8106,7 @@ const me = ({ children: e, className: t, style: a, ...r }) => /* @__PURE__ */ i(
|
|
|
8106
8106
|
},
|
|
8107
8107
|
children: u.label
|
|
8108
8108
|
},
|
|
8109
|
-
u.value || `option-${
|
|
8109
|
+
u.value || `option-${g}`
|
|
8110
8110
|
))
|
|
8111
8111
|
]
|
|
8112
8112
|
}
|
|
@@ -8126,7 +8126,7 @@ const ci = 280, ca = ({
|
|
|
8126
8126
|
readOnly: l = !1,
|
|
8127
8127
|
required: c = !1
|
|
8128
8128
|
}) => {
|
|
8129
|
-
const { t: d } = je(), u = n ?? d("common.select"),
|
|
8129
|
+
const { t: d } = je(), u = n ?? d("common.select"), g = o || l, [p, C] = w(!1), [N, x] = w(""), [F, T] = w(null), [$, U] = w({
|
|
8130
8130
|
bg: "#ffffff",
|
|
8131
8131
|
borderColor: "#d1d5db",
|
|
8132
8132
|
textPrimary: "#111827",
|
|
@@ -8150,11 +8150,11 @@ const ci = 280, ca = ({
|
|
|
8150
8150
|
hoverBg: R("--metakyc-surface", O)
|
|
8151
8151
|
});
|
|
8152
8152
|
}, []), h = ee(() => {
|
|
8153
|
-
if (
|
|
8153
|
+
if (g) return;
|
|
8154
8154
|
ce();
|
|
8155
8155
|
const z = _();
|
|
8156
8156
|
z && T(z), C(!0);
|
|
8157
|
-
}, [
|
|
8157
|
+
}, [g, _, ce]), L = ee(() => {
|
|
8158
8158
|
C(!1), x("");
|
|
8159
8159
|
}, []);
|
|
8160
8160
|
Ne(() => {
|
|
@@ -8178,13 +8178,13 @@ const ci = 280, ca = ({
|
|
|
8178
8178
|
const M = r.filter(
|
|
8179
8179
|
(z) => z.label.toLowerCase().includes(N.toLowerCase())
|
|
8180
8180
|
), Z = (z) => {
|
|
8181
|
-
|
|
8182
|
-
},
|
|
8183
|
-
R.stopPropagation(),
|
|
8181
|
+
g || a(t.includes(z) ? t.filter((R) => R !== z) : [...t, z]);
|
|
8182
|
+
}, ae = (z, R) => {
|
|
8183
|
+
R.stopPropagation(), g || a(t.filter((O) => O !== z));
|
|
8184
8184
|
}, W = (z) => {
|
|
8185
8185
|
var R;
|
|
8186
8186
|
return ((R = r.find((O) => O.value === z)) == null ? void 0 : R.label) || z;
|
|
8187
|
-
}, { bg:
|
|
8187
|
+
}, { bg: re, borderColor: he, textPrimary: fe, textSecondary: De, primaryColor: se, primaryLight: G, hoverBg: Q } = $, te = p && F && /* @__PURE__ */ s(
|
|
8188
8188
|
"div",
|
|
8189
8189
|
{
|
|
8190
8190
|
ref: B,
|
|
@@ -8199,7 +8199,7 @@ const ci = 280, ca = ({
|
|
|
8199
8199
|
borderRadius: "8px",
|
|
8200
8200
|
boxShadow: "0 4px 16px rgba(0,0,0,0.18)",
|
|
8201
8201
|
border: `1px solid ${he}`,
|
|
8202
|
-
backgroundColor:
|
|
8202
|
+
backgroundColor: re,
|
|
8203
8203
|
overflow: "hidden"
|
|
8204
8204
|
},
|
|
8205
8205
|
children: [
|
|
@@ -8220,17 +8220,17 @@ const ci = 280, ca = ({
|
|
|
8220
8220
|
fontSize: "13px",
|
|
8221
8221
|
borderRadius: "6px",
|
|
8222
8222
|
border: `1px solid ${he}`,
|
|
8223
|
-
backgroundColor:
|
|
8223
|
+
backgroundColor: re,
|
|
8224
8224
|
color: fe,
|
|
8225
8225
|
outline: "none",
|
|
8226
8226
|
boxSizing: "border-box"
|
|
8227
8227
|
},
|
|
8228
8228
|
onFocus: (z) => {
|
|
8229
8229
|
const R = getComputedStyle(document.querySelector(".metakyc-sdk") || document.documentElement), O = R.getPropertyValue("--metakyc-input-border-focus").trim() || R.getPropertyValue("--metakyc-primary").trim() || "#2563eb";
|
|
8230
|
-
z.currentTarget.style.backgroundColor =
|
|
8230
|
+
z.currentTarget.style.backgroundColor = re, z.currentTarget.style.color = fe, z.currentTarget.style.borderColor = O, z.currentTarget.style.outline = "none", z.currentTarget.style.boxShadow = `0 0 0 2px ${O}33`;
|
|
8231
8231
|
},
|
|
8232
8232
|
onBlur: (z) => {
|
|
8233
|
-
z.currentTarget.style.backgroundColor =
|
|
8233
|
+
z.currentTarget.style.backgroundColor = re, z.currentTarget.style.color = fe, z.currentTarget.style.borderColor = he, z.currentTarget.style.outline = "none", z.currentTarget.style.boxShadow = "none";
|
|
8234
8234
|
}
|
|
8235
8235
|
}
|
|
8236
8236
|
) }),
|
|
@@ -8249,7 +8249,7 @@ const ci = 280, ca = ({
|
|
|
8249
8249
|
fontSize: "13px",
|
|
8250
8250
|
cursor: "pointer",
|
|
8251
8251
|
backgroundColor: R ? G : "transparent",
|
|
8252
|
-
color: R ?
|
|
8252
|
+
color: R ? se : fe,
|
|
8253
8253
|
userSelect: "none"
|
|
8254
8254
|
},
|
|
8255
8255
|
onMouseEnter: (O) => {
|
|
@@ -8312,7 +8312,7 @@ const ci = 280, ca = ({
|
|
|
8312
8312
|
className: He(
|
|
8313
8313
|
"metakyc-multiselect-trigger",
|
|
8314
8314
|
"w-full px-3 py-2 rounded-lg border text-sm transition-colors relative",
|
|
8315
|
-
|
|
8315
|
+
g ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
|
|
8316
8316
|
),
|
|
8317
8317
|
style: {
|
|
8318
8318
|
minHeight: "38px",
|
|
@@ -8339,11 +8339,11 @@ const ci = 280, ca = ({
|
|
|
8339
8339
|
},
|
|
8340
8340
|
children: [
|
|
8341
8341
|
W(z),
|
|
8342
|
-
!
|
|
8342
|
+
!g && /* @__PURE__ */ i(
|
|
8343
8343
|
"button",
|
|
8344
8344
|
{
|
|
8345
8345
|
type: "button",
|
|
8346
|
-
onClick: (R) =>
|
|
8346
|
+
onClick: (R) => ae(z, R),
|
|
8347
8347
|
className: "metakyc-multiselect-chip-remove",
|
|
8348
8348
|
style: {
|
|
8349
8349
|
background: "transparent",
|
|
@@ -8382,7 +8382,7 @@ const ci = 280, ca = ({
|
|
|
8382
8382
|
]
|
|
8383
8383
|
}
|
|
8384
8384
|
),
|
|
8385
|
-
typeof document < "u" &&
|
|
8385
|
+
typeof document < "u" && te ? Mt(te, document.body) : null
|
|
8386
8386
|
] });
|
|
8387
8387
|
}, di = 260, ct = ({
|
|
8388
8388
|
label: e,
|
|
@@ -8395,7 +8395,7 @@ const ci = 280, ca = ({
|
|
|
8395
8395
|
disabled: c = !1,
|
|
8396
8396
|
readOnly: d = !1,
|
|
8397
8397
|
required: u = !1,
|
|
8398
|
-
className:
|
|
8398
|
+
className: g
|
|
8399
8399
|
}) => {
|
|
8400
8400
|
var xe;
|
|
8401
8401
|
const { t: p } = je(), C = n ?? p("common.select"), N = c || d, [x, F] = w(!1), [T, $] = w(""), [U, P] = w(null), [D, B] = w({
|
|
@@ -8407,15 +8407,15 @@ const ci = 280, ca = ({
|
|
|
8407
8407
|
primaryLight: "#eff6ff",
|
|
8408
8408
|
hoverBg: "#f9fafb"
|
|
8409
8409
|
}), _ = ee(() => {
|
|
8410
|
-
const q = getComputedStyle(document.querySelector(".metakyc-sdk") || document.documentElement),
|
|
8410
|
+
const q = getComputedStyle(document.querySelector(".metakyc-sdk") || document.documentElement), ie = (Ce, qe) => q.getPropertyValue(Ce).trim() || qe, Te = ie("--metakyc-input-bg", ie("--metakyc-background", "#ffffff"));
|
|
8411
8411
|
B({
|
|
8412
8412
|
bg: Te,
|
|
8413
|
-
border:
|
|
8414
|
-
text:
|
|
8415
|
-
textSecondary:
|
|
8416
|
-
primary:
|
|
8417
|
-
primaryLight:
|
|
8418
|
-
hoverBg:
|
|
8413
|
+
border: ie("--metakyc-input-border", ie("--metakyc-border", "#d1d5db")),
|
|
8414
|
+
text: ie("--metakyc-input-text", ie("--metakyc-text-primary", "#111827")),
|
|
8415
|
+
textSecondary: ie("--metakyc-text-secondary", "#6b7280"),
|
|
8416
|
+
primary: ie("--metakyc-primary", "#2563eb"),
|
|
8417
|
+
primaryLight: ie("--metakyc-primary-light", "#eff6ff"),
|
|
8418
|
+
hoverBg: ie("--metakyc-surface", Te)
|
|
8419
8419
|
});
|
|
8420
8420
|
}, []), ce = be(null), h = be(null), L = be(null), M = be(null), Z = ee(() => {
|
|
8421
8421
|
if (!h.current) return null;
|
|
@@ -8426,27 +8426,27 @@ const ci = 280, ca = ({
|
|
|
8426
8426
|
width: q.width,
|
|
8427
8427
|
openUp: Te
|
|
8428
8428
|
};
|
|
8429
|
-
}, []),
|
|
8429
|
+
}, []), ae = ee(() => {
|
|
8430
8430
|
if (N) return;
|
|
8431
8431
|
_();
|
|
8432
8432
|
const q = Z();
|
|
8433
8433
|
q && P(q), F(!0);
|
|
8434
8434
|
}, [N, Z, _]), W = ee(() => {
|
|
8435
8435
|
F(!1), $("");
|
|
8436
|
-
}, []),
|
|
8436
|
+
}, []), re = () => x ? W() : ae();
|
|
8437
8437
|
Ne(() => {
|
|
8438
8438
|
if (!x) return;
|
|
8439
|
-
const q = (
|
|
8439
|
+
const q = (ie) => {
|
|
8440
8440
|
var Ce, qe;
|
|
8441
|
-
const Te =
|
|
8441
|
+
const Te = ie.target;
|
|
8442
8442
|
!((Ce = ce.current) != null && Ce.contains(Te)) && !((qe = L.current) != null && qe.contains(Te)) && W();
|
|
8443
8443
|
};
|
|
8444
8444
|
return document.addEventListener("mousedown", q), () => document.removeEventListener("mousedown", q);
|
|
8445
8445
|
}, [x, W]), Ne(() => {
|
|
8446
8446
|
if (!x) return;
|
|
8447
8447
|
const q = () => {
|
|
8448
|
-
const
|
|
8449
|
-
|
|
8448
|
+
const ie = Z();
|
|
8449
|
+
ie && P(ie);
|
|
8450
8450
|
};
|
|
8451
8451
|
return window.addEventListener("scroll", q, !0), window.addEventListener("resize", q), () => {
|
|
8452
8452
|
window.removeEventListener("scroll", q, !0), window.removeEventListener("resize", q);
|
|
@@ -8459,9 +8459,9 @@ const ci = 280, ca = ({
|
|
|
8459
8459
|
}, [x]);
|
|
8460
8460
|
const he = r.filter(
|
|
8461
8461
|
(q) => q.label.toLowerCase().includes(T.toLowerCase()) || q.value.toLowerCase().includes(T.toLowerCase())
|
|
8462
|
-
), fe = (xe = r.find((q) => q.value === o)) == null ? void 0 : xe.label, De = (q,
|
|
8463
|
-
N ||
|
|
8464
|
-
}, { bg:
|
|
8462
|
+
), fe = (xe = r.find((q) => q.value === o)) == null ? void 0 : xe.label, De = (q, ie) => {
|
|
8463
|
+
N || ie || (l(q), W());
|
|
8464
|
+
}, { bg: se, border: G, text: Q, textSecondary: te, primary: z, primaryLight: R, hoverBg: O } = D, Se = x && U && /* @__PURE__ */ s(
|
|
8465
8465
|
"div",
|
|
8466
8466
|
{
|
|
8467
8467
|
ref: L,
|
|
@@ -8476,7 +8476,7 @@ const ci = 280, ca = ({
|
|
|
8476
8476
|
borderRadius: "8px",
|
|
8477
8477
|
boxShadow: "0 4px 16px rgba(0,0,0,0.18)",
|
|
8478
8478
|
border: `1px solid ${G}`,
|
|
8479
|
-
backgroundColor:
|
|
8479
|
+
backgroundColor: se,
|
|
8480
8480
|
overflow: "hidden"
|
|
8481
8481
|
},
|
|
8482
8482
|
children: [
|
|
@@ -8497,17 +8497,17 @@ const ci = 280, ca = ({
|
|
|
8497
8497
|
fontSize: "13px",
|
|
8498
8498
|
borderRadius: "6px",
|
|
8499
8499
|
border: `1px solid ${G}`,
|
|
8500
|
-
backgroundColor:
|
|
8500
|
+
backgroundColor: se,
|
|
8501
8501
|
color: Q,
|
|
8502
8502
|
outline: "none",
|
|
8503
8503
|
boxSizing: "border-box"
|
|
8504
8504
|
},
|
|
8505
8505
|
onFocus: (q) => {
|
|
8506
|
-
const
|
|
8507
|
-
q.currentTarget.style.backgroundColor =
|
|
8506
|
+
const ie = getComputedStyle(document.querySelector(".metakyc-sdk") || document.documentElement), Te = ie.getPropertyValue("--metakyc-input-border-focus").trim() || ie.getPropertyValue("--metakyc-primary").trim() || "#2563eb";
|
|
8507
|
+
q.currentTarget.style.backgroundColor = se, q.currentTarget.style.color = Q, q.currentTarget.style.borderColor = Te, q.currentTarget.style.outline = "none", q.currentTarget.style.boxShadow = `0 0 0 2px ${Te}33`;
|
|
8508
8508
|
},
|
|
8509
8509
|
onBlur: (q) => {
|
|
8510
|
-
q.currentTarget.style.backgroundColor =
|
|
8510
|
+
q.currentTarget.style.backgroundColor = se, q.currentTarget.style.color = Q, q.currentTarget.style.borderColor = G, q.currentTarget.style.outline = "none", q.currentTarget.style.boxShadow = "none";
|
|
8511
8511
|
}
|
|
8512
8512
|
}
|
|
8513
8513
|
) }),
|
|
@@ -8521,8 +8521,8 @@ const ci = 280, ca = ({
|
|
|
8521
8521
|
maxHeight: "208px",
|
|
8522
8522
|
overflowY: "auto"
|
|
8523
8523
|
},
|
|
8524
|
-
children: he.length === 0 ? /* @__PURE__ */ i("li", { style: { padding: "8px 12px", fontSize: "13px", color:
|
|
8525
|
-
const
|
|
8524
|
+
children: he.length === 0 ? /* @__PURE__ */ i("li", { style: { padding: "8px 12px", fontSize: "13px", color: te }, children: p("common.noResults") }) : he.map((q) => {
|
|
8525
|
+
const ie = q.value === o;
|
|
8526
8526
|
return /* @__PURE__ */ i(
|
|
8527
8527
|
"li",
|
|
8528
8528
|
{
|
|
@@ -8533,15 +8533,15 @@ const ci = 280, ca = ({
|
|
|
8533
8533
|
fontSize: "13px",
|
|
8534
8534
|
cursor: q.disabled ? "not-allowed" : "pointer",
|
|
8535
8535
|
opacity: q.disabled ? 0.4 : 1,
|
|
8536
|
-
backgroundColor:
|
|
8537
|
-
color:
|
|
8536
|
+
backgroundColor: ie ? R : "transparent",
|
|
8537
|
+
color: ie ? z : Q,
|
|
8538
8538
|
userSelect: "none"
|
|
8539
8539
|
},
|
|
8540
8540
|
onMouseEnter: (Te) => {
|
|
8541
|
-
!
|
|
8541
|
+
!ie && !q.disabled && (Te.currentTarget.style.backgroundColor = O);
|
|
8542
8542
|
},
|
|
8543
8543
|
onMouseLeave: (Te) => {
|
|
8544
|
-
|
|
8544
|
+
ie || (Te.currentTarget.style.backgroundColor = "transparent");
|
|
8545
8545
|
},
|
|
8546
8546
|
children: q.label
|
|
8547
8547
|
},
|
|
@@ -8556,7 +8556,7 @@ const ci = 280, ca = ({
|
|
|
8556
8556
|
return /* @__PURE__ */ s(
|
|
8557
8557
|
"div",
|
|
8558
8558
|
{
|
|
8559
|
-
className: He("w-full metakyc-searchable-select",
|
|
8559
|
+
className: He("w-full metakyc-searchable-select", g),
|
|
8560
8560
|
ref: ce,
|
|
8561
8561
|
children: [
|
|
8562
8562
|
e && /* @__PURE__ */ s(
|
|
@@ -8576,9 +8576,9 @@ const ci = 280, ca = ({
|
|
|
8576
8576
|
ref: h,
|
|
8577
8577
|
role: "button",
|
|
8578
8578
|
tabIndex: N ? -1 : 0,
|
|
8579
|
-
onClick:
|
|
8579
|
+
onClick: re,
|
|
8580
8580
|
onKeyDown: (q) => {
|
|
8581
|
-
(q.key === "Enter" || q.key === " ") && (q.preventDefault(),
|
|
8581
|
+
(q.key === "Enter" || q.key === " ") && (q.preventDefault(), re()), q.key === "Escape" && W();
|
|
8582
8582
|
},
|
|
8583
8583
|
className: He(
|
|
8584
8584
|
"metakyc-searchable-select-trigger",
|
|
@@ -8632,7 +8632,7 @@ const ma = ({
|
|
|
8632
8632
|
value: d = [],
|
|
8633
8633
|
className: u
|
|
8634
8634
|
}) => {
|
|
8635
|
-
const { t:
|
|
8635
|
+
const { t: g } = je(), [p, C] = w(!1), [N, x] = w(null), F = be(null), T = ee((h) => {
|
|
8636
8636
|
if (!h) return;
|
|
8637
8637
|
x(null);
|
|
8638
8638
|
const L = Array.from(h);
|
|
@@ -8742,14 +8742,14 @@ const ma = ({
|
|
|
8742
8742
|
),
|
|
8743
8743
|
/* @__PURE__ */ s("div", { children: [
|
|
8744
8744
|
/* @__PURE__ */ s("p", { style: { fontSize: "14px", color: "var(--metakyc-text-secondary, #6b7280)", margin: 0 }, children: [
|
|
8745
|
-
/* @__PURE__ */ i("span", { style: { fontWeight: 600, color: "var(--metakyc-primary, #2563eb)" }, children:
|
|
8745
|
+
/* @__PURE__ */ i("span", { style: { fontWeight: 600, color: "var(--metakyc-primary, #2563eb)" }, children: g("uploadDocument.clickToUpload") }),
|
|
8746
8746
|
" ",
|
|
8747
|
-
|
|
8747
|
+
g("uploadDocument.orDragDrop")
|
|
8748
8748
|
] }),
|
|
8749
8749
|
(r || o) && /* @__PURE__ */ s("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "4px" }, children: [
|
|
8750
8750
|
r && /* @__PURE__ */ i("span", { children: r }),
|
|
8751
8751
|
r && o && /* @__PURE__ */ i("span", { children: " · " }),
|
|
8752
|
-
o && /* @__PURE__ */ i("span", { children:
|
|
8752
|
+
o && /* @__PURE__ */ i("span", { children: g("uploadDocument.maxSize", { size: Ot(o) }) })
|
|
8753
8753
|
] })
|
|
8754
8754
|
] })
|
|
8755
8755
|
] })
|
|
@@ -8757,7 +8757,7 @@ const ma = ({
|
|
|
8757
8757
|
}
|
|
8758
8758
|
),
|
|
8759
8759
|
ce && /* @__PURE__ */ i("div", { style: { marginTop: "12px", display: "flex", flexDirection: "column", gap: "8px" }, children: d.map((h, L) => {
|
|
8760
|
-
const M = da(h), Z = M === "image",
|
|
8760
|
+
const M = da(h), Z = M === "image", ae = Z ? URL.createObjectURL(h) : null;
|
|
8761
8761
|
return /* @__PURE__ */ s(
|
|
8762
8762
|
"div",
|
|
8763
8763
|
{
|
|
@@ -8787,10 +8787,10 @@ const ma = ({
|
|
|
8787
8787
|
overflow: "hidden",
|
|
8788
8788
|
backgroundColor: Z ? "transparent" : "color-mix(in srgb, var(--metakyc-primary, #2563eb) 10%, transparent)"
|
|
8789
8789
|
},
|
|
8790
|
-
children: Z &&
|
|
8790
|
+
children: Z && ae ? /* @__PURE__ */ i(
|
|
8791
8791
|
"img",
|
|
8792
8792
|
{
|
|
8793
|
-
src:
|
|
8793
|
+
src: ae,
|
|
8794
8794
|
alt: h.name,
|
|
8795
8795
|
style: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "8px" }
|
|
8796
8796
|
}
|
|
@@ -9000,7 +9000,7 @@ const ha = Rt(
|
|
|
9000
9000
|
...c
|
|
9001
9001
|
},
|
|
9002
9002
|
[
|
|
9003
|
-
...l.map(([u,
|
|
9003
|
+
...l.map(([u, g]) => Ut(u, g)),
|
|
9004
9004
|
...Array.isArray(o) ? o : [o]
|
|
9005
9005
|
]
|
|
9006
9006
|
)
|
|
@@ -9084,9 +9084,9 @@ const wa = ({
|
|
|
9084
9084
|
onComplete: t,
|
|
9085
9085
|
onBack: a
|
|
9086
9086
|
}) => {
|
|
9087
|
-
const { t: r } = je(), { questionnaire: n, initialAnswers: o, isLoading: l, isSubmitting: c, error: d, submit: u } = ta(e), [
|
|
9087
|
+
const { t: r } = je(), { questionnaire: n, initialAnswers: o, isLoading: l, isSubmitting: c, error: d, submit: u } = ta(e), [g, p] = w({}), [C, N] = w({}), [x, F] = w(0);
|
|
9088
9088
|
we.useEffect(() => {
|
|
9089
|
-
o && Object.keys(o).length > 0 && Object.keys(
|
|
9089
|
+
o && Object.keys(o).length > 0 && Object.keys(g).length === 0 && p(o);
|
|
9090
9090
|
}, [o]);
|
|
9091
9091
|
const T = Ye(
|
|
9092
9092
|
() => n ? xa(n.questionGroups) : [],
|
|
@@ -9099,11 +9099,11 @@ const wa = ({
|
|
|
9099
9099
|
}, []), D = ee(() => {
|
|
9100
9100
|
const h = {};
|
|
9101
9101
|
for (const { question: L } of U) {
|
|
9102
|
-
const M = ba(L,
|
|
9102
|
+
const M = ba(L, g[L.id] ?? []);
|
|
9103
9103
|
M && (h[L.id] = M);
|
|
9104
9104
|
}
|
|
9105
9105
|
return N((L) => ({ ...L, ...h })), Object.keys(h).length === 0;
|
|
9106
|
-
}, [U,
|
|
9106
|
+
}, [U, g]), B = () => {
|
|
9107
9107
|
D() && F((h) => h + 1);
|
|
9108
9108
|
}, _ = () => {
|
|
9109
9109
|
x > 0 ? F((h) => h - 1) : a == null || a();
|
|
@@ -9113,7 +9113,7 @@ const wa = ({
|
|
|
9113
9113
|
const h = n.questionGroups.flatMap(
|
|
9114
9114
|
(M) => (M.questions ?? []).map((Z) => ({
|
|
9115
9115
|
questionId: Z.id,
|
|
9116
|
-
values:
|
|
9116
|
+
values: g[Z.id] ?? []
|
|
9117
9117
|
}))
|
|
9118
9118
|
), L = {
|
|
9119
9119
|
applicantId: e,
|
|
@@ -9153,7 +9153,7 @@ const wa = ({
|
|
|
9153
9153
|
Sa,
|
|
9154
9154
|
{
|
|
9155
9155
|
question: h,
|
|
9156
|
-
value:
|
|
9156
|
+
value: g[h.id] ?? [],
|
|
9157
9157
|
error: C[h.id],
|
|
9158
9158
|
onChange: (L) => P(h.id, L)
|
|
9159
9159
|
},
|
|
@@ -9270,17 +9270,17 @@ const wa = ({
|
|
|
9270
9270
|
] }),
|
|
9271
9271
|
(l === "checkbox" || l === "multi-select") && /* @__PURE__ */ s("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
|
|
9272
9272
|
(e.defaultAnswers ?? []).map((d) => {
|
|
9273
|
-
const u = t.includes(d),
|
|
9273
|
+
const u = t.includes(d), g = () => {
|
|
9274
9274
|
r(u ? t.filter((p) => p !== d) : [...t, d]);
|
|
9275
9275
|
};
|
|
9276
9276
|
return /* @__PURE__ */ s(
|
|
9277
9277
|
"div",
|
|
9278
9278
|
{
|
|
9279
9279
|
className: "metakyc-option-label",
|
|
9280
|
-
onClick:
|
|
9280
|
+
onClick: g,
|
|
9281
9281
|
style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer", margin: 0, padding: 0, userSelect: "none" },
|
|
9282
9282
|
children: [
|
|
9283
|
-
/* @__PURE__ */ i(tt, { checked: u, onChange: () =>
|
|
9283
|
+
/* @__PURE__ */ i(tt, { checked: u, onChange: () => g() }),
|
|
9284
9284
|
/* @__PURE__ */ i("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: d })
|
|
9285
9285
|
]
|
|
9286
9286
|
},
|
|
@@ -9305,7 +9305,7 @@ const Na = ({
|
|
|
9305
9305
|
onComplete: t,
|
|
9306
9306
|
onBack: a
|
|
9307
9307
|
}) => {
|
|
9308
|
-
const { t: r } = je(), { uploadDocument: n, isLoading: o, isSubmitting: l, error: c, submit: d } = ia(e), [u,
|
|
9308
|
+
const { t: r } = je(), { uploadDocument: n, isLoading: o, isSubmitting: l, error: c, submit: d } = ia(e), [u, g] = w({}), [p, C] = w(null), [N, x] = w(0), [F, T] = w({}), $ = Ye(
|
|
9309
9309
|
() => n ? Ca(n.uploadDocumentFiles) : [],
|
|
9310
9310
|
[n]
|
|
9311
9311
|
), U = $[N] ?? [], P = N === $.length - 1, D = $.length, B = ee(() => {
|
|
@@ -9323,10 +9323,10 @@ const Na = ({
|
|
|
9323
9323
|
try {
|
|
9324
9324
|
const L = await Promise.all(
|
|
9325
9325
|
n.uploadDocumentFiles.map(async (Z) => {
|
|
9326
|
-
const
|
|
9327
|
-
|
|
9328
|
-
fileName:
|
|
9329
|
-
fileData: await Gr(
|
|
9326
|
+
const ae = u[Z.id] || [], W = await Promise.all(
|
|
9327
|
+
ae.map(async (re) => ({
|
|
9328
|
+
fileName: re.name,
|
|
9329
|
+
fileData: await Gr(re)
|
|
9330
9330
|
}))
|
|
9331
9331
|
);
|
|
9332
9332
|
return {
|
|
@@ -9455,9 +9455,9 @@ const Na = ({
|
|
|
9455
9455
|
value: u[L.id] || [],
|
|
9456
9456
|
onChange: (M) => {
|
|
9457
9457
|
C(null), T((Z) => {
|
|
9458
|
-
const
|
|
9459
|
-
return delete
|
|
9460
|
-
}),
|
|
9458
|
+
const ae = { ...Z };
|
|
9459
|
+
return delete ae[L.id], ae;
|
|
9460
|
+
}), g((Z) => ({ ...Z, [L.id]: M }));
|
|
9461
9461
|
}
|
|
9462
9462
|
},
|
|
9463
9463
|
L.id
|
|
@@ -9525,13 +9525,13 @@ const Na = ({
|
|
|
9525
9525
|
/* @__PURE__ */ i("h2", { className: "text-lg font-bold", children: n.title || r("overview.title") }),
|
|
9526
9526
|
n.description && /* @__PURE__ */ i("p", { className: "mt-1", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n.description })
|
|
9527
9527
|
] }),
|
|
9528
|
-
/* @__PURE__ */ i(ue, { className: "space-y-8", children: n.steps && n.steps.length > 0 ? n.steps.sort((
|
|
9528
|
+
/* @__PURE__ */ i(ue, { className: "space-y-8", children: n.steps && n.steps.length > 0 ? n.steps.sort((g, p) => g.order - p.order).map((g) => /* @__PURE__ */ s("div", { className: "metakyc-overview-step-item flex items-center space-x-3", children: [
|
|
9529
9529
|
/* @__PURE__ */ i("div", { className: "metakyc-step-icon flex-shrink-0", children: /* @__PURE__ */ i(
|
|
9530
9530
|
"div",
|
|
9531
9531
|
{
|
|
9532
9532
|
className: "w-8 h-8 rounded-full flex items-center justify-center font-medium text-sm",
|
|
9533
9533
|
style: { backgroundColor: "var(--metakyc-primary, #2563eb)", color: "#ffffff" },
|
|
9534
|
-
children:
|
|
9534
|
+
children: g.order + 1
|
|
9535
9535
|
}
|
|
9536
9536
|
) }),
|
|
9537
9537
|
/* @__PURE__ */ s(
|
|
@@ -9545,12 +9545,12 @@ const Na = ({
|
|
|
9545
9545
|
background: "transparent"
|
|
9546
9546
|
},
|
|
9547
9547
|
children: [
|
|
9548
|
-
/* @__PURE__ */ i("span", { className: "metakyc-step-title text-sm font-semibold", style: { color: "var(--metakyc-text-primary, #111827)" }, children:
|
|
9549
|
-
|
|
9548
|
+
/* @__PURE__ */ i("span", { className: "metakyc-step-title text-sm font-semibold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: g.title }),
|
|
9549
|
+
g.description && /* @__PURE__ */ i("p", { className: "metakyc-step-description text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: g.description })
|
|
9550
9550
|
]
|
|
9551
9551
|
}
|
|
9552
9552
|
)
|
|
9553
|
-
] },
|
|
9553
|
+
] }, g.order)) : /* @__PURE__ */ i("div", { className: "text-center py-8", children: /* @__PURE__ */ i("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: r("overview.loadingOverview") }) }) }),
|
|
9554
9554
|
/* @__PURE__ */ s(Oe, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
9555
9555
|
a && /* @__PURE__ */ i(le, { type: "button", variant: "outline", onClick: a, children: r("common.back") }),
|
|
9556
9556
|
/* @__PURE__ */ i(le, { onClick: u, isLoading: l, children: r("common.continue") })
|
|
@@ -9623,7 +9623,7 @@ const Da = ({
|
|
|
9623
9623
|
onComplete: t,
|
|
9624
9624
|
onBack: a
|
|
9625
9625
|
}) => {
|
|
9626
|
-
const { t: r } = je(), { config: n } = Ee(), o = n.locale ?? "en", { criteria: l, initialAnswers: c, isLoading: d, isSubmitting: u, error:
|
|
9626
|
+
const { t: r } = je(), { config: n } = Ee(), o = n.locale ?? "en", { criteria: l, initialAnswers: c, isLoading: d, isSubmitting: u, error: g, submit: p } = na(e), [C, N] = w({}), [x, F] = w({}), [T, $] = w(0), [U, P] = w(!1);
|
|
9627
9627
|
we.useEffect(() => {
|
|
9628
9628
|
c && Object.keys(c).length > 0 && Object.keys(C).length === 0 && N(c);
|
|
9629
9629
|
}, [c]);
|
|
@@ -9634,32 +9634,32 @@ const Da = ({
|
|
|
9634
9634
|
we.useEffect(() => {
|
|
9635
9635
|
!d && l && l.length === 0 && !U && !u && (P(!0), p({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
|
|
9636
9636
|
}, [d, l, U, u, p, e, t]);
|
|
9637
|
-
const ce = ee((
|
|
9638
|
-
N((
|
|
9639
|
-
const he = { ...
|
|
9640
|
-
return delete he[
|
|
9637
|
+
const ce = ee((ae, W) => {
|
|
9638
|
+
N((re) => ({ ...re, [ae]: W })), F((re) => {
|
|
9639
|
+
const he = { ...re };
|
|
9640
|
+
return delete he[ae], he;
|
|
9641
9641
|
});
|
|
9642
9642
|
}, []), h = ee(() => {
|
|
9643
|
-
const
|
|
9643
|
+
const ae = {};
|
|
9644
9644
|
for (const { criterion: W } of _) {
|
|
9645
|
-
const
|
|
9646
|
-
|
|
9645
|
+
const re = za(W, C[W.id] ?? []);
|
|
9646
|
+
re && (ae[W.id] = re);
|
|
9647
9647
|
}
|
|
9648
|
-
return F((W) => ({ ...W, ...
|
|
9648
|
+
return F((W) => ({ ...W, ...ae })), Object.keys(ae).length === 0;
|
|
9649
9649
|
}, [_, C]), L = () => {
|
|
9650
|
-
h() && $((
|
|
9650
|
+
h() && $((ae) => ae + 1);
|
|
9651
9651
|
}, M = () => {
|
|
9652
|
-
T > 0 ? $((
|
|
9652
|
+
T > 0 ? $((ae) => ae - 1) : a == null || a();
|
|
9653
9653
|
}, Z = async () => {
|
|
9654
9654
|
if (!(!h() || !l))
|
|
9655
9655
|
try {
|
|
9656
|
-
const
|
|
9657
|
-
const he = (C[
|
|
9658
|
-
return he.length > 0 ? { riskCriteriaId:
|
|
9659
|
-
}).filter((
|
|
9660
|
-
await p({ applicantId: e, criteriaValueInputs:
|
|
9661
|
-
} catch (
|
|
9662
|
-
console.error("Risk scoring submit error:",
|
|
9656
|
+
const ae = l.map((re) => {
|
|
9657
|
+
const he = (C[re.id] ?? []).filter((fe) => fe && fe.trim());
|
|
9658
|
+
return he.length > 0 ? { riskCriteriaId: re.id, values: he } : null;
|
|
9659
|
+
}).filter((re) => re !== null);
|
|
9660
|
+
await p({ applicantId: e, criteriaValueInputs: ae }), t == null || t();
|
|
9661
|
+
} catch (ae) {
|
|
9662
|
+
console.error("Risk scoring submit error:", ae);
|
|
9663
9663
|
}
|
|
9664
9664
|
};
|
|
9665
9665
|
return d ? /* @__PURE__ */ i(me, { children: /* @__PURE__ */ s(ue, { children: [
|
|
@@ -9668,17 +9668,17 @@ const Da = ({
|
|
|
9668
9668
|
] }) }) : !d && l && l.length === 0 ? /* @__PURE__ */ i(me, { children: /* @__PURE__ */ s(ue, { children: [
|
|
9669
9669
|
/* @__PURE__ */ i(Ge, { className: "my-8" }),
|
|
9670
9670
|
/* @__PURE__ */ i("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: r("riskScoring.noCriteria") })
|
|
9671
|
-
] }) }) :
|
|
9671
|
+
] }) }) : g ? /* @__PURE__ */ i(me, { children: /* @__PURE__ */ i(ue, { children: /* @__PURE__ */ s("p", { className: "text-danger-500", children: [
|
|
9672
9672
|
r("riskScoring.errorLoading"),
|
|
9673
9673
|
" ",
|
|
9674
|
-
|
|
9674
|
+
g.message
|
|
9675
9675
|
] }) }) }) : l ? /* @__PURE__ */ s(me, { children: [
|
|
9676
9676
|
/* @__PURE__ */ s(Fe, { children: [
|
|
9677
9677
|
/* @__PURE__ */ i("h2", { className: "text-lg font-bold", children: r("riskScoring.title") }),
|
|
9678
9678
|
/* @__PURE__ */ i("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: r("riskScoring.subtitle") }),
|
|
9679
9679
|
D.length > 1 && /* @__PURE__ */ s("div", { className: "flex items-center justify-between mt-3", children: [
|
|
9680
9680
|
/* @__PURE__ */ i("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: r("common.pageXofY", { current: T + 1, total: D.length }) }),
|
|
9681
|
-
/* @__PURE__ */ i("div", { className: "flex items-center gap-1.5", children: D.map((
|
|
9681
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-1.5", children: D.map((ae, W) => /* @__PURE__ */ i(
|
|
9682
9682
|
"div",
|
|
9683
9683
|
{
|
|
9684
9684
|
className: "rounded-full transition-all duration-200",
|
|
@@ -9692,16 +9692,16 @@ const Da = ({
|
|
|
9692
9692
|
)) })
|
|
9693
9693
|
] })
|
|
9694
9694
|
] }),
|
|
9695
|
-
/* @__PURE__ */ i(ue, { className: "space-y-6", children: _.map(({ criterion:
|
|
9695
|
+
/* @__PURE__ */ i(ue, { className: "space-y-6", children: _.map(({ criterion: ae }) => /* @__PURE__ */ i(
|
|
9696
9696
|
Pa,
|
|
9697
9697
|
{
|
|
9698
|
-
criterion:
|
|
9699
|
-
value: C[
|
|
9700
|
-
error: x[
|
|
9698
|
+
criterion: ae,
|
|
9699
|
+
value: C[ae.id] ?? [],
|
|
9700
|
+
error: x[ae.id],
|
|
9701
9701
|
locale: o,
|
|
9702
|
-
onChange: (W) => ce(
|
|
9702
|
+
onChange: (W) => ce(ae.id, W)
|
|
9703
9703
|
},
|
|
9704
|
-
|
|
9704
|
+
ae.id
|
|
9705
9705
|
)) }),
|
|
9706
9706
|
/* @__PURE__ */ s(Oe, { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
|
|
9707
9707
|
/* @__PURE__ */ s(
|
|
@@ -9730,13 +9730,13 @@ const Da = ({
|
|
|
9730
9730
|
}
|
|
9731
9731
|
)
|
|
9732
9732
|
] }),
|
|
9733
|
-
|
|
9733
|
+
g && /* @__PURE__ */ i("div", { className: "mx-6 mb-4 p-3 rounded", style: {
|
|
9734
9734
|
backgroundColor: "var(--metakyc-danger-bg, color-mix(in srgb, var(--metakyc-danger, #ef4444) 10%, transparent))",
|
|
9735
9735
|
border: "1px solid color-mix(in srgb, var(--metakyc-danger, #ef4444) 30%, transparent)"
|
|
9736
|
-
}, children: /* @__PURE__ */ i("p", { className: "text-sm", style: { color: "var(--metakyc-danger, #ef4444)" }, children:
|
|
9736
|
+
}, children: /* @__PURE__ */ i("p", { className: "text-sm", style: { color: "var(--metakyc-danger, #ef4444)" }, children: g.message }) })
|
|
9737
9737
|
] }) : null;
|
|
9738
9738
|
}, Pa = ({ criterion: e, value: t, error: a, locale: r, onChange: n }) => {
|
|
9739
|
-
const { t: o } = je(), l = Ea(e), c = e.valueDataType === lt.Integer || e.valueDataType === lt.Money || e.valueDataType === lt.DigitOnly, d = Ia(e), u = (
|
|
9739
|
+
const { t: o } = je(), l = Ea(e), c = e.valueDataType === lt.Integer || e.valueDataType === lt.Money || e.valueDataType === lt.DigitOnly, d = Ia(e), u = (g) => d ? Aa(g, r) : g;
|
|
9740
9740
|
return /* @__PURE__ */ s("div", { className: "space-y-2", children: [
|
|
9741
9741
|
/* @__PURE__ */ s("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: [
|
|
9742
9742
|
e.displayName,
|
|
@@ -9748,32 +9748,32 @@ const Da = ({
|
|
|
9748
9748
|
Le,
|
|
9749
9749
|
{
|
|
9750
9750
|
value: t[0] ?? "",
|
|
9751
|
-
onChange: (
|
|
9751
|
+
onChange: (g) => n([g.target.value]),
|
|
9752
9752
|
type: c ? "number" : "text",
|
|
9753
9753
|
placeholder: o("placeholders.enterAnswer"),
|
|
9754
9754
|
error: a,
|
|
9755
9755
|
required: e.isRequired,
|
|
9756
9756
|
min: e.min,
|
|
9757
9757
|
max: e.max,
|
|
9758
|
-
onKeyDown: (
|
|
9759
|
-
e.valueDataType === lt.DigitOnly && ["e", "E", "+", "-", "."].includes(
|
|
9758
|
+
onKeyDown: (g) => {
|
|
9759
|
+
e.valueDataType === lt.DigitOnly && ["e", "E", "+", "-", "."].includes(g.key) && g.preventDefault();
|
|
9760
9760
|
}
|
|
9761
9761
|
}
|
|
9762
9762
|
),
|
|
9763
9763
|
l === "radio" && /* @__PURE__ */ s("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
|
|
9764
|
-
(e.defaultValues ?? []).map((
|
|
9764
|
+
(e.defaultValues ?? []).map((g) => /* @__PURE__ */ s(
|
|
9765
9765
|
"div",
|
|
9766
9766
|
{
|
|
9767
9767
|
className: "metakyc-option-label",
|
|
9768
|
-
onClick: () => n([
|
|
9768
|
+
onClick: () => n([g]),
|
|
9769
9769
|
style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer", margin: 0, padding: 0, userSelect: "none" },
|
|
9770
9770
|
children: [
|
|
9771
9771
|
/* @__PURE__ */ i(
|
|
9772
9772
|
"input",
|
|
9773
9773
|
{
|
|
9774
9774
|
type: "radio",
|
|
9775
|
-
checked: t[0] ===
|
|
9776
|
-
onChange: () => n([
|
|
9775
|
+
checked: t[0] === g,
|
|
9776
|
+
onChange: () => n([g]),
|
|
9777
9777
|
onClick: (p) => p.stopPropagation(),
|
|
9778
9778
|
className: "metakyc-option-input",
|
|
9779
9779
|
style: {
|
|
@@ -9791,17 +9791,17 @@ const Da = ({
|
|
|
9791
9791
|
}
|
|
9792
9792
|
}
|
|
9793
9793
|
),
|
|
9794
|
-
/* @__PURE__ */ i("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: u(
|
|
9794
|
+
/* @__PURE__ */ i("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: u(g) })
|
|
9795
9795
|
]
|
|
9796
9796
|
},
|
|
9797
|
-
|
|
9797
|
+
g
|
|
9798
9798
|
)),
|
|
9799
9799
|
a && /* @__PURE__ */ i("p", { className: "text-sm text-danger-500", children: a })
|
|
9800
9800
|
] }),
|
|
9801
9801
|
l === "checkbox" && /* @__PURE__ */ s("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
|
|
9802
|
-
(e.defaultValues ?? []).map((
|
|
9803
|
-
const p = t.includes(
|
|
9804
|
-
n(p ? t.filter((N) => N !==
|
|
9802
|
+
(e.defaultValues ?? []).map((g) => {
|
|
9803
|
+
const p = t.includes(g), C = () => {
|
|
9804
|
+
n(p ? t.filter((N) => N !== g) : [...t, g]);
|
|
9805
9805
|
};
|
|
9806
9806
|
return /* @__PURE__ */ s(
|
|
9807
9807
|
"div",
|
|
@@ -9811,10 +9811,10 @@ const Da = ({
|
|
|
9811
9811
|
style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer", margin: 0, padding: 0, userSelect: "none" },
|
|
9812
9812
|
children: [
|
|
9813
9813
|
/* @__PURE__ */ i(tt, { checked: p, onChange: () => C() }),
|
|
9814
|
-
/* @__PURE__ */ i("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: u(
|
|
9814
|
+
/* @__PURE__ */ i("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: u(g) })
|
|
9815
9815
|
]
|
|
9816
9816
|
},
|
|
9817
|
-
|
|
9817
|
+
g
|
|
9818
9818
|
);
|
|
9819
9819
|
}),
|
|
9820
9820
|
a && /* @__PURE__ */ i("p", { className: "text-sm text-danger-500", children: a })
|
|
@@ -9823,7 +9823,7 @@ const Da = ({
|
|
|
9823
9823
|
Gt,
|
|
9824
9824
|
{
|
|
9825
9825
|
value: t[0] ?? "",
|
|
9826
|
-
onChange: (
|
|
9826
|
+
onChange: (g) => n([g.target.value]),
|
|
9827
9827
|
options: [
|
|
9828
9828
|
{ value: "US", label: "United States" },
|
|
9829
9829
|
{ value: "GB", label: "United Kingdom" },
|
|
@@ -9842,13 +9842,13 @@ const Da = ({
|
|
|
9842
9842
|
onComplete: t,
|
|
9843
9843
|
onBack: a
|
|
9844
9844
|
}) => {
|
|
9845
|
-
const { t: r } = je(), { investorCategorizationService: n } = Ee(), [o, l] = w(null), [c, d] = w(!1), [u,
|
|
9845
|
+
const { t: r } = je(), { investorCategorizationService: n } = Ee(), [o, l] = w(null), [c, d] = w(!1), [u, g] = w(null);
|
|
9846
9846
|
return /* @__PURE__ */ i("form", { onSubmit: async (C) => {
|
|
9847
9847
|
if (C.preventDefault(), o === null) {
|
|
9848
|
-
|
|
9848
|
+
g(r("investorCategorization.pleaseSelect"));
|
|
9849
9849
|
return;
|
|
9850
9850
|
}
|
|
9851
|
-
d(!0),
|
|
9851
|
+
d(!0), g(null);
|
|
9852
9852
|
try {
|
|
9853
9853
|
const N = {
|
|
9854
9854
|
applicantId: e,
|
|
@@ -9858,7 +9858,7 @@ const Da = ({
|
|
|
9858
9858
|
const x = await n.setInvestorCategorization(N);
|
|
9859
9859
|
console.log("Investor categorization result:", x), t == null || t();
|
|
9860
9860
|
} catch (N) {
|
|
9861
|
-
console.error("Error submitting investor categorization:", N),
|
|
9861
|
+
console.error("Error submitting investor categorization:", N), g(N.message || r("investorCategorization.failedToSubmit"));
|
|
9862
9862
|
} finally {
|
|
9863
9863
|
d(!1);
|
|
9864
9864
|
}
|
|
@@ -9983,7 +9983,7 @@ const ja = ({
|
|
|
9983
9983
|
onComplete: t,
|
|
9984
9984
|
onBack: a
|
|
9985
9985
|
}) => {
|
|
9986
|
-
const { t: r } = je(), { appropriatenessTestService: n } = Ee(), [o, l] = w(null), [c, d] = w(!0), [u,
|
|
9986
|
+
const { t: r } = je(), { appropriatenessTestService: n } = Ee(), [o, l] = w(null), [c, d] = w(!0), [u, g] = w(!1), [p, C] = w(null), [N, x] = w({}), [F, T] = w(0), [$, U] = w(!1), [P, D] = w(!1), [B, _] = w(0), [ce, h] = w(0), [L, M] = w(null);
|
|
9987
9987
|
Ne(() => {
|
|
9988
9988
|
(async () => {
|
|
9989
9989
|
try {
|
|
@@ -10012,11 +10012,11 @@ const ja = ({
|
|
|
10012
10012
|
}, 1e3);
|
|
10013
10013
|
return () => clearInterval(R);
|
|
10014
10014
|
}, [B]), Ne(() => {
|
|
10015
|
-
P && !u &&
|
|
10015
|
+
P && !u && re();
|
|
10016
10016
|
}, [P]);
|
|
10017
10017
|
const Z = () => {
|
|
10018
10018
|
o && (U(!0), T(o.testDurationSec), h(0), x({}), C(null));
|
|
10019
|
-
},
|
|
10019
|
+
}, ae = (R, O) => {
|
|
10020
10020
|
x((Se) => ({ ...Se, [R]: O }));
|
|
10021
10021
|
}, W = ee(async () => {
|
|
10022
10022
|
try {
|
|
@@ -10027,7 +10027,7 @@ const ja = ({
|
|
|
10027
10027
|
}
|
|
10028
10028
|
} catch {
|
|
10029
10029
|
}
|
|
10030
|
-
}, [e, n]),
|
|
10030
|
+
}, [e, n]), re = async (R) => {
|
|
10031
10031
|
if (o) {
|
|
10032
10032
|
if (!P) {
|
|
10033
10033
|
const O = o.appropriatenessQuestions.length - Object.keys(N).length;
|
|
@@ -10036,7 +10036,7 @@ const ja = ({
|
|
|
10036
10036
|
return;
|
|
10037
10037
|
}
|
|
10038
10038
|
}
|
|
10039
|
-
|
|
10039
|
+
g(!0), C(null);
|
|
10040
10040
|
try {
|
|
10041
10041
|
const O = o.appropriatenessQuestions.map(
|
|
10042
10042
|
(xe) => ({ appropriatenessQuestionId: xe.id, value: N[xe.id] || "" })
|
|
@@ -10057,7 +10057,7 @@ const ja = ({
|
|
|
10057
10057
|
} catch (O) {
|
|
10058
10058
|
C(O.message || r("appropriatenessTest.failedToSubmit")), he();
|
|
10059
10059
|
} finally {
|
|
10060
|
-
|
|
10060
|
+
g(!1);
|
|
10061
10061
|
}
|
|
10062
10062
|
}
|
|
10063
10063
|
}, he = () => {
|
|
@@ -10073,7 +10073,7 @@ const ja = ({
|
|
|
10073
10073
|
/* @__PURE__ */ i("p", { style: { fontSize: "16px", fontWeight: 600, color: "var(--metakyc-danger, #ef4444)" }, children: r("appropriatenessTest.noTestData") }),
|
|
10074
10074
|
p && /* @__PURE__ */ i("p", { style: { fontSize: "14px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "8px" }, children: p })
|
|
10075
10075
|
] }) }) });
|
|
10076
|
-
const fe = o.testAllowedMaxTry - o.totalFailedTries, De = o.appropriatenessQuestions.length,
|
|
10076
|
+
const fe = o.testAllowedMaxTry - o.totalFailedTries, De = o.appropriatenessQuestions.length, se = Object.keys(N).length;
|
|
10077
10077
|
if (B > 0)
|
|
10078
10078
|
return /* @__PURE__ */ s(me, { children: [
|
|
10079
10079
|
/* @__PURE__ */ i(Fe, { children: /* @__PURE__ */ i("h2", { style: { fontSize: "18px", fontWeight: 700, color: "var(--metakyc-text-primary, #111827)", margin: 0 }, children: o.displayName }) }),
|
|
@@ -10246,7 +10246,7 @@ const ja = ({
|
|
|
10246
10246
|
/* @__PURE__ */ i(le, { type: "button", onClick: Z, disabled: fe <= 0, children: r("appropriatenessTest.startTest") })
|
|
10247
10247
|
] }) })
|
|
10248
10248
|
] });
|
|
10249
|
-
const G = o.appropriatenessQuestions[ce], Q = ce === De - 1,
|
|
10249
|
+
const G = o.appropriatenessQuestions[ce], Q = ce === De - 1, te = se === De, z = F <= 60;
|
|
10250
10250
|
return /* @__PURE__ */ s(me, { children: [
|
|
10251
10251
|
/* @__PURE__ */ s(Fe, { children: [
|
|
10252
10252
|
/* @__PURE__ */ s("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
|
|
@@ -10299,7 +10299,7 @@ const ja = ({
|
|
|
10299
10299
|
height: "100%",
|
|
10300
10300
|
borderRadius: "999px",
|
|
10301
10301
|
backgroundColor: "var(--metakyc-primary, #2563eb)",
|
|
10302
|
-
width: `${
|
|
10302
|
+
width: `${se / De * 100}%`,
|
|
10303
10303
|
transition: "width 0.3s ease"
|
|
10304
10304
|
} }) }),
|
|
10305
10305
|
/* @__PURE__ */ s("div", { style: {
|
|
@@ -10308,7 +10308,7 @@ const ja = ({
|
|
|
10308
10308
|
marginTop: "4px"
|
|
10309
10309
|
}, children: [
|
|
10310
10310
|
/* @__PURE__ */ s("span", { style: { fontSize: "11px", color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
|
|
10311
|
-
|
|
10311
|
+
se,
|
|
10312
10312
|
" ",
|
|
10313
10313
|
r("appropriatenessTest.answered")
|
|
10314
10314
|
] }),
|
|
@@ -10327,7 +10327,7 @@ const ja = ({
|
|
|
10327
10327
|
question: G,
|
|
10328
10328
|
index: ce,
|
|
10329
10329
|
selectedAnswer: N[G.id],
|
|
10330
|
-
onSelect: (R) =>
|
|
10330
|
+
onSelect: (R) => ae(G.id, R),
|
|
10331
10331
|
disabled: u
|
|
10332
10332
|
}
|
|
10333
10333
|
),
|
|
@@ -10408,14 +10408,14 @@ const ja = ({
|
|
|
10408
10408
|
children: r("common.next")
|
|
10409
10409
|
}
|
|
10410
10410
|
),
|
|
10411
|
-
(Q ||
|
|
10411
|
+
(Q || te) && /* @__PURE__ */ i(
|
|
10412
10412
|
le,
|
|
10413
10413
|
{
|
|
10414
10414
|
type: "button",
|
|
10415
10415
|
isLoading: u,
|
|
10416
|
-
onClick: () =>
|
|
10417
|
-
disabled: !
|
|
10418
|
-
style: { opacity:
|
|
10416
|
+
onClick: () => re(),
|
|
10417
|
+
disabled: !te && !P,
|
|
10418
|
+
style: { opacity: te || P ? 1 : 0.5 },
|
|
10419
10419
|
children: r(P ? "appropriatenessTest.submitting" : "appropriatenessTest.submitTest")
|
|
10420
10420
|
}
|
|
10421
10421
|
)
|
|
@@ -10554,7 +10554,7 @@ const ja = ({
|
|
|
10554
10554
|
onBack: a
|
|
10555
10555
|
}) => {
|
|
10556
10556
|
var Pe, Je, mt, rt;
|
|
10557
|
-
const { t: r } = je(), { applicantService: n, baseInformationService: o, identityService: l, config: c, currentTheme: d } = Ee(), { identityData: u, provider:
|
|
10557
|
+
const { t: r } = je(), { applicantService: n, baseInformationService: o, identityService: l, config: c, currentTheme: d } = Ee(), { identityData: u, provider: g, token: p, isLoading: C, error: N, requestIdentity: x, restartIdentity: F } = aa(e), [T, $] = w(null), [U, P] = w(null), [D, B] = w([]), [_, ce] = w([]), [h, L] = w(!0), [M, Z] = w(!1), [ae, W] = w(null), [re, he] = w(!1), fe = we.useRef(!1), [De, se] = w({}), [G, Q] = w({}), te = d != null && d.reviewPageFields && d.reviewPageFields.length > 0 ? d.reviewPageFields[0] : null, z = !!(d != null && d.reviewPageDisabled), R = be(!1);
|
|
10558
10558
|
R.current = z;
|
|
10559
10559
|
const O = ji({
|
|
10560
10560
|
defaultValues: {
|
|
@@ -10585,37 +10585,37 @@ const ja = ({
|
|
|
10585
10585
|
B(ke);
|
|
10586
10586
|
const Ie = /* @__PURE__ */ new Set(), y = Y.filter((A) => A.countryCode).map((A) => ({ value: A.countryCode, label: `${A.countryCode} – ${A.name}` })).filter((A) => Ie.has(A.value) ? !1 : (Ie.add(A.value), !0));
|
|
10587
10587
|
ce(y);
|
|
10588
|
-
const
|
|
10589
|
-
if (
|
|
10590
|
-
firstName: (
|
|
10591
|
-
lastName: (
|
|
10592
|
-
email: (
|
|
10593
|
-
dateOfBirth: (
|
|
10594
|
-
title: (
|
|
10595
|
-
salutation: (
|
|
10596
|
-
phonenumber: (
|
|
10597
|
-
mobileCountryCode: (
|
|
10598
|
-
street: (
|
|
10599
|
-
streetNumber: (
|
|
10600
|
-
city: (
|
|
10601
|
-
zip: (
|
|
10602
|
-
country: (
|
|
10603
|
-
nationality: (
|
|
10604
|
-
taxCountry: (
|
|
10605
|
-
countryOfBirth: (
|
|
10606
|
-
placeOfBirth: (
|
|
10607
|
-
educationLevel: (
|
|
10608
|
-
occupation: (
|
|
10609
|
-
taxNumber: (
|
|
10610
|
-
defaultLanguage: (
|
|
10588
|
+
const f = V.applicantRequestData;
|
|
10589
|
+
if (se({
|
|
10590
|
+
firstName: (f == null ? void 0 : f.firstName) || "",
|
|
10591
|
+
lastName: (f == null ? void 0 : f.lastName) || "",
|
|
10592
|
+
email: (f == null ? void 0 : f.email) || "",
|
|
10593
|
+
dateOfBirth: (f == null ? void 0 : f.dateOfBirth) || "",
|
|
10594
|
+
title: (f == null ? void 0 : f.title) || "",
|
|
10595
|
+
salutation: (f == null ? void 0 : f.salutation) || "",
|
|
10596
|
+
phonenumber: (f == null ? void 0 : f.phonenumber) || "",
|
|
10597
|
+
mobileCountryCode: (f == null ? void 0 : f.mobileCountryCode) || "",
|
|
10598
|
+
street: (f == null ? void 0 : f.street) || "",
|
|
10599
|
+
streetNumber: (f == null ? void 0 : f.streetNumber) || "",
|
|
10600
|
+
city: (f == null ? void 0 : f.city) || "",
|
|
10601
|
+
zip: (f == null ? void 0 : f.zip) || "",
|
|
10602
|
+
country: (f == null ? void 0 : f.country) || "",
|
|
10603
|
+
nationality: (f == null ? void 0 : f.nationality) || "",
|
|
10604
|
+
taxCountry: (f == null ? void 0 : f.taxCountry) || "",
|
|
10605
|
+
countryOfBirth: (f == null ? void 0 : f.countryOfBirth) || "",
|
|
10606
|
+
placeOfBirth: (f == null ? void 0 : f.placeOfBirth) || "",
|
|
10607
|
+
educationLevel: (f == null ? void 0 : f.educationLevel) || "",
|
|
10608
|
+
occupation: (f == null ? void 0 : f.occupation) || "",
|
|
10609
|
+
taxNumber: (f == null ? void 0 : f.taxNumber) || "",
|
|
10610
|
+
defaultLanguage: (f == null ? void 0 : f.defaultLanguage) || ""
|
|
10611
10611
|
}), O.reset({
|
|
10612
|
-
street: (
|
|
10613
|
-
streetNumber: (
|
|
10614
|
-
city: (
|
|
10615
|
-
zip: (
|
|
10616
|
-
country: (
|
|
10617
|
-
nationality: (
|
|
10618
|
-
phonenumber: (
|
|
10612
|
+
street: (f == null ? void 0 : f.street) || "",
|
|
10613
|
+
streetNumber: (f == null ? void 0 : f.streetNumber) || "",
|
|
10614
|
+
city: (f == null ? void 0 : f.city) || "",
|
|
10615
|
+
zip: (f == null ? void 0 : f.zip) || "",
|
|
10616
|
+
country: (f == null ? void 0 : f.country) || "",
|
|
10617
|
+
nationality: (f == null ? void 0 : f.nationality) || "",
|
|
10618
|
+
phonenumber: (f == null ? void 0 : f.phonenumber) || ""
|
|
10619
10619
|
}), V.kycRecords && V.kycRecords.length > 0 && V.kycRecords[0].providerTokenObject !== null && !fe.current && R.current) {
|
|
10620
10620
|
console.log("[Identity] Review page disabled + existing identity — auto-requesting..."), fe.current = !0;
|
|
10621
10621
|
try {
|
|
@@ -10657,16 +10657,16 @@ const ja = ({
|
|
|
10657
10657
|
}
|
|
10658
10658
|
}
|
|
10659
10659
|
}, [p]);
|
|
10660
|
-
const Se =
|
|
10660
|
+
const Se = g !== null && g === et.Sumsub;
|
|
10661
10661
|
Ne(() => {
|
|
10662
|
-
if (
|
|
10663
|
-
const b =
|
|
10662
|
+
if (g !== null && p && !T && M && !re) {
|
|
10663
|
+
const b = g;
|
|
10664
10664
|
if (Se) {
|
|
10665
10665
|
console.log("[Sumsub] Fetching access token for Web SDK…"), W(null), (async () => {
|
|
10666
10666
|
try {
|
|
10667
|
-
const V = await l.refreshSumsubToken(e), J = pt.parseProviderConfig(
|
|
10667
|
+
const V = await l.refreshSumsubToken(e), J = pt.parseProviderConfig(g, p, c);
|
|
10668
10668
|
J.accessToken = V, J.onTokenRefresh = () => l.refreshSumsubToken(e);
|
|
10669
|
-
const Y = pt.createProvider(
|
|
10669
|
+
const Y = pt.createProvider(g, J);
|
|
10670
10670
|
Y.onComplete((ye) => {
|
|
10671
10671
|
console.log("[Sumsub] Verification complete:", ye), t == null || t();
|
|
10672
10672
|
}), Y.onError((ye) => {
|
|
@@ -10684,8 +10684,8 @@ const ja = ({
|
|
|
10684
10684
|
if (new URL(p.url), b === et.SardinAI) {
|
|
10685
10685
|
console.log("[SardinAI] Initializing Risk SDK in background...");
|
|
10686
10686
|
try {
|
|
10687
|
-
const V = pt.parseProviderConfig(
|
|
10688
|
-
pt.createProvider(
|
|
10687
|
+
const V = pt.parseProviderConfig(g, p, c);
|
|
10688
|
+
pt.createProvider(g, V).initialize().then(() => console.log("[SardinAI] Risk SDK initialized in background")).catch((Y) => console.warn("[SardinAI] Risk SDK init failed (non-blocking):", Y));
|
|
10689
10689
|
} catch (V) {
|
|
10690
10690
|
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", V);
|
|
10691
10691
|
}
|
|
@@ -10699,7 +10699,7 @@ const ja = ({
|
|
|
10699
10699
|
if (b === et.SardinAI) {
|
|
10700
10700
|
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), W(null);
|
|
10701
10701
|
try {
|
|
10702
|
-
const V = pt.parseProviderConfig(
|
|
10702
|
+
const V = pt.parseProviderConfig(g, p, c), J = pt.createProvider(g, V);
|
|
10703
10703
|
J.initialize().then(() => {
|
|
10704
10704
|
console.log("[SardinAI] Risk SDK initialized successfully"), $(J), setTimeout(() => t == null ? void 0 : t(), 2e3);
|
|
10705
10705
|
}).catch((Y) => {
|
|
@@ -10715,7 +10715,7 @@ const ja = ({
|
|
|
10715
10715
|
}
|
|
10716
10716
|
try {
|
|
10717
10717
|
W(null);
|
|
10718
|
-
const V = pt.parseProviderConfig(
|
|
10718
|
+
const V = pt.parseProviderConfig(g, p, c), J = pt.createProvider(g, V);
|
|
10719
10719
|
b === et.Onfido && J.initialize("identity-container").catch((Y) => {
|
|
10720
10720
|
console.error("[Onfido] Initialization error:", Y), W(r("identity.failedToInitialize", { message: Y.message }));
|
|
10721
10721
|
}), $(J);
|
|
@@ -10731,7 +10731,7 @@ const ja = ({
|
|
|
10731
10731
|
console.error("[Identity] Error destroying provider:", b);
|
|
10732
10732
|
}
|
|
10733
10733
|
};
|
|
10734
|
-
}, [
|
|
10734
|
+
}, [g, p, T, M, t, re, Se, e, c, l]);
|
|
10735
10735
|
const xe = async () => {
|
|
10736
10736
|
try {
|
|
10737
10737
|
W(null), he(!1), await x(), Z(!0);
|
|
@@ -10755,8 +10755,8 @@ const ja = ({
|
|
|
10755
10755
|
"Error: ",
|
|
10756
10756
|
N.message
|
|
10757
10757
|
] }) }) });
|
|
10758
|
-
const
|
|
10759
|
-
if (M && (
|
|
10758
|
+
const ie = z ? a : () => Z(!1);
|
|
10759
|
+
if (M && (ae || re))
|
|
10760
10760
|
return /* @__PURE__ */ s(me, { children: [
|
|
10761
10761
|
/* @__PURE__ */ i(Fe, { children: /* @__PURE__ */ i("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: r("identity.sessionIssueTitle") }) }),
|
|
10762
10762
|
/* @__PURE__ */ s(ue, { children: [
|
|
@@ -10784,8 +10784,8 @@ const ja = ({
|
|
|
10784
10784
|
}
|
|
10785
10785
|
),
|
|
10786
10786
|
/* @__PURE__ */ s("div", { children: [
|
|
10787
|
-
/* @__PURE__ */ i("h3", { className: "font-semibold mb-1", style: { color: "var(--metakyc-danger, #ef4444)" }, children: r(
|
|
10788
|
-
/* @__PURE__ */ i("p", { className: "text-sm", style: { color: "var(--metakyc-danger, #ef4444)" }, children:
|
|
10787
|
+
/* @__PURE__ */ i("h3", { className: "font-semibold mb-1", style: { color: "var(--metakyc-danger, #ef4444)" }, children: r(re ? "identity.sessionExpiredTitle" : "identity.verificationError") }),
|
|
10788
|
+
/* @__PURE__ */ i("p", { className: "text-sm", style: { color: "var(--metakyc-danger, #ef4444)" }, children: ae || r("identity.sessionExpiredMessage") })
|
|
10789
10789
|
] })
|
|
10790
10790
|
] }) }),
|
|
10791
10791
|
/* @__PURE__ */ s("div", { className: "rounded-lg p-4", style: {
|
|
@@ -10801,12 +10801,12 @@ const ja = ({
|
|
|
10801
10801
|
] })
|
|
10802
10802
|
] }),
|
|
10803
10803
|
/* @__PURE__ */ s(Oe, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
10804
|
-
|
|
10804
|
+
ie && /* @__PURE__ */ i(le, { type: "button", variant: "outline", onClick: ie, children: r("common.back") }),
|
|
10805
10805
|
/* @__PURE__ */ i(le, { type: "button", onClick: q, disabled: C, children: r(C ? "identity.restarting" : "identity.restartVerification") })
|
|
10806
10806
|
] })
|
|
10807
10807
|
] });
|
|
10808
10808
|
if (M && u) {
|
|
10809
|
-
const b =
|
|
10809
|
+
const b = g;
|
|
10810
10810
|
return Se ? /* @__PURE__ */ s("div", { style: {
|
|
10811
10811
|
background: "var(--metakyc-background, #ffffff)",
|
|
10812
10812
|
borderRadius: "12px",
|
|
@@ -10866,10 +10866,10 @@ const ja = ({
|
|
|
10866
10866
|
}
|
|
10867
10867
|
}
|
|
10868
10868
|
),
|
|
10869
|
-
|
|
10869
|
+
ie && /* @__PURE__ */ i("div", { style: {
|
|
10870
10870
|
padding: "16px 24px",
|
|
10871
10871
|
borderTop: "1px solid var(--metakyc-border, #e5e7eb)"
|
|
10872
|
-
}, children: /* @__PURE__ */ i(le, { variant: "outline", onClick:
|
|
10872
|
+
}, children: /* @__PURE__ */ i(le, { variant: "outline", onClick: ie, children: r("common.back") }) })
|
|
10873
10873
|
] }) : p != null && p.url ? /* @__PURE__ */ s(me, { children: [
|
|
10874
10874
|
/* @__PURE__ */ i(Fe, { children: /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
|
|
10875
10875
|
/* @__PURE__ */ s("div", { children: [
|
|
@@ -10916,7 +10916,7 @@ const ja = ({
|
|
|
10916
10916
|
}
|
|
10917
10917
|
) })
|
|
10918
10918
|
] }),
|
|
10919
|
-
|
|
10919
|
+
ie && /* @__PURE__ */ i(Oe, { children: /* @__PURE__ */ i(le, { variant: "outline", onClick: ie, children: r("common.back") }) })
|
|
10920
10920
|
] }) : b === et.SardinAI ? /* @__PURE__ */ s(me, { children: [
|
|
10921
10921
|
/* @__PURE__ */ s(Fe, { children: [
|
|
10922
10922
|
/* @__PURE__ */ i("h2", { className: "text-2xl font-bold", children: r("identity.deviceRiskAssessment") }),
|
|
@@ -10933,7 +10933,7 @@ const ja = ({
|
|
|
10933
10933
|
/* @__PURE__ */ i("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: r("identity.subtitle") })
|
|
10934
10934
|
] }),
|
|
10935
10935
|
/* @__PURE__ */ i(ue, { children: /* @__PURE__ */ i("div", { id: "identity-container", className: "min-h-[400px]" }) }),
|
|
10936
|
-
|
|
10936
|
+
ie && /* @__PURE__ */ i(Oe, { children: /* @__PURE__ */ i(le, { variant: "outline", onClick: ie, children: r("common.back") }) })
|
|
10937
10937
|
] });
|
|
10938
10938
|
}
|
|
10939
10939
|
const Te = /* @__PURE__ */ new Set(["country", "nationality", "taxCountry", "countryOfBirth", "mobileCountryCode", "otherNationality"]), Ce = (b = 4) => {
|
|
@@ -11075,7 +11075,7 @@ const ja = ({
|
|
|
11075
11075
|
rel: "noopener noreferrer",
|
|
11076
11076
|
className: "text-sm underline",
|
|
11077
11077
|
style: { color: "var(--metakyc-primary, #6366f1)" },
|
|
11078
|
-
children:
|
|
11078
|
+
children: oe(b.displayText, r) || oe(b.label, r) || b.linkText || b.linkUrl
|
|
11079
11079
|
}
|
|
11080
11080
|
),
|
|
11081
11081
|
b.helpText
|
|
@@ -11093,23 +11093,23 @@ const ja = ({
|
|
|
11093
11093
|
}
|
|
11094
11094
|
),
|
|
11095
11095
|
/* @__PURE__ */ i("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: b.customType === "link_checkbox" && b.linkUrl ? /* @__PURE__ */ s(wt, { children: [
|
|
11096
|
-
/* @__PURE__ */ i("a", { href: b.linkUrl, target: "_blank", rel: "noopener noreferrer", style: { color: "var(--metakyc-primary, #6366f1)", textDecoration: "underline" }, children: b.linkText ||
|
|
11097
|
-
b.label && b.linkText ? ` ${
|
|
11098
|
-
] }) :
|
|
11096
|
+
/* @__PURE__ */ i("a", { href: b.linkUrl, target: "_blank", rel: "noopener noreferrer", style: { color: "var(--metakyc-primary, #6366f1)", textDecoration: "underline" }, children: b.linkText || oe(b.label, r) }),
|
|
11097
|
+
b.label && b.linkText ? ` ${oe(b.label, r)}` : ""
|
|
11098
|
+
] }) : oe(b.displayText, r) || oe(b.label, r) })
|
|
11099
11099
|
] }),
|
|
11100
11100
|
b.helpText
|
|
11101
11101
|
) }, J);
|
|
11102
11102
|
}
|
|
11103
11103
|
if (b.customType === "group_checkbox") {
|
|
11104
11104
|
const ke = Array.isArray(ye) ? ye : ye ? [ye] : [], Ie = (y) => {
|
|
11105
|
-
b.singleSelect ? Q((
|
|
11106
|
-
...
|
|
11105
|
+
b.singleSelect ? Q((f) => ({ ...f, [Y]: ke[0] === y ? [] : [y] })) : Q((f) => ({
|
|
11106
|
+
...f,
|
|
11107
11107
|
[Y]: ke.includes(y) ? ke.filter((I) => I !== y) : [...ke, y]
|
|
11108
11108
|
}));
|
|
11109
11109
|
};
|
|
11110
11110
|
return /* @__PURE__ */ i("div", { style: Ce(b.colSpan), children: _e(
|
|
11111
11111
|
/* @__PURE__ */ s("div", { className: "space-y-1.5", children: [
|
|
11112
|
-
b.label && /* @__PURE__ */ i("p", { className: "text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children:
|
|
11112
|
+
b.label && /* @__PURE__ */ i("p", { className: "text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: oe(b.displayText, r) || oe(b.label, r) }),
|
|
11113
11113
|
(b.options || []).map((y) => /* @__PURE__ */ s("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
|
|
11114
11114
|
/* @__PURE__ */ i(
|
|
11115
11115
|
tt,
|
|
@@ -11127,7 +11127,7 @@ const ja = ({
|
|
|
11127
11127
|
}
|
|
11128
11128
|
return b.customType === "radio_group" ? /* @__PURE__ */ i("div", { style: Ce(b.colSpan), children: _e(
|
|
11129
11129
|
/* @__PURE__ */ s("div", { className: "space-y-1.5", children: [
|
|
11130
|
-
b.label && /* @__PURE__ */ i("p", { className: "text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children:
|
|
11130
|
+
b.label && /* @__PURE__ */ i("p", { className: "text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: oe(b.displayText, r) || oe(b.label, r) }),
|
|
11131
11131
|
(b.options || []).map((ke) => /* @__PURE__ */ s("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
|
|
11132
11132
|
/* @__PURE__ */ i(
|
|
11133
11133
|
"input",
|
|
@@ -11148,7 +11148,7 @@ const ja = ({
|
|
|
11148
11148
|
/* @__PURE__ */ i(
|
|
11149
11149
|
Le,
|
|
11150
11150
|
{
|
|
11151
|
-
label:
|
|
11151
|
+
label: oe(b.displayText, r) || oe(b.label, r) || Y,
|
|
11152
11152
|
value: String(ye ?? ""),
|
|
11153
11153
|
onChange: (ke) => Q((Ie) => ({ ...Ie, [Y]: ke.target.value }))
|
|
11154
11154
|
}
|
|
@@ -11157,14 +11157,14 @@ const ja = ({
|
|
|
11157
11157
|
) }, J);
|
|
11158
11158
|
}, Ze = (b, V) => {
|
|
11159
11159
|
if (b.isCustom) return yt(b, V);
|
|
11160
|
-
const J = b.name ?? "", Y = gt[J], ye =
|
|
11160
|
+
const J = b.name ?? "", Y = gt[J], ye = oe(b.displayText, r) || (Y != null && Y.translationKey ? r(`fields.${Y.translationKey}`) : void 0) || (Y == null ? void 0 : Y.label) || J, ke = De[J] ?? "", Ie = J === "mobileCountryCode", y = !!(Y != null && Y.countriesType) && !Ie;
|
|
11161
11161
|
return b.editable ? Ie ? /* @__PURE__ */ i("div", { style: Ce(b.colSpan ?? 2), children: _e(
|
|
11162
11162
|
/* @__PURE__ */ i(
|
|
11163
11163
|
ct,
|
|
11164
11164
|
{
|
|
11165
11165
|
label: ye,
|
|
11166
11166
|
value: String(ke),
|
|
11167
|
-
onChange: (
|
|
11167
|
+
onChange: (f) => se((I) => ({ ...I, [J]: f })),
|
|
11168
11168
|
options: [{ value: "", label: r("placeholders.selectCountryCode") }, ..._]
|
|
11169
11169
|
}
|
|
11170
11170
|
),
|
|
@@ -11175,7 +11175,7 @@ const ja = ({
|
|
|
11175
11175
|
{
|
|
11176
11176
|
label: ye,
|
|
11177
11177
|
value: String(ke),
|
|
11178
|
-
onChange: (
|
|
11178
|
+
onChange: (f) => se((I) => ({ ...I, [J]: f })),
|
|
11179
11179
|
options: [{ value: "", label: r("common.select") }, ...D]
|
|
11180
11180
|
}
|
|
11181
11181
|
),
|
|
@@ -11187,7 +11187,7 @@ const ja = ({
|
|
|
11187
11187
|
label: ye,
|
|
11188
11188
|
type: (Y == null ? void 0 : Y.type) === "date" ? "date" : (Y == null ? void 0 : Y.type) === "email" ? "email" : "text",
|
|
11189
11189
|
value: String(ke),
|
|
11190
|
-
onChange: (
|
|
11190
|
+
onChange: (f) => se((I) => ({ ...I, [J]: f.target.value }))
|
|
11191
11191
|
}
|
|
11192
11192
|
),
|
|
11193
11193
|
b.helpText
|
|
@@ -11199,8 +11199,8 @@ const ja = ({
|
|
|
11199
11199
|
b.helpText
|
|
11200
11200
|
) }, `ro-${V}`);
|
|
11201
11201
|
};
|
|
11202
|
-
if (
|
|
11203
|
-
const b =
|
|
11202
|
+
if (te) {
|
|
11203
|
+
const b = oe(te.title, r) || r("identity.reviewYourInformation"), V = oe(te.subtitle, r) || r("identity.reviewSubtitle");
|
|
11204
11204
|
return /* @__PURE__ */ i("form", { onSubmit: (J) => {
|
|
11205
11205
|
J.preventDefault(), xe();
|
|
11206
11206
|
}, children: /* @__PURE__ */ s(me, { children: [
|
|
@@ -11208,7 +11208,7 @@ const ja = ({
|
|
|
11208
11208
|
/* @__PURE__ */ i("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: b }),
|
|
11209
11209
|
V && /* @__PURE__ */ i("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: V })
|
|
11210
11210
|
] }),
|
|
11211
|
-
/* @__PURE__ */ i(ue, { children: /* @__PURE__ */ i("div", { className: "metakyc-form-grid", children:
|
|
11211
|
+
/* @__PURE__ */ i(ue, { children: /* @__PURE__ */ i("div", { className: "metakyc-form-grid", children: te.fields.map((J, Y) => Ze(J, Y)) }) }),
|
|
11212
11212
|
/* @__PURE__ */ s(Oe, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
11213
11213
|
a && /* @__PURE__ */ i(le, { type: "button", variant: "outline", onClick: a, children: r("common.back") }),
|
|
11214
11214
|
/* @__PURE__ */ i(le, { type: "submit", isLoading: C, children: r("identity.confirmAndStart") })
|
|
@@ -11425,7 +11425,7 @@ const pi = ({
|
|
|
11425
11425
|
subtitle: t,
|
|
11426
11426
|
className: a = ""
|
|
11427
11427
|
}) => {
|
|
11428
|
-
const { currentTheme: r } = Ee(), { t: n } = je(), o = e || (r == null ? void 0 : r.title) || "", l =
|
|
11428
|
+
const { currentTheme: r } = Ee(), { t: n } = je(), o = e || (r == null ? void 0 : r.title) || "", l = oe(o, n), c = oe(t, n), d = !!(r != null && r.logo && r.logo.visible && r.logo.url), u = !!l;
|
|
11429
11429
|
return !d && !u ? null : /* @__PURE__ */ s("div", { className: `metakyc-header ${a}`, children: [
|
|
11430
11430
|
/* @__PURE__ */ s(
|
|
11431
11431
|
"div",
|
|
@@ -11453,14 +11453,14 @@ function It() {
|
|
|
11453
11453
|
return t.current = e, t;
|
|
11454
11454
|
}
|
|
11455
11455
|
const Ua = ({ children: e }) => {
|
|
11456
|
-
const [t, a] = w([]), [r, n] = w({}), o = be([]), l = ee((
|
|
11457
|
-
o.current = [...o.current.filter((p) => p.id !==
|
|
11458
|
-
}, []), c = ee((
|
|
11459
|
-
o.current = o.current.filter((p) => p.id !==
|
|
11460
|
-
}, []), d = ee((
|
|
11456
|
+
const [t, a] = w([]), [r, n] = w({}), o = be([]), l = ee((g) => {
|
|
11457
|
+
o.current = [...o.current.filter((p) => p.id !== g.id), g], a([...o.current]);
|
|
11458
|
+
}, []), c = ee((g) => {
|
|
11459
|
+
o.current = o.current.filter((p) => p.id !== g), a([...o.current]);
|
|
11460
|
+
}, []), d = ee((g) => {
|
|
11461
11461
|
n((p) => {
|
|
11462
|
-
const C = { ...p, ...
|
|
11463
|
-
return Object.keys(
|
|
11462
|
+
const C = { ...p, ...g };
|
|
11463
|
+
return Object.keys(g).some((x) => p[x] !== g[x]) ? C : p;
|
|
11464
11464
|
});
|
|
11465
11465
|
}, []), u = Ye(
|
|
11466
11466
|
() => ({ actions: t, registerAction: l, unregisterAction: c, sdkState: r, updateSdkState: d }),
|
|
@@ -11478,7 +11478,7 @@ const Ua = ({ children: e }) => {
|
|
|
11478
11478
|
clearTimeout(L), document.removeEventListener("mousedown", h);
|
|
11479
11479
|
};
|
|
11480
11480
|
}, [t]), !e) return null;
|
|
11481
|
-
const { actions: d, sdkState: u } = e,
|
|
11481
|
+
const { actions: d, sdkState: u } = e, g = d.filter((h) => h.group === "form"), p = d.filter((h) => h.group === "workflow"), C = d.filter((h) => !h.group || h.group === "general"), N = async (h, L) => {
|
|
11482
11482
|
l(h);
|
|
11483
11483
|
try {
|
|
11484
11484
|
await L();
|
|
@@ -11621,7 +11621,7 @@ const Ua = ({ children: e }) => {
|
|
|
11621
11621
|
/* @__PURE__ */ i("button", { style: $(r === "state"), onClick: () => n("state"), children: "State" })
|
|
11622
11622
|
] }),
|
|
11623
11623
|
/* @__PURE__ */ i("div", { style: { flex: 1, overflowY: "auto", overflowX: "hidden" }, children: r === "actions" ? /* @__PURE__ */ s("div", { style: { paddingBottom: "8px" }, children: [
|
|
11624
|
-
B("Form",
|
|
11624
|
+
B("Form", g),
|
|
11625
11625
|
B("Workflow", p),
|
|
11626
11626
|
B("General", C),
|
|
11627
11627
|
d.length === 0 && /* @__PURE__ */ s("div", { style: { padding: "24px 14px", textAlign: "center", color: "#6c7086" }, children: [
|
|
@@ -11862,13 +11862,13 @@ const Qa = {
|
|
|
11862
11862
|
onSuccess: r,
|
|
11863
11863
|
onCancel: n
|
|
11864
11864
|
}) => {
|
|
11865
|
-
var
|
|
11866
|
-
const { config: o, baseInformationService: l, currentTheme: c } = Ee(), { createApplicant: d, getApplicantData: u, isLoading:
|
|
11865
|
+
var f, I, A, K, X, ne, ve;
|
|
11866
|
+
const { config: o, baseInformationService: l, currentTheme: c } = Ee(), { createApplicant: d, getApplicantData: u, isLoading: g } = Ci(), { t: p } = je(), C = e || ((f = o.applicantForm) == null ? void 0 : f.workflowKey);
|
|
11867
11867
|
if (!C)
|
|
11868
11868
|
throw new Error(
|
|
11869
11869
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
11870
11870
|
);
|
|
11871
|
-
const N = t || ((I = o.applicantForm) == null ? void 0 : I.externalRefId) || "", x = ((A = o.applicantForm) == null ? void 0 : A.email) || "", F = ((K = o.applicantForm) == null ? void 0 : K.hiddenValues) || {}, T = ((X = o.applicantForm) == null ? void 0 : X.initialValues) || {}, U = (((
|
|
11871
|
+
const N = t || ((I = o.applicantForm) == null ? void 0 : I.externalRefId) || "", x = ((A = o.applicantForm) == null ? void 0 : A.email) || "", F = ((K = o.applicantForm) == null ? void 0 : K.hiddenValues) || {}, T = ((X = o.applicantForm) == null ? void 0 : X.initialValues) || {}, U = (((ne = o.applicantForm) == null ? void 0 : ne.fieldLabelMode) || (c == null ? void 0 : c.fieldLabelMode) || "label") !== "placeholder", P = Ye(
|
|
11872
11872
|
() => c != null && c.applicantFormPages && c.applicantFormPages.length > 0 ? c.applicantFormPages : null,
|
|
11873
11873
|
[c == null ? void 0 : c.applicantFormPages]
|
|
11874
11874
|
), D = Ye(() => {
|
|
@@ -11909,12 +11909,12 @@ const Qa = {
|
|
|
11909
11909
|
for (const k of B)
|
|
11910
11910
|
_.has(k) && m.add((E = gt[k]) == null ? void 0 : E.countriesType);
|
|
11911
11911
|
return m.size === 0 && m.add(void 0), Array.from(m);
|
|
11912
|
-
}, [B, P]), [h, L] = w({}), [M, Z] = w(!0),
|
|
11912
|
+
}, [B, P]), [h, L] = w({}), [M, Z] = w(!0), ae = be(/* @__PURE__ */ new Set()), W = be(/* @__PURE__ */ new Set());
|
|
11913
11913
|
Ne(() => {
|
|
11914
11914
|
if (!c) return;
|
|
11915
11915
|
const m = ce.filter((k) => {
|
|
11916
11916
|
const v = k != null ? String(k) : "all";
|
|
11917
|
-
return !W.current.has(v) && !
|
|
11917
|
+
return !W.current.has(v) && !ae.current.has(v);
|
|
11918
11918
|
});
|
|
11919
11919
|
if (m.length === 0) {
|
|
11920
11920
|
ce.every((v) => {
|
|
@@ -11925,7 +11925,7 @@ const Qa = {
|
|
|
11925
11925
|
}
|
|
11926
11926
|
Z(!0);
|
|
11927
11927
|
const j = m.map((k) => k != null ? String(k) : "all");
|
|
11928
|
-
j.forEach((k) =>
|
|
11928
|
+
j.forEach((k) => ae.current.add(k)), (async () => {
|
|
11929
11929
|
try {
|
|
11930
11930
|
const k = await Promise.all(
|
|
11931
11931
|
m.map(async (v) => {
|
|
@@ -11933,12 +11933,12 @@ const Qa = {
|
|
|
11933
11933
|
value: Ae.countryCode,
|
|
11934
11934
|
label: `${Ae.countryCode} – ${Ae.name}`
|
|
11935
11935
|
} : { value: Ae.abbreviation3 || Ae.abbreviation, label: Ae.name }).filter((Ae) => !Ae.value || Ve.has(Ae.value) ? !1 : (Ve.add(Ae.value), !0));
|
|
11936
|
-
return W.current.add(S),
|
|
11936
|
+
return W.current.add(S), ae.current.delete(S), [S, Be];
|
|
11937
11937
|
})
|
|
11938
11938
|
);
|
|
11939
11939
|
L((v) => ({ ...v, ...Object.fromEntries(k) }));
|
|
11940
11940
|
} catch (k) {
|
|
11941
|
-
j.forEach((v) =>
|
|
11941
|
+
j.forEach((v) => ae.current.delete(v)), console.error("Failed to load countries:", k);
|
|
11942
11942
|
} finally {
|
|
11943
11943
|
ce.every((v) => {
|
|
11944
11944
|
const S = v != null ? String(v) : "all";
|
|
@@ -11947,7 +11947,7 @@ const Qa = {
|
|
|
11947
11947
|
}
|
|
11948
11948
|
})();
|
|
11949
11949
|
}, [ce, c]);
|
|
11950
|
-
const
|
|
11950
|
+
const re = (m, j) => {
|
|
11951
11951
|
var v;
|
|
11952
11952
|
const E = j ?? ((v = gt[m]) == null ? void 0 : v.countriesType), k = E != null ? String(E) : "all";
|
|
11953
11953
|
return h[k] || [];
|
|
@@ -11978,7 +11978,7 @@ const Qa = {
|
|
|
11978
11978
|
Object.entries(F).filter(([m]) => m in he)
|
|
11979
11979
|
), De = Object.fromEntries(
|
|
11980
11980
|
Object.entries(T).filter(([m]) => m in he)
|
|
11981
|
-
), [
|
|
11981
|
+
), [se, G] = w({
|
|
11982
11982
|
workflowKey: C,
|
|
11983
11983
|
firstName: "",
|
|
11984
11984
|
lastName: "",
|
|
@@ -12007,7 +12007,7 @@ const Qa = {
|
|
|
12007
12007
|
...De
|
|
12008
12008
|
}), Q = Object.fromEntries(
|
|
12009
12009
|
Object.entries(F).filter(([m]) => !(m in fe) && m !== "externalRefId" && m !== "workflowKey")
|
|
12010
|
-
), [
|
|
12010
|
+
), [te, z] = w({ ...Q }), [R, O] = w(!!a);
|
|
12011
12011
|
Ne(() => {
|
|
12012
12012
|
if (!a) return;
|
|
12013
12013
|
let m = !1;
|
|
@@ -12053,7 +12053,7 @@ const Qa = {
|
|
|
12053
12053
|
m = !0;
|
|
12054
12054
|
};
|
|
12055
12055
|
}, [a]);
|
|
12056
|
-
const [Se, xe] = w(0), [q,
|
|
12056
|
+
const [Se, xe] = w(0), [q, ie] = w({}), [Te, Ce] = w(null), [qe, it] = w(!1), _e = It(), yt = ee(() => {
|
|
12057
12057
|
const m = _a(), j = (E) => {
|
|
12058
12058
|
var ge;
|
|
12059
12059
|
const k = (ge = gt[E]) == null ? void 0 : ge.countriesType, v = k != null ? String(k) : "all", S = (h[v] || []).filter((pe) => pe.value);
|
|
@@ -12077,7 +12077,7 @@ const Qa = {
|
|
|
12077
12077
|
for (const pe of ge.fields)
|
|
12078
12078
|
!pe.isCustom || !pe.paramName || k[pe.paramName] || (pe.customType === "checkbox" || pe.customType === "link_checkbox" ? k[pe.paramName] = "true" : pe.customType === "radio_group" && ((v = pe.options) != null && v.length) || pe.customType === "group_checkbox" && ((S = pe.options) != null && S.length) ? k[pe.paramName] = pe.options[0].value : pe.customType === "text" && (k[pe.paramName] = "Sample value"));
|
|
12079
12079
|
return k;
|
|
12080
|
-
}),
|
|
12080
|
+
}), ie({}), Ce(null);
|
|
12081
12081
|
}, [P, h]);
|
|
12082
12082
|
Ne(() => {
|
|
12083
12083
|
const m = _e.current;
|
|
@@ -12090,11 +12090,11 @@ const Qa = {
|
|
|
12090
12090
|
handler: yt
|
|
12091
12091
|
}), () => m.unregisterAction("fill-individual-form");
|
|
12092
12092
|
}, [_e, yt]);
|
|
12093
|
-
const Ze = (m, j) => G((E) => ({ ...E, [m]: j })), Pe = (m, j) => z((E) => ({ ...E, [m]: j })), Je = (m) => !m.conditionalOn ||
|
|
12093
|
+
const Ze = (m, j) => G((E) => ({ ...E, [m]: j })), Pe = (m, j) => z((E) => ({ ...E, [m]: j })), Je = (m) => !m.conditionalOn || te[m.conditionalOn] === "true", mt = (m) => {
|
|
12094
12094
|
var j;
|
|
12095
12095
|
for (const E of m.fields) {
|
|
12096
12096
|
if (!E.isCustom || !E.paramName || !((j = E.blockingValues) != null && j.length)) continue;
|
|
12097
|
-
const k =
|
|
12097
|
+
const k = te[E.paramName] ?? "";
|
|
12098
12098
|
if (E.customType === "group_checkbox") {
|
|
12099
12099
|
if (k.split(",").filter(Boolean).some((S) => E.blockingValues.includes(S))) return !0;
|
|
12100
12100
|
} else if (E.customType === "radio_group" && E.blockingValues.includes(k))
|
|
@@ -12107,13 +12107,13 @@ const Qa = {
|
|
|
12107
12107
|
if (E.isCustom) {
|
|
12108
12108
|
if (E.customType === "paragraph" || E.customType === "html" || E.customType === "br" || E.customType === "link") continue;
|
|
12109
12109
|
if (E.required && E.paramName) {
|
|
12110
|
-
const k =
|
|
12110
|
+
const k = te[E.paramName], v = oe(E.displayText, p) || oe(E.label, p) || E.paramName;
|
|
12111
12111
|
E.customType === "checkbox" || E.customType === "link_checkbox" ? k !== "true" && (j[E.paramName] = p("validation.fieldRequired", { field: v })) : (!k || k.trim() === "") && (j[E.paramName] = p("validation.fieldRequired", { field: v }));
|
|
12112
12112
|
}
|
|
12113
12113
|
} else if (E.name) {
|
|
12114
12114
|
const k = E.name;
|
|
12115
|
-
if (D.includes(k) && St(
|
|
12116
|
-
const v = gt[k], S =
|
|
12115
|
+
if (D.includes(k) && St(se[k])) {
|
|
12116
|
+
const v = gt[k], S = oe(E.displayText, p) || (v != null && v.translationKey ? p(`fields.${v.translationKey}`) : void 0) || (v == null ? void 0 : v.label) || k;
|
|
12117
12117
|
j[k] = p("validation.fieldRequired", { field: S });
|
|
12118
12118
|
}
|
|
12119
12119
|
}
|
|
@@ -12123,54 +12123,54 @@ const Qa = {
|
|
|
12123
12123
|
const m = P[Se];
|
|
12124
12124
|
if (mt(m) || m.conditionalOn && m.conditionalMode === "block" && !Je(m)) return;
|
|
12125
12125
|
if (m.conditionalOn && !Je(m)) {
|
|
12126
|
-
|
|
12126
|
+
ie({}), rt >= 0 ? xe(rt) : await Y();
|
|
12127
12127
|
return;
|
|
12128
12128
|
}
|
|
12129
12129
|
const j = V(m);
|
|
12130
12130
|
if (Object.keys(j).length > 0) {
|
|
12131
|
-
|
|
12131
|
+
ie(j);
|
|
12132
12132
|
return;
|
|
12133
12133
|
}
|
|
12134
|
-
|
|
12134
|
+
ie({}), rt >= 0 ? xe(rt) : await Y();
|
|
12135
12135
|
}, Y = async () => {
|
|
12136
12136
|
if (P) {
|
|
12137
12137
|
let m = {};
|
|
12138
12138
|
for (const j of P)
|
|
12139
12139
|
Je(j) && (m = { ...m, ...V(j) });
|
|
12140
12140
|
if (Object.keys(m).length > 0) {
|
|
12141
|
-
|
|
12141
|
+
ie(m);
|
|
12142
12142
|
return;
|
|
12143
12143
|
}
|
|
12144
12144
|
}
|
|
12145
12145
|
it(!0), Ce(null);
|
|
12146
12146
|
try {
|
|
12147
|
-
if (!
|
|
12147
|
+
if (!se.externalRefId || se.externalRefId.trim() === "") {
|
|
12148
12148
|
Ce(p("createApplicant.externalRefIdRequired"));
|
|
12149
12149
|
return;
|
|
12150
12150
|
}
|
|
12151
12151
|
const m = {
|
|
12152
12152
|
...a ? { applicantId: a } : {},
|
|
12153
|
-
workflowKey:
|
|
12154
|
-
externalRefId:
|
|
12153
|
+
workflowKey: se.workflowKey,
|
|
12154
|
+
externalRefId: se.externalRefId.trim()
|
|
12155
12155
|
};
|
|
12156
12156
|
if (P) {
|
|
12157
12157
|
for (const v of P)
|
|
12158
12158
|
if (Je(v)) {
|
|
12159
12159
|
for (const S of v.fields)
|
|
12160
12160
|
if (!S.isCustom && S.name) {
|
|
12161
|
-
const ge = S.name, pe =
|
|
12161
|
+
const ge = S.name, pe = se[ge];
|
|
12162
12162
|
St(pe) || (m[ge] = pe);
|
|
12163
12163
|
}
|
|
12164
12164
|
}
|
|
12165
12165
|
for (const v of zt)
|
|
12166
12166
|
if (m[v] === void 0) {
|
|
12167
|
-
const S =
|
|
12167
|
+
const S = se[v];
|
|
12168
12168
|
St(S) || (m[v] = S);
|
|
12169
12169
|
}
|
|
12170
12170
|
} else
|
|
12171
12171
|
B.forEach((v) => {
|
|
12172
12172
|
if (v === "externalRefId") return;
|
|
12173
|
-
const S =
|
|
12173
|
+
const S = se[v];
|
|
12174
12174
|
St(S) || (m[v] = S);
|
|
12175
12175
|
});
|
|
12176
12176
|
const j = [];
|
|
@@ -12179,7 +12179,7 @@ const Qa = {
|
|
|
12179
12179
|
if (Je(v))
|
|
12180
12180
|
for (const S of v.fields) {
|
|
12181
12181
|
if (!S.isCustom || !S.paramName || S.customType === "paragraph" || S.customType === "html" || S.customType === "br" || S.customType === "link") continue;
|
|
12182
|
-
const ge =
|
|
12182
|
+
const ge = te[S.paramName] ?? "";
|
|
12183
12183
|
let pe;
|
|
12184
12184
|
if (S.customType === "checkbox" || S.customType === "link_checkbox")
|
|
12185
12185
|
pe = ge === "true" ? "yes" : "no";
|
|
@@ -12203,7 +12203,7 @@ const Qa = {
|
|
|
12203
12203
|
}, ye = async (m) => {
|
|
12204
12204
|
m.preventDefault();
|
|
12205
12205
|
for (const j of D)
|
|
12206
|
-
if (St(
|
|
12206
|
+
if (St(se[j])) {
|
|
12207
12207
|
const E = gt[j], k = (E != null && E.translationKey ? p(`fields.${E.translationKey}`) : void 0) || (E == null ? void 0 : E.label) || j;
|
|
12208
12208
|
Ce(p("validation.fieldRequired", { field: k }));
|
|
12209
12209
|
return;
|
|
@@ -12213,17 +12213,17 @@ const Qa = {
|
|
|
12213
12213
|
var Xt;
|
|
12214
12214
|
const S = gt[m];
|
|
12215
12215
|
if (!S) return null;
|
|
12216
|
-
const ge = D.includes(m), pe = q[m], Ve =
|
|
12216
|
+
const ge = D.includes(m), pe = q[m], Ve = oe(E, p) || (S.translationKey ? p(`fields.${S.translationKey}`) : void 0) || S.label, Be = m in De, Ae = j ?? m, Qe = { required: ge }, nt = v ? v !== "placeholder" : U, ut = nt ? Ve : void 0;
|
|
12217
12217
|
switch (S.type) {
|
|
12218
12218
|
case "select":
|
|
12219
12219
|
if (m === "country" || m === "nationality" || m === "taxCountry" || m === "countryOfBirth" || m === "mobileCountryCode") {
|
|
12220
|
-
const Ue =
|
|
12220
|
+
const Ue = re(m, k);
|
|
12221
12221
|
return /* @__PURE__ */ i(
|
|
12222
12222
|
ct,
|
|
12223
12223
|
{
|
|
12224
12224
|
...Qe,
|
|
12225
12225
|
label: ut,
|
|
12226
|
-
value:
|
|
12226
|
+
value: se[m] || "",
|
|
12227
12227
|
onChange: (ht) => Ze(m, ht),
|
|
12228
12228
|
options: [{ value: "", label: nt ? p("placeholders.selectCountry") : Ve }, ...Ue],
|
|
12229
12229
|
disabled: M,
|
|
@@ -12239,7 +12239,7 @@ const Qa = {
|
|
|
12239
12239
|
{
|
|
12240
12240
|
...Qe,
|
|
12241
12241
|
label: ut,
|
|
12242
|
-
value: ((Xt =
|
|
12242
|
+
value: ((Xt = se[m]) == null ? void 0 : Xt.toString()) || "",
|
|
12243
12243
|
onChange: (Ue) => Ze(m, Ue ? Number(Ue) : null),
|
|
12244
12244
|
options: [
|
|
12245
12245
|
{ value: "", label: nt ? p("placeholders.selectSalutation") : Ve },
|
|
@@ -12259,7 +12259,7 @@ const Qa = {
|
|
|
12259
12259
|
{
|
|
12260
12260
|
...Qe,
|
|
12261
12261
|
label: ut,
|
|
12262
|
-
value:
|
|
12262
|
+
value: se[m] || "",
|
|
12263
12263
|
onChange: (ht) => Ze(m, ht),
|
|
12264
12264
|
options: [{ value: "", label: nt ? p("placeholders.selectLanguage") : Ve }, ...Ue],
|
|
12265
12265
|
readOnly: Be,
|
|
@@ -12271,13 +12271,13 @@ const Qa = {
|
|
|
12271
12271
|
return null;
|
|
12272
12272
|
case "multiselect":
|
|
12273
12273
|
if (m === "otherNationality") {
|
|
12274
|
-
const Ue =
|
|
12274
|
+
const Ue = re(m, k);
|
|
12275
12275
|
return /* @__PURE__ */ i(
|
|
12276
12276
|
ca,
|
|
12277
12277
|
{
|
|
12278
12278
|
...Qe,
|
|
12279
12279
|
label: ut,
|
|
12280
|
-
value:
|
|
12280
|
+
value: se[m] || [],
|
|
12281
12281
|
onChange: (ht) => Ze(m, ht),
|
|
12282
12282
|
options: Ue,
|
|
12283
12283
|
placeholder: nt ? p("placeholders.selectOtherNationalities") : Ve,
|
|
@@ -12296,7 +12296,7 @@ const Qa = {
|
|
|
12296
12296
|
type: "date",
|
|
12297
12297
|
label: ut,
|
|
12298
12298
|
placeholder: nt ? void 0 : Ve,
|
|
12299
|
-
value:
|
|
12299
|
+
value: se[m] || "",
|
|
12300
12300
|
onChange: (Ue) => Ze(m, Ue.target.value),
|
|
12301
12301
|
readOnly: Be,
|
|
12302
12302
|
error: pe
|
|
@@ -12311,7 +12311,7 @@ const Qa = {
|
|
|
12311
12311
|
type: "email",
|
|
12312
12312
|
label: ut,
|
|
12313
12313
|
placeholder: nt ? void 0 : Ve,
|
|
12314
|
-
value:
|
|
12314
|
+
value: se[m] || "",
|
|
12315
12315
|
onChange: (Ue) => Ze(m, Ue.target.value),
|
|
12316
12316
|
readOnly: Be,
|
|
12317
12317
|
error: pe
|
|
@@ -12326,7 +12326,7 @@ const Qa = {
|
|
|
12326
12326
|
type: "tel",
|
|
12327
12327
|
label: ut,
|
|
12328
12328
|
placeholder: nt ? void 0 : Ve,
|
|
12329
|
-
value:
|
|
12329
|
+
value: se[m] || "",
|
|
12330
12330
|
onChange: (Ue) => Ze(m, Ue.target.value),
|
|
12331
12331
|
readOnly: Be,
|
|
12332
12332
|
error: pe
|
|
@@ -12341,7 +12341,7 @@ const Qa = {
|
|
|
12341
12341
|
type: "text",
|
|
12342
12342
|
label: ut,
|
|
12343
12343
|
placeholder: nt ? void 0 : Ve,
|
|
12344
|
-
value:
|
|
12344
|
+
value: se[m] || "",
|
|
12345
12345
|
onChange: (Ue) => Ze(m, Ue.target.value),
|
|
12346
12346
|
readOnly: Be,
|
|
12347
12347
|
error: pe
|
|
@@ -12352,7 +12352,7 @@ const Qa = {
|
|
|
12352
12352
|
}, Ie = (m, j) => {
|
|
12353
12353
|
const E = m.labelMode ? m.labelMode !== "placeholder" : U;
|
|
12354
12354
|
if (m.customType === "paragraph") {
|
|
12355
|
-
const S =
|
|
12355
|
+
const S = oe(m.displayText, p) || oe(m.label, p) || "";
|
|
12356
12356
|
return /* @__PURE__ */ i(
|
|
12357
12357
|
"p",
|
|
12358
12358
|
{
|
|
@@ -12372,14 +12372,14 @@ const Qa = {
|
|
|
12372
12372
|
return /* @__PURE__ */ i(
|
|
12373
12373
|
"div",
|
|
12374
12374
|
{
|
|
12375
|
-
dangerouslySetInnerHTML: { __html:
|
|
12375
|
+
dangerouslySetInnerHTML: { __html: oe(m.label, p) || "" }
|
|
12376
12376
|
},
|
|
12377
12377
|
`custom-${j}`
|
|
12378
12378
|
);
|
|
12379
12379
|
if (m.customType === "br")
|
|
12380
12380
|
return /* @__PURE__ */ i("div", { style: { height: "12px" } }, `custom-${j}`);
|
|
12381
12381
|
if (m.customType === "link") {
|
|
12382
|
-
const S =
|
|
12382
|
+
const S = oe(m.displayText, p) || oe(m.label, p) || m.linkText || m.linkUrl || "";
|
|
12383
12383
|
return /* @__PURE__ */ i("div", { className: "metakyc-link-field", children: /* @__PURE__ */ s(
|
|
12384
12384
|
"a",
|
|
12385
12385
|
{
|
|
@@ -12403,9 +12403,9 @@ const Qa = {
|
|
|
12403
12403
|
) }, `custom-${j}`);
|
|
12404
12404
|
}
|
|
12405
12405
|
if (!m.paramName) return null;
|
|
12406
|
-
const k = q[m.paramName], v =
|
|
12406
|
+
const k = q[m.paramName], v = oe(m.displayText, p) || oe(m.label, p) || m.paramName;
|
|
12407
12407
|
if (m.customType === "checkbox") {
|
|
12408
|
-
const S =
|
|
12408
|
+
const S = te[m.paramName] === "true";
|
|
12409
12409
|
return /* @__PURE__ */ s("div", { className: "flex flex-col gap-1", children: [
|
|
12410
12410
|
/* @__PURE__ */ s(
|
|
12411
12411
|
"div",
|
|
@@ -12441,7 +12441,7 @@ const Qa = {
|
|
|
12441
12441
|
] }, `custom-${j}`);
|
|
12442
12442
|
}
|
|
12443
12443
|
if (m.customType === "link_checkbox") {
|
|
12444
|
-
const S =
|
|
12444
|
+
const S = te[m.paramName] === "true";
|
|
12445
12445
|
return /* @__PURE__ */ s("div", { className: "flex flex-col gap-1", children: [
|
|
12446
12446
|
/* @__PURE__ */ s(
|
|
12447
12447
|
"div",
|
|
@@ -12490,7 +12490,7 @@ const Qa = {
|
|
|
12490
12490
|
] }, `custom-${j}`);
|
|
12491
12491
|
}
|
|
12492
12492
|
if (m.customType === "group_checkbox") {
|
|
12493
|
-
const S = (
|
|
12493
|
+
const S = (te[m.paramName] || "").split(",").filter(Boolean);
|
|
12494
12494
|
return /* @__PURE__ */ s("div", { className: "flex flex-col gap-1.5", children: [
|
|
12495
12495
|
E && /* @__PURE__ */ s(
|
|
12496
12496
|
"div",
|
|
@@ -12504,7 +12504,7 @@ const Qa = {
|
|
|
12504
12504
|
}
|
|
12505
12505
|
),
|
|
12506
12506
|
/* @__PURE__ */ i("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (m.options || []).map((ge) => {
|
|
12507
|
-
const pe = m.singleSelect ?
|
|
12507
|
+
const pe = m.singleSelect ? te[m.paramName] === ge.value : S.includes(ge.value), Ve = () => {
|
|
12508
12508
|
if (m.singleSelect)
|
|
12509
12509
|
Pe(m.paramName, pe ? "" : ge.value);
|
|
12510
12510
|
else {
|
|
@@ -12559,7 +12559,7 @@ const Qa = {
|
|
|
12559
12559
|
"input",
|
|
12560
12560
|
{
|
|
12561
12561
|
type: "radio",
|
|
12562
|
-
checked:
|
|
12562
|
+
checked: te[m.paramName] === S.value,
|
|
12563
12563
|
onChange: () => Pe(m.paramName, S.value),
|
|
12564
12564
|
name: `radio-group-${m.paramName}-${j}`,
|
|
12565
12565
|
className: "metakyc-option-input",
|
|
@@ -12586,7 +12586,7 @@ const Qa = {
|
|
|
12586
12586
|
type: "text",
|
|
12587
12587
|
label: E ? `${v}${m.required ? " *" : ""}` : void 0,
|
|
12588
12588
|
placeholder: E ? void 0 : v,
|
|
12589
|
-
value:
|
|
12589
|
+
value: te[m.paramName] || "",
|
|
12590
12590
|
onChange: (S) => Pe(m.paramName, S.target.value),
|
|
12591
12591
|
required: m.required,
|
|
12592
12592
|
error: k
|
|
@@ -12617,7 +12617,7 @@ const Qa = {
|
|
|
12617
12617
|
{
|
|
12618
12618
|
className: "metakyc-option-text",
|
|
12619
12619
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", fontWeight: 500 },
|
|
12620
|
-
children:
|
|
12620
|
+
children: oe(m.conditionalLabel, p) || m.conditionalOn
|
|
12621
12621
|
}
|
|
12622
12622
|
)
|
|
12623
12623
|
]
|
|
@@ -12635,7 +12635,7 @@ const Qa = {
|
|
|
12635
12635
|
/* @__PURE__ */ i("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: p("common.loadingForm") })
|
|
12636
12636
|
] }) }) });
|
|
12637
12637
|
if (P) {
|
|
12638
|
-
const m = P[Se] ?? P[0], j = b === -1, E = rt === -1, k = P.length, v = Je(m), S = mt(m), ge = Object.values(q), pe = !v && !!m.conditionalOn && m.conditionalMode === "block", Ve = qe ||
|
|
12638
|
+
const m = P[Se] ?? P[0], j = b === -1, E = rt === -1, k = P.length, v = Je(m), S = mt(m), ge = Object.values(q), pe = !v && !!m.conditionalOn && m.conditionalMode === "block", Ve = qe || g || pe || S;
|
|
12639
12639
|
let Be;
|
|
12640
12640
|
return pe || S ? Be = p("common.blocked") : E ? Be = m.conditionalOn && !v ? p("common.skipAndSubmit") : p("common.submit") : Be = m.conditionalOn && !v ? p("common.skip") : p("common.next"), /* @__PURE__ */ i("div", { className: "metakyc-sdk", children: /* @__PURE__ */ s(me, { children: [
|
|
12641
12641
|
/* @__PURE__ */ i(Fe, { children: /* @__PURE__ */ i(Tt, { title: (c == null ? void 0 : c.title) || p("createApplicant.title") }) }),
|
|
@@ -12646,7 +12646,7 @@ const Qa = {
|
|
|
12646
12646
|
{
|
|
12647
12647
|
className: "font-semibold text-base",
|
|
12648
12648
|
style: { color: "var(--metakyc-text-primary, #111827)" },
|
|
12649
|
-
children:
|
|
12649
|
+
children: oe(m.title, p)
|
|
12650
12650
|
}
|
|
12651
12651
|
),
|
|
12652
12652
|
m.subtitle && /* @__PURE__ */ i(
|
|
@@ -12654,7 +12654,7 @@ const Qa = {
|
|
|
12654
12654
|
{
|
|
12655
12655
|
className: "text-sm mt-0.5",
|
|
12656
12656
|
style: { color: "var(--metakyc-text-secondary, #6b7280)" },
|
|
12657
|
-
children:
|
|
12657
|
+
children: oe(m.subtitle, p)
|
|
12658
12658
|
}
|
|
12659
12659
|
),
|
|
12660
12660
|
m.description && m.description !== m.subtitle && /* @__PURE__ */ i(
|
|
@@ -12662,7 +12662,7 @@ const Qa = {
|
|
|
12662
12662
|
{
|
|
12663
12663
|
className: "text-xs mt-1",
|
|
12664
12664
|
style: { color: "var(--metakyc-text-secondary, #6b7280)" },
|
|
12665
|
-
children:
|
|
12665
|
+
children: oe(m.description, p)
|
|
12666
12666
|
}
|
|
12667
12667
|
)
|
|
12668
12668
|
] }),
|
|
@@ -12706,19 +12706,19 @@ const Qa = {
|
|
|
12706
12706
|
type: "button",
|
|
12707
12707
|
variant: "outline",
|
|
12708
12708
|
onClick: () => {
|
|
12709
|
-
xe(b),
|
|
12709
|
+
xe(b), ie({});
|
|
12710
12710
|
},
|
|
12711
|
-
disabled: qe ||
|
|
12711
|
+
disabled: qe || g,
|
|
12712
12712
|
children: p("common.previous")
|
|
12713
12713
|
}
|
|
12714
12714
|
),
|
|
12715
|
-
j && n && /* @__PURE__ */ i(le, { type: "button", variant: "outline", onClick: n, disabled: qe ||
|
|
12715
|
+
j && n && /* @__PURE__ */ i(le, { type: "button", variant: "outline", onClick: n, disabled: qe || g, children: "Cancel" })
|
|
12716
12716
|
] }),
|
|
12717
12717
|
/* @__PURE__ */ i(
|
|
12718
12718
|
le,
|
|
12719
12719
|
{
|
|
12720
12720
|
type: "button",
|
|
12721
|
-
isLoading: qe ||
|
|
12721
|
+
isLoading: qe || g,
|
|
12722
12722
|
disabled: Ve,
|
|
12723
12723
|
onClick: E ? Y : J,
|
|
12724
12724
|
children: Be
|
|
@@ -12741,8 +12741,8 @@ const Qa = {
|
|
|
12741
12741
|
/* @__PURE__ */ i("div", { className: "metakyc-form-grid", children: B.map((m) => /* @__PURE__ */ i("div", { style: { gridColumn: "span 4 / span 4" }, children: ke(m) }, m)) })
|
|
12742
12742
|
] }),
|
|
12743
12743
|
/* @__PURE__ */ s(Oe, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
12744
|
-
n && /* @__PURE__ */ i(le, { type: "button", variant: "outline", onClick: n, disabled: qe ||
|
|
12745
|
-
/* @__PURE__ */ i(le, { type: "submit", isLoading: qe ||
|
|
12744
|
+
n && /* @__PURE__ */ i(le, { type: "button", variant: "outline", onClick: n, disabled: qe || g, children: "Cancel" }),
|
|
12745
|
+
/* @__PURE__ */ i(le, { type: "submit", isLoading: qe || g, children: p("createApplicant.createApplicant") })
|
|
12746
12746
|
] })
|
|
12747
12747
|
] }) }) });
|
|
12748
12748
|
}, yi = ["companyName", "email"];
|
|
@@ -12756,8 +12756,8 @@ const Za = ({
|
|
|
12756
12756
|
onCancel: r
|
|
12757
12757
|
}) => {
|
|
12758
12758
|
var V, J, Y, ye, ke, Ie;
|
|
12759
|
-
const { config: n, baseInformationService: o, currentTheme: l } = Ee(), { createCompanyApplicant: c, isLoading: d } = Ci(), { t: u } = je(),
|
|
12760
|
-
if (!
|
|
12759
|
+
const { config: n, baseInformationService: o, currentTheme: l } = Ee(), { createCompanyApplicant: c, isLoading: d } = Ci(), { t: u } = je(), g = e || ((V = n.applicantForm) == null ? void 0 : V.workflowKey);
|
|
12760
|
+
if (!g)
|
|
12761
12761
|
throw new Error(
|
|
12762
12762
|
"workflowKey is required. Provide it either as a prop to CreateCompanyApplicantForm or set it in config.applicantForm.workflowKey"
|
|
12763
12763
|
);
|
|
@@ -12765,8 +12765,8 @@ const Za = ({
|
|
|
12765
12765
|
() => l != null && l.companyFormPages && l.companyFormPages.length > 0 ? l.companyFormPages : null,
|
|
12766
12766
|
[l == null ? void 0 : l.companyFormPages]
|
|
12767
12767
|
), $ = Ye(() => {
|
|
12768
|
-
const y = new Set(yi),
|
|
12769
|
-
if (
|
|
12768
|
+
const y = new Set(yi), f = l == null ? void 0 : l.companyFormRequiredFields;
|
|
12769
|
+
if (f) for (const I of f) y.add(I);
|
|
12770
12770
|
if (T)
|
|
12771
12771
|
for (const I of T)
|
|
12772
12772
|
for (const A of I.fields)
|
|
@@ -12775,18 +12775,18 @@ const Za = ({
|
|
|
12775
12775
|
}, [l == null ? void 0 : l.companyFormRequiredFields, T]), U = Ye(() => {
|
|
12776
12776
|
var y;
|
|
12777
12777
|
if (T) {
|
|
12778
|
-
const
|
|
12778
|
+
const f = T.flatMap((A) => A.fields).filter((A) => !A.isCustom && A.name).map((A) => A.name), I = new Set(f);
|
|
12779
12779
|
for (const A of yi) I.add(A);
|
|
12780
12780
|
return Array.from(I);
|
|
12781
12781
|
}
|
|
12782
12782
|
return (y = n.applicantForm) != null && y.visibleFields ? n.applicantForm.visibleFields : l != null && l.companyFormVisibleFields && l.companyFormVisibleFields.length > 0 ? l.companyFormVisibleFields : _i;
|
|
12783
12783
|
}, [(Ie = n.applicantForm) == null ? void 0 : Ie.visibleFields, l == null ? void 0 : l.companyFormVisibleFields, T]), P = /* @__PURE__ */ new Set(["countryResidence", "addressCountry"]), D = Ye(() => {
|
|
12784
|
-
var
|
|
12784
|
+
var f, I;
|
|
12785
12785
|
const y = /* @__PURE__ */ new Set();
|
|
12786
12786
|
if (T)
|
|
12787
12787
|
for (const A of T)
|
|
12788
12788
|
for (const K of A.fields)
|
|
12789
|
-
!K.isCustom && K.name && P.has(K.name) && y.add(K.countriesType ?? ((
|
|
12789
|
+
!K.isCustom && K.name && P.has(K.name) && y.add(K.countriesType ?? ((f = vt[K.name]) == null ? void 0 : f.countriesType));
|
|
12790
12790
|
else
|
|
12791
12791
|
for (const A of U)
|
|
12792
12792
|
P.has(A) && y.add((I = vt[A]) == null ? void 0 : I.countriesType);
|
|
@@ -12803,28 +12803,28 @@ const Za = ({
|
|
|
12803
12803
|
return;
|
|
12804
12804
|
}
|
|
12805
12805
|
h(!0);
|
|
12806
|
-
const
|
|
12807
|
-
|
|
12806
|
+
const f = y.map((A) => A != null ? String(A) : "all");
|
|
12807
|
+
f.forEach((A) => L.current.add(A)), (async () => {
|
|
12808
12808
|
try {
|
|
12809
12809
|
const A = await Promise.all(
|
|
12810
12810
|
y.map(async (K) => {
|
|
12811
|
-
const X = K != null ? String(K) : "all",
|
|
12811
|
+
const X = K != null ? String(K) : "all", ne = await o.getCountries("", n.locale || "en", K), ve = /* @__PURE__ */ new Set(), m = ne.map((j) => ({ value: j.abbreviation3 || j.abbreviation, label: j.name })).filter((j) => !j.value || ve.has(j.value) ? !1 : (ve.add(j.value), !0));
|
|
12812
12812
|
return M.current.add(X), L.current.delete(X), [X, m];
|
|
12813
12813
|
})
|
|
12814
12814
|
);
|
|
12815
12815
|
_((K) => ({ ...K, ...Object.fromEntries(A) }));
|
|
12816
12816
|
} catch (A) {
|
|
12817
|
-
|
|
12817
|
+
f.forEach((K) => L.current.delete(K)), console.error("Failed to load countries:", A);
|
|
12818
12818
|
} finally {
|
|
12819
12819
|
D.every((K) => M.current.has(K != null ? String(K) : "all")) && h(!1);
|
|
12820
12820
|
}
|
|
12821
12821
|
})();
|
|
12822
12822
|
}, [D, l]);
|
|
12823
|
-
const Z = (y,
|
|
12823
|
+
const Z = (y, f) => {
|
|
12824
12824
|
var K;
|
|
12825
|
-
const I =
|
|
12825
|
+
const I = f ?? ((K = vt[y]) == null ? void 0 : K.countriesType), A = I != null ? String(I) : "all";
|
|
12826
12826
|
return B[A] || [];
|
|
12827
|
-
},
|
|
12827
|
+
}, ae = {
|
|
12828
12828
|
companyName: 1,
|
|
12829
12829
|
registrationNumber: 1,
|
|
12830
12830
|
email: 1,
|
|
@@ -12845,9 +12845,9 @@ const Za = ({
|
|
|
12845
12845
|
addressCountry: 1,
|
|
12846
12846
|
lei: 1
|
|
12847
12847
|
}, W = Object.fromEntries(
|
|
12848
|
-
Object.entries(N).filter(([y]) => y in
|
|
12849
|
-
), [
|
|
12850
|
-
workflowKey:
|
|
12848
|
+
Object.entries(N).filter(([y]) => y in ae)
|
|
12849
|
+
), [re, he] = w({
|
|
12850
|
+
workflowKey: g,
|
|
12851
12851
|
companyName: "",
|
|
12852
12852
|
email: C,
|
|
12853
12853
|
phone: "",
|
|
@@ -12869,10 +12869,10 @@ const Za = ({
|
|
|
12869
12869
|
lei: "",
|
|
12870
12870
|
externalRefId: p,
|
|
12871
12871
|
...W
|
|
12872
|
-
}), [fe, De] = w({}), [
|
|
12873
|
-
const y = Ga(),
|
|
12874
|
-
var
|
|
12875
|
-
const A = (
|
|
12872
|
+
}), [fe, De] = w({}), [se, G] = w(0), [Q, te] = w({}), [z, R] = w(null), [O, Se] = w(!1), xe = It(), q = ee(() => {
|
|
12873
|
+
const y = Ga(), f = (I) => {
|
|
12874
|
+
var ne;
|
|
12875
|
+
const A = (ne = vt[I]) == null ? void 0 : ne.countriesType, K = A != null ? String(A) : "all", X = (B[K] || []).filter((ve) => ve.value);
|
|
12876
12876
|
if (X.length)
|
|
12877
12877
|
return X[Math.floor(Math.random() * X.length)].value;
|
|
12878
12878
|
};
|
|
@@ -12881,19 +12881,19 @@ const Za = ({
|
|
|
12881
12881
|
for (const [K, X] of Object.entries(y))
|
|
12882
12882
|
if (K in I && (I[K] === "" || I[K] === null || I[K] === void 0))
|
|
12883
12883
|
if (P.has(K)) {
|
|
12884
|
-
const
|
|
12885
|
-
|
|
12884
|
+
const ne = f(K);
|
|
12885
|
+
ne && (A[K] = ne);
|
|
12886
12886
|
} else
|
|
12887
12887
|
A[K] = X;
|
|
12888
12888
|
return A;
|
|
12889
12889
|
}), T && De((I) => {
|
|
12890
12890
|
var K, X;
|
|
12891
12891
|
const A = { ...I };
|
|
12892
|
-
for (const
|
|
12893
|
-
for (const ve of
|
|
12892
|
+
for (const ne of T)
|
|
12893
|
+
for (const ve of ne.fields)
|
|
12894
12894
|
!ve.isCustom || !ve.paramName || A[ve.paramName] || (ve.customType === "checkbox" || ve.customType === "link_checkbox" ? A[ve.paramName] = "true" : ve.customType === "radio_group" && ((K = ve.options) != null && K.length) || ve.customType === "group_checkbox" && ((X = ve.options) != null && X.length) ? A[ve.paramName] = ve.options[0].value : ve.customType === "text" && (A[ve.paramName] = "Sample value"));
|
|
12895
12895
|
return A;
|
|
12896
|
-
}),
|
|
12896
|
+
}), te({}), R(null);
|
|
12897
12897
|
}, [T, B]);
|
|
12898
12898
|
Ne(() => {
|
|
12899
12899
|
const y = xe.current;
|
|
@@ -12906,10 +12906,10 @@ const Za = ({
|
|
|
12906
12906
|
handler: q
|
|
12907
12907
|
}), () => y.unregisterAction("fill-company-form");
|
|
12908
12908
|
}, [xe, q]);
|
|
12909
|
-
const
|
|
12910
|
-
var
|
|
12909
|
+
const ie = (y, f) => he((I) => ({ ...I, [y]: f })), Te = (y, f) => De((I) => ({ ...I, [y]: f })), Ce = (y) => !y.conditionalOn || fe[y.conditionalOn] === "true", qe = (y) => {
|
|
12910
|
+
var f;
|
|
12911
12911
|
for (const I of y.fields) {
|
|
12912
|
-
if (!I.isCustom || !I.paramName || !((
|
|
12912
|
+
if (!I.isCustom || !I.paramName || !((f = I.blockingValues) != null && f.length)) continue;
|
|
12913
12913
|
const A = fe[I.paramName] ?? "";
|
|
12914
12914
|
if (I.customType === "group_checkbox") {
|
|
12915
12915
|
if (A.split(",").filter(Boolean).some((X) => I.blockingValues.includes(X))) return !0;
|
|
@@ -12917,84 +12917,84 @@ const Za = ({
|
|
|
12917
12917
|
return !0;
|
|
12918
12918
|
}
|
|
12919
12919
|
return !1;
|
|
12920
|
-
}, it = T &&
|
|
12921
|
-
const
|
|
12920
|
+
}, it = T && se < T.length - 1 ? se + 1 : -1, _e = T && se > 0 ? se - 1 : -1, yt = (y) => {
|
|
12921
|
+
const f = {};
|
|
12922
12922
|
for (const I of y.fields)
|
|
12923
12923
|
if (I.isCustom) {
|
|
12924
12924
|
if (I.customType === "paragraph" || I.customType === "html" || I.customType === "br" || I.customType === "link") continue;
|
|
12925
12925
|
if (I.required && I.paramName) {
|
|
12926
|
-
const A = fe[I.paramName], K =
|
|
12927
|
-
I.customType === "checkbox" || I.customType === "link_checkbox" ? A !== "true" && (
|
|
12926
|
+
const A = fe[I.paramName], K = oe(I.displayText, u) || oe(I.label, u) || I.paramName;
|
|
12927
|
+
I.customType === "checkbox" || I.customType === "link_checkbox" ? A !== "true" && (f[I.paramName] = u("validation.fieldRequired", { field: K })) : (!A || A.trim() === "") && (f[I.paramName] = u("validation.fieldRequired", { field: K }));
|
|
12928
12928
|
}
|
|
12929
12929
|
} else if (I.name) {
|
|
12930
12930
|
const A = I.name;
|
|
12931
|
-
if ($.includes(A) && qt(
|
|
12932
|
-
const K = vt[A], X =
|
|
12933
|
-
|
|
12931
|
+
if ($.includes(A) && qt(re[A])) {
|
|
12932
|
+
const K = vt[A], X = oe(I.displayText, u) || (K != null && K.translationKey ? u(`fields.${K.translationKey}`) : void 0) || (K == null ? void 0 : K.label) || A;
|
|
12933
|
+
f[A] = u("validation.fieldRequired", { field: X });
|
|
12934
12934
|
}
|
|
12935
12935
|
}
|
|
12936
|
-
return
|
|
12936
|
+
return f;
|
|
12937
12937
|
}, Ze = async () => {
|
|
12938
12938
|
if (!T) return;
|
|
12939
|
-
const y = T[
|
|
12939
|
+
const y = T[se];
|
|
12940
12940
|
if (qe(y) || y.conditionalOn && y.conditionalMode === "block" && !Ce(y)) return;
|
|
12941
12941
|
if (y.conditionalOn && !Ce(y)) {
|
|
12942
|
-
|
|
12942
|
+
te({}), it >= 0 ? G(it) : await Pe();
|
|
12943
12943
|
return;
|
|
12944
12944
|
}
|
|
12945
|
-
const
|
|
12946
|
-
if (Object.keys(
|
|
12947
|
-
|
|
12945
|
+
const f = yt(y);
|
|
12946
|
+
if (Object.keys(f).length > 0) {
|
|
12947
|
+
te(f);
|
|
12948
12948
|
return;
|
|
12949
12949
|
}
|
|
12950
|
-
|
|
12950
|
+
te({}), it >= 0 ? G(it) : await Pe();
|
|
12951
12951
|
}, Pe = async () => {
|
|
12952
12952
|
var y;
|
|
12953
12953
|
if (T) {
|
|
12954
|
-
let
|
|
12954
|
+
let f = {};
|
|
12955
12955
|
for (const I of T)
|
|
12956
|
-
Ce(I) && (
|
|
12957
|
-
if (Object.keys(
|
|
12958
|
-
|
|
12956
|
+
Ce(I) && (f = { ...f, ...yt(I) });
|
|
12957
|
+
if (Object.keys(f).length > 0) {
|
|
12958
|
+
te(f);
|
|
12959
12959
|
return;
|
|
12960
12960
|
}
|
|
12961
12961
|
}
|
|
12962
12962
|
Se(!0), R(null);
|
|
12963
12963
|
try {
|
|
12964
|
-
const
|
|
12965
|
-
workflowKey:
|
|
12966
|
-
externalRefId: ((y =
|
|
12964
|
+
const f = {
|
|
12965
|
+
workflowKey: re.workflowKey,
|
|
12966
|
+
externalRefId: ((y = re.externalRefId) == null ? void 0 : y.trim()) || void 0
|
|
12967
12967
|
}, I = T ? T.filter((X) => Ce(X)).flatMap((X) => X.fields).filter((X) => !X.isCustom && X.name).map((X) => X.name) : U;
|
|
12968
12968
|
for (const X of I) {
|
|
12969
|
-
const
|
|
12970
|
-
if (!qt(
|
|
12969
|
+
const ne = re[X];
|
|
12970
|
+
if (!qt(ne))
|
|
12971
12971
|
switch (X) {
|
|
12972
12972
|
case "companyName":
|
|
12973
|
-
|
|
12973
|
+
f.companyName = ne;
|
|
12974
12974
|
break;
|
|
12975
12975
|
case "email":
|
|
12976
|
-
|
|
12976
|
+
f.companyEmail = ne;
|
|
12977
12977
|
break;
|
|
12978
12978
|
case "phone":
|
|
12979
|
-
|
|
12979
|
+
f.companyPhone = ne;
|
|
12980
12980
|
break;
|
|
12981
12981
|
case "registrationNumber":
|
|
12982
|
-
|
|
12982
|
+
f.companyRegistrationNumber = ne;
|
|
12983
12983
|
break;
|
|
12984
12984
|
case "countryResidence":
|
|
12985
|
-
|
|
12985
|
+
f.companyCountry = ne;
|
|
12986
12986
|
break;
|
|
12987
12987
|
case "city":
|
|
12988
|
-
|
|
12988
|
+
f.companyCity = ne;
|
|
12989
12989
|
break;
|
|
12990
12990
|
case "street":
|
|
12991
|
-
|
|
12991
|
+
f.companyStreet = ne;
|
|
12992
12992
|
break;
|
|
12993
12993
|
case "postalCode":
|
|
12994
|
-
|
|
12994
|
+
f.companyZip = ne;
|
|
12995
12995
|
break;
|
|
12996
12996
|
default:
|
|
12997
|
-
|
|
12997
|
+
f[X] = ne;
|
|
12998
12998
|
break;
|
|
12999
12999
|
}
|
|
13000
13000
|
}
|
|
@@ -13002,37 +13002,37 @@ const Za = ({
|
|
|
13002
13002
|
if (T) {
|
|
13003
13003
|
for (const X of T)
|
|
13004
13004
|
if (Ce(X))
|
|
13005
|
-
for (const
|
|
13006
|
-
if (!
|
|
13007
|
-
const ve = fe[
|
|
13005
|
+
for (const ne of X.fields) {
|
|
13006
|
+
if (!ne.isCustom || !ne.paramName || ne.customType === "paragraph" || ne.customType === "html" || ne.customType === "br" || ne.customType === "link") continue;
|
|
13007
|
+
const ve = fe[ne.paramName] ?? "";
|
|
13008
13008
|
let m;
|
|
13009
|
-
if (
|
|
13009
|
+
if (ne.customType === "checkbox" || ne.customType === "link_checkbox")
|
|
13010
13010
|
m = ve === "true" ? "yes" : "no";
|
|
13011
|
-
else if (m = ve, !m && !
|
|
13012
|
-
A.push({ paramName:
|
|
13011
|
+
else if (m = ve, !m && !ne.required) continue;
|
|
13012
|
+
A.push({ paramName: ne.paramName, value: m });
|
|
13013
13013
|
}
|
|
13014
13014
|
}
|
|
13015
|
-
A.length > 0 && (
|
|
13016
|
-
const K = await c(
|
|
13015
|
+
A.length > 0 && (f.applicantAdditionalDatas = A);
|
|
13016
|
+
const K = await c(f);
|
|
13017
13017
|
a(K.applicantId);
|
|
13018
|
-
} catch (
|
|
13019
|
-
console.error("Error creating company applicant:",
|
|
13018
|
+
} catch (f) {
|
|
13019
|
+
console.error("Error creating company applicant:", f), R(f.message || u("createCompany.failedToCreate"));
|
|
13020
13020
|
} finally {
|
|
13021
13021
|
Se(!1);
|
|
13022
13022
|
}
|
|
13023
13023
|
}, Je = async (y) => {
|
|
13024
13024
|
y.preventDefault();
|
|
13025
|
-
for (const
|
|
13026
|
-
if (qt(
|
|
13027
|
-
const I = vt[
|
|
13025
|
+
for (const f of $)
|
|
13026
|
+
if (qt(re[f])) {
|
|
13027
|
+
const I = vt[f], A = (I != null && I.translationKey ? u(`fields.${I.translationKey}`) : void 0) || (I == null ? void 0 : I.label) || f;
|
|
13028
13028
|
R(u("validation.fieldRequired", { field: A }));
|
|
13029
13029
|
return;
|
|
13030
13030
|
}
|
|
13031
13031
|
await Pe();
|
|
13032
|
-
}, mt = (y,
|
|
13032
|
+
}, mt = (y, f, I, A, K) => {
|
|
13033
13033
|
const X = vt[y];
|
|
13034
13034
|
if (!X) return null;
|
|
13035
|
-
const
|
|
13035
|
+
const ne = $.includes(y), ve = Q[y], m = oe(I, u) || (X.translationKey ? u(`fields.${X.translationKey}`) : void 0) || X.label, j = y in W, E = f ?? y, k = K ? K !== "placeholder" : F, v = k ? m : void 0;
|
|
13036
13036
|
switch (X.type) {
|
|
13037
13037
|
case "select":
|
|
13038
13038
|
if (y === "countryResidence" || y === "addressCountry") {
|
|
@@ -13040,10 +13040,10 @@ const Za = ({
|
|
|
13040
13040
|
return /* @__PURE__ */ i(
|
|
13041
13041
|
ct,
|
|
13042
13042
|
{
|
|
13043
|
-
required:
|
|
13043
|
+
required: ne,
|
|
13044
13044
|
label: v,
|
|
13045
|
-
value:
|
|
13046
|
-
onChange: (ge) =>
|
|
13045
|
+
value: re[y] || "",
|
|
13046
|
+
onChange: (ge) => ie(y, ge),
|
|
13047
13047
|
options: [{ value: "", label: k ? u("placeholders.selectCountry") : m }, ...S],
|
|
13048
13048
|
disabled: ce,
|
|
13049
13049
|
readOnly: j,
|
|
@@ -13057,12 +13057,12 @@ const Za = ({
|
|
|
13057
13057
|
return /* @__PURE__ */ i(
|
|
13058
13058
|
Le,
|
|
13059
13059
|
{
|
|
13060
|
-
required:
|
|
13060
|
+
required: ne,
|
|
13061
13061
|
type: "date",
|
|
13062
13062
|
label: v,
|
|
13063
13063
|
placeholder: k ? void 0 : m,
|
|
13064
|
-
value:
|
|
13065
|
-
onChange: (S) =>
|
|
13064
|
+
value: re[y] || "",
|
|
13065
|
+
onChange: (S) => ie(y, S.target.value),
|
|
13066
13066
|
readOnly: j,
|
|
13067
13067
|
error: ve
|
|
13068
13068
|
},
|
|
@@ -13072,12 +13072,12 @@ const Za = ({
|
|
|
13072
13072
|
return /* @__PURE__ */ i(
|
|
13073
13073
|
Le,
|
|
13074
13074
|
{
|
|
13075
|
-
required:
|
|
13075
|
+
required: ne,
|
|
13076
13076
|
type: "email",
|
|
13077
13077
|
label: v,
|
|
13078
13078
|
placeholder: k ? void 0 : m,
|
|
13079
|
-
value:
|
|
13080
|
-
onChange: (S) =>
|
|
13079
|
+
value: re[y] || "",
|
|
13080
|
+
onChange: (S) => ie(y, S.target.value),
|
|
13081
13081
|
readOnly: j,
|
|
13082
13082
|
error: ve
|
|
13083
13083
|
},
|
|
@@ -13087,12 +13087,12 @@ const Za = ({
|
|
|
13087
13087
|
return /* @__PURE__ */ i(
|
|
13088
13088
|
Le,
|
|
13089
13089
|
{
|
|
13090
|
-
required:
|
|
13090
|
+
required: ne,
|
|
13091
13091
|
type: "tel",
|
|
13092
13092
|
label: v,
|
|
13093
13093
|
placeholder: k ? void 0 : m,
|
|
13094
|
-
value:
|
|
13095
|
-
onChange: (S) =>
|
|
13094
|
+
value: re[y] || "",
|
|
13095
|
+
onChange: (S) => ie(y, S.target.value),
|
|
13096
13096
|
readOnly: j,
|
|
13097
13097
|
error: ve
|
|
13098
13098
|
},
|
|
@@ -13102,32 +13102,32 @@ const Za = ({
|
|
|
13102
13102
|
return /* @__PURE__ */ i(
|
|
13103
13103
|
Le,
|
|
13104
13104
|
{
|
|
13105
|
-
required:
|
|
13105
|
+
required: ne,
|
|
13106
13106
|
type: "text",
|
|
13107
13107
|
label: v,
|
|
13108
13108
|
placeholder: k ? void 0 : m,
|
|
13109
|
-
value:
|
|
13110
|
-
onChange: (S) =>
|
|
13109
|
+
value: re[y] || "",
|
|
13110
|
+
onChange: (S) => ie(y, S.target.value),
|
|
13111
13111
|
readOnly: j,
|
|
13112
13112
|
error: ve
|
|
13113
13113
|
},
|
|
13114
13114
|
E
|
|
13115
13115
|
);
|
|
13116
13116
|
}
|
|
13117
|
-
}, rt = (y,
|
|
13117
|
+
}, rt = (y, f) => {
|
|
13118
13118
|
if (y.customType === "paragraph")
|
|
13119
13119
|
return /* @__PURE__ */ i(
|
|
13120
13120
|
"p",
|
|
13121
13121
|
{
|
|
13122
13122
|
style: { fontSize: "14px", lineHeight: "1.7", margin: 0, color: "var(--metakyc-text-secondary, #6b7280)" },
|
|
13123
|
-
dangerouslySetInnerHTML: { __html:
|
|
13123
|
+
dangerouslySetInnerHTML: { __html: oe(y.displayText, u) || oe(y.label, u) || "" }
|
|
13124
13124
|
},
|
|
13125
|
-
`custom-${
|
|
13125
|
+
`custom-${f}`
|
|
13126
13126
|
);
|
|
13127
13127
|
if (y.customType === "html")
|
|
13128
|
-
return /* @__PURE__ */ i("div", { dangerouslySetInnerHTML: { __html:
|
|
13128
|
+
return /* @__PURE__ */ i("div", { dangerouslySetInnerHTML: { __html: oe(y.label, u) || "" } }, `custom-${f}`);
|
|
13129
13129
|
if (y.customType === "br")
|
|
13130
|
-
return /* @__PURE__ */ i("div", { style: { height: "12px" } }, `custom-${
|
|
13130
|
+
return /* @__PURE__ */ i("div", { style: { height: "12px" } }, `custom-${f}`);
|
|
13131
13131
|
if (y.customType === "link")
|
|
13132
13132
|
return /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(
|
|
13133
13133
|
"a",
|
|
@@ -13136,11 +13136,11 @@ const Za = ({
|
|
|
13136
13136
|
target: "_blank",
|
|
13137
13137
|
rel: "noopener noreferrer",
|
|
13138
13138
|
style: { color: "var(--metakyc-primary, #2563eb)", fontSize: "14px", textDecoration: "underline" },
|
|
13139
|
-
children:
|
|
13139
|
+
children: oe(y.displayText, u) || oe(y.label, u) || y.linkText || y.linkUrl || ""
|
|
13140
13140
|
}
|
|
13141
|
-
) }, `custom-${
|
|
13141
|
+
) }, `custom-${f}`);
|
|
13142
13142
|
if (!y.paramName) return null;
|
|
13143
|
-
const I = Q[y.paramName], A =
|
|
13143
|
+
const I = Q[y.paramName], A = oe(y.displayText, u) || oe(y.label, u) || y.paramName, K = y.labelMode ? y.labelMode !== "placeholder" : F;
|
|
13144
13144
|
if (y.customType === "checkbox") {
|
|
13145
13145
|
const X = fe[y.paramName] === "true";
|
|
13146
13146
|
return /* @__PURE__ */ s("div", { className: "flex flex-col gap-1", children: [
|
|
@@ -13156,7 +13156,7 @@ const Za = ({
|
|
|
13156
13156
|
tt,
|
|
13157
13157
|
{
|
|
13158
13158
|
checked: X,
|
|
13159
|
-
onChange: (
|
|
13159
|
+
onChange: (ne) => Te(y.paramName, ne ? "true" : "false")
|
|
13160
13160
|
}
|
|
13161
13161
|
),
|
|
13162
13162
|
/* @__PURE__ */ s("span", { style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)" }, children: [
|
|
@@ -13167,7 +13167,7 @@ const Za = ({
|
|
|
13167
13167
|
}
|
|
13168
13168
|
),
|
|
13169
13169
|
I && /* @__PURE__ */ i("p", { className: "text-xs mt-0.5", style: { color: "var(--metakyc-danger, #ef4444)" }, children: I })
|
|
13170
|
-
] }, `custom-${
|
|
13170
|
+
] }, `custom-${f}`);
|
|
13171
13171
|
}
|
|
13172
13172
|
return /* @__PURE__ */ i(
|
|
13173
13173
|
Le,
|
|
@@ -13180,31 +13180,31 @@ const Za = ({
|
|
|
13180
13180
|
required: y.required,
|
|
13181
13181
|
error: I
|
|
13182
13182
|
},
|
|
13183
|
-
`custom-${
|
|
13183
|
+
`custom-${f}`
|
|
13184
13184
|
);
|
|
13185
13185
|
}, b = (y) => {
|
|
13186
|
-
const
|
|
13186
|
+
const f = Ce(y);
|
|
13187
13187
|
return /* @__PURE__ */ s("div", { className: "space-y-4", children: [
|
|
13188
13188
|
y.conditionalOn && /* @__PURE__ */ s(
|
|
13189
13189
|
"div",
|
|
13190
13190
|
{
|
|
13191
13191
|
role: "checkbox",
|
|
13192
|
-
"aria-checked":
|
|
13193
|
-
onClick: () => Te(y.conditionalOn,
|
|
13192
|
+
"aria-checked": f,
|
|
13193
|
+
onClick: () => Te(y.conditionalOn, f ? "false" : "true"),
|
|
13194
13194
|
style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer", userSelect: "none" },
|
|
13195
13195
|
children: [
|
|
13196
13196
|
/* @__PURE__ */ i(
|
|
13197
13197
|
tt,
|
|
13198
13198
|
{
|
|
13199
|
-
checked:
|
|
13199
|
+
checked: f,
|
|
13200
13200
|
onChange: (I) => Te(y.conditionalOn, I ? "true" : "false")
|
|
13201
13201
|
}
|
|
13202
13202
|
),
|
|
13203
|
-
/* @__PURE__ */ i("span", { style: { fontSize: "14px", fontWeight: 500 }, children:
|
|
13203
|
+
/* @__PURE__ */ i("span", { style: { fontSize: "14px", fontWeight: 500 }, children: oe(y.conditionalLabel, u) || y.conditionalOn })
|
|
13204
13204
|
]
|
|
13205
13205
|
}
|
|
13206
13206
|
),
|
|
13207
|
-
|
|
13207
|
+
f && /* @__PURE__ */ i("div", { className: "metakyc-form-grid", children: y.fields.map((I, A) => {
|
|
13208
13208
|
const K = Math.min(4, Math.max(1, Number(I.colSpan) || 4)), X = I.isCustom ? `custom-${A}-${I.paramName}` : `builtin-${I.name}-${A}`;
|
|
13209
13209
|
return /* @__PURE__ */ i("div", { style: { gridColumn: `span ${K} / span ${K}` }, children: I.isCustom ? rt(I, A) : mt(I.name, X, I.displayText, I.countriesType, I.labelMode) }, X);
|
|
13210
13210
|
}) })
|
|
@@ -13216,16 +13216,16 @@ const Za = ({
|
|
|
13216
13216
|
/* @__PURE__ */ i("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: u("common.loadingForm") })
|
|
13217
13217
|
] }) }) });
|
|
13218
13218
|
if (T) {
|
|
13219
|
-
const y = T[
|
|
13219
|
+
const y = T[se] ?? T[0], f = _e === -1, I = it === -1, A = T.length, K = Ce(y), X = qe(y), ne = Object.values(Q), ve = !K && !!y.conditionalOn && y.conditionalMode === "block", m = O || d || ve || X;
|
|
13220
13220
|
let j;
|
|
13221
13221
|
return ve || X ? j = u("common.blocked") : I ? j = y.conditionalOn && !K ? u("common.skipAndSubmit") : u("common.submit") : j = y.conditionalOn && !K ? u("common.skip") : u("common.next"), /* @__PURE__ */ i("div", { className: "metakyc-sdk", children: /* @__PURE__ */ s(me, { children: [
|
|
13222
13222
|
/* @__PURE__ */ i(Fe, { children: /* @__PURE__ */ i(Tt, { title: (l == null ? void 0 : l.title) || u("createCompany.title") }) }),
|
|
13223
13223
|
/* @__PURE__ */ s(ue, { children: [
|
|
13224
13224
|
(y.title || y.subtitle) && /* @__PURE__ */ s("div", { className: "mb-4", children: [
|
|
13225
|
-
y.title && /* @__PURE__ */ i("h3", { className: "font-semibold text-base", style: { color: "var(--metakyc-text-primary, #111827)" }, children:
|
|
13226
|
-
y.subtitle && /* @__PURE__ */ i("p", { className: "text-sm mt-0.5", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children:
|
|
13225
|
+
y.title && /* @__PURE__ */ i("h3", { className: "font-semibold text-base", style: { color: "var(--metakyc-text-primary, #111827)" }, children: oe(y.title, u) }),
|
|
13226
|
+
y.subtitle && /* @__PURE__ */ i("p", { className: "text-sm mt-0.5", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: oe(y.subtitle, u) })
|
|
13227
13227
|
] }),
|
|
13228
|
-
(z ||
|
|
13228
|
+
(z || ne.length > 0) && /* @__PURE__ */ s("div", { className: "mb-4 p-3 rounded-lg", style: {
|
|
13229
13229
|
backgroundColor: "var(--metakyc-danger-bg, color-mix(in srgb, var(--metakyc-danger, #ef4444) 10%, transparent))",
|
|
13230
13230
|
border: "1px solid color-mix(in srgb, var(--metakyc-danger, #ef4444) 30%, transparent)"
|
|
13231
13231
|
}, children: [
|
|
@@ -13234,7 +13234,7 @@ const Za = ({
|
|
|
13234
13234
|
" ",
|
|
13235
13235
|
z
|
|
13236
13236
|
] }),
|
|
13237
|
-
|
|
13237
|
+
ne.map((E, k) => /* @__PURE__ */ i("p", { className: "text-sm", style: { color: "var(--metakyc-danger, #ef4444)" }, children: E }, k))
|
|
13238
13238
|
] }),
|
|
13239
13239
|
A > 1 && /* @__PURE__ */ s("div", { style: { display: "flex", alignItems: "center", gap: "0.5rem", marginBottom: "1rem" }, children: [
|
|
13240
13240
|
T.map((E, k) => /* @__PURE__ */ i(
|
|
@@ -13244,13 +13244,13 @@ const Za = ({
|
|
|
13244
13244
|
height: "0.375rem",
|
|
13245
13245
|
borderRadius: "9999px",
|
|
13246
13246
|
transition: "all 150ms",
|
|
13247
|
-
...k ===
|
|
13247
|
+
...k === se ? { flex: "1 1 0%", backgroundColor: "var(--metakyc-primary, #2563eb)", opacity: 0.3 } : k < se ? { width: "2rem", backgroundColor: "var(--metakyc-primary-light, #93c5fd)", opacity: 0.7 } : { width: "2rem", backgroundColor: "#e5e7eb", opacity: 0.3 }
|
|
13248
13248
|
}
|
|
13249
13249
|
},
|
|
13250
13250
|
k
|
|
13251
13251
|
)),
|
|
13252
13252
|
/* @__PURE__ */ s("span", { style: { fontSize: "0.75rem", color: "var(--metakyc-text-muted, #9ca3af)", flexShrink: 0 }, children: [
|
|
13253
|
-
|
|
13253
|
+
se + 1,
|
|
13254
13254
|
" / ",
|
|
13255
13255
|
A
|
|
13256
13256
|
] })
|
|
@@ -13259,19 +13259,19 @@ const Za = ({
|
|
|
13259
13259
|
] }),
|
|
13260
13260
|
/* @__PURE__ */ s(Oe, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
13261
13261
|
/* @__PURE__ */ s("div", { children: [
|
|
13262
|
-
!
|
|
13262
|
+
!f && /* @__PURE__ */ i(
|
|
13263
13263
|
le,
|
|
13264
13264
|
{
|
|
13265
13265
|
type: "button",
|
|
13266
13266
|
variant: "outline",
|
|
13267
13267
|
onClick: () => {
|
|
13268
|
-
G(_e),
|
|
13268
|
+
G(_e), te({});
|
|
13269
13269
|
},
|
|
13270
13270
|
disabled: O || d,
|
|
13271
13271
|
children: u("common.previous")
|
|
13272
13272
|
}
|
|
13273
13273
|
),
|
|
13274
|
-
|
|
13274
|
+
f && r && /* @__PURE__ */ i(le, { type: "button", variant: "outline", onClick: r, disabled: O || d, children: "Cancel" })
|
|
13275
13275
|
] }),
|
|
13276
13276
|
/* @__PURE__ */ i(le, { type: "button", isLoading: O || d, disabled: m, onClick: I ? Pe : Ze, children: j })
|
|
13277
13277
|
] })
|
|
@@ -13306,7 +13306,7 @@ const Za = ({
|
|
|
13306
13306
|
progress: c,
|
|
13307
13307
|
currentStep: d,
|
|
13308
13308
|
steps: u,
|
|
13309
|
-
nextWorkflowKey:
|
|
13309
|
+
nextWorkflowKey: g,
|
|
13310
13310
|
hasWorkflowChanged: p,
|
|
13311
13311
|
isLoading: C,
|
|
13312
13312
|
error: N,
|
|
@@ -13361,7 +13361,7 @@ const Za = ({
|
|
|
13361
13361
|
}), () => G.unregisterAction("workflow-back");
|
|
13362
13362
|
}
|
|
13363
13363
|
}, [B, x, W]);
|
|
13364
|
-
const
|
|
13364
|
+
const re = we.useCallback(async () => {
|
|
13365
13365
|
if (!d || !e) return;
|
|
13366
13366
|
const G = d.action;
|
|
13367
13367
|
try {
|
|
@@ -13386,7 +13386,7 @@ const Za = ({
|
|
|
13386
13386
|
}
|
|
13387
13387
|
case de.RiskScoring: {
|
|
13388
13388
|
H.info("[DevTools] Skipping Risk Scoring step");
|
|
13389
|
-
const
|
|
13389
|
+
const te = (await h.getRiskCriterias(e)).map((z) => {
|
|
13390
13390
|
var R;
|
|
13391
13391
|
return {
|
|
13392
13392
|
riskCriteriaId: z.id,
|
|
@@ -13395,13 +13395,13 @@ const Za = ({
|
|
|
13395
13395
|
});
|
|
13396
13396
|
await h.submitRiskScoring({
|
|
13397
13397
|
applicantId: e,
|
|
13398
|
-
criteriaValueInputs:
|
|
13398
|
+
criteriaValueInputs: te
|
|
13399
13399
|
});
|
|
13400
13400
|
break;
|
|
13401
13401
|
}
|
|
13402
13402
|
case de.AppropriatenessTest: {
|
|
13403
13403
|
H.info("[DevTools] Skipping Appropriateness Test step");
|
|
13404
|
-
const Q = await L.getAppropriatenessTest(e),
|
|
13404
|
+
const Q = await L.getAppropriatenessTest(e), te = Q.appropriatenessQuestions.map((z) => {
|
|
13405
13405
|
var R;
|
|
13406
13406
|
return {
|
|
13407
13407
|
appropriatenessQuestionId: z.id,
|
|
@@ -13411,13 +13411,13 @@ const Za = ({
|
|
|
13411
13411
|
await L.fillAppropriatenessTest({
|
|
13412
13412
|
applicantId: e,
|
|
13413
13413
|
appropriatenessTestId: Q.id,
|
|
13414
|
-
appropriatenessQuestionResults:
|
|
13414
|
+
appropriatenessQuestionResults: te
|
|
13415
13415
|
});
|
|
13416
13416
|
break;
|
|
13417
13417
|
}
|
|
13418
13418
|
case de.UploadDocument: {
|
|
13419
13419
|
H.info("[DevTools] Skipping Upload Document step");
|
|
13420
|
-
const Q = await M.getUploadDocument(e),
|
|
13420
|
+
const Q = await M.getUploadDocument(e), te = Q.uploadDocumentFiles.map((z) => ({
|
|
13421
13421
|
uploadDocumentFileId: z.id,
|
|
13422
13422
|
valueList: [{
|
|
13423
13423
|
fileName: "dev-placeholder.pdf",
|
|
@@ -13427,14 +13427,14 @@ const Za = ({
|
|
|
13427
13427
|
await M.fillUploadDocument({
|
|
13428
13428
|
applicantId: e,
|
|
13429
13429
|
uploadDocumentId: Q.id,
|
|
13430
|
-
uploadDocumentResults:
|
|
13430
|
+
uploadDocumentResults: te
|
|
13431
13431
|
});
|
|
13432
13432
|
break;
|
|
13433
13433
|
}
|
|
13434
13434
|
case de.InvestorCategorization:
|
|
13435
13435
|
case de.AdditionalData: {
|
|
13436
13436
|
H.info("[DevTools] Skipping Investor Categorization step");
|
|
13437
|
-
const
|
|
13437
|
+
const te = (await h.getRiskCriterias(e)).map((z) => {
|
|
13438
13438
|
var R;
|
|
13439
13439
|
return {
|
|
13440
13440
|
riskCriteriaId: z.id,
|
|
@@ -13443,7 +13443,7 @@ const Za = ({
|
|
|
13443
13443
|
});
|
|
13444
13444
|
await h.submitRiskScoring({
|
|
13445
13445
|
applicantId: e,
|
|
13446
|
-
criteriaValueInputs:
|
|
13446
|
+
criteriaValueInputs: te
|
|
13447
13447
|
});
|
|
13448
13448
|
break;
|
|
13449
13449
|
}
|
|
@@ -13478,31 +13478,38 @@ const Za = ({
|
|
|
13478
13478
|
label: `Skip: ${d.title || d.name || de[Q]}`,
|
|
13479
13479
|
icon: "⏭️",
|
|
13480
13480
|
group: "workflow",
|
|
13481
|
-
handler:
|
|
13481
|
+
handler: re
|
|
13482
13482
|
}), () => G.unregisterAction("workflow-skip");
|
|
13483
|
-
}, [B, d,
|
|
13483
|
+
}, [B, d, re]), we.useEffect(() => {
|
|
13484
13484
|
N && a && a(N);
|
|
13485
13485
|
}, [N, a]), we.useEffect(() => {
|
|
13486
13486
|
c != null && c.workflowResult && t && t(c.workflowResult);
|
|
13487
13487
|
}, [c == null ? void 0 : c.workflowResult, t]);
|
|
13488
13488
|
const he = we.useRef(!1);
|
|
13489
13489
|
if (we.useEffect(() => {
|
|
13490
|
-
!p || !
|
|
13490
|
+
if (!p || !g || !e || he.current) return;
|
|
13491
|
+
he.current = !0;
|
|
13492
|
+
let G = !1;
|
|
13493
|
+
return $(!0), P(null), (async () => {
|
|
13491
13494
|
try {
|
|
13492
|
-
H.info(`[SDK] Auto-duplicating applicant ${e} → workflow ${
|
|
13493
|
-
const Q =
|
|
13495
|
+
H.info(`[SDK] Auto-duplicating applicant ${e} → workflow ${g}`);
|
|
13496
|
+
const Q = await l.duplicateApplicant({
|
|
13494
13497
|
applicantId: e,
|
|
13495
|
-
workflowKey:
|
|
13496
|
-
})
|
|
13497
|
-
|
|
13498
|
-
|
|
13499
|
-
|
|
13500
|
-
|
|
13498
|
+
workflowKey: g
|
|
13499
|
+
});
|
|
13500
|
+
if (G) return;
|
|
13501
|
+
H.info(`[SDK] Duplicated → new applicantId=${Q.applicantId}`), r && r(Q.applicantId);
|
|
13502
|
+
} catch (Q) {
|
|
13503
|
+
if (G) return;
|
|
13504
|
+
const te = (Q == null ? void 0 : Q.message) || "Failed to continue with new workflow";
|
|
13505
|
+
H.warn(`[SDK] Duplicate applicant failed: ${te}`), P(te);
|
|
13501
13506
|
} finally {
|
|
13502
|
-
$(!1)
|
|
13507
|
+
G || $(!1);
|
|
13503
13508
|
}
|
|
13504
|
-
})())
|
|
13505
|
-
|
|
13509
|
+
})(), () => {
|
|
13510
|
+
G = !0;
|
|
13511
|
+
};
|
|
13512
|
+
}, [p, g, e, l, r]), C || T || !c)
|
|
13506
13513
|
return /* @__PURE__ */ i("div", { className: `metakyc-sdk ${n || ""}`, children: /* @__PURE__ */ i(me, { children: /* @__PURE__ */ s(ue, { children: [
|
|
13507
13514
|
/* @__PURE__ */ i(Ge, { className: "my-8" }),
|
|
13508
13515
|
/* @__PURE__ */ i("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: o("workflow.loadingWorkflow") })
|
|
@@ -13563,7 +13570,7 @@ const Za = ({
|
|
|
13563
13570
|
return "";
|
|
13564
13571
|
}
|
|
13565
13572
|
}, De = () => {
|
|
13566
|
-
const G = u.filter((O) => O.visibility !== !1), Q = G.findIndex((O) => O.order === d.order),
|
|
13573
|
+
const G = u.filter((O) => O.visibility !== !1), Q = G.findIndex((O) => O.order === d.order), te = Q >= 0 ? Q + 1 : 1, z = G.length, R = z > 1 ? (Q + 1) / z * 100 : 100;
|
|
13567
13574
|
return /* @__PURE__ */ s("div", { className: "metakyc-progress-wrapper", style: {
|
|
13568
13575
|
marginBottom: "24px",
|
|
13569
13576
|
backgroundColor: "var(--metakyc-surface, var(--metakyc-background, #ffffff))",
|
|
@@ -13574,7 +13581,7 @@ const Za = ({
|
|
|
13574
13581
|
}, children: [
|
|
13575
13582
|
/* @__PURE__ */ s("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", marginBottom: "16px", gap: "8px", flexWrap: "wrap" }, children: [
|
|
13576
13583
|
/* @__PURE__ */ i(Tt, {}),
|
|
13577
|
-
/* @__PURE__ */ i(Ni, { variant: c.status === 1 ? "info" : "success", children: o("common.stepXofY", { current:
|
|
13584
|
+
/* @__PURE__ */ i(Ni, { variant: c.status === 1 ? "info" : "success", children: o("common.stepXofY", { current: te, total: z }) })
|
|
13578
13585
|
] }),
|
|
13579
13586
|
/* @__PURE__ */ s("div", { style: { position: "relative", height: "4px", borderRadius: "999px", overflow: "hidden", marginBottom: "16px" }, children: [
|
|
13580
13587
|
/* @__PURE__ */ i("div", { style: { position: "absolute", inset: 0, backgroundColor: "var(--metakyc-border, #e5e7eb)", opacity: 0.3 } }),
|
|
@@ -13599,13 +13606,13 @@ const Za = ({
|
|
|
13599
13606
|
}
|
|
13600
13607
|
)
|
|
13601
13608
|
] });
|
|
13602
|
-
},
|
|
13603
|
-
const
|
|
13609
|
+
}, se = () => {
|
|
13610
|
+
const te = u.filter((R) => R.visibility !== !1).findIndex((R) => R.order === d.order) <= 0, z = {
|
|
13604
13611
|
applicantId: e,
|
|
13605
13612
|
onComplete: async () => {
|
|
13606
13613
|
await F();
|
|
13607
13614
|
},
|
|
13608
|
-
onBack:
|
|
13615
|
+
onBack: te ? void 0 : x
|
|
13609
13616
|
};
|
|
13610
13617
|
switch (d.action) {
|
|
13611
13618
|
case de.Questionaries:
|
|
@@ -13651,7 +13658,7 @@ const Za = ({
|
|
|
13651
13658
|
};
|
|
13652
13659
|
return /* @__PURE__ */ s("div", { className: `metakyc-sdk ${n || ""}`, children: [
|
|
13653
13660
|
De(),
|
|
13654
|
-
|
|
13661
|
+
se()
|
|
13655
13662
|
] });
|
|
13656
13663
|
}, tn = we.forwardRef(
|
|
13657
13664
|
({ visibleSteps: e, currentVisibleStepIndex: t, getStepFallbackName: a }, r) => {
|
|
@@ -13679,7 +13686,7 @@ const Za = ({
|
|
|
13679
13686
|
gap: "0"
|
|
13680
13687
|
},
|
|
13681
13688
|
children: e.map((l, c) => {
|
|
13682
|
-
const d = c < t, u = c === t,
|
|
13689
|
+
const d = c < t, u = c === t, g = d || u, p = l.displayName || l.name || a(l.action) || `Step ${c + 1}`;
|
|
13683
13690
|
return /* @__PURE__ */ s(we.Fragment, { children: [
|
|
13684
13691
|
/* @__PURE__ */ s(
|
|
13685
13692
|
"div",
|
|
@@ -13702,7 +13709,7 @@ const Za = ({
|
|
|
13702
13709
|
fontWeight: 600,
|
|
13703
13710
|
flexShrink: 0,
|
|
13704
13711
|
transition: "all 0.2s ease",
|
|
13705
|
-
...
|
|
13712
|
+
...g ? {
|
|
13706
13713
|
backgroundColor: "var(--metakyc-primary, #2563eb)",
|
|
13707
13714
|
color: "#ffffff",
|
|
13708
13715
|
border: "none"
|
|
@@ -13764,14 +13771,14 @@ const hi = ({
|
|
|
13764
13771
|
phase: c,
|
|
13765
13772
|
applicantId: d,
|
|
13766
13773
|
isCompany: u,
|
|
13767
|
-
workflowKey:
|
|
13774
|
+
workflowKey: g,
|
|
13768
13775
|
error: p,
|
|
13769
13776
|
isLoading: C,
|
|
13770
13777
|
transitionToWorkflow: N,
|
|
13771
13778
|
switchApplicant: x,
|
|
13772
13779
|
refresh: F
|
|
13773
13780
|
} = ea(e);
|
|
13774
|
-
rn(c, d, u,
|
|
13781
|
+
rn(c, d, u, g);
|
|
13775
13782
|
const T = It();
|
|
13776
13783
|
we.useEffect(() => {
|
|
13777
13784
|
const D = T.current;
|
|
@@ -13800,7 +13807,7 @@ const hi = ({
|
|
|
13800
13807
|
/* @__PURE__ */ i("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: (p == null ? void 0 : p.message) || "An unexpected error occurred." })
|
|
13801
13808
|
] }) }) }) });
|
|
13802
13809
|
if (c === "create_applicant") {
|
|
13803
|
-
const D =
|
|
13810
|
+
const D = g || ((U = l.applicantForm) == null ? void 0 : U.workflowKey), B = (P = l.applicantForm) == null ? void 0 : P.externalRefId;
|
|
13804
13811
|
return u ? /* @__PURE__ */ i("div", { className: `metakyc-sdk ${n || ""}`, children: /* @__PURE__ */ i(
|
|
13805
13812
|
Za,
|
|
13806
13813
|
{
|
|
@@ -13988,7 +13995,7 @@ export {
|
|
|
13988
13995
|
pr as minimalTheme,
|
|
13989
13996
|
ur as modernTheme,
|
|
13990
13997
|
fn as removeScript,
|
|
13991
|
-
|
|
13998
|
+
oe as resolveDisplayText,
|
|
13992
13999
|
bn as saveApplicantId,
|
|
13993
14000
|
Xr as saveWorkflowState,
|
|
13994
14001
|
gr as themePresets,
|