@incodetech/core 0.0.0-dev-20260911-aec162f0 → 0.0.0-dev-20260914-8aef7789

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.
Files changed (118) hide show
  1. package/dist/{FaceDetectionProvider-Cn1wS-sA.d.ts → BaseWasmProvider-CO0GfaHM.d.ts} +7 -37
  2. package/dist/{BrowserDiagnosticsCryptoProvider-8sT0QLgq.esm.js → BrowserDiagnosticsCryptoProvider-BoYzmYY5.esm.js} +1 -1
  3. package/dist/{onDeviceFaceResults-hle2Ci9l.esm.js → FaceDetectionProvider-0bWjPgW5.esm.js} +219 -340
  4. package/dist/FaceDetectionProvider-CyLxkzRP.d.ts +36 -0
  5. package/dist/{IIdCaptureCapability-DDWlQzhi.d.ts → IIdCaptureCapability-nfpic2z2.d.ts} +7 -3
  6. package/dist/{IWasmUtilCapability-SNPhmIwB.d.ts → IWasmUtilCapability-DaP6pfHq.d.ts} +10 -4
  7. package/dist/{MotionSensorProvider-Vlyhbcty.esm.js → MotionSensorProvider-BnZ8_1Sk.esm.js} +1 -1
  8. package/dist/{StreamCanvasCapture-D2XcXCZ4.esm.js → StreamCanvasCapture-C9jtgBdT.esm.js} +2 -2
  9. package/dist/{deepsightService-MZOpj7Vp.d.ts → StreamCanvasCapture-D9Dz8kqB.d.ts} +54 -41
  10. package/dist/ae-signature.esm.js +1 -1
  11. package/dist/{apiError-XdhqSAmg.esm.js → apiError-CixFeCyt.esm.js} +1 -1
  12. package/dist/authentication.d.ts +3 -3
  13. package/dist/authentication.esm.js +2 -2
  14. package/dist/{authenticationManager-DqBOkMzk.esm.js → authenticationManager-CN26fkJa.esm.js} +4 -4
  15. package/dist/{authenticationManager-BCkV6CSG.d.ts → authenticationManager-D7UUqgnN.d.ts} +1 -1
  16. package/dist/{authenticationStateMachine-Cto_G5bN.esm.js → authenticationStateMachine-CUXpIxAD.esm.js} +6 -62
  17. package/dist/avatar.d.ts +1 -1
  18. package/dist/avatar.esm.js +1 -1
  19. package/dist/{backCameraStream-DE_5qY04.esm.js → backCameraStream-BOtyQowf.esm.js} +75 -18
  20. package/dist/{camera-_2sXMXiF.esm.js → camera-sIa9ceW2.esm.js} +19 -1
  21. package/dist/camera.esm.js +1 -1
  22. package/dist/{canvas-E1zGkel4.esm.js → canvas-BxFzWTt-.esm.js} +19 -0
  23. package/dist/createCameraCycleOwnership-DQ5-F2oW.esm.js +826 -0
  24. package/dist/{createFaceAvatar-DQKaRise.esm.js → createFaceAvatar-BNHdeFj8.esm.js} +2 -2
  25. package/dist/{createFaceAvatar-pUEkdk4X.d.ts → createFaceAvatar-CTM9aj9Q.d.ts} +12 -6
  26. package/dist/curp-validation.d.ts +1 -1
  27. package/dist/{curpValidationManager-cSd2MrOQ.d.ts → curpValidationManager-CTJB2RsD.d.ts} +1 -1
  28. package/dist/{deepsightLoader-Dwr1zKFa.esm.js → deepsightLoader-Dhz9T_KJ.esm.js} +19 -53
  29. package/dist/document-capture.esm.js +2 -2
  30. package/dist/{documentCaptureManager-BTpHZMgW.esm.js → documentCaptureManager-BwcbMwo5.esm.js} +1 -1
  31. package/dist/{documentCaptureStateMachine-CPizkpcg.esm.js → documentCaptureStateMachine-F8SCOtL_.esm.js} +4 -4
  32. package/dist/dynamic-forms.esm.js +2 -2
  33. package/dist/{dynamicFormsManager-Cmh84Nz4.esm.js → dynamicFormsManager-CNBrBOR3.esm.js} +1 -1
  34. package/dist/{dynamicFormsStateMachine-DZr7Ugvy.esm.js → dynamicFormsStateMachine-Bo2qrjHB.esm.js} +1 -1
  35. package/dist/ekyb.d.ts +1 -1
  36. package/dist/ekyb.esm.js +3 -3
  37. package/dist/{ekybManager-Dc2tT9fu.esm.js → ekybManager-D8DdfRAD.esm.js} +1 -1
  38. package/dist/{ekybStateMachine-GSEMOiHn.esm.js → ekybStateMachine-oPCbEFob.esm.js} +1 -1
  39. package/dist/electronic-signature.esm.js +1 -1
  40. package/dist/{electronicSignatureManager-CpLuqw7T.esm.js → electronicSignatureManager-DkKQ07vx.esm.js} +1 -1
  41. package/dist/extensibility.d.ts +11 -58
  42. package/dist/extensibility.esm.js +13 -13
  43. package/dist/{faceCaptureManagerFactory-kDmbL0I7.esm.js → faceCaptureManagerFactory-D_EjQnnE.esm.js} +19 -4
  44. package/dist/{faceCaptureManagerFactory-CzUr_ZPq.d.ts → faceCaptureManagerFactory-DqrYpjA5.d.ts} +24 -12
  45. package/dist/{faceCaptureSetup-CAGBnLVx.esm.js → faceCaptureSetup-WeO8-TfR.esm.js} +999 -382
  46. package/dist/{feature-management-B6CtmH1O.esm.js → feature-management-BEqf3Sr3.esm.js} +1 -1
  47. package/dist/feature-management.esm.js +1 -1
  48. package/dist/fiscal-qr.esm.js +1 -1
  49. package/dist/{fiscalQrManager-DI6uOffY.esm.js → fiscalQrManager-Bp_-3LJr.esm.js} +3 -3
  50. package/dist/flow-events.d.ts +1 -1
  51. package/dist/flow.d.ts +6 -6
  52. package/dist/flow.esm.js +3 -3
  53. package/dist/{flowCompletionService-BpoZDpAn.esm.js → flowCompletionService-DELbVeL5.esm.js} +1 -1
  54. package/dist/{flowServices-BVnSStkh.esm.js → flowServices-Brr2fh_c.esm.js} +5 -5
  55. package/dist/geolocation.esm.js +2 -2
  56. package/dist/{geolocationManager-CLm86P8G.esm.js → geolocationManager-CtVZDjng.esm.js} +1 -1
  57. package/dist/{geolocationStateMachine-Bi3vy7Wl.esm.js → geolocationStateMachine-tjsYcMhr.esm.js} +1 -1
  58. package/dist/home.d.ts +1 -1
  59. package/dist/id-selfie-flow.d.ts +3 -3
  60. package/dist/id-selfie-flow.esm.js +10 -10
  61. package/dist/id.d.ts +4 -4
  62. package/dist/id.esm.js +35 -44
  63. package/dist/{idCaptureDefaults-BLsd7shz.esm.js → idCaptureDefaults-C66YvkgN.esm.js} +19 -14
  64. package/dist/{idCaptureManager-DW1GeEUk.d.ts → idCaptureManager-DE_jyr5X.d.ts} +98 -37
  65. package/dist/{idCaptureManager-BUTdcmaD.esm.js → idCaptureManager-zjul9YdZ.esm.js} +27 -17
  66. package/dist/{idCaptureServices-fzIhBqAK.esm.js → idCaptureServices-UXYCBZPK.esm.js} +80 -20
  67. package/dist/{idCaptureStateMachine-Cp2_revF.esm.js → idCaptureStateMachine-D3pqfK2Z.esm.js} +1954 -1082
  68. package/dist/{index-1PoJuUJ-.d.ts → index-BGxFwnld.d.ts} +1 -1
  69. package/dist/index.d.ts +1 -1
  70. package/dist/index.esm.js +1 -1
  71. package/dist/mandatory-consent.d.ts +2 -2
  72. package/dist/{mandatoryConsentManager-BJnylLZO.d.ts → mandatoryConsentManager-CZwhsUlO.d.ts} +1 -1
  73. package/dist/{permissionGuards-DxbvOoZJ.esm.js → permissionGuards-o1JLtewE.esm.js} +1 -1
  74. package/dist/{permissionServices-f7nBnW5P.esm.js → permissionServices-7lzEiOsO.esm.js} +3 -3
  75. package/dist/personhood.d.ts +5 -5
  76. package/dist/personhood.esm.js +8 -8
  77. package/dist/qe-signature.esm.js +1 -1
  78. package/dist/{runChildModule-BPlX2IDO.esm.js → runChildModule-BDlvNMrA.esm.js} +1 -1
  79. package/dist/{safeStorage-Dp9m6aOh.esm.js → safeStorage-1O9k0ulP.esm.js} +8 -8
  80. package/dist/{sdkVersion-Dr9_E3d9.esm.js → sdkVersion-CS_0s_Lc.esm.js} +1 -1
  81. package/dist/selfie.d.ts +4 -4
  82. package/dist/selfie.esm.js +12 -74
  83. package/dist/{selfieManager-BdP-RgH4.esm.js → selfieManager-BouB9yUQ.esm.js} +4 -4
  84. package/dist/{selfieManager-Bg_Xwe4p.d.ts → selfieManager-DZ3u_WN9.d.ts} +1 -1
  85. package/dist/{selfieStateMachine-B8vFeT39.esm.js → selfieStateMachine-TGfI9hNp.esm.js} +22 -31
  86. package/dist/{session-C2THUsQZ.esm.js → session-m9j27bHm.esm.js} +3 -3
  87. package/dist/session.d.ts +1 -1
  88. package/dist/session.esm.js +4 -4
  89. package/dist/{sessionInitializer-CEycxhm4.esm.js → sessionInitializer-CUpgbHzs.esm.js} +4 -4
  90. package/dist/{setup-D6yz9se2.d.ts → setup-CEX95gJ1.d.ts} +11 -6
  91. package/dist/{setup-BHJ3-fhX.esm.js → setup-CfNAVG-d.esm.js} +12 -11
  92. package/dist/{trueSightService-DLzYznkh.esm.js → trueSightService-TqmmYye3.esm.js} +4 -4
  93. package/dist/types-BhHF-CuL.d.ts +6 -0
  94. package/dist/{types-DJ2OM9rw.d.ts → types-BzuUebkB.d.ts} +1 -1
  95. package/dist/{types-DzmqFoCH.d.ts → types-CBctcPeF.d.ts} +1 -1
  96. package/dist/{types-BBI4-s9u2.d.ts → types-CoOlCUp82.d.ts} +5 -5
  97. package/dist/{types-hSqUyXyw.d.ts → types-DL0CXuWv.d.ts} +3 -3
  98. package/dist/types-Ds928RiU.d.ts +1 -0
  99. package/dist/{types-_pWNFY1F.d.ts → types-eLtVBhon.d.ts} +1 -1
  100. package/dist/video-selfie.d.ts +3 -3
  101. package/dist/video-selfie.esm.js +5 -5
  102. package/dist/{videoSelfieCameraWarmer-D5E12WjL.esm.js → videoSelfieCameraWarmer-C-cESczy.esm.js} +9 -9
  103. package/dist/{videoSelfieStepDetector-B8TvFDNK.d.ts → videoSelfieStepDetector-CdXIFh9s.d.ts} +4 -4
  104. package/dist/virtualCameraCheck-WOloJ-do.esm.js +48 -0
  105. package/dist/{warmup-BOM-sD-6.esm.js → warmup-CUUnwYxe.esm.js} +282 -90
  106. package/dist/{warmup-CXHBgvFC.d.ts → warmup-Cis2p6O0.d.ts} +13 -2
  107. package/dist/wasm.d.ts +9 -3
  108. package/dist/wasm.esm.js +10 -4
  109. package/dist/{wasmDsFlagSync-C3k_VK9o.esm.js → wasmDsFlagSync-BJtLh2XK.esm.js} +1 -1
  110. package/dist/{wasmWebClient-BJCaFeBL.esm.js → wasmWebClient-B7baE-Wf.esm.js} +223 -2
  111. package/dist/workflow.d.ts +1 -1
  112. package/dist/workflow.esm.js +15 -15
  113. package/package.json +1 -1
  114. package/dist/imageFile-CLaua6xO.esm.js +0 -69
  115. package/dist/types-m4t_cT5J.d.ts +0 -6
  116. package/dist/{Face2DProvider-UUQt_vRC.esm.js → Face2DProvider-BF48sz5c.esm.js} +1 -1
  117. package/dist/{PrivacyLensProvider-D8PS7AJa.esm.js → PrivacyLensProvider-EwnC_C5n.esm.js} +1 -1
  118. package/dist/{selfieErrorUtils-C6gC06J7.esm.js → selfieErrorUtils-C77GXJH6.esm.js} +1 -1
