@ekyc_qoobiss/qbs-ect-cmp 3.6.13 → 3.6.15
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/cjs/{Stream-3b222f7c.js → agreement-check_19.cjs.entry.js} +5197 -96
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/qbs-ect-cmp.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -2
- package/dist/collection/components/common/capture-error/capture-error.js +6 -1
- package/dist/collection/components/common/id-back-capture/id-back-capture.js +2 -4
- package/dist/collection/components/common/id-capture/id-capture.js +2 -4
- package/dist/collection/components/common/id-tilt/id-tilt.js +3 -5
- package/dist/collection/components/common/selfie-capture/selfie-capture.js +3 -27
- package/dist/collection/components/common/selfie-tilt/selfie-tilt.css +7 -0
- package/dist/collection/components/common/selfie-tilt/selfie-tilt.js +212 -0
- package/dist/collection/components/flow/process-id/process-id.js +53 -91
- package/dist/collection/components/flow/user-liveness/user-liveness.js +88 -40
- package/dist/collection/helpers/Stream.js +5 -6
- package/dist/collection/libs/FaceML5Detector/FaceML5Detector.js +18 -15
- package/dist/collection/models/CaptureFlow.js +21 -9
- package/dist/collection/models/FlowSteps.js +3 -6
- package/dist/esm/{Stream-57643e4d.js → agreement-check_19.entry.js} +5132 -29
- package/dist/esm/{index-5d6f9123.js → index-9d69e511.js} +1 -1
- package/dist/esm/loader-dots.entry.js +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/qbs-ect-cmp.js +3 -3
- package/dist/qbs-ect-cmp/{p-aacd7024.js → p-06e42b28.js} +1 -1
- package/dist/qbs-ect-cmp/{p-7c33dd41.entry.js → p-4c8e922b.entry.js} +1 -1
- package/dist/qbs-ect-cmp/{p-ed7ad79f.js → p-a85dd6fc.entry.js} +26 -26
- package/dist/qbs-ect-cmp/qbs-ect-cmp.esm.js +1 -1
- package/dist/types/components/common/capture-error/capture-error.d.ts +3 -1
- package/dist/types/components/common/selfie-capture/selfie-capture.d.ts +0 -1
- package/dist/types/components/common/selfie-tilt/selfie-tilt.d.ts +30 -0
- package/dist/types/components/controls/camera/camera.d.ts +2 -3
- package/dist/types/components/flow/process-id/process-id.d.ts +0 -1
- package/dist/types/components/flow/user-liveness/user-liveness.d.ts +4 -4
- package/dist/types/components.d.ts +20 -37
- package/dist/types/helpers/Stream.d.ts +1 -2
- package/dist/types/libs/FaceML5Detector/FaceML5Detector.d.ts +3 -2
- package/dist/types/models/CaptureFlow.d.ts +15 -6
- package/dist/types/models/FlowSteps.d.ts +3 -6
- package/package.json +1 -1
- package/dist/cjs/agreement-check_18.cjs.entry.js +0 -5005
- package/dist/cjs/id-double-side.cjs.entry.js +0 -208
- package/dist/cjs/id-single-side.cjs.entry.js +0 -147
- package/dist/collection/components/flow/id-double-side/id-double-side.css +0 -0
- package/dist/collection/components/flow/id-double-side/id-double-side.js +0 -285
- package/dist/collection/components/flow/id-single-side/id-single-side.css +0 -0
- package/dist/collection/components/flow/id-single-side/id-single-side.js +0 -216
- package/dist/collection/models/IRecordingCallback.js +0 -1
- package/dist/esm/agreement-check_18.entry.js +0 -4984
- package/dist/esm/id-double-side.entry.js +0 -204
- package/dist/esm/id-single-side.entry.js +0 -143
- package/dist/qbs-ect-cmp/p-4934666e.entry.js +0 -1
- package/dist/qbs-ect-cmp/p-65eb59af.entry.js +0 -1
- package/dist/qbs-ect-cmp/p-878f427a.entry.js +0 -1
- package/dist/types/components/flow/id-double-side/id-double-side.d.ts +0 -29
- package/dist/types/components/flow/id-single-side/id-single-side.d.ts +0 -24
- package/dist/types/models/IRecordingCallback.d.ts +0 -4
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["agreement-
|
|
17
|
+
return index.bootstrapLazy([["loader-dots.cjs",[[1,"loader-dots"]]],["agreement-check_19.cjs",[[1,"identification-component",{"token":[1537],"order_id":[1537],"api_url":[1537],"env":[1537],"redirect_id":[1537],"phone_number":[1537],"idSide":[32],"errorMessage":[32],"errorTitle":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"],[0,"apiError","apiErrorEmitter"]]],[0,"process-id",{"captureStep":[32],"showTimeout":[32],"showInvalid":[32],"flow":[32]},[[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoIdCapture","captureIdImage"],[0,"photoIdBackCapture","captureIdBackImage"],[0,"recordingIdCapture","capturedIdRecording"]]],[0,"user-liveness",{"showError":[32],"captureStep":[32],"flow":[32]},[[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoSelfieCapture","captureSelfieImage"],[0,"recordingSelfieCapture","capturedSelfieRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-info",{"agreementsChecked":[32],"termsChecked":[32],"openAgreements":[32],"openTerms":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"]]],[0,"camera-error",{"title":[32],"description":[32],"buttonDisabled":[32],"demoVideo":[32]}],[0,"end-redirect"],[0,"error-end",{"message":[1],"errorTitle":[1,"error-title"]}],[0,"landing-validation",{"warningText":[32],"buttonDisabled":[32]}],[0,"mobile-redirect",{"infoTextTop":[32],"infoTextBottom":[32],"contact":[32],"invalidValue":[32],"waitingMobile":[32],"orderStatus":[32],"redirectLink":[32],"qrCode":[32],"prefilledPhone":[32]}],[0,"sms-code-validation",{"title":[32],"details":[32],"buttonText":[32],"phoneNumber":[32],"code":[32],"prefilledPhone":[32],"canSend":[32]}],[0,"id-back-capture",{"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"verificationFinished","verificationFinished"],[0,"takePhoto","takePhoto"]]],[0,"id-capture",{"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"id-tilt",{"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"selfie-capture",{"videoStarted":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"demoEnded":[32],"demoVideo":[32],"uploadingLink":[32],"captureHeight":[32],"captureWidth":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"selfie-tilt",{"videoStarted":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"demoEnded":[32],"demoVideo":[32],"uploadingLink":[32],"captureHeight":[32],"captureWidth":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-check",{"agreementType":[1,"agreement-type"],"htmlContent":[32],"buttonEnabled":[32]}],[0,"capture-error",{"type":[1],"buttonEnabled":[32],"buttonText":[32]}],[0,"how-to-info",{"idSide":[1,"id-side"],"topTitle":[32],"subTitle":[32],"imagePath":[32],"buttonText":[32],"buttonEnabled":[32]}],[0,"camera-comp",{"modelPath":[1,"model-path"],"probabilityThreshold":[2,"probability-threshold"],"captureMode":[1,"capture-mode"]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -17,7 +17,7 @@ const patchBrowser = () => {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
patchBrowser().then(options => {
|
|
20
|
-
return index.bootstrapLazy([["agreement-
|
|
20
|
+
return index.bootstrapLazy([["loader-dots.cjs",[[1,"loader-dots"]]],["agreement-check_19.cjs",[[1,"identification-component",{"token":[1537],"order_id":[1537],"api_url":[1537],"env":[1537],"redirect_id":[1537],"phone_number":[1537],"idSide":[32],"errorMessage":[32],"errorTitle":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"],[0,"apiError","apiErrorEmitter"]]],[0,"process-id",{"captureStep":[32],"showTimeout":[32],"showInvalid":[32],"flow":[32]},[[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoIdCapture","captureIdImage"],[0,"photoIdBackCapture","captureIdBackImage"],[0,"recordingIdCapture","capturedIdRecording"]]],[0,"user-liveness",{"showError":[32],"captureStep":[32],"flow":[32]},[[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoSelfieCapture","captureSelfieImage"],[0,"recordingSelfieCapture","capturedSelfieRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-info",{"agreementsChecked":[32],"termsChecked":[32],"openAgreements":[32],"openTerms":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"]]],[0,"camera-error",{"title":[32],"description":[32],"buttonDisabled":[32],"demoVideo":[32]}],[0,"end-redirect"],[0,"error-end",{"message":[1],"errorTitle":[1,"error-title"]}],[0,"landing-validation",{"warningText":[32],"buttonDisabled":[32]}],[0,"mobile-redirect",{"infoTextTop":[32],"infoTextBottom":[32],"contact":[32],"invalidValue":[32],"waitingMobile":[32],"orderStatus":[32],"redirectLink":[32],"qrCode":[32],"prefilledPhone":[32]}],[0,"sms-code-validation",{"title":[32],"details":[32],"buttonText":[32],"phoneNumber":[32],"code":[32],"prefilledPhone":[32],"canSend":[32]}],[0,"id-back-capture",{"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"verificationFinished","verificationFinished"],[0,"takePhoto","takePhoto"]]],[0,"id-capture",{"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"id-tilt",{"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"selfie-capture",{"videoStarted":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"demoEnded":[32],"demoVideo":[32],"uploadingLink":[32],"captureHeight":[32],"captureWidth":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"selfie-tilt",{"videoStarted":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"demoEnded":[32],"demoVideo":[32],"uploadingLink":[32],"captureHeight":[32],"captureWidth":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-check",{"agreementType":[1,"agreement-type"],"htmlContent":[32],"buttonEnabled":[32]}],[0,"capture-error",{"type":[1],"buttonEnabled":[32],"buttonText":[32]}],[0,"how-to-info",{"idSide":[1,"id-side"],"topTitle":[32],"subTitle":[32],"imagePath":[32],"buttonText":[32],"buttonEnabled":[32]}],[0,"camera-comp",{"modelPath":[1,"model-path"],"probabilityThreshold":[2,"probability-threshold"],"captureMode":[1,"capture-mode"]}]]]], options);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
exports.setNonce = index.setNonce;
|
|
@@ -8,13 +8,12 @@
|
|
|
8
8
|
"./components/common/id-capture/id-capture.js",
|
|
9
9
|
"./components/common/id-tilt/id-tilt.js",
|
|
10
10
|
"./components/common/selfie-capture/selfie-capture.js",
|
|
11
|
+
"./components/common/selfie-tilt/selfie-tilt.js",
|
|
11
12
|
"./components/controls/camera/camera.js",
|
|
12
13
|
"./components/controls/loader-dots/loader-dots.js",
|
|
13
14
|
"./components/flow/agreement-info/agreement-info.js",
|
|
14
15
|
"./components/flow/end-redirect/end-redirect.js",
|
|
15
16
|
"./components/flow/error-end/error-end.js",
|
|
16
|
-
"./components/flow/id-double-side/id-double-side.js",
|
|
17
|
-
"./components/flow/id-single-side/id-single-side.js",
|
|
18
17
|
"./components/flow/landing-validation/landing-validation.js",
|
|
19
18
|
"./components/flow/mobile-redirect/mobile-redirect.js",
|
|
20
19
|
"./components/flow/process-id/process-id.js",
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { h } from '@stencil/core';
|
|
2
2
|
import { IdCaptureValues, SelfieCaptureValues } from '../../../helpers/textValues';
|
|
3
3
|
import { delay } from '../../../utils/utils';
|
|
4
|
+
import { BaseComponent } from '../../base-component';
|
|
5
|
+
import { FlowMoments, FlowSteps } from '../../../models/FlowSteps';
|
|
4
6
|
export class CaptureError {
|
|
5
7
|
constructor() {
|
|
6
8
|
this.type = undefined;
|
|
7
9
|
this.buttonEnabled = undefined;
|
|
8
10
|
this.buttonText = undefined;
|
|
11
|
+
this.baseComponent = new BaseComponent(FlowSteps.CiError);
|
|
9
12
|
}
|
|
10
13
|
async componentWillLoad() {
|
|
11
14
|
this.buttonEnabled = false;
|
|
@@ -23,6 +26,7 @@ export class CaptureError {
|
|
|
23
26
|
}
|
|
24
27
|
}
|
|
25
28
|
async componentDidLoad() {
|
|
29
|
+
await this.baseComponent.logStep(FlowSteps.CiError, FlowMoments.Initialized);
|
|
26
30
|
for (let i = 5; i >= 1; i--) {
|
|
27
31
|
this.buttonText = i.toString();
|
|
28
32
|
await delay(1000);
|
|
@@ -30,8 +34,9 @@ export class CaptureError {
|
|
|
30
34
|
this.buttonText = IdCaptureValues.Button;
|
|
31
35
|
this.buttonEnabled = true;
|
|
32
36
|
}
|
|
33
|
-
buttonClick() {
|
|
37
|
+
async buttonClick() {
|
|
34
38
|
this.buttonEnabled = false;
|
|
39
|
+
await this.baseComponent.logStep(FlowSteps.CiError, FlowMoments.Finalized);
|
|
35
40
|
this.eventCaptureErrorDone.emit();
|
|
36
41
|
}
|
|
37
42
|
render() {
|
|
@@ -29,7 +29,7 @@ export class IdBackCapture {
|
|
|
29
29
|
this.verified = false;
|
|
30
30
|
this.cameras = new Cameras();
|
|
31
31
|
this.showDemo = true;
|
|
32
|
-
this.baseComponent = new BaseComponent(FlowSteps.
|
|
32
|
+
this.baseComponent = new BaseComponent(FlowSteps.CiBackCapture);
|
|
33
33
|
}
|
|
34
34
|
eventVideoStarted(event) {
|
|
35
35
|
this.videoStarted = true;
|
|
@@ -42,7 +42,7 @@ export class IdBackCapture {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
async componentDidLoad() {
|
|
45
|
-
await this.baseComponent.logStep(FlowSteps.
|
|
45
|
+
await this.baseComponent.logStep(FlowSteps.CiBackCapture, FlowMoments.Initialized);
|
|
46
46
|
this.titleMesage = IdCaptureValues.TtileRotate;
|
|
47
47
|
this.demoVideo.src = IdCaptureValues.IDPoseDemoMapping[IDPose.Rotate];
|
|
48
48
|
this.demoVideo.play();
|
|
@@ -52,11 +52,9 @@ export class IdBackCapture {
|
|
|
52
52
|
this.demoVideo.play();
|
|
53
53
|
await delay(IdCaptureValues.VideoLenght);
|
|
54
54
|
this.showDemo = false;
|
|
55
|
-
await this.baseComponent.logStep(FlowSteps.CiBackHoldAnimation, FlowMoments.Finalized);
|
|
56
55
|
this.openCamera();
|
|
57
56
|
}
|
|
58
57
|
async openCamera() {
|
|
59
|
-
await this.baseComponent.logStep(FlowSteps.CiBackCapture, FlowMoments.Initialized);
|
|
60
58
|
const constraints = this.cameras.GetConstraints(store.cameraId, store.device);
|
|
61
59
|
setTimeout(() => {
|
|
62
60
|
navigator.mediaDevices
|
|
@@ -29,7 +29,7 @@ export class IdCapture {
|
|
|
29
29
|
this.verified = false;
|
|
30
30
|
this.cameras = new Cameras();
|
|
31
31
|
this.showDemo = true;
|
|
32
|
-
this.baseComponent = new BaseComponent(FlowSteps.
|
|
32
|
+
this.baseComponent = new BaseComponent(FlowSteps.CiFrontCapture);
|
|
33
33
|
}
|
|
34
34
|
eventVideoStarted(event) {
|
|
35
35
|
this.videoStarted = true;
|
|
@@ -43,16 +43,14 @@ export class IdCapture {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
async componentDidLoad() {
|
|
46
|
-
await this.baseComponent.logStep(FlowSteps.
|
|
46
|
+
await this.baseComponent.logStep(FlowSteps.CiFrontCapture, FlowMoments.Initialized);
|
|
47
47
|
this.demoVideo.src = IdCaptureValues.IDPoseDemoMapping[IDPose.Straight];
|
|
48
48
|
this.demoVideo.play();
|
|
49
49
|
await delay(IdCaptureValues.VideoLenght);
|
|
50
50
|
this.showDemo = false;
|
|
51
|
-
await this.baseComponent.logStep(FlowSteps.CiFrontHoldAnimation, FlowMoments.Finalized);
|
|
52
51
|
this.openCamera();
|
|
53
52
|
}
|
|
54
53
|
async openCamera() {
|
|
55
|
-
await this.baseComponent.logStep(FlowSteps.CiFrontCapture, FlowMoments.Initialized);
|
|
56
54
|
const constraints = this.cameras.GetConstraints(store.cameraId, store.device);
|
|
57
55
|
setTimeout(() => {
|
|
58
56
|
navigator.mediaDevices
|
|
@@ -29,7 +29,7 @@ export class IdTilt {
|
|
|
29
29
|
this.verified = false;
|
|
30
30
|
this.cameras = new Cameras();
|
|
31
31
|
this.showDemo = true;
|
|
32
|
-
this.baseComponent = new BaseComponent(FlowSteps.
|
|
32
|
+
this.baseComponent = new BaseComponent(FlowSteps.CiTilt);
|
|
33
33
|
}
|
|
34
34
|
eventVideoStarted(event) {
|
|
35
35
|
this.videoStarted = true;
|
|
@@ -43,16 +43,14 @@ export class IdTilt {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
async componentDidLoad() {
|
|
46
|
-
await this.baseComponent.logStep(FlowSteps.
|
|
46
|
+
await this.baseComponent.logStep(FlowSteps.CiTilt, FlowMoments.Initialized);
|
|
47
47
|
this.demoVideo.src = IdCaptureValues.IDPoseDemoMapping[IDPose.Tilted];
|
|
48
48
|
this.demoVideo.play();
|
|
49
49
|
await delay(IdCaptureValues.VideoLenght);
|
|
50
50
|
this.showDemo = false;
|
|
51
|
-
await this.baseComponent.logStep(FlowSteps.CiFrontTiltAnimation, FlowMoments.Finalized);
|
|
52
51
|
this.openCamera();
|
|
53
52
|
}
|
|
54
53
|
async openCamera() {
|
|
55
|
-
await this.baseComponent.logStep(FlowSteps.CiTilt, FlowMoments.Initialized);
|
|
56
54
|
const constraints = this.cameras.GetConstraints(store.cameraId, store.device);
|
|
57
55
|
setTimeout(() => {
|
|
58
56
|
navigator.mediaDevices
|
|
@@ -139,7 +137,7 @@ export class IdTilt {
|
|
|
139
137
|
static get events() {
|
|
140
138
|
return [{
|
|
141
139
|
"method": "eventPhotoCapture",
|
|
142
|
-
"name": "
|
|
140
|
+
"name": "photoTiltCapture",
|
|
143
141
|
"bubbles": true,
|
|
144
142
|
"cancelable": true,
|
|
145
143
|
"composed": true,
|
|
@@ -30,23 +30,7 @@ export class SelfieCapture {
|
|
|
30
30
|
this.cameras = new Cameras();
|
|
31
31
|
this.demoEnded = false;
|
|
32
32
|
this.uploadingLink = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_selfie.mp4';
|
|
33
|
-
this.baseComponent = new BaseComponent(FlowSteps.
|
|
34
|
-
}
|
|
35
|
-
async eventChangeTitle(event) {
|
|
36
|
-
// this.stopAnimation = false;
|
|
37
|
-
if (event.detail == null) {
|
|
38
|
-
this.titleMesage = SelfieCaptureValues.FinalTitle;
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
await this.baseComponent.logStep(FlowSteps.SelfieTiltAnimation, FlowMoments.Initialized);
|
|
42
|
-
this.titleMesage = SelfieCaptureValues.FacePoseMapping[event.detail];
|
|
43
|
-
this.demoEnded = false;
|
|
44
|
-
this.demoVideo.src = SelfieCaptureValues.FacePoseDemoMapping[event.detail];
|
|
45
|
-
this.demoVideo.play();
|
|
46
|
-
await delay(SelfieCaptureValues.VideoLenght);
|
|
47
|
-
this.demoEnded = true;
|
|
48
|
-
await this.baseComponent.logStep(FlowSteps.SelfieTiltAnimation, FlowMoments.Finalized);
|
|
49
|
-
}
|
|
33
|
+
this.baseComponent = new BaseComponent(FlowSteps.SelfieCapture);
|
|
50
34
|
}
|
|
51
35
|
eventVideoStarted(event) {
|
|
52
36
|
this.videoStarted = true;
|
|
@@ -63,16 +47,14 @@ export class SelfieCapture {
|
|
|
63
47
|
}
|
|
64
48
|
}
|
|
65
49
|
async componentDidLoad() {
|
|
66
|
-
await this.baseComponent.logStep(FlowSteps.
|
|
50
|
+
await this.baseComponent.logStep(FlowSteps.SelfieCapture, FlowMoments.Initialized);
|
|
67
51
|
this.demoVideo.src = SelfieCaptureValues.FacePoseDemoMapping[FacePose.Main];
|
|
68
52
|
this.demoVideo.play();
|
|
69
53
|
await delay(SelfieCaptureValues.VideoLenght);
|
|
70
54
|
this.demoEnded = true;
|
|
71
|
-
await this.baseComponent.logStep(FlowSteps.SelfieHoldAnimation, FlowMoments.Finalized);
|
|
72
55
|
this.openCamera();
|
|
73
56
|
}
|
|
74
57
|
async openCamera() {
|
|
75
|
-
await this.baseComponent.logStep(FlowSteps.SelfieCapture, FlowMoments.Initialized);
|
|
76
58
|
const constraints = this.cameras.GetConstraints('', store.device, true);
|
|
77
59
|
setTimeout(() => {
|
|
78
60
|
navigator.mediaDevices
|
|
@@ -103,7 +85,7 @@ export class SelfieCapture {
|
|
|
103
85
|
this.captureTaken = true;
|
|
104
86
|
let res = await Stream.getInstance(VerificationMode.Full).takePhoto();
|
|
105
87
|
this.photoIsReady(res);
|
|
106
|
-
await this.baseComponent.logStep(FlowSteps.
|
|
88
|
+
await this.baseComponent.logStep(FlowSteps.SelfieCapture, FlowMoments.Finalized);
|
|
107
89
|
}
|
|
108
90
|
verificationFinished() {
|
|
109
91
|
if (this.verified)
|
|
@@ -193,12 +175,6 @@ export class SelfieCapture {
|
|
|
193
175
|
static get elementRef() { return "component"; }
|
|
194
176
|
static get listeners() {
|
|
195
177
|
return [{
|
|
196
|
-
"name": "changeTitle",
|
|
197
|
-
"method": "eventChangeTitle",
|
|
198
|
-
"target": undefined,
|
|
199
|
-
"capture": false,
|
|
200
|
-
"passive": false
|
|
201
|
-
}, {
|
|
202
178
|
"name": "videoStarted",
|
|
203
179
|
"method": "eventVideoStarted",
|
|
204
180
|
"target": undefined,
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import { Cameras } from '../../../helpers/Cameras';
|
|
3
|
+
import { Stream } from '../../../helpers/Stream';
|
|
4
|
+
import { SelfieCaptureValues } from '../../../helpers/textValues';
|
|
5
|
+
import { FaceML5Detector } from '../../../libs/FaceML5Detector/FaceML5Detector';
|
|
6
|
+
import { delay } from '../../../utils/utils';
|
|
7
|
+
import store from '../../../helpers/store';
|
|
8
|
+
import { BaseComponent } from '../../base-component';
|
|
9
|
+
import { FlowMoments, FlowSteps } from '../../../models/FlowSteps';
|
|
10
|
+
import { VerificationMode } from '../../../models/IVerificationMode';
|
|
11
|
+
export class SelfieTilt {
|
|
12
|
+
// @State() private animationPath: string;
|
|
13
|
+
constructor() {
|
|
14
|
+
this.photoIsReady = photos => {
|
|
15
|
+
//this.closeCamera();
|
|
16
|
+
this.eventPhotoCapture.emit(photos);
|
|
17
|
+
};
|
|
18
|
+
this.videoStarted = undefined;
|
|
19
|
+
this.captureTaken = undefined;
|
|
20
|
+
this.verified = undefined;
|
|
21
|
+
this.titleMesage = undefined;
|
|
22
|
+
this.demoEnded = undefined;
|
|
23
|
+
this.demoVideo = undefined;
|
|
24
|
+
this.uploadingLink = undefined;
|
|
25
|
+
this.captureHeight = undefined;
|
|
26
|
+
this.captureWidth = undefined;
|
|
27
|
+
this.captureTaken = false;
|
|
28
|
+
this.verified = false;
|
|
29
|
+
this.cameras = new Cameras();
|
|
30
|
+
this.demoEnded = false;
|
|
31
|
+
this.uploadingLink = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_selfie.mp4';
|
|
32
|
+
this.baseComponent = new BaseComponent(FlowSteps.SelfieTilt);
|
|
33
|
+
}
|
|
34
|
+
async eventChangeTitle(event) {
|
|
35
|
+
// this.stopAnimation = false;
|
|
36
|
+
if (event.detail == null) {
|
|
37
|
+
this.titleMesage = SelfieCaptureValues.FinalTitle;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
this.titleMesage = SelfieCaptureValues.FacePoseMapping[event.detail];
|
|
41
|
+
this.demoEnded = false;
|
|
42
|
+
this.demoVideo.src = SelfieCaptureValues.FacePoseDemoMapping[event.detail];
|
|
43
|
+
this.demoVideo.play();
|
|
44
|
+
await delay(SelfieCaptureValues.VideoLenght);
|
|
45
|
+
this.demoEnded = true;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
eventVideoStarted(event) {
|
|
49
|
+
this.videoStarted = true;
|
|
50
|
+
var cameraSize = event.detail;
|
|
51
|
+
var height = Math.round((cameraSize.width * 16) / 9);
|
|
52
|
+
this.captureHeight = height - Math.round((window.screen.height - height) / 2);
|
|
53
|
+
this.captureWidth = Math.round((this.captureHeight * 9) / 16);
|
|
54
|
+
}
|
|
55
|
+
componentWillLoad() {
|
|
56
|
+
this.titleMesage = SelfieCaptureValues.Title;
|
|
57
|
+
//this.videoDemoStyle = this.device.isMobile ? { 'width': window.screen.width + 'px', 'height': window.screen.height + 'px', 'object-fit': 'fill' } : {};
|
|
58
|
+
if (!navigator.mediaDevices) {
|
|
59
|
+
this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
async componentDidLoad() {
|
|
63
|
+
this.mainStream = Stream.getInstance(VerificationMode.Tilt);
|
|
64
|
+
await this.baseComponent.logStep(FlowSteps.SelfieTilt, FlowMoments.Initialized);
|
|
65
|
+
this.openCamera();
|
|
66
|
+
}
|
|
67
|
+
async openCamera() {
|
|
68
|
+
const constraints = this.cameras.GetConstraints('', store.device, true);
|
|
69
|
+
setTimeout(() => {
|
|
70
|
+
navigator.mediaDevices
|
|
71
|
+
.getUserMedia(constraints)
|
|
72
|
+
.then(stream => {
|
|
73
|
+
this.mainStream.initStream(stream);
|
|
74
|
+
})
|
|
75
|
+
.catch(e => {
|
|
76
|
+
this.closeCamera();
|
|
77
|
+
this.apiErrorEvent.emit(e);
|
|
78
|
+
});
|
|
79
|
+
}, 100);
|
|
80
|
+
}
|
|
81
|
+
closeCamera() {
|
|
82
|
+
if (this.mainStream) {
|
|
83
|
+
this.mainStream.dropStream();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
disconnectedCallback() {
|
|
87
|
+
this.closeCamera();
|
|
88
|
+
Stream.instance = null;
|
|
89
|
+
FaceML5Detector.instance = null;
|
|
90
|
+
}
|
|
91
|
+
async takePhoto() {
|
|
92
|
+
if (this.captureTaken)
|
|
93
|
+
return;
|
|
94
|
+
this.captureTaken = true;
|
|
95
|
+
let res = this.mainStream.takePhoto();
|
|
96
|
+
this.photoIsReady(res);
|
|
97
|
+
await this.baseComponent.logStep(FlowSteps.SelfieCapture, FlowMoments.Finalized);
|
|
98
|
+
}
|
|
99
|
+
verificationFinished() {
|
|
100
|
+
if (this.verified)
|
|
101
|
+
return;
|
|
102
|
+
this.verified = true;
|
|
103
|
+
this.titleMesage = SelfieCaptureValues.Loading;
|
|
104
|
+
this.closeCamera();
|
|
105
|
+
this.demoEnded = false;
|
|
106
|
+
this.demoVideo.src = this.uploadingLink;
|
|
107
|
+
this.demoVideo.loop = true;
|
|
108
|
+
this.demoVideo.play();
|
|
109
|
+
}
|
|
110
|
+
render() {
|
|
111
|
+
let cameraStyle;
|
|
112
|
+
if (store.device.isMobile && this.videoStarted) {
|
|
113
|
+
cameraStyle = {
|
|
114
|
+
'width': this.captureWidth + 'px',
|
|
115
|
+
'height': this.captureHeight + 'px',
|
|
116
|
+
'overflow': 'hidden',
|
|
117
|
+
'borderRadius': '10px',
|
|
118
|
+
'text-align': 'center',
|
|
119
|
+
'margin': 'auto',
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
let titleClass = this.verified ? 'color-black-2 text-center' : 'color-white text-center';
|
|
123
|
+
//let videoClass = this.device.isMobile ? '' : 'video-demo';
|
|
124
|
+
let bgDemo = this.verified ? 'container' : 'container bg-black';
|
|
125
|
+
return (h("div", { class: bgDemo }, h("div", { class: "container-video" }, h("div", { hidden: this.demoEnded }, h("video", { id: "howtoSelfie", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, h("source", { type: "video/mp4" }))), h("div", { hidden: this.demoEnded == false }, h("div", { hidden: this.verified }, h("div", { class: "video-capture" }, h("div", { style: cameraStyle }, h("camera-comp", { "capture-mode": "selfie" }))))), h("div", { class: "capture-title" }, h("h1", { class: titleClass }, this.titleMesage), h("p", { class: "main-text font-size-18 text-right mb-0" }, SelfieCaptureValues.FooterText)))));
|
|
126
|
+
}
|
|
127
|
+
static get is() { return "selfie-tilt"; }
|
|
128
|
+
static get originalStyleUrls() {
|
|
129
|
+
return {
|
|
130
|
+
"$": ["selfie-tilt.css"]
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
static get styleUrls() {
|
|
134
|
+
return {
|
|
135
|
+
"$": ["selfie-tilt.css"]
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
static get states() {
|
|
139
|
+
return {
|
|
140
|
+
"videoStarted": {},
|
|
141
|
+
"captureTaken": {},
|
|
142
|
+
"verified": {},
|
|
143
|
+
"titleMesage": {},
|
|
144
|
+
"demoEnded": {},
|
|
145
|
+
"demoVideo": {},
|
|
146
|
+
"uploadingLink": {},
|
|
147
|
+
"captureHeight": {},
|
|
148
|
+
"captureWidth": {}
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
static get events() {
|
|
152
|
+
return [{
|
|
153
|
+
"method": "eventPhotoCapture",
|
|
154
|
+
"name": "photoSelfieTiltCapture",
|
|
155
|
+
"bubbles": true,
|
|
156
|
+
"cancelable": true,
|
|
157
|
+
"composed": true,
|
|
158
|
+
"docs": {
|
|
159
|
+
"tags": [],
|
|
160
|
+
"text": ""
|
|
161
|
+
},
|
|
162
|
+
"complexType": {
|
|
163
|
+
"original": "any",
|
|
164
|
+
"resolved": "any",
|
|
165
|
+
"references": {}
|
|
166
|
+
}
|
|
167
|
+
}, {
|
|
168
|
+
"method": "apiErrorEvent",
|
|
169
|
+
"name": "apiError",
|
|
170
|
+
"bubbles": true,
|
|
171
|
+
"cancelable": true,
|
|
172
|
+
"composed": true,
|
|
173
|
+
"docs": {
|
|
174
|
+
"tags": [],
|
|
175
|
+
"text": ""
|
|
176
|
+
},
|
|
177
|
+
"complexType": {
|
|
178
|
+
"original": "any",
|
|
179
|
+
"resolved": "any",
|
|
180
|
+
"references": {}
|
|
181
|
+
}
|
|
182
|
+
}];
|
|
183
|
+
}
|
|
184
|
+
static get elementRef() { return "component"; }
|
|
185
|
+
static get listeners() {
|
|
186
|
+
return [{
|
|
187
|
+
"name": "changeTitle",
|
|
188
|
+
"method": "eventChangeTitle",
|
|
189
|
+
"target": undefined,
|
|
190
|
+
"capture": false,
|
|
191
|
+
"passive": false
|
|
192
|
+
}, {
|
|
193
|
+
"name": "videoStarted",
|
|
194
|
+
"method": "eventVideoStarted",
|
|
195
|
+
"target": undefined,
|
|
196
|
+
"capture": false,
|
|
197
|
+
"passive": false
|
|
198
|
+
}, {
|
|
199
|
+
"name": "takePhoto",
|
|
200
|
+
"method": "takePhoto",
|
|
201
|
+
"target": undefined,
|
|
202
|
+
"capture": false,
|
|
203
|
+
"passive": false
|
|
204
|
+
}, {
|
|
205
|
+
"name": "verificationFinished",
|
|
206
|
+
"method": "verificationFinished",
|
|
207
|
+
"target": undefined,
|
|
208
|
+
"capture": false,
|
|
209
|
+
"passive": false
|
|
210
|
+
}];
|
|
211
|
+
}
|
|
212
|
+
}
|