@neofaceid/web-sdk 1.40.2 → 1.41.1

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.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { default as default_2 } from 'react';
1
2
  import { JSX as JSX_2 } from 'react/jsx-runtime';
2
3
  import { z } from 'zod';
3
4
 
@@ -223,7 +224,7 @@ declare const BiometricLoginResultSchema: z.ZodObject<{
223
224
 
224
225
  declare interface BiometricRegistrationCallbacks {
225
226
  onSuccess(result: BiometricRegistrationResult): void;
226
- onError(code: string, message: string): void;
227
+ onError(err: NeoFaceError): void;
227
228
  }
228
229
 
229
230
  export declare function BiometricRegistrationModal({ personData, applicationToken, onClose, onSuccess, onPhotosCaptured, onError, onCannotGesture, autoLighting, }: BiometricRegistrationModalProps): JSX_2.Element;
@@ -297,7 +298,40 @@ declare interface Callbacks {
297
298
  email: string;
298
299
  documentId: string;
299
300
  }): void;
300
- onError(code: string, message: string): void;
301
+ onError(err: NeoFaceError): void;
302
+ }
303
+
304
+ /**
305
+ * Componente de guia oval para captura facial.
306
+ *
307
+ * Renderiza o preview da câmera com um oval SVG sobreposto e um halo colorido
308
+ * que indica o estado de posicionamento do rosto em tempo real.
309
+ *
310
+ * @example
311
+ * ```tsx
312
+ * <CameraOvalGuide
313
+ * stream={mediaStream}
314
+ * faceState="centered"
315
+ * instruction="Mantenha o rosto no oval"
316
+ * />
317
+ * ```
318
+ */
319
+ export declare function CameraOvalGuide({ stream, faceState, instruction, className, style, }: CameraOvalGuideProps): JSX_2.Element;
320
+
321
+ /**
322
+ * Props do componente CameraOvalGuide.
323
+ */
324
+ export declare interface CameraOvalGuideProps {
325
+ /** Stream de vídeo da câmera. Null enquanto aguarda permissão. */
326
+ stream: MediaStream | null;
327
+ /** Estado de posicionamento do rosto — controla a cor do halo. */
328
+ faceState: FaceState;
329
+ /** Instrução textual exibida abaixo do oval (ex: "Aproxime o rosto"). */
330
+ instruction: string;
331
+ /** Classe CSS adicional aplicada ao container externo. */
332
+ className?: string;
333
+ /** Estilos inline adicionais aplicados ao container externo. */
334
+ style?: default_2.CSSProperties;
301
335
  }
302
336
 
303
337
  /**
@@ -593,8 +627,6 @@ export declare const ENVIRONMENT_URLS: Record<Environment, string>;
593
627
  */
