@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
package/dist/{FaceDetectionProvider-B83VmClw.esm.js → FaceDetectionProvider-D9PlON49.esm.js}
RENAMED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { l as wasmRuntime } from "./warmup-
|
|
2
|
-
import { t as ensureWasmPipelines } from "./setup-
|
|
3
|
-
import { r as BaseWasmProvider } from "./WasmUtilProvider-
|
|
4
|
-
import { t as api, u as endpoints } from "./api-
|
|
5
|
-
import { l as trueSightHintTransition, r as noteTrueSightCaptureActivity } from "./trueSightService-
|
|
6
|
-
import "./sessionInitializer-
|
|
7
|
-
import { t as addDeviceStats } from "./stats-
|
|
1
|
+
import { l as wasmRuntime } from "./warmup-DtB0DJpl.esm.js";
|
|
2
|
+
import { t as ensureWasmPipelines } from "./setup-D26WdmvA.esm.js";
|
|
3
|
+
import { r as BaseWasmProvider } from "./WasmUtilProvider-Dp2V-Uct.esm.js";
|
|
4
|
+
import { t as api, u as endpoints } from "./api-CpP4PS4S.esm.js";
|
|
5
|
+
import { l as trueSightHintTransition, r as noteTrueSightCaptureActivity } from "./trueSightService-OZl8wQu7.esm.js";
|
|
6
|
+
import "./sessionInitializer-CwJACl13.esm.js";
|
|
7
|
+
import { t as addDeviceStats } from "./stats-CatA2dea.esm.js";
|
|
8
8
|
import { t as IncodeCanvas } from "./canvas-BxFzWTt-.esm.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import "./deepsightService-twg3bXqY.esm.js";
|
|
9
|
+
import { t as StreamCanvasProcessingSession } from "./StreamCanvasProcessingSession-CBnbTnOr.esm.js";
|
|
10
|
+
import { r as hasBackCamera } from "./backCameraStream-DS1oDiUq.esm.js";
|
|
12
11
|
import { t as getDeviceClass } from "./getDeviceClass-DoIWuKI8.esm.js";
|
|
13
|
-
import { n as saveProcessFaceMatch } from "./processFaceMatch-
|
|
12
|
+
import { n as saveProcessFaceMatch } from "./processFaceMatch-Bst83HaS.esm.js";
|
|
14
13
|
//#region src/internal/faceCapture/onDeviceFaceResults.ts
|
|
15
14
|
/**
|
|
16
15
|
* On-device still-face capture is owned by the protected camera-cycle actor.
|
|
@@ -236,7 +235,7 @@ function startDetection(params) {
|
|
|
236
235
|
};
|
|
237
236
|
}
|
|
238
237
|
async function initializeDeepsightSession(options) {
|
|
239
|
-
const { loadDeepsightSession } = await import("./deepsightLoader-
|
|
238
|
+
const { loadDeepsightSession } = await import("./deepsightLoader-Crsj_u0c.esm.js");
|
|
240
239
|
return loadDeepsightSession({
|
|
241
240
|
ds: options.ds,
|
|
242
241
|
storage: options.storage
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { n as getMultipartRecorderMimeType } from "./mediaRecorderOptions-B9-IEVtV.esm.js";
|
|
2
|
+
//#region ../infra/src/providers/browser/MultipartRecordingProvider.ts
|
|
3
|
+
/**
|
|
4
|
+
* How often `MediaRecorder` hands us buffered data (incremental blobs).
|
|
5
|
+
* 500 ms keeps each blob — and therefore each upload chunk — small: less
|
|
6
|
+
* tail lost when a session is interrupted, and a smaller first blob (init
|
|
7
|
+
* header + keyframe), which is the largest and most timeout-prone chunk.
|
|
8
|
+
* Not lower: request rate doubles per halving, and browsers stop honoring
|
|
9
|
+
* very small timeslices reliably.
|
|
10
|
+
*/
|
|
11
|
+
const TIMESLICE_MS = 500;
|
|
12
|
+
/**
|
|
13
|
+
* Encoder target for the full video-selfie session. Higher than the
|
|
14
|
+
* short-clip liveness path (0.5–1 Mbps) so a multi-minute session keeps
|
|
15
|
+
* usable quality. It's a ceiling — a still scene still encodes well below it.
|
|
16
|
+
*/
|
|
17
|
+
const VIDEO_BITS_PER_SECOND = 25e5;
|
|
18
|
+
/**
|
|
19
|
+
* Records a stream and emits every `MediaRecorder` timeslice blob as its own
|
|
20
|
+
* part, in order. Each blob is a whole container fragment (WebM cluster /
|
|
21
|
+
* fMP4 `moof`+`mdat`), which is the property the video-selfie-service's
|
|
22
|
+
* gap-splicing depends on — parts must never cut a fragment at a byte
|
|
23
|
+
* offset. The service stages sub-5 MiB chunks and combines them server-side,
|
|
24
|
+
* so emitting the smallest whole-fragment unit (~0.5 s of video) maximizes
|
|
25
|
+
* what an interrupted session can salvage.
|
|
26
|
+
*
|
|
27
|
+
* Page-lifecycle orchestration lives in Core: it pauses this recorder before a
|
|
28
|
+
* backgrounded camera can stall, restores the camera/compositor, and only then
|
|
29
|
+
* resumes this same media container.
|
|
30
|
+
*/
|
|
31
|
+
var MultipartRecordingProvider = class {
|
|
32
|
+
constructor() {
|
|
33
|
+
this.mediaRecorder = null;
|
|
34
|
+
this._isRecording = false;
|
|
35
|
+
this._hasError = false;
|
|
36
|
+
this._error = null;
|
|
37
|
+
this.mimeType = "";
|
|
38
|
+
this.partNumber = 0;
|
|
39
|
+
this.onPart = null;
|
|
40
|
+
}
|
|
41
|
+
get isRecording() {
|
|
42
|
+
return this._isRecording;
|
|
43
|
+
}
|
|
44
|
+
get hasError() {
|
|
45
|
+
return this._hasError;
|
|
46
|
+
}
|
|
47
|
+
get error() {
|
|
48
|
+
return this._error;
|
|
49
|
+
}
|
|
50
|
+
startRecording(stream, onPart) {
|
|
51
|
+
this.reset();
|
|
52
|
+
this.partNumber = 0;
|
|
53
|
+
this.onPart = onPart;
|
|
54
|
+
try {
|
|
55
|
+
this.mimeType = getMultipartRecorderMimeType();
|
|
56
|
+
const recorder = new MediaRecorder(stream.clone(), {
|
|
57
|
+
mimeType: this.mimeType,
|
|
58
|
+
videoBitsPerSecond: VIDEO_BITS_PER_SECOND
|
|
59
|
+
});
|
|
60
|
+
recorder.ondataavailable = (event) => {
|
|
61
|
+
if (event.data.size > 0 && this.onPart) {
|
|
62
|
+
this.partNumber += 1;
|
|
63
|
+
this.onPart({
|
|
64
|
+
chunk: event.data,
|
|
65
|
+
partNumber: this.partNumber
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
recorder.onerror = (event) => {
|
|
70
|
+
const detail = event instanceof ErrorEvent && event.error instanceof Error ? event.error.message : event.type;
|
|
71
|
+
this._error = `Recording error: ${detail}`;
|
|
72
|
+
this._isRecording = false;
|
|
73
|
+
this._hasError = true;
|
|
74
|
+
};
|
|
75
|
+
recorder.start(TIMESLICE_MS);
|
|
76
|
+
this.mediaRecorder = recorder;
|
|
77
|
+
this._isRecording = true;
|
|
78
|
+
this._error = null;
|
|
79
|
+
this._hasError = false;
|
|
80
|
+
} catch (err) {
|
|
81
|
+
const detail = err instanceof Error ? err.message : String(err);
|
|
82
|
+
this._error = `Failed to start recording: ${detail}`;
|
|
83
|
+
this._hasError = true;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
pauseRecording() {
|
|
87
|
+
const recorder = this.mediaRecorder;
|
|
88
|
+
if (!recorder || !this._isRecording || this._hasError) return false;
|
|
89
|
+
if (recorder.state === "paused") return true;
|
|
90
|
+
if (recorder.state !== "recording") return false;
|
|
91
|
+
try {
|
|
92
|
+
recorder.pause();
|
|
93
|
+
return true;
|
|
94
|
+
} catch (err) {
|
|
95
|
+
const detail = err instanceof Error ? err.message : String(err);
|
|
96
|
+
this._error = `Failed to pause recording: ${detail}`;
|
|
97
|
+
this._hasError = true;
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
resumeRecording() {
|
|
102
|
+
const recorder = this.mediaRecorder;
|
|
103
|
+
if (!recorder || !this._isRecording || this._hasError) return false;
|
|
104
|
+
if (recorder.state === "recording") return true;
|
|
105
|
+
if (recorder.state !== "paused") return false;
|
|
106
|
+
try {
|
|
107
|
+
recorder.resume();
|
|
108
|
+
return true;
|
|
109
|
+
} catch (err) {
|
|
110
|
+
const detail = err instanceof Error ? err.message : String(err);
|
|
111
|
+
this._error = `Failed to resume recording: ${detail}`;
|
|
112
|
+
this._hasError = true;
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
stopRecording() {
|
|
117
|
+
const recorder = this.mediaRecorder;
|
|
118
|
+
return new Promise((resolve) => {
|
|
119
|
+
if (recorder && this._isRecording) {
|
|
120
|
+
recorder.onstop = () => {
|
|
121
|
+
resolve();
|
|
122
|
+
};
|
|
123
|
+
recorder.stop();
|
|
124
|
+
this._isRecording = false;
|
|
125
|
+
} else resolve();
|
|
126
|
+
recorder?.stream?.getTracks().forEach((track) => track.stop());
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
reset() {
|
|
130
|
+
const recorder = this.mediaRecorder;
|
|
131
|
+
if (recorder) {
|
|
132
|
+
recorder.ondataavailable = null;
|
|
133
|
+
recorder.onerror = null;
|
|
134
|
+
recorder.onstop = null;
|
|
135
|
+
if (recorder.state !== "inactive") recorder.stop();
|
|
136
|
+
recorder.stream.getTracks().forEach((track) => track.stop());
|
|
137
|
+
this.mediaRecorder = null;
|
|
138
|
+
}
|
|
139
|
+
this.onPart = null;
|
|
140
|
+
this._isRecording = false;
|
|
141
|
+
this._error = null;
|
|
142
|
+
this._hasError = false;
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
//#endregion
|
|
146
|
+
export { MultipartRecordingProvider as t };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
//#region ../infra/src/media/StreamCanvasProcessingSession.ts
|
|
2
|
+
var StreamCanvasProcessingSession = class {
|
|
3
|
+
/**
|
|
4
|
+
* Creates a processing session that reacts to `StreamCanvasCapture` frame events
|
|
5
|
+
* and drives a provider's `processFrame()` method with backpressure.
|
|
6
|
+
*/
|
|
7
|
+
constructor(params) {
|
|
8
|
+
this.disposed = false;
|
|
9
|
+
this.isProcessing = false;
|
|
10
|
+
this.onFrameEvent = () => {
|
|
11
|
+
if (this.disposed || this.isProcessing) return;
|
|
12
|
+
const frame = this.capturer.getLatestFrame();
|
|
13
|
+
if (!frame) return;
|
|
14
|
+
this.onFrame?.(frame);
|
|
15
|
+
this.isProcessing = true;
|
|
16
|
+
this.provider.processFrame(frame).catch(() => {}).finally(() => {
|
|
17
|
+
this.isProcessing = false;
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
this.capturer = params.capturer;
|
|
21
|
+
this.provider = params.provider;
|
|
22
|
+
this.onFrame = params.onFrame;
|
|
23
|
+
this.capturer.addEventListener("frame", this.onFrameEvent);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Unsubscribes from frame events and resets the provider.
|
|
27
|
+
*/
|
|
28
|
+
dispose() {
|
|
29
|
+
if (this.disposed) return;
|
|
30
|
+
this.disposed = true;
|
|
31
|
+
this.capturer.removeEventListener("frame", this.onFrameEvent);
|
|
32
|
+
this.provider.reset();
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Returns whether the session has been disposed.
|
|
36
|
+
*/
|
|
37
|
+
isDisposed() {
|
|
38
|
+
return this.disposed;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
//#endregion
|
|
42
|
+
export { StreamCanvasProcessingSession as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as __exportAll } from "./rolldown-runtime-B-1-B7_t.esm.js";
|
|
2
|
-
import { c as wasmCallWrapper, d as noteUnlockedCallStart, s as ML_CALL_MAX_POLLS, u as noteUnlockedCallEnd } from "./wasmWebClient-
|
|
3
|
-
import { i as isWasmReady, l as wasmRuntime, o as waitForWasm, r as getWasmStatus, s as warmupWasm } from "./warmup-
|
|
2
|
+
import { c as wasmCallWrapper, d as noteUnlockedCallStart, s as ML_CALL_MAX_POLLS, u as noteUnlockedCallEnd } from "./wasmWebClient-BDrax6Eu.esm.js";
|
|
3
|
+
import { i as isWasmReady, l as wasmRuntime, o as waitForWasm, r as getWasmStatus, s as warmupWasm } from "./warmup-DtB0DJpl.esm.js";
|
|
4
4
|
//#region ../infra/src/wasm/utilityWasmApi.ts
|
|
5
5
|
/**
|
|
6
6
|
* Utility / metadata domain facade over {@link WasmRuntime}.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { n as __exportAll } from "./rolldown-runtime-B-1-B7_t.esm.js";
|
|
2
|
+
import { t as MultipartRecordingProvider } from "./MultipartRecordingProvider-D9mauUdS.esm.js";
|
|
3
|
+
//#region ../infra/src/providers/browser/WorkerEncoderRecordingProvider.ts
|
|
4
|
+
var WorkerEncoderRecordingProvider_exports = /* @__PURE__ */ __exportAll({ WorkerEncoderRecordingProvider: () => WorkerEncoderRecordingProvider });
|
|
5
|
+
/**
|
|
6
|
+
* Multipart recorder for a `CameraCompositor` that encodes inside its worker
|
|
7
|
+
* (ENG-55397): emits the worker's WebM clusters as parts, in order. When the
|
|
8
|
+
* compositor could not start in-worker encoding (no insertable streams or
|
|
9
|
+
* WebCodecs, strict CSP), it records the composite stream with
|
|
10
|
+
* `MediaRecorder` instead, so callers wire it unconditionally.
|
|
11
|
+
*
|
|
12
|
+
* Why not always `MediaRecorder`: Chrome hands every recorded frame through
|
|
13
|
+
* the page main thread and drops frames while it is blocked. On a Galaxy A01
|
|
14
|
+
* Core the ID flow blocks it for 3–5 s (WASM + 1080p readbacks); a
|
|
15
|
+
* `MediaRecorder` fed by the worker kept 74 of 149 frames under 1.5 s
|
|
16
|
+
* freezes, the in-worker encoder 150 of 151.
|
|
17
|
+
*/
|
|
18
|
+
var WorkerEncoderRecordingProvider = class {
|
|
19
|
+
constructor(compositor) {
|
|
20
|
+
this.compositor = compositor;
|
|
21
|
+
this._isRecording = false;
|
|
22
|
+
this._error = null;
|
|
23
|
+
this.partNumber = 0;
|
|
24
|
+
this.fallback = null;
|
|
25
|
+
}
|
|
26
|
+
get isRecording() {
|
|
27
|
+
return this.fallback ? this.fallback.isRecording : this._isRecording;
|
|
28
|
+
}
|
|
29
|
+
get hasError() {
|
|
30
|
+
return this.error !== null;
|
|
31
|
+
}
|
|
32
|
+
get error() {
|
|
33
|
+
if (this.fallback) return this.fallback.error;
|
|
34
|
+
return this._error ?? this.compositor.workerRecordingErrorMessage;
|
|
35
|
+
}
|
|
36
|
+
startRecording(stream, onPart) {
|
|
37
|
+
this.reset();
|
|
38
|
+
if (!this.compositor.encodesInWorker) {
|
|
39
|
+
this.fallback = new MultipartRecordingProvider();
|
|
40
|
+
this.fallback.startRecording(stream, onPart);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
this.partNumber = 0;
|
|
44
|
+
const started = this.compositor.startWorkerRecording((chunk) => {
|
|
45
|
+
this.partNumber += 1;
|
|
46
|
+
onPart({
|
|
47
|
+
chunk,
|
|
48
|
+
partNumber: this.partNumber
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
this._isRecording = started;
|
|
52
|
+
this._error = started ? null : "Failed to start recording: no encoder";
|
|
53
|
+
}
|
|
54
|
+
pauseRecording() {
|
|
55
|
+
if (this.fallback) return this.fallback.pauseRecording();
|
|
56
|
+
return this._isRecording && this.compositor.pauseWorkerRecording();
|
|
57
|
+
}
|
|
58
|
+
resumeRecording() {
|
|
59
|
+
if (this.fallback) return this.fallback.resumeRecording();
|
|
60
|
+
return this._isRecording && this.compositor.resumeWorkerRecording();
|
|
61
|
+
}
|
|
62
|
+
async stopRecording() {
|
|
63
|
+
if (this.fallback) {
|
|
64
|
+
await this.fallback.stopRecording();
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (!this._isRecording) return;
|
|
68
|
+
this._isRecording = false;
|
|
69
|
+
await this.compositor.stopWorkerRecording();
|
|
70
|
+
}
|
|
71
|
+
reset() {
|
|
72
|
+
this.fallback?.reset();
|
|
73
|
+
this.fallback = null;
|
|
74
|
+
this.compositor.cancelWorkerRecording();
|
|
75
|
+
this._isRecording = false;
|
|
76
|
+
this._error = null;
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
//#endregion
|
|
80
|
+
export { WorkerEncoderRecordingProvider_exports as n, WorkerEncoderRecordingProvider as t };
|
|
@@ -1,214 +1,6 @@
|
|
|
1
|
-
import { t as api, u as endpoints } from "./api-
|
|
1
|
+
import { t as api, u as endpoints } from "./api-CpP4PS4S.esm.js";
|
|
2
2
|
import { t as BrowserTimerProvider } from "./BrowserTimerProvider-BXhgNxLt.esm.js";
|
|
3
3
|
import { t as fromCallback } from "./xstate-actors.esm-8Gzepa_A.esm.js";
|
|
4
|
-
//#region src/shared/usStates.ts
|
|
5
|
-
const usStates = {
|
|
6
|
-
AL: {
|
|
7
|
-
code: "AL",
|
|
8
|
-
name: "Alabama"
|
|
9
|
-
},
|
|
10
|
-
AK: {
|
|
11
|
-
code: "AK",
|
|
12
|
-
name: "Alaska"
|
|
13
|
-
},
|
|
14
|
-
AZ: {
|
|
15
|
-
code: "AZ",
|
|
16
|
-
name: "Arizona"
|
|
17
|
-
},
|
|
18
|
-
AR: {
|
|
19
|
-
code: "AR",
|
|
20
|
-
name: "Arkansas"
|
|
21
|
-
},
|
|
22
|
-
CA: {
|
|
23
|
-
code: "CA",
|
|
24
|
-
name: "California"
|
|
25
|
-
},
|
|
26
|
-
CO: {
|
|
27
|
-
code: "CO",
|
|
28
|
-
name: "Colorado"
|
|
29
|
-
},
|
|
30
|
-
CT: {
|
|
31
|
-
code: "CT",
|
|
32
|
-
name: "Connecticut"
|
|
33
|
-
},
|
|
34
|
-
DE: {
|
|
35
|
-
code: "DE",
|
|
36
|
-
name: "Delaware"
|
|
37
|
-
},
|
|
38
|
-
FL: {
|
|
39
|
-
code: "FL",
|
|
40
|
-
name: "Florida"
|
|
41
|
-
},
|
|
42
|
-
GA: {
|
|
43
|
-
code: "GA",
|
|
44
|
-
name: "Georgia"
|
|
45
|
-
},
|
|
46
|
-
HI: {
|
|
47
|
-
code: "HI",
|
|
48
|
-
name: "Hawaii"
|
|
49
|
-
},
|
|
50
|
-
ID: {
|
|
51
|
-
code: "ID",
|
|
52
|
-
name: "Idaho"
|
|
53
|
-
},
|
|
54
|
-
IL: {
|
|
55
|
-
code: "IL",
|
|
56
|
-
name: "Illinois"
|
|
57
|
-
},
|
|
58
|
-
IN: {
|
|
59
|
-
code: "IN",
|
|
60
|
-
name: "Indiana"
|
|
61
|
-
},
|
|
62
|
-
IA: {
|
|
63
|
-
code: "IA",
|
|
64
|
-
name: "Iowa"
|
|
65
|
-
},
|
|
66
|
-
KS: {
|
|
67
|
-
code: "KS",
|
|
68
|
-
name: "Kansas"
|
|
69
|
-
},
|
|
70
|
-
KY: {
|
|
71
|
-
code: "KY",
|
|
72
|
-
name: "Kentucky"
|
|
73
|
-
},
|
|
74
|
-
LA: {
|
|
75
|
-
code: "LA",
|
|
76
|
-
name: "Louisiana"
|
|
77
|
-
},
|
|
78
|
-
ME: {
|
|
79
|
-
code: "ME",
|
|
80
|
-
name: "Maine"
|
|
81
|
-
},
|
|
82
|
-
MD: {
|
|
83
|
-
code: "MD",
|
|
84
|
-
name: "Maryland"
|
|
85
|
-
},
|
|
86
|
-
MA: {
|
|
87
|
-
code: "MA",
|
|
88
|
-
name: "Massachusetts"
|
|
89
|
-
},
|
|
90
|
-
MI: {
|
|
91
|
-
code: "MI",
|
|
92
|
-
name: "Michigan"
|
|
93
|
-
},
|
|
94
|
-
MN: {
|
|
95
|
-
code: "MN",
|
|
96
|
-
name: "Minnesota"
|
|
97
|
-
},
|
|
98
|
-
MS: {
|
|
99
|
-
code: "MS",
|
|
100
|
-
name: "Mississippi"
|
|
101
|
-
},
|
|
102
|
-
MO: {
|
|
103
|
-
code: "MO",
|
|
104
|
-
name: "Missouri"
|
|
105
|
-
},
|
|
106
|
-
MT: {
|
|
107
|
-
code: "MT",
|
|
108
|
-
name: "Montana"
|
|
109
|
-
},
|
|
110
|
-
NE: {
|
|
111
|
-
code: "NE",
|
|
112
|
-
name: "Nebraska"
|
|
113
|
-
},
|
|
114
|
-
NV: {
|
|
115
|
-
code: "NV",
|
|
116
|
-
name: "Nevada"
|
|
117
|
-
},
|
|
118
|
-
NH: {
|
|
119
|
-
code: "NH",
|
|
120
|
-
name: "New Hampshire"
|
|
121
|
-
},
|
|
122
|
-
NJ: {
|
|
123
|
-
code: "NJ",
|
|
124
|
-
name: "New Jersey"
|
|
125
|
-
},
|
|
126
|
-
NM: {
|
|
127
|
-
code: "NM",
|
|
128
|
-
name: "New Mexico"
|
|
129
|
-
},
|
|
130
|
-
NY: {
|
|
131
|
-
code: "NY",
|
|
132
|
-
name: "New York"
|
|
133
|
-
},
|
|
134
|
-
NC: {
|
|
135
|
-
code: "NC",
|
|
136
|
-
name: "North Carolina"
|
|
137
|
-
},
|
|
138
|
-
ND: {
|
|
139
|
-
code: "ND",
|
|
140
|
-
name: "North Dakota"
|
|
141
|
-
},
|
|
142
|
-
OH: {
|
|
143
|
-
code: "OH",
|
|
144
|
-
name: "Ohio"
|
|
145
|
-
},
|
|
146
|
-
OK: {
|
|
147
|
-
code: "OK",
|
|
148
|
-
name: "Oklahoma"
|
|
149
|
-
},
|
|
150
|
-
OR: {
|
|
151
|
-
code: "OR",
|
|
152
|
-
name: "Oregon"
|
|
153
|
-
},
|
|
154
|
-
PA: {
|
|
155
|
-
code: "PA",
|
|
156
|
-
name: "Pennsylvania"
|
|
157
|
-
},
|
|
158
|
-
RI: {
|
|
159
|
-
code: "RI",
|
|
160
|
-
name: "Rhode Island"
|
|
161
|
-
},
|
|
162
|
-
SC: {
|
|
163
|
-
code: "SC",
|
|
164
|
-
name: "South Carolina"
|
|
165
|
-
},
|
|
166
|
-
SD: {
|
|
167
|
-
code: "SD",
|
|
168
|
-
name: "South Dakota"
|
|
169
|
-
},
|
|
170
|
-
TN: {
|
|
171
|
-
code: "TN",
|
|
172
|
-
name: "Tennessee"
|
|
173
|
-
},
|
|
174
|
-
TX: {
|
|
175
|
-
code: "TX",
|
|
176
|
-
name: "Texas"
|
|
177
|
-
},
|
|
178
|
-
UT: {
|
|
179
|
-
code: "UT",
|
|
180
|
-
name: "Utah"
|
|
181
|
-
},
|
|
182
|
-
VT: {
|
|
183
|
-
code: "VT",
|
|
184
|
-
name: "Vermont"
|
|
185
|
-
},
|
|
186
|
-
VA: {
|
|
187
|
-
code: "VA",
|
|
188
|
-
name: "Virginia"
|
|
189
|
-
},
|
|
190
|
-
WA: {
|
|
191
|
-
code: "WA",
|
|
192
|
-
name: "Washington"
|
|
193
|
-
},
|
|
194
|
-
WV: {
|
|
195
|
-
code: "WV",
|
|
196
|
-
name: "West Virginia"
|
|
197
|
-
},
|
|
198
|
-
WI: {
|
|
199
|
-
code: "WI",
|
|
200
|
-
name: "Wisconsin"
|
|
201
|
-
},
|
|
202
|
-
WY: {
|
|
203
|
-
code: "WY",
|
|
204
|
-
name: "Wyoming"
|
|
205
|
-
}
|
|
206
|
-
};
|
|
207
|
-
const usStateOptions = Object.values(usStates).map((state) => ({
|
|
208
|
-
value: state.code,
|
|
209
|
-
label: state.name
|
|
210
|
-
}));
|
|
211
|
-
//#endregion
|
|
212
4
|
//#region src/shared/addressSuggestion.ts
|
|
213
5
|
/** Shown when an autocomplete suggestion has no street (city/region-level result). */
|
|
214
6
|
const STREET_LEVEL_REQUIRED_ERROR = { key: "verification.errors.streetLevelRequired" };
|
|
@@ -263,9 +55,6 @@ function buildStreetValue(street, houseNumber, hasHouseNoField) {
|
|
|
263
55
|
if (houseNumber && street) return `${houseNumber} ${street}`;
|
|
264
56
|
return houseNumber ?? street ?? "";
|
|
265
57
|
}
|
|
266
|
-
//#endregion
|
|
267
|
-
//#region src/shared/displayErrors.ts
|
|
268
|
-
const DYNAMIC_REQUIRED_KEY = "verification.errors.fieldRequiredDynamic";
|
|
269
58
|
const POSTAL_CODE_MAX_LENGTH_BY_COUNTRY = {
|
|
270
59
|
US: 10,
|
|
271
60
|
BR: 9,
|
|
@@ -383,98 +172,6 @@ function formatPostalCode(value, country) {
|
|
|
383
172
|
return value.slice(0, 8);
|
|
384
173
|
}
|
|
385
174
|
//#endregion
|
|
386
|
-
//#region src/internal/forms/checkSupport.ts
|
|
387
|
-
const GROUP_POLICIES = /* @__PURE__ */ new Set(["hide", "forceShow"]);
|
|
388
|
-
/**
|
|
389
|
-
* Compares `major.minor` vocabulary versions. The compiler's twin is
|
|
390
|
-
* `compareVersions` in `packages/form-definitions/scripts/lib/checks.mjs`;
|
|
391
|
-
* both are tested against that package's `fixtures/vocabularyVersions.json`.
|
|
392
|
-
*/
|
|
393
|
-
function compareVocabulary(a, b) {
|
|
394
|
-
const [aMajor = 0, aMinor = 0] = a.split(".").map(Number);
|
|
395
|
-
const [bMajor = 0, bMinor = 0] = b.split(".").map(Number);
|
|
396
|
-
return aMajor - bMajor || aMinor - bMinor;
|
|
397
|
-
}
|
|
398
|
-
/**
|
|
399
|
-
* Whether this build can use a definition. Any id it doesn't implement makes
|
|
400
|
-
* the definition unsupported, so the caller falls back to its bundled
|
|
401
|
-
* definition or current form. Presentation hints (widget, keyboard, autofill)
|
|
402
|
-
* never fail: an unknown hint falls back to the platform default.
|
|
403
|
-
*/
|
|
404
|
-
function checkSupport(definition, ids) {
|
|
405
|
-
const problems = [];
|
|
406
|
-
const need = (category, known, id, path) => {
|
|
407
|
-
if (!known.has(id)) problems.push({
|
|
408
|
-
category,
|
|
409
|
-
id,
|
|
410
|
-
path
|
|
411
|
-
});
|
|
412
|
-
};
|
|
413
|
-
if (!ids.schemaVersions.includes(definition.schemaVersion)) problems.push({
|
|
414
|
-
category: "schemaVersion",
|
|
415
|
-
id: String(definition.schemaVersion),
|
|
416
|
-
path: "schemaVersion"
|
|
417
|
-
});
|
|
418
|
-
if (compareVocabulary(definition.vocabulary, ids.vocabulary) > 0) problems.push({
|
|
419
|
-
category: "vocabulary",
|
|
420
|
-
id: definition.vocabulary,
|
|
421
|
-
path: "vocabulary"
|
|
422
|
-
});
|
|
423
|
-
const checkField = (field, path) => {
|
|
424
|
-
need("kind", ids.kinds, field.kind, `${path}.kind`);
|
|
425
|
-
need("group", ids.groups, field.group, `${path}.group`);
|
|
426
|
-
field.rules?.forEach((rule, i) => need("rule", ids.rules, rule.id, `${path}.rules[${i}]`));
|
|
427
|
-
field.input?.format?.forEach((t, i) => need("transform", ids.transforms, t.id, `${path}.input.format[${i}]`));
|
|
428
|
-
field.payload?.transforms?.forEach((t, i) => need("transform", ids.transforms, t.id, `${path}.payload.transforms[${i}]`));
|
|
429
|
-
if (field.optionsRef) need("optionList", ids.optionLists, field.optionsRef, `${path}.optionsRef`);
|
|
430
|
-
if (field.suggestionsRef) need("optionList", ids.optionLists, field.suggestionsRef, `${path}.suggestionsRef`);
|
|
431
|
-
field.requiredWhen?.forEach((condition, i) => {
|
|
432
|
-
const keys = Object.keys(condition);
|
|
433
|
-
if (keys.length !== 1) problems.push({
|
|
434
|
-
category: "condition",
|
|
435
|
-
id: keys.join("+") || "(empty)",
|
|
436
|
-
path: `${path}.requiredWhen[${i}]`
|
|
437
|
-
});
|
|
438
|
-
for (const key of keys) need("condition", ids.conditions, key, `${path}.requiredWhen[${i}]`);
|
|
439
|
-
});
|
|
440
|
-
field.prefill?.forEach((id, i) => need("prefillSource", ids.prefillSources, id, `${path}.prefill[${i}]`));
|
|
441
|
-
const lock = field.phone?.lockCountry;
|
|
442
|
-
if (typeof lock === "string" && lock !== "whenPhoneRisk") problems.push({
|
|
443
|
-
category: "phoneLock",
|
|
444
|
-
id: lock,
|
|
445
|
-
path: `${path}.phone`
|
|
446
|
-
});
|
|
447
|
-
};
|
|
448
|
-
definition.fields.forEach((field) => checkField(field, `fields.${field.name}`));
|
|
449
|
-
definition.groups?.forEach((policy) => {
|
|
450
|
-
need("group", ids.groups, policy.group, `groups.${policy.group}`);
|
|
451
|
-
if (!GROUP_POLICIES.has(policy.whenDisabled)) problems.push({
|
|
452
|
-
category: "groupPolicy",
|
|
453
|
-
id: policy.whenDisabled,
|
|
454
|
-
path: `groups.${policy.group}`
|
|
455
|
-
});
|
|
456
|
-
});
|
|
457
|
-
definition.groupRules?.forEach((rule, i) => {
|
|
458
|
-
need("groupRule", ids.groupRules, rule.id, `groupRules[${i}]`);
|
|
459
|
-
const cases = rule.id === "rulesByOption" ? rule.params?.cases : void 0;
|
|
460
|
-
if (cases && typeof cases === "object" && !Array.isArray(cases)) for (const [value, rules] of Object.entries(cases)) {
|
|
461
|
-
if (!Array.isArray(rules)) continue;
|
|
462
|
-
rules.forEach((ref, j) => {
|
|
463
|
-
const id = ref?.id;
|
|
464
|
-
need("rule", ids.rules, typeof id === "string" ? id : "(missing)", `groupRules[${i}].params.cases.${value}[${j}]`);
|
|
465
|
-
});
|
|
466
|
-
}
|
|
467
|
-
});
|
|
468
|
-
definition.collections?.forEach((collection) => {
|
|
469
|
-
need("group", ids.groups, collection.group, `collections.${collection.id}`);
|
|
470
|
-
collection.fields.forEach((field) => checkField(field, `collections.${collection.id}.fields.${field.name}`));
|
|
471
|
-
});
|
|
472
|
-
return problems.length === 0 ? { supported: true } : {
|
|
473
|
-
supported: false,
|
|
474
|
-
problems
|
|
475
|
-
};
|
|
476
|
-
}
|
|
477
|
-
//#endregion
|
|
478
175
|
//#region src/internal/forms/definitionSource.ts
|
|
479
176
|
const queryKey = ({ module, source, country }) => `${module}|${source ?? ""}|${country ?? ""}`;
|
|
480
177
|
/**
|
|
@@ -486,53 +183,6 @@ function createBundledDefinitionSource(definitions) {
|
|
|
486
183
|
return { select: (query) => byQuery.get(queryKey(query)) };
|
|
487
184
|
}
|
|
488
185
|
//#endregion
|
|
489
|
-
//#region src/internal/forms/resolveForm.ts
|
|
490
|
-
const FORCE_SHOW = "forceShow";
|
|
491
|
-
const WHEN_PHONE_RISK = "whenPhoneRisk";
|
|
492
|
-
/**
|
|
493
|
-
* Resolves a definition against module configuration: which fields show,
|
|
494
|
-
* which are required, whether the phone is locked, and which group rules and
|
|
495
|
-
* collections apply. Pure and synchronous, so it runs inside an assign action.
|
|
496
|
-
*
|
|
497
|
-
* Call `checkSupport` first for any definition that wasn't bundled with this
|
|
498
|
-
* build; `resolveForm` ignores ids it doesn't know.
|
|
499
|
-
*/
|
|
500
|
-
function resolveForm(definition, context) {
|
|
501
|
-
const forcedGroups = new Set((definition.groups ?? []).filter((policy) => policy.whenDisabled === FORCE_SHOW).map((policy) => policy.group));
|
|
502
|
-
const isOn = (group) => context.groups[group] === true;
|
|
503
|
-
const isShown = (group) => isOn(group) || forcedGroups.has(group);
|
|
504
|
-
const riskAddons = new Set(context.riskAddons ?? []);
|
|
505
|
-
const shownFields = definition.fields.filter((field) => isShown(field.group));
|
|
506
|
-
const shownNames = new Set(shownFields.map((field) => field.name));
|
|
507
|
-
const fields = shownFields.map((field) => {
|
|
508
|
-
const conditions = field.requiredWhen ?? [];
|
|
509
|
-
const addonRequired = conditions.some((condition) => condition.riskAddon !== void 0 && riskAddons.has(condition.riskAddon));
|
|
510
|
-
const requiredIfFilled = conditions.map((condition) => condition.fieldFilled).filter((name) => name !== void 0 && shownNames.has(name));
|
|
511
|
-
const lock = field.phone?.lockCountry;
|
|
512
|
-
return {
|
|
513
|
-
field,
|
|
514
|
-
required: field.required === true || addonRequired,
|
|
515
|
-
requiredIfFilled,
|
|
516
|
-
forced: !isOn(field.group),
|
|
517
|
-
phoneLocked: field.kind === "phone" && (lock === true || lock === WHEN_PHONE_RISK && context.phoneRisk === true)
|
|
518
|
-
};
|
|
519
|
-
});
|
|
520
|
-
const order = shownFields.map((field) => field.name);
|
|
521
|
-
return {
|
|
522
|
-
definition,
|
|
523
|
-
fields,
|
|
524
|
-
groupRules: (definition.groupRules ?? []).map((rule) => ({
|
|
525
|
-
rule,
|
|
526
|
-
fields: order.filter((name) => rule.fields.includes(name))
|
|
527
|
-
})).filter((resolved) => resolved.fields.length > 0),
|
|
528
|
-
collections: (definition.collections ?? []).filter((collection) => isShown(collection.group)).map((collection) => ({
|
|
529
|
-
collection,
|
|
530
|
-
min: collection.min ?? 0,
|
|
531
|
-
max: collection.max
|
|
532
|
-
}))
|
|
533
|
-
};
|
|
534
|
-
}
|
|
535
|
-
//#endregion
|
|
536
186
|
//#region src/internal/formDefinitionsRollout/formDefinitionsRollout.ts
|
|
537
187
|
/**
|
|
538
188
|
* The rollout switch for form definitions (ENG-59781): one all-or-nothing
|
|
@@ -601,4 +251,4 @@ const debounceSearchActor = fromCallback(({ input, sendBack }) => {
|
|
|
601
251
|
};
|
|
602
252
|
});
|
|
603
253
|
//#endregion
|
|
604
|
-
export {
|
|
254
|
+
export { FIXED_DIGIT_POSTAL_CODE_LENGTH as a, getPostalCodeMaxLength as c, fillFromSuggestion as d, getStreetLevelErrorForSuggestion as f, createBundledDefinitionSource as i, validatePostalCode as l, searchAddress as n, formatPostalCode as o, isFormDefinitionsEnabled as r, getPostalCodeErrorKey as s, debounceSearchActor as t, STREET_LEVEL_REQUIRED_ERROR as u };
|