@ekyc_qoobiss/qbs-ect-cmp 3.6.40 → 3.6.42
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-bfe4477a.js → TranslationUtils-dd73945b.js} +31 -43
- package/dist/cjs/{agreement-check_19.cjs.entry.js → agreement-check_17.cjs.entry.js} +248 -821
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/qbs-ect-cmp.cjs.js +1 -1
- package/dist/cjs/random-actions.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +1 -3
- package/dist/collection/components/common/how-to-info/how-to-info.js +11 -34
- package/dist/collection/components/common/id-capture/id-capture.js +39 -19
- package/dist/collection/components/common/selfie-capture/selfie-capture.js +26 -27
- package/dist/collection/components/controls/camera/camera.js +1 -3
- package/dist/collection/components/flow/agreement-info/agreement-info.js +4 -5
- package/dist/collection/components/flow/landing-validation/landing-validation.js +11 -19
- package/dist/collection/components/flow/mobile-redirect/mobile-redirect.js +1 -1
- package/dist/collection/components/flow/process-id/process-id.js +47 -161
- package/dist/collection/components/flow/sms-code-validation/sms-code-validation.js +7 -56
- package/dist/collection/components/flow/sms-send/sms-send.css +0 -0
- package/dist/collection/components/flow/sms-send/sms-send.js +91 -0
- package/dist/collection/components/flow/user-liveness/user-liveness.js +46 -118
- package/dist/collection/components/identification-component/identification-component.js +14 -41
- package/dist/collection/helpers/ApiCall.js +14 -15
- package/dist/collection/helpers/ML5.js +1 -1
- package/dist/collection/helpers/store.js +0 -18
- package/dist/collection/helpers/textValues.js +2 -0
- package/dist/collection/models/CaptureFlow.js +0 -16
- package/dist/collection/models/FlowStatus.js +16 -10
- package/dist/esm/{TranslationUtils-7e68bc94.js → TranslationUtils-741a728a.js} +31 -43
- package/dist/esm/{agreement-check_19.entry.js → agreement-check_17.entry.js} +248 -819
- package/dist/esm/loader.js +1 -1
- package/dist/esm/qbs-ect-cmp.js +1 -1
- package/dist/esm/random-actions.entry.js +1 -1
- package/dist/qbs-ect-cmp/p-87c689d6.js +1 -0
- package/dist/qbs-ect-cmp/{p-d1d9feaf.entry.js → p-a130edd5.entry.js} +1 -1
- package/dist/qbs-ect-cmp/{p-df2ea91b.entry.js → p-f62c1796.entry.js} +2 -2
- package/dist/qbs-ect-cmp/qbs-ect-cmp.esm.js +1 -1
- package/dist/types/components/common/how-to-info/how-to-info.d.ts +0 -1
- package/dist/types/components/common/id-capture/id-capture.d.ts +5 -1
- package/dist/types/components/common/selfie-capture/selfie-capture.d.ts +3 -2
- package/dist/types/components/flow/process-id/process-id.d.ts +0 -3
- package/dist/types/components/flow/sms-code-validation/sms-code-validation.d.ts +0 -3
- package/dist/types/components/flow/sms-send/sms-send.d.ts +17 -0
- package/dist/types/components/flow/user-liveness/user-liveness.d.ts +3 -6
- package/dist/types/components/identification-component/identification-component.d.ts +1 -2
- package/dist/types/components.d.ts +18 -62
- package/dist/types/helpers/ApiCall.d.ts +9 -3
- package/dist/types/helpers/textValues.d.ts +2 -0
- package/dist/types/models/CaptureFlow.d.ts +2 -19
- package/dist/types/models/FlowStatus.d.ts +18 -10
- package/dist/types/models/IAbortResult.d.ts +1 -0
- package/dist/types/models/IAddRequest.d.ts +1 -1
- package/dist/types/models/IEctStore.d.ts +0 -6
- package/dist/types/models/IOtpCheck.d.ts +1 -0
- package/dist/types/models/IOtpSend.d.ts +1 -0
- package/dist/types/models/IUploadFile.d.ts +1 -0
- package/package.json +1 -1
- package/dist/collection/components/common/id-back-capture/id-back-capture.css +0 -35
- package/dist/collection/components/common/id-back-capture/id-back-capture.js +0 -219
- package/dist/collection/components/common/id-tilt/id-tilt.css +0 -35
- package/dist/collection/components/common/id-tilt/id-tilt.js +0 -220
- package/dist/collection/components/common/selfie-tilt/selfie-tilt.css +0 -7
- package/dist/collection/components/common/selfie-tilt/selfie-tilt.js +0 -221
- package/dist/qbs-ect-cmp/p-d35256e9.js +0 -1
- package/dist/types/components/common/id-back-capture/id-back-capture.d.ts +0 -28
- package/dist/types/components/common/id-tilt/id-tilt.d.ts +0 -28
- package/dist/types/components/common/selfie-tilt/selfie-tilt.d.ts +0 -31
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-41696e0e.js');
|
|
6
|
-
const TranslationUtils = require('./TranslationUtils-
|
|
6
|
+
const TranslationUtils = require('./TranslationUtils-dd73945b.js');
|
|
7
7
|
|
|
8
8
|
var MobileOS;
|
|
9
9
|
(function (MobileOS) {
|
|
@@ -294,11 +294,11 @@ const AgreementInfo = class {
|
|
|
294
294
|
}
|
|
295
295
|
async buttonClick() {
|
|
296
296
|
if (this.agreementsChecked && this.termsChecked) {
|
|
297
|
-
|
|
298
|
-
TranslationUtils.state.flowStatus =
|
|
297
|
+
try {
|
|
298
|
+
TranslationUtils.state.flowStatus = await this.baseComponent.apiCall.GetNextFlowState();
|
|
299
299
|
}
|
|
300
|
-
|
|
301
|
-
|
|
300
|
+
catch (e) {
|
|
301
|
+
this.apiErrorEvent.emit(e);
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
304
|
}
|
|
@@ -1629,7 +1629,7 @@ class ML5 {
|
|
|
1629
1629
|
}
|
|
1630
1630
|
async init() {
|
|
1631
1631
|
return new Promise(async (resolve) => {
|
|
1632
|
-
const modelPath = TranslationUtils.state.
|
|
1632
|
+
const modelPath = TranslationUtils.state.apiBaseUrl.includes("apimd") ? 'https://ekyc.blob.core.windows.net/$web/md/model.json' : 'https://ekyc.blob.core.windows.net/$web/model.json';
|
|
1633
1633
|
this.classifier = await ml5.imageClassifier(modelPath, this.loaded);
|
|
1634
1634
|
this.faceapi = await ml5.faceApi({ withLandmarks: true, withDescriptors: false }, this.loaded);
|
|
1635
1635
|
//warmup
|
|
@@ -4736,8 +4736,7 @@ const Camera = class {
|
|
|
4736
4736
|
return (index.h("div", { class: "camera" }, index.h("video", { id: "video", loop: true, autoplay: true, playsinline: true, muted: true, class: cameraVideoClass, ref: el => (this.cameraVideo = el) }), index.h("canvas", { id: "output", class: cameraCanvasClass, ref: el => (this.cameraCanvas = el) })));
|
|
4737
4737
|
}
|
|
4738
4738
|
startStream() {
|
|
4739
|
-
|
|
4740
|
-
const stream = Stream.getNewInstance(captureMode);
|
|
4739
|
+
const stream = Stream.instance;
|
|
4741
4740
|
stream.updateHtmlElements(this.cameraVideo, this.cameraCanvas, this.component);
|
|
4742
4741
|
if (this.captureMode == 'selfie') {
|
|
4743
4742
|
stream.setFaceDetection(true);
|
|
@@ -4900,7 +4899,7 @@ ErrorEnd.style = errorEndCss;
|
|
|
4900
4899
|
const howToInfoCss = "";
|
|
4901
4900
|
|
|
4902
4901
|
const HowToInfo = class {
|
|
4903
|
-
constructor(hostRef) { index.registerInstance(this, hostRef); this.eventHowToInfoDone = index.createEvent(this, "howToInfoDone", 7); this.apiErrorEvent = index.createEvent(this, "apiError", 7); this.
|
|
4902
|
+
constructor(hostRef) { index.registerInstance(this, hostRef); this.eventHowToInfoDone = index.createEvent(this, "howToInfoDone", 7); this.apiErrorEvent = index.createEvent(this, "apiError", 7); this.topTitle = undefined; this.subTitle = undefined; this.imagePath = undefined; this.buttonText = undefined; this.buttonEnabled = undefined; }
|
|
4904
4903
|
async componentDidLoad() {
|
|
4905
4904
|
await this.baseComponent.initialize();
|
|
4906
4905
|
}
|
|
@@ -4915,18 +4914,16 @@ const HowToInfo = class {
|
|
|
4915
4914
|
this.translations = await TranslationUtils.Translations.getValues();
|
|
4916
4915
|
this.subTitle = '';
|
|
4917
4916
|
this.buttonEnabled = true;
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
this.subTitle = this.translations.HowToValues.IdSubTitileBack;
|
|
4929
|
-
}
|
|
4917
|
+
this.topTitle = this.translations.HowToValues.IdTitile;
|
|
4918
|
+
this.imagePath = 'https://ekyc.blob.core.windows.net/$web/howto_id.png';
|
|
4919
|
+
this.buttonText = this.translations.HowToValues.IdButton;
|
|
4920
|
+
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.IDFRONT) {
|
|
4921
|
+
this.baseComponent = new BaseComponent(TranslationUtils.FlowSteps.CiFrontHowTo);
|
|
4922
|
+
this.subTitle = this.translations.HowToValues.IdSubTitileFace;
|
|
4923
|
+
}
|
|
4924
|
+
else if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.IDBACK) {
|
|
4925
|
+
this.baseComponent = new BaseComponent(TranslationUtils.FlowSteps.CiBackHowTo);
|
|
4926
|
+
this.subTitle = this.translations.HowToValues.IdSubTitileBack;
|
|
4930
4927
|
}
|
|
4931
4928
|
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.LIVENESS) {
|
|
4932
4929
|
this.baseComponent = new BaseComponent(TranslationUtils.FlowSteps.SelfieHowTo);
|
|
@@ -5081,128 +5078,6 @@ var IDPose;
|
|
|
5081
5078
|
IDPose[IDPose["BackTilted"] = 4] = "BackTilted";
|
|
5082
5079
|
})(IDPose || (IDPose = {}));
|
|
5083
5080
|
|
|
5084
|
-
const idBackCaptureCss = ".logo{max-height:450px;max-width:450px}.canvas-on-video{max-width:100%;max-height:100%;position:absolute;z-index:2;transform:scale(-1, 1)}";
|
|
5085
|
-
|
|
5086
|
-
const IdBackCapture = class {
|
|
5087
|
-
// @State() private animationPath: string;
|
|
5088
|
-
constructor(hostRef) {
|
|
5089
|
-
index.registerInstance(this, hostRef);
|
|
5090
|
-
this.eventPhotoCapture = index.createEvent(this, "photoIdBackCapture", 7);
|
|
5091
|
-
this.apiErrorEvent = index.createEvent(this, "apiError", 7);
|
|
5092
|
-
this.eventTimeElapsed = index.createEvent(this, "timeElapsed", 7);
|
|
5093
|
-
this.photoIsReady = photos => {
|
|
5094
|
-
//this.closeCamera();
|
|
5095
|
-
this.eventPhotoCapture.emit(photos);
|
|
5096
|
-
};
|
|
5097
|
-
this.videoStarted = undefined;
|
|
5098
|
-
this.cameraSize = undefined;
|
|
5099
|
-
this.captureTaken = undefined;
|
|
5100
|
-
this.verified = undefined;
|
|
5101
|
-
this.titleMesage = undefined;
|
|
5102
|
-
this.showDemo = undefined;
|
|
5103
|
-
this.demoVideo = undefined;
|
|
5104
|
-
this.captureTaken = false;
|
|
5105
|
-
this.verified = false;
|
|
5106
|
-
this.cameras = new Cameras();
|
|
5107
|
-
this.showDemo = true;
|
|
5108
|
-
this.baseComponent = new BaseComponent(TranslationUtils.FlowSteps.CiBackCapture);
|
|
5109
|
-
}
|
|
5110
|
-
eventVideoStarted(event) {
|
|
5111
|
-
this.videoStarted = true;
|
|
5112
|
-
this.cameraSize = event.detail;
|
|
5113
|
-
}
|
|
5114
|
-
async componentWillLoad() {
|
|
5115
|
-
this.translations = await TranslationUtils.Translations.getValues();
|
|
5116
|
-
//this.videoDemoStyle = this.device.isMobile ? { width: window.screen.width + 'px', height: window.screen.height + 'px', 'object-fit': 'fill' } : {};
|
|
5117
|
-
if (!navigator.mediaDevices) {
|
|
5118
|
-
this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
|
|
5119
|
-
}
|
|
5120
|
-
}
|
|
5121
|
-
async componentDidLoad() {
|
|
5122
|
-
await this.baseComponent.logStep(TranslationUtils.FlowSteps.CiBackCapture, TranslationUtils.FlowMoments.Initialized);
|
|
5123
|
-
this.titleMesage = this.translations.IdCaptureValues.TtileRotate;
|
|
5124
|
-
this.demoVideo.src = TranslationUtils.IdCaptureValues.IDPoseDemoMapping[IDPose.Rotate];
|
|
5125
|
-
this.demoVideo.play();
|
|
5126
|
-
await delay(this.translations.GlobalValues.VideoLenght);
|
|
5127
|
-
this.titleMesage = this.translations.IdCaptureValues.TitleBack;
|
|
5128
|
-
this.demoVideo.src = TranslationUtils.IdCaptureValues.IDPoseDemoMapping[IDPose.BackStraight];
|
|
5129
|
-
this.demoVideo.play();
|
|
5130
|
-
await delay(this.translations.GlobalValues.VideoLenght);
|
|
5131
|
-
this.showDemo = false;
|
|
5132
|
-
this.openCamera();
|
|
5133
|
-
}
|
|
5134
|
-
async openCamera() {
|
|
5135
|
-
const constraints = this.cameras.GetConstraints(TranslationUtils.state.cameraId, TranslationUtils.state.device);
|
|
5136
|
-
setTimeout(() => {
|
|
5137
|
-
navigator.mediaDevices
|
|
5138
|
-
.getUserMedia(constraints)
|
|
5139
|
-
.then(stream => {
|
|
5140
|
-
const superStream = Stream.getNewInstance(VerificationMode.Full);
|
|
5141
|
-
superStream.initStream(stream);
|
|
5142
|
-
})
|
|
5143
|
-
.catch(e => {
|
|
5144
|
-
this.closeCamera();
|
|
5145
|
-
this.apiErrorEvent.emit(e);
|
|
5146
|
-
});
|
|
5147
|
-
}, 100);
|
|
5148
|
-
}
|
|
5149
|
-
closeCamera() {
|
|
5150
|
-
if (Stream.instance) {
|
|
5151
|
-
Stream.instance.dropStream();
|
|
5152
|
-
}
|
|
5153
|
-
}
|
|
5154
|
-
disconnectedCallback() {
|
|
5155
|
-
this.closeCamera();
|
|
5156
|
-
Stream.instance = null;
|
|
5157
|
-
IDML5Detector.instance = null;
|
|
5158
|
-
FaceML5Detector.instance = null;
|
|
5159
|
-
}
|
|
5160
|
-
async verificationFinished() {
|
|
5161
|
-
if (this.verified)
|
|
5162
|
-
return;
|
|
5163
|
-
this.verified = true;
|
|
5164
|
-
this.titleMesage = this.translations.IdCaptureValues.Loading;
|
|
5165
|
-
this.closeCamera();
|
|
5166
|
-
this.showDemo = true;
|
|
5167
|
-
var loops = 0;
|
|
5168
|
-
this.demoVideo.src = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_id.mp4';
|
|
5169
|
-
this.demoVideo.loop = false;
|
|
5170
|
-
while (loops < 7) {
|
|
5171
|
-
loops++;
|
|
5172
|
-
this.demoVideo.play();
|
|
5173
|
-
await delay(this.translations.GlobalValues.VideoLenght);
|
|
5174
|
-
}
|
|
5175
|
-
this.eventTimeElapsed.emit();
|
|
5176
|
-
}
|
|
5177
|
-
async takePhoto() {
|
|
5178
|
-
if (this.captureTaken)
|
|
5179
|
-
return;
|
|
5180
|
-
this.captureTaken = true;
|
|
5181
|
-
if (Stream.instance) {
|
|
5182
|
-
let res = await Stream.instance.takePhoto();
|
|
5183
|
-
this.photoIsReady(res);
|
|
5184
|
-
}
|
|
5185
|
-
else {
|
|
5186
|
-
this.eventTimeElapsed.emit();
|
|
5187
|
-
}
|
|
5188
|
-
await this.baseComponent.logStep(TranslationUtils.FlowSteps.CiBackCapture, TranslationUtils.FlowMoments.Finalized);
|
|
5189
|
-
}
|
|
5190
|
-
render() {
|
|
5191
|
-
let cameraStyle;
|
|
5192
|
-
let cameraStyleInner;
|
|
5193
|
-
if (this.videoStarted) {
|
|
5194
|
-
cameraStyle = { width: Math.round(this.cameraSize.width) + 'px', height: Math.round((this.cameraSize.width * 9) / 16) + 'px', overflow: 'hidden', borderRadius: '10px' };
|
|
5195
|
-
cameraStyleInner = { marginTop: Math.round((this.cameraSize.height - (this.cameraSize.width * 9) / 16) / 2) * -1 + 'px' };
|
|
5196
|
-
}
|
|
5197
|
-
let titleClass = this.verified ? 'color-black-2 text-center' : 'color-white text-center';
|
|
5198
|
-
//let videoClass = this.device.isMobile ? '' : 'video-demo';
|
|
5199
|
-
let bgDemo = this.verified ? 'container' : 'container bg-black';
|
|
5200
|
-
return (index.h("div", { class: bgDemo }, index.h("div", { class: "container-video" }, index.h("div", { hidden: this.showDemo == false }, index.h("video", { id: "howtoBack", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, index.h("source", { type: "video/mp4" }))), index.h("div", { hidden: this.showDemo }, index.h("div", { hidden: this.verified }, index.h("div", { class: "video-capture" }, index.h("div", { style: cameraStyle }, index.h("div", { style: cameraStyleInner }, index.h("camera-comp", { "capture-mode": "id" })))))), index.h("div", { class: "capture-title" }, index.h("h1", { class: titleClass }, this.titleMesage), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText)))));
|
|
5201
|
-
}
|
|
5202
|
-
get component() { return index.getElement(this); }
|
|
5203
|
-
};
|
|
5204
|
-
IdBackCapture.style = idBackCaptureCss;
|
|
5205
|
-
|
|
5206
5081
|
const idCaptureCss = ".logo{max-height:450px;max-width:450px}.canvas-on-video{max-width:100%;max-height:100%;position:absolute;z-index:2;transform:scale(-1, 1)}";
|
|
5207
5082
|
|
|
5208
5083
|
const IdCapture = class {
|
|
@@ -5212,8 +5087,7 @@ const IdCapture = class {
|
|
|
5212
5087
|
this.eventPhotoCapture = index.createEvent(this, "photoIdCapture", 7);
|
|
5213
5088
|
this.apiErrorEvent = index.createEvent(this, "apiError", 7);
|
|
5214
5089
|
this.eventTimeElapsed = index.createEvent(this, "timeElapsed", 7);
|
|
5215
|
-
this.photoIsReady = photos => {
|
|
5216
|
-
//this.closeCamera();
|
|
5090
|
+
this.photoIsReady = (photos) => {
|
|
5217
5091
|
this.eventPhotoCapture.emit(photos);
|
|
5218
5092
|
};
|
|
5219
5093
|
this.videoStarted = undefined;
|
|
@@ -5227,7 +5101,6 @@ const IdCapture = class {
|
|
|
5227
5101
|
this.verified = false;
|
|
5228
5102
|
this.cameras = new Cameras();
|
|
5229
5103
|
this.showDemo = true;
|
|
5230
|
-
this.baseComponent = new BaseComponent(TranslationUtils.FlowSteps.CiFrontCapture);
|
|
5231
5104
|
}
|
|
5232
5105
|
eventVideoStarted(event) {
|
|
5233
5106
|
this.videoStarted = true;
|
|
@@ -5235,138 +5108,41 @@ const IdCapture = class {
|
|
|
5235
5108
|
}
|
|
5236
5109
|
async componentWillLoad() {
|
|
5237
5110
|
this.translations = await TranslationUtils.Translations.getValues();
|
|
5238
|
-
this.titleMesage = this.translations.IdCaptureValues.Title;
|
|
5239
|
-
//this.videoDemoStyle = this.device.isMobile ? { 'width': window.screen.width + 'px', 'height': window.screen.height + 'px', 'object-fit': 'fill' } : {};
|
|
5240
5111
|
if (!navigator.mediaDevices) {
|
|
5241
5112
|
this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
|
|
5242
5113
|
}
|
|
5114
|
+
this.baseComponent = new BaseComponent(this.flowStep);
|
|
5243
5115
|
}
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
this.openCamera();
|
|
5251
|
-
}
|
|
5252
|
-
async openCamera() {
|
|
5253
|
-
const constraints = this.cameras.GetConstraints(TranslationUtils.state.cameraId, TranslationUtils.state.device);
|
|
5254
|
-
setTimeout(() => {
|
|
5255
|
-
navigator.mediaDevices
|
|
5256
|
-
.getUserMedia(constraints)
|
|
5257
|
-
.then(stream => {
|
|
5258
|
-
const superStream = Stream.getNewInstance(VerificationMode.Full);
|
|
5259
|
-
superStream.initStream(stream);
|
|
5260
|
-
})
|
|
5261
|
-
.catch(e => {
|
|
5262
|
-
this.closeCamera();
|
|
5263
|
-
this.apiErrorEvent.emit(e);
|
|
5264
|
-
});
|
|
5265
|
-
}, 100);
|
|
5266
|
-
}
|
|
5267
|
-
closeCamera() {
|
|
5268
|
-
if (Stream.instance) {
|
|
5269
|
-
Stream.instance.dropStream();
|
|
5116
|
+
initVariables() {
|
|
5117
|
+
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.IDFRONT) {
|
|
5118
|
+
this.pose = IDPose.Straight;
|
|
5119
|
+
this.flowStep = TranslationUtils.FlowSteps.CiFrontCapture;
|
|
5120
|
+
this.titleMesage = this.translations.IdCaptureValues.Title;
|
|
5121
|
+
this.verificationMode = VerificationMode.Full;
|
|
5270
5122
|
}
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
FaceML5Detector.instance = null;
|
|
5277
|
-
}
|
|
5278
|
-
async takePhoto() {
|
|
5279
|
-
if (this.captureTaken)
|
|
5280
|
-
return;
|
|
5281
|
-
this.captureTaken = true;
|
|
5282
|
-
if (Stream.instance) {
|
|
5283
|
-
let res = await Stream.instance.takePhoto();
|
|
5284
|
-
this.photoIsReady(res);
|
|
5123
|
+
else if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.IDBACK) {
|
|
5124
|
+
this.pose = IDPose.BackStraight;
|
|
5125
|
+
this.flowStep = TranslationUtils.FlowSteps.CiBackCapture;
|
|
5126
|
+
this.titleMesage = this.translations.IdCaptureValues.TtileRotate;
|
|
5127
|
+
this.verificationMode = VerificationMode.Full;
|
|
5285
5128
|
}
|
|
5286
|
-
else {
|
|
5287
|
-
this.
|
|
5129
|
+
else if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.IDTILT) {
|
|
5130
|
+
this.titleMesage = this.translations.IdCaptureValues.IDPoseMapping;
|
|
5131
|
+
this.pose = IDPose.Tilted;
|
|
5132
|
+
this.flowStep = TranslationUtils.FlowSteps.CiTilt;
|
|
5133
|
+
this.verificationMode = VerificationMode.Tilt;
|
|
5288
5134
|
}
|
|
5289
|
-
await this.baseComponent.logStep(TranslationUtils.FlowSteps.CiFrontCapture, TranslationUtils.FlowMoments.Finalized);
|
|
5290
5135
|
}
|
|
5291
|
-
async
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
this.closeCamera();
|
|
5297
|
-
this.showDemo = true;
|
|
5298
|
-
var loops = 0;
|
|
5299
|
-
this.demoVideo.src = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_id.mp4';
|
|
5300
|
-
this.demoVideo.loop = false;
|
|
5301
|
-
while (loops < 7) {
|
|
5302
|
-
loops++;
|
|
5136
|
+
async componentDidLoad() {
|
|
5137
|
+
await this.baseComponent.logStep(this.flowStep, TranslationUtils.FlowMoments.Initialized);
|
|
5138
|
+
this.initVariables();
|
|
5139
|
+
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.IDBACK) {
|
|
5140
|
+
this.demoVideo.src = TranslationUtils.IdCaptureValues.IDPoseDemoMapping[IDPose.Rotate];
|
|
5303
5141
|
this.demoVideo.play();
|
|
5304
5142
|
await delay(this.translations.GlobalValues.VideoLenght);
|
|
5143
|
+
this.titleMesage = this.translations.IdCaptureValues.TitleBack;
|
|
5305
5144
|
}
|
|
5306
|
-
this.
|
|
5307
|
-
}
|
|
5308
|
-
render() {
|
|
5309
|
-
let cameraStyle;
|
|
5310
|
-
let cameraStyleInner;
|
|
5311
|
-
if (this.videoStarted) {
|
|
5312
|
-
cameraStyle = {
|
|
5313
|
-
width: Math.round(this.cameraSize.width) + 'px',
|
|
5314
|
-
height: Math.round((this.cameraSize.width * 9) / 16) + 'px',
|
|
5315
|
-
overflow: 'hidden',
|
|
5316
|
-
borderRadius: '10px',
|
|
5317
|
-
};
|
|
5318
|
-
cameraStyleInner = { marginTop: Math.round((this.cameraSize.height - (this.cameraSize.width * 9) / 16) / 2) * -1 + 'px' };
|
|
5319
|
-
}
|
|
5320
|
-
let titleClass = this.verified ? 'color-black-2 text-center' : 'color-white text-center';
|
|
5321
|
-
//let videoClass = this.device.isMobile ? '' : 'video-demo';
|
|
5322
|
-
let bgDemo = this.verified ? 'container' : 'container bg-black';
|
|
5323
|
-
return (index.h("div", { class: bgDemo }, index.h("div", { class: "container-video" }, index.h("div", { hidden: this.showDemo == false }, index.h("video", { id: "howtoFront", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, index.h("source", { type: "video/mp4" }))), index.h("div", { hidden: this.showDemo }, index.h("div", { hidden: this.verified }, index.h("div", { class: "video-capture" }, index.h("div", { style: cameraStyle }, index.h("div", { style: cameraStyleInner }, index.h("camera-comp", { "capture-mode": "id" })))))), index.h("div", { class: "capture-title" }, index.h("h1", { class: titleClass }, this.titleMesage), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText)))));
|
|
5324
|
-
}
|
|
5325
|
-
get component() { return index.getElement(this); }
|
|
5326
|
-
};
|
|
5327
|
-
IdCapture.style = idCaptureCss;
|
|
5328
|
-
|
|
5329
|
-
const idTiltCss = ".logo{max-height:450px;max-width:450px}.canvas-on-video{max-width:100%;max-height:100%;position:absolute;z-index:2;transform:scale(-1, 1)}";
|
|
5330
|
-
|
|
5331
|
-
const IdTilt = class {
|
|
5332
|
-
// @State() private animationPath: string;
|
|
5333
|
-
constructor(hostRef) {
|
|
5334
|
-
index.registerInstance(this, hostRef);
|
|
5335
|
-
this.eventPhotoCapture = index.createEvent(this, "photoTiltCapture", 7);
|
|
5336
|
-
this.apiErrorEvent = index.createEvent(this, "apiError", 7);
|
|
5337
|
-
this.eventTimeElapsed = index.createEvent(this, "timeElapsed", 7);
|
|
5338
|
-
this.photoIsReady = photos => {
|
|
5339
|
-
//this.closeCamera();
|
|
5340
|
-
this.eventPhotoCapture.emit(photos);
|
|
5341
|
-
};
|
|
5342
|
-
this.videoStarted = undefined;
|
|
5343
|
-
this.cameraSize = undefined;
|
|
5344
|
-
this.captureTaken = undefined;
|
|
5345
|
-
this.verified = undefined;
|
|
5346
|
-
this.titleMesage = undefined;
|
|
5347
|
-
this.showDemo = undefined;
|
|
5348
|
-
this.demoVideo = undefined;
|
|
5349
|
-
this.captureTaken = false;
|
|
5350
|
-
this.verified = false;
|
|
5351
|
-
this.cameras = new Cameras();
|
|
5352
|
-
this.showDemo = true;
|
|
5353
|
-
this.baseComponent = new BaseComponent(TranslationUtils.FlowSteps.CiTilt);
|
|
5354
|
-
}
|
|
5355
|
-
eventVideoStarted(event) {
|
|
5356
|
-
this.videoStarted = true;
|
|
5357
|
-
this.cameraSize = event.detail;
|
|
5358
|
-
}
|
|
5359
|
-
async componentWillLoad() {
|
|
5360
|
-
this.translations = await TranslationUtils.Translations.getValues();
|
|
5361
|
-
this.titleMesage = this.translations.IdCaptureValues.IDPoseMapping;
|
|
5362
|
-
//this.videoDemoStyle = this.device.isMobile ? { 'width': window.screen.width + 'px', 'height': window.screen.height + 'px', 'object-fit': 'fill' } : {};
|
|
5363
|
-
if (!navigator.mediaDevices) {
|
|
5364
|
-
this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
|
|
5365
|
-
}
|
|
5366
|
-
}
|
|
5367
|
-
async componentDidLoad() {
|
|
5368
|
-
await this.baseComponent.logStep(TranslationUtils.FlowSteps.CiTilt, TranslationUtils.FlowMoments.Initialized);
|
|
5369
|
-
this.demoVideo.src = TranslationUtils.IdCaptureValues.IDPoseDemoMapping[IDPose.Tilted];
|
|
5145
|
+
this.demoVideo.src = TranslationUtils.IdCaptureValues.IDPoseDemoMapping[this.pose];
|
|
5370
5146
|
this.demoVideo.play();
|
|
5371
5147
|
await delay(this.translations.GlobalValues.VideoLenght);
|
|
5372
5148
|
this.showDemo = false;
|
|
@@ -5378,7 +5154,7 @@ const IdTilt = class {
|
|
|
5378
5154
|
navigator.mediaDevices
|
|
5379
5155
|
.getUserMedia(constraints)
|
|
5380
5156
|
.then(stream => {
|
|
5381
|
-
const superStream = Stream.getNewInstance(
|
|
5157
|
+
const superStream = Stream.getNewInstance(this.verificationMode);
|
|
5382
5158
|
superStream.initStream(stream);
|
|
5383
5159
|
})
|
|
5384
5160
|
.catch(e => {
|
|
@@ -5409,7 +5185,7 @@ const IdTilt = class {
|
|
|
5409
5185
|
else {
|
|
5410
5186
|
this.eventTimeElapsed.emit();
|
|
5411
5187
|
}
|
|
5412
|
-
await this.baseComponent.logStep(
|
|
5188
|
+
await this.baseComponent.logStep(this.flowStep, TranslationUtils.FlowMoments.Finalized);
|
|
5413
5189
|
}
|
|
5414
5190
|
async verificationFinished() {
|
|
5415
5191
|
if (this.verified)
|
|
@@ -5417,15 +5193,11 @@ const IdTilt = class {
|
|
|
5417
5193
|
this.verified = true;
|
|
5418
5194
|
this.titleMesage = this.translations.IdCaptureValues.Loading;
|
|
5419
5195
|
this.closeCamera();
|
|
5420
|
-
this.showDemo = true;
|
|
5421
|
-
var loops = 0;
|
|
5422
5196
|
this.demoVideo.src = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_id.mp4';
|
|
5423
|
-
this.demoVideo.loop =
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
|
|
5427
|
-
await delay(this.translations.GlobalValues.VideoLenght);
|
|
5428
|
-
}
|
|
5197
|
+
this.demoVideo.loop = true;
|
|
5198
|
+
this.showDemo = true;
|
|
5199
|
+
this.demoVideo.play();
|
|
5200
|
+
await delay(10000);
|
|
5429
5201
|
this.eventTimeElapsed.emit();
|
|
5430
5202
|
}
|
|
5431
5203
|
render() {
|
|
@@ -5441,13 +5213,12 @@ const IdTilt = class {
|
|
|
5441
5213
|
cameraStyleInner = { marginTop: Math.round((this.cameraSize.height - (this.cameraSize.width * 9) / 16) / 2) * -1 + 'px' };
|
|
5442
5214
|
}
|
|
5443
5215
|
let titleClass = this.verified ? 'color-black-2 text-center' : 'color-white text-center';
|
|
5444
|
-
//let videoClass = this.device.isMobile ? '' : 'video-demo';
|
|
5445
5216
|
let bgDemo = this.verified ? 'container' : 'container bg-black';
|
|
5446
|
-
return (index.h("div", { class: bgDemo }, index.h("div", { class: "container-video" }, index.h("div", { hidden: this.showDemo == false }, index.h("video", { id: "
|
|
5217
|
+
return (index.h("div", { class: bgDemo }, index.h("div", { class: "container-video" }, index.h("div", { hidden: this.showDemo == false }, index.h("video", { id: "howTo", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, index.h("source", { type: "video/mp4" }))), index.h("div", { hidden: this.showDemo }, index.h("div", { hidden: this.verified }, index.h("div", { class: "video-capture" }, index.h("div", { style: cameraStyle }, index.h("div", { style: cameraStyleInner }, index.h("camera-comp", { "capture-mode": "id" })))))), index.h("div", { class: "capture-title" }, index.h("h1", { class: titleClass }, this.titleMesage), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText)))));
|
|
5447
5218
|
}
|
|
5448
5219
|
get component() { return index.getElement(this); }
|
|
5449
5220
|
};
|
|
5450
|
-
|
|
5221
|
+
IdCapture.style = idCaptureCss;
|
|
5451
5222
|
|
|
5452
5223
|
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
5453
5224
|
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
@@ -5515,7 +5286,7 @@ function v4(options, buf, offset) {
|
|
|
5515
5286
|
}
|
|
5516
5287
|
|
|
5517
5288
|
const name = "@ekyc_qoobiss/qbs-ect-cmp";
|
|
5518
|
-
const version$1 = "3.6.
|
|
5289
|
+
const version$1 = "3.6.42";
|
|
5519
5290
|
const description = "Person Identification Component";
|
|
5520
5291
|
const main = "./dist/index.cjs.js";
|
|
5521
5292
|
const module$1 = "./dist/index.js";
|
|
@@ -5637,6 +5408,7 @@ const IdentificationComponent = class {
|
|
|
5637
5408
|
index.registerInstance(this, hostRef);
|
|
5638
5409
|
this.logInit = {};
|
|
5639
5410
|
this.flowStatusToSet = TranslationUtils.FlowStatus.NONE;
|
|
5411
|
+
this.initialised = false;
|
|
5640
5412
|
this.token = undefined;
|
|
5641
5413
|
this.order_id = undefined;
|
|
5642
5414
|
this.api_url = undefined;
|
|
@@ -5644,7 +5416,6 @@ const IdentificationComponent = class {
|
|
|
5644
5416
|
this.redirect_id = undefined;
|
|
5645
5417
|
this.phone_number = undefined;
|
|
5646
5418
|
this.lang_iso = undefined;
|
|
5647
|
-
this.idSide = '';
|
|
5648
5419
|
this.errorMessage = undefined;
|
|
5649
5420
|
this.errorTitle = undefined;
|
|
5650
5421
|
}
|
|
@@ -5679,33 +5450,14 @@ const IdentificationComponent = class {
|
|
|
5679
5450
|
if (this.lang_iso && this.lang_iso != '') {
|
|
5680
5451
|
TranslationUtils.state.langIso = this.lang_iso;
|
|
5681
5452
|
}
|
|
5682
|
-
var ini = sessionStorage.getItem(TranslationUtils.SessionKeys.InitialisedKey);
|
|
5683
|
-
if (ini && ini.toLowerCase() == 'true') {
|
|
5684
|
-
TranslationUtils.state.initialised = true;
|
|
5685
|
-
}
|
|
5686
|
-
var hasIdBk = sessionStorage.getItem(TranslationUtils.SessionKeys.HasIdBackKey);
|
|
5687
|
-
if (hasIdBk && hasIdBk.toLowerCase() == 'true') {
|
|
5688
|
-
TranslationUtils.state.hasIdBack = true;
|
|
5689
|
-
}
|
|
5690
|
-
var agrVal = sessionStorage.getItem(TranslationUtils.SessionKeys.AgreementValidationKey);
|
|
5691
|
-
if (agrVal && agrVal.toLowerCase() == 'true') {
|
|
5692
|
-
TranslationUtils.state.agreementsValidation = true;
|
|
5693
|
-
}
|
|
5694
|
-
var phoneVal = sessionStorage.getItem(TranslationUtils.SessionKeys.PhoneValidationKey);
|
|
5695
|
-
if (phoneVal && phoneVal.toLowerCase() == 'true') {
|
|
5696
|
-
TranslationUtils.state.phoneValidation = true;
|
|
5697
|
-
}
|
|
5698
5453
|
const savedRequest = sessionStorage.getItem(TranslationUtils.SessionKeys.RequestIdKey);
|
|
5454
|
+
if (savedRequest && savedRequest != '' && savedRequest != this.order_id && TranslationUtils.state.debug) {
|
|
5455
|
+
console.log('Session RequestId: ' + savedRequest + ' has different value than property one: ' + this.order_id);
|
|
5456
|
+
}
|
|
5699
5457
|
if (this.order_id && this.order_id != '') {
|
|
5700
5458
|
TranslationUtils.state.requestId = this.order_id;
|
|
5701
5459
|
if (TranslationUtils.state.debug)
|
|
5702
5460
|
console.log('Current RequestId has value: ' + this.order_id);
|
|
5703
|
-
if (savedRequest && savedRequest != '' && savedRequest != this.order_id) {
|
|
5704
|
-
if (TranslationUtils.state.debug)
|
|
5705
|
-
console.log('Session RequestId: ' + savedRequest + ' has different value than property one: ' + this.order_id);
|
|
5706
|
-
this.flowStatusToSet = TranslationUtils.FlowStatus.LANDING;
|
|
5707
|
-
TranslationUtils.state.initialised = false;
|
|
5708
|
-
}
|
|
5709
5461
|
}
|
|
5710
5462
|
else if (savedRequest) {
|
|
5711
5463
|
if (TranslationUtils.state.debug)
|
|
@@ -5727,17 +5479,12 @@ const IdentificationComponent = class {
|
|
|
5727
5479
|
await this.initializeRequest();
|
|
5728
5480
|
TranslationUtils.state.flowStatus = this.flowStatusToSet;
|
|
5729
5481
|
}
|
|
5730
|
-
componentWillRender() {
|
|
5731
|
-
if (this.idSide == '') {
|
|
5732
|
-
this.idSide = TranslationUtils.state.hasIdBack ? 'front' : '';
|
|
5733
|
-
}
|
|
5734
|
-
}
|
|
5735
5482
|
async initializeRequest() {
|
|
5736
|
-
if (
|
|
5483
|
+
if (this.initialised) {
|
|
5737
5484
|
return;
|
|
5738
5485
|
}
|
|
5486
|
+
this.initialised = true;
|
|
5739
5487
|
if (TranslationUtils.state.environment == 'DEMO') {
|
|
5740
|
-
TranslationUtils.state.initialised = true;
|
|
5741
5488
|
return;
|
|
5742
5489
|
}
|
|
5743
5490
|
if (TranslationUtils.state.device.browser == Browser.Mi) {
|
|
@@ -5755,7 +5502,7 @@ const IdentificationComponent = class {
|
|
|
5755
5502
|
this.redirect_id = TranslationUtils.state.redirectId;
|
|
5756
5503
|
}
|
|
5757
5504
|
if (TranslationUtils.state.token != '' && (TranslationUtils.state.requestId != '' || TranslationUtils.state.redirectId != '')) {
|
|
5758
|
-
|
|
5505
|
+
await this.baseComponent.apiCall.AddIdentificationRequest(TranslationUtils.state.device, packageJson.version);
|
|
5759
5506
|
if (!this.order_id || this.order_id == '') {
|
|
5760
5507
|
this.order_id = TranslationUtils.state.requestId;
|
|
5761
5508
|
}
|
|
@@ -5771,19 +5518,17 @@ const IdentificationComponent = class {
|
|
|
5771
5518
|
}
|
|
5772
5519
|
render() {
|
|
5773
5520
|
let currentBlock = (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("div", { class: "div-ci align-center" }, index.h("img", { src: loaderSvg })))));
|
|
5774
|
-
if (TranslationUtils.state.
|
|
5775
|
-
|
|
5776
|
-
currentBlock = index.h("landing-validation", null);
|
|
5777
|
-
}
|
|
5521
|
+
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.LANDING) {
|
|
5522
|
+
currentBlock = index.h("landing-validation", null);
|
|
5778
5523
|
}
|
|
5779
|
-
|
|
5524
|
+
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.MOBILE) {
|
|
5780
5525
|
currentBlock = index.h("mobile-redirect", null);
|
|
5781
5526
|
}
|
|
5782
5527
|
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.AGREEMENT) {
|
|
5783
5528
|
currentBlock = index.h("agreement-info", null);
|
|
5784
5529
|
}
|
|
5785
5530
|
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.PHONE) {
|
|
5786
|
-
currentBlock = index.h("sms-
|
|
5531
|
+
currentBlock = index.h("sms-send", null);
|
|
5787
5532
|
}
|
|
5788
5533
|
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.CODE) {
|
|
5789
5534
|
currentBlock = index.h("sms-code-validation", null);
|
|
@@ -5791,11 +5536,11 @@ const IdentificationComponent = class {
|
|
|
5791
5536
|
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.CODEERROR) {
|
|
5792
5537
|
currentBlock = index.h("sms-code-validation", null);
|
|
5793
5538
|
}
|
|
5794
|
-
if (TranslationUtils.state.flowStatus
|
|
5539
|
+
if (TranslationUtils.state.flowStatus in [TranslationUtils.FlowStatus.IDFRONT, TranslationUtils.FlowStatus.IDBACK, TranslationUtils.FlowStatus.IDTILT]) {
|
|
5795
5540
|
currentBlock = index.h("process-id", null);
|
|
5796
5541
|
}
|
|
5797
|
-
if (TranslationUtils.state.flowStatus
|
|
5798
|
-
currentBlock = index.h("user-liveness",
|
|
5542
|
+
if (TranslationUtils.state.flowStatus in [TranslationUtils.FlowStatus.LIVENESS, TranslationUtils.FlowStatus.LIVENESSGESTURE]) {
|
|
5543
|
+
currentBlock = index.h("user-liveness", null);
|
|
5799
5544
|
}
|
|
5800
5545
|
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.COMPLETE) {
|
|
5801
5546
|
currentBlock = index.h("end-redirect", null);
|
|
@@ -5846,33 +5591,25 @@ const LandingValidation = class {
|
|
|
5846
5591
|
}
|
|
5847
5592
|
}
|
|
5848
5593
|
async initRequest() {
|
|
5849
|
-
|
|
5850
|
-
this.warningText = this.translations.LandingValues.WarningMd;
|
|
5851
|
-
}
|
|
5852
|
-
else {
|
|
5853
|
-
this.warningText = this.translations.LandingValues.Warning;
|
|
5854
|
-
}
|
|
5594
|
+
this.warningText = this.translations.LandingValues.Warning;
|
|
5855
5595
|
}
|
|
5856
5596
|
async startFlow() {
|
|
5857
|
-
if (
|
|
5597
|
+
if (!this.buttonDisabled) {
|
|
5858
5598
|
this.buttonDisabled = true;
|
|
5859
5599
|
if (TranslationUtils.state.environment === 'DEMO') {
|
|
5860
5600
|
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus.COMPLETE;
|
|
5861
5601
|
return;
|
|
5862
5602
|
}
|
|
5863
|
-
|
|
5603
|
+
var cameraIsAccessible = await Cameras.InitCameras(TranslationUtils.state.device);
|
|
5604
|
+
if (!cameraIsAccessible) {
|
|
5864
5605
|
if (TranslationUtils.state.device.mobileOS == MobileOS.iOS)
|
|
5865
5606
|
sessionStorage.setItem(TranslationUtils.SessionKeys.RefreshDoneKey, 'false');
|
|
5866
|
-
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus.CAMERAERROR;
|
|
5867
5607
|
}
|
|
5868
|
-
|
|
5869
|
-
TranslationUtils.state.flowStatus =
|
|
5608
|
+
try {
|
|
5609
|
+
TranslationUtils.state.flowStatus = await this.baseComponent.apiCall.LandingValidationStartFlow(cameraIsAccessible);
|
|
5870
5610
|
}
|
|
5871
|
-
|
|
5872
|
-
|
|
5873
|
-
}
|
|
5874
|
-
else {
|
|
5875
|
-
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus.ID;
|
|
5611
|
+
catch (e) {
|
|
5612
|
+
this.apiErrorEvent.emit(e);
|
|
5876
5613
|
}
|
|
5877
5614
|
}
|
|
5878
5615
|
}
|
|
@@ -5882,9 +5619,9 @@ const LandingValidation = class {
|
|
|
5882
5619
|
async leaveFlow() {
|
|
5883
5620
|
if (this.buttonDisabled)
|
|
5884
5621
|
return;
|
|
5885
|
-
TranslationUtils.state.initialised = false;
|
|
5886
5622
|
try {
|
|
5887
|
-
await this.baseComponent.apiCall.AbortRequest();
|
|
5623
|
+
let abortResult = await this.baseComponent.apiCall.AbortRequest();
|
|
5624
|
+
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus[abortResult.state];
|
|
5888
5625
|
Events.flowAborted();
|
|
5889
5626
|
}
|
|
5890
5627
|
catch (e) {
|
|
@@ -5893,7 +5630,7 @@ const LandingValidation = class {
|
|
|
5893
5630
|
}
|
|
5894
5631
|
}
|
|
5895
5632
|
render() {
|
|
5896
|
-
return (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("div", null, index.h("h1", { class: "text-center" }, this.translations.LandingValues.Title), index.h("div", { class: "d-flex space-between align-center" }, index.h("p", { class: "main-text font-size-2" }, this.translations.LandingValues.Description), index.h("div", { class: "img-info" }, index.h("div", { class: "i-effect" }), index.h("img", { src: infoSvg })))), index.h("div", { class: "info-container" }, index.h("div", { class: "img-text" }, index.h("div", { class: "bg-img" }, index.h("img", { src: idSvg })), index.h("h3", null, this.translations.LandingValues.IdInfo)), index.h("div", { class: "img-text" }, index.h("div", { class: "bg-img" }, index.h("img", { src: deviceSvg })), index.h("h3", null, this.translations.LandingValues.DeviceInfo)), index.h("div", { class: "img-text" }, index.h("div", { class: "bg-img" }, index.h("img", { src: validationSvg })), index.h("h3", null, this.translations.LandingValues.SmsInfo))), index.h("div", { class: "terms-container" }, index.h("h3", { class: "font-size-2 mb-1 text-center" }, this.warningText)), index.h("div", { class: "pos-relative show-bottom" }, index.h("div", { class: "btn-buletin" }, index.h("button", { class: "main-button", type: "button", disabled:
|
|
5633
|
+
return (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("div", null, index.h("h1", { class: "text-center" }, this.translations.LandingValues.Title), index.h("div", { class: "d-flex space-between align-center" }, index.h("p", { class: "main-text font-size-2" }, this.translations.LandingValues.Description), index.h("div", { class: "img-info" }, index.h("div", { class: "i-effect" }), index.h("img", { src: infoSvg })))), index.h("div", { class: "info-container" }, index.h("div", { class: "img-text" }, index.h("div", { class: "bg-img" }, index.h("img", { src: idSvg })), index.h("h3", null, this.translations.LandingValues.IdInfo)), index.h("div", { class: "img-text" }, index.h("div", { class: "bg-img" }, index.h("img", { src: deviceSvg })), index.h("h3", null, this.translations.LandingValues.DeviceInfo)), index.h("div", { class: "img-text" }, index.h("div", { class: "bg-img" }, index.h("img", { src: validationSvg })), index.h("h3", null, this.translations.LandingValues.SmsInfo))), index.h("div", { class: "terms-container" }, index.h("h3", { class: "font-size-2 mb-1 text-center" }, this.warningText)), index.h("div", { class: "pos-relative show-bottom" }, index.h("div", { class: "btn-buletin" }, index.h("button", { class: "main-button", type: "button", disabled: this.buttonDisabled, onClick: () => this.startFlow() }, this.translations.LandingValues.Button), index.h("p", { class: "main-text font-size-2 link-text mb-0", onClick: () => this.leaveFlow() }, this.translations.LandingValues.ButtonLeave), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
|
|
5897
5634
|
}
|
|
5898
5635
|
};
|
|
5899
5636
|
LandingValidation.style = landingValidationCss;
|
|
@@ -8797,7 +8534,7 @@ const MobileRedirect = class {
|
|
|
8797
8534
|
this.infoTextTop = this.translations.MobileRedirectValues.InfoTop;
|
|
8798
8535
|
this.infoTextBottom = this.translations.MobileRedirectValues.InfoBottom;
|
|
8799
8536
|
let envUri = TranslationUtils.state.environment == 'QA' ? 'test' : 'ect';
|
|
8800
|
-
let baseUri = TranslationUtils.state.
|
|
8537
|
+
let baseUri = TranslationUtils.state.apiBaseUrl.includes("apimd") ? 'https://onmd.id-kyc.com/' : 'https://onro.id-kyc.com/';
|
|
8801
8538
|
this.redirectLink = baseUri + envUri + '/mobileredirect?redirectId=' + TranslationUtils.state.redirectId;
|
|
8802
8539
|
if (TranslationUtils.state.phoneNumber && TranslationUtils.state.phoneNumber != '') {
|
|
8803
8540
|
this.contact = TranslationUtils.state.phoneNumber;
|
|
@@ -8880,23 +8617,7 @@ var CaptureUploadTypes;
|
|
|
8880
8617
|
CaptureUploadTypes["SelfieGestureVideo"] = "SelfieGestureVideo";
|
|
8881
8618
|
CaptureUploadTypes["TiltVideo"] = "TiltVideo";
|
|
8882
8619
|
CaptureUploadTypes["None"] = "None";
|
|
8883
|
-
})(CaptureUploadTypes || (CaptureUploadTypes = {}));
|
|
8884
|
-
var IdCaptureFlowStatus;
|
|
8885
|
-
(function (IdCaptureFlowStatus) {
|
|
8886
|
-
IdCaptureFlowStatus[IdCaptureFlowStatus["HowToFront"] = 0] = "HowToFront";
|
|
8887
|
-
IdCaptureFlowStatus[IdCaptureFlowStatus["IdFront"] = 1] = "IdFront";
|
|
8888
|
-
IdCaptureFlowStatus[IdCaptureFlowStatus["HowToBack"] = 2] = "HowToBack";
|
|
8889
|
-
IdCaptureFlowStatus[IdCaptureFlowStatus["IdBack"] = 3] = "IdBack";
|
|
8890
|
-
IdCaptureFlowStatus[IdCaptureFlowStatus["Tilt"] = 4] = "Tilt";
|
|
8891
|
-
IdCaptureFlowStatus[IdCaptureFlowStatus["End"] = 5] = "End";
|
|
8892
|
-
})(IdCaptureFlowStatus || (IdCaptureFlowStatus = {}));
|
|
8893
|
-
var SelfieFlowStatus;
|
|
8894
|
-
(function (SelfieFlowStatus) {
|
|
8895
|
-
SelfieFlowStatus[SelfieFlowStatus["HowToSelfie"] = 0] = "HowToSelfie";
|
|
8896
|
-
SelfieFlowStatus[SelfieFlowStatus["Selfie"] = 1] = "Selfie";
|
|
8897
|
-
SelfieFlowStatus[SelfieFlowStatus["Gesture"] = 2] = "Gesture";
|
|
8898
|
-
SelfieFlowStatus[SelfieFlowStatus["End"] = 3] = "End";
|
|
8899
|
-
})(SelfieFlowStatus || (SelfieFlowStatus = {}));
|
|
8620
|
+
})(CaptureUploadTypes || (CaptureUploadTypes = {}));
|
|
8900
8621
|
|
|
8901
8622
|
const processIdCss = "";
|
|
8902
8623
|
|
|
@@ -8905,7 +8626,6 @@ const ProcessId = class {
|
|
|
8905
8626
|
index.registerInstance(this, hostRef);
|
|
8906
8627
|
this.apiErrorEvent = index.createEvent(this, "apiError", 7);
|
|
8907
8628
|
this.recordingResultCount = 0;
|
|
8908
|
-
this.captureStep = undefined;
|
|
8909
8629
|
this.showTimeout = undefined;
|
|
8910
8630
|
this.showInvalid = undefined;
|
|
8911
8631
|
this.flow = undefined;
|
|
@@ -8917,47 +8637,42 @@ const ProcessId = class {
|
|
|
8917
8637
|
this.initFlow();
|
|
8918
8638
|
}
|
|
8919
8639
|
initFlow() {
|
|
8920
|
-
|
|
8921
|
-
|
|
8922
|
-
|
|
8923
|
-
|
|
8924
|
-
|
|
8925
|
-
|
|
8926
|
-
|
|
8927
|
-
|
|
8928
|
-
|
|
8929
|
-
|
|
8930
|
-
|
|
8931
|
-
|
|
8932
|
-
|
|
8933
|
-
|
|
8934
|
-
|
|
8935
|
-
|
|
8936
|
-
|
|
8937
|
-
|
|
8938
|
-
|
|
8939
|
-
|
|
8640
|
+
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.IDFRONT) {
|
|
8641
|
+
this.flow = {
|
|
8642
|
+
capture: {
|
|
8643
|
+
fileName: 'idImage.png',
|
|
8644
|
+
recName: 'idVideo.',
|
|
8645
|
+
photoType: CaptureUploadTypes.IdFront,
|
|
8646
|
+
recType: CaptureUploadTypes.IdFrontVideo,
|
|
8647
|
+
},
|
|
8648
|
+
howToDone: false,
|
|
8649
|
+
};
|
|
8650
|
+
}
|
|
8651
|
+
else if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.IDBACK) {
|
|
8652
|
+
this.flow = {
|
|
8653
|
+
capture: {
|
|
8654
|
+
fileName: 'idBackImage.png',
|
|
8655
|
+
recName: 'idBackVideo.',
|
|
8656
|
+
photoType: CaptureUploadTypes.IdBack,
|
|
8657
|
+
recType: CaptureUploadTypes.IdBackVideo,
|
|
8658
|
+
},
|
|
8659
|
+
howToDone: false,
|
|
8940
8660
|
};
|
|
8941
8661
|
}
|
|
8942
|
-
if (TranslationUtils.state.
|
|
8943
|
-
this.flow
|
|
8944
|
-
|
|
8945
|
-
|
|
8946
|
-
|
|
8947
|
-
|
|
8948
|
-
|
|
8949
|
-
|
|
8662
|
+
else if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.IDTILT) {
|
|
8663
|
+
this.flow = {
|
|
8664
|
+
capture: {
|
|
8665
|
+
fileName: 'idTiltImage.png',
|
|
8666
|
+
recName: 'idTiltVideo.',
|
|
8667
|
+
photoType: CaptureUploadTypes.None,
|
|
8668
|
+
recType: CaptureUploadTypes.TiltVideo,
|
|
8669
|
+
},
|
|
8670
|
+
howToDone: false,
|
|
8950
8671
|
};
|
|
8951
8672
|
}
|
|
8952
|
-
this.captureStep = IdCaptureFlowStatus.HowToFront;
|
|
8953
8673
|
}
|
|
8954
8674
|
howToDone() {
|
|
8955
|
-
|
|
8956
|
-
this.captureStep = IdCaptureFlowStatus.IdFront;
|
|
8957
|
-
}
|
|
8958
|
-
if (this.captureStep == IdCaptureFlowStatus.HowToBack) {
|
|
8959
|
-
this.captureStep = IdCaptureFlowStatus.IdBack;
|
|
8960
|
-
}
|
|
8675
|
+
this.flow.howToDone = true;
|
|
8961
8676
|
}
|
|
8962
8677
|
timeElapsed() {
|
|
8963
8678
|
this.showTimeout = true;
|
|
@@ -8978,34 +8693,20 @@ const ProcessId = class {
|
|
|
8978
8693
|
return;
|
|
8979
8694
|
}
|
|
8980
8695
|
try {
|
|
8981
|
-
let frontCapture = new File([idPhoto], this.flow.
|
|
8982
|
-
|
|
8983
|
-
|
|
8696
|
+
let frontCapture = new File([idPhoto], this.flow.capture.fileName, { type: 'image/png' });
|
|
8697
|
+
let uploadPhotoDone = await this.uploadPhotos(this.flow.capture.photoType, frontCapture);
|
|
8698
|
+
if (!uploadPhotoDone) {
|
|
8699
|
+
this.triggerErrorFlow();
|
|
8700
|
+
}
|
|
8984
8701
|
}
|
|
8985
8702
|
catch (e) {
|
|
8986
8703
|
this.apiErrorEvent.emit(e);
|
|
8987
8704
|
}
|
|
8988
8705
|
}
|
|
8989
|
-
async
|
|
8990
|
-
let
|
|
8991
|
-
if (
|
|
8992
|
-
|
|
8993
|
-
this.triggerErrorFlow();
|
|
8994
|
-
return;
|
|
8995
|
-
}
|
|
8996
|
-
try {
|
|
8997
|
-
let backCapture = new File([idPhoto], this.flow.back.fileName, { type: 'image/png' });
|
|
8998
|
-
this.flow.back.photoDone = await this.uploadPhotos(this.flow.back.photoType, backCapture);
|
|
8999
|
-
await this.endFlow();
|
|
9000
|
-
}
|
|
9001
|
-
catch (e) {
|
|
9002
|
-
this.apiErrorEvent.emit(e);
|
|
9003
|
-
}
|
|
9004
|
-
}
|
|
9005
|
-
async capturedIdRecording(event) {
|
|
9006
|
-
let idRecording = event.detail;
|
|
9007
|
-
if (idRecording.size == 0 && this.recordingResultCount == 0) {
|
|
9008
|
-
this.recordingResultCount++;
|
|
8706
|
+
async capturedIdRecording(event) {
|
|
8707
|
+
let idRecording = event.detail;
|
|
8708
|
+
if (idRecording.size == 0 && this.recordingResultCount == 0) {
|
|
8709
|
+
this.recordingResultCount++;
|
|
9009
8710
|
return;
|
|
9010
8711
|
}
|
|
9011
8712
|
if (idRecording.size == 0) {
|
|
@@ -9014,22 +8715,11 @@ const ProcessId = class {
|
|
|
9014
8715
|
return;
|
|
9015
8716
|
}
|
|
9016
8717
|
let mimeType = idRecording.type == Stream.mp4MimeType.type ? Stream.mp4MimeType : Stream.webmMimeType;
|
|
9017
|
-
|
|
9018
|
-
|
|
9019
|
-
|
|
9020
|
-
|
|
9021
|
-
else if (this.captureStep == IdCaptureFlowStatus.IdBack) {
|
|
9022
|
-
let backRec = new File([idRecording], this.flow.back.recName + mimeType.extension, { type: mimeType.type });
|
|
9023
|
-
this.flow.back.recordingDone = await this.uploadRecording(this.flow.back.recType, backRec);
|
|
9024
|
-
}
|
|
9025
|
-
else if (this.captureStep == IdCaptureFlowStatus.Tilt) {
|
|
9026
|
-
let tiltRec = new File([idRecording], this.flow.tilt.recName + mimeType.extension, { type: mimeType.type });
|
|
9027
|
-
this.flow.tilt.recordingDone = await this.uploadRecording(this.flow.tilt.recType, tiltRec);
|
|
9028
|
-
}
|
|
9029
|
-
else {
|
|
9030
|
-
this.triggerErrorFlow(true);
|
|
8718
|
+
let captureRec = new File([idRecording], this.flow.capture.recName + mimeType.extension, { type: mimeType.type });
|
|
8719
|
+
let recordingUploaded = await this.uploadRecording(this.flow.capture.recType, captureRec);
|
|
8720
|
+
if (!recordingUploaded) {
|
|
8721
|
+
this.triggerErrorFlow();
|
|
9031
8722
|
}
|
|
9032
|
-
await this.endFlow();
|
|
9033
8723
|
this.recordingResultCount = 0;
|
|
9034
8724
|
}
|
|
9035
8725
|
async componentDidLoad() {
|
|
@@ -9062,72 +8752,9 @@ const ProcessId = class {
|
|
|
9062
8752
|
}
|
|
9063
8753
|
return false;
|
|
9064
8754
|
}
|
|
9065
|
-
triggerErrorFlow(
|
|
9066
|
-
if (this.captureStep == IdCaptureFlowStatus.IdBack) {
|
|
9067
|
-
restart = true;
|
|
9068
|
-
}
|
|
9069
|
-
if (restart) {
|
|
9070
|
-
this.initFlow();
|
|
9071
|
-
this.showInvalid = true;
|
|
9072
|
-
return;
|
|
9073
|
-
}
|
|
9074
|
-
if (this.captureStep == IdCaptureFlowStatus.IdFront) {
|
|
9075
|
-
this.flow.front.photoDone = false;
|
|
9076
|
-
this.flow.front.recordingDone = false;
|
|
9077
|
-
}
|
|
9078
|
-
if (this.captureStep == IdCaptureFlowStatus.IdBack) {
|
|
9079
|
-
this.flow.back.photoDone = false;
|
|
9080
|
-
this.flow.back.recordingDone = false;
|
|
9081
|
-
}
|
|
9082
|
-
if (this.captureStep == IdCaptureFlowStatus.Tilt) {
|
|
9083
|
-
this.flow.tilt.photoDone = true;
|
|
9084
|
-
this.flow.tilt.recordingDone = false;
|
|
9085
|
-
}
|
|
8755
|
+
triggerErrorFlow() {
|
|
9086
8756
|
this.showInvalid = true;
|
|
9087
8757
|
}
|
|
9088
|
-
async endFlow() {
|
|
9089
|
-
if (this.captureStep == IdCaptureFlowStatus.IdFront) {
|
|
9090
|
-
if (this.flow.front.photoDone && this.flow.front.recordingDone) {
|
|
9091
|
-
if (TranslationUtils.state.hasIdBack) {
|
|
9092
|
-
this.captureStep = IdCaptureFlowStatus.IdBack;
|
|
9093
|
-
}
|
|
9094
|
-
else if (TranslationUtils.state.hasIdTilt) {
|
|
9095
|
-
this.captureStep = IdCaptureFlowStatus.Tilt;
|
|
9096
|
-
}
|
|
9097
|
-
else {
|
|
9098
|
-
this.captureStep = IdCaptureFlowStatus.End;
|
|
9099
|
-
}
|
|
9100
|
-
}
|
|
9101
|
-
else {
|
|
9102
|
-
return;
|
|
9103
|
-
}
|
|
9104
|
-
}
|
|
9105
|
-
if (this.captureStep == IdCaptureFlowStatus.IdBack && TranslationUtils.state.hasIdBack) {
|
|
9106
|
-
if (this.flow.back.photoDone && this.flow.back.recordingDone) {
|
|
9107
|
-
if (TranslationUtils.state.hasIdTilt) {
|
|
9108
|
-
this.captureStep = IdCaptureFlowStatus.Tilt;
|
|
9109
|
-
}
|
|
9110
|
-
else {
|
|
9111
|
-
this.captureStep = IdCaptureFlowStatus.End;
|
|
9112
|
-
}
|
|
9113
|
-
}
|
|
9114
|
-
else {
|
|
9115
|
-
return;
|
|
9116
|
-
}
|
|
9117
|
-
}
|
|
9118
|
-
if (this.captureStep == IdCaptureFlowStatus.Tilt && TranslationUtils.state.hasIdTilt) {
|
|
9119
|
-
if (this.flow.tilt.photoDone && this.flow.tilt.recordingDone) {
|
|
9120
|
-
this.captureStep = IdCaptureFlowStatus.End;
|
|
9121
|
-
}
|
|
9122
|
-
else {
|
|
9123
|
-
return;
|
|
9124
|
-
}
|
|
9125
|
-
}
|
|
9126
|
-
if (this.captureStep != IdCaptureFlowStatus.End) {
|
|
9127
|
-
return;
|
|
9128
|
-
}
|
|
9129
|
-
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus.LIVENESS;
|
|
9130
|
-
}
|
|
9131
8758
|
async disconnectedCallback() {
|
|
9132
8759
|
await this.baseComponent.finalize();
|
|
9133
8760
|
}
|
|
@@ -9143,30 +8770,17 @@ const ProcessId = class {
|
|
|
9143
8770
|
}
|
|
9144
8771
|
render() {
|
|
9145
8772
|
let error = index.h("capture-error", { type: "ID" });
|
|
9146
|
-
let
|
|
9147
|
-
let
|
|
9148
|
-
let tiltCapture = index.h("id-tilt", null);
|
|
9149
|
-
let howToFront = index.h("how-to-info", { idSide: "front" });
|
|
9150
|
-
let howToBack = index.h("how-to-info", { idSide: "back" });
|
|
8773
|
+
let capture = index.h("id-capture", null);
|
|
8774
|
+
let howTo = index.h("how-to-info", null);
|
|
9151
8775
|
if (this.showInvalid || this.showTimeout) {
|
|
9152
8776
|
return error;
|
|
9153
8777
|
}
|
|
9154
|
-
if (
|
|
9155
|
-
return
|
|
9156
|
-
}
|
|
9157
|
-
if (this.captureStep == IdCaptureFlowStatus.HowToBack) {
|
|
9158
|
-
return howToBack;
|
|
9159
|
-
}
|
|
9160
|
-
if (this.captureStep == IdCaptureFlowStatus.IdFront) {
|
|
9161
|
-
return frontCapture;
|
|
9162
|
-
}
|
|
9163
|
-
if (this.captureStep == IdCaptureFlowStatus.IdBack) {
|
|
9164
|
-
return secondCapture;
|
|
8778
|
+
if (TranslationUtils.state.flowStatus != TranslationUtils.FlowStatus.IDTILT && this.flow.howToDone) {
|
|
8779
|
+
return howTo;
|
|
9165
8780
|
}
|
|
9166
|
-
|
|
9167
|
-
return
|
|
8781
|
+
else {
|
|
8782
|
+
return capture;
|
|
9168
8783
|
}
|
|
9169
|
-
return index.h("div", null);
|
|
9170
8784
|
}
|
|
9171
8785
|
};
|
|
9172
8786
|
ProcessId.style = processIdCss;
|
|
@@ -9174,31 +8788,23 @@ ProcessId.style = processIdCss;
|
|
|
9174
8788
|
const selfieCaptureCss = "";
|
|
9175
8789
|
|
|
9176
8790
|
const SelfieCapture = class {
|
|
9177
|
-
// @State() private animationPath: string;
|
|
9178
8791
|
constructor(hostRef) {
|
|
9179
8792
|
index.registerInstance(this, hostRef);
|
|
9180
8793
|
this.eventPhotoCapture = index.createEvent(this, "photoSelfieCapture", 7);
|
|
9181
8794
|
this.apiErrorEvent = index.createEvent(this, "apiError", 7);
|
|
9182
8795
|
this.eventTimeElapsed = index.createEvent(this, "timeElapsed", 7);
|
|
9183
|
-
this.photoIsReady = photos => {
|
|
9184
|
-
//this.closeCamera();
|
|
9185
|
-
this.eventPhotoCapture.emit(photos);
|
|
9186
|
-
};
|
|
9187
8796
|
this.videoStarted = undefined;
|
|
9188
8797
|
this.captureTaken = undefined;
|
|
9189
8798
|
this.verified = undefined;
|
|
9190
8799
|
this.titleMesage = undefined;
|
|
9191
8800
|
this.demoEnded = undefined;
|
|
9192
8801
|
this.demoVideo = undefined;
|
|
9193
|
-
this.uploadingLink = undefined;
|
|
9194
8802
|
this.captureHeight = undefined;
|
|
9195
8803
|
this.captureWidth = undefined;
|
|
9196
8804
|
this.captureTaken = false;
|
|
9197
8805
|
this.verified = false;
|
|
9198
8806
|
this.cameras = new Cameras();
|
|
9199
8807
|
this.demoEnded = false;
|
|
9200
|
-
this.uploadingLink = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_selfie.mp4';
|
|
9201
|
-
this.baseComponent = new BaseComponent(TranslationUtils.FlowSteps.SelfieCapture);
|
|
9202
8808
|
}
|
|
9203
8809
|
eventVideoStarted(event) {
|
|
9204
8810
|
this.videoStarted = true;
|
|
@@ -9216,8 +8822,20 @@ const SelfieCapture = class {
|
|
|
9216
8822
|
}
|
|
9217
8823
|
}
|
|
9218
8824
|
async componentDidLoad() {
|
|
9219
|
-
|
|
9220
|
-
|
|
8825
|
+
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.LIVENESS) {
|
|
8826
|
+
this.verificationMode = VerificationMode.Full;
|
|
8827
|
+
this.currentStep = TranslationUtils.FlowSteps.SelfieCapture;
|
|
8828
|
+
this.mainStream = Stream.getNewInstance(this.verificationMode);
|
|
8829
|
+
this.demoVideo.src = TranslationUtils.SelfieCaptureValues.FacePoseDemoMapping[FacePose.Main];
|
|
8830
|
+
}
|
|
8831
|
+
else if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.LIVENESSGESTURE) {
|
|
8832
|
+
this.verificationMode = VerificationMode.Tilt;
|
|
8833
|
+
this.currentStep = TranslationUtils.FlowSteps.SelfieTilt;
|
|
8834
|
+
this.mainStream = Stream.getNewInstance(this.verificationMode);
|
|
8835
|
+
this.demoVideo.src = TranslationUtils.SelfieCaptureValues.FacePoseDemoMapping[this.mainStream.facePose];
|
|
8836
|
+
}
|
|
8837
|
+
this.baseComponent = new BaseComponent(this.currentStep);
|
|
8838
|
+
await this.baseComponent.logStep(this.currentStep, TranslationUtils.FlowMoments.Initialized);
|
|
9221
8839
|
this.demoVideo.play();
|
|
9222
8840
|
await delay(this.translations.GlobalValues.VideoLenght);
|
|
9223
8841
|
this.demoEnded = true;
|
|
@@ -9229,8 +8847,7 @@ const SelfieCapture = class {
|
|
|
9229
8847
|
navigator.mediaDevices
|
|
9230
8848
|
.getUserMedia(constraints)
|
|
9231
8849
|
.then(stream => {
|
|
9232
|
-
|
|
9233
|
-
superStream.initStream(stream);
|
|
8850
|
+
this.mainStream.initStream(stream);
|
|
9234
8851
|
})
|
|
9235
8852
|
.catch(e => {
|
|
9236
8853
|
this.closeCamera();
|
|
@@ -9239,8 +8856,8 @@ const SelfieCapture = class {
|
|
|
9239
8856
|
}, 100);
|
|
9240
8857
|
}
|
|
9241
8858
|
closeCamera() {
|
|
9242
|
-
if (
|
|
9243
|
-
|
|
8859
|
+
if (this.mainStream) {
|
|
8860
|
+
this.mainStream.dropStream();
|
|
9244
8861
|
}
|
|
9245
8862
|
}
|
|
9246
8863
|
disconnectedCallback() {
|
|
@@ -9252,14 +8869,14 @@ const SelfieCapture = class {
|
|
|
9252
8869
|
if (this.captureTaken)
|
|
9253
8870
|
return;
|
|
9254
8871
|
this.captureTaken = true;
|
|
9255
|
-
if (
|
|
9256
|
-
let res = await
|
|
9257
|
-
this.
|
|
8872
|
+
if (this.mainStream) {
|
|
8873
|
+
let res = await this.mainStream.takePhoto();
|
|
8874
|
+
this.eventPhotoCapture.emit(res);
|
|
9258
8875
|
}
|
|
9259
8876
|
else {
|
|
9260
8877
|
this.eventTimeElapsed.emit();
|
|
9261
8878
|
}
|
|
9262
|
-
await this.baseComponent.logStep(
|
|
8879
|
+
await this.baseComponent.logStep(this.currentStep, TranslationUtils.FlowMoments.Finalized);
|
|
9263
8880
|
}
|
|
9264
8881
|
async verificationFinished() {
|
|
9265
8882
|
if (this.verified)
|
|
@@ -9268,14 +8885,10 @@ const SelfieCapture = class {
|
|
|
9268
8885
|
this.titleMesage = this.translations.SelfieCaptureValues.Loading;
|
|
9269
8886
|
this.closeCamera();
|
|
9270
8887
|
this.demoEnded = false;
|
|
9271
|
-
|
|
9272
|
-
this.demoVideo.
|
|
9273
|
-
this.demoVideo.
|
|
9274
|
-
|
|
9275
|
-
loops++;
|
|
9276
|
-
this.demoVideo.play();
|
|
9277
|
-
await delay(this.translations.GlobalValues.VideoLenght);
|
|
9278
|
-
}
|
|
8888
|
+
this.demoVideo.src = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_selfie.mp4';
|
|
8889
|
+
this.demoVideo.loop = true;
|
|
8890
|
+
this.demoVideo.play();
|
|
8891
|
+
await delay(10000);
|
|
9279
8892
|
this.eventTimeElapsed.emit();
|
|
9280
8893
|
}
|
|
9281
8894
|
render() {
|
|
@@ -9299,169 +8912,79 @@ const SelfieCapture = class {
|
|
|
9299
8912
|
};
|
|
9300
8913
|
SelfieCapture.style = selfieCaptureCss;
|
|
9301
8914
|
|
|
9302
|
-
const
|
|
8915
|
+
const smsCodeValidationCss = "";
|
|
9303
8916
|
|
|
9304
|
-
const
|
|
9305
|
-
// @State() private animationPath: string;
|
|
8917
|
+
const SmsCodeValidation = class {
|
|
9306
8918
|
constructor(hostRef) {
|
|
9307
8919
|
index.registerInstance(this, hostRef);
|
|
9308
|
-
this.eventPhotoCapture = index.createEvent(this, "photoSelfieTiltCapture", 7);
|
|
9309
8920
|
this.apiErrorEvent = index.createEvent(this, "apiError", 7);
|
|
9310
|
-
this.
|
|
9311
|
-
this.
|
|
9312
|
-
|
|
9313
|
-
|
|
9314
|
-
|
|
9315
|
-
this.
|
|
9316
|
-
this.
|
|
9317
|
-
this.verified = undefined;
|
|
9318
|
-
this.titleMesage = undefined;
|
|
9319
|
-
this.demoEnded = undefined;
|
|
9320
|
-
this.demoVideo = undefined;
|
|
9321
|
-
this.uploadingLink = undefined;
|
|
9322
|
-
this.captureHeight = undefined;
|
|
9323
|
-
this.captureWidth = undefined;
|
|
9324
|
-
this.captureTaken = false;
|
|
9325
|
-
this.verified = false;
|
|
9326
|
-
this.cameras = new Cameras();
|
|
9327
|
-
this.demoEnded = false;
|
|
9328
|
-
this.uploadingLink = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_selfie.mp4';
|
|
9329
|
-
this.baseComponent = new BaseComponent(TranslationUtils.FlowSteps.SelfieTilt);
|
|
9330
|
-
}
|
|
9331
|
-
eventVideoStarted(event) {
|
|
9332
|
-
this.videoStarted = true;
|
|
9333
|
-
var cameraSize = event.detail;
|
|
9334
|
-
var height = Math.round((cameraSize.width * 16) / 9);
|
|
9335
|
-
this.captureHeight = height - Math.round((window.screen.height - height) / 2);
|
|
9336
|
-
this.captureWidth = Math.round((this.captureHeight * 9) / 16);
|
|
8921
|
+
this.title = undefined;
|
|
8922
|
+
this.details = undefined;
|
|
8923
|
+
this.buttonText = undefined;
|
|
8924
|
+
this.code = undefined;
|
|
8925
|
+
this.canSend = false;
|
|
8926
|
+
this.baseComponent = new BaseComponent(TranslationUtils.FlowSteps.OtpCheck);
|
|
8927
|
+
this.baseComponent.setEventEmitter(this.apiErrorEvent);
|
|
9337
8928
|
}
|
|
9338
|
-
async
|
|
9339
|
-
|
|
9340
|
-
|
|
9341
|
-
|
|
9342
|
-
|
|
9343
|
-
this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
|
|
8929
|
+
async doAction() {
|
|
8930
|
+
try {
|
|
8931
|
+
this.canSend = false;
|
|
8932
|
+
var codeChecked = await this.baseComponent.apiCall.CheckOTPCode(TranslationUtils.state.requestId, this.code);
|
|
8933
|
+
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus[codeChecked.status];
|
|
9344
8934
|
}
|
|
9345
|
-
|
|
9346
|
-
|
|
9347
|
-
this.mainStream = Stream.getNewInstance(VerificationMode.Tilt);
|
|
9348
|
-
await this.baseComponent.logStep(TranslationUtils.FlowSteps.SelfieTilt, TranslationUtils.FlowMoments.Initialized);
|
|
9349
|
-
this.titleMesage = this.translations.SelfieCaptureValues.FacePoseMapping[this.mainStream.facePose];
|
|
9350
|
-
this.demoEnded = false;
|
|
9351
|
-
this.demoVideo.src = TranslationUtils.SelfieCaptureValues.FacePoseDemoMapping[this.mainStream.facePose];
|
|
9352
|
-
this.demoVideo.play();
|
|
9353
|
-
await delay(this.translations.GlobalValues.VideoLenght);
|
|
9354
|
-
this.demoEnded = true;
|
|
9355
|
-
this.openCamera();
|
|
9356
|
-
}
|
|
9357
|
-
async openCamera() {
|
|
9358
|
-
const constraints = this.cameras.GetConstraints('', TranslationUtils.state.device, true);
|
|
9359
|
-
setTimeout(() => {
|
|
9360
|
-
navigator.mediaDevices
|
|
9361
|
-
.getUserMedia(constraints)
|
|
9362
|
-
.then(stream => {
|
|
9363
|
-
this.mainStream.initStream(stream);
|
|
9364
|
-
})
|
|
9365
|
-
.catch(e => {
|
|
9366
|
-
this.closeCamera();
|
|
9367
|
-
this.apiErrorEvent.emit(e);
|
|
9368
|
-
});
|
|
9369
|
-
}, 100);
|
|
9370
|
-
}
|
|
9371
|
-
closeCamera() {
|
|
9372
|
-
if (this.mainStream) {
|
|
9373
|
-
this.mainStream.dropStream();
|
|
8935
|
+
catch (e) {
|
|
8936
|
+
this.apiErrorEvent.emit(e);
|
|
9374
8937
|
}
|
|
9375
8938
|
}
|
|
9376
|
-
disconnectedCallback() {
|
|
9377
|
-
this.
|
|
9378
|
-
Stream.instance = null;
|
|
9379
|
-
FaceML5Detector.instance = null;
|
|
8939
|
+
async disconnectedCallback() {
|
|
8940
|
+
await this.baseComponent.finalize();
|
|
9380
8941
|
}
|
|
9381
|
-
async
|
|
9382
|
-
|
|
9383
|
-
|
|
9384
|
-
this.
|
|
9385
|
-
|
|
9386
|
-
this.photoIsReady(res);
|
|
9387
|
-
await this.baseComponent.logStep(TranslationUtils.FlowSteps.SelfieTilt, TranslationUtils.FlowMoments.Finalized);
|
|
8942
|
+
async componentWillRender() {
|
|
8943
|
+
this.translations = await TranslationUtils.Translations.getValues();
|
|
8944
|
+
this.title = this.translations.CodeValidationValues.Title;
|
|
8945
|
+
this.details = this.translations.CodeValidationValues.Description;
|
|
8946
|
+
this.buttonText = this.translations.CodeValidationValues.Button;
|
|
9388
8947
|
}
|
|
9389
|
-
async
|
|
9390
|
-
|
|
9391
|
-
|
|
9392
|
-
|
|
9393
|
-
|
|
9394
|
-
this.
|
|
9395
|
-
this.
|
|
9396
|
-
|
|
9397
|
-
this.
|
|
9398
|
-
|
|
9399
|
-
while (loops < 7) {
|
|
9400
|
-
loops++;
|
|
9401
|
-
this.demoVideo.play();
|
|
9402
|
-
await delay(this.translations.GlobalValues.VideoLenght);
|
|
9403
|
-
}
|
|
9404
|
-
this.eventTimeElapsed.emit();
|
|
8948
|
+
async componentDidLoad() {
|
|
8949
|
+
await this.baseComponent.initialize();
|
|
8950
|
+
}
|
|
8951
|
+
handleChangeCode(ev) {
|
|
8952
|
+
let value = ev.target ? ev.target.value : '';
|
|
8953
|
+
this.code = value;
|
|
8954
|
+
if (this.code.length > 4)
|
|
8955
|
+
this.code = this.code.substring(0, 4);
|
|
8956
|
+
this.canSend = this.code.length == 4;
|
|
8957
|
+
ev.target.value = this.code;
|
|
9405
8958
|
}
|
|
9406
8959
|
render() {
|
|
9407
|
-
let
|
|
9408
|
-
if (TranslationUtils.state.
|
|
9409
|
-
|
|
9410
|
-
'width': this.captureWidth + 'px',
|
|
9411
|
-
'height': this.captureHeight + 'px',
|
|
9412
|
-
'overflow': 'hidden',
|
|
9413
|
-
'borderRadius': '10px',
|
|
9414
|
-
'text-align': 'center',
|
|
9415
|
-
'margin': 'auto',
|
|
9416
|
-
};
|
|
8960
|
+
let errorBlock;
|
|
8961
|
+
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.CODEERROR) {
|
|
8962
|
+
errorBlock = index.h("p", { class: "main-text font-size-18 mt-15 color-red text-center" }, this.translations.CodeValidationValues.Error);
|
|
9417
8963
|
}
|
|
9418
|
-
|
|
9419
|
-
//let videoClass = this.device.isMobile ? '' : 'video-demo';
|
|
9420
|
-
let bgDemo = this.verified ? 'container' : 'container bg-black';
|
|
9421
|
-
return (index.h("div", { class: bgDemo }, index.h("div", { class: "container-video" }, index.h("div", { hidden: this.demoEnded }, index.h("video", { id: "howtoSelfie", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, index.h("source", { type: "video/mp4" }))), index.h("div", { hidden: this.demoEnded == false }, index.h("div", { hidden: this.verified }, index.h("div", { class: "video-capture" }, index.h("div", { style: cameraStyle }, index.h("camera-comp", { "capture-mode": "selfie" }))))), index.h("div", { class: "capture-title" }, index.h("h1", { class: titleClass }, this.titleMesage), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText)))));
|
|
8964
|
+
return (index.h("div", { class: "container" }, index.h("div", { class: "row row-validare" }, index.h("div", null, index.h("h1", { class: "text-center" }, this.title), errorBlock == null ? index.h("p", { class: "main-text font-size-2 mt-15 mb-20 text-center" }, this.details) : errorBlock), index.h("div", { class: "input-container mb-15" }, index.h("input", { type: "text", id: "codeInput", class: "main-input", onInput: ev => this.handleChangeCode(ev), value: this.code })), index.h("div", { class: "pos-relative show-bottom" }, index.h("div", { class: "btn-buletin" }, index.h("button", { id: "action", disabled: !this.canSend, class: "main-button", onClick: () => this.doAction() }, this.buttonText), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
|
|
9422
8965
|
}
|
|
9423
|
-
get component() { return index.getElement(this); }
|
|
9424
8966
|
};
|
|
9425
|
-
|
|
8967
|
+
SmsCodeValidation.style = smsCodeValidationCss;
|
|
9426
8968
|
|
|
9427
|
-
const
|
|
8969
|
+
const smsSendCss = "";
|
|
9428
8970
|
|
|
9429
|
-
const
|
|
8971
|
+
const SmsSend = class {
|
|
9430
8972
|
constructor(hostRef) {
|
|
9431
8973
|
index.registerInstance(this, hostRef);
|
|
9432
8974
|
this.apiErrorEvent = index.createEvent(this, "apiError", 7);
|
|
9433
|
-
this.title = undefined;
|
|
9434
|
-
this.details = undefined;
|
|
9435
8975
|
this.buttonText = undefined;
|
|
9436
8976
|
this.phoneNumber = undefined;
|
|
9437
|
-
this.code = undefined;
|
|
9438
8977
|
this.prefilledPhone = false;
|
|
9439
8978
|
this.canSend = false;
|
|
9440
|
-
|
|
9441
|
-
this.baseComponent = new BaseComponent(TranslationUtils.FlowSteps.OtpSend);
|
|
9442
|
-
}
|
|
9443
|
-
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.CODE) {
|
|
9444
|
-
this.baseComponent = new BaseComponent(TranslationUtils.FlowSteps.OtpCheck);
|
|
9445
|
-
}
|
|
8979
|
+
this.baseComponent = new BaseComponent(TranslationUtils.FlowSteps.OtpSend);
|
|
9446
8980
|
this.baseComponent.setEventEmitter(this.apiErrorEvent);
|
|
9447
8981
|
}
|
|
9448
8982
|
async doAction() {
|
|
9449
8983
|
try {
|
|
9450
8984
|
this.canSend = false;
|
|
9451
|
-
|
|
9452
|
-
|
|
9453
|
-
|
|
9454
|
-
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus.ID;
|
|
9455
|
-
}
|
|
9456
|
-
else {
|
|
9457
|
-
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus.CODEERROR;
|
|
9458
|
-
}
|
|
9459
|
-
}
|
|
9460
|
-
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.PHONE) {
|
|
9461
|
-
var codeSent = await this.baseComponent.apiCall.SendOTPCode(TranslationUtils.state.requestId, this.phoneNumber);
|
|
9462
|
-
if (codeSent === true) {
|
|
9463
|
-
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus.CODE;
|
|
9464
|
-
}
|
|
8985
|
+
var codeSent = await this.baseComponent.apiCall.SendOTPCode(TranslationUtils.state.requestId, this.phoneNumber);
|
|
8986
|
+
if (codeSent.sent === true) {
|
|
8987
|
+
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus[codeSent.status];
|
|
9465
8988
|
}
|
|
9466
8989
|
}
|
|
9467
8990
|
catch (e) {
|
|
@@ -9473,20 +8996,11 @@ const SmsCodeValidation = class {
|
|
|
9473
8996
|
}
|
|
9474
8997
|
async componentWillRender() {
|
|
9475
8998
|
this.translations = await TranslationUtils.Translations.getValues();
|
|
9476
|
-
|
|
9477
|
-
|
|
9478
|
-
this.
|
|
9479
|
-
this.
|
|
9480
|
-
|
|
9481
|
-
this.phoneNumber = TranslationUtils.state.phoneNumber;
|
|
9482
|
-
this.prefilledPhone = true;
|
|
9483
|
-
this.canSend = true;
|
|
9484
|
-
}
|
|
9485
|
-
}
|
|
9486
|
-
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.CODE || TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.CODEERROR) {
|
|
9487
|
-
this.title = this.translations.CodeValidationValues.Title;
|
|
9488
|
-
this.details = this.translations.CodeValidationValues.Description;
|
|
9489
|
-
this.buttonText = this.translations.CodeValidationValues.Button;
|
|
8999
|
+
this.buttonText = this.translations.PhoneValidationValues.Button;
|
|
9000
|
+
if (TranslationUtils.state.phoneNumber && TranslationUtils.state.phoneNumber != '') {
|
|
9001
|
+
this.phoneNumber = TranslationUtils.state.phoneNumber;
|
|
9002
|
+
this.prefilledPhone = true;
|
|
9003
|
+
this.canSend = true;
|
|
9490
9004
|
}
|
|
9491
9005
|
}
|
|
9492
9006
|
async componentDidLoad() {
|
|
@@ -9500,30 +9014,11 @@ const SmsCodeValidation = class {
|
|
|
9500
9014
|
this.canSend = this.phoneNumber.length == 10;
|
|
9501
9015
|
ev.target.value = this.phoneNumber;
|
|
9502
9016
|
}
|
|
9503
|
-
handleChangeCode(ev) {
|
|
9504
|
-
let value = ev.target ? ev.target.value : '';
|
|
9505
|
-
this.code = value;
|
|
9506
|
-
if (this.code.length > 4)
|
|
9507
|
-
this.code = this.code.substring(0, 4);
|
|
9508
|
-
this.canSend = this.code.length == 4;
|
|
9509
|
-
ev.target.value = this.code;
|
|
9510
|
-
}
|
|
9511
9017
|
render() {
|
|
9512
|
-
|
|
9513
|
-
let errorBlock;
|
|
9514
|
-
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.CODEERROR) {
|
|
9515
|
-
errorBlock = index.h("p", { class: "main-text font-size-18 mt-15 color-red text-center" }, this.translations.CodeValidationValues.Error);
|
|
9516
|
-
}
|
|
9517
|
-
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.PHONE) {
|
|
9518
|
-
inputBlock = (index.h("div", { class: "input-container mb-15" }, index.h("label", { class: "font-size-18 mb-1" }, index.h("b", null, this.translations.PhoneValidationValues.Label)), index.h("input", { type: "tel", id: "phoneInput", class: "main-input", disabled: this.prefilledPhone, onInput: ev => this.handleChangePhone(ev), value: this.phoneNumber })));
|
|
9519
|
-
}
|
|
9520
|
-
else {
|
|
9521
|
-
inputBlock = (index.h("div", { class: "input-container mb-15" }, index.h("input", { type: "text", id: "codeInput", class: "main-input", onInput: ev => this.handleChangeCode(ev), value: this.code })));
|
|
9522
|
-
}
|
|
9523
|
-
return (index.h("div", { class: "container" }, index.h("div", { class: "row row-validare" }, index.h("div", null, index.h("h1", { class: "text-center" }, this.title), errorBlock == null ? index.h("p", { class: "main-text font-size-2 mt-15 mb-20 text-center" }, this.details) : errorBlock), inputBlock, index.h("div", { class: "pos-relative show-bottom" }, index.h("div", { class: "btn-buletin" }, index.h("button", { id: "action", disabled: !this.canSend, class: "main-button", onClick: () => this.doAction() }, this.buttonText), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
|
|
9018
|
+
return (index.h("div", { class: "container" }, index.h("div", { class: "row row-validare" }, index.h("div", { class: "input-container mb-15" }, index.h("label", { class: "font-size-18 mb-1" }, index.h("b", null, this.translations.PhoneValidationValues.Label)), index.h("input", { type: "tel", id: "phoneInput", class: "main-input", disabled: this.prefilledPhone, onInput: ev => this.handleChangePhone(ev), value: this.phoneNumber })), index.h("div", { class: "pos-relative show-bottom" }, index.h("div", { class: "btn-buletin" }, index.h("button", { id: "action", disabled: !this.canSend, class: "main-button", onClick: () => this.doAction() }, this.buttonText), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
|
|
9524
9019
|
}
|
|
9525
9020
|
};
|
|
9526
|
-
|
|
9021
|
+
SmsSend.style = smsSendCss;
|
|
9527
9022
|
|
|
9528
9023
|
const userLivenessCss = "";
|
|
9529
9024
|
|
|
@@ -9534,57 +9029,52 @@ const UserLiveness = class {
|
|
|
9534
9029
|
this.recordingResultCount = 0;
|
|
9535
9030
|
this.recordingRetryCount = 0;
|
|
9536
9031
|
this.showError = undefined;
|
|
9537
|
-
this.captureStep = undefined;
|
|
9538
9032
|
this.flow = undefined;
|
|
9539
|
-
this.
|
|
9540
|
-
this.baseComponent.setEventEmitter(this.apiErrorEvent);
|
|
9033
|
+
this.howToDone = false;
|
|
9541
9034
|
}
|
|
9542
9035
|
async componentDidLoad() {
|
|
9543
9036
|
await this.baseComponent.initialize();
|
|
9544
9037
|
}
|
|
9545
9038
|
componentWillLoad() {
|
|
9546
|
-
|
|
9547
|
-
|
|
9548
|
-
|
|
9549
|
-
|
|
9550
|
-
|
|
9551
|
-
|
|
9552
|
-
|
|
9553
|
-
|
|
9554
|
-
|
|
9555
|
-
|
|
9556
|
-
tilt: null,
|
|
9557
|
-
};
|
|
9558
|
-
if (TranslationUtils.state.hasSelfieGesture) {
|
|
9559
|
-
this.flow.tilt = {
|
|
9560
|
-
photoDone: true,
|
|
9561
|
-
recordingDone: false,
|
|
9562
|
-
fileName: '',
|
|
9563
|
-
recName: 'selfieTiltVideo.',
|
|
9564
|
-
photoType: CaptureUploadTypes.None,
|
|
9565
|
-
recType: CaptureUploadTypes.SelfieGestureVideo,
|
|
9039
|
+
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.LIVENESS) {
|
|
9040
|
+
this.currentStep = TranslationUtils.FlowSteps.Selfie;
|
|
9041
|
+
this.flow = {
|
|
9042
|
+
capture: {
|
|
9043
|
+
fileName: 'selfie.png',
|
|
9044
|
+
recName: 'selfieVideo.',
|
|
9045
|
+
photoType: CaptureUploadTypes.Selfie,
|
|
9046
|
+
recType: CaptureUploadTypes.SelfieVideo,
|
|
9047
|
+
},
|
|
9048
|
+
howToDone: false,
|
|
9566
9049
|
};
|
|
9567
9050
|
}
|
|
9568
|
-
|
|
9051
|
+
else if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.LIVENESSGESTURE) {
|
|
9052
|
+
this.currentStep = TranslationUtils.FlowSteps.SelfieTilt;
|
|
9053
|
+
this.flow = {
|
|
9054
|
+
capture: {
|
|
9055
|
+
fileName: '',
|
|
9056
|
+
recName: 'selfieTiltVideo.',
|
|
9057
|
+
photoType: CaptureUploadTypes.None,
|
|
9058
|
+
recType: CaptureUploadTypes.SelfieGestureVideo,
|
|
9059
|
+
},
|
|
9060
|
+
howToDone: false,
|
|
9061
|
+
};
|
|
9062
|
+
}
|
|
9063
|
+
this.baseComponent = new BaseComponent(this.currentStep);
|
|
9064
|
+
this.baseComponent.setEventEmitter(this.apiErrorEvent);
|
|
9569
9065
|
}
|
|
9570
|
-
|
|
9571
|
-
this.
|
|
9066
|
+
howToDoneEvent() {
|
|
9067
|
+
this.howToDone = true;
|
|
9572
9068
|
}
|
|
9573
9069
|
timeElapsed() {
|
|
9574
9070
|
this.showError = true;
|
|
9575
9071
|
}
|
|
9576
9072
|
captureErrorDone() {
|
|
9577
9073
|
this.showError = false;
|
|
9578
|
-
if (this.captureStep == SelfieFlowStatus.Selfie) {
|
|
9579
|
-
this.flow.front.photoDone = false;
|
|
9580
|
-
this.flow.front.recordingDone = false;
|
|
9581
|
-
}
|
|
9582
|
-
if (this.captureStep == SelfieFlowStatus.Gesture) {
|
|
9583
|
-
this.flow.tilt.photoDone = false;
|
|
9584
|
-
this.flow.tilt.recordingDone = false;
|
|
9585
|
-
}
|
|
9586
9074
|
}
|
|
9587
9075
|
async captureSelfieImage(event) {
|
|
9076
|
+
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.LIVENESSGESTURE)
|
|
9077
|
+
return;
|
|
9588
9078
|
let selfiePhoto = event.detail;
|
|
9589
9079
|
if (selfiePhoto.size == 0) {
|
|
9590
9080
|
await this.baseComponent.apiCall.AddLog({ message: 'Empty selfie', blobData: selfiePhoto }, getLogMessage());
|
|
@@ -9592,8 +9082,11 @@ const UserLiveness = class {
|
|
|
9592
9082
|
return;
|
|
9593
9083
|
}
|
|
9594
9084
|
try {
|
|
9595
|
-
var uploadPhoto = new File([selfiePhoto], this.flow.
|
|
9596
|
-
await this.
|
|
9085
|
+
var uploadPhoto = new File([selfiePhoto], this.flow.capture.fileName, { type: 'image/png' });
|
|
9086
|
+
let photoUploaded = await this.baseComponent.apiCall.UploadFileForRequestB64(TranslationUtils.state.requestId, this.flow.capture.photoType, uploadPhoto);
|
|
9087
|
+
if (!photoUploaded) {
|
|
9088
|
+
this.triggerErrorFlow();
|
|
9089
|
+
}
|
|
9597
9090
|
}
|
|
9598
9091
|
catch (e) {
|
|
9599
9092
|
this.apiErrorEvent.emit(e);
|
|
@@ -9613,18 +9106,11 @@ const UserLiveness = class {
|
|
|
9613
9106
|
}
|
|
9614
9107
|
let mimeType = selfieRecording.type == Stream.mp4MimeType.type ? Stream.mp4MimeType : Stream.webmMimeType;
|
|
9615
9108
|
try {
|
|
9616
|
-
|
|
9617
|
-
|
|
9618
|
-
|
|
9619
|
-
}
|
|
9620
|
-
else if (this.captureStep == SelfieFlowStatus.Gesture) {
|
|
9621
|
-
let uploadRec = new File([selfieRecording], this.flow.tilt.recName + mimeType.extension, { type: mimeType.type });
|
|
9622
|
-
this.flow.tilt.recordingDone = await this.uploadRecording(uploadRec, this.flow.tilt.recType);
|
|
9623
|
-
}
|
|
9624
|
-
else {
|
|
9109
|
+
let uploadRec = new File([selfieRecording], this.flow.capture.recName + mimeType.extension, { type: mimeType.type });
|
|
9110
|
+
let uplodDone = await this.baseComponent.apiCall.UploadFileForRequestB64(TranslationUtils.state.requestId, this.flow.capture.recType, uploadRec);
|
|
9111
|
+
if (!uplodDone) {
|
|
9625
9112
|
this.triggerErrorFlow();
|
|
9626
9113
|
}
|
|
9627
|
-
this.endFlow();
|
|
9628
9114
|
}
|
|
9629
9115
|
catch (e) {
|
|
9630
9116
|
if (this.recordingRetryCount < 3) {
|
|
@@ -9636,82 +9122,25 @@ const UserLiveness = class {
|
|
|
9636
9122
|
}
|
|
9637
9123
|
}
|
|
9638
9124
|
}
|
|
9639
|
-
async verificationFinished(_event) {
|
|
9640
|
-
this.endFlow();
|
|
9641
|
-
}
|
|
9642
9125
|
async disconnectedCallback() {
|
|
9643
9126
|
await this.baseComponent.finalize();
|
|
9644
9127
|
}
|
|
9645
|
-
async uploadPhoto(photoFile, photoType) {
|
|
9646
|
-
if (this.flow.front.photoDone) {
|
|
9647
|
-
return;
|
|
9648
|
-
}
|
|
9649
|
-
this.flow.front.photoDone = await this.baseComponent.apiCall.UploadFileForRequestB64(TranslationUtils.state.requestId, photoType, photoFile);
|
|
9650
|
-
if (this.flow.front.photoDone) {
|
|
9651
|
-
this.endFlow();
|
|
9652
|
-
}
|
|
9653
|
-
else {
|
|
9654
|
-
this.triggerErrorFlow();
|
|
9655
|
-
}
|
|
9656
|
-
}
|
|
9657
|
-
async uploadRecording(uploadRec, recType) {
|
|
9658
|
-
let uplodDone = await this.baseComponent.apiCall.UploadFileForRequestB64(TranslationUtils.state.requestId, recType, uploadRec);
|
|
9659
|
-
if (uplodDone) {
|
|
9660
|
-
return true;
|
|
9661
|
-
}
|
|
9662
|
-
else {
|
|
9663
|
-
this.triggerErrorFlow();
|
|
9664
|
-
}
|
|
9665
|
-
return false;
|
|
9666
|
-
}
|
|
9667
9128
|
triggerErrorFlow() {
|
|
9668
9129
|
this.showError = true;
|
|
9669
9130
|
}
|
|
9670
|
-
endFlow() {
|
|
9671
|
-
if (this.captureStep == SelfieFlowStatus.Selfie) {
|
|
9672
|
-
if (this.flow.front.photoDone && this.flow.front.recordingDone) {
|
|
9673
|
-
if (TranslationUtils.state.hasSelfieGesture) {
|
|
9674
|
-
this.captureStep = SelfieFlowStatus.Gesture;
|
|
9675
|
-
}
|
|
9676
|
-
else {
|
|
9677
|
-
this.captureStep = SelfieFlowStatus.End;
|
|
9678
|
-
}
|
|
9679
|
-
}
|
|
9680
|
-
else {
|
|
9681
|
-
return;
|
|
9682
|
-
}
|
|
9683
|
-
}
|
|
9684
|
-
if (this.captureStep == SelfieFlowStatus.Gesture) {
|
|
9685
|
-
if (this.flow.tilt.photoDone && this.flow.tilt.recordingDone) {
|
|
9686
|
-
this.captureStep = SelfieFlowStatus.End;
|
|
9687
|
-
}
|
|
9688
|
-
else {
|
|
9689
|
-
return;
|
|
9690
|
-
}
|
|
9691
|
-
}
|
|
9692
|
-
if (this.captureStep != SelfieFlowStatus.End) {
|
|
9693
|
-
return;
|
|
9694
|
-
}
|
|
9695
|
-
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus.COMPLETE;
|
|
9696
|
-
}
|
|
9697
9131
|
render() {
|
|
9698
|
-
let howTo = index.h("how-to-info",
|
|
9699
|
-
let capture = index.h("selfie-capture",
|
|
9700
|
-
let tilt = index.h("selfie-tilt", { id: "camera" });
|
|
9132
|
+
let howTo = index.h("how-to-info", null);
|
|
9133
|
+
let capture = index.h("selfie-capture", null);
|
|
9701
9134
|
let error = index.h("capture-error", { type: "LIVENESS" });
|
|
9702
9135
|
if (this.showError) {
|
|
9703
9136
|
return error;
|
|
9704
9137
|
}
|
|
9705
|
-
if (this.
|
|
9706
|
-
return howTo;
|
|
9707
|
-
}
|
|
9708
|
-
if (this.captureStep == SelfieFlowStatus.Selfie) {
|
|
9138
|
+
if (this.howToDone) {
|
|
9709
9139
|
return capture;
|
|
9710
9140
|
}
|
|
9711
|
-
|
|
9712
|
-
return
|
|
9141
|
+
else {
|
|
9142
|
+
return howTo;
|
|
9713
9143
|
}
|
|
9714
|
-
return index.h("div", null);
|
|
9715
9144
|
}
|
|
9716
9145
|
};
|
|
9717
9146
|
UserLiveness.style = userLivenessCss;
|
|
@@ -9724,14 +9153,12 @@ exports.capture_error = CaptureError;
|
|
|
9724
9153
|
exports.end_redirect = EndRedirect;
|
|
9725
9154
|
exports.error_end = ErrorEnd;
|
|
9726
9155
|
exports.how_to_info = HowToInfo;
|
|
9727
|
-
exports.id_back_capture = IdBackCapture;
|
|
9728
9156
|
exports.id_capture = IdCapture;
|
|
9729
|
-
exports.id_tilt = IdTilt;
|
|
9730
9157
|
exports.identification_component = IdentificationComponent;
|
|
9731
9158
|
exports.landing_validation = LandingValidation;
|
|
9732
9159
|
exports.mobile_redirect = MobileRedirect;
|
|
9733
9160
|
exports.process_id = ProcessId;
|
|
9734
9161
|
exports.selfie_capture = SelfieCapture;
|
|
9735
|
-
exports.selfie_tilt = SelfieTilt;
|
|
9736
9162
|
exports.sms_code_validation = SmsCodeValidation;
|
|
9163
|
+
exports.sms_send = SmsSend;
|
|
9737
9164
|
exports.user_liveness = UserLiveness;
|