594
628
  export declare enum ErrorType {
595
629
  NETWORK = "NetworkError",
596
- /** @deprecated Use `ErrorType.NETWORK`. Mantido para compatibilidade com consumidores existentes do SDK. */
597
- NETWORK_ERROR = "NetworkError",
598
630
  INVALID_TOKEN = "InvalidTokenError",
599
631
  RECOGNITION_FAILED = "RecognitionFailedError",
600
632
  LOGIN_FAILED = "LoginFailedError",
@@ -629,6 +661,16 @@ declare interface FaceCaptureModalProps {
629
661
  autoLighting?: boolean;
630
662
  }
631
663
 
664
+ /**
665
+ * Estado de posicionamento do rosto detectado.
666
+ * - `searching` — nenhum rosto detectado ainda
667
+ * - `too-far` — rosto muito distante da câmera
668
+ * - `too-close` — rosto muito próximo da câmera
669
+ * - `off-center` — rosto fora do centro do oval
670
+ * - `centered` — rosto corretamente posicionado
671
+ */
672
+ export declare type FaceState = 'searching' | 'too-far' | 'too-close' | 'off-center' | 'centered';
673
+
632
674
  /**
633
675
  * Classe para gerenciar o prompt de fallback
634
676
  */
@@ -1632,7 +1674,7 @@ export declare function startHandLogin(options: BiometricLoginOptions): Promise<
1632
1674
  */
1633
1675
  export declare function startLivenessCapture(applicationToken: string, callbacks: {
1634
1676
  onSuccess(photos: Blob[]): void;
1635
- onError(code: string, message: string): void;
1677
+ onError(err: NeoFaceError): void;
1636
1678
  onCancel?(): void;
1637
1679
  }, options?: {
1638
1680
  appName?: string;
@@ -1739,7 +1781,7 @@ export declare const validateToken: (applicationToken: string) => Promise<boolea
1739
1781
  * MINOR: Incrementado quando adicionamos funcionalidades mantendo compatibilidade
1740
1782
  * PATCH: Incrementado quando corrigimos bugs mantendo compatibilidade
1741
1783
  */
1742
- export declare const VERSION = "1.40.2";
1784
+ export declare const VERSION = "1.41.1";
1743
1785
 
1744
1786
  /**
1745
1787
  * Executa `fn(sessionId)`. Se o servidor devolver 410 (sessão consumida/expirada),
@@ -148,7 +148,6 @@ const useCamera = () => {
148
148
  };
149
149
  var ErrorType = /* @__PURE__ */ ((ErrorType2) => {
150
150
  ErrorType2["NETWORK"] = "NetworkError";
151
- ErrorType2["NETWORK_ERROR"] = "NetworkError";
152
151
  ErrorType2["INVALID_TOKEN"] = "InvalidTokenError";
153
152
  ErrorType2["RECOGNITION_FAILED"] = "RecognitionFailedError";
154
153
  ErrorType2["LOGIN_FAILED"] = "LoginFailedError";
@@ -4804,11 +4803,14 @@ const validateToken = async (applicationToken) => {
4804
4803
  } catch (error) {
4805
4804
  if (error instanceof Error) {
4806
4805
  if (error.name === "AbortError") {
4807
- throw new NeoFaceError("Request timeout", ErrorType.NETWORK_ERROR);
4806
+ throw new NeoFaceError("Request timeout", ErrorType.NETWORK);
4808
4807
  }
4809
- throw new NeoFaceError(error.message, ErrorType.NETWORK_ERROR);
4808
+ if (error instanceof NeoFaceError) {
4809
+ throw error;
4810
+ }
4811
+ throw new NeoFaceError(error.message, ErrorType.NETWORK);
4810
4812
  }
4811
- throw new NeoFaceError("Unknown error", ErrorType.NETWORK_ERROR);
4813
+ throw new NeoFaceError("Unknown error", ErrorType.NETWORK);
4812
4814
  }
4813
4815
  };
4814
4816
  const getOnboardingDetails = async (applicationToken, onboardingToken) => {
@@ -4846,7 +4848,7 @@ const getOnboardingDetails = async (applicationToken, onboardingToken) => {
4846
4848
  }
4847
4849
  throw new NeoFaceError(error.message, ErrorType.NETWORK);
4848
4850
  }
4849
- throw new NeoFaceError("Erro desconhecido", ErrorType.NETWORK_ERROR);
4851
+ throw new NeoFaceError("Erro desconhecido", ErrorType.NETWORK);
4850
4852
  }
4851
4853
  };
4852
4854
  const validateOnboardingToken = async (applicationToken, onboardingToken) => {
@@ -4884,7 +4886,7 @@ const validateOnboardingToken = async (applicationToken, onboardingToken) => {
4884
4886
  }
4885
4887
  throw new NeoFaceError(error.message, ErrorType.NETWORK);
4886
4888
  }
4887
- throw new NeoFaceError("Erro desconhecido", ErrorType.NETWORK_ERROR);
4889
+ throw new NeoFaceError("Erro desconhecido", ErrorType.NETWORK);
4888
4890
  }
4889
4891
  };
4890
4892
  const completeOnboarding = async (applicationToken, onboardingToken, faceImage, documentImage) => {
@@ -4951,7 +4953,7 @@ const completeOnboarding = async (applicationToken, onboardingToken, faceImage,
4951
4953
  }
4952
4954
  throw new NeoFaceError(error.message, ErrorType.NETWORK);
4953
4955
  }
