@incodetech/core 2.2.0-rc.5 → 2.2.0-rc.7

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 (138) hide show
  1. package/dist/{BrowserDiagnosticsCryptoProvider-DVsBW0AN.esm.js → BrowserDiagnosticsCryptoProvider-BJSK21UY.esm.js} +1 -1
  2. package/dist/{IFeatureManagementCapability-DdEUp6tB.d.ts → IFeatureManagementCapability-De8wpbGh.d.ts} +2 -0
  3. package/dist/{addressSearch-DQyrvDQj.esm.js → addressSearch-D1XpBdUS.esm.js} +1 -1
  4. package/dist/ae-signature.esm.js +1 -1
  5. package/dist/antifraud.esm.js +2 -2
  6. package/dist/{antifraudManager-B8Plzf7a.esm.js → antifraudManager-CQFNgSPt.esm.js} +3 -3
  7. package/dist/{antifraudStateMachine-r4VxSBS4.esm.js → antifraudStateMachine-Bf_JVNwn.esm.js} +2 -2
  8. package/dist/{apiError-Dtho9qf_.esm.js → apiError-DLDatBW_.esm.js} +1 -1
  9. package/dist/authentication.esm.js +2 -2
  10. package/dist/{authenticationManager-DXnLy-a7.esm.js → authenticationManager-08-DeHG7.esm.js} +4 -4
  11. package/dist/{authenticationStateMachine-CRJ6ilTX.esm.js → authenticationStateMachine-DXsm3ZJN.esm.js} +4 -4
  12. package/dist/certificate-issuance.esm.js +3 -3
  13. package/dist/{certificateIssuanceStateMachine-COd7_l2T.esm.js → certificateIssuanceStateMachine-D_R92TYu.esm.js} +2 -2
  14. package/dist/consent.d.ts +1 -1
  15. package/dist/consent.esm.js +2 -2
  16. package/dist/{consentManager-BApTlfA0.esm.js → consentManager-BxjpLZAG.esm.js} +3 -3
  17. package/dist/{consentManager-3Pbtj-RV.d.ts → consentManager-uhDPdU6i.d.ts} +4 -4
  18. package/dist/{consentStateMachine-WD-S-Yhs.esm.js → consentStateMachine-D9D4ON8Z.esm.js} +2 -2
  19. package/dist/cross-document-data-match.esm.js +1 -1
  20. package/dist/{crossDocumentDataMatchManager-OmYvyung.esm.js → crossDocumentDataMatchManager-CGT0V6RV.esm.js} +3 -3
  21. package/dist/curp-validation.esm.js +2 -2
  22. package/dist/{curpValidationManager-UZxcrsrz.esm.js → curpValidationManager-6Nmkn5u1.esm.js} +3 -3
  23. package/dist/{curpValidationStateMachine-9KwnqeoB.esm.js → curpValidationStateMachine-Ds7KMacK.esm.js} +2 -2
  24. package/dist/custom-fields.esm.js +3 -3
  25. package/dist/custom-watchlist.esm.js +3 -3
  26. package/dist/{customWatchlistStateMachine-B_ey3TFj.esm.js → customWatchlistStateMachine-YWSgKLbF.esm.js} +2 -2
  27. package/dist/{deepsightLoader-zdZnx5Ny.esm.js → deepsightLoader-BENyeSyy.esm.js} +3 -3
  28. package/dist/document-capture.d.ts +1 -1
  29. package/dist/document-capture.esm.js +2 -2
  30. package/dist/document-upload.esm.js +3 -3
  31. package/dist/{documentCaptureManager-B3t0ydtg.d.ts → documentCaptureManager-B4Kivr8_.d.ts} +5 -5
  32. package/dist/{documentCaptureManager-DszmcU-l.esm.js → documentCaptureManager-DsQQhWry.esm.js} +3 -3
  33. package/dist/{documentCaptureStateMachine-D2jBwwVb.esm.js → documentCaptureStateMachine-BM4Ex_5x.esm.js} +2 -2
  34. package/dist/dynamic-forms.esm.js +2 -2
  35. package/dist/{dynamicFormsManager-DT3BoUBK.esm.js → dynamicFormsManager-CGIITYpf.esm.js} +3 -3
  36. package/dist/{dynamicFormsStateMachine-vrCtQ3gW.esm.js → dynamicFormsStateMachine-CjT9ACFu.esm.js} +3 -3
  37. package/dist/ekyb.esm.js +3 -3
  38. package/dist/{ekybManager-DmIGaEK6.esm.js → ekybManager-FH5H9w4I.esm.js} +3 -3
  39. package/dist/{ekybStateMachine-32IR4TYs.esm.js → ekybStateMachine-DF4TSEo5.esm.js} +4 -4
  40. package/dist/ekyc.esm.js +2 -2
  41. package/dist/{ekycManager-oTstTJuL.esm.js → ekycManager-DgT48ky6.esm.js} +3 -3
  42. package/dist/{ekycStateMachine-DHvksnrr.esm.js → ekycStateMachine-CQwqiR-R.esm.js} +3 -3
  43. package/dist/electronic-signature.esm.js +1 -1
  44. package/dist/{electronicSignatureManager-BsDoCdF_.esm.js → electronicSignatureManager-BFoQXHgw.esm.js} +4 -4
  45. package/dist/email.esm.js +2 -2
  46. package/dist/{emailManager-tE-YvNtS.esm.js → emailManager-BY0jeYwR.esm.js} +3 -3
  47. package/dist/{emailStateMachine-Bm894MHB.esm.js → emailStateMachine-Crw8QVmc.esm.js} +2 -2
  48. package/dist/{events-CxfNJVZW.esm.js → events-DYiyoSlx.esm.js} +5 -6
  49. package/dist/events.d.ts +11 -9
  50. package/dist/events.esm.js +1 -1
  51. package/dist/extensibility.d.ts +5 -5
  52. package/dist/extensibility.esm.js +28 -28
  53. package/dist/face-match.esm.js +2 -2
  54. package/dist/{faceCaptureManagerFactory-BHCXTj9J.esm.js → faceCaptureManagerFactory-BOXOVkzQ.esm.js} +3 -3
  55. package/dist/{faceCaptureSetup-eqC24yO9.esm.js → faceCaptureSetup-CSRoNVVa.esm.js} +4 -4
  56. package/dist/{faceMatchManager-BXp2WUT-.esm.js → faceMatchManager-Ri4UbNz0.esm.js} +3 -3
  57. package/dist/{faceMatchStateMachine-CJiO2yLO.esm.js → faceMatchStateMachine-20DdZ3jg.esm.js} +2 -2
  58. package/dist/{feature-management-DS_Nj5Gg.esm.js → feature-management-BNQRs-_1.esm.js} +31 -40
  59. package/dist/feature-management.d.ts +41 -33
  60. package/dist/feature-management.esm.js +1 -1
  61. package/dist/field-comparison.esm.js +1 -1
  62. package/dist/{fieldComparisonManager-DhnYdYZ2.esm.js → fieldComparisonManager-Cg6kPQQx.esm.js} +3 -3
  63. package/dist/fiscal-qr.esm.js +3 -3
  64. package/dist/flow.d.ts +1 -1
  65. package/dist/flow.esm.js +6 -6
  66. package/dist/{flowCompletionService-Bg3Wlac8.esm.js → flowCompletionService-BSJ-_sjm.esm.js} +1 -1
  67. package/dist/{flowServices-D4A-aOqa.esm.js → flowServices-yVZNf0k-.esm.js} +4 -4
  68. package/dist/geolocation.esm.js +2 -2
  69. package/dist/{geolocationManager-CtE8v1SL.esm.js → geolocationManager-B3gAX5hk.esm.js} +3 -3
  70. package/dist/{geolocationStateMachine-BeWhwin9.esm.js → geolocationStateMachine-BNfb_jIM.esm.js} +3 -3
  71. package/dist/government-validation.esm.js +3 -3
  72. package/dist/{governmentValidationStateMachine-BYKYUdza.esm.js → governmentValidationStateMachine-CK9DrZXX.esm.js} +2 -2
  73. package/dist/home.esm.js +2 -2
  74. package/dist/id-ocr.esm.js +2 -2
  75. package/dist/id-selfie-flow.esm.js +8 -8
  76. package/dist/id-verification.esm.js +2 -2
  77. package/dist/id.d.ts +2 -2
  78. package/dist/id.esm.js +7 -7
  79. package/dist/{idCaptureManager-BGq73YE-.esm.js → idCaptureManager-Cf6LiYpF.esm.js} +13 -17
  80. package/dist/{idCaptureManager-BjU-Wyow.d.ts → idCaptureManager-CqrqSjJV.d.ts} +20 -10
  81. package/dist/{idCaptureServices-CqquDPJK.esm.js → idCaptureServices-tPKuX2tk.esm.js} +143 -17
  82. package/dist/{idCaptureStateMachine-C77vPrfK.esm.js → idCaptureStateMachine-Bmxbuam2.esm.js} +446 -55
  83. package/dist/{idOcrManager-CvJZhmBR.esm.js → idOcrManager-BIQYQXXj.esm.js} +3 -3
  84. package/dist/{idOcrStateMachine-Bq_e3l4E.esm.js → idOcrStateMachine-cSxzHpHt.esm.js} +2 -2
  85. package/dist/{idVerificationManager-CduNXhWd.esm.js → idVerificationManager-JpV_SAsl.esm.js} +3 -3
  86. package/dist/{idVerificationStateMachine-GEQWUPU2.esm.js → idVerificationStateMachine-nPeUNyFq.esm.js} +2 -2
  87. package/dist/identity-reuse.esm.js +2 -2
  88. package/dist/{identityReuseManager-D5vXknnJ.esm.js → identityReuseManager-kNCg9AbD.esm.js} +3 -3
  89. package/dist/{identityReuseStateMachine-AubRPhIi.esm.js → identityReuseStateMachine-DyulxDjP.esm.js} +2 -2
  90. package/dist/index.d.ts +1 -1
  91. package/dist/index.esm.js +1 -1
  92. package/dist/{invokeOnCaptureCallback-1m1VJ3Q4.esm.js → invokeOnCaptureCallback-GpvMuz9o.esm.js} +1 -1
  93. package/dist/mandatory-consent.d.ts +1 -1
  94. package/dist/mandatory-consent.esm.js +2 -2
  95. package/dist/{mandatoryConsentManager-DyPzUmsZ.d.ts → mandatoryConsentManager-B29kR0XA.d.ts} +4 -4
  96. package/dist/{mandatoryConsentManager-BeELm1zS.esm.js → mandatoryConsentManager-B4Niyg_u.esm.js} +3 -3
  97. package/dist/{mandatoryConsentStateMachine-zroQGzwb.esm.js → mandatoryConsentStateMachine-B4-1u-L8.esm.js} +2 -2
  98. package/dist/{onDeviceFaceResults-W-0feT1M.esm.js → onDeviceFaceResults-c2C3f8aJ.esm.js} +3 -3
  99. package/dist/personhood.esm.js +6 -6
  100. package/dist/phone.esm.js +2 -2
  101. package/dist/{phoneManager-Cpiai2IM.esm.js → phoneManager-FsJ0W2Ei.esm.js} +3 -3
  102. package/dist/{phoneStateMachine-E1fUUcNM.esm.js → phoneStateMachine-Ba0wKHyX.esm.js} +2 -2
  103. package/dist/qe-signature.esm.js +1 -1
  104. package/dist/{recordingService-DGUDVjsC.esm.js → recordingService-B4lWwVvx.esm.js} +1 -1
  105. package/dist/redirect-to-mobile.esm.js +2 -2
  106. package/dist/{redirectToMobileManager-C0dfc7f6.esm.js → redirectToMobileManager-y4VQB11M.esm.js} +4 -4
  107. package/dist/{redirectToMobileStateMachine-C9SYCJcH.esm.js → redirectToMobileStateMachine-Cyv2x0PP.esm.js} +2 -2
  108. package/dist/{runChildModule-C8zmFi0v.esm.js → runChildModule-CJmel52G.esm.js} +4 -4
  109. package/dist/sdkVersion-BdayV33Z.esm.js +4 -0
  110. package/dist/selfie.esm.js +8 -8
  111. package/dist/{selfieManager-nF1U2HVv.esm.js → selfieManager-D0n-sWLB.esm.js} +4 -4
  112. package/dist/{selfieStateMachine-WweUsh9j.esm.js → selfieStateMachine-CwVVWkl4.esm.js} +4 -4
  113. package/dist/{session-CSiLRkhY.esm.js → session-ClKGwEr_.esm.js} +4 -4
  114. package/dist/session.esm.js +4 -4
  115. package/dist/{sessionInitializer-Cryl_eFw.esm.js → sessionInitializer-DeBJtwsx.esm.js} +5 -4
  116. package/dist/{setup-DywQeePQ.d.ts → setup-BgoWtvIS.d.ts} +13 -1
  117. package/dist/{setup-Pq3OUa24.esm.js → setup-D__MD20t.esm.js} +7 -6
  118. package/dist/signature.esm.js +2 -2
  119. package/dist/{signatureManager-DdPgcmou.esm.js → signatureManager-Ca43yhwk.esm.js} +3 -3
  120. package/dist/{signatureStateMachine-Cf73DGWO.esm.js → signatureStateMachine-K1LMRrxG.esm.js} +2 -2
  121. package/dist/trueSight-D7taBQCC.esm.js +1 -0
  122. package/dist/{trueSightService-g7xYcH1C.esm.js → trueSightService-dcIpUbq3.esm.js} +4 -6
  123. package/dist/trust-graph.esm.js +2 -2
  124. package/dist/{types-M6eb82ra2.d.ts → types-Bdf8_LYB2.d.ts} +69 -13
  125. package/dist/video-selfie.esm.js +5 -5
  126. package/dist/{videoSelfieCameraWarmer-DvbVY391.esm.js → videoSelfieCameraWarmer-spkca8yr.esm.js} +2 -2
  127. package/dist/wasm.d.ts +1 -1
  128. package/dist/wasm.esm.js +1 -1
  129. package/dist/watchlist-for-business.esm.js +3 -3
  130. package/dist/watchlist.esm.js +2 -2
  131. package/dist/{watchlistForBusinessStateMachine-BcBMkMvV.esm.js → watchlistForBusinessStateMachine-CxFnlshm.esm.js} +2 -2
  132. package/dist/{watchlistManager-CjSMmbyq.esm.js → watchlistManager-LoNZH9qm.esm.js} +3 -3
  133. package/dist/{watchlistStateMachine-Bl7Wy9Cm.esm.js → watchlistStateMachine-DIKQDoUT.esm.js} +2 -2
  134. package/dist/workflow.esm.js +37 -37
  135. package/dist/{xstate-actors.esm-CtI5S0f4.esm.js → xstate-actors.esm-BXeQ-Ucz.esm.js} +1 -1
  136. package/dist/{xstate.esm-Cf4e0Cfd.esm.js → xstate.esm-BuFLFuzz.esm.js} +1 -1
  137. package/package.json +1 -1
  138. package/dist/trueSight-BG20aur1.esm.js +0 -1
