@ekyc_qoobiss/qbs-ect-cmp 3.6.27 → 3.6.29

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 (168) hide show
  1. package/dist/cjs/TranslationUtils-b918ffb1.js +346 -0
  2. package/dist/cjs/agreement-check_19.cjs.entry.js +9997 -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 +22 -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 +59 -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 +108 -0
  23. package/dist/collection/components/common/camera-error/camera-error.css +0 -0
  24. package/dist/collection/components/common/camera-error/camera-error.js +93 -0
  25. package/dist/collection/components/common/capture-error/capture-error.css +0 -0
  26. package/dist/collection/components/common/capture-error/capture-error.js +102 -0
  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 +123 -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} +102 -30
  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} +100 -28
  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} +100 -28
  35. package/dist/collection/components/common/random-actions/random-actions.css +0 -0
  36. package/dist/collection/components/common/random-actions/random-actions.js +23 -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} +102 -29
  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} +103 -30
  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/collection/components/flow/agreement-info/agreement-info.js +107 -0
  47. package/dist/collection/components/flow/end-redirect/end-redirect.css +128 -0
  48. package/dist/collection/components/flow/end-redirect/end-redirect.js +48 -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 +124 -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 +145 -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/collection/components/flow/sms-code-validation/sms-code-validation.js +141 -0
  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/{qbs-ect-cmp/textValues-6bcc85dd.js → esm/TranslationUtils-8ceeb437.js} +84 -47
  102. package/dist/esm/agreement-check_19.entry.js +9975 -0
  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 +6 -9
  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-473a4636.entry.js +1 -0
  126. package/dist/qbs-ect-cmp/p-8942656c.js +2 -0
  127. package/dist/qbs-ect-cmp/p-b2c9c8d7.entry.js +1373 -0
  128. package/dist/qbs-ect-cmp/p-e568a07c.js +1 -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/dist/types/components/base-component.d.ts +0 -2
  132. package/dist/types/components/common/agreement-check/agreement-check.d.ts +2 -0
  133. package/dist/types/components/common/camera-error/camera-error.d.ts +1 -0
  134. package/dist/types/components/common/capture-error/capture-error.d.ts +1 -0
  135. package/dist/types/components/common/how-to-info/how-to-info.d.ts +2 -1
  136. package/dist/types/components/common/id-back-capture/id-back-capture.d.ts +1 -0
  137. package/dist/types/components/common/id-capture/id-capture.d.ts +1 -0
  138. package/dist/types/components/common/id-tilt/id-tilt.d.ts +1 -0
  139. package/dist/types/components/common/random-actions/random-actions.d.ts +2 -2
  140. package/dist/types/components/common/selfie-capture/selfie-capture.d.ts +2 -1
  141. package/dist/types/components/common/selfie-tilt/selfie-tilt.d.ts +2 -1
  142. package/dist/types/components/flow/agreement-info/agreement-info.d.ts +2 -1
  143. package/dist/types/components/flow/end-redirect/end-redirect.d.ts +2 -1
  144. package/dist/types/components/flow/landing-validation/landing-validation.d.ts +1 -0
  145. package/dist/types/components/flow/mobile-redirect/mobile-redirect.d.ts +1 -0
  146. package/dist/types/components/flow/sms-code-validation/sms-code-validation.d.ts +2 -1
  147. package/package.json +1 -1
  148. package/dist/qbs-ect-cmp/ML5-657ef934.js +0 -1370
  149. package/dist/qbs-ect-cmp/Stream-b867a2be.js +0 -3104
  150. package/dist/qbs-ect-cmp/_commonjsHelpers-321aa363.js +0 -44
  151. package/dist/qbs-ect-cmp/agreement-check.entry.js +0 -41
  152. package/dist/qbs-ect-cmp/agreement-info.entry.js +0 -66
  153. package/dist/qbs-ect-cmp/app-globals-0f993ce5.js +0 -3
  154. package/dist/qbs-ect-cmp/base-component-2e490fd9.js +0 -502
  155. package/dist/qbs-ect-cmp/camera-comp.entry.js +0 -103
  156. package/dist/qbs-ect-cmp/camera-error.entry.js +0 -59
  157. package/dist/qbs-ect-cmp/capture-error.entry.js +0 -53
  158. package/dist/qbs-ect-cmp/css-shim-b7d3d95f.js +0 -4
  159. package/dist/qbs-ect-cmp/dom-64053c71.js +0 -73
  160. package/dist/qbs-ect-cmp/end-redirect.entry.js +0 -25
  161. package/dist/qbs-ect-cmp/error-end.entry.js +0 -19
  162. package/dist/qbs-ect-cmp/how-to-info.entry.js +0 -52
  163. package/dist/qbs-ect-cmp/identification-component.entry.js +0 -909
  164. package/dist/qbs-ect-cmp/index-78a05b9e.js +0 -3371
  165. package/dist/qbs-ect-cmp/landing-validation.entry.js +0 -90
  166. package/dist/qbs-ect-cmp/mobile-redirect.entry.js +0 -2984
  167. package/dist/qbs-ect-cmp/shadow-css-98135883.js +0 -387
  168. package/dist/qbs-ect-cmp/sms-code-validation.entry.js +0 -106
