@ekyc_qoobiss/qbs-ect-cmp 3.2.1 → 3.2.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 (60) hide show
  1. package/dist/cjs/agreement-check_18.cjs.entry.js +379 -267
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/qbs-ect-cmp.cjs.js +1 -1
  4. package/dist/collection/components/base-component.js +48 -0
  5. package/dist/collection/components/common/camera-error/camera-error.js +9 -36
  6. package/dist/collection/components/common/id-back-capture/id-back-capture.js +2 -27
  7. package/dist/collection/components/common/id-capture/id-capture.js +2 -27
  8. package/dist/collection/components/common/selfie-capture/selfie-capture.js +4 -28
  9. package/dist/collection/components/controls/camera/camera.js +3 -23
  10. package/dist/collection/components/flow/agreement-info/agreement-info.js +6 -9
  11. package/dist/collection/components/flow/end-redirect/end-redirect.js +4 -9
  12. package/dist/collection/components/flow/id-double-side/id-double-side.js +31 -51
  13. package/dist/collection/components/flow/id-single-side/id-single-side.js +14 -42
  14. package/dist/collection/components/flow/landing-validation/landing-validation.js +19 -40
  15. package/dist/collection/components/flow/mobile-redirect/mobile-redirect.js +7 -10
  16. package/dist/collection/components/flow/sms-code-validation/sms-code-validation.js +12 -15
  17. package/dist/collection/components/flow/user-liveness/user-liveness.js +29 -49
  18. package/dist/collection/components/identification-component/identification-component.js +14 -15
  19. package/dist/collection/helpers/ApiCall.js +3 -3
  20. package/dist/collection/helpers/Cameras.js +3 -2
  21. package/dist/collection/helpers/DeviceDetection.js +83 -0
  22. package/dist/collection/helpers/Events.js +9 -0
  23. package/dist/collection/helpers/Stream.js +9 -8
  24. package/dist/collection/helpers/index.js +0 -33
  25. package/dist/collection/helpers/store.js +2 -0
  26. package/dist/collection/models/FlowSteps.js +19 -13
  27. package/dist/collection/models/IDevice.js +22 -1
  28. package/dist/collection/models/IEctStore.js +1 -0
  29. package/dist/esm/agreement-check_18.entry.js +379 -267
  30. package/dist/esm/loader.js +1 -1
  31. package/dist/esm/qbs-ect-cmp.js +1 -1
  32. package/dist/qbs-ect-cmp/{p-92eaaff9.entry.js → p-29f81591.entry.js} +2 -2
  33. package/dist/qbs-ect-cmp/qbs-ect-cmp.esm.js +1 -1
  34. package/dist/types/components/base-component.d.ts +14 -0
  35. package/dist/types/components/common/camera-error/camera-error.d.ts +1 -3
  36. package/dist/types/components/common/id-back-capture/id-back-capture.d.ts +0 -2
  37. package/dist/types/components/common/id-capture/id-capture.d.ts +0 -2
  38. package/dist/types/components/common/selfie-capture/selfie-capture.d.ts +0 -2
  39. package/dist/types/components/controls/camera/camera.d.ts +0 -2
  40. package/dist/types/components/flow/agreement-info/agreement-info.d.ts +3 -3
  41. package/dist/types/components/flow/end-redirect/end-redirect.d.ts +1 -1
  42. package/dist/types/components/flow/id-double-side/id-double-side.d.ts +4 -5
  43. package/dist/types/components/flow/id-single-side/id-single-side.d.ts +3 -5
  44. package/dist/types/components/flow/landing-validation/landing-validation.d.ts +2 -3
  45. package/dist/types/components/flow/mobile-redirect/mobile-redirect.d.ts +1 -1
  46. package/dist/types/components/flow/sms-code-validation/sms-code-validation.d.ts +2 -2
  47. package/dist/types/components/flow/user-liveness/user-liveness.d.ts +3 -4
  48. package/dist/types/components/identification-component/identification-component.d.ts +1 -2
  49. package/dist/types/components.d.ts +0 -19
  50. package/dist/types/helpers/ApiCall.d.ts +4 -4
  51. package/dist/types/helpers/Cameras.d.ts +4 -4
  52. package/dist/types/helpers/DeviceDetection.d.ts +18 -0
  53. package/dist/types/helpers/Events.d.ts +2 -0
  54. package/dist/types/helpers/Stream.d.ts +1 -3
  55. package/dist/types/helpers/index.d.ts +0 -2
  56. package/dist/types/helpers/store.d.ts +2 -17
  57. package/dist/types/models/FlowSteps.d.ts +18 -13
  58. package/dist/types/models/IDevice.d.ts +32 -9
  59. package/dist/types/models/IEctStore.d.ts +20 -0
  60. package/package.json +1 -1
