@ekyc_qoobiss/qbs-ect-cmp 3.6.28 → 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 (47) hide show
  1. package/dist/cjs/TranslationUtils-b918ffb1.js +346 -0
  2. package/dist/cjs/agreement-check_19.cjs.entry.js +783 -284
  3. package/dist/cjs/random-actions.cjs.entry.js +5 -6
  4. package/dist/collection/components/base-component.js +0 -4
  5. package/dist/collection/components/common/agreement-check/agreement-check.js +6 -2
  6. package/dist/collection/components/common/camera-error/camera-error.js +7 -5
  7. package/dist/collection/components/common/capture-error/capture-error.js +12 -10
  8. package/dist/collection/components/common/how-to-info/how-to-info.js +11 -9
  9. package/dist/collection/components/common/id-back-capture/id-back-capture.js +8 -6
  10. package/dist/collection/components/common/id-capture/id-capture.js +6 -4
  11. package/dist/collection/components/common/id-tilt/id-tilt.js +6 -4
  12. package/dist/collection/components/common/random-actions/random-actions.js +5 -6
  13. package/dist/collection/components/common/selfie-capture/selfie-capture.js +7 -5
  14. package/dist/collection/components/common/selfie-tilt/selfie-tilt.js +8 -6
  15. package/dist/collection/components/flow/agreement-info/agreement-info.js +4 -2
  16. package/dist/collection/components/flow/end-redirect/end-redirect.js +5 -4
  17. package/dist/collection/components/flow/landing-validation/landing-validation.js +5 -3
  18. package/dist/collection/components/flow/mobile-redirect/mobile-redirect.js +8 -6
  19. package/dist/collection/components/flow/sms-code-validation/sms-code-validation.js +12 -10
  20. package/dist/esm/TranslationUtils-8ceeb437.js +339 -0
  21. package/dist/esm/agreement-check_19.entry.js +575 -76
  22. package/dist/esm/random-actions.entry.js +5 -6
  23. package/dist/qbs-ect-cmp/p-473a4636.entry.js +1 -0
  24. package/dist/qbs-ect-cmp/{p-c32a782a.entry.js → p-b2c9c8d7.entry.js} +2 -2
  25. package/dist/qbs-ect-cmp/p-e568a07c.js +1 -0
  26. package/dist/qbs-ect-cmp/qbs-ect-cmp.esm.js +1 -1
  27. package/dist/types/components/base-component.d.ts +0 -2
  28. package/dist/types/components/common/agreement-check/agreement-check.d.ts +2 -0
  29. package/dist/types/components/common/camera-error/camera-error.d.ts +1 -0
  30. package/dist/types/components/common/capture-error/capture-error.d.ts +1 -0
  31. package/dist/types/components/common/how-to-info/how-to-info.d.ts +2 -1
  32. package/dist/types/components/common/id-back-capture/id-back-capture.d.ts +1 -0
  33. package/dist/types/components/common/id-capture/id-capture.d.ts +1 -0
  34. package/dist/types/components/common/id-tilt/id-tilt.d.ts +1 -0
  35. package/dist/types/components/common/random-actions/random-actions.d.ts +2 -2
  36. package/dist/types/components/common/selfie-capture/selfie-capture.d.ts +2 -1
  37. package/dist/types/components/common/selfie-tilt/selfie-tilt.d.ts +2 -1
  38. package/dist/types/components/flow/agreement-info/agreement-info.d.ts +2 -1
  39. package/dist/types/components/flow/end-redirect/end-redirect.d.ts +2 -1
  40. package/dist/types/components/flow/landing-validation/landing-validation.d.ts +1 -0
  41. package/dist/types/components/flow/mobile-redirect/mobile-redirect.d.ts +1 -0
  42. package/dist/types/components/flow/sms-code-validation/sms-code-validation.d.ts +2 -1
  43. package/package.json +1 -1
  44. package/dist/cjs/base-component-aa9e52bf.js +0 -832
  45. package/dist/esm/base-component-b7f50d31.js +0 -824
  46. package/dist/qbs-ect-cmp/p-215a7e76.entry.js +0 -1
  47. package/dist/qbs-ect-cmp/p-7bedffaa.js +0 -1
@@ -3,7 +3,489 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-41696e0e.js');
6
- const baseComponent = require('./base-component-aa9e52bf.js');
6
+ const TranslationUtils = require('./TranslationUtils-b918ffb1.js');
7
+
8
+ var OrderStatuses;
9
+ (function (OrderStatuses) {
10
+ OrderStatuses[OrderStatuses["Capturing"] = 0] = "Capturing";
11
+ OrderStatuses[OrderStatuses["FinishedCapturing"] = 1] = "FinishedCapturing";
12
+ OrderStatuses[OrderStatuses["Waiting"] = 2] = "Waiting";
13
+ OrderStatuses[OrderStatuses["NotFound"] = 3] = "NotFound";
14
+ OrderStatuses[OrderStatuses["Aborted"] = 4] = "Aborted";
15
+ })(OrderStatuses || (OrderStatuses = {}));
16
+
17
+ var FlowSteps;
18
+ (function (FlowSteps) {
19
+ FlowSteps[FlowSteps["ComponentLoaded"] = 'component-loaded'] = "ComponentLoaded";
20
+ FlowSteps[FlowSteps["MobileRedirect"] = 'mobile-redirect'] = "MobileRedirect";
21
+ FlowSteps[FlowSteps["Landing"] = 'landing'] = "Landing";
22
+ FlowSteps[FlowSteps["Agreements"] = 'agreements'] = "Agreements";
23
+ FlowSteps[FlowSteps["OtpSend"] = 'otp-send'] = "OtpSend";
24
+ FlowSteps[FlowSteps["OtpCheck"] = 'otp-check'] = "OtpCheck";
25
+ FlowSteps[FlowSteps["CiFront"] = 'ci-front'] = "CiFront";
26
+ FlowSteps[FlowSteps["CiFrontHowTo"] = 'ci-front-how-to'] = "CiFrontHowTo";
27
+ FlowSteps[FlowSteps["CiFrontCapture"] = 'ci-front-capture'] = "CiFrontCapture";
28
+ FlowSteps[FlowSteps["CiBack"] = 'ci-back'] = "CiBack";
29
+ FlowSteps[FlowSteps["CiBackHowTo"] = 'ci-back-how-to'] = "CiBackHowTo";
30
+ FlowSteps[FlowSteps["CiBackCapture"] = 'ci-back-capture'] = "CiBackCapture";
31
+ FlowSteps[FlowSteps["CiTilt"] = 'ci-tilt'] = "CiTilt";
32
+ FlowSteps[FlowSteps["CiError"] = 'ci-error'] = "CiError";
33
+ FlowSteps[FlowSteps["SelfieHowTo"] = 'selfie-how-to'] = "SelfieHowTo";
34
+ FlowSteps[FlowSteps["SelfieTilt"] = 'selfie-tilt'] = "SelfieTilt";
35
+ FlowSteps[FlowSteps["SelfieCapture"] = 'selfie-capture'] = "SelfieCapture";
36
+ FlowSteps[FlowSteps["Selfie"] = 'selfie'] = "Selfie";
37
+ FlowSteps[FlowSteps["SelfieError"] = 'selfie-error'] = "SelfieError";
38
+ FlowSteps[FlowSteps["End"] = 'end'] = "End";
39
+ FlowSteps[FlowSteps["CameraError"] = 'camera-error'] = "CameraError";
40
+ })(FlowSteps || (FlowSteps = {}));
41
+ var FlowMoments;
42
+ (function (FlowMoments) {
43
+ FlowMoments[FlowMoments["Initialized"] = 'initialized'] = "Initialized";
44
+ FlowMoments[FlowMoments["Finalized"] = 'finalized'] = "Finalized";
45
+ FlowMoments[FlowMoments["None"] = 'none'] = "None";
46
+ })(FlowMoments || (FlowMoments = {}));
47
+
48
+ class ApiCall {
49
+ constructor() {
50
+ this.serviceErrors = ['Service Unavailable', 'Unauthorized'];
51
+ this.toBase64 = (file) => new Promise((resolve, reject) => {
52
+ const reader = new FileReader();
53
+ reader.readAsDataURL(file);
54
+ reader.onload = () => resolve(reader.result);
55
+ reader.onerror = error => reject(error);
56
+ });
57
+ this.urls = new TranslationUtils.ApiUrls();
58
+ }
59
+ // private async http2<T>(method: string, url: string, data: string): Promise<T> {
60
+ // return new Promise((resolve, reject) => {
61
+ // var xhr = new XMLHttpRequest();
62
+ // xhr.open(method, url);
63
+ // xhr.onload = function () {
64
+ // if (xhr.status >= 200 && xhr.status < 300) {
65
+ // resolve(xhr.response);
66
+ // } else {
67
+ // reject({
68
+ // status: xhr.status,
69
+ // statusText: xhr.statusText,
70
+ // });
71
+ // }
72
+ // };
73
+ // xhr.onerror = function () {
74
+ // reject({
75
+ // status: xhr.status,
76
+ // statusText: xhr.statusText,
77
+ // });
78
+ // };
79
+ // xhr.send(data);
80
+ // });
81
+ // }
82
+ async http(request) {
83
+ const response = await fetch(request);
84
+ if (!response.ok) {
85
+ throw new Error(response.statusText);
86
+ }
87
+ try {
88
+ // may error if there is no body
89
+ return await response.json();
90
+ }
91
+ catch (ex) {
92
+ throw new Error('No json found in response ' + ex);
93
+ }
94
+ }
95
+ async post(url, data, withRetry = true) {
96
+ var request = new Request(TranslationUtils.state.apiBaseUrl + url, {
97
+ method: 'POST',
98
+ body: data,
99
+ headers: {
100
+ 'Content-Type': 'application/json',
101
+ 'Authorization': 'IDKYC-TOKEN ' + TranslationUtils.state.token,
102
+ },
103
+ });
104
+ try {
105
+ return await this.http(request);
106
+ }
107
+ catch (ex) {
108
+ if (!withRetry || this.serviceErrors.includes(ex.message)) {
109
+ throw ex;
110
+ }
111
+ this.AddLog('Error in post ', ex);
112
+ try {
113
+ var request2 = new Request(TranslationUtils.state.apiBaseUrl + url, {
114
+ method: 'POST',
115
+ body: data,
116
+ headers: {
117
+ 'Content-Type': 'application/json',
118
+ 'Authorization': 'IDKYC-TOKEN ' + TranslationUtils.state.token,
119
+ },
120
+ });
121
+ return await this.http(request2);
122
+ }
123
+ catch (ex2) {
124
+ this.AddLog('Error in post ', ex2);
125
+ var request3 = new Request(TranslationUtils.state.apiBaseUrl + url, {
126
+ method: 'POST',
127
+ body: data,
128
+ headers: {
129
+ 'Content-Type': 'application/json',
130
+ 'Authorization': 'IDKYC-TOKEN ' + TranslationUtils.state.token,
131
+ },
132
+ });
133
+ return await this.http(request3);
134
+ }
135
+ }
136
+ }
137
+ async get(url, withRetry = true) {
138
+ var request = new Request(TranslationUtils.state.apiBaseUrl + url, {
139
+ method: 'GET',
140
+ headers: {
141
+ 'Content-Type': 'application/json',
142
+ 'Authorization': 'IDKYC-TOKEN ' + TranslationUtils.state.token,
143
+ },
144
+ });
145
+ try {
146
+ return await this.http(request);
147
+ }
148
+ catch (ex) {
149
+ if (!withRetry || this.serviceErrors.includes(ex.message)) {
150
+ throw ex;
151
+ }
152
+ this.AddLog('Error in get ', ex);
153
+ try {
154
+ var request2 = new Request(TranslationUtils.state.apiBaseUrl + url, {
155
+ method: 'GET',
156
+ headers: {
157
+ 'Content-Type': 'application/json',
158
+ 'Authorization': 'IDKYC-TOKEN ' + TranslationUtils.state.token,
159
+ },
160
+ });
161
+ return await this.http(request2);
162
+ }
163
+ catch (ex2) {
164
+ this.AddLog('Error in get ', ex2);
165
+ var request3 = new Request(TranslationUtils.state.apiBaseUrl + url, {
166
+ method: 'GET',
167
+ headers: {
168
+ 'Content-Type': 'application/json',
169
+ 'Authorization': 'IDKYC-TOKEN ' + TranslationUtils.state.token,
170
+ },
171
+ });
172
+ return await this.http(request3);
173
+ }
174
+ }
175
+ }
176
+ async SendOTPCode(requestId, phoneNumber) {
177
+ let data = { requestId: requestId, phone: phoneNumber };
178
+ let jsonResp = await this.post(this.urls.OtpSend, JSON.stringify(data));
179
+ return jsonResp.sent;
180
+ }
181
+ async CheckOTPCode(requestId, otpCode) {
182
+ let data = { requestId: requestId, otp: otpCode };
183
+ let jsonResp = await this.post(this.urls.OtpCheck, JSON.stringify(data));
184
+ return jsonResp.valid;
185
+ }
186
+ async AddIdentificationRequest(deviceInfo, version) {
187
+ if (TranslationUtils.state.debug)
188
+ console.log('Calling identity request with store:' + JSON.stringify(TranslationUtils.state));
189
+ let data = {
190
+ requestId: TranslationUtils.state.requestId,
191
+ clientDeviceInfo: JSON.stringify(deviceInfo),
192
+ redirectId: TranslationUtils.state.redirectId,
193
+ phoneNumber: TranslationUtils.state.phoneNumber,
194
+ version: version,
195
+ };
196
+ let jsonResp = await this.post(this.urls.IdentityInsert, JSON.stringify(data));
197
+ if (TranslationUtils.state.requestId == '') {
198
+ TranslationUtils.state.requestId = jsonResp.requestId;
199
+ }
200
+ TranslationUtils.state.hasIdBack = jsonResp.hasIdBack;
201
+ TranslationUtils.state.hasIdTilt = jsonResp.hasIdTilt;
202
+ TranslationUtils.state.hasSelfieGesture = jsonResp.hasSelfieGesture;
203
+ TranslationUtils.state.agreementsValidation = jsonResp.agreementsValidation;
204
+ TranslationUtils.state.phoneValidation = jsonResp.phoneValidation;
205
+ TranslationUtils.state.phoneNumber = jsonResp.phoneNumber;
206
+ return true;
207
+ }
208
+ async UploadFileForRequestB64(requestId, type, file) {
209
+ let data = {
210
+ requestId: requestId,
211
+ type: type,
212
+ data: await this.toBase64(file),
213
+ };
214
+ let respJson = await this.post(this.urls.UploadCapture, JSON.stringify(data));
215
+ if (!TranslationUtils.state.hasIdBack && type == 'IdFront') {
216
+ return respJson.isValid;
217
+ }
218
+ if (TranslationUtils.state.hasIdBack && type == 'IdBack') {
219
+ return respJson.isValid;
220
+ }
221
+ if (type == 'Selfie') {
222
+ return respJson.isValid;
223
+ }
224
+ return true;
225
+ }
226
+ async GetAgreement(agreementType) {
227
+ let resp = await this.get(this.urls.GetAgreement + '?type=' + agreementType + '&requestId=' + TranslationUtils.state.requestId);
228
+ return resp.htmlText;
229
+ }
230
+ async GenerateAgreement(agreementType) {
231
+ let data = { requestId: TranslationUtils.state.requestId, documentType: agreementType };
232
+ let resp = await this.post(this.urls.GenerateAgreement, JSON.stringify(data));
233
+ return resp.generation;
234
+ }
235
+ async GetStatus(requestId) {
236
+ let resp = await this.get(this.urls.GetStatus + '?orderId=' + requestId);
237
+ return OrderStatuses[resp.status];
238
+ }
239
+ async SendLink(link, phoneNumber) {
240
+ let data = { requestId: TranslationUtils.state.requestId, link: link, phoneNumber: phoneNumber };
241
+ let resp = await this.post(this.urls.SendLink, JSON.stringify(data));
242
+ return resp.sent;
243
+ }
244
+ async AddLog(error, context) {
245
+ try {
246
+ let data = {
247
+ requestId: TranslationUtils.state.requestId,
248
+ action: TranslationUtils.FlowStatus[TranslationUtils.state.flowStatus],
249
+ message: JSON.stringify({ error, context }),
250
+ };
251
+ let result = await this.post(this.urls.AddLog, JSON.stringify(data), false);
252
+ return result.saved;
253
+ }
254
+ catch (_a) { }
255
+ }
256
+ async AddStep(step, moment) {
257
+ let data = { requestId: TranslationUtils.state.requestId, redirectId: TranslationUtils.state.redirectId, step: FlowSteps[step], moment: FlowMoments[moment], timestamp: new Date().toISOString() };
258
+ let result = await this.post(this.urls.AddStep, JSON.stringify(data));
259
+ return result.saved;
260
+ }
261
+ async AbortRequest() {
262
+ let result = await this.post(this.urls.AbortRequest, JSON.stringify({ requestId: TranslationUtils.state.requestId }));
263
+ return result.saved;
264
+ }
265
+ }
266
+
267
+ var MobileOS;
268
+ (function (MobileOS) {
269
+ MobileOS["Android"] = "android";
270
+ MobileOS["iOS"] = "ios";
271
+ MobileOS["Unknown"] = "unknown";
272
+ MobileOS["WindowsPhone"] = "Windows Phone";
273
+ })(MobileOS || (MobileOS = {}));
274
+ var DesktopOS;
275
+ (function (DesktopOS) {
276
+ DesktopOS["Linux"] = "linux";
277
+ DesktopOS["MacOS"] = "mac_os";
278
+ DesktopOS["Unix"] = "unix";
279
+ DesktopOS["Unknown"] = "unknown";
280
+ DesktopOS["Windows"] = "windows";
281
+ })(DesktopOS || (DesktopOS = {}));
282
+ var Browser;
283
+ (function (Browser) {
284
+ Browser["Chrome"] = "chrome";
285
+ Browser["Firefox"] = "firefox";
286
+ Browser["Safari"] = "safari";
287
+ Browser["Mi"] = "mi";
288
+ Browser["Unknown"] = "unknown";
289
+ })(Browser || (Browser = {}));
290
+
291
+ class DeviceDetection {
292
+ constructor() {
293
+ var _a, _b, _c, _d;
294
+ this.supportedScreenOrientation = (_b = (_a = ((screen === null || screen === void 0 ? void 0 : screen.orientation) || {}).type) !== null && _a !== void 0 ? _a : screen.mozOrientation) !== null && _b !== void 0 ? _b : screen.msOrientation;
295
+ this.safariScreenOrientation = !(screen === null || screen === void 0 ? void 0 : screen.orientation) && matchMedia('(orientation: portrait)').matches ? 'portrait-primary' : 'landscape-primary';
296
+ this.initialScreenOrientation = (_d = (_c = this.supportedScreenOrientation) !== null && _c !== void 0 ? _c : this.safariScreenOrientation) !== null && _d !== void 0 ? _d : 'portrait-primary';
297
+ this.userAgent = navigator.userAgent || navigator.vendor || window.opera || undefined;
298
+ this.isMobile = this.isMobileDevice();
299
+ this.isTablet = this.isTabletDevice();
300
+ this.isDesktop = !this.isMobile && !this.isTablet;
301
+ }
302
+ // Device typology
303
+ isMobileDevice() {
304
+ const regexs = [/(Android)(.+)(Mobile)/i, /BlackBerry/i, /iPhone|iPod/i, /Opera Mini/i, /IEMobile/i];
305
+ return regexs.some(b => this.userAgent.match(b));
306
+ }
307
+ isTabletDevice() {
308
+ const regex = /(ipad|tablet|(android(?!.*mobile))|(windows(?!.*phone)(.*touch))|kindle|playbook|silk|(puffin(?!.*(IP|AP|WP))))/;
309
+ return regex.test(this.userAgent.toLowerCase());
310
+ }
311
+ // Device Operating System
312
+ getMobileOS() {
313
+ if (this.isMobileDevice()) {
314
+ if (/windows phone/i.test(this.userAgent))
315
+ return MobileOS.WindowsPhone;
316
+ else if (/android/i.test(this.userAgent))
317
+ return MobileOS.Android;
318
+ else if (/iPad|iPhone|iPod/.test(this.userAgent) && !window.MSStream)
319
+ return MobileOS.iOS;
320
+ return MobileOS.Unknown;
321
+ }
322
+ else
323
+ return undefined;
324
+ }
325
+ getDesktopOS() {
326
+ if (this.isDesktop) {
327
+ if (this.userAgent.indexOf('Win') !== -1)
328
+ return DesktopOS.Windows;
329
+ else if (this.userAgent.indexOf('Mac') !== -1)
330
+ return DesktopOS.MacOS;
331
+ else if (this.userAgent.indexOf('X11') !== -1)
332
+ return DesktopOS.Unix;
333
+ else if (this.userAgent.indexOf('Linux') !== -1)
334
+ return DesktopOS.Linux;
335
+ return DesktopOS.Unknown;
336
+ }
337
+ else
338
+ return undefined;
339
+ }
340
+ getDeviceOS() {
341
+ var _a;
342
+ return (_a = this.getMobileOS()) !== null && _a !== void 0 ? _a : this.getDesktopOS();
343
+ }
344
+ getBrowser() {
345
+ if (/XiaoMi/i.test(this.userAgent) || /MiuiBrowser/i.test(this.userAgent))
346
+ return Browser.Mi;
347
+ var isChrome = /chrome/i.test(this.userAgent);
348
+ if (isChrome)
349
+ return Browser.Chrome;
350
+ if (/firefox/i.test(navigator.userAgent))
351
+ return Browser.Firefox;
352
+ else if (!isChrome && /safari/i.test(navigator.userAgent))
353
+ return Browser.Safari;
354
+ else
355
+ return Browser.Unknown;
356
+ }
357
+ getDevice() {
358
+ var device = {
359
+ isDesktop: this.isDesktop,
360
+ desktopOS: this.getDesktopOS(),
361
+ isWindowsDesktop: this.getDeviceOS() === DesktopOS.Windows,
362
+ isLinuxOrUnixDesktop: this.getDeviceOS() === DesktopOS.Linux || this.getDeviceOS() === DesktopOS.Unix,
363
+ isMobile: this.isMobile,
364
+ mobileOS: this.getMobileOS(),
365
+ isAndroidDevice: this.getDeviceOS() === MobileOS.Android,
366
+ isAppleDevice: this.getDeviceOS() === MobileOS.iOS || this.getDeviceOS() === DesktopOS.MacOS,
367
+ isUnknownMobileDevice: this.getDeviceOS() === MobileOS.Unknown,
368
+ browser: this.getBrowser(),
369
+ isTablet: this.isTablet,
370
+ initialScreenOrientation: this.initialScreenOrientation,
371
+ };
372
+ return device;
373
+ }
374
+ }
375
+
376
+ class Events {
377
+ static init(element) {
378
+ this.callingModule = element;
379
+ }
380
+ static flowEvent(step, moment) {
381
+ const eventName = `ect-${step.toString()}-${moment.toString()}-event`;
382
+ this.callingModule.dispatchEvent(new CustomEvent(eventName, {
383
+ detail: {},
384
+ bubbles: true,
385
+ cancelable: true,
386
+ composed: true,
387
+ }));
388
+ }
389
+ static flowStarted() {
390
+ this.callingModule.dispatchEvent(new CustomEvent('ect-started', {
391
+ detail: {},
392
+ bubbles: true,
393
+ cancelable: true,
394
+ composed: true,
395
+ }));
396
+ }
397
+ static flowAborted() {
398
+ sessionStorage.clear();
399
+ this.callingModule.dispatchEvent(new CustomEvent('ect-aborted', {
400
+ detail: {},
401
+ bubbles: true,
402
+ cancelable: true,
403
+ composed: true,
404
+ }));
405
+ }
406
+ static flowCompleted() {
407
+ sessionStorage.clear();
408
+ this.callingModule.dispatchEvent(new CustomEvent('ect-completed', {
409
+ detail: {},
410
+ bubbles: true,
411
+ cancelable: true,
412
+ composed: true,
413
+ }));
414
+ }
415
+ static flowError(error) {
416
+ sessionStorage.clear();
417
+ this.callingModule.dispatchEvent(new CustomEvent('ect-error', {
418
+ detail: { error },
419
+ bubbles: true,
420
+ cancelable: true,
421
+ composed: true,
422
+ }));
423
+ }
424
+ static tokenExpired() {
425
+ sessionStorage.clear();
426
+ this.callingModule.dispatchEvent(new CustomEvent('ect-session-expired', {
427
+ detail: {},
428
+ bubbles: true,
429
+ cancelable: true,
430
+ composed: true,
431
+ }));
432
+ }
433
+ }
434
+
435
+ class BaseComponent {
436
+ constructor(step) {
437
+ this.apiErrorEvent = null;
438
+ this.processError = null;
439
+ this.apiCall = new ApiCall();
440
+ if (step)
441
+ this.flowStep = step;
442
+ if (!TranslationUtils.state.device) {
443
+ TranslationUtils.state.device = new DeviceDetection().getDevice();
444
+ }
445
+ }
446
+ setEventEmitter(event) {
447
+ this.apiErrorEvent = event;
448
+ }
449
+ setErrorCallback(callback) {
450
+ this.processError = callback;
451
+ }
452
+ async logStep(step, moment) {
453
+ Events.flowEvent(step, moment);
454
+ try {
455
+ await this.apiCall.AddStep(step, moment);
456
+ }
457
+ catch (e) {
458
+ if (this.apiErrorEvent)
459
+ this.apiErrorEvent.emit(e);
460
+ else
461
+ this.processError(e, `${step}-${moment}`);
462
+ }
463
+ }
464
+ async initialize() {
465
+ Events.flowEvent(this.flowStep, FlowMoments.Initialized);
466
+ try {
467
+ await this.apiCall.AddStep(this.flowStep, FlowMoments.Initialized);
468
+ }
469
+ catch (e) {
470
+ if (this.apiErrorEvent)
471
+ this.apiErrorEvent.emit(e);
472
+ else
473
+ this.processError(e, `${this.flowStep}-${FlowMoments.Initialized}`);
474
+ }
475
+ }
476
+ async finalize() {
477
+ Events.flowEvent(this.flowStep, FlowMoments.Finalized);
478
+ try {
479
+ await this.apiCall.AddStep(this.flowStep, FlowMoments.Finalized);
480
+ }
481
+ catch (e) {
482
+ if (this.apiErrorEvent)
483
+ this.apiErrorEvent.emit(e);
484
+ else
485
+ this.processError(e, `${this.flowStep}-${FlowMoments.Finalized}`);
486
+ }
487
+ }
488
+ }
7
489
 
