@ekyc_qoobiss/qbs-ect-cmp 3.6.27 → 3.6.28

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 (148) hide show
  1. package/dist/cjs/agreement-check_19.cjs.entry.js +9498 -0
  2. package/dist/cjs/base-component-aa9e52bf.js +832 -0
  3. package/dist/cjs/index-41696e0e.js +1573 -0
  4. package/dist/cjs/index.cjs.js +2 -0
  5. package/dist/cjs/loader-dots.cjs.entry.js +19 -0
  6. package/dist/cjs/loader.cjs.js +22 -0
  7. package/dist/cjs/qbs-ect-cmp.cjs.js +23 -0
  8. package/dist/cjs/random-actions.cjs.entry.js +23 -0
  9. package/dist/collection/assets/canvas-masks/face_green.svg +8 -0
  10. package/dist/collection/assets/canvas-masks/face_white.svg +8 -0
  11. package/dist/collection/assets/canvas-masks/id_green.svg +6 -0
  12. package/dist/collection/assets/canvas-masks/id_white.svg +6 -0
  13. package/dist/collection/assets/complete.svg +4 -0
  14. package/dist/collection/assets/landing/device.svg +14 -0
  15. package/dist/collection/assets/landing/id.svg +3 -0
  16. package/dist/collection/assets/landing/info.svg +3 -0
  17. package/dist/collection/assets/landing/validation.svg +16 -0
  18. package/dist/collection/assets/loader.svg +29 -0
  19. package/dist/collection/collection-manifest.json +32 -0
  20. package/dist/collection/components/base-component.js +63 -0
  21. package/dist/collection/components/common/agreement-check/agreement-check.css +0 -0
  22. package/dist/collection/components/common/agreement-check/agreement-check.js +104 -0
  23. package/dist/collection/components/common/camera-error/camera-error.css +0 -0
  24. package/dist/{qbs-ect-cmp/camera-error.entry.js → collection/components/common/camera-error/camera-error.js} +52 -20
  25. package/dist/collection/components/common/capture-error/capture-error.css +0 -0
  26. package/dist/{qbs-ect-cmp/capture-error.entry.js → collection/components/common/capture-error/capture-error.js} +63 -16
  27. package/dist/collection/components/common/how-to-info/how-to-info.css +0 -0
  28. package/dist/collection/components/common/how-to-info/how-to-info.js +121 -0
  29. package/dist/collection/components/common/id-back-capture/id-back-capture.css +35 -0
  30. package/dist/{qbs-ect-cmp/id-back-capture.entry.js → collection/components/common/id-back-capture/id-back-capture.js} +94 -24
  31. package/dist/collection/components/common/id-capture/id-capture.css +35 -0
  32. package/dist/{qbs-ect-cmp/id-capture.entry.js → collection/components/common/id-capture/id-capture.js} +94 -24
  33. package/dist/collection/components/common/id-tilt/id-tilt.css +35 -0
  34. package/dist/{qbs-ect-cmp/id-tilt.entry.js → collection/components/common/id-tilt/id-tilt.js} +94 -24
  35. package/dist/collection/components/common/random-actions/random-actions.css +0 -0
  36. package/dist/collection/components/common/random-actions/random-actions.js +24 -0
  37. package/dist/collection/components/common/selfie-capture/selfie-capture.css +7 -0
  38. package/dist/{qbs-ect-cmp/selfie-capture.entry.js → collection/components/common/selfie-capture/selfie-capture.js} +95 -24
  39. package/dist/collection/components/common/selfie-tilt/selfie-tilt.css +7 -0
  40. package/dist/{qbs-ect-cmp/selfie-tilt.entry.js → collection/components/common/selfie-tilt/selfie-tilt.js} +95 -24
  41. package/dist/collection/components/controls/camera/camera.css +47 -0
  42. package/dist/collection/components/controls/camera/camera.js +289 -0
  43. package/dist/collection/components/controls/loader-dots/loader-dots.css +61 -0
  44. package/dist/collection/components/controls/loader-dots/loader-dots.js +18 -0
  45. package/dist/collection/components/flow/agreement-info/agreement-info.css +0 -0
  46. package/dist/{qbs-ect-cmp/agreement-info.entry.js → collection/components/flow/agreement-info/agreement-info.js} +57 -18
  47. package/dist/collection/components/flow/end-redirect/end-redirect.css +128 -0
  48. package/dist/collection/components/flow/end-redirect/end-redirect.js +47 -0
  49. package/dist/collection/components/flow/error-end/error-end.css +0 -0
  50. package/dist/collection/components/flow/error-end/error-end.js +61 -0
  51. package/dist/collection/components/flow/landing-validation/landing-validation.css +0 -0
  52. package/dist/collection/components/flow/landing-validation/landing-validation.js +122 -0
  53. package/dist/collection/components/flow/mobile-redirect/mobile-redirect.css +10 -0
  54. package/dist/collection/components/flow/mobile-redirect/mobile-redirect.js +143 -0
  55. package/dist/collection/components/flow/process-id/process-id.css +0 -0
  56. package/dist/{qbs-ect-cmp/process-id.entry.js → collection/components/flow/process-id/process-id.js} +100 -32
  57. package/dist/collection/components/flow/sms-code-validation/sms-code-validation.css +0 -0
  58. package/dist/{qbs-ect-cmp/sms-code-validation.entry.js → collection/components/flow/sms-code-validation/sms-code-validation.js} +63 -30
  59. package/dist/collection/components/flow/user-liveness/user-liveness.css +0 -0
  60. package/dist/{qbs-ect-cmp/user-liveness.entry.js → collection/components/flow/user-liveness/user-liveness.js} +91 -25
  61. package/dist/collection/components/identification-component/identification-component.css +991 -0
  62. package/dist/collection/components/identification-component/identification-component.js +408 -0
  63. package/dist/collection/global.js +0 -0
  64. package/dist/collection/helpers/ApiCall.js +223 -0
  65. package/dist/{qbs-ect-cmp/Cameras-dfbebc29.js → collection/helpers/Cameras.js} +6 -9
  66. package/dist/collection/helpers/DeviceDetection.js +85 -0
  67. package/dist/collection/helpers/Events.js +58 -0
  68. package/dist/collection/helpers/ML5.js +38 -0
  69. package/dist/collection/helpers/Stream.js +229 -0
  70. package/dist/collection/helpers/TranslationUtils.js +37 -0
  71. package/dist/collection/helpers/canvas.js +10 -0
  72. package/dist/collection/helpers/index.js +21 -0
  73. package/dist/collection/helpers/security.js +25 -0
  74. package/dist/collection/helpers/store.js +48 -0
  75. package/dist/collection/helpers/textValues.js +48 -0
  76. package/dist/collection/index.js +1 -0
  77. package/dist/collection/libs/FaceML5Detector/FaceML5Detector.js +182 -0
  78. package/dist/collection/libs/FaceML5Detector/FacePose.js +85 -0
  79. package/dist/collection/libs/IDML5Detector/IDML5Detector.js +99 -0
  80. package/dist/{qbs-ect-cmp/IDPose-181bcb25.js → collection/libs/IDML5Detector/IDPose.js} +2 -4
  81. package/dist/{qbs-ect-cmp/CaptureFlow-db5d90a4.js → collection/models/CaptureFlow.js} +4 -6
  82. package/dist/collection/models/FlowStatus.js +14 -0
  83. package/dist/collection/models/FlowSteps.js +30 -0
  84. package/dist/collection/models/IAbortResult.js +1 -0
  85. package/dist/collection/models/IAddRequest.js +1 -0
  86. package/dist/collection/models/IAgreement.js +1 -0
  87. package/dist/collection/models/ICamera.js +1 -0
  88. package/dist/{qbs-ect-cmp/IDevice-15ecfdeb.js → collection/models/IDevice.js} +4 -6
  89. package/dist/collection/models/IEctStore.js +1 -0
  90. package/dist/collection/models/IGeneration.js +1 -0
  91. package/dist/collection/models/ILinkSend.js +1 -0
  92. package/dist/collection/models/ILogResult.js +1 -0
  93. package/dist/collection/models/IOrderStatus.js +1 -0
  94. package/dist/collection/models/IOtpCheck.js +1 -0
  95. package/dist/collection/models/IOtpSend.js +1 -0
  96. package/dist/collection/models/ITranslationValues.js +1 -0
  97. package/dist/collection/models/IUploadFile.js +1 -0
  98. package/dist/collection/models/IVerificationMode.js +5 -0
  99. package/dist/collection/models/OrderStatuses.js +8 -0
  100. package/dist/{qbs-ect-cmp/utils-8225f0b7.js → collection/utils/utils.js} +8 -10
  101. package/dist/esm/agreement-check_19.entry.js +9476 -0
  102. package/dist/{qbs-ect-cmp/base-component-2e490fd9.js → esm/base-component-b7f50d31.js} +384 -62
  103. package/dist/esm/index-cf54a432.js +1543 -0
  104. package/dist/esm/index.js +1 -0
  105. package/dist/{qbs-ect-cmp → esm}/loader-dots.entry.js +1 -1
  106. package/dist/esm/loader.js +18 -0
  107. package/dist/esm/polyfills/core-js.js +11 -0
  108. package/dist/esm/polyfills/css-shim.js +1 -0
  109. package/dist/esm/polyfills/dom.js +79 -0
  110. package/dist/esm/polyfills/es5-html-element.js +1 -0
  111. package/dist/esm/polyfills/index.js +34 -0
  112. package/dist/esm/polyfills/system.js +6 -0
  113. package/dist/esm/qbs-ect-cmp.js +18 -0
  114. package/dist/{qbs-ect-cmp → esm}/random-actions.entry.js +2 -4
  115. package/dist/index.cjs.js +1 -0
  116. package/dist/index.js +1 -0
  117. package/dist/loader/cdn.js +3 -0
  118. package/dist/loader/index.cjs.js +3 -0
  119. package/dist/loader/index.d.ts +21 -0
  120. package/dist/loader/index.es2017.js +3 -0
  121. package/dist/loader/index.js +4 -0
  122. package/dist/loader/package.json +11 -0
  123. package/dist/qbs-ect-cmp/index.esm.js +0 -1
  124. package/dist/qbs-ect-cmp/p-054dc5b3.entry.js +1 -0
  125. package/dist/qbs-ect-cmp/p-215a7e76.entry.js +1 -0
  126. package/dist/qbs-ect-cmp/p-7bedffaa.js +1 -0
  127. package/dist/qbs-ect-cmp/p-8942656c.js +2 -0
  128. package/dist/qbs-ect-cmp/p-c32a782a.entry.js +1373 -0
  129. package/dist/qbs-ect-cmp/qbs-ect-cmp.css +1 -320
  130. package/dist/qbs-ect-cmp/qbs-ect-cmp.esm.js +1 -148
  131. package/package.json +1 -1
  132. package/dist/qbs-ect-cmp/ML5-657ef934.js +0 -1370
  133. package/dist/qbs-ect-cmp/Stream-b867a2be.js +0 -3104
  134. package/dist/qbs-ect-cmp/_commonjsHelpers-321aa363.js +0 -44
  135. package/dist/qbs-ect-cmp/agreement-check.entry.js +0 -41
  136. package/dist/qbs-ect-cmp/app-globals-0f993ce5.js +0 -3
  137. package/dist/qbs-ect-cmp/camera-comp.entry.js +0 -103
  138. package/dist/qbs-ect-cmp/css-shim-b7d3d95f.js +0 -4
  139. package/dist/qbs-ect-cmp/dom-64053c71.js +0 -73
  140. package/dist/qbs-ect-cmp/end-redirect.entry.js +0 -25
  141. package/dist/qbs-ect-cmp/error-end.entry.js +0 -19
  142. package/dist/qbs-ect-cmp/how-to-info.entry.js +0 -52
  143. package/dist/qbs-ect-cmp/identification-component.entry.js +0 -909
  144. package/dist/qbs-ect-cmp/index-78a05b9e.js +0 -3371
  145. package/dist/qbs-ect-cmp/landing-validation.entry.js +0 -90
  146. package/dist/qbs-ect-cmp/mobile-redirect.entry.js +0 -2984
  147. package/dist/qbs-ect-cmp/shadow-css-98135883.js +0 -387
  148. package/dist/qbs-ect-cmp/textValues-6bcc85dd.js +0 -302
