@ekyc_qoobiss/qbs-ect-cmp 3.3.0 → 3.3.2

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.
Files changed (35) hide show
  1. package/dist/cjs/agreement-check_18.cjs.entry.js +101 -31
  2. package/dist/collection/components/common/camera-error/camera-error.js +3 -1
  3. package/dist/collection/components/common/id-back-capture/id-back-capture.js +17 -4
  4. package/dist/collection/components/common/id-capture/id-capture.js +17 -4
  5. package/dist/collection/components/common/selfie-capture/selfie-capture.js +17 -4
  6. package/dist/collection/components/flow/agreement-info/agreement-info.js +3 -1
  7. package/dist/collection/components/flow/error-end/error-end.js +1 -5
  8. package/dist/collection/components/flow/id-double-side/id-double-side.js +3 -1
  9. package/dist/collection/components/flow/id-single-side/id-single-side.js +3 -1
  10. package/dist/collection/components/flow/landing-validation/landing-validation.js +3 -2
  11. package/dist/collection/components/flow/mobile-redirect/mobile-redirect.js +3 -1
  12. package/dist/collection/components/flow/sms-code-validation/sms-code-validation.js +3 -1
  13. package/dist/collection/components/flow/user-liveness/user-liveness.js +3 -1
  14. package/dist/collection/components/identification-component/identification-component.js +11 -3
  15. package/dist/collection/helpers/ApiCall.js +53 -5
  16. package/dist/collection/helpers/DeviceDetection.js +2 -0
  17. package/dist/collection/models/IDevice.js +1 -0
  18. package/dist/esm/agreement-check_18.entry.js +101 -31
  19. package/dist/qbs-ect-cmp/{p-01d8fff0.entry.js → p-5c7d0547.entry.js} +2 -2
  20. package/dist/qbs-ect-cmp/qbs-ect-cmp.esm.js +1 -1
  21. package/dist/types/components/common/camera-error/camera-error.d.ts +1 -0
  22. package/dist/types/components/common/id-back-capture/id-back-capture.d.ts +1 -0
  23. package/dist/types/components/common/id-capture/id-capture.d.ts +1 -0
  24. package/dist/types/components/common/selfie-capture/selfie-capture.d.ts +1 -0
  25. package/dist/types/components/flow/agreement-info/agreement-info.d.ts +1 -0
  26. package/dist/types/components/flow/id-double-side/id-double-side.d.ts +1 -0
  27. package/dist/types/components/flow/id-single-side/id-single-side.d.ts +1 -0
  28. package/dist/types/components/flow/landing-validation/landing-validation.d.ts +1 -0
  29. package/dist/types/components/flow/mobile-redirect/mobile-redirect.d.ts +1 -0
  30. package/dist/types/components/flow/sms-code-validation/sms-code-validation.d.ts +1 -0
  31. package/dist/types/components/flow/user-liveness/user-liveness.d.ts +1 -0
  32. package/dist/types/components.d.ts +3 -0
  33. package/dist/types/helpers/ApiCall.d.ts +1 -0
  34. package/dist/types/models/IDevice.d.ts +1 -0
  35. package/package.json +1 -1
@@ -439,6 +439,30 @@ class ApiCall {
439
439
  });
440
440
  this.urls = new ApiUrls();
441
441
  }
