@incodetech/core 2.4.1-agentic → 2.4.1-agentic.2
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.
- package/dist/BrowserNetworkStatusProvider-BrDXBEDd.esm.js +21 -0
- package/dist/{multipartRecordingService-DMBxHKS2.esm.js → CameraCompositor-DN7NkJzV.esm.js} +7 -734
- package/dist/{FaceDetectionProvider-B83VmClw.esm.js → FaceDetectionProvider-D9PlON49.esm.js} +11 -12
- package/dist/MultipartRecordingProvider-D9mauUdS.esm.js +146 -0
- package/dist/StreamCanvasProcessingSession-CBnbTnOr.esm.js +42 -0
- package/dist/{WasmUtilProvider-GTkoJyFY.esm.js → WasmUtilProvider-Dp2V-Uct.esm.js} +2 -2
- package/dist/WorkerEncoderRecordingProvider-B1ODYtgN.esm.js +80 -0
- package/dist/{addressSearch-41sMcnJk.esm.js → addressSearch-DzbE9Ogt.esm.js} +2 -352
- package/dist/ae-signature.esm.js +1 -1
- package/dist/antifraud.esm.js +2 -2
- package/dist/{antifraudManager-CQ08atTC.esm.js → antifraudManager-BObuHBjn.esm.js} +2 -2
- package/dist/{antifraudStateMachine-BcsUTTIr.esm.js → antifraudStateMachine-Dfrd2-26.esm.js} +1 -1
- package/dist/{api-BO8JA7Pf.esm.js → api-CpP4PS4S.esm.js} +2 -0
- package/dist/{apiError-CfuIvnUy.esm.js → apiError-gNfsp99I.esm.js} +1 -1
- package/dist/{attemptCarry-BjTJ6bMQ.esm.js → attemptCarry-WOkfvFMw.esm.js} +2 -2
- package/dist/authentication.d.ts +3 -3
- package/dist/authentication.esm.js +2 -2
- package/dist/{authenticationManager-DvmklBTE.esm.js → authenticationManager-BtN4CHOR.esm.js} +5 -5
- package/dist/{authenticationManager-C-cOki0Y.d.ts → authenticationManager-CWmh7aSY.d.ts} +1 -1
- package/dist/{authenticationStateMachine-BL2ptOA0.esm.js → authenticationStateMachine-DdcnWnBT.esm.js} +3 -3
- package/dist/backCameraLabel-yda5ugE4.esm.js +67 -0
- package/dist/{backCameraStream-C5_NNfUN.esm.js → backCameraStream-DS1oDiUq.esm.js} +10 -65
- package/dist/{browser-pQZA35G2-DtkAf6sn.esm.js → browser-pQZA35G2-C0fRj-ID.esm.js} +1 -1
- package/dist/camera.d.ts +2 -2
- package/dist/camera.esm.js +1 -1
- package/dist/certificate-issuance.esm.js +2 -2
- package/dist/{certificateIssuanceManager-CM0fuqDC.esm.js → certificateIssuanceManager-C1nETQos.esm.js} +2 -2
- package/dist/{certificateIssuanceStateMachine-kksIUOPD.esm.js → certificateIssuanceStateMachine-DThXMDqr.esm.js} +1 -1
- package/dist/{connectivity-HSl0diCx.esm.js → connectivity-BCuEoQ-n.esm.js} +2 -21
- package/dist/consent.d.ts +1 -1
- package/dist/consent.esm.js +2 -2
- package/dist/{consentManager-CBwFozhv.esm.js → consentManager-DMlSL6Ax.esm.js} +2 -2
- package/dist/{consentManager-_q9yJUku.d.ts → consentManager-bjfVXO7p.d.ts} +9 -9
- package/dist/{consentStateMachine-CpmRAcr2.esm.js → consentStateMachine-DIYSMxKQ.esm.js} +1 -1
- package/dist/cross-document-data-match.esm.js +1 -1
- package/dist/{crossDocumentDataMatchManager-64O8t10a.esm.js → crossDocumentDataMatchManager-BFTdiEDB.esm.js} +2 -2
- package/dist/curp-validation.d.ts +1 -1
- package/dist/curp-validation.esm.js +2 -2
- package/dist/{curpValidationManager-CLgJQcx0.esm.js → curpValidationManager-DNpC3wyf.esm.js} +2 -2
- package/dist/{curpValidationManager-CXpFE-Mv.d.ts → curpValidationManager-z8428oCM.d.ts} +1 -1
- package/dist/{curpValidationStateMachine-Bx9YhVkJ.esm.js → curpValidationStateMachine-B3iVsDyt.esm.js} +2 -2
- package/dist/custom-fields.esm.js +1 -1
- package/dist/custom-watchlist.esm.js +2 -2
- package/dist/{customFieldsManager-DWt_0YtJ.esm.js → customFieldsManager-CvI-pDT3.esm.js} +2 -2
- package/dist/{customWatchlistManager-D8o-2Nej.esm.js → customWatchlistManager-BuHtUb0y.esm.js} +2 -2
- package/dist/{customWatchlistStateMachine-Sbi6DIcK.esm.js → customWatchlistStateMachine-CiVD9wyF.esm.js} +1 -1
- package/dist/{deepsightService-twg3bXqY.esm.js → deepsightLoader-Crsj_u0c.esm.js} +34 -29
- package/dist/{desktopCameraElection-kHY2IDJi.esm.js → desktopCameraElection-BGMtYwk3.esm.js} +5 -5
- package/dist/document-capture.d.ts +3 -3
- package/dist/document-capture.esm.js +2 -2
- package/dist/{documentCaptureManager-6tnnDkMX.d.ts → documentCaptureManager-DDfviFg0.d.ts} +25 -4
- package/dist/{documentCaptureManager-CMSC_Mhd.esm.js → documentCaptureManager-DLPqruXJ.esm.js} +3 -2
- package/dist/{documentCaptureStateMachine-BCwD5Rto.esm.js → documentCaptureStateMachine-DCvWQhFG.esm.js} +67 -26
- package/dist/dynamic-forms.esm.js +2 -2
- package/dist/{dynamicFormsManager-DU6W1e20.esm.js → dynamicFormsManager-CwqgwLa5.esm.js} +2 -2
- package/dist/{dynamicFormsStateMachine-C8Z7k3vo.esm.js → dynamicFormsStateMachine-CBdnpD95.esm.js} +2 -2
- package/dist/ekyb.d.ts +4 -4
- package/dist/ekyb.esm.js +3 -3
- package/dist/{ekybManager-TB6ZG5lX.d.ts → ekybManager-BLOkwmWO.d.ts} +2 -2
- package/dist/{ekybManager-TGfqyjuu.esm.js → ekybManager-BVTqTHd3.esm.js} +2 -2
- package/dist/{ekybStateMachine-DBgFuEPK.esm.js → ekybStateMachine-BmZHuZE1.esm.js} +5 -3
- package/dist/ekybUtils-Cw8Ta9Qi.esm.js +140 -0
- package/dist/ekyc.d.ts +3 -2
- package/dist/ekyc.esm.js +3 -3
- package/dist/{ekycManager-BSQteIfC.d.ts → ekycManager-DlGIn9wA.d.ts} +2 -1
- package/dist/{ekycManager-C2cgG2Pl.esm.js → ekycManager-DymCvmVB.esm.js} +2 -2
- package/dist/{ekycStateMachine-CuNF7z4O.esm.js → ekycStateMachine-CoFCUJ2z.esm.js} +141 -68
- package/dist/{ekycUtils-BFncpC4F.esm.js → ekycUtils-GRuMELYr.esm.js} +80 -9
- package/dist/electronic-signature.esm.js +1 -1
- package/dist/{electronicSignatureManager-C7pqXsRm.esm.js → electronicSignatureManager-Bt_tCIdI.esm.js} +3 -3
- package/dist/email.esm.js +2 -2
- package/dist/{emailManager-FH_CP0cT.esm.js → emailManager-CGoE3CUe.esm.js} +2 -2
- package/dist/{emailStateMachine-Cx-uTaBV.esm.js → emailStateMachine-KgHfDNvM.esm.js} +2 -2
- package/dist/{events-CQteqXfy.esm.js → events-ggpBBaZ8.esm.js} +1 -1
- package/dist/events.esm.js +1 -1
- package/dist/extensibility.d.ts +15 -14
- package/dist/extensibility.esm.js +36 -35
- package/dist/face-match.esm.js +2 -2
- package/dist/{faceCaptureManagerFactory-CBm05KnT.esm.js → faceCaptureManagerFactory-BWOB3ZeZ.esm.js} +4 -4
- package/dist/{faceCaptureManagerFactory-C-xKdj-d.d.ts → faceCaptureManagerFactory-DV2ULUYS.d.ts} +3 -3
- package/dist/{faceCaptureSetup-BQjCbL51.esm.js → faceCaptureSetup-D0w1UBlO.esm.js} +12 -403
- package/dist/{faceMatchManager-B2zp7yP4.esm.js → faceMatchManager-D2xKPjjQ.esm.js} +2 -2
- package/dist/{faceMatchStateMachine-ByTMQCUC.esm.js → faceMatchStateMachine-CUvwiQi9.esm.js} +2 -2
- package/dist/{feature-management-DjAG5lsJ.esm.js → feature-management-DBh1nqp8.esm.js} +35 -21
- package/dist/feature-management.esm.js +1 -1
- package/dist/field-comparison.esm.js +1 -1
- package/dist/{fieldComparisonManager-CC0vKmpf.esm.js → fieldComparisonManager-DgDbEeFZ.esm.js} +2 -2
- package/dist/fiscal-qr.esm.js +1 -1
- package/dist/{fiscalQrManager-Be-r4oZj.esm.js → fiscalQrManager-BZeklojR.esm.js} +3 -3
- package/dist/flow-events.d.ts +1 -1
- package/dist/flow.d.ts +8 -8
- package/dist/flow.esm.js +10 -6
- package/dist/{flowCompletionService-ChMU2v79.esm.js → flowCompletionService-Dv7zoVWe.esm.js} +2 -2
- package/dist/{flowServices-g2tVWsJl.esm.js → flowServices-C5-oamoC.esm.js} +69 -143
- package/dist/geolocation.esm.js +2 -2
- package/dist/{geolocationManager-DLbvZwUB.esm.js → geolocationManager-BFTxgOZG.esm.js} +2 -2
- package/dist/{geolocationStateMachine-CAJVongM.esm.js → geolocationStateMachine-v729Lz_0.esm.js} +3 -3
- package/dist/government-validation.esm.js +2 -2
- package/dist/{governmentValidationManager-CkX9TEkh.esm.js → governmentValidationManager-CjChjZ3C.esm.js} +2 -2
- package/dist/{governmentValidationStateMachine-PTPCP26N.esm.js → governmentValidationStateMachine-AEbn3Afi.esm.js} +1 -1
- package/dist/home.d.ts +1 -1
- package/dist/home.esm.js +1 -1
- package/dist/http.esm.js +1 -1
- package/dist/id-ocr.d.ts +1 -1
- package/dist/id-ocr.esm.js +2 -2
- package/dist/id-selfie-flow.d.ts +1 -1
- package/dist/id-selfie-flow.esm.js +10 -9
- package/dist/id-verification.esm.js +2 -2
- package/dist/id.d.ts +3 -3
- package/dist/id.esm.js +4 -4
- package/dist/{idCaptureDefaults-MSQoqScU.esm.js → idCaptureDefaults-Dszuq9ng.esm.js} +3 -3
- package/dist/{idCaptureManager-zZdTcpG1.esm.js → idCaptureManager-BVfqpIjM.esm.js} +9 -8
- package/dist/{idCaptureManager-DzTfQ1Am.d.ts → idCaptureManager-CCA2D1Ah.d.ts} +5 -3
- package/dist/{idCaptureServices-8OHinO0N.esm.js → idCaptureServices-CwG9Xp_n.esm.js} +27 -196
- package/dist/{idCaptureStateMachine-B3G6XoDG.esm.js → idCaptureStateMachine-DUm3a_Mt.esm.js} +20 -20
- package/dist/{idOcrManager-DT3kPIB3.d.ts → idOcrManager-BTdHlJ9D.d.ts} +1 -1
- package/dist/{idOcrManager-B64-fjWg.esm.js → idOcrManager-xyEZNOBa.esm.js} +2 -2
- package/dist/{idOcrStateMachine-B1aZnobs.esm.js → idOcrStateMachine-DNKXh4Rn.esm.js} +1 -1
- package/dist/{idVerificationManager-_Kebv-Ue.esm.js → idVerificationManager-DdnvYfgN.esm.js} +2 -2
- package/dist/{idVerificationStateMachine-DQn6c84z.esm.js → idVerificationStateMachine-DtIBCa32.esm.js} +1 -1
- package/dist/identity-reuse.esm.js +2 -2
- package/dist/{identityReuseManager-DDXkNVZi.esm.js → identityReuseManager-CcpovlfD.esm.js} +2 -2
- package/dist/{identityReuseStateMachine-Bcnkbjf8.esm.js → identityReuseStateMachine-DxZFWy47.esm.js} +1 -1
- package/dist/{index-DEfwds5y.d.ts → index-BfSZvEHi.d.ts} +10 -2
- package/dist/{index-DMDAk85K.d.ts → index-DC0P2Vzw.d.ts} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/{invokeOnCaptureCallback-CXIBwBeE.esm.js → invokeOnCaptureCallback-BJ0GVHGr.esm.js} +1 -1
- package/dist/kyb-checks.d.ts +3 -0
- package/dist/kyb-checks.esm.js +3 -0
- package/dist/kybChecksManager-CblEL97E.d.ts +95 -0
- package/dist/kybChecksManager-D2BEaUzK.esm.js +89 -0
- package/dist/kybChecksStateMachine-Cy-MsmKZ.esm.js +718 -0
- package/dist/mandatory-consent.d.ts +2 -2
- package/dist/mandatory-consent.esm.js +2 -2
- package/dist/{mandatoryConsentManager-43W5d_8G.esm.js → mandatoryConsentManager-B4vCYslr.esm.js} +2 -2
- package/dist/{mandatoryConsentManager-xx3mY-xw.d.ts → mandatoryConsentManager-B88Sm5nd.d.ts} +6 -6
- package/dist/{mandatoryConsentStateMachine-CVlgdlnt.esm.js → mandatoryConsentStateMachine-DWslYPA3.esm.js} +1 -1
- package/dist/mediaRecorderOptions-B9-IEVtV.esm.js +70 -0
- package/dist/multipartRecordingService-BTqkHGG9.esm.js +407 -0
- package/dist/{permissionGuards-B3OPL8Si.esm.js → permissionGuards-DFV-Ws0a.esm.js} +1 -1
- package/dist/{permissionServices-DnBAN_hW.esm.js → permissionServices-D190ATGD.esm.js} +8 -6
- package/dist/phone.esm.js +2 -2
- package/dist/phoneFormat-JJNaWthV.esm.js +75 -0
- package/dist/{phoneManager-C6jut_pz.esm.js → phoneManager-Dy5tODCU.esm.js} +3 -3
- package/dist/phoneServices-DJgyOzU2.esm.js +77 -0
- package/dist/{phoneStateMachine-T1-drWfG.esm.js → phoneStateMachine-DnlPhnw7.esm.js} +20 -60
- package/dist/{processFaceMatch-BWme3kVV.esm.js → processFaceMatch-Bst83HaS.esm.js} +1 -1
- package/dist/qe-signature.esm.js +1 -1
- package/dist/recordingService-CTko6Cjn.esm.js +397 -0
- package/dist/redirect-to-mobile.esm.js +2 -2
- package/dist/{redirectToMobileManager-BJXC6Kx9.esm.js → redirectToMobileManager-CgGaT2NP.esm.js} +3 -3
- package/dist/{redirectToMobileStateMachine-BBMAc2Gb.esm.js → redirectToMobileStateMachine-CbhN8uVN.esm.js} +39 -21
- package/dist/resolveForm-O7-r79VA.esm.js +351 -0
- package/dist/{runChildModule-DPHTqSdF.esm.js → runChildModule-BG46reQE.esm.js} +2 -2
- package/dist/{sdkVersion-C3_P-Qbq.esm.js → sdkVersion-DJCo6uSb.esm.js} +1 -1
- package/dist/selfie.d.ts +3 -3
- package/dist/selfie.esm.js +10 -10
- package/dist/{selfieErrorUtils-BL0BLMnp.esm.js → selfieErrorUtils-DNbVqz2B.esm.js} +1 -1
- package/dist/{selfieManager-Cbliomv7.esm.js → selfieManager-1_TQP4-x.esm.js} +5 -5
- package/dist/{selfieManager-BMmpUii2.d.ts → selfieManager-DmZFzs1-.d.ts} +1 -1
- package/dist/{selfieStateMachine-B5m_Kn0O.esm.js → selfieStateMachine-BUnZmMRY.esm.js} +3 -3
- package/dist/{session-DAaAewMX.esm.js → session-DdnAM9fZ.esm.js} +4 -4
- package/dist/session.d.ts +1 -1
- package/dist/session.esm.js +6 -6
- package/dist/{sessionInitializer-CWFT4dfw.esm.js → sessionInitializer-CwJACl13.esm.js} +83 -24
- package/dist/{setup-D9qt8YVU.d.ts → setup-CmqnkqsR.d.ts} +1 -1
- package/dist/{setup-CDAKwTr7.esm.js → setup-D26WdmvA.esm.js} +28 -27
- package/dist/signature.esm.js +2 -2
- package/dist/{signatureManager-BeEVCcsC.esm.js → signatureManager-CwqjcxPg.esm.js} +2 -2
- package/dist/{signatureStateMachine-_1c1vSid.esm.js → signatureStateMachine-DBVDd1Eu.esm.js} +1 -1
- package/dist/{stats-BpMz-hTP.esm.js → stats-CatA2dea.esm.js} +1 -1
- package/dist/stats.esm.js +1 -1
- package/dist/textRules-D4NRinKY.d.ts +41 -0
- package/dist/{tri-BajQnjbf.esm.js → tri-C9SvtzuQ.esm.js} +24 -3
- package/dist/tri.d.ts +2 -2
- package/dist/{tri.esm-CzTNi5Q_.esm.js → tri.esm-DgTlfPhR.esm.js} +167 -155
- package/dist/tri.esm.js +2 -2
- package/dist/{trueSightService-BujtUIW6.esm.js → trueSightService-OZl8wQu7.esm.js} +4 -4
- package/dist/trust-graph.esm.js +1 -1
- package/dist/{types--3HDl2SF.d.ts → types-BEVHQbbC.d.ts} +1 -1
- package/dist/{types-xEEWCx1j.d.ts → types-BPm1JSu7.d.ts} +1 -1
- package/dist/{types-C397LhmN.d.ts → types-BgRHw-dR.d.ts} +1 -1
- package/dist/{types-DuD8TRJU.d.ts → types-CRaFu6wS.d.ts} +4 -2
- package/dist/types-CTaL0XJz.d.ts +80 -0
- package/dist/{types-PTZHRhGX.d.ts → types-Cd0J0F9D.d.ts} +1 -1
- package/dist/{types-e8fCsvvk.d.ts → types-Csh8vzPo.d.ts} +1 -1
- package/dist/{types-B2FK_wYb.d.ts → types-CuMJ2M7D.d.ts} +2 -41
- package/dist/{types-ZTZelfbM.d.ts → types-CyNndVAT.d.ts} +14 -6
- package/dist/types-J6g6iKe_.d.ts +6 -0
- package/dist/video-selfie.d.ts +1 -1
- package/dist/video-selfie.esm.js +9 -7
- package/dist/{videoSelfieCameraWarmer-DjkPpoj_.esm.js → videoSelfieCameraWarmer-Bhi70pSN.esm.js} +8 -8
- package/dist/{videoSelfieStepDetector-RfSmlFFW.d.ts → videoSelfieStepDetector-Dv3Mgws-.d.ts} +2 -2
- package/dist/virtualCameraCheck-eFOm2C9q.esm.js +27 -0
- package/dist/{warmup-BkfxQZsC.esm.js → warmup-DtB0DJpl.esm.js} +24 -17
- package/dist/wasm.d.ts +1 -1
- package/dist/wasm.esm.js +3 -3
- package/dist/{wasmDsFlagSync-BhU5H2oR.esm.js → wasmDsFlagSync-BtiR5pig.esm.js} +1 -1
- package/dist/{wasmWebClient-DTj9auyA.esm.js → wasmWebClient-BDrax6Eu.esm.js} +12 -9
- package/dist/watchlist-for-business.esm.js +2 -2
- package/dist/watchlist.esm.js +2 -2
- package/dist/{watchlistForBusinessManager-CVay6-9A.esm.js → watchlistForBusinessManager-DqUpAEj_.esm.js} +2 -2
- package/dist/{watchlistForBusinessStateMachine-DA6K5na4.esm.js → watchlistForBusinessStateMachine-DdaPl2PS.esm.js} +1 -1
- package/dist/{watchlistManager-B8gQ_rw3.esm.js → watchlistManager-CdpXzT4B.esm.js} +2 -2
- package/dist/{watchlistStateMachine-CSi_ZhtT.esm.js → watchlistStateMachine-ofHW_lPk.esm.js} +1 -1
- package/dist/workflow.d.ts +1 -1
- package/dist/workflow.esm.js +42 -42
- package/package.json +13 -7
- package/dist/deepsightLoader-DMxtowCm.esm.js +0 -33
- package/dist/types-D9r3zRfY.d.ts +0 -6
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-
|
|
2
|
-
import { s as createActor, u as createManager } from "./xstate.esm-DSajW7CJ.esm.js";
|
|
1
|
+
import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-ggpBBaZ8.esm.js";
|
|
3
2
|
import { n as loadPhoneValidation, t as getPhoneValidation } from "./phoneValidation-OggtfjRt.esm.js";
|
|
3
|
+
import { s as createActor, u as createManager } from "./xstate.esm-DSajW7CJ.esm.js";
|
|
4
4
|
import { n as isOtpComplete } from "./otp-D2k3PeSL.esm.js";
|
|
5
|
-
import { t as phoneMachine } from "./phoneStateMachine-
|
|
5
|
+
import { t as phoneMachine } from "./phoneStateMachine-DnlPhnw7.esm.js";
|
|
6
6
|
//#region src/modules/phone/phoneActor.ts
|
|
7
7
|
function createPhoneActor(options) {
|
|
8
8
|
return createActor(phoneMachine, { input: { config: options.config } }).start();
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { r as getToken, t as api, u as endpoints } from "./api-CpP4PS4S.esm.js";
|
|
2
|
+
//#region src/modules/phone/phoneServices.ts
|
|
3
|
+
function getPhoneServerFailureReason(error, invalidStatus) {
|
|
4
|
+
if (error.status === invalidStatus) return "invalidPhone";
|
|
5
|
+
return "serverError";
|
|
6
|
+
}
|
|
7
|
+
async function fetchPhone(signal) {
|
|
8
|
+
const res = await api.get(endpoints.getPhone, { signal });
|
|
9
|
+
if (!res.ok) throw new Error(`GET ${endpoints.getPhone} failed: ${res.status} ${res.statusText}`);
|
|
10
|
+
return res.data;
|
|
11
|
+
}
|
|
12
|
+
async function requestStartInfo(signal) {
|
|
13
|
+
const res = await api.get(endpoints.startInfo, { signal });
|
|
14
|
+
if (!res.ok) throw new Error(`GET ${endpoints.startInfo} failed: ${res.status} ${res.statusText}`);
|
|
15
|
+
return res.data;
|
|
16
|
+
}
|
|
17
|
+
let prefetchedStartInfo;
|
|
18
|
+
/**
|
|
19
|
+
* Starts the start-info request before the phone step runs (the flow calls
|
|
20
|
+
* it when the step is first), so the step's first screen does not wait for
|
|
21
|
+
* that round trip. The step's own `fetchStartInfo` uses the answer once.
|
|
22
|
+
*/
|
|
23
|
+
function prefetchStartInfo() {
|
|
24
|
+
const token = getToken();
|
|
25
|
+
if (!token || prefetchedStartInfo?.token === token) return;
|
|
26
|
+
const promise = requestStartInfo();
|
|
27
|
+
promise.catch(() => void 0);
|
|
28
|
+
prefetchedStartInfo = {
|
|
29
|
+
token,
|
|
30
|
+
promise
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
async function fetchStartInfo(signal) {
|
|
34
|
+
const prefetched = prefetchedStartInfo;
|
|
35
|
+
prefetchedStartInfo = void 0;
|
|
36
|
+
if (prefetched?.token === getToken()) {
|
|
37
|
+
const info = await prefetched.promise.catch(() => void 0);
|
|
38
|
+
if (info) return info;
|
|
39
|
+
}
|
|
40
|
+
return requestStartInfo(signal);
|
|
41
|
+
}
|
|
42
|
+
async function addPhone(params, signal) {
|
|
43
|
+
try {
|
|
44
|
+
return (await api.post(endpoints.phone, {
|
|
45
|
+
phone: params.phone,
|
|
46
|
+
optInGranted: params.optInGranted
|
|
47
|
+
}, { signal })).data;
|
|
48
|
+
} catch (error) {
|
|
49
|
+
throw new Error(getPhoneServerFailureReason(error, 400));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
async function addPhoneInstantVerify(params, signal) {
|
|
53
|
+
try {
|
|
54
|
+
return (await api.post(endpoints.phoneInstant, {
|
|
55
|
+
phone: params.phone,
|
|
56
|
+
optInGranted: params.optInGranted
|
|
57
|
+
}, { signal })).data;
|
|
58
|
+
} catch (error) {
|
|
59
|
+
throw new Error(getPhoneServerFailureReason(error, 400));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
async function sendOtp(signal) {
|
|
63
|
+
try {
|
|
64
|
+
await api.get(`${endpoints.sendSmsOtp}?communicationchannel=SMS`, { signal });
|
|
65
|
+
} catch (error) {
|
|
66
|
+
throw new Error(getPhoneServerFailureReason(error));
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
async function verifyOtp(code, signal) {
|
|
70
|
+
try {
|
|
71
|
+
return (await api.get(`${endpoints.compareOtp}?code=${code}&channel=SMS`, { signal })).data;
|
|
72
|
+
} catch (error) {
|
|
73
|
+
throw new Error(getPhoneServerFailureReason(error));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
//#endregion
|
|
77
|
+
export { prefetchStartInfo as a, fetchStartInfo as i, addPhoneInstantVerify as n, sendOtp as o, fetchPhone as r, verifyOtp as s, addPhone as t };
|
|
@@ -1,60 +1,10 @@
|
|
|
1
|
-
import { t as api, u as endpoints } from "./api-BO8JA7Pf.esm.js";
|
|
2
1
|
import { t as BrowserTimerProvider } from "./BrowserTimerProvider-BXhgNxLt.esm.js";
|
|
2
|
+
import { n as loadPhoneValidation } from "./phoneValidation-OggtfjRt.esm.js";
|
|
3
|
+
import { i as fetchStartInfo, n as addPhoneInstantVerify, o as sendOtp, r as fetchPhone, s as verifyOtp, t as addPhone } from "./phoneServices-DJgyOzU2.esm.js";
|
|
3
4
|
import { i as assign, t as setup } from "./xstate.esm-DSajW7CJ.esm.js";
|
|
4
5
|
import { n as fromPromise, t as fromCallback } from "./xstate-actors.esm-8Gzepa_A.esm.js";
|
|
5
|
-
import { t as carryAttempts } from "./attemptCarry-
|
|
6
|
-
import { n as loadPhoneValidation } from "./phoneValidation-OggtfjRt.esm.js";
|
|
6
|
+
import { t as carryAttempts } from "./attemptCarry-WOkfvFMw.esm.js";
|
|
7
7
|
import { n as isOtpComplete, t as computeOtpValidationErrors } from "./otp-D2k3PeSL.esm.js";
|
|
8
|
-
//#region src/modules/phone/phoneServices.ts
|
|
9
|
-
function getPhoneServerFailureReason(error, invalidStatus) {
|
|
10
|
-
if (error.status === invalidStatus) return "invalidPhone";
|
|
11
|
-
return "serverError";
|
|
12
|
-
}
|
|
13
|
-
async function fetchPhone(signal) {
|
|
14
|
-
const res = await api.get(endpoints.getPhone, { signal });
|
|
15
|
-
if (!res.ok) throw new Error(`GET ${endpoints.getPhone} failed: ${res.status} ${res.statusText}`);
|
|
16
|
-
return res.data;
|
|
17
|
-
}
|
|
18
|
-
async function fetchStartInfo(signal) {
|
|
19
|
-
const res = await api.get(endpoints.startInfo, { signal });
|
|
20
|
-
if (!res.ok) throw new Error(`GET ${endpoints.startInfo} failed: ${res.status} ${res.statusText}`);
|
|
21
|
-
return res.data;
|
|
22
|
-
}
|
|
23
|
-
async function addPhone(params, signal) {
|
|
24
|
-
try {
|
|
25
|
-
return (await api.post(endpoints.phone, {
|
|
26
|
-
phone: params.phone,
|
|
27
|
-
optInGranted: params.optInGranted
|
|
28
|
-
}, { signal })).data;
|
|
29
|
-
} catch (error) {
|
|
30
|
-
throw new Error(getPhoneServerFailureReason(error, 400));
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
async function addPhoneInstantVerify(params, signal) {
|
|
34
|
-
try {
|
|
35
|
-
return (await api.post(endpoints.phoneInstant, {
|
|
36
|
-
phone: params.phone,
|
|
37
|
-
optInGranted: params.optInGranted
|
|
38
|
-
}, { signal })).data;
|
|
39
|
-
} catch (error) {
|
|
40
|
-
throw new Error(getPhoneServerFailureReason(error, 400));
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
async function sendOtp(signal) {
|
|
44
|
-
try {
|
|
45
|
-
await api.get(`${endpoints.sendSmsOtp}?communicationchannel=SMS`, { signal });
|
|
46
|
-
} catch (error) {
|
|
47
|
-
throw new Error(getPhoneServerFailureReason(error));
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
async function verifyOtp(code, signal) {
|
|
51
|
-
try {
|
|
52
|
-
return (await api.get(`${endpoints.compareOtp}?code=${code}&channel=SMS`, { signal })).data;
|
|
53
|
-
} catch (error) {
|
|
54
|
-
throw new Error(getPhoneServerFailureReason(error));
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
//#endregion
|
|
58
8
|
//#region src/modules/phone/phoneStateMachine.ts
|
|
59
9
|
const RESEND_TIMER_SECONDS = 30;
|
|
60
10
|
function getErrorMessage(error) {
|
|
@@ -149,6 +99,7 @@ const phoneMachine = setup({
|
|
|
149
99
|
setOptInGranted: assign(({ event }) => ({ optInGranted: event.granted })),
|
|
150
100
|
setError: assign(({ event }) => ({ error: getErrorMessage(event.error) })),
|
|
151
101
|
clearError: assign({ error: () => void 0 }),
|
|
102
|
+
settleLoad: assign({ pendingLoads: ({ context }) => context.pendingLoads - 1 }),
|
|
152
103
|
clearPhoneError: assign({ phoneError: () => void 0 }),
|
|
153
104
|
setOtpCode: assign(({ event }) => ({
|
|
154
105
|
otpCode: event.code,
|
|
@@ -191,6 +142,7 @@ const phoneMachine = setup({
|
|
|
191
142
|
prefilledPhone: void 0,
|
|
192
143
|
optInGranted: false,
|
|
193
144
|
startInfo: void 0,
|
|
145
|
+
pendingLoads: 0,
|
|
194
146
|
error: void 0,
|
|
195
147
|
otpCode: "",
|
|
196
148
|
otpError: void 0,
|
|
@@ -202,6 +154,7 @@ const phoneMachine = setup({
|
|
|
202
154
|
},
|
|
203
155
|
guards: {
|
|
204
156
|
hasPrefill: ({ context }) => context.config.prefill,
|
|
157
|
+
areLoadsSettled: ({ context }) => context.pendingLoads === 0,
|
|
205
158
|
hasOtpVerification: ({ context }) => context.config.otpVerification,
|
|
206
159
|
hasNoValidationErrors: ({ context }) => !context.validationErrors || Object.keys(context.validationErrors).length === 0,
|
|
207
160
|
hasAttemptsRemaining: ({ context }) => context.attemptsRemaining > 1,
|
|
@@ -224,6 +177,7 @@ const phoneMachine = setup({
|
|
|
224
177
|
prefilledPhone: void 0,
|
|
225
178
|
optInGranted: false,
|
|
226
179
|
startInfo: void 0,
|
|
180
|
+
pendingLoads: 0,
|
|
227
181
|
error: void 0,
|
|
228
182
|
otpCode: "",
|
|
229
183
|
otpError: void 0,
|
|
@@ -247,15 +201,21 @@ const phoneMachine = setup({
|
|
|
247
201
|
{ target: "loadingStartInfo" }
|
|
248
202
|
] } },
|
|
249
203
|
loadingPrefill: {
|
|
250
|
-
entry: "startLoadingPhoneRules",
|
|
251
|
-
invoke: {
|
|
204
|
+
entry: ["startLoadingPhoneRules", assign({ pendingLoads: () => 2 })],
|
|
205
|
+
invoke: [{
|
|
252
206
|
id: "fetchPhone",
|
|
253
207
|
src: "fetchPhone",
|
|
254
|
-
onDone: {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
208
|
+
onDone: { actions: ["setPrefilledPhone", "settleLoad"] },
|
|
209
|
+
onError: { actions: "settleLoad" }
|
|
210
|
+
}, {
|
|
211
|
+
id: "fetchStartInfo",
|
|
212
|
+
src: "fetchStartInfo",
|
|
213
|
+
onDone: { actions: ["setStartInfo", "settleLoad"] },
|
|
214
|
+
onError: { actions: "settleLoad" }
|
|
215
|
+
}],
|
|
216
|
+
always: {
|
|
217
|
+
target: "loadingPhoneRules",
|
|
218
|
+
guard: "areLoadsSettled"
|
|
259
219
|
}
|
|
260
220
|
},
|
|
261
221
|
loadingStartInfo: {
|
package/dist/qe-signature.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as NAMIRIAL_QES_CONSENT_KEYS, c as areAllConsented, o as NAMIRIAL_QES_PROVIDER_CODE, r as electronicSignatureMachine, s as QE_CONSENT_KEYS, t as createElectronicSignatureManager, u as getDefaultConsentChecks } from "./electronicSignatureManager-
|
|
1
|
+
import { a as NAMIRIAL_QES_CONSENT_KEYS, c as areAllConsented, o as NAMIRIAL_QES_PROVIDER_CODE, r as electronicSignatureMachine, s as QE_CONSENT_KEYS, t as createElectronicSignatureManager, u as getDefaultConsentChecks } from "./electronicSignatureManager-Bt_tCIdI.esm.js";
|
|
2
2
|
//#region src/modules/qe-signature/index.ts
|
|
3
3
|
function createQeSignatureManager(options) {
|
|
4
4
|
return createElectronicSignatureManager({ config: {
|
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
import { t as api, u as endpoints } from "./api-CpP4PS4S.esm.js";
|
|
2
|
+
import { t as BrowserLazyImportProvider } from "./BrowserLazyImportProvider-BhoA957O.esm.js";
|
|
3
|
+
import { r as createRecordingCompositor } from "./CameraCompositor-DN7NkJzV.esm.js";
|
|
4
|
+
import { t as getAdaptiveMediaRecorderOptions } from "./mediaRecorderOptions-B9-IEVtV.esm.js";
|
|
5
|
+
import { t as WorkerEncoderRecordingProvider } from "./WorkerEncoderRecordingProvider-B1ODYtgN.esm.js";
|
|
6
|
+
import { t as MultipartRecordingService } from "./multipartRecordingService-BTqkHGG9.esm.js";
|
|
7
|
+
//#region ../infra/src/media/VideoTrimmer.ts
|
|
8
|
+
/** A trim that runs longer than this uploads the full recording instead. */
|
|
9
|
+
const TRIM_TIMEOUT_MS = 1e4;
|
|
10
|
+
const trimmer = BrowserLazyImportProvider.getInstance().create(() => import("./videoTrimByCopy-BFfAiNpv.esm.js").then((module) => module.trimLastNSecondsByCopy), {
|
|
11
|
+
label: "Video liveness",
|
|
12
|
+
moduleName: "mediabunny",
|
|
13
|
+
timeoutMs: 1e4,
|
|
14
|
+
disabledMessage: "the full recording will be uploaded untrimmed."
|
|
15
|
+
});
|
|
16
|
+
/** Starts loading the trimmer, e.g. when a recording that will be trimmed starts. */
|
|
17
|
+
function preloadVideoTrimmer() {
|
|
18
|
+
trimmer.load();
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Keeps about the last `seconds` of a recording. Never rejects and never
|
|
22
|
+
* hangs: when the trimmer cannot load, fails, or takes longer than
|
|
23
|
+
* {@link TRIM_TIMEOUT_MS}, it resolves the untrimmed recording.
|
|
24
|
+
*/
|
|
25
|
+
async function trimLastNSeconds(videoBlob, seconds) {
|
|
26
|
+
const trim = await trimmer.load();
|
|
27
|
+
if (!trim) return videoBlob;
|
|
28
|
+
let timeout;
|
|
29
|
+
try {
|
|
30
|
+
return await Promise.race([trim(videoBlob, seconds), new Promise((resolve) => {
|
|
31
|
+
timeout = setTimeout(() => {
|
|
32
|
+
console.warn("[Video liveness] Trimming timed out; the full recording will be uploaded untrimmed.");
|
|
33
|
+
resolve(videoBlob);
|
|
34
|
+
}, TRIM_TIMEOUT_MS);
|
|
35
|
+
})]);
|
|
36
|
+
} catch (error) {
|
|
37
|
+
console.warn("[Video liveness] Trimming failed; the full recording will be uploaded untrimmed.", error);
|
|
38
|
+
return videoBlob;
|
|
39
|
+
} finally {
|
|
40
|
+
clearTimeout(timeout);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region ../infra/src/providers/browser/LocalRecordingProvider.ts
|
|
45
|
+
function toBase64(videoBlob) {
|
|
46
|
+
return new Promise((resolve, reject) => {
|
|
47
|
+
const reader = new FileReader();
|
|
48
|
+
reader.onloadend = () => {
|
|
49
|
+
const base64 = reader.result.split(",")[1];
|
|
50
|
+
resolve(base64);
|
|
51
|
+
};
|
|
52
|
+
reader.onerror = () => reject(reader.error ?? /* @__PURE__ */ new Error("FileReader error"));
|
|
53
|
+
reader.readAsDataURL(videoBlob);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
/** `MediaRecorderOptions.videoKeyFrameIntervalDuration`, see `startRecording`. */
|
|
57
|
+
const KEYFRAME_INTERVAL_MS = 1e3;
|
|
58
|
+
var LocalRecordingProvider = class {
|
|
59
|
+
constructor() {
|
|
60
|
+
this.mediaRecorder = null;
|
|
61
|
+
this._isRecording = false;
|
|
62
|
+
this._hasError = false;
|
|
63
|
+
this._error = null;
|
|
64
|
+
this.mimeType = "";
|
|
65
|
+
this.stream = null;
|
|
66
|
+
this.pauseRecordingBound = this.pauseRecording.bind(this);
|
|
67
|
+
}
|
|
68
|
+
get isRecording() {
|
|
69
|
+
return this._isRecording;
|
|
70
|
+
}
|
|
71
|
+
get hasError() {
|
|
72
|
+
return this._hasError;
|
|
73
|
+
}
|
|
74
|
+
get error() {
|
|
75
|
+
return this._error;
|
|
76
|
+
}
|
|
77
|
+
startRecording(stream) {
|
|
78
|
+
this.reset();
|
|
79
|
+
preloadVideoTrimmer();
|
|
80
|
+
this.registerEventListeners();
|
|
81
|
+
this.stream = stream;
|
|
82
|
+
try {
|
|
83
|
+
const options = getAdaptiveMediaRecorderOptions();
|
|
84
|
+
this.mimeType = options.mimeType;
|
|
85
|
+
const recorder = new MediaRecorder(stream.clone(), {
|
|
86
|
+
...options,
|
|
87
|
+
videoKeyFrameIntervalDuration: KEYFRAME_INTERVAL_MS
|
|
88
|
+
});
|
|
89
|
+
recorder.onerror = (event) => {
|
|
90
|
+
this._error = `Recording error: ${event}`;
|
|
91
|
+
this._isRecording = false;
|
|
92
|
+
this._hasError = true;
|
|
93
|
+
};
|
|
94
|
+
recorder.start();
|
|
95
|
+
this.mediaRecorder = recorder;
|
|
96
|
+
this._isRecording = true;
|
|
97
|
+
this._error = null;
|
|
98
|
+
this._hasError = false;
|
|
99
|
+
} catch (err) {
|
|
100
|
+
this._error = `Failed to start recording: ${err}`;
|
|
101
|
+
this._hasError = true;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
async stopRecording(trimSeconds, encrypt, generateChecksum) {
|
|
105
|
+
const recorder = this.mediaRecorder;
|
|
106
|
+
return new Promise((resolve, reject) => {
|
|
107
|
+
this.removeEventListeners();
|
|
108
|
+
if (recorder && this._isRecording) {
|
|
109
|
+
const chunks = [];
|
|
110
|
+
recorder.ondataavailable = (event) => {
|
|
111
|
+
if (event.data.size > 0) chunks.push(event.data);
|
|
112
|
+
};
|
|
113
|
+
recorder.onstop = async () => {
|
|
114
|
+
try {
|
|
115
|
+
const trimmedVideo = await trimLastNSeconds(new Blob(chunks, { type: this.mimeType }), trimSeconds);
|
|
116
|
+
const encryptedVideoBase64 = encrypt(await toBase64(trimmedVideo));
|
|
117
|
+
generateChecksum(await trimmedVideo.arrayBuffer());
|
|
118
|
+
this._isRecording = false;
|
|
119
|
+
resolve({
|
|
120
|
+
trimmedBlob: trimmedVideo,
|
|
121
|
+
encryptedVideo: encryptedVideoBase64
|
|
122
|
+
});
|
|
123
|
+
} catch (error) {
|
|
124
|
+
this._isRecording = false;
|
|
125
|
+
this._error = `Recording stop failed: ${error}`;
|
|
126
|
+
this._hasError = true;
|
|
127
|
+
reject(error);
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
recorder.stop();
|
|
131
|
+
this._isRecording = false;
|
|
132
|
+
} else resolve({
|
|
133
|
+
trimmedBlob: new Blob([], { type: this.mimeType }),
|
|
134
|
+
encryptedVideo: ""
|
|
135
|
+
});
|
|
136
|
+
recorder?.stream?.getTracks().forEach((track) => track.stop());
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Discards the in-progress recording without producing a result: detaches
|
|
141
|
+
* the recorder's handlers, stops it, releases its cloned tracks and clears
|
|
142
|
+
* the flags. Idempotent, and safe after `stopRecording` or when never
|
|
143
|
+
* started. Mirrors `MultipartRecordingProvider.reset()` so an attempt that is
|
|
144
|
+
* released before finalization cannot leave a live camera clone behind
|
|
145
|
+
* (ENG-56648).
|
|
146
|
+
*/
|
|
147
|
+
reset() {
|
|
148
|
+
this.removeEventListeners();
|
|
149
|
+
const recorder = this.mediaRecorder;
|
|
150
|
+
if (recorder) {
|
|
151
|
+
recorder.ondataavailable = null;
|
|
152
|
+
recorder.onerror = null;
|
|
153
|
+
recorder.onstop = null;
|
|
154
|
+
if (recorder.state !== "inactive") try {
|
|
155
|
+
recorder.stop();
|
|
156
|
+
} catch {}
|
|
157
|
+
recorder.stream?.getTracks().forEach((track) => track.stop());
|
|
158
|
+
this.mediaRecorder = null;
|
|
159
|
+
}
|
|
160
|
+
this.stream = null;
|
|
161
|
+
this._isRecording = false;
|
|
162
|
+
this._error = null;
|
|
163
|
+
this._hasError = false;
|
|
164
|
+
}
|
|
165
|
+
pauseRecording() {
|
|
166
|
+
if (!this._isRecording) return;
|
|
167
|
+
if (this.mediaRecorder?.state === "recording") try {
|
|
168
|
+
this.mediaRecorder.pause();
|
|
169
|
+
} catch {}
|
|
170
|
+
}
|
|
171
|
+
registerEventListeners() {
|
|
172
|
+
document.addEventListener("visibilitychange", this.pauseRecordingBound);
|
|
173
|
+
}
|
|
174
|
+
removeEventListeners() {
|
|
175
|
+
document.removeEventListener("visibilitychange", this.pauseRecordingBound);
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
//#endregion
|
|
179
|
+
//#region src/internal/recordings/recordingsRepository.ts
|
|
180
|
+
async function uploadDeepsightVideo(encryptedVideo, token) {
|
|
181
|
+
try {
|
|
182
|
+
return (await api.post(endpoints.deepsightVideoImport, {
|
|
183
|
+
video: encryptedVideo,
|
|
184
|
+
type: "selfie"
|
|
185
|
+
}, { headers: { "X-Incode-Hardware-Id": token } })).data.recordingId ?? "";
|
|
186
|
+
} catch {
|
|
187
|
+
return "";
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
//#endregion
|
|
191
|
+
//#region src/internal/faceCapture/recordingService.ts
|
|
192
|
+
/**
|
|
193
|
+
* Records on-device and uploads encrypted video for liveness.
|
|
194
|
+
*/
|
|
195
|
+
var LocalRecordingService = class {
|
|
196
|
+
constructor(wasmUtil, sessionToken) {
|
|
197
|
+
this.recorder = new LocalRecordingProvider();
|
|
198
|
+
this.sessionToken = sessionToken;
|
|
199
|
+
this.wasmUtil = wasmUtil;
|
|
200
|
+
}
|
|
201
|
+
async start(stream) {
|
|
202
|
+
this.recorder.startRecording(stream);
|
|
203
|
+
this.wasmUtil.osv();
|
|
204
|
+
}
|
|
205
|
+
async stop() {
|
|
206
|
+
if (!this.recorder.isRecording) return { recordingId: null };
|
|
207
|
+
this.wasmUtil.oev();
|
|
208
|
+
const result = await this.recorder.stopRecording(10, (base64) => this.wasmUtil.encryptImage(base64), (buffer) => this.wasmUtil.ckvcks(buffer));
|
|
209
|
+
if (!this.sessionToken) return { recordingId: null };
|
|
210
|
+
return { recordingId: await uploadDeepsightVideo(result.encryptedVideo, this.sessionToken) };
|
|
211
|
+
}
|
|
212
|
+
prepareUpload() {
|
|
213
|
+
return this.stop();
|
|
214
|
+
}
|
|
215
|
+
async stopAndGetVideo() {
|
|
216
|
+
if (!this.recorder.isRecording) return { videoBase64: void 0 };
|
|
217
|
+
try {
|
|
218
|
+
this.wasmUtil.oev();
|
|
219
|
+
const videoBase64 = (await this.recorder.stopRecording(10, (base64) => base64, () => {})).encryptedVideo;
|
|
220
|
+
return { videoBase64: videoBase64 ? videoBase64 : void 0 };
|
|
221
|
+
} catch {
|
|
222
|
+
return { videoBase64: void 0 };
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
cleanup() {
|
|
226
|
+
this.recorder.reset();
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
/**
|
|
230
|
+
* Records a regular Selfie capture locally and streams it through the scoped
|
|
231
|
+
* video-selfie-service multipart protocol. The recording is associated with
|
|
232
|
+
* the interview asynchronously by the backend's `selfie` scope consumer, so
|
|
233
|
+
* its upload id must not be forwarded to `/omni/add/face` as a legacy
|
|
234
|
+
* `recordingId`.
|
|
235
|
+
*
|
|
236
|
+
* The recording is scoped to the capture step (ENG-56648). The recorder
|
|
237
|
+
* records a stable `CameraCompositor` stream instead of a raw camera clone, so
|
|
238
|
+
* every attempt can end its own clone before PRC and POC run and the next
|
|
239
|
+
* attempt swaps a fresh clone into the same multipart upload. The owning
|
|
240
|
+
* controller completes the upload once the backend accepts a capture or the
|
|
241
|
+
* step ends without a retry.
|
|
242
|
+
*/
|
|
243
|
+
var MultipartFaceRecordingService = class {
|
|
244
|
+
constructor() {
|
|
245
|
+
this.recordingCompositor = createRecordingCompositor();
|
|
246
|
+
this.service = new MultipartRecordingService("selfie", new WorkerEncoderRecordingProvider(this.recordingCompositor));
|
|
247
|
+
this.audioSource = [];
|
|
248
|
+
this.needsVideoSourceReplacement = false;
|
|
249
|
+
this.pausedForAttempt = false;
|
|
250
|
+
this.startInFlight = false;
|
|
251
|
+
this.suspendRequested = false;
|
|
252
|
+
this.stopping = false;
|
|
253
|
+
}
|
|
254
|
+
async start(stream) {
|
|
255
|
+
if (this.stopping) throw new Error("Face recording already completed");
|
|
256
|
+
if (this.compositor) {
|
|
257
|
+
await this.resume(stream);
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
const recordingSource = stream.clone();
|
|
261
|
+
const compositor = this.recordingCompositor;
|
|
262
|
+
this.startInFlight = true;
|
|
263
|
+
try {
|
|
264
|
+
const composite = compositor.start(recordingSource);
|
|
265
|
+
await this.service.start(composite);
|
|
266
|
+
} catch (error) {
|
|
267
|
+
compositor.stop();
|
|
268
|
+
recordingSource.getTracks().forEach((track) => track.stop());
|
|
269
|
+
this.service.cleanup();
|
|
270
|
+
throw error;
|
|
271
|
+
} finally {
|
|
272
|
+
this.startInFlight = false;
|
|
273
|
+
}
|
|
274
|
+
if (this.stopping) {
|
|
275
|
+
compositor.stop();
|
|
276
|
+
recordingSource.getTracks().forEach((track) => track.stop());
|
|
277
|
+
this.service.cleanup();
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
this.compositor = compositor;
|
|
281
|
+
this.recordingSource = recordingSource;
|
|
282
|
+
this.audioSource = recordingSource.getAudioTracks();
|
|
283
|
+
if (this.suspendRequested) {
|
|
284
|
+
this.suspendRequested = false;
|
|
285
|
+
this.suspend();
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Pauses the container and ends the camera clone on the calling thread. The
|
|
290
|
+
* composite stream and the upload stay open for the next attempt.
|
|
291
|
+
*/
|
|
292
|
+
suspend() {
|
|
293
|
+
if (this.stopping) return;
|
|
294
|
+
if (!this.compositor) {
|
|
295
|
+
this.suspendRequested = this.startInFlight;
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
if (!this.pausedForAttempt) this.pausedForAttempt = this.service.pause();
|
|
299
|
+
this.releaseCameraClone({ keepAudio: true });
|
|
300
|
+
this.needsVideoSourceReplacement = true;
|
|
301
|
+
}
|
|
302
|
+
async prepareUpload() {
|
|
303
|
+
this.suspend();
|
|
304
|
+
return { recordingId: null };
|
|
305
|
+
}
|
|
306
|
+
async stop() {
|
|
307
|
+
await this.complete();
|
|
308
|
+
return { recordingId: null };
|
|
309
|
+
}
|
|
310
|
+
pauseForBackground() {
|
|
311
|
+
this.suspend();
|
|
312
|
+
}
|
|
313
|
+
async resumeFromBackground(stream) {
|
|
314
|
+
if (!this.compositor || this.stopping) return;
|
|
315
|
+
await this.resume(stream);
|
|
316
|
+
}
|
|
317
|
+
async stopAndGetVideo() {
|
|
318
|
+
await this.complete();
|
|
319
|
+
return { videoBase64: void 0 };
|
|
320
|
+
}
|
|
321
|
+
cleanup() {
|
|
322
|
+
this.suspendRequested = false;
|
|
323
|
+
this.pausedForAttempt = false;
|
|
324
|
+
this.needsVideoSourceReplacement = false;
|
|
325
|
+
this.releaseCameraClone({ keepAudio: false });
|
|
326
|
+
this.compositor?.stop();
|
|
327
|
+
this.compositor = void 0;
|
|
328
|
+
this.recordingSource = void 0;
|
|
329
|
+
this.audioSource = [];
|
|
330
|
+
this.service.cleanup();
|
|
331
|
+
}
|
|
332
|
+
/** Swaps this attempt's camera clone into the composite and resumes. */
|
|
333
|
+
async resume(stream) {
|
|
334
|
+
const compositor = this.compositor;
|
|
335
|
+
if (!compositor) return;
|
|
336
|
+
if (this.needsVideoSourceReplacement) {
|
|
337
|
+
const recordingSource = stream.clone();
|
|
338
|
+
recordingSource.getAudioTracks().forEach((track) => track.stop());
|
|
339
|
+
compositor.switchVideo(recordingSource);
|
|
340
|
+
this.needsVideoSourceReplacement = false;
|
|
341
|
+
this.recordingSource = recordingSource;
|
|
342
|
+
const result = await compositor.resume();
|
|
343
|
+
if (result !== "resumed") throw new Error(`Face recording camera did not resume: ${result}`);
|
|
344
|
+
}
|
|
345
|
+
if (this.pausedForAttempt && !this.service.resume()) throw new Error("Face recording did not resume");
|
|
346
|
+
this.pausedForAttempt = false;
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Completes the scoped upload. The camera clone ends synchronously before the
|
|
350
|
+
* drain so a step that ends mid-attempt never pins the camera; the composite
|
|
351
|
+
* stays alive until the recorder has emitted its final chunk.
|
|
352
|
+
*/
|
|
353
|
+
async complete() {
|
|
354
|
+
this.stopping = true;
|
|
355
|
+
this.suspendRequested = false;
|
|
356
|
+
this.releaseCameraClone({ keepAudio: false });
|
|
357
|
+
try {
|
|
358
|
+
await this.service.stop();
|
|
359
|
+
} finally {
|
|
360
|
+
this.compositor?.stop();
|
|
361
|
+
this.compositor = void 0;
|
|
362
|
+
this.recordingSource = void 0;
|
|
363
|
+
this.audioSource = [];
|
|
364
|
+
this.pausedForAttempt = false;
|
|
365
|
+
this.needsVideoSourceReplacement = false;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
releaseCameraClone(options) {
|
|
369
|
+
try {
|
|
370
|
+
this.compositor?.pause();
|
|
371
|
+
} catch {}
|
|
372
|
+
const tracks = options.keepAudio ? this.recordingSource?.getVideoTracks() ?? [] : /* @__PURE__ */ new Set([...this.recordingSource?.getTracks() ?? [], ...this.audioSource]);
|
|
373
|
+
for (const track of tracks) try {
|
|
374
|
+
track.stop();
|
|
375
|
+
} catch {}
|
|
376
|
+
}
|
|
377
|
+
};
|
|
378
|
+
/**
|
|
379
|
+
* Creates the recording service for the current configuration.
|
|
380
|
+
*
|
|
381
|
+
* Order of precedence:
|
|
382
|
+
* 1. `onDeviceFaceResultsSubmissionEnabled === true` → no recording. The
|
|
383
|
+
* on-device workflow never uploads media, only the staged face-results
|
|
384
|
+
* JSON via `WebApi.postFaceResults`. Mirrors V1's
|
|
385
|
+
* `FaceFlowManager.setRecorders()` early return.
|
|
386
|
+
* 2. `deepsightLiveness === 'VIDEOLIVENESS'` → local Deepsight recorder.
|
|
387
|
+
* 3. `enableFaceRecording === true` → scoped multipart recorder.
|
|
388
|
+
* 4. otherwise → no recording.
|
|
389
|
+
*/
|
|
390
|
+
function createRecordingService(params) {
|
|
391
|
+
if (params.config.onDeviceFaceResultsSubmissionEnabled === true) return;
|
|
392
|
+
if (params.localDelivery === true) return params.config.enableFaceRecording === true || params.config.deepsightLiveness === "VIDEOLIVENESS" ? new LocalRecordingService(params.wasmUtil, null) : void 0;
|
|
393
|
+
if (params.config.deepsightLiveness === "VIDEOLIVENESS") return new LocalRecordingService(params.wasmUtil, params.sessionToken);
|
|
394
|
+
if (params.config.enableFaceRecording === true) return new MultipartFaceRecordingService();
|
|
395
|
+
}
|
|
396
|
+
//#endregion
|
|
397
|
+
export { createRecordingService };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as redirectToMobileMachine, r as defaultRedirectToMobileServices } from "./redirectToMobileStateMachine-
|
|
2
|
-
import { n as createRedirectToMobileManagerFromActor, t as createRedirectToMobileManager } from "./redirectToMobileManager-
|
|
1
|
+
import { n as redirectToMobileMachine, r as defaultRedirectToMobileServices } from "./redirectToMobileStateMachine-CbhN8uVN.esm.js";
|
|
2
|
+
import { n as createRedirectToMobileManagerFromActor, t as createRedirectToMobileManager } from "./redirectToMobileManager-CgGaT2NP.esm.js";
|
|
3
3
|
export { createRedirectToMobileManager, createRedirectToMobileManagerFromActor, defaultRedirectToMobileServices, redirectToMobileMachine };
|
package/dist/{redirectToMobileManager-BJXC6Kx9.esm.js → redirectToMobileManager-CgGaT2NP.esm.js}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-
|
|
1
|
+
import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-ggpBBaZ8.esm.js";
|
|
2
2
|
import { t as BrowserTimerProvider } from "./BrowserTimerProvider-BXhgNxLt.esm.js";
|
|
3
3
|
import { s as createActor, u as createManager } from "./xstate.esm-DSajW7CJ.esm.js";
|
|
4
4
|
import { n as fromPromise, t as fromCallback } from "./xstate-actors.esm-8Gzepa_A.esm.js";
|
|
5
|
-
import { n as redirectToMobileMachine, r as defaultRedirectToMobileServices, t as canResendSmsFromContext } from "./redirectToMobileStateMachine-
|
|
5
|
+
import { n as redirectToMobileMachine, r as defaultRedirectToMobileServices, t as canResendSmsFromContext } from "./redirectToMobileStateMachine-CbhN8uVN.esm.js";
|
|
6
6
|
//#region src/modules/redirect-to-mobile/redirectToMobileActor.ts
|
|
7
7
|
const POLL_INTERVAL_MS = 5e3;
|
|
8
8
|
const QR_REFRESH_INTERVAL_MS = 5e3;
|
|
@@ -58,7 +58,7 @@ function mapState(snapshot) {
|
|
|
58
58
|
const typedSnapshot = snapshot;
|
|
59
59
|
const { context } = typedSnapshot;
|
|
60
60
|
if (typedSnapshot.matches("idle")) return { status: "idle" };
|
|
61
|
-
if (typedSnapshot.matches("generatingUrl")
|
|
61
|
+
if (typedSnapshot.matches("generatingUrl")) return { status: "loading" };
|
|
62
62
|
if (typedSnapshot.matches("showingQr")) return {
|
|
63
63
|
status: "redirecting",
|
|
64
64
|
redirectUrl: context.redirectUrl,
|