@incodetech/core 0.0.0-dev-20260914-e56ce14a → 0.0.0-dev-20260915-eedd82d4

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 (105) hide show
  1. package/dist/{BaseWasmProvider-CO0GfaHM.d.ts → BaseWasmProvider-Dyi6dKp1.d.ts} +1 -1
  2. package/dist/{BrowserDiagnosticsCryptoProvider-QEfW4CMV.esm.js → BrowserDiagnosticsCryptoProvider-Ns6-JLzE.esm.js} +1 -1
  3. package/dist/{FaceDetectionProvider-CyLxkzRP.d.ts → FaceDetectionProvider-LdZ47bWy.d.ts} +2 -2
  4. package/dist/{FaceDetectionProvider-BD3zvnei.esm.js → FaceDetectionProvider-wJitf58B.esm.js} +11 -9
  5. package/dist/{IIdCaptureCapability-nfpic2z2.d.ts → IIdCaptureCapability-RNiFhvXR.d.ts} +1 -1
  6. package/dist/{IWasmUtilCapability-DaP6pfHq.d.ts → IWasmUtilCapability-CXXDA5l1.d.ts} +10 -5
  7. package/dist/{MotionSensorProvider-BnZ8_1Sk.esm.js → MotionSensorProvider-BgTYwg9L.esm.js} +1 -1
  8. package/dist/{StreamCanvasCapture-D9Dz8kqB.d.ts → StreamCanvasCapture-B3YT2Bt6.d.ts} +2 -2
  9. package/dist/ae-signature.esm.js +1 -1
  10. package/dist/{apiError--EXEza2H.esm.js → apiError-CC5v1ZI1.esm.js} +1 -1
  11. package/dist/authentication.d.ts +3 -3
  12. package/dist/authentication.esm.js +2 -2
  13. package/dist/{authenticationManager-74fEUEd9.esm.js → authenticationManager-9Ndo3B9-.esm.js} +4 -4
  14. package/dist/{authenticationManager-D7UUqgnN.d.ts → authenticationManager-DXTIUcma.d.ts} +1 -1
  15. package/dist/{authenticationStateMachine-DdWbed_7.esm.js → authenticationStateMachine-BCIcBGE-.esm.js} +2 -2
  16. package/dist/avatar.d.ts +1 -1
  17. package/dist/camera.esm.js +1 -1
  18. package/dist/{createFaceAvatar-CTM9aj9Q.d.ts → createFaceAvatar-BlcTYgJv.d.ts} +4 -2
  19. package/dist/curp-validation.d.ts +1 -1
  20. package/dist/{curpValidationManager-CTJB2RsD.d.ts → curpValidationManager-SSKNrm5Z.d.ts} +1 -1
  21. package/dist/{deepsightLoader-Dx7dba9o.esm.js → deepsightLoader-DywI_Cln.esm.js} +6 -6
  22. package/dist/document-capture.d.ts +1 -1
  23. package/dist/document-capture.esm.js +2 -2
  24. package/dist/{documentCaptureManager-BwcbMwo5.esm.js → documentCaptureManager-DR_Wv-3H.esm.js} +1 -1
  25. package/dist/{documentCaptureManager-DD0qtFdE.d.ts → documentCaptureManager-DensIj5F.d.ts} +1 -1
  26. package/dist/{documentCaptureStateMachine-F8SCOtL_.esm.js → documentCaptureStateMachine-CWOATHfE.esm.js} +2 -2
  27. package/dist/dynamic-forms.esm.js +2 -2
  28. package/dist/{dynamicFormsManager-06-kEAw5.esm.js → dynamicFormsManager-CZD4HaZY.esm.js} +1 -1
  29. package/dist/{dynamicFormsStateMachine-DA6KFFXF.esm.js → dynamicFormsStateMachine-50ilSDiK.esm.js} +1 -1
  30. package/dist/ekyb.d.ts +1 -1
  31. package/dist/ekyb.esm.js +3 -3
  32. package/dist/{ekybManager-BrJA-R6z.esm.js → ekybManager-BPT_VGSQ.esm.js} +1 -1
  33. package/dist/{ekybStateMachine-R1e0h9ad.esm.js → ekybStateMachine-CNIA7d6-.esm.js} +1 -1
  34. package/dist/electronic-signature.esm.js +1 -1
  35. package/dist/{electronicSignatureManager-8espPS7K.esm.js → electronicSignatureManager-pgoS8NvX.esm.js} +1 -1
  36. package/dist/extensibility.d.ts +12 -12
  37. package/dist/extensibility.esm.js +12 -12
  38. package/dist/{faceCaptureManagerFactory-DqrYpjA5.d.ts → faceCaptureManagerFactory-CvtqcLxs.d.ts} +8 -8
  39. package/dist/{faceCaptureManagerFactory-DuLFqL2Z.esm.js → faceCaptureManagerFactory-DM00JM7H.esm.js} +3 -3
  40. package/dist/{faceCaptureSetup-CfTUCIUt.esm.js → faceCaptureSetup-CVYCvUSc.esm.js} +6 -6
  41. package/dist/{feature-management-DnhTmqlW.esm.js → feature-management-XAltcaKL.esm.js} +1 -1
  42. package/dist/feature-management.esm.js +1 -1
  43. package/dist/flow-events.d.ts +1 -1
  44. package/dist/flow.d.ts +5 -5
  45. package/dist/flow.esm.js +3 -3
  46. package/dist/{flowCompletionService-BcXefdE-.esm.js → flowCompletionService-BnU3Yo4k.esm.js} +1 -1
  47. package/dist/{flowServices-C9ZUPED-.esm.js → flowServices-BdQkcWNs.esm.js} +4 -4
  48. package/dist/geolocation.esm.js +2 -2
  49. package/dist/{geolocationManager-BF0td98B.esm.js → geolocationManager-CEAdL6w_.esm.js} +1 -1
  50. package/dist/{geolocationStateMachine-Ch189Ce6.esm.js → geolocationStateMachine-ClMoFwKO.esm.js} +1 -1
  51. package/dist/home.d.ts +1 -1
  52. package/dist/id-selfie-flow.d.ts +2 -2
  53. package/dist/id-selfie-flow.esm.js +8 -8
  54. package/dist/id.d.ts +3 -3
  55. package/dist/id.esm.js +3 -3
  56. package/dist/{idCaptureDefaults-DOgVQKC_.esm.js → idCaptureDefaults-D34NYQ4a.esm.js} +273 -30
  57. package/dist/{idCaptureManager-D8iqvPZA.esm.js → idCaptureManager-CjWevOsf.esm.js} +5 -5
  58. package/dist/{idCaptureManager-DE_jyr5X.d.ts → idCaptureManager-CvmHOWWd.d.ts} +8 -8
  59. package/dist/{idCaptureServices-BHpGFr0S.esm.js → idCaptureServices-bJRNhMEH.esm.js} +5 -5
  60. package/dist/{idCaptureStateMachine-DFnQkmrh.esm.js → idCaptureStateMachine-BAssHKV8.esm.js} +12 -12
  61. package/dist/{index-BGxFwnld.d.ts → index-DLcJT5YP.d.ts} +1 -1
  62. package/dist/index.d.ts +1 -1
  63. package/dist/index.esm.js +1 -1
  64. package/dist/mandatory-consent.d.ts +2 -2
  65. package/dist/{mandatoryConsentManager-DHiNShoL.d.ts → mandatoryConsentManager-CJSyhTpi.d.ts} +5 -5
  66. package/dist/{multipartRecordingService-B3C_zlev.esm.js → multipartRecordingService-CWxZ5mTi.esm.js} +13 -2
  67. package/dist/{permissionGuards-o1JLtewE.esm.js → permissionGuards-uYZYFu4J.esm.js} +1 -1
  68. package/dist/{permissionServices-7lzEiOsO.esm.js → permissionServices-Bj_fyWtv.esm.js} +2 -2
  69. package/dist/personhood.d.ts +5 -5
  70. package/dist/personhood.esm.js +6 -6
  71. package/dist/qe-signature.esm.js +1 -1
  72. package/dist/{runChildModule-BIzVnwtR.esm.js → runChildModule-DkWLwaAz.esm.js} +1 -1
  73. package/dist/{safeStorage-1O9k0ulP.esm.js → safeStorage-B-trhxg6.esm.js} +3 -2
  74. package/dist/{sdkVersion-BYWrh5Sm.esm.js → sdkVersion-tlFW91ji.esm.js} +1 -1
  75. package/dist/selfie.d.ts +4 -4
  76. package/dist/selfie.esm.js +6 -6
  77. package/dist/{selfieManager-D0FkWpe-.esm.js → selfieManager-BzzaKDle.esm.js} +4 -4
  78. package/dist/{selfieManager-DZ3u_WN9.d.ts → selfieManager-D1KRJ39M.d.ts} +1 -1
  79. package/dist/{selfieStateMachine-B_hrRIgL.esm.js → selfieStateMachine-BetnORsZ.esm.js} +2 -2
  80. package/dist/{session-CRt_05iK.esm.js → session-S9zc4a1K.esm.js} +3 -3
  81. package/dist/session.d.ts +1 -1
  82. package/dist/session.esm.js +4 -4
  83. package/dist/{sessionInitializer-Dunz-NDi.esm.js → sessionInitializer-DDsk97UB.esm.js} +3 -3
  84. package/dist/{setup-riMNzcSh.d.ts → setup-Cv-JM9QC.d.ts} +1 -1
  85. package/dist/{setup-DiDWtGSY.esm.js → setup-DcVN2srO.esm.js} +7 -7
  86. package/dist/{trueSightService-Kp5zCFNW.esm.js → trueSightService-CD0T81YQ.esm.js} +2 -2
  87. package/dist/{types-BzuUebkB.d.ts → types-9_esGTPj.d.ts} +1 -1
  88. package/dist/types-BT_Oalip.d.ts +1 -0
  89. package/dist/{types-DL0CXuWv.d.ts → types-CM-jtjJ2.d.ts} +3 -3
  90. package/dist/{types-CoOlCUp82.d.ts → types-CjKBS37a2.d.ts} +5 -5
  91. package/dist/{types-eLtVBhon.d.ts → types-DgDvvzg0.d.ts} +1 -1
  92. package/dist/{types-CBctcPeF.d.ts → types-Do5rEXij.d.ts} +1 -1
  93. package/dist/types-ZT1XFIJ8.d.ts +6 -0
  94. package/dist/video-selfie.d.ts +2 -2
  95. package/dist/video-selfie.esm.js +6 -6
  96. package/dist/{videoSelfieCameraWarmer-DwOuqlka.esm.js → videoSelfieCameraWarmer-mEqG_xP8.esm.js} +4 -4
  97. package/dist/{videoSelfieStepDetector-CdXIFh9s.d.ts → videoSelfieStepDetector-Ct2y9wZo.d.ts} +45 -15
  98. package/dist/wasm.d.ts +2 -2
  99. package/dist/wasm.esm.js +1 -1
  100. package/dist/{wasmDsFlagSync-BJtLh2XK.esm.js → wasmDsFlagSync-B2e8p268.esm.js} +1 -1
  101. package/dist/workflow.d.ts +5 -5
  102. package/dist/workflow.esm.js +15 -15
  103. package/package.json +3 -3
  104. package/dist/types-BhHF-CuL.d.ts +0 -6
  105. package/dist/types-Ds928RiU.d.ts +0 -1
