@vpdev2/metakyc 1.0.76 → 1.0.77
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/client/session.d.ts +5 -0
- package/dist/client/session.d.ts.map +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +519 -519
- package/dist/index.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ var be = (e, t, a) => Fi(e, typeof t != "symbol" ? t + "" : t, a);
|
|
|
4
4
|
import wi from "axios";
|
|
5
5
|
import { jsx as i, jsxs as l, Fragment as bt } from "react/jsx-runtime";
|
|
6
6
|
import * as Jt from "react";
|
|
7
|
-
import he, { createContext as _t, useMemo as Ue, useState as
|
|
7
|
+
import he, { createContext as _t, useMemo as Ue, useState as C, useEffect as ve, useContext as Gt, useCallback as Z, useRef as ge, forwardRef as Rt, createElement as Ut } from "react";
|
|
8
8
|
import Oi, { createPortal as Mt } from "react-dom";
|
|
9
9
|
import { useForm as Vi, Controller as yt } from "react-hook-form";
|
|
10
10
|
import { z as ot } from "zod";
|
|
@@ -428,7 +428,7 @@ class nr {
|
|
|
428
428
|
}
|
|
429
429
|
class kn {
|
|
430
430
|
static async createToken(t) {
|
|
431
|
-
const { baseUrl: a, apiKey: r, secretKey: n, tenantId: o, clientId: s, externalRefId: c, workflowKey: u, email: g, isCompany: y,
|
|
431
|
+
const { baseUrl: a, apiKey: r, secretKey: n, tenantId: o, clientId: s, externalRefId: c, workflowKey: u, email: g, isCompany: y, tenantClientId: f, applicant: D } = t, T = t.enableEncryption !== !1;
|
|
432
432
|
if (!o && !s)
|
|
433
433
|
throw new Error("Either tenantId or clientId must be provided.");
|
|
434
434
|
if (!c)
|
|
@@ -437,30 +437,30 @@ class kn {
|
|
|
437
437
|
throw new Error("workflowKey is required. Pass the workflow key for this KYC session.");
|
|
438
438
|
if (!g)
|
|
439
439
|
throw new Error("email is required. Pass the applicant's email address.");
|
|
440
|
-
const
|
|
440
|
+
const x = {
|
|
441
441
|
apiKey: r,
|
|
442
442
|
secretKey: n,
|
|
443
443
|
externalRefId: c,
|
|
444
444
|
workflowKey: u,
|
|
445
445
|
email: g
|
|
446
446
|
};
|
|
447
|
-
o != null && (
|
|
448
|
-
const
|
|
447
|
+
o != null && (x.tenantId = o), s && (x.clientId = s), y != null && (x.isCompany = y), f != null && (x.tenantClientId = f), D && (x.applicant = D), T && (x.sdkPublicKey = "1");
|
|
448
|
+
const N = (await wi.post(
|
|
449
449
|
`${a.replace(/\/+$/, "")}/api/SdkSession/CreateToken`,
|
|
450
|
-
|
|
450
|
+
x,
|
|
451
451
|
{ headers: { "Content-Type": "application/json" } }
|
|
452
452
|
)).data;
|
|
453
|
-
if (!
|
|
454
|
-
throw new Error(
|
|
455
|
-
const
|
|
456
|
-
if (
|
|
457
|
-
const
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
453
|
+
if (!N.success)
|
|
454
|
+
throw new Error(N.error || "Failed to create session token.");
|
|
455
|
+
const K = N.result;
|
|
456
|
+
if (K.encSessionKey && K.encSessionId) {
|
|
457
|
+
const q = Kt(K.encSessionKey);
|
|
458
|
+
K.encryptionKey = q.buffer.slice(
|
|
459
|
+
q.byteOffset,
|
|
460
|
+
q.byteOffset + q.byteLength
|
|
461
461
|
);
|
|
462
462
|
}
|
|
463
|
-
return
|
|
463
|
+
return K;
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
466
|
class or {
|
|
@@ -7155,7 +7155,7 @@ function ie(e, t) {
|
|
|
7155
7155
|
const r = Xr.exec(a);
|
|
7156
7156
|
return r ? t(r[1]) : e;
|
|
7157
7157
|
}
|
|
7158
|
-
const $t = "1.0.
|
|
7158
|
+
const $t = "1.0.77", Ni = _t(null), ci = `metakyc-translations-${$t}-`, Zr = ({
|
|
7159
7159
|
locale: e,
|
|
7160
7160
|
fetchTranslations: t,
|
|
7161
7161
|
children: a
|
|
@@ -7169,7 +7169,7 @@ const $t = "1.0.76", Ni = _t(null), ci = `metakyc-translations-${$t}-`, Zr = ({
|
|
|
7169
7169
|
} catch {
|
|
7170
7170
|
}
|
|
7171
7171
|
return u;
|
|
7172
|
-
}, [r]), [o, s] =
|
|
7172
|
+
}, [r]), [o, s] = C(n);
|
|
7173
7173
|
ve(() => {
|
|
7174
7174
|
if (!t) return;
|
|
7175
7175
|
let u = !1;
|
|
@@ -7220,18 +7220,18 @@ function ea() {
|
|
|
7220
7220
|
}
|
|
7221
7221
|
const ui = "metakyc-theme-cache", xn = ({ config: e, children: t }) => {
|
|
7222
7222
|
ea();
|
|
7223
|
-
const [a, r] =
|
|
7223
|
+
const [a, r] = C(null), n = he.useRef(!1), o = he.useRef(!1), s = Ue(() => {
|
|
7224
7224
|
_.setLevel(e.debug ?? e.logLevel ?? "none"), _.info(`SDK v${$t} initializing — baseUrl=${e.baseUrl}`);
|
|
7225
|
-
const g = new nr(e), y = new or(g), f = new sr(g), D = new lr(g), T = new cr(g),
|
|
7225
|
+
const g = new nr(e), y = new or(g), f = new sr(g), D = new lr(g), T = new cr(g), x = new dr(g), V = new ur(g), N = new mr(g), K = new pr(g), q = new gr(g), F = new wr(g), M = new xr(g), U = new Er();
|
|
7226
7226
|
if (typeof document < "u")
|
|
7227
7227
|
if (e.theme)
|
|
7228
|
-
|
|
7228
|
+
U.applyTheme(e.theme);
|
|
7229
7229
|
else
|
|
7230
7230
|
try {
|
|
7231
7231
|
const G = localStorage.getItem(ui);
|
|
7232
|
-
|
|
7232
|
+
U.applyTheme(G ? JSON.parse(G) : Ve);
|
|
7233
7233
|
} catch {
|
|
7234
|
-
|
|
7234
|
+
U.applyTheme(Ve);
|
|
7235
7235
|
}
|
|
7236
7236
|
return {
|
|
7237
7237
|
httpClient: g,
|
|
@@ -7239,14 +7239,14 @@ const ui = "metakyc-theme-cache", xn = ({ config: e, children: t }) => {
|
|
|
7239
7239
|
questionnaireService: f,
|
|
7240
7240
|
uploadDocumentService: D,
|
|
7241
7241
|
appropriatenessTestService: T,
|
|
7242
|
-
overviewService:
|
|
7243
|
-
riskScoringService:
|
|
7244
|
-
identityService:
|
|
7242
|
+
overviewService: x,
|
|
7243
|
+
riskScoringService: V,
|
|
7244
|
+
identityService: N,
|
|
7245
7245
|
baseInformationService: K,
|
|
7246
|
-
investorCategorizationService:
|
|
7246
|
+
investorCategorizationService: q,
|
|
7247
7247
|
themeService: F,
|
|
7248
7248
|
translationService: M,
|
|
7249
|
-
themeManager:
|
|
7249
|
+
themeManager: U
|
|
7250
7250
|
};
|
|
7251
7251
|
}, [e]), c = Ue(() => ({
|
|
7252
7252
|
config: e,
|
|
@@ -7404,7 +7404,7 @@ function In() {
|
|
|
7404
7404
|
ia(), aa();
|
|
7405
7405
|
}
|
|
7406
7406
|
function na(e) {
|
|
7407
|
-
const { createOrchestrator: t, config: a } = Te(), [r, n] =
|
|
7407
|
+
const { createOrchestrator: t, config: a } = Te(), [r, n] = C(null), [o, s] = C(!1), [c, u] = C(null), g = ge(null), y = e || a.applicantId || void 0;
|
|
7408
7408
|
ve(() => {
|
|
7409
7409
|
g.current || (g.current = t());
|
|
7410
7410
|
}, [t]), ve(() => {
|
|
@@ -7438,7 +7438,7 @@ function na(e) {
|
|
|
7438
7438
|
ve(() => {
|
|
7439
7439
|
y && D.current !== y && T();
|
|
7440
7440
|
}, [y, T]);
|
|
7441
|
-
const
|
|
7441
|
+
const x = Z(async () => {
|
|
7442
7442
|
if (g.current) {
|
|
7443
7443
|
if (f.current) {
|
|
7444
7444
|
_.debug("Workflow refresh already in progress, skipping");
|
|
@@ -7454,7 +7454,7 @@ function na(e) {
|
|
|
7454
7454
|
s(!1), f.current = !1;
|
|
7455
7455
|
}
|
|
7456
7456
|
}
|
|
7457
|
-
}, []),
|
|
7457
|
+
}, []), V = Z(async () => {
|
|
7458
7458
|
if (g.current) {
|
|
7459
7459
|
s(!0), u(null);
|
|
7460
7460
|
try {
|
|
@@ -7466,7 +7466,7 @@ function na(e) {
|
|
|
7466
7466
|
s(!1);
|
|
7467
7467
|
}
|
|
7468
7468
|
}
|
|
7469
|
-
}, []),
|
|
7469
|
+
}, []), N = Z(async () => {
|
|
7470
7470
|
if (g.current) {
|
|
7471
7471
|
s(!0), u(null);
|
|
7472
7472
|
try {
|
|
@@ -7483,20 +7483,20 @@ function na(e) {
|
|
|
7483
7483
|
s(!0), u(null);
|
|
7484
7484
|
try {
|
|
7485
7485
|
await g.current.submitCurrentStep(M);
|
|
7486
|
-
const
|
|
7487
|
-
n(
|
|
7488
|
-
} catch (
|
|
7489
|
-
throw u(
|
|
7486
|
+
const U = await g.current.refreshProgress();
|
|
7487
|
+
n(U);
|
|
7488
|
+
} catch (U) {
|
|
7489
|
+
throw u(U), U;
|
|
7490
7490
|
} finally {
|
|
7491
7491
|
s(!1);
|
|
7492
7492
|
}
|
|
7493
7493
|
}
|
|
7494
|
-
}, []),
|
|
7494
|
+
}, []), q = Jt.useMemo(() => r != null && r.stepInfoList ? [...r.stepInfoList].sort((M, U) => M.order - U.order) : [], [r == null ? void 0 : r.stepInfoList]), F = Jt.useMemo(() => r ? r.nextWorkflowKey && r.nextWorkflowKey !== r.workFlowKey : !1, [r]);
|
|
7495
7495
|
return {
|
|
7496
7496
|
progress: r,
|
|
7497
7497
|
applicantId: y,
|
|
7498
7498
|
currentStep: (r == null ? void 0 : r.currentStep) || null,
|
|
7499
|
-
steps:
|
|
7499
|
+
steps: q,
|
|
7500
7500
|
status: (r == null ? void 0 : r.status) || qe.None,
|
|
7501
7501
|
workflowResult: (r == null ? void 0 : r.workflowResult) || null,
|
|
7502
7502
|
workflowKey: r == null ? void 0 : r.workFlowKey,
|
|
@@ -7506,16 +7506,16 @@ function na(e) {
|
|
|
7506
7506
|
error: c,
|
|
7507
7507
|
isComplete: (r == null ? void 0 : r.status) === qe.Finished,
|
|
7508
7508
|
isOnHold: (r == null ? void 0 : r.status) === qe.OnHold,
|
|
7509
|
-
refreshProgress:
|
|
7510
|
-
moveToNext:
|
|
7511
|
-
moveBack:
|
|
7509
|
+
refreshProgress: x,
|
|
7510
|
+
moveToNext: V,
|
|
7511
|
+
moveBack: N,
|
|
7512
7512
|
submitCurrentStep: K,
|
|
7513
7513
|
orchestrator: g.current
|
|
7514
7514
|
};
|
|
7515
7515
|
}
|
|
7516
7516
|
function oa(e) {
|
|
7517
|
-
var
|
|
7518
|
-
const { applicantService: t, config: a } = Te(), [r, n] =
|
|
7517
|
+
var U;
|
|
7518
|
+
const { applicantService: t, config: a } = Te(), [r, n] = C(null), [o, s] = C(!0), [c, u] = C(null), [g, y] = C(), [f, D] = C(), T = ge(!1), x = Z(async () => {
|
|
7519
7519
|
try {
|
|
7520
7520
|
s(!0), u(null);
|
|
7521
7521
|
const G = await t.getSdkState();
|
|
@@ -7527,28 +7527,28 @@ function oa(e) {
|
|
|
7527
7527
|
}
|
|
7528
7528
|
}, [t]);
|
|
7529
7529
|
ve(() => {
|
|
7530
|
-
T.current ||
|
|
7531
|
-
}, [
|
|
7532
|
-
const
|
|
7530
|
+
T.current || x();
|
|
7531
|
+
}, [x]);
|
|
7532
|
+
const V = Z((G) => {
|
|
7533
7533
|
_.info(`Transitioning to workflow → applicantId=${G}`), y(G), D("workflow");
|
|
7534
|
-
}, []),
|
|
7534
|
+
}, []), N = Z((G) => {
|
|
7535
7535
|
_.info(`Switching applicant → newApplicantId=${G}`), y(G), D("workflow");
|
|
7536
|
-
}, []), K = f || (r == null ? void 0 : r.phase) || "loading",
|
|
7536
|
+
}, []), K = f || (r == null ? void 0 : r.phase) || "loading", q = g || (r == null ? void 0 : r.applicantId), F = e ?? (r == null ? void 0 : r.isCompany) ?? !1, M = (r == null ? void 0 : r.workflowKey) || ((U = a.applicantForm) == null ? void 0 : U.workflowKey);
|
|
7537
7537
|
return {
|
|
7538
7538
|
phase: c ? "error" : o ? "loading" : K,
|
|
7539
|
-
applicantId:
|
|
7539
|
+
applicantId: q,
|
|
7540
7540
|
isCompany: F,
|
|
7541
7541
|
workflowKey: M,
|
|
7542
7542
|
error: c || void 0,
|
|
7543
7543
|
isLoading: o,
|
|
7544
|
-
transitionToWorkflow:
|
|
7545
|
-
switchApplicant:
|
|
7546
|
-
refresh:
|
|
7544
|
+
transitionToWorkflow: V,
|
|
7545
|
+
switchApplicant: N,
|
|
7546
|
+
refresh: x
|
|
7547
7547
|
};
|
|
7548
7548
|
}
|
|
7549
7549
|
function sa(e) {
|
|
7550
|
-
const { questionnaireService: t, applicantService: a } = Te(), [r, n] =
|
|
7551
|
-
var K,
|
|
7550
|
+
const { questionnaireService: t, applicantService: a } = Te(), [r, n] = C(null), [o, s] = C({}), [c, u] = C(!1), [g, y] = C(!1), [f, D] = C(null), T = ge(!1), x = ge(null), V = Z(async () => {
|
|
7551
|
+
var K, q;
|
|
7552
7552
|
if (e) {
|
|
7553
7553
|
if (T.current) {
|
|
7554
7554
|
_.debug("Questionnaire load already in progress, skipping");
|
|
@@ -7561,17 +7561,17 @@ function sa(e) {
|
|
|
7561
7561
|
a.getApplicantData(e).catch(() => null)
|
|
7562
7562
|
]);
|
|
7563
7563
|
if (n(F), (K = M == null ? void 0 : M.questionnaireResults) != null && K.length && F) {
|
|
7564
|
-
const
|
|
7564
|
+
const U = /* @__PURE__ */ new Map();
|
|
7565
7565
|
for (const k of M.questionnaireResults)
|
|
7566
|
-
k.question && ((
|
|
7566
|
+
k.question && ((q = k.answers) != null && q.length) && U.set(k.question.trim().toLowerCase(), k.answers);
|
|
7567
7567
|
const G = {}, se = F.questionGroups.flatMap((k) => k.questions ?? []);
|
|
7568
7568
|
for (const k of se) {
|
|
7569
7569
|
const L = k.text.trim().toLowerCase();
|
|
7570
|
-
|
|
7570
|
+
U.has(L) && (G[k.id] = U.get(L));
|
|
7571
7571
|
}
|
|
7572
7572
|
s(G);
|
|
7573
7573
|
}
|
|
7574
|
-
|
|
7574
|
+
x.current = e;
|
|
7575
7575
|
} catch (F) {
|
|
7576
7576
|
D(F);
|
|
7577
7577
|
} finally {
|
|
@@ -7580,15 +7580,15 @@ function sa(e) {
|
|
|
7580
7580
|
}
|
|
7581
7581
|
}, [e, t, a]);
|
|
7582
7582
|
ve(() => {
|
|
7583
|
-
e &&
|
|
7583
|
+
e && x.current !== e && V();
|
|
7584
7584
|
}, [e]);
|
|
7585
|
-
const
|
|
7585
|
+
const N = Z(
|
|
7586
7586
|
async (K) => {
|
|
7587
7587
|
y(!0), D(null);
|
|
7588
7588
|
try {
|
|
7589
7589
|
return await t.fillQuestionnaire(K);
|
|
7590
|
-
} catch (
|
|
7591
|
-
throw D(
|
|
7590
|
+
} catch (q) {
|
|
7591
|
+
throw D(q), q;
|
|
7592
7592
|
} finally {
|
|
7593
7593
|
y(!1);
|
|
7594
7594
|
}
|
|
@@ -7601,12 +7601,12 @@ function sa(e) {
|
|
|
7601
7601
|
isLoading: c,
|
|
7602
7602
|
isSubmitting: g,
|
|
7603
7603
|
error: f,
|
|
7604
|
-
load:
|
|
7605
|
-
submit:
|
|
7604
|
+
load: V,
|
|
7605
|
+
submit: N
|
|
7606
7606
|
};
|
|
7607
7607
|
}
|
|
7608
7608
|
function la(e) {
|
|
7609
|
-
const { uploadDocumentService: t } = Te(), [a, r] =
|
|
7609
|
+
const { uploadDocumentService: t } = Te(), [a, r] = C(null), [n, o] = C(!1), [s, c] = C(!1), [u, g] = C(0), [y, f] = C(null), D = ge(!1), T = ge(null), x = Z(async () => {
|
|
7610
7610
|
if (e) {
|
|
7611
7611
|
if (D.current) {
|
|
7612
7612
|
_.debug("UploadDocument load already in progress, skipping");
|
|
@@ -7614,23 +7614,23 @@ function la(e) {
|
|
|
7614
7614
|
}
|
|
7615
7615
|
D.current = !0, o(!0), f(null);
|
|
7616
7616
|
try {
|
|
7617
|
-
const
|
|
7618
|
-
r(
|
|
7619
|
-
} catch (
|
|
7620
|
-
f(
|
|
7617
|
+
const N = await t.getUploadDocument(e);
|
|
7618
|
+
r(N), T.current = e;
|
|
7619
|
+
} catch (N) {
|
|
7620
|
+
f(N);
|
|
7621
7621
|
} finally {
|
|
7622
7622
|
o(!1), D.current = !1;
|
|
7623
7623
|
}
|
|
7624
7624
|
}
|
|
7625
7625
|
}, [e, t]);
|
|
7626
7626
|
ve(() => {
|
|
7627
|
-
e && T.current !== e &&
|
|
7627
|
+
e && T.current !== e && x();
|
|
7628
7628
|
}, [e]);
|
|
7629
|
-
const
|
|
7630
|
-
async (
|
|
7629
|
+
const V = Z(
|
|
7630
|
+
async (N) => {
|
|
7631
7631
|
c(!0), g(0), f(null);
|
|
7632
7632
|
try {
|
|
7633
|
-
await t.fillUploadDocument(
|
|
7633
|
+
await t.fillUploadDocument(N), g(100);
|
|
7634
7634
|
} catch (K) {
|
|
7635
7635
|
throw f(K), K;
|
|
7636
7636
|
} finally {
|
|
@@ -7645,12 +7645,12 @@ function la(e) {
|
|
|
7645
7645
|
isSubmitting: s,
|
|
7646
7646
|
uploadProgress: u,
|
|
7647
7647
|
error: y,
|
|
7648
|
-
load:
|
|
7649
|
-
submit:
|
|
7648
|
+
load: x,
|
|
7649
|
+
submit: V
|
|
7650
7650
|
};
|
|
7651
7651
|
}
|
|
7652
7652
|
function zn(e) {
|
|
7653
|
-
const { appropriatenessTestService: t } = Te(), [a, r] =
|
|
7653
|
+
const { appropriatenessTestService: t } = Te(), [a, r] = C(null), [n, o] = C(!1), [s, c] = C(!1), [u, g] = C(null), [y, f] = C(null), D = ge(!1), T = ge(null), x = Z(async () => {
|
|
7654
7654
|
if (e) {
|
|
7655
7655
|
if (D.current) {
|
|
7656
7656
|
_.debug("AppropriatenessTest load already in progress, skipping");
|
|
@@ -7658,23 +7658,23 @@ function zn(e) {
|
|
|
7658
7658
|
}
|
|
7659
7659
|
D.current = !0, o(!0), g(null);
|
|
7660
7660
|
try {
|
|
7661
|
-
const
|
|
7662
|
-
r(
|
|
7663
|
-
} catch (
|
|
7664
|
-
g(
|
|
7661
|
+
const N = await t.getAppropriatenessTest(e);
|
|
7662
|
+
r(N), T.current = e;
|
|
7663
|
+
} catch (N) {
|
|
7664
|
+
g(N);
|
|
7665
7665
|
} finally {
|
|
7666
7666
|
o(!1), D.current = !1;
|
|
7667
7667
|
}
|
|
7668
7668
|
}
|
|
7669
7669
|
}, [e, t]);
|
|
7670
7670
|
ve(() => {
|
|
7671
|
-
e && T.current !== e &&
|
|
7671
|
+
e && T.current !== e && x();
|
|
7672
7672
|
}, [e]);
|
|
7673
|
-
const
|
|
7674
|
-
async (
|
|
7673
|
+
const V = Z(
|
|
7674
|
+
async (N) => {
|
|
7675
7675
|
c(!0), g(null);
|
|
7676
7676
|
try {
|
|
7677
|
-
const K = await t.fillAppropriatenessTest(
|
|
7677
|
+
const K = await t.fillAppropriatenessTest(N);
|
|
7678
7678
|
return f(K), K;
|
|
7679
7679
|
} catch (K) {
|
|
7680
7680
|
throw g(K), K;
|
|
@@ -7690,12 +7690,12 @@ function zn(e) {
|
|
|
7690
7690
|
isLoading: n,
|
|
7691
7691
|
isSubmitting: s,
|
|
7692
7692
|
error: u,
|
|
7693
|
-
load:
|
|
7694
|
-
submit:
|
|
7693
|
+
load: x,
|
|
7694
|
+
submit: V
|
|
7695
7695
|
};
|
|
7696
7696
|
}
|
|
7697
7697
|
function ca(e) {
|
|
7698
|
-
const { overviewService: t } = Te(), [a, r] =
|
|
7698
|
+
const { overviewService: t } = Te(), [a, r] = C(null), [n, o] = C(!1), [s, c] = C(!1), [u, g] = C(null), y = ge(!1), f = ge(null), D = Z(async () => {
|
|
7699
7699
|
if (e) {
|
|
7700
7700
|
if (y.current) {
|
|
7701
7701
|
_.debug("Overview load already in progress, skipping");
|
|
@@ -7703,10 +7703,10 @@ function ca(e) {
|
|
|
7703
7703
|
}
|
|
7704
7704
|
y.current = !0, o(!0), g(null);
|
|
7705
7705
|
try {
|
|
7706
|
-
const
|
|
7707
|
-
r(
|
|
7708
|
-
} catch (
|
|
7709
|
-
g(
|
|
7706
|
+
const x = await t.getOverviewData(e);
|
|
7707
|
+
r(x), f.current = e;
|
|
7708
|
+
} catch (x) {
|
|
7709
|
+
g(x);
|
|
7710
7710
|
} finally {
|
|
7711
7711
|
o(!1), y.current = !1;
|
|
7712
7712
|
}
|
|
@@ -7720,8 +7720,8 @@ function ca(e) {
|
|
|
7720
7720
|
c(!0), g(null);
|
|
7721
7721
|
try {
|
|
7722
7722
|
await t.passOverview(e);
|
|
7723
|
-
} catch (
|
|
7724
|
-
throw g(
|
|
7723
|
+
} catch (x) {
|
|
7724
|
+
throw g(x), x;
|
|
7725
7725
|
} finally {
|
|
7726
7726
|
c(!1);
|
|
7727
7727
|
}
|
|
@@ -7737,9 +7737,9 @@ function ca(e) {
|
|
|
7737
7737
|
};
|
|
7738
7738
|
}
|
|
7739
7739
|
function da(e) {
|
|
7740
|
-
const { identityService: t } = Te(), [a, r] =
|
|
7740
|
+
const { identityService: t } = Te(), [a, r] = C(
|
|
7741
7741
|
null
|
|
7742
|
-
), [n, o] =
|
|
7742
|
+
), [n, o] = C(!1), [s, c] = C(null), u = ge(!1), g = Z(
|
|
7743
7743
|
async (D, T) => {
|
|
7744
7744
|
if (e) {
|
|
7745
7745
|
if (u.current) {
|
|
@@ -7748,17 +7748,17 @@ function da(e) {
|
|
|
7748
7748
|
}
|
|
7749
7749
|
u.current = !0, o(!0), c(null);
|
|
7750
7750
|
try {
|
|
7751
|
-
const
|
|
7751
|
+
const x = {
|
|
7752
7752
|
applicantId: e,
|
|
7753
7753
|
restart: !1,
|
|
7754
7754
|
redirectUrl: D || "",
|
|
7755
7755
|
ttl: T || 604800
|
|
7756
7756
|
};
|
|
7757
|
-
_.debug("Identity request input:",
|
|
7758
|
-
const
|
|
7759
|
-
return _.debug("Identity request result:",
|
|
7760
|
-
} catch (
|
|
7761
|
-
throw c(
|
|
7757
|
+
_.debug("Identity request input:", x);
|
|
7758
|
+
const V = await t.identityRequest(x);
|
|
7759
|
+
return _.debug("Identity request result:", V), r(V), V;
|
|
7760
|
+
} catch (x) {
|
|
7761
|
+
throw c(x), x;
|
|
7762
7762
|
} finally {
|
|
7763
7763
|
o(!1), u.current = !1;
|
|
7764
7764
|
}
|
|
@@ -7770,15 +7770,15 @@ function da(e) {
|
|
|
7770
7770
|
if (e) {
|
|
7771
7771
|
o(!0), c(null);
|
|
7772
7772
|
try {
|
|
7773
|
-
const
|
|
7773
|
+
const x = {
|
|
7774
7774
|
applicantId: e,
|
|
7775
7775
|
restart: !1,
|
|
7776
7776
|
redirectUrl: D,
|
|
7777
7777
|
ttl: T
|
|
7778
|
-
},
|
|
7779
|
-
return r(
|
|
7780
|
-
} catch (
|
|
7781
|
-
throw c(
|
|
7778
|
+
}, V = await t.identityCompanyRequest(x);
|
|
7779
|
+
return r(V), V;
|
|
7780
|
+
} catch (x) {
|
|
7781
|
+
throw c(x), x;
|
|
7782
7782
|
} finally {
|
|
7783
7783
|
o(!1);
|
|
7784
7784
|
}
|
|
@@ -7821,21 +7821,21 @@ function da(e) {
|
|
|
7821
7821
|
};
|
|
7822
7822
|
}
|
|
7823
7823
|
function ua(e) {
|
|
7824
|
-
const { riskScoringService: t, applicantService: a } = Te(), [r, n] =
|
|
7824
|
+
const { riskScoringService: t, applicantService: a } = Te(), [r, n] = C(null), [o, s] = C({}), [c, u] = C(!1), [g, y] = C(!1), [f, D] = C(null), [T, x] = C(null), V = ge(!1), N = ge(null), K = Z(async () => {
|
|
7825
7825
|
var F;
|
|
7826
7826
|
if (e) {
|
|
7827
|
-
if (
|
|
7827
|
+
if (V.current) {
|
|
7828
7828
|
_.debug("RiskScoring load already in progress, skipping");
|
|
7829
7829
|
return;
|
|
7830
7830
|
}
|
|
7831
|
-
|
|
7831
|
+
V.current = !0, u(!0), D(null);
|
|
7832
7832
|
try {
|
|
7833
|
-
const [M,
|
|
7833
|
+
const [M, U] = await Promise.all([
|
|
7834
7834
|
t.getRiskCriterias(e),
|
|
7835
7835
|
a.getApplicantData(e).catch(() => null)
|
|
7836
7836
|
]);
|
|
7837
|
-
if (n(M), (F =
|
|
7838
|
-
const G =
|
|
7837
|
+
if (n(M), (F = U == null ? void 0 : U.riskScoringResults) != null && F.length) {
|
|
7838
|
+
const G = U.riskScoringResults[0], se = {};
|
|
7839
7839
|
for (const k of G.riskCriteriaResults ?? [])
|
|
7840
7840
|
if (k.riskCriteriaId != null && k.answer != null && k.answer !== "") {
|
|
7841
7841
|
const L = [...new Set(
|
|
@@ -7845,23 +7845,23 @@ function ua(e) {
|
|
|
7845
7845
|
}
|
|
7846
7846
|
s(se);
|
|
7847
7847
|
}
|
|
7848
|
-
|
|
7848
|
+
N.current = e;
|
|
7849
7849
|
} catch (M) {
|
|
7850
7850
|
D(M);
|
|
7851
7851
|
} finally {
|
|
7852
|
-
u(!1),
|
|
7852
|
+
u(!1), V.current = !1;
|
|
7853
7853
|
}
|
|
7854
7854
|
}
|
|
7855
7855
|
}, [e, t, a]);
|
|
7856
7856
|
ve(() => {
|
|
7857
|
-
e &&
|
|
7857
|
+
e && N.current !== e && K();
|
|
7858
7858
|
}, [e]);
|
|
7859
|
-
const
|
|
7859
|
+
const q = Z(
|
|
7860
7860
|
async (F) => {
|
|
7861
7861
|
y(!0), D(null);
|
|
7862
7862
|
try {
|
|
7863
7863
|
const M = await t.submitRiskScoring(F);
|
|
7864
|
-
return
|
|
7864
|
+
return x(M), M;
|
|
7865
7865
|
} catch (M) {
|
|
7866
7866
|
throw D(M), M;
|
|
7867
7867
|
} finally {
|
|
@@ -7878,30 +7878,30 @@ function ua(e) {
|
|
|
7878
7878
|
isSubmitting: g,
|
|
7879
7879
|
error: f,
|
|
7880
7880
|
load: K,
|
|
7881
|
-
submit:
|
|
7881
|
+
submit: q
|
|
7882
7882
|
};
|
|
7883
7883
|
}
|
|
7884
7884
|
function Ri() {
|
|
7885
|
-
const { applicantService: e, config: t } = Te(), [a, r] =
|
|
7886
|
-
const
|
|
7887
|
-
return (T === "x" ?
|
|
7885
|
+
const { applicantService: e, config: t } = Te(), [a, r] = C(!1), [n, o] = C(null), s = ge(!1), c = ge(!1), u = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(T) {
|
|
7886
|
+
const x = Math.random() * 16 | 0;
|
|
7887
|
+
return (T === "x" ? x : x & 3 | 8).toString(16);
|
|
7888
7888
|
}), g = Z(
|
|
7889
7889
|
async (T) => {
|
|
7890
|
-
var
|
|
7890
|
+
var x;
|
|
7891
7891
|
if (s.current)
|
|
7892
7892
|
throw _.debug("Applicant creation already in progress, skipping"), new Error("Creation already in progress");
|
|
7893
7893
|
s.current = !0, r(!0), o(null);
|
|
7894
7894
|
try {
|
|
7895
|
-
if (T.applicantAdditionalDatas || (T.applicantAdditionalDatas = []), (
|
|
7896
|
-
const
|
|
7897
|
-
_.debug(`SardinAI session key generated: ${
|
|
7895
|
+
if (T.applicantAdditionalDatas || (T.applicantAdditionalDatas = []), (x = t.identityProviders) != null && x.sardinai) {
|
|
7896
|
+
const N = u();
|
|
7897
|
+
_.debug(`SardinAI session key generated: ${N}`), T.applicantAdditionalDatas.push({
|
|
7898
7898
|
paramName: "sessionKey",
|
|
7899
|
-
value:
|
|
7899
|
+
value: N
|
|
7900
7900
|
});
|
|
7901
7901
|
}
|
|
7902
7902
|
return await e.createApplicant(T);
|
|
7903
|
-
} catch (
|
|
7904
|
-
throw o(
|
|
7903
|
+
} catch (V) {
|
|
7904
|
+
throw o(V), V;
|
|
7905
7905
|
} finally {
|
|
7906
7906
|
r(!1), s.current = !1;
|
|
7907
7907
|
}
|
|
@@ -7912,8 +7912,8 @@ function Ri() {
|
|
|
7912
7912
|
r(!0), o(null);
|
|
7913
7913
|
try {
|
|
7914
7914
|
return await e.createCompanyApplicant(T);
|
|
7915
|
-
} catch (
|
|
7916
|
-
throw o(
|
|
7915
|
+
} catch (x) {
|
|
7916
|
+
throw o(x), x;
|
|
7917
7917
|
} finally {
|
|
7918
7918
|
r(!1);
|
|
7919
7919
|
}
|
|
@@ -7924,8 +7924,8 @@ function Ri() {
|
|
|
7924
7924
|
c.current = !0, r(!0), o(null);
|
|
7925
7925
|
try {
|
|
7926
7926
|
return await e.getApplicantData(T);
|
|
7927
|
-
} catch (
|
|
7928
|
-
throw o(
|
|
7927
|
+
} catch (x) {
|
|
7928
|
+
throw o(x), x;
|
|
7929
7929
|
} finally {
|
|
7930
7930
|
r(!1), c.current = !1;
|
|
7931
7931
|
}
|
|
@@ -7936,8 +7936,8 @@ function Ri() {
|
|
|
7936
7936
|
r(!0), o(null);
|
|
7937
7937
|
try {
|
|
7938
7938
|
await e.stopProgress(T);
|
|
7939
|
-
} catch (
|
|
7940
|
-
throw o(
|
|
7939
|
+
} catch (x) {
|
|
7940
|
+
throw o(x), x;
|
|
7941
7941
|
} finally {
|
|
7942
7942
|
r(!1);
|
|
7943
7943
|
}
|
|
@@ -8364,7 +8364,7 @@ const mi = 280, fa = ({
|
|
|
8364
8364
|
readOnly: s = !1,
|
|
8365
8365
|
required: c = !1
|
|
8366
8366
|
}) => {
|
|
8367
|
-
const { t: u } = Ie(), g = n ?? u("common.select"), y = o || s, [f, D] =
|
|
8367
|
+
const { t: u } = Ie(), g = n ?? u("common.select"), y = o || s, [f, D] = C(!1), [T, x] = C(""), [V, N] = C(null), [K, q] = C({
|
|
8368
8368
|
bg: "#ffffff",
|
|
8369
8369
|
borderColor: "#d1d5db",
|
|
8370
8370
|
textPrimary: "#111827",
|
|
@@ -8372,13 +8372,13 @@ const mi = 280, fa = ({
|
|
|
8372
8372
|
primaryColor: "#2563eb",
|
|
8373
8373
|
primaryLight: "#eff6ff",
|
|
8374
8374
|
hoverBg: "#f9fafb"
|
|
8375
|
-
}), F = ge(null), M = ge(null),
|
|
8375
|
+
}), F = ge(null), M = ge(null), U = ge(null), G = Z(() => {
|
|
8376
8376
|
if (!M.current) return null;
|
|
8377
8377
|
const A = M.current.getBoundingClientRect(), H = window.innerHeight - A.bottom < mi && A.top > mi;
|
|
8378
8378
|
return { top: H ? A.top : A.bottom + 4, left: A.left, width: A.width, openUp: H };
|
|
8379
8379
|
}, []), se = Z(() => {
|
|
8380
8380
|
const A = getComputedStyle(document.querySelector(".metakyc-sdk") || document.documentElement), E = (ye, fe) => A.getPropertyValue(ye).trim() || fe, H = E("--metakyc-input-bg", E("--metakyc-background", "#ffffff"));
|
|
8381
|
-
|
|
8381
|
+
q({
|
|
8382
8382
|
bg: H,
|
|
8383
8383
|
borderColor: E("--metakyc-input-border", E("--metakyc-border", "#d1d5db")),
|
|
8384
8384
|
textPrimary: E("--metakyc-input-text", E("--metakyc-text-primary", "#111827")),
|
|
@@ -8391,23 +8391,23 @@ const mi = 280, fa = ({
|
|
|
8391
8391
|
if (y) return;
|
|
8392
8392
|
se();
|
|
8393
8393
|
const A = G();
|
|
8394
|
-
A &&
|
|
8394
|
+
A && N(A), D(!0);
|
|
8395
8395
|
}, [y, G, se]), L = Z(() => {
|
|
8396
|
-
D(!1),
|
|
8396
|
+
D(!1), x("");
|
|
8397
8397
|
}, []);
|
|
8398
8398
|
ve(() => {
|
|
8399
8399
|
if (!f) return;
|
|
8400
8400
|
const A = (E) => {
|
|
8401
8401
|
var ye, fe;
|
|
8402
8402
|
const H = E.target;
|
|
8403
|
-
!((ye = F.current) != null && ye.contains(H)) && !((fe =
|
|
8403
|
+
!((ye = F.current) != null && ye.contains(H)) && !((fe = U.current) != null && fe.contains(H)) && L();
|
|
8404
8404
|
};
|
|
8405
8405
|
return document.addEventListener("mousedown", A), () => document.removeEventListener("mousedown", A);
|
|
8406
8406
|
}, [f, L]), ve(() => {
|
|
8407
8407
|
if (!f) return;
|
|
8408
8408
|
const A = () => {
|
|
8409
8409
|
const E = G();
|
|
8410
|
-
E &&
|
|
8410
|
+
E && N(E);
|
|
8411
8411
|
};
|
|
8412
8412
|
return window.addEventListener("scroll", A, !0), window.addEventListener("resize", A), () => {
|
|
8413
8413
|
window.removeEventListener("scroll", A, !0), window.removeEventListener("resize", A);
|
|
@@ -8422,17 +8422,17 @@ const mi = 280, fa = ({
|
|
|
8422
8422
|
}, $ = (A) => {
|
|
8423
8423
|
var E;
|
|
8424
8424
|
return ((E = r.find((H) => H.value === A)) == null ? void 0 : E.label) || A;
|
|
8425
|
-
}, { bg: ee, borderColor: pe, textPrimary: me, textSecondary: Re, primaryColor: ce, primaryLight: Y, hoverBg: Q } = K, re = f &&
|
|
8425
|
+
}, { bg: ee, borderColor: pe, textPrimary: me, textSecondary: Re, primaryColor: ce, primaryLight: Y, hoverBg: Q } = K, re = f && V && /* @__PURE__ */ l(
|
|
8426
8426
|
"div",
|
|
8427
8427
|
{
|
|
8428
|
-
ref:
|
|
8428
|
+
ref: U,
|
|
8429
8429
|
className: "metakyc-multiselect-dropdown",
|
|
8430
8430
|
style: {
|
|
8431
8431
|
position: "fixed",
|
|
8432
|
-
top:
|
|
8433
|
-
bottom:
|
|
8434
|
-
left:
|
|
8435
|
-
width:
|
|
8432
|
+
top: V.openUp ? void 0 : V.top,
|
|
8433
|
+
bottom: V.openUp ? window.innerHeight - V.top + 4 : void 0,
|
|
8434
|
+
left: V.left,
|
|
8435
|
+
width: V.width,
|
|
8436
8436
|
zIndex: 99999,
|
|
8437
8437
|
borderRadius: "8px",
|
|
8438
8438
|
boxShadow: "0 4px 16px rgba(0,0,0,0.18)",
|
|
@@ -8446,7 +8446,7 @@ const mi = 280, fa = ({
|
|
|
8446
8446
|
{
|
|
8447
8447
|
type: "text",
|
|
8448
8448
|
value: T,
|
|
8449
|
-
onChange: (A) =>
|
|
8449
|
+
onChange: (A) => x(A.target.value),
|
|
8450
8450
|
placeholder: u("common.search"),
|
|
8451
8451
|
autoFocus: !0,
|
|
8452
8452
|
onClick: (A) => A.stopPropagation(),
|
|
@@ -8516,7 +8516,7 @@ const mi = 280, fa = ({
|
|
|
8516
8516
|
{
|
|
8517
8517
|
type: "button",
|
|
8518
8518
|
onClick: () => {
|
|
8519
|
-
a([]),
|
|
8519
|
+
a([]), x("");
|
|
8520
8520
|
},
|
|
8521
8521
|
style: { fontSize: "12px", color: "#ef4444", background: "none", border: "none", cursor: "pointer", padding: 0 },
|
|
8522
8522
|
children: [
|
|
@@ -8636,7 +8636,7 @@ const mi = 280, fa = ({
|
|
|
8636
8636
|
className: y
|
|
8637
8637
|
}) => {
|
|
8638
8638
|
var fe;
|
|
8639
|
-
const { t: f } = Ie(), D = n ?? f("common.select"), T = c || u, [
|
|
8639
|
+
const { t: f } = Ie(), D = n ?? f("common.select"), T = c || u, [x, V] = C(!1), [N, K] = C(""), [q, F] = C(null), [M, U] = C({
|
|
8640
8640
|
bg: "#ffffff",
|
|
8641
8641
|
border: "#d1d5db",
|
|
8642
8642
|
text: "#111827",
|
|
@@ -8645,8 +8645,8 @@ const mi = 280, fa = ({
|
|
|
8645
8645
|
primaryLight: "#eff6ff",
|
|
8646
8646
|
hoverBg: "#f9fafb"
|
|
8647
8647
|
}), G = Z(() => {
|
|
8648
|
-
const
|
|
8649
|
-
|
|
8648
|
+
const W = getComputedStyle(document.querySelector(".metakyc-sdk") || document.documentElement), J = (Ne, Se) => W.getPropertyValue(Ne).trim() || Se, ke = J("--metakyc-input-bg", J("--metakyc-background", "#ffffff"));
|
|
8649
|
+
U({
|
|
8650
8650
|
bg: ke,
|
|
8651
8651
|
border: J("--metakyc-input-border", J("--metakyc-border", "#d1d5db")),
|
|
8652
8652
|
text: J("--metakyc-input-text", J("--metakyc-text-primary", "#111827")),
|
|
@@ -8657,59 +8657,59 @@ const mi = 280, fa = ({
|
|
|
8657
8657
|
});
|
|
8658
8658
|
}, []), se = ge(null), k = ge(null), L = ge(null), j = ge(null), X = Z(() => {
|
|
8659
8659
|
if (!k.current) return null;
|
|
8660
|
-
const
|
|
8660
|
+
const W = k.current.getBoundingClientRect(), ke = window.innerHeight - W.bottom < pi && W.top > pi;
|
|
8661
8661
|
return {
|
|
8662
|
-
top: ke ?
|
|
8663
|
-
left:
|
|
8664
|
-
width:
|
|
8662
|
+
top: ke ? W.top : W.bottom + 4,
|
|
8663
|
+
left: W.left,
|
|
8664
|
+
width: W.width,
|
|
8665
8665
|
openUp: ke
|
|
8666
8666
|
};
|
|
8667
8667
|
}, []), te = Z(() => {
|
|
8668
8668
|
if (T) return;
|
|
8669
8669
|
G();
|
|
8670
|
-
const
|
|
8671
|
-
|
|
8670
|
+
const W = X();
|
|
8671
|
+
W && F(W), V(!0);
|
|
8672
8672
|
}, [T, X, G]), $ = Z(() => {
|
|
8673
|
-
|
|
8674
|
-
}, []), ee = () =>
|
|
8673
|
+
V(!1), K("");
|
|
8674
|
+
}, []), ee = () => x ? $() : te();
|
|
8675
8675
|
ve(() => {
|
|
8676
|
-
if (!
|
|
8677
|
-
const
|
|
8676
|
+
if (!x) return;
|
|
8677
|
+
const W = (J) => {
|
|
8678
8678
|
var Ne, Se;
|
|
8679
8679
|
const ke = J.target;
|
|
8680
8680
|
!((Ne = se.current) != null && Ne.contains(ke)) && !((Se = L.current) != null && Se.contains(ke)) && $();
|
|
8681
8681
|
};
|
|
8682
|
-
return document.addEventListener("mousedown",
|
|
8683
|
-
}, [
|
|
8684
|
-
if (!
|
|
8685
|
-
const
|
|
8682
|
+
return document.addEventListener("mousedown", W), () => document.removeEventListener("mousedown", W);
|
|
8683
|
+
}, [x, $]), ve(() => {
|
|
8684
|
+
if (!x) return;
|
|
8685
|
+
const W = () => {
|
|
8686
8686
|
const J = X();
|
|
8687
8687
|
J && F(J);
|
|
8688
8688
|
};
|
|
8689
|
-
return window.addEventListener("scroll",
|
|
8690
|
-
window.removeEventListener("scroll",
|
|
8689
|
+
return window.addEventListener("scroll", W, !0), window.addEventListener("resize", W), () => {
|
|
8690
|
+
window.removeEventListener("scroll", W, !0), window.removeEventListener("resize", W);
|
|
8691
8691
|
};
|
|
8692
|
-
}, [
|
|
8693
|
-
|
|
8694
|
-
var
|
|
8695
|
-
return (
|
|
8692
|
+
}, [x, X]), ve(() => {
|
|
8693
|
+
x && j.current && setTimeout(() => {
|
|
8694
|
+
var W;
|
|
8695
|
+
return (W = j.current) == null ? void 0 : W.focus();
|
|
8696
8696
|
}, 0);
|
|
8697
|
-
}, [
|
|
8697
|
+
}, [x]);
|
|
8698
8698
|
const pe = r.filter(
|
|
8699
|
-
(
|
|
8700
|
-
), me = (fe = r.find((
|
|
8701
|
-
T || J || (s(
|
|
8702
|
-
}, { bg: ce, border: Y, text: Q, textSecondary: re, primary: A, primaryLight: E, hoverBg: H } = M, ye =
|
|
8699
|
+
(W) => W.label.toLowerCase().includes(N.toLowerCase()) || W.value.toLowerCase().includes(N.toLowerCase())
|
|
8700
|
+
), me = (fe = r.find((W) => W.value === o)) == null ? void 0 : fe.label, Re = (W, J) => {
|
|
8701
|
+
T || J || (s(W), $());
|
|
8702
|
+
}, { bg: ce, border: Y, text: Q, textSecondary: re, primary: A, primaryLight: E, hoverBg: H } = M, ye = x && q && /* @__PURE__ */ l(
|
|
8703
8703
|
"div",
|
|
8704
8704
|
{
|
|
8705
8705
|
ref: L,
|
|
8706
8706
|
className: "metakyc-searchable-select-dropdown",
|
|
8707
8707
|
style: {
|
|
8708
8708
|
position: "fixed",
|
|
8709
|
-
top:
|
|
8710
|
-
bottom:
|
|
8711
|
-
left:
|
|
8712
|
-
width:
|
|
8709
|
+
top: q.openUp ? void 0 : q.top,
|
|
8710
|
+
bottom: q.openUp ? window.innerHeight - q.top + 4 : void 0,
|
|
8711
|
+
left: q.left,
|
|
8712
|
+
width: q.width,
|
|
8713
8713
|
zIndex: 99999,
|
|
8714
8714
|
borderRadius: "8px",
|
|
8715
8715
|
boxShadow: "0 4px 16px rgba(0,0,0,0.18)",
|
|
@@ -8723,10 +8723,10 @@ const mi = 280, fa = ({
|
|
|
8723
8723
|
{
|
|
8724
8724
|
ref: j,
|
|
8725
8725
|
type: "text",
|
|
8726
|
-
value:
|
|
8727
|
-
onChange: (
|
|
8726
|
+
value: N,
|
|
8727
|
+
onChange: (W) => K(W.target.value),
|
|
8728
8728
|
placeholder: f("common.search"),
|
|
8729
|
-
onClick: (
|
|
8729
|
+
onClick: (W) => W.stopPropagation(),
|
|
8730
8730
|
className: "metakyc-searchable-select-search w-full",
|
|
8731
8731
|
style: {
|
|
8732
8732
|
display: "block",
|
|
@@ -8740,12 +8740,12 @@ const mi = 280, fa = ({
|
|
|
8740
8740
|
outline: "none",
|
|
8741
8741
|
boxSizing: "border-box"
|
|
8742
8742
|
},
|
|
8743
|
-
onFocus: (
|
|
8743
|
+
onFocus: (W) => {
|
|
8744
8744
|
const J = getComputedStyle(document.querySelector(".metakyc-sdk") || document.documentElement), ke = J.getPropertyValue("--metakyc-input-border-focus").trim() || J.getPropertyValue("--metakyc-primary").trim() || "#2563eb";
|
|
8745
|
-
|
|
8745
|
+
W.currentTarget.style.backgroundColor = ce, W.currentTarget.style.color = Q, W.currentTarget.style.borderColor = ke, W.currentTarget.style.outline = "none", W.currentTarget.style.boxShadow = `0 0 0 2px ${ke}33`;
|
|
8746
8746
|
},
|
|
8747
|
-
onBlur: (
|
|
8748
|
-
|
|
8747
|
+
onBlur: (W) => {
|
|
8748
|
+
W.currentTarget.style.backgroundColor = ce, W.currentTarget.style.color = Q, W.currentTarget.style.borderColor = Y, W.currentTarget.style.outline = "none", W.currentTarget.style.boxShadow = "none";
|
|
8749
8749
|
}
|
|
8750
8750
|
}
|
|
8751
8751
|
) }),
|
|
@@ -8759,31 +8759,31 @@ const mi = 280, fa = ({
|
|
|
8759
8759
|
maxHeight: "208px",
|
|
8760
8760
|
overflowY: "auto"
|
|
8761
8761
|
},
|
|
8762
|
-
children: pe.length === 0 ? /* @__PURE__ */ i("li", { style: { padding: "8px 12px", fontSize: "13px", color: re }, children: f("common.noResults") }) : pe.map((
|
|
8763
|
-
const J =
|
|
8762
|
+
children: pe.length === 0 ? /* @__PURE__ */ i("li", { style: { padding: "8px 12px", fontSize: "13px", color: re }, children: f("common.noResults") }) : pe.map((W) => {
|
|
8763
|
+
const J = W.value === o;
|
|
8764
8764
|
return /* @__PURE__ */ i(
|
|
8765
8765
|
"li",
|
|
8766
8766
|
{
|
|
8767
8767
|
className: "metakyc-searchable-select-option",
|
|
8768
|
-
onClick: () => Re(
|
|
8768
|
+
onClick: () => Re(W.value, W.disabled),
|
|
8769
8769
|
style: {
|
|
8770
8770
|
padding: "8px 12px",
|
|
8771
8771
|
fontSize: "13px",
|
|
8772
|
-
cursor:
|
|
8773
|
-
opacity:
|
|
8772
|
+
cursor: W.disabled ? "not-allowed" : "pointer",
|
|
8773
|
+
opacity: W.disabled ? 0.4 : 1,
|
|
8774
8774
|
backgroundColor: J ? E : "transparent",
|
|
8775
8775
|
color: J ? A : Q,
|
|
8776
8776
|
userSelect: "none"
|
|
8777
8777
|
},
|
|
8778
8778
|
onMouseEnter: (ke) => {
|
|
8779
|
-
!J && !
|
|
8779
|
+
!J && !W.disabled && (ke.currentTarget.style.backgroundColor = H);
|
|
8780
8780
|
},
|
|
8781
8781
|
onMouseLeave: (ke) => {
|
|
8782
8782
|
J || (ke.currentTarget.style.backgroundColor = "transparent");
|
|
8783
8783
|
},
|
|
8784
|
-
children:
|
|
8784
|
+
children: W.label
|
|
8785
8785
|
},
|
|
8786
|
-
|
|
8786
|
+
W.value
|
|
8787
8787
|
);
|
|
8788
8788
|
})
|
|
8789
8789
|
}
|
|
@@ -8815,8 +8815,8 @@ const mi = 280, fa = ({
|
|
|
8815
8815
|
role: "button",
|
|
8816
8816
|
tabIndex: T ? -1 : 0,
|
|
8817
8817
|
onClick: ee,
|
|
8818
|
-
onKeyDown: (
|
|
8819
|
-
(
|
|
8818
|
+
onKeyDown: (W) => {
|
|
8819
|
+
(W.key === "Enter" || W.key === " ") && (W.preventDefault(), ee()), W.key === "Escape" && $();
|
|
8820
8820
|
},
|
|
8821
8821
|
className: We(
|
|
8822
8822
|
"metakyc-searchable-select-trigger",
|
|
@@ -8828,9 +8828,9 @@ const mi = 280, fa = ({
|
|
|
8828
8828
|
style: {
|
|
8829
8829
|
backgroundColor: "var(--metakyc-input-bg, #ffffff)",
|
|
8830
8830
|
color: me ? "var(--metakyc-input-text, var(--metakyc-text-primary, #111827))" : "var(--metakyc-input-placeholder, var(--metakyc-text-muted, #9ca3af))",
|
|
8831
|
-
borderColor: t ? "var(--metakyc-danger, #ef4444)" :
|
|
8831
|
+
borderColor: t ? "var(--metakyc-danger, #ef4444)" : x ? "var(--metakyc-input-border-focus, var(--metakyc-primary, #2563eb))" : "var(--metakyc-input-border, var(--metakyc-border, #d1d5db))",
|
|
8832
8832
|
minHeight: "38px",
|
|
8833
|
-
outline:
|
|
8833
|
+
outline: x ? "2px solid var(--metakyc-input-border-focus, var(--metakyc-primary, #2563eb))" : "none",
|
|
8834
8834
|
outlineOffset: "-1px"
|
|
8835
8835
|
},
|
|
8836
8836
|
children: [
|
|
@@ -8840,7 +8840,7 @@ const mi = 280, fa = ({
|
|
|
8840
8840
|
{
|
|
8841
8841
|
className: "flex-shrink-0 text-xs pointer-events-none",
|
|
8842
8842
|
style: { color: "var(--metakyc-text-secondary, #6b7280)" },
|
|
8843
|
-
children:
|
|
8843
|
+
children: x ? "▲" : "▼"
|
|
8844
8844
|
}
|
|
8845
8845
|
)
|
|
8846
8846
|
]
|
|
@@ -8870,26 +8870,26 @@ const ha = ({
|
|
|
8870
8870
|
value: u = [],
|
|
8871
8871
|
className: g
|
|
8872
8872
|
}) => {
|
|
8873
|
-
const { t: y } = Ie(), [f, D] =
|
|
8873
|
+
const { t: y } = Ie(), [f, D] = C(!1), [T, x] = C(null), V = ge(null), N = Z((k) => {
|
|
8874
8874
|
if (!k) return;
|
|
8875
|
-
|
|
8875
|
+
x(null);
|
|
8876
8876
|
const L = Array.from(k);
|
|
8877
8877
|
if (o && L.filter((X) => X.size > o).length > 0) {
|
|
8878
|
-
|
|
8878
|
+
x(`File exceeds the maximum size of ${Ot(o)}`);
|
|
8879
8879
|
return;
|
|
8880
8880
|
}
|
|
8881
8881
|
c == null || c(n ? [...u, ...L] : [L[0]]);
|
|
8882
8882
|
}, [o, n, c, u]), K = Z((k) => {
|
|
8883
8883
|
k.preventDefault(), k.stopPropagation(), D(!0);
|
|
8884
|
-
}, []),
|
|
8884
|
+
}, []), q = Z((k) => {
|
|
8885
8885
|
k.preventDefault(), k.stopPropagation(), D(!1);
|
|
8886
8886
|
}, []), F = Z((k) => {
|
|
8887
|
-
k.preventDefault(), k.stopPropagation(), D(!1),
|
|
8888
|
-
}, [
|
|
8887
|
+
k.preventDefault(), k.stopPropagation(), D(!1), N(k.dataTransfer.files);
|
|
8888
|
+
}, [N]), M = () => {
|
|
8889
8889
|
var k;
|
|
8890
|
-
(k =
|
|
8891
|
-
},
|
|
8892
|
-
|
|
8890
|
+
(k = V.current) == null || k.click();
|
|
8891
|
+
}, U = (k) => {
|
|
8892
|
+
x(null);
|
|
8893
8893
|
const L = u.filter((j, X) => X !== k);
|
|
8894
8894
|
c == null || c(L);
|
|
8895
8895
|
}, G = a || T, se = u.length > 0;
|
|
@@ -8918,7 +8918,7 @@ const ha = ({
|
|
|
8918
8918
|
className: "metakyc-file-dropzone",
|
|
8919
8919
|
onClick: M,
|
|
8920
8920
|
onDragOver: K,
|
|
8921
|
-
onDragLeave:
|
|
8921
|
+
onDragLeave: q,
|
|
8922
8922
|
onDrop: F,
|
|
8923
8923
|
style: {
|
|
8924
8924
|
border: `2px dashed ${G ? "var(--metakyc-danger, #ef4444)" : f ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #d1d5db)"}`,
|
|
@@ -8933,13 +8933,13 @@ const ha = ({
|
|
|
8933
8933
|
/* @__PURE__ */ i(
|
|
8934
8934
|
"input",
|
|
8935
8935
|
{
|
|
8936
|
-
ref:
|
|
8936
|
+
ref: V,
|
|
8937
8937
|
type: "file",
|
|
8938
8938
|
style: { display: "none" },
|
|
8939
8939
|
accept: r,
|
|
8940
8940
|
multiple: n,
|
|
8941
8941
|
onChange: (k) => {
|
|
8942
|
-
|
|
8942
|
+
N(k.target.files), k.target.value = "";
|
|
8943
8943
|
}
|
|
8944
8944
|
}
|
|
8945
8945
|
),
|
|
@@ -9061,7 +9061,7 @@ const ha = ({
|
|
|
9061
9061
|
{
|
|
9062
9062
|
type: "button",
|
|
9063
9063
|
onClick: ($) => {
|
|
9064
|
-
$.stopPropagation(),
|
|
9064
|
+
$.stopPropagation(), U(L);
|
|
9065
9065
|
},
|
|
9066
9066
|
style: {
|
|
9067
9067
|
display: "flex",
|
|
@@ -9322,29 +9322,29 @@ const Aa = ({
|
|
|
9322
9322
|
onComplete: t,
|
|
9323
9323
|
onBack: a
|
|
9324
9324
|
}) => {
|
|
9325
|
-
const { t: r } = Ie(), { questionnaire: n, initialAnswers: o, isLoading: s, isSubmitting: c, error: u, submit: g } = sa(e), [y, f] =
|
|
9325
|
+
const { t: r } = Ie(), { questionnaire: n, initialAnswers: o, isLoading: s, isSubmitting: c, error: u, submit: g } = sa(e), [y, f] = C({}), [D, T] = C({}), [x, V] = C(0);
|
|
9326
9326
|
he.useEffect(() => {
|
|
9327
9327
|
o && Object.keys(o).length > 0 && Object.keys(y).length === 0 && f(o);
|
|
9328
9328
|
}, [o]);
|
|
9329
|
-
const
|
|
9329
|
+
const N = Ue(
|
|
9330
9330
|
() => n ? Ra(n.questionGroups) : [],
|
|
9331
9331
|
[n]
|
|
9332
|
-
), K =
|
|
9332
|
+
), K = x === N.length - 1, q = N[x] ?? [], F = Z((k, L) => {
|
|
9333
9333
|
f((j) => ({ ...j, [k]: L })), T((j) => {
|
|
9334
9334
|
const X = { ...j };
|
|
9335
9335
|
return delete X[k], X;
|
|
9336
9336
|
});
|
|
9337
9337
|
}, []), M = Z(() => {
|
|
9338
9338
|
const k = {};
|
|
9339
|
-
for (const { question: L } of
|
|
9339
|
+
for (const { question: L } of q) {
|
|
9340
9340
|
const j = Ta(L, y[L.id] ?? []);
|
|
9341
9341
|
j && (k[L.id] = j);
|
|
9342
9342
|
}
|
|
9343
9343
|
return T((L) => ({ ...L, ...k })), Object.keys(k).length === 0;
|
|
9344
|
-
}, [
|
|
9345
|
-
M() &&
|
|
9344
|
+
}, [q, y]), U = () => {
|
|
9345
|
+
M() && V((k) => k + 1);
|
|
9346
9346
|
}, G = () => {
|
|
9347
|
-
|
|
9347
|
+
x > 0 ? V((k) => k - 1) : a == null || a();
|
|
9348
9348
|
}, se = async () => {
|
|
9349
9349
|
if (!(!M() || !n))
|
|
9350
9350
|
try {
|
|
@@ -9371,23 +9371,23 @@ const Aa = ({
|
|
|
9371
9371
|
/* @__PURE__ */ l(Le, { children: [
|
|
9372
9372
|
/* @__PURE__ */ i("h2", { className: "text-lg font-bold", children: n.displayName }),
|
|
9373
9373
|
n.subtitle && /* @__PURE__ */ i("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n.subtitle }),
|
|
9374
|
-
|
|
9375
|
-
/* @__PURE__ */ i("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: r("common.pageXofY", { current:
|
|
9376
|
-
/* @__PURE__ */ i("div", { className: "flex items-center gap-1.5", children:
|
|
9374
|
+
N.length > 1 && /* @__PURE__ */ l("div", { className: "flex items-center justify-between mt-3", children: [
|
|
9375
|
+
/* @__PURE__ */ i("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: r("common.pageXofY", { current: x + 1, total: N.length }) }),
|
|
9376
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-1.5", children: N.map((k, L) => /* @__PURE__ */ i(
|
|
9377
9377
|
"div",
|
|
9378
9378
|
{
|
|
9379
9379
|
className: "rounded-full transition-all duration-200",
|
|
9380
9380
|
style: {
|
|
9381
9381
|
height: "6px",
|
|
9382
|
-
width: L ===
|
|
9383
|
-
backgroundColor: L <=
|
|
9382
|
+
width: L === x ? "20px" : "6px",
|
|
9383
|
+
backgroundColor: L <= x ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
|
|
9384
9384
|
}
|
|
9385
9385
|
},
|
|
9386
9386
|
L
|
|
9387
9387
|
)) })
|
|
9388
9388
|
] })
|
|
9389
9389
|
] }),
|
|
9390
|
-
/* @__PURE__ */ i(oe, { className: "space-y-6", children:
|
|
9390
|
+
/* @__PURE__ */ i(oe, { className: "space-y-6", children: q.map(({ question: k }) => /* @__PURE__ */ i(
|
|
9391
9391
|
Ia,
|
|
9392
9392
|
{
|
|
9393
9393
|
question: k,
|
|
@@ -9407,7 +9407,7 @@ const Aa = ({
|
|
|
9407
9407
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
9408
9408
|
children: [
|
|
9409
9409
|
/* @__PURE__ */ i(Li, { size: 14 }),
|
|
9410
|
-
|
|
9410
|
+
x > 0 ? r("common.previous") : r("common.back")
|
|
9411
9411
|
]
|
|
9412
9412
|
}
|
|
9413
9413
|
),
|
|
@@ -9423,7 +9423,7 @@ const Aa = ({
|
|
|
9423
9423
|
le,
|
|
9424
9424
|
{
|
|
9425
9425
|
type: "button",
|
|
9426
|
-
onClick:
|
|
9426
|
+
onClick: U,
|
|
9427
9427
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
9428
9428
|
children: [
|
|
9429
9429
|
r("common.next"),
|
|
@@ -9543,20 +9543,20 @@ const La = ({
|
|
|
9543
9543
|
onComplete: t,
|
|
9544
9544
|
onBack: a
|
|
9545
9545
|
}) => {
|
|
9546
|
-
const { t: r } = Ie(), { uploadDocument: n, isLoading: o, isSubmitting: s, error: c, submit: u } = la(e), [g, y] =
|
|
9546
|
+
const { t: r } = Ie(), { uploadDocument: n, isLoading: o, isSubmitting: s, error: c, submit: u } = la(e), [g, y] = C({}), [f, D] = C(null), [T, x] = C(0), [V, N] = C({}), K = Ue(
|
|
9547
9547
|
() => n ? za(n.uploadDocumentFiles) : [],
|
|
9548
9548
|
[n]
|
|
9549
|
-
),
|
|
9549
|
+
), q = K[T] ?? [], F = T === K.length - 1, M = K.length, U = Z(() => {
|
|
9550
9550
|
const L = {};
|
|
9551
|
-
for (const j of
|
|
9551
|
+
for (const j of q)
|
|
9552
9552
|
j.isRequired && (g[j.id] || []).length === 0 && (L[j.id] = `${j.displayName} is required`);
|
|
9553
|
-
return
|
|
9554
|
-
}, [
|
|
9555
|
-
|
|
9553
|
+
return N(L), Object.keys(L).length === 0;
|
|
9554
|
+
}, [q, g]), G = () => {
|
|
9555
|
+
U() && (x((L) => L + 1), N({}));
|
|
9556
9556
|
}, se = () => {
|
|
9557
|
-
T > 0 ? (
|
|
9557
|
+
T > 0 ? (x((L) => L - 1), N({})) : a == null || a();
|
|
9558
9558
|
}, k = async () => {
|
|
9559
|
-
if (!(!
|
|
9559
|
+
if (!(!U() || !n)) {
|
|
9560
9560
|
D(null);
|
|
9561
9561
|
try {
|
|
9562
9562
|
const L = await Promise.all(
|
|
@@ -9680,7 +9680,7 @@ const La = ({
|
|
|
9680
9680
|
lineHeight: 1.5
|
|
9681
9681
|
}, children: n.description })
|
|
9682
9682
|
] }),
|
|
9683
|
-
/* @__PURE__ */ i(oe, { children: /* @__PURE__ */ i("div", { style: { display: "flex", flexDirection: "column", gap: "24px" }, children:
|
|
9683
|
+
/* @__PURE__ */ i(oe, { children: /* @__PURE__ */ i("div", { style: { display: "flex", flexDirection: "column", gap: "24px" }, children: q.map((L) => /* @__PURE__ */ i(
|
|
9684
9684
|
ha,
|
|
9685
9685
|
{
|
|
9686
9686
|
label: L.displayName,
|
|
@@ -9689,10 +9689,10 @@ const La = ({
|
|
|
9689
9689
|
multiple: L.multipleFile,
|
|
9690
9690
|
maxSize: L.maxEachFileSizeByte,
|
|
9691
9691
|
required: L.isRequired,
|
|
9692
|
-
error:
|
|
9692
|
+
error: V[L.id],
|
|
9693
9693
|
value: g[L.id] || [],
|
|
9694
9694
|
onChange: (j) => {
|
|
9695
|
-
D(null),
|
|
9695
|
+
D(null), N((X) => {
|
|
9696
9696
|
const te = { ...X };
|
|
9697
9697
|
return delete te[L.id], te;
|
|
9698
9698
|
}), y((X) => ({ ...X, [L.id]: j }));
|
|
@@ -9861,19 +9861,19 @@ const Va = ({
|
|
|
9861
9861
|
onComplete: t,
|
|
9862
9862
|
onBack: a
|
|
9863
9863
|
}) => {
|
|
9864
|
-
const { t: r } = Ie(), { config: n } = Te(), o = n.locale ?? "en", { criteria: s, initialAnswers: c, isLoading: u, isSubmitting: g, error: y, submit: f } = ua(e), [D, T] =
|
|
9864
|
+
const { t: r } = Ie(), { config: n } = Te(), o = n.locale ?? "en", { criteria: s, initialAnswers: c, isLoading: u, isSubmitting: g, error: y, submit: f } = ua(e), [D, T] = C({}), [x, V] = C({}), [N, K] = C(0), [q, F] = C(!1);
|
|
9865
9865
|
he.useEffect(() => {
|
|
9866
9866
|
c && Object.keys(c).length > 0 && Object.keys(D).length === 0 && T(c);
|
|
9867
9867
|
}, [c]);
|
|
9868
9868
|
const M = Ue(
|
|
9869
9869
|
() => s && s.length > 0 ? Fa(s) : [],
|
|
9870
9870
|
[s]
|
|
9871
|
-
),
|
|
9871
|
+
), U = N === M.length - 1, G = M[N] ?? [];
|
|
9872
9872
|
he.useEffect(() => {
|
|
9873
|
-
!u && s && s.length === 0 && !
|
|
9874
|
-
}, [u, s,
|
|
9873
|
+
!u && s && s.length === 0 && !q && !g && (F(!0), f({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
|
|
9874
|
+
}, [u, s, q, g, f, e, t]);
|
|
9875
9875
|
const se = Z((te, $) => {
|
|
9876
|
-
T((ee) => ({ ...ee, [te]: $ })),
|
|
9876
|
+
T((ee) => ({ ...ee, [te]: $ })), V((ee) => {
|
|
9877
9877
|
const pe = { ...ee };
|
|
9878
9878
|
return delete pe[te], pe;
|
|
9879
9879
|
});
|
|
@@ -9883,11 +9883,11 @@ const Va = ({
|
|
|
9883
9883
|
const ee = ja($, D[$.id] ?? []);
|
|
9884
9884
|
ee && (te[$.id] = ee);
|
|
9885
9885
|
}
|
|
9886
|
-
return
|
|
9886
|
+
return V(($) => ({ ...$, ...te })), Object.keys(te).length === 0;
|
|
9887
9887
|
}, [G, D]), L = () => {
|
|
9888
9888
|
k() && K((te) => te + 1);
|
|
9889
9889
|
}, j = () => {
|
|
9890
|
-
|
|
9890
|
+
N > 0 ? K((te) => te - 1) : a == null || a();
|
|
9891
9891
|
}, X = async () => {
|
|
9892
9892
|
if (!(!k() || !s))
|
|
9893
9893
|
try {
|
|
@@ -9915,15 +9915,15 @@ const Va = ({
|
|
|
9915
9915
|
/* @__PURE__ */ i("h2", { className: "text-lg font-bold", children: r("riskScoring.title") }),
|
|
9916
9916
|
/* @__PURE__ */ i("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: r("riskScoring.subtitle") }),
|
|
9917
9917
|
M.length > 1 && /* @__PURE__ */ l("div", { className: "flex items-center justify-between mt-3", children: [
|
|
9918
|
-
/* @__PURE__ */ i("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: r("common.pageXofY", { current:
|
|
9918
|
+
/* @__PURE__ */ i("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: r("common.pageXofY", { current: N + 1, total: M.length }) }),
|
|
9919
9919
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-1.5", children: M.map((te, $) => /* @__PURE__ */ i(
|
|
9920
9920
|
"div",
|
|
9921
9921
|
{
|
|
9922
9922
|
className: "rounded-full transition-all duration-200",
|
|
9923
9923
|
style: {
|
|
9924
9924
|
height: "6px",
|
|
9925
|
-
width: $ ===
|
|
9926
|
-
backgroundColor: $ <=
|
|
9925
|
+
width: $ === N ? "20px" : "6px",
|
|
9926
|
+
backgroundColor: $ <= N ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
|
|
9927
9927
|
}
|
|
9928
9928
|
},
|
|
9929
9929
|
$
|
|
@@ -9935,7 +9935,7 @@ const Va = ({
|
|
|
9935
9935
|
{
|
|
9936
9936
|
criterion: te,
|
|
9937
9937
|
value: D[te.id] ?? [],
|
|
9938
|
-
error:
|
|
9938
|
+
error: x[te.id],
|
|
9939
9939
|
locale: o,
|
|
9940
9940
|
onChange: ($) => se(te.id, $)
|
|
9941
9941
|
},
|
|
@@ -9951,11 +9951,11 @@ const Va = ({
|
|
|
9951
9951
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
9952
9952
|
children: [
|
|
9953
9953
|
/* @__PURE__ */ i(Li, { size: 14 }),
|
|
9954
|
-
|
|
9954
|
+
N > 0 ? r("common.previous") : r("common.back")
|
|
9955
9955
|
]
|
|
9956
9956
|
}
|
|
9957
9957
|
),
|
|
9958
|
-
|
|
9958
|
+
U ? /* @__PURE__ */ i(le, { type: "button", isLoading: g, onClick: X, children: r("common.continue") }) : /* @__PURE__ */ l(
|
|
9959
9959
|
le,
|
|
9960
9960
|
{
|
|
9961
9961
|
type: "button",
|
|
@@ -10080,7 +10080,7 @@ const Va = ({
|
|
|
10080
10080
|
onComplete: t,
|
|
10081
10081
|
onBack: a
|
|
10082
10082
|
}) => {
|
|
10083
|
-
const { t: r } = Ie(), { investorCategorizationService: n } = Te(), [o, s] =
|
|
10083
|
+
const { t: r } = Ie(), { investorCategorizationService: n } = Te(), [o, s] = C(null), [c, u] = C(!1), [g, y] = C(null);
|
|
10084
10084
|
return /* @__PURE__ */ i("form", { onSubmit: async (D) => {
|
|
10085
10085
|
if (D.preventDefault(), o === null) {
|
|
10086
10086
|
y(r("investorCategorization.pleaseSelect"));
|
|
@@ -10093,8 +10093,8 @@ const Va = ({
|
|
|
10093
10093
|
investorType: o
|
|
10094
10094
|
};
|
|
10095
10095
|
console.log("Submitting investor categorization:", T);
|
|
10096
|
-
const
|
|
10097
|
-
console.log("Investor categorization result:",
|
|
10096
|
+
const x = await n.setInvestorCategorization(T);
|
|
10097
|
+
console.log("Investor categorization result:", x), t == null || t();
|
|
10098
10098
|
} catch (T) {
|
|
10099
10099
|
console.error("Error submitting investor categorization:", T), y(T.message || r("investorCategorization.failedToSubmit"));
|
|
10100
10100
|
} finally {
|
|
@@ -10221,7 +10221,7 @@ const Ua = ({
|
|
|
10221
10221
|
onComplete: t,
|
|
10222
10222
|
onBack: a
|
|
10223
10223
|
}) => {
|
|
10224
|
-
const { t: r } = Ie(), { appropriatenessTestService: n } = Te(), [o, s] =
|
|
10224
|
+
const { t: r } = Ie(), { appropriatenessTestService: n } = Te(), [o, s] = C(null), [c, u] = C(!0), [g, y] = C(!1), [f, D] = C(null), [T, x] = C({}), [V, N] = C(0), [K, q] = C(!1), [F, M] = C(!1), [U, G] = C(0), [se, k] = C(0), [L, j] = C(null);
|
|
10225
10225
|
ve(() => {
|
|
10226
10226
|
(async () => {
|
|
10227
10227
|
try {
|
|
@@ -10238,24 +10238,24 @@ const Ua = ({
|
|
|
10238
10238
|
}
|
|
10239
10239
|
})();
|
|
10240
10240
|
}, [e, n]), ve(() => {
|
|
10241
|
-
if (!K ||
|
|
10241
|
+
if (!K || V <= 0) return;
|
|
10242
10242
|
const E = setInterval(() => {
|
|
10243
|
-
|
|
10243
|
+
N((H) => H <= 1 ? (M(!0), 0) : H - 1);
|
|
10244
10244
|
}, 1e3);
|
|
10245
10245
|
return () => clearInterval(E);
|
|
10246
|
-
}, [K,
|
|
10247
|
-
if (
|
|
10246
|
+
}, [K, V]), ve(() => {
|
|
10247
|
+
if (U <= 0) return;
|
|
10248
10248
|
const E = setInterval(() => {
|
|
10249
10249
|
G((H) => H <= 1 ? 0 : H - 1);
|
|
10250
10250
|
}, 1e3);
|
|
10251
10251
|
return () => clearInterval(E);
|
|
10252
|
-
}, [
|
|
10252
|
+
}, [U]), ve(() => {
|
|
10253
10253
|
F && !g && ee();
|
|
10254
10254
|
}, [F]);
|
|
10255
10255
|
const X = () => {
|
|
10256
|
-
o && (
|
|
10256
|
+
o && (q(!0), N(o.testDurationSec), k(0), x({}), D(null));
|
|
10257
10257
|
}, te = (E, H) => {
|
|
10258
|
-
|
|
10258
|
+
x((ye) => ({ ...ye, [E]: H }));
|
|
10259
10259
|
}, $ = Z(async () => {
|
|
10260
10260
|
try {
|
|
10261
10261
|
const E = await n.getAppropriatenessTest(e);
|
|
@@ -10299,7 +10299,7 @@ const Ua = ({
|
|
|
10299
10299
|
}
|
|
10300
10300
|
}
|
|
10301
10301
|
}, pe = () => {
|
|
10302
|
-
|
|
10302
|
+
q(!1), M(!1), x({}), k(0);
|
|
10303
10303
|
};
|
|
10304
10304
|
if (c)
|
|
10305
10305
|
return /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ i(oe, { children: /* @__PURE__ */ l("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", padding: "48px 0", gap: "16px" }, children: [
|
|
@@ -10312,7 +10312,7 @@ const Ua = ({
|
|
|
10312
10312
|
f && /* @__PURE__ */ i("p", { style: { fontSize: "14px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "8px" }, children: f })
|
|
10313
10313
|
] }) }) });
|
|
10314
10314
|
const me = o.testAllowedMaxTry - o.totalFailedTries, Re = o.appropriatenessQuestions.length, ce = Object.keys(T).length;
|
|
10315
|
-
if (
|
|
10315
|
+
if (U > 0)
|
|
10316
10316
|
return /* @__PURE__ */ l(ne, { children: [
|
|
10317
10317
|
/* @__PURE__ */ i(Le, { children: /* @__PURE__ */ i("h2", { style: { fontSize: "18px", fontWeight: 700, color: "var(--metakyc-text-primary, #111827)", margin: 0 }, children: o.displayName }) }),
|
|
10318
10318
|
/* @__PURE__ */ i(oe, { children: /* @__PURE__ */ l("div", { style: { textAlign: "center", padding: "32px 0" }, children: [
|
|
@@ -10330,7 +10330,7 @@ const Ua = ({
|
|
|
10330
10330
|
fontWeight: 700,
|
|
10331
10331
|
color: "var(--metakyc-primary, #2563eb)",
|
|
10332
10332
|
fontVariantNumeric: "tabular-nums"
|
|
10333
|
-
}, children: Vt(
|
|
10333
|
+
}, children: Vt(U) }) }),
|
|
10334
10334
|
/* @__PURE__ */ i("p", { style: { fontSize: "15px", fontWeight: 500, color: "var(--metakyc-text-primary, #111827)" }, children: r("appropriatenessTest.waitBeforeRetrying") }),
|
|
10335
10335
|
/* @__PURE__ */ i("p", { style: { fontSize: "13px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "4px" }, children: r("appropriatenessTest.waitTimerMessage") }),
|
|
10336
10336
|
f && /* @__PURE__ */ i("div", { style: {
|
|
@@ -10409,8 +10409,8 @@ const Ua = ({
|
|
|
10409
10409
|
}, children: r("appropriatenessTest.noAttemptsRemaining") }) })
|
|
10410
10410
|
] }) }),
|
|
10411
10411
|
/* @__PURE__ */ i(Ee, { children: /* @__PURE__ */ i("div", { style: { display: "flex", justifyContent: "center", width: "100%", gap: "12px" }, children: L.success ? /* @__PURE__ */ i(le, { type: "button", onClick: () => t == null ? void 0 : t(), children: r("common.continue") }) : /* @__PURE__ */ l(bt, { children: [
|
|
10412
|
-
me > 0 &&
|
|
10413
|
-
me > 0 &&
|
|
10412
|
+
me > 0 && U <= 0 && /* @__PURE__ */ i(le, { type: "button", onClick: E, children: r("appropriatenessTest.retakeTest") }),
|
|
10413
|
+
me > 0 && U > 0 && /* @__PURE__ */ i(le, { type: "button", onClick: E, children: r("appropriatenessTest.ok") }),
|
|
10414
10414
|
me <= 0 && a && /* @__PURE__ */ i(le, { type: "button", variant: "outline", onClick: a, children: r("common.back") })
|
|
10415
10415
|
] }) }) })
|
|
10416
10416
|
] });
|
|
@@ -10484,7 +10484,7 @@ const Ua = ({
|
|
|
10484
10484
|
/* @__PURE__ */ i(le, { type: "button", onClick: X, disabled: me <= 0, children: r("appropriatenessTest.startTest") })
|
|
10485
10485
|
] }) })
|
|
10486
10486
|
] });
|
|
10487
|
-
const Y = o.appropriatenessQuestions[se], Q = se === Re - 1, re = ce === Re, A =
|
|
10487
|
+
const Y = o.appropriatenessQuestions[se], Q = se === Re - 1, re = ce === Re, A = V <= 60;
|
|
10488
10488
|
return /* @__PURE__ */ l(ne, { children: [
|
|
10489
10489
|
/* @__PURE__ */ l(Le, { children: [
|
|
10490
10490
|
/* @__PURE__ */ l("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
|
|
@@ -10524,7 +10524,7 @@ const Ua = ({
|
|
|
10524
10524
|
fontVariantNumeric: "tabular-nums",
|
|
10525
10525
|
color: A ? "var(--metakyc-danger, #ef4444)" : "var(--metakyc-text-primary, #111827)",
|
|
10526
10526
|
transition: "color 0.3s ease"
|
|
10527
|
-
}, children: Vt(
|
|
10527
|
+
}, children: Vt(V) })
|
|
10528
10528
|
] })
|
|
10529
10529
|
] }),
|
|
10530
10530
|
/* @__PURE__ */ l("div", { style: { marginTop: "12px" }, children: [
|
|
@@ -10791,9 +10791,9 @@ const Ua = ({
|
|
|
10791
10791
|
onComplete: t,
|
|
10792
10792
|
onBack: a
|
|
10793
10793
|
}) => {
|
|
10794
|
-
var gt, b,
|
|
10795
|
-
const { t: r } = Ie(), { applicantService: n, baseInformationService: o, identityService: s, config: c, currentTheme: u } = Te(), { identityData: g, provider: y, token: f, isLoading: D, error: T, requestIdentity:
|
|
10796
|
-
|
|
10794
|
+
var gt, b, O, P;
|
|
10795
|
+
const { t: r } = Ie(), { applicantService: n, baseInformationService: o, identityService: s, config: c, currentTheme: u } = Te(), { identityData: g, provider: y, token: f, isLoading: D, error: T, requestIdentity: x, restartIdentity: V } = da(e), [N, K] = C(null), [q, F] = C(null), [M, U] = C([]), [G, se] = C([]), [k, L] = C(!0), [j, X] = C(!1), [te, $] = C(null), [ee, pe] = C(!1), me = he.useRef(!1), [Re, ce] = C("idle"), Y = ge(!1), Q = ge(null), [re, A] = C({}), [E, H] = C({}), ye = u != null && u.reviewPageFields && u.reviewPageFields.length > 0 ? u.reviewPageFields[0] : null, fe = !!(u != null && u.reviewPageDisabled), W = ge(!1);
|
|
10796
|
+
W.current = fe;
|
|
10797
10797
|
const J = Vi({
|
|
10798
10798
|
defaultValues: {
|
|
10799
10799
|
street: "",
|
|
@@ -10807,7 +10807,7 @@ const Ua = ({
|
|
|
10807
10807
|
});
|
|
10808
10808
|
ve(() => {
|
|
10809
10809
|
if (fe) {
|
|
10810
|
-
me.current || (me.current = !0,
|
|
10810
|
+
me.current || (me.current = !0, x().then(() => X(!0)).catch((h) => console.error("[Identity] Auto-request failed:", h)).finally(() => L(!1)));
|
|
10811
10811
|
return;
|
|
10812
10812
|
}
|
|
10813
10813
|
(async () => {
|
|
@@ -10820,9 +10820,9 @@ const Ua = ({
|
|
|
10820
10820
|
]);
|
|
10821
10821
|
F(h);
|
|
10822
10822
|
const B = /* @__PURE__ */ new Set(), d = z.map((w) => ({ value: w.abbreviation3 || w.abbreviation, label: w.name })).filter((w) => !w.value || B.has(w.value) ? !1 : (B.add(w.value), !0));
|
|
10823
|
-
|
|
10824
|
-
const I = /* @__PURE__ */ new Set(),
|
|
10825
|
-
se(
|
|
10823
|
+
U(d);
|
|
10824
|
+
const I = /* @__PURE__ */ new Set(), S = R.filter((w) => w.countryCode).map((w) => ({ value: w.countryCode, label: `${w.countryCode} – ${w.name}` })).filter((w) => I.has(w.value) ? !1 : (I.add(w.value), !0));
|
|
10825
|
+
se(S);
|
|
10826
10826
|
const m = h.applicantRequestData;
|
|
10827
10827
|
if (A({
|
|
10828
10828
|
firstName: (m == null ? void 0 : m.firstName) || "",
|
|
@@ -10854,10 +10854,10 @@ const Ua = ({
|
|
|
10854
10854
|
country: (m == null ? void 0 : m.country) || "",
|
|
10855
10855
|
nationality: (m == null ? void 0 : m.nationality) || "",
|
|
10856
10856
|
phonenumber: (m == null ? void 0 : m.phonenumber) || ""
|
|
10857
|
-
}), h.kycRecords && h.kycRecords.length > 0 && h.kycRecords[0].providerTokenObject !== null && !me.current &&
|
|
10857
|
+
}), h.kycRecords && h.kycRecords.length > 0 && h.kycRecords[0].providerTokenObject !== null && !me.current && W.current) {
|
|
10858
10858
|
console.log("[Identity] Review page disabled + existing identity — auto-requesting..."), me.current = !0;
|
|
10859
10859
|
try {
|
|
10860
|
-
await
|
|
10860
|
+
await x(), X(!0);
|
|
10861
10861
|
} catch (w) {
|
|
10862
10862
|
console.error("[Identity] Auto-request failed:", w);
|
|
10863
10863
|
}
|
|
@@ -10869,7 +10869,7 @@ const Ua = ({
|
|
|
10869
10869
|
}
|
|
10870
10870
|
})();
|
|
10871
10871
|
}, [e]), ve(() => {
|
|
10872
|
-
g && !j &&
|
|
10872
|
+
g && !j && W.current && (console.log("[Identity] Review page disabled — showing cached provider"), X(!0));
|
|
10873
10873
|
}, [g, j]), ve(() => {
|
|
10874
10874
|
if (f) {
|
|
10875
10875
|
if (f.expiresAt) {
|
|
@@ -10932,7 +10932,7 @@ const Ua = ({
|
|
|
10932
10932
|
}, [j, e, n, Se]);
|
|
10933
10933
|
const _e = y !== null && y === Ge.Sumsub;
|
|
10934
10934
|
ve(() => {
|
|
10935
|
-
if (y !== null && f && !
|
|
10935
|
+
if (y !== null && f && !N && j && !ee) {
|
|
10936
10936
|
const p = y;
|
|
10937
10937
|
if (_e) {
|
|
10938
10938
|
console.log("[Sumsub] Fetching access token for Web SDK…"), $(null), (async () => {
|
|
@@ -10997,25 +10997,25 @@ const Ua = ({
|
|
|
10997
10997
|
}
|
|
10998
10998
|
}
|
|
10999
10999
|
return () => {
|
|
11000
|
-
if (
|
|
11000
|
+
if (N && N.destroy)
|
|
11001
11001
|
try {
|
|
11002
|
-
|
|
11002
|
+
N.destroy();
|
|
11003
11003
|
} catch (p) {
|
|
11004
11004
|
console.error("[Identity] Error destroying provider:", p);
|
|
11005
11005
|
}
|
|
11006
11006
|
};
|
|
11007
|
-
}, [y, f,
|
|
11007
|
+
}, [y, f, N, j, t, ee, _e, e, c, s, Se]);
|
|
11008
11008
|
const st = async () => {
|
|
11009
11009
|
try {
|
|
11010
|
-
$(null), pe(!1), await
|
|
11010
|
+
$(null), pe(!1), await x(), X(!0);
|
|
11011
11011
|
} catch (p) {
|
|
11012
11012
|
console.error("Error starting identity verification:", p);
|
|
11013
11013
|
}
|
|
11014
|
-
}, [Ze, Ye] =
|
|
11014
|
+
}, [Ze, Ye] = C(!1), ze = async () => {
|
|
11015
11015
|
try {
|
|
11016
|
-
if (Ye(!0), $(null), console.log("[Sumsub] Resetting KYC data..."), await n.resetKyc(e), console.log("[Sumsub] KYC data reset — re-initializing widget"),
|
|
11016
|
+
if (Ye(!0), $(null), console.log("[Sumsub] Resetting KYC data..."), await n.resetKyc(e), console.log("[Sumsub] KYC data reset — re-initializing widget"), N && N.destroy)
|
|
11017
11017
|
try {
|
|
11018
|
-
|
|
11018
|
+
N.destroy();
|
|
11019
11019
|
} catch {
|
|
11020
11020
|
}
|
|
11021
11021
|
K(null);
|
|
@@ -11026,7 +11026,7 @@ const Ua = ({
|
|
|
11026
11026
|
}
|
|
11027
11027
|
}, Qe = async () => {
|
|
11028
11028
|
try {
|
|
11029
|
-
$(null), pe(!1), K(null), console.log("[Identity] Restarting verification..."), await
|
|
11029
|
+
$(null), pe(!1), K(null), console.log("[Identity] Restarting verification..."), await V(), X(!0);
|
|
11030
11030
|
} catch (p) {
|
|
11031
11031
|
console.error("Error restarting identity verification:", p), $(p.message || r("identity.failedToRestart"));
|
|
11032
11032
|
}
|
|
@@ -11185,8 +11185,8 @@ const Ua = ({
|
|
|
11185
11185
|
try {
|
|
11186
11186
|
const d = h.target, I = d.contentDocument || ((z = d.contentWindow) == null ? void 0 : z.document);
|
|
11187
11187
|
if (I) {
|
|
11188
|
-
const
|
|
11189
|
-
(
|
|
11188
|
+
const S = ((B = (R = I.body) == null ? void 0 : R.textContent) == null ? void 0 : B.toLowerCase()) || "";
|
|
11189
|
+
(S.includes("expired") || S.includes("invalid") || S.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), pe(!0), $(r("identity.linkExpired")));
|
|
11190
11190
|
}
|
|
11191
11191
|
} catch {
|
|
11192
11192
|
console.log("[Identity] Cannot check iframe content (CORS)");
|
|
@@ -11226,7 +11226,7 @@ const Ua = ({
|
|
|
11226
11226
|
}
|
|
11227
11227
|
return String(h);
|
|
11228
11228
|
}, wt = ({ helpText: p }) => {
|
|
11229
|
-
const [h, z] =
|
|
11229
|
+
const [h, z] = C(!1), R = ge(null), [, B] = C({ top: 0, left: 0 });
|
|
11230
11230
|
return /* @__PURE__ */ l(bt, { children: [
|
|
11231
11231
|
/* @__PURE__ */ i(
|
|
11232
11232
|
"button",
|
|
@@ -11367,7 +11367,7 @@ const Ua = ({
|
|
|
11367
11367
|
Xe,
|
|
11368
11368
|
{
|
|
11369
11369
|
checked: !!d,
|
|
11370
|
-
onChange: (I) => H((
|
|
11370
|
+
onChange: (I) => H((S) => ({ ...S, [R]: String(I) })),
|
|
11371
11371
|
style: { marginTop: 2 }
|
|
11372
11372
|
}
|
|
11373
11373
|
),
|
|
@@ -11380,26 +11380,26 @@ const Ua = ({
|
|
|
11380
11380
|
) }, z);
|
|
11381
11381
|
}
|
|
11382
11382
|
if (p.customType === "group_checkbox") {
|
|
11383
|
-
const d = Array.isArray(B) ? B : B ? [B] : [], I = (
|
|
11384
|
-
p.singleSelect ? H((m) => ({ ...m, [R]: d[0] ===
|
|
11383
|
+
const d = Array.isArray(B) ? B : B ? [B] : [], I = (S) => {
|
|
11384
|
+
p.singleSelect ? H((m) => ({ ...m, [R]: d[0] === S ? [] : [S] })) : H((m) => ({
|
|
11385
11385
|
...m,
|
|
11386
|
-
[R]: d.includes(
|
|
11386
|
+
[R]: d.includes(S) ? d.filter((v) => v !== S) : [...d, S]
|
|
11387
11387
|
}));
|
|
11388
11388
|
};
|
|
11389
11389
|
return /* @__PURE__ */ i("div", { style: De(p.colSpan), children: Pe(
|
|
11390
11390
|
/* @__PURE__ */ l("div", { className: "space-y-1.5", children: [
|
|
11391
11391
|
p.label && /* @__PURE__ */ i("p", { className: "text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: ie(p.displayText, r) || ie(p.label, r) }),
|
|
11392
|
-
(p.options || []).map((
|
|
11392
|
+
(p.options || []).map((S) => /* @__PURE__ */ l("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
|
|
11393
11393
|
/* @__PURE__ */ i(
|
|
11394
11394
|
Xe,
|
|
11395
11395
|
{
|
|
11396
|
-
checked: d.includes(
|
|
11397
|
-
onChange: () => I(
|
|
11396
|
+
checked: d.includes(S.value),
|
|
11397
|
+
onChange: () => I(S.value),
|
|
11398
11398
|
style: { marginTop: 2 }
|
|
11399
11399
|
}
|
|
11400
11400
|
),
|
|
11401
|
-
/* @__PURE__ */ i("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children:
|
|
11402
|
-
] },
|
|
11401
|
+
/* @__PURE__ */ i("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: S.label })
|
|
11402
|
+
] }, S.value))
|
|
11403
11403
|
] }),
|
|
11404
11404
|
p.helpText
|
|
11405
11405
|
) }, z);
|
|
@@ -11436,7 +11436,7 @@ const Ua = ({
|
|
|
11436
11436
|
) }, z);
|
|
11437
11437
|
}, pt = (p, h) => {
|
|
11438
11438
|
if (p.isCustom) return xt(p, h);
|
|
11439
|
-
const z = p.name ?? "", R = dt[z], B = ie(p.displayText, r) || (R != null && R.translationKey ? r(`fields.${R.translationKey}`) : void 0) || (R == null ? void 0 : R.label) || z, d = re[z] ?? "", I = z === "mobileCountryCode",
|
|
11439
|
+
const z = p.name ?? "", R = dt[z], B = ie(p.displayText, r) || (R != null && R.translationKey ? r(`fields.${R.translationKey}`) : void 0) || (R == null ? void 0 : R.label) || z, d = re[z] ?? "", I = z === "mobileCountryCode", S = !!(R != null && R.countriesType) && !I;
|
|
11440
11440
|
return p.editable ? I ? /* @__PURE__ */ i("div", { style: De(p.colSpan ?? 2), children: Pe(
|
|
11441
11441
|
/* @__PURE__ */ i(
|
|
11442
11442
|
nt,
|
|
@@ -11448,7 +11448,7 @@ const Ua = ({
|
|
|
11448
11448
|
}
|
|
11449
11449
|
),
|
|
11450
11450
|
p.helpText
|
|
11451
|
-
) }, `epc-${h}`) :
|
|
11451
|
+
) }, `epc-${h}`) : S ? /* @__PURE__ */ i("div", { style: De(p.colSpan ?? 2), children: Pe(
|
|
11452
11452
|
/* @__PURE__ */ i(
|
|
11453
11453
|
nt,
|
|
11454
11454
|
{
|
|
@@ -11501,9 +11501,9 @@ const Ua = ({
|
|
|
11501
11501
|
] }),
|
|
11502
11502
|
/* @__PURE__ */ l(oe, { className: "space-y-6", children: [
|
|
11503
11503
|
/* @__PURE__ */ i("div", { className: "space-y-4 pb-4", style: { borderBottom: "1px solid var(--metakyc-border, #e5e7eb)" }, children: [
|
|
11504
|
-
{ label: r("fields.name"), value: `${((gt =
|
|
11505
|
-
{ label: r("fields.email"), value: (
|
|
11506
|
-
{ label: r("fields.dateOfBirth"), value: ((P =
|
|
11504
|
+
{ label: r("fields.name"), value: `${((gt = q == null ? void 0 : q.applicantRequestData) == null ? void 0 : gt.firstName) || ""} ${((b = q == null ? void 0 : q.applicantRequestData) == null ? void 0 : b.lastName) || ""}`.trim() },
|
|
11505
|
+
{ label: r("fields.email"), value: (O = q == null ? void 0 : q.applicantRequestData) == null ? void 0 : O.email },
|
|
11506
|
+
{ label: r("fields.dateOfBirth"), value: ((P = q == null ? void 0 : q.applicantRequestData) == null ? void 0 : P.dateOfBirth) || r("fields.notProvided") }
|
|
11507
11507
|
].map(({ label: p, value: h }) => /* @__PURE__ */ l("div", { children: [
|
|
11508
11508
|
/* @__PURE__ */ i("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: p }),
|
|
11509
11509
|
/* @__PURE__ */ i("p", { className: "mt-1 text-base", style: { color: "var(--metakyc-text-primary, #111827)" }, children: h })
|
|
@@ -11732,14 +11732,14 @@ function At() {
|
|
|
11732
11732
|
return t.current = e, t;
|
|
11733
11733
|
}
|
|
11734
11734
|
const _a = ({ children: e }) => {
|
|
11735
|
-
const [t, a] =
|
|
11735
|
+
const [t, a] = C([]), [r, n] = C({}), o = ge([]), s = Z((y) => {
|
|
11736
11736
|
o.current = [...o.current.filter((f) => f.id !== y.id), y], a([...o.current]);
|
|
11737
11737
|
}, []), c = Z((y) => {
|
|
11738
11738
|
o.current = o.current.filter((f) => f.id !== y), a([...o.current]);
|
|
11739
11739
|
}, []), u = Z((y) => {
|
|
11740
11740
|
n((f) => {
|
|
11741
11741
|
const D = { ...f, ...y };
|
|
11742
|
-
return Object.keys(y).some((
|
|
11742
|
+
return Object.keys(y).some((x) => f[x] !== y[x]) ? D : f;
|
|
11743
11743
|
});
|
|
11744
11744
|
}, []), g = Ue(
|
|
11745
11745
|
() => ({ actions: t, registerAction: s, unregisterAction: c, sdkState: r, updateSdkState: u }),
|
|
@@ -11747,7 +11747,7 @@ const _a = ({ children: e }) => {
|
|
|
11747
11747
|
);
|
|
11748
11748
|
return /* @__PURE__ */ i(Di.Provider, { value: g, children: e });
|
|
11749
11749
|
}, hi = 2147483640, Ga = () => {
|
|
11750
|
-
const e = Pi(), [t, a] =
|
|
11750
|
+
const e = Pi(), [t, a] = C(!1), [r, n] = C("actions"), [o, s] = C(null), c = ge(null);
|
|
11751
11751
|
if (ve(() => {
|
|
11752
11752
|
if (!t) return;
|
|
11753
11753
|
const k = (j) => {
|
|
@@ -11764,7 +11764,7 @@ const _a = ({ children: e }) => {
|
|
|
11764
11764
|
} catch {
|
|
11765
11765
|
}
|
|
11766
11766
|
s(null);
|
|
11767
|
-
},
|
|
11767
|
+
}, x = {
|
|
11768
11768
|
position: "fixed",
|
|
11769
11769
|
bottom: "16px",
|
|
11770
11770
|
right: "16px",
|
|
@@ -11786,7 +11786,7 @@ const _a = ({ children: e }) => {
|
|
|
11786
11786
|
letterSpacing: "0.03em",
|
|
11787
11787
|
lineHeight: 1,
|
|
11788
11788
|
userSelect: "none"
|
|
11789
|
-
},
|
|
11789
|
+
}, V = {
|
|
11790
11790
|
position: "fixed",
|
|
11791
11791
|
bottom: "56px",
|
|
11792
11792
|
right: "16px",
|
|
@@ -11803,7 +11803,7 @@ const _a = ({ children: e }) => {
|
|
|
11803
11803
|
overflow: "hidden",
|
|
11804
11804
|
display: "flex",
|
|
11805
11805
|
flexDirection: "column"
|
|
11806
|
-
},
|
|
11806
|
+
}, N = {
|
|
11807
11807
|
display: "flex",
|
|
11808
11808
|
borderBottom: "1px solid rgba(165,180,252,0.1)",
|
|
11809
11809
|
background: "#181825"
|
|
@@ -11821,7 +11821,7 @@ const _a = ({ children: e }) => {
|
|
|
11821
11821
|
borderBottom: k ? "2px solid #a5b4fc" : "2px solid transparent",
|
|
11822
11822
|
fontFamily: "inherit",
|
|
11823
11823
|
transition: "color 0.15s, border-color 0.15s"
|
|
11824
|
-
}),
|
|
11824
|
+
}), q = {
|
|
11825
11825
|
fontSize: "9px",
|
|
11826
11826
|
fontWeight: 700,
|
|
11827
11827
|
letterSpacing: "0.12em",
|
|
@@ -11843,8 +11843,8 @@ const _a = ({ children: e }) => {
|
|
|
11843
11843
|
textAlign: "left",
|
|
11844
11844
|
transition: "background 0.1s",
|
|
11845
11845
|
opacity: k ? 0.6 : 1
|
|
11846
|
-
}), M = (k) => /* @__PURE__ */ i("span", { style: { fontSize: "14px", width: "20px", textAlign: "center", flexShrink: 0 }, children: k }),
|
|
11847
|
-
/* @__PURE__ */ i("div", { style:
|
|
11846
|
+
}), M = (k) => /* @__PURE__ */ i("span", { style: { fontSize: "14px", width: "20px", textAlign: "center", flexShrink: 0 }, children: k }), U = (k, L) => L.length === 0 ? null : /* @__PURE__ */ l(he.Fragment, { children: [
|
|
11847
|
+
/* @__PURE__ */ i("div", { style: q, children: k }),
|
|
11848
11848
|
L.map((j) => /* @__PURE__ */ l(
|
|
11849
11849
|
"button",
|
|
11850
11850
|
{
|
|
@@ -11872,7 +11872,7 @@ const _a = ({ children: e }) => {
|
|
|
11872
11872
|
/* @__PURE__ */ i("span", { style: { color: "#a6adc8", textAlign: "right", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: j == null ? /* @__PURE__ */ i("span", { style: { color: "#6c7086", fontStyle: "italic" }, children: "null" }) : typeof j == "object" ? JSON.stringify(j) : String(j) })
|
|
11873
11873
|
] }, L)) });
|
|
11874
11874
|
}, se = /* @__PURE__ */ l(bt, { children: [
|
|
11875
|
-
t && /* @__PURE__ */ l("div", { ref: c, style:
|
|
11875
|
+
t && /* @__PURE__ */ l("div", { ref: c, style: V, children: [
|
|
11876
11876
|
/* @__PURE__ */ l("div", { style: { padding: "12px 14px 8px", display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
|
|
11877
11877
|
/* @__PURE__ */ l("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: [
|
|
11878
11878
|
/* @__PURE__ */ i("span", { style: { fontSize: "14px" }, children: "🔧" }),
|
|
@@ -11895,14 +11895,14 @@ const _a = ({ children: e }) => {
|
|
|
11895
11895
|
}
|
|
11896
11896
|
)
|
|
11897
11897
|
] }),
|
|
11898
|
-
/* @__PURE__ */ l("div", { style:
|
|
11898
|
+
/* @__PURE__ */ l("div", { style: N, children: [
|
|
11899
11899
|
/* @__PURE__ */ i("button", { style: K(r === "actions"), onClick: () => n("actions"), children: "Actions" }),
|
|
11900
11900
|
/* @__PURE__ */ i("button", { style: K(r === "state"), onClick: () => n("state"), children: "State" })
|
|
11901
11901
|
] }),
|
|
11902
11902
|
/* @__PURE__ */ i("div", { style: { flex: 1, overflowY: "auto", overflowX: "hidden" }, children: r === "actions" ? /* @__PURE__ */ l("div", { style: { paddingBottom: "8px" }, children: [
|
|
11903
|
-
|
|
11904
|
-
|
|
11905
|
-
|
|
11903
|
+
U("Form", y),
|
|
11904
|
+
U("Workflow", f),
|
|
11905
|
+
U("General", D),
|
|
11906
11906
|
u.length === 0 && /* @__PURE__ */ l("div", { style: { padding: "24px 14px", textAlign: "center", color: "#6c7086" }, children: [
|
|
11907
11907
|
"No actions registered.",
|
|
11908
11908
|
/* @__PURE__ */ i("br", {}),
|
|
@@ -11913,7 +11913,7 @@ const _a = ({ children: e }) => {
|
|
|
11913
11913
|
/* @__PURE__ */ l(
|
|
11914
11914
|
"button",
|
|
11915
11915
|
{
|
|
11916
|
-
style:
|
|
11916
|
+
style: x,
|
|
11917
11917
|
onClick: () => a((k) => !k),
|
|
11918
11918
|
onMouseEnter: (k) => {
|
|
11919
11919
|
k.currentTarget.style.transform = "scale(1.05)";
|
|
@@ -12141,32 +12141,32 @@ const rn = {
|
|
|
12141
12141
|
onSuccess: r,
|
|
12142
12142
|
onCancel: n
|
|
12143
12143
|
}) => {
|
|
12144
|
-
var
|
|
12145
|
-
const { config: o, baseInformationService: s, currentTheme: c } = Te(), { createApplicant: u, getApplicantData: g, isLoading: y } = Ri(), { t: f } = Ie(), D = e || ((
|
|
12144
|
+
var O, P, p, h, z, R, B;
|
|
12145
|
+
const { config: o, baseInformationService: s, currentTheme: c } = Te(), { createApplicant: u, getApplicantData: g, isLoading: y } = Ri(), { t: f } = Ie(), D = e || ((O = o.applicantForm) == null ? void 0 : O.workflowKey);
|
|
12146
12146
|
if (!D)
|
|
12147
12147
|
throw new Error(
|
|
12148
12148
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
12149
12149
|
);
|
|
12150
|
-
const T = t || ((P = o.applicantForm) == null ? void 0 : P.externalRefId) || "",
|
|
12150
|
+
const T = t || ((P = o.applicantForm) == null ? void 0 : P.externalRefId) || "", x = ((p = o.applicantForm) == null ? void 0 : p.email) || "", V = ((h = o.applicantForm) == null ? void 0 : h.hiddenValues) || {}, N = ((z = o.applicantForm) == null ? void 0 : z.initialValues) || {}, q = (((R = o.applicantForm) == null ? void 0 : R.fieldLabelMode) || (c == null ? void 0 : c.fieldLabelMode) || "label") !== "placeholder", F = Ue(
|
|
12151
12151
|
() => c != null && c.applicantFormPages && c.applicantFormPages.length > 0 ? c.applicantFormPages : null,
|
|
12152
12152
|
[c == null ? void 0 : c.applicantFormPages]
|
|
12153
12153
|
), M = Ue(() => {
|
|
12154
12154
|
const d = new Set(zt), I = c == null ? void 0 : c.applicantFormRequiredFields;
|
|
12155
|
-
if (I) for (const
|
|
12155
|
+
if (I) for (const S of I) d.add(S);
|
|
12156
12156
|
if (F)
|
|
12157
|
-
for (const
|
|
12158
|
-
for (const m of
|
|
12157
|
+
for (const S of F)
|
|
12158
|
+
for (const m of S.fields)
|
|
12159
12159
|
!m.isCustom && m.name && m.required && d.add(m.name);
|
|
12160
12160
|
return Array.from(d);
|
|
12161
|
-
}, [c == null ? void 0 : c.applicantFormRequiredFields, F]),
|
|
12162
|
-
var
|
|
12161
|
+
}, [c == null ? void 0 : c.applicantFormRequiredFields, F]), U = Ue(() => {
|
|
12162
|
+
var S;
|
|
12163
12163
|
if (F) {
|
|
12164
12164
|
const m = F.flatMap((w) => w.fields).filter((w) => !w.isCustom && w.name).map((w) => w.name), v = new Set(m);
|
|
12165
12165
|
for (const w of zt) v.add(w);
|
|
12166
12166
|
return Array.from(v);
|
|
12167
12167
|
}
|
|
12168
12168
|
let d;
|
|
12169
|
-
(
|
|
12169
|
+
(S = o.applicantForm) != null && S.visibleFields ? d = o.applicantForm.visibleFields : c != null && c.applicantFormVisibleFields && c.applicantFormVisibleFields.length > 0 ? d = c.applicantFormVisibleFields : d = Zi;
|
|
12170
12170
|
const I = new Set(d);
|
|
12171
12171
|
for (const m of zt) I.add(m);
|
|
12172
12172
|
return Array.from(I);
|
|
@@ -12178,17 +12178,17 @@ const rn = {
|
|
|
12178
12178
|
"mobileCountryCode",
|
|
12179
12179
|
"otherNationality"
|
|
12180
12180
|
]), se = Ue(() => {
|
|
12181
|
-
var I,
|
|
12181
|
+
var I, S;
|
|
12182
12182
|
const d = /* @__PURE__ */ new Set();
|
|
12183
12183
|
if (F)
|
|
12184
12184
|
for (const m of F)
|
|
12185
12185
|
for (const v of m.fields)
|
|
12186
12186
|
!v.isCustom && v.name && G.has(v.name) && d.add(v.countriesType ?? ((I = dt[v.name]) == null ? void 0 : I.countriesType));
|
|
12187
12187
|
else
|
|
12188
|
-
for (const m of
|
|
12189
|
-
G.has(m) && d.add((
|
|
12188
|
+
for (const m of U)
|
|
12189
|
+
G.has(m) && d.add((S = dt[m]) == null ? void 0 : S.countriesType);
|
|
12190
12190
|
return d.size === 0 && d.add(void 0), Array.from(d);
|
|
12191
|
-
}, [
|
|
12191
|
+
}, [U, F]), [k, L] = C({}), [j, X] = C(!0), te = ge(/* @__PURE__ */ new Set()), $ = ge(/* @__PURE__ */ new Set());
|
|
12192
12192
|
ve(() => {
|
|
12193
12193
|
if (!c) return;
|
|
12194
12194
|
const d = se.filter((m) => {
|
|
@@ -12228,7 +12228,7 @@ const rn = {
|
|
|
12228
12228
|
}, [se, c]);
|
|
12229
12229
|
const ee = (d, I) => {
|
|
12230
12230
|
var v;
|
|
12231
|
-
const
|
|
12231
|
+
const S = I ?? ((v = dt[d]) == null ? void 0 : v.countriesType), m = S != null ? String(S) : "all";
|
|
12232
12232
|
return k[m] || [];
|
|
12233
12233
|
}, pe = {
|
|
12234
12234
|
firstName: 1,
|
|
@@ -12254,15 +12254,15 @@ const rn = {
|
|
|
12254
12254
|
occupation: 1,
|
|
12255
12255
|
taxNumber: 1
|
|
12256
12256
|
}, me = Object.fromEntries(
|
|
12257
|
-
Object.entries(
|
|
12257
|
+
Object.entries(V).filter(([d]) => d in pe)
|
|
12258
12258
|
), Re = Object.fromEntries(
|
|
12259
|
-
Object.entries(
|
|
12260
|
-
), [ce, Y] =
|
|
12259
|
+
Object.entries(N).filter(([d]) => d in pe)
|
|
12260
|
+
), [ce, Y] = C({
|
|
12261
12261
|
workflowKey: D,
|
|
12262
12262
|
firstName: "",
|
|
12263
12263
|
lastName: "",
|
|
12264
12264
|
title: "",
|
|
12265
|
-
email:
|
|
12265
|
+
email: x,
|
|
12266
12266
|
dateOfBirth: "",
|
|
12267
12267
|
phonenumber: "",
|
|
12268
12268
|
externalRefId: T,
|
|
@@ -12285,16 +12285,16 @@ const rn = {
|
|
|
12285
12285
|
...me,
|
|
12286
12286
|
...Re
|
|
12287
12287
|
}), Q = Object.fromEntries(
|
|
12288
|
-
Object.entries(
|
|
12289
|
-
), [re, A] =
|
|
12288
|
+
Object.entries(V).filter(([d]) => !(d in me) && d !== "externalRefId" && d !== "workflowKey")
|
|
12289
|
+
), [re, A] = C({ ...Q }), [E, H] = C(!!a);
|
|
12290
12290
|
ve(() => {
|
|
12291
12291
|
if (!a) return;
|
|
12292
12292
|
let d = !1;
|
|
12293
12293
|
return (async () => {
|
|
12294
12294
|
try {
|
|
12295
|
-
const
|
|
12295
|
+
const S = await g(a);
|
|
12296
12296
|
if (d) return;
|
|
12297
|
-
const m =
|
|
12297
|
+
const m = S.applicantRequestData;
|
|
12298
12298
|
m && Y((v) => {
|
|
12299
12299
|
var w;
|
|
12300
12300
|
return {
|
|
@@ -12322,9 +12322,9 @@ const rn = {
|
|
|
12322
12322
|
salutation: m.salutation != null ? Number(m.salutation) : v.salutation,
|
|
12323
12323
|
otherNationality: (w = m.otherNationalities) != null && w.length ? m.otherNationalities : v.otherNationality
|
|
12324
12324
|
};
|
|
12325
|
-
}),
|
|
12326
|
-
} catch (
|
|
12327
|
-
d || console.error("Failed to load existing applicant data:",
|
|
12325
|
+
}), S.externalRefId && Y((v) => ({ ...v, externalRefId: S.externalRefId }));
|
|
12326
|
+
} catch (S) {
|
|
12327
|
+
d || console.error("Failed to load existing applicant data:", S);
|
|
12328
12328
|
} finally {
|
|
12329
12329
|
d || H(!1);
|
|
12330
12330
|
}
|
|
@@ -12332,26 +12332,26 @@ const rn = {
|
|
|
12332
12332
|
d = !0;
|
|
12333
12333
|
};
|
|
12334
12334
|
}, [a]);
|
|
12335
|
-
const [ye, fe] =
|
|
12336
|
-
const d = en(), I = (
|
|
12335
|
+
const [ye, fe] = C(0), [W, J] = C({}), [ke, Ne] = C(null), [Se, _e] = C(!1), st = At(), Ze = Z(() => {
|
|
12336
|
+
const d = en(), I = (S) => {
|
|
12337
12337
|
var ue;
|
|
12338
|
-
const m = (ue = dt[
|
|
12338
|
+
const m = (ue = dt[S]) == null ? void 0 : ue.countriesType, v = m != null ? String(m) : "all", w = (k[v] || []).filter((de) => de.value);
|
|
12339
12339
|
if (w.length)
|
|
12340
12340
|
return w[Math.floor(Math.random() * w.length)].value;
|
|
12341
12341
|
};
|
|
12342
|
-
Y((
|
|
12343
|
-
const m = { ...
|
|
12342
|
+
Y((S) => {
|
|
12343
|
+
const m = { ...S };
|
|
12344
12344
|
for (const [v, w] of Object.entries(d))
|
|
12345
|
-
if (v in
|
|
12345
|
+
if (v in S && (S[v] === "" || S[v] === null || S[v] === void 0))
|
|
12346
12346
|
if (G.has(v)) {
|
|
12347
12347
|
const ue = I(v);
|
|
12348
12348
|
ue && (m[v] = ue);
|
|
12349
12349
|
} else
|
|
12350
12350
|
m[v] = w;
|
|
12351
12351
|
return m;
|
|
12352
|
-
}), F && A((
|
|
12352
|
+
}), F && A((S) => {
|
|
12353
12353
|
var v, w;
|
|
12354
|
-
const m = { ...
|
|
12354
|
+
const m = { ...S };
|
|
12355
12355
|
for (const ue of F)
|
|
12356
12356
|
for (const de of ue.fields)
|
|
12357
12357
|
!de.isCustom || !de.paramName || m[de.paramName] || (de.customType === "checkbox" || de.customType === "link_checkbox" ? m[de.paramName] = "true" : de.customType === "radio_group" && ((v = de.options) != null && v.length) || de.customType === "group_checkbox" && ((w = de.options) != null && w.length) ? m[de.paramName] = de.options[0].value : de.customType === "text" && (m[de.paramName] = "Sample value"));
|
|
@@ -12369,30 +12369,30 @@ const rn = {
|
|
|
12369
12369
|
handler: Ze
|
|
12370
12370
|
}), () => d.unregisterAction("fill-individual-form");
|
|
12371
12371
|
}, [st, Ze]);
|
|
12372
|
-
const Ye = (d, I) => Y((
|
|
12372
|
+
const Ye = (d, I) => Y((S) => ({ ...S, [d]: I })), ze = (d, I) => A((S) => ({ ...S, [d]: I })), Qe = (d) => !d.conditionalOn || re[d.conditionalOn] === "true", He = (d) => {
|
|
12373
12373
|
var I;
|
|
12374
|
-
for (const
|
|
12375
|
-
if (!
|
|
12376
|
-
const m = re[
|
|
12377
|
-
if (
|
|
12378
|
-
if (m.split(",").filter(Boolean).some((w) =>
|
|
12379
|
-
} else if (
|
|
12374
|
+
for (const S of d.fields) {
|
|
12375
|
+
if (!S.isCustom || !S.paramName || !((I = S.blockingValues) != null && I.length)) continue;
|
|
12376
|
+
const m = re[S.paramName] ?? "";
|
|
12377
|
+
if (S.customType === "group_checkbox") {
|
|
12378
|
+
if (m.split(",").filter(Boolean).some((w) => S.blockingValues.includes(w))) return !0;
|
|
12379
|
+
} else if (S.customType === "radio_group" && S.blockingValues.includes(m))
|
|
12380
12380
|
return !0;
|
|
12381
12381
|
}
|
|
12382
12382
|
return !1;
|
|
12383
12383
|
}, et = F && ye < F.length - 1 ? ye + 1 : -1, De = F && ye > 0 ? ye - 1 : -1, mt = (d) => {
|
|
12384
12384
|
const I = {};
|
|
12385
|
-
for (const
|
|
12386
|
-
if (
|
|
12387
|
-
if (
|
|
12388
|
-
if (
|
|
12389
|
-
const m = re[
|
|
12390
|
-
|
|
12385
|
+
for (const S of d.fields)
|
|
12386
|
+
if (S.isCustom) {
|
|
12387
|
+
if (S.customType === "paragraph" || S.customType === "html" || S.customType === "br" || S.customType === "link") continue;
|
|
12388
|
+
if (S.required && S.paramName) {
|
|
12389
|
+
const m = re[S.paramName], v = ie(S.displayText, f) || ie(S.label, f) || S.paramName;
|
|
12390
|
+
S.customType === "checkbox" || S.customType === "link_checkbox" ? m !== "true" && (I[S.paramName] = f("validation.fieldRequired", { field: v })) : (!m || m.trim() === "") && (I[S.paramName] = f("validation.fieldRequired", { field: v }));
|
|
12391
12391
|
}
|
|
12392
|
-
} else if (
|
|
12393
|
-
const m =
|
|
12392
|
+
} else if (S.name) {
|
|
12393
|
+
const m = S.name;
|
|
12394
12394
|
if (M.includes(m) && St(ce[m])) {
|
|
12395
|
-
const v = dt[m], w = ie(
|
|
12395
|
+
const v = dt[m], w = ie(S.displayText, f) || (v != null && v.translationKey ? f(`fields.${v.translationKey}`) : void 0) || (v == null ? void 0 : v.label) || m;
|
|
12396
12396
|
I[m] = f("validation.fieldRequired", { field: w });
|
|
12397
12397
|
}
|
|
12398
12398
|
}
|
|
@@ -12447,7 +12447,7 @@ const rn = {
|
|
|
12447
12447
|
St(w) || (d[v] = w);
|
|
12448
12448
|
}
|
|
12449
12449
|
} else
|
|
12450
|
-
|
|
12450
|
+
U.forEach((v) => {
|
|
12451
12451
|
if (v === "externalRefId") return;
|
|
12452
12452
|
const w = ce[v];
|
|
12453
12453
|
St(w) || (d[v] = w);
|
|
@@ -12468,9 +12468,9 @@ const rn = {
|
|
|
12468
12468
|
}
|
|
12469
12469
|
for (const [v, w] of Object.entries(me))
|
|
12470
12470
|
d[v] === void 0 && !St(w) && (d[v] = w);
|
|
12471
|
-
const
|
|
12471
|
+
const S = new Set(I.map((v) => v.paramName));
|
|
12472
12472
|
for (const [v, w] of Object.entries(Q))
|
|
12473
|
-
!
|
|
12473
|
+
!S.has(v) && w && I.push({ paramName: v, value: w });
|
|
12474
12474
|
I.length > 0 && (d.applicantAdditionalDatas = I);
|
|
12475
12475
|
const m = await u(d);
|
|
12476
12476
|
r(m.applicantId);
|
|
@@ -12483,16 +12483,16 @@ const rn = {
|
|
|
12483
12483
|
d.preventDefault();
|
|
12484
12484
|
for (const I of M)
|
|
12485
12485
|
if (St(ce[I])) {
|
|
12486
|
-
const
|
|
12486
|
+
const S = dt[I], m = (S != null && S.translationKey ? f(`fields.${S.translationKey}`) : void 0) || (S == null ? void 0 : S.label) || I;
|
|
12487
12487
|
Ne(f("validation.fieldRequired", { field: m }));
|
|
12488
12488
|
return;
|
|
12489
12489
|
}
|
|
12490
12490
|
await Pe();
|
|
12491
|
-
}, pt = (d, I,
|
|
12491
|
+
}, pt = (d, I, S, m, v) => {
|
|
12492
12492
|
var Zt;
|
|
12493
12493
|
const w = dt[d];
|
|
12494
12494
|
if (!w) return null;
|
|
12495
|
-
const ue = M.includes(d), de =
|
|
12495
|
+
const ue = M.includes(d), de = W[d], Me = ie(S, f) || (w.translationKey ? f(`fields.${w.translationKey}`) : void 0) || w.label, je = d in Re, we = I ?? d, $e = { required: ue }, tt = v ? v !== "placeholder" : q, lt = tt ? Me : void 0;
|
|
12496
12496
|
switch (w.type) {
|
|
12497
12497
|
case "select":
|
|
12498
12498
|
if (d === "country" || d === "nationality" || d === "taxCountry" || d === "countryOfBirth" || d === "mobileCountryCode") {
|
|
@@ -12629,7 +12629,7 @@ const rn = {
|
|
|
12629
12629
|
);
|
|
12630
12630
|
}
|
|
12631
12631
|
}, gt = (d, I) => {
|
|
12632
|
-
const
|
|
12632
|
+
const S = d.labelMode ? d.labelMode !== "placeholder" : q;
|
|
12633
12633
|
if (d.customType === "paragraph") {
|
|
12634
12634
|
const w = ie(d.displayText, f) || ie(d.label, f) || "";
|
|
12635
12635
|
return /* @__PURE__ */ i(
|
|
@@ -12682,7 +12682,7 @@ const rn = {
|
|
|
12682
12682
|
) }, `custom-${I}`);
|
|
12683
12683
|
}
|
|
12684
12684
|
if (!d.paramName) return null;
|
|
12685
|
-
const m =
|
|
12685
|
+
const m = W[d.paramName], v = ie(d.displayText, f) || ie(d.label, f) || d.paramName;
|
|
12686
12686
|
if (d.customType === "checkbox") {
|
|
12687
12687
|
const w = re[d.paramName] === "true";
|
|
12688
12688
|
return /* @__PURE__ */ l("div", { className: "flex flex-col gap-1", children: [
|
|
@@ -12771,7 +12771,7 @@ const rn = {
|
|
|
12771
12771
|
if (d.customType === "group_checkbox") {
|
|
12772
12772
|
const w = (re[d.paramName] || "").split(",").filter(Boolean);
|
|
12773
12773
|
return /* @__PURE__ */ l("div", { className: "flex flex-col gap-1.5", children: [
|
|
12774
|
-
|
|
12774
|
+
S && /* @__PURE__ */ l(
|
|
12775
12775
|
"div",
|
|
12776
12776
|
{
|
|
12777
12777
|
className: "text-sm font-medium",
|
|
@@ -12816,7 +12816,7 @@ const rn = {
|
|
|
12816
12816
|
] }, `custom-${I}`);
|
|
12817
12817
|
}
|
|
12818
12818
|
return d.customType === "radio_group" ? /* @__PURE__ */ l("div", { className: "flex flex-col gap-1.5", children: [
|
|
12819
|
-
|
|
12819
|
+
S && /* @__PURE__ */ l(
|
|
12820
12820
|
"div",
|
|
12821
12821
|
{
|
|
12822
12822
|
className: "text-sm font-medium",
|
|
@@ -12863,8 +12863,8 @@ const rn = {
|
|
|
12863
12863
|
Ce,
|
|
12864
12864
|
{
|
|
12865
12865
|
type: "text",
|
|
12866
|
-
label:
|
|
12867
|
-
placeholder:
|
|
12866
|
+
label: S ? `${v}${d.required ? " *" : ""}` : void 0,
|
|
12867
|
+
placeholder: S ? void 0 : v,
|
|
12868
12868
|
value: re[d.paramName] || "",
|
|
12869
12869
|
onChange: (w) => ze(d.paramName, w.target.value),
|
|
12870
12870
|
required: d.required,
|
|
@@ -12873,21 +12873,21 @@ const rn = {
|
|
|
12873
12873
|
`custom-${I}`
|
|
12874
12874
|
);
|
|
12875
12875
|
}, b = (d, I) => {
|
|
12876
|
-
const
|
|
12876
|
+
const S = Qe(d);
|
|
12877
12877
|
return /* @__PURE__ */ l("div", { className: "space-y-4", children: [
|
|
12878
12878
|
d.conditionalOn && /* @__PURE__ */ i(vi, { helpText: d.conditionalHelpText, children: /* @__PURE__ */ l(
|
|
12879
12879
|
"div",
|
|
12880
12880
|
{
|
|
12881
12881
|
className: "metakyc-option-label",
|
|
12882
12882
|
role: "checkbox",
|
|
12883
|
-
"aria-checked":
|
|
12884
|
-
onClick: () => ze(d.conditionalOn,
|
|
12883
|
+
"aria-checked": S,
|
|
12884
|
+
onClick: () => ze(d.conditionalOn, S ? "false" : "true"),
|
|
12885
12885
|
style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer", margin: 0, padding: 0, userSelect: "none" },
|
|
12886
12886
|
children: [
|
|
12887
12887
|
/* @__PURE__ */ i(
|
|
12888
12888
|
Xe,
|
|
12889
12889
|
{
|
|
12890
|
-
checked:
|
|
12890
|
+
checked: S,
|
|
12891
12891
|
onChange: (m) => ze(d.conditionalOn, m ? "true" : "false")
|
|
12892
12892
|
}
|
|
12893
12893
|
),
|
|
@@ -12902,7 +12902,7 @@ const rn = {
|
|
|
12902
12902
|
]
|
|
12903
12903
|
}
|
|
12904
12904
|
) }),
|
|
12905
|
-
|
|
12905
|
+
S && /* @__PURE__ */ i("div", { className: "metakyc-form-grid", children: d.fields.map((m, v) => {
|
|
12906
12906
|
const w = Math.min(4, Math.max(1, Number(m.colSpan) || 4)), ue = m.isCustom ? `custom-${v}-${m.paramName}` : `builtin-${m.name}-${v}`;
|
|
12907
12907
|
return /* @__PURE__ */ i("div", { style: { gridColumn: `span ${w} / span ${w}` }, children: /* @__PURE__ */ i(vi, { helpText: m.helpText, children: m.isCustom ? gt(m, v) : pt(m.name, ue, m.displayText, m.countriesType, m.labelMode) }) }, ue);
|
|
12908
12908
|
}) })
|
|
@@ -12914,9 +12914,9 @@ const rn = {
|
|
|
12914
12914
|
/* @__PURE__ */ i("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: f("common.loadingForm") })
|
|
12915
12915
|
] }) }) });
|
|
12916
12916
|
if (F) {
|
|
12917
|
-
const d = F[ye] ?? F[0], I = De === -1,
|
|
12917
|
+
const d = F[ye] ?? F[0], I = De === -1, S = et === -1, m = F.length, v = Qe(d), w = He(d), ue = Object.values(W), de = !v && !!d.conditionalOn && d.conditionalMode === "block", Me = Se || y || de || w;
|
|
12918
12918
|
let je;
|
|
12919
|
-
return de || w ? je = f("common.blocked") :
|
|
12919
|
+
return de || w ? je = f("common.blocked") : S ? je = d.conditionalOn && !v ? f("common.skipAndSubmit") : f("common.submit") : je = d.conditionalOn && !v ? f("common.skip") : f("common.next"), /* @__PURE__ */ i("div", { className: "metakyc-sdk", children: /* @__PURE__ */ l(ne, { children: [
|
|
12920
12920
|
/* @__PURE__ */ i(Le, { children: /* @__PURE__ */ i(Tt, { title: (c == null ? void 0 : c.title) || f("createApplicant.title") }) }),
|
|
12921
12921
|
/* @__PURE__ */ l(oe, { children: [
|
|
12922
12922
|
(d.title || d.subtitle || d.description) && /* @__PURE__ */ l("div", { className: "mb-4", children: [
|
|
@@ -12999,7 +12999,7 @@ const rn = {
|
|
|
12999
12999
|
type: "button",
|
|
13000
13000
|
isLoading: Se || y,
|
|
13001
13001
|
disabled: Me,
|
|
13002
|
-
onClick:
|
|
13002
|
+
onClick: S ? Pe : wt,
|
|
13003
13003
|
children: je
|
|
13004
13004
|
}
|
|
13005
13005
|
)
|
|
@@ -13017,7 +13017,7 @@ const rn = {
|
|
|
13017
13017
|
" ",
|
|
13018
13018
|
ke
|
|
13019
13019
|
] }) }),
|
|
13020
|
-
/* @__PURE__ */ i("div", { className: "metakyc-form-grid", children:
|
|
13020
|
+
/* @__PURE__ */ i("div", { className: "metakyc-form-grid", children: U.map((d) => /* @__PURE__ */ i("div", { style: { gridColumn: "span 4 / span 4" }, children: pt(d) }, d)) })
|
|
13021
13021
|
] }),
|
|
13022
13022
|
/* @__PURE__ */ l(Ee, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
13023
13023
|
n && /* @__PURE__ */ i(le, { type: "button", variant: "outline", onClick: n, disabled: Se || y, children: "Cancel" }),
|
|
@@ -13040,37 +13040,37 @@ const nn = ({
|
|
|
13040
13040
|
throw new Error(
|
|
13041
13041
|
"workflowKey is required. Provide it either as a prop to CreateCompanyApplicantForm or set it in config.applicantForm.workflowKey"
|
|
13042
13042
|
);
|
|
13043
|
-
const f = t || ((wt = n.applicantForm) == null ? void 0 : wt.externalRefId) || "", D = ((Pe = n.applicantForm) == null ? void 0 : Pe.email) || "", T = ((xt = n.applicantForm) == null ? void 0 : xt.initialValues) || {},
|
|
13043
|
+
const f = t || ((wt = n.applicantForm) == null ? void 0 : wt.externalRefId) || "", D = ((Pe = n.applicantForm) == null ? void 0 : Pe.email) || "", T = ((xt = n.applicantForm) == null ? void 0 : xt.initialValues) || {}, V = (((pt = n.applicantForm) == null ? void 0 : pt.fieldLabelMode) || (s == null ? void 0 : s.fieldLabelMode) || "label") !== "placeholder", N = Ue(
|
|
13044
13044
|
() => s != null && s.companyFormPages && s.companyFormPages.length > 0 ? s.companyFormPages : null,
|
|
13045
13045
|
[s == null ? void 0 : s.companyFormPages]
|
|
13046
13046
|
), K = Ue(() => {
|
|
13047
|
-
const b = new Set(ki),
|
|
13048
|
-
if (
|
|
13049
|
-
if (
|
|
13050
|
-
for (const P of
|
|
13047
|
+
const b = new Set(ki), O = s == null ? void 0 : s.companyFormRequiredFields;
|
|
13048
|
+
if (O) for (const P of O) b.add(P);
|
|
13049
|
+
if (N)
|
|
13050
|
+
for (const P of N)
|
|
13051
13051
|
for (const p of P.fields)
|
|
13052
13052
|
!p.isCustom && p.name && p.required && b.add(p.name);
|
|
13053
13053
|
return Array.from(b);
|
|
13054
|
-
}, [s == null ? void 0 : s.companyFormRequiredFields,
|
|
13054
|
+
}, [s == null ? void 0 : s.companyFormRequiredFields, N]), q = Ue(() => {
|
|
13055
13055
|
var b;
|
|
13056
|
-
if (
|
|
13057
|
-
const
|
|
13056
|
+
if (N) {
|
|
13057
|
+
const O = N.flatMap((p) => p.fields).filter((p) => !p.isCustom && p.name).map((p) => p.name), P = new Set(O);
|
|
13058
13058
|
for (const p of ki) P.add(p);
|
|
13059
13059
|
return Array.from(P);
|
|
13060
13060
|
}
|
|
13061
13061
|
return (b = n.applicantForm) != null && b.visibleFields ? n.applicantForm.visibleFields : s != null && s.companyFormVisibleFields && s.companyFormVisibleFields.length > 0 ? s.companyFormVisibleFields : Xi;
|
|
13062
|
-
}, [(gt = n.applicantForm) == null ? void 0 : gt.visibleFields, s == null ? void 0 : s.companyFormVisibleFields,
|
|
13063
|
-
var
|
|
13062
|
+
}, [(gt = n.applicantForm) == null ? void 0 : gt.visibleFields, s == null ? void 0 : s.companyFormVisibleFields, N]), F = /* @__PURE__ */ new Set(["countryResidence", "addressCountry"]), M = Ue(() => {
|
|
13063
|
+
var O, P;
|
|
13064
13064
|
const b = /* @__PURE__ */ new Set();
|
|
13065
|
-
if (
|
|
13066
|
-
for (const p of
|
|
13065
|
+
if (N)
|
|
13066
|
+
for (const p of N)
|
|
13067
13067
|
for (const h of p.fields)
|
|
13068
|
-
!h.isCustom && h.name && F.has(h.name) && b.add(h.countriesType ?? ((
|
|
13068
|
+
!h.isCustom && h.name && F.has(h.name) && b.add(h.countriesType ?? ((O = ht[h.name]) == null ? void 0 : O.countriesType));
|
|
13069
13069
|
else
|
|
13070
|
-
for (const p of
|
|
13070
|
+
for (const p of q)
|
|
13071
13071
|
F.has(p) && b.add((P = ht[p]) == null ? void 0 : P.countriesType);
|
|
13072
13072
|
return b.size === 0 && b.add(void 0), Array.from(b);
|
|
13073
|
-
}, [
|
|
13073
|
+
}, [q, N]), [U, G] = C({}), [se, k] = C(!0), L = ge(/* @__PURE__ */ new Set()), j = ge(/* @__PURE__ */ new Set());
|
|
13074
13074
|
ve(() => {
|
|
13075
13075
|
if (!s) return;
|
|
13076
13076
|
const b = M.filter((p) => {
|
|
@@ -13082,8 +13082,8 @@ const nn = ({
|
|
|
13082
13082
|
return;
|
|
13083
13083
|
}
|
|
13084
13084
|
k(!0);
|
|
13085
|
-
const
|
|
13086
|
-
|
|
13085
|
+
const O = b.map((p) => p != null ? String(p) : "all");
|
|
13086
|
+
O.forEach((p) => L.current.add(p)), (async () => {
|
|
13087
13087
|
try {
|
|
13088
13088
|
const p = await Promise.all(
|
|
13089
13089
|
b.map(async (h) => {
|
|
@@ -13093,16 +13093,16 @@ const nn = ({
|
|
|
13093
13093
|
);
|
|
13094
13094
|
G((h) => ({ ...h, ...Object.fromEntries(p) }));
|
|
13095
13095
|
} catch (p) {
|
|
13096
|
-
|
|
13096
|
+
O.forEach((h) => L.current.delete(h)), console.error("Failed to load countries:", p);
|
|
13097
13097
|
} finally {
|
|
13098
13098
|
M.every((h) => j.current.has(h != null ? String(h) : "all")) && k(!1);
|
|
13099
13099
|
}
|
|
13100
13100
|
})();
|
|
13101
13101
|
}, [M, s]);
|
|
13102
|
-
const X = (b,
|
|
13102
|
+
const X = (b, O) => {
|
|
13103
13103
|
var h;
|
|
13104
|
-
const P =
|
|
13105
|
-
return
|
|
13104
|
+
const P = O ?? ((h = ht[b]) == null ? void 0 : h.countriesType), p = P != null ? String(P) : "all";
|
|
13105
|
+
return U[p] || [];
|
|
13106
13106
|
}, te = {
|
|
13107
13107
|
companyName: 1,
|
|
13108
13108
|
registrationNumber: 1,
|
|
@@ -13125,7 +13125,7 @@ const nn = ({
|
|
|
13125
13125
|
lei: 1
|
|
13126
13126
|
}, $ = Object.fromEntries(
|
|
13127
13127
|
Object.entries(T).filter(([b]) => b in te)
|
|
13128
|
-
), [ee, pe] =
|
|
13128
|
+
), [ee, pe] = C({
|
|
13129
13129
|
workflowKey: y,
|
|
13130
13130
|
companyName: "",
|
|
13131
13131
|
email: D,
|
|
@@ -13148,10 +13148,10 @@ const nn = ({
|
|
|
13148
13148
|
lei: "",
|
|
13149
13149
|
externalRefId: f,
|
|
13150
13150
|
...$
|
|
13151
|
-
}), [me, Re] =
|
|
13152
|
-
const b = tn(),
|
|
13151
|
+
}), [me, Re] = C({}), [ce, Y] = C(0), [Q, re] = C({}), [A, E] = C(null), [H, ye] = C(!1), fe = At(), W = Z(() => {
|
|
13152
|
+
const b = tn(), O = (P) => {
|
|
13153
13153
|
var R;
|
|
13154
|
-
const p = (R = ht[P]) == null ? void 0 : R.countriesType, h = p != null ? String(p) : "all", z = (
|
|
13154
|
+
const p = (R = ht[P]) == null ? void 0 : R.countriesType, h = p != null ? String(p) : "all", z = (U[h] || []).filter((B) => B.value);
|
|
13155
13155
|
if (z.length)
|
|
13156
13156
|
return z[Math.floor(Math.random() * z.length)].value;
|
|
13157
13157
|
};
|
|
@@ -13160,20 +13160,20 @@ const nn = ({
|
|
|
13160
13160
|
for (const [h, z] of Object.entries(b))
|
|
13161
13161
|
if (h in P && (P[h] === "" || P[h] === null || P[h] === void 0))
|
|
13162
13162
|
if (F.has(h)) {
|
|
13163
|
-
const R =
|
|
13163
|
+
const R = O(h);
|
|
13164
13164
|
R && (p[h] = R);
|
|
13165
13165
|
} else
|
|
13166
13166
|
p[h] = z;
|
|
13167
13167
|
return p;
|
|
13168
|
-
}),
|
|
13168
|
+
}), N && Re((P) => {
|
|
13169
13169
|
var h, z;
|
|
13170
13170
|
const p = { ...P };
|
|
13171
|
-
for (const R of
|
|
13171
|
+
for (const R of N)
|
|
13172
13172
|
for (const B of R.fields)
|
|
13173
13173
|
!B.isCustom || !B.paramName || p[B.paramName] || (B.customType === "checkbox" || B.customType === "link_checkbox" ? p[B.paramName] = "true" : B.customType === "radio_group" && ((h = B.options) != null && h.length) || B.customType === "group_checkbox" && ((z = B.options) != null && z.length) ? p[B.paramName] = B.options[0].value : B.customType === "text" && (p[B.paramName] = "Sample value"));
|
|
13174
13174
|
return p;
|
|
13175
13175
|
}), re({}), E(null);
|
|
13176
|
-
}, [
|
|
13176
|
+
}, [N, U]);
|
|
13177
13177
|
ve(() => {
|
|
13178
13178
|
const b = fe.current;
|
|
13179
13179
|
if (b)
|
|
@@ -13182,13 +13182,13 @@ const nn = ({
|
|
|
13182
13182
|
label: "Fill with Sample Data",
|
|
13183
13183
|
icon: "🏢",
|
|
13184
13184
|
group: "form",
|
|
13185
|
-
handler:
|
|
13185
|
+
handler: W
|
|
13186
13186
|
}), () => b.unregisterAction("fill-company-form");
|
|
13187
|
-
}, [fe,
|
|
13188
|
-
const J = (b,
|
|
13189
|
-
var
|
|
13187
|
+
}, [fe, W]);
|
|
13188
|
+
const J = (b, O) => pe((P) => ({ ...P, [b]: O })), ke = (b, O) => Re((P) => ({ ...P, [b]: O })), Ne = (b) => !b.conditionalOn || me[b.conditionalOn] === "true", Se = (b) => {
|
|
13189
|
+
var O;
|
|
13190
13190
|
for (const P of b.fields) {
|
|
13191
|
-
if (!P.isCustom || !P.paramName || !((
|
|
13191
|
+
if (!P.isCustom || !P.paramName || !((O = P.blockingValues) != null && O.length)) continue;
|
|
13192
13192
|
const p = me[P.paramName] ?? "";
|
|
13193
13193
|
if (P.customType === "group_checkbox") {
|
|
13194
13194
|
if (p.split(",").filter(Boolean).some((z) => P.blockingValues.includes(z))) return !0;
|
|
@@ -13196,90 +13196,90 @@ const nn = ({
|
|
|
13196
13196
|
return !0;
|
|
13197
13197
|
}
|
|
13198
13198
|
return !1;
|
|
13199
|
-
}, _e =
|
|
13200
|
-
const
|
|
13199
|
+
}, _e = N && ce < N.length - 1 ? ce + 1 : -1, st = N && ce > 0 ? ce - 1 : -1, Ze = (b) => {
|
|
13200
|
+
const O = {};
|
|
13201
13201
|
for (const P of b.fields)
|
|
13202
13202
|
if (P.isCustom) {
|
|
13203
13203
|
if (P.customType === "paragraph" || P.customType === "html" || P.customType === "br" || P.customType === "link") continue;
|
|
13204
13204
|
if (P.required && P.paramName) {
|
|
13205
13205
|
const p = me[P.paramName], h = ie(P.displayText, g) || ie(P.label, g) || P.paramName;
|
|
13206
|
-
P.customType === "checkbox" || P.customType === "link_checkbox" ? p !== "true" && (
|
|
13206
|
+
P.customType === "checkbox" || P.customType === "link_checkbox" ? p !== "true" && (O[P.paramName] = g("validation.fieldRequired", { field: h })) : (!p || p.trim() === "") && (O[P.paramName] = g("validation.fieldRequired", { field: h }));
|
|
13207
13207
|
}
|
|
13208
13208
|
} else if (P.name) {
|
|
13209
13209
|
const p = P.name;
|
|
13210
13210
|
if (K.includes(p) && qt(ee[p])) {
|
|
13211
13211
|
const h = ht[p], z = ie(P.displayText, g) || (h != null && h.translationKey ? g(`fields.${h.translationKey}`) : void 0) || (h == null ? void 0 : h.label) || p;
|
|
13212
|
-
|
|
13212
|
+
O[p] = g("validation.fieldRequired", { field: z });
|
|
13213
13213
|
}
|
|
13214
13214
|
}
|
|
13215
|
-
return
|
|
13215
|
+
return O;
|
|
13216
13216
|
}, Ye = async () => {
|
|
13217
|
-
if (!
|
|
13218
|
-
const b =
|
|
13217
|
+
if (!N) return;
|
|
13218
|
+
const b = N[ce];
|
|
13219
13219
|
if (Se(b) || b.conditionalOn && b.conditionalMode === "block" && !Ne(b)) return;
|
|
13220
13220
|
if (b.conditionalOn && !Ne(b)) {
|
|
13221
13221
|
re({}), _e >= 0 ? Y(_e) : await ze();
|
|
13222
13222
|
return;
|
|
13223
13223
|
}
|
|
13224
|
-
const
|
|
13225
|
-
if (Object.keys(
|
|
13226
|
-
re(
|
|
13224
|
+
const O = Ze(b);
|
|
13225
|
+
if (Object.keys(O).length > 0) {
|
|
13226
|
+
re(O);
|
|
13227
13227
|
return;
|
|
13228
13228
|
}
|
|
13229
13229
|
re({}), _e >= 0 ? Y(_e) : await ze();
|
|
13230
13230
|
}, ze = async () => {
|
|
13231
13231
|
var b;
|
|
13232
|
-
if (
|
|
13233
|
-
let
|
|
13234
|
-
for (const P of
|
|
13235
|
-
Ne(P) && (
|
|
13236
|
-
if (Object.keys(
|
|
13237
|
-
re(
|
|
13232
|
+
if (N) {
|
|
13233
|
+
let O = {};
|
|
13234
|
+
for (const P of N)
|
|
13235
|
+
Ne(P) && (O = { ...O, ...Ze(P) });
|
|
13236
|
+
if (Object.keys(O).length > 0) {
|
|
13237
|
+
re(O);
|
|
13238
13238
|
return;
|
|
13239
13239
|
}
|
|
13240
13240
|
}
|
|
13241
13241
|
ye(!0), E(null);
|
|
13242
13242
|
try {
|
|
13243
|
-
const
|
|
13243
|
+
const O = {
|
|
13244
13244
|
workflowKey: ee.workflowKey,
|
|
13245
13245
|
externalRefId: ((b = ee.externalRefId) == null ? void 0 : b.trim()) || void 0
|
|
13246
|
-
}, P =
|
|
13246
|
+
}, P = N ? N.filter((z) => Ne(z)).flatMap((z) => z.fields).filter((z) => !z.isCustom && z.name).map((z) => z.name) : q;
|
|
13247
13247
|
for (const z of P) {
|
|
13248
13248
|
const R = ee[z];
|
|
13249
13249
|
if (!qt(R))
|
|
13250
13250
|
switch (z) {
|
|
13251
13251
|
case "companyName":
|
|
13252
|
-
|
|
13252
|
+
O.companyName = R;
|
|
13253
13253
|
break;
|
|
13254
13254
|
case "email":
|
|
13255
|
-
|
|
13255
|
+
O.companyEmail = R;
|
|
13256
13256
|
break;
|
|
13257
13257
|
case "phone":
|
|
13258
|
-
|
|
13258
|
+
O.companyPhone = R;
|
|
13259
13259
|
break;
|
|
13260
13260
|
case "registrationNumber":
|
|
13261
|
-
|
|
13261
|
+
O.companyRegistrationNumber = R;
|
|
13262
13262
|
break;
|
|
13263
13263
|
case "countryResidence":
|
|
13264
|
-
|
|
13264
|
+
O.companyCountry = R;
|
|
13265
13265
|
break;
|
|
13266
13266
|
case "city":
|
|
13267
|
-
|
|
13267
|
+
O.companyCity = R;
|
|
13268
13268
|
break;
|
|
13269
13269
|
case "street":
|
|
13270
|
-
|
|
13270
|
+
O.companyStreet = R;
|
|
13271
13271
|
break;
|
|
13272
13272
|
case "postalCode":
|
|
13273
|
-
|
|
13273
|
+
O.companyZip = R;
|
|
13274
13274
|
break;
|
|
13275
13275
|
default:
|
|
13276
|
-
|
|
13276
|
+
O[z] = R;
|
|
13277
13277
|
break;
|
|
13278
13278
|
}
|
|
13279
13279
|
}
|
|
13280
13280
|
const p = [];
|
|
13281
|
-
if (
|
|
13282
|
-
for (const z of
|
|
13281
|
+
if (N) {
|
|
13282
|
+
for (const z of N)
|
|
13283
13283
|
if (Ne(z))
|
|
13284
13284
|
for (const R of z.fields) {
|
|
13285
13285
|
if (!R.isCustom || !R.paramName || R.customType === "paragraph" || R.customType === "html" || R.customType === "br" || R.customType === "link") continue;
|
|
@@ -13291,27 +13291,27 @@ const nn = ({
|
|
|
13291
13291
|
p.push({ paramName: R.paramName, value: d });
|
|
13292
13292
|
}
|
|
13293
13293
|
}
|
|
13294
|
-
p.length > 0 && (
|
|
13295
|
-
const h = await c(
|
|
13294
|
+
p.length > 0 && (O.applicantAdditionalDatas = p);
|
|
13295
|
+
const h = await c(O);
|
|
13296
13296
|
a(h.applicantId);
|
|
13297
|
-
} catch (
|
|
13298
|
-
console.error("Error creating company applicant:",
|
|
13297
|
+
} catch (O) {
|
|
13298
|
+
console.error("Error creating company applicant:", O), E(O.message || g("createCompany.failedToCreate"));
|
|
13299
13299
|
} finally {
|
|
13300
13300
|
ye(!1);
|
|
13301
13301
|
}
|
|
13302
13302
|
}, Qe = async (b) => {
|
|
13303
13303
|
b.preventDefault();
|
|
13304
|
-
for (const
|
|
13305
|
-
if (qt(ee[
|
|
13306
|
-
const P = ht[
|
|
13304
|
+
for (const O of K)
|
|
13305
|
+
if (qt(ee[O])) {
|
|
13306
|
+
const P = ht[O], p = (P != null && P.translationKey ? g(`fields.${P.translationKey}`) : void 0) || (P == null ? void 0 : P.label) || O;
|
|
13307
13307
|
E(g("validation.fieldRequired", { field: p }));
|
|
13308
13308
|
return;
|
|
13309
13309
|
}
|
|
13310
13310
|
await ze();
|
|
13311
|
-
}, He = (b,
|
|
13311
|
+
}, He = (b, O, P, p, h) => {
|
|
13312
13312
|
const z = ht[b];
|
|
13313
13313
|
if (!z) return null;
|
|
13314
|
-
const R = K.includes(b), B = Q[b], d = ie(P, g) || (z.translationKey ? g(`fields.${z.translationKey}`) : void 0) || z.label, I = b in $,
|
|
13314
|
+
const R = K.includes(b), B = Q[b], d = ie(P, g) || (z.translationKey ? g(`fields.${z.translationKey}`) : void 0) || z.label, I = b in $, S = O ?? b, m = h ? h !== "placeholder" : V, v = m ? d : void 0;
|
|
13315
13315
|
switch (z.type) {
|
|
13316
13316
|
case "select":
|
|
13317
13317
|
if (b === "countryResidence" || b === "addressCountry") {
|
|
@@ -13328,7 +13328,7 @@ const nn = ({
|
|
|
13328
13328
|
readOnly: I,
|
|
13329
13329
|
error: B
|
|
13330
13330
|
},
|
|
13331
|
-
|
|
13331
|
+
S
|
|
13332
13332
|
);
|
|
13333
13333
|
}
|
|
13334
13334
|
return null;
|
|
@@ -13345,7 +13345,7 @@ const nn = ({
|
|
|
13345
13345
|
readOnly: I,
|
|
13346
13346
|
error: B
|
|
13347
13347
|
},
|
|
13348
|
-
|
|
13348
|
+
S
|
|
13349
13349
|
);
|
|
13350
13350
|
case "email":
|
|
13351
13351
|
return /* @__PURE__ */ i(
|
|
@@ -13360,7 +13360,7 @@ const nn = ({
|
|
|
13360
13360
|
readOnly: I,
|
|
13361
13361
|
error: B
|
|
13362
13362
|
},
|
|
13363
|
-
|
|
13363
|
+
S
|
|
13364
13364
|
);
|
|
13365
13365
|
case "tel":
|
|
13366
13366
|
return /* @__PURE__ */ i(
|
|
@@ -13375,7 +13375,7 @@ const nn = ({
|
|
|
13375
13375
|
readOnly: I,
|
|
13376
13376
|
error: B
|
|
13377
13377
|
},
|
|
13378
|
-
|
|
13378
|
+
S
|
|
13379
13379
|
);
|
|
13380
13380
|
default:
|
|
13381
13381
|
return /* @__PURE__ */ i(
|
|
@@ -13390,10 +13390,10 @@ const nn = ({
|
|
|
13390
13390
|
readOnly: I,
|
|
13391
13391
|
error: B
|
|
13392
13392
|
},
|
|
13393
|
-
|
|
13393
|
+
S
|
|
13394
13394
|
);
|
|
13395
13395
|
}
|
|
13396
|
-
}, et = (b,
|
|
13396
|
+
}, et = (b, O) => {
|
|
13397
13397
|
if (b.customType === "paragraph")
|
|
13398
13398
|
return /* @__PURE__ */ i(
|
|
13399
13399
|
"p",
|
|
@@ -13401,12 +13401,12 @@ const nn = ({
|
|
|
13401
13401
|
style: { fontSize: "14px", lineHeight: "1.7", margin: 0, color: "var(--metakyc-text-secondary, #6b7280)" },
|
|
13402
13402
|
dangerouslySetInnerHTML: { __html: ie(b.displayText, g) || ie(b.label, g) || "" }
|
|
13403
13403
|
},
|
|
13404
|
-
`custom-${
|
|
13404
|
+
`custom-${O}`
|
|
13405
13405
|
);
|
|
13406
13406
|
if (b.customType === "html")
|
|
13407
|
-
return /* @__PURE__ */ i("div", { dangerouslySetInnerHTML: { __html: ie(b.label, g) || "" } }, `custom-${
|
|
13407
|
+
return /* @__PURE__ */ i("div", { dangerouslySetInnerHTML: { __html: ie(b.label, g) || "" } }, `custom-${O}`);
|
|
13408
13408
|
if (b.customType === "br")
|
|
13409
|
-
return /* @__PURE__ */ i("div", { style: { height: "12px" } }, `custom-${
|
|
13409
|
+
return /* @__PURE__ */ i("div", { style: { height: "12px" } }, `custom-${O}`);
|
|
13410
13410
|
if (b.customType === "link")
|
|
13411
13411
|
return /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(
|
|
13412
13412
|
"a",
|
|
@@ -13417,9 +13417,9 @@ const nn = ({
|
|
|
13417
13417
|
style: { color: "var(--metakyc-primary, #2563eb)", fontSize: "14px", textDecoration: "underline" },
|
|
13418
13418
|
children: ie(b.displayText, g) || ie(b.label, g) || b.linkText || b.linkUrl || ""
|
|
13419
13419
|
}
|
|
13420
|
-
) }, `custom-${
|
|
13420
|
+
) }, `custom-${O}`);
|
|
13421
13421
|
if (!b.paramName) return null;
|
|
13422
|
-
const P = Q[b.paramName], p = ie(b.displayText, g) || ie(b.label, g) || b.paramName, h = b.labelMode ? b.labelMode !== "placeholder" :
|
|
13422
|
+
const P = Q[b.paramName], p = ie(b.displayText, g) || ie(b.label, g) || b.paramName, h = b.labelMode ? b.labelMode !== "placeholder" : V;
|
|
13423
13423
|
if (b.customType === "checkbox") {
|
|
13424
13424
|
const z = me[b.paramName] === "true";
|
|
13425
13425
|
return /* @__PURE__ */ l("div", { className: "flex flex-col gap-1", children: [
|
|
@@ -13446,7 +13446,7 @@ const nn = ({
|
|
|
13446
13446
|
}
|
|
13447
13447
|
),
|
|
13448
13448
|
P && /* @__PURE__ */ i("p", { className: "text-xs mt-0.5", style: { color: "var(--metakyc-danger, #ef4444)" }, children: P })
|
|
13449
|
-
] }, `custom-${
|
|
13449
|
+
] }, `custom-${O}`);
|
|
13450
13450
|
}
|
|
13451
13451
|
return /* @__PURE__ */ i(
|
|
13452
13452
|
Ce,
|
|
@@ -13459,23 +13459,23 @@ const nn = ({
|
|
|
13459
13459
|
required: b.required,
|
|
13460
13460
|
error: P
|
|
13461
13461
|
},
|
|
13462
|
-
`custom-${
|
|
13462
|
+
`custom-${O}`
|
|
13463
13463
|
);
|
|
13464
13464
|
}, De = (b) => {
|
|
13465
|
-
const
|
|
13465
|
+
const O = Ne(b);
|
|
13466
13466
|
return /* @__PURE__ */ l("div", { className: "space-y-4", children: [
|
|
13467
13467
|
b.conditionalOn && /* @__PURE__ */ l(
|
|
13468
13468
|
"div",
|
|
13469
13469
|
{
|
|
13470
13470
|
role: "checkbox",
|
|
13471
|
-
"aria-checked":
|
|
13472
|
-
onClick: () => ke(b.conditionalOn,
|
|
13471
|
+
"aria-checked": O,
|
|
13472
|
+
onClick: () => ke(b.conditionalOn, O ? "false" : "true"),
|
|
13473
13473
|
style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer", userSelect: "none" },
|
|
13474
13474
|
children: [
|
|
13475
13475
|
/* @__PURE__ */ i(
|
|
13476
13476
|
Xe,
|
|
13477
13477
|
{
|
|
13478
|
-
checked:
|
|
13478
|
+
checked: O,
|
|
13479
13479
|
onChange: (P) => ke(b.conditionalOn, P ? "true" : "false")
|
|
13480
13480
|
}
|
|
13481
13481
|
),
|
|
@@ -13483,7 +13483,7 @@ const nn = ({
|
|
|
13483
13483
|
]
|
|
13484
13484
|
}
|
|
13485
13485
|
),
|
|
13486
|
-
|
|
13486
|
+
O && /* @__PURE__ */ i("div", { className: "metakyc-form-grid", children: b.fields.map((P, p) => {
|
|
13487
13487
|
const h = Math.min(4, Math.max(1, Number(P.colSpan) || 4)), z = P.isCustom ? `custom-${p}-${P.paramName}` : `builtin-${P.name}-${p}`;
|
|
13488
13488
|
return /* @__PURE__ */ i("div", { style: { gridColumn: `span ${h} / span ${h}` }, children: P.isCustom ? et(P, p) : He(P.name, z, P.displayText, P.countriesType, P.labelMode) }, z);
|
|
13489
13489
|
}) })
|
|
@@ -13494,8 +13494,8 @@ const nn = ({
|
|
|
13494
13494
|
/* @__PURE__ */ i(Ke, { className: "my-8" }),
|
|
13495
13495
|
/* @__PURE__ */ i("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: g("common.loadingForm") })
|
|
13496
13496
|
] }) }) });
|
|
13497
|
-
if (
|
|
13498
|
-
const b =
|
|
13497
|
+
if (N) {
|
|
13498
|
+
const b = N[ce] ?? N[0], O = st === -1, P = _e === -1, p = N.length, h = Ne(b), z = Se(b), R = Object.values(Q), B = !h && !!b.conditionalOn && b.conditionalMode === "block", d = H || u || B || z;
|
|
13499
13499
|
let I;
|
|
13500
13500
|
return B || z ? I = g("common.blocked") : P ? I = b.conditionalOn && !h ? g("common.skipAndSubmit") : g("common.submit") : I = b.conditionalOn && !h ? g("common.skip") : g("common.next"), /* @__PURE__ */ i("div", { className: "metakyc-sdk", children: /* @__PURE__ */ l(ne, { children: [
|
|
13501
13501
|
/* @__PURE__ */ i(Le, { children: /* @__PURE__ */ i(Tt, { title: (s == null ? void 0 : s.title) || g("createCompany.title") }) }),
|
|
@@ -13513,10 +13513,10 @@ const nn = ({
|
|
|
13513
13513
|
" ",
|
|
13514
13514
|
A
|
|
13515
13515
|
] }),
|
|
13516
|
-
R.map((
|
|
13516
|
+
R.map((S, m) => /* @__PURE__ */ i("p", { className: "text-sm", style: { color: "var(--metakyc-danger, #ef4444)" }, children: S }, m))
|
|
13517
13517
|
] }),
|
|
13518
13518
|
p > 1 && /* @__PURE__ */ l("div", { style: { display: "flex", alignItems: "center", gap: "0.5rem", marginBottom: "1rem" }, children: [
|
|
13519
|
-
|
|
13519
|
+
N.map((S, m) => /* @__PURE__ */ i(
|
|
13520
13520
|
"div",
|
|
13521
13521
|
{
|
|
13522
13522
|
style: {
|
|
@@ -13538,7 +13538,7 @@ const nn = ({
|
|
|
13538
13538
|
] }),
|
|
13539
13539
|
/* @__PURE__ */ l(Ee, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
13540
13540
|
/* @__PURE__ */ l("div", { children: [
|
|
13541
|
-
!
|
|
13541
|
+
!O && /* @__PURE__ */ i(
|
|
13542
13542
|
le,
|
|
13543
13543
|
{
|
|
13544
13544
|
type: "button",
|
|
@@ -13550,7 +13550,7 @@ const nn = ({
|
|
|
13550
13550
|
children: g("common.previous")
|
|
13551
13551
|
}
|
|
13552
13552
|
),
|
|
13553
|
-
|
|
13553
|
+
O && r && /* @__PURE__ */ i(le, { type: "button", variant: "outline", onClick: r, disabled: H || u, children: "Cancel" })
|
|
13554
13554
|
] }),
|
|
13555
13555
|
/* @__PURE__ */ i(le, { type: "button", isLoading: H || u, disabled: d, onClick: P ? ze : Ye, children: I })
|
|
13556
13556
|
] })
|
|
@@ -13567,7 +13567,7 @@ const nn = ({
|
|
|
13567
13567
|
" ",
|
|
13568
13568
|
A
|
|
13569
13569
|
] }) }),
|
|
13570
|
-
/* @__PURE__ */ i("div", { className: "metakyc-form-grid", children:
|
|
13570
|
+
/* @__PURE__ */ i("div", { className: "metakyc-form-grid", children: q.map((b) => /* @__PURE__ */ i("div", { style: { gridColumn: "span 4 / span 4" }, children: He(b) }, b)) })
|
|
13571
13571
|
] }),
|
|
13572
13572
|
/* @__PURE__ */ l(Ee, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
13573
13573
|
r && /* @__PURE__ */ i(le, { type: "button", variant: "outline", onClick: r, disabled: H || u, children: "Cancel" }),
|
|
@@ -13589,9 +13589,9 @@ const nn = ({
|
|
|
13589
13589
|
hasWorkflowChanged: f,
|
|
13590
13590
|
isLoading: D,
|
|
13591
13591
|
error: T,
|
|
13592
|
-
moveBack:
|
|
13593
|
-
refreshProgress:
|
|
13594
|
-
} = na(e), [
|
|
13592
|
+
moveBack: x,
|
|
13593
|
+
refreshProgress: V
|
|
13594
|
+
} = na(e), [N, K] = he.useState(!1), [q, F] = he.useState(null), M = he.useRef(null), U = At(), {
|
|
13595
13595
|
questionnaireService: G,
|
|
13596
13596
|
overviewService: se,
|
|
13597
13597
|
riskScoringService: k,
|
|
@@ -13599,7 +13599,7 @@ const nn = ({
|
|
|
13599
13599
|
uploadDocumentService: j
|
|
13600
13600
|
} = Te();
|
|
13601
13601
|
he.useEffect(() => {
|
|
13602
|
-
const Y =
|
|
13602
|
+
const Y = U.current;
|
|
13603
13603
|
if (!Y) return;
|
|
13604
13604
|
const Q = u ? u.title || u.name || ae[u.action] : null;
|
|
13605
13605
|
Y.updateSdkState({
|
|
@@ -13609,23 +13609,23 @@ const nn = ({
|
|
|
13609
13609
|
workflowStatus: (c == null ? void 0 : c.status) != null ? qe[c.status] : null,
|
|
13610
13610
|
totalSteps: g.length
|
|
13611
13611
|
});
|
|
13612
|
-
}, [
|
|
13613
|
-
const Y =
|
|
13612
|
+
}, [U, u, c == null ? void 0 : c.status, g.length]), he.useEffect(() => {
|
|
13613
|
+
const Y = U.current;
|
|
13614
13614
|
if (Y)
|
|
13615
13615
|
return Y.registerAction({
|
|
13616
13616
|
id: "workflow-refresh",
|
|
13617
13617
|
label: "Refresh Progress",
|
|
13618
13618
|
icon: "🔄",
|
|
13619
13619
|
group: "workflow",
|
|
13620
|
-
handler:
|
|
13620
|
+
handler: V
|
|
13621
13621
|
}), () => Y.unregisterAction("workflow-refresh");
|
|
13622
|
-
}, [
|
|
13622
|
+
}, [U, V]);
|
|
13623
13623
|
const X = he.useMemo(() => g.filter((Y) => Y.visibility !== !1), [g]), $ = he.useMemo(
|
|
13624
13624
|
() => X.findIndex((Y) => Y.order === (u == null ? void 0 : u.order)),
|
|
13625
13625
|
[X, u == null ? void 0 : u.order]
|
|
13626
13626
|
) <= 0;
|
|
13627
13627
|
he.useEffect(() => {
|
|
13628
|
-
const Y =
|
|
13628
|
+
const Y = U.current;
|
|
13629
13629
|
if (Y) {
|
|
13630
13630
|
if ($) {
|
|
13631
13631
|
Y.unregisterAction("workflow-back");
|
|
@@ -13636,10 +13636,10 @@ const nn = ({
|
|
|
13636
13636
|
label: "Go to Previous Step",
|
|
13637
13637
|
icon: "⏪",
|
|
13638
13638
|
group: "workflow",
|
|
13639
|
-
handler:
|
|
13639
|
+
handler: x
|
|
13640
13640
|
}), () => Y.unregisterAction("workflow-back");
|
|
13641
13641
|
}
|
|
13642
|
-
}, [
|
|
13642
|
+
}, [U, x, $]);
|
|
13643
13643
|
const ee = he.useCallback(async () => {
|
|
13644
13644
|
if (!u || !e) return;
|
|
13645
13645
|
const Y = u.action;
|
|
@@ -13730,14 +13730,14 @@ const nn = ({
|
|
|
13730
13730
|
_.warn(`[DevTools] Cannot skip step type: ${ae[Y]}`);
|
|
13731
13731
|
return;
|
|
13732
13732
|
}
|
|
13733
|
-
await
|
|
13733
|
+
await V();
|
|
13734
13734
|
} catch (Q) {
|
|
13735
13735
|
_.warn(`[DevTools] Failed to skip step: ${Q}`);
|
|
13736
13736
|
}
|
|
13737
13737
|
}, [
|
|
13738
13738
|
u,
|
|
13739
13739
|
e,
|
|
13740
|
-
|
|
13740
|
+
V,
|
|
13741
13741
|
G,
|
|
13742
13742
|
se,
|
|
13743
13743
|
k,
|
|
@@ -13745,7 +13745,7 @@ const nn = ({
|
|
|
13745
13745
|
j
|
|
13746
13746
|
]);
|
|
13747
13747
|
he.useEffect(() => {
|
|
13748
|
-
const Y =
|
|
13748
|
+
const Y = U.current;
|
|
13749
13749
|
if (!Y || !u) return;
|
|
13750
13750
|
const Q = u.action;
|
|
13751
13751
|
if (!(Q !== ae.IdentitySdk && Q !== ae.ManualReview)) {
|
|
@@ -13759,7 +13759,7 @@ const nn = ({
|
|
|
13759
13759
|
group: "workflow",
|
|
13760
13760
|
handler: ee
|
|
13761
13761
|
}), () => Y.unregisterAction("workflow-skip");
|
|
13762
|
-
}, [
|
|
13762
|
+
}, [U, u, ee]), he.useEffect(() => {
|
|
13763
13763
|
T && a && a(T);
|
|
13764
13764
|
}, [T, a]), he.useEffect(() => {
|
|
13765
13765
|
c != null && c.workflowResult && t && t(c.workflowResult);
|
|
@@ -13788,7 +13788,7 @@ const nn = ({
|
|
|
13788
13788
|
})(), () => {
|
|
13789
13789
|
Y = !0;
|
|
13790
13790
|
};
|
|
13791
|
-
}, [f, y, e, s, r]), D ||
|
|
13791
|
+
}, [f, y, e, s, r]), D || N || !c)
|
|
13792
13792
|
return /* @__PURE__ */ i("div", { className: `metakyc-sdk ${n || ""}`, children: /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ l(oe, { children: [
|
|
13793
13793
|
/* @__PURE__ */ i(Ke, { className: "my-8" }),
|
|
13794
13794
|
/* @__PURE__ */ i("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: o("workflow.loadingWorkflow") })
|
|
@@ -13799,9 +13799,9 @@ const nn = ({
|
|
|
13799
13799
|
/* @__PURE__ */ i("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: T.message })
|
|
13800
13800
|
] }) }) }) });
|
|
13801
13801
|
if (f)
|
|
13802
|
-
return
|
|
13802
|
+
return q ? /* @__PURE__ */ i("div", { className: `metakyc-sdk ${n || ""}`, children: /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ i(oe, { children: /* @__PURE__ */ l("div", { className: "text-center py-8", children: [
|
|
13803
13803
|
/* @__PURE__ */ i("p", { className: "text-lg mb-2", style: { color: "var(--metakyc-danger, #ef4444)" }, children: o("workflow.errorOccurred") }),
|
|
13804
|
-
/* @__PURE__ */ i("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children:
|
|
13804
|
+
/* @__PURE__ */ i("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: q })
|
|
13805
13805
|
] }) }) }) }) : /* @__PURE__ */ i("div", { className: `metakyc-sdk ${n || ""}`, children: /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ l(oe, { children: [
|
|
13806
13806
|
/* @__PURE__ */ i(Ke, { className: "my-8" }),
|
|
13807
13807
|
/* @__PURE__ */ i("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: o("workflow.loadingWorkflow") })
|
|
@@ -13889,9 +13889,9 @@ const nn = ({
|
|
|
13889
13889
|
const re = g.filter((E) => E.visibility !== !1).findIndex((E) => E.order === u.order) <= 0, A = {
|
|
13890
13890
|
applicantId: e,
|
|
13891
13891
|
onComplete: async () => {
|
|
13892
|
-
await
|
|
13892
|
+
await V();
|
|
13893
13893
|
},
|
|
13894
|
-
onBack: re ? void 0 :
|
|
13894
|
+
onBack: re ? void 0 : x
|
|
13895
13895
|
};
|
|
13896
13896
|
switch (u.action) {
|
|
13897
13897
|
case ae.Questionaries:
|
|
@@ -14045,7 +14045,7 @@ const bi = ({
|
|
|
14045
14045
|
onApplicantCreated: r,
|
|
14046
14046
|
className: n
|
|
14047
14047
|
}) => {
|
|
14048
|
-
var
|
|
14048
|
+
var q, F;
|
|
14049
14049
|
const { t: o } = Ie(), { config: s } = Te(), {
|
|
14050
14050
|
phase: c,
|
|
14051
14051
|
applicantId: u,
|
|
@@ -14054,22 +14054,22 @@ const bi = ({
|
|
|
14054
14054
|
error: f,
|
|
14055
14055
|
isLoading: D,
|
|
14056
14056
|
transitionToWorkflow: T,
|
|
14057
|
-
switchApplicant:
|
|
14058
|
-
refresh:
|
|
14057
|
+
switchApplicant: x,
|
|
14058
|
+
refresh: V
|
|
14059
14059
|
} = oa(e);
|
|
14060
14060
|
cn(c, u, g, y);
|
|
14061
|
-
const
|
|
14061
|
+
const N = At();
|
|
14062
14062
|
he.useEffect(() => {
|
|
14063
|
-
const M =
|
|
14063
|
+
const M = N.current;
|
|
14064
14064
|
if (M)
|
|
14065
14065
|
return M.registerAction({
|
|
14066
14066
|
id: "dev-refresh-state",
|
|
14067
14067
|
label: "Refresh SDK State",
|
|
14068
14068
|
icon: "🔄",
|
|
14069
14069
|
group: "general",
|
|
14070
|
-
handler:
|
|
14070
|
+
handler: V
|
|
14071
14071
|
}), () => M.unregisterAction("dev-refresh-state");
|
|
14072
|
-
}, [
|
|
14072
|
+
}, [N, V]), he.useEffect(() => {
|
|
14073
14073
|
f && a && a(f);
|
|
14074
14074
|
}, [f, a]);
|
|
14075
14075
|
const K = he.useCallback((M) => {
|
|
@@ -14086,19 +14086,19 @@ const bi = ({
|
|
|
14086
14086
|
/* @__PURE__ */ i("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: (f == null ? void 0 : f.message) || "An unexpected error occurred." })
|
|
14087
14087
|
] }) }) }) });
|
|
14088
14088
|
if (c === "create_applicant") {
|
|
14089
|
-
const M = y || ((
|
|
14089
|
+
const M = y || ((q = s.applicantForm) == null ? void 0 : q.workflowKey), U = (F = s.applicantForm) == null ? void 0 : F.externalRefId;
|
|
14090
14090
|
return g ? /* @__PURE__ */ i("div", { className: `metakyc-sdk ${n || ""}`, children: /* @__PURE__ */ i(
|
|
14091
14091
|
nn,
|
|
14092
14092
|
{
|
|
14093
14093
|
workflowKey: M,
|
|
14094
|
-
externalRefId:
|
|
14094
|
+
externalRefId: U,
|
|
14095
14095
|
onSuccess: K
|
|
14096
14096
|
}
|
|
14097
14097
|
) }) : /* @__PURE__ */ i("div", { className: `metakyc-sdk ${n || ""}`, children: /* @__PURE__ */ i(
|
|
14098
14098
|
an,
|
|
14099
14099
|
{
|
|
14100
14100
|
workflowKey: M,
|
|
14101
|
-
externalRefId:
|
|
14101
|
+
externalRefId: U,
|
|
14102
14102
|
applicantId: u,
|
|
14103
14103
|
onSuccess: K
|
|
14104
14104
|
}
|
|
@@ -14110,7 +14110,7 @@ const bi = ({
|
|
|
14110
14110
|
applicantId: u,
|
|
14111
14111
|
onComplete: t,
|
|
14112
14112
|
onError: a,
|
|
14113
|
-
onWorkflowChange:
|
|
14113
|
+
onWorkflowChange: x,
|
|
14114
14114
|
className: ""
|
|
14115
14115
|
}
|
|
14116
14116
|
) }) : /* @__PURE__ */ i("div", { className: `metakyc-sdk ${n || ""}`, children: /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ i(oe, { children: /* @__PURE__ */ i("div", { className: "text-center py-8", children: /* @__PURE__ */ i("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Unable to determine SDK state. Ensure the session token contains a valid ExternalRefId." }) }) }) }) });
|