4954
- throw new NeoFaceError("Erro desconhecido", ErrorType.NETWORK_ERROR);
4956
+ throw new NeoFaceError("Erro desconhecido", ErrorType.NETWORK);
4955
4957
  }
4956
4958
  };
4957
4959
  const completeOnboardingWithData = async (applicationToken, onboardingToken, personData, personImages, documentImage) => {
@@ -5037,7 +5039,7 @@ const completeOnboardingWithData = async (applicationToken, onboardingToken, per
5037
5039
  }
5038
5040
  throw new NeoFaceError(error.message, ErrorType.NETWORK);
5039
5041
  }
5040
- throw new NeoFaceError("Erro desconhecido", ErrorType.NETWORK_ERROR);
5042
+ throw new NeoFaceError("Erro desconhecido", ErrorType.NETWORK);
5041
5043
  }
5042
5044
  };
5043
5045
  const recognize = async (image, applicationToken) => {
@@ -5089,7 +5091,7 @@ const recognize = async (image, applicationToken) => {
5089
5091
  }
5090
5092
  throw new NeoFaceError(error.message, ErrorType.NETWORK);
5091
5093
  }
5092
- throw new NeoFaceError("Unknown error occurred", ErrorType.NETWORK_ERROR);
5094
+ throw new NeoFaceError("Unknown error occurred", ErrorType.NETWORK);
5093
5095
  }
5094
5096
  };
5095
5097
  const loginWithBiometric = async (image, applicationToken) => {
@@ -5156,7 +5158,7 @@ const loginWithBiometric = async (image, applicationToken) => {
5156
5158
  }
5157
5159
  throw new NeoFaceError(error.message, ErrorType.NETWORK);
5158
5160
  }
5159
- throw new NeoFaceError("Unknown error occurred", ErrorType.NETWORK_ERROR);
5161
+ throw new NeoFaceError("Unknown error occurred", ErrorType.NETWORK);
5160
5162
  }
5161
5163
  };
5162
5164
  const recognizeBiometric = async (image, applicationToken, livenessCheck = true, confidenceThreshold = 0.8) => {
@@ -5210,7 +5212,7 @@ const recognizeBiometric = async (image, applicationToken, livenessCheck = true,
5210
5212
  }
5211
5213
  throw new NeoFaceError(error.message, ErrorType.NETWORK);
5212
5214
  }
5213
- throw new NeoFaceError("Unknown error occurred", ErrorType.NETWORK_ERROR);
5215
+ throw new NeoFaceError("Unknown error occurred", ErrorType.NETWORK);
5214
5216
  }
5215
5217
  };
5216
5218
  const simpleIdentification = async (documentType, documentNumber, applicationToken, purpose = "LOGIN") => {
@@ -5256,7 +5258,7 @@ const simpleIdentification = async (documentType, documentNumber, applicationTok
5256
5258
  }
5257
5259
  throw new NeoFaceError(error.message, ErrorType.NETWORK);
5258
5260
  }
5259
- throw new NeoFaceError("Unknown error occurred", ErrorType.NETWORK_ERROR);
5261
+ throw new NeoFaceError("Unknown error occurred", ErrorType.NETWORK);
5260
5262
  }
5261
5263
  };
5262
5264
  const recognizeByPurpose = async (image, applicationToken, purpose, confidenceThreshold = 0.8, signature, sessionData) => {
@@ -5322,7 +5324,7 @@ const recognizeByPurpose = async (image, applicationToken, purpose, confidenceTh
5322
5324
  }
5323
5325
  throw new NeoFaceError(error.message, ErrorType.NETWORK);
5324
5326
  }
5325
- throw new NeoFaceError("Unknown error occurred", ErrorType.NETWORK_ERROR);
5327
+ throw new NeoFaceError("Unknown error occurred", ErrorType.NETWORK);
5326
5328
  }
5327
5329
  };