@@ -1,5 +1,5 @@
1
1
  import { n as __toESM } from "./rolldown-runtime-FDOR9p9I.esm.js";
2
- import { t as SDK_VERSION } from "./sdkVersion-BYWrh5Sm.esm.js";
2
+ import { t as SDK_VERSION } from "./sdkVersion-tlFW91ji.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-DnhTmqlW.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-XAltcaKL.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 };
@@ -1,2 +1,2 @@
1
- import { a as FlowEventListener, c as FlowModuleStartedEvent, i as FlowEvent, l as FlowReadyEvent, n as FlowCompletedEvent, o as FlowEventSubscribable, r as FlowErrorEvent, s as FlowModuleCompletedEvent, t as FlowClosedEvent, u as FlowStartedEvent } from "./index-BGxFwnld.js";
1
+ import { a as FlowEventListener, c as FlowModuleStartedEvent, i as FlowEvent, l as FlowReadyEvent, n as FlowCompletedEvent, o as FlowEventSubscribable, r as FlowErrorEvent, s as FlowModuleCompletedEvent, t as FlowClosedEvent, u as FlowStartedEvent } from "./index-DLcJT5YP.js";
2
2
  export type { FlowClosedEvent, FlowCompletedEvent, FlowErrorEvent, FlowEvent, FlowEventListener, FlowEventSubscribable, FlowModuleCompletedEvent, FlowModuleStartedEvent, FlowReadyEvent, FlowStartedEvent };