@@ -0,0 +1,122 @@
1
+ import { h } from '@stencil/core';
2
+ import { SessionKeys } from '../../../helpers/textValues';
3
+ import store from '../../../helpers/store';
4
+ import Events from '../../../helpers/Events';
5
+ import { FlowStatus } from '../../../models/FlowStatus';
6
+ import { ApiCall } from '../../../helpers/ApiCall';
7
+ import { FlowSteps } from '../../../models/FlowSteps';
8
+ import { Cameras } from '../../../helpers/Cameras';
9
+ import { BaseComponent } from '../../base-component';
10
+ import { MobileOS } from '../../../models/IDevice';
11
+ // @ts-ignore
12
+ import info from '../../../assets/landing/info.svg';
13
+ // @ts-ignore
14
+ import idSvg from '../../../assets/landing/id.svg';
15
+ // @ts-ignore
16
+ import idValidation from '../../../assets/landing/validation.svg';
17
+ // @ts-ignore
18
+ import idDevice from '../../../assets/landing/device.svg';
19
+ export class LandingValidation {
20
+ constructor() {
21
+ this.warningText = undefined;
22
+ this.buttonDisabled = undefined;
23
+ this.baseComponent = new BaseComponent(FlowSteps.Landing);
24
+ this.baseComponent.setEventEmitter(this.apiErrorEvent);
25
+ }
26
+ async componentWillLoad() {
27
+ Events.flowStarted();
28
+ this.baseComponent.apiCall = new ApiCall();
29
+ this.buttonDisabled = false;
30
+ await this.initRequest();
31
+ }
32
+ async componentDidLoad() {
33
+ if (store.environment !== 'DEMO') {
34
+ await this.baseComponent.initialize();
35
+ }
36
+ }
37
+ async initRequest() {
38
+ if (store.hasIdBack) {
39
+ this.warningText = this.baseComponent.translations.LandingValues.WarningMd;
40
+ }
41
+ else {
42
+ this.warningText = this.baseComponent.translations.LandingValues.Warning;
43
+ }
44
+ }
45
+ async startFlow() {
46
+ if (store.initialised) {
47
+ this.buttonDisabled = true;
48
+ if (store.environment === 'DEMO') {
49
+ store.flowStatus = FlowStatus.COMPLETE;
50
+ return;
51
+ }
52
+ if (!(await Cameras.InitCameras(store.device))) {
53
+ if (store.device.mobileOS == MobileOS.iOS)
54
+ sessionStorage.setItem(SessionKeys.RefreshDoneKey, 'false');
55
+ store.flowStatus = FlowStatus.CAMERAERROR;
56
+ }
57
+ else if (store.agreementsValidation) {
58
+ store.flowStatus = FlowStatus.AGREEMENT;
59
+ }
60
+ else if (store.phoneValidation) {
61
+ store.flowStatus = FlowStatus.PHONE;
62
+ }
63
+ else {
64
+ store.flowStatus = FlowStatus.ID;
65
+ }
66
+ }
67
+ }
68
+ async disconnectedCallback() {
69
+ await this.baseComponent.finalize();
70
+ }
71
+ async leaveFlow() {
72
+ if (this.buttonDisabled)
73
+ return;
74
+ store.initialised = false;
75
+ try {
76
+ await this.baseComponent.apiCall.AbortRequest();
77
+ Events.flowAborted();
78
+ }
79
+ catch (e) {
80
+ Events.flowAborted();
81
+ this.apiErrorEvent.emit(e);
82
+ }
83
+ }
84
+ render() {
85
+ return (h("div", { class: "container" }, h("div", { class: "row" }, h("div", null, h("h1", { class: "text-center" }, this.baseComponent.translations.LandingValues.Title), h("div", { class: "d-flex space-between align-center" }, h("p", { class: "main-text font-size-2" }, this.baseComponent.translations.LandingValues.Description), h("div", { class: "img-info" }, h("div", { class: "i-effect" }), h("img", { src: info })))), h("div", { class: "info-container" }, h("div", { class: "img-text" }, h("div", { class: "bg-img" }, h("img", { src: idSvg })), h("h3", null, this.baseComponent.translations.LandingValues.IdInfo)), h("div", { class: "img-text" }, h("div", { class: "bg-img" }, h("img", { src: idDevice })), h("h3", null, this.baseComponent.translations.LandingValues.DeviceInfo)), h("div", { class: "img-text" }, h("div", { class: "bg-img" }, h("img", { src: idValidation })), h("h3", null, this.baseComponent.translations.LandingValues.SmsInfo))), h("div", { class: "terms-container" }, h("h3", { class: "font-size-2 mb-1 text-center" }, this.warningText)), h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", type: "button", disabled: !store.initialised || this.buttonDisabled, onClick: () => this.startFlow() }, this.baseComponent.translations.LandingValues.Button), h("p", { class: "main-text font-size-2 link-text mb-0", onClick: () => this.leaveFlow() }, this.baseComponent.translations.LandingValues.ButtonLeave), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.baseComponent.translations.GlobalValues.FooterText))))));
86
+ }
87
+ static get is() { return "landing-validation"; }
88
+ static get originalStyleUrls() {
89
+ return {
90
+ "$": ["landing-validation.css"]
91
+ };
92
+ }
93
+ static get styleUrls() {
94
+ return {
95
+ "$": ["landing-validation.css"]
96
+ };
97
+ }
98
+ static get states() {
99
+ return {
100
+ "warningText": {},
101
+ "buttonDisabled": {}
102
+ };
103
+ }
104
+ static get events() {
105
+ return [{
106
+ "method": "apiErrorEvent",
107
+ "name": "apiError",
108
+ "bubbles": true,
109
+ "cancelable": true,
110
+ "composed": true,
111
+ "docs": {
112
+ "tags": [],
113
+ "text": ""
114
+ },
115
+ "complexType": {
116
+ "original": "any",
117
+ "resolved": "any",
118
+ "references": {}
119
+ }
120
+ }];
121
+ }
122
+ }
@@ -0,0 +1,10 @@
1
+ .qr-canvas {
2
+ max-height: 60vh;
3
+ max-width: 80vw;
4
+ text-align: center;
5
+ }
6
+
7
+ .qr-canvas > canvas {
8
+ width: 100%;
9
+ height: 100%;
10
+ }
@@ -0,0 +1,143 @@
1
+ import { h } from '@stencil/core';
2
+ import QRCode from 'qrcode';
3
+ import store from '../../../helpers/store';
4
+ import Events from '../../../helpers/Events';
5
+ import { OrderStatuses } from '../../../models/OrderStatuses';
6
+ import { FlowStatus } from '../../../models/FlowStatus';
7
+ import { FlowSteps } from '../../../models/FlowSteps';
8
+ import { delay } from '../../../utils/utils';
9
+ import { BaseComponent } from '../../base-component';
10
+ export class MobileRedirect {
11
+ constructor() {
12
+ this.infoTextTop = undefined;
13
+ this.infoTextBottom = undefined;
14
+ this.contact = undefined;
15
+ this.invalidValue = undefined;
16
+ this.waitingMobile = undefined;
17
+ this.orderStatus = undefined;
18
+ this.redirectLink = undefined;
19
+ this.qrCode = undefined;
20
+ this.prefilledPhone = false;
21
+ this.baseComponent = new BaseComponent(FlowSteps.MobileRedirect);
22
+ this.baseComponent.setEventEmitter(this.apiErrorEvent);
23
+ this.invalidValue = false;
24
+ this.waitingMobile = false;
25
+ }
26
+ async componentWillLoad() {
27
+ Events.flowStarted();
28
+ this.infoTextTop = this.baseComponent.translations.MobileRedirectValues.InfoTop;
29
+ this.infoTextBottom = this.baseComponent.translations.MobileRedirectValues.InfoBottom;
30
+ let envUri = store.environment == 'QA' ? 'test' : 'ect';
31
+ let baseUri = store.hasIdBack ? 'https://onmd.id-kyc.com/' : 'https://onro.id-kyc.com/';
32
+ this.redirectLink = baseUri + envUri + '/mobileredirect?redirectId=' + store.redirectId;
33
+ if (store.phoneNumber && store.phoneNumber != '') {
34
+ this.contact = store.phoneNumber;
35
+ this.prefilledPhone = true;
36
+ }
37
+ var self = this;
38
+ QRCode.toDataURL(this.redirectLink, { type: 'image/png', errorCorrectionLevel: 'M', scale: 6 }, function (error, url) {
39
+ if (error)
40
+ console.error(error);
41
+ self.qrCode = url;
42
+ });
43
+ }
44
+ async componentDidLoad() {
45
+ await this.baseComponent.initialize();
46
+ await delay(5000);
47
+ await this.checkStatus();
48
+ while (this.orderStatus == OrderStatuses.Capturing || this.orderStatus == OrderStatuses.Waiting) {
49
+ await this.checkStatus();
50
+ await delay(5000);
51
+ }
52
+ }
53
+ async checkStatus() {
54
+ this.orderStatus = await this.baseComponent.apiCall.GetStatus(store.requestId);
55
+ if (this.orderStatus == OrderStatuses.FinishedCapturing) {
56
+ this.waitingMobile = false;
57
+ store.flowStatus = FlowStatus.COMPLETE;
58
+ }
59
+ if (this.orderStatus == OrderStatuses.NotFound) {
60
+ this.apiErrorEvent.emit({ message: 'No order was started for this process.' });
61
+ }
62
+ if (this.orderStatus == OrderStatuses.Capturing) {
63
+ this.infoTextTop = this.baseComponent.translations.MobileRedirectValues.InfoWaiting;
64
+ this.waitingMobile = true;
65
+ }
66
+ if (this.orderStatus == OrderStatuses.Aborted) {
67
+ this.waitingMobile = false;
68
+ this.infoTextTop = this.baseComponent.translations.MobileRedirectValues.InfoAborted;
69
+ Events.flowAborted();
70
+ }
71
+ }
72
+ async disconnectedCallback() {
73
+ await this.baseComponent.finalize();
74
+ }
75
+ async buttonClick() {
76
+ if (this.contact == '' || this.contact.length != 10) {
77
+ this.invalidValue == true;
78
+ return;
79
+ }
80
+ this.waitingMobile = true;
81
+ this.infoTextTop = this.baseComponent.translations.MobileRedirectValues.InfoWaiting;
82
+ try {
83
+ await this.baseComponent.apiCall.SendLink(this.redirectLink, this.contact);
84
+ }
85
+ catch (e) {
86
+ this.apiErrorEvent.emit(e);
87
+ }
88
+ }
89
+ handleChangeContact(ev) {
90
+ let value = ev.target ? ev.target.value : '';
91
+ this.contact = value.replace(/\D/g, '');
92
+ if (this.contact.length > 10) {
93
+ this.contact = this.contact.substring(0, 10);
94
+ }
95
+ this.invalidValue = this.contact.length != 10;
96
+ ev.target.value = this.contact;
97
+ }
98
+ render() {
99
+ return (h("div", { class: "container" }, h("div", { class: "row" }, h("div", { hidden: this.waitingMobile }, h("div", { class: "text-center" }, h("p", { class: "font-size-2" }, this.infoTextTop)), h("div", { class: "qr-canvas align-center" }, h("img", { src: this.qrCode })), h("div", { class: "text-center" }, h("p", { class: "font-size-2" }, this.infoTextBottom)), h("div", { class: "input-container mb-15" }, h("label", { class: "font-size-18 mb-1 color-red", hidden: this.invalidValue == false }, h("b", null, this.baseComponent.translations.MobileRedirectValues.Validation)), h("input", { type: "text", id: "codeInput", class: "main-input", disabled: this.prefilledPhone, value: this.contact, onInput: ev => this.handleChangeContact(ev) })), h("div", { class: "pos-relative" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", onClick: () => this.buttonClick() }, "Trimite"), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.baseComponent.translations.GlobalValues.FooterText)))), h("div", { hidden: this.waitingMobile == false }, h("div", { class: "text-center" }, h("p", { class: "font-size-2" }, this.infoTextTop))))));
100
+ }
101
+ static get is() { return "mobile-redirect"; }
102
+ static get originalStyleUrls() {
103
+ return {
104
+ "$": ["mobile-redirect.css"]
105
+ };
106
+ }
107
+ static get styleUrls() {
108
+ return {
109
+ "$": ["mobile-redirect.css"]
110
+ };
111
+ }
112
+ static get states() {
113
+ return {
114
+ "infoTextTop": {},
115
+ "infoTextBottom": {},
116
+ "contact": {},
117
+ "invalidValue": {},
118
+ "waitingMobile": {},
119
+ "orderStatus": {},
120
+ "redirectLink": {},
121
+ "qrCode": {},
122
+ "prefilledPhone": {}
123
+ };
124
+ }
125
+ static get events() {
126
+ return [{
127
+ "method": "apiErrorEvent",
128
+ "name": "apiError",
129
+ "bubbles": true,
130
+ "cancelable": true,
131
+ "composed": true,
132
+ "docs": {
133
+ "tags": [],
134
+ "text": ""
135
+ },
136
+ "complexType": {
137
+ "original": "any",
138
+ "resolved": "any",
139
+ "references": {}
140
+ }
141
+ }];
142
+ }
143
+ }
@@ -1,19 +1,14 @@
1
- import { r as registerInstance, e as createEvent, h } from './index-78a05b9e.js';
2
- import { s as state, F as FlowStatus } from './textValues-6bcc85dd.js';
3
- import { S as Stream } from './Stream-b867a2be.js';
4
- import { B as BaseComponent, F as FlowSteps } from './base-component-2e490fd9.js';
5
- import { g as getLogMessage } from './utils-8225f0b7.js';
6
- import { C as CaptureUploadTypes, I as IdCaptureFlowStatus } from './CaptureFlow-db5d90a4.js';
7
- import './ML5-657ef934.js';
8
- import './_commonjsHelpers-321aa363.js';
9
- import './IDevice-15ecfdeb.js';
10
-
11
- const processIdCss = "";
12
-
13
- const ProcessId = class {
14
- constructor(hostRef) {
15
- registerInstance(this, hostRef);
16
- this.apiErrorEvent = createEvent(this, "apiError", 7);
1
+ import { h /*getAssetPath*/ } from '@stencil/core';
2
+ import store from '../../../helpers/store';
3
+ import { Stream } from '../../../helpers/Stream';
4
+ import { FlowStatus } from '../../../models/FlowStatus';
5
+ import { FlowSteps } from '../../../models/FlowSteps';
6
+ import { getLogMessage } from '../../../utils/utils';
7
+ import { BaseComponent } from '../../base-component';
8
+ import { IdCaptureFlowStatus, CaptureUploadTypes } from '../../../models/CaptureFlow';
9
+ // import { IDPose } from '../../libs/IDML5Detector/IDPose';
10
+ export class ProcessId {
11
+ constructor() {
17
12
  this.recordingResultCount = 0;
18
13
  this.captureStep = undefined;
19
14
  this.showTimeout = undefined;
@@ -36,7 +31,7 @@ const ProcessId = class {
36
31
  back: null,
37
32
  tilt: null,
38
33
  };
39
- if (state.hasIdBack) {
34
+ if (store.hasIdBack) {
40
35
  this.flow.back = {
41
36
  photoDone: false,
42
37
  recordingDone: false,
@@ -46,7 +41,7 @@ const ProcessId = class {
46
41
  recType: CaptureUploadTypes.IdBackVideo,
47
42
  };
48
43
  }
49
- if (state.hasIdTilt) {
44
+ if (store.hasIdTilt) {
50
45
  this.flow.tilt = {
51
46
  photoDone: true,
52
47
  recordingDone: false,
@@ -146,7 +141,7 @@ const ProcessId = class {
146
141
  if (photoFile == null || uploadType == '') {
147
142
  return false;
148
143
  }
149
- var uploadResult = await this.baseComponent.apiCall.UploadFileForRequestB64(state.requestId, uploadType, photoFile);
144
+ var uploadResult = await this.baseComponent.apiCall.UploadFileForRequestB64(store.requestId, uploadType, photoFile);
150
145
  if (uploadResult) {
151
146
  return true;
152
147
  }
@@ -160,7 +155,7 @@ const ProcessId = class {
160
155
  if (recordingFile == null) {
161
156
  return;
162
157
  }
163
- var uploadResult = await this.baseComponent.apiCall.UploadFileForRequestB64(state.requestId, uploadType, recordingFile);
158
+ var uploadResult = await this.baseComponent.apiCall.UploadFileForRequestB64(store.requestId, uploadType, recordingFile);
164
159
  if (uploadResult) {
165
160
  return true;
166
161
  }
@@ -193,10 +188,10 @@ const ProcessId = class {
193
188
  async endFlow() {
194
189
  if (this.captureStep == IdCaptureFlowStatus.IdFront) {
195
190
  if (this.flow.front.photoDone && this.flow.front.recordingDone) {
196
- if (state.hasIdBack) {
191
+ if (store.hasIdBack) {
197
192
  this.captureStep = IdCaptureFlowStatus.IdBack;
198
193
  }
199
- else if (state.hasIdTilt) {
194
+ else if (store.hasIdTilt) {
200
195
  this.captureStep = IdCaptureFlowStatus.Tilt;
201
196
  }
202
197
  else {
@@ -207,9 +202,9 @@ const ProcessId = class {
207
202
  return;
208
203
  }
209
204
  }
210
- if (this.captureStep == IdCaptureFlowStatus.IdBack && state.hasIdBack) {
205
+ if (this.captureStep == IdCaptureFlowStatus.IdBack && store.hasIdBack) {
211
206
  if (this.flow.back.photoDone && this.flow.back.recordingDone) {
212
- if (state.hasIdTilt) {
207
+ if (store.hasIdTilt) {
213
208
  this.captureStep = IdCaptureFlowStatus.Tilt;
214
209
  }
215
210
  else {
@@ -220,7 +215,7 @@ const ProcessId = class {
220
215
  return;
221
216
  }
222
217
  }
223
- if (this.captureStep == IdCaptureFlowStatus.Tilt && state.hasIdTilt) {
218
+ if (this.captureStep == IdCaptureFlowStatus.Tilt && store.hasIdTilt) {
224
219
  if (this.flow.tilt.photoDone && this.flow.tilt.recordingDone) {
225
220
  this.captureStep = IdCaptureFlowStatus.End;
226
221
  }
@@ -231,15 +226,15 @@ const ProcessId = class {
231
226
  if (this.captureStep != IdCaptureFlowStatus.End) {
232
227
  return;
233
228
  }
234
- state.flowStatus = FlowStatus.LIVENESS;
229
+ store.flowStatus = FlowStatus.LIVENESS;
235
230
  }
236
231
  async disconnectedCallback() {
237
232
  await this.baseComponent.finalize();
238
233
  }
239
234
  switchCamera() {
240
235
  if (this.captureRetryCount == 1) {
241
- let camIndex = state.cameraIds.indexOf(state.cameraId);
242
- state.cameraId = camIndex === state.cameraIds.length - 1 ? state.cameraIds[0] : state.cameraIds[camIndex + 1];
236
+ let camIndex = store.cameraIds.indexOf(store.cameraId);
237
+ store.cameraId = camIndex === store.cameraIds.length - 1 ? store.cameraIds[0] : store.cameraIds[camIndex + 1];
243
238
  this.captureRetryCount = 0;
244
239
  }
245
240
  else {
@@ -272,7 +267,80 @@ const ProcessId = class {
272
267
  return tiltCapture;
273
268
  }
274
269
  }
275
- };
276
- ProcessId.style = processIdCss;
277
-
278
- export { ProcessId as process_id };
270
+ static get is() { return "process-id"; }
271
+ static get originalStyleUrls() {
272
+ return {
273
+ "$": ["process-id.css"]
274
+ };
275
+ }
276
+ static get styleUrls() {
277
+ return {
278
+ "$": ["process-id.css"]
279
+ };
280
+ }
281
+ static get states() {
282
+ return {
283
+ "captureStep": {},
284
+ "showTimeout": {},
285
+ "showInvalid": {},
286
+ "flow": {}
287
+ };
288
+ }
289
+ static get events() {
290
+ return [{
291
+ "method": "apiErrorEvent",
292
+ "name": "apiError",
293
+ "bubbles": true,
294
+ "cancelable": true,
295
+ "composed": true,
296
+ "docs": {
297
+ "tags": [],
298
+ "text": ""
299
+ },
300
+ "complexType": {
301
+ "original": "any",
302
+ "resolved": "any",
303
+ "references": {}
304
+ }
305
+ }];
306
+ }
307
+ static get listeners() {
308
+ return [{
309
+ "name": "howToInfoDone",
310
+ "method": "howToDone",
311
+ "target": undefined,
312
+ "capture": false,
313
+ "passive": false
314
+ }, {
315
+ "name": "timeElapsed",
316
+ "method": "timeElapsed",
317
+ "target": undefined,
318
+ "capture": false,
319
+ "passive": false
320
+ }, {
321
+ "name": "captureErrorDone",
322
+ "method": "captureErrorDone",
323
+ "target": undefined,
324
+ "capture": false,
325
+ "passive": false
326
+ }, {
327
+ "name": "photoIdCapture",
328
+ "method": "captureIdImage",
329
+ "target": undefined,
330
+ "capture": false,
331
+ "passive": false
332
+ }, {
333
+ "name": "photoIdBackCapture",
334
+ "method": "captureIdBackImage",
335
+ "target": undefined,
336
+ "capture": false,
337
+ "passive": false
338
+ }, {
339
+ "name": "recordingIdCapture",
340
+ "method": "capturedIdRecording",
341
+ "target": undefined,
342
+ "capture": false,
343
+ "passive": false
344
+ }];
345
+ }
346
+ }
@@ -1,14 +1,10 @@
1
- import { r as registerInstance, e as createEvent, h } from './index-78a05b9e.js';
2
- import { s as state, F as FlowStatus } from './textValues-6bcc85dd.js';
3
- import { B as BaseComponent, F as FlowSteps } from './base-component-2e490fd9.js';
4
- import './IDevice-15ecfdeb.js';
5
-
6
- const smsCodeValidationCss = "";
7
-
8
- const SmsCodeValidation = class {
9
- constructor(hostRef) {
10
- registerInstance(this, hostRef);
11
- this.apiErrorEvent = createEvent(this, "apiError", 7);
1
+ import { h } from '@stencil/core';
2
+ import store from '../../../helpers/store';
3
+ import { FlowStatus } from '../../../models/FlowStatus';
4
+ import { FlowSteps } from '../../../models/FlowSteps';
5
+ import { BaseComponent } from '../../base-component';
6
+ export class SmsCodeValidation {
7
+ constructor() {
12
8
  this.title = undefined;
13
9
  this.details = undefined;
14
10
  this.buttonText = undefined;
@@ -16,10 +12,10 @@ const SmsCodeValidation = class {
16
12
  this.code = undefined;
17
13
  this.prefilledPhone = false;
18
14
  this.canSend = false;
19
- if (state.flowStatus == FlowStatus.PHONE) {
15
+ if (store.flowStatus == FlowStatus.PHONE) {
20
16
  this.baseComponent = new BaseComponent(FlowSteps.OtpSend);
21
17
  }
22
- if (state.flowStatus == FlowStatus.CODE) {
18
+ if (store.flowStatus == FlowStatus.CODE) {
23
19
  this.baseComponent = new BaseComponent(FlowSteps.OtpCheck);
24
20
  }
25
21
  this.baseComponent.setEventEmitter(this.apiErrorEvent);
@@ -27,19 +23,19 @@ const SmsCodeValidation = class {
27
23
  async doAction() {
28
24
  try {
29
25
  this.canSend = false;
30
- if (state.flowStatus == FlowStatus.CODE || state.flowStatus == FlowStatus.CODEERROR) {
31
- var codeChecked = await this.baseComponent.apiCall.CheckOTPCode(state.requestId, this.code);
26
+ if (store.flowStatus == FlowStatus.CODE || store.flowStatus == FlowStatus.CODEERROR) {
27
+ var codeChecked = await this.baseComponent.apiCall.CheckOTPCode(store.requestId, this.code);
32
28
  if (codeChecked === true) {
33
- state.flowStatus = FlowStatus.ID;
29
+ store.flowStatus = FlowStatus.ID;
34
30
  }
35
31
  else {
36
- state.flowStatus = FlowStatus.CODEERROR;
32
+ store.flowStatus = FlowStatus.CODEERROR;
37
33
  }
38
34
  }
39
- if (state.flowStatus == FlowStatus.PHONE) {
40
- var codeSent = await this.baseComponent.apiCall.SendOTPCode(state.requestId, this.phoneNumber);
35
+ if (store.flowStatus == FlowStatus.PHONE) {
36
+ var codeSent = await this.baseComponent.apiCall.SendOTPCode(store.requestId, this.phoneNumber);
41
37
  if (codeSent === true) {
42
- state.flowStatus = FlowStatus.CODE;
38
+ store.flowStatus = FlowStatus.CODE;
43
39
  }
44
40
  }
45
41
  }
@@ -51,17 +47,17 @@ const SmsCodeValidation = class {
51
47
  await this.baseComponent.finalize();
52
48
  }
53
49
  componentWillRender() {
54
- if (state.flowStatus == FlowStatus.PHONE) {
50
+ if (store.flowStatus == FlowStatus.PHONE) {
55
51
  this.title = this.baseComponent.translations.PhoneValidationValues.Title;
56
52
  this.details = this.baseComponent.translations.PhoneValidationValues.Description;
57
53
  this.buttonText = this.baseComponent.translations.PhoneValidationValues.Button;
58
- if (state.phoneNumber && state.phoneNumber != '') {
59
- this.phoneNumber = state.phoneNumber;
54
+ if (store.phoneNumber && store.phoneNumber != '') {
55
+ this.phoneNumber = store.phoneNumber;
60
56
  this.prefilledPhone = true;
61
57
  this.canSend = true;
62
58
  }
63
59
  }
64
- if (state.flowStatus == FlowStatus.CODE || state.flowStatus == FlowStatus.CODEERROR) {
60
+ if (store.flowStatus == FlowStatus.CODE || store.flowStatus == FlowStatus.CODEERROR) {
65
61
  this.title = this.baseComponent.translations.CodeValidationValues.Title;
66
62
  this.details = this.baseComponent.translations.CodeValidationValues.Description;
67
63
  this.buttonText = this.baseComponent.translations.CodeValidationValues.Button;
@@ -89,10 +85,10 @@ const SmsCodeValidation = class {
89
85
  render() {
90
86
  let inputBlock;
91
87
  let errorBlock;
92
- if (state.flowStatus == FlowStatus.CODEERROR) {
88
+ if (store.flowStatus == FlowStatus.CODEERROR) {
93
89
  errorBlock = h("p", { class: "main-text font-size-18 mt-15 color-red text-center" }, this.baseComponent.translations.CodeValidationValues.Error);
94
90
  }
95
- if (state.flowStatus == FlowStatus.PHONE) {
91
+ if (store.flowStatus == FlowStatus.PHONE) {
96
92
  inputBlock = (h("div", { class: "input-container mb-15" }, h("label", { class: "font-size-18 mb-1" }, h("b", null, this.baseComponent.translations.PhoneValidationValues.Label)), h("input", { type: "tel", id: "phoneInput", class: "main-input", disabled: this.prefilledPhone, onInput: ev => this.handleChangePhone(ev), value: this.phoneNumber })));
97
93
  }
98
94
  else {
@@ -100,7 +96,44 @@ const SmsCodeValidation = class {
100
96
  }
101
97
  return (h("div", { class: "container" }, h("div", { class: "row row-validare" }, h("div", null, h("h1", { class: "text-center" }, this.title), errorBlock == null ? h("p", { class: "main-text font-size-2 mt-15 mb-20 text-center" }, this.details) : errorBlock), inputBlock, h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { id: "action", disabled: !this.canSend, class: "main-button", onClick: () => this.doAction() }, this.buttonText), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.baseComponent.translations.GlobalValues.FooterText))))));
102
98
  }
103
- };
104
- SmsCodeValidation.style = smsCodeValidationCss;
105
-
106
- export { SmsCodeValidation as sms_code_validation };
99
+ static get is() { return "sms-code-validation"; }
100
+ static get originalStyleUrls() {
101
+ return {
102
+ "$": ["sms-code-validation.css"]
103
+ };
104
+ }
105
+ static get styleUrls() {
106
+ return {
107
+ "$": ["sms-code-validation.css"]
108
+ };
109
+ }
110
+ static get states() {
111
+ return {
112
+ "title": {},
113
+ "details": {},
114
+ "buttonText": {},
115
+ "phoneNumber": {},
116
+ "code": {},
117
+ "prefilledPhone": {},
118
+ "canSend": {}
119
+ };
120
+ }
121
+ static get events() {
122
+ return [{
123
+ "method": "apiErrorEvent",
124
+ "name": "apiError",
125
+ "bubbles": true,
126
+ "cancelable": true,
127
+ "composed": true,
128
+ "docs": {
129
+ "tags": [],
130
+ "text": ""
131
+ },
132
+ "complexType": {
133
+ "original": "any",
134
+ "resolved": "any",
135
+ "references": {}
136
+ }
137
+ }];
138
+ }
139
+ }