trm-tmpl 3.2.1 → 3.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/app/i18n/i18n-key.enum.mjs +2 -1
- package/esm2022/lib/app/i18n/keys.mjs +3 -2
- package/esm2022/lib/app/models/constants.mjs +4 -2
- package/esm2022/lib/app/pages/components/constructor-form/components/constructor-field-date/constructor-field-date.component.mjs +24 -38
- package/esm2022/lib/app/pages/components/constructor-form/components/constructor-field-iframe/card-sdk.service.mjs +41 -0
- package/esm2022/lib/app/pages/components/constructor-form/components/constructor-field-iframe/constructor-field-iframe.component.mjs +102 -118
- package/esm2022/lib/app/pages/components/constructor-form/components/constructor-field-iframe/iframe-validator-directive.directive.mjs +88 -0
- package/esm2022/lib/app/pages/components/constructor-form/components/constructor-field-select/constructor-field-select.component.mjs +15 -37
- package/esm2022/lib/app/pages/components/constructor-form/components/constructor-field-text/constructor-field-text.component.mjs +10 -4
- package/esm2022/lib/app/pages/components/constructor-form/components/index.mjs +3 -1
- package/esm2022/lib/app/pages/components/constructor-form/components/ps-select/ps-select.component.mjs +20 -24
- package/esm2022/lib/app/pages/components/constructor-form/constructor-form.component.mjs +89 -66
- package/esm2022/lib/app/pages/components/constructor-form/models/field-template.mjs +2 -1
- package/esm2022/lib/app/pages/components/constructor-form/models/index.mjs +1 -2
- package/esm2022/lib/app/pages/components/constructor-form/models/payment-field.mjs +1 -1
- package/esm2022/lib/app/pages/components/constructor-form/services/constructor-form.service.mjs +39 -24
- package/esm2022/lib/app/pages/components/terminal-layout/terminal-layout.component.mjs +11 -9
- package/esm2022/lib/app/services/api-errors.service.mjs +16 -34
- package/esm2022/lib/app/services/csrf.resolver.mjs +6 -18
- package/esm2022/lib/app/services/error.interceptior.mjs +2 -2
- package/esm2022/lib/app/services/local-storage.mjs +70 -0
- package/esm2022/lib/app/services/script-loader.mjs +4 -7
- package/esm2022/lib/app/services/session.data-source.mjs +8 -8
- package/esm2022/lib/app/services/translation/translate-lang-storage.service.mjs +95 -79
- package/esm2022/lib/app/shared/components/terminal-lang-switcher/terminal-lang-switcher.component.mjs +10 -8
- package/esm2022/lib/app/shared/components/terminal-layout-tpl/terminal-layout-tpl.component.mjs +6 -6
- package/esm2022/lib/app/shared/components/trm-select/trm-select.component.mjs +1 -1
- package/esm2022/lib/app/terminal-tpl.component.mjs +5 -12
- package/fesm2022/trm-tmpl.mjs +738 -587
- package/fesm2022/trm-tmpl.mjs.map +1 -1
- package/lib/app/i18n/i18n-key.enum.d.ts +1 -0
- package/lib/app/models/constants.d.ts +3 -1
- package/lib/app/pages/components/constructor-form/components/constructor-field-date/constructor-field-date.component.d.ts +7 -10
- package/lib/app/pages/components/constructor-form/components/constructor-field-iframe/card-sdk.service.d.ts +18 -0
- package/lib/app/pages/components/constructor-form/components/constructor-field-iframe/constructor-field-iframe.component.d.ts +25 -27
- package/lib/app/pages/components/constructor-form/components/constructor-field-iframe/iframe-validator-directive.directive.d.ts +16 -0
- package/lib/app/pages/components/constructor-form/components/constructor-field-select/constructor-field-select.component.d.ts +6 -10
- package/lib/app/pages/components/constructor-form/components/constructor-field-text/constructor-field-text.component.d.ts +3 -3
- package/lib/app/pages/components/constructor-form/components/index.d.ts +2 -0
- package/lib/app/pages/components/constructor-form/components/ps-select/ps-select.component.d.ts +4 -6
- package/lib/app/pages/components/constructor-form/constructor-form.component.d.ts +5 -8
- package/lib/app/pages/components/constructor-form/models/index.d.ts +0 -1
- package/lib/app/pages/components/constructor-form/models/payment-field.d.ts +1 -1
- package/lib/app/pages/components/constructor-form/services/constructor-form.service.d.ts +8 -5
- package/lib/app/pages/components/terminal-layout/terminal-layout.component.d.ts +1 -0
- package/lib/app/services/api-errors.service.d.ts +4 -10
- package/lib/app/services/csrf.resolver.d.ts +1 -4
- package/lib/app/services/local-storage.d.ts +24 -0
- package/lib/app/services/script-loader.d.ts +1 -2
- package/lib/app/services/session.data-source.d.ts +1 -1
- package/lib/app/services/translation/translate-lang-storage.service.d.ts +22 -23
- package/lib/app/shared/components/terminal-lang-switcher/terminal-lang-switcher.component.d.ts +4 -34
- package/lib/app/shared/components/terminal-layout-tpl/terminal-layout-tpl.component.d.ts +1 -2
- package/lib/app/shared/components/trm-select/trm-select.component.d.ts +1 -2
- package/package.json +1 -1
- package/esm2022/lib/app/pages/components/constructor-form/models/constants.mjs +0 -4
- package/lib/app/pages/components/constructor-form/models/constants.d.ts +0 -3
package/fesm2022/trm-tmpl.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, Injectable, ChangeDetectorRef, CSP_NONCE, Component, HostListener, NgModule, TemplateRef, Directive, ElementRef, Renderer2, Pipe, EventEmitter, forwardRef, ChangeDetectionStrategy, Input, Output, ContentChild, SecurityContext, ViewContainerRef, Injector, ViewChild } from '@angular/core';
|
|
2
|
+
import { InjectionToken, inject, Injectable, ChangeDetectorRef, CSP_NONCE, Component, HostListener, NgModule, TemplateRef, Directive, ElementRef, Renderer2, Pipe, EventEmitter, forwardRef, ChangeDetectionStrategy, Input, Output, ContentChild, SecurityContext, ViewContainerRef, Injector, DestroyRef, ViewChild, ViewChildren } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/router';
|
|
4
4
|
import { Router, NavigationEnd, NavigationCancel, NavigationError, RouterOutlet, RouterModule, ActivatedRoute } from '@angular/router';
|
|
5
5
|
import { registerLocale, getNames } from 'i18n-iso-countries';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { BehaviorSubject, of, throwError, Subject, merge, fromEvent, distinctUntilChanged, timer, interval } from 'rxjs';
|
|
7
|
+
import { registerLocaleData, DOCUMENT, AsyncPipe, CommonModule, NgTemplateOutlet, NgClass, CurrencyPipe, getCurrencySymbol, Location } from '@angular/common';
|
|
8
8
|
import localeRu from '@angular/common/locales/ru';
|
|
9
9
|
import localeEn from '@angular/common/locales/en';
|
|
10
10
|
import localeTr from '@angular/common/locales/tr';
|
|
@@ -18,18 +18,20 @@ import TR_COUNTRIES from 'i18n-iso-countries/langs/tr.json';
|
|
|
18
18
|
import PT_COUNTRIES from 'i18n-iso-countries/langs/pt.json';
|
|
19
19
|
import LT_COUNTRIES from 'i18n-iso-countries/langs/lt.json';
|
|
20
20
|
import * as i2 from '@ngx-translate/core';
|
|
21
|
-
import { TranslateService, TranslateModule,
|
|
22
|
-
import {
|
|
21
|
+
import { TranslateService, TranslateModule, TranslatePipe, TranslateLoader } from '@ngx-translate/core';
|
|
22
|
+
import { catchError, map, first, delay, tap, switchMap, takeUntil, filter, debounceTime, finalize } from 'rxjs/operators';
|
|
23
23
|
import { CookieService } from 'ngx-cookie-service';
|
|
24
24
|
import * as momentjs from 'moment-timezone';
|
|
25
25
|
import momentjs__default from 'moment-timezone';
|
|
26
|
-
import { NgxMaskService, NgxMaskPipe, NgxMaskDirective, provideNgxMask } from 'ngx-mask';
|
|
27
26
|
import { trigger, transition, style, animate } from '@angular/animations';
|
|
27
|
+
import { NgxMaskService, NgxMaskPipe, NgxMaskDirective, provideNgxMask } from 'ngx-mask';
|
|
28
28
|
import { NgScrollbar } from 'ngx-scrollbar';
|
|
29
29
|
import * as i1$1 from '@angular/forms';
|
|
30
|
-
import { FormControl, NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule, FormGroup, Validators,
|
|
30
|
+
import { FormControl, NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule, FormGroup, Validators, NG_ASYNC_VALIDATORS, NgControl } from '@angular/forms';
|
|
31
31
|
import { GmSkeletonComponent } from '@gmmoney/gm-ui-kit';
|
|
32
32
|
import { DomSanitizer, Title } from '@angular/platform-browser';
|
|
33
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
34
|
+
import { fromPromise } from 'rxjs/internal/observable/innerFrom';
|
|
33
35
|
import { MatDatepickerInput, MatDatepickerToggle, MatDatepickerToggleIcon, MatDatepicker, MatDatepickerModule } from '@angular/material/datepicker';
|
|
34
36
|
import { isMoment } from 'moment';
|
|
35
37
|
import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material/core';
|
|
@@ -104,6 +106,7 @@ var I18N_KEY;
|
|
|
104
106
|
I18N_KEY["DEFAULT_ERROR_CODE"] = "error_api";
|
|
105
107
|
I18N_KEY["DEFAULT_ERROR_CODE_GENERAL"] = "error_general";
|
|
106
108
|
I18N_KEY["ERROR_OCCUR"] = "ERROR_OCCUR";
|
|
109
|
+
I18N_KEY["ERROR_OCCUR_SDK"] = "ERROR_OCCUR_SDK";
|
|
107
110
|
I18N_KEY["PROGRESS_TITLE"] = "PROGRESS_TITLE";
|
|
108
111
|
I18N_KEY["FAIL_TITLE"] = "FAIL_TITLE";
|
|
109
112
|
I18N_KEY["SUCCESS_TITLE"] = "SUCCESS_TITLE";
|
|
@@ -270,7 +273,8 @@ const i18nMap = new Map([
|
|
|
270
273
|
[I18N_KEY.TERMINAL_SESSION_SUCCESS, 'Операция прошла успешно!'],
|
|
271
274
|
[I18N_KEY.TERMINAL_SESSION_SUPPORT, 'В случае возникновения проблем с платежом, обращайтесь в техническую поддержку магазина или к нам на почту'],
|
|
272
275
|
[I18N_KEY.SELECT_SEARCH, 'Поиск'],
|
|
273
|
-
[I18N_KEY.SELECT_EMPTY_LIST, 'Список пуст']
|
|
276
|
+
[I18N_KEY.SELECT_EMPTY_LIST, 'Список пуст'],
|
|
277
|
+
[I18N_KEY.ERROR_OCCUR_SDK, 'Ошибка загрузки терминала']
|
|
274
278
|
]);
|
|
275
279
|
const getI18Key = (key) => {
|
|
276
280
|
return i18nMap.get(key);
|
|
@@ -292,7 +296,9 @@ const CSRF_COOKIE_NAME = 'TERMINAL-CSRF-KEY';
|
|
|
292
296
|
const I18N_COUNTRIES = new InjectionToken('i18n-iso-countries');
|
|
293
297
|
const SessionToken = new InjectionToken('SessionToken');
|
|
294
298
|
const CheckinModeToken = new InjectionToken('CheckinModeToken');
|
|
295
|
-
const
|
|
299
|
+
const DEFAULT_COUNTRY_LOCALHOST_KEY = 'GM_TERMINAL_COUNTRY';
|
|
300
|
+
const DEFAULT_METHOD_LOCALHOST_KEY = 'GM_TERMINAL_METHOD';
|
|
301
|
+
const DEFAULT_CURRENCY_LOCALHOST_KEY = 'GM_TERMINAL_CURRENCY';
|
|
296
302
|
|
|
297
303
|
var Mode;
|
|
298
304
|
(function (Mode) {
|
|
@@ -310,13 +316,17 @@ class VersionServiceBase {
|
|
|
310
316
|
}
|
|
311
317
|
|
|
312
318
|
class ApiErrorsService {
|
|
313
|
-
;
|
|
314
|
-
get ERROR_KEY() {
|
|
315
|
-
return `${this.token}_ERROR_DETAIL`;
|
|
316
|
-
}
|
|
317
319
|
constructor() {
|
|
318
320
|
this.token = inject(SessionToken, { optional: true }) || 'token';
|
|
319
|
-
|
|
321
|
+
}
|
|
322
|
+
clear() {
|
|
323
|
+
this._localError = null;
|
|
324
|
+
}
|
|
325
|
+
get hasError() {
|
|
326
|
+
return !!this._localError;
|
|
327
|
+
}
|
|
328
|
+
get hasFatalError() {
|
|
329
|
+
const formatErrors = [
|
|
320
330
|
ApiErrors.FORMAT_PHONE,
|
|
321
331
|
ApiErrors.FORMAT_DATE_BIRTH,
|
|
322
332
|
ApiErrors.FORMAT_EMAIL,
|
|
@@ -327,38 +337,17 @@ class ApiErrorsService {
|
|
|
327
337
|
ApiErrors.FORMAT_WALLET,
|
|
328
338
|
ApiErrors.FORMAT_ZIP,
|
|
329
339
|
];
|
|
330
|
-
this.
|
|
331
|
-
|
|
332
|
-
setError(err) {
|
|
333
|
-
let code = I18N_KEY.DEFAULT_ERROR_CODE;
|
|
334
|
-
if (err?.code) {
|
|
335
|
-
code = err.code;
|
|
340
|
+
if (formatErrors.includes(this._localError)) {
|
|
341
|
+
return false;
|
|
336
342
|
}
|
|
337
|
-
this.
|
|
338
|
-
}
|
|
339
|
-
getError() {
|
|
340
|
-
const code = this.document.defaultView.sessionStorage.getItem(this.ERROR_KEY) || null;
|
|
341
|
-
return getI18Key(code) || code;
|
|
342
|
-
}
|
|
343
|
-
clear() {
|
|
344
|
-
this.document.defaultView.sessionStorage.removeItem(this.ERROR_KEY);
|
|
345
|
-
}
|
|
346
|
-
get hasError() {
|
|
347
|
-
return !!this.document.defaultView.sessionStorage.getItem(this.ERROR_KEY);
|
|
348
|
-
}
|
|
349
|
-
get hasFatalError() {
|
|
350
|
-
const code = this.document.defaultView.sessionStorage.getItem(this.ERROR_KEY);
|
|
351
|
-
return this.FATAL_ERRORS?.includes(code) || false;
|
|
343
|
+
return !!this._localError;
|
|
352
344
|
}
|
|
353
345
|
setLocalError(err) {
|
|
354
346
|
let code = I18N_KEY.DEFAULT_ERROR_CODE;
|
|
355
347
|
if (err?.code) {
|
|
356
348
|
code = err.code;
|
|
357
349
|
}
|
|
358
|
-
this._localError =
|
|
359
|
-
}
|
|
360
|
-
clearLocal() {
|
|
361
|
-
this._localError = '';
|
|
350
|
+
this._localError = code;
|
|
362
351
|
}
|
|
363
352
|
get hasLocalError() {
|
|
364
353
|
return !!this._localError;
|
|
@@ -423,105 +412,186 @@ const ENVIRONMENT = new InjectionToken('ENVIRONMENT');
|
|
|
423
412
|
const TERMINAL_VERSION_SERVICE_TOKEN = new InjectionToken('TERMINAL_VERSION_SERVICE_TOKEN');
|
|
424
413
|
const TERMINAL_SDK_FACTORY = new InjectionToken('TERMINAL_SDK_FACTORY');
|
|
425
414
|
|
|
415
|
+
class LocalStorage {
|
|
416
|
+
constructor() {
|
|
417
|
+
this._document = inject(DOCUMENT);
|
|
418
|
+
this._supported = true;
|
|
419
|
+
try {
|
|
420
|
+
if (!this._document.defaultView.localStorage) {
|
|
421
|
+
this._supported = false;
|
|
422
|
+
}
|
|
423
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
424
|
+
}
|
|
425
|
+
catch (error) {
|
|
426
|
+
this._supported = false;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
get _storage() {
|
|
430
|
+
return this._document.defaultView.localStorage;
|
|
431
|
+
}
|
|
432
|
+
getItem(key) {
|
|
433
|
+
if (!this._supported) {
|
|
434
|
+
return null;
|
|
435
|
+
}
|
|
436
|
+
return this._storage.getItem(key);
|
|
437
|
+
}
|
|
438
|
+
setItem(key, value) {
|
|
439
|
+
if (!this._supported) {
|
|
440
|
+
return;
|
|
441
|
+
}
|
|
442
|
+
this._storage.setItem(key, value);
|
|
443
|
+
}
|
|
444
|
+
get defaultCountry() {
|
|
445
|
+
return (this._defaultCountry ||
|
|
446
|
+
this.getItem(DEFAULT_COUNTRY_LOCALHOST_KEY));
|
|
447
|
+
}
|
|
448
|
+
get defaultMethodName() {
|
|
449
|
+
return (this._defaultMethodName || this.getItem(DEFAULT_METHOD_LOCALHOST_KEY));
|
|
450
|
+
}
|
|
451
|
+
get defaultCurrency() {
|
|
452
|
+
return (this._defaultCurrency || this.getItem(DEFAULT_CURRENCY_LOCALHOST_KEY));
|
|
453
|
+
}
|
|
454
|
+
get defaultLang() {
|
|
455
|
+
return this._defaultLang || this.getItem(LOCAL_LANG_KEY);
|
|
456
|
+
}
|
|
457
|
+
saveDefaultCountry(value) {
|
|
458
|
+
this._defaultCountry = value;
|
|
459
|
+
this.setItem(DEFAULT_COUNTRY_LOCALHOST_KEY, value);
|
|
460
|
+
}
|
|
461
|
+
saveDefaultMethodName(value) {
|
|
462
|
+
this._defaultMethodName = value;
|
|
463
|
+
this.setItem(DEFAULT_METHOD_LOCALHOST_KEY, value);
|
|
464
|
+
}
|
|
465
|
+
saveDefaultCurrency(value) {
|
|
466
|
+
this._defaultCurrency = value;
|
|
467
|
+
this.setItem(DEFAULT_CURRENCY_LOCALHOST_KEY, value);
|
|
468
|
+
}
|
|
469
|
+
saveDefaultLang(value) {
|
|
470
|
+
this._defaultLang = value;
|
|
471
|
+
this.setItem(LOCAL_LANG_KEY, value);
|
|
472
|
+
}
|
|
473
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: LocalStorage, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
474
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: LocalStorage, providedIn: 'root' }); }
|
|
475
|
+
}
|
|
476
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: LocalStorage, decorators: [{
|
|
477
|
+
type: Injectable,
|
|
478
|
+
args: [{ providedIn: 'root' }]
|
|
479
|
+
}], ctorParameters: () => [] });
|
|
480
|
+
|
|
481
|
+
const TRANSLATION_LANG_KEYS = {
|
|
482
|
+
[LANGUAGE.RU]: {
|
|
483
|
+
code: 'ru',
|
|
484
|
+
name: 'Русский',
|
|
485
|
+
countries: [
|
|
486
|
+
'AZ',
|
|
487
|
+
'AM',
|
|
488
|
+
'BY',
|
|
489
|
+
'KZ',
|
|
490
|
+
'KG',
|
|
491
|
+
'MD',
|
|
492
|
+
'RU',
|
|
493
|
+
'TJ',
|
|
494
|
+
'TM',
|
|
495
|
+
'UZ',
|
|
496
|
+
'UA',
|
|
497
|
+
],
|
|
498
|
+
},
|
|
499
|
+
[LANGUAGE.EN]: {
|
|
500
|
+
code: 'gb',
|
|
501
|
+
name: 'English',
|
|
502
|
+
countries: [],
|
|
503
|
+
},
|
|
504
|
+
[LANGUAGE.ES]: {
|
|
505
|
+
code: 'es',
|
|
506
|
+
name: 'Español',
|
|
507
|
+
countries: [
|
|
508
|
+
'BZ',
|
|
509
|
+
'GT',
|
|
510
|
+
'HN',
|
|
511
|
+
'CR',
|
|
512
|
+
'PA',
|
|
513
|
+
'NI',
|
|
514
|
+
'SV',
|
|
515
|
+
'AR',
|
|
516
|
+
'CL',
|
|
517
|
+
'CO',
|
|
518
|
+
'EC',
|
|
519
|
+
'PY',
|
|
520
|
+
'PE',
|
|
521
|
+
'GY',
|
|
522
|
+
'ES',
|
|
523
|
+
],
|
|
524
|
+
},
|
|
525
|
+
[LANGUAGE.TR]: {
|
|
526
|
+
code: 'tr',
|
|
527
|
+
name: 'Türkçe',
|
|
528
|
+
countries: ['TR'],
|
|
529
|
+
},
|
|
530
|
+
[LANGUAGE.PT]: {
|
|
531
|
+
code: 'pt',
|
|
532
|
+
name: 'Português',
|
|
533
|
+
countries: ['PT', 'BR'],
|
|
534
|
+
},
|
|
535
|
+
};
|
|
426
536
|
class TranslateLangStorageService {
|
|
427
537
|
constructor() {
|
|
538
|
+
this._storage = inject(LocalStorage);
|
|
539
|
+
this.versionSrv = inject(TERMINAL_VERSION_SERVICE_TOKEN);
|
|
428
540
|
this.document = inject(DOCUMENT);
|
|
429
541
|
this.translateSrv = inject(TranslateService);
|
|
430
|
-
this.
|
|
431
|
-
this._isLanguageDetected = false;
|
|
432
|
-
this.TRANSLATION_LANG_KEYS = {
|
|
433
|
-
[LANGUAGE.RU]: {
|
|
434
|
-
code: 'ru',
|
|
435
|
-
name: 'Русский',
|
|
436
|
-
countries: ['AZ', 'AM', 'BY', 'KZ', 'KG', 'MD', 'RU', 'TJ', 'TM', 'UZ', 'UA']
|
|
437
|
-
},
|
|
438
|
-
[LANGUAGE.EN]: {
|
|
439
|
-
code: 'gb',
|
|
440
|
-
name: 'English',
|
|
441
|
-
countries: []
|
|
442
|
-
},
|
|
443
|
-
[LANGUAGE.LT]: {
|
|
444
|
-
code: 'lt',
|
|
445
|
-
name: 'Lietuvių',
|
|
446
|
-
countries: ['LT']
|
|
447
|
-
},
|
|
448
|
-
[LANGUAGE.ES]: {
|
|
449
|
-
code: 'es',
|
|
450
|
-
name: 'Español',
|
|
451
|
-
countries: ['BZ', 'GT', 'HN', 'CR', 'PA', 'NI', 'SV', 'AR', 'CL', 'CO', 'EC', 'PY', 'PE', 'GY', 'ES']
|
|
452
|
-
},
|
|
453
|
-
[LANGUAGE.TR]: {
|
|
454
|
-
code: 'tr',
|
|
455
|
-
name: 'Türkçe',
|
|
456
|
-
countries: ['TR']
|
|
457
|
-
},
|
|
458
|
-
[LANGUAGE.PT]: {
|
|
459
|
-
code: 'pt',
|
|
460
|
-
name: 'Português',
|
|
461
|
-
countries: ['PT', 'BR']
|
|
462
|
-
}
|
|
463
|
-
};
|
|
464
|
-
this.translations = this.TRANSLATION_LANG_KEYS;
|
|
542
|
+
this.TRANSLATION_LANG_KEYS = TRANSLATION_LANG_KEYS;
|
|
465
543
|
}
|
|
466
544
|
get languages() {
|
|
467
545
|
return this.versionSrv.langs || [LANGUAGE.RU, LANGUAGE.EN, LANGUAGE.PT, LANGUAGE.TR, LANGUAGE.ES];
|
|
468
546
|
}
|
|
469
|
-
get storage() {
|
|
470
|
-
return this.document.defaultView.localStorage;
|
|
471
|
-
}
|
|
472
547
|
get location() {
|
|
473
548
|
return this.document.defaultView.location;
|
|
474
549
|
}
|
|
475
|
-
get defaultLang() {
|
|
476
|
-
const detectedLanguage = this.storage.getItem(LOCAL_LANG_KEY) || this.queryLang;
|
|
477
|
-
this._isLanguageDetected = !!detectedLanguage;
|
|
478
|
-
return detectedLanguage || DEFAULT_LANG;
|
|
479
|
-
}
|
|
480
550
|
get onLangChange$() {
|
|
481
551
|
return this.translateSrv.onLangChange;
|
|
482
552
|
}
|
|
483
|
-
get isLanguageDetected() {
|
|
484
|
-
return this._isLanguageDetected;
|
|
485
|
-
}
|
|
486
553
|
get currentLang() {
|
|
487
554
|
return this.translateSrv.currentLang;
|
|
488
555
|
}
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
value[c] = this.TRANSLATION_LANG_KEYS[c];
|
|
497
|
-
}
|
|
498
|
-
return value;
|
|
499
|
-
}, {});
|
|
500
|
-
if (!langs.includes(this.translateSrv.currentLang)) {
|
|
501
|
-
this.translateSrv
|
|
502
|
-
.use(langs[0]);
|
|
556
|
+
get queryLang() {
|
|
557
|
+
return new URL(this.location.href).searchParams.get('language');
|
|
558
|
+
}
|
|
559
|
+
get countryLanguage() {
|
|
560
|
+
const code = this._storage.defaultCountry?.toUpperCase();
|
|
561
|
+
if (!code) {
|
|
562
|
+
return null;
|
|
503
563
|
}
|
|
564
|
+
return Object.keys(this.TRANSLATION_LANG_KEYS).find((lang) => {
|
|
565
|
+
const meta = this.TRANSLATION_LANG_KEYS[lang];
|
|
566
|
+
return meta?.countries.some((c) => c.includes(code.toUpperCase()));
|
|
567
|
+
});
|
|
504
568
|
}
|
|
505
|
-
setLanguage$(
|
|
506
|
-
|
|
507
|
-
|
|
569
|
+
setLanguage$(options = { save: true }) {
|
|
570
|
+
const availableLanguages = Object.keys(this.TRANSLATION_LANG_KEYS);
|
|
571
|
+
let candidateLang = DEFAULT_LANG;
|
|
572
|
+
const lang = options?.lang?.toLowerCase();
|
|
573
|
+
const queryLang = this.queryLang?.toLowerCase();
|
|
574
|
+
const storageLang = this._storage.defaultLang?.toLowerCase();
|
|
575
|
+
const countryLang = this.countryLanguage?.toLowerCase();
|
|
576
|
+
if (availableLanguages.includes(lang)) {
|
|
577
|
+
candidateLang = lang;
|
|
508
578
|
}
|
|
509
|
-
else if (
|
|
510
|
-
|
|
579
|
+
else if (availableLanguages.includes(storageLang)) {
|
|
580
|
+
candidateLang = storageLang;
|
|
511
581
|
}
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
if (
|
|
522
|
-
this.
|
|
582
|
+
else if (availableLanguages.includes(queryLang)) {
|
|
583
|
+
candidateLang = queryLang;
|
|
584
|
+
}
|
|
585
|
+
else if (availableLanguages.includes(countryLang)) {
|
|
586
|
+
candidateLang = countryLang;
|
|
587
|
+
}
|
|
588
|
+
if (!this.versionSrv.langs.includes(candidateLang)) {
|
|
589
|
+
candidateLang = DEFAULT_LANG;
|
|
590
|
+
}
|
|
591
|
+
if (options?.save) {
|
|
592
|
+
this._storage.saveDefaultLang(candidateLang);
|
|
523
593
|
}
|
|
524
|
-
return;
|
|
594
|
+
return this.translateSrv.use(candidateLang);
|
|
525
595
|
}
|
|
526
596
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: TranslateLangStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
527
597
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: TranslateLangStorageService }); }
|
|
@@ -530,18 +600,117 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
530
600
|
type: Injectable
|
|
531
601
|
}], ctorParameters: () => [] });
|
|
532
602
|
|
|
533
|
-
|
|
534
|
-
(
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
603
|
+
class CSRFResolver {
|
|
604
|
+
constructor() {
|
|
605
|
+
this.cookieSrv = inject(CookieService);
|
|
606
|
+
this.apiErrorsSrv = inject(ApiErrorsService);
|
|
607
|
+
this.configuration = inject(CONFIGURATION_TOKEN, { optional: true }) || { credentials: {} };
|
|
608
|
+
this.terminalApi = inject(TERMINAL_SERVICE_TOKEN);
|
|
609
|
+
this.token = inject(SessionToken, { optional: true }) || 'token';
|
|
610
|
+
this.environment = inject(ENVIRONMENT);
|
|
611
|
+
this.storage = inject(LocalStorage);
|
|
612
|
+
}
|
|
613
|
+
saveDefaultCountry(defaultCountryISOCode) {
|
|
614
|
+
if (defaultCountryISOCode) {
|
|
615
|
+
this.storage.saveDefaultCountry(defaultCountryISOCode);
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
resolve(route) {
|
|
619
|
+
const token = this.token;
|
|
620
|
+
if (!token) {
|
|
621
|
+
if (!this.apiErrorsSrv.hasError) {
|
|
622
|
+
this.apiErrorsSrv.setLocalError({ code: ApiErrors.SESSION_NOT_FOUND });
|
|
623
|
+
}
|
|
624
|
+
return of(true);
|
|
625
|
+
}
|
|
626
|
+
const timezone = momentjs__default.tz.guess();
|
|
627
|
+
if (!this.environment.csrf) {
|
|
628
|
+
return of(false);
|
|
629
|
+
}
|
|
630
|
+
if (this.resolveCSRF(token)) {
|
|
631
|
+
return of(true);
|
|
632
|
+
}
|
|
633
|
+
return this.terminalApi.postTerminalOpen({
|
|
634
|
+
token,
|
|
635
|
+
terminalOpenRequest: {
|
|
636
|
+
timezone
|
|
637
|
+
}
|
|
638
|
+
})
|
|
639
|
+
.pipe(catchError((err) => {
|
|
640
|
+
this.apiErrorsSrv.setLocalError(err.error);
|
|
641
|
+
return of({ csrf: null, defaultCountryISOCode: null });
|
|
642
|
+
}), map(({ csrf, defaultCountryISOCode }) => {
|
|
643
|
+
this.saveDefaultCountry(defaultCountryISOCode);
|
|
644
|
+
this.resolveCSRF(token, csrf);
|
|
645
|
+
return true;
|
|
646
|
+
}));
|
|
647
|
+
}
|
|
648
|
+
resolveCSRF(token, csrf) {
|
|
649
|
+
if (!csrf) {
|
|
650
|
+
if (token && this.cookieSrv.check(`${token}_${CSRF_COOKIE_NAME}`)) {
|
|
651
|
+
this.apiErrorsSrv.clear();
|
|
652
|
+
this.configuration.credentials.CSRF = this.cookieSrv.get(`${token}_${CSRF_COOKIE_NAME}`);
|
|
653
|
+
return true;
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
else {
|
|
657
|
+
this.apiErrorsSrv.clear();
|
|
658
|
+
this.cookieSrv.set(`${token}_${CSRF_COOKIE_NAME}`, csrf, momentjs__default().add(24, 'hours').toDate(), undefined, undefined, this.environment.production);
|
|
659
|
+
this.configuration.credentials.CSRF = csrf;
|
|
660
|
+
return true;
|
|
661
|
+
}
|
|
662
|
+
return false;
|
|
663
|
+
}
|
|
664
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: CSRFResolver, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
665
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: CSRFResolver }); }
|
|
666
|
+
}
|
|
667
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: CSRFResolver, decorators: [{
|
|
668
|
+
type: Injectable
|
|
669
|
+
}], ctorParameters: () => [] });
|
|
539
670
|
|
|
540
|
-
|
|
541
|
-
(
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
671
|
+
class ErrorInterceptorService {
|
|
672
|
+
constructor() {
|
|
673
|
+
this.apiErrorSrv = inject(ApiErrorsService);
|
|
674
|
+
}
|
|
675
|
+
intercept(req, next) {
|
|
676
|
+
return next
|
|
677
|
+
.handle(req)
|
|
678
|
+
.pipe(catchError((err) => {
|
|
679
|
+
if (err.status === 404 || err.status === 500) {
|
|
680
|
+
this.apiErrorSrv.setLocalError();
|
|
681
|
+
}
|
|
682
|
+
return throwError(err);
|
|
683
|
+
}));
|
|
684
|
+
}
|
|
685
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: ErrorInterceptorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
686
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: ErrorInterceptorService }); }
|
|
687
|
+
}
|
|
688
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: ErrorInterceptorService, decorators: [{
|
|
689
|
+
type: Injectable
|
|
690
|
+
}], ctorParameters: () => [] });
|
|
691
|
+
|
|
692
|
+
const DELAY_INITIAL_LOADER_HIDING = 0;
|
|
693
|
+
const LOADER_HIDE_CSS_CLASS = 'trm-loader-init--hide';
|
|
694
|
+
function hideInitLoader() {
|
|
695
|
+
return of(false).pipe(first(), map(() => {
|
|
696
|
+
const loader = document.querySelector('.trm-loader-init');
|
|
697
|
+
if (!loader) {
|
|
698
|
+
return false;
|
|
699
|
+
}
|
|
700
|
+
loader.classList.add(LOADER_HIDE_CSS_CLASS);
|
|
701
|
+
return true;
|
|
702
|
+
}), delay(DELAY_INITIAL_LOADER_HIDING));
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
const insertRemoveTrigger = trigger('insertRemove', [
|
|
706
|
+
transition(':enter', [
|
|
707
|
+
style({ opacity: 0 }),
|
|
708
|
+
animate('150ms', style({ opacity: 1 })),
|
|
709
|
+
]),
|
|
710
|
+
transition(':leave', [
|
|
711
|
+
animate('150ms', style({ opacity: 0 }))
|
|
712
|
+
])
|
|
713
|
+
]);
|
|
545
714
|
|
|
546
715
|
const removeSpecSymbols = (s) => s.replace(/[\+\(\)\-\s]+/g, '');
|
|
547
716
|
const PHONE_MASKS = [
|
|
@@ -1903,44 +2072,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
1903
2072
|
type: Injectable
|
|
1904
2073
|
}], ctorParameters: () => [] });
|
|
1905
2074
|
|
|
1906
|
-
var PaymentFieldTypeEnum;
|
|
1907
|
-
(function (PaymentFieldTypeEnum) {
|
|
1908
|
-
PaymentFieldTypeEnum["Amount"] = "amount";
|
|
1909
|
-
PaymentFieldTypeEnum["Email"] = "email";
|
|
1910
|
-
PaymentFieldTypeEnum["Text"] = "text";
|
|
1911
|
-
PaymentFieldTypeEnum["Number"] = "number";
|
|
1912
|
-
PaymentFieldTypeEnum["Date"] = "date";
|
|
1913
|
-
PaymentFieldTypeEnum["Select"] = "select";
|
|
1914
|
-
PaymentFieldTypeEnum["Iframe"] = "iframe";
|
|
1915
|
-
})(PaymentFieldTypeEnum || (PaymentFieldTypeEnum = {}));
|
|
1916
|
-
|
|
1917
|
-
const DEFAULT_COUNTRY_LOCALHOST_KEY = 'TERMINAL_COUNTRY';
|
|
1918
|
-
const DEFAULT_METHOD_LOCALHOST_KEY = 'TERMINAL_METHOD';
|
|
1919
|
-
const DEFAULT_CURRENCY_LOCALHOST_KEY = 'TERMINAL_CURRENCY';
|
|
1920
|
-
|
|
1921
|
-
const DELAY_INITIAL_LOADER_HIDING = 0;
|
|
1922
|
-
const LOADER_HIDE_CSS_CLASS = 'trm-loader-init--hide';
|
|
1923
|
-
function hideInitLoader() {
|
|
1924
|
-
return of(false).pipe(first(), map(() => {
|
|
1925
|
-
const loader = document.querySelector('.trm-loader-init');
|
|
1926
|
-
if (!loader) {
|
|
1927
|
-
return false;
|
|
1928
|
-
}
|
|
1929
|
-
loader.classList.add(LOADER_HIDE_CSS_CLASS);
|
|
1930
|
-
return true;
|
|
1931
|
-
}), delay(DELAY_INITIAL_LOADER_HIDING));
|
|
1932
|
-
}
|
|
1933
|
-
|
|
1934
|
-
const insertRemoveTrigger = trigger('insertRemove', [
|
|
1935
|
-
transition(':enter', [
|
|
1936
|
-
style({ opacity: 0 }),
|
|
1937
|
-
animate('150ms', style({ opacity: 1 })),
|
|
1938
|
-
]),
|
|
1939
|
-
transition(':leave', [
|
|
1940
|
-
animate('150ms', style({ opacity: 0 }))
|
|
1941
|
-
])
|
|
1942
|
-
]);
|
|
1943
|
-
|
|
1944
2075
|
function sortByTabIndex(list) {
|
|
1945
2076
|
return list.sort((a, b) => {
|
|
1946
2077
|
const index1 = +a.getAttribute('tabindex');
|
|
@@ -2060,6 +2191,23 @@ const warningConsole = () => {
|
|
|
2060
2191
|
console.log("\n");
|
|
2061
2192
|
};
|
|
2062
2193
|
|
|
2194
|
+
var PaymentFieldTypeEnum;
|
|
2195
|
+
(function (PaymentFieldTypeEnum) {
|
|
2196
|
+
PaymentFieldTypeEnum["Amount"] = "amount";
|
|
2197
|
+
PaymentFieldTypeEnum["Email"] = "email";
|
|
2198
|
+
PaymentFieldTypeEnum["Text"] = "text";
|
|
2199
|
+
PaymentFieldTypeEnum["Number"] = "number";
|
|
2200
|
+
PaymentFieldTypeEnum["Date"] = "date";
|
|
2201
|
+
PaymentFieldTypeEnum["Select"] = "select";
|
|
2202
|
+
PaymentFieldTypeEnum["Iframe"] = "iframe";
|
|
2203
|
+
})(PaymentFieldTypeEnum || (PaymentFieldTypeEnum = {}));
|
|
2204
|
+
|
|
2205
|
+
var CollectionType;
|
|
2206
|
+
(function (CollectionType) {
|
|
2207
|
+
CollectionType[CollectionType["Banks"] = 1] = "Banks";
|
|
2208
|
+
CollectionType[CollectionType["Documents"] = 2] = "Documents";
|
|
2209
|
+
})(CollectionType || (CollectionType = {}));
|
|
2210
|
+
|
|
2063
2211
|
const PHONE_FIELD = {
|
|
2064
2212
|
name: 'add_phone_number',
|
|
2065
2213
|
description: I18N_KEY.CONSTRUCTOR_DESCRIPTION_PHONE,
|
|
@@ -2098,6 +2246,7 @@ const FIELD_TEMPLATE = {
|
|
|
2098
2246
|
type: PaymentFieldTypeEnum.Amount
|
|
2099
2247
|
},
|
|
2100
2248
|
CARD_TERMINAL: {
|
|
2249
|
+
name: 'card_terminal',
|
|
2101
2250
|
type: PaymentFieldTypeEnum.Iframe
|
|
2102
2251
|
},
|
|
2103
2252
|
EMAIL: EMAIL_FIELD,
|
|
@@ -2164,107 +2313,6 @@ const FIELD_TEMPLATE = {
|
|
|
2164
2313
|
}
|
|
2165
2314
|
};
|
|
2166
2315
|
|
|
2167
|
-
const FORMAT_DATE = 'YYYY-MM-DD';
|
|
2168
|
-
|
|
2169
|
-
class CSRFResolver {
|
|
2170
|
-
constructor() {
|
|
2171
|
-
this.document = inject(DOCUMENT);
|
|
2172
|
-
this.cookieSrv = inject(CookieService);
|
|
2173
|
-
this.apiErrorsSrv = inject(ApiErrorsService);
|
|
2174
|
-
this.configuration = inject(CONFIGURATION_TOKEN, { optional: true }) || { credentials: {} };
|
|
2175
|
-
this.terminalApi = inject(TERMINAL_SERVICE_TOKEN);
|
|
2176
|
-
this.token = inject(SessionToken, { optional: true }) || 'token';
|
|
2177
|
-
this.langStorage = inject(TranslateLangStorageService);
|
|
2178
|
-
this.environment = inject(ENVIRONMENT);
|
|
2179
|
-
}
|
|
2180
|
-
get _localStorage() {
|
|
2181
|
-
return this.document.defaultView.localStorage;
|
|
2182
|
-
}
|
|
2183
|
-
saveDefaultCountry(defaultCountryISOCode) {
|
|
2184
|
-
if (defaultCountryISOCode) {
|
|
2185
|
-
this._localStorage.setItem(DEFAULT_COUNTRY_LOCALHOST_KEY, defaultCountryISOCode);
|
|
2186
|
-
}
|
|
2187
|
-
}
|
|
2188
|
-
get savedCountry() {
|
|
2189
|
-
return this._localStorage.getItem(DEFAULT_COUNTRY_LOCALHOST_KEY);
|
|
2190
|
-
}
|
|
2191
|
-
resolve(route) {
|
|
2192
|
-
const token = this.token;
|
|
2193
|
-
if (!token) {
|
|
2194
|
-
this.langStorage.setLanguageByCountry(this.savedCountry);
|
|
2195
|
-
if (!this.apiErrorsSrv.hasError) {
|
|
2196
|
-
this.apiErrorsSrv.setError({ code: ApiErrors.SESSION_NOT_FOUND });
|
|
2197
|
-
}
|
|
2198
|
-
return of(true);
|
|
2199
|
-
}
|
|
2200
|
-
const timezone = momentjs__default.tz.guess();
|
|
2201
|
-
if (!this.environment.csrf) {
|
|
2202
|
-
return of(false);
|
|
2203
|
-
}
|
|
2204
|
-
if (this.resolveCSRF(token)) {
|
|
2205
|
-
this.langStorage.setLanguageByCountry(this.savedCountry);
|
|
2206
|
-
return of(true);
|
|
2207
|
-
}
|
|
2208
|
-
return this.terminalApi.postTerminalOpen({
|
|
2209
|
-
token,
|
|
2210
|
-
terminalOpenRequest: {
|
|
2211
|
-
timezone
|
|
2212
|
-
}
|
|
2213
|
-
})
|
|
2214
|
-
.pipe(catchError((err) => {
|
|
2215
|
-
this.apiErrorsSrv.setError(err.error);
|
|
2216
|
-
return of({ csrf: null, defaultCountryISOCode: null });
|
|
2217
|
-
}), map(({ csrf, defaultCountryISOCode }) => {
|
|
2218
|
-
this.saveDefaultCountry(defaultCountryISOCode);
|
|
2219
|
-
this.langStorage.setLanguageByCountry(this.savedCountry);
|
|
2220
|
-
this.resolveCSRF(token, csrf);
|
|
2221
|
-
return true;
|
|
2222
|
-
}));
|
|
2223
|
-
}
|
|
2224
|
-
resolveCSRF(token, csrf) {
|
|
2225
|
-
if (!csrf) {
|
|
2226
|
-
if (token && this.cookieSrv.check(`${token}_${CSRF_COOKIE_NAME}`)) {
|
|
2227
|
-
this.apiErrorsSrv.clear();
|
|
2228
|
-
this.configuration.credentials.CSRF = this.cookieSrv.get(`${token}_${CSRF_COOKIE_NAME}`);
|
|
2229
|
-
return true;
|
|
2230
|
-
}
|
|
2231
|
-
}
|
|
2232
|
-
else {
|
|
2233
|
-
this.apiErrorsSrv.clear();
|
|
2234
|
-
this.cookieSrv.set(`${token}_${CSRF_COOKIE_NAME}`, csrf, momentjs__default().add(24, 'hours').toDate(), undefined, undefined, this.environment.production);
|
|
2235
|
-
this.configuration.credentials.CSRF = csrf;
|
|
2236
|
-
return true;
|
|
2237
|
-
}
|
|
2238
|
-
return false;
|
|
2239
|
-
}
|
|
2240
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: CSRFResolver, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2241
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: CSRFResolver }); }
|
|
2242
|
-
}
|
|
2243
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: CSRFResolver, decorators: [{
|
|
2244
|
-
type: Injectable
|
|
2245
|
-
}], ctorParameters: () => [] });
|
|
2246
|
-
|
|
2247
|
-
class ErrorInterceptorService {
|
|
2248
|
-
constructor() {
|
|
2249
|
-
this.apiErrorSrv = inject(ApiErrorsService);
|
|
2250
|
-
}
|
|
2251
|
-
intercept(req, next) {
|
|
2252
|
-
return next
|
|
2253
|
-
.handle(req)
|
|
2254
|
-
.pipe(catchError((err) => {
|
|
2255
|
-
if (err.status === 404 || err.status === 500) {
|
|
2256
|
-
this.apiErrorSrv.setError();
|
|
2257
|
-
}
|
|
2258
|
-
return throwError(err);
|
|
2259
|
-
}));
|
|
2260
|
-
}
|
|
2261
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: ErrorInterceptorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2262
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: ErrorInterceptorService }); }
|
|
2263
|
-
}
|
|
2264
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: ErrorInterceptorService, decorators: [{
|
|
2265
|
-
type: Injectable
|
|
2266
|
-
}], ctorParameters: () => [] });
|
|
2267
|
-
|
|
2268
2316
|
const advcash = {
|
|
2269
2317
|
confirmation: '',
|
|
2270
2318
|
title: 'Advcash',
|
|
@@ -2273,6 +2321,15 @@ const advcash = {
|
|
|
2273
2321
|
]
|
|
2274
2322
|
};
|
|
2275
2323
|
|
|
2324
|
+
var TerminalStep;
|
|
2325
|
+
(function (TerminalStep) {
|
|
2326
|
+
TerminalStep[TerminalStep["Prepare"] = 0] = "Prepare";
|
|
2327
|
+
TerminalStep[TerminalStep["Confirmation"] = 1] = "Confirmation";
|
|
2328
|
+
TerminalStep[TerminalStep["Status"] = 2] = "Status";
|
|
2329
|
+
})(TerminalStep || (TerminalStep = {}));
|
|
2330
|
+
|
|
2331
|
+
const FORMAT_DATE = 'YYYY-MM-DD';
|
|
2332
|
+
|
|
2276
2333
|
const alfabank = {
|
|
2277
2334
|
confirmation: '',
|
|
2278
2335
|
title: 'AlfaClick',
|
|
@@ -3426,7 +3483,7 @@ class SessionDataSource {
|
|
|
3426
3483
|
this.cd = inject(ChangeDetectorRef);
|
|
3427
3484
|
this.cardTerminalSdkFactory = inject(TERMINAL_SDK_FACTORY);
|
|
3428
3485
|
this.data$ = new BehaviorSubject(undefined);
|
|
3429
|
-
this.loading$ = new BehaviorSubject(
|
|
3486
|
+
this.loading$ = new BehaviorSubject(true);
|
|
3430
3487
|
this.loadingMethodInfo$ = new BehaviorSubject(true);
|
|
3431
3488
|
this.loadingConfirm$ = new BehaviorSubject(false);
|
|
3432
3489
|
this.configurations = new Map();
|
|
@@ -3494,7 +3551,7 @@ class SessionDataSource {
|
|
|
3494
3551
|
return this.data$.getValue();
|
|
3495
3552
|
}
|
|
3496
3553
|
get() {
|
|
3497
|
-
if (this.loading$.getValue()
|
|
3554
|
+
if (!this.loading$.getValue()) {
|
|
3498
3555
|
this.loading$.next(true);
|
|
3499
3556
|
}
|
|
3500
3557
|
return this.terminalApi.getTerminalSessionInfo({
|
|
@@ -3532,14 +3589,14 @@ class SessionDataSource {
|
|
|
3532
3589
|
}
|
|
3533
3590
|
catchError(loading$) {
|
|
3534
3591
|
return (err) => {
|
|
3535
|
-
this.apiErrorsSrv.
|
|
3592
|
+
this.apiErrorsSrv.setLocalError(err.error);
|
|
3536
3593
|
loading$?.next(false);
|
|
3537
3594
|
this.cd.markForCheck();
|
|
3538
3595
|
return throwError(err);
|
|
3539
3596
|
};
|
|
3540
3597
|
}
|
|
3541
3598
|
prepare(data) {
|
|
3542
|
-
if (this.loadingConfirm$.getValue()
|
|
3599
|
+
if (!this.loadingConfirm$.getValue()) {
|
|
3543
3600
|
this.loadingConfirm$.next(true);
|
|
3544
3601
|
}
|
|
3545
3602
|
return this.terminalApi
|
|
@@ -3550,7 +3607,7 @@ class SessionDataSource {
|
|
|
3550
3607
|
.pipe(catchError(this.catchError(this.loadingConfirm$)), tap(() => this.loadingConfirm$.next(false)));
|
|
3551
3608
|
}
|
|
3552
3609
|
confirm() {
|
|
3553
|
-
if (this.loadingConfirm$.getValue()
|
|
3610
|
+
if (!this.loadingConfirm$.getValue()) {
|
|
3554
3611
|
this.loadingConfirm$.next(true);
|
|
3555
3612
|
}
|
|
3556
3613
|
return this.terminalApi
|
|
@@ -3567,7 +3624,7 @@ class SessionDataSource {
|
|
|
3567
3624
|
}));
|
|
3568
3625
|
}
|
|
3569
3626
|
close() {
|
|
3570
|
-
if (this.loadingConfirm$.getValue()
|
|
3627
|
+
if (!this.loadingConfirm$.getValue()) {
|
|
3571
3628
|
this.loadingConfirm$.next(true);
|
|
3572
3629
|
}
|
|
3573
3630
|
return this.terminalApi
|
|
@@ -3577,7 +3634,7 @@ class SessionDataSource {
|
|
|
3577
3634
|
.pipe(catchError(this.catchError(this.loadingConfirm$)), map(() => {
|
|
3578
3635
|
if (!this.returnBack()) {
|
|
3579
3636
|
const error = { code: I18N_KEY.SESSION_CLOSED };
|
|
3580
|
-
this.apiErrorsSrv.
|
|
3637
|
+
this.apiErrorsSrv.setLocalError(error);
|
|
3581
3638
|
this.loadingConfirm$?.next(false);
|
|
3582
3639
|
this.cd.markForCheck();
|
|
3583
3640
|
throw error;
|
|
@@ -3618,7 +3675,7 @@ class ScriptLoader {
|
|
|
3618
3675
|
this.document = inject(DOCUMENT);
|
|
3619
3676
|
this.nonce = inject(CSP_NONCE);
|
|
3620
3677
|
this.environment = inject(ENVIRONMENT);
|
|
3621
|
-
this.
|
|
3678
|
+
this.SCRIPT_HASH_MAP = new Map([
|
|
3622
3679
|
[
|
|
3623
3680
|
'cde_sdk',
|
|
3624
3681
|
this.environment.production ? {
|
|
@@ -3631,9 +3688,6 @@ class ScriptLoader {
|
|
|
3631
3688
|
]
|
|
3632
3689
|
]);
|
|
3633
3690
|
}
|
|
3634
|
-
get window() {
|
|
3635
|
-
return this.document.defaultView;
|
|
3636
|
-
}
|
|
3637
3691
|
fetchScript(id) {
|
|
3638
3692
|
return new Promise((resolve, reject) => {
|
|
3639
3693
|
let script;
|
|
@@ -3661,7 +3715,7 @@ class ScriptLoader {
|
|
|
3661
3715
|
script = template.content.children.item(0);
|
|
3662
3716
|
}
|
|
3663
3717
|
else {
|
|
3664
|
-
const { src, hash } = this.
|
|
3718
|
+
const { src, hash } = this.SCRIPT_HASH_MAP.get(id);
|
|
3665
3719
|
script = this.document.createElement('script');
|
|
3666
3720
|
script.type = 'text/javascript';
|
|
3667
3721
|
script.src = src;
|
|
@@ -3674,7 +3728,7 @@ class ScriptLoader {
|
|
|
3674
3728
|
script.nonce = this.nonce;
|
|
3675
3729
|
script.onload = () => resolve();
|
|
3676
3730
|
script.onerror = (err) => reject(err);
|
|
3677
|
-
this.document.body.
|
|
3731
|
+
this.document.body.appendChild(script);
|
|
3678
3732
|
});
|
|
3679
3733
|
}
|
|
3680
3734
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: ScriptLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
@@ -3698,16 +3752,9 @@ class TerminalTplComponent {
|
|
|
3698
3752
|
FocusHandler.previousEnabled(ev);
|
|
3699
3753
|
}
|
|
3700
3754
|
ngOnInit() {
|
|
3701
|
-
this.
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
this.navigationEnd$(),
|
|
3705
|
-
this.langStorage.setLanguage$()
|
|
3706
|
-
])
|
|
3707
|
-
.pipe(switchMap(() => hideInitLoader()), first(), takeUntil(this.unSubscriber))
|
|
3708
|
-
.subscribe(() => {
|
|
3709
|
-
this.ready$.next(true);
|
|
3710
|
-
});
|
|
3755
|
+
this.navigationEnd$()
|
|
3756
|
+
.pipe(switchMap(() => this.langStorage.setLanguage$({ save: false })), switchMap(() => hideInitLoader()), first(), takeUntil(this.unSubscriber))
|
|
3757
|
+
.subscribe(() => this.ready$.next(true));
|
|
3711
3758
|
}
|
|
3712
3759
|
navigationEnd$() {
|
|
3713
3760
|
if (this.router.navigated) {
|
|
@@ -4123,14 +4170,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
4123
4170
|
|
|
4124
4171
|
class TerminalLangSwitcherComponent {
|
|
4125
4172
|
get translation_keys() {
|
|
4126
|
-
return this.langStorageSrv.
|
|
4173
|
+
return this.langStorageSrv.TRANSLATION_LANG_KEYS;
|
|
4127
4174
|
}
|
|
4128
4175
|
constructor() {
|
|
4176
|
+
this.versionSrv = inject(TERMINAL_VERSION_SERVICE_TOKEN);
|
|
4129
4177
|
this.langStorageSrv = inject(TranslateLangStorageService);
|
|
4130
4178
|
this.cd = inject(ChangeDetectorRef);
|
|
4131
4179
|
this.unSubscriber = new Subject();
|
|
4132
4180
|
this.loading = false;
|
|
4133
|
-
this.
|
|
4181
|
+
this.langChange = new EventEmitter();
|
|
4134
4182
|
this.tabIndex = 0;
|
|
4135
4183
|
this.langStorageSrv.onLangChange$
|
|
4136
4184
|
.pipe(takeUntil(this.unSubscriber))
|
|
@@ -4140,26 +4188,26 @@ class TerminalLangSwitcherComponent {
|
|
|
4140
4188
|
return this.langStorageSrv.currentLang;
|
|
4141
4189
|
}
|
|
4142
4190
|
get langs() {
|
|
4143
|
-
return
|
|
4191
|
+
return this.versionSrv.langs;
|
|
4144
4192
|
}
|
|
4145
4193
|
changeLang(lang) {
|
|
4146
|
-
this.langStorageSrv.setLanguage$(lang);
|
|
4194
|
+
this.langStorageSrv.setLanguage$({ lang, save: true });
|
|
4147
4195
|
this.cd.markForCheck();
|
|
4148
|
-
this.
|
|
4196
|
+
this.langChange.emit(lang);
|
|
4149
4197
|
}
|
|
4150
4198
|
ngOnDestroy() {
|
|
4151
4199
|
this.unSubscriber.next();
|
|
4152
4200
|
this.unSubscriber.unsubscribe();
|
|
4153
4201
|
}
|
|
4154
4202
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: TerminalLangSwitcherComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4155
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.2", type: TerminalLangSwitcherComponent, isStandalone: true, selector: "app-terminal-lang-switcher", inputs: { loading: "loading", tabIndex: "tabIndex" }, outputs: {
|
|
4203
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.2", type: TerminalLangSwitcherComponent, isStandalone: true, selector: "app-terminal-lang-switcher", inputs: { loading: "loading", tabIndex: "tabIndex" }, outputs: { langChange: "langChange" }, ngImport: i0, template: "@if (!loading) {\r\n <app-trm-select class=\"lang-switcher\"\r\n [hasBorder]=\"false\"\r\n [searchable]=\"false\"\r\n [hasScrollbar]=\"false\"\r\n [data]=\"langs\"\r\n [ngModel]=\"lang\"\r\n [tabIndex]=\"tabIndex\"\r\n (ngModelChange)=\"changeLang($event)\"\r\n >\r\n <ng-template trmSelectLabelTemplate let-item=\"item\">\r\n <span class=\"fi\" [ngClass]=\"'fi-' + translation_keys[item].code\"></span>\r\n <span> {{translation_keys[item].name | translate}}</span>\r\n </ng-template>\r\n </app-trm-select>\r\n} @else {\r\n <gm-skeleton [count]=\"1\" [size]=\"30\"></gm-skeleton>\r\n}\r\n", styles: [":host{display:block}@media (min-width: 768px){:host{min-width:108px}}.lang-switcher{--trm-select-padding-right: 20px;--trm-select-arrow-right: 0;width:100%}.fi{border-radius:2px;overflow:hidden;border:1px solid rgba(0,0,0,.08);box-sizing:border-box;background-origin:border-box;flex-shrink:0;height:15px}.fi~span{display:none}@media (min-width: 768px){.fi~span{display:inline}}.trm-skeleton{min-width:70px}.trm-skeleton .loader,.trm-skeleton .skeleton-loader{height:30px}\n"], dependencies: [{ kind: "component", type: TrmSelectComponent, selector: "app-trm-select", inputs: ["label", "hasBorder", "data", "tabIndex", "name", "placeholder", "searchable", "hasScrollbar", "nameId", "nameLabel"], outputs: ["open", "search"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: TrmSelectLabelTemplateDirective, selector: "[trmSelectLabelTemplate]" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "component", type: GmSkeletonComponent, selector: "gm-skeleton", inputs: ["shape", "orientation", "count", "size", "gap"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4156
4204
|
}
|
|
4157
4205
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: TerminalLangSwitcherComponent, decorators: [{
|
|
4158
4206
|
type: Component,
|
|
4159
4207
|
args: [{ selector: 'app-terminal-lang-switcher', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [TrmSelectComponent, FormsModule, TrmSelectLabelTemplateDirective, NgClass, TranslateModule, GmSkeletonComponent], template: "@if (!loading) {\r\n <app-trm-select class=\"lang-switcher\"\r\n [hasBorder]=\"false\"\r\n [searchable]=\"false\"\r\n [hasScrollbar]=\"false\"\r\n [data]=\"langs\"\r\n [ngModel]=\"lang\"\r\n [tabIndex]=\"tabIndex\"\r\n (ngModelChange)=\"changeLang($event)\"\r\n >\r\n <ng-template trmSelectLabelTemplate let-item=\"item\">\r\n <span class=\"fi\" [ngClass]=\"'fi-' + translation_keys[item].code\"></span>\r\n <span> {{translation_keys[item].name | translate}}</span>\r\n </ng-template>\r\n </app-trm-select>\r\n} @else {\r\n <gm-skeleton [count]=\"1\" [size]=\"30\"></gm-skeleton>\r\n}\r\n", styles: [":host{display:block}@media (min-width: 768px){:host{min-width:108px}}.lang-switcher{--trm-select-padding-right: 20px;--trm-select-arrow-right: 0;width:100%}.fi{border-radius:2px;overflow:hidden;border:1px solid rgba(0,0,0,.08);box-sizing:border-box;background-origin:border-box;flex-shrink:0;height:15px}.fi~span{display:none}@media (min-width: 768px){.fi~span{display:inline}}.trm-skeleton{min-width:70px}.trm-skeleton .loader,.trm-skeleton .skeleton-loader{height:30px}\n"] }]
|
|
4160
4208
|
}], ctorParameters: () => [], propDecorators: { loading: [{
|
|
4161
4209
|
type: Input
|
|
4162
|
-
}],
|
|
4210
|
+
}], langChange: [{
|
|
4163
4211
|
type: Output
|
|
4164
4212
|
}], tabIndex: [{
|
|
4165
4213
|
type: Input
|
|
@@ -4169,14 +4217,14 @@ class TerminalLayoutTplComponent {
|
|
|
4169
4217
|
constructor() {
|
|
4170
4218
|
this.versionSrv = inject(TERMINAL_VERSION_SERVICE_TOKEN);
|
|
4171
4219
|
this.document = inject(DOCUMENT);
|
|
4172
|
-
this.
|
|
4220
|
+
this.translateSrv = inject(TranslateService);
|
|
4173
4221
|
this.cd = inject(ChangeDetectorRef);
|
|
4174
4222
|
this.translateStorageSrv = inject(TranslateLangStorageService);
|
|
4175
4223
|
this.unSubscriber = new Subject();
|
|
4176
4224
|
this.loading = true;
|
|
4177
|
-
this.
|
|
4225
|
+
this.translateSrv.onLangChange
|
|
4178
4226
|
.pipe(takeUntil(this.unSubscriber))
|
|
4179
|
-
.subscribe((
|
|
4227
|
+
.subscribe(() => {
|
|
4180
4228
|
this.cd.detectChanges();
|
|
4181
4229
|
});
|
|
4182
4230
|
}
|
|
@@ -4194,7 +4242,7 @@ class TerminalLayoutTplComponent {
|
|
|
4194
4242
|
this.unSubscriber.unsubscribe();
|
|
4195
4243
|
}
|
|
4196
4244
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: TerminalLayoutTplComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4197
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.2", type: TerminalLayoutTplComponent, isStandalone: true, selector: "app-terminal-layout-tpl", inputs: { projectName: "projectName", description: "description", loading: "loading" }, ngImport: i0, template: "<ng-scrollbar appearance=\"compact\">\r\n <div class=\"terminal-layout\">\r\n <section class=\"terminal\">\r\n <div class=\"terminal__content\">\r\n <header class=\"terminal__header\">\r\n <i class=\"terminal__header-logo\"\r\n [class]=\"logoClass\"></i>\r\n <div class=\"terminal__header-lang\">\r\n @if (hasChoice) {\r\n <app-terminal-lang-switcher\r\n [loading]=\"loading\"\r\n [tabIndex]=\"1\"></app-terminal-lang-switcher>\r\n }\r\n </div>\r\n </header>\r\n <div class=\"terminal__form\">\r\n <ng-content selector=\"[terminal-layout-status]\"></ng-content>\r\n <ng-content selector=\"[terminal-layout-form]\"></ng-content>\r\n @if (loading) {\r\n <div class=\"trm-skeleton-group\">\r\n <gm-skeleton [count]=\"1\" [size]=\"120\"></gm-skeleton>\r\n <gm-skeleton [count]=\"4\" [gap]=\"20\" [size]=\"80\"></gm-skeleton>\r\n <gm-skeleton [count]=\"2\" [gap]=\"10\" [size]=\"48\"></gm-skeleton>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </section>\r\n <footer class=\"terminal-footer\">\r\n <i class=\"terminal-footer__logo\"></i>\r\n <p class=\"terminal-footer__txt\">\r\n {{footerText}}\r\n </p>\r\n </footer>\r\n </div>\r\n</ng-scrollbar>\r\n", styles: [":host{display:flex;flex-direction:column;height:100vh;box-sizing:border-box}.terminal{box-sizing:border-box;width:100%;max-width:528px;min-width:320px;padding:0 10px}.terminal-layout{min-height:100vh;padding:42px 0;display:flex;flex-direction:column;gap:42px;justify-content:flex-start;align-items:center}.terminal-footer{flex:auto 1 0;display:flex;flex-direction:column;gap:24px;justify-content:flex-end;align-items:center}.terminal-footer__txt{font-weight:400;font-size:14px;line-height:18px;color:var(--color-base-350);margin:0}.terminal__content{box-sizing:border-box;margin:auto;padding:20px;width:100%;background:#fff;border-radius:16px;min-height:300px;display:flex;flex-direction:column;gap:32px;justify-content:flex-start;align-items:stretch}@media (min-width: 768px){.terminal__content{padding:32px}}.terminal__header{display:flex;flex-direction:row;gap:0;justify-content:flex-start;align-items:center}@media (min-width: 768px){.terminal__header-logo{width:143px;height:30px}}.terminal__header-lang{margin-left:auto}.terminal__form{display:flex;flex-direction:column;gap:24px;justify-content:flex-start;align-items:stretch;width:100%;margin:auto}.terminal__status{margin-top:8px}.terminal .trm-skeleton-group{display:flex;flex-direction:column;gap:32px;justify-content:flex-start;align-items:stretch}.terminal .trm-skeleton-group__form{gap:20px}.terminal .trm-skeleton-group__form .loader,.terminal .trm-skeleton-group__form .skeleton-loader{height:80px}.terminal .trm-skeleton-group__header .loader,.terminal .trm-skeleton-group__header .skeleton-loader{height:120px}.terminal .trm-skeleton-group__actions{gap:10px}.terminal .trm-skeleton-group__actions .loader,.terminal .trm-skeleton-group__actions .skeleton-loader{height:48px}\n"], dependencies: [{ kind: "component", type: NgScrollbar, selector: "ng-scrollbar:not([externalViewport])", exportAs: ["ngScrollbar"] }, { kind: "component", type: TerminalLangSwitcherComponent, selector: "app-terminal-lang-switcher", inputs: ["loading", "tabIndex"], outputs: ["
|
|
4245
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.2", type: TerminalLayoutTplComponent, isStandalone: true, selector: "app-terminal-layout-tpl", inputs: { projectName: "projectName", description: "description", loading: "loading" }, ngImport: i0, template: "<ng-scrollbar appearance=\"compact\">\r\n <div class=\"terminal-layout\">\r\n <section class=\"terminal\">\r\n <div class=\"terminal__content\">\r\n <header class=\"terminal__header\">\r\n <i class=\"terminal__header-logo\"\r\n [class]=\"logoClass\"></i>\r\n <div class=\"terminal__header-lang\">\r\n @if (hasChoice) {\r\n <app-terminal-lang-switcher\r\n [loading]=\"loading\"\r\n [tabIndex]=\"1\"></app-terminal-lang-switcher>\r\n }\r\n </div>\r\n </header>\r\n <div class=\"terminal__form\">\r\n <ng-content selector=\"[terminal-layout-status]\"></ng-content>\r\n <ng-content selector=\"[terminal-layout-form]\"></ng-content>\r\n @if (loading) {\r\n <div class=\"trm-skeleton-group\">\r\n <gm-skeleton [count]=\"1\" [size]=\"120\"></gm-skeleton>\r\n <gm-skeleton [count]=\"4\" [gap]=\"20\" [size]=\"80\"></gm-skeleton>\r\n <gm-skeleton [count]=\"2\" [gap]=\"10\" [size]=\"48\"></gm-skeleton>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </section>\r\n <footer class=\"terminal-footer\">\r\n <i class=\"terminal-footer__logo\"></i>\r\n <p class=\"terminal-footer__txt\">\r\n {{footerText}}\r\n </p>\r\n </footer>\r\n </div>\r\n</ng-scrollbar>\r\n", styles: [":host{display:flex;flex-direction:column;height:100vh;box-sizing:border-box}.terminal{box-sizing:border-box;width:100%;max-width:528px;min-width:320px;padding:0 10px}.terminal-layout{min-height:100vh;padding:42px 0;display:flex;flex-direction:column;gap:42px;justify-content:flex-start;align-items:center}.terminal-footer{flex:auto 1 0;display:flex;flex-direction:column;gap:24px;justify-content:flex-end;align-items:center}.terminal-footer__txt{font-weight:400;font-size:14px;line-height:18px;color:var(--color-base-350);margin:0}.terminal__content{box-sizing:border-box;margin:auto;padding:20px;width:100%;background:#fff;border-radius:16px;min-height:300px;display:flex;flex-direction:column;gap:32px;justify-content:flex-start;align-items:stretch}@media (min-width: 768px){.terminal__content{padding:32px}}.terminal__header{display:flex;flex-direction:row;gap:0;justify-content:flex-start;align-items:center}@media (min-width: 768px){.terminal__header-logo{width:143px;height:30px}}.terminal__header-lang{margin-left:auto}.terminal__form{display:flex;flex-direction:column;gap:24px;justify-content:flex-start;align-items:stretch;width:100%;margin:auto}.terminal__status{margin-top:8px}.terminal .trm-skeleton-group{display:flex;flex-direction:column;gap:32px;justify-content:flex-start;align-items:stretch}.terminal .trm-skeleton-group__form{gap:20px}.terminal .trm-skeleton-group__form .loader,.terminal .trm-skeleton-group__form .skeleton-loader{height:80px}.terminal .trm-skeleton-group__header .loader,.terminal .trm-skeleton-group__header .skeleton-loader{height:120px}.terminal .trm-skeleton-group__actions{gap:10px}.terminal .trm-skeleton-group__actions .loader,.terminal .trm-skeleton-group__actions .skeleton-loader{height:48px}\n"], dependencies: [{ kind: "component", type: NgScrollbar, selector: "ng-scrollbar:not([externalViewport])", exportAs: ["ngScrollbar"] }, { kind: "component", type: TerminalLangSwitcherComponent, selector: "app-terminal-lang-switcher", inputs: ["loading", "tabIndex"], outputs: ["langChange"] }, { kind: "component", type: GmSkeletonComponent, selector: "gm-skeleton", inputs: ["shape", "orientation", "count", "size", "gap"] }] }); }
|
|
4198
4246
|
}
|
|
4199
4247
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: TerminalLayoutTplComponent, decorators: [{
|
|
4200
4248
|
type: Component,
|
|
@@ -4378,18 +4426,20 @@ function removeEmptyProps(obj, options = { nullValue: true }) {
|
|
|
4378
4426
|
class ConstructorFormService extends FormGroup {
|
|
4379
4427
|
constructor() {
|
|
4380
4428
|
super({
|
|
4381
|
-
country: new FormControl(),
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4429
|
+
country: new FormControl(undefined, Validators.required),
|
|
4430
|
+
method: new FormControl(undefined, Validators.required),
|
|
4431
|
+
currency: new FormControl(undefined, Validators.required),
|
|
4432
|
+
user_currency: new FormControl(undefined, Validators.required),
|
|
4385
4433
|
payment: new FormGroup({})
|
|
4386
4434
|
});
|
|
4387
4435
|
this.sessionDS = inject(SessionDataSource);
|
|
4388
4436
|
this.cd = inject(ChangeDetectorRef);
|
|
4389
4437
|
this.configurationFactory = inject(TERMINAL_METHOD_CONFIGURATION_FACTORY, { optional: true }) || ((method, defaultConfig) => defaultConfig);
|
|
4438
|
+
this._storage = inject(LocalStorage);
|
|
4390
4439
|
this.cancelRequestsSubscriber = new Subject();
|
|
4391
4440
|
this.unSubscriber = new Subject();
|
|
4392
4441
|
this.fields = [];
|
|
4442
|
+
this.ready = false;
|
|
4393
4443
|
this.amountDynamic = false;
|
|
4394
4444
|
}
|
|
4395
4445
|
get methodInfoLoading() {
|
|
@@ -4409,6 +4459,8 @@ class ConstructorFormService extends FormGroup {
|
|
|
4409
4459
|
.forEach((controlName) => this.payment.removeControl(controlName));
|
|
4410
4460
|
}
|
|
4411
4461
|
init() {
|
|
4462
|
+
this.ready = false;
|
|
4463
|
+
this.cd.detectChanges();
|
|
4412
4464
|
if (this.configurationFactory) {
|
|
4413
4465
|
this.config = this.configurationFactory(this.methodName, this.sessionDS.getConfiguration(this.methodName));
|
|
4414
4466
|
}
|
|
@@ -4428,7 +4480,10 @@ class ConstructorFormService extends FormGroup {
|
|
|
4428
4480
|
if (!field.name) {
|
|
4429
4481
|
return;
|
|
4430
4482
|
}
|
|
4431
|
-
const control = new FormControl(
|
|
4483
|
+
const control = new FormControl({
|
|
4484
|
+
value: field.type === PaymentFieldTypeEnum.Iframe ? undefined : null,
|
|
4485
|
+
disabled: false,
|
|
4486
|
+
});
|
|
4432
4487
|
const validators = [];
|
|
4433
4488
|
this.amountDynamic = methodInfo.amountDynamic;
|
|
4434
4489
|
const isEditable = !methodInfo.amountDynamic && this.isAmountEditable();
|
|
@@ -4507,15 +4562,13 @@ class ConstructorFormService extends FormGroup {
|
|
|
4507
4562
|
validators.push(field.validator(this.payment));
|
|
4508
4563
|
}
|
|
4509
4564
|
control.setValidators(validators);
|
|
4510
|
-
|
|
4511
|
-
this.payment.addControl(field.name, control);
|
|
4512
|
-
}
|
|
4565
|
+
this.payment.addControl(field.name, control);
|
|
4513
4566
|
this.fetchCollection(field)
|
|
4514
4567
|
.subscribe(() => {
|
|
4515
4568
|
control.updateValueAndValidity();
|
|
4516
4569
|
});
|
|
4517
4570
|
});
|
|
4518
|
-
|
|
4571
|
+
this.ready = true;
|
|
4519
4572
|
}
|
|
4520
4573
|
fetchCollection(field) {
|
|
4521
4574
|
const EMPTY_LIST = of([]).pipe(first());
|
|
@@ -4573,22 +4626,22 @@ class ConstructorFormService extends FormGroup {
|
|
|
4573
4626
|
return this.sessionDS.getTypeNameById(id);
|
|
4574
4627
|
}
|
|
4575
4628
|
saveDefaultCountry() {
|
|
4576
|
-
this.
|
|
4577
|
-
}
|
|
4578
|
-
get defaultCountry() {
|
|
4579
|
-
return this.sessionDS.document.defaultView.localStorage.getItem(DEFAULT_COUNTRY_LOCALHOST_KEY);
|
|
4629
|
+
this._storage.saveDefaultCountry(this.country.value);
|
|
4580
4630
|
}
|
|
4581
4631
|
saveDefaultMethodName() {
|
|
4582
|
-
this.
|
|
4583
|
-
}
|
|
4584
|
-
get defaultMethodName() {
|
|
4585
|
-
return this.sessionDS.document.defaultView.localStorage.getItem(DEFAULT_METHOD_LOCALHOST_KEY);
|
|
4632
|
+
this._storage.saveDefaultMethodName(this.methodName);
|
|
4586
4633
|
}
|
|
4587
4634
|
saveDefaultCurrency() {
|
|
4588
|
-
this.
|
|
4635
|
+
this._storage.saveDefaultCurrency(this.currency.value);
|
|
4636
|
+
}
|
|
4637
|
+
get defaultCountry() {
|
|
4638
|
+
return this._storage.defaultCountry;
|
|
4639
|
+
}
|
|
4640
|
+
get defaultMethodName() {
|
|
4641
|
+
return this._storage.defaultMethodName;
|
|
4589
4642
|
}
|
|
4590
4643
|
get defaultCurrency() {
|
|
4591
|
-
return this.
|
|
4644
|
+
return this._storage.defaultCurrency;
|
|
4592
4645
|
}
|
|
4593
4646
|
cancelRequests() {
|
|
4594
4647
|
this.cancelRequestsSubscriber.next();
|
|
@@ -4608,6 +4661,18 @@ class ConstructorFormService extends FormGroup {
|
|
|
4608
4661
|
});
|
|
4609
4662
|
return removeEmptyProps(data);
|
|
4610
4663
|
}
|
|
4664
|
+
updateValueAndValidityIframes() {
|
|
4665
|
+
this.fields.forEach(({ name, type }) => {
|
|
4666
|
+
if (type === PaymentFieldTypeEnum.Iframe) {
|
|
4667
|
+
this.payment.get(name).updateValueAndValidity({ emitEvent: false });
|
|
4668
|
+
}
|
|
4669
|
+
});
|
|
4670
|
+
}
|
|
4671
|
+
get readyIframesSubmit() {
|
|
4672
|
+
return this.fields
|
|
4673
|
+
.filter(({ type }) => type !== PaymentFieldTypeEnum.Iframe)
|
|
4674
|
+
.every(({ name, type }) => !this.payment.get(name).invalid);
|
|
4675
|
+
}
|
|
4611
4676
|
isAmountEditable() {
|
|
4612
4677
|
return this.sessionDS.getSessionValue().amountEditable;
|
|
4613
4678
|
}
|
|
@@ -4638,9 +4703,6 @@ class ConstructorFormService extends FormGroup {
|
|
|
4638
4703
|
});
|
|
4639
4704
|
this.updateValueAndValidity({ emitEvent: false });
|
|
4640
4705
|
}
|
|
4641
|
-
get isCDEFailed() {
|
|
4642
|
-
return this.hasError('cde_error');
|
|
4643
|
-
}
|
|
4644
4706
|
distinctValueChanges() {
|
|
4645
4707
|
return this.valueChanges.pipe(debounceTime(300), distinctUntilChanged((prev, curr) => {
|
|
4646
4708
|
if (!prev ||
|
|
@@ -4716,134 +4778,232 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
4716
4778
|
}]
|
|
4717
4779
|
}], ctorParameters: () => [] });
|
|
4718
4780
|
|
|
4719
|
-
class
|
|
4720
|
-
get finished() {
|
|
4721
|
-
return this._finished;
|
|
4722
|
-
}
|
|
4781
|
+
class CardSdkService {
|
|
4723
4782
|
constructor() {
|
|
4724
|
-
this.translateSrv = inject(TranslateService);
|
|
4725
|
-
this.sessionSrv = inject(SessionDataSource);
|
|
4726
|
-
this.cd = inject(ChangeDetectorRef);
|
|
4727
4783
|
this.scriptLoaderSrv = inject(ScriptLoader);
|
|
4728
|
-
this.
|
|
4729
|
-
this.
|
|
4730
|
-
this.
|
|
4731
|
-
this.I18N_KEY = I18N_KEY;
|
|
4732
|
-
this.error = new EventEmitter();
|
|
4733
|
-
this.paid = new EventEmitter();
|
|
4734
|
-
this.ready = new EventEmitter();
|
|
4735
|
-
this._iframeOnLoadHandler = () => {
|
|
4736
|
-
this.loading = false;
|
|
4737
|
-
this.cd.detectChanges();
|
|
4738
|
-
};
|
|
4739
|
-
this._ready = false;
|
|
4740
|
-
this._finished = false;
|
|
4741
|
-
this.submitted = false;
|
|
4784
|
+
this.sessionSrv = inject(SessionDataSource);
|
|
4785
|
+
this._pending = false;
|
|
4786
|
+
this._submitted = false;
|
|
4742
4787
|
}
|
|
4743
|
-
|
|
4744
|
-
this.
|
|
4745
|
-
.fetchScript('cde_sdk')
|
|
4746
|
-
.then(() => this._init(), () => this._onError());
|
|
4788
|
+
markAsReady() {
|
|
4789
|
+
this._pending = false;
|
|
4747
4790
|
}
|
|
4748
|
-
|
|
4749
|
-
|
|
4791
|
+
markAsSubmitted() {
|
|
4792
|
+
this._submitted = true;
|
|
4750
4793
|
}
|
|
4751
|
-
get
|
|
4752
|
-
return this.
|
|
4794
|
+
get pending() {
|
|
4795
|
+
return this._pending;
|
|
4753
4796
|
}
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
this.
|
|
4758
|
-
return;
|
|
4797
|
+
submit() {
|
|
4798
|
+
if (!this._submitted && this._sdk) {
|
|
4799
|
+
this._sdk.submit();
|
|
4800
|
+
this._pending = true;
|
|
4759
4801
|
}
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
this.
|
|
4763
|
-
|
|
4802
|
+
}
|
|
4803
|
+
get _ready$() {
|
|
4804
|
+
return fromPromise(this.scriptLoaderSrv.fetchScript('cde_sdk'));
|
|
4805
|
+
}
|
|
4806
|
+
createCardTerminalSdk$(lang, id, tabindex) {
|
|
4807
|
+
return this._ready$.pipe(map(() => (this._sdk = this.sessionSrv.createCardTerminalSdk(lang, id, tabindex))));
|
|
4808
|
+
}
|
|
4809
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: CardSdkService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4810
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: CardSdkService }); }
|
|
4811
|
+
}
|
|
4812
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: CardSdkService, decorators: [{
|
|
4813
|
+
type: Injectable
|
|
4814
|
+
}] });
|
|
4815
|
+
|
|
4816
|
+
class IframeValidatorDirectiveDirective {
|
|
4817
|
+
constructor() {
|
|
4818
|
+
this.cardSdkSrv = inject(CardSdkService);
|
|
4819
|
+
this.submitting$ = new Subject();
|
|
4820
|
+
this._validationSdkError = false;
|
|
4821
|
+
}
|
|
4822
|
+
registerSDK(sdk) {
|
|
4823
|
+
if (!sdk) {
|
|
4824
|
+
this._fatalError = I18N_KEY.ERROR_OCCUR_SDK;
|
|
4825
|
+
}
|
|
4826
|
+
else {
|
|
4827
|
+
this._sdk = sdk;
|
|
4828
|
+
this.handleSubmitting();
|
|
4829
|
+
}
|
|
4830
|
+
}
|
|
4831
|
+
handleSubmitting() {
|
|
4764
4832
|
this._sdk.onInputPending(() => {
|
|
4765
|
-
|
|
4766
|
-
this._sdk.refreshHeight();
|
|
4767
|
-
});
|
|
4768
|
-
this._ready = false;
|
|
4833
|
+
this._validationSdkError = true;
|
|
4769
4834
|
});
|
|
4770
|
-
this._sdk.
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
this.status = I18N_KEY.CDE_CARD_PAID;
|
|
4776
|
-
this.paid.emit();
|
|
4835
|
+
this._sdk.onError((code) => {
|
|
4836
|
+
this._validationSdkError = false;
|
|
4837
|
+
let codeError = I18N_KEY.ERROR_OCCUR;
|
|
4838
|
+
if (code === 501) {
|
|
4839
|
+
codeError = I18N_KEY.CDE_CARD_ERROR_501;
|
|
4777
4840
|
}
|
|
4778
|
-
else {
|
|
4779
|
-
|
|
4841
|
+
else if (code === 500) {
|
|
4842
|
+
codeError = I18N_KEY.CDE_CARD_ERROR_500;
|
|
4780
4843
|
}
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
this._sdk
|
|
4784
|
-
.onTimeout(() => this.error.emit(I18N_KEY.CDE_CARD_ERROR_504));
|
|
4785
|
-
this.translateSrv
|
|
4786
|
-
.onLangChange
|
|
4787
|
-
.pipe(takeUntil(this.unSubscriber))
|
|
4788
|
-
.subscribe((options) => {
|
|
4789
|
-
if (!options.lang) {
|
|
4790
|
-
return;
|
|
4844
|
+
else if (code === 504) {
|
|
4845
|
+
codeError = I18N_KEY.CDE_CARD_ERROR_504;
|
|
4791
4846
|
}
|
|
4792
|
-
this.
|
|
4847
|
+
this._fatalError = codeError;
|
|
4793
4848
|
});
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
subscriptions.push(this._sdk.onInputSubmitted(() => resolve(true)));
|
|
4806
|
-
}
|
|
4807
|
-
this._sdk.submit();
|
|
4808
|
-
})
|
|
4809
|
-
.then((result) => {
|
|
4810
|
-
subscriptions.map(s => s.unsubscribe());
|
|
4811
|
-
return result;
|
|
4849
|
+
this._sdk.onInputReady(() => {
|
|
4850
|
+
this._validationSdkError = false;
|
|
4851
|
+
this.submitting$.next(null);
|
|
4852
|
+
});
|
|
4853
|
+
this._sdk.onInputSubmitted(() => {
|
|
4854
|
+
this._validationSdkError = false;
|
|
4855
|
+
this.submitting$.next(null);
|
|
4856
|
+
});
|
|
4857
|
+
this._sdk.onTimeout(() => {
|
|
4858
|
+
this._validationSdkError = false;
|
|
4859
|
+
this._fatalError = I18N_KEY.CDE_CARD_ERROR_504;
|
|
4812
4860
|
});
|
|
4813
4861
|
}
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
codeError = I18N_KEY.CDE_CARD_ERROR_501;
|
|
4862
|
+
validate(control) {
|
|
4863
|
+
if (this._fatalError) {
|
|
4864
|
+
return of({ cde_error: this._fatalError });
|
|
4818
4865
|
}
|
|
4819
|
-
|
|
4820
|
-
|
|
4866
|
+
if (this._validationSdkError) {
|
|
4867
|
+
return of({ cde_validation_error: true });
|
|
4821
4868
|
}
|
|
4822
|
-
|
|
4823
|
-
|
|
4869
|
+
if (this.cardSdkSrv.pending) {
|
|
4870
|
+
return this.submitting$.asObservable();
|
|
4824
4871
|
}
|
|
4825
|
-
|
|
4826
|
-
this.error.emit(codeError);
|
|
4872
|
+
return of(null);
|
|
4827
4873
|
}
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4874
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: IframeValidatorDirectiveDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4875
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.2", type: IframeValidatorDirectiveDirective, isStandalone: true, selector: "[appIframeValidatorDirective]", providers: [
|
|
4876
|
+
{
|
|
4877
|
+
provide: NG_ASYNC_VALIDATORS,
|
|
4878
|
+
useExisting: forwardRef(() => IframeValidatorDirectiveDirective),
|
|
4879
|
+
multi: true,
|
|
4880
|
+
},
|
|
4881
|
+
], ngImport: i0 }); }
|
|
4882
|
+
}
|
|
4883
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: IframeValidatorDirectiveDirective, decorators: [{
|
|
4884
|
+
type: Directive,
|
|
4885
|
+
args: [{
|
|
4886
|
+
selector: '[appIframeValidatorDirective]',
|
|
4887
|
+
standalone: true,
|
|
4888
|
+
providers: [
|
|
4889
|
+
{
|
|
4890
|
+
provide: NG_ASYNC_VALIDATORS,
|
|
4891
|
+
useExisting: forwardRef(() => IframeValidatorDirectiveDirective),
|
|
4892
|
+
multi: true,
|
|
4893
|
+
},
|
|
4894
|
+
],
|
|
4895
|
+
}]
|
|
4896
|
+
}] });
|
|
4897
|
+
|
|
4898
|
+
const ID_CDE_CONTAINER = 'cde-container';
|
|
4899
|
+
class ConstructorFieldIframeComponent {
|
|
4900
|
+
constructor() {
|
|
4901
|
+
this._translateSrv = inject(TranslateService);
|
|
4902
|
+
this._sessionSrv = inject(SessionDataSource);
|
|
4903
|
+
this._cd = inject(ChangeDetectorRef);
|
|
4904
|
+
this._injector = inject(Injector);
|
|
4905
|
+
this._destroyRef = inject(DestroyRef);
|
|
4906
|
+
this.viewReady = false;
|
|
4907
|
+
this.validator = inject(IframeValidatorDirectiveDirective);
|
|
4908
|
+
this.cardSdkSrv = inject(CardSdkService);
|
|
4909
|
+
this._loading = true;
|
|
4910
|
+
this.I18N_KEY = I18N_KEY;
|
|
4911
|
+
this.ID_CDE_CONTAINER = ID_CDE_CONTAINER;
|
|
4912
|
+
}
|
|
4913
|
+
registerOnTouched(fn) { }
|
|
4914
|
+
registerOnChange(fn) { }
|
|
4915
|
+
writeValue() { }
|
|
4916
|
+
get loading() {
|
|
4917
|
+
return this._loading;
|
|
4918
|
+
}
|
|
4919
|
+
ngAfterViewInit() {
|
|
4920
|
+
this._control = this._injector.get(NgControl).control;
|
|
4921
|
+
this.cardSdkSrv
|
|
4922
|
+
.createCardTerminalSdk$(this._translateSrv.currentLang, this.ID_CDE_CONTAINER, this.tabIndex)
|
|
4923
|
+
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
4924
|
+
.subscribe({
|
|
4925
|
+
next: (sdk) => {
|
|
4926
|
+
this._sdk = sdk;
|
|
4927
|
+
this._destroyRef.onDestroy(() => this._sdk?.unsubscribe());
|
|
4928
|
+
this.validator.registerSDK(sdk);
|
|
4929
|
+
this._init();
|
|
4930
|
+
},
|
|
4931
|
+
error: () => {
|
|
4932
|
+
this.validator.registerSDK();
|
|
4933
|
+
this._updateValueAndValidity();
|
|
4934
|
+
},
|
|
4935
|
+
});
|
|
4936
|
+
}
|
|
4937
|
+
_updateValueAndValidity() {
|
|
4938
|
+
this.cardSdkSrv.markAsReady();
|
|
4939
|
+
this._control?.updateValueAndValidity({ onlySelf: true });
|
|
4940
|
+
this._cd.detectChanges();
|
|
4941
|
+
this.refreshHeight();
|
|
4942
|
+
}
|
|
4943
|
+
refreshHeight() {
|
|
4944
|
+
setTimeout(() => {
|
|
4945
|
+
this._sdk?.refreshHeight();
|
|
4946
|
+
this.viewReady = true;
|
|
4947
|
+
this._cd.detectChanges();
|
|
4948
|
+
}, 100);
|
|
4949
|
+
}
|
|
4950
|
+
_init() {
|
|
4951
|
+
this._sdk.onInputPending(() => {
|
|
4952
|
+
this._loading = false;
|
|
4953
|
+
this._updateValueAndValidity();
|
|
4954
|
+
});
|
|
4955
|
+
this._sdk.onInputReady(() => {
|
|
4956
|
+
this._updateValueAndValidity();
|
|
4957
|
+
});
|
|
4958
|
+
this._sdk.onInputSubmitted(() => {
|
|
4959
|
+
this._loading = false;
|
|
4960
|
+
this.cardSdkSrv.markAsSubmitted();
|
|
4961
|
+
this.status = I18N_KEY.CDE_CARD_ERROR_ALREADY_PAID;
|
|
4962
|
+
this._updateValueAndValidity();
|
|
4963
|
+
});
|
|
4964
|
+
this._sdk.onTimeout(() => {
|
|
4965
|
+
this._updateValueAndValidity();
|
|
4966
|
+
});
|
|
4967
|
+
this._sdk.onError(() => {
|
|
4968
|
+
this._loading = false;
|
|
4969
|
+
this._updateValueAndValidity();
|
|
4970
|
+
});
|
|
4971
|
+
this._translateSrv.onLangChange
|
|
4972
|
+
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
4973
|
+
.subscribe({
|
|
4974
|
+
next: (options) => {
|
|
4975
|
+
if (!options.lang) {
|
|
4976
|
+
return;
|
|
4977
|
+
}
|
|
4978
|
+
this._sdk.useLang(options.lang);
|
|
4979
|
+
},
|
|
4980
|
+
});
|
|
4833
4981
|
}
|
|
4834
4982
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: ConstructorFieldIframeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4835
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.2", type: ConstructorFieldIframeComponent, isStandalone: true, selector: "app-constructor-field-iframe", inputs: { tabIndex: "tabIndex" },
|
|
4983
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.2", type: ConstructorFieldIframeComponent, isStandalone: true, selector: "app-constructor-field-iframe", inputs: { tabIndex: "tabIndex" }, providers: [
|
|
4984
|
+
{
|
|
4985
|
+
provide: NG_VALUE_ACCESSOR,
|
|
4986
|
+
useExisting: forwardRef(() => ConstructorFieldIframeComponent),
|
|
4987
|
+
multi: true,
|
|
4988
|
+
},
|
|
4989
|
+
CardSdkService,
|
|
4990
|
+
], hostDirectives: [{ directive: IframeValidatorDirectiveDirective }], ngImport: i0, template: "@if (!status) {\r\n <div\r\n class=\"iframe-container\"\r\n [id]=\"ID_CDE_CONTAINER\"\r\n [hidden]=\"loading\"\r\n [class.iframe-container--ready]=\"viewReady\"\r\n ></div>\r\n} @else if (!loading) {\r\n <p class=\"iframe-warning text--warn\">{{ status | trans }}</p>\r\n}\r\n\r\n@if (loading) {\r\n <div class=\"trm-skeleton-fields\">\r\n @for (i of [1,2]; track i) {\r\n <div class=\"trm-skeleton-field\">\r\n <gm-skeleton [count]=\"1\" [shape]=\"'rect-md'\" [size]=\"18\"></gm-skeleton>\r\n <gm-skeleton [count]=\"1\" [size]=\"50\"></gm-skeleton>\r\n </div>\r\n }\r\n </div>\r\n}\r\n", styles: [":host{position:relative}.iframe-container{position:absolute;width:100%;visibility:hidden}.iframe-container--ready{position:relative;visibility:visible}.iframe-warning{font-weight:400;font-size:14px;line-height:22px;color:var(--color-base-350);margin-top:8px}\n"], dependencies: [{ kind: "pipe", type: TranslateByKeyPipe, name: "trans" }, { kind: "component", type: GmSkeletonComponent, selector: "gm-skeleton", inputs: ["shape", "orientation", "count", "size", "gap"] }], animations: [insertRemoveTrigger], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4836
4991
|
}
|
|
4837
4992
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: ConstructorFieldIframeComponent, decorators: [{
|
|
4838
4993
|
type: Component,
|
|
4839
|
-
args: [{ selector: 'app-constructor-field-iframe', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true,
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4994
|
+
args: [{ selector: 'app-constructor-field-iframe', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, animations: [insertRemoveTrigger], providers: [
|
|
4995
|
+
{
|
|
4996
|
+
provide: NG_VALUE_ACCESSOR,
|
|
4997
|
+
useExisting: forwardRef(() => ConstructorFieldIframeComponent),
|
|
4998
|
+
multi: true,
|
|
4999
|
+
},
|
|
5000
|
+
CardSdkService,
|
|
5001
|
+
], imports: [TranslateByKeyPipe, GmSkeletonComponent], hostDirectives: [
|
|
5002
|
+
{
|
|
5003
|
+
directive: IframeValidatorDirectiveDirective,
|
|
5004
|
+
},
|
|
5005
|
+
], template: "@if (!status) {\r\n <div\r\n class=\"iframe-container\"\r\n [id]=\"ID_CDE_CONTAINER\"\r\n [hidden]=\"loading\"\r\n [class.iframe-container--ready]=\"viewReady\"\r\n ></div>\r\n} @else if (!loading) {\r\n <p class=\"iframe-warning text--warn\">{{ status | trans }}</p>\r\n}\r\n\r\n@if (loading) {\r\n <div class=\"trm-skeleton-fields\">\r\n @for (i of [1,2]; track i) {\r\n <div class=\"trm-skeleton-field\">\r\n <gm-skeleton [count]=\"1\" [shape]=\"'rect-md'\" [size]=\"18\"></gm-skeleton>\r\n <gm-skeleton [count]=\"1\" [size]=\"50\"></gm-skeleton>\r\n </div>\r\n }\r\n </div>\r\n}\r\n", styles: [":host{position:relative}.iframe-container{position:absolute;width:100%;visibility:hidden}.iframe-container--ready{position:relative;visibility:visible}.iframe-warning{font-weight:400;font-size:14px;line-height:22px;color:var(--color-base-350);margin-top:8px}\n"] }]
|
|
5006
|
+
}], propDecorators: { tabIndex: [{
|
|
4847
5007
|
type: Input
|
|
4848
5008
|
}] } });
|
|
4849
5009
|
|
|
@@ -4885,6 +5045,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
4885
5045
|
}] } });
|
|
4886
5046
|
|
|
4887
5047
|
class PsSelectComponent {
|
|
5048
|
+
constructor() {
|
|
5049
|
+
this.cd = inject(ChangeDetectorRef);
|
|
5050
|
+
this.methodTitlePipe = inject(MethodTitlePipe);
|
|
5051
|
+
this.translatePipe = inject(TranslatePipe);
|
|
5052
|
+
this.destroyRef = inject(DestroyRef);
|
|
5053
|
+
this.I18N_KEY = I18N_KEY;
|
|
5054
|
+
this.onChange = (_value) => {
|
|
5055
|
+
};
|
|
5056
|
+
this.onTouch = () => {
|
|
5057
|
+
};
|
|
5058
|
+
this.methods = [];
|
|
5059
|
+
this.disabled = false;
|
|
5060
|
+
this.otherMethodControl = new FormControl(undefined);
|
|
5061
|
+
}
|
|
4888
5062
|
get popularMethods() {
|
|
4889
5063
|
if (this.disabled) {
|
|
4890
5064
|
return null;
|
|
@@ -4908,24 +5082,10 @@ class PsSelectComponent {
|
|
|
4908
5082
|
}
|
|
4909
5083
|
});
|
|
4910
5084
|
}
|
|
4911
|
-
constructor() {
|
|
4912
|
-
this.cd = inject(ChangeDetectorRef);
|
|
4913
|
-
this.methodTitlePipe = inject(MethodTitlePipe);
|
|
4914
|
-
this.translatePipe = inject(TranslatePipe);
|
|
4915
|
-
this.unsub = new Subject();
|
|
4916
|
-
this.I18N_KEY = I18N_KEY;
|
|
4917
|
-
this.onChange = (_value) => {
|
|
4918
|
-
};
|
|
4919
|
-
this.onTouch = () => {
|
|
4920
|
-
};
|
|
4921
|
-
this.methods = [];
|
|
4922
|
-
this.disabled = false;
|
|
4923
|
-
this.otherMethodControl = new FormControl(undefined);
|
|
4924
|
-
}
|
|
4925
5085
|
ngOnInit() {
|
|
4926
5086
|
this.otherMethodControl
|
|
4927
5087
|
.valueChanges
|
|
4928
|
-
.pipe(filter(m => !!m),
|
|
5088
|
+
.pipe(filter(m => !!m), takeUntilDestroyed(this.destroyRef))
|
|
4929
5089
|
.subscribe((method) => this.selectMethod(method));
|
|
4930
5090
|
}
|
|
4931
5091
|
selectMethod(method, options = { emitChange: true }) {
|
|
@@ -4966,10 +5126,6 @@ class PsSelectComponent {
|
|
|
4966
5126
|
this.searchString = value;
|
|
4967
5127
|
this.cd.markForCheck();
|
|
4968
5128
|
}
|
|
4969
|
-
ngOnDestroy() {
|
|
4970
|
-
this.unsub.next();
|
|
4971
|
-
this.unsub.unsubscribe();
|
|
4972
|
-
}
|
|
4973
5129
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: PsSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4974
5130
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.2", type: PsSelectComponent, isStandalone: true, selector: "app-ps-select", inputs: { methods: "methods", tabIndex: "tabIndex" }, providers: [
|
|
4975
5131
|
{
|
|
@@ -4992,13 +5148,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
4992
5148
|
MethodTitlePipe,
|
|
4993
5149
|
TranslatePipe
|
|
4994
5150
|
], standalone: true, imports: [TabIndexFocusDirective, NgClass, TrmSelectComponent, FormsModule, ReactiveFormsModule, TrmSelectLabelTemplateDirective, MethodTitlePipe, TranslateByKeyPipe], template: "<label class=\"trm-label\">\r\n {{I18N_KEY.CONSTRUCTOR_LABEL_PS | trans}}\r\n</label>\r\n<ul class=\"methods\">\r\n @for (method of popularMethods; track method.id) {\r\n <li class=\"method\"\r\n [class.method--selected]=\"selectedType === method.id\"\r\n [tabindex]=\"tabIndex\"\r\n (keydown.enter)=\"$event.stopPropagation(); selectMethod(method.id)\"\r\n (blur)=\"onTouch()\"\r\n (click)=\"selectMethod(method.id)\"\r\n >\r\n <span class=\"method__icon\"\r\n [ngClass]=\"'ps-icon-'+method.name\"\r\n ></span>\r\n <span class=\"method__name\" [title]=\"method.name | trans\" > {{method.name | method_title | trans}} </span>\r\n </li>\r\n }\r\n @if (searchString || otherMethods.length) {\r\n <li class=\"methods__other\">\r\n <app-trm-select [data]=\"otherMethods\"\r\n idLabel=\"method\"\r\n (search)=\"search($event)\"\r\n [tabIndex]=\"tabIndex\"\r\n (open)=\"onTouch()\"\r\n [formControl]=\"otherMethodControl\"\r\n [placeholder]=\"I18N_KEY.CONSTRUCTOR_PLACEHOLDER_PS | trans\"\r\n class=\"c-field-select trm-form-field\"\r\n >\r\n <ng-template trmSelectLabelTemplate let-item=\"item\">\r\n <span class=\"method__icon\"\r\n [ngClass]=\"'ps-icon-'+item.name\"></span>\r\n <span class=\"method__name\"\r\n [title]=\"item.name | trans\" >{{item.name | method_title | trans}}</span>\r\n </ng-template>\r\n </app-trm-select>\r\n </li>\r\n }\r\n</ul>\r\n<ng-content select=\"[app-ps-select-hint]\"></ng-content>\r\n<ng-content select=\"[app-ps-select-error]\"></ng-content>\r\n\r\n", styles: [":host{display:block}.methods{display:flex;flex-direction:row;gap:10px;justify-content:flex-start;align-items:flex-start;list-style:none;flex-wrap:wrap;margin:0;padding:0}.methods .method{--method-color: var(--ps-select-color, var(--color-base-350));--method-border-color: var(--ps-select-border-color, var(--color-base-200));display:flex;flex-direction:column;gap:10px;justify-content:flex-start;align-items:flex-start;box-sizing:border-box;flex:100%;max-width:calc(50% - 5px);padding:16px;border:1px solid var(--method-border-color);border-radius:10px;outline:0;align-self:stretch}.methods .method:hover,.methods .method:focus{--method-color: var(--ps-select-color--hover, var(--color-primary-500));--method-border-color: var(--ps-select-border-color--hover, var(--color-primary-500));cursor:pointer;box-shadow:0 0 15px -1px #a378ff26}.methods .method.method--selected{--method-color: var(--ps-select-color--active, var(--color-primary-500));--method-border-color: var(--ps-select-border-color--active, var(--color-primary-500));cursor:default;box-shadow:0 0 0 2px var(--method-border-color);outline:none}.methods .method__icon{background:transparent no-repeat 100% 100%;background-size:contain;width:24px;height:24px;flex-shrink:0}.methods .method__name{font-weight:600;font-size:14px;line-height:18px;color:var(--method-color);white-space:normal;overflow:hidden;max-width:100%;text-overflow:ellipsis;flex-shrink:0}.methods__other{box-sizing:border-box;flex:100%;margin-top:10px}\n"] }]
|
|
4995
|
-
}],
|
|
5151
|
+
}], propDecorators: { methods: [{
|
|
4996
5152
|
type: Input
|
|
4997
5153
|
}], tabIndex: [{
|
|
4998
5154
|
type: Input
|
|
4999
5155
|
}] } });
|
|
5000
5156
|
|
|
5001
5157
|
class ConstructorFieldSelectComponent {
|
|
5158
|
+
constructor() {
|
|
5159
|
+
this.cd = inject(ChangeDetectorRef);
|
|
5160
|
+
this.injector = inject(Injector);
|
|
5161
|
+
this.I18N_KEY = I18N_KEY;
|
|
5162
|
+
this.onChange = (_value) => {
|
|
5163
|
+
};
|
|
5164
|
+
this.onTouch = () => {
|
|
5165
|
+
};
|
|
5166
|
+
}
|
|
5002
5167
|
get data() {
|
|
5003
5168
|
if (!this.items) {
|
|
5004
5169
|
return [];
|
|
@@ -5015,17 +5180,6 @@ class ConstructorFieldSelectComponent {
|
|
|
5015
5180
|
}
|
|
5016
5181
|
});
|
|
5017
5182
|
}
|
|
5018
|
-
constructor() {
|
|
5019
|
-
this.cd = inject(ChangeDetectorRef);
|
|
5020
|
-
this.injector = inject(Injector);
|
|
5021
|
-
this.unsub = new Subject();
|
|
5022
|
-
this.I18N_KEY = I18N_KEY;
|
|
5023
|
-
this.onChange = (value) => {
|
|
5024
|
-
};
|
|
5025
|
-
this.onTouch = () => {
|
|
5026
|
-
};
|
|
5027
|
-
this.cd.detach();
|
|
5028
|
-
}
|
|
5029
5183
|
registerOnChange(fn) {
|
|
5030
5184
|
this.onChange = fn;
|
|
5031
5185
|
}
|
|
@@ -5043,27 +5197,8 @@ class ConstructorFieldSelectComponent {
|
|
|
5043
5197
|
return this.control?.getError('error');
|
|
5044
5198
|
}
|
|
5045
5199
|
ngAfterViewInit() {
|
|
5046
|
-
this.control = this.injector.get(
|
|
5047
|
-
this.cd.reattach();
|
|
5200
|
+
this.control = this.injector.get(NgControl).control;
|
|
5048
5201
|
this.cd.detectChanges();
|
|
5049
|
-
this.ngDoCheck();
|
|
5050
|
-
}
|
|
5051
|
-
ngDoCheck() {
|
|
5052
|
-
if (!this.control) {
|
|
5053
|
-
return;
|
|
5054
|
-
}
|
|
5055
|
-
if (this.control.dirty) {
|
|
5056
|
-
this.control.markAsDirty();
|
|
5057
|
-
this.cd.detectChanges();
|
|
5058
|
-
}
|
|
5059
|
-
if (this.control.touched) {
|
|
5060
|
-
this.control.markAsTouched();
|
|
5061
|
-
this.cd.detectChanges();
|
|
5062
|
-
}
|
|
5063
|
-
}
|
|
5064
|
-
ngOnDestroy() {
|
|
5065
|
-
this.unsub.next();
|
|
5066
|
-
this.unsub.unsubscribe();
|
|
5067
5202
|
}
|
|
5068
5203
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: ConstructorFieldSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5069
5204
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.2", type: ConstructorFieldSelectComponent, isStandalone: true, selector: "app-constructor-field-select", inputs: { config: "config", items: "items", tabIndex: "tabIndex" }, providers: [
|
|
@@ -5072,7 +5207,7 @@ class ConstructorFieldSelectComponent {
|
|
|
5072
5207
|
useExisting: forwardRef(() => ConstructorFieldSelectComponent),
|
|
5073
5208
|
multi: true
|
|
5074
5209
|
}
|
|
5075
|
-
], ngImport: i0, template: "<app-trm-select [data]=\"data\"\r\n
|
|
5210
|
+
], ngImport: i0, template: "@if (control) {\r\n <app-trm-select [data]=\"data\"\r\n [placeholder]=\"config.placeholder | trans\"\r\n [label]=\"config.label | trans\"\r\n [name]=\"config.name\"\r\n (search)=\"search($event)\"\r\n (open)=\"onTouch()\"\r\n [formControl]=\"control\"\r\n [tabIndex]=\"tabIndex\"\r\n class=\"c-field-select trm-form-field\"\r\n ></app-trm-select>\r\n @if (control.hasError('required') && control.touched && control.dirty) {\r\n <div class=\"trm-error\"\r\n @insertRemove\r\n >\r\n {{ I18N_KEY.VALIDATION_REQUIRED | trans }}\r\n </div>\r\n }\r\n @if (control.hasError('error') && control.touched && control.dirty) {\r\n <div class=\"trm-error\"\r\n @insertRemove\r\n >\r\n {{ apiError | trans }}\r\n </div>\r\n }\r\n\r\n @if (control.hasError('custom_error') && control.touched && control.dirty) {\r\n <div class=\"trm-error\"\r\n @insertRemove\r\n >\r\n {{ control.getError('custom_error') | trans }}\r\n </div>\r\n }\r\n\r\n}\r\n", styles: [":host{display:block;width:100%}\n"], dependencies: [{ kind: "component", type: TrmSelectComponent, selector: "app-trm-select", inputs: ["label", "hasBorder", "data", "tabIndex", "name", "placeholder", "searchable", "hasScrollbar", "nameId", "nameLabel"], outputs: ["open", "search"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "pipe", type: TranslateByKeyPipe, name: "trans" }], animations: [insertRemoveTrigger], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5076
5211
|
}
|
|
5077
5212
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: ConstructorFieldSelectComponent, decorators: [{
|
|
5078
5213
|
type: Component,
|
|
@@ -5082,8 +5217,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
5082
5217
|
useExisting: forwardRef(() => ConstructorFieldSelectComponent),
|
|
5083
5218
|
multi: true
|
|
5084
5219
|
}
|
|
5085
|
-
], standalone: true, imports: [TrmSelectComponent, FormsModule, ReactiveFormsModule, TranslateByKeyPipe], template: "<app-trm-select [data]=\"data\"\r\n
|
|
5086
|
-
}],
|
|
5220
|
+
], standalone: true, imports: [TrmSelectComponent, FormsModule, ReactiveFormsModule, TranslateByKeyPipe], template: "@if (control) {\r\n <app-trm-select [data]=\"data\"\r\n [placeholder]=\"config.placeholder | trans\"\r\n [label]=\"config.label | trans\"\r\n [name]=\"config.name\"\r\n (search)=\"search($event)\"\r\n (open)=\"onTouch()\"\r\n [formControl]=\"control\"\r\n [tabIndex]=\"tabIndex\"\r\n class=\"c-field-select trm-form-field\"\r\n ></app-trm-select>\r\n @if (control.hasError('required') && control.touched && control.dirty) {\r\n <div class=\"trm-error\"\r\n @insertRemove\r\n >\r\n {{ I18N_KEY.VALIDATION_REQUIRED | trans }}\r\n </div>\r\n }\r\n @if (control.hasError('error') && control.touched && control.dirty) {\r\n <div class=\"trm-error\"\r\n @insertRemove\r\n >\r\n {{ apiError | trans }}\r\n </div>\r\n }\r\n\r\n @if (control.hasError('custom_error') && control.touched && control.dirty) {\r\n <div class=\"trm-error\"\r\n @insertRemove\r\n >\r\n {{ control.getError('custom_error') | trans }}\r\n </div>\r\n }\r\n\r\n}\r\n", styles: [":host{display:block;width:100%}\n"] }]
|
|
5221
|
+
}], propDecorators: { config: [{
|
|
5087
5222
|
type: Input
|
|
5088
5223
|
}], items: [{
|
|
5089
5224
|
type: Input
|
|
@@ -5148,7 +5283,7 @@ class ConstructorFieldTextComponent {
|
|
|
5148
5283
|
this.dropSpecialCharacters = true;
|
|
5149
5284
|
this.I18N_KEY = I18N_KEY;
|
|
5150
5285
|
this.maskedValueChange = new EventEmitter();
|
|
5151
|
-
this.onChange = (
|
|
5286
|
+
this.onChange = (_value) => {
|
|
5152
5287
|
};
|
|
5153
5288
|
this.onTouch = () => {
|
|
5154
5289
|
};
|
|
@@ -5168,7 +5303,9 @@ class ConstructorFieldTextComponent {
|
|
|
5168
5303
|
this.control?.markAsUntouched();
|
|
5169
5304
|
e.preventDefault();
|
|
5170
5305
|
e.stopPropagation();
|
|
5171
|
-
target.value = this.maskPipe
|
|
5306
|
+
target.value = this.maskPipe
|
|
5307
|
+
.transform(target.value, this.mask, { patterns: this.maskPatterns })
|
|
5308
|
+
.replace(/^-|-$/, '');
|
|
5172
5309
|
setTimeout(() => {
|
|
5173
5310
|
this.control?.updateValueAndValidity();
|
|
5174
5311
|
if (selectionStart === selectionEnd && e.inputType !== 'deleteContentBackward') {
|
|
@@ -5187,7 +5324,7 @@ class ConstructorFieldTextComponent {
|
|
|
5187
5324
|
return;
|
|
5188
5325
|
}
|
|
5189
5326
|
const value = t.value;
|
|
5190
|
-
let content = e.clipboardData
|
|
5327
|
+
let content = e.clipboardData?.getData('text') || '';
|
|
5191
5328
|
let selectionStart = removeSpecSymbols(t.value.slice(0, t.selectionStart)).length + removeSpecSymbols(content).length;
|
|
5192
5329
|
if (value) {
|
|
5193
5330
|
const arr = Array.from(value);
|
|
@@ -5208,6 +5345,10 @@ class ConstructorFieldTextComponent {
|
|
|
5208
5345
|
return;
|
|
5209
5346
|
}
|
|
5210
5347
|
const target = e.target;
|
|
5348
|
+
if (this.type === PaymentFieldTypeEnum.Email) {
|
|
5349
|
+
this._emitMaskedValueChanges(target);
|
|
5350
|
+
return;
|
|
5351
|
+
}
|
|
5211
5352
|
const value = this.control?.value;
|
|
5212
5353
|
let selectionStart = removeSpecSymbols(target.value.slice(0, target.selectionStart)).length;
|
|
5213
5354
|
const mask = this.maskSrv.getMaskByValue(this.config.mask, value);
|
|
@@ -5379,19 +5520,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
5379
5520
|
}] } });
|
|
5380
5521
|
|
|
5381
5522
|
class ConstructorFieldDateComponent {
|
|
5382
|
-
get startCalendarDate() {
|
|
5383
|
-
return this.config.options?.startCalendarDate;
|
|
5384
|
-
}
|
|
5385
5523
|
constructor() {
|
|
5386
5524
|
this.cd = inject(ChangeDetectorRef);
|
|
5387
5525
|
this.injector = inject(Injector);
|
|
5526
|
+
this.destroyRef = inject(DestroyRef);
|
|
5388
5527
|
this.FORMAT_DATE = FORMAT_DATE;
|
|
5389
|
-
this.
|
|
5390
|
-
this.onChange = (value) => {
|
|
5528
|
+
this.onChange = (_value) => {
|
|
5391
5529
|
};
|
|
5392
5530
|
this.onTouch = () => {
|
|
5393
5531
|
};
|
|
5394
|
-
|
|
5532
|
+
}
|
|
5533
|
+
get startCalendarDate() {
|
|
5534
|
+
return this.config.options?.startCalendarDate;
|
|
5395
5535
|
}
|
|
5396
5536
|
registerOnChange(fn) {
|
|
5397
5537
|
this.onChange = fn;
|
|
@@ -5400,48 +5540,36 @@ class ConstructorFieldDateComponent {
|
|
|
5400
5540
|
this.onTouch = fn;
|
|
5401
5541
|
}
|
|
5402
5542
|
writeValue(value) {
|
|
5403
|
-
|
|
5404
|
-
|
|
5543
|
+
if (isMoment(value) || typeof value === 'string') {
|
|
5544
|
+
if (isMoment(value)) {
|
|
5545
|
+
this.control?.setValue(value.format(FORMAT_DATE), { emitEvent: false });
|
|
5546
|
+
}
|
|
5547
|
+
else {
|
|
5548
|
+
this.control?.setValue(value, { emitEvent: false });
|
|
5549
|
+
}
|
|
5550
|
+
this.cd.markForCheck();
|
|
5551
|
+
}
|
|
5405
5552
|
}
|
|
5406
5553
|
ngAfterViewInit() {
|
|
5407
|
-
this.control = this.injector.get(
|
|
5408
|
-
this.cd.reattach();
|
|
5554
|
+
this.control = this.injector.get(NgControl).control;
|
|
5409
5555
|
this.cd.detectChanges();
|
|
5410
|
-
this.ngDoCheck();
|
|
5411
5556
|
this.control
|
|
5412
5557
|
.valueChanges
|
|
5413
|
-
.pipe(
|
|
5558
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
5414
5559
|
.subscribe((value) => {
|
|
5415
5560
|
if (isMoment(value)) {
|
|
5416
5561
|
this.onChange(value.format(this.FORMAT_DATE));
|
|
5417
5562
|
}
|
|
5418
5563
|
});
|
|
5419
5564
|
}
|
|
5420
|
-
ngDoCheck() {
|
|
5421
|
-
if (!this.control) {
|
|
5422
|
-
return;
|
|
5423
|
-
}
|
|
5424
|
-
if (this.control.dirty) {
|
|
5425
|
-
this.control.markAsDirty();
|
|
5426
|
-
this.cd.detectChanges();
|
|
5427
|
-
}
|
|
5428
|
-
if (this.control.touched) {
|
|
5429
|
-
this.control.markAsTouched();
|
|
5430
|
-
this.cd.detectChanges();
|
|
5431
|
-
}
|
|
5432
|
-
}
|
|
5433
|
-
ngOnDestroy() {
|
|
5434
|
-
this.unsub.next();
|
|
5435
|
-
this.unsub.unsubscribe();
|
|
5436
|
-
}
|
|
5437
5565
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: ConstructorFieldDateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5438
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
5566
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.2", type: ConstructorFieldDateComponent, isStandalone: true, selector: "app-constructor-field-date", inputs: { config: "config", tabIndex: "tabIndex" }, providers: [
|
|
5439
5567
|
{
|
|
5440
5568
|
provide: NG_VALUE_ACCESSOR,
|
|
5441
5569
|
useExisting: forwardRef(() => ConstructorFieldDateComponent),
|
|
5442
5570
|
multi: true
|
|
5443
5571
|
}
|
|
5444
|
-
], ngImport: i0, template: "<app-constructor-field-text\r\n
|
|
5572
|
+
], ngImport: i0, template: "@if (control) {\r\n <app-constructor-field-text\r\n class=\"c-date__input\"\r\n [tabIndex]=\"tabIndex\"\r\n [config]=\"config\"\r\n [formControl]=\"control\"\r\n [matDatepicker]=\"picker\">\r\n <mat-datepicker-toggle [for]=\"picker\"\r\n app-c-text-suffix\r\n class=\"date__toggle\"\r\n [tabIndex]=\"tabIndex\"\r\n >\r\n <div class=\"date__toggleIcon\"\r\n matDatepickerToggleIcon\r\n app-c-text-suffix></div>\r\n </mat-datepicker-toggle>\r\n </app-constructor-field-text>\r\n\r\n <mat-datepicker #picker [tabIndex]=\"tabIndex\" [startAt]=\"startCalendarDate\"></mat-datepicker>\r\n}\r\n", styles: [":host{display:block}.date__toggle{position:absolute;top:50%;right:-20px;transform:translate(-50%,-50%);flex-shrink:0}.date__toggleIcon{display:block;mask-repeat:no-repeat;mask-size:contain}\n"], dependencies: [{ kind: "component", type: ConstructorFieldTextComponent, selector: "app-constructor-field-text", inputs: ["config", "matDatepicker", "tabIndex"], outputs: ["maskedValueChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "directive", type: MatDatepickerToggleIcon, selector: "[matDatepickerToggleIcon]" }, { kind: "component", type: MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5445
5573
|
}
|
|
5446
5574
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: ConstructorFieldDateComponent, decorators: [{
|
|
5447
5575
|
type: Component,
|
|
@@ -5451,8 +5579,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
5451
5579
|
useExisting: forwardRef(() => ConstructorFieldDateComponent),
|
|
5452
5580
|
multi: true
|
|
5453
5581
|
}
|
|
5454
|
-
], standalone: true, imports: [ConstructorFieldTextComponent, FormsModule, ReactiveFormsModule, MatDatepickerToggle, MatDatepickerToggleIcon, MatDatepicker], template: "<app-constructor-field-text\r\n
|
|
5455
|
-
}],
|
|
5582
|
+
], standalone: true, imports: [ConstructorFieldTextComponent, FormsModule, ReactiveFormsModule, MatDatepickerToggle, MatDatepickerToggleIcon, MatDatepicker], template: "@if (control) {\r\n <app-constructor-field-text\r\n class=\"c-date__input\"\r\n [tabIndex]=\"tabIndex\"\r\n [config]=\"config\"\r\n [formControl]=\"control\"\r\n [matDatepicker]=\"picker\">\r\n <mat-datepicker-toggle [for]=\"picker\"\r\n app-c-text-suffix\r\n class=\"date__toggle\"\r\n [tabIndex]=\"tabIndex\"\r\n >\r\n <div class=\"date__toggleIcon\"\r\n matDatepickerToggleIcon\r\n app-c-text-suffix></div>\r\n </mat-datepicker-toggle>\r\n </app-constructor-field-text>\r\n\r\n <mat-datepicker #picker [tabIndex]=\"tabIndex\" [startAt]=\"startCalendarDate\"></mat-datepicker>\r\n}\r\n", styles: [":host{display:block}.date__toggle{position:absolute;top:50%;right:-20px;transform:translate(-50%,-50%);flex-shrink:0}.date__toggleIcon{display:block;mask-repeat:no-repeat;mask-size:contain}\n"] }]
|
|
5583
|
+
}], propDecorators: { config: [{
|
|
5456
5584
|
type: Input
|
|
5457
5585
|
}], tabIndex: [{
|
|
5458
5586
|
type: Input
|
|
@@ -5486,6 +5614,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
5486
5614
|
}] } });
|
|
5487
5615
|
|
|
5488
5616
|
class ConstructorFormComponent {
|
|
5617
|
+
constructor() {
|
|
5618
|
+
this.cd = inject(ChangeDetectorRef);
|
|
5619
|
+
this.form = inject(ConstructorFormService);
|
|
5620
|
+
this.translateSrv = inject(TranslateService);
|
|
5621
|
+
this.countriesSortPipe = inject(CountriesSortPipe);
|
|
5622
|
+
this.countryTranslatePipe = inject(CountryTranslatePipe);
|
|
5623
|
+
this.ngScrollBar = inject(NgScrollbar);
|
|
5624
|
+
this.versionSrv = inject(TERMINAL_VERSION_SERVICE_TOKEN);
|
|
5625
|
+
this.unSubscriber = new Subject();
|
|
5626
|
+
this.preparationStepFilled = false;
|
|
5627
|
+
this.TERMINAL_STEP = TerminalStep;
|
|
5628
|
+
this.CONSTRUCTOR_FIELD_TYPES = PaymentFieldTypeEnum;
|
|
5629
|
+
this.loading = false;
|
|
5630
|
+
this.types = [];
|
|
5631
|
+
this.canReturnToProject = true;
|
|
5632
|
+
this.amountChanged = new EventEmitter();
|
|
5633
|
+
this.back = new EventEmitter();
|
|
5634
|
+
this.prepare = new EventEmitter();
|
|
5635
|
+
this.confirm = new EventEmitter();
|
|
5636
|
+
this.onPaymentChanged = new EventEmitter();
|
|
5637
|
+
this.I18N_KEY = I18N_KEY;
|
|
5638
|
+
}
|
|
5489
5639
|
get countriesList() {
|
|
5490
5640
|
return this.countriesSortPipe
|
|
5491
5641
|
.transform(this.types
|
|
@@ -5548,30 +5698,6 @@ class ConstructorFormComponent {
|
|
|
5548
5698
|
this.form.userCurrency.disable();
|
|
5549
5699
|
}
|
|
5550
5700
|
}
|
|
5551
|
-
hasFeeHint(options) {
|
|
5552
|
-
return options.fee || options.fixedFee || options.min || options.max;
|
|
5553
|
-
}
|
|
5554
|
-
constructor() {
|
|
5555
|
-
this.cd = inject(ChangeDetectorRef);
|
|
5556
|
-
this.form = inject(ConstructorFormService);
|
|
5557
|
-
this.translateSrv = inject(TranslateService);
|
|
5558
|
-
this.countriesSortPipe = inject(CountriesSortPipe);
|
|
5559
|
-
this.countryTranslatePipe = inject(CountryTranslatePipe);
|
|
5560
|
-
this.ngScrollBar = inject(NgScrollbar);
|
|
5561
|
-
this.versionSrv = inject(TERMINAL_VERSION_SERVICE_TOKEN);
|
|
5562
|
-
this.unSubscriber = new Subject();
|
|
5563
|
-
this.TERMINAL_STEP = TerminalStep;
|
|
5564
|
-
this.CONSTRUCTOR_FIELD_TYPES = PaymentFieldTypeEnum;
|
|
5565
|
-
this.loading = false;
|
|
5566
|
-
this.types = [];
|
|
5567
|
-
this.canReturnToProject = true;
|
|
5568
|
-
this.amountChanged = new EventEmitter();
|
|
5569
|
-
this.back = new EventEmitter();
|
|
5570
|
-
this.prepare = new EventEmitter();
|
|
5571
|
-
this.confirm = new EventEmitter();
|
|
5572
|
-
this.onPaymentChanged = new EventEmitter();
|
|
5573
|
-
this.I18N_KEY = I18N_KEY;
|
|
5574
|
-
}
|
|
5575
5701
|
get hasCurrencyMethodSelector() {
|
|
5576
5702
|
return this.versionSrv.hasCurrencyMethodSelector === true;
|
|
5577
5703
|
}
|
|
@@ -5586,7 +5712,19 @@ class ConstructorFormComponent {
|
|
|
5586
5712
|
// Get configuration fields
|
|
5587
5713
|
const countries = this.countriesList;
|
|
5588
5714
|
const defaultCountry = this.form.defaultCountry;
|
|
5589
|
-
|
|
5715
|
+
let country = null;
|
|
5716
|
+
if (!countries.includes(defaultCountry)) {
|
|
5717
|
+
if (countries.includes(OTHER_COUNTRY_CODE)) {
|
|
5718
|
+
country = OTHER_COUNTRY_CODE;
|
|
5719
|
+
}
|
|
5720
|
+
}
|
|
5721
|
+
else {
|
|
5722
|
+
country = defaultCountry;
|
|
5723
|
+
}
|
|
5724
|
+
this.form.country.setValue(country);
|
|
5725
|
+
if (!country) {
|
|
5726
|
+
return;
|
|
5727
|
+
}
|
|
5590
5728
|
if (countries.length === 1 && this.form.country.value) {
|
|
5591
5729
|
this.form.country.disable();
|
|
5592
5730
|
}
|
|
@@ -5607,10 +5745,16 @@ class ConstructorFormComponent {
|
|
|
5607
5745
|
.subscribe(() => this.onPaymentChanged.emit(this.form.getRawValue()));
|
|
5608
5746
|
this.fetchForm();
|
|
5609
5747
|
}
|
|
5748
|
+
if (changes.step?.currentValue && !changes.types && !changes.currency) {
|
|
5749
|
+
this.fetchForm();
|
|
5750
|
+
}
|
|
5610
5751
|
if (changes.feeOptions && !changes.feeOptions.firstChange) {
|
|
5611
5752
|
// need for triggering of the custom validator
|
|
5612
5753
|
this.form.amount?.updateValueAndValidity();
|
|
5613
5754
|
}
|
|
5755
|
+
if (this.step === TerminalStep.Confirmation) {
|
|
5756
|
+
this.preparationStepFilled = true;
|
|
5757
|
+
}
|
|
5614
5758
|
}
|
|
5615
5759
|
ngAfterViewInit() {
|
|
5616
5760
|
this.form
|
|
@@ -5651,6 +5795,10 @@ class ConstructorFormComponent {
|
|
|
5651
5795
|
});
|
|
5652
5796
|
}
|
|
5653
5797
|
fetchForm() {
|
|
5798
|
+
if (!this.form.method.value) {
|
|
5799
|
+
this.form.ready = true;
|
|
5800
|
+
return;
|
|
5801
|
+
}
|
|
5654
5802
|
this.form.cancelRequests();
|
|
5655
5803
|
if (this.step !== this.TERMINAL_STEP.Prepare) {
|
|
5656
5804
|
return;
|
|
@@ -5660,14 +5808,16 @@ class ConstructorFormComponent {
|
|
|
5660
5808
|
this.form
|
|
5661
5809
|
.init()
|
|
5662
5810
|
.subscribe(() => {
|
|
5663
|
-
if (!this.form.hasWhatToFill()) {
|
|
5811
|
+
if (!this.preparationStepFilled && !this.form.hasWhatToFill()) {
|
|
5664
5812
|
this.send();
|
|
5665
5813
|
return;
|
|
5666
5814
|
}
|
|
5815
|
+
this.form.payment.updateValueAndValidity({ onlySelf: true });
|
|
5667
5816
|
this.cd.detectChanges();
|
|
5668
5817
|
this.scrollToRequisits();
|
|
5669
5818
|
this.form.maskedWallet = '';
|
|
5670
5819
|
}, (err) => {
|
|
5820
|
+
this.form.payment.updateValueAndValidity({ onlySelf: true });
|
|
5671
5821
|
this.cd.markForCheck();
|
|
5672
5822
|
});
|
|
5673
5823
|
}
|
|
@@ -5683,47 +5833,46 @@ class ConstructorFormComponent {
|
|
|
5683
5833
|
return typeof this.form.config?.description === 'function' ? this.form.config?.description(this.form.getRawValue()) : this.form.config?.description;
|
|
5684
5834
|
}
|
|
5685
5835
|
submit() {
|
|
5686
|
-
if (!this.check() && !this.loading) {
|
|
5687
|
-
return;
|
|
5688
|
-
}
|
|
5689
|
-
if (this.form.methodName === 'card' && !this.cardIframe?.finished) {
|
|
5690
|
-
this.form.continueLoaderOn();
|
|
5691
|
-
this.cd.detectChanges();
|
|
5692
|
-
this.cardIframe?.submit()
|
|
5693
|
-
.then(success => !success && this.form.continueLoaderOff());
|
|
5694
|
-
return;
|
|
5695
|
-
}
|
|
5696
|
-
this.send();
|
|
5697
|
-
}
|
|
5698
|
-
cardPaid() {
|
|
5699
|
-
if (!this.check()) {
|
|
5700
|
-
return;
|
|
5701
|
-
}
|
|
5702
|
-
this.send();
|
|
5703
|
-
}
|
|
5704
|
-
iframeError(code) {
|
|
5705
|
-
this.form.setCDEError(code);
|
|
5706
|
-
this.cd.detectChanges();
|
|
5707
|
-
}
|
|
5708
|
-
check() {
|
|
5709
5836
|
if (this.step === TerminalStep.Confirmation) {
|
|
5710
5837
|
this.confirm.emit();
|
|
5711
|
-
return
|
|
5838
|
+
return;
|
|
5712
5839
|
}
|
|
5713
|
-
if (this.form.config === null) {
|
|
5714
|
-
return
|
|
5840
|
+
if (this.form.config === null || !this.form.ready) {
|
|
5841
|
+
return;
|
|
5715
5842
|
}
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5843
|
+
this.triggerIframeSubmit();
|
|
5844
|
+
if (this.form.invalid || this.error) {
|
|
5845
|
+
Object.values(this.form.controls).forEach((control) => {
|
|
5846
|
+
control.markAsDirty();
|
|
5847
|
+
control.markAsTouched();
|
|
5848
|
+
});
|
|
5849
|
+
Object.values(this.form.payment.controls).forEach((control) => {
|
|
5719
5850
|
control.markAsDirty();
|
|
5720
5851
|
control.markAsTouched();
|
|
5721
5852
|
control.updateValueAndValidity({ emitEvent: false });
|
|
5722
5853
|
});
|
|
5723
5854
|
this.cd.detectChanges();
|
|
5724
|
-
return
|
|
5855
|
+
return;
|
|
5725
5856
|
}
|
|
5726
|
-
|
|
5857
|
+
if (this.form.pending) {
|
|
5858
|
+
this.form.statusChanges
|
|
5859
|
+
.pipe(first(), takeUntil(this.unSubscriber))
|
|
5860
|
+
.subscribe((status) => {
|
|
5861
|
+
if (status === 'VALID') {
|
|
5862
|
+
this.send();
|
|
5863
|
+
}
|
|
5864
|
+
});
|
|
5865
|
+
}
|
|
5866
|
+
else {
|
|
5867
|
+
this.send();
|
|
5868
|
+
}
|
|
5869
|
+
}
|
|
5870
|
+
triggerIframeSubmit() {
|
|
5871
|
+
if (!this.form.readyIframesSubmit) {
|
|
5872
|
+
return;
|
|
5873
|
+
}
|
|
5874
|
+
this.sdkList?.forEach((sdk) => sdk.submit());
|
|
5875
|
+
this.form.updateValueAndValidityIframes();
|
|
5727
5876
|
}
|
|
5728
5877
|
send() {
|
|
5729
5878
|
const data = this.form.getPaymentValue();
|
|
@@ -5754,15 +5903,15 @@ class ConstructorFormComponent {
|
|
|
5754
5903
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.2", type: ConstructorFormComponent, isStandalone: true, selector: "app-constructor-form", inputs: { step: "step", error: "error", response: "response", feeLoading: "feeLoading", feeOptions: "feeOptions", currency: "currency", userCurrency: "userCurrency", loading: "loading", types: "types", canReturnToProject: "canReturnToProject", tabIndex: "tabIndex" }, outputs: { amountChanged: "amountChanged", back: "back", prepare: "prepare", confirm: "confirm", onPaymentChanged: "onPaymentChanged" }, providers: [
|
|
5755
5904
|
ConstructorFormService,
|
|
5756
5905
|
CountryTranslatePipe, CountriesSortPipe
|
|
5757
|
-
], viewQueries: [{ propertyName: "requisites", first: true, predicate: ["paymentRequisites"], descendants: true }, { propertyName: "hintMethod", first: true, predicate: ["hintMethod"], descendants: true }, { propertyName: "cardIframe", first: true, predicate: ["cardIframe"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<form class=\"constructor\"\r\n [formGroup]=\"form\"\r\n (ngSubmit)=\"submit()\"\r\n >\r\n @if (loading !== null) {\r\n @if (step === TERMINAL_STEP.Prepare) {\r\n <div class=\"constructor__fields\">\r\n @if (countrySearchString || countriesList.length > 1) {\r\n <div class=\"constructor__field\">\r\n <app-trm-select [data]=\"countriesList\"\r\n name=\"country\"\r\n [label]=\"I18N_KEY.CONSTRUCTOR_LABEL_COUNTRY | trans\"\r\n formControlName=\"country\"\r\n class=\"c-field-select trm-form-field\"\r\n (search)=\"searchCountry($event)\"\r\n [tabIndex]=\"tabIndex\"\r\n >\r\n <ng-template trmSelectLabelTemplate let-item=\"item\">\r\n <span class=\"fi\"\r\n [ngClass]=\"'fi-' + item.toLowerCase()\"></span>\r\n <span class=\"method__name\">{{item | country_translate: lang}}</span>\r\n </ng-template>\r\n </app-trm-select>\r\n </div>\r\n }\r\n @if (form.country.value) {\r\n <app-ps-select [methods]=\"methodsList\"\r\n formControlName=\"method\"\r\n [tabIndex]=\"tabIndex\"\r\n >\r\n @if (form.config?.description) {\r\n <div class=\"constructor__hint text--warn\"\r\n app-ps-select-hint\r\n #hintMethod\r\n @insertRemove\r\n >\r\n {{description | trans }}\r\n </div>\r\n }\r\n @if (form.isCDEFailed) {\r\n <div class=\"constructor__hint cde-error\"\r\n app-ps-select-hint\r\n @insertRemove\r\n >\r\n {{form.getError('cde_error') | trans }}\r\n </div>\r\n }\r\n </app-ps-select>\r\n }\r\n @if (!form.methodInfoLoading) {\r\n @if (form.paymentFormFieldNames.length) {\r\n <div formGroupName=\"payment\"\r\n #paymentRequisites\r\n class=\"constructor__fields constructor__fields--reverse\">\r\n @if (form.amountDynamic) {\r\n <ng-container *ngTemplateOutlet=\"currencyTpl; context: {label: I18N_KEY.CONSTRUCTOR_LABEL_CURRENCY | trans, tabIndex: 0}\"></ng-container>\r\n }\r\n @for (field of form.fields; track field.name; let i = $index) {\r\n @if (field.type === CONSTRUCTOR_FIELD_TYPES.Iframe) {\r\n <app-constructor-field-iframe\r\n [hidden]=\"form.isCDEFailed\"\r\n (paid)=\"cardPaid()\"\r\n #cardIframe\r\n (error)=\"iframeError($event)\"\r\n [tabIndex]=\"form.fields.length - i + tabIndex\">\r\n </app-constructor-field-iframe>\r\n }\r\n @if (field.type === CONSTRUCTOR_FIELD_TYPES.Select) {\r\n <app-constructor-field-select\r\n [config]=\"field\"\r\n [items]=\"field?.options?.items\"\r\n [formControlName]=\"field.name\"\r\n [tabIndex]=\"form.fields.length - i + tabIndex\"\r\n ></app-constructor-field-select>\r\n }\r\n @if ([CONSTRUCTOR_FIELD_TYPES.Text, CONSTRUCTOR_FIELD_TYPES.Number, CONSTRUCTOR_FIELD_TYPES.Email].includes(field.type)) {\r\n <app-constructor-field-text\r\n [config]=\"field\"\r\n [formControlName]=\"field.name\"\r\n (maskedValueChange)=\"changeTextFieldValue($event, field)\"\r\n [tabIndex]=\"form.fields.length - i + tabIndex\"></app-constructor-field-text>\r\n }\r\n @if (field.type === CONSTRUCTOR_FIELD_TYPES.Amount) {\r\n <app-constructor-field-text\r\n [config]=\"field\"\r\n [formControlName]=\"field.name\"\r\n [tabIndex]=\"form.fields.length - i + tabIndex\">\r\n <app-method-amount-hint app-c-text-hint\r\n class=\"constructor__hint\"\r\n [loading]=\"feeLoading\"\r\n [options]=\"feeOptions || field.options\"\r\n ></app-method-amount-hint>\r\n <div app-c-text-suffix\r\n class=\"constructor__currency\"\r\n [class.constructor__currency--transparent]=\"form.isAmountEditable\"\r\n >\r\n <ng-container *ngTemplateOutlet=\"currencyTpl; context: {tabIndex: form.fields.length - i + tabIndex}\"></ng-container>\r\n </div>\r\n </app-constructor-field-text>\r\n @if (hasCurrencyMethodSelector) {\r\n <app-trm-select\r\n class=\"constructor-field\"\r\n [label]=\"I18N_KEY.CONSTRUCTOR_LABEL_CURRENCY | trans\"\r\n [formControl]=\"form.currency\"\r\n [searchable]=\"false\"\r\n [data]=\"currenciesList\"\r\n [tabIndex]=\"form.fields.length - i + tabIndex\"\r\n >\r\n <ng-template trmSelectLabelTemplate let-item=\"item\">\r\n <span class=\"trm-icon\" [ngClass]=\"'trm-curr-' + item.toLowerCase()\"\r\n [title]=\"item\"></span>\r\n {{item}}\r\n </ng-template>\r\n </app-trm-select>\r\n }\r\n }\r\n @if (field.type === CONSTRUCTOR_FIELD_TYPES.Date) {\r\n <app-constructor-field-date\r\n [config]=\"field\"\r\n [formControlName]=\"field.name\"\r\n [tabIndex]=\"form.fields.length - i + tabIndex\"></app-constructor-field-date>\r\n }\r\n }\r\n <ng-template #currencyTpl let-label=\"label\" let-tabIndex=\"tabIndex\">\r\n <app-trm-select\r\n [label]=\"label\"\r\n [formControl]=\"form.userCurrency\"\r\n [searchable]=\"false\"\r\n [data]=\"userCurrenciesList\"\r\n [tabIndex]=\"tabIndex\"\r\n >\r\n <ng-template trmSelectLabelTemplate let-item=\"item\">\r\n <span class=\"trm-icon\"\r\n [ngClass]=\"'trm-curr-' + item.toLowerCase()\"\r\n [title]=\"item\"></span>\r\n {{item}}\r\n </ng-template>\r\n </app-trm-select>\r\n </ng-template>\r\n </div>\r\n }\r\n } @else {\r\n <div class=\"trm-skeleton-fields\">\r\n @for (i of skeletonLength; track $index) {\r\n <div class=\"trm-skeleton-field\">\r\n <gm-skeleton [count]=\"1\" [shape]=\"'rect-md'\" [size]=\"18\"></gm-skeleton>\r\n <gm-skeleton [count]=\"1\" [size]=\"50\"></gm-skeleton>\r\n </div>\r\n }\r\n </div>\r\n }\r\n @if (error && !form.methodInfoLoading) {\r\n <div class=\"trm-error\"\r\n @insertRemove\r\n >\r\n {{ error | trans }}\r\n </div>\r\n }\r\n </div>\r\n }\r\n @if (step === TERMINAL_STEP.Confirmation) {\r\n <app-constructor-preparation\r\n [currency]=\"response?.currency\"\r\n [methodName]=\"form.getTypeNameById(response.typeId)\"\r\n [wallet]=\"response.wallet\"\r\n [maskedWallet]=\"maskedWallet\"\r\n [amount]=\"response.amount\"\r\n [total]=\"response.total\"\r\n [confirmationText]=\"form.config?.confirmation\"\r\n >\r\n @if (error && !form.payment.pending) {\r\n <div class=\"trm-error\"\r\n app-constructor-preparation-error\r\n @insertRemove\r\n >\r\n {{ error | trans }}\r\n </div>\r\n }\r\n </app-constructor-preparation>\r\n }\r\n <div class=\"constructor__actions\">\r\n <button class=\"trm-button trm-button--primary constructor__actions-continue\"\r\n type=\"submit\"\r\n [tabindex]=\"form.fields.length + tabIndex\">\r\n {{I18N_KEY.CONSTRUCTOR_LABEL_CONTINUE | trans}}\r\n @if (loading) {\r\n <span class=\"trm-spinner trm-spinner-white\"></span>\r\n }\r\n </button>\r\n <button class=\"trm-button trm-button--secondary constructor__actions-back\"\r\n type=\"button\"\r\n [tabindex]=\"form.fields.length + tabIndex\"\r\n (click)=\"back.emit()\"> {{ backBtnLabel | trans}}</button>\r\n </div>\r\n } @else {\r\n <div class=\"trm-skeleton-group\">\r\n <gm-skeleton [count]=\"4\" [gap]=\"20\" [size]=\"80\"></gm-skeleton>\r\n <gm-skeleton [count]=\"2\" [gap]=\"10\" [size]=\"48\"></gm-skeleton>\r\n </div>\r\n }\r\n</form>\r\n", styles: [":host{display:block}.constructor{display:flex;flex-direction:column;gap:32px;justify-content:flex-start;align-items:stretch}.constructor__fields{display:flex;flex-direction:column;gap:20px;justify-content:flex-start;align-items:stretch}.constructor__fields--reverse{flex-direction:column-reverse}.constructor__fields .fi{border-radius:2px;overflow:hidden;border:1px solid rgba(0,0,0,.08);box-sizing:border-box;background-origin:border-box;flex-shrink:0;height:15px}.constructor__fields .fi-other{border-color:transparent}.constructor__currency{--trm-select-border-radius: 0 10px 10px 0;display:flex;align-items:center;position:absolute;bottom:0;right:0;flex-shrink:0;min-height:46px}@media (min-width: 768px){.constructor__currency{min-height:50px}}.constructor__currency .trm-divider{margin:5px 0;align-self:stretch}.constructor__currency--transparent{--trm-select-bg-color: transparent;--trm-select-bg-color--disabled: transparent;--trm-select-border-color: transparent;--trm-select-border-color--hover: transparent;--trm-select-border-color--focus: transparent}.constructor__actions{display:flex;flex-direction:column;gap:10px;justify-content:flex-start;align-items:flex-start}.constructor__hint{font-weight:400;font-size:14px;line-height:22px;color:var(--color-base-350);margin-top:8px}.constructor__hint.cde-error{font-weight:500;font-size:14px;line-height:20px;color:var(--color-red-500)}.constructor .constructor__actions-continue{position:relative}.constructor .constructor__actions-continue .trm-spinner{position:absolute;right:15px}\n"], dependencies: [{ kind: "pipe", type: CountryTranslatePipe, name: "country_translate" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "component", type: TrmSelectComponent, selector: "app-trm-select", inputs: ["label", "hasBorder", "data", "tabIndex", "name", "placeholder", "searchable", "hasScrollbar", "nameId", "nameLabel"], outputs: ["open", "search"] }, { kind: "directive", type: TrmSelectLabelTemplateDirective, selector: "[trmSelectLabelTemplate]" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: PsSelectComponent, selector: "app-ps-select", inputs: ["methods", "tabIndex"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ConstructorFieldIframeComponent, selector: "app-constructor-field-iframe", inputs: ["tabIndex"], outputs: ["error", "paid", "ready"] }, { kind: "component", type: ConstructorFieldSelectComponent, selector: "app-constructor-field-select", inputs: ["config", "items", "tabIndex"] }, { kind: "component", type: ConstructorFieldTextComponent, selector: "app-constructor-field-text", inputs: ["config", "matDatepicker", "tabIndex"], outputs: ["maskedValueChange"] }, { kind: "component", type: MethodAmountHintComponent, selector: "app-method-amount-hint", inputs: ["loading", "options"] }, { kind: "component", type: ConstructorFieldDateComponent, selector: "app-constructor-field-date", inputs: ["config", "tabIndex"] }, { kind: "component", type: ConstructorPreparationComponent, selector: "app-constructor-preparation", inputs: ["maskedWallet", "wallet", "confirmationText", "methodName", "currency", "amount", "total"] }, { kind: "directive", type: TabIndexFocusDirective, selector: "[tabindex]" }, { kind: "pipe", type: TranslateByKeyPipe, name: "trans" }, { kind: "component", type: GmSkeletonComponent, selector: "gm-skeleton", inputs: ["shape", "orientation", "count", "size", "gap"] }], animations: [insertRemoveTrigger], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5906
|
+
], viewQueries: [{ propertyName: "requisites", first: true, predicate: ["paymentRequisites"], descendants: true }, { propertyName: "hintMethod", first: true, predicate: ["hintMethod"], descendants: true }, { propertyName: "sdkList", predicate: CardSdkService, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<form class=\"constructor\"\r\n [formGroup]=\"form\"\r\n (ngSubmit)=\"submit()\"\r\n >\r\n @if (!loading) {\r\n @if (step === TERMINAL_STEP.Prepare) {\r\n <div class=\"constructor__fields\">\r\n @if (countrySearchString || countriesList.length > 1) {\r\n <div class=\"constructor__field\">\r\n <app-trm-select [data]=\"countriesList\"\r\n @insertRemove\r\n name=\"country\"\r\n [label]=\"I18N_KEY.CONSTRUCTOR_LABEL_COUNTRY | trans\"\r\n formControlName=\"country\"\r\n class=\"c-field-select trm-form-field\"\r\n (search)=\"searchCountry($event)\"\r\n [tabIndex]=\"tabIndex\"\r\n >\r\n <ng-template trmSelectLabelTemplate let-item=\"item\">\r\n <span class=\"fi\"\r\n [ngClass]=\"'fi-' + item.toLowerCase()\"></span>\r\n <span class=\"method__name\">{{item | country_translate: lang}}</span>\r\n </ng-template>\r\n </app-trm-select>\r\n </div>\r\n }\r\n @if (form.country.value) {\r\n <app-ps-select [methods]=\"methodsList\"\r\n @insertRemove\r\n formControlName=\"method\"\r\n [tabIndex]=\"tabIndex\"\r\n >\r\n @if (form.config?.description) {\r\n <div class=\"constructor__hint text--warn\"\r\n app-ps-select-hint\r\n #hintMethod\r\n @insertRemove\r\n >\r\n {{description | trans }}\r\n </div>\r\n }\r\n </app-ps-select>\r\n\r\n @if (\r\n form.method?.hasError('required') &&\r\n form.method.touched &&\r\n form.method.dirty\r\n ) {\r\n <div class=\"gm-error\" @insertRemove>\r\n {{ I18N_KEY.VALIDATION_REQUIRED | trans }}\r\n </div>\r\n }\r\n }\r\n\r\n @if (form.ready) {\r\n <div formGroupName=\"payment\"\r\n @insertRemove\r\n #paymentRequisites\r\n class=\"constructor__fields constructor__fields--reverse\">\r\n @if (form.method.value && form.amountDynamic) {\r\n <ng-container *ngTemplateOutlet=\"currencyTpl; context: {label: I18N_KEY.CONSTRUCTOR_LABEL_CURRENCY | trans, tabIndex: 0}\"></ng-container>\r\n }\r\n @for (field of form.fields; track field.name; let i = $index) {\r\n @if (field.type === CONSTRUCTOR_FIELD_TYPES.Iframe) {\r\n @if (form.payment.get(field.name)?.hasError('cde_error')) {\r\n <div class=\"constructor__hint cde-error\" @insertRemove>\r\n {{\r\n form.payment.get(field.name).getError('cde_error')\r\n | trans\r\n }}\r\n </div>\r\n }\r\n <app-constructor-field-iframe\r\n [formControlName]=\"field.name\"\r\n @insertRemove\r\n [hidden]=\"\r\n form.payment.get(field.name)?.hasError('cde_error')\r\n \"\r\n [tabIndex]=\"form.fields.length - i + tabIndex\"\r\n >\r\n </app-constructor-field-iframe>\r\n }\r\n @if (field.type === CONSTRUCTOR_FIELD_TYPES.Select) {\r\n <app-constructor-field-select\r\n @insertRemove\r\n [config]=\"field\"\r\n [items]=\"field?.options?.items\"\r\n [formControlName]=\"field.name\"\r\n [tabIndex]=\"form.fields.length - i + tabIndex\"\r\n ></app-constructor-field-select>\r\n }\r\n @if ([CONSTRUCTOR_FIELD_TYPES.Text, CONSTRUCTOR_FIELD_TYPES.Number, CONSTRUCTOR_FIELD_TYPES.Email].includes(field.type)) {\r\n <app-constructor-field-text\r\n @insertRemove\r\n [config]=\"field\"\r\n [formControlName]=\"field.name\"\r\n (maskedValueChange)=\"changeTextFieldValue($event, field)\"\r\n [tabIndex]=\"form.fields.length - i + tabIndex\"></app-constructor-field-text>\r\n }\r\n @if (field.type === CONSTRUCTOR_FIELD_TYPES.Amount) {\r\n <app-constructor-field-text\r\n @insertRemove\r\n [config]=\"field\"\r\n [formControlName]=\"field.name\"\r\n [tabIndex]=\"form.fields.length - i + tabIndex\">\r\n <app-method-amount-hint app-c-text-hint\r\n class=\"constructor__hint\"\r\n [loading]=\"feeLoading\"\r\n [options]=\"feeOptions || field.options\"\r\n ></app-method-amount-hint>\r\n <div app-c-text-suffix\r\n class=\"constructor__currency\"\r\n [class.constructor__currency--transparent]=\"form.isAmountEditable\"\r\n >\r\n <ng-container *ngTemplateOutlet=\"currencyTpl; context: {tabIndex: form.fields.length - i + tabIndex}\"></ng-container>\r\n </div>\r\n </app-constructor-field-text>\r\n @if (hasCurrencyMethodSelector) {\r\n <app-trm-select\r\n @insertRemove\r\n class=\"constructor-field\"\r\n [label]=\"I18N_KEY.CONSTRUCTOR_LABEL_CURRENCY | trans\"\r\n [formControl]=\"form.currency\"\r\n [searchable]=\"false\"\r\n [data]=\"currenciesList\"\r\n [tabIndex]=\"form.fields.length - i + tabIndex\"\r\n >\r\n <ng-template trmSelectLabelTemplate let-item=\"item\">\r\n <span class=\"trm-icon\" [ngClass]=\"'trm-curr-' + item.toLowerCase()\"\r\n [title]=\"item\"></span>\r\n {{item}}\r\n </ng-template>\r\n </app-trm-select>\r\n }\r\n }\r\n @if (field.type === CONSTRUCTOR_FIELD_TYPES.Date) {\r\n <app-constructor-field-date\r\n @insertRemove\r\n [config]=\"field\"\r\n [formControlName]=\"field.name\"\r\n [tabIndex]=\"form.fields.length - i + tabIndex\"></app-constructor-field-date>\r\n }\r\n }\r\n <ng-template #currencyTpl let-label=\"label\" let-tabIndex=\"tabIndex\">\r\n <app-trm-select\r\n @insertRemove\r\n [label]=\"label\"\r\n [formControl]=\"form.userCurrency\"\r\n [searchable]=\"false\"\r\n [data]=\"userCurrenciesList\"\r\n [tabIndex]=\"tabIndex\"\r\n >\r\n <ng-template trmSelectLabelTemplate let-item=\"item\">\r\n <span class=\"trm-icon\"\r\n [ngClass]=\"'trm-curr-' + item.toLowerCase()\"\r\n [title]=\"item\"></span>\r\n {{item}}\r\n </ng-template>\r\n </app-trm-select>\r\n </ng-template>\r\n </div>\r\n } @else {\r\n <div class=\"trm-skeleton-fields\">\r\n @for (i of skeletonLength; track $index) {\r\n <div class=\"trm-skeleton-field\">\r\n <gm-skeleton [count]=\"1\" [shape]=\"'rect-md'\" [size]=\"18\"></gm-skeleton>\r\n <gm-skeleton [count]=\"1\" [size]=\"50\"></gm-skeleton>\r\n </div>\r\n }\r\n </div>\r\n }\r\n @if (error && !form.methodInfoLoading) {\r\n <div class=\"trm-error\"\r\n @insertRemove\r\n >\r\n {{ error | trans }}\r\n </div>\r\n }\r\n </div>\r\n }\r\n @if (step === TERMINAL_STEP.Confirmation) {\r\n <app-constructor-preparation\r\n @insertRemove\r\n [currency]=\"response?.currency\"\r\n [methodName]=\"form.getTypeNameById(response.typeId)\"\r\n [wallet]=\"response.wallet\"\r\n [maskedWallet]=\"maskedWallet\"\r\n [amount]=\"response.amount\"\r\n [total]=\"response.total\"\r\n [confirmationText]=\"form.config?.confirmation\"\r\n >\r\n @if (error && !form.payment.pending) {\r\n <div class=\"trm-error\"\r\n app-constructor-preparation-error\r\n @insertRemove\r\n >\r\n {{ error | trans }}\r\n </div>\r\n }\r\n </app-constructor-preparation>\r\n }\r\n <div class=\"constructor__actions\"\r\n @insertRemove>\r\n <button class=\"trm-button trm-button--primary constructor__actions-continue\"\r\n type=\"submit\"\r\n [tabindex]=\"form.fields.length + tabIndex\">\r\n {{I18N_KEY.CONSTRUCTOR_LABEL_CONTINUE | trans}}\r\n @if (loading) {\r\n <span class=\"trm-spinner trm-spinner-white\"></span>\r\n }\r\n </button>\r\n <button class=\"trm-button trm-button--secondary constructor__actions-back\"\r\n type=\"button\"\r\n [tabindex]=\"form.fields.length + tabIndex\"\r\n (click)=\"back.emit()\"> {{ backBtnLabel | trans}}</button>\r\n </div>\r\n } @else {\r\n <div class=\"trm-skeleton-group\">\r\n <gm-skeleton [count]=\"4\" [gap]=\"20\" [size]=\"80\"></gm-skeleton>\r\n <gm-skeleton [count]=\"2\" [gap]=\"10\" [size]=\"48\"></gm-skeleton>\r\n </div>\r\n }\r\n</form>\r\n", styles: [":host{display:block}.constructor{display:flex;flex-direction:column;gap:32px;justify-content:flex-start;align-items:stretch}.constructor__fields{display:flex;flex-direction:column;gap:20px;justify-content:flex-start;align-items:stretch}.constructor__fields--reverse{flex-direction:column-reverse}.constructor__fields .fi{border-radius:2px;overflow:hidden;border:1px solid rgba(0,0,0,.08);box-sizing:border-box;background-origin:border-box;flex-shrink:0;height:15px}.constructor__fields .fi-other{border-color:transparent}.constructor__currency{--trm-select-border-radius: 0 10px 10px 0;display:flex;align-items:center;position:absolute;bottom:0;right:0;flex-shrink:0;min-height:46px}@media (min-width: 768px){.constructor__currency{min-height:50px}}.constructor__currency .trm-divider{margin:5px 0;align-self:stretch}.constructor__currency--transparent{--trm-select-bg-color: transparent;--trm-select-bg-color--disabled: transparent;--trm-select-border-color: transparent;--trm-select-border-color--hover: transparent;--trm-select-border-color--focus: transparent}.constructor__actions{display:flex;flex-direction:column;gap:10px;justify-content:flex-start;align-items:flex-start}.constructor__hint{font-weight:400;font-size:14px;line-height:22px;color:var(--color-base-350);margin-top:8px}.constructor__hint.cde-error{font-weight:500;font-size:14px;line-height:20px;color:var(--color-red-500)}.constructor .constructor__actions-continue{position:relative}.constructor .constructor__actions-continue .trm-spinner{position:absolute;right:15px}\n"], dependencies: [{ kind: "pipe", type: CountryTranslatePipe, name: "country_translate" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "component", type: TrmSelectComponent, selector: "app-trm-select", inputs: ["label", "hasBorder", "data", "tabIndex", "name", "placeholder", "searchable", "hasScrollbar", "nameId", "nameLabel"], outputs: ["open", "search"] }, { kind: "directive", type: TrmSelectLabelTemplateDirective, selector: "[trmSelectLabelTemplate]" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: PsSelectComponent, selector: "app-ps-select", inputs: ["methods", "tabIndex"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ConstructorFieldIframeComponent, selector: "app-constructor-field-iframe", inputs: ["tabIndex"] }, { kind: "component", type: ConstructorFieldSelectComponent, selector: "app-constructor-field-select", inputs: ["config", "items", "tabIndex"] }, { kind: "component", type: ConstructorFieldTextComponent, selector: "app-constructor-field-text", inputs: ["config", "matDatepicker", "tabIndex"], outputs: ["maskedValueChange"] }, { kind: "component", type: MethodAmountHintComponent, selector: "app-method-amount-hint", inputs: ["loading", "options"] }, { kind: "component", type: ConstructorFieldDateComponent, selector: "app-constructor-field-date", inputs: ["config", "tabIndex"] }, { kind: "component", type: ConstructorPreparationComponent, selector: "app-constructor-preparation", inputs: ["maskedWallet", "wallet", "confirmationText", "methodName", "currency", "amount", "total"] }, { kind: "directive", type: TabIndexFocusDirective, selector: "[tabindex]" }, { kind: "pipe", type: TranslateByKeyPipe, name: "trans" }, { kind: "component", type: GmSkeletonComponent, selector: "gm-skeleton", inputs: ["shape", "orientation", "count", "size", "gap"] }], animations: [insertRemoveTrigger], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5758
5907
|
}
|
|
5759
5908
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: ConstructorFormComponent, decorators: [{
|
|
5760
5909
|
type: Component,
|
|
5761
5910
|
args: [{ selector: 'app-constructor-form', changeDetection: ChangeDetectionStrategy.OnPush, animations: [insertRemoveTrigger], providers: [
|
|
5762
5911
|
ConstructorFormService,
|
|
5763
5912
|
CountryTranslatePipe, CountriesSortPipe
|
|
5764
|
-
], standalone: true, imports: [CountryTranslatePipe, CountriesSortPipe, FormsModule, ReactiveFormsModule, TrmSelectComponent, TrmSelectLabelTemplateDirective, NgClass, PsSelectComponent, NgTemplateOutlet, ConstructorFieldIframeComponent, ConstructorFieldSelectComponent, ConstructorFieldTextComponent, MethodAmountHintComponent, ConstructorFieldDateComponent, ConstructorPreparationComponent, TabIndexFocusDirective, CountryTranslatePipe, TranslateByKeyPipe, GmSkeletonComponent], template: "<form class=\"constructor\"\r\n [formGroup]=\"form\"\r\n (ngSubmit)=\"submit()\"\r\n >\r\n @if (loading !== null) {\r\n @if (step === TERMINAL_STEP.Prepare) {\r\n <div class=\"constructor__fields\">\r\n @if (countrySearchString || countriesList.length > 1) {\r\n <div class=\"constructor__field\">\r\n <app-trm-select [data]=\"countriesList\"\r\n name=\"country\"\r\n [label]=\"I18N_KEY.CONSTRUCTOR_LABEL_COUNTRY | trans\"\r\n formControlName=\"country\"\r\n class=\"c-field-select trm-form-field\"\r\n (search)=\"searchCountry($event)\"\r\n [tabIndex]=\"tabIndex\"\r\n >\r\n <ng-template trmSelectLabelTemplate let-item=\"item\">\r\n <span class=\"fi\"\r\n [ngClass]=\"'fi-' + item.toLowerCase()\"></span>\r\n <span class=\"method__name\">{{item | country_translate: lang}}</span>\r\n </ng-template>\r\n </app-trm-select>\r\n </div>\r\n }\r\n @if (form.country.value) {\r\n <app-ps-select [methods]=\"methodsList\"\r\n formControlName=\"method\"\r\n [tabIndex]=\"tabIndex\"\r\n >\r\n @if (form.config?.description) {\r\n <div class=\"constructor__hint text--warn\"\r\n app-ps-select-hint\r\n #hintMethod\r\n @insertRemove\r\n >\r\n {{description | trans }}\r\n </div>\r\n }\r\n @if (form.isCDEFailed) {\r\n <div class=\"constructor__hint cde-error\"\r\n app-ps-select-hint\r\n @insertRemove\r\n >\r\n {{form.getError('cde_error') | trans }}\r\n </div>\r\n }\r\n </app-ps-select>\r\n }\r\n @if (!form.methodInfoLoading) {\r\n @if (form.paymentFormFieldNames.length) {\r\n <div formGroupName=\"payment\"\r\n #paymentRequisites\r\n class=\"constructor__fields constructor__fields--reverse\">\r\n @if (form.amountDynamic) {\r\n <ng-container *ngTemplateOutlet=\"currencyTpl; context: {label: I18N_KEY.CONSTRUCTOR_LABEL_CURRENCY | trans, tabIndex: 0}\"></ng-container>\r\n }\r\n @for (field of form.fields; track field.name; let i = $index) {\r\n @if (field.type === CONSTRUCTOR_FIELD_TYPES.Iframe) {\r\n <app-constructor-field-iframe\r\n [hidden]=\"form.isCDEFailed\"\r\n (paid)=\"cardPaid()\"\r\n #cardIframe\r\n (error)=\"iframeError($event)\"\r\n [tabIndex]=\"form.fields.length - i + tabIndex\">\r\n </app-constructor-field-iframe>\r\n }\r\n @if (field.type === CONSTRUCTOR_FIELD_TYPES.Select) {\r\n <app-constructor-field-select\r\n [config]=\"field\"\r\n [items]=\"field?.options?.items\"\r\n [formControlName]=\"field.name\"\r\n [tabIndex]=\"form.fields.length - i + tabIndex\"\r\n ></app-constructor-field-select>\r\n }\r\n @if ([CONSTRUCTOR_FIELD_TYPES.Text, CONSTRUCTOR_FIELD_TYPES.Number, CONSTRUCTOR_FIELD_TYPES.Email].includes(field.type)) {\r\n <app-constructor-field-text\r\n [config]=\"field\"\r\n [formControlName]=\"field.name\"\r\n (maskedValueChange)=\"changeTextFieldValue($event, field)\"\r\n [tabIndex]=\"form.fields.length - i + tabIndex\"></app-constructor-field-text>\r\n }\r\n @if (field.type === CONSTRUCTOR_FIELD_TYPES.Amount) {\r\n <app-constructor-field-text\r\n [config]=\"field\"\r\n [formControlName]=\"field.name\"\r\n [tabIndex]=\"form.fields.length - i + tabIndex\">\r\n <app-method-amount-hint app-c-text-hint\r\n class=\"constructor__hint\"\r\n [loading]=\"feeLoading\"\r\n [options]=\"feeOptions || field.options\"\r\n ></app-method-amount-hint>\r\n <div app-c-text-suffix\r\n class=\"constructor__currency\"\r\n [class.constructor__currency--transparent]=\"form.isAmountEditable\"\r\n >\r\n <ng-container *ngTemplateOutlet=\"currencyTpl; context: {tabIndex: form.fields.length - i + tabIndex}\"></ng-container>\r\n </div>\r\n </app-constructor-field-text>\r\n @if (hasCurrencyMethodSelector) {\r\n <app-trm-select\r\n class=\"constructor-field\"\r\n [label]=\"I18N_KEY.CONSTRUCTOR_LABEL_CURRENCY | trans\"\r\n [formControl]=\"form.currency\"\r\n [searchable]=\"false\"\r\n [data]=\"currenciesList\"\r\n [tabIndex]=\"form.fields.length - i + tabIndex\"\r\n >\r\n <ng-template trmSelectLabelTemplate let-item=\"item\">\r\n <span class=\"trm-icon\" [ngClass]=\"'trm-curr-' + item.toLowerCase()\"\r\n [title]=\"item\"></span>\r\n {{item}}\r\n </ng-template>\r\n </app-trm-select>\r\n }\r\n }\r\n @if (field.type === CONSTRUCTOR_FIELD_TYPES.Date) {\r\n <app-constructor-field-date\r\n [config]=\"field\"\r\n [formControlName]=\"field.name\"\r\n [tabIndex]=\"form.fields.length - i + tabIndex\"></app-constructor-field-date>\r\n }\r\n }\r\n <ng-template #currencyTpl let-label=\"label\" let-tabIndex=\"tabIndex\">\r\n <app-trm-select\r\n [label]=\"label\"\r\n [formControl]=\"form.userCurrency\"\r\n [searchable]=\"false\"\r\n [data]=\"userCurrenciesList\"\r\n [tabIndex]=\"tabIndex\"\r\n >\r\n <ng-template trmSelectLabelTemplate let-item=\"item\">\r\n <span class=\"trm-icon\"\r\n [ngClass]=\"'trm-curr-' + item.toLowerCase()\"\r\n [title]=\"item\"></span>\r\n {{item}}\r\n </ng-template>\r\n </app-trm-select>\r\n </ng-template>\r\n </div>\r\n }\r\n } @else {\r\n <div class=\"trm-skeleton-fields\">\r\n @for (i of skeletonLength; track $index) {\r\n <div class=\"trm-skeleton-field\">\r\n <gm-skeleton [count]=\"1\" [shape]=\"'rect-md'\" [size]=\"18\"></gm-skeleton>\r\n <gm-skeleton [count]=\"1\" [size]=\"50\"></gm-skeleton>\r\n </div>\r\n }\r\n </div>\r\n }\r\n @if (error && !form.methodInfoLoading) {\r\n <div class=\"trm-error\"\r\n @insertRemove\r\n >\r\n {{ error | trans }}\r\n </div>\r\n }\r\n </div>\r\n }\r\n @if (step === TERMINAL_STEP.Confirmation) {\r\n <app-constructor-preparation\r\n [currency]=\"response?.currency\"\r\n [methodName]=\"form.getTypeNameById(response.typeId)\"\r\n [wallet]=\"response.wallet\"\r\n [maskedWallet]=\"maskedWallet\"\r\n [amount]=\"response.amount\"\r\n [total]=\"response.total\"\r\n [confirmationText]=\"form.config?.confirmation\"\r\n >\r\n @if (error && !form.payment.pending) {\r\n <div class=\"trm-error\"\r\n app-constructor-preparation-error\r\n @insertRemove\r\n >\r\n {{ error | trans }}\r\n </div>\r\n }\r\n </app-constructor-preparation>\r\n }\r\n <div class=\"constructor__actions\">\r\n <button class=\"trm-button trm-button--primary constructor__actions-continue\"\r\n type=\"submit\"\r\n [tabindex]=\"form.fields.length + tabIndex\">\r\n {{I18N_KEY.CONSTRUCTOR_LABEL_CONTINUE | trans}}\r\n @if (loading) {\r\n <span class=\"trm-spinner trm-spinner-white\"></span>\r\n }\r\n </button>\r\n <button class=\"trm-button trm-button--secondary constructor__actions-back\"\r\n type=\"button\"\r\n [tabindex]=\"form.fields.length + tabIndex\"\r\n (click)=\"back.emit()\"> {{ backBtnLabel | trans}}</button>\r\n </div>\r\n } @else {\r\n <div class=\"trm-skeleton-group\">\r\n <gm-skeleton [count]=\"4\" [gap]=\"20\" [size]=\"80\"></gm-skeleton>\r\n <gm-skeleton [count]=\"2\" [gap]=\"10\" [size]=\"48\"></gm-skeleton>\r\n </div>\r\n }\r\n</form>\r\n", styles: [":host{display:block}.constructor{display:flex;flex-direction:column;gap:32px;justify-content:flex-start;align-items:stretch}.constructor__fields{display:flex;flex-direction:column;gap:20px;justify-content:flex-start;align-items:stretch}.constructor__fields--reverse{flex-direction:column-reverse}.constructor__fields .fi{border-radius:2px;overflow:hidden;border:1px solid rgba(0,0,0,.08);box-sizing:border-box;background-origin:border-box;flex-shrink:0;height:15px}.constructor__fields .fi-other{border-color:transparent}.constructor__currency{--trm-select-border-radius: 0 10px 10px 0;display:flex;align-items:center;position:absolute;bottom:0;right:0;flex-shrink:0;min-height:46px}@media (min-width: 768px){.constructor__currency{min-height:50px}}.constructor__currency .trm-divider{margin:5px 0;align-self:stretch}.constructor__currency--transparent{--trm-select-bg-color: transparent;--trm-select-bg-color--disabled: transparent;--trm-select-border-color: transparent;--trm-select-border-color--hover: transparent;--trm-select-border-color--focus: transparent}.constructor__actions{display:flex;flex-direction:column;gap:10px;justify-content:flex-start;align-items:flex-start}.constructor__hint{font-weight:400;font-size:14px;line-height:22px;color:var(--color-base-350);margin-top:8px}.constructor__hint.cde-error{font-weight:500;font-size:14px;line-height:20px;color:var(--color-red-500)}.constructor .constructor__actions-continue{position:relative}.constructor .constructor__actions-continue .trm-spinner{position:absolute;right:15px}\n"] }]
|
|
5765
|
-
}],
|
|
5913
|
+
], standalone: true, imports: [CountryTranslatePipe, CountriesSortPipe, FormsModule, ReactiveFormsModule, TrmSelectComponent, TrmSelectLabelTemplateDirective, NgClass, PsSelectComponent, NgTemplateOutlet, ConstructorFieldIframeComponent, ConstructorFieldSelectComponent, ConstructorFieldTextComponent, MethodAmountHintComponent, ConstructorFieldDateComponent, ConstructorPreparationComponent, TabIndexFocusDirective, CountryTranslatePipe, TranslateByKeyPipe, GmSkeletonComponent], template: "<form class=\"constructor\"\r\n [formGroup]=\"form\"\r\n (ngSubmit)=\"submit()\"\r\n >\r\n @if (!loading) {\r\n @if (step === TERMINAL_STEP.Prepare) {\r\n <div class=\"constructor__fields\">\r\n @if (countrySearchString || countriesList.length > 1) {\r\n <div class=\"constructor__field\">\r\n <app-trm-select [data]=\"countriesList\"\r\n @insertRemove\r\n name=\"country\"\r\n [label]=\"I18N_KEY.CONSTRUCTOR_LABEL_COUNTRY | trans\"\r\n formControlName=\"country\"\r\n class=\"c-field-select trm-form-field\"\r\n (search)=\"searchCountry($event)\"\r\n [tabIndex]=\"tabIndex\"\r\n >\r\n <ng-template trmSelectLabelTemplate let-item=\"item\">\r\n <span class=\"fi\"\r\n [ngClass]=\"'fi-' + item.toLowerCase()\"></span>\r\n <span class=\"method__name\">{{item | country_translate: lang}}</span>\r\n </ng-template>\r\n </app-trm-select>\r\n </div>\r\n }\r\n @if (form.country.value) {\r\n <app-ps-select [methods]=\"methodsList\"\r\n @insertRemove\r\n formControlName=\"method\"\r\n [tabIndex]=\"tabIndex\"\r\n >\r\n @if (form.config?.description) {\r\n <div class=\"constructor__hint text--warn\"\r\n app-ps-select-hint\r\n #hintMethod\r\n @insertRemove\r\n >\r\n {{description | trans }}\r\n </div>\r\n }\r\n </app-ps-select>\r\n\r\n @if (\r\n form.method?.hasError('required') &&\r\n form.method.touched &&\r\n form.method.dirty\r\n ) {\r\n <div class=\"gm-error\" @insertRemove>\r\n {{ I18N_KEY.VALIDATION_REQUIRED | trans }}\r\n </div>\r\n }\r\n }\r\n\r\n @if (form.ready) {\r\n <div formGroupName=\"payment\"\r\n @insertRemove\r\n #paymentRequisites\r\n class=\"constructor__fields constructor__fields--reverse\">\r\n @if (form.method.value && form.amountDynamic) {\r\n <ng-container *ngTemplateOutlet=\"currencyTpl; context: {label: I18N_KEY.CONSTRUCTOR_LABEL_CURRENCY | trans, tabIndex: 0}\"></ng-container>\r\n }\r\n @for (field of form.fields; track field.name; let i = $index) {\r\n @if (field.type === CONSTRUCTOR_FIELD_TYPES.Iframe) {\r\n @if (form.payment.get(field.name)?.hasError('cde_error')) {\r\n <div class=\"constructor__hint cde-error\" @insertRemove>\r\n {{\r\n form.payment.get(field.name).getError('cde_error')\r\n | trans\r\n }}\r\n </div>\r\n }\r\n <app-constructor-field-iframe\r\n [formControlName]=\"field.name\"\r\n @insertRemove\r\n [hidden]=\"\r\n form.payment.get(field.name)?.hasError('cde_error')\r\n \"\r\n [tabIndex]=\"form.fields.length - i + tabIndex\"\r\n >\r\n </app-constructor-field-iframe>\r\n }\r\n @if (field.type === CONSTRUCTOR_FIELD_TYPES.Select) {\r\n <app-constructor-field-select\r\n @insertRemove\r\n [config]=\"field\"\r\n [items]=\"field?.options?.items\"\r\n [formControlName]=\"field.name\"\r\n [tabIndex]=\"form.fields.length - i + tabIndex\"\r\n ></app-constructor-field-select>\r\n }\r\n @if ([CONSTRUCTOR_FIELD_TYPES.Text, CONSTRUCTOR_FIELD_TYPES.Number, CONSTRUCTOR_FIELD_TYPES.Email].includes(field.type)) {\r\n <app-constructor-field-text\r\n @insertRemove\r\n [config]=\"field\"\r\n [formControlName]=\"field.name\"\r\n (maskedValueChange)=\"changeTextFieldValue($event, field)\"\r\n [tabIndex]=\"form.fields.length - i + tabIndex\"></app-constructor-field-text>\r\n }\r\n @if (field.type === CONSTRUCTOR_FIELD_TYPES.Amount) {\r\n <app-constructor-field-text\r\n @insertRemove\r\n [config]=\"field\"\r\n [formControlName]=\"field.name\"\r\n [tabIndex]=\"form.fields.length - i + tabIndex\">\r\n <app-method-amount-hint app-c-text-hint\r\n class=\"constructor__hint\"\r\n [loading]=\"feeLoading\"\r\n [options]=\"feeOptions || field.options\"\r\n ></app-method-amount-hint>\r\n <div app-c-text-suffix\r\n class=\"constructor__currency\"\r\n [class.constructor__currency--transparent]=\"form.isAmountEditable\"\r\n >\r\n <ng-container *ngTemplateOutlet=\"currencyTpl; context: {tabIndex: form.fields.length - i + tabIndex}\"></ng-container>\r\n </div>\r\n </app-constructor-field-text>\r\n @if (hasCurrencyMethodSelector) {\r\n <app-trm-select\r\n @insertRemove\r\n class=\"constructor-field\"\r\n [label]=\"I18N_KEY.CONSTRUCTOR_LABEL_CURRENCY | trans\"\r\n [formControl]=\"form.currency\"\r\n [searchable]=\"false\"\r\n [data]=\"currenciesList\"\r\n [tabIndex]=\"form.fields.length - i + tabIndex\"\r\n >\r\n <ng-template trmSelectLabelTemplate let-item=\"item\">\r\n <span class=\"trm-icon\" [ngClass]=\"'trm-curr-' + item.toLowerCase()\"\r\n [title]=\"item\"></span>\r\n {{item}}\r\n </ng-template>\r\n </app-trm-select>\r\n }\r\n }\r\n @if (field.type === CONSTRUCTOR_FIELD_TYPES.Date) {\r\n <app-constructor-field-date\r\n @insertRemove\r\n [config]=\"field\"\r\n [formControlName]=\"field.name\"\r\n [tabIndex]=\"form.fields.length - i + tabIndex\"></app-constructor-field-date>\r\n }\r\n }\r\n <ng-template #currencyTpl let-label=\"label\" let-tabIndex=\"tabIndex\">\r\n <app-trm-select\r\n @insertRemove\r\n [label]=\"label\"\r\n [formControl]=\"form.userCurrency\"\r\n [searchable]=\"false\"\r\n [data]=\"userCurrenciesList\"\r\n [tabIndex]=\"tabIndex\"\r\n >\r\n <ng-template trmSelectLabelTemplate let-item=\"item\">\r\n <span class=\"trm-icon\"\r\n [ngClass]=\"'trm-curr-' + item.toLowerCase()\"\r\n [title]=\"item\"></span>\r\n {{item}}\r\n </ng-template>\r\n </app-trm-select>\r\n </ng-template>\r\n </div>\r\n } @else {\r\n <div class=\"trm-skeleton-fields\">\r\n @for (i of skeletonLength; track $index) {\r\n <div class=\"trm-skeleton-field\">\r\n <gm-skeleton [count]=\"1\" [shape]=\"'rect-md'\" [size]=\"18\"></gm-skeleton>\r\n <gm-skeleton [count]=\"1\" [size]=\"50\"></gm-skeleton>\r\n </div>\r\n }\r\n </div>\r\n }\r\n @if (error && !form.methodInfoLoading) {\r\n <div class=\"trm-error\"\r\n @insertRemove\r\n >\r\n {{ error | trans }}\r\n </div>\r\n }\r\n </div>\r\n }\r\n @if (step === TERMINAL_STEP.Confirmation) {\r\n <app-constructor-preparation\r\n @insertRemove\r\n [currency]=\"response?.currency\"\r\n [methodName]=\"form.getTypeNameById(response.typeId)\"\r\n [wallet]=\"response.wallet\"\r\n [maskedWallet]=\"maskedWallet\"\r\n [amount]=\"response.amount\"\r\n [total]=\"response.total\"\r\n [confirmationText]=\"form.config?.confirmation\"\r\n >\r\n @if (error && !form.payment.pending) {\r\n <div class=\"trm-error\"\r\n app-constructor-preparation-error\r\n @insertRemove\r\n >\r\n {{ error | trans }}\r\n </div>\r\n }\r\n </app-constructor-preparation>\r\n }\r\n <div class=\"constructor__actions\"\r\n @insertRemove>\r\n <button class=\"trm-button trm-button--primary constructor__actions-continue\"\r\n type=\"submit\"\r\n [tabindex]=\"form.fields.length + tabIndex\">\r\n {{I18N_KEY.CONSTRUCTOR_LABEL_CONTINUE | trans}}\r\n @if (loading) {\r\n <span class=\"trm-spinner trm-spinner-white\"></span>\r\n }\r\n </button>\r\n <button class=\"trm-button trm-button--secondary constructor__actions-back\"\r\n type=\"button\"\r\n [tabindex]=\"form.fields.length + tabIndex\"\r\n (click)=\"back.emit()\"> {{ backBtnLabel | trans}}</button>\r\n </div>\r\n } @else {\r\n <div class=\"trm-skeleton-group\">\r\n <gm-skeleton [count]=\"4\" [gap]=\"20\" [size]=\"80\"></gm-skeleton>\r\n <gm-skeleton [count]=\"2\" [gap]=\"10\" [size]=\"48\"></gm-skeleton>\r\n </div>\r\n }\r\n</form>\r\n", styles: [":host{display:block}.constructor{display:flex;flex-direction:column;gap:32px;justify-content:flex-start;align-items:stretch}.constructor__fields{display:flex;flex-direction:column;gap:20px;justify-content:flex-start;align-items:stretch}.constructor__fields--reverse{flex-direction:column-reverse}.constructor__fields .fi{border-radius:2px;overflow:hidden;border:1px solid rgba(0,0,0,.08);box-sizing:border-box;background-origin:border-box;flex-shrink:0;height:15px}.constructor__fields .fi-other{border-color:transparent}.constructor__currency{--trm-select-border-radius: 0 10px 10px 0;display:flex;align-items:center;position:absolute;bottom:0;right:0;flex-shrink:0;min-height:46px}@media (min-width: 768px){.constructor__currency{min-height:50px}}.constructor__currency .trm-divider{margin:5px 0;align-self:stretch}.constructor__currency--transparent{--trm-select-bg-color: transparent;--trm-select-bg-color--disabled: transparent;--trm-select-border-color: transparent;--trm-select-border-color--hover: transparent;--trm-select-border-color--focus: transparent}.constructor__actions{display:flex;flex-direction:column;gap:10px;justify-content:flex-start;align-items:flex-start}.constructor__hint{font-weight:400;font-size:14px;line-height:22px;color:var(--color-base-350);margin-top:8px}.constructor__hint.cde-error{font-weight:500;font-size:14px;line-height:20px;color:var(--color-red-500)}.constructor .constructor__actions-continue{position:relative}.constructor .constructor__actions-continue .trm-spinner{position:absolute;right:15px}\n"] }]
|
|
5914
|
+
}], propDecorators: { step: [{
|
|
5766
5915
|
type: Input
|
|
5767
5916
|
}], error: [{
|
|
5768
5917
|
type: Input
|
|
@@ -5800,9 +5949,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
5800
5949
|
}], hintMethod: [{
|
|
5801
5950
|
type: ViewChild,
|
|
5802
5951
|
args: ['hintMethod', { static: false }]
|
|
5803
|
-
}],
|
|
5804
|
-
type:
|
|
5805
|
-
args: [
|
|
5952
|
+
}], sdkList: [{
|
|
5953
|
+
type: ViewChildren,
|
|
5954
|
+
args: [CardSdkService]
|
|
5806
5955
|
}] } });
|
|
5807
5956
|
|
|
5808
5957
|
class TerminalLayoutComponent {
|
|
@@ -5815,6 +5964,7 @@ class TerminalLayoutComponent {
|
|
|
5815
5964
|
this.translateLoader = inject(TranslateLoader);
|
|
5816
5965
|
this.cd = inject(ChangeDetectorRef);
|
|
5817
5966
|
this.translateStorageSrv = inject(TranslateLangStorageService);
|
|
5967
|
+
this.translateSrv = inject(TranslateService);
|
|
5818
5968
|
this.adapter = inject(DateAdapter);
|
|
5819
5969
|
this.apiErrorSrv = inject(ApiErrorsService);
|
|
5820
5970
|
this.location = inject(Location);
|
|
@@ -5827,9 +5977,9 @@ class TerminalLayoutComponent {
|
|
|
5827
5977
|
this._submitted = false;
|
|
5828
5978
|
this.feeCalculateSubject = new Subject();
|
|
5829
5979
|
this.feeLoading = false;
|
|
5830
|
-
this.adapter.setLocale(this.
|
|
5980
|
+
this.adapter.setLocale(this.translateSrv.currentLang);
|
|
5831
5981
|
this._setTitle();
|
|
5832
|
-
this.
|
|
5982
|
+
this.translateSrv.onLangChange
|
|
5833
5983
|
.pipe(takeUntil(this.unSubscriber))
|
|
5834
5984
|
.subscribe((e) => {
|
|
5835
5985
|
this.adapter.setLocale(e.lang);
|
|
@@ -5848,7 +5998,7 @@ class TerminalLayoutComponent {
|
|
|
5848
5998
|
return this.versionSrv.footerText;
|
|
5849
5999
|
}
|
|
5850
6000
|
_setTitle() {
|
|
5851
|
-
this.titleSrv.setTitle(this.versionSrv.pageTitle + this.
|
|
6001
|
+
this.titleSrv.setTitle(this.versionSrv.pageTitle + this.translateSrv.instant(getI18Key(I18N_KEY.TITLE_PAGE_INVOICE)));
|
|
5852
6002
|
}
|
|
5853
6003
|
changeLang() {
|
|
5854
6004
|
}
|
|
@@ -5929,7 +6079,7 @@ class TerminalLayoutComponent {
|
|
|
5929
6079
|
}
|
|
5930
6080
|
checkFatalError() {
|
|
5931
6081
|
// Clear form error when any values have changed.
|
|
5932
|
-
if (!this.apiErrorSrv.hasFatalError && this.apiErrorSrv.
|
|
6082
|
+
if (!this.apiErrorSrv.hasFatalError && this.apiErrorSrv.getLocalError()) {
|
|
5933
6083
|
this.apiErrorSrv.clear();
|
|
5934
6084
|
}
|
|
5935
6085
|
}
|
|
@@ -5959,7 +6109,7 @@ class TerminalLayoutComponent {
|
|
|
5959
6109
|
this.cd.detectChanges();
|
|
5960
6110
|
}
|
|
5961
6111
|
get statusText() {
|
|
5962
|
-
return this.apiErrorSrv.
|
|
6112
|
+
return this.apiErrorSrv.getLocalError() || this._statusText;
|
|
5963
6113
|
}
|
|
5964
6114
|
get hasStatusError() {
|
|
5965
6115
|
return this.apiErrorSrv.hasFatalError;
|
|
@@ -5973,6 +6123,7 @@ class TerminalLayoutComponent {
|
|
|
5973
6123
|
}
|
|
5974
6124
|
this.feeCalculateSubject.next();
|
|
5975
6125
|
this.feeLoading = true;
|
|
6126
|
+
this.feeOptions = {};
|
|
5976
6127
|
this.cd.detectChanges();
|
|
5977
6128
|
this.sessionDS
|
|
5978
6129
|
.feeOptions(value)
|
|
@@ -5999,7 +6150,7 @@ class TerminalLayoutComponent {
|
|
|
5999
6150
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.2", type: TerminalLayoutComponent, isStandalone: true, selector: "app-terminal-layout", providers: [
|
|
6000
6151
|
SessionDataSource,
|
|
6001
6152
|
CurrencyPipe
|
|
6002
|
-
], viewQueries: [{ propertyName: "scrollComponent", first: true, predicate: ["scrollComponent"], descendants: true }], ngImport: i0, template: "<ng-scrollbar appearance=\"compact\">\r\n <div class=\"terminal-layout\">\r\n <section class=\"terminal\">\r\n <div class=\"terminal__content\">\r\n <header class=\"terminal__header\">\r\n <i class=\"terminal__header-logo\"\r\n [class]=\"logoClass\"></i>\r\n <div class=\"terminal__header-lang\">\r\n @if (hasChoice) {\r\n <app-terminal-lang-switcher (
|
|
6153
|
+
], viewQueries: [{ propertyName: "scrollComponent", first: true, predicate: ["scrollComponent"], descendants: true }], ngImport: i0, template: "<ng-scrollbar appearance=\"compact\">\r\n <div class=\"terminal-layout\">\r\n <section class=\"terminal\">\r\n <div class=\"terminal__content\">\r\n <header class=\"terminal__header\">\r\n <i class=\"terminal__header-logo\"\r\n [class]=\"logoClass\"></i>\r\n <div class=\"terminal__header-lang\">\r\n @if (hasChoice) {\r\n <app-terminal-lang-switcher (langChange)=\"changeLang()\"\r\n [tabIndex]=\"1\"></app-terminal-lang-switcher>\r\n }\r\n </div>\r\n </header>\r\n <div class=\"terminal__form\">\r\n @if (sessionDS.loading$ | async) {\r\n <div class=\"trm-skeleton-group\">\r\n <gm-skeleton [count]=\"1\" [size]=\"120\"></gm-skeleton>\r\n <gm-skeleton [count]=\"4\" [gap]=\"20\" [size]=\"80\"></gm-skeleton>\r\n <gm-skeleton [count]=\"2\" [gap]=\"10\" [size]=\"48\"></gm-skeleton>\r\n </div>\r\n } @else {\r\n @if (projectName) {\r\n <div class=\"terminal__info\">\r\n <h5 class=\"terminal__info__name\"> {{ projectName }} </h5>\r\n @if (description) {\r\n <p class=\"terminal__info__desc\"> {{ description }} </p>\r\n }\r\n </div>\r\n }\r\n @if (step !== TERMINAL_STEP.Status && !hasStatusError) {\r\n <app-constructor-form\r\n [feeLoading]=\"feeLoading\"\r\n [feeOptions]=\"feeOptions\"\r\n [loading]=\"(sessionDS.loadingConfirm$ | async)\"\r\n [step]=\"step\"\r\n [types]=\"types\"\r\n [currency]=\"currency\"\r\n [response]=\"data\"\r\n [error]=\"statusText\"\r\n (prepare)=\"prepare($event)\"\r\n (onPaymentChanged)=\"checkFatalError(); calculateFee($event)\"\r\n (back)=\"back()\"\r\n [canReturnToProject]=\"sessionDS.canReturnToProject\"\r\n (confirm)=\"confirm()\"\r\n [tabIndex]=\"2\"></app-constructor-form>\r\n } @else {\r\n <app-constructor-status class=\"terminal__status\"\r\n [failed]=\"hasStatusError\"\r\n [message]=\"statusText ? (statusText | trans) : ''\"\r\n [backUrl]=\"returnBackUrl\"\r\n ></app-constructor-status>\r\n }\r\n }\r\n\r\n </div>\r\n </div>\r\n </section>\r\n <footer class=\"terminal-footer\">\r\n <i class=\"terminal-footer__logo\"></i>\r\n <p class=\"terminal-footer__txt\">\r\n {{ footerText }}\r\n </p>\r\n </footer>\r\n </div>\r\n</ng-scrollbar>\r\n", styles: [":host{display:flex;flex-direction:column;height:100vh;box-sizing:border-box}.terminal{box-sizing:border-box;width:100%;max-width:528px;min-width:320px;padding:0 10px}.terminal-layout{min-height:100vh;padding:42px 0 84px;display:flex;flex-direction:column;gap:42px;justify-content:flex-start;align-items:center}.terminal-footer{flex:auto 1 0;display:flex;flex-direction:column;gap:24px;justify-content:flex-end;align-items:center}.terminal-footer__txt{font-weight:400;font-size:14px;line-height:18px;color:var(--color-base-350);margin:0}.terminal__content{box-sizing:border-box;margin:auto;padding:20px;width:100%;background:#fff;border-radius:16px;display:flex;flex-direction:column;gap:32px;justify-content:flex-start;align-items:stretch}@media (min-width: 768px){.terminal__content{padding:32px}}.terminal__header{display:flex;flex-direction:row;gap:0;justify-content:flex-start;align-items:center}.terminal__header-lang{margin-left:auto}.terminal__form{display:flex;flex-direction:column;gap:24px;justify-content:flex-start;align-items:stretch;width:100%}.terminal__info{background:#f5f5f5;border-radius:16px;padding:20px 24px;display:flex;flex-direction:column;gap:10px;justify-content:flex-start;align-items:flex-start}.terminal__info__name{margin:0;font-weight:500;font-size:16px;line-height:20px;color:#000}.terminal__info__desc{margin:0;font-weight:400;font-size:15px;line-height:22px;color:var(--color-base-350)}.terminal__status{margin-top:8px}.terminal .trm-skeleton-group{display:flex;flex-direction:column;gap:32px;justify-content:flex-start;align-items:stretch}.terminal .trm-skeleton-group__form{gap:20px}.terminal .trm-skeleton-group__form .loader,.terminal .trm-skeleton-group__form .skeleton-loader{height:80px}.terminal .trm-skeleton-group__header .loader,.terminal .trm-skeleton-group__header .skeleton-loader{height:120px}.terminal .trm-skeleton-group__actions{gap:10px}.terminal .trm-skeleton-group__actions .loader,.terminal .trm-skeleton-group__actions .skeleton-loader{height:48px}\n"], dependencies: [{ kind: "component", type: NgScrollbar, selector: "ng-scrollbar:not([externalViewport])", exportAs: ["ngScrollbar"] }, { kind: "component", type: TerminalLangSwitcherComponent, selector: "app-terminal-lang-switcher", inputs: ["loading", "tabIndex"], outputs: ["langChange"] }, { kind: "component", type: ConstructorFormComponent, selector: "app-constructor-form", inputs: ["step", "error", "response", "feeLoading", "feeOptions", "currency", "userCurrency", "loading", "types", "canReturnToProject", "tabIndex"], outputs: ["amountChanged", "back", "prepare", "confirm", "onPaymentChanged"] }, { kind: "component", type: ConstructorStatusComponent, selector: "app-constructor-status", inputs: ["failed", "inProgress", "animation", "message", "failTitle", "progressTitle", "successTitle", "tabIndex", "backUrl", "backUrlTitle", "hasSupportHint"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: TranslateByKeyPipe, name: "trans" }, { kind: "component", type: GmSkeletonComponent, selector: "gm-skeleton", inputs: ["shape", "orientation", "count", "size", "gap"] }] }); }
|
|
6003
6154
|
}
|
|
6004
6155
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: TerminalLayoutComponent, decorators: [{
|
|
6005
6156
|
type: Component,
|
|
@@ -6012,7 +6163,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
6012
6163
|
ConstructorFormComponent, ConstructorStatusComponent,
|
|
6013
6164
|
AsyncPipe,
|
|
6014
6165
|
TranslateByKeyPipe, GmSkeletonComponent
|
|
6015
|
-
], template: "<ng-scrollbar appearance=\"compact\">\r\n <div class=\"terminal-layout\">\r\n <section class=\"terminal\">\r\n <div class=\"terminal__content\">\r\n <header class=\"terminal__header\">\r\n <i class=\"terminal__header-logo\"\r\n [class]=\"logoClass\"></i>\r\n <div class=\"terminal__header-lang\">\r\n @if (hasChoice) {\r\n <app-terminal-lang-switcher (
|
|
6166
|
+
], template: "<ng-scrollbar appearance=\"compact\">\r\n <div class=\"terminal-layout\">\r\n <section class=\"terminal\">\r\n <div class=\"terminal__content\">\r\n <header class=\"terminal__header\">\r\n <i class=\"terminal__header-logo\"\r\n [class]=\"logoClass\"></i>\r\n <div class=\"terminal__header-lang\">\r\n @if (hasChoice) {\r\n <app-terminal-lang-switcher (langChange)=\"changeLang()\"\r\n [tabIndex]=\"1\"></app-terminal-lang-switcher>\r\n }\r\n </div>\r\n </header>\r\n <div class=\"terminal__form\">\r\n @if (sessionDS.loading$ | async) {\r\n <div class=\"trm-skeleton-group\">\r\n <gm-skeleton [count]=\"1\" [size]=\"120\"></gm-skeleton>\r\n <gm-skeleton [count]=\"4\" [gap]=\"20\" [size]=\"80\"></gm-skeleton>\r\n <gm-skeleton [count]=\"2\" [gap]=\"10\" [size]=\"48\"></gm-skeleton>\r\n </div>\r\n } @else {\r\n @if (projectName) {\r\n <div class=\"terminal__info\">\r\n <h5 class=\"terminal__info__name\"> {{ projectName }} </h5>\r\n @if (description) {\r\n <p class=\"terminal__info__desc\"> {{ description }} </p>\r\n }\r\n </div>\r\n }\r\n @if (step !== TERMINAL_STEP.Status && !hasStatusError) {\r\n <app-constructor-form\r\n [feeLoading]=\"feeLoading\"\r\n [feeOptions]=\"feeOptions\"\r\n [loading]=\"(sessionDS.loadingConfirm$ | async)\"\r\n [step]=\"step\"\r\n [types]=\"types\"\r\n [currency]=\"currency\"\r\n [response]=\"data\"\r\n [error]=\"statusText\"\r\n (prepare)=\"prepare($event)\"\r\n (onPaymentChanged)=\"checkFatalError(); calculateFee($event)\"\r\n (back)=\"back()\"\r\n [canReturnToProject]=\"sessionDS.canReturnToProject\"\r\n (confirm)=\"confirm()\"\r\n [tabIndex]=\"2\"></app-constructor-form>\r\n } @else {\r\n <app-constructor-status class=\"terminal__status\"\r\n [failed]=\"hasStatusError\"\r\n [message]=\"statusText ? (statusText | trans) : ''\"\r\n [backUrl]=\"returnBackUrl\"\r\n ></app-constructor-status>\r\n }\r\n }\r\n\r\n </div>\r\n </div>\r\n </section>\r\n <footer class=\"terminal-footer\">\r\n <i class=\"terminal-footer__logo\"></i>\r\n <p class=\"terminal-footer__txt\">\r\n {{ footerText }}\r\n </p>\r\n </footer>\r\n </div>\r\n</ng-scrollbar>\r\n", styles: [":host{display:flex;flex-direction:column;height:100vh;box-sizing:border-box}.terminal{box-sizing:border-box;width:100%;max-width:528px;min-width:320px;padding:0 10px}.terminal-layout{min-height:100vh;padding:42px 0 84px;display:flex;flex-direction:column;gap:42px;justify-content:flex-start;align-items:center}.terminal-footer{flex:auto 1 0;display:flex;flex-direction:column;gap:24px;justify-content:flex-end;align-items:center}.terminal-footer__txt{font-weight:400;font-size:14px;line-height:18px;color:var(--color-base-350);margin:0}.terminal__content{box-sizing:border-box;margin:auto;padding:20px;width:100%;background:#fff;border-radius:16px;display:flex;flex-direction:column;gap:32px;justify-content:flex-start;align-items:stretch}@media (min-width: 768px){.terminal__content{padding:32px}}.terminal__header{display:flex;flex-direction:row;gap:0;justify-content:flex-start;align-items:center}.terminal__header-lang{margin-left:auto}.terminal__form{display:flex;flex-direction:column;gap:24px;justify-content:flex-start;align-items:stretch;width:100%}.terminal__info{background:#f5f5f5;border-radius:16px;padding:20px 24px;display:flex;flex-direction:column;gap:10px;justify-content:flex-start;align-items:flex-start}.terminal__info__name{margin:0;font-weight:500;font-size:16px;line-height:20px;color:#000}.terminal__info__desc{margin:0;font-weight:400;font-size:15px;line-height:22px;color:var(--color-base-350)}.terminal__status{margin-top:8px}.terminal .trm-skeleton-group{display:flex;flex-direction:column;gap:32px;justify-content:flex-start;align-items:stretch}.terminal .trm-skeleton-group__form{gap:20px}.terminal .trm-skeleton-group__form .loader,.terminal .trm-skeleton-group__form .skeleton-loader{height:80px}.terminal .trm-skeleton-group__header .loader,.terminal .trm-skeleton-group__header .skeleton-loader{height:120px}.terminal .trm-skeleton-group__actions{gap:10px}.terminal .trm-skeleton-group__actions .loader,.terminal .trm-skeleton-group__actions .skeleton-loader{height:48px}\n"] }]
|
|
6016
6167
|
}], ctorParameters: () => [], propDecorators: { scrollComponent: [{
|
|
6017
6168
|
type: ViewChild,
|
|
6018
6169
|
args: ['scrollComponent']
|
|
@@ -6458,5 +6609,5 @@ const moment = momentjs;
|
|
|
6458
6609
|
* Generated bundle index. Do not edit.
|
|
6459
6610
|
*/
|
|
6460
6611
|
|
|
6461
|
-
export { APP_READY_TOKEN, ApiErrors, ApiErrorsService, CHECKIN_SERVICE_TOKEN, CONFIGURATION_TOKEN, CSRFResolver, CSRF_COOKIE_NAME, CheckinDatasource, CheckinModeToken, CheckinModule, CheckinPageComponent, CollectionType, ConstructorFieldDateComponent, ConstructorFieldIframeComponent, ConstructorFieldSelectComponent, ConstructorFieldTextComponent, ConstructorFormComponent, ConstructorFormService, ConstructorPreparationComponent, ConstructorStatusComponent, CountriesSortPipe, CountryTranslatePipe, DEFAULT_COUNTRY_LOCALHOST_KEY, DEFAULT_CURRENCY_LOCALHOST_KEY, DEFAULT_LANG, DEFAULT_METHOD_LOCALHOST_KEY, ENVIRONMENT, ErrorComponent, ErrorInterceptorService,
|
|
6612
|
+
export { APP_READY_TOKEN, ApiErrors, ApiErrorsService, CHECKIN_SERVICE_TOKEN, CONFIGURATION_TOKEN, CSRFResolver, CSRF_COOKIE_NAME, CardSdkService, CheckinDatasource, CheckinModeToken, CheckinModule, CheckinPageComponent, CollectionType, ConstructorFieldDateComponent, ConstructorFieldIframeComponent, ConstructorFieldSelectComponent, ConstructorFieldTextComponent, ConstructorFormComponent, ConstructorFormService, ConstructorPreparationComponent, ConstructorStatusComponent, CountriesSortPipe, CountryTranslatePipe, DEFAULT_COUNTRY_LOCALHOST_KEY, DEFAULT_CURRENCY_LOCALHOST_KEY, DEFAULT_LANG, DEFAULT_METHOD_LOCALHOST_KEY, ENVIRONMENT, ErrorComponent, ErrorInterceptorService, FIELD_TEMPLATE, FORMAT_DATE, FocusHandler, HtmlSanitizerPipe, I18N_COUNTRIES, I18N_KEY, INITIAL_PHONE_MASK, IframeValidatorDirectiveDirective, InputMaskCorrector, InvoiceStatus, LANGUAGE, LOCAL_LANG_KEY, MASKS, MaskResolver, MaskService, MethodAmountHintComponent, MethodTitlePipe, Mode, NgVarContext, NgVarDirective, OTHER_COUNTRY_CODE, PHONE_MASKS, PHONE_MASK_PATTERNS, PaymentFieldTypeEnum, PsSelectComponent, SanitizerPipe, ScriptLoader, ScrollbarSelectHeightDirective, SessionDataSource, SessionToken, SharedModule, TERMINAL_METHOD_CONFIGURATION_FACTORY, TERMINAL_SDK_FACTORY, TERMINAL_SERVICE_TOKEN, TERMINAL_VERSION_SERVICE_TOKEN, TabIndexFocusDirective, TerminalLangSwitcherComponent, TerminalLayoutComponent, TerminalLayoutTplComponent, TerminalModule, TerminalStep, TerminalTplComponent, TranslateByKeyPipe, TranslateLangStorageService, TrmCurrencyPipe, TrmSelectComponent, TrmSelectLabelTemplateDirective, VersionServiceBase, getI18Key, hideInitLoader, i18nMap, insertRemoveTrigger, isObject, isObjectTheSame, loadI18NData, moment, removeEmptyProps, removeSpecSymbols, warningConsole };
|
|
6462
6613
|
//# sourceMappingURL=trm-tmpl.mjs.map
|