myrtex-mf-signer 1.1.51 → 1.1.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +11 -11
  2. package/esm2020/lib/components/certificate-select/certificate-select.component.mjs +3 -3
  3. package/esm2020/lib/components/sign-modal/sign-modal.component.mjs +17 -12
  4. package/esm2020/lib/enums/signer-type.enum.mjs +8 -0
  5. package/esm2020/lib/helpers/strippingCharacters.mjs +1 -1
  6. package/esm2020/lib/models/certificate.model.mjs +1 -1
  7. package/esm2020/lib/models/index.mjs +1 -1
  8. package/esm2020/lib/models/internal/verify.cert.model.mjs +1 -1
  9. package/esm2020/lib/models/internal/verify.cert.response.model.mjs +1 -1
  10. package/esm2020/lib/models/sign-request.model.mjs +1 -1
  11. package/esm2020/lib/models/sign-validate-response.model.mjs +1 -1
  12. package/esm2020/lib/models/signed-result.model.mjs +1 -1
  13. package/esm2020/lib/myrtex-signer.module.mjs +1 -1
  14. package/esm2020/lib/providers/crypto.provider.mjs +48 -40
  15. package/esm2020/lib/providers/cryptojinn.provider.mjs +3 -2
  16. package/esm2020/lib/providers/cryptots.provider.mjs +4 -3
  17. package/esm2020/lib/providers/empty.provider.mjs +2 -2
  18. package/esm2020/lib/providers/interfaces/isign.provider.mjs +1 -1
  19. package/esm2020/lib/providers/signprovider.factory.mjs +1 -1
  20. package/esm2020/lib/services/certificate.adjuster.mjs +15 -15
  21. package/esm2020/lib/services/crypto.api.service.mjs +1 -1
  22. package/esm2020/lib/services/crypto.base.service.mjs +1 -1
  23. package/esm2020/lib/services/crypto.service.mjs +1 -1
  24. package/esm2020/lib/services/cryptopro/crypto.pro.async.service.mjs +1 -1
  25. package/esm2020/lib/services/cryptopro/crypto.pro.base.service.mjs +45 -11
  26. package/esm2020/lib/services/cryptopro/crypto.pro.ts.service.mjs +1 -1
  27. package/esm2020/lib/services/download.service.mjs +1 -1
  28. package/esm2020/lib/services/public.sign.service.mjs +1 -1
  29. package/esm2020/public-api.mjs +1 -1
  30. package/fesm2015/myrtex-mf-signer.mjs +143 -85
  31. package/fesm2015/myrtex-mf-signer.mjs.map +1 -1
  32. package/fesm2020/myrtex-mf-signer.mjs +141 -85
  33. package/fesm2020/myrtex-mf-signer.mjs.map +1 -1
  34. package/lib/components/sign-modal/sign-modal.component.d.ts +9 -1
  35. package/lib/enums/signer-type.enum.d.ts +6 -0
  36. package/lib/helpers/strippingCharacters.d.ts +1 -1
  37. package/lib/models/sign-request.model.d.ts +16 -2
  38. package/lib/providers/crypto.provider.d.ts +3 -5
  39. package/lib/providers/cryptojinn.provider.d.ts +2 -2
  40. package/lib/providers/cryptots.provider.d.ts +2 -2
  41. package/lib/providers/empty.provider.d.ts +2 -2
  42. package/lib/providers/interfaces/isign.provider.d.ts +17 -2
  43. package/lib/services/certificate.adjuster.d.ts +10 -10
  44. package/lib/services/cryptopro/crypto.pro.base.service.d.ts +6 -2
  45. package/package.json +1 -1
@@ -48,55 +48,70 @@ class CertificateAdjuster {
48
48
  return '';
49
49
  }
50
50
  ;
