@ekyc_qoobiss/qbs-ect-cmp 3.6.54 → 3.6.56

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.
@@ -4419,24 +4419,36 @@ class Stream {
4419
4419
  this.streamPaused = false;
4420
4420
  this.recordedChunks = [];
4421
4421
  this.videoSize = { width: 0, height: 0 };
4422
+ if (TranslationUtils.state.debug)
4423
+ console.log('stream | constructor');
4422
4424
  this.initFacePose();
4423
4425
  this.idML5Detector = IDML5Detector.getInstance(this, TranslationUtils.state.device.isMobile);
4424
4426
  this.faceML5Detector = FaceML5Detector.getInstance(this, TranslationUtils.state.device.isMobile);
4425
4427
  this.verificationMode = mode;
4426
4428
  }
4427
4429
  static getNewInstance(mode) {
4430
+ if (TranslationUtils.state.debug)
4431
+ console.log('stream | getNewInstance');
4428
4432
  if (!Stream.instance) {
4433
+ if (TranslationUtils.state.debug)
4434
+ console.log('stream | getNewInstance | new instance');
4429
4435
  Stream.instance = new Stream(mode);
4430
4436
  }
4431
4437
  return Stream.instance;
4432
4438
  }
4433
4439
  autoCapturing() {
4440
+ if (TranslationUtils.state.debug)
4441
+ console.log('stream | autoCapturing');
4434
4442
  this.callbackAutoCapturing();
4435
4443
  }
4436
4444
  timeElapsed() {
4445
+ if (TranslationUtils.state.debug)
4446
+ console.log('stream | timeElapsed');
4437
4447
  this.callbackTimeElapsed();
4438
4448
  }
4439
4449
  verificationReady() {
4450
+ if (TranslationUtils.state.debug)
4451
+ console.log('stream | verificationReady');
4440
4452
  this.verificationFinished();
4441
4453
  }