package/dist/flow.d.ts CHANGED
@@ -4,17 +4,17 @@ import "./StateMachine-EDpYWy0i.js";
4
4
  import { t as Manager } from "./Manager-CQQ99QOI.js";
5
5
  import { a as ElectronicSignatureConfig } from "./types-D0gekt4U.js";
6
6
  import { t as EkycConfig } from "./types-Bk_6dmDa.js";
7
- import { i as FlowModuleConfig, n as Flow, r as FlowModule } from "./types-CBctcPeF.js";
8
- import { t as AuthenticationConfig } from "./types-BhHF-CuL.js";
7
+ import { i as FlowModuleConfig, n as Flow, r as FlowModule } from "./types-Do5rEXij.js";
8
+ import { t as AuthenticationConfig } from "./types-ZT1XFIJ8.js";
9
9
  import { r as DocumentCaptureConfig } from "./types-BjSly8cp.js";
10
10
  import { t as DynamicFormsConfig } from "./types-BSBzhHRH.js";
11
11
  import { t as EkybConfig } from "./types-BfHiko5D.js";
12
- import { u as IdCaptureConfig } from "./types-CoOlCUp82.js";
13
- import { r as MandatoryConsentConfig } from "./types-BzuUebkB.js";
12
+ import { u as IdCaptureConfig } from "./types-CjKBS37a2.js";
13
+ import { r as MandatoryConsentConfig } from "./types-9_esGTPj.js";
14
14
  import { t as IdOcrConfig } from "./types-CJ7Yl9K-.js";
15
15
  import { t as RedirectToMobileConfig } from "./types-DPIDuhut.js";
16
16
  import { a as TotalScore, c as getTotalScoreStatus, n as FinishStatus, o as classifyScoreStatus, r as GetFinishStatusFn, t as FinishScreenVariant } from "./flowCompletionService-BlAHsKyv.js";
17
- import { o as FlowEventSubscribable } from "./index-BGxFwnld.js";
17
+ import { o as FlowEventSubscribable } from "./index-DLcJT5YP.js";
18
18
  import { n as ModuleRegistry } from "./types-BfgmV7s7.js";
19
19
  //#region src/modules/flow/orchestratedFlowStateMachine.d.ts
20
20
  type GetFlowFn = (signal: AbortSignal) => Promise<Flow>;
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-C9ZUPED-.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-BdQkcWNs.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-BcXefdE-.esm.js";
6
- import { n as attachFlowEventEmitter, t as runChildModule } from "./runChildModule-BIzVnwtR.esm.js";
5
+ import { n as getFinishStatus, r as getTotalScoreStatus, t as classifyScoreStatus } from "./flowCompletionService-BnU3Yo4k.esm.js";
6
+ import { n as attachFlowEventEmitter, t as runChildModule } from "./runChildModule-DkWLwaAz.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-D3B9mUHh.esm.js";
3
- import { i as toIncodeApiError } from "./apiError--EXEza2H.esm.js";
3
+ import { i as toIncodeApiError } from "./apiError-CC5v1ZI1.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-DnhTmqlW.esm.js";
2
+ import { E as updateFeatureManagementUser } from "./feature-management-XAltcaKL.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-Dunz-NDi.esm.js";
4
+ import { i as initializeSession, l as whenSessionFingerprintSettled, r as getSessionFingerprintResult, u as getStandaloneFlowPolicy } from "./sessionInitializer-DDsk97UB.esm.js";
5
5
  import { t as endpoints } from "./endpoints-D3B9mUHh.esm.js";
6
- import { i as toIncodeApiError } from "./apiError--EXEza2H.esm.js";
7
- import "./session-CRt_05iK.esm.js";
6
+ import { i as toIncodeApiError } from "./apiError-CC5v1ZI1.esm.js";
7
+ import "./session-S9zc4a1K.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-BF0td98B.esm.js";
2
- import { t as geolocationMachine } from "./geolocationStateMachine-Ch189Ce6.esm.js";
1
+ import { t as createGeolocationManager } from "./geolocationManager-CEAdL6w_.esm.js";
2
+ import { t as geolocationMachine } from "./geolocationStateMachine-ClMoFwKO.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-Ch189Ce6.esm.js";
3
+ import { t as geolocationMachine } from "./geolocationStateMachine-ClMoFwKO.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-D3B9mUHh.esm.js";
3
3
  import { a as isIOS, t as isAndroid } from "./platform-DkcRc9JV.esm.js";
4
- import { n as isConnectivityError } from "./apiError--EXEza2H.esm.js";
4
+ import { n as isConnectivityError } from "./apiError-CC5v1ZI1.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
package/dist/home.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { A as StateMachine, C as StateValue, a as ActorRefFromLogic, c as AnyEventObject, g as IsNotNever, h as InputFrom, k as MachineSnapshot, o as AnyActorLogic, p as EventObject, r as ActorRef, s as AnyActorRef, u as ConditionalRequired, v as MetaObject, x as RequiredLogicInput, y as NonReducibleUnknown } from "./spawn-D9jgw9pW.js";
2
2
  import "./StateMachine-EDpYWy0i.js";
3
3
  import { t as Manager } from "./Manager-CQQ99QOI.js";
4
- import { t as EmptyConfig } from "./types-CBctcPeF.js";
4
+ import { t as EmptyConfig } from "./types-Do5rEXij.js";
5
5
  //#region src/modules/home/types.d.ts
6
6
  type HomeConfig = EmptyConfig;
7
7
  //#endregion
@@ -2,9 +2,9 @@ import "./warmup-Cis2p6O0.js";
2
2
  import "./StateMachine-EDpYWy0i.js";
3
3
  import "./Actor-iTq7YY48.js";
4
4
  import { t as CameraStream } from "./camera-9wWD-pwg.js";
5
- import { t as DetectionOrientation } from "./IIdCaptureCapability-nfpic2z2.js";
5
+ import { t as DetectionOrientation } from "./IIdCaptureCapability-RNiFhvXR.js";
6
6
  import { n as FinishStatus } from "./flowCompletionService-BlAHsKyv.js";
7
- import { a as FacingMode, i as CameraCompositor, n as VideoSelfieDetectionStatus, r as VideoSelfieValidationFailure, s as VideoSelfieStep, t as StepDetector } from "./videoSelfieStepDetector-CdXIFh9s.js";
7
+ import { a as FacingMode, i as CameraCompositor, n as VideoSelfieDetectionStatus, r as VideoSelfieValidationFailure, s as VideoSelfieStep, t as StepDetector } from "./videoSelfieStepDetector-Ct2y9wZo.js";
8
8
  //#region src/modules/id-selfie-flow/types.d.ts
