@vpdev2/metakyc 1.0.33 → 1.0.35
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/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +169 -164
- package/dist/index.js.map +1 -1
- package/dist/theme/theme-manager.d.ts.map +1 -1
- package/dist/types/theme.d.ts +4 -0
- package/dist/types/theme.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var di = Object.defineProperty;
|
|
2
2
|
var mi = (e, t, r) => t in e ? di(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
-
var
|
|
3
|
+
var fe = (e, t, r) => mi(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
4
|
import ui from "axios";
|
|
5
5
|
import { jsx as i, jsxs as o, Fragment as pt } from "react/jsx-runtime";
|
|
6
6
|
import * as jt from "react";
|
|
7
|
-
import Ce, { createContext as Xt, useMemo as Fe, useState as k, useEffect as
|
|
7
|
+
import Ce, { createContext as Xt, useMemo as Fe, useState as k, useEffect as ve, useContext as Zt, useCallback as te, useRef as de, forwardRef as ht, createElement as It } from "react";
|
|
8
8
|
import pi, { createPortal as Lt } from "react-dom";
|
|
9
9
|
import { useForm as gi, Controller as at } from "react-hook-form";
|
|
10
10
|
import { z as Qe } from "zod";
|
|
@@ -140,7 +140,7 @@ class Ai {
|
|
|
140
140
|
class $e extends Error {
|
|
141
141
|
constructor(r, a, n, l, s) {
|
|
142
142
|
super(r);
|
|
143
|
-
|
|
143
|
+
fe(this, "response");
|
|
144
144
|
this.code = a, this.details = n, this.validationErrors = l, this.name = "MetaKYCError", this.response = s, Object.setPrototypeOf(this, $e.prototype);
|
|
145
145
|
}
|
|
146
146
|
}
|
|
@@ -196,9 +196,9 @@ class yt {
|
|
|
196
196
|
}
|
|
197
197
|
class zi {
|
|
198
198
|
constructor(t) {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
199
|
+
fe(this, "axiosInstance");
|
|
200
|
+
fe(this, "endpointBuilder");
|
|
201
|
+
fe(this, "config");
|
|
202
202
|
this.config = { ...Ii, ...t }, this.endpointBuilder = new Ai(this.config.endpoints), this.axiosInstance = ui.create({
|
|
203
203
|
baseURL: this.config.baseUrl,
|
|
204
204
|
timeout: this.config.timeout,
|
|
@@ -1048,7 +1048,7 @@ class $i {
|
|
|
1048
1048
|
}
|
|
1049
1049
|
class _i {
|
|
1050
1050
|
constructor() {
|
|
1051
|
-
|
|
1051
|
+
fe(this, "listeners", /* @__PURE__ */ new Map());
|
|
1052
1052
|
}
|
|
1053
1053
|
/**
|
|
1054
1054
|
* Subscribe to an event
|
|
@@ -1093,10 +1093,10 @@ class _i {
|
|
|
1093
1093
|
}
|
|
1094
1094
|
class Gi {
|
|
1095
1095
|
constructor() {
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1096
|
+
fe(this, "events", new _i());
|
|
1097
|
+
fe(this, "_applicantId", null);
|
|
1098
|
+
fe(this, "_progress", null);
|
|
1099
|
+
fe(this, "_error", null);
|
|
1100
1100
|
}
|
|
1101
1101
|
/**
|
|
1102
1102
|
* Get current applicant ID
|
|
@@ -1233,7 +1233,7 @@ class Gi {
|
|
|
1233
1233
|
}
|
|
1234
1234
|
class Qi {
|
|
1235
1235
|
constructor() {
|
|
1236
|
-
|
|
1236
|
+
fe(this, "handlers", /* @__PURE__ */ new Map());
|
|
1237
1237
|
}
|
|
1238
1238
|
/**
|
|
1239
1239
|
* Register a step handler
|
|
@@ -1274,8 +1274,8 @@ class Qi {
|
|
|
1274
1274
|
}
|
|
1275
1275
|
class Xi {
|
|
1276
1276
|
constructor(t, r, a, n, l, s, p, m) {
|
|
1277
|
-
|
|
1278
|
-
|
|
1277
|
+
fe(this, "state");
|
|
1278
|
+
fe(this, "stepRouter");
|
|
1279
1279
|
this.applicantService = t, this.questionnaireService = r, this.uploadDocumentService = a, this.appropriatenessTestService = n, this.overviewService = l, this.riskScoringService = s, this.investorCategorizationService = m, this.state = new Gi(), this.stepRouter = new Qi(), this.registerStepHandlers();
|
|
1280
1280
|
}
|
|
1281
1281
|
/**
|
|
@@ -1471,10 +1471,10 @@ a:hover { color: ${t}; }
|
|
|
1471
1471
|
}
|
|
1472
1472
|
class er {
|
|
1473
1473
|
constructor(t) {
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1474
|
+
fe(this, "sdk", null);
|
|
1475
|
+
fe(this, "config");
|
|
1476
|
+
fe(this, "completeCallback", null);
|
|
1477
|
+
fe(this, "errorCallback", null);
|
|
1478
1478
|
this.config = t;
|
|
1479
1479
|
}
|
|
1480
1480
|
async loadSDK() {
|
|
@@ -1528,8 +1528,8 @@ class er {
|
|
|
1528
1528
|
}
|
|
1529
1529
|
class tr {
|
|
1530
1530
|
constructor(t) {
|
|
1531
|
-
|
|
1532
|
-
|
|
1531
|
+
fe(this, "sdk", null);
|
|
1532
|
+
fe(this, "config");
|
|
1533
1533
|
this.config = t;
|
|
1534
1534
|
}
|
|
1535
1535
|
/**
|
|
@@ -1594,9 +1594,9 @@ class tr {
|
|
|
1594
1594
|
}
|
|
1595
1595
|
class ir {
|
|
1596
1596
|
constructor(t) {
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1597
|
+
fe(this, "sardineContext", null);
|
|
1598
|
+
fe(this, "config");
|
|
1599
|
+
fe(this, "sessionKey");
|
|
1600
1600
|
this.config = t, this.sessionKey = t.sessionKey || this.generateSessionKey();
|
|
1601
1601
|
}
|
|
1602
1602
|
/**
|
|
@@ -1793,9 +1793,9 @@ class et {
|
|
|
1793
1793
|
}
|
|
1794
1794
|
class rr {
|
|
1795
1795
|
constructor() {
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1796
|
+
fe(this, "currentTheme", Pe);
|
|
1797
|
+
fe(this, "customStyleElement", null);
|
|
1798
|
+
fe(this, "themeStyleElement", null);
|
|
1799
1799
|
}
|
|
1800
1800
|
/**
|
|
1801
1801
|
* Apply theme configuration
|
|
@@ -1832,7 +1832,12 @@ class rr {
|
|
|
1832
1832
|
"input-text": t.inputText || t.textPrimary,
|
|
1833
1833
|
"input-border": t.inputBorder || t.border,
|
|
1834
1834
|
"input-border-focus": t.inputBorderFocus || t.primary,
|
|
1835
|
-
"input-placeholder": t.inputPlaceholder || t.textMuted
|
|
1835
|
+
"input-placeholder": t.inputPlaceholder || t.textMuted,
|
|
1836
|
+
// Message background overrides (optional — support rgba/hex-alpha for transparency)
|
|
1837
|
+
"danger-bg": t.dangerBg,
|
|
1838
|
+
"success-bg": t.successBg,
|
|
1839
|
+
"warning-bg": t.warningBg,
|
|
1840
|
+
"info-bg": t.infoBg
|
|
1836
1841
|
};
|
|
1837
1842
|
r != null && r.fontFamily && (n["font-family"] = r.fontFamily), r != null && r.headingFont && (n["heading-font"] = r.headingFont), r != null && r.fontSize && Object.entries(r.fontSize).forEach(([m, d]) => {
|
|
1838
1843
|
n[`font-size-${m}`] = d;
|
|
@@ -6730,7 +6735,7 @@ function ei(e) {
|
|
|
6730
6735
|
};
|
|
6731
6736
|
}
|
|
6732
6737
|
const wr = /^t\(['"](.+?)['"]\)$/, Bt = "$t:";
|
|
6733
|
-
function
|
|
6738
|
+
function pe(e, t) {
|
|
6734
6739
|
if (!e) return "";
|
|
6735
6740
|
const r = e.trim();
|
|
6736
6741
|
if (r.startsWith(Bt))
|
|
@@ -6738,7 +6743,7 @@ function ke(e, t) {
|
|
|
6738
6743
|
const a = wr.exec(r);
|
|
6739
6744
|
return a ? t(a[1]) : e;
|
|
6740
6745
|
}
|
|
6741
|
-
const ti = "1.0.
|
|
6746
|
+
const ti = "1.0.35", ii = Xt(null), qt = `metakyc-translations-${ti}-`, Sr = ({
|
|
6742
6747
|
locale: e,
|
|
6743
6748
|
fetchTranslations: t,
|
|
6744
6749
|
children: r
|
|
@@ -6753,7 +6758,7 @@ const ti = "1.0.33", ii = Xt(null), qt = `metakyc-translations-${ti}-`, Sr = ({
|
|
|
6753
6758
|
}
|
|
6754
6759
|
return m;
|
|
6755
6760
|
}, [a]), [l, s] = k(n);
|
|
6756
|
-
|
|
6761
|
+
ve(() => {
|
|
6757
6762
|
if (!t) return;
|
|
6758
6763
|
let m = !1;
|
|
6759
6764
|
return t(a).then((d) => {
|
|
@@ -6845,7 +6850,7 @@ const Wt = "metakyc-theme-cache", Pa = ({ config: e, children: t }) => {
|
|
|
6845
6850
|
s.investorCategorizationService
|
|
6846
6851
|
)
|
|
6847
6852
|
}), [e, s, r]);
|
|
6848
|
-
|
|
6853
|
+
ve(() => ((async () => {
|
|
6849
6854
|
if (n.current || l.current) {
|
|
6850
6855
|
console.log("[MetaKYC] Theme already loading or loaded, skipping...");
|
|
6851
6856
|
return;
|
|
@@ -6998,9 +7003,9 @@ function Oa() {
|
|
|
6998
7003
|
}
|
|
6999
7004
|
function Er(e) {
|
|
7000
7005
|
const { createOrchestrator: t } = Oe(), [r, a] = k(null), [n, l] = k(!1), [s, p] = k(null), m = de(null), d = e || Ir();
|
|
7001
|
-
|
|
7006
|
+
ve(() => {
|
|
7002
7007
|
m.current || (m.current = t());
|
|
7003
|
-
}, [t]),
|
|
7008
|
+
}, [t]), ve(() => {
|
|
7004
7009
|
var F;
|
|
7005
7010
|
r && d && (Rr(d), zr({
|
|
7006
7011
|
applicantId: d,
|
|
@@ -7028,7 +7033,7 @@ function Er(e) {
|
|
|
7028
7033
|
}
|
|
7029
7034
|
}
|
|
7030
7035
|
}, [d]);
|
|
7031
|
-
|
|
7036
|
+
ve(() => {
|
|
7032
7037
|
d && !h.current && R();
|
|
7033
7038
|
}, [d, R]);
|
|
7034
7039
|
const L = te(async () => {
|
|
@@ -7139,7 +7144,7 @@ function Pr(e) {
|
|
|
7139
7144
|
}
|
|
7140
7145
|
}
|
|
7141
7146
|
}, [e, t, r]);
|
|
7142
|
-
|
|
7147
|
+
ve(() => {
|
|
7143
7148
|
e && b.current !== e && q();
|
|
7144
7149
|
}, [e]);
|
|
7145
7150
|
const S = te(
|
|
@@ -7183,7 +7188,7 @@ function Dr(e) {
|
|
|
7183
7188
|
}
|
|
7184
7189
|
}
|
|
7185
7190
|
}, [e, t]);
|
|
7186
|
-
|
|
7191
|
+
ve(() => {
|
|
7187
7192
|
e && L.current !== e && b();
|
|
7188
7193
|
}, [e]);
|
|
7189
7194
|
const q = te(
|
|
@@ -7227,7 +7232,7 @@ function Va(e) {
|
|
|
7227
7232
|
}
|
|
7228
7233
|
}
|
|
7229
7234
|
}, [e, t]);
|
|
7230
|
-
|
|
7235
|
+
ve(() => {
|
|
7231
7236
|
e && L.current !== e && b();
|
|
7232
7237
|
}, [e]);
|
|
7233
7238
|
const q = te(
|
|
@@ -7272,7 +7277,7 @@ function jr(e) {
|
|
|
7272
7277
|
}
|
|
7273
7278
|
}
|
|
7274
7279
|
}, [e, t]);
|
|
7275
|
-
|
|
7280
|
+
ve(() => {
|
|
7276
7281
|
e && h.current !== e && R();
|
|
7277
7282
|
}, [e]);
|
|
7278
7283
|
const L = te(async () => {
|
|
@@ -7415,7 +7420,7 @@ function Fr(e) {
|
|
|
7415
7420
|
}
|
|
7416
7421
|
}
|
|
7417
7422
|
}, [e, t, r]);
|
|
7418
|
-
|
|
7423
|
+
ve(() => {
|
|
7419
7424
|
e && S.current !== e && P();
|
|
7420
7425
|
}, [e]);
|
|
7421
7426
|
const B = te(
|
|
@@ -7939,7 +7944,7 @@ const Kt = 280, qr = ({
|
|
|
7939
7944
|
const D = U.current.getBoundingClientRect(), O = window.innerHeight - D.bottom < Kt && D.top > Kt;
|
|
7940
7945
|
return { top: O ? D.top : D.bottom + 4, left: D.left, width: D.width, openUp: O };
|
|
7941
7946
|
}, []), ae = te(() => {
|
|
7942
|
-
const D = getComputedStyle(document.querySelector(".metakyc-sdk") || document.documentElement), E = (
|
|
7947
|
+
const D = getComputedStyle(document.querySelector(".metakyc-sdk") || document.documentElement), E = (he, se) => D.getPropertyValue(he).trim() || se, O = E("--metakyc-input-bg", E("--metakyc-background", "#ffffff"));
|
|
7943
7948
|
B({
|
|
7944
7949
|
bg: O,
|
|
7945
7950
|
borderColor: E("--metakyc-input-border", E("--metakyc-border", "#d1d5db")),
|
|
@@ -7957,15 +7962,15 @@ const Kt = 280, qr = ({
|
|
|
7957
7962
|
}, [y, J, ae]), A = te(() => {
|
|
7958
7963
|
R(!1), b("");
|
|
7959
7964
|
}, []);
|
|
7960
|
-
|
|
7965
|
+
ve(() => {
|
|
7961
7966
|
if (!h) return;
|
|
7962
7967
|
const D = (E) => {
|
|
7963
|
-
var
|
|
7968
|
+
var he, se;
|
|
7964
7969
|
const O = E.target;
|
|
7965
|
-
!((
|
|
7970
|
+
!((he = F.current) != null && he.contains(O)) && !((se = K.current) != null && se.contains(O)) && A();
|
|
7966
7971
|
};
|
|
7967
7972
|
return document.addEventListener("mousedown", D), () => document.removeEventListener("mousedown", D);
|
|
7968
|
-
}, [h, A]),
|
|
7973
|
+
}, [h, A]), ve(() => {
|
|
7969
7974
|
if (!h) return;
|
|
7970
7975
|
const D = () => {
|
|
7971
7976
|
const E = J();
|
|
@@ -7984,7 +7989,7 @@ const Kt = 280, qr = ({
|
|
|
7984
7989
|
}, W = (D) => {
|
|
7985
7990
|
var E;
|
|
7986
7991
|
return ((E = a.find((O) => O.value === D)) == null ? void 0 : E.label) || D;
|
|
7987
|
-
}, { bg: _, borderColor: oe, textPrimary: H, textSecondary: Me, primaryColor:
|
|
7992
|
+
}, { bg: _, borderColor: oe, textPrimary: H, textSecondary: Me, primaryColor: ge, primaryLight: ye, hoverBg: xe } = P, me = h && q && /* @__PURE__ */ o(
|
|
7988
7993
|
"div",
|
|
7989
7994
|
{
|
|
7990
7995
|
ref: K,
|
|
@@ -8048,8 +8053,8 @@ const Kt = 280, qr = ({
|
|
|
8048
8053
|
padding: "8px 12px",
|
|
8049
8054
|
fontSize: "13px",
|
|
8050
8055
|
cursor: "pointer",
|
|
8051
|
-
backgroundColor: E ?
|
|
8052
|
-
color: E ?
|
|
8056
|
+
backgroundColor: E ? ye : "transparent",
|
|
8057
|
+
color: E ? ge : H,
|
|
8053
8058
|
userSelect: "none"
|
|
8054
8059
|
},
|
|
8055
8060
|
onMouseEnter: (O) => {
|
|
@@ -8234,7 +8239,7 @@ const Kt = 280, qr = ({
|
|
|
8234
8239
|
}, [L, Q, J]), W = te(() => {
|
|
8235
8240
|
q(!1), P("");
|
|
8236
8241
|
}, []), _ = () => b ? W() : X();
|
|
8237
|
-
|
|
8242
|
+
ve(() => {
|
|
8238
8243
|
if (!b) return;
|
|
8239
8244
|
const j = (ne) => {
|
|
8240
8245
|
var Ie, ze;
|
|
@@ -8242,7 +8247,7 @@ const Kt = 280, qr = ({
|
|
|
8242
8247
|
!((Ie = ae.current) != null && Ie.contains(Z)) && !((ze = A.current) != null && ze.contains(Z)) && W();
|
|
8243
8248
|
};
|
|
8244
8249
|
return document.addEventListener("mousedown", j), () => document.removeEventListener("mousedown", j);
|
|
8245
|
-
}, [b, W]),
|
|
8250
|
+
}, [b, W]), ve(() => {
|
|
8246
8251
|
if (!b) return;
|
|
8247
8252
|
const j = () => {
|
|
8248
8253
|
const ne = Q();
|
|
@@ -8251,7 +8256,7 @@ const Kt = 280, qr = ({
|
|
|
8251
8256
|
return window.addEventListener("scroll", j, !0), window.addEventListener("resize", j), () => {
|
|
8252
8257
|
window.removeEventListener("scroll", j, !0), window.removeEventListener("resize", j);
|
|
8253
8258
|
};
|
|
8254
|
-
}, [b, Q]),
|
|
8259
|
+
}, [b, Q]), ve(() => {
|
|
8255
8260
|
b && V.current && setTimeout(() => {
|
|
8256
8261
|
var j;
|
|
8257
8262
|
return (j = V.current) == null ? void 0 : j.focus();
|
|
@@ -8261,7 +8266,7 @@ const Kt = 280, qr = ({
|
|
|
8261
8266
|
(j) => j.label.toLowerCase().includes(S.toLowerCase()) || j.value.toLowerCase().includes(S.toLowerCase())
|
|
8262
8267
|
), H = (se = a.find((j) => j.value === l)) == null ? void 0 : se.label, Me = (j, ne) => {
|
|
8263
8268
|
L || ne || (s(j), W());
|
|
8264
|
-
}, { bg:
|
|
8269
|
+
}, { bg: ge, border: ye, text: xe, textSecondary: me, primary: D, primaryLight: E, hoverBg: O } = U, he = b && B && /* @__PURE__ */ o(
|
|
8265
8270
|
"div",
|
|
8266
8271
|
{
|
|
8267
8272
|
ref: A,
|
|
@@ -8275,12 +8280,12 @@ const Kt = 280, qr = ({
|
|
|
8275
8280
|
zIndex: 99999,
|
|
8276
8281
|
borderRadius: "8px",
|
|
8277
8282
|
boxShadow: "0 4px 16px rgba(0,0,0,0.18)",
|
|
8278
|
-
border: `1px solid ${
|
|
8279
|
-
backgroundColor:
|
|
8283
|
+
border: `1px solid ${ye}`,
|
|
8284
|
+
backgroundColor: ge,
|
|
8280
8285
|
overflow: "hidden"
|
|
8281
8286
|
},
|
|
8282
8287
|
children: [
|
|
8283
|
-
/* @__PURE__ */ i("div", { style: { padding: "8px", borderBottom: `1px solid ${
|
|
8288
|
+
/* @__PURE__ */ i("div", { style: { padding: "8px", borderBottom: `1px solid ${ye}` }, children: /* @__PURE__ */ i(
|
|
8284
8289
|
"input",
|
|
8285
8290
|
{
|
|
8286
8291
|
ref: V,
|
|
@@ -8296,18 +8301,18 @@ const Kt = 280, qr = ({
|
|
|
8296
8301
|
padding: "6px 8px",
|
|
8297
8302
|
fontSize: "13px",
|
|
8298
8303
|
borderRadius: "6px",
|
|
8299
|
-
border: `1px solid ${
|
|
8300
|
-
backgroundColor:
|
|
8304
|
+
border: `1px solid ${ye}`,
|
|
8305
|
+
backgroundColor: ge,
|
|
8301
8306
|
color: xe,
|
|
8302
8307
|
outline: "none",
|
|
8303
8308
|
boxSizing: "border-box"
|
|
8304
8309
|
},
|
|
8305
8310
|
onFocus: (j) => {
|
|
8306
8311
|
const ne = getComputedStyle(document.querySelector(".metakyc-sdk") || document.documentElement), Z = ne.getPropertyValue("--metakyc-input-border-focus").trim() || ne.getPropertyValue("--metakyc-primary").trim() || "#2563eb";
|
|
8307
|
-
j.currentTarget.style.backgroundColor =
|
|
8312
|
+
j.currentTarget.style.backgroundColor = ge, j.currentTarget.style.color = xe, j.currentTarget.style.borderColor = Z, j.currentTarget.style.outline = "none", j.currentTarget.style.boxShadow = `0 0 0 2px ${Z}33`;
|
|
8308
8313
|
},
|
|
8309
8314
|
onBlur: (j) => {
|
|
8310
|
-
j.currentTarget.style.backgroundColor =
|
|
8315
|
+
j.currentTarget.style.backgroundColor = ge, j.currentTarget.style.color = xe, j.currentTarget.style.borderColor = ye, j.currentTarget.style.outline = "none", j.currentTarget.style.boxShadow = "none";
|
|
8311
8316
|
}
|
|
8312
8317
|
}
|
|
8313
8318
|
) }),
|
|
@@ -8408,7 +8413,7 @@ const Kt = 280, qr = ({
|
|
|
8408
8413
|
]
|
|
8409
8414
|
}
|
|
8410
8415
|
),
|
|
8411
|
-
typeof document < "u" &&
|
|
8416
|
+
typeof document < "u" && he ? Lt(he, document.body) : null,
|
|
8412
8417
|
t && /* @__PURE__ */ i("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-error, #ef4444)" }, children: t }),
|
|
8413
8418
|
!t && r && /* @__PURE__ */ i("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: r })
|
|
8414
8419
|
]
|
|
@@ -8995,7 +9000,7 @@ const ea = ({
|
|
|
8995
9000
|
)
|
|
8996
9001
|
] }),
|
|
8997
9002
|
m && /* @__PURE__ */ i("div", { className: "mx-6 mb-4 p-3 rounded", style: {
|
|
8998
|
-
backgroundColor: "color-mix(in srgb, var(--metakyc-danger, #ef4444) 10%, transparent)",
|
|
9003
|
+
backgroundColor: "var(--metakyc-danger-bg, color-mix(in srgb, var(--metakyc-danger, #ef4444) 10%, transparent))",
|
|
8999
9004
|
border: "1px solid color-mix(in srgb, var(--metakyc-danger, #ef4444) 30%, transparent)"
|
|
9000
9005
|
}, children: /* @__PURE__ */ i("p", { className: "text-sm", style: { color: "var(--metakyc-danger, #ef4444)" }, children: m.message }) })
|
|
9001
9006
|
] }) : null;
|
|
@@ -9531,7 +9536,7 @@ const ma = ({
|
|
|
9531
9536
|
)
|
|
9532
9537
|
] }),
|
|
9533
9538
|
y && /* @__PURE__ */ i("div", { className: "mx-6 mb-4 p-3 rounded", style: {
|
|
9534
|
-
backgroundColor: "color-mix(in srgb, var(--metakyc-danger, #ef4444) 10%, transparent)",
|
|
9539
|
+
backgroundColor: "var(--metakyc-danger-bg, color-mix(in srgb, var(--metakyc-danger, #ef4444) 10%, transparent))",
|
|
9535
9540
|
border: "1px solid color-mix(in srgb, var(--metakyc-danger, #ef4444) 30%, transparent)"
|
|
9536
9541
|
}, children: /* @__PURE__ */ i("p", { className: "text-sm", style: { color: "var(--metakyc-danger, #ef4444)" }, children: y.message }) })
|
|
9537
9542
|
] }) : null;
|
|
@@ -9784,7 +9789,7 @@ const ga = ({
|
|
|
9784
9789
|
onBack: r
|
|
9785
9790
|
}) => {
|
|
9786
9791
|
const { t: a } = Re(), { appropriatenessTestService: n } = Oe(), [l, s] = k(null), [p, m] = k(!0), [d, y] = k(!1), [h, R] = k(null), [L, b] = k({}), [q, S] = k(0), [P, B] = k(!1), [F, U] = k(!1), [K, J] = k(0), [ae, x] = k(0), [A, V] = k(null);
|
|
9787
|
-
|
|
9792
|
+
ve(() => {
|
|
9788
9793
|
(async () => {
|
|
9789
9794
|
try {
|
|
9790
9795
|
m(!0), R(null);
|
|
@@ -9799,25 +9804,25 @@ const ga = ({
|
|
|
9799
9804
|
m(!1);
|
|
9800
9805
|
}
|
|
9801
9806
|
})();
|
|
9802
|
-
}, [e, n]),
|
|
9807
|
+
}, [e, n]), ve(() => {
|
|
9803
9808
|
if (!P || q <= 0) return;
|
|
9804
9809
|
const E = setInterval(() => {
|
|
9805
9810
|
S((O) => O <= 1 ? (U(!0), 0) : O - 1);
|
|
9806
9811
|
}, 1e3);
|
|
9807
9812
|
return () => clearInterval(E);
|
|
9808
|
-
}, [P, q]),
|
|
9813
|
+
}, [P, q]), ve(() => {
|
|
9809
9814
|
if (K <= 0) return;
|
|
9810
9815
|
const E = setInterval(() => {
|
|
9811
9816
|
J((O) => O <= 1 ? 0 : O - 1);
|
|
9812
9817
|
}, 1e3);
|
|
9813
9818
|
return () => clearInterval(E);
|
|
9814
|
-
}, [K]),
|
|
9819
|
+
}, [K]), ve(() => {
|
|
9815
9820
|
F && !d && _();
|
|
9816
9821
|
}, [F]);
|
|
9817
9822
|
const Q = () => {
|
|
9818
9823
|
l && (B(!0), S(l.testDurationSec), x(0), b({}), R(null));
|
|
9819
9824
|
}, X = (E, O) => {
|
|
9820
|
-
b((
|
|
9825
|
+
b((he) => ({ ...he, [E]: O }));
|
|
9821
9826
|
}, W = te(async () => {
|
|
9822
9827
|
try {
|
|
9823
9828
|
const E = await n.getAppropriatenessTest(e);
|
|
@@ -9840,13 +9845,13 @@ const ga = ({
|
|
|
9840
9845
|
try {
|
|
9841
9846
|
const O = l.appropriatenessQuestions.map(
|
|
9842
9847
|
(se) => ({ appropriatenessQuestionId: se.id, value: L[se.id] || "" })
|
|
9843
|
-
),
|
|
9848
|
+
), he = {
|
|
9844
9849
|
applicantId: e,
|
|
9845
9850
|
appropriatenessTestId: l.id,
|
|
9846
9851
|
appropriatenessQuestionResults: O
|
|
9847
9852
|
};
|
|
9848
9853
|
try {
|
|
9849
|
-
const se = await n.fillAppropriatenessTest(
|
|
9854
|
+
const se = await n.fillAppropriatenessTest(he);
|
|
9850
9855
|
se.isSuccess ? V({ success: !0, message: se.message || a("appropriatenessTest.passedMessage") }) : (V({ success: !1, message: se.message || a("appropriatenessTest.failedMessage") }), setTimeout(() => W(), 1e3));
|
|
9851
9856
|
} catch (se) {
|
|
9852
9857
|
if (se.code === 400 && se.message)
|
|
@@ -9873,7 +9878,7 @@ const ga = ({
|
|
|
9873
9878
|
/* @__PURE__ */ i("p", { style: { fontSize: "16px", fontWeight: 600, color: "var(--metakyc-danger, #ef4444)" }, children: a("appropriatenessTest.noTestData") }),
|
|
9874
9879
|
h && /* @__PURE__ */ i("p", { style: { fontSize: "14px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "8px" }, children: h })
|
|
9875
9880
|
] }) }) });
|
|
9876
|
-
const H = l.testAllowedMaxTry - l.totalFailedTries, Me = l.appropriatenessQuestions.length,
|
|
9881
|
+
const H = l.testAllowedMaxTry - l.totalFailedTries, Me = l.appropriatenessQuestions.length, ge = Object.keys(L).length;
|
|
9877
9882
|
if (K > 0)
|
|
9878
9883
|
return /* @__PURE__ */ o(ie, { children: [
|
|
9879
9884
|
/* @__PURE__ */ i(Ne, { children: /* @__PURE__ */ i("h2", { style: { fontSize: "18px", fontWeight: 700, color: "var(--metakyc-text-primary, #111827)", margin: 0 }, children: l.displayName }) }),
|
|
@@ -10046,7 +10051,7 @@ const ga = ({
|
|
|
10046
10051
|
/* @__PURE__ */ i(G, { type: "button", onClick: Q, disabled: H <= 0, children: a("appropriatenessTest.startTest") })
|
|
10047
10052
|
] }) })
|
|
10048
10053
|
] });
|
|
10049
|
-
const
|
|
10054
|
+
const ye = l.appropriatenessQuestions[ae], xe = ae === Me - 1, me = ge === Me, D = q <= 60;
|
|
10050
10055
|
return /* @__PURE__ */ o(ie, { children: [
|
|
10051
10056
|
/* @__PURE__ */ o(Ne, { children: [
|
|
10052
10057
|
/* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
|
|
@@ -10099,7 +10104,7 @@ const ga = ({
|
|
|
10099
10104
|
height: "100%",
|
|
10100
10105
|
borderRadius: "999px",
|
|
10101
10106
|
backgroundColor: "var(--metakyc-primary, #2563eb)",
|
|
10102
|
-
width: `${
|
|
10107
|
+
width: `${ge / Me * 100}%`,
|
|
10103
10108
|
transition: "width 0.3s ease"
|
|
10104
10109
|
} }) }),
|
|
10105
10110
|
/* @__PURE__ */ o("div", { style: {
|
|
@@ -10108,7 +10113,7 @@ const ga = ({
|
|
|
10108
10113
|
marginTop: "4px"
|
|
10109
10114
|
}, children: [
|
|
10110
10115
|
/* @__PURE__ */ o("span", { style: { fontSize: "11px", color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
|
|
10111
|
-
|
|
10116
|
+
ge,
|
|
10112
10117
|
" ",
|
|
10113
10118
|
a("appropriatenessTest.answered")
|
|
10114
10119
|
] }),
|
|
@@ -10121,13 +10126,13 @@ const ga = ({
|
|
|
10121
10126
|
] })
|
|
10122
10127
|
] }),
|
|
10123
10128
|
/* @__PURE__ */ o(re, { children: [
|
|
10124
|
-
|
|
10129
|
+
ye && /* @__PURE__ */ i(
|
|
10125
10130
|
fa,
|
|
10126
10131
|
{
|
|
10127
|
-
question:
|
|
10132
|
+
question: ye,
|
|
10128
10133
|
index: ae,
|
|
10129
|
-
selectedAnswer: L[
|
|
10130
|
-
onSelect: (E) => X(
|
|
10134
|
+
selectedAnswer: L[ye.id],
|
|
10135
|
+
onSelect: (E) => X(ye.id, E),
|
|
10131
10136
|
disabled: d
|
|
10132
10137
|
}
|
|
10133
10138
|
),
|
|
@@ -10354,7 +10359,7 @@ const ga = ({
|
|
|
10354
10359
|
onBack: r
|
|
10355
10360
|
}) => {
|
|
10356
10361
|
var it, Ke, dt, Xe;
|
|
10357
|
-
const { t: a } = Re(), { applicantService: n, baseInformationService: l, identityService: s, config: p, currentTheme: m } = Oe(), { identityData: d, provider: y, token: h, isLoading: R, error: L, requestIdentity: b, restartIdentity: q } = Mr(e), [S, P] = k(null), [B, F] = k(null), [U, K] = k([]), [J, ae] = k([]), [x, A] = k(!0), [V, Q] = k(!1), [X, W] = k(null), [_, oe] = k(!1), H = Ce.useRef(!1), [Me,
|
|
10362
|
+
const { t: a } = Re(), { applicantService: n, baseInformationService: l, identityService: s, config: p, currentTheme: m } = Oe(), { identityData: d, provider: y, token: h, isLoading: R, error: L, requestIdentity: b, restartIdentity: q } = Mr(e), [S, P] = k(null), [B, F] = k(null), [U, K] = k([]), [J, ae] = k([]), [x, A] = k(!0), [V, Q] = k(!1), [X, W] = k(null), [_, oe] = k(!1), H = Ce.useRef(!1), [Me, ge] = k({}), [ye, xe] = k({}), me = m != null && m.reviewPageFields && m.reviewPageFields.length > 0 ? m.reviewPageFields[0] : null, D = !!(m != null && m.reviewPageDisabled), E = de(!1);
|
|
10358
10363
|
E.current = D;
|
|
10359
10364
|
const O = gi({
|
|
10360
10365
|
defaultValues: {
|
|
@@ -10367,7 +10372,7 @@ const ga = ({
|
|
|
10367
10372
|
phonenumber: ""
|
|
10368
10373
|
}
|
|
10369
10374
|
});
|
|
10370
|
-
|
|
10375
|
+
ve(() => {
|
|
10371
10376
|
if (D) {
|
|
10372
10377
|
H.current || (H.current = !0, b().then(() => Q(!0)).catch((M) => console.error("[Identity] Auto-request failed:", M)).finally(() => A(!1)));
|
|
10373
10378
|
return;
|
|
@@ -10386,7 +10391,7 @@ const ga = ({
|
|
|
10386
10391
|
const z = /* @__PURE__ */ new Set(), w = Y.filter((v) => v.countryCode).map((v) => ({ value: v.countryCode, label: `${v.countryCode} – ${v.name}` })).filter((v) => z.has(v.value) ? !1 : (z.add(v.value), !0));
|
|
10387
10392
|
ae(w);
|
|
10388
10393
|
const u = M.applicantRequestData;
|
|
10389
|
-
if (
|
|
10394
|
+
if (ge({
|
|
10390
10395
|
firstName: (u == null ? void 0 : u.firstName) || "",
|
|
10391
10396
|
lastName: (u == null ? void 0 : u.lastName) || "",
|
|
10392
10397
|
email: (u == null ? void 0 : u.email) || "",
|
|
@@ -10430,9 +10435,9 @@ const ga = ({
|
|
|
10430
10435
|
A(!1);
|
|
10431
10436
|
}
|
|
10432
10437
|
})();
|
|
10433
|
-
}, [e]),
|
|
10438
|
+
}, [e]), ve(() => {
|
|
10434
10439
|
d && !V && E.current && (console.log("[Identity] Review page disabled — showing cached provider"), Q(!0));
|
|
10435
|
-
}, [d, V]),
|
|
10440
|
+
}, [d, V]), ve(() => {
|
|
10436
10441
|
if (h) {
|
|
10437
10442
|
if (h.expiresAt) {
|
|
10438
10443
|
const f = new Date(h.expiresAt).getTime();
|
|
@@ -10457,11 +10462,11 @@ const ga = ({
|
|
|
10457
10462
|
}
|
|
10458
10463
|
}
|
|
10459
10464
|
}, [h]);
|
|
10460
|
-
const
|
|
10461
|
-
|
|
10465
|
+
const he = y !== null && y === Be.Sumsub;
|
|
10466
|
+
ve(() => {
|
|
10462
10467
|
if (y !== null && h && !S && V && !_) {
|
|
10463
10468
|
const f = y;
|
|
10464
|
-
if (
|
|
10469
|
+
if (he) {
|
|
10465
10470
|
console.log("[Sumsub] Fetching access token for Web SDK…"), W(null), (async () => {
|
|
10466
10471
|
try {
|
|
10467
10472
|
const M = await s.refreshSumsubToken(e), $ = et.parseProviderConfig(y, h, p);
|
|
@@ -10531,7 +10536,7 @@ const ga = ({
|
|
|
10531
10536
|
console.error("[Identity] Error destroying provider:", f);
|
|
10532
10537
|
}
|
|
10533
10538
|
};
|
|
10534
|
-
}, [y, h, S, V, t, _,
|
|
10539
|
+
}, [y, h, S, V, t, _, he, e, p, s]);
|
|
10535
10540
|
const se = async () => {
|
|
10536
10541
|
try {
|
|
10537
10542
|
W(null), oe(!1), await b(), Q(!0);
|
|
@@ -10560,7 +10565,7 @@ const ga = ({
|
|
|
10560
10565
|
/* @__PURE__ */ i(Ne, { children: /* @__PURE__ */ i("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: a("identity.sessionIssueTitle") }) }),
|
|
10561
10566
|
/* @__PURE__ */ o(re, { children: [
|
|
10562
10567
|
/* @__PURE__ */ i("div", { className: "p-4 rounded-lg mb-6", style: {
|
|
10563
|
-
backgroundColor: "color-mix(in srgb, var(--metakyc-danger, #ef4444) 10%, transparent)",
|
|
10568
|
+
backgroundColor: "var(--metakyc-danger-bg, color-mix(in srgb, var(--metakyc-danger, #ef4444) 10%, transparent))",
|
|
10564
10569
|
border: "1px solid color-mix(in srgb, var(--metakyc-danger, #ef4444) 30%, transparent)"
|
|
10565
10570
|
}, children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
|
|
10566
10571
|
/* @__PURE__ */ i(
|
|
@@ -10588,7 +10593,7 @@ const ga = ({
|
|
|
10588
10593
|
] })
|
|
10589
10594
|
] }) }),
|
|
10590
10595
|
/* @__PURE__ */ o("div", { className: "rounded-lg p-4", style: {
|
|
10591
|
-
backgroundColor: "color-mix(in srgb, var(--metakyc-primary, #2563eb) 10%, transparent)",
|
|
10596
|
+
backgroundColor: "var(--metakyc-info-bg, color-mix(in srgb, var(--metakyc-primary, #2563eb) 10%, transparent))",
|
|
10592
10597
|
border: "1px solid color-mix(in srgb, var(--metakyc-primary, #2563eb) 30%, transparent)"
|
|
10593
10598
|
}, children: [
|
|
10594
10599
|
/* @__PURE__ */ i("h3", { className: "font-semibold mb-2", style: { color: "var(--metakyc-primary, #2563eb)" }, children: a("identity.whatToDoNext") }),
|
|
@@ -10606,7 +10611,7 @@ const ga = ({
|
|
|
10606
10611
|
] });
|
|
10607
10612
|
if (V && d) {
|
|
10608
10613
|
const f = y;
|
|
10609
|
-
return
|
|
10614
|
+
return he ? /* @__PURE__ */ o("div", { style: {
|
|
10610
10615
|
background: "var(--metakyc-background, #ffffff)",
|
|
10611
10616
|
borderRadius: "12px",
|
|
10612
10617
|
border: "1px solid var(--metakyc-border, #e5e7eb)",
|
|
@@ -10689,7 +10694,7 @@ const ga = ({
|
|
|
10689
10694
|
] }) }),
|
|
10690
10695
|
/* @__PURE__ */ o(re, { children: [
|
|
10691
10696
|
/* @__PURE__ */ i("div", { className: "mb-4 p-3 rounded-lg", style: {
|
|
10692
|
-
backgroundColor: "color-mix(in srgb, var(--metakyc-warning, #f59e0b) 10%, transparent)",
|
|
10697
|
+
backgroundColor: "var(--metakyc-warning-bg, color-mix(in srgb, var(--metakyc-warning, #f59e0b) 10%, transparent))",
|
|
10693
10698
|
border: "1px solid color-mix(in srgb, var(--metakyc-warning, #f59e0b) 30%, transparent)"
|
|
10694
10699
|
}, children: /* @__PURE__ */ i("p", { className: "text-sm", style: { color: "var(--metakyc-warning, #f59e0b)" }, children: a("identity.importantExpiredMessage") }) }),
|
|
10695
10700
|
/* @__PURE__ */ i("div", { className: "w-full", style: { height: "600px" }, children: /* @__PURE__ */ i(
|
|
@@ -10843,7 +10848,7 @@ const ga = ({
|
|
|
10843
10848
|
/* @__PURE__ */ i("div", { style: { flex: 1, minWidth: 0 }, children: f }),
|
|
10844
10849
|
/* @__PURE__ */ i("div", { style: { paddingTop: 24 }, children: /* @__PURE__ */ i(ze, { helpText: M }) })
|
|
10845
10850
|
] }) : f, We = (f, M) => {
|
|
10846
|
-
const $ = `cf-${M}`, Y = f.paramName ?? "", ee =
|
|
10851
|
+
const $ = `cf-${M}`, Y = f.paramName ?? "", ee = ye[Y];
|
|
10847
10852
|
if (f.customType === "br")
|
|
10848
10853
|
return /* @__PURE__ */ i("div", { style: { ...Z(f.colSpan), minHeight: "0.5rem" } }, $);
|
|
10849
10854
|
if (f.customType === "paragraph")
|
|
@@ -10963,7 +10968,7 @@ const ga = ({
|
|
|
10963
10968
|
{
|
|
10964
10969
|
label: ee,
|
|
10965
10970
|
value: String(g),
|
|
10966
|
-
onChange: (u) =>
|
|
10971
|
+
onChange: (u) => ge((c) => ({ ...c, [$]: u })),
|
|
10967
10972
|
options: [{ value: "", label: a("placeholders.selectCountryCode") }, ...J]
|
|
10968
10973
|
}
|
|
10969
10974
|
),
|
|
@@ -10974,7 +10979,7 @@ const ga = ({
|
|
|
10974
10979
|
{
|
|
10975
10980
|
label: ee,
|
|
10976
10981
|
value: String(g),
|
|
10977
|
-
onChange: (u) =>
|
|
10982
|
+
onChange: (u) => ge((c) => ({ ...c, [$]: u })),
|
|
10978
10983
|
options: [{ value: "", label: a("common.select") }, ...U]
|
|
10979
10984
|
}
|
|
10980
10985
|
),
|
|
@@ -10986,7 +10991,7 @@ const ga = ({
|
|
|
10986
10991
|
label: ee,
|
|
10987
10992
|
type: (Y == null ? void 0 : Y.type) === "date" ? "date" : (Y == null ? void 0 : Y.type) === "email" ? "email" : "text",
|
|
10988
10993
|
value: String(g),
|
|
10989
|
-
onChange: (u) =>
|
|
10994
|
+
onChange: (u) => ge((c) => ({ ...c, [$]: u.target.value }))
|
|
10990
10995
|
}
|
|
10991
10996
|
),
|
|
10992
10997
|
f.helpText
|
|
@@ -11081,14 +11086,14 @@ const ga = ({
|
|
|
11081
11086
|
] })
|
|
11082
11087
|
] }) });
|
|
11083
11088
|
}, Pt = {
|
|
11084
|
-
success: { color: "--metakyc-success", fallback: "#22c55e" },
|
|
11085
|
-
error: { color: "--metakyc-danger", fallback: "#ef4444" },
|
|
11086
|
-
pending: { color: "--metakyc-warning", fallback: "#f59e0b" }
|
|
11089
|
+
success: { color: "--metakyc-success", fallback: "#22c55e", bgVar: "--metakyc-success-bg" },
|
|
11090
|
+
error: { color: "--metakyc-danger", fallback: "#ef4444", bgVar: "--metakyc-danger-bg" },
|
|
11091
|
+
pending: { color: "--metakyc-warning", fallback: "#f59e0b", bgVar: "--metakyc-warning-bg" }
|
|
11087
11092
|
};
|
|
11088
11093
|
function Tt(e) {
|
|
11089
|
-
const { color: t, fallback: r } = Pt[e];
|
|
11094
|
+
const { color: t, fallback: r, bgVar: a } = Pt[e];
|
|
11090
11095
|
return {
|
|
11091
|
-
backgroundColor: `color-mix(in srgb, var(${t}, ${r}) 10%, transparent)`,
|
|
11096
|
+
backgroundColor: `var(${a}, color-mix(in srgb, var(${t}, ${r}) 10%, transparent))`,
|
|
11092
11097
|
border: `1px solid color-mix(in srgb, var(${t}, ${r}) 30%, transparent)`
|
|
11093
11098
|
};
|
|
11094
11099
|
}
|
|
@@ -11224,7 +11229,7 @@ const _t = ({
|
|
|
11224
11229
|
subtitle: t,
|
|
11225
11230
|
className: r = ""
|
|
11226
11231
|
}) => {
|
|
11227
|
-
const { currentTheme: a } = Oe(), { t: n } = Re(), l = e || (a == null ? void 0 : a.title) || "", s =
|
|
11232
|
+
const { currentTheme: a } = Oe(), { t: n } = Re(), l = e || (a == null ? void 0 : a.title) || "", s = pe(l, n), p = pe(t, n), m = !!(a != null && a.logo && a.logo.visible && a.logo.url), d = !!s;
|
|
11228
11233
|
return !m && !d ? null : /* @__PURE__ */ o("div", { className: `metakyc-header ${r}`, children: [
|
|
11229
11234
|
/* @__PURE__ */ o(
|
|
11230
11235
|
"div",
|
|
@@ -11437,7 +11442,7 @@ const ba = {
|
|
|
11437
11442
|
U.has(I) && c.add((C = lt[I]) == null ? void 0 : C.countriesType);
|
|
11438
11443
|
return c.size === 0 && c.add(void 0), Array.from(c);
|
|
11439
11444
|
}, [F, P]), [J, ae] = k({}), [x, A] = k(!0), V = de(/* @__PURE__ */ new Set()), Q = de(/* @__PURE__ */ new Set());
|
|
11440
|
-
|
|
11445
|
+
ve(() => {
|
|
11441
11446
|
if (!s) return;
|
|
11442
11447
|
const c = K.filter((I) => {
|
|
11443
11448
|
const N = I != null ? String(I) : "all";
|
|
@@ -11456,10 +11461,10 @@ const ba = {
|
|
|
11456
11461
|
try {
|
|
11457
11462
|
const I = await Promise.all(
|
|
11458
11463
|
c.map(async (N) => {
|
|
11459
|
-
const T = N != null ? String(N) : "all", ue = await l.getCountries("", n.locale || "en", N), le = N === 40, we = /* @__PURE__ */ new Set(), be = ue.map((
|
|
11460
|
-
value:
|
|
11461
|
-
label: `${
|
|
11462
|
-
} : { value:
|
|
11464
|
+
const T = N != null ? String(N) : "all", ue = await l.getCountries("", n.locale || "en", N), le = N === 40, we = /* @__PURE__ */ new Set(), be = ue.map((ke) => le && ke.countryCode ? {
|
|
11465
|
+
value: ke.countryCode,
|
|
11466
|
+
label: `${ke.countryCode} – ${ke.name}`
|
|
11467
|
+
} : { value: ke.abbreviation3 || ke.abbreviation, label: ke.name }).filter((ke) => !ke.value || we.has(ke.value) ? !1 : (we.add(ke.value), !0));
|
|
11463
11468
|
return Q.current.add(T), V.current.delete(T), [T, be];
|
|
11464
11469
|
})
|
|
11465
11470
|
);
|
|
@@ -11532,21 +11537,21 @@ const ba = {
|
|
|
11532
11537
|
taxNumber: "",
|
|
11533
11538
|
..._,
|
|
11534
11539
|
...oe
|
|
11535
|
-
}),
|
|
11540
|
+
}), ge = Object.fromEntries(
|
|
11536
11541
|
Object.entries(L).filter(([c]) => !(c in _) && c !== "externalRefId" && c !== "workflowKey")
|
|
11537
|
-
), [
|
|
11542
|
+
), [ye, xe] = k({ ...ge }), [me, D] = k(0), [E, O] = k({}), [he, se] = k(null), [j, ne] = k(!1), Z = (c, v) => Me((C) => ({ ...C, [c]: v })), Ie = (c, v) => xe((C) => ({ ...C, [c]: v })), ze = (c) => !c.conditionalOn || ye[c.conditionalOn] === "true", Ae = P && me < P.length - 1 ? me + 1 : -1, We = P && me > 0 ? me - 1 : -1, ct = (c) => {
|
|
11538
11543
|
const v = {};
|
|
11539
11544
|
for (const C of c.fields)
|
|
11540
11545
|
if (C.isCustom) {
|
|
11541
11546
|
if (C.customType === "paragraph" || C.customType === "html" || C.customType === "br" || C.customType === "link") continue;
|
|
11542
11547
|
if (C.required && C.paramName) {
|
|
11543
|
-
const I =
|
|
11548
|
+
const I = ye[C.paramName], N = pe(C.displayText, d) || pe(C.label, d) || C.paramName;
|
|
11544
11549
|
C.customType === "checkbox" || C.customType === "link_checkbox" ? I !== "true" && (v[C.paramName] = d("validation.fieldRequired", { field: N })) : (!I || I.trim() === "") && (v[C.paramName] = d("validation.fieldRequired", { field: N }));
|
|
11545
11550
|
}
|
|
11546
11551
|
} else if (C.name) {
|
|
11547
11552
|
const I = C.name;
|
|
11548
11553
|
if (B.includes(I) && ut(H[I])) {
|
|
11549
|
-
const N = lt[I], T =
|
|
11554
|
+
const N = lt[I], T = pe(C.displayText, d) || (N != null && N.translationKey ? d(`fields.${N.translationKey}`) : void 0) || (N == null ? void 0 : N.label) || I;
|
|
11550
11555
|
v[I] = d("validation.fieldRequired", { field: T });
|
|
11551
11556
|
}
|
|
11552
11557
|
}
|
|
@@ -11610,7 +11615,7 @@ const ba = {
|
|
|
11610
11615
|
if (ze(N))
|
|
11611
11616
|
for (const T of N.fields) {
|
|
11612
11617
|
if (!T.isCustom || !T.paramName || T.customType === "paragraph" || T.customType === "html" || T.customType === "br" || T.customType === "link") continue;
|
|
11613
|
-
const ue =
|
|
11618
|
+
const ue = ye[T.paramName] ?? "";
|
|
11614
11619
|
let le;
|
|
11615
11620
|
if (T.customType === "checkbox" || T.customType === "link_checkbox")
|
|
11616
11621
|
le = ue === "true" ? "yes" : "no";
|
|
@@ -11621,7 +11626,7 @@ const ba = {
|
|
|
11621
11626
|
for (const [N, T] of Object.entries(_))
|
|
11622
11627
|
c[N] === void 0 && !ut(T) && (c[N] = T);
|
|
11623
11628
|
const C = new Set(v.map((N) => N.paramName));
|
|
11624
|
-
for (const [N, T] of Object.entries(
|
|
11629
|
+
for (const [N, T] of Object.entries(ge))
|
|
11625
11630
|
!C.has(N) && T && v.push({ paramName: N, value: T });
|
|
11626
11631
|
v.length > 0 && (c.applicantAdditionalDatas = v);
|
|
11627
11632
|
const I = await p(c);
|
|
@@ -11644,7 +11649,7 @@ const ba = {
|
|
|
11644
11649
|
var Dt;
|
|
11645
11650
|
const T = lt[c];
|
|
11646
11651
|
if (!T) return null;
|
|
11647
|
-
const ue = B.includes(c), le = E[c], we =
|
|
11652
|
+
const ue = B.includes(c), le = E[c], we = pe(C, d) || (T.translationKey ? d(`fields.${T.translationKey}`) : void 0) || T.label, be = c in oe, ke = v ?? c, Ze = { required: ue }, Ye = N ? N !== "placeholder" : S, Je = Ye ? we : void 0;
|
|
11648
11653
|
switch (T.type) {
|
|
11649
11654
|
case "select":
|
|
11650
11655
|
if (c === "country" || c === "nationality" || c === "taxCountry" || c === "countryOfBirth" || c === "mobileCountryCode") {
|
|
@@ -11661,7 +11666,7 @@ const ba = {
|
|
|
11661
11666
|
readOnly: be,
|
|
11662
11667
|
error: le
|
|
11663
11668
|
},
|
|
11664
|
-
|
|
11669
|
+
ke
|
|
11665
11670
|
);
|
|
11666
11671
|
}
|
|
11667
11672
|
if (c === "salutation")
|
|
@@ -11681,7 +11686,7 @@ const ba = {
|
|
|
11681
11686
|
readOnly: be,
|
|
11682
11687
|
error: le
|
|
11683
11688
|
},
|
|
11684
|
-
|
|
11689
|
+
ke
|
|
11685
11690
|
);
|
|
11686
11691
|
if (c === "defaultLanguage") {
|
|
11687
11692
|
const Le = s != null && s.allowedLanguages && s.allowedLanguages.length > 0 ? Mt.filter((rt) => s.allowedLanguages.includes(rt.value)) : Mt;
|
|
@@ -11696,7 +11701,7 @@ const ba = {
|
|
|
11696
11701
|
readOnly: be,
|
|
11697
11702
|
error: le
|
|
11698
11703
|
},
|
|
11699
|
-
|
|
11704
|
+
ke
|
|
11700
11705
|
);
|
|
11701
11706
|
}
|
|
11702
11707
|
return null;
|
|
@@ -11715,7 +11720,7 @@ const ba = {
|
|
|
11715
11720
|
disabled: x,
|
|
11716
11721
|
readOnly: be
|
|
11717
11722
|
},
|
|
11718
|
-
|
|
11723
|
+
ke
|
|
11719
11724
|
);
|
|
11720
11725
|
}
|
|
11721
11726
|
return null;
|
|
@@ -11732,7 +11737,7 @@ const ba = {
|
|
|
11732
11737
|
readOnly: be,
|
|
11733
11738
|
error: le
|
|
11734
11739
|
},
|
|
11735
|
-
|
|
11740
|
+
ke
|
|
11736
11741
|
);
|
|
11737
11742
|
case "email":
|
|
11738
11743
|
return /* @__PURE__ */ i(
|
|
@@ -11747,7 +11752,7 @@ const ba = {
|
|
|
11747
11752
|
readOnly: be,
|
|
11748
11753
|
error: le
|
|
11749
11754
|
},
|
|
11750
|
-
|
|
11755
|
+
ke
|
|
11751
11756
|
);
|
|
11752
11757
|
case "tel":
|
|
11753
11758
|
return /* @__PURE__ */ i(
|
|
@@ -11762,7 +11767,7 @@ const ba = {
|
|
|
11762
11767
|
readOnly: be,
|
|
11763
11768
|
error: le
|
|
11764
11769
|
},
|
|
11765
|
-
|
|
11770
|
+
ke
|
|
11766
11771
|
);
|
|
11767
11772
|
default:
|
|
11768
11773
|
return /* @__PURE__ */ i(
|
|
@@ -11777,13 +11782,13 @@ const ba = {
|
|
|
11777
11782
|
readOnly: be,
|
|
11778
11783
|
error: le
|
|
11779
11784
|
},
|
|
11780
|
-
|
|
11785
|
+
ke
|
|
11781
11786
|
);
|
|
11782
11787
|
}
|
|
11783
11788
|
}, f = (c, v) => {
|
|
11784
11789
|
const C = c.labelMode ? c.labelMode !== "placeholder" : S;
|
|
11785
11790
|
if (c.customType === "paragraph") {
|
|
11786
|
-
const T =
|
|
11791
|
+
const T = pe(c.displayText, d) || pe(c.label, d) || "";
|
|
11787
11792
|
return /* @__PURE__ */ i(
|
|
11788
11793
|
"p",
|
|
11789
11794
|
{
|
|
@@ -11803,14 +11808,14 @@ const ba = {
|
|
|
11803
11808
|
return /* @__PURE__ */ i(
|
|
11804
11809
|
"div",
|
|
11805
11810
|
{
|
|
11806
|
-
dangerouslySetInnerHTML: { __html:
|
|
11811
|
+
dangerouslySetInnerHTML: { __html: pe(c.label, d) || "" }
|
|
11807
11812
|
},
|
|
11808
11813
|
`custom-${v}`
|
|
11809
11814
|
);
|
|
11810
11815
|
if (c.customType === "br")
|
|
11811
11816
|
return /* @__PURE__ */ i("div", { style: { height: "12px" } }, `custom-${v}`);
|
|
11812
11817
|
if (c.customType === "link") {
|
|
11813
|
-
const T =
|
|
11818
|
+
const T = pe(c.displayText, d) || pe(c.label, d) || c.linkText || c.linkUrl || "";
|
|
11814
11819
|
return /* @__PURE__ */ i("div", { className: "metakyc-link-field", children: /* @__PURE__ */ o(
|
|
11815
11820
|
"a",
|
|
11816
11821
|
{
|
|
@@ -11834,7 +11839,7 @@ const ba = {
|
|
|
11834
11839
|
) }, `custom-${v}`);
|
|
11835
11840
|
}
|
|
11836
11841
|
if (!c.paramName) return null;
|
|
11837
|
-
const I = E[c.paramName], N =
|
|
11842
|
+
const I = E[c.paramName], N = pe(c.displayText, d) || pe(c.label, d) || c.paramName;
|
|
11838
11843
|
if (c.customType === "checkbox")
|
|
11839
11844
|
return /* @__PURE__ */ o("div", { className: "flex flex-col gap-1", children: [
|
|
11840
11845
|
/* @__PURE__ */ o(
|
|
@@ -11846,7 +11851,7 @@ const ba = {
|
|
|
11846
11851
|
/* @__PURE__ */ i(
|
|
11847
11852
|
Ue,
|
|
11848
11853
|
{
|
|
11849
|
-
checked:
|
|
11854
|
+
checked: ye[c.paramName] === "true",
|
|
11850
11855
|
onChange: (T) => Ie(c.paramName, T ? "true" : "false")
|
|
11851
11856
|
}
|
|
11852
11857
|
),
|
|
@@ -11877,7 +11882,7 @@ const ba = {
|
|
|
11877
11882
|
/* @__PURE__ */ i(
|
|
11878
11883
|
Ue,
|
|
11879
11884
|
{
|
|
11880
|
-
checked:
|
|
11885
|
+
checked: ye[c.paramName] === "true",
|
|
11881
11886
|
onChange: (T) => Ie(c.paramName, T ? "true" : "false")
|
|
11882
11887
|
}
|
|
11883
11888
|
),
|
|
@@ -11911,7 +11916,7 @@ const ba = {
|
|
|
11911
11916
|
I && /* @__PURE__ */ i("p", { className: "text-xs mt-0.5", style: { color: "var(--metakyc-danger, #ef4444)" }, children: I })
|
|
11912
11917
|
] }, `custom-${v}`);
|
|
11913
11918
|
if (c.customType === "group_checkbox") {
|
|
11914
|
-
const T = (
|
|
11919
|
+
const T = (ye[c.paramName] || "").split(",").filter(Boolean);
|
|
11915
11920
|
return /* @__PURE__ */ o("div", { className: "flex flex-col gap-1.5", children: [
|
|
11916
11921
|
C && /* @__PURE__ */ o(
|
|
11917
11922
|
"div",
|
|
@@ -11925,7 +11930,7 @@ const ba = {
|
|
|
11925
11930
|
}
|
|
11926
11931
|
),
|
|
11927
11932
|
/* @__PURE__ */ i("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (c.options || []).map((ue) => {
|
|
11928
|
-
const le = c.singleSelect ?
|
|
11933
|
+
const le = c.singleSelect ? ye[c.paramName] === ue.value : T.includes(ue.value);
|
|
11929
11934
|
return /* @__PURE__ */ o(
|
|
11930
11935
|
"label",
|
|
11931
11936
|
{
|
|
@@ -11940,7 +11945,7 @@ const ba = {
|
|
|
11940
11945
|
if (c.singleSelect)
|
|
11941
11946
|
Ie(c.paramName, we ? ue.value : "");
|
|
11942
11947
|
else {
|
|
11943
|
-
const be = we ? [...T, ue.value] : T.filter((
|
|
11948
|
+
const be = we ? [...T, ue.value] : T.filter((ke) => ke !== ue.value);
|
|
11944
11949
|
Ie(c.paramName, be.join(","));
|
|
11945
11950
|
}
|
|
11946
11951
|
}
|
|
@@ -11984,7 +11989,7 @@ const ba = {
|
|
|
11984
11989
|
"input",
|
|
11985
11990
|
{
|
|
11986
11991
|
type: "radio",
|
|
11987
|
-
checked:
|
|
11992
|
+
checked: ye[c.paramName] === T.value,
|
|
11988
11993
|
onChange: () => Ie(c.paramName, T.value),
|
|
11989
11994
|
name: `radio-group-${c.paramName}-${v}`,
|
|
11990
11995
|
className: "metakyc-option-input",
|
|
@@ -12010,7 +12015,7 @@ const ba = {
|
|
|
12010
12015
|
type: "text",
|
|
12011
12016
|
label: C ? `${N}${c.required ? " *" : ""}` : void 0,
|
|
12012
12017
|
placeholder: C ? void 0 : N,
|
|
12013
|
-
value:
|
|
12018
|
+
value: ye[c.paramName] || "",
|
|
12014
12019
|
onChange: (T) => Ie(c.paramName, T.target.value),
|
|
12015
12020
|
required: c.required,
|
|
12016
12021
|
error: I
|
|
@@ -12066,7 +12071,7 @@ const ba = {
|
|
|
12066
12071
|
{
|
|
12067
12072
|
className: "font-semibold text-base",
|
|
12068
12073
|
style: { color: "var(--metakyc-text-primary, #111827)" },
|
|
12069
|
-
children: c.title
|
|
12074
|
+
children: pe(c.title, d)
|
|
12070
12075
|
}
|
|
12071
12076
|
),
|
|
12072
12077
|
c.subtitle && /* @__PURE__ */ i(
|
|
@@ -12074,7 +12079,7 @@ const ba = {
|
|
|
12074
12079
|
{
|
|
12075
12080
|
className: "text-sm mt-0.5",
|
|
12076
12081
|
style: { color: "var(--metakyc-text-secondary, #6b7280)" },
|
|
12077
|
-
children: c.subtitle
|
|
12082
|
+
children: pe(c.subtitle, d)
|
|
12078
12083
|
}
|
|
12079
12084
|
),
|
|
12080
12085
|
c.description && c.description !== c.subtitle && /* @__PURE__ */ i(
|
|
@@ -12082,7 +12087,7 @@ const ba = {
|
|
|
12082
12087
|
{
|
|
12083
12088
|
className: "text-xs mt-1",
|
|
12084
12089
|
style: { color: "var(--metakyc-text-secondary, #6b7280)" },
|
|
12085
|
-
children: c.description
|
|
12090
|
+
children: pe(c.description, d)
|
|
12086
12091
|
}
|
|
12087
12092
|
)
|
|
12088
12093
|
] }),
|
|
@@ -12105,14 +12110,14 @@ const ba = {
|
|
|
12105
12110
|
I
|
|
12106
12111
|
] })
|
|
12107
12112
|
] }),
|
|
12108
|
-
(
|
|
12109
|
-
backgroundColor: "color-mix(in srgb, var(--metakyc-danger, #ef4444) 10%, transparent)",
|
|
12113
|
+
(he || T.length > 0) && /* @__PURE__ */ o("div", { className: "mb-4 p-3 rounded-lg", style: {
|
|
12114
|
+
backgroundColor: "var(--metakyc-danger-bg, color-mix(in srgb, var(--metakyc-danger, #ef4444) 10%, transparent))",
|
|
12110
12115
|
border: "1px solid color-mix(in srgb, var(--metakyc-danger, #ef4444) 30%, transparent)"
|
|
12111
12116
|
}, children: [
|
|
12112
|
-
|
|
12117
|
+
he && /* @__PURE__ */ o("p", { className: "text-sm", style: { color: "var(--metakyc-danger, #ef4444)" }, children: [
|
|
12113
12118
|
/* @__PURE__ */ i("strong", { children: d("common.errorPrefix") }),
|
|
12114
12119
|
" ",
|
|
12115
|
-
|
|
12120
|
+
he
|
|
12116
12121
|
] }),
|
|
12117
12122
|
T.map((ue, le) => /* @__PURE__ */ i("p", { className: "text-sm", style: { color: "var(--metakyc-danger, #ef4444)" }, children: ue }, le))
|
|
12118
12123
|
] }),
|
|
@@ -12149,13 +12154,13 @@ const ba = {
|
|
|
12149
12154
|
return /* @__PURE__ */ i("div", { className: "metakyc-sdk", children: /* @__PURE__ */ i("form", { onSubmit: dt, children: /* @__PURE__ */ o(ie, { children: [
|
|
12150
12155
|
/* @__PURE__ */ i(Ne, { children: /* @__PURE__ */ i(vt, { title: (s == null ? void 0 : s.title) || d("createApplicant.title") }) }),
|
|
12151
12156
|
/* @__PURE__ */ o(re, { children: [
|
|
12152
|
-
|
|
12153
|
-
backgroundColor: "color-mix(in srgb, var(--metakyc-danger, #ef4444) 10%, transparent)",
|
|
12157
|
+
he && /* @__PURE__ */ i("div", { className: "mb-6 p-4 rounded-lg", style: {
|
|
12158
|
+
backgroundColor: "var(--metakyc-danger-bg, color-mix(in srgb, var(--metakyc-danger, #ef4444) 10%, transparent))",
|
|
12154
12159
|
border: "1px solid color-mix(in srgb, var(--metakyc-danger, #ef4444) 30%, transparent)"
|
|
12155
12160
|
}, children: /* @__PURE__ */ o("p", { className: "text-sm", style: { color: "var(--metakyc-danger, #ef4444)" }, children: [
|
|
12156
12161
|
/* @__PURE__ */ i("strong", { children: d("common.errorPrefix") }),
|
|
12157
12162
|
" ",
|
|
12158
|
-
|
|
12163
|
+
he
|
|
12159
12164
|
] }) }),
|
|
12160
12165
|
/* @__PURE__ */ i("div", { style: { display: "grid", gridTemplateColumns: "repeat(4, minmax(0, 1fr))", gap: "1rem" }, children: F.map((c) => /* @__PURE__ */ i("div", { style: { gridColumn: "span 4 / span 4" }, children: Xe(c) }, c)) })
|
|
12161
12166
|
] }),
|
|
@@ -12211,7 +12216,7 @@ const qa = ({
|
|
|
12211
12216
|
F.has(u) && g.add((w = mt[u]) == null ? void 0 : w.countriesType);
|
|
12212
12217
|
return g.size === 0 && g.add(void 0), Array.from(g);
|
|
12213
12218
|
}, [B, S]), [K, J] = k({}), [ae, x] = k(!0), A = de(/* @__PURE__ */ new Set()), V = de(/* @__PURE__ */ new Set());
|
|
12214
|
-
|
|
12219
|
+
ve(() => {
|
|
12215
12220
|
if (!s) return;
|
|
12216
12221
|
const g = U.filter((u) => {
|
|
12217
12222
|
const c = u != null ? String(u) : "all";
|
|
@@ -12288,28 +12293,28 @@ const qa = ({
|
|
|
12288
12293
|
lei: "",
|
|
12289
12294
|
externalRefId: h,
|
|
12290
12295
|
...W
|
|
12291
|
-
}), [H, Me] = k({}), [
|
|
12296
|
+
}), [H, Me] = k({}), [ge, ye] = k(0), [xe, me] = k({}), [D, E] = k(null), [O, he] = k(!1), se = (g, z) => oe((w) => ({ ...w, [g]: z })), j = (g, z) => Me((w) => ({ ...w, [g]: z })), ne = (g) => !g.conditionalOn || H[g.conditionalOn] === "true", Z = S && ge < S.length - 1 ? ge + 1 : -1, Ie = S && ge > 0 ? ge - 1 : -1, ze = (g) => {
|
|
12292
12297
|
const z = {};
|
|
12293
12298
|
for (const w of g.fields)
|
|
12294
12299
|
if (w.isCustom) {
|
|
12295
12300
|
if (w.customType === "paragraph" || w.customType === "html" || w.customType === "br" || w.customType === "link") continue;
|
|
12296
12301
|
if (w.required && w.paramName) {
|
|
12297
|
-
const u = H[w.paramName], c =
|
|
12302
|
+
const u = H[w.paramName], c = pe(w.displayText, d) || pe(w.label, d) || w.paramName;
|
|
12298
12303
|
w.customType === "checkbox" || w.customType === "link_checkbox" ? u !== "true" && (z[w.paramName] = d("validation.fieldRequired", { field: c })) : (!u || u.trim() === "") && (z[w.paramName] = d("validation.fieldRequired", { field: c }));
|
|
12299
12304
|
}
|
|
12300
12305
|
} else if (w.name) {
|
|
12301
12306
|
const u = w.name;
|
|
12302
12307
|
if (P.includes(u) && Rt(_[u])) {
|
|
12303
|
-
const c = mt[u], v =
|
|
12308
|
+
const c = mt[u], v = pe(w.displayText, d) || (c != null && c.translationKey ? d(`fields.${c.translationKey}`) : void 0) || (c == null ? void 0 : c.label) || u;
|
|
12304
12309
|
z[u] = d("validation.fieldRequired", { field: v });
|
|
12305
12310
|
}
|
|
12306
12311
|
}
|
|
12307
12312
|
return z;
|
|
12308
12313
|
}, Ae = async () => {
|
|
12309
12314
|
if (!S) return;
|
|
12310
|
-
const g = S[
|
|
12315
|
+
const g = S[ge];
|
|
12311
12316
|
if (g.conditionalOn && !ne(g)) {
|
|
12312
|
-
me({}), Z >= 0 ?
|
|
12317
|
+
me({}), Z >= 0 ? ye(Z) : await We();
|
|
12313
12318
|
return;
|
|
12314
12319
|
}
|
|
12315
12320
|
const z = ze(g);
|
|
@@ -12317,7 +12322,7 @@ const qa = ({
|
|
|
12317
12322
|
me(z);
|
|
12318
12323
|
return;
|
|
12319
12324
|
}
|
|
12320
|
-
me({}), Z >= 0 ?
|
|
12325
|
+
me({}), Z >= 0 ? ye(Z) : await We();
|
|
12321
12326
|
}, We = async () => {
|
|
12322
12327
|
var g;
|
|
12323
12328
|
if (S) {
|
|
@@ -12329,7 +12334,7 @@ const qa = ({
|
|
|
12329
12334
|
return;
|
|
12330
12335
|
}
|
|
12331
12336
|
}
|
|
12332
|
-
|
|
12337
|
+
he(!0), E(null);
|
|
12333
12338
|
try {
|
|
12334
12339
|
const z = {
|
|
12335
12340
|
workflowKey: _.workflowKey,
|
|
@@ -12388,7 +12393,7 @@ const qa = ({
|
|
|
12388
12393
|
} catch (z) {
|
|
12389
12394
|
console.error("Error creating company applicant:", z), E(z.message || d("createCompany.failedToCreate"));
|
|
12390
12395
|
} finally {
|
|
12391
|
-
|
|
12396
|
+
he(!1);
|
|
12392
12397
|
}
|
|
12393
12398
|
}, ct = async (g) => {
|
|
12394
12399
|
g.preventDefault();
|
|
@@ -12402,7 +12407,7 @@ const qa = ({
|
|
|
12402
12407
|
}, it = (g, z, w, u, c) => {
|
|
12403
12408
|
const v = mt[g];
|
|
12404
12409
|
if (!v) return null;
|
|
12405
|
-
const C = P.includes(g), I = xe[g], N =
|
|
12410
|
+
const C = P.includes(g), I = xe[g], N = pe(w, d) || (v.translationKey ? d(`fields.${v.translationKey}`) : void 0) || v.label, T = g in W, ue = z ?? g, le = c ? c !== "placeholder" : q, we = le ? N : void 0;
|
|
12406
12411
|
switch (v.type) {
|
|
12407
12412
|
case "select":
|
|
12408
12413
|
if (g === "countryResidence" || g === "addressCountry") {
|
|
@@ -12413,7 +12418,7 @@ const qa = ({
|
|
|
12413
12418
|
required: C,
|
|
12414
12419
|
label: we,
|
|
12415
12420
|
value: _[g] || "",
|
|
12416
|
-
onChange: (
|
|
12421
|
+
onChange: (ke) => se(g, ke),
|
|
12417
12422
|
options: [{ value: "", label: le ? d("placeholders.selectCountry") : N }, ...be],
|
|
12418
12423
|
disabled: ae,
|
|
12419
12424
|
readOnly: T,
|
|
@@ -12490,12 +12495,12 @@ const qa = ({
|
|
|
12490
12495
|
"p",
|
|
12491
12496
|
{
|
|
12492
12497
|
style: { fontSize: "14px", lineHeight: "1.7", margin: 0, color: "var(--metakyc-text-secondary, #6b7280)" },
|
|
12493
|
-
dangerouslySetInnerHTML: { __html:
|
|
12498
|
+
dangerouslySetInnerHTML: { __html: pe(g.displayText, d) || pe(g.label, d) || "" }
|
|
12494
12499
|
},
|
|
12495
12500
|
`custom-${z}`
|
|
12496
12501
|
);
|
|
12497
12502
|
if (g.customType === "html")
|
|
12498
|
-
return /* @__PURE__ */ i("div", { dangerouslySetInnerHTML: { __html:
|
|
12503
|
+
return /* @__PURE__ */ i("div", { dangerouslySetInnerHTML: { __html: pe(g.label, d) || "" } }, `custom-${z}`);
|
|
12499
12504
|
if (g.customType === "br")
|
|
12500
12505
|
return /* @__PURE__ */ i("div", { style: { height: "12px" } }, `custom-${z}`);
|
|
12501
12506
|
if (g.customType === "link")
|
|
@@ -12506,11 +12511,11 @@ const qa = ({
|
|
|
12506
12511
|
target: "_blank",
|
|
12507
12512
|
rel: "noopener noreferrer",
|
|
12508
12513
|
style: { color: "var(--metakyc-primary, #2563eb)", fontSize: "14px", textDecoration: "underline" },
|
|
12509
|
-
children:
|
|
12514
|
+
children: pe(g.displayText, d) || pe(g.label, d) || g.linkText || g.linkUrl || ""
|
|
12510
12515
|
}
|
|
12511
12516
|
) }, `custom-${z}`);
|
|
12512
12517
|
if (!g.paramName) return null;
|
|
12513
|
-
const w = xe[g.paramName], u =
|
|
12518
|
+
const w = xe[g.paramName], u = pe(g.displayText, d) || pe(g.label, d) || g.paramName, c = g.labelMode ? g.labelMode !== "placeholder" : q;
|
|
12514
12519
|
return g.customType === "checkbox" ? /* @__PURE__ */ o("div", { className: "flex flex-col gap-1", children: [
|
|
12515
12520
|
/* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer" }, children: [
|
|
12516
12521
|
/* @__PURE__ */ i(
|
|
@@ -12564,16 +12569,16 @@ const qa = ({
|
|
|
12564
12569
|
/* @__PURE__ */ i("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: d("common.loadingForm") })
|
|
12565
12570
|
] }) }) });
|
|
12566
12571
|
if (S) {
|
|
12567
|
-
const g = S[
|
|
12572
|
+
const g = S[ge] ?? S[0], z = Ie === -1, w = Z === -1, u = S.length, c = ne(g), v = Object.values(xe);
|
|
12568
12573
|
return /* @__PURE__ */ i("div", { className: "metakyc-sdk", children: /* @__PURE__ */ o(ie, { children: [
|
|
12569
12574
|
/* @__PURE__ */ i(Ne, { children: /* @__PURE__ */ i(vt, { title: (s == null ? void 0 : s.title) || d("createCompany.title") }) }),
|
|
12570
12575
|
/* @__PURE__ */ o(re, { children: [
|
|
12571
12576
|
(g.title || g.subtitle) && /* @__PURE__ */ o("div", { className: "mb-4", children: [
|
|
12572
|
-
g.title && /* @__PURE__ */ i("h3", { className: "font-semibold text-base", style: { color: "var(--metakyc-text-primary, #111827)" }, children: g.title }),
|
|
12573
|
-
g.subtitle && /* @__PURE__ */ i("p", { className: "text-sm mt-0.5", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: g.subtitle })
|
|
12577
|
+
g.title && /* @__PURE__ */ i("h3", { className: "font-semibold text-base", style: { color: "var(--metakyc-text-primary, #111827)" }, children: pe(g.title, d) }),
|
|
12578
|
+
g.subtitle && /* @__PURE__ */ i("p", { className: "text-sm mt-0.5", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: pe(g.subtitle, d) })
|
|
12574
12579
|
] }),
|
|
12575
12580
|
(D || v.length > 0) && /* @__PURE__ */ o("div", { className: "mb-4 p-3 rounded-lg", style: {
|
|
12576
|
-
backgroundColor: "color-mix(in srgb, var(--metakyc-danger, #ef4444) 10%, transparent)",
|
|
12581
|
+
backgroundColor: "var(--metakyc-danger-bg, color-mix(in srgb, var(--metakyc-danger, #ef4444) 10%, transparent))",
|
|
12577
12582
|
border: "1px solid color-mix(in srgb, var(--metakyc-danger, #ef4444) 30%, transparent)"
|
|
12578
12583
|
}, children: [
|
|
12579
12584
|
D && /* @__PURE__ */ o("p", { className: "text-sm", style: { color: "var(--metakyc-danger, #ef4444)" }, children: [
|
|
@@ -12591,13 +12596,13 @@ const qa = ({
|
|
|
12591
12596
|
height: "0.375rem",
|
|
12592
12597
|
borderRadius: "9999px",
|
|
12593
12598
|
transition: "all 150ms",
|
|
12594
|
-
...I ===
|
|
12599
|
+
...I === ge ? { flex: "1 1 0%", backgroundColor: "var(--metakyc-primary, #2563eb)", opacity: 0.3 } : I < ge ? { width: "2rem", backgroundColor: "var(--metakyc-primary-light, #93c5fd)", opacity: 0.7 } : { width: "2rem", backgroundColor: "#e5e7eb", opacity: 0.3 }
|
|
12595
12600
|
}
|
|
12596
12601
|
},
|
|
12597
12602
|
I
|
|
12598
12603
|
)),
|
|
12599
12604
|
/* @__PURE__ */ o("span", { style: { fontSize: "0.75rem", color: "var(--metakyc-text-muted, #9ca3af)", flexShrink: 0 }, children: [
|
|
12600
|
-
|
|
12605
|
+
ge + 1,
|
|
12601
12606
|
" / ",
|
|
12602
12607
|
u
|
|
12603
12608
|
] })
|
|
@@ -12612,7 +12617,7 @@ const qa = ({
|
|
|
12612
12617
|
type: "button",
|
|
12613
12618
|
variant: "outline",
|
|
12614
12619
|
onClick: () => {
|
|
12615
|
-
|
|
12620
|
+
ye(Ie), me({});
|
|
12616
12621
|
},
|
|
12617
12622
|
disabled: O || m,
|
|
12618
12623
|
children: d("common.previous")
|
|
@@ -12628,7 +12633,7 @@ const qa = ({
|
|
|
12628
12633
|
/* @__PURE__ */ i(Ne, { children: /* @__PURE__ */ i(vt, { title: (s == null ? void 0 : s.title) || d("createCompany.title") }) }),
|
|
12629
12634
|
/* @__PURE__ */ o(re, { children: [
|
|
12630
12635
|
D && /* @__PURE__ */ i("div", { className: "mb-6 p-4 rounded-lg", style: {
|
|
12631
|
-
backgroundColor: "color-mix(in srgb, var(--metakyc-danger, #ef4444) 10%, transparent)",
|
|
12636
|
+
backgroundColor: "var(--metakyc-danger-bg, color-mix(in srgb, var(--metakyc-danger, #ef4444) 10%, transparent))",
|
|
12632
12637
|
border: "1px solid color-mix(in srgb, var(--metakyc-danger, #ef4444) 30%, transparent)"
|
|
12633
12638
|
}, children: /* @__PURE__ */ o("p", { className: "text-sm", style: { color: "var(--metakyc-danger, #ef4444)" }, children: [
|
|
12634
12639
|
/* @__PURE__ */ i("strong", { children: d("common.errorPrefix") }),
|
|
@@ -13080,7 +13085,7 @@ export {
|
|
|
13080
13085
|
Ki as minimalTheme,
|
|
13081
13086
|
Wi as modernTheme,
|
|
13082
13087
|
Ea as removeScript,
|
|
13083
|
-
|
|
13088
|
+
pe as resolveDisplayText,
|
|
13084
13089
|
Rr as saveApplicantId,
|
|
13085
13090
|
zr as saveWorkflowState,
|
|
13086
13091
|
Yi as themePresets,
|