@vpdev2/metakyc-sdk 1.0.7 → 1.0.9

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
@@ -2,12 +2,12 @@ var Je = Object.defineProperty;
2
2
  var Xe = (t, e, r) => e in t ? Je(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
3
  var K = (t, e, r) => Xe(t, typeof e != "symbol" ? e + "" : e, r);
4
4
  import et from "axios";
5
- import * as Te from "react";
6
- import le, { createContext as tt, useState as x, useMemo as je, useEffect as V, useContext as rt, useRef as ve, useCallback as q, forwardRef as Pe } from "react";
5
+ import * as Me from "react";
6
+ import ie, { createContext as tt, useState as N, useMemo as Re, useEffect as Y, useContext as rt, useRef as H, useCallback as q, forwardRef as Le } from "react";
7
7
  import { jsx as n, jsxs as o, Fragment as nt } from "react/jsx-runtime";
8
- import { get as Ie, set as Ae, appendErrors as _e, useForm as Fe, Controller as G } from "react-hook-form";
9
- import { z as de } from "zod";
10
- var U = /* @__PURE__ */ ((t) => (t[t.IdentitySdk = 0] = "IdentitySdk", t[t.RiskScoring = 1] = "RiskScoring", t[t.Questionaries = 2] = "Questionaries", t[t.AdditionalData = 3] = "AdditionalData", t[t.AppropriatenessTest = 4] = "AppropriatenessTest", t[t.UploadDocument = 5] = "UploadDocument", t[t.ManualReview = 6] = "ManualReview", t[t.Overview = 7] = "Overview", t[t.InvestorCategorization = 8] = "InvestorCategorization", t))(U || {}), ke = /* @__PURE__ */ ((t) => (t[t.NotStarted = 0] = "NotStarted", t[t.InProgress = 1] = "InProgress", t[t.Success = 2] = "Success", t[t.PartialSuccess = 3] = "PartialSuccess", t[t.Failed = 4] = "Failed", t[t.Skipped = 5] = "Skipped", t[t.AdminReview = 6] = "AdminReview", t[t.SkippedAndAdminReview = 7] = "SkippedAndAdminReview", t))(ke || {}), ae = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.InProgress = 1] = "InProgress", t[t.Finished = 2] = "Finished", t[t.OnHold = 3] = "OnHold", t[t.IdentityPending = 4] = "IdentityPending", t))(ae || {}), st = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.RepresentativeKYC = 1] = "RepresentativeKYC", t[t.ManualRiskCriteria = 2] = "ManualRiskCriteria", t[t.UploadDocumentReview = 3] = "UploadDocumentReview", t[t.AdminReview = 4] = "AdminReview", t))(st || {}), at = /* @__PURE__ */ ((t) => (t[t.LowRisk = 0] = "LowRisk", t[t.MediumRisk = 1] = "MediumRisk", t[t.HighRisk = 2] = "HighRisk", t[t.Alert = 3] = "Alert", t))(at || {}), he = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.Pending = 1] = "Pending", t[t.Approved = 2] = "Approved", t[t.Rejected = 3] = "Rejected", t[t.ResendRequested = 4] = "ResendRequested", t[t.Unknown = 5] = "Unknown", t[t.InProgress = 6] = "InProgress", t))(he || {}), pe = /* @__PURE__ */ ((t) => (t[t.Approved = 0] = "Approved", t[t.Reject = 1] = "Reject", t[t.UnderReview = 2] = "UnderReview", t[t.Closed = 3] = "Closed", t[t.AdminReview = 4] = "AdminReview", t[t.New = 5] = "New", t[t.InProgress = 6] = "InProgress", t))(pe || {}), it = /* @__PURE__ */ ((t) => (t[t.ProviderResultPending = 0] = "ProviderResultPending", t[t.ProviderResultReceived = 1] = "ProviderResultReceived", t[t.Canceled = 2] = "Canceled", t[t.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", t))(it || {}), ot = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.ProviderResultPending = 1] = "ProviderResultPending", t[t.ProviderResultReceived = 2] = "ProviderResultReceived", t[t.Canceled = 3] = "Canceled", t))(ot || {}), se = /* @__PURE__ */ ((t) => (t[t.Onfido = 0] = "Onfido", t[t.Sumsub = 2] = "Sumsub", t[t.SardinAI = 3] = "SardinAI", t))(se || {}), lt = /* @__PURE__ */ ((t) => (t[t.Individual = 0] = "Individual", t[t.Company = 1] = "Company", t))(lt || {}), Ne = /* @__PURE__ */ ((t) => (t[t.Male = 0] = "Male", t[t.Female = 1] = "Female", t[t.Other = 2] = "Other", t))(Ne || {}), ct = /* @__PURE__ */ ((t) => (t[t.Image = 0] = "Image", t[t.Video = 1] = "Video", t[t.PDF = 2] = "PDF", t[t.OfficePDF = 3] = "OfficePDF", t[t.Custom = 4] = "Custom", t))(ct || {}), dt = /* @__PURE__ */ ((t) => (t[t.Pending = 0] = "Pending", t[t.Approved = 1] = "Approved", t[t.Rejected = 2] = "Rejected", t[t.RequiresRevision = 3] = "RequiresRevision", t))(dt || {}), ut = /* @__PURE__ */ ((t) => (t[t.SingleChoice = 0] = "SingleChoice", t[t.MultipleChoice = 1] = "MultipleChoice", t[t.Text = 2] = "Text", t))(ut || {}), Re = /* @__PURE__ */ ((t) => (t[t.String = 0] = "String", t[t.Integer = 1] = "Integer", t[t.Decimal = 2] = "Decimal", t[t.Boolean = 3] = "Boolean", t[t.Date = 4] = "Date", t[t.Country = 5] = "Country", t[t.DigitOnly = 6] = "DigitOnly", t))(Re || {}), mt = /* @__PURE__ */ ((t) => (t[t.Text = 0] = "Text", t[t.Radio = 1] = "Radio", t[t.Checkbox = 2] = "Checkbox", t[t.Dropdown = 3] = "Dropdown", t[t.Country = 4] = "Country", t))(mt || {}), ht = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.Country = 1] = "Country", t))(ht || {}), ee = /* @__PURE__ */ ((t) => (t[t.Individual = 0] = "Individual", t[t.Sophisticated = 1] = "Sophisticated", t[t.HighNetWorth = 2] = "HighNetWorth", t[t.Business = 3] = "Business", t))(ee || {}), pt = /* @__PURE__ */ ((t) => (t[t.Retail = 0] = "Retail", t[t.Professional = 1] = "Professional", t[t.EligibleCounterparty = 2] = "EligibleCounterparty", t))(pt || {});
8
+ import { get as De, set as Ee, appendErrors as _e, useForm as Te, Controller as J } from "react-hook-form";
9
+ import { z as ue } from "zod";
10
+ var U = /* @__PURE__ */ ((t) => (t[t.IdentitySdk = 0] = "IdentitySdk", t[t.RiskScoring = 1] = "RiskScoring", t[t.Questionaries = 2] = "Questionaries", t[t.AdditionalData = 3] = "AdditionalData", t[t.AppropriatenessTest = 4] = "AppropriatenessTest", t[t.UploadDocument = 5] = "UploadDocument", t[t.ManualReview = 6] = "ManualReview", t[t.Overview = 7] = "Overview", t[t.InvestorCategorization = 8] = "InvestorCategorization", t))(U || {}), Ne = /* @__PURE__ */ ((t) => (t[t.NotStarted = 0] = "NotStarted", t[t.InProgress = 1] = "InProgress", t[t.Success = 2] = "Success", t[t.PartialSuccess = 3] = "PartialSuccess", t[t.Failed = 4] = "Failed", t[t.Skipped = 5] = "Skipped", t[t.AdminReview = 6] = "AdminReview", t[t.SkippedAndAdminReview = 7] = "SkippedAndAdminReview", t))(Ne || {}), le = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.InProgress = 1] = "InProgress", t[t.Finished = 2] = "Finished", t[t.OnHold = 3] = "OnHold", t[t.IdentityPending = 4] = "IdentityPending", t))(le || {}), st = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.RepresentativeKYC = 1] = "RepresentativeKYC", t[t.ManualRiskCriteria = 2] = "ManualRiskCriteria", t[t.UploadDocumentReview = 3] = "UploadDocumentReview", t[t.AdminReview = 4] = "AdminReview", t))(st || {}), at = /* @__PURE__ */ ((t) => (t[t.LowRisk = 0] = "LowRisk", t[t.MediumRisk = 1] = "MediumRisk", t[t.HighRisk = 2] = "HighRisk", t[t.Alert = 3] = "Alert", t))(at || {}), pe = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.Pending = 1] = "Pending", t[t.Approved = 2] = "Approved", t[t.Rejected = 3] = "Rejected", t[t.ResendRequested = 4] = "ResendRequested", t[t.Unknown = 5] = "Unknown", t[t.InProgress = 6] = "InProgress", t))(pe || {}), ge = /* @__PURE__ */ ((t) => (t[t.Approved = 0] = "Approved", t[t.Reject = 1] = "Reject", t[t.UnderReview = 2] = "UnderReview", t[t.Closed = 3] = "Closed", t[t.AdminReview = 4] = "AdminReview", t[t.New = 5] = "New", t[t.InProgress = 6] = "InProgress", t))(ge || {}), it = /* @__PURE__ */ ((t) => (t[t.ProviderResultPending = 0] = "ProviderResultPending", t[t.ProviderResultReceived = 1] = "ProviderResultReceived", t[t.Canceled = 2] = "Canceled", t[t.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", t))(it || {}), ot = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.ProviderResultPending = 1] = "ProviderResultPending", t[t.ProviderResultReceived = 2] = "ProviderResultReceived", t[t.Canceled = 3] = "Canceled", t))(ot || {}), oe = /* @__PURE__ */ ((t) => (t[t.Onfido = 0] = "Onfido", t[t.Sumsub = 2] = "Sumsub", t[t.SardinAI = 3] = "SardinAI", t))(oe || {}), lt = /* @__PURE__ */ ((t) => (t[t.Individual = 0] = "Individual", t[t.Company = 1] = "Company", t))(lt || {}), Se = /* @__PURE__ */ ((t) => (t[t.Male = 0] = "Male", t[t.Female = 1] = "Female", t[t.Other = 2] = "Other", t))(Se || {}), ct = /* @__PURE__ */ ((t) => (t[t.Image = 0] = "Image", t[t.Video = 1] = "Video", t[t.PDF = 2] = "PDF", t[t.OfficePDF = 3] = "OfficePDF", t[t.Custom = 4] = "Custom", t))(ct || {}), dt = /* @__PURE__ */ ((t) => (t[t.Pending = 0] = "Pending", t[t.Approved = 1] = "Approved", t[t.Rejected = 2] = "Rejected", t[t.RequiresRevision = 3] = "RequiresRevision", t))(dt || {}), ut = /* @__PURE__ */ ((t) => (t[t.SingleChoice = 0] = "SingleChoice", t[t.MultipleChoice = 1] = "MultipleChoice", t[t.Text = 2] = "Text", t))(ut || {}), Pe = /* @__PURE__ */ ((t) => (t[t.String = 0] = "String", t[t.Integer = 1] = "Integer", t[t.Decimal = 2] = "Decimal", t[t.Boolean = 3] = "Boolean", t[t.Date = 4] = "Date", t[t.Country = 5] = "Country", t[t.DigitOnly = 6] = "DigitOnly", t))(Pe || {}), mt = /* @__PURE__ */ ((t) => (t[t.Text = 0] = "Text", t[t.Radio = 1] = "Radio", t[t.Checkbox = 2] = "Checkbox", t[t.Dropdown = 3] = "Dropdown", t[t.Country = 4] = "Country", t))(mt || {}), ht = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.Country = 1] = "Country", t))(ht || {}), re = /* @__PURE__ */ ((t) => (t[t.Individual = 0] = "Individual", t[t.Sophisticated = 1] = "Sophisticated", t[t.HighNetWorth = 2] = "HighNetWorth", t[t.Business = 3] = "Business", t))(re || {}), pt = /* @__PURE__ */ ((t) => (t[t.Retail = 0] = "Retail", t[t.Professional = 1] = "Professional", t[t.EligibleCounterparty = 2] = "EligibleCounterparty", t))(pt || {});
11
11
  const gt = [
12
12
  "firstName",
13
13
  "lastName",
@@ -71,7 +71,7 @@ const gt = [
71
71
  taxNumber: { label: "Tax Number", type: "text" },
72
72
  externalRefId: { label: "External Reference ID", type: "text" }
73
73
  };
74
- var Y = /* @__PURE__ */ ((t) => (t.Default = "default", t.Corporate = "corporate", t.Fintech = "fintech", t.Healthcare = "healthcare", t.Modern = "modern", t.Minimal = "minimal", t))(Y || {});
74
+ var W = /* @__PURE__ */ ((t) => (t.Default = "default", t.Corporate = "corporate", t.Fintech = "fintech", t.Healthcare = "healthcare", t.Modern = "modern", t.Minimal = "minimal", t))(W || {});
75
75
  const ft = {
76
76
  timeout: 3e4,
77
77
  retries: 3,
@@ -120,19 +120,19 @@ class bt {
120
120
  }[e] || e;
121
121
  }
122
122
  }
123
- class ce extends Error {
124
- constructor(r, s, a, i, c) {
123
+ class de extends Error {
124
+ constructor(r, s, a, i, l) {
125
125
  super(r);
126
126
  K(this, "response");
127
- this.code = s, this.details = a, this.validationErrors = i, this.name = "MetaKYCError", this.response = c, Object.setPrototypeOf(this, ce.prototype);
127
+ this.code = s, this.details = a, this.validationErrors = i, this.name = "MetaKYCError", this.response = l, Object.setPrototypeOf(this, de.prototype);
128
128
  }
129
129
  }
130
- class be {
130
+ class ve {
131
131
  /**
132
132
  * Process an error from the API response
133
133
  */
134
134
  static handleApiError(e) {
135
- return new ce(
135
+ return new de(
136
136
  e.message || "An unknown error occurred",
137
137
  e.code,
138
138
  e.details || void 0,
@@ -145,39 +145,39 @@ class be {
145
145
  static handleAxiosError(e) {
146
146
  if (e.response) {
147
147
  const r = e.response.data;
148
- return r && r.error ? new ce(
148
+ return r && r.error ? new de(
149
149
  r.error.message || "An unknown error occurred",
150
150
  r.error.code,
151
151
  r.error.details || void 0,
152
152
  r.error.validationErrors || void 0,
153
153
  e.response
154
- ) : r && r.result && r.result.message ? new ce(
154
+ ) : r && r.result && r.result.message ? new de(
155
155
  r.result.message,
156
156
  e.response.status,
157
157
  `HTTP ${e.response.status}: ${e.response.statusText}`,
158
158
  void 0,
159
159
  e.response
160
- ) : new ce(
160
+ ) : new de(
161
161
  (r == null ? void 0 : r.message) || e.message || "Request failed",
162
162
  e.response.status,
163
163
  `HTTP ${e.response.status}: ${e.response.statusText}`,
164
164
  void 0,
165
165
  e.response
166
166
  );
167
- } else return e.request ? new ce(
167
+ } else return e.request ? new de(
168
168
  "No response from server",
169
169
  0,
170
170
  "The request was made but no response was received. Please check your network connection."
171
- ) : new ce(e.message || "An unexpected error occurred", 0, e.toString());
171
+ ) : new de(e.message || "An unexpected error occurred", 0, e.toString());
172
172
  }
173
173
  /**
174
174
  * Check if an error is a MetaKYCError
175
175
  */
176
176
  static isMetaKYCError(e) {
177
- return e instanceof ce;
177
+ return e instanceof de;
178
178
  }
179
179
  }
180
- class xt {
180
+ class vt {
181
181
  constructor(e) {
182
182
  K(this, "axiosInstance");
183
183
  K(this, "endpointBuilder");
@@ -218,7 +218,7 @@ class xt {
218
218
  });
219
219
  return this.handleResponse(i);
220
220
  } catch (a) {
221
- throw be.handleAxiosError(a);
221
+ throw ve.handleAxiosError(a);
222
222
  }
223
223
  }
224
224
  /**
@@ -229,7 +229,7 @@ class xt {
229
229
  const a = this.buildEndpoint(e, r), i = await this.axiosInstance.post(a, s);
230
230
  return this.handleResponse(i);
231
231
  } catch (a) {
232
- throw be.handleAxiosError(a);
232
+ throw ve.handleAxiosError(a);
233
233
  }
234
234
  }
235
235
  /**
@@ -240,7 +240,7 @@ class xt {
240
240
  const a = this.buildEndpoint(e, r), i = await this.axiosInstance.put(a, s);
241
241
  return this.handleResponse(i);
242
242
  } catch (a) {
243
- throw be.handleAxiosError(a);
243
+ throw ve.handleAxiosError(a);
244
244
  }
245
245
  }
246
246
  /**
@@ -253,7 +253,7 @@ class xt {
253
253
  });
254
254
  return this.handleResponse(i);
255
255
  } catch (a) {
256
- throw be.handleAxiosError(a);
256
+ throw ve.handleAxiosError(a);
257
257
  }
258
258
  }
259
259
  /**
@@ -262,7 +262,7 @@ class xt {
262
262
  handleResponse(e) {
263
263
  const r = e.data;
264
264
  if (!r.success && r.error)
265
- throw be.handleApiError(r.error);
265
+ throw ve.handleApiError(r.error);
266
266
  return r;
267
267
  }
268
268
  /**
@@ -272,7 +272,7 @@ class xt {
272
272
  return this.axiosInstance;
273
273
  }
274
274
  }
275
- class vt {
275
+ class xt {
276
276
  constructor(e) {
277
277
  this.httpClient = e;
278
278
  }
@@ -646,7 +646,7 @@ class It {
646
646
  )).result;
647
647
  }
648
648
  }
649
- const Q = {
649
+ const Z = {
650
650
  name: "Default",
651
651
  title: "KYC Verification",
652
652
  logo: {
@@ -880,15 +880,15 @@ const Q = {
880
880
  inputHeight: "2.25rem"
881
881
  }
882
882
  }, Tt = {
883
- [Y.Default]: Q,
884
- [Y.Corporate]: Rt,
885
- [Y.Fintech]: Dt,
886
- [Y.Healthcare]: Pt,
887
- [Y.Modern]: Ft,
888
- [Y.Minimal]: Lt
883
+ [W.Default]: Z,
884
+ [W.Corporate]: Rt,
885
+ [W.Fintech]: Dt,
886
+ [W.Healthcare]: Pt,
887
+ [W.Modern]: Ft,
888
+ [W.Minimal]: Lt
889
889
  };
890
890
  function xe(t) {
891
- return Tt[t] || Q;
891
+ return Tt[t] || Z;
892
892
  }
893
893
  class Mt {
894
894
  constructor(e) {
@@ -905,8 +905,8 @@ class Mt {
905
905
  "GetThemeConfiguration"
906
906
  );
907
907
  if (!r.result.isEnabled)
908
- return xe(Y.Default);
909
- let s = r.result.preset ? xe(r.result.preset) : xe(Y.Default);
908
+ return xe(W.Default);
909
+ let s = r.result.preset ? xe(r.result.preset) : xe(W.Default);
910
910
  return r.result.title && (s.title = r.result.title), r.result.logo && (s.logo = { ...s.logo, ...r.result.logo }), r.result.colors && (s.colors = { ...s.colors, ...r.result.colors }), r.result.typography && (s.typography = { ...s.typography, ...r.result.typography }), r.result.spacing && (s.spacing = { ...s.spacing, ...r.result.spacing }), r.result.customCSS && (s.customCSS = r.result.customCSS), r.result.darkMode && (s.darkMode = {
911
911
  colors: {
912
912
  ...(e = s.darkMode) == null ? void 0 : e.colors,
@@ -914,7 +914,7 @@ class Mt {
914
914
  }
915
915
  }), s;
916
916
  } catch (r) {
917
- return console.warn("[ThemeService] Failed to fetch theme configuration:", r), xe(Y.Default);
917
+ return console.warn("[ThemeService] Failed to fetch theme configuration:", r), xe(W.Default);
918
918
  }
919
919
  }
920
920
  /**
@@ -928,12 +928,12 @@ class Mt {
928
928
  */
929
929
  getAvailablePresets() {
930
930
  return [
931
- { id: Y.Default, name: "Default" },
932
- { id: Y.Corporate, name: "Corporate" },
933
- { id: Y.Fintech, name: "Fintech" },
934
- { id: Y.Healthcare, name: "Healthcare" },
935
- { id: Y.Modern, name: "Modern" },
936
- { id: Y.Minimal, name: "Minimal" }
931
+ { id: W.Default, name: "Default" },
932
+ { id: W.Corporate, name: "Corporate" },
933
+ { id: W.Fintech, name: "Fintech" },
934
+ { id: W.Healthcare, name: "Healthcare" },
935
+ { id: W.Modern, name: "Modern" },
936
+ { id: W.Minimal, name: "Minimal" }
937
937
  ];
938
938
  }
939
939
  /**
@@ -1034,7 +1034,7 @@ class Ot {
1034
1034
  */
1035
1035
  get status() {
1036
1036
  var e;
1037
- return ((e = this._progress) == null ? void 0 : e.status) || ae.None;
1037
+ return ((e = this._progress) == null ? void 0 : e.status) || le.None;
1038
1038
  }
1039
1039
  /**
1040
1040
  * Get workflow result
@@ -1053,19 +1053,19 @@ class Ot {
1053
1053
  * Check if workflow is complete
1054
1054
  */
1055
1055
  get isComplete() {
1056
- return this.status === ae.Finished;
1056
+ return this.status === le.Finished;
1057
1057
  }
1058
1058
  /**
1059
1059
  * Check if workflow is on hold
1060
1060
  */
1061
1061
  get isOnHold() {
1062
- return this.status === ae.OnHold;
1062
+ return this.status === le.OnHold;
1063
1063
  }
1064
1064
  /**
1065
1065
  * Check if workflow is in progress
1066
1066
  */
1067
1067
  get isInProgress() {
1068
- return this.status === ae.InProgress;
1068
+ return this.status === le.InProgress;
1069
1069
  }
1070
1070
  /**
1071
1071
  * Set applicant ID
@@ -1079,7 +1079,7 @@ class Ot {
1079
1079
  updateProgress(e) {
1080
1080
  var s, a;
1081
1081
  const r = (s = this._progress) == null ? void 0 : s.currentStep;
1082
- this._progress = e, this._applicantId = e.applicantId, this._error = null, this.events.emit("progressUpdated", e), (r == null ? void 0 : r.order) !== ((a = e.currentStep) == null ? void 0 : a.order) && this.events.emit("stepChanged", e.currentStep), this.events.emit("statusChanged", e.status), e.status === ae.Finished && e.workflowResult && this.events.emit("completed", e.workflowResult);
1082
+ this._progress = e, this._applicantId = e.applicantId, this._error = null, this.events.emit("progressUpdated", e), (r == null ? void 0 : r.order) !== ((a = e.currentStep) == null ? void 0 : a.order) && this.events.emit("stepChanged", e.currentStep), this.events.emit("statusChanged", e.status), e.status === le.Finished && e.workflowResult && this.events.emit("completed", e.workflowResult);
1083
1083
  }
1084
1084
  /**
1085
1085
  * Set error
@@ -1178,10 +1178,10 @@ class zt {
1178
1178
  }
1179
1179
  }
1180
1180
  class $t {
1181
- constructor(e, r, s, a, i, c, l, d) {
1181
+ constructor(e, r, s, a, i, l, c, d) {
1182
1182
  K(this, "state");
1183
1183
  K(this, "stepRouter");
1184
- this.applicantService = e, this.questionnaireService = r, this.uploadDocumentService = s, this.appropriatenessTestService = a, this.overviewService = i, this.riskScoringService = c, this.investorCategorizationService = d, this.state = new Ot(), this.stepRouter = new zt(), this.registerStepHandlers();
1184
+ this.applicantService = e, this.questionnaireService = r, this.uploadDocumentService = s, this.appropriatenessTestService = a, this.overviewService = i, this.riskScoringService = l, this.investorCategorizationService = d, this.state = new Ot(), this.stepRouter = new zt(), this.registerStepHandlers();
1185
1185
  }
1186
1186
  /**
1187
1187
  * Register all step handlers
@@ -1519,7 +1519,7 @@ class Kt {
1519
1519
  try {
1520
1520
  if (await this.loadSDK(), !window._Sardine)
1521
1521
  throw new Error("SardinAI SDK not available after loading");
1522
- const e = this.getSardineHost(), { clientId: r, environment: s, flow: a, enableBiometrics: i, enablePortScanning: c } = this.config;
1522
+ const e = this.getSardineHost(), { clientId: r, environment: s, flow: a, enableBiometrics: i, enablePortScanning: l } = this.config;
1523
1523
  this.sardineContext = window._Sardine.createContext({
1524
1524
  clientId: r,
1525
1525
  sessionKey: this.sessionKey,
@@ -1530,16 +1530,16 @@ class Kt {
1530
1530
  parentElement: document.body,
1531
1531
  enableBiometrics: i !== !1,
1532
1532
  // Default true
1533
- enablePortScanning: c === !0,
1533
+ enablePortScanning: l === !0,
1534
1534
  // Default false
1535
1535
  region: this.config.region,
1536
1536
  // Callback for device response (deprecated but kept for compatibility)
1537
- onDeviceResponse: (l) => {
1538
- console.log(`[SardinAI] Device ID: ${l.deviceId}`);
1537
+ onDeviceResponse: (c) => {
1538
+ console.log(`[SardinAI] Device ID: ${c.deviceId}`);
1539
1539
  },
1540
1540
  // New callback for session updates
1541
- onConfigUpdate: (l, d, u) => {
1542
- switch (l) {
1541
+ onConfigUpdate: (c, d, u) => {
1542
+ switch (c) {
1543
1543
  case "SESSION_UPDATE_FAILED":
1544
1544
  console.error("[SardinAI] Session update failed:", u);
1545
1545
  break;
@@ -1550,7 +1550,7 @@ class Kt {
1550
1550
  console.log("[SardinAI] No session update");
1551
1551
  break;
1552
1552
  default:
1553
- console.warn("[SardinAI] Unknown event:", l);
1553
+ console.warn("[SardinAI] Unknown event:", c);
1554
1554
  }
1555
1555
  }
1556
1556
  }), this.addNoScriptFallback(e), console.log("[SardinAI] SDK initialized with sessionKey:", this.sessionKey);
@@ -1603,17 +1603,17 @@ class Kt {
1603
1603
  this.sardineContext && (this.sardineContext = null);
1604
1604
  }
1605
1605
  }
1606
- class ye {
1606
+ class fe {
1607
1607
  /**
1608
1608
  * Create a provider instance
1609
1609
  */
1610
1610
  static createProvider(e, r) {
1611
1611
  switch (e) {
1612
- case se.Sumsub:
1612
+ case oe.Sumsub:
1613
1613
  return new jt(r);
1614
- case se.Onfido:
1614
+ case oe.Onfido:
1615
1615
  return new _t(r);
1616
- case se.SardinAI:
1616
+ case oe.SardinAI:
1617
1617
  return new Kt(r);
1618
1618
  default:
1619
1619
  throw new Error(`Unsupported identity provider: ${e}`);
@@ -1625,7 +1625,7 @@ class ye {
1625
1625
  static parseProviderConfig(e, r, s) {
1626
1626
  var a;
1627
1627
  switch (e) {
1628
- case se.Sumsub:
1628
+ case oe.Sumsub:
1629
1629
  return {
1630
1630
  accessToken: r.accessToken || r.token,
1631
1631
  applicantEmail: r.email,
@@ -1633,11 +1633,11 @@ class ye {
1633
1633
  externalUserId: r.externalUserId,
1634
1634
  lang: r.lang || "en"
1635
1635
  };
1636
- case se.Onfido:
1636
+ case oe.Onfido:
1637
1637
  return {
1638
1638
  token: r.token || r.sdkToken
1639
1639
  };
1640
- case se.SardinAI:
1640
+ case oe.SardinAI:
1641
1641
  const i = ((a = s == null ? void 0 : s.identityProviders) == null ? void 0 : a.sardinai) || {};
1642
1642
  return {
1643
1643
  clientId: i.clientId || r.clientId,
@@ -1655,7 +1655,7 @@ class ye {
1655
1655
  }
1656
1656
  class Ut {
1657
1657
  constructor(e) {
1658
- K(this, "currentTheme", Q);
1658
+ K(this, "currentTheme", Z);
1659
1659
  K(this, "customStyleElement", null);
1660
1660
  K(this, "container");
1661
1661
  this.container = e || document.documentElement;
@@ -1735,19 +1735,19 @@ class Ut {
1735
1735
  mergeWithDefault(e) {
1736
1736
  var r;
1737
1737
  return {
1738
- name: e.name || Q.name,
1739
- title: e.title || Q.title,
1740
- logo: { ...Q.logo, ...e.logo },
1741
- colors: { ...Q.colors, ...e.colors },
1742
- typography: e.typography ? { ...Q.typography, ...e.typography } : Q.typography,
1743
- spacing: e.spacing ? { ...Q.spacing, ...e.spacing } : Q.spacing,
1738
+ name: e.name || Z.name,
1739
+ title: e.title || Z.title,
1740
+ logo: { ...Z.logo, ...e.logo },
1741
+ colors: { ...Z.colors, ...e.colors },
1742
+ typography: e.typography ? { ...Z.typography, ...e.typography } : Z.typography,
1743
+ spacing: e.spacing ? { ...Z.spacing, ...e.spacing } : Z.spacing,
1744
1744
  customCSS: e.customCSS,
1745
1745
  darkMode: e.darkMode ? {
1746
1746
  colors: {
1747
- ...(r = Q.darkMode) == null ? void 0 : r.colors,
1747
+ ...(r = Z.darkMode) == null ? void 0 : r.colors,
1748
1748
  ...e.darkMode.colors
1749
1749
  }
1750
- } : Q.darkMode
1750
+ } : Z.darkMode
1751
1751
  };
1752
1752
  }
1753
1753
  /**
@@ -1760,7 +1760,7 @@ class Ut {
1760
1760
  * Reset to default theme
1761
1761
  */
1762
1762
  resetTheme() {
1763
- this.applyTheme(Q);
1763
+ this.applyTheme(Z);
1764
1764
  }
1765
1765
  /**
1766
1766
  * Remove all custom styles
@@ -1776,59 +1776,61 @@ class Ut {
1776
1776
  }
1777
1777
  }
1778
1778
  const Ue = tt(null), Or = ({ config: t, children: e }) => {
1779
- const [r, s] = x(null), a = le.useRef(!1), i = je(() => {
1780
- const c = new xt(t), l = new vt(c), d = new wt(c), u = new kt(c), g = new Nt(c), p = new St(c), m = new Ct(c), v = new At(c), b = new Et(c), y = new It(c), P = new Mt(c), f = new Ut();
1779
+ const [r, s] = N(null), a = ie.useRef(!1), i = ie.useRef(!1), l = Re(() => {
1780
+ const d = new vt(t), u = new xt(d), y = new wt(d), x = new kt(d), g = new Nt(d), b = new St(d), m = new Ct(d), f = new At(d), k = new Et(d), h = new It(d), A = new Mt(d), v = new Ut();
1781
1781
  return {
1782
- config: t,
1783
- httpClient: c,
1784
- applicantService: l,
1785
- questionnaireService: d,
1786
- uploadDocumentService: u,
1782
+ httpClient: d,
1783
+ applicantService: u,
1784
+ questionnaireService: y,
1785
+ uploadDocumentService: x,
1787
1786
  appropriatenessTestService: g,
1788
- overviewService: p,
1787
+ overviewService: b,
1789
1788
  riskScoringService: m,
1790
- identityService: v,
1791
- baseInformationService: b,
1792
- investorCategorizationService: y,
1793
- themeService: P,
1794
- themeManager: f,
1795
- currentTheme: r,
1796
- createOrchestrator: () => new $t(
1797
- l,
1798
- d,
1799
- u,
1800
- g,
1801
- p,
1802
- m,
1803
- v,
1804
- y
1805
- )
1789
+ identityService: f,
1790
+ baseInformationService: k,
1791
+ investorCategorizationService: h,
1792
+ themeService: A,
1793
+ themeManager: v
1806
1794
  };
1807
- }, [t, r]);
1808
- return V(() => ((async () => {
1809
- if (a.current) {
1810
- console.log("[MetaKYC] Theme load already in progress, skipping...");
1795
+ }, [t]), c = Re(() => ({
1796
+ config: t,
1797
+ ...l,
1798
+ currentTheme: r,
1799
+ createOrchestrator: () => new $t(
1800
+ l.applicantService,
1801
+ l.questionnaireService,
1802
+ l.uploadDocumentService,
1803
+ l.appropriatenessTestService,
1804
+ l.overviewService,
1805
+ l.riskScoringService,
1806
+ l.identityService,
1807
+ l.investorCategorizationService
1808
+ )
1809
+ }), [t, l, r]);
1810
+ return Y(() => ((async () => {
1811
+ if (a.current || i.current) {
1812
+ console.log("[MetaKYC] Theme already loading or loaded, skipping...");
1811
1813
  return;
1812
1814
  }
1813
1815
  a.current = !0;
1814
1816
  try {
1815
1817
  if (t.theme) {
1816
- console.log("[MetaKYC] Applying static theme from config"), i.themeManager.applyTheme(t.theme), s(i.themeManager.getCurrentTheme());
1818
+ console.log("[MetaKYC] Applying static theme from config"), l.themeManager.applyTheme(t.theme), s(l.themeManager.getCurrentTheme()), i.current = !0;
1817
1819
  return;
1818
1820
  }
1819
1821
  console.log("[MetaKYC] Fetching theme from backend...");
1820
- const l = await i.themeService.getThemeConfiguration();
1821
- i.themeManager.applyTheme(l), s(i.themeManager.getCurrentTheme()), console.log("[MetaKYC] Theme loaded and applied", l);
1822
- } catch (l) {
1823
- console.warn("[MetaKYC] Failed to load theme, using default:", l), s(i.themeManager.getCurrentTheme());
1822
+ const u = await l.themeService.getThemeConfiguration();
1823
+ l.themeManager.applyTheme(u), s(l.themeManager.getCurrentTheme()), i.current = !0, console.log("[MetaKYC] Theme loaded and applied", u);
1824
+ } catch (u) {
1825
+ console.warn("[MetaKYC] Failed to load theme, using default:", u), s(l.themeManager.getCurrentTheme()), i.current = !0;
1824
1826
  } finally {
1825
1827
  a.current = !1;
1826
1828
  }
1827
1829
  })(), () => {
1828
- i.themeManager.cleanup();
1829
- }), [t.theme, i.themeService, i.themeManager]), /* @__PURE__ */ n(Ue.Provider, { value: i, children: e });
1830
+ l.themeManager.cleanup();
1831
+ }), []), /* @__PURE__ */ n(Ue.Provider, { value: c, children: e });
1830
1832
  };
1831
- function re() {
1833
+ function se() {
1832
1834
  const t = rt(Ue);
1833
1835
  if (!t)
1834
1836
  throw new Error("useMetaKYC must be used within a MetaKYCProvider");
@@ -1855,7 +1857,7 @@ function $r(t, e) {
1855
1857
  return t.type === s;
1856
1858
  });
1857
1859
  }
1858
- function Ee(t) {
1860
+ function Ie(t) {
1859
1861
  if (t === 0) return "0 Bytes";
1860
1862
  const e = 1024, r = ["Bytes", "KB", "MB", "GB"], s = Math.floor(Math.log(t) / Math.log(e));
1861
1863
  return Math.round(t / Math.pow(e, s) * 100) / 100 + " " + r[s];
@@ -1863,23 +1865,23 @@ function Ee(t) {
1863
1865
  function jr(t) {
1864
1866
  return t;
1865
1867
  }
1866
- function X(...t) {
1868
+ function te(...t) {
1867
1869
  return t.filter(Boolean).join(" ");
1868
1870
  }
1869
- const fe = {
1871
+ const be = {
1870
1872
  APPLICANT_ID: "metakyc_applicant_id",
1871
1873
  WORKFLOW_STATE: "metakyc_workflow_state"
1872
1874
  };
1873
1875
  function Ht(t) {
1874
1876
  try {
1875
- localStorage.setItem(fe.APPLICANT_ID, t.toString());
1877
+ localStorage.setItem(be.APPLICANT_ID, t.toString());
1876
1878
  } catch (e) {
1877
1879
  console.warn("Failed to save applicant ID to storage:", e);
1878
1880
  }
1879
1881
  }
1880
1882
  function Vt() {
1881
1883
  try {
1882
- const t = localStorage.getItem(fe.APPLICANT_ID);
1884
+ const t = localStorage.getItem(be.APPLICANT_ID);
1883
1885
  return t ? parseInt(t, 10) : null;
1884
1886
  } catch (t) {
1885
1887
  return console.warn("Failed to retrieve applicant ID from storage:", t), null;
@@ -1887,21 +1889,21 @@ function Vt() {
1887
1889
  }
1888
1890
  function Yt() {
1889
1891
  try {
1890
- localStorage.removeItem(fe.APPLICANT_ID);
1892
+ localStorage.removeItem(be.APPLICANT_ID);
1891
1893
  } catch (t) {
1892
1894
  console.warn("Failed to clear applicant ID from storage:", t);
1893
1895
  }
1894
1896
  }
1895
1897
  function Wt(t) {
1896
1898
  try {
1897
- localStorage.setItem(fe.WORKFLOW_STATE, JSON.stringify(t));
1899
+ localStorage.setItem(be.WORKFLOW_STATE, JSON.stringify(t));
1898
1900
  } catch (e) {
1899
1901
  console.warn("Failed to save workflow state to storage:", e);
1900
1902
  }
1901
1903
  }
1902
1904
  function _r() {
1903
1905
  try {
1904
- const t = localStorage.getItem(fe.WORKFLOW_STATE);
1906
+ const t = localStorage.getItem(be.WORKFLOW_STATE);
1905
1907
  return t ? JSON.parse(t) : null;
1906
1908
  } catch (t) {
1907
1909
  return console.warn("Failed to retrieve workflow state from storage:", t), null;
@@ -1909,7 +1911,7 @@ function _r() {
1909
1911
  }
1910
1912
  function Qt() {
1911
1913
  try {
1912
- localStorage.removeItem(fe.WORKFLOW_STATE);
1914
+ localStorage.removeItem(be.WORKFLOW_STATE);
1913
1915
  } catch (t) {
1914
1916
  console.warn("Failed to clear workflow state from storage:", t);
1915
1917
  }
@@ -1918,141 +1920,145 @@ function Kr() {
1918
1920
  Yt(), Qt();
1919
1921
  }
1920
1922
  function Gt(t) {
1921
- const { createOrchestrator: e } = re(), [r, s] = x(null), [a, i] = x(!1), [c, l] = x(null), d = ve(null), u = t || Vt();
1922
- V(() => {
1923
+ const { createOrchestrator: e } = se(), [r, s] = N(null), [a, i] = N(!1), [l, c] = N(null), d = H(null), u = t || Vt();
1924
+ Y(() => {
1923
1925
  d.current || (d.current = e());
1924
- }, [e]), V(() => {
1925
- var h;
1926
+ }, [e]), Y(() => {
1927
+ var v;
1926
1928
  r && u && (Ht(u), Wt({
1927
1929
  applicantId: u,
1928
- currentStepOrder: (h = r.currentStep) == null ? void 0 : h.order,
1930
+ currentStepOrder: (v = r.currentStep) == null ? void 0 : v.order,
1929
1931
  status: r.status,
1930
1932
  lastUpdated: (/* @__PURE__ */ new Date()).toISOString(),
1931
1933
  workflowKey: r.workFlowKey,
1932
1934
  nextWorkflowKey: r.nextWorkflowKey
1933
1935
  }));
1934
1936
  }, [r, u]);
1935
- const g = ve(!1), p = ve(!1), m = q(async () => {
1937
+ const y = H(!1), x = H(!1), g = q(async () => {
1936
1938
  if (!(!u || !d.current)) {
1937
- if (g.current) {
1939
+ if (y.current) {
1938
1940
  console.log("[Workflow] Load already in progress, skipping...");
1939
1941
  return;
1940
1942
  }
1941
- g.current = !0, i(!0), l(null);
1943
+ y.current = !0, i(!0), c(null);
1942
1944
  try {
1943
- const h = await d.current.initialize(u);
1944
- s(h), p.current = !0;
1945
- } catch (h) {
1946
- l(h);
1945
+ const v = await d.current.initialize(u);
1946
+ s(v), x.current = !0;
1947
+ } catch (v) {
1948
+ c(v);
1947
1949
  } finally {
1948
- i(!1), g.current = !1;
1950
+ i(!1), y.current = !1;
1949
1951
  }
1950
1952
  }
1951
1953
  }, [u]);
1952
- V(() => {
1953
- u && !p.current && m();
1954
- }, [u, m]);
1955
- const v = q(async () => {
1954
+ Y(() => {
1955
+ u && !x.current && g();
1956
+ }, [u, g]);
1957
+ const b = q(async () => {
1956
1958
  if (d.current) {
1957
- if (g.current) {
1959
+ if (y.current) {
1958
1960
  console.log("[Workflow] Refresh already in progress, skipping...");
1959
1961
  return;
1960
1962
  }
1961
- g.current = !0, i(!0), l(null);
1963
+ y.current = !0, i(!0), c(null);
1962
1964
  try {
1963
- const h = await d.current.refreshProgress();
1964
- s(h);
1965
- } catch (h) {
1966
- l(h);
1965
+ const v = await d.current.refreshProgress();
1966
+ s(v);
1967
+ } catch (v) {
1968
+ c(v);
1967
1969
  } finally {
1968
- i(!1), g.current = !1;
1970
+ i(!1), y.current = !1;
1969
1971
  }
1970
1972
  }
1971
- }, []), b = q(async () => {
1973
+ }, []), m = q(async () => {
1972
1974
  if (d.current) {
1973
- i(!0), l(null);
1975
+ i(!0), c(null);
1974
1976
  try {
1975
- const h = await d.current.moveToNextStep();
1976
- s(h);
1977
- } catch (h) {
1978
- l(h);
1977
+ const v = await d.current.moveToNextStep();
1978
+ s(v);
1979
+ } catch (v) {
1980
+ c(v);
1979
1981
  } finally {
1980
1982
  i(!1);
1981
1983
  }
1982
1984
  }
1983
- }, []), y = q(async () => {
1985
+ }, []), f = q(async () => {
1984
1986
  if (d.current) {
1985
- i(!0), l(null);
1987
+ i(!0), c(null);
1986
1988
  try {
1987
- const h = await d.current.moveToPreviousStep();
1988
- s(h);
1989
- } catch (h) {
1990
- l(h);
1989
+ const v = await d.current.moveToPreviousStep();
1990
+ s(v);
1991
+ } catch (v) {
1992
+ c(v);
1991
1993
  } finally {
1992
1994
  i(!1);
1993
1995
  }
1994
1996
  }
1995
- }, []), P = q(async (h) => {
1997
+ }, []), k = q(async (v) => {
1996
1998
  if (d.current) {
1997
- i(!0), l(null);
1999
+ i(!0), c(null);
1998
2000
  try {
1999
- await d.current.submitCurrentStep(h);
2000
- const N = await d.current.refreshProgress();
2001
- s(N);
2002
- } catch (N) {
2003
- throw l(N), N;
2001
+ await d.current.submitCurrentStep(v);
2002
+ const S = await d.current.refreshProgress();
2003
+ s(S);
2004
+ } catch (S) {
2005
+ throw c(S), S;
2004
2006
  } finally {
2005
2007
  i(!1);
2006
2008
  }
2007
2009
  }
2008
- }, []), f = Te.useMemo(() => r != null && r.stepInfoList ? [...r.stepInfoList].sort((h, N) => h.order - N.order) : [], [r == null ? void 0 : r.stepInfoList]), E = Te.useMemo(() => r ? r.nextWorkflowKey && r.nextWorkflowKey !== r.workFlowKey : !1, [r]);
2010
+ }, []), h = Me.useMemo(() => r != null && r.stepInfoList ? [...r.stepInfoList].sort((v, S) => v.order - S.order) : [], [r == null ? void 0 : r.stepInfoList]), A = Me.useMemo(() => r ? r.nextWorkflowKey && r.nextWorkflowKey !== r.workFlowKey : !1, [r]);
2009
2011
  return {
2010
2012
  progress: r,
2011
2013
  applicantId: u,
2012
2014
  currentStep: (r == null ? void 0 : r.currentStep) || null,
2013
- steps: f,
2014
- status: (r == null ? void 0 : r.status) || ae.None,
2015
+ steps: h,
2016
+ status: (r == null ? void 0 : r.status) || le.None,
2015
2017
  workflowResult: (r == null ? void 0 : r.workflowResult) || null,
2016
2018
  workflowKey: r == null ? void 0 : r.workFlowKey,
2017
2019
  nextWorkflowKey: r == null ? void 0 : r.nextWorkflowKey,
2018
- hasWorkflowChanged: E,
2020
+ hasWorkflowChanged: A,
2019
2021
  isLoading: a,
2020
- error: c,
2021
- isComplete: (r == null ? void 0 : r.status) === ae.Finished,
2022
- isOnHold: (r == null ? void 0 : r.status) === ae.OnHold,
2023
- refreshProgress: v,
2024
- moveToNext: b,
2025
- moveBack: y,
2026
- submitCurrentStep: P,
2022
+ error: l,
2023
+ isComplete: (r == null ? void 0 : r.status) === le.Finished,
2024
+ isOnHold: (r == null ? void 0 : r.status) === le.OnHold,
2025
+ refreshProgress: b,
2026
+ moveToNext: m,
2027
+ moveBack: f,
2028
+ submitCurrentStep: k,
2027
2029
  orchestrator: d.current
2028
2030
  };
2029
2031
  }
2030
2032
  function Zt(t) {
2031
- const { questionnaireService: e } = re(), [r, s] = x(null), [a, i] = x(!1), [c, l] = x(!1), [d, u] = x(null), g = q(async () => {
2033
+ const { questionnaireService: e } = se(), [r, s] = N(null), [a, i] = N(!1), [l, c] = N(!1), [d, u] = N(null), y = H(!1), x = H(null), g = q(async () => {
2032
2034
  if (t) {
2033
- i(!0), u(null);
2035
+ if (y.current) {
2036
+ console.log("[Questionnaire] Load already in progress, skipping...");
2037
+ return;
2038
+ }
2039
+ y.current = !0, i(!0), u(null);
2034
2040
  try {
2035
2041
  const m = await e.getQuestionnaire(t);
2036
- s(m);
2042
+ s(m), x.current = t;
2037
2043
  } catch (m) {
2038
2044
  u(m);
2039
2045
  } finally {
2040
- i(!1);
2046
+ i(!1), y.current = !1;
2041
2047
  }
2042
2048
  }
2043
2049
  }, [t, e]);
2044
- V(() => {
2045
- t && g();
2046
- }, [t, g]);
2047
- const p = q(
2050
+ Y(() => {
2051
+ t && x.current !== t && g();
2052
+ }, [t]);
2053
+ const b = q(
2048
2054
  async (m) => {
2049
- l(!0), u(null);
2055
+ c(!0), u(null);
2050
2056
  try {
2051
2057
  return await e.fillQuestionnaire(m);
2052
- } catch (v) {
2053
- throw u(v), v;
2058
+ } catch (f) {
2059
+ throw u(f), f;
2054
2060
  } finally {
2055
- l(!1);
2061
+ c(!1);
2056
2062
  }
2057
2063
  },
2058
2064
  [e]
@@ -2060,38 +2066,42 @@ function Zt(t) {
2060
2066
  return {
2061
2067
  questionnaire: r,
2062
2068
  isLoading: a,
2063
- isSubmitting: c,
2069
+ isSubmitting: l,
2064
2070
  error: d,
2065
2071
  load: g,
2066
- submit: p
2072
+ submit: b
2067
2073
  };
2068
2074
  }
2069
2075
  function Jt(t) {
2070
- const { uploadDocumentService: e } = re(), [r, s] = x(null), [a, i] = x(!1), [c, l] = x(!1), [d, u] = x(0), [g, p] = x(null), m = q(async () => {
2076
+ const { uploadDocumentService: e } = se(), [r, s] = N(null), [a, i] = N(!1), [l, c] = N(!1), [d, u] = N(0), [y, x] = N(null), g = H(!1), b = H(null), m = q(async () => {
2071
2077
  if (t) {
2072
- i(!0), p(null);
2078
+ if (g.current) {
2079
+ console.log("[UploadDocument] Load already in progress, skipping...");
2080
+ return;
2081
+ }
2082
+ g.current = !0, i(!0), x(null);
2073
2083
  try {
2074
- const b = await e.getUploadDocument(t);
2075
- s(b);
2076
- } catch (b) {
2077
- p(b);
2084
+ const k = await e.getUploadDocument(t);
2085
+ s(k), b.current = t;
2086
+ } catch (k) {
2087
+ x(k);
2078
2088
  } finally {
2079
- i(!1);
2089
+ i(!1), g.current = !1;
2080
2090
  }
2081
2091
  }
2082
2092
  }, [t, e]);
2083
- V(() => {
2084
- t && m();
2085
- }, [t, m]);
2086
- const v = q(
2087
- async (b) => {
2088
- l(!0), u(0), p(null);
2093
+ Y(() => {
2094
+ t && b.current !== t && m();
2095
+ }, [t]);
2096
+ const f = q(
2097
+ async (k) => {
2098
+ c(!0), u(0), x(null);
2089
2099
  try {
2090
- await e.fillUploadDocument(b), u(100);
2091
- } catch (y) {
2092
- throw p(y), y;
2100
+ await e.fillUploadDocument(k), u(100);
2101
+ } catch (h) {
2102
+ throw x(h), h;
2093
2103
  } finally {
2094
- l(!1);
2104
+ c(!1);
2095
2105
  }
2096
2106
  },
2097
2107
  [e]
@@ -2099,162 +2109,170 @@ function Jt(t) {
2099
2109
  return {
2100
2110
  uploadDocument: r,
2101
2111
  isLoading: a,
2102
- isSubmitting: c,
2112
+ isSubmitting: l,
2103
2113
  uploadProgress: d,
2104
- error: g,
2114
+ error: y,
2105
2115
  load: m,
2106
- submit: v
2116
+ submit: f
2107
2117
  };
2108
2118
  }
2109
2119
  function Ur(t) {
2110
- const { appropriatenessTestService: e } = re(), [r, s] = x(null), [a, i] = x(!1), [c, l] = x(!1), [d, u] = x(null), [g, p] = x(null), m = q(async () => {
2120
+ const { appropriatenessTestService: e } = se(), [r, s] = N(null), [a, i] = N(!1), [l, c] = N(!1), [d, u] = N(null), [y, x] = N(null), g = H(!1), b = H(null), m = q(async () => {
2111
2121
  if (t) {
2112
- i(!0), u(null);
2122
+ if (g.current) {
2123
+ console.log("[AppropriatenessTest] Load already in progress, skipping...");
2124
+ return;
2125
+ }
2126
+ g.current = !0, i(!0), u(null);
2113
2127
  try {
2114
- const b = await e.getAppropriatenessTest(t);
2115
- s(b);
2116
- } catch (b) {
2117
- u(b);
2128
+ const k = await e.getAppropriatenessTest(t);
2129
+ s(k), b.current = t;
2130
+ } catch (k) {
2131
+ u(k);
2118
2132
  } finally {
2119
- i(!1);
2133
+ i(!1), g.current = !1;
2120
2134
  }
2121
2135
  }
2122
2136
  }, [t, e]);
2123
- V(() => {
2124
- t && m();
2125
- }, [t, m]);
2126
- const v = q(
2127
- async (b) => {
2128
- l(!0), u(null);
2137
+ Y(() => {
2138
+ t && b.current !== t && m();
2139
+ }, [t]);
2140
+ const f = q(
2141
+ async (k) => {
2142
+ c(!0), u(null);
2129
2143
  try {
2130
- const y = await e.fillAppropriatenessTest(b);
2131
- return p(y), y;
2132
- } catch (y) {
2133
- throw u(y), y;
2144
+ const h = await e.fillAppropriatenessTest(k);
2145
+ return x(h), h;
2146
+ } catch (h) {
2147
+ throw u(h), h;
2134
2148
  } finally {
2135
- l(!1);
2149
+ c(!1);
2136
2150
  }
2137
2151
  },
2138
2152
  [e]
2139
2153
  );
2140
2154
  return {
2141
2155
  test: r,
2142
- result: g,
2156
+ result: y,
2143
2157
  isLoading: a,
2144
- isSubmitting: c,
2158
+ isSubmitting: l,
2145
2159
  error: d,
2146
2160
  load: m,
2147
- submit: v
2161
+ submit: f
2148
2162
  };
2149
2163
  }
2150
2164
  function Xt(t) {
2151
- const { overviewService: e } = re(), [r, s] = x(null), [a, i] = x(!1), [c, l] = x(!1), [d, u] = x(null), g = q(async () => {
2165
+ const { overviewService: e } = se(), [r, s] = N(null), [a, i] = N(!1), [l, c] = N(!1), [d, u] = N(null), y = H(!1), x = H(null), g = q(async () => {
2152
2166
  if (t) {
2153
- i(!0), u(null);
2167
+ if (y.current) {
2168
+ console.log("[Overview] Load already in progress, skipping...");
2169
+ return;
2170
+ }
2171
+ y.current = !0, i(!0), u(null);
2154
2172
  try {
2155
2173
  const m = await e.getOverviewData(t);
2156
- s(m);
2174
+ s(m), x.current = t;
2157
2175
  } catch (m) {
2158
2176
  u(m);
2159
2177
  } finally {
2160
- i(!1);
2178
+ i(!1), y.current = !1;
2161
2179
  }
2162
2180
  }
2163
2181
  }, [t, e]);
2164
- V(() => {
2165
- t && g();
2166
- }, [t, g]);
2167
- const p = q(async () => {
2182
+ Y(() => {
2183
+ t && x.current !== t && g();
2184
+ }, [t]);
2185
+ const b = q(async () => {
2168
2186
  if (t) {
2169
- l(!0), u(null);
2187
+ c(!0), u(null);
2170
2188
  try {
2171
2189
  await e.passOverview(t);
2172
2190
  } catch (m) {
2173
2191
  throw u(m), m;
2174
2192
  } finally {
2175
- l(!1);
2193
+ c(!1);
2176
2194
  }
2177
2195
  }
2178
2196
  }, [t, e]);
2179
2197
  return {
2180
2198
  overview: r,
2181
2199
  isLoading: a,
2182
- isSubmitting: c,
2200
+ isSubmitting: l,
2183
2201
  error: d,
2184
2202
  load: g,
2185
- passOverview: p
2203
+ passOverview: b
2186
2204
  };
2187
2205
  }
2188
2206
  function er(t) {
2189
- const { identityService: e } = re(), [r, s] = x(
2207
+ const { identityService: e } = se(), [r, s] = N(
2190
2208
  null
2191
- ), [a, i] = x(!1), [c, l] = x(null), d = ve(!1), u = q(
2192
- async (m, v) => {
2209
+ ), [a, i] = N(!1), [l, c] = N(null), d = H(!1), u = q(
2210
+ async (g, b) => {
2193
2211
  if (t) {
2194
2212
  if (d.current) {
2195
2213
  console.log("[Identity] Request already in progress, skipping...");
2196
2214
  return;
2197
2215
  }
2198
- d.current = !0, i(!0), l(null);
2216
+ d.current = !0, i(!0), c(null);
2199
2217
  try {
2200
- const b = {
2218
+ const m = {
2201
2219
  applicantId: t,
2202
2220
  restart: !1,
2203
- redirectUrl: m || "",
2204
- ttl: v || 604800
2221
+ redirectUrl: g || "",
2222
+ ttl: b || 604800
2205
2223
  // Default: 7 days
2206
2224
  };
2207
- console.log("Identity request input:", b);
2208
- const y = await e.identityRequest(b);
2209
- return console.log("Identity request result:", y), s(y), y;
2210
- } catch (b) {
2211
- throw l(b), b;
2225
+ console.log("Identity request input:", m);
2226
+ const f = await e.identityRequest(m);
2227
+ return console.log("Identity request result:", f), s(f), f;
2228
+ } catch (m) {
2229
+ throw c(m), m;
2212
2230
  } finally {
2213
2231
  i(!1), d.current = !1;
2214
2232
  }
2215
2233
  }
2216
2234
  },
2217
2235
  [t, e]
2218
- ), g = q(
2219
- async (m, v) => {
2236
+ ), y = q(
2237
+ async (g, b) => {
2220
2238
  if (t) {
2221
- i(!0), l(null);
2239
+ i(!0), c(null);
2222
2240
  try {
2223
- const b = {
2241
+ const m = {
2224
2242
  applicantId: t,
2225
2243
  restart: !1,
2226
- redirectUrl: m,
2227
- ttl: v
2228
- }, y = await e.identityCompanyRequest(b);
2229
- return s(y), y;
2230
- } catch (b) {
2231
- throw l(b), b;
2244
+ redirectUrl: g,
2245
+ ttl: b
2246
+ }, f = await e.identityCompanyRequest(m);
2247
+ return s(f), f;
2248
+ } catch (m) {
2249
+ throw c(m), m;
2232
2250
  } finally {
2233
2251
  i(!1);
2234
2252
  }
2235
2253
  }
2236
2254
  },
2237
2255
  [t, e]
2238
- ), p = q(async () => {
2256
+ ), x = q(async () => {
2239
2257
  if (t) {
2240
2258
  if (d.current) {
2241
2259
  console.log("[Identity] Restart already in progress, skipping...");
2242
2260
  return;
2243
2261
  }
2244
- d.current = !0, i(!0), l(null);
2262
+ d.current = !0, i(!0), c(null);
2245
2263
  try {
2246
- const m = {
2264
+ const g = {
2247
2265
  applicantId: t,
2248
2266
  restart: !0,
2249
2267
  redirectUrl: "",
2250
2268
  ttl: 604800
2251
2269
  // 7 days
2252
2270
  };
2253
- console.log("Restarting identity with input:", m);
2254
- const v = await e.identityRequest(m);
2255
- return console.log("Restart identity result:", v), s(v), v;
2256
- } catch (m) {
2257
- throw l(m), m;
2271
+ console.log("Restarting identity with input:", g);
2272
+ const b = await e.identityRequest(g);
2273
+ return console.log("Restart identity result:", b), s(b), b;
2274
+ } catch (g) {
2275
+ throw c(g), g;
2258
2276
  } finally {
2259
2277
  i(!1), d.current = !1;
2260
2278
  }
@@ -2265,82 +2283,88 @@ function er(t) {
2265
2283
  provider: (r == null ? void 0 : r.provider) || null,
2266
2284
  token: (r == null ? void 0 : r.publicProviderTokenObject) || null,
2267
2285
  isLoading: a,
2268
- error: c,
2286
+ error: l,
2269
2287
  requestIdentity: u,
2270
- requestCompanyIdentity: g,
2271
- restartIdentity: p
2288
+ requestCompanyIdentity: y,
2289
+ restartIdentity: x
2272
2290
  };
2273
2291
  }
2274
2292
  function tr(t) {
2275
- const { riskScoringService: e } = re(), [r, s] = x(null), [a, i] = x(!1), [c, l] = x(!1), [d, u] = x(null), [g, p] = x(null), m = q(async () => {
2293
+ const { riskScoringService: e } = se(), [r, s] = N(null), [a, i] = N(!1), [l, c] = N(!1), [d, u] = N(null), [y, x] = N(null), g = H(!1), b = H(null), m = q(async () => {
2276
2294
  if (t) {
2277
- i(!0), u(null);
2295
+ if (g.current) {
2296
+ console.log("[RiskScoring] Load already in progress, skipping...");
2297
+ return;
2298
+ }
2299
+ g.current = !0, i(!0), u(null);
2278
2300
  try {
2279
- const b = await e.getRiskCriterias(t);
2280
- s(b);
2281
- } catch (b) {
2282
- u(b);
2301
+ const k = await e.getRiskCriterias(t);
2302
+ s(k), b.current = t;
2303
+ } catch (k) {
2304
+ u(k);
2283
2305
  } finally {
2284
- i(!1);
2306
+ i(!1), g.current = !1;
2285
2307
  }
2286
2308
  }
2287
2309
  }, [t, e]);
2288
- V(() => {
2289
- t && m();
2290
- }, [t, m]);
2291
- const v = q(
2292
- async (b) => {
2293
- l(!0), u(null);
2310
+ Y(() => {
2311
+ t && b.current !== t && m();
2312
+ }, [t]);
2313
+ const f = q(
2314
+ async (k) => {
2315
+ c(!0), u(null);
2294
2316
  try {
2295
- const y = await e.submitRiskScoring(b);
2296
- return p(y), y;
2297
- } catch (y) {
2298
- throw u(y), y;
2317
+ const h = await e.submitRiskScoring(k);
2318
+ return x(h), h;
2319
+ } catch (h) {
2320
+ throw u(h), h;
2299
2321
  } finally {
2300
- l(!1);
2322
+ c(!1);
2301
2323
  }
2302
2324
  },
2303
2325
  [e]
2304
2326
  );
2305
2327
  return {
2306
2328
  criteria: r,
2307
- result: g,
2329
+ result: y,
2308
2330
  isLoading: a,
2309
- isSubmitting: c,
2331
+ isSubmitting: l,
2310
2332
  error: d,
2311
2333
  load: m,
2312
- submit: v
2334
+ submit: f
2313
2335
  };
2314
2336
  }
2315
2337
  function rr() {
2316
- const { applicantService: t, config: e } = re(), [r, s] = x(!1), [a, i] = x(null), c = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(p) {
2338
+ const { applicantService: t, config: e } = se(), [r, s] = N(!1), [a, i] = N(null), l = H(!1), c = H(!1), d = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(b) {
2317
2339
  const m = Math.random() * 16 | 0;
2318
- return (p === "x" ? m : m & 3 | 8).toString(16);
2319
- }), l = q(
2320
- async (p) => {
2340
+ return (b === "x" ? m : m & 3 | 8).toString(16);
2341
+ }), u = q(
2342
+ async (b) => {
2321
2343
  var m;
2322
- s(!0), i(null);
2344
+ if (l.current)
2345
+ throw console.log("[Applicant] Create already in progress, skipping..."), new Error("Creation already in progress");
2346
+ l.current = !0, s(!0), i(null);
2323
2347
  try {
2324
- if (p.applicantAdditionalDatas || (p.applicantAdditionalDatas = []), (m = e.identityProviders) != null && m.sardinai) {
2325
- const b = c();
2326
- console.log("[SardinAI] Generated session key:", b), p.applicantAdditionalDatas.push({
2348
+ if (b.applicantAdditionalDatas || (b.applicantAdditionalDatas = []), (m = e.identityProviders) != null && m.sardinai) {
2349
+ const k = d();
2350
+ console.log("[SardinAI] Generated session key:", k), b.applicantAdditionalDatas.push({
2327
2351
  paramName: "sessionKey",
2328
- value: b
2352
+ value: k
2329
2353
  });
2330
2354
  }
2331
- return await t.createApplicant(p);
2332
- } catch (v) {
2333
- throw i(v), v;
2355
+ return await t.createApplicant(b);
2356
+ } catch (f) {
2357
+ throw i(f), f;
2334
2358
  } finally {
2335
- s(!1);
2359
+ s(!1), l.current = !1;
2336
2360
  }
2337
2361
  },
2338
2362
  [t, e]
2339
- ), d = q(
2340
- async (p) => {
2363
+ ), y = q(
2364
+ async (b) => {
2341
2365
  s(!0), i(null);
2342
2366
  try {
2343
- return await t.createCompanyApplicant(p);
2367
+ return await t.createCompanyApplicant(b);
2344
2368
  } catch (m) {
2345
2369
  throw i(m), m;
2346
2370
  } finally {
@@ -2348,23 +2372,25 @@ function rr() {
2348
2372
  }
2349
2373
  },
2350
2374
  [t]
2351
- ), u = q(
2352
- async (p) => {
2353
- s(!0), i(null);
2375
+ ), x = q(
2376
+ async (b) => {
2377
+ if (c.current)
2378
+ throw console.log("[Applicant] Data load already in progress, skipping..."), new Error("Data load already in progress");
2379
+ c.current = !0, s(!0), i(null);
2354
2380
  try {
2355
- return await t.getApplicantData(p);
2381
+ return await t.getApplicantData(b);
2356
2382
  } catch (m) {
2357
2383
  throw i(m), m;
2358
2384
  } finally {
2359
- s(!1);
2385
+ s(!1), c.current = !1;
2360
2386
  }
2361
2387
  },
2362
2388
  [t]
2363
2389
  ), g = q(
2364
- async (p) => {
2390
+ async (b) => {
2365
2391
  s(!0), i(null);
2366
2392
  try {
2367
- await t.stopProgress(p);
2393
+ await t.stopProgress(b);
2368
2394
  } catch (m) {
2369
2395
  throw i(m), m;
2370
2396
  } finally {
@@ -2376,9 +2402,9 @@ function rr() {
2376
2402
  return {
2377
2403
  isLoading: r,
2378
2404
  error: a,
2379
- createApplicant: l,
2380
- createCompanyApplicant: d,
2381
- getApplicantData: u,
2405
+ createApplicant: u,
2406
+ createCompanyApplicant: y,
2407
+ getApplicantData: x,
2382
2408
  stopProgress: g
2383
2409
  };
2384
2410
  }
@@ -2389,9 +2415,9 @@ const j = ({
2389
2415
  isLoading: s = !1,
2390
2416
  disabled: a,
2391
2417
  className: i,
2392
- ...c
2418
+ ...l
2393
2419
  }) => {
2394
- const l = "inline-flex items-center justify-center rounded-lg font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed", d = {
2420
+ const c = "inline-flex items-center justify-center rounded-lg font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed", d = {
2395
2421
  primary: "bg-primary-500 text-white hover:bg-primary-600 focus:ring-primary-500",
2396
2422
  secondary: "bg-gray-200 text-gray-900 hover:bg-gray-300 focus:ring-gray-400",
2397
2423
  outline: "border-2 border-primary-500 text-primary-500 hover:bg-primary-50 focus:ring-primary-500",
@@ -2405,9 +2431,9 @@ const j = ({
2405
2431
  return /* @__PURE__ */ o(
2406
2432
  "button",
2407
2433
  {
2408
- className: X(l, d[e], u[r], i),
2434
+ className: te(c, d[e], u[r], i),
2409
2435
  disabled: a || s,
2410
- ...c,
2436
+ ...l,
2411
2437
  children: [
2412
2438
  s && /* @__PURE__ */ o(
2413
2439
  "svg",
@@ -2443,19 +2469,19 @@ const j = ({
2443
2469
  ]
2444
2470
  }
2445
2471
  );
2446
- }, Z = Pe(
2447
- ({ label: t, error: e, helperText: r, leftIcon: s, rightIcon: a, className: i, ...c }, l) => /* @__PURE__ */ o("div", { className: "w-full", children: [
2472
+ }, X = Le(
2473
+ ({ label: t, error: e, helperText: r, leftIcon: s, rightIcon: a, className: i, ...l }, c) => /* @__PURE__ */ o("div", { className: "w-full", children: [
2448
2474
  t && /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
2449
2475
  t,
2450
- c.required && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
2476
+ l.required && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
2451
2477
  ] }),
2452
2478
  /* @__PURE__ */ o("div", { className: "relative", children: [
2453
2479
  s && /* @__PURE__ */ n("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none", children: s }),
2454
2480
  /* @__PURE__ */ n(
2455
2481
  "input",
2456
2482
  {
2457
- ref: l,
2458
- className: X(
2483
+ ref: c,
2484
+ className: te(
2459
2485
  "block w-full rounded-lg border px-3 py-2 text-sm transition-colors",
2460
2486
  "focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",
2461
2487
  "disabled:bg-gray-100 disabled:cursor-not-allowed",
@@ -2465,7 +2491,7 @@ const j = ({
2465
2491
  a ? "pr-10" : "",
2466
2492
  i
2467
2493
  ),
2468
- ...c
2494
+ ...l
2469
2495
  }
2470
2496
  ),
2471
2497
  a && /* @__PURE__ */ n("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none", children: a })
@@ -2474,11 +2500,11 @@ const j = ({
2474
2500
  !e && r && /* @__PURE__ */ n("p", { className: "mt-1 text-sm text-gray-500", children: r })
2475
2501
  ] })
2476
2502
  );
2477
- Z.displayName = "Input";
2478
- const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2503
+ X.displayName = "Input";
2504
+ const L = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2479
2505
  "div",
2480
2506
  {
2481
- className: X(
2507
+ className: te(
2482
2508
  "rounded-xl shadow-sm border",
2483
2509
  e
2484
2510
  ),
@@ -2489,30 +2515,30 @@ const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2489
2515
  ...r,
2490
2516
  children: t
2491
2517
  }
2492
- ), J = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2518
+ ), ee = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2493
2519
  "div",
2494
2520
  {
2495
- className: X("px-6 py-4 border-b", e),
2521
+ className: te("px-6 py-4 border-b", e),
2496
2522
  style: {
2497
2523
  borderColor: "var(--metakyc-border, #e5e7eb)"
2498
2524
  },
2499
2525
  ...r,
2500
2526
  children: t
2501
2527
  }
2502
- ), M = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n("div", { className: X("px-6 py-4", e), ...r, children: t }), te = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2528
+ ), T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n("div", { className: te("px-6 py-4", e), ...r, children: t }), ne = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2503
2529
  "div",
2504
2530
  {
2505
- className: X("px-6 py-4 border-t", e),
2531
+ className: te("px-6 py-4 border-t", e),
2506
2532
  style: {
2507
2533
  borderColor: "var(--metakyc-border, #e5e7eb)"
2508
2534
  },
2509
2535
  ...r,
2510
2536
  children: t
2511
2537
  }
2512
- ), me = ({ children: t, variant: e = "default", className: r, ...s }) => /* @__PURE__ */ n(
2538
+ ), he = ({ children: t, variant: e = "default", className: r, ...s }) => /* @__PURE__ */ n(
2513
2539
  "span",
2514
2540
  {
2515
- className: X(
2541
+ className: te(
2516
2542
  "inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",
2517
2543
  {
2518
2544
  default: "bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300",
@@ -2526,16 +2552,16 @@ const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2526
2552
  ...s,
2527
2553
  children: t
2528
2554
  }
2529
- ), ie = ({ size: t = "md", className: e, ...r }) => {
2555
+ ), ce = ({ size: t = "md", className: e, ...r }) => {
2530
2556
  const s = {
2531
2557
  sm: "h-4 w-4",
2532
2558
  md: "h-8 w-8",
2533
2559
  lg: "h-12 w-12"
2534
2560
  };
2535
- return /* @__PURE__ */ n("div", { className: X("flex items-center justify-center", e), ...r, children: /* @__PURE__ */ o(
2561
+ return /* @__PURE__ */ n("div", { className: te("flex items-center justify-center", e), ...r, children: /* @__PURE__ */ o(
2536
2562
  "svg",
2537
2563
  {
2538
- className: X("animate-spin text-primary-500", s[t]),
2564
+ className: te("animate-spin text-primary-500", s[t]),
2539
2565
  xmlns: "http://www.w3.org/2000/svg",
2540
2566
  fill: "none",
2541
2567
  viewBox: "0 0 24 24",
@@ -2562,17 +2588,17 @@ const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2562
2588
  ]
2563
2589
  }
2564
2590
  ) });
2565
- }, ge = Pe(
2566
- ({ label: t, error: e, helperText: r, options: s, placeholder: a, className: i, ...c }, l) => /* @__PURE__ */ o("div", { className: "w-full", children: [
2591
+ }, ye = Le(
2592
+ ({ label: t, error: e, helperText: r, options: s, placeholder: a, className: i, ...l }, c) => /* @__PURE__ */ o("div", { className: "w-full", children: [
2567
2593
  t && /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
2568
2594
  t,
2569
- c.required && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
2595
+ l.required && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
2570
2596
  ] }),
2571
2597
  /* @__PURE__ */ o(
2572
2598
  "select",
2573
2599
  {
2574
- ref: l,
2575
- className: X(
2600
+ ref: c,
2601
+ className: te(
2576
2602
  "block w-full rounded-lg border px-3 py-2 text-sm transition-colors",
2577
2603
  "focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",
2578
2604
  "disabled:bg-gray-100 disabled:cursor-not-allowed",
@@ -2580,7 +2606,7 @@ const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2580
2606
  "dark:bg-gray-800 dark:text-white",
2581
2607
  i
2582
2608
  ),
2583
- ...c,
2609
+ ...l,
2584
2610
  children: [
2585
2611
  a && /* @__PURE__ */ n("option", { value: "", disabled: !0, children: a }, "__placeholder__"),
2586
2612
  s.map((d, u) => /* @__PURE__ */ n(
@@ -2599,7 +2625,7 @@ const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2599
2625
  !e && r && /* @__PURE__ */ n("p", { className: "mt-1 text-sm text-gray-500", children: r })
2600
2626
  ] })
2601
2627
  );
2602
- ge.displayName = "Select";
2628
+ ye.displayName = "Select";
2603
2629
  const nr = ({
2604
2630
  label: t,
2605
2631
  error: e,
@@ -2607,55 +2633,55 @@ const nr = ({
2607
2633
  multiple: s = !1,
2608
2634
  maxSize: a,
2609
2635
  onChange: i,
2610
- value: c = [],
2611
- className: l
2636
+ value: l = [],
2637
+ className: c
2612
2638
  }) => {
2613
- const [d, u] = x(!1), g = ve(null), p = (f) => {
2614
- if (!f) return;
2615
- const E = Array.from(f);
2616
- if (a && E.filter((N) => N.size > a).length > 0) {
2617
- const N = Ee(a);
2618
- alert(`Some files exceed the maximum size of ${N}`);
2639
+ const [d, u] = N(!1), y = H(null), x = (h) => {
2640
+ if (!h) return;
2641
+ const A = Array.from(h);
2642
+ if (a && A.filter((S) => S.size > a).length > 0) {
2643
+ const S = Ie(a);
2644
+ alert(`Some files exceed the maximum size of ${S}`);
2619
2645
  return;
2620
2646
  }
2621
- i == null || i(s ? [...c, ...E] : [E[0]]);
2622
- }, m = (f) => {
2623
- f.preventDefault(), u(!0);
2624
- }, v = () => {
2647
+ i == null || i(s ? [...l, ...A] : [A[0]]);
2648
+ }, g = (h) => {
2649
+ h.preventDefault(), u(!0);
2650
+ }, b = () => {
2625
2651
  u(!1);
2626
- }, b = (f) => {
2627
- f.preventDefault(), u(!1), p(f.dataTransfer.files);
2628
- }, y = () => {
2629
- var f;
2630
- (f = g.current) == null || f.click();
2631
- }, P = (f) => {
2632
- const E = c.filter((h, N) => N !== f);
2633
- i == null || i(E);
2652
+ }, m = (h) => {
2653
+ h.preventDefault(), u(!1), x(h.dataTransfer.files);
2654
+ }, f = () => {
2655
+ var h;
2656
+ (h = y.current) == null || h.click();
2657
+ }, k = (h) => {
2658
+ const A = l.filter((v, S) => S !== h);
2659
+ i == null || i(A);
2634
2660
  };
2635
- return /* @__PURE__ */ o("div", { className: X("w-full", l), children: [
2661
+ return /* @__PURE__ */ o("div", { className: te("w-full", c), children: [
2636
2662
  t && /* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: t }),
2637
2663
  /* @__PURE__ */ o(
2638
2664
  "div",
2639
2665
  {
2640
- className: X(
2666
+ className: te(
2641
2667
  "border-2 border-dashed rounded-lg p-6 text-center cursor-pointer transition-colors",
2642
2668
  d ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-300 dark:border-gray-600 hover:border-primary-500",
2643
2669
  e && "border-danger-500"
2644
2670
  ),
2645
- onDragOver: m,
2646
- onDragLeave: v,
2647
- onDrop: b,
2648
- onClick: y,
2671
+ onDragOver: g,
2672
+ onDragLeave: b,
2673
+ onDrop: m,
2674
+ onClick: f,
2649
2675
  children: [
2650
2676
  /* @__PURE__ */ n(
2651
2677
  "input",
2652
2678
  {
2653
- ref: g,
2679
+ ref: y,
2654
2680
  type: "file",
2655
2681
  className: "hidden",
2656
2682
  accept: r,
2657
2683
  multiple: s,
2658
- onChange: (f) => p(f.target.files)
2684
+ onChange: (h) => x(h.target.files)
2659
2685
  }
2660
2686
  ),
2661
2687
  /* @__PURE__ */ o("div", { className: "space-y-2", children: [
@@ -2683,13 +2709,13 @@ const nr = ({
2683
2709
  ] }),
2684
2710
  a && /* @__PURE__ */ o("p", { className: "text-xs text-gray-500", children: [
2685
2711
  "Maximum file size: ",
2686
- Ee(a)
2712
+ Ie(a)
2687
2713
  ] })
2688
2714
  ] })
2689
2715
  ]
2690
2716
  }
2691
2717
  ),
2692
- c.length > 0 && /* @__PURE__ */ n("div", { className: "mt-3 space-y-2", children: c.map((f, E) => /* @__PURE__ */ o(
2718
+ l.length > 0 && /* @__PURE__ */ n("div", { className: "mt-3 space-y-2", children: l.map((h, A) => /* @__PURE__ */ o(
2693
2719
  "div",
2694
2720
  {
2695
2721
  className: "flex items-center justify-between px-3 py-2 bg-gray-50 dark:bg-gray-700 rounded-lg",
@@ -2711,10 +2737,10 @@ const nr = ({
2711
2737
  )
2712
2738
  }
2713
2739
  ),
2714
- /* @__PURE__ */ n("span", { className: "text-sm text-gray-700 dark:text-gray-300 truncate", children: f.name }),
2740
+ /* @__PURE__ */ n("span", { className: "text-sm text-gray-700 dark:text-gray-300 truncate", children: h.name }),
2715
2741
  /* @__PURE__ */ o("span", { className: "text-xs text-gray-500", children: [
2716
2742
  "(",
2717
- Ee(f.size),
2743
+ Ie(h.size),
2718
2744
  ")"
2719
2745
  ] })
2720
2746
  ] }),
@@ -2722,8 +2748,8 @@ const nr = ({
2722
2748
  "button",
2723
2749
  {
2724
2750
  type: "button",
2725
- onClick: (h) => {
2726
- h.stopPropagation(), P(E);
2751
+ onClick: (v) => {
2752
+ v.stopPropagation(), k(A);
2727
2753
  },
2728
2754
  className: "ml-2 text-danger-500 hover:text-danger-700 focus:outline-none",
2729
2755
  children: /* @__PURE__ */ n("svg", { className: "h-5 w-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ n(
@@ -2738,11 +2764,11 @@ const nr = ({
2738
2764
  )
2739
2765
  ]
2740
2766
  },
2741
- E
2767
+ A
2742
2768
  )) }),
2743
2769
  e && /* @__PURE__ */ n("p", { className: "mt-1 text-sm text-danger-500", children: e })
2744
2770
  ] });
2745
- }, sr = Pe(
2771
+ }, sr = Le(
2746
2772
  ({ countryCode: t = "+1", onCountryCodeChange: e, className: r, ...s }, a) => /* @__PURE__ */ o("div", { className: "w-full", children: [
2747
2773
  s.label && /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
2748
2774
  s.label,
@@ -2755,7 +2781,7 @@ const nr = ({
2755
2781
  type: "text",
2756
2782
  value: t,
2757
2783
  onChange: (i) => e == null ? void 0 : e(i.target.value),
2758
- className: X(
2784
+ className: te(
2759
2785
  "w-20 rounded-lg border px-3 py-2 text-sm",
2760
2786
  "focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",
2761
2787
  "border-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:text-white"
@@ -2764,11 +2790,11 @@ const nr = ({
2764
2790
  }
2765
2791
  ),
2766
2792
  /* @__PURE__ */ n(
2767
- Z,
2793
+ X,
2768
2794
  {
2769
2795
  ref: a,
2770
2796
  type: "tel",
2771
- className: X("flex-1", r),
2797
+ className: te("flex-1", r),
2772
2798
  ...s,
2773
2799
  label: ""
2774
2800
  }
@@ -2778,63 +2804,63 @@ const nr = ({
2778
2804
  ] })
2779
2805
  );
2780
2806
  sr.displayName = "PhoneInput";
2781
- const Me = (t, e, r) => {
2807
+ const Be = (t, e, r) => {
2782
2808
  if (t && "reportValidity" in t) {
2783
- const s = Ie(r, e);
2809
+ const s = De(r, e);
2784
2810
  t.setCustomValidity(s && s.message || ""), t.reportValidity();
2785
2811
  }
2786
- }, De = (t, e) => {
2812
+ }, Fe = (t, e) => {
2787
2813
  for (const r in e.fields) {
2788
2814
  const s = e.fields[r];
2789
- s && s.ref && "reportValidity" in s.ref ? Me(s.ref, r, t) : s && s.refs && s.refs.forEach((a) => Me(a, r, t));
2815
+ s && s.ref && "reportValidity" in s.ref ? Be(s.ref, r, t) : s && s.refs && s.refs.forEach((a) => Be(a, r, t));
2790
2816
  }
2791
- }, Be = (t, e) => {
2792
- e.shouldUseNativeValidation && De(t, e);
2817
+ }, Oe = (t, e) => {
2818
+ e.shouldUseNativeValidation && Fe(t, e);
2793
2819
  const r = {};
2794
2820
  for (const s in t) {
2795
- const a = Ie(e.fields, s), i = Object.assign(t[s] || {}, { ref: a && a.ref });
2821
+ const a = De(e.fields, s), i = Object.assign(t[s] || {}, { ref: a && a.ref });
2796
2822
  if (ar(e.names || Object.keys(t), s)) {
2797
- const c = Object.assign({}, Ie(r, s));
2798
- Ae(c, "root", i), Ae(r, s, c);
2799
- } else Ae(r, s, i);
2823
+ const l = Object.assign({}, De(r, s));
2824
+ Ee(l, "root", i), Ee(r, s, l);
2825
+ } else Ee(r, s, i);
2800
2826
  }
2801
2827
  return r;
2802
2828
  }, ar = (t, e) => {
2803
- const r = Oe(e);
2804
- return t.some((s) => Oe(s).match(`^${r}\\.\\d+`));
2829
+ const r = ze(e);
2830
+ return t.some((s) => ze(s).match(`^${r}\\.\\d+`));
2805
2831
  };
2806
- function Oe(t) {
2832
+ function ze(t) {
2807
2833
  return t.replace(/\]|\[/g, "");
2808
2834
  }
2809
2835
  function qe(t, e, r) {
2810
- function s(l, d) {
2836
+ function s(c, d) {
2811
2837
  var u;
2812
- Object.defineProperty(l, "_zod", {
2813
- value: l._zod ?? {},
2838
+ Object.defineProperty(c, "_zod", {
2839
+ value: c._zod ?? {},
2814
2840
  enumerable: !1
2815
- }), (u = l._zod).traits ?? (u.traits = /* @__PURE__ */ new Set()), l._zod.traits.add(t), e(l, d);
2816
- for (const g in c.prototype)
2817
- g in l || Object.defineProperty(l, g, { value: c.prototype[g].bind(l) });
2818
- l._zod.constr = c, l._zod.def = d;
2841
+ }), (u = c._zod).traits ?? (u.traits = /* @__PURE__ */ new Set()), c._zod.traits.add(t), e(c, d);
2842
+ for (const y in l.prototype)
2843
+ y in c || Object.defineProperty(c, y, { value: l.prototype[y].bind(c) });
2844
+ c._zod.constr = l, c._zod.def = d;
2819
2845
  }
2820
2846
  const a = (r == null ? void 0 : r.Parent) ?? Object;
2821
2847
  class i extends a {
2822
2848
  }
2823
2849
  Object.defineProperty(i, "name", { value: t });
2824
- function c(l) {
2850
+ function l(c) {
2825
2851
  var d;
2826
2852
  const u = r != null && r.Parent ? new i() : this;
2827
- s(u, l), (d = u._zod).deferred ?? (d.deferred = []);
2828
- for (const g of u._zod.deferred)
2829
- g();
2853
+ s(u, c), (d = u._zod).deferred ?? (d.deferred = []);
2854
+ for (const y of u._zod.deferred)
2855
+ y();
2830
2856
  return u;
2831
2857
  }
2832
- return Object.defineProperty(c, "init", { value: s }), Object.defineProperty(c, Symbol.hasInstance, {
2833
- value: (l) => {
2858
+ return Object.defineProperty(l, "init", { value: s }), Object.defineProperty(l, Symbol.hasInstance, {
2859
+ value: (c) => {
2834
2860
  var d, u;
2835
- return r != null && r.Parent && l instanceof r.Parent ? !0 : (u = (d = l == null ? void 0 : l._zod) == null ? void 0 : d.traits) == null ? void 0 : u.has(t);
2861
+ return r != null && r.Parent && c instanceof r.Parent ? !0 : (u = (d = c == null ? void 0 : c._zod) == null ? void 0 : d.traits) == null ? void 0 : u.has(t);
2836
2862
  }
2837
- }), Object.defineProperty(c, "name", { value: t }), c;
2863
+ }), Object.defineProperty(l, "name", { value: t }), l;
2838
2864
  }
2839
2865
  class ir extends Error {
2840
2866
  constructor() {
@@ -2850,15 +2876,15 @@ function lr(t, e) {
2850
2876
  }
2851
2877
  const Ve = Error.captureStackTrace ? Error.captureStackTrace : (...t) => {
2852
2878
  };
2853
- function we(t) {
2879
+ function ke(t) {
2854
2880
  return typeof t == "string" ? t : t == null ? void 0 : t.message;
2855
2881
  }
2856
2882
  function Ye(t, e, r) {
2857
- var a, i, c, l, d, u;
2883
+ var a, i, l, c, d, u;
2858
2884
  const s = { ...t, path: t.path ?? [] };
2859
2885
  if (!t.message) {
2860
- const g = we((c = (i = (a = t.inst) == null ? void 0 : a._zod.def) == null ? void 0 : i.error) == null ? void 0 : c.call(i, t)) ?? we((l = e == null ? void 0 : e.error) == null ? void 0 : l.call(e, t)) ?? we((d = r.customError) == null ? void 0 : d.call(r, t)) ?? we((u = r.localeError) == null ? void 0 : u.call(r, t)) ?? "Invalid input";
2861
- s.message = g;
2886
+ const y = ke((l = (i = (a = t.inst) == null ? void 0 : a._zod.def) == null ? void 0 : i.error) == null ? void 0 : l.call(i, t)) ?? ke((c = e == null ? void 0 : e.error) == null ? void 0 : c.call(e, t)) ?? ke((d = r.customError) == null ? void 0 : d.call(r, t)) ?? ke((u = r.localeError) == null ? void 0 : u.call(r, t)) ?? "Invalid input";
2887
+ s.message = y;
2862
2888
  }
2863
2889
  return delete s.inst, delete s.continue, e != null && e.reportInput || delete s.input, s;
2864
2890
  }
@@ -2880,24 +2906,24 @@ const We = (t, e) => {
2880
2906
  enumerable: !1
2881
2907
  });
2882
2908
  }, cr = qe("$ZodError", We), Qe = qe("$ZodError", We, { Parent: Error }), dr = (t) => (e, r, s, a) => {
2883
- const i = s ? Object.assign(s, { async: !1 }) : { async: !1 }, c = e._zod.run({ value: r, issues: [] }, i);
2884
- if (c instanceof Promise)
2909
+ const i = s ? Object.assign(s, { async: !1 }) : { async: !1 }, l = e._zod.run({ value: r, issues: [] }, i);
2910
+ if (l instanceof Promise)
2885
2911
  throw new ir();
2886
- if (c.issues.length) {
2887
- const l = new ((a == null ? void 0 : a.Err) ?? t)(c.issues.map((d) => Ye(d, i, He())));
2888
- throw Ve(l, a == null ? void 0 : a.callee), l;
2912
+ if (l.issues.length) {
2913
+ const c = new ((a == null ? void 0 : a.Err) ?? t)(l.issues.map((d) => Ye(d, i, He())));
2914
+ throw Ve(c, a == null ? void 0 : a.callee), c;
2889
2915
  }
2890
- return c.value;
2916
+ return l.value;
2891
2917
  }, ur = /* @__PURE__ */ dr(Qe), mr = (t) => async (e, r, s, a) => {
2892
2918
  const i = s ? Object.assign(s, { async: !0 }) : { async: !0 };
2893
- let c = e._zod.run({ value: r, issues: [] }, i);
2894
- if (c instanceof Promise && (c = await c), c.issues.length) {
2895
- const l = new ((a == null ? void 0 : a.Err) ?? t)(c.issues.map((d) => Ye(d, i, He())));
2896
- throw Ve(l, a == null ? void 0 : a.callee), l;
2919
+ let l = e._zod.run({ value: r, issues: [] }, i);
2920
+ if (l instanceof Promise && (l = await l), l.issues.length) {
2921
+ const c = new ((a == null ? void 0 : a.Err) ?? t)(l.issues.map((d) => Ye(d, i, He())));
2922
+ throw Ve(c, a == null ? void 0 : a.callee), c;
2897
2923
  }
2898
- return c.value;
2924
+ return l.value;
2899
2925
  }, hr = /* @__PURE__ */ mr(Qe);
2900
- function ze(t, e) {
2926
+ function $e(t, e) {
2901
2927
  try {
2902
2928
  var r = t();
2903
2929
  } catch (s) {
@@ -2907,18 +2933,18 @@ function ze(t, e) {
2907
2933
  }
2908
2934
  function pr(t, e) {
2909
2935
  for (var r = {}; t.length; ) {
2910
- var s = t[0], a = s.code, i = s.message, c = s.path.join(".");
2911
- if (!r[c]) if ("unionErrors" in s) {
2912
- var l = s.unionErrors[0].errors[0];
2913
- r[c] = { message: l.message, type: l.code };
2914
- } else r[c] = { message: i, type: a };
2915
- if ("unionErrors" in s && s.unionErrors.forEach(function(g) {
2916
- return g.errors.forEach(function(p) {
2917
- return t.push(p);
2936
+ var s = t[0], a = s.code, i = s.message, l = s.path.join(".");
2937
+ if (!r[l]) if ("unionErrors" in s) {
2938
+ var c = s.unionErrors[0].errors[0];
2939
+ r[l] = { message: c.message, type: c.code };
2940
+ } else r[l] = { message: i, type: a };
2941
+ if ("unionErrors" in s && s.unionErrors.forEach(function(y) {
2942
+ return y.errors.forEach(function(x) {
2943
+ return t.push(x);
2918
2944
  });
2919
2945
  }), e) {
2920
- var d = r[c].types, u = d && d[s.code];
2921
- r[c] = _e(c, e, r, a, u ? [].concat(u, s.message) : s.message);
2946
+ var d = r[l].types, u = d && d[s.code];
2947
+ r[l] = _e(l, e, r, a, u ? [].concat(u, s.message) : s.message);
2922
2948
  }
2923
2949
  t.shift();
2924
2950
  }
@@ -2926,18 +2952,18 @@ function pr(t, e) {
2926
2952
  }
2927
2953
  function gr(t, e) {
2928
2954
  for (var r = {}; t.length; ) {
2929
- var s = t[0], a = s.code, i = s.message, c = s.path.join(".");
2930
- if (!r[c]) if (s.code === "invalid_union" && s.errors.length > 0) {
2931
- var l = s.errors[0][0];
2932
- r[c] = { message: l.message, type: l.code };
2933
- } else r[c] = { message: i, type: a };
2934
- if (s.code === "invalid_union" && s.errors.forEach(function(g) {
2935
- return g.forEach(function(p) {
2936
- return t.push(p);
2955
+ var s = t[0], a = s.code, i = s.message, l = s.path.join(".");
2956
+ if (!r[l]) if (s.code === "invalid_union" && s.errors.length > 0) {
2957
+ var c = s.errors[0][0];
2958
+ r[l] = { message: c.message, type: c.code };
2959
+ } else r[l] = { message: i, type: a };
2960
+ if (s.code === "invalid_union" && s.errors.forEach(function(y) {
2961
+ return y.forEach(function(x) {
2962
+ return t.push(x);
2937
2963
  });
2938
2964
  }), e) {
2939
- var d = r[c].types, u = d && d[s.code];
2940
- r[c] = _e(c, e, r, a, u ? [].concat(u, s.message) : s.message);
2965
+ var d = r[l].types, u = d && d[s.code];
2966
+ r[l] = _e(l, e, r, a, u ? [].concat(u, s.message) : s.message);
2941
2967
  }
2942
2968
  t.shift();
2943
2969
  }
@@ -2948,47 +2974,47 @@ function Ge(t, e, r) {
2948
2974
  return "_def" in s && typeof s._def == "object" && "typeName" in s._def;
2949
2975
  }(t)) return function(s, a, i) {
2950
2976
  try {
2951
- return Promise.resolve(ze(function() {
2952
- return Promise.resolve(t[r.mode === "sync" ? "parse" : "parseAsync"](s, e)).then(function(c) {
2953
- return i.shouldUseNativeValidation && De({}, i), { errors: {}, values: r.raw ? Object.assign({}, s) : c };
2977
+ return Promise.resolve($e(function() {
2978
+ return Promise.resolve(t[r.mode === "sync" ? "parse" : "parseAsync"](s, e)).then(function(l) {
2979
+ return i.shouldUseNativeValidation && Fe({}, i), { errors: {}, values: r.raw ? Object.assign({}, s) : l };
2954
2980
  });
2955
- }, function(c) {
2956
- if (function(l) {
2957
- return Array.isArray(l == null ? void 0 : l.issues);
2958
- }(c)) return { values: {}, errors: Be(pr(c.errors, !i.shouldUseNativeValidation && i.criteriaMode === "all"), i) };
2959
- throw c;
2981
+ }, function(l) {
2982
+ if (function(c) {
2983
+ return Array.isArray(c == null ? void 0 : c.issues);
2984
+ }(l)) return { values: {}, errors: Oe(pr(l.errors, !i.shouldUseNativeValidation && i.criteriaMode === "all"), i) };
2985
+ throw l;
2960
2986
  }));
2961
- } catch (c) {
2962
- return Promise.reject(c);
2987
+ } catch (l) {
2988
+ return Promise.reject(l);
2963
2989
  }
2964
2990
  };
2965
2991
  if (function(s) {
2966
2992
  return "_zod" in s && typeof s._zod == "object";
2967
2993
  }(t)) return function(s, a, i) {
2968
2994
  try {
2969
- return Promise.resolve(ze(function() {
2970
- return Promise.resolve((r.mode === "sync" ? ur : hr)(t, s, e)).then(function(c) {
2971
- return i.shouldUseNativeValidation && De({}, i), { errors: {}, values: r.raw ? Object.assign({}, s) : c };
2995
+ return Promise.resolve($e(function() {
2996
+ return Promise.resolve((r.mode === "sync" ? ur : hr)(t, s, e)).then(function(l) {
2997
+ return i.shouldUseNativeValidation && Fe({}, i), { errors: {}, values: r.raw ? Object.assign({}, s) : l };
2972
2998
  });
2973
- }, function(c) {
2974
- if (function(l) {
2975
- return l instanceof cr;
2976
- }(c)) return { values: {}, errors: Be(gr(c.issues, !i.shouldUseNativeValidation && i.criteriaMode === "all"), i) };
2977
- throw c;
2999
+ }, function(l) {
3000
+ if (function(c) {
3001
+ return c instanceof cr;
3002
+ }(l)) return { values: {}, errors: Oe(gr(l.issues, !i.shouldUseNativeValidation && i.criteriaMode === "all"), i) };
3003
+ throw l;
2978
3004
  }));
2979
- } catch (c) {
2980
- return Promise.reject(c);
3005
+ } catch (l) {
3006
+ return Promise.reject(l);
2981
3007
  }
2982
3008
  };
2983
3009
  throw new Error("Invalid input: not a Zod schema");
2984
3010
  }
2985
3011
  function yr(t) {
2986
- return de.object({
2987
- questionResults: de.any()
3012
+ return ue.object({
3013
+ questionResults: ue.any()
2988
3014
  }).passthrough();
2989
3015
  }
2990
3016
  function fr(t) {
2991
- let e = de.array(de.instanceof(File));
3017
+ let e = ue.array(ue.instanceof(File));
2992
3018
  if (t.isRequired ? e = e.min(
2993
3019
  1,
2994
3020
  `${t.displayName} is required`
@@ -3014,132 +3040,132 @@ function qr(t) {
3014
3040
  return t.uploadDocumentFiles.forEach((r) => {
3015
3041
  const s = `file_${r.id}`;
3016
3042
  e[s] = fr(r);
3017
- }), de.object(e);
3043
+ }), ue.object(e);
3018
3044
  }
3019
3045
  function br(t) {
3020
- return de.any();
3046
+ return ue.any();
3021
3047
  }
3022
- function xr(t) {
3023
- return de.string().min(1, "This question is required");
3048
+ function vr(t) {
3049
+ return ue.string().min(1, "This question is required");
3024
3050
  }
3025
3051
  function Hr(t) {
3026
3052
  const e = {};
3027
3053
  return t.appropriatenessQuestions.forEach((r) => {
3028
3054
  const s = `question_${r.id}`;
3029
- e[s] = xr();
3030
- }), de.object(e);
3055
+ e[s] = vr();
3056
+ }), ue.object(e);
3031
3057
  }
3032
- const Vr = de.any(), vr = ({
3058
+ const Vr = ue.any(), xr = ({
3033
3059
  applicantId: t,
3034
3060
  onComplete: e,
3035
3061
  onBack: r
3036
3062
  }) => {
3037
- const { questionnaire: s, isLoading: a, isSubmitting: i, error: c, submit: l } = Zt(t), d = je(() => s ? { questionResults: s.questionGroups.map(
3038
- (y) => y.questions.map((P) => ({
3039
- questionId: P.id,
3063
+ const { questionnaire: s, isLoading: a, isSubmitting: i, error: l, submit: c } = Zt(t), d = Re(() => s ? { questionResults: s.questionGroups.map(
3064
+ (f) => f.questions.map((k) => ({
3065
+ questionId: k.id,
3040
3066
  values: []
3041
3067
  }))
3042
3068
  ) } : { questionResults: [] }, [s]), u = s ? yr() : null, {
3043
- control: g,
3044
- handleSubmit: p,
3045
- formState: { errors: m }
3046
- } = Fe({
3069
+ control: y,
3070
+ handleSubmit: x,
3071
+ formState: { errors: g }
3072
+ } = Te({
3047
3073
  resolver: u ? Ge(u) : void 0,
3048
3074
  defaultValues: d
3049
- }), v = async (b) => {
3075
+ }), b = async (m) => {
3050
3076
  if (s)
3051
3077
  try {
3052
- console.log("Form submitted with data:", b);
3053
- const y = s.questionGroups.flatMap(
3054
- (f, E) => f.questions.map((h, N) => {
3055
- var F, L, R;
3078
+ console.log("Form submitted with data:", m);
3079
+ const f = s.questionGroups.flatMap(
3080
+ (h, A) => h.questions.map((v, S) => {
3081
+ var I, P, C;
3056
3082
  return {
3057
- questionId: h.id,
3058
- values: ((R = (L = (F = b.questionResults) == null ? void 0 : F[E]) == null ? void 0 : L[N]) == null ? void 0 : R.values) || []
3083
+ questionId: v.id,
3084
+ values: ((C = (P = (I = m.questionResults) == null ? void 0 : I[A]) == null ? void 0 : P[S]) == null ? void 0 : C.values) || []
3059
3085
  };
3060
3086
  })
3061
3087
  );
3062
- console.log("Question results to submit:", y);
3063
- const P = {
3088
+ console.log("Question results to submit:", f);
3089
+ const k = {
3064
3090
  applicantId: t,
3065
3091
  questionnarieId: s.id,
3066
- questionResults: y
3092
+ questionResults: f
3067
3093
  };
3068
- console.log("Final input:", P), await l(P), e == null || e();
3069
- } catch (y) {
3070
- console.error("Error submitting questionnaire:", y);
3094
+ console.log("Final input:", k), await c(k), e == null || e();
3095
+ } catch (f) {
3096
+ console.error("Error submitting questionnaire:", f);
3071
3097
  }
3072
3098
  };
3073
- return a ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(ie, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3099
+ return a ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(ce, { className: "my-8" }) }) }) : l ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3074
3100
  "Error loading questionnaire: ",
3075
- c.message
3076
- ] }) }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: p(v), children: /* @__PURE__ */ o(T, { children: [
3077
- /* @__PURE__ */ o(J, { children: [
3101
+ l.message
3102
+ ] }) }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: x(b), children: /* @__PURE__ */ o(L, { children: [
3103
+ /* @__PURE__ */ o(ee, { children: [
3078
3104
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: s.displayName }),
3079
3105
  s.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: s.subtitle })
3080
3106
  ] }),
3081
- /* @__PURE__ */ n(M, { className: "space-y-8", children: s.questionGroups.flatMap(
3082
- (b, y) => b.questions.map((P, f) => {
3083
- const h = P.defaultAnswers && P.defaultAnswers.length > 0 ? P.showAsDropdown ? P.canMultipleAnswer ? "multi-select" : "single-select" : P.canMultipleAnswer ? "checkbox" : "radio" : "text";
3107
+ /* @__PURE__ */ n(T, { className: "space-y-8", children: s.questionGroups.flatMap(
3108
+ (m, f) => m.questions.map((k, h) => {
3109
+ const v = k.defaultAnswers && k.defaultAnswers.length > 0 ? k.showAsDropdown ? k.canMultipleAnswer ? "multi-select" : "single-select" : k.canMultipleAnswer ? "checkbox" : "radio" : "text";
3084
3110
  return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3085
3111
  /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300", children: [
3086
- P.text,
3087
- P.isRequired && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
3112
+ k.text,
3113
+ k.isRequired && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
3088
3114
  ] }),
3089
- h === "text" && /* @__PURE__ */ n(
3090
- G,
3115
+ v === "text" && /* @__PURE__ */ n(
3116
+ J,
3091
3117
  {
3092
- control: g,
3093
- name: `questionResults.${y}.${f}.values.0`,
3094
- render: ({ field: N }) => {
3095
- var F, L, R, C;
3118
+ control: y,
3119
+ name: `questionResults.${f}.${h}.values.0`,
3120
+ render: ({ field: S }) => {
3121
+ var I, P, C, E;
3096
3122
  return /* @__PURE__ */ n(
3097
- Z,
3123
+ X,
3098
3124
  {
3099
- value: N.value || "",
3100
- onChange: N.onChange,
3101
- onBlur: N.onBlur,
3102
- name: N.name,
3125
+ value: S.value || "",
3126
+ onChange: S.onChange,
3127
+ onBlur: S.onBlur,
3128
+ name: S.name,
3103
3129
  placeholder: "Enter your answer...",
3104
- error: (C = (R = (L = (F = m.questionResults) == null ? void 0 : F[y]) == null ? void 0 : L[f]) == null ? void 0 : R.values) == null ? void 0 : C.message
3130
+ error: (E = (C = (P = (I = g.questionResults) == null ? void 0 : I[f]) == null ? void 0 : P[h]) == null ? void 0 : C.values) == null ? void 0 : E.message
3105
3131
  }
3106
3132
  );
3107
3133
  }
3108
3134
  }
3109
3135
  ),
3110
- (h === "single-select" || h === "radio") && /* @__PURE__ */ n(
3111
- G,
3136
+ (v === "single-select" || v === "radio") && /* @__PURE__ */ n(
3137
+ J,
3112
3138
  {
3113
- control: g,
3114
- name: `questionResults.${y}.${f}.values.0`,
3115
- render: ({ field: N }) => {
3116
- var F, L, R, C;
3139
+ control: y,
3140
+ name: `questionResults.${f}.${h}.values.0`,
3141
+ render: ({ field: S }) => {
3142
+ var I, P, C, E;
3117
3143
  return /* @__PURE__ */ n(
3118
- ge,
3144
+ ye,
3119
3145
  {
3120
- value: N.value || "",
3121
- onChange: N.onChange,
3122
- onBlur: N.onBlur,
3123
- name: N.name,
3124
- options: P.defaultAnswers.map((B) => ({
3125
- value: B,
3126
- label: B
3146
+ value: S.value || "",
3147
+ onChange: S.onChange,
3148
+ onBlur: S.onBlur,
3149
+ name: S.name,
3150
+ options: k.defaultAnswers.map((M) => ({
3151
+ value: M,
3152
+ label: M
3127
3153
  })),
3128
3154
  placeholder: "Select an option...",
3129
- error: (C = (R = (L = (F = m.questionResults) == null ? void 0 : F[y]) == null ? void 0 : L[f]) == null ? void 0 : R.values) == null ? void 0 : C.message
3155
+ error: (E = (C = (P = (I = g.questionResults) == null ? void 0 : I[f]) == null ? void 0 : P[h]) == null ? void 0 : C.values) == null ? void 0 : E.message
3130
3156
  }
3131
3157
  );
3132
3158
  }
3133
3159
  }
3134
3160
  ),
3135
- (h === "checkbox" || h === "multi-select") && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3161
+ (v === "checkbox" || v === "multi-select") && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3136
3162
  /* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400 mb-2", children: "Choose one or more options" }),
3137
3163
  /* @__PURE__ */ n(
3138
- G,
3164
+ J,
3139
3165
  {
3140
- control: g,
3141
- name: `questionResults.${y}.${f}.values`,
3142
- render: ({ field: { value: N = [], onChange: F } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: P.defaultAnswers.map((L, R) => /* @__PURE__ */ o(
3166
+ control: y,
3167
+ name: `questionResults.${f}.${h}.values`,
3168
+ render: ({ field: { value: S = [], onChange: I } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: k.defaultAnswers.map((P, C) => /* @__PURE__ */ o(
3143
3169
  "label",
3144
3170
  {
3145
3171
  className: "flex items-center space-x-2 cursor-pointer",
@@ -3148,26 +3174,26 @@ const Vr = de.any(), vr = ({
3148
3174
  "input",
3149
3175
  {
3150
3176
  type: "checkbox",
3151
- checked: Array.isArray(N) && N.includes(L),
3152
- onChange: (C) => {
3153
- const B = Array.isArray(N) ? N : [], z = C.target.checked ? [...B, L] : B.filter((w) => w !== L);
3154
- F(z);
3177
+ checked: Array.isArray(S) && S.includes(P),
3178
+ onChange: (E) => {
3179
+ const M = Array.isArray(S) ? S : [], B = E.target.checked ? [...M, P] : M.filter((Q) => Q !== P);
3180
+ I(B);
3155
3181
  },
3156
3182
  className: "h-4 w-4 text-primary-500 rounded border-gray-300 focus:ring-primary-500"
3157
3183
  }
3158
3184
  ),
3159
- /* @__PURE__ */ n("span", { className: "text-sm", children: L })
3185
+ /* @__PURE__ */ n("span", { className: "text-sm", children: P })
3160
3186
  ]
3161
3187
  },
3162
- `answer-${y}-${f}-${R}`
3188
+ `answer-${f}-${h}-${C}`
3163
3189
  )) })
3164
3190
  }
3165
3191
  )
3166
3192
  ] })
3167
- ] }, P.id);
3193
+ ] }, k.id);
3168
3194
  })
3169
3195
  ) }),
3170
- /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3196
+ /* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
3171
3197
  r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3172
3198
  /* @__PURE__ */ n(
3173
3199
  j,
@@ -3175,15 +3201,15 @@ const Vr = de.any(), vr = ({
3175
3201
  type: "submit",
3176
3202
  isLoading: i,
3177
3203
  onClick: () => {
3178
- console.log("Continue button clicked"), console.log("Form errors:", m);
3204
+ console.log("Continue button clicked"), console.log("Form errors:", g);
3179
3205
  },
3180
3206
  children: "Continue"
3181
3207
  }
3182
3208
  )
3183
3209
  ] }),
3184
- c && /* @__PURE__ */ n("div", { className: "mt-4 p-4 bg-red-50 border border-red-200 rounded", children: /* @__PURE__ */ o("p", { className: "text-red-600 text-sm", children: [
3210
+ l && /* @__PURE__ */ n("div", { className: "mt-4 p-4 bg-red-50 border border-red-200 rounded", children: /* @__PURE__ */ o("p", { className: "text-red-600 text-sm", children: [
3185
3211
  "Error: ",
3186
- c.message
3212
+ l.message
3187
3213
  ] }) })
3188
3214
  ] }) }) : null;
3189
3215
  }, wr = ({
@@ -3191,69 +3217,69 @@ const Vr = de.any(), vr = ({
3191
3217
  onComplete: e,
3192
3218
  onBack: r
3193
3219
  }) => {
3194
- const { uploadDocument: s, isLoading: a, isSubmitting: i, error: c, submit: l } = Jt(t), [d, u] = x({}), g = async (p) => {
3195
- if (p.preventDefault(), !s) return;
3196
- const m = await Promise.all(
3197
- s.uploadDocumentFiles.map(async (b) => {
3198
- const y = d[b.id] || [], P = await Promise.all(
3199
- y.map(async (f) => ({
3200
- fileName: f.name,
3201
- fileData: await qt(f)
3220
+ const { uploadDocument: s, isLoading: a, isSubmitting: i, error: l, submit: c } = Jt(t), [d, u] = N({}), y = async (x) => {
3221
+ if (x.preventDefault(), !s) return;
3222
+ const g = await Promise.all(
3223
+ s.uploadDocumentFiles.map(async (m) => {
3224
+ const f = d[m.id] || [], k = await Promise.all(
3225
+ f.map(async (h) => ({
3226
+ fileName: h.name,
3227
+ fileData: await qt(h)
3202
3228
  }))
3203
3229
  );
3204
3230
  return {
3205
- uploadDocumentFileId: b.id,
3206
- valueList: P
3231
+ uploadDocumentFileId: m.id,
3232
+ valueList: k
3207
3233
  };
3208
3234
  })
3209
- ), v = {
3235
+ ), b = {
3210
3236
  applicantId: t,
3211
3237
  uploadDocumentId: s.id,
3212
- uploadDocumentResults: m
3238
+ uploadDocumentResults: g
3213
3239
  };
3214
- await l(v), e == null || e();
3240
+ await c(b), e == null || e();
3215
3241
  };
3216
- return a ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(ie, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3242
+ return a ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(ce, { className: "my-8" }) }) }) : l ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3217
3243
  "Error loading document requirements: ",
3218
- c.message
3219
- ] }) }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: g, children: /* @__PURE__ */ o(T, { children: [
3220
- /* @__PURE__ */ o(J, { children: [
3244
+ l.message
3245
+ ] }) }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: y, children: /* @__PURE__ */ o(L, { children: [
3246
+ /* @__PURE__ */ o(ee, { children: [
3221
3247
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: s.displayName }),
3222
3248
  s.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: s.subtitle })
3223
3249
  ] }),
3224
- /* @__PURE__ */ n(M, { className: "space-y-6", children: s.uploadDocumentFiles.map((p) => /* @__PURE__ */ n(
3250
+ /* @__PURE__ */ n(T, { className: "space-y-6", children: s.uploadDocumentFiles.map((x) => /* @__PURE__ */ n(
3225
3251
  nr,
3226
3252
  {
3227
- label: p.displayName,
3228
- accept: p.allowedTypes,
3229
- multiple: p.multipleFile,
3230
- maxSize: p.maxEachFileSizeByte,
3231
- value: d[p.id] || [],
3232
- onChange: (m) => {
3233
- u((v) => ({ ...v, [p.id]: m }));
3253
+ label: x.displayName,
3254
+ accept: x.allowedTypes,
3255
+ multiple: x.multipleFile,
3256
+ maxSize: x.maxEachFileSizeByte,
3257
+ value: d[x.id] || [],
3258
+ onChange: (g) => {
3259
+ u((b) => ({ ...b, [x.id]: g }));
3234
3260
  }
3235
3261
  },
3236
- p.id
3262
+ x.id
3237
3263
  )) }),
3238
- /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3264
+ /* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
3239
3265
  r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3240
3266
  /* @__PURE__ */ n(j, { type: "submit", isLoading: i, children: "Continue" })
3241
3267
  ] })
3242
3268
  ] }) }) : null;
3243
3269
  }, kr = ({ applicantId: t, onComplete: e, onBack: r }) => {
3244
- const { overview: s, isLoading: a, isSubmitting: i, error: c, passOverview: l } = Xt(t), d = async () => {
3245
- await l(), e == null || e();
3270
+ const { overview: s, isLoading: a, isSubmitting: i, error: l, passOverview: c } = Xt(t), d = async () => {
3271
+ await c(), e == null || e();
3246
3272
  };
3247
- return a ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(ie, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3273
+ return a ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(ce, { className: "my-8" }) }) }) : l ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3248
3274
  "Error loading overview: ",
3249
- c.message
3250
- ] }) }) }) : s ? /* @__PURE__ */ o(T, { children: [
3251
- /* @__PURE__ */ o(J, { children: [
3275
+ l.message
3276
+ ] }) }) }) : s ? /* @__PURE__ */ o(L, { children: [
3277
+ /* @__PURE__ */ o(ee, { children: [
3252
3278
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: s.title || "Overview" }),
3253
3279
  s.description && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: s.description })
3254
3280
  ] }),
3255
- /* @__PURE__ */ o(M, { className: "space-y-6", children: [
3256
- s.steps && s.steps.length > 0 ? /* @__PURE__ */ n("div", { className: "space-y-4", children: s.steps.sort((u, g) => u.order - g.order).map((u) => /* @__PURE__ */ n(
3281
+ /* @__PURE__ */ o(T, { className: "space-y-6", children: [
3282
+ s.steps && s.steps.length > 0 ? /* @__PURE__ */ n("div", { className: "space-y-4", children: s.steps.sort((u, y) => u.order - y.order).map((u) => /* @__PURE__ */ n(
3257
3283
  "div",
3258
3284
  {
3259
3285
  className: "border border-gray-200 dark:border-gray-700 rounded-lg p-4 bg-gray-50 dark:bg-gray-800",
@@ -3272,7 +3298,7 @@ const Vr = de.any(), vr = ({
3272
3298
  " Review the information above and confirm to proceed."
3273
3299
  ] }) })
3274
3300
  ] }),
3275
- /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3301
+ /* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
3276
3302
  r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3277
3303
  /* @__PURE__ */ n(j, { onClick: d, isLoading: i, children: "Confirm and Continue" })
3278
3304
  ] })
@@ -3282,148 +3308,148 @@ const Vr = de.any(), vr = ({
3282
3308
  onComplete: e,
3283
3309
  onBack: r
3284
3310
  }) => {
3285
- const { criteria: s, isLoading: a, isSubmitting: i, error: c, submit: l } = tr(t), [d, u] = le.useState(!1), g = le.useMemo(() => !s || s.length === 0 ? { criteriaValueInputs: [] } : {
3286
- criteriaValueInputs: s.map((f) => ({
3287
- riskCriteriaId: f.id,
3311
+ const { criteria: s, isLoading: a, isSubmitting: i, error: l, submit: c } = tr(t), [d, u] = ie.useState(!1), y = ie.useMemo(() => !s || s.length === 0 ? { criteriaValueInputs: [] } : {
3312
+ criteriaValueInputs: s.map((h) => ({
3313
+ riskCriteriaId: h.id,
3288
3314
  values: [""]
3289
3315
  // Initialize with empty string to prevent uncontrolled input warning
3290
3316
  }))
3291
- }, [s]), p = s && s.length > 0 ? br() : null, {
3292
- control: m,
3293
- handleSubmit: v,
3294
- formState: { errors: b }
3295
- } = Fe({
3296
- resolver: p ? Ge(p) : void 0,
3297
- defaultValues: g
3317
+ }, [s]), x = s && s.length > 0 ? br() : null, {
3318
+ control: g,
3319
+ handleSubmit: b,
3320
+ formState: { errors: m }
3321
+ } = Te({
3322
+ resolver: x ? Ge(x) : void 0,
3323
+ defaultValues: y
3298
3324
  });
3299
- le.useEffect(() => {
3300
- !a && s && s.length === 0 && !d && !i && (u(!0), l({ applicantId: t, criteriaValueInputs: [] }).then(() => e == null ? void 0 : e()).catch(console.error));
3301
- }, [a, s, d, i, l, t, e]);
3302
- const y = async (f) => {
3325
+ ie.useEffect(() => {
3326
+ !a && s && s.length === 0 && !d && !i && (u(!0), c({ applicantId: t, criteriaValueInputs: [] }).then(() => e == null ? void 0 : e()).catch(console.error));
3327
+ }, [a, s, d, i, c, t, e]);
3328
+ const f = async (h) => {
3303
3329
  if (s)
3304
3330
  try {
3305
- console.log("Risk scoring form submitted:", f), console.log("Criteria metadata:", s);
3306
- const E = f.criteriaValueInputs.map((N, F) => {
3307
- const L = N.values || [], R = Array.isArray(L) ? L.filter((C) => C && C.trim()) : L && L.toString().trim() ? [L.toString()] : [];
3308
- return R.length === 0 ? null : {
3309
- riskCriteriaId: s[F].id,
3310
- values: R
3331
+ console.log("Risk scoring form submitted:", h), console.log("Criteria metadata:", s);
3332
+ const A = h.criteriaValueInputs.map((S, I) => {
3333
+ const P = S.values || [], C = Array.isArray(P) ? P.filter((E) => E && E.trim()) : P && P.toString().trim() ? [P.toString()] : [];
3334
+ return C.length === 0 ? null : {
3335
+ riskCriteriaId: s[I].id,
3336
+ values: C
3311
3337
  };
3312
- }).filter((N) => N !== null);
3313
- console.log("Risk scoring criteriaValueInputs to submit:", E);
3314
- const h = {
3338
+ }).filter((S) => S !== null);
3339
+ console.log("Risk scoring criteriaValueInputs to submit:", A);
3340
+ const v = {
3315
3341
  applicantId: t,
3316
- criteriaValueInputs: E
3342
+ criteriaValueInputs: A
3317
3343
  };
3318
- console.log("Final risk scoring input:", h), await l(h), console.log("Risk scoring submitted successfully!"), e == null || e();
3319
- } catch (E) {
3320
- throw console.error("Error submitting risk scoring:", E), E;
3344
+ console.log("Final risk scoring input:", v), await c(v), console.log("Risk scoring submitted successfully!"), e == null || e();
3345
+ } catch (A) {
3346
+ throw console.error("Error submitting risk scoring:", A), A;
3321
3347
  }
3322
- }, P = (f) => f.builtInType === 1 ? "country" : !f.defaultValues || f.defaultValues.length === 0 ? "text" : f.multipleValue ? "checkbox" : "radio";
3323
- return a ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
3324
- /* @__PURE__ */ n(ie, { className: "my-8" }),
3348
+ }, k = (h) => h.builtInType === 1 ? "country" : !h.defaultValues || h.defaultValues.length === 0 ? "text" : h.multipleValue ? "checkbox" : "radio";
3349
+ return a ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
3350
+ /* @__PURE__ */ n(ce, { className: "my-8" }),
3325
3351
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading risk scoring criteria..." })
3326
- ] }) }) : c ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3352
+ ] }) }) : l ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3327
3353
  "Error loading criteria: ",
3328
- c.message
3329
- ] }) }) }) : !a && s && s.length === 0 ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
3330
- /* @__PURE__ */ n(ie, { className: "my-8" }),
3354
+ l.message
3355
+ ] }) }) }) : !a && s && s.length === 0 ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
3356
+ /* @__PURE__ */ n(ce, { className: "my-8" }),
3331
3357
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400", children: "No risk scoring criteria required. Moving to next step..." })
3332
- ] }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: v(y), children: /* @__PURE__ */ o(T, { children: [
3333
- /* @__PURE__ */ o(J, { children: [
3358
+ ] }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: b(f), children: /* @__PURE__ */ o(L, { children: [
3359
+ /* @__PURE__ */ o(ee, { children: [
3334
3360
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Risk Assessment" }),
3335
3361
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please answer the following questions for risk evaluation" })
3336
3362
  ] }),
3337
- /* @__PURE__ */ n(M, { className: "space-y-8", children: s.map((f, E) => {
3338
- var N, F, L;
3339
- const h = P(f);
3363
+ /* @__PURE__ */ n(T, { className: "space-y-8", children: s.map((h, A) => {
3364
+ var S, I, P;
3365
+ const v = k(h);
3340
3366
  return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3341
3367
  /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300", children: [
3342
- f.displayName,
3343
- f.isRequired && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
3368
+ h.displayName,
3369
+ h.isRequired && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
3344
3370
  ] }),
3345
- f.description && /* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: f.description }),
3346
- h === "text" && /* @__PURE__ */ n(
3347
- G,
3371
+ h.description && /* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: h.description }),
3372
+ v === "text" && /* @__PURE__ */ n(
3373
+ J,
3348
3374
  {
3349
- control: m,
3350
- name: `criteriaValueInputs.${E}.values.0`,
3351
- render: ({ field: R }) => {
3352
- var C, B, z;
3375
+ control: g,
3376
+ name: `criteriaValueInputs.${A}.values.0`,
3377
+ render: ({ field: C }) => {
3378
+ var E, M, B;
3353
3379
  return /* @__PURE__ */ n(
3354
- Z,
3380
+ X,
3355
3381
  {
3356
- ...R,
3357
- value: R.value || "",
3358
- type: f.valueDataType === Re.DigitOnly ? "number" : "text",
3382
+ ...C,
3383
+ value: C.value || "",
3384
+ type: h.valueDataType === Pe.DigitOnly ? "number" : "text",
3359
3385
  placeholder: "Enter your answer...",
3360
- error: (z = (B = (C = b.criteriaValueInputs) == null ? void 0 : C[E]) == null ? void 0 : B.values) == null ? void 0 : z.message,
3361
- onKeyDown: (w) => {
3362
- f.valueDataType === Re.DigitOnly && ["e", "E", "+", "-", "."].includes(w.key) && w.preventDefault();
3386
+ error: (B = (M = (E = m.criteriaValueInputs) == null ? void 0 : E[A]) == null ? void 0 : M.values) == null ? void 0 : B.message,
3387
+ onKeyDown: (Q) => {
3388
+ h.valueDataType === Pe.DigitOnly && ["e", "E", "+", "-", "."].includes(Q.key) && Q.preventDefault();
3363
3389
  }
3364
3390
  }
3365
3391
  );
3366
3392
  }
3367
3393
  }
3368
3394
  ),
3369
- h === "radio" && f.defaultValues && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3395
+ v === "radio" && h.defaultValues && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3370
3396
  /* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: "Choose one option" }),
3371
3397
  /* @__PURE__ */ n(
3372
- G,
3398
+ J,
3373
3399
  {
3374
- control: m,
3375
- name: `criteriaValueInputs.${E}.values.0`,
3376
- render: ({ field: { value: R, onChange: C } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: f.defaultValues.map((B, z) => /* @__PURE__ */ o("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
3400
+ control: g,
3401
+ name: `criteriaValueInputs.${A}.values.0`,
3402
+ render: ({ field: { value: C, onChange: E } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: h.defaultValues.map((M, B) => /* @__PURE__ */ o("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
3377
3403
  /* @__PURE__ */ n(
3378
3404
  "input",
3379
3405
  {
3380
3406
  type: "radio",
3381
- checked: R === B,
3382
- onChange: () => C(B),
3407
+ checked: C === M,
3408
+ onChange: () => E(M),
3383
3409
  className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
3384
3410
  }
3385
3411
  ),
3386
- /* @__PURE__ */ n("span", { className: "text-sm", children: B })
3387
- ] }, `${E}-${z}`)) })
3412
+ /* @__PURE__ */ n("span", { className: "text-sm", children: M })
3413
+ ] }, `${A}-${B}`)) })
3388
3414
  }
3389
3415
  )
3390
3416
  ] }),
3391
- h === "checkbox" && f.defaultValues && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3417
+ v === "checkbox" && h.defaultValues && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3392
3418
  /* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: "Choose one or more options" }),
3393
3419
  /* @__PURE__ */ n(
3394
- G,
3420
+ J,
3395
3421
  {
3396
- control: m,
3397
- name: `criteriaValueInputs.${E}.values`,
3398
- render: ({ field: { value: R = [], onChange: C } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: f.defaultValues.map((B, z) => /* @__PURE__ */ o("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
3422
+ control: g,
3423
+ name: `criteriaValueInputs.${A}.values`,
3424
+ render: ({ field: { value: C = [], onChange: E } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: h.defaultValues.map((M, B) => /* @__PURE__ */ o("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
3399
3425
  /* @__PURE__ */ n(
3400
3426
  "input",
3401
3427
  {
3402
3428
  type: "checkbox",
3403
- checked: Array.isArray(R) && R.includes(B),
3404
- onChange: (w) => {
3405
- const I = Array.isArray(R) ? R : [], A = w.target.checked ? [...I, B] : I.filter((k) => k !== B);
3406
- C(A);
3429
+ checked: Array.isArray(C) && C.includes(M),
3430
+ onChange: (Q) => {
3431
+ const _ = Array.isArray(C) ? C : [], p = Q.target.checked ? [..._, M] : _.filter((w) => w !== M);
3432
+ E(p);
3407
3433
  },
3408
3434
  className: "h-4 w-4 text-primary-500 rounded border-gray-300 focus:ring-primary-500"
3409
3435
  }
3410
3436
  ),
3411
- /* @__PURE__ */ n("span", { className: "text-sm", children: B })
3412
- ] }, `${E}-${z}`)) })
3437
+ /* @__PURE__ */ n("span", { className: "text-sm", children: M })
3438
+ ] }, `${A}-${B}`)) })
3413
3439
  }
3414
3440
  )
3415
3441
  ] }),
3416
- h === "country" && /* @__PURE__ */ n(
3417
- G,
3442
+ v === "country" && /* @__PURE__ */ n(
3443
+ J,
3418
3444
  {
3419
- control: m,
3420
- name: `criteriaValueInputs.${E}.values.0`,
3421
- render: ({ field: R }) => {
3422
- var C, B, z;
3445
+ control: g,
3446
+ name: `criteriaValueInputs.${A}.values.0`,
3447
+ render: ({ field: C }) => {
3448
+ var E, M, B;
3423
3449
  return /* @__PURE__ */ n(
3424
- ge,
3450
+ ye,
3425
3451
  {
3426
- ...R,
3452
+ ...C,
3427
3453
  options: [
3428
3454
  { value: "US", label: "United States" },
3429
3455
  { value: "GB", label: "United Kingdom" },
@@ -3431,16 +3457,16 @@ const Vr = de.any(), vr = ({
3431
3457
  // TODO: Load from base information service
3432
3458
  ],
3433
3459
  placeholder: "Select a country...",
3434
- error: (z = (B = (C = b.criteriaValueInputs) == null ? void 0 : C[E]) == null ? void 0 : B.values) == null ? void 0 : z.message
3460
+ error: (B = (M = (E = m.criteriaValueInputs) == null ? void 0 : E[A]) == null ? void 0 : M.values) == null ? void 0 : B.message
3435
3461
  }
3436
3462
  );
3437
3463
  }
3438
3464
  }
3439
3465
  ),
3440
- ((L = (F = (N = b.criteriaValueInputs) == null ? void 0 : N[E]) == null ? void 0 : F.values) == null ? void 0 : L.message) && /* @__PURE__ */ n("p", { className: "text-sm text-danger-500 mt-1", children: b.criteriaValueInputs[E].values.message })
3441
- ] }, f.id);
3466
+ ((P = (I = (S = m.criteriaValueInputs) == null ? void 0 : S[A]) == null ? void 0 : I.values) == null ? void 0 : P.message) && /* @__PURE__ */ n("p", { className: "text-sm text-danger-500 mt-1", children: m.criteriaValueInputs[A].values.message })
3467
+ ] }, h.id);
3442
3468
  }) }),
3443
- /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3469
+ /* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
3444
3470
  r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3445
3471
  /* @__PURE__ */ n(
3446
3472
  j,
@@ -3448,15 +3474,15 @@ const Vr = de.any(), vr = ({
3448
3474
  type: "submit",
3449
3475
  isLoading: i,
3450
3476
  onClick: () => {
3451
- console.log("Risk scoring submit button clicked"), console.log("Form errors:", b);
3477
+ console.log("Risk scoring submit button clicked"), console.log("Form errors:", m);
3452
3478
  },
3453
3479
  children: "Continue"
3454
3480
  }
3455
3481
  )
3456
3482
  ] }),
3457
- c && /* @__PURE__ */ n("div", { className: "mt-4 p-4 bg-red-50 border border-red-200 rounded", children: /* @__PURE__ */ o("p", { className: "text-red-600 text-sm", children: [
3483
+ l && /* @__PURE__ */ n("div", { className: "mt-4 p-4 bg-red-50 border border-red-200 rounded", children: /* @__PURE__ */ o("p", { className: "text-red-600 text-sm", children: [
3458
3484
  "Error: ",
3459
- c.message
3485
+ l.message
3460
3486
  ] }) })
3461
3487
  ] }) }) : null;
3462
3488
  }, Sr = ({
@@ -3464,39 +3490,39 @@ const Vr = de.any(), vr = ({
3464
3490
  onComplete: e,
3465
3491
  onBack: r
3466
3492
  }) => {
3467
- const { investorCategorizationService: s } = re(), [a, i] = x(null), [c, l] = x(!1), [d, u] = x(null);
3468
- return /* @__PURE__ */ n("form", { onSubmit: async (p) => {
3469
- if (p.preventDefault(), a === null) {
3493
+ const { investorCategorizationService: s } = se(), [a, i] = N(null), [l, c] = N(!1), [d, u] = N(null);
3494
+ return /* @__PURE__ */ n("form", { onSubmit: async (x) => {
3495
+ if (x.preventDefault(), a === null) {
3470
3496
  u("Please select an investor type");
3471
3497
  return;
3472
3498
  }
3473
- l(!0), u(null);
3499
+ c(!0), u(null);
3474
3500
  try {
3475
- const m = {
3501
+ const g = {
3476
3502
  applicantId: t,
3477
3503
  investorType: a
3478
3504
  };
3479
- console.log("Submitting investor categorization:", m);
3480
- const v = await s.setInvestorCategorization(m);
3481
- console.log("Investor categorization result:", v), e == null || e();
3482
- } catch (m) {
3483
- console.error("Error submitting investor categorization:", m), u(m.message || "Failed to submit investor categorization");
3505
+ console.log("Submitting investor categorization:", g);
3506
+ const b = await s.setInvestorCategorization(g);
3507
+ console.log("Investor categorization result:", b), e == null || e();
3508
+ } catch (g) {
3509
+ console.error("Error submitting investor categorization:", g), u(g.message || "Failed to submit investor categorization");
3484
3510
  } finally {
3485
- l(!1);
3511
+ c(!1);
3486
3512
  }
3487
- }, children: /* @__PURE__ */ o(T, { children: [
3488
- /* @__PURE__ */ o(J, { children: [
3513
+ }, children: /* @__PURE__ */ o(L, { children: [
3514
+ /* @__PURE__ */ o(ee, { children: [
3489
3515
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Which statement best describes you?" }),
3490
3516
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: "All Tokenise clients are treated as Retail Investors under EU regulation, which gives you the highest level of investor protection. For our internal purposes, we ask you to select the description that best matches your situation" })
3491
3517
  ] }),
3492
- /* @__PURE__ */ o(M, { className: "space-y-4", children: [
3518
+ /* @__PURE__ */ o(T, { className: "space-y-4", children: [
3493
3519
  /* @__PURE__ */ n("p", { className: "text-sm font-medium text-gray-700 dark:text-gray-300 mb-3", children: "Choose one" }),
3494
3520
  /* @__PURE__ */ n(
3495
3521
  "label",
3496
3522
  {
3497
3523
  className: `
3498
3524
  block p-4 border-2 rounded-lg cursor-pointer transition-all
3499
- ${a === ee.Individual ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
3525
+ ${a === re.Individual ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
3500
3526
  `,
3501
3527
  children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
3502
3528
  /* @__PURE__ */ n(
@@ -3504,9 +3530,9 @@ const Vr = de.any(), vr = ({
3504
3530
  {
3505
3531
  type: "radio",
3506
3532
  name: "investorType",
3507
- value: ee.Individual,
3508
- checked: a === ee.Individual,
3509
- onChange: () => i(ee.Individual),
3533
+ value: re.Individual,
3534
+ checked: a === re.Individual,
3535
+ onChange: () => i(re.Individual),
3510
3536
  className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
3511
3537
  }
3512
3538
  ),
@@ -3522,7 +3548,7 @@ const Vr = de.any(), vr = ({
3522
3548
  {
3523
3549
  className: `
3524
3550
  block p-4 border-2 rounded-lg cursor-pointer transition-all
3525
- ${a === ee.Sophisticated ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
3551
+ ${a === re.Sophisticated ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
3526
3552
  `,
3527
3553
  children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
3528
3554
  /* @__PURE__ */ n(
@@ -3530,9 +3556,9 @@ const Vr = de.any(), vr = ({
3530
3556
  {
3531
3557
  type: "radio",
3532
3558
  name: "investorType",
3533
- value: ee.Sophisticated,
3534
- checked: a === ee.Sophisticated,
3535
- onChange: () => i(ee.Sophisticated),
3559
+ value: re.Sophisticated,
3560
+ checked: a === re.Sophisticated,
3561
+ onChange: () => i(re.Sophisticated),
3536
3562
  className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
3537
3563
  }
3538
3564
  ),
@@ -3553,7 +3579,7 @@ const Vr = de.any(), vr = ({
3553
3579
  {
3554
3580
  className: `
3555
3581
  block p-4 border-2 rounded-lg cursor-pointer transition-all
3556
- ${a === ee.HighNetWorth ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
3582
+ ${a === re.HighNetWorth ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
3557
3583
  `,
3558
3584
  children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
3559
3585
  /* @__PURE__ */ n(
@@ -3561,9 +3587,9 @@ const Vr = de.any(), vr = ({
3561
3587
  {
3562
3588
  type: "radio",
3563
3589
  name: "investorType",
3564
- value: ee.HighNetWorth,
3565
- checked: a === ee.HighNetWorth,
3566
- onChange: () => i(ee.HighNetWorth),
3590
+ value: re.HighNetWorth,
3591
+ checked: a === re.HighNetWorth,
3592
+ onChange: () => i(re.HighNetWorth),
3567
3593
  className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
3568
3594
  }
3569
3595
  ),
@@ -3584,13 +3610,13 @@ const Vr = de.any(), vr = ({
3584
3610
  d
3585
3611
  ] }) })
3586
3612
  ] }),
3587
- /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3613
+ /* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
3588
3614
  r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3589
3615
  /* @__PURE__ */ n(
3590
3616
  j,
3591
3617
  {
3592
3618
  type: "submit",
3593
- isLoading: c,
3619
+ isLoading: l,
3594
3620
  disabled: a === null,
3595
3621
  children: "Submit"
3596
3622
  }
@@ -3602,135 +3628,135 @@ const Vr = de.any(), vr = ({
3602
3628
  onComplete: e,
3603
3629
  onBack: r
3604
3630
  }) => {
3605
- const { appropriatenessTestService: s } = re(), [a, i] = x(null), [c, l] = x(!0), [d, u] = x(!1), [g, p] = x(null), [m, v] = x({}), [b, y] = x(0), [P, f] = x(!1), [E, h] = x(!1), [N, F] = x(0);
3606
- V(() => {
3631
+ const { appropriatenessTestService: s } = se(), [a, i] = N(null), [l, c] = N(!0), [d, u] = N(!1), [y, x] = N(null), [g, b] = N({}), [m, f] = N(0), [k, h] = N(!1), [A, v] = N(!1), [S, I] = N(0);
3632
+ Y(() => {
3607
3633
  (async () => {
3608
3634
  try {
3609
- l(!0), p(null), console.log("Loading appropriateness test for applicant:", t);
3610
- const k = await s.getAppropriatenessTest(t);
3611
- if (console.log("Appropriateness test data:", k), i(k), k.waitTimeSpanForNextTry && k.waitTimeSpanForNextTry !== "00:00:00") {
3612
- const S = L(k.waitTimeSpanForNextTry);
3613
- S > 0 && F(S);
3635
+ c(!0), x(null), console.log("Loading appropriateness test for applicant:", t);
3636
+ const w = await s.getAppropriatenessTest(t);
3637
+ if (console.log("Appropriateness test data:", w), i(w), w.waitTimeSpanForNextTry && w.waitTimeSpanForNextTry !== "00:00:00") {
3638
+ const O = P(w.waitTimeSpanForNextTry);
3639
+ O > 0 && I(O);
3614
3640
  }
3615
- } catch (k) {
3616
- console.error("Error loading appropriateness test:", k), p(k.message || "Failed to load appropriateness test");
3641
+ } catch (w) {
3642
+ console.error("Error loading appropriateness test:", w), x(w.message || "Failed to load appropriateness test");
3617
3643
  } finally {
3618
- l(!1);
3644
+ c(!1);
3619
3645
  }
3620
3646
  })();
3621
3647
  }, [t, s]);
3622
- const L = (A) => {
3623
- const k = A.split(":").map(Number);
3624
- if (k.length === 3) {
3625
- const [S, _, oe] = k;
3626
- return S * 3600 + _ * 60 + oe;
3648
+ const P = (p) => {
3649
+ const w = p.split(":").map(Number);
3650
+ if (w.length === 3) {
3651
+ const [O, z, R] = w;
3652
+ return O * 3600 + z * 60 + R;
3627
3653
  }
3628
3654
  return 0;
3629
- }, R = (A) => {
3630
- const k = Math.floor(A / 60), S = A % 60;
3631
- return `${k.toString().padStart(2, "0")}:${S.toString().padStart(2, "0")}`;
3655
+ }, C = (p) => {
3656
+ const w = Math.floor(p / 60), O = p % 60;
3657
+ return `${w.toString().padStart(2, "0")}:${O.toString().padStart(2, "0")}`;
3632
3658
  };
3633
- V(() => {
3634
- if (!P || b <= 0) return;
3635
- const A = setInterval(() => {
3636
- y((k) => k <= 1 ? (h(!0), 0) : k - 1);
3659
+ Y(() => {
3660
+ if (!k || m <= 0) return;
3661
+ const p = setInterval(() => {
3662
+ f((w) => w <= 1 ? (v(!0), 0) : w - 1);
3637
3663
  }, 1e3);
3638
- return () => clearInterval(A);
3639
- }, [P, b]), V(() => {
3640
- if (N <= 0) return;
3641
- const A = setInterval(() => {
3642
- F((k) => k <= 1 ? 0 : k - 1);
3664
+ return () => clearInterval(p);
3665
+ }, [k, m]), Y(() => {
3666
+ if (S <= 0) return;
3667
+ const p = setInterval(() => {
3668
+ I((w) => w <= 1 ? 0 : w - 1);
3643
3669
  }, 1e3);
3644
- return () => clearInterval(A);
3645
- }, [N]), V(() => {
3646
- E && !d && z();
3647
- }, [E]);
3648
- const C = () => {
3649
- a && (f(!0), y(a.testDurationSec));
3650
- }, B = (A, k) => {
3651
- v((S) => ({
3652
- ...S,
3653
- [A]: k
3670
+ return () => clearInterval(p);
3671
+ }, [S]), Y(() => {
3672
+ A && !d && B();
3673
+ }, [A]);
3674
+ const E = () => {
3675
+ a && (h(!0), f(a.testDurationSec));
3676
+ }, M = (p, w) => {
3677
+ b((O) => ({
3678
+ ...O,
3679
+ [p]: w
3654
3680
  }));
3655
- }, z = async (A) => {
3656
- if (A && A.preventDefault(), !!a) {
3657
- if (!E) {
3658
- const k = a.appropriatenessQuestions.length - Object.keys(m).length;
3659
- if (k > 0) {
3660
- p(`Please answer all questions. ${k} question(s) remaining.`);
3681
+ }, B = async (p) => {
3682
+ if (p && p.preventDefault(), !!a) {
3683
+ if (!A) {
3684
+ const w = a.appropriatenessQuestions.length - Object.keys(g).length;
3685
+ if (w > 0) {
3686
+ x(`Please answer all questions. ${w} question(s) remaining.`);
3661
3687
  return;
3662
3688
  }
3663
3689
  }
3664
- u(!0), p(null);
3690
+ u(!0), x(null);
3665
3691
  try {
3666
- const k = a.appropriatenessQuestions.map(
3667
- (_) => ({
3668
- appropriatenessQuestionId: _.id,
3669
- value: m[_.id] || ""
3692
+ const w = a.appropriatenessQuestions.map(
3693
+ (z) => ({
3694
+ appropriatenessQuestionId: z.id,
3695
+ value: g[z.id] || ""
3670
3696
  // Empty string if not answered
3671
3697
  })
3672
- ), S = {
3698
+ ), O = {
3673
3699
  applicantId: t,
3674
3700
  appropriatenessTestId: a.id,
3675
- appropriatenessQuestionResults: k
3701
+ appropriatenessQuestionResults: w
3676
3702
  };
3677
- console.log("Submitting appropriateness test:", S);
3703
+ console.log("Submitting appropriateness test:", O);
3678
3704
  try {
3679
- const _ = await s.fillAppropriatenessTest(S);
3680
- console.log("Appropriateness test result:", _), _.message && (_.message.toLowerCase().includes("pass") || _.message.toLowerCase().includes("success") || _.message.toLowerCase().includes("congratulations")) ? e == null || e() : (p(_.message || "Test completed. Please check the result."), f(!1), h(!1), v({}), setTimeout(() => w(), 1e3));
3681
- } catch (_) {
3682
- if (_.code === 400 && _.message) {
3683
- const oe = _.message;
3684
- console.log("Test failed:", oe), p(oe), f(!1), h(!1), v({}), setTimeout(() => w(), 1500);
3705
+ const z = await s.fillAppropriatenessTest(O);
3706
+ console.log("Appropriateness test result:", z), z.message && (z.message.toLowerCase().includes("pass") || z.message.toLowerCase().includes("success") || z.message.toLowerCase().includes("congratulations")) ? e == null || e() : (x(z.message || "Test completed. Please check the result."), h(!1), v(!1), b({}), setTimeout(() => Q(), 1e3));
3707
+ } catch (z) {
3708
+ if (z.code === 400 && z.message) {
3709
+ const R = z.message;
3710
+ console.log("Test failed:", R), x(R), h(!1), v(!1), b({}), setTimeout(() => Q(), 1500);
3685
3711
  } else
3686
- throw _;
3712
+ throw z;
3687
3713
  }
3688
- } catch (k) {
3689
- console.error("Error submitting appropriateness test:", k), p(k.message || "Failed to submit test. Please try again."), f(!1), h(!1), v({});
3714
+ } catch (w) {
3715
+ console.error("Error submitting appropriateness test:", w), x(w.message || "Failed to submit test. Please try again."), h(!1), v(!1), b({});
3690
3716
  } finally {
3691
3717
  u(!1);
3692
3718
  }
3693
3719
  }
3694
- }, w = async () => {
3720
+ }, Q = async () => {
3695
3721
  try {
3696
- const A = await s.getAppropriatenessTest(t);
3697
- if (console.log("Reloaded test data:", A), i(A), A.waitTimeSpanForNextTry && A.waitTimeSpanForNextTry !== "00:00:00") {
3698
- const k = L(A.waitTimeSpanForNextTry);
3699
- k > 0 && F(k);
3722
+ const p = await s.getAppropriatenessTest(t);
3723
+ if (console.log("Reloaded test data:", p), i(p), p.waitTimeSpanForNextTry && p.waitTimeSpanForNextTry !== "00:00:00") {
3724
+ const w = P(p.waitTimeSpanForNextTry);
3725
+ w > 0 && I(w);
3700
3726
  }
3701
- } catch (A) {
3702
- console.error("Error reloading test data:", A), p((k) => k + `
3727
+ } catch (p) {
3728
+ console.error("Error reloading test data:", p), x((w) => w + `
3703
3729
 
3704
3730
  Failed to reload test data. Please refresh the page.`);
3705
3731
  }
3706
3732
  };
3707
- if (c)
3708
- return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
3709
- /* @__PURE__ */ n(ie, { className: "my-8" }),
3733
+ if (l)
3734
+ return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
3735
+ /* @__PURE__ */ n(ce, { className: "my-8" }),
3710
3736
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading appropriateness test..." })
3711
3737
  ] }) });
3712
3738
  if (!a)
3713
- return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { className: "py-12 text-center", children: [
3739
+ return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { className: "py-12 text-center", children: [
3714
3740
  /* @__PURE__ */ n("p", { className: "text-danger-500 text-lg mb-4", children: "No test data available" }),
3715
- g && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: g })
3741
+ y && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: y })
3716
3742
  ] }) });
3717
- if (N > 0)
3718
- return /* @__PURE__ */ o(T, { children: [
3719
- /* @__PURE__ */ o(J, { children: [
3743
+ if (S > 0)
3744
+ return /* @__PURE__ */ o(L, { children: [
3745
+ /* @__PURE__ */ o(ee, { children: [
3720
3746
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: a.displayName }),
3721
3747
  a.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: a.subtitle })
3722
3748
  ] }),
3723
- /* @__PURE__ */ o(M, { className: "py-12 text-center", children: [
3749
+ /* @__PURE__ */ o(T, { className: "py-12 text-center", children: [
3724
3750
  /* @__PURE__ */ o("div", { className: "mb-6", children: [
3725
- /* @__PURE__ */ n("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: R(N) }),
3751
+ /* @__PURE__ */ n("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: C(S) }),
3726
3752
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait before attempting the test again" })
3727
3753
  ] }),
3728
- g && /* @__PURE__ */ n("div", { className: "mt-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ n("p", { className: "text-red-600 dark:text-red-400 text-sm", children: g }) })
3754
+ y && /* @__PURE__ */ n("div", { className: "mt-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ n("p", { className: "text-red-600 dark:text-red-400 text-sm", children: y }) })
3729
3755
  ] })
3730
3756
  ] });
3731
- const I = a.testAllowedMaxTry - a.totalFailedTries;
3732
- return P ? /* @__PURE__ */ n("form", { onSubmit: z, children: /* @__PURE__ */ o(T, { children: [
3733
- /* @__PURE__ */ n(J, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
3757
+ const _ = a.testAllowedMaxTry - a.totalFailedTries;
3758
+ return k ? /* @__PURE__ */ n("form", { onSubmit: B, children: /* @__PURE__ */ o(L, { children: [
3759
+ /* @__PURE__ */ n(ee, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
3734
3760
  /* @__PURE__ */ o("div", { children: [
3735
3761
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: a.displayName }),
3736
3762
  a.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.subtitle })
@@ -3739,29 +3765,29 @@ Failed to reload test data. Please refresh the page.`);
3739
3765
  /* @__PURE__ */ n(
3740
3766
  "div",
3741
3767
  {
3742
- className: `text-3xl font-bold ${b <= 60 ? "text-danger-500" : "text-primary-500"}`,
3743
- children: R(b)
3768
+ className: `text-3xl font-bold ${m <= 60 ? "text-danger-500" : "text-primary-500"}`,
3769
+ children: C(m)
3744
3770
  }
3745
3771
  ),
3746
3772
  /* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Time Remaining" })
3747
3773
  ] })
3748
3774
  ] }) }),
3749
- /* @__PURE__ */ o(M, { className: "space-y-6", children: [
3775
+ /* @__PURE__ */ o(T, { className: "space-y-6", children: [
3750
3776
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between mb-4", children: [
3751
- /* @__PURE__ */ o(me, { variant: "info", children: [
3777
+ /* @__PURE__ */ o(he, { variant: "info", children: [
3752
3778
  "Question ",
3753
- Object.keys(m).length,
3779
+ Object.keys(g).length,
3754
3780
  " of ",
3755
3781
  a.totalQuestionCount
3756
3782
  ] }),
3757
- /* @__PURE__ */ o(me, { variant: I > 1 ? "success" : "warning", children: [
3758
- I,
3783
+ /* @__PURE__ */ o(he, { variant: _ > 1 ? "success" : "warning", children: [
3784
+ _,
3759
3785
  " attempt",
3760
- I !== 1 ? "s" : "",
3786
+ _ !== 1 ? "s" : "",
3761
3787
  " remaining"
3762
3788
  ] })
3763
3789
  ] }),
3764
- a.appropriatenessQuestions.map((A, k) => /* @__PURE__ */ o(
3790
+ a.appropriatenessQuestions.map((p, w) => /* @__PURE__ */ o(
3765
3791
  "div",
3766
3792
  {
3767
3793
  className: "p-4 border border-gray-200 dark:border-gray-700 rounded-lg",
@@ -3769,51 +3795,51 @@ Failed to reload test data. Please refresh the page.`);
3769
3795
  /* @__PURE__ */ o("div", { className: "mb-4", children: [
3770
3796
  /* @__PURE__ */ o("span", { className: "inline-block px-2 py-1 text-xs font-semibold text-primary-700 bg-primary-100 dark:text-primary-300 dark:bg-primary-900/30 rounded mb-2", children: [
3771
3797
  "Question ",
3772
- k + 1
3798
+ w + 1
3773
3799
  ] }),
3774
- A.groupName && /* @__PURE__ */ n("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: A.groupName }),
3775
- /* @__PURE__ */ n("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children: A.question })
3800
+ p.groupName && /* @__PURE__ */ n("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: p.groupName }),
3801
+ /* @__PURE__ */ n("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children: p.question })
3776
3802
  ] }),
3777
- /* @__PURE__ */ n("div", { className: "space-y-2", children: A.answers.map((S, _) => /* @__PURE__ */ o(
3803
+ /* @__PURE__ */ n("div", { className: "space-y-2", children: p.answers.map((O, z) => /* @__PURE__ */ o(
3778
3804
  "label",
3779
3805
  {
3780
3806
  className: `
3781
3807
  flex items-center p-3 border-2 rounded-lg cursor-pointer transition-all
3782
- ${m[A.id] === S ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
3808
+ ${g[p.id] === O ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
3783
3809
  `,
3784
3810
  children: [
3785
3811
  /* @__PURE__ */ n(
3786
3812
  "input",
3787
3813
  {
3788
3814
  type: "radio",
3789
- name: `question-${A.id}`,
3790
- value: S,
3791
- checked: m[A.id] === S,
3792
- onChange: (oe) => B(A.id, oe.target.value),
3815
+ name: `question-${p.id}`,
3816
+ value: O,
3817
+ checked: g[p.id] === O,
3818
+ onChange: (R) => M(p.id, R.target.value),
3793
3819
  className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500",
3794
3820
  disabled: d
3795
3821
  }
3796
3822
  ),
3797
- /* @__PURE__ */ n("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children: S })
3823
+ /* @__PURE__ */ n("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children: O })
3798
3824
  ]
3799
3825
  },
3800
- _
3826
+ z
3801
3827
  )) })
3802
3828
  ]
3803
3829
  },
3804
- A.id
3830
+ p.id
3805
3831
  )),
3806
- g && !E && /* @__PURE__ */ n("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
3832
+ y && !A && /* @__PURE__ */ n("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
3807
3833
  /* @__PURE__ */ n("strong", { children: "Error:" }),
3808
3834
  " ",
3809
- g
3835
+ y
3810
3836
  ] }) }),
3811
- E && /* @__PURE__ */ n("div", { className: "p-4 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-yellow-700 dark:text-yellow-400 text-sm", children: [
3837
+ A && /* @__PURE__ */ n("div", { className: "p-4 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-yellow-700 dark:text-yellow-400 text-sm", children: [
3812
3838
  /* @__PURE__ */ n("strong", { children: "Time's up!" }),
3813
3839
  " Your answers are being submitted automatically."
3814
3840
  ] }) })
3815
3841
  ] }),
3816
- /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3842
+ /* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
3817
3843
  /* @__PURE__ */ n(
3818
3844
  j,
3819
3845
  {
@@ -3829,51 +3855,51 @@ Failed to reload test data. Please refresh the page.`);
3829
3855
  {
3830
3856
  type: "submit",
3831
3857
  isLoading: d,
3832
- disabled: Object.keys(m).length < a.totalQuestionCount,
3833
- children: E ? "Submitting..." : "Submit Test"
3858
+ disabled: Object.keys(g).length < a.totalQuestionCount,
3859
+ children: A ? "Submitting..." : "Submit Test"
3834
3860
  }
3835
3861
  )
3836
3862
  ] })
3837
- ] }) }) : /* @__PURE__ */ o(T, { children: [
3838
- /* @__PURE__ */ o(J, { children: [
3863
+ ] }) }) : /* @__PURE__ */ o(L, { children: [
3864
+ /* @__PURE__ */ o(ee, { children: [
3839
3865
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: a.displayName }),
3840
3866
  a.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: a.subtitle })
3841
3867
  ] }),
3842
- /* @__PURE__ */ o(M, { children: [
3868
+ /* @__PURE__ */ o(T, { children: [
3843
3869
  a.description && /* @__PURE__ */ n("div", { className: "mb-6 p-4 bg-gray-50 dark:bg-gray-800 rounded-lg", children: /* @__PURE__ */ n("p", { className: "text-gray-700 dark:text-gray-300", children: a.description }) }),
3844
3870
  /* @__PURE__ */ o("div", { className: "space-y-4 mb-6", children: [
3845
3871
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
3846
3872
  /* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Total Questions:" }),
3847
- /* @__PURE__ */ n(me, { variant: "info", children: a.totalQuestionCount })
3873
+ /* @__PURE__ */ n(he, { variant: "info", children: a.totalQuestionCount })
3848
3874
  ] }),
3849
3875
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
3850
3876
  /* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Time Limit:" }),
3851
- /* @__PURE__ */ n(me, { variant: "info", children: R(a.testDurationSec) })
3877
+ /* @__PURE__ */ n(he, { variant: "info", children: C(a.testDurationSec) })
3852
3878
  ] }),
3853
3879
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
3854
3880
  /* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Correct Answers Required:" }),
3855
- /* @__PURE__ */ n(me, { variant: "info", children: a.testCorrectAnswerPassLimit })
3881
+ /* @__PURE__ */ n(he, { variant: "info", children: a.testCorrectAnswerPassLimit })
3856
3882
  ] }),
3857
3883
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
3858
3884
  /* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Attempts Remaining:" }),
3859
- /* @__PURE__ */ n(me, { variant: I > 1 ? "success" : "warning", children: I })
3885
+ /* @__PURE__ */ n(he, { variant: _ > 1 ? "success" : "warning", children: _ })
3860
3886
  ] })
3861
3887
  ] }),
3862
- g && /* @__PURE__ */ n("div", { className: "mb-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
3888
+ y && /* @__PURE__ */ n("div", { className: "mb-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
3863
3889
  /* @__PURE__ */ n("strong", { children: "Previous Attempt:" }),
3864
3890
  " ",
3865
- g
3891
+ y
3866
3892
  ] }) }),
3867
- I <= 0 && /* @__PURE__ */ n("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ n("p", { className: "text-red-600 dark:text-red-400", children: "You have used all your attempts. Please contact support for assistance." }) })
3893
+ _ <= 0 && /* @__PURE__ */ n("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ n("p", { className: "text-red-600 dark:text-red-400", children: "You have used all your attempts. Please contact support for assistance." }) })
3868
3894
  ] }),
3869
- /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3895
+ /* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
3870
3896
  r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3871
3897
  /* @__PURE__ */ n(
3872
3898
  j,
3873
3899
  {
3874
3900
  type: "button",
3875
- onClick: C,
3876
- disabled: I <= 0,
3901
+ onClick: E,
3902
+ disabled: _ <= 0,
3877
3903
  children: "Start Test"
3878
3904
  }
3879
3905
  )
@@ -3884,8 +3910,8 @@ Failed to reload test data. Please refresh the page.`);
3884
3910
  onComplete: e,
3885
3911
  onBack: r
3886
3912
  }) => {
3887
- var S, _, oe, Le;
3888
- const { applicantService: s, baseInformationService: a, config: i } = re(), { identityData: c, provider: l, token: d, isLoading: u, error: g, requestIdentity: p, restartIdentity: m } = er(t), [v, b] = x(null), [y, P] = x(null), [f, E] = x([]), [h, N] = x(!0), [F, L] = x(!1), [R, C] = x(null), [B, z] = x(!1), w = le.useRef(!1), I = Fe({
3913
+ var O, z, R, we;
3914
+ const { applicantService: s, baseInformationService: a, config: i } = se(), { identityData: l, provider: c, token: d, isLoading: u, error: y, requestIdentity: x, restartIdentity: g } = er(t), [b, m] = N(null), [f, k] = N(null), [h, A] = N([]), [v, S] = N(!0), [I, P] = N(!1), [C, E] = N(null), [M, B] = N(!1), Q = ie.useRef(!1), _ = Te({
3889
3915
  defaultValues: {
3890
3916
  street: "",
3891
3917
  streetNumber: "",
@@ -3896,21 +3922,21 @@ Failed to reload test data. Please refresh the page.`);
3896
3922
  phonenumber: ""
3897
3923
  }
3898
3924
  });
3899
- V(() => {
3925
+ Y(() => {
3900
3926
  (async () => {
3901
3927
  try {
3902
- const [D, W] = await Promise.all([
3928
+ const [D, G] = await Promise.all([
3903
3929
  s.getApplicantData(t),
3904
3930
  a.getCountries("", "en")
3905
3931
  ]);
3906
- P(D);
3907
- const H = /* @__PURE__ */ new Set(), ne = W.filter((ue) => {
3908
- const Ce = ue.abbreviation3 || ue.abbreviation;
3909
- return !Ce || H.has(Ce) ? !1 : (H.add(Ce), !0);
3932
+ k(D);
3933
+ const V = /* @__PURE__ */ new Set(), ae = G.filter((me) => {
3934
+ const Ae = me.abbreviation3 || me.abbreviation;
3935
+ return !Ae || V.has(Ae) ? !1 : (V.add(Ae), !0);
3910
3936
  });
3911
- E(ne);
3937
+ A(ae);
3912
3938
  const $ = D.applicantRequestData;
3913
- if (I.reset({
3939
+ if (_.reset({
3914
3940
  street: ($ == null ? void 0 : $.street) || "",
3915
3941
  streetNumber: ($ == null ? void 0 : $.streetNumber) || "",
3916
3942
  city: ($ == null ? void 0 : $.city) || "",
@@ -3918,28 +3944,28 @@ Failed to reload test data. Please refresh the page.`);
3918
3944
  country: ($ == null ? void 0 : $.country) || "",
3919
3945
  nationality: ($ == null ? void 0 : $.nationality) || "",
3920
3946
  phonenumber: ($ == null ? void 0 : $.phonenumber) || ""
3921
- }), D.kycRecords && D.kycRecords.length > 0 && D.kycRecords[0].providerTokenObject !== null && !w.current) {
3922
- console.log("[Identity] Found existing identity verification, auto-requesting..."), w.current = !0;
3947
+ }), D.kycRecords && D.kycRecords.length > 0 && D.kycRecords[0].providerTokenObject !== null && !Q.current) {
3948
+ console.log("[Identity] Found existing identity verification, auto-requesting..."), Q.current = !0;
3923
3949
  try {
3924
- await p(), L(!0);
3925
- } catch (ue) {
3926
- console.error("[Identity] Auto-request failed:", ue);
3950
+ await x(), P(!0);
3951
+ } catch (me) {
3952
+ console.error("[Identity] Auto-request failed:", me);
3927
3953
  }
3928
3954
  }
3929
3955
  } catch (D) {
3930
3956
  console.error("Error loading applicant data:", D);
3931
3957
  } finally {
3932
- N(!1);
3958
+ S(!1);
3933
3959
  }
3934
3960
  })();
3935
- }, [t]), V(() => {
3936
- c && !F && (console.log("[Identity] Identity data already loaded, showing provider"), L(!0));
3937
- }, [c, F]), V(() => {
3961
+ }, [t]), Y(() => {
3962
+ l && !I && (console.log("[Identity] Identity data already loaded, showing provider"), P(!0));
3963
+ }, [l, I]), Y(() => {
3938
3964
  if (d) {
3939
3965
  if (d.expiresAt) {
3940
- const O = new Date(d.expiresAt).getTime();
3941
- if (Date.now() >= O) {
3942
- console.warn("[Identity] Token has expired (expiresAt)"), z(!0), C("Your verification session has expired. Please restart.");
3966
+ const F = new Date(d.expiresAt).getTime();
3967
+ if (Date.now() >= F) {
3968
+ console.warn("[Identity] Token has expired (expiresAt)"), B(!0), E("Your verification session has expired. Please restart.");
3943
3969
  return;
3944
3970
  }
3945
3971
  }
@@ -3947,112 +3973,112 @@ Failed to reload test data. Please refresh the page.`);
3947
3973
  try {
3948
3974
  const D = new URL(d.url).toString().toLowerCase();
3949
3975
  if (D.includes("expired") || D.includes("invalid") || D.includes("error")) {
3950
- console.warn("[Identity] Token URL indicates expiration"), z(!0), C("Your verification link has expired. Please restart.");
3976
+ console.warn("[Identity] Token URL indicates expiration"), B(!0), E("Your verification link has expired. Please restart.");
3951
3977
  return;
3952
3978
  }
3953
3979
  } catch {
3954
3980
  console.error("[Identity] Invalid token URL");
3955
3981
  }
3956
3982
  if (d.status === "expired" || d.error === "expired" || d.expired === !0) {
3957
- console.warn("[Identity] Token object indicates expiration"), z(!0), C("Your verification session has expired. Please restart.");
3983
+ console.warn("[Identity] Token object indicates expiration"), B(!0), E("Your verification session has expired. Please restart.");
3958
3984
  return;
3959
3985
  }
3960
3986
  }
3961
- }, [d]), V(() => {
3962
- if (l !== null && d && !v && F && !B) {
3963
- const O = l;
3987
+ }, [d]), Y(() => {
3988
+ if (c !== null && d && !b && I && !M) {
3989
+ const F = c;
3964
3990
  if (d.url) {
3965
- console.log("[Identity] Loading provider URL for user verification:", d.url), C(null);
3991
+ console.log("[Identity] Loading provider URL for user verification:", d.url), E(null);
3966
3992
  try {
3967
- if (new URL(d.url), O === se.SardinAI) {
3993
+ if (new URL(d.url), F === oe.SardinAI) {
3968
3994
  console.log("[SardinAI] Initializing Risk SDK in background...");
3969
3995
  try {
3970
- const D = ye.parseProviderConfig(l, d, i);
3971
- ye.createProvider(l, D).initialize().then(() => {
3996
+ const D = fe.parseProviderConfig(c, d, i);
3997
+ fe.createProvider(c, D).initialize().then(() => {
3972
3998
  console.log("[SardinAI] Risk SDK initialized successfully in background");
3973
- }).catch((H) => {
3974
- console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):", H);
3999
+ }).catch((V) => {
4000
+ console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):", V);
3975
4001
  });
3976
4002
  } catch (D) {
3977
4003
  console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", D);
3978
4004
  }
3979
4005
  }
3980
- b({ type: "url", url: d.url });
4006
+ m({ type: "url", url: d.url });
3981
4007
  } catch (D) {
3982
- console.error("[Identity] Invalid URL:", D), C("Invalid verification URL. Please restart."), z(!0);
4008
+ console.error("[Identity] Invalid URL:", D), E("Invalid verification URL. Please restart."), B(!0);
3983
4009
  }
3984
4010
  return;
3985
4011
  }
3986
- if (O === se.SardinAI) {
3987
- console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), C(null);
4012
+ if (F === oe.SardinAI) {
4013
+ console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), E(null);
3988
4014
  try {
3989
- const D = ye.parseProviderConfig(l, d, i), W = ye.createProvider(l, D);
3990
- W.initialize().then(() => {
3991
- console.log("[SardinAI] Risk SDK initialized successfully"), b(W), setTimeout(() => {
4015
+ const D = fe.parseProviderConfig(c, d, i), G = fe.createProvider(c, D);
4016
+ G.initialize().then(() => {
4017
+ console.log("[SardinAI] Risk SDK initialized successfully"), m(G), setTimeout(() => {
3992
4018
  e == null || e();
3993
4019
  }, 2e3);
3994
- }).catch((H) => {
4020
+ }).catch((V) => {
3995
4021
  var $;
3996
- console.error("[SardinAI] Failed to initialize:", H);
3997
- const ne = (($ = H.message) == null ? void 0 : $.toLowerCase()) || "";
3998
- ne.includes("expired") || ne.includes("invalid") || ne.includes("401") || ne.includes("400") ? (z(!0), C("Session expired or invalid. Please restart verification.")) : C(`Failed to initialize: ${H.message}`);
4022
+ console.error("[SardinAI] Failed to initialize:", V);
4023
+ const ae = (($ = V.message) == null ? void 0 : $.toLowerCase()) || "";
4024
+ ae.includes("expired") || ae.includes("invalid") || ae.includes("401") || ae.includes("400") ? (B(!0), E("Session expired or invalid. Please restart verification.")) : E(`Failed to initialize: ${V.message}`);
3999
4025
  });
4000
4026
  } catch (D) {
4001
- console.error("[SardinAI] Error creating provider:", D), C(`Configuration error: ${D.message}`);
4027
+ console.error("[SardinAI] Error creating provider:", D), E(`Configuration error: ${D.message}`);
4002
4028
  }
4003
4029
  return;
4004
4030
  }
4005
4031
  try {
4006
- C(null);
4007
- const D = ye.parseProviderConfig(l, d, i), W = ye.createProvider(l, D);
4008
- O === se.Sumsub ? (W.initialize("identity-container").catch((H) => {
4009
- var ne;
4010
- console.error("[Sumsub] Initialization error:", H), C(`Failed to initialize: ${H.message}`), (ne = H.message) != null && ne.toLowerCase().includes("expired") && z(!0);
4011
- }), W.onComplete && W.onComplete(() => {
4032
+ E(null);
4033
+ const D = fe.parseProviderConfig(c, d, i), G = fe.createProvider(c, D);
4034
+ F === oe.Sumsub ? (G.initialize("identity-container").catch((V) => {
4035
+ var ae;
4036
+ console.error("[Sumsub] Initialization error:", V), E(`Failed to initialize: ${V.message}`), (ae = V.message) != null && ae.toLowerCase().includes("expired") && B(!0);
4037
+ }), G.onComplete && G.onComplete(() => {
4012
4038
  e == null || e();
4013
- })) : O === se.Onfido && W.initialize("identity-container").catch((H) => {
4014
- console.error("[Onfido] Initialization error:", H), C(`Failed to initialize: ${H.message}`);
4015
- }), b(W);
4039
+ })) : F === oe.Onfido && G.initialize("identity-container").catch((V) => {
4040
+ console.error("[Onfido] Initialization error:", V), E(`Failed to initialize: ${V.message}`);
4041
+ }), m(G);
4016
4042
  } catch (D) {
4017
- console.error("[Identity] Provider setup error:", D), C(`Setup error: ${D.message}`);
4043
+ console.error("[Identity] Provider setup error:", D), E(`Setup error: ${D.message}`);
4018
4044
  }
4019
4045
  }
4020
4046
  return () => {
4021
- if (v && v.destroy)
4047
+ if (b && b.destroy)
4022
4048
  try {
4023
- v.destroy();
4024
- } catch (O) {
4025
- console.error("[Identity] Error destroying provider:", O);
4049
+ b.destroy();
4050
+ } catch (F) {
4051
+ console.error("[Identity] Error destroying provider:", F);
4026
4052
  }
4027
4053
  };
4028
- }, [l, d, v, F, e, B]);
4029
- const A = async () => {
4054
+ }, [c, d, b, I, e, M]);
4055
+ const p = async () => {
4030
4056
  try {
4031
- C(null), z(!1), await p(), L(!0);
4032
- } catch (O) {
4033
- console.error("Error starting identity verification:", O);
4057
+ E(null), B(!1), await x(), P(!0);
4058
+ } catch (F) {
4059
+ console.error("Error starting identity verification:", F);
4034
4060
  }
4035
- }, k = async () => {
4061
+ }, w = async () => {
4036
4062
  try {
4037
- C(null), z(!1), b(null), console.log("[Identity] Restarting verification..."), await m(), L(!0);
4038
- } catch (O) {
4039
- console.error("Error restarting identity verification:", O), C(O.message || "Failed to restart verification");
4063
+ E(null), B(!1), m(null), console.log("[Identity] Restarting verification..."), await g(), P(!0);
4064
+ } catch (F) {
4065
+ console.error("Error restarting identity verification:", F), E(F.message || "Failed to restart verification");
4040
4066
  }
4041
4067
  };
4042
- if (h || u)
4043
- return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
4044
- /* @__PURE__ */ n(ie, { className: "my-8" }),
4068
+ if (v || u)
4069
+ return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
4070
+ /* @__PURE__ */ n(ce, { className: "my-8" }),
4045
4071
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading identity verification..." })
4046
4072
  ] }) });
4047
- if (g)
4048
- return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
4073
+ if (y)
4074
+ return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
4049
4075
  "Error: ",
4050
- g.message
4076
+ y.message
4051
4077
  ] }) }) });
4052
- if (F && (R || B))
4053
- return /* @__PURE__ */ o(T, { children: [
4054
- /* @__PURE__ */ n(J, { children: /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
4055
- /* @__PURE__ */ o(M, { children: [
4078
+ if (I && (C || M))
4079
+ return /* @__PURE__ */ o(L, { children: [
4080
+ /* @__PURE__ */ n(ee, { children: /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
4081
+ /* @__PURE__ */ o(T, { children: [
4056
4082
  /* @__PURE__ */ n("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg mb-6", children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
4057
4083
  /* @__PURE__ */ n(
4058
4084
  "svg",
@@ -4073,8 +4099,8 @@ Failed to reload test data. Please refresh the page.`);
4073
4099
  }
4074
4100
  ),
4075
4101
  /* @__PURE__ */ o("div", { children: [
4076
- /* @__PURE__ */ n("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children: B ? "Session Expired" : "Verification Error" }),
4077
- /* @__PURE__ */ n("p", { className: "text-red-800 dark:text-red-200 text-sm", children: R || "Your verification session has expired and needs to be restarted." })
4102
+ /* @__PURE__ */ n("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children: M ? "Session Expired" : "Verification Error" }),
4103
+ /* @__PURE__ */ n("p", { className: "text-red-800 dark:text-red-200 text-sm", children: C || "Your verification session has expired and needs to be restarted." })
4078
4104
  ] })
4079
4105
  ] }) }),
4080
4106
  /* @__PURE__ */ o("div", { className: "bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4", children: [
@@ -4086,15 +4112,15 @@ Failed to reload test data. Please refresh the page.`);
4086
4112
  ] })
4087
4113
  ] })
4088
4114
  ] }),
4089
- /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
4115
+ /* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
4090
4116
  r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
4091
- /* @__PURE__ */ n(j, { type: "button", onClick: k, disabled: u, children: u ? "Restarting..." : "Restart Verification" })
4117
+ /* @__PURE__ */ n(j, { type: "button", onClick: w, disabled: u, children: u ? "Restarting..." : "Restart Verification" })
4092
4118
  ] })
4093
4119
  ] });
4094
- if (F && c) {
4095
- const O = l;
4096
- return d != null && d.url ? /* @__PURE__ */ o(T, { children: [
4097
- /* @__PURE__ */ n(J, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
4120
+ if (I && l) {
4121
+ const F = c;
4122
+ return d != null && d.url ? /* @__PURE__ */ o(L, { children: [
4123
+ /* @__PURE__ */ n(ee, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
4098
4124
  /* @__PURE__ */ o("div", { children: [
4099
4125
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
4100
4126
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
@@ -4105,13 +4131,13 @@ Failed to reload test data. Please refresh the page.`);
4105
4131
  type: "button",
4106
4132
  variant: "outline",
4107
4133
  size: "sm",
4108
- onClick: k,
4134
+ onClick: w,
4109
4135
  disabled: u,
4110
4136
  children: "Restart"
4111
4137
  }
4112
4138
  )
4113
4139
  ] }) }),
4114
- /* @__PURE__ */ o(M, { children: [
4140
+ /* @__PURE__ */ o(T, { children: [
4115
4141
  /* @__PURE__ */ n("div", { className: "mb-4 p-3 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-yellow-800 dark:text-yellow-200 text-sm", children: [
4116
4142
  /* @__PURE__ */ n("strong", { children: "Important:" }),
4117
4143
  ' If you see an "expired" or "invalid link" message below, click the "Restart" button above to generate a new verification session.'
@@ -4124,13 +4150,13 @@ Failed to reload test data. Please refresh the page.`);
4124
4150
  allow: "camera; microphone; geolocation",
4125
4151
  title: "Identity Verification",
4126
4152
  onLoad: (D) => {
4127
- var W, H, ne;
4153
+ var G, V, ae;
4128
4154
  console.log("[Identity] Iframe loaded");
4129
4155
  try {
4130
- const $ = D.target, Se = $.contentDocument || ((W = $.contentWindow) == null ? void 0 : W.document);
4131
- if (Se) {
4132
- const ue = ((ne = (H = Se.body) == null ? void 0 : H.textContent) == null ? void 0 : ne.toLowerCase()) || "";
4133
- (ue.includes("expired") || ue.includes("invalid") || ue.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), z(!0), C("Your verification link has expired."));
4156
+ const $ = D.target, Ce = $.contentDocument || ((G = $.contentWindow) == null ? void 0 : G.document);
4157
+ if (Ce) {
4158
+ const me = ((ae = (V = Ce.body) == null ? void 0 : V.textContent) == null ? void 0 : ae.toLowerCase()) || "";
4159
+ (me.includes("expired") || me.includes("invalid") || me.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), B(!0), E("Your verification link has expired."));
4134
4160
  }
4135
4161
  } catch {
4136
4162
  console.log("[Identity] Cannot check iframe content (CORS)");
@@ -4139,66 +4165,66 @@ Failed to reload test data. Please refresh the page.`);
4139
4165
  }
4140
4166
  ) })
4141
4167
  ] }),
4142
- r && /* @__PURE__ */ n(te, { children: /* @__PURE__ */ n(j, { variant: "outline", onClick: r, children: "Back" }) })
4143
- ] }) : O === se.SardinAI ? /* @__PURE__ */ o(T, { children: [
4144
- /* @__PURE__ */ o(J, { children: [
4168
+ r && /* @__PURE__ */ n(ne, { children: /* @__PURE__ */ n(j, { variant: "outline", onClick: r, children: "Back" }) })
4169
+ ] }) : F === oe.SardinAI ? /* @__PURE__ */ o(L, { children: [
4170
+ /* @__PURE__ */ o(ee, { children: [
4145
4171
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Device Risk Assessment" }),
4146
4172
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Analyzing device security and behavioral patterns..." })
4147
4173
  ] }),
4148
- /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("div", { className: "text-center py-12", children: [
4149
- /* @__PURE__ */ n(ie, { className: "mb-4" }),
4174
+ /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("div", { className: "text-center py-12", children: [
4175
+ /* @__PURE__ */ n(ce, { className: "mb-4" }),
4150
4176
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait while we verify your device security" }),
4151
4177
  /* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-500 mt-2", children: "This process is automatic and will complete in a few seconds" })
4152
4178
  ] }) })
4153
- ] }) : /* @__PURE__ */ o(T, { children: [
4154
- /* @__PURE__ */ o(J, { children: [
4179
+ ] }) : /* @__PURE__ */ o(L, { children: [
4180
+ /* @__PURE__ */ o(ee, { children: [
4155
4181
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
4156
4182
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
4157
4183
  ] }),
4158
- /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n("div", { id: "identity-container", className: "min-h-[400px]" }) }),
4159
- r && /* @__PURE__ */ n(te, { children: /* @__PURE__ */ n(j, { variant: "outline", onClick: r, children: "Back" }) })
4184
+ /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n("div", { id: "identity-container", className: "min-h-[400px]" }) }),
4185
+ r && /* @__PURE__ */ n(ne, { children: /* @__PURE__ */ n(j, { variant: "outline", onClick: r, children: "Back" }) })
4160
4186
  ] });
4161
4187
  }
4162
- return /* @__PURE__ */ n("form", { onSubmit: I.handleSubmit(A), children: /* @__PURE__ */ o(T, { children: [
4163
- /* @__PURE__ */ o(J, { children: [
4188
+ return /* @__PURE__ */ n("form", { onSubmit: _.handleSubmit(p), children: /* @__PURE__ */ o(L, { children: [
4189
+ /* @__PURE__ */ o(ee, { children: [
4164
4190
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Review Your Information" }),
4165
4191
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please review and confirm your information before starting identity verification" })
4166
4192
  ] }),
4167
- /* @__PURE__ */ o(M, { className: "space-y-6", children: [
4193
+ /* @__PURE__ */ o(T, { className: "space-y-6", children: [
4168
4194
  /* @__PURE__ */ o("div", { className: "space-y-4 pb-4 border-b border-gray-200 dark:border-gray-700", children: [
4169
4195
  /* @__PURE__ */ o("div", { children: [
4170
4196
  /* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Name" }),
4171
4197
  /* @__PURE__ */ o("p", { className: "mt-1 text-base", children: [
4172
- (S = y == null ? void 0 : y.applicantRequestData) == null ? void 0 : S.firstName,
4198
+ (O = f == null ? void 0 : f.applicantRequestData) == null ? void 0 : O.firstName,
4173
4199
  " ",
4174
- (_ = y == null ? void 0 : y.applicantRequestData) == null ? void 0 : _.lastName
4200
+ (z = f == null ? void 0 : f.applicantRequestData) == null ? void 0 : z.lastName
4175
4201
  ] })
4176
4202
  ] }),
4177
4203
  /* @__PURE__ */ o("div", { children: [
4178
4204
  /* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Email" }),
4179
- /* @__PURE__ */ n("p", { className: "mt-1 text-base", children: (oe = y == null ? void 0 : y.applicantRequestData) == null ? void 0 : oe.email })
4205
+ /* @__PURE__ */ n("p", { className: "mt-1 text-base", children: (R = f == null ? void 0 : f.applicantRequestData) == null ? void 0 : R.email })
4180
4206
  ] }),
4181
4207
  /* @__PURE__ */ o("div", { children: [
4182
4208
  /* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Date of Birth" }),
4183
- /* @__PURE__ */ n("p", { className: "mt-1 text-base", children: ((Le = y == null ? void 0 : y.applicantRequestData) == null ? void 0 : Le.dateOfBirth) || "Not provided" })
4209
+ /* @__PURE__ */ n("p", { className: "mt-1 text-base", children: ((we = f == null ? void 0 : f.applicantRequestData) == null ? void 0 : we.dateOfBirth) || "Not provided" })
4184
4210
  ] })
4185
4211
  ] }),
4186
4212
  /* @__PURE__ */ o("div", { className: "space-y-4", children: [
4187
4213
  /* @__PURE__ */ n("h3", { className: "text-lg font-semibold", children: "Address Information" }),
4188
4214
  /* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
4189
4215
  /* @__PURE__ */ n(
4190
- G,
4216
+ J,
4191
4217
  {
4192
- control: I.control,
4218
+ control: _.control,
4193
4219
  name: "country",
4194
- render: ({ field: O }) => /* @__PURE__ */ n(
4195
- ge,
4220
+ render: ({ field: F }) => /* @__PURE__ */ n(
4221
+ ye,
4196
4222
  {
4197
- ...O,
4223
+ ...F,
4198
4224
  label: "Country",
4199
4225
  options: [
4200
4226
  { value: "", label: "Select country..." },
4201
- ...f.map((D) => ({
4227
+ ...h.map((D) => ({
4202
4228
  value: D.abbreviation3 || D.abbreviation,
4203
4229
  label: D.name
4204
4230
  }))
@@ -4208,18 +4234,18 @@ Failed to reload test data. Please refresh the page.`);
4208
4234
  }
4209
4235
  ),
4210
4236
  /* @__PURE__ */ n(
4211
- G,
4237
+ J,
4212
4238
  {
4213
- control: I.control,
4239
+ control: _.control,
4214
4240
  name: "nationality",
4215
- render: ({ field: O }) => /* @__PURE__ */ n(
4216
- ge,
4241
+ render: ({ field: F }) => /* @__PURE__ */ n(
4242
+ ye,
4217
4243
  {
4218
- ...O,
4244
+ ...F,
4219
4245
  label: "Nationality",
4220
4246
  options: [
4221
4247
  { value: "", label: "Select nationality..." },
4222
- ...f.map((D) => ({
4248
+ ...h.map((D) => ({
4223
4249
  value: D.abbreviation3 || D.abbreviation,
4224
4250
  label: D.name
4225
4251
  }))
@@ -4231,56 +4257,56 @@ Failed to reload test data. Please refresh the page.`);
4231
4257
  ] }),
4232
4258
  /* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
4233
4259
  /* @__PURE__ */ n(
4234
- G,
4260
+ J,
4235
4261
  {
4236
- control: I.control,
4262
+ control: _.control,
4237
4263
  name: "street",
4238
- render: ({ field: O }) => /* @__PURE__ */ n(Z, { ...O, label: "Street" })
4264
+ render: ({ field: F }) => /* @__PURE__ */ n(X, { ...F, label: "Street" })
4239
4265
  }
4240
4266
  ),
4241
4267
  /* @__PURE__ */ n(
4242
- G,
4268
+ J,
4243
4269
  {
4244
- control: I.control,
4270
+ control: _.control,
4245
4271
  name: "streetNumber",
4246
- render: ({ field: O }) => /* @__PURE__ */ n(Z, { ...O, label: "Street Number" })
4272
+ render: ({ field: F }) => /* @__PURE__ */ n(X, { ...F, label: "Street Number" })
4247
4273
  }
4248
4274
  )
4249
4275
  ] }),
4250
4276
  /* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
4251
4277
  /* @__PURE__ */ n(
4252
- G,
4278
+ J,
4253
4279
  {
4254
- control: I.control,
4280
+ control: _.control,
4255
4281
  name: "city",
4256
- render: ({ field: O }) => /* @__PURE__ */ n(Z, { ...O, label: "City" })
4282
+ render: ({ field: F }) => /* @__PURE__ */ n(X, { ...F, label: "City" })
4257
4283
  }
4258
4284
  ),
4259
4285
  /* @__PURE__ */ n(
4260
- G,
4286
+ J,
4261
4287
  {
4262
- control: I.control,
4288
+ control: _.control,
4263
4289
  name: "zip",
4264
- render: ({ field: O }) => /* @__PURE__ */ n(Z, { ...O, label: "ZIP/Postal Code" })
4290
+ render: ({ field: F }) => /* @__PURE__ */ n(X, { ...F, label: "ZIP/Postal Code" })
4265
4291
  }
4266
4292
  )
4267
4293
  ] }),
4268
4294
  /* @__PURE__ */ n(
4269
- G,
4295
+ J,
4270
4296
  {
4271
- control: I.control,
4297
+ control: _.control,
4272
4298
  name: "phonenumber",
4273
- render: ({ field: O }) => /* @__PURE__ */ n(Z, { ...O, label: "Phone Number", type: "tel" })
4299
+ render: ({ field: F }) => /* @__PURE__ */ n(X, { ...F, label: "Phone Number", type: "tel" })
4274
4300
  }
4275
4301
  )
4276
4302
  ] })
4277
4303
  ] }),
4278
- /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
4304
+ /* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
4279
4305
  r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
4280
4306
  /* @__PURE__ */ n(j, { type: "submit", isLoading: u, children: "Confirm and Start Verification" })
4281
4307
  ] })
4282
4308
  ] }) });
4283
- }, $e = ({
4309
+ }, je = ({
4284
4310
  kycStatus: t,
4285
4311
  reviewStatus: e,
4286
4312
  workflowResult: r,
@@ -4288,63 +4314,63 @@ Failed to reload test data. Please refresh the page.`);
4288
4314
  onContinue: a,
4289
4315
  onContactSupport: i
4290
4316
  }) => {
4291
- const l = t === he.Approved ? {
4317
+ const c = t === pe.Approved ? {
4292
4318
  type: "success",
4293
4319
  title: "Verification Approved",
4294
4320
  icon: "✓",
4295
4321
  iconBg: "bg-green-100 dark:bg-green-900/30",
4296
4322
  iconColor: "text-green-600 dark:text-green-400",
4297
4323
  message: "Your identity verification has been successfully approved."
4298
- } : t === he.Rejected ? {
4324
+ } : t === pe.Rejected ? {
4299
4325
  type: "error",
4300
4326
  title: "Verification Rejected",
4301
4327
  icon: "✕",
4302
4328
  iconBg: "bg-red-100 dark:bg-red-900/30",
4303
4329
  iconColor: "text-red-600 dark:text-red-400",
4304
4330
  message: "Unfortunately, your identity verification was not approved."
4305
- } : t === he.Pending || t === he.InProgress ? {
4331
+ } : t === pe.Pending || t === pe.InProgress ? {
4306
4332
  type: "pending",
4307
4333
  title: "Verification Pending",
4308
4334
  icon: "⏱",
4309
4335
  iconBg: "bg-blue-100 dark:bg-blue-900/30",
4310
4336
  iconColor: "text-blue-600 dark:text-blue-400",
4311
4337
  message: "Your identity verification is currently being processed."
4312
- } : e === pe.Approved ? {
4338
+ } : e === ge.Approved ? {
4313
4339
  type: "success",
4314
4340
  title: "Application Approved",
4315
4341
  icon: "✓",
4316
4342
  iconBg: "bg-green-100 dark:bg-green-900/30",
4317
4343
  iconColor: "text-green-600 dark:text-green-400",
4318
4344
  message: "Your application has been approved."
4319
- } : e === pe.Reject ? {
4345
+ } : e === ge.Reject ? {
4320
4346
  type: "error",
4321
4347
  title: "Application Rejected",
4322
4348
  icon: "✕",
4323
4349
  iconBg: "bg-red-100 dark:bg-red-900/30",
4324
4350
  iconColor: "text-red-600 dark:text-red-400",
4325
4351
  message: "Your application has been rejected."
4326
- } : e === pe.UnderReview || e === pe.AdminReview ? {
4352
+ } : e === ge.UnderReview || e === ge.AdminReview ? {
4327
4353
  type: "pending",
4328
4354
  title: "Under Review",
4329
4355
  icon: "📋",
4330
4356
  iconBg: "bg-yellow-100 dark:bg-yellow-900/30",
4331
4357
  iconColor: "text-yellow-700 dark:text-yellow-400",
4332
4358
  message: "Your application is currently under manual review."
4333
- } : r === ke.Success ? {
4359
+ } : r === Ne.Success ? {
4334
4360
  type: "success",
4335
4361
  title: "Process Complete",
4336
4362
  icon: "✓",
4337
4363
  iconBg: "bg-green-100 dark:bg-green-900/30",
4338
4364
  iconColor: "text-green-600 dark:text-green-400",
4339
4365
  message: "Your verification process has been completed successfully."
4340
- } : r === ke.Failed ? {
4366
+ } : r === Ne.Failed ? {
4341
4367
  type: "error",
4342
4368
  title: "Process Failed",
4343
4369
  icon: "✕",
4344
4370
  iconBg: "bg-red-100 dark:bg-red-900/30",
4345
4371
  iconColor: "text-red-600 dark:text-red-400",
4346
4372
  message: "The verification process could not be completed."
4347
- } : r === ke.AdminReview ? {
4373
+ } : r === Ne.AdminReview ? {
4348
4374
  type: "pending",
4349
4375
  title: "Admin Review Required",
4350
4376
  icon: "📋",
@@ -4359,25 +4385,25 @@ Failed to reload test data. Please refresh the page.`);
4359
4385
  iconColor: "text-blue-600 dark:text-blue-400",
4360
4386
  message: "Your application is being reviewed."
4361
4387
  };
4362
- return /* @__PURE__ */ o(T, { children: [
4363
- /* @__PURE__ */ o(M, { className: "py-12", children: [
4388
+ return /* @__PURE__ */ o(L, { children: [
4389
+ /* @__PURE__ */ o(T, { className: "py-12", children: [
4364
4390
  /* @__PURE__ */ n("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ n(
4365
4391
  "div",
4366
4392
  {
4367
- className: `w-24 h-24 rounded-full flex items-center justify-center ${l.iconBg}`,
4368
- children: /* @__PURE__ */ n("span", { className: `text-5xl ${l.iconColor}`, children: l.icon })
4393
+ className: `w-24 h-24 rounded-full flex items-center justify-center ${c.iconBg}`,
4394
+ children: /* @__PURE__ */ n("span", { className: `text-5xl ${c.iconColor}`, children: c.icon })
4369
4395
  }
4370
4396
  ) }),
4371
- /* @__PURE__ */ n("h2", { className: "text-3xl font-bold text-center text-gray-900 dark:text-white mb-4", children: l.title }),
4397
+ /* @__PURE__ */ n("h2", { className: "text-3xl font-bold text-center text-gray-900 dark:text-white mb-4", children: c.title }),
4372
4398
  /* @__PURE__ */ n("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ n(
4373
- me,
4399
+ he,
4374
4400
  {
4375
- variant: l.type === "success" ? "success" : l.type === "error" ? "danger" : l.type === "pending" ? "warning" : "info",
4376
- children: t != null ? he[t] : pe[e]
4401
+ variant: c.type === "success" ? "success" : c.type === "error" ? "danger" : c.type === "pending" ? "warning" : "info",
4402
+ children: t != null ? pe[t] : ge[e]
4377
4403
  }
4378
4404
  ) }),
4379
- /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mb-6 max-w-md mx-auto", children: s || l.message }),
4380
- l.type === "success" && /* @__PURE__ */ o("div", { className: "bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg p-4 mb-6", children: [
4405
+ /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mb-6 max-w-md mx-auto", children: s || c.message }),
4406
+ c.type === "success" && /* @__PURE__ */ o("div", { className: "bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg p-4 mb-6", children: [
4381
4407
  /* @__PURE__ */ n("h3", { className: "font-semibold text-green-900 dark:text-green-100 mb-2", children: "What's Next?" }),
4382
4408
  /* @__PURE__ */ o("ul", { className: "text-sm text-green-800 dark:text-green-200 space-y-1", children: [
4383
4409
  /* @__PURE__ */ n("li", { children: "✓ Your identity has been verified" }),
@@ -4385,7 +4411,7 @@ Failed to reload test data. Please refresh the page.`);
4385
4411
  /* @__PURE__ */ n("li", { children: "✓ All features are now accessible" })
4386
4412
  ] })
4387
4413
  ] }),
4388
- l.type === "error" && /* @__PURE__ */ o("div", { className: "bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4 mb-6", children: [
4414
+ c.type === "error" && /* @__PURE__ */ o("div", { className: "bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4 mb-6", children: [
4389
4415
  /* @__PURE__ */ n("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-2", children: "What Can You Do?" }),
4390
4416
  /* @__PURE__ */ o("ul", { className: "text-sm text-red-800 dark:text-red-200 space-y-2", children: [
4391
4417
  /* @__PURE__ */ n("li", { children: "• Review the requirements and ensure all information is correct" }),
@@ -4393,7 +4419,7 @@ Failed to reload test data. Please refresh the page.`);
4393
4419
  /* @__PURE__ */ n("li", { children: "• You may be able to resubmit your application" })
4394
4420
  ] })
4395
4421
  ] }),
4396
- l.type === "pending" && /* @__PURE__ */ o("div", { className: "bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4 mb-6", children: [
4422
+ c.type === "pending" && /* @__PURE__ */ o("div", { className: "bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4 mb-6", children: [
4397
4423
  /* @__PURE__ */ n("h3", { className: "font-semibold text-blue-900 dark:text-blue-100 mb-2", children: "What Happens Next?" }),
4398
4424
  /* @__PURE__ */ o("ul", { className: "text-sm text-blue-800 dark:text-blue-200 space-y-2", children: [
4399
4425
  /* @__PURE__ */ n("li", { children: "• Our team is reviewing your information" }),
@@ -4405,21 +4431,21 @@ Failed to reload test data. Please refresh the page.`);
4405
4431
  /* @__PURE__ */ n("div", { className: "mt-6 pt-6 border-t border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ o("div", { className: "grid grid-cols-2 gap-4 text-sm", children: [
4406
4432
  /* @__PURE__ */ o("div", { children: [
4407
4433
  /* @__PURE__ */ n("span", { className: "text-gray-500 dark:text-gray-400", children: "KYC Status:" }),
4408
- /* @__PURE__ */ n("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: t != null ? he[t] : "Not Available" })
4434
+ /* @__PURE__ */ n("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: t != null ? pe[t] : "Not Available" })
4409
4435
  ] }),
4410
4436
  /* @__PURE__ */ o("div", { children: [
4411
4437
  /* @__PURE__ */ n("span", { className: "text-gray-500 dark:text-gray-400", children: "Review Status:" }),
4412
- /* @__PURE__ */ n("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: pe[e] })
4438
+ /* @__PURE__ */ n("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: ge[e] })
4413
4439
  ] })
4414
4440
  ] }) })
4415
4441
  ] }),
4416
- /* @__PURE__ */ o(te, { className: "flex justify-center gap-4", children: [
4417
- l.type === "success" && a && /* @__PURE__ */ n(j, { onClick: a, size: "lg", children: "Continue" }),
4418
- l.type === "error" && /* @__PURE__ */ o(nt, { children: [
4442
+ /* @__PURE__ */ o(ne, { className: "flex justify-center gap-4", children: [
4443
+ c.type === "success" && a && /* @__PURE__ */ n(j, { onClick: a, size: "lg", children: "Continue" }),
4444
+ c.type === "error" && /* @__PURE__ */ o(nt, { children: [
4419
4445
  i && /* @__PURE__ */ n(j, { variant: "outline", onClick: i, children: "Contact Support" }),
4420
4446
  a && /* @__PURE__ */ n(j, { onClick: a, children: "Try Again" })
4421
4447
  ] }),
4422
- l.type === "pending" && /* @__PURE__ */ n("div", { className: "text-center", children: /* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Please check back later or wait for our email notification" }) })
4448
+ c.type === "pending" && /* @__PURE__ */ n("div", { className: "text-center", children: /* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Please check back later or wait for our email notification" }) })
4423
4449
  ] })
4424
4450
  ] });
4425
4451
  }, Er = ({ config: t, className: e = "" }) => !(t != null && t.visible) || !(t != null && t.url) ? null : /* @__PURE__ */ n("div", { className: `metakyc-logo ${e}`, children: /* @__PURE__ */ n(
@@ -4442,7 +4468,7 @@ Failed to reload test data. Please refresh the page.`);
4442
4468
  subtitle: e,
4443
4469
  className: r = ""
4444
4470
  }) => {
4445
- const { currentTheme: s } = re(), a = t || (s == null ? void 0 : s.title) || "KYC Verification";
4471
+ const { currentTheme: s } = se(), a = t || (s == null ? void 0 : s.title) || "KYC Verification";
4446
4472
  return /* @__PURE__ */ o("div", { className: `metakyc-header ${r}`, children: [
4447
4473
  (s == null ? void 0 : s.logo) && s.logo.visible && /* @__PURE__ */ n("div", { className: "mb-3", children: /* @__PURE__ */ n(Er, { config: s.logo }) }),
4448
4474
  /* @__PURE__ */ o("div", { children: [
@@ -4456,21 +4482,21 @@ Failed to reload test data. Please refresh the page.`);
4456
4482
  onSuccess: r,
4457
4483
  onCancel: s
4458
4484
  }) => {
4459
- var C, B, z;
4460
- const { config: a, baseInformationService: i } = re(), { createApplicant: c, isLoading: l } = rr(), [d, u] = x([]), [g, p] = x(!0), [m, v] = x(!1), [b, y] = x(null), P = t || ((C = a.applicantForm) == null ? void 0 : C.workflowKey);
4461
- if (!P)
4485
+ var B, Q, _;
4486
+ const { config: a, baseInformationService: i } = se(), { createApplicant: l, isLoading: c } = rr(), [d, u] = N([]), [y, x] = N(!0), [g, b] = N(!1), [m, f] = N(null), k = H(!1), h = H(!1), A = t || ((B = a.applicantForm) == null ? void 0 : B.workflowKey);
4487
+ if (!A)
4462
4488
  throw new Error(
4463
4489
  "workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
4464
4490
  );
4465
- const f = e || ((B = a.applicantForm) == null ? void 0 : B.externalRefId) || "", E = ((z = a.applicantForm) == null ? void 0 : z.visibleFields) || gt, [h, N] = x({
4466
- workflowKey: P,
4491
+ const v = e || ((Q = a.applicantForm) == null ? void 0 : Q.externalRefId) || "", S = ((_ = a.applicantForm) == null ? void 0 : _.visibleFields) || gt, [I, P] = N({
4492
+ workflowKey: A,
4467
4493
  firstName: "",
4468
4494
  lastName: "",
4469
4495
  title: "",
4470
4496
  email: "",
4471
4497
  dateOfBirth: "",
4472
4498
  phonenumber: "",
4473
- externalRefId: f,
4499
+ externalRefId: v,
4474
4500
  // Set from config or prop
4475
4501
  mobileCountryCode: "",
4476
4502
  street: "",
@@ -4489,170 +4515,174 @@ Failed to reload test data. Please refresh the page.`);
4489
4515
  occupation: "",
4490
4516
  taxNumber: ""
4491
4517
  });
4492
- V(() => {
4518
+ Y(() => {
4493
4519
  (async () => {
4520
+ if (k.current || h.current) {
4521
+ console.log("[CreateApplicant] Countries already loading or loaded, skipping...");
4522
+ return;
4523
+ }
4524
+ k.current = !0, x(!0);
4494
4525
  try {
4495
- p(!0);
4496
- const I = await i.getCountries("", a.locale || "en"), A = /* @__PURE__ */ new Set(), k = I.map((S) => ({
4497
- value: S.abbreviation3 || S.abbreviation,
4498
- label: S.name
4499
- })).filter((S) => !S.value || A.has(S.value) ? !1 : (A.add(S.value), !0));
4500
- u(k);
4501
- } catch (I) {
4502
- console.error("Failed to load countries:", I);
4526
+ const w = await i.getCountries("", a.locale || "en"), O = /* @__PURE__ */ new Set(), z = w.map((R) => ({
4527
+ value: R.abbreviation3 || R.abbreviation,
4528
+ label: R.name
4529
+ })).filter((R) => !R.value || O.has(R.value) ? !1 : (O.add(R.value), !0));
4530
+ u(z), h.current = !0;
4531
+ } catch (w) {
4532
+ console.error("Failed to load countries:", w);
4503
4533
  } finally {
4504
- p(!1);
4534
+ x(!1), k.current = !1;
4505
4535
  }
4506
4536
  })();
4507
- }, [i, a.locale]);
4508
- const F = (w, I) => {
4509
- N((A) => ({ ...A, [w]: I }));
4510
- }, L = async (w) => {
4511
- w.preventDefault(), v(!0), y(null);
4537
+ }, []);
4538
+ const C = (p, w) => {
4539
+ P((O) => ({ ...O, [p]: w }));
4540
+ }, E = async (p) => {
4541
+ p.preventDefault(), b(!0), f(null);
4512
4542
  try {
4513
- if (!h.externalRefId || h.externalRefId.trim() === "") {
4514
- y("External Reference ID is required and cannot be empty"), v(!1);
4543
+ if (!I.externalRefId || I.externalRefId.trim() === "") {
4544
+ f("External Reference ID is required and cannot be empty"), b(!1);
4515
4545
  return;
4516
4546
  }
4517
- const I = {
4518
- workflowKey: h.workflowKey,
4519
- externalRefId: h.externalRefId.trim()
4547
+ const w = {
4548
+ workflowKey: I.workflowKey,
4549
+ externalRefId: I.externalRefId.trim()
4520
4550
  // Always include, never empty
4521
4551
  };
4522
- E.forEach((k) => {
4523
- if (k === "externalRefId") return;
4524
- const S = h[k];
4525
- S != null && S !== "" && !(Array.isArray(S) && S.length === 0) && (I[k] = S);
4526
- }), console.log("Creating applicant with data:", I);
4527
- const A = await c(
4528
- I
4552
+ S.forEach((z) => {
4553
+ if (z === "externalRefId") return;
4554
+ const R = I[z];
4555
+ R != null && R !== "" && !(Array.isArray(R) && R.length === 0) && (w[z] = R);
4556
+ }), console.log("Creating applicant with data:", w);
4557
+ const O = await l(
4558
+ w
4529
4559
  );
4530
- console.log("Applicant created:", A), r(A.applicantId);
4531
- } catch (I) {
4532
- console.error("Error creating applicant:", I), y(I.message || "Failed to create applicant");
4560
+ console.log("Applicant created:", O), r(O.applicantId);
4561
+ } catch (w) {
4562
+ console.error("Error creating applicant:", w), f(w.message || "Failed to create applicant");
4533
4563
  } finally {
4534
- v(!1);
4564
+ b(!1);
4535
4565
  }
4536
- }, R = (w) => {
4537
- var A, k;
4538
- const I = yt[w];
4539
- switch (I.type) {
4566
+ }, M = (p) => {
4567
+ var O, z;
4568
+ const w = yt[p];
4569
+ switch (w.type) {
4540
4570
  case "select":
4541
- return w === "country" || w === "nationality" || w === "taxCountry" || w === "countryOfBirth" ? /* @__PURE__ */ n(
4542
- ge,
4571
+ return p === "country" || p === "nationality" || p === "taxCountry" || p === "countryOfBirth" ? /* @__PURE__ */ n(
4572
+ ye,
4543
4573
  {
4544
- label: I.label,
4545
- value: h[w] || "",
4546
- onChange: (S) => F(w, S.target.value),
4574
+ label: w.label,
4575
+ value: I[p] || "",
4576
+ onChange: (R) => C(p, R.target.value),
4547
4577
  options: [
4548
- { value: "", label: `Select ${I.label.toLowerCase()}...` },
4578
+ { value: "", label: `Select ${w.label.toLowerCase()}...` },
4549
4579
  ...d
4550
4580
  ],
4551
- disabled: g
4581
+ disabled: y
4552
4582
  },
4553
- w
4554
- ) : w === "salutation" ? /* @__PURE__ */ n(
4555
- ge,
4583
+ p
4584
+ ) : p === "salutation" ? /* @__PURE__ */ n(
4585
+ ye,
4556
4586
  {
4557
- label: I.label,
4558
- value: ((A = h[w]) == null ? void 0 : A.toString()) || "",
4559
- onChange: (S) => F(w, S.target.value ? Number(S.target.value) : null),
4587
+ label: w.label,
4588
+ value: ((O = I[p]) == null ? void 0 : O.toString()) || "",
4589
+ onChange: (R) => C(p, R.target.value ? Number(R.target.value) : null),
4560
4590
  options: [
4561
4591
  { value: "", label: "Select salutation..." },
4562
- { value: Ne.Male.toString(), label: "Male" },
4563
- { value: Ne.Female.toString(), label: "Female" },
4564
- { value: Ne.Other.toString(), label: "Other" }
4592
+ { value: Se.Male.toString(), label: "Male" },
4593
+ { value: Se.Female.toString(), label: "Female" },
4594
+ { value: Se.Other.toString(), label: "Other" }
4565
4595
  ]
4566
4596
  },
4567
- w
4597
+ p
4568
4598
  ) : null;
4569
4599
  case "multiselect":
4570
- return w === "otherNationality" ? /* @__PURE__ */ n(
4571
- Z,
4600
+ return p === "otherNationality" ? /* @__PURE__ */ n(
4601
+ X,
4572
4602
  {
4573
4603
  type: "text",
4574
- label: I.label,
4575
- value: ((k = h[w]) == null ? void 0 : k.join(", ")) || "",
4576
- onChange: (S) => {
4577
- const _ = S.target.value.split(",").map((oe) => oe.trim()).filter(Boolean);
4578
- F(w, _);
4604
+ label: w.label,
4605
+ value: ((z = I[p]) == null ? void 0 : z.join(", ")) || "",
4606
+ onChange: (R) => {
4607
+ const we = R.target.value.split(",").map((F) => F.trim()).filter(Boolean);
4608
+ C(p, we);
4579
4609
  },
4580
4610
  placeholder: "Enter countries separated by commas"
4581
4611
  },
4582
- w
4612
+ p
4583
4613
  ) : null;
4584
4614
  case "date":
4585
4615
  return /* @__PURE__ */ n(
4586
- Z,
4616
+ X,
4587
4617
  {
4588
4618
  type: "date",
4589
- label: I.label,
4590
- value: h[w] || "",
4591
- onChange: (S) => F(w, S.target.value)
4619
+ label: w.label,
4620
+ value: I[p] || "",
4621
+ onChange: (R) => C(p, R.target.value)
4592
4622
  },
4593
- w
4623
+ p
4594
4624
  );
4595
4625
  case "email":
4596
4626
  return /* @__PURE__ */ n(
4597
- Z,
4627
+ X,
4598
4628
  {
4599
4629
  type: "email",
4600
- label: I.label,
4601
- value: h[w] || "",
4602
- onChange: (S) => F(w, S.target.value),
4603
- required: w === "email"
4630
+ label: w.label,
4631
+ value: I[p] || "",
4632
+ onChange: (R) => C(p, R.target.value),
4633
+ required: p === "email"
4604
4634
  },
4605
- w
4635
+ p
4606
4636
  );
4607
4637
  case "tel":
4608
4638
  return /* @__PURE__ */ n(
4609
- Z,
4639
+ X,
4610
4640
  {
4611
4641
  type: "tel",
4612
- label: I.label,
4613
- value: h[w] || "",
4614
- onChange: (S) => F(w, S.target.value),
4615
- required: w === "phonenumber"
4642
+ label: w.label,
4643
+ value: I[p] || "",
4644
+ onChange: (R) => C(p, R.target.value),
4645
+ required: p === "phonenumber"
4616
4646
  },
4617
- w
4647
+ p
4618
4648
  );
4619
4649
  case "text":
4620
4650
  default:
4621
4651
  return /* @__PURE__ */ n(
4622
- Z,
4652
+ X,
4623
4653
  {
4624
4654
  type: "text",
4625
- label: I.label,
4626
- value: h[w] || "",
4627
- onChange: (S) => F(w, S.target.value),
4628
- required: w === "firstName" || w === "lastName" || w === "externalRefId"
4655
+ label: w.label,
4656
+ value: I[p] || "",
4657
+ onChange: (R) => C(p, R.target.value),
4658
+ required: p === "firstName" || p === "lastName" || p === "externalRefId"
4629
4659
  },
4630
- w
4660
+ p
4631
4661
  );
4632
4662
  }
4633
4663
  };
4634
- return g ? /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
4635
- /* @__PURE__ */ n(ie, { className: "my-8" }),
4664
+ return y ? /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
4665
+ /* @__PURE__ */ n(ce, { className: "my-8" }),
4636
4666
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading form..." })
4637
- ] }) }) }) : /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n("form", { onSubmit: L, children: /* @__PURE__ */ o(T, { children: [
4638
- /* @__PURE__ */ n(J, { children: /* @__PURE__ */ n(
4667
+ ] }) }) }) : /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n("form", { onSubmit: E, children: /* @__PURE__ */ o(L, { children: [
4668
+ /* @__PURE__ */ n(ee, { children: /* @__PURE__ */ n(
4639
4669
  Ze,
4640
4670
  {
4641
4671
  title: "Create Applicant",
4642
4672
  subtitle: "Please fill in the required information to begin the KYC verification process."
4643
4673
  }
4644
4674
  ) }),
4645
- /* @__PURE__ */ o(M, { children: [
4646
- b && /* @__PURE__ */ n("div", { className: "mb-6 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
4675
+ /* @__PURE__ */ o(T, { children: [
4676
+ m && /* @__PURE__ */ n("div", { className: "mb-6 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
4647
4677
  /* @__PURE__ */ n("strong", { children: "Error:" }),
4648
4678
  " ",
4649
- b
4679
+ m
4650
4680
  ] }) }),
4651
- /* @__PURE__ */ n("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: E.map((w) => R(w)) })
4681
+ /* @__PURE__ */ n("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: S.map((p) => M(p)) })
4652
4682
  ] }),
4653
- /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
4654
- s && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: s, disabled: m || l, children: "Cancel" }),
4655
- /* @__PURE__ */ n(j, { type: "submit", isLoading: m || l, children: "Create Applicant" })
4683
+ /* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
4684
+ s && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: s, disabled: g || c, children: "Cancel" }),
4685
+ /* @__PURE__ */ n(j, { type: "submit", isLoading: g || c, children: "Create Applicant" })
4656
4686
  ] })
4657
4687
  ] }) }) });
4658
4688
  }, Wr = ({
@@ -4664,36 +4694,36 @@ Failed to reload test data. Please refresh the page.`);
4664
4694
  }) => {
4665
4695
  const {
4666
4696
  progress: i,
4667
- currentStep: c,
4668
- steps: l,
4697
+ currentStep: l,
4698
+ steps: c,
4669
4699
  workflowKey: d,
4670
4700
  nextWorkflowKey: u,
4671
- hasWorkflowChanged: g,
4672
- isLoading: p,
4673
- error: m,
4674
- moveBack: v,
4675
- refreshProgress: b
4676
- } = Gt(t), [y, P] = le.useState(!1);
4677
- if (le.useEffect(() => {
4678
- m && r && r(m);
4679
- }, [m, r]), le.useEffect(() => {
4701
+ hasWorkflowChanged: y,
4702
+ isLoading: x,
4703
+ error: g,
4704
+ moveBack: b,
4705
+ refreshProgress: m
4706
+ } = Gt(t), [f, k] = ie.useState(!1);
4707
+ if (ie.useEffect(() => {
4708
+ g && r && r(g);
4709
+ }, [g, r]), ie.useEffect(() => {
4680
4710
  i != null && i.workflowResult && e && e(i.workflowResult);
4681
- }, [i == null ? void 0 : i.workflowResult, e]), le.useEffect(() => {
4711
+ }, [i == null ? void 0 : i.workflowResult, e]), ie.useEffect(() => {
4682
4712
  s === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
4683
- }, [s]), le.useEffect(() => {
4684
- g && P(!1);
4685
- }, [g]), p || !i)
4686
- return /* @__PURE__ */ n("div", { className: a, children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
4687
- /* @__PURE__ */ n(ie, { className: "my-8" }),
4713
+ }, [s]), ie.useEffect(() => {
4714
+ y && k(!1);
4715
+ }, [y]), x || !i)
4716
+ return /* @__PURE__ */ n("div", { className: a, children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
4717
+ /* @__PURE__ */ n(ce, { className: "my-8" }),
4688
4718
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading workflow..." })
4689
4719
  ] }) }) });
4690
- if (m)
4691
- return /* @__PURE__ */ n("div", { className: a, children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
4720
+ if (g)
4721
+ return /* @__PURE__ */ n("div", { className: a, children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
4692
4722
  /* @__PURE__ */ n("p", { className: "text-danger-500 text-lg mb-4", children: "An error occurred" }),
4693
- /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: m.message })
4723
+ /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: g.message })
4694
4724
  ] }) }) }) });
4695
- if (g && !y)
4696
- return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
4725
+ if (y && !f)
4726
+ return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
4697
4727
  /* @__PURE__ */ n("div", { className: "mb-6", children: /* @__PURE__ */ n("div", { className: "inline-flex items-center justify-center w-16 h-16 rounded-full bg-blue-100 dark:bg-blue-900 mb-4", children: /* @__PURE__ */ n("svg", { className: "w-8 h-8 text-blue-600 dark:text-blue-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }) }) }),
4698
4728
  /* @__PURE__ */ n("h3", { className: "text-xl font-semibold text-gray-900 dark:text-white mb-2", children: "Workflow Transition" }),
4699
4729
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mb-6", children: "Your application workflow has been updated based on your progress." }),
@@ -4714,15 +4744,15 @@ Failed to reload test data. Please refresh the page.`);
4714
4744
  /* @__PURE__ */ n(
4715
4745
  "button",
4716
4746
  {
4717
- onClick: () => P(!0),
4747
+ onClick: () => k(!0),
4718
4748
  className: "px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-lg transition-colors",
4719
4749
  children: "Continue with New Workflow"
4720
4750
  }
4721
4751
  )
4722
4752
  ] }) }) }) });
4723
- if (i.status === ae.Finished || i.status === ae.OnHold)
4753
+ if (i.status === le.Finished || i.status === le.OnHold)
4724
4754
  return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ n(
4725
- $e,
4755
+ je,
4726
4756
  {
4727
4757
  kycStatus: i.kycStatus,
4728
4758
  reviewStatus: i.reviewStatus,
@@ -4734,81 +4764,81 @@ Failed to reload test data. Please refresh the page.`);
4734
4764
  }
4735
4765
  }
4736
4766
  ) });
4737
- if (!c)
4738
- return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
4739
- /* @__PURE__ */ n(ie, { className: "my-8" }),
4740
- /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: i.status === ae.IdentityPending ? "Loading identity verification..." : "Loading current step..." })
4767
+ if (!l)
4768
+ return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
4769
+ /* @__PURE__ */ n(ce, { className: "my-8" }),
4770
+ /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: i.status === le.IdentityPending ? "Loading identity verification..." : "Loading current step..." })
4741
4771
  ] }) }) });
4742
- const f = () => {
4743
- const h = l.filter((R) => R.visibility !== !1), N = h.findIndex((R) => R.order === c.order), F = N >= 0 ? N + 1 : 1, L = h.length;
4772
+ const h = () => {
4773
+ const v = c.filter((C) => C.visibility !== !1), S = v.findIndex((C) => C.order === l.order), I = S >= 0 ? S + 1 : 1, P = v.length;
4744
4774
  return /* @__PURE__ */ o("div", { className: "mb-6", children: [
4745
4775
  /* @__PURE__ */ o("div", { className: "flex items-start justify-between mb-4", children: [
4746
4776
  /* @__PURE__ */ n(Ze, {}),
4747
- /* @__PURE__ */ o(me, { variant: i.status === 1 ? "info" : "success", children: [
4777
+ /* @__PURE__ */ o(he, { variant: i.status === 1 ? "info" : "success", children: [
4748
4778
  "Step ",
4749
- F,
4779
+ I,
4750
4780
  " of ",
4751
- L
4781
+ P
4752
4782
  ] })
4753
4783
  ] }),
4754
- /* @__PURE__ */ n("div", { className: "flex items-center", children: h.map((R, C) => {
4755
- const B = C < N, z = R.order === c.order;
4756
- return /* @__PURE__ */ o(le.Fragment, { children: [
4784
+ /* @__PURE__ */ n("div", { className: "flex items-center", children: v.map((C, E) => {
4785
+ const M = E < S, B = C.order === l.order;
4786
+ return /* @__PURE__ */ o(ie.Fragment, { children: [
4757
4787
  /* @__PURE__ */ o("div", { className: "flex items-center", children: [
4758
4788
  /* @__PURE__ */ n(
4759
4789
  "div",
4760
4790
  {
4761
4791
  className: `
4762
4792
  w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium
4763
- ${B || z ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
4793
+ ${M || B ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
4764
4794
  `,
4765
- children: C + 1
4795
+ children: E + 1
4766
4796
  }
4767
4797
  ),
4768
4798
  /* @__PURE__ */ n(
4769
4799
  "span",
4770
4800
  {
4771
- className: `ml-2 text-sm ${z ? "font-semibold text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`,
4772
- children: R.displayName
4801
+ className: `ml-2 text-sm ${B ? "font-semibold text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`,
4802
+ children: C.displayName
4773
4803
  }
4774
4804
  )
4775
4805
  ] }),
4776
- C < h.length - 1 && /* @__PURE__ */ n(
4806
+ E < v.length - 1 && /* @__PURE__ */ n(
4777
4807
  "div",
4778
4808
  {
4779
- className: `flex-1 h-0.5 mx-4 ${B ? "bg-primary-500" : "bg-gray-200 dark:bg-gray-700"}`
4809
+ className: `flex-1 h-0.5 mx-4 ${M ? "bg-primary-500" : "bg-gray-200 dark:bg-gray-700"}`
4780
4810
  }
4781
4811
  )
4782
- ] }, R.order);
4812
+ ] }, C.order);
4783
4813
  }) })
4784
4814
  ] });
4785
- }, E = () => {
4786
- const h = {
4815
+ }, A = () => {
4816
+ const v = {
4787
4817
  applicantId: t,
4788
4818
  onComplete: async () => {
4789
- await b();
4819
+ await m();
4790
4820
  },
4791
- onBack: c.order > 0 ? v : void 0
4821
+ onBack: l.order > 0 ? b : void 0
4792
4822
  };
4793
- switch (c.action) {
4823
+ switch (l.action) {
4794
4824
  case U.Questionaries:
4795
- return /* @__PURE__ */ n(vr, { ...h });
4825
+ return /* @__PURE__ */ n(xr, { ...v });
4796
4826
  case U.UploadDocument:
4797
- return /* @__PURE__ */ n(wr, { ...h });
4827
+ return /* @__PURE__ */ n(wr, { ...v });
4798
4828
  case U.Overview:
4799
- return /* @__PURE__ */ n(kr, { ...h });
4829
+ return /* @__PURE__ */ n(kr, { ...v });
4800
4830
  case U.IdentitySdk:
4801
- return /* @__PURE__ */ n(Ar, { ...h });
4831
+ return /* @__PURE__ */ n(Ar, { ...v });
4802
4832
  case U.RiskScoring:
4803
- return /* @__PURE__ */ n(Nr, { ...h });
4833
+ return /* @__PURE__ */ n(Nr, { ...v });
4804
4834
  case U.AdditionalData:
4805
4835
  case U.InvestorCategorization:
4806
- return /* @__PURE__ */ n(Sr, { ...h });
4836
+ return /* @__PURE__ */ n(Sr, { ...v });
4807
4837
  case U.AppropriatenessTest:
4808
- return /* @__PURE__ */ n(Cr, { ...h });
4838
+ return /* @__PURE__ */ n(Cr, { ...v });
4809
4839
  case U.ManualReview:
4810
4840
  return /* @__PURE__ */ n(
4811
- $e,
4841
+ je,
4812
4842
  {
4813
4843
  kycStatus: i.kycStatus,
4814
4844
  reviewStatus: i.reviewStatus,
@@ -4817,108 +4847,108 @@ Failed to reload test data. Please refresh the page.`);
4817
4847
  }
4818
4848
  );
4819
4849
  default:
4820
- return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { className: "py-12 text-center", children: [
4821
- /* @__PURE__ */ n("div", { className: "mb-4", children: /* @__PURE__ */ n(ie, {}) }),
4850
+ return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { className: "py-12 text-center", children: [
4851
+ /* @__PURE__ */ n("div", { className: "mb-4", children: /* @__PURE__ */ n(ce, {}) }),
4822
4852
  /* @__PURE__ */ o("p", { className: "text-gray-600 dark:text-gray-400 mb-2", children: [
4823
4853
  "Processing step: ",
4824
- c.title || c.name
4854
+ l.title || l.name
4825
4855
  ] }),
4826
4856
  /* @__PURE__ */ o("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: [
4827
4857
  "Action type: ",
4828
- U[c.action]
4858
+ U[l.action]
4829
4859
  ] })
4830
4860
  ] }) });
4831
4861
  }
4832
4862
  };
4833
4863
  return /* @__PURE__ */ o("div", { className: `metakyc-sdk ${a || ""}`, children: [
4834
- f(),
4835
- E()
4864
+ h(),
4865
+ A()
4836
4866
  ] });
4837
4867
  };
4838
4868
  export {
4839
4869
  Tr as ALL_APPLICANT_FIELDS,
4840
4870
  st as ApplicantProgressOnHoldReason,
4841
- ae as ApplicantProgressStatus,
4842
- vt as ApplicantService,
4871
+ le as ApplicantProgressStatus,
4872
+ xt as ApplicantService,
4843
4873
  it as ApplicantStatus,
4844
4874
  ut as AppropriatenessQuestionType,
4845
4875
  Nt as AppropriatenessTestService,
4846
4876
  Cr as AppropriatenessTestStep,
4847
- me as Badge,
4877
+ he as Badge,
4848
4878
  Et as BaseInformationService,
4849
4879
  j as Button,
4850
- T as Card,
4851
- M as CardContent,
4852
- te as CardFooter,
4853
- J as CardHeader,
4880
+ L as Card,
4881
+ T as CardContent,
4882
+ ne as CardFooter,
4883
+ ee as CardHeader,
4854
4884
  Yr as CreateApplicantForm,
4855
4885
  ht as CriteriaBuiltInType,
4856
4886
  gt as DEFAULT_VISIBLE_FIELDS,
4857
4887
  dt as DocumentReviewStatus,
4858
4888
  bt as EndpointBuilder,
4859
- be as ErrorHandler,
4889
+ ve as ErrorHandler,
4860
4890
  Bt as EventEmitter,
4861
4891
  yt as FIELD_METADATA,
4862
4892
  ct as FileType,
4863
4893
  nr as FileUpload,
4864
- Ne as GenderType,
4894
+ Se as GenderType,
4865
4895
  Ze as Header,
4866
- xt as HttpClient,
4867
- ye as IdentityProviderManager,
4896
+ vt as HttpClient,
4897
+ fe as IdentityProviderManager,
4868
4898
  At as IdentityService,
4869
- se as IdentityVerificationProvider,
4899
+ oe as IdentityVerificationProvider,
4870
4900
  Ar as IdentityVerificationStep,
4871
- Z as Input,
4901
+ X as Input,
4872
4902
  It as InvestorCategorizationService,
4873
4903
  Sr as InvestorCategorizationStep,
4874
- ee as InvestorCategorizationType,
4904
+ re as InvestorCategorizationType,
4875
4905
  pt as InvestorCategoryType,
4876
4906
  ot as KycProcessStatus,
4877
- he as KycStatus,
4878
- $e as KycStatusDisplay,
4907
+ pe as KycStatus,
4908
+ je as KycStatusDisplay,
4879
4909
  Wr as KycWorkflow,
4880
4910
  Er as Logo,
4881
4911
  Ue as MetaKYCContext,
4882
- ce as MetaKYCError,
4912
+ de as MetaKYCError,
4883
4913
  Or as MetaKYCProvider,
4884
4914
  _t as OnfidoProvider,
4885
4915
  St as OverviewService,
4886
4916
  kr as OverviewStep,
4887
4917
  sr as PhoneInput,
4888
4918
  wt as QuestionnaireService,
4889
- vr as QuestionnaireStep,
4890
- pe as ReviewStatus,
4919
+ xr as QuestionnaireStep,
4920
+ ge as ReviewStatus,
4891
4921
  mt as RiskCriteriaType,
4892
4922
  at as RiskLevel,
4893
4923
  Ct as RiskScoringService,
4894
4924
  Nr as RiskScoringStep,
4895
4925
  Kt as SardinAIProvider,
4896
- ge as Select,
4897
- ie as Spinner,
4926
+ ye as Select,
4927
+ ce as Spinner,
4898
4928
  zt as StepRouter,
4899
4929
  jt as SumsubProvider,
4900
4930
  Ut as ThemeManager,
4901
- Y as ThemePreset,
4931
+ W as ThemePreset,
4902
4932
  Mt as ThemeService,
4903
4933
  kt as UploadDocumentService,
4904
4934
  wr as UploadDocumentStep,
4905
4935
  lt as UserType,
4906
- Re as ValueDataType,
4936
+ Pe as ValueDataType,
4907
4937
  $t as WorkflowOrchestrator,
4908
- ke as WorkflowResultType,
4938
+ Ne as WorkflowResultType,
4909
4939
  Ot as WorkflowState,
4910
4940
  U as WorkflowStepAction,
4911
4941
  Vr as appropriatenessTestSchema,
4912
4942
  Kr as clearAllStorage,
4913
4943
  Yt as clearApplicantId,
4914
4944
  Qt as clearWorkflowState,
4915
- X as cn,
4945
+ te as cn,
4916
4946
  Rt as corporateTheme,
4917
4947
  ft as defaultConfig,
4918
- Q as defaultTheme,
4948
+ Z as defaultTheme,
4919
4949
  qt as fileToBase64,
4920
4950
  Dt as fintechTheme,
4921
- Ee as formatFileSize,
4951
+ Ie as formatFileSize,
4922
4952
  Hr as generateAppropriatenessSchema,
4923
4953
  yr as generateQuestionnaireSchema,
4924
4954
  br as generateRiskScoringSchema,
@@ -4940,7 +4970,7 @@ export {
4940
4970
  Ur as useAppropriatenessTest,
4941
4971
  er as useIdentityVerification,
4942
4972
  Gt as useKycWorkflow,
4943
- re as useMetaKYC,
4973
+ se as useMetaKYC,
4944
4974
  Xt as useOverview,
4945
4975
  Zt as useQuestionnaire,
4946
4976
  tr as useRiskScoring,