@vpdev2/metakyc 1.0.66 → 1.0.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -316,13 +316,13 @@ class Ji {
316
316
  const d = (async () => {
317
317
  var u;
318
318
  try {
319
- const f = await this.axiosInstance.get(n, {
319
+ const g = await this.axiosInstance.get(n, {
320
320
  params: r
321
321
  }), p = Math.round(performance.now() - c);
322
- return H.response("GET", n, f.status, p, (u = f.data) == null ? void 0 : u.result), this.handleResponse(f);
323
- } catch (f) {
322
+ return H.response("GET", n, g.status, p, (u = g.data) == null ? void 0 : u.result), this.handleResponse(g);
323
+ } catch (g) {
324
324
  const p = Math.round(performance.now() - c);
325
- throw H.error("GET", n, f, p), Ct.handleAxiosError(f);
325
+ throw H.error("GET", n, g, p), Ct.handleAxiosError(g);
326
326
  } finally {
327
327
  setTimeout(() => this.inflightGets.delete(o), ti);
328
328
  }
@@ -379,7 +379,7 @@ class Ji {
379
379
  }
380
380
  class pn {
381
381
  static async createToken(t) {
382
- const { baseUrl: a, apiKey: r, secretKey: n, tenantId: o, clientId: l, externalRefId: c, workflowKey: d, email: u, isCompany: f, applicant: p } = t;
382
+ const { baseUrl: a, apiKey: r, secretKey: n, tenantId: o, clientId: l, externalRefId: c, workflowKey: d, email: u, isCompany: g, applicant: p } = t;
383
383
  if (!o && !l)
384
384
  throw new Error("Either tenantId or clientId must be provided.");
385
385
  if (!c)
@@ -395,7 +395,7 @@ class pn {
395
395
  workflowKey: d,
396
396
  email: u
397
397
  };
398
- o != null && (C.tenantId = o), l && (C.clientId = l), f != null && (C.isCompany = f), p && (C.applicant = p);
398
+ o != null && (C.tenantId = o), l && (C.clientId = l), g != null && (C.isCompany = g), p && (C.applicant = p);
399
399
  const x = (await ki.post(
400
400
  `${a.replace(/\/+$/, "")}/api/SdkSession/CreateToken`,
401
401
  C,
@@ -6917,7 +6917,7 @@ function oe(e, t) {
6917
6917
  const r = $r.exec(a);
6918
6918
  return r ? t(r[1]) : e;
6919
6919
  }
6920
- const $t = "1.0.66", wi = Ht(null), oi = `metakyc-translations-${$t}-`, Yr = ({
6920
+ const $t = "1.0.67", wi = Ht(null), oi = `metakyc-translations-${$t}-`, Yr = ({
6921
6921
  locale: e,
6922
6922
  fetchTranslations: t,
6923
6923
  children: a
@@ -6942,7 +6942,7 @@ const $t = "1.0.66", wi = Ht(null), oi = `metakyc-translations-${$t}-`, Yr = ({
6942
6942
  return;
6943
6943
  }
6944
6944
  H.debug(`Remote translation overrides loaded for locale: ${r}`);
6945
- const f = Wt(r), p = ri(f, u);
6945
+ const g = Wt(r), p = ri(g, u);
6946
6946
  l(p);
6947
6947
  try {
6948
6948
  localStorage.setItem(oi + r, JSON.stringify(u));
@@ -6984,7 +6984,7 @@ const li = "metakyc-theme-cache", yn = ({ config: e, children: t }) => {
6984
6984
  _r();
6985
6985
  const [a, r] = w(null), n = we.useRef(!1), o = we.useRef(!1), l = Ye(() => {
6986
6986
  H.setLevel(e.debug ?? e.logLevel ?? "none"), H.info(`SDK v${$t} initializing — baseUrl=${e.baseUrl}`);
6987
- const u = new Ji(e), f = new er(u), p = new tr(u), C = new ir(u), N = new rr(u), x = new ar(u), F = new nr(u), T = new or(u), $ = new sr(u), U = new lr(u), P = new fr(u), D = new yr(u), B = new Tr();
6987
+ const u = new Ji(e), g = new er(u), p = new tr(u), C = new ir(u), N = new rr(u), x = new ar(u), F = new nr(u), T = new or(u), $ = new sr(u), U = new lr(u), P = new fr(u), D = new yr(u), B = new Tr();
6988
6988
  if (typeof document < "u")
6989
6989
  if (e.theme)
6990
6990
  B.applyTheme(e.theme);
@@ -6997,7 +6997,7 @@ const li = "metakyc-theme-cache", yn = ({ config: e, children: t }) => {
6997
6997
  }
6998
6998
  return {
6999
6999
  httpClient: u,
7000
- applicantService: f,
7000
+ applicantService: g,
7001
7001
  questionnaireService: p,
7002
7002
  uploadDocumentService: C,
7003
7003
  appropriatenessTestService: N,
@@ -7037,10 +7037,10 @@ const li = "metakyc-theme-cache", yn = ({ config: e, children: t }) => {
7037
7037
  return;
7038
7038
  }
7039
7039
  H.debug("Fetching theme from backend...");
7040
- const f = await l.themeService.getThemeConfiguration(e.configVersion);
7041
- l.themeManager.applyTheme(f), r(l.themeManager.getCurrentTheme()), o.current = !0;
7040
+ const g = await l.themeService.getThemeConfiguration(e.configVersion);
7041
+ l.themeManager.applyTheme(g), r(l.themeManager.getCurrentTheme()), o.current = !0;
7042
7042
  try {
7043
- localStorage.setItem(li, JSON.stringify(f));
7043
+ localStorage.setItem(li, JSON.stringify(g));
7044
7044
  } catch {
7045
7045
  }
7046
7046
  H.info("Theme loaded and applied");
@@ -7166,40 +7166,40 @@ function Sn() {
7166
7166
  Qr(), Zr();
7167
7167
  }
7168
7168
  function Jr(e) {
7169
- const { createOrchestrator: t, config: a } = Ee(), [r, n] = w(null), [o, l] = w(!1), [c, d] = w(null), u = be(null), f = e || a.applicantId || void 0;
7169
+ const { createOrchestrator: t, config: a } = Ee(), [r, n] = w(null), [o, l] = w(!1), [c, d] = w(null), u = be(null), g = e || a.applicantId || void 0;
7170
7170
  Ne(() => {
7171
7171
  u.current || (u.current = t());
7172
7172
  }, [t]), Ne(() => {
7173
7173
  var D;
7174
- r && f && Xr({
7175
- applicantId: f,
7174
+ r && g && Xr({
7175
+ applicantId: g,
7176
7176
  currentStepOrder: (D = r.currentStep) == null ? void 0 : D.order,
7177
7177
  status: r.status,
7178
7178
  lastUpdated: (/* @__PURE__ */ new Date()).toISOString(),
7179
7179
  workflowKey: r.workFlowKey,
7180
7180
  nextWorkflowKey: r.nextWorkflowKey
7181
7181
  });
7182
- }, [r, f]);
7183
- const p = be(!1), C = be(!1), N = ee(async () => {
7184
- if (!(!f || !u.current)) {
7182
+ }, [r, g]);
7183
+ const p = be(!1), C = be(void 0), N = ee(async () => {
7184
+ if (!(!g || !u.current)) {
7185
7185
  if (p.current) {
7186
7186
  H.debug("Workflow load already in progress, skipping");
7187
7187
  return;
7188
7188
  }
7189
7189
  p.current = !0, l(!0), d(null);
7190
7190
  try {
7191
- const D = await u.current.initialize(f);
7192
- n(D), C.current = !0;
7191
+ const D = await u.current.initialize(g);
7192
+ n(D), C.current = g;
7193
7193
  } catch (D) {
7194
7194
  d(D);
7195
7195
  } finally {
7196
7196
  l(!1), p.current = !1;
7197
7197
  }
7198
7198
  }
7199
- }, [f]);
7199
+ }, [g]);
7200
7200
  Ne(() => {
7201
- f && !C.current && N();
7202
- }, [f, N]);
7201
+ g && C.current !== g && N();
7202
+ }, [g, N]);
7203
7203
  const x = ee(async () => {
7204
7204
  if (u.current) {
7205
7205
  if (p.current) {
@@ -7256,7 +7256,7 @@ function Jr(e) {
7256
7256
  }, []), U = Zt.useMemo(() => r != null && r.stepInfoList ? [...r.stepInfoList].sort((D, B) => D.order - B.order) : [], [r == null ? void 0 : r.stepInfoList]), P = Zt.useMemo(() => r ? r.nextWorkflowKey && r.nextWorkflowKey !== r.workFlowKey : !1, [r]);
7257
7257
  return {
7258
7258
  progress: r,
7259
- applicantId: f,
7259
+ applicantId: g,
7260
7260
  currentStep: (r == null ? void 0 : r.currentStep) || null,
7261
7261
  steps: U,
7262
7262
  status: (r == null ? void 0 : r.status) || Xe.None,
@@ -7277,7 +7277,7 @@ function Jr(e) {
7277
7277
  }
7278
7278
  function ea(e) {
7279
7279
  var B;
7280
- const { applicantService: t, config: a } = Ee(), [r, n] = w(null), [o, l] = w(!0), [c, d] = w(null), [u, f] = w(), [p, C] = w(), N = be(!1), x = ee(async () => {
7280
+ const { applicantService: t, config: a } = Ee(), [r, n] = w(null), [o, l] = w(!0), [c, d] = w(null), [u, g] = w(), [p, C] = w(), N = be(!1), x = ee(async () => {
7281
7281
  try {
7282
7282
  l(!0), d(null);
7283
7283
  const _ = await t.getSdkState();
@@ -7292,9 +7292,9 @@ function ea(e) {
7292
7292
  N.current || x();
7293
7293
  }, [x]);
7294
7294
  const F = ee((_) => {
7295
- H.info(`Transitioning to workflow → applicantId=${_}`), f(_), C("workflow");
7295
+ H.info(`Transitioning to workflow → applicantId=${_}`), g(_), C("workflow");
7296
7296
  }, []), T = ee((_) => {
7297
- H.info(`Switching applicant → newApplicantId=${_}`), f(_), C("workflow");
7297
+ H.info(`Switching applicant → newApplicantId=${_}`), g(_), C("workflow");
7298
7298
  }, []), $ = p || (r == null ? void 0 : r.phase) || "loading", U = u || (r == null ? void 0 : r.applicantId), P = e ?? (r == null ? void 0 : r.isCompany) ?? !1, D = (r == null ? void 0 : r.workflowKey) || ((B = a.applicantForm) == null ? void 0 : B.workflowKey);
7299
7299
  return {
7300
7300
  phase: c ? "error" : o ? "loading" : $,
@@ -7309,7 +7309,7 @@ function ea(e) {
7309
7309
  };
7310
7310
  }
7311
7311
  function ta(e) {
7312
- const { questionnaireService: t, applicantService: a } = Ee(), [r, n] = w(null), [o, l] = w({}), [c, d] = w(!1), [u, f] = w(!1), [p, C] = w(null), N = be(!1), x = be(null), F = ee(async () => {
7312
+ const { questionnaireService: t, applicantService: a } = Ee(), [r, n] = w(null), [o, l] = w({}), [c, d] = w(!1), [u, g] = w(!1), [p, C] = w(null), N = be(!1), x = be(null), F = ee(async () => {
7313
7313
  var $, U;
7314
7314
  if (e) {
7315
7315
  if (N.current) {
@@ -7346,13 +7346,13 @@ function ta(e) {
7346
7346
  }, [e]);
7347
7347
  const T = ee(
7348
7348
  async ($) => {
7349
- f(!0), C(null);
7349
+ g(!0), C(null);
7350
7350
  try {
7351
7351
  return await t.fillQuestionnaire($);
7352
7352
  } catch (U) {
7353
7353
  throw C(U), U;
7354
7354
  } finally {
7355
- f(!1);
7355
+ g(!1);
7356
7356
  }
7357
7357
  },
7358
7358
  [t]
@@ -7368,7 +7368,7 @@ function ta(e) {
7368
7368
  };
7369
7369
  }
7370
7370
  function ia(e) {
7371
- const { uploadDocumentService: t } = Ee(), [a, r] = w(null), [n, o] = w(!1), [l, c] = w(!1), [d, u] = w(0), [f, p] = w(null), C = be(!1), N = be(null), x = ee(async () => {
7371
+ const { uploadDocumentService: t } = Ee(), [a, r] = w(null), [n, o] = w(!1), [l, c] = w(!1), [d, u] = w(0), [g, p] = w(null), C = be(!1), N = be(null), x = ee(async () => {
7372
7372
  if (e) {
7373
7373
  if (C.current) {
7374
7374
  H.debug("UploadDocument load already in progress, skipping");
@@ -7406,13 +7406,13 @@ function ia(e) {
7406
7406
  isLoading: n,
7407
7407
  isSubmitting: l,
7408
7408
  uploadProgress: d,
7409
- error: f,
7409
+ error: g,
7410
7410
  load: x,
7411
7411
  submit: F
7412
7412
  };
7413
7413
  }
7414
7414
  function Cn(e) {
7415
- const { appropriatenessTestService: t } = Ee(), [a, r] = w(null), [n, o] = w(!1), [l, c] = w(!1), [d, u] = w(null), [f, p] = w(null), C = be(!1), N = be(null), x = ee(async () => {
7415
+ const { appropriatenessTestService: t } = Ee(), [a, r] = w(null), [n, o] = w(!1), [l, c] = w(!1), [d, u] = w(null), [g, p] = w(null), C = be(!1), N = be(null), x = ee(async () => {
7416
7416
  if (e) {
7417
7417
  if (C.current) {
7418
7418
  H.debug("AppropriatenessTest load already in progress, skipping");
@@ -7448,7 +7448,7 @@ function Cn(e) {
7448
7448
  );
7449
7449
  return {
7450
7450
  test: a,
7451
- result: f,
7451
+ result: g,
7452
7452
  isLoading: n,
7453
7453
  isSubmitting: l,
7454
7454
  error: d,
@@ -7457,20 +7457,20 @@ function Cn(e) {
7457
7457
  };
7458
7458
  }
7459
7459
  function ra(e) {
7460
- const { overviewService: t } = Ee(), [a, r] = w(null), [n, o] = w(!1), [l, c] = w(!1), [d, u] = w(null), f = be(!1), p = be(null), C = ee(async () => {
7460
+ const { overviewService: t } = Ee(), [a, r] = w(null), [n, o] = w(!1), [l, c] = w(!1), [d, u] = w(null), g = be(!1), p = be(null), C = ee(async () => {
7461
7461
  if (e) {
7462
- if (f.current) {
7462
+ if (g.current) {
7463
7463
  H.debug("Overview load already in progress, skipping");
7464
7464
  return;
7465
7465
  }
7466
- f.current = !0, o(!0), u(null);
7466
+ g.current = !0, o(!0), u(null);
7467
7467
  try {
7468
7468
  const x = await t.getOverviewData(e);
7469
7469
  r(x), p.current = e;
7470
7470
  } catch (x) {
7471
7471
  u(x);
7472
7472
  } finally {
7473
- o(!1), f.current = !1;
7473
+ o(!1), g.current = !1;
7474
7474
  }
7475
7475
  }
7476
7476
  }, [e, t]);
@@ -7527,7 +7527,7 @@ function aa(e) {
7527
7527
  }
7528
7528
  },
7529
7529
  [e, t]
7530
- ), f = ee(
7530
+ ), g = ee(
7531
7531
  async (C, N) => {
7532
7532
  if (e) {
7533
7533
  o(!0), c(null);
@@ -7578,12 +7578,12 @@ function aa(e) {
7578
7578
  isLoading: n,
7579
7579
  error: l,
7580
7580
  requestIdentity: u,
7581
- requestCompanyIdentity: f,
7581
+ requestCompanyIdentity: g,
7582
7582
  restartIdentity: p
7583
7583
  };
7584
7584
  }
7585
7585
  function na(e) {
7586
- const { riskScoringService: t, applicantService: a } = Ee(), [r, n] = w(null), [o, l] = w({}), [c, d] = w(!1), [u, f] = w(!1), [p, C] = w(null), [N, x] = w(null), F = be(!1), T = be(null), $ = ee(async () => {
7586
+ const { riskScoringService: t, applicantService: a } = Ee(), [r, n] = w(null), [o, l] = w({}), [c, d] = w(!1), [u, g] = w(!1), [p, C] = w(null), [N, x] = w(null), F = be(!1), T = be(null), $ = ee(async () => {
7587
7587
  var P;
7588
7588
  if (e) {
7589
7589
  if (F.current) {
@@ -7620,14 +7620,14 @@ function na(e) {
7620
7620
  }, [e]);
7621
7621
  const U = ee(
7622
7622
  async (P) => {
7623
- f(!0), C(null);
7623
+ g(!0), C(null);
7624
7624
  try {
7625
7625
  const D = await t.submitRiskScoring(P);
7626
7626
  return x(D), D;
7627
7627
  } catch (D) {
7628
7628
  throw C(D), D;
7629
7629
  } finally {
7630
- f(!1);
7630
+ g(!1);
7631
7631
  }
7632
7632
  },
7633
7633
  [t]
@@ -7669,7 +7669,7 @@ function Ci() {
7669
7669
  }
7670
7670
  },
7671
7671
  [e, t]
7672
- ), f = ee(
7672
+ ), g = ee(
7673
7673
  async (N) => {
7674
7674
  r(!0), o(null);
7675
7675
  try {
@@ -7710,7 +7710,7 @@ function Ci() {
7710
7710
  isLoading: a,
7711
7711
  error: n,
7712
7712
  createApplicant: u,
7713
- createCompanyApplicant: f,
7713
+ createCompanyApplicant: g,
7714
7714
  getApplicantData: p,
7715
7715
  stopProgress: C
7716
7716
  };
@@ -7755,7 +7755,7 @@ const oa = {
7755
7755
  sm: "px-3 py-1.5 text-sm",
7756
7756
  md: "px-4 py-2 text-sm",
7757
7757
  lg: "px-6 py-3 text-base"
7758
- }, f = {
7758
+ }, g = {
7759
7759
  sm: { padding: "0.375rem 0.75rem", fontSize: "0.875rem" },
7760
7760
  md: { padding: "0.5rem 1rem", fontSize: "0.875rem" },
7761
7761
  lg: { padding: "0.75rem 1.5rem", fontSize: "1rem" }
@@ -7775,7 +7775,7 @@ const oa = {
7775
7775
  cursor: n || r ? "not-allowed" : "pointer",
7776
7776
  opacity: n || r ? 0.5 : 1,
7777
7777
  lineHeight: "1.25rem",
7778
- ...f[a],
7778
+ ...g[a],
7779
7779
  ...oa[t],
7780
7780
  ...l
7781
7781
  },
@@ -8095,7 +8095,7 @@ const me = ({ children: e, className: t, style: a, ...r }) => /* @__PURE__ */ i(
8095
8095
  },
8096
8096
  "__placeholder__"
8097
8097
  ),
8098
- r.map((u, f) => /* @__PURE__ */ i(
8098
+ r.map((u, g) => /* @__PURE__ */ i(
8099
8099
  "option",
8100
8100
  {
8101
8101
  value: u.value,
@@ -8106,7 +8106,7 @@ const me = ({ children: e, className: t, style: a, ...r }) => /* @__PURE__ */ i(
8106
8106
  },
8107
8107
  children: u.label
8108
8108
  },
8109
- u.value || `option-${f}`
8109
+ u.value || `option-${g}`
8110
8110
  ))
8111
8111
  ]
8112
8112
  }
@@ -8126,7 +8126,7 @@ const ci = 280, ca = ({
8126
8126
  readOnly: l = !1,
8127
8127
  required: c = !1
8128
8128
  }) => {
8129
- const { t: d } = je(), u = n ?? d("common.select"), f = o || l, [p, C] = w(!1), [N, x] = w(""), [F, T] = w(null), [$, U] = w({
8129
+ const { t: d } = je(), u = n ?? d("common.select"), g = o || l, [p, C] = w(!1), [N, x] = w(""), [F, T] = w(null), [$, U] = w({
8130
8130
  bg: "#ffffff",
8131
8131
  borderColor: "#d1d5db",
8132
8132
  textPrimary: "#111827",
@@ -8150,11 +8150,11 @@ const ci = 280, ca = ({
8150
8150
  hoverBg: R("--metakyc-surface", O)
8151
8151
  });
8152
8152
  }, []), h = ee(() => {
8153
- if (f) return;
8153
+ if (g) return;
8154
8154
  ce();
8155
8155
  const z = _();
8156
8156
  z && T(z), C(!0);
8157
- }, [f, _, ce]), L = ee(() => {
8157
+ }, [g, _, ce]), L = ee(() => {
8158
8158
  C(!1), x("");
8159
8159
  }, []);
8160
8160
  Ne(() => {
@@ -8178,9 +8178,9 @@ const ci = 280, ca = ({
8178
8178
  const M = r.filter(
8179
8179
  (z) => z.label.toLowerCase().includes(N.toLowerCase())
8180
8180
  ), Z = (z) => {
8181
- f || a(t.includes(z) ? t.filter((R) => R !== z) : [...t, z]);
8181
+ g || a(t.includes(z) ? t.filter((R) => R !== z) : [...t, z]);
8182
8182
  }, ae = (z, R) => {
8183
- R.stopPropagation(), f || a(t.filter((O) => O !== z));
8183
+ R.stopPropagation(), g || a(t.filter((O) => O !== z));
8184
8184
  }, W = (z) => {
8185
8185
  var R;
8186
8186
  return ((R = r.find((O) => O.value === z)) == null ? void 0 : R.label) || z;
@@ -8312,7 +8312,7 @@ const ci = 280, ca = ({
8312
8312
  className: He(
8313
8313
  "metakyc-multiselect-trigger",
8314
8314
  "w-full px-3 py-2 rounded-lg border text-sm transition-colors relative",
8315
- f ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
8315
+ g ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
8316
8316
  ),
8317
8317
  style: {
8318
8318
  minHeight: "38px",
@@ -8339,7 +8339,7 @@ const ci = 280, ca = ({
8339
8339
  },
8340
8340
  children: [
8341
8341
  W(z),
8342
- !f && /* @__PURE__ */ i(
8342
+ !g && /* @__PURE__ */ i(
8343
8343
  "button",
8344
8344
  {
8345
8345
  type: "button",
@@ -8395,7 +8395,7 @@ const ci = 280, ca = ({
8395
8395
  disabled: c = !1,
8396
8396
  readOnly: d = !1,
8397
8397
  required: u = !1,
8398
- className: f
8398
+ className: g
8399
8399
  }) => {
8400
8400
  var xe;
8401
8401
  const { t: p } = je(), C = n ?? p("common.select"), N = c || d, [x, F] = w(!1), [T, $] = w(""), [U, P] = w(null), [D, B] = w({
@@ -8556,7 +8556,7 @@ const ci = 280, ca = ({
8556
8556
  return /* @__PURE__ */ s(
8557
8557
  "div",
8558
8558
  {
8559
- className: He("w-full metakyc-searchable-select", f),
8559
+ className: He("w-full metakyc-searchable-select", g),
8560
8560
  ref: ce,
8561
8561
  children: [
8562
8562
  e && /* @__PURE__ */ s(
@@ -8632,7 +8632,7 @@ const ma = ({
8632
8632
  value: d = [],
8633
8633
  className: u
8634
8634
  }) => {
8635
- const { t: f } = je(), [p, C] = w(!1), [N, x] = w(null), F = be(null), T = ee((h) => {
8635
+ const { t: g } = je(), [p, C] = w(!1), [N, x] = w(null), F = be(null), T = ee((h) => {
8636
8636
  if (!h) return;
8637
8637
  x(null);
8638
8638
  const L = Array.from(h);
@@ -8742,14 +8742,14 @@ const ma = ({
8742
8742
  ),
8743
8743
  /* @__PURE__ */ s("div", { children: [
8744
8744
  /* @__PURE__ */ s("p", { style: { fontSize: "14px", color: "var(--metakyc-text-secondary, #6b7280)", margin: 0 }, children: [
8745
- /* @__PURE__ */ i("span", { style: { fontWeight: 600, color: "var(--metakyc-primary, #2563eb)" }, children: f("uploadDocument.clickToUpload") }),
8745
+ /* @__PURE__ */ i("span", { style: { fontWeight: 600, color: "var(--metakyc-primary, #2563eb)" }, children: g("uploadDocument.clickToUpload") }),
8746
8746
  " ",
8747
- f("uploadDocument.orDragDrop")
8747
+ g("uploadDocument.orDragDrop")
8748
8748
  ] }),
8749
8749
  (r || o) && /* @__PURE__ */ s("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "4px" }, children: [
8750
8750
  r && /* @__PURE__ */ i("span", { children: r }),
8751
8751
  r && o && /* @__PURE__ */ i("span", { children: " · " }),
8752
- o && /* @__PURE__ */ i("span", { children: f("uploadDocument.maxSize", { size: Ot(o) }) })
8752
+ o && /* @__PURE__ */ i("span", { children: g("uploadDocument.maxSize", { size: Ot(o) }) })
8753
8753
  ] })
8754
8754
  ] })
8755
8755
  ] })
@@ -9000,7 +9000,7 @@ const ha = Rt(
9000
9000
  ...c
9001
9001
  },
9002
9002
  [
9003
- ...l.map(([u, f]) => Ut(u, f)),
9003
+ ...l.map(([u, g]) => Ut(u, g)),
9004
9004
  ...Array.isArray(o) ? o : [o]
9005
9005
  ]
9006
9006
  )
@@ -9084,9 +9084,9 @@ const wa = ({
9084
9084
  onComplete: t,
9085
9085
  onBack: a
9086
9086
  }) => {
9087
- const { t: r } = je(), { questionnaire: n, initialAnswers: o, isLoading: l, isSubmitting: c, error: d, submit: u } = ta(e), [f, p] = w({}), [C, N] = w({}), [x, F] = w(0);
9087
+ const { t: r } = je(), { questionnaire: n, initialAnswers: o, isLoading: l, isSubmitting: c, error: d, submit: u } = ta(e), [g, p] = w({}), [C, N] = w({}), [x, F] = w(0);
9088
9088
  we.useEffect(() => {
9089
- o && Object.keys(o).length > 0 && Object.keys(f).length === 0 && p(o);
9089
+ o && Object.keys(o).length > 0 && Object.keys(g).length === 0 && p(o);
9090
9090
  }, [o]);
9091
9091
  const T = Ye(
9092
9092
  () => n ? xa(n.questionGroups) : [],
@@ -9099,11 +9099,11 @@ const wa = ({
9099
9099
  }, []), D = ee(() => {
9100
9100
  const h = {};
9101
9101
  for (const { question: L } of U) {
9102
- const M = ba(L, f[L.id] ?? []);
9102
+ const M = ba(L, g[L.id] ?? []);
9103
9103
  M && (h[L.id] = M);
9104
9104
  }
9105
9105
  return N((L) => ({ ...L, ...h })), Object.keys(h).length === 0;
9106
- }, [U, f]), B = () => {
9106
+ }, [U, g]), B = () => {
9107
9107
  D() && F((h) => h + 1);
9108
9108
  }, _ = () => {
9109
9109
  x > 0 ? F((h) => h - 1) : a == null || a();
@@ -9113,7 +9113,7 @@ const wa = ({
9113
9113
  const h = n.questionGroups.flatMap(
9114
9114
  (M) => (M.questions ?? []).map((Z) => ({
9115
9115
  questionId: Z.id,
9116
- values: f[Z.id] ?? []
9116
+ values: g[Z.id] ?? []
9117
9117
  }))
9118
9118
  ), L = {
9119
9119
  applicantId: e,
@@ -9153,7 +9153,7 @@ const wa = ({
9153
9153
  Sa,
9154
9154
  {
9155
9155
  question: h,
9156
- value: f[h.id] ?? [],
9156
+ value: g[h.id] ?? [],
9157
9157
  error: C[h.id],
9158
9158
  onChange: (L) => P(h.id, L)
9159
9159
  },
@@ -9270,17 +9270,17 @@ const wa = ({
9270
9270
  ] }),
9271
9271
  (l === "checkbox" || l === "multi-select") && /* @__PURE__ */ s("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
9272
9272
  (e.defaultAnswers ?? []).map((d) => {
9273
- const u = t.includes(d), f = () => {
9273
+ const u = t.includes(d), g = () => {
9274
9274
  r(u ? t.filter((p) => p !== d) : [...t, d]);
9275
9275
  };
9276
9276
  return /* @__PURE__ */ s(
9277
9277
  "div",
9278
9278
  {
9279
9279
  className: "metakyc-option-label",
9280
- onClick: f,
9280
+ onClick: g,
9281
9281
  style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer", margin: 0, padding: 0, userSelect: "none" },
9282
9282
  children: [
9283
- /* @__PURE__ */ i(tt, { checked: u, onChange: () => f() }),
9283
+ /* @__PURE__ */ i(tt, { checked: u, onChange: () => g() }),
9284
9284
  /* @__PURE__ */ i("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: d })
9285
9285
  ]
9286
9286
  },
@@ -9305,7 +9305,7 @@ const Na = ({
9305
9305
  onComplete: t,
9306
9306
  onBack: a
9307
9307
  }) => {
9308
- const { t: r } = je(), { uploadDocument: n, isLoading: o, isSubmitting: l, error: c, submit: d } = ia(e), [u, f] = w({}), [p, C] = w(null), [N, x] = w(0), [F, T] = w({}), $ = Ye(
9308
+ const { t: r } = je(), { uploadDocument: n, isLoading: o, isSubmitting: l, error: c, submit: d } = ia(e), [u, g] = w({}), [p, C] = w(null), [N, x] = w(0), [F, T] = w({}), $ = Ye(
9309
9309
  () => n ? Ca(n.uploadDocumentFiles) : [],
9310
9310
  [n]
9311
9311
  ), U = $[N] ?? [], P = N === $.length - 1, D = $.length, B = ee(() => {
@@ -9457,7 +9457,7 @@ const Na = ({
9457
9457
  C(null), T((Z) => {
9458
9458
  const ae = { ...Z };
9459
9459
  return delete ae[L.id], ae;
9460
- }), f((Z) => ({ ...Z, [L.id]: M }));
9460
+ }), g((Z) => ({ ...Z, [L.id]: M }));
9461
9461
  }
9462
9462
  },
9463
9463
  L.id
@@ -9525,13 +9525,13 @@ const Na = ({
9525
9525
  /* @__PURE__ */ i("h2", { className: "text-lg font-bold", children: n.title || r("overview.title") }),
9526
9526
  n.description && /* @__PURE__ */ i("p", { className: "mt-1", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n.description })
9527
9527
  ] }),
9528
- /* @__PURE__ */ i(ue, { className: "space-y-8", children: n.steps && n.steps.length > 0 ? n.steps.sort((f, p) => f.order - p.order).map((f) => /* @__PURE__ */ s("div", { className: "metakyc-overview-step-item flex items-center space-x-3", children: [
9528
+ /* @__PURE__ */ i(ue, { className: "space-y-8", children: n.steps && n.steps.length > 0 ? n.steps.sort((g, p) => g.order - p.order).map((g) => /* @__PURE__ */ s("div", { className: "metakyc-overview-step-item flex items-center space-x-3", children: [
9529
9529
  /* @__PURE__ */ i("div", { className: "metakyc-step-icon flex-shrink-0", children: /* @__PURE__ */ i(
9530
9530
  "div",
9531
9531
  {
9532
9532
  className: "w-8 h-8 rounded-full flex items-center justify-center font-medium text-sm",
9533
9533
  style: { backgroundColor: "var(--metakyc-primary, #2563eb)", color: "#ffffff" },
9534
- children: f.order + 1
9534
+ children: g.order + 1
9535
9535
  }
9536
9536
  ) }),
9537
9537
  /* @__PURE__ */ s(
@@ -9545,12 +9545,12 @@ const Na = ({
9545
9545
  background: "transparent"
9546
9546
  },
9547
9547
  children: [
9548
- /* @__PURE__ */ i("span", { className: "metakyc-step-title text-sm font-semibold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: f.title }),
9549
- f.description && /* @__PURE__ */ i("p", { className: "metakyc-step-description text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: f.description })
9548
+ /* @__PURE__ */ i("span", { className: "metakyc-step-title text-sm font-semibold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: g.title }),
9549
+ g.description && /* @__PURE__ */ i("p", { className: "metakyc-step-description text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: g.description })
9550
9550
  ]
9551
9551
  }
9552
9552
  )
9553
- ] }, f.order)) : /* @__PURE__ */ i("div", { className: "text-center py-8", children: /* @__PURE__ */ i("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: r("overview.loadingOverview") }) }) }),
9553
+ ] }, g.order)) : /* @__PURE__ */ i("div", { className: "text-center py-8", children: /* @__PURE__ */ i("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: r("overview.loadingOverview") }) }) }),
9554
9554
  /* @__PURE__ */ s(Oe, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
9555
9555
  a && /* @__PURE__ */ i(le, { type: "button", variant: "outline", onClick: a, children: r("common.back") }),
9556
9556
  /* @__PURE__ */ i(le, { onClick: u, isLoading: l, children: r("common.continue") })
@@ -9623,7 +9623,7 @@ const Da = ({
9623
9623
  onComplete: t,
9624
9624
  onBack: a
9625
9625
  }) => {
9626
- const { t: r } = je(), { config: n } = Ee(), o = n.locale ?? "en", { criteria: l, initialAnswers: c, isLoading: d, isSubmitting: u, error: f, submit: p } = na(e), [C, N] = w({}), [x, F] = w({}), [T, $] = w(0), [U, P] = w(!1);
9626
+ const { t: r } = je(), { config: n } = Ee(), o = n.locale ?? "en", { criteria: l, initialAnswers: c, isLoading: d, isSubmitting: u, error: g, submit: p } = na(e), [C, N] = w({}), [x, F] = w({}), [T, $] = w(0), [U, P] = w(!1);
9627
9627
  we.useEffect(() => {
9628
9628
  c && Object.keys(c).length > 0 && Object.keys(C).length === 0 && N(c);
9629
9629
  }, [c]);
@@ -9668,10 +9668,10 @@ const Da = ({
9668
9668
  ] }) }) : !d && l && l.length === 0 ? /* @__PURE__ */ i(me, { children: /* @__PURE__ */ s(ue, { children: [
9669
9669
  /* @__PURE__ */ i(Ge, { className: "my-8" }),
9670
9670
  /* @__PURE__ */ i("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: r("riskScoring.noCriteria") })
9671
- ] }) }) : f ? /* @__PURE__ */ i(me, { children: /* @__PURE__ */ i(ue, { children: /* @__PURE__ */ s("p", { className: "text-danger-500", children: [
9671
+ ] }) }) : g ? /* @__PURE__ */ i(me, { children: /* @__PURE__ */ i(ue, { children: /* @__PURE__ */ s("p", { className: "text-danger-500", children: [
9672
9672
  r("riskScoring.errorLoading"),
9673
9673
  " ",
9674
- f.message
9674
+ g.message
9675
9675
  ] }) }) }) : l ? /* @__PURE__ */ s(me, { children: [
9676
9676
  /* @__PURE__ */ s(Fe, { children: [
9677
9677
  /* @__PURE__ */ i("h2", { className: "text-lg font-bold", children: r("riskScoring.title") }),
@@ -9730,13 +9730,13 @@ const Da = ({
9730
9730
  }
9731
9731
  )
9732
9732
  ] }),
9733
- f && /* @__PURE__ */ i("div", { className: "mx-6 mb-4 p-3 rounded", style: {
9733
+ g && /* @__PURE__ */ i("div", { className: "mx-6 mb-4 p-3 rounded", style: {
9734
9734
  backgroundColor: "var(--metakyc-danger-bg, color-mix(in srgb, var(--metakyc-danger, #ef4444) 10%, transparent))",
9735
9735
  border: "1px solid color-mix(in srgb, var(--metakyc-danger, #ef4444) 30%, transparent)"
9736
- }, children: /* @__PURE__ */ i("p", { className: "text-sm", style: { color: "var(--metakyc-danger, #ef4444)" }, children: f.message }) })
9736
+ }, children: /* @__PURE__ */ i("p", { className: "text-sm", style: { color: "var(--metakyc-danger, #ef4444)" }, children: g.message }) })
9737
9737
  ] }) : null;
9738
9738
  }, Pa = ({ criterion: e, value: t, error: a, locale: r, onChange: n }) => {
9739
- const { t: o } = je(), l = Ea(e), c = e.valueDataType === lt.Integer || e.valueDataType === lt.Money || e.valueDataType === lt.DigitOnly, d = Ia(e), u = (f) => d ? Aa(f, r) : f;
9739
+ const { t: o } = je(), l = Ea(e), c = e.valueDataType === lt.Integer || e.valueDataType === lt.Money || e.valueDataType === lt.DigitOnly, d = Ia(e), u = (g) => d ? Aa(g, r) : g;
9740
9740
  return /* @__PURE__ */ s("div", { className: "space-y-2", children: [
9741
9741
  /* @__PURE__ */ s("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: [
9742
9742
  e.displayName,
@@ -9748,32 +9748,32 @@ const Da = ({
9748
9748
  Le,
9749
9749
  {
9750
9750
  value: t[0] ?? "",
9751
- onChange: (f) => n([f.target.value]),
9751
+ onChange: (g) => n([g.target.value]),
9752
9752
  type: c ? "number" : "text",
9753
9753
  placeholder: o("placeholders.enterAnswer"),
9754
9754
  error: a,
9755
9755
  required: e.isRequired,
9756
9756
  min: e.min,
9757
9757
  max: e.max,
9758
- onKeyDown: (f) => {
9759
- e.valueDataType === lt.DigitOnly && ["e", "E", "+", "-", "."].includes(f.key) && f.preventDefault();
9758
+ onKeyDown: (g) => {
9759
+ e.valueDataType === lt.DigitOnly && ["e", "E", "+", "-", "."].includes(g.key) && g.preventDefault();
9760
9760
  }
9761
9761
  }
9762
9762
  ),
9763
9763
  l === "radio" && /* @__PURE__ */ s("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
9764
- (e.defaultValues ?? []).map((f) => /* @__PURE__ */ s(
9764
+ (e.defaultValues ?? []).map((g) => /* @__PURE__ */ s(
9765
9765
  "div",
9766
9766
  {
9767
9767
  className: "metakyc-option-label",
9768
- onClick: () => n([f]),
9768
+ onClick: () => n([g]),
9769
9769
  style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer", margin: 0, padding: 0, userSelect: "none" },
9770
9770
  children: [
9771
9771
  /* @__PURE__ */ i(
9772
9772
  "input",
9773
9773
  {
9774
9774
  type: "radio",
9775
- checked: t[0] === f,
9776
- onChange: () => n([f]),
9775
+ checked: t[0] === g,
9776
+ onChange: () => n([g]),
9777
9777
  onClick: (p) => p.stopPropagation(),
9778
9778
  className: "metakyc-option-input",
9779
9779
  style: {
@@ -9791,17 +9791,17 @@ const Da = ({
9791
9791
  }
9792
9792
  }
9793
9793
  ),
9794
- /* @__PURE__ */ i("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: u(f) })
9794
+ /* @__PURE__ */ i("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: u(g) })
9795
9795
  ]
9796
9796
  },
9797
- f
9797
+ g
9798
9798
  )),
9799
9799
  a && /* @__PURE__ */ i("p", { className: "text-sm text-danger-500", children: a })
9800
9800
  ] }),
9801
9801
  l === "checkbox" && /* @__PURE__ */ s("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
9802
- (e.defaultValues ?? []).map((f) => {
9803
- const p = t.includes(f), C = () => {
9804
- n(p ? t.filter((N) => N !== f) : [...t, f]);
9802
+ (e.defaultValues ?? []).map((g) => {
9803
+ const p = t.includes(g), C = () => {
9804
+ n(p ? t.filter((N) => N !== g) : [...t, g]);
9805
9805
  };
9806
9806
  return /* @__PURE__ */ s(
9807
9807
  "div",
@@ -9811,10 +9811,10 @@ const Da = ({
9811
9811
  style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer", margin: 0, padding: 0, userSelect: "none" },
9812
9812
  children: [
9813
9813
  /* @__PURE__ */ i(tt, { checked: p, onChange: () => C() }),
9814
- /* @__PURE__ */ i("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: u(f) })
9814
+ /* @__PURE__ */ i("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: u(g) })
9815
9815
  ]
9816
9816
  },
9817
- f
9817
+ g
9818
9818
  );
9819
9819
  }),
9820
9820
  a && /* @__PURE__ */ i("p", { className: "text-sm text-danger-500", children: a })
@@ -9823,7 +9823,7 @@ const Da = ({
9823
9823
  Gt,
9824
9824
  {
9825
9825
  value: t[0] ?? "",
9826
- onChange: (f) => n([f.target.value]),
9826
+ onChange: (g) => n([g.target.value]),
9827
9827
  options: [
9828
9828
  { value: "US", label: "United States" },
9829
9829
  { value: "GB", label: "United Kingdom" },
@@ -9842,13 +9842,13 @@ const Da = ({
9842
9842
  onComplete: t,
9843
9843
  onBack: a
9844
9844
  }) => {
9845
- const { t: r } = je(), { investorCategorizationService: n } = Ee(), [o, l] = w(null), [c, d] = w(!1), [u, f] = w(null);
9845
+ const { t: r } = je(), { investorCategorizationService: n } = Ee(), [o, l] = w(null), [c, d] = w(!1), [u, g] = w(null);
9846
9846
  return /* @__PURE__ */ i("form", { onSubmit: async (C) => {
9847
9847
  if (C.preventDefault(), o === null) {
9848
- f(r("investorCategorization.pleaseSelect"));
9848
+ g(r("investorCategorization.pleaseSelect"));
9849
9849
  return;
9850
9850
  }
9851
- d(!0), f(null);
9851
+ d(!0), g(null);
9852
9852
  try {
9853
9853
  const N = {
9854
9854
  applicantId: e,
@@ -9858,7 +9858,7 @@ const Da = ({
9858
9858
  const x = await n.setInvestorCategorization(N);
9859
9859
  console.log("Investor categorization result:", x), t == null || t();
9860
9860
  } catch (N) {
9861
- console.error("Error submitting investor categorization:", N), f(N.message || r("investorCategorization.failedToSubmit"));
9861
+ console.error("Error submitting investor categorization:", N), g(N.message || r("investorCategorization.failedToSubmit"));
9862
9862
  } finally {
9863
9863
  d(!1);
9864
9864
  }
@@ -9983,7 +9983,7 @@ const ja = ({
9983
9983
  onComplete: t,
9984
9984
  onBack: a
9985
9985
  }) => {
9986
- const { t: r } = je(), { appropriatenessTestService: n } = Ee(), [o, l] = w(null), [c, d] = w(!0), [u, f] = w(!1), [p, C] = w(null), [N, x] = w({}), [F, T] = w(0), [$, U] = w(!1), [P, D] = w(!1), [B, _] = w(0), [ce, h] = w(0), [L, M] = w(null);
9986
+ const { t: r } = je(), { appropriatenessTestService: n } = Ee(), [o, l] = w(null), [c, d] = w(!0), [u, g] = w(!1), [p, C] = w(null), [N, x] = w({}), [F, T] = w(0), [$, U] = w(!1), [P, D] = w(!1), [B, _] = w(0), [ce, h] = w(0), [L, M] = w(null);
9987
9987
  Ne(() => {
9988
9988
  (async () => {
9989
9989
  try {
@@ -10036,7 +10036,7 @@ const ja = ({
10036
10036
  return;
10037
10037
  }
10038
10038
  }
10039
- f(!0), C(null);
10039
+ g(!0), C(null);
10040
10040
  try {
10041
10041
  const O = o.appropriatenessQuestions.map(
10042
10042
  (xe) => ({ appropriatenessQuestionId: xe.id, value: N[xe.id] || "" })
@@ -10057,7 +10057,7 @@ const ja = ({
10057
10057
  } catch (O) {
10058
10058
  C(O.message || r("appropriatenessTest.failedToSubmit")), he();
10059
10059
  } finally {
10060
- f(!1);
10060
+ g(!1);
10061
10061
  }
10062
10062
  }
10063
10063
  }, he = () => {
@@ -10554,7 +10554,7 @@ const ja = ({
10554
10554
  onBack: a
10555
10555
  }) => {
10556
10556
  var Pe, Je, mt, rt;
10557
- const { t: r } = je(), { applicantService: n, baseInformationService: o, identityService: l, config: c, currentTheme: d } = Ee(), { identityData: u, provider: f, token: p, isLoading: C, error: N, requestIdentity: x, restartIdentity: F } = aa(e), [T, $] = w(null), [U, P] = w(null), [D, B] = w([]), [_, ce] = w([]), [h, L] = w(!0), [M, Z] = w(!1), [ae, W] = w(null), [re, he] = w(!1), fe = we.useRef(!1), [De, se] = w({}), [G, Q] = w({}), te = d != null && d.reviewPageFields && d.reviewPageFields.length > 0 ? d.reviewPageFields[0] : null, z = !!(d != null && d.reviewPageDisabled), R = be(!1);
10557
+ const { t: r } = je(), { applicantService: n, baseInformationService: o, identityService: l, config: c, currentTheme: d } = Ee(), { identityData: u, provider: g, token: p, isLoading: C, error: N, requestIdentity: x, restartIdentity: F } = aa(e), [T, $] = w(null), [U, P] = w(null), [D, B] = w([]), [_, ce] = w([]), [h, L] = w(!0), [M, Z] = w(!1), [ae, W] = w(null), [re, he] = w(!1), fe = we.useRef(!1), [De, se] = w({}), [G, Q] = w({}), te = d != null && d.reviewPageFields && d.reviewPageFields.length > 0 ? d.reviewPageFields[0] : null, z = !!(d != null && d.reviewPageDisabled), R = be(!1);
10558
10558
  R.current = z;
10559
10559
  const O = ji({
10560
10560
  defaultValues: {
@@ -10585,37 +10585,37 @@ const ja = ({
10585
10585
  B(ke);
10586
10586
  const Ie = /* @__PURE__ */ new Set(), y = Y.filter((A) => A.countryCode).map((A) => ({ value: A.countryCode, label: `${A.countryCode} – ${A.name}` })).filter((A) => Ie.has(A.value) ? !1 : (Ie.add(A.value), !0));
10587
10587
  ce(y);
10588
- const g = V.applicantRequestData;
10588
+ const f = V.applicantRequestData;
10589
10589
  if (se({
10590
- firstName: (g == null ? void 0 : g.firstName) || "",
10591
- lastName: (g == null ? void 0 : g.lastName) || "",
10592
- email: (g == null ? void 0 : g.email) || "",
10593
- dateOfBirth: (g == null ? void 0 : g.dateOfBirth) || "",
10594
- title: (g == null ? void 0 : g.title) || "",
10595
- salutation: (g == null ? void 0 : g.salutation) || "",
10596
- phonenumber: (g == null ? void 0 : g.phonenumber) || "",
10597
- mobileCountryCode: (g == null ? void 0 : g.mobileCountryCode) || "",
10598
- street: (g == null ? void 0 : g.street) || "",
10599
- streetNumber: (g == null ? void 0 : g.streetNumber) || "",
10600
- city: (g == null ? void 0 : g.city) || "",
10601
- zip: (g == null ? void 0 : g.zip) || "",
10602
- country: (g == null ? void 0 : g.country) || "",
10603
- nationality: (g == null ? void 0 : g.nationality) || "",
10604
- taxCountry: (g == null ? void 0 : g.taxCountry) || "",
10605
- countryOfBirth: (g == null ? void 0 : g.countryOfBirth) || "",
10606
- placeOfBirth: (g == null ? void 0 : g.placeOfBirth) || "",
10607
- educationLevel: (g == null ? void 0 : g.educationLevel) || "",
10608
- occupation: (g == null ? void 0 : g.occupation) || "",
10609
- taxNumber: (g == null ? void 0 : g.taxNumber) || "",
10610
- defaultLanguage: (g == null ? void 0 : g.defaultLanguage) || ""
10590
+ firstName: (f == null ? void 0 : f.firstName) || "",
10591
+ lastName: (f == null ? void 0 : f.lastName) || "",
10592
+ email: (f == null ? void 0 : f.email) || "",
10593
+ dateOfBirth: (f == null ? void 0 : f.dateOfBirth) || "",
10594
+ title: (f == null ? void 0 : f.title) || "",
10595
+ salutation: (f == null ? void 0 : f.salutation) || "",
10596
+ phonenumber: (f == null ? void 0 : f.phonenumber) || "",
10597
+ mobileCountryCode: (f == null ? void 0 : f.mobileCountryCode) || "",
10598
+ street: (f == null ? void 0 : f.street) || "",
10599
+ streetNumber: (f == null ? void 0 : f.streetNumber) || "",
10600
+ city: (f == null ? void 0 : f.city) || "",
10601
+ zip: (f == null ? void 0 : f.zip) || "",
10602
+ country: (f == null ? void 0 : f.country) || "",
10603
+ nationality: (f == null ? void 0 : f.nationality) || "",
10604
+ taxCountry: (f == null ? void 0 : f.taxCountry) || "",
10605
+ countryOfBirth: (f == null ? void 0 : f.countryOfBirth) || "",
10606
+ placeOfBirth: (f == null ? void 0 : f.placeOfBirth) || "",
10607
+ educationLevel: (f == null ? void 0 : f.educationLevel) || "",
10608
+ occupation: (f == null ? void 0 : f.occupation) || "",
10609
+ taxNumber: (f == null ? void 0 : f.taxNumber) || "",
10610
+ defaultLanguage: (f == null ? void 0 : f.defaultLanguage) || ""
10611
10611
  }), O.reset({
10612
- street: (g == null ? void 0 : g.street) || "",
10613
- streetNumber: (g == null ? void 0 : g.streetNumber) || "",
10614
- city: (g == null ? void 0 : g.city) || "",
10615
- zip: (g == null ? void 0 : g.zip) || "",
10616
- country: (g == null ? void 0 : g.country) || "",
10617
- nationality: (g == null ? void 0 : g.nationality) || "",
10618
- phonenumber: (g == null ? void 0 : g.phonenumber) || ""
10612
+ street: (f == null ? void 0 : f.street) || "",
10613
+ streetNumber: (f == null ? void 0 : f.streetNumber) || "",
10614
+ city: (f == null ? void 0 : f.city) || "",
10615
+ zip: (f == null ? void 0 : f.zip) || "",
10616
+ country: (f == null ? void 0 : f.country) || "",
10617
+ nationality: (f == null ? void 0 : f.nationality) || "",
10618
+ phonenumber: (f == null ? void 0 : f.phonenumber) || ""
10619
10619
  }), V.kycRecords && V.kycRecords.length > 0 && V.kycRecords[0].providerTokenObject !== null && !fe.current && R.current) {
10620
10620
  console.log("[Identity] Review page disabled + existing identity — auto-requesting..."), fe.current = !0;
10621
10621
  try {
@@ -10657,16 +10657,16 @@ const ja = ({
10657
10657
  }
10658
10658
  }
10659
10659
  }, [p]);
10660
- const Se = f !== null && f === et.Sumsub;
10660
+ const Se = g !== null && g === et.Sumsub;
10661
10661
  Ne(() => {
10662
- if (f !== null && p && !T && M && !re) {
10663
- const b = f;
10662
+ if (g !== null && p && !T && M && !re) {
10663
+ const b = g;
10664
10664
  if (Se) {
10665
10665
  console.log("[Sumsub] Fetching access token for Web SDK…"), W(null), (async () => {
10666
10666
  try {
10667
- const V = await l.refreshSumsubToken(e), J = pt.parseProviderConfig(f, p, c);
10667
+ const V = await l.refreshSumsubToken(e), J = pt.parseProviderConfig(g, p, c);
10668
10668
  J.accessToken = V, J.onTokenRefresh = () => l.refreshSumsubToken(e);
10669
- const Y = pt.createProvider(f, J);
10669
+ const Y = pt.createProvider(g, J);
10670
10670
  Y.onComplete((ye) => {
10671
10671
  console.log("[Sumsub] Verification complete:", ye), t == null || t();
10672
10672
  }), Y.onError((ye) => {
@@ -10684,8 +10684,8 @@ const ja = ({
10684
10684
  if (new URL(p.url), b === et.SardinAI) {
10685
10685
  console.log("[SardinAI] Initializing Risk SDK in background...");
10686
10686
  try {
10687
- const V = pt.parseProviderConfig(f, p, c);
10688
- pt.createProvider(f, V).initialize().then(() => console.log("[SardinAI] Risk SDK initialized in background")).catch((Y) => console.warn("[SardinAI] Risk SDK init failed (non-blocking):", Y));
10687
+ const V = pt.parseProviderConfig(g, p, c);
10688
+ pt.createProvider(g, V).initialize().then(() => console.log("[SardinAI] Risk SDK initialized in background")).catch((Y) => console.warn("[SardinAI] Risk SDK init failed (non-blocking):", Y));
10689
10689
  } catch (V) {
10690
10690
  console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", V);
10691
10691
  }
@@ -10699,7 +10699,7 @@ const ja = ({
10699
10699
  if (b === et.SardinAI) {
10700
10700
  console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), W(null);
10701
10701
  try {
10702
- const V = pt.parseProviderConfig(f, p, c), J = pt.createProvider(f, V);
10702
+ const V = pt.parseProviderConfig(g, p, c), J = pt.createProvider(g, V);
10703
10703
  J.initialize().then(() => {
10704
10704
  console.log("[SardinAI] Risk SDK initialized successfully"), $(J), setTimeout(() => t == null ? void 0 : t(), 2e3);
10705
10705
  }).catch((Y) => {
@@ -10715,7 +10715,7 @@ const ja = ({
10715
10715
  }
10716
10716
  try {
10717
10717
  W(null);
10718
- const V = pt.parseProviderConfig(f, p, c), J = pt.createProvider(f, V);
10718
+ const V = pt.parseProviderConfig(g, p, c), J = pt.createProvider(g, V);
10719
10719
  b === et.Onfido && J.initialize("identity-container").catch((Y) => {
10720
10720
  console.error("[Onfido] Initialization error:", Y), W(r("identity.failedToInitialize", { message: Y.message }));
10721
10721
  }), $(J);
@@ -10731,7 +10731,7 @@ const ja = ({
10731
10731
  console.error("[Identity] Error destroying provider:", b);
10732
10732
  }
10733
10733
  };
10734
- }, [f, p, T, M, t, re, Se, e, c, l]);
10734
+ }, [g, p, T, M, t, re, Se, e, c, l]);
10735
10735
  const xe = async () => {
10736
10736
  try {
10737
10737
  W(null), he(!1), await x(), Z(!0);
@@ -10806,7 +10806,7 @@ const ja = ({
10806
10806
  ] })
10807
10807
  ] });
10808
10808
  if (M && u) {
10809
- const b = f;
10809
+ const b = g;
10810
10810
  return Se ? /* @__PURE__ */ s("div", { style: {
10811
10811
  background: "var(--metakyc-background, #ffffff)",
10812
10812
  borderRadius: "12px",
@@ -11102,8 +11102,8 @@ const ja = ({
11102
11102
  }
11103
11103
  if (b.customType === "group_checkbox") {
11104
11104
  const ke = Array.isArray(ye) ? ye : ye ? [ye] : [], Ie = (y) => {
11105
- b.singleSelect ? Q((g) => ({ ...g, [Y]: ke[0] === y ? [] : [y] })) : Q((g) => ({
11106
- ...g,
11105
+ b.singleSelect ? Q((f) => ({ ...f, [Y]: ke[0] === y ? [] : [y] })) : Q((f) => ({
11106
+ ...f,
11107
11107
  [Y]: ke.includes(y) ? ke.filter((I) => I !== y) : [...ke, y]
11108
11108
  }));
11109
11109
  };
@@ -11164,7 +11164,7 @@ const ja = ({
11164
11164
  {
11165
11165
  label: ye,
11166
11166
  value: String(ke),
11167
- onChange: (g) => se((I) => ({ ...I, [J]: g })),
11167
+ onChange: (f) => se((I) => ({ ...I, [J]: f })),
11168
11168
  options: [{ value: "", label: r("placeholders.selectCountryCode") }, ..._]
11169
11169
  }
11170
11170
  ),
@@ -11175,7 +11175,7 @@ const ja = ({
11175
11175
  {
11176
11176
  label: ye,
11177
11177
  value: String(ke),
11178
- onChange: (g) => se((I) => ({ ...I, [J]: g })),
11178
+ onChange: (f) => se((I) => ({ ...I, [J]: f })),
11179
11179
  options: [{ value: "", label: r("common.select") }, ...D]
11180
11180
  }
11181
11181
  ),
@@ -11187,7 +11187,7 @@ const ja = ({
11187
11187
  label: ye,
11188
11188
  type: (Y == null ? void 0 : Y.type) === "date" ? "date" : (Y == null ? void 0 : Y.type) === "email" ? "email" : "text",
11189
11189
  value: String(ke),
11190
- onChange: (g) => se((I) => ({ ...I, [J]: g.target.value }))
11190
+ onChange: (f) => se((I) => ({ ...I, [J]: f.target.value }))
11191
11191
  }
11192
11192
  ),
11193
11193
  b.helpText
@@ -11453,14 +11453,14 @@ function It() {
11453
11453
  return t.current = e, t;
11454
11454
  }
11455
11455
  const Ua = ({ children: e }) => {
11456
- const [t, a] = w([]), [r, n] = w({}), o = be([]), l = ee((f) => {
11457
- o.current = [...o.current.filter((p) => p.id !== f.id), f], a([...o.current]);
11458
- }, []), c = ee((f) => {
11459
- o.current = o.current.filter((p) => p.id !== f), a([...o.current]);
11460
- }, []), d = ee((f) => {
11456
+ const [t, a] = w([]), [r, n] = w({}), o = be([]), l = ee((g) => {
11457
+ o.current = [...o.current.filter((p) => p.id !== g.id), g], a([...o.current]);
11458
+ }, []), c = ee((g) => {
11459
+ o.current = o.current.filter((p) => p.id !== g), a([...o.current]);
11460
+ }, []), d = ee((g) => {
11461
11461
  n((p) => {
11462
- const C = { ...p, ...f };
11463
- return Object.keys(f).some((x) => p[x] !== f[x]) ? C : p;
11462
+ const C = { ...p, ...g };
11463
+ return Object.keys(g).some((x) => p[x] !== g[x]) ? C : p;
11464
11464
  });
11465
11465
  }, []), u = Ye(
11466
11466
  () => ({ actions: t, registerAction: l, unregisterAction: c, sdkState: r, updateSdkState: d }),
@@ -11478,7 +11478,7 @@ const Ua = ({ children: e }) => {
11478
11478
  clearTimeout(L), document.removeEventListener("mousedown", h);
11479
11479
  };
11480
11480
  }, [t]), !e) return null;
11481
- const { actions: d, sdkState: u } = e, f = d.filter((h) => h.group === "form"), p = d.filter((h) => h.group === "workflow"), C = d.filter((h) => !h.group || h.group === "general"), N = async (h, L) => {
11481
+ const { actions: d, sdkState: u } = e, g = d.filter((h) => h.group === "form"), p = d.filter((h) => h.group === "workflow"), C = d.filter((h) => !h.group || h.group === "general"), N = async (h, L) => {
11482
11482
  l(h);
11483
11483
  try {
11484
11484
  await L();
@@ -11621,7 +11621,7 @@ const Ua = ({ children: e }) => {
11621
11621
  /* @__PURE__ */ i("button", { style: $(r === "state"), onClick: () => n("state"), children: "State" })
11622
11622
  ] }),
11623
11623
  /* @__PURE__ */ i("div", { style: { flex: 1, overflowY: "auto", overflowX: "hidden" }, children: r === "actions" ? /* @__PURE__ */ s("div", { style: { paddingBottom: "8px" }, children: [
11624
- B("Form", f),
11624
+ B("Form", g),
11625
11625
  B("Workflow", p),
11626
11626
  B("General", C),
11627
11627
  d.length === 0 && /* @__PURE__ */ s("div", { style: { padding: "24px 14px", textAlign: "center", color: "#6c7086" }, children: [
@@ -11862,8 +11862,8 @@ const Qa = {
11862
11862
  onSuccess: r,
11863
11863
  onCancel: n
11864
11864
  }) => {
11865
- var g, I, A, K, X, ne, ve;
11866
- const { config: o, baseInformationService: l, currentTheme: c } = Ee(), { createApplicant: d, getApplicantData: u, isLoading: f } = Ci(), { t: p } = je(), C = e || ((g = o.applicantForm) == null ? void 0 : g.workflowKey);
11865
+ var f, I, A, K, X, ne, ve;
11866
+ const { config: o, baseInformationService: l, currentTheme: c } = Ee(), { createApplicant: d, getApplicantData: u, isLoading: g } = Ci(), { t: p } = je(), C = e || ((f = o.applicantForm) == null ? void 0 : f.workflowKey);
11867
11867
  if (!C)
11868
11868
  throw new Error(
11869
11869
  "workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
@@ -12635,7 +12635,7 @@ const Qa = {
12635
12635
  /* @__PURE__ */ i("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: p("common.loadingForm") })
12636
12636
  ] }) }) });
12637
12637
  if (P) {
12638
- const m = P[Se] ?? P[0], j = b === -1, E = rt === -1, k = P.length, v = Je(m), S = mt(m), ge = Object.values(q), pe = !v && !!m.conditionalOn && m.conditionalMode === "block", Ve = qe || f || pe || S;
12638
+ const m = P[Se] ?? P[0], j = b === -1, E = rt === -1, k = P.length, v = Je(m), S = mt(m), ge = Object.values(q), pe = !v && !!m.conditionalOn && m.conditionalMode === "block", Ve = qe || g || pe || S;
12639
12639
  let Be;
12640
12640
  return pe || S ? Be = p("common.blocked") : E ? Be = m.conditionalOn && !v ? p("common.skipAndSubmit") : p("common.submit") : Be = m.conditionalOn && !v ? p("common.skip") : p("common.next"), /* @__PURE__ */ i("div", { className: "metakyc-sdk", children: /* @__PURE__ */ s(me, { children: [
12641
12641
  /* @__PURE__ */ i(Fe, { children: /* @__PURE__ */ i(Tt, { title: (c == null ? void 0 : c.title) || p("createApplicant.title") }) }),
@@ -12708,17 +12708,17 @@ const Qa = {
12708
12708
  onClick: () => {
12709
12709
  xe(b), ie({});
12710
12710
  },
12711
- disabled: qe || f,
12711
+ disabled: qe || g,
12712
12712
  children: p("common.previous")
12713
12713
  }
12714
12714
  ),
12715
- j && n && /* @__PURE__ */ i(le, { type: "button", variant: "outline", onClick: n, disabled: qe || f, children: "Cancel" })
12715
+ j && n && /* @__PURE__ */ i(le, { type: "button", variant: "outline", onClick: n, disabled: qe || g, children: "Cancel" })
12716
12716
  ] }),
12717
12717
  /* @__PURE__ */ i(
12718
12718
  le,
12719
12719
  {
12720
12720
  type: "button",
12721
- isLoading: qe || f,
12721
+ isLoading: qe || g,
12722
12722
  disabled: Ve,
12723
12723
  onClick: E ? Y : J,
12724
12724
  children: Be
@@ -12741,8 +12741,8 @@ const Qa = {
12741
12741
  /* @__PURE__ */ i("div", { className: "metakyc-form-grid", children: B.map((m) => /* @__PURE__ */ i("div", { style: { gridColumn: "span 4 / span 4" }, children: ke(m) }, m)) })
12742
12742
  ] }),
12743
12743
  /* @__PURE__ */ s(Oe, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
12744
- n && /* @__PURE__ */ i(le, { type: "button", variant: "outline", onClick: n, disabled: qe || f, children: "Cancel" }),
12745
- /* @__PURE__ */ i(le, { type: "submit", isLoading: qe || f, children: p("createApplicant.createApplicant") })
12744
+ n && /* @__PURE__ */ i(le, { type: "button", variant: "outline", onClick: n, disabled: qe || g, children: "Cancel" }),
12745
+ /* @__PURE__ */ i(le, { type: "submit", isLoading: qe || g, children: p("createApplicant.createApplicant") })
12746
12746
  ] })
12747
12747
  ] }) }) });
12748
12748
  }, yi = ["companyName", "email"];
@@ -12756,8 +12756,8 @@ const Za = ({
12756
12756
  onCancel: r
12757
12757
  }) => {
12758
12758
  var V, J, Y, ye, ke, Ie;
12759
- const { config: n, baseInformationService: o, currentTheme: l } = Ee(), { createCompanyApplicant: c, isLoading: d } = Ci(), { t: u } = je(), f = e || ((V = n.applicantForm) == null ? void 0 : V.workflowKey);
12760
- if (!f)
12759
+ const { config: n, baseInformationService: o, currentTheme: l } = Ee(), { createCompanyApplicant: c, isLoading: d } = Ci(), { t: u } = je(), g = e || ((V = n.applicantForm) == null ? void 0 : V.workflowKey);
12760
+ if (!g)
12761
12761
  throw new Error(
12762
12762
  "workflowKey is required. Provide it either as a prop to CreateCompanyApplicantForm or set it in config.applicantForm.workflowKey"
12763
12763
  );
@@ -12765,8 +12765,8 @@ const Za = ({
12765
12765
  () => l != null && l.companyFormPages && l.companyFormPages.length > 0 ? l.companyFormPages : null,
12766
12766
  [l == null ? void 0 : l.companyFormPages]
12767
12767
  ), $ = Ye(() => {
12768
- const y = new Set(yi), g = l == null ? void 0 : l.companyFormRequiredFields;
12769
- if (g) for (const I of g) y.add(I);
12768
+ const y = new Set(yi), f = l == null ? void 0 : l.companyFormRequiredFields;
12769
+ if (f) for (const I of f) y.add(I);
12770
12770
  if (T)
12771
12771
  for (const I of T)
12772
12772
  for (const A of I.fields)
@@ -12775,18 +12775,18 @@ const Za = ({
12775
12775
  }, [l == null ? void 0 : l.companyFormRequiredFields, T]), U = Ye(() => {
12776
12776
  var y;
12777
12777
  if (T) {
12778
- const g = T.flatMap((A) => A.fields).filter((A) => !A.isCustom && A.name).map((A) => A.name), I = new Set(g);
12778
+ const f = T.flatMap((A) => A.fields).filter((A) => !A.isCustom && A.name).map((A) => A.name), I = new Set(f);
12779
12779
  for (const A of yi) I.add(A);
12780
12780
  return Array.from(I);
12781
12781
  }
12782
12782
  return (y = n.applicantForm) != null && y.visibleFields ? n.applicantForm.visibleFields : l != null && l.companyFormVisibleFields && l.companyFormVisibleFields.length > 0 ? l.companyFormVisibleFields : _i;
12783
12783
  }, [(Ie = n.applicantForm) == null ? void 0 : Ie.visibleFields, l == null ? void 0 : l.companyFormVisibleFields, T]), P = /* @__PURE__ */ new Set(["countryResidence", "addressCountry"]), D = Ye(() => {
12784
- var g, I;
12784
+ var f, I;
12785
12785
  const y = /* @__PURE__ */ new Set();
12786
12786
  if (T)
12787
12787
  for (const A of T)
12788
12788
  for (const K of A.fields)
12789
- !K.isCustom && K.name && P.has(K.name) && y.add(K.countriesType ?? ((g = vt[K.name]) == null ? void 0 : g.countriesType));
12789
+ !K.isCustom && K.name && P.has(K.name) && y.add(K.countriesType ?? ((f = vt[K.name]) == null ? void 0 : f.countriesType));
12790
12790
  else
12791
12791
  for (const A of U)
12792
12792
  P.has(A) && y.add((I = vt[A]) == null ? void 0 : I.countriesType);
@@ -12803,8 +12803,8 @@ const Za = ({
12803
12803
  return;
12804
12804
  }
12805
12805
  h(!0);
12806
- const g = y.map((A) => A != null ? String(A) : "all");
12807
- g.forEach((A) => L.current.add(A)), (async () => {
12806
+ const f = y.map((A) => A != null ? String(A) : "all");
12807
+ f.forEach((A) => L.current.add(A)), (async () => {
12808
12808
  try {
12809
12809
  const A = await Promise.all(
12810
12810
  y.map(async (K) => {
@@ -12814,15 +12814,15 @@ const Za = ({
12814
12814
  );
12815
12815
  _((K) => ({ ...K, ...Object.fromEntries(A) }));
12816
12816
  } catch (A) {
12817
- g.forEach((K) => L.current.delete(K)), console.error("Failed to load countries:", A);
12817
+ f.forEach((K) => L.current.delete(K)), console.error("Failed to load countries:", A);
12818
12818
  } finally {
12819
12819
  D.every((K) => M.current.has(K != null ? String(K) : "all")) && h(!1);
12820
12820
  }
12821
12821
  })();
12822
12822
  }, [D, l]);
12823
- const Z = (y, g) => {
12823
+ const Z = (y, f) => {
12824
12824
  var K;
12825
- const I = g ?? ((K = vt[y]) == null ? void 0 : K.countriesType), A = I != null ? String(I) : "all";
12825
+ const I = f ?? ((K = vt[y]) == null ? void 0 : K.countriesType), A = I != null ? String(I) : "all";
12826
12826
  return B[A] || [];
12827
12827
  }, ae = {
12828
12828
  companyName: 1,
@@ -12847,7 +12847,7 @@ const Za = ({
12847
12847
  }, W = Object.fromEntries(
12848
12848
  Object.entries(N).filter(([y]) => y in ae)
12849
12849
  ), [re, he] = w({
12850
- workflowKey: f,
12850
+ workflowKey: g,
12851
12851
  companyName: "",
12852
12852
  email: C,
12853
12853
  phone: "",
@@ -12870,7 +12870,7 @@ const Za = ({
12870
12870
  externalRefId: p,
12871
12871
  ...W
12872
12872
  }), [fe, De] = w({}), [se, G] = w(0), [Q, te] = w({}), [z, R] = w(null), [O, Se] = w(!1), xe = It(), q = ee(() => {
12873
- const y = Ga(), g = (I) => {
12873
+ const y = Ga(), f = (I) => {
12874
12874
  var ne;
12875
12875
  const A = (ne = vt[I]) == null ? void 0 : ne.countriesType, K = A != null ? String(A) : "all", X = (B[K] || []).filter((ve) => ve.value);
12876
12876
  if (X.length)
@@ -12881,7 +12881,7 @@ const Za = ({
12881
12881
  for (const [K, X] of Object.entries(y))
12882
12882
  if (K in I && (I[K] === "" || I[K] === null || I[K] === void 0))
12883
12883
  if (P.has(K)) {
12884
- const ne = g(K);
12884
+ const ne = f(K);
12885
12885
  ne && (A[K] = ne);
12886
12886
  } else
12887
12887
  A[K] = X;
@@ -12906,10 +12906,10 @@ const Za = ({
12906
12906
  handler: q
12907
12907
  }), () => y.unregisterAction("fill-company-form");
12908
12908
  }, [xe, q]);
12909
- const ie = (y, g) => he((I) => ({ ...I, [y]: g })), Te = (y, g) => De((I) => ({ ...I, [y]: g })), Ce = (y) => !y.conditionalOn || fe[y.conditionalOn] === "true", qe = (y) => {
12910
- var g;
12909
+ const ie = (y, f) => he((I) => ({ ...I, [y]: f })), Te = (y, f) => De((I) => ({ ...I, [y]: f })), Ce = (y) => !y.conditionalOn || fe[y.conditionalOn] === "true", qe = (y) => {
12910
+ var f;
12911
12911
  for (const I of y.fields) {
12912
- if (!I.isCustom || !I.paramName || !((g = I.blockingValues) != null && g.length)) continue;
12912
+ if (!I.isCustom || !I.paramName || !((f = I.blockingValues) != null && f.length)) continue;
12913
12913
  const A = fe[I.paramName] ?? "";
12914
12914
  if (I.customType === "group_checkbox") {
12915
12915
  if (A.split(",").filter(Boolean).some((X) => I.blockingValues.includes(X))) return !0;
@@ -12918,22 +12918,22 @@ const Za = ({
12918
12918
  }
12919
12919
  return !1;
12920
12920
  }, it = T && se < T.length - 1 ? se + 1 : -1, _e = T && se > 0 ? se - 1 : -1, yt = (y) => {
12921
- const g = {};
12921
+ const f = {};
12922
12922
  for (const I of y.fields)
12923
12923
  if (I.isCustom) {
12924
12924
  if (I.customType === "paragraph" || I.customType === "html" || I.customType === "br" || I.customType === "link") continue;
12925
12925
  if (I.required && I.paramName) {
12926
12926
  const A = fe[I.paramName], K = oe(I.displayText, u) || oe(I.label, u) || I.paramName;
12927
- I.customType === "checkbox" || I.customType === "link_checkbox" ? A !== "true" && (g[I.paramName] = u("validation.fieldRequired", { field: K })) : (!A || A.trim() === "") && (g[I.paramName] = u("validation.fieldRequired", { field: K }));
12927
+ I.customType === "checkbox" || I.customType === "link_checkbox" ? A !== "true" && (f[I.paramName] = u("validation.fieldRequired", { field: K })) : (!A || A.trim() === "") && (f[I.paramName] = u("validation.fieldRequired", { field: K }));
12928
12928
  }
12929
12929
  } else if (I.name) {
12930
12930
  const A = I.name;
12931
12931
  if ($.includes(A) && qt(re[A])) {
12932
12932
  const K = vt[A], X = oe(I.displayText, u) || (K != null && K.translationKey ? u(`fields.${K.translationKey}`) : void 0) || (K == null ? void 0 : K.label) || A;
12933
- g[A] = u("validation.fieldRequired", { field: X });
12933
+ f[A] = u("validation.fieldRequired", { field: X });
12934
12934
  }
12935
12935
  }
12936
- return g;
12936
+ return f;
12937
12937
  }, Ze = async () => {
12938
12938
  if (!T) return;
12939
12939
  const y = T[se];
@@ -12942,26 +12942,26 @@ const Za = ({
12942
12942
  te({}), it >= 0 ? G(it) : await Pe();
12943
12943
  return;
12944
12944
  }
12945
- const g = yt(y);
12946
- if (Object.keys(g).length > 0) {
12947
- te(g);
12945
+ const f = yt(y);
12946
+ if (Object.keys(f).length > 0) {
12947
+ te(f);
12948
12948
  return;
12949
12949
  }
12950
12950
  te({}), it >= 0 ? G(it) : await Pe();
12951
12951
  }, Pe = async () => {
12952
12952
  var y;
12953
12953
  if (T) {
12954
- let g = {};
12954
+ let f = {};
12955
12955
  for (const I of T)
12956
- Ce(I) && (g = { ...g, ...yt(I) });
12957
- if (Object.keys(g).length > 0) {
12958
- te(g);
12956
+ Ce(I) && (f = { ...f, ...yt(I) });
12957
+ if (Object.keys(f).length > 0) {
12958
+ te(f);
12959
12959
  return;
12960
12960
  }
12961
12961
  }
12962
12962
  Se(!0), R(null);
12963
12963
  try {
12964
- const g = {
12964
+ const f = {
12965
12965
  workflowKey: re.workflowKey,
12966
12966
  externalRefId: ((y = re.externalRefId) == null ? void 0 : y.trim()) || void 0
12967
12967
  }, I = T ? T.filter((X) => Ce(X)).flatMap((X) => X.fields).filter((X) => !X.isCustom && X.name).map((X) => X.name) : U;
@@ -12970,31 +12970,31 @@ const Za = ({
12970
12970
  if (!qt(ne))
12971
12971
  switch (X) {
12972
12972
  case "companyName":
12973
- g.companyName = ne;
12973
+ f.companyName = ne;
12974
12974
  break;
12975
12975
  case "email":
12976
- g.companyEmail = ne;
12976
+ f.companyEmail = ne;
12977
12977
  break;
12978
12978
  case "phone":
12979
- g.companyPhone = ne;
12979
+ f.companyPhone = ne;
12980
12980
  break;
12981
12981
  case "registrationNumber":
12982
- g.companyRegistrationNumber = ne;
12982
+ f.companyRegistrationNumber = ne;
12983
12983
  break;
12984
12984
  case "countryResidence":
12985
- g.companyCountry = ne;
12985
+ f.companyCountry = ne;
12986
12986
  break;
12987
12987
  case "city":
12988
- g.companyCity = ne;
12988
+ f.companyCity = ne;
12989
12989
  break;
12990
12990
  case "street":
12991
- g.companyStreet = ne;
12991
+ f.companyStreet = ne;
12992
12992
  break;
12993
12993
  case "postalCode":
12994
- g.companyZip = ne;
12994
+ f.companyZip = ne;
12995
12995
  break;
12996
12996
  default:
12997
- g[X] = ne;
12997
+ f[X] = ne;
12998
12998
  break;
12999
12999
  }
13000
13000
  }
@@ -13012,27 +13012,27 @@ const Za = ({
13012
13012
  A.push({ paramName: ne.paramName, value: m });
13013
13013
  }
13014
13014
  }
13015
- A.length > 0 && (g.applicantAdditionalDatas = A);
13016
- const K = await c(g);
13015
+ A.length > 0 && (f.applicantAdditionalDatas = A);
13016
+ const K = await c(f);
13017
13017
  a(K.applicantId);
13018
- } catch (g) {
13019
- console.error("Error creating company applicant:", g), R(g.message || u("createCompany.failedToCreate"));
13018
+ } catch (f) {
13019
+ console.error("Error creating company applicant:", f), R(f.message || u("createCompany.failedToCreate"));
13020
13020
  } finally {
13021
13021
  Se(!1);
13022
13022
  }
13023
13023
  }, Je = async (y) => {
13024
13024
  y.preventDefault();
13025
- for (const g of $)
13026
- if (qt(re[g])) {
13027
- const I = vt[g], A = (I != null && I.translationKey ? u(`fields.${I.translationKey}`) : void 0) || (I == null ? void 0 : I.label) || g;
13025
+ for (const f of $)
13026
+ if (qt(re[f])) {
13027
+ const I = vt[f], A = (I != null && I.translationKey ? u(`fields.${I.translationKey}`) : void 0) || (I == null ? void 0 : I.label) || f;
13028
13028
  R(u("validation.fieldRequired", { field: A }));
13029
13029
  return;
13030
13030
  }
13031
13031
  await Pe();
13032
- }, mt = (y, g, I, A, K) => {
13032
+ }, mt = (y, f, I, A, K) => {
13033
13033
  const X = vt[y];
13034
13034
  if (!X) return null;
13035
- const ne = $.includes(y), ve = Q[y], m = oe(I, u) || (X.translationKey ? u(`fields.${X.translationKey}`) : void 0) || X.label, j = y in W, E = g ?? y, k = K ? K !== "placeholder" : F, v = k ? m : void 0;
13035
+ const ne = $.includes(y), ve = Q[y], m = oe(I, u) || (X.translationKey ? u(`fields.${X.translationKey}`) : void 0) || X.label, j = y in W, E = f ?? y, k = K ? K !== "placeholder" : F, v = k ? m : void 0;
13036
13036
  switch (X.type) {
13037
13037
  case "select":
13038
13038
  if (y === "countryResidence" || y === "addressCountry") {
@@ -13114,7 +13114,7 @@ const Za = ({
13114
13114
  E
13115
13115
  );
13116
13116
  }
13117
- }, rt = (y, g) => {
13117
+ }, rt = (y, f) => {
13118
13118
  if (y.customType === "paragraph")
13119
13119
  return /* @__PURE__ */ i(
13120
13120
  "p",
@@ -13122,12 +13122,12 @@ const Za = ({
13122
13122
  style: { fontSize: "14px", lineHeight: "1.7", margin: 0, color: "var(--metakyc-text-secondary, #6b7280)" },
13123
13123
  dangerouslySetInnerHTML: { __html: oe(y.displayText, u) || oe(y.label, u) || "" }
13124
13124
  },
13125
- `custom-${g}`
13125
+ `custom-${f}`
13126
13126
  );
13127
13127
  if (y.customType === "html")
13128
- return /* @__PURE__ */ i("div", { dangerouslySetInnerHTML: { __html: oe(y.label, u) || "" } }, `custom-${g}`);
13128
+ return /* @__PURE__ */ i("div", { dangerouslySetInnerHTML: { __html: oe(y.label, u) || "" } }, `custom-${f}`);
13129
13129
  if (y.customType === "br")
13130
- return /* @__PURE__ */ i("div", { style: { height: "12px" } }, `custom-${g}`);
13130
+ return /* @__PURE__ */ i("div", { style: { height: "12px" } }, `custom-${f}`);
13131
13131
  if (y.customType === "link")
13132
13132
  return /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(
13133
13133
  "a",
@@ -13138,7 +13138,7 @@ const Za = ({
13138
13138
  style: { color: "var(--metakyc-primary, #2563eb)", fontSize: "14px", textDecoration: "underline" },
13139
13139
  children: oe(y.displayText, u) || oe(y.label, u) || y.linkText || y.linkUrl || ""
13140
13140
  }
13141
- ) }, `custom-${g}`);
13141
+ ) }, `custom-${f}`);
13142
13142
  if (!y.paramName) return null;
13143
13143
  const I = Q[y.paramName], A = oe(y.displayText, u) || oe(y.label, u) || y.paramName, K = y.labelMode ? y.labelMode !== "placeholder" : F;
13144
13144
  if (y.customType === "checkbox") {
@@ -13167,7 +13167,7 @@ const Za = ({
13167
13167
  }
13168
13168
  ),
13169
13169
  I && /* @__PURE__ */ i("p", { className: "text-xs mt-0.5", style: { color: "var(--metakyc-danger, #ef4444)" }, children: I })
13170
- ] }, `custom-${g}`);
13170
+ ] }, `custom-${f}`);
13171
13171
  }
13172
13172
  return /* @__PURE__ */ i(
13173
13173
  Le,
@@ -13180,23 +13180,23 @@ const Za = ({
13180
13180
  required: y.required,
13181
13181
  error: I
13182
13182
  },
13183
- `custom-${g}`
13183
+ `custom-${f}`
13184
13184
  );
13185
13185
  }, b = (y) => {
13186
- const g = Ce(y);
13186
+ const f = Ce(y);
13187
13187
  return /* @__PURE__ */ s("div", { className: "space-y-4", children: [
13188
13188
  y.conditionalOn && /* @__PURE__ */ s(
13189
13189
  "div",
13190
13190
  {
13191
13191
  role: "checkbox",
13192
- "aria-checked": g,
13193
- onClick: () => Te(y.conditionalOn, g ? "false" : "true"),
13192
+ "aria-checked": f,
13193
+ onClick: () => Te(y.conditionalOn, f ? "false" : "true"),
13194
13194
  style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer", userSelect: "none" },
13195
13195
  children: [
13196
13196
  /* @__PURE__ */ i(
13197
13197
  tt,
13198
13198
  {
13199
- checked: g,
13199
+ checked: f,
13200
13200
  onChange: (I) => Te(y.conditionalOn, I ? "true" : "false")
13201
13201
  }
13202
13202
  ),
@@ -13204,7 +13204,7 @@ const Za = ({
13204
13204
  ]
13205
13205
  }
13206
13206
  ),
13207
- g && /* @__PURE__ */ i("div", { className: "metakyc-form-grid", children: y.fields.map((I, A) => {
13207
+ f && /* @__PURE__ */ i("div", { className: "metakyc-form-grid", children: y.fields.map((I, A) => {
13208
13208
  const K = Math.min(4, Math.max(1, Number(I.colSpan) || 4)), X = I.isCustom ? `custom-${A}-${I.paramName}` : `builtin-${I.name}-${A}`;
13209
13209
  return /* @__PURE__ */ i("div", { style: { gridColumn: `span ${K} / span ${K}` }, children: I.isCustom ? rt(I, A) : mt(I.name, X, I.displayText, I.countriesType, I.labelMode) }, X);
13210
13210
  }) })
@@ -13216,7 +13216,7 @@ const Za = ({
13216
13216
  /* @__PURE__ */ i("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: u("common.loadingForm") })
13217
13217
  ] }) }) });
13218
13218
  if (T) {
13219
- const y = T[se] ?? T[0], g = _e === -1, I = it === -1, A = T.length, K = Ce(y), X = qe(y), ne = Object.values(Q), ve = !K && !!y.conditionalOn && y.conditionalMode === "block", m = O || d || ve || X;
13219
+ const y = T[se] ?? T[0], f = _e === -1, I = it === -1, A = T.length, K = Ce(y), X = qe(y), ne = Object.values(Q), ve = !K && !!y.conditionalOn && y.conditionalMode === "block", m = O || d || ve || X;
13220
13220
  let j;
13221
13221
  return ve || X ? j = u("common.blocked") : I ? j = y.conditionalOn && !K ? u("common.skipAndSubmit") : u("common.submit") : j = y.conditionalOn && !K ? u("common.skip") : u("common.next"), /* @__PURE__ */ i("div", { className: "metakyc-sdk", children: /* @__PURE__ */ s(me, { children: [
13222
13222
  /* @__PURE__ */ i(Fe, { children: /* @__PURE__ */ i(Tt, { title: (l == null ? void 0 : l.title) || u("createCompany.title") }) }),
@@ -13259,7 +13259,7 @@ const Za = ({
13259
13259
  ] }),
13260
13260
  /* @__PURE__ */ s(Oe, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
13261
13261
  /* @__PURE__ */ s("div", { children: [
13262
- !g && /* @__PURE__ */ i(
13262
+ !f && /* @__PURE__ */ i(
13263
13263
  le,
13264
13264
  {
13265
13265
  type: "button",
@@ -13271,7 +13271,7 @@ const Za = ({
13271
13271
  children: u("common.previous")
13272
13272
  }
13273
13273
  ),
13274
- g && r && /* @__PURE__ */ i(le, { type: "button", variant: "outline", onClick: r, disabled: O || d, children: "Cancel" })
13274
+ f && r && /* @__PURE__ */ i(le, { type: "button", variant: "outline", onClick: r, disabled: O || d, children: "Cancel" })
13275
13275
  ] }),
13276
13276
  /* @__PURE__ */ i(le, { type: "button", isLoading: O || d, disabled: m, onClick: I ? Pe : Ze, children: j })
13277
13277
  ] })
@@ -13306,7 +13306,7 @@ const Za = ({
13306
13306
  progress: c,
13307
13307
  currentStep: d,
13308
13308
  steps: u,
13309
- nextWorkflowKey: f,
13309
+ nextWorkflowKey: g,
13310
13310
  hasWorkflowChanged: p,
13311
13311
  isLoading: C,
13312
13312
  error: N,
@@ -13487,15 +13487,15 @@ const Za = ({
13487
13487
  }, [c == null ? void 0 : c.workflowResult, t]);
13488
13488
  const he = we.useRef(!1);
13489
13489
  if (we.useEffect(() => {
13490
- if (!p || !f || !e || he.current) return;
13490
+ if (!p || !g || !e || he.current) return;
13491
13491
  he.current = !0;
13492
13492
  let G = !1;
13493
13493
  return $(!0), P(null), (async () => {
13494
13494
  try {
13495
- H.info(`[SDK] Auto-duplicating applicant ${e} → workflow ${f}`);
13495
+ H.info(`[SDK] Auto-duplicating applicant ${e} → workflow ${g}`);
13496
13496
  const Q = await l.duplicateApplicant({
13497
13497
  applicantId: e,
13498
- workflowKey: f
13498
+ workflowKey: g
13499
13499
  });
13500
13500
  if (G) return;
13501
13501
  H.info(`[SDK] Duplicated → new applicantId=${Q.applicantId}`), r && r(Q.applicantId);
@@ -13509,7 +13509,7 @@ const Za = ({
13509
13509
  })(), () => {
13510
13510
  G = !0;
13511
13511
  };
13512
- }, [p, f, e, l, r]), C || T || !c)
13512
+ }, [p, g, e, l, r]), C || T || !c)
13513
13513
  return /* @__PURE__ */ i("div", { className: `metakyc-sdk ${n || ""}`, children: /* @__PURE__ */ i(me, { children: /* @__PURE__ */ s(ue, { children: [
13514
13514
  /* @__PURE__ */ i(Ge, { className: "my-8" }),
13515
13515
  /* @__PURE__ */ i("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: o("workflow.loadingWorkflow") })
@@ -13686,7 +13686,7 @@ const Za = ({
13686
13686
  gap: "0"
13687
13687
  },
13688
13688
  children: e.map((l, c) => {
13689
- const d = c < t, u = c === t, f = d || u, p = l.displayName || l.name || a(l.action) || `Step ${c + 1}`;
13689
+ const d = c < t, u = c === t, g = d || u, p = l.displayName || l.name || a(l.action) || `Step ${c + 1}`;
13690
13690
  return /* @__PURE__ */ s(we.Fragment, { children: [
13691
13691
  /* @__PURE__ */ s(
13692
13692
  "div",
@@ -13709,7 +13709,7 @@ const Za = ({
13709
13709
  fontWeight: 600,
13710
13710
  flexShrink: 0,
13711
13711
  transition: "all 0.2s ease",
13712
- ...f ? {
13712
+ ...g ? {
13713
13713
  backgroundColor: "var(--metakyc-primary, #2563eb)",
13714
13714
  color: "#ffffff",
13715
13715
  border: "none"
@@ -13771,14 +13771,14 @@ const hi = ({
13771
13771
  phase: c,
13772
13772
  applicantId: d,
13773
13773
  isCompany: u,
13774
- workflowKey: f,
13774
+ workflowKey: g,
13775
13775
  error: p,
13776
13776
  isLoading: C,
13777
13777
  transitionToWorkflow: N,
13778
13778
  switchApplicant: x,
13779
13779
  refresh: F
13780
13780
  } = ea(e);
13781
- rn(c, d, u, f);
13781
+ rn(c, d, u, g);
13782
13782
  const T = It();
13783
13783
  we.useEffect(() => {
13784
13784
  const D = T.current;
@@ -13807,7 +13807,7 @@ const hi = ({
13807
13807
  /* @__PURE__ */ i("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: (p == null ? void 0 : p.message) || "An unexpected error occurred." })
13808
13808
  ] }) }) }) });
13809
13809
  if (c === "create_applicant") {
13810
- const D = f || ((U = l.applicantForm) == null ? void 0 : U.workflowKey), B = (P = l.applicantForm) == null ? void 0 : P.externalRefId;
13810
+ const D = g || ((U = l.applicantForm) == null ? void 0 : U.workflowKey), B = (P = l.applicantForm) == null ? void 0 : P.externalRefId;
13811
13811
  return u ? /* @__PURE__ */ i("div", { className: `metakyc-sdk ${n || ""}`, children: /* @__PURE__ */ i(
13812
13812
  Za,
13813
13813
  {