@incodetech/core 0.0.0-dev-20260902-40c6c934 → 0.0.0-dev-20260902-6bf995eb

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 (56) hide show
  1. package/dist/{BrowserDiagnosticsCryptoProvider-DDehiRaB.esm.js → BrowserDiagnosticsCryptoProvider-DwmAfiwB.esm.js} +1 -1
  2. package/dist/ae-signature.esm.js +1 -1
  3. package/dist/{apiError-3eSyevaX.esm.js → apiError-DhziHa4B.esm.js} +1 -1
  4. package/dist/authentication.esm.js +2 -2
  5. package/dist/{authenticationManager-CjdHY09X.esm.js → authenticationManager-CpFvm_na.esm.js} +3 -3
  6. package/dist/{authenticationStateMachine-C_-KyW3t.esm.js → authenticationStateMachine-DZ_KW_eb.esm.js} +2 -2
  7. package/dist/consent.d.ts +1 -1
  8. package/dist/{consentManager-3Pbtj-RV.d.ts → consentManager-uhDPdU6i.d.ts} +4 -4
  9. package/dist/{deepsightLoader-D_lzPrKE.esm.js → deepsightLoader-BCsoAbCL.esm.js} +2 -2
  10. package/dist/dynamic-forms.esm.js +2 -2
  11. package/dist/{dynamicFormsManager-C_LF5Uv2.esm.js → dynamicFormsManager-DIkSROGe.esm.js} +1 -1
  12. package/dist/{dynamicFormsStateMachine-CHBZqg0W.esm.js → dynamicFormsStateMachine-DPMGFx9g.esm.js} +1 -1
  13. package/dist/ekyb.esm.js +3 -3
  14. package/dist/{ekybManager-x7MaCF3a.esm.js → ekybManager-Dbyzu1GZ.esm.js} +1 -1
  15. package/dist/{ekybStateMachine-Cp6b6_Rf.esm.js → ekybStateMachine-D6ERRSpc.esm.js} +1 -1
  16. package/dist/electronic-signature.esm.js +1 -1
  17. package/dist/{electronicSignatureManager-Bx-xotVy.esm.js → electronicSignatureManager-YTvxmh25.esm.js} +1 -1
  18. package/dist/extensibility.d.ts +2 -2
  19. package/dist/extensibility.esm.js +10 -10
  20. package/dist/{faceCaptureManagerFactory-BReY4BtR.esm.js → faceCaptureManagerFactory-BKkwc_5_.esm.js} +1 -1
  21. package/dist/{faceCaptureSetup-Bv167dJ_.esm.js → faceCaptureSetup-xL2SFeyk.esm.js} +1 -1
  22. package/dist/{feature-management-BumvjbYe.esm.js → feature-management-DhZKhR-O.esm.js} +1 -1
  23. package/dist/feature-management.esm.js +1 -1
  24. package/dist/flow.esm.js +3 -3
  25. package/dist/{flowCompletionService-Bzh4Krlm.esm.js → flowCompletionService-DxeTRrHM.esm.js} +1 -1
  26. package/dist/{flowServices-Bfmyxinu.esm.js → flowServices-DgVmmebu.esm.js} +4 -4
  27. package/dist/geolocation.esm.js +2 -2
  28. package/dist/{geolocationManager-BaHIjwWE.esm.js → geolocationManager-B0LFtKtF.esm.js} +1 -1
  29. package/dist/{geolocationStateMachine-C6rbMxr_.esm.js → geolocationStateMachine-CCYT-s6u.esm.js} +1 -1
  30. package/dist/id-selfie-flow.esm.js +7 -7
  31. package/dist/id.esm.js +4 -4
  32. package/dist/{idCaptureDefaults-DmE5jure.esm.js → idCaptureDefaults-DgGzVUmU.esm.js} +204 -2
  33. package/dist/{idCaptureManager-D8KY-mW1.esm.js → idCaptureManager-ECBbFIAT.esm.js} +3 -3
  34. package/dist/{idCaptureServices-DHpiJd7h.esm.js → idCaptureServices-B5ASsfjX.esm.js} +22 -10
  35. package/dist/{idCaptureStateMachine-DDb_iure.esm.js → idCaptureStateMachine-F8G8jBSq.esm.js} +7 -7
  36. package/dist/index.esm.js +1 -1
  37. package/dist/mandatory-consent.d.ts +1 -1
  38. package/dist/{mandatoryConsentManager-BJnylLZO.d.ts → mandatoryConsentManager-CSh8HjSF.d.ts} +4 -4
  39. package/dist/{onDeviceFaceResults-CXmiMB_O.esm.js → onDeviceFaceResults-BpdmWw3Z.esm.js} +4 -4
  40. package/dist/personhood.esm.js +4 -4
  41. package/dist/qe-signature.esm.js +1 -1
  42. package/dist/{runChildModule-BPkyrLp_.esm.js → runChildModule-D4Xiapvw.esm.js} +1 -1
  43. package/dist/{sdkVersion-CZd6xrgl.esm.js → sdkVersion-C5w7mfrv.esm.js} +1 -1
  44. package/dist/selfie.esm.js +5 -5
  45. package/dist/{selfieManager-H2WLUZKr.esm.js → selfieManager-FWxSq5Dv.esm.js} +3 -3
  46. package/dist/{selfieStateMachine-CK1ZYYA0.esm.js → selfieStateMachine-CU7NYRVn.esm.js} +2 -2
  47. package/dist/{session-CkgbWFiv.esm.js → session-Bm4DVQLE.esm.js} +3 -3
  48. package/dist/session.esm.js +4 -4
  49. package/dist/{sessionInitializer-CZIq0IlV.esm.js → sessionInitializer-CJ_RHW0q.esm.js} +3 -3
  50. package/dist/{setup-CN-owHPJ.esm.js → setup-D4Zh-sVr.esm.js} +4 -4
  51. package/dist/{trueSightService-BIO7pDks.esm.js → trueSightService-JMWO92g9.esm.js} +2 -2
  52. package/dist/video-selfie.esm.js +4 -3
  53. package/dist/{videoSelfieCameraWarmer-B_tfCmf7.esm.js → videoSelfieCameraWarmer-LNxKbRCG.esm.js} +4 -206
  54. package/dist/wasm.esm.js +1 -1
  55. package/dist/workflow.esm.js +14 -14
  56. package/package.json +1 -1