5328
5330
  const registerPersonWithoutFace = async (personData, applicationToken, options) => {
@@ -5590,7 +5592,7 @@ const registerPersonWithBiometric = async (personData, facePhotos, applicationTo
5590
5592
  }
5591
5593
  throw new NeoFaceError(error.message, ErrorType.NETWORK);
5592
5594
  }
5593
- throw new NeoFaceError("Unknown error occurred", ErrorType.NETWORK_ERROR);
5595
+ throw new NeoFaceError("Unknown error occurred", ErrorType.NETWORK);
5594
5596
  }
5595
5597
  };
5596
5598
  const loginWithEmail = async (email2, password, applicationToken) => {
@@ -5635,7 +5637,7 @@ const loginWithEmail = async (email2, password, applicationToken) => {
5635
5637
  }
5636
5638
  throw new NeoFaceError(error.message, ErrorType.NETWORK);
5637
5639
  }
5638
- throw new NeoFaceError("Unknown error occurred", ErrorType.NETWORK_ERROR);
5640
+ throw new NeoFaceError("Unknown error occurred", ErrorType.NETWORK);
5639
5641
  }
5640
5642
  };
5641
5643
  const identifyPerson = async (image, applicationToken) => {
@@ -5703,7 +5705,7 @@ const identifyPerson = async (image, applicationToken) => {
5703
5705
  }
5704
5706
  throw new NeoFaceError(error.message, ErrorType.NETWORK);
5705
5707
  }
5706
- throw new NeoFaceError("Unknown error occurred", ErrorType.NETWORK_ERROR);
5708
+ throw new NeoFaceError("Unknown error occurred", ErrorType.NETWORK);
5707
5709
  }
5708
5710
  };
5709
5711
  const registerBiometric = async (personId, faceImage, applicationToken) => {
@@ -5779,7 +5781,7 @@ const registerBiometric = async (personId, faceImage, applicationToken) => {
5779
5781
  }
5780
5782
  throw new NeoFaceError(error.message, ErrorType.NETWORK);
5781
5783
  }
5782
- throw new NeoFaceError("Unknown error occurred", ErrorType.NETWORK_ERROR);
5784
+ throw new NeoFaceError("Unknown error occurred", ErrorType.NETWORK);
5783
5785
  }
5784
5786
  };
5785
5787
  const registerApplication = async (jwtToken, consumerId, applicationData) => {
@@ -5848,7 +5850,7 @@ const registerApplication = async (jwtToken, consumerId, applicationData) => {
5848
5850
  }
5849
5851
  throw new NeoFaceError(error.message, ErrorType.NETWORK);
5850
5852
  }
5851
- throw new NeoFaceError("Unknown error occurred", ErrorType.NETWORK_ERROR);
5853
+ throw new NeoFaceError("Unknown error occurred", ErrorType.NETWORK);
5852
5854
  }
5853
5855
  };
5854
5856
  const recordFaceVideo = async (options = {}) => {
@@ -6048,7 +6050,7 @@ const startProofOfLife = async (videoBase64, applicationToken) => {
6048
6050
  }
6049
6051
  throw new NeoFaceError(error.message, ErrorType.NETWORK);
6050
6052
  }
6051
- throw new NeoFaceError("Unknown error occurred", ErrorType.NETWORK_ERROR);
6053
+ throw new NeoFaceError("Unknown error occurred", ErrorType.NETWORK);
6052
6054
  }
6053
6055
  };