51
- Print2Digit(digit) {
51
+ print2Digit(digit) {
52
52
  return (digit < 10) ? '0' + digit : digit;
53
53
  }
54
54
  ;
55
- GetCertDate(paramDate) {
55
+ getCertDate(paramDate) {
56
56
  let certDate = new Date(paramDate);
57
- return this.Print2Digit(certDate.getUTCDate()) + '.' + this.Print2Digit(certDate.getMonth() + 1) +
57
+ return this.print2Digit(certDate.getUTCDate()) + '.' + this.print2Digit(certDate.getMonth() + 1) +
58
58
  '.' + certDate.getFullYear() + ' ' +
59
- this.Print2Digit(certDate.getUTCHours()) + ':' + this.Print2Digit(certDate.getUTCMinutes()) +
60
- ':' + this.Print2Digit(certDate.getUTCSeconds());
59
+ this.print2Digit(certDate.getUTCHours()) + ':' + this.print2Digit(certDate.getUTCMinutes()) +
60
+ ':' + this.print2Digit(certDate.getUTCSeconds());
61
61
  }
62
62
  ;
63
- GetCertFio(certSubjectName) {
63
+ getCertFio(certSubjectName) {
64
64
  const lastName = this.extract(certSubjectName, 'SN');
65
65
  const name = this.extract(certSubjectName, 'G');
66
66
  return lastName + ' ' + name;
67
67
  }
68
68
  ;
69
- GetCertPost(certSubjectName) {
69
+ getCertPost(certSubjectName) {
70
70
  return this.extract(certSubjectName, 'T');
71
71
  }
72
72
  ;
73
- GetCertOgrn(certSubjectName) {
73
+ getCertOgrn(certSubjectName) {
74
74
  return this.extract(certSubjectName, ['OGRN', 'ОГРН', 'ОГРНИП', 'OGRNIP', '1.2.643.100.1']);
75
75
  }
76
76
  ;
77
- GetCertOrg(certSubjectName) {
77
+ getCertOrg(certSubjectName) {
78
78
  return this.extract(certSubjectName, 'O');
79
79
  }
80
80
  ;
81
- GetCertInn(certSubjectName) {
81
+ getCertInn(certSubjectName) {
82
82
  return this.extract(certSubjectName, ['INN', 'ИНН', '1.2.643.3.131.1.1']);
83
83
  }
84
84
  ;
85
- GetCertName(certSubjectName) {
85
+ getCertName(certSubjectName) {
86
86
  return this.extract(certSubjectName, 'CN');
87
87
  }
88
88
  ;
89
- GetIssuer(certIssuerName) {
89
+ getIssuer(certIssuerName) {
90
90
  return this.extract(certIssuerName, 'CN');
91
91
  }
92
92
  ;
93
- GetCertInfoString(certSubjectName, certFromDate) {
94
- return this.extract(certSubjectName, 'CN') + '; Выдан: ' + this.GetCertDate(certFromDate);
93
+ getCertInfoString(certSubjectName, certFromDate) {
94
+ return this.extract(certSubjectName, 'CN') + '; Выдан: ' + this.getCertDate(certFromDate);
95
95
  }
96
96
  ;
97
97
  }
98
98
  const instance = new CertificateAdjuster();
99
99
 
100
+ var SignerTypeEnum;
101
+ (function (SignerTypeEnum) {
102
+ SignerTypeEnum[SignerTypeEnum["Unknown"] = 0] = "Unknown";
103
+ SignerTypeEnum[SignerTypeEnum["FL"] = 1] = "FL";
104
+ SignerTypeEnum[SignerTypeEnum["UL"] = 2] = "UL";
105
+ SignerTypeEnum[SignerTypeEnum["IP"] = 3] = "IP";
106
+ })(SignerTypeEnum || (SignerTypeEnum = {}));
107
+
108
+ const strippingCharacters = (text) => {
109
+ if (!text) {
110
+ return '';
111
+ }
112
+ return text.replace(/\.|,|!|"|«|»|<|>|'|:|;|-|\\(|\\)/g, '').toLowerCase();
113
+ };
114
+
100
115
  // @ts-ignore
101
116
  class CryptoProBaseService extends CryptoBaseService {
102
117
  constructor() {
@@ -107,7 +122,7 @@ class CryptoProBaseService extends CryptoBaseService {
107
122
  return Promise.resolve(this);
108
123
  }
109
124
  ;
110
- async getCertificates() {
125
+ async getCertificates(filter) {
111
126
  const store = await window.cadesplugin.CreateObjectAsync("CAdESCOM.Store" /* Store */);
112
127
  await store.Open(2 /* CAPICOM_CURRENT_USER_STORE */, "My" /* CAPICOM_MY_STORE */, 2 /* CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED */);
113
128
  let storeCerts = await store.Certificates;
@@ -118,24 +133,56 @@ class CryptoProBaseService extends CryptoBaseService {
118
133
  let validFromDate = new Date(await cert.ValidFromDate);
119
134
  let validToDate = new Date(await cert.ValidToDate);
120
135
  const subjectName = await cert.SubjectName;
121
- certificates.push({
136
+ const certificate = {
122
137
  id: i,
123
138
  certificate: cert,
124
139
  subjectName: subjectName,
125
- name: instance.GetCertInfoString(subjectName, validFromDate),
126
- cn: instance.GetCertName(subjectName),
127
- fio: instance.GetCertFio(subjectName),
128
- post: instance.GetCertPost(subjectName),
129
- ogrn: instance.GetCertOgrn(subjectName),
130
- organization: instance.GetCertOrg(subjectName),
131
- inn: instance.GetCertInn(subjectName),
140
+ name: instance.getCertInfoString(subjectName, validFromDate),
141
+ cn: instance.getCertName(subjectName),
142
+ fio: instance.getCertFio(subjectName),
143
+ post: instance.getCertPost(subjectName),
144
+ ogrn: instance.getCertOgrn(subjectName),
145
+ organization: instance.getCertOrg(subjectName),
146
+ inn: instance.getCertInn(subjectName),
132
147
  validFromDate: validFromDate.toLocaleDateString('ru-RU'),
133
148
  validToDate: validToDate.toLocaleDateString('ru-RU'),
134
149
  thumbprint: await cert.Thumbprint,
135
150
  issuerName: await cert.IssuerName,
136
151
  serialNumber: await cert.SerialNumber,
137
152
  isExpired: validToDate < new Date()
138
- });
153
+ };
154
+ let filterOk = true;
155
+ if (filter?.certificateCheck?.signerType === SignerTypeEnum.FL) {
156
+ filterOk = !certificate.ogrn;
157
+ }
158
+ else if ([SignerTypeEnum.UL, SignerTypeEnum.IP]
159
+ .indexOf(filter?.certificateCheck?.signerType || SignerTypeEnum.Unknown) > -1) {
160
+ filterOk = certificate.ogrn ? true : false;
161
+ if (filterOk) {
162
+ const organization = certificate.organization || certificate.cn;
163
+ if (organization) {
164
+ const orgIsValid = (filter?.certificateCheck?.fullName &&
165
+ strippingCharacters(organization) == strippingCharacters(filter?.certificateCheck?.fullName))
166
+ || (filter?.certificateCheck?.shortName &&
167
+ strippingCharacters(organization) == strippingCharacters(filter?.certificateCheck?.shortName));
168
+ if (!orgIsValid) {
169
+ filterOk = false;
170
+ }
171
+ }
172
+ else {
173
+ filterOk = false;
174
+ }
175
+ }
176
+ }
177
+ if (filterOk && filter?.certificateCheck?.signerType) {
178
+ const fio = certificate.fio.toLowerCase();
179
+ if (filter?.certificateCheck?.fio?.toLocaleLowerCase() !== fio) {
180
+ filterOk = false;
181
+ }
182
+ }
183
+ if (filterOk) {
184
+ certificates.push(certificate);
185
+ }
139
186
  }
140
187
  await store.Close();
141
188
  return certificates;
@@ -183,19 +230,12 @@ class CertificateSelectComponent extends SimpleModalComponent {
183
230
  }
184
231
  }
185
232
  CertificateSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: CertificateSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
186
- CertificateSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: CertificateSelectComponent, selector: "lib-certificate-select", usesInheritance: true, ngImport: i0, template: "<div class=\"modal-content open accent-head certificate\">\r\n <div class=\"modal-header\">\r\n <div class=\"modal-title\" [innerHTML]=\"'\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043A\u0430\u0442'\">\r\n </div>\r\n <span class='close close-click' (click)=\"close()\">\r\n <svg width='14' height='14' fill='none' xmlns='http://www.w3.org/2000/svg'>\r\n <path d='M13 1L1 13M1 1l12 12' stroke='#3A3A3A' stroke-width='1.5' stroke-linecap='round'\r\n stroke-linejoin='round' />\r\n </svg>\r\n </span>\r\n </div>\r\n <div class=\"modal-body text-center\">\r\n\r\n <div class=\"modal-body-other\">\r\n <div *ngFor=\"let cert of certificates\">\r\n <div class=\"modal-body-info\" *ngIf=\"!cert.isExpired\">\r\n <div class=\"modal-body-info__item\">\r\n <span class=\"text\">\r\n \u0412\u043B\u0430\u0434\u0435\u043B\u0435\u0446:\r\n </span>\r\n <span class=\"text\">\r\n {{cert.cn}}<br/>\r\n {{cert.fio}}<span *ngIf=\"cert.post\">, {{cert.post}}</span>\r\n </span>\r\n </div>\r\n <div class=\"modal-body-info__item\">\r\n <span class=\"text\">\r\n \u0421\u0440\u043E\u043A \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F:\r\n </span>\r\n <span class=\"text\">\r\n {{cert.validFromDate}} - {{cert.validToDate}}\r\n </span>\r\n </div>\r\n <div class=\"modal-body-info__item\">\r\n <span class=\"text hash\">\r\n {{cert.thumbprint}} {{cert.isExpired ? \"(\u0438\u0441\u0442\u0435\u043A)\" : \"\"}}\r\n </span>\r\n </div>\r\n <button\r\n (click)=\"ok(cert)\"\r\n [disabled]=\"cert.isExpired\"\r\n class=\"btn btn-md\">\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u043F\u043E\u0434\u043F\u0438\u0441\u044C</button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"modal-footer\">\r\n </div>\r\n</div>", styles: [":host{display:contents}:host textarea{width:100%;height:600px;border:0}\n"], directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
233
+ CertificateSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: CertificateSelectComponent, selector: "lib-certificate-select", usesInheritance: true, ngImport: i0, template: "<div class=\"modal-content open accent-head certificate\">\n <div class=\"modal-header\">\n <div class=\"modal-title\" [innerHTML]=\"'\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043A\u0430\u0442'\">\n </div>\n <span class='close close-click' (click)=\"close()\">\n <svg width='14' height='14' fill='none' xmlns='http://www.w3.org/2000/svg'>\n <path d='M13 1L1 13M1 1l12 12' stroke='#3A3A3A' stroke-width='1.5' stroke-linecap='round'\n stroke-linejoin='round' />\n </svg>\n </span>\n </div>\n <div class=\"modal-body text-center\">\n\n <div class=\"modal-body-other\">\n <div *ngFor=\"let cert of certificates\">\n <div class=\"modal-body-info\" *ngIf=\"!cert.isExpired\">\n <div class=\"modal-body-info__item\">\n <span class=\"text\">\n \u0412\u043B\u0430\u0434\u0435\u043B\u0435\u0446:\n </span>\n <span class=\"text\">\n {{cert.cn}}<br/>\n {{cert.fio}}<span *ngIf=\"cert.post\">, {{cert.post}}</span>\n </span>\n </div>\n <div class=\"modal-body-info__item\">\n <span class=\"text\">\n \u0421\u0440\u043E\u043A \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F:\n </span>\n <span class=\"text\">\n {{cert.validFromDate}} - {{cert.validToDate}}\n </span>\n </div>\n <div class=\"modal-body-info__item\">\n <span class=\"text hash\">\n {{cert.thumbprint}} {{cert.isExpired ? \"(\u0438\u0441\u0442\u0435\u043A)\" : \"\"}}\n </span>\n </div>\n <button\n (click)=\"ok(cert)\"\n [disabled]=\"cert.isExpired\"\n class=\"btn btn-md\">\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u043F\u043E\u0434\u043F\u0438\u0441\u044C</button>\n </div>\n </div>\n </div>\n </div>\n <div class=\"modal-footer\">\n </div>\n</div>", styles: [":host{display:contents}:host textarea{width:100%;height:600px;border:0}\n"], directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
187
234
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: CertificateSelectComponent, decorators: [{
188
235
  type: Component,
189
- args: [{ selector: 'lib-certificate-select', template: "<div class=\"modal-content open accent-head certificate\">\r\n <div class=\"modal-header\">\r\n <div class=\"modal-title\" [innerHTML]=\"'\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043A\u0430\u0442'\">\r\n </div>\r\n <span class='close close-click' (click)=\"close()\">\r\n <svg width='14' height='14' fill='none' xmlns='http://www.w3.org/2000/svg'>\r\n <path d='M13 1L1 13M1 1l12 12' stroke='#3A3A3A' stroke-width='1.5' stroke-linecap='round'\r\n stroke-linejoin='round' />\r\n </svg>\r\n </span>\r\n </div>\r\n <div class=\"modal-body text-center\">\r\n\r\n <div class=\"modal-body-other\">\r\n <div *ngFor=\"let cert of certificates\">\r\n <div class=\"modal-body-info\" *ngIf=\"!cert.isExpired\">\r\n <div class=\"modal-body-info__item\">\r\n <span class=\"text\">\r\n \u0412\u043B\u0430\u0434\u0435\u043B\u0435\u0446:\r\n </span>\r\n <span class=\"text\">\r\n {{cert.cn}}<br/>\r\n {{cert.fio}}<span *ngIf=\"cert.post\">, {{cert.post}}</span>\r\n </span>\r\n </div>\r\n <div class=\"modal-body-info__item\">\r\n <span class=\"text\">\r\n \u0421\u0440\u043E\u043A \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F:\r\n </span>\r\n <span class=\"text\">\r\n {{cert.validFromDate}} - {{cert.validToDate}}\r\n </span>\r\n </div>\r\n <div class=\"modal-body-info__item\">\r\n <span class=\"text hash\">\r\n {{cert.thumbprint}} {{cert.isExpired ? \"(\u0438\u0441\u0442\u0435\u043A)\" : \"\"}}\r\n </span>\r\n </div>\r\n <button\r\n (click)=\"ok(cert)\"\r\n [disabled]=\"cert.isExpired\"\r\n class=\"btn btn-md\">\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u043F\u043E\u0434\u043F\u0438\u0441\u044C</button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"modal-footer\">\r\n </div>\r\n</div>", styles: [":host{display:contents}:host textarea{width:100%;height:600px;border:0}\n"] }]
236
+ args: [{ selector: 'lib-certificate-select', template: "<div class=\"modal-content open accent-head certificate\">\n <div class=\"modal-header\">\n <div class=\"modal-title\" [innerHTML]=\"'\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043A\u0430\u0442'\">\n </div>\n <span class='close close-click' (click)=\"close()\">\n <svg width='14' height='14' fill='none' xmlns='http://www.w3.org/2000/svg'>\n <path d='M13 1L1 13M1 1l12 12' stroke='#3A3A3A' stroke-width='1.5' stroke-linecap='round'\n stroke-linejoin='round' />\n </svg>\n </span>\n </div>\n <div class=\"modal-body text-center\">\n\n <div class=\"modal-body-other\">\n <div *ngFor=\"let cert of certificates\">\n <div class=\"modal-body-info\" *ngIf=\"!cert.isExpired\">\n <div class=\"modal-body-info__item\">\n <span class=\"text\">\n \u0412\u043B\u0430\u0434\u0435\u043B\u0435\u0446:\n </span>\n <span class=\"text\">\n {{cert.cn}}<br/>\n {{cert.fio}}<span *ngIf=\"cert.post\">, {{cert.post}}</span>\n </span>\n </div>\n <div class=\"modal-body-info__item\">\n <span class=\"text\">\n \u0421\u0440\u043E\u043A \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F:\n </span>\n <span class=\"text\">\n {{cert.validFromDate}} - {{cert.validToDate}}\n </span>\n </div>\n <div class=\"modal-body-info__item\">\n <span class=\"text hash\">\n {{cert.thumbprint}} {{cert.isExpired ? \"(\u0438\u0441\u0442\u0435\u043A)\" : \"\"}}\n </span>\n </div>\n <button\n (click)=\"ok(cert)\"\n [disabled]=\"cert.isExpired\"\n class=\"btn btn-md\">\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u043F\u043E\u0434\u043F\u0438\u0441\u044C</button>\n </div>\n </div>\n </div>\n </div>\n <div class=\"modal-footer\">\n </div>\n</div>", styles: [":host{display:contents}:host textarea{width:100%;height:600px;border:0}\n"] }]
190
237
  }], ctorParameters: function () { return []; } });
191
238
 
192
- const strippingCharacters = (text) => {
193
- if (!text) {
194
- return '';
195
- }
196
- return text.replace(/\.|,|!|"|«|»|<|>|'|:|;|-|\\(|\\)/g, '').toLowerCase();
197
- };
198
-
199
239
  class CryptoProTsService extends CryptoProBaseService {
200
240
  constructor() {
201
241
  super();
@@ -382,43 +422,45 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
382
422
  }], ctorParameters: function () { return [{ type: i1$1.HttpClient }, { type: i0.Injector }]; } });
383
423
 
384
424
  class CryptoProvider {
385
- constructor(simpleModalService, cryptoService, alertService, cryptoApiService) {
425
+ constructor(simpleModalService, cryptoService, cryptoApiService) {
386
426
  this.simpleModalService = simpleModalService;
387
427
  this.cryptoService = cryptoService;
388
- this.alertService = alertService;
389
428
  this.cryptoApiService = cryptoApiService;
390
429
  }
391
- async sign(data, withLog, options) {
430
+ async sign(data, options) {
431
+ const withLog = options?.withLog;
392
432
  await this.cryptoService.startUp(withLog);
393
433
  const service = await this.cryptoService.getService(CryptoProAsyncService.key);
394
- const list = await service.getCertificates();
434
+ const list = await service.getCertificates({
435
+ certificateCheck: options?.certificateCheck
436
+ });
437
+ if (list.length === 0) {
438
+ return Promise.reject('Отсутствует подходящий сертификат');
439
+ }
395
440
  const modalResult = await this.simpleModalService
396
441
  .addModal(CertificateSelectComponent, { certificates: list }).toPromise();
397
442
  if (!modalResult.selected) {
398
443
  if (withLog) {
399
- console.log('No certificate selected, rejecting');
444
+ console.log('Сертификат не выбран, отмена');
400
445
  }
401
446
  return Promise.reject();
402
447
  }
403
448
  let certificateFail = 0;
404
449
  if (window.CRYPTO_SKIP_CHECK !== true) {
405
- if (options.checkFio &&
406
- modalResult.selected.fio.toLowerCase() !== options.checkFio.toLowerCase()) {
450
+ if (options?.certificateCheck?.fio &&
451
+ modalResult.selected.fio.toLowerCase() !== options?.certificateCheck?.fio.toLowerCase()) {
407
452
  certificateFail = 1;
408
453
  }
409
- // var ogrnIsValid = strippingCharacters(modalResult.selected.ogrn) == strippingCharacters(options.checkOgrn);
410
- //
411
- // if (options.checkOgrn && !ogrnIsValid) {
412
- // certificateFail = 2;
413
- // }
414
- if (options.checkOrganizationFullName || options.checkOrganizationShortName) {
454
+ if (options?.certificateCheck?.fullName || options?.certificateCheck?.shortName) {
415
455
  let organization = modalResult.selected.organization;
416
456
  if (!organization) {
417
457
  organization = modalResult.selected.cn;
418
458
  }
419
459
  if (organization) {
420
- const orgIsValid = strippingCharacters(organization) == strippingCharacters(options.checkOrganizationFullName)
421
- || strippingCharacters(organization) == strippingCharacters(options.checkOrganizationShortName);
460
+ const orgIsValid = (options?.certificateCheck?.fullName &&
461
+ strippingCharacters(organization) == strippingCharacters(options?.certificateCheck?.fullName))
462
+ || (options?.certificateCheck?.shortName &&
463
+ strippingCharacters(organization) == strippingCharacters(options?.certificateCheck?.shortName));
422
464
  if (!orgIsValid) {
423
465
  certificateFail = 2;
424
466
  }
@@ -427,39 +469,46 @@ class CryptoProvider {
427
469
  certificateFail = 2;
428
470
  }
429
471
  }
430
- if (!list.length) {
431
- console.warn('Not certificate found!');
432
- certificateFail = 3;
472
+ /** @deprecated */
473
+ if (options?.checkFio &&
474
+ modalResult.selected.fio.toLowerCase() !== options?.checkFio.toLowerCase()) {
475
+ certificateFail = 1;
476
+ }
477
+ if (options?.checkOrganizationFullName || options?.checkOrganizationShortName) {
478
+ let organization = modalResult.selected.organization;
479
+ if (!organization) {
480
+ organization = modalResult.selected.cn;
481
+ }
482
+ if (organization) {
483
+ const orgIsValid = (options?.checkOrganizationFullName &&
484
+ strippingCharacters(organization) == strippingCharacters(options?.checkOrganizationFullName))
485
+ || (options?.checkOrganizationShortName &&
486
+ strippingCharacters(organization) == strippingCharacters(options?.checkOrganizationShortName));
487
+ if (!orgIsValid) {
488
+ certificateFail = 2;
489
+ }
490
+ }
491
+ else {
492
+ certificateFail = 2;
493
+ }
433
494
  }
434
495
  }
435
496
  if (certificateFail > 0) {
436
- // this.alertService.showDialog({
437
- // title: 'Ошибка сертификата',
438
- // message: certificateFail == 1 ?
439
- // 'Данные лица, подписывающего заявку не совпадают с данными усиленной квалифицированной подписи.' :
440
- // certificateFail === 3 ? 'Отсутствует сертификат с данными усиленной квалифицированной подписи' :
441
- // 'Данные организации не совпадают с данными усиленной квалифицированной подписи. ' +
442
- // 'Убедитесь, что вы используете сертификат, выданные от организации.',
443
- // color: DialogColor.red,
444
- // type: DialogType.alert,
445
- // okCallback: (ok) => {
446
- // //
447
- // }
448
- // });
449
497
  return Promise.reject(certificateFail == 1 ?
450
498
  'Данные лица, подписывающего заявку не совпадают с данными усиленной квалифицированной подписи.' :
451
- certificateFail === 3 ? 'Отсутствует активный КриптоПровайдер (не установлен либо недоступен плагин). Чтобы подписать, установите плагин КриптоПро и проверьте наличие сертификата' :
499
+ certificateFail === 3 ? 'Отсутствует активный КриптоПровайдер (не установлен либо недоступен плагин). ' +
500
+ 'Чтобы подписать, установите плагин КриптоПро и проверьте наличие сертификата' :
452
501
  'Данные организации не совпадают с данными усиленной квалифицированной подписи. ' +
453
502
  'Убедитесь, что вы используете сертификат, выданные от организации.');
454
503
  }
455
504
  if (withLog) {
456
- console.log('Signing data', data);
505
+ console.log('Подписываемые данные', data);
457
506
  }
458
507
  const signedData = await service.signBase64(modalResult.selected.certificate, data, true);
459
508
  if (withLog) {
460
- console.log('Signing data', data);
509
+ console.log('Подписанные данные', signedData);
461
510
  }
462
- if (!options.skipServerCheck) {
511
+ if (!options?.skipServerCheck) {
463
512
  const verifyResult = await this.cryptoApiService.verify({
464
513
  data: data,
465
514
  signature: Base64.encode(signedData),
@@ -482,14 +531,14 @@ class CryptoProvider {
482
531
  }
483
532
  }
484
533
  }
485
- CryptoProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: CryptoProvider, deps: [{ token: i1$2.SimpleModalService }, { token: CryptoService }, { token: i3.AlertService }, { token: CryptoApiService }], target: i0.ɵɵFactoryTarget.Injectable });
534
+ CryptoProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: CryptoProvider, deps: [{ token: i1$2.SimpleModalService }, { token: CryptoService }, { token: CryptoApiService }], target: i0.ɵɵFactoryTarget.Injectable });
486
535
  CryptoProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: CryptoProvider, providedIn: 'root' });
487
536
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: CryptoProvider, decorators: [{
488
537
  type: Injectable,
489
538
  args: [{
490
539
  providedIn: 'root'
491
540
  }]
492
- }], ctorParameters: function () { return [{ type: i1$2.SimpleModalService }, { type: CryptoService }, { type: i3.AlertService }, { type: CryptoApiService }]; } });
541
+ }], ctorParameters: function () { return [{ type: i1$2.SimpleModalService }, { type: CryptoService }, { type: CryptoApiService }]; } });
493
542
 
494
543
  class CryptoJinnProvider {
495
544
  constructor(simpleModalService, cryptoService, cryptoApiService) {
@@ -497,7 +546,8 @@ class CryptoJinnProvider {
497
546
  this.cryptoService = cryptoService;
498
547
  this.cryptoApiService = cryptoApiService;
499
548
  }
500
- async sign(data, withLog, options) {
549
+ async sign(data, options) {
550
+ const withLog = options?.withLog;
501
551
  await this.cryptoService.startUp(withLog);
502
552
  const service = await this.cryptoService.getService(CryptoProAsyncService.key);
503
553
  const list = await service.getCertificates();
@@ -537,7 +587,8 @@ class CryptoTsProvider {
537
587
  this.cryptoService = cryptoService;
538
588
  this.cryptoApiService = cryptoApiService;
539
589
  }
540
- async sign(data, withLog, options) {
590
+ async sign(data, options) {
591
+ const withLog = options?.withLog;
541
592
  await this.cryptoService.startUp(withLog);
542
593
  const service = await this.cryptoService.getService(CryptoProTsService.key);
543
594
  const list = await service.getCertificates();
@@ -550,7 +601,7 @@ class CryptoTsProvider {
550
601
  return Promise.reject();
551
602
  }
552
603
  const signedData = await service.sign(modalResult.selected.certificate, data);
553
- if (!options.skipServerCheck) {
604
+ if (!options?.skipServerCheck) {
554
605
  const validateResult = await this.cryptoApiService.validate(signedData).toPromise();
555
606
  return {
556
607
  data,
@@ -581,7 +632,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
581
632
  }], ctorParameters: function () { return [{ type: i1$2.SimpleModalService }, { type: CryptoService }, { type: CryptoApiService }]; } });
582
633
 
583
634
  class EmptyProvider {
584
- async sign(data, withLog, options) {
635
+ async sign(data, options) {
585
636
  return Promise.resolve({
586
637
  data: data,
587
638
  success: true
@@ -702,8 +753,10 @@ class SignModalComponent extends SimpleModalComponent {
702
753
  break;
703
754
  }
704
755
  this.signProviderFactory.create(this.provider)
705
- .sign(signData, this.withLog, {
756
+ .sign(signData, {
706
757
  skipServerCheck: this.skipServerCheck,
758
+ withLog: this.withLog,
759
+ certificateCheck: this.certificateCheck,
707
760
  checkFio: this.checkFio,
708
761
  checkOgrn: this.checkOgrn,
709
762
  checkOrganizationFullName: this.checkOrganizationFullName,
@@ -739,14 +792,17 @@ class SignModalComponent extends SimpleModalComponent {
739
792
  if (this.withLog) {
740
793
  console.error(error);
741
794
  }
742
- this.alertService.showDialog({
743
- title: 'Ошибка проверки подписи',
744
- message: typeof (error) == 'string' ? error : JSON.stringify(error),
745
- color: DialogColor.red,
746
- type: DialogType.alert,
747
- okCallback: (ok) => {
748
- }
749
- });
795
+ if (error) {
796
+ this.alertService.showDialog({
797
+ title: 'Ошибка проверки подписи',
798
+ message: typeof (error) == 'string' ? error : JSON.stringify(error),
799
+ color: DialogColor.red,
800
+ type: DialogType.alert,
801
+ okCallback: (ok) => {
802
+ //
803
+ }
804
+ });
805
+ }
750
806
  }
751
807
  downloadXml() {
752
808
  if (!this.xmlUrl) {
@@ -791,10 +847,10 @@ class SignModalComponent extends SimpleModalComponent {
791
847
  }
792
848
  }
793
849
  SignModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SignModalComponent, deps: [{ token: SignProviderFactory }, { token: DownloadService }, { token: i3.AlertService }], target: i0.ɵɵFactoryTarget.Component });
794
- SignModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: SignModalComponent, selector: "lib-sign-modal", usesInheritance: true, ngImport: i0, template: "<div class=\"modal-content accent-head xl\">\r\n <div class=\"modal-header\">\r\n <div class=\"modal-title uppercase\">\r\n <h4 class=\"ng-binding\">{{title || '\u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u043D\u0430 \u043F\u043E\u0434\u043F\u0438\u0441\u0430\u043D\u0438\u0435'}}</h4>\r\n </div>\r\n <span class=\"close close-click\" (click)=\"close()\">\r\n <svg width=\"14\" height=\"14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path d=\"M13 1L1 13M1 1l12 12\" stroke=\"#3A3A3A\" stroke-width=\"1.5\" stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"></path>\r\n </svg>\r\n </span>\r\n </div>\r\n\r\n <div class=\"modal-body text-center\">\r\n <div class=\"widget\">\r\n <my-tabs>\r\n <app-tab tabTitle=\"\u0412\u0438\u0437\u0443\u0430\u043B\u0438\u0437\u0430\u0446\u0438\u044F \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\" *ngIf=\"pdfUrl\">\r\n <pre *ngIf=\"downloadingPdf\">\r\n \u041F\u043E\u0434\u043E\u0436\u0434\u0438\u0442\u0435, \u0438\u0434\u0435\u0442 \u0444\u043E\u0440\u043C\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\r\n </pre>\r\n <iframe *ngIf=\"!downloadingPdf\" [src]=\"pdfViewUrl | safeurl\"\r\n title=\"webviewer\" frameborder=\"0\" width=\"100%\" height=\"800\"></iframe>\r\n </app-tab>\r\n <app-tab tabTitle=\"\u041F\u043E\u0434\u043F\u0438\u0441\u044B\u0432\u0430\u0435\u043C\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435\" *ngIf=\"xmlUrl\">\r\n <pre [innerText]=\"xmlToSign\"></pre>\r\n </app-tab>\r\n </my-tabs>\r\n </div>\r\n </div>\r\n\r\n <div class=\"modal-footer\">\r\n <div *ngIf=\"pdfUrl || xmlUrl || additionalPdfUrl\"\r\n class=\"modal-footer-item\">\r\n <a *ngIf=\"pdfUrl\"\r\n class=\"modal-footer-item__link\"\r\n target=\"_blank\"\r\n [href]=\"pdfUrl\">\r\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path\r\n d=\"M18 21.25H6C5.30964 21.25 4.75 20.6904 4.75 20V4C4.75 3.30964 5.30964 2.75 6 2.75H13.1893L19.25 8.81066V20C19.25 20.6904 18.6904 21.25 18 21.25Z\"\r\n stroke=\"#282828\" stroke-width=\"1.5\"/>\r\n </svg>\r\n <span>\u0421\u043A\u0430\u0447\u0430\u0442\u044C \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442</span>\r\n </a>\r\n <a *ngIf=\"xmlUrl\"\r\n class=\"modal-footer-item__link\"\r\n target=\"_blank\"\r\n [href]=\"xmlUrl\">\r\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path d=\"M6 16L2 12L6 8\" stroke=\"#282828\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n <path d=\"M18 16L22 12L18 8\" stroke=\"#282828\" stroke-width=\"1.5\" stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"/>\r\n <path d=\"M7.56689 19.1782L15.5669 5.32182\" stroke=\"#282828\" stroke-width=\"1.5\" stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"/>\r\n </svg>\r\n <span>\u0421\u043A\u0430\u0447\u0430\u0442\u044C XML-\u0434\u0430\u043D\u043D\u044B\u0435</span>\r\n </a>\r\n <a *ngIf=\"additionalPdfUrl\"\r\n class=\"modal-footer-item__link\"\r\n target=\"_blank\"\r\n [href]=\"additionalPdfUrl\">\r\n <svg width=\"24\" height=\"20\" viewBox=\"0 0 24 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M7.21404 14.2776C7.50693 13.9847 7.98181 13.9847 8.2747 14.2776L12.2747 18.2776C12.5676 18.5705 12.5676 19.0454 12.2747 19.3383C11.9818 19.6312 11.5069 19.6312 11.214 19.3383L7.21404 15.3383C6.92115 15.0454 6.92115 14.5705 7.21404 14.2776Z\" fill=\"#33373C\"/>\r\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M16.2747 14.2776C16.5676 14.5705 16.5676 15.0454 16.2747 15.3383L12.2747 19.3383C11.9818 19.6312 11.5069 19.6312 11.214 19.3383C10.9211 19.0454 10.9211 18.5705 11.214 18.2776L15.214 14.2776C15.5069 13.9847 15.9818 13.9847 16.2747 14.2776Z\" fill=\"#33373C\"/>\r\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M11.7444 9.05796C12.1586 9.05796 12.4944 9.39374 12.4944 9.80796V18.808C12.4944 19.2222 12.1586 19.558 11.7444 19.558C11.3302 19.558 10.9944 19.2222 10.9944 18.808V9.80796C10.9944 9.39374 11.3302 9.05796 11.7444 9.05796Z\" fill=\"#33373C\"/>\r\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M0.978206 4.66339C2.62297 1.48351 6.12559 -0.37405 9.73462 0.063407C13.146 0.476912 15.9708 2.84408 17.0094 6.05796H17.7444C20.2757 6.05796 22.4565 7.67267 23.2559 10.0708C23.2593 10.0811 23.2625 10.0915 23.2655 10.1019C23.9483 12.4917 23.1511 15.0227 21.0835 16.516C20.7477 16.7585 20.2789 16.6829 20.0364 16.3471C19.7938 16.0113 19.8695 15.5425 20.2053 15.2999C21.7333 14.1964 22.337 12.335 21.8277 10.5297C21.223 8.73647 19.6077 7.55796 17.7444 7.55796H16.4444C16.1002 7.55796 15.8002 7.32373 15.7168 6.98986C14.9919 4.0904 12.5447 1.915 9.55412 1.55251C6.56314 1.18997 3.66577 2.7324 2.31053 5.35252C0.950478 7.98196 1.3145 11.2478 3.3074 13.5125C3.58105 13.8234 3.5508 14.2974 3.23984 14.571C2.92888 14.8446 2.45498 14.8144 2.18133 14.5034C-0.225765 11.7681 -0.66174 7.83395 0.978206 4.66339Z\" fill=\"#33373C\"/>\r\n </svg>\r\n <span>{{additionalPdfUrlTitle}}</span>\r\n </a>\r\n </div>\r\n <div class=\"modal-footer-item\">\r\n <button\r\n class=\"mrx-btn mrx-btn-secondary mrx-btn-md wpx-120 mr-3\"\r\n (click)=\"cancel()\"\r\n >\r\n <div class=\"mrx-btn-label\">{{cancelLabel || '\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C'}}</div>\r\n </button>\r\n <button\r\n class=\"mrx-btn mrx-btn-primary mrx-btn-md\"\r\n [disabled]=\"disabled\"\r\n (click)=\"ok()\"\r\n >\r\n <div class=\"mrx-btn-label\">{{okLabel || '\u041F\u043E\u0434\u043F\u0438\u0441\u0430\u0442\u044C'}}</div>\r\n </button>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [":host{display:contents}:host pre{width:100%;height:600px;border:0;text-align:left;overflow-y:scroll}.modal-footer{justify-content:space-between;align-items:center}.modal-footer-item__link{display:inline-flex;align-items:center;font-family:PT Sans,sans-serif;font-weight:700;font-size:14px;line-height:160%;color:var(--Main1);margin-right:16px}.modal-footer-item__link svg{margin-right:4px}.modal-body iframe{height:600px}pre{height:600px;overflow:scroll}\n"], components: [{ type: i3.TabsComponent, selector: "my-tabs" }, { type: i3.TabComponent, selector: "app-tab", inputs: ["tabTitle", "active"] }], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "safeurl": i3.SafeUrlPipe } });
850
+ SignModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: SignModalComponent, selector: "lib-sign-modal", usesInheritance: true, ngImport: i0, template: "<div class=\"modal-content accent-head xl\">\n <div class=\"modal-header\">\n <div class=\"modal-title uppercase\">\n <h4 class=\"ng-binding\">{{title || '\u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u043D\u0430 \u043F\u043E\u0434\u043F\u0438\u0441\u0430\u043D\u0438\u0435'}}</h4>\n </div>\n <span class=\"close close-click\" (click)=\"close()\">\n <svg width=\"14\" height=\"14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M13 1L1 13M1 1l12 12\" stroke=\"#3A3A3A\" stroke-width=\"1.5\" stroke-linecap=\"round\"\n stroke-linejoin=\"round\"></path>\n </svg>\n </span>\n </div>\n\n <div class=\"modal-body text-center\">\n <div class=\"widget\">\n <my-tabs>\n <app-tab tabTitle=\"\u0412\u0438\u0437\u0443\u0430\u043B\u0438\u0437\u0430\u0446\u0438\u044F \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\" *ngIf=\"pdfUrl\">\n <pre *ngIf=\"downloadingPdf\">\n \u041F\u043E\u0434\u043E\u0436\u0434\u0438\u0442\u0435, \u0438\u0434\u0435\u0442 \u0444\u043E\u0440\u043C\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\n </pre>\n <iframe *ngIf=\"!downloadingPdf\" [src]=\"pdfViewUrl | safeurl\"\n title=\"webviewer\" frameborder=\"0\" width=\"100%\" height=\"800\"></iframe>\n </app-tab>\n <app-tab tabTitle=\"\u041F\u043E\u0434\u043F\u0438\u0441\u044B\u0432\u0430\u0435\u043C\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435\" *ngIf=\"xmlUrl\">\n <pre [innerText]=\"xmlToSign\"></pre>\n </app-tab>\n </my-tabs>\n </div>\n </div>\n\n <div class=\"modal-footer\">\n <div *ngIf=\"pdfUrl || xmlUrl || additionalPdfUrl\"\n class=\"modal-footer-item\">\n <a *ngIf=\"pdfUrl\"\n class=\"modal-footer-item__link\"\n target=\"_blank\"\n [href]=\"pdfUrl\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M18 21.25H6C5.30964 21.25 4.75 20.6904 4.75 20V4C4.75 3.30964 5.30964 2.75 6 2.75H13.1893L19.25 8.81066V20C19.25 20.6904 18.6904 21.25 18 21.25Z\"\n stroke=\"#282828\" stroke-width=\"1.5\"/>\n </svg>\n <span>\u0421\u043A\u0430\u0447\u0430\u0442\u044C \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442</span>\n </a>\n <a *ngIf=\"xmlUrl\"\n class=\"modal-footer-item__link\"\n target=\"_blank\"\n [href]=\"xmlUrl\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M6 16L2 12L6 8\" stroke=\"#282828\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M18 16L22 12L18 8\" stroke=\"#282828\" stroke-width=\"1.5\" stroke-linecap=\"round\"\n stroke-linejoin=\"round\"/>\n <path d=\"M7.56689 19.1782L15.5669 5.32182\" stroke=\"#282828\" stroke-width=\"1.5\" stroke-linecap=\"round\"\n stroke-linejoin=\"round\"/>\n </svg>\n <span>\u0421\u043A\u0430\u0447\u0430\u0442\u044C XML-\u0434\u0430\u043D\u043D\u044B\u0435</span>\n </a>\n <a *ngIf=\"additionalPdfUrl\"\n class=\"modal-footer-item__link\"\n target=\"_blank\"\n [href]=\"additionalPdfUrl\">\n <svg width=\"24\" height=\"20\" viewBox=\"0 0 24 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M7.21404 14.2776C7.50693 13.9847 7.98181 13.9847 8.2747 14.2776L12.2747 18.2776C12.5676 18.5705 12.5676 19.0454 12.2747 19.3383C11.9818 19.6312 11.5069 19.6312 11.214 19.3383L7.21404 15.3383C6.92115 15.0454 6.92115 14.5705 7.21404 14.2776Z\" fill=\"#33373C\"/>\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M16.2747 14.2776C16.5676 14.5705 16.5676 15.0454 16.2747 15.3383L12.2747 19.3383C11.9818 19.6312 11.5069 19.6312 11.214 19.3383C10.9211 19.0454 10.9211 18.5705 11.214 18.2776L15.214 14.2776C15.5069 13.9847 15.9818 13.9847 16.2747 14.2776Z\" fill=\"#33373C\"/>\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M11.7444 9.05796C12.1586 9.05796 12.4944 9.39374 12.4944 9.80796V18.808C12.4944 19.2222 12.1586 19.558 11.7444 19.558C11.3302 19.558 10.9944 19.2222 10.9944 18.808V9.80796C10.9944 9.39374 11.3302 9.05796 11.7444 9.05796Z\" fill=\"#33373C\"/>\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M0.978206 4.66339C2.62297 1.48351 6.12559 -0.37405 9.73462 0.063407C13.146 0.476912 15.9708 2.84408 17.0094 6.05796H17.7444C20.2757 6.05796 22.4565 7.67267 23.2559 10.0708C23.2593 10.0811 23.2625 10.0915 23.2655 10.1019C23.9483 12.4917 23.1511 15.0227 21.0835 16.516C20.7477 16.7585 20.2789 16.6829 20.0364 16.3471C19.7938 16.0113 19.8695 15.5425 20.2053 15.2999C21.7333 14.1964 22.337 12.335 21.8277 10.5297C21.223 8.73647 19.6077 7.55796 17.7444 7.55796H16.4444C16.1002 7.55796 15.8002 7.32373 15.7168 6.98986C14.9919 4.0904 12.5447 1.915 9.55412 1.55251C6.56314 1.18997 3.66577 2.7324 2.31053 5.35252C0.950478 7.98196 1.3145 11.2478 3.3074 13.5125C3.58105 13.8234 3.5508 14.2974 3.23984 14.571C2.92888 14.8446 2.45498 14.8144 2.18133 14.5034C-0.225765 11.7681 -0.66174 7.83395 0.978206 4.66339Z\" fill=\"#33373C\"/>\n </svg>\n <span>{{additionalPdfUrlTitle}}</span>\n </a>\n </div>\n <div class=\"modal-footer-item\">\n <button\n class=\"mrx-btn mrx-btn-secondary mrx-btn-md wpx-120 mr-3\"\n (click)=\"cancel()\"\n >\n <div class=\"mrx-btn-label\">{{cancelLabel || '\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C'}}</div>\n </button>\n <button\n class=\"mrx-btn mrx-btn-primary mrx-btn-md\"\n [disabled]=\"disabled\"\n (click)=\"ok()\"\n >\n <div class=\"mrx-btn-label\">{{okLabel || '\u041F\u043E\u0434\u043F\u0438\u0441\u0430\u0442\u044C'}}</div>\n </button>\n </div>\n </div>\n</div>\n", styles: [":host{display:contents}:host pre{width:100%;height:600px;border:0;text-align:left;overflow-y:scroll}.modal-footer{justify-content:space-between;align-items:center}.modal-footer-item__link{display:inline-flex;align-items:center;font-family:PT Sans,sans-serif;font-weight:700;font-size:14px;line-height:160%;color:var(--Main1);margin-right:16px}.modal-footer-item__link svg{margin-right:4px}.modal-body iframe{height:600px}pre{height:600px;overflow:scroll}\n"], components: [{ type: i3.TabsComponent, selector: "my-tabs" }, { type: i3.TabComponent, selector: "app-tab", inputs: ["tabTitle", "active"] }], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "safeurl": i3.SafeUrlPipe } });
795
851
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SignModalComponent, decorators: [{
796
852
  type: Component,
797
- args: [{ selector: 'lib-sign-modal', template: "<div class=\"modal-content accent-head xl\">\r\n <div class=\"modal-header\">\r\n <div class=\"modal-title uppercase\">\r\n <h4 class=\"ng-binding\">{{title || '\u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u043D\u0430 \u043F\u043E\u0434\u043F\u0438\u0441\u0430\u043D\u0438\u0435'}}</h4>\r\n </div>\r\n <span class=\"close close-click\" (click)=\"close()\">\r\n <svg width=\"14\" height=\"14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path d=\"M13 1L1 13M1 1l12 12\" stroke=\"#3A3A3A\" stroke-width=\"1.5\" stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"></path>\r\n </svg>\r\n </span>\r\n </div>\r\n\r\n <div class=\"modal-body text-center\">\r\n <div class=\"widget\">\r\n <my-tabs>\r\n <app-tab tabTitle=\"\u0412\u0438\u0437\u0443\u0430\u043B\u0438\u0437\u0430\u0446\u0438\u044F \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\" *ngIf=\"pdfUrl\">\r\n <pre *ngIf=\"downloadingPdf\">\r\n \u041F\u043E\u0434\u043E\u0436\u0434\u0438\u0442\u0435, \u0438\u0434\u0435\u0442 \u0444\u043E\u0440\u043C\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\r\n </pre>\r\n <iframe *ngIf=\"!downloadingPdf\" [src]=\"pdfViewUrl | safeurl\"\r\n title=\"webviewer\" frameborder=\"0\" width=\"100%\" height=\"800\"></iframe>\r\n </app-tab>\r\n <app-tab tabTitle=\"\u041F\u043E\u0434\u043F\u0438\u0441\u044B\u0432\u0430\u0435\u043C\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435\" *ngIf=\"xmlUrl\">\r\n <pre [innerText]=\"xmlToSign\"></pre>\r\n </app-tab>\r\n </my-tabs>\r\n </div>\r\n </div>\r\n\r\n <div class=\"modal-footer\">\r\n <div *ngIf=\"pdfUrl || xmlUrl || additionalPdfUrl\"\r\n class=\"modal-footer-item\">\r\n <a *ngIf=\"pdfUrl\"\r\n class=\"modal-footer-item__link\"\r\n target=\"_blank\"\r\n [href]=\"pdfUrl\">\r\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path\r\n d=\"M18 21.25H6C5.30964 21.25 4.75 20.6904 4.75 20V4C4.75 3.30964 5.30964 2.75 6 2.75H13.1893L19.25 8.81066V20C19.25 20.6904 18.6904 21.25 18 21.25Z\"\r\n stroke=\"#282828\" stroke-width=\"1.5\"/>\r\n </svg>\r\n <span>\u0421\u043A\u0430\u0447\u0430\u0442\u044C \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442</span>\r\n </a>\r\n <a *ngIf=\"xmlUrl\"\r\n class=\"modal-footer-item__link\"\r\n target=\"_blank\"\r\n [href]=\"xmlUrl\">\r\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path d=\"M6 16L2 12L6 8\" stroke=\"#282828\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n <path d=\"M18 16L22 12L18 8\" stroke=\"#282828\" stroke-width=\"1.5\" stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"/>\r\n <path d=\"M7.56689 19.1782L15.5669 5.32182\" stroke=\"#282828\" stroke-width=\"1.5\" stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"/>\r\n </svg>\r\n <span>\u0421\u043A\u0430\u0447\u0430\u0442\u044C XML-\u0434\u0430\u043D\u043D\u044B\u0435</span>\r\n </a>\r\n <a *ngIf=\"additionalPdfUrl\"\r\n class=\"modal-footer-item__link\"\r\n target=\"_blank\"\r\n [href]=\"additionalPdfUrl\">\r\n <svg width=\"24\" height=\"20\" viewBox=\"0 0 24 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M7.21404 14.2776C7.50693 13.9847 7.98181 13.9847 8.2747 14.2776L12.2747 18.2776C12.5676 18.5705 12.5676 19.0454 12.2747 19.3383C11.9818 19.6312 11.5069 19.6312 11.214 19.3383L7.21404 15.3383C6.92115 15.0454 6.92115 14.5705 7.21404 14.2776Z\" fill=\"#33373C\"/>\r\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M16.2747 14.2776C16.5676 14.5705 16.5676 15.0454 16.2747 15.3383L12.2747 19.3383C11.9818 19.6312 11.5069 19.6312 11.214 19.3383C10.9211 19.0454 10.9211 18.5705 11.214 18.2776L15.214 14.2776C15.5069 13.9847 15.9818 13.9847 16.2747 14.2776Z\" fill=\"#33373C\"/>\r\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M11.7444 9.05796C12.1586 9.05796 12.4944 9.39374 12.4944 9.80796V18.808C12.4944 19.2222 12.1586 19.558 11.7444 19.558C11.3302 19.558 10.9944 19.2222 10.9944 18.808V9.80796C10.9944 9.39374 11.3302 9.05796 11.7444 9.05796Z\" fill=\"#33373C\"/>\r\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M0.978206 4.66339C2.62297 1.48351 6.12559 -0.37405 9.73462 0.063407C13.146 0.476912 15.9708 2.84408 17.0094 6.05796H17.7444C20.2757 6.05796 22.4565 7.67267 23.2559 10.0708C23.2593 10.0811 23.2625 10.0915 23.2655 10.1019C23.9483 12.4917 23.1511 15.0227 21.0835 16.516C20.7477 16.7585 20.2789 16.6829 20.0364 16.3471C19.7938 16.0113 19.8695 15.5425 20.2053 15.2999C21.7333 14.1964 22.337 12.335 21.8277 10.5297C21.223 8.73647 19.6077 7.55796 17.7444 7.55796H16.4444C16.1002 7.55796 15.8002 7.32373 15.7168 6.98986C14.9919 4.0904 12.5447 1.915 9.55412 1.55251C6.56314 1.18997 3.66577 2.7324 2.31053 5.35252C0.950478 7.98196 1.3145 11.2478 3.3074 13.5125C3.58105 13.8234 3.5508 14.2974 3.23984 14.571C2.92888 14.8446 2.45498 14.8144 2.18133 14.5034C-0.225765 11.7681 -0.66174 7.83395 0.978206 4.66339Z\" fill=\"#33373C\"/>\r\n </svg>\r\n <span>{{additionalPdfUrlTitle}}</span>\r\n </a>\r\n </div>\r\n <div class=\"modal-footer-item\">\r\n <button\r\n class=\"mrx-btn mrx-btn-secondary mrx-btn-md wpx-120 mr-3\"\r\n (click)=\"cancel()\"\r\n >\r\n <div class=\"mrx-btn-label\">{{cancelLabel || '\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C'}}</div>\r\n </button>\r\n <button\r\n class=\"mrx-btn mrx-btn-primary mrx-btn-md\"\r\n [disabled]=\"disabled\"\r\n (click)=\"ok()\"\r\n >\r\n <div class=\"mrx-btn-label\">{{okLabel || '\u041F\u043E\u0434\u043F\u0438\u0441\u0430\u0442\u044C'}}</div>\r\n </button>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [":host{display:contents}:host pre{width:100%;height:600px;border:0;text-align:left;overflow-y:scroll}.modal-footer{justify-content:space-between;align-items:center}.modal-footer-item__link{display:inline-flex;align-items:center;font-family:PT Sans,sans-serif;font-weight:700;font-size:14px;line-height:160%;color:var(--Main1);margin-right:16px}.modal-footer-item__link svg{margin-right:4px}.modal-body iframe{height:600px}pre{height:600px;overflow:scroll}\n"] }]
853
+ args: [{ selector: 'lib-sign-modal', template: "<div class=\"modal-content accent-head xl\">\n <div class=\"modal-header\">\n <div class=\"modal-title uppercase\">\n <h4 class=\"ng-binding\">{{title || '\u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u043D\u0430 \u043F\u043E\u0434\u043F\u0438\u0441\u0430\u043D\u0438\u0435'}}</h4>\n </div>\n <span class=\"close close-click\" (click)=\"close()\">\n <svg width=\"14\" height=\"14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M13 1L1 13M1 1l12 12\" stroke=\"#3A3A3A\" stroke-width=\"1.5\" stroke-linecap=\"round\"\n stroke-linejoin=\"round\"></path>\n </svg>\n </span>\n </div>\n\n <div class=\"modal-body text-center\">\n <div class=\"widget\">\n <my-tabs>\n <app-tab tabTitle=\"\u0412\u0438\u0437\u0443\u0430\u043B\u0438\u0437\u0430\u0446\u0438\u044F \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\" *ngIf=\"pdfUrl\">\n <pre *ngIf=\"downloadingPdf\">\n \u041F\u043E\u0434\u043E\u0436\u0434\u0438\u0442\u0435, \u0438\u0434\u0435\u0442 \u0444\u043E\u0440\u043C\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\n </pre>\n <iframe *ngIf=\"!downloadingPdf\" [src]=\"pdfViewUrl | safeurl\"\n title=\"webviewer\" frameborder=\"0\" width=\"100%\" height=\"800\"></iframe>\n </app-tab>\n <app-tab tabTitle=\"\u041F\u043E\u0434\u043F\u0438\u0441\u044B\u0432\u0430\u0435\u043C\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435\" *ngIf=\"xmlUrl\">\n <pre [innerText]=\"xmlToSign\"></pre>\n </app-tab>\n </my-tabs>\n </div>\n </div>\n\n <div class=\"modal-footer\">\n <div *ngIf=\"pdfUrl || xmlUrl || additionalPdfUrl\"\n class=\"modal-footer-item\">\n <a *ngIf=\"pdfUrl\"\n class=\"modal-footer-item__link\"\n target=\"_blank\"\n [href]=\"pdfUrl\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M18 21.25H6C5.30964 21.25 4.75 20.6904 4.75 20V4C4.75 3.30964 5.30964 2.75 6 2.75H13.1893L19.25 8.81066V20C19.25 20.6904 18.6904 21.25 18 21.25Z\"\n stroke=\"#282828\" stroke-width=\"1.5\"/>\n </svg>\n <span>\u0421\u043A\u0430\u0447\u0430\u0442\u044C \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442</span>\n </a>\n <a *ngIf=\"xmlUrl\"\n class=\"modal-footer-item__link\"\n target=\"_blank\"\n [href]=\"xmlUrl\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M6 16L2 12L6 8\" stroke=\"#282828\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M18 16L22 12L18 8\" stroke=\"#282828\" stroke-width=\"1.5\" stroke-linecap=\"round\"\n stroke-linejoin=\"round\"/>\n <path d=\"M7.56689 19.1782L15.5669 5.32182\" stroke=\"#282828\" stroke-width=\"1.5\" stroke-linecap=\"round\"\n stroke-linejoin=\"round\"/>\n </svg>\n <span>\u0421\u043A\u0430\u0447\u0430\u0442\u044C XML-\u0434\u0430\u043D\u043D\u044B\u0435</span>\n </a>\n <a *ngIf=\"additionalPdfUrl\"\n class=\"modal-footer-item__link\"\n target=\"_blank\"\n [href]=\"additionalPdfUrl\">\n <svg width=\"24\" height=\"20\" viewBox=\"0 0 24 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M7.21404 14.2776C7.50693 13.9847 7.98181 13.9847 8.2747 14.2776L12.2747 18.2776C12.5676 18.5705 12.5676 19.0454 12.2747 19.3383C11.9818 19.6312 11.5069 19.6312 11.214 19.3383L7.21404 15.3383C6.92115 15.0454 6.92115 14.5705 7.21404 14.2776Z\" fill=\"#33373C\"/>\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M16.2747 14.2776C16.5676 14.5705 16.5676 15.0454 16.2747 15.3383L12.2747 19.3383C11.9818 19.6312 11.5069 19.6312 11.214 19.3383C10.9211 19.0454 10.9211 18.5705 11.214 18.2776L15.214 14.2776C15.5069 13.9847 15.9818 13.9847 16.2747 14.2776Z\" fill=\"#33373C\"/>\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M11.7444 9.05796C12.1586 9.05796 12.4944 9.39374 12.4944 9.80796V18.808C12.4944 19.2222 12.1586 19.558 11.7444 19.558C11.3302 19.558 10.9944 19.2222 10.9944 18.808V9.80796C10.9944 9.39374 11.3302 9.05796 11.7444 9.05796Z\" fill=\"#33373C\"/>\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M0.978206 4.66339C2.62297 1.48351 6.12559 -0.37405 9.73462 0.063407C13.146 0.476912 15.9708 2.84408 17.0094 6.05796H17.7444C20.2757 6.05796 22.4565 7.67267 23.2559 10.0708C23.2593 10.0811 23.2625 10.0915 23.2655 10.1019C23.9483 12.4917 23.1511 15.0227 21.0835 16.516C20.7477 16.7585 20.2789 16.6829 20.0364 16.3471C19.7938 16.0113 19.8695 15.5425 20.2053 15.2999C21.7333 14.1964 22.337 12.335 21.8277 10.5297C21.223 8.73647 19.6077 7.55796 17.7444 7.55796H16.4444C16.1002 7.55796 15.8002 7.32373 15.7168 6.98986C14.9919 4.0904 12.5447 1.915 9.55412 1.55251C6.56314 1.18997 3.66577 2.7324 2.31053 5.35252C0.950478 7.98196 1.3145 11.2478 3.3074 13.5125C3.58105 13.8234 3.5508 14.2974 3.23984 14.571C2.92888 14.8446 2.45498 14.8144 2.18133 14.5034C-0.225765 11.7681 -0.66174 7.83395 0.978206 4.66339Z\" fill=\"#33373C\"/>\n </svg>\n <span>{{additionalPdfUrlTitle}}</span>\n </a>\n </div>\n <div class=\"modal-footer-item\">\n <button\n class=\"mrx-btn mrx-btn-secondary mrx-btn-md wpx-120 mr-3\"\n (click)=\"cancel()\"\n >\n <div class=\"mrx-btn-label\">{{cancelLabel || '\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C'}}</div>\n </button>\n <button\n class=\"mrx-btn mrx-btn-primary mrx-btn-md\"\n [disabled]=\"disabled\"\n (click)=\"ok()\"\n >\n <div class=\"mrx-btn-label\">{{okLabel || '\u041F\u043E\u0434\u043F\u0438\u0441\u0430\u0442\u044C'}}</div>\n </button>\n </div>\n </div>\n</div>\n", styles: [":host{display:contents}:host pre{width:100%;height:600px;border:0;text-align:left;overflow-y:scroll}.modal-footer{justify-content:space-between;align-items:center}.modal-footer-item__link{display:inline-flex;align-items:center;font-family:PT Sans,sans-serif;font-weight:700;font-size:14px;line-height:160%;color:var(--Main1);margin-right:16px}.modal-footer-item__link svg{margin-right:4px}.modal-body iframe{height:600px}pre{height:600px;overflow:scroll}\n"] }]
798
854
  }], ctorParameters: function () { return [{ type: SignProviderFactory }, { type: DownloadService }, { type: i3.AlertService }]; } });
799
855
 
800
856
  class SignService {