@ekyc_qoobiss/qbs-ect-cmp 3.6.27 → 3.6.29
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/TranslationUtils-b918ffb1.js +346 -0
- package/dist/cjs/agreement-check_19.cjs.entry.js +9997 -0
- package/dist/cjs/index-41696e0e.js +1573 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader-dots.cjs.entry.js +19 -0
- package/dist/cjs/loader.cjs.js +22 -0
- package/dist/cjs/qbs-ect-cmp.cjs.js +23 -0
- package/dist/cjs/random-actions.cjs.entry.js +22 -0
- package/dist/collection/assets/canvas-masks/face_green.svg +8 -0
- package/dist/collection/assets/canvas-masks/face_white.svg +8 -0
- package/dist/collection/assets/canvas-masks/id_green.svg +6 -0
- package/dist/collection/assets/canvas-masks/id_white.svg +6 -0
- package/dist/collection/assets/complete.svg +4 -0
- package/dist/collection/assets/landing/device.svg +14 -0
- package/dist/collection/assets/landing/id.svg +3 -0
- package/dist/collection/assets/landing/info.svg +3 -0
- package/dist/collection/assets/landing/validation.svg +16 -0
- package/dist/collection/assets/loader.svg +29 -0
- package/dist/collection/collection-manifest.json +32 -0
- package/dist/collection/components/base-component.js +59 -0
- package/dist/collection/components/common/agreement-check/agreement-check.css +0 -0
- package/dist/collection/components/common/agreement-check/agreement-check.js +108 -0
- package/dist/collection/components/common/camera-error/camera-error.css +0 -0
- package/dist/collection/components/common/camera-error/camera-error.js +93 -0
- package/dist/collection/components/common/capture-error/capture-error.css +0 -0
- package/dist/collection/components/common/capture-error/capture-error.js +102 -0
- package/dist/collection/components/common/how-to-info/how-to-info.css +0 -0
- package/dist/collection/components/common/how-to-info/how-to-info.js +123 -0
- package/dist/collection/components/common/id-back-capture/id-back-capture.css +35 -0
- package/dist/{qbs-ect-cmp/id-back-capture.entry.js → collection/components/common/id-back-capture/id-back-capture.js} +102 -30
- package/dist/collection/components/common/id-capture/id-capture.css +35 -0
- package/dist/{qbs-ect-cmp/id-capture.entry.js → collection/components/common/id-capture/id-capture.js} +100 -28
- package/dist/collection/components/common/id-tilt/id-tilt.css +35 -0
- package/dist/{qbs-ect-cmp/id-tilt.entry.js → collection/components/common/id-tilt/id-tilt.js} +100 -28
- package/dist/collection/components/common/random-actions/random-actions.css +0 -0
- package/dist/collection/components/common/random-actions/random-actions.js +23 -0
- package/dist/collection/components/common/selfie-capture/selfie-capture.css +7 -0
- package/dist/{qbs-ect-cmp/selfie-capture.entry.js → collection/components/common/selfie-capture/selfie-capture.js} +102 -29
- package/dist/collection/components/common/selfie-tilt/selfie-tilt.css +7 -0
- package/dist/{qbs-ect-cmp/selfie-tilt.entry.js → collection/components/common/selfie-tilt/selfie-tilt.js} +103 -30
- package/dist/collection/components/controls/camera/camera.css +47 -0
- package/dist/collection/components/controls/camera/camera.js +289 -0
- package/dist/collection/components/controls/loader-dots/loader-dots.css +61 -0
- package/dist/collection/components/controls/loader-dots/loader-dots.js +18 -0
- package/dist/collection/components/flow/agreement-info/agreement-info.css +0 -0
- package/dist/collection/components/flow/agreement-info/agreement-info.js +107 -0
- package/dist/collection/components/flow/end-redirect/end-redirect.css +128 -0
- package/dist/collection/components/flow/end-redirect/end-redirect.js +48 -0
- package/dist/collection/components/flow/error-end/error-end.css +0 -0
- package/dist/collection/components/flow/error-end/error-end.js +61 -0
- package/dist/collection/components/flow/landing-validation/landing-validation.css +0 -0
- package/dist/collection/components/flow/landing-validation/landing-validation.js +124 -0
- package/dist/collection/components/flow/mobile-redirect/mobile-redirect.css +10 -0
- package/dist/collection/components/flow/mobile-redirect/mobile-redirect.js +145 -0
- package/dist/collection/components/flow/process-id/process-id.css +0 -0
- package/dist/{qbs-ect-cmp/process-id.entry.js → collection/components/flow/process-id/process-id.js} +100 -32
- package/dist/collection/components/flow/sms-code-validation/sms-code-validation.css +0 -0
- package/dist/collection/components/flow/sms-code-validation/sms-code-validation.js +141 -0
- package/dist/collection/components/flow/user-liveness/user-liveness.css +0 -0
- package/dist/{qbs-ect-cmp/user-liveness.entry.js → collection/components/flow/user-liveness/user-liveness.js} +91 -25
- package/dist/collection/components/identification-component/identification-component.css +991 -0
- package/dist/collection/components/identification-component/identification-component.js +408 -0
- package/dist/collection/global.js +0 -0
- package/dist/collection/helpers/ApiCall.js +223 -0
- package/dist/{qbs-ect-cmp/Cameras-dfbebc29.js → collection/helpers/Cameras.js} +6 -9
- package/dist/collection/helpers/DeviceDetection.js +85 -0
- package/dist/collection/helpers/Events.js +58 -0
- package/dist/collection/helpers/ML5.js +38 -0
- package/dist/collection/helpers/Stream.js +229 -0
- package/dist/collection/helpers/TranslationUtils.js +37 -0
- package/dist/collection/helpers/canvas.js +10 -0
- package/dist/collection/helpers/index.js +21 -0
- package/dist/collection/helpers/security.js +25 -0
- package/dist/collection/helpers/store.js +48 -0
- package/dist/collection/helpers/textValues.js +48 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/libs/FaceML5Detector/FaceML5Detector.js +182 -0
- package/dist/collection/libs/FaceML5Detector/FacePose.js +85 -0
- package/dist/collection/libs/IDML5Detector/IDML5Detector.js +99 -0
- package/dist/{qbs-ect-cmp/IDPose-181bcb25.js → collection/libs/IDML5Detector/IDPose.js} +2 -4
- package/dist/{qbs-ect-cmp/CaptureFlow-db5d90a4.js → collection/models/CaptureFlow.js} +4 -6
- package/dist/collection/models/FlowStatus.js +14 -0
- package/dist/collection/models/FlowSteps.js +30 -0
- package/dist/collection/models/IAbortResult.js +1 -0
- package/dist/collection/models/IAddRequest.js +1 -0
- package/dist/collection/models/IAgreement.js +1 -0
- package/dist/collection/models/ICamera.js +1 -0
- package/dist/{qbs-ect-cmp/IDevice-15ecfdeb.js → collection/models/IDevice.js} +4 -6
- package/dist/collection/models/IEctStore.js +1 -0
- package/dist/collection/models/IGeneration.js +1 -0
- package/dist/collection/models/ILinkSend.js +1 -0
- package/dist/collection/models/ILogResult.js +1 -0
- package/dist/collection/models/IOrderStatus.js +1 -0
- package/dist/collection/models/IOtpCheck.js +1 -0
- package/dist/collection/models/IOtpSend.js +1 -0
- package/dist/collection/models/ITranslationValues.js +1 -0
- package/dist/collection/models/IUploadFile.js +1 -0
- package/dist/collection/models/IVerificationMode.js +5 -0
- package/dist/collection/models/OrderStatuses.js +8 -0
- package/dist/{qbs-ect-cmp/utils-8225f0b7.js → collection/utils/utils.js} +8 -10
- package/dist/{qbs-ect-cmp/textValues-6bcc85dd.js → esm/TranslationUtils-8ceeb437.js} +84 -47
- package/dist/esm/agreement-check_19.entry.js +9975 -0
- package/dist/esm/index-cf54a432.js +1543 -0
- package/dist/esm/index.js +1 -0
- package/dist/{qbs-ect-cmp → esm}/loader-dots.entry.js +1 -1
- package/dist/esm/loader.js +18 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/esm/qbs-ect-cmp.js +18 -0
- package/dist/{qbs-ect-cmp → esm}/random-actions.entry.js +6 -9
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/loader/cdn.js +3 -0
- package/dist/loader/index.cjs.js +3 -0
- package/dist/loader/index.d.ts +21 -0
- package/dist/loader/index.es2017.js +3 -0
- package/dist/loader/index.js +4 -0
- package/dist/loader/package.json +11 -0
- package/dist/qbs-ect-cmp/index.esm.js +0 -1
- package/dist/qbs-ect-cmp/p-054dc5b3.entry.js +1 -0
- package/dist/qbs-ect-cmp/p-473a4636.entry.js +1 -0
- package/dist/qbs-ect-cmp/p-8942656c.js +2 -0
- package/dist/qbs-ect-cmp/p-b2c9c8d7.entry.js +1373 -0
- package/dist/qbs-ect-cmp/p-e568a07c.js +1 -0
- package/dist/qbs-ect-cmp/qbs-ect-cmp.css +1 -320
- package/dist/qbs-ect-cmp/qbs-ect-cmp.esm.js +1 -148
- package/dist/types/components/base-component.d.ts +0 -2
- package/dist/types/components/common/agreement-check/agreement-check.d.ts +2 -0
- package/dist/types/components/common/camera-error/camera-error.d.ts +1 -0
- package/dist/types/components/common/capture-error/capture-error.d.ts +1 -0
- package/dist/types/components/common/how-to-info/how-to-info.d.ts +2 -1
- package/dist/types/components/common/id-back-capture/id-back-capture.d.ts +1 -0
- package/dist/types/components/common/id-capture/id-capture.d.ts +1 -0
- package/dist/types/components/common/id-tilt/id-tilt.d.ts +1 -0
- package/dist/types/components/common/random-actions/random-actions.d.ts +2 -2
- package/dist/types/components/common/selfie-capture/selfie-capture.d.ts +2 -1
- package/dist/types/components/common/selfie-tilt/selfie-tilt.d.ts +2 -1
- package/dist/types/components/flow/agreement-info/agreement-info.d.ts +2 -1
- package/dist/types/components/flow/end-redirect/end-redirect.d.ts +2 -1
- package/dist/types/components/flow/landing-validation/landing-validation.d.ts +1 -0
- package/dist/types/components/flow/mobile-redirect/mobile-redirect.d.ts +1 -0
- package/dist/types/components/flow/sms-code-validation/sms-code-validation.d.ts +2 -1
- package/package.json +1 -1
- package/dist/qbs-ect-cmp/ML5-657ef934.js +0 -1370
- package/dist/qbs-ect-cmp/Stream-b867a2be.js +0 -3104
- package/dist/qbs-ect-cmp/_commonjsHelpers-321aa363.js +0 -44
- package/dist/qbs-ect-cmp/agreement-check.entry.js +0 -41
- package/dist/qbs-ect-cmp/agreement-info.entry.js +0 -66
- package/dist/qbs-ect-cmp/app-globals-0f993ce5.js +0 -3
- package/dist/qbs-ect-cmp/base-component-2e490fd9.js +0 -502
- package/dist/qbs-ect-cmp/camera-comp.entry.js +0 -103
- package/dist/qbs-ect-cmp/camera-error.entry.js +0 -59
- package/dist/qbs-ect-cmp/capture-error.entry.js +0 -53
- package/dist/qbs-ect-cmp/css-shim-b7d3d95f.js +0 -4
- package/dist/qbs-ect-cmp/dom-64053c71.js +0 -73
- package/dist/qbs-ect-cmp/end-redirect.entry.js +0 -25
- package/dist/qbs-ect-cmp/error-end.entry.js +0 -19
- package/dist/qbs-ect-cmp/how-to-info.entry.js +0 -52
- package/dist/qbs-ect-cmp/identification-component.entry.js +0 -909
- package/dist/qbs-ect-cmp/index-78a05b9e.js +0 -3371
- package/dist/qbs-ect-cmp/landing-validation.entry.js +0 -90
- package/dist/qbs-ect-cmp/mobile-redirect.entry.js +0 -2984
- package/dist/qbs-ect-cmp/shadow-css-98135883.js +0 -387
- package/dist/qbs-ect-cmp/sms-code-validation.entry.js +0 -106
package/dist/{qbs-ect-cmp/id-tilt.entry.js → collection/components/common/id-tilt/id-tilt.js}
RENAMED
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import '
|
|
9
|
-
import '
|
|
10
|
-
import '
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import { Cameras } from '../../../helpers/Cameras';
|
|
3
|
+
import { Stream } from '../../../helpers/Stream';
|
|
4
|
+
import { IdCaptureValues } from '../../../helpers/textValues';
|
|
5
|
+
import { IDML5Detector } from '../../../libs/IDML5Detector/IDML5Detector';
|
|
6
|
+
import { FaceML5Detector } from '../../../libs/FaceML5Detector/FaceML5Detector';
|
|
7
|
+
import { IDPose } from '../../../libs/IDML5Detector/IDPose';
|
|
8
|
+
import { delay } from '../../../utils/utils';
|
|
9
|
+
import store from '../../../helpers/store';
|
|
10
|
+
import { BaseComponent } from '../../base-component';
|
|
11
|
+
import { FlowMoments, FlowSteps } from '../../../models/FlowSteps';
|
|
12
|
+
import { VerificationMode } from '../../../models/IVerificationMode';
|
|
13
|
+
import { Translations } from '../../../helpers/TranslationUtils';
|
|
14
|
+
// import { IDPose } from '../../libs/IDML5Detector/IDPose';
|
|
15
|
+
export class IdTilt {
|
|
15
16
|
// @State() private animationPath: string;
|
|
16
|
-
constructor(
|
|
17
|
-
registerInstance(this, hostRef);
|
|
18
|
-
this.eventPhotoCapture = createEvent(this, "photoTiltCapture", 7);
|
|
19
|
-
this.apiErrorEvent = createEvent(this, "apiError", 7);
|
|
17
|
+
constructor() {
|
|
20
18
|
this.photoIsReady = photos => {
|
|
21
19
|
//this.closeCamera();
|
|
22
20
|
this.eventPhotoCapture.emit(photos);
|
|
@@ -39,7 +37,8 @@ const IdTilt = class {
|
|
|
39
37
|
this.cameraSize = event.detail;
|
|
40
38
|
}
|
|
41
39
|
async componentWillLoad() {
|
|
42
|
-
this.
|
|
40
|
+
this.translations = await Translations.getValues();
|
|
41
|
+
this.titleMesage = this.translations.IdCaptureValues.IDPoseMapping;
|
|
43
42
|
//this.videoDemoStyle = this.device.isMobile ? { 'width': window.screen.width + 'px', 'height': window.screen.height + 'px', 'object-fit': 'fill' } : {};
|
|
44
43
|
if (!navigator.mediaDevices) {
|
|
45
44
|
this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
|
|
@@ -49,12 +48,12 @@ const IdTilt = class {
|
|
|
49
48
|
await this.baseComponent.logStep(FlowSteps.CiTilt, FlowMoments.Initialized);
|
|
50
49
|
this.demoVideo.src = IdCaptureValues.IDPoseDemoMapping[IDPose.Tilted];
|
|
51
50
|
this.demoVideo.play();
|
|
52
|
-
await delay(this.
|
|
51
|
+
await delay(this.translations.GlobalValues.VideoLenght);
|
|
53
52
|
this.showDemo = false;
|
|
54
53
|
this.openCamera();
|
|
55
54
|
}
|
|
56
55
|
async openCamera() {
|
|
57
|
-
const constraints = this.cameras.GetConstraints(
|
|
56
|
+
const constraints = this.cameras.GetConstraints(store.cameraId, store.device);
|
|
58
57
|
setTimeout(() => {
|
|
59
58
|
navigator.mediaDevices
|
|
60
59
|
.getUserMedia(constraints)
|
|
@@ -91,7 +90,7 @@ const IdTilt = class {
|
|
|
91
90
|
if (this.verified)
|
|
92
91
|
return;
|
|
93
92
|
this.verified = true;
|
|
94
|
-
this.titleMesage = this.
|
|
93
|
+
this.titleMesage = this.translations.IdCaptureValues.Loading;
|
|
95
94
|
this.closeCamera();
|
|
96
95
|
this.showDemo = true;
|
|
97
96
|
this.demoVideo.src = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_id.mp4';
|
|
@@ -113,10 +112,83 @@ const IdTilt = class {
|
|
|
113
112
|
let titleClass = this.verified ? 'color-black-2 text-center' : 'color-white text-center';
|
|
114
113
|
//let videoClass = this.device.isMobile ? '' : 'video-demo';
|
|
115
114
|
let bgDemo = this.verified ? 'container' : 'container bg-black';
|
|
116
|
-
return (h("div", { class: bgDemo }, h("div", { class: "container-video" }, h("div", { hidden: this.showDemo == false }, h("video", { id: "howtoFront", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, h("source", { type: "video/mp4" }))), h("div", { hidden: this.showDemo }, h("div", { hidden: this.verified }, h("div", { class: "video-capture" }, h("div", { style: cameraStyle }, h("div", { style: cameraStyleInner }, h("camera-comp", { "capture-mode": "tilt" })))))), h("div", { class: "capture-title" }, h("h1", { class: titleClass }, this.titleMesage), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.
|
|
115
|
+
return (h("div", { class: bgDemo }, h("div", { class: "container-video" }, h("div", { hidden: this.showDemo == false }, h("video", { id: "howtoFront", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, h("source", { type: "video/mp4" }))), h("div", { hidden: this.showDemo }, h("div", { hidden: this.verified }, h("div", { class: "video-capture" }, h("div", { style: cameraStyle }, h("div", { style: cameraStyleInner }, h("camera-comp", { "capture-mode": "tilt" })))))), h("div", { class: "capture-title" }, h("h1", { class: titleClass }, this.titleMesage), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText)))));
|
|
117
116
|
}
|
|
118
|
-
get
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
117
|
+
static get is() { return "id-tilt"; }
|
|
118
|
+
static get originalStyleUrls() {
|
|
119
|
+
return {
|
|
120
|
+
"$": ["id-tilt.css"]
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
static get styleUrls() {
|
|
124
|
+
return {
|
|
125
|
+
"$": ["id-tilt.css"]
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
static get states() {
|
|
129
|
+
return {
|
|
130
|
+
"videoStarted": {},
|
|
131
|
+
"cameraSize": {},
|
|
132
|
+
"captureTaken": {},
|
|
133
|
+
"verified": {},
|
|
134
|
+
"titleMesage": {},
|
|
135
|
+
"showDemo": {},
|
|
136
|
+
"demoVideo": {}
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
static get events() {
|
|
140
|
+
return [{
|
|
141
|
+
"method": "eventPhotoCapture",
|
|
142
|
+
"name": "photoTiltCapture",
|
|
143
|
+
"bubbles": true,
|
|
144
|
+
"cancelable": true,
|
|
145
|
+
"composed": true,
|
|
146
|
+
"docs": {
|
|
147
|
+
"tags": [],
|
|
148
|
+
"text": ""
|
|
149
|
+
},
|
|
150
|
+
"complexType": {
|
|
151
|
+
"original": "any",
|
|
152
|
+
"resolved": "any",
|
|
153
|
+
"references": {}
|
|
154
|
+
}
|
|
155
|
+
}, {
|
|
156
|
+
"method": "apiErrorEvent",
|
|
157
|
+
"name": "apiError",
|
|
158
|
+
"bubbles": true,
|
|
159
|
+
"cancelable": true,
|
|
160
|
+
"composed": true,
|
|
161
|
+
"docs": {
|
|
162
|
+
"tags": [],
|
|
163
|
+
"text": ""
|
|
164
|
+
},
|
|
165
|
+
"complexType": {
|
|
166
|
+
"original": "any",
|
|
167
|
+
"resolved": "any",
|
|
168
|
+
"references": {}
|
|
169
|
+
}
|
|
170
|
+
}];
|
|
171
|
+
}
|
|
172
|
+
static get elementRef() { return "component"; }
|
|
173
|
+
static get listeners() {
|
|
174
|
+
return [{
|
|
175
|
+
"name": "videoStarted",
|
|
176
|
+
"method": "eventVideoStarted",
|
|
177
|
+
"target": undefined,
|
|
178
|
+
"capture": false,
|
|
179
|
+
"passive": false
|
|
180
|
+
}, {
|
|
181
|
+
"name": "takePhoto",
|
|
182
|
+
"method": "takePhoto",
|
|
183
|
+
"target": undefined,
|
|
184
|
+
"capture": false,
|
|
185
|
+
"passive": false
|
|
186
|
+
}, {
|
|
187
|
+
"name": "verificationFinished",
|
|
188
|
+
"method": "verificationFinished",
|
|
189
|
+
"target": undefined,
|
|
190
|
+
"capture": false,
|
|
191
|
+
"passive": false
|
|
192
|
+
}];
|
|
193
|
+
}
|
|
194
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import { Translations } from '../../../helpers/TranslationUtils';
|
|
3
|
+
export class RandomActions {
|
|
4
|
+
constructor() { }
|
|
5
|
+
async componentWillLoad() {
|
|
6
|
+
this.translations = await Translations.getValues();
|
|
7
|
+
}
|
|
8
|
+
buttonClick() { }
|
|
9
|
+
render() {
|
|
10
|
+
return (h("div", { class: "container" }, h("div", { class: "row" }, h("div", { class: "text-center" }, h("h1", null, this.topTitle)), h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", onClick: () => this.buttonClick() }, this.buttonText), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
|
|
11
|
+
}
|
|
12
|
+
static get is() { return "random-actions"; }
|
|
13
|
+
static get originalStyleUrls() {
|
|
14
|
+
return {
|
|
15
|
+
"$": ["random-actions.css"]
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
static get styleUrls() {
|
|
19
|
+
return {
|
|
20
|
+
"$": ["random-actions.css"]
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import '
|
|
8
|
-
import '
|
|
9
|
-
import '
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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 { FacePose } from '../../../libs/FaceML5Detector/FacePose';
|
|
7
|
+
import { delay } from '../../../utils/utils';
|
|
8
|
+
import store from '../../../helpers/store';
|
|
9
|
+
import { BaseComponent } from '../../base-component';
|
|
10
|
+
import { FlowMoments, FlowSteps } from '../../../models/FlowSteps';
|
|
11
|
+
import { VerificationMode } from '../../../models/IVerificationMode';
|
|
12
|
+
import { Translations } from '../../../helpers/TranslationUtils';
|
|
13
|
+
export class SelfieCapture {
|
|
14
14
|
// @State() private animationPath: string;
|
|
15
|
-
constructor(
|
|
16
|
-
registerInstance(this, hostRef);
|
|
17
|
-
this.eventPhotoCapture = createEvent(this, "photoSelfieCapture", 7);
|
|
18
|
-
this.apiErrorEvent = createEvent(this, "apiError", 7);
|
|
15
|
+
constructor() {
|
|
19
16
|
this.photoIsReady = photos => {
|
|
20
17
|
//this.closeCamera();
|
|
21
18
|
this.eventPhotoCapture.emit(photos);
|
|
@@ -43,8 +40,9 @@ const SelfieCapture = class {
|
|
|
43
40
|
this.captureHeight = height - Math.round((window.screen.height - height) / 2);
|
|
44
41
|
this.captureWidth = Math.round((this.captureHeight * 9) / 16);
|
|
45
42
|
}
|
|
46
|
-
componentWillLoad() {
|
|
47
|
-
this.
|
|
43
|
+
async componentWillLoad() {
|
|
44
|
+
this.translations = await Translations.getValues();
|
|
45
|
+
this.titleMesage = this.translations.SelfieCaptureValues.Title;
|
|
48
46
|
//this.videoDemoStyle = this.device.isMobile ? { 'width': window.screen.width + 'px', 'height': window.screen.height + 'px', 'object-fit': 'fill' } : {};
|
|
49
47
|
if (!navigator.mediaDevices) {
|
|
50
48
|
this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
|
|
@@ -54,12 +52,12 @@ const SelfieCapture = class {
|
|
|
54
52
|
await this.baseComponent.logStep(FlowSteps.SelfieCapture, FlowMoments.Initialized);
|
|
55
53
|
this.demoVideo.src = SelfieCaptureValues.FacePoseDemoMapping[FacePose.Main];
|
|
56
54
|
this.demoVideo.play();
|
|
57
|
-
await delay(this.
|
|
55
|
+
await delay(this.translations.GlobalValues.VideoLenght);
|
|
58
56
|
this.demoEnded = true;
|
|
59
57
|
this.openCamera();
|
|
60
58
|
}
|
|
61
59
|
async openCamera() {
|
|
62
|
-
const constraints = this.cameras.GetConstraints('',
|
|
60
|
+
const constraints = this.cameras.GetConstraints('', store.device, true);
|
|
63
61
|
setTimeout(() => {
|
|
64
62
|
navigator.mediaDevices
|
|
65
63
|
.getUserMedia(constraints)
|
|
@@ -95,7 +93,7 @@ const SelfieCapture = class {
|
|
|
95
93
|
if (this.verified)
|
|
96
94
|
return;
|
|
97
95
|
this.verified = true;
|
|
98
|
-
this.titleMesage = this.
|
|
96
|
+
this.titleMesage = this.translations.SelfieCaptureValues.Loading;
|
|
99
97
|
this.closeCamera();
|
|
100
98
|
this.demoEnded = false;
|
|
101
99
|
this.demoVideo.src = this.uploadingLink;
|
|
@@ -104,7 +102,7 @@ const SelfieCapture = class {
|
|
|
104
102
|
}
|
|
105
103
|
render() {
|
|
106
104
|
let cameraStyle;
|
|
107
|
-
if (
|
|
105
|
+
if (store.device.isMobile && this.videoStarted) {
|
|
108
106
|
cameraStyle = {
|
|
109
107
|
'width': this.captureWidth + 'px',
|
|
110
108
|
'height': this.captureHeight + 'px',
|
|
@@ -117,10 +115,85 @@ const SelfieCapture = class {
|
|
|
117
115
|
let titleClass = this.verified ? 'color-black-2 text-center' : 'color-white text-center';
|
|
118
116
|
//let videoClass = this.device.isMobile ? '' : 'video-demo';
|
|
119
117
|
let bgDemo = this.verified ? 'container' : 'container bg-black';
|
|
120
|
-
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" }, this.
|
|
118
|
+
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" }, this.translations.GlobalValues.FooterText)))));
|
|
121
119
|
}
|
|
122
|
-
get
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
120
|
+
static get is() { return "selfie-capture"; }
|
|
121
|
+
static get originalStyleUrls() {
|
|
122
|
+
return {
|
|
123
|
+
"$": ["selfie-capture.css"]
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
static get styleUrls() {
|
|
127
|
+
return {
|
|
128
|
+
"$": ["selfie-capture.css"]
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
static get states() {
|
|
132
|
+
return {
|
|
133
|
+
"videoStarted": {},
|
|
134
|
+
"captureTaken": {},
|
|
135
|
+
"verified": {},
|
|
136
|
+
"titleMesage": {},
|
|
137
|
+
"demoEnded": {},
|
|
138
|
+
"demoVideo": {},
|
|
139
|
+
"uploadingLink": {},
|
|
140
|
+
"captureHeight": {},
|
|
141
|
+
"captureWidth": {}
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
static get events() {
|
|
145
|
+
return [{
|
|
146
|
+
"method": "eventPhotoCapture",
|
|
147
|
+
"name": "photoSelfieCapture",
|
|
148
|
+
"bubbles": true,
|
|
149
|
+
"cancelable": true,
|
|
150
|
+
"composed": true,
|
|
151
|
+
"docs": {
|
|
152
|
+
"tags": [],
|
|
153
|
+
"text": ""
|
|
154
|
+
},
|
|
155
|
+
"complexType": {
|
|
156
|
+
"original": "any",
|
|
157
|
+
"resolved": "any",
|
|
158
|
+
"references": {}
|
|
159
|
+
}
|
|
160
|
+
}, {
|
|
161
|
+
"method": "apiErrorEvent",
|
|
162
|
+
"name": "apiError",
|
|
163
|
+
"bubbles": true,
|
|
164
|
+
"cancelable": true,
|
|
165
|
+
"composed": true,
|
|
166
|
+
"docs": {
|
|
167
|
+
"tags": [],
|
|
168
|
+
"text": ""
|
|
169
|
+
},
|
|
170
|
+
"complexType": {
|
|
171
|
+
"original": "any",
|
|
172
|
+
"resolved": "any",
|
|
173
|
+
"references": {}
|
|
174
|
+
}
|
|
175
|
+
}];
|
|
176
|
+
}
|
|
177
|
+
static get elementRef() { return "component"; }
|
|
178
|
+
static get listeners() {
|
|
179
|
+
return [{
|
|
180
|
+
"name": "videoStarted",
|
|
181
|
+
"method": "eventVideoStarted",
|
|
182
|
+
"target": undefined,
|
|
183
|
+
"capture": false,
|
|
184
|
+
"passive": false
|
|
185
|
+
}, {
|
|
186
|
+
"name": "takePhoto",
|
|
187
|
+
"method": "takePhoto",
|
|
188
|
+
"target": undefined,
|
|
189
|
+
"capture": false,
|
|
190
|
+
"passive": false
|
|
191
|
+
}, {
|
|
192
|
+
"name": "verificationFinished",
|
|
193
|
+
"method": "verificationFinished",
|
|
194
|
+
"target": undefined,
|
|
195
|
+
"capture": false,
|
|
196
|
+
"passive": false
|
|
197
|
+
}];
|
|
198
|
+
}
|
|
199
|
+
}
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import '
|
|
8
|
-
import '
|
|
9
|
-
import '
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
+
import { FacePose } from '../../../libs/FaceML5Detector/FacePose';
|
|
12
|
+
import { Translations } from '../../../helpers/TranslationUtils';
|
|
13
|
+
export class SelfieTilt {
|
|
14
14
|
// @State() private animationPath: string;
|
|
15
|
-
constructor(
|
|
16
|
-
registerInstance(this, hostRef);
|
|
17
|
-
this.eventPhotoCapture = createEvent(this, "photoSelfieTiltCapture", 7);
|
|
18
|
-
this.apiErrorEvent = createEvent(this, "apiError", 7);
|
|
15
|
+
constructor() {
|
|
19
16
|
this.photoIsReady = photos => {
|
|
20
17
|
//this.closeCamera();
|
|
21
18
|
this.eventPhotoCapture.emit(photos);
|
|
@@ -43,8 +40,9 @@ const SelfieTilt = class {
|
|
|
43
40
|
this.captureHeight = height - Math.round((window.screen.height - height) / 2);
|
|
44
41
|
this.captureWidth = Math.round((this.captureHeight * 9) / 16);
|
|
45
42
|
}
|
|
46
|
-
componentWillLoad() {
|
|
47
|
-
this.
|
|
43
|
+
async componentWillLoad() {
|
|
44
|
+
this.translations = await Translations.getValues();
|
|
45
|
+
this.titleMesage = this.translations.SelfieCaptureValues.Title;
|
|
48
46
|
//this.videoDemoStyle = this.device.isMobile ? { 'width': window.screen.width + 'px', 'height': window.screen.height + 'px', 'object-fit': 'fill' } : {};
|
|
49
47
|
if (!navigator.mediaDevices) {
|
|
50
48
|
this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
|
|
@@ -53,16 +51,16 @@ const SelfieTilt = class {
|
|
|
53
51
|
async componentDidLoad() {
|
|
54
52
|
this.mainStream = Stream.getInstance(VerificationMode.Tilt);
|
|
55
53
|
await this.baseComponent.logStep(FlowSteps.SelfieTilt, FlowMoments.Initialized);
|
|
56
|
-
this.titleMesage = this.
|
|
54
|
+
this.titleMesage = this.translations.SelfieCaptureValues.FacePoseMapping[Object.values(FacePose).indexOf(this.mainStream.facePose)];
|
|
57
55
|
this.demoEnded = false;
|
|
58
56
|
this.demoVideo.src = SelfieCaptureValues.FacePoseDemoMapping[this.mainStream.facePose];
|
|
59
57
|
this.demoVideo.play();
|
|
60
|
-
await delay(this.
|
|
58
|
+
await delay(this.translations.GlobalValues.VideoLenght);
|
|
61
59
|
this.demoEnded = true;
|
|
62
60
|
this.openCamera();
|
|
63
61
|
}
|
|
64
62
|
async openCamera() {
|
|
65
|
-
const constraints = this.cameras.GetConstraints('',
|
|
63
|
+
const constraints = this.cameras.GetConstraints('', store.device, true);
|
|
66
64
|
setTimeout(() => {
|
|
67
65
|
navigator.mediaDevices
|
|
68
66
|
.getUserMedia(constraints)
|
|
@@ -97,7 +95,7 @@ const SelfieTilt = class {
|
|
|
97
95
|
if (this.verified)
|
|
98
96
|
return;
|
|
99
97
|
this.verified = true;
|
|
100
|
-
this.titleMesage = this.
|
|
98
|
+
this.titleMesage = this.translations.SelfieCaptureValues.Loading;
|
|
101
99
|
this.closeCamera();
|
|
102
100
|
this.demoEnded = false;
|
|
103
101
|
this.demoVideo.src = this.uploadingLink;
|
|
@@ -106,7 +104,7 @@ const SelfieTilt = class {
|
|
|
106
104
|
}
|
|
107
105
|
render() {
|
|
108
106
|
let cameraStyle;
|
|
109
|
-
if (
|
|
107
|
+
if (store.device.isMobile && this.videoStarted) {
|
|
110
108
|
cameraStyle = {
|
|
111
109
|
'width': this.captureWidth + 'px',
|
|
112
110
|
'height': this.captureHeight + 'px',
|
|
@@ -119,10 +117,85 @@ const SelfieTilt = class {
|
|
|
119
117
|
let titleClass = this.verified ? 'color-black-2 text-center' : 'color-white text-center';
|
|
120
118
|
//let videoClass = this.device.isMobile ? '' : 'video-demo';
|
|
121
119
|
let bgDemo = this.verified ? 'container' : 'container bg-black';
|
|
122
|
-
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" }, this.
|
|
120
|
+
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" }, this.translations.GlobalValues.FooterText)))));
|
|
123
121
|
}
|
|
124
|
-
get
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
122
|
+
static get is() { return "selfie-tilt"; }
|
|
123
|
+
static get originalStyleUrls() {
|
|
124
|
+
return {
|
|
125
|
+
"$": ["selfie-tilt.css"]
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
static get styleUrls() {
|
|
129
|
+
return {
|
|
130
|
+
"$": ["selfie-tilt.css"]
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
static get states() {
|
|
134
|
+
return {
|
|
135
|
+
"videoStarted": {},
|
|
136
|
+
"captureTaken": {},
|
|
137
|
+
"verified": {},
|
|
138
|
+
"titleMesage": {},
|
|
139
|
+
"demoEnded": {},
|
|
140
|
+
"demoVideo": {},
|
|
141
|
+
"uploadingLink": {},
|
|
142
|
+
"captureHeight": {},
|
|
143
|
+
"captureWidth": {}
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
static get events() {
|
|
147
|
+
return [{
|
|
148
|
+
"method": "eventPhotoCapture",
|
|
149
|
+
"name": "photoSelfieTiltCapture",
|
|
150
|
+
"bubbles": true,
|
|
151
|
+
"cancelable": true,
|
|
152
|
+
"composed": true,
|
|
153
|
+
"docs": {
|
|
154
|
+
"tags": [],
|
|
155
|
+
"text": ""
|
|
156
|
+
},
|
|
157
|
+
"complexType": {
|
|
158
|
+
"original": "any",
|
|
159
|
+
"resolved": "any",
|
|
160
|
+
"references": {}
|
|
161
|
+
}
|
|
162
|
+
}, {
|
|
163
|
+
"method": "apiErrorEvent",
|
|
164
|
+
"name": "apiError",
|
|
165
|
+
"bubbles": true,
|
|
166
|
+
"cancelable": true,
|
|
167
|
+
"composed": true,
|
|
168
|
+
"docs": {
|
|
169
|
+
"tags": [],
|
|
170
|
+
"text": ""
|
|
171
|
+
},
|
|
172
|
+
"complexType": {
|
|
173
|
+
"original": "any",
|
|
174
|
+
"resolved": "any",
|
|
175
|
+
"references": {}
|
|
176
|
+
}
|
|
177
|
+
}];
|
|
178
|
+
}
|
|
179
|
+
static get elementRef() { return "component"; }
|
|
180
|
+
static get listeners() {
|
|
181
|
+
return [{
|
|
182
|
+
"name": "videoStarted",
|
|
183
|
+
"method": "eventVideoStarted",
|
|
184
|
+
"target": undefined,
|
|
185
|
+
"capture": false,
|
|
186
|
+
"passive": false
|
|
187
|
+
}, {
|
|
188
|
+
"name": "takePhoto",
|
|
189
|
+
"method": "takePhoto",
|
|
190
|
+
"target": undefined,
|
|
191
|
+
"capture": false,
|
|
192
|
+
"passive": false
|
|
193
|
+
}, {
|
|
194
|
+
"name": "verificationFinished",
|
|
195
|
+
"method": "verificationFinished",
|
|
196
|
+
"target": undefined,
|
|
197
|
+
"capture": false,
|
|
198
|
+
"passive": false
|
|
199
|
+
}];
|
|
200
|
+
}
|
|
201
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
.camera {
|
|
2
|
+
width: 100%;
|
|
3
|
+
height: 100%;
|
|
4
|
+
color: white;
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
position: relative;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.cameraCanvas,
|
|
12
|
+
.cameraCanvasSelfie,
|
|
13
|
+
.cameraCanvasSelfieDesk {
|
|
14
|
+
z-index: 3;
|
|
15
|
+
max-width: 100%;
|
|
16
|
+
max-height: 100%;
|
|
17
|
+
border-radius: 10px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.cameraCanvasSelfie,
|
|
21
|
+
.cameraCanvasSelfieDesk {
|
|
22
|
+
transform: scale(-1, 1);
|
|
23
|
+
-webkit-transform: scale(-1, 1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.cameraVideo,
|
|
27
|
+
.cameraVideoSelfie,
|
|
28
|
+
.cameraVideoSelfieDesk {
|
|
29
|
+
z-index: 2;
|
|
30
|
+
position: absolute;
|
|
31
|
+
max-width: 100%;
|
|
32
|
+
max-height: 100%;
|
|
33
|
+
border-radius: 10px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.cameraVideoSelfie,
|
|
37
|
+
.cameraVideoSelfieDesk {
|
|
38
|
+
transform: scale(-1, 1);
|
|
39
|
+
-webkit-transform: scale(-1, 1);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.cameraMobile {
|
|
43
|
+
position: fixed;
|
|
44
|
+
top: 0;
|
|
45
|
+
left: 0;
|
|
46
|
+
background: black;
|
|
47
|
+
}
|