6054
6056
  const videoToBase64 = async (videoBlob) => new Promise((resolve, reject) => {
@@ -6101,10 +6103,7 @@ const registerDocumentByImage = async (personId, jwtToken, images) => {
6101
6103
  });
6102
6104
  const data = await response.json();
6103
6105
  if (!response.ok) {
6104
- throw new NeoFaceError(
6105
- (data == null ? void 0 : data.message) || `API Error ${response.status}`,
6106
- ErrorType.NETWORK_ERROR
6107
- );
6106
+ throw new NeoFaceError((data == null ? void 0 : data.message) || `API Error ${response.status}`, ErrorType.NETWORK);
6108
6107
  }
6109
6108
  return {
6110
6109
  success: true,
@@ -6116,11 +6115,11 @@ const registerDocumentByImage = async (personId, jwtToken, images) => {
6116
6115
  if (error instanceof NeoFaceError) throw error;
6117
6116
  if (error instanceof Error) {
6118
6117
  if (error.name === "AbortError") {
6119
- throw new NeoFaceError("Request timeout", ErrorType.NETWORK_ERROR);
6118
+ throw new NeoFaceError("Request timeout", ErrorType.NETWORK);
6120
6119
  }
6121
- throw new NeoFaceError(error.message, ErrorType.NETWORK_ERROR);
6120
+ throw new NeoFaceError(error.message, ErrorType.NETWORK);
6122
6121
  }
6123
- throw new NeoFaceError("Unknown error occurred", ErrorType.NETWORK_ERROR);
6122
+ throw new NeoFaceError("Unknown error occurred", ErrorType.NETWORK);
6124
6123
  }
6125
6124
  };
6126
6125
  const getTaskStatus = async (taskId, applicationToken) => {
@@ -6141,10 +6140,7 @@ const getTaskStatus = async (taskId, applicationToken) => {
6141
6140
  });
6142
6141
  const data = await response.json();
6143
6142
  if (!response.ok) {
6144
- throw new NeoFaceError(
6145
- (data == null ? void 0 : data.message) || `API Error ${response.status}`,
6146
- ErrorType.NETWORK_ERROR
6147
- );
6143
+ throw new NeoFaceError((data == null ? void 0 : data.message) || `API Error ${response.status}`, ErrorType.NETWORK);
6148
6144
  }
6149
6145
  return {
6150
6146
  success: data.success,
@@ -6154,7 +6150,7 @@ const getTaskStatus = async (taskId, applicationToken) => {
6154
6150
  };
6155
6151
  } catch (error) {
6156
6152
  if (error instanceof NeoFaceError) throw error;
6157
- throw new NeoFaceError("Failed to fetch task status", ErrorType.NETWORK_ERROR);
6153
+ throw new NeoFaceError("Failed to fetch task status", ErrorType.NETWORK);
6158
6154
  }
6159
6155
  };
6160
6156
  const identifyPersonAsync = async (image, applicationToken, options = {}) => {
@@ -6190,7 +6186,7 @@ const identifyPersonAsync = async (image, applicationToken, options = {}) => {
6190
6186
  }
6191
6187
  await new Promise((resolve) => setTimeout(resolve, interval));
6192
6188
  }
6193
- throw new NeoFaceError("Timed out waiting for identification", ErrorType.NETWORK_ERROR);
6189
+ throw new NeoFaceError("Timed out waiting for identification", ErrorType.NETWORK);
6194
6190
  };
6195
6191
  async function requestPasswordReset(email2, applicationToken) {
6196
6192
  const baseUrl = getBaseUrl();
@@ -8736,7 +8732,7 @@ function BiometricRegistrationModal({
8736
8732
  /* @__PURE__ */ jsx("canvas", { ref: canvasRef })
8737
8733
  ] });
8738
8734
  }
8739
- const VERSION = "1.40.2";
8735
+ const VERSION = "1.41.1";
8740
8736
  const RELEASE_DATE = "2026-09-10";
8741
8737
  const CONSENT_TRAIL_STORAGE_KEY = "neoface_consent_trail_v1";
8742
8738
  const CONSENT_TRAIL_MAX_LIMIT = 100;
@@ -9182,6 +9178,193 @@ const DEFAULT_CONSENT_INFO = {
9182
9178
  privacyPolicyUrl: DEFAULT_PRIVACY_URL,
9183
9179
  retentionDays: DEFAULT_RETENTION_DAYS
9184
9180
  };