9
9
  /**
10
10
  * The capture steps an ID + Selfie flow session can run, in flow order. A
@@ -1,18 +1,18 @@
1
- import { t as ensureWasmPipelines } from "./setup-DiDWtGSY.esm.js";
2
- import { r as WasmUtilProvider } from "./safeStorage-1O9k0ulP.esm.js";
1
+ import { t as ensureWasmPipelines } from "./setup-DcVN2srO.esm.js";
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-C9ZUPED-.esm.js";
4
+ import { a as resolveDashboardModuleConfig, d as facingModeForStep } from "./flowServices-BdQkcWNs.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-BD3zvnei.esm.js";
7
+ import { n as encryptSelfieImage, o as startDetection, t as FaceDetectionProvider } from "./FaceDetectionProvider-wJitf58B.esm.js";
8
8
  import { a as StreamCanvasProcessingSession } from "./recordingsRepository-CCWy13M-.esm.js";
9
9
  import { n as getWindowDimensions } from "./getDeviceClass-CeBiEayS.esm.js";
10
10
  import { a as uploadSelfie, r as processFace } from "./selfieErrorUtils-C77GXJH6.esm.js";
11
- import { i as CameraCompositor, n as DEFAULT_ID_CAPTURE_THRESHOLDS, r as IdCaptureProvider, t as DEFAULT_ID_CAPTURE_GEOMETRY } from "./idCaptureDefaults-DOgVQKC_.esm.js";
12
- import { _ as ID_ERROR_CODES, g as validateUploadResponse, m as uploadIdImage, u as processId } from "./idCaptureServices-BHpGFr0S.esm.js";
11
+ import { i as CameraCompositor, n as DEFAULT_ID_CAPTURE_THRESHOLDS, r as IdCaptureProvider, t as DEFAULT_ID_CAPTURE_GEOMETRY } from "./idCaptureDefaults-D34NYQ4a.esm.js";
12
+ import { _ as ID_ERROR_CODES, g as validateUploadResponse, m as uploadIdImage, u as processId } from "./idCaptureServices-bJRNhMEH.esm.js";
13
13
  import { t as StreamCanvasCapture } from "./StreamCanvasCapture-C9jtgBdT.esm.js";
14
- import { n as getFinishStatus } from "./flowCompletionService-BcXefdE-.esm.js";
15
- import { i as delay, n as defaultAcquireCamera, o as isSelfieValidationError, s as isWrongVideoSelfieIdSide } from "./videoSelfieCameraWarmer-DwOuqlka.esm.js";
14
+ import { n as getFinishStatus } from "./flowCompletionService-BnU3Yo4k.esm.js";
15
+ import { i as delay, n as defaultAcquireCamera, o as isSelfieValidationError, s as isWrongVideoSelfieIdSide } from "./videoSelfieCameraWarmer-mEqG_xP8.esm.js";
16
16
  //#region src/modules/id-selfie-flow/idSelfieFlowStepDetector.ts
17
17
  /** Default autocapture window for the selfie step. */
18
18
  const SELFIE_AUTOCAPTURE_MS = 1e4;
package/dist/id.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { t as IVisibilityObserverCapability } from "./IVisibilityObserverCapability-D4tvIB5v.js";
2
2
  import { n as PermissionStatus, t as PermissionResult } from "./types-BEwVKkLJ.js";
3
3
  import { t as CameraStream } from "./camera-9wWD-pwg.js";