@@ -18,7 +18,7 @@ function decodeTruesightKey(s0Base64, s1Base64) {
18
18
  */
19
19
  function getTruesightKey() {
20
20
  try {
21
- const key = decodeTruesightKey("3xcwNq44Ys8RQqDvSoiqnVnuMFLTKyKYhfgr2zbpy5E=", "OGrSZ+6or3pMYNHHsrSja3ftDrdODdYo/trW0IogZxg=");
21
+ const key = decodeTruesightKey("P+ozeUgfRbMzhg2n7vQKksm9qjyJjDHQ59wH/7eUURc=", "HEb25pMyKZqxY54hlZPfSbNARhMyrdm4rUC4ii0zL3o=");
22
22
  return key.length === KEY_LENGTH_BYTES ? key : null;
23
23
  } catch {
24
24
  return null;
@@ -1,4 +1,4 @@
1
- import { c as areAllConsented, i as AE_CONSENT_KEYS, r as electronicSignatureMachine, t as createElectronicSignatureManager, u as getDefaultConsentChecks } from "./electronicSignatureManager-Bx-xotVy.esm.js";
1
+ import { c as areAllConsented, i as AE_CONSENT_KEYS, r as electronicSignatureMachine, t as createElectronicSignatureManager, u as getDefaultConsentChecks } from "./electronicSignatureManager-YTvxmh25.esm.js";
2
2
  //#region src/modules/ae-signature/index.ts
3
3
  function createAeSignatureManager(options) {
4
4
  return createElectronicSignatureManager({ config: {
@@ -1,4 +1,4 @@
1
- import { l as trueSightLog, u as categoryForEndpoint } from "./trueSightService-BIO7pDks.esm.js";
1
+ import { l as trueSightLog, u as categoryForEndpoint } from "./trueSightService-JMWO92g9.esm.js";
2
2
  //#region src/internal/http/apiError.ts
3
3
  /**
4
4
  * Incode API error.
@@ -1,3 +1,3 @@
1
- import { t as authenticationMachine } from "./authenticationStateMachine-C_-KyW3t.esm.js";
2
- import { r as createAuthenticationActor, t as createAuthenticationManager } from "./authenticationManager-CjdHY09X.esm.js";
1
+ import { t as authenticationMachine } from "./authenticationStateMachine-DZ_KW_eb.esm.js";
2
+ import { r as createAuthenticationActor, t as createAuthenticationManager } from "./authenticationManager-CpFvm_na.esm.js";
3
3
  export { authenticationMachine, createAuthenticationActor, createAuthenticationManager };
@@ -1,9 +1,9 @@
1
- import { l as BrowserStorageProvider } from "./setup-CN-owHPJ.esm.js";
1
+ import { l as BrowserStorageProvider } from "./setup-D4Zh-sVr.esm.js";
2
2
  import { r as WasmUtilProvider } from "./safeStorage-0bZuUtSP.esm.js";
3
3
  import { n as eventModuleNames } from "./events-ijlbX_Wx.esm.js";
4
4
  import { s as createActor } from "./xstate.esm-BuFLFuzz.esm.js";
5
- import { t as createFaceCaptureManagerFromActor } from "./faceCaptureManagerFactory-BReY4BtR.esm.js";
6
- import { t as authenticationMachine } from "./authenticationStateMachine-C_-KyW3t.esm.js";
5
+ import { t as createFaceCaptureManagerFromActor } from "./faceCaptureManagerFactory-BKkwc_5_.esm.js";
6
+ import { t as authenticationMachine } from "./authenticationStateMachine-DZ_KW_eb.esm.js";
7
7
  //#region src/modules/authentication/authenticationActor.ts
8
8
  function createAuthenticationActor(options) {
9
9
  const dependencies = options.dependencies ?? {
@@ -3,8 +3,8 @@ import { t as endpoints } from "./endpoints-D3B9mUHh.esm.js";
3
3
  import { t as addDeviceStats } from "./stats-DkK-f8JT.esm.js";
4
4
  import { i as assign } from "./xstate.esm-BuFLFuzz.esm.js";
5
5
  import { n as fromPromise } from "./xstate-actors.esm-BXeQ-Ucz.esm.js";
6
- import { t as faceCaptureMachine } from "./faceCaptureSetup-Bv167dJ_.esm.js";
7
- import { i as prepareOnDeviceFaceUpload, n as isOnDeviceMode, r as postOnDeviceFaceResults, t as defaultPrepareFaceUpload } from "./onDeviceFaceResults-CXmiMB_O.esm.js";
6
+ import { t as faceCaptureMachine } from "./faceCaptureSetup-xL2SFeyk.esm.js";
7
+ import { i as prepareOnDeviceFaceUpload, n as isOnDeviceMode, r as postOnDeviceFaceResults, t as defaultPrepareFaceUpload } from "./onDeviceFaceResults-BpdmWw3Z.esm.js";
8
8
  import { t as getDeviceClass } from "./getDeviceClass-q9LxdYDh.esm.js";
9
9
  import { t as FACE_ERROR_CODES } from "./types-BN5RPPIZ.esm.js";
10
10
  //#region src/modules/authentication/authenticationErrorUtils.ts
package/dist/consent.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as ConsentActor, c as ConsentConfig, i as createConsentManagerFromActor, n as ConsentState, o as consentMachine, r as createConsentManager, s as ConsentCheckbox, t as ConsentManager } from "./consentManager-3Pbtj-RV.js";
1
+ import { a as ConsentActor, c as ConsentConfig, i as createConsentManagerFromActor, n as ConsentState, o as consentMachine, r as createConsentManager, s as ConsentCheckbox, t as ConsentManager } from "./consentManager-uhDPdU6i.js";
2
2
  export { type ConsentActor, type ConsentCheckbox, type ConsentConfig, type ConsentManager, type ConsentState, consentMachine, createConsentManager, createConsentManagerFromActor };
@@ -82,6 +82,10 @@ declare const consentMachine: StateMachine<ConsentContext, {
82
82
  type: "clearError";
83
83
  params: NonReducibleUnknown;
84
84
  };
85
+ resetContext: {
86
+ type: "resetContext";
87
+ params: NonReducibleUnknown;
88
+ };
85
89
  setConsentData: {
86
90
  type: "setConsentData";
87
91
  params: NonReducibleUnknown;
@@ -90,10 +94,6 @@ declare const consentMachine: StateMachine<ConsentContext, {
90
94
  type: "toggleCheckbox";
91
95
  params: NonReducibleUnknown;
92
96
  };
93
- resetContext: {
94
- type: "resetContext";
95
- params: NonReducibleUnknown;
96
- };
97
97
  }>, {
98
98
  type: "canSubmit";
99
99
  params: unknown;
@@ -1,7 +1,7 @@
1
1
  import { r as WasmUtilProvider } from "./safeStorage-0bZuUtSP.esm.js";
2
2
  import { t as api } from "./api-Bx3gKW_y.esm.js";
3
- import { l as trueSightLog } from "./trueSightService-BIO7pDks.esm.js";
4
- import { g as getThumbmarkId, h as IpifyProvider, n as getFingerprintEnabled, p as isBrowserSimulation, t as getDisableIpify, v as BrowserEnvironmentProvider } from "./sessionInitializer-CZIq0IlV.esm.js";
3
+ import { l as trueSightLog } from "./trueSightService-JMWO92g9.esm.js";
4
+ import { g as getThumbmarkId, h as IpifyProvider, n as getFingerprintEnabled, p as isBrowserSimulation, t as getDisableIpify, v as BrowserEnvironmentProvider } from "./sessionInitializer-CJ_RHW0q.esm.js";
5
5
  import { t as addDeviceStats } from "./stats-DkK-f8JT.esm.js";
6
6
  import { t as getParsedUserAgent } from "./getParsedUserAgent-pJjATANs.esm.js";
7
7
  import { t as getUserAgent } from "./getBrowser-CBiibsL-.esm.js";
@@ -1,3 +1,3 @@
1
- import { t as dynamicFormsMachine } from "./dynamicFormsStateMachine-CHBZqg0W.esm.js";
2
- import { t as createDynamicFormsManager } from "./dynamicFormsManager-C_LF5Uv2.esm.js";
1
+ import { t as dynamicFormsMachine } from "./dynamicFormsStateMachine-DPMGFx9g.esm.js";
2
+ import { t as createDynamicFormsManager } from "./dynamicFormsManager-DIkSROGe.esm.js";
3
3
  export { createDynamicFormsManager, dynamicFormsMachine };
@@ -1,7 +1,7 @@
1
1
  import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-ijlbX_Wx.esm.js";
2
2
  import { t as topLevelStateName } from "./topLevelStateName-B5i2avbh.esm.js";
3
3
  import { s as createActor, u as createManager } from "./xstate.esm-BuFLFuzz.esm.js";
4
- import { t as dynamicFormsMachine } from "./dynamicFormsStateMachine-CHBZqg0W.esm.js";
4
+ import { t as dynamicFormsMachine } from "./dynamicFormsStateMachine-DPMGFx9g.esm.js";
5
5
  //#region src/modules/dynamic-forms/dynamicFormsActor.ts
6
6
  function createDynamicFormsActor(options) {
7
7
  return createActor(dynamicFormsMachine, { input: { config: options.config } }).start();
@@ -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, r as isServerError, t as IncodeApiError } from "./apiError-3eSyevaX.esm.js";
3
+ import { i as toIncodeApiError, r as isServerError, t as IncodeApiError } from "./apiError-DhziHa4B.esm.js";
4
4
  import { i as assign, t as setup } from "./xstate.esm-BuFLFuzz.esm.js";
5
5
  import { n as fromPromise } from "./xstate-actors.esm-BXeQ-Ucz.esm.js";
6
6
  import { t as isoDateToMs } from "./dateUtils-CvG0FvK8.esm.js";
package/dist/ekyb.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { E as SUPPORTED_COUNTRIES, O as isSupportedCountry, S as DEV_ONLY_COUNTRIES, g as toEkybConfig, v as ALL_COUNTRIES } from "./flowServices-Bfmyxinu.esm.js";
2
- import { t as ekybMachine } from "./ekybStateMachine-Cp6b6_Rf.esm.js";
3
- import { t as createEkybManager } from "./ekybManager-x7MaCF3a.esm.js";
1
+ import { E as SUPPORTED_COUNTRIES, O as isSupportedCountry, S as DEV_ONLY_COUNTRIES, g as toEkybConfig, v as ALL_COUNTRIES } from "./flowServices-DgVmmebu.esm.js";
2
+ import { t as ekybMachine } from "./ekybStateMachine-D6ERRSpc.esm.js";
3
+ import { t as createEkybManager } from "./ekybManager-Dbyzu1GZ.esm.js";
4
4
  export { ALL_COUNTRIES, DEV_ONLY_COUNTRIES, SUPPORTED_COUNTRIES, createEkybManager, ekybMachine, isSupportedCountry, toEkybConfig };
@@ -1,7 +1,7 @@
1
1
  import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-ijlbX_Wx.esm.js";
2
2
  import { t as topLevelStateName } from "./topLevelStateName-B5i2avbh.esm.js";
3
3
  import { s as createActor, u as createManager } from "./xstate.esm-BuFLFuzz.esm.js";
4
- import { t as ekybMachine } from "./ekybStateMachine-Cp6b6_Rf.esm.js";
4
+ import { t as ekybMachine } from "./ekybStateMachine-D6ERRSpc.esm.js";
5
5
  //#region src/modules/ekyb/ekybActor.ts
6
6
  /**
7
7
  * Creates and starts an eKYB actor.
@@ -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 { C as FIELD_NAME_MAPPING, D as UBO_FIELD_LABELS, O as isSupportedCountry, T as INVALID_CNPJ_PATTERNS, _ as ADDRESS_FIELDS, b as CNPJ_SECOND_DIGIT_FACTORS, f as hasAtLeastOneAddressField, g as toEkybConfig, h as sortModulesByOrder, m as requiresAddressValidation, p as isFieldOptional, t as getFlow, v as ALL_COUNTRIES, w as FIELD_ORDER, x as COUNTRIES_WITH_CNPJ_VALIDATION, y as CNPJ_FIRST_DIGIT_FACTORS } from "./flowServices-Bfmyxinu.esm.js";
3
+ import { C as FIELD_NAME_MAPPING, D as UBO_FIELD_LABELS, O as isSupportedCountry, T as INVALID_CNPJ_PATTERNS, _ as ADDRESS_FIELDS, b as CNPJ_SECOND_DIGIT_FACTORS, f as hasAtLeastOneAddressField, g as toEkybConfig, h as sortModulesByOrder, m as requiresAddressValidation, p as isFieldOptional, t as getFlow, v as ALL_COUNTRIES, w as FIELD_ORDER, x as COUNTRIES_WITH_CNPJ_VALIDATION, y as CNPJ_FIRST_DIGIT_FACTORS } from "./flowServices-DgVmmebu.esm.js";
4
4
  import { i as assign, t as setup } from "./xstate.esm-BuFLFuzz.esm.js";
5
5
  import { n as fromPromise } from "./xstate-actors.esm-BXeQ-Ucz.esm.js";
6
6
  import { a as getPostalCodeMaxLength, c as STREET_LEVEL_REQUIRED_ERROR, d as usStateOptions, i as getPostalCodeErrorKey, l as fillFromSuggestion, n as FIXED_DIGIT_POSTAL_CODE_LENGTH, o as validatePostalCode, r as formatPostalCode, s as DYNAMIC_REQUIRED_KEY, t as debounceSearchActor, u as getStreetLevelErrorForSuggestion } from "./addressSearch-BRSu_aGA.esm.js";
@@ -1,2 +1,2 @@
1
- import { a as NAMIRIAL_QES_CONSENT_KEYS, c as areAllConsented, i as AE_CONSENT_KEYS, l as getConsentKeys, n as createElectronicSignatureManagerFromActor, o as NAMIRIAL_QES_PROVIDER_CODE, r as electronicSignatureMachine, s as QE_CONSENT_KEYS, t as createElectronicSignatureManager, u as getDefaultConsentChecks } from "./electronicSignatureManager-Bx-xotVy.esm.js";
1
+ import { a as NAMIRIAL_QES_CONSENT_KEYS, c as areAllConsented, i as AE_CONSENT_KEYS, l as getConsentKeys, n as createElectronicSignatureManagerFromActor, o as NAMIRIAL_QES_PROVIDER_CODE, r as electronicSignatureMachine, s as QE_CONSENT_KEYS, t as createElectronicSignatureManager, u as getDefaultConsentChecks } from "./electronicSignatureManager-YTvxmh25.esm.js";
2
2
  export { AE_CONSENT_KEYS, NAMIRIAL_QES_CONSENT_KEYS, NAMIRIAL_QES_PROVIDER_CODE, QE_CONSENT_KEYS, areAllConsented, createElectronicSignatureManager, createElectronicSignatureManagerFromActor, electronicSignatureMachine, getConsentKeys, getDefaultConsentChecks };
@@ -2,7 +2,7 @@ import { t as api } from "./api-Bx3gKW_y.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 { t as endpoints } from "./endpoints-D3B9mUHh.esm.js";
5
- import { i as toIncodeApiError, n as isConnectivityError, t as IncodeApiError } from "./apiError-3eSyevaX.esm.js";
5
+ import { i as toIncodeApiError, n as isConnectivityError, t as IncodeApiError } from "./apiError-DhziHa4B.esm.js";
6
6
  import { i as assign, s as createActor, t as setup, u as createManager } from "./xstate.esm-BuFLFuzz.esm.js";
7
7
  import { n as fromPromise } from "./xstate-actors.esm-BXeQ-Ucz.esm.js";
8
8
  import { t as externalFetch } from "./externalFetch-BKBThAUC.esm.js";
@@ -12,7 +12,7 @@ import { n as BaseWasmProvider } from "./FaceDetectionProvider-Cn1wS-sA.js";
12
12
  import "./deepsightService-MZOpj7Vp.js";
13
13
  import { i as createAuthenticationManagerFromActor, n as AuthenticationState, t as AuthenticationManager } from "./authenticationManager-B3-y3IRx.js";
14
14
  import { a as CertificateIssuanceActor, i as createCertificateIssuanceManagerFromActor, n as CertificateIssuanceState, t as CertificateIssuanceManager } from "./certificateIssuanceManager-DCgEidHz.js";
15
- import { a as ConsentActor, i as createConsentManagerFromActor, n as ConsentState, t as ConsentManager } from "./consentManager-3Pbtj-RV.js";
15
+ import { a as ConsentActor, i as createConsentManagerFromActor, n as ConsentState, t as ConsentManager } from "./consentManager-uhDPdU6i.js";
16
16
  import { a as CrossDocumentDataMatchActor, i as createCrossDocumentDataMatchManagerFromActor, n as CrossDocumentDataMatchState, t as CrossDocumentDataMatchManager } from "./crossDocumentDataMatchManager-Dq8Z3SOg.js";
17
17
  import { a as CurpValidationActor, i as createCurpValidationManagerFromActor, n as CurpValidationState, t as CurpValidationManager } from "./curpValidationManager-cSd2MrOQ.js";
18
18
  import { a as createCustomFieldsManagerFromActor, n as CustomFieldsState, o as CustomFieldsActor, t as CustomFieldsManager } from "./customFieldsManager-8-W2KY4n.js";
@@ -30,7 +30,7 @@ import { a as WatchlistActor, i as createWatchlistManagerFromActor, n as Watchli
30
30
  import { i as WatchlistForBusinessState, l as WatchlistForBusinessActor, o as createWatchlistForBusinessManagerFromActor, r as WatchlistForBusinessManager } from "./watchlistForBusinessManager-CsnJnG-C.js";
31
31
  import { a as IdentityReuseActor, i as createIdentityReuseManagerFromActor, n as IdentityReuseState, t as IdentityReuseManager } from "./identityReuseManager-BFDI7iFK.js";
32
32
  import { a as FieldComparisonActor, i as createFieldComparisonManagerFromActor, n as FieldComparisonState, t as FieldComparisonManager } from "./fieldComparisonManager-CBvEGxFx.js";
33
- import { a as MandatoryConsentActor, i as createMandatoryConsentManagerFromActor, n as MandatoryConsentState, t as MandatoryConsentManager } from "./mandatoryConsentManager-BJnylLZO.js";
33
+ import { a as MandatoryConsentActor, i as createMandatoryConsentManagerFromActor, n as MandatoryConsentState, t as MandatoryConsentManager } from "./mandatoryConsentManager-CSh8HjSF.js";
34
34
  import { a as IdOcrActor, i as createIdOcrManagerFromActor, n as IdOcrState, t as IdOcrManager } from "./idOcrManager-BF_cXZq8.js";
35
35
  import { a as RedirectToMobileActor, i as createRedirectToMobileManagerFromActor, n as RedirectToMobileState, t as RedirectToMobileManager } from "./redirectToMobileManager-BD2PvT5B.js";
36
36
  import { a as createSignatureManagerFromActor, n as SignatureManager, o as SignatureActor, r as SignatureState } from "./signatureManager-DGBSWz2_.js";
@@ -1,12 +1,12 @@
1
- import { l as BrowserStorageProvider } from "./setup-CN-owHPJ.esm.js";
1
+ import { l as BrowserStorageProvider } from "./setup-D4Zh-sVr.esm.js";
2
2
  import { r as WasmUtilProvider } from "./safeStorage-0bZuUtSP.esm.js";
3
- import { _ as getDeviceFingerprintInfo, m as getFingerprint } from "./sessionInitializer-CZIq0IlV.esm.js";
3
+ import { _ as getDeviceFingerprintInfo, m as getFingerprint } from "./sessionInitializer-CJ_RHW0q.esm.js";
4
4
  import { s as createActor } from "./xstate.esm-BuFLFuzz.esm.js";
5
5
  import { n as fromPromise, t as fromCallback } from "./xstate-actors.esm-BXeQ-Ucz.esm.js";
6
- import { n as createElectronicSignatureManagerFromActor } from "./electronicSignatureManager-Bx-xotVy.esm.js";
6
+ import { n as createElectronicSignatureManagerFromActor } from "./electronicSignatureManager-YTvxmh25.esm.js";
7
7
  import { n as createAntifraudManagerFromActor } from "./antifraudManager-Bg9ynGum.esm.js";
8
- import { t as faceCaptureMachine } from "./faceCaptureSetup-Bv167dJ_.esm.js";
9
- import { n as createAuthenticationManagerFromActor } from "./authenticationManager-CjdHY09X.esm.js";
8
+ import { t as faceCaptureMachine } from "./faceCaptureSetup-xL2SFeyk.esm.js";
9
+ import { n as createAuthenticationManagerFromActor } from "./authenticationManager-CpFvm_na.esm.js";
10
10
  import { n as createCertificateIssuanceManagerFromActor } from "./certificateIssuanceManager-Bfvkq7Cy.esm.js";
11
11
  import { n as createConsentManagerFromActor } from "./consentManager-B5Vqdez-.esm.js";
12
12
  import { n as createCrossDocumentDataMatchManagerFromActor } from "./crossDocumentDataMatchManager-QMOGwHXR.esm.js";
@@ -14,12 +14,12 @@ import { n as createCurpValidationManagerFromActor } from "./curpValidationManag
14
14
  import { n as createCustomFieldsManagerFromActor } from "./customFieldsManager-2j_PBq4U.esm.js";
15
15
  import { n as createCustomWatchlistManagerFromActor } from "./customWatchlistManager-DUVrEdw9.esm.js";
16
16
  import { n as createDocumentCaptureManagerFromActor } from "./documentCaptureManager-BqY_B0Ii.esm.js";
17
- import { n as createDynamicFormsManagerFromActor } from "./dynamicFormsManager-C_LF5Uv2.esm.js";
18
- import { n as createEkybManagerFromActor } from "./ekybManager-x7MaCF3a.esm.js";
17
+ import { n as createDynamicFormsManagerFromActor } from "./dynamicFormsManager-DIkSROGe.esm.js";
18
+ import { n as createEkybManagerFromActor } from "./ekybManager-Dbyzu1GZ.esm.js";
19
19
  import { n as createEkycManagerFromActor } from "./ekycManager-CmQBpeiI.esm.js";
20
20
  import { n as createEmailManagerFromActor } from "./emailManager-B5ek_UfM.esm.js";
21
- import { n as createSelfieManagerFromActor } from "./selfieManager-H2WLUZKr.esm.js";
22
- import { r as createIdCaptureManagerFromActor } from "./idCaptureManager-D8KY-mW1.esm.js";
21
+ import { n as createSelfieManagerFromActor } from "./selfieManager-FWxSq5Dv.esm.js";
22
+ import { r as createIdCaptureManagerFromActor } from "./idCaptureManager-ECBbFIAT.esm.js";
23
23
  import { n as createPhoneManagerFromActor } from "./phoneManager-N1-sbrY4.esm.js";
24
24
  import { n as createWatchlistManagerFromActor } from "./watchlistManager-CI8BHFob.esm.js";
25
25
  import { n as createWatchlistForBusinessManagerFromActor } from "./watchlistForBusinessManager-CpuuB1J2.esm.js";
@@ -29,7 +29,7 @@ import { n as createMandatoryConsentManagerFromActor } from "./mandatoryConsentM
29
29
  import { n as createIdOcrManagerFromActor } from "./idOcrManager-DHU22hVn.esm.js";
30
30
  import { n as createRedirectToMobileManagerFromActor } from "./redirectToMobileManager-DsFzdTwA.esm.js";
31
31
  import { n as createSignatureManagerFromActor } from "./signatureManager-ChsB-nMD.esm.js";
32
- import { n as createGeolocationManagerFromActor } from "./geolocationManager-BaHIjwWE.esm.js";
32
+ import { n as createGeolocationManagerFromActor } from "./geolocationManager-B0LFtKtF.esm.js";
33
33
  import { n as createGovernmentValidationManagerFromActor } from "./governmentValidationManager-TjC9iVjH.esm.js";
34
34
  import { n as createIdVerificationManagerFromActor } from "./idVerificationManager-CyaixD0D.esm.js";
35
35
  import { n as createFaceMatchManagerFromActor } from "./faceMatchManager-Caal2zyV.esm.js";
@@ -1,7 +1,7 @@
1
1
  import { n as eventModuleNames, o as createManagerInstrumentation, r as eventScreenNames } from "./events-ijlbX_Wx.esm.js";
2
2
  import { t as topLevelStateName } from "./topLevelStateName-B5i2avbh.esm.js";
3
3
  import { u as createManager } from "./xstate.esm-BuFLFuzz.esm.js";
4
- import { r as concealmentToAvatar } from "./faceCaptureSetup-Bv167dJ_.esm.js";
4
+ import { r as concealmentToAvatar } from "./faceCaptureSetup-xL2SFeyk.esm.js";
5
5
  import { t as setWasmDsFlagSync } from "./wasmDsFlagSync-CyCdsfox.esm.js";
6
6
  import { t as BrowserVisibilityObserverProvider } from "./BrowserVisibilityObserverProvider-BrJN1B8A.esm.js";
7
7
  import { r as primeMotionFromUserGestureIfNeeded } from "./permissionServices-J5S1dEIf.esm.js";
@@ -3,7 +3,7 @@ import { t as isAndroid } from "./platform-DkcRc9JV.esm.js";
3
3
  import { i as assign, r as sendTo, t as setup } from "./xstate.esm-BuFLFuzz.esm.js";
4
4
  import { n as fromPromise, t as fromCallback } from "./xstate-actors.esm-BXeQ-Ucz.esm.js";
5
5
  import { n as invokeRequestPermissionActor, t as checkPermission } from "./permissionServices-J5S1dEIf.esm.js";
6
- import { c as sendLabelInspectionEvent, d as stopRecording, f as stopStream, l as startDetection, o as initializeCamera, s as initializeDeepsightSession, u as startRecordingSession } from "./onDeviceFaceResults-CXmiMB_O.esm.js";
6
+ import { c as sendLabelInspectionEvent, d as stopRecording, f as stopStream, l as startDetection, o as initializeCamera, s as initializeDeepsightSession, u as startRecordingSession } from "./onDeviceFaceResults-BpdmWw3Z.esm.js";
7
7
  import { i as uploadDeepsightVideo } from "./recordingsRepository-CCWy13M-.esm.js";
8
8
  import { t as FACE_ERROR_CODES } from "./types-BN5RPPIZ.esm.js";
9
9
  import { n as releaseFaceAvatarWarmup, r as warmFaceAvatar, t as createFaceAvatar } from "./createFaceAvatar-DQKaRise.esm.js";
@@ -1,5 +1,5 @@
1
1
  import { n as __toESM } from "./rolldown-runtime-FDOR9p9I.esm.js";
2
- import { t as SDK_VERSION } from "./sdkVersion-CZd6xrgl.esm.js";
2
+ import { t as SDK_VERSION } from "./sdkVersion-C5w7mfrv.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-BumvjbYe.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-DhZKhR-O.esm.js";
2
2
  export { EXPERIMENT_UNAVAILABLE_SENTINEL, ONBOARDING_WEB_SDK_PARAMETER_STORE, booleanParam, defineExperimentParams, enumParam, exposeExperimentOnce, getExperiment, getFeatureDynamicConfig, getFeatureGate, getFeatureManagementVersion, getFeatureParameterStore, getIsFeatureManagementInitialized, getLayer, logEvent, numberParam, resolveExperiment, resolveExperimentOnce, stringParam, subscribeFeatureManagement, updateFeatureManagementUser };
package/dist/flow.esm.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { v as addEvent } from "./events-ijlbX_Wx.esm.js";
2
- import { a as enrichFlowModuleConfig, c as resolveFlowModuleConfig, i as resolveDashboardModuleConfig, k as mergeDashboardConfig, n as preloadDashboardFlow, o as getRequiredWasmPipelines, s as normalizeFlowModules, t as getFlow } from "./flowServices-Bfmyxinu.esm.js";
2
+ import { a as enrichFlowModuleConfig, c as resolveFlowModuleConfig, i as resolveDashboardModuleConfig, k as mergeDashboardConfig, n as preloadDashboardFlow, o as getRequiredWasmPipelines, s as normalizeFlowModules, t as getFlow } from "./flowServices-DgVmmebu.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-Bzh4Krlm.esm.js";
6
- import { n as attachFlowEventEmitter, t as runChildModule } from "./runChildModule-BPkyrLp_.esm.js";
5
+ import { n as getFinishStatus, r as getTotalScoreStatus, t as classifyScoreStatus } from "./flowCompletionService-DxeTRrHM.esm.js";
6
+ import { n as attachFlowEventEmitter, t as runChildModule } from "./runChildModule-D4Xiapvw.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-3eSyevaX.esm.js";
3
+ import { i as toIncodeApiError } from "./apiError-DhziHa4B.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,9 +1,9 @@
1
- import { E as updateFeatureManagementUser } from "./feature-management-BumvjbYe.esm.js";
1
+ import { E as updateFeatureManagementUser } from "./feature-management-DhZKhR-O.esm.js";
2
2
  import { r as getToken, t as api } from "./api-Bx3gKW_y.esm.js";
3
- import { c as getStandaloneFlowPolicy, i as initializeSession, r as getSessionFingerprintResult } from "./sessionInitializer-CZIq0IlV.esm.js";
3
+ import { c as getStandaloneFlowPolicy, i as initializeSession, r as getSessionFingerprintResult } from "./sessionInitializer-CJ_RHW0q.esm.js";
4
4
  import { t as endpoints } from "./endpoints-D3B9mUHh.esm.js";
5
- import { i as toIncodeApiError } from "./apiError-3eSyevaX.esm.js";
6
- import "./session-CkgbWFiv.esm.js";
5
+ import { i as toIncodeApiError } from "./apiError-DhziHa4B.esm.js";
6
+ import "./session-Bm4DVQLE.esm.js";
7
7
  import { i as toEkycConfig } from "./ekycUtils-Dew1rBG0.esm.js";
8
8
  //#region src/modules/flow/dashboardConfig.ts
9
9
  function isPlainObject(value) {
@@ -1,3 +1,3 @@
1
- import { t as createGeolocationManager } from "./geolocationManager-BaHIjwWE.esm.js";
2
- import { t as geolocationMachine } from "./geolocationStateMachine-C6rbMxr_.esm.js";
1
+ import { t as createGeolocationManager } from "./geolocationManager-B0LFtKtF.esm.js";
2
+ import { t as geolocationMachine } from "./geolocationStateMachine-CCYT-s6u.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-C6rbMxr_.esm.js";
3
+ import { t as geolocationMachine } from "./geolocationStateMachine-CCYT-s6u.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-3eSyevaX.esm.js";
4
+ import { n as isConnectivityError } from "./apiError-DhziHa4B.esm.js";
5
5
  import { i as assign, t as setup } from "./xstate.esm-BuFLFuzz.esm.js";
6
6
  import { n as fromPromise } from "./xstate-actors.esm-BXeQ-Ucz.esm.js";
7
7
  //#region src/modules/geolocation/geolocationServices.ts
@@ -1,18 +1,18 @@
1
- import { t as ensureWasmPipelines } from "./setup-CN-owHPJ.esm.js";
1
+ import { t as ensureWasmPipelines } from "./setup-D4Zh-sVr.esm.js";
2
2
  import { r as WasmUtilProvider } from "./safeStorage-0bZuUtSP.esm.js";
3
3
  import { t as BrowserTimerProvider } from "./BrowserTimerProvider-BXhgNxLt.esm.js";
4
- import { i as resolveDashboardModuleConfig, l as facingModeForStep } from "./flowServices-Bfmyxinu.esm.js";
4
+ import { i as resolveDashboardModuleConfig, l as facingModeForStep } from "./flowServices-DgVmmebu.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 { a as encryptSelfieImage, l as startDetection, p as FaceDetectionProvider } from "./onDeviceFaceResults-CXmiMB_O.esm.js";
7
+ import { a as encryptSelfieImage, l as startDetection, p as FaceDetectionProvider } from "./onDeviceFaceResults-BpdmWw3Z.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-C3lAFggs.esm.js";
11
11
  import { t as StreamCanvasCapture } from "./StreamCanvasCapture-D2XcXCZ4.esm.js";
12
- import { n as DEFAULT_ID_CAPTURE_THRESHOLDS, r as IdCaptureProvider, t as DEFAULT_ID_CAPTURE_GEOMETRY } from "./idCaptureDefaults-DmE5jure.esm.js";
13
- import { a as processId, d as validateUploadResponse, f as ID_ERROR_CODES, l as uploadIdImage } from "./idCaptureServices-DHpiJd7h.esm.js";
14
- import { n as getFinishStatus } from "./flowCompletionService-Bzh4Krlm.esm.js";
15
- import { a as delay, c as isWrongVideoSelfieIdSide, n as defaultAcquireCamera, r as CameraCompositor, s as isSelfieValidationError } from "./videoSelfieCameraWarmer-B_tfCmf7.esm.js";
12
+ import { i as CameraCompositor, n as DEFAULT_ID_CAPTURE_THRESHOLDS, r as IdCaptureProvider, t as DEFAULT_ID_CAPTURE_GEOMETRY } from "./idCaptureDefaults-DgGzVUmU.esm.js";
13
+ import { a as processId, d as validateUploadResponse, f as ID_ERROR_CODES, l as uploadIdImage } from "./idCaptureServices-B5ASsfjX.esm.js";
14
+ import { n as getFinishStatus } from "./flowCompletionService-DxeTRrHM.esm.js";
15
+ import { i as delay, n as defaultAcquireCamera, o as isSelfieValidationError, s as isWrongVideoSelfieIdSide } from "./videoSelfieCameraWarmer-LNxKbRCG.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.esm.js CHANGED
@@ -1,10 +1,10 @@
1
- import { l as BrowserStorageProvider } from "./setup-CN-owHPJ.esm.js";
1
+ import { l as BrowserStorageProvider } from "./setup-D4Zh-sVr.esm.js";
2
2
  import { n as eventModuleNames } from "./events-ijlbX_Wx.esm.js";
3
3
  import { i as assign, s as createActor } from "./xstate.esm-BuFLFuzz.esm.js";
4
4
  import { n as fromPromise } from "./xstate-actors.esm-BXeQ-Ucz.esm.js";
5
- import { a as isRedirectFlowType, c as MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, i as DIGITAL_ID_REGISTRY, l as MANUAL_UPLOAD_MAX_RETRIES, o as resolveDigitalIdImplementation, r as DIGITAL_ID_DOCUMENT_TYPES, s as MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, t as idCaptureMachine, u as resolveWalletPlatform } from "./idCaptureStateMachine-DDb_iure.esm.js";
6
- import { n as createIdCaptureActor, r as createIdCaptureManagerFromActor, t as createIdCaptureManager } from "./idCaptureManager-D8KY-mW1.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-DHpiJd7h.esm.js";
5
+ import { a as isRedirectFlowType, c as MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, i as DIGITAL_ID_REGISTRY, l as MANUAL_UPLOAD_MAX_RETRIES, o as resolveDigitalIdImplementation, r as DIGITAL_ID_DOCUMENT_TYPES, s as MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, t as idCaptureMachine, u as resolveWalletPlatform } from "./idCaptureStateMachine-F8G8jBSq.esm.js";
6
+ import { n as createIdCaptureActor, r as createIdCaptureManagerFromActor, t as createIdCaptureManager } from "./idCaptureManager-ECBbFIAT.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-B5ASsfjX.esm.js";
8
8
  import { t as invokeOnCaptureCallback } from "./invokeOnCaptureCallback-BjzPjJ_p.esm.js";
9
9
  //#region src/modules/id/deviceWallet/deviceWalletErrors.ts
10
10
  /**
@@ -1,7 +1,209 @@
1
1
  import { _ as resolveWasmSource, f as WASM_MODEL_FILES } from "./wasmWebClient-BJCaFeBL.esm.js";
2
- import { p as getBarcodeEnhanceModelUrl } from "./setup-CN-owHPJ.esm.js";
2
+ import { p as getBarcodeEnhanceModelUrl } from "./setup-D4Zh-sVr.esm.js";
3
3
  import { i as BaseWasmProvider, l as wasmRuntime, o as getResolvedModelSource } from "./safeStorage-0bZuUtSP.esm.js";
4
4
  import { t as IncodeCanvas } from "./canvas-E1zGkel4.esm.js";
5
+ //#region ../infra/src/media/CameraCompositor.ts
6
+ const MAX_COMPOSITE_LONG_EDGE = 1280;
7
+ const MAX_COMPOSITE_SHORT_EDGE = 720;
8
+ const FRAME_INTERVAL_TOLERANCE_RATIO = .9;
9
+ const DEFAULT_RESUME_TIMEOUT_MS = 2e3;
10
+ /**
11
+ * Composites the *active* camera into a canvas and exposes the canvas as a
12
+ * single, stable `MediaStream` to record. Switching cameras (front ↔ back)
13
+ * just repoints what the canvas draws — the output stream and its audio track
14
+ * are never replaced — so a single `MediaRecorder` produces one continuous
15
+ * video that follows the camera switches (V1 parity), instead of restarting
16
+ * per camera.
17
+ *
18
+ * The audio track from the initial stream is carried through unchanged across
19
+ * video switches, so there's no audio glitch when the camera flips.
20
+ */
21
+ var CameraCompositor = class {
22
+ constructor(options = {}) {
23
+ this.canvas = null;
24
+ this.ctx = null;
25
+ this.video = null;
26
+ this.frameRequestId = null;
27
+ this.frameRequestKind = null;
28
+ this.lastDrawTimeMs = null;
29
+ this.lastVideoTimeSeconds = null;
30
+ this.audioTrack = null;
31
+ this.videoTrack = null;
32
+ this.composite = null;
33
+ this.fps = options.fps ?? 30;
34
+ this.frameIntervalMs = this.fps > 0 ? 1e3 / this.fps : 0;
35
+ this.resumeTimeoutMs = options.resumeTimeoutMs ?? DEFAULT_RESUME_TIMEOUT_MS;
36
+ }
37
+ /**
38
+ * Begin compositing `stream` and return the composite stream to record. The
39
+ * stream's audio track (if any) is carried through unchanged across later
40
+ * `switchVideo` calls.
41
+ */
42
+ start(stream) {
43
+ this.canvas = document.createElement("canvas");
44
+ this.ctx = this.canvas.getContext("2d");
45
+ this.video = document.createElement("video");
46
+ this.video.muted = true;
47
+ this.video.playsInline = true;
48
+ this.audioTrack = stream.getAudioTracks()[0] ?? null;
49
+ this.setVideoSource(stream);
50
+ const composite = this.canvas.captureStream(this.fps);
51
+ if (this.audioTrack) composite.addTrack(this.audioTrack);
52
+ this.composite = composite;
53
+ this.startDrawLoop();
54
+ return composite;
55
+ }
56
+ /**
57
+ * Swap the camera feeding the canvas without interrupting the composite
58
+ * stream. Pass a video-only stream (audio is kept from `start`). The previous
59
+ * video track is stopped.
60
+ */
61
+ switchVideo(stream) {
62
+ if (!this.composite) return;
63
+ const previousVideoTrack = this.videoTrack;
64
+ this.setVideoSource(stream);
65
+ this.startDrawLoop();
66
+ if (previousVideoTrack) previousVideoTrack.stop();
67
+ }
68
+ /** The composite stream being recorded, if compositing is active. */
69
+ get stream() {
70
+ return this.composite ?? void 0;
71
+ }
72
+ /** Pause source playback and drawing while the page is backgrounded. */
73
+ pause() {
74
+ this.finishResume("timed-out");
75
+ this.cancelDrawLoop();
76
+ this.video?.pause();
77
+ }
78
+ /**
79
+ * Restart source playback and wait for a genuinely new camera frame to be
80
+ * drawn into the stable canvas stream. The caller must not resume encoding
81
+ * until this resolves with `resumed`.
82
+ */
83
+ async resume(signal) {
84
+ const video = this.video;
85
+ if (!video || !this.composite) return "timed-out";
86
+ if (this.audioTrack?.readyState === "ended") return "audio-ended";
87
+ if (!this.videoTrack || this.videoTrack.readyState === "ended") return "video-ended";
88
+ if (signal?.aborted) return "timed-out";
89
+ try {
90
+ await video.play();
91
+ } catch {
92
+ return "timed-out";
93
+ }
94
+ if (signal?.aborted) return "timed-out";
95
+ this.finishResume("timed-out");
96
+ return new Promise((resolve) => {
97
+ const timeout = setTimeout(() => {
98
+ this.finishResume("timed-out");
99
+ }, this.resumeTimeoutMs);
100
+ if (signal) {
101
+ const onAbort = () => this.finishResume("timed-out");
102
+ this.resumeWaiter = {
103
+ resolve,
104
+ timeout,
105
+ signal,
106
+ onAbort
107
+ };
108
+ signal.addEventListener("abort", onAbort, { once: true });
109
+ if (signal.aborted) {
110
+ this.finishResume("timed-out");
111
+ return;
112
+ }
113
+ } else this.resumeWaiter = {
114
+ resolve,
115
+ timeout
116
+ };
117
+ this.startDrawLoop(false);
118
+ });
119
+ }
120
+ /** Stop compositing and release the canvas, audio, and video tracks. */
121
+ stop() {
122
+ this.finishResume("timed-out");
123
+ this.cancelDrawLoop();
124
+ this.videoTrack?.stop();
125
+ this.audioTrack?.stop();
126
+ this.composite?.getTracks().forEach((track) => track.stop());
127
+ if (this.video) this.video.srcObject = null;
128
+ this.canvas = null;
129
+ this.ctx = null;
130
+ this.video = null;
131
+ this.videoTrack = null;
132
+ this.audioTrack = null;
133
+ this.composite = null;
134
+ }
135
+ setVideoSource(stream) {
136
+ this.videoTrack = stream.getVideoTracks()[0] ?? null;
137
+ const video = this.video;
138
+ if (!video) return;
139
+ video.srcObject = new MediaStream(stream.getVideoTracks());
140
+ video.play().catch(() => {});
141
+ }
142
+ startDrawLoop(resetSourceTime = true) {
143
+ this.cancelDrawLoop();
144
+ this.lastDrawTimeMs = null;
145
+ if (resetSourceTime) this.lastVideoTimeSeconds = null;
146
+ const draw = (timeMs) => {
147
+ const elapsed = this.lastDrawTimeMs === null ? Infinity : timeMs - this.lastDrawTimeMs;
148
+ if ((this.frameIntervalMs === 0 || elapsed >= this.frameIntervalMs * FRAME_INTERVAL_TOLERANCE_RATIO) && this.drawCurrentFrame()) {
149
+ this.lastDrawTimeMs = timeMs;
150
+ this.finishResume("resumed");
151
+ }
152
+ this.scheduleNextFrame(draw);
153
+ };
154
+ this.scheduleNextFrame(draw);
155
+ }
156
+ finishResume(result) {
157
+ const waiter = this.resumeWaiter;
158
+ if (!waiter) return;
159
+ this.resumeWaiter = void 0;
160
+ clearTimeout(waiter.timeout);
161
+ if ("signal" in waiter) waiter.signal.removeEventListener("abort", waiter.onAbort);
162
+ waiter.resolve(result);
163
+ }
164
+ scheduleNextFrame(callback) {
165
+ const video = this.video;
166
+ if (video && typeof video.requestVideoFrameCallback === "function") {
167
+ this.frameRequestKind = "video";
168
+ this.frameRequestId = video.requestVideoFrameCallback(callback);
169
+ return;
170
+ }
171
+ this.frameRequestKind = "animation";
172
+ this.frameRequestId = requestAnimationFrame(callback);
173
+ }
174
+ cancelDrawLoop() {
175
+ if (this.frameRequestId === null) return;
176
+ if (this.frameRequestKind === "video" && this.video && typeof this.video.cancelVideoFrameCallback === "function") this.video.cancelVideoFrameCallback(this.frameRequestId);
177
+ else cancelAnimationFrame(this.frameRequestId);
178
+ this.frameRequestId = null;
179
+ this.frameRequestKind = null;
180
+ }
181
+ drawCurrentFrame() {
182
+ const video = this.video;
183
+ const canvas = this.canvas;
184
+ const ctx = this.ctx;
185
+ if (!video || !canvas || !ctx || video.videoWidth <= 0) return false;
186
+ if (this.lastVideoTimeSeconds === video.currentTime) return false;
187
+ const dimensions = this.getBoundedDimensions(video.videoWidth, video.videoHeight);
188
+ if (canvas.width !== dimensions.width || canvas.height !== dimensions.height) {
189
+ canvas.width = dimensions.width;
190
+ canvas.height = dimensions.height;
191
+ }
192
+ ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
193
+ this.lastVideoTimeSeconds = video.currentTime;
194
+ return true;
195
+ }
196
+ getBoundedDimensions(width, height) {
197
+ const longEdge = Math.max(width, height);
198
+ const shortEdge = Math.min(width, height);
199
+ const scale = Math.min(1, MAX_COMPOSITE_LONG_EDGE / longEdge, MAX_COMPOSITE_SHORT_EDGE / shortEdge);
200
+ return {
201
+ width: Math.max(1, Math.round(width * scale)),
202
+ height: Math.max(1, Math.round(height * scale))
203
+ };
204
+ }
205
+ };
206
+ //#endregion
5
207
  //#region ../infra/src/wasm/idCaptureWasmApi.ts
6
208
  var IdCaptureWasmApi = class {
7
209
  constructor(runtime = wasmRuntime) {
@@ -273,4 +475,4 @@ const DEFAULT_ID_CAPTURE_GEOMETRY = {
273
475
  widthUp: 205
274
476
  };
275
477
  //#endregion
276
- export { DEFAULT_ID_CAPTURE_THRESHOLDS as n, IdCaptureProvider as r, DEFAULT_ID_CAPTURE_GEOMETRY as t };
478
+ export { CameraCompositor as i, DEFAULT_ID_CAPTURE_THRESHOLDS as n, IdCaptureProvider as r, DEFAULT_ID_CAPTURE_GEOMETRY as t };