@@ -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"]]],["agreement-check_18.cjs",[[1,"identification-component",{"token":[1537],"order_id":[1537],"api_url":[1537],"env":[1537],"redirect_id":[1537],"phone_number":[1537],"idSide":[32],"errorMessage":[32],"errorTitle":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"],[0,"apiError","apiErrorEmitter"]]],[0,"id-double-side",{"device":[16],"showTimeout":[32],"showInvalid":[32],"showHowTo":[32],"front":[32],"flow":[32]},[[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoIdCapture","captureIdImage"],[0,"photoIdBackCapture","captureIdBackImage"],[0,"recordingIdCapture","capturedIdRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"id-single-side",{"device":[16],"showTimeout":[32],"showHowTo":[32],"idFlow":[32]},[[0,"captureErrorDone","captureErrorDone"],[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"photoIdCapture","captureIdImage"],[0,"verificationFinished","verificationFinished"],[0,"recordingIdCapture","capturedIdRecording"]]],[0,"user-liveness",{"device":[16],"showError":[32],"showHowTo":[32],"selfieFlow":[32]},[[0,"howToInfoDone","howToDone"],[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",{"device":[16],"title":[32],"description":[32],"buttonDisabled":[32],"demoVideo":[32]}],[0,"end-redirect"],[0,"error-end",{"message":[1],"errorTitle":[1,"error-title"]}],[0,"landing-validation",{"device":[16],"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],"phoneNumber":[32],"code":[32],"prefilledPhone":[32],"canSend":[32]}],[0,"id-back-capture",{"device":[16],"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"verificationFinished","verificationFinished"],[0,"takePhoto","takePhoto"]]],[0,"selfie-capture",{"device":[16],"videoStarted":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"demoEnded":[32],"demoVideo":[32],"uploadingLink":[32],"captureHeight":[32],"captureWidth":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-check",{"agreementType":[1,"agreement-type"],"htmlContent":[32],"buttonEnabled":[32]}],[0,"id-capture",{"device":[16],"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"capture-error",{"type":[1],"buttonEnabled":[32],"buttonText":[32]}],[0,"how-to-info",{"idSide":[1,"id-side"],"topTitle":[32],"subTitle":[32],"imagePath":[32],"buttonText":[32],"buttonEnabled":[32]}],[0,"camera-comp",{"modelPath":[1,"model-path"],"device":[16],"probabilityThreshold":[2,"probability-threshold"],"captureMode":[1,"capture-mode"]}]]]], options);
17
+ return index.bootstrapLazy([["loader-dots.cjs",[[1,"loader-dots"]]],["agreement-check_18.cjs",[[1,"identification-component",{"token":[1537],"order_id":[1537],"api_url":[1537],"env":[1537],"redirect_id":[1537],"phone_number":[1537],"idSide":[32],"errorMessage":[32],"errorTitle":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"],[0,"apiError","apiErrorEmitter"]]],[0,"id-double-side",{"showTimeout":[32],"showInvalid":[32],"showHowTo":[32],"front":[32],"flow":[32]},[[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoIdCapture","captureIdImage"],[0,"photoIdBackCapture","captureIdBackImage"],[0,"recordingIdCapture","capturedIdRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"id-single-side",{"showTimeout":[32],"showHowTo":[32],"idFlow":[32]},[[0,"captureErrorDone","captureErrorDone"],[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"photoIdCapture","captureIdImage"],[0,"verificationFinished","verificationFinished"],[0,"recordingIdCapture","capturedIdRecording"]]],[0,"user-liveness",{"showError":[32],"showHowTo":[32],"selfieFlow":[32]},[[0,"howToInfoDone","howToDone"],[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],"phoneNumber":[32],"code":[32],"prefilledPhone":[32],"canSend":[32]}],[0,"id-back-capture",{"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"verificationFinished","verificationFinished"],[0,"takePhoto","takePhoto"]]],[0,"selfie-capture",{"videoStarted":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"demoEnded":[32],"demoVideo":[32],"uploadingLink":[32],"captureHeight":[32],"captureWidth":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-check",{"agreementType":[1,"agreement-type"],"htmlContent":[32],"buttonEnabled":[32]}],[0,"id-capture",{"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"capture-error",{"type":[1],"buttonEnabled":[32],"buttonText":[32]}],[0,"how-to-info",{"idSide":[1,"id-side"],"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"]]],["agreement-check_18.cjs",[[1,"identification-component",{"token":[1537],"order_id":[1537],"api_url":[1537],"env":[1537],"redirect_id":[1537],"phone_number":[1537],"idSide":[32],"errorMessage":[32],"errorTitle":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"],[0,"apiError","apiErrorEmitter"]]],[0,"id-double-side",{"device":[16],"showTimeout":[32],"showInvalid":[32],"showHowTo":[32],"front":[32],"flow":[32]},[[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoIdCapture","captureIdImage"],[0,"photoIdBackCapture","captureIdBackImage"],[0,"recordingIdCapture","capturedIdRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"id-single-side",{"device":[16],"showTimeout":[32],"showHowTo":[32],"idFlow":[32]},[[0,"captureErrorDone","captureErrorDone"],[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"photoIdCapture","captureIdImage"],[0,"verificationFinished","verificationFinished"],[0,"recordingIdCapture","capturedIdRecording"]]],[0,"user-liveness",{"device":[16],"showError":[32],"showHowTo":[32],"selfieFlow":[32]},[[0,"howToInfoDone","howToDone"],[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",{"device":[16],"title":[32],"description":[32],"buttonDisabled":[32],"demoVideo":[32]}],[0,"end-redirect"],[0,"error-end",{"message":[1],"errorTitle":[1,"error-title"]}],[0,"landing-validation",{"device":[16],"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],"phoneNumber":[32],"code":[32],"prefilledPhone":[32],"canSend":[32]}],[0,"id-back-capture",{"device":[16],"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"verificationFinished","verificationFinished"],[0,"takePhoto","takePhoto"]]],[0,"selfie-capture",{"device":[16],"videoStarted":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"demoEnded":[32],"demoVideo":[32],"uploadingLink":[32],"captureHeight":[32],"captureWidth":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-check",{"agreementType":[1,"agreement-type"],"htmlContent":[32],"buttonEnabled":[32]}],[0,"id-capture",{"device":[16],"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"capture-error",{"type":[1],"buttonEnabled":[32],"buttonText":[32]}],[0,"how-to-info",{"idSide":[1,"id-side"],"topTitle":[32],"subTitle":[32],"imagePath":[32],"buttonText":[32],"buttonEnabled":[32]}],[0,"camera-comp",{"modelPath":[1,"model-path"],"device":[16],"probabilityThreshold":[2,"probability-threshold"],"captureMode":[1,"capture-mode"]}]]]], options);
20
+ return index.bootstrapLazy([["loader-dots.cjs",[[1,"loader-dots"]]],["agreement-check_18.cjs",[[1,"identification-component",{"token":[1537],"order_id":[1537],"api_url":[1537],"env":[1537],"redirect_id":[1537],"phone_number":[1537],"idSide":[32],"errorMessage":[32],"errorTitle":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"],[0,"apiError","apiErrorEmitter"]]],[0,"id-double-side",{"showTimeout":[32],"showInvalid":[32],"showHowTo":[32],"front":[32],"flow":[32]},[[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoIdCapture","captureIdImage"],[0,"photoIdBackCapture","captureIdBackImage"],[0,"recordingIdCapture","capturedIdRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"id-single-side",{"showTimeout":[32],"showHowTo":[32],"idFlow":[32]},[[0,"captureErrorDone","captureErrorDone"],[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"photoIdCapture","captureIdImage"],[0,"verificationFinished","verificationFinished"],[0,"recordingIdCapture","capturedIdRecording"]]],[0,"user-liveness",{"showError":[32],"showHowTo":[32],"selfieFlow":[32]},[[0,"howToInfoDone","howToDone"],[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],"phoneNumber":[32],"code":[32],"prefilledPhone":[32],"canSend":[32]}],[0,"id-back-capture",{"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"verificationFinished","verificationFinished"],[0,"takePhoto","takePhoto"]]],[0,"selfie-capture",{"videoStarted":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"demoEnded":[32],"demoVideo":[32],"uploadingLink":[32],"captureHeight":[32],"captureWidth":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-check",{"agreementType":[1,"agreement-type"],"htmlContent":[32],"buttonEnabled":[32]}],[0,"id-capture",{"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"capture-error",{"type":[1],"buttonEnabled":[32],"buttonText":[32]}],[0,"how-to-info",{"idSide":[1,"id-side"],"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;
@@ -0,0 +1,48 @@
1
+ import { ApiCall } from '../helpers/ApiCall';
2
+ import { DeviceDetection } from '../helpers/DeviceDetection';
3
+ import Events from '../helpers/Events';
4
+ import store from '../helpers/store';
5
+ import { FlowMoments } from '../models/FlowSteps';
6
+ export class BaseComponent {
7
+ constructor(step) {
8
+ this.apiErrorEvent = null;
9
+ this.processError = null;
10
+ this.apiCall = new ApiCall();
11
+ if (step)
12
+ this.flowStep = step;
13
+ if (!store.device) {
14
+ store.device = new DeviceDetection().getDevice();
15
+ }
16
+ Events.init(window);
17
+ }
18
+ setEventEmitter(event) {
19
+ this.apiErrorEvent = event;
20
+ }
21
+ setErrorCallback(callback) {
22
+ this.processError = callback;
23
+ }
24
+ async initialize() {
25
+ Events.flowEvent(this.flowStep, FlowMoments.Initialized);
26
+ try {
27
+ await this.apiCall.AddStep(this.flowStep, FlowMoments.Initialized);
28
+ }
29
+ catch (e) {
30
+ if (this.apiErrorEvent)
31
+ this.apiErrorEvent.emit(e);
32
+ else
33
+ this.processError(e, FlowMoments.Initialized);
34
+ }
35
+ }
36
+ async finalize() {
37
+ Events.flowEvent(this.flowStep, FlowMoments.Finalized);
38
+ try {
39
+ await this.apiCall.AddStep(this.flowStep, FlowMoments.Finalized);
40
+ }
41
+ catch (e) {
42
+ if (this.apiErrorEvent)
43
+ this.apiErrorEvent.emit(e);
44
+ else
45
+ this.processError(e, FlowMoments.Initialized);
46
+ }
47
+ }
48
+ }
@@ -2,16 +2,17 @@ import { h } from '@stencil/core';
2
2
  import { CameraErrorValues, SessionKeys } from '../../../helpers/textValues';
3
3
  import store from '../../../helpers/store';
4
4
  import { FlowStatus } from '../../../models/FlowStatus';
5
- import { ApiCall } from '../../../helpers/ApiCall';
6
5
  import { FlowSteps } from '../../../models/FlowSteps';
6
+ import { MobileOS } from '../../../models/IDevice';
7
+ import { BaseComponent } from '../../base-component';
7
8
  export class CameraError {
8
9
  constructor() {
9
- this.device = undefined;
10
10
  this.title = undefined;
11
11
  this.description = undefined;
12
12
  this.buttonDisabled = undefined;
13
13
  this.demoVideo = undefined;
14
- this.apiCall = new ApiCall();
14
+ this.baseComponent = new BaseComponent(FlowSteps.CameraError);
15
+ this.baseComponent.setEventEmitter(this.apiErrorEvent);
15
16
  }
16
17
  async componentWillLoad() {
17
18
  this.buttonDisabled = false;
@@ -20,7 +21,8 @@ export class CameraError {
20
21
  this.buttonText = CameraErrorValues.Button;
21
22
  }
22
23
  async componentDidLoad() {
23
- if (!this.device.isIos) {
24
+ await this.baseComponent.initialize();
25
+ if (store.device.mobileOS != MobileOS.iOS) {
24
26
  this.demoVideo.src = CameraErrorValues.HowToLink;
25
27
  this.demoVideo.loop = true;
26
28
  this.demoVideo.play();
@@ -32,16 +34,11 @@ export class CameraError {
32
34
  store.flowStatus = FlowStatus.LANDING;
33
35
  }
34
36
  }
35
- try {
36
- await this.apiCall.AddStep(FlowSteps.CameraError);
37
- }
38
- catch (e) {
39
- this.apiErrorEvent.emit(e);
40
- }
41
37
  }
42
38
  async buttonClick() {
43
39
  this.buttonDisabled = true;
44
- if (this.device.isIos) {
40
+ await this.baseComponent.finalize();
41
+ if (store.device.mobileOS == MobileOS.iOS) {
45
42
  sessionStorage.setItem(SessionKeys.RefreshDoneKey, 'true');
46
43
  window.location.reload();
47
44
  }
@@ -50,7 +47,7 @@ export class CameraError {
50
47
  }
51
48
  }
52
49
  render() {
53
- return (h("div", { class: "container" }, h("div", { class: "row" }, h("h1", { class: "color-red" }, this.title), h("div", null, h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.description)), h("div", { hidden: this.device.isIos }, h("video", { id: "howtoPermissions", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, h("source", { type: "video/mp4" }))), h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", type: "button", disabled: this.buttonDisabled, onClick: () => this.buttonClick() }, this.buttonText), h("p", { class: "main-text font-size-18 text-right mb-0" }, CameraErrorValues.FooterText))))));
50
+ return (h("div", { class: "container" }, h("div", { class: "row" }, h("h1", { class: "color-red" }, this.title), h("div", null, h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.description)), h("div", { hidden: store.device.mobileOS == MobileOS.iOS }, h("video", { id: "howtoPermissions", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, h("source", { type: "video/mp4" }))), h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", type: "button", disabled: this.buttonDisabled, onClick: () => this.buttonClick() }, this.buttonText), h("p", { class: "main-text font-size-18 text-right mb-0" }, CameraErrorValues.FooterText))))));
54
51
  }
55
52
  static get is() { return "camera-error"; }
56
53
  static get originalStyleUrls() {
@@ -63,30 +60,6 @@ export class CameraError {
63
60
  "$": ["camera-error.css"]
64
61
  };
65
62
  }
66
- static get properties() {
67
- return {
68
- "device": {
69
- "type": "unknown",
70
- "mutable": false,
71
- "complexType": {
72
- "original": "Device",
73
- "resolved": "Device",
74
- "references": {
75
- "Device": {
76
- "location": "import",
77
- "path": "../../../models/IDevice"
78
- }
79
- }
80
- },
81
- "required": false,
82
- "optional": false,
83
- "docs": {
84
- "tags": [],
85
- "text": ""
86
- }
87
- }
88
- };
89
- }
90
63
  static get states() {
91
64
  return {
92
65
  "title": {},
@@ -16,7 +16,6 @@ export class IdBackCapture {
16
16
  //this.closeCamera();
17
17
  this.eventPhotoCapture.emit(photos);
18
18
  };
19
- this.device = undefined;
20
19
  this.videoStarted = undefined;
21
20
  this.cameraSize = undefined;
22
21
  this.captureTaken = undefined;
@@ -61,7 +60,7 @@ export class IdBackCapture {
61
60
  this.openCamera();
62
61
  }
63
62
  async openCamera() {
64
- var constraints = this.cameras.GetConstraints(store.cameraId, this.device);
63
+ var constraints = this.cameras.GetConstraints(store.cameraId, store.device);
65
64
  setTimeout(() => {
66
65
  navigator.mediaDevices
67
66
  .getUserMedia(constraints)
@@ -114,7 +113,7 @@ export class IdBackCapture {
114
113
  let titleClass = this.verified ? 'color-black-2 text-center' : 'color-white text-center';
115
114
  //let videoClass = this.device.isMobile ? '' : 'video-demo';
116
115
  let bgDemo = this.verified ? 'container' : 'container bg-black';
117
- return (h("div", { class: bgDemo }, h("div", { class: "container-video" }, h("div", { hidden: this.showDemo == false }, h("video", { id: "howtoBack", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, h("source", { type: "video/mp4" }))), h("div", { hidden: this.showDemo }, h("div", { hidden: this.verified }, h("div", { class: "video-capture" }, h("div", { style: cameraStyle }, h("div", { style: cameraStyleInner }, h("camera-comp", { device: this.device, "capture-mode": "id" })))))), h("div", { class: "capture-title" }, h("h1", { class: titleClass }, this.titleMesage), h("p", { class: "main-text font-size-18 text-right mb-0" }, IdCaptureValues.FooterText)))));
116
+ return (h("div", { class: bgDemo }, h("div", { class: "container-video" }, h("div", { hidden: this.showDemo == false }, h("video", { id: "howtoBack", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, h("source", { type: "video/mp4" }))), h("div", { hidden: this.showDemo }, h("div", { hidden: this.verified }, h("div", { class: "video-capture" }, h("div", { style: cameraStyle }, h("div", { style: cameraStyleInner }, h("camera-comp", { "capture-mode": "id" })))))), h("div", { class: "capture-title" }, h("h1", { class: titleClass }, this.titleMesage), h("p", { class: "main-text font-size-18 text-right mb-0" }, IdCaptureValues.FooterText)))));
118
117
  }
119
118
  static get is() { return "id-back-capture"; }
120
119
  static get originalStyleUrls() {
@@ -127,30 +126,6 @@ export class IdBackCapture {
127
126
  "$": ["id-back-capture.css"]
128
127
  };
129
128
  }
130
- static get properties() {
131
- return {
132
- "device": {
133
- "type": "unknown",
134
- "mutable": false,
135
- "complexType": {
136
- "original": "Device",
137
- "resolved": "Device",
138
- "references": {
139
- "Device": {
140
- "location": "import",
141
- "path": "../../../models/IDevice"
142
- }
143
- }
144
- },
145
- "required": false,
146
- "optional": false,
147
- "docs": {
148
- "tags": [],
149
- "text": ""
150
- }
151
- }
152
- };
153
- }
154
129
  static get states() {
155
130
  return {
156
131
  "videoStarted": {},
@@ -16,7 +16,6 @@ export class IdCapture {
16
16
  //this.closeCamera();
17
17
  this.eventPhotoCapture.emit(photos);
18
18
  };
19
- this.device = undefined;
20
19
  this.videoStarted = undefined;
21
20
  this.cameraSize = undefined;
22
21
  this.captureTaken = undefined;
@@ -57,7 +56,7 @@ export class IdCapture {
57
56
  this.openCamera();
58
57
  }
59
58
  async openCamera() {
60
- var constraints = this.cameras.GetConstraints(store.cameraId, this.device);
59
+ var constraints = this.cameras.GetConstraints(store.cameraId, store.device);
61
60
  setTimeout(() => {
62
61
  navigator.mediaDevices
63
62
  .getUserMedia(constraints)
@@ -115,7 +114,7 @@ export class IdCapture {
115
114
  let titleClass = this.verified ? 'color-black-2 text-center' : 'color-white text-center';
116
115
  //let videoClass = this.device.isMobile ? '' : 'video-demo';
117
116
  let bgDemo = this.verified ? 'container' : 'container bg-black';
118
- return (h("div", { class: bgDemo }, h("div", { class: "container-video" }, h("div", { hidden: this.showDemo == false }, h("video", { id: "howtoFront", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, h("source", { type: "video/mp4" }))), h("div", { hidden: this.showDemo }, h("div", { hidden: this.verified }, h("div", { class: "video-capture" }, h("div", { style: cameraStyle }, h("div", { style: cameraStyleInner }, h("camera-comp", { device: this.device, "capture-mode": "id" })))))), h("div", { class: "capture-title" }, h("h1", { class: titleClass }, this.titleMesage), h("p", { class: "main-text font-size-18 text-right mb-0" }, IdCaptureValues.FooterText)))));
117
+ return (h("div", { class: bgDemo }, h("div", { class: "container-video" }, h("div", { hidden: this.showDemo == false }, h("video", { id: "howtoFront", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, h("source", { type: "video/mp4" }))), h("div", { hidden: this.showDemo }, h("div", { hidden: this.verified }, h("div", { class: "video-capture" }, h("div", { style: cameraStyle }, h("div", { style: cameraStyleInner }, h("camera-comp", { "capture-mode": "id" })))))), h("div", { class: "capture-title" }, h("h1", { class: titleClass }, this.titleMesage), h("p", { class: "main-text font-size-18 text-right mb-0" }, IdCaptureValues.FooterText)))));
119
118
  }
120
119
  static get is() { return "id-capture"; }
121
120
  static get originalStyleUrls() {
@@ -128,30 +127,6 @@ export class IdCapture {
128
127
  "$": ["id-capture.css"]
129
128
  };
130
129
  }
131
- static get properties() {
132
- return {
133
- "device": {
134
- "type": "unknown",
135
- "mutable": false,
136
- "complexType": {
137
- "original": "Device",
138
- "resolved": "Device",
139
- "references": {
140
- "Device": {
141
- "location": "import",
142
- "path": "../../../models/IDevice"
143
- }
144
- }
145
- },
146
- "required": false,
147
- "optional": false,
148
- "docs": {
149
- "tags": [],
150
- "text": ""
151
- }
152
- }
153
- };
154
- }
155
130
  static get states() {
156
131
  return {
157
132
  "videoStarted": {},
@@ -6,6 +6,7 @@ import { SelfieCaptureValues } from '../../../helpers/textValues';
6
6
  import { FaceML5Detector } from '../../../libs/FaceML5Detector/FaceML5Detector';
7
7
  import { FacePose } from '../../../libs/FaceML5Detector/FacePose';
8
8
  import { delay } from '../../../utils/utils';
9
+ import store from '../../../helpers/store';
9
10
  export class SelfieCapture {
10
11
  // @State() private animationPath: string;
11
12
  constructor() {
@@ -13,7 +14,6 @@ export class SelfieCapture {
13
14
  //this.closeCamera();
14
15
  this.eventPhotoCapture.emit(photos);
15
16
  };
16
- this.device = undefined;
17
17
  this.videoStarted = undefined;
18
18
  this.captureTaken = undefined;
19
19
  this.verified = undefined;
@@ -66,7 +66,7 @@ export class SelfieCapture {
66
66
  this.openCamera();
67
67
  }
68
68
  async openCamera() {
69
- const constraints = this.cameras.GetConstraints('', this.device, true);
69
+ const constraints = this.cameras.GetConstraints('', store.device, true);
70
70
  setTimeout(() => {
71
71
  navigator.mediaDevices
72
72
  .getUserMedia(constraints)
@@ -110,7 +110,7 @@ export class SelfieCapture {
110
110
  }
111
111
  render() {
112
112
  let cameraStyle;
113
- if (this.device.isMobile && this.videoStarted) {
113
+ if (store.device.isMobile && this.videoStarted) {
114
114
  cameraStyle = {
115
115
  'width': this.captureWidth + 'px',
116
116
  'height': this.captureHeight + 'px',
@@ -123,7 +123,7 @@ export class SelfieCapture {
123
123
  let titleClass = this.verified ? 'color-black-2 text-center' : 'color-white text-center';
124
124
  //let videoClass = this.device.isMobile ? '' : 'video-demo';
125
125
  let bgDemo = this.verified ? 'container' : 'container bg-black';
126
- return (h("div", { class: bgDemo }, h("div", { class: "container-video" }, h("div", { hidden: this.demoEnded }, h("video", { id: "howtoSelfie", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, h("source", { type: "video/mp4" }))), h("div", { hidden: this.demoEnded == false }, h("div", { hidden: this.verified }, h("div", { class: "video-capture" }, h("div", { style: cameraStyle }, h("camera-comp", { device: this.device, "capture-mode": "selfie" }))))), h("div", { class: "capture-title" }, h("h1", { class: titleClass }, this.titleMesage), h("p", { class: "main-text font-size-18 text-right mb-0" }, SelfieCaptureValues.FooterText)))));
126
+ return (h("div", { class: bgDemo }, h("div", { class: "container-video" }, h("div", { hidden: this.demoEnded }, h("video", { id: "howtoSelfie", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, h("source", { type: "video/mp4" }))), h("div", { hidden: this.demoEnded == false }, h("div", { hidden: this.verified }, h("div", { class: "video-capture" }, h("div", { style: cameraStyle }, h("camera-comp", { "capture-mode": "selfie" }))))), h("div", { class: "capture-title" }, h("h1", { class: titleClass }, this.titleMesage), h("p", { class: "main-text font-size-18 text-right mb-0" }, SelfieCaptureValues.FooterText)))));
127
127
  }
128
128
  static get is() { return "selfie-capture"; }
129
129
  static get originalStyleUrls() {
@@ -136,30 +136,6 @@ export class SelfieCapture {
136
136
  "$": ["selfie-capture.css"]
137
137
  };
138
138
  }
139
- static get properties() {
140
- return {
141
- "device": {
142
- "type": "unknown",
143
- "mutable": false,
144
- "complexType": {
145
- "original": "Device",
146
- "resolved": "Device",
147
- "references": {
148
- "Device": {
149
- "location": "import",
150
- "path": "../../../models/IDevice"
151
- }
152
- }
153
- },
154
- "required": false,
155
- "optional": false,
156
- "docs": {
157
- "tags": [],
158
- "text": ""
159
- }
160
- }
161
- };
162
- }
163
139
  static get states() {
164
140
  return {
165
141
  "videoStarted": {},
@@ -1,5 +1,6 @@
1
1
  import { Stream } from '../../../helpers/Stream';
2
2
  import { h } from '@stencil/core';
3
+ import store from '../../../helpers/store';
3
4
  // import { PipelineResult } from '../../../libs/FaceDetector/PipelineResult';
4
5
  export class Camera {
5
6
  constructor() {
@@ -37,7 +38,6 @@ export class Camera {
37
38
  this.verificationFinished.emit();
38
39
  };
39
40
  this.modelPath = undefined;
40
- this.device = undefined;
41
41
  this.probabilityThreshold = undefined;
42
42
  this.captureMode = undefined;
43
43
  }
@@ -47,7 +47,7 @@ export class Camera {
47
47
  render() {
48
48
  let cameraVideoClass = 'cameraVideo';
49
49
  let cameraCanvasClass = 'cameraCanvas';
50
- if (this.device.isWin) {
50
+ if (store.device.isDesktop) {
51
51
  cameraVideoClass = 'cameraVideoSelfieDesk';
52
52
  cameraCanvasClass = 'cameraCanvasSelfieDesk';
53
53
  }
@@ -59,7 +59,7 @@ export class Camera {
59
59
  }
60
60
  startStream() {
61
61
  if (!Stream.instance)
62
- Stream.getInstance(this.device, this.modelPath);
62
+ Stream.getInstance(this.modelPath);
63
63
  const stream = Stream.getInstance();
64
64
  stream.updateHtmlElements(this.cameraVideo, this.cameraCanvas, this.component);
65
65
  if (this.captureMode == 'selfie') {
@@ -111,26 +111,6 @@ export class Camera {
111
111
  "attribute": "model-path",
112
112
  "reflect": false
113
113
  },
114
- "device": {
115
- "type": "unknown",
116
- "mutable": false,
117
- "complexType": {
118
- "original": "Device",
119
- "resolved": "Device",
120
- "references": {
121
- "Device": {
122
- "location": "import",
123
- "path": "../../../models/IDevice"
124
- }
125
- }
126
- },
127
- "required": false,
128
- "optional": false,
129
- "docs": {
130
- "tags": [],
131
- "text": ""
132
- }
133
- },
134
114
  "probabilityThreshold": {
135
115
  "type": "number",
136
116
  "mutable": false,
@@ -3,31 +3,28 @@ import store from '../../../helpers/store';
3
3
  import { AgreementInfoValues } from '../../../helpers/textValues';
4
4
  import { FlowStatus } from '../../../models/FlowStatus';
5
5
  import { FlowSteps } from '../../../models/FlowSteps';
6
- import { ApiCall } from '../../../helpers/ApiCall';
6
+ import { BaseComponent } from '../../base-component';
7
7
  export class AgreementInfo {
8
8
  constructor() {
9
9
  this.agreementsChecked = undefined;
10
10
  this.termsChecked = undefined;
11
11
  this.openAgreements = undefined;
12
12
  this.openTerms = undefined;
13
+ this.baseComponent = new BaseComponent(FlowSteps.Agreements);
14
+ this.baseComponent.setEventEmitter(this.apiErrorEvent);
13
15
  this.agreementsChecked = false;
14
16
  this.termsChecked = false;
15
- this.apiCall = new ApiCall();
16
17
  }
17
18
  async componentDidLoad() {
18
- try {
19
- await this.apiCall.AddStep(FlowSteps.Agreements);
20
- }
21
- catch (e) {
22
- this.apiErrorEvent.emit(e);
23
- }
19
+ await this.baseComponent.initialize();
24
20
  }
25
21
  componentWillLoad() {
26
22
  this.openAgreements = false;
27
23
  this.openTerms = false;
28
24
  }
29
- buttonClick() {
25
+ async buttonClick() {
30
26
  if (this.agreementsChecked && this.termsChecked) {
27
+ await this.baseComponent.finalize();
31
28
  store.flowStatus = FlowStatus.PHONE;
32
29
  }
33
30
  }
@@ -4,22 +4,17 @@ import { CompleteValues } from '../../../helpers/textValues';
4
4
  import completeImg from '../../../assets/complete.svg';
5
5
  import store from '../../../helpers/store';
6
6
  import Events from '../../../helpers/Events';
7
- import { ApiCall } from '../../../helpers/ApiCall';
8
7
  import { FlowSteps } from '../../../models/FlowSteps';
8
+ import { BaseComponent } from '../../base-component';
9
9
  export class EndRedirect {
10
10
  constructor() {
11
- this.apiCall = new ApiCall();
11
+ this.baseComponent = new BaseComponent(FlowSteps.End);
12
+ this.baseComponent.setEventEmitter(this.apiErrorEvent);
12
13
  }
13
14
  async componentDidLoad() {
14
- Events.init(window);
15
15
  Events.flowCompleted();
16
16
  if (store.environment !== 'DEMO') {
17
- try {
18
- await this.apiCall.AddStep(FlowSteps.End);
19
- }
20
- catch (e) {
21
- this.apiErrorEvent.emit(e);
22
- }
17
+ await this.baseComponent.initialize();
23
18
  }
24
19
  }
25
20
  render() {