4
- import { r as IdCaptureSettings, t as DetectionOrientation } from "./IIdCaptureCapability-nfpic2z2.js";
5
- import { A as MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, B as DeviceWalletPlatform, C as IdDocumentType, D as RecordingSession, E as IdFlowStep, F as ManualUploadTab, G as DigitalIdFunnelEntry, H as DIGITAL_ID_DOCUMENT_TYPES, I as DeviceWalletDecision, J as isRedirectFlowType, K as DigitalIdPlatformSupport, L as DeviceWalletDecryptResponse, M as MANUAL_UPLOAD_MAX_RETRIES, N as ManualUploadContext, O as UploadIdResponse, P as ManualUploadSide, Q as RedirectReturnParams, R as DeviceWalletFailReason, S as IdCapturedImageData, T as IdErrorCode, U as DIGITAL_ID_REGISTRY, V as DeviceWalletProvider, W as DigitalIdDocumentType, X as DigitalIdProviderId, Y as resolveDigitalIdImplementation, _ as IdCaptureInput, a as CaptureOnlyResponse, b as IdCaptureOutput, c as DetectionStatus, d as IdCaptureContext, f as IdCaptureDependencies, g as IdCaptureGeometry, h as IdCaptureEvent, i as CaptureIdResponse, j as MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, l as ID_ERROR_CODES, m as IdCaptureDigitalIdMethod, n as AcceptedDocumentType, o as CapturedImage, p as IdCaptureDigitalIdFlowType, q as ResolvedDigitalIdRoute, r as AddBarcodeV3Response, s as DetectionArea, t as AcceptedDocument, u as IdCaptureConfig, v as IdCaptureMode, w as IdError, x as IdCaptureThresholds, y as IdCaptureOnlyConfig, z as DeviceWalletOutput } from "./types-CoOlCUp82.js";
6
- import { A as preloadIdRecordingProvider, C as addBarcode, D as getRealQualityValue, E as finalizeRecordingSession, F as stopStream, I as uploadIdImage, L as uploadManualIdFile, M as processId, N as startRecordingSession, O as initializeIdCapture, P as stopRecording, R as validateUploadResponse, S as ValidationError, T as disposeRecordingSession, _ as IdCaptureInitResult, a as CreateIdCaptureOnlyActorOptions, b as UploadIdImageParams, c as IdCaptureOnlyMachine, d as IdCaptureActor, f as createIdCaptureActor, g as FinalizedIdRecording, h as AddBarcodeParams, j as prepareRecordingForCameraRetry, k as pauseRecordingForAttempt, l as idCaptureOnlyMachine, m as idCaptureMachine, n as IdCaptureManager, o as IdCaptureOnlyActor, p as IdCaptureMachine, r as IdCaptureState, s as createIdCaptureOnlyActor, t as createIdCaptureManager, u as CreateIdCaptureActorOptions, v as InitializeIdCaptureParams, w as barcodeToBase64, x as UploadManualIdFileParams, y as StartRecordingParams } from "./idCaptureManager-DE_jyr5X.js";
4
+ import { r as IdCaptureSettings, t as DetectionOrientation } from "./IIdCaptureCapability-RNiFhvXR.js";
5
+ import { A as MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, B as DeviceWalletPlatform, C as IdDocumentType, D as RecordingSession, E as IdFlowStep, F as ManualUploadTab, G as DigitalIdFunnelEntry, H as DIGITAL_ID_DOCUMENT_TYPES, I as DeviceWalletDecision, J as isRedirectFlowType, K as DigitalIdPlatformSupport, L as DeviceWalletDecryptResponse, M as MANUAL_UPLOAD_MAX_RETRIES, N as ManualUploadContext, O as UploadIdResponse, P as ManualUploadSide, Q as RedirectReturnParams, R as DeviceWalletFailReason, S as IdCapturedImageData, T as IdErrorCode, U as DIGITAL_ID_REGISTRY, V as DeviceWalletProvider, W as DigitalIdDocumentType, X as DigitalIdProviderId, Y as resolveDigitalIdImplementation, _ as IdCaptureInput, a as CaptureOnlyResponse, b as IdCaptureOutput, c as DetectionStatus, d as IdCaptureContext, f as IdCaptureDependencies, g as IdCaptureGeometry, h as IdCaptureEvent, i as CaptureIdResponse, j as MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, l as ID_ERROR_CODES, m as IdCaptureDigitalIdMethod, n as AcceptedDocumentType, o as CapturedImage, p as IdCaptureDigitalIdFlowType, q as ResolvedDigitalIdRoute, r as AddBarcodeV3Response, s as DetectionArea, t as AcceptedDocument, u as IdCaptureConfig, v as IdCaptureMode, w as IdError, x as IdCaptureThresholds, y as IdCaptureOnlyConfig, z as DeviceWalletOutput } from "./types-CjKBS37a2.js";
6
+ import { A as preloadIdRecordingProvider, C as addBarcode, D as getRealQualityValue, E as finalizeRecordingSession, F as stopStream, I as uploadIdImage, L as uploadManualIdFile, M as processId, N as startRecordingSession, O as initializeIdCapture, P as stopRecording, R as validateUploadResponse, S as ValidationError, T as disposeRecordingSession, _ as IdCaptureInitResult, a as CreateIdCaptureOnlyActorOptions, b as UploadIdImageParams, c as IdCaptureOnlyMachine, d as IdCaptureActor, f as createIdCaptureActor, g as FinalizedIdRecording, h as AddBarcodeParams, j as prepareRecordingForCameraRetry, k as pauseRecordingForAttempt, l as idCaptureOnlyMachine, m as idCaptureMachine, n as IdCaptureManager, o as IdCaptureOnlyActor, p as IdCaptureMachine, r as IdCaptureState, s as createIdCaptureOnlyActor, t as createIdCaptureManager, u as CreateIdCaptureActorOptions, v as InitializeIdCaptureParams, w as barcodeToBase64, x as UploadManualIdFileParams, y as StartRecordingParams } from "./idCaptureManager-CvmHOWWd.js";
7
7
  //#region src/modules/id/deviceWallet/deviceWalletErrors.d.ts