9181
+ function getHaloStyles(state) {
9182
+ switch (state) {
9183
+ case "centered":
9184
+ return {
9185
+ borderColor: "#0E9F6E",
9186
+ boxShadow: "0 0 0 4px rgba(14, 159, 110, 0.8), 0 0 45px rgba(14, 159, 110, 0.45)",
9187
+ svgStroke: "#0E9F6E",
9188
+ badgeBg: "rgba(14, 159, 110, 0.95)",
9189
+ badgeColor: "#FFFFFF"
9190
+ };
9191
+ case "too-far":
9192
+ case "too-close":
9193
+ case "off-center":
9194
+ return {
9195
+ borderColor: "#F59E0B",
9196
+ boxShadow: "0 0 0 4px rgba(245, 158, 11, 0.7), 0 0 35px rgba(245, 158, 11, 0.35)",
9197
+ svgStroke: "#F59E0B",
9198
+ badgeBg: "rgba(245, 158, 11, 0.95)",
9199
+ badgeColor: "#1F2937"
9200
+ };
9201
+ case "searching":
9202
+ default:
9203
+ return {
9204
+ borderColor: "rgba(156, 163, 175, 0.5)",
9205
+ boxShadow: "0 0 0 4px rgba(156, 163, 175, 0.3), 0 0 20px rgba(156, 163, 175, 0.15)",
9206
+ svgStroke: "#9CA3AF",
9207
+ badgeBg: "rgba(55, 65, 81, 0.9)",
9208
+ badgeColor: "#FFFFFF"
9209
+ };
9210
+ }
9211
+ }
9212
+ function CameraOvalGuide({
9213
+ stream,
9214
+ faceState,
9215
+ instruction,
9216
+ className = "",
9217
+ style = {}
9218
+ }) {
9219
+ const videoRef = useRef(null);
9220
+ useEffect(() => {
9221
+ const videoEl = videoRef.current;
9222
+ if (!videoEl) return;
9223
+ if (stream) {
9224
+ videoEl.srcObject = stream;
9225
+ videoEl.play().catch(() => {
9226
+ });
9227
+ } else {
9228
+ videoEl.srcObject = null;
9229
+ }
9230
+ return () => {
9231
+ if (stream) {
9232
+ stream.getTracks().forEach((track) => track.stop());
9233
+ }
9234
+ if (videoEl) {
9235
+ videoEl.srcObject = null;
9236
+ }
9237
+ };
9238
+ }, [stream]);
9239
+ const halo = getHaloStyles(faceState);
9240
+ return /* @__PURE__ */ jsxs(
9241
+ "div",
9242
+ {
9243
+ className: `neofaceid-camera-oval-guide-container ${className}`,
9244
+ style: {
9245
+ display: "flex",
9246
+ flexDirection: "column",
9247
+ alignItems: "center",
9248
+ justifyContent: "center",
9249
+ position: "relative",
9250
+ width: "100%",
9251
+ maxHeight: "100%",
9252
+ padding: "16px",
9253
+ boxSizing: "border-box",
9254
+ ...style
9255
+ },
9256
+ children: [
9257
+ /* @__PURE__ */ jsx("style", { children: `
9258
+ .neofaceid-oval-frame {
9259
+ width: 320px;
9260
+ height: 400px;
9261
+ border-radius: 50%;
9262
+ overflow: hidden;
9263
+ position: relative;
9264
+ background: #000000;
9265
+ transition: box-shadow 0.3s ease, border-color 0.3s ease;
9266
+ }
9267
+
9268
+ .neofaceid-oval-video {
9269
+ width: 100%;
9270
+ height: 100%;
9271
+ object-fit: cover;
9272
+ transform: scaleX(-1);
9273
+ display: block;
9274
+ }
9275
+
9276
+ .neofaceid-oval-svg-overlay {
9277
+ position: absolute;
9278
+ inset: 0;
9279
+ width: 100%;
9280
+ height: 100%;
9281
+ pointer-events: none;
9282
+ z-index: 2;
9283
+ }
9284
+
9285
+ .neofaceid-oval-instruction-badge {
9286
+ margin-top: 20px;
9287
+ padding: 10px 20px;
9288
+ border-radius: 20px;
9289
+ font-size: 15px;
9290
+ font-weight: 600;
9291
+ text-align: center;
9292
+ max-width: 320px;
9293
+ box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
9294
+ backdrop-filter: blur(8px);
9295
+ transition: background-color 0.3s ease, color 0.3s ease;
9296
+ z-index: 5;
9297
+ }
9298
+
9299
+ @media (max-width: 640px) {
9300
+ .neofaceid-oval-frame {
9301
+ width: 280px;
9302
+ height: 350px;
9303
+ }
9304
+ }
9305
+ ` }),
9306
+ /* @__PURE__ */ jsxs(
9307
+ "div",
9308
+ {
9309
+ className: "neofaceid-oval-frame",
9310
+ style: {
9311
+ boxShadow: halo.boxShadow,
9312
+ borderColor: halo.borderColor
9313
+ },
9314
+ children: [
9315
+ /* @__PURE__ */ jsx(
9316
+ "video",
9317
+ {
9318
+ ref: videoRef,
9319
+ className: "neofaceid-oval-video",
9320
+ autoPlay: true,
9321
+ playsInline: true,
9322
+ muted: true,
9323
+ "data-testid": "camera-oval-video"
9324
+ }
9325
+ ),
9326
+ /* @__PURE__ */ jsx(
9327
+ "svg",
9328
+ {
9329
+ className: "neofaceid-oval-svg-overlay",
9330
+ viewBox: "0 0 320 400",
9331
+ fill: "none",
9332
+ xmlns: "http://www.w3.org/2000/svg",
9333
+ children: /* @__PURE__ */ jsx(
9334
+ "ellipse",
9335
+ {
9336
+ cx: "160",
9337
+ cy: "200",
9338
+ rx: "140",
9339
+ ry: "180",
9340
+ stroke: halo.svgStroke,
9341
+ strokeWidth: "3",
9342
+ strokeDasharray: faceState === "searching" ? "8 8" : "none",
9343
+ style: { transition: "stroke 0.3s ease" }
9344
+ }
9345
+ )
9346
+ }
9347
+ )
9348
+ ]
9349
+ }
9350
+ ),
9351
+ instruction && /* @__PURE__ */ jsx(
9352
+ "div",
9353
+ {
9354
+ className: "neofaceid-oval-instruction-badge",
9355
+ "aria-live": "assertive",
9356
+ style: {
9357
+ backgroundColor: halo.badgeBg,
9358
+ color: halo.badgeColor
9359
+ },
9360
+ "data-testid": "camera-oval-instruction",
9361
+ children: instruction
9362
+ }
9363
+ )
9364
+ ]
9365
+ }
9366
+ );
9367
+ }
9185
9368
  const DARK_THRESHOLD = 0.235;