8
490
  const agreementCheckCss = "";
9
491
 
@@ -16,11 +498,14 @@ const AgreementCheck = class {
16
498
  this.htmlContent = undefined;
17
499
  this.buttonEnabled = undefined;
18
500
  this.scrollClass = 'scroll';
19
- this.apiCalls = new baseComponent.ApiCall();
501
+ this.apiCalls = new ApiCall();
20
502
  this.buttonEnabled = true;
21
- this.baseComponent = new baseComponent.BaseComponent(baseComponent.FlowSteps.CameraError);
503
+ this.baseComponent = new BaseComponent(FlowSteps.Agreements);
22
504
  this.baseComponent.setEventEmitter(this.apiErrorEvent);
23
505
  }
506
+ async componentWillLoad() {
507
+ this.translations = await TranslationUtils.Translations.getValues();
508
+ }
24
509
  async componentDidLoad() {
25
510
  try {
26
511
  this.htmlContent = await this.apiCalls.GetAgreement(this.agreementType);
@@ -34,7 +519,7 @@ const AgreementCheck = class {
34
519
  this.agreementAcceptance.emit({ agreementType: this.agreementType, result });
35
520
  }
36
521
  render() {
37
- let content = (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("div", { class: this.scrollClass, innerHTML: this.htmlContent }), index.h("div", { class: "pos-relative show-bottom" }, index.h("div", { class: "btn-buletin" }, index.h("div", { class: "d-flex two-buttons" }, index.h("button", { class: "normal-button red-button", disabled: !this.buttonEnabled, onClick: () => this.buttonClick(false) }, this.baseComponent.translations.AgreementCheckValues.ButtonNo), index.h("button", { class: "normal-button", disabled: !this.buttonEnabled, onClick: () => this.buttonClick(true) }, this.baseComponent.translations.AgreementCheckValues.ButtonYes)), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.baseComponent.translations.GlobalValues.FooterText))))));
522
+ let content = (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("div", { class: this.scrollClass, innerHTML: this.htmlContent }), index.h("div", { class: "pos-relative show-bottom" }, index.h("div", { class: "btn-buletin" }, index.h("div", { class: "d-flex two-buttons" }, index.h("button", { class: "normal-button red-button", disabled: !this.buttonEnabled, onClick: () => this.buttonClick(false) }, this.translations.AgreementCheckValues.ButtonNo), index.h("button", { class: "normal-button", disabled: !this.buttonEnabled, onClick: () => this.buttonClick(true) }, this.translations.AgreementCheckValues.ButtonYes)), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
38
523
  return this.htmlContent ? content : index.h("div", null);
39
524
  }
40
525
  };
@@ -50,7 +535,7 @@ const AgreementInfo = class {
50
535
  this.termsChecked = undefined;
51
536
  this.openAgreements = undefined;
52
537
  this.openTerms = undefined;
53
- this.baseComponent = new baseComponent.BaseComponent(baseComponent.FlowSteps.Agreements);
538
+ this.baseComponent = new BaseComponent(FlowSteps.Agreements);
54
539
  this.baseComponent.setEventEmitter(this.apiErrorEvent);
55
540
  this.agreementsChecked = false;
56
541
  this.termsChecked = false;
@@ -58,7 +543,8 @@ const AgreementInfo = class {
58
543
  async componentDidLoad() {
59
544
  await this.baseComponent.initialize();
60
545
  }
61
- componentWillLoad() {
546
+ async componentWillLoad() {
547
+ this.translations = await TranslationUtils.Translations.getValues();
62
548
  this.openAgreements = false;
63
549
  this.openTerms = false;
64
550
  }
@@ -67,11 +553,11 @@ const AgreementInfo = class {
67
553
  }
68
554
  async buttonClick() {
69
555
  if (this.agreementsChecked && this.termsChecked) {
70
- if (baseComponent.state.phoneValidation) {
71
- baseComponent.state.flowStatus = baseComponent.FlowStatus.PHONE;
556
+ if (TranslationUtils.state.phoneValidation) {
557
+ TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus.PHONE;
72
558
  }
73
559
  else {
74
- baseComponent.state.flowStatus = baseComponent.FlowStatus.ID;
560
+ TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus.ID;
75
561
  }
76
562
  }
77
563
  }
@@ -94,7 +580,7 @@ const AgreementInfo = class {
94
580
  render() {
95
581
  let agreementsCheck = index.h("agreement-check", { agreementType: "agreement" });
96
582
  let termsCheck = index.h("agreement-check", { agreementType: "terms" });
97
- let mainComp = (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("div", null, index.h("h1", { class: "text-center" }, this.baseComponent.translations.AgreementInfoValues.Title), index.h("div", { class: "d-flex space-between align-center" }, index.h("h3", { class: "main-text font-size-2", onClick: () => this.agreementsClicked() }, index.h("input", { type: "checkbox", readOnly: true, checked: this.agreementsChecked }), this.baseComponent.translations.AgreementInfoValues.Agreement)), index.h("div", { class: "d-flex space-between align-center" }, index.h("h3", { class: "main-text font-size-2", onClick: () => this.termsClicked() }, index.h("input", { type: "checkbox", readOnly: true, checked: this.termsChecked }), this.baseComponent.translations.AgreementInfoValues.Terms))), index.h("div", { class: "pos-relative show-bottom" }, index.h("div", { class: "btn-buletin" }, index.h("button", { class: "main-button", onClick: () => this.buttonClick() }, this.baseComponent.translations.AgreementInfoValues.Button), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.baseComponent.translations.GlobalValues.FooterText))))));
583
+ let mainComp = (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("div", null, index.h("h1", { class: "text-center" }, this.translations.AgreementInfoValues.Title), index.h("div", { class: "d-flex space-between align-center" }, index.h("h3", { class: "main-text font-size-2", onClick: () => this.agreementsClicked() }, index.h("input", { type: "checkbox", readOnly: true, checked: this.agreementsChecked }), this.translations.AgreementInfoValues.Agreement)), index.h("div", { class: "d-flex space-between align-center" }, index.h("h3", { class: "main-text font-size-2", onClick: () => this.termsClicked() }, index.h("input", { type: "checkbox", readOnly: true, checked: this.termsChecked }), this.translations.AgreementInfoValues.Terms))), index.h("div", { class: "pos-relative show-bottom" }, index.h("div", { class: "btn-buletin" }, index.h("button", { class: "main-button", onClick: () => this.buttonClick() }, this.translations.AgreementInfoValues.Button), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
98
584
  return this.openAgreements ? agreementsCheck : this.openTerms ? termsCheck : mainComp;
99
585
  }
100
586
  };
@@ -1402,7 +1888,7 @@ class ML5 {
1402
1888
  }
1403
1889
  async init() {
1404
1890
  return new Promise(async (resolve) => {
1405
- const modelPath = baseComponent.state.hasIdBack ? 'https://ekyc.blob.core.windows.net/$web/md/model.json' : 'https://ekyc.blob.core.windows.net/$web/model.json';
1891
+ const modelPath = TranslationUtils.state.hasIdBack ? 'https://ekyc.blob.core.windows.net/$web/md/model.json' : 'https://ekyc.blob.core.windows.net/$web/model.json';
1406
1892
  this.classifier = await ml5.imageClassifier(modelPath, this.loaded);
1407
1893
  this.faceapi = await ml5.faceApi({ withLandmarks: true, withDescriptors: false }, this.loaded);
1408
1894
  //warmup
@@ -1414,13 +1900,13 @@ class ML5 {
1414
1900
  });
1415
1901
  }
1416
1902
  loaded() {
1417
- if (baseComponent.state.debug)
1903
+ if (TranslationUtils.state.debug)
1418
1904
  console.log('ML5 LOADED!!!');
1419
1905
  }
1420
1906
  gotResults(error, results) {
1421
- if (baseComponent.state.debug)
1907
+ if (TranslationUtils.state.debug)
1422
1908
  console.log(error);
1423
- if (baseComponent.state.debug)
1909
+ if (TranslationUtils.state.debug)
1424
1910
  console.log(results);
1425
1911
  }
1426
1912
  }
@@ -1439,8 +1925,8 @@ const blobToBase64 = (blob) => {
1439
1925
  const delay = ms => new Promise(res => setTimeout(res, ms));
1440
1926
  const getLogMessage = (param_req_id = '', param_redirect_id = '', param_token = '') => {
1441
1927
  return {
1442
- store_values: { request_id: baseComponent.state.requestId, redirect_id: baseComponent.state.redirectId, token: baseComponent.state.token },
1443
- session_values: { request_id: sessionStorage.getItem(baseComponent.SessionKeys.RequestIdKey), token: sessionStorage.getItem(baseComponent.SessionKeys.TokenKey) },
1928
+ store_values: { request_id: TranslationUtils.state.requestId, redirect_id: TranslationUtils.state.redirectId, token: TranslationUtils.state.token },
1929
+ session_values: { request_id: sessionStorage.getItem(TranslationUtils.SessionKeys.RequestIdKey), token: sessionStorage.getItem(TranslationUtils.SessionKeys.TokenKey) },
1444
1930
  parameter_values: { request_id: param_req_id, redirect_id: param_redirect_id, token: param_token },
1445
1931
  };
1446
1932
  };
@@ -1784,7 +2270,7 @@ class FaceML5Detector {
1784
2270
  if (this.frontFace == null) {
1785
2271
  this.frontFace = face;
1786
2272
  // await this.drawFrame('green');
1787
- if (baseComponent.state.debug)
2273
+ if (TranslationUtils.state.debug)
1788
2274
  console.log('face ok');
1789
2275
  }
1790
2276
  else if (this.frontFace != null && this.presentedFacePose == null) {
@@ -4331,8 +4817,8 @@ class Stream {
4331
4817
  // if (this.faceDetection) Detector.getInstance().stopDetector();
4332
4818
  };
4333
4819
  this.initFacePose();
4334
- this.idML5Detector = IDML5Detector.getInstance(this, baseComponent.state.device.isMobile);
4335
- this.faceML5Detector = FaceML5Detector.getInstance(this, baseComponent.state.device.isMobile);
4820
+ this.idML5Detector = IDML5Detector.getInstance(this, TranslationUtils.state.device.isMobile);
4821
+ this.faceML5Detector = FaceML5Detector.getInstance(this, TranslationUtils.state.device.isMobile);
4336
4822
  this.verificationMode = mode;
4337
4823
  }
4338
4824
  static getInstance(mode) {
@@ -4403,7 +4889,7 @@ class Stream {
4403
4889
  return;
4404
4890
  var options = { mimeType: Stream.webmMimeType.mime, videoBitsPerSecond: 1500000 };
4405
4891
  if (!MediaRecorder.isTypeSupported(options.mimeType)) {
4406
- if (baseComponent.state.device.mobileOS == baseComponent.MobileOS.iOS || baseComponent.state.device.browser == baseComponent.Browser.Safari)
4892
+ if (TranslationUtils.state.device.mobileOS == MobileOS.iOS || TranslationUtils.state.device.browser == Browser.Safari)
4407
4893
  options.mimeType = Stream.mp4MimeType.mime;
4408
4894
  }
4409
4895
  this.recordedChunks = [];
@@ -4454,7 +4940,7 @@ class Stream {
4454
4940
  const context = canvas.getContext('2d');
4455
4941
  context.drawImage(this.videoElement, 0, 0, canvas.width, canvas.height);
4456
4942
  canvas.toBlob((frame) => {
4457
- if (frame.type === ImageFormat.JPEG && !baseComponent.state.device.isAppleDevice) {
4943
+ if (frame.type === ImageFormat.JPEG && !TranslationUtils.state.device.isAppleDevice) {
4458
4944
  try {
4459
4945
  addExifInImg(frame, this.stream.getTracks()[0], this.videoSize).then(updatedFrame => resolve(updatedFrame));
4460
4946
  }
@@ -4558,7 +5044,7 @@ const Camera = class {
4558
5044
  render() {
4559
5045
  let cameraVideoClass = 'cameraVideo';
4560
5046
  let cameraCanvasClass = 'cameraCanvas';
4561
- if (baseComponent.state.device.isDesktop) {
5047
+ if (TranslationUtils.state.device.isDesktop) {
4562
5048
  cameraVideoClass = 'cameraVideoSelfieDesk';
4563
5049
  cameraCanvasClass = 'cameraCanvasSelfieDesk';
4564
5050
  }
@@ -4605,27 +5091,28 @@ const CameraError = class {
4605
5091
  this.description = undefined;
4606
5092
  this.buttonDisabled = undefined;
4607
5093
  this.demoVideo = undefined;
4608
- this.baseComponent = new baseComponent.BaseComponent(baseComponent.FlowSteps.CameraError);
5094
+ this.baseComponent = new BaseComponent(FlowSteps.CameraError);
4609
5095
  this.baseComponent.setEventEmitter(this.apiErrorEvent);
4610
5096
  }
4611
5097
  async componentWillLoad() {
5098
+ this.translations = await TranslationUtils.Translations.getValues();
4612
5099
  this.buttonDisabled = false;
4613
- this.title = this.baseComponent.translations.CameraErrorValues.Title;
4614
- this.description = this.baseComponent.translations.CameraErrorValues.Description;
4615
- this.buttonText = this.baseComponent.translations.CameraErrorValues.Button;
5100
+ this.title = this.translations.CameraErrorValues.Title;
5101
+ this.description = this.translations.CameraErrorValues.Description;
5102
+ this.buttonText = this.translations.CameraErrorValues.Button;
4616
5103
  }
4617
5104
  async componentDidLoad() {
4618
5105
  await this.baseComponent.initialize();
4619
- if (baseComponent.state.device.mobileOS != baseComponent.MobileOS.iOS) {
4620
- this.demoVideo.src = this.baseComponent.translations.CameraErrorValues.HowToLink;
5106
+ if (TranslationUtils.state.device.mobileOS != MobileOS.iOS) {
5107
+ this.demoVideo.src = this.translations.CameraErrorValues.HowToLink;
4621
5108
  this.demoVideo.loop = true;
4622
5109
  this.demoVideo.play();
4623
5110
  }
4624
5111
  else {
4625
- var loaded = sessionStorage.getItem(baseComponent.SessionKeys.RefreshDoneKey);
5112
+ var loaded = sessionStorage.getItem(TranslationUtils.SessionKeys.RefreshDoneKey);
4626
5113
  if (loaded === 'true') {
4627
- sessionStorage.setItem(baseComponent.SessionKeys.RefreshDoneKey, 'false');
4628
- baseComponent.state.flowStatus = baseComponent.FlowStatus.LANDING;
5114
+ sessionStorage.setItem(TranslationUtils.SessionKeys.RefreshDoneKey, 'false');
5115
+ TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus.LANDING;
4629
5116
  }
4630
5117
  }
4631
5118
  }
@@ -4634,16 +5121,16 @@ const CameraError = class {
4634
5121
  }
4635
5122
  async buttonClick() {
4636
5123
  this.buttonDisabled = true;
4637
- if (baseComponent.state.device.mobileOS == baseComponent.MobileOS.iOS) {
4638
- sessionStorage.setItem(baseComponent.SessionKeys.RefreshDoneKey, 'true');
5124
+ if (TranslationUtils.state.device.mobileOS == MobileOS.iOS) {
5125
+ sessionStorage.setItem(TranslationUtils.SessionKeys.RefreshDoneKey, 'true');
4639
5126
  window.location.reload();
4640
5127
  }
4641
5128
  else {
4642
- baseComponent.state.flowStatus = baseComponent.FlowStatus.LANDING;
5129
+ TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus.LANDING;
4643
5130
  }
4644
5131
  }
4645
5132
  render() {
4646
- return (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("h1", { class: "color-red" }, this.title), index.h("div", null, index.h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.description)), index.h("div", { hidden: baseComponent.state.device.mobileOS == baseComponent.MobileOS.iOS }, index.h("video", { id: "howtoPermissions", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, index.h("source", { type: "video/mp4" }))), index.h("div", { class: "pos-relative show-bottom" }, index.h("div", { class: "btn-buletin" }, index.h("button", { class: "main-button", type: "button", disabled: this.buttonDisabled, onClick: () => this.buttonClick() }, this.buttonText), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.baseComponent.translations.GlobalValues.FooterText))))));
5133
+ return (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("h1", { class: "color-red" }, this.title), index.h("div", null, index.h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.description)), index.h("div", { hidden: TranslationUtils.state.device.mobileOS == MobileOS.iOS }, index.h("video", { id: "howtoPermissions", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, index.h("source", { type: "video/mp4" }))), index.h("div", { class: "pos-relative show-bottom" }, index.h("div", { class: "btn-buletin" }, index.h("button", { class: "main-button", type: "button", disabled: this.buttonDisabled, onClick: () => this.buttonClick() }, this.buttonText), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
4647
5134
  }
4648
5135
  };
4649
5136
  CameraError.style = cameraErrorCss;
@@ -4657,39 +5144,40 @@ const CaptureError = class {
4657
5144
  this.type = undefined;
4658
5145
  this.buttonEnabled = undefined;
4659
5146
  this.buttonText = undefined;
4660
- this.baseComponent = new baseComponent.BaseComponent(baseComponent.FlowSteps.CiError);
5147
+ this.baseComponent = new BaseComponent(FlowSteps.CiError);
4661
5148
  }
4662
5149
  async componentWillLoad() {
5150
+ this.translations = await TranslationUtils.Translations.getValues();
4663
5151
  this.buttonEnabled = false;
4664
5152
  if (this.type == 'ID') {
4665
- this.titleR1 = this.baseComponent.translations.IdCaptureValues.ErrorTitleR1;
4666
- this.titleR2 = this.baseComponent.translations.IdCaptureValues.ErrorTitleR2;
4667
- this.descriptionR1 = this.baseComponent.translations.IdCaptureValues.ErrorR1;
4668
- this.descriptionR2 = this.baseComponent.translations.IdCaptureValues.ErrorR2;
5153
+ this.titleR1 = this.translations.IdCaptureValues.ErrorTitleR1;
5154
+ this.titleR2 = this.translations.IdCaptureValues.ErrorTitleR2;
5155
+ this.descriptionR1 = this.translations.IdCaptureValues.ErrorR1;
5156
+ this.descriptionR2 = this.translations.IdCaptureValues.ErrorR2;
4669
5157
  }
4670
5158
  if (this.type == 'LIVENESS') {
4671
- this.titleR1 = this.baseComponent.translations.SelfieCaptureValues.ErrorTitleR1;
4672
- this.titleR2 = this.baseComponent.translations.SelfieCaptureValues.ErrorTitleR2;
4673
- this.descriptionR1 = this.baseComponent.translations.SelfieCaptureValues.ErrorR1;
4674
- this.descriptionR2 = this.baseComponent.translations.SelfieCaptureValues.ErrorR2;
5159
+ this.titleR1 = this.translations.SelfieCaptureValues.ErrorTitleR1;
5160
+ this.titleR2 = this.translations.SelfieCaptureValues.ErrorTitleR2;
5161
+ this.descriptionR1 = this.translations.SelfieCaptureValues.ErrorR1;
5162
+ this.descriptionR2 = this.translations.SelfieCaptureValues.ErrorR2;
4675
5163
  }
4676
5164
  }
4677
5165
  async componentDidLoad() {
4678
- await this.baseComponent.logStep(baseComponent.FlowSteps.CiError, baseComponent.FlowMoments.Initialized);
5166
+ await this.baseComponent.logStep(FlowSteps.CiError, FlowMoments.Initialized);
4679
5167
  for (let i = 5; i >= 1; i--) {
4680
5168
  this.buttonText = i.toString();
4681
5169
  await delay(1000);
4682
5170
  }
4683
- this.buttonText = this.baseComponent.translations.IdCaptureValues.Button;
5171
+ this.buttonText = this.translations.IdCaptureValues.Button;
4684
5172
  this.buttonEnabled = true;
4685
5173
  }
4686
5174
  async buttonClick() {
4687
5175
  this.buttonEnabled = false;
4688
- await this.baseComponent.logStep(baseComponent.FlowSteps.CiError, baseComponent.FlowMoments.Finalized);
5176
+ await this.baseComponent.logStep(FlowSteps.CiError, FlowMoments.Finalized);
4689
5177
  this.eventCaptureErrorDone.emit();
4690
5178
  }
4691
5179
  render() {
4692
- return (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("h1", { class: "color-red" }, this.titleR1), index.h("h1", { class: "color-red" }, this.titleR2), index.h("div", null, index.h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.descriptionR1), index.h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.descriptionR2)), index.h("div", { class: "pos-relative show-bottom" }, index.h("div", { class: "btn-buletin" }, index.h("button", { class: "main-button", type: "button", disabled: !this.buttonEnabled, onClick: () => this.buttonClick() }, this.buttonText), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.baseComponent.translations.GlobalValues.FooterText))))));
5180
+ return (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("h1", { class: "color-red" }, this.titleR1), index.h("h1", { class: "color-red" }, this.titleR2), index.h("div", null, index.h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.descriptionR1), index.h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.descriptionR2)), index.h("div", { class: "pos-relative show-bottom" }, index.h("div", { class: "btn-buletin" }, index.h("button", { class: "main-button", type: "button", disabled: !this.buttonEnabled, onClick: () => this.buttonClick() }, this.buttonText), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
4693
5181
  }
4694
5182
  };
4695
5183
  CaptureError.style = captureErrorCss;
@@ -4702,13 +5190,15 @@ const EndRedirect = class {
4702
5190
  constructor(hostRef) {
4703
5191
  index.registerInstance(this, hostRef);
4704
5192
  this.apiErrorEvent = index.createEvent(this, "apiError", 7);
4705
- this.baseComponent = new baseComponent.BaseComponent(baseComponent.FlowSteps.End);
5193
+ }
5194
+ async componentWillLoad() {
5195
+ this.translations = await TranslationUtils.Translations.getValues();
4706
5196
  }
4707
5197
  async componentDidLoad() {
4708
- baseComponent.Events.flowCompleted();
5198
+ Events.flowCompleted();
4709
5199
  }
4710
5200
  render() {
4711
- return (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("div", null, index.h("h1", { class: "text-center" }, this.baseComponent.translations.CompleteValues.Title), index.h("p", { class: "main-text font-size-18 mt-8 text-center" }, this.baseComponent.translations.CompleteValues.Description)), index.h("div", { class: "buletin-container" }, index.h("div", { class: "container-coin" }, index.h("div", { class: "coin-scale" }, index.h("div", { class: "coin-flip" }, index.h("img", { class: "w-40 coin", src: completeSvg }))))), index.h("div", { class: "text-center" }, index.h("p", { class: "font-weight-900 font-size-3 color-black-2 text-center mt-20" }, this.baseComponent.translations.CompleteValues.Message), index.h("p", null, baseComponent.state.requestId)), index.h("div", { class: "btn-buletin" }, index.h("p", { class: "main-text font-size-18 text-center mb-0" }, this.baseComponent.translations.GlobalValues.FooterText)))));
5201
+ return (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("div", null, index.h("h1", { class: "text-center" }, this.translations.CompleteValues.Title), index.h("p", { class: "main-text font-size-18 mt-8 text-center" }, this.translations.CompleteValues.Description)), index.h("div", { class: "buletin-container" }, index.h("div", { class: "container-coin" }, index.h("div", { class: "coin-scale" }, index.h("div", { class: "coin-flip" }, index.h("img", { class: "w-40 coin", src: completeSvg }))))), index.h("div", { class: "text-center" }, index.h("p", { class: "font-weight-900 font-size-3 color-black-2 text-center mt-20" }, this.translations.CompleteValues.Message), index.h("p", null, TranslationUtils.state.requestId)), index.h("div", { class: "btn-buletin" }, index.h("p", { class: "main-text font-size-18 text-center mb-0" }, this.translations.GlobalValues.FooterText)))));
4712
5202
  }
4713
5203
  };
4714
5204
  EndRedirect.style = endRedirectCss;
@@ -4723,7 +5213,7 @@ const ErrorEnd = class {
4723
5213
  }
4724
5214
  componentDidLoad() { }
4725
5215
  render() {
4726
- return (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("div", { class: "text-center" }, index.h("h1", null, this.errorTitle)), index.h("div", { class: "text-center" }, index.h("p", null, baseComponent.state.requestId)), index.h("div", null, index.h("p", { class: "color-red font-weight-bold font-size-2 text-center mt-10" }, this.message)))));
5216
+ return (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("div", { class: "text-center" }, index.h("h1", null, this.errorTitle)), index.h("div", { class: "text-center" }, index.h("p", null, TranslationUtils.state.requestId)), index.h("div", null, index.h("p", { class: "color-red font-weight-bold font-size-2 text-center mt-10" }, this.message)))));
4727
5217
  }
4728
5218
  };
4729
5219
  ErrorEnd.style = errorEndCss;
@@ -4742,34 +5232,35 @@ const HowToInfo = class {
4742
5232
  this.buttonEnabled = false;
4743
5233
  this.eventHowToInfoDone.emit();
4744
5234
  }
4745
- componentWillLoad() {
5235
+ async componentWillLoad() {
5236
+ this.translations = await TranslationUtils.Translations.getValues();
4746
5237
  this.subTitle = '';
4747
5238
  this.buttonEnabled = true;
4748
- if (baseComponent.state.flowStatus == baseComponent.FlowStatus.ID) {
4749
- this.topTitle = this.baseComponent.translations.HowToValues.IdTitile;
5239
+ if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.ID) {
5240
+ this.topTitle = this.translations.HowToValues.IdTitile;
4750
5241
  this.imagePath = 'https://ekyc.blob.core.windows.net/$web/howto_id.png';
4751
- this.buttonText = this.baseComponent.translations.HowToValues.IdButton;
5242
+ this.buttonText = this.translations.HowToValues.IdButton;
4752
5243
  if (this.idSide == 'front') {
4753
- this.baseComponent = new baseComponent.BaseComponent(baseComponent.FlowSteps.CiFrontHowTo);
4754
- this.subTitle = this.baseComponent.translations.HowToValues.IdSubTitileFace;
5244
+ this.baseComponent = new BaseComponent(FlowSteps.CiFrontHowTo);
5245
+ this.subTitle = this.translations.HowToValues.IdSubTitileFace;
4755
5246
  }
4756
5247
  if (this.idSide == 'back') {
4757
- this.baseComponent = new baseComponent.BaseComponent(baseComponent.FlowSteps.CiBackHowTo);
4758
- this.subTitle = this.baseComponent.translations.HowToValues.IdSubTitileBack;
5248
+ this.baseComponent = new BaseComponent(FlowSteps.CiBackHowTo);
5249
+ this.subTitle = this.translations.HowToValues.IdSubTitileBack;
4759
5250
  }
4760
5251
  }
4761
- if (baseComponent.state.flowStatus == baseComponent.FlowStatus.LIVENESS) {
4762
- this.baseComponent = new baseComponent.BaseComponent(baseComponent.FlowSteps.SelfieHowTo);
4763
- this.topTitle = this.baseComponent.translations.HowToValues.SelfieTitile;
4764
- this.subTitle = this.baseComponent.translations.HowToValues.SelfieSubTitile;
5252
+ if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.LIVENESS) {
5253
+ this.baseComponent = new BaseComponent(FlowSteps.SelfieHowTo);
5254
+ this.topTitle = this.translations.HowToValues.SelfieTitile;
5255
+ this.subTitle = this.translations.HowToValues.SelfieSubTitile;
4765
5256
  this.imagePath = 'https://ekyc.blob.core.windows.net/$web/howto_selfie.png';
4766
- this.buttonText = this.baseComponent.translations.HowToValues.SelfieButton;
5257
+ this.buttonText = this.translations.HowToValues.SelfieButton;
4767
5258
  }
4768
5259
  this.baseComponent.setEventEmitter(this.apiErrorEvent);
4769
5260
  }
4770
5261
  render() {
4771
5262
  let sub = this.subTitle != '' ? index.h("p", { class: "font-size-2" }, this.subTitle) : null;
4772
- return (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("div", { class: "div-ci align-center" }, index.h("img", { src: this.imagePath })), index.h("div", { class: "text-center" }, index.h("h1", null, this.topTitle), sub), index.h("div", { class: "pos-relative show-bottom" }, index.h("div", { class: "btn-buletin" }, index.h("button", { class: "main-button", disabled: !this.buttonEnabled, onClick: () => this.buttonClick() }, this.buttonText), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.baseComponent.translations.GlobalValues.FooterText))))));
5263
+ return (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("div", { class: "div-ci align-center" }, index.h("img", { src: this.imagePath })), index.h("div", { class: "text-center" }, index.h("h1", null, this.topTitle), sub), index.h("div", { class: "pos-relative show-bottom" }, index.h("div", { class: "btn-buletin" }, index.h("button", { class: "main-button", disabled: !this.buttonEnabled, onClick: () => this.buttonClick() }, this.buttonText), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
4773
5264
  }
4774
5265
  };
4775
5266
  HowToInfo.style = howToInfoCss;
@@ -4784,7 +5275,7 @@ class Cameras {
4784
5275
  const stream = await navigator.mediaDevices.getUserMedia(updatedConstraints);
4785
5276
  stream.getVideoTracks().forEach(track => {
4786
5277
  var _a, _b;
4787
- if (deviceInfo.browser === baseComponent.Browser.Firefox) {
5278
+ if (deviceInfo.browser === Browser.Firefox) {
4788
5279
  const settings = track.getSettings();
4789
5280
  let facingMode = settings.facingMode && settings.facingMode.length > 0 ? settings.facingMode[0] : '';
4790
5281
  facingMode = facingMode === 'e' ? 'environment' : facingMode;
@@ -4888,8 +5379,8 @@ class Cameras {
4888
5379
  let cam = new Cameras();
4889
5380
  let cameras = (await cam.GetCameras(device)).filter(c => c.facingMode == 'environment');
4890
5381
  var recommCamera = cam.GetRecommendedCamera(cameras);
4891
- baseComponent.state.cameraIds = cameras.map(camera => camera.deviceId);
4892
- baseComponent.state.cameraId = recommCamera === null || recommCamera === void 0 ? void 0 : recommCamera.deviceId;
5382
+ TranslationUtils.state.cameraIds = cameras.map(camera => camera.deviceId);
5383
+ TranslationUtils.state.cameraId = recommCamera === null || recommCamera === void 0 ? void 0 : recommCamera.deviceId;
4893
5384
  return true;
4894
5385
  }
4895
5386
  catch (e) {
@@ -4934,33 +5425,34 @@ const IdBackCapture = class {
4934
5425
  this.verified = false;
4935
5426
  this.cameras = new Cameras();
4936
5427
  this.showDemo = true;
4937
- this.baseComponent = new baseComponent.BaseComponent(baseComponent.FlowSteps.CiBackCapture);
5428
+ this.baseComponent = new BaseComponent(FlowSteps.CiBackCapture);
4938
5429
  }
4939
5430
  eventVideoStarted(event) {
4940
5431
  this.videoStarted = true;
4941
5432
  this.cameraSize = event.detail;
4942
5433
  }
4943
5434
  async componentWillLoad() {
5435
+ this.translations = await TranslationUtils.Translations.getValues();
4944
5436
  //this.videoDemoStyle = this.device.isMobile ? { width: window.screen.width + 'px', height: window.screen.height + 'px', 'object-fit': 'fill' } : {};
4945
5437
  if (!navigator.mediaDevices) {
4946
5438
  this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
4947
5439
  }
4948
5440
  }
4949
5441
  async componentDidLoad() {
4950
- await this.baseComponent.logStep(baseComponent.FlowSteps.CiBackCapture, baseComponent.FlowMoments.Initialized);
4951
- this.titleMesage = this.baseComponent.translations.IdCaptureValues.TtileRotate;
4952
- this.demoVideo.src = baseComponent.IdCaptureValues.IDPoseDemoMapping[IDPose.Rotate];
5442
+ await this.baseComponent.logStep(FlowSteps.CiBackCapture, FlowMoments.Initialized);
5443
+ this.titleMesage = this.translations.IdCaptureValues.TtileRotate;
5444
+ this.demoVideo.src = TranslationUtils.IdCaptureValues.IDPoseDemoMapping[IDPose.Rotate];
4953
5445
  this.demoVideo.play();
4954
- await delay(this.baseComponent.translations.GlobalValues.VideoLenght);
4955
- this.titleMesage = this.baseComponent.translations.IdCaptureValues.TitleBack;
4956
- this.demoVideo.src = baseComponent.IdCaptureValues.IDPoseDemoMapping[IDPose.BackStraight];
5446
+ await delay(this.translations.GlobalValues.VideoLenght);
5447
+ this.titleMesage = this.translations.IdCaptureValues.TitleBack;
5448
+ this.demoVideo.src = TranslationUtils.IdCaptureValues.IDPoseDemoMapping[IDPose.BackStraight];
4957
5449
  this.demoVideo.play();
4958
- await delay(this.baseComponent.translations.GlobalValues.VideoLenght);
5450
+ await delay(this.translations.GlobalValues.VideoLenght);
4959
5451
  this.showDemo = false;
4960
5452
  this.openCamera();
4961
5453
  }
4962
5454
  async openCamera() {
4963
- const constraints = this.cameras.GetConstraints(baseComponent.state.cameraId, baseComponent.state.device);
5455
+ const constraints = this.cameras.GetConstraints(TranslationUtils.state.cameraId, TranslationUtils.state.device);
4964
5456
  setTimeout(() => {
4965
5457
  navigator.mediaDevices
4966
5458
  .getUserMedia(constraints)
@@ -4989,7 +5481,7 @@ const IdBackCapture = class {
4989
5481
  if (this.verified)
4990
5482
  return;
4991
5483
  this.verified = true;
4992
- this.titleMesage = this.baseComponent.translations.IdCaptureValues.Loading;
5484
+ this.titleMesage = this.translations.IdCaptureValues.Loading;
4993
5485
  this.closeCamera();
4994
5486
  this.showDemo = true;
4995
5487
  this.demoVideo.src = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_id.mp4';
@@ -5002,7 +5494,7 @@ const IdBackCapture = class {
5002
5494
  this.captureTaken = true;
5003
5495
  let res = await Stream.getInstance(VerificationMode.Full).takePhoto();
5004
5496
  this.photoIsReady(res);
5005
- await this.baseComponent.logStep(baseComponent.FlowSteps.CiBackCapture, baseComponent.FlowMoments.Finalized);
5497
+ await this.baseComponent.logStep(FlowSteps.CiBackCapture, FlowMoments.Finalized);
5006
5498
  }
5007
5499
  render() {
5008
5500
  let cameraStyle;
@@ -5014,7 +5506,7 @@ const IdBackCapture = class {
5014
5506
  let titleClass = this.verified ? 'color-black-2 text-center' : 'color-white text-center';
5015
5507
  //let videoClass = this.device.isMobile ? '' : 'video-demo';
5016
5508
  let bgDemo = this.verified ? 'container' : 'container bg-black';
5017
- return (index.h("div", { class: bgDemo }, index.h("div", { class: "container-video" }, index.h("div", { hidden: this.showDemo == false }, index.h("video", { id: "howtoBack", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, index.h("source", { type: "video/mp4" }))), index.h("div", { hidden: this.showDemo }, index.h("div", { hidden: this.verified }, index.h("div", { class: "video-capture" }, index.h("div", { style: cameraStyle }, index.h("div", { style: cameraStyleInner }, index.h("camera-comp", { "capture-mode": "id" })))))), index.h("div", { class: "capture-title" }, index.h("h1", { class: titleClass }, this.titleMesage), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.baseComponent.translations.GlobalValues.FooterText)))));
5509
+ return (index.h("div", { class: bgDemo }, index.h("div", { class: "container-video" }, index.h("div", { hidden: this.showDemo == false }, index.h("video", { id: "howtoBack", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, index.h("source", { type: "video/mp4" }))), index.h("div", { hidden: this.showDemo }, index.h("div", { hidden: this.verified }, index.h("div", { class: "video-capture" }, index.h("div", { style: cameraStyle }, index.h("div", { style: cameraStyleInner }, index.h("camera-comp", { "capture-mode": "id" })))))), index.h("div", { class: "capture-title" }, index.h("h1", { class: titleClass }, this.titleMesage), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText)))));
5018
5510
  }
5019
5511
  get component() { return index.getElement(this); }
5020
5512
  };
@@ -5043,29 +5535,30 @@ const IdCapture = class {
5043
5535
  this.verified = false;
5044
5536
  this.cameras = new Cameras();
5045
5537
  this.showDemo = true;
5046
- this.baseComponent = new baseComponent.BaseComponent(baseComponent.FlowSteps.CiFrontCapture);
5538
+ this.baseComponent = new BaseComponent(FlowSteps.CiFrontCapture);
5047
5539
  }
5048
5540
  eventVideoStarted(event) {
5049
5541
  this.videoStarted = true;
5050
5542
  this.cameraSize = event.detail;
5051
5543
  }
5052
5544
  async componentWillLoad() {
5053
- this.titleMesage = this.baseComponent.translations.IdCaptureValues.Title;
5545
+ this.translations = await TranslationUtils.Translations.getValues();
5546
+ this.titleMesage = this.translations.IdCaptureValues.Title;
5054
5547
  //this.videoDemoStyle = this.device.isMobile ? { 'width': window.screen.width + 'px', 'height': window.screen.height + 'px', 'object-fit': 'fill' } : {};
5055
5548
  if (!navigator.mediaDevices) {
5056
5549
  this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
5057
5550
  }
5058
5551
  }
5059
5552
  async componentDidLoad() {
5060
- await this.baseComponent.logStep(baseComponent.FlowSteps.CiFrontCapture, baseComponent.FlowMoments.Initialized);
5061
- this.demoVideo.src = baseComponent.IdCaptureValues.IDPoseDemoMapping[IDPose.Straight];
5553
+ await this.baseComponent.logStep(FlowSteps.CiFrontCapture, FlowMoments.Initialized);
5554
+ this.demoVideo.src = TranslationUtils.IdCaptureValues.IDPoseDemoMapping[IDPose.Straight];
5062
5555
  this.demoVideo.play();
5063
- await delay(this.baseComponent.translations.GlobalValues.VideoLenght);
5556
+ await delay(this.translations.GlobalValues.VideoLenght);
5064
5557
  this.showDemo = false;
5065
5558
  this.openCamera();
5066
5559
  }
5067
5560
  async openCamera() {
5068
- const constraints = this.cameras.GetConstraints(baseComponent.state.cameraId, baseComponent.state.device);
5561
+ const constraints = this.cameras.GetConstraints(TranslationUtils.state.cameraId, TranslationUtils.state.device);
5069
5562
  setTimeout(() => {
5070
5563
  navigator.mediaDevices
5071
5564
  .getUserMedia(constraints)
@@ -5096,13 +5589,13 @@ const IdCapture = class {
5096
5589
  this.captureTaken = true;
5097
5590
  let res = await Stream.getInstance(VerificationMode.Full).takePhoto();
5098
5591
  this.photoIsReady(res);
5099
- await this.baseComponent.logStep(baseComponent.FlowSteps.CiFrontCapture, baseComponent.FlowMoments.Finalized);
5592
+ await this.baseComponent.logStep(FlowSteps.CiFrontCapture, FlowMoments.Finalized);
5100
5593
  }
5101
5594
  async verificationFinished() {
5102
5595
  if (this.verified)
5103
5596
  return;
5104
5597
  this.verified = true;
5105
- this.titleMesage = this.baseComponent.translations.IdCaptureValues.Loading;
5598
+ this.titleMesage = this.translations.IdCaptureValues.Loading;
5106
5599
  this.closeCamera();
5107
5600
  this.showDemo = true;
5108
5601
  this.demoVideo.src = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_id.mp4';
@@ -5124,7 +5617,7 @@ const IdCapture = class {
5124
5617
  let titleClass = this.verified ? 'color-black-2 text-center' : 'color-white text-center';
5125
5618
  //let videoClass = this.device.isMobile ? '' : 'video-demo';
5126
5619
  let bgDemo = this.verified ? 'container' : 'container bg-black';
5127
- return (index.h("div", { class: bgDemo }, index.h("div", { class: "container-video" }, index.h("div", { hidden: this.showDemo == false }, index.h("video", { id: "howtoFront", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, index.h("source", { type: "video/mp4" }))), index.h("div", { hidden: this.showDemo }, index.h("div", { hidden: this.verified }, index.h("div", { class: "video-capture" }, index.h("div", { style: cameraStyle }, index.h("div", { style: cameraStyleInner }, index.h("camera-comp", { "capture-mode": "id" })))))), index.h("div", { class: "capture-title" }, index.h("h1", { class: titleClass }, this.titleMesage), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.baseComponent.translations.GlobalValues.FooterText)))));
5620
+ return (index.h("div", { class: bgDemo }, index.h("div", { class: "container-video" }, index.h("div", { hidden: this.showDemo == false }, index.h("video", { id: "howtoFront", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, index.h("source", { type: "video/mp4" }))), index.h("div", { hidden: this.showDemo }, index.h("div", { hidden: this.verified }, index.h("div", { class: "video-capture" }, index.h("div", { style: cameraStyle }, index.h("div", { style: cameraStyleInner }, index.h("camera-comp", { "capture-mode": "id" })))))), index.h("div", { class: "capture-title" }, index.h("h1", { class: titleClass }, this.titleMesage), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText)))));
5128
5621
  }
5129
5622
  get component() { return index.getElement(this); }
5130
5623
  };
@@ -5153,29 +5646,30 @@ const IdTilt = class {
5153
5646
  this.verified = false;
5154
5647
  this.cameras = new Cameras();
5155
5648
  this.showDemo = true;
5156
- this.baseComponent = new baseComponent.BaseComponent(baseComponent.FlowSteps.CiTilt);
5649
+ this.baseComponent = new BaseComponent(FlowSteps.CiTilt);
5157
5650
  }
5158
5651
  eventVideoStarted(event) {
5159
5652
  this.videoStarted = true;
5160
5653
  this.cameraSize = event.detail;
5161
5654
  }
5162
5655
  async componentWillLoad() {
5163
- this.titleMesage = this.baseComponent.translations.IdCaptureValues.IDPoseMapping;
5656
+ this.translations = await TranslationUtils.Translations.getValues();
5657
+ this.titleMesage = this.translations.IdCaptureValues.IDPoseMapping;
5164
5658
  //this.videoDemoStyle = this.device.isMobile ? { 'width': window.screen.width + 'px', 'height': window.screen.height + 'px', 'object-fit': 'fill' } : {};
5165
5659
  if (!navigator.mediaDevices) {
5166
5660
  this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
5167
5661
  }
5168
5662
  }
5169
5663
  async componentDidLoad() {
5170
- await this.baseComponent.logStep(baseComponent.FlowSteps.CiTilt, baseComponent.FlowMoments.Initialized);
5171
- this.demoVideo.src = baseComponent.IdCaptureValues.IDPoseDemoMapping[IDPose.Tilted];
5664
+ await this.baseComponent.logStep(FlowSteps.CiTilt, FlowMoments.Initialized);
5665
+ this.demoVideo.src = TranslationUtils.IdCaptureValues.IDPoseDemoMapping[IDPose.Tilted];
5172
5666
  this.demoVideo.play();
5173
- await delay(this.baseComponent.translations.GlobalValues.VideoLenght);
5667
+ await delay(this.translations.GlobalValues.VideoLenght);
5174
5668
  this.showDemo = false;
5175
5669
  this.openCamera();
5176
5670
  }
5177
5671
  async openCamera() {
5178
- const constraints = this.cameras.GetConstraints(baseComponent.state.cameraId, baseComponent.state.device);
5672
+ const constraints = this.cameras.GetConstraints(TranslationUtils.state.cameraId, TranslationUtils.state.device);
5179
5673
  setTimeout(() => {
5180
5674
  navigator.mediaDevices
5181
5675
  .getUserMedia(constraints)
@@ -5206,13 +5700,13 @@ const IdTilt = class {
5206
5700
  this.captureTaken = true;
5207
5701
  let res = await Stream.getInstance(VerificationMode.Full).takePhoto();
5208
5702
  this.photoIsReady(res);
5209
- await this.baseComponent.logStep(baseComponent.FlowSteps.CiTilt, baseComponent.FlowMoments.Finalized);
5703
+ await this.baseComponent.logStep(FlowSteps.CiTilt, FlowMoments.Finalized);
5210
5704
  }
5211
5705
  async verificationFinished() {
5212
5706
  if (this.verified)
5213
5707
  return;
5214
5708
  this.verified = true;
5215
- this.titleMesage = this.baseComponent.translations.IdCaptureValues.Loading;
5709
+ this.titleMesage = this.translations.IdCaptureValues.Loading;
5216
5710
  this.closeCamera();
5217
5711
  this.showDemo = true;
5218
5712
  this.demoVideo.src = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_id.mp4';
@@ -5234,7 +5728,7 @@ const IdTilt = class {
5234
5728
  let titleClass = this.verified ? 'color-black-2 text-center' : 'color-white text-center';
5235
5729
  //let videoClass = this.device.isMobile ? '' : 'video-demo';
5236
5730
  let bgDemo = this.verified ? 'container' : 'container bg-black';
5237
- return (index.h("div", { class: bgDemo }, index.h("div", { class: "container-video" }, index.h("div", { hidden: this.showDemo == false }, index.h("video", { id: "howtoFront", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, index.h("source", { type: "video/mp4" }))), index.h("div", { hidden: this.showDemo }, index.h("div", { hidden: this.verified }, index.h("div", { class: "video-capture" }, index.h("div", { style: cameraStyle }, index.h("div", { style: cameraStyleInner }, index.h("camera-comp", { "capture-mode": "tilt" })))))), index.h("div", { class: "capture-title" }, index.h("h1", { class: titleClass }, this.titleMesage), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.baseComponent.translations.GlobalValues.FooterText)))));
5731
+ return (index.h("div", { class: bgDemo }, index.h("div", { class: "container-video" }, index.h("div", { hidden: this.showDemo == false }, index.h("video", { id: "howtoFront", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, index.h("source", { type: "video/mp4" }))), index.h("div", { hidden: this.showDemo }, index.h("div", { hidden: this.verified }, index.h("div", { class: "video-capture" }, index.h("div", { style: cameraStyle }, index.h("div", { style: cameraStyleInner }, index.h("camera-comp", { "capture-mode": "tilt" })))))), index.h("div", { class: "capture-title" }, index.h("h1", { class: titleClass }, this.titleMesage), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText)))));
5238
5732
  }
5239
5733
  get component() { return index.getElement(this); }
5240
5734
  };
@@ -5306,7 +5800,7 @@ function v4(options, buf, offset) {
5306
5800
  }
5307
5801
 
5308
5802
  const name = "@ekyc_qoobiss/qbs-ect-cmp";
5309
- const version$1 = "3.6.28";
5803
+ const version$1 = "3.6.29";
5310
5804
  const description = "Person Identification Component";
5311
5805
  const main = "./dist/index.cjs.js";
5312
5806
  const module$1 = "./dist/index.js";
@@ -5380,14 +5874,14 @@ const identificationComponentCss = "@font-face{font-family:'Inter';font-style:no
5380
5874
 
5381
5875
  const IdentificationComponent = class {
5382
5876
  async onTokenChange(newValue, _oldValue) {
5383
- if (baseComponent.state.debug)
5877
+ if (TranslationUtils.state.debug)
5384
5878
  console.log('Token change called with value: ' + newValue);
5385
5879
  if (newValue == '') {
5386
- newValue = baseComponent.state.token;
5880
+ newValue = TranslationUtils.state.token;
5387
5881
  return;
5388
5882
  }
5389
- if (baseComponent.state.token !== newValue) {
5390
- baseComponent.state.token = newValue;
5883
+ if (TranslationUtils.state.token !== newValue) {
5884
+ TranslationUtils.state.token = newValue;
5391
5885
  }
5392
5886
  }
5393
5887
  agreementAcceptanceEmitted(data) {
@@ -5419,15 +5913,15 @@ const IdentificationComponent = class {
5419
5913
  await this.baseComponent.apiCall.AddLog(apiLogData, getLogMessage(this.order_id, this.redirect_id, this.token));
5420
5914
  }
5421
5915
  catch (_g) { }
5422
- baseComponent.Events.flowError(this.errorTitle);
5423
- baseComponent.state.flowStatus = baseComponent.FlowStatus.ERROREND;
5916
+ Events.flowError(this.errorTitle);
5917
+ TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus.ERROREND;
5424
5918
  }
5425
5919
  handleScroll(ev) {
5426
5920
  }
5427
5921
  constructor(hostRef) {
5428
5922
  index.registerInstance(this, hostRef);
5429
5923
  this.logInit = {};
5430
- this.flowStatusToSet = baseComponent.FlowStatus.NONE;
5924
+ this.flowStatusToSet = TranslationUtils.FlowStatus.NONE;
5431
5925
  this.token = undefined;
5432
5926
  this.order_id = undefined;
5433
5927
  this.api_url = undefined;
@@ -5440,161 +5934,161 @@ const IdentificationComponent = class {
5440
5934
  this.errorTitle = undefined;
5441
5935
  }
5442
5936
  async componentWillLoad() {
5443
- baseComponent.Events.init(window);
5444
- baseComponent.Events.flowEvent(baseComponent.FlowSteps.ComponentLoaded, baseComponent.FlowMoments.Initialized);
5445
- baseComponent.state.apiBaseUrl = this.api_url;
5937
+ Events.init(window);
5938
+ Events.flowEvent(FlowSteps.ComponentLoaded, FlowMoments.Initialized);
5939
+ TranslationUtils.state.apiBaseUrl = this.api_url;
5446
5940
  if (this.env && this.env != '') {
5447
- baseComponent.state.environment = this.env;
5941
+ TranslationUtils.state.environment = this.env;
5448
5942
  }
5449
- this.baseComponent = new baseComponent.BaseComponent(baseComponent.FlowSteps.ComponentLoaded);
5943
+ this.baseComponent = new BaseComponent(FlowSteps.ComponentLoaded);
5450
5944
  this.baseComponent.setErrorCallback(this.apiErrorEmitter);
5451
- if (baseComponent.state.debug)
5945
+ if (TranslationUtils.state.debug)
5452
5946
  this.logInit = getLogMessage(this.order_id, this.redirect_id, this.token);
5453
5947
  if (this.token) {
5454
- if (baseComponent.state.debug)
5948
+ if (TranslationUtils.state.debug)
5455
5949
  console.log('Store Token set with property value: ' + this.token);
5456
- baseComponent.state.token = this.token;
5950
+ TranslationUtils.state.token = this.token;
5457
5951
  }
5458
- else if (baseComponent.state.token == '') {
5459
- baseComponent.state.token = sessionStorage.getItem(baseComponent.SessionKeys.TokenKey);
5460
- this.token = baseComponent.state.token;
5461
- if (baseComponent.state.debug)
5462
- console.log('Store Token set with session value: ' + baseComponent.state.token);
5952
+ else if (TranslationUtils.state.token == '') {
5953
+ TranslationUtils.state.token = sessionStorage.getItem(TranslationUtils.SessionKeys.TokenKey);
5954
+ this.token = TranslationUtils.state.token;
5955
+ if (TranslationUtils.state.debug)
5956
+ console.log('Store Token set with session value: ' + TranslationUtils.state.token);
5463
5957
  }
5464
5958
  if (this.redirect_id) {
5465
- baseComponent.state.redirectId = this.redirect_id;
5959
+ TranslationUtils.state.redirectId = this.redirect_id;
5466
5960
  }
5467
5961
  if (this.phone_number && this.phone_number != '') {
5468
- baseComponent.state.phoneNumber = this.phone_number;
5962
+ TranslationUtils.state.phoneNumber = this.phone_number;
5469
5963
  }
5470
5964
  if (this.lang_iso && this.lang_iso != '') {
5471
- baseComponent.state.langIso = this.lang_iso;
5965
+ TranslationUtils.state.langIso = this.lang_iso;
5472
5966
  }
5473
- var ini = sessionStorage.getItem(baseComponent.SessionKeys.InitialisedKey);
5967
+ var ini = sessionStorage.getItem(TranslationUtils.SessionKeys.InitialisedKey);
5474
5968
  if (ini && ini.toLowerCase() == 'true') {
5475
- baseComponent.state.initialised = true;
5969
+ TranslationUtils.state.initialised = true;
5476
5970
  }
5477
- var hasIdBk = sessionStorage.getItem(baseComponent.SessionKeys.HasIdBackKey);
5971
+ var hasIdBk = sessionStorage.getItem(TranslationUtils.SessionKeys.HasIdBackKey);
5478
5972
  if (hasIdBk && hasIdBk.toLowerCase() == 'true') {
5479
- baseComponent.state.hasIdBack = true;
5973
+ TranslationUtils.state.hasIdBack = true;
5480
5974
  }
5481
- var agrVal = sessionStorage.getItem(baseComponent.SessionKeys.AgreementValidationKey);
5975
+ var agrVal = sessionStorage.getItem(TranslationUtils.SessionKeys.AgreementValidationKey);
5482
5976
  if (agrVal && agrVal.toLowerCase() == 'true') {
5483
- baseComponent.state.agreementsValidation = true;
5977
+ TranslationUtils.state.agreementsValidation = true;
5484
5978
  }
5485
- var phoneVal = sessionStorage.getItem(baseComponent.SessionKeys.PhoneValidationKey);
5979
+ var phoneVal = sessionStorage.getItem(TranslationUtils.SessionKeys.PhoneValidationKey);
5486
5980
  if (phoneVal && phoneVal.toLowerCase() == 'true') {
5487
- baseComponent.state.phoneValidation = true;
5981
+ TranslationUtils.state.phoneValidation = true;
5488
5982
  }
5489
- const savedRequest = sessionStorage.getItem(baseComponent.SessionKeys.RequestIdKey);
5983
+ const savedRequest = sessionStorage.getItem(TranslationUtils.SessionKeys.RequestIdKey);
5490
5984
  if (this.order_id && this.order_id != '') {
5491
- baseComponent.state.requestId = this.order_id;
5492
- if (baseComponent.state.debug)
5985
+ TranslationUtils.state.requestId = this.order_id;
5986
+ if (TranslationUtils.state.debug)
5493
5987
  console.log('Current RequestId has value: ' + this.order_id);
5494
5988
  if (savedRequest && savedRequest != '' && savedRequest != this.order_id) {
5495
- if (baseComponent.state.debug)
5989
+ if (TranslationUtils.state.debug)
5496
5990
  console.log('Session RequestId: ' + savedRequest + ' has different value than property one: ' + this.order_id);
5497
- this.flowStatusToSet = baseComponent.FlowStatus.LANDING;
5498
- baseComponent.state.initialised = false;
5991
+ this.flowStatusToSet = TranslationUtils.FlowStatus.LANDING;
5992
+ TranslationUtils.state.initialised = false;
5499
5993
  }
5500
5994
  }
5501
5995
  else if (savedRequest) {
5502
- if (baseComponent.state.debug)
5996
+ if (TranslationUtils.state.debug)
5503
5997
  console.log('Current RequestId has no value, setting with session value: ' + savedRequest);
5504
- baseComponent.state.requestId = savedRequest;
5998
+ TranslationUtils.state.requestId = savedRequest;
5505
5999
  this.order_id = savedRequest;
5506
6000
  }
5507
- if (this.flowStatusToSet == baseComponent.FlowStatus.NONE) {
5508
- var flowSt = sessionStorage.getItem(baseComponent.SessionKeys.FlowStatusKey);
6001
+ if (this.flowStatusToSet == TranslationUtils.FlowStatus.NONE) {
6002
+ var flowSt = sessionStorage.getItem(TranslationUtils.SessionKeys.FlowStatusKey);
5509
6003
  if (flowSt) {
5510
- this.flowStatusToSet = baseComponent.FlowStatus[flowSt];
6004
+ this.flowStatusToSet = TranslationUtils.FlowStatus[flowSt];
5511
6005
  }
5512
6006
  else {
5513
- this.flowStatusToSet = baseComponent.FlowStatus.LANDING;
6007
+ this.flowStatusToSet = TranslationUtils.FlowStatus.LANDING;
5514
6008
  }
5515
6009
  }
5516
6010
  }
5517
6011
  async componentDidLoad() {
5518
6012
  await this.initializeRequest();
5519
- baseComponent.state.flowStatus = this.flowStatusToSet;
6013
+ TranslationUtils.state.flowStatus = this.flowStatusToSet;
5520
6014
  }
5521
6015
  componentWillRender() {
5522
6016
  if (this.idSide == '') {
5523
- this.idSide = baseComponent.state.hasIdBack ? 'front' : '';
6017
+ this.idSide = TranslationUtils.state.hasIdBack ? 'front' : '';
5524
6018
  }
5525
6019
  }
5526
6020
  async initializeRequest() {
5527
- if (baseComponent.state.initialised) {
6021
+ if (TranslationUtils.state.initialised) {
5528
6022
  return;
5529
6023
  }
5530
- if (baseComponent.state.environment == 'DEMO') {
5531
- baseComponent.state.initialised = true;
6024
+ if (TranslationUtils.state.environment == 'DEMO') {
6025
+ TranslationUtils.state.initialised = true;
5532
6026
  return;
5533
6027
  }
5534
- if (baseComponent.state.device.browser == baseComponent.Browser.Mi) {
5535
- this.apiErrorEmitter('Mi Browser nu este acceptat. Va rugam utilizati Chrome.', 'Request Initialisation RequestId:' + baseComponent.state.requestId + ' RedirectId:' + baseComponent.state.redirectId);
6028
+ if (TranslationUtils.state.device.browser == Browser.Mi) {
6029
+ this.apiErrorEmitter('Mi Browser nu este acceptat. Va rugam utilizati Chrome.', 'Request Initialisation RequestId:' + TranslationUtils.state.requestId + ' RedirectId:' + TranslationUtils.state.redirectId);
5536
6030
  return;
5537
6031
  }
5538
6032
  try {
5539
- if (baseComponent.state.debug)
6033
+ if (TranslationUtils.state.debug)
5540
6034
  this.baseComponent.apiCall.AddLog({ phase: 'debug mode' }, this.logInit);
5541
6035
  }
5542
6036
  catch (_a) { }
5543
6037
  try {
5544
- if (!baseComponent.state.device.isMobile && baseComponent.state.redirectId == '') {
5545
- baseComponent.state.redirectId = v4();
5546
- this.redirect_id = baseComponent.state.redirectId;
6038
+ if (!TranslationUtils.state.device.isMobile && TranslationUtils.state.redirectId == '') {
6039
+ TranslationUtils.state.redirectId = v4();
6040
+ this.redirect_id = TranslationUtils.state.redirectId;
5547
6041
  }
5548
- if (baseComponent.state.token != '' && (baseComponent.state.requestId != '' || baseComponent.state.redirectId != '')) {
5549
- baseComponent.state.initialised = await this.baseComponent.apiCall.AddIdentificationRequest(baseComponent.state.device, packageJson.version);
6042
+ if (TranslationUtils.state.token != '' && (TranslationUtils.state.requestId != '' || TranslationUtils.state.redirectId != '')) {
6043
+ TranslationUtils.state.initialised = await this.baseComponent.apiCall.AddIdentificationRequest(TranslationUtils.state.device, packageJson.version);
5550
6044
  if (!this.order_id || this.order_id == '') {
5551
- this.order_id = baseComponent.state.requestId;
6045
+ this.order_id = TranslationUtils.state.requestId;
5552
6046
  }
5553
6047
  }
5554
6048
  }
5555
6049
  catch (e) {
5556
- this.apiErrorEmitter(e, 'Request Initialisation RequestId:' + baseComponent.state.requestId + ' RedirectId:' + baseComponent.state.redirectId);
6050
+ this.apiErrorEmitter(e, 'Request Initialisation RequestId:' + TranslationUtils.state.requestId + ' RedirectId:' + TranslationUtils.state.redirectId);
5557
6051
  }
5558
6052
  ML5.getInstance();
5559
6053
  }
5560
6054
  disconnectedCallback() {
5561
- baseComponent.Events.flowEvent(baseComponent.FlowSteps.ComponentLoaded, baseComponent.FlowMoments.Finalized);
6055
+ Events.flowEvent(FlowSteps.ComponentLoaded, FlowMoments.Finalized);
5562
6056
  }
5563
6057
  render() {
5564
6058
  let currentBlock = (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("div", { class: "div-ci align-center" }, index.h("img", { src: loaderSvg })))));
5565
- if (baseComponent.state.device.isMobile || baseComponent.state.environment == 'DEMO') {
5566
- if (baseComponent.state.flowStatus == baseComponent.FlowStatus.LANDING) {
6059
+ if (TranslationUtils.state.device.isMobile || TranslationUtils.state.environment == 'DEMO') {
6060
+ if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.LANDING) {
5567
6061
  currentBlock = index.h("landing-validation", null);
5568
6062
  }
5569
6063
  }
5570
- else if (baseComponent.state.flowStatus != baseComponent.FlowStatus.NONE) {
6064
+ else if (TranslationUtils.state.flowStatus != TranslationUtils.FlowStatus.NONE) {
5571
6065
  currentBlock = index.h("mobile-redirect", null);
5572
6066
  }
5573
- if (baseComponent.state.flowStatus == baseComponent.FlowStatus.AGREEMENT) {
6067
+ if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.AGREEMENT) {
5574
6068
  currentBlock = index.h("agreement-info", null);
5575
6069
  }
5576
- if (baseComponent.state.flowStatus == baseComponent.FlowStatus.PHONE) {
6070
+ if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.PHONE) {
5577
6071
  currentBlock = index.h("sms-code-validation", null);
5578
6072
  }
5579
- if (baseComponent.state.flowStatus == baseComponent.FlowStatus.CODE) {
6073
+ if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.CODE) {
5580
6074
  currentBlock = index.h("sms-code-validation", null);
5581
6075
  }
5582
- if (baseComponent.state.flowStatus == baseComponent.FlowStatus.CODEERROR) {
6076
+ if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.CODEERROR) {
5583
6077
  currentBlock = index.h("sms-code-validation", null);
5584
6078
  }
5585
- if (baseComponent.state.flowStatus == baseComponent.FlowStatus.ID) {
6079
+ if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.ID) {
5586
6080
  currentBlock = index.h("process-id", null);
5587
6081
  }
5588
- if (baseComponent.state.flowStatus == baseComponent.FlowStatus.LIVENESS) {
6082
+ if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.LIVENESS) {
5589
6083
  currentBlock = index.h("user-liveness", { id: "camera" });
5590
6084
  }
5591
- if (baseComponent.state.flowStatus == baseComponent.FlowStatus.COMPLETE) {
6085
+ if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.COMPLETE) {
5592
6086
  currentBlock = index.h("end-redirect", null);
5593
6087
  }
5594
- if (baseComponent.state.flowStatus == baseComponent.FlowStatus.ERROREND) {
6088
+ if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.ERROREND) {
5595
6089
  currentBlock = index.h("error-end", { errorTitle: this.errorTitle, message: this.errorMessage });
5596
6090
  }
5597
- if (baseComponent.state.flowStatus == baseComponent.FlowStatus.CAMERAERROR) {
6091
+ if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.CAMERAERROR) {
5598
6092
  currentBlock = index.h("camera-error", null);
5599
6093
  }
5600
6094
  return index.h("div", null, currentBlock);
@@ -5621,48 +6115,49 @@ const LandingValidation = class {
5621
6115
  this.apiErrorEvent = index.createEvent(this, "apiError", 7);
5622
6116
  this.warningText = undefined;
5623
6117
  this.buttonDisabled = undefined;
5624
- this.baseComponent = new baseComponent.BaseComponent(baseComponent.FlowSteps.Landing);
6118
+ this.baseComponent = new BaseComponent(FlowSteps.Landing);
5625
6119
  this.baseComponent.setEventEmitter(this.apiErrorEvent);
5626
6120
  }
5627
6121
  async componentWillLoad() {
5628
- baseComponent.Events.flowStarted();
5629
- this.baseComponent.apiCall = new baseComponent.ApiCall();
6122
+ Events.flowStarted();
6123
+ this.translations = await TranslationUtils.Translations.getValues();
6124
+ this.baseComponent.apiCall = new ApiCall();
5630
6125
  this.buttonDisabled = false;
5631
6126
  await this.initRequest();
5632
6127
  }
5633
6128
  async componentDidLoad() {
5634
- if (baseComponent.state.environment !== 'DEMO') {
6129
+ if (TranslationUtils.state.environment !== 'DEMO') {
5635
6130
  await this.baseComponent.initialize();
5636
6131
  }
5637
6132
  }
5638
6133
  async initRequest() {
5639
- if (baseComponent.state.hasIdBack) {
5640
- this.warningText = this.baseComponent.translations.LandingValues.WarningMd;
6134
+ if (TranslationUtils.state.hasIdBack) {
6135
+ this.warningText = this.translations.LandingValues.WarningMd;
5641
6136
  }
5642
6137
  else {
5643
- this.warningText = this.baseComponent.translations.LandingValues.Warning;
6138
+ this.warningText = this.translations.LandingValues.Warning;
5644
6139
  }
5645
6140
  }
5646
6141
  async startFlow() {
5647
- if (baseComponent.state.initialised) {
6142
+ if (TranslationUtils.state.initialised) {
5648
6143
  this.buttonDisabled = true;
5649
- if (baseComponent.state.environment === 'DEMO') {
5650
- baseComponent.state.flowStatus = baseComponent.FlowStatus.COMPLETE;
6144
+ if (TranslationUtils.state.environment === 'DEMO') {
6145
+ TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus.COMPLETE;
5651
6146
  return;
5652
6147
  }
5653
- if (!(await Cameras.InitCameras(baseComponent.state.device))) {
5654
- if (baseComponent.state.device.mobileOS == baseComponent.MobileOS.iOS)
5655
- sessionStorage.setItem(baseComponent.SessionKeys.RefreshDoneKey, 'false');
5656
- baseComponent.state.flowStatus = baseComponent.FlowStatus.CAMERAERROR;
6148
+ if (!(await Cameras.InitCameras(TranslationUtils.state.device))) {
6149
+ if (TranslationUtils.state.device.mobileOS == MobileOS.iOS)
6150
+ sessionStorage.setItem(TranslationUtils.SessionKeys.RefreshDoneKey, 'false');
6151
+ TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus.CAMERAERROR;
5657
6152
  }
5658
- else if (baseComponent.state.agreementsValidation) {
5659
- baseComponent.state.flowStatus = baseComponent.FlowStatus.AGREEMENT;
6153
+ else if (TranslationUtils.state.agreementsValidation) {
6154
+ TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus.AGREEMENT;
5660
6155
  }
5661
- else if (baseComponent.state.phoneValidation) {
5662
- baseComponent.state.flowStatus = baseComponent.FlowStatus.PHONE;
6156
+ else if (TranslationUtils.state.phoneValidation) {
6157
+ TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus.PHONE;
5663
6158
  }
5664
6159
  else {
5665
- baseComponent.state.flowStatus = baseComponent.FlowStatus.ID;
6160
+ TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus.ID;
5666
6161
  }
5667
6162
  }
5668
6163
  }
@@ -5672,18 +6167,18 @@ const LandingValidation = class {
5672
6167
  async leaveFlow() {
5673
6168
  if (this.buttonDisabled)
5674
6169
  return;
5675
- baseComponent.state.initialised = false;
6170
+ TranslationUtils.state.initialised = false;
5676
6171
  try {
5677
6172
  await this.baseComponent.apiCall.AbortRequest();
5678
- baseComponent.Events.flowAborted();
6173
+ Events.flowAborted();
5679
6174
  }
5680
6175
  catch (e) {
5681
- baseComponent.Events.flowAborted();
6176
+ Events.flowAborted();
5682
6177
  this.apiErrorEvent.emit(e);
5683
6178
  }
5684
6179
  }
5685
6180
  render() {
5686
- return (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("div", null, index.h("h1", { class: "text-center" }, this.baseComponent.translations.LandingValues.Title), index.h("div", { class: "d-flex space-between align-center" }, index.h("p", { class: "main-text font-size-2" }, this.baseComponent.translations.LandingValues.Description), index.h("div", { class: "img-info" }, index.h("div", { class: "i-effect" }), index.h("img", { src: infoSvg })))), index.h("div", { class: "info-container" }, index.h("div", { class: "img-text" }, index.h("div", { class: "bg-img" }, index.h("img", { src: idSvg })), index.h("h3", null, this.baseComponent.translations.LandingValues.IdInfo)), index.h("div", { class: "img-text" }, index.h("div", { class: "bg-img" }, index.h("img", { src: deviceSvg })), index.h("h3", null, this.baseComponent.translations.LandingValues.DeviceInfo)), index.h("div", { class: "img-text" }, index.h("div", { class: "bg-img" }, index.h("img", { src: validationSvg })), index.h("h3", null, this.baseComponent.translations.LandingValues.SmsInfo))), index.h("div", { class: "terms-container" }, index.h("h3", { class: "font-size-2 mb-1 text-center" }, this.warningText)), index.h("div", { class: "pos-relative show-bottom" }, index.h("div", { class: "btn-buletin" }, index.h("button", { class: "main-button", type: "button", disabled: !baseComponent.state.initialised || this.buttonDisabled, onClick: () => this.startFlow() }, this.baseComponent.translations.LandingValues.Button), index.h("p", { class: "main-text font-size-2 link-text mb-0", onClick: () => this.leaveFlow() }, this.baseComponent.translations.LandingValues.ButtonLeave), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.baseComponent.translations.GlobalValues.FooterText))))));
6181
+ return (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("div", null, index.h("h1", { class: "text-center" }, this.translations.LandingValues.Title), index.h("div", { class: "d-flex space-between align-center" }, index.h("p", { class: "main-text font-size-2" }, this.translations.LandingValues.Description), index.h("div", { class: "img-info" }, index.h("div", { class: "i-effect" }), index.h("img", { src: infoSvg })))), index.h("div", { class: "info-container" }, index.h("div", { class: "img-text" }, index.h("div", { class: "bg-img" }, index.h("img", { src: idSvg })), index.h("h3", null, this.translations.LandingValues.IdInfo)), index.h("div", { class: "img-text" }, index.h("div", { class: "bg-img" }, index.h("img", { src: deviceSvg })), index.h("h3", null, this.translations.LandingValues.DeviceInfo)), index.h("div", { class: "img-text" }, index.h("div", { class: "bg-img" }, index.h("img", { src: validationSvg })), index.h("h3", null, this.translations.LandingValues.SmsInfo))), index.h("div", { class: "terms-container" }, index.h("h3", { class: "font-size-2 mb-1 text-center" }, this.warningText)), index.h("div", { class: "pos-relative show-bottom" }, index.h("div", { class: "btn-buletin" }, index.h("button", { class: "main-button", type: "button", disabled: !TranslationUtils.state.initialised || this.buttonDisabled, onClick: () => this.startFlow() }, this.translations.LandingValues.Button), index.h("p", { class: "main-text font-size-2 link-text mb-0", onClick: () => this.leaveFlow() }, this.translations.LandingValues.ButtonLeave), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
5687
6182
  }
5688
6183
  };
5689
6184
  LandingValidation.style = landingValidationCss;
@@ -8576,20 +9071,21 @@ const MobileRedirect = class {
8576
9071
  this.redirectLink = undefined;
8577
9072
  this.qrCode = undefined;
8578
9073
  this.prefilledPhone = false;
8579
- this.baseComponent = new baseComponent.BaseComponent(baseComponent.FlowSteps.MobileRedirect);
9074
+ this.baseComponent = new BaseComponent(FlowSteps.MobileRedirect);
8580
9075
  this.baseComponent.setEventEmitter(this.apiErrorEvent);
8581
9076
  this.invalidValue = false;
8582
9077
  this.waitingMobile = false;
8583
9078
  }
8584
9079
  async componentWillLoad() {
8585
- baseComponent.Events.flowStarted();
8586
- this.infoTextTop = this.baseComponent.translations.MobileRedirectValues.InfoTop;
8587
- this.infoTextBottom = this.baseComponent.translations.MobileRedirectValues.InfoBottom;
8588
- let envUri = baseComponent.state.environment == 'QA' ? 'test' : 'ect';
8589
- let baseUri = baseComponent.state.hasIdBack ? 'https://onmd.id-kyc.com/' : 'https://onro.id-kyc.com/';
8590
- this.redirectLink = baseUri + envUri + '/mobileredirect?redirectId=' + baseComponent.state.redirectId;
8591
- if (baseComponent.state.phoneNumber && baseComponent.state.phoneNumber != '') {
8592
- this.contact = baseComponent.state.phoneNumber;
9080
+ Events.flowStarted();
9081
+ this.translations = await TranslationUtils.Translations.getValues();
9082
+ this.infoTextTop = this.translations.MobileRedirectValues.InfoTop;
9083
+ this.infoTextBottom = this.translations.MobileRedirectValues.InfoBottom;
9084
+ let envUri = TranslationUtils.state.environment == 'QA' ? 'test' : 'ect';
9085
+ let baseUri = TranslationUtils.state.hasIdBack ? 'https://onmd.id-kyc.com/' : 'https://onro.id-kyc.com/';
9086
+ this.redirectLink = baseUri + envUri + '/mobileredirect?redirectId=' + TranslationUtils.state.redirectId;
9087
+ if (TranslationUtils.state.phoneNumber && TranslationUtils.state.phoneNumber != '') {
9088
+ this.contact = TranslationUtils.state.phoneNumber;
8593
9089
  this.prefilledPhone = true;
8594
9090
  }
8595
9091
  var self = this;
@@ -8603,28 +9099,28 @@ const MobileRedirect = class {
8603
9099
  await this.baseComponent.initialize();
8604
9100
  await delay(5000);
8605
9101
  await this.checkStatus();
8606
- while (this.orderStatus == baseComponent.OrderStatuses.Capturing || this.orderStatus == baseComponent.OrderStatuses.Waiting) {
9102
+ while (this.orderStatus == OrderStatuses.Capturing || this.orderStatus == OrderStatuses.Waiting) {
8607
9103
  await this.checkStatus();
8608
9104
  await delay(5000);
8609
9105
  }
8610
9106
  }
8611
9107
  async checkStatus() {
8612
- this.orderStatus = await this.baseComponent.apiCall.GetStatus(baseComponent.state.requestId);
8613
- if (this.orderStatus == baseComponent.OrderStatuses.FinishedCapturing) {
9108
+ this.orderStatus = await this.baseComponent.apiCall.GetStatus(TranslationUtils.state.requestId);
9109
+ if (this.orderStatus == OrderStatuses.FinishedCapturing) {
8614
9110
  this.waitingMobile = false;
8615
- baseComponent.state.flowStatus = baseComponent.FlowStatus.COMPLETE;
9111
+ TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus.COMPLETE;
8616
9112
  }
8617
- if (this.orderStatus == baseComponent.OrderStatuses.NotFound) {
9113
+ if (this.orderStatus == OrderStatuses.NotFound) {
8618
9114
  this.apiErrorEvent.emit({ message: 'No order was started for this process.' });
8619
9115
  }
8620
- if (this.orderStatus == baseComponent.OrderStatuses.Capturing) {
8621
- this.infoTextTop = this.baseComponent.translations.MobileRedirectValues.InfoWaiting;
9116
+ if (this.orderStatus == OrderStatuses.Capturing) {
9117
+ this.infoTextTop = this.translations.MobileRedirectValues.InfoWaiting;
8622
9118
  this.waitingMobile = true;
8623
9119
  }
8624
- if (this.orderStatus == baseComponent.OrderStatuses.Aborted) {
9120
+ if (this.orderStatus == OrderStatuses.Aborted) {
8625
9121
  this.waitingMobile = false;
8626
- this.infoTextTop = this.baseComponent.translations.MobileRedirectValues.InfoAborted;
8627
- baseComponent.Events.flowAborted();
9122
+ this.infoTextTop = this.translations.MobileRedirectValues.InfoAborted;
9123
+ Events.flowAborted();
8628
9124
  }
8629
9125
  }
8630
9126
  async disconnectedCallback() {
@@ -8635,7 +9131,7 @@ const MobileRedirect = class {
8635
9131
  return;
8636
9132
  }
8637
9133
  this.waitingMobile = true;
8638
- this.infoTextTop = this.baseComponent.translations.MobileRedirectValues.InfoWaiting;
9134
+ this.infoTextTop = this.translations.MobileRedirectValues.InfoWaiting;
8639
9135
  try {
8640
9136
  await this.baseComponent.apiCall.SendLink(this.redirectLink, this.contact);
8641
9137
  }
@@ -8653,7 +9149,7 @@ const MobileRedirect = class {
8653
9149
  ev.target.value = this.contact;
8654
9150
  }
8655
9151
  render() {
8656
- return (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("div", { hidden: this.waitingMobile }, index.h("div", { class: "text-center" }, index.h("p", { class: "font-size-2" }, this.infoTextTop)), index.h("div", { class: "qr-canvas align-center" }, index.h("img", { src: this.qrCode })), index.h("div", { class: "text-center" }, index.h("p", { class: "font-size-2" }, this.infoTextBottom)), index.h("div", { class: "input-container mb-15" }, index.h("label", { class: "font-size-18 mb-1 color-red", hidden: this.invalidValue == false }, index.h("b", null, this.baseComponent.translations.MobileRedirectValues.Validation)), index.h("input", { type: "text", id: "codeInput", class: "main-input", disabled: this.prefilledPhone, value: this.contact, onInput: ev => this.handleChangeContact(ev) })), index.h("div", { class: "pos-relative" }, index.h("div", { class: "btn-buletin" }, index.h("button", { class: "main-button", onClick: () => this.buttonClick() }, "Trimite"), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.baseComponent.translations.GlobalValues.FooterText)))), index.h("div", { hidden: this.waitingMobile == false }, index.h("div", { class: "text-center" }, index.h("p", { class: "font-size-2" }, this.infoTextTop))))));
9152
+ return (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("div", { hidden: this.waitingMobile }, index.h("div", { class: "text-center" }, index.h("p", { class: "font-size-2" }, this.infoTextTop)), index.h("div", { class: "qr-canvas align-center" }, index.h("img", { src: this.qrCode })), index.h("div", { class: "text-center" }, index.h("p", { class: "font-size-2" }, this.infoTextBottom)), index.h("div", { class: "input-container mb-15" }, index.h("label", { class: "font-size-18 mb-1 color-red", hidden: this.invalidValue == false }, index.h("b", null, this.translations.MobileRedirectValues.Validation)), index.h("input", { type: "text", id: "codeInput", class: "main-input", disabled: this.prefilledPhone, value: this.contact, onInput: ev => this.handleChangeContact(ev) })), index.h("div", { class: "pos-relative" }, index.h("div", { class: "btn-buletin" }, index.h("button", { class: "main-button", onClick: () => this.buttonClick() }, "Trimite"), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText)))), index.h("div", { hidden: this.waitingMobile == false }, index.h("div", { class: "text-center" }, index.h("p", { class: "font-size-2" }, this.infoTextTop))))));
8657
9153
  }
8658
9154
  };
8659
9155
  MobileRedirect.style = mobileRedirectCss;
@@ -8698,7 +9194,7 @@ const ProcessId = class {
8698
9194
  this.showTimeout = undefined;
8699
9195
  this.showInvalid = undefined;
8700
9196
  this.flow = undefined;
8701
- this.baseComponent = new baseComponent.BaseComponent(baseComponent.FlowSteps.CiBack);
9197
+ this.baseComponent = new BaseComponent(FlowSteps.CiBack);
8702
9198
  this.baseComponent.setEventEmitter(this.apiErrorEvent);
8703
9199
  }
8704
9200
  componentWillLoad() {
@@ -8715,7 +9211,7 @@ const ProcessId = class {
8715
9211
  back: null,
8716
9212
  tilt: null,
8717
9213
  };
8718
- if (baseComponent.state.hasIdBack) {
9214
+ if (TranslationUtils.state.hasIdBack) {
8719
9215
  this.flow.back = {
8720
9216
  photoDone: false,
8721
9217
  recordingDone: false,
@@ -8725,7 +9221,7 @@ const ProcessId = class {
8725
9221
  recType: CaptureUploadTypes.IdBackVideo,
8726
9222
  };
8727
9223
  }
8728
- if (baseComponent.state.hasIdTilt) {
9224
+ if (TranslationUtils.state.hasIdTilt) {
8729
9225
  this.flow.tilt = {
8730
9226
  photoDone: true,
8731
9227
  recordingDone: false,
@@ -8825,7 +9321,7 @@ const ProcessId = class {
8825
9321
  if (photoFile == null || uploadType == '') {
8826
9322
  return false;
8827
9323
  }
8828
- var uploadResult = await this.baseComponent.apiCall.UploadFileForRequestB64(baseComponent.state.requestId, uploadType, photoFile);
9324
+ var uploadResult = await this.baseComponent.apiCall.UploadFileForRequestB64(TranslationUtils.state.requestId, uploadType, photoFile);
8829
9325
  if (uploadResult) {
8830
9326
  return true;
8831
9327
  }
@@ -8839,7 +9335,7 @@ const ProcessId = class {
8839
9335
  if (recordingFile == null) {
8840
9336
  return;
8841
9337
  }
8842
- var uploadResult = await this.baseComponent.apiCall.UploadFileForRequestB64(baseComponent.state.requestId, uploadType, recordingFile);
9338
+ var uploadResult = await this.baseComponent.apiCall.UploadFileForRequestB64(TranslationUtils.state.requestId, uploadType, recordingFile);
8843
9339
  if (uploadResult) {
8844
9340
  return true;
8845
9341
  }
@@ -8872,10 +9368,10 @@ const ProcessId = class {
8872
9368
  async endFlow() {
8873
9369
  if (this.captureStep == IdCaptureFlowStatus.IdFront) {
8874
9370
  if (this.flow.front.photoDone && this.flow.front.recordingDone) {
8875
- if (baseComponent.state.hasIdBack) {
9371
+ if (TranslationUtils.state.hasIdBack) {
8876
9372
  this.captureStep = IdCaptureFlowStatus.IdBack;
8877
9373
  }
8878
- else if (baseComponent.state.hasIdTilt) {
9374
+ else if (TranslationUtils.state.hasIdTilt) {
8879
9375
  this.captureStep = IdCaptureFlowStatus.Tilt;
8880
9376
  }
8881
9377
  else {
@@ -8886,9 +9382,9 @@ const ProcessId = class {
8886
9382
  return;
8887
9383
  }
8888
9384
  }
8889
- if (this.captureStep == IdCaptureFlowStatus.IdBack && baseComponent.state.hasIdBack) {
9385
+ if (this.captureStep == IdCaptureFlowStatus.IdBack && TranslationUtils.state.hasIdBack) {
8890
9386
  if (this.flow.back.photoDone && this.flow.back.recordingDone) {
8891
- if (baseComponent.state.hasIdTilt) {
9387
+ if (TranslationUtils.state.hasIdTilt) {
8892
9388
  this.captureStep = IdCaptureFlowStatus.Tilt;
8893
9389
  }
8894
9390
  else {
@@ -8899,7 +9395,7 @@ const ProcessId = class {
8899
9395
  return;
8900
9396
  }
8901
9397
  }
8902
- if (this.captureStep == IdCaptureFlowStatus.Tilt && baseComponent.state.hasIdTilt) {
9398
+ if (this.captureStep == IdCaptureFlowStatus.Tilt && TranslationUtils.state.hasIdTilt) {
8903
9399
  if (this.flow.tilt.photoDone && this.flow.tilt.recordingDone) {
8904
9400
  this.captureStep = IdCaptureFlowStatus.End;
8905
9401
  }
@@ -8910,15 +9406,15 @@ const ProcessId = class {
8910
9406
  if (this.captureStep != IdCaptureFlowStatus.End) {
8911
9407
  return;
8912
9408
  }
8913
- baseComponent.state.flowStatus = baseComponent.FlowStatus.LIVENESS;
9409
+ TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus.LIVENESS;
8914
9410
  }
8915
9411
  async disconnectedCallback() {
8916
9412
  await this.baseComponent.finalize();
8917
9413
  }
8918
9414
  switchCamera() {
8919
9415
  if (this.captureRetryCount == 1) {
8920
- let camIndex = baseComponent.state.cameraIds.indexOf(baseComponent.state.cameraId);
8921
- baseComponent.state.cameraId = camIndex === baseComponent.state.cameraIds.length - 1 ? baseComponent.state.cameraIds[0] : baseComponent.state.cameraIds[camIndex + 1];
9416
+ let camIndex = TranslationUtils.state.cameraIds.indexOf(TranslationUtils.state.cameraId);
9417
+ TranslationUtils.state.cameraId = camIndex === TranslationUtils.state.cameraIds.length - 1 ? TranslationUtils.state.cameraIds[0] : TranslationUtils.state.cameraIds[camIndex + 1];
8922
9418
  this.captureRetryCount = 0;
8923
9419
  }
8924
9420
  else {
@@ -8980,7 +9476,7 @@ const SelfieCapture = class {
8980
9476
  this.cameras = new Cameras();
8981
9477
  this.demoEnded = false;
8982
9478
  this.uploadingLink = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_selfie.mp4';
8983
- this.baseComponent = new baseComponent.BaseComponent(baseComponent.FlowSteps.SelfieCapture);
9479
+ this.baseComponent = new BaseComponent(FlowSteps.SelfieCapture);
8984
9480
  }
8985
9481
  eventVideoStarted(event) {
8986
9482
  this.videoStarted = true;
@@ -8989,23 +9485,24 @@ const SelfieCapture = class {
8989
9485
  this.captureHeight = height - Math.round((window.screen.height - height) / 2);
8990
9486
  this.captureWidth = Math.round((this.captureHeight * 9) / 16);
8991
9487
  }
8992
- componentWillLoad() {
8993
- this.titleMesage = this.baseComponent.translations.SelfieCaptureValues.Title;
9488
+ async componentWillLoad() {
9489
+ this.translations = await TranslationUtils.Translations.getValues();
9490
+ this.titleMesage = this.translations.SelfieCaptureValues.Title;
8994
9491
  //this.videoDemoStyle = this.device.isMobile ? { 'width': window.screen.width + 'px', 'height': window.screen.height + 'px', 'object-fit': 'fill' } : {};
8995
9492
  if (!navigator.mediaDevices) {
8996
9493
  this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
8997
9494
  }
8998
9495
  }
8999
9496
  async componentDidLoad() {
9000
- await this.baseComponent.logStep(baseComponent.FlowSteps.SelfieCapture, baseComponent.FlowMoments.Initialized);
9001
- this.demoVideo.src = baseComponent.SelfieCaptureValues.FacePoseDemoMapping[FacePose.Main];
9497
+ await this.baseComponent.logStep(FlowSteps.SelfieCapture, FlowMoments.Initialized);
9498
+ this.demoVideo.src = TranslationUtils.SelfieCaptureValues.FacePoseDemoMapping[FacePose.Main];
9002
9499
  this.demoVideo.play();
9003
- await delay(this.baseComponent.translations.GlobalValues.VideoLenght);
9500
+ await delay(this.translations.GlobalValues.VideoLenght);
9004
9501
  this.demoEnded = true;
9005
9502
  this.openCamera();
9006
9503
  }
9007
9504
  async openCamera() {
9008
- const constraints = this.cameras.GetConstraints('', baseComponent.state.device, true);
9505
+ const constraints = this.cameras.GetConstraints('', TranslationUtils.state.device, true);
9009
9506
  setTimeout(() => {
9010
9507
  navigator.mediaDevices
9011
9508
  .getUserMedia(constraints)
@@ -9035,13 +9532,13 @@ const SelfieCapture = class {
9035
9532
  this.captureTaken = true;
9036
9533
  let res = await Stream.getInstance(VerificationMode.Full).takePhoto();
9037
9534
  this.photoIsReady(res);
9038
- await this.baseComponent.logStep(baseComponent.FlowSteps.SelfieCapture, baseComponent.FlowMoments.Finalized);
9535
+ await this.baseComponent.logStep(FlowSteps.SelfieCapture, FlowMoments.Finalized);
9039
9536
  }
9040
9537
  verificationFinished() {
9041
9538
  if (this.verified)
9042
9539
  return;
9043
9540
  this.verified = true;
9044
- this.titleMesage = this.baseComponent.translations.SelfieCaptureValues.Loading;
9541
+ this.titleMesage = this.translations.SelfieCaptureValues.Loading;
9045
9542
  this.closeCamera();
9046
9543
  this.demoEnded = false;
9047
9544
  this.demoVideo.src = this.uploadingLink;
@@ -9050,7 +9547,7 @@ const SelfieCapture = class {
9050
9547
  }
9051
9548
  render() {
9052
9549
  let cameraStyle;
9053
- if (baseComponent.state.device.isMobile && this.videoStarted) {
9550
+ if (TranslationUtils.state.device.isMobile && this.videoStarted) {
9054
9551
  cameraStyle = {
9055
9552
  'width': this.captureWidth + 'px',
9056
9553
  'height': this.captureHeight + 'px',
@@ -9063,7 +9560,7 @@ const SelfieCapture = class {
9063
9560
  let titleClass = this.verified ? 'color-black-2 text-center' : 'color-white text-center';
9064
9561
  //let videoClass = this.device.isMobile ? '' : 'video-demo';
9065
9562
  let bgDemo = this.verified ? 'container' : 'container bg-black';
9066
- return (index.h("div", { class: bgDemo }, index.h("div", { class: "container-video" }, index.h("div", { hidden: this.demoEnded }, index.h("video", { id: "howtoSelfie", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, index.h("source", { type: "video/mp4" }))), index.h("div", { hidden: this.demoEnded == false }, index.h("div", { hidden: this.verified }, index.h("div", { class: "video-capture" }, index.h("div", { style: cameraStyle }, index.h("camera-comp", { "capture-mode": "selfie" }))))), index.h("div", { class: "capture-title" }, index.h("h1", { class: titleClass }, this.titleMesage), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.baseComponent.translations.GlobalValues.FooterText)))));
9563
+ return (index.h("div", { class: bgDemo }, index.h("div", { class: "container-video" }, index.h("div", { hidden: this.demoEnded }, index.h("video", { id: "howtoSelfie", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, index.h("source", { type: "video/mp4" }))), index.h("div", { hidden: this.demoEnded == false }, index.h("div", { hidden: this.verified }, index.h("div", { class: "video-capture" }, index.h("div", { style: cameraStyle }, index.h("camera-comp", { "capture-mode": "selfie" }))))), index.h("div", { class: "capture-title" }, index.h("h1", { class: titleClass }, this.titleMesage), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText)))));
9067
9564
  }
9068
9565
  get component() { return index.getElement(this); }
9069
9566
  };
@@ -9095,7 +9592,7 @@ const SelfieTilt = class {
9095
9592
  this.cameras = new Cameras();
9096
9593
  this.demoEnded = false;
9097
9594
  this.uploadingLink = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_selfie.mp4';
9098
- this.baseComponent = new baseComponent.BaseComponent(baseComponent.FlowSteps.SelfieTilt);
9595
+ this.baseComponent = new BaseComponent(FlowSteps.SelfieTilt);
9099
9596
  }
9100
9597
  eventVideoStarted(event) {
9101
9598
  this.videoStarted = true;
@@ -9104,8 +9601,9 @@ const SelfieTilt = class {
9104
9601
  this.captureHeight = height - Math.round((window.screen.height - height) / 2);
9105
9602
  this.captureWidth = Math.round((this.captureHeight * 9) / 16);
9106
9603
  }
9107
- componentWillLoad() {
9108
- this.titleMesage = this.baseComponent.translations.SelfieCaptureValues.Title;
9604
+ async componentWillLoad() {
9605
+ this.translations = await TranslationUtils.Translations.getValues();
9606
+ this.titleMesage = this.translations.SelfieCaptureValues.Title;
9109
9607
  //this.videoDemoStyle = this.device.isMobile ? { 'width': window.screen.width + 'px', 'height': window.screen.height + 'px', 'object-fit': 'fill' } : {};
9110
9608
  if (!navigator.mediaDevices) {
9111
9609
  this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
@@ -9113,17 +9611,17 @@ const SelfieTilt = class {
9113
9611
  }
9114
9612
  async componentDidLoad() {
9115
9613
  this.mainStream = Stream.getInstance(VerificationMode.Tilt);
9116
- await this.baseComponent.logStep(baseComponent.FlowSteps.SelfieTilt, baseComponent.FlowMoments.Initialized);
9117
- this.titleMesage = this.baseComponent.translations.SelfieCaptureValues.FacePoseMapping[Object.values(FacePose).indexOf(this.mainStream.facePose)];
9614
+ await this.baseComponent.logStep(FlowSteps.SelfieTilt, FlowMoments.Initialized);
9615
+ this.titleMesage = this.translations.SelfieCaptureValues.FacePoseMapping[Object.values(FacePose).indexOf(this.mainStream.facePose)];
9118
9616
  this.demoEnded = false;
9119
- this.demoVideo.src = baseComponent.SelfieCaptureValues.FacePoseDemoMapping[this.mainStream.facePose];
9617
+ this.demoVideo.src = TranslationUtils.SelfieCaptureValues.FacePoseDemoMapping[this.mainStream.facePose];
9120
9618
  this.demoVideo.play();
9121
- await delay(this.baseComponent.translations.GlobalValues.VideoLenght);
9619
+ await delay(this.translations.GlobalValues.VideoLenght);
9122
9620
  this.demoEnded = true;
9123
9621
  this.openCamera();
9124
9622
  }
9125
9623
  async openCamera() {
9126
- const constraints = this.cameras.GetConstraints('', baseComponent.state.device, true);
9624
+ const constraints = this.cameras.GetConstraints('', TranslationUtils.state.device, true);
9127
9625
  setTimeout(() => {
9128
9626
  navigator.mediaDevices
9129
9627
  .getUserMedia(constraints)
@@ -9152,13 +9650,13 @@ const SelfieTilt = class {
9152
9650
  this.captureTaken = true;
9153
9651
  let res = this.mainStream.takePhoto();
9154
9652
  this.photoIsReady(res);
9155
- await this.baseComponent.logStep(baseComponent.FlowSteps.SelfieCapture, baseComponent.FlowMoments.Finalized);
9653
+ await this.baseComponent.logStep(FlowSteps.SelfieCapture, FlowMoments.Finalized);
9156
9654
  }
9157
9655
  verificationFinished() {
9158
9656
  if (this.verified)
9159
9657
  return;
9160
9658
  this.verified = true;
9161
- this.titleMesage = this.baseComponent.translations.SelfieCaptureValues.Loading;
9659
+ this.titleMesage = this.translations.SelfieCaptureValues.Loading;
9162
9660
  this.closeCamera();
9163
9661
  this.demoEnded = false;
9164
9662
  this.demoVideo.src = this.uploadingLink;
@@ -9167,7 +9665,7 @@ const SelfieTilt = class {
9167
9665
  }
9168
9666
  render() {
9169
9667
  let cameraStyle;
9170
- if (baseComponent.state.device.isMobile && this.videoStarted) {
9668
+ if (TranslationUtils.state.device.isMobile && this.videoStarted) {
9171
9669
  cameraStyle = {
9172
9670
  'width': this.captureWidth + 'px',
9173
9671
  'height': this.captureHeight + 'px',
@@ -9180,7 +9678,7 @@ const SelfieTilt = class {
9180
9678
  let titleClass = this.verified ? 'color-black-2 text-center' : 'color-white text-center';
9181
9679
  //let videoClass = this.device.isMobile ? '' : 'video-demo';
9182
9680
  let bgDemo = this.verified ? 'container' : 'container bg-black';
9183
- return (index.h("div", { class: bgDemo }, index.h("div", { class: "container-video" }, index.h("div", { hidden: this.demoEnded }, index.h("video", { id: "howtoSelfie", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, index.h("source", { type: "video/mp4" }))), index.h("div", { hidden: this.demoEnded == false }, index.h("div", { hidden: this.verified }, index.h("div", { class: "video-capture" }, index.h("div", { style: cameraStyle }, index.h("camera-comp", { "capture-mode": "selfie" }))))), index.h("div", { class: "capture-title" }, index.h("h1", { class: titleClass }, this.titleMesage), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.baseComponent.translations.GlobalValues.FooterText)))));
9681
+ return (index.h("div", { class: bgDemo }, index.h("div", { class: "container-video" }, index.h("div", { hidden: this.demoEnded }, index.h("video", { id: "howtoSelfie", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, index.h("source", { type: "video/mp4" }))), index.h("div", { hidden: this.demoEnded == false }, index.h("div", { hidden: this.verified }, index.h("div", { class: "video-capture" }, index.h("div", { style: cameraStyle }, index.h("camera-comp", { "capture-mode": "selfie" }))))), index.h("div", { class: "capture-title" }, index.h("h1", { class: titleClass }, this.titleMesage), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText)))));
9184
9682
  }
9185
9683
  get component() { return index.getElement(this); }
9186
9684
  };
@@ -9199,30 +9697,30 @@ const SmsCodeValidation = class {
9199
9697
  this.code = undefined;
9200
9698
  this.prefilledPhone = false;
9201
9699
  this.canSend = false;
9202
- if (baseComponent.state.flowStatus == baseComponent.FlowStatus.PHONE) {
9203
- this.baseComponent = new baseComponent.BaseComponent(baseComponent.FlowSteps.OtpSend);
9700
+ if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.PHONE) {
9701
+ this.baseComponent = new BaseComponent(FlowSteps.OtpSend);
9204
9702
  }
9205
- if (baseComponent.state.flowStatus == baseComponent.FlowStatus.CODE) {
9206
- this.baseComponent = new baseComponent.BaseComponent(baseComponent.FlowSteps.OtpCheck);
9703
+ if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.CODE) {
9704
+ this.baseComponent = new BaseComponent(FlowSteps.OtpCheck);
9207
9705
  }
9208
9706
  this.baseComponent.setEventEmitter(this.apiErrorEvent);
9209
9707
  }
9210
9708
  async doAction() {
9211
9709
  try {
9212
9710
  this.canSend = false;
9213
- if (baseComponent.state.flowStatus == baseComponent.FlowStatus.CODE || baseComponent.state.flowStatus == baseComponent.FlowStatus.CODEERROR) {
9214
- var codeChecked = await this.baseComponent.apiCall.CheckOTPCode(baseComponent.state.requestId, this.code);
9711
+ if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.CODE || TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.CODEERROR) {
9712
+ var codeChecked = await this.baseComponent.apiCall.CheckOTPCode(TranslationUtils.state.requestId, this.code);
9215
9713
  if (codeChecked === true) {
9216
- baseComponent.state.flowStatus = baseComponent.FlowStatus.ID;
9714
+ TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus.ID;
9217
9715
  }
9218
9716
  else {
9219
- baseComponent.state.flowStatus = baseComponent.FlowStatus.CODEERROR;
9717
+ TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus.CODEERROR;
9220
9718
  }
9221
9719
  }
9222
- if (baseComponent.state.flowStatus == baseComponent.FlowStatus.PHONE) {
9223
- var codeSent = await this.baseComponent.apiCall.SendOTPCode(baseComponent.state.requestId, this.phoneNumber);
9720
+ if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.PHONE) {
9721
+ var codeSent = await this.baseComponent.apiCall.SendOTPCode(TranslationUtils.state.requestId, this.phoneNumber);
9224
9722
  if (codeSent === true) {
9225
- baseComponent.state.flowStatus = baseComponent.FlowStatus.CODE;
9723
+ TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus.CODE;
9226
9724
  }
9227
9725
  }
9228
9726
  }
@@ -9233,21 +9731,22 @@ const SmsCodeValidation = class {
9233
9731
  async disconnectedCallback() {
9234
9732
  await this.baseComponent.finalize();
9235
9733
  }
9236
- componentWillRender() {
9237
- if (baseComponent.state.flowStatus == baseComponent.FlowStatus.PHONE) {
9238
- this.title = this.baseComponent.translations.PhoneValidationValues.Title;
9239
- this.details = this.baseComponent.translations.PhoneValidationValues.Description;
9240
- this.buttonText = this.baseComponent.translations.PhoneValidationValues.Button;
9241
- if (baseComponent.state.phoneNumber && baseComponent.state.phoneNumber != '') {
9242
- this.phoneNumber = baseComponent.state.phoneNumber;
9734
+ async componentWillRender() {
9735
+ this.translations = await TranslationUtils.Translations.getValues();
9736
+ if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.PHONE) {
9737
+ this.title = this.translations.PhoneValidationValues.Title;
9738
+ this.details = this.translations.PhoneValidationValues.Description;
9739
+ this.buttonText = this.translations.PhoneValidationValues.Button;
9740
+ if (TranslationUtils.state.phoneNumber && TranslationUtils.state.phoneNumber != '') {
9741
+ this.phoneNumber = TranslationUtils.state.phoneNumber;
9243
9742
  this.prefilledPhone = true;
9244
9743
  this.canSend = true;
9245
9744
  }
9246
9745
  }
9247
- if (baseComponent.state.flowStatus == baseComponent.FlowStatus.CODE || baseComponent.state.flowStatus == baseComponent.FlowStatus.CODEERROR) {
9248
- this.title = this.baseComponent.translations.CodeValidationValues.Title;
9249
- this.details = this.baseComponent.translations.CodeValidationValues.Description;
9250
- this.buttonText = this.baseComponent.translations.CodeValidationValues.Button;
9746
+ if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.CODE || TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.CODEERROR) {
9747
+ this.title = this.translations.CodeValidationValues.Title;
9748
+ this.details = this.translations.CodeValidationValues.Description;
9749
+ this.buttonText = this.translations.CodeValidationValues.Button;
9251
9750
  }
9252
9751
  }
9253
9752
  async componentDidLoad() {
@@ -9272,16 +9771,16 @@ const SmsCodeValidation = class {
9272
9771
  render() {
9273
9772
  let inputBlock;
9274
9773
  let errorBlock;
9275
- if (baseComponent.state.flowStatus == baseComponent.FlowStatus.CODEERROR) {
9276
- errorBlock = index.h("p", { class: "main-text font-size-18 mt-15 color-red text-center" }, this.baseComponent.translations.CodeValidationValues.Error);
9774
+ if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.CODEERROR) {
9775
+ errorBlock = index.h("p", { class: "main-text font-size-18 mt-15 color-red text-center" }, this.translations.CodeValidationValues.Error);
9277
9776
  }
9278
- if (baseComponent.state.flowStatus == baseComponent.FlowStatus.PHONE) {
9279
- inputBlock = (index.h("div", { class: "input-container mb-15" }, index.h("label", { class: "font-size-18 mb-1" }, index.h("b", null, this.baseComponent.translations.PhoneValidationValues.Label)), index.h("input", { type: "tel", id: "phoneInput", class: "main-input", disabled: this.prefilledPhone, onInput: ev => this.handleChangePhone(ev), value: this.phoneNumber })));
9777
+ if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.PHONE) {
9778
+ inputBlock = (index.h("div", { class: "input-container mb-15" }, index.h("label", { class: "font-size-18 mb-1" }, index.h("b", null, this.translations.PhoneValidationValues.Label)), index.h("input", { type: "tel", id: "phoneInput", class: "main-input", disabled: this.prefilledPhone, onInput: ev => this.handleChangePhone(ev), value: this.phoneNumber })));
9280
9779
  }
9281
9780
  else {
9282
9781
  inputBlock = (index.h("div", { class: "input-container mb-15" }, index.h("input", { type: "text", id: "codeInput", class: "main-input", onInput: ev => this.handleChangeCode(ev), value: this.code })));
9283
9782
  }
9284
- return (index.h("div", { class: "container" }, index.h("div", { class: "row row-validare" }, index.h("div", null, index.h("h1", { class: "text-center" }, this.title), errorBlock == null ? index.h("p", { class: "main-text font-size-2 mt-15 mb-20 text-center" }, this.details) : errorBlock), inputBlock, index.h("div", { class: "pos-relative show-bottom" }, index.h("div", { class: "btn-buletin" }, index.h("button", { id: "action", disabled: !this.canSend, class: "main-button", onClick: () => this.doAction() }, this.buttonText), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.baseComponent.translations.GlobalValues.FooterText))))));
9783
+ return (index.h("div", { class: "container" }, index.h("div", { class: "row row-validare" }, index.h("div", null, index.h("h1", { class: "text-center" }, this.title), errorBlock == null ? index.h("p", { class: "main-text font-size-2 mt-15 mb-20 text-center" }, this.details) : errorBlock), inputBlock, index.h("div", { class: "pos-relative show-bottom" }, index.h("div", { class: "btn-buletin" }, index.h("button", { id: "action", disabled: !this.canSend, class: "main-button", onClick: () => this.doAction() }, this.buttonText), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
9285
9784
  }
9286
9785
  };
9287
9786
  SmsCodeValidation.style = smsCodeValidationCss;
@@ -9297,7 +9796,7 @@ const UserLiveness = class {
9297
9796
  this.showError = undefined;
9298
9797
  this.captureStep = undefined;
9299
9798
  this.flow = undefined;
9300
- this.baseComponent = new baseComponent.BaseComponent(baseComponent.FlowSteps.Selfie);
9799
+ this.baseComponent = new BaseComponent(FlowSteps.Selfie);
9301
9800
  this.baseComponent.setEventEmitter(this.apiErrorEvent);
9302
9801
  }
9303
9802
  async componentDidLoad() {
@@ -9316,7 +9815,7 @@ const UserLiveness = class {
9316
9815
  back: null,
9317
9816
  tilt: null,
9318
9817
  };
9319
- if (baseComponent.state.hasSelfieGesture) {
9818
+ if (TranslationUtils.state.hasSelfieGesture) {
9320
9819
  this.flow.tilt = {
9321
9820
  photoDone: true,
9322
9821
  recordingDone: false,
@@ -9407,7 +9906,7 @@ const UserLiveness = class {
9407
9906
  if (this.flow.front.photoDone) {
9408
9907
  return;
9409
9908
  }
9410
- this.flow.front.photoDone = await this.baseComponent.apiCall.UploadFileForRequestB64(baseComponent.state.requestId, photoType, photoFile);
9909
+ this.flow.front.photoDone = await this.baseComponent.apiCall.UploadFileForRequestB64(TranslationUtils.state.requestId, photoType, photoFile);
9411
9910
  if (this.flow.front.photoDone) {
9412
9911
  await this.endFlow();
9413
9912
  }
@@ -9416,7 +9915,7 @@ const UserLiveness = class {
9416
9915
  }
9417
9916
  }
9418
9917
  async uploadRecording(uploadRec, recType) {
9419
- let uplodDone = await this.baseComponent.apiCall.UploadFileForRequestB64(baseComponent.state.requestId, recType, uploadRec);
9918
+ let uplodDone = await this.baseComponent.apiCall.UploadFileForRequestB64(TranslationUtils.state.requestId, recType, uploadRec);
9420
9919
  if (uplodDone) {
9421
9920
  return true;
9422
9921
  }
@@ -9431,7 +9930,7 @@ const UserLiveness = class {
9431
9930
  async endFlow() {
9432
9931
  if (this.captureStep == SelfieFlowStatus.Selfie) {
9433
9932
  if (this.flow.front.photoDone && this.flow.front.recordingDone) {
9434
- if (baseComponent.state.hasSelfieGesture) {
9933
+ if (TranslationUtils.state.hasSelfieGesture) {
9435
9934
  this.captureStep = SelfieFlowStatus.Gesture;
9436
9935
  }
9437
9936
  else {
@@ -9453,7 +9952,7 @@ const UserLiveness = class {
9453
9952
  if (this.captureStep != SelfieFlowStatus.End) {
9454
9953
  return;
9455
9954
  }
9456
- baseComponent.state.flowStatus = baseComponent.FlowStatus.COMPLETE;
9955
+ TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus.COMPLETE;
9457
9956
  }
9458
9957
  render() {
9459
9958
  let howTo = index.h("how-to-info", { idSide: "" });