442
+ async http2(method, url, data) {
443
+ return new Promise((resolve, reject) => {
444
+ var xhr = new XMLHttpRequest();
445
+ xhr.open(method, url);
446
+ xhr.onload = function () {
447
+ if (xhr.status >= 200 && xhr.status < 300) {
448
+ resolve(xhr.response);
449
+ }
450
+ else {
451
+ reject({
452
+ status: xhr.status,
453
+ statusText: xhr.statusText,
454
+ });
455
+ }
456
+ };
457
+ xhr.onerror = function () {
458
+ reject({
459
+ status: xhr.status,
460
+ statusText: xhr.statusText,
461
+ });
462
+ };
463
+ xhr.send(data);
464
+ });
465
+ }
442
466
  async http(request) {
443
467
  const response = await fetch(request);
444
468
  if (!response.ok) {
@@ -453,23 +477,47 @@ class ApiCall {
453
477
  }
454
478
  }
455
479
  async post(url, data) {
456
- return await this.http(new Request(state.apiBaseUrl + url, {
480
+ var request = new Request(state.apiBaseUrl + url, {
457
481
  method: 'POST',
458
482
  body: data,
459
483
  headers: {
460
484
  'Content-Type': 'application/json',
461
485
  'Authorization': 'IDKYC-TOKEN ' + state.token,
462
486
  },
463
- }));
487
+ });
488
+ try {
489
+ return await this.http(request);
490
+ }
491
+ catch (ex) {
492
+ this.AddLog('Error in post ', ex);
493
+ try {
494
+ return await this.http(request);
495
+ }
496
+ catch (ex2) {
497
+ return await this.http2('POST', state.apiBaseUrl + url, data);
498
+ }
499
+ }
464
500
  }
465
501
  async get(url) {
466
- return await this.http(new Request(state.apiBaseUrl + url, {
502
+ var request = new Request(state.apiBaseUrl + url, {
467
503
  method: 'GET',
468
504
  headers: {
469
505
  'Content-Type': 'application/json',
470
506
  'Authorization': 'IDKYC-TOKEN ' + state.token,
471
507
  },
472
- }));
508
+ });
509
+ try {
510
+ return await this.http(request);
511
+ }
512
+ catch (ex) {
513
+ this.AddLog('Error in get ', ex);
514
+ try {
515
+ return await this.http(request);
516
+ }
517
+ catch (ex2) {
518
+ return await this.http2('GET', state.apiBaseUrl + url, '');
519
+ }
520
+ }
473
521
  }
474
522
  async SendOTPCode(requestId, phoneNumber) {
475
523
  let data = { requestId: requestId, phone: phoneNumber };
@@ -542,7 +590,7 @@ class ApiCall {
542
590
  let data = {
543
591
  requestId: state.requestId,
544
592
  action: FlowStatus[state.flowStatus],
545
- message: `${JSON.stringify(error !== null && error !== void 0 ? error : 'no error data')} | ${JSON.stringify(context !== null && context !== void 0 ? context : 'no context data')}`,
593
+ message: JSON.stringify({ error, context }),
546
594
  };
547
595
  let result = await this.post(this.urls.AddLog, JSON.stringify(data));
548
596
  return result.saved;
@@ -612,6 +660,7 @@ var Browser;
612
660
  Browser["Chrome"] = "chrome";
613
661
  Browser["Firefox"] = "firefox";
614
662
  Browser["Safari"] = "safari";
663
+ Browser["Mi"] = "mi";
615
664
  Browser["Unknown"] = "unknown";
616
665
  })(Browser || (Browser = {}));
617
666
 
@@ -676,6 +725,8 @@ class DeviceDetection {
676
725
  return Browser.Firefox;
677
726
  else if (!isChrome && /safari/i.test(navigator.userAgent))
678
727
  return Browser.Safari;
728
+ else if (!isChrome && / Mi /i.test(navigator.userAgent))
729
+ return Browser.Mi;
679
730
  else
680
731
  return Browser.Unknown;
681
732
  }
@@ -823,9 +874,11 @@ const AgreementInfo = class {
823
874
  this.openAgreements = false;
824
875
  this.openTerms = false;
825
876
  }
877
+ disconnectedCallback() {
878
+ this.baseComponent.finalize();
879
+ }
826
880
  async buttonClick() {
827
881
  if (this.agreementsChecked && this.termsChecked) {
828
- await this.baseComponent.finalize();
829
882
  state.flowStatus = FlowStatus.PHONE;
830
883
  }
831
884
  }
@@ -5429,9 +5482,11 @@ const CameraError = class {
5429
5482
  }
5430
5483
  }
5431
5484
  }