@@ -0,0 +1,36 @@
1
+ import { c as FaceAttributesThresholds, d as FaceDetectionCallbacks, f as FaceDetectionConfig, h as IFaceDetectionCapability, l as FaceChecksConfig, m as FacePositionConstraints, p as FaceDetectionThresholds, v as WebApiHostRequestConfig } from "./createFaceAvatar-CTM9aj9Q.js";
2
+ import { t as BaseWasmProvider } from "./BaseWasmProvider-CO0GfaHM.js";
3
+ //#region ../infra/src/providers/wasm/FaceDetectionProvider.d.ts
4
+ declare class FaceDetectionProvider extends BaseWasmProvider implements IFaceDetectionCapability {
5
+ private defaultThresholds;
6
+ private currentThresholds;
7
+ private currentFrame;
8
+ private onFaceDataCallback;
9
+ constructor();
10
+ processFrame(image: ImageData): Promise<void>;
11
+ initialize(config: FaceDetectionConfig): Promise<void>;
12
+ /**
13
+ * Last-registered onCapture callback — captured into a private
14
+ * field so `forceCapture()` (called from outside the WASM-callback
15
+ * lifecycle) can re-fire the same wrapper. `setCallbacks` rebinds
16
+ * this on each invocation, so the field always reflects the
17
+ * current consumer.
18
+ */
19
+ private currentOnCaptureWrapper;
20
+ processPhoto(canvas: HTMLCanvasElement): void;
21
+ postFaceResults(config?: WebApiHostRequestConfig): Promise<unknown>;
22
+ setCallbacks(callbacks: FaceDetectionCallbacks): void;
23
+ setPositionConstraints(constraints: FacePositionConstraints): void;
24
+ applyDefaults(autocaptureInterval?: number): void;
25
+ setAutocaptureInterval(interval: number): void;
26
+ setThresholds(thresholds: FaceDetectionThresholds): void;
27
+ setAttributesThresholds(thresholds: FaceAttributesThresholds): void;
28
+ setChecksEnabled(config: FaceChecksConfig): void;
29
+ setVideoSelfieMode(enabled: boolean): void;
30
+ forceCapture(): void;
31
+ reset(): void;
32
+ private createDefaultFaceCoordinates;
33
+ private formatFaceCoordinates;
34
+ }
35
+ //#endregion
36
+ export { FaceDetectionProvider as t };
@@ -1,5 +1,5 @@
1
- import "./warmup-CXHBgvFC.js";
2
- import { _ as MLProviderConfig, g as IMLProviderCapability, y as IncodeCanvas } from "./createFaceAvatar-pUEkdk4X.js";
1
+ import "./warmup-Cis2p6O0.js";
2
+ import { _ as MLProviderConfig, g as IMLProviderCapability, y as IncodeCanvas } from "./createFaceAvatar-CTM9aj9Q.js";
3
3
  //#region ../infra/src/wasm/mlWasmBridgeTypes.d.ts
4
4
  /**
5
5
  * Decoded PDF417 barcode surfaced from the WASM ID-capture pipeline during
@@ -72,7 +72,11 @@ interface IdCaptureCallbacks {
72
72
  onBlur?: () => void;
73
73
  onGlare?: () => void;
74
74
  onCapturing?: () => void;
75
- onCapture?: () => void;
75
+ /**
76
+ * Receives the exact best-shot canvas detached by the Core ID workflow.
77
+ * The canvas is presentation-only; protected submission remains native-owned.
78
+ */
79
+ onCapture?: (canvas?: HTMLCanvasElement | null) => void;
76
80
  onBestFrame?: (blur: number, glare: number, orientation: string) => void;
77
81
  onIdNotDetected?: () => void;
78
82
  onSwitchToManualCapture?: () => void;
@@ -1,5 +1,5 @@
1
- import { c as WasmPipeline } from "./warmup-CXHBgvFC.js";
2
- import { _ as MLProviderConfig } from "./createFaceAvatar-pUEkdk4X.js";
1
+ import { c as WasmPipeline } from "./warmup-Cis2p6O0.js";
2
+ import { _ as MLProviderConfig } from "./createFaceAvatar-CTM9aj9Q.js";
3
3
  //#region ../infra/src/capabilities/IRecordingCapability.d.ts
4
4
  type RecordingPublisher = {
5
5
  getStreamId: () => string | undefined;
@@ -105,8 +105,10 @@ type IWasmUtilCapability = {
105
105
  setMotionStatus(status: string): void;
106
106
  setBackgroundMode(backgroundMode: boolean): void;
107
107
  /**
108
- * Enables on-device mode: the native WASM module skips full fingerprint
109
- * collection and keeps only the device-detection DTO. Additive; default off.
108
+ * @deprecated Compatibility-only no-op for ml-wasm-kit v2.14.49-post1.
109
+ * Both values are accepted before or after initialization and never invoke
110
+ * native code. The public `fingerprint` option controls client-side
111
+ * submission; native fingerprint lifecycle remains owned by WASM.
110
112
  */
111
113
  setOnDeviceMode(enabled: boolean): void;
112
114
  setZc(zc: string): void;
@@ -130,6 +132,10 @@ type IWasmUtilCapability = {
130
132
  */
131
133
  getPipelineState(): string;
132
134
  estimatePerformance(): string;
135
+ /**
136
+ * @deprecated Returns `false` for compatibility. Protected PRC/POC is the
137
+ * authoritative virtual-camera decision path.
138
+ */
133
139
  isVirtualCamera(label: string | null): boolean;
134
140
  prc(): Promise<void>;
135
141
  poc(output: VirtualCameraCheckOutput): Promise<void>;
@@ -1,4 +1,4 @@
1
- import { n as resolveSessionStorage } from "./safeStorage-Dp9m6aOh.esm.js";
1
+ import { n as resolveSessionStorage } from "./safeStorage-1O9k0ulP.esm.js";
2
2
  //#region ../infra/src/providers/browser/MotionSensorProvider.ts
3
3
  const MOTION_PERMISSION_GRANTED_KEY = "motionSensorsPermissionsGranted";
4
4
  const MOTION_PERMISSION_DENIED_KEY = "motionSensorsPermissionsDenied";
@@ -1,4 +1,4 @@
1
- import { t as IncodeCanvas } from "./canvas-E1zGkel4.esm.js";
1
+ import { t as IncodeCanvas } from "./canvas-BxFzWTt-.esm.js";
2
2
  //#region ../infra/src/media/StreamCanvasCapture.ts
3
3
  var StreamCanvasCapture = class {
4
4
  constructor(stream, options) {
@@ -28,7 +28,7 @@ var StreamCanvasCapture = class {
28
28
  try {
29
29
  this.video.play();
30
30
  } catch {}
31
- this.rafLoop(intervalMs);
31
+ if (options?.continuous !== false) this.rafLoop(intervalMs);
32
32
  }
33
33
  addEventListener(type, listener, options) {
34
34
  this.eventTarget.addEventListener(type, listener, options);
@@ -1,44 +1,6 @@
1
- import { y as IncodeCanvas } from "./createFaceAvatar-pUEkdk4X.js";
2
- import "./IWasmUtilCapability-SNPhmIwB.js";
1
+ import { y as IncodeCanvas } from "./createFaceAvatar-CTM9aj9Q.js";
2
+ import "./IWasmUtilCapability-DaP6pfHq.js";
3
3
  import { t as CameraStream } from "./camera-9wWD-pwg.js";
4
- //#region ../infra/src/media/StreamCanvasCapture.d.ts
5
- type StreamCanvasCaptureOptions = {
6
- fps?: number;
7
- width?: number;
8
- height?: number;
9
- };
10
- type StreamCanvasCaptureEventMap = {
11
- frame: Event;
12
- };
13
- declare class StreamCanvasCapture {
14
- private video;
15
- private canvas;
16
- private ctx;
17
- private rafId;
18
- private lastFrameTimeSeconds;
19
- private lastTickTimeMs;
20
- private hasFrame;
21
- private disposed;
22
- private eventTarget;
23
- constructor(stream: CameraStream, options?: StreamCanvasCaptureOptions);
24
- addEventListener(type: keyof StreamCanvasCaptureEventMap, listener: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions): void;
25
- removeEventListener(type: keyof StreamCanvasCaptureEventMap, listener: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions): void;
26
- /**
27
- * Returns the latest cached frame as an {@link IncodeCanvas}.
28
- */
29
- getLatestCanvas(): IncodeCanvas | null;
30
- /**
31
- * Returns the latest cached frame as raw {@link ImageData}.
32
- */
33
- getLatestFrame(): ImageData | null;
34
- /**
35
- * Disposes internal resources and stops the capture loop.
36
- */
37
- dispose(): void;
38
- private rafLoop;
39
- private tick;
40
- }
41
- //#endregion
42
4
  //#region ../infra/src/capabilities/IMotionSensorCapability.d.ts
43
5
  type MotionStatus = 'PASS' | 'FAIL' | 'UNCLEAR';
44
6
  type MotionPermissionState = 'granted' | 'denied' | 'not-required';
@@ -95,6 +57,12 @@ type DeepsightService = {
95
57
  */
96
58
  performPrcCheck(params: DeepsightPrcCheckParams): Promise<void>;
97
59
  analyzeFrame(imageData: ImageData): Promise<void>;
60
+ /**
61
+ * Finalizes non-frame DeepSight metadata after a protected WASM capture.
62
+ * The protected runtime owns frame analysis, so this intentionally does not
63
+ * call the host-supplied `analyzeFrame` fallback.
64
+ */
65
+ finalizeProtectedCaptureMetadata(): Promise<void>;
98
66
  getMetadata(): string;
99
67
  getMotionStatus(): string;
100
68
  getAnalysisStatus(): string;
@@ -105,4 +73,49 @@ type DeepsightPrcCheckParams = {
105
73
  constraints: MediaStreamConstraints;
106
74
  };
107
75
  //#endregion
108
- export { StreamCanvasCapture as n, DeepsightService as t };
76
+ //#region ../infra/src/media/StreamCanvasCapture.d.ts
77
+ type StreamCanvasCaptureOptions = {
78
+ fps?: number;
79
+ width?: number;
80
+ height?: number;
81
+ /**
82
+ * Keep a canvas cache updated from requestAnimationFrame. Defaults to true.
83
+ * Set false when a caller only needs an occasional presentation snapshot;
84
+ * `getLatestCanvas`/`getLatestFrame` will draw the current video frame on
85
+ * demand without running a duplicate per-frame loop.
86
+ */
87
+ continuous?: boolean;
88
+ };
89
+ type StreamCanvasCaptureEventMap = {
90
+ frame: Event;
91
+ };
92
+ declare class StreamCanvasCapture {
93
+ private video;
94
+ private canvas;
95
+ private ctx;
96
+ private rafId;
97
+ private lastFrameTimeSeconds;
98
+ private lastTickTimeMs;
99
+ private hasFrame;
100
+ private disposed;
101
+ private eventTarget;
102
+ constructor(stream: CameraStream, options?: StreamCanvasCaptureOptions);
103
+ addEventListener(type: keyof StreamCanvasCaptureEventMap, listener: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions): void;
104
+ removeEventListener(type: keyof StreamCanvasCaptureEventMap, listener: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions): void;
105
+ /**
106
+ * Returns the latest cached frame as an {@link IncodeCanvas}.
107
+ */
108
+ getLatestCanvas(): IncodeCanvas | null;
109
+ /**
110
+ * Returns the latest cached frame as raw {@link ImageData}.
111
+ */
112
+ getLatestFrame(): ImageData | null;
113
+ /**
114
+ * Disposes internal resources and stops the capture loop.
115
+ */
116
+ dispose(): void;
117
+ private rafLoop;
118
+ private tick;
119
+ }
120
+ //#endregion
121
+ export { DeepsightService as n, StreamCanvasCapture as t };
@@ -1,4 +1,4 @@
1
- import { c as areAllConsented, i as AE_CONSENT_KEYS, r as electronicSignatureMachine, t as createElectronicSignatureManager, u as getDefaultConsentChecks } from "./electronicSignatureManager-CpLuqw7T.esm.js";
1
+ import { c as areAllConsented, i as AE_CONSENT_KEYS, r as electronicSignatureMachine, t as createElectronicSignatureManager, u as getDefaultConsentChecks } from "./electronicSignatureManager-DkKQ07vx.esm.js";
2
2
  //#region src/modules/ae-signature/index.ts
3
3
  function createAeSignatureManager(options) {
4
4
  return createElectronicSignatureManager({ config: {
@@ -1,4 +1,4 @@
1
- import { l as trueSightLog, u as categoryForEndpoint } from "./trueSightService-DLzYznkh.esm.js";
1
+ import { l as trueSightLog, u as categoryForEndpoint } from "./trueSightService-TqmmYye3.esm.js";
2
2
  //#region src/internal/http/apiError.ts
3
3
  /**
4
4
  * Incode API error.
@@ -1,4 +1,4 @@
1
- import { C as authenticationMachine, S as createAuthenticationActor, b as AuthenticationActor, x as CreateAuthenticationActorOptions } from "./faceCaptureManagerFactory-CzUr_ZPq.js";
2
- import { t as AuthenticationConfig } from "./types-m4t_cT5J.js";
3
- import { n as AuthenticationState, r as createAuthenticationManager, t as AuthenticationManager } from "./authenticationManager-BCkV6CSG.js";
1
+ import { C as authenticationMachine, S as createAuthenticationActor, b as AuthenticationActor, x as CreateAuthenticationActorOptions } from "./faceCaptureManagerFactory-DqrYpjA5.js";
2
+ import { t as AuthenticationConfig } from "./types-BhHF-CuL.js";
3
+ import { n as AuthenticationState, r as createAuthenticationManager, t as AuthenticationManager } from "./authenticationManager-D7UUqgnN.js";
4
4
  export { type AuthenticationActor, type AuthenticationConfig, type AuthenticationManager, type AuthenticationState, type CreateAuthenticationActorOptions, authenticationMachine, createAuthenticationActor, createAuthenticationManager };
@@ -1,3 +1,3 @@
1
- import { t as authenticationMachine } from "./authenticationStateMachine-Cto_G5bN.esm.js";
2
- import { r as createAuthenticationActor, t as createAuthenticationManager } from "./authenticationManager-DqBOkMzk.esm.js";
1
+ import { t as authenticationMachine } from "./authenticationStateMachine-CUXpIxAD.esm.js";
2
+ import { r as createAuthenticationActor, t as createAuthenticationManager } from "./authenticationManager-CN26fkJa.esm.js";
3
3
  export { authenticationMachine, createAuthenticationActor, createAuthenticationManager };
@@ -1,9 +1,9 @@
1
- import { l as BrowserStorageProvider } from "./setup-BHJ3-fhX.esm.js";
2
- import { r as WasmUtilProvider } from "./safeStorage-Dp9m6aOh.esm.js";
1
+ import { l as BrowserStorageProvider } from "./setup-CfNAVG-d.esm.js";
2
+ import { r as WasmUtilProvider } from "./safeStorage-1O9k0ulP.esm.js";
3
3
  import { n as eventModuleNames } from "./events-ijlbX_Wx.esm.js";
4
4
  import { s as createActor } from "./xstate.esm-BuFLFuzz.esm.js";
5
- import { t as createFaceCaptureManagerFromActor } from "./faceCaptureManagerFactory-kDmbL0I7.esm.js";
6
- import { t as authenticationMachine } from "./authenticationStateMachine-Cto_G5bN.esm.js";
5
+ import { t as createFaceCaptureManagerFromActor } from "./faceCaptureManagerFactory-D_EjQnnE.esm.js";
6
+ import { t as authenticationMachine } from "./authenticationStateMachine-CUXpIxAD.esm.js";
7
7
  //#region src/modules/authentication/authenticationActor.ts
8
8
  function createAuthenticationActor(options) {
9
9
  const dependencies = options.dependencies ?? {
@@ -1,6 +1,6 @@
1
1
  import { t as Manager } from "./Manager-CQQ99QOI.js";
2
2
  import { t as IVisibilityObserverCapability } from "./IVisibilityObserverCapability-D4tvIB5v.js";
3
- import { b as AuthenticationActor, n as FaceCaptureManagerState, t as FaceCaptureManager, x as CreateAuthenticationActorOptions } from "./faceCaptureManagerFactory-CzUr_ZPq.js";
3
+ import { b as AuthenticationActor, n as FaceCaptureManagerState, t as FaceCaptureManager, x as CreateAuthenticationActorOptions } from "./faceCaptureManagerFactory-DqrYpjA5.js";
4
4
  //#region src/modules/authentication/authenticationManager.d.ts
5
5
  type AuthenticationState = FaceCaptureManagerState;
6
6
  /**
@@ -1,12 +1,9 @@
1
- import { t as api } from "./api-Bx3gKW_y.esm.js";
2
- import { t as endpoints } from "./endpoints-D3B9mUHh.esm.js";
3
- import { t as addDeviceStats } from "./stats-DkK-f8JT.esm.js";
4
1
  import { i as assign } from "./xstate.esm-BuFLFuzz.esm.js";
5
2
  import { n as fromPromise } from "./xstate-actors.esm-BXeQ-Ucz.esm.js";
6
- import { t as faceCaptureMachine } from "./faceCaptureSetup-CAGBnLVx.esm.js";
7
- import { i as prepareOnDeviceFaceUpload, n as isOnDeviceMode, r as postOnDeviceFaceResults, t as defaultPrepareFaceUpload } from "./onDeviceFaceResults-hle2Ci9l.esm.js";
8
- import { t as getDeviceClass } from "./getDeviceClass-5NYZg9s6.esm.js";
3
+ import { n as createDefaultProtectedFaceControllerActor, t as faceCaptureMachine } from "./faceCaptureSetup-WeO8-TfR.esm.js";
4
+ import { u as isOnDeviceMode } from "./FaceDetectionProvider-0bWjPgW5.esm.js";
9
5
  import { t as FACE_ERROR_CODES } from "./types-BN5RPPIZ.esm.js";
6
+ import { s as PROTECTED_CAPTURE_TARGET } from "./createCameraCycleOwnership-DQ5-F2oW.esm.js";
10
7
  //#region src/modules/authentication/authenticationErrorUtils.ts
11
8
  const AUTH_ERROR_MAP = {
12
9
  SPOOF_ATTEMPT_DETECTED: FACE_ERROR_CODES.SPOOF_ATTEMPT_DETECTED,
@@ -42,46 +39,6 @@ const isTerminalAuthError = (response, attemptsRemaining) => {
42
39
  return false;
43
40
  };
44
41
  //#endregion
45
- //#region src/modules/authentication/authenticationUploadService.ts
46
- async function uploadAuthFace(params) {
47
- try {
48
- const payload = {
49
- base64Image: params.encryptedBase64Image,
50
- faceCoordinates: params.faceCoordinates ?? void 0,
51
- encrypted: true,
52
- clientInfo: { deviceClass: getDeviceClass() },
53
- metadata: params.metadata ?? void 0,
54
- ...params.authHint !== void 0 && { hint: params.authHint }
55
- };
56
- const query = {};
57
- if (params.recordingId) query.recordingId = params.recordingId;
58
- const res = await api.post(endpoints.authenticate, payload, {
59
- signal: params.signal,
60
- query
61
- });
62
- if (!res.ok) throw new Error(`POST ${endpoints.authenticate} failed: ${res.status} ${res.statusText}`);
63
- if (params.deepsightService) addDeviceStats({
64
- frontIdStatsAnalysisStatus: "",
65
- backIdStatsAnalysisStatus: "",
66
- selfieStatsAnalysisStatus: params.deepsightService.getAnalysisStatus(),
67
- motionStatus: params.deepsightService.getMotionStatus()
68
- });
69
- return res.data;
70
- } catch (error) {
71
- const errorCode = getAuthErrorCodeFromHttpError(error);
72
- if (errorCode) throw new Error(errorCode);
73
- throw new Error(FACE_ERROR_CODES.SERVER);
74
- }
75
- }
76
- const getAuthErrorCodeFromHttpError = (error) => {
77
- const err = error;
78
- if (err.ok !== false || typeof err.status !== "number") return;
79
- if (err.status !== 400) return FACE_ERROR_CODES.SERVER;
80
- const errorName = err.data?.error?.name;
81
- if (!errorName) return FACE_ERROR_CODES.BAD_REQUEST;
82
- return AUTH_ERROR_MAP[errorName] ?? FACE_ERROR_CODES.BAD_REQUEST;
83
- };
84
- //#endregion
85
42
  //#region src/modules/authentication/authenticationStateMachine.ts
86
43
  /**
87
44
  * Narrow the base machine's opaque `uploadResponse` (Record<string, unknown>)
@@ -90,22 +47,9 @@ const getAuthErrorCodeFromHttpError = (error) => {
90
47
  const authUploadResponse = (context) => context.uploadResponse;
91
48
  const authenticationMachine = faceCaptureMachine.provide({
92
49
  actors: {
93
- prepareFaceUpload: fromPromise(async ({ input }) => {
94
- const ctx = input;
95
- return isOnDeviceMode(ctx.config) ? prepareOnDeviceFaceUpload(ctx) : defaultPrepareFaceUpload(ctx);
96
- }),
97
- uploadFace: fromPromise(async ({ input, signal }) => {
98
- const ctx = input;
99
- if (isOnDeviceMode(ctx.config)) return postOnDeviceFaceResults(ctx, signal);
100
- return uploadAuthFace({
101
- encryptedBase64Image: ctx.encryptedBase64Image,
102
- faceCoordinates: ctx.faceCoordinates,
103
- authHint: ctx.authHint,
104
- metadata: ctx.deepsightService?.getMetadata(),
105
- recordingId: ctx.uploadRecordingId,
106
- deepsightService: ctx.deepsightService ?? void 0,
107
- signal
108
- });
50
+ protectedFaceController: createDefaultProtectedFaceControllerActor({
51
+ target: PROTECTED_CAPTURE_TARGET.authentication,
52
+ delivery: "protected"
109
53
  }),
110
54
  processFace: fromPromise(async () => ({}))
111
55
  },
package/dist/avatar.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { i as createFaceAvatar, n as FaceAvatarHandle, o as AvatarFaceState, r as FaceAvatarOptions, t as AvatarId } from "./createFaceAvatar-pUEkdk4X.js";
1
+ import { i as createFaceAvatar, n as FaceAvatarHandle, o as AvatarFaceState, r as FaceAvatarOptions, t as AvatarId } from "./createFaceAvatar-CTM9aj9Q.js";
2
2
  export { type AvatarFaceState, type AvatarId, type FaceAvatarHandle, type FaceAvatarOptions, createFaceAvatar };
@@ -1,2 +1,2 @@
1
- import { t as createFaceAvatar } from "./createFaceAvatar-DQKaRise.esm.js";
1
+ import { t as createFaceAvatar } from "./createFaceAvatar-BNHdeFj8.esm.js";
2
2
  export { createFaceAvatar };
@@ -1,5 +1,5 @@
1
1
  import { a as isIOS, c as isIPhone14OrHigher, d as isSafari, i as isDesktop, t as isAndroid } from "./platform-DkcRc9JV.esm.js";
2
- import { a as stopCameraStream, n as enumerateVideoDevices, r as requestCameraAccess, t as applyTrackConstraints } from "./camera-_2sXMXiF.esm.js";
2
+ import { i as requestCameraAccess, n as enumerateVideoDevices, o as stopCameraStream, t as applyTrackConstraints } from "./camera-sIa9ceW2.esm.js";
3
3
  import { t as sleep } from "./ITimerCapability-DgdDzp8G.esm.js";
4
4
  import { t as getBrowser } from "./getBrowser-Cbe1C4Tn.esm.js";
5
5
  //#region src/internal/camera/backCameraStream.ts
@@ -213,8 +213,11 @@ async function getAndroidBackCameraStream(fallbackLevel = 0) {
213
213
  const mainCamera = selectMainCameraFromStream(track, await getCameras());
214
214
  stopCameraStream(initialStream);
215
215
  if (!mainCamera) throw new Error("Could not identify main camera");
216
+ const acquisitionConstraints = getAndroidFinalConstraints(mainCamera, fallbackLevel);
217
+ const finalStream = await requestCameraAccess({ video: acquisitionConstraints });
216
218
  return {
217
- stream: await requestCameraAccess({ video: getAndroidFinalConstraints(mainCamera, fallbackLevel) }),
219
+ stream: finalStream,
220
+ constraints: await applyAutofocusHint(finalStream, acquisitionConstraints),
218
221
  fallbackLevel
219
222
  };
220
223
  } catch (error) {
@@ -232,16 +235,52 @@ async function getAndroidBackCameraStream(fallbackLevel = 0) {
232
235
  }
233
236
  }
234
237
  async function getFirefoxAndroidBackCameraStream() {
238
+ const requestConstraints = getDesktopConstraints({ facingMode: "environment" });
239
+ const acquisitionConstraints = getVideoTrackConstraints(requestConstraints);
240
+ const stream = await requestCameraAccess(requestConstraints);
235
241
  return {
236
- stream: await requestCameraAccess(getDesktopConstraints({ facingMode: "environment" })),
242
+ stream,
243
+ constraints: await applyAutofocusHint(stream, acquisitionConstraints),
237
244
  fallbackLevel: 0
238
245
  };
239
246
  }
240
- async function applyFocusHint(stream) {
247
+ /**
248
+ * Preserve SDK 1's iOS focus-distance hint and request the browser's continuous
249
+ * autofocus mode on any selected back-camera track that advertises it.
250
+ *
251
+ * This is deliberately capability-gated and best-effort. A fixed focus
252
+ * distance on Android can blur a close document, while an unsupported advanced
253
+ * constraint must never make camera acquisition fail.
254
+ */
255
+ async function applyAutofocusHint(stream, acquisitionConstraints, includeIOSFocusDistance = false) {
241
256
  const videoTrack = stream.getVideoTracks()[0];
257
+ if (!videoTrack) return acquisitionConstraints;
258
+ let focusMode;
242
259
  try {
243
- await applyTrackConstraints(videoTrack, { advanced: [{ focusDistance: 1 }] });
260
+ const advertisedModes = (videoTrack.getCapabilities?.())?.focusMode;
261
+ const supportedModes = Array.isArray(advertisedModes) ? advertisedModes : advertisedModes ? [advertisedModes] : [];
262
+ focusMode = supportedModes.includes("continuous") ? "continuous" : supportedModes.includes("auto") ? "auto" : void 0;
244
263
  } catch {}
264
+ if (!focusMode && !includeIOSFocusDistance) return acquisitionConstraints;
265
+ const focusConstraints = {
266
+ ...focusMode ? { focusMode } : {},
267
+ ...includeIOSFocusDistance ? { focusDistance: 1 } : {}
268
+ };
269
+ const constraints = {
270
+ ...acquisitionConstraints,
271
+ advanced: [...acquisitionConstraints.advanced ?? [], focusConstraints]
272
+ };
273
+ try {
274
+ await applyTrackConstraints(videoTrack, constraints);
275
+ return constraints;
276
+ } catch {
277
+ try {
278
+ await applyTrackConstraints(videoTrack, { advanced: [focusConstraints] });
279
+ return constraints;
280
+ } catch {
281
+ return acquisitionConstraints;
282
+ }
283
+ }
245
284
  }
246
285
  function getIOSConstraints() {
247
286
  return {
@@ -254,9 +293,13 @@ function getIOSConstraints() {
254
293
  };
255
294
  }
256
295
  async function getIOSCameraStream() {
257
- const stream = await requestCameraAccess(getIOSConstraints());
258
- await applyFocusHint(stream);
259
- return stream;
296
+ const requestConstraints = getIOSConstraints();
297
+ const acquisitionConstraints = getVideoTrackConstraints(requestConstraints);
298
+ const stream = await requestCameraAccess(requestConstraints);
299
+ return {
300
+ stream,
301
+ constraints: await applyAutofocusHint(stream, acquisitionConstraints, true)
302
+ };
260
303
  }
261
304
  function getDesktopVideoConstraints(level) {
262
305
  switch (level) {
@@ -335,17 +378,26 @@ function getDesktopConstraints(options, level = 0) {
335
378
  }
336
379
  };
337
380
  }
338
- async function getDesktopCameraStream(options, fallbackLevel = 0) {
381
+ function getVideoTrackConstraints(constraints) {
382
+ return constraints.video && typeof constraints.video !== "boolean" ? constraints.video : {};
383
+ }
384
+ async function getDesktopCameraStreamResult(options, fallbackLevel = 0) {
339
385
  if (fallbackLevel > 5) throw new Error("Failed to get desktop camera after all fallback attempts");
340
386
  const constraints = getDesktopConstraints(options, fallbackLevel);
341
387
  try {
342
- return await requestCameraAccess(constraints);
388
+ return {
389
+ stream: await requestCameraAccess(constraints),
390
+ constraints: getVideoTrackConstraints(constraints)
391
+ };
343
392
  } catch (error) {
344
393
  const nextLevel = fallbackLevel + 1;
345
394
  if (nextLevel > 5) throw error;
346
- return getDesktopCameraStream(options, nextLevel);
395
+ return getDesktopCameraStreamResult(options, nextLevel);
347
396
  }
348
397
  }
398
+ async function getDesktopCameraStream(options, fallbackLevel = 0) {
399
+ return (await getDesktopCameraStreamResult(options, fallbackLevel)).stream;
400
+ }
349
401
  /**
350
402
  * Pick the best back-facing device from a list already filtered by label.
351
403
  * Prefers the highest megapixel count when labels advertise it, else the first.
@@ -381,17 +433,17 @@ function selectBestBackDevice(devices) {
381
433
  * An explicit deviceId from the caller is always trusted as-is.
382
434
  */
383
435
  async function getDesktopBackCameraStream(deviceId) {
384
- if (deviceId) return getDesktopCameraStream({ deviceId });
385
- const original = await getDesktopCameraStream({ facingMode: "environment" });
386
- const track = original.getVideoTracks()[0];
436
+ if (deviceId) return getDesktopCameraStreamResult({ deviceId });
437
+ const original = await getDesktopCameraStreamResult({ facingMode: "environment" });
438
+ const track = original.stream.getVideoTracks()[0];
387
439
  if (track && isBackCameraLabel(track.label)) return original;
388
440
  const backDevices = (await enumerateVideoDevices()).filter((d) => isBackCameraLabel(d.label));
389
441
  if (backDevices.length === 0) return original;
390
442
  const target = selectBestBackDevice(backDevices);
391
443
  if (track && track.getSettings().deviceId === target.deviceId) return original;
392
444
  try {
393
- const corrected = await getDesktopCameraStream({ deviceId: target.deviceId });
394
- stopCameraStream(original);
445
+ const corrected = await getDesktopCameraStreamResult({ deviceId: target.deviceId });
446
+ stopCameraStream(original.stream);
395
447
  return corrected;
396
448
  } catch {
397
449
  return original;
@@ -435,12 +487,17 @@ async function ensureFrontCameraStream(open) {
435
487
  }
436
488
  }
437
489
  async function getBackCameraStream(deviceId) {
438
- if (isIOS()) return { stream: await getIOSCameraStream() };
490
+ if (isIOS()) return getIOSCameraStream();
439
491
  if (isAndroid()) {
440
492
  if (getBrowser() === "firefox") return getFirefoxAndroidBackCameraStream();
441
493
  return getAndroidBackCameraStream(0);
442
494
  }
443
- return { stream: await getDesktopBackCameraStream(deviceId) };
495
+ const acquired = await getDesktopBackCameraStream(deviceId);
496
+ const constraints = await applyAutofocusHint(acquired.stream, acquired.constraints);
497
+ return {
498
+ stream: acquired.stream,
499
+ constraints
500
+ };
444
501
  }
445
502
  //#endregion
446
503
  export { isBackFacingTrack as a, hasBackCamera as i, getBackCameraStream as n, getDesktopCameraStream as r, ensureFrontCameraStream as t };
@@ -126,6 +126,24 @@ async function requestCameraWithFallback(baseConstraints, fallbacks = DEFAULT_RE
126
126
  }
127
127
  throw new Error("All camera resolution fallbacks failed");
128
128
  }
129
+ /**
130
+ * Preserve the constraints used for an acquired camera while pinning future
131
+ * acquisitions to the device the browser actually selected.
132
+ *
133
+ * Protected WASM PRC/POC may reacquire the stream. Advisory constraints such
134
+ * as `facingMode` are not enough on devices with multiple matching cameras,
135
+ * so the selected device must be replayed as an exact constraint.
136
+ */
137
+ function getCameraReacquisitionConstraints(track, acquisitionConstraints) {
138
+ if (!track) return acquisitionConstraints;
139
+ const constraints = acquisitionConstraints ?? track.getConstraints();
140
+ const selectedDeviceId = track.getSettings().deviceId;
141
+ if (!selectedDeviceId) return constraints;
142
+ return {
143
+ ...constraints,
144
+ deviceId: { exact: selectedDeviceId }
145
+ };
146
+ }
129
147
  function stopCameraStream(stream) {
130
148
  for (const track of stream.getTracks()) track.stop();
131
149
  }
@@ -137,4 +155,4 @@ async function applyTrackConstraints(track, constraints) {
137
155
  await track.applyConstraints(constraints);
138
156
  }
139
157
  //#endregion
140
- export { stopCameraStream as a, requestCameraWithFallback as i, enumerateVideoDevices as n, clearCameraGrantedInDocument as o, requestCameraAccess as r, isCameraGrantedInDocument as s, applyTrackConstraints as t };
158
+ export { requestCameraWithFallback as a, isCameraGrantedInDocument as c, requestCameraAccess as i, enumerateVideoDevices as n, stopCameraStream as o, getCameraReacquisitionConstraints as r, clearCameraGrantedInDocument as s, applyTrackConstraints as t };
@@ -1,2 +1,2 @@
1
- import { i as requestPermission, t as checkPermission } from "./permissionServices-f7nBnW5P.esm.js";
1
+ import { i as requestPermission, t as checkPermission } from "./permissionServices-7lzEiOsO.esm.js";
2
2
  export { checkPermission as checkCameraPermission, requestPermission as requestCameraPermission };
@@ -170,6 +170,25 @@ var IncodeCanvas = class IncodeCanvas {
170
170
  if (base64) this.blobData = IncodeCanvas.base64ToBlob(base64);
171
171
  }
172
172
  /**
173
+ * Creates a JPEG Blob without synchronously encoding the canvas as base64.
174
+ * Returns `null` when the canvas is invalid, encoding is unavailable, or the
175
+ * browser cannot produce a Blob.
176
+ */
177
+ async updateBlobAsync(jpegQuality = 1) {
178
+ if (!this.checkCanvas() || typeof this.canvas.toBlob !== "function") return null;
179
+ const blob = await new Promise((resolve) => {
180
+ this.canvas.toBlob(resolve, "image/jpeg", jpegQuality);
181
+ });
182
+ if (!blob) return null;
183
+ if (this.blobData?.url) URL.revokeObjectURL(this.blobData.url);
184
+ const blobData = {
185
+ blob,
186
+ url: URL.createObjectURL(blob)
187
+ };
188
+ this.blobData = blobData;
189
+ return blobData;
190
+ }
191
+ /**
173
192
  * Converts a base64 string to a Blob and creates a URL for it.
174
193
  */
175
194
  static base64ToBlob(base64) {