8
8
  /**
9
9
  * Fail reason → i18n key for the device-wallet error screen (same shape as
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-DFnQkmrh.esm.js";
5
- import { n as createIdCaptureActor, r as createIdCaptureManagerFromActor, t as createIdCaptureManager } from "./idCaptureManager-D8iqvPZA.esm.js";
6
- import { _ as ID_ERROR_CODES, a as getRealQualityValue, c as preloadIdRecordingProvider, d as startRecordingSession, f as stopRecording, g as validateUploadResponse, h as uploadManualIdFile, i as finalizeRecordingSession, l as prepareRecordingForCameraRetry, m as uploadIdImage, n as barcodeToBase64, o as initializeIdCapture, p as stopStream, r as disposeRecordingSession, s as pauseRecordingForAttempt, t as addBarcode, u as processId, y as resolveIdCaptureThresholds } from "./idCaptureServices-BHpGFr0S.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-BAssHKV8.esm.js";
5
+ import { n as createIdCaptureActor, r as createIdCaptureManagerFromActor, t as createIdCaptureManager } from "./idCaptureManager-CjWevOsf.esm.js";
6
+ import { _ as ID_ERROR_CODES, a as getRealQualityValue, c as preloadIdRecordingProvider, d as startRecordingSession, f as stopRecording, g as validateUploadResponse, h as uploadManualIdFile, i as finalizeRecordingSession, l as prepareRecordingForCameraRetry, m as uploadIdImage, n as barcodeToBase64, o as initializeIdCapture, p as stopStream, r as disposeRecordingSession, s as pauseRecordingForAttempt, t as addBarcode, u as processId, y as resolveIdCaptureThresholds } from "./idCaptureServices-bJRNhMEH.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
  /**
@@ -1,20 +1,161 @@
1
1
  import { b as resolveWasmSource, p as WASM_MODEL_FILES } from "./wasmWebClient-B7baE-Wf.esm.js";
2
- import { p as getBarcodeEnhanceModelUrl } from "./setup-DiDWtGSY.esm.js";
2
+ import { p as getBarcodeEnhanceModelUrl } from "./setup-DcVN2srO.esm.js";
3
3
  import { s as wasmRuntime, t as getResolvedModelSource } from "./warmup-CUUnwYxe.esm.js";
4
- import { i as BaseWasmProvider } from "./safeStorage-1O9k0ulP.esm.js";
4
+ import { i as BaseWasmProvider } from "./safeStorage-B-trhxg6.esm.js";
5
5
  import { t as IncodeCanvas } from "./canvas-BxFzWTt-.esm.js";
6
+ //#region ../infra/src/media/cameraCompositorWorker.ts
7
+ /**
8
+ * Whether the worker transport is available here. Every probe must hold;
9
+ * anything missing routes `CameraCompositor` to its main-thread path.
10
+ */
11
+ function canUseCameraCompositorWorker() {
12
+ const g = globalThis;
13
+ return typeof g.MediaStreamTrackProcessor === "function" && typeof g.MediaStreamTrackGenerator === "function" && typeof g.Worker === "function" && typeof g.OffscreenCanvas === "function" && typeof g.VideoFrame === "function";
14
+ }
15
+ function createTrackProcessor(track) {
16
+ const Ctor = globalThis.MediaStreamTrackProcessor;
17
+ if (!Ctor) throw new Error("MediaStreamTrackProcessor unavailable");
18
+ return new Ctor({ track });
19
+ }
20
+ function createTrackGenerator() {
21
+ const Ctor = globalThis.MediaStreamTrackGenerator;
22
+ if (!Ctor) throw new Error("MediaStreamTrackGenerator unavailable");
23
+ return new Ctor({ kind: "video" });
24
+ }
25
+ /**
26
+ * The worker's entire logic. SELF-CONTAINED (serialized via toString into the
27
+ * blob): no module references. Frame loop: read → scale within the bound →
28
+ * write → close. The processor buffers at most one frame, so reads always
29
+ * yield the freshest frame; while paused, frames are still read and closed so
30
+ * the camera's frame pool stays healthy — an unclosed VideoFrame can stall the
31
+ * capture pipeline, which the recording must never do.
32
+ */
33
+ function cameraCompositorWorkerMain(scope) {
34
+ const g = globalThis;
35
+ let maxLongEdge = 1280;
36
+ let maxShortEdge = 720;
37
+ let canvas = null;
38
+ let ctx = null;
39
+ let writer = null;
40
+ let activeReader = null;
41
+ let generation = 0;
42
+ let paused = false;
43
+ let announceNextFrame = false;
44
+ const boundedSize = (width, height) => {
45
+ const scale = Math.min(1, maxLongEdge / Math.max(width, height), maxShortEdge / Math.min(width, height));
46
+ return {
47
+ width: Math.max(1, Math.round(width * scale)),
48
+ height: Math.max(1, Math.round(height * scale))
49
+ };
50
+ };
51
+ const scaled = (frame) => {
52
+ const size = boundedSize(frame.displayWidth, frame.displayHeight);
53
+ if (!canvas || !ctx || size.width === frame.displayWidth && size.height === frame.displayHeight) return frame;
54
+ if (canvas.width !== size.width || canvas.height !== size.height) {
55
+ canvas.width = size.width;
56
+ canvas.height = size.height;
57
+ }
58
+ ctx.drawImage(frame, 0, 0, size.width, size.height);
59
+ const out = new g.VideoFrame(canvas, { timestamp: frame.timestamp });
60
+ frame.close();
61
+ return out;
62
+ };
63
+ const pump = async (readable, gen) => {
64
+ const reader = readable.getReader();
65
+ activeReader = reader;
66
+ try {
67
+ for (;;) {
68
+ const { value: frame, done } = await reader.read();
69
+ if (done) {
70
+ if (gen === generation) scope.postMessage({ type: "ended" });
71
+ return;
72
+ }
73
+ if (gen !== generation) {
74
+ frame.close();
75
+ return;
76
+ }
77
+ if (paused || !writer) {
78
+ frame.close();
79
+ continue;
80
+ }
81
+ await writer.write(scaled(frame));
82
+ if (announceNextFrame) {
83
+ announceNextFrame = false;
84
+ scope.postMessage({ type: "frame" });
85
+ }
86
+ }
87
+ } catch (error) {
88
+ if (gen === generation) scope.postMessage({
89
+ type: "fatal",
90
+ message: String(error)
91
+ });
92
+ }
93
+ };
94
+ const switchSource = (readable) => {
95
+ generation += 1;
96
+ const previous = activeReader;
97
+ activeReader = null;
98
+ previous?.cancel().catch(() => {});
99
+ pump(readable, generation);
100
+ };
101
+ scope.onmessage = (event) => {
102
+ const message = event.data;
103
+ switch (message.type) {
104
+ case "start":
105
+ maxLongEdge = message.maxLongEdge;
106
+ maxShortEdge = message.maxShortEdge;
107
+ canvas = new g.OffscreenCanvas(1, 1);
108
+ ctx = canvas.getContext("2d");
109
+ writer = message.writable.getWriter();
110
+ announceNextFrame = true;
111
+ switchSource(message.readable);
112
+ break;
113
+ case "source":
114
+ switchSource(message.readable);
115
+ break;
116
+ case "pause":
117
+ paused = true;
118
+ break;
119
+ case "resume":
120
+ paused = false;
121
+ announceNextFrame = true;
122
+ break;
123
+ default: break;
124
+ }
125
+ };
126
+ }
127
+ /** Assembles the classic-worker script from the serialized worker main. */
128
+ function buildCameraCompositorWorkerSource() {
129
+ return [`const workerMain = ${cameraCompositorWorkerMain.toString()};`, "workerMain(self);"].join("\n");
130
+ }
131
+ //#endregion
6
132
  //#region ../infra/src/media/CameraCompositor.ts
7
133
  const MAX_COMPOSITE_LONG_EDGE = 1280;
8
134
  const MAX_COMPOSITE_SHORT_EDGE = 720;
9
135
  const FRAME_INTERVAL_TOLERANCE_RATIO = .9;
10
136
  const DEFAULT_RESUME_TIMEOUT_MS = 2e3;
11
137
  /**
12
- * Composites the *active* camera into a canvas and exposes the canvas as a
13
- * single, stable `MediaStream` to record. Switching cameras (front ↔ back)
14
- * just repoints what the canvas draws the output stream and its audio track
15
- * are never replaced — so a single `MediaRecorder` produces one continuous
16
- * video that follows the camera switches (V1 parity), instead of restarting
17
- * per camera.
138
+ * Composites the *active* camera into a single, stable `MediaStream` to
139
+ * record. Switching cameras (front ↔ back) just repoints the source — the
140
+ * output stream and its audio track are never replaced so a single
141
+ * `MediaRecorder` produces one continuous video that follows the camera
142
+ * switches (V1 parity), instead of restarting per camera.
143
+ *
144
+ * Two transports (ENG-55397):
145
+ * - **Worker (preferred, Chromium 94+):** camera track →
146
+ * `MediaStreamTrackProcessor` → worker scales on an `OffscreenCanvas` →
147
+ * `MediaStreamTrackGenerator`. The main thread is not in the frame path, so
148
+ * the recording stays at camera rate while the synchronous ID detection
149
+ * tick saturates the main thread (measured: 4–9 fps main-thread vs 30 fps
150
+ * worker on a Galaxy S21 under the same load).
151
+ * - **Main thread (fallback):** hidden `<video>` → rVFC/rAF → canvas →
152
+ * `captureStream`, for Safari, Firefox and strict-CSP hosts that block blob
153
+ * workers.
154
+ *
155
+ * A worker that dies mid-recording (GPU-process crash, OOM) is released at
156
+ * once; the composite track stays valid but receives no further frames, and
157
+ * the next `resume()` reports `timed-out` so the caller reacquires the camera
158
+ * instead of talking to a dead worker.
18
159
  *
19
160
  * The audio track from the initial stream is carried through unchanged across
20
161
  * video switches, so there's no audio glitch when the camera flips.
@@ -24,8 +165,11 @@ var CameraCompositor = class {
24
165
  this.canvas = null;
25
166
  this.ctx = null;
26
167
  this.video = null;
168
+ this.transport = null;
169
+ this.generator = null;
27
170
  this.frameRequestId = null;
28
171
  this.frameRequestKind = null;
172
+ this.sourceExceedsTargetFps = false;
29
173
  this.lastDrawTimeMs = null;
30
174
  this.lastVideoTimeSeconds = null;
31
175
  this.audioTrack = null;
@@ -41,29 +185,33 @@ var CameraCompositor = class {
41
185
  * `switchVideo` calls.
42
186
  */
