@vpdev2/metakyc-sdk 1.0.3 → 1.0.5

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
@@ -1,14 +1,14 @@
1
- var Qe = Object.defineProperty;
2
- var Ge = (t, e, r) => e in t ? Qe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
- var U = (t, e, r) => Ge(t, typeof e != "symbol" ? e + "" : e, r);
4
- import Ze from "axios";
5
- import * as Pe from "react";
6
- import ce, { createContext as Je, useMemo as Oe, useEffect as V, useContext as Xe, useState as v, useRef as ze, useCallback as q, forwardRef as Re } from "react";
7
- import { jsx as n, jsxs as o, Fragment as et } from "react/jsx-runtime";
8
- import { get as Ae, set as Se, appendErrors as $e, useForm as De, Controller as Q } from "react-hook-form";
1
+ var Je = Object.defineProperty;
2
+ var Xe = (t, e, r) => e in t ? Je(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
+ var K = (t, e, r) => Xe(t, typeof e != "symbol" ? e + "" : e, r);
4
+ import et from "axios";
5
+ import * as Le from "react";
6
+ import le, { createContext as tt, useMemo as $e, useEffect as V, useContext as rt, useState as x, useRef as je, useCallback as q, forwardRef as De } from "react";
7
+ import { jsx as n, jsxs as o, Fragment as nt } from "react/jsx-runtime";
8
+ import { get as Ee, set as Ce, appendErrors as _e, useForm as Pe, Controller as G } from "react-hook-form";
9
9
  import { z as de } from "zod";
10
- var K = /* @__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))(K || {}), 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 || {}), tt = /* @__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))(tt || {}), rt = /* @__PURE__ */ ((t) => (t[t.LowRisk = 0] = "LowRisk", t[t.MediumRisk = 1] = "MediumRisk", t[t.HighRisk = 2] = "HighRisk", t[t.Alert = 3] = "Alert", t))(rt || {}), 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 || {}), nt = /* @__PURE__ */ ((t) => (t[t.ProviderResultPending = 0] = "ProviderResultPending", t[t.ProviderResultReceived = 1] = "ProviderResultReceived", t[t.Canceled = 2] = "Canceled", t[t.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", t))(nt || {}), at = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.ProviderResultPending = 1] = "ProviderResultPending", t[t.ProviderResultReceived = 2] = "ProviderResultReceived", t[t.Canceled = 3] = "Canceled", t))(at || {}), ne = /* @__PURE__ */ ((t) => (t[t.Onfido = 0] = "Onfido", t[t.Sumsub = 2] = "Sumsub", t[t.SardinAI = 3] = "SardinAI", t))(ne || {}), st = /* @__PURE__ */ ((t) => (t[t.Individual = 0] = "Individual", t[t.Company = 1] = "Company", t))(st || {}), Ne = /* @__PURE__ */ ((t) => (t[t.Male = 0] = "Male", t[t.Female = 1] = "Female", t[t.Other = 2] = "Other", t))(Ne || {}), it = /* @__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))(it || {}), ot = /* @__PURE__ */ ((t) => (t[t.Pending = 0] = "Pending", t[t.Approved = 1] = "Approved", t[t.Rejected = 2] = "Rejected", t[t.RequiresRevision = 3] = "RequiresRevision", t))(ot || {}), lt = /* @__PURE__ */ ((t) => (t[t.SingleChoice = 0] = "SingleChoice", t[t.MultipleChoice = 1] = "MultipleChoice", t[t.Text = 2] = "Text", t))(lt || {}), Ee = /* @__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))(Ee || {}), ct = /* @__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))(ct || {}), dt = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.Country = 1] = "Country", t))(dt || {}), X = /* @__PURE__ */ ((t) => (t[t.Individual = 0] = "Individual", t[t.Sophisticated = 1] = "Sophisticated", t[t.HighNetWorth = 2] = "HighNetWorth", t[t.Business = 3] = "Business", t))(X || {}), ut = /* @__PURE__ */ ((t) => (t[t.Retail = 0] = "Retail", t[t.Professional = 1] = "Professional", t[t.EligibleCounterparty = 2] = "EligibleCounterparty", t))(ut || {});
11
- const mt = [
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 || {}), we = /* @__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))(we || {}), 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 || {}), ke = /* @__PURE__ */ ((t) => (t[t.Male = 0] = "Male", t[t.Female = 1] = "Female", t[t.Other = 2] = "Other", t))(ke || {}), 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 || {}), Ie = /* @__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))(Ie || {}), 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 || {});
11
+ const gt = [
12
12
  "firstName",
13
13
  "lastName",
14
14
  "email",
@@ -22,7 +22,7 @@ const mt = [
22
22
  "nationality",
23
23
  "taxCountry",
24
24
  "taxNumber"
25
- ], Dr = [
25
+ ], Tr = [
26
26
  "firstName",
27
27
  "lastName",
28
28
  "title",
@@ -46,7 +46,7 @@ const mt = [
46
46
  "occupation",
47
47
  "taxNumber",
48
48
  "externalRefId"
49
- ], ht = {
49
+ ], yt = {
50
50
  firstName: { label: "First Name", type: "text" },
51
51
  lastName: { label: "Last Name", type: "text" },
52
52
  title: { label: "Title", type: "text" },
@@ -72,7 +72,7 @@ const mt = [
72
72
  externalRefId: { label: "External Reference ID", type: "text" }
73
73
  };
74
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 || {});
75
- const pt = {
75
+ const ft = {
76
76
  timeout: 3e4,
77
77
  retries: 3,
78
78
  locale: "en",
@@ -80,7 +80,7 @@ const pt = {
80
80
  pattern: "host-controller"
81
81
  }
82
82
  };
83
- class gt {
83
+ class bt {
84
84
  constructor(e) {
85
85
  this.config = e;
86
86
  }
@@ -91,9 +91,9 @@ class gt {
91
91
  * @returns The full endpoint path
92
92
  */
93
93
  build(e, r) {
94
- const a = `${e}.${r}`;
95
- if (this.config.customPaths && this.config.customPaths[a])
96
- return this.config.customPaths[a];
94
+ const s = `${e}.${r}`;
95
+ if (this.config.customPaths && this.config.customPaths[s])
96
+ return this.config.customPaths[s];
97
97
  switch (this.config.pattern) {
98
98
  case "host-controller":
99
99
  return `/api/${e}/${r}`;
@@ -101,7 +101,7 @@ class gt {
101
101
  return `/services/app/${this.getServiceName(e)}/${r}`;
102
102
  case "custom":
103
103
  throw new Error(
104
- `Custom endpoint path not found for ${a}. Please provide it in customPaths.`
104
+ `Custom endpoint path not found for ${s}. Please provide it in customPaths.`
105
105
  );
106
106
  default:
107
107
  throw new Error(`Unknown endpoint pattern: ${this.config.pattern}`);
@@ -120,19 +120,19 @@ class gt {
120
120
  }[e] || e;
121
121
  }
122
122
  }
123
- class le extends Error {
124
- constructor(r, a, s, i, c) {
123
+ class ce extends Error {
124
+ constructor(r, s, a, i, c) {
125
125
  super(r);
126
- U(this, "response");
127
- this.code = a, this.details = s, this.validationErrors = i, this.name = "MetaKYCError", this.response = c, Object.setPrototypeOf(this, le.prototype);
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);
128
128
  }
129
129
  }
130
- class xe {
130
+ class be {
131
131
  /**
132
132
  * Process an error from the API response
133
133
  */
134
134
  static handleApiError(e) {
135
- return new le(
135
+ return new ce(
136
136
  e.message || "An unknown error occurred",
137
137
  e.code,
138
138
  e.details || void 0,
@@ -145,44 +145,44 @@ class xe {
145
145
  static handleAxiosError(e) {
146
146
  if (e.response) {
147
147
  const r = e.response.data;
148
- return r && r.error ? new le(
148
+ return r && r.error ? new ce(
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 le(
154
+ ) : r && r.result && r.result.message ? new ce(
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 le(
160
+ ) : new ce(
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 le(
167
+ } else return e.request ? new ce(
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 le(e.message || "An unexpected error occurred", 0, e.toString());
171
+ ) : new ce(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 le;
177
+ return e instanceof ce;
178
178
  }
179
179
  }
180
- class yt {
180
+ class xt {
181
181
  constructor(e) {
182
- U(this, "axiosInstance");
183
- U(this, "endpointBuilder");
184
- U(this, "config");
185
- this.config = { ...pt, ...e }, this.endpointBuilder = new gt(this.config.endpoints), this.axiosInstance = Ze.create({
182
+ K(this, "axiosInstance");
183
+ K(this, "endpointBuilder");
184
+ K(this, "config");
185
+ this.config = { ...ft, ...e }, this.endpointBuilder = new bt(this.config.endpoints), this.axiosInstance = et.create({
186
186
  baseURL: this.config.baseUrl,
187
187
  timeout: this.config.timeout,
188
188
  headers: {
@@ -194,11 +194,11 @@ class yt {
194
194
  ), this.axiosInstance.interceptors.response.use(
195
195
  (r) => r,
196
196
  async (r) => {
197
- var s;
198
- const a = r.config;
199
- return ((s = r.response) == null ? void 0 : s.status) >= 500 && !a._retry && (a._retry = !0, a._retryCount = (a._retryCount || 0) + 1, a._retryCount < (this.config.retries || 3)) ? (await new Promise(
200
- (i) => setTimeout(i, 1e3 * a._retryCount)
201
- ), this.axiosInstance(a)) : Promise.reject(r);
197
+ var a;
198
+ const s = r.config;
199
+ return ((a = r.response) == null ? void 0 : a.status) >= 500 && !s._retry && (s._retry = !0, s._retryCount = (s._retryCount || 0) + 1, s._retryCount < (this.config.retries || 3)) ? (await new Promise(
200
+ (i) => setTimeout(i, 1e3 * s._retryCount)
201
+ ), this.axiosInstance(s)) : Promise.reject(r);
202
202
  }
203
203
  );
204
204
  }
@@ -211,49 +211,49 @@ class yt {
211
211
  /**
212
212
  * Make a GET request
213
213
  */
214
- async get(e, r, a) {
214
+ async get(e, r, s) {
215
215
  try {
216
- const s = this.buildEndpoint(e, r), i = await this.axiosInstance.get(s, {
217
- params: a
216
+ const a = this.buildEndpoint(e, r), i = await this.axiosInstance.get(a, {
217
+ params: s
218
218
  });
219
219
  return this.handleResponse(i);
220
- } catch (s) {
221
- throw xe.handleAxiosError(s);
220
+ } catch (a) {
221
+ throw be.handleAxiosError(a);
222
222
  }
223
223
  }
224
224
  /**
225
225
  * Make a POST request
226
226
  */
227
- async post(e, r, a) {
227
+ async post(e, r, s) {
228
228
  try {
229
- const s = this.buildEndpoint(e, r), i = await this.axiosInstance.post(s, a);
229
+ const a = this.buildEndpoint(e, r), i = await this.axiosInstance.post(a, s);
230
230
  return this.handleResponse(i);
231
- } catch (s) {
232
- throw xe.handleAxiosError(s);
231
+ } catch (a) {
232
+ throw be.handleAxiosError(a);
233
233
  }
234
234
  }
235
235
  /**
236
236
  * Make a PUT request
237
237
  */
238
- async put(e, r, a) {
238
+ async put(e, r, s) {
239
239
  try {
240
- const s = this.buildEndpoint(e, r), i = await this.axiosInstance.put(s, a);
240
+ const a = this.buildEndpoint(e, r), i = await this.axiosInstance.put(a, s);
241
241
  return this.handleResponse(i);
242
- } catch (s) {
243
- throw xe.handleAxiosError(s);
242
+ } catch (a) {
243
+ throw be.handleAxiosError(a);
244
244
  }
245
245
  }
246
246
  /**
247
247
  * Make a DELETE request
248
248
  */
249
- async delete(e, r, a) {
249
+ async delete(e, r, s) {
250
250
  try {
251
- const s = this.buildEndpoint(e, r), i = await this.axiosInstance.delete(s, {
252
- params: a
251
+ const a = this.buildEndpoint(e, r), i = await this.axiosInstance.delete(a, {
252
+ params: s
253
253
  });
254
254
  return this.handleResponse(i);
255
- } catch (s) {
256
- throw xe.handleAxiosError(s);
255
+ } catch (a) {
256
+ throw be.handleAxiosError(a);
257
257
  }
258
258
  }
259
259
  /**
@@ -262,7 +262,7 @@ class yt {
262
262
  handleResponse(e) {
263
263
  const r = e.data;
264
264
  if (!r.success && r.error)
265
- throw xe.handleApiError(r.error);
265
+ throw be.handleApiError(r.error);
266
266
  return r;
267
267
  }
268
268
  /**
@@ -272,7 +272,7 @@ class yt {
272
272
  return this.axiosInstance;
273
273
  }
274
274
  }
275
- class ft {
275
+ class vt {
276
276
  constructor(e) {
277
277
  this.httpClient = e;
278
278
  }
@@ -391,7 +391,7 @@ class ft {
391
391
  )).result;
392
392
  }
393
393
  }
394
- class bt {
394
+ class wt {
395
395
  constructor(e) {
396
396
  this.httpClient = e;
397
397
  }
@@ -418,7 +418,7 @@ class bt {
418
418
  )).result;
419
419
  }
420
420
  }
421
- class xt {
421
+ class kt {
422
422
  constructor(e) {
423
423
  this.httpClient = e;
424
424
  }
@@ -446,7 +446,7 @@ class xt {
446
446
  await this.httpClient.post("UploadDocument", "ReviewUploadDocument", e);
447
447
  }
448
448
  }
449
- class vt {
449
+ class Nt {
450
450
  constructor(e) {
451
451
  this.httpClient = e;
452
452
  }
@@ -472,7 +472,7 @@ class vt {
472
472
  )).result;
473
473
  }
474
474
  }
475
- class wt {
475
+ class St {
476
476
  constructor(e) {
477
477
  this.httpClient = e;
478
478
  }
@@ -494,7 +494,7 @@ class wt {
494
494
  await this.httpClient.get("Applicant", "PassOverview", { applicantId: e });
495
495
  }
496
496
  }
497
- class kt {
497
+ class Ct {
498
498
  constructor(e) {
499
499
  this.httpClient = e;
500
500
  }
@@ -529,7 +529,7 @@ class kt {
529
529
  )).result;
530
530
  }
531
531
  }
532
- class Nt {
532
+ class At {
533
533
  constructor(e) {
534
534
  this.httpClient = e;
535
535
  }
@@ -584,7 +584,7 @@ class Nt {
584
584
  return this.identityCompanyRequest(r);
585
585
  }
586
586
  }
587
- class St {
587
+ class Et {
588
588
  constructor(e) {
589
589
  this.httpClient = e;
590
590
  }
@@ -594,11 +594,11 @@ class St {
594
594
  * @param lng - Language code (e.g., 'en', 'de')
595
595
  * @param type - Optional country type filter
596
596
  */
597
- async getCountries(e, r, a) {
597
+ async getCountries(e, r, s) {
598
598
  return (await this.httpClient.get(
599
599
  "BaseInformation",
600
600
  "GetAllCountries",
601
- { filter: e || "", lng: r || "en", type: a }
601
+ { filter: e || "", lng: r || "en", type: s }
602
602
  )).result;
603
603
  }
604
604
  /**
@@ -620,7 +620,7 @@ class St {
620
620
  )).result;
621
621
  }
622
622
  }
623
- class Ct {
623
+ class It {
624
624
  constructor(e) {
625
625
  this.httpClient = e;
626
626
  }
@@ -646,8 +646,9 @@ class Ct {
646
646
  )).result;
647
647
  }
648
648
  }
649
- const ee = {
649
+ const Q = {
650
650
  name: "Default",
651
+ title: "KYC Verification",
651
652
  logo: {
652
653
  url: "",
653
654
  height: "40px",
@@ -704,7 +705,7 @@ const ee = {
704
705
  textMuted: "#9ca3af"
705
706
  }
706
707
  }
707
- }, At = {
708
+ }, Rt = {
708
709
  name: "Corporate",
709
710
  logo: {
710
711
  url: "",
@@ -737,7 +738,7 @@ const ee = {
737
738
  cardPadding: "1.5rem",
738
739
  inputHeight: "2.5rem"
739
740
  }
740
- }, Et = {
741
+ }, Dt = {
741
742
  name: "Fintech",
742
743
  logo: {
743
744
  url: "",
@@ -770,7 +771,7 @@ const ee = {
770
771
  cardPadding: "2rem",
771
772
  inputHeight: "3rem"
772
773
  }
773
- }, It = {
774
+ }, Pt = {
774
775
  name: "Healthcare",
775
776
  logo: {
776
777
  url: "",
@@ -812,7 +813,7 @@ const ee = {
812
813
  textSecondary: "#CBD5E1"
813
814
  }
814
815
  }
815
- }, Rt = {
816
+ }, Ft = {
816
817
  name: "Modern",
817
818
  logo: {
818
819
  url: "",
@@ -845,7 +846,7 @@ const ee = {
845
846
  cardPadding: "2rem",
846
847
  inputHeight: "3rem"
847
848
  }
848
- }, Dt = {
849
+ }, Lt = {
849
850
  name: "Minimal",
850
851
  logo: {
851
852
  url: "",
@@ -878,18 +879,18 @@ const ee = {
878
879
  cardPadding: "1.25rem",
879
880
  inputHeight: "2.25rem"
880
881
  }
881
- }, Pt = {
882
- [Y.Default]: ee,
883
- [Y.Corporate]: At,
884
- [Y.Fintech]: Et,
885
- [Y.Healthcare]: It,
886
- [Y.Modern]: Rt,
887
- [Y.Minimal]: Dt
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
888
889
  };
889
- function ve(t) {
890
- return Pt[t] || ee;
890
+ function xe(t) {
891
+ return Tt[t] || Q;
891
892
  }
892
- class Ft {
893
+ class Mt {
893
894
  constructor(e) {
894
895
  this.httpClient = e;
895
896
  }
@@ -904,16 +905,16 @@ class Ft {
904
905
  "GetThemeConfiguration"
905
906
  );
906
907
  if (!r.result.isEnabled)
907
- return ve(Y.Default);
908
- let a = r.result.preset ? ve(r.result.preset) : ve(Y.Default);
909
- return r.result.logo && (a.logo = { ...a.logo, ...r.result.logo }), r.result.colors && (a.colors = { ...a.colors, ...r.result.colors }), r.result.typography && (a.typography = { ...a.typography, ...r.result.typography }), r.result.spacing && (a.spacing = { ...a.spacing, ...r.result.spacing }), r.result.customCSS && (a.customCSS = r.result.customCSS), r.result.darkMode && (a.darkMode = {
908
+ return xe(Y.Default);
909
+ let s = r.result.preset ? xe(r.result.preset) : xe(Y.Default);
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 = {
910
911
  colors: {
911
- ...(e = a.darkMode) == null ? void 0 : e.colors,
912
+ ...(e = s.darkMode) == null ? void 0 : e.colors,
912
913
  ...r.result.darkMode.colors
913
914
  }
914
- }), a;
915
+ }), s;
915
916
  } catch (r) {
916
- return console.warn("[ThemeService] Failed to fetch theme configuration:", r), ve(Y.Default);
917
+ return console.warn("[ThemeService] Failed to fetch theme configuration:", r), xe(Y.Default);
917
918
  }
918
919
  }
919
920
  /**
@@ -939,20 +940,20 @@ class Ft {
939
940
  * Preview theme (doesn't save)
940
941
  */
941
942
  getPreviewTheme(e, r) {
942
- const a = ve(e);
943
+ const s = xe(e);
943
944
  return r ? {
944
- ...a,
945
+ ...s,
945
946
  ...r,
946
- logo: { ...a.logo, ...r.logo },
947
- colors: { ...a.colors, ...r.colors },
948
- typography: r.typography ? { ...a.typography, ...r.typography } : a.typography,
949
- spacing: r.spacing ? { ...a.spacing, ...r.spacing } : a.spacing
950
- } : a;
947
+ logo: { ...s.logo, ...r.logo },
948
+ colors: { ...s.colors, ...r.colors },
949
+ typography: r.typography ? { ...s.typography, ...r.typography } : s.typography,
950
+ spacing: r.spacing ? { ...s.spacing, ...r.spacing } : s.spacing
951
+ } : s;
951
952
  }
952
953
  }
953
- class Lt {
954
+ class Bt {
954
955
  constructor() {
955
- U(this, "listeners", /* @__PURE__ */ new Map());
956
+ K(this, "listeners", /* @__PURE__ */ new Map());
956
957
  }
957
958
  /**
958
959
  * Subscribe to an event
@@ -966,17 +967,17 @@ class Lt {
966
967
  * Unsubscribe from an event
967
968
  */
968
969
  off(e, r) {
969
- const a = this.listeners.get(e);
970
- a && a.delete(r);
970
+ const s = this.listeners.get(e);
971
+ s && s.delete(r);
971
972
  }
972
973
  /**
973
974
  * Emit an event
974
975
  */
975
976
  emit(e, r) {
976
- const a = this.listeners.get(e);
977
- a && a.forEach((s) => {
977
+ const s = this.listeners.get(e);
978
+ s && s.forEach((a) => {
978
979
  try {
979
- s(r);
980
+ a(r);
980
981
  } catch (i) {
981
982
  console.error(`Error in event listener for "${e}":`, i);
982
983
  }
@@ -995,12 +996,12 @@ class Lt {
995
996
  this.listeners.delete(e);
996
997
  }
997
998
  }
998
- class Tt {
999
+ class Ot {
999
1000
  constructor() {
1000
- U(this, "events", new Lt());
1001
- U(this, "_applicantId", null);
1002
- U(this, "_progress", null);
1003
- U(this, "_error", null);
1001
+ K(this, "events", new Bt());
1002
+ K(this, "_applicantId", null);
1003
+ K(this, "_progress", null);
1004
+ K(this, "_error", null);
1004
1005
  }
1005
1006
  /**
1006
1007
  * Get current applicant ID
@@ -1076,9 +1077,9 @@ class Tt {
1076
1077
  * Update progress
1077
1078
  */
1078
1079
  updateProgress(e) {
1079
- var a, s;
1080
- const r = (a = this._progress) == null ? void 0 : a.currentStep;
1081
- this._progress = e, this._applicantId = e.applicantId, this._error = null, this.events.emit("progressUpdated", e), (r == null ? void 0 : r.order) !== ((s = e.currentStep) == null ? void 0 : s.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);
1080
+ var s, a;
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
1083
  }
1083
1084
  /**
1084
1085
  * Set error
@@ -1135,9 +1136,9 @@ class Tt {
1135
1136
  this.events.clear();
1136
1137
  }
1137
1138
  }
1138
- class Mt {
1139
+ class zt {
1139
1140
  constructor() {
1140
- U(this, "handlers", /* @__PURE__ */ new Map());
1141
+ K(this, "handlers", /* @__PURE__ */ new Map());
1141
1142
  }
1142
1143
  /**
1143
1144
  * Register a step handler
@@ -1161,72 +1162,72 @@ class Mt {
1161
1162
  * Load data for a step
1162
1163
  */
1163
1164
  async loadStepData(e, r) {
1164
- const a = this.getHandler(e);
1165
- if (!a)
1166
- throw new Error(`No handler registered for step action: ${K[e]}`);
1167
- return a.loadData(r);
1165
+ const s = this.getHandler(e);
1166
+ if (!s)
1167
+ throw new Error(`No handler registered for step action: ${U[e]}`);
1168
+ return s.loadData(r);
1168
1169
  }
1169
1170
  /**
1170
1171
  * Submit data for a step
1171
1172
  */
1172
1173
  async submitStepData(e, r) {
1173
- const a = this.getHandler(e);
1174
- if (!a)
1175
- throw new Error(`No handler registered for step action: ${K[e]}`);
1176
- return a.submitData(r);
1174
+ const s = this.getHandler(e);
1175
+ if (!s)
1176
+ throw new Error(`No handler registered for step action: ${U[e]}`);
1177
+ return s.submitData(r);
1177
1178
  }
1178
1179
  }
1179
- class Bt {
1180
- constructor(e, r, a, s, i, c, l, d) {
1181
- U(this, "state");
1182
- U(this, "stepRouter");
1183
- this.applicantService = e, this.questionnaireService = r, this.uploadDocumentService = a, this.appropriatenessTestService = s, this.overviewService = i, this.riskScoringService = c, this.investorCategorizationService = d, this.state = new Tt(), this.stepRouter = new Mt(), this.registerStepHandlers();
1180
+ class $t {
1181
+ constructor(e, r, s, a, i, c, l, d) {
1182
+ K(this, "state");
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
1185
  }
1185
1186
  /**
1186
1187
  * Register all step handlers
1187
1188
  */
1188
1189
  registerStepHandlers() {
1189
- this.stepRouter.registerHandler(K.Questionaries, {
1190
+ this.stepRouter.registerHandler(U.Questionaries, {
1190
1191
  loadData: (e) => this.questionnaireService.getQuestionnaire(e),
1191
1192
  submitData: async (e) => {
1192
1193
  await this.questionnaireService.fillQuestionnaire(e);
1193
1194
  }
1194
- }), this.stepRouter.registerHandler(K.UploadDocument, {
1195
+ }), this.stepRouter.registerHandler(U.UploadDocument, {
1195
1196
  loadData: (e) => this.uploadDocumentService.getUploadDocument(e),
1196
1197
  submitData: (e) => this.uploadDocumentService.fillUploadDocument(e)
1197
- }), this.stepRouter.registerHandler(K.AppropriatenessTest, {
1198
+ }), this.stepRouter.registerHandler(U.AppropriatenessTest, {
1198
1199
  loadData: (e) => this.appropriatenessTestService.getAppropriatenessTest(e),
1199
1200
  submitData: async (e) => {
1200
1201
  await this.appropriatenessTestService.fillAppropriatenessTest(e);
1201
1202
  }
1202
- }), this.stepRouter.registerHandler(K.Overview, {
1203
+ }), this.stepRouter.registerHandler(U.Overview, {
1203
1204
  loadData: (e) => this.overviewService.getOverviewData(e),
1204
1205
  submitData: (e) => this.overviewService.passOverview(e.applicantId)
1205
- }), this.stepRouter.registerHandler(K.RiskScoring, {
1206
+ }), this.stepRouter.registerHandler(U.RiskScoring, {
1206
1207
  loadData: (e) => this.riskScoringService.getRiskCriterias(e),
1207
1208
  submitData: async (e) => {
1208
1209
  await this.riskScoringService.submitRiskScoring(e);
1209
1210
  }
1210
- }), this.stepRouter.registerHandler(K.IdentitySdk, {
1211
+ }), this.stepRouter.registerHandler(U.IdentitySdk, {
1211
1212
  loadData: async (e) => ({
1212
1213
  applicantId: e,
1213
1214
  message: "Identity verification required"
1214
1215
  }),
1215
1216
  submitData: async () => {
1216
1217
  }
1217
- }), this.stepRouter.registerHandler(K.InvestorCategorization, {
1218
+ }), this.stepRouter.registerHandler(U.InvestorCategorization, {
1218
1219
  loadData: (e) => this.investorCategorizationService.getInvestorCategorization(e),
1219
1220
  submitData: async (e) => {
1220
1221
  await this.investorCategorizationService.setInvestorCategorization(e);
1221
1222
  }
1222
- }), this.stepRouter.registerHandler(K.ManualReview, {
1223
+ }), this.stepRouter.registerHandler(U.ManualReview, {
1223
1224
  loadData: async (e) => ({
1224
1225
  applicantId: e,
1225
1226
  message: "Your application is under manual review"
1226
1227
  }),
1227
1228
  submitData: async () => {
1228
1229
  }
1229
- }), this.stepRouter.registerHandler(K.AdditionalData, {
1230
+ }), this.stepRouter.registerHandler(U.AdditionalData, {
1230
1231
  loadData: async (e) => ({
1231
1232
  applicantId: e,
1232
1233
  message: "Additional data required"
@@ -1320,34 +1321,34 @@ class Bt {
1320
1321
  return this.stepRouter;
1321
1322
  }
1322
1323
  }
1323
- function _e(t, e) {
1324
- return new Promise((r, a) => {
1324
+ function Ke(t, e) {
1325
+ return new Promise((r, s) => {
1325
1326
  if (e && document.getElementById(e)) {
1326
1327
  r();
1327
1328
  return;
1328
1329
  }
1329
- const s = document.createElement("script");
1330
- s.src = t, e && (s.id = e), s.async = !0, s.onload = () => r(), s.onerror = () => a(new Error(`Failed to load script: ${t}`)), document.head.appendChild(s);
1330
+ const a = document.createElement("script");
1331
+ a.src = t, e && (a.id = e), a.async = !0, a.onload = () => r(), a.onerror = () => s(new Error(`Failed to load script: ${t}`)), document.head.appendChild(a);
1331
1332
  });
1332
1333
  }
1333
- function Pr(t) {
1334
+ function Mr(t) {
1334
1335
  return !!document.getElementById(t);
1335
1336
  }
1336
- function Fr(t) {
1337
+ function Br(t) {
1337
1338
  const e = document.getElementById(t);
1338
1339
  e && e.remove();
1339
1340
  }
1340
- class Ot {
1341
+ class jt {
1341
1342
  constructor(e) {
1342
- U(this, "sdk", null);
1343
- U(this, "config");
1343
+ K(this, "sdk", null);
1344
+ K(this, "config");
1344
1345
  this.config = e;
1345
1346
  }
1346
1347
  /**
1347
1348
  * Load Sumsub SDK
1348
1349
  */
1349
1350
  async loadSDK() {
1350
- await _e(
1351
+ await Ke(
1351
1352
  "https://cdn.sumsub.com/websdk/v2/production/websdk.js",
1352
1353
  "sumsub-sdk"
1353
1354
  );
@@ -1392,17 +1393,17 @@ class Ot {
1392
1393
  this.sdk && this.sdk.on("idCheck.onError", e);
1393
1394
  }
1394
1395
  }
1395
- class zt {
1396
+ class _t {
1396
1397
  constructor(e) {
1397
- U(this, "sdk", null);
1398
- U(this, "config");
1398
+ K(this, "sdk", null);
1399
+ K(this, "config");
1399
1400
  this.config = e;
1400
1401
  }
1401
1402
  /**
1402
1403
  * Load Onfido SDK
1403
1404
  */
1404
1405
  async loadSDK() {
1405
- await _e(
1406
+ await Ke(
1406
1407
  "https://sdk.onfido.com/v12.0.0/onfido.min.js",
1407
1408
  "onfido-sdk"
1408
1409
  );
@@ -1458,11 +1459,11 @@ class zt {
1458
1459
  this.sdk && (this.sdk.tearDown(), this.sdk = null);
1459
1460
  }
1460
1461
  }
1461
- class $t {
1462
+ class Kt {
1462
1463
  constructor(e) {
1463
- U(this, "sardineContext", null);
1464
- U(this, "config");
1465
- U(this, "sessionKey");
1464
+ K(this, "sardineContext", null);
1465
+ K(this, "config");
1466
+ K(this, "sessionKey");
1466
1467
  this.config = e, this.sessionKey = e.sessionKey || this.generateSessionKey();
1467
1468
  }
1468
1469
  /**
@@ -1501,14 +1502,14 @@ class $t {
1501
1502
  e();
1502
1503
  return;
1503
1504
  }
1504
- const a = this.getSardineHost(), s = document.createElement("script");
1505
- s.type = "text/javascript", s.async = !0, s.src = `https://${a}/assets/loader.min.js`, s.onload = () => {
1505
+ const s = this.getSardineHost(), a = document.createElement("script");
1506
+ a.type = "text/javascript", a.async = !0, a.src = `https://${s}/assets/loader.min.js`, a.onload = () => {
1506
1507
  console.log("[SardinAI] SDK loaded successfully"), e();
1507
- }, s.onerror = () => {
1508
+ }, a.onerror = () => {
1508
1509
  r(new Error("Failed to load SardinAI SDK"));
1509
1510
  };
1510
1511
  const i = document.getElementsByTagName("script")[0];
1511
- i && i.parentNode ? i.parentNode.insertBefore(s, i) : document.head.appendChild(s);
1512
+ i && i.parentNode ? i.parentNode.insertBefore(a, i) : document.head.appendChild(a);
1512
1513
  });
1513
1514
  }
1514
1515
  /**
@@ -1518,14 +1519,14 @@ class $t {
1518
1519
  try {
1519
1520
  if (await this.loadSDK(), !window._Sardine)
1520
1521
  throw new Error("SardinAI SDK not available after loading");
1521
- const e = this.getSardineHost(), { clientId: r, environment: a, flow: s, enableBiometrics: i, enablePortScanning: c } = this.config;
1522
+ const e = this.getSardineHost(), { clientId: r, environment: s, flow: a, enableBiometrics: i, enablePortScanning: c } = this.config;
1522
1523
  this.sardineContext = window._Sardine.createContext({
1523
1524
  clientId: r,
1524
1525
  sessionKey: this.sessionKey,
1525
1526
  userIdHash: void 0,
1526
1527
  // Will be set later via updateConfig
1527
- flow: s || window.location.pathname,
1528
- environment: a || "production",
1528
+ flow: a || window.location.pathname,
1529
+ environment: s || "production",
1529
1530
  parentElement: document.body,
1530
1531
  enableBiometrics: i !== !1,
1531
1532
  // Default true
@@ -1561,8 +1562,8 @@ class $t {
1561
1562
  * Add noscript fallback for cases where JS is disabled
1562
1563
  */
1563
1564
  addNoScriptFallback(e) {
1564
- const r = document.createElement("noscript"), a = document.createElement("img"), { clientId: s, flow: i } = this.config;
1565
- a.src = `https://${e}/v1/a.png?clientId=${s}&sessionKey=${this.sessionKey}&flow=${i || "kyc"}&ns=1`, a.style.display = "none", r.appendChild(a), document.body.appendChild(r);
1565
+ const r = document.createElement("noscript"), s = document.createElement("img"), { clientId: a, flow: i } = this.config;
1566
+ s.src = `https://${e}/v1/a.png?clientId=${a}&sessionKey=${this.sessionKey}&flow=${i || "kyc"}&ns=1`, s.style.display = "none", r.appendChild(s), document.body.appendChild(r);
1566
1567
  }
1567
1568
  /**
1568
1569
  * Update configuration (e.g., set userIdHash after login)
@@ -1574,13 +1575,13 @@ class $t {
1574
1575
  }
1575
1576
  e.sessionKey && (this.sessionKey = e.sessionKey), this.sardineContext.updateConfig({
1576
1577
  ...e,
1577
- onConfigUpdate: (r, a, s) => {
1578
+ onConfigUpdate: (r, s, a) => {
1578
1579
  switch (r) {
1579
1580
  case "SESSION_UPDATE_FAILED":
1580
- console.error("[SardinAI] Config update failed:", s);
1581
+ console.error("[SardinAI] Config update failed:", a);
1581
1582
  break;
1582
1583
  case "SESSION_UPDATED":
1583
- console.log("[SardinAI] Config updated:", a);
1584
+ console.log("[SardinAI] Config updated:", s);
1584
1585
  break;
1585
1586
  case "SESSION_NO_UPDATE":
1586
1587
  console.log("[SardinAI] No config update needed");
@@ -1602,18 +1603,18 @@ class $t {
1602
1603
  this.sardineContext && (this.sardineContext = null);
1603
1604
  }
1604
1605
  }
1605
- class fe {
1606
+ class ye {
1606
1607
  /**
1607
1608
  * Create a provider instance
1608
1609
  */
1609
1610
  static createProvider(e, r) {
1610
1611
  switch (e) {
1611
- case ne.Sumsub:
1612
- return new Ot(r);
1613
- case ne.Onfido:
1614
- return new zt(r);
1615
- case ne.SardinAI:
1616
- return new $t(r);
1612
+ case se.Sumsub:
1613
+ return new jt(r);
1614
+ case se.Onfido:
1615
+ return new _t(r);
1616
+ case se.SardinAI:
1617
+ return new Kt(r);
1617
1618
  default:
1618
1619
  throw new Error(`Unsupported identity provider: ${e}`);
1619
1620
  }
@@ -1621,10 +1622,10 @@ class fe {
1621
1622
  /**
1622
1623
  * Get provider configuration from API token object
1623
1624
  */
1624
- static parseProviderConfig(e, r, a) {
1625
- var s;
1625
+ static parseProviderConfig(e, r, s) {
1626
+ var a;
1626
1627
  switch (e) {
1627
- case ne.Sumsub:
1628
+ case se.Sumsub:
1628
1629
  return {
1629
1630
  accessToken: r.accessToken || r.token,
1630
1631
  applicantEmail: r.email,
@@ -1632,12 +1633,12 @@ class fe {
1632
1633
  externalUserId: r.externalUserId,
1633
1634
  lang: r.lang || "en"
1634
1635
  };
1635
- case ne.Onfido:
1636
+ case se.Onfido:
1636
1637
  return {
1637
1638
  token: r.token || r.sdkToken
1638
1639
  };
1639
- case ne.SardinAI:
1640
- const i = ((s = a == null ? void 0 : a.identityProviders) == null ? void 0 : s.sardinai) || {};
1640
+ case se.SardinAI:
1641
+ const i = ((a = s == null ? void 0 : s.identityProviders) == null ? void 0 : a.sardinai) || {};
1641
1642
  return {
1642
1643
  clientId: i.clientId || r.clientId,
1643
1644
  sessionKey: i.sessionKey || r.sessionKey,
@@ -1652,11 +1653,11 @@ class fe {
1652
1653
  }
1653
1654
  }
1654
1655
  }
1655
- class _t {
1656
+ class Ut {
1656
1657
  constructor(e) {
1657
- U(this, "currentTheme", ee);
1658
- U(this, "customStyleElement", null);
1659
- U(this, "container");
1658
+ K(this, "currentTheme", Q);
1659
+ K(this, "customStyleElement", null);
1660
+ K(this, "container");
1660
1661
  this.container = e || document.documentElement;
1661
1662
  }
1662
1663
  /**
@@ -1669,7 +1670,7 @@ class _t {
1669
1670
  * Apply color palette as CSS variables
1670
1671
  */
1671
1672
  applyColors(e) {
1672
- var a;
1673
+ var s;
1673
1674
  const r = {
1674
1675
  primary: e.primary,
1675
1676
  "primary-hover": e.primaryHover,
@@ -1688,18 +1689,18 @@ class _t {
1688
1689
  "text-secondary": e.textSecondary,
1689
1690
  "text-muted": e.textMuted
1690
1691
  };
1691
- Object.entries(r).forEach(([s, i]) => {
1692
- this.container.style.setProperty(`--metakyc-${s}`, i);
1693
- }), (a = this.currentTheme.darkMode) != null && a.colors && this.applyDarkModeColors(this.currentTheme.darkMode.colors);
1692
+ Object.entries(r).forEach(([a, i]) => {
1693
+ this.container.style.setProperty(`--metakyc-${a}`, i);
1694
+ }), (s = this.currentTheme.darkMode) != null && s.colors && this.applyDarkModeColors(this.currentTheme.darkMode.colors);
1694
1695
  }
1695
1696
  /**
1696
1697
  * Apply dark mode color overrides
1697
1698
  */
1698
1699
  applyDarkModeColors(e) {
1699
- Object.entries(e).forEach(([r, a]) => {
1700
- if (a) {
1701
- const s = `--metakyc-dark-${this.kebabCase(r)}`;
1702
- this.container.style.setProperty(s, a);
1700
+ Object.entries(e).forEach(([r, s]) => {
1701
+ if (s) {
1702
+ const a = `--metakyc-dark-${this.kebabCase(r)}`;
1703
+ this.container.style.setProperty(a, s);
1703
1704
  }
1704
1705
  });
1705
1706
  }
@@ -1707,19 +1708,19 @@ class _t {
1707
1708
  * Apply typography settings
1708
1709
  */
1709
1710
  applyTypography(e) {
1710
- e && (e.fontFamily && this.container.style.setProperty("--metakyc-font-family", e.fontFamily), e.headingFont && this.container.style.setProperty("--metakyc-heading-font", e.headingFont), e.fontSize && Object.entries(e.fontSize).forEach(([r, a]) => {
1711
- this.container.style.setProperty(`--metakyc-font-size-${r}`, a);
1712
- }), e.fontWeight && Object.entries(e.fontWeight).forEach(([r, a]) => {
1713
- this.container.style.setProperty(`--metakyc-font-weight-${r}`, a.toString());
1711
+ e && (e.fontFamily && this.container.style.setProperty("--metakyc-font-family", e.fontFamily), e.headingFont && this.container.style.setProperty("--metakyc-heading-font", e.headingFont), e.fontSize && Object.entries(e.fontSize).forEach(([r, s]) => {
1712
+ this.container.style.setProperty(`--metakyc-font-size-${r}`, s);
1713
+ }), e.fontWeight && Object.entries(e.fontWeight).forEach(([r, s]) => {
1714
+ this.container.style.setProperty(`--metakyc-font-weight-${r}`, s.toString());
1714
1715
  }));
1715
1716
  }
1716
1717
  /**
1717
1718
  * Apply spacing settings
1718
1719
  */
1719
1720
  applySpacing(e) {
1720
- e && Object.entries(e).forEach(([r, a]) => {
1721
- const s = `--metakyc-${this.kebabCase(r)}`;
1722
- this.container.style.setProperty(s, a);
1721
+ e && Object.entries(e).forEach(([r, s]) => {
1722
+ const a = `--metakyc-${this.kebabCase(r)}`;
1723
+ this.container.style.setProperty(a, s);
1723
1724
  });
1724
1725
  }
1725
1726
  /**
@@ -1734,18 +1735,19 @@ class _t {
1734
1735
  mergeWithDefault(e) {
1735
1736
  var r;
1736
1737
  return {
1737
- name: e.name || ee.name,
1738
- logo: { ...ee.logo, ...e.logo },
1739
- colors: { ...ee.colors, ...e.colors },
1740
- typography: e.typography ? { ...ee.typography, ...e.typography } : ee.typography,
1741
- spacing: e.spacing ? { ...ee.spacing, ...e.spacing } : ee.spacing,
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,
1742
1744
  customCSS: e.customCSS,
1743
1745
  darkMode: e.darkMode ? {
1744
1746
  colors: {
1745
- ...(r = ee.darkMode) == null ? void 0 : r.colors,
1747
+ ...(r = Q.darkMode) == null ? void 0 : r.colors,
1746
1748
  ...e.darkMode.colors
1747
1749
  }
1748
- } : ee.darkMode
1750
+ } : Q.darkMode
1749
1751
  };
1750
1752
  }
1751
1753
  /**
@@ -1758,7 +1760,7 @@ class _t {
1758
1760
  * Reset to default theme
1759
1761
  */
1760
1762
  resetTheme() {
1761
- this.applyTheme(ee);
1763
+ this.applyTheme(Q);
1762
1764
  }
1763
1765
  /**
1764
1766
  * Remove all custom styles
@@ -1773,13 +1775,13 @@ class _t {
1773
1775
  return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
1774
1776
  }
1775
1777
  }
1776
- const je = Je(null), Lr = ({ config: t, children: e }) => {
1777
- const r = Oe(() => {
1778
- const a = new yt(t), s = new ft(a), i = new bt(a), c = new xt(a), l = new vt(a), d = new wt(a), u = new kt(a), g = new Nt(a), p = new St(a), m = new Ct(a), b = new Ft(a), y = new _t();
1778
+ const Ue = tt(null), Or = ({ config: t, children: e }) => {
1779
+ const r = $e(() => {
1780
+ const s = new xt(t), a = new vt(s), i = new wt(s), c = new kt(s), l = new Nt(s), d = new St(s), u = new Ct(s), g = new At(s), p = new Et(s), m = new It(s), f = new Mt(s), y = new Ut();
1779
1781
  return {
1780
1782
  config: t,
1781
- httpClient: a,
1782
- applicantService: s,
1783
+ httpClient: s,
1784
+ applicantService: a,
1783
1785
  questionnaireService: i,
1784
1786
  uploadDocumentService: c,
1785
1787
  appropriatenessTestService: l,
@@ -1788,10 +1790,10 @@ const je = Je(null), Lr = ({ config: t, children: e }) => {
1788
1790
  identityService: g,
1789
1791
  baseInformationService: p,
1790
1792
  investorCategorizationService: m,
1791
- themeService: b,
1793
+ themeService: f,
1792
1794
  themeManager: y,
1793
- createOrchestrator: () => new Bt(
1794
- s,
1795
+ createOrchestrator: () => new $t(
1796
+ a,
1795
1797
  i,
1796
1798
  c,
1797
1799
  l,
@@ -1809,111 +1811,111 @@ const je = Je(null), Lr = ({ config: t, children: e }) => {
1809
1811
  return;
1810
1812
  }
1811
1813
  console.log("[MetaKYC] Fetching theme from backend...");
1812
- const s = await r.themeService.getThemeConfiguration();
1813
- r.themeManager.applyTheme(s), console.log("[MetaKYC] Theme loaded and applied");
1814
- } catch (s) {
1815
- console.warn("[MetaKYC] Failed to load theme, using default:", s);
1814
+ const a = await r.themeService.getThemeConfiguration();
1815
+ r.themeManager.applyTheme(a), console.log("[MetaKYC] Theme loaded and applied");
1816
+ } catch (a) {
1817
+ console.warn("[MetaKYC] Failed to load theme, using default:", a);
1816
1818
  }
1817
1819
  })(), () => {
1818
1820
  r.themeManager.cleanup();
1819
- }), [t.theme, r.themeService, r.themeManager]), /* @__PURE__ */ n(je.Provider, { value: r, children: e });
1821
+ }), [t.theme, r.themeService, r.themeManager]), /* @__PURE__ */ n(Ue.Provider, { value: r, children: e });
1820
1822
  };
1821
- function ie() {
1822
- const t = Xe(je);
1823
+ function re() {
1824
+ const t = rt(Ue);
1823
1825
  if (!t)
1824
1826
  throw new Error("useMetaKYC must be used within a MetaKYCProvider");
1825
1827
  return t;
1826
1828
  }
1827
- async function jt(t) {
1829
+ async function qt(t) {
1828
1830
  return new Promise((e, r) => {
1829
- const a = new FileReader();
1830
- a.readAsDataURL(t), a.onload = () => {
1831
- const i = a.result.split(",")[1];
1831
+ const s = new FileReader();
1832
+ s.readAsDataURL(t), s.onload = () => {
1833
+ const i = s.result.split(",")[1];
1832
1834
  e(i);
1833
- }, a.onerror = (s) => r(s);
1835
+ }, s.onerror = (a) => r(a);
1834
1836
  });
1835
1837
  }
1836
- function Tr(t, e) {
1838
+ function zr(t, e) {
1837
1839
  return t.size <= e;
1838
1840
  }
1839
- function Mr(t, e) {
1840
- return e.split(",").map((a) => a.trim()).some((a) => {
1841
- if (a.endsWith("/*")) {
1842
- const s = a.slice(0, -2);
1843
- return t.type.startsWith(s);
1841
+ function $r(t, e) {
1842
+ return e.split(",").map((s) => s.trim()).some((s) => {
1843
+ if (s.endsWith("/*")) {
1844
+ const a = s.slice(0, -2);
1845
+ return t.type.startsWith(a);
1844
1846
  }
1845
- return t.type === a;
1847
+ return t.type === s;
1846
1848
  });
1847
1849
  }
1848
- function Ce(t) {
1850
+ function Ae(t) {
1849
1851
  if (t === 0) return "0 Bytes";
1850
- const e = 1024, r = ["Bytes", "KB", "MB", "GB"], a = Math.floor(Math.log(t) / Math.log(e));
1851
- return Math.round(t / Math.pow(e, a) * 100) / 100 + " " + r[a];
1852
+ const e = 1024, r = ["Bytes", "KB", "MB", "GB"], s = Math.floor(Math.log(t) / Math.log(e));
1853
+ return Math.round(t / Math.pow(e, s) * 100) / 100 + " " + r[s];
1852
1854
  }
1853
- function Br(t) {
1855
+ function jr(t) {
1854
1856
  return t;
1855
1857
  }
1856
- function J(...t) {
1858
+ function X(...t) {
1857
1859
  return t.filter(Boolean).join(" ");
1858
1860
  }
1859
- const be = {
1861
+ const fe = {
1860
1862
  APPLICANT_ID: "metakyc_applicant_id",
1861
1863
  WORKFLOW_STATE: "metakyc_workflow_state"
1862
1864
  };
1863
- function Ut(t) {
1865
+ function Ht(t) {
1864
1866
  try {
1865
- localStorage.setItem(be.APPLICANT_ID, t.toString());
1867
+ localStorage.setItem(fe.APPLICANT_ID, t.toString());
1866
1868
  } catch (e) {
1867
1869
  console.warn("Failed to save applicant ID to storage:", e);
1868
1870
  }
1869
1871
  }
1870
- function Kt() {
1872
+ function Vt() {
1871
1873
  try {
1872
- const t = localStorage.getItem(be.APPLICANT_ID);
1874
+ const t = localStorage.getItem(fe.APPLICANT_ID);
1873
1875
  return t ? parseInt(t, 10) : null;
1874
1876
  } catch (t) {
1875
1877
  return console.warn("Failed to retrieve applicant ID from storage:", t), null;
1876
1878
  }
1877
1879
  }
1878
- function qt() {
1880
+ function Yt() {
1879
1881
  try {
1880
- localStorage.removeItem(be.APPLICANT_ID);
1882
+ localStorage.removeItem(fe.APPLICANT_ID);
1881
1883
  } catch (t) {
1882
1884
  console.warn("Failed to clear applicant ID from storage:", t);
1883
1885
  }
1884
1886
  }
1885
- function Ht(t) {
1887
+ function Wt(t) {
1886
1888
  try {
1887
- localStorage.setItem(be.WORKFLOW_STATE, JSON.stringify(t));
1889
+ localStorage.setItem(fe.WORKFLOW_STATE, JSON.stringify(t));
1888
1890
  } catch (e) {
1889
1891
  console.warn("Failed to save workflow state to storage:", e);
1890
1892
  }
1891
1893
  }
1892
- function Or() {
1894
+ function _r() {
1893
1895
  try {
1894
- const t = localStorage.getItem(be.WORKFLOW_STATE);
1896
+ const t = localStorage.getItem(fe.WORKFLOW_STATE);
1895
1897
  return t ? JSON.parse(t) : null;
1896
1898
  } catch (t) {
1897
1899
  return console.warn("Failed to retrieve workflow state from storage:", t), null;
1898
1900
  }
1899
1901
  }
1900
- function Vt() {
1902
+ function Qt() {
1901
1903
  try {
1902
- localStorage.removeItem(be.WORKFLOW_STATE);
1904
+ localStorage.removeItem(fe.WORKFLOW_STATE);
1903
1905
  } catch (t) {
1904
1906
  console.warn("Failed to clear workflow state from storage:", t);
1905
1907
  }
1906
1908
  }
1907
- function zr() {
1908
- qt(), Vt();
1909
+ function Kr() {
1910
+ Yt(), Qt();
1909
1911
  }
1910
- function Yt(t) {
1911
- const { createOrchestrator: e } = ie(), [r, a] = v(null), [s, i] = v(!1), [c, l] = v(null), d = ze(null), u = t || Kt();
1912
+ function Gt(t) {
1913
+ const { createOrchestrator: e } = re(), [r, s] = x(null), [a, i] = x(!1), [c, l] = x(null), d = je(null), u = t || Vt();
1912
1914
  V(() => {
1913
1915
  d.current || (d.current = e());
1914
1916
  }, [e]), V(() => {
1915
1917
  var h;
1916
- r && u && (Ut(u), Ht({
1918
+ r && u && (Ht(u), Wt({
1917
1919
  applicantId: u,
1918
1920
  currentStepOrder: (h = r.currentStep) == null ? void 0 : h.order,
1919
1921
  status: r.status,
@@ -1927,7 +1929,7 @@ function Yt(t) {
1927
1929
  i(!0), l(null);
1928
1930
  try {
1929
1931
  const h = await d.current.initialize(u);
1930
- a(h);
1932
+ s(h);
1931
1933
  } catch (h) {
1932
1934
  l(h);
1933
1935
  } finally {
@@ -1943,7 +1945,7 @@ function Yt(t) {
1943
1945
  i(!0), l(null);
1944
1946
  try {
1945
1947
  const h = await d.current.refreshProgress();
1946
- a(h);
1948
+ s(h);
1947
1949
  } catch (h) {
1948
1950
  l(h);
1949
1951
  } finally {
@@ -1955,19 +1957,19 @@ function Yt(t) {
1955
1957
  i(!0), l(null);
1956
1958
  try {
1957
1959
  const h = await d.current.moveToNextStep();
1958
- a(h);
1960
+ s(h);
1959
1961
  } catch (h) {
1960
1962
  l(h);
1961
1963
  } finally {
1962
1964
  i(!1);
1963
1965
  }
1964
1966
  }
1965
- }, []), b = q(async () => {
1967
+ }, []), f = q(async () => {
1966
1968
  if (d.current) {
1967
1969
  i(!0), l(null);
1968
1970
  try {
1969
1971
  const h = await d.current.moveToPreviousStep();
1970
- a(h);
1972
+ s(h);
1971
1973
  } catch (h) {
1972
1974
  l(h);
1973
1975
  } finally {
@@ -1980,42 +1982,42 @@ function Yt(t) {
1980
1982
  try {
1981
1983
  await d.current.submitCurrentStep(h);
1982
1984
  const N = await d.current.refreshProgress();
1983
- a(N);
1985
+ s(N);
1984
1986
  } catch (N) {
1985
1987
  throw l(N), N;
1986
1988
  } finally {
1987
1989
  i(!1);
1988
1990
  }
1989
1991
  }
1990
- }, []), x = Pe.useMemo(() => r != null && r.stepInfoList ? [...r.stepInfoList].sort((h, N) => h.order - N.order) : [], [r == null ? void 0 : r.stepInfoList]), R = Pe.useMemo(() => r ? r.nextWorkflowKey && r.nextWorkflowKey !== r.workFlowKey : !1, [r]);
1992
+ }, []), b = Le.useMemo(() => r != null && r.stepInfoList ? [...r.stepInfoList].sort((h, N) => h.order - N.order) : [], [r == null ? void 0 : r.stepInfoList]), F = Le.useMemo(() => r ? r.nextWorkflowKey && r.nextWorkflowKey !== r.workFlowKey : !1, [r]);
1991
1993
  return {
1992
1994
  progress: r,
1993
1995
  applicantId: u,
1994
1996
  currentStep: (r == null ? void 0 : r.currentStep) || null,
1995
- steps: x,
1997
+ steps: b,
1996
1998
  status: (r == null ? void 0 : r.status) || ae.None,
1997
1999
  workflowResult: (r == null ? void 0 : r.workflowResult) || null,
1998
2000
  workflowKey: r == null ? void 0 : r.workFlowKey,
1999
2001
  nextWorkflowKey: r == null ? void 0 : r.nextWorkflowKey,
2000
- hasWorkflowChanged: R,
2001
- isLoading: s,
2002
+ hasWorkflowChanged: F,
2003
+ isLoading: a,
2002
2004
  error: c,
2003
2005
  isComplete: (r == null ? void 0 : r.status) === ae.Finished,
2004
2006
  isOnHold: (r == null ? void 0 : r.status) === ae.OnHold,
2005
2007
  refreshProgress: p,
2006
2008
  moveToNext: m,
2007
- moveBack: b,
2009
+ moveBack: f,
2008
2010
  submitCurrentStep: y,
2009
2011
  orchestrator: d.current
2010
2012
  };
2011
2013
  }
2012
- function Wt(t) {
2013
- const { questionnaireService: e } = ie(), [r, a] = v(null), [s, i] = v(!1), [c, l] = v(!1), [d, u] = v(null), g = q(async () => {
2014
+ function Zt(t) {
2015
+ const { questionnaireService: e } = re(), [r, s] = x(null), [a, i] = x(!1), [c, l] = x(!1), [d, u] = x(null), g = q(async () => {
2014
2016
  if (t) {
2015
2017
  i(!0), u(null);
2016
2018
  try {
2017
2019
  const m = await e.getQuestionnaire(t);
2018
- a(m);
2020
+ s(m);
2019
2021
  } catch (m) {
2020
2022
  u(m);
2021
2023
  } finally {
@@ -2031,8 +2033,8 @@ function Wt(t) {
2031
2033
  l(!0), u(null);
2032
2034
  try {
2033
2035
  return await e.fillQuestionnaire(m);
2034
- } catch (b) {
2035
- throw u(b), b;
2036
+ } catch (f) {
2037
+ throw u(f), f;
2036
2038
  } finally {
2037
2039
  l(!1);
2038
2040
  }
@@ -2041,20 +2043,20 @@ function Wt(t) {
2041
2043
  );
2042
2044
  return {
2043
2045
  questionnaire: r,
2044
- isLoading: s,
2046
+ isLoading: a,
2045
2047
  isSubmitting: c,
2046
2048
  error: d,
2047
2049
  load: g,
2048
2050
  submit: p
2049
2051
  };
2050
2052
  }
2051
- function Qt(t) {
2052
- const { uploadDocumentService: e } = ie(), [r, a] = v(null), [s, i] = v(!1), [c, l] = v(!1), [d, u] = v(0), [g, p] = v(null), m = q(async () => {
2053
+ function Jt(t) {
2054
+ 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 () => {
2053
2055
  if (t) {
2054
2056
  i(!0), p(null);
2055
2057
  try {
2056
2058
  const y = await e.getUploadDocument(t);
2057
- a(y);
2059
+ s(y);
2058
2060
  } catch (y) {
2059
2061
  p(y);
2060
2062
  } finally {
@@ -2065,13 +2067,13 @@ function Qt(t) {
2065
2067
  V(() => {
2066
2068
  t && m();
2067
2069
  }, [t, m]);
2068
- const b = q(
2070
+ const f = q(
2069
2071
  async (y) => {
2070
2072
  l(!0), u(0), p(null);
2071
2073
  try {
2072
2074
  await e.fillUploadDocument(y), u(100);
2073
- } catch (x) {
2074
- throw p(x), x;
2075
+ } catch (b) {
2076
+ throw p(b), b;
2075
2077
  } finally {
2076
2078
  l(!1);
2077
2079
  }
@@ -2080,21 +2082,21 @@ function Qt(t) {
2080
2082
  );
2081
2083
  return {
2082
2084
  uploadDocument: r,
2083
- isLoading: s,
2085
+ isLoading: a,
2084
2086
  isSubmitting: c,
2085
2087
  uploadProgress: d,
2086
2088
  error: g,
2087
2089
  load: m,
2088
- submit: b
2090
+ submit: f
2089
2091
  };
2090
2092
  }
2091
- function $r(t) {
2092
- const { appropriatenessTestService: e } = ie(), [r, a] = v(null), [s, i] = v(!1), [c, l] = v(!1), [d, u] = v(null), [g, p] = v(null), m = q(async () => {
2093
+ function Ur(t) {
2094
+ 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 () => {
2093
2095
  if (t) {
2094
2096
  i(!0), u(null);
2095
2097
  try {
2096
2098
  const y = await e.getAppropriatenessTest(t);
2097
- a(y);
2099
+ s(y);
2098
2100
  } catch (y) {
2099
2101
  u(y);
2100
2102
  } finally {
@@ -2105,14 +2107,14 @@ function $r(t) {
2105
2107
  V(() => {
2106
2108
  t && m();
2107
2109
  }, [t, m]);
2108
- const b = q(
2110
+ const f = q(
2109
2111
  async (y) => {
2110
2112
  l(!0), u(null);
2111
2113
  try {
2112
- const x = await e.fillAppropriatenessTest(y);
2113
- return p(x), x;
2114
- } catch (x) {
2115
- throw u(x), x;
2114
+ const b = await e.fillAppropriatenessTest(y);
2115
+ return p(b), b;
2116
+ } catch (b) {
2117
+ throw u(b), b;
2116
2118
  } finally {
2117
2119
  l(!1);
2118
2120
  }
@@ -2122,20 +2124,20 @@ function $r(t) {
2122
2124
  return {
2123
2125
  test: r,
2124
2126
  result: g,
2125
- isLoading: s,
2127
+ isLoading: a,
2126
2128
  isSubmitting: c,
2127
2129
  error: d,
2128
2130
  load: m,
2129
- submit: b
2131
+ submit: f
2130
2132
  };
2131
2133
  }
2132
- function Gt(t) {
2133
- const { overviewService: e } = ie(), [r, a] = v(null), [s, i] = v(!1), [c, l] = v(!1), [d, u] = v(null), g = q(async () => {
2134
+ function Xt(t) {
2135
+ const { overviewService: e } = re(), [r, s] = x(null), [a, i] = x(!1), [c, l] = x(!1), [d, u] = x(null), g = q(async () => {
2134
2136
  if (t) {
2135
2137
  i(!0), u(null);
2136
2138
  try {
2137
2139
  const m = await e.getOverviewData(t);
2138
- a(m);
2140
+ s(m);
2139
2141
  } catch (m) {
2140
2142
  u(m);
2141
2143
  } finally {
@@ -2160,33 +2162,33 @@ function Gt(t) {
2160
2162
  }, [t, e]);
2161
2163
  return {
2162
2164
  overview: r,
2163
- isLoading: s,
2165
+ isLoading: a,
2164
2166
  isSubmitting: c,
2165
2167
  error: d,
2166
2168
  load: g,
2167
2169
  passOverview: p
2168
2170
  };
2169
2171
  }
2170
- function Zt(t) {
2171
- const { identityService: e } = ie(), [r, a] = v(
2172
+ function er(t) {
2173
+ const { identityService: e } = re(), [r, s] = x(
2172
2174
  null
2173
- ), [s, i] = v(!1), [c, l] = v(null), d = q(
2175
+ ), [a, i] = x(!1), [c, l] = x(null), d = q(
2174
2176
  async (p, m) => {
2175
2177
  if (t) {
2176
2178
  i(!0), l(null);
2177
2179
  try {
2178
- const b = {
2180
+ const f = {
2179
2181
  applicantId: t,
2180
2182
  restart: !1,
2181
2183
  redirectUrl: p || "",
2182
2184
  ttl: m || 604800
2183
2185
  // Default: 7 days
2184
2186
  };
2185
- console.log("Identity request input:", b);
2186
- const y = await e.identityRequest(b);
2187
- return console.log("Identity request result:", y), a(y), y;
2188
- } catch (b) {
2189
- throw l(b), b;
2187
+ console.log("Identity request input:", f);
2188
+ const y = await e.identityRequest(f);
2189
+ return console.log("Identity request result:", y), s(y), y;
2190
+ } catch (f) {
2191
+ throw l(f), f;
2190
2192
  } finally {
2191
2193
  i(!1);
2192
2194
  }
@@ -2198,15 +2200,15 @@ function Zt(t) {
2198
2200
  if (t) {
2199
2201
  i(!0), l(null);
2200
2202
  try {
2201
- const b = {
2203
+ const f = {
2202
2204
  applicantId: t,
2203
2205
  restart: !1,
2204
2206
  redirectUrl: p,
2205
2207
  ttl: m
2206
- }, y = await e.identityCompanyRequest(b);
2207
- return a(y), y;
2208
- } catch (b) {
2209
- throw l(b), b;
2208
+ }, y = await e.identityCompanyRequest(f);
2209
+ return s(y), y;
2210
+ } catch (f) {
2211
+ throw l(f), f;
2210
2212
  } finally {
2211
2213
  i(!1);
2212
2214
  }
@@ -2226,7 +2228,7 @@ function Zt(t) {
2226
2228
  };
2227
2229
  console.log("Restarting identity with input:", p);
2228
2230
  const m = await e.identityRequest(p);
2229
- return console.log("Restart identity result:", m), a(m), m;
2231
+ return console.log("Restart identity result:", m), s(m), m;
2230
2232
  } catch (p) {
2231
2233
  throw l(p), p;
2232
2234
  } finally {
@@ -2238,20 +2240,20 @@ function Zt(t) {
2238
2240
  identityData: r,
2239
2241
  provider: (r == null ? void 0 : r.provider) || null,
2240
2242
  token: (r == null ? void 0 : r.publicProviderTokenObject) || null,
2241
- isLoading: s,
2243
+ isLoading: a,
2242
2244
  error: c,
2243
2245
  requestIdentity: d,
2244
2246
  requestCompanyIdentity: u,
2245
2247
  restartIdentity: g
2246
2248
  };
2247
2249
  }
2248
- function Jt(t) {
2249
- const { riskScoringService: e } = ie(), [r, a] = v(null), [s, i] = v(!1), [c, l] = v(!1), [d, u] = v(null), [g, p] = v(null), m = q(async () => {
2250
+ function tr(t) {
2251
+ 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 () => {
2250
2252
  if (t) {
2251
2253
  i(!0), u(null);
2252
2254
  try {
2253
2255
  const y = await e.getRiskCriterias(t);
2254
- a(y);
2256
+ s(y);
2255
2257
  } catch (y) {
2256
2258
  u(y);
2257
2259
  } finally {
@@ -2262,14 +2264,14 @@ function Jt(t) {
2262
2264
  V(() => {
2263
2265
  t && m();
2264
2266
  }, [t, m]);
2265
- const b = q(
2267
+ const f = q(
2266
2268
  async (y) => {
2267
2269
  l(!0), u(null);
2268
2270
  try {
2269
- const x = await e.submitRiskScoring(y);
2270
- return p(x), x;
2271
- } catch (x) {
2272
- throw u(x), x;
2271
+ const b = await e.submitRiskScoring(y);
2272
+ return p(b), b;
2273
+ } catch (b) {
2274
+ throw u(b), b;
2273
2275
  } finally {
2274
2276
  l(!1);
2275
2277
  }
@@ -2279,21 +2281,21 @@ function Jt(t) {
2279
2281
  return {
2280
2282
  criteria: r,
2281
2283
  result: g,
2282
- isLoading: s,
2284
+ isLoading: a,
2283
2285
  isSubmitting: c,
2284
2286
  error: d,
2285
2287
  load: m,
2286
- submit: b
2288
+ submit: f
2287
2289
  };
2288
2290
  }
2289
- function Xt() {
2290
- const { applicantService: t, config: e } = ie(), [r, a] = v(!1), [s, i] = v(null), c = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(p) {
2291
+ function rr() {
2292
+ 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) {
2291
2293
  const m = Math.random() * 16 | 0;
2292
2294
  return (p === "x" ? m : m & 3 | 8).toString(16);
2293
2295
  }), l = q(
2294
2296
  async (p) => {
2295
2297
  var m;
2296
- a(!0), i(null);
2298
+ s(!0), i(null);
2297
2299
  try {
2298
2300
  if (p.applicantAdditionalDatas || (p.applicantAdditionalDatas = []), (m = e.identityProviders) != null && m.sardinai) {
2299
2301
  const y = c();
@@ -2303,65 +2305,65 @@ function Xt() {
2303
2305
  });
2304
2306
  }
2305
2307
  return await t.createApplicant(p);
2306
- } catch (b) {
2307
- throw i(b), b;
2308
+ } catch (f) {
2309
+ throw i(f), f;
2308
2310
  } finally {
2309
- a(!1);
2311
+ s(!1);
2310
2312
  }
2311
2313
  },
2312
2314
  [t, e]
2313
2315
  ), d = q(
2314
2316
  async (p) => {
2315
- a(!0), i(null);
2317
+ s(!0), i(null);
2316
2318
  try {
2317
2319
  return await t.createCompanyApplicant(p);
2318
2320
  } catch (m) {
2319
2321
  throw i(m), m;
2320
2322
  } finally {
2321
- a(!1);
2323
+ s(!1);
2322
2324
  }
2323
2325
  },
2324
2326
  [t]
2325
2327
  ), u = q(
2326
2328
  async (p) => {
2327
- a(!0), i(null);
2329
+ s(!0), i(null);
2328
2330
  try {
2329
2331
  return await t.getApplicantData(p);
2330
2332
  } catch (m) {
2331
2333
  throw i(m), m;
2332
2334
  } finally {
2333
- a(!1);
2335
+ s(!1);
2334
2336
  }
2335
2337
  },
2336
2338
  [t]
2337
2339
  ), g = q(
2338
2340
  async (p) => {
2339
- a(!0), i(null);
2341
+ s(!0), i(null);
2340
2342
  try {
2341
2343
  await t.stopProgress(p);
2342
2344
  } catch (m) {
2343
2345
  throw i(m), m;
2344
2346
  } finally {
2345
- a(!1);
2347
+ s(!1);
2346
2348
  }
2347
2349
  },
2348
2350
  [t]
2349
2351
  );
2350
2352
  return {
2351
2353
  isLoading: r,
2352
- error: s,
2354
+ error: a,
2353
2355
  createApplicant: l,
2354
2356
  createCompanyApplicant: d,
2355
2357
  getApplicantData: u,
2356
2358
  stopProgress: g
2357
2359
  };
2358
2360
  }
2359
- const _ = ({
2361
+ const j = ({
2360
2362
  children: t,
2361
2363
  variant: e = "primary",
2362
2364
  size: r = "md",
2363
- isLoading: a = !1,
2364
- disabled: s,
2365
+ isLoading: s = !1,
2366
+ disabled: a,
2365
2367
  className: i,
2366
2368
  ...c
2367
2369
  }) => {
@@ -2379,11 +2381,11 @@ const _ = ({
2379
2381
  return /* @__PURE__ */ o(
2380
2382
  "button",
2381
2383
  {
2382
- className: J(l, d[e], u[r], i),
2383
- disabled: s || a,
2384
+ className: X(l, d[e], u[r], i),
2385
+ disabled: a || s,
2384
2386
  ...c,
2385
2387
  children: [
2386
- a && /* @__PURE__ */ o(
2388
+ s && /* @__PURE__ */ o(
2387
2389
  "svg",
2388
2390
  {
2389
2391
  className: "animate-spin -ml-1 mr-2 h-4 w-4",
@@ -2417,52 +2419,76 @@ const _ = ({
2417
2419
  ]
2418
2420
  }
2419
2421
  );
2420
- }, G = Re(
2421
- ({ label: t, error: e, helperText: r, leftIcon: a, rightIcon: s, className: i, ...c }, l) => /* @__PURE__ */ o("div", { className: "w-full", children: [
2422
+ }, Z = De(
2423
+ ({ label: t, error: e, helperText: r, leftIcon: s, rightIcon: a, className: i, ...c }, l) => /* @__PURE__ */ o("div", { className: "w-full", children: [
2422
2424
  t && /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
2423
2425
  t,
2424
2426
  c.required && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
2425
2427
  ] }),
2426
2428
  /* @__PURE__ */ o("div", { className: "relative", children: [
2427
- a && /* @__PURE__ */ n("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none", children: a }),
2429
+ s && /* @__PURE__ */ n("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none", children: s }),
2428
2430
  /* @__PURE__ */ n(
2429
2431
  "input",
2430
2432
  {
2431
2433
  ref: l,
2432
- className: J(
2434
+ className: X(
2433
2435
  "block w-full rounded-lg border px-3 py-2 text-sm transition-colors",
2434
2436
  "focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",
2435
2437
  "disabled:bg-gray-100 disabled:cursor-not-allowed",
2436
2438
  e ? "border-danger-500 focus:ring-danger-500" : "border-gray-300 dark:border-gray-600",
2437
2439
  "dark:bg-gray-800 dark:text-white",
2438
- a ? "pl-10" : "",
2439
- s ? "pr-10" : "",
2440
+ s ? "pl-10" : "",
2441
+ a ? "pr-10" : "",
2440
2442
  i
2441
2443
  ),
2442
2444
  ...c
2443
2445
  }
2444
2446
  ),
2445
- s && /* @__PURE__ */ n("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none", children: s })
2447
+ a && /* @__PURE__ */ n("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none", children: a })
2446
2448
  ] }),
2447
2449
  e && /* @__PURE__ */ n("p", { className: "mt-1 text-sm text-danger-500", children: e }),
2448
2450
  !e && r && /* @__PURE__ */ n("p", { className: "mt-1 text-sm text-gray-500", children: r })
2449
2451
  ] })
2450
2452
  );
2451
- G.displayName = "Input";
2452
- const L = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2453
+ Z.displayName = "Input";
2454
+ const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2453
2455
  "div",
2454
2456
  {
2455
- className: J(
2456
- "bg-white dark:bg-gray-800 rounded-xl shadow-sm border border-gray-200 dark:border-gray-700",
2457
+ className: X(
2458
+ "rounded-xl shadow-sm border",
2457
2459
  e
2458
2460
  ),
2461
+ style: {
2462
+ backgroundColor: "var(--metakyc-surface, #ffffff)",
2463
+ borderColor: "var(--metakyc-border, #e5e7eb)"
2464
+ },
2465
+ ...r,
2466
+ children: t
2467
+ }
2468
+ ), J = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2469
+ "div",
2470
+ {
2471
+ className: X("px-6 py-4 border-b", e),
2472
+ style: {
2473
+ borderColor: "var(--metakyc-border, #e5e7eb)"
2474
+ },
2475
+ ...r,
2476
+ children: t
2477
+ }
2478
+ ), 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(
2479
+ "div",
2480
+ {
2481
+ className: X("px-6 py-4 border-t", e),
2482
+ style: {
2483
+ borderColor: "var(--metakyc-border, #e5e7eb)"
2484
+ },
2459
2485
  ...r,
2460
2486
  children: t
2461
2487
  }
2462
- ), Z = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n("div", { className: J("px-6 py-4 border-b border-gray-200 dark:border-gray-700", e), ...r, children: t }), T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n("div", { className: J("px-6 py-4", e), ...r, children: t }), te = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n("div", { className: J("px-6 py-4 border-t border-gray-200 dark:border-gray-700", e), ...r, children: t }), ue = ({ children: t, variant: e = "default", className: r, ...a }) => /* @__PURE__ */ n(
2488
+ ), me = ({ children: t, variant: e = "default", className: r, ...s }) => /* @__PURE__ */ n(
2463
2489
  "span",
2464
2490
  {
2465
- className: J(
2491
+ className: X(
2466
2492
  "inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",
2467
2493
  {
2468
2494
  default: "bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300",
@@ -2473,19 +2499,19 @@ const L = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2473
2499
  }[e],
2474
2500
  r
2475
2501
  ),
2476
- ...a,
2502
+ ...s,
2477
2503
  children: t
2478
2504
  }
2479
- ), se = ({ size: t = "md", className: e, ...r }) => {
2480
- const a = {
2505
+ ), ie = ({ size: t = "md", className: e, ...r }) => {
2506
+ const s = {
2481
2507
  sm: "h-4 w-4",
2482
2508
  md: "h-8 w-8",
2483
2509
  lg: "h-12 w-12"
2484
2510
  };
2485
- return /* @__PURE__ */ n("div", { className: J("flex items-center justify-center", e), ...r, children: /* @__PURE__ */ o(
2511
+ return /* @__PURE__ */ n("div", { className: X("flex items-center justify-center", e), ...r, children: /* @__PURE__ */ o(
2486
2512
  "svg",
2487
2513
  {
2488
- className: J("animate-spin text-primary-500", a[t]),
2514
+ className: X("animate-spin text-primary-500", s[t]),
2489
2515
  xmlns: "http://www.w3.org/2000/svg",
2490
2516
  fill: "none",
2491
2517
  viewBox: "0 0 24 24",
@@ -2512,8 +2538,8 @@ const L = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2512
2538
  ]
2513
2539
  }
2514
2540
  ) });
2515
- }, ye = Re(
2516
- ({ label: t, error: e, helperText: r, options: a, placeholder: s, className: i, ...c }, l) => /* @__PURE__ */ o("div", { className: "w-full", children: [
2541
+ }, ge = De(
2542
+ ({ label: t, error: e, helperText: r, options: s, placeholder: a, className: i, ...c }, l) => /* @__PURE__ */ o("div", { className: "w-full", children: [
2517
2543
  t && /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
2518
2544
  t,
2519
2545
  c.required && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
@@ -2522,7 +2548,7 @@ const L = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2522
2548
  "select",
2523
2549
  {
2524
2550
  ref: l,
2525
- className: J(
2551
+ className: X(
2526
2552
  "block w-full rounded-lg border px-3 py-2 text-sm transition-colors",
2527
2553
  "focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",
2528
2554
  "disabled:bg-gray-100 disabled:cursor-not-allowed",
@@ -2532,8 +2558,8 @@ const L = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2532
2558
  ),
2533
2559
  ...c,
2534
2560
  children: [
2535
- s && /* @__PURE__ */ n("option", { value: "", disabled: !0, children: s }, "__placeholder__"),
2536
- a.map((d, u) => /* @__PURE__ */ n(
2561
+ a && /* @__PURE__ */ n("option", { value: "", disabled: !0, children: a }, "__placeholder__"),
2562
+ s.map((d, u) => /* @__PURE__ */ n(
2537
2563
  "option",
2538
2564
  {
2539
2565
  value: d.value,
@@ -2549,53 +2575,53 @@ const L = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2549
2575
  !e && r && /* @__PURE__ */ n("p", { className: "mt-1 text-sm text-gray-500", children: r })
2550
2576
  ] })
2551
2577
  );
2552
- ye.displayName = "Select";
2553
- const er = ({
2578
+ ge.displayName = "Select";
2579
+ const nr = ({
2554
2580
  label: t,
2555
2581
  error: e,
2556
2582
  accept: r,
2557
- multiple: a = !1,
2558
- maxSize: s,
2583
+ multiple: s = !1,
2584
+ maxSize: a,
2559
2585
  onChange: i,
2560
2586
  value: c = [],
2561
2587
  className: l
2562
2588
  }) => {
2563
- const [d, u] = v(!1), g = ze(null), p = (h) => {
2589
+ const [d, u] = x(!1), g = je(null), p = (h) => {
2564
2590
  if (!h) return;
2565
2591
  const N = Array.from(h);
2566
- if (s && N.filter((E) => E.size > s).length > 0) {
2567
- const E = Ce(s);
2568
- alert(`Some files exceed the maximum size of ${E}`);
2592
+ if (a && N.filter((I) => I.size > a).length > 0) {
2593
+ const I = Ae(a);
2594
+ alert(`Some files exceed the maximum size of ${I}`);
2569
2595
  return;
2570
2596
  }
2571
- i == null || i(a ? [...c, ...N] : [N[0]]);
2597
+ i == null || i(s ? [...c, ...N] : [N[0]]);
2572
2598
  }, m = (h) => {
2573
2599
  h.preventDefault(), u(!0);
2574
- }, b = () => {
2600
+ }, f = () => {
2575
2601
  u(!1);
2576
2602
  }, y = (h) => {
2577
2603
  h.preventDefault(), u(!1), p(h.dataTransfer.files);
2578
- }, x = () => {
2604
+ }, b = () => {
2579
2605
  var h;
2580
2606
  (h = g.current) == null || h.click();
2581
- }, R = (h) => {
2582
- const N = c.filter((w, E) => E !== h);
2607
+ }, F = (h) => {
2608
+ const N = c.filter((w, I) => I !== h);
2583
2609
  i == null || i(N);
2584
2610
  };
2585
- return /* @__PURE__ */ o("div", { className: J("w-full", l), children: [
2611
+ return /* @__PURE__ */ o("div", { className: X("w-full", l), children: [
2586
2612
  t && /* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: t }),
2587
2613
  /* @__PURE__ */ o(
2588
2614
  "div",
2589
2615
  {
2590
- className: J(
2616
+ className: X(
2591
2617
  "border-2 border-dashed rounded-lg p-6 text-center cursor-pointer transition-colors",
2592
2618
  d ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-300 dark:border-gray-600 hover:border-primary-500",
2593
2619
  e && "border-danger-500"
2594
2620
  ),
2595
2621
  onDragOver: m,
2596
- onDragLeave: b,
2622
+ onDragLeave: f,
2597
2623
  onDrop: y,
2598
- onClick: x,
2624
+ onClick: b,
2599
2625
  children: [
2600
2626
  /* @__PURE__ */ n(
2601
2627
  "input",
@@ -2604,7 +2630,7 @@ const er = ({
2604
2630
  type: "file",
2605
2631
  className: "hidden",
2606
2632
  accept: r,
2607
- multiple: a,
2633
+ multiple: s,
2608
2634
  onChange: (h) => p(h.target.files)
2609
2635
  }
2610
2636
  ),
@@ -2631,9 +2657,9 @@ const er = ({
2631
2657
  /* @__PURE__ */ n("span", { className: "font-medium text-primary-500", children: "Click to upload" }),
2632
2658
  " or drag and drop"
2633
2659
  ] }),
2634
- s && /* @__PURE__ */ o("p", { className: "text-xs text-gray-500", children: [
2660
+ a && /* @__PURE__ */ o("p", { className: "text-xs text-gray-500", children: [
2635
2661
  "Maximum file size: ",
2636
- Ce(s)
2662
+ Ae(a)
2637
2663
  ] })
2638
2664
  ] })
2639
2665
  ]
@@ -2664,7 +2690,7 @@ const er = ({
2664
2690
  /* @__PURE__ */ n("span", { className: "text-sm text-gray-700 dark:text-gray-300 truncate", children: h.name }),
2665
2691
  /* @__PURE__ */ o("span", { className: "text-xs text-gray-500", children: [
2666
2692
  "(",
2667
- Ce(h.size),
2693
+ Ae(h.size),
2668
2694
  ")"
2669
2695
  ] })
2670
2696
  ] }),
@@ -2673,7 +2699,7 @@ const er = ({
2673
2699
  {
2674
2700
  type: "button",
2675
2701
  onClick: (w) => {
2676
- w.stopPropagation(), R(N);
2702
+ w.stopPropagation(), F(N);
2677
2703
  },
2678
2704
  className: "ml-2 text-danger-500 hover:text-danger-700 focus:outline-none",
2679
2705
  children: /* @__PURE__ */ n("svg", { className: "h-5 w-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ n(
@@ -2692,11 +2718,11 @@ const er = ({
2692
2718
  )) }),
2693
2719
  e && /* @__PURE__ */ n("p", { className: "mt-1 text-sm text-danger-500", children: e })
2694
2720
  ] });
2695
- }, tr = Re(
2696
- ({ countryCode: t = "+1", onCountryCodeChange: e, className: r, ...a }, s) => /* @__PURE__ */ o("div", { className: "w-full", children: [
2697
- a.label && /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
2698
- a.label,
2699
- a.required && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
2721
+ }, sr = De(
2722
+ ({ countryCode: t = "+1", onCountryCodeChange: e, className: r, ...s }, a) => /* @__PURE__ */ o("div", { className: "w-full", children: [
2723
+ s.label && /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
2724
+ s.label,
2725
+ s.required && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
2700
2726
  ] }),
2701
2727
  /* @__PURE__ */ o("div", { className: "flex gap-2", children: [
2702
2728
  /* @__PURE__ */ n(
@@ -2705,7 +2731,7 @@ const er = ({
2705
2731
  type: "text",
2706
2732
  value: t,
2707
2733
  onChange: (i) => e == null ? void 0 : e(i.target.value),
2708
- className: J(
2734
+ className: X(
2709
2735
  "w-20 rounded-lg border px-3 py-2 text-sm",
2710
2736
  "focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",
2711
2737
  "border-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:text-white"
@@ -2714,50 +2740,50 @@ const er = ({
2714
2740
  }
2715
2741
  ),
2716
2742
  /* @__PURE__ */ n(
2717
- G,
2743
+ Z,
2718
2744
  {
2719
- ref: s,
2745
+ ref: a,
2720
2746
  type: "tel",
2721
- className: J("flex-1", r),
2722
- ...a,
2747
+ className: X("flex-1", r),
2748
+ ...s,
2723
2749
  label: ""
2724
2750
  }
2725
2751
  )
2726
2752
  ] }),
2727
- a.error && /* @__PURE__ */ n("p", { className: "mt-1 text-sm text-danger-500", children: a.error })
2753
+ s.error && /* @__PURE__ */ n("p", { className: "mt-1 text-sm text-danger-500", children: s.error })
2728
2754
  ] })
2729
2755
  );
2730
- tr.displayName = "PhoneInput";
2731
- const Fe = (t, e, r) => {
2756
+ sr.displayName = "PhoneInput";
2757
+ const Te = (t, e, r) => {
2732
2758
  if (t && "reportValidity" in t) {
2733
- const a = Ae(r, e);
2734
- t.setCustomValidity(a && a.message || ""), t.reportValidity();
2759
+ const s = Ee(r, e);
2760
+ t.setCustomValidity(s && s.message || ""), t.reportValidity();
2735
2761
  }
2736
- }, Ie = (t, e) => {
2762
+ }, Re = (t, e) => {
2737
2763
  for (const r in e.fields) {
2738
- const a = e.fields[r];
2739
- a && a.ref && "reportValidity" in a.ref ? Fe(a.ref, r, t) : a && a.refs && a.refs.forEach((s) => Fe(s, r, t));
2764
+ const s = e.fields[r];
2765
+ s && s.ref && "reportValidity" in s.ref ? Te(s.ref, r, t) : s && s.refs && s.refs.forEach((a) => Te(a, r, t));
2740
2766
  }
2741
- }, Le = (t, e) => {
2742
- e.shouldUseNativeValidation && Ie(t, e);
2767
+ }, Me = (t, e) => {
2768
+ e.shouldUseNativeValidation && Re(t, e);
2743
2769
  const r = {};
2744
- for (const a in t) {
2745
- const s = Ae(e.fields, a), i = Object.assign(t[a] || {}, { ref: s && s.ref });
2746
- if (rr(e.names || Object.keys(t), a)) {
2747
- const c = Object.assign({}, Ae(r, a));
2748
- Se(c, "root", i), Se(r, a, c);
2749
- } else Se(r, a, i);
2770
+ for (const s in t) {
2771
+ const a = Ee(e.fields, s), i = Object.assign(t[s] || {}, { ref: a && a.ref });
2772
+ if (ar(e.names || Object.keys(t), s)) {
2773
+ const c = Object.assign({}, Ee(r, s));
2774
+ Ce(c, "root", i), Ce(r, s, c);
2775
+ } else Ce(r, s, i);
2750
2776
  }
2751
2777
  return r;
2752
- }, rr = (t, e) => {
2753
- const r = Te(e);
2754
- return t.some((a) => Te(a).match(`^${r}\\.\\d+`));
2778
+ }, ar = (t, e) => {
2779
+ const r = Be(e);
2780
+ return t.some((s) => Be(s).match(`^${r}\\.\\d+`));
2755
2781
  };
2756
- function Te(t) {
2782
+ function Be(t) {
2757
2783
  return t.replace(/\]|\[/g, "");
2758
2784
  }
2759
- function Ue(t, e, r) {
2760
- function a(l, d) {
2785
+ function qe(t, e, r) {
2786
+ function s(l, d) {
2761
2787
  var u;
2762
2788
  Object.defineProperty(l, "_zod", {
2763
2789
  value: l._zod ?? {},
@@ -2767,52 +2793,52 @@ function Ue(t, e, r) {
2767
2793
  g in l || Object.defineProperty(l, g, { value: c.prototype[g].bind(l) });
2768
2794
  l._zod.constr = c, l._zod.def = d;
2769
2795
  }
2770
- const s = (r == null ? void 0 : r.Parent) ?? Object;
2771
- class i extends s {
2796
+ const a = (r == null ? void 0 : r.Parent) ?? Object;
2797
+ class i extends a {
2772
2798
  }
2773
2799
  Object.defineProperty(i, "name", { value: t });
2774
2800
  function c(l) {
2775
2801
  var d;
2776
2802
  const u = r != null && r.Parent ? new i() : this;
2777
- a(u, l), (d = u._zod).deferred ?? (d.deferred = []);
2803
+ s(u, l), (d = u._zod).deferred ?? (d.deferred = []);
2778
2804
  for (const g of u._zod.deferred)
2779
2805
  g();
2780
2806
  return u;
2781
2807
  }
2782
- return Object.defineProperty(c, "init", { value: a }), Object.defineProperty(c, Symbol.hasInstance, {
2808
+ return Object.defineProperty(c, "init", { value: s }), Object.defineProperty(c, Symbol.hasInstance, {
2783
2809
  value: (l) => {
2784
2810
  var d, u;
2785
2811
  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);
2786
2812
  }
2787
2813
  }), Object.defineProperty(c, "name", { value: t }), c;
2788
2814
  }
2789
- class nr extends Error {
2815
+ class ir extends Error {
2790
2816
  constructor() {
2791
2817
  super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
2792
2818
  }
2793
2819
  }
2794
- const ar = {};
2795
- function Ke(t) {
2796
- return ar;
2820
+ const or = {};
2821
+ function He(t) {
2822
+ return or;
2797
2823
  }
2798
- function sr(t, e) {
2824
+ function lr(t, e) {
2799
2825
  return typeof e == "bigint" ? e.toString() : e;
2800
2826
  }
2801
- const qe = Error.captureStackTrace ? Error.captureStackTrace : (...t) => {
2827
+ const Ve = Error.captureStackTrace ? Error.captureStackTrace : (...t) => {
2802
2828
  };
2803
- function we(t) {
2829
+ function ve(t) {
2804
2830
  return typeof t == "string" ? t : t == null ? void 0 : t.message;
2805
2831
  }
2806
- function He(t, e, r) {
2807
- var s, i, c, l, d, u;
2808
- const a = { ...t, path: t.path ?? [] };
2832
+ function Ye(t, e, r) {
2833
+ var a, i, c, l, d, u;
2834
+ const s = { ...t, path: t.path ?? [] };
2809
2835
  if (!t.message) {
2810
- const g = we((c = (i = (s = t.inst) == null ? void 0 : s._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";
2811
- a.message = g;
2836
+ const g = ve((c = (i = (a = t.inst) == null ? void 0 : a._zod.def) == null ? void 0 : i.error) == null ? void 0 : c.call(i, t)) ?? ve((l = e == null ? void 0 : e.error) == null ? void 0 : l.call(e, t)) ?? ve((d = r.customError) == null ? void 0 : d.call(r, t)) ?? ve((u = r.localeError) == null ? void 0 : u.call(r, t)) ?? "Invalid input";
2837
+ s.message = g;
2812
2838
  }
2813
- return delete a.inst, delete a.continue, e != null && e.reportInput || delete a.input, a;
2839
+ return delete s.inst, delete s.continue, e != null && e.reportInput || delete s.input, s;
2814
2840
  }
2815
- const Ve = (t, e) => {
2841
+ const We = (t, e) => {
2816
2842
  t.name = "$ZodError", Object.defineProperty(t, "_zod", {
2817
2843
  value: t._zod,
2818
2844
  enumerable: !1
@@ -2821,7 +2847,7 @@ const Ve = (t, e) => {
2821
2847
  enumerable: !1
2822
2848
  }), Object.defineProperty(t, "message", {
2823
2849
  get() {
2824
- return JSON.stringify(e, sr, 2);
2850
+ return JSON.stringify(e, lr, 2);
2825
2851
  },
2826
2852
  enumerable: !0
2827
2853
  // configurable: false,
@@ -2829,101 +2855,101 @@ const Ve = (t, e) => {
2829
2855
  value: () => t.message,
2830
2856
  enumerable: !1
2831
2857
  });
2832
- }, ir = Ue("$ZodError", Ve), Ye = Ue("$ZodError", Ve, { Parent: Error }), or = (t) => (e, r, a, s) => {
2833
- const i = a ? Object.assign(a, { async: !1 }) : { async: !1 }, c = e._zod.run({ value: r, issues: [] }, i);
2858
+ }, cr = qe("$ZodError", We), Qe = qe("$ZodError", We, { Parent: Error }), dr = (t) => (e, r, s, a) => {
2859
+ const i = s ? Object.assign(s, { async: !1 }) : { async: !1 }, c = e._zod.run({ value: r, issues: [] }, i);
2834
2860
  if (c instanceof Promise)
2835
- throw new nr();
2861
+ throw new ir();
2836
2862
  if (c.issues.length) {
2837
- const l = new ((s == null ? void 0 : s.Err) ?? t)(c.issues.map((d) => He(d, i, Ke())));
2838
- throw qe(l, s == null ? void 0 : s.callee), l;
2863
+ const l = new ((a == null ? void 0 : a.Err) ?? t)(c.issues.map((d) => Ye(d, i, He())));
2864
+ throw Ve(l, a == null ? void 0 : a.callee), l;
2839
2865
  }
2840
2866
  return c.value;
2841
- }, lr = /* @__PURE__ */ or(Ye), cr = (t) => async (e, r, a, s) => {
2842
- const i = a ? Object.assign(a, { async: !0 }) : { async: !0 };
2867
+ }, ur = /* @__PURE__ */ dr(Qe), mr = (t) => async (e, r, s, a) => {
2868
+ const i = s ? Object.assign(s, { async: !0 }) : { async: !0 };
2843
2869
  let c = e._zod.run({ value: r, issues: [] }, i);
2844
2870
  if (c instanceof Promise && (c = await c), c.issues.length) {
2845
- const l = new ((s == null ? void 0 : s.Err) ?? t)(c.issues.map((d) => He(d, i, Ke())));
2846
- throw qe(l, s == null ? void 0 : s.callee), l;
2871
+ const l = new ((a == null ? void 0 : a.Err) ?? t)(c.issues.map((d) => Ye(d, i, He())));
2872
+ throw Ve(l, a == null ? void 0 : a.callee), l;
2847
2873
  }
2848
2874
  return c.value;
2849
- }, dr = /* @__PURE__ */ cr(Ye);
2850
- function Me(t, e) {
2875
+ }, hr = /* @__PURE__ */ mr(Qe);
2876
+ function Oe(t, e) {
2851
2877
  try {
2852
2878
  var r = t();
2853
- } catch (a) {
2854
- return e(a);
2879
+ } catch (s) {
2880
+ return e(s);
2855
2881
  }
2856
2882
  return r && r.then ? r.then(void 0, e) : r;
2857
2883
  }
2858
- function ur(t, e) {
2884
+ function pr(t, e) {
2859
2885
  for (var r = {}; t.length; ) {
2860
- var a = t[0], s = a.code, i = a.message, c = a.path.join(".");
2861
- if (!r[c]) if ("unionErrors" in a) {
2862
- var l = a.unionErrors[0].errors[0];
2886
+ var s = t[0], a = s.code, i = s.message, c = s.path.join(".");
2887
+ if (!r[c]) if ("unionErrors" in s) {
2888
+ var l = s.unionErrors[0].errors[0];
2863
2889
  r[c] = { message: l.message, type: l.code };
2864
- } else r[c] = { message: i, type: s };
2865
- if ("unionErrors" in a && a.unionErrors.forEach(function(g) {
2890
+ } else r[c] = { message: i, type: a };
2891
+ if ("unionErrors" in s && s.unionErrors.forEach(function(g) {
2866
2892
  return g.errors.forEach(function(p) {
2867
2893
  return t.push(p);
2868
2894
  });
2869
2895
  }), e) {
2870
- var d = r[c].types, u = d && d[a.code];
2871
- r[c] = $e(c, e, r, s, u ? [].concat(u, a.message) : a.message);
2896
+ var d = r[c].types, u = d && d[s.code];
2897
+ r[c] = _e(c, e, r, a, u ? [].concat(u, s.message) : s.message);
2872
2898
  }
2873
2899
  t.shift();
2874
2900
  }
2875
2901
  return r;
2876
2902
  }
2877
- function mr(t, e) {
2903
+ function gr(t, e) {
2878
2904
  for (var r = {}; t.length; ) {
2879
- var a = t[0], s = a.code, i = a.message, c = a.path.join(".");
2880
- if (!r[c]) if (a.code === "invalid_union" && a.errors.length > 0) {
2881
- var l = a.errors[0][0];
2905
+ var s = t[0], a = s.code, i = s.message, c = s.path.join(".");
2906
+ if (!r[c]) if (s.code === "invalid_union" && s.errors.length > 0) {
2907
+ var l = s.errors[0][0];
2882
2908
  r[c] = { message: l.message, type: l.code };
2883
- } else r[c] = { message: i, type: s };
2884
- if (a.code === "invalid_union" && a.errors.forEach(function(g) {
2909
+ } else r[c] = { message: i, type: a };
2910
+ if (s.code === "invalid_union" && s.errors.forEach(function(g) {
2885
2911
  return g.forEach(function(p) {
2886
2912
  return t.push(p);
2887
2913
  });
2888
2914
  }), e) {
2889
- var d = r[c].types, u = d && d[a.code];
2890
- r[c] = $e(c, e, r, s, u ? [].concat(u, a.message) : a.message);
2915
+ var d = r[c].types, u = d && d[s.code];
2916
+ r[c] = _e(c, e, r, a, u ? [].concat(u, s.message) : s.message);
2891
2917
  }
2892
2918
  t.shift();
2893
2919
  }
2894
2920
  return r;
2895
2921
  }
2896
- function We(t, e, r) {
2897
- if (r === void 0 && (r = {}), function(a) {
2898
- return "_def" in a && typeof a._def == "object" && "typeName" in a._def;
2899
- }(t)) return function(a, s, i) {
2922
+ function Ge(t, e, r) {
2923
+ if (r === void 0 && (r = {}), function(s) {
2924
+ return "_def" in s && typeof s._def == "object" && "typeName" in s._def;
2925
+ }(t)) return function(s, a, i) {
2900
2926
  try {
2901
- return Promise.resolve(Me(function() {
2902
- return Promise.resolve(t[r.mode === "sync" ? "parse" : "parseAsync"](a, e)).then(function(c) {
2903
- return i.shouldUseNativeValidation && Ie({}, i), { errors: {}, values: r.raw ? Object.assign({}, a) : c };
2927
+ return Promise.resolve(Oe(function() {
2928
+ return Promise.resolve(t[r.mode === "sync" ? "parse" : "parseAsync"](s, e)).then(function(c) {
2929
+ return i.shouldUseNativeValidation && Re({}, i), { errors: {}, values: r.raw ? Object.assign({}, s) : c };
2904
2930
  });
2905
2931
  }, function(c) {
2906
2932
  if (function(l) {
2907
2933
  return Array.isArray(l == null ? void 0 : l.issues);
2908
- }(c)) return { values: {}, errors: Le(ur(c.errors, !i.shouldUseNativeValidation && i.criteriaMode === "all"), i) };
2934
+ }(c)) return { values: {}, errors: Me(pr(c.errors, !i.shouldUseNativeValidation && i.criteriaMode === "all"), i) };
2909
2935
  throw c;
2910
2936
  }));
2911
2937
  } catch (c) {
2912
2938
  return Promise.reject(c);
2913
2939
  }
2914
2940
  };
2915
- if (function(a) {
2916
- return "_zod" in a && typeof a._zod == "object";
2917
- }(t)) return function(a, s, i) {
2941
+ if (function(s) {
2942
+ return "_zod" in s && typeof s._zod == "object";
2943
+ }(t)) return function(s, a, i) {
2918
2944
  try {
2919
- return Promise.resolve(Me(function() {
2920
- return Promise.resolve((r.mode === "sync" ? lr : dr)(t, a, e)).then(function(c) {
2921
- return i.shouldUseNativeValidation && Ie({}, i), { errors: {}, values: r.raw ? Object.assign({}, a) : c };
2945
+ return Promise.resolve(Oe(function() {
2946
+ return Promise.resolve((r.mode === "sync" ? ur : hr)(t, s, e)).then(function(c) {
2947
+ return i.shouldUseNativeValidation && Re({}, i), { errors: {}, values: r.raw ? Object.assign({}, s) : c };
2922
2948
  });
2923
2949
  }, function(c) {
2924
2950
  if (function(l) {
2925
- return l instanceof ir;
2926
- }(c)) return { values: {}, errors: Le(mr(c.issues, !i.shouldUseNativeValidation && i.criteriaMode === "all"), i) };
2951
+ return l instanceof cr;
2952
+ }(c)) return { values: {}, errors: Me(gr(c.issues, !i.shouldUseNativeValidation && i.criteriaMode === "all"), i) };
2927
2953
  throw c;
2928
2954
  }));
2929
2955
  } catch (c) {
@@ -2932,12 +2958,12 @@ function We(t, e, r) {
2932
2958
  };
2933
2959
  throw new Error("Invalid input: not a Zod schema");
2934
2960
  }
2935
- function hr(t) {
2961
+ function yr(t) {
2936
2962
  return de.object({
2937
2963
  questionResults: de.any()
2938
2964
  }).passthrough();
2939
2965
  }
2940
- function pr(t) {
2966
+ function fr(t) {
2941
2967
  let e = de.array(de.instanceof(File));
2942
2968
  if (t.isRequired ? e = e.min(
2943
2969
  1,
@@ -2946,137 +2972,137 @@ function pr(t) {
2946
2972
  (r) => !r || r.length <= 1,
2947
2973
  { message: "Only one file is allowed" }
2948
2974
  )), t.maxEachFileSizeByte > 0 && (e = e.refine(
2949
- (r) => !r || r.every((a) => a.size <= t.maxEachFileSizeByte),
2975
+ (r) => !r || r.every((s) => s.size <= t.maxEachFileSizeByte),
2950
2976
  { message: `File size must not exceed ${Math.round(t.maxEachFileSizeByte / 1024 / 1024)}MB` }
2951
2977
  )), t.allowedTypes) {
2952
- const r = t.allowedTypes.split(",").map((a) => a.trim());
2978
+ const r = t.allowedTypes.split(",").map((s) => s.trim());
2953
2979
  e = e.refine(
2954
- (a) => a ? a.every(
2955
- (s) => r.some((i) => i.endsWith("/*") ? s.type.startsWith(i.slice(0, -2)) : s.type === i)
2980
+ (s) => s ? s.every(
2981
+ (a) => r.some((i) => i.endsWith("/*") ? a.type.startsWith(i.slice(0, -2)) : a.type === i)
2956
2982
  ) : !0,
2957
2983
  { message: "Invalid file type" }
2958
2984
  );
2959
2985
  }
2960
2986
  return e;
2961
2987
  }
2962
- function _r(t) {
2988
+ function qr(t) {
2963
2989
  const e = {};
2964
2990
  return t.uploadDocumentFiles.forEach((r) => {
2965
- const a = `file_${r.id}`;
2966
- e[a] = pr(r);
2991
+ const s = `file_${r.id}`;
2992
+ e[s] = fr(r);
2967
2993
  }), de.object(e);
2968
2994
  }
2969
- function gr(t) {
2995
+ function br(t) {
2970
2996
  return de.any();
2971
2997
  }
2972
- function yr(t) {
2998
+ function xr(t) {
2973
2999
  return de.string().min(1, "This question is required");
2974
3000
  }
2975
- function jr(t) {
3001
+ function Hr(t) {
2976
3002
  const e = {};
2977
3003
  return t.appropriatenessQuestions.forEach((r) => {
2978
- const a = `question_${r.id}`;
2979
- e[a] = yr();
3004
+ const s = `question_${r.id}`;
3005
+ e[s] = xr();
2980
3006
  }), de.object(e);
2981
3007
  }
2982
- const Ur = de.any(), fr = ({
3008
+ const Vr = de.any(), vr = ({
2983
3009
  applicantId: t,
2984
3010
  onComplete: e,
2985
3011
  onBack: r
2986
3012
  }) => {
2987
- const { questionnaire: a, isLoading: s, isSubmitting: i, error: c, submit: l } = Wt(t), d = Oe(() => a ? { questionResults: a.questionGroups.map(
2988
- (x) => x.questions.map((R) => ({
2989
- questionId: R.id,
3013
+ const { questionnaire: s, isLoading: a, isSubmitting: i, error: c, submit: l } = Zt(t), d = $e(() => s ? { questionResults: s.questionGroups.map(
3014
+ (b) => b.questions.map((F) => ({
3015
+ questionId: F.id,
2990
3016
  values: []
2991
3017
  }))
2992
- ) } : { questionResults: [] }, [a]), u = a ? hr() : null, {
3018
+ ) } : { questionResults: [] }, [s]), u = s ? yr() : null, {
2993
3019
  control: g,
2994
3020
  handleSubmit: p,
2995
3021
  formState: { errors: m }
2996
- } = De({
2997
- resolver: u ? We(u) : void 0,
3022
+ } = Pe({
3023
+ resolver: u ? Ge(u) : void 0,
2998
3024
  defaultValues: d
2999
- }), b = async (y) => {
3000
- if (a)
3025
+ }), f = async (y) => {
3026
+ if (s)
3001
3027
  try {
3002
3028
  console.log("Form submitted with data:", y);
3003
- const x = a.questionGroups.flatMap(
3004
- (h, N) => h.questions.map((w, E) => {
3005
- var F, M, I;
3029
+ const b = s.questionGroups.flatMap(
3030
+ (h, N) => h.questions.map((w, I) => {
3031
+ var P, L, R;
3006
3032
  return {
3007
3033
  questionId: w.id,
3008
- values: ((I = (M = (F = y.questionResults) == null ? void 0 : F[N]) == null ? void 0 : M[E]) == null ? void 0 : I.values) || []
3034
+ values: ((R = (L = (P = y.questionResults) == null ? void 0 : P[N]) == null ? void 0 : L[I]) == null ? void 0 : R.values) || []
3009
3035
  };
3010
3036
  })
3011
3037
  );
3012
- console.log("Question results to submit:", x);
3013
- const R = {
3038
+ console.log("Question results to submit:", b);
3039
+ const F = {
3014
3040
  applicantId: t,
3015
- questionnarieId: a.id,
3016
- questionResults: x
3041
+ questionnarieId: s.id,
3042
+ questionResults: b
3017
3043
  };
3018
- console.log("Final input:", R), await l(R), e == null || e();
3019
- } catch (x) {
3020
- console.error("Error submitting questionnaire:", x);
3044
+ console.log("Final input:", F), await l(F), e == null || e();
3045
+ } catch (b) {
3046
+ console.error("Error submitting questionnaire:", b);
3021
3047
  }
3022
3048
  };
3023
- return s ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(se, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3049
+ 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: [
3024
3050
  "Error loading questionnaire: ",
3025
3051
  c.message
3026
- ] }) }) }) : a ? /* @__PURE__ */ n("form", { onSubmit: p(b), children: /* @__PURE__ */ o(L, { children: [
3027
- /* @__PURE__ */ o(Z, { children: [
3028
- /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: a.displayName }),
3029
- a.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.subtitle })
3052
+ ] }) }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: p(f), children: /* @__PURE__ */ o(T, { children: [
3053
+ /* @__PURE__ */ o(J, { children: [
3054
+ /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: s.displayName }),
3055
+ s.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: s.subtitle })
3030
3056
  ] }),
3031
- /* @__PURE__ */ n(T, { className: "space-y-8", children: a.questionGroups.flatMap(
3032
- (y, x) => y.questions.map((R, h) => {
3033
- const w = R.defaultAnswers && R.defaultAnswers.length > 0 ? R.showAsDropdown ? R.canMultipleAnswer ? "multi-select" : "single-select" : R.canMultipleAnswer ? "checkbox" : "radio" : "text";
3057
+ /* @__PURE__ */ n(M, { className: "space-y-8", children: s.questionGroups.flatMap(
3058
+ (y, b) => y.questions.map((F, h) => {
3059
+ const w = F.defaultAnswers && F.defaultAnswers.length > 0 ? F.showAsDropdown ? F.canMultipleAnswer ? "multi-select" : "single-select" : F.canMultipleAnswer ? "checkbox" : "radio" : "text";
3034
3060
  return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3035
3061
  /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300", children: [
3036
- R.text,
3037
- R.isRequired && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
3062
+ F.text,
3063
+ F.isRequired && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
3038
3064
  ] }),
3039
3065
  w === "text" && /* @__PURE__ */ n(
3040
- Q,
3066
+ G,
3041
3067
  {
3042
3068
  control: g,
3043
- name: `questionResults.${x}.${h}.values.0`,
3044
- render: ({ field: E }) => {
3045
- var F, M, I, A;
3069
+ name: `questionResults.${b}.${h}.values.0`,
3070
+ render: ({ field: I }) => {
3071
+ var P, L, R, C;
3046
3072
  return /* @__PURE__ */ n(
3047
- G,
3073
+ Z,
3048
3074
  {
3049
- value: E.value || "",
3050
- onChange: E.onChange,
3051
- onBlur: E.onBlur,
3052
- name: E.name,
3075
+ value: I.value || "",
3076
+ onChange: I.onChange,
3077
+ onBlur: I.onBlur,
3078
+ name: I.name,
3053
3079
  placeholder: "Enter your answer...",
3054
- error: (A = (I = (M = (F = m.questionResults) == null ? void 0 : F[x]) == null ? void 0 : M[h]) == null ? void 0 : I.values) == null ? void 0 : A.message
3080
+ error: (C = (R = (L = (P = m.questionResults) == null ? void 0 : P[b]) == null ? void 0 : L[h]) == null ? void 0 : R.values) == null ? void 0 : C.message
3055
3081
  }
3056
3082
  );
3057
3083
  }
3058
3084
  }
3059
3085
  ),
3060
3086
  (w === "single-select" || w === "radio") && /* @__PURE__ */ n(
3061
- Q,
3087
+ G,
3062
3088
  {
3063
3089
  control: g,
3064
- name: `questionResults.${x}.${h}.values.0`,
3065
- render: ({ field: E }) => {
3066
- var F, M, I, A;
3090
+ name: `questionResults.${b}.${h}.values.0`,
3091
+ render: ({ field: I }) => {
3092
+ var P, L, R, C;
3067
3093
  return /* @__PURE__ */ n(
3068
- ye,
3094
+ ge,
3069
3095
  {
3070
- value: E.value || "",
3071
- onChange: E.onChange,
3072
- onBlur: E.onBlur,
3073
- name: E.name,
3074
- options: R.defaultAnswers.map((B) => ({
3096
+ value: I.value || "",
3097
+ onChange: I.onChange,
3098
+ onBlur: I.onBlur,
3099
+ name: I.name,
3100
+ options: F.defaultAnswers.map((B) => ({
3075
3101
  value: B,
3076
3102
  label: B
3077
3103
  })),
3078
3104
  placeholder: "Select an option...",
3079
- error: (A = (I = (M = (F = m.questionResults) == null ? void 0 : F[x]) == null ? void 0 : M[h]) == null ? void 0 : I.values) == null ? void 0 : A.message
3105
+ error: (C = (R = (L = (P = m.questionResults) == null ? void 0 : P[b]) == null ? void 0 : L[h]) == null ? void 0 : R.values) == null ? void 0 : C.message
3080
3106
  }
3081
3107
  );
3082
3108
  }
@@ -3085,11 +3111,11 @@ const Ur = de.any(), fr = ({
3085
3111
  (w === "checkbox" || w === "multi-select") && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3086
3112
  /* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400 mb-2", children: "Choose one or more options" }),
3087
3113
  /* @__PURE__ */ n(
3088
- Q,
3114
+ G,
3089
3115
  {
3090
3116
  control: g,
3091
- name: `questionResults.${x}.${h}.values`,
3092
- render: ({ field: { value: E = [], onChange: F } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: R.defaultAnswers.map((M, I) => /* @__PURE__ */ o(
3117
+ name: `questionResults.${b}.${h}.values`,
3118
+ render: ({ field: { value: I = [], onChange: P } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: F.defaultAnswers.map((L, R) => /* @__PURE__ */ o(
3093
3119
  "label",
3094
3120
  {
3095
3121
  className: "flex items-center space-x-2 cursor-pointer",
@@ -3098,29 +3124,29 @@ const Ur = de.any(), fr = ({
3098
3124
  "input",
3099
3125
  {
3100
3126
  type: "checkbox",
3101
- checked: Array.isArray(E) && E.includes(M),
3102
- onChange: (A) => {
3103
- const B = Array.isArray(E) ? E : [], z = A.target.checked ? [...B, M] : B.filter((f) => f !== M);
3104
- F(z);
3127
+ checked: Array.isArray(I) && I.includes(L),
3128
+ onChange: (C) => {
3129
+ const B = Array.isArray(I) ? I : [], z = C.target.checked ? [...B, L] : B.filter((v) => v !== L);
3130
+ P(z);
3105
3131
  },
3106
3132
  className: "h-4 w-4 text-primary-500 rounded border-gray-300 focus:ring-primary-500"
3107
3133
  }
3108
3134
  ),
3109
- /* @__PURE__ */ n("span", { className: "text-sm", children: M })
3135
+ /* @__PURE__ */ n("span", { className: "text-sm", children: L })
3110
3136
  ]
3111
3137
  },
3112
- `answer-${x}-${h}-${I}`
3138
+ `answer-${b}-${h}-${R}`
3113
3139
  )) })
3114
3140
  }
3115
3141
  )
3116
3142
  ] })
3117
- ] }, R.id);
3143
+ ] }, F.id);
3118
3144
  })
3119
3145
  ) }),
3120
3146
  /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3121
- r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3147
+ r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3122
3148
  /* @__PURE__ */ n(
3123
- _,
3149
+ j,
3124
3150
  {
3125
3151
  type: "submit",
3126
3152
  isLoading: i,
@@ -3136,43 +3162,43 @@ const Ur = de.any(), fr = ({
3136
3162
  c.message
3137
3163
  ] }) })
3138
3164
  ] }) }) : null;
3139
- }, br = ({
3165
+ }, wr = ({
3140
3166
  applicantId: t,
3141
3167
  onComplete: e,
3142
3168
  onBack: r
3143
3169
  }) => {
3144
- const { uploadDocument: a, isLoading: s, isSubmitting: i, error: c, submit: l } = Qt(t), [d, u] = v({}), g = async (p) => {
3145
- if (p.preventDefault(), !a) return;
3170
+ const { uploadDocument: s, isLoading: a, isSubmitting: i, error: c, submit: l } = Jt(t), [d, u] = x({}), g = async (p) => {
3171
+ if (p.preventDefault(), !s) return;
3146
3172
  const m = await Promise.all(
3147
- a.uploadDocumentFiles.map(async (y) => {
3148
- const x = d[y.id] || [], R = await Promise.all(
3149
- x.map(async (h) => ({
3173
+ s.uploadDocumentFiles.map(async (y) => {
3174
+ const b = d[y.id] || [], F = await Promise.all(
3175
+ b.map(async (h) => ({
3150
3176
  fileName: h.name,
3151
- fileData: await jt(h)
3177
+ fileData: await qt(h)
3152
3178
  }))
3153
3179
  );
3154
3180
  return {
3155
3181
  uploadDocumentFileId: y.id,
3156
- valueList: R
3182
+ valueList: F
3157
3183
  };
3158
3184
  })
3159
- ), b = {
3185
+ ), f = {
3160
3186
  applicantId: t,
3161
- uploadDocumentId: a.id,
3187
+ uploadDocumentId: s.id,
3162
3188
  uploadDocumentResults: m
3163
3189
  };
3164
- await l(b), e == null || e();
3190
+ await l(f), e == null || e();
3165
3191
  };
3166
- return s ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(se, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3192
+ 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: [
3167
3193
  "Error loading document requirements: ",
3168
3194
  c.message
3169
- ] }) }) }) : a ? /* @__PURE__ */ n("form", { onSubmit: g, children: /* @__PURE__ */ o(L, { children: [
3170
- /* @__PURE__ */ o(Z, { children: [
3171
- /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: a.displayName }),
3172
- a.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.subtitle })
3195
+ ] }) }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: g, children: /* @__PURE__ */ o(T, { children: [
3196
+ /* @__PURE__ */ o(J, { children: [
3197
+ /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: s.displayName }),
3198
+ s.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: s.subtitle })
3173
3199
  ] }),
3174
- /* @__PURE__ */ n(T, { className: "space-y-6", children: a.uploadDocumentFiles.map((p) => /* @__PURE__ */ n(
3175
- er,
3200
+ /* @__PURE__ */ n(M, { className: "space-y-6", children: s.uploadDocumentFiles.map((p) => /* @__PURE__ */ n(
3201
+ nr,
3176
3202
  {
3177
3203
  label: p.displayName,
3178
3204
  accept: p.allowedTypes,
@@ -3180,30 +3206,30 @@ const Ur = de.any(), fr = ({
3180
3206
  maxSize: p.maxEachFileSizeByte,
3181
3207
  value: d[p.id] || [],
3182
3208
  onChange: (m) => {
3183
- u((b) => ({ ...b, [p.id]: m }));
3209
+ u((f) => ({ ...f, [p.id]: m }));
3184
3210
  }
3185
3211
  },
3186
3212
  p.id
3187
3213
  )) }),
3188
3214
  /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3189
- r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3190
- /* @__PURE__ */ n(_, { type: "submit", isLoading: i, children: "Continue" })
3215
+ r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3216
+ /* @__PURE__ */ n(j, { type: "submit", isLoading: i, children: "Continue" })
3191
3217
  ] })
3192
3218
  ] }) }) : null;
3193
- }, xr = ({ applicantId: t, onComplete: e, onBack: r }) => {
3194
- const { overview: a, isLoading: s, isSubmitting: i, error: c, passOverview: l } = Gt(t), d = async () => {
3219
+ }, kr = ({ applicantId: t, onComplete: e, onBack: r }) => {
3220
+ const { overview: s, isLoading: a, isSubmitting: i, error: c, passOverview: l } = Xt(t), d = async () => {
3195
3221
  await l(), e == null || e();
3196
3222
  };
3197
- return s ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(se, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3223
+ 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: [
3198
3224
  "Error loading overview: ",
3199
3225
  c.message
3200
- ] }) }) }) : a ? /* @__PURE__ */ o(L, { children: [
3201
- /* @__PURE__ */ o(Z, { children: [
3202
- /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: a.title || "Overview" }),
3203
- a.description && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.description })
3226
+ ] }) }) }) : s ? /* @__PURE__ */ o(T, { children: [
3227
+ /* @__PURE__ */ o(J, { children: [
3228
+ /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: s.title || "Overview" }),
3229
+ s.description && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: s.description })
3204
3230
  ] }),
3205
- /* @__PURE__ */ o(T, { className: "space-y-6", children: [
3206
- a.steps && a.steps.length > 0 ? /* @__PURE__ */ n("div", { className: "space-y-4", children: a.steps.sort((u, g) => u.order - g.order).map((u) => /* @__PURE__ */ n(
3231
+ /* @__PURE__ */ o(M, { className: "space-y-6", children: [
3232
+ 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(
3207
3233
  "div",
3208
3234
  {
3209
3235
  className: "border border-gray-200 dark:border-gray-700 rounded-lg p-4 bg-gray-50 dark:bg-gray-800",
@@ -3217,49 +3243,49 @@ const Ur = de.any(), fr = ({
3217
3243
  },
3218
3244
  u.order
3219
3245
  )) }) : /* @__PURE__ */ n("div", { className: "text-center py-8", children: /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Loading overview data..." }) }),
3220
- a.steps && a.steps.length > 0 && /* @__PURE__ */ n("div", { className: "mt-6 p-4 bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-green-800 dark:text-green-300 text-sm", children: [
3246
+ s.steps && s.steps.length > 0 && /* @__PURE__ */ n("div", { className: "mt-6 p-4 bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-green-800 dark:text-green-300 text-sm", children: [
3221
3247
  /* @__PURE__ */ n("strong", { children: "✓ All steps completed!" }),
3222
3248
  " Review the information above and confirm to proceed."
3223
3249
  ] }) })
3224
3250
  ] }),
3225
3251
  /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3226
- r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3227
- /* @__PURE__ */ n(_, { onClick: d, isLoading: i, children: "Confirm and Continue" })
3252
+ r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3253
+ /* @__PURE__ */ n(j, { onClick: d, isLoading: i, children: "Confirm and Continue" })
3228
3254
  ] })
3229
3255
  ] }) : null;
3230
- }, vr = ({
3256
+ }, Nr = ({
3231
3257
  applicantId: t,
3232
3258
  onComplete: e,
3233
3259
  onBack: r
3234
3260
  }) => {
3235
- const { criteria: a, isLoading: s, isSubmitting: i, error: c, submit: l } = Jt(t), [d, u] = ce.useState(!1), g = ce.useMemo(() => !a || a.length === 0 ? { criteriaValueInputs: [] } : {
3236
- criteriaValueInputs: a.map((h) => ({
3261
+ 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: [] } : {
3262
+ criteriaValueInputs: s.map((h) => ({
3237
3263
  riskCriteriaId: h.id,
3238
3264
  values: [""]
3239
3265
  // Initialize with empty string to prevent uncontrolled input warning
3240
3266
  }))
3241
- }, [a]), p = a && a.length > 0 ? gr() : null, {
3267
+ }, [s]), p = s && s.length > 0 ? br() : null, {
3242
3268
  control: m,
3243
- handleSubmit: b,
3269
+ handleSubmit: f,
3244
3270
  formState: { errors: y }
3245
- } = De({
3246
- resolver: p ? We(p) : void 0,
3271
+ } = Pe({
3272
+ resolver: p ? Ge(p) : void 0,
3247
3273
  defaultValues: g
3248
3274
  });
3249
- ce.useEffect(() => {
3250
- !s && a && a.length === 0 && !d && !i && (u(!0), l({ applicantId: t, criteriaValueInputs: [] }).then(() => e == null ? void 0 : e()).catch(console.error));
3251
- }, [s, a, d, i, l, t, e]);
3252
- const x = async (h) => {
3253
- if (a)
3275
+ le.useEffect(() => {
3276
+ !a && s && s.length === 0 && !d && !i && (u(!0), l({ applicantId: t, criteriaValueInputs: [] }).then(() => e == null ? void 0 : e()).catch(console.error));
3277
+ }, [a, s, d, i, l, t, e]);
3278
+ const b = async (h) => {
3279
+ if (s)
3254
3280
  try {
3255
- console.log("Risk scoring form submitted:", h), console.log("Criteria metadata:", a);
3256
- const N = h.criteriaValueInputs.map((E, F) => {
3257
- const M = E.values || [], I = Array.isArray(M) ? M.filter((A) => A && A.trim()) : M && M.toString().trim() ? [M.toString()] : [];
3258
- return I.length === 0 ? null : {
3259
- riskCriteriaId: a[F].id,
3260
- values: I
3281
+ console.log("Risk scoring form submitted:", h), console.log("Criteria metadata:", s);
3282
+ const N = h.criteriaValueInputs.map((I, P) => {
3283
+ const L = I.values || [], R = Array.isArray(L) ? L.filter((C) => C && C.trim()) : L && L.toString().trim() ? [L.toString()] : [];
3284
+ return R.length === 0 ? null : {
3285
+ riskCriteriaId: s[P].id,
3286
+ values: R
3261
3287
  };
3262
- }).filter((E) => E !== null);
3288
+ }).filter((I) => I !== null);
3263
3289
  console.log("Risk scoring criteriaValueInputs to submit:", N);
3264
3290
  const w = {
3265
3291
  applicantId: t,
@@ -3269,24 +3295,24 @@ const Ur = de.any(), fr = ({
3269
3295
  } catch (N) {
3270
3296
  throw console.error("Error submitting risk scoring:", N), N;
3271
3297
  }
3272
- }, R = (h) => h.builtInType === 1 ? "country" : !h.defaultValues || h.defaultValues.length === 0 ? "text" : h.multipleValue ? "checkbox" : "radio";
3273
- return s ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
3274
- /* @__PURE__ */ n(se, { className: "my-8" }),
3298
+ }, F = (h) => h.builtInType === 1 ? "country" : !h.defaultValues || h.defaultValues.length === 0 ? "text" : h.multipleValue ? "checkbox" : "radio";
3299
+ return a ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
3300
+ /* @__PURE__ */ n(ie, { className: "my-8" }),
3275
3301
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading risk scoring criteria..." })
3276
- ] }) }) : c ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3302
+ ] }) }) : c ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3277
3303
  "Error loading criteria: ",
3278
3304
  c.message
3279
- ] }) }) }) : !s && a && a.length === 0 ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
3280
- /* @__PURE__ */ n(se, { className: "my-8" }),
3305
+ ] }) }) }) : !a && s && s.length === 0 ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
3306
+ /* @__PURE__ */ n(ie, { className: "my-8" }),
3281
3307
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400", children: "No risk scoring criteria required. Moving to next step..." })
3282
- ] }) }) : a ? /* @__PURE__ */ n("form", { onSubmit: b(x), children: /* @__PURE__ */ o(L, { children: [
3283
- /* @__PURE__ */ o(Z, { children: [
3308
+ ] }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: f(b), children: /* @__PURE__ */ o(T, { children: [
3309
+ /* @__PURE__ */ o(J, { children: [
3284
3310
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Risk Assessment" }),
3285
3311
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please answer the following questions for risk evaluation" })
3286
3312
  ] }),
3287
- /* @__PURE__ */ n(T, { className: "space-y-8", children: a.map((h, N) => {
3288
- var E, F, M;
3289
- const w = R(h);
3313
+ /* @__PURE__ */ n(M, { className: "space-y-8", children: s.map((h, N) => {
3314
+ var I, P, L;
3315
+ const w = F(h);
3290
3316
  return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3291
3317
  /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300", children: [
3292
3318
  h.displayName,
@@ -3294,22 +3320,22 @@ const Ur = de.any(), fr = ({
3294
3320
  ] }),
3295
3321
  h.description && /* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: h.description }),
3296
3322
  w === "text" && /* @__PURE__ */ n(
3297
- Q,
3323
+ G,
3298
3324
  {
3299
3325
  control: m,
3300
3326
  name: `criteriaValueInputs.${N}.values.0`,
3301
- render: ({ field: I }) => {
3302
- var A, B, z;
3327
+ render: ({ field: R }) => {
3328
+ var C, B, z;
3303
3329
  return /* @__PURE__ */ n(
3304
- G,
3330
+ Z,
3305
3331
  {
3306
- ...I,
3307
- value: I.value || "",
3308
- type: h.valueDataType === Ee.DigitOnly ? "number" : "text",
3332
+ ...R,
3333
+ value: R.value || "",
3334
+ type: h.valueDataType === Ie.DigitOnly ? "number" : "text",
3309
3335
  placeholder: "Enter your answer...",
3310
- error: (z = (B = (A = y.criteriaValueInputs) == null ? void 0 : A[N]) == null ? void 0 : B.values) == null ? void 0 : z.message,
3311
- onKeyDown: (f) => {
3312
- h.valueDataType === Ee.DigitOnly && ["e", "E", "+", "-", "."].includes(f.key) && f.preventDefault();
3336
+ error: (z = (B = (C = y.criteriaValueInputs) == null ? void 0 : C[N]) == null ? void 0 : B.values) == null ? void 0 : z.message,
3337
+ onKeyDown: (v) => {
3338
+ h.valueDataType === Ie.DigitOnly && ["e", "E", "+", "-", "."].includes(v.key) && v.preventDefault();
3313
3339
  }
3314
3340
  }
3315
3341
  );
@@ -3319,17 +3345,17 @@ const Ur = de.any(), fr = ({
3319
3345
  w === "radio" && h.defaultValues && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3320
3346
  /* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: "Choose one option" }),
3321
3347
  /* @__PURE__ */ n(
3322
- Q,
3348
+ G,
3323
3349
  {
3324
3350
  control: m,
3325
3351
  name: `criteriaValueInputs.${N}.values.0`,
3326
- render: ({ field: { value: I, onChange: A } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: h.defaultValues.map((B, z) => /* @__PURE__ */ o("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
3352
+ render: ({ field: { value: R, onChange: C } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: h.defaultValues.map((B, z) => /* @__PURE__ */ o("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
3327
3353
  /* @__PURE__ */ n(
3328
3354
  "input",
3329
3355
  {
3330
3356
  type: "radio",
3331
- checked: I === B,
3332
- onChange: () => A(B),
3357
+ checked: R === B,
3358
+ onChange: () => C(B),
3333
3359
  className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
3334
3360
  }
3335
3361
  ),
@@ -3341,19 +3367,19 @@ const Ur = de.any(), fr = ({
3341
3367
  w === "checkbox" && h.defaultValues && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3342
3368
  /* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: "Choose one or more options" }),
3343
3369
  /* @__PURE__ */ n(
3344
- Q,
3370
+ G,
3345
3371
  {
3346
3372
  control: m,
3347
3373
  name: `criteriaValueInputs.${N}.values`,
3348
- render: ({ field: { value: I = [], onChange: A } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: h.defaultValues.map((B, z) => /* @__PURE__ */ o("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
3374
+ render: ({ field: { value: R = [], onChange: C } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: h.defaultValues.map((B, z) => /* @__PURE__ */ o("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
3349
3375
  /* @__PURE__ */ n(
3350
3376
  "input",
3351
3377
  {
3352
3378
  type: "checkbox",
3353
- checked: Array.isArray(I) && I.includes(B),
3354
- onChange: (f) => {
3355
- const D = Array.isArray(I) ? I : [], C = f.target.checked ? [...D, B] : D.filter((k) => k !== B);
3356
- A(C);
3379
+ checked: Array.isArray(R) && R.includes(B),
3380
+ onChange: (v) => {
3381
+ const E = Array.isArray(R) ? R : [], A = v.target.checked ? [...E, B] : E.filter((k) => k !== B);
3382
+ C(A);
3357
3383
  },
3358
3384
  className: "h-4 w-4 text-primary-500 rounded border-gray-300 focus:ring-primary-500"
3359
3385
  }
@@ -3364,16 +3390,16 @@ const Ur = de.any(), fr = ({
3364
3390
  )
3365
3391
  ] }),
3366
3392
  w === "country" && /* @__PURE__ */ n(
3367
- Q,
3393
+ G,
3368
3394
  {
3369
3395
  control: m,
3370
3396
  name: `criteriaValueInputs.${N}.values.0`,
3371
- render: ({ field: I }) => {
3372
- var A, B, z;
3397
+ render: ({ field: R }) => {
3398
+ var C, B, z;
3373
3399
  return /* @__PURE__ */ n(
3374
- ye,
3400
+ ge,
3375
3401
  {
3376
- ...I,
3402
+ ...R,
3377
3403
  options: [
3378
3404
  { value: "US", label: "United States" },
3379
3405
  { value: "GB", label: "United Kingdom" },
@@ -3381,19 +3407,19 @@ const Ur = de.any(), fr = ({
3381
3407
  // TODO: Load from base information service
3382
3408
  ],
3383
3409
  placeholder: "Select a country...",
3384
- error: (z = (B = (A = y.criteriaValueInputs) == null ? void 0 : A[N]) == null ? void 0 : B.values) == null ? void 0 : z.message
3410
+ error: (z = (B = (C = y.criteriaValueInputs) == null ? void 0 : C[N]) == null ? void 0 : B.values) == null ? void 0 : z.message
3385
3411
  }
3386
3412
  );
3387
3413
  }
3388
3414
  }
3389
3415
  ),
3390
- ((M = (F = (E = y.criteriaValueInputs) == null ? void 0 : E[N]) == null ? void 0 : F.values) == null ? void 0 : M.message) && /* @__PURE__ */ n("p", { className: "text-sm text-danger-500 mt-1", children: y.criteriaValueInputs[N].values.message })
3416
+ ((L = (P = (I = y.criteriaValueInputs) == null ? void 0 : I[N]) == null ? void 0 : P.values) == null ? void 0 : L.message) && /* @__PURE__ */ n("p", { className: "text-sm text-danger-500 mt-1", children: y.criteriaValueInputs[N].values.message })
3391
3417
  ] }, h.id);
3392
3418
  }) }),
3393
3419
  /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3394
- r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3420
+ r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3395
3421
  /* @__PURE__ */ n(
3396
- _,
3422
+ j,
3397
3423
  {
3398
3424
  type: "submit",
3399
3425
  isLoading: i,
@@ -3409,14 +3435,14 @@ const Ur = de.any(), fr = ({
3409
3435
  c.message
3410
3436
  ] }) })
3411
3437
  ] }) }) : null;
3412
- }, wr = ({
3438
+ }, Sr = ({
3413
3439
  applicantId: t,
3414
3440
  onComplete: e,
3415
3441
  onBack: r
3416
3442
  }) => {
3417
- const { investorCategorizationService: a } = ie(), [s, i] = v(null), [c, l] = v(!1), [d, u] = v(null);
3443
+ const { investorCategorizationService: s } = re(), [a, i] = x(null), [c, l] = x(!1), [d, u] = x(null);
3418
3444
  return /* @__PURE__ */ n("form", { onSubmit: async (p) => {
3419
- if (p.preventDefault(), s === null) {
3445
+ if (p.preventDefault(), a === null) {
3420
3446
  u("Please select an investor type");
3421
3447
  return;
3422
3448
  }
@@ -3424,29 +3450,29 @@ const Ur = de.any(), fr = ({
3424
3450
  try {
3425
3451
  const m = {
3426
3452
  applicantId: t,
3427
- investorType: s
3453
+ investorType: a
3428
3454
  };
3429
3455
  console.log("Submitting investor categorization:", m);
3430
- const b = await a.setInvestorCategorization(m);
3431
- console.log("Investor categorization result:", b), e == null || e();
3456
+ const f = await s.setInvestorCategorization(m);
3457
+ console.log("Investor categorization result:", f), e == null || e();
3432
3458
  } catch (m) {
3433
3459
  console.error("Error submitting investor categorization:", m), u(m.message || "Failed to submit investor categorization");
3434
3460
  } finally {
3435
3461
  l(!1);
3436
3462
  }
3437
- }, children: /* @__PURE__ */ o(L, { children: [
3438
- /* @__PURE__ */ o(Z, { children: [
3463
+ }, children: /* @__PURE__ */ o(T, { children: [
3464
+ /* @__PURE__ */ o(J, { children: [
3439
3465
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Which statement best describes you?" }),
3440
3466
  /* @__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" })
3441
3467
  ] }),
3442
- /* @__PURE__ */ o(T, { className: "space-y-4", children: [
3468
+ /* @__PURE__ */ o(M, { className: "space-y-4", children: [
3443
3469
  /* @__PURE__ */ n("p", { className: "text-sm font-medium text-gray-700 dark:text-gray-300 mb-3", children: "Choose one" }),
3444
3470
  /* @__PURE__ */ n(
3445
3471
  "label",
3446
3472
  {
3447
3473
  className: `
3448
3474
  block p-4 border-2 rounded-lg cursor-pointer transition-all
3449
- ${s === X.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"}
3475
+ ${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"}
3450
3476
  `,
3451
3477
  children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
3452
3478
  /* @__PURE__ */ n(
@@ -3454,9 +3480,9 @@ const Ur = de.any(), fr = ({
3454
3480
  {
3455
3481
  type: "radio",
3456
3482
  name: "investorType",
3457
- value: X.Individual,
3458
- checked: s === X.Individual,
3459
- onChange: () => i(X.Individual),
3483
+ value: ee.Individual,
3484
+ checked: a === ee.Individual,
3485
+ onChange: () => i(ee.Individual),
3460
3486
  className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
3461
3487
  }
3462
3488
  ),
@@ -3472,7 +3498,7 @@ const Ur = de.any(), fr = ({
3472
3498
  {
3473
3499
  className: `
3474
3500
  block p-4 border-2 rounded-lg cursor-pointer transition-all
3475
- ${s === X.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"}
3501
+ ${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"}
3476
3502
  `,
3477
3503
  children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
3478
3504
  /* @__PURE__ */ n(
@@ -3480,9 +3506,9 @@ const Ur = de.any(), fr = ({
3480
3506
  {
3481
3507
  type: "radio",
3482
3508
  name: "investorType",
3483
- value: X.Sophisticated,
3484
- checked: s === X.Sophisticated,
3485
- onChange: () => i(X.Sophisticated),
3509
+ value: ee.Sophisticated,
3510
+ checked: a === ee.Sophisticated,
3511
+ onChange: () => i(ee.Sophisticated),
3486
3512
  className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
3487
3513
  }
3488
3514
  ),
@@ -3503,7 +3529,7 @@ const Ur = de.any(), fr = ({
3503
3529
  {
3504
3530
  className: `
3505
3531
  block p-4 border-2 rounded-lg cursor-pointer transition-all
3506
- ${s === X.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"}
3532
+ ${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"}
3507
3533
  `,
3508
3534
  children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
3509
3535
  /* @__PURE__ */ n(
@@ -3511,9 +3537,9 @@ const Ur = de.any(), fr = ({
3511
3537
  {
3512
3538
  type: "radio",
3513
3539
  name: "investorType",
3514
- value: X.HighNetWorth,
3515
- checked: s === X.HighNetWorth,
3516
- onChange: () => i(X.HighNetWorth),
3540
+ value: ee.HighNetWorth,
3541
+ checked: a === ee.HighNetWorth,
3542
+ onChange: () => i(ee.HighNetWorth),
3517
3543
  className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
3518
3544
  }
3519
3545
  ),
@@ -3535,32 +3561,32 @@ const Ur = de.any(), fr = ({
3535
3561
  ] }) })
3536
3562
  ] }),
3537
3563
  /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3538
- r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3564
+ r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3539
3565
  /* @__PURE__ */ n(
3540
- _,
3566
+ j,
3541
3567
  {
3542
3568
  type: "submit",
3543
3569
  isLoading: c,
3544
- disabled: s === null,
3570
+ disabled: a === null,
3545
3571
  children: "Submit"
3546
3572
  }
3547
3573
  )
3548
3574
  ] })
3549
3575
  ] }) });
3550
- }, kr = ({
3576
+ }, Cr = ({
3551
3577
  applicantId: t,
3552
3578
  onComplete: e,
3553
3579
  onBack: r
3554
3580
  }) => {
3555
- const { appropriatenessTestService: a } = ie(), [s, i] = v(null), [c, l] = v(!0), [d, u] = v(!1), [g, p] = v(null), [m, b] = v({}), [y, x] = v(0), [R, h] = v(!1), [N, w] = v(!1), [E, F] = v(0);
3581
+ const { appropriatenessTestService: s } = re(), [a, i] = x(null), [c, l] = x(!0), [d, u] = x(!1), [g, p] = x(null), [m, f] = x({}), [y, b] = x(0), [F, h] = x(!1), [N, w] = x(!1), [I, P] = x(0);
3556
3582
  V(() => {
3557
3583
  (async () => {
3558
3584
  try {
3559
3585
  l(!0), p(null), console.log("Loading appropriateness test for applicant:", t);
3560
- const k = await a.getAppropriatenessTest(t);
3586
+ const k = await s.getAppropriatenessTest(t);
3561
3587
  if (console.log("Appropriateness test data:", k), i(k), k.waitTimeSpanForNextTry && k.waitTimeSpanForNextTry !== "00:00:00") {
3562
- const S = M(k.waitTimeSpanForNextTry);
3563
- S > 0 && F(S);
3588
+ const S = L(k.waitTimeSpanForNextTry);
3589
+ S > 0 && P(S);
3564
3590
  }
3565
3591
  } catch (k) {
3566
3592
  console.error("Error loading appropriateness test:", k), p(k.message || "Failed to load appropriateness test");
@@ -3568,44 +3594,44 @@ const Ur = de.any(), fr = ({
3568
3594
  l(!1);
3569
3595
  }
3570
3596
  })();
3571
- }, [t, a]);
3572
- const M = (C) => {
3573
- const k = C.split(":").map(Number);
3597
+ }, [t, s]);
3598
+ const L = (A) => {
3599
+ const k = A.split(":").map(Number);
3574
3600
  if (k.length === 3) {
3575
- const [S, j, oe] = k;
3576
- return S * 3600 + j * 60 + oe;
3601
+ const [S, _, oe] = k;
3602
+ return S * 3600 + _ * 60 + oe;
3577
3603
  }
3578
3604
  return 0;
3579
- }, I = (C) => {
3580
- const k = Math.floor(C / 60), S = C % 60;
3605
+ }, R = (A) => {
3606
+ const k = Math.floor(A / 60), S = A % 60;
3581
3607
  return `${k.toString().padStart(2, "0")}:${S.toString().padStart(2, "0")}`;
3582
3608
  };
3583
3609
  V(() => {
3584
- if (!R || y <= 0) return;
3585
- const C = setInterval(() => {
3586
- x((k) => k <= 1 ? (w(!0), 0) : k - 1);
3610
+ if (!F || y <= 0) return;
3611
+ const A = setInterval(() => {
3612
+ b((k) => k <= 1 ? (w(!0), 0) : k - 1);
3587
3613
  }, 1e3);
3588
- return () => clearInterval(C);
3589
- }, [R, y]), V(() => {
3590
- if (E <= 0) return;
3591
- const C = setInterval(() => {
3592
- F((k) => k <= 1 ? 0 : k - 1);
3614
+ return () => clearInterval(A);
3615
+ }, [F, y]), V(() => {
3616
+ if (I <= 0) return;
3617
+ const A = setInterval(() => {
3618
+ P((k) => k <= 1 ? 0 : k - 1);
3593
3619
  }, 1e3);
3594
- return () => clearInterval(C);
3595
- }, [E]), V(() => {
3620
+ return () => clearInterval(A);
3621
+ }, [I]), V(() => {
3596
3622
  N && !d && z();
3597
3623
  }, [N]);
3598
- const A = () => {
3599
- s && (h(!0), x(s.testDurationSec));
3600
- }, B = (C, k) => {
3601
- b((S) => ({
3624
+ const C = () => {
3625
+ a && (h(!0), b(a.testDurationSec));
3626
+ }, B = (A, k) => {
3627
+ f((S) => ({
3602
3628
  ...S,
3603
- [C]: k
3629
+ [A]: k
3604
3630
  }));
3605
- }, z = async (C) => {
3606
- if (C && C.preventDefault(), !!s) {
3631
+ }, z = async (A) => {
3632
+ if (A && A.preventDefault(), !!a) {
3607
3633
  if (!N) {
3608
- const k = s.appropriatenessQuestions.length - Object.keys(m).length;
3634
+ const k = a.appropriatenessQuestions.length - Object.keys(m).length;
3609
3635
  if (k > 0) {
3610
3636
  p(`Please answer all questions. ${k} question(s) remaining.`);
3611
3637
  return;
@@ -3613,105 +3639,105 @@ const Ur = de.any(), fr = ({
3613
3639
  }
3614
3640
  u(!0), p(null);
3615
3641
  try {
3616
- const k = s.appropriatenessQuestions.map(
3617
- (j) => ({
3618
- appropriatenessQuestionId: j.id,
3619
- value: m[j.id] || ""
3642
+ const k = a.appropriatenessQuestions.map(
3643
+ (_) => ({
3644
+ appropriatenessQuestionId: _.id,
3645
+ value: m[_.id] || ""
3620
3646
  // Empty string if not answered
3621
3647
  })
3622
3648
  ), S = {
3623
3649
  applicantId: t,
3624
- appropriatenessTestId: s.id,
3650
+ appropriatenessTestId: a.id,
3625
3651
  appropriatenessQuestionResults: k
3626
3652
  };
3627
3653
  console.log("Submitting appropriateness test:", S);
3628
3654
  try {
3629
- const j = await a.fillAppropriatenessTest(S);
3630
- console.log("Appropriateness test result:", j), j.message && (j.message.toLowerCase().includes("pass") || j.message.toLowerCase().includes("success") || j.message.toLowerCase().includes("congratulations")) ? e == null || e() : (p(j.message || "Test completed. Please check the result."), h(!1), w(!1), b({}), setTimeout(() => f(), 1e3));
3631
- } catch (j) {
3632
- if (j.code === 400 && j.message) {
3633
- const oe = j.message;
3634
- console.log("Test failed:", oe), p(oe), h(!1), w(!1), b({}), setTimeout(() => f(), 1500);
3655
+ const _ = await s.fillAppropriatenessTest(S);
3656
+ 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."), h(!1), w(!1), f({}), setTimeout(() => v(), 1e3));
3657
+ } catch (_) {
3658
+ if (_.code === 400 && _.message) {
3659
+ const oe = _.message;
3660
+ console.log("Test failed:", oe), p(oe), h(!1), w(!1), f({}), setTimeout(() => v(), 1500);
3635
3661
  } else
3636
- throw j;
3662
+ throw _;
3637
3663
  }
3638
3664
  } catch (k) {
3639
- console.error("Error submitting appropriateness test:", k), p(k.message || "Failed to submit test. Please try again."), h(!1), w(!1), b({});
3665
+ console.error("Error submitting appropriateness test:", k), p(k.message || "Failed to submit test. Please try again."), h(!1), w(!1), f({});
3640
3666
  } finally {
3641
3667
  u(!1);
3642
3668
  }
3643
3669
  }
3644
- }, f = async () => {
3670
+ }, v = async () => {
3645
3671
  try {
3646
- const C = await a.getAppropriatenessTest(t);
3647
- if (console.log("Reloaded test data:", C), i(C), C.waitTimeSpanForNextTry && C.waitTimeSpanForNextTry !== "00:00:00") {
3648
- const k = M(C.waitTimeSpanForNextTry);
3649
- k > 0 && F(k);
3672
+ const A = await s.getAppropriatenessTest(t);
3673
+ if (console.log("Reloaded test data:", A), i(A), A.waitTimeSpanForNextTry && A.waitTimeSpanForNextTry !== "00:00:00") {
3674
+ const k = L(A.waitTimeSpanForNextTry);
3675
+ k > 0 && P(k);
3650
3676
  }
3651
- } catch (C) {
3652
- console.error("Error reloading test data:", C), p((k) => k + `
3677
+ } catch (A) {
3678
+ console.error("Error reloading test data:", A), p((k) => k + `
3653
3679
 
3654
3680
  Failed to reload test data. Please refresh the page.`);
3655
3681
  }
3656
3682
  };
3657
3683
  if (c)
3658
- return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
3659
- /* @__PURE__ */ n(se, { className: "my-8" }),
3684
+ return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
3685
+ /* @__PURE__ */ n(ie, { className: "my-8" }),
3660
3686
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading appropriateness test..." })
3661
3687
  ] }) });
3662
- if (!s)
3663
- return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { className: "py-12 text-center", children: [
3688
+ if (!a)
3689
+ return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { className: "py-12 text-center", children: [
3664
3690
  /* @__PURE__ */ n("p", { className: "text-danger-500 text-lg mb-4", children: "No test data available" }),
3665
3691
  g && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: g })
3666
3692
  ] }) });
3667
- if (E > 0)
3668
- return /* @__PURE__ */ o(L, { children: [
3669
- /* @__PURE__ */ o(Z, { children: [
3670
- /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: s.displayName }),
3671
- s.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: s.subtitle })
3693
+ if (I > 0)
3694
+ return /* @__PURE__ */ o(T, { children: [
3695
+ /* @__PURE__ */ o(J, { children: [
3696
+ /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: a.displayName }),
3697
+ a.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: a.subtitle })
3672
3698
  ] }),
3673
- /* @__PURE__ */ o(T, { className: "py-12 text-center", children: [
3699
+ /* @__PURE__ */ o(M, { className: "py-12 text-center", children: [
3674
3700
  /* @__PURE__ */ o("div", { className: "mb-6", children: [
3675
- /* @__PURE__ */ n("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: I(E) }),
3701
+ /* @__PURE__ */ n("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: R(I) }),
3676
3702
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait before attempting the test again" })
3677
3703
  ] }),
3678
3704
  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 }) })
3679
3705
  ] })
3680
3706
  ] });
3681
- const D = s.testAllowedMaxTry - s.totalFailedTries;
3682
- return R ? /* @__PURE__ */ n("form", { onSubmit: z, children: /* @__PURE__ */ o(L, { children: [
3683
- /* @__PURE__ */ n(Z, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
3707
+ const E = a.testAllowedMaxTry - a.totalFailedTries;
3708
+ return F ? /* @__PURE__ */ n("form", { onSubmit: z, children: /* @__PURE__ */ o(T, { children: [
3709
+ /* @__PURE__ */ n(J, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
3684
3710
  /* @__PURE__ */ o("div", { children: [
3685
- /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: s.displayName }),
3686
- s.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: s.subtitle })
3711
+ /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: a.displayName }),
3712
+ a.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.subtitle })
3687
3713
  ] }),
3688
3714
  /* @__PURE__ */ o("div", { className: "text-right", children: [
3689
3715
  /* @__PURE__ */ n(
3690
3716
  "div",
3691
3717
  {
3692
3718
  className: `text-3xl font-bold ${y <= 60 ? "text-danger-500" : "text-primary-500"}`,
3693
- children: I(y)
3719
+ children: R(y)
3694
3720
  }
3695
3721
  ),
3696
3722
  /* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Time Remaining" })
3697
3723
  ] })
3698
3724
  ] }) }),
3699
- /* @__PURE__ */ o(T, { className: "space-y-6", children: [
3725
+ /* @__PURE__ */ o(M, { className: "space-y-6", children: [
3700
3726
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between mb-4", children: [
3701
- /* @__PURE__ */ o(ue, { variant: "info", children: [
3727
+ /* @__PURE__ */ o(me, { variant: "info", children: [
3702
3728
  "Question ",
3703
3729
  Object.keys(m).length,
3704
3730
  " of ",
3705
- s.totalQuestionCount
3731
+ a.totalQuestionCount
3706
3732
  ] }),
3707
- /* @__PURE__ */ o(ue, { variant: D > 1 ? "success" : "warning", children: [
3708
- D,
3733
+ /* @__PURE__ */ o(me, { variant: E > 1 ? "success" : "warning", children: [
3734
+ E,
3709
3735
  " attempt",
3710
- D !== 1 ? "s" : "",
3736
+ E !== 1 ? "s" : "",
3711
3737
  " remaining"
3712
3738
  ] })
3713
3739
  ] }),
3714
- s.appropriatenessQuestions.map((C, k) => /* @__PURE__ */ o(
3740
+ a.appropriatenessQuestions.map((A, k) => /* @__PURE__ */ o(
3715
3741
  "div",
3716
3742
  {
3717
3743
  className: "p-4 border border-gray-200 dark:border-gray-700 rounded-lg",
@@ -3721,25 +3747,25 @@ Failed to reload test data. Please refresh the page.`);
3721
3747
  "Question ",
3722
3748
  k + 1
3723
3749
  ] }),
3724
- C.groupName && /* @__PURE__ */ n("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: C.groupName }),
3725
- /* @__PURE__ */ n("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children: C.question })
3750
+ A.groupName && /* @__PURE__ */ n("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: A.groupName }),
3751
+ /* @__PURE__ */ n("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children: A.question })
3726
3752
  ] }),
3727
- /* @__PURE__ */ n("div", { className: "space-y-2", children: C.answers.map((S, j) => /* @__PURE__ */ o(
3753
+ /* @__PURE__ */ n("div", { className: "space-y-2", children: A.answers.map((S, _) => /* @__PURE__ */ o(
3728
3754
  "label",
3729
3755
  {
3730
3756
  className: `
3731
3757
  flex items-center p-3 border-2 rounded-lg cursor-pointer transition-all
3732
- ${m[C.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"}
3758
+ ${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"}
3733
3759
  `,
3734
3760
  children: [
3735
3761
  /* @__PURE__ */ n(
3736
3762
  "input",
3737
3763
  {
3738
3764
  type: "radio",
3739
- name: `question-${C.id}`,
3765
+ name: `question-${A.id}`,
3740
3766
  value: S,
3741
- checked: m[C.id] === S,
3742
- onChange: (oe) => B(C.id, oe.target.value),
3767
+ checked: m[A.id] === S,
3768
+ onChange: (oe) => B(A.id, oe.target.value),
3743
3769
  className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500",
3744
3770
  disabled: d
3745
3771
  }
@@ -3747,11 +3773,11 @@ Failed to reload test data. Please refresh the page.`);
3747
3773
  /* @__PURE__ */ n("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children: S })
3748
3774
  ]
3749
3775
  },
3750
- j
3776
+ _
3751
3777
  )) })
3752
3778
  ]
3753
3779
  },
3754
- C.id
3780
+ A.id
3755
3781
  )),
3756
3782
  g && !N && /* @__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: [
3757
3783
  /* @__PURE__ */ n("strong", { children: "Error:" }),
@@ -3765,7 +3791,7 @@ Failed to reload test data. Please refresh the page.`);
3765
3791
  ] }),
3766
3792
  /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3767
3793
  /* @__PURE__ */ n(
3768
- _,
3794
+ j,
3769
3795
  {
3770
3796
  type: "button",
3771
3797
  variant: "outline",
@@ -3775,38 +3801,38 @@ Failed to reload test data. Please refresh the page.`);
3775
3801
  }
3776
3802
  ),
3777
3803
  /* @__PURE__ */ n(
3778
- _,
3804
+ j,
3779
3805
  {
3780
3806
  type: "submit",
3781
3807
  isLoading: d,
3782
- disabled: Object.keys(m).length < s.totalQuestionCount,
3808
+ disabled: Object.keys(m).length < a.totalQuestionCount,
3783
3809
  children: N ? "Submitting..." : "Submit Test"
3784
3810
  }
3785
3811
  )
3786
3812
  ] })
3787
- ] }) }) : /* @__PURE__ */ o(L, { children: [
3788
- /* @__PURE__ */ o(Z, { children: [
3789
- /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: s.displayName }),
3790
- s.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: s.subtitle })
3813
+ ] }) }) : /* @__PURE__ */ o(T, { children: [
3814
+ /* @__PURE__ */ o(J, { children: [
3815
+ /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: a.displayName }),
3816
+ a.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: a.subtitle })
3791
3817
  ] }),
3792
- /* @__PURE__ */ o(T, { children: [
3793
- s.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: s.description }) }),
3818
+ /* @__PURE__ */ o(M, { children: [
3819
+ 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 }) }),
3794
3820
  /* @__PURE__ */ o("div", { className: "space-y-4 mb-6", children: [
3795
3821
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
3796
3822
  /* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Total Questions:" }),
3797
- /* @__PURE__ */ n(ue, { variant: "info", children: s.totalQuestionCount })
3823
+ /* @__PURE__ */ n(me, { variant: "info", children: a.totalQuestionCount })
3798
3824
  ] }),
3799
3825
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
3800
3826
  /* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Time Limit:" }),
3801
- /* @__PURE__ */ n(ue, { variant: "info", children: I(s.testDurationSec) })
3827
+ /* @__PURE__ */ n(me, { variant: "info", children: R(a.testDurationSec) })
3802
3828
  ] }),
3803
3829
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
3804
3830
  /* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Correct Answers Required:" }),
3805
- /* @__PURE__ */ n(ue, { variant: "info", children: s.testCorrectAnswerPassLimit })
3831
+ /* @__PURE__ */ n(me, { variant: "info", children: a.testCorrectAnswerPassLimit })
3806
3832
  ] }),
3807
3833
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
3808
3834
  /* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Attempts Remaining:" }),
3809
- /* @__PURE__ */ n(ue, { variant: D > 1 ? "success" : "warning", children: D })
3835
+ /* @__PURE__ */ n(me, { variant: E > 1 ? "success" : "warning", children: E })
3810
3836
  ] })
3811
3837
  ] }),
3812
3838
  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: [
@@ -3814,28 +3840,28 @@ Failed to reload test data. Please refresh the page.`);
3814
3840
  " ",
3815
3841
  g
3816
3842
  ] }) }),
3817
- D <= 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." }) })
3843
+ E <= 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." }) })
3818
3844
  ] }),
3819
3845
  /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3820
- r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3846
+ r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3821
3847
  /* @__PURE__ */ n(
3822
- _,
3848
+ j,
3823
3849
  {
3824
3850
  type: "button",
3825
- onClick: A,
3826
- disabled: D <= 0,
3851
+ onClick: C,
3852
+ disabled: E <= 0,
3827
3853
  children: "Start Test"
3828
3854
  }
3829
3855
  )
3830
3856
  ] })
3831
3857
  ] });
3832
- }, Nr = ({
3858
+ }, Ar = ({
3833
3859
  applicantId: t,
3834
3860
  onComplete: e,
3835
3861
  onBack: r
3836
3862
  }) => {
3837
- var k, S, j, oe;
3838
- const { applicantService: a, baseInformationService: s, config: i } = ie(), { identityData: c, provider: l, token: d, isLoading: u, error: g, requestIdentity: p, restartIdentity: m } = Zt(t), [b, y] = v(null), [x, R] = v(null), [h, N] = v([]), [w, E] = v(!0), [F, M] = v(!1), [I, A] = v(null), [B, z] = v(!1), f = De({
3863
+ var S, _, oe, Fe;
3864
+ const { applicantService: s, baseInformationService: a, config: i } = re(), { identityData: c, provider: l, token: d, isLoading: u, error: g, requestIdentity: p, restartIdentity: m } = er(t), [f, y] = x(null), [b, F] = x(null), [h, N] = x([]), [w, I] = x(!0), [P, L] = x(!1), [R, C] = x(null), [B, z] = x(!1), v = le.useRef(!1), E = Pe({
3839
3865
  defaultValues: {
3840
3866
  street: "",
3841
3867
  streetNumber: "",
@@ -3849,18 +3875,18 @@ Failed to reload test data. Please refresh the page.`);
3849
3875
  V(() => {
3850
3876
  (async () => {
3851
3877
  try {
3852
- const [P, W] = await Promise.all([
3853
- a.getApplicantData(t),
3854
- s.getCountries("", "en")
3878
+ const [D, W] = await Promise.all([
3879
+ s.getApplicantData(t),
3880
+ a.getCountries("", "en")
3855
3881
  ]);
3856
- R(P);
3857
- const H = /* @__PURE__ */ new Set(), re = W.filter((me) => {
3858
- const he = me.abbreviation3 || me.abbreviation;
3859
- return !he || H.has(he) ? !1 : (H.add(he), !0);
3882
+ F(D);
3883
+ const H = /* @__PURE__ */ new Set(), ne = W.filter((ue) => {
3884
+ const Se = ue.abbreviation3 || ue.abbreviation;
3885
+ return !Se || H.has(Se) ? !1 : (H.add(Se), !0);
3860
3886
  });
3861
- N(re);
3862
- const $ = P.applicantRequestData;
3863
- if (f.reset({
3887
+ N(ne);
3888
+ const $ = D.applicantRequestData;
3889
+ if (E.reset({
3864
3890
  street: ($ == null ? void 0 : $.street) || "",
3865
3891
  streetNumber: ($ == null ? void 0 : $.streetNumber) || "",
3866
3892
  city: ($ == null ? void 0 : $.city) || "",
@@ -3868,73 +3894,75 @@ Failed to reload test data. Please refresh the page.`);
3868
3894
  country: ($ == null ? void 0 : $.country) || "",
3869
3895
  nationality: ($ == null ? void 0 : $.nationality) || "",
3870
3896
  phonenumber: ($ == null ? void 0 : $.phonenumber) || ""
3871
- }), !c && !u) {
3872
- console.log("[Identity] Auto-requesting identity verification for IdentityPending status");
3897
+ }), D.kycRecords && D.kycRecords.length > 0 && D.kycRecords[0].providerTokenObject !== null && !v.current) {
3898
+ console.log("[Identity] Found existing identity verification, auto-requesting..."), v.current = !0;
3873
3899
  try {
3874
- await p(), M(!0);
3875
- } catch (me) {
3876
- console.error("[Identity] Auto-request failed:", me);
3900
+ await p(), L(!0);
3901
+ } catch (ue) {
3902
+ console.error("[Identity] Auto-request failed:", ue);
3877
3903
  }
3878
3904
  }
3879
- } catch (P) {
3880
- console.error("Error loading applicant data:", P);
3905
+ } catch (D) {
3906
+ console.error("Error loading applicant data:", D);
3881
3907
  } finally {
3882
- E(!1);
3908
+ I(!1);
3883
3909
  }
3884
3910
  })();
3885
- }, [t, a, s, f, c, u]), V(() => {
3911
+ }, [t, s, a, E, p]), V(() => {
3912
+ c && !P && (console.log("[Identity] Identity data already loaded, showing provider"), L(!0));
3913
+ }, [c, P]), V(() => {
3886
3914
  if (d) {
3887
3915
  if (d.expiresAt) {
3888
3916
  const O = new Date(d.expiresAt).getTime();
3889
3917
  if (Date.now() >= O) {
3890
- console.warn("[Identity] Token has expired (expiresAt)"), z(!0), A("Your verification session has expired. Please restart.");
3918
+ console.warn("[Identity] Token has expired (expiresAt)"), z(!0), C("Your verification session has expired. Please restart.");
3891
3919
  return;
3892
3920
  }
3893
3921
  }
3894
3922
  if (d.url)
3895
3923
  try {
3896
- const P = new URL(d.url).toString().toLowerCase();
3897
- if (P.includes("expired") || P.includes("invalid") || P.includes("error")) {
3898
- console.warn("[Identity] Token URL indicates expiration"), z(!0), A("Your verification link has expired. Please restart.");
3924
+ const D = new URL(d.url).toString().toLowerCase();
3925
+ if (D.includes("expired") || D.includes("invalid") || D.includes("error")) {
3926
+ console.warn("[Identity] Token URL indicates expiration"), z(!0), C("Your verification link has expired. Please restart.");
3899
3927
  return;
3900
3928
  }
3901
3929
  } catch {
3902
3930
  console.error("[Identity] Invalid token URL");
3903
3931
  }
3904
3932
  if (d.status === "expired" || d.error === "expired" || d.expired === !0) {
3905
- console.warn("[Identity] Token object indicates expiration"), z(!0), A("Your verification session has expired. Please restart.");
3933
+ console.warn("[Identity] Token object indicates expiration"), z(!0), C("Your verification session has expired. Please restart.");
3906
3934
  return;
3907
3935
  }
3908
3936
  }
3909
3937
  }, [d]), V(() => {
3910
- if (l !== null && d && !b && F && !B) {
3938
+ if (l !== null && d && !f && P && !B) {
3911
3939
  const O = l;
3912
3940
  if (d.url) {
3913
- console.log("[Identity] Loading provider URL for user verification:", d.url), A(null);
3941
+ console.log("[Identity] Loading provider URL for user verification:", d.url), C(null);
3914
3942
  try {
3915
- if (new URL(d.url), O === ne.SardinAI) {
3943
+ if (new URL(d.url), O === se.SardinAI) {
3916
3944
  console.log("[SardinAI] Initializing Risk SDK in background...");
3917
3945
  try {
3918
- const P = fe.parseProviderConfig(l, d, i);
3919
- fe.createProvider(l, P).initialize().then(() => {
3946
+ const D = ye.parseProviderConfig(l, d, i);
3947
+ ye.createProvider(l, D).initialize().then(() => {
3920
3948
  console.log("[SardinAI] Risk SDK initialized successfully in background");
3921
3949
  }).catch((H) => {
3922
3950
  console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):", H);
3923
3951
  });
3924
- } catch (P) {
3925
- console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", P);
3952
+ } catch (D) {
3953
+ console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", D);
3926
3954
  }
3927
3955
  }
3928
3956
  y({ type: "url", url: d.url });
3929
- } catch (P) {
3930
- console.error("[Identity] Invalid URL:", P), A("Invalid verification URL. Please restart."), z(!0);
3957
+ } catch (D) {
3958
+ console.error("[Identity] Invalid URL:", D), C("Invalid verification URL. Please restart."), z(!0);
3931
3959
  }
3932
3960
  return;
3933
3961
  }
3934
- if (O === ne.SardinAI) {
3935
- console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), A(null);
3962
+ if (O === se.SardinAI) {
3963
+ console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), C(null);
3936
3964
  try {
3937
- const P = fe.parseProviderConfig(l, d, i), W = fe.createProvider(l, P);
3965
+ const D = ye.parseProviderConfig(l, d, i), W = ye.createProvider(l, D);
3938
3966
  W.initialize().then(() => {
3939
3967
  console.log("[SardinAI] Risk SDK initialized successfully"), y(W), setTimeout(() => {
3940
3968
  e == null || e();
@@ -3942,65 +3970,65 @@ Failed to reload test data. Please refresh the page.`);
3942
3970
  }).catch((H) => {
3943
3971
  var $;
3944
3972
  console.error("[SardinAI] Failed to initialize:", H);
3945
- const re = (($ = H.message) == null ? void 0 : $.toLowerCase()) || "";
3946
- re.includes("expired") || re.includes("invalid") || re.includes("401") || re.includes("400") ? (z(!0), A("Session expired or invalid. Please restart verification.")) : A(`Failed to initialize: ${H.message}`);
3973
+ const ne = (($ = H.message) == null ? void 0 : $.toLowerCase()) || "";
3974
+ 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}`);
3947
3975
  });
3948
- } catch (P) {
3949
- console.error("[SardinAI] Error creating provider:", P), A(`Configuration error: ${P.message}`);
3976
+ } catch (D) {
3977
+ console.error("[SardinAI] Error creating provider:", D), C(`Configuration error: ${D.message}`);
3950
3978
  }
3951
3979
  return;
3952
3980
  }
3953
3981
  try {
3954
- A(null);
3955
- const P = fe.parseProviderConfig(l, d, i), W = fe.createProvider(l, P);
3956
- O === ne.Sumsub ? (W.initialize("identity-container").catch((H) => {
3957
- var re;
3958
- console.error("[Sumsub] Initialization error:", H), A(`Failed to initialize: ${H.message}`), (re = H.message) != null && re.toLowerCase().includes("expired") && z(!0);
3982
+ C(null);
3983
+ const D = ye.parseProviderConfig(l, d, i), W = ye.createProvider(l, D);
3984
+ O === se.Sumsub ? (W.initialize("identity-container").catch((H) => {
3985
+ var ne;
3986
+ console.error("[Sumsub] Initialization error:", H), C(`Failed to initialize: ${H.message}`), (ne = H.message) != null && ne.toLowerCase().includes("expired") && z(!0);
3959
3987
  }), W.onComplete && W.onComplete(() => {
3960
3988
  e == null || e();
3961
- })) : O === ne.Onfido && W.initialize("identity-container").catch((H) => {
3962
- console.error("[Onfido] Initialization error:", H), A(`Failed to initialize: ${H.message}`);
3989
+ })) : O === se.Onfido && W.initialize("identity-container").catch((H) => {
3990
+ console.error("[Onfido] Initialization error:", H), C(`Failed to initialize: ${H.message}`);
3963
3991
  }), y(W);
3964
- } catch (P) {
3965
- console.error("[Identity] Provider setup error:", P), A(`Setup error: ${P.message}`);
3992
+ } catch (D) {
3993
+ console.error("[Identity] Provider setup error:", D), C(`Setup error: ${D.message}`);
3966
3994
  }
3967
3995
  }
3968
3996
  return () => {
3969
- if (b && b.destroy)
3997
+ if (f && f.destroy)
3970
3998
  try {
3971
- b.destroy();
3999
+ f.destroy();
3972
4000
  } catch (O) {
3973
4001
  console.error("[Identity] Error destroying provider:", O);
3974
4002
  }
3975
4003
  };
3976
- }, [l, d, b, F, e, B]);
3977
- const D = async () => {
4004
+ }, [l, d, f, P, e, B]);
4005
+ const A = async () => {
3978
4006
  try {
3979
- A(null), z(!1), await p(), M(!0);
4007
+ C(null), z(!1), await p(), L(!0);
3980
4008
  } catch (O) {
3981
4009
  console.error("Error starting identity verification:", O);
3982
4010
  }
3983
- }, C = async () => {
4011
+ }, k = async () => {
3984
4012
  try {
3985
- A(null), z(!1), y(null), console.log("[Identity] Restarting verification..."), await m(), M(!0);
4013
+ C(null), z(!1), y(null), console.log("[Identity] Restarting verification..."), await m(), L(!0);
3986
4014
  } catch (O) {
3987
- console.error("Error restarting identity verification:", O), A(O.message || "Failed to restart verification");
4015
+ console.error("Error restarting identity verification:", O), C(O.message || "Failed to restart verification");
3988
4016
  }
3989
4017
  };
3990
4018
  if (w || u)
3991
- return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
3992
- /* @__PURE__ */ n(se, { className: "my-8" }),
4019
+ return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
4020
+ /* @__PURE__ */ n(ie, { className: "my-8" }),
3993
4021
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading identity verification..." })
3994
4022
  ] }) });
3995
4023
  if (g)
3996
- return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
4024
+ return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3997
4025
  "Error: ",
3998
4026
  g.message
3999
4027
  ] }) }) });
4000
- if (F && (I || B))
4001
- return /* @__PURE__ */ o(L, { children: [
4002
- /* @__PURE__ */ n(Z, { children: /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
4003
- /* @__PURE__ */ o(T, { children: [
4028
+ if (P && (R || B))
4029
+ return /* @__PURE__ */ o(T, { children: [
4030
+ /* @__PURE__ */ n(J, { children: /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
4031
+ /* @__PURE__ */ o(M, { children: [
4004
4032
  /* @__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: [
4005
4033
  /* @__PURE__ */ n(
4006
4034
  "svg",
@@ -4022,7 +4050,7 @@ Failed to reload test data. Please refresh the page.`);
4022
4050
  ),
4023
4051
  /* @__PURE__ */ o("div", { children: [
4024
4052
  /* @__PURE__ */ n("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children: B ? "Session Expired" : "Verification Error" }),
4025
- /* @__PURE__ */ n("p", { className: "text-red-800 dark:text-red-200 text-sm", children: I || "Your verification session has expired and needs to be restarted." })
4053
+ /* @__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." })
4026
4054
  ] })
4027
4055
  ] }) }),
4028
4056
  /* @__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: [
@@ -4035,31 +4063,31 @@ Failed to reload test data. Please refresh the page.`);
4035
4063
  ] })
4036
4064
  ] }),
4037
4065
  /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
4038
- r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
4039
- /* @__PURE__ */ n(_, { type: "button", onClick: C, disabled: u, children: u ? "Restarting..." : "Restart Verification" })
4066
+ r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
4067
+ /* @__PURE__ */ n(j, { type: "button", onClick: k, disabled: u, children: u ? "Restarting..." : "Restart Verification" })
4040
4068
  ] })
4041
4069
  ] });
4042
- if (F && c) {
4070
+ if (P && c) {
4043
4071
  const O = l;
4044
- return d != null && d.url ? /* @__PURE__ */ o(L, { children: [
4045
- /* @__PURE__ */ n(Z, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
4072
+ return d != null && d.url ? /* @__PURE__ */ o(T, { children: [
4073
+ /* @__PURE__ */ n(J, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
4046
4074
  /* @__PURE__ */ o("div", { children: [
4047
4075
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
4048
4076
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
4049
4077
  ] }),
4050
4078
  /* @__PURE__ */ n(
4051
- _,
4079
+ j,
4052
4080
  {
4053
4081
  type: "button",
4054
4082
  variant: "outline",
4055
4083
  size: "sm",
4056
- onClick: C,
4084
+ onClick: k,
4057
4085
  disabled: u,
4058
4086
  children: "Restart"
4059
4087
  }
4060
4088
  )
4061
4089
  ] }) }),
4062
- /* @__PURE__ */ o(T, { children: [
4090
+ /* @__PURE__ */ o(M, { children: [
4063
4091
  /* @__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: [
4064
4092
  /* @__PURE__ */ n("strong", { children: "Important:" }),
4065
4093
  ' If you see an "expired" or "invalid link" message below, click the "Restart" button above to generate a new verification session.'
@@ -4071,14 +4099,14 @@ Failed to reload test data. Please refresh the page.`);
4071
4099
  className: "w-full h-full border-0 rounded-lg",
4072
4100
  allow: "camera; microphone; geolocation",
4073
4101
  title: "Identity Verification",
4074
- onLoad: (P) => {
4075
- var W, H, re;
4102
+ onLoad: (D) => {
4103
+ var W, H, ne;
4076
4104
  console.log("[Identity] Iframe loaded");
4077
4105
  try {
4078
- const $ = P.target, me = $.contentDocument || ((W = $.contentWindow) == null ? void 0 : W.document);
4079
- if (me) {
4080
- const he = ((re = (H = me.body) == null ? void 0 : H.textContent) == null ? void 0 : re.toLowerCase()) || "";
4081
- (he.includes("expired") || he.includes("invalid") || he.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), z(!0), A("Your verification link has expired."));
4106
+ const $ = D.target, Ne = $.contentDocument || ((W = $.contentWindow) == null ? void 0 : W.document);
4107
+ if (Ne) {
4108
+ const ue = ((ne = (H = Ne.body) == null ? void 0 : H.textContent) == null ? void 0 : ne.toLowerCase()) || "";
4109
+ (ue.includes("expired") || ue.includes("invalid") || ue.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), z(!0), C("Your verification link has expired."));
4082
4110
  }
4083
4111
  } catch {
4084
4112
  console.log("[Identity] Cannot check iframe content (CORS)");
@@ -4087,68 +4115,68 @@ Failed to reload test data. Please refresh the page.`);
4087
4115
  }
4088
4116
  ) })
4089
4117
  ] }),
4090
- r && /* @__PURE__ */ n(te, { children: /* @__PURE__ */ n(_, { variant: "outline", onClick: r, children: "Back" }) })
4091
- ] }) : O === ne.SardinAI ? /* @__PURE__ */ o(L, { children: [
4092
- /* @__PURE__ */ o(Z, { children: [
4118
+ r && /* @__PURE__ */ n(te, { children: /* @__PURE__ */ n(j, { variant: "outline", onClick: r, children: "Back" }) })
4119
+ ] }) : O === se.SardinAI ? /* @__PURE__ */ o(T, { children: [
4120
+ /* @__PURE__ */ o(J, { children: [
4093
4121
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Device Risk Assessment" }),
4094
4122
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Analyzing device security and behavioral patterns..." })
4095
4123
  ] }),
4096
- /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("div", { className: "text-center py-12", children: [
4097
- /* @__PURE__ */ n(se, { className: "mb-4" }),
4124
+ /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("div", { className: "text-center py-12", children: [
4125
+ /* @__PURE__ */ n(ie, { className: "mb-4" }),
4098
4126
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait while we verify your device security" }),
4099
4127
  /* @__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" })
4100
4128
  ] }) })
4101
- ] }) : /* @__PURE__ */ o(L, { children: [
4102
- /* @__PURE__ */ o(Z, { children: [
4129
+ ] }) : /* @__PURE__ */ o(T, { children: [
4130
+ /* @__PURE__ */ o(J, { children: [
4103
4131
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
4104
4132
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
4105
4133
  ] }),
4106
- /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n("div", { id: "identity-container", className: "min-h-[400px]" }) }),
4107
- r && /* @__PURE__ */ n(te, { children: /* @__PURE__ */ n(_, { variant: "outline", onClick: r, children: "Back" }) })
4134
+ /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n("div", { id: "identity-container", className: "min-h-[400px]" }) }),
4135
+ r && /* @__PURE__ */ n(te, { children: /* @__PURE__ */ n(j, { variant: "outline", onClick: r, children: "Back" }) })
4108
4136
  ] });
4109
4137
  }
4110
- return /* @__PURE__ */ n("form", { onSubmit: f.handleSubmit(D), children: /* @__PURE__ */ o(L, { children: [
4111
- /* @__PURE__ */ o(Z, { children: [
4138
+ return /* @__PURE__ */ n("form", { onSubmit: E.handleSubmit(A), children: /* @__PURE__ */ o(T, { children: [
4139
+ /* @__PURE__ */ o(J, { children: [
4112
4140
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Review Your Information" }),
4113
4141
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please review and confirm your information before starting identity verification" })
4114
4142
  ] }),
4115
- /* @__PURE__ */ o(T, { className: "space-y-6", children: [
4143
+ /* @__PURE__ */ o(M, { className: "space-y-6", children: [
4116
4144
  /* @__PURE__ */ o("div", { className: "space-y-4 pb-4 border-b border-gray-200 dark:border-gray-700", children: [
4117
4145
  /* @__PURE__ */ o("div", { children: [
4118
4146
  /* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Name" }),
4119
4147
  /* @__PURE__ */ o("p", { className: "mt-1 text-base", children: [
4120
- (k = x == null ? void 0 : x.applicantRequestData) == null ? void 0 : k.firstName,
4148
+ (S = b == null ? void 0 : b.applicantRequestData) == null ? void 0 : S.firstName,
4121
4149
  " ",
4122
- (S = x == null ? void 0 : x.applicantRequestData) == null ? void 0 : S.lastName
4150
+ (_ = b == null ? void 0 : b.applicantRequestData) == null ? void 0 : _.lastName
4123
4151
  ] })
4124
4152
  ] }),
4125
4153
  /* @__PURE__ */ o("div", { children: [
4126
4154
  /* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Email" }),
4127
- /* @__PURE__ */ n("p", { className: "mt-1 text-base", children: (j = x == null ? void 0 : x.applicantRequestData) == null ? void 0 : j.email })
4155
+ /* @__PURE__ */ n("p", { className: "mt-1 text-base", children: (oe = b == null ? void 0 : b.applicantRequestData) == null ? void 0 : oe.email })
4128
4156
  ] }),
4129
4157
  /* @__PURE__ */ o("div", { children: [
4130
4158
  /* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Date of Birth" }),
4131
- /* @__PURE__ */ n("p", { className: "mt-1 text-base", children: ((oe = x == null ? void 0 : x.applicantRequestData) == null ? void 0 : oe.dateOfBirth) || "Not provided" })
4159
+ /* @__PURE__ */ n("p", { className: "mt-1 text-base", children: ((Fe = b == null ? void 0 : b.applicantRequestData) == null ? void 0 : Fe.dateOfBirth) || "Not provided" })
4132
4160
  ] })
4133
4161
  ] }),
4134
4162
  /* @__PURE__ */ o("div", { className: "space-y-4", children: [
4135
4163
  /* @__PURE__ */ n("h3", { className: "text-lg font-semibold", children: "Address Information" }),
4136
4164
  /* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
4137
4165
  /* @__PURE__ */ n(
4138
- Q,
4166
+ G,
4139
4167
  {
4140
- control: f.control,
4168
+ control: E.control,
4141
4169
  name: "country",
4142
4170
  render: ({ field: O }) => /* @__PURE__ */ n(
4143
- ye,
4171
+ ge,
4144
4172
  {
4145
4173
  ...O,
4146
4174
  label: "Country",
4147
4175
  options: [
4148
4176
  { value: "", label: "Select country..." },
4149
- ...h.map((P) => ({
4150
- value: P.abbreviation3 || P.abbreviation,
4151
- label: P.name
4177
+ ...h.map((D) => ({
4178
+ value: D.abbreviation3 || D.abbreviation,
4179
+ label: D.name
4152
4180
  }))
4153
4181
  ]
4154
4182
  }
@@ -4156,20 +4184,20 @@ Failed to reload test data. Please refresh the page.`);
4156
4184
  }
4157
4185
  ),
4158
4186
  /* @__PURE__ */ n(
4159
- Q,
4187
+ G,
4160
4188
  {
4161
- control: f.control,
4189
+ control: E.control,
4162
4190
  name: "nationality",
4163
4191
  render: ({ field: O }) => /* @__PURE__ */ n(
4164
- ye,
4192
+ ge,
4165
4193
  {
4166
4194
  ...O,
4167
4195
  label: "Nationality",
4168
4196
  options: [
4169
4197
  { value: "", label: "Select nationality..." },
4170
- ...h.map((P) => ({
4171
- value: P.abbreviation3 || P.abbreviation,
4172
- label: P.name
4198
+ ...h.map((D) => ({
4199
+ value: D.abbreviation3 || D.abbreviation,
4200
+ label: D.name
4173
4201
  }))
4174
4202
  ]
4175
4203
  }
@@ -4179,120 +4207,120 @@ Failed to reload test data. Please refresh the page.`);
4179
4207
  ] }),
4180
4208
  /* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
4181
4209
  /* @__PURE__ */ n(
4182
- Q,
4210
+ G,
4183
4211
  {
4184
- control: f.control,
4212
+ control: E.control,
4185
4213
  name: "street",
4186
- render: ({ field: O }) => /* @__PURE__ */ n(G, { ...O, label: "Street" })
4214
+ render: ({ field: O }) => /* @__PURE__ */ n(Z, { ...O, label: "Street" })
4187
4215
  }
4188
4216
  ),
4189
4217
  /* @__PURE__ */ n(
4190
- Q,
4218
+ G,
4191
4219
  {
4192
- control: f.control,
4220
+ control: E.control,
4193
4221
  name: "streetNumber",
4194
- render: ({ field: O }) => /* @__PURE__ */ n(G, { ...O, label: "Street Number" })
4222
+ render: ({ field: O }) => /* @__PURE__ */ n(Z, { ...O, label: "Street Number" })
4195
4223
  }
4196
4224
  )
4197
4225
  ] }),
4198
4226
  /* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
4199
4227
  /* @__PURE__ */ n(
4200
- Q,
4228
+ G,
4201
4229
  {
4202
- control: f.control,
4230
+ control: E.control,
4203
4231
  name: "city",
4204
- render: ({ field: O }) => /* @__PURE__ */ n(G, { ...O, label: "City" })
4232
+ render: ({ field: O }) => /* @__PURE__ */ n(Z, { ...O, label: "City" })
4205
4233
  }
4206
4234
  ),
4207
4235
  /* @__PURE__ */ n(
4208
- Q,
4236
+ G,
4209
4237
  {
4210
- control: f.control,
4238
+ control: E.control,
4211
4239
  name: "zip",
4212
- render: ({ field: O }) => /* @__PURE__ */ n(G, { ...O, label: "ZIP/Postal Code" })
4240
+ render: ({ field: O }) => /* @__PURE__ */ n(Z, { ...O, label: "ZIP/Postal Code" })
4213
4241
  }
4214
4242
  )
4215
4243
  ] }),
4216
4244
  /* @__PURE__ */ n(
4217
- Q,
4245
+ G,
4218
4246
  {
4219
- control: f.control,
4247
+ control: E.control,
4220
4248
  name: "phonenumber",
4221
- render: ({ field: O }) => /* @__PURE__ */ n(G, { ...O, label: "Phone Number", type: "tel" })
4249
+ render: ({ field: O }) => /* @__PURE__ */ n(Z, { ...O, label: "Phone Number", type: "tel" })
4222
4250
  }
4223
4251
  )
4224
4252
  ] })
4225
4253
  ] }),
4226
4254
  /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
4227
- r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
4228
- /* @__PURE__ */ n(_, { type: "submit", isLoading: u, children: "Confirm and Start Verification" })
4255
+ r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
4256
+ /* @__PURE__ */ n(j, { type: "submit", isLoading: u, children: "Confirm and Start Verification" })
4229
4257
  ] })
4230
4258
  ] }) });
4231
- }, Be = ({
4259
+ }, ze = ({
4232
4260
  kycStatus: t,
4233
4261
  reviewStatus: e,
4234
4262
  workflowResult: r,
4235
- customMessage: a,
4236
- onContinue: s,
4263
+ customMessage: s,
4264
+ onContinue: a,
4237
4265
  onContactSupport: i
4238
4266
  }) => {
4239
- const l = t === pe.Approved ? {
4267
+ const l = t === he.Approved ? {
4240
4268
  type: "success",
4241
4269
  title: "Verification Approved",
4242
4270
  icon: "✓",
4243
4271
  iconBg: "bg-green-100 dark:bg-green-900/30",
4244
4272
  iconColor: "text-green-600 dark:text-green-400",
4245
4273
  message: "Your identity verification has been successfully approved."
4246
- } : t === pe.Rejected ? {
4274
+ } : t === he.Rejected ? {
4247
4275
  type: "error",
4248
4276
  title: "Verification Rejected",
4249
4277
  icon: "✕",
4250
4278
  iconBg: "bg-red-100 dark:bg-red-900/30",
4251
4279
  iconColor: "text-red-600 dark:text-red-400",
4252
4280
  message: "Unfortunately, your identity verification was not approved."
4253
- } : t === pe.Pending || t === pe.InProgress ? {
4281
+ } : t === he.Pending || t === he.InProgress ? {
4254
4282
  type: "pending",
4255
4283
  title: "Verification Pending",
4256
4284
  icon: "⏱",
4257
4285
  iconBg: "bg-blue-100 dark:bg-blue-900/30",
4258
4286
  iconColor: "text-blue-600 dark:text-blue-400",
4259
4287
  message: "Your identity verification is currently being processed."
4260
- } : e === ge.Approved ? {
4288
+ } : e === pe.Approved ? {
4261
4289
  type: "success",
4262
4290
  title: "Application Approved",
4263
4291
  icon: "✓",
4264
4292
  iconBg: "bg-green-100 dark:bg-green-900/30",
4265
4293
  iconColor: "text-green-600 dark:text-green-400",
4266
4294
  message: "Your application has been approved."
4267
- } : e === ge.Reject ? {
4295
+ } : e === pe.Reject ? {
4268
4296
  type: "error",
4269
4297
  title: "Application Rejected",
4270
4298
  icon: "✕",
4271
4299
  iconBg: "bg-red-100 dark:bg-red-900/30",
4272
4300
  iconColor: "text-red-600 dark:text-red-400",
4273
4301
  message: "Your application has been rejected."
4274
- } : e === ge.UnderReview || e === ge.AdminReview ? {
4302
+ } : e === pe.UnderReview || e === pe.AdminReview ? {
4275
4303
  type: "pending",
4276
4304
  title: "Under Review",
4277
4305
  icon: "📋",
4278
4306
  iconBg: "bg-yellow-100 dark:bg-yellow-900/30",
4279
4307
  iconColor: "text-yellow-700 dark:text-yellow-400",
4280
4308
  message: "Your application is currently under manual review."
4281
- } : r === ke.Success ? {
4309
+ } : r === we.Success ? {
4282
4310
  type: "success",
4283
4311
  title: "Process Complete",
4284
4312
  icon: "✓",
4285
4313
  iconBg: "bg-green-100 dark:bg-green-900/30",
4286
4314
  iconColor: "text-green-600 dark:text-green-400",
4287
4315
  message: "Your verification process has been completed successfully."
4288
- } : r === ke.Failed ? {
4316
+ } : r === we.Failed ? {
4289
4317
  type: "error",
4290
4318
  title: "Process Failed",
4291
4319
  icon: "✕",
4292
4320
  iconBg: "bg-red-100 dark:bg-red-900/30",
4293
4321
  iconColor: "text-red-600 dark:text-red-400",
4294
4322
  message: "The verification process could not be completed."
4295
- } : r === ke.AdminReview ? {
4323
+ } : r === we.AdminReview ? {
4296
4324
  type: "pending",
4297
4325
  title: "Admin Review Required",
4298
4326
  icon: "📋",
@@ -4307,8 +4335,8 @@ Failed to reload test data. Please refresh the page.`);
4307
4335
  iconColor: "text-blue-600 dark:text-blue-400",
4308
4336
  message: "Your application is being reviewed."
4309
4337
  };
4310
- return /* @__PURE__ */ o(L, { children: [
4311
- /* @__PURE__ */ o(T, { className: "py-12", children: [
4338
+ return /* @__PURE__ */ o(T, { children: [
4339
+ /* @__PURE__ */ o(M, { className: "py-12", children: [
4312
4340
  /* @__PURE__ */ n("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ n(
4313
4341
  "div",
4314
4342
  {
@@ -4318,13 +4346,13 @@ Failed to reload test data. Please refresh the page.`);
4318
4346
  ) }),
4319
4347
  /* @__PURE__ */ n("h2", { className: "text-3xl font-bold text-center text-gray-900 dark:text-white mb-4", children: l.title }),
4320
4348
  /* @__PURE__ */ n("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ n(
4321
- ue,
4349
+ me,
4322
4350
  {
4323
4351
  variant: l.type === "success" ? "success" : l.type === "error" ? "danger" : l.type === "pending" ? "warning" : "info",
4324
- children: t != null ? pe[t] : ge[e]
4352
+ children: t != null ? he[t] : pe[e]
4325
4353
  }
4326
4354
  ) }),
4327
- /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mb-6 max-w-md mx-auto", children: a || l.message }),
4355
+ /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mb-6 max-w-md mx-auto", children: s || l.message }),
4328
4356
  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: [
4329
4357
  /* @__PURE__ */ n("h3", { className: "font-semibold text-green-900 dark:text-green-100 mb-2", children: "What's Next?" }),
4330
4358
  /* @__PURE__ */ o("ul", { className: "text-sm text-green-800 dark:text-green-200 space-y-1", children: [
@@ -4353,24 +4381,24 @@ Failed to reload test data. Please refresh the page.`);
4353
4381
  /* @__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: [
4354
4382
  /* @__PURE__ */ o("div", { children: [
4355
4383
  /* @__PURE__ */ n("span", { className: "text-gray-500 dark:text-gray-400", children: "KYC Status:" }),
4356
- /* @__PURE__ */ n("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: t != null ? pe[t] : "Not Available" })
4384
+ /* @__PURE__ */ n("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: t != null ? he[t] : "Not Available" })
4357
4385
  ] }),
4358
4386
  /* @__PURE__ */ o("div", { children: [
4359
4387
  /* @__PURE__ */ n("span", { className: "text-gray-500 dark:text-gray-400", children: "Review Status:" }),
4360
- /* @__PURE__ */ n("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: ge[e] })
4388
+ /* @__PURE__ */ n("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: pe[e] })
4361
4389
  ] })
4362
4390
  ] }) })
4363
4391
  ] }),
4364
4392
  /* @__PURE__ */ o(te, { className: "flex justify-center gap-4", children: [
4365
- l.type === "success" && s && /* @__PURE__ */ n(_, { onClick: s, size: "lg", children: "Continue" }),
4366
- l.type === "error" && /* @__PURE__ */ o(et, { children: [
4367
- i && /* @__PURE__ */ n(_, { variant: "outline", onClick: i, children: "Contact Support" }),
4368
- s && /* @__PURE__ */ n(_, { onClick: s, children: "Try Again" })
4393
+ l.type === "success" && a && /* @__PURE__ */ n(j, { onClick: a, size: "lg", children: "Continue" }),
4394
+ l.type === "error" && /* @__PURE__ */ o(nt, { children: [
4395
+ i && /* @__PURE__ */ n(j, { variant: "outline", onClick: i, children: "Contact Support" }),
4396
+ a && /* @__PURE__ */ n(j, { onClick: a, children: "Try Again" })
4369
4397
  ] }),
4370
4398
  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" }) })
4371
4399
  ] })
4372
4400
  ] });
4373
- }, Kr = ({ config: t, className: e = "" }) => !(t != null && t.visible) || !(t != null && t.url) ? null : /* @__PURE__ */ n("div", { className: `metakyc-logo ${e}`, children: /* @__PURE__ */ n(
4401
+ }, Er = ({ config: t, className: e = "" }) => !(t != null && t.visible) || !(t != null && t.url) ? null : /* @__PURE__ */ n("div", { className: `metakyc-logo ${e}`, children: /* @__PURE__ */ n(
4374
4402
  "img",
4375
4403
  {
4376
4404
  src: t.url,
@@ -4385,20 +4413,33 @@ Failed to reload test data. Please refresh the page.`);
4385
4413
  console.warn("[Logo] Failed to load logo:", t.url), r.target.style.display = "none";
4386
4414
  }
4387
4415
  }
4388
- ) }), qr = ({
4416
+ ) }), Ze = ({
4417
+ title: t,
4418
+ subtitle: e,
4419
+ className: r = ""
4420
+ }) => {
4421
+ const { themeManager: s } = re(), a = s.getCurrentTheme(), i = t || a.title || "KYC Verification";
4422
+ return /* @__PURE__ */ o("div", { className: `metakyc-header ${r}`, children: [
4423
+ a.logo && a.logo.visible && /* @__PURE__ */ n("div", { className: "mb-3", children: /* @__PURE__ */ n(Er, { config: a.logo }) }),
4424
+ /* @__PURE__ */ o("div", { children: [
4425
+ /* @__PURE__ */ n("h1", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: i }),
4426
+ e && /* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400 mt-1", children: e })
4427
+ ] })
4428
+ ] });
4429
+ }, Yr = ({
4389
4430
  workflowKey: t,
4390
4431
  externalRefId: e,
4391
4432
  onSuccess: r,
4392
- onCancel: a
4433
+ onCancel: s
4393
4434
  }) => {
4394
- var A, B, z;
4395
- const { config: s, baseInformationService: i } = ie(), { createApplicant: c, isLoading: l } = Xt(), [d, u] = v([]), [g, p] = v(!0), [m, b] = v(!1), [y, x] = v(null), R = t || ((A = s.applicantForm) == null ? void 0 : A.workflowKey);
4396
- if (!R)
4435
+ var C, B, z;
4436
+ const { config: a, baseInformationService: i } = re(), { createApplicant: c, isLoading: l } = rr(), [d, u] = x([]), [g, p] = x(!0), [m, f] = x(!1), [y, b] = x(null), F = t || ((C = a.applicantForm) == null ? void 0 : C.workflowKey);
4437
+ if (!F)
4397
4438
  throw new Error(
4398
4439
  "workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
4399
4440
  );
4400
- const h = e || ((B = s.applicantForm) == null ? void 0 : B.externalRefId) || "", N = ((z = s.applicantForm) == null ? void 0 : z.visibleFields) || mt, [w, E] = v({
4401
- workflowKey: R,
4441
+ const h = e || ((B = a.applicantForm) == null ? void 0 : B.externalRefId) || "", N = ((z = a.applicantForm) == null ? void 0 : z.visibleFields) || gt, [w, I] = x({
4442
+ workflowKey: F,
4402
4443
  firstName: "",
4403
4444
  lastName: "",
4404
4445
  title: "",
@@ -4428,28 +4469,28 @@ Failed to reload test data. Please refresh the page.`);
4428
4469
  (async () => {
4429
4470
  try {
4430
4471
  p(!0);
4431
- const D = await i.getCountries("", s.locale || "en"), C = /* @__PURE__ */ new Set(), k = D.map((S) => ({
4472
+ const E = await i.getCountries("", a.locale || "en"), A = /* @__PURE__ */ new Set(), k = E.map((S) => ({
4432
4473
  value: S.abbreviation3 || S.abbreviation,
4433
4474
  label: S.name
4434
- })).filter((S) => !S.value || C.has(S.value) ? !1 : (C.add(S.value), !0));
4475
+ })).filter((S) => !S.value || A.has(S.value) ? !1 : (A.add(S.value), !0));
4435
4476
  u(k);
4436
- } catch (D) {
4437
- console.error("Failed to load countries:", D);
4477
+ } catch (E) {
4478
+ console.error("Failed to load countries:", E);
4438
4479
  } finally {
4439
4480
  p(!1);
4440
4481
  }
4441
4482
  })();
4442
- }, [i, s.locale]);
4443
- const F = (f, D) => {
4444
- E((C) => ({ ...C, [f]: D }));
4445
- }, M = async (f) => {
4446
- f.preventDefault(), b(!0), x(null);
4483
+ }, [i, a.locale]);
4484
+ const P = (v, E) => {
4485
+ I((A) => ({ ...A, [v]: E }));
4486
+ }, L = async (v) => {
4487
+ v.preventDefault(), f(!0), b(null);
4447
4488
  try {
4448
4489
  if (!w.externalRefId || w.externalRefId.trim() === "") {
4449
- x("External Reference ID is required and cannot be empty"), b(!1);
4490
+ b("External Reference ID is required and cannot be empty"), f(!1);
4450
4491
  return;
4451
4492
  }
4452
- const D = {
4493
+ const E = {
4453
4494
  workflowKey: w.workflowKey,
4454
4495
  externalRefId: w.externalRefId.trim()
4455
4496
  // Always include, never empty
@@ -4457,142 +4498,145 @@ Failed to reload test data. Please refresh the page.`);
4457
4498
  N.forEach((k) => {
4458
4499
  if (k === "externalRefId") return;
4459
4500
  const S = w[k];
4460
- S != null && S !== "" && !(Array.isArray(S) && S.length === 0) && (D[k] = S);
4461
- }), console.log("Creating applicant with data:", D);
4462
- const C = await c(
4463
- D
4501
+ S != null && S !== "" && !(Array.isArray(S) && S.length === 0) && (E[k] = S);
4502
+ }), console.log("Creating applicant with data:", E);
4503
+ const A = await c(
4504
+ E
4464
4505
  );
4465
- console.log("Applicant created:", C), r(C.applicantId);
4466
- } catch (D) {
4467
- console.error("Error creating applicant:", D), x(D.message || "Failed to create applicant");
4506
+ console.log("Applicant created:", A), r(A.applicantId);
4507
+ } catch (E) {
4508
+ console.error("Error creating applicant:", E), b(E.message || "Failed to create applicant");
4468
4509
  } finally {
4469
- b(!1);
4510
+ f(!1);
4470
4511
  }
4471
- }, I = (f) => {
4472
- var C, k;
4473
- const D = ht[f];
4474
- switch (D.type) {
4512
+ }, R = (v) => {
4513
+ var A, k;
4514
+ const E = yt[v];
4515
+ switch (E.type) {
4475
4516
  case "select":
4476
- return f === "country" || f === "nationality" || f === "taxCountry" || f === "countryOfBirth" ? /* @__PURE__ */ n(
4477
- ye,
4517
+ return v === "country" || v === "nationality" || v === "taxCountry" || v === "countryOfBirth" ? /* @__PURE__ */ n(
4518
+ ge,
4478
4519
  {
4479
- label: D.label,
4480
- value: w[f] || "",
4481
- onChange: (S) => F(f, S.target.value),
4520
+ label: E.label,
4521
+ value: w[v] || "",
4522
+ onChange: (S) => P(v, S.target.value),
4482
4523
  options: [
4483
- { value: "", label: `Select ${D.label.toLowerCase()}...` },
4524
+ { value: "", label: `Select ${E.label.toLowerCase()}...` },
4484
4525
  ...d
4485
4526
  ],
4486
4527
  disabled: g
4487
4528
  },
4488
- f
4489
- ) : f === "salutation" ? /* @__PURE__ */ n(
4490
- ye,
4529
+ v
4530
+ ) : v === "salutation" ? /* @__PURE__ */ n(
4531
+ ge,
4491
4532
  {
4492
- label: D.label,
4493
- value: ((C = w[f]) == null ? void 0 : C.toString()) || "",
4494
- onChange: (S) => F(f, S.target.value ? Number(S.target.value) : null),
4533
+ label: E.label,
4534
+ value: ((A = w[v]) == null ? void 0 : A.toString()) || "",
4535
+ onChange: (S) => P(v, S.target.value ? Number(S.target.value) : null),
4495
4536
  options: [
4496
4537
  { value: "", label: "Select salutation..." },
4497
- { value: Ne.Male.toString(), label: "Male" },
4498
- { value: Ne.Female.toString(), label: "Female" },
4499
- { value: Ne.Other.toString(), label: "Other" }
4538
+ { value: ke.Male.toString(), label: "Male" },
4539
+ { value: ke.Female.toString(), label: "Female" },
4540
+ { value: ke.Other.toString(), label: "Other" }
4500
4541
  ]
4501
4542
  },
4502
- f
4543
+ v
4503
4544
  ) : null;
4504
4545
  case "multiselect":
4505
- return f === "otherNationality" ? /* @__PURE__ */ n(
4506
- G,
4546
+ return v === "otherNationality" ? /* @__PURE__ */ n(
4547
+ Z,
4507
4548
  {
4508
4549
  type: "text",
4509
- label: D.label,
4510
- value: ((k = w[f]) == null ? void 0 : k.join(", ")) || "",
4550
+ label: E.label,
4551
+ value: ((k = w[v]) == null ? void 0 : k.join(", ")) || "",
4511
4552
  onChange: (S) => {
4512
- const j = S.target.value.split(",").map((oe) => oe.trim()).filter(Boolean);
4513
- F(f, j);
4553
+ const _ = S.target.value.split(",").map((oe) => oe.trim()).filter(Boolean);
4554
+ P(v, _);
4514
4555
  },
4515
4556
  placeholder: "Enter countries separated by commas"
4516
4557
  },
4517
- f
4558
+ v
4518
4559
  ) : null;
4519
4560
  case "date":
4520
4561
  return /* @__PURE__ */ n(
4521
- G,
4562
+ Z,
4522
4563
  {
4523
4564
  type: "date",
4524
- label: D.label,
4525
- value: w[f] || "",
4526
- onChange: (S) => F(f, S.target.value)
4565
+ label: E.label,
4566
+ value: w[v] || "",
4567
+ onChange: (S) => P(v, S.target.value)
4527
4568
  },
4528
- f
4569
+ v
4529
4570
  );
4530
4571
  case "email":
4531
4572
  return /* @__PURE__ */ n(
4532
- G,
4573
+ Z,
4533
4574
  {
4534
4575
  type: "email",
4535
- label: D.label,
4536
- value: w[f] || "",
4537
- onChange: (S) => F(f, S.target.value),
4538
- required: f === "email"
4576
+ label: E.label,
4577
+ value: w[v] || "",
4578
+ onChange: (S) => P(v, S.target.value),
4579
+ required: v === "email"
4539
4580
  },
4540
- f
4581
+ v
4541
4582
  );
4542
4583
  case "tel":
4543
4584
  return /* @__PURE__ */ n(
4544
- G,
4585
+ Z,
4545
4586
  {
4546
4587
  type: "tel",
4547
- label: D.label,
4548
- value: w[f] || "",
4549
- onChange: (S) => F(f, S.target.value),
4550
- required: f === "phonenumber"
4588
+ label: E.label,
4589
+ value: w[v] || "",
4590
+ onChange: (S) => P(v, S.target.value),
4591
+ required: v === "phonenumber"
4551
4592
  },
4552
- f
4593
+ v
4553
4594
  );
4554
4595
  case "text":
4555
4596
  default:
4556
4597
  return /* @__PURE__ */ n(
4557
- G,
4598
+ Z,
4558
4599
  {
4559
4600
  type: "text",
4560
- label: D.label,
4561
- value: w[f] || "",
4562
- onChange: (S) => F(f, S.target.value),
4563
- required: f === "firstName" || f === "lastName" || f === "externalRefId"
4601
+ label: E.label,
4602
+ value: w[v] || "",
4603
+ onChange: (S) => P(v, S.target.value),
4604
+ required: v === "firstName" || v === "lastName" || v === "externalRefId"
4564
4605
  },
4565
- f
4606
+ v
4566
4607
  );
4567
4608
  }
4568
4609
  };
4569
- return g ? /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
4570
- /* @__PURE__ */ n(se, { className: "my-8" }),
4610
+ return g ? /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
4611
+ /* @__PURE__ */ n(ie, { className: "my-8" }),
4571
4612
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading form..." })
4572
- ] }) }) }) : /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n("form", { onSubmit: M, children: /* @__PURE__ */ o(L, { children: [
4573
- /* @__PURE__ */ o(Z, { children: [
4574
- /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Create Applicant" }),
4575
- /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: "Please fill in the required information to begin the KYC verification process." })
4576
- ] }),
4577
- /* @__PURE__ */ o(T, { children: [
4613
+ ] }) }) }) : /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n("form", { onSubmit: L, children: /* @__PURE__ */ o(T, { children: [
4614
+ /* @__PURE__ */ n(J, { children: /* @__PURE__ */ n(
4615
+ Ze,
4616
+ {
4617
+ title: "Create Applicant",
4618
+ subtitle: "Please fill in the required information to begin the KYC verification process."
4619
+ }
4620
+ ) }),
4621
+ /* @__PURE__ */ o(M, { children: [
4578
4622
  y && /* @__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: [
4579
4623
  /* @__PURE__ */ n("strong", { children: "Error:" }),
4580
4624
  " ",
4581
4625
  y
4582
4626
  ] }) }),
4583
- /* @__PURE__ */ n("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: N.map((f) => I(f)) })
4627
+ /* @__PURE__ */ n("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: N.map((v) => R(v)) })
4584
4628
  ] }),
4585
4629
  /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
4586
- a && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: a, disabled: m || l, children: "Cancel" }),
4587
- /* @__PURE__ */ n(_, { type: "submit", isLoading: m || l, children: "Create Applicant" })
4630
+ s && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: s, disabled: m || l, children: "Cancel" }),
4631
+ /* @__PURE__ */ n(j, { type: "submit", isLoading: m || l, children: "Create Applicant" })
4588
4632
  ] })
4589
4633
  ] }) }) });
4590
- }, Hr = ({
4634
+ }, Wr = ({
4591
4635
  applicantId: t,
4592
4636
  onComplete: e,
4593
4637
  onError: r,
4594
- theme: a = "light",
4595
- className: s
4638
+ theme: s = "light",
4639
+ className: a
4596
4640
  }) => {
4597
4641
  const {
4598
4642
  progress: i,
@@ -4603,29 +4647,29 @@ Failed to reload test data. Please refresh the page.`);
4603
4647
  hasWorkflowChanged: g,
4604
4648
  isLoading: p,
4605
4649
  error: m,
4606
- moveBack: b,
4650
+ moveBack: f,
4607
4651
  refreshProgress: y
4608
- } = Yt(t), [x, R] = ce.useState(!1);
4609
- if (ce.useEffect(() => {
4652
+ } = Gt(t), [b, F] = le.useState(!1);
4653
+ if (le.useEffect(() => {
4610
4654
  m && r && r(m);
4611
- }, [m, r]), ce.useEffect(() => {
4655
+ }, [m, r]), le.useEffect(() => {
4612
4656
  i != null && i.workflowResult && e && e(i.workflowResult);
4613
- }, [i == null ? void 0 : i.workflowResult, e]), ce.useEffect(() => {
4614
- a === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
4615
- }, [a]), ce.useEffect(() => {
4616
- g && R(!1);
4657
+ }, [i == null ? void 0 : i.workflowResult, e]), le.useEffect(() => {
4658
+ s === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
4659
+ }, [s]), le.useEffect(() => {
4660
+ g && F(!1);
4617
4661
  }, [g]), p || !i)
4618
- return /* @__PURE__ */ n("div", { className: s, children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
4619
- /* @__PURE__ */ n(se, { className: "my-8" }),
4662
+ return /* @__PURE__ */ n("div", { className: a, children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
4663
+ /* @__PURE__ */ n(ie, { className: "my-8" }),
4620
4664
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading workflow..." })
4621
4665
  ] }) }) });
4622
4666
  if (m)
4623
- return /* @__PURE__ */ n("div", { className: s, children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
4667
+ return /* @__PURE__ */ n("div", { className: a, children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
4624
4668
  /* @__PURE__ */ n("p", { className: "text-danger-500 text-lg mb-4", children: "An error occurred" }),
4625
4669
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: m.message })
4626
4670
  ] }) }) }) });
4627
- if (g && !x)
4628
- return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
4671
+ if (g && !b)
4672
+ 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: [
4629
4673
  /* @__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" }) }) }) }),
4630
4674
  /* @__PURE__ */ n("h3", { className: "text-xl font-semibold text-gray-900 dark:text-white mb-2", children: "Workflow Transition" }),
4631
4675
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mb-6", children: "Your application workflow has been updated based on your progress." }),
@@ -4646,15 +4690,15 @@ Failed to reload test data. Please refresh the page.`);
4646
4690
  /* @__PURE__ */ n(
4647
4691
  "button",
4648
4692
  {
4649
- onClick: () => R(!0),
4693
+ onClick: () => F(!0),
4650
4694
  className: "px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-lg transition-colors",
4651
4695
  children: "Continue with New Workflow"
4652
4696
  }
4653
4697
  )
4654
4698
  ] }) }) }) });
4655
4699
  if (i.status === ae.Finished || i.status === ae.OnHold)
4656
- return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ n(
4657
- Be,
4700
+ return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ n(
4701
+ ze,
4658
4702
  {
4659
4703
  kycStatus: i.kycStatus,
4660
4704
  reviewStatus: i.reviewStatus,
@@ -4667,25 +4711,25 @@ Failed to reload test data. Please refresh the page.`);
4667
4711
  }
4668
4712
  ) });
4669
4713
  if (!c)
4670
- return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
4671
- /* @__PURE__ */ n(se, { className: "my-8" }),
4714
+ return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
4715
+ /* @__PURE__ */ n(ie, { className: "my-8" }),
4672
4716
  /* @__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..." })
4673
4717
  ] }) }) });
4674
4718
  const h = () => {
4675
- const w = l.filter((I) => I.visibility !== !1), E = w.findIndex((I) => I.order === c.order), F = E >= 0 ? E + 1 : 1, M = w.length;
4719
+ const w = l.filter((R) => R.visibility !== !1), I = w.findIndex((R) => R.order === c.order), P = I >= 0 ? I + 1 : 1, L = w.length;
4676
4720
  return /* @__PURE__ */ o("div", { className: "mb-6", children: [
4677
- /* @__PURE__ */ o("div", { className: "flex items-center justify-between mb-4", children: [
4678
- /* @__PURE__ */ n("h1", { className: "text-2xl font-bold", children: "KYC Verification" }),
4679
- /* @__PURE__ */ o(ue, { variant: i.status === 1 ? "info" : "success", children: [
4721
+ /* @__PURE__ */ o("div", { className: "flex items-start justify-between mb-4", children: [
4722
+ /* @__PURE__ */ n(Ze, {}),
4723
+ /* @__PURE__ */ o(me, { variant: i.status === 1 ? "info" : "success", children: [
4680
4724
  "Step ",
4681
- F,
4725
+ P,
4682
4726
  " of ",
4683
- M
4727
+ L
4684
4728
  ] })
4685
4729
  ] }),
4686
- /* @__PURE__ */ n("div", { className: "flex items-center", children: w.map((I, A) => {
4687
- const B = A < E, z = I.order === c.order;
4688
- return /* @__PURE__ */ o(ce.Fragment, { children: [
4730
+ /* @__PURE__ */ n("div", { className: "flex items-center", children: w.map((R, C) => {
4731
+ const B = C < I, z = R.order === c.order;
4732
+ return /* @__PURE__ */ o(le.Fragment, { children: [
4689
4733
  /* @__PURE__ */ o("div", { className: "flex items-center", children: [
4690
4734
  /* @__PURE__ */ n(
4691
4735
  "div",
@@ -4694,24 +4738,24 @@ Failed to reload test data. Please refresh the page.`);
4694
4738
  w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium
4695
4739
  ${B || z ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
4696
4740
  `,
4697
- children: A + 1
4741
+ children: C + 1
4698
4742
  }
4699
4743
  ),
4700
4744
  /* @__PURE__ */ n(
4701
4745
  "span",
4702
4746
  {
4703
4747
  className: `ml-2 text-sm ${z ? "font-semibold text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`,
4704
- children: I.displayName
4748
+ children: R.displayName
4705
4749
  }
4706
4750
  )
4707
4751
  ] }),
4708
- A < w.length - 1 && /* @__PURE__ */ n(
4752
+ C < w.length - 1 && /* @__PURE__ */ n(
4709
4753
  "div",
4710
4754
  {
4711
4755
  className: `flex-1 h-0.5 mx-4 ${B ? "bg-primary-500" : "bg-gray-200 dark:bg-gray-700"}`
4712
4756
  }
4713
4757
  )
4714
- ] }, I.order);
4758
+ ] }, R.order);
4715
4759
  }) })
4716
4760
  ] });
4717
4761
  }, N = () => {
@@ -4720,27 +4764,27 @@ Failed to reload test data. Please refresh the page.`);
4720
4764
  onComplete: async () => {
4721
4765
  await y();
4722
4766
  },
4723
- onBack: c.order > 0 ? b : void 0
4767
+ onBack: c.order > 0 ? f : void 0
4724
4768
  };
4725
4769
  switch (c.action) {
4726
- case K.Questionaries:
4727
- return /* @__PURE__ */ n(fr, { ...w });
4728
- case K.UploadDocument:
4729
- return /* @__PURE__ */ n(br, { ...w });
4730
- case K.Overview:
4731
- return /* @__PURE__ */ n(xr, { ...w });
4732
- case K.IdentitySdk:
4733
- return /* @__PURE__ */ n(Nr, { ...w });
4734
- case K.RiskScoring:
4770
+ case U.Questionaries:
4735
4771
  return /* @__PURE__ */ n(vr, { ...w });
4736
- case K.AdditionalData:
4737
- case K.InvestorCategorization:
4772
+ case U.UploadDocument:
4738
4773
  return /* @__PURE__ */ n(wr, { ...w });
4739
- case K.AppropriatenessTest:
4774
+ case U.Overview:
4740
4775
  return /* @__PURE__ */ n(kr, { ...w });
4741
- case K.ManualReview:
4776
+ case U.IdentitySdk:
4777
+ return /* @__PURE__ */ n(Ar, { ...w });
4778
+ case U.RiskScoring:
4779
+ return /* @__PURE__ */ n(Nr, { ...w });
4780
+ case U.AdditionalData:
4781
+ case U.InvestorCategorization:
4782
+ return /* @__PURE__ */ n(Sr, { ...w });
4783
+ case U.AppropriatenessTest:
4784
+ return /* @__PURE__ */ n(Cr, { ...w });
4785
+ case U.ManualReview:
4742
4786
  return /* @__PURE__ */ n(
4743
- Be,
4787
+ ze,
4744
4788
  {
4745
4789
  kycStatus: i.kycStatus,
4746
4790
  reviewStatus: i.reviewStatus,
@@ -4749,134 +4793,135 @@ Failed to reload test data. Please refresh the page.`);
4749
4793
  }
4750
4794
  );
4751
4795
  default:
4752
- return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { className: "py-12 text-center", children: [
4753
- /* @__PURE__ */ n("div", { className: "mb-4", children: /* @__PURE__ */ n(se, {}) }),
4796
+ return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { className: "py-12 text-center", children: [
4797
+ /* @__PURE__ */ n("div", { className: "mb-4", children: /* @__PURE__ */ n(ie, {}) }),
4754
4798
  /* @__PURE__ */ o("p", { className: "text-gray-600 dark:text-gray-400 mb-2", children: [
4755
4799
  "Processing step: ",
4756
4800
  c.title || c.name
4757
4801
  ] }),
4758
4802
  /* @__PURE__ */ o("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: [
4759
4803
  "Action type: ",
4760
- K[c.action]
4804
+ U[c.action]
4761
4805
  ] })
4762
4806
  ] }) });
4763
4807
  }
4764
4808
  };
4765
- return /* @__PURE__ */ o("div", { className: `metakyc-sdk ${s || ""}`, children: [
4809
+ return /* @__PURE__ */ o("div", { className: `metakyc-sdk ${a || ""}`, children: [
4766
4810
  h(),
4767
4811
  N()
4768
4812
  ] });
4769
4813
  };
4770
4814
  export {
4771
- Dr as ALL_APPLICANT_FIELDS,
4772
- tt as ApplicantProgressOnHoldReason,
4815
+ Tr as ALL_APPLICANT_FIELDS,
4816
+ st as ApplicantProgressOnHoldReason,
4773
4817
  ae as ApplicantProgressStatus,
4774
- ft as ApplicantService,
4775
- nt as ApplicantStatus,
4776
- lt as AppropriatenessQuestionType,
4777
- vt as AppropriatenessTestService,
4778
- kr as AppropriatenessTestStep,
4779
- ue as Badge,
4780
- St as BaseInformationService,
4781
- _ as Button,
4782
- L as Card,
4783
- T as CardContent,
4818
+ vt as ApplicantService,
4819
+ it as ApplicantStatus,
4820
+ ut as AppropriatenessQuestionType,
4821
+ Nt as AppropriatenessTestService,
4822
+ Cr as AppropriatenessTestStep,
4823
+ me as Badge,
4824
+ Et as BaseInformationService,
4825
+ j as Button,
4826
+ T as Card,
4827
+ M as CardContent,
4784
4828
  te as CardFooter,
4785
- Z as CardHeader,
4786
- qr as CreateApplicantForm,
4787
- dt as CriteriaBuiltInType,
4788
- mt as DEFAULT_VISIBLE_FIELDS,
4789
- ot as DocumentReviewStatus,
4790
- gt as EndpointBuilder,
4791
- xe as ErrorHandler,
4792
- Lt as EventEmitter,
4793
- ht as FIELD_METADATA,
4794
- it as FileType,
4795
- er as FileUpload,
4796
- Ne as GenderType,
4797
- yt as HttpClient,
4798
- fe as IdentityProviderManager,
4799
- Nt as IdentityService,
4800
- ne as IdentityVerificationProvider,
4801
- Nr as IdentityVerificationStep,
4802
- G as Input,
4803
- Ct as InvestorCategorizationService,
4804
- wr as InvestorCategorizationStep,
4805
- X as InvestorCategorizationType,
4806
- ut as InvestorCategoryType,
4807
- at as KycProcessStatus,
4808
- pe as KycStatus,
4809
- Be as KycStatusDisplay,
4810
- Hr as KycWorkflow,
4811
- Kr as Logo,
4812
- je as MetaKYCContext,
4813
- le as MetaKYCError,
4814
- Lr as MetaKYCProvider,
4815
- zt as OnfidoProvider,
4816
- wt as OverviewService,
4817
- xr as OverviewStep,
4818
- tr as PhoneInput,
4819
- bt as QuestionnaireService,
4820
- fr as QuestionnaireStep,
4821
- ge as ReviewStatus,
4822
- ct as RiskCriteriaType,
4823
- rt as RiskLevel,
4824
- kt as RiskScoringService,
4825
- vr as RiskScoringStep,
4826
- $t as SardinAIProvider,
4827
- ye as Select,
4828
- se as Spinner,
4829
- Mt as StepRouter,
4830
- Ot as SumsubProvider,
4831
- _t as ThemeManager,
4829
+ J as CardHeader,
4830
+ Yr as CreateApplicantForm,
4831
+ ht as CriteriaBuiltInType,
4832
+ gt as DEFAULT_VISIBLE_FIELDS,
4833
+ dt as DocumentReviewStatus,
4834
+ bt as EndpointBuilder,
4835
+ be as ErrorHandler,
4836
+ Bt as EventEmitter,
4837
+ yt as FIELD_METADATA,
4838
+ ct as FileType,
4839
+ nr as FileUpload,
4840
+ ke as GenderType,
4841
+ Ze as Header,
4842
+ xt as HttpClient,
4843
+ ye as IdentityProviderManager,
4844
+ At as IdentityService,
4845
+ se as IdentityVerificationProvider,
4846
+ Ar as IdentityVerificationStep,
4847
+ Z as Input,
4848
+ It as InvestorCategorizationService,
4849
+ Sr as InvestorCategorizationStep,
4850
+ ee as InvestorCategorizationType,
4851
+ pt as InvestorCategoryType,
4852
+ ot as KycProcessStatus,
4853
+ he as KycStatus,
4854
+ ze as KycStatusDisplay,
4855
+ Wr as KycWorkflow,
4856
+ Er as Logo,
4857
+ Ue as MetaKYCContext,
4858
+ ce as MetaKYCError,
4859
+ Or as MetaKYCProvider,
4860
+ _t as OnfidoProvider,
4861
+ St as OverviewService,
4862
+ kr as OverviewStep,
4863
+ sr as PhoneInput,
4864
+ wt as QuestionnaireService,
4865
+ vr as QuestionnaireStep,
4866
+ pe as ReviewStatus,
4867
+ mt as RiskCriteriaType,
4868
+ at as RiskLevel,
4869
+ Ct as RiskScoringService,
4870
+ Nr as RiskScoringStep,
4871
+ Kt as SardinAIProvider,
4872
+ ge as Select,
4873
+ ie as Spinner,
4874
+ zt as StepRouter,
4875
+ jt as SumsubProvider,
4876
+ Ut as ThemeManager,
4832
4877
  Y as ThemePreset,
4833
- Ft as ThemeService,
4834
- xt as UploadDocumentService,
4835
- br as UploadDocumentStep,
4836
- st as UserType,
4837
- Ee as ValueDataType,
4838
- Bt as WorkflowOrchestrator,
4839
- ke as WorkflowResultType,
4840
- Tt as WorkflowState,
4841
- K as WorkflowStepAction,
4842
- Ur as appropriatenessTestSchema,
4843
- zr as clearAllStorage,
4844
- qt as clearApplicantId,
4845
- Vt as clearWorkflowState,
4846
- J as cn,
4847
- At as corporateTheme,
4848
- pt as defaultConfig,
4849
- ee as defaultTheme,
4850
- jt as fileToBase64,
4851
- Et as fintechTheme,
4852
- Ce as formatFileSize,
4853
- jr as generateAppropriatenessSchema,
4854
- hr as generateQuestionnaireSchema,
4855
- gr as generateRiskScoringSchema,
4856
- _r as generateUploadDocumentSchema,
4857
- Br as getAcceptString,
4858
- Kt as getApplicantId,
4859
- ve as getThemePreset,
4860
- Or as getWorkflowState,
4861
- It as healthcareTheme,
4862
- Pr as isScriptLoaded,
4863
- _e as loadScript,
4864
- Dt as minimalTheme,
4865
- Rt as modernTheme,
4866
- Fr as removeScript,
4867
- Ut as saveApplicantId,
4868
- Ht as saveWorkflowState,
4869
- Pt as themePresets,
4870
- Xt as useApplicant,
4871
- $r as useAppropriatenessTest,
4872
- Zt as useIdentityVerification,
4873
- Yt as useKycWorkflow,
4874
- ie as useMetaKYC,
4875
- Gt as useOverview,
4876
- Wt as useQuestionnaire,
4877
- Jt as useRiskScoring,
4878
- Qt as useUploadDocument,
4879
- Tr as validateFileSize,
4880
- Mr as validateFileType
4878
+ Mt as ThemeService,
4879
+ kt as UploadDocumentService,
4880
+ wr as UploadDocumentStep,
4881
+ lt as UserType,
4882
+ Ie as ValueDataType,
4883
+ $t as WorkflowOrchestrator,
4884
+ we as WorkflowResultType,
4885
+ Ot as WorkflowState,
4886
+ U as WorkflowStepAction,
4887
+ Vr as appropriatenessTestSchema,
4888
+ Kr as clearAllStorage,
4889
+ Yt as clearApplicantId,
4890
+ Qt as clearWorkflowState,
4891
+ X as cn,
4892
+ Rt as corporateTheme,
4893
+ ft as defaultConfig,
4894
+ Q as defaultTheme,
4895
+ qt as fileToBase64,
4896
+ Dt as fintechTheme,
4897
+ Ae as formatFileSize,
4898
+ Hr as generateAppropriatenessSchema,
4899
+ yr as generateQuestionnaireSchema,
4900
+ br as generateRiskScoringSchema,
4901
+ qr as generateUploadDocumentSchema,
4902
+ jr as getAcceptString,
4903
+ Vt as getApplicantId,
4904
+ xe as getThemePreset,
4905
+ _r as getWorkflowState,
4906
+ Pt as healthcareTheme,
4907
+ Mr as isScriptLoaded,
4908
+ Ke as loadScript,
4909
+ Lt as minimalTheme,
4910
+ Ft as modernTheme,
4911
+ Br as removeScript,
4912
+ Ht as saveApplicantId,
4913
+ Wt as saveWorkflowState,
4914
+ Tt as themePresets,
4915
+ rr as useApplicant,
4916
+ Ur as useAppropriatenessTest,
4917
+ er as useIdentityVerification,
4918
+ Gt as useKycWorkflow,
4919
+ re as useMetaKYC,
4920
+ Xt as useOverview,
4921
+ Zt as useQuestionnaire,
4922
+ tr as useRiskScoring,
4923
+ Jt as useUploadDocument,
4924
+ zr as validateFileSize,
4925
+ $r as validateFileType
4881
4926
  };
4882
4927
  //# sourceMappingURL=index.js.map