@incodetech/core 2.0.1-rc.0 → 2.1.0-rc.0
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/{BrowserStorageProvider-CuOW1Er2.esm.js → BrowserStorageProvider-BpJM-gIl.esm.js} +8 -1
- package/dist/{IpifyProvider-D7jx52AL.esm.js → IpifyProvider-D4LWD15E.esm.js} +28 -0
- package/dist/{MotionSensorProvider-4v7xkqAp.esm.js → MotionSensorProvider-Bx7Mpzt0.esm.js} +63 -13
- package/dist/{OpenViduRecordingProvider-CMu6XVdc.esm.js → OpenViduRecordingProvider-O4GjBseO.esm.js} +1 -1
- package/dist/StateMachine-BC_nGvrc.d.ts +2 -0
- package/dist/StreamCanvasCapture-ImiDQdVA.esm.js +118 -0
- package/dist/StreamCanvasCapture-yyl20qd9.d.ts +152 -0
- package/dist/{BaseWasmProvider-C_DLEI40.esm.js → WasmUtilProvider-CiEN7Gjn.esm.js} +183 -11
- package/dist/{addressSearch-BpTbTWCa.esm.js → addressSearch-DvmWXKZg.esm.js} +63 -57
- package/dist/{ae-signature-DDDZmWXj.esm.js → ae-signature-BFZta3TZ.esm.js} +1 -1
- package/dist/ae-signature.d.ts +3 -3
- package/dist/ae-signature.esm.js +6 -5
- package/dist/antifraud.d.ts +5 -46
- package/dist/antifraud.esm.js +6 -43
- package/dist/antifraudManager-CkV4u-LE.esm.js +55 -0
- package/dist/antifraudManager-CznnhyvD.d.ts +63 -0
- package/dist/{antifraudStateMachine-O0TMf6yc.esm.js → antifraudStateMachine-Ccrb-Jxc.esm.js} +2 -2
- package/dist/apiError-B-j-gyDx.esm.js +51 -0
- package/dist/authentication.d.ts +13 -11
- package/dist/authentication.esm.js +26 -22
- package/dist/{authenticationManager-C83GNIhl.d.ts → authenticationManager-CIVY80H9.d.ts} +4 -4
- package/dist/{authenticationManager-5M-fKzXx.esm.js → authenticationManager-ZNotsWnC.esm.js} +6 -6
- package/dist/{authenticationStateMachine-BMZqatiF.esm.js → authenticationStateMachine-DksVbF_H.esm.js} +21 -9
- package/dist/{backCameraStream-DMdMeGk2.esm.js → backCameraStream-D7Wo4Nbx.esm.js} +95 -7
- package/dist/{session-CGtQJJzB.esm.js → browserSimulation-B1dWiXp7.esm.js} +61 -476
- package/dist/camera.d.ts +4 -3
- package/dist/camera.esm.js +4 -3
- package/dist/canvas-SKcRBxsk.esm.js +230 -0
- package/dist/consent.d.ts +4 -398
- package/dist/consent.esm.js +6 -77
- package/dist/consentManager-BLd51QiW.d.ts +419 -0
- package/dist/consentManager-BYo9Nu1r.esm.js +90 -0
- package/dist/{consentStateMachine-CCT-B60O.esm.js → consentStateMachine-BG3yL8aC.esm.js} +9 -6
- package/dist/cpf-ocr.d.ts +4 -199
- package/dist/cpf-ocr.esm.js +8 -177
- package/dist/cpfOcrManager-BnieFXuG.d.ts +216 -0
- package/dist/cpfOcrManager-sSKegxox.esm.js +190 -0
- package/dist/cross-document-data-match.d.ts +1 -1
- package/dist/cross-document-data-match.esm.js +4 -4
- package/dist/curp-validation.d.ts +8 -158
- package/dist/curp-validation.esm.js +6 -108
- package/dist/curpValidationManager-CFem6zP9.esm.js +122 -0
- package/dist/curpValidationManager-RttixpIc.d.ts +184 -0
- package/dist/{curpValidationStateMachine-CitWLr2c.esm.js → curpValidationStateMachine-B7V_qp66.esm.js} +20 -13
- package/dist/custom-fields.d.ts +2 -2
- package/dist/custom-fields.esm.js +4 -4
- package/dist/custom-watchlist.d.ts +1 -1
- package/dist/custom-watchlist.esm.js +4 -41
- package/dist/customWatchlistStateMachine-HmFybXLX.esm.js +50 -0
- package/dist/{deepsightLoader-Cm4JIT_z.esm.js → deepsightLoader-65k1Appi.esm.js} +19 -10
- package/dist/{deepsightService-CEVxzehb.d.ts → deepsightService-B7ShOkWL.d.ts} +8 -160
- package/dist/deepsightService-CrHmvx8X.esm.js +276 -0
- package/dist/device.esm.js +4 -3
- package/dist/document-capture.d.ts +992 -83
- package/dist/document-capture.esm.js +34 -8
- package/dist/document-upload.d.ts +47 -47
- package/dist/document-upload.esm.js +7 -7
- package/dist/{documentCaptureStateMachine-BqzTDy9k.esm.js → documentCaptureStateMachine-WYV1r9le.esm.js} +90 -6
- package/dist/dynamic-forms.d.ts +20 -5
- package/dist/dynamic-forms.esm.js +150 -61
- package/dist/ekyb.d.ts +32 -13
- package/dist/ekyb.esm.js +25 -15
- package/dist/{ekybStateMachine-BR2let5f.esm.js → ekybStateMachine-aYixw2sL.esm.js} +319 -207
- package/dist/ekyc.d.ts +10 -78
- package/dist/ekyc.esm.js +17 -12
- package/dist/{ekycStateMachine-oeO0Iekd.esm.js → ekycStateMachine-CXbpaJJn.esm.js} +201 -113
- package/dist/electronic-signature.d.ts +3 -3
- package/dist/electronic-signature.esm.js +5 -4
- package/dist/{electronicSignatureManager-D9OHzTpG.esm.js → electronicSignatureManager-BaECdJ1u.esm.js} +91 -23
- package/dist/email.d.ts +4 -3
- package/dist/email.esm.js +6 -5
- package/dist/{emailManager-wAV0LE-H.esm.js → emailManager--D5G3ChB.esm.js} +30 -7
- package/dist/{emailManager-DIfnS5g1.d.ts → emailManager-lAzDoQOs.d.ts} +66 -8
- package/dist/{emailStateMachine-DOf4j58N.esm.js → emailStateMachine-CxTOMAjC.esm.js} +46 -11
- package/dist/{endpoints-CnN3SyDa.esm.js → endpoints-BeTK0Mlt.esm.js} +6 -3
- package/dist/{events-D6-e4vok.esm.js → events-Dvvriq9l.esm.js} +3 -1
- package/dist/events.d.ts +2 -0
- package/dist/events.esm.js +1 -1
- package/dist/extensibility.d.ts +32 -16
- package/dist/extensibility.esm.js +55 -33
- package/dist/face-match.d.ts +32 -2
- package/dist/face-match.esm.js +5 -5
- package/dist/{faceCaptureManagerFactory-yqtpxjnN.d.ts → faceCaptureManagerFactory-C_hRHx8a.d.ts} +35 -11
- package/dist/{faceCaptureManagerFactory-Dh2PdGlF.esm.js → faceCaptureManagerFactory-kqbUqtrr.esm.js} +21 -5
- package/dist/{faceCaptureSetup-B3faSpYA.esm.js → faceCaptureSetup-CtvHWd3x.esm.js} +68 -183
- package/dist/{faceMatchStateMachine-DNFrxTFS.esm.js → faceMatchStateMachine-DdGXUBnx.esm.js} +60 -6
- package/dist/field-comparison.d.ts +4 -0
- package/dist/field-comparison.esm.js +7 -0
- package/dist/fieldComparisonManager-Bu5TaSr3.d.ts +76 -0
- package/dist/fieldComparisonManager-COGI2ARD.esm.js +162 -0
- package/dist/fiscal-qr.d.ts +59 -0
- package/dist/fiscal-qr.esm.js +323 -0
- package/dist/flow-events.d.ts +6 -5
- package/dist/flow.d.ts +23 -15
- package/dist/flow.esm.js +63 -17
- package/dist/flowCompletionService-BdR2cGgB.d.ts +19 -0
- package/dist/flowCompletionService-DdGojV9K.esm.js +20 -0
- package/dist/{flowServices-DG3IdWw6.esm.js → flowServices-BTuHLHVr.esm.js} +10 -5
- package/dist/geolocation.d.ts +4 -4
- package/dist/geolocation.esm.js +6 -6
- package/dist/{geolocationStateMachine-asasuHY2.esm.js → geolocationStateMachine-Dvh7X0wF.esm.js} +5 -5
- package/dist/getBrowser-C8DP7oTB.esm.js +8 -0
- package/dist/{getBrowser-BSXUTWXw.esm.js → getDeviceClass-C0olyNFS.esm.js} +1 -8
- package/dist/{getDeviceClass-BSntT9_j.esm.js → getDeviceClass-C8Do2qYu.esm.js} +1 -1
- package/dist/government-validation.d.ts +28 -8
- package/dist/government-validation.esm.js +19 -8
- package/dist/{governmentValidationStateMachine-BDDYrJTo.esm.js → governmentValidationStateMachine-DcJ-BfsC.esm.js} +35 -77
- package/dist/home.d.ts +15 -14
- package/dist/home.esm.js +2 -2
- package/dist/http-Cai3IoLS.esm.js +0 -0
- package/dist/http.esm.js +1 -0
- package/dist/id-ocr.d.ts +54 -54
- package/dist/id-ocr.esm.js +5 -5
- package/dist/id-verification.d.ts +27 -27
- package/dist/id-verification.esm.js +4 -4
- package/dist/id.d.ts +12 -10
- package/dist/id.esm.js +36 -26
- package/dist/{idCaptureManager-Fyd0eam-.d.ts → idCaptureManager-D-QYESvF.d.ts} +28 -14
- package/dist/{idCaptureManager-ZPkD7Gjk.esm.js → idCaptureManager-DGVv5l1_.esm.js} +22 -7
- package/dist/{idCaptureStateMachine-BK0bPHoc.esm.js → idCaptureStateMachine-DHi7HydI.esm.js} +172 -123
- package/dist/{idOcrStateMachine-YbjjC_Gg.esm.js → idOcrStateMachine-CDQ5d_VM.esm.js} +4 -4
- package/dist/{idVerificationStateMachine-xbw9HP1Z.esm.js → idVerificationStateMachine-kRxwImzO.esm.js} +2 -2
- package/dist/identity-reuse.d.ts +4 -530
- package/dist/identity-reuse.esm.js +8 -274
- package/dist/identityReuseManager-C6n_97dw.esm.js +95 -0
- package/dist/identityReuseManager-DwLtVzUn.d.ts +428 -0
- package/dist/identityReuseStateMachine-BfE5YiEr.esm.js +148 -0
- package/dist/{index-BcRG8rtJ.d.ts → index-B5hPA0Bg.d.ts} +2 -2
- package/dist/{index-DZoqeAo9.d.ts → index-B9NysVDB.d.ts} +469 -195
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +10 -8
- package/dist/{invokeOnCaptureCallback-rc6kBHo5.esm.js → invokeOnCaptureCallback-ygByVdnn.esm.js} +1 -1
- package/dist/{lib-BB0B_qQX.esm.js → lib-BY67lgbq.esm.js} +1 -1
- package/dist/mandatory-consent.d.ts +8 -412
- package/dist/mandatory-consent.esm.js +6 -76
- package/dist/mandatoryConsentManager-H6D18cZB.esm.js +89 -0
- package/dist/mandatoryConsentManager-KfIlURRY.d.ts +429 -0
- package/dist/{mandatoryConsentStateMachine-Cnco1jvn.esm.js → mandatoryConsentStateMachine-DtQNW1ji.esm.js} +6 -6
- package/dist/openviduLazy-B8L--0oe.esm.js +3 -0
- package/dist/{openviduLazy-Cok70ZSg.esm.js → openviduLazy-Dh14JNJc.esm.js} +2 -2
- package/dist/otp-CGMdUzBC.esm.js +33 -0
- package/dist/otp-DF5A0sFx.d.ts +8 -0
- package/dist/permissionGuards-C1ispV96.esm.js +23 -0
- package/dist/permissionServices-CG3bMSfG.esm.js +130 -0
- package/dist/phone.d.ts +4 -3
- package/dist/phone.esm.js +6 -5
- package/dist/{phoneManager-DAJbGhlY.esm.js → phoneManager-BmF-0Ez4.esm.js} +30 -7
- package/dist/{phoneManager-B6M30hKE.d.ts → phoneManager-fPmIBYQK.d.ts} +65 -7
- package/dist/{phoneStateMachine-CuPARRaT.esm.js → phoneStateMachine-BiV0yoEx.esm.js} +46 -11
- package/dist/{qe-signature-DFo_Cc-I.esm.js → qe-signature-CUYPcHVo.esm.js} +1 -1
- package/dist/qe-signature.d.ts +3 -3
- package/dist/qe-signature.esm.js +6 -5
- package/dist/{recordingService-Ig2UgbLv.esm.js → recordingService-Bn9EdCmz.esm.js} +197 -179
- package/dist/redirect-to-mobile.d.ts +6 -104
- package/dist/redirect-to-mobile.esm.js +6 -99
- package/dist/redirectToMobileManager-BNe3IzC_.d.ts +178 -0
- package/dist/redirectToMobileManager-Dy3t7o0C.esm.js +159 -0
- package/dist/{redirectToMobileStateMachine-BOEqe46A.esm.js → redirectToMobileStateMachine-DyAdRxfP.esm.js} +28 -19
- package/dist/{runChildModule-CqqwqAkW.esm.js → runChildModule-CuoHZ1cx.esm.js} +35 -3
- package/dist/selfie.d.ts +13 -11
- package/dist/selfie.esm.js +27 -23
- package/dist/{selfieManager-Duisl7qN.esm.js → selfieManager-BjCoKRy0.esm.js} +6 -6
- package/dist/{selfieManager-D0lSgd-J.d.ts → selfieManager-dUbKRzOh.d.ts} +4 -4
- package/dist/{selfieStateMachine-D76whWEf.esm.js → selfieStateMachine-b4F2q9zw.esm.js} +5 -3
- package/dist/session-DoVb-OcB.esm.js +152 -0
- package/dist/session.d.ts +37 -5
- package/dist/session.esm.js +12 -7
- package/dist/sessionInitializer-B8H5MsXM.esm.js +366 -0
- package/dist/{setup-C5AITV8m.d.ts → setup-BbkprdVv.d.ts} +57 -6
- package/dist/{setup-DsM8IG7k.esm.js → setup-BqEfrdja.esm.js} +162 -24
- package/dist/signature.d.ts +2 -2
- package/dist/signature.esm.js +4 -4
- package/dist/{signatureStateMachine-B5-QVUve.esm.js → signatureStateMachine-C5qqYLRz.esm.js} +3 -3
- package/dist/stats-BMNUG1AU.esm.js +41 -0
- package/dist/stats.d.ts +13 -2
- package/dist/stats.esm.js +3 -2
- package/dist/trust-graph.d.ts +33 -4
- package/dist/trust-graph.esm.js +21 -15
- package/dist/{types-CFV9G_7j.d.ts → types-Bj9hdFjU.d.ts} +1 -1
- package/dist/{types-BP1m8VRw.d.ts → types-DOUhndhT.d.ts} +14 -2
- package/dist/types-DsnEVMhr.esm.js +34 -0
- package/dist/types-DvGZI7BF.d.ts +131 -0
- package/dist/{types-B06Ypu2F.d.ts → types-NuT8ftBV.d.ts} +1 -1
- package/dist/types-ya0LN_MX.d.ts +5 -0
- package/dist/{warmup-CEcppFiS.d.ts → warmup-Dg8Lh-50.d.ts} +8 -0
- package/dist/wasm.d.ts +6 -4
- package/dist/wasm.esm.js +11 -9
- package/dist/watchlist-for-business.d.ts +1 -1
- package/dist/watchlist-for-business.esm.js +5 -73
- package/dist/watchlist.d.ts +1 -1
- package/dist/watchlist.esm.js +4 -41
- package/dist/watchlistForBusinessStateMachine-DMl8j2Ov.esm.js +74 -0
- package/dist/watchlistStateMachine-DmQlqI6L.esm.js +50 -0
- package/dist/workflow.d.ts +153 -100
- package/dist/workflow.esm.js +156 -80
- package/package.json +19 -1
- package/dist/StateMachine-BCQrZJhf.d.ts +0 -2
- package/dist/WasmUtilProvider-j98OJf-S.esm.js +0 -114
- package/dist/browserSimulation-gxD8cSpM.esm.js +0 -20
- package/dist/deepsightService-O74l4Y__.esm.js +0 -489
- package/dist/displayErrors-DqJ_IbsG.d.ts +0 -39
- package/dist/flowCompletionService-DhkT4SRY.d.ts +0 -10
- package/dist/flowCompletionService-P54yzGvA.esm.js +0 -13
- package/dist/openviduLazy-Cm0XFh_v.esm.js +0 -3
- package/dist/permissionServices-D_i6nzEw.esm.js +0 -50
- package/dist/stats-CIfiPzb1.esm.js +0 -16
- package/dist/types-CAD4va6a.d.ts +0 -5
- package/dist/watchlistServices-DMbUhkBX.esm.js +0 -12
- /package/dist/{Actor-CI32dTbG.d.ts → Actor-Y0_Fj-KL.d.ts} +0 -0
- /package/dist/{ITimerCapability-C67ZRskg.esm.js → ITimerCapability-CB0I1Uf2.esm.js} +0 -0
- /package/dist/{Manager-C8PrhBOx.d.ts → Manager-BHn8wH8K.d.ts} +0 -0
- /package/dist/{camera-PA2Ljri3.esm.js → camera-DJWm3V4g.esm.js} +0 -0
- /package/dist/{camera-DBSxa6ML.d.ts → camera-SRBpPq2X.d.ts} +0 -0
- /package/dist/{chunk-CRF6K_H_.esm.js → chunk-CMUKZ2uL.esm.js} +0 -0
- /package/dist/{cpf-PPz2Njto.esm.js → cpf-BRzggV8G.esm.js} +0 -0
- /package/dist/{dateUtils-UoN5xswP.esm.js → dateUtils-AksLQmgV.esm.js} +0 -0
- /package/dist/{platform-CfrjKhmi.esm.js → platform-SKvEfCBh.esm.js} +0 -0
- /package/dist/{xstate.esm-B70JrNqo.esm.js → xstate.esm-C9wncMQa.esm.js} +0 -0
|
@@ -1,489 +0,0 @@
|
|
|
1
|
-
import { t as api } from "./api-CESGtpbH.esm.js";
|
|
2
|
-
import { t as isBrowserSimulation } from "./browserSimulation-gxD8cSpM.esm.js";
|
|
3
|
-
import { i as stopCameraStream, r as requestCameraAccess } from "./camera-PA2Ljri3.esm.js";
|
|
4
|
-
import { n as getDeviceInfo, t as getUserAgent } from "./getBrowser-BSXUTWXw.esm.js";
|
|
5
|
-
import { t as addDeviceStats } from "./stats-CIfiPzb1.esm.js";
|
|
6
|
-
|
|
7
|
-
//#region ../infra/src/media/canvas.ts
|
|
8
|
-
/**
|
|
9
|
-
* Class representing a canvas element for image capture and manipulation.
|
|
10
|
-
*/
|
|
11
|
-
var IncodeCanvas = class IncodeCanvas {
|
|
12
|
-
/**
|
|
13
|
-
* Creates an {@link IncodeCanvas} from a raw {@link ImageData} frame.
|
|
14
|
-
* @param imageData - Frame pixels in RGBA format
|
|
15
|
-
* @returns An {@link IncodeCanvas} containing the provided pixels
|
|
16
|
-
*/
|
|
17
|
-
static fromImageData(imageData) {
|
|
18
|
-
const canvas = document.createElement("canvas");
|
|
19
|
-
canvas.width = imageData.width;
|
|
20
|
-
canvas.height = imageData.height;
|
|
21
|
-
const context = canvas.getContext("2d", { willReadFrequently: true });
|
|
22
|
-
if (!context) return new IncodeCanvas(canvas);
|
|
23
|
-
if ("putImageData" in context) context.putImageData(imageData, 0, 0);
|
|
24
|
-
return new IncodeCanvas(canvas);
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Create a new canvas element.
|
|
28
|
-
* @param canvas_ - The canvas element to clone.
|
|
29
|
-
*/
|
|
30
|
-
constructor(canvas_) {
|
|
31
|
-
this.base64Image = null;
|
|
32
|
-
this.blobData = null;
|
|
33
|
-
this.canvas = document.createElement("canvas");
|
|
34
|
-
this.canvas.width = canvas_.width;
|
|
35
|
-
this.canvas.height = canvas_.height;
|
|
36
|
-
const context = this.canvas.getContext("2d");
|
|
37
|
-
if (context) context.drawImage(canvas_, 0, 0);
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Check if the current canvas is valid.
|
|
41
|
-
*/
|
|
42
|
-
checkCanvas() {
|
|
43
|
-
return this.canvas && this.canvas.width > 1 && this.canvas.height > 1;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Disposes of resources, including revoking object URLs to prevent memory leaks.
|
|
47
|
-
*/
|
|
48
|
-
dispose() {
|
|
49
|
-
if (this.blobData?.url) {
|
|
50
|
-
URL.revokeObjectURL(this.blobData.url);
|
|
51
|
-
this.blobData = null;
|
|
52
|
-
}
|
|
53
|
-
this.base64Image = null;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Release the data stored by IncodeCanvas.
|
|
57
|
-
*/
|
|
58
|
-
release() {
|
|
59
|
-
if (!this.checkCanvas()) return;
|
|
60
|
-
this.canvas.width = 1;
|
|
61
|
-
this.canvas.height = 1;
|
|
62
|
-
this.canvas.getContext("2d")?.clearRect(0, 0, 1, 1);
|
|
63
|
-
this.base64Image = null;
|
|
64
|
-
if (this.blobData?.url) URL.revokeObjectURL(this.blobData.url);
|
|
65
|
-
this.blobData = null;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Revokes the object URL if one exists, preventing memory leaks.
|
|
69
|
-
* Use this when you no longer need the preview image URL.
|
|
70
|
-
*/
|
|
71
|
-
revokeObjectURL() {
|
|
72
|
-
if (this.blobData?.url) {
|
|
73
|
-
URL.revokeObjectURL(this.blobData.url);
|
|
74
|
-
this.blobData = {
|
|
75
|
-
...this.blobData,
|
|
76
|
-
url: ""
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Get the width of the canvas.
|
|
82
|
-
*/
|
|
83
|
-
width() {
|
|
84
|
-
if (!this.checkCanvas()) return null;
|
|
85
|
-
return this.canvas.width;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Get the height of the canvas.
|
|
89
|
-
*/
|
|
90
|
-
height() {
|
|
91
|
-
if (!this.checkCanvas()) return null;
|
|
92
|
-
return this.canvas.height;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Set the width of the canvas.
|
|
96
|
-
*/
|
|
97
|
-
setWidth(width) {
|
|
98
|
-
if (!this.checkCanvas()) return;
|
|
99
|
-
this.canvas.width = width;
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Set the height of the canvas.
|
|
103
|
-
*/
|
|
104
|
-
setHeight(height) {
|
|
105
|
-
if (!this.checkCanvas()) return;
|
|
106
|
-
this.canvas.height = height;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Clone the current canvas.
|
|
110
|
-
*/
|
|
111
|
-
clone() {
|
|
112
|
-
if (!this.checkCanvas()) return null;
|
|
113
|
-
const cloned = new IncodeCanvas(this.canvas);
|
|
114
|
-
cloned.setBase64Image(this.base64Image);
|
|
115
|
-
return cloned;
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Deep clone the current IncodeCanvas including blob data.
|
|
119
|
-
*/
|
|
120
|
-
async deepClone() {
|
|
121
|
-
const cloned = this.clone();
|
|
122
|
-
if (!cloned) return null;
|
|
123
|
-
if (this.blobData) await cloned.setBlobData(this.blobData);
|
|
124
|
-
return cloned;
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Returns the drawing context on the canvas.
|
|
128
|
-
*/
|
|
129
|
-
getContext(contextId, contextAttributes) {
|
|
130
|
-
if (!this.checkCanvas()) return null;
|
|
131
|
-
const context = this.canvas.getContext(contextId, contextAttributes);
|
|
132
|
-
return context instanceof CanvasRenderingContext2D ? context : null;
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Retrieves the image data from the canvas.
|
|
136
|
-
*/
|
|
137
|
-
getImageData() {
|
|
138
|
-
if (!this.checkCanvas()) return null;
|
|
139
|
-
const context = this.canvas.getContext("2d", { willReadFrequently: true });
|
|
140
|
-
if (!context) return null;
|
|
141
|
-
return context.getImageData(0, 0, this.canvas.width, this.canvas.height);
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Updates the base64 representation of the current canvas image.
|
|
145
|
-
*/
|
|
146
|
-
updateBase64Image(jpegQuality = 1) {
|
|
147
|
-
if (!this.checkCanvas()) return;
|
|
148
|
-
this.base64Image = this.canvas.toDataURL("image/jpeg", jpegQuality);
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* Converts the current canvas element to a base64 string.
|
|
152
|
-
*/
|
|
153
|
-
getBase64Image(jpegQuality = 1, includeDataURLPrefix = false) {
|
|
154
|
-
if (!this.checkCanvas()) return null;
|
|
155
|
-
if (this.base64Image === null) this.updateBase64Image(jpegQuality);
|
|
156
|
-
const base64Image = this.base64Image;
|
|
157
|
-
if (base64Image === null) return null;
|
|
158
|
-
if (includeDataURLPrefix) return base64Image;
|
|
159
|
-
const commaIndex = base64Image.indexOf(",");
|
|
160
|
-
if (commaIndex === -1) return base64Image;
|
|
161
|
-
return base64Image.slice(commaIndex + 1);
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* Sets the base64 representation of the current canvas image.
|
|
165
|
-
*/
|
|
166
|
-
setBase64Image(base64Image) {
|
|
167
|
-
this.base64Image = base64Image;
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* Updates the Blob representation of the current canvas image.
|
|
171
|
-
*/
|
|
172
|
-
updateBlob(jpegQuality = 1, includeDataURLPrefix = false) {
|
|
173
|
-
if (!this.checkCanvas()) return;
|
|
174
|
-
if (this.base64Image === null) this.updateBase64Image(jpegQuality);
|
|
175
|
-
const base64 = this.getBase64Image(jpegQuality, includeDataURLPrefix);
|
|
176
|
-
if (base64) this.blobData = IncodeCanvas.base64ToBlob(base64);
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Converts a base64 string to a Blob and creates a URL for it.
|
|
180
|
-
*/
|
|
181
|
-
static base64ToBlob(base64) {
|
|
182
|
-
try {
|
|
183
|
-
const binary = atob(base64);
|
|
184
|
-
const array = [];
|
|
185
|
-
for (let i = 0; i < binary.length; i++) array.push(binary.charCodeAt(i));
|
|
186
|
-
const blob = new Blob([new Uint8Array(array)]);
|
|
187
|
-
return {
|
|
188
|
-
blob,
|
|
189
|
-
url: URL.createObjectURL(blob)
|
|
190
|
-
};
|
|
191
|
-
} catch (error) {
|
|
192
|
-
console.error("Failed to convert base64 string to Blob:", error);
|
|
193
|
-
}
|
|
194
|
-
return null;
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* Retrieves the Blob data and its URL from the current canvas.
|
|
198
|
-
*/
|
|
199
|
-
getBlobData(jpegQuality = 1, includeDataURLPrefix = false) {
|
|
200
|
-
if (!this.checkCanvas()) return null;
|
|
201
|
-
if (this.blobData === null) this.updateBlob(jpegQuality, includeDataURLPrefix);
|
|
202
|
-
return this.blobData;
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* Sets the Blob data of the current canvas image.
|
|
206
|
-
*/
|
|
207
|
-
async setBlobData(blobData) {
|
|
208
|
-
const blobDataArrayBuffer = await blobData.blob.arrayBuffer();
|
|
209
|
-
this.blobData = {
|
|
210
|
-
blob: new Blob([blobDataArrayBuffer], { type: blobData.blob.type }),
|
|
211
|
-
url: blobData.url
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
/**
|
|
215
|
-
* Returns a resized canvas according to video element size.
|
|
216
|
-
*/
|
|
217
|
-
getResizedCanvas(videoElementWidth, videoElementHeight) {
|
|
218
|
-
if (!this.checkCanvas()) return null;
|
|
219
|
-
const cameraOffsetX = Math.abs(videoElementWidth - window.innerWidth);
|
|
220
|
-
const resized = new IncodeCanvas(document.createElement("canvas"));
|
|
221
|
-
const canvasHeight = this.height();
|
|
222
|
-
if (!canvasHeight) return null;
|
|
223
|
-
const ratio = canvasHeight / videoElementHeight;
|
|
224
|
-
const newWidth = window.innerWidth;
|
|
225
|
-
const newHeight = window.innerHeight;
|
|
226
|
-
resized.setWidth(newWidth);
|
|
227
|
-
resized.setHeight(newHeight);
|
|
228
|
-
const context = resized.getContext("2d");
|
|
229
|
-
if (!context) return null;
|
|
230
|
-
context.drawImage(this.canvas, ratio * cameraOffsetX / 2, 0, ratio * newWidth, ratio * newHeight, 0, 0, newWidth, newHeight);
|
|
231
|
-
return resized;
|
|
232
|
-
}
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
//#endregion
|
|
236
|
-
//#region ../infra/src/media/video.ts
|
|
237
|
-
/**
|
|
238
|
-
* Creates a hidden video element for a stream and appends it to document.body.
|
|
239
|
-
*/
|
|
240
|
-
function createHiddenVideoElement(stream) {
|
|
241
|
-
if (typeof document === "undefined") throw new Error("Document not available");
|
|
242
|
-
const video = document.createElement("video");
|
|
243
|
-
video.autoplay = true;
|
|
244
|
-
video.playsInline = true;
|
|
245
|
-
video.muted = true;
|
|
246
|
-
video.srcObject = stream;
|
|
247
|
-
video.style.width = "0px";
|
|
248
|
-
video.style.height = "0px";
|
|
249
|
-
video.style.position = "absolute";
|
|
250
|
-
video.style.top = "0";
|
|
251
|
-
video.style.left = "0";
|
|
252
|
-
video.style.zIndex = "-1";
|
|
253
|
-
document.body.appendChild(video);
|
|
254
|
-
return {
|
|
255
|
-
element: video,
|
|
256
|
-
dispose: () => {
|
|
257
|
-
video.srcObject = null;
|
|
258
|
-
if (video.parentElement) video.parentElement.removeChild(video);
|
|
259
|
-
}
|
|
260
|
-
};
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
//#endregion
|
|
264
|
-
//#region src/internal/deepsight/metadataService.ts
|
|
265
|
-
function createMetadataService(wasmUtil, visibility, browserEnv, ipLookup) {
|
|
266
|
-
return {
|
|
267
|
-
async initialize(sdkVersion, disableIpify = false) {
|
|
268
|
-
wasmUtil.setSdkPlatform("WEBAPP");
|
|
269
|
-
wasmUtil.setSdkVersion(sdkVersion);
|
|
270
|
-
const ua = getUserAgent();
|
|
271
|
-
const isMobile = /Android|iPhone|iPad|iPod/i.test(ua);
|
|
272
|
-
const deviceInfo = getDeviceInfo();
|
|
273
|
-
const visitorId = browserEnv.generateCanvasFingerprint();
|
|
274
|
-
const ip = disableIpify ? "" : await ipLookup.getIp();
|
|
275
|
-
const screenDimensions = browserEnv.getScreenDimensions();
|
|
276
|
-
const deviceMetadata = {
|
|
277
|
-
kind: isMobile ? "mobile" : "desktop",
|
|
278
|
-
model: "",
|
|
279
|
-
os: void 0,
|
|
280
|
-
osVersion: void 0,
|
|
281
|
-
screenDimensions,
|
|
282
|
-
numTouchPoints: deviceInfo.maxTouchPoints,
|
|
283
|
-
fingerprintHash: visitorId,
|
|
284
|
-
ip,
|
|
285
|
-
backgroundMode: false
|
|
286
|
-
};
|
|
287
|
-
wasmUtil.setDeviceInfo(deviceMetadata);
|
|
288
|
-
const navigatorPrefixes = browserEnv.getNavigatorPrefixes();
|
|
289
|
-
const browserInfo = {
|
|
290
|
-
userAgent: ua,
|
|
291
|
-
getUserMediaAvailability: {
|
|
292
|
-
webkit: navigatorPrefixes.webkit,
|
|
293
|
-
moz: navigatorPrefixes.moz,
|
|
294
|
-
o: navigatorPrefixes.o,
|
|
295
|
-
ms: navigatorPrefixes.ms
|
|
296
|
-
},
|
|
297
|
-
webglFingerprint: browserEnv.getWebGLRenderer(),
|
|
298
|
-
inspectorOpened: false,
|
|
299
|
-
isMockedBrowser: isBrowserSimulation(browserEnv)
|
|
300
|
-
};
|
|
301
|
-
wasmUtil.setBrowserInfo(browserInfo, false);
|
|
302
|
-
},
|
|
303
|
-
updateCameraInfo(videoTrack) {
|
|
304
|
-
const settings = videoTrack.getSettings();
|
|
305
|
-
const capabilities = videoTrack.getCapabilities?.() ?? {};
|
|
306
|
-
const labels = videoTrack.label ? [videoTrack.label] : [];
|
|
307
|
-
const cameraInfo = {
|
|
308
|
-
facingMode: settings.facingMode === "user" ? "frontal" : settings.facingMode === "environment" ? "back" : settings.facingMode || "unknown",
|
|
309
|
-
settings,
|
|
310
|
-
capabilities,
|
|
311
|
-
labels
|
|
312
|
-
};
|
|
313
|
-
wasmUtil.setCameraInfo(cameraInfo);
|
|
314
|
-
},
|
|
315
|
-
async checkForVirtualCameraByLabel(videoTrack = null) {
|
|
316
|
-
try {
|
|
317
|
-
if (!videoTrack) {
|
|
318
|
-
const labels = await browserEnv.enumerateVideoDeviceLabels();
|
|
319
|
-
for (const label of labels) if (wasmUtil.isVirtualCamera(label)) return true;
|
|
320
|
-
}
|
|
321
|
-
if (videoTrack && wasmUtil.isVirtualCamera(videoTrack.label)) return true;
|
|
322
|
-
return false;
|
|
323
|
-
} catch {
|
|
324
|
-
return false;
|
|
325
|
-
}
|
|
326
|
-
},
|
|
327
|
-
async analyzeFrame(imageData) {
|
|
328
|
-
await wasmUtil.analyzeFrame(imageData);
|
|
329
|
-
},
|
|
330
|
-
setMotionStatus(status) {
|
|
331
|
-
wasmUtil.setMotionStatus(status);
|
|
332
|
-
},
|
|
333
|
-
setBackgroundMode(backgroundMode) {
|
|
334
|
-
wasmUtil.setBackgroundMode(backgroundMode || visibility.wasBackgrounded);
|
|
335
|
-
visibility.reset();
|
|
336
|
-
},
|
|
337
|
-
estimatePerformance() {
|
|
338
|
-
return wasmUtil.estimatePerformance();
|
|
339
|
-
},
|
|
340
|
-
getMetadata() {
|
|
341
|
-
return wasmUtil.getMetadata();
|
|
342
|
-
},
|
|
343
|
-
getCheck() {
|
|
344
|
-
return wasmUtil.getCheck();
|
|
345
|
-
},
|
|
346
|
-
getPipelineState() {
|
|
347
|
-
return wasmUtil.getPipelineState();
|
|
348
|
-
},
|
|
349
|
-
preparePipelineState() {
|
|
350
|
-
wasmUtil.getPipelineState();
|
|
351
|
-
}
|
|
352
|
-
};
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
//#endregion
|
|
356
|
-
//#region src/internal/deepsight/motionStatusService.ts
|
|
357
|
-
function createMotionStatusService(motionSensor) {
|
|
358
|
-
return {
|
|
359
|
-
async requestPermission() {
|
|
360
|
-
return motionSensor.requestPermission();
|
|
361
|
-
},
|
|
362
|
-
async start() {
|
|
363
|
-
await motionSensor.start();
|
|
364
|
-
},
|
|
365
|
-
stop() {
|
|
366
|
-
motionSensor.stop();
|
|
367
|
-
},
|
|
368
|
-
check() {
|
|
369
|
-
return motionSensor.check();
|
|
370
|
-
},
|
|
371
|
-
get isRunning() {
|
|
372
|
-
return motionSensor.isRunning;
|
|
373
|
-
},
|
|
374
|
-
get hasPermission() {
|
|
375
|
-
return motionSensor.hasPermission;
|
|
376
|
-
}
|
|
377
|
-
};
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
//#endregion
|
|
381
|
-
//#region src/internal/virtualCameraCheck.ts
|
|
382
|
-
/**
|
|
383
|
-
* Sends the analyzed frame image to the backend for logging.
|
|
384
|
-
*/
|
|
385
|
-
async function logFrame({ source, base64Image, token }) {
|
|
386
|
-
try {
|
|
387
|
-
return (await api.post("/omni/log/frame/v2", { base64Image }, {
|
|
388
|
-
query: { source },
|
|
389
|
-
headers: { "X-Incode-Hardware-Id": token }
|
|
390
|
-
})).data;
|
|
391
|
-
} catch {
|
|
392
|
-
return;
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
/**
|
|
396
|
-
* Runs the WASM virtual camera check and handles logging and stats.
|
|
397
|
-
*/
|
|
398
|
-
async function runVirtualCameraCheck({ wasmUtil, source, token }) {
|
|
399
|
-
const output = {
|
|
400
|
-
canvas: null,
|
|
401
|
-
itr: null,
|
|
402
|
-
skipped: null
|
|
403
|
-
};
|
|
404
|
-
await wasmUtil.poc(output);
|
|
405
|
-
if (output.skipped !== false) return;
|
|
406
|
-
if (output.canvas && token) {
|
|
407
|
-
const base64Image = new IncodeCanvas(output.canvas).getBase64Image();
|
|
408
|
-
if (base64Image) await logFrame({
|
|
409
|
-
source,
|
|
410
|
-
base64Image,
|
|
411
|
-
token
|
|
412
|
-
});
|
|
413
|
-
}
|
|
414
|
-
if (output.itr === true) {
|
|
415
|
-
addDeviceStats({ virtualCameraDetected: true });
|
|
416
|
-
wasmUtil.setZc("FAIL");
|
|
417
|
-
} else if (output.itr === false) wasmUtil.setZc("PASS");
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
//#endregion
|
|
421
|
-
//#region src/internal/deepsight/deepsightService.ts
|
|
422
|
-
function createDeepsightService(config) {
|
|
423
|
-
const metadata = createMetadataService(config.wasmUtil, config.visibility, config.browserEnv, config.ipLookup);
|
|
424
|
-
const motion = createMotionStatusService(config.motionSensor);
|
|
425
|
-
return {
|
|
426
|
-
metadata,
|
|
427
|
-
motion,
|
|
428
|
-
async initialize(disableIpify = false) {
|
|
429
|
-
await metadata.initialize(config.sdkVersion, disableIpify);
|
|
430
|
-
metadata.estimatePerformance();
|
|
431
|
-
},
|
|
432
|
-
async requestMotionPermission() {
|
|
433
|
-
return motion.requestPermission();
|
|
434
|
-
},
|
|
435
|
-
async startMotionSensors() {
|
|
436
|
-
await motion.start();
|
|
437
|
-
},
|
|
438
|
-
stopMotionSensors() {
|
|
439
|
-
motion.stop();
|
|
440
|
-
},
|
|
441
|
-
async checkVirtualCamera(videoTrack) {
|
|
442
|
-
metadata.updateCameraInfo(videoTrack);
|
|
443
|
-
return metadata.checkForVirtualCameraByLabel(videoTrack);
|
|
444
|
-
},
|
|
445
|
-
async performVirtualCameraCheck(sessionToken, source) {
|
|
446
|
-
await runVirtualCameraCheck({
|
|
447
|
-
wasmUtil: config.wasmUtil,
|
|
448
|
-
source,
|
|
449
|
-
token: sessionToken
|
|
450
|
-
});
|
|
451
|
-
},
|
|
452
|
-
async performPrcCheck(params) {
|
|
453
|
-
const prcStream = await requestCameraAccess(params.constraints);
|
|
454
|
-
const hiddenVideo = createHiddenVideoElement(prcStream);
|
|
455
|
-
try {
|
|
456
|
-
await config.wasmUtil.prc();
|
|
457
|
-
} finally {
|
|
458
|
-
hiddenVideo.dispose();
|
|
459
|
-
stopCameraStream(prcStream);
|
|
460
|
-
}
|
|
461
|
-
},
|
|
462
|
-
async analyzeFrame(imageData) {
|
|
463
|
-
await metadata.analyzeFrame(imageData);
|
|
464
|
-
metadata.preparePipelineState();
|
|
465
|
-
const motionStatus = motion.check();
|
|
466
|
-
metadata.setMotionStatus(motionStatus);
|
|
467
|
-
metadata.getCheck();
|
|
468
|
-
metadata.setBackgroundMode(false);
|
|
469
|
-
},
|
|
470
|
-
getMetadata() {
|
|
471
|
-
return metadata.getMetadata();
|
|
472
|
-
},
|
|
473
|
-
getMotionStatus() {
|
|
474
|
-
return motion.check();
|
|
475
|
-
},
|
|
476
|
-
getAnalysisStatus() {
|
|
477
|
-
return metadata.getCheck();
|
|
478
|
-
},
|
|
479
|
-
getPipelineState() {
|
|
480
|
-
return metadata.getPipelineState();
|
|
481
|
-
},
|
|
482
|
-
cleanup() {
|
|
483
|
-
motion.stop();
|
|
484
|
-
}
|
|
485
|
-
};
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
//#endregion
|
|
489
|
-
export { IncodeCanvas as n, createDeepsightService as t };
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
//#region src/shared/types.d.ts
|
|
2
|
-
/** A single form field definition for dynamic rendering. */
|
|
3
|
-
type FieldDef = {
|
|
4
|
-
name: string;
|
|
5
|
-
type: 'text' | 'tel' | 'date' | 'dropdown' | 'phone' | 'radio';
|
|
6
|
-
label: string;
|
|
7
|
-
displayLabel?: string;
|
|
8
|
-
placeholder?: string;
|
|
9
|
-
placeholderParams?: Record<string, string>;
|
|
10
|
-
required: boolean;
|
|
11
|
-
optional?: boolean;
|
|
12
|
-
maxLength?: number;
|
|
13
|
-
options?: {
|
|
14
|
-
value: string;
|
|
15
|
-
label: string;
|
|
16
|
-
}[];
|
|
17
|
-
readonly?: boolean;
|
|
18
|
-
section?: string;
|
|
19
|
-
disableCountrySelector?: boolean;
|
|
20
|
-
};
|
|
21
|
-
/** An address suggestion returned by the address autocomplete API. */
|
|
22
|
-
type AddressSuggestion = {
|
|
23
|
-
id: string | number;
|
|
24
|
-
label: string;
|
|
25
|
-
street?: string;
|
|
26
|
-
city?: string;
|
|
27
|
-
stateCode?: string;
|
|
28
|
-
postalCode?: string;
|
|
29
|
-
houseNumber?: string;
|
|
30
|
-
countryCode?: string;
|
|
31
|
-
};
|
|
32
|
-
//#endregion
|
|
33
|
-
//#region src/shared/displayErrors.d.ts
|
|
34
|
-
type DisplayErrorsResult = {
|
|
35
|
-
displayErrors: Record<string, string>;
|
|
36
|
-
errorParams: Record<string, Record<string, string | number>>;
|
|
37
|
-
};
|
|
38
|
-
//#endregion
|
|
39
|
-
export { AddressSuggestion as n, FieldDef as r, DisplayErrorsResult as t };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
//#region src/modules/flow/flowCompletionService.d.ts
|
|
2
|
-
type FinishStatus = {
|
|
3
|
-
redirectionUrl: string;
|
|
4
|
-
action: 'approved' | 'rejected' | 'none';
|
|
5
|
-
scoreStatus: 'OK' | 'WARN' | 'MANUAL_OK' | 'FAIL' | 'UNKNOWN' | 'MANUAL_FAIL';
|
|
6
|
-
};
|
|
7
|
-
type GetFinishStatusFn = (flowId: string | undefined | null, signal?: AbortSignal) => Promise<FinishStatus>;
|
|
8
|
-
declare const getFinishStatus: GetFinishStatusFn;
|
|
9
|
-
//#endregion
|
|
10
|
-
export { GetFinishStatusFn as n, getFinishStatus as r, FinishStatus as t };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { t as api } from "./api-CESGtpbH.esm.js";
|
|
2
|
-
import { t as endpoints } from "./endpoints-CnN3SyDa.esm.js";
|
|
3
|
-
|
|
4
|
-
//#region src/modules/flow/flowCompletionService.ts
|
|
5
|
-
const getFinishStatus = async (flowId, signal) => {
|
|
6
|
-
const url = `${endpoints.finishStatus}${flowId ? `?flowId=${flowId}` : ""}`;
|
|
7
|
-
const res = await api.get(url, { signal });
|
|
8
|
-
if (!res.ok) throw new Error(`GET ${url} failed: ${res.status} ${res.statusText}`);
|
|
9
|
-
return res.data;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
//#endregion
|
|
13
|
-
export { getFinishStatus as t };
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { i as stopCameraStream, r as requestCameraAccess } from "./camera-PA2Ljri3.esm.js";
|
|
2
|
-
import { t as MotionSensorProvider } from "./MotionSensorProvider-4v7xkqAp.esm.js";
|
|
3
|
-
|
|
4
|
-
//#region ../infra/src/media/permissions.ts
|
|
5
|
-
async function queryPermission(name) {
|
|
6
|
-
try {
|
|
7
|
-
if (typeof navigator === "undefined" || !navigator.permissions) return "prompt";
|
|
8
|
-
return (await navigator.permissions.query({ name })).state;
|
|
9
|
-
} catch {
|
|
10
|
-
return "prompt";
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
async function queryCameraPermission() {
|
|
14
|
-
return queryPermission("camera");
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
//#endregion
|
|
18
|
-
//#region src/internal/permissions/permissionServices.ts
|
|
19
|
-
async function checkPermission() {
|
|
20
|
-
const queryResult = await queryCameraPermission();
|
|
21
|
-
if (queryResult === "granted") return "granted";
|
|
22
|
-
if (queryResult === "denied") return "denied";
|
|
23
|
-
return "prompt";
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Requests motion sensor permission. Must be called during a user gesture on iOS.
|
|
27
|
-
* Returns the permission result.
|
|
28
|
-
*/
|
|
29
|
-
async function requestMotionPermission() {
|
|
30
|
-
return new MotionSensorProvider().requestPermission();
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Requests camera permission by attempting to access the camera, then immediately
|
|
34
|
-
* stops the obtained stream. Also requests motion sensor permission (required on iOS
|
|
35
|
-
* to be called during a user gesture). This function does not keep or return the stream.
|
|
36
|
-
*/
|
|
37
|
-
async function requestPermission(options = {}) {
|
|
38
|
-
try {
|
|
39
|
-
if (options.requestMotion) await requestMotionPermission();
|
|
40
|
-
stopCameraStream(await requestCameraAccess({ video: true }));
|
|
41
|
-
return "granted";
|
|
42
|
-
} catch (error) {
|
|
43
|
-
const name = error instanceof Error ? error.name : void 0;
|
|
44
|
-
if (name === "NotAllowedError" || name === "PermissionDeniedError") return "denied";
|
|
45
|
-
return "prompt";
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
//#endregion
|
|
50
|
-
export { requestPermission as n, checkPermission as t };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { t as api } from "./api-CESGtpbH.esm.js";
|
|
2
|
-
|
|
3
|
-
//#region src/modules/stats/statsServices.ts
|
|
4
|
-
/**
|
|
5
|
-
* Sends device stats to the backend.
|
|
6
|
-
*/
|
|
7
|
-
async function addDeviceStats(stats) {
|
|
8
|
-
try {
|
|
9
|
-
await api.post("/omni/device/stats", stats);
|
|
10
|
-
} catch {
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
//#endregion
|
|
16
|
-
export { addDeviceStats as t };
|
package/dist/types-CAD4va6a.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { t as api } from "./api-CESGtpbH.esm.js";
|
|
2
|
-
import { t as endpoints } from "./endpoints-CnN3SyDa.esm.js";
|
|
3
|
-
|
|
4
|
-
//#region src/modules/watchlist/watchlistServices.ts
|
|
5
|
-
async function processWatchlist(signal) {
|
|
6
|
-
const res = await api.post(endpoints.processWatchlist, {}, { signal });
|
|
7
|
-
if (!res.ok) throw new Error(`POST ${endpoints.processWatchlist} failed: ${res.status} ${res.statusText}`);
|
|
8
|
-
return res.data;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
//#endregion
|
|
12
|
-
export { processWatchlist as t };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|