9186
9369
  const IMPROVEMENT_TARGET = 0.12;
9187
9370
  const SAMPLE_INTERVAL_MS = 600;
@@ -14313,7 +14496,7 @@ const CONSENT_DENIED_MESSAGE = "Consentimento recusado pelo usuário.";
14313
14496
  function start(applicationToken, callbacks, options) {
14314
14497
  requestConsent({ appName: options == null ? void 0 : options.appName, flow: "verification" }).then((accepted) => {
14315
14498
  if (!accepted) {
14316
- callbacks.onError("CONSENT_DENIED", CONSENT_DENIED_MESSAGE);
14499
+ callbacks.onError(new NeoFaceError(CONSENT_DENIED_MESSAGE, ErrorType.CONSENT_DENIED));
14317
14500
  return;
14318
14501
  }
14319
14502
  const container = document.createElement("div");
@@ -14342,14 +14525,16 @@ function start(applicationToken, callbacks, options) {
14342
14525
  root.render(modalElement);
14343
14526
  }).catch((error) => {
14344
14527
  cleanup();
14345
- callbacks.onError("TOKEN_VALIDATION_ERROR", error.message || "Failed to validate token");
14528
+ callbacks.onError(
14529
+ error instanceof NeoFaceError ? error : new NeoFaceError(error.message || "Failed to validate token", ErrorType.INVALID_TOKEN)
14530
+ );
14346
14531
  });
14347
14532
  });
