@vpdev2/metakyc 1.0.54 → 1.0.55
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 +4 -4
- package/dist/client/session.d.ts.map +1 -1
- package/dist/components/CreateApplicantForm.d.ts.map +1 -1
- package/dist/hooks/useApplicant.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +382 -379
- package/dist/index.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6812,7 +6812,7 @@ function Q(e, t) {
|
|
|
6812
6812
|
const r = Rr.exec(a);
|
|
6813
6813
|
return r ? t(r[1]) : e;
|
|
6814
6814
|
}
|
|
6815
|
-
const si = "1.0.
|
|
6815
|
+
const si = "1.0.55", li = ii(null), Yt = `metakyc-translations-${si}-`, Ir = ({
|
|
6816
6816
|
locale: e,
|
|
6817
6817
|
fetchTranslations: t,
|
|
6818
6818
|
children: a
|
|
@@ -6878,7 +6878,7 @@ function Ar() {
|
|
|
6878
6878
|
const $t = "metakyc-theme-cache", Fa = ({ config: e, children: t }) => {
|
|
6879
6879
|
Ar();
|
|
6880
6880
|
const [a, r] = w(null), n = Ie.useRef(!1), s = Ie.useRef(!1), l = Ue(() => {
|
|
6881
|
-
const m = new Mi(e), f = new ji(m), g = new Fi(m), N = new Oi(m),
|
|
6881
|
+
const m = new Mi(e), f = new ji(m), g = new Fi(m), N = new Oi(m), z = new Vi(m), S = new Bi(m), q = new qi(m), T = new Ui(m), $ = new Wi(m), K = new Ki(m), F = new Xi(m), L = new Zi(m), H = new lr();
|
|
6882
6882
|
if (typeof document < "u")
|
|
6883
6883
|
if (e.theme)
|
|
6884
6884
|
H.applyTheme(e.theme);
|
|
@@ -6894,14 +6894,14 @@ const $t = "metakyc-theme-cache", Fa = ({ config: e, children: t }) => {
|
|
|
6894
6894
|
applicantService: f,
|
|
6895
6895
|
questionnaireService: g,
|
|
6896
6896
|
uploadDocumentService: N,
|
|
6897
|
-
appropriatenessTestService:
|
|
6897
|
+
appropriatenessTestService: z,
|
|
6898
6898
|
overviewService: S,
|
|
6899
6899
|
riskScoringService: q,
|
|
6900
6900
|
identityService: T,
|
|
6901
6901
|
baseInformationService: $,
|
|
6902
6902
|
investorCategorizationService: K,
|
|
6903
6903
|
themeService: F,
|
|
6904
|
-
translationService:
|
|
6904
|
+
translationService: L,
|
|
6905
6905
|
themeManager: H
|
|
6906
6906
|
};
|
|
6907
6907
|
}, [e]), d = Ue(() => ({
|
|
@@ -7064,17 +7064,17 @@ function Mr(e) {
|
|
|
7064
7064
|
ve(() => {
|
|
7065
7065
|
m.current || (m.current = t());
|
|
7066
7066
|
}, [t]), ve(() => {
|
|
7067
|
-
var
|
|
7067
|
+
var L;
|
|
7068
7068
|
r && f && Pr({
|
|
7069
7069
|
applicantId: f,
|
|
7070
|
-
currentStepOrder: (
|
|
7070
|
+
currentStepOrder: (L = r.currentStep) == null ? void 0 : L.order,
|
|
7071
7071
|
status: r.status,
|
|
7072
7072
|
lastUpdated: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7073
7073
|
workflowKey: r.workFlowKey,
|
|
7074
7074
|
nextWorkflowKey: r.nextWorkflowKey
|
|
7075
7075
|
});
|
|
7076
7076
|
}, [r, f]);
|
|
7077
|
-
const g = ye(!1), N = ye(!1),
|
|
7077
|
+
const g = ye(!1), N = ye(!1), z = ae(async () => {
|
|
7078
7078
|
if (!(!f || !m.current)) {
|
|
7079
7079
|
if (g.current) {
|
|
7080
7080
|
console.log("[Workflow] Load already in progress, skipping...");
|
|
@@ -7082,18 +7082,18 @@ function Mr(e) {
|
|
|
7082
7082
|
}
|
|
7083
7083
|
g.current = !0, l(!0), u(null);
|
|
7084
7084
|
try {
|
|
7085
|
-
const
|
|
7086
|
-
n(
|
|
7087
|
-
} catch (
|
|
7088
|
-
u(
|
|
7085
|
+
const L = await m.current.initialize(f);
|
|
7086
|
+
n(L), N.current = !0;
|
|
7087
|
+
} catch (L) {
|
|
7088
|
+
u(L);
|
|
7089
7089
|
} finally {
|
|
7090
7090
|
l(!1), g.current = !1;
|
|
7091
7091
|
}
|
|
7092
7092
|
}
|
|
7093
7093
|
}, [f]);
|
|
7094
7094
|
ve(() => {
|
|
7095
|
-
f && !N.current &&
|
|
7096
|
-
}, [f,
|
|
7095
|
+
f && !N.current && z();
|
|
7096
|
+
}, [f, z]);
|
|
7097
7097
|
const S = ae(async () => {
|
|
7098
7098
|
if (m.current) {
|
|
7099
7099
|
if (g.current) {
|
|
@@ -7102,10 +7102,10 @@ function Mr(e) {
|
|
|
7102
7102
|
}
|
|
7103
7103
|
g.current = !0, l(!0), u(null);
|
|
7104
7104
|
try {
|
|
7105
|
-
const
|
|
7106
|
-
n(
|
|
7107
|
-
} catch (
|
|
7108
|
-
u(
|
|
7105
|
+
const L = await m.current.refreshProgress();
|
|
7106
|
+
n(L);
|
|
7107
|
+
} catch (L) {
|
|
7108
|
+
u(L);
|
|
7109
7109
|
} finally {
|
|
7110
7110
|
l(!1), g.current = !1;
|
|
7111
7111
|
}
|
|
@@ -7114,10 +7114,10 @@ function Mr(e) {
|
|
|
7114
7114
|
if (m.current) {
|
|
7115
7115
|
l(!0), u(null);
|
|
7116
7116
|
try {
|
|
7117
|
-
const
|
|
7118
|
-
n(
|
|
7119
|
-
} catch (
|
|
7120
|
-
u(
|
|
7117
|
+
const L = await m.current.moveToNextStep();
|
|
7118
|
+
n(L);
|
|
7119
|
+
} catch (L) {
|
|
7120
|
+
u(L);
|
|
7121
7121
|
} finally {
|
|
7122
7122
|
l(!1);
|
|
7123
7123
|
}
|
|
@@ -7126,19 +7126,19 @@ function Mr(e) {
|
|
|
7126
7126
|
if (m.current) {
|
|
7127
7127
|
l(!0), u(null);
|
|
7128
7128
|
try {
|
|
7129
|
-
const
|
|
7130
|
-
n(
|
|
7131
|
-
} catch (
|
|
7132
|
-
u(
|
|
7129
|
+
const L = await m.current.moveToPreviousStep();
|
|
7130
|
+
n(L);
|
|
7131
|
+
} catch (L) {
|
|
7132
|
+
u(L);
|
|
7133
7133
|
} finally {
|
|
7134
7134
|
l(!1);
|
|
7135
7135
|
}
|
|
7136
7136
|
}
|
|
7137
|
-
}, []), $ = ae(async (
|
|
7137
|
+
}, []), $ = ae(async (L) => {
|
|
7138
7138
|
if (m.current) {
|
|
7139
7139
|
l(!0), u(null);
|
|
7140
7140
|
try {
|
|
7141
|
-
await m.current.submitCurrentStep(
|
|
7141
|
+
await m.current.submitCurrentStep(L);
|
|
7142
7142
|
const H = await m.current.refreshProgress();
|
|
7143
7143
|
n(H);
|
|
7144
7144
|
} catch (H) {
|
|
@@ -7147,7 +7147,7 @@ function Mr(e) {
|
|
|
7147
7147
|
l(!1);
|
|
7148
7148
|
}
|
|
7149
7149
|
}
|
|
7150
|
-
}, []), K = Vt.useMemo(() => r != null && r.stepInfoList ? [...r.stepInfoList].sort((
|
|
7150
|
+
}, []), K = Vt.useMemo(() => r != null && r.stepInfoList ? [...r.stepInfoList].sort((L, H) => L.order - H.order) : [], [r == null ? void 0 : r.stepInfoList]), F = Vt.useMemo(() => r ? r.nextWorkflowKey && r.nextWorkflowKey !== r.workFlowKey : !1, [r]);
|
|
7151
7151
|
return {
|
|
7152
7152
|
progress: r,
|
|
7153
7153
|
applicantId: f,
|
|
@@ -7170,22 +7170,22 @@ function Mr(e) {
|
|
|
7170
7170
|
};
|
|
7171
7171
|
}
|
|
7172
7172
|
function jr(e) {
|
|
7173
|
-
const { questionnaireService: t, applicantService: a } = We(), [r, n] = w(null), [s, l] = w({}), [d, u] = w(!1), [m, f] = w(!1), [g, N] = w(null),
|
|
7173
|
+
const { questionnaireService: t, applicantService: a } = We(), [r, n] = w(null), [s, l] = w({}), [d, u] = w(!1), [m, f] = w(!1), [g, N] = w(null), z = ye(!1), S = ye(null), q = ae(async () => {
|
|
7174
7174
|
var $, K;
|
|
7175
7175
|
if (e) {
|
|
7176
|
-
if (
|
|
7176
|
+
if (z.current) {
|
|
7177
7177
|
console.log("[Questionnaire] Load already in progress, skipping...");
|
|
7178
7178
|
return;
|
|
7179
7179
|
}
|
|
7180
|
-
|
|
7180
|
+
z.current = !0, u(!0), N(null);
|
|
7181
7181
|
try {
|
|
7182
|
-
const [F,
|
|
7182
|
+
const [F, L] = await Promise.all([
|
|
7183
7183
|
t.getQuestionnaire(e),
|
|
7184
7184
|
a.getApplicantData(e).catch(() => null)
|
|
7185
7185
|
]);
|
|
7186
|
-
if (n(F), ($ =
|
|
7186
|
+
if (n(F), ($ = L == null ? void 0 : L.questionnaireResults) != null && $.length && F) {
|
|
7187
7187
|
const H = /* @__PURE__ */ new Map();
|
|
7188
|
-
for (const x of
|
|
7188
|
+
for (const x of L.questionnaireResults)
|
|
7189
7189
|
x.question && ((K = x.answers) != null && K.length) && H.set(x.question.trim().toLowerCase(), x.answers);
|
|
7190
7190
|
const J = {}, ie = F.questionGroups.flatMap((x) => x.questions ?? []);
|
|
7191
7191
|
for (const x of ie) {
|
|
@@ -7198,7 +7198,7 @@ function jr(e) {
|
|
|
7198
7198
|
} catch (F) {
|
|
7199
7199
|
N(F);
|
|
7200
7200
|
} finally {
|
|
7201
|
-
u(!1),
|
|
7201
|
+
u(!1), z.current = !1;
|
|
7202
7202
|
}
|
|
7203
7203
|
}
|
|
7204
7204
|
}, [e, t, a]);
|
|
@@ -7229,7 +7229,7 @@ function jr(e) {
|
|
|
7229
7229
|
};
|
|
7230
7230
|
}
|
|
7231
7231
|
function Fr(e) {
|
|
7232
|
-
const { uploadDocumentService: t } = We(), [a, r] = w(null), [n, s] = w(!1), [l, d] = w(!1), [u, m] = w(0), [f, g] = w(null), N = ye(!1),
|
|
7232
|
+
const { uploadDocumentService: t } = We(), [a, r] = w(null), [n, s] = w(!1), [l, d] = w(!1), [u, m] = w(0), [f, g] = w(null), N = ye(!1), z = ye(null), S = ae(async () => {
|
|
7233
7233
|
if (e) {
|
|
7234
7234
|
if (N.current) {
|
|
7235
7235
|
console.log("[UploadDocument] Load already in progress, skipping...");
|
|
@@ -7238,7 +7238,7 @@ function Fr(e) {
|
|
|
7238
7238
|
N.current = !0, s(!0), g(null);
|
|
7239
7239
|
try {
|
|
7240
7240
|
const T = await t.getUploadDocument(e);
|
|
7241
|
-
r(T),
|
|
7241
|
+
r(T), z.current = e;
|
|
7242
7242
|
} catch (T) {
|
|
7243
7243
|
g(T);
|
|
7244
7244
|
} finally {
|
|
@@ -7247,7 +7247,7 @@ function Fr(e) {
|
|
|
7247
7247
|
}
|
|
7248
7248
|
}, [e, t]);
|
|
7249
7249
|
ve(() => {
|
|
7250
|
-
e &&
|
|
7250
|
+
e && z.current !== e && S();
|
|
7251
7251
|
}, [e]);
|
|
7252
7252
|
const q = ae(
|
|
7253
7253
|
async (T) => {
|
|
@@ -7273,7 +7273,7 @@ function Fr(e) {
|
|
|
7273
7273
|
};
|
|
7274
7274
|
}
|
|
7275
7275
|
function Ya(e) {
|
|
7276
|
-
const { appropriatenessTestService: t } = We(), [a, r] = w(null), [n, s] = w(!1), [l, d] = w(!1), [u, m] = w(null), [f, g] = w(null), N = ye(!1),
|
|
7276
|
+
const { appropriatenessTestService: t } = We(), [a, r] = w(null), [n, s] = w(!1), [l, d] = w(!1), [u, m] = w(null), [f, g] = w(null), N = ye(!1), z = ye(null), S = ae(async () => {
|
|
7277
7277
|
if (e) {
|
|
7278
7278
|
if (N.current) {
|
|
7279
7279
|
console.log("[AppropriatenessTest] Load already in progress, skipping...");
|
|
@@ -7282,7 +7282,7 @@ function Ya(e) {
|
|
|
7282
7282
|
N.current = !0, s(!0), m(null);
|
|
7283
7283
|
try {
|
|
7284
7284
|
const T = await t.getAppropriatenessTest(e);
|
|
7285
|
-
r(T),
|
|
7285
|
+
r(T), z.current = e;
|
|
7286
7286
|
} catch (T) {
|
|
7287
7287
|
m(T);
|
|
7288
7288
|
} finally {
|
|
@@ -7291,7 +7291,7 @@ function Ya(e) {
|
|
|
7291
7291
|
}
|
|
7292
7292
|
}, [e, t]);
|
|
7293
7293
|
ve(() => {
|
|
7294
|
-
e &&
|
|
7294
|
+
e && z.current !== e && S();
|
|
7295
7295
|
}, [e]);
|
|
7296
7296
|
const q = ae(
|
|
7297
7297
|
async (T) => {
|
|
@@ -7338,7 +7338,7 @@ function Or(e) {
|
|
|
7338
7338
|
ve(() => {
|
|
7339
7339
|
e && g.current !== e && N();
|
|
7340
7340
|
}, [e]);
|
|
7341
|
-
const
|
|
7341
|
+
const z = ae(async () => {
|
|
7342
7342
|
if (e) {
|
|
7343
7343
|
d(!0), m(null);
|
|
7344
7344
|
try {
|
|
@@ -7356,14 +7356,14 @@ function Or(e) {
|
|
|
7356
7356
|
isSubmitting: l,
|
|
7357
7357
|
error: u,
|
|
7358
7358
|
load: N,
|
|
7359
|
-
passOverview:
|
|
7359
|
+
passOverview: z
|
|
7360
7360
|
};
|
|
7361
7361
|
}
|
|
7362
7362
|
function Vr(e) {
|
|
7363
7363
|
const { identityService: t } = We(), [a, r] = w(
|
|
7364
7364
|
null
|
|
7365
7365
|
), [n, s] = w(!1), [l, d] = w(null), u = ye(!1), m = ae(
|
|
7366
|
-
async (N,
|
|
7366
|
+
async (N, z) => {
|
|
7367
7367
|
if (e) {
|
|
7368
7368
|
if (u.current) {
|
|
7369
7369
|
console.log("[Identity] Request already in progress, skipping...");
|
|
@@ -7375,7 +7375,7 @@ function Vr(e) {
|
|
|
7375
7375
|
applicantId: e,
|
|
7376
7376
|
restart: !1,
|
|
7377
7377
|
redirectUrl: N || "",
|
|
7378
|
-
ttl:
|
|
7378
|
+
ttl: z || 604800
|
|
7379
7379
|
// Default: 7 days
|
|
7380
7380
|
};
|
|
7381
7381
|
console.log("Identity request input:", S);
|
|
@@ -7390,7 +7390,7 @@ function Vr(e) {
|
|
|
7390
7390
|
},
|
|
7391
7391
|
[e, t]
|
|
7392
7392
|
), f = ae(
|
|
7393
|
-
async (N,
|
|
7393
|
+
async (N, z) => {
|
|
7394
7394
|
if (e) {
|
|
7395
7395
|
s(!0), d(null);
|
|
7396
7396
|
try {
|
|
@@ -7398,7 +7398,7 @@ function Vr(e) {
|
|
|
7398
7398
|
applicantId: e,
|
|
7399
7399
|
restart: !1,
|
|
7400
7400
|
redirectUrl: N,
|
|
7401
|
-
ttl:
|
|
7401
|
+
ttl: z
|
|
7402
7402
|
}, q = await t.identityCompanyRequest(S);
|
|
7403
7403
|
return r(q), q;
|
|
7404
7404
|
} catch (S) {
|
|
@@ -7425,8 +7425,8 @@ function Vr(e) {
|
|
|
7425
7425
|
// 7 days
|
|
7426
7426
|
};
|
|
7427
7427
|
console.log("Restarting identity with input:", N);
|
|
7428
|
-
const
|
|
7429
|
-
return console.log("Restart identity result:",
|
|
7428
|
+
const z = await t.identityRequest(N);
|
|
7429
|
+
return console.log("Restart identity result:", z), r(z), z;
|
|
7430
7430
|
} catch (N) {
|
|
7431
7431
|
throw d(N), N;
|
|
7432
7432
|
} finally {
|
|
@@ -7446,7 +7446,7 @@ function Vr(e) {
|
|
|
7446
7446
|
};
|
|
7447
7447
|
}
|
|
7448
7448
|
function Br(e) {
|
|
7449
|
-
const { riskScoringService: t, applicantService: a } = We(), [r, n] = w(null), [s, l] = w({}), [d, u] = w(!1), [m, f] = w(!1), [g, N] = w(null), [
|
|
7449
|
+
const { riskScoringService: t, applicantService: a } = We(), [r, n] = w(null), [s, l] = w({}), [d, u] = w(!1), [m, f] = w(!1), [g, N] = w(null), [z, S] = w(null), q = ye(!1), T = ye(null), $ = ae(async () => {
|
|
7450
7450
|
var F;
|
|
7451
7451
|
if (e) {
|
|
7452
7452
|
if (q.current) {
|
|
@@ -7455,11 +7455,11 @@ function Br(e) {
|
|
|
7455
7455
|
}
|
|
7456
7456
|
q.current = !0, u(!0), N(null);
|
|
7457
7457
|
try {
|
|
7458
|
-
const [
|
|
7458
|
+
const [L, H] = await Promise.all([
|
|
7459
7459
|
t.getRiskCriterias(e),
|
|
7460
7460
|
a.getApplicantData(e).catch(() => null)
|
|
7461
7461
|
]);
|
|
7462
|
-
if (n(
|
|
7462
|
+
if (n(L), (F = H == null ? void 0 : H.riskScoringResults) != null && F.length) {
|
|
7463
7463
|
const J = H.riskScoringResults[0], ie = {};
|
|
7464
7464
|
for (const x of J.riskCriteriaResults ?? [])
|
|
7465
7465
|
if (x.riskCriteriaId != null && x.answer != null && x.answer !== "") {
|
|
@@ -7471,8 +7471,8 @@ function Br(e) {
|
|
|
7471
7471
|
l(ie);
|
|
7472
7472
|
}
|
|
7473
7473
|
T.current = e;
|
|
7474
|
-
} catch (
|
|
7475
|
-
N(
|
|
7474
|
+
} catch (L) {
|
|
7475
|
+
N(L);
|
|
7476
7476
|
} finally {
|
|
7477
7477
|
u(!1), q.current = !1;
|
|
7478
7478
|
}
|
|
@@ -7485,10 +7485,10 @@ function Br(e) {
|
|
|
7485
7485
|
async (F) => {
|
|
7486
7486
|
f(!0), N(null);
|
|
7487
7487
|
try {
|
|
7488
|
-
const
|
|
7489
|
-
return S(
|
|
7490
|
-
} catch (
|
|
7491
|
-
throw N(
|
|
7488
|
+
const L = await t.submitRiskScoring(F);
|
|
7489
|
+
return S(L), L;
|
|
7490
|
+
} catch (L) {
|
|
7491
|
+
throw N(L), L;
|
|
7492
7492
|
} finally {
|
|
7493
7493
|
f(!1);
|
|
7494
7494
|
}
|
|
@@ -7498,7 +7498,7 @@ function Br(e) {
|
|
|
7498
7498
|
return {
|
|
7499
7499
|
criteria: r,
|
|
7500
7500
|
initialAnswers: s,
|
|
7501
|
-
result:
|
|
7501
|
+
result: z,
|
|
7502
7502
|
isLoading: d,
|
|
7503
7503
|
isSubmitting: m,
|
|
7504
7504
|
error: g,
|
|
@@ -7507,24 +7507,24 @@ function Br(e) {
|
|
|
7507
7507
|
};
|
|
7508
7508
|
}
|
|
7509
7509
|
function di() {
|
|
7510
|
-
const { applicantService: e, config: t } = We(), [a, r] = w(!1), [n, s] = w(null), l = ye(!1), d = ye(!1), u = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(
|
|
7510
|
+
const { applicantService: e, config: t } = We(), [a, r] = w(!1), [n, s] = w(null), l = ye(!1), d = ye(!1), u = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(z) {
|
|
7511
7511
|
const S = Math.random() * 16 | 0;
|
|
7512
|
-
return (
|
|
7512
|
+
return (z === "x" ? S : S & 3 | 8).toString(16);
|
|
7513
7513
|
}), m = ae(
|
|
7514
|
-
async (
|
|
7514
|
+
async (z) => {
|
|
7515
7515
|
var S;
|
|
7516
7516
|
if (l.current)
|
|
7517
7517
|
throw console.log("[Applicant] Create already in progress, skipping..."), new Error("Creation already in progress");
|
|
7518
7518
|
l.current = !0, r(!0), s(null);
|
|
7519
7519
|
try {
|
|
7520
|
-
if (
|
|
7520
|
+
if (z.applicantAdditionalDatas || (z.applicantAdditionalDatas = []), (S = t.identityProviders) != null && S.sardinai) {
|
|
7521
7521
|
const T = u();
|
|
7522
|
-
console.log("[SardinAI] Generated session key:", T),
|
|
7522
|
+
console.log("[SardinAI] Generated session key:", T), z.applicantAdditionalDatas.push({
|
|
7523
7523
|
paramName: "sessionKey",
|
|
7524
7524
|
value: T
|
|
7525
7525
|
});
|
|
7526
7526
|
}
|
|
7527
|
-
return await e.createApplicant(
|
|
7527
|
+
return await e.createApplicant(z);
|
|
7528
7528
|
} catch (q) {
|
|
7529
7529
|
throw s(q), q;
|
|
7530
7530
|
} finally {
|
|
@@ -7533,10 +7533,10 @@ function di() {
|
|
|
7533
7533
|
},
|
|
7534
7534
|
[e, t]
|
|
7535
7535
|
), f = ae(
|
|
7536
|
-
async (
|
|
7536
|
+
async (z) => {
|
|
7537
7537
|
r(!0), s(null);
|
|
7538
7538
|
try {
|
|
7539
|
-
return await e.createCompanyApplicant(
|
|
7539
|
+
return await e.createCompanyApplicant(z);
|
|
7540
7540
|
} catch (S) {
|
|
7541
7541
|
throw s(S), S;
|
|
7542
7542
|
} finally {
|
|
@@ -7545,12 +7545,10 @@ function di() {
|
|
|
7545
7545
|
},
|
|
7546
7546
|
[e]
|
|
7547
7547
|
), g = ae(
|
|
7548
|
-
async (
|
|
7549
|
-
if (d.current)
|
|
7550
|
-
throw console.log("[Applicant] Data load already in progress, skipping..."), new Error("Data load already in progress");
|
|
7548
|
+
async (z) => {
|
|
7551
7549
|
d.current = !0, r(!0), s(null);
|
|
7552
7550
|
try {
|
|
7553
|
-
return await e.getApplicantData(
|
|
7551
|
+
return await e.getApplicantData(z);
|
|
7554
7552
|
} catch (S) {
|
|
7555
7553
|
throw s(S), S;
|
|
7556
7554
|
} finally {
|
|
@@ -7559,10 +7557,10 @@ function di() {
|
|
|
7559
7557
|
},
|
|
7560
7558
|
[e]
|
|
7561
7559
|
), N = ae(
|
|
7562
|
-
async (
|
|
7560
|
+
async (z) => {
|
|
7563
7561
|
r(!0), s(null);
|
|
7564
7562
|
try {
|
|
7565
|
-
await e.stopProgress(
|
|
7563
|
+
await e.stopProgress(z);
|
|
7566
7564
|
} catch (S) {
|
|
7567
7565
|
throw s(S), S;
|
|
7568
7566
|
} finally {
|
|
@@ -7991,7 +7989,7 @@ const _t = 280, Kr = ({
|
|
|
7991
7989
|
readOnly: l = !1,
|
|
7992
7990
|
required: d = !1
|
|
7993
7991
|
}) => {
|
|
7994
|
-
const { t: u } = Le(), m = n ?? u("common.select"), f = s || l, [g, N] = w(!1), [
|
|
7992
|
+
const { t: u } = Le(), m = n ?? u("common.select"), f = s || l, [g, N] = w(!1), [z, S] = w(""), [q, T] = w(null), [$, K] = w({
|
|
7995
7993
|
bg: "#ffffff",
|
|
7996
7994
|
borderColor: "#d1d5db",
|
|
7997
7995
|
textPrimary: "#111827",
|
|
@@ -7999,20 +7997,20 @@ const _t = 280, Kr = ({
|
|
|
7999
7997
|
primaryColor: "#2563eb",
|
|
8000
7998
|
primaryLight: "#eff6ff",
|
|
8001
7999
|
hoverBg: "#f9fafb"
|
|
8002
|
-
}), F = ye(null),
|
|
8003
|
-
if (!
|
|
8004
|
-
const M =
|
|
8000
|
+
}), F = ye(null), L = ye(null), H = ye(null), J = ae(() => {
|
|
8001
|
+
if (!L.current) return null;
|
|
8002
|
+
const M = L.current.getBoundingClientRect(), O = window.innerHeight - M.bottom < _t && M.top > _t;
|
|
8005
8003
|
return { top: O ? M.top : M.bottom + 4, left: M.left, width: M.width, openUp: O };
|
|
8006
8004
|
}, []), ie = ae(() => {
|
|
8007
|
-
const M = getComputedStyle(document.querySelector(".metakyc-sdk") || document.documentElement),
|
|
8005
|
+
const M = getComputedStyle(document.querySelector(".metakyc-sdk") || document.documentElement), E = (fe, ue) => M.getPropertyValue(fe).trim() || ue, O = E("--metakyc-input-bg", E("--metakyc-background", "#ffffff"));
|
|
8008
8006
|
K({
|
|
8009
8007
|
bg: O,
|
|
8010
|
-
borderColor:
|
|
8011
|
-
textPrimary:
|
|
8012
|
-
textSecondary:
|
|
8013
|
-
primaryColor:
|
|
8014
|
-
primaryLight:
|
|
8015
|
-
hoverBg:
|
|
8008
|
+
borderColor: E("--metakyc-input-border", E("--metakyc-border", "#d1d5db")),
|
|
8009
|
+
textPrimary: E("--metakyc-input-text", E("--metakyc-text-primary", "#111827")),
|
|
8010
|
+
textSecondary: E("--metakyc-text-secondary", "#6b7280"),
|
|
8011
|
+
primaryColor: E("--metakyc-primary", "#2563eb"),
|
|
8012
|
+
primaryLight: E("--metakyc-primary-light", "#eff6ff"),
|
|
8013
|
+
hoverBg: E("--metakyc-surface", O)
|
|
8016
8014
|
});
|
|
8017
8015
|
}, []), x = ae(() => {
|
|
8018
8016
|
if (f) return;
|
|
@@ -8024,31 +8022,31 @@ const _t = 280, Kr = ({
|
|
|
8024
8022
|
}, []);
|
|
8025
8023
|
ve(() => {
|
|
8026
8024
|
if (!g) return;
|
|
8027
|
-
const M = (
|
|
8025
|
+
const M = (E) => {
|
|
8028
8026
|
var fe, ue;
|
|
8029
|
-
const O =
|
|
8027
|
+
const O = E.target;
|
|
8030
8028
|
!((fe = F.current) != null && fe.contains(O)) && !((ue = H.current) != null && ue.contains(O)) && I();
|
|
8031
8029
|
};
|
|
8032
8030
|
return document.addEventListener("mousedown", M), () => document.removeEventListener("mousedown", M);
|
|
8033
8031
|
}, [g, I]), ve(() => {
|
|
8034
8032
|
if (!g) return;
|
|
8035
8033
|
const M = () => {
|
|
8036
|
-
const
|
|
8037
|
-
|
|
8034
|
+
const E = J();
|
|
8035
|
+
E && T(E);
|
|
8038
8036
|
};
|
|
8039
8037
|
return window.addEventListener("scroll", M, !0), window.addEventListener("resize", M), () => {
|
|
8040
8038
|
window.removeEventListener("scroll", M, !0), window.removeEventListener("resize", M);
|
|
8041
8039
|
};
|
|
8042
8040
|
}, [g, J]);
|
|
8043
8041
|
const V = r.filter(
|
|
8044
|
-
(M) => M.label.toLowerCase().includes(
|
|
8042
|
+
(M) => M.label.toLowerCase().includes(z.toLowerCase())
|
|
8045
8043
|
), ee = (M) => {
|
|
8046
|
-
f || a(t.includes(M) ? t.filter((
|
|
8047
|
-
}, X = (M,
|
|
8048
|
-
|
|
8044
|
+
f || a(t.includes(M) ? t.filter((E) => E !== M) : [...t, M]);
|
|
8045
|
+
}, X = (M, E) => {
|
|
8046
|
+
E.stopPropagation(), f || a(t.filter((O) => O !== M));
|
|
8049
8047
|
}, U = (M) => {
|
|
8050
|
-
var
|
|
8051
|
-
return ((
|
|
8048
|
+
var E;
|
|
8049
|
+
return ((E = r.find((O) => O.value === M)) == null ? void 0 : E.label) || M;
|
|
8052
8050
|
}, { bg: te, borderColor: de, textPrimary: le, textSecondary: Me, primaryColor: re, primaryLight: Ce, hoverBg: Se } = $, ge = g && q && /* @__PURE__ */ o(
|
|
8053
8051
|
"div",
|
|
8054
8052
|
{
|
|
@@ -8072,7 +8070,7 @@ const _t = 280, Kr = ({
|
|
|
8072
8070
|
"input",
|
|
8073
8071
|
{
|
|
8074
8072
|
type: "text",
|
|
8075
|
-
value:
|
|
8073
|
+
value: z,
|
|
8076
8074
|
onChange: (M) => S(M.target.value),
|
|
8077
8075
|
placeholder: u("common.search"),
|
|
8078
8076
|
autoFocus: !0,
|
|
@@ -8091,7 +8089,7 @@ const _t = 280, Kr = ({
|
|
|
8091
8089
|
boxSizing: "border-box"
|
|
8092
8090
|
},
|
|
8093
8091
|
onFocus: (M) => {
|
|
8094
|
-
const
|
|
8092
|
+
const E = getComputedStyle(document.querySelector(".metakyc-sdk") || document.documentElement), O = E.getPropertyValue("--metakyc-input-border-focus").trim() || E.getPropertyValue("--metakyc-primary").trim() || "#2563eb";
|
|
8095
8093
|
M.currentTarget.style.backgroundColor = te, M.currentTarget.style.color = le, M.currentTarget.style.borderColor = O, M.currentTarget.style.outline = "none", M.currentTarget.style.boxShadow = `0 0 0 2px ${O}33`;
|
|
8096
8094
|
},
|
|
8097
8095
|
onBlur: (M) => {
|
|
@@ -8100,7 +8098,7 @@ const _t = 280, Kr = ({
|
|
|
8100
8098
|
}
|
|
8101
8099
|
) }),
|
|
8102
8100
|
/* @__PURE__ */ i("ul", { style: { listStyle: "none", margin: 0, padding: "4px 0", maxHeight: "192px", overflowY: "auto" }, children: V.length === 0 ? /* @__PURE__ */ i("li", { style: { padding: "8px 12px", fontSize: "13px", color: Me }, children: u("common.noResults") }) : V.map((M) => {
|
|
8103
|
-
const
|
|
8101
|
+
const E = t.includes(M.value);
|
|
8104
8102
|
return /* @__PURE__ */ o(
|
|
8105
8103
|
"li",
|
|
8106
8104
|
{
|
|
@@ -8113,21 +8111,21 @@ const _t = 280, Kr = ({
|
|
|
8113
8111
|
padding: "8px 12px",
|
|
8114
8112
|
fontSize: "13px",
|
|
8115
8113
|
cursor: "pointer",
|
|
8116
|
-
backgroundColor:
|
|
8117
|
-
color:
|
|
8114
|
+
backgroundColor: E ? Ce : "transparent",
|
|
8115
|
+
color: E ? re : le,
|
|
8118
8116
|
userSelect: "none"
|
|
8119
8117
|
},
|
|
8120
8118
|
onMouseEnter: (O) => {
|
|
8121
|
-
|
|
8119
|
+
E || (O.currentTarget.style.backgroundColor = Se);
|
|
8122
8120
|
},
|
|
8123
8121
|
onMouseLeave: (O) => {
|
|
8124
|
-
|
|
8122
|
+
E || (O.currentTarget.style.backgroundColor = "transparent");
|
|
8125
8123
|
},
|
|
8126
8124
|
children: [
|
|
8127
8125
|
/* @__PURE__ */ i(
|
|
8128
8126
|
Ge,
|
|
8129
8127
|
{
|
|
8130
|
-
checked:
|
|
8128
|
+
checked: E,
|
|
8131
8129
|
onChange: () => {
|
|
8132
8130
|
}
|
|
8133
8131
|
}
|
|
@@ -8172,7 +8170,7 @@ const _t = 280, Kr = ({
|
|
|
8172
8170
|
/* @__PURE__ */ o(
|
|
8173
8171
|
"div",
|
|
8174
8172
|
{
|
|
8175
|
-
ref:
|
|
8173
|
+
ref: L,
|
|
8176
8174
|
onClick: () => g ? I() : x(),
|
|
8177
8175
|
className: qe(
|
|
8178
8176
|
"metakyc-multiselect-trigger",
|
|
@@ -8208,7 +8206,7 @@ const _t = 280, Kr = ({
|
|
|
8208
8206
|
"button",
|
|
8209
8207
|
{
|
|
8210
8208
|
type: "button",
|
|
8211
|
-
onClick: (
|
|
8209
|
+
onClick: (E) => X(M, E),
|
|
8212
8210
|
className: "metakyc-multiselect-chip-remove",
|
|
8213
8211
|
style: {
|
|
8214
8212
|
background: "transparent",
|
|
@@ -8263,7 +8261,7 @@ const _t = 280, Kr = ({
|
|
|
8263
8261
|
className: f
|
|
8264
8262
|
}) => {
|
|
8265
8263
|
var ue;
|
|
8266
|
-
const { t: g } = Le(), N = n ?? g("common.select"),
|
|
8264
|
+
const { t: g } = Le(), N = n ?? g("common.select"), z = d || u, [S, q] = w(!1), [T, $] = w(""), [K, F] = w(null), [L, H] = w({
|
|
8267
8265
|
bg: "#ffffff",
|
|
8268
8266
|
border: "#d1d5db",
|
|
8269
8267
|
text: "#111827",
|
|
@@ -8292,11 +8290,11 @@ const _t = 280, Kr = ({
|
|
|
8292
8290
|
openUp: he
|
|
8293
8291
|
};
|
|
8294
8292
|
}, []), X = ae(() => {
|
|
8295
|
-
if (
|
|
8293
|
+
if (z) return;
|
|
8296
8294
|
J();
|
|
8297
8295
|
const j = ee();
|
|
8298
8296
|
j && F(j), q(!0);
|
|
8299
|
-
}, [
|
|
8297
|
+
}, [z, ee, J]), U = ae(() => {
|
|
8300
8298
|
q(!1), $("");
|
|
8301
8299
|
}, []), te = () => S ? U() : X();
|
|
8302
8300
|
ve(() => {
|
|
@@ -8325,8 +8323,8 @@ const _t = 280, Kr = ({
|
|
|
8325
8323
|
const de = r.filter(
|
|
8326
8324
|
(j) => j.label.toLowerCase().includes(T.toLowerCase()) || j.value.toLowerCase().includes(T.toLowerCase())
|
|
8327
8325
|
), le = (ue = r.find((j) => j.value === s)) == null ? void 0 : ue.label, Me = (j, _) => {
|
|
8328
|
-
|
|
8329
|
-
}, { bg: re, border: Ce, text: Se, textSecondary: ge, primary: M, primaryLight:
|
|
8326
|
+
z || _ || (l(j), U());
|
|
8327
|
+
}, { bg: re, border: Ce, text: Se, textSecondary: ge, primary: M, primaryLight: E, hoverBg: O } = L, fe = S && K && /* @__PURE__ */ o(
|
|
8330
8328
|
"div",
|
|
8331
8329
|
{
|
|
8332
8330
|
ref: I,
|
|
@@ -8398,7 +8396,7 @@ const _t = 280, Kr = ({
|
|
|
8398
8396
|
fontSize: "13px",
|
|
8399
8397
|
cursor: j.disabled ? "not-allowed" : "pointer",
|
|
8400
8398
|
opacity: j.disabled ? 0.4 : 1,
|
|
8401
|
-
backgroundColor: _ ?
|
|
8399
|
+
backgroundColor: _ ? E : "transparent",
|
|
8402
8400
|
color: _ ? M : Se,
|
|
8403
8401
|
userSelect: "none"
|
|
8404
8402
|
},
|
|
@@ -8440,7 +8438,7 @@ const _t = 280, Kr = ({
|
|
|
8440
8438
|
{
|
|
8441
8439
|
ref: x,
|
|
8442
8440
|
role: "button",
|
|
8443
|
-
tabIndex:
|
|
8441
|
+
tabIndex: z ? -1 : 0,
|
|
8444
8442
|
onClick: te,
|
|
8445
8443
|
onKeyDown: (j) => {
|
|
8446
8444
|
(j.key === "Enter" || j.key === " ") && (j.preventDefault(), te()), j.key === "Escape" && U();
|
|
@@ -8450,7 +8448,7 @@ const _t = 280, Kr = ({
|
|
|
8450
8448
|
"w-full px-3 py-2 rounded-lg border text-sm transition-colors text-left",
|
|
8451
8449
|
"flex items-center justify-between gap-2",
|
|
8452
8450
|
"focus:outline-none",
|
|
8453
|
-
|
|
8451
|
+
z ? "opacity-60 cursor-not-allowed" : "cursor-pointer"
|
|
8454
8452
|
),
|
|
8455
8453
|
style: {
|
|
8456
8454
|
backgroundColor: "var(--metakyc-input-bg, #ffffff)",
|
|
@@ -8497,7 +8495,7 @@ const Hr = ({
|
|
|
8497
8495
|
value: u = [],
|
|
8498
8496
|
className: m
|
|
8499
8497
|
}) => {
|
|
8500
|
-
const { t: f } = Le(), [g, N] = w(!1), [
|
|
8498
|
+
const { t: f } = Le(), [g, N] = w(!1), [z, S] = w(null), q = ye(null), T = ae((x) => {
|
|
8501
8499
|
if (!x) return;
|
|
8502
8500
|
S(null);
|
|
8503
8501
|
const I = Array.from(x);
|
|
@@ -8512,14 +8510,14 @@ const Hr = ({
|
|
|
8512
8510
|
x.preventDefault(), x.stopPropagation(), N(!1);
|
|
8513
8511
|
}, []), F = ae((x) => {
|
|
8514
8512
|
x.preventDefault(), x.stopPropagation(), N(!1), T(x.dataTransfer.files);
|
|
8515
|
-
}, [T]),
|
|
8513
|
+
}, [T]), L = () => {
|
|
8516
8514
|
var x;
|
|
8517
8515
|
(x = q.current) == null || x.click();
|
|
8518
8516
|
}, H = (x) => {
|
|
8519
8517
|
S(null);
|
|
8520
8518
|
const I = u.filter((V, ee) => ee !== x);
|
|
8521
8519
|
d == null || d(I);
|
|
8522
|
-
}, J = a ||
|
|
8520
|
+
}, J = a || z, ie = u.length > 0;
|
|
8523
8521
|
return /* @__PURE__ */ o("div", { className: qe("metakyc-file-upload", m), style: { width: "100%" }, children: [
|
|
8524
8522
|
e && /* @__PURE__ */ o("div", { style: { marginBottom: "8px" }, children: [
|
|
8525
8523
|
/* @__PURE__ */ o(
|
|
@@ -8543,7 +8541,7 @@ const Hr = ({
|
|
|
8543
8541
|
"div",
|
|
8544
8542
|
{
|
|
8545
8543
|
className: "metakyc-file-dropzone",
|
|
8546
|
-
onClick:
|
|
8544
|
+
onClick: L,
|
|
8547
8545
|
onDragOver: $,
|
|
8548
8546
|
onDragLeave: K,
|
|
8549
8547
|
onDrop: F,
|
|
@@ -8949,7 +8947,7 @@ const ra = ({
|
|
|
8949
8947
|
onComplete: t,
|
|
8950
8948
|
onBack: a
|
|
8951
8949
|
}) => {
|
|
8952
|
-
const { t: r } = Le(), { questionnaire: n, initialAnswers: s, isLoading: l, isSubmitting: d, error: u, submit: m } = jr(e), [f, g] = w({}), [N,
|
|
8950
|
+
const { t: r } = Le(), { questionnaire: n, initialAnswers: s, isLoading: l, isSubmitting: d, error: u, submit: m } = jr(e), [f, g] = w({}), [N, z] = w({}), [S, q] = w(0);
|
|
8953
8951
|
Ie.useEffect(() => {
|
|
8954
8952
|
s && Object.keys(s).length > 0 && Object.keys(f).length === 0 && g(s);
|
|
8955
8953
|
}, [s]);
|
|
@@ -8957,23 +8955,23 @@ const ra = ({
|
|
|
8957
8955
|
() => n ? ia(n.questionGroups) : [],
|
|
8958
8956
|
[n]
|
|
8959
8957
|
), $ = S === T.length - 1, K = T[S] ?? [], F = ae((x, I) => {
|
|
8960
|
-
g((V) => ({ ...V, [x]: I })),
|
|
8958
|
+
g((V) => ({ ...V, [x]: I })), z((V) => {
|
|
8961
8959
|
const ee = { ...V };
|
|
8962
8960
|
return delete ee[x], ee;
|
|
8963
8961
|
});
|
|
8964
|
-
}, []),
|
|
8962
|
+
}, []), L = ae(() => {
|
|
8965
8963
|
const x = {};
|
|
8966
8964
|
for (const { question: I } of K) {
|
|
8967
8965
|
const V = ta(I, f[I.id] ?? []);
|
|
8968
8966
|
V && (x[I.id] = V);
|
|
8969
8967
|
}
|
|
8970
|
-
return
|
|
8968
|
+
return z((I) => ({ ...I, ...x })), Object.keys(x).length === 0;
|
|
8971
8969
|
}, [K, f]), H = () => {
|
|
8972
|
-
|
|
8970
|
+
L() && q((x) => x + 1);
|
|
8973
8971
|
}, J = () => {
|
|
8974
8972
|
S > 0 ? q((x) => x - 1) : a == null || a();
|
|
8975
8973
|
}, ie = async () => {
|
|
8976
|
-
if (!(!
|
|
8974
|
+
if (!(!L() || !n))
|
|
8977
8975
|
try {
|
|
8978
8976
|
const x = n.questionGroups.flatMap(
|
|
8979
8977
|
(V) => (V.questions ?? []).map((ee) => ({
|
|
@@ -9170,10 +9168,10 @@ const oa = ({
|
|
|
9170
9168
|
onComplete: t,
|
|
9171
9169
|
onBack: a
|
|
9172
9170
|
}) => {
|
|
9173
|
-
const { t: r } = Le(), { uploadDocument: n, isLoading: s, isSubmitting: l, error: d, submit: u } = Fr(e), [m, f] = w({}), [g, N] = w(null), [
|
|
9171
|
+
const { t: r } = Le(), { uploadDocument: n, isLoading: s, isSubmitting: l, error: d, submit: u } = Fr(e), [m, f] = w({}), [g, N] = w(null), [z, S] = w(0), [q, T] = w({}), $ = Ue(
|
|
9174
9172
|
() => n ? na(n.uploadDocumentFiles) : [],
|
|
9175
9173
|
[n]
|
|
9176
|
-
), K = $[
|
|
9174
|
+
), K = $[z] ?? [], F = z === $.length - 1, L = $.length, H = ae(() => {
|
|
9177
9175
|
const I = {};
|
|
9178
9176
|
for (const V of K)
|
|
9179
9177
|
V.isRequired && (m[V.id] || []).length === 0 && (I[V.id] = `${V.displayName} is required`);
|
|
@@ -9181,7 +9179,7 @@ const oa = ({
|
|
|
9181
9179
|
}, [K, m]), J = () => {
|
|
9182
9180
|
H() && (S((I) => I + 1), T({}));
|
|
9183
9181
|
}, ie = () => {
|
|
9184
|
-
|
|
9182
|
+
z > 0 ? (S((I) => I - 1), T({})) : a == null || a();
|
|
9185
9183
|
}, x = async () => {
|
|
9186
9184
|
if (!(!H() || !n)) {
|
|
9187
9185
|
N(null);
|
|
@@ -9249,29 +9247,29 @@ const oa = ({
|
|
|
9249
9247
|
color: "var(--metakyc-text-secondary, #6b7280)",
|
|
9250
9248
|
marginTop: "4px"
|
|
9251
9249
|
}, children: n.subtitle }),
|
|
9252
|
-
|
|
9250
|
+
L > 1 && /* @__PURE__ */ o("div", { style: {
|
|
9253
9251
|
display: "flex",
|
|
9254
9252
|
alignItems: "center",
|
|
9255
9253
|
justifyContent: "space-between",
|
|
9256
9254
|
marginTop: "12px"
|
|
9257
9255
|
}, children: [
|
|
9258
|
-
/* @__PURE__ */ i("span", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)" }, children: r("common.pageXofY", { current:
|
|
9256
|
+
/* @__PURE__ */ i("span", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)" }, children: r("common.pageXofY", { current: z + 1, total: L }) }),
|
|
9259
9257
|
/* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: $.map((I, V) => /* @__PURE__ */ i(
|
|
9260
9258
|
"div",
|
|
9261
9259
|
{
|
|
9262
9260
|
style: {
|
|
9263
9261
|
height: "6px",
|
|
9264
|
-
width: V ===
|
|
9262
|
+
width: V === z ? "20px" : "6px",
|
|
9265
9263
|
borderRadius: "999px",
|
|
9266
9264
|
transition: "all 0.2s ease",
|
|
9267
|
-
backgroundColor: V <=
|
|
9265
|
+
backgroundColor: V <= z ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
|
|
9268
9266
|
}
|
|
9269
9267
|
},
|
|
9270
9268
|
V
|
|
9271
9269
|
)) })
|
|
9272
9270
|
] })
|
|
9273
9271
|
] }),
|
|
9274
|
-
n.description &&
|
|
9272
|
+
n.description && z === 0 && /* @__PURE__ */ o("div", { style: {
|
|
9275
9273
|
margin: "0 24px",
|
|
9276
9274
|
marginTop: "4px",
|
|
9277
9275
|
display: "flex",
|
|
@@ -9356,7 +9354,7 @@ const oa = ({
|
|
|
9356
9354
|
type: "button",
|
|
9357
9355
|
variant: "outline",
|
|
9358
9356
|
onClick: ie,
|
|
9359
|
-
children:
|
|
9357
|
+
children: z > 0 ? r("common.previous") : r("common.back")
|
|
9360
9358
|
}
|
|
9361
9359
|
),
|
|
9362
9360
|
F ? /* @__PURE__ */ i(
|
|
@@ -9488,19 +9486,19 @@ const ga = ({
|
|
|
9488
9486
|
onComplete: t,
|
|
9489
9487
|
onBack: a
|
|
9490
9488
|
}) => {
|
|
9491
|
-
const { t: r } = Le(), { config: n } = We(), s = n.locale ?? "en", { criteria: l, initialAnswers: d, isLoading: u, isSubmitting: m, error: f, submit: g } = Br(e), [N,
|
|
9489
|
+
const { t: r } = Le(), { config: n } = We(), s = n.locale ?? "en", { criteria: l, initialAnswers: d, isLoading: u, isSubmitting: m, error: f, submit: g } = Br(e), [N, z] = w({}), [S, q] = w({}), [T, $] = w(0), [K, F] = w(!1);
|
|
9492
9490
|
Ie.useEffect(() => {
|
|
9493
|
-
d && Object.keys(d).length > 0 && Object.keys(N).length === 0 &&
|
|
9491
|
+
d && Object.keys(d).length > 0 && Object.keys(N).length === 0 && z(d);
|
|
9494
9492
|
}, [d]);
|
|
9495
|
-
const
|
|
9493
|
+
const L = Ue(
|
|
9496
9494
|
() => l && l.length > 0 ? ua(l) : [],
|
|
9497
9495
|
[l]
|
|
9498
|
-
), H = T ===
|
|
9496
|
+
), H = T === L.length - 1, J = L[T] ?? [];
|
|
9499
9497
|
Ie.useEffect(() => {
|
|
9500
9498
|
!u && l && l.length === 0 && !K && !m && (F(!0), g({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
|
|
9501
9499
|
}, [u, l, K, m, g, e, t]);
|
|
9502
9500
|
const ie = ae((X, U) => {
|
|
9503
|
-
|
|
9501
|
+
z((te) => ({ ...te, [X]: U })), q((te) => {
|
|
9504
9502
|
const de = { ...te };
|
|
9505
9503
|
return delete de[X], de;
|
|
9506
9504
|
});
|
|
@@ -9541,9 +9539,9 @@ const ga = ({
|
|
|
9541
9539
|
/* @__PURE__ */ o(ze, { children: [
|
|
9542
9540
|
/* @__PURE__ */ i("h2", { className: "text-lg font-bold", children: r("riskScoring.title") }),
|
|
9543
9541
|
/* @__PURE__ */ i("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: r("riskScoring.subtitle") }),
|
|
9544
|
-
|
|
9545
|
-
/* @__PURE__ */ i("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: r("common.pageXofY", { current: T + 1, total:
|
|
9546
|
-
/* @__PURE__ */ i("div", { className: "flex items-center gap-1.5", children:
|
|
9542
|
+
L.length > 1 && /* @__PURE__ */ o("div", { className: "flex items-center justify-between mt-3", children: [
|
|
9543
|
+
/* @__PURE__ */ i("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: r("common.pageXofY", { current: T + 1, total: L.length }) }),
|
|
9544
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-1.5", children: L.map((X, U) => /* @__PURE__ */ i(
|
|
9547
9545
|
"div",
|
|
9548
9546
|
{
|
|
9549
9547
|
className: "rounded-full transition-all duration-200",
|
|
@@ -9666,7 +9664,7 @@ const ga = ({
|
|
|
9666
9664
|
l === "checkbox" && /* @__PURE__ */ o("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
|
|
9667
9665
|
(e.defaultValues ?? []).map((f) => {
|
|
9668
9666
|
const g = t.includes(f), N = () => {
|
|
9669
|
-
n(g ? t.filter((
|
|
9667
|
+
n(g ? t.filter((z) => z !== f) : [...t, f]);
|
|
9670
9668
|
};
|
|
9671
9669
|
return /* @__PURE__ */ o(
|
|
9672
9670
|
"div",
|
|
@@ -9715,15 +9713,15 @@ const ga = ({
|
|
|
9715
9713
|
}
|
|
9716
9714
|
u(!0), f(null);
|
|
9717
9715
|
try {
|
|
9718
|
-
const
|
|
9716
|
+
const z = {
|
|
9719
9717
|
applicantId: e,
|
|
9720
9718
|
investorType: s
|
|
9721
9719
|
};
|
|
9722
|
-
console.log("Submitting investor categorization:",
|
|
9723
|
-
const S = await n.setInvestorCategorization(
|
|
9720
|
+
console.log("Submitting investor categorization:", z);
|
|
9721
|
+
const S = await n.setInvestorCategorization(z);
|
|
9724
9722
|
console.log("Investor categorization result:", S), t == null || t();
|
|
9725
|
-
} catch (
|
|
9726
|
-
console.error("Error submitting investor categorization:",
|
|
9723
|
+
} catch (z) {
|
|
9724
|
+
console.error("Error submitting investor categorization:", z), f(z.message || r("investorCategorization.failedToSubmit"));
|
|
9727
9725
|
} finally {
|
|
9728
9726
|
u(!1);
|
|
9729
9727
|
}
|
|
@@ -9848,54 +9846,54 @@ const ka = ({
|
|
|
9848
9846
|
onComplete: t,
|
|
9849
9847
|
onBack: a
|
|
9850
9848
|
}) => {
|
|
9851
|
-
const { t: r } = Le(), { appropriatenessTestService: n } = We(), [s, l] = w(null), [d, u] = w(!0), [m, f] = w(!1), [g, N] = w(null), [
|
|
9849
|
+
const { t: r } = Le(), { appropriatenessTestService: n } = We(), [s, l] = w(null), [d, u] = w(!0), [m, f] = w(!1), [g, N] = w(null), [z, S] = w({}), [q, T] = w(0), [$, K] = w(!1), [F, L] = w(!1), [H, J] = w(0), [ie, x] = w(0), [I, V] = w(null);
|
|
9852
9850
|
ve(() => {
|
|
9853
9851
|
(async () => {
|
|
9854
9852
|
try {
|
|
9855
9853
|
u(!0), N(null);
|
|
9856
|
-
const
|
|
9857
|
-
if (l(
|
|
9858
|
-
const O = Xt(
|
|
9854
|
+
const E = await n.getAppropriatenessTest(e);
|
|
9855
|
+
if (l(E), E.waitTimeSpanForNextTry && E.waitTimeSpanForNextTry !== "00:00:00") {
|
|
9856
|
+
const O = Xt(E.waitTimeSpanForNextTry);
|
|
9859
9857
|
O > 0 && J(O);
|
|
9860
9858
|
}
|
|
9861
|
-
} catch (
|
|
9862
|
-
N(
|
|
9859
|
+
} catch (E) {
|
|
9860
|
+
N(E.message || r("appropriatenessTest.failedToLoad"));
|
|
9863
9861
|
} finally {
|
|
9864
9862
|
u(!1);
|
|
9865
9863
|
}
|
|
9866
9864
|
})();
|
|
9867
9865
|
}, [e, n]), ve(() => {
|
|
9868
9866
|
if (!$ || q <= 0) return;
|
|
9869
|
-
const
|
|
9870
|
-
T((O) => O <= 1 ? (
|
|
9867
|
+
const E = setInterval(() => {
|
|
9868
|
+
T((O) => O <= 1 ? (L(!0), 0) : O - 1);
|
|
9871
9869
|
}, 1e3);
|
|
9872
|
-
return () => clearInterval(
|
|
9870
|
+
return () => clearInterval(E);
|
|
9873
9871
|
}, [$, q]), ve(() => {
|
|
9874
9872
|
if (H <= 0) return;
|
|
9875
|
-
const
|
|
9873
|
+
const E = setInterval(() => {
|
|
9876
9874
|
J((O) => O <= 1 ? 0 : O - 1);
|
|
9877
9875
|
}, 1e3);
|
|
9878
|
-
return () => clearInterval(
|
|
9876
|
+
return () => clearInterval(E);
|
|
9879
9877
|
}, [H]), ve(() => {
|
|
9880
9878
|
F && !m && te();
|
|
9881
9879
|
}, [F]);
|
|
9882
9880
|
const ee = () => {
|
|
9883
9881
|
s && (K(!0), T(s.testDurationSec), x(0), S({}), N(null));
|
|
9884
|
-
}, X = (
|
|
9885
|
-
S((fe) => ({ ...fe, [
|
|
9882
|
+
}, X = (E, O) => {
|
|
9883
|
+
S((fe) => ({ ...fe, [E]: O }));
|
|
9886
9884
|
}, U = ae(async () => {
|
|
9887
9885
|
try {
|
|
9888
|
-
const
|
|
9889
|
-
if (l(
|
|
9890
|
-
const O = Xt(
|
|
9886
|
+
const E = await n.getAppropriatenessTest(e);
|
|
9887
|
+
if (l(E), E.waitTimeSpanForNextTry && E.waitTimeSpanForNextTry !== "00:00:00") {
|
|
9888
|
+
const O = Xt(E.waitTimeSpanForNextTry);
|
|
9891
9889
|
O > 0 && J(O);
|
|
9892
9890
|
}
|
|
9893
9891
|
} catch {
|
|
9894
9892
|
}
|
|
9895
|
-
}, [e, n]), te = async (
|
|
9893
|
+
}, [e, n]), te = async (E) => {
|
|
9896
9894
|
if (s) {
|
|
9897
9895
|
if (!F) {
|
|
9898
|
-
const O = s.appropriatenessQuestions.length - Object.keys(
|
|
9896
|
+
const O = s.appropriatenessQuestions.length - Object.keys(z).length;
|
|
9899
9897
|
if (O > 0) {
|
|
9900
9898
|
N(r("appropriatenessTest.answerAllQuestions", { remaining: O }));
|
|
9901
9899
|
return;
|
|
@@ -9904,7 +9902,7 @@ const ka = ({
|
|
|
9904
9902
|
f(!0), N(null);
|
|
9905
9903
|
try {
|
|
9906
9904
|
const O = s.appropriatenessQuestions.map(
|
|
9907
|
-
(ue) => ({ appropriatenessQuestionId: ue.id, value:
|
|
9905
|
+
(ue) => ({ appropriatenessQuestionId: ue.id, value: z[ue.id] || "" })
|
|
9908
9906
|
), fe = {
|
|
9909
9907
|
applicantId: e,
|
|
9910
9908
|
appropriatenessTestId: s.id,
|
|
@@ -9926,7 +9924,7 @@ const ka = ({
|
|
|
9926
9924
|
}
|
|
9927
9925
|
}
|
|
9928
9926
|
}, de = () => {
|
|
9929
|
-
K(!1),
|
|
9927
|
+
K(!1), L(!1), S({}), x(0);
|
|
9930
9928
|
};
|
|
9931
9929
|
if (d)
|
|
9932
9930
|
return /* @__PURE__ */ i(oe, { children: /* @__PURE__ */ i(se, { children: /* @__PURE__ */ o("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", padding: "48px 0", gap: "16px" }, children: [
|
|
@@ -9938,7 +9936,7 @@ const ka = ({
|
|
|
9938
9936
|
/* @__PURE__ */ i("p", { style: { fontSize: "16px", fontWeight: 600, color: "var(--metakyc-danger, #ef4444)" }, children: r("appropriatenessTest.noTestData") }),
|
|
9939
9937
|
g && /* @__PURE__ */ i("p", { style: { fontSize: "14px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "8px" }, children: g })
|
|
9940
9938
|
] }) }) });
|
|
9941
|
-
const le = s.testAllowedMaxTry - s.totalFailedTries, Me = s.appropriatenessQuestions.length, re = Object.keys(
|
|
9939
|
+
const le = s.testAllowedMaxTry - s.totalFailedTries, Me = s.appropriatenessQuestions.length, re = Object.keys(z).length;
|
|
9942
9940
|
if (H > 0)
|
|
9943
9941
|
return /* @__PURE__ */ o(oe, { children: [
|
|
9944
9942
|
/* @__PURE__ */ i(ze, { children: /* @__PURE__ */ i("h2", { style: { fontSize: "18px", fontWeight: 700, color: "var(--metakyc-text-primary, #111827)", margin: 0 }, children: s.displayName }) }),
|
|
@@ -9970,7 +9968,7 @@ const ka = ({
|
|
|
9970
9968
|
] }) })
|
|
9971
9969
|
] });
|
|
9972
9970
|
if (I) {
|
|
9973
|
-
const
|
|
9971
|
+
const E = () => {
|
|
9974
9972
|
V(null), de(), N(null);
|
|
9975
9973
|
};
|
|
9976
9974
|
return /* @__PURE__ */ o(oe, { children: [
|
|
@@ -10036,8 +10034,8 @@ const ka = ({
|
|
|
10036
10034
|
}, children: r("appropriatenessTest.noAttemptsRemaining") }) })
|
|
10037
10035
|
] }) }),
|
|
10038
10036
|
/* @__PURE__ */ i(Ae, { children: /* @__PURE__ */ i("div", { style: { display: "flex", justifyContent: "center", width: "100%", gap: "12px" }, children: I.success ? /* @__PURE__ */ i(Z, { type: "button", onClick: () => t == null ? void 0 : t(), children: r("common.continue") }) : /* @__PURE__ */ o(kt, { children: [
|
|
10039
|
-
le > 0 && H <= 0 && /* @__PURE__ */ i(Z, { type: "button", onClick:
|
|
10040
|
-
le > 0 && H > 0 && /* @__PURE__ */ i(Z, { type: "button", onClick:
|
|
10037
|
+
le > 0 && H <= 0 && /* @__PURE__ */ i(Z, { type: "button", onClick: E, children: r("appropriatenessTest.retakeTest") }),
|
|
10038
|
+
le > 0 && H > 0 && /* @__PURE__ */ i(Z, { type: "button", onClick: E, children: r("appropriatenessTest.ok") }),
|
|
10041
10039
|
le <= 0 && a && /* @__PURE__ */ i(Z, { type: "button", variant: "outline", onClick: a, children: r("common.back") })
|
|
10042
10040
|
] }) }) })
|
|
10043
10041
|
] });
|
|
@@ -10191,8 +10189,8 @@ const ka = ({
|
|
|
10191
10189
|
{
|
|
10192
10190
|
question: Ce,
|
|
10193
10191
|
index: ie,
|
|
10194
|
-
selectedAnswer:
|
|
10195
|
-
onSelect: (
|
|
10192
|
+
selectedAnswer: z[Ce.id],
|
|
10193
|
+
onSelect: (E) => X(Ce.id, E),
|
|
10196
10194
|
disabled: m
|
|
10197
10195
|
}
|
|
10198
10196
|
),
|
|
@@ -10202,7 +10200,7 @@ const ka = ({
|
|
|
10202
10200
|
gap: "6px",
|
|
10203
10201
|
marginTop: "20px",
|
|
10204
10202
|
flexWrap: "wrap"
|
|
10205
|
-
}, children: s.appropriatenessQuestions.map((
|
|
10203
|
+
}, children: s.appropriatenessQuestions.map((E, O) => /* @__PURE__ */ i(
|
|
10206
10204
|
"button",
|
|
10207
10205
|
{
|
|
10208
10206
|
type: "button",
|
|
@@ -10212,8 +10210,8 @@ const ka = ({
|
|
|
10212
10210
|
height: "28px",
|
|
10213
10211
|
borderRadius: "8px",
|
|
10214
10212
|
border: O === ie ? "2px solid var(--metakyc-primary, #2563eb)" : "1px solid var(--metakyc-border, #e5e7eb)",
|
|
10215
|
-
backgroundColor:
|
|
10216
|
-
color:
|
|
10213
|
+
backgroundColor: z[E.id] ? O === ie ? "color-mix(in srgb, var(--metakyc-primary, #2563eb) 15%, transparent)" : "color-mix(in srgb, var(--metakyc-primary, #2563eb) 8%, transparent)" : O === ie ? "var(--metakyc-surface, #f9fafb)" : "var(--metakyc-background, #ffffff)",
|
|
10214
|
+
color: z[E.id] ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-text-muted, #9ca3af)",
|
|
10217
10215
|
fontSize: "12px",
|
|
10218
10216
|
fontWeight: 600,
|
|
10219
10217
|
cursor: "pointer",
|
|
@@ -10225,7 +10223,7 @@ const ka = ({
|
|
|
10225
10223
|
},
|
|
10226
10224
|
children: O + 1
|
|
10227
10225
|
},
|
|
10228
|
-
|
|
10226
|
+
E.id
|
|
10229
10227
|
)) }),
|
|
10230
10228
|
F && /* @__PURE__ */ o("div", { style: {
|
|
10231
10229
|
marginTop: "16px",
|
|
@@ -10258,7 +10256,7 @@ const ka = ({
|
|
|
10258
10256
|
type: "button",
|
|
10259
10257
|
variant: "outline",
|
|
10260
10258
|
onClick: () => {
|
|
10261
|
-
ie > 0 ? x((
|
|
10259
|
+
ie > 0 ? x((E) => E - 1) : a == null || a();
|
|
10262
10260
|
},
|
|
10263
10261
|
disabled: m,
|
|
10264
10262
|
children: ie > 0 ? r("common.previous") : r("common.cancel")
|
|
@@ -10269,7 +10267,7 @@ const ka = ({
|
|
|
10269
10267
|
Z,
|
|
10270
10268
|
{
|
|
10271
10269
|
type: "button",
|
|
10272
|
-
onClick: () => x((
|
|
10270
|
+
onClick: () => x((E) => E + 1),
|
|
10273
10271
|
children: r("common.next")
|
|
10274
10272
|
}
|
|
10275
10273
|
),
|
|
@@ -10419,8 +10417,8 @@ const ka = ({
|
|
|
10419
10417
|
onBack: a
|
|
10420
10418
|
}) => {
|
|
10421
10419
|
var at, Qe, dt, nt;
|
|
10422
|
-
const { t: r } = Le(), { applicantService: n, baseInformationService: s, identityService: l, config: d, currentTheme: u } = We(), { identityData: m, provider: f, token: g, isLoading: N, error:
|
|
10423
|
-
|
|
10420
|
+
const { t: r } = Le(), { applicantService: n, baseInformationService: s, identityService: l, config: d, currentTheme: u } = We(), { identityData: m, provider: f, token: g, isLoading: N, error: z, requestIdentity: S, restartIdentity: q } = Vr(e), [T, $] = w(null), [K, F] = w(null), [L, H] = w([]), [J, ie] = w([]), [x, I] = w(!0), [V, ee] = w(!1), [X, U] = w(null), [te, de] = w(!1), le = Ie.useRef(!1), [Me, re] = w({}), [Ce, Se] = w({}), ge = u != null && u.reviewPageFields && u.reviewPageFields.length > 0 ? u.reviewPageFields[0] : null, M = !!(u != null && u.reviewPageDisabled), E = ye(!1);
|
|
10421
|
+
E.current = M;
|
|
10424
10422
|
const O = vi({
|
|
10425
10423
|
defaultValues: {
|
|
10426
10424
|
street: "",
|
|
@@ -10481,7 +10479,7 @@ const ka = ({
|
|
|
10481
10479
|
country: (p == null ? void 0 : p.country) || "",
|
|
10482
10480
|
nationality: (p == null ? void 0 : p.nationality) || "",
|
|
10483
10481
|
phonenumber: (p == null ? void 0 : p.phonenumber) || ""
|
|
10484
|
-
}), D.kycRecords && D.kycRecords.length > 0 && D.kycRecords[0].providerTokenObject !== null && !le.current &&
|
|
10482
|
+
}), D.kycRecords && D.kycRecords.length > 0 && D.kycRecords[0].providerTokenObject !== null && !le.current && E.current) {
|
|
10485
10483
|
console.log("[Identity] Review page disabled + existing identity — auto-requesting..."), le.current = !0;
|
|
10486
10484
|
try {
|
|
10487
10485
|
await S(), ee(!0);
|
|
@@ -10496,7 +10494,7 @@ const ka = ({
|
|
|
10496
10494
|
}
|
|
10497
10495
|
})();
|
|
10498
10496
|
}, [e]), ve(() => {
|
|
10499
|
-
m && !V &&
|
|
10497
|
+
m && !V && E.current && (console.log("[Identity] Review page disabled — showing cached provider"), ee(!0));
|
|
10500
10498
|
}, [m, V]), ve(() => {
|
|
10501
10499
|
if (g) {
|
|
10502
10500
|
if (g.expiresAt) {
|
|
@@ -10615,10 +10613,10 @@ const ka = ({
|
|
|
10615
10613
|
/* @__PURE__ */ i(Ye, { className: "my-8" }),
|
|
10616
10614
|
/* @__PURE__ */ i("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: r("identity.loadingIdentity") })
|
|
10617
10615
|
] }) });
|
|
10618
|
-
if (
|
|
10616
|
+
if (z)
|
|
10619
10617
|
return /* @__PURE__ */ i(oe, { children: /* @__PURE__ */ i(se, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
10620
10618
|
"Error: ",
|
|
10621
|
-
|
|
10619
|
+
z.message
|
|
10622
10620
|
] }) }) });
|
|
10623
10621
|
const _ = M ? a : () => ee(!1);
|
|
10624
10622
|
if (V && (X || te))
|
|
@@ -10807,7 +10805,7 @@ const ka = ({
|
|
|
10807
10805
|
}, je = (k, D) => {
|
|
10808
10806
|
if (!D && D !== 0) return "—";
|
|
10809
10807
|
if (he.has(k) && k !== "mobileCountryCode") {
|
|
10810
|
-
const G =
|
|
10808
|
+
const G = L.find((Y) => Y.value === D);
|
|
10811
10809
|
return G ? G.label : String(D);
|
|
10812
10810
|
}
|
|
10813
10811
|
return String(D);
|
|
@@ -11041,7 +11039,7 @@ const ka = ({
|
|
|
11041
11039
|
label: ne,
|
|
11042
11040
|
value: String(y),
|
|
11043
11041
|
onChange: (p) => re((B) => ({ ...B, [G]: p })),
|
|
11044
|
-
options: [{ value: "", label: r("common.select") }, ...
|
|
11042
|
+
options: [{ value: "", label: r("common.select") }, ...L]
|
|
11045
11043
|
}
|
|
11046
11044
|
),
|
|
11047
11045
|
k.helpText
|
|
@@ -11108,7 +11106,7 @@ const ka = ({
|
|
|
11108
11106
|
label: r("fields.country"),
|
|
11109
11107
|
value: k.value,
|
|
11110
11108
|
onChange: k.onChange,
|
|
11111
|
-
options: [{ value: "", label: r("placeholders.selectCountry") }, ...
|
|
11109
|
+
options: [{ value: "", label: r("placeholders.selectCountry") }, ...L]
|
|
11112
11110
|
}
|
|
11113
11111
|
)
|
|
11114
11112
|
}
|
|
@@ -11124,7 +11122,7 @@ const ka = ({
|
|
|
11124
11122
|
label: r("fields.nationality"),
|
|
11125
11123
|
value: k.value,
|
|
11126
11124
|
onChange: k.onChange,
|
|
11127
|
-
options: [{ value: "", label: r("placeholders.selectNationality") }, ...
|
|
11125
|
+
options: [{ value: "", label: r("placeholders.selectNationality") }, ...L]
|
|
11128
11126
|
}
|
|
11129
11127
|
)
|
|
11130
11128
|
}
|
|
@@ -11462,29 +11460,29 @@ const Sa = {
|
|
|
11462
11460
|
throw new Error(
|
|
11463
11461
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
11464
11462
|
);
|
|
11465
|
-
const
|
|
11463
|
+
const z = t || ((b = s.applicantForm) == null ? void 0 : b.externalRefId) || "", S = ((p = s.applicantForm) == null ? void 0 : p.email) || "", q = ((B = s.applicantForm) == null ? void 0 : B.hiddenValues) || {}, T = ((W = s.applicantForm) == null ? void 0 : W.initialValues) || {}, K = (((ce = s.applicantForm) == null ? void 0 : ce.fieldLabelMode) || (d == null ? void 0 : d.fieldLabelMode) || "label") !== "placeholder", F = Ue(
|
|
11466
11464
|
() => d != null && d.applicantFormPages && d.applicantFormPages.length > 0 ? d.applicantFormPages : null,
|
|
11467
11465
|
[d == null ? void 0 : d.applicantFormPages]
|
|
11468
|
-
),
|
|
11469
|
-
const c = new Set(St),
|
|
11470
|
-
if (
|
|
11466
|
+
), L = Ue(() => {
|
|
11467
|
+
const c = new Set(St), P = d == null ? void 0 : d.applicantFormRequiredFields;
|
|
11468
|
+
if (P) for (const A of P) c.add(A);
|
|
11471
11469
|
if (F)
|
|
11472
|
-
for (const
|
|
11473
|
-
for (const h of
|
|
11470
|
+
for (const A of F)
|
|
11471
|
+
for (const h of A.fields)
|
|
11474
11472
|
!h.isCustom && h.name && h.required && c.add(h.name);
|
|
11475
11473
|
return Array.from(c);
|
|
11476
11474
|
}, [d == null ? void 0 : d.applicantFormRequiredFields, F]), H = Ue(() => {
|
|
11477
|
-
var
|
|
11475
|
+
var A;
|
|
11478
11476
|
if (F) {
|
|
11479
|
-
const h = F.flatMap((C) => C.fields).filter((C) => !C.isCustom && C.name).map((C) => C.name),
|
|
11480
|
-
for (const C of St)
|
|
11481
|
-
return Array.from(
|
|
11477
|
+
const h = F.flatMap((C) => C.fields).filter((C) => !C.isCustom && C.name).map((C) => C.name), v = new Set(h);
|
|
11478
|
+
for (const C of St) v.add(C);
|
|
11479
|
+
return Array.from(v);
|
|
11482
11480
|
}
|
|
11483
11481
|
let c;
|
|
11484
|
-
(
|
|
11485
|
-
const
|
|
11486
|
-
for (const h of St)
|
|
11487
|
-
return Array.from(
|
|
11482
|
+
(A = s.applicantForm) != null && A.visibleFields ? c = s.applicantForm.visibleFields : d != null && d.applicantFormVisibleFields && d.applicantFormVisibleFields.length > 0 ? c = d.applicantFormVisibleFields : c = Ei;
|
|
11483
|
+
const P = new Set(c);
|
|
11484
|
+
for (const h of St) P.add(h);
|
|
11485
|
+
return Array.from(P);
|
|
11488
11486
|
}, [(Ee = s.applicantForm) == null ? void 0 : Ee.visibleFields, d == null ? void 0 : d.applicantFormVisibleFields, F]), J = /* @__PURE__ */ new Set([
|
|
11489
11487
|
"country",
|
|
11490
11488
|
"nationality",
|
|
@@ -11493,57 +11491,57 @@ const Sa = {
|
|
|
11493
11491
|
"mobileCountryCode",
|
|
11494
11492
|
"otherNationality"
|
|
11495
11493
|
]), ie = Ue(() => {
|
|
11496
|
-
var
|
|
11494
|
+
var P, A;
|
|
11497
11495
|
const c = /* @__PURE__ */ new Set();
|
|
11498
11496
|
if (F)
|
|
11499
11497
|
for (const h of F)
|
|
11500
|
-
for (const
|
|
11501
|
-
!
|
|
11498
|
+
for (const v of h.fields)
|
|
11499
|
+
!v.isCustom && v.name && J.has(v.name) && c.add(v.countriesType ?? ((P = gt[v.name]) == null ? void 0 : P.countriesType));
|
|
11502
11500
|
else
|
|
11503
11501
|
for (const h of H)
|
|
11504
|
-
J.has(h) && c.add((
|
|
11502
|
+
J.has(h) && c.add((A = gt[h]) == null ? void 0 : A.countriesType);
|
|
11505
11503
|
return c.size === 0 && c.add(void 0), Array.from(c);
|
|
11506
11504
|
}, [H, F]), [x, I] = w({}), [V, ee] = w(!0), X = ye(/* @__PURE__ */ new Set()), U = ye(/* @__PURE__ */ new Set());
|
|
11507
11505
|
ve(() => {
|
|
11508
11506
|
if (!d) return;
|
|
11509
11507
|
const c = ie.filter((h) => {
|
|
11510
|
-
const
|
|
11511
|
-
return !U.current.has(
|
|
11508
|
+
const v = h != null ? String(h) : "all";
|
|
11509
|
+
return !U.current.has(v) && !X.current.has(v);
|
|
11512
11510
|
});
|
|
11513
11511
|
if (c.length === 0) {
|
|
11514
|
-
ie.every((
|
|
11515
|
-
const C =
|
|
11512
|
+
ie.every((v) => {
|
|
11513
|
+
const C = v != null ? String(v) : "all";
|
|
11516
11514
|
return U.current.has(C);
|
|
11517
11515
|
}) && ee(!1);
|
|
11518
11516
|
return;
|
|
11519
11517
|
}
|
|
11520
11518
|
ee(!0);
|
|
11521
|
-
const
|
|
11522
|
-
|
|
11519
|
+
const P = c.map((h) => h != null ? String(h) : "all");
|
|
11520
|
+
P.forEach((h) => X.current.add(h)), (async () => {
|
|
11523
11521
|
try {
|
|
11524
11522
|
const h = await Promise.all(
|
|
11525
|
-
c.map(async (
|
|
11526
|
-
const C =
|
|
11523
|
+
c.map(async (v) => {
|
|
11524
|
+
const C = v != null ? String(v) : "all", me = await l.getCountries("", s.locale || "en", v), we = v === 40, Pe = /* @__PURE__ */ new Set(), De = me.map((be) => we && be.countryCode ? {
|
|
11527
11525
|
value: be.countryCode,
|
|
11528
11526
|
label: `${be.countryCode} – ${be.name}`
|
|
11529
11527
|
} : { value: be.abbreviation3 || be.abbreviation, label: be.name }).filter((be) => !be.value || Pe.has(be.value) ? !1 : (Pe.add(be.value), !0));
|
|
11530
11528
|
return U.current.add(C), X.current.delete(C), [C, De];
|
|
11531
11529
|
})
|
|
11532
11530
|
);
|
|
11533
|
-
I((
|
|
11531
|
+
I((v) => ({ ...v, ...Object.fromEntries(h) }));
|
|
11534
11532
|
} catch (h) {
|
|
11535
|
-
|
|
11533
|
+
P.forEach((v) => X.current.delete(v)), console.error("Failed to load countries:", h);
|
|
11536
11534
|
} finally {
|
|
11537
|
-
ie.every((
|
|
11538
|
-
const C =
|
|
11535
|
+
ie.every((v) => {
|
|
11536
|
+
const C = v != null ? String(v) : "all";
|
|
11539
11537
|
return U.current.has(C);
|
|
11540
11538
|
}) && ee(!1);
|
|
11541
11539
|
}
|
|
11542
11540
|
})();
|
|
11543
11541
|
}, [ie, d]);
|
|
11544
|
-
const te = (c,
|
|
11545
|
-
var
|
|
11546
|
-
const
|
|
11542
|
+
const te = (c, P) => {
|
|
11543
|
+
var v;
|
|
11544
|
+
const A = P ?? ((v = gt[c]) == null ? void 0 : v.countriesType), h = A != null ? String(A) : "all";
|
|
11547
11545
|
return x[h] || [];
|
|
11548
11546
|
}, de = {
|
|
11549
11547
|
firstName: 1,
|
|
@@ -11580,7 +11578,7 @@ const Sa = {
|
|
|
11580
11578
|
email: S,
|
|
11581
11579
|
dateOfBirth: "",
|
|
11582
11580
|
phonenumber: "",
|
|
11583
|
-
externalRefId:
|
|
11581
|
+
externalRefId: z,
|
|
11584
11582
|
mobileCountryCode: "",
|
|
11585
11583
|
street: "",
|
|
11586
11584
|
streetNumber: "",
|
|
@@ -11601,75 +11599,80 @@ const Sa = {
|
|
|
11601
11599
|
...Me
|
|
11602
11600
|
}), Se = Object.fromEntries(
|
|
11603
11601
|
Object.entries(q).filter(([c]) => !(c in le) && c !== "externalRefId" && c !== "workflowKey")
|
|
11604
|
-
), [ge, M] = w({ ...Se }), [
|
|
11602
|
+
), [ge, M] = w({ ...Se }), [E, O] = w(!!a);
|
|
11605
11603
|
ve(() => {
|
|
11606
11604
|
if (!a) return;
|
|
11607
|
-
|
|
11605
|
+
let c = !1;
|
|
11606
|
+
return (async () => {
|
|
11608
11607
|
try {
|
|
11609
|
-
const
|
|
11610
|
-
|
|
11611
|
-
|
|
11608
|
+
const A = await m(a);
|
|
11609
|
+
if (c) return;
|
|
11610
|
+
const h = A.applicantRequestData;
|
|
11611
|
+
h && Ce((v) => {
|
|
11612
|
+
var C;
|
|
11612
11613
|
return {
|
|
11613
|
-
...
|
|
11614
|
-
firstName:
|
|
11615
|
-
lastName:
|
|
11616
|
-
email:
|
|
11617
|
-
dateOfBirth:
|
|
11618
|
-
phonenumber:
|
|
11619
|
-
mobileCountryCode:
|
|
11620
|
-
street:
|
|
11621
|
-
streetNumber:
|
|
11622
|
-
zip:
|
|
11623
|
-
city:
|
|
11624
|
-
country:
|
|
11625
|
-
nationality:
|
|
11626
|
-
taxCountry:
|
|
11627
|
-
placeOfBirth:
|
|
11628
|
-
countryOfBirth:
|
|
11629
|
-
taxNumber:
|
|
11630
|
-
defaultLanguage:
|
|
11631
|
-
educationLevel:
|
|
11632
|
-
occupation:
|
|
11633
|
-
title:
|
|
11634
|
-
salutation:
|
|
11635
|
-
otherNationality: (
|
|
11614
|
+
...v,
|
|
11615
|
+
firstName: h.firstName || v.firstName,
|
|
11616
|
+
lastName: h.lastName || v.lastName,
|
|
11617
|
+
email: h.email || v.email,
|
|
11618
|
+
dateOfBirth: h.dateOfBirth || v.dateOfBirth,
|
|
11619
|
+
phonenumber: h.phonenumber || v.phonenumber,
|
|
11620
|
+
mobileCountryCode: h.mobileCountryCode || v.mobileCountryCode,
|
|
11621
|
+
street: h.street || v.street,
|
|
11622
|
+
streetNumber: h.streetNumber || v.streetNumber,
|
|
11623
|
+
zip: h.zip || v.zip,
|
|
11624
|
+
city: h.city || v.city,
|
|
11625
|
+
country: h.country || v.country,
|
|
11626
|
+
nationality: h.nationality || v.nationality,
|
|
11627
|
+
taxCountry: h.taxCountry || v.taxCountry,
|
|
11628
|
+
placeOfBirth: h.placeOfBirth || v.placeOfBirth,
|
|
11629
|
+
countryOfBirth: h.countryOfBirth || v.countryOfBirth,
|
|
11630
|
+
taxNumber: h.taxNumber || v.taxNumber,
|
|
11631
|
+
defaultLanguage: h.defaultLanguage || v.defaultLanguage,
|
|
11632
|
+
educationLevel: h.educationLevel || v.educationLevel,
|
|
11633
|
+
occupation: h.occupation || v.occupation,
|
|
11634
|
+
title: h.title || v.title,
|
|
11635
|
+
salutation: h.salutation != null ? Number(h.salutation) : v.salutation,
|
|
11636
|
+
otherNationality: (C = h.otherNationalities) != null && C.length ? h.otherNationalities : v.otherNationality
|
|
11636
11637
|
};
|
|
11637
|
-
}),
|
|
11638
|
-
} catch (
|
|
11639
|
-
console.error("Failed to load existing applicant data:",
|
|
11638
|
+
}), A.externalRefId && Ce((v) => ({ ...v, externalRefId: A.externalRefId }));
|
|
11639
|
+
} catch (A) {
|
|
11640
|
+
c || console.error("Failed to load existing applicant data:", A);
|
|
11640
11641
|
} finally {
|
|
11641
|
-
O(!1);
|
|
11642
|
+
c || O(!1);
|
|
11642
11643
|
}
|
|
11643
|
-
})()
|
|
11644
|
+
})(), () => {
|
|
11645
|
+
c = !0;
|
|
11646
|
+
};
|
|
11644
11647
|
}, [a]);
|
|
11645
|
-
const [fe, ue] = w(0), [j, _] = w({}), [he, ke] = w(null), [je, ct] = w(!1), Te = (c,
|
|
11646
|
-
var
|
|
11647
|
-
for (const
|
|
11648
|
-
if (!
|
|
11649
|
-
const h = ge[
|
|
11650
|
-
if (
|
|
11651
|
-
if (h.split(",").filter(Boolean).some((C) =>
|
|
11652
|
-
} else if (
|
|
11648
|
+
const [fe, ue] = w(0), [j, _] = w({}), [he, ke] = w(null), [je, ct] = w(!1), Te = (c, P) => Ce((A) => ({ ...A, [c]: P })), Re = (c, P) => M((A) => ({ ...A, [c]: P })), _e = (c) => !c.conditionalOn || ge[c.conditionalOn] === "true", at = (c) => {
|
|
11649
|
+
var P;
|
|
11650
|
+
for (const A of c.fields) {
|
|
11651
|
+
if (!A.isCustom || !A.paramName || !((P = A.blockingValues) != null && P.length)) continue;
|
|
11652
|
+
const h = ge[A.paramName] ?? "";
|
|
11653
|
+
if (A.customType === "group_checkbox") {
|
|
11654
|
+
if (h.split(",").filter(Boolean).some((C) => A.blockingValues.includes(C))) return !0;
|
|
11655
|
+
} else if (A.customType === "radio_group" && A.blockingValues.includes(h))
|
|
11653
11656
|
return !0;
|
|
11654
11657
|
}
|
|
11655
11658
|
return !1;
|
|
11656
11659
|
}, Qe = F && fe < F.length - 1 ? fe + 1 : -1, dt = F && fe > 0 ? fe - 1 : -1, nt = (c) => {
|
|
11657
|
-
const
|
|
11658
|
-
for (const
|
|
11659
|
-
if (
|
|
11660
|
-
if (
|
|
11661
|
-
if (
|
|
11662
|
-
const h = ge[
|
|
11663
|
-
|
|
11660
|
+
const P = {};
|
|
11661
|
+
for (const A of c.fields)
|
|
11662
|
+
if (A.isCustom) {
|
|
11663
|
+
if (A.customType === "paragraph" || A.customType === "html" || A.customType === "br" || A.customType === "link") continue;
|
|
11664
|
+
if (A.required && A.paramName) {
|
|
11665
|
+
const h = ge[A.paramName], v = Q(A.displayText, g) || Q(A.label, g) || A.paramName;
|
|
11666
|
+
A.customType === "checkbox" || A.customType === "link_checkbox" ? h !== "true" && (P[A.paramName] = g("validation.fieldRequired", { field: v })) : (!h || h.trim() === "") && (P[A.paramName] = g("validation.fieldRequired", { field: v }));
|
|
11664
11667
|
}
|
|
11665
|
-
} else if (
|
|
11666
|
-
const h =
|
|
11667
|
-
if (
|
|
11668
|
-
const
|
|
11669
|
-
|
|
11668
|
+
} else if (A.name) {
|
|
11669
|
+
const h = A.name;
|
|
11670
|
+
if (L.includes(h) && ft(re[h])) {
|
|
11671
|
+
const v = gt[h], C = Q(A.displayText, g) || (v != null && v.translationKey ? g(`fields.${v.translationKey}`) : void 0) || (v == null ? void 0 : v.label) || h;
|
|
11672
|
+
P[h] = g("validation.fieldRequired", { field: C });
|
|
11670
11673
|
}
|
|
11671
11674
|
}
|
|
11672
|
-
return
|
|
11675
|
+
return P;
|
|
11673
11676
|
}, k = async () => {
|
|
11674
11677
|
if (!F) return;
|
|
11675
11678
|
const c = F[fe];
|
|
@@ -11678,17 +11681,17 @@ const Sa = {
|
|
|
11678
11681
|
_({}), Qe >= 0 ? ue(Qe) : await D();
|
|
11679
11682
|
return;
|
|
11680
11683
|
}
|
|
11681
|
-
const
|
|
11682
|
-
if (Object.keys(
|
|
11683
|
-
_(
|
|
11684
|
+
const P = nt(c);
|
|
11685
|
+
if (Object.keys(P).length > 0) {
|
|
11686
|
+
_(P);
|
|
11684
11687
|
return;
|
|
11685
11688
|
}
|
|
11686
11689
|
_({}), Qe >= 0 ? ue(Qe) : await D();
|
|
11687
11690
|
}, D = async () => {
|
|
11688
11691
|
if (F) {
|
|
11689
11692
|
let c = {};
|
|
11690
|
-
for (const
|
|
11691
|
-
_e(
|
|
11693
|
+
for (const P of F)
|
|
11694
|
+
_e(P) && (c = { ...c, ...nt(P) });
|
|
11692
11695
|
if (Object.keys(c).length > 0) {
|
|
11693
11696
|
_(c);
|
|
11694
11697
|
return;
|
|
@@ -11706,45 +11709,45 @@ const Sa = {
|
|
|
11706
11709
|
externalRefId: re.externalRefId.trim()
|
|
11707
11710
|
};
|
|
11708
11711
|
if (F) {
|
|
11709
|
-
for (const
|
|
11710
|
-
if (_e(
|
|
11711
|
-
for (const C of
|
|
11712
|
+
for (const v of F)
|
|
11713
|
+
if (_e(v)) {
|
|
11714
|
+
for (const C of v.fields)
|
|
11712
11715
|
if (!C.isCustom && C.name) {
|
|
11713
11716
|
const me = C.name, we = re[me];
|
|
11714
11717
|
ft(we) || (c[me] = we);
|
|
11715
11718
|
}
|
|
11716
11719
|
}
|
|
11717
|
-
for (const
|
|
11718
|
-
if (c[
|
|
11719
|
-
const C = re[
|
|
11720
|
-
ft(C) || (c[
|
|
11720
|
+
for (const v of St)
|
|
11721
|
+
if (c[v] === void 0) {
|
|
11722
|
+
const C = re[v];
|
|
11723
|
+
ft(C) || (c[v] = C);
|
|
11721
11724
|
}
|
|
11722
11725
|
} else
|
|
11723
|
-
H.forEach((
|
|
11724
|
-
if (
|
|
11725
|
-
const C = re[
|
|
11726
|
-
ft(C) || (c[
|
|
11726
|
+
H.forEach((v) => {
|
|
11727
|
+
if (v === "externalRefId") return;
|
|
11728
|
+
const C = re[v];
|
|
11729
|
+
ft(C) || (c[v] = C);
|
|
11727
11730
|
});
|
|
11728
|
-
const
|
|
11731
|
+
const P = [];
|
|
11729
11732
|
if (F) {
|
|
11730
|
-
for (const
|
|
11731
|
-
if (_e(
|
|
11732
|
-
for (const C of
|
|
11733
|
+
for (const v of F)
|
|
11734
|
+
if (_e(v))
|
|
11735
|
+
for (const C of v.fields) {
|
|
11733
11736
|
if (!C.isCustom || !C.paramName || C.customType === "paragraph" || C.customType === "html" || C.customType === "br" || C.customType === "link") continue;
|
|
11734
11737
|
const me = ge[C.paramName] ?? "";
|
|
11735
11738
|
let we;
|
|
11736
11739
|
if (C.customType === "checkbox" || C.customType === "link_checkbox")
|
|
11737
11740
|
we = me === "true" ? "yes" : "no";
|
|
11738
11741
|
else if (we = me, !we && !C.required) continue;
|
|
11739
|
-
|
|
11742
|
+
P.push({ paramName: C.paramName, value: we });
|
|
11740
11743
|
}
|
|
11741
11744
|
}
|
|
11742
|
-
for (const [
|
|
11743
|
-
c[
|
|
11744
|
-
const
|
|
11745
|
-
for (const [
|
|
11746
|
-
!
|
|
11747
|
-
|
|
11745
|
+
for (const [v, C] of Object.entries(le))
|
|
11746
|
+
c[v] === void 0 && !ft(C) && (c[v] = C);
|
|
11747
|
+
const A = new Set(P.map((v) => v.paramName));
|
|
11748
|
+
for (const [v, C] of Object.entries(Se))
|
|
11749
|
+
!A.has(v) && C && P.push({ paramName: v, value: C });
|
|
11750
|
+
P.length > 0 && (c.applicantAdditionalDatas = P);
|
|
11748
11751
|
const h = await u(c);
|
|
11749
11752
|
r(h.applicantId);
|
|
11750
11753
|
} catch (c) {
|
|
@@ -11754,18 +11757,18 @@ const Sa = {
|
|
|
11754
11757
|
}
|
|
11755
11758
|
}, G = async (c) => {
|
|
11756
11759
|
c.preventDefault();
|
|
11757
|
-
for (const
|
|
11758
|
-
if (ft(re[
|
|
11759
|
-
const
|
|
11760
|
+
for (const P of L)
|
|
11761
|
+
if (ft(re[P])) {
|
|
11762
|
+
const A = gt[P], h = (A != null && A.translationKey ? g(`fields.${A.translationKey}`) : void 0) || (A == null ? void 0 : A.label) || P;
|
|
11760
11763
|
ke(g("validation.fieldRequired", { field: h }));
|
|
11761
11764
|
return;
|
|
11762
11765
|
}
|
|
11763
11766
|
await D();
|
|
11764
|
-
}, Y = (c,
|
|
11767
|
+
}, Y = (c, P, A, h, v) => {
|
|
11765
11768
|
var Ot;
|
|
11766
11769
|
const C = gt[c];
|
|
11767
11770
|
if (!C) return null;
|
|
11768
|
-
const me =
|
|
11771
|
+
const me = L.includes(c), we = j[c], Pe = Q(A, g) || (C.translationKey ? g(`fields.${C.translationKey}`) : void 0) || C.label, De = c in Me, be = P ?? c, Ke = { required: me }, Ze = v ? v !== "placeholder" : K, ot = Ze ? Pe : void 0;
|
|
11769
11772
|
switch (C.type) {
|
|
11770
11773
|
case "select":
|
|
11771
11774
|
if (c === "country" || c === "nationality" || c === "taxCountry" || c === "countryOfBirth" || c === "mobileCountryCode") {
|
|
@@ -11901,8 +11904,8 @@ const Sa = {
|
|
|
11901
11904
|
be
|
|
11902
11905
|
);
|
|
11903
11906
|
}
|
|
11904
|
-
}, ne = (c,
|
|
11905
|
-
const
|
|
11907
|
+
}, ne = (c, P) => {
|
|
11908
|
+
const A = c.labelMode ? c.labelMode !== "placeholder" : K;
|
|
11906
11909
|
if (c.customType === "paragraph") {
|
|
11907
11910
|
const C = Q(c.displayText, g) || Q(c.label, g) || "";
|
|
11908
11911
|
return /* @__PURE__ */ i(
|
|
@@ -11917,7 +11920,7 @@ const Sa = {
|
|
|
11917
11920
|
},
|
|
11918
11921
|
dangerouslySetInnerHTML: { __html: C }
|
|
11919
11922
|
},
|
|
11920
|
-
`custom-${
|
|
11923
|
+
`custom-${P}`
|
|
11921
11924
|
);
|
|
11922
11925
|
}
|
|
11923
11926
|
if (c.customType === "html")
|
|
@@ -11926,10 +11929,10 @@ const Sa = {
|
|
|
11926
11929
|
{
|
|
11927
11930
|
dangerouslySetInnerHTML: { __html: Q(c.label, g) || "" }
|
|
11928
11931
|
},
|
|
11929
|
-
`custom-${
|
|
11932
|
+
`custom-${P}`
|
|
11930
11933
|
);
|
|
11931
11934
|
if (c.customType === "br")
|
|
11932
|
-
return /* @__PURE__ */ i("div", { style: { height: "12px" } }, `custom-${
|
|
11935
|
+
return /* @__PURE__ */ i("div", { style: { height: "12px" } }, `custom-${P}`);
|
|
11933
11936
|
if (c.customType === "link") {
|
|
11934
11937
|
const C = Q(c.displayText, g) || Q(c.label, g) || c.linkText || c.linkUrl || "";
|
|
11935
11938
|
return /* @__PURE__ */ i("div", { className: "metakyc-link-field", children: /* @__PURE__ */ o(
|
|
@@ -11952,10 +11955,10 @@ const Sa = {
|
|
|
11952
11955
|
/* @__PURE__ */ i("span", { style: { fontSize: "10px", opacity: 0.7 }, children: "↗" })
|
|
11953
11956
|
]
|
|
11954
11957
|
}
|
|
11955
|
-
) }, `custom-${
|
|
11958
|
+
) }, `custom-${P}`);
|
|
11956
11959
|
}
|
|
11957
11960
|
if (!c.paramName) return null;
|
|
11958
|
-
const h = j[c.paramName],
|
|
11961
|
+
const h = j[c.paramName], v = Q(c.displayText, g) || Q(c.label, g) || c.paramName;
|
|
11959
11962
|
if (c.customType === "checkbox") {
|
|
11960
11963
|
const C = ge[c.paramName] === "true";
|
|
11961
11964
|
return /* @__PURE__ */ o("div", { className: "flex flex-col gap-1", children: [
|
|
@@ -11981,7 +11984,7 @@ const Sa = {
|
|
|
11981
11984
|
className: "metakyc-option-text",
|
|
11982
11985
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
11983
11986
|
children: [
|
|
11984
|
-
|
|
11987
|
+
v,
|
|
11985
11988
|
c.required && /* @__PURE__ */ i("span", { className: "ml-0.5", style: { color: "var(--metakyc-danger, #ef4444)" }, children: "*" })
|
|
11986
11989
|
]
|
|
11987
11990
|
}
|
|
@@ -11990,7 +11993,7 @@ const Sa = {
|
|
|
11990
11993
|
}
|
|
11991
11994
|
),
|
|
11992
11995
|
h && /* @__PURE__ */ i("p", { className: "text-xs mt-0.5", style: { color: "var(--metakyc-danger, #ef4444)" }, children: h })
|
|
11993
|
-
] }, `custom-${
|
|
11996
|
+
] }, `custom-${P}`);
|
|
11994
11997
|
}
|
|
11995
11998
|
if (c.customType === "link_checkbox") {
|
|
11996
11999
|
const C = ge[c.paramName] === "true";
|
|
@@ -12017,7 +12020,7 @@ const Sa = {
|
|
|
12017
12020
|
className: "metakyc-option-text",
|
|
12018
12021
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
12019
12022
|
children: [
|
|
12020
|
-
|
|
12023
|
+
v,
|
|
12021
12024
|
" ",
|
|
12022
12025
|
c.linkUrl && /* @__PURE__ */ i(
|
|
12023
12026
|
"a",
|
|
@@ -12039,18 +12042,18 @@ const Sa = {
|
|
|
12039
12042
|
}
|
|
12040
12043
|
),
|
|
12041
12044
|
h && /* @__PURE__ */ i("p", { className: "text-xs mt-0.5", style: { color: "var(--metakyc-danger, #ef4444)" }, children: h })
|
|
12042
|
-
] }, `custom-${
|
|
12045
|
+
] }, `custom-${P}`);
|
|
12043
12046
|
}
|
|
12044
12047
|
if (c.customType === "group_checkbox") {
|
|
12045
12048
|
const C = (ge[c.paramName] || "").split(",").filter(Boolean);
|
|
12046
12049
|
return /* @__PURE__ */ o("div", { className: "flex flex-col gap-1.5", children: [
|
|
12047
|
-
|
|
12050
|
+
A && /* @__PURE__ */ o(
|
|
12048
12051
|
"div",
|
|
12049
12052
|
{
|
|
12050
12053
|
className: "text-sm font-medium",
|
|
12051
12054
|
style: { color: "var(--metakyc-text-primary, #111827)" },
|
|
12052
12055
|
children: [
|
|
12053
|
-
|
|
12056
|
+
v,
|
|
12054
12057
|
c.required && /* @__PURE__ */ i("span", { className: "ml-0.5", style: { color: "var(--metakyc-danger, #ef4444)" }, children: "*" })
|
|
12055
12058
|
]
|
|
12056
12059
|
}
|
|
@@ -12086,16 +12089,16 @@ const Sa = {
|
|
|
12086
12089
|
);
|
|
12087
12090
|
}) }),
|
|
12088
12091
|
h && /* @__PURE__ */ i("p", { className: "text-xs", style: { color: "var(--metakyc-danger, #ef4444)" }, children: h })
|
|
12089
|
-
] }, `custom-${
|
|
12092
|
+
] }, `custom-${P}`);
|
|
12090
12093
|
}
|
|
12091
12094
|
return c.customType === "radio_group" ? /* @__PURE__ */ o("div", { className: "flex flex-col gap-1.5", children: [
|
|
12092
|
-
|
|
12095
|
+
A && /* @__PURE__ */ o(
|
|
12093
12096
|
"div",
|
|
12094
12097
|
{
|
|
12095
12098
|
className: "text-sm font-medium",
|
|
12096
12099
|
style: { color: "var(--metakyc-text-primary, #111827)" },
|
|
12097
12100
|
children: [
|
|
12098
|
-
|
|
12101
|
+
v,
|
|
12099
12102
|
c.required && /* @__PURE__ */ i("span", { className: "ml-0.5", style: { color: "var(--metakyc-danger, #ef4444)" }, children: "*" })
|
|
12100
12103
|
]
|
|
12101
12104
|
}
|
|
@@ -12113,7 +12116,7 @@ const Sa = {
|
|
|
12113
12116
|
type: "radio",
|
|
12114
12117
|
checked: ge[c.paramName] === C.value,
|
|
12115
12118
|
onChange: () => Re(c.paramName, C.value),
|
|
12116
|
-
name: `radio-group-${c.paramName}-${
|
|
12119
|
+
name: `radio-group-${c.paramName}-${P}`,
|
|
12117
12120
|
className: "metakyc-option-input",
|
|
12118
12121
|
onClick: (me) => me.stopPropagation(),
|
|
12119
12122
|
style: Sa
|
|
@@ -12132,35 +12135,35 @@ const Sa = {
|
|
|
12132
12135
|
C.value
|
|
12133
12136
|
)) }),
|
|
12134
12137
|
h && /* @__PURE__ */ i("p", { className: "text-xs", style: { color: "var(--metakyc-danger, #ef4444)" }, children: h })
|
|
12135
|
-
] }, `custom-${
|
|
12138
|
+
] }, `custom-${P}`) : /* @__PURE__ */ i(
|
|
12136
12139
|
Ne,
|
|
12137
12140
|
{
|
|
12138
12141
|
type: "text",
|
|
12139
|
-
label:
|
|
12140
|
-
placeholder:
|
|
12142
|
+
label: A ? `${v}${c.required ? " *" : ""}` : void 0,
|
|
12143
|
+
placeholder: A ? void 0 : v,
|
|
12141
12144
|
value: ge[c.paramName] || "",
|
|
12142
12145
|
onChange: (C) => Re(c.paramName, C.target.value),
|
|
12143
12146
|
required: c.required,
|
|
12144
12147
|
error: h
|
|
12145
12148
|
},
|
|
12146
|
-
`custom-${
|
|
12149
|
+
`custom-${P}`
|
|
12147
12150
|
);
|
|
12148
|
-
}, y = (c,
|
|
12149
|
-
const
|
|
12151
|
+
}, y = (c, P) => {
|
|
12152
|
+
const A = _e(c);
|
|
12150
12153
|
return /* @__PURE__ */ o("div", { className: "space-y-4", children: [
|
|
12151
12154
|
c.conditionalOn && /* @__PURE__ */ i(Jt, { helpText: c.conditionalHelpText, children: /* @__PURE__ */ o(
|
|
12152
12155
|
"div",
|
|
12153
12156
|
{
|
|
12154
12157
|
className: "metakyc-option-label",
|
|
12155
12158
|
role: "checkbox",
|
|
12156
|
-
"aria-checked":
|
|
12157
|
-
onClick: () => Re(c.conditionalOn,
|
|
12159
|
+
"aria-checked": A,
|
|
12160
|
+
onClick: () => Re(c.conditionalOn, A ? "false" : "true"),
|
|
12158
12161
|
style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer", margin: 0, padding: 0, userSelect: "none" },
|
|
12159
12162
|
children: [
|
|
12160
12163
|
/* @__PURE__ */ i(
|
|
12161
12164
|
Ge,
|
|
12162
12165
|
{
|
|
12163
|
-
checked:
|
|
12166
|
+
checked: A,
|
|
12164
12167
|
onChange: (h) => Re(c.conditionalOn, h ? "true" : "false")
|
|
12165
12168
|
}
|
|
12166
12169
|
),
|
|
@@ -12175,21 +12178,21 @@ const Sa = {
|
|
|
12175
12178
|
]
|
|
12176
12179
|
}
|
|
12177
12180
|
) }),
|
|
12178
|
-
|
|
12179
|
-
const C = Math.min(4, Math.max(1, Number(h.colSpan) || 4)), me = h.isCustom ? `custom-${
|
|
12180
|
-
return /* @__PURE__ */ i("div", { style: { gridColumn: `span ${C} / span ${C}` }, children: /* @__PURE__ */ i(Jt, { helpText: h.helpText, children: h.isCustom ? ne(h,
|
|
12181
|
+
A && /* @__PURE__ */ i("div", { className: "metakyc-form-grid", children: c.fields.map((h, v) => {
|
|
12182
|
+
const C = Math.min(4, Math.max(1, Number(h.colSpan) || 4)), me = h.isCustom ? `custom-${v}-${h.paramName}` : `builtin-${h.name}-${v}`;
|
|
12183
|
+
return /* @__PURE__ */ i("div", { style: { gridColumn: `span ${C} / span ${C}` }, children: /* @__PURE__ */ i(Jt, { helpText: h.helpText, children: h.isCustom ? ne(h, v) : Y(h.name, me, h.displayText, h.countriesType, h.labelMode) }) }, me);
|
|
12181
12184
|
}) })
|
|
12182
12185
|
] });
|
|
12183
12186
|
};
|
|
12184
|
-
if (!d || V ||
|
|
12187
|
+
if (!d || V || E)
|
|
12185
12188
|
return /* @__PURE__ */ i("div", { className: "metakyc-sdk", children: /* @__PURE__ */ i(oe, { children: /* @__PURE__ */ o(se, { children: [
|
|
12186
12189
|
/* @__PURE__ */ i(Ye, { className: "my-8" }),
|
|
12187
12190
|
/* @__PURE__ */ i("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: g("common.loadingForm") })
|
|
12188
12191
|
] }) }) });
|
|
12189
12192
|
if (F) {
|
|
12190
|
-
const c = F[fe] ?? F[0],
|
|
12193
|
+
const c = F[fe] ?? F[0], P = dt === -1, A = Qe === -1, h = F.length, v = _e(c), C = at(c), me = Object.values(j), we = !v && !!c.conditionalOn && c.conditionalMode === "block", Pe = je || f || we || C;
|
|
12191
12194
|
let De;
|
|
12192
|
-
return we || C ? De = g("common.blocked") :
|
|
12195
|
+
return we || C ? De = g("common.blocked") : A ? De = c.conditionalOn && !v ? g("common.skipAndSubmit") : g("common.submit") : De = c.conditionalOn && !v ? g("common.skip") : g("common.next"), /* @__PURE__ */ i("div", { className: "metakyc-sdk", children: /* @__PURE__ */ o(oe, { children: [
|
|
12193
12196
|
/* @__PURE__ */ i(ze, { children: /* @__PURE__ */ i(bt, { title: (d == null ? void 0 : d.title) || g("createApplicant.title") }) }),
|
|
12194
12197
|
/* @__PURE__ */ o(se, { children: [
|
|
12195
12198
|
(c.title || c.subtitle || c.description) && /* @__PURE__ */ o("div", { className: "mb-4", children: [
|
|
@@ -12252,7 +12255,7 @@ const Sa = {
|
|
|
12252
12255
|
] }),
|
|
12253
12256
|
/* @__PURE__ */ o(Ae, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
12254
12257
|
/* @__PURE__ */ o("div", { children: [
|
|
12255
|
-
!
|
|
12258
|
+
!P && /* @__PURE__ */ i(
|
|
12256
12259
|
Z,
|
|
12257
12260
|
{
|
|
12258
12261
|
type: "button",
|
|
@@ -12264,7 +12267,7 @@ const Sa = {
|
|
|
12264
12267
|
children: g("common.previous")
|
|
12265
12268
|
}
|
|
12266
12269
|
),
|
|
12267
|
-
|
|
12270
|
+
P && n && /* @__PURE__ */ i(Z, { type: "button", variant: "outline", onClick: n, disabled: je || f, children: "Cancel" })
|
|
12268
12271
|
] }),
|
|
12269
12272
|
/* @__PURE__ */ i(
|
|
12270
12273
|
Z,
|
|
@@ -12272,7 +12275,7 @@ const Sa = {
|
|
|
12272
12275
|
type: "button",
|
|
12273
12276
|
isLoading: je || f,
|
|
12274
12277
|
disabled: Pe,
|
|
12275
|
-
onClick:
|
|
12278
|
+
onClick: A ? D : k,
|
|
12276
12279
|
children: De
|
|
12277
12280
|
}
|
|
12278
12281
|
)
|
|
@@ -12313,7 +12316,7 @@ const $a = ({
|
|
|
12313
12316
|
throw new Error(
|
|
12314
12317
|
"workflowKey is required. Provide it either as a prop to CreateCompanyApplicantForm or set it in config.applicantForm.workflowKey"
|
|
12315
12318
|
);
|
|
12316
|
-
const g = t || ((k = n.applicantForm) == null ? void 0 : k.externalRefId) || "", N = ((D = n.applicantForm) == null ? void 0 : D.email) || "",
|
|
12319
|
+
const g = t || ((k = n.applicantForm) == null ? void 0 : k.externalRefId) || "", N = ((D = n.applicantForm) == null ? void 0 : D.email) || "", z = ((G = n.applicantForm) == null ? void 0 : G.initialValues) || {}, q = (((Y = n.applicantForm) == null ? void 0 : Y.fieldLabelMode) || (l == null ? void 0 : l.fieldLabelMode) || "label") !== "placeholder", T = Ue(
|
|
12317
12320
|
() => l != null && l.companyFormPages && l.companyFormPages.length > 0 ? l.companyFormPages : null,
|
|
12318
12321
|
[l == null ? void 0 : l.companyFormPages]
|
|
12319
12322
|
), $ = Ue(() => {
|
|
@@ -12332,7 +12335,7 @@ const $a = ({
|
|
|
12332
12335
|
return Array.from(b);
|
|
12333
12336
|
}
|
|
12334
12337
|
return (y = n.applicantForm) != null && y.visibleFields ? n.applicantForm.visibleFields : l != null && l.companyFormVisibleFields && l.companyFormVisibleFields.length > 0 ? l.companyFormVisibleFields : Li;
|
|
12335
|
-
}, [(ne = n.applicantForm) == null ? void 0 : ne.visibleFields, l == null ? void 0 : l.companyFormVisibleFields, T]), F = /* @__PURE__ */ new Set(["countryResidence", "addressCountry"]),
|
|
12338
|
+
}, [(ne = n.applicantForm) == null ? void 0 : ne.visibleFields, l == null ? void 0 : l.companyFormVisibleFields, T]), F = /* @__PURE__ */ new Set(["countryResidence", "addressCountry"]), L = Ue(() => {
|
|
12336
12339
|
var R, b;
|
|
12337
12340
|
const y = /* @__PURE__ */ new Set();
|
|
12338
12341
|
if (T)
|
|
@@ -12346,12 +12349,12 @@ const $a = ({
|
|
|
12346
12349
|
}, [K, T]), [H, J] = w({}), [ie, x] = w(!0), I = ye(/* @__PURE__ */ new Set()), V = ye(/* @__PURE__ */ new Set());
|
|
12347
12350
|
ve(() => {
|
|
12348
12351
|
if (!l) return;
|
|
12349
|
-
const y =
|
|
12352
|
+
const y = L.filter((p) => {
|
|
12350
12353
|
const B = p != null ? String(p) : "all";
|
|
12351
12354
|
return !V.current.has(B) && !I.current.has(B);
|
|
12352
12355
|
});
|
|
12353
12356
|
if (y.length === 0) {
|
|
12354
|
-
|
|
12357
|
+
L.every((B) => V.current.has(B != null ? String(B) : "all")) && x(!1);
|
|
12355
12358
|
return;
|
|
12356
12359
|
}
|
|
12357
12360
|
x(!0);
|
|
@@ -12360,7 +12363,7 @@ const $a = ({
|
|
|
12360
12363
|
try {
|
|
12361
12364
|
const p = await Promise.all(
|
|
12362
12365
|
y.map(async (B) => {
|
|
12363
|
-
const W = B != null ? String(B) : "all", ce = await s.getCountries("", n.locale || "en", B), Ee = /* @__PURE__ */ new Set(), c = ce.map((
|
|
12366
|
+
const W = B != null ? String(B) : "all", ce = await s.getCountries("", n.locale || "en", B), Ee = /* @__PURE__ */ new Set(), c = ce.map((P) => ({ value: P.abbreviation3 || P.abbreviation, label: P.name })).filter((P) => !P.value || Ee.has(P.value) ? !1 : (Ee.add(P.value), !0));
|
|
12364
12367
|
return V.current.add(W), I.current.delete(W), [W, c];
|
|
12365
12368
|
})
|
|
12366
12369
|
);
|
|
@@ -12368,10 +12371,10 @@ const $a = ({
|
|
|
12368
12371
|
} catch (p) {
|
|
12369
12372
|
R.forEach((B) => I.current.delete(B)), console.error("Failed to load countries:", p);
|
|
12370
12373
|
} finally {
|
|
12371
|
-
|
|
12374
|
+
L.every((B) => V.current.has(B != null ? String(B) : "all")) && x(!1);
|
|
12372
12375
|
}
|
|
12373
12376
|
})();
|
|
12374
|
-
}, [
|
|
12377
|
+
}, [L, l]);
|
|
12375
12378
|
const ee = (y, R) => {
|
|
12376
12379
|
var B;
|
|
12377
12380
|
const b = R ?? ((B = yt[y]) == null ? void 0 : B.countriesType), p = b != null ? String(b) : "all";
|
|
@@ -12397,7 +12400,7 @@ const $a = ({
|
|
|
12397
12400
|
addressCountry: 1,
|
|
12398
12401
|
lei: 1
|
|
12399
12402
|
}, U = Object.fromEntries(
|
|
12400
|
-
Object.entries(
|
|
12403
|
+
Object.entries(z).filter(([y]) => y in X)
|
|
12401
12404
|
), [te, de] = w({
|
|
12402
12405
|
workflowKey: f,
|
|
12403
12406
|
companyName: "",
|
|
@@ -12421,7 +12424,7 @@ const $a = ({
|
|
|
12421
12424
|
lei: "",
|
|
12422
12425
|
externalRefId: g,
|
|
12423
12426
|
...U
|
|
12424
|
-
}), [le, Me] = w({}), [re, Ce] = w(0), [Se, ge] = w({}), [M,
|
|
12427
|
+
}), [le, Me] = w({}), [re, Ce] = w(0), [Se, ge] = w({}), [M, E] = w(null), [O, fe] = w(!1), ue = (y, R) => de((b) => ({ ...b, [y]: R })), j = (y, R) => Me((b) => ({ ...b, [y]: R })), _ = (y) => !y.conditionalOn || le[y.conditionalOn] === "true", he = (y) => {
|
|
12425
12428
|
var R;
|
|
12426
12429
|
for (const b of y.fields) {
|
|
12427
12430
|
if (!b.isCustom || !b.paramName || !((R = b.blockingValues) != null && R.length)) continue;
|
|
@@ -12474,7 +12477,7 @@ const $a = ({
|
|
|
12474
12477
|
return;
|
|
12475
12478
|
}
|
|
12476
12479
|
}
|
|
12477
|
-
fe(!0),
|
|
12480
|
+
fe(!0), E(null);
|
|
12478
12481
|
try {
|
|
12479
12482
|
const R = {
|
|
12480
12483
|
workflowKey: te.workflowKey,
|
|
@@ -12531,7 +12534,7 @@ const $a = ({
|
|
|
12531
12534
|
const B = await d(R);
|
|
12532
12535
|
a(B.applicantId);
|
|
12533
12536
|
} catch (R) {
|
|
12534
|
-
console.error("Error creating company applicant:", R),
|
|
12537
|
+
console.error("Error creating company applicant:", R), E(R.message || m("createCompany.failedToCreate"));
|
|
12535
12538
|
} finally {
|
|
12536
12539
|
fe(!1);
|
|
12537
12540
|
}
|
|
@@ -12540,14 +12543,14 @@ const $a = ({
|
|
|
12540
12543
|
for (const R of $)
|
|
12541
12544
|
if (Lt(te[R])) {
|
|
12542
12545
|
const b = yt[R], p = (b != null && b.translationKey ? m(`fields.${b.translationKey}`) : void 0) || (b == null ? void 0 : b.label) || R;
|
|
12543
|
-
|
|
12546
|
+
E(m("validation.fieldRequired", { field: p }));
|
|
12544
12547
|
return;
|
|
12545
12548
|
}
|
|
12546
12549
|
await Re();
|
|
12547
12550
|
}, at = (y, R, b, p, B) => {
|
|
12548
12551
|
const W = yt[y];
|
|
12549
12552
|
if (!W) return null;
|
|
12550
|
-
const ce = $.includes(y), Ee = Se[y], c = Q(b, m) || (W.translationKey ? m(`fields.${W.translationKey}`) : void 0) || W.label,
|
|
12553
|
+
const ce = $.includes(y), Ee = Se[y], c = Q(b, m) || (W.translationKey ? m(`fields.${W.translationKey}`) : void 0) || W.label, P = y in U, A = R ?? y, h = B ? B !== "placeholder" : q, v = h ? c : void 0;
|
|
12551
12554
|
switch (W.type) {
|
|
12552
12555
|
case "select":
|
|
12553
12556
|
if (y === "countryResidence" || y === "addressCountry") {
|
|
@@ -12556,15 +12559,15 @@ const $a = ({
|
|
|
12556
12559
|
it,
|
|
12557
12560
|
{
|
|
12558
12561
|
required: ce,
|
|
12559
|
-
label:
|
|
12562
|
+
label: v,
|
|
12560
12563
|
value: te[y] || "",
|
|
12561
12564
|
onChange: (me) => ue(y, me),
|
|
12562
12565
|
options: [{ value: "", label: h ? m("placeholders.selectCountry") : c }, ...C],
|
|
12563
12566
|
disabled: ie,
|
|
12564
|
-
readOnly:
|
|
12567
|
+
readOnly: P,
|
|
12565
12568
|
error: Ee
|
|
12566
12569
|
},
|
|
12567
|
-
|
|
12570
|
+
A
|
|
12568
12571
|
);
|
|
12569
12572
|
}
|
|
12570
12573
|
return null;
|
|
@@ -12574,14 +12577,14 @@ const $a = ({
|
|
|
12574
12577
|
{
|
|
12575
12578
|
required: ce,
|
|
12576
12579
|
type: "date",
|
|
12577
|
-
label:
|
|
12580
|
+
label: v,
|
|
12578
12581
|
placeholder: h ? void 0 : c,
|
|
12579
12582
|
value: te[y] || "",
|
|
12580
12583
|
onChange: (C) => ue(y, C.target.value),
|
|
12581
|
-
readOnly:
|
|
12584
|
+
readOnly: P,
|
|
12582
12585
|
error: Ee
|
|
12583
12586
|
},
|
|
12584
|
-
|
|
12587
|
+
A
|
|
12585
12588
|
);
|
|
12586
12589
|
case "email":
|
|
12587
12590
|
return /* @__PURE__ */ i(
|
|
@@ -12589,14 +12592,14 @@ const $a = ({
|
|
|
12589
12592
|
{
|
|
12590
12593
|
required: ce,
|
|
12591
12594
|
type: "email",
|
|
12592
|
-
label:
|
|
12595
|
+
label: v,
|
|
12593
12596
|
placeholder: h ? void 0 : c,
|
|
12594
12597
|
value: te[y] || "",
|
|
12595
12598
|
onChange: (C) => ue(y, C.target.value),
|
|
12596
|
-
readOnly:
|
|
12599
|
+
readOnly: P,
|
|
12597
12600
|
error: Ee
|
|
12598
12601
|
},
|
|
12599
|
-
|
|
12602
|
+
A
|
|
12600
12603
|
);
|
|
12601
12604
|
case "tel":
|
|
12602
12605
|
return /* @__PURE__ */ i(
|
|
@@ -12604,14 +12607,14 @@ const $a = ({
|
|
|
12604
12607
|
{
|
|
12605
12608
|
required: ce,
|
|
12606
12609
|
type: "tel",
|
|
12607
|
-
label:
|
|
12610
|
+
label: v,
|
|
12608
12611
|
placeholder: h ? void 0 : c,
|
|
12609
12612
|
value: te[y] || "",
|
|
12610
12613
|
onChange: (C) => ue(y, C.target.value),
|
|
12611
|
-
readOnly:
|
|
12614
|
+
readOnly: P,
|
|
12612
12615
|
error: Ee
|
|
12613
12616
|
},
|
|
12614
|
-
|
|
12617
|
+
A
|
|
12615
12618
|
);
|
|
12616
12619
|
default:
|
|
12617
12620
|
return /* @__PURE__ */ i(
|
|
@@ -12619,14 +12622,14 @@ const $a = ({
|
|
|
12619
12622
|
{
|
|
12620
12623
|
required: ce,
|
|
12621
12624
|
type: "text",
|
|
12622
|
-
label:
|
|
12625
|
+
label: v,
|
|
12623
12626
|
placeholder: h ? void 0 : c,
|
|
12624
12627
|
value: te[y] || "",
|
|
12625
12628
|
onChange: (C) => ue(y, C.target.value),
|
|
12626
|
-
readOnly:
|
|
12629
|
+
readOnly: P,
|
|
12627
12630
|
error: Ee
|
|
12628
12631
|
},
|
|
12629
|
-
|
|
12632
|
+
A
|
|
12630
12633
|
);
|
|
12631
12634
|
}
|
|
12632
12635
|
}, Qe = (y, R) => {
|
|
@@ -12732,8 +12735,8 @@ const $a = ({
|
|
|
12732
12735
|
] }) }) });
|
|
12733
12736
|
if (T) {
|
|
12734
12737
|
const y = T[re] ?? T[0], R = je === -1, b = ke === -1, p = T.length, B = _(y), W = he(y), ce = Object.values(Se), Ee = !B && !!y.conditionalOn && y.conditionalMode === "block", c = O || u || Ee || W;
|
|
12735
|
-
let
|
|
12736
|
-
return Ee || W ?
|
|
12738
|
+
let P;
|
|
12739
|
+
return Ee || W ? P = m("common.blocked") : b ? P = y.conditionalOn && !B ? m("common.skipAndSubmit") : m("common.submit") : P = y.conditionalOn && !B ? m("common.skip") : m("common.next"), /* @__PURE__ */ i("div", { className: "metakyc-sdk", children: /* @__PURE__ */ o(oe, { children: [
|
|
12737
12740
|
/* @__PURE__ */ i(ze, { children: /* @__PURE__ */ i(bt, { title: (l == null ? void 0 : l.title) || m("createCompany.title") }) }),
|
|
12738
12741
|
/* @__PURE__ */ o(se, { children: [
|
|
12739
12742
|
(y.title || y.subtitle) && /* @__PURE__ */ o("div", { className: "mb-4", children: [
|
|
@@ -12749,10 +12752,10 @@ const $a = ({
|
|
|
12749
12752
|
" ",
|
|
12750
12753
|
M
|
|
12751
12754
|
] }),
|
|
12752
|
-
ce.map((
|
|
12755
|
+
ce.map((A, h) => /* @__PURE__ */ i("p", { className: "text-sm", style: { color: "var(--metakyc-danger, #ef4444)" }, children: A }, h))
|
|
12753
12756
|
] }),
|
|
12754
12757
|
p > 1 && /* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "center", gap: "0.5rem", marginBottom: "1rem" }, children: [
|
|
12755
|
-
T.map((
|
|
12758
|
+
T.map((A, h) => /* @__PURE__ */ i(
|
|
12756
12759
|
"div",
|
|
12757
12760
|
{
|
|
12758
12761
|
style: {
|
|
@@ -12788,7 +12791,7 @@ const $a = ({
|
|
|
12788
12791
|
),
|
|
12789
12792
|
R && r && /* @__PURE__ */ i(Z, { type: "button", variant: "outline", onClick: r, disabled: O || u, children: "Cancel" })
|
|
12790
12793
|
] }),
|
|
12791
|
-
/* @__PURE__ */ i(Z, { type: "button", isLoading: O || u, disabled: c, onClick: b ? Re : Te, children:
|
|
12794
|
+
/* @__PURE__ */ i(Z, { type: "button", isLoading: O || u, disabled: c, onClick: b ? Re : Te, children: P })
|
|
12792
12795
|
] })
|
|
12793
12796
|
] }) });
|
|
12794
12797
|
}
|
|
@@ -12825,7 +12828,7 @@ const $a = ({
|
|
|
12825
12828
|
hasWorkflowChanged: f,
|
|
12826
12829
|
isLoading: g,
|
|
12827
12830
|
error: N,
|
|
12828
|
-
moveBack:
|
|
12831
|
+
moveBack: z,
|
|
12829
12832
|
refreshProgress: S
|
|
12830
12833
|
} = Mr(e), [q, T] = Ie.useState(!1), $ = Ie.useRef(null);
|
|
12831
12834
|
if (Ie.useEffect(() => {
|
|
@@ -12952,13 +12955,13 @@ const $a = ({
|
|
|
12952
12955
|
}
|
|
12953
12956
|
)
|
|
12954
12957
|
] });
|
|
12955
|
-
},
|
|
12958
|
+
}, L = () => {
|
|
12956
12959
|
const ie = d.filter((I) => I.visibility !== !1).findIndex((I) => I.order === l.order) <= 0, x = {
|
|
12957
12960
|
applicantId: e,
|
|
12958
12961
|
onComplete: async () => {
|
|
12959
12962
|
await S();
|
|
12960
12963
|
},
|
|
12961
|
-
onBack: ie ? void 0 :
|
|
12964
|
+
onBack: ie ? void 0 : z
|
|
12962
12965
|
};
|
|
12963
12966
|
switch (l.action) {
|
|
12964
12967
|
case pe.Questionaries:
|
|
@@ -13004,7 +13007,7 @@ const $a = ({
|
|
|
13004
13007
|
};
|
|
13005
13008
|
return /* @__PURE__ */ o("div", { className: `metakyc-sdk ${r || ""}`, children: [
|
|
13006
13009
|
F(),
|
|
13007
|
-
|
|
13010
|
+
L()
|
|
13008
13011
|
] });
|
|
13009
13012
|
}, Ca = Ie.forwardRef(
|
|
13010
13013
|
({ visibleSteps: e, currentVisibleStepIndex: t, getStepFallbackName: a }, r) => {
|