5485
+ disconnectedCallback() {
5486
+ this.baseComponent.finalize();
5487
+ }
5432
5488
  async buttonClick() {
5433
5489
  this.buttonDisabled = true;
5434
- await this.baseComponent.finalize();
5435
5490
  if (state.device.mobileOS == MobileOS.iOS) {
5436
5491
  sessionStorage.setItem(SessionKeys.RefreshDoneKey, 'true');
5437
5492
  window.location.reload();
@@ -5520,10 +5575,7 @@ const ErrorEnd = class {
5520
5575
  this.message = undefined;
5521
5576
  this.errorTitle = undefined;
5522
5577
  }
5523
- componentDidLoad() {
5524
- Events.init(window);
5525
- Events.flowError(this.errorTitle + ' ' + this.message);
5526
- }
5578
+ componentDidLoad() { }
5527
5579
  render() {
5528
5580
  return (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("div", { class: "text-center" }, index.h("h1", null, this.errorTitle)), index.h("div", { class: "text-center" }, index.h("p", null, state.requestId)), index.h("div", null, index.h("p", { class: "color-red font-weight-bold font-size-2 text-center mt-10" }, this.message)))));
5529
5581
  }
@@ -5703,6 +5755,7 @@ const IdBackCapture = class {
5703
5755
  constructor(hostRef) {
5704
5756
  index.registerInstance(this, hostRef);
5705
5757
  this.eventPhotoCapture = index.createEvent(this, "photoIdBackCapture", 7);
5758
+ this.apiErrorEvent = index.createEvent(this, "apiError", 7);
5706
5759
  this.photoIsReady = photos => {
5707
5760
  //this.closeCamera();
5708
5761
  this.eventPhotoCapture.emit(photos);
@@ -5732,10 +5785,9 @@ const IdBackCapture = class {
5732
5785
  this.cameraSize = event.detail;
5733
5786
  }
5734
5787
  async componentWillLoad() {
5735
- Events.init(this.component);
5736
5788
  //this.videoDemoStyle = this.device.isMobile ? { width: window.screen.width + 'px', height: window.screen.height + 'px', 'object-fit': 'fill' } : {};
5737
5789
  if (!navigator.mediaDevices) {
5738
- Events.flowError('This browser does not support webRTC');
5790
+ this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
5739
5791
  }
5740
5792
  }
5741
5793
  async componentDidLoad() {
@@ -5761,7 +5813,7 @@ const IdBackCapture = class {
5761
5813
  })
5762
5814
  .catch(e => {
5763
5815
  this.closeCamera();
5764
- Events.flowError(e);
5816
+ this.apiErrorEvent.emit(e);
5765
5817
  });
5766
5818
  }, 100);
5767
5819
  }
@@ -5817,6 +5869,7 @@ const IdCapture = class {
5817
5869
  constructor(hostRef) {
5818
5870
  index.registerInstance(this, hostRef);
5819
5871
  this.eventPhotoCapture = index.createEvent(this, "photoIdCapture", 7);
5872
+ this.apiErrorEvent = index.createEvent(this, "apiError", 7);
5820
5873
  this.photoIsReady = photos => {
5821
5874
  //this.closeCamera();
5822
5875
  this.eventPhotoCapture.emit(photos);
@@ -5846,11 +5899,10 @@ const IdCapture = class {
5846
5899
  this.cameraSize = event.detail;
5847
5900
  }
5848
5901
  async componentWillLoad() {
5849
- Events.init(this.component);
5850
5902
  this.titleMesage = IdCaptureValues.Title;
5851
5903
  //this.videoDemoStyle = this.device.isMobile ? { 'width': window.screen.width + 'px', 'height': window.screen.height + 'px', 'object-fit': 'fill' } : {};
5852
5904
  if (!navigator.mediaDevices) {
5853
- Events.flowError('This browser does not support webRTC');
5905
+ this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
5854
5906
  }
5855
5907
  }
5856
5908
  async componentDidLoad() {
@@ -5871,7 +5923,7 @@ const IdCapture = class {
5871
5923
  })
5872
5924
  .catch(e => {
5873
5925
  this.closeCamera();
5874
- Events.flowError(e);
5926
+ this.apiErrorEvent.emit(e);
5875
5927
  });
5876
5928
  }, 100);
5877
5929
  }
@@ -6091,9 +6143,11 @@ const IdDoubleSide = class {
6091
6143
  return;
6092
6144
  }
6093
6145
  state.recordingRetryCount = 0;
6094
- await this.baseComponent.finalize();
6095
6146
  state.flowStatus = FlowStatus.LIVENESS;
6096
6147
  }