43
187
  start(stream) {
44
- this.canvas = document.createElement("canvas");
45
- this.ctx = this.canvas.getContext("2d");
46
- this.video = document.createElement("video");
47
- this.video.muted = true;
48
- this.video.playsInline = true;
49
188
  this.audioTrack = stream.getAudioTracks()[0] ?? null;
50
- this.setVideoSource(stream);
51
- const composite = this.canvas.captureStream(this.fps);
189
+ const composite = this.startWorkerTransport(stream) ?? this.startMainThread(stream);
52
190
  if (this.audioTrack) composite.addTrack(this.audioTrack);
53
191
  this.composite = composite;
54
- this.startDrawLoop();
55
192
  return composite;
56
193
  }
57
194
  /**
58
- * Swap the camera feeding the canvas without interrupting the composite
195
+ * Swap the camera feeding the composite without interrupting the composite
59
196
  * stream. Pass a video-only stream (audio is kept from `start`). The previous
60
197
  * video track is stopped.
61
198
  */
62
199
  switchVideo(stream) {
63
200
  if (!this.composite) return;
64
201
  const previousVideoTrack = this.videoTrack;
65
- this.setVideoSource(stream);
66
- this.startDrawLoop();
202
+ if (this.transport) {
203
+ this.videoTrack = stream.getVideoTracks()[0] ?? null;
204
+ if (this.videoTrack) try {
205
+ const processor = createTrackProcessor(this.videoTrack);
206
+ this.postToWorker({
207
+ type: "source",
208
+ readable: processor.readable
209
+ }, [processor.readable]);
210
+ } catch {}
211
+ } else if (this.video) {
212
+ this.setVideoSource(stream);
213
+ this.startDrawLoop();
214
+ } else this.videoTrack = stream.getVideoTracks()[0] ?? null;
67
215
  if (previousVideoTrack) previousVideoTrack.stop();
68
216
  }
69
217
  /** The composite stream being recorded, if compositing is active. */
