@ekyc_qoobiss/qbs-ect-cmp 3.6.39 → 3.6.41
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} +245 -882
- 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 -62
- 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 +45 -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/Stream.js +1 -47
- 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} +245 -880
- 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-4e3b735b.entry.js → p-b3fa0a37.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/controls/camera/camera.d.ts +0 -7
- 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 +2 -6
- package/dist/types/components/identification-component/identification-component.d.ts +1 -2
- package/dist/types/components.d.ts +18 -65
- package/dist/types/helpers/ApiCall.d.ts +9 -3
- package/dist/types/helpers/Stream.d.ts +0 -11
- 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
|
|
@@ -4520,24 +4520,12 @@ class Stream {
|
|
|
4520
4520
|
this.idDetection = val;
|
|
4521
4521
|
this.faceDetection = !val;
|
|
4522
4522
|
}
|
|
4523
|
-
// public setProbabilityThreshold(val: number): void {
|
|
4524
|
-
// Detector.getInstance().setProbabilityThreshold(val);
|
|
4525
|
-
// }
|
|
4526
|
-
setCallbackChangeTitle(fun) {
|
|
4527
|
-
this.callbackChangeTitle = fun;
|
|
4528
|
-
}
|
|
4529
4523
|
setCallbackVideoStarted(fun) {
|
|
4530
4524
|
this.callbackVideoStarted = fun;
|
|
4531
4525
|
}
|
|
4532
|
-
setCallbackErrors(fun) {
|
|
4533
|
-
this.callbackErrors = fun;
|
|
4534
|
-
}
|
|
4535
4526
|
setCallbackAutoCapturing(fun) {
|
|
4536
4527
|
this.callbackAutoCapturing = fun;
|
|
4537
4528
|
}
|
|
4538
|
-
// public setCallbackFaceDetectionErrors(fun: (e: PipelineResult) => void): void {
|
|
4539
|
-
// this.callbackFaceDetectionErrors = fun;
|
|
4540
|
-
// }
|
|
4541
4529
|
setCallbackRecordingReady(fun) {
|
|
4542
4530
|
this.callbackRecordingReady = fun;
|
|
4543
4531
|
}
|
|
@@ -4551,13 +4539,6 @@ class Stream {
|
|
|
4551
4539
|
this.streamPaused = false;
|
|
4552
4540
|
this.recordedChunks = [];
|
|
4553
4541
|
this.videoSize = { width: 0, height: 0 };
|
|
4554
|
-
this.pauseStream = () => {
|
|
4555
|
-
this.streamPaused = true;
|
|
4556
|
-
this.mediaRecorder.pause();
|
|
4557
|
-
this.videoElement.pause();
|
|
4558
|
-
// this.dropMask();
|
|
4559
|
-
// if (this.faceDetection) Detector.getInstance().stopDetector();
|
|
4560
|
-
};
|
|
4561
4542
|
this.initFacePose();
|
|
4562
4543
|
this.idML5Detector = IDML5Detector.getInstance(this, TranslationUtils.state.device.isMobile);
|
|
4563
4544
|
this.faceML5Detector = FaceML5Detector.getInstance(this, TranslationUtils.state.device.isMobile);
|
|
@@ -4569,9 +4550,6 @@ class Stream {
|
|
|
4569
4550
|
}
|
|
4570
4551
|
return Stream.instance;
|
|
4571
4552
|
}
|
|
4572
|
-
// public returnErrors(errors: PipelineResult) {
|
|
4573
|
-
// this.callbackFaceDetectionErrors(errors);
|
|
4574
|
-
// }
|
|
4575
4553
|
autoCapturing() {
|
|
4576
4554
|
this.callbackAutoCapturing();
|
|
4577
4555
|
}
|
|
@@ -4587,7 +4565,6 @@ class Stream {
|
|
|
4587
4565
|
this.idML5Detector.updateHtmlElements(this.videoElement, this.canvasElement, component);
|
|
4588
4566
|
this.faceML5Detector.updateHtmlElements(this.videoElement, this.canvasElement, component);
|
|
4589
4567
|
}
|
|
4590
|
-
static orientationChange() { }
|
|
4591
4568
|
startStream(stream) {
|
|
4592
4569
|
if (this.stream)
|
|
4593
4570
|
this.stream.getTracks().forEach((track) => track.stop());
|
|
@@ -4619,13 +4596,6 @@ class Stream {
|
|
|
4619
4596
|
this.startStream(stream);
|
|
4620
4597
|
this.recordStream();
|
|
4621
4598
|
}
|
|
4622
|
-
async resumeStream() {
|
|
4623
|
-
this.streamPaused = false;
|
|
4624
|
-
this.mediaRecorder.resume();
|
|
4625
|
-
await this.videoElement.play();
|
|
4626
|
-
// this.drawMask();
|
|
4627
|
-
// if (this.faceDetection) await Detector.getInstance().startDetector();
|
|
4628
|
-
}
|
|
4629
4599
|
recordStream() {
|
|
4630
4600
|
if (this.mediaRecorder && this.mediaRecorder.state == 'recording')
|
|
4631
4601
|
return;
|
|
@@ -4665,7 +4635,6 @@ class Stream {
|
|
|
4665
4635
|
if (this.mediaRecorder && this.mediaRecorder.state != 'inactive') {
|
|
4666
4636
|
this.mediaRecorder.stop();
|
|
4667
4637
|
}
|
|
4668
|
-
// if (this.faceDetection) Detector.getInstance().stopDetector();
|
|
4669
4638
|
}
|
|
4670
4639
|
streamStopped() {
|
|
4671
4640
|
return !(this.stream && this.stream.getTracks && this.stream.getTracks().length > 0);
|
|
@@ -4688,15 +4657,13 @@ class Stream {
|
|
|
4688
4657
|
}
|
|
4689
4658
|
catch (e) {
|
|
4690
4659
|
resolve(frame);
|
|
4691
|
-
this.
|
|
4660
|
+
this.timeElapsed();
|
|
4692
4661
|
}
|
|
4693
4662
|
}
|
|
4694
4663
|
else {
|
|
4695
4664
|
resolve(frame);
|
|
4696
4665
|
}
|
|
4697
4666
|
}, ImageFormat.PNG, 1);
|
|
4698
|
-
//let outCanvContext = this.canvasElement.getContext('2d');
|
|
4699
|
-
//outCanvContext.drawImage(this.videoElement, 0, 0, this.canvasElement.width, this.canvasElement.height);
|
|
4700
4667
|
});
|
|
4701
4668
|
}
|
|
4702
4669
|
async startIdDetection() {
|
|
@@ -4712,22 +4679,9 @@ class Stream {
|
|
|
4712
4679
|
initFacePose() {
|
|
4713
4680
|
this.facePose = FacePosePick.randomEnum(FacePose);
|
|
4714
4681
|
}
|
|
4715
|
-
requestFacePose() {
|
|
4716
|
-
// var pose = FacePose.TiltLeft;
|
|
4717
|
-
this.callbackChangeTitle(this.facePose);
|
|
4718
|
-
return this.facePose;
|
|
4719
|
-
}
|
|
4720
|
-
changeFacePose() {
|
|
4721
|
-
this.callbackChangeTitle(null);
|
|
4722
|
-
}
|
|
4723
|
-
changeIDPose(pose) {
|
|
4724
|
-
this.callbackChangeTitle(pose);
|
|
4725
|
-
}
|
|
4726
4682
|
}
|
|
4727
4683
|
Stream.mp4MimeType = { type: 'video/mp4', codec: 'codecs:h264', extension: 'mp4', mime: 'video/mp4;codecs:h264' };
|
|
4728
|
-
Stream.webmMimeType = { type: 'video/webm', codec: 'codecs=vp8', extension: 'webm', mime: 'video/webm;codecs=vp8' };
|
|
4729
|
-
window.addEventListener('resize', Stream.orientationChange, false);
|
|
4730
|
-
window.addEventListener('orientationchange', Stream.orientationChange, false);
|
|
4684
|
+
Stream.webmMimeType = { type: 'video/webm', codec: 'codecs=vp8', extension: 'webm', mime: 'video/webm;codecs=vp8' };
|
|
4731
4685
|
|
|
4732
4686
|
const cameraCss = ".camera{width:100%;height:100%;color:white;display:flex;align-items:center;justify-content:center;position:relative}.cameraCanvas,.cameraCanvasSelfie,.cameraCanvasSelfieDesk{z-index:3;max-width:100%;max-height:100%;border-radius:10px}.cameraCanvasSelfie,.cameraCanvasSelfieDesk{transform:scale(-1, 1);-webkit-transform:scale(-1, 1)}.cameraVideo,.cameraVideoSelfie,.cameraVideoSelfieDesk{z-index:2;position:absolute;max-width:100%;max-height:100%;border-radius:10px}.cameraVideoSelfie,.cameraVideoSelfieDesk{transform:scale(-1, 1);-webkit-transform:scale(-1, 1)}.cameraMobile{position:fixed;top:0;left:0;background:black}";
|
|
4733
4687
|
|
|
@@ -4735,23 +4689,11 @@ const Camera = class {
|
|
|
4735
4689
|
constructor(hostRef) {
|
|
4736
4690
|
index.registerInstance(this, hostRef);
|
|
4737
4691
|
this.eventVideoStarted = index.createEvent(this, "videoStarted", 7);
|
|
4738
|
-
this.eventCloseCamera = index.createEvent(this, "closeCamera", 7);
|
|
4739
|
-
this.errorCameraEvent = index.createEvent(this, "errorCamera", 7);
|
|
4740
4692
|
this.eventTakePhoto = index.createEvent(this, "takePhoto", 7);
|
|
4741
4693
|
this.eventRecordingSelfieReady = index.createEvent(this, "recordingSelfieCapture", 7);
|
|
4742
4694
|
this.eventRecordingIdReady = index.createEvent(this, "recordingIdCapture", 7);
|
|
4743
4695
|
this.eventTimeElapsed = index.createEvent(this, "timeElapsed", 7);
|
|
4744
|
-
this.eventChangeTitle = index.createEvent(this, "changeTitle", 7);
|
|
4745
4696
|
this.verificationFinished = index.createEvent(this, "verificationFinished", 7);
|
|
4746
|
-
this.callbackErrors = (error, isError) => {
|
|
4747
|
-
if (isError) {
|
|
4748
|
-
this.errorCameraEvent.emit(error);
|
|
4749
|
-
this.eventCloseCamera.emit();
|
|
4750
|
-
}
|
|
4751
|
-
else {
|
|
4752
|
-
this.errorCameraEvent.emit(error);
|
|
4753
|
-
}
|
|
4754
|
-
};
|
|
4755
4697
|
this.callbackAutoCapturing = () => {
|
|
4756
4698
|
this.eventTakePhoto.emit();
|
|
4757
4699
|
};
|
|
@@ -4767,9 +4709,6 @@ const Camera = class {
|
|
|
4767
4709
|
this.callbackTimeElapsed = () => {
|
|
4768
4710
|
this.eventTimeElapsed.emit();
|
|
4769
4711
|
};
|
|
4770
|
-
this.callbackChangeTitle = (message) => {
|
|
4771
|
-
this.eventChangeTitle.emit(message);
|
|
4772
|
-
};
|
|
4773
4712
|
this.callbackVideoStarted = () => {
|
|
4774
4713
|
this.eventVideoStarted.emit(this.component.getBoundingClientRect());
|
|
4775
4714
|
};
|
|
@@ -4797,8 +4736,7 @@ const Camera = class {
|
|
|
4797
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) })));
|
|
4798
4737
|
}
|
|
4799
4738
|
startStream() {
|
|
4800
|
-
|
|
4801
|
-
const stream = Stream.getNewInstance(captureMode);
|
|
4739
|
+
const stream = Stream.instance;
|
|
4802
4740
|
stream.updateHtmlElements(this.cameraVideo, this.cameraCanvas, this.component);
|
|
4803
4741
|
if (this.captureMode == 'selfie') {
|
|
4804
4742
|
stream.setFaceDetection(true);
|
|
@@ -4812,9 +4750,7 @@ const Camera = class {
|
|
|
4812
4750
|
stream.setCallbackRecordingReady(this.callbackIdRecordingReady);
|
|
4813
4751
|
// stream.setShowMask(false);
|
|
4814
4752
|
}
|
|
4815
|
-
stream.setCallbackErrors(this.callbackErrors);
|
|
4816
4753
|
stream.setCallbackAutoCapturing(this.callbackAutoCapturing);
|
|
4817
|
-
stream.setCallbackChangeTitle(this.callbackChangeTitle);
|
|
4818
4754
|
stream.setCallbackVideoStarted(this.callbackVideoStarted);
|
|
4819
4755
|
stream.setCallbackTimeElapsed(this.callbackTimeElapsed);
|
|
4820
4756
|
stream.setVerificationFinished(this.callbackVerificationFinished);
|
|
@@ -4963,7 +4899,7 @@ ErrorEnd.style = errorEndCss;
|
|
|
4963
4899
|
const howToInfoCss = "";
|
|
4964
4900
|
|
|
4965
4901
|
const HowToInfo = class {
|
|
4966
|
-
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; }
|
|
4967
4903
|
async componentDidLoad() {
|
|
4968
4904
|
await this.baseComponent.initialize();
|
|
4969
4905
|
}
|
|
@@ -4978,18 +4914,16 @@ const HowToInfo = class {
|
|
|
4978
4914
|
this.translations = await TranslationUtils.Translations.getValues();
|
|
4979
4915
|
this.subTitle = '';
|
|
4980
4916
|
this.buttonEnabled = true;
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
this.subTitle = this.translations.HowToValues.IdSubTitileBack;
|
|
4992
|
-
}
|
|
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;
|
|
4993
4927
|
}
|
|
4994
4928
|
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.LIVENESS) {
|
|
4995
4929
|
this.baseComponent = new BaseComponent(TranslationUtils.FlowSteps.SelfieHowTo);
|
|
@@ -5144,128 +5078,6 @@ var IDPose;
|
|
|
5144
5078
|
IDPose[IDPose["BackTilted"] = 4] = "BackTilted";
|
|
5145
5079
|
})(IDPose || (IDPose = {}));
|
|
5146
5080
|
|
|
5147
|
-
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)}";
|
|
5148
|
-
|
|
5149
|
-
const IdBackCapture = class {
|
|
5150
|
-
// @State() private animationPath: string;
|
|
5151
|
-
constructor(hostRef) {
|
|
5152
|
-
index.registerInstance(this, hostRef);
|
|
5153
|
-
this.eventPhotoCapture = index.createEvent(this, "photoIdBackCapture", 7);
|
|
5154
|
-
this.apiErrorEvent = index.createEvent(this, "apiError", 7);
|
|
5155
|
-
this.eventTimeElapsed = index.createEvent(this, "timeElapsed", 7);
|
|
5156
|
-
this.photoIsReady = photos => {
|
|
5157
|
-
//this.closeCamera();
|
|
5158
|
-
this.eventPhotoCapture.emit(photos);
|
|
5159
|
-
};
|
|
5160
|
-
this.videoStarted = undefined;
|
|
5161
|
-
this.cameraSize = undefined;
|
|
5162
|
-
this.captureTaken = undefined;
|
|
5163
|
-
this.verified = undefined;
|
|
5164
|
-
this.titleMesage = undefined;
|
|
5165
|
-
this.showDemo = undefined;
|
|
5166
|
-
this.demoVideo = undefined;
|
|
5167
|
-
this.captureTaken = false;
|
|
5168
|
-
this.verified = false;
|
|
5169
|
-
this.cameras = new Cameras();
|
|
5170
|
-
this.showDemo = true;
|
|
5171
|
-
this.baseComponent = new BaseComponent(TranslationUtils.FlowSteps.CiBackCapture);
|
|
5172
|
-
}
|
|
5173
|
-
eventVideoStarted(event) {
|
|
5174
|
-
this.videoStarted = true;
|
|
5175
|
-
this.cameraSize = event.detail;
|
|
5176
|
-
}
|
|
5177
|
-
async componentWillLoad() {
|
|
5178
|
-
this.translations = await TranslationUtils.Translations.getValues();
|
|
5179
|
-
//this.videoDemoStyle = this.device.isMobile ? { width: window.screen.width + 'px', height: window.screen.height + 'px', 'object-fit': 'fill' } : {};
|
|
5180
|
-
if (!navigator.mediaDevices) {
|
|
5181
|
-
this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
|
|
5182
|
-
}
|
|
5183
|
-
}
|
|
5184
|
-
async componentDidLoad() {
|
|
5185
|
-
await this.baseComponent.logStep(TranslationUtils.FlowSteps.CiBackCapture, TranslationUtils.FlowMoments.Initialized);
|
|
5186
|
-
this.titleMesage = this.translations.IdCaptureValues.TtileRotate;
|
|
5187
|
-
this.demoVideo.src = TranslationUtils.IdCaptureValues.IDPoseDemoMapping[IDPose.Rotate];
|
|
5188
|
-
this.demoVideo.play();
|
|
5189
|
-
await delay(this.translations.GlobalValues.VideoLenght);
|
|
5190
|
-
this.titleMesage = this.translations.IdCaptureValues.TitleBack;
|
|
5191
|
-
this.demoVideo.src = TranslationUtils.IdCaptureValues.IDPoseDemoMapping[IDPose.BackStraight];
|
|
5192
|
-
this.demoVideo.play();
|
|
5193
|
-
await delay(this.translations.GlobalValues.VideoLenght);
|
|
5194
|
-
this.showDemo = false;
|
|
5195
|
-
this.openCamera();
|
|
5196
|
-
}
|
|
5197
|
-
async openCamera() {
|
|
5198
|
-
const constraints = this.cameras.GetConstraints(TranslationUtils.state.cameraId, TranslationUtils.state.device);
|
|
5199
|
-
setTimeout(() => {
|
|
5200
|
-
navigator.mediaDevices
|
|
5201
|
-
.getUserMedia(constraints)
|
|
5202
|
-
.then(stream => {
|
|
5203
|
-
const superStream = Stream.getNewInstance(VerificationMode.Full);
|
|
5204
|
-
superStream.initStream(stream);
|
|
5205
|
-
})
|
|
5206
|
-
.catch(e => {
|
|
5207
|
-
this.closeCamera();
|
|
5208
|
-
this.apiErrorEvent.emit(e);
|
|
5209
|
-
});
|
|
5210
|
-
}, 100);
|
|
5211
|
-
}
|
|
5212
|
-
closeCamera() {
|
|
5213
|
-
if (Stream.instance) {
|
|
5214
|
-
Stream.instance.dropStream();
|
|
5215
|
-
}
|
|
5216
|
-
}
|
|
5217
|
-
disconnectedCallback() {
|
|
5218
|
-
this.closeCamera();
|
|
5219
|
-
Stream.instance = null;
|
|
5220
|
-
IDML5Detector.instance = null;
|
|
5221
|
-
FaceML5Detector.instance = null;
|
|
5222
|
-
}
|
|
5223
|
-
async verificationFinished() {
|
|
5224
|
-
if (this.verified)
|
|
5225
|
-
return;
|
|
5226
|
-
this.verified = true;
|
|
5227
|
-
this.titleMesage = this.translations.IdCaptureValues.Loading;
|
|
5228
|
-
this.closeCamera();
|
|
5229
|
-
this.showDemo = true;
|
|
5230
|
-
var loops = 0;
|
|
5231
|
-
this.demoVideo.src = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_id.mp4';
|
|
5232
|
-
this.demoVideo.loop = false;
|
|
5233
|
-
while (loops < 7) {
|
|
5234
|
-
loops++;
|
|
5235
|
-
this.demoVideo.play();
|
|
5236
|
-
await delay(this.translations.GlobalValues.VideoLenght);
|
|
5237
|
-
}
|
|
5238
|
-
this.eventTimeElapsed.emit();
|
|
5239
|
-
}
|
|
5240
|
-
async takePhoto() {
|
|
5241
|
-
if (this.captureTaken)
|
|
5242
|
-
return;
|
|
5243
|
-
this.captureTaken = true;
|
|
5244
|
-
if (Stream.instance) {
|
|
5245
|
-
let res = await Stream.instance.takePhoto();
|
|
5246
|
-
this.photoIsReady(res);
|
|
5247
|
-
}
|
|
5248
|
-
else {
|
|
5249
|
-
this.eventTimeElapsed.emit();
|
|
5250
|
-
}
|
|
5251
|
-
await this.baseComponent.logStep(TranslationUtils.FlowSteps.CiBackCapture, TranslationUtils.FlowMoments.Finalized);
|
|
5252
|
-
}
|
|
5253
|
-
render() {
|
|
5254
|
-
let cameraStyle;
|
|
5255
|
-
let cameraStyleInner;
|
|
5256
|
-
if (this.videoStarted) {
|
|
5257
|
-
cameraStyle = { width: Math.round(this.cameraSize.width) + 'px', height: Math.round((this.cameraSize.width * 9) / 16) + 'px', overflow: 'hidden', borderRadius: '10px' };
|
|
5258
|
-
cameraStyleInner = { marginTop: Math.round((this.cameraSize.height - (this.cameraSize.width * 9) / 16) / 2) * -1 + 'px' };
|
|
5259
|
-
}
|
|
5260
|
-
let titleClass = this.verified ? 'color-black-2 text-center' : 'color-white text-center';
|
|
5261
|
-
//let videoClass = this.device.isMobile ? '' : 'video-demo';
|
|
5262
|
-
let bgDemo = this.verified ? 'container' : 'container bg-black';
|
|
5263
|
-
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)))));
|
|
5264
|
-
}
|
|
5265
|
-
get component() { return index.getElement(this); }
|
|
5266
|
-
};
|
|
5267
|
-
IdBackCapture.style = idBackCaptureCss;
|
|
5268
|
-
|
|
5269
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)}";
|
|
5270
5082
|
|
|
5271
5083
|
const IdCapture = class {
|
|
@@ -5275,8 +5087,7 @@ const IdCapture = class {
|
|
|
5275
5087
|
this.eventPhotoCapture = index.createEvent(this, "photoIdCapture", 7);
|
|
5276
5088
|
this.apiErrorEvent = index.createEvent(this, "apiError", 7);
|
|
5277
5089
|
this.eventTimeElapsed = index.createEvent(this, "timeElapsed", 7);
|
|
5278
|
-
this.photoIsReady = photos => {
|
|
5279
|
-
//this.closeCamera();
|
|
5090
|
+
this.photoIsReady = (photos) => {
|
|
5280
5091
|
this.eventPhotoCapture.emit(photos);
|
|
5281
5092
|
};
|
|
5282
5093
|
this.videoStarted = undefined;
|
|
@@ -5290,7 +5101,6 @@ const IdCapture = class {
|
|
|
5290
5101
|
this.verified = false;
|
|
5291
5102
|
this.cameras = new Cameras();
|
|
5292
5103
|
this.showDemo = true;
|
|
5293
|
-
this.baseComponent = new BaseComponent(TranslationUtils.FlowSteps.CiFrontCapture);
|
|
5294
5104
|
}
|
|
5295
5105
|
eventVideoStarted(event) {
|
|
5296
5106
|
this.videoStarted = true;
|
|
@@ -5298,138 +5108,41 @@ const IdCapture = class {
|
|
|
5298
5108
|
}
|
|
5299
5109
|
async componentWillLoad() {
|
|
5300
5110
|
this.translations = await TranslationUtils.Translations.getValues();
|
|
5301
|
-
this.titleMesage = this.translations.IdCaptureValues.Title;
|
|
5302
|
-
//this.videoDemoStyle = this.device.isMobile ? { 'width': window.screen.width + 'px', 'height': window.screen.height + 'px', 'object-fit': 'fill' } : {};
|
|
5303
5111
|
if (!navigator.mediaDevices) {
|
|
5304
5112
|
this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
|
|
5305
5113
|
}
|
|
5114
|
+
this.baseComponent = new BaseComponent(this.flowStep);
|
|
5306
5115
|
}
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
this.openCamera();
|
|
5314
|
-
}
|
|
5315
|
-
async openCamera() {
|
|
5316
|
-
const constraints = this.cameras.GetConstraints(TranslationUtils.state.cameraId, TranslationUtils.state.device);
|
|
5317
|
-
setTimeout(() => {
|
|
5318
|
-
navigator.mediaDevices
|
|
5319
|
-
.getUserMedia(constraints)
|
|
5320
|
-
.then(stream => {
|
|
5321
|
-
const superStream = Stream.getNewInstance(VerificationMode.Full);
|
|
5322
|
-
superStream.initStream(stream);
|
|
5323
|
-
})
|
|
5324
|
-
.catch(e => {
|
|
5325
|
-
this.closeCamera();
|
|
5326
|
-
this.apiErrorEvent.emit(e);
|
|
5327
|
-
});
|
|
5328
|
-
}, 100);
|
|
5329
|
-
}
|
|
5330
|
-
closeCamera() {
|
|
5331
|
-
if (Stream.instance) {
|
|
5332
|
-
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;
|
|
5333
5122
|
}
|
|
5334
|
-
|
|
5335
|
-
|
|
5336
|
-
|
|
5337
|
-
|
|
5338
|
-
|
|
5339
|
-
FaceML5Detector.instance = null;
|
|
5340
|
-
}
|
|
5341
|
-
async takePhoto() {
|
|
5342
|
-
if (this.captureTaken)
|
|
5343
|
-
return;
|
|
5344
|
-
this.captureTaken = true;
|
|
5345
|
-
if (Stream.instance) {
|
|
5346
|
-
let res = await Stream.instance.takePhoto();
|
|
5347
|
-
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;
|
|
5348
5128
|
}
|
|
5349
|
-
else {
|
|
5350
|
-
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;
|
|
5351
5134
|
}
|
|
5352
|
-
await this.baseComponent.logStep(TranslationUtils.FlowSteps.CiFrontCapture, TranslationUtils.FlowMoments.Finalized);
|
|
5353
5135
|
}
|
|
5354
|
-
async
|
|
5355
|
-
|
|
5356
|
-
|
|
5357
|
-
|
|
5358
|
-
|
|
5359
|
-
this.closeCamera();
|
|
5360
|
-
this.showDemo = true;
|
|
5361
|
-
var loops = 0;
|
|
5362
|
-
this.demoVideo.src = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_id.mp4';
|
|
5363
|
-
this.demoVideo.loop = false;
|
|
5364
|
-
while (loops < 7) {
|
|
5365
|
-
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];
|
|
5366
5141
|
this.demoVideo.play();
|
|
5367
5142
|
await delay(this.translations.GlobalValues.VideoLenght);
|
|
5143
|
+
this.titleMesage = this.translations.IdCaptureValues.TitleBack;
|
|
5368
5144
|
}
|
|
5369
|
-
this.
|
|
5370
|
-
}
|
|
5371
|
-
render() {
|
|
5372
|
-
let cameraStyle;
|
|
5373
|
-
let cameraStyleInner;
|
|
5374
|
-
if (this.videoStarted) {
|
|
5375
|
-
cameraStyle = {
|
|
5376
|
-
width: Math.round(this.cameraSize.width) + 'px',
|
|
5377
|
-
height: Math.round((this.cameraSize.width * 9) / 16) + 'px',
|
|
5378
|
-
overflow: 'hidden',
|
|
5379
|
-
borderRadius: '10px',
|
|
5380
|
-
};
|
|
5381
|
-
cameraStyleInner = { marginTop: Math.round((this.cameraSize.height - (this.cameraSize.width * 9) / 16) / 2) * -1 + 'px' };
|
|
5382
|
-
}
|
|
5383
|
-
let titleClass = this.verified ? 'color-black-2 text-center' : 'color-white text-center';
|
|
5384
|
-
//let videoClass = this.device.isMobile ? '' : 'video-demo';
|
|
5385
|
-
let bgDemo = this.verified ? 'container' : 'container bg-black';
|
|
5386
|
-
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)))));
|
|
5387
|
-
}
|
|
5388
|
-
get component() { return index.getElement(this); }
|
|
5389
|
-
};
|
|
5390
|
-
IdCapture.style = idCaptureCss;
|
|
5391
|
-
|
|
5392
|
-
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)}";
|
|
5393
|
-
|
|
5394
|
-
const IdTilt = class {
|
|
5395
|
-
// @State() private animationPath: string;
|
|
5396
|
-
constructor(hostRef) {
|
|
5397
|
-
index.registerInstance(this, hostRef);
|
|
5398
|
-
this.eventPhotoCapture = index.createEvent(this, "photoTiltCapture", 7);
|
|
5399
|
-
this.apiErrorEvent = index.createEvent(this, "apiError", 7);
|
|
5400
|
-
this.eventTimeElapsed = index.createEvent(this, "timeElapsed", 7);
|
|
5401
|
-
this.photoIsReady = photos => {
|
|
5402
|
-
//this.closeCamera();
|
|
5403
|
-
this.eventPhotoCapture.emit(photos);
|
|
5404
|
-
};
|
|
5405
|
-
this.videoStarted = undefined;
|
|
5406
|
-
this.cameraSize = undefined;
|
|
5407
|
-
this.captureTaken = undefined;
|
|
5408
|
-
this.verified = undefined;
|
|
5409
|
-
this.titleMesage = undefined;
|
|
5410
|
-
this.showDemo = undefined;
|
|
5411
|
-
this.demoVideo = undefined;
|
|
5412
|
-
this.captureTaken = false;
|
|
5413
|
-
this.verified = false;
|
|
5414
|
-
this.cameras = new Cameras();
|
|
5415
|
-
this.showDemo = true;
|
|
5416
|
-
this.baseComponent = new BaseComponent(TranslationUtils.FlowSteps.CiTilt);
|
|
5417
|
-
}
|
|
5418
|
-
eventVideoStarted(event) {
|
|
5419
|
-
this.videoStarted = true;
|
|
5420
|
-
this.cameraSize = event.detail;
|
|
5421
|
-
}
|
|
5422
|
-
async componentWillLoad() {
|
|
5423
|
-
this.translations = await TranslationUtils.Translations.getValues();
|
|
5424
|
-
this.titleMesage = this.translations.IdCaptureValues.IDPoseMapping;
|
|
5425
|
-
//this.videoDemoStyle = this.device.isMobile ? { 'width': window.screen.width + 'px', 'height': window.screen.height + 'px', 'object-fit': 'fill' } : {};
|
|
5426
|
-
if (!navigator.mediaDevices) {
|
|
5427
|
-
this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
|
|
5428
|
-
}
|
|
5429
|
-
}
|
|
5430
|
-
async componentDidLoad() {
|
|
5431
|
-
await this.baseComponent.logStep(TranslationUtils.FlowSteps.CiTilt, TranslationUtils.FlowMoments.Initialized);
|
|
5432
|
-
this.demoVideo.src = TranslationUtils.IdCaptureValues.IDPoseDemoMapping[IDPose.Tilted];
|
|
5145
|
+
this.demoVideo.src = TranslationUtils.IdCaptureValues.IDPoseDemoMapping[this.pose];
|
|
5433
5146
|
this.demoVideo.play();
|
|
5434
5147
|
await delay(this.translations.GlobalValues.VideoLenght);
|
|
5435
5148
|
this.showDemo = false;
|
|
@@ -5441,7 +5154,7 @@ const IdTilt = class {
|
|
|
5441
5154
|
navigator.mediaDevices
|
|
5442
5155
|
.getUserMedia(constraints)
|
|
5443
5156
|
.then(stream => {
|
|
5444
|
-
const superStream = Stream.getNewInstance(
|
|
5157
|
+
const superStream = Stream.getNewInstance(this.verificationMode);
|
|
5445
5158
|
superStream.initStream(stream);
|
|
5446
5159
|
})
|
|
5447
5160
|
.catch(e => {
|
|
@@ -5472,7 +5185,7 @@ const IdTilt = class {
|
|
|
5472
5185
|
else {
|
|
5473
5186
|
this.eventTimeElapsed.emit();
|
|
5474
5187
|
}
|
|
5475
|
-
await this.baseComponent.logStep(
|
|
5188
|
+
await this.baseComponent.logStep(this.flowStep, TranslationUtils.FlowMoments.Finalized);
|
|
5476
5189
|
}
|
|
5477
5190
|
async verificationFinished() {
|
|
5478
5191
|
if (this.verified)
|
|
@@ -5480,15 +5193,11 @@ const IdTilt = class {
|
|
|
5480
5193
|
this.verified = true;
|
|
5481
5194
|
this.titleMesage = this.translations.IdCaptureValues.Loading;
|
|
5482
5195
|
this.closeCamera();
|
|
5483
|
-
this.showDemo = true;
|
|
5484
|
-
var loops = 0;
|
|
5485
5196
|
this.demoVideo.src = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_id.mp4';
|
|
5486
|
-
this.demoVideo.loop =
|
|
5487
|
-
|
|
5488
|
-
|
|
5489
|
-
|
|
5490
|
-
await delay(this.translations.GlobalValues.VideoLenght);
|
|
5491
|
-
}
|
|
5197
|
+
this.demoVideo.loop = true;
|
|
5198
|
+
this.showDemo = true;
|
|
5199
|
+
this.demoVideo.play();
|
|
5200
|
+
await delay(10000);
|
|
5492
5201
|
this.eventTimeElapsed.emit();
|
|
5493
5202
|
}
|
|
5494
5203
|
render() {
|
|
@@ -5504,13 +5213,12 @@ const IdTilt = class {
|
|
|
5504
5213
|
cameraStyleInner = { marginTop: Math.round((this.cameraSize.height - (this.cameraSize.width * 9) / 16) / 2) * -1 + 'px' };
|
|
5505
5214
|
}
|
|
5506
5215
|
let titleClass = this.verified ? 'color-black-2 text-center' : 'color-white text-center';
|
|
5507
|
-
//let videoClass = this.device.isMobile ? '' : 'video-demo';
|
|
5508
5216
|
let bgDemo = this.verified ? 'container' : 'container bg-black';
|
|
5509
|
-
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)))));
|
|
5510
5218
|
}
|
|
5511
5219
|
get component() { return index.getElement(this); }
|
|
5512
5220
|
};
|
|
5513
|
-
|
|
5221
|
+
IdCapture.style = idCaptureCss;
|
|
5514
5222
|
|
|
5515
5223
|
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
5516
5224
|
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
@@ -5578,7 +5286,7 @@ function v4(options, buf, offset) {
|
|
|
5578
5286
|
}
|
|
5579
5287
|
|
|
5580
5288
|
const name = "@ekyc_qoobiss/qbs-ect-cmp";
|
|
5581
|
-
const version$1 = "3.6.
|
|
5289
|
+
const version$1 = "3.6.41";
|
|
5582
5290
|
const description = "Person Identification Component";
|
|
5583
5291
|
const main = "./dist/index.cjs.js";
|
|
5584
5292
|
const module$1 = "./dist/index.js";
|
|
@@ -5700,6 +5408,7 @@ const IdentificationComponent = class {
|
|
|
5700
5408
|
index.registerInstance(this, hostRef);
|
|
5701
5409
|
this.logInit = {};
|
|
5702
5410
|
this.flowStatusToSet = TranslationUtils.FlowStatus.NONE;
|
|
5411
|
+
this.initialised = false;
|
|
5703
5412
|
this.token = undefined;
|
|
5704
5413
|
this.order_id = undefined;
|
|
5705
5414
|
this.api_url = undefined;
|
|
@@ -5707,7 +5416,6 @@ const IdentificationComponent = class {
|
|
|
5707
5416
|
this.redirect_id = undefined;
|
|
5708
5417
|
this.phone_number = undefined;
|
|
5709
5418
|
this.lang_iso = undefined;
|
|
5710
|
-
this.idSide = '';
|
|
5711
5419
|
this.errorMessage = undefined;
|
|
5712
5420
|
this.errorTitle = undefined;
|
|
5713
5421
|
}
|
|
@@ -5742,33 +5450,14 @@ const IdentificationComponent = class {
|
|
|
5742
5450
|
if (this.lang_iso && this.lang_iso != '') {
|
|
5743
5451
|
TranslationUtils.state.langIso = this.lang_iso;
|
|
5744
5452
|
}
|
|
5745
|
-
var ini = sessionStorage.getItem(TranslationUtils.SessionKeys.InitialisedKey);
|
|
5746
|
-
if (ini && ini.toLowerCase() == 'true') {
|
|
5747
|
-
TranslationUtils.state.initialised = true;
|
|
5748
|
-
}
|
|
5749
|
-
var hasIdBk = sessionStorage.getItem(TranslationUtils.SessionKeys.HasIdBackKey);
|
|
5750
|
-
if (hasIdBk && hasIdBk.toLowerCase() == 'true') {
|
|
5751
|
-
TranslationUtils.state.hasIdBack = true;
|
|
5752
|
-
}
|
|
5753
|
-
var agrVal = sessionStorage.getItem(TranslationUtils.SessionKeys.AgreementValidationKey);
|
|
5754
|
-
if (agrVal && agrVal.toLowerCase() == 'true') {
|
|
5755
|
-
TranslationUtils.state.agreementsValidation = true;
|
|
5756
|
-
}
|
|
5757
|
-
var phoneVal = sessionStorage.getItem(TranslationUtils.SessionKeys.PhoneValidationKey);
|
|
5758
|
-
if (phoneVal && phoneVal.toLowerCase() == 'true') {
|
|
5759
|
-
TranslationUtils.state.phoneValidation = true;
|
|
5760
|
-
}
|
|
5761
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
|
+
}
|
|
5762
5457
|
if (this.order_id && this.order_id != '') {
|
|
5763
5458
|
TranslationUtils.state.requestId = this.order_id;
|
|
5764
5459
|
if (TranslationUtils.state.debug)
|
|
5765
5460
|
console.log('Current RequestId has value: ' + this.order_id);
|
|
5766
|
-
if (savedRequest && savedRequest != '' && savedRequest != this.order_id) {
|
|
5767
|
-
if (TranslationUtils.state.debug)
|
|
5768
|
-
console.log('Session RequestId: ' + savedRequest + ' has different value than property one: ' + this.order_id);
|
|
5769
|
-
this.flowStatusToSet = TranslationUtils.FlowStatus.LANDING;
|
|
5770
|
-
TranslationUtils.state.initialised = false;
|
|
5771
|
-
}
|
|
5772
5461
|
}
|
|
5773
5462
|
else if (savedRequest) {
|
|
5774
5463
|
if (TranslationUtils.state.debug)
|
|
@@ -5790,17 +5479,12 @@ const IdentificationComponent = class {
|
|
|
5790
5479
|
await this.initializeRequest();
|
|
5791
5480
|
TranslationUtils.state.flowStatus = this.flowStatusToSet;
|
|
5792
5481
|
}
|
|
5793
|
-
componentWillRender() {
|
|
5794
|
-
if (this.idSide == '') {
|
|
5795
|
-
this.idSide = TranslationUtils.state.hasIdBack ? 'front' : '';
|
|
5796
|
-
}
|
|
5797
|
-
}
|
|
5798
5482
|
async initializeRequest() {
|
|
5799
|
-
if (
|
|
5483
|
+
if (this.initialised) {
|
|
5800
5484
|
return;
|
|
5801
5485
|
}
|
|
5486
|
+
this.initialised = true;
|
|
5802
5487
|
if (TranslationUtils.state.environment == 'DEMO') {
|
|
5803
|
-
TranslationUtils.state.initialised = true;
|
|
5804
5488
|
return;
|
|
5805
5489
|
}
|
|
5806
5490
|
if (TranslationUtils.state.device.browser == Browser.Mi) {
|
|
@@ -5818,7 +5502,7 @@ const IdentificationComponent = class {
|
|
|
5818
5502
|
this.redirect_id = TranslationUtils.state.redirectId;
|
|
5819
5503
|
}
|
|
5820
5504
|
if (TranslationUtils.state.token != '' && (TranslationUtils.state.requestId != '' || TranslationUtils.state.redirectId != '')) {
|
|
5821
|
-
|
|
5505
|
+
await this.baseComponent.apiCall.AddIdentificationRequest(TranslationUtils.state.device, packageJson.version);
|
|
5822
5506
|
if (!this.order_id || this.order_id == '') {
|
|
5823
5507
|
this.order_id = TranslationUtils.state.requestId;
|
|
5824
5508
|
}
|
|
@@ -5834,19 +5518,17 @@ const IdentificationComponent = class {
|
|
|
5834
5518
|
}
|
|
5835
5519
|
render() {
|
|
5836
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 })))));
|
|
5837
|
-
if (TranslationUtils.state.
|
|
5838
|
-
|
|
5839
|
-
currentBlock = index.h("landing-validation", null);
|
|
5840
|
-
}
|
|
5521
|
+
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.LANDING) {
|
|
5522
|
+
currentBlock = index.h("landing-validation", null);
|
|
5841
5523
|
}
|
|
5842
|
-
|
|
5524
|
+
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.MOBILE) {
|
|
5843
5525
|
currentBlock = index.h("mobile-redirect", null);
|
|
5844
5526
|
}
|
|
5845
5527
|
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.AGREEMENT) {
|
|
5846
5528
|
currentBlock = index.h("agreement-info", null);
|
|
5847
5529
|
}
|
|
5848
5530
|
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.PHONE) {
|
|
5849
|
-
currentBlock = index.h("sms-
|
|
5531
|
+
currentBlock = index.h("sms-send", null);
|
|
5850
5532
|
}
|
|
5851
5533
|
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.CODE) {
|
|
5852
5534
|
currentBlock = index.h("sms-code-validation", null);
|
|
@@ -5854,11 +5536,11 @@ const IdentificationComponent = class {
|
|
|
5854
5536
|
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.CODEERROR) {
|
|
5855
5537
|
currentBlock = index.h("sms-code-validation", null);
|
|
5856
5538
|
}
|
|
5857
|
-
if (TranslationUtils.state.flowStatus
|
|
5539
|
+
if (TranslationUtils.state.flowStatus in [TranslationUtils.FlowStatus.IDFRONT, TranslationUtils.FlowStatus.IDBACK, TranslationUtils.FlowStatus.IDTILT]) {
|
|
5858
5540
|
currentBlock = index.h("process-id", null);
|
|
5859
5541
|
}
|
|
5860
|
-
if (TranslationUtils.state.flowStatus
|
|
5861
|
-
currentBlock = index.h("user-liveness",
|
|
5542
|
+
if (TranslationUtils.state.flowStatus in [TranslationUtils.FlowStatus.LIVENESS, TranslationUtils.FlowStatus.LIVENESSGESTURE]) {
|
|
5543
|
+
currentBlock = index.h("user-liveness", null);
|
|
5862
5544
|
}
|
|
5863
5545
|
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.COMPLETE) {
|
|
5864
5546
|
currentBlock = index.h("end-redirect", null);
|
|
@@ -5909,33 +5591,25 @@ const LandingValidation = class {
|
|
|
5909
5591
|
}
|
|
5910
5592
|
}
|
|
5911
5593
|
async initRequest() {
|
|
5912
|
-
|
|
5913
|
-
this.warningText = this.translations.LandingValues.WarningMd;
|
|
5914
|
-
}
|
|
5915
|
-
else {
|
|
5916
|
-
this.warningText = this.translations.LandingValues.Warning;
|
|
5917
|
-
}
|
|
5594
|
+
this.warningText = this.translations.LandingValues.Warning;
|
|
5918
5595
|
}
|
|
5919
5596
|
async startFlow() {
|
|
5920
|
-
if (
|
|
5597
|
+
if (!this.buttonDisabled) {
|
|
5921
5598
|
this.buttonDisabled = true;
|
|
5922
5599
|
if (TranslationUtils.state.environment === 'DEMO') {
|
|
5923
5600
|
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus.COMPLETE;
|
|
5924
5601
|
return;
|
|
5925
5602
|
}
|
|
5926
|
-
|
|
5603
|
+
var cameraIsAccessible = await Cameras.InitCameras(TranslationUtils.state.device);
|
|
5604
|
+
if (!cameraIsAccessible) {
|
|
5927
5605
|
if (TranslationUtils.state.device.mobileOS == MobileOS.iOS)
|
|
5928
5606
|
sessionStorage.setItem(TranslationUtils.SessionKeys.RefreshDoneKey, 'false');
|
|
5929
|
-
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus.CAMERAERROR;
|
|
5930
|
-
}
|
|
5931
|
-
else if (TranslationUtils.state.agreementsValidation) {
|
|
5932
|
-
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus.AGREEMENT;
|
|
5933
5607
|
}
|
|
5934
|
-
|
|
5935
|
-
TranslationUtils.state.flowStatus =
|
|
5608
|
+
try {
|
|
5609
|
+
TranslationUtils.state.flowStatus = await this.baseComponent.apiCall.LandingValidationStartFlow(cameraIsAccessible);
|
|
5936
5610
|
}
|
|
5937
|
-
|
|
5938
|
-
|
|
5611
|
+
catch (e) {
|
|
5612
|
+
this.apiErrorEvent.emit(e);
|
|
5939
5613
|
}
|
|
5940
5614
|
}
|
|
5941
5615
|
}
|
|
@@ -5945,9 +5619,9 @@ const LandingValidation = class {
|
|
|
5945
5619
|
async leaveFlow() {
|
|
5946
5620
|
if (this.buttonDisabled)
|
|
5947
5621
|
return;
|
|
5948
|
-
TranslationUtils.state.initialised = false;
|
|
5949
5622
|
try {
|
|
5950
|
-
await this.baseComponent.apiCall.AbortRequest();
|
|
5623
|
+
let abortResult = await this.baseComponent.apiCall.AbortRequest();
|
|
5624
|
+
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus[abortResult.state];
|
|
5951
5625
|
Events.flowAborted();
|
|
5952
5626
|
}
|
|
5953
5627
|
catch (e) {
|
|
@@ -5956,7 +5630,7 @@ const LandingValidation = class {
|
|
|
5956
5630
|
}
|
|
5957
5631
|
}
|
|
5958
5632
|
render() {
|
|
5959
|
-
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))))));
|
|
5960
5634
|
}
|
|
5961
5635
|
};
|
|
5962
5636
|
LandingValidation.style = landingValidationCss;
|
|
@@ -8860,7 +8534,7 @@ const MobileRedirect = class {
|
|
|
8860
8534
|
this.infoTextTop = this.translations.MobileRedirectValues.InfoTop;
|
|
8861
8535
|
this.infoTextBottom = this.translations.MobileRedirectValues.InfoBottom;
|
|
8862
8536
|
let envUri = TranslationUtils.state.environment == 'QA' ? 'test' : 'ect';
|
|
8863
|
-
let baseUri = TranslationUtils.state.
|
|
8537
|
+
let baseUri = TranslationUtils.state.apiBaseUrl.includes("apimd") ? 'https://onmd.id-kyc.com/' : 'https://onro.id-kyc.com/';
|
|
8864
8538
|
this.redirectLink = baseUri + envUri + '/mobileredirect?redirectId=' + TranslationUtils.state.redirectId;
|
|
8865
8539
|
if (TranslationUtils.state.phoneNumber && TranslationUtils.state.phoneNumber != '') {
|
|
8866
8540
|
this.contact = TranslationUtils.state.phoneNumber;
|
|
@@ -8943,23 +8617,7 @@ var CaptureUploadTypes;
|
|
|
8943
8617
|
CaptureUploadTypes["SelfieGestureVideo"] = "SelfieGestureVideo";
|
|
8944
8618
|
CaptureUploadTypes["TiltVideo"] = "TiltVideo";
|
|
8945
8619
|
CaptureUploadTypes["None"] = "None";
|
|
8946
|
-
})(CaptureUploadTypes || (CaptureUploadTypes = {}));
|
|
8947
|
-
var IdCaptureFlowStatus;
|
|
8948
|
-
(function (IdCaptureFlowStatus) {
|
|
8949
|
-
IdCaptureFlowStatus[IdCaptureFlowStatus["HowToFront"] = 0] = "HowToFront";
|
|
8950
|
-
IdCaptureFlowStatus[IdCaptureFlowStatus["IdFront"] = 1] = "IdFront";
|
|
8951
|
-
IdCaptureFlowStatus[IdCaptureFlowStatus["HowToBack"] = 2] = "HowToBack";
|
|
8952
|
-
IdCaptureFlowStatus[IdCaptureFlowStatus["IdBack"] = 3] = "IdBack";
|
|
8953
|
-
IdCaptureFlowStatus[IdCaptureFlowStatus["Tilt"] = 4] = "Tilt";
|
|
8954
|
-
IdCaptureFlowStatus[IdCaptureFlowStatus["End"] = 5] = "End";
|
|
8955
|
-
})(IdCaptureFlowStatus || (IdCaptureFlowStatus = {}));
|
|
8956
|
-
var SelfieFlowStatus;
|
|
8957
|
-
(function (SelfieFlowStatus) {
|
|
8958
|
-
SelfieFlowStatus[SelfieFlowStatus["HowToSelfie"] = 0] = "HowToSelfie";
|
|
8959
|
-
SelfieFlowStatus[SelfieFlowStatus["Selfie"] = 1] = "Selfie";
|
|
8960
|
-
SelfieFlowStatus[SelfieFlowStatus["Gesture"] = 2] = "Gesture";
|
|
8961
|
-
SelfieFlowStatus[SelfieFlowStatus["End"] = 3] = "End";
|
|
8962
|
-
})(SelfieFlowStatus || (SelfieFlowStatus = {}));
|
|
8620
|
+
})(CaptureUploadTypes || (CaptureUploadTypes = {}));
|
|
8963
8621
|
|
|
8964
8622
|
const processIdCss = "";
|
|
8965
8623
|
|
|
@@ -8968,7 +8626,6 @@ const ProcessId = class {
|
|
|
8968
8626
|
index.registerInstance(this, hostRef);
|
|
8969
8627
|
this.apiErrorEvent = index.createEvent(this, "apiError", 7);
|
|
8970
8628
|
this.recordingResultCount = 0;
|
|
8971
|
-
this.captureStep = undefined;
|
|
8972
8629
|
this.showTimeout = undefined;
|
|
8973
8630
|
this.showInvalid = undefined;
|
|
8974
8631
|
this.flow = undefined;
|
|
@@ -8980,47 +8637,42 @@ const ProcessId = class {
|
|
|
8980
8637
|
this.initFlow();
|
|
8981
8638
|
}
|
|
8982
8639
|
initFlow() {
|
|
8983
|
-
|
|
8984
|
-
|
|
8985
|
-
|
|
8986
|
-
|
|
8987
|
-
|
|
8988
|
-
|
|
8989
|
-
|
|
8990
|
-
|
|
8991
|
-
|
|
8992
|
-
|
|
8993
|
-
|
|
8994
|
-
|
|
8995
|
-
|
|
8996
|
-
|
|
8997
|
-
|
|
8998
|
-
|
|
8999
|
-
|
|
9000
|
-
|
|
9001
|
-
|
|
9002
|
-
|
|
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,
|
|
9003
8660
|
};
|
|
9004
8661
|
}
|
|
9005
|
-
if (TranslationUtils.state.
|
|
9006
|
-
this.flow
|
|
9007
|
-
|
|
9008
|
-
|
|
9009
|
-
|
|
9010
|
-
|
|
9011
|
-
|
|
9012
|
-
|
|
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,
|
|
9013
8671
|
};
|
|
9014
8672
|
}
|
|
9015
|
-
this.captureStep = IdCaptureFlowStatus.HowToFront;
|
|
9016
8673
|
}
|
|
9017
8674
|
howToDone() {
|
|
9018
|
-
|
|
9019
|
-
this.captureStep = IdCaptureFlowStatus.IdFront;
|
|
9020
|
-
}
|
|
9021
|
-
if (this.captureStep == IdCaptureFlowStatus.HowToBack) {
|
|
9022
|
-
this.captureStep = IdCaptureFlowStatus.IdBack;
|
|
9023
|
-
}
|
|
8675
|
+
this.flow.howToDone = true;
|
|
9024
8676
|
}
|
|
9025
8677
|
timeElapsed() {
|
|
9026
8678
|
this.showTimeout = true;
|
|
@@ -9041,25 +8693,11 @@ const ProcessId = class {
|
|
|
9041
8693
|
return;
|
|
9042
8694
|
}
|
|
9043
8695
|
try {
|
|
9044
|
-
let frontCapture = new File([idPhoto], this.flow.
|
|
9045
|
-
|
|
9046
|
-
|
|
9047
|
-
|
|
9048
|
-
|
|
9049
|
-
this.apiErrorEvent.emit(e);
|
|
9050
|
-
}
|
|
9051
|
-
}
|
|
9052
|
-
async captureIdBackImage(event) {
|
|
9053
|
-
let idPhoto = event.detail;
|
|
9054
|
-
if (idPhoto.size == 0) {
|
|
9055
|
-
await this.baseComponent.apiCall.AddLog({ message: 'Empty id photo', blobData: idPhoto }, getLogMessage());
|
|
9056
|
-
this.triggerErrorFlow();
|
|
9057
|
-
return;
|
|
9058
|
-
}
|
|
9059
|
-
try {
|
|
9060
|
-
let backCapture = new File([idPhoto], this.flow.back.fileName, { type: 'image/png' });
|
|
9061
|
-
this.flow.back.photoDone = await this.uploadPhotos(this.flow.back.photoType, backCapture);
|
|
9062
|
-
await this.endFlow();
|
|
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
|
+
}
|
|
9063
8701
|
}
|
|
9064
8702
|
catch (e) {
|
|
9065
8703
|
this.apiErrorEvent.emit(e);
|
|
@@ -9077,22 +8715,11 @@ const ProcessId = class {
|
|
|
9077
8715
|
return;
|
|
9078
8716
|
}
|
|
9079
8717
|
let mimeType = idRecording.type == Stream.mp4MimeType.type ? Stream.mp4MimeType : Stream.webmMimeType;
|
|
9080
|
-
|
|
9081
|
-
|
|
9082
|
-
|
|
9083
|
-
|
|
9084
|
-
else if (this.captureStep == IdCaptureFlowStatus.IdBack) {
|
|
9085
|
-
let backRec = new File([idRecording], this.flow.back.recName + mimeType.extension, { type: mimeType.type });
|
|
9086
|
-
this.flow.back.recordingDone = await this.uploadRecording(this.flow.back.recType, backRec);
|
|
9087
|
-
}
|
|
9088
|
-
else if (this.captureStep == IdCaptureFlowStatus.Tilt) {
|
|
9089
|
-
let tiltRec = new File([idRecording], this.flow.tilt.recName + mimeType.extension, { type: mimeType.type });
|
|
9090
|
-
this.flow.tilt.recordingDone = await this.uploadRecording(this.flow.tilt.recType, tiltRec);
|
|
9091
|
-
}
|
|
9092
|
-
else {
|
|
9093
|
-
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();
|
|
9094
8722
|
}
|
|
9095
|
-
await this.endFlow();
|
|
9096
8723
|
this.recordingResultCount = 0;
|
|
9097
8724
|
}
|
|
9098
8725
|
async componentDidLoad() {
|
|
@@ -9125,72 +8752,9 @@ const ProcessId = class {
|
|
|
9125
8752
|
}
|
|
9126
8753
|
return false;
|
|
9127
8754
|
}
|
|
9128
|
-
triggerErrorFlow(
|
|
9129
|
-
if (this.captureStep == IdCaptureFlowStatus.IdBack) {
|
|
9130
|
-
restart = true;
|
|
9131
|
-
}
|
|
9132
|
-
if (restart) {
|
|
9133
|
-
this.initFlow();
|
|
9134
|
-
this.showInvalid = true;
|
|
9135
|
-
return;
|
|
9136
|
-
}
|
|
9137
|
-
if (this.captureStep == IdCaptureFlowStatus.IdFront) {
|
|
9138
|
-
this.flow.front.photoDone = false;
|
|
9139
|
-
this.flow.front.recordingDone = false;
|
|
9140
|
-
}
|
|
9141
|
-
if (this.captureStep == IdCaptureFlowStatus.IdBack) {
|
|
9142
|
-
this.flow.back.photoDone = false;
|
|
9143
|
-
this.flow.back.recordingDone = false;
|
|
9144
|
-
}
|
|
9145
|
-
if (this.captureStep == IdCaptureFlowStatus.Tilt) {
|
|
9146
|
-
this.flow.tilt.photoDone = true;
|
|
9147
|
-
this.flow.tilt.recordingDone = false;
|
|
9148
|
-
}
|
|
8755
|
+
triggerErrorFlow() {
|
|
9149
8756
|
this.showInvalid = true;
|
|
9150
8757
|
}
|
|
9151
|
-
async endFlow() {
|
|
9152
|
-
if (this.captureStep == IdCaptureFlowStatus.IdFront) {
|
|
9153
|
-
if (this.flow.front.photoDone && this.flow.front.recordingDone) {
|
|
9154
|
-
if (TranslationUtils.state.hasIdBack) {
|
|
9155
|
-
this.captureStep = IdCaptureFlowStatus.IdBack;
|
|
9156
|
-
}
|
|
9157
|
-
else if (TranslationUtils.state.hasIdTilt) {
|
|
9158
|
-
this.captureStep = IdCaptureFlowStatus.Tilt;
|
|
9159
|
-
}
|
|
9160
|
-
else {
|
|
9161
|
-
this.captureStep = IdCaptureFlowStatus.End;
|
|
9162
|
-
}
|
|
9163
|
-
}
|
|
9164
|
-
else {
|
|
9165
|
-
return;
|
|
9166
|
-
}
|
|
9167
|
-
}
|
|
9168
|
-
if (this.captureStep == IdCaptureFlowStatus.IdBack && TranslationUtils.state.hasIdBack) {
|
|
9169
|
-
if (this.flow.back.photoDone && this.flow.back.recordingDone) {
|
|
9170
|
-
if (TranslationUtils.state.hasIdTilt) {
|
|
9171
|
-
this.captureStep = IdCaptureFlowStatus.Tilt;
|
|
9172
|
-
}
|
|
9173
|
-
else {
|
|
9174
|
-
this.captureStep = IdCaptureFlowStatus.End;
|
|
9175
|
-
}
|
|
9176
|
-
}
|
|
9177
|
-
else {
|
|
9178
|
-
return;
|
|
9179
|
-
}
|
|
9180
|
-
}
|
|
9181
|
-
if (this.captureStep == IdCaptureFlowStatus.Tilt && TranslationUtils.state.hasIdTilt) {
|
|
9182
|
-
if (this.flow.tilt.photoDone && this.flow.tilt.recordingDone) {
|
|
9183
|
-
this.captureStep = IdCaptureFlowStatus.End;
|
|
9184
|
-
}
|
|
9185
|
-
else {
|
|
9186
|
-
return;
|
|
9187
|
-
}
|
|
9188
|
-
}
|
|
9189
|
-
if (this.captureStep != IdCaptureFlowStatus.End) {
|
|
9190
|
-
return;
|
|
9191
|
-
}
|
|
9192
|
-
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus.LIVENESS;
|
|
9193
|
-
}
|
|
9194
8758
|
async disconnectedCallback() {
|
|
9195
8759
|
await this.baseComponent.finalize();
|
|
9196
8760
|
}
|
|
@@ -9206,30 +8770,17 @@ const ProcessId = class {
|
|
|
9206
8770
|
}
|
|
9207
8771
|
render() {
|
|
9208
8772
|
let error = index.h("capture-error", { type: "ID" });
|
|
9209
|
-
let
|
|
9210
|
-
let
|
|
9211
|
-
let tiltCapture = index.h("id-tilt", null);
|
|
9212
|
-
let howToFront = index.h("how-to-info", { idSide: "front" });
|
|
9213
|
-
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);
|
|
9214
8775
|
if (this.showInvalid || this.showTimeout) {
|
|
9215
8776
|
return error;
|
|
9216
8777
|
}
|
|
9217
|
-
if (
|
|
9218
|
-
return
|
|
9219
|
-
}
|
|
9220
|
-
if (this.captureStep == IdCaptureFlowStatus.HowToBack) {
|
|
9221
|
-
return howToBack;
|
|
9222
|
-
}
|
|
9223
|
-
if (this.captureStep == IdCaptureFlowStatus.IdFront) {
|
|
9224
|
-
return frontCapture;
|
|
9225
|
-
}
|
|
9226
|
-
if (this.captureStep == IdCaptureFlowStatus.IdBack) {
|
|
9227
|
-
return secondCapture;
|
|
8778
|
+
if (TranslationUtils.state.flowStatus != TranslationUtils.FlowStatus.IDTILT && this.flow.howToDone) {
|
|
8779
|
+
return howTo;
|
|
9228
8780
|
}
|
|
9229
|
-
|
|
9230
|
-
return
|
|
8781
|
+
else {
|
|
8782
|
+
return capture;
|
|
9231
8783
|
}
|
|
9232
|
-
return index.h("div", null);
|
|
9233
8784
|
}
|
|
9234
8785
|
};
|
|
9235
8786
|
ProcessId.style = processIdCss;
|
|
@@ -9237,31 +8788,23 @@ ProcessId.style = processIdCss;
|
|
|
9237
8788
|
const selfieCaptureCss = "";
|
|
9238
8789
|
|
|
9239
8790
|
const SelfieCapture = class {
|
|
9240
|
-
// @State() private animationPath: string;
|
|
9241
8791
|
constructor(hostRef) {
|
|
9242
8792
|
index.registerInstance(this, hostRef);
|
|
9243
8793
|
this.eventPhotoCapture = index.createEvent(this, "photoSelfieCapture", 7);
|
|
9244
8794
|
this.apiErrorEvent = index.createEvent(this, "apiError", 7);
|
|
9245
8795
|
this.eventTimeElapsed = index.createEvent(this, "timeElapsed", 7);
|
|
9246
|
-
this.photoIsReady = photos => {
|
|
9247
|
-
//this.closeCamera();
|
|
9248
|
-
this.eventPhotoCapture.emit(photos);
|
|
9249
|
-
};
|
|
9250
8796
|
this.videoStarted = undefined;
|
|
9251
8797
|
this.captureTaken = undefined;
|
|
9252
8798
|
this.verified = undefined;
|
|
9253
8799
|
this.titleMesage = undefined;
|
|
9254
8800
|
this.demoEnded = undefined;
|
|
9255
8801
|
this.demoVideo = undefined;
|
|
9256
|
-
this.uploadingLink = undefined;
|
|
9257
8802
|
this.captureHeight = undefined;
|
|
9258
8803
|
this.captureWidth = undefined;
|
|
9259
8804
|
this.captureTaken = false;
|
|
9260
8805
|
this.verified = false;
|
|
9261
8806
|
this.cameras = new Cameras();
|
|
9262
8807
|
this.demoEnded = false;
|
|
9263
|
-
this.uploadingLink = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_selfie.mp4';
|
|
9264
|
-
this.baseComponent = new BaseComponent(TranslationUtils.FlowSteps.SelfieCapture);
|
|
9265
8808
|
}
|
|
9266
8809
|
eventVideoStarted(event) {
|
|
9267
8810
|
this.videoStarted = true;
|
|
@@ -9279,8 +8822,20 @@ const SelfieCapture = class {
|
|
|
9279
8822
|
}
|
|
9280
8823
|
}
|
|
9281
8824
|
async componentDidLoad() {
|
|
9282
|
-
|
|
9283
|
-
|
|
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);
|
|
9284
8839
|
this.demoVideo.play();
|
|
9285
8840
|
await delay(this.translations.GlobalValues.VideoLenght);
|
|
9286
8841
|
this.demoEnded = true;
|
|
@@ -9292,8 +8847,7 @@ const SelfieCapture = class {
|
|
|
9292
8847
|
navigator.mediaDevices
|
|
9293
8848
|
.getUserMedia(constraints)
|
|
9294
8849
|
.then(stream => {
|
|
9295
|
-
|
|
9296
|
-
superStream.initStream(stream);
|
|
8850
|
+
this.mainStream.initStream(stream);
|
|
9297
8851
|
})
|
|
9298
8852
|
.catch(e => {
|
|
9299
8853
|
this.closeCamera();
|
|
@@ -9302,8 +8856,8 @@ const SelfieCapture = class {
|
|
|
9302
8856
|
}, 100);
|
|
9303
8857
|
}
|
|
9304
8858
|
closeCamera() {
|
|
9305
|
-
if (
|
|
9306
|
-
|
|
8859
|
+
if (this.mainStream) {
|
|
8860
|
+
this.mainStream.dropStream();
|
|
9307
8861
|
}
|
|
9308
8862
|
}
|
|
9309
8863
|
disconnectedCallback() {
|
|
@@ -9315,14 +8869,14 @@ const SelfieCapture = class {
|
|
|
9315
8869
|
if (this.captureTaken)
|
|
9316
8870
|
return;
|
|
9317
8871
|
this.captureTaken = true;
|
|
9318
|
-
if (
|
|
9319
|
-
let res = await
|
|
9320
|
-
this.
|
|
8872
|
+
if (this.mainStream) {
|
|
8873
|
+
let res = await this.mainStream.takePhoto();
|
|
8874
|
+
this.eventPhotoCapture.emit(res);
|
|
9321
8875
|
}
|
|
9322
8876
|
else {
|
|
9323
8877
|
this.eventTimeElapsed.emit();
|
|
9324
8878
|
}
|
|
9325
|
-
await this.baseComponent.logStep(
|
|
8879
|
+
await this.baseComponent.logStep(this.currentStep, TranslationUtils.FlowMoments.Finalized);
|
|
9326
8880
|
}
|
|
9327
8881
|
async verificationFinished() {
|
|
9328
8882
|
if (this.verified)
|
|
@@ -9331,14 +8885,10 @@ const SelfieCapture = class {
|
|
|
9331
8885
|
this.titleMesage = this.translations.SelfieCaptureValues.Loading;
|
|
9332
8886
|
this.closeCamera();
|
|
9333
8887
|
this.demoEnded = false;
|
|
9334
|
-
|
|
9335
|
-
this.demoVideo.
|
|
9336
|
-
this.demoVideo.
|
|
9337
|
-
|
|
9338
|
-
loops++;
|
|
9339
|
-
this.demoVideo.play();
|
|
9340
|
-
await delay(this.translations.GlobalValues.VideoLenght);
|
|
9341
|
-
}
|
|
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);
|
|
9342
8892
|
this.eventTimeElapsed.emit();
|
|
9343
8893
|
}
|
|
9344
8894
|
render() {
|
|
@@ -9362,169 +8912,79 @@ const SelfieCapture = class {
|
|
|
9362
8912
|
};
|
|
9363
8913
|
SelfieCapture.style = selfieCaptureCss;
|
|
9364
8914
|
|
|
9365
|
-
const
|
|
8915
|
+
const smsCodeValidationCss = "";
|
|
9366
8916
|
|
|
9367
|
-
const
|
|
9368
|
-
// @State() private animationPath: string;
|
|
8917
|
+
const SmsCodeValidation = class {
|
|
9369
8918
|
constructor(hostRef) {
|
|
9370
8919
|
index.registerInstance(this, hostRef);
|
|
9371
|
-
this.eventPhotoCapture = index.createEvent(this, "photoSelfieTiltCapture", 7);
|
|
9372
8920
|
this.apiErrorEvent = index.createEvent(this, "apiError", 7);
|
|
9373
|
-
this.
|
|
9374
|
-
this.
|
|
9375
|
-
|
|
9376
|
-
|
|
9377
|
-
|
|
9378
|
-
this.
|
|
9379
|
-
this.
|
|
9380
|
-
this.verified = undefined;
|
|
9381
|
-
this.titleMesage = undefined;
|
|
9382
|
-
this.demoEnded = undefined;
|
|
9383
|
-
this.demoVideo = undefined;
|
|
9384
|
-
this.uploadingLink = undefined;
|
|
9385
|
-
this.captureHeight = undefined;
|
|
9386
|
-
this.captureWidth = undefined;
|
|
9387
|
-
this.captureTaken = false;
|
|
9388
|
-
this.verified = false;
|
|
9389
|
-
this.cameras = new Cameras();
|
|
9390
|
-
this.demoEnded = false;
|
|
9391
|
-
this.uploadingLink = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_selfie.mp4';
|
|
9392
|
-
this.baseComponent = new BaseComponent(TranslationUtils.FlowSteps.SelfieTilt);
|
|
9393
|
-
}
|
|
9394
|
-
eventVideoStarted(event) {
|
|
9395
|
-
this.videoStarted = true;
|
|
9396
|
-
var cameraSize = event.detail;
|
|
9397
|
-
var height = Math.round((cameraSize.width * 16) / 9);
|
|
9398
|
-
this.captureHeight = height - Math.round((window.screen.height - height) / 2);
|
|
9399
|
-
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);
|
|
9400
8928
|
}
|
|
9401
|
-
async
|
|
9402
|
-
|
|
9403
|
-
|
|
9404
|
-
|
|
9405
|
-
|
|
9406
|
-
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];
|
|
9407
8934
|
}
|
|
9408
|
-
|
|
9409
|
-
|
|
9410
|
-
this.mainStream = Stream.getNewInstance(VerificationMode.Tilt);
|
|
9411
|
-
await this.baseComponent.logStep(TranslationUtils.FlowSteps.SelfieTilt, TranslationUtils.FlowMoments.Initialized);
|
|
9412
|
-
this.titleMesage = this.translations.SelfieCaptureValues.FacePoseMapping[this.mainStream.facePose];
|
|
9413
|
-
this.demoEnded = false;
|
|
9414
|
-
this.demoVideo.src = TranslationUtils.SelfieCaptureValues.FacePoseDemoMapping[this.mainStream.facePose];
|
|
9415
|
-
this.demoVideo.play();
|
|
9416
|
-
await delay(this.translations.GlobalValues.VideoLenght);
|
|
9417
|
-
this.demoEnded = true;
|
|
9418
|
-
this.openCamera();
|
|
9419
|
-
}
|
|
9420
|
-
async openCamera() {
|
|
9421
|
-
const constraints = this.cameras.GetConstraints('', TranslationUtils.state.device, true);
|
|
9422
|
-
setTimeout(() => {
|
|
9423
|
-
navigator.mediaDevices
|
|
9424
|
-
.getUserMedia(constraints)
|
|
9425
|
-
.then(stream => {
|
|
9426
|
-
this.mainStream.initStream(stream);
|
|
9427
|
-
})
|
|
9428
|
-
.catch(e => {
|
|
9429
|
-
this.closeCamera();
|
|
9430
|
-
this.apiErrorEvent.emit(e);
|
|
9431
|
-
});
|
|
9432
|
-
}, 100);
|
|
9433
|
-
}
|
|
9434
|
-
closeCamera() {
|
|
9435
|
-
if (this.mainStream) {
|
|
9436
|
-
this.mainStream.dropStream();
|
|
8935
|
+
catch (e) {
|
|
8936
|
+
this.apiErrorEvent.emit(e);
|
|
9437
8937
|
}
|
|
9438
8938
|
}
|
|
9439
|
-
disconnectedCallback() {
|
|
9440
|
-
this.
|
|
9441
|
-
Stream.instance = null;
|
|
9442
|
-
FaceML5Detector.instance = null;
|
|
8939
|
+
async disconnectedCallback() {
|
|
8940
|
+
await this.baseComponent.finalize();
|
|
9443
8941
|
}
|
|
9444
|
-
async
|
|
9445
|
-
|
|
9446
|
-
|
|
9447
|
-
this.
|
|
9448
|
-
|
|
9449
|
-
this.photoIsReady(res);
|
|
9450
|
-
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;
|
|
9451
8947
|
}
|
|
9452
|
-
async
|
|
9453
|
-
|
|
9454
|
-
|
|
9455
|
-
|
|
9456
|
-
|
|
9457
|
-
this.
|
|
9458
|
-
this.
|
|
9459
|
-
|
|
9460
|
-
this.
|
|
9461
|
-
|
|
9462
|
-
while (loops < 7) {
|
|
9463
|
-
loops++;
|
|
9464
|
-
this.demoVideo.play();
|
|
9465
|
-
await delay(this.translations.GlobalValues.VideoLenght);
|
|
9466
|
-
}
|
|
9467
|
-
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;
|
|
9468
8958
|
}
|
|
9469
8959
|
render() {
|
|
9470
|
-
let
|
|
9471
|
-
if (TranslationUtils.state.
|
|
9472
|
-
|
|
9473
|
-
'width': this.captureWidth + 'px',
|
|
9474
|
-
'height': this.captureHeight + 'px',
|
|
9475
|
-
'overflow': 'hidden',
|
|
9476
|
-
'borderRadius': '10px',
|
|
9477
|
-
'text-align': 'center',
|
|
9478
|
-
'margin': 'auto',
|
|
9479
|
-
};
|
|
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);
|
|
9480
8963
|
}
|
|
9481
|
-
|
|
9482
|
-
//let videoClass = this.device.isMobile ? '' : 'video-demo';
|
|
9483
|
-
let bgDemo = this.verified ? 'container' : 'container bg-black';
|
|
9484
|
-
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))))));
|
|
9485
8965
|
}
|
|
9486
|
-
get component() { return index.getElement(this); }
|
|
9487
8966
|
};
|
|
9488
|
-
|
|
8967
|
+
SmsCodeValidation.style = smsCodeValidationCss;
|
|
9489
8968
|
|
|
9490
|
-
const
|
|
8969
|
+
const smsSendCss = "";
|
|
9491
8970
|
|
|
9492
|
-
const
|
|
8971
|
+
const SmsSend = class {
|
|
9493
8972
|
constructor(hostRef) {
|
|
9494
8973
|
index.registerInstance(this, hostRef);
|
|
9495
8974
|
this.apiErrorEvent = index.createEvent(this, "apiError", 7);
|
|
9496
|
-
this.title = undefined;
|
|
9497
|
-
this.details = undefined;
|
|
9498
8975
|
this.buttonText = undefined;
|
|
9499
8976
|
this.phoneNumber = undefined;
|
|
9500
|
-
this.code = undefined;
|
|
9501
8977
|
this.prefilledPhone = false;
|
|
9502
8978
|
this.canSend = false;
|
|
9503
|
-
|
|
9504
|
-
this.baseComponent = new BaseComponent(TranslationUtils.FlowSteps.OtpSend);
|
|
9505
|
-
}
|
|
9506
|
-
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.CODE) {
|
|
9507
|
-
this.baseComponent = new BaseComponent(TranslationUtils.FlowSteps.OtpCheck);
|
|
9508
|
-
}
|
|
8979
|
+
this.baseComponent = new BaseComponent(TranslationUtils.FlowSteps.OtpSend);
|
|
9509
8980
|
this.baseComponent.setEventEmitter(this.apiErrorEvent);
|
|
9510
8981
|
}
|
|
9511
8982
|
async doAction() {
|
|
9512
8983
|
try {
|
|
9513
8984
|
this.canSend = false;
|
|
9514
|
-
|
|
9515
|
-
|
|
9516
|
-
|
|
9517
|
-
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus.ID;
|
|
9518
|
-
}
|
|
9519
|
-
else {
|
|
9520
|
-
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus.CODEERROR;
|
|
9521
|
-
}
|
|
9522
|
-
}
|
|
9523
|
-
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.PHONE) {
|
|
9524
|
-
var codeSent = await this.baseComponent.apiCall.SendOTPCode(TranslationUtils.state.requestId, this.phoneNumber);
|
|
9525
|
-
if (codeSent === true) {
|
|
9526
|
-
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus.CODE;
|
|
9527
|
-
}
|
|
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];
|
|
9528
8988
|
}
|
|
9529
8989
|
}
|
|
9530
8990
|
catch (e) {
|
|
@@ -9536,20 +8996,11 @@ const SmsCodeValidation = class {
|
|
|
9536
8996
|
}
|
|
9537
8997
|
async componentWillRender() {
|
|
9538
8998
|
this.translations = await TranslationUtils.Translations.getValues();
|
|
9539
|
-
|
|
9540
|
-
|
|
9541
|
-
this.
|
|
9542
|
-
this.
|
|
9543
|
-
|
|
9544
|
-
this.phoneNumber = TranslationUtils.state.phoneNumber;
|
|
9545
|
-
this.prefilledPhone = true;
|
|
9546
|
-
this.canSend = true;
|
|
9547
|
-
}
|
|
9548
|
-
}
|
|
9549
|
-
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.CODE || TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.CODEERROR) {
|
|
9550
|
-
this.title = this.translations.CodeValidationValues.Title;
|
|
9551
|
-
this.details = this.translations.CodeValidationValues.Description;
|
|
9552
|
-
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;
|
|
9553
9004
|
}
|
|
9554
9005
|
}
|
|
9555
9006
|
async componentDidLoad() {
|
|
@@ -9563,30 +9014,11 @@ const SmsCodeValidation = class {
|
|
|
9563
9014
|
this.canSend = this.phoneNumber.length == 10;
|
|
9564
9015
|
ev.target.value = this.phoneNumber;
|
|
9565
9016
|
}
|
|
9566
|
-
handleChangeCode(ev) {
|
|
9567
|
-
let value = ev.target ? ev.target.value : '';
|
|
9568
|
-
this.code = value;
|
|
9569
|
-
if (this.code.length > 4)
|
|
9570
|
-
this.code = this.code.substring(0, 4);
|
|
9571
|
-
this.canSend = this.code.length == 4;
|
|
9572
|
-
ev.target.value = this.code;
|
|
9573
|
-
}
|
|
9574
9017
|
render() {
|
|
9575
|
-
|
|
9576
|
-
let errorBlock;
|
|
9577
|
-
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.CODEERROR) {
|
|
9578
|
-
errorBlock = index.h("p", { class: "main-text font-size-18 mt-15 color-red text-center" }, this.translations.CodeValidationValues.Error);
|
|
9579
|
-
}
|
|
9580
|
-
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.PHONE) {
|
|
9581
|
-
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 })));
|
|
9582
|
-
}
|
|
9583
|
-
else {
|
|
9584
|
-
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 })));
|
|
9585
|
-
}
|
|
9586
|
-
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))))));
|
|
9587
9019
|
}
|
|
9588
9020
|
};
|
|
9589
|
-
|
|
9021
|
+
SmsSend.style = smsSendCss;
|
|
9590
9022
|
|
|
9591
9023
|
const userLivenessCss = "";
|
|
9592
9024
|
|
|
@@ -9597,57 +9029,51 @@ const UserLiveness = class {
|
|
|
9597
9029
|
this.recordingResultCount = 0;
|
|
9598
9030
|
this.recordingRetryCount = 0;
|
|
9599
9031
|
this.showError = undefined;
|
|
9600
|
-
this.captureStep = undefined;
|
|
9601
9032
|
this.flow = undefined;
|
|
9602
|
-
this.
|
|
9603
|
-
this.baseComponent.setEventEmitter(this.apiErrorEvent);
|
|
9033
|
+
this.howToDone = false;
|
|
9604
9034
|
}
|
|
9605
9035
|
async componentDidLoad() {
|
|
9606
9036
|
await this.baseComponent.initialize();
|
|
9607
9037
|
}
|
|
9608
9038
|
componentWillLoad() {
|
|
9609
|
-
|
|
9610
|
-
|
|
9611
|
-
|
|
9612
|
-
|
|
9613
|
-
|
|
9614
|
-
|
|
9615
|
-
|
|
9616
|
-
|
|
9617
|
-
|
|
9618
|
-
|
|
9619
|
-
tilt: null,
|
|
9620
|
-
};
|
|
9621
|
-
if (TranslationUtils.state.hasSelfieGesture) {
|
|
9622
|
-
this.flow.tilt = {
|
|
9623
|
-
photoDone: true,
|
|
9624
|
-
recordingDone: false,
|
|
9625
|
-
fileName: '',
|
|
9626
|
-
recName: 'selfieTiltVideo.',
|
|
9627
|
-
photoType: CaptureUploadTypes.None,
|
|
9628
|
-
recType: CaptureUploadTypes.SelfieGestureVideo,
|
|
9039
|
+
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.LIVENESS) {
|
|
9040
|
+
this.baseComponent = new BaseComponent(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,
|
|
9629
9049
|
};
|
|
9630
9050
|
}
|
|
9631
|
-
|
|
9051
|
+
else if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.LIVENESSGESTURE) {
|
|
9052
|
+
this.baseComponent = new BaseComponent(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.setEventEmitter(this.apiErrorEvent);
|
|
9632
9064
|
}
|
|
9633
|
-
|
|
9634
|
-
this.
|
|
9065
|
+
howToDoneEvent() {
|
|
9066
|
+
this.howToDone = true;
|
|
9635
9067
|
}
|
|
9636
9068
|
timeElapsed() {
|
|
9637
9069
|
this.showError = true;
|
|
9638
9070
|
}
|
|
9639
9071
|
captureErrorDone() {
|
|
9640
9072
|
this.showError = false;
|
|
9641
|
-
if (this.captureStep == SelfieFlowStatus.Selfie) {
|
|
9642
|
-
this.flow.front.photoDone = false;
|
|
9643
|
-
this.flow.front.recordingDone = false;
|
|
9644
|
-
}
|
|
9645
|
-
if (this.captureStep == SelfieFlowStatus.Gesture) {
|
|
9646
|
-
this.flow.tilt.photoDone = false;
|
|
9647
|
-
this.flow.tilt.recordingDone = false;
|
|
9648
|
-
}
|
|
9649
9073
|
}
|
|
9650
9074
|
async captureSelfieImage(event) {
|
|
9075
|
+
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.LIVENESSGESTURE)
|
|
9076
|
+
return;
|
|
9651
9077
|
let selfiePhoto = event.detail;
|
|
9652
9078
|
if (selfiePhoto.size == 0) {
|
|
9653
9079
|
await this.baseComponent.apiCall.AddLog({ message: 'Empty selfie', blobData: selfiePhoto }, getLogMessage());
|
|
@@ -9655,8 +9081,11 @@ const UserLiveness = class {
|
|
|
9655
9081
|
return;
|
|
9656
9082
|
}
|
|
9657
9083
|
try {
|
|
9658
|
-
var uploadPhoto = new File([selfiePhoto], this.flow.
|
|
9659
|
-
await this.
|
|
9084
|
+
var uploadPhoto = new File([selfiePhoto], this.flow.capture.fileName, { type: 'image/png' });
|
|
9085
|
+
let photoUploaded = await this.baseComponent.apiCall.UploadFileForRequestB64(TranslationUtils.state.requestId, this.flow.capture.photoType, uploadPhoto);
|
|
9086
|
+
if (!photoUploaded) {
|
|
9087
|
+
this.triggerErrorFlow();
|
|
9088
|
+
}
|
|
9660
9089
|
}
|
|
9661
9090
|
catch (e) {
|
|
9662
9091
|
this.apiErrorEvent.emit(e);
|
|
@@ -9676,18 +9105,11 @@ const UserLiveness = class {
|
|
|
9676
9105
|
}
|
|
9677
9106
|
let mimeType = selfieRecording.type == Stream.mp4MimeType.type ? Stream.mp4MimeType : Stream.webmMimeType;
|
|
9678
9107
|
try {
|
|
9679
|
-
|
|
9680
|
-
|
|
9681
|
-
|
|
9682
|
-
}
|
|
9683
|
-
else if (this.captureStep == SelfieFlowStatus.Gesture) {
|
|
9684
|
-
let uploadRec = new File([selfieRecording], this.flow.tilt.recName + mimeType.extension, { type: mimeType.type });
|
|
9685
|
-
this.flow.tilt.recordingDone = await this.uploadRecording(uploadRec, this.flow.tilt.recType);
|
|
9686
|
-
}
|
|
9687
|
-
else {
|
|
9108
|
+
let uploadRec = new File([selfieRecording], this.flow.capture.recName + mimeType.extension, { type: mimeType.type });
|
|
9109
|
+
let uplodDone = await this.baseComponent.apiCall.UploadFileForRequestB64(TranslationUtils.state.requestId, this.flow.capture.recType, uploadRec);
|
|
9110
|
+
if (!uplodDone) {
|
|
9688
9111
|
this.triggerErrorFlow();
|
|
9689
9112
|
}
|
|
9690
|
-
this.endFlow();
|
|
9691
9113
|
}
|
|
9692
9114
|
catch (e) {
|
|
9693
9115
|
if (this.recordingRetryCount < 3) {
|
|
@@ -9699,82 +9121,25 @@ const UserLiveness = class {
|
|
|
9699
9121
|
}
|
|
9700
9122
|
}
|
|
9701
9123
|
}
|
|
9702
|
-
async verificationFinished(_event) {
|
|
9703
|
-
this.endFlow();
|
|
9704
|
-
}
|
|
9705
9124
|
async disconnectedCallback() {
|
|
9706
9125
|
await this.baseComponent.finalize();
|
|
9707
9126
|
}
|
|
9708
|
-
async uploadPhoto(photoFile, photoType) {
|
|
9709
|
-
if (this.flow.front.photoDone) {
|
|
9710
|
-
return;
|
|
9711
|
-
}
|
|
9712
|
-
this.flow.front.photoDone = await this.baseComponent.apiCall.UploadFileForRequestB64(TranslationUtils.state.requestId, photoType, photoFile);
|
|
9713
|
-
if (this.flow.front.photoDone) {
|
|
9714
|
-
this.endFlow();
|
|
9715
|
-
}
|
|
9716
|
-
else {
|
|
9717
|
-
this.triggerErrorFlow();
|
|
9718
|
-
}
|
|
9719
|
-
}
|
|
9720
|
-
async uploadRecording(uploadRec, recType) {
|
|
9721
|
-
let uplodDone = await this.baseComponent.apiCall.UploadFileForRequestB64(TranslationUtils.state.requestId, recType, uploadRec);
|
|
9722
|
-
if (uplodDone) {
|
|
9723
|
-
return true;
|
|
9724
|
-
}
|
|
9725
|
-
else {
|
|
9726
|
-
this.triggerErrorFlow();
|
|
9727
|
-
}
|
|
9728
|
-
return false;
|
|
9729
|
-
}
|
|
9730
9127
|
triggerErrorFlow() {
|
|
9731
9128
|
this.showError = true;
|
|
9732
9129
|
}
|
|
9733
|
-
endFlow() {
|
|
9734
|
-
if (this.captureStep == SelfieFlowStatus.Selfie) {
|
|
9735
|
-
if (this.flow.front.photoDone && this.flow.front.recordingDone) {
|
|
9736
|
-
if (TranslationUtils.state.hasSelfieGesture) {
|
|
9737
|
-
this.captureStep = SelfieFlowStatus.Gesture;
|
|
9738
|
-
}
|
|
9739
|
-
else {
|
|
9740
|
-
this.captureStep = SelfieFlowStatus.End;
|
|
9741
|
-
}
|
|
9742
|
-
}
|
|
9743
|
-
else {
|
|
9744
|
-
return;
|
|
9745
|
-
}
|
|
9746
|
-
}
|
|
9747
|
-
if (this.captureStep == SelfieFlowStatus.Gesture) {
|
|
9748
|
-
if (this.flow.tilt.photoDone && this.flow.tilt.recordingDone) {
|
|
9749
|
-
this.captureStep = SelfieFlowStatus.End;
|
|
9750
|
-
}
|
|
9751
|
-
else {
|
|
9752
|
-
return;
|
|
9753
|
-
}
|
|
9754
|
-
}
|
|
9755
|
-
if (this.captureStep != SelfieFlowStatus.End) {
|
|
9756
|
-
return;
|
|
9757
|
-
}
|
|
9758
|
-
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus.COMPLETE;
|
|
9759
|
-
}
|
|
9760
9130
|
render() {
|
|
9761
|
-
let howTo = index.h("how-to-info",
|
|
9762
|
-
let capture = index.h("selfie-capture",
|
|
9763
|
-
let tilt = index.h("selfie-tilt", { id: "camera" });
|
|
9131
|
+
let howTo = index.h("how-to-info", null);
|
|
9132
|
+
let capture = index.h("selfie-capture", null);
|
|
9764
9133
|
let error = index.h("capture-error", { type: "LIVENESS" });
|
|
9765
9134
|
if (this.showError) {
|
|
9766
9135
|
return error;
|
|
9767
9136
|
}
|
|
9768
|
-
if (this.
|
|
9769
|
-
return howTo;
|
|
9770
|
-
}
|
|
9771
|
-
if (this.captureStep == SelfieFlowStatus.Selfie) {
|
|
9137
|
+
if (this.howToDone) {
|
|
9772
9138
|
return capture;
|
|
9773
9139
|
}
|
|
9774
|
-
|
|
9775
|
-
return
|
|
9140
|
+
else {
|
|
9141
|
+
return howTo;
|
|
9776
9142
|
}
|
|
9777
|
-
return index.h("div", null);
|
|
9778
9143
|
}
|
|
9779
9144
|
};
|
|
9780
9145
|
UserLiveness.style = userLivenessCss;
|
|
@@ -9787,14 +9152,12 @@ exports.capture_error = CaptureError;
|
|
|
9787
9152
|
exports.end_redirect = EndRedirect;
|
|
9788
9153
|
exports.error_end = ErrorEnd;
|
|
9789
9154
|
exports.how_to_info = HowToInfo;
|
|
9790
|
-
exports.id_back_capture = IdBackCapture;
|
|
9791
9155
|
exports.id_capture = IdCapture;
|
|
9792
|
-
exports.id_tilt = IdTilt;
|
|
9793
9156
|
exports.identification_component = IdentificationComponent;
|
|
9794
9157
|
exports.landing_validation = LandingValidation;
|
|
9795
9158
|
exports.mobile_redirect = MobileRedirect;
|
|
9796
9159
|
exports.process_id = ProcessId;
|
|
9797
9160
|
exports.selfie_capture = SelfieCapture;
|
|
9798
|
-
exports.selfie_tilt = SelfieTilt;
|
|
9799
9161
|
exports.sms_code_validation = SmsCodeValidation;
|
|
9162
|
+
exports.sms_send = SmsSend;
|
|
9800
9163
|
exports.user_liveness = UserLiveness;
|