@@ -1,8 +1,8 @@
1
1
  import { t as BrowserTimerProvider } from "./BrowserTimerProvider-BXhgNxLt.esm.js";
2
2
  import { t as api } from "./api-Bx3gKW_y.esm.js";
3
3
  import { t as endpoints } from "./endpoints-CCzL3XD_.esm.js";
4
- import { r as assign, t as setup } from "./xstate.esm-Cf4e0Cfd.esm.js";
5
- import { n as fromPromise, t as fromCallback } from "./xstate-actors.esm-CtI5S0f4.esm.js";
4
+ import { i as assign, t as setup } from "./xstate.esm-BuFLFuzz.esm.js";
5
+ import { n as fromPromise, t as fromCallback } from "./xstate-actors.esm-BXeQ-Ucz.esm.js";
6
6
  import { n as isOtpComplete, t as computeOtpValidationErrors } from "./otp-D2k3PeSL.esm.js";
7
7
  //#region src/modules/government-validation/governmentValidationServices.ts
8
8
  async function processGovernmentValidation(signal) {
package/dist/home.esm.js CHANGED
@@ -1,5 +1,5 @@
1
- import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-CxfNJVZW.esm.js";
2
- import { c as createManager, o as createActor, t as setup } from "./xstate.esm-Cf4e0Cfd.esm.js";
1
+ import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-DYiyoSlx.esm.js";
2
+ import { s as createActor, t as setup, u as createManager } from "./xstate.esm-BuFLFuzz.esm.js";
3
3
  //#region src/modules/home/homeStateMachine.ts
4
4
  const homeMachine = setup({ types: {
5
5
  context: {},
@@ -1,6 +1,6 @@
1
1
  import { t as validateCPF } from "./cpf-BIADjddF.esm.js";
2
- import { a as MIN_AGE, i as CPFFlowIds, n as OCR_FIELDS, r as getOcrFields, t as idOcrStateMachine } from "./idOcrStateMachine-Bq_e3l4E.esm.js";
3
- import { n as createIdOcrManagerFromActor, t as createIdOcrManager } from "./idOcrManager-CvJZhmBR.esm.js";
2
+ import { a as MIN_AGE, i as CPFFlowIds, n as OCR_FIELDS, r as getOcrFields, t as idOcrStateMachine } from "./idOcrStateMachine-cSxzHpHt.esm.js";
3
+ import { n as createIdOcrManagerFromActor, t as createIdOcrManager } from "./idOcrManager-BIQYQXXj.esm.js";
4
4
  //#region src/modules/id-ocr/idOcrCpfUtils.ts
5
5
  function formatCPF(value) {
6
6
  const digits = value.replace(/\D/g, "").slice(0, 11);
@@ -1,17 +1,17 @@
1
1
  import { r as WasmUtilProvider } from "./safeStorage-Ep56I-f_.esm.js";
2
- import { t as ensureWasmPipelines } from "./setup-Pq3OUa24.esm.js";
2
+ import { t as ensureWasmPipelines } from "./setup-D__MD20t.esm.js";
3
3
  import { t as BrowserTimerProvider } from "./BrowserTimerProvider-BXhgNxLt.esm.js";
4
- import { i as resolveDashboardModuleConfig, l as facingModeForStep } from "./flowServices-D4A-aOqa.esm.js";
5
- import { c as createManager, n as sendTo, o as createActor, r as assign, t as setup } from "./xstate.esm-Cf4e0Cfd.esm.js";
6
- import { n as fromPromise, t as fromCallback } from "./xstate-actors.esm-CtI5S0f4.esm.js";
7
- import { _ as StreamCanvasProcessingSession, a as encryptSelfieImage, l as startDetection, v as FaceDetectionProvider } from "./onDeviceFaceResults-W-0feT1M.esm.js";
4
+ import { i as resolveDashboardModuleConfig, l as facingModeForStep } from "./flowServices-yVZNf0k-.esm.js";
5
+ import { i as assign, r as sendTo, s as createActor, t as setup, u as createManager } from "./xstate.esm-BuFLFuzz.esm.js";
6
+ import { n as fromPromise, t as fromCallback } from "./xstate-actors.esm-BXeQ-Ucz.esm.js";
7
+ import { _ as StreamCanvasProcessingSession, a as encryptSelfieImage, l as startDetection, v as FaceDetectionProvider } from "./onDeviceFaceResults-c2C3f8aJ.esm.js";
8
8
  import { n as getWindowDimensions } from "./getDeviceClass-CeBiEayS.esm.js";
9
9
  import { i as uploadSelfie, r as processFace } from "./selfieErrorUtils-C2PYBVsp.esm.js";
10
10
  import { t as StreamCanvasCapture } from "./StreamCanvasCapture-D2XcXCZ4.esm.js";
11
11
  import { n as DEFAULT_ID_CAPTURE_THRESHOLDS, r as IdCaptureProvider, t as DEFAULT_ID_CAPTURE_GEOMETRY } from "./idCaptureDefaults-WeHbQM7W.esm.js";
12
- import { a as processId, d as validateUploadResponse, f as ID_ERROR_CODES, l as uploadIdImage } from "./idCaptureServices-CqquDPJK.esm.js";
13
- import { n as getFinishStatus } from "./flowCompletionService-Bg3Wlac8.esm.js";
14
- import { a as delay, c as isWrongVideoSelfieIdSide, n as defaultAcquireCamera, r as CameraCompositor, s as isSelfieValidationError } from "./videoSelfieCameraWarmer-DvbVY391.esm.js";
12
+ import { a as processId, d as validateUploadResponse, f as ID_ERROR_CODES, l as uploadIdImage } from "./idCaptureServices-tPKuX2tk.esm.js";
13
+ import { n as getFinishStatus } from "./flowCompletionService-BSJ-_sjm.esm.js";
14
+ import { a as delay, c as isWrongVideoSelfieIdSide, n as defaultAcquireCamera, r as CameraCompositor, s as isSelfieValidationError } from "./videoSelfieCameraWarmer-spkca8yr.esm.js";
15
15
  //#region src/modules/id-selfie-flow/idSelfieFlowStepDetector.ts
16
16
  /** Default autocapture window for the selfie step. */
17
17
  const SELFIE_AUTOCAPTURE_MS = 1e4;
@@ -1,3 +1,3 @@
1
- import { t as idVerificationMachine } from "./idVerificationStateMachine-GEQWUPU2.esm.js";
2
- import { n as createIdVerificationManagerFromActor, t as createIdVerificationManager } from "./idVerificationManager-CduNXhWd.esm.js";
1
+ import { t as idVerificationMachine } from "./idVerificationStateMachine-nPeUNyFq.esm.js";
2
+ import { n as createIdVerificationManagerFromActor, t as createIdVerificationManager } from "./idVerificationManager-JpV_SAsl.esm.js";
3
3
  export { createIdVerificationManager, createIdVerificationManagerFromActor, idVerificationMachine };
package/dist/id.d.ts CHANGED
@@ -2,8 +2,8 @@ import { t as IVisibilityObserverCapability } from "./IVisibilityObserverCapabil
2
2
  import { t as CameraStream } from "./camera-9wWD-pwg.js";
3
3
  import { n as PermissionStatus, t as PermissionResult } from "./types-BEwVKkLJ.js";
4
4
  import { r as IdCaptureSettings, t as DetectionOrientation } from "./IIdCaptureCapability-DHTT3FC2.js";
5
- import { A as ManualUploadSide, C as RecordingSession, D as MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, E as MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, O as MANUAL_UPLOAD_MAX_RETRIES, S as IdFlowStep, _ as IdCaptureThresholds, a as DetectionArea, b as IdError, c as IdCaptureConfig, d as IdCaptureEvent, f as IdCaptureGeometry, g as IdCaptureOutput, h as IdCaptureOnlyConfig, i as CapturedImage, j as ManualUploadTab, k as ManualUploadContext, l as IdCaptureContext, m as IdCaptureMode, n as CaptureIdResponse, o as DetectionStatus, p as IdCaptureInput, r as CaptureOnlyResponse, s as ID_ERROR_CODES, t as AddBarcodeV3Response, u as IdCaptureDependencies, v as IdCapturedImageData, w as UploadIdResponse, x as IdErrorCode, y as IdDocumentType } from "./types-M6eb82ra2.js";
6
- import { A as createIdCaptureActor, C as CreateIdCaptureOnlyActorOptions, D as idCaptureOnlyMachine, E as IdCaptureOnlyMachine, M as idCaptureMachine, O as CreateIdCaptureActorOptions, S as validateUploadResponse, T as createIdCaptureOnlyActor, _ as startRecordingSession, a as AddBarcodeParams, b as uploadIdImage, c as StartRecordingParams, d as ValidationError, f as addBarcode, g as processId, h as preloadIdRecordingProvider, j as IdCaptureMachine, k as IdCaptureActor, l as UploadIdImageParams, m as initializeIdCapture, n as IdCaptureManager, o as IdCaptureInitResult, p as barcodeToBase64, r as IdCaptureState, s as InitializeIdCaptureParams, t as createIdCaptureManager, u as UploadManualIdFileParams, v as stopRecording, w as IdCaptureOnlyActor, x as uploadManualIdFile, y as stopStream } from "./idCaptureManager-BjU-Wyow.js";
5
+ import { A as ManualUploadSide, C as RecordingSession, D as MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, E as MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, O as MANUAL_UPLOAD_MAX_RETRIES, S as IdFlowStep, _ as IdCaptureThresholds, a as DetectionArea, b as IdError, c as IdCaptureConfig, d as IdCaptureEvent, f as IdCaptureGeometry, g as IdCaptureOutput, h as IdCaptureOnlyConfig, i as CapturedImage, j as ManualUploadTab, k as ManualUploadContext, l as IdCaptureContext, m as IdCaptureMode, n as CaptureIdResponse, o as DetectionStatus, p as IdCaptureInput, r as CaptureOnlyResponse, s as ID_ERROR_CODES, t as AddBarcodeV3Response, u as IdCaptureDependencies, v as IdCapturedImageData, w as UploadIdResponse, x as IdErrorCode, y as IdDocumentType } from "./types-Bdf8_LYB2.js";
6
+ import { A as createIdCaptureActor, C as CreateIdCaptureOnlyActorOptions, D as idCaptureOnlyMachine, E as IdCaptureOnlyMachine, M as idCaptureMachine, O as CreateIdCaptureActorOptions, S as validateUploadResponse, T as createIdCaptureOnlyActor, _ as startRecordingSession, a as AddBarcodeParams, b as uploadIdImage, c as StartRecordingParams, d as ValidationError, f as addBarcode, g as processId, h as preloadIdRecordingProvider, j as IdCaptureMachine, k as IdCaptureActor, l as UploadIdImageParams, m as initializeIdCapture, n as IdCaptureManager, o as IdCaptureInitResult, p as barcodeToBase64, r as IdCaptureState, s as InitializeIdCaptureParams, t as createIdCaptureManager, u as UploadManualIdFileParams, v as stopRecording, w as IdCaptureOnlyActor, x as uploadManualIdFile, y as stopStream } from "./idCaptureManager-CqrqSjJV.js";
7
7
  //#region src/modules/id/idCaptureOnlyManager.d.ts
8
8
  type IdCaptureOnlyManager = IdCaptureManager;
9
9
  /**
package/dist/id.esm.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { t as BrowserStorageProvider } from "./BrowserStorageProvider-k-FDkC4W.esm.js";
2
- import { n as eventModuleNames } from "./events-CxfNJVZW.esm.js";
3
- import { o as createActor, r as assign } from "./xstate.esm-Cf4e0Cfd.esm.js";
4
- import { n as fromPromise } from "./xstate-actors.esm-CtI5S0f4.esm.js";
5
- import { a as MANUAL_UPLOAD_MAX_RETRIES, i as MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, r as MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, t as idCaptureMachine } from "./idCaptureStateMachine-C77vPrfK.esm.js";
6
- import { n as createIdCaptureActor, r as createIdCaptureManagerFromActor, t as createIdCaptureManager } from "./idCaptureManager-BGq73YE-.esm.js";
7
- import { a as processId, c as stopStream, d as validateUploadResponse, f as ID_ERROR_CODES, i as preloadIdRecordingProvider, l as uploadIdImage, m as resolveIdCaptureThresholds, n as barcodeToBase64, o as startRecordingSession, r as initializeIdCapture, s as stopRecording, t as addBarcode, u as uploadManualIdFile } from "./idCaptureServices-CqquDPJK.esm.js";
8
- import { t as invokeOnCaptureCallback } from "./invokeOnCaptureCallback-1m1VJ3Q4.esm.js";
2
+ import { n as eventModuleNames } from "./events-DYiyoSlx.esm.js";
3
+ import { i as assign, s as createActor } from "./xstate.esm-BuFLFuzz.esm.js";
4
+ import { n as fromPromise } from "./xstate-actors.esm-BXeQ-Ucz.esm.js";
5
+ import { a as MANUAL_UPLOAD_MAX_RETRIES, i as MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, r as MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, t as idCaptureMachine } from "./idCaptureStateMachine-Bmxbuam2.esm.js";
6
+ import { n as createIdCaptureActor, r as createIdCaptureManagerFromActor, t as createIdCaptureManager } from "./idCaptureManager-Cf6LiYpF.esm.js";
7
+ import { a as processId, c as stopStream, d as validateUploadResponse, f as ID_ERROR_CODES, i as preloadIdRecordingProvider, l as uploadIdImage, m as resolveIdCaptureThresholds, n as barcodeToBase64, o as startRecordingSession, r as initializeIdCapture, s as stopRecording, t as addBarcode, u as uploadManualIdFile } from "./idCaptureServices-tPKuX2tk.esm.js";
8
+ import { t as invokeOnCaptureCallback } from "./invokeOnCaptureCallback-GpvMuz9o.esm.js";
9
9
  //#region src/modules/id/idCaptureOnlyStateMachine.ts
10
10
  function buildSubImage(canvas) {
11
11
  if (!canvas) return void 0;
@@ -1,12 +1,12 @@
1
1
  import { t as BrowserStorageProvider } from "./BrowserStorageProvider-k-FDkC4W.esm.js";
2
- import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-CxfNJVZW.esm.js";
2
+ import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-DYiyoSlx.esm.js";
3
3
  import { t as topLevelStateName } from "./topLevelStateName-B5i2avbh.esm.js";
4
- import { c as createManager, o as createActor } from "./xstate.esm-Cf4e0Cfd.esm.js";
4
+ import { s as createActor, u as createManager } from "./xstate.esm-BuFLFuzz.esm.js";
5
5
  import { t as setWasmDsFlagSync } from "./wasmDsFlagSync-BqUCwLY8.esm.js";
6
6
  import { t as BrowserVisibilityObserverProvider } from "./BrowserVisibilityObserverProvider-BX1BiLDK.esm.js";
7
7
  import { o as resetWasmMotionPrimedForModule, r as primeMotionFromUserGestureIfNeeded } from "./permissionServices-UvUcOSRb.esm.js";
8
- import { n as getManualUploadTabs, t as idCaptureMachine } from "./idCaptureStateMachine-C77vPrfK.esm.js";
9
- import { m as resolveIdCaptureThresholds, p as resolveCaptureResultPreviewTreatment } from "./idCaptureServices-CqquDPJK.esm.js";
8
+ import { n as getManualUploadTabs, t as idCaptureMachine } from "./idCaptureStateMachine-Bmxbuam2.esm.js";
9
+ import { m as resolveIdCaptureThresholds, p as resolveCaptureOptimizingTreatment } from "./idCaptureServices-tPKuX2tk.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) {
@@ -115,13 +115,13 @@ function getPermissionStatus(snapshot) {
115
115
  function getCaptureStatus(snapshot) {
116
116
  const matches = {
117
117
  initializing: snapshot.matches({ capture: "initializing" }),
118
- detecting: snapshot.matches({ capture: "detecting" }),
118
+ detecting: snapshot.matches({ capture: "detecting" }) || snapshot.matches({ capture: "choosingDetectionStrategy" }) || snapshot.matches({ capture: { detectingWithOptimization: "searching" } }),
119
119
  manualCaptureWaiting: snapshot.matches({ capture: "manualCaptureWaiting" }),
120
120
  capturing: snapshot.matches({ capture: "capturing" }),
121
121
  capturingManual: snapshot.matches({ capture: "capturingManual" }),
122
122
  capturingBarcode: snapshot.matches({ capture: "capturingBarcode" }),
123
123
  submittingBarcodePreCapture: snapshot.matches({ capture: "submittingBarcodePreCapture" }),
124
- resultPreview: snapshot.matches({ capture: "resultPreview" }),
124
+ optimizing: snapshot.matches({ capture: { detectingWithOptimization: "optimizing" } }) || snapshot.matches({ capture: "optimizingHold" }),
125
125
  uploading: snapshot.matches({ capture: "uploading" }),
126
126
  uploadCompleted: snapshot.matches({ capture: "uploadCompleted" }),
127
127
  submittingBarcode: snapshot.matches({ capture: "submittingBarcode" }),
@@ -129,11 +129,11 @@ function getCaptureStatus(snapshot) {
129
129
  success: snapshot.matches({ capture: "success" })
130
130
  };
131
131
  if (matches.initializing) return "initializing";
132
+ if (matches.optimizing) return "optimizing";
132
133
  if (matches.detecting || matches.manualCaptureWaiting) return "detecting";
133
134
  if (matches.capturingBarcode || matches.submittingBarcodePreCapture) return "holdOn";
134
135
  if (matches.capturing || matches.capturingManual) return "capturing";
135
136
  if (matches.uploading || matches.uploadCompleted || matches.submittingBarcode) return "uploading";
136
- if (matches.resultPreview) return "resultPreview";
137
137
  if (matches.uploadError) return "uploadError";
138
138
  if (matches.success) return "success";
139
139
  }
@@ -223,6 +223,8 @@ function mapCaptureState(snapshot, context) {
223
223
  orientation: context.orientation,
224
224
  idType: context.idType,
225
225
  previewImageUrl: context.previewImageUrl,
226
+ candidateImageUrl: context.candidateImageUrl,
227
+ optimizingDwellMs: context.optimizingDwellMs,
226
228
  barcodeFastPathCaptured: context.barcodeFastPathCaptured,
227
229
  uploadProgress: context.uploadProgress ?? 0,
228
230
  ageAssurance: context.config.ageAssurance === true,
@@ -406,14 +408,6 @@ function createApi({ actor, trackElementClicked, trackCaptureAttemptFinished })
406
408
  }
407
409
  actor.send({ type: "NEXT_STEP" });
408
410
  },
409
- /**
410
- * Advances out of `resultPreview`. Deliberately untracked: this fires from
411
- * the UI's own dwell timer / animationend, not a user action, so it must not
412
- * emit an `elementClicked`.
413
- */
414
- completeResultPreview() {
415
- actor.send({ type: "RESULT_PREVIEW_COMPLETE" });
416
- },
417
411
  requestPermission() {
418
412
  trackElementClicked?.("requestPermission");
419
413
  actor.send({ type: "REQUEST_PERMISSION" });
@@ -792,14 +786,16 @@ function createIdCaptureManagerFromActor(actor, visibilityObserver = new Browser
792
786
  //#region src/modules/id/idCaptureActor.ts
793
787
  function createIdCaptureActor(options) {
794
788
  const dependencies = options.dependencies ?? { storage: new BrowserStorageProvider() };
795
- const treatment = resolveCaptureResultPreviewTreatment(options.config);
789
+ const treatment = resolveCaptureOptimizingTreatment(options.config);
796
790
  return createActor(idCaptureMachine, { input: {
797
791
  config: {
798
792
  ...options.config,
799
793
  thresholds: resolveIdCaptureThresholds(options.config, treatment?.framesAggregationInterval)
800
794
  },
801
795
  dependencies,
802
- captureFeedbackMode: treatment?.mode ?? "countdown"
796
+ captureFeedbackMode: treatment?.mode ?? "countdown",
797
+ captureWindowMs: treatment?.captureWindowMs,
798
+ optimizingDwellMs: treatment?.optimizingDwellMs
803
799
  } }).start();
804
800
  }
805
801
  //#endregion
@@ -9,7 +9,7 @@ import { a as RegulationTypes } from "./types-KPvmag_B.js";
9
9
  import { n as PermissionStatus } from "./types-BEwVKkLJ.js";
10
10
  import { t as DeepsightService } from "./deepsightService-DLVQS_RH.js";
11
11
  import { i as Pdf417DecodeResult, n as IIdCaptureCapability, t as DetectionOrientation } from "./IIdCaptureCapability-DHTT3FC2.js";
12
- import { A as ManualUploadSide, C as RecordingSession, T as IAnalyticsCapability, a as DetectionArea, c as IdCaptureConfig, d as IdCaptureEvent, g as IdCaptureOutput, h as IdCaptureOnlyConfig, j as ManualUploadTab, l as IdCaptureContext, m as IdCaptureMode, n as CaptureIdResponse, o as DetectionStatus, p as IdCaptureInput, t as AddBarcodeV3Response, u as IdCaptureDependencies, w as UploadIdResponse, x as IdErrorCode, y as IdDocumentType } from "./types-M6eb82ra2.js";
12
+ import { A as ManualUploadSide, C as RecordingSession, T as IAnalyticsCapability, a as DetectionArea, c as IdCaptureConfig, d as IdCaptureEvent, g as IdCaptureOutput, h as IdCaptureOnlyConfig, j as ManualUploadTab, l as IdCaptureContext, m as IdCaptureMode, n as CaptureIdResponse, o as DetectionStatus, p as IdCaptureInput, t as AddBarcodeV3Response, u as IdCaptureDependencies, w as UploadIdResponse, x as IdErrorCode, y as IdDocumentType } from "./types-Bdf8_LYB2.js";
13
13
  //#region src/modules/id/idCaptureStateMachine.d.ts
14
14
  declare const idCaptureMachine: AnyStateMachine;
15
15
  type IdCaptureMachine = StateMachine<IdCaptureContext, IdCaptureEvent, any, any, any, any, any, any, any, IdCaptureInput, any, any, any, any>;
@@ -171,7 +171,7 @@ declare function addBarcode(params: AddBarcodeParams): Promise<AddBarcodeV3Respo
171
171
  type DigitalUploadFailReason = 'DIGITAL_ID_REQUESTED_BUT_OTHER_PROVIDED' | 'ID_TYPE_UNACCEPTABLE' | 'FILE_CHANGED_ERROR' | 'INVALID_FILE_TYPE' | 'NETWORK_ERROR' | 'GENERIC';
172
172
  //#endregion
173
173
  //#region src/internal/idCapture/idCaptureManagerFactory.d.ts
174
- type CaptureStatus = 'initializing' | 'detecting' | 'capturing' | 'holdOn' | 'resultPreview' | 'uploading' | 'uploadError' | 'success';
174
+ type CaptureStatus = 'initializing' | 'detecting' | 'capturing' | 'holdOn' | 'optimizing' | 'uploading' | 'uploadError' | 'success';
175
175
  type IdCaptureIdleState = {
176
176
  status: 'idle';
177
177
  };
@@ -206,6 +206,23 @@ type IdCaptureCaptureState = {
206
206
  orientation: DetectionOrientation | undefined;
207
207
  idType: string | undefined;
208
208
  previewImageUrl?: string;
209
+ /**
210
+ * IDC-05 auto-capture path, while `captureStatus === 'optimizing'`: WASM's
211
+ * best frame so far, to freeze during the optimizing phase. Display-only — detection is
212
+ * still running and may yet find a better frame, which arrives on
213
+ * `previewImageUrl`.
214
+ *
215
+ * Absent on the manual path, whose phase runs *after* the commit — freeze
216
+ * `previewImageUrl` there. `candidateImageUrl ?? previewImageUrl` covers
217
+ * both without branching on the path.
218
+ */
219
+ candidateImageUrl?: string;
220
+ /**
221
+ * IDC-05 only: how long the optimizing phase lasts. Also the hold the
222
+ * rendering layer applies on the manual-capture path, which has no
223
+ * aggregation window of its own.
224
+ */
225
+ optimizingDwellMs?: number;
209
226
  /**
210
227
  * Barcode fast-path success — render the checkmark "Successfully processed!"
211
228
  * screen with NO captured image (the grabbed frame is a backend signal only;
@@ -215,7 +232,7 @@ type IdCaptureCaptureState = {
215
232
  barcodeFastPathCaptured: boolean;
216
233
  uploadProgress?: number;
217
234
  ageAssurance: boolean;
218
- captureFeedbackMode: 'countdown' | 'result-preview';
235
+ captureFeedbackMode: 'countdown' | 'optimizing';
219
236
  uploadErrorMessage?: string;
220
237
  uploadErrorDescription?: string;
221
238
  /** Whether back capture is needed after front capture completes */
@@ -336,12 +353,6 @@ declare function createIdCaptureManagerFromActor(actor: AnyIdCaptureActor, visib
336
353
  load(): void;
337
354
  selectDocument(documentType: IdDocumentType): void;
338
355
  nextStep(): Promise<void>;
339
- /**
340
- * Advances out of `resultPreview`. Deliberately untracked: this fires from
341
- * the UI's own dwell timer / animationend, not a user action, so it must not
342
- * emit an `elementClicked`.
343
- */
344
- completeResultPreview(): void;
345
356
  requestPermission(): void;
346
357
  goToLearnMore(): void;
347
358
  back(): void;
@@ -396,7 +407,6 @@ declare function createIdCaptureManager(options: CreateIdCaptureActorOptions): M
396
407
  load(): void;
397
408
  selectDocument(documentType: IdDocumentType): void;
398
409
  nextStep(): Promise<void>;
399
- completeResultPreview(): void;
400
410
  requestPermission(): void;
401
411
  goToLearnMore(): void;
402
412
  back(): void;
@@ -1,11 +1,11 @@
1
- import { i as numberParam, n as defineExperimentParams, t as booleanParam, u as resolveExperimentOnce } from "./feature-management-DS_Nj5Gg.esm.js";
1
+ import { i as numberParam, n as defineExperimentParams, t as booleanParam, u as resolveExperimentOnce } from "./feature-management-BNQRs-_1.esm.js";
2
2
  import { t as api } from "./api-Bx3gKW_y.esm.js";
3
3
  import { t as endpoints } from "./endpoints-CCzL3XD_.esm.js";
4
4
  import { r as isDesktop } from "./platform-BJrm5nzZ.esm.js";
5
- import { h as stopRecording$1, m as startRecording, p as createRecordingSession } from "./onDeviceFaceResults-W-0feT1M.esm.js";
5
+ import { h as stopRecording$1, m as startRecording, p as createRecordingSession } from "./onDeviceFaceResults-c2C3f8aJ.esm.js";
6
6
  import { n as getBackCameraStream } from "./backCameraStream-CUeYm5eu.esm.js";
7
7
  import { t as getDeviceClass } from "./getDeviceClass-9y-kbVDw.esm.js";
8
- import { n as preloadOpenViduProvider } from "./recordingService-DGUDVjsC.esm.js";
8
+ import { n as preloadOpenViduProvider } from "./recordingService-B4lWwVvx.esm.js";
9
9
  import { n as DEFAULT_ID_CAPTURE_THRESHOLDS, r as IdCaptureProvider } from "./idCaptureDefaults-WeHbQM7W.esm.js";
10
10
  //#region src/modules/id/idCameraStream.ts
11
11
  async function getIdCameraStream(deviceId) {
@@ -14,24 +14,148 @@ async function getIdCameraStream(deviceId) {
14
14
  //#endregion
15
15
  //#region src/modules/id/idCaptureExperiments.ts
16
16
  /**
17
- * IDC-05 resolved by core because `framesAggregationInterval` feeds
17
+ * IDC-05 splits the WASM frames-aggregation window into a silent live half
18
+ * (`framesAggregationIntervalMs`, "Taking photo…") and an optimizing half
19
+ * (`resultPreviewDwellMs`, "Successfully captured" / "Optimizing your capture…")
20
+ * during which detection keeps running, so the frame that finally uploads is
21
+ * the best across both halves. WASM receives their sum. iOS uses 1500 + 1500
22
+ * (`IDCaptureExp05Timing`).
23
+ *
24
+ * The two param names below are the **Statsig payload keys**, deliberately kept
25
+ * as originally configured; everything downstream of
26
+ * `resolveCaptureOptimizingTreatment` speaks of the optimizing phase instead
27
+ * (`captureWindowMs` / `optimizingDwellMs`). Renaming a key here renames what
28
+ * the console must send, and a payload still using the old spelling would
29
+ * silently fall back to these code defaults.
30
+ *
31
+ * The split is NOT pinned to a fixed total. The only ceiling is the session's
32
+ * autocapture budget, applied in `resolveCaptureOptimizingTreatment`: a
33
+ * payload whose halves exceed it is halved to fit rather than rejected, and a
34
+ * session whose budget cannot fit a meaningful split runs the countdown arm.
35
+ * Note this means the console payload decides total capture duration — a
36
+ * treatment payload that leaves `framesAggregationIntervalMs` at its 3000
37
+ * default produces a 4500ms window against the 5s default budget, i.e. longer
38
+ * than the countdown arm's 3000ms. Set both halves explicitly.
39
+ */
40
+ const MAX_OPTIMIZING_DWELL_MS = 2500;
41
+ const DEFAULT_OPTIMIZING_DWELL_MS = 1500;
42
+ /**
43
+ * How long the machine waits for WASM's commit *after* the optimizing phase has
44
+ * had its full dwell, before treating the window as abandoned
45
+ * (`optimizingGrace`, `idCaptureStateMachine.ts`).
46
+ *
47
+ * The phase is expected to last exactly one dwell: it starts at
48
+ * `T0 + captureWindowMs` and WASM closes its aggregation window with
49
+ * `onCapture` at `T0 + captureWindowMs + optimizingDwellMs`. This grace covers
50
+ * the case where that `onCapture` never arrives — aggregation aborting
51
+ * mid-phase because the document left the frame, so the window the frozen still
52
+ * belongs to is simply abandoned.
53
+ *
54
+ * Sized to be unreachable on a healthy phase: WASM's frame loop and the JS
55
+ * boundary timer both jitter, and a late boundary only *delays* the phase, which
56
+ * delays this grace with it — so the only way to overrun a full second past the
57
+ * dwell is that no commit is coming.
58
+ */
59
+ const OPTIMIZING_WATCHDOG_MARGIN_MS = 1e3;
60
+ /**
61
+ * IDC-05 — resolved by core because `framesAggregationIntervalMs` feeds
18
62
  * `setThresholds` before detection can run.
63
+ *
64
+ * `framesAggregationIntervalMs` carries no upper bound here because it means
65
+ * two different things depending on the arm: the WHOLE aggregation window in
66
+ * the countdown arm, only the pre-boundary half in the treatment arm. Bounding it
67
+ * for one would break the other, so the arm-aware handling lives in
68
+ * `resolveCaptureOptimizingTreatment`. Its code default stays at the
69
+ * canonical 3000 so an unallocated session keeps shipped control behavior.
19
70
  */
20
- const CAPTURE_RESULT_PREVIEW = {
21
- storeParam: "captureResultPreview",
71
+ const CAPTURE_OPTIMIZING = {
72
+ storeParam: "idcExp05ShowResult",
22
73
  ...defineExperimentParams({
23
74
  showCaptureResultPreview: booleanParam(false),
24
- framesAggregationInterval: numberParam(DEFAULT_ID_CAPTURE_THRESHOLDS.framesAggregationInterval)
75
+ framesAggregationIntervalMs: numberParam(DEFAULT_ID_CAPTURE_THRESHOLDS.framesAggregationInterval, { min: 0 }),
76
+ resultPreviewDwellMs: numberParam(DEFAULT_OPTIMIZING_DWELL_MS, {
77
+ min: 0,
78
+ max: MAX_OPTIMIZING_DWELL_MS
79
+ })
25
80
  })
26
81
  };
27
82
  //#endregion
28
83
  //#region src/modules/id/idCaptureThresholds.ts
29
- function resolveCaptureResultPreviewTreatment(config) {
30
- if (config.supportsCaptureResultPreview !== true) return void 0;
31
- const { params } = resolveExperimentOnce(CAPTURE_RESULT_PREVIEW);
84
+ /**
85
+ * WASM restarts its manual-capture timer at first ID *detection* but only opens
86
+ * the frames-aggregation window at the first *good-quality* frame, and never
87
+ * stops that timer once aggregation begins. If it fires mid-window it captures
88
+ * early (`CapturingManager.cpp`, the `isLookingForBestFrame` branch of the
89
+ * `manualCaptureTimer` interval callback), which would truncate the
90
+ * optimizing half.
91
+ */
92
+ const AUTOCAPTURE_SAFETY_MARGIN_MS = 500;
93
+ /**
94
+ * Smallest autocapture budget that can still carry a meaningful IDC-05 split.
95
+ *
96
+ * An over-budget payload is halved to fit (below), so the budget alone decides
97
+ * how short each half can get. At 3000ms each half is 1500ms — the iOS timing
98
+ * and the shortest pre-boundary window that reliably yields a best frame. Below
99
+ * that the session runs the countdown arm instead: a 1000ms/1000ms split would
100
+ * reveal a frame WASM has barely had time to score.
101
+ *
102
+ * Budget is `autocaptureTimeout - AUTOCAPTURE_SAFETY_MARGIN_MS`, so this floor
103
+ * means an effective `autocaptureTimeout` of at least 3500ms.
104
+ */
105
+ const MIN_EXPERIMENT_AUTOCAPTURE_BUDGET_MS = 3e3;
106
+ /**
107
+ * The autocapture window WASM will be given, derived the same way whether the
108
+ * caller is building thresholds or checking whether a split window fits inside
109
+ * it. Shared so the two can't drift.
110
+ */
111
+ function resolveAutocaptureTimeout(config) {
112
+ return config.thresholds?.autocaptureTimeout ?? (config.autoCaptureTimeout ?? 5) * 1e3;
113
+ }
114
+ /**
115
+ * Resolves the IDC-05 arm and, for the treatment, the two halves of the capture
116
+ * window. Precedence:
117
+ *
118
+ * 1. An explicit `config.thresholds.framesAggregationInterval` (host/headless
119
+ * override) opts the session OUT of the treatment: the host has deliberately
120
+ * pinned the capture window, and splitting it against that intent is worse
121
+ * than not running the experiment on that traffic.
122
+ * 2. Countdown arm (or unallocated) → the experiment's interval straight
123
+ * through, unchanged from before this split existed.
124
+ * 3. Treatment arm, budget too small for a viable split → countdown arm on the
125
+ * CANONICAL window (not the payload's, see below).
126
+ * 4. Treatment arm → the payload's two halves, each halved to `budget / 2` if
127
+ * their sum would overrun the autocapture budget. Deliberately no contract
128
+ * on the total and no rejection path: an out-of-range payload is fitted, not
129
+ * refused, so no session logs a warning or silently runs mis-timed.
130
+ */
131
+ function resolveCaptureOptimizingTreatment(config) {
132
+ if (config.supportsOptimizingStatus !== true) return void 0;
133
+ const { params } = resolveExperimentOnce(CAPTURE_OPTIMIZING);
134
+ const hostInterval = config.thresholds?.framesAggregationInterval;
135
+ if (hostInterval !== void 0) return {
136
+ mode: "countdown",
137
+ framesAggregationInterval: hostInterval
138
+ };
139
+ const budget = resolveAutocaptureTimeout(config) - AUTOCAPTURE_SAFETY_MARGIN_MS;
140
+ if (!params.showCaptureResultPreview) return {
141
+ mode: "countdown",
142
+ framesAggregationInterval: params.framesAggregationIntervalMs
143
+ };
144
+ if (budget < MIN_EXPERIMENT_AUTOCAPTURE_BUDGET_MS) return {
145
+ mode: "countdown",
146
+ framesAggregationInterval: DEFAULT_ID_CAPTURE_THRESHOLDS.framesAggregationInterval
147
+ };
148
+ let captureWindowMs = params.framesAggregationIntervalMs;
149
+ let optimizingDwellMs = params.resultPreviewDwellMs;
150
+ if (captureWindowMs + optimizingDwellMs > budget) {
151
+ captureWindowMs = Math.floor(budget / 2);
152
+ optimizingDwellMs = captureWindowMs;
153
+ }
32
154
  return {
33
- mode: params.showCaptureResultPreview ? "result-preview" : "countdown",
34
- framesAggregationInterval: params.framesAggregationInterval
155
+ mode: "optimizing",
156
+ framesAggregationInterval: captureWindowMs + optimizingDwellMs,
157
+ captureWindowMs,
158
+ optimizingDwellMs
35
159
  };
36
160
  }
37
161
  /**
@@ -41,9 +165,11 @@ function resolveCaptureResultPreviewTreatment(config) {
41
165
  * 3000ms) — with precedence:
42
166
  *
43
167
  * 1. An explicit `config.thresholds.framesAggregationInterval` (host/headless
44
- * override) always wins including when allocated to the treatment arm,
45
- * which then runs the treatment UI on the host's aggregation window.
46
- * 2. Otherwise, the IDC-05 experiment's `framesAggregationInterval`.
168
+ * override) always wins. Such a session never runs the IDC-05 treatment
169
+ * (see `resolveCaptureOptimizingTreatment`), so the override is the whole
170
+ * window, undivided.
171
+ * 2. Otherwise, the IDC-05-resolved interval — the summed split window in the
172
+ * treatment arm, the plain interval in the countdown arm.
47
173
  * 3. Otherwise, the canonical default.
48
174
  *
49
175
  * `idDetectedTimeout`/`autocaptureTimeout` are derived here too (from
@@ -64,7 +190,7 @@ function resolveIdCaptureThresholds(config, experimentInterval) {
64
190
  ...config.thresholds,
65
191
  framesAggregationInterval: config.thresholds?.framesAggregationInterval ?? experimentInterval ?? DEFAULT_ID_CAPTURE_THRESHOLDS.framesAggregationInterval,
66
192
  idDetectedTimeout: config.thresholds?.idDetectedTimeout ?? (config.deviceIdleTimeout ?? 10) * 1e3,
67
- autocaptureTimeout: config.thresholds?.autocaptureTimeout ?? (config.autoCaptureTimeout ?? 5) * 1e3
193
+ autocaptureTimeout: resolveAutocaptureTimeout(config)
68
194
  };
69
195
  }
70
196
  //#endregion
@@ -393,4 +519,4 @@ async function addBarcode(params) {
393
519
  return res.data;
394
520
  }
395
521
  //#endregion
396
- export { processId as a, stopStream as c, validateUploadResponse as d, ID_ERROR_CODES as f, getIdCameraStream as g, CAPTURE_RESULT_PREVIEW as h, preloadIdRecordingProvider as i, uploadIdImage as l, resolveIdCaptureThresholds as m, barcodeToBase64 as n, startRecordingSession as o, resolveCaptureResultPreviewTreatment as p, initializeIdCapture as r, stopRecording as s, addBarcode as t, uploadManualIdFile as u };
522
+ export { getIdCameraStream as _, processId as a, stopStream as c, validateUploadResponse as d, ID_ERROR_CODES as f, OPTIMIZING_WATCHDOG_MARGIN_MS as g, CAPTURE_OPTIMIZING as h, preloadIdRecordingProvider as i, uploadIdImage as l, resolveIdCaptureThresholds as m, barcodeToBase64 as n, startRecordingSession as o, resolveCaptureOptimizingTreatment as p, initializeIdCapture as r, stopRecording as s, addBarcode as t, uploadManualIdFile as u };