@@ -73,26 +221,32 @@ var CameraCompositor = class {
73
221
  /** Pause source playback and drawing while the page is backgrounded. */
74
222
  pause() {
75
223
  this.finishResume("timed-out");
224
+ if (this.transport) {
225
+ this.postToWorker({ type: "pause" });
226
+ return;
227
+ }
76
228
  this.cancelDrawLoop();
77
229
  this.video?.pause();
78
230
  }
79
231
  /**
80
- * Restart source playback and wait for a genuinely new camera frame to be
81
- * drawn into the stable canvas stream. The caller must not resume encoding
82
- * until this resolves with `resumed`.
232
+ * Restart source playback and wait for a genuinely new camera frame to reach
233
+ * the stable composite stream. The caller must not resume encoding until
234
+ * this resolves with `resumed`.
83
235
  */
84
236
  async resume(signal) {
85
237
  const video = this.video;
86
- if (!video || !this.composite) return "timed-out";
238
+ if (!this.composite || !video && !this.transport) return "timed-out";
87
239
  if (this.audioTrack?.readyState === "ended") return "audio-ended";
88
240
  if (!this.videoTrack || this.videoTrack.readyState === "ended") return "video-ended";
89
241
  if (signal?.aborted) return "timed-out";
90
- try {
91
- await video.play();
92
- } catch {
93
- return "timed-out";
242
+ if (video && !this.transport) {
243
+ try {
244
+ await video.play();
245
+ } catch {
246
+ return "timed-out";
247
+ }
248
+ if (signal?.aborted) return "timed-out";
94
249
  }
95
- if (signal?.aborted) return "timed-out";
96
250
  this.finishResume("timed-out");
97
251
  return new Promise((resolve) => {
98
252
  const timeout = setTimeout(() => {
@@ -115,13 +269,20 @@ var CameraCompositor = class {
115
269
  resolve,
116
270
  timeout
117
271
  };
272
+ if (this.transport) {
273
+ this.postToWorker({ type: "resume" });
274
+ return;
275
+ }
118
276
  this.startDrawLoop(false);
119
277
  });
120
278
  }
121
- /** Stop compositing and release the canvas, audio, and video tracks. */
279
+ /** Stop compositing and release the worker, canvas, audio and video tracks. */
122
280
  stop() {
123
281
  this.finishResume("timed-out");
124
282
  this.cancelDrawLoop();
283
+ this.releaseWorker();
284
+ this.generator?.stop();
285
+ this.generator = null;
125
286
  this.videoTrack?.stop();
126
287
  this.audioTrack?.stop();
127
288
  this.composite?.getTracks().forEach((track) => track.stop());
@@ -133,8 +294,90 @@ var CameraCompositor = class {
133
294
  this.audioTrack = null;
134
295
  this.composite = null;
135
296
  }
297
+ /**
298
+ * Worker transport. Returns `null` — and leaves nothing behind — when the
299
+ * browser lacks insertable streams or a strict `worker-src` CSP blocks blob
300
+ * workers, so `start` falls through to the main-thread path. Never throws.
301
+ */
302
+ startWorkerTransport(stream) {
303
+ const track = stream.getVideoTracks()[0];
304
+ if (!track || !canUseCameraCompositorWorker()) return null;
305
+ let worker = null;
306
+ let generator = null;
307
+ let blobUrl = null;
308
+ try {
309
+ const processor = createTrackProcessor(track);
310
+ generator = createTrackGenerator();
311
+ blobUrl = URL.createObjectURL(new Blob([buildCameraCompositorWorkerSource()], { type: "text/javascript" }));
312
+ worker = new Worker(blobUrl);
313
+ worker.onmessage = (event) => this.onWorkerMessage(event.data);
314
+ worker.onerror = (event) => this.onWorkerMessage({
315
+ type: "fatal",
316
+ message: event?.message || "worker error"
317
+ });
318
+ const message = {
319
+ type: "start",
320
+ readable: processor.readable,
321
+ writable: generator.writable,
322
+ maxLongEdge: MAX_COMPOSITE_LONG_EDGE,
323
+ maxShortEdge: MAX_COMPOSITE_SHORT_EDGE
324
+ };
325
+ worker.postMessage(message, [processor.readable, generator.writable]);
326
+ } catch {
327
+ worker?.terminate();
328
+ generator?.stop();
329
+ if (blobUrl) URL.revokeObjectURL(blobUrl);
330
+ return null;
331
+ }
332
+ this.videoTrack = track;
333
+ this.transport = {
334
+ worker,
335
+ blobUrl
336
+ };
337
+ this.generator = generator;
338
+ return new MediaStream([generator]);
339
+ }
340
+ /** Terminates the worker and frees its blob; idempotent. */
341
+ releaseWorker() {
342
+ if (!this.transport) return;
343
+ this.transport.worker.terminate();
344
+ URL.revokeObjectURL(this.transport.blobUrl);
345
+ this.transport = null;
346
+ }
347
+ startMainThread(stream) {
348
+ this.canvas = document.createElement("canvas");
349
+ this.ctx = this.canvas.getContext("2d");
350
+ this.video = document.createElement("video");
351
+ this.video.muted = true;
352
+ this.video.playsInline = true;
353
+ this.setVideoSource(stream);
354
+ const composite = this.canvas.captureStream(this.fps);
355
+ this.startDrawLoop();
356
+ return composite;
357
+ }
358
+ postToWorker(message, transfer = []) {
359
+ this.transport?.worker.postMessage(message, transfer);
360
+ }
361
+ onWorkerMessage(message) {
362
+ if (!this.transport) return;
363
+ switch (message.type) {
364
+ case "frame":
365
+ this.finishResume("resumed");
366
+ break;
367
+ case "ended":
368
+ this.finishResume("video-ended");
369
+ break;
370
+ case "fatal":
371
+ this.releaseWorker();
372
+ this.finishResume("timed-out");
373
+ break;
374
+ default: break;
375
+ }
376
+ }
136
377
  setVideoSource(stream) {
137
378
  this.videoTrack = stream.getVideoTracks()[0] ?? null;
379
+ const sourceFps = this.videoTrack && typeof this.videoTrack.getSettings === "function" ? this.videoTrack.getSettings().frameRate : void 0;
380
+ this.sourceExceedsTargetFps = typeof sourceFps === "number" && sourceFps > this.fps;
138
381
  const video = this.video;
139
382
  if (!video) return;
140
383
  video.srcObject = new MediaStream(stream.getVideoTracks());
@@ -146,7 +389,7 @@ var CameraCompositor = class {
146
389
  if (resetSourceTime) this.lastVideoTimeSeconds = null;
147
390
  const draw = (timeMs) => {
148
391
  const elapsed = this.lastDrawTimeMs === null ? Infinity : timeMs - this.lastDrawTimeMs;
149
- if ((this.frameIntervalMs === 0 || elapsed >= this.frameIntervalMs * FRAME_INTERVAL_TOLERANCE_RATIO) && this.drawCurrentFrame()) {
392
+ if ((!(this.frameIntervalMs > 0 && (this.frameRequestKind !== "video" || this.sourceExceedsTargetFps)) || elapsed >= this.frameIntervalMs * FRAME_INTERVAL_TOLERANCE_RATIO) && this.drawCurrentFrame()) {
150
393
  this.lastDrawTimeMs = timeMs;
151
394
  this.finishResume("resumed");
152
395
  }
@@ -1,12 +1,12 @@
1
- import { l as BrowserStorageProvider } from "./setup-DiDWtGSY.esm.js";
1
+ import { l as BrowserStorageProvider } from "./setup-DcVN2srO.esm.js";
2
2
  import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-ijlbX_Wx.esm.js";
3
3
  import { t as topLevelStateName } from "./topLevelStateName-B5i2avbh.esm.js";
4
4
  import { s as createActor, u as createManager } from "./xstate.esm-BuFLFuzz.esm.js";
5
- import { t as setWasmDsFlagSync } from "./wasmDsFlagSync-BJtLh2XK.esm.js";
5
+ import { t as setWasmDsFlagSync } from "./wasmDsFlagSync-B2e8p268.esm.js";
6
6
  import { t as BrowserVisibilityObserverProvider } from "./BrowserVisibilityObserverProvider-BrJN1B8A.esm.js";
7
- import { o as resetWasmMotionPrimedForModule, r as primeMotionFromUserGestureIfNeeded } from "./permissionServices-7lzEiOsO.esm.js";
8
- import { a as createIdProtectedCaptureController, n as provideIdProtectedCaptureController, o as findIdProtectedCaptureController, s as getManualUploadTabs, t as idCaptureMachine } from "./idCaptureStateMachine-DFnQkmrh.esm.js";
9
- import { v as resolveCaptureOptimizingTreatment, y as resolveIdCaptureThresholds } from "./idCaptureServices-BHpGFr0S.esm.js";
7
+ import { o as resetWasmMotionPrimedForModule, r as primeMotionFromUserGestureIfNeeded } from "./permissionServices-Bj_fyWtv.esm.js";
8
+ import { a as createIdProtectedCaptureController, n as provideIdProtectedCaptureController, o as findIdProtectedCaptureController, s as getManualUploadTabs, t as idCaptureMachine } from "./idCaptureStateMachine-BAssHKV8.esm.js";
9
+ import { v as resolveCaptureOptimizingTreatment, y as resolveIdCaptureThresholds } from "./idCaptureServices-bJRNhMEH.esm.js";
10
10
  //#region src/modules/id/digitalUpload/instrumentation.ts
11
11
  const TERMINAL_REASONS = /* @__PURE__ */ new Set(["DIGITAL_ID_REQUESTED_BUT_OTHER_PROVIDED", "ID_TYPE_UNACCEPTABLE"]);
12
12
  function isHoldingState(value) {