@@ -0,0 +1,61 @@
1
+ import { h } from '@stencil/core';
2
+ import store from '../../../helpers/store';
3
+ export class ErrorEnd {
4
+ constructor() {
5
+ this.message = undefined;
6
+ this.errorTitle = undefined;
7
+ }
8
+ componentDidLoad() { }
9
+ render() {
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)))));
11
+ }
12
+ static get is() { return "error-end"; }
13
+ static get originalStyleUrls() {
14
+ return {
15
+ "$": ["error-end.css"]
16
+ };
17
+ }
18
+ static get styleUrls() {
19
+ return {
20
+ "$": ["error-end.css"]
21
+ };
22
+ }
23
+ static get properties() {
24
+ return {
25
+ "message": {
26
+ "type": "string",
27
+ "mutable": false,
28
+ "complexType": {
29
+ "original": "string",
30
+ "resolved": "string",
31
+ "references": {}
32
+ },
33
+ "required": false,
34
+ "optional": false,
35
+ "docs": {
36
+ "tags": [],
37
+ "text": ""
38
+ },
39
+ "attribute": "message",
40
+ "reflect": false
41
+ },
42
+ "errorTitle": {
43
+ "type": "string",
44
+ "mutable": false,
45
+ "complexType": {
46
+ "original": "string",
47
+ "resolved": "string",
48
+ "references": {}
49
+ },
50
+ "required": false,
51
+ "optional": false,
52
+ "docs": {
53
+ "tags": [],
54
+ "text": ""
55
+ },
56
+ "attribute": "error-title",
57
+ "reflect": false
58
+ }
59
+ };
60
+ }
61
+ }
@@ -0,0 +1,124 @@
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
+ import { Translations } from '../../../helpers/TranslationUtils';
20
+ export class LandingValidation {
21
+ constructor() {
22
+ this.warningText = undefined;
23
+ this.buttonDisabled = undefined;
24
+ this.baseComponent = new BaseComponent(FlowSteps.Landing);
25
+ this.baseComponent.setEventEmitter(this.apiErrorEvent);
26
+ }
27
+ async componentWillLoad() {
28
+ Events.flowStarted();
29
+ this.translations = await Translations.getValues();
30
+ this.baseComponent.apiCall = new ApiCall();
31
+ this.buttonDisabled = false;
32
+ await this.initRequest();
33
+ }
34
+ async componentDidLoad() {
35
+ if (store.environment !== 'DEMO') {
36
+ await this.baseComponent.initialize();
37
+ }
38
+ }
39
+ async initRequest() {
40
+ if (store.hasIdBack) {
41
+ this.warningText = this.translations.LandingValues.WarningMd;
42
+ }
43
+ else {
44
+ this.warningText = this.translations.LandingValues.Warning;
45
+ }
46
+ }
47
+ async startFlow() {
48
+ if (store.initialised) {
49
+ this.buttonDisabled = true;
50
+ if (store.environment === 'DEMO') {
51
+ store.flowStatus = FlowStatus.COMPLETE;
52
+ return;
53
+ }
54
+ if (!(await Cameras.InitCameras(store.device))) {
55
+ if (store.device.mobileOS == MobileOS.iOS)
56
+ sessionStorage.setItem(SessionKeys.RefreshDoneKey, 'false');
57
+ store.flowStatus = FlowStatus.CAMERAERROR;
58
+ }
59
+ else if (store.agreementsValidation) {
60
+ store.flowStatus = FlowStatus.AGREEMENT;
61
+ }
62
+ else if (store.phoneValidation) {
63
+ store.flowStatus = FlowStatus.PHONE;
64
+ }
65
+ else {
66
+ store.flowStatus = FlowStatus.ID;
67
+ }
68
+ }
69
+ }
70
+ async disconnectedCallback() {
71
+ await this.baseComponent.finalize();
72
+ }
73
+ async leaveFlow() {
74
+ if (this.buttonDisabled)
75
+ return;
76
+ store.initialised = false;
77
+ try {
78
+ await this.baseComponent.apiCall.AbortRequest();
79
+ Events.flowAborted();
80
+ }
81
+ catch (e) {
82
+ Events.flowAborted();
83
+ this.apiErrorEvent.emit(e);
84
+ }
85
+ }
86
+ render() {
87
+ return (h("div", { class: "container" }, h("div", { class: "row" }, h("div", null, h("h1", { class: "text-center" }, this.translations.LandingValues.Title), h("div", { class: "d-flex space-between align-center" }, h("p", { class: "main-text font-size-2" }, this.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.translations.LandingValues.IdInfo)), h("div", { class: "img-text" }, h("div", { class: "bg-img" }, h("img", { src: idDevice })), h("h3", null, this.translations.LandingValues.DeviceInfo)), h("div", { class: "img-text" }, h("div", { class: "bg-img" }, h("img", { src: idValidation })), h("h3", null, this.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.translations.LandingValues.Button), h("p", { class: "main-text font-size-2 link-text mb-0", onClick: () => this.leaveFlow() }, this.translations.LandingValues.ButtonLeave), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
88
+ }
89
+ static get is() { return "landing-validation"; }
90
+ static get originalStyleUrls() {
91
+ return {
92
+ "$": ["landing-validation.css"]
93
+ };
94
+ }
95
+ static get styleUrls() {
96
+ return {
97
+ "$": ["landing-validation.css"]
98
+ };
99
+ }
100
+ static get states() {
101
+ return {
102
+ "warningText": {},
103
+ "buttonDisabled": {}
104
+ };
105
+ }
106
+ static get events() {
107
+ return [{
108
+ "method": "apiErrorEvent",
109
+ "name": "apiError",
110
+ "bubbles": true,
111
+ "cancelable": true,
112
+ "composed": true,
113
+ "docs": {
114
+ "tags": [],
115
+ "text": ""
116
+ },
117
+ "complexType": {
118
+ "original": "any",
119
+ "resolved": "any",
120
+ "references": {}
121
+ }
122
+ }];
123
+ }
124
+ }
@@ -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,145 @@
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
+ import { Translations } from '../../../helpers/TranslationUtils';
11
+ export class MobileRedirect {
12
+ constructor() {
13
+ this.infoTextTop = undefined;
14
+ this.infoTextBottom = undefined;
15
+ this.contact = undefined;
16
+ this.invalidValue = undefined;
17
+ this.waitingMobile = undefined;
18
+ this.orderStatus = undefined;
19
+ this.redirectLink = undefined;
20
+ this.qrCode = undefined;
21
+ this.prefilledPhone = false;
22
+ this.baseComponent = new BaseComponent(FlowSteps.MobileRedirect);
23
+ this.baseComponent.setEventEmitter(this.apiErrorEvent);
24
+ this.invalidValue = false;
25
+ this.waitingMobile = false;
26
+ }
27
+ async componentWillLoad() {
28
+ Events.flowStarted();
29
+ this.translations = await Translations.getValues();
30
+ this.infoTextTop = this.translations.MobileRedirectValues.InfoTop;
31
+ this.infoTextBottom = this.translations.MobileRedirectValues.InfoBottom;
32
+ let envUri = store.environment == 'QA' ? 'test' : 'ect';
33
+ let baseUri = store.hasIdBack ? 'https://onmd.id-kyc.com/' : 'https://onro.id-kyc.com/';
34
+ this.redirectLink = baseUri + envUri + '/mobileredirect?redirectId=' + store.redirectId;
35
+ if (store.phoneNumber && store.phoneNumber != '') {
36
+ this.contact = store.phoneNumber;
37
+ this.prefilledPhone = true;
38
+ }
39
+ var self = this;
40
+ QRCode.toDataURL(this.redirectLink, { type: 'image/png', errorCorrectionLevel: 'M', scale: 6 }, function (error, url) {
41
+ if (error)
42
+ console.error(error);
43
+ self.qrCode = url;
44
+ });
45
+ }
46
+ async componentDidLoad() {
47
+ await this.baseComponent.initialize();
48
+ await delay(5000);
49
+ await this.checkStatus();
50
+ while (this.orderStatus == OrderStatuses.Capturing || this.orderStatus == OrderStatuses.Waiting) {
51
+ await this.checkStatus();
52
+ await delay(5000);
53
+ }
54
+ }
55
+ async checkStatus() {
56
+ this.orderStatus = await this.baseComponent.apiCall.GetStatus(store.requestId);
57
+ if (this.orderStatus == OrderStatuses.FinishedCapturing) {
58
+ this.waitingMobile = false;
59
+ store.flowStatus = FlowStatus.COMPLETE;
60
+ }
61
+ if (this.orderStatus == OrderStatuses.NotFound) {
62
+ this.apiErrorEvent.emit({ message: 'No order was started for this process.' });
63
+ }
64
+ if (this.orderStatus == OrderStatuses.Capturing) {
65
+ this.infoTextTop = this.translations.MobileRedirectValues.InfoWaiting;
66
+ this.waitingMobile = true;
67
+ }
68
+ if (this.orderStatus == OrderStatuses.Aborted) {
69
+ this.waitingMobile = false;
70
+ this.infoTextTop = this.translations.MobileRedirectValues.InfoAborted;
71
+ Events.flowAborted();
72
+ }
73
+ }
74
+ async disconnectedCallback() {
75
+ await this.baseComponent.finalize();
76
+ }
77
+ async buttonClick() {
78
+ if (this.contact == '' || this.contact.length != 10) {
79
+ this.invalidValue == true;
80
+ return;
81
+ }
82
+ this.waitingMobile = true;
83
+ this.infoTextTop = this.translations.MobileRedirectValues.InfoWaiting;
84
+ try {
85
+ await this.baseComponent.apiCall.SendLink(this.redirectLink, this.contact);
86
+ }
87
+ catch (e) {
88
+ this.apiErrorEvent.emit(e);
89
+ }
90
+ }
91
+ handleChangeContact(ev) {
92
+ let value = ev.target ? ev.target.value : '';
93
+ this.contact = value.replace(/\D/g, '');
94
+ if (this.contact.length > 10) {
95
+ this.contact = this.contact.substring(0, 10);
96
+ }
97
+ this.invalidValue = this.contact.length != 10;
98
+ ev.target.value = this.contact;
99
+ }
100
+ render() {
101
+ 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.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.translations.GlobalValues.FooterText)))), h("div", { hidden: this.waitingMobile == false }, h("div", { class: "text-center" }, h("p", { class: "font-size-2" }, this.infoTextTop))))));
102
+ }
103
+ static get is() { return "mobile-redirect"; }
104
+ static get originalStyleUrls() {
105
+ return {
106
+ "$": ["mobile-redirect.css"]
107
+ };
108
+ }
109
+ static get styleUrls() {
110
+ return {
111
+ "$": ["mobile-redirect.css"]
112
+ };
113
+ }
114
+ static get states() {
115
+ return {
116
+ "infoTextTop": {},
117
+ "infoTextBottom": {},
118
+ "contact": {},
119
+ "invalidValue": {},
120
+ "waitingMobile": {},
121
+ "orderStatus": {},
122
+ "redirectLink": {},
123
+ "qrCode": {},
124
+ "prefilledPhone": {}
125
+ };
126
+ }
127
+ static get events() {
128
+ return [{
129
+ "method": "apiErrorEvent",
130
+ "name": "apiError",
131
+ "bubbles": true,
132
+ "cancelable": true,
133
+ "composed": true,
134
+ "docs": {
135
+ "tags": [],
136
+ "text": ""
137
+ },
138
+ "complexType": {
139
+ "original": "any",
140
+ "resolved": "any",
141
+ "references": {}
142
+ }
143
+ }];
144
+ }
145
+ }
@@ -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
+ }