6148
+ disconnectedCallback() {
6149
+ this.baseComponent.finalize();
6150
+ }
6097
6151
  switchCamera() {
6098
6152
  if (this.captureRetryCount == 1) {
6099
6153
  let camIndex = state.cameraIds.indexOf(state.cameraId);
@@ -6222,9 +6276,11 @@ const IdSingleSide = class {
6222
6276
  if (!this.idFlow.verificationFinished) {
6223
6277
  return;
6224
6278
  }
6225
- await this.baseComponent.finalize();
6226
6279
  state.flowStatus = FlowStatus.LIVENESS;
6227
6280
  }
6281
+ disconnectedCallback() {
6282
+ this.baseComponent.finalize();
6283
+ }
6228
6284
  switchCamera() {
6229
6285
  if (this.captureRetryCount == 1) {
6230
6286
  let camIndex = state.cameraIds.indexOf(state.cameraId);
@@ -6310,7 +6366,7 @@ function v4(options, buf, offset) {
6310
6366
  }
6311
6367
 
6312
6368
  const name = "@ekyc_qoobiss/qbs-ect-cmp";
6313
- const version$1 = "3.3.0";
6369
+ const version$1 = "3.3.2";
6314
6370
  const description = "Person Identification Component";
6315
6371
  const main = "./dist/index.cjs.js";
6316
6372
  const module$1 = "./dist/index.js";
@@ -6468,8 +6524,11 @@ const IdentificationComponent = class {
6468
6524
  else {
6469
6525
  this.errorTitle = data;
6470
6526
  }
6471
- await this.baseComponent.apiCall.AddLog(apiLogData, getLogMessage(this.order_id, this.redirect_id, this.token));
6472
- Events.flowError(data);
6527
+ try {
6528
+ await this.baseComponent.apiCall.AddLog(apiLogData, getLogMessage(this.order_id, this.redirect_id, this.token));
6529
+ }
6530
+ catch (_c) { }
6531
+ Events.flowError(this.errorTitle);
6473
6532
  state.flowStatus = FlowStatus.ERROREND;
6474
6533
  }
6475
6534
  constructor(hostRef) {
@@ -6574,10 +6633,14 @@ const IdentificationComponent = class {
6574
6633
  }
6575
6634
  try {
6576
6635
  if (state.debug)
6577
- this.baseComponent.apiCall.AddLog('init log', this.logInit);
6636
+ this.baseComponent.apiCall.AddLog({ phase: 'debug mode' }, this.logInit);
6578
6637
  }
6579
6638
  catch (_a) { }
6580
6639
  try {
6640
+ if (state.device.browser == Browser.Mi) {
6641
+ this.apiErrorEmitter('Mi Browser nu este acceptat. Va rugam utilizati Chrome.', 'Request Initialisation RequestId:' + state.requestId + ' RedirectId:' + state.redirectId);
6642
+ return;
6643
+ }
6581
6644
  if (!state.device.isMobile && state.redirectId == '') {
6582
6645
  state.redirectId = v4();
6583
6646
  this.redirect_id = state.redirectId;
@@ -6693,7 +6756,6 @@ const LandingValidation = class {
6693
6756
  state.flowStatus = FlowStatus.COMPLETE;
6694
6757
  return;
6695
6758
  }
6696
- await this.baseComponent.finalize();
6697
6759
  if (!(await Cameras.InitCameras(state.device))) {
6698
6760
  if (state.device.mobileOS == MobileOS.iOS)
6699
6761
  sessionStorage.setItem(SessionKeys.RefreshDoneKey, 'false');
@@ -6710,13 +6772,15 @@ const LandingValidation = class {
6710
6772
  }
6711
6773
  }
6712
6774
  }
6775
+ disconnectedCallback() {
6776
+ this.baseComponent.finalize();
6777
+ }
6713
6778
  async leaveFlow() {
6714
6779
  if (this.buttonDisabled)
6715
6780
  return;
6716
6781
  state.initialised = false;
6717
6782
  try {
6718
6783
  await this.baseComponent.apiCall.AbortRequest();
6719
- await this.baseComponent.finalize();
6720
6784
  Events.flowAborted();
6721
6785
  }
6722
6786
  catch (e) {
@@ -9655,7 +9719,6 @@ const MobileRedirect = class {
9655
9719
  this.orderStatus = await this.baseComponent.apiCall.GetStatus(state.requestId);
9656
9720
  if (this.orderStatus == OrderStatuses.FinishedCapturing) {
9657
9721
  this.waitingMobile = false;
9658
- await this.baseComponent.finalize();
9659
9722
  state.flowStatus = FlowStatus.COMPLETE;
9660
9723
  }
9661
9724
  if (this.orderStatus == OrderStatuses.NotFound) {
@@ -9671,6 +9734,9 @@ const MobileRedirect = class {
9671
9734
  Events.flowAborted();
9672
9735
  }
9673
9736
  }
9737
+ disconnectedCallback() {
9738
+ this.baseComponent.finalize();
9739
+ }
9674
9740
  async buttonClick() {
9675
9741
  if (this.contact == '' || this.contact.length != 10) {
9676
9742
  return;
@@ -9706,6 +9772,7 @@ const SelfieCapture = class {
9706
9772
  constructor(hostRef) {
9707
9773
  index.registerInstance(this, hostRef);
9708
9774
  this.eventPhotoCapture = index.createEvent(this, "photoSelfieCapture", 7);
9775
+ this.apiErrorEvent = index.createEvent(this, "apiError", 7);
9709
9776
  this.photoIsReady = photos => {
9710
9777
  //this.closeCamera();
9711
9778
  this.eventPhotoCapture.emit(photos);
@@ -9747,11 +9814,10 @@ const SelfieCapture = class {
9747
9814
  this.captureWidth = Math.round((this.captureHeight * 9) / 16);
9748
9815
  }
9749
9816
  componentWillLoad() {
9750
- Events.init(this.component);
9751
9817
  this.titleMesage = SelfieCaptureValues.Title;
9752
9818
  //this.videoDemoStyle = this.device.isMobile ? { 'width': window.screen.width + 'px', 'height': window.screen.height + 'px', 'object-fit': 'fill' } : {};
9753
9819
  if (!navigator.mediaDevices) {
9754
- Events.flowError('This browser does not support webRTC');
9820
+ this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
9755
9821
  }
9756
9822
  }
9757
9823
  async componentDidLoad() {
@@ -9772,7 +9838,7 @@ const SelfieCapture = class {
9772
9838
  })
9773
9839
  .catch(e => {
9774
9840
  this.closeCamera();
9775
- Events.flowError(e);
9841
+ this.apiErrorEvent.emit(e);
9776
9842
  });
9777
9843
  }, 100);
9778
9844
  }
@@ -9849,7 +9915,6 @@ const SmsCodeValidation = class {
9849
9915
  async doAction() {
9850
9916
  try {
9851
9917
  this.canSend = false;
9852
- await this.baseComponent.finalize();
9853
9918
  if (state.flowStatus == FlowStatus.CODE || state.flowStatus == FlowStatus.CODEERROR) {
9854
9919
  var codeChecked = await this.baseComponent.apiCall.CheckOTPCode(state.requestId, this.code);
9855
9920
  if (codeChecked === true) {
@@ -9870,6 +9935,9 @@ const SmsCodeValidation = class {
9870
9935
  this.apiErrorEvent.emit(e);
9871
9936
  }
9872
9937
  }
9938
+ disconnectedCallback() {
9939
+ this.baseComponent.finalize();
9940
+ }
9873
9941
  componentWillRender() {
9874
9942
  if (state.flowStatus == FlowStatus.PHONE) {
9875
9943
  this.title = PhoneValidationValues.Title;
@@ -9999,6 +10067,9 @@ const UserLiveness = class {
9999
10067
  this.selfieFlow.verificationFinished = true;
10000
10068
  await this.endFlow();
10001
10069
  }
10070
+ disconnectedCallback() {
10071
+ this.baseComponent.finalize();
10072
+ }
10002
10073
  async uploadPhoto() {
10003
10074
  if (this.selfieFlow.photoFile == null || this.selfieFlow.photoDone) {
10004
10075
  return;
@@ -10039,7 +10110,6 @@ const UserLiveness = class {
10039
10110
  return;
10040
10111
  }
10041
10112
  state.recordingRetryCount = 0;
10042
- await this.baseComponent.finalize();
10043
10113
  state.flowStatus = FlowStatus.COMPLETE;
10044
10114
  }
10045
10115
  render() {
@@ -35,9 +35,11 @@ export class CameraError {
35
35
  }
36
36
  }
37
37
  }
38
+ disconnectedCallback() {
39
+ this.baseComponent.finalize();
40
+ }
38
41
  async buttonClick() {
39
42
  this.buttonDisabled = true;
40
- await this.baseComponent.finalize();
41
43
  if (store.device.mobileOS == MobileOS.iOS) {
42
44
  sessionStorage.setItem(SessionKeys.RefreshDoneKey, 'true');
43
45
  window.location.reload();
@@ -1,5 +1,4 @@
1
1
  import { h } from '@stencil/core';
2
- import Events from '../../../helpers/Events';
3
2
  import { Cameras } from '../../../helpers/Cameras';
4
3
  import { Stream } from '../../../helpers/Stream';
5
4
  import { IdCaptureValues } from '../../../helpers/textValues';
@@ -41,10 +40,9 @@ export class IdBackCapture {
41
40
  this.cameraSize = event.detail;
42
41
  }
43
42
  async componentWillLoad() {
44
- Events.init(this.component);
45
43
  //this.videoDemoStyle = this.device.isMobile ? { width: window.screen.width + 'px', height: window.screen.height + 'px', 'object-fit': 'fill' } : {};
46
44
  if (!navigator.mediaDevices) {
47
- Events.flowError('This browser does not support webRTC');
45
+ this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
48
46
  }
49
47
  }
50
48
  async componentDidLoad() {
@@ -70,7 +68,7 @@ export class IdBackCapture {
70
68
  })
71
69
  .catch(e => {
72
70
  this.closeCamera();
73
- Events.flowError(e);
71
+ this.apiErrorEvent.emit(e);
74
72
  });
75
73
  }, 100);
76
74
  }
@@ -153,6 +151,21 @@ export class IdBackCapture {
153
151
  "resolved": "any",
154
152
  "references": {}
155
153
  }
154
+ }, {
155
+ "method": "apiErrorEvent",
156
+ "name": "apiError",
157
+ "bubbles": true,
158
+ "cancelable": true,
159
+ "composed": true,
160
+ "docs": {
161
+ "tags": [],
162
+ "text": ""
163
+ },
164
+ "complexType": {
165
+ "original": "any",
166
+ "resolved": "any",
167
+ "references": {}
168
+ }
156
169
  }];
157
170
  }
158
171
  static get elementRef() { return "component"; }
@@ -1,5 +1,4 @@
1
1
  import { h } from '@stencil/core';
2
- import Events from '../../../helpers/Events';
3
2
  import { Cameras } from '../../../helpers/Cameras';
4
3
  import { Stream } from '../../../helpers/Stream';
5
4
  import { IdCaptureValues } from '../../../helpers/textValues';
@@ -41,11 +40,10 @@ export class IdCapture {
41
40
  this.cameraSize = event.detail;
42
41
  }
43
42
  async componentWillLoad() {
44
- Events.init(this.component);
45
43
  this.titleMesage = IdCaptureValues.Title;
46
44
  //this.videoDemoStyle = this.device.isMobile ? { 'width': window.screen.width + 'px', 'height': window.screen.height + 'px', 'object-fit': 'fill' } : {};
47
45
  if (!navigator.mediaDevices) {
48
- Events.flowError('This browser does not support webRTC');
46
+ this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
49
47
  }
50
48
  }
51
49
  async componentDidLoad() {
@@ -66,7 +64,7 @@ export class IdCapture {
66
64
  })
67
65
  .catch(e => {
68
66
  this.closeCamera();
69
- Events.flowError(e);
67
+ this.apiErrorEvent.emit(e);
70
68
  });
71
69
  }, 100);
72
70
  }
@@ -154,6 +152,21 @@ export class IdCapture {
154
152
  "resolved": "any",
155
153
  "references": {}
156
154
  }
155
+ }, {
156
+ "method": "apiErrorEvent",
157
+ "name": "apiError",
158
+ "bubbles": true,
159
+ "cancelable": true,
160
+ "composed": true,
161
+ "docs": {
162
+ "tags": [],
163
+ "text": ""
164
+ },
165
+ "complexType": {
166
+ "original": "any",
167
+ "resolved": "any",
168
+ "references": {}
169
+ }
157
170
  }];
158
171
  }
159
172
  static get elementRef() { return "component"; }
@@ -1,5 +1,4 @@
1
1
  import { h } from '@stencil/core';
2
- import Events from '../../../helpers/Events';
3
2
  import { Cameras } from '../../../helpers/Cameras';
4
3
  import { Stream } from '../../../helpers/Stream';
5
4
  import { SelfieCaptureValues } from '../../../helpers/textValues';
@@ -51,11 +50,10 @@ export class SelfieCapture {
51
50
  this.captureWidth = Math.round((this.captureHeight * 9) / 16);
52
51
  }
53
52
  componentWillLoad() {
54
- Events.init(this.component);
55
53
  this.titleMesage = SelfieCaptureValues.Title;
56
54
  //this.videoDemoStyle = this.device.isMobile ? { 'width': window.screen.width + 'px', 'height': window.screen.height + 'px', 'object-fit': 'fill' } : {};
57
55
  if (!navigator.mediaDevices) {
58
- Events.flowError('This browser does not support webRTC');
56
+ this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
59
57
  }
60
58
  }
61
59
  async componentDidLoad() {
@@ -76,7 +74,7 @@ export class SelfieCapture {
76
74
  })
77
75
  .catch(e => {
78
76
  this.closeCamera();
79
- Events.flowError(e);
77
+ this.apiErrorEvent.emit(e);
80
78
  });
81
79
  }, 100);
82
80
  }
@@ -165,6 +163,21 @@ export class SelfieCapture {
165
163
  "resolved": "any",
166
164
  "references": {}
167
165
  }
166
+ }, {
167
+ "method": "apiErrorEvent",
168
+ "name": "apiError",
169
+ "bubbles": true,
170
+ "cancelable": true,
171
+ "composed": true,
172
+ "docs": {
173
+ "tags": [],
174
+ "text": ""
175
+ },
176
+ "complexType": {
177
+ "original": "any",
178
+ "resolved": "any",
179
+ "references": {}
180
+ }
168
181
  }];
169
182
  }
170
183
  static get elementRef() { return "component"; }
@@ -22,9 +22,11 @@ export class AgreementInfo {
22
22
  this.openAgreements = false;
23
23
  this.openTerms = false;
24
24
  }
25
+ disconnectedCallback() {
26
+ this.baseComponent.finalize();
27
+ }
25
28
  async buttonClick() {
26
29
  if (this.agreementsChecked && this.termsChecked) {
27
- await this.baseComponent.finalize();
28
30
  store.flowStatus = FlowStatus.PHONE;
29
31
  }
30
32
  }
@@ -1,15 +1,11 @@
1
1
  import { h } from '@stencil/core';
2
- import Events from '../../../helpers/Events';
3
2
  import store from '../../../helpers/store';
4
3
  export class ErrorEnd {
5
4
  constructor() {
6
5
  this.message = undefined;
7
6
  this.errorTitle = undefined;
8
7
  }
9
- componentDidLoad() {
10
- Events.init(window);
11
- Events.flowError(this.errorTitle + ' ' + this.message);
12
- }
8
+ componentDidLoad() { }
13
9
  render() {
14
10
  return (h("div", { class: "container" }, h("div", { class: "row" }, h("div", { class: "text-center" }, h("h1", null, this.errorTitle)), h("div", { class: "text-center" }, h("p", null, store.requestId)), h("div", null, h("p", { class: "color-red font-weight-bold font-size-2 text-center mt-10" }, this.message)))));
15
11
  }
@@ -168,9 +168,11 @@ export class IdDoubleSide {
168
168
  return;
169
169
  }
170
170
  store.recordingRetryCount = 0;
171
- await this.baseComponent.finalize();
172
171
  store.flowStatus = FlowStatus.LIVENESS;
173
172
  }
173
+ disconnectedCallback() {
174
+ this.baseComponent.finalize();
175
+ }
174
176
  switchCamera() {
175
177
  if (this.captureRetryCount == 1) {
176
178
  let camIndex = store.cameraIds.indexOf(store.cameraId);
@@ -110,9 +110,11 @@ export class IdSingleSide {
110
110
  if (!this.idFlow.verificationFinished) {
111
111
  return;
112
112
  }
113
- await this.baseComponent.finalize();
114
113
  store.flowStatus = FlowStatus.LIVENESS;
115
114
  }
115
+ disconnectedCallback() {
116
+ this.baseComponent.finalize();
117
+ }
116
118
  switchCamera() {
117
119
  if (this.captureRetryCount == 1) {
118
120
  let camIndex = store.cameraIds.indexOf(store.cameraId);
@@ -50,7 +50,6 @@ export class LandingValidation {
50
50
  store.flowStatus = FlowStatus.COMPLETE;
51
51
  return;
52
52
  }
53
- await this.baseComponent.finalize();
54
53
  if (!(await Cameras.InitCameras(store.device))) {
55
54
  if (store.device.mobileOS == MobileOS.iOS)
56
55
  sessionStorage.setItem(SessionKeys.RefreshDoneKey, 'false');
@@ -67,13 +66,15 @@ export class LandingValidation {
67
66
  }
68
67
  }
69
68
  }
69
+ disconnectedCallback() {
70
+ this.baseComponent.finalize();
71
+ }
70
72
  async leaveFlow() {
71
73
  if (this.buttonDisabled)
72
74
  return;
73
75
  store.initialised = false;
74
76
  try {
75
77
  await this.baseComponent.apiCall.AbortRequest();
76
- await this.baseComponent.finalize();
77
78
  Events.flowAborted();
78
79
  }
79
80
  catch (e) {
@@ -56,7 +56,6 @@ export class MobileRedirect {
56
56
  this.orderStatus = await this.baseComponent.apiCall.GetStatus(store.requestId);
57
57
  if (this.orderStatus == OrderStatuses.FinishedCapturing) {
58
58
  this.waitingMobile = false;
59
- await this.baseComponent.finalize();
60
59
  store.flowStatus = FlowStatus.COMPLETE;
61
60
  }
62
61
  if (this.orderStatus == OrderStatuses.NotFound) {
@@ -72,6 +71,9 @@ export class MobileRedirect {
72
71
  Events.flowAborted();
73
72
  }
74
73
  }
74
+ disconnectedCallback() {
75
+ this.baseComponent.finalize();
76
+ }
75
77
  async buttonClick() {
76
78
  if (this.contact == '' || this.contact.length != 10) {
77
79
  this.invalidValue == true;
@@ -24,7 +24,6 @@ export class SmsCodeValidation {
24
24
  async doAction() {
25
25
  try {
26
26
  this.canSend = false;
27
- await this.baseComponent.finalize();
28
27
  if (store.flowStatus == FlowStatus.CODE || store.flowStatus == FlowStatus.CODEERROR) {
29
28
  var codeChecked = await this.baseComponent.apiCall.CheckOTPCode(store.requestId, this.code);
30
29
  if (codeChecked === true) {
@@ -45,6 +44,9 @@ export class SmsCodeValidation {
45
44
  this.apiErrorEvent.emit(e);
46
45
  }
47
46
  }
47
+ disconnectedCallback() {
48
+ this.baseComponent.finalize();
49
+ }
48
50
  componentWillRender() {
49
51
  if (store.flowStatus == FlowStatus.PHONE) {
50
52
  this.title = PhoneValidationValues.Title;
@@ -77,6 +77,9 @@ export class UserLiveness {
77
77
  this.selfieFlow.verificationFinished = true;
78
78
  await this.endFlow();
79
79
  }
80
+ disconnectedCallback() {
81
+ this.baseComponent.finalize();
82
+ }
80
83
  async uploadPhoto() {
81
84
  if (this.selfieFlow.photoFile == null || this.selfieFlow.photoDone) {
82
85
  return;
@@ -117,7 +120,6 @@ export class UserLiveness {
117
120
  return;
118
121
  }
119
122
  store.recordingRetryCount = 0;
120
- await this.baseComponent.finalize();
121
123
  store.flowStatus = FlowStatus.COMPLETE;
122
124
  }
123
125
  render() {