4442
4454
  updateHtmlElements(videoElement, canvasElement, component) {
@@ -4446,6 +4458,8 @@ class Stream {
4446
4458
  this.faceML5Detector.updateHtmlElements(this.videoElement, this.canvasElement, component);
4447
4459
  }
4448
4460
  startStream(stream) {
4461
+ if (TranslationUtils.state.debug)
4462
+ console.log('stream | startStream');
4449
4463
  if (this.stream)
4450
4464
  this.stream.getTracks().forEach((track) => track.stop());
4451
4465
  this.stream = stream;
@@ -4477,6 +4491,8 @@ class Stream {
4477
4491
  this.recordStream();
4478
4492
  }
4479
4493
  recordStream() {
4494
+ if (TranslationUtils.state.debug)
4495
+ console.log('stream | recordStream');
4480
4496
  if (this.mediaRecorder && this.mediaRecorder.state == 'recording')
4481
4497
  return;
4482
4498
  var options = { mimeType: Stream.webmMimeType.mime, videoBitsPerSecond: 1500000 };
@@ -4487,9 +4503,13 @@ class Stream {
4487
4503
  this.recordedChunks = [];
4488
4504
  this.mediaRecorder = new MediaRecorder(this.stream, options);
4489
4505
  this.mediaRecorder.ondataavailable = event => {
4506
+ if (TranslationUtils.state.debug)
4507
+ console.log('stream | recordStream | ondataavailable');
4490
4508
  this.recordedChunks.push(event.data);
4491
4509
  };
4492
4510
  this.mediaRecorder.onstop = _e => {
4511
+ if (TranslationUtils.state.debug)
4512
+ console.log('stream | recordStream | onstop');
4493
4513
  var rec = new Blob(this.recordedChunks, {
4494
4514
  type: options.mimeType.split(';')[0],
4495
4515
  });
@@ -4520,6 +4540,8 @@ class Stream {
4520
4540
  return !(this.stream && this.stream.getTracks && this.stream.getTracks().length > 0);
4521
4541
  }
4522
4542
  async takePhoto() {
4543
+ if (TranslationUtils.state.debug)
4544
+ console.log('stream | takePhoto');
4523
4545
  const canvas = document.createElement('canvas');
4524
4546
  canvas.style.visibility = 'hidden';
4525
4547
  canvas.width = this.videoElement.videoWidth;
@@ -4527,12 +4549,16 @@ class Stream {
4527
4549
  return await this.getFrame(canvas);
4528
4550
  }
4529
4551
  getFrame(canvas) {
4552
+ if (TranslationUtils.state.debug)
4553
+ console.log('stream | getFrame');
4530
4554
  return new Promise(resolve => {
4531
4555
  const context = canvas.getContext('2d');
4532
4556
  context.drawImage(this.videoElement, 0, 0, canvas.width, canvas.height);
4533
4557
  canvas.toBlob((frame) => {
4534
4558
  if (frame.type === ImageFormat.JPEG && !TranslationUtils.state.device.isAppleDevice) {
4535
4559
  try {
4560
+ if (TranslationUtils.state.debug)
4561
+ console.log('stream | getFrame | addExifInImg');
4536
4562
  addExifInImg(frame, this.stream.getTracks()[0], this.videoSize).then(updatedFrame => resolve(updatedFrame));
4537
4563
  }
4538
4564
  catch (e) {
@@ -4541,6 +4567,8 @@ class Stream {
4541
4567
  }
4542
4568
  }
4543
4569
  else {
4570
+ if (TranslationUtils.state.debug)
4571
+ console.log('stream | getFrame | resolve');
4544
4572
  resolve(frame);
4545
4573
  }
4546
4574
  }, ImageFormat.PNG, 1);
@@ -4600,6 +4628,8 @@ const Camera = class {
4600
4628
  this.captureMode = undefined;
4601
4629
  }
4602
4630
  componentDidLoad() {
4631
+ if (TranslationUtils.state.debug)
4632
+ console.log('camera | componentDidLoad');
4603
4633
  this.startStream();
4604
4634
  }
4605
4635
  render() {
@@ -4616,6 +4646,8 @@ const Camera = class {
4616
4646
  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) })));
4617
4647
  }
4618
4648
  startStream() {
4649
+ if (TranslationUtils.state.debug)
4650
+ console.log('camera | startStream');
4619
4651
  let verificationMode = [TranslationUtils.FlowStatus.IDTILT, TranslationUtils.FlowStatus.LIVENESSGESTURE].includes(TranslationUtils.state.flowStatus) ? VerificationMode.Tilt : VerificationMode.Full;
4620
4652
  const stream = Stream.getNewInstance(verificationMode);
4621
4653
  stream.updateHtmlElements(this.cameraVideo, this.cameraCanvas, this.component);
@@ -4720,7 +4752,7 @@ const CaptureError = class {
4720
4752
  this.eventCaptureErrorDone.emit();
4721
4753
  }
4722
4754
  render() {
4723
- return (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("h1", { class: "color-red" }, this.titleR1), index.h("h1", { class: "color-red" }, this.titleR2), index.h("div", null, index.h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.reason), index.h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.descriptionR1), index.h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.descriptionR2)), index.h("div", { class: "pos-relative show-bottom" }, index.h("div", { class: "btn-buletin" }, index.h("button", { class: "main-button", type: "button", disabled: !this.buttonEnabled, onClick: () => this.buttonClick() }, this.buttonText), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
4755
+ return (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("h1", { class: "color-red" }, this.titleR1), index.h("h1", { class: "color-red" }, this.titleR2), index.h("div", null, index.h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.descriptionR1), index.h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.descriptionR2), index.h("p", { class: "font-size-1" }, this.reason)), index.h("div", { class: "pos-relative show-bottom" }, index.h("div", { class: "btn-buletin" }, index.h("button", { class: "main-button", type: "button", disabled: !this.buttonEnabled, onClick: () => this.buttonClick() }, this.buttonText), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
4724
4756
  }
4725
4757
  };
4726
4758
  CaptureError.style = captureErrorCss;
@@ -4915,12 +4947,16 @@ class Cameras {
4915
4947
  return null;
4916
4948
  }
4917
4949
  static async InitCameras(device) {
4950
+ if (TranslationUtils.state.debug)
4951
+ console.log('cameras | initCameras');
4918
4952
  try {
4919
4953
  let cam = new Cameras();
4920
4954
  let cameras = (await cam.GetCameras(device)).filter(c => c.facingMode == 'environment');
4921
4955
  var recommCamera = cam.GetRecommendedCamera(cameras);
4922
4956
  TranslationUtils.state.cameraIds = cameras.map(camera => camera.deviceId);
4923
4957
  TranslationUtils.state.cameraId = recommCamera === null || recommCamera === void 0 ? void 0 : recommCamera.deviceId;
4958
+ if (TranslationUtils.state.debug)
4959
+ console.log(`cameras | initCameras | cameraIds ${TranslationUtils.state.cameraIds} | cameraId ${TranslationUtils.state.cameraId}`);
4924
4960
  return true;
4925
4961
  }
4926
4962
  catch (e) {
@@ -4961,9 +4997,6 @@ const IdCapture = class {
4961
4997
  this.eventPhotoCapture = index.createEvent(this, "photoIdCapture", 7);
4962
4998
  this.apiErrorEvent = index.createEvent(this, "apiError", 7);
4963
4999
  this.eventTimeElapsed = index.createEvent(this, "timeElapsed", 7);
4964
- this.photoIsReady = (photos) => {
4965
- this.eventPhotoCapture.emit(photos);
4966
- };
4967
5000
  this.videoStarted = undefined;
4968
5001
  this.cameraSize = undefined;
4969
5002
  this.captureTaken = undefined;
@@ -4981,12 +5014,16 @@ const IdCapture = class {
4981
5014
  this.cameraSize = event.detail;
4982
5015
  }
4983
5016
  async componentWillLoad() {
5017
+ if (TranslationUtils.state.debug)
5018
+ console.log('id-capture | componentWillLoad');
4984
5019
  this.translations = await TranslationUtils.Translations.getValues();
4985
5020
  if (!navigator.mediaDevices) {
4986
5021
  this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
4987
5022
  }
4988
5023
  }
4989
5024
  initVariables() {
5025
+ if (TranslationUtils.state.debug)
5026
+ console.log('id-capture | initVariables');
4990
5027
  if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.IDFRONT) {
4991
5028
  this.pose = IDPose.Straight;
4992
5029
  this.flowStep = TranslationUtils.FlowSteps.CiFrontCapture;
@@ -5007,6 +5044,8 @@ const IdCapture = class {
5007
5044
  }
5008
5045
  }
5009
5046
  async componentDidLoad() {
5047
+ if (TranslationUtils.state.debug)
5048
+ console.log('id-capture | componentDidLoad');
5010
5049
  this.initVariables();
5011
5050
  await BaseComponent.logStep(this.flowStep, TranslationUtils.FlowMoments.Initialized);
5012
5051
  if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.IDBACK) {
@@ -5022,11 +5061,15 @@ const IdCapture = class {
5022
5061
  this.openCamera();
5023
5062
  }
5024
5063
  async openCamera() {
5064
+ if (TranslationUtils.state.debug)
5065
+ console.log('id-capture | openCamera');
5025
5066
  const constraints = this.cameras.GetConstraints(TranslationUtils.state.cameraId, TranslationUtils.state.device);
5026
5067
  setTimeout(() => {
5027
5068
  navigator.mediaDevices
5028
5069
  .getUserMedia(constraints)
5029
5070
  .then(stream => {
5071
+ if (TranslationUtils.state.debug)
5072
+ console.log('id-capture | openCamera | streamObtained');
5030
5073
  const superStream = Stream.getNewInstance(this.verificationMode);
5031
5074
  superStream.initStream(stream);
5032
5075
  })
@@ -5037,23 +5080,31 @@ const IdCapture = class {
5037
5080
  }, 100);
5038
5081
  }
5039
5082
  closeCamera() {
5083
+ if (TranslationUtils.state.debug)
5084
+ console.log('id-capture | closeCamera');
5040
5085
  if (Stream.instance) {
5041
5086
  Stream.instance.dropStream();
5042
5087
  }
5043
5088
  }
5044
5089
  disconnectedCallback() {
5090
+ if (TranslationUtils.state.debug)
5091
+ console.log('id-capture | disconnectedCallback');
5045
5092
  this.closeCamera();
5046
5093
  Stream.instance = null;
5047
5094
  IDML5Detector.instance = null;
5048
5095
  FaceML5Detector.instance = null;
5049
5096
  }
5050
5097
  async takePhoto() {
5098
+ if (TranslationUtils.state.debug)
5099
+ console.log('id-capture | takePhoto');
5051
5100
  if (this.captureTaken)
5052
5101
  return;
5053
5102
  this.captureTaken = true;
5054
5103
  if (Stream.instance) {
5104
+ if (TranslationUtils.state.debug)
5105
+ console.log('id-capture | takePhoto | sendingPhoto');
5055
5106
  let res = await Stream.instance.takePhoto();
5056
- this.photoIsReady(res);
5107
+ this.eventPhotoCapture.emit(res);
5057
5108
  }
5058
5109
  else {
5059
5110
  this.eventTimeElapsed.emit();
@@ -5061,14 +5112,16 @@ const IdCapture = class {
5061
5112
  await BaseComponent.logStep(this.flowStep, TranslationUtils.FlowMoments.Finalized);
5062
5113
  }
5063
5114
  async verificationFinished() {
5115
+ if (TranslationUtils.state.debug)
5116
+ console.log('id-capture | verificationFinished');
5064
5117
  if (this.verified)
5065
5118
  return;
5066
5119
  this.verified = true;
5067
5120
  this.titleMesage = this.translations.IdCaptureValues.Loading;
5068
5121
  this.closeCamera();
5069
5122
  this.demoVideo.src = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_id.mp4';
5070
- this.demoVideo.loop = true;
5071
5123
  this.showDemo = true;
5124
+ this.demoVideo.loop = true;
5072
5125
  this.demoVideo.play();
5073
5126
  }
5074
5127
  render() {
@@ -5157,7 +5210,7 @@ function v4(options, buf, offset) {
5157
5210
  }
5158
5211
 
5159
5212
  const name = "@ekyc_qoobiss/qbs-ect-cmp";
5160
- const version$1 = "3.6.54";
5213
+ const version$1 = "3.6.56";
5161
5214
  const description = "Person Identification Component";
5162
5215
  const main = "./dist/index.cjs.js";
5163
5216
  const module$1 = "./dist/index.js";
@@ -8616,6 +8669,8 @@ const ProcessId = class {
8616
8669
  howToDone: false,
8617
8670
  };
8618
8671
  }
8672
+ if (TranslationUtils.state.debug)
8673
+ console.log('process-id | initFlow');
8619
8674
  }
8620
8675
  howToDone() {
8621
8676
  this.flow.howToDone = true;
@@ -8633,8 +8688,12 @@ const ProcessId = class {
8633
8688
  }
8634
8689
  }
8635
8690
  async captureIdImage(event) {
8691
+ if (TranslationUtils.state.debug)
8692
+ console.log('process-id | captureIdImage');
8636
8693
  let idPhoto = event.detail;
8637
8694
  if (idPhoto.size == 0) {
8695
+ if (TranslationUtils.state.debug)
8696
+ console.log('process-id | captureIdImage | Empty id photo');
8638
8697
  await TranslationUtils.ApiCall.instance.AddLog({ message: 'Empty id photo', blobData: idPhoto }, getLogMessage());
8639
8698
  this.triggerErrorFlow();
8640
8699
  return;
@@ -8642,6 +8701,8 @@ const ProcessId = class {
8642
8701
  try {
8643
8702
  let frontCapture = new File([idPhoto], this.flow.capture.fileName, { type: 'image/png' });
8644
8703
  var uploadResult = await TranslationUtils.ApiCall.instance.UploadFileForRequestB64(TranslationUtils.state.requestId, this.flow.capture.photoType, frontCapture);
8704
+ if (TranslationUtils.state.debug)
8705
+ console.log('process-id | captureIdImage | uploadResult: ' + uploadResult);
8645
8706
  if (!uploadResult) {
8646
8707
  this.switchCamera();
8647
8708
  this.triggerErrorFlow();
@@ -8652,12 +8713,16 @@ const ProcessId = class {
8652
8713
  }
8653
8714
  }
8654
8715
  async capturedIdRecording(event) {
8716
+ if (TranslationUtils.state.debug)
8717
+ console.log('process-id | capturedIdRecording');
8655
8718
  let idRecording = event.detail;
8656
8719
  if (idRecording.size == 0 && this.recordingResultCount == 0) {
8657
8720
  this.recordingResultCount++;
8658
8721
  return;
8659
8722
  }
8660
8723
  if (idRecording.size == 0) {
8724
+ if (TranslationUtils.state.debug)
8725
+ console.log('process-id | capturedIdRecording | Empty ID recording');
8661
8726
  await TranslationUtils.ApiCall.instance.AddLog({ message: 'Empty ID recording', blobData: idRecording }, getLogMessage());
8662
8727
  this.triggerErrorFlow();
8663
8728
  return;
@@ -8665,12 +8730,32 @@ const ProcessId = class {
8665
8730
  let mimeType = idRecording.type == Stream.mp4MimeType.type ? Stream.mp4MimeType : Stream.webmMimeType;
8666
8731
  let captureRec = new File([idRecording], this.flow.capture.recName + mimeType.extension, { type: mimeType.type });
8667
8732
  var uploadResult = await TranslationUtils.ApiCall.instance.UploadFileForRequestB64(TranslationUtils.state.requestId, this.flow.capture.recType, captureRec);
8733
+ if (TranslationUtils.state.debug)
8734
+ console.log('process-id | capturedIdRecording | uploadResult: ' + uploadResult);
8668
8735
  if (!uploadResult) {
8669
8736
  this.triggerErrorFlow();
8670
8737
  }
8671
8738
  this.recordingResultCount = 0;
8672
8739
  }
8740
+ async verificationFinished() {
8741
+ if (TranslationUtils.state.debug)
8742
+ console.log('process-id | verificationFinished');
8743
+ this.verificationReceived = Date.now();
8744
+ while (Date.now() - this.verificationReceived < 25000) {
8745
+ await delay(2000);
8746
+ let currentStatus = await TranslationUtils.ApiCall.instance.GetFlowState();
8747
+ if (currentStatus != TranslationUtils.state.flowStatus) {
8748
+ TranslationUtils.state.flowStatus = currentStatus;
8749
+ break;
8750
+ }
8751
+ }
8752
+ if (TranslationUtils.state.debug)
8753
+ console.log('process-id | verificationFinished | waitingFinished ');
8754
+ this.triggerErrorFlow();
8755
+ }
8673
8756
  async componentDidLoad() {
8757
+ if (TranslationUtils.state.debug)
8758
+ console.log('process-id | componentDidLoad');
8674
8759
  await BaseComponent.initialize(this.currentStep);
8675
8760
  }
8676
8761
  triggerErrorFlow() {
@@ -8678,9 +8763,13 @@ const ProcessId = class {
8678
8763
  this.showInvalid = true;
8679
8764
  }
8680
8765
  async disconnectedCallback() {
8766
+ if (TranslationUtils.state.debug)
8767
+ console.log('process-id | disconnectedCallback');
8681
8768
  await BaseComponent.finalize(this.currentStep);
8682
8769
  }
8683
8770
  switchCamera() {
8771
+ if (TranslationUtils.state.debug)
8772
+ console.log('process-id | switchCamera');
8684
8773
  if (this.captureRetryCount == 1) {
8685
8774
  Cameras.switchCamera();
8686
8775
  this.captureRetryCount = 0;
@@ -8876,7 +8965,7 @@ SmsCodeValidation.style = smsCodeValidationCss;
8876
8965
  const smsSendCss = "";
8877
8966
 
8878
8967
  const SmsSend = class {
8879
- constructor(hostRef) { index.registerInstance(this, hostRef); this.apiErrorEvent = index.createEvent(this, "apiError", 7); this.buttonText = undefined; this.title = undefined; this.phoneNumber = undefined; this.prefilledPhone = false; this.canSend = false; }
8968
+ constructor(hostRef) { index.registerInstance(this, hostRef); this.apiErrorEvent = index.createEvent(this, "apiError", 7); this.buttonText = undefined; this.title = undefined; this.details = undefined; this.phoneNumber = undefined; this.prefilledPhone = false; this.canSend = false; }
8880
8969
  async doAction() {
8881
8970
  try {
8882
8971
  this.canSend = false;
@@ -8896,6 +8985,7 @@ const SmsSend = class {
8896
8985
  this.translations = await TranslationUtils.Translations.getValues();
8897
8986
  this.buttonText = this.translations.PhoneValidationValues.Button;
8898
8987
  this.title = this.translations.PhoneValidationValues.Title;
8988
+ this.details = this.translations.PhoneValidationValues.Description;
8899
8989
  if (TranslationUtils.state.phoneNumber && TranslationUtils.state.phoneNumber != '') {
8900
8990
  this.phoneNumber = TranslationUtils.state.phoneNumber;
8901
8991
  this.prefilledPhone = true;
@@ -8914,7 +9004,7 @@ const SmsSend = class {
8914
9004
  ev.target.value = this.phoneNumber;
8915
9005
  }
8916
9006
  render() {
8917
- 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)), 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))))));
9007
+ 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), index.h("p", { class: "main-text font-size-2 mt-15 mb-20 text-center" }, this.details)), 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))))));
8918
9008
  }
8919
9009
  };
8920
9010
  SmsSend.style = smsSendCss;
@@ -9025,6 +9115,18 @@ const UserLiveness = class {
9025
9115
  }
9026
9116
  }
9027
9117
  }
9118
+ async verificationFinished() {
9119
+ this.verificationReceived = Date.now();
9120
+ while (Date.now() - this.verificationReceived < 25000) {
9121
+ await delay(2000);
9122
+ let currentStatus = await TranslationUtils.ApiCall.instance.GetFlowState();
9123
+ if (currentStatus != TranslationUtils.state.flowStatus) {
9124
+ TranslationUtils.state.flowStatus = currentStatus;
9125
+ break;
9126
+ }
9127
+ }
9128
+ this.triggerErrorFlow();
9129
+ }
9028
9130
  async disconnectedCallback() {
9029
9131
  await BaseComponent.finalize(this.currentStep);
9030
9132
  }
@@ -14,7 +14,7 @@ const patchEsm = () => {
14
14
  const defineCustomElements = (win, options) => {
15
15
  if (typeof window === 'undefined') return Promise.resolve();
16
16
  return patchEsm().then(() => {
17
- return index.bootstrapLazy([["loader-dots.cjs",[[1,"loader-dots"]]],["random-actions.cjs",[[0,"random-actions"]]],["agreement-check_17.cjs",[[1,"identification-component",{"token":[1537],"order_id":[1537],"api_url":[1537],"env":[1537],"redirect_id":[1537],"phone_number":[1537],"lang_iso":[1537],"errorMessage":[32],"errorTitle":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"],[0,"apiError","apiErrorEmitter"],[9,"scroll","handleScroll"]]],[0,"process-id",{"mode":[1],"showTimeout":[32],"showInvalid":[32],"flow":[32]},[[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoIdCapture","captureIdImage"],[0,"recordingIdCapture","capturedIdRecording"]]],[0,"user-liveness",{"mode":[1],"showError":[32],"showTimeout":[32],"flow":[32],"howToDone":[32]},[[0,"howToInfoDone","howToDoneEvent"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoSelfieCapture","captureSelfieImage"],[0,"recordingSelfieCapture","capturedSelfieRecording"]]],[0,"agreement-info",{"agreementsChecked":[32],"termsChecked":[32],"openAgreements":[32],"openTerms":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"]]],[0,"camera-error",{"title":[32],"description":[32],"buttonDisabled":[32],"demoVideo":[32]}],[0,"end-redirect"],[0,"error-end",{"message":[1],"errorTitle":[1,"error-title"]}],[0,"landing-validation",{"warningText":[32],"buttonDisabled":[32]}],[0,"mobile-redirect",{"infoTextTop":[32],"infoTextBottom":[32],"contact":[32],"invalidValue":[32],"waitingMobile":[32],"orderStatus":[32],"redirectLink":[32],"qrCode":[32],"prefilledPhone":[32]}],[0,"sms-code-validation",{"title":[32],"details":[32],"buttonText":[32],"code":[32],"canSend":[32]}],[0,"sms-send",{"buttonText":[32],"title":[32],"phoneNumber":[32],"prefilledPhone":[32],"canSend":[32]}],[0,"id-capture",{"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"selfie-capture",{"videoStarted":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"demoEnded":[32],"demoVideo":[32],"captureHeight":[32],"captureWidth":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-check",{"agreementType":[1,"agreement-type"],"htmlContent":[32],"buttonEnabled":[32],"scrollClass":[32]}],[0,"capture-error",{"type":[1],"reason":[1],"buttonEnabled":[32],"buttonText":[32]}],[0,"how-to-info",{"topTitle":[32],"subTitle":[32],"imagePath":[32],"buttonText":[32],"buttonEnabled":[32]}],[0,"camera-comp",{"modelPath":[1,"model-path"],"probabilityThreshold":[2,"probability-threshold"],"captureMode":[1,"capture-mode"]}]]]], options);
17
+ return index.bootstrapLazy([["loader-dots.cjs",[[1,"loader-dots"]]],["random-actions.cjs",[[0,"random-actions"]]],["agreement-check_17.cjs",[[1,"identification-component",{"token":[1537],"order_id":[1537],"api_url":[1537],"env":[1537],"redirect_id":[1537],"phone_number":[1537],"lang_iso":[1537],"errorMessage":[32],"errorTitle":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"],[0,"apiError","apiErrorEmitter"],[9,"scroll","handleScroll"]]],[0,"process-id",{"mode":[1],"showTimeout":[32],"showInvalid":[32],"flow":[32]},[[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoIdCapture","captureIdImage"],[0,"recordingIdCapture","capturedIdRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"user-liveness",{"mode":[1],"showError":[32],"showTimeout":[32],"flow":[32],"howToDone":[32]},[[0,"howToInfoDone","howToDoneEvent"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoSelfieCapture","captureSelfieImage"],[0,"recordingSelfieCapture","capturedSelfieRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-info",{"agreementsChecked":[32],"termsChecked":[32],"openAgreements":[32],"openTerms":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"]]],[0,"camera-error",{"title":[32],"description":[32],"buttonDisabled":[32],"demoVideo":[32]}],[0,"end-redirect"],[0,"error-end",{"message":[1],"errorTitle":[1,"error-title"]}],[0,"landing-validation",{"warningText":[32],"buttonDisabled":[32]}],[0,"mobile-redirect",{"infoTextTop":[32],"infoTextBottom":[32],"contact":[32],"invalidValue":[32],"waitingMobile":[32],"orderStatus":[32],"redirectLink":[32],"qrCode":[32],"prefilledPhone":[32]}],[0,"sms-code-validation",{"title":[32],"details":[32],"buttonText":[32],"code":[32],"canSend":[32]}],[0,"sms-send",{"buttonText":[32],"title":[32],"details":[32],"phoneNumber":[32],"prefilledPhone":[32],"canSend":[32]}],[0,"id-capture",{"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"selfie-capture",{"videoStarted":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"demoEnded":[32],"demoVideo":[32],"captureHeight":[32],"captureWidth":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-check",{"agreementType":[1,"agreement-type"],"htmlContent":[32],"buttonEnabled":[32],"scrollClass":[32]}],[0,"capture-error",{"type":[1],"reason":[1],"buttonEnabled":[32],"buttonText":[32]}],[0,"how-to-info",{"topTitle":[32],"subTitle":[32],"imagePath":[32],"buttonText":[32],"buttonEnabled":[32]}],[0,"camera-comp",{"modelPath":[1,"model-path"],"probabilityThreshold":[2,"probability-threshold"],"captureMode":[1,"capture-mode"]}]]]], options);
18
18
  });
19
19
  };
20
20
 
@@ -17,7 +17,7 @@ const patchBrowser = () => {
17
17
  };
18
18
 
19
19
  patchBrowser().then(options => {
20
- return index.bootstrapLazy([["loader-dots.cjs",[[1,"loader-dots"]]],["random-actions.cjs",[[0,"random-actions"]]],["agreement-check_17.cjs",[[1,"identification-component",{"token":[1537],"order_id":[1537],"api_url":[1537],"env":[1537],"redirect_id":[1537],"phone_number":[1537],"lang_iso":[1537],"errorMessage":[32],"errorTitle":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"],[0,"apiError","apiErrorEmitter"],[9,"scroll","handleScroll"]]],[0,"process-id",{"mode":[1],"showTimeout":[32],"showInvalid":[32],"flow":[32]},[[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoIdCapture","captureIdImage"],[0,"recordingIdCapture","capturedIdRecording"]]],[0,"user-liveness",{"mode":[1],"showError":[32],"showTimeout":[32],"flow":[32],"howToDone":[32]},[[0,"howToInfoDone","howToDoneEvent"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoSelfieCapture","captureSelfieImage"],[0,"recordingSelfieCapture","capturedSelfieRecording"]]],[0,"agreement-info",{"agreementsChecked":[32],"termsChecked":[32],"openAgreements":[32],"openTerms":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"]]],[0,"camera-error",{"title":[32],"description":[32],"buttonDisabled":[32],"demoVideo":[32]}],[0,"end-redirect"],[0,"error-end",{"message":[1],"errorTitle":[1,"error-title"]}],[0,"landing-validation",{"warningText":[32],"buttonDisabled":[32]}],[0,"mobile-redirect",{"infoTextTop":[32],"infoTextBottom":[32],"contact":[32],"invalidValue":[32],"waitingMobile":[32],"orderStatus":[32],"redirectLink":[32],"qrCode":[32],"prefilledPhone":[32]}],[0,"sms-code-validation",{"title":[32],"details":[32],"buttonText":[32],"code":[32],"canSend":[32]}],[0,"sms-send",{"buttonText":[32],"title":[32],"phoneNumber":[32],"prefilledPhone":[32],"canSend":[32]}],[0,"id-capture",{"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"selfie-capture",{"videoStarted":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"demoEnded":[32],"demoVideo":[32],"captureHeight":[32],"captureWidth":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-check",{"agreementType":[1,"agreement-type"],"htmlContent":[32],"buttonEnabled":[32],"scrollClass":[32]}],[0,"capture-error",{"type":[1],"reason":[1],"buttonEnabled":[32],"buttonText":[32]}],[0,"how-to-info",{"topTitle":[32],"subTitle":[32],"imagePath":[32],"buttonText":[32],"buttonEnabled":[32]}],[0,"camera-comp",{"modelPath":[1,"model-path"],"probabilityThreshold":[2,"probability-threshold"],"captureMode":[1,"capture-mode"]}]]]], options);
20
+ return index.bootstrapLazy([["loader-dots.cjs",[[1,"loader-dots"]]],["random-actions.cjs",[[0,"random-actions"]]],["agreement-check_17.cjs",[[1,"identification-component",{"token":[1537],"order_id":[1537],"api_url":[1537],"env":[1537],"redirect_id":[1537],"phone_number":[1537],"lang_iso":[1537],"errorMessage":[32],"errorTitle":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"],[0,"apiError","apiErrorEmitter"],[9,"scroll","handleScroll"]]],[0,"process-id",{"mode":[1],"showTimeout":[32],"showInvalid":[32],"flow":[32]},[[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoIdCapture","captureIdImage"],[0,"recordingIdCapture","capturedIdRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"user-liveness",{"mode":[1],"showError":[32],"showTimeout":[32],"flow":[32],"howToDone":[32]},[[0,"howToInfoDone","howToDoneEvent"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoSelfieCapture","captureSelfieImage"],[0,"recordingSelfieCapture","capturedSelfieRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-info",{"agreementsChecked":[32],"termsChecked":[32],"openAgreements":[32],"openTerms":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"]]],[0,"camera-error",{"title":[32],"description":[32],"buttonDisabled":[32],"demoVideo":[32]}],[0,"end-redirect"],[0,"error-end",{"message":[1],"errorTitle":[1,"error-title"]}],[0,"landing-validation",{"warningText":[32],"buttonDisabled":[32]}],[0,"mobile-redirect",{"infoTextTop":[32],"infoTextBottom":[32],"contact":[32],"invalidValue":[32],"waitingMobile":[32],"orderStatus":[32],"redirectLink":[32],"qrCode":[32],"prefilledPhone":[32]}],[0,"sms-code-validation",{"title":[32],"details":[32],"buttonText":[32],"code":[32],"canSend":[32]}],[0,"sms-send",{"buttonText":[32],"title":[32],"details":[32],"phoneNumber":[32],"prefilledPhone":[32],"canSend":[32]}],[0,"id-capture",{"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"selfie-capture",{"videoStarted":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"demoEnded":[32],"demoVideo":[32],"captureHeight":[32],"captureWidth":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-check",{"agreementType":[1,"agreement-type"],"htmlContent":[32],"buttonEnabled":[32],"scrollClass":[32]}],[0,"capture-error",{"type":[1],"reason":[1],"buttonEnabled":[32],"buttonText":[32]}],[0,"how-to-info",{"topTitle":[32],"subTitle":[32],"imagePath":[32],"buttonText":[32],"buttonEnabled":[32]}],[0,"camera-comp",{"modelPath":[1,"model-path"],"probabilityThreshold":[2,"probability-threshold"],"captureMode":[1,"capture-mode"]}]]]], options);
21
21
  });
22
22
 
23
23
  exports.setNonce = index.setNonce;
@@ -36,7 +36,7 @@ export class CaptureError {
36
36
  this.eventCaptureErrorDone.emit();
37
37
  }
38
38
  render() {
39
- return (h("div", { class: "container" }, h("div", { class: "row" }, h("h1", { class: "color-red" }, this.titleR1), h("h1", { class: "color-red" }, this.titleR2), h("div", null, h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.reason), h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.descriptionR1), h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.descriptionR2)), h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", type: "button", disabled: !this.buttonEnabled, onClick: () => this.buttonClick() }, this.buttonText), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
39
+ return (h("div", { class: "container" }, h("div", { class: "row" }, h("h1", { class: "color-red" }, this.titleR1), h("h1", { class: "color-red" }, this.titleR2), h("div", null, h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.descriptionR1), h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.descriptionR2), h("p", { class: "font-size-1" }, this.reason)), h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", type: "button", disabled: !this.buttonEnabled, onClick: () => this.buttonClick() }, this.buttonText), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
40
40
  }
41
41
  static get is() { return "capture-error"; }
42
42
  static get originalStyleUrls() {
@@ -16,9 +16,6 @@ import { FlowStatus } from '../../../models/FlowStatus';
16
16
  export class IdCapture {
17
17
  // @State() private animationPath: string;
18
18
  constructor() {
19
- this.photoIsReady = (photos) => {
20
- this.eventPhotoCapture.emit(photos);
21
- };
22
19
  this.videoStarted = undefined;
23
20
  this.cameraSize = undefined;
24
21
  this.captureTaken = undefined;
@@ -36,12 +33,16 @@ export class IdCapture {
36
33
  this.cameraSize = event.detail;
37
34
  }
38
35
  async componentWillLoad() {
36
+ if (store.debug)
37
+ console.log('id-capture | componentWillLoad');
39
38
  this.translations = await Translations.getValues();
40
39
  if (!navigator.mediaDevices) {
41
40
  this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
42
41
  }
43
42
  }
44
43
  initVariables() {
44
+ if (store.debug)
45
+ console.log('id-capture | initVariables');
45
46
  if (store.flowStatus == FlowStatus.IDFRONT) {
46
47
  this.pose = IDPose.Straight;
47
48
  this.flowStep = FlowSteps.CiFrontCapture;
@@ -62,6 +63,8 @@ export class IdCapture {
62
63
  }
63
64
  }
64
65
  async componentDidLoad() {
66
+ if (store.debug)
67
+ console.log('id-capture | componentDidLoad');
65
68
  this.initVariables();
66
69
  await BaseComponent.logStep(this.flowStep, FlowMoments.Initialized);
67
70
  if (store.flowStatus == FlowStatus.IDBACK) {
@@ -77,11 +80,15 @@ export class IdCapture {
77
80
  this.openCamera();
78
81
  }
79
82
  async openCamera() {
83
+ if (store.debug)
84
+ console.log('id-capture | openCamera');
80
85
  const constraints = this.cameras.GetConstraints(store.cameraId, store.device);
81
86
  setTimeout(() => {
82
87
  navigator.mediaDevices
83
88
  .getUserMedia(constraints)
84
89
  .then(stream => {
90
+ if (store.debug)
91
+ console.log('id-capture | openCamera | streamObtained');
85
92
  const superStream = Stream.getNewInstance(this.verificationMode);
86
93
  superStream.initStream(stream);
87
94
  })
@@ -92,23 +99,31 @@ export class IdCapture {
92
99
  }, 100);
93
100
  }
94
101
  closeCamera() {
102
+ if (store.debug)
103
+ console.log('id-capture | closeCamera');
95
104
  if (Stream.instance) {
96
105
  Stream.instance.dropStream();
97
106
  }
98
107
  }
99
108
  disconnectedCallback() {
109
+ if (store.debug)
110
+ console.log('id-capture | disconnectedCallback');
100
111
  this.closeCamera();
101
112
  Stream.instance = null;
102
113
  IDML5Detector.instance = null;
103
114
  FaceML5Detector.instance = null;
104
115
  }
105
116
  async takePhoto() {
117
+ if (store.debug)
118
+ console.log('id-capture | takePhoto');
106
119
  if (this.captureTaken)
107
120
  return;
108
121
  this.captureTaken = true;
109
122
  if (Stream.instance) {
123
+ if (store.debug)
124
+ console.log('id-capture | takePhoto | sendingPhoto');
110
125
  let res = await Stream.instance.takePhoto();
111
- this.photoIsReady(res);
126
+ this.eventPhotoCapture.emit(res);
112
127
  }
113
128
  else {
114
129
  this.eventTimeElapsed.emit();
@@ -116,14 +131,16 @@ export class IdCapture {
116
131
  await BaseComponent.logStep(this.flowStep, FlowMoments.Finalized);
117
132
  }
118
133
  async verificationFinished() {
134
+ if (store.debug)
135
+ console.log('id-capture | verificationFinished');
119
136
  if (this.verified)
120
137
  return;
121
138
  this.verified = true;
122
139
  this.titleMesage = this.translations.IdCaptureValues.Loading;
123
140
  this.closeCamera();
124
141
  this.demoVideo.src = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_id.mp4';
125
- this.demoVideo.loop = true;
126
142
  this.showDemo = true;
143
+ this.demoVideo.loop = true;
127
144
  this.demoVideo.play();
128
145
  }
129
146
  render() {
@@ -32,6 +32,8 @@ export class Camera {
32
32
  this.captureMode = undefined;
33
33
  }
34
34
  componentDidLoad() {
35
+ if (store.debug)
36
+ console.log('camera | componentDidLoad');
35
37
  this.startStream();
36
38
  }
37
39
  render() {
@@ -48,6 +50,8 @@ export class Camera {
48
50
  return (h("div", { class: "camera" }, h("video", { id: "video", loop: true, autoplay: true, playsinline: true, muted: true, class: cameraVideoClass, ref: el => (this.cameraVideo = el) }), h("canvas", { id: "output", class: cameraCanvasClass, ref: el => (this.cameraCanvas = el) })));
49
51
  }
50
52
  startStream() {
53
+ if (store.debug)
54
+ console.log('camera | startStream');
51
55
  let verificationMode = [FlowStatus.IDTILT, FlowStatus.LIVENESSGESTURE].includes(store.flowStatus) ? VerificationMode.Tilt : VerificationMode.Full;
52
56
  const stream = Stream.getNewInstance(verificationMode);
53
57
  stream.updateHtmlElements(this.cameraVideo, this.cameraCanvas, this.component);