14348
14533
  }
14349
14534
  function startBiometricRegistration(personData, applicationToken, callbacks, options) {
14350
14535
  requestConsent({ appName: options == null ? void 0 : options.appName, flow: "registration" }).then((accepted) => {
14351
14536
  if (!accepted) {
14352
- callbacks.onError("CONSENT_DENIED", CONSENT_DENIED_MESSAGE);
14537
+ callbacks.onError(new NeoFaceError(CONSENT_DENIED_MESSAGE, ErrorType.CONSENT_DENIED));
14353
14538
  return;
14354
14539
  }
14355
14540
  const container = document.createElement("div");
@@ -14377,7 +14562,7 @@ function startBiometricRegistration(personData, applicationToken, callbacks, opt
14377
14562
  },
14378
14563
  onError: (error) => {
14379
14564
  cleanup();
14380
- callbacks.onError("BIOMETRIC_REGISTRATION_ERROR", error);
14565
+ callbacks.onError(new NeoFaceError(error, ErrorType.UNKNOWN));
14381
14566
  },
14382
14567
  onCannotGesture: options == null ? void 0 : options.onCannotGesture
14383
14568
  });
@@ -14385,14 +14570,16 @@ function startBiometricRegistration(personData, applicationToken, callbacks, opt
14385
14570
  rootRef.render(modalElement);
14386
14571
  }).catch((error) => {
14387
14572
  cleanup();
14388
- callbacks.onError("TOKEN_VALIDATION_ERROR", error.message || "Failed to validate token");
14573
+ callbacks.onError(
14574
+ error instanceof NeoFaceError ? error : new NeoFaceError(error.message || "Failed to validate token", ErrorType.INVALID_TOKEN)
14575
+ );
14389
14576
  });
14390
14577
  });
14391
14578
  }
14392
14579
  function startLivenessCapture(applicationToken, callbacks, options) {
14393
14580
  requestConsent({ appName: options == null ? void 0 : options.appName, flow: "verification" }).then((accepted) => {
14394
14581
  if (!accepted) {
14395
- callbacks.onError("CONSENT_DENIED", CONSENT_DENIED_MESSAGE);
14582
+ callbacks.onError(new NeoFaceError(CONSENT_DENIED_MESSAGE, ErrorType.CONSENT_DENIED));
14396
14583
  return;
14397
14584
  }
14398
14585
  const container = document.createElement("div");
@@ -14425,7 +14612,7 @@ function startLivenessCapture(applicationToken, callbacks, options) {
14425
14612
  },
14426
14613
  onError: (error) => {
14427
14614
  cleanup();
14428
- callbacks.onError("LIVENESS_CAPTURE_ERROR", error);
14615
+ callbacks.onError(new NeoFaceError(error, ErrorType.UNKNOWN));
14429
14616
  },
14430
14617
  onCannotGesture: options == null ? void 0 : options.onCannotGesture
14431
14618
  });
@@ -14433,7 +14620,9 @@ function startLivenessCapture(applicationToken, callbacks, options) {
14433
14620
  rootRef.render(modalElement);
14434
14621
  }).catch((error) => {
14435
14622
  cleanup();
14436
- callbacks.onError("TOKEN_VALIDATION_ERROR", error.message || "Failed to validate token");
14623
+ callbacks.onError(
14624
+ error instanceof NeoFaceError ? error : new NeoFaceError(error.message || "Failed to validate token", ErrorType.INVALID_TOKEN)
14625
+ );
14437
14626
  });
14438
14627
  });
14439
14628
  }
@@ -14441,6 +14630,7 @@ export {
14441
14630
  BiometricCaptureModal,
14442
14631
  BiometricRegistrationModal,
14443
14632
  BiometricStatusOverlay,
14633
+ CameraOvalGuide,
14444
14634
  ConsentModal,
14445
14635
  DEFAULT_CONSENT_INFO,
14446
14636
  DocumentCaptureModal,