trm-tmpl 3.2.1 → 3.3.0
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 +99 -117
- 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/method-amount-hint/method-amount-hint.component.mjs +11 -7
- 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 +90 -64
- 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-options.mjs +1 -1
- 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 +40 -25
- package/esm2022/lib/app/pages/components/terminal-layout/terminal-layout.component.mjs +11 -9
- package/esm2022/lib/app/pages/directives/fee-template.directive.mjs +17 -0
- package/esm2022/lib/app/pages/directives/index.mjs +2 -1
- 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 +12 -11
- 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 +13 -16
- package/esm2022/lib/app/terminal.module.mjs +43 -75
- package/fesm2022/trm-tmpl.mjs +936 -793
- 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 +24 -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/method-amount-hint/method-amount-hint.component.d.ts +3 -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 +6 -9
- package/lib/app/pages/components/constructor-form/models/index.d.ts +0 -1
- package/lib/app/pages/components/constructor-form/models/payment-field-options.d.ts +1 -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/pages/directives/fee-template.directive.d.ts +7 -0
- package/lib/app/pages/directives/index.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/lib/app/terminal-tpl.component.d.ts +2 -1
- package/lib/app/terminal.module.d.ts +26 -4
- 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,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, Injectable, ChangeDetectorRef, CSP_NONCE,
|
|
2
|
+
import { InjectionToken, inject, Injectable, ChangeDetectorRef, CSP_NONCE, NgModule, TemplateRef, Directive, Component, ContentChild, HostListener, ElementRef, Renderer2, Pipe, EventEmitter, forwardRef, ChangeDetectionStrategy, Input, Output, SecurityContext, ViewContainerRef, Injector, DestroyRef, ViewChild, ViewChildren } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/router';
|
|
4
|
-
import { Router, NavigationEnd, NavigationCancel, NavigationError, RouterOutlet,
|
|
5
|
-
import {
|
|
6
|
-
import { DOCUMENT, registerLocaleData, AsyncPipe, CommonModule, NgTemplateOutlet, NgClass, CurrencyPipe, getCurrencySymbol, Location } from '@angular/common';
|
|
7
|
-
import { BehaviorSubject, of, throwError, Subject, combineLatest, merge, fromEvent, distinctUntilChanged, timer, interval } from 'rxjs';
|
|
4
|
+
import { RouterModule, Router, NavigationEnd, NavigationCancel, NavigationError, RouterOutlet, ActivatedRoute } from '@angular/router';
|
|
5
|
+
import { registerLocaleData, DOCUMENT, AsyncPipe, NgTemplateOutlet, NgClass, CommonModule, CurrencyPipe, getCurrencySymbol, Location } from '@angular/common';
|
|
8
6
|
import localeRu from '@angular/common/locales/ru';
|
|
9
7
|
import localeEn from '@angular/common/locales/en';
|
|
10
8
|
import localeTr from '@angular/common/locales/tr';
|
|
@@ -17,19 +15,23 @@ import ES_COUNTRIES from 'i18n-iso-countries/langs/es.json';
|
|
|
17
15
|
import TR_COUNTRIES from 'i18n-iso-countries/langs/tr.json';
|
|
18
16
|
import PT_COUNTRIES from 'i18n-iso-countries/langs/pt.json';
|
|
19
17
|
import LT_COUNTRIES from 'i18n-iso-countries/langs/lt.json';
|
|
20
|
-
import
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
18
|
+
import { registerLocale, getNames } from 'i18n-iso-countries';
|
|
19
|
+
import { BehaviorSubject, of, throwError, Subject, merge, fromEvent, distinctUntilChanged, timer, interval } from 'rxjs';
|
|
20
|
+
import { catchError, map, first, delay, tap, switchMap, takeUntil, filter, debounceTime, finalize } from 'rxjs/operators';
|
|
23
21
|
import { CookieService } from 'ngx-cookie-service';
|
|
24
22
|
import * as momentjs from 'moment-timezone';
|
|
25
23
|
import momentjs__default from 'moment-timezone';
|
|
26
|
-
import
|
|
24
|
+
import * as i2 from '@ngx-translate/core';
|
|
25
|
+
import { TranslateService, TranslateModule, TranslatePipe, TranslateLoader } from '@ngx-translate/core';
|
|
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';
|
|
@@ -85,6 +87,48 @@ var InvoiceStatus;
|
|
|
85
87
|
})(InvoiceStatus || (InvoiceStatus = {}));
|
|
86
88
|
;
|
|
87
89
|
|
|
90
|
+
const OTHER_COUNTRY_CODE = 'other';
|
|
91
|
+
// Additional countries
|
|
92
|
+
Object.assign(EN_COUNTRIES.countries, {
|
|
93
|
+
OS: 'South Ossetia',
|
|
94
|
+
AB: 'Abkhazia',
|
|
95
|
+
[OTHER_COUNTRY_CODE]: 'Other'
|
|
96
|
+
});
|
|
97
|
+
Object.assign(RU_COUNTRIES.countries, {
|
|
98
|
+
OS: 'Южная Осетия',
|
|
99
|
+
AB: 'Абхазия',
|
|
100
|
+
[OTHER_COUNTRY_CODE]: 'Другие'
|
|
101
|
+
});
|
|
102
|
+
Object.assign(ES_COUNTRIES.countries, {
|
|
103
|
+
OS: 'Osetia del Sur',
|
|
104
|
+
AB: 'Abjasia',
|
|
105
|
+
[OTHER_COUNTRY_CODE]: 'Otro'
|
|
106
|
+
});
|
|
107
|
+
Object.assign(TR_COUNTRIES.countries, {
|
|
108
|
+
OS: 'Güney Osetya',
|
|
109
|
+
AB: 'Abhazya',
|
|
110
|
+
[OTHER_COUNTRY_CODE]: 'Diğer'
|
|
111
|
+
});
|
|
112
|
+
Object.assign(PT_COUNTRIES.countries, {
|
|
113
|
+
OS: 'Ossétia do Sul',
|
|
114
|
+
AB: 'Abecásia',
|
|
115
|
+
[OTHER_COUNTRY_CODE]: 'Outro'
|
|
116
|
+
});
|
|
117
|
+
const loadI18NData = () => {
|
|
118
|
+
registerLocaleData(localeRu);
|
|
119
|
+
registerLocaleData(localeEn);
|
|
120
|
+
registerLocaleData(localeEs);
|
|
121
|
+
registerLocaleData(localeTr);
|
|
122
|
+
registerLocaleData(localePt);
|
|
123
|
+
registerLocaleData(localeLt);
|
|
124
|
+
registerLocale(EN_COUNTRIES);
|
|
125
|
+
registerLocale(RU_COUNTRIES);
|
|
126
|
+
registerLocale(ES_COUNTRIES);
|
|
127
|
+
registerLocale(TR_COUNTRIES);
|
|
128
|
+
registerLocale(PT_COUNTRIES);
|
|
129
|
+
registerLocale(LT_COUNTRIES);
|
|
130
|
+
};
|
|
131
|
+
|
|
88
132
|
var I18N_KEY;
|
|
89
133
|
(function (I18N_KEY) {
|
|
90
134
|
I18N_KEY["TITLE_PAGE_INVOICE"] = "TITLE_PAGE_INVOICE";
|
|
@@ -104,6 +148,7 @@ var I18N_KEY;
|
|
|
104
148
|
I18N_KEY["DEFAULT_ERROR_CODE"] = "error_api";
|
|
105
149
|
I18N_KEY["DEFAULT_ERROR_CODE_GENERAL"] = "error_general";
|
|
106
150
|
I18N_KEY["ERROR_OCCUR"] = "ERROR_OCCUR";
|
|
151
|
+
I18N_KEY["ERROR_OCCUR_SDK"] = "ERROR_OCCUR_SDK";
|
|
107
152
|
I18N_KEY["PROGRESS_TITLE"] = "PROGRESS_TITLE";
|
|
108
153
|
I18N_KEY["FAIL_TITLE"] = "FAIL_TITLE";
|
|
109
154
|
I18N_KEY["SUCCESS_TITLE"] = "SUCCESS_TITLE";
|
|
@@ -270,7 +315,8 @@ const i18nMap = new Map([
|
|
|
270
315
|
[I18N_KEY.TERMINAL_SESSION_SUCCESS, 'Операция прошла успешно!'],
|
|
271
316
|
[I18N_KEY.TERMINAL_SESSION_SUPPORT, 'В случае возникновения проблем с платежом, обращайтесь в техническую поддержку магазина или к нам на почту'],
|
|
272
317
|
[I18N_KEY.SELECT_SEARCH, 'Поиск'],
|
|
273
|
-
[I18N_KEY.SELECT_EMPTY_LIST, 'Список пуст']
|
|
318
|
+
[I18N_KEY.SELECT_EMPTY_LIST, 'Список пуст'],
|
|
319
|
+
[I18N_KEY.ERROR_OCCUR_SDK, 'Ошибка загрузки терминала']
|
|
274
320
|
]);
|
|
275
321
|
const getI18Key = (key) => {
|
|
276
322
|
return i18nMap.get(key);
|
|
@@ -292,7 +338,9 @@ const CSRF_COOKIE_NAME = 'TERMINAL-CSRF-KEY';
|
|
|
292
338
|
const I18N_COUNTRIES = new InjectionToken('i18n-iso-countries');
|
|
293
339
|
const SessionToken = new InjectionToken('SessionToken');
|
|
294
340
|
const CheckinModeToken = new InjectionToken('CheckinModeToken');
|
|
295
|
-
const
|
|
341
|
+
const DEFAULT_COUNTRY_LOCALHOST_KEY = 'GM_TERMINAL_COUNTRY';
|
|
342
|
+
const DEFAULT_METHOD_LOCALHOST_KEY = 'GM_TERMINAL_METHOD';
|
|
343
|
+
const DEFAULT_CURRENCY_LOCALHOST_KEY = 'GM_TERMINAL_CURRENCY';
|
|
296
344
|
|
|
297
345
|
var Mode;
|
|
298
346
|
(function (Mode) {
|
|
@@ -310,13 +358,17 @@ class VersionServiceBase {
|
|
|
310
358
|
}
|
|
311
359
|
|
|
312
360
|
class ApiErrorsService {
|
|
313
|
-
;
|
|
314
|
-
get ERROR_KEY() {
|
|
315
|
-
return `${this.token}_ERROR_DETAIL`;
|
|
316
|
-
}
|
|
317
361
|
constructor() {
|
|
318
362
|
this.token = inject(SessionToken, { optional: true }) || 'token';
|
|
319
|
-
|
|
363
|
+
}
|
|
364
|
+
clear() {
|
|
365
|
+
this._localError = null;
|
|
366
|
+
}
|
|
367
|
+
get hasError() {
|
|
368
|
+
return !!this._localError;
|
|
369
|
+
}
|
|
370
|
+
get hasFatalError() {
|
|
371
|
+
const formatErrors = [
|
|
320
372
|
ApiErrors.FORMAT_PHONE,
|
|
321
373
|
ApiErrors.FORMAT_DATE_BIRTH,
|
|
322
374
|
ApiErrors.FORMAT_EMAIL,
|
|
@@ -327,38 +379,17 @@ class ApiErrorsService {
|
|
|
327
379
|
ApiErrors.FORMAT_WALLET,
|
|
328
380
|
ApiErrors.FORMAT_ZIP,
|
|
329
381
|
];
|
|
330
|
-
this.
|
|
331
|
-
|
|
332
|
-
setError(err) {
|
|
333
|
-
let code = I18N_KEY.DEFAULT_ERROR_CODE;
|
|
334
|
-
if (err?.code) {
|
|
335
|
-
code = err.code;
|
|
382
|
+
if (formatErrors.includes(this._localError)) {
|
|
383
|
+
return false;
|
|
336
384
|
}
|
|
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;
|
|
385
|
+
return !!this._localError;
|
|
352
386
|
}
|
|
353
387
|
setLocalError(err) {
|
|
354
388
|
let code = I18N_KEY.DEFAULT_ERROR_CODE;
|
|
355
389
|
if (err?.code) {
|
|
356
390
|
code = err.code;
|
|
357
391
|
}
|
|
358
|
-
this._localError =
|
|
359
|
-
}
|
|
360
|
-
clearLocal() {
|
|
361
|
-
this._localError = '';
|
|
392
|
+
this._localError = code;
|
|
362
393
|
}
|
|
363
394
|
get hasLocalError() {
|
|
364
395
|
return !!this._localError;
|
|
@@ -373,48 +404,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
373
404
|
type: Injectable
|
|
374
405
|
}], ctorParameters: () => [] });
|
|
375
406
|
|
|
376
|
-
const OTHER_COUNTRY_CODE = 'other';
|
|
377
|
-
// Additional countries
|
|
378
|
-
Object.assign(EN_COUNTRIES.countries, {
|
|
379
|
-
OS: 'South Ossetia',
|
|
380
|
-
AB: 'Abkhazia',
|
|
381
|
-
[OTHER_COUNTRY_CODE]: 'Other'
|
|
382
|
-
});
|
|
383
|
-
Object.assign(RU_COUNTRIES.countries, {
|
|
384
|
-
OS: 'Южная Осетия',
|
|
385
|
-
AB: 'Абхазия',
|
|
386
|
-
[OTHER_COUNTRY_CODE]: 'Другие'
|
|
387
|
-
});
|
|
388
|
-
Object.assign(ES_COUNTRIES.countries, {
|
|
389
|
-
OS: 'Osetia del Sur',
|
|
390
|
-
AB: 'Abjasia',
|
|
391
|
-
[OTHER_COUNTRY_CODE]: 'Otro'
|
|
392
|
-
});
|
|
393
|
-
Object.assign(TR_COUNTRIES.countries, {
|
|
394
|
-
OS: 'Güney Osetya',
|
|
395
|
-
AB: 'Abhazya',
|
|
396
|
-
[OTHER_COUNTRY_CODE]: 'Diğer'
|
|
397
|
-
});
|
|
398
|
-
Object.assign(PT_COUNTRIES.countries, {
|
|
399
|
-
OS: 'Ossétia do Sul',
|
|
400
|
-
AB: 'Abecásia',
|
|
401
|
-
[OTHER_COUNTRY_CODE]: 'Outro'
|
|
402
|
-
});
|
|
403
|
-
const loadI18NData = () => {
|
|
404
|
-
registerLocaleData(localeRu);
|
|
405
|
-
registerLocaleData(localeEn);
|
|
406
|
-
registerLocaleData(localeEs);
|
|
407
|
-
registerLocaleData(localeTr);
|
|
408
|
-
registerLocaleData(localePt);
|
|
409
|
-
registerLocaleData(localeLt);
|
|
410
|
-
registerLocale(EN_COUNTRIES);
|
|
411
|
-
registerLocale(RU_COUNTRIES);
|
|
412
|
-
registerLocale(ES_COUNTRIES);
|
|
413
|
-
registerLocale(TR_COUNTRIES);
|
|
414
|
-
registerLocale(PT_COUNTRIES);
|
|
415
|
-
registerLocale(LT_COUNTRIES);
|
|
416
|
-
};
|
|
417
|
-
|
|
418
407
|
const CONFIGURATION_TOKEN = new InjectionToken('CONFIGURATION_TOKEN');
|
|
419
408
|
const CHECKIN_SERVICE_TOKEN = new InjectionToken('CHECKIN_SERVICE_TOKEN');
|
|
420
409
|
const TERMINAL_SERVICE_TOKEN = new InjectionToken('TERMINAL_SERVICE_TOKEN');
|
|
@@ -423,105 +412,275 @@ 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
|
|
|
426
|
-
class
|
|
415
|
+
class LocalStorage {
|
|
427
416
|
constructor() {
|
|
428
|
-
this.
|
|
429
|
-
this.
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
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']
|
|
417
|
+
this._document = inject(DOCUMENT);
|
|
418
|
+
this._supported = true;
|
|
419
|
+
try {
|
|
420
|
+
if (!this._document.defaultView.localStorage) {
|
|
421
|
+
this._supported = false;
|
|
462
422
|
}
|
|
463
|
-
|
|
464
|
-
|
|
423
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
424
|
+
}
|
|
425
|
+
catch (error) {
|
|
426
|
+
this._supported = false;
|
|
427
|
+
}
|
|
465
428
|
}
|
|
466
|
-
get
|
|
467
|
-
return this.
|
|
429
|
+
get _storage() {
|
|
430
|
+
return this._document.defaultView.localStorage;
|
|
468
431
|
}
|
|
469
|
-
|
|
470
|
-
|
|
432
|
+
getItem(key) {
|
|
433
|
+
if (!this._supported) {
|
|
434
|
+
return null;
|
|
435
|
+
}
|
|
436
|
+
return this._storage.getItem(key);
|
|
471
437
|
}
|
|
472
|
-
|
|
473
|
-
|
|
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));
|
|
474
453
|
}
|
|
475
454
|
get defaultLang() {
|
|
476
|
-
|
|
477
|
-
this._isLanguageDetected = !!detectedLanguage;
|
|
478
|
-
return detectedLanguage || DEFAULT_LANG;
|
|
455
|
+
return this._defaultLang || this.getItem(LOCAL_LANG_KEY);
|
|
479
456
|
}
|
|
480
|
-
|
|
481
|
-
|
|
457
|
+
saveDefaultCountry(value) {
|
|
458
|
+
this._defaultCountry = value;
|
|
459
|
+
this.setItem(DEFAULT_COUNTRY_LOCALHOST_KEY, value);
|
|
482
460
|
}
|
|
483
|
-
|
|
484
|
-
|
|
461
|
+
saveDefaultMethodName(value) {
|
|
462
|
+
this._defaultMethodName = value;
|
|
463
|
+
this.setItem(DEFAULT_METHOD_LOCALHOST_KEY, value);
|
|
485
464
|
}
|
|
486
|
-
|
|
487
|
-
|
|
465
|
+
saveDefaultCurrency(value) {
|
|
466
|
+
this._defaultCurrency = value;
|
|
467
|
+
this.setItem(DEFAULT_CURRENCY_LOCALHOST_KEY, value);
|
|
488
468
|
}
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
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
|
+
class CSRFResolver {
|
|
482
|
+
constructor() {
|
|
483
|
+
this.cookieSrv = inject(CookieService);
|
|
484
|
+
this.apiErrorsSrv = inject(ApiErrorsService);
|
|
485
|
+
this.configuration = inject(CONFIGURATION_TOKEN, { optional: true }) || { credentials: {} };
|
|
486
|
+
this.terminalApi = inject(TERMINAL_SERVICE_TOKEN);
|
|
487
|
+
this.token = inject(SessionToken, { optional: true }) || 'token';
|
|
488
|
+
this.environment = inject(ENVIRONMENT);
|
|
489
|
+
this.storage = inject(LocalStorage);
|
|
490
|
+
}
|
|
491
|
+
saveDefaultCountry(defaultCountryISOCode) {
|
|
492
|
+
if (defaultCountryISOCode) {
|
|
493
|
+
this.storage.saveDefaultCountry(defaultCountryISOCode);
|
|
493
494
|
}
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
495
|
+
}
|
|
496
|
+
resolve(route) {
|
|
497
|
+
const token = this.token;
|
|
498
|
+
if (!token) {
|
|
499
|
+
if (!this.apiErrorsSrv.hasError) {
|
|
500
|
+
this.apiErrorsSrv.setLocalError({ code: ApiErrors.SESSION_NOT_FOUND });
|
|
497
501
|
}
|
|
498
|
-
return
|
|
499
|
-
}, {});
|
|
500
|
-
if (!langs.includes(this.translateSrv.currentLang)) {
|
|
501
|
-
this.translateSrv
|
|
502
|
-
.use(langs[0]);
|
|
502
|
+
return of(true);
|
|
503
503
|
}
|
|
504
|
+
const timezone = momentjs__default.tz.guess();
|
|
505
|
+
if (!this.environment.csrf) {
|
|
506
|
+
return of(false);
|
|
507
|
+
}
|
|
508
|
+
if (this.resolveCSRF(token)) {
|
|
509
|
+
return of(true);
|
|
510
|
+
}
|
|
511
|
+
return this.terminalApi.postTerminalOpen({
|
|
512
|
+
token,
|
|
513
|
+
terminalOpenRequest: {
|
|
514
|
+
timezone
|
|
515
|
+
}
|
|
516
|
+
})
|
|
517
|
+
.pipe(catchError((err) => {
|
|
518
|
+
this.apiErrorsSrv.setLocalError(err.error);
|
|
519
|
+
return of({ csrf: null, defaultCountryISOCode: null });
|
|
520
|
+
}), map(({ csrf, defaultCountryISOCode }) => {
|
|
521
|
+
this.saveDefaultCountry(defaultCountryISOCode);
|
|
522
|
+
this.resolveCSRF(token, csrf);
|
|
523
|
+
return true;
|
|
524
|
+
}));
|
|
504
525
|
}
|
|
505
|
-
|
|
506
|
-
if (!
|
|
507
|
-
|
|
526
|
+
resolveCSRF(token, csrf) {
|
|
527
|
+
if (!csrf) {
|
|
528
|
+
if (token && this.cookieSrv.check(`${token}_${CSRF_COOKIE_NAME}`)) {
|
|
529
|
+
this.apiErrorsSrv.clear();
|
|
530
|
+
this.configuration.credentials.CSRF = this.cookieSrv.get(`${token}_${CSRF_COOKIE_NAME}`);
|
|
531
|
+
return true;
|
|
532
|
+
}
|
|
508
533
|
}
|
|
509
|
-
else
|
|
510
|
-
this.
|
|
534
|
+
else {
|
|
535
|
+
this.apiErrorsSrv.clear();
|
|
536
|
+
this.cookieSrv.set(`${token}_${CSRF_COOKIE_NAME}`, csrf, momentjs__default().add(24, 'hours').toDate(), undefined, undefined, this.environment.production);
|
|
537
|
+
this.configuration.credentials.CSRF = csrf;
|
|
538
|
+
return true;
|
|
511
539
|
}
|
|
512
|
-
return
|
|
513
|
-
|
|
540
|
+
return false;
|
|
541
|
+
}
|
|
542
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: CSRFResolver, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
543
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: CSRFResolver }); }
|
|
544
|
+
}
|
|
545
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: CSRFResolver, decorators: [{
|
|
546
|
+
type: Injectable
|
|
547
|
+
}], ctorParameters: () => [] });
|
|
548
|
+
|
|
549
|
+
class ErrorInterceptorService {
|
|
550
|
+
constructor() {
|
|
551
|
+
this.apiErrorSrv = inject(ApiErrorsService);
|
|
552
|
+
}
|
|
553
|
+
intercept(req, next) {
|
|
554
|
+
return next
|
|
555
|
+
.handle(req)
|
|
556
|
+
.pipe(catchError((err) => {
|
|
557
|
+
if (err.status === 404 || err.status === 500) {
|
|
558
|
+
this.apiErrorSrv.setLocalError();
|
|
559
|
+
}
|
|
560
|
+
return throwError(err);
|
|
561
|
+
}));
|
|
562
|
+
}
|
|
563
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: ErrorInterceptorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
564
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: ErrorInterceptorService }); }
|
|
565
|
+
}
|
|
566
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: ErrorInterceptorService, decorators: [{
|
|
567
|
+
type: Injectable
|
|
568
|
+
}], ctorParameters: () => [] });
|
|
569
|
+
|
|
570
|
+
const TRANSLATION_LANG_KEYS = {
|
|
571
|
+
[LANGUAGE.RU]: {
|
|
572
|
+
code: 'ru',
|
|
573
|
+
name: 'Русский',
|
|
574
|
+
countries: [
|
|
575
|
+
'AZ',
|
|
576
|
+
'AM',
|
|
577
|
+
'BY',
|
|
578
|
+
'KZ',
|
|
579
|
+
'KG',
|
|
580
|
+
'MD',
|
|
581
|
+
'RU',
|
|
582
|
+
'TJ',
|
|
583
|
+
'TM',
|
|
584
|
+
'UZ',
|
|
585
|
+
'UA',
|
|
586
|
+
],
|
|
587
|
+
},
|
|
588
|
+
[LANGUAGE.EN]: {
|
|
589
|
+
code: 'gb',
|
|
590
|
+
name: 'English',
|
|
591
|
+
countries: [],
|
|
592
|
+
},
|
|
593
|
+
[LANGUAGE.ES]: {
|
|
594
|
+
code: 'es',
|
|
595
|
+
name: 'Español',
|
|
596
|
+
countries: [
|
|
597
|
+
'BZ',
|
|
598
|
+
'GT',
|
|
599
|
+
'HN',
|
|
600
|
+
'CR',
|
|
601
|
+
'PA',
|
|
602
|
+
'NI',
|
|
603
|
+
'SV',
|
|
604
|
+
'AR',
|
|
605
|
+
'CL',
|
|
606
|
+
'CO',
|
|
607
|
+
'EC',
|
|
608
|
+
'PY',
|
|
609
|
+
'PE',
|
|
610
|
+
'GY',
|
|
611
|
+
'ES',
|
|
612
|
+
],
|
|
613
|
+
},
|
|
614
|
+
[LANGUAGE.TR]: {
|
|
615
|
+
code: 'tr',
|
|
616
|
+
name: 'Türkçe',
|
|
617
|
+
countries: ['TR'],
|
|
618
|
+
},
|
|
619
|
+
[LANGUAGE.PT]: {
|
|
620
|
+
code: 'pt',
|
|
621
|
+
name: 'Português',
|
|
622
|
+
countries: ['PT', 'BR'],
|
|
623
|
+
},
|
|
624
|
+
};
|
|
625
|
+
class TranslateLangStorageService {
|
|
626
|
+
constructor() {
|
|
627
|
+
this._storage = inject(LocalStorage);
|
|
628
|
+
this.versionSrv = inject(TERMINAL_VERSION_SERVICE_TOKEN);
|
|
629
|
+
this.document = inject(DOCUMENT);
|
|
630
|
+
this.translateSrv = inject(TranslateService);
|
|
631
|
+
this.TRANSLATION_LANG_KEYS = TRANSLATION_LANG_KEYS;
|
|
632
|
+
}
|
|
633
|
+
get languages() {
|
|
634
|
+
return this.versionSrv.langs || [LANGUAGE.RU, LANGUAGE.EN, LANGUAGE.PT, LANGUAGE.TR, LANGUAGE.ES];
|
|
635
|
+
}
|
|
636
|
+
get location() {
|
|
637
|
+
return this.document.defaultView.location;
|
|
638
|
+
}
|
|
639
|
+
get onLangChange$() {
|
|
640
|
+
return this.translateSrv.onLangChange;
|
|
641
|
+
}
|
|
642
|
+
get currentLang() {
|
|
643
|
+
return this.translateSrv.currentLang;
|
|
514
644
|
}
|
|
515
645
|
get queryLang() {
|
|
516
646
|
return new URL(this.location.href).searchParams.get('language');
|
|
517
647
|
}
|
|
518
|
-
|
|
519
|
-
const
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
this.setLanguage$(country, { save: false });
|
|
648
|
+
get countryLanguage() {
|
|
649
|
+
const code = this._storage.defaultCountry?.toUpperCase();
|
|
650
|
+
if (!code) {
|
|
651
|
+
return null;
|
|
523
652
|
}
|
|
524
|
-
return
|
|
653
|
+
return Object.keys(this.TRANSLATION_LANG_KEYS).find((lang) => {
|
|
654
|
+
const meta = this.TRANSLATION_LANG_KEYS[lang];
|
|
655
|
+
return meta?.countries.some((c) => c.includes(code.toUpperCase()));
|
|
656
|
+
});
|
|
657
|
+
}
|
|
658
|
+
setLanguage$(options = { save: true }) {
|
|
659
|
+
const availableLanguages = Object.keys(this.TRANSLATION_LANG_KEYS);
|
|
660
|
+
let candidateLang = DEFAULT_LANG;
|
|
661
|
+
const lang = options?.lang?.toLowerCase();
|
|
662
|
+
const queryLang = this.queryLang?.toLowerCase();
|
|
663
|
+
const storageLang = this._storage.defaultLang?.toLowerCase();
|
|
664
|
+
const countryLang = this.countryLanguage?.toLowerCase();
|
|
665
|
+
if (availableLanguages.includes(lang)) {
|
|
666
|
+
candidateLang = lang;
|
|
667
|
+
}
|
|
668
|
+
else if (availableLanguages.includes(storageLang)) {
|
|
669
|
+
candidateLang = storageLang;
|
|
670
|
+
}
|
|
671
|
+
else if (availableLanguages.includes(queryLang)) {
|
|
672
|
+
candidateLang = queryLang;
|
|
673
|
+
}
|
|
674
|
+
else if (availableLanguages.includes(countryLang)) {
|
|
675
|
+
candidateLang = countryLang;
|
|
676
|
+
}
|
|
677
|
+
if (!this.versionSrv.langs.includes(candidateLang)) {
|
|
678
|
+
candidateLang = DEFAULT_LANG;
|
|
679
|
+
}
|
|
680
|
+
if (options?.save) {
|
|
681
|
+
this._storage.saveDefaultLang(candidateLang);
|
|
682
|
+
}
|
|
683
|
+
return this.translateSrv.use(candidateLang);
|
|
525
684
|
}
|
|
526
685
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: TranslateLangStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
527
686
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: TranslateLangStorageService }); }
|
|
@@ -530,18 +689,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
530
689
|
type: Injectable
|
|
531
690
|
}], ctorParameters: () => [] });
|
|
532
691
|
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
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
|
+
}
|
|
539
704
|
|
|
540
|
-
|
|
541
|
-
(
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
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,
|
|
@@ -2107,163 +2256,62 @@ const FIELD_TEMPLATE = {
|
|
|
2107
2256
|
label: I18N_KEY.CONSTRUCTOR_LABEL_FIRSTNAME,
|
|
2108
2257
|
placeholder: I18N_KEY.CONSTRUCTOR_PLACEHOLDER_FIRSTNAME,
|
|
2109
2258
|
require: true,
|
|
2110
|
-
type: PaymentFieldTypeEnum.Text
|
|
2111
|
-
},
|
|
2112
|
-
SECOND_NAME: {
|
|
2113
|
-
name: 'add_last_name',
|
|
2114
|
-
label: I18N_KEY.CONSTRUCTOR_LABEL_LASTNAME,
|
|
2115
|
-
placeholder: I18N_KEY.CONSTRUCTOR_PLACEHOLDER_LASTNAME,
|
|
2116
|
-
require: true,
|
|
2117
|
-
type: PaymentFieldTypeEnum.Text
|
|
2118
|
-
},
|
|
2119
|
-
DATE_OF_BIRTH: {
|
|
2120
|
-
name: 'add_day_of_birth',
|
|
2121
|
-
label: I18N_KEY.CONSTRUCTOR_LABEL_DATEBIRTH,
|
|
2122
|
-
placeholder: '1993-04-20',
|
|
2123
|
-
require: true,
|
|
2124
|
-
mask: '0000-00-00',
|
|
2125
|
-
type: PaymentFieldTypeEnum.Date,
|
|
2126
|
-
options: {
|
|
2127
|
-
startCalendarDate: momentjs__default().subtract(18, 'years')
|
|
2128
|
-
}
|
|
2129
|
-
},
|
|
2130
|
-
ZIP: {
|
|
2131
|
-
name: 'add_zip',
|
|
2132
|
-
label: I18N_KEY.CONSTRUCTOR_LABEL_ZIP,
|
|
2133
|
-
placeholder: I18N_KEY.CONSTRUCTOR_PLACEHOLDER_ZIP,
|
|
2134
|
-
pattern: /\d{6}/,
|
|
2135
|
-
mask: '000000',
|
|
2136
|
-
maskValidation: true,
|
|
2137
|
-
readonly: false,
|
|
2138
|
-
require: true,
|
|
2139
|
-
type: PaymentFieldTypeEnum.Text
|
|
2140
|
-
},
|
|
2141
|
-
PHONE: PHONE_FIELD,
|
|
2142
|
-
PHONE_WALLET: castWallet(PHONE_FIELD),
|
|
2143
|
-
DOCUMENT_TYPE: {
|
|
2144
|
-
name: 'add_document_type',
|
|
2145
|
-
label: I18N_KEY.CONSTRUCTOR_LABEL_TYPEDOCUMENT,
|
|
2146
|
-
placeholder: I18N_KEY.CONSTRUCTOR_PLACEHOLDER_TYPEDOCUMENT,
|
|
2147
|
-
readonly: false,
|
|
2148
|
-
require: true,
|
|
2149
|
-
type: PaymentFieldTypeEnum.Select,
|
|
2150
|
-
options: {
|
|
2151
|
-
collection: CollectionType.Documents
|
|
2152
|
-
}
|
|
2153
|
-
},
|
|
2154
|
-
BANK_TYPE: {
|
|
2155
|
-
name: 'add_bank_id',
|
|
2156
|
-
label: I18N_KEY.CONSTRUCTOR_LABEL_BANK,
|
|
2157
|
-
placeholder: I18N_KEY.CONSTRUCTOR_PLACEHOLDER_BANK,
|
|
2158
|
-
readonly: false,
|
|
2159
|
-
require: true,
|
|
2160
|
-
type: PaymentFieldTypeEnum.Select,
|
|
2161
|
-
options: {
|
|
2162
|
-
collection: CollectionType.Banks
|
|
2163
|
-
}
|
|
2164
|
-
}
|
|
2165
|
-
};
|
|
2166
|
-
|
|
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
|
-
}
|
|
2259
|
+
type: PaymentFieldTypeEnum.Text
|
|
2260
|
+
},
|
|
2261
|
+
SECOND_NAME: {
|
|
2262
|
+
name: 'add_last_name',
|
|
2263
|
+
label: I18N_KEY.CONSTRUCTOR_LABEL_LASTNAME,
|
|
2264
|
+
placeholder: I18N_KEY.CONSTRUCTOR_PLACEHOLDER_LASTNAME,
|
|
2265
|
+
require: true,
|
|
2266
|
+
type: PaymentFieldTypeEnum.Text
|
|
2267
|
+
},
|
|
2268
|
+
DATE_OF_BIRTH: {
|
|
2269
|
+
name: 'add_day_of_birth',
|
|
2270
|
+
label: I18N_KEY.CONSTRUCTOR_LABEL_DATEBIRTH,
|
|
2271
|
+
placeholder: '1993-04-20',
|
|
2272
|
+
require: true,
|
|
2273
|
+
mask: '0000-00-00',
|
|
2274
|
+
type: PaymentFieldTypeEnum.Date,
|
|
2275
|
+
options: {
|
|
2276
|
+
startCalendarDate: momentjs__default().subtract(18, 'years')
|
|
2231
2277
|
}
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2278
|
+
},
|
|
2279
|
+
ZIP: {
|
|
2280
|
+
name: 'add_zip',
|
|
2281
|
+
label: I18N_KEY.CONSTRUCTOR_LABEL_ZIP,
|
|
2282
|
+
placeholder: I18N_KEY.CONSTRUCTOR_PLACEHOLDER_ZIP,
|
|
2283
|
+
pattern: /\d{6}/,
|
|
2284
|
+
mask: '000000',
|
|
2285
|
+
maskValidation: true,
|
|
2286
|
+
readonly: false,
|
|
2287
|
+
require: true,
|
|
2288
|
+
type: PaymentFieldTypeEnum.Text
|
|
2289
|
+
},
|
|
2290
|
+
PHONE: PHONE_FIELD,
|
|
2291
|
+
PHONE_WALLET: castWallet(PHONE_FIELD),
|
|
2292
|
+
DOCUMENT_TYPE: {
|
|
2293
|
+
name: 'add_document_type',
|
|
2294
|
+
label: I18N_KEY.CONSTRUCTOR_LABEL_TYPEDOCUMENT,
|
|
2295
|
+
placeholder: I18N_KEY.CONSTRUCTOR_PLACEHOLDER_TYPEDOCUMENT,
|
|
2296
|
+
readonly: false,
|
|
2297
|
+
require: true,
|
|
2298
|
+
type: PaymentFieldTypeEnum.Select,
|
|
2299
|
+
options: {
|
|
2300
|
+
collection: CollectionType.Documents
|
|
2301
|
+
}
|
|
2302
|
+
},
|
|
2303
|
+
BANK_TYPE: {
|
|
2304
|
+
name: 'add_bank_id',
|
|
2305
|
+
label: I18N_KEY.CONSTRUCTOR_LABEL_BANK,
|
|
2306
|
+
placeholder: I18N_KEY.CONSTRUCTOR_PLACEHOLDER_BANK,
|
|
2307
|
+
readonly: false,
|
|
2308
|
+
require: true,
|
|
2309
|
+
type: PaymentFieldTypeEnum.Select,
|
|
2310
|
+
options: {
|
|
2311
|
+
collection: CollectionType.Banks
|
|
2237
2312
|
}
|
|
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
2313
|
}
|
|
2261
|
-
|
|
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: () => [] });
|
|
2314
|
+
};
|
|
2267
2315
|
|
|
2268
2316
|
const advcash = {
|
|
2269
2317
|
confirmation: '',
|
|
@@ -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,9 +3483,9 @@ 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
|
-
this.loadingConfirm$ = new BehaviorSubject(
|
|
3488
|
+
this.loadingConfirm$ = new BehaviorSubject(null);
|
|
3432
3489
|
this.configurations = new Map();
|
|
3433
3490
|
this.feeChangeable = !!this.terminalApi.getFee;
|
|
3434
3491
|
}
|
|
@@ -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({
|
|
@@ -3528,18 +3585,19 @@ class SessionDataSource {
|
|
|
3528
3585
|
this.payment_token = method.payment_token;
|
|
3529
3586
|
}
|
|
3530
3587
|
this.loadingMethodInfo$.next(false);
|
|
3588
|
+
this.loadingConfirm$.next(false);
|
|
3531
3589
|
}));
|
|
3532
3590
|
}
|
|
3533
3591
|
catchError(loading$) {
|
|
3534
3592
|
return (err) => {
|
|
3535
|
-
this.apiErrorsSrv.
|
|
3593
|
+
this.apiErrorsSrv.setLocalError(err.error);
|
|
3536
3594
|
loading$?.next(false);
|
|
3537
3595
|
this.cd.markForCheck();
|
|
3538
3596
|
return throwError(err);
|
|
3539
3597
|
};
|
|
3540
3598
|
}
|
|
3541
3599
|
prepare(data) {
|
|
3542
|
-
if (this.loadingConfirm$.getValue()
|
|
3600
|
+
if (!this.loadingConfirm$.getValue()) {
|
|
3543
3601
|
this.loadingConfirm$.next(true);
|
|
3544
3602
|
}
|
|
3545
3603
|
return this.terminalApi
|
|
@@ -3547,10 +3605,10 @@ class SessionDataSource {
|
|
|
3547
3605
|
token: this.token,
|
|
3548
3606
|
terminalPaymentPrepareRequest: data
|
|
3549
3607
|
})
|
|
3550
|
-
.pipe(catchError(this.catchError(this.loadingConfirm$)), tap(() => this.loadingConfirm$.next(false)));
|
|
3608
|
+
.pipe(delay(2000), catchError(this.catchError(this.loadingConfirm$)), tap(() => this.loadingConfirm$.next(false)));
|
|
3551
3609
|
}
|
|
3552
3610
|
confirm() {
|
|
3553
|
-
if (this.loadingConfirm$.getValue()
|
|
3611
|
+
if (!this.loadingConfirm$.getValue()) {
|
|
3554
3612
|
this.loadingConfirm$.next(true);
|
|
3555
3613
|
}
|
|
3556
3614
|
return this.terminalApi
|
|
@@ -3567,7 +3625,7 @@ class SessionDataSource {
|
|
|
3567
3625
|
}));
|
|
3568
3626
|
}
|
|
3569
3627
|
close() {
|
|
3570
|
-
if (this.loadingConfirm$.getValue()
|
|
3628
|
+
if (!this.loadingConfirm$.getValue()) {
|
|
3571
3629
|
this.loadingConfirm$.next(true);
|
|
3572
3630
|
}
|
|
3573
3631
|
return this.terminalApi
|
|
@@ -3577,7 +3635,7 @@ class SessionDataSource {
|
|
|
3577
3635
|
.pipe(catchError(this.catchError(this.loadingConfirm$)), map(() => {
|
|
3578
3636
|
if (!this.returnBack()) {
|
|
3579
3637
|
const error = { code: I18N_KEY.SESSION_CLOSED };
|
|
3580
|
-
this.apiErrorsSrv.
|
|
3638
|
+
this.apiErrorsSrv.setLocalError(error);
|
|
3581
3639
|
this.loadingConfirm$?.next(false);
|
|
3582
3640
|
this.cd.markForCheck();
|
|
3583
3641
|
throw error;
|
|
@@ -3618,7 +3676,7 @@ class ScriptLoader {
|
|
|
3618
3676
|
this.document = inject(DOCUMENT);
|
|
3619
3677
|
this.nonce = inject(CSP_NONCE);
|
|
3620
3678
|
this.environment = inject(ENVIRONMENT);
|
|
3621
|
-
this.
|
|
3679
|
+
this.SCRIPT_HASH_MAP = new Map([
|
|
3622
3680
|
[
|
|
3623
3681
|
'cde_sdk',
|
|
3624
3682
|
this.environment.production ? {
|
|
@@ -3631,9 +3689,6 @@ class ScriptLoader {
|
|
|
3631
3689
|
]
|
|
3632
3690
|
]);
|
|
3633
3691
|
}
|
|
3634
|
-
get window() {
|
|
3635
|
-
return this.document.defaultView;
|
|
3636
|
-
}
|
|
3637
3692
|
fetchScript(id) {
|
|
3638
3693
|
return new Promise((resolve, reject) => {
|
|
3639
3694
|
let script;
|
|
@@ -3661,7 +3716,7 @@ class ScriptLoader {
|
|
|
3661
3716
|
script = template.content.children.item(0);
|
|
3662
3717
|
}
|
|
3663
3718
|
else {
|
|
3664
|
-
const { src, hash } = this.
|
|
3719
|
+
const { src, hash } = this.SCRIPT_HASH_MAP.get(id);
|
|
3665
3720
|
script = this.document.createElement('script');
|
|
3666
3721
|
script.type = 'text/javascript';
|
|
3667
3722
|
script.src = src;
|
|
@@ -3674,7 +3729,7 @@ class ScriptLoader {
|
|
|
3674
3729
|
script.nonce = this.nonce;
|
|
3675
3730
|
script.onload = () => resolve();
|
|
3676
3731
|
script.onerror = (err) => reject(err);
|
|
3677
|
-
this.document.body.
|
|
3732
|
+
this.document.body.appendChild(script);
|
|
3678
3733
|
});
|
|
3679
3734
|
}
|
|
3680
3735
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: ScriptLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
@@ -3684,6 +3739,80 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
3684
3739
|
type: Injectable
|
|
3685
3740
|
}] });
|
|
3686
3741
|
|
|
3742
|
+
loadI18NData();
|
|
3743
|
+
class TerminalModule {
|
|
3744
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: TerminalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
3745
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.2", ngImport: i0, type: TerminalModule, imports: [i1.RouterModule] }); }
|
|
3746
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: TerminalModule, imports: [RouterModule.forChild([
|
|
3747
|
+
{
|
|
3748
|
+
path: '',
|
|
3749
|
+
loadChildren: () => Promise.resolve().then(function () { return pages_module; })
|
|
3750
|
+
},
|
|
3751
|
+
{
|
|
3752
|
+
path: 'checkin',
|
|
3753
|
+
loadChildren: () => Promise.resolve().then(function () { return checkin_module; }).then(m => m.CheckinModule)
|
|
3754
|
+
},
|
|
3755
|
+
{
|
|
3756
|
+
path: '**',
|
|
3757
|
+
redirectTo: ''
|
|
3758
|
+
}
|
|
3759
|
+
])] }); }
|
|
3760
|
+
}
|
|
3761
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: TerminalModule, decorators: [{
|
|
3762
|
+
type: NgModule,
|
|
3763
|
+
args: [{
|
|
3764
|
+
imports: [
|
|
3765
|
+
RouterModule.forChild([
|
|
3766
|
+
{
|
|
3767
|
+
path: '',
|
|
3768
|
+
loadChildren: () => Promise.resolve().then(function () { return pages_module; })
|
|
3769
|
+
},
|
|
3770
|
+
{
|
|
3771
|
+
path: 'checkin',
|
|
3772
|
+
loadChildren: () => Promise.resolve().then(function () { return checkin_module; }).then(m => m.CheckinModule)
|
|
3773
|
+
},
|
|
3774
|
+
{
|
|
3775
|
+
path: '**',
|
|
3776
|
+
redirectTo: ''
|
|
3777
|
+
}
|
|
3778
|
+
])
|
|
3779
|
+
]
|
|
3780
|
+
}]
|
|
3781
|
+
}] });
|
|
3782
|
+
const provideTerminal = () => {
|
|
3783
|
+
return [
|
|
3784
|
+
TranslateLangStorageService,
|
|
3785
|
+
{
|
|
3786
|
+
provide: I18N_COUNTRIES,
|
|
3787
|
+
useValue: {
|
|
3788
|
+
ru: getNames(LANGUAGE.RU),
|
|
3789
|
+
lt: getNames(LANGUAGE.LT),
|
|
3790
|
+
en: getNames(LANGUAGE.EN),
|
|
3791
|
+
es: getNames(LANGUAGE.ES),
|
|
3792
|
+
tr: getNames(LANGUAGE.TR),
|
|
3793
|
+
pt: getNames(LANGUAGE.PT)
|
|
3794
|
+
}
|
|
3795
|
+
},
|
|
3796
|
+
ApiErrorsService,
|
|
3797
|
+
ScriptLoader
|
|
3798
|
+
];
|
|
3799
|
+
};
|
|
3800
|
+
|
|
3801
|
+
class FeeTemplateDirective {
|
|
3802
|
+
constructor() {
|
|
3803
|
+
this.tml = inject(TemplateRef);
|
|
3804
|
+
}
|
|
3805
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: FeeTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3806
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.2", type: FeeTemplateDirective, isStandalone: true, selector: "[terminalFee]", ngImport: i0 }); }
|
|
3807
|
+
}
|
|
3808
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: FeeTemplateDirective, decorators: [{
|
|
3809
|
+
type: Directive,
|
|
3810
|
+
args: [{
|
|
3811
|
+
selector: '[terminalFee]',
|
|
3812
|
+
standalone: true
|
|
3813
|
+
}]
|
|
3814
|
+
}] });
|
|
3815
|
+
|
|
3687
3816
|
class TerminalTplComponent {
|
|
3688
3817
|
constructor() {
|
|
3689
3818
|
this.router = inject(Router);
|
|
@@ -3698,16 +3827,9 @@ class TerminalTplComponent {
|
|
|
3698
3827
|
FocusHandler.previousEnabled(ev);
|
|
3699
3828
|
}
|
|
3700
3829
|
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
|
-
});
|
|
3830
|
+
this.navigationEnd$()
|
|
3831
|
+
.pipe(switchMap(() => this.langStorage.setLanguage$({ save: false })), switchMap(() => hideInitLoader()), first(), takeUntil(this.unSubscriber))
|
|
3832
|
+
.subscribe(() => this.ready$.next(true));
|
|
3711
3833
|
}
|
|
3712
3834
|
navigationEnd$() {
|
|
3713
3835
|
if (this.router.navigated) {
|
|
@@ -3721,14 +3843,17 @@ class TerminalTplComponent {
|
|
|
3721
3843
|
this.unSubscriber.unsubscribe();
|
|
3722
3844
|
}
|
|
3723
3845
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: TerminalTplComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3724
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.2", type: TerminalTplComponent, isStandalone: true, selector: "terminal
|
|
3846
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.2", type: TerminalTplComponent, isStandalone: true, selector: "terminal", host: { listeners: { "document:keydown.arrowDown": "next($event,$event.currentTarget)", "document:keydown.arrowUp": "prev($event,$event.currentTarget)" }, classAttribute: "trm" }, queries: [{ propertyName: "feeTpl", first: true, predicate: FeeTemplateDirective, descendants: true, read: TemplateRef }], ngImport: i0, template: "@if (ready$ | async) {\r\n <div class=\"app__container\">\r\n <router-outlet></router-outlet>\r\n </div>\r\n}\r\n", styles: [""], dependencies: [{ kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "pipe", type: AsyncPipe, name: "async" }] }); }
|
|
3725
3847
|
}
|
|
3726
3848
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: TerminalTplComponent, decorators: [{
|
|
3727
3849
|
type: Component,
|
|
3728
|
-
args: [{ selector: 'terminal
|
|
3850
|
+
args: [{ selector: 'terminal', host: {
|
|
3729
3851
|
class: 'trm'
|
|
3730
3852
|
}, standalone: true, imports: [RouterOutlet, AsyncPipe], template: "@if (ready$ | async) {\r\n <div class=\"app__container\">\r\n <router-outlet></router-outlet>\r\n </div>\r\n}\r\n" }]
|
|
3731
|
-
}], propDecorators: {
|
|
3853
|
+
}], propDecorators: { feeTpl: [{
|
|
3854
|
+
type: ContentChild,
|
|
3855
|
+
args: [FeeTemplateDirective, { read: TemplateRef, static: false }]
|
|
3856
|
+
}], next: [{
|
|
3732
3857
|
type: HostListener,
|
|
3733
3858
|
args: ['document:keydown.arrowDown', ['$event', '$event.currentTarget']]
|
|
3734
3859
|
}], prev: [{
|
|
@@ -3736,98 +3861,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
3736
3861
|
args: ['document:keydown.arrowUp', ['$event', '$event.currentTarget']]
|
|
3737
3862
|
}] } });
|
|
3738
3863
|
|
|
3739
|
-
var terminalTpl_component = /*#__PURE__*/Object.freeze({
|
|
3740
|
-
__proto__: null,
|
|
3741
|
-
TerminalTplComponent: TerminalTplComponent
|
|
3742
|
-
});
|
|
3743
|
-
|
|
3744
|
-
loadI18NData();
|
|
3745
|
-
class TerminalModule {
|
|
3746
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: TerminalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
3747
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.2", ngImport: i0, type: TerminalModule, imports: [CommonModule, i1.RouterModule, TerminalTplComponent] }); }
|
|
3748
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: TerminalModule, providers: [
|
|
3749
|
-
TranslateLangStorageService,
|
|
3750
|
-
{
|
|
3751
|
-
provide: I18N_COUNTRIES,
|
|
3752
|
-
useValue: {
|
|
3753
|
-
ru: getNames(LANGUAGE.RU),
|
|
3754
|
-
lt: getNames(LANGUAGE.LT),
|
|
3755
|
-
en: getNames(LANGUAGE.EN),
|
|
3756
|
-
es: getNames(LANGUAGE.ES),
|
|
3757
|
-
tr: getNames(LANGUAGE.TR),
|
|
3758
|
-
pt: getNames(LANGUAGE.PT)
|
|
3759
|
-
}
|
|
3760
|
-
},
|
|
3761
|
-
ApiErrorsService,
|
|
3762
|
-
ScriptLoader
|
|
3763
|
-
], imports: [CommonModule,
|
|
3764
|
-
RouterModule.forChild([
|
|
3765
|
-
{
|
|
3766
|
-
path: '',
|
|
3767
|
-
loadComponent: () => Promise.resolve().then(function () { return terminalTpl_component; }).then(m => m.TerminalTplComponent),
|
|
3768
|
-
children: [
|
|
3769
|
-
{
|
|
3770
|
-
path: '',
|
|
3771
|
-
loadChildren: () => Promise.resolve().then(function () { return pages_module; })
|
|
3772
|
-
},
|
|
3773
|
-
{
|
|
3774
|
-
path: 'checkin',
|
|
3775
|
-
loadChildren: () => Promise.resolve().then(function () { return checkin_module; }).then(m => m.CheckinModule)
|
|
3776
|
-
},
|
|
3777
|
-
{
|
|
3778
|
-
path: '**',
|
|
3779
|
-
redirectTo: ''
|
|
3780
|
-
}
|
|
3781
|
-
]
|
|
3782
|
-
}
|
|
3783
|
-
])] }); }
|
|
3784
|
-
}
|
|
3785
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: TerminalModule, decorators: [{
|
|
3786
|
-
type: NgModule,
|
|
3787
|
-
args: [{
|
|
3788
|
-
imports: [
|
|
3789
|
-
CommonModule,
|
|
3790
|
-
RouterModule.forChild([
|
|
3791
|
-
{
|
|
3792
|
-
path: '',
|
|
3793
|
-
loadComponent: () => Promise.resolve().then(function () { return terminalTpl_component; }).then(m => m.TerminalTplComponent),
|
|
3794
|
-
children: [
|
|
3795
|
-
{
|
|
3796
|
-
path: '',
|
|
3797
|
-
loadChildren: () => Promise.resolve().then(function () { return pages_module; })
|
|
3798
|
-
},
|
|
3799
|
-
{
|
|
3800
|
-
path: 'checkin',
|
|
3801
|
-
loadChildren: () => Promise.resolve().then(function () { return checkin_module; }).then(m => m.CheckinModule)
|
|
3802
|
-
},
|
|
3803
|
-
{
|
|
3804
|
-
path: '**',
|
|
3805
|
-
redirectTo: ''
|
|
3806
|
-
}
|
|
3807
|
-
]
|
|
3808
|
-
}
|
|
3809
|
-
]),
|
|
3810
|
-
TerminalTplComponent
|
|
3811
|
-
],
|
|
3812
|
-
providers: [
|
|
3813
|
-
TranslateLangStorageService,
|
|
3814
|
-
{
|
|
3815
|
-
provide: I18N_COUNTRIES,
|
|
3816
|
-
useValue: {
|
|
3817
|
-
ru: getNames(LANGUAGE.RU),
|
|
3818
|
-
lt: getNames(LANGUAGE.LT),
|
|
3819
|
-
en: getNames(LANGUAGE.EN),
|
|
3820
|
-
es: getNames(LANGUAGE.ES),
|
|
3821
|
-
tr: getNames(LANGUAGE.TR),
|
|
3822
|
-
pt: getNames(LANGUAGE.PT)
|
|
3823
|
-
}
|
|
3824
|
-
},
|
|
3825
|
-
ApiErrorsService,
|
|
3826
|
-
ScriptLoader
|
|
3827
|
-
]
|
|
3828
|
-
}]
|
|
3829
|
-
}] });
|
|
3830
|
-
|
|
3831
3864
|
class TrmSelectLabelTemplateDirective {
|
|
3832
3865
|
constructor() {
|
|
3833
3866
|
this.tpl = inject(TemplateRef);
|
|
@@ -4123,14 +4156,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
4123
4156
|
|
|
4124
4157
|
class TerminalLangSwitcherComponent {
|
|
4125
4158
|
get translation_keys() {
|
|
4126
|
-
return this.langStorageSrv.
|
|
4159
|
+
return this.langStorageSrv.TRANSLATION_LANG_KEYS;
|
|
4127
4160
|
}
|
|
4128
4161
|
constructor() {
|
|
4162
|
+
this.versionSrv = inject(TERMINAL_VERSION_SERVICE_TOKEN);
|
|
4129
4163
|
this.langStorageSrv = inject(TranslateLangStorageService);
|
|
4130
4164
|
this.cd = inject(ChangeDetectorRef);
|
|
4131
4165
|
this.unSubscriber = new Subject();
|
|
4132
4166
|
this.loading = false;
|
|
4133
|
-
this.
|
|
4167
|
+
this.langChange = new EventEmitter();
|
|
4134
4168
|
this.tabIndex = 0;
|
|
4135
4169
|
this.langStorageSrv.onLangChange$
|
|
4136
4170
|
.pipe(takeUntil(this.unSubscriber))
|
|
@@ -4140,26 +4174,26 @@ class TerminalLangSwitcherComponent {
|
|
|
4140
4174
|
return this.langStorageSrv.currentLang;
|
|
4141
4175
|
}
|
|
4142
4176
|
get langs() {
|
|
4143
|
-
return
|
|
4177
|
+
return this.versionSrv.langs;
|
|
4144
4178
|
}
|
|
4145
4179
|
changeLang(lang) {
|
|
4146
|
-
this.langStorageSrv.setLanguage$(lang);
|
|
4180
|
+
this.langStorageSrv.setLanguage$({ lang, save: true });
|
|
4147
4181
|
this.cd.markForCheck();
|
|
4148
|
-
this.
|
|
4182
|
+
this.langChange.emit(lang);
|
|
4149
4183
|
}
|
|
4150
4184
|
ngOnDestroy() {
|
|
4151
4185
|
this.unSubscriber.next();
|
|
4152
4186
|
this.unSubscriber.unsubscribe();
|
|
4153
4187
|
}
|
|
4154
4188
|
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: {
|
|
4189
|
+
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
4190
|
}
|
|
4157
4191
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: TerminalLangSwitcherComponent, decorators: [{
|
|
4158
4192
|
type: Component,
|
|
4159
4193
|
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
4194
|
}], ctorParameters: () => [], propDecorators: { loading: [{
|
|
4161
4195
|
type: Input
|
|
4162
|
-
}],
|
|
4196
|
+
}], langChange: [{
|
|
4163
4197
|
type: Output
|
|
4164
4198
|
}], tabIndex: [{
|
|
4165
4199
|
type: Input
|
|
@@ -4169,14 +4203,14 @@ class TerminalLayoutTplComponent {
|
|
|
4169
4203
|
constructor() {
|
|
4170
4204
|
this.versionSrv = inject(TERMINAL_VERSION_SERVICE_TOKEN);
|
|
4171
4205
|
this.document = inject(DOCUMENT);
|
|
4172
|
-
this.
|
|
4206
|
+
this.translateSrv = inject(TranslateService);
|
|
4173
4207
|
this.cd = inject(ChangeDetectorRef);
|
|
4174
4208
|
this.translateStorageSrv = inject(TranslateLangStorageService);
|
|
4175
4209
|
this.unSubscriber = new Subject();
|
|
4176
4210
|
this.loading = true;
|
|
4177
|
-
this.
|
|
4211
|
+
this.translateSrv.onLangChange
|
|
4178
4212
|
.pipe(takeUntil(this.unSubscriber))
|
|
4179
|
-
.subscribe((
|
|
4213
|
+
.subscribe(() => {
|
|
4180
4214
|
this.cd.detectChanges();
|
|
4181
4215
|
});
|
|
4182
4216
|
}
|
|
@@ -4194,7 +4228,7 @@ class TerminalLayoutTplComponent {
|
|
|
4194
4228
|
this.unSubscriber.unsubscribe();
|
|
4195
4229
|
}
|
|
4196
4230
|
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: ["
|
|
4231
|
+
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
4232
|
}
|
|
4199
4233
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: TerminalLayoutTplComponent, decorators: [{
|
|
4200
4234
|
type: Component,
|
|
@@ -4378,18 +4412,20 @@ function removeEmptyProps(obj, options = { nullValue: true }) {
|
|
|
4378
4412
|
class ConstructorFormService extends FormGroup {
|
|
4379
4413
|
constructor() {
|
|
4380
4414
|
super({
|
|
4381
|
-
country: new FormControl(),
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4415
|
+
country: new FormControl(undefined, Validators.required),
|
|
4416
|
+
method: new FormControl(undefined, Validators.required),
|
|
4417
|
+
currency: new FormControl(undefined, Validators.required),
|
|
4418
|
+
user_currency: new FormControl(undefined, Validators.required),
|
|
4385
4419
|
payment: new FormGroup({})
|
|
4386
4420
|
});
|
|
4387
4421
|
this.sessionDS = inject(SessionDataSource);
|
|
4388
4422
|
this.cd = inject(ChangeDetectorRef);
|
|
4389
4423
|
this.configurationFactory = inject(TERMINAL_METHOD_CONFIGURATION_FACTORY, { optional: true }) || ((method, defaultConfig) => defaultConfig);
|
|
4424
|
+
this._storage = inject(LocalStorage);
|
|
4390
4425
|
this.cancelRequestsSubscriber = new Subject();
|
|
4391
4426
|
this.unSubscriber = new Subject();
|
|
4392
4427
|
this.fields = [];
|
|
4428
|
+
this.ready = false;
|
|
4393
4429
|
this.amountDynamic = false;
|
|
4394
4430
|
}
|
|
4395
4431
|
get methodInfoLoading() {
|
|
@@ -4409,6 +4445,8 @@ class ConstructorFormService extends FormGroup {
|
|
|
4409
4445
|
.forEach((controlName) => this.payment.removeControl(controlName));
|
|
4410
4446
|
}
|
|
4411
4447
|
init() {
|
|
4448
|
+
this.ready = false;
|
|
4449
|
+
this.cd.detectChanges();
|
|
4412
4450
|
if (this.configurationFactory) {
|
|
4413
4451
|
this.config = this.configurationFactory(this.methodName, this.sessionDS.getConfiguration(this.methodName));
|
|
4414
4452
|
}
|
|
@@ -4428,7 +4466,10 @@ class ConstructorFormService extends FormGroup {
|
|
|
4428
4466
|
if (!field.name) {
|
|
4429
4467
|
return;
|
|
4430
4468
|
}
|
|
4431
|
-
const control = new FormControl(
|
|
4469
|
+
const control = new FormControl({
|
|
4470
|
+
value: field.type === PaymentFieldTypeEnum.Iframe ? undefined : null,
|
|
4471
|
+
disabled: false,
|
|
4472
|
+
});
|
|
4432
4473
|
const validators = [];
|
|
4433
4474
|
this.amountDynamic = methodInfo.amountDynamic;
|
|
4434
4475
|
const isEditable = !methodInfo.amountDynamic && this.isAmountEditable();
|
|
@@ -4507,15 +4548,13 @@ class ConstructorFormService extends FormGroup {
|
|
|
4507
4548
|
validators.push(field.validator(this.payment));
|
|
4508
4549
|
}
|
|
4509
4550
|
control.setValidators(validators);
|
|
4510
|
-
|
|
4511
|
-
this.payment.addControl(field.name, control);
|
|
4512
|
-
}
|
|
4551
|
+
this.payment.addControl(field.name, control);
|
|
4513
4552
|
this.fetchCollection(field)
|
|
4514
4553
|
.subscribe(() => {
|
|
4515
4554
|
control.updateValueAndValidity();
|
|
4516
4555
|
});
|
|
4517
4556
|
});
|
|
4518
|
-
|
|
4557
|
+
this.ready = true;
|
|
4519
4558
|
}
|
|
4520
4559
|
fetchCollection(field) {
|
|
4521
4560
|
const EMPTY_LIST = of([]).pipe(first());
|
|
@@ -4573,22 +4612,22 @@ class ConstructorFormService extends FormGroup {
|
|
|
4573
4612
|
return this.sessionDS.getTypeNameById(id);
|
|
4574
4613
|
}
|
|
4575
4614
|
saveDefaultCountry() {
|
|
4576
|
-
this.
|
|
4577
|
-
}
|
|
4578
|
-
get defaultCountry() {
|
|
4579
|
-
return this.sessionDS.document.defaultView.localStorage.getItem(DEFAULT_COUNTRY_LOCALHOST_KEY);
|
|
4615
|
+
this._storage.saveDefaultCountry(this.country.value);
|
|
4580
4616
|
}
|
|
4581
4617
|
saveDefaultMethodName() {
|
|
4582
|
-
this.
|
|
4583
|
-
}
|
|
4584
|
-
get defaultMethodName() {
|
|
4585
|
-
return this.sessionDS.document.defaultView.localStorage.getItem(DEFAULT_METHOD_LOCALHOST_KEY);
|
|
4618
|
+
this._storage.saveDefaultMethodName(this.methodName);
|
|
4586
4619
|
}
|
|
4587
4620
|
saveDefaultCurrency() {
|
|
4588
|
-
this.
|
|
4621
|
+
this._storage.saveDefaultCurrency(this.currency.value);
|
|
4622
|
+
}
|
|
4623
|
+
get defaultCountry() {
|
|
4624
|
+
return this._storage.defaultCountry;
|
|
4625
|
+
}
|
|
4626
|
+
get defaultMethodName() {
|
|
4627
|
+
return this._storage.defaultMethodName;
|
|
4589
4628
|
}
|
|
4590
4629
|
get defaultCurrency() {
|
|
4591
|
-
return this.
|
|
4630
|
+
return this._storage.defaultCurrency;
|
|
4592
4631
|
}
|
|
4593
4632
|
cancelRequests() {
|
|
4594
4633
|
this.cancelRequestsSubscriber.next();
|
|
@@ -4608,6 +4647,18 @@ class ConstructorFormService extends FormGroup {
|
|
|
4608
4647
|
});
|
|
4609
4648
|
return removeEmptyProps(data);
|
|
4610
4649
|
}
|
|
4650
|
+
updateValueAndValidityIframes() {
|
|
4651
|
+
this.fields.forEach(({ name, type }) => {
|
|
4652
|
+
if (type === PaymentFieldTypeEnum.Iframe) {
|
|
4653
|
+
this.payment.get(name).updateValueAndValidity({ emitEvent: false });
|
|
4654
|
+
}
|
|
4655
|
+
});
|
|
4656
|
+
}
|
|
4657
|
+
get readyIframesSubmit() {
|
|
4658
|
+
return this.fields
|
|
4659
|
+
.filter(({ type }) => type !== PaymentFieldTypeEnum.Iframe)
|
|
4660
|
+
.every(({ name, type }) => !this.payment.get(name).invalid);
|
|
4661
|
+
}
|
|
4611
4662
|
isAmountEditable() {
|
|
4612
4663
|
return this.sessionDS.getSessionValue().amountEditable;
|
|
4613
4664
|
}
|
|
@@ -4638,9 +4689,6 @@ class ConstructorFormService extends FormGroup {
|
|
|
4638
4689
|
});
|
|
4639
4690
|
this.updateValueAndValidity({ emitEvent: false });
|
|
4640
4691
|
}
|
|
4641
|
-
get isCDEFailed() {
|
|
4642
|
-
return this.hasError('cde_error');
|
|
4643
|
-
}
|
|
4644
4692
|
distinctValueChanges() {
|
|
4645
4693
|
return this.valueChanges.pipe(debounceTime(300), distinctUntilChanged((prev, curr) => {
|
|
4646
4694
|
if (!prev ||
|
|
@@ -4651,7 +4699,7 @@ class ConstructorFormService extends FormGroup {
|
|
|
4651
4699
|
return (prev.country === curr.country &&
|
|
4652
4700
|
prev.method === curr.method &&
|
|
4653
4701
|
prev.currency === curr.currency &&
|
|
4654
|
-
|
|
4702
|
+
prev.payment.amount === curr.payment.amount);
|
|
4655
4703
|
}));
|
|
4656
4704
|
}
|
|
4657
4705
|
ngOnDestroy() {
|
|
@@ -4710,140 +4758,237 @@ class CountriesSortPipe {
|
|
|
4710
4758
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: CountriesSortPipe, decorators: [{
|
|
4711
4759
|
type: Pipe,
|
|
4712
4760
|
args: [{
|
|
4713
|
-
name: 'countries_sort',
|
|
4714
|
-
pure: true,
|
|
4715
|
-
standalone: true
|
|
4761
|
+
name: 'countries_sort',
|
|
4762
|
+
pure: true,
|
|
4763
|
+
standalone: true
|
|
4764
|
+
}]
|
|
4765
|
+
}], ctorParameters: () => [] });
|
|
4766
|
+
|
|
4767
|
+
class CardSdkService {
|
|
4768
|
+
constructor() {
|
|
4769
|
+
this.scriptLoaderSrv = inject(ScriptLoader);
|
|
4770
|
+
this.sessionSrv = inject(SessionDataSource);
|
|
4771
|
+
this._pending = false;
|
|
4772
|
+
this._submitted = false;
|
|
4773
|
+
}
|
|
4774
|
+
markAsReady() {
|
|
4775
|
+
this._pending = false;
|
|
4776
|
+
}
|
|
4777
|
+
markAsSubmitted() {
|
|
4778
|
+
this._submitted = true;
|
|
4779
|
+
}
|
|
4780
|
+
get pending() {
|
|
4781
|
+
return this._pending;
|
|
4782
|
+
}
|
|
4783
|
+
submit() {
|
|
4784
|
+
if (!this._submitted && this._sdk) {
|
|
4785
|
+
this._sdk.submit();
|
|
4786
|
+
this._pending = true;
|
|
4787
|
+
}
|
|
4788
|
+
}
|
|
4789
|
+
get _ready$() {
|
|
4790
|
+
return fromPromise(this.scriptLoaderSrv.fetchScript('cde_sdk'));
|
|
4791
|
+
}
|
|
4792
|
+
createCardTerminalSdk$(lang, id, tabindex) {
|
|
4793
|
+
return this._ready$.pipe(map(() => (this._sdk = this.sessionSrv.createCardTerminalSdk(lang, id, tabindex))));
|
|
4794
|
+
}
|
|
4795
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: CardSdkService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4796
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: CardSdkService }); }
|
|
4797
|
+
}
|
|
4798
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: CardSdkService, decorators: [{
|
|
4799
|
+
type: Injectable
|
|
4800
|
+
}] });
|
|
4801
|
+
|
|
4802
|
+
class IframeValidatorDirectiveDirective {
|
|
4803
|
+
constructor() {
|
|
4804
|
+
this.cardSdkSrv = inject(CardSdkService);
|
|
4805
|
+
this.submitting$ = new Subject();
|
|
4806
|
+
this._validationSdkError = false;
|
|
4807
|
+
}
|
|
4808
|
+
registerSDK(sdk) {
|
|
4809
|
+
if (!sdk) {
|
|
4810
|
+
this._fatalError = I18N_KEY.ERROR_OCCUR_SDK;
|
|
4811
|
+
}
|
|
4812
|
+
else {
|
|
4813
|
+
this._sdk = sdk;
|
|
4814
|
+
this.handleSubmitting();
|
|
4815
|
+
}
|
|
4816
|
+
}
|
|
4817
|
+
handleSubmitting() {
|
|
4818
|
+
this._sdk.onInputPending(() => {
|
|
4819
|
+
this._validationSdkError = true;
|
|
4820
|
+
});
|
|
4821
|
+
this._sdk.onError((code) => {
|
|
4822
|
+
this._validationSdkError = false;
|
|
4823
|
+
let codeError = I18N_KEY.ERROR_OCCUR;
|
|
4824
|
+
if (code === 501) {
|
|
4825
|
+
codeError = I18N_KEY.CDE_CARD_ERROR_501;
|
|
4826
|
+
}
|
|
4827
|
+
else if (code === 500) {
|
|
4828
|
+
codeError = I18N_KEY.CDE_CARD_ERROR_500;
|
|
4829
|
+
}
|
|
4830
|
+
else if (code === 504) {
|
|
4831
|
+
codeError = I18N_KEY.CDE_CARD_ERROR_504;
|
|
4832
|
+
}
|
|
4833
|
+
this._fatalError = codeError;
|
|
4834
|
+
});
|
|
4835
|
+
this._sdk.onInputReady(() => {
|
|
4836
|
+
this._validationSdkError = false;
|
|
4837
|
+
this.submitting$.next(null);
|
|
4838
|
+
});
|
|
4839
|
+
this._sdk.onInputSubmitted(() => {
|
|
4840
|
+
this._validationSdkError = false;
|
|
4841
|
+
this.submitting$.next(null);
|
|
4842
|
+
});
|
|
4843
|
+
this._sdk.onTimeout(() => {
|
|
4844
|
+
this._validationSdkError = false;
|
|
4845
|
+
this._fatalError = I18N_KEY.CDE_CARD_ERROR_504;
|
|
4846
|
+
});
|
|
4847
|
+
}
|
|
4848
|
+
validate(control) {
|
|
4849
|
+
if (this._fatalError) {
|
|
4850
|
+
return of({ cde_error: this._fatalError });
|
|
4851
|
+
}
|
|
4852
|
+
if (this._validationSdkError) {
|
|
4853
|
+
return of({ cde_validation_error: true });
|
|
4854
|
+
}
|
|
4855
|
+
if (this.cardSdkSrv.pending) {
|
|
4856
|
+
return this.submitting$.asObservable();
|
|
4857
|
+
}
|
|
4858
|
+
return of(null);
|
|
4859
|
+
}
|
|
4860
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: IframeValidatorDirectiveDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4861
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.2", type: IframeValidatorDirectiveDirective, isStandalone: true, selector: "[appIframeValidatorDirective]", providers: [
|
|
4862
|
+
{
|
|
4863
|
+
provide: NG_ASYNC_VALIDATORS,
|
|
4864
|
+
useExisting: forwardRef(() => IframeValidatorDirectiveDirective),
|
|
4865
|
+
multi: true,
|
|
4866
|
+
},
|
|
4867
|
+
], ngImport: i0 }); }
|
|
4868
|
+
}
|
|
4869
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: IframeValidatorDirectiveDirective, decorators: [{
|
|
4870
|
+
type: Directive,
|
|
4871
|
+
args: [{
|
|
4872
|
+
selector: '[appIframeValidatorDirective]',
|
|
4873
|
+
standalone: true,
|
|
4874
|
+
providers: [
|
|
4875
|
+
{
|
|
4876
|
+
provide: NG_ASYNC_VALIDATORS,
|
|
4877
|
+
useExisting: forwardRef(() => IframeValidatorDirectiveDirective),
|
|
4878
|
+
multi: true,
|
|
4879
|
+
},
|
|
4880
|
+
],
|
|
4716
4881
|
}]
|
|
4717
|
-
}]
|
|
4882
|
+
}] });
|
|
4718
4883
|
|
|
4884
|
+
const ID_CDE_CONTAINER = 'cde-container';
|
|
4719
4885
|
class ConstructorFieldIframeComponent {
|
|
4720
|
-
get finished() {
|
|
4721
|
-
return this._finished;
|
|
4722
|
-
}
|
|
4723
4886
|
constructor() {
|
|
4724
|
-
this.
|
|
4725
|
-
this.
|
|
4726
|
-
this.
|
|
4727
|
-
this.
|
|
4728
|
-
this.
|
|
4729
|
-
this.
|
|
4730
|
-
this.
|
|
4887
|
+
this._translateSrv = inject(TranslateService);
|
|
4888
|
+
this._cd = inject(ChangeDetectorRef);
|
|
4889
|
+
this._injector = inject(Injector);
|
|
4890
|
+
this._destroyRef = inject(DestroyRef);
|
|
4891
|
+
this.viewReady = false;
|
|
4892
|
+
this.validator = inject(IframeValidatorDirectiveDirective);
|
|
4893
|
+
this.cardSdkSrv = inject(CardSdkService);
|
|
4894
|
+
this._loading = true;
|
|
4731
4895
|
this.I18N_KEY = I18N_KEY;
|
|
4732
|
-
this.
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
this._ready = false;
|
|
4740
|
-
this._finished = false;
|
|
4741
|
-
this.submitted = false;
|
|
4896
|
+
this.ID_CDE_CONTAINER = ID_CDE_CONTAINER;
|
|
4897
|
+
}
|
|
4898
|
+
registerOnTouched(fn) { }
|
|
4899
|
+
registerOnChange(fn) { }
|
|
4900
|
+
writeValue() { }
|
|
4901
|
+
get loading() {
|
|
4902
|
+
return this._loading;
|
|
4742
4903
|
}
|
|
4743
4904
|
ngAfterViewInit() {
|
|
4744
|
-
this.
|
|
4745
|
-
|
|
4746
|
-
.
|
|
4905
|
+
this._control = this._injector.get(NgControl).control;
|
|
4906
|
+
this.cardSdkSrv
|
|
4907
|
+
.createCardTerminalSdk$(this._translateSrv.currentLang, this.ID_CDE_CONTAINER, this.tabIndex)
|
|
4908
|
+
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
4909
|
+
.subscribe({
|
|
4910
|
+
next: (sdk) => {
|
|
4911
|
+
this._sdk = sdk;
|
|
4912
|
+
this._destroyRef.onDestroy(() => this._sdk?.unsubscribe());
|
|
4913
|
+
this.validator.registerSDK(sdk);
|
|
4914
|
+
this._init();
|
|
4915
|
+
},
|
|
4916
|
+
error: () => {
|
|
4917
|
+
this.validator.registerSDK();
|
|
4918
|
+
this._updateValueAndValidity();
|
|
4919
|
+
},
|
|
4920
|
+
});
|
|
4747
4921
|
}
|
|
4748
|
-
|
|
4749
|
-
|
|
4922
|
+
_updateValueAndValidity() {
|
|
4923
|
+
this.cardSdkSrv.markAsReady();
|
|
4924
|
+
this._control?.updateValueAndValidity({ onlySelf: true });
|
|
4925
|
+
this._cd.detectChanges();
|
|
4926
|
+
this.refreshHeight();
|
|
4750
4927
|
}
|
|
4751
|
-
|
|
4752
|
-
|
|
4928
|
+
refreshHeight() {
|
|
4929
|
+
setTimeout(() => {
|
|
4930
|
+
this._sdk?.refreshHeight();
|
|
4931
|
+
this.viewReady = true;
|
|
4932
|
+
this._cd.detectChanges();
|
|
4933
|
+
}, 100);
|
|
4753
4934
|
}
|
|
4754
4935
|
_init() {
|
|
4755
|
-
this._sdk = this.sessionSrv.createCardTerminalSdk(this.lang, this.ID_CDE_CONTAINER, this.tabIndex);
|
|
4756
|
-
if (!this.iframe) {
|
|
4757
|
-
this._onError();
|
|
4758
|
-
return;
|
|
4759
|
-
}
|
|
4760
|
-
this.iframe
|
|
4761
|
-
.addEventListener('load', this._iframeOnLoadHandler);
|
|
4762
|
-
this._sdk
|
|
4763
|
-
.onError((code) => this._onError(code));
|
|
4764
4936
|
this._sdk.onInputPending(() => {
|
|
4765
|
-
|
|
4766
|
-
|
|
4767
|
-
});
|
|
4768
|
-
this._ready = false;
|
|
4937
|
+
this._loading = false;
|
|
4938
|
+
this._updateValueAndValidity();
|
|
4769
4939
|
});
|
|
4770
|
-
this._sdk.onInputReady(() =>
|
|
4771
|
-
|
|
4772
|
-
.onInputSubmitted(() => {
|
|
4773
|
-
this._finished = true;
|
|
4774
|
-
if (this.submitted) {
|
|
4775
|
-
this.status = I18N_KEY.CDE_CARD_PAID;
|
|
4776
|
-
this.paid.emit();
|
|
4777
|
-
}
|
|
4778
|
-
else {
|
|
4779
|
-
this.status = I18N_KEY.CDE_CARD_ERROR_ALREADY_PAID;
|
|
4780
|
-
}
|
|
4781
|
-
this.cd.detectChanges();
|
|
4940
|
+
this._sdk.onInputReady(() => {
|
|
4941
|
+
this._updateValueAndValidity();
|
|
4782
4942
|
});
|
|
4783
|
-
this._sdk
|
|
4784
|
-
.
|
|
4785
|
-
|
|
4786
|
-
.
|
|
4787
|
-
.
|
|
4788
|
-
.subscribe((options) => {
|
|
4789
|
-
if (!options.lang) {
|
|
4790
|
-
return;
|
|
4791
|
-
}
|
|
4792
|
-
this._sdk.useLang(options.lang);
|
|
4943
|
+
this._sdk.onInputSubmitted(() => {
|
|
4944
|
+
this._loading = false;
|
|
4945
|
+
this.cardSdkSrv.markAsSubmitted();
|
|
4946
|
+
this.status = I18N_KEY.CDE_CARD_ERROR_ALREADY_PAID;
|
|
4947
|
+
this._updateValueAndValidity();
|
|
4793
4948
|
});
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
subscriptions.map(s => s.unsubscribe());
|
|
4811
|
-
return result;
|
|
4949
|
+
this._sdk.onTimeout(() => {
|
|
4950
|
+
this._updateValueAndValidity();
|
|
4951
|
+
});
|
|
4952
|
+
this._sdk.onError(() => {
|
|
4953
|
+
this._loading = false;
|
|
4954
|
+
this._updateValueAndValidity();
|
|
4955
|
+
});
|
|
4956
|
+
this._translateSrv.onLangChange
|
|
4957
|
+
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
4958
|
+
.subscribe({
|
|
4959
|
+
next: (options) => {
|
|
4960
|
+
if (!options.lang) {
|
|
4961
|
+
return;
|
|
4962
|
+
}
|
|
4963
|
+
this._sdk.useLang(options.lang);
|
|
4964
|
+
},
|
|
4812
4965
|
});
|
|
4813
|
-
}
|
|
4814
|
-
_onError(code) {
|
|
4815
|
-
let codeError = I18N_KEY.ERROR_OCCUR;
|
|
4816
|
-
if (code === 501) {
|
|
4817
|
-
codeError = I18N_KEY.CDE_CARD_ERROR_501;
|
|
4818
|
-
}
|
|
4819
|
-
else if (code === 500) {
|
|
4820
|
-
codeError = I18N_KEY.CDE_CARD_ERROR_500;
|
|
4821
|
-
}
|
|
4822
|
-
else if (code === 504) {
|
|
4823
|
-
codeError = I18N_KEY.CDE_CARD_ERROR_504;
|
|
4824
|
-
}
|
|
4825
|
-
this.loading = false;
|
|
4826
|
-
this.error.emit(codeError);
|
|
4827
|
-
}
|
|
4828
|
-
ngOnDestroy() {
|
|
4829
|
-
this.iframe?.removeEventListener('load', this._iframeOnLoadHandler);
|
|
4830
|
-
this.unSubscriber.next();
|
|
4831
|
-
this.unSubscriber.unsubscribe();
|
|
4832
|
-
this._sdk?.unsubscribe();
|
|
4833
4966
|
}
|
|
4834
4967
|
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" },
|
|
4968
|
+
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: [
|
|
4969
|
+
{
|
|
4970
|
+
provide: NG_VALUE_ACCESSOR,
|
|
4971
|
+
useExisting: forwardRef(() => ConstructorFieldIframeComponent),
|
|
4972
|
+
multi: true,
|
|
4973
|
+
},
|
|
4974
|
+
CardSdkService,
|
|
4975
|
+
], 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
4976
|
}
|
|
4837
4977
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: ConstructorFieldIframeComponent, decorators: [{
|
|
4838
4978
|
type: Component,
|
|
4839
|
-
args: [{ selector: 'app-constructor-field-iframe', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true,
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4979
|
+
args: [{ selector: 'app-constructor-field-iframe', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, animations: [insertRemoveTrigger], providers: [
|
|
4980
|
+
{
|
|
4981
|
+
provide: NG_VALUE_ACCESSOR,
|
|
4982
|
+
useExisting: forwardRef(() => ConstructorFieldIframeComponent),
|
|
4983
|
+
multi: true,
|
|
4984
|
+
},
|
|
4985
|
+
CardSdkService,
|
|
4986
|
+
], imports: [TranslateByKeyPipe, GmSkeletonComponent], hostDirectives: [
|
|
4987
|
+
{
|
|
4988
|
+
directive: IframeValidatorDirectiveDirective,
|
|
4989
|
+
},
|
|
4990
|
+
], 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"] }]
|
|
4991
|
+
}], propDecorators: { tabIndex: [{
|
|
4847
4992
|
type: Input
|
|
4848
4993
|
}] } });
|
|
4849
4994
|
|
|
@@ -4885,6 +5030,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
4885
5030
|
}] } });
|
|
4886
5031
|
|
|
4887
5032
|
class PsSelectComponent {
|
|
5033
|
+
constructor() {
|
|
5034
|
+
this.cd = inject(ChangeDetectorRef);
|
|
5035
|
+
this.methodTitlePipe = inject(MethodTitlePipe);
|
|
5036
|
+
this.translatePipe = inject(TranslatePipe);
|
|
5037
|
+
this.destroyRef = inject(DestroyRef);
|
|
5038
|
+
this.I18N_KEY = I18N_KEY;
|
|
5039
|
+
this.onChange = (_value) => {
|
|
5040
|
+
};
|
|
5041
|
+
this.onTouch = () => {
|
|
5042
|
+
};
|
|
5043
|
+
this.methods = [];
|
|
5044
|
+
this.disabled = false;
|
|
5045
|
+
this.otherMethodControl = new FormControl(undefined);
|
|
5046
|
+
}
|
|
4888
5047
|
get popularMethods() {
|
|
4889
5048
|
if (this.disabled) {
|
|
4890
5049
|
return null;
|
|
@@ -4908,24 +5067,10 @@ class PsSelectComponent {
|
|
|
4908
5067
|
}
|
|
4909
5068
|
});
|
|
4910
5069
|
}
|
|
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
5070
|
ngOnInit() {
|
|
4926
5071
|
this.otherMethodControl
|
|
4927
5072
|
.valueChanges
|
|
4928
|
-
.pipe(filter(m => !!m),
|
|
5073
|
+
.pipe(filter(m => !!m), takeUntilDestroyed(this.destroyRef))
|
|
4929
5074
|
.subscribe((method) => this.selectMethod(method));
|
|
4930
5075
|
}
|
|
4931
5076
|
selectMethod(method, options = { emitChange: true }) {
|
|
@@ -4966,10 +5111,6 @@ class PsSelectComponent {
|
|
|
4966
5111
|
this.searchString = value;
|
|
4967
5112
|
this.cd.markForCheck();
|
|
4968
5113
|
}
|
|
4969
|
-
ngOnDestroy() {
|
|
4970
|
-
this.unsub.next();
|
|
4971
|
-
this.unsub.unsubscribe();
|
|
4972
|
-
}
|
|
4973
5114
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: PsSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4974
5115
|
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
5116
|
{
|
|
@@ -4992,13 +5133,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
4992
5133
|
MethodTitlePipe,
|
|
4993
5134
|
TranslatePipe
|
|
4994
5135
|
], 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
|
-
}],
|
|
5136
|
+
}], propDecorators: { methods: [{
|
|
4996
5137
|
type: Input
|
|
4997
5138
|
}], tabIndex: [{
|
|
4998
5139
|
type: Input
|
|
4999
5140
|
}] } });
|
|
5000
5141
|
|
|
5001
5142
|
class ConstructorFieldSelectComponent {
|
|
5143
|
+
constructor() {
|
|
5144
|
+
this.cd = inject(ChangeDetectorRef);
|
|
5145
|
+
this.injector = inject(Injector);
|
|
5146
|
+
this.I18N_KEY = I18N_KEY;
|
|
5147
|
+
this.onChange = (_value) => {
|
|
5148
|
+
};
|
|
5149
|
+
this.onTouch = () => {
|
|
5150
|
+
};
|
|
5151
|
+
}
|
|
5002
5152
|
get data() {
|
|
5003
5153
|
if (!this.items) {
|
|
5004
5154
|
return [];
|
|
@@ -5015,17 +5165,6 @@ class ConstructorFieldSelectComponent {
|
|
|
5015
5165
|
}
|
|
5016
5166
|
});
|
|
5017
5167
|
}
|
|
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
5168
|
registerOnChange(fn) {
|
|
5030
5169
|
this.onChange = fn;
|
|
5031
5170
|
}
|
|
@@ -5043,27 +5182,8 @@ class ConstructorFieldSelectComponent {
|
|
|
5043
5182
|
return this.control?.getError('error');
|
|
5044
5183
|
}
|
|
5045
5184
|
ngAfterViewInit() {
|
|
5046
|
-
this.control = this.injector.get(
|
|
5047
|
-
this.cd.reattach();
|
|
5185
|
+
this.control = this.injector.get(NgControl).control;
|
|
5048
5186
|
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
5187
|
}
|
|
5068
5188
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: ConstructorFieldSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5069
5189
|
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 +5192,7 @@ class ConstructorFieldSelectComponent {
|
|
|
5072
5192
|
useExisting: forwardRef(() => ConstructorFieldSelectComponent),
|
|
5073
5193
|
multi: true
|
|
5074
5194
|
}
|
|
5075
|
-
], ngImport: i0, template: "<app-trm-select [data]=\"data\"\r\n
|
|
5195
|
+
], 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
5196
|
}
|
|
5077
5197
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: ConstructorFieldSelectComponent, decorators: [{
|
|
5078
5198
|
type: Component,
|
|
@@ -5082,8 +5202,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
5082
5202
|
useExisting: forwardRef(() => ConstructorFieldSelectComponent),
|
|
5083
5203
|
multi: true
|
|
5084
5204
|
}
|
|
5085
|
-
], standalone: true, imports: [TrmSelectComponent, FormsModule, ReactiveFormsModule, TranslateByKeyPipe], template: "<app-trm-select [data]=\"data\"\r\n
|
|
5086
|
-
}],
|
|
5205
|
+
], 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"] }]
|
|
5206
|
+
}], propDecorators: { config: [{
|
|
5087
5207
|
type: Input
|
|
5088
5208
|
}], items: [{
|
|
5089
5209
|
type: Input
|
|
@@ -5148,7 +5268,7 @@ class ConstructorFieldTextComponent {
|
|
|
5148
5268
|
this.dropSpecialCharacters = true;
|
|
5149
5269
|
this.I18N_KEY = I18N_KEY;
|
|
5150
5270
|
this.maskedValueChange = new EventEmitter();
|
|
5151
|
-
this.onChange = (
|
|
5271
|
+
this.onChange = (_value) => {
|
|
5152
5272
|
};
|
|
5153
5273
|
this.onTouch = () => {
|
|
5154
5274
|
};
|
|
@@ -5168,7 +5288,9 @@ class ConstructorFieldTextComponent {
|
|
|
5168
5288
|
this.control?.markAsUntouched();
|
|
5169
5289
|
e.preventDefault();
|
|
5170
5290
|
e.stopPropagation();
|
|
5171
|
-
target.value = this.maskPipe
|
|
5291
|
+
target.value = this.maskPipe
|
|
5292
|
+
.transform(target.value, this.mask, { patterns: this.maskPatterns })
|
|
5293
|
+
.replace(/^-|-$/, '');
|
|
5172
5294
|
setTimeout(() => {
|
|
5173
5295
|
this.control?.updateValueAndValidity();
|
|
5174
5296
|
if (selectionStart === selectionEnd && e.inputType !== 'deleteContentBackward') {
|
|
@@ -5187,7 +5309,7 @@ class ConstructorFieldTextComponent {
|
|
|
5187
5309
|
return;
|
|
5188
5310
|
}
|
|
5189
5311
|
const value = t.value;
|
|
5190
|
-
let content = e.clipboardData
|
|
5312
|
+
let content = e.clipboardData?.getData('text') || '';
|
|
5191
5313
|
let selectionStart = removeSpecSymbols(t.value.slice(0, t.selectionStart)).length + removeSpecSymbols(content).length;
|
|
5192
5314
|
if (value) {
|
|
5193
5315
|
const arr = Array.from(value);
|
|
@@ -5208,6 +5330,10 @@ class ConstructorFieldTextComponent {
|
|
|
5208
5330
|
return;
|
|
5209
5331
|
}
|
|
5210
5332
|
const target = e.target;
|
|
5333
|
+
if (this.type === PaymentFieldTypeEnum.Email) {
|
|
5334
|
+
this._emitMaskedValueChanges(target);
|
|
5335
|
+
return;
|
|
5336
|
+
}
|
|
5211
5337
|
const value = this.control?.value;
|
|
5212
5338
|
let selectionStart = removeSpecSymbols(target.value.slice(0, target.selectionStart)).length;
|
|
5213
5339
|
const mask = this.maskSrv.getMaskByValue(this.config.mask, value);
|
|
@@ -5361,17 +5487,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
5361
5487
|
|
|
5362
5488
|
class MethodAmountHintComponent {
|
|
5363
5489
|
constructor() {
|
|
5490
|
+
this.mainTpl = inject(TerminalTplComponent);
|
|
5364
5491
|
this.options = {};
|
|
5365
5492
|
this.I18N_KEY = I18N_KEY;
|
|
5366
5493
|
}
|
|
5494
|
+
get feeTpl() {
|
|
5495
|
+
return this.mainTpl.feeTpl;
|
|
5496
|
+
}
|
|
5367
5497
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: MethodAmountHintComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5368
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.2", type: MethodAmountHintComponent, isStandalone: true, selector: "app-method-amount-hint", inputs: { loading: "loading", options: "options" }, host: { properties: { "hidden": "!loading && (!options || (!options.fee && !options.fixedFee && !options.minFixedFee && !options.min && !options.max))" } }, providers: [CurrencyPipe], ngImport: i0, template: "<div class=\"c-method-hint\" @insertRemove>\r\n @if (loading) {\r\n <span class=\"trm-spinner\" @insertRemove></span>\r\n }\r\n
|
|
5498
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.2", type: MethodAmountHintComponent, isStandalone: true, selector: "app-method-amount-hint", inputs: { loading: "loading", options: "options" }, host: { properties: { "hidden": "!loading && (!options || (!options.fee && !options.fixedFee && !options.minFixedFee && !options.min && !options.max))" } }, providers: [CurrencyPipe], ngImport: i0, template: "<div class=\"c-method-hint\" @insertRemove>\r\n @if (loading) {\r\n <span class=\"trm-spinner\" @insertRemove></span>\r\n }\r\n @if (options.fee || options.fixedFee) {\r\n <div @insertRemove>\r\n {{ (I18N_KEY.CONSTRUCTOR_LABEL_FEE | trans) }}\r\n @if (options.fee) {\r\n <span class=\"trm-amount\">\r\n <span class=\"trm-amount__value\">{{ options.fee }}<span class=\"trm-currency\">%</span></span>\r\n </span>\r\n }\r\n @if (options.fixedFee && options.fee) {\r\n <span> + </span>\r\n }\r\n @if (options.fixedFee) {\r\n <span\r\n [innerHTML]=\"options.fixedFee | trm_currency: options.currency | sanitizeHtml\"></span>\r\n }\r\n @if (options.minFixedFee) {\r\n ({{ I18N_KEY.CONSTRUCTOR_LABEL_MIN_FIXED_FEE | trans }}<span\r\n [innerHTML]=\"options.minFixedFee | trm_currency: options.currency | sanitizeHtml\"></span>)\r\n }\r\n </div>\r\n }\r\n @if (options.min) {\r\n <div @insertRemove>\r\n {{ (I18N_KEY.CONSTRUCTOR_LABEL_MIN_AMOUNT | trans) }}\r\n <span [innerHTML]=\"options.min | trm_currency: options.currency\"></span>\r\n </div>\r\n }\r\n @if (options.max) {\r\n <div @insertRemove>\r\n {{ (I18N_KEY.CONSTRUCTOR_LABEL_MAX_AMOUNT | trans) }}\r\n <span [innerHTML]=\"options.max | trm_currency: options.currency\"></span>\r\n </div>\r\n }\r\n\r\n @if (feeTpl) {\r\n <div *ngTemplateOutlet=\"feeTpl; context: {options}\" @insertRemove></div>\r\n }\r\n</div>\r\n", styles: [":host{display:block;position:relative}.trm-spinner{position:absolute;right:10px}.c-method-hint{position:relative;font-weight:400;font-size:14px;line-height:22px;color:var(--color-base-350)}.c-method-hint:first-letter,.c-method-hint>div:first-letter{text-transform:uppercase}\n"], dependencies: [{ kind: "pipe", type: TrmCurrencyPipe, name: "trm_currency" }, { kind: "pipe", type: TranslateByKeyPipe, name: "trans" }, { kind: "pipe", type: HtmlSanitizerPipe, name: "sanitizeHtml" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], animations: [insertRemoveTrigger] }); }
|
|
5369
5499
|
}
|
|
5370
5500
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: MethodAmountHintComponent, decorators: [{
|
|
5371
5501
|
type: Component,
|
|
5372
|
-
args: [{ selector: 'app-method-amount-hint', standalone: true, animations: [insertRemoveTrigger], providers: [CurrencyPipe], imports: [TrmCurrencyPipe, TranslateByKeyPipe,
|
|
5502
|
+
args: [{ selector: 'app-method-amount-hint', standalone: true, animations: [insertRemoveTrigger], providers: [CurrencyPipe], imports: [TrmCurrencyPipe, TranslateByKeyPipe, HtmlSanitizerPipe, NgTemplateOutlet], host: {
|
|
5373
5503
|
'[hidden]': '!loading && (!options || (!options.fee && !options.fixedFee && !options.minFixedFee && !options.min && !options.max))'
|
|
5374
|
-
}, template: "<div class=\"c-method-hint\" @insertRemove>\r\n @if (loading) {\r\n <span class=\"trm-spinner\" @insertRemove></span>\r\n }\r\n
|
|
5504
|
+
}, template: "<div class=\"c-method-hint\" @insertRemove>\r\n @if (loading) {\r\n <span class=\"trm-spinner\" @insertRemove></span>\r\n }\r\n @if (options.fee || options.fixedFee) {\r\n <div @insertRemove>\r\n {{ (I18N_KEY.CONSTRUCTOR_LABEL_FEE | trans) }}\r\n @if (options.fee) {\r\n <span class=\"trm-amount\">\r\n <span class=\"trm-amount__value\">{{ options.fee }}<span class=\"trm-currency\">%</span></span>\r\n </span>\r\n }\r\n @if (options.fixedFee && options.fee) {\r\n <span> + </span>\r\n }\r\n @if (options.fixedFee) {\r\n <span\r\n [innerHTML]=\"options.fixedFee | trm_currency: options.currency | sanitizeHtml\"></span>\r\n }\r\n @if (options.minFixedFee) {\r\n ({{ I18N_KEY.CONSTRUCTOR_LABEL_MIN_FIXED_FEE | trans }}<span\r\n [innerHTML]=\"options.minFixedFee | trm_currency: options.currency | sanitizeHtml\"></span>)\r\n }\r\n </div>\r\n }\r\n @if (options.min) {\r\n <div @insertRemove>\r\n {{ (I18N_KEY.CONSTRUCTOR_LABEL_MIN_AMOUNT | trans) }}\r\n <span [innerHTML]=\"options.min | trm_currency: options.currency\"></span>\r\n </div>\r\n }\r\n @if (options.max) {\r\n <div @insertRemove>\r\n {{ (I18N_KEY.CONSTRUCTOR_LABEL_MAX_AMOUNT | trans) }}\r\n <span [innerHTML]=\"options.max | trm_currency: options.currency\"></span>\r\n </div>\r\n }\r\n\r\n @if (feeTpl) {\r\n <div *ngTemplateOutlet=\"feeTpl; context: {options}\" @insertRemove></div>\r\n }\r\n</div>\r\n", styles: [":host{display:block;position:relative}.trm-spinner{position:absolute;right:10px}.c-method-hint{position:relative;font-weight:400;font-size:14px;line-height:22px;color:var(--color-base-350)}.c-method-hint:first-letter,.c-method-hint>div:first-letter{text-transform:uppercase}\n"] }]
|
|
5375
5505
|
}], propDecorators: { loading: [{
|
|
5376
5506
|
type: Input
|
|
5377
5507
|
}], options: [{
|
|
@@ -5379,19 +5509,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
5379
5509
|
}] } });
|
|
5380
5510
|
|
|
5381
5511
|
class ConstructorFieldDateComponent {
|
|
5382
|
-
get startCalendarDate() {
|
|
5383
|
-
return this.config.options?.startCalendarDate;
|
|
5384
|
-
}
|
|
5385
5512
|
constructor() {
|
|
5386
5513
|
this.cd = inject(ChangeDetectorRef);
|
|
5387
5514
|
this.injector = inject(Injector);
|
|
5515
|
+
this.destroyRef = inject(DestroyRef);
|
|
5388
5516
|
this.FORMAT_DATE = FORMAT_DATE;
|
|
5389
|
-
this.
|
|
5390
|
-
this.onChange = (value) => {
|
|
5517
|
+
this.onChange = (_value) => {
|
|
5391
5518
|
};
|
|
5392
5519
|
this.onTouch = () => {
|
|
5393
5520
|
};
|
|
5394
|
-
|
|
5521
|
+
}
|
|
5522
|
+
get startCalendarDate() {
|
|
5523
|
+
return this.config.options?.startCalendarDate;
|
|
5395
5524
|
}
|
|
5396
5525
|
registerOnChange(fn) {
|
|
5397
5526
|
this.onChange = fn;
|
|
@@ -5400,48 +5529,36 @@ class ConstructorFieldDateComponent {
|
|
|
5400
5529
|
this.onTouch = fn;
|
|
5401
5530
|
}
|
|
5402
5531
|
writeValue(value) {
|
|
5403
|
-
|
|
5404
|
-
|
|
5532
|
+
if (isMoment(value) || typeof value === 'string') {
|
|
5533
|
+
if (isMoment(value)) {
|
|
5534
|
+
this.control?.setValue(value.format(FORMAT_DATE), { emitEvent: false });
|
|
5535
|
+
}
|
|
5536
|
+
else {
|
|
5537
|
+
this.control?.setValue(value, { emitEvent: false });
|
|
5538
|
+
}
|
|
5539
|
+
this.cd.markForCheck();
|
|
5540
|
+
}
|
|
5405
5541
|
}
|
|
5406
5542
|
ngAfterViewInit() {
|
|
5407
|
-
this.control = this.injector.get(
|
|
5408
|
-
this.cd.reattach();
|
|
5543
|
+
this.control = this.injector.get(NgControl).control;
|
|
5409
5544
|
this.cd.detectChanges();
|
|
5410
|
-
this.ngDoCheck();
|
|
5411
5545
|
this.control
|
|
5412
5546
|
.valueChanges
|
|
5413
|
-
.pipe(
|
|
5547
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
5414
5548
|
.subscribe((value) => {
|
|
5415
5549
|
if (isMoment(value)) {
|
|
5416
5550
|
this.onChange(value.format(this.FORMAT_DATE));
|
|
5417
5551
|
}
|
|
5418
5552
|
});
|
|
5419
5553
|
}
|
|
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
5554
|
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: "
|
|
5555
|
+
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
5556
|
{
|
|
5440
5557
|
provide: NG_VALUE_ACCESSOR,
|
|
5441
5558
|
useExisting: forwardRef(() => ConstructorFieldDateComponent),
|
|
5442
5559
|
multi: true
|
|
5443
5560
|
}
|
|
5444
|
-
], ngImport: i0, template: "<app-constructor-field-text\r\n
|
|
5561
|
+
], 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
5562
|
}
|
|
5446
5563
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: ConstructorFieldDateComponent, decorators: [{
|
|
5447
5564
|
type: Component,
|
|
@@ -5451,8 +5568,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
5451
5568
|
useExisting: forwardRef(() => ConstructorFieldDateComponent),
|
|
5452
5569
|
multi: true
|
|
5453
5570
|
}
|
|
5454
|
-
], standalone: true, imports: [ConstructorFieldTextComponent, FormsModule, ReactiveFormsModule, MatDatepickerToggle, MatDatepickerToggleIcon, MatDatepicker], template: "<app-constructor-field-text\r\n
|
|
5455
|
-
}],
|
|
5571
|
+
], 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"] }]
|
|
5572
|
+
}], propDecorators: { config: [{
|
|
5456
5573
|
type: Input
|
|
5457
5574
|
}], tabIndex: [{
|
|
5458
5575
|
type: Input
|
|
@@ -5486,6 +5603,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
5486
5603
|
}] } });
|
|
5487
5604
|
|
|
5488
5605
|
class ConstructorFormComponent {
|
|
5606
|
+
constructor() {
|
|
5607
|
+
this.cd = inject(ChangeDetectorRef);
|
|
5608
|
+
this.form = inject(ConstructorFormService);
|
|
5609
|
+
this.translateSrv = inject(TranslateService);
|
|
5610
|
+
this.countriesSortPipe = inject(CountriesSortPipe);
|
|
5611
|
+
this.countryTranslatePipe = inject(CountryTranslatePipe);
|
|
5612
|
+
this.ngScrollBar = inject(NgScrollbar);
|
|
5613
|
+
this.versionSrv = inject(TERMINAL_VERSION_SERVICE_TOKEN);
|
|
5614
|
+
this.unSubscriber = new Subject();
|
|
5615
|
+
this.preparationStepFilled = false;
|
|
5616
|
+
this.TERMINAL_STEP = TerminalStep;
|
|
5617
|
+
this.CONSTRUCTOR_FIELD_TYPES = PaymentFieldTypeEnum;
|
|
5618
|
+
this.loading = null;
|
|
5619
|
+
this.types = [];
|
|
5620
|
+
this.canReturnToProject = true;
|
|
5621
|
+
this.amountChanged = new EventEmitter();
|
|
5622
|
+
this.back = new EventEmitter();
|
|
5623
|
+
this.prepare = new EventEmitter();
|
|
5624
|
+
this.confirm = new EventEmitter();
|
|
5625
|
+
this.onPaymentChanged = new EventEmitter();
|
|
5626
|
+
this.I18N_KEY = I18N_KEY;
|
|
5627
|
+
}
|
|
5489
5628
|
get countriesList() {
|
|
5490
5629
|
return this.countriesSortPipe
|
|
5491
5630
|
.transform(this.types
|
|
@@ -5548,30 +5687,6 @@ class ConstructorFormComponent {
|
|
|
5548
5687
|
this.form.userCurrency.disable();
|
|
5549
5688
|
}
|
|
5550
5689
|
}
|
|
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
5690
|
get hasCurrencyMethodSelector() {
|
|
5576
5691
|
return this.versionSrv.hasCurrencyMethodSelector === true;
|
|
5577
5692
|
}
|
|
@@ -5586,7 +5701,19 @@ class ConstructorFormComponent {
|
|
|
5586
5701
|
// Get configuration fields
|
|
5587
5702
|
const countries = this.countriesList;
|
|
5588
5703
|
const defaultCountry = this.form.defaultCountry;
|
|
5589
|
-
|
|
5704
|
+
let country = null;
|
|
5705
|
+
if (!countries.includes(defaultCountry)) {
|
|
5706
|
+
if (countries.includes(OTHER_COUNTRY_CODE)) {
|
|
5707
|
+
country = OTHER_COUNTRY_CODE;
|
|
5708
|
+
}
|
|
5709
|
+
}
|
|
5710
|
+
else {
|
|
5711
|
+
country = defaultCountry;
|
|
5712
|
+
}
|
|
5713
|
+
this.form.country.setValue(country);
|
|
5714
|
+
if (!country) {
|
|
5715
|
+
return;
|
|
5716
|
+
}
|
|
5590
5717
|
if (countries.length === 1 && this.form.country.value) {
|
|
5591
5718
|
this.form.country.disable();
|
|
5592
5719
|
}
|
|
@@ -5607,10 +5734,16 @@ class ConstructorFormComponent {
|
|
|
5607
5734
|
.subscribe(() => this.onPaymentChanged.emit(this.form.getRawValue()));
|
|
5608
5735
|
this.fetchForm();
|
|
5609
5736
|
}
|
|
5737
|
+
if (changes.step?.currentValue && !changes.types && !changes.currency) {
|
|
5738
|
+
this.fetchForm();
|
|
5739
|
+
}
|
|
5610
5740
|
if (changes.feeOptions && !changes.feeOptions.firstChange) {
|
|
5611
5741
|
// need for triggering of the custom validator
|
|
5612
5742
|
this.form.amount?.updateValueAndValidity();
|
|
5613
5743
|
}
|
|
5744
|
+
if (this.step === TerminalStep.Confirmation) {
|
|
5745
|
+
this.preparationStepFilled = true;
|
|
5746
|
+
}
|
|
5614
5747
|
}
|
|
5615
5748
|
ngAfterViewInit() {
|
|
5616
5749
|
this.form
|
|
@@ -5651,6 +5784,10 @@ class ConstructorFormComponent {
|
|
|
5651
5784
|
});
|
|
5652
5785
|
}
|
|
5653
5786
|
fetchForm() {
|
|
5787
|
+
if (!this.form.method.value) {
|
|
5788
|
+
this.form.ready = true;
|
|
5789
|
+
return;
|
|
5790
|
+
}
|
|
5654
5791
|
this.form.cancelRequests();
|
|
5655
5792
|
if (this.step !== this.TERMINAL_STEP.Prepare) {
|
|
5656
5793
|
return;
|
|
@@ -5660,14 +5797,16 @@ class ConstructorFormComponent {
|
|
|
5660
5797
|
this.form
|
|
5661
5798
|
.init()
|
|
5662
5799
|
.subscribe(() => {
|
|
5663
|
-
if (!this.form.hasWhatToFill()) {
|
|
5800
|
+
if (!this.preparationStepFilled && !this.form.hasWhatToFill()) {
|
|
5664
5801
|
this.send();
|
|
5665
5802
|
return;
|
|
5666
5803
|
}
|
|
5804
|
+
this.form.payment.updateValueAndValidity({ onlySelf: true });
|
|
5667
5805
|
this.cd.detectChanges();
|
|
5668
5806
|
this.scrollToRequisits();
|
|
5669
5807
|
this.form.maskedWallet = '';
|
|
5670
5808
|
}, (err) => {
|
|
5809
|
+
this.form.payment.updateValueAndValidity({ onlySelf: true });
|
|
5671
5810
|
this.cd.markForCheck();
|
|
5672
5811
|
});
|
|
5673
5812
|
}
|
|
@@ -5683,47 +5822,49 @@ class ConstructorFormComponent {
|
|
|
5683
5822
|
return typeof this.form.config?.description === 'function' ? this.form.config?.description(this.form.getRawValue()) : this.form.config?.description;
|
|
5684
5823
|
}
|
|
5685
5824
|
submit() {
|
|
5686
|
-
if (
|
|
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()) {
|
|
5825
|
+
if (this.feeLoading) {
|
|
5700
5826
|
return;
|
|
5701
5827
|
}
|
|
5702
|
-
this.send();
|
|
5703
|
-
}
|
|
5704
|
-
iframeError(code) {
|
|
5705
|
-
this.form.setCDEError(code);
|
|
5706
|
-
this.cd.detectChanges();
|
|
5707
|
-
}
|
|
5708
|
-
check() {
|
|
5709
5828
|
if (this.step === TerminalStep.Confirmation) {
|
|
5710
5829
|
this.confirm.emit();
|
|
5711
|
-
return
|
|
5830
|
+
return;
|
|
5712
5831
|
}
|
|
5713
|
-
if (this.form.config === null) {
|
|
5714
|
-
return
|
|
5832
|
+
if (this.form.config === null || !this.form.ready) {
|
|
5833
|
+
return;
|
|
5715
5834
|
}
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5835
|
+
this.triggerIframeSubmit();
|
|
5836
|
+
if (this.form.invalid || this.error) {
|
|
5837
|
+
Object.values(this.form.controls).forEach((control) => {
|
|
5838
|
+
control.markAsDirty();
|
|
5839
|
+
control.markAsTouched();
|
|
5840
|
+
});
|
|
5841
|
+
Object.values(this.form.payment.controls).forEach((control) => {
|
|
5719
5842
|
control.markAsDirty();
|
|
5720
5843
|
control.markAsTouched();
|
|
5721
5844
|
control.updateValueAndValidity({ emitEvent: false });
|
|
5722
5845
|
});
|
|
5723
5846
|
this.cd.detectChanges();
|
|
5724
|
-
return
|
|
5847
|
+
return;
|
|
5725
5848
|
}
|
|
5726
|
-
|
|
5849
|
+
if (this.form.pending) {
|
|
5850
|
+
this.form.statusChanges
|
|
5851
|
+
.pipe(first(), takeUntil(this.unSubscriber))
|
|
5852
|
+
.subscribe((status) => {
|
|
5853
|
+
if (status === 'VALID') {
|
|
5854
|
+
this.send();
|
|
5855
|
+
}
|
|
5856
|
+
});
|
|
5857
|
+
}
|
|
5858
|
+
else {
|
|
5859
|
+
this.send();
|
|
5860
|
+
}
|
|
5861
|
+
}
|
|
5862
|
+
triggerIframeSubmit() {
|
|
5863
|
+
if (!this.form.readyIframesSubmit) {
|
|
5864
|
+
return;
|
|
5865
|
+
}
|
|
5866
|
+
this.sdkList?.forEach((sdk) => sdk.submit());
|
|
5867
|
+
this.form.updateValueAndValidityIframes();
|
|
5727
5868
|
}
|
|
5728
5869
|
send() {
|
|
5729
5870
|
const data = this.form.getPaymentValue();
|
|
@@ -5754,15 +5895,15 @@ class ConstructorFormComponent {
|
|
|
5754
5895
|
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
5896
|
ConstructorFormService,
|
|
5756
5897
|
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 }); }
|
|
5898
|
+
], 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 !== 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 @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
5899
|
}
|
|
5759
5900
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: ConstructorFormComponent, decorators: [{
|
|
5760
5901
|
type: Component,
|
|
5761
5902
|
args: [{ selector: 'app-constructor-form', changeDetection: ChangeDetectionStrategy.OnPush, animations: [insertRemoveTrigger], providers: [
|
|
5762
5903
|
ConstructorFormService,
|
|
5763
5904
|
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
|
-
}],
|
|
5905
|
+
], 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 @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"] }]
|
|
5906
|
+
}], propDecorators: { step: [{
|
|
5766
5907
|
type: Input
|
|
5767
5908
|
}], error: [{
|
|
5768
5909
|
type: Input
|
|
@@ -5800,9 +5941,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
5800
5941
|
}], hintMethod: [{
|
|
5801
5942
|
type: ViewChild,
|
|
5802
5943
|
args: ['hintMethod', { static: false }]
|
|
5803
|
-
}],
|
|
5804
|
-
type:
|
|
5805
|
-
args: [
|
|
5944
|
+
}], sdkList: [{
|
|
5945
|
+
type: ViewChildren,
|
|
5946
|
+
args: [CardSdkService]
|
|
5806
5947
|
}] } });
|
|
5807
5948
|
|
|
5808
5949
|
class TerminalLayoutComponent {
|
|
@@ -5815,6 +5956,7 @@ class TerminalLayoutComponent {
|
|
|
5815
5956
|
this.translateLoader = inject(TranslateLoader);
|
|
5816
5957
|
this.cd = inject(ChangeDetectorRef);
|
|
5817
5958
|
this.translateStorageSrv = inject(TranslateLangStorageService);
|
|
5959
|
+
this.translateSrv = inject(TranslateService);
|
|
5818
5960
|
this.adapter = inject(DateAdapter);
|
|
5819
5961
|
this.apiErrorSrv = inject(ApiErrorsService);
|
|
5820
5962
|
this.location = inject(Location);
|
|
@@ -5827,9 +5969,9 @@ class TerminalLayoutComponent {
|
|
|
5827
5969
|
this._submitted = false;
|
|
5828
5970
|
this.feeCalculateSubject = new Subject();
|
|
5829
5971
|
this.feeLoading = false;
|
|
5830
|
-
this.adapter.setLocale(this.
|
|
5972
|
+
this.adapter.setLocale(this.translateSrv.currentLang);
|
|
5831
5973
|
this._setTitle();
|
|
5832
|
-
this.
|
|
5974
|
+
this.translateSrv.onLangChange
|
|
5833
5975
|
.pipe(takeUntil(this.unSubscriber))
|
|
5834
5976
|
.subscribe((e) => {
|
|
5835
5977
|
this.adapter.setLocale(e.lang);
|
|
@@ -5848,7 +5990,7 @@ class TerminalLayoutComponent {
|
|
|
5848
5990
|
return this.versionSrv.footerText;
|
|
5849
5991
|
}
|
|
5850
5992
|
_setTitle() {
|
|
5851
|
-
this.titleSrv.setTitle(this.versionSrv.pageTitle + this.
|
|
5993
|
+
this.titleSrv.setTitle(this.versionSrv.pageTitle + this.translateSrv.instant(getI18Key(I18N_KEY.TITLE_PAGE_INVOICE)));
|
|
5852
5994
|
}
|
|
5853
5995
|
changeLang() {
|
|
5854
5996
|
}
|
|
@@ -5929,7 +6071,7 @@ class TerminalLayoutComponent {
|
|
|
5929
6071
|
}
|
|
5930
6072
|
checkFatalError() {
|
|
5931
6073
|
// Clear form error when any values have changed.
|
|
5932
|
-
if (!this.apiErrorSrv.hasFatalError && this.apiErrorSrv.
|
|
6074
|
+
if (!this.apiErrorSrv.hasFatalError && this.apiErrorSrv.getLocalError()) {
|
|
5933
6075
|
this.apiErrorSrv.clear();
|
|
5934
6076
|
}
|
|
5935
6077
|
}
|
|
@@ -5959,7 +6101,7 @@ class TerminalLayoutComponent {
|
|
|
5959
6101
|
this.cd.detectChanges();
|
|
5960
6102
|
}
|
|
5961
6103
|
get statusText() {
|
|
5962
|
-
return this.apiErrorSrv.
|
|
6104
|
+
return this.apiErrorSrv.getLocalError() || this._statusText;
|
|
5963
6105
|
}
|
|
5964
6106
|
get hasStatusError() {
|
|
5965
6107
|
return this.apiErrorSrv.hasFatalError;
|
|
@@ -5973,6 +6115,7 @@ class TerminalLayoutComponent {
|
|
|
5973
6115
|
}
|
|
5974
6116
|
this.feeCalculateSubject.next();
|
|
5975
6117
|
this.feeLoading = true;
|
|
6118
|
+
this.feeOptions = {};
|
|
5976
6119
|
this.cd.detectChanges();
|
|
5977
6120
|
this.sessionDS
|
|
5978
6121
|
.feeOptions(value)
|
|
@@ -5999,7 +6142,7 @@ class TerminalLayoutComponent {
|
|
|
5999
6142
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.2", type: TerminalLayoutComponent, isStandalone: true, selector: "app-terminal-layout", providers: [
|
|
6000
6143
|
SessionDataSource,
|
|
6001
6144
|
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 (
|
|
6145
|
+
], 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
6146
|
}
|
|
6004
6147
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: TerminalLayoutComponent, decorators: [{
|
|
6005
6148
|
type: Component,
|
|
@@ -6012,7 +6155,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
6012
6155
|
ConstructorFormComponent, ConstructorStatusComponent,
|
|
6013
6156
|
AsyncPipe,
|
|
6014
6157
|
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 (
|
|
6158
|
+
], 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
6159
|
}], ctorParameters: () => [], propDecorators: { scrollComponent: [{
|
|
6017
6160
|
type: ViewChild,
|
|
6018
6161
|
args: ['scrollComponent']
|
|
@@ -6458,5 +6601,5 @@ const moment = momentjs;
|
|
|
6458
6601
|
* Generated bundle index. Do not edit.
|
|
6459
6602
|
*/
|
|
6460
6603
|
|
|
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,
|
|
6604
|
+
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, FeeTemplateDirective, 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, provideTerminal, removeEmptyProps, removeSpecSymbols, warningConsole };
|
|
6462
6605
|
//# sourceMappingURL=trm-tmpl.mjs.map
|