@incodetech/core 2.3.0-rc.2 → 2.3.0-rc.3

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 (67) hide show
  1. package/dist/{BrowserDiagnosticsCryptoProvider-Crg8fwBl.esm.js → BrowserDiagnosticsCryptoProvider-C2E4mGEX.esm.js} +1 -1
  2. package/dist/{FaceDetectionProvider-i55W_Jkj.esm.js → FaceDetectionProvider-DAVK6BAe.esm.js} +4 -4
  3. package/dist/ae-signature.esm.js +1 -1
  4. package/dist/{apiError-DcnaKSwk.esm.js → apiError-BArJSmSN.esm.js} +1 -1
  5. package/dist/authentication.d.ts +2 -2
  6. package/dist/authentication.esm.js +2 -2
  7. package/dist/{authenticationManager-D-UWdyhr.esm.js → authenticationManager-DNciG_Ri.esm.js} +3 -3
  8. package/dist/{authenticationManager-CjXBjC-c.d.ts → authenticationManager-DcTHmYmL.d.ts} +1 -1
  9. package/dist/{authenticationStateMachine-Cklrmjfo.esm.js → authenticationStateMachine-BFOcuSH6.esm.js} +2 -2
  10. package/dist/consent.d.ts +1 -1
  11. package/dist/{consentManager-BhYFeKiG.d.ts → consentManager-uhDPdU6i.d.ts} +8 -8
  12. package/dist/{deepsightLoader-BNDIPbEK.esm.js → deepsightLoader-DPJZSnHo.esm.js} +3 -3
  13. package/dist/document-capture.d.ts +1 -1
  14. package/dist/{documentCaptureManager-DensIj5F.d.ts → documentCaptureManager-DD0qtFdE.d.ts} +1 -1
  15. package/dist/dynamic-forms.esm.js +2 -2
  16. package/dist/{dynamicFormsManager-DOu0Xgs0.esm.js → dynamicFormsManager-BDi3ffWG.esm.js} +1 -1
  17. package/dist/{dynamicFormsStateMachine-DehYndAZ.esm.js → dynamicFormsStateMachine-B7-mpYDT.esm.js} +1 -1
  18. package/dist/ekyb.esm.js +3 -3
  19. package/dist/{ekybManager-CCcz4-FC.esm.js → ekybManager-BfpqWpNP.esm.js} +1 -1
  20. package/dist/{ekybStateMachine-xesYf5pK.esm.js → ekybStateMachine-BGnzaF__.esm.js} +1 -1
  21. package/dist/electronic-signature.esm.js +1 -1
  22. package/dist/{electronicSignatureManager-8VGN2aKU.esm.js → electronicSignatureManager-Bc8MLmTL.esm.js} +1 -1
  23. package/dist/extensibility.d.ts +7 -7
  24. package/dist/extensibility.esm.js +10 -10
  25. package/dist/{faceCaptureManagerFactory-BeUl8fl1.d.ts → faceCaptureManagerFactory-Cx-8SqRy.d.ts} +45 -37
  26. package/dist/{faceCaptureManagerFactory-Bl6EffXD.esm.js → faceCaptureManagerFactory-qPW__uXd.esm.js} +1 -1
  27. package/dist/{faceCaptureSetup-CDGmqC8J.esm.js → faceCaptureSetup-DpM1YYl9.esm.js} +243 -42
  28. package/dist/{feature-management-J3rr-HDW.esm.js → feature-management-Bzr9uaS4.esm.js} +1 -1
  29. package/dist/feature-management.esm.js +1 -1
  30. package/dist/flow.esm.js +3 -3
  31. package/dist/{flowCompletionService-CayNS1FR.esm.js → flowCompletionService-D0qKFy5Y.esm.js} +1 -1
  32. package/dist/{flowServices-DX5ygAyn.esm.js → flowServices-CnyFU9Bz.esm.js} +4 -4
  33. package/dist/geolocation.esm.js +2 -2
  34. package/dist/{geolocationManager-DYXuNsN2.esm.js → geolocationManager-BqM__4xb.esm.js} +1 -1
  35. package/dist/{geolocationStateMachine-C-37vSiR.esm.js → geolocationStateMachine-DpxY4O3h.esm.js} +1 -1
  36. package/dist/id-selfie-flow.esm.js +8 -7
  37. package/dist/id.esm.js +3 -3
  38. package/dist/idCaptureDefaults-Cd-qOMUt.esm.js +282 -0
  39. package/dist/{idCaptureManager-BFtpmjsP.esm.js → idCaptureManager-CO4WBQQN.esm.js} +3 -3
  40. package/dist/{idCaptureServices-C7aPT72E.esm.js → idCaptureServices-CFuKdAW7.esm.js} +4 -4
  41. package/dist/{idCaptureStateMachine-BEbzg_R1.esm.js → idCaptureStateMachine-CzyZ_21z.esm.js} +9 -9
  42. package/dist/identity-reuse.d.ts +1 -1
  43. package/dist/{identityReuseManager-v2TH5g7e.d.ts → identityReuseManager-BFDI7iFK.d.ts} +4 -4
  44. package/dist/index.esm.js +1 -1
  45. package/dist/mandatory-consent.d.ts +1 -1
  46. package/dist/{mandatoryConsentManager-vhv1co_n.d.ts → mandatoryConsentManager-Csfl7_XQ.d.ts} +4 -4
  47. package/dist/{multipartRecordingService-OEgIRvqC.esm.js → multipartRecordingService-CuXLH4tK.esm.js} +446 -1
  48. package/dist/personhood.esm.js +4 -4
  49. package/dist/qe-signature.esm.js +1 -1
  50. package/dist/{runChildModule-CT0aKjFV.esm.js → runChildModule-CTeh8a1T.esm.js} +1 -1
  51. package/dist/{sdkVersion-DTrl2Jm7.esm.js → sdkVersion-DYlnESxD.esm.js} +1 -1
  52. package/dist/selfie.d.ts +2 -2
  53. package/dist/selfie.esm.js +5 -5
  54. package/dist/{selfieManager-0gvnAH1m.esm.js → selfieManager-CFGf-DmP.esm.js} +3 -3
  55. package/dist/{selfieManager-4RRLi21P.d.ts → selfieManager-jXqwqosi.d.ts} +1 -1
  56. package/dist/{selfieStateMachine-rfneTd9x.esm.js → selfieStateMachine-BJVwANex.esm.js} +2 -2
  57. package/dist/{session-ZAdron5D.esm.js → session-Cs6z9Stj.esm.js} +3 -3
  58. package/dist/session.esm.js +4 -4
  59. package/dist/{sessionInitializer-C1A6s33W.esm.js → sessionInitializer-DKCQfxZ2.esm.js} +3 -3
  60. package/dist/{setup-6e71xCI7.esm.js → setup-B-qr0dC6.esm.js} +4 -4
  61. package/dist/{trueSightService-DJ1kSDlH.esm.js → trueSightService-De306VXK.esm.js} +3 -3
  62. package/dist/video-selfie.esm.js +4 -5
  63. package/dist/{videoSelfieCameraWarmer-BqXupt3L.esm.js → videoSelfieCameraWarmer-BRz5aQPN.esm.js} +3 -3
  64. package/dist/wasm.esm.js +1 -1
  65. package/dist/workflow.esm.js +14 -14
  66. package/package.json +3 -3
  67. package/dist/idCaptureDefaults-CxOh31Xf.esm.js +0 -727
@@ -1,21 +1,21 @@
1
1
  import { t as getTimestamp } from "./IBrowserEnvironmentCapability-DEaRRk-R.esm.js";
2
2
  import { r as getToken, t as api } from "./api-Bx3gKW_y.esm.js";
3
- import { l as trueSightLog, m as isTrueSightTesting } from "./trueSightService-DJ1kSDlH.esm.js";
4
- import "./sessionInitializer-C1A6s33W.esm.js";
3
+ import { l as trueSightLog, m as isTrueSightTesting } from "./trueSightService-De306VXK.esm.js";
4
+ import "./sessionInitializer-DKCQfxZ2.esm.js";
5
5
  import { t as endpoints } from "./endpoints-B-3Q-LUw.esm.js";
6
6
  import { t as addDeviceStats } from "./stats-CZcy2J53.esm.js";
7
7
  import { t as isAndroid } from "./platform-DkcRc9JV.esm.js";
8
8
  import { i as assign, n as enqueueActions, r as sendTo, t as setup } from "./xstate.esm-BuFLFuzz.esm.js";
9
9
  import { n as fromPromise, t as fromCallback } from "./xstate-actors.esm-BXeQ-Ucz.esm.js";
10
10
  import { n as invokeRequestPermissionActor, t as checkPermission } from "./permissionServices-Bj_fyWtv.esm.js";
11
- import { a as sendLabelInspectionEvent, i as initializeDeepsightSession, r as initializeCamera, s as stopStream, t as FaceDetectionProvider } from "./FaceDetectionProvider-i55W_Jkj.esm.js";
11
+ import { a as sendLabelInspectionEvent, i as initializeDeepsightSession, r as initializeCamera, s as stopStream, t as FaceDetectionProvider } from "./FaceDetectionProvider-DAVK6BAe.esm.js";
12
12
  import { t as FACE_ERROR_CODES } from "./types-BN5RPPIZ.esm.js";
13
13
  import { a as flagFaceManualReview, i as imageFileToDataUrl, n as runProtectedAttempt, r as cameraCycleProvider, s as PROTECTED_CAPTURE_TARGET, t as createCameraCycleOwnership } from "./createCameraCycleOwnership-CX3hJGKc.esm.js";
14
14
  import { n as releaseFaceAvatarWarmup, r as warmFaceAvatar, t as createFaceAvatar } from "./createFaceAvatar-BNHdeFj8.esm.js";
15
15
  import { t as IncodeCanvas } from "./canvas-BxFzWTt-.esm.js";
16
16
  import { n as needsMotionPrimeOnlyFromPermission, r as resolveStoredPermissionResult, t as isReadyForCaptureFromPermission } from "./permissionGuards-uYZYFu4J.esm.js";
17
17
  import { t as getDeviceClass } from "./getDeviceClass-5NYZg9s6.esm.js";
18
- import { n as getAdaptiveMediaRecorderOptions, t as MultipartRecordingService } from "./multipartRecordingService-OEgIRvqC.esm.js";
18
+ import { n as CameraCompositor, r as getAdaptiveMediaRecorderOptions, t as MultipartRecordingService } from "./multipartRecordingService-CuXLH4tK.esm.js";
19
19
  //#region src/internal/avatar/concealment.ts
20
20
  /**
21
21
  * Maps a backend concealment option to the internal avatar flags. `OPTION_NONE`
@@ -592,49 +592,146 @@ var LocalRecordingService = class {
592
592
  * the interview asynchronously by the backend's `selfie` scope consumer, so
593
593
  * its upload id must not be forwarded to `/omni/add/face` as a legacy
594
594
  * `recordingId`.
595
+ *
596
+ * The recording is scoped to the capture step (ENG-56648). The recorder
597
+ * records a stable `CameraCompositor` stream instead of a raw camera clone, so
598
+ * every attempt can end its own clone before PRC and POC run and the next
599
+ * attempt swaps a fresh clone into the same multipart upload. The owning
600
+ * controller completes the upload once the backend accepts a capture or the
601
+ * step ends without a retry.
595
602
  */
596
603
  var MultipartFaceRecordingService = class {
597
604
  constructor() {
598
605
  this.service = new MultipartRecordingService("selfie");
606
+ this.audioSource = [];
607
+ this.needsVideoSourceReplacement = false;
599
608
  this.pausedForAttempt = false;
609
+ this.startInFlight = false;
610
+ this.suspendRequested = false;
611
+ this.stopping = false;
600
612
  }
601
613
  async start(stream) {
602
- if (this.pausedForAttempt) {
603
- if (!this.service.resume()) throw new Error("Face recording did not resume");
604
- this.pausedForAttempt = false;
614
+ if (this.stopping) throw new Error("Face recording already completed");
615
+ if (this.compositor) {
616
+ await this.resume(stream);
617
+ return;
618
+ }
619
+ const recordingSource = stream.clone();
620
+ const compositor = new CameraCompositor({ fps: 30 });
621
+ this.startInFlight = true;
622
+ try {
623
+ const composite = compositor.start(recordingSource);
624
+ await this.service.start(composite);
625
+ } catch (error) {
626
+ compositor.stop();
627
+ recordingSource.getTracks().forEach((track) => track.stop());
628
+ this.service.cleanup();
629
+ throw error;
630
+ } finally {
631
+ this.startInFlight = false;
632
+ }
633
+ if (this.stopping) {
634
+ compositor.stop();
635
+ recordingSource.getTracks().forEach((track) => track.stop());
636
+ this.service.cleanup();
637
+ return;
638
+ }
639
+ this.compositor = compositor;
640
+ this.recordingSource = recordingSource;
641
+ this.audioSource = recordingSource.getAudioTracks();
642
+ if (this.suspendRequested) {
643
+ this.suspendRequested = false;
644
+ this.suspend();
645
+ }
646
+ }
647
+ /**
648
+ * Pauses the container and ends the camera clone on the calling thread. The
649
+ * composite stream and the upload stay open for the next attempt.
650
+ */
651
+ suspend() {
652
+ if (this.stopping) return;
653
+ if (!this.compositor) {
654
+ this.suspendRequested = this.startInFlight;
605
655
  return;
606
656
  }
607
- await this.service.start(stream);
657
+ if (!this.pausedForAttempt) this.pausedForAttempt = this.service.pause();
658
+ this.releaseCameraClone({ keepAudio: true });
659
+ this.needsVideoSourceReplacement = true;
608
660
  }
609
661
  async prepareUpload() {
610
- this.pausedForAttempt = this.service.pause();
662
+ this.suspend();
611
663
  return { recordingId: null };
612
664
  }
613
665
  async stop() {
614
- try {
615
- await this.service.stop();
616
- } finally {
617
- this.pausedForAttempt = false;
618
- }
666
+ await this.complete();
619
667
  return { recordingId: null };
620
668
  }
621
669
  pauseForBackground() {
622
- this.service.pause();
670
+ this.suspend();
623
671
  }
624
- async resumeFromBackground() {
625
- this.service.resume();
672
+ async resumeFromBackground(stream) {
673
+ if (!this.compositor || this.stopping) return;
674
+ await this.resume(stream);
626
675
  }
627
676
  async stopAndGetVideo() {
677
+ await this.complete();
678
+ return { videoBase64: void 0 };
679
+ }
680
+ cleanup() {
681
+ this.suspendRequested = false;
682
+ this.pausedForAttempt = false;
683
+ this.needsVideoSourceReplacement = false;
684
+ this.releaseCameraClone({ keepAudio: false });
685
+ this.compositor?.stop();
686
+ this.compositor = void 0;
687
+ this.recordingSource = void 0;
688
+ this.audioSource = [];
689
+ this.service.cleanup();
690
+ }
691
+ /** Swaps this attempt's camera clone into the composite and resumes. */
692
+ async resume(stream) {
693
+ const compositor = this.compositor;
694
+ if (!compositor) return;
695
+ if (this.needsVideoSourceReplacement) {
696
+ const recordingSource = stream.clone();
697
+ recordingSource.getAudioTracks().forEach((track) => track.stop());
698
+ compositor.switchVideo(recordingSource);
699
+ this.needsVideoSourceReplacement = false;
700
+ this.recordingSource = recordingSource;
701
+ const result = await compositor.resume();
702
+ if (result !== "resumed") throw new Error(`Face recording camera did not resume: ${result}`);
703
+ }
704
+ if (this.pausedForAttempt && !this.service.resume()) throw new Error("Face recording did not resume");
705
+ this.pausedForAttempt = false;
706
+ }
707
+ /**
708
+ * Completes the scoped upload. The camera clone ends synchronously before the
709
+ * drain so a step that ends mid-attempt never pins the camera; the composite
710
+ * stays alive until the recorder has emitted its final chunk.
711
+ */
712
+ async complete() {
713
+ this.stopping = true;
714
+ this.suspendRequested = false;
715
+ this.releaseCameraClone({ keepAudio: false });
628
716
  try {
629
717
  await this.service.stop();
630
718
  } finally {
719
+ this.compositor?.stop();
720
+ this.compositor = void 0;
721
+ this.recordingSource = void 0;
722
+ this.audioSource = [];
631
723
  this.pausedForAttempt = false;
724
+ this.needsVideoSourceReplacement = false;
632
725
  }
633
- return { videoBase64: void 0 };
634
726
  }
635
- cleanup() {
636
- this.pausedForAttempt = false;
637
- this.service.cleanup();
727
+ releaseCameraClone(options) {
728
+ try {
729
+ this.compositor?.pause();
730
+ } catch {}
731
+ const tracks = options.keepAudio ? this.recordingSource?.getVideoTracks() ?? [] : /* @__PURE__ */ new Set([...this.recordingSource?.getTracks() ?? [], ...this.audioSource]);
732
+ for (const track of tracks) try {
733
+ track.stop();
734
+ } catch {}
638
735
  }
639
736
  };
640
737
  /**
@@ -658,51 +755,88 @@ function createRecordingService(params) {
658
755
  //#endregion
659
756
  //#region src/internal/faceCapture/protectedFaceAttempt.ts
660
757
  const ON_DEVICE_MANUAL_CAPTURE_TIMEOUT_MS = 2147483647;
758
+ /**
759
+ * Recorder hooks for one protected face attempt.
760
+ *
761
+ * The recording service comes from the owner of the capture step (the face
762
+ * controller), so a step-scoped service (`suspend` present) is started or
763
+ * resumed by every attempt, paused with its camera clone ended before POC, and
764
+ * suspended again on release; only the controller completes it (ENG-56648).
765
+ * Per-attempt services (local video liveness, capture-only video) keep their
766
+ * stop-before-POC and cleanup-on-release behavior.
767
+ */
661
768
  var ProtectedFaceRecorderHooks = class {
662
- constructor(config, dependencies, delivery) {
663
- this.config = config;
664
- this.dependencies = dependencies;
769
+ constructor(config, delivery, getRecordingService) {
665
770
  this.delivery = delivery;
771
+ this.getRecordingService = getRecordingService;
772
+ this.disposed = false;
666
773
  this.mode = config.onDeviceFaceResultsSubmissionEnabled === true || config.enableFaceRecording !== true && config.deepsightLiveness !== "VIDEOLIVENESS" ? "none" : "finalizeBeforePoc";
667
774
  }
668
775
  async start(unprotectedStream) {
669
776
  if (this.mode === "none") return;
670
- const wasmUtil = await this.dependencies.getWasmUtil();
671
- this.service = createRecordingService({
672
- config: this.config,
673
- wasmUtil,
674
- sessionToken: getToken(),
675
- localDelivery: this.delivery === "local"
676
- });
677
- await this.service?.start(unprotectedStream);
777
+ const service = await this.getRecordingService();
778
+ if (!service) return;
779
+ this.service = service;
780
+ if (this.disposed) {
781
+ this.suspendOrCleanup();
782
+ return;
783
+ }
784
+ try {
785
+ await service.start(unprotectedStream);
786
+ } catch (error) {
787
+ if (service.suspend) {
788
+ service.suspend();
789
+ trueSightLog("warning", "recording", "faceScan", "face recording did not resume for this attempt");
790
+ return;
791
+ }
792
+ throw error;
793
+ }
794
+ if (this.disposed) this.suspendOrCleanup();
678
795
  }
679
796
  async prepareForPoc() {
680
- if (!this.service) return {};
797
+ const service = this.service;
798
+ if (!service) return {};
681
799
  if (this.delivery === "local") {
682
800
  try {
683
- const result = await this.service.stopAndGetVideo();
801
+ const result = await service.stopAndGetVideo();
684
802
  this.captureOnlyVideoBase64 = result.videoBase64;
685
803
  } catch {
686
804
  this.captureOnlyVideoBase64 = void 0;
687
805
  }
688
806
  return {};
689
807
  }
690
- return this.service.stop();
808
+ if (service.suspend) return service.prepareUpload();
809
+ return service.stop();
691
810
  }
692
811
  async resumeAfterPoc() {}
693
812
  pauseForBackground() {
694
813
  this.service?.pauseForBackground?.();
695
814
  }
696
815
  async resumeFromBackground(unprotectedStream) {
697
- await this.service?.resumeFromBackground?.(unprotectedStream);
816
+ const service = this.service;
817
+ if (!service?.resumeFromBackground || this.disposed) return;
818
+ try {
819
+ await service.resumeFromBackground(unprotectedStream);
820
+ } catch {
821
+ service.suspend?.();
822
+ trueSightLog("warning", "recording", "faceScan", "face recording did not resume after foreground");
823
+ }
698
824
  }
699
825
  dispose() {
826
+ this.disposed = true;
700
827
  try {
701
- this.service?.cleanup();
828
+ this.suspendOrCleanup();
702
829
  } finally {
703
830
  this.service = void 0;
704
831
  }
705
832
  }
833
+ /** Step-scoped services suspend (the owner completes them); others clean up. */
834
+ suspendOrCleanup() {
835
+ const service = this.service;
836
+ if (!service) return;
837
+ if (service.suspend) service.suspend();
838
+ else service.cleanup();
839
+ }
706
840
  takeCaptureOnlyVideo() {
707
841
  const video = this.captureOnlyVideoBase64;
708
842
  this.captureOnlyVideoBase64 = void 0;
@@ -726,9 +860,19 @@ var ProtectedFaceAttemptRuntime = class ProtectedFaceAttemptRuntime {
726
860
  this.recorderTransferred = false;
727
861
  this.pendingSignals = [];
728
862
  this.provider = options.faceDetection;
729
- this.recorder = new ProtectedFaceRecorderHooks(options.config, options.dependencies, options.delivery);
863
+ this.recorder = new ProtectedFaceRecorderHooks(options.config, options.delivery, options.getRecordingService ?? (() => this.createAttemptRecordingService()));
730
864
  this.cycleOwnership = createCameraCycleOwnership(options.cycle);
731
865
  }
866
+ /** Per-attempt fallback when no step owner supplies the recording service. */
867
+ async createAttemptRecordingService() {
868
+ const wasmUtil = await this.options.dependencies.getWasmUtil();
869
+ return createRecordingService({
870
+ config: this.options.config,
871
+ wasmUtil,
872
+ sessionToken: getToken(),
873
+ localDelivery: this.options.delivery === "local"
874
+ });
875
+ }
732
876
  get delivery() {
733
877
  return this.options.delivery;
734
878
  }
@@ -994,6 +1138,8 @@ function createProtectedFaceControllerActor(options) {
994
1138
  let committedPreview;
995
1139
  let pendingAutoPreview;
996
1140
  let recording = {};
1141
+ let stepRecording;
1142
+ let stepRecordingPending;
997
1143
  let generation = 0;
998
1144
  let active = true;
999
1145
  let diagnosticAttempt = 0;
@@ -1012,6 +1158,48 @@ function createProtectedFaceControllerActor(options) {
1012
1158
  if (!controllerInput) throw new Error("Protected face controller is not bound");
1013
1159
  return controllerInput;
1014
1160
  };
1161
+ /**
1162
+ * One recording service per capture step (ENG-56648). Every attempt of the
1163
+ * step starts or resumes it; `completeStepRecording` completes it when the
1164
+ * backend accepts a capture or the step ends without a retry.
1165
+ */
1166
+ const getStepRecordingService = () => {
1167
+ if (stepRecording) return Promise.resolve(stepRecording);
1168
+ if (stepRecordingPending) return stepRecordingPending;
1169
+ const input = getControllerInput();
1170
+ const pending = (async () => {
1171
+ const wasmUtil = await input.dependencies.getWasmUtil();
1172
+ if (!active) return;
1173
+ stepRecording ??= createRecordingService({
1174
+ config: input.config,
1175
+ wasmUtil,
1176
+ sessionToken: getToken(),
1177
+ localDelivery: options.delivery === "local"
1178
+ });
1179
+ return stepRecording;
1180
+ })();
1181
+ stepRecordingPending = pending;
1182
+ pending.finally(() => {
1183
+ if (stepRecordingPending === pending) stepRecordingPending = void 0;
1184
+ });
1185
+ return pending;
1186
+ };
1187
+ const completeStepRecording = () => {
1188
+ const service = stepRecording;
1189
+ stepRecording = void 0;
1190
+ if (!service) return;
1191
+ if (!service.suspend) {
1192
+ try {
1193
+ service.cleanup();
1194
+ } catch {}
1195
+ return;
1196
+ }
1197
+ service.stop().catch(() => void 0).finally(() => {
1198
+ try {
1199
+ service.cleanup();
1200
+ } catch {}
1201
+ });
1202
+ };
1015
1203
  const ensureRuntime = () => {
1016
1204
  if (!runtime) {
1017
1205
  const input = getControllerInput();
@@ -1027,7 +1215,8 @@ function createProtectedFaceControllerActor(options) {
1027
1215
  acquireCamera: (provider) => initializeCamera({
1028
1216
  config: input.config,
1029
1217
  provider
1030
- })
1218
+ }),
1219
+ getRecordingService: getStepRecordingService
1031
1220
  });
1032
1221
  if (deepsightService) runtime.setDeepsightService(deepsightService);
1033
1222
  }
@@ -1271,12 +1460,16 @@ function createProtectedFaceControllerActor(options) {
1271
1460
  case "RESET":
1272
1461
  releaseCurrent("retry");
1273
1462
  return;
1463
+ case "COMPLETE_RECORDING":
1464
+ completeStepRecording();
1465
+ return;
1274
1466
  case "RELEASE": releaseCurrent(command.reason);
1275
1467
  }
1276
1468
  });
1277
1469
  return () => {
1278
1470
  active = false;
1279
1471
  releaseCurrent("externalStop");
1472
+ completeStepRecording();
1280
1473
  };
1281
1474
  });
1282
1475
  }
@@ -1512,6 +1705,10 @@ const faceCaptureMachine = setup({
1512
1705
  if (!isProtectedFaceControllerRunning(self)) return;
1513
1706
  enqueue.sendTo("protectedFaceController", { type: "RESET" });
1514
1707
  }),
1708
+ completeProtectedRecording: enqueueActions(({ enqueue, self }) => {
1709
+ if (!isProtectedFaceControllerRunning(self)) return;
1710
+ enqueue.sendTo("protectedFaceController", { type: "COMPLETE_RECORDING" });
1711
+ }),
1515
1712
  sendProtectedAutoCapture: enqueueActions(({ enqueue, self, event }) => {
1516
1713
  if (!isProtectedFaceControllerRunning(self)) return;
1517
1714
  enqueue.sendTo("protectedFaceController", {
@@ -2001,7 +2198,7 @@ const faceCaptureMachine = setup({
2001
2198
  }
2002
2199
  ] } },
2003
2200
  success: {
2004
- entry: "cleanup",
2201
+ entry: ["completeProtectedRecording", "cleanup"],
2005
2202
  after: { 3e3: { target: "#faceCapture.processing" } }
2006
2203
  }
2007
2204
  }
@@ -2047,7 +2244,7 @@ const faceCaptureMachine = setup({
2047
2244
  onError: { target: "finished" }
2048
2245
  } },
2049
2246
  terminalProcessing: {
2050
- entry: "cleanup",
2247
+ entry: ["completeProtectedRecording", "cleanup"],
2051
2248
  invoke: {
2052
2249
  id: "processFace",
2053
2250
  src: "processFace",
@@ -2076,7 +2273,11 @@ const faceCaptureMachine = setup({
2076
2273
  type: "final"
2077
2274
  },
2078
2275
  error: {
2079
- entry: ["stopMediaStream", "releaseAvatarWarmup"],
2276
+ entry: [
2277
+ "completeProtectedRecording",
2278
+ "stopMediaStream",
2279
+ "releaseAvatarWarmup"
2280
+ ],
2080
2281
  on: { RESET: {
2081
2282
  target: "idle",
2082
2283
  actions: ["resetProtectedController", "resetContext"]
@@ -1,5 +1,5 @@
1
1
  import { n as __toESM } from "./rolldown-runtime-FDOR9p9I.esm.js";
2
- import { t as SDK_VERSION } from "./sdkVersion-DTrl2Jm7.esm.js";
2
+ import { t as SDK_VERSION } from "./sdkVersion-DYlnESxD.esm.js";
3
3
  import { t as BrowserLazyImportProvider } from "./BrowserLazyImportProvider-BhoA957O.esm.js";
4
4
  let currentEnvironment;
5
5
  /** Effective tier: the explicitly-set value, else the default (see note above). */
@@ -1,2 +1,2 @@
1
- import { E as updateFeatureManagementUser, T as subscribeFeatureManagement, _ as getIsFeatureManagementInitialized, a as stringParam, d as ONBOARDING_WEB_SDK_PARAMETER_STORE, f as getExperiment, g as getFeatureParameterStore, h as getFeatureManagementVersion, i as numberParam, l as resolveExperiment, m as getFeatureGate, n as defineExperimentParams, o as EXPERIMENT_UNAVAILABLE_SENTINEL, p as getFeatureDynamicConfig, r as enumParam, s as exposeExperimentOnce, t as booleanParam, u as resolveExperimentOnce, x as logEvent, y as getLayer } from "./feature-management-J3rr-HDW.esm.js";
1
+ import { E as updateFeatureManagementUser, T as subscribeFeatureManagement, _ as getIsFeatureManagementInitialized, a as stringParam, d as ONBOARDING_WEB_SDK_PARAMETER_STORE, f as getExperiment, g as getFeatureParameterStore, h as getFeatureManagementVersion, i as numberParam, l as resolveExperiment, m as getFeatureGate, n as defineExperimentParams, o as EXPERIMENT_UNAVAILABLE_SENTINEL, p as getFeatureDynamicConfig, r as enumParam, s as exposeExperimentOnce, t as booleanParam, u as resolveExperimentOnce, x as logEvent, y as getLayer } from "./feature-management-Bzr9uaS4.esm.js";
2
2
  export { EXPERIMENT_UNAVAILABLE_SENTINEL, ONBOARDING_WEB_SDK_PARAMETER_STORE, booleanParam, defineExperimentParams, enumParam, exposeExperimentOnce, getExperiment, getFeatureDynamicConfig, getFeatureGate, getFeatureManagementVersion, getFeatureParameterStore, getIsFeatureManagementInitialized, getLayer, logEvent, numberParam, resolveExperiment, resolveExperimentOnce, stringParam, subscribeFeatureManagement, updateFeatureManagementUser };
package/dist/flow.esm.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { v as addEvent } from "./events-ijlbX_Wx.esm.js";
2
- import { a as resolveDashboardModuleConfig, c as getRequiredWasmPipelines, j as mergeDashboardConfig, l as normalizeFlowModules, n as getFlow, o as enrichFlowModuleConfig, r as preloadDashboardFlow, s as getNextRequiredWasmPipelines, t as completeDeferredActivation, u as resolveFlowModuleConfig } from "./flowServices-DX5ygAyn.esm.js";
2
+ import { a as resolveDashboardModuleConfig, c as getRequiredWasmPipelines, j as mergeDashboardConfig, l as normalizeFlowModules, n as getFlow, o as enrichFlowModuleConfig, r as preloadDashboardFlow, s as getNextRequiredWasmPipelines, t as completeDeferredActivation, u as resolveFlowModuleConfig } from "./flowServices-CnyFU9Bz.esm.js";
3
3
  import { i as assign, s as createActor, t as setup, u as createManager } from "./xstate.esm-BuFLFuzz.esm.js";
4
4
  import { n as fromPromise } from "./xstate-actors.esm-BXeQ-Ucz.esm.js";
5
- import { n as getFinishStatus, r as getTotalScoreStatus, t as classifyScoreStatus } from "./flowCompletionService-CayNS1FR.esm.js";
6
- import { n as attachFlowEventEmitter, t as runChildModule } from "./runChildModule-CT0aKjFV.esm.js";
5
+ import { n as getFinishStatus, r as getTotalScoreStatus, t as classifyScoreStatus } from "./flowCompletionService-D0qKFy5Y.esm.js";
6
+ import { n as attachFlowEventEmitter, t as runChildModule } from "./runChildModule-CTeh8a1T.esm.js";
7
7
  import { n as isAdvanceableError } from "./advanceableErrors-CpF2cBy6.esm.js";
8
8
  //#region src/modules/flow/noOpFlowModuleMachine.ts
9
9
  const noOpFlowModuleMachine = setup({}).createMachine({
@@ -1,6 +1,6 @@
1
1
  import { t as api } from "./api-Bx3gKW_y.esm.js";
2
2
  import { t as endpoints } from "./endpoints-B-3Q-LUw.esm.js";
3
- import { i as toIncodeApiError } from "./apiError-DcnaKSwk.esm.js";
3
+ import { i as toIncodeApiError } from "./apiError-BArJSmSN.esm.js";
4
4
  //#region src/modules/flow/flowCompletionService.ts
5
5
  const getFinishStatus = async (flowId, signal) => {
6
6
  const url = `${endpoints.finishStatus}${flowId ? `?flowId=${flowId}` : ""}`;
@@ -1,10 +1,10 @@
1
1
  import { n as getWasmStatus } from "./warmup-CUUnwYxe.esm.js";
2
- import { E as updateFeatureManagementUser } from "./feature-management-J3rr-HDW.esm.js";
2
+ import { E as updateFeatureManagementUser } from "./feature-management-Bzr9uaS4.esm.js";
3
3
  import { r as getToken, t as api } from "./api-Bx3gKW_y.esm.js";
4
- import { i as initializeSession, l as whenSessionFingerprintSettled, r as getSessionFingerprintResult, u as getStandaloneFlowPolicy } from "./sessionInitializer-C1A6s33W.esm.js";
4
+ import { i as initializeSession, l as whenSessionFingerprintSettled, r as getSessionFingerprintResult, u as getStandaloneFlowPolicy } from "./sessionInitializer-DKCQfxZ2.esm.js";
5
5
  import { t as endpoints } from "./endpoints-B-3Q-LUw.esm.js";
6
- import { i as toIncodeApiError } from "./apiError-DcnaKSwk.esm.js";
7
- import "./session-ZAdron5D.esm.js";
6
+ import { i as toIncodeApiError } from "./apiError-BArJSmSN.esm.js";
7
+ import "./session-Cs6z9Stj.esm.js";
8
8
  import { i as toEkycConfig } from "./ekycUtils-Dew1rBG0.esm.js";
9
9
  //#region src/modules/flow/dashboardConfig.ts
10
10
  function isPlainObject(value) {
@@ -1,3 +1,3 @@
1
- import { t as createGeolocationManager } from "./geolocationManager-DYXuNsN2.esm.js";
2
- import { t as geolocationMachine } from "./geolocationStateMachine-C-37vSiR.esm.js";
1
+ import { t as createGeolocationManager } from "./geolocationManager-BqM__4xb.esm.js";
2
+ import { t as geolocationMachine } from "./geolocationStateMachine-DpxY4O3h.esm.js";
3
3
  export { createGeolocationManager, geolocationMachine };
@@ -1,6 +1,6 @@
1
1
  import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-ijlbX_Wx.esm.js";
2
2
  import { s as createActor, u as createManager } from "./xstate.esm-BuFLFuzz.esm.js";
3
- import { t as geolocationMachine } from "./geolocationStateMachine-C-37vSiR.esm.js";
3
+ import { t as geolocationMachine } from "./geolocationStateMachine-DpxY4O3h.esm.js";
4
4
  //#region ../infra/src/providers/browser/BrowserGeolocationProvider.ts
5
5
  var BrowserGeolocationProvider = class {
6
6
  getCurrentPosition() {
@@ -1,7 +1,7 @@
1
1
  import { t as api } from "./api-Bx3gKW_y.esm.js";
2
2
  import { t as endpoints } from "./endpoints-B-3Q-LUw.esm.js";
3
3
  import { a as isIOS, t as isAndroid } from "./platform-DkcRc9JV.esm.js";
4
- import { n as isConnectivityError } from "./apiError-DcnaKSwk.esm.js";
4
+ import { n as isConnectivityError } from "./apiError-BArJSmSN.esm.js";
5
5
  import { i as assign, t as setup } from "./xstate.esm-BuFLFuzz.esm.js";
6
6
  import { n as fromPromise } from "./xstate-actors.esm-BXeQ-Ucz.esm.js";
7
7
  //#region src/modules/geolocation/geolocationServices.ts
@@ -1,18 +1,19 @@
1
- import { t as ensureWasmPipelines } from "./setup-6e71xCI7.esm.js";
1
+ import { t as ensureWasmPipelines } from "./setup-B-qr0dC6.esm.js";
2
2
  import { r as WasmUtilProvider } from "./safeStorage-B-trhxg6.esm.js";
3
3
  import { t as BrowserTimerProvider } from "./BrowserTimerProvider-BXhgNxLt.esm.js";
4
- import { a as resolveDashboardModuleConfig, d as facingModeForStep } from "./flowServices-DX5ygAyn.esm.js";
4
+ import { a as resolveDashboardModuleConfig, d as facingModeForStep } from "./flowServices-CnyFU9Bz.esm.js";
5
5
  import { i as assign, r as sendTo, s as createActor, t as setup, u as createManager } from "./xstate.esm-BuFLFuzz.esm.js";
6
6
  import { n as fromPromise, t as fromCallback } from "./xstate-actors.esm-BXeQ-Ucz.esm.js";
7
- import { n as encryptSelfieImage, o as startDetection, t as FaceDetectionProvider } from "./FaceDetectionProvider-i55W_Jkj.esm.js";
7
+ import { n as encryptSelfieImage, o as startDetection, t as FaceDetectionProvider } from "./FaceDetectionProvider-DAVK6BAe.esm.js";
8
8
  import { t as StreamCanvasProcessingSession } from "./StreamCanvasProcessingSession-CBnbTnOr.esm.js";
9
9
  import { n as getWindowDimensions } from "./getDeviceClass-CeBiEayS.esm.js";
10
10
  import { a as uploadSelfie, r as processFace } from "./selfieErrorUtils-UiQ46EBa.esm.js";
11
- import { i as CameraCompositor, n as DEFAULT_ID_CAPTURE_THRESHOLDS, r as IdCaptureProvider, t as DEFAULT_ID_CAPTURE_GEOMETRY } from "./idCaptureDefaults-CxOh31Xf.esm.js";
12
- import { _ as validateUploadResponse, h as uploadIdImage, u as processId, v as ID_ERROR_CODES } from "./idCaptureServices-C7aPT72E.esm.js";
11
+ import { n as CameraCompositor } from "./multipartRecordingService-CuXLH4tK.esm.js";
12
+ import { n as DEFAULT_ID_CAPTURE_THRESHOLDS, r as IdCaptureProvider, t as DEFAULT_ID_CAPTURE_GEOMETRY } from "./idCaptureDefaults-Cd-qOMUt.esm.js";
13
+ import { _ as validateUploadResponse, h as uploadIdImage, u as processId, v as ID_ERROR_CODES } from "./idCaptureServices-CFuKdAW7.esm.js";
13
14
  import { t as StreamCanvasCapture } from "./StreamCanvasCapture-C9jtgBdT.esm.js";
14
- import { n as getFinishStatus } from "./flowCompletionService-CayNS1FR.esm.js";
15
- import { i as delay, n as defaultAcquireCamera, o as isSelfieValidationError, s as isWrongVideoSelfieIdSide } from "./videoSelfieCameraWarmer-BqXupt3L.esm.js";
15
+ import { n as getFinishStatus } from "./flowCompletionService-D0qKFy5Y.esm.js";
16
+ import { i as delay, n as defaultAcquireCamera, o as isSelfieValidationError, s as isWrongVideoSelfieIdSide } from "./videoSelfieCameraWarmer-BRz5aQPN.esm.js";
16
17
  //#region src/modules/id-selfie-flow/idSelfieFlowStepDetector.ts
17
18
  /** Default autocapture window for the selfie step. */
18
19
  const SELFIE_AUTOCAPTURE_MS = 1e4;
package/dist/id.esm.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { n as eventModuleNames } from "./events-ijlbX_Wx.esm.js";
2
2
  import { i as assign, s as createActor } from "./xstate.esm-BuFLFuzz.esm.js";
3
3
  import { n as fromPromise } from "./xstate-actors.esm-BXeQ-Ucz.esm.js";
4
- import { a as createIdProtectedCaptureController, c as DIGITAL_ID_DOCUMENT_TYPES, d as resolveDigitalIdImplementation, f as MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, h as resolveWalletPlatform, i as createIdCaptureOnlyDeliveryActor, l as DIGITAL_ID_REGISTRY, m as MANUAL_UPLOAD_MAX_RETRIES, n as provideIdProtectedCaptureController, p as MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, r as attachIdProtectedCaptureController, t as idCaptureMachine, u as isRedirectFlowType } from "./idCaptureStateMachine-BEbzg_R1.esm.js";
5
- import { n as createIdCaptureActor, r as createIdCaptureManagerFromActor, t as createIdCaptureManager } from "./idCaptureManager-BFtpmjsP.esm.js";
6
- import { _ as validateUploadResponse, a as getRealQualityValue, b as resolveIdCaptureThresholds, c as pauseRecordingForAttempt, d as resumeRecordingAfterPause, f as startRecordingSession, g as uploadManualIdFile, h as uploadIdImage, i as finalizeRecordingSession, l as prepareRecordingForCameraRetry, m as stopStream, n as barcodeToBase64, o as initializeIdCapture, p as stopRecording, r as disposeRecordingSession, s as isSuspendableRecordingSession, t as addBarcode, u as processId, v as ID_ERROR_CODES } from "./idCaptureServices-C7aPT72E.esm.js";
4
+ import { a as createIdProtectedCaptureController, c as DIGITAL_ID_DOCUMENT_TYPES, d as resolveDigitalIdImplementation, f as MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, h as resolveWalletPlatform, i as createIdCaptureOnlyDeliveryActor, l as DIGITAL_ID_REGISTRY, m as MANUAL_UPLOAD_MAX_RETRIES, n as provideIdProtectedCaptureController, p as MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, r as attachIdProtectedCaptureController, t as idCaptureMachine, u as isRedirectFlowType } from "./idCaptureStateMachine-CzyZ_21z.esm.js";
5
+ import { n as createIdCaptureActor, r as createIdCaptureManagerFromActor, t as createIdCaptureManager } from "./idCaptureManager-CO4WBQQN.esm.js";
6
+ import { _ as validateUploadResponse, a as getRealQualityValue, b as resolveIdCaptureThresholds, c as pauseRecordingForAttempt, d as resumeRecordingAfterPause, f as startRecordingSession, g as uploadManualIdFile, h as uploadIdImage, i as finalizeRecordingSession, l as prepareRecordingForCameraRetry, m as stopStream, n as barcodeToBase64, o as initializeIdCapture, p as stopRecording, r as disposeRecordingSession, s as isSuspendableRecordingSession, t as addBarcode, u as processId, v as ID_ERROR_CODES } from "./idCaptureServices-CFuKdAW7.esm.js";
7
7
  import { t as invokeOnCaptureCallback } from "./invokeOnCaptureCallback-BjzPjJ_p.esm.js";
8
8
  //#region src/modules/id/deviceWallet/deviceWalletErrors.ts
9
9
  /**