ngx-scandoc 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/core/components/base.component.d.ts +6 -0
  2. package/core/components/camera-switch/camera-switch.component.d.ts +11 -0
  3. package/core/components/components.module.d.ts +10 -3
  4. package/core/components/scan/scan.component.d.ts +120 -0
  5. package/core/components/scan-results/scan-results.component.d.ts +20 -0
  6. package/core/components/webcam/webcam/webcam.component.d.ts +5 -2
  7. package/core/interfaces/config.d.ts +16 -0
  8. package/dialogs/components/blank/blank.component.d.ts +2 -3
  9. package/dialogs/components/scan-profile/scan-profile.component.d.ts +10 -116
  10. package/dialogs/components/turn-document/turn-document.component.d.ts +12 -0
  11. package/dialogs/dialogs.core.provider.d.ts +1 -1
  12. package/dialogs/dialogs.module.d.ts +2 -2
  13. package/esm2020/core/components/base.component.mjs +15 -0
  14. package/esm2020/core/components/camera-switch/camera-switch.component.mjs +22 -0
  15. package/esm2020/core/components/components.module.mjs +34 -6
  16. package/esm2020/core/components/scan/scan.component.mjs +587 -0
  17. package/esm2020/core/components/scan-results/scan-results.component.mjs +38 -0
  18. package/esm2020/core/components/webcam/webcam/webcam.component.mjs +17 -11
  19. package/esm2020/core/interfaces/config.mjs +2 -0
  20. package/esm2020/dialogs/components/blank/blank.component.mjs +6 -7
  21. package/esm2020/dialogs/components/scan-profile/scan-profile.component.mjs +33 -741
  22. package/esm2020/dialogs/components/scan-selfie/scan-selfie.component.mjs +2 -2
  23. package/esm2020/dialogs/components/turn-document/turn-document.component.mjs +32 -0
  24. package/esm2020/dialogs/dialogs.core.provider.mjs +18 -9
  25. package/esm2020/dialogs/dialogs.module.mjs +7 -7
  26. package/esm2020/lib/ngx-scandoc.module.mjs +1 -1
  27. package/esm2020/providers/auth.provider.mjs +3 -2
  28. package/esm2020/providers/camera.provider.mjs +40 -0
  29. package/esm2020/providers/interceptor.provider.mjs +2 -2
  30. package/esm2020/providers/layout.provider.mjs +28 -0
  31. package/esm2020/providers/scan.provider.mjs +4 -6
  32. package/esm2020/public-api.mjs +4 -2
  33. package/fesm2015/ngx-scandoc.mjs +1689 -1676
  34. package/fesm2015/ngx-scandoc.mjs.map +1 -1
  35. package/fesm2020/ngx-scandoc.mjs +1960 -1947
  36. package/fesm2020/ngx-scandoc.mjs.map +1 -1
  37. package/lib/ngx-scandoc.module.d.ts +1 -15
  38. package/package.json +1 -1
  39. package/providers/auth.provider.d.ts +1 -1
  40. package/providers/camera.provider.d.ts +17 -0
  41. package/providers/layout.provider.d.ts +11 -0
  42. package/providers/scan.provider.d.ts +3 -5
  43. package/public-api.d.ts +3 -1
  44. package/dialogs/components/scan-mobile/scan-mobile.component.d.ts +0 -16
  45. package/esm2020/dialogs/components/scan-mobile/scan-mobile.component.mjs +0 -43
@@ -1,66 +1,65 @@
1
1
  import * as i0 from '@angular/core';
2
- import { EventEmitter, Component, Input, Output, ViewChild, HostListener, NgModule, Pipe, Injectable, Inject, ViewContainerRef, ChangeDetectionStrategy } from '@angular/core';
2
+ import { Injectable, EventEmitter, Component, Input, Output, ViewChild, HostListener, NgModule, Inject, ChangeDetectionStrategy, HostBinding, Pipe, ViewContainerRef } from '@angular/core';
3
3
  import * as i5 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
- import { Observable, from, of, Subject, throwError } from 'rxjs';
6
- import { tap, switchMap, map, share, catchError } from 'rxjs/operators';
5
+ import { Observable, from, Subject, of, tap as tap$1, distinctUntilChanged, throwError } from 'rxjs';
6
+ import { tap, switchMap, takeUntil, map, share, catchError } from 'rxjs/operators';
7
7
  import * as i1 from '@angular/cdk/layout';
8
8
  import { Breakpoints } from '@angular/cdk/layout';
9
9
  import * as i2 from '@angular/cdk/platform';
10
10
  import { PlatformModule } from '@angular/cdk/platform';
11
- import * as i1$1 from '@angular/platform-browser';
12
- import { MatAutocompleteModule } from '@angular/material/autocomplete';
13
- import { MatBadgeModule } from '@angular/material/badge';
14
- import * as i3 from '@angular/material/button';
11
+ import { v4 } from 'uuid';
12
+ import * as i4 from '@angular/forms';
13
+ import { FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
14
+ import moment from 'moment';
15
+ import * as i1$1 from '@angular/common/http';
16
+ import { HttpHeaders, HTTP_INTERCEPTORS } from '@angular/common/http';
17
+ import * as i1$2 from '@ngx-translate/core';
18
+ import { TranslateModule } from '@ngx-translate/core';
19
+ import jwt_decode from 'jwt-decode';
20
+ import * as i7$1 from '@angular/material/icon';
21
+ import { MatIconModule } from '@angular/material/icon';
22
+ import * as i6 from '@angular/material/button';
15
23
  import { MatButtonModule } from '@angular/material/button';
16
- import * as i12 from '@angular/material/card';
24
+ import * as i9 from '@angular/material/progress-bar';
25
+ import { MatProgressBarModule } from '@angular/material/progress-bar';
26
+ import * as i5$1 from '@angular/material/card';
17
27
  import { MatCardModule } from '@angular/material/card';
28
+ import * as i7 from '@ngx-formly/core';
29
+ import { FormlyModule } from '@ngx-formly/core';
30
+ import { MatAutocompleteModule } from '@angular/material/autocomplete';
31
+ import { MatBadgeModule } from '@angular/material/badge';
18
32
  import { MatCheckboxModule } from '@angular/material/checkbox';
19
33
  import { MatChipsModule } from '@angular/material/chips';
20
- import * as i8 from '@angular/material/core';
34
+ import * as i6$1 from '@angular/material/core';
21
35
  import { MatNativeDateModule } from '@angular/material/core';
22
36
  import { MatDatepickerModule } from '@angular/material/datepicker';
23
- import * as i1$3 from '@angular/material/dialog';
37
+ import * as i1$4 from '@angular/material/dialog';
24
38
  import { MatDialogModule, MAT_DIALOG_DATA } from '@angular/material/dialog';
25
- import * as i9 from '@angular/material/icon';
26
- import { MatIconModule } from '@angular/material/icon';
27
39
  import { MatInputModule } from '@angular/material/input';
28
40
  import { MatListModule } from '@angular/material/list';
29
41
  import { MatMenuModule } from '@angular/material/menu';
30
42
  import { MatPaginatorModule } from '@angular/material/paginator';
31
- import * as i1$4 from '@angular/material/progress-bar';
32
- import { MatProgressBarModule } from '@angular/material/progress-bar';
33
43
  import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
34
- import * as i7 from '@angular/material/select';
44
+ import * as i5$2 from '@angular/material/select';
35
45
  import { MatSelectModule } from '@angular/material/select';
36
46
  import { MatSlideToggleModule } from '@angular/material/slide-toggle';
37
47
  import { MatSliderModule } from '@angular/material/slider';
38
48
  import { MatSnackBarModule } from '@angular/material/snack-bar';
39
49
  import { MatTableModule } from '@angular/material/table';
40
50
  import { MatTabsModule } from '@angular/material/tabs';
41
- import * as i6 from '@angular/forms';
42
- import { FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
43
- import { v4 } from 'uuid';
44
- import moment from 'moment';
45
- import * as i1$2 from '@angular/common/http';
46
- import { HttpHeaders, HTTP_INTERCEPTORS } from '@angular/common/http';
47
- import jwt_decode from 'jwt-decode';
48
- import * as i4 from '@angular/flex-layout';
49
- import { FlexModule, FlexLayoutModule } from '@angular/flex-layout';
50
- import * as i5$1 from '@angular/flex-layout/extended';
51
- import * as i4$1 from '@ngx-translate/core';
52
- import { TranslateModule } from '@ngx-translate/core';
53
- import { webSocket } from 'rxjs/webSocket';
54
- import * as i3$1 from 'angularx-qrcode';
55
- import { QRCodeModule } from 'angularx-qrcode';
56
- import * as i6$1 from '@angular/material/form-field';
57
- import * as i8$1 from '@ngx-formly/core';
58
- import { FormlyModule } from '@ngx-formly/core';
59
51
  import { FieldType, FormlyMaterialModule } from '@ngx-formly/material';
60
- import * as i3$2 from 'ngx-avatars';
52
+ import * as i3 from 'ngx-avatars';
61
53
  import { AvatarModule } from 'ngx-avatars';
62
54
  import { FormlySelectModule } from '@ngx-formly/core/select';
63
55
  import { FormlyMatDatepickerModule } from '@ngx-formly/material/datepicker';
56
+ import * as i4$1 from '@angular/material/form-field';
57
+ import * as i1$3 from '@angular/platform-browser';
58
+ import * as i4$2 from '@angular/flex-layout';
59
+ import { FlexModule, FlexLayoutModule } from '@angular/flex-layout';
60
+ import * as i5$3 from '@angular/flex-layout/extended';
61
+ import { QRCodeModule } from 'angularx-qrcode';
62
+ import { webSocket } from 'rxjs/webSocket';
64
63
 
65
64
  /**
66
65
  * Container class for a captured webcam image
@@ -402,12 +401,63 @@ addEventListener('message', ({ data }) => {
402
401
  });
403
402
  `;
404
403
 
405
- class WebcamComponent {
406
- constructor(breakpointObserver, platform, cd, zone) {
404
+ class BaseComponent {
405
+ constructor() {
406
+ this.$destroy = new Subject();
407
+ }
408
+ __subs(observable) {
409
+ return observable.pipe(takeUntil(this.$destroy));
410
+ }
411
+ __destroy() {
412
+ this.$destroy.next(true);
413
+ this.$destroy.complete();
414
+ }
415
+ }
416
+
417
+ class NgxScandocCameraProvider {
418
+ constructor() {
419
+ this.switchCamera = new Subject();
420
+ this.cameraReady = false;
421
+ this.cameraSwitched = new Subject();
422
+ this.multipleWebcamsAvailable = false;
423
+ this.setup();
424
+ }
425
+ setup() {
426
+ WebcamUtil.getAvailableVideoInputs().subscribe((mediaDevices) => {
427
+ console.log('[DEVICES]', mediaDevices.map((d) => d.label));
428
+ this.mediaDevices = mediaDevices;
429
+ this.multipleWebcamsAvailable = mediaDevices && mediaDevices.length > 1;
430
+ });
431
+ }
432
+ selectCamera(event) {
433
+ this.switchCamera.next(event.value);
434
+ }
435
+ cameraWasSwitched(deviceId) {
436
+ console.log('[active device]', deviceId);
437
+ this.deviceId = deviceId;
438
+ this.cameraReady = true;
439
+ }
440
+ get nextWebcamObservable() {
441
+ return this.switchCamera.asObservable();
442
+ }
443
+ }
444
+ NgxScandocCameraProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgxScandocCameraProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
445
+ NgxScandocCameraProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgxScandocCameraProvider, providedIn: 'root' });
446
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgxScandocCameraProvider, decorators: [{
447
+ type: Injectable,
448
+ args: [{
449
+ providedIn: 'root',
450
+ }]
451
+ }], ctorParameters: function () { return []; } });
452
+
453
+ class WebcamComponent extends BaseComponent {
454
+ constructor(breakpointObserver, platform, cd, zone, cameraProvider) {
455
+ super();
407
456
  this.breakpointObserver = breakpointObserver;
408
457
  this.platform = platform;
409
458
  this.cd = cd;
410
459
  this.zone = zone;
460
+ this.cameraProvider = cameraProvider;
411
461
  /** Defines the max width of the webcam area in px */
412
462
  this.width = 640;
413
463
  /** Defines the max height of the webcam area in px */
@@ -637,15 +687,15 @@ class WebcamComponent {
637
687
  ngAfterViewInit() {
638
688
  this.setupWorker();
639
689
  if (this.imageHandler) {
640
- this.imageHandler.subscribe((resp) => {
690
+ this.__subs(this.imageHandler).subscribe((resp) => {
641
691
  var _a;
642
692
  if (resp.type === 'stop') {
643
693
  (_a = this.worker) === null || _a === void 0 ? void 0 : _a.postMessage({ type: 'stop' });
644
694
  }
645
695
  });
646
696
  }
647
- this.breakpointObserver
648
- .observe([Breakpoints.HandsetPortrait, Breakpoints.HandsetLandscape])
697
+ this.__subs(this.breakpointObserver
698
+ .observe([Breakpoints.HandsetPortrait, Breakpoints.HandsetLandscape]))
649
699
  .subscribe((state) => {
650
700
  if (this.platform.IOS || this.platform.ANDROID) {
651
701
  // this.landscape = state.breakpoints[Breakpoints.HandsetLandscape];
@@ -700,6 +750,7 @@ class WebcamComponent {
700
750
  });
701
751
  this.nativeVideoElement.srcObject = null;
702
752
  }
753
+ this.__destroy();
703
754
  // this.nativeVideoElement.src = null;
704
755
  // this.nativeVideoElement.srcObject = null;
705
756
  }
@@ -1086,6 +1137,7 @@ class WebcamComponent {
1086
1137
  const activeDeviceId = WebcamComponent.getDeviceIdFromMediaStreamTrack(stream.getVideoTracks()[0]);
1087
1138
  const videoTrack = stream.getTracks()[0];
1088
1139
  this.trackSettings = videoTrack.getSettings();
1140
+ this.cameraProvider.cameraWasSwitched(activeDeviceId);
1089
1141
  this.cameraSwitched.next(activeDeviceId);
1090
1142
  setTimeout(() => {
1091
1143
  this.zone.run(() => {
@@ -1192,12 +1244,12 @@ WebcamComponent.DEFAULT_VIDEO_OPTIONS = {
1192
1244
  };
1193
1245
  WebcamComponent.DEFAULT_IMAGE_TYPE = 'image/jpeg';
1194
1246
  WebcamComponent.DEFAULT_IMAGE_QUALITY = 1;
1195
- WebcamComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: WebcamComponent, deps: [{ token: i1.BreakpointObserver }, { token: i2.Platform }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
1196
- WebcamComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: WebcamComponent, selector: "app-webcam", inputs: { imageHandler: "imageHandler", id: "id", type: "type", width: "width", height: "height", videoOptions: "videoOptions", allowCameraSwitch: "allowCameraSwitch", mirrorImage: "mirrorImage", captureImageData: "captureImageData", imageType: "imageType", imageQuality: "imageQuality", trigger: "trigger", switchCamera: "switchCamera" }, outputs: { imageCapture: "imageCapture", initError: "initError", imageClick: "imageClick", cameraSwitched: "cameraSwitched", videoReady: "videoReady", destroyed: "destroyed" }, host: { listeners: { "window:resize": "onResize($event)" } }, viewQueries: [{ propertyName: "video", first: true, predicate: ["video"], descendants: true, static: true }, { propertyName: "videoStreamer", first: true, predicate: ["videoStreamer"], descendants: true, static: true }, { propertyName: "canvas", first: true, predicate: ["canvas"], descendants: true, static: true }, { propertyName: "canvasSnapshot", first: true, predicate: ["canvasSnapshot"], descendants: true, static: true }, { propertyName: "canvasResize", first: true, predicate: ["canvasResize"], descendants: true, static: true }], ngImport: i0, template: "<div class=\"webcam-wrapper\">\n <div>\n <video\n #video\n autoplay\n muted\n style=\"display: block\"\n playsinline\n\n ></video>\n\n <div class=\"rectangle\">\n <canvas\n #canvas\n [ngStyle]=\"{ visibility: showVideo ? 'visible' : 'hidden' }\"\n [width]=\"canvasSize.width\"\n [height]=\"canvasSize.height\"\n ></canvas>\n </div>\n </div>\n</div>\n", styles: [":host{display:flex;flex-direction:row;flex:1;transform:transale3d(0,0,0);background-color:#000}.webcam-wrapper{display:flex;flex-direction:row;align-items:center;flex:1;justify-content:center}.webcam-wrapper canvas{transform:transale3d(0,0,0);display:block;position:relative;z-index:20;left:0;top:0}.webcam-wrapper .rectangle{position:absolute;left:0;top:0;display:flex;flex-direction:row;align-items:center;justify-content:center;width:100%;height:100%}\n"], dependencies: [{ kind: "directive", type: i5.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
1247
+ WebcamComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: WebcamComponent, deps: [{ token: i1.BreakpointObserver }, { token: i2.Platform }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: NgxScandocCameraProvider }], target: i0.ɵɵFactoryTarget.Component });
1248
+ WebcamComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: WebcamComponent, selector: "app-webcam", inputs: { imageHandler: "imageHandler", id: "id", type: "type", width: "width", height: "height", videoOptions: "videoOptions", allowCameraSwitch: "allowCameraSwitch", mirrorImage: "mirrorImage", captureImageData: "captureImageData", imageType: "imageType", imageQuality: "imageQuality", trigger: "trigger", switchCamera: "switchCamera" }, outputs: { imageCapture: "imageCapture", initError: "initError", imageClick: "imageClick", cameraSwitched: "cameraSwitched", videoReady: "videoReady", destroyed: "destroyed" }, host: { listeners: { "window:resize": "onResize($event)" } }, viewQueries: [{ propertyName: "video", first: true, predicate: ["video"], descendants: true, static: true }, { propertyName: "videoStreamer", first: true, predicate: ["videoStreamer"], descendants: true, static: true }, { propertyName: "canvas", first: true, predicate: ["canvas"], descendants: true, static: true }, { propertyName: "canvasSnapshot", first: true, predicate: ["canvasSnapshot"], descendants: true, static: true }, { propertyName: "canvasResize", first: true, predicate: ["canvasResize"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"webcam-wrapper\">\n <div>\n <video\n #video\n autoplay\n muted\n style=\"display: block\"\n playsinline\n\n ></video>\n\n <div class=\"rectangle\">\n\n <canvas\n #canvas\n [ngStyle]=\"{ visibility: showVideo ? 'visible' : 'hidden' }\"\n [width]=\"canvasSize.width\"\n [height]=\"canvasSize.height\"\n ></canvas>\n </div>\n </div>\n</div>\n", styles: [":host{display:flex;flex-direction:row;flex:1;transform:transale3d(0,0,0);background-color:#000}.webcam-wrapper{display:flex;flex-direction:row;align-items:center;flex:1;justify-content:center}.webcam-wrapper canvas{transform:transale3d(0,0,0);display:block;position:relative;z-index:20;left:0;top:0}.webcam-wrapper .rectangle{position:absolute;left:0;top:0;display:flex;flex-direction:row;align-items:center;justify-content:center;width:100%;height:100%}\n"], dependencies: [{ kind: "directive", type: i5.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
1197
1249
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: WebcamComponent, decorators: [{
1198
1250
  type: Component,
1199
- args: [{ selector: 'app-webcam', template: "<div class=\"webcam-wrapper\">\n <div>\n <video\n #video\n autoplay\n muted\n style=\"display: block\"\n playsinline\n\n ></video>\n\n <div class=\"rectangle\">\n <canvas\n #canvas\n [ngStyle]=\"{ visibility: showVideo ? 'visible' : 'hidden' }\"\n [width]=\"canvasSize.width\"\n [height]=\"canvasSize.height\"\n ></canvas>\n </div>\n </div>\n</div>\n", styles: [":host{display:flex;flex-direction:row;flex:1;transform:transale3d(0,0,0);background-color:#000}.webcam-wrapper{display:flex;flex-direction:row;align-items:center;flex:1;justify-content:center}.webcam-wrapper canvas{transform:transale3d(0,0,0);display:block;position:relative;z-index:20;left:0;top:0}.webcam-wrapper .rectangle{position:absolute;left:0;top:0;display:flex;flex-direction:row;align-items:center;justify-content:center;width:100%;height:100%}\n"] }]
1200
- }], ctorParameters: function () { return [{ type: i1.BreakpointObserver }, { type: i2.Platform }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }]; }, propDecorators: { imageHandler: [{
1251
+ args: [{ selector: 'app-webcam', template: "<div class=\"webcam-wrapper\">\n <div>\n <video\n #video\n autoplay\n muted\n style=\"display: block\"\n playsinline\n\n ></video>\n\n <div class=\"rectangle\">\n\n <canvas\n #canvas\n [ngStyle]=\"{ visibility: showVideo ? 'visible' : 'hidden' }\"\n [width]=\"canvasSize.width\"\n [height]=\"canvasSize.height\"\n ></canvas>\n </div>\n </div>\n</div>\n", styles: [":host{display:flex;flex-direction:row;flex:1;transform:transale3d(0,0,0);background-color:#000}.webcam-wrapper{display:flex;flex-direction:row;align-items:center;flex:1;justify-content:center}.webcam-wrapper canvas{transform:transale3d(0,0,0);display:block;position:relative;z-index:20;left:0;top:0}.webcam-wrapper .rectangle{position:absolute;left:0;top:0;display:flex;flex-direction:row;align-items:center;justify-content:center;width:100%;height:100%}\n"] }]
1252
+ }], ctorParameters: function () { return [{ type: i1.BreakpointObserver }, { type: i2.Platform }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: NgxScandocCameraProvider }]; }, propDecorators: { imageHandler: [{
1201
1253
  type: Input
1202
1254
  }], id: [{
1203
1255
  type: Input
@@ -1272,258 +1324,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
1272
1324
  }]
1273
1325
  }] });
1274
1326
 
1275
- class CoreComponentsModule {
1276
- }
1277
- CoreComponentsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CoreComponentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1278
- CoreComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: CoreComponentsModule, imports: [CommonModule, WebcamModule], exports: [WebcamModule] });
1279
- CoreComponentsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CoreComponentsModule, imports: [CommonModule, WebcamModule, WebcamModule] });
1280
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CoreComponentsModule, decorators: [{
1281
- type: NgModule,
1282
- args: [{
1283
- imports: [CommonModule, WebcamModule],
1284
- declarations: [],
1285
- exports: [WebcamModule],
1286
- }]
1287
- }] });
1288
-
1289
- class SafeResourceUrlPipe {
1290
- constructor(sanitizer) {
1291
- this.sanitizer = sanitizer;
1292
- }
1293
- transform(style) {
1294
- return this.sanitizer.bypassSecurityTrustResourceUrl(style);
1295
- // return this.sanitizer.bypassSecurityTrustStyle(style);
1296
- // return this.sanitizer.bypassSecurityTrustXxx(style); - see docs
1297
- }
1298
- }
1299
- SafeResourceUrlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SafeResourceUrlPipe, deps: [{ token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
1300
- SafeResourceUrlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: SafeResourceUrlPipe, name: "safeResourceUrl" });
1301
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SafeResourceUrlPipe, decorators: [{
1302
- type: Pipe,
1303
- args: [{ name: 'safeResourceUrl' }]
1304
- }], ctorParameters: function () { return [{ type: i1$1.DomSanitizer }]; } });
1305
-
1306
- class CorePipesModule {
1307
- }
1308
- CorePipesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CorePipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1309
- CorePipesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: CorePipesModule, declarations: [SafeResourceUrlPipe], exports: [SafeResourceUrlPipe] });
1310
- CorePipesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CorePipesModule });
1311
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CorePipesModule, decorators: [{
1312
- type: NgModule,
1313
- args: [{
1314
- declarations: [SafeResourceUrlPipe],
1315
- imports: [],
1316
- exports: [
1317
- SafeResourceUrlPipe,
1318
- ],
1319
- }]
1320
- }] });
1321
-
1322
- class MaterialModule {
1323
- }
1324
- MaterialModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MaterialModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1325
- MaterialModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: MaterialModule, imports: [MatNativeDateModule,
1326
- MatDatepickerModule,
1327
- MatCardModule,
1328
- MatMenuModule,
1329
- MatIconModule,
1330
- MatButtonModule,
1331
- MatDialogModule,
1332
- MatInputModule,
1333
- MatSnackBarModule,
1334
- MatProgressBarModule,
1335
- MatTableModule,
1336
- MatProgressSpinnerModule,
1337
- MatPaginatorModule,
1338
- MatSelectModule,
1339
- MatCheckboxModule,
1340
- MatChipsModule,
1341
- MatBadgeModule,
1342
- MatListModule,
1343
- MatTabsModule,
1344
- MatSliderModule,
1345
- MatSlideToggleModule], exports: [MatNativeDateModule,
1346
- MatDatepickerModule,
1347
- MatSelectModule,
1348
- MatCardModule,
1349
- MatMenuModule,
1350
- MatIconModule,
1351
- MatButtonModule,
1352
- MatDialogModule,
1353
- MatInputModule,
1354
- MatSnackBarModule,
1355
- MatProgressBarModule,
1356
- MatProgressSpinnerModule,
1357
- MatTableModule,
1358
- MatPaginatorModule,
1359
- MatChipsModule,
1360
- MatBadgeModule,
1361
- MatCheckboxModule,
1362
- MatListModule,
1363
- MatTabsModule,
1364
- MatSlideToggleModule,
1365
- MatAutocompleteModule] });
1366
- MaterialModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MaterialModule, imports: [MatNativeDateModule,
1367
- MatDatepickerModule,
1368
- MatCardModule,
1369
- MatMenuModule,
1370
- MatIconModule,
1371
- MatButtonModule,
1372
- MatDialogModule,
1373
- MatInputModule,
1374
- MatSnackBarModule,
1375
- MatProgressBarModule,
1376
- MatTableModule,
1377
- MatProgressSpinnerModule,
1378
- MatPaginatorModule,
1379
- MatSelectModule,
1380
- MatCheckboxModule,
1381
- MatChipsModule,
1382
- MatBadgeModule,
1383
- MatListModule,
1384
- MatTabsModule,
1385
- MatSliderModule,
1386
- MatSlideToggleModule, MatNativeDateModule,
1387
- MatDatepickerModule,
1388
- MatSelectModule,
1389
- MatCardModule,
1390
- MatMenuModule,
1391
- MatIconModule,
1392
- MatButtonModule,
1393
- MatDialogModule,
1394
- MatInputModule,
1395
- MatSnackBarModule,
1396
- MatProgressBarModule,
1397
- MatProgressSpinnerModule,
1398
- MatTableModule,
1399
- MatPaginatorModule,
1400
- MatChipsModule,
1401
- MatBadgeModule,
1402
- MatCheckboxModule,
1403
- MatListModule,
1404
- MatTabsModule,
1405
- MatSlideToggleModule,
1406
- MatAutocompleteModule] });
1407
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MaterialModule, decorators: [{
1408
- type: NgModule,
1409
- args: [{
1410
- imports: [
1411
- MatNativeDateModule,
1412
- MatDatepickerModule,
1413
- MatCardModule,
1414
- MatMenuModule,
1415
- MatIconModule,
1416
- MatButtonModule,
1417
- MatDialogModule,
1418
- MatInputModule,
1419
- MatSnackBarModule,
1420
- MatProgressBarModule,
1421
- MatTableModule,
1422
- MatProgressSpinnerModule,
1423
- MatPaginatorModule,
1424
- MatSelectModule,
1425
- MatCheckboxModule,
1426
- MatChipsModule,
1427
- MatBadgeModule,
1428
- MatListModule,
1429
- MatTabsModule,
1430
- MatSliderModule,
1431
- MatSlideToggleModule,
1432
- ],
1433
- exports: [
1434
- MatNativeDateModule,
1435
- MatDatepickerModule,
1436
- MatSelectModule,
1437
- MatCardModule,
1438
- MatMenuModule,
1439
- MatIconModule,
1440
- MatButtonModule,
1441
- MatDialogModule,
1442
- MatInputModule,
1443
- MatSnackBarModule,
1444
- MatProgressBarModule,
1445
- MatProgressSpinnerModule,
1446
- MatTableModule,
1447
- MatPaginatorModule,
1448
- MatChipsModule,
1449
- MatBadgeModule,
1450
- MatCheckboxModule,
1451
- MatListModule,
1452
- MatTabsModule,
1453
- MatSlideToggleModule,
1454
- MatAutocompleteModule,
1455
- ],
1456
- providers: [],
1457
- }]
1458
- }] });
1459
-
1460
- class AuthProvider {
1327
+ class ScanProvider {
1461
1328
  constructor(http, config) {
1462
1329
  this.http = http;
1463
1330
  this.config = config;
1464
- this.token = '';
1465
- this.tokenTimestamps = {
1466
- exp: 0,
1467
- iat: 0,
1468
- };
1469
- }
1470
- setConfig() { }
1471
- get tokenExpired() {
1472
- if (this.token == '' || this.tokenTimestamps.exp === 0) {
1473
- console.log('EXPIRED');
1474
- return true;
1475
- }
1476
- const { iat, exp } = this.tokenTimestamps;
1477
- return iat + 20 > exp;
1478
- }
1479
- resetToken() {
1480
- this.token = '';
1481
- }
1482
- get accesToken() {
1483
- return this.tokenExpired ? this.getToken() : of(this.token);
1484
- }
1485
- getToken() {
1486
- return this.http
1487
- .post(this.config.path, {
1488
- clientId: this.config.clientId,
1489
- token: this.config.tokenName,
1490
- })
1491
- .pipe(map((data) => data.accessToken), tap((token) => {
1492
- this.token = token;
1493
- const decoded = jwt_decode(this.token);
1494
- const { iat, exp } = decoded;
1495
- this.tokenTimestamps = { iat, exp };
1496
- }));
1497
- }
1498
- }
1499
- AuthProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AuthProvider, deps: [{ token: i1$2.HttpClient }, { token: 'configAuth' }], target: i0.ɵɵFactoryTarget.Injectable });
1500
- AuthProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AuthProvider, providedIn: 'root' });
1501
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AuthProvider, decorators: [{
1502
- type: Injectable,
1503
- args: [{
1504
- providedIn: 'root',
1505
- }]
1506
- }], ctorParameters: function () {
1507
- return [{ type: i1$2.HttpClient }, { type: undefined, decorators: [{
1508
- type: Inject,
1509
- args: ['configAuth']
1510
- }] }];
1511
- } });
1512
-
1513
- class ScanProvider {
1514
- constructor(http, auth, config) {
1515
- this.http = http;
1516
- this.auth = auth;
1517
- this.config = config;
1518
- this.enableVerification = true;
1519
- this.canStoreImages = true;
1520
- }
1521
- genderList() {
1522
- return {
1523
- M: 'MALE',
1524
- 'M/M': 'MALE',
1525
- F: 'FEMALE',
1526
- 'F/F': 'FEMALE',
1331
+ this.enableVerification = true;
1332
+ this.canStoreImages = true;
1333
+ }
1334
+ genderList() {
1335
+ return {
1336
+ M: 'MALE',
1337
+ 'M/M': 'MALE',
1338
+ F: 'FEMALE',
1339
+ 'F/F': 'FEMALE',
1527
1340
  };
1528
1341
  }
1529
1342
  stateless(DocumentFaceImage, LiveFaceImage) {
@@ -1980,7 +1793,7 @@ class ScanProvider {
1980
1793
  });
1981
1794
  }
1982
1795
  }
1983
- ScanProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanProvider, deps: [{ token: i1$2.HttpClient }, { token: AuthProvider }, { token: 'config' }], target: i0.ɵɵFactoryTarget.Injectable });
1796
+ ScanProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanProvider, deps: [{ token: i1$1.HttpClient }, { token: 'config' }], target: i0.ɵɵFactoryTarget.Injectable });
1984
1797
  ScanProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanProvider, providedIn: 'root' });
1985
1798
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanProvider, decorators: [{
1986
1799
  type: Injectable,
@@ -1988,762 +1801,180 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
1988
1801
  providedIn: 'root',
1989
1802
  }]
1990
1803
  }], ctorParameters: function () {
1991
- return [{ type: i1$2.HttpClient }, { type: AuthProvider }, { type: undefined, decorators: [{
1804
+ return [{ type: i1$1.HttpClient }, { type: undefined, decorators: [{
1992
1805
  type: Inject,
1993
1806
  args: ['config']
1994
1807
  }] }];
1995
1808
  } });
1996
1809
 
1997
- class BlankComponent {
1998
- constructor(dialogRef, data, componentFactoryResolver, cd) {
1999
- this.dialogRef = dialogRef;
2000
- this.data = data;
2001
- this.componentFactoryResolver = componentFactoryResolver;
2002
- this.cd = cd;
2003
- this.initSet = false;
2004
- }
2005
- setModel(model) {
2006
- this.data.data.model = model;
2007
- this.init();
1810
+ class LayoutProvider {
1811
+ constructor(breakpointObserver) {
1812
+ this.breakpointObserver = breakpointObserver;
1813
+ this.isMobile = false;
1814
+ this.breakpoint$ = this.breakpointObserver
1815
+ .observe(['(min-width: 768px)'])
1816
+ .pipe(tap$1((value) => console.log(value)), distinctUntilChanged());
2008
1817
  }
2009
1818
  init() {
2010
- var _a, _b;
2011
- this.initSet = true;
2012
- const componentFactory = this.componentFactoryResolver.resolveComponentFactory(this.data.component);
2013
- (_a = this.body) === null || _a === void 0 ? void 0 : _a.clear();
2014
- const componentRef = (_b = this.body) === null || _b === void 0 ? void 0 : _b.createComponent(componentFactory);
2015
- componentRef.instance.data = this.data.data;
2016
- componentRef.instance.dialogRef = this.dialogRef;
2017
- if (componentRef.instance.init) {
2018
- componentRef.instance.init();
2019
- }
2020
- this.cd.detectChanges();
2021
- }
2022
- ngAfterViewInit() {
2023
- if (!this.initSet) {
2024
- this.init();
2025
- }
1819
+ this.breakpoint$.subscribe((v) => {
1820
+ this.isMobile = !v.matches;
1821
+ document.body.className = this.isMobile ? 'mobile' : 'desktop';
1822
+ });
2026
1823
  }
2027
1824
  }
2028
- BlankComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: BlankComponent, deps: [{ token: i1$3.MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: i0.ComponentFactoryResolver }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2029
- BlankComponentcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: BlankComponent, selector: "app-dialog-blank", viewQueries: [{ propertyName: "body", first: true, predicate: ["body"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<ng-template #body></ng-template>\n", styles: [":host{display:flex;flex:1;flex-direction:column;overflow:hidden;height:100%}\n"] });
2030
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: BlankComponent, decorators: [{
2031
- type: Component,
2032
- args: [{ selector: 'app-dialog-blank', template: "<ng-template #body></ng-template>\n", styles: [":host{display:flex;flex:1;flex-direction:column;overflow:hidden;height:100%}\n"] }]
2033
- }], ctorParameters: function () {
2034
- return [{ type: i1$3.MatDialogRef }, { type: undefined, decorators: [{
2035
- type: Inject,
2036
- args: [MAT_DIALOG_DATA]
2037
- }] }, { type: i0.ComponentFactoryResolver }, { type: i0.ChangeDetectorRef }];
2038
- }, propDecorators: { body: [{
2039
- type: ViewChild,
2040
- args: ['body', { read: ViewContainerRef, static: true }]
2041
- }] } });
2042
-
2043
- class LoadingComponent {
2044
- }
2045
- LoadingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoadingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2046
- LoadingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: LoadingComponent, selector: "app-loading", ngImport: i0, template: "<div style=\"width:240px;\">\n\n <div class=\"pb-16\" style=\"font-size: 18px;padding-bottom:16px;\">\n Loading...\n </div>\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n</div>\n", styles: [""], dependencies: [{ kind: "component", type: i1$4.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }] });
2047
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoadingComponent, decorators: [{
2048
- type: Component,
2049
- args: [{ selector: 'app-loading', template: "<div style=\"width:240px;\">\n\n <div class=\"pb-16\" style=\"font-size: 18px;padding-bottom:16px;\">\n Loading...\n </div>\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n</div>\n" }]
2050
- }] });
1825
+ LayoutProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LayoutProvider, deps: [{ token: i1.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Injectable });
1826
+ LayoutProviderprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LayoutProvider, providedIn: 'root' });
1827
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LayoutProvider, decorators: [{
1828
+ type: Injectable,
1829
+ args: [{
1830
+ providedIn: 'root',
1831
+ }]
1832
+ }], ctorParameters: function () { return [{ type: i1.BreakpointObserver }]; } });
2051
1833
 
2052
- class ConfirmComponent {
2053
- constructor(dialogRef, data) {
2054
- this.dialogRef = dialogRef;
2055
- this.data = data;
2056
- this.showDetails = false;
2057
- this.images = {
2058
- alert: 'page-lost.svg',
2059
- prompt: 'bedroom.svg',
2060
- dirty: 'opps.svg',
1834
+ class AuthProvider {
1835
+ constructor(http, config) {
1836
+ this.http = http;
1837
+ this.config = config;
1838
+ this.token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJDbGllbnQiOiJQcm90ZWwiLCJTdWJDbGllbnQiOiJIMSIsIklzc3VlVGltZSI6IjA5LjAzLjIwMjIsIDA5OjQ3OjAwIn0.u_FP16TGuZ4LtGbsIxBjy8vCJJuTyBbRs2gPPZU2vgaeSvLdfi1iEVcRjRVh873hkluOtotUGmw0v3Jdh-cHgQ';
1839
+ this.tokenTimestamps = {
1840
+ exp: 0,
1841
+ iat: 0,
2061
1842
  };
2062
- this.options = {};
2063
- }
2064
- onEnterPress(e) {
2065
- this.action(true);
2066
- }
2067
- onEscapePress(e) {
2068
- this.action(false);
2069
- }
2070
- ngOnInit() {
2071
- console.log(this.data);
2072
- this.options = this.data.options || {};
2073
- this.type = this.options.type || this.data.type || 'prompt';
2074
1843
  }
2075
- action(key) {
2076
- this.dialogRef.close(key);
2077
- }
2078
- close() { }
2079
- }
2080
- ConfirmComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ConfirmComponent, deps: [{ token: i1$3.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
2081
- ConfirmComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ConfirmComponent, selector: "app-confirm", host: { listeners: { "document:keyup.enter": "onEnterPress($event)", "document:keyup.escape": "onEscapePress($event)" } }, ngImport: i0, template: "<header class=\"page-header\" fxLayout=\"row\" fxLayoutAlign=\"start center\">\n\n\n <div class=\"title\" ngClass.lt-sm=\"title-small\">\n {{ data.title | translate }}\n\n <!-- {{ data.text.statusText }} {{ data.text.status }} -->\n </div>\n\n <span fxFlex></span>\n\n <!-- <div class=\"separator\"></div>\n\n <button mat-button (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button> -->\n <!-- <mat-icon class=\"mr-16\" style=\"color:#888;\">info_outline</mat-icon> -->\n</header>\n\n<div fxLayout=\"column\" fxLayoutAlign=\"center center\">\n <!-- <img\n style=\"height: 240px; margin: 34px 0px;display: none;\"\n [src]=\"'/assets/images/illustrations/' + images[type]\"\n /> -->\n <!-- <img style=\"width:60px;\" src=\"/assets/images/illustrations/door-lock.png\"> -->\n\n <div class=\"text\" *ngIf=\"data.text\">\n <span [innerHtml]=\"data.text\"></span>\n </div>\n</div>\n\n<!-- -->\n\n<footer>\n\n <div class=\"actions\" fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <button\n *ngIf=\"!data.alert && !options?.hideCancelButton\"\n (click)=\"action(false)\"\n mat-raised-button\n >\n {{ data.cancel || 'core.page.cancel' | translate }}\n </button>\n\n <button\n *ngIf=\"data.no && !options?.hideNoButton\"\n (click)=\"action('no')\"\n\n mat-raised-button\n >\n {{ data.no }}\n </button>\n <button\n *ngIf=\"!data.hideOkButton && !options?.hideOkButton\"\n (click)=\"action(true)\"\n color=\"accent\"\n mat-raised-button\n >\n <ng-container *ngIf=\"!data.alert\">\n {{ data.ok || 'core.page.confirm' | translate }}\n </ng-container>\n\n <ng-container *ngIf=\"data.alert\">\n {{ data.ok || 'core.page.close' | translate }}\n </ng-container>\n </button>\n </div>\n</footer>\n", styles: [":host{display:flex;flex-direction:column;flex:1;height:100%;width:100%}.title{font-size:18px}.text{padding:0 30px;text-align:center;font-size:16px;margin:40px 0}.actions{min-height:60px}.actions button{min-width:120px;margin-right:16px;box-shadow:none;text-transform:uppercase}footer{background-color:#fff}footer button{box-shadow:none!important;border:1px solid rgba(0,0,0,.12);font-size:13px}\n", ".page-header{z-index:2000;height:64px;padding:0;background-color:#fff;border-bottom:1px solid rgba(0,0,0,.12)}.page-header .title{padding-left:24px;line-height:64px;font-size:18px}.page-header .separator{width:1px;background-color:#0000001f;height:100%}.page-header .total{line-height:64px}.page-header .total span{font-weight:700}.page-footer{height:64px}.page-footer button{margin-left:24px;box-shadow:none!important}\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i4.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i4.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i4.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i5$1.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }] });
2082
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ConfirmComponent, decorators: [{
2083
- type: Component,
2084
- args: [{ selector: 'app-confirm', template: "<header class=\"page-header\" fxLayout=\"row\" fxLayoutAlign=\"start center\">\n\n\n <div class=\"title\" ngClass.lt-sm=\"title-small\">\n {{ data.title | translate }}\n\n <!-- {{ data.text.statusText }} {{ data.text.status }} -->\n </div>\n\n <span fxFlex></span>\n\n <!-- <div class=\"separator\"></div>\n\n <button mat-button (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button> -->\n <!-- <mat-icon class=\"mr-16\" style=\"color:#888;\">info_outline</mat-icon> -->\n</header>\n\n<div fxLayout=\"column\" fxLayoutAlign=\"center center\">\n <!-- <img\n style=\"height: 240px; margin: 34px 0px;display: none;\"\n [src]=\"'/assets/images/illustrations/' + images[type]\"\n /> -->\n <!-- <img style=\"width:60px;\" src=\"/assets/images/illustrations/door-lock.png\"> -->\n\n <div class=\"text\" *ngIf=\"data.text\">\n <span [innerHtml]=\"data.text\"></span>\n </div>\n</div>\n\n<!-- -->\n\n<footer>\n\n <div class=\"actions\" fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <button\n *ngIf=\"!data.alert && !options?.hideCancelButton\"\n (click)=\"action(false)\"\n mat-raised-button\n >\n {{ data.cancel || 'core.page.cancel' | translate }}\n </button>\n\n <button\n *ngIf=\"data.no && !options?.hideNoButton\"\n (click)=\"action('no')\"\n\n mat-raised-button\n >\n {{ data.no }}\n </button>\n <button\n *ngIf=\"!data.hideOkButton && !options?.hideOkButton\"\n (click)=\"action(true)\"\n color=\"accent\"\n mat-raised-button\n >\n <ng-container *ngIf=\"!data.alert\">\n {{ data.ok || 'core.page.confirm' | translate }}\n </ng-container>\n\n <ng-container *ngIf=\"data.alert\">\n {{ data.ok || 'core.page.close' | translate }}\n </ng-container>\n </button>\n </div>\n</footer>\n", styles: [":host{display:flex;flex-direction:column;flex:1;height:100%;width:100%}.title{font-size:18px}.text{padding:0 30px;text-align:center;font-size:16px;margin:40px 0}.actions{min-height:60px}.actions button{min-width:120px;margin-right:16px;box-shadow:none;text-transform:uppercase}footer{background-color:#fff}footer button{box-shadow:none!important;border:1px solid rgba(0,0,0,.12);font-size:13px}\n", ".page-header{z-index:2000;height:64px;padding:0;background-color:#fff;border-bottom:1px solid rgba(0,0,0,.12)}.page-header .title{padding-left:24px;line-height:64px;font-size:18px}.page-header .separator{width:1px;background-color:#0000001f;height:100%}.page-header .total{line-height:64px}.page-header .total span{font-weight:700}.page-footer{height:64px}.page-footer button{margin-left:24px;box-shadow:none!important}\n"] }]
2085
- }], ctorParameters: function () {
2086
- return [{ type: i1$3.MatDialogRef }, { type: undefined, decorators: [{
2087
- type: Inject,
2088
- args: [MAT_DIALOG_DATA]
2089
- }] }];
2090
- }, propDecorators: { onEnterPress: [{
2091
- type: HostListener,
2092
- args: ['document:keyup.enter', ['$event']]
2093
- }], onEscapePress: [{
2094
- type: HostListener,
2095
- args: ['document:keyup.escape', ['$event']]
2096
- }] } });
2097
-
2098
- class webRtcProvider {
2099
- constructor() {
2100
- this.pc = new RTCPeerConnection();
1844
+ setConfig() { }
1845
+ get tokenExpired() {
1846
+ return false;
1847
+ if (this.token == '' || this.tokenTimestamps.exp === 0) {
1848
+ console.log('EXPIRED');
1849
+ return true;
1850
+ }
1851
+ const { iat, exp } = this.tokenTimestamps;
1852
+ return iat + 20 > exp;
2101
1853
  }
2102
- connect(id = 1) {
2103
- this.subject = webSocket('wss://localhost:3000?id=' + id);
1854
+ resetToken() {
1855
+ this.token = '';
2104
1856
  }
2105
- setup() {
2106
- this.connect(1);
2107
- // try {
2108
- // this.pc = new RTCPeerConnection({
2109
- // iceServers: [
2110
- // { urls: 'stun:stun.services.mozilla.com' },
2111
- // { urls: 'stun:stun.l.google.com:19302' },
2112
- // ],
2113
- // });
2114
- // } catch (error) {
2115
- // console.log(error);
2116
- // this.pc = new RTCPeerConnection({
2117
- // iceServers: [
2118
- // { urls: 'stun:stun.services.mozilla.com' },
2119
- // { urls: 'stun:stun.l.google.com:19302' },
2120
- // ],
2121
- // });
2122
- // }
2123
- // this.pc.onicecandidate = (event) => {
2124
- // event.candidate
2125
- // ? this.sendMessage({ ice: event.candidate })
2126
- // : console.log('Sent All Ice');
2127
- // };
2128
- // if (this.pc) {
2129
- // from(this.pc.createOffer())
2130
- // .pipe(switchMap((offer) => from(this.pc.setLocalDescription(offer))))
2131
- // .subscribe((data: any) => {
2132
- // this.sendMessage({
2133
- // type: 'offer',
2134
- // sdp: this.pc.localDescription,
2135
- // });
2136
- // });
2137
- // }
1857
+ get accesToken() {
1858
+ return this.tokenExpired ? this.getToken() : of(this.token);
2138
1859
  }
2139
- sendMessage(data) {
2140
- console.log(data);
2141
- this.subject.next(JSON.stringify(data));
1860
+ getToken() {
1861
+ return this.http
1862
+ .post(this.config.path, {
1863
+ clientId: this.config.clientId,
1864
+ token: this.config.tokenName,
1865
+ })
1866
+ .pipe(map((data) => data.accessToken), tap((token) => {
1867
+ this.token = token;
1868
+ const decoded = jwt_decode(this.token);
1869
+ const { iat, exp } = decoded;
1870
+ this.tokenTimestamps = { iat, exp };
1871
+ }));
2142
1872
  }
2143
1873
  }
2144
- webRtcProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: webRtcProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2145
- webRtcProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: webRtcProvider, providedIn: 'root' });
2146
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: webRtcProvider, decorators: [{
1874
+ AuthProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AuthProvider, deps: [{ token: i1$1.HttpClient }, { token: 'configAuth' }], target: i0.ɵɵFactoryTarget.Injectable });
1875
+ AuthProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AuthProvider, providedIn: 'root' });
1876
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AuthProvider, decorators: [{
2147
1877
  type: Injectable,
2148
1878
  args: [{
2149
1879
  providedIn: 'root',
2150
1880
  }]
2151
- }], ctorParameters: function () { return []; } });
2152
-
2153
- class ScanMobileComponent {
2154
- constructor(dialogRef, data, rtcProvider) {
2155
- this.dialogRef = dialogRef;
2156
- this.data = data;
2157
- this.rtcProvider = rtcProvider;
2158
- }
2159
- ngOnInit() {
2160
- this.rtcProvider.setup();
2161
- this.rtcProvider.subject.subscribe((msg) => {
2162
- console.log('[MSG]' + msg);
2163
- }, // Called whenever there is a message from the server.
2164
- (err) => console.log(err), // Called if at any point WebSocket API signals some kind of error.
2165
- () => console.log('complete') // Called when connection is closed (for whatever reason).
2166
- );
2167
- console.log(this.data);
2168
- const path = 'https://192.168.1.104:4200/';
2169
- this.code = path + 'mobile?id=1';
2170
- }
2171
- close() {
2172
- this.dialogRef.close();
2173
- }
2174
- action() { }
2175
- }
2176
- ScanMobileComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanMobileComponent, deps: [{ token: i1$3.MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: webRtcProvider }], target: i0.ɵɵFactoryTarget.Component });
2177
- ScanMobileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScanMobileComponent, selector: "app-scan-mobile", ngImport: i0, template: "<header class=\"page-header\" fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <div class=\"title\" ngClass.lt-sm=\"title-small\">\n Send to mobile\n\n <!-- {{ data.text.statusText }} {{ data.text.status }} -->\n </div>\n\n <span fxFlex></span>\n\n <!-- <div class=\"separator\"></div>\n\n <button mat-button (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button> -->\n <!-- <mat-icon class=\"mr-16\" style=\"color:#888;\">info_outline</mat-icon> -->\n</header>\n\n<div fxLayout=\"column\" fxLayoutAlign=\"center center\">\n <!-- <img\n style=\"height: 240px; margin: 34px 0px;display: none;\"\n [src]=\"'/assets/images/illustrations/' + images[type]\"\n /> -->\n <!-- <img style=\"width:60px;\" src=\"/assets/images/illustrations/door-lock.png\"> -->\n\n<qrcode [qrdata]=\"code\" [width]=\"256\" [errorCorrectionLevel]=\"'M'\"></qrcode>\n\n\n</div>\n\n<!-- -->\n\n<footer>\n <div class=\"actions\" fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <button (click)=\"close()\" mat-raised-button>\n {{ \"core.page.cancel\" | translate }}\n </button>\n\n <button (click)=\"action()\" color=\"accent\" mat-raised-button>\n <ng-container>\n {{ \"core.page.ok\" | translate }}\n </ng-container>\n </button>\n </div>\n</footer>\n", styles: [":host{display:flex;flex-direction:column;flex:1;height:100%;width:100%}.title{font-size:18px}.text{padding:0 30px;text-align:center;font-size:16px;margin:40px 0}.actions{min-height:60px}.actions button{min-width:120px;margin-right:16px;box-shadow:none;text-transform:uppercase}footer{background-color:#fff}footer button{box-shadow:none!important;border:1px solid rgba(0,0,0,.12);font-size:13px}\n", ".page-header{z-index:2000;height:64px;padding:0;background-color:#fff;border-bottom:1px solid rgba(0,0,0,.12)}.page-header .title{padding-left:24px;line-height:64px;font-size:18px}.page-header .separator{width:1px;background-color:#0000001f;height:100%}.page-header .total{line-height:64px}.page-header .total span{font-weight:700}.page-footer{height:64px}.page-footer button{margin-left:24px;box-shadow:none!important}\n"], dependencies: [{ kind: "component", type: i3$1.QRCodeComponent, selector: "qrcode", inputs: ["allowEmptyString", "colorDark", "colorLight", "cssClass", "elementType", "errorCorrectionLevel", "imageSrc", "imageHeight", "imageWidth", "margin", "qrdata", "scale", "version", "width", "alt", "ariaLabel", "title"], outputs: ["qrCodeURL"] }, { kind: "component", type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i4.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i4.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i4.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i5$1.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }] });
2178
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanMobileComponent, decorators: [{
2179
- type: Component,
2180
- args: [{ selector: 'app-scan-mobile', template: "<header class=\"page-header\" fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <div class=\"title\" ngClass.lt-sm=\"title-small\">\n Send to mobile\n\n <!-- {{ data.text.statusText }} {{ data.text.status }} -->\n </div>\n\n <span fxFlex></span>\n\n <!-- <div class=\"separator\"></div>\n\n <button mat-button (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button> -->\n <!-- <mat-icon class=\"mr-16\" style=\"color:#888;\">info_outline</mat-icon> -->\n</header>\n\n<div fxLayout=\"column\" fxLayoutAlign=\"center center\">\n <!-- <img\n style=\"height: 240px; margin: 34px 0px;display: none;\"\n [src]=\"'/assets/images/illustrations/' + images[type]\"\n /> -->\n <!-- <img style=\"width:60px;\" src=\"/assets/images/illustrations/door-lock.png\"> -->\n\n<qrcode [qrdata]=\"code\" [width]=\"256\" [errorCorrectionLevel]=\"'M'\"></qrcode>\n\n\n</div>\n\n<!-- -->\n\n<footer>\n <div class=\"actions\" fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <button (click)=\"close()\" mat-raised-button>\n {{ \"core.page.cancel\" | translate }}\n </button>\n\n <button (click)=\"action()\" color=\"accent\" mat-raised-button>\n <ng-container>\n {{ \"core.page.ok\" | translate }}\n </ng-container>\n </button>\n </div>\n</footer>\n", styles: [":host{display:flex;flex-direction:column;flex:1;height:100%;width:100%}.title{font-size:18px}.text{padding:0 30px;text-align:center;font-size:16px;margin:40px 0}.actions{min-height:60px}.actions button{min-width:120px;margin-right:16px;box-shadow:none;text-transform:uppercase}footer{background-color:#fff}footer button{box-shadow:none!important;border:1px solid rgba(0,0,0,.12);font-size:13px}\n", ".page-header{z-index:2000;height:64px;padding:0;background-color:#fff;border-bottom:1px solid rgba(0,0,0,.12)}.page-header .title{padding-left:24px;line-height:64px;font-size:18px}.page-header .separator{width:1px;background-color:#0000001f;height:100%}.page-header .total{line-height:64px}.page-header .total span{font-weight:700}.page-footer{height:64px}.page-footer button{margin-left:24px;box-shadow:none!important}\n"] }]
2181
1881
  }], ctorParameters: function () {
2182
- return [{ type: i1$3.MatDialogRef }, { type: undefined, decorators: [{
1882
+ return [{ type: i1$1.HttpClient }, { type: undefined, decorators: [{
2183
1883
  type: Inject,
2184
- args: [MAT_DIALOG_DATA]
2185
- }] }, { type: webRtcProvider }];
1884
+ args: ['configAuth']
1885
+ }] }];
2186
1886
  } });
2187
1887
 
2188
- class ScanSelfieComponent {
2189
- constructor(cd, scanProvider, dialogs,
2190
- // private formProvider: ScanFieldsProvider,
2191
- translate) {
2192
- this.cd = cd;
2193
- this.scanProvider = scanProvider;
2194
- this.dialogs = dialogs;
1888
+ class TranslationProvider {
1889
+ constructor(translate) {
2195
1890
  this.translate = translate;
2196
- this.scanBlastData = [
2197
- {
2198
- title: 'pms.dialogs.components.scanProfile.front',
2199
- description: 'pms.dialogs.components.scanProfile.frontDescription',
2200
- side: 'FRONT',
2201
- },
2202
- {
2203
- title: 'pms.dialogs.components.scanProfile.back',
2204
- description: 'pms.dialogs.components.scanProfile.backDescription',
2205
- disabled: true,
2206
- side: 'BACK',
2207
- },
2208
- ];
2209
- this.type = 'desktop';
2210
- this.actions = new EventEmitter();
2211
- this.mediaDevices = [];
2212
- this.videoOptions = {
2213
- width: 1920,
2214
- height: 1080,
2215
- facingMode: 'environment',
2216
- };
2217
- this.multipleWebcamsAvailable = false;
2218
- // webcam snapshot trigger
2219
- this.documentTypeSelected = false;
2220
- this.preview = null;
2221
- this.allowCameraSwitch = true;
2222
- this.error = false;
2223
- this.cameraReady = false;
2224
- this.scaning = false;
2225
- this.scanDatas = [];
2226
- this.trigger = new Subject();
2227
- // switch to next / previous / specific webcam; true/false: forward/backwards, string: deviceId
2228
- this.nextWebcam = new Subject();
2229
- this.form = new FormGroup({});
2230
1891
  }
2231
- onResize() {
2232
- if (this.wraper) {
2233
- this.width = this.wraper.nativeElement.clientWidth;
2234
- this.height = this.wraper.nativeElement.clientHeight;
2235
- console.log(this.width, this.height);
2236
- setTimeout(() => {
2237
- var _a;
2238
- const video = (_a = this.wraper) === null || _a === void 0 ? void 0 : _a.nativeElement.querySelector('video');
2239
- if (video) {
2240
- // console.log(video.clientWidth, video.clientHeight);
2241
- this.videoWidth = video.clientWidth;
2242
- this.videoHeight = video.clientHeight;
2243
- }
2244
- }, 100);
2245
- this.cd.detectChanges();
1892
+ forms(item, namespace = null) {
1893
+ if (item.fieldGroup) {
1894
+ item.fieldGroup = item.fieldGroup.map((field) => this.forms(field));
2246
1895
  }
2247
- }
2248
- init() {
2249
- console.log('HAS MULTI');
2250
- // this.result=true;
2251
- // this.result ={};
2252
- this.fields = []; //this.formProvider.document();
2253
- WebcamUtil.getAvailableVideoInputs().subscribe((mediaDevices) => {
2254
- console.log('[DEVICES]', mediaDevices);
2255
- this.mediaDevices = mediaDevices;
2256
- this.multipleWebcamsAvailable = mediaDevices && mediaDevices.length > 1;
2257
- this.singleScan(this.scanBlastData[0]);
2258
- });
2259
- }
2260
- handleImage(webcamImage) {
2261
- console.log('[received webcam image]', webcamImage);
2262
- this.webcamImage = webcamImage;
2263
- this.preview = webcamImage.imageAsDataUrl;
2264
- this.cd.detectChanges();
2265
- }
2266
- handleInitError(error) {
2267
- console.log(error);
2268
- }
2269
- get scanBlastCanUpload() {
2270
- return this.scanBlastData[0].image ? true : false;
2271
- }
2272
- cameraWasSwitched(deviceId) {
2273
- console.log('active device: ' + deviceId);
2274
- this.deviceId = deviceId;
2275
- this.cameraReady = true;
2276
- this.defaultDevice = deviceId;
2277
- this.onResize();
2278
- }
2279
- get nextWebcamObservable() {
2280
- return this.nextWebcam.asObservable();
2281
- }
2282
- ngAfterViewInit() {
2283
- this.cd.detectChanges();
2284
- }
2285
- selectCamera(event) {
2286
- console.log(event);
2287
- this.nextWebcam.next(event.value);
2288
- }
2289
- close() {
2290
- var _a;
2291
- (_a = this.dialogRef) === null || _a === void 0 ? void 0 : _a.close();
2292
- }
2293
- singleScan(side) {
2294
- this.scanType = side.side;
2295
- this.preview = null;
2296
- this.selectedSide = side;
2297
- this.selectedSide.image = null;
2298
- this.documentTypeSelected = true;
2299
- this.scanBlastData[1].disabled = false;
2300
- this.cd.detectChanges();
2301
- setTimeout(() => {
2302
- this.onResize();
2303
- }, 10);
2304
- }
2305
- getBase64(file) {
2306
- return new Observable((observer) => {
2307
- const reader = new FileReader();
2308
- reader.readAsDataURL(file);
2309
- reader.onload = () => {
2310
- observer.next(reader.result);
2311
- };
2312
- reader.onerror = (error) => {
2313
- observer.error(error);
2314
- };
2315
- });
2316
- }
2317
- handleFileInput(target, event, side) {
2318
- const files = target.files;
2319
- this.selectedSide = side;
2320
- console.log(files);
2321
- const file = files.item(0);
2322
- this.resolutionLimit(file)
2323
- .pipe(switchMap((valid) => {
2324
- return valid ? this.getBase64(file) : of(false);
2325
- }))
2326
- .subscribe((imageAsDataUrl) => {
2327
- // console.log(imageAsDataUrl);
2328
- event.target.value = null;
2329
- if (!imageAsDataUrl) {
2330
- this.dialogs.alert('core.page.error', this.translate.instant('pms.dialogs.components.scanProfile.minResolution'));
1896
+ const prefix = namespace ? namespace + '.' : '';
1897
+ if (item.templateOptions &&
1898
+ (item.templateOptions.label ||
1899
+ item.templateOptions.placeholder ||
1900
+ item.templateOptions.options)) {
1901
+ if (!item.expressionProperties) {
1902
+ item.expressionProperties = {};
2331
1903
  }
2332
- else {
2333
- side.image = {
2334
- imageAsDataUrl,
2335
- };
2336
- if (this.selectedSide.side === 'FRONT') {
2337
- this.scanBlastData[1].disabled = false;
2338
- }
1904
+ if (item.templateOptions.label) {
1905
+ item.expressionProperties['templateOptions.label'] =
1906
+ this.translate.stream(prefix + item.templateOptions.label);
1907
+ }
1908
+ if (item.templateOptions.placeholder) {
1909
+ item.expressionProperties['templateOptions.placeholder'] =
1910
+ this.translate.stream(prefix + item.templateOptions.placeholder);
1911
+ }
1912
+ if (Array.isArray(item.templateOptions.options)) {
1913
+ item.expressionProperties['templateOptions.options'] =
1914
+ item.templateOptions.options.map((m) => {
1915
+ // console.log(m);
1916
+ if (m.label) {
1917
+ m.label = this.translate.instant(prefix + m.label);
1918
+ }
1919
+ return m;
1920
+ });
2339
1921
  }
2340
- this.cd.detectChanges();
2341
- });
2342
- }
2343
- rotateBase64Image(base64data) {
2344
- return new Observable((observer) => {
2345
- const canvas = document.createElement('canvas');
2346
- const ctx = canvas.getContext('2d');
2347
- var image = new Image();
2348
- image.src = base64data;
2349
- image.onload = () => {
2350
- console.log(canvas);
2351
- canvas.width = image.height;
2352
- canvas.height = image.width;
2353
- if (ctx) {
2354
- ctx.rotate((90 * Math.PI) / 180);
2355
- ctx.translate(0, -canvas.width);
2356
- ctx.drawImage(image, 0, 0);
2357
- observer.next(canvas.toDataURL());
2358
- }
2359
- else {
2360
- observer.error({ type: 'generic error' });
2361
- }
2362
- };
2363
- image.onerror = (e) => {
2364
- observer.error(e);
2365
- };
2366
- });
2367
- }
2368
- sendMobile() {
2369
- this.dialogs.scanMobile({ id: 1 });
2370
- }
2371
- singleScanRotate(side) {
2372
- console.log(side);
2373
- this.rotateBase64Image(side.image.imageAsDataUrl).subscribe((data) => {
2374
- side.image = { imageAsDataUrl: data };
2375
- this.cd.detectChanges();
2376
- });
2377
- }
2378
- singleScanRemove(side) {
2379
- side.image = null;
2380
- if (side.side === 'FRONT') {
2381
- this.scanBlastData[1].disabled = true;
2382
1922
  }
2383
- this.cd.detectChanges();
2384
- }
2385
- resolutionLimit(file) {
2386
- const minWidth = 1280;
2387
- const minHeight = 720;
2388
- return new Observable((observer) => {
2389
- const img = new Image();
2390
- img.src = window.URL.createObjectURL(file);
2391
- img.onload = () => {
2392
- const width = img.naturalWidth;
2393
- const height = img.naturalHeight;
2394
- let valid = false;
2395
- if (width > height) {
2396
- valid = width >= minWidth && height >= minHeight;
2397
- }
2398
- else {
2399
- valid = width >= minHeight && height >= minWidth;
2400
- }
2401
- observer.next(valid);
2402
- };
2403
- img.onerror = (error) => {
2404
- observer.error(error);
2405
- };
2406
- });
1923
+ return item;
2407
1924
  }
2408
- getImgBase64(num) {
2409
- return this.scanBlastData[num].image.dataUrl.split(',')[1];
1925
+ }
1926
+ TranslationProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TranslationProvider, deps: [{ token: i1$2.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
1927
+ TranslationProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TranslationProvider, providedIn: 'root' });
1928
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TranslationProvider, decorators: [{
1929
+ type: Injectable,
1930
+ args: [{
1931
+ providedIn: 'root',
1932
+ }]
1933
+ }], ctorParameters: function () { return [{ type: i1$2.TranslateService }]; } });
1934
+
1935
+ class ScanFieldsProvider {
1936
+ constructor(translate, provider) {
1937
+ this.translate = translate;
1938
+ this.provider = provider;
2410
1939
  }
2411
- scanBlastFinish() {
2412
- if (this.type === 'mobile') {
2413
- this.actions.emit({ data: this.scanBlastData });
2414
- this.retake();
2415
- return;
2416
- }
2417
- const loading = this.dialogs.loading();
2418
- this.scaning = true;
2419
- const payload = {
2420
- AcceptTermsAndConditions: true,
2421
- DataFields: {
2422
- FrontImageType: 'base64',
2423
- FrontImageCropped: false,
2424
- BackImageType: 'base64',
2425
- BackImageCropped: false,
2426
- FrontImage: this.getImgBase64(0),
2427
- BackImage: this.scanBlastData[1].image ? this.getImgBase64(1) : null,
2428
- },
2429
- Settings: {
2430
- ShouldValidate: true,
2431
- ShouldReturnDocumentImage: true,
2432
- ShouldReturnFaceIfDetected: true,
2433
- SkipImageSizeCheck: true,
2434
- CanStoreImages: this.scanProvider.canStoreImages,
2435
- },
2436
- // CallBackUrl: 'http://demo:5000/report/extracted/',
2437
- };
2438
- if (!this.scanBlastData[1].image) {
2439
- payload.Settings.IgnoreBackImage = true;
2440
- }
2441
- this.scanProvider.blastPost(payload).subscribe((data) => {
2442
- var _a, _b, _c;
2443
- const results = data.Data;
2444
- loading.close();
2445
- this.documentTypeSelected = true;
2446
- this.scaning = false;
2447
- if (results && data.Metadata.length > 0) {
2448
- if ((_a = data.ImageData) === null || _a === void 0 ? void 0 : _a.Documents) {
2449
- const { Documents } = data.ImageData;
2450
- this.images = Documents.map((image, i) => {
2451
- return { data: 'data:image/jpeg;base64,' + Documents[i] };
2452
- });
2453
- }
2454
- this.result = this.scanProvider.parseBlast(results);
2455
- console.log('RES', this.result);
2456
- this.model = this.result.model;
2457
- if ((_b = data.ImageData) === null || _b === void 0 ? void 0 : _b.FaceImage) {
2458
- this.model._avatar =
2459
- 'data:image/jpeg;base64,' + ((_c = data.ImageData) === null || _c === void 0 ? void 0 : _c.FaceImage);
2460
- }
2461
- console.log('MODEL', this.model);
2462
- }
2463
- else {
2464
- console.log('ERROR');
2465
- // this.scanSide = 0;
2466
- this.error = true;
2467
- this.preview = true;
2468
- // this.documentTypeSelected = false;
2469
- // this.retry();
2470
- }
2471
- this.cd.detectChanges();
2472
- }, (err) => {
2473
- loading.close();
2474
- // this.scanSide = 0;
2475
- this.error = true;
2476
- this.preview = true;
2477
- this.documentTypeSelected = true;
2478
- this.scaning = false;
2479
- });
2480
- }
2481
- cameraOff(ev) {
2482
- this.cameraReady = false;
2483
- this.cd.detectChanges();
2484
- }
2485
- continue() {
2486
- var _a, _b;
2487
- if (this.scanProvider.enableVerification) {
2488
- const loading = this.dialogs.loading();
2489
- console.log(this.data.avatar);
2490
- this.scanProvider
2491
- .stateless(this.data.avatar.split(',')[1], (_a = this.webcamImage) === null || _a === void 0 ? void 0 : _a.imageAsDataUrl.split(',')[1])
2492
- .subscribe((resp) => {
2493
- var _a, _b;
2494
- loading.close();
2495
- if ((_a = resp.Data) === null || _a === void 0 ? void 0 : _a.Verified) {
2496
- (_b = this.dialogRef) === null || _b === void 0 ? void 0 : _b.close(this.webcamImage);
2497
- }
2498
- else {
2499
- this.dialogs.alert('Verification failed!', "We can't verify that your selfie is same as image on document.");
2500
- }
2501
- console.log(resp);
2502
- }, (err) => {
2503
- var _a;
2504
- loading.close();
2505
- (_a = this.dialogRef) === null || _a === void 0 ? void 0 : _a.close(this.webcamImage);
2506
- });
2507
- }
2508
- else {
2509
- (_b = this.dialogRef) === null || _b === void 0 ? void 0 : _b.close(this.webcamImage);
2510
- }
2511
- // this.dialogRef.close(this.webcamImage)
2512
- }
2513
- retry() {
2514
- this.preview = false;
2515
- this.result = false;
2516
- if (this.error) {
2517
- this.documentTypeSelected = false;
2518
- this.scanBlastData.forEach((element) => {
2519
- element.image = null;
2520
- });
2521
- }
2522
- this.error = false;
2523
- }
2524
- triggerSnapshot() {
2525
- this.trigger.next(0);
2526
- }
2527
- scan() {
2528
- console.log('SCAN');
2529
- this.triggerSnapshot();
2530
- this.scanDatas[0] = true;
2531
- }
2532
- retake() {
2533
- this.preview = false;
2534
- this.error = false;
2535
- this.result = false;
2536
- this.scanSide = 0;
2537
- this.scanDatas = [];
2538
- this.scaning = false;
2539
- this.images = [];
2540
- this.documentTypeSelected = false;
2541
- this.scanBlastData.forEach((m) => {
2542
- m.image = null;
2543
- });
2544
- this.cd.detectChanges();
2545
- }
2546
- use() { }
2547
- selfie() { }
2548
- }
2549
- ScanSelfieComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanSelfieComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: ScanProvider }, { token: DialogsCoreProvider }, { token: i4$1.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
2550
- ScanSelfieComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScanSelfieComponent, selector: "app-scan-selfie", inputs: { type: "type" }, outputs: { actions: "actions" }, host: { listeners: { "window:resize": "onResize($event)" } }, viewQueries: [{ propertyName: "wraper", first: true, predicate: ["wraper"], descendants: true }], ngImport: i0, template: "<header class=\"page-header\" fxLayout=\"row\">\n <div class=\"title\" ngClass.lt-sm=\"title-small\">Selfie</div>\n\n <span fxFlex></span>\n <ng-container\n *ngIf=\"\n documentTypeSelected &&\n !result &&\n !error &&\n multipleWebcamsAvailable &&\n !preview\n \"\n >\n <div class=\"separator\"></div>\n <div style=\"padding: 0px 16px\">\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <mat-form-field\n style=\"font-size: 14px; width: 200px; margin-top: 8px\"\n class=\"w-200 mr-16 mt-8\"\n >\n <mat-label> Camera </mat-label>\n <mat-select\n (selectionChange)=\"selectCamera($event)\"\n [(ngModel)]=\"deviceId\"\n >\n <mat-option\n *ngFor=\"let device of mediaDevices\"\n [value]=\"device.deviceId\"\n >\n {{ device.label }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n </div>\n </ng-container>\n\n <ng-container>\n <div class=\"separator\"></div>\n\n <button mat-button (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button>\n </ng-container>\n <!-- <ng-container *ngIf=\"type === 'desktop'\">\n <div class=\"separator\"></div>\n <button mat-button (click)=\"sendMobile()\">\n <mat-icon>tablet_mac</mat-icon>\n </button>\n\n <div class=\"separator\"></div>\n\n <button mat-button (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button>\n </ng-container> -->\n</header>\n\n<div *ngIf=\"!result\" fxFlex fxLayout=\"column\">\n <div fxFlex #wraper class=\"wraper\" fxLayout=\"row\">\n <div\n style=\"\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n z-index: 20;\n background-color: whitesmoke;\n \"\n *ngIf=\"!cameraReady && !preview\"\n >\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n </div>\n\n <ng-container *ngIf=\"!error\">\n <!-- <div\n class=\"rectangle\"\n [ngStyle]=\"{\n 'width.px': videoHeight * 0.75 * 1.588,\n 'height.px': videoHeight * 0.75\n }\"\n ></div>\n <svg\n *ngIf=\"videoWidth\"\n style=\"position: absolute; left: 0px; top: 0px\"\n width=\"0\"\n height=\"0\"\n >\n <defs>\n <clipPath id=\"myClip\">\n <rect\n stroke-width=\"6\"\n stroke-color=\"red\"\n [attr.x]=\"(videoWidth - videoHeight * 0.75 * 1.588) / 2\"\n [attr.y]=\"(videoHeight * 0.25) / 2\"\n [attr.width]=\"videoHeight * 0.75 * 1.588\"\n [attr.height]=\"videoHeight * 0.75\"\n rx=\"25\"\n />\n </clipPath>\n </defs>\n </svg> -->\n\n <app-webcam\n *ngIf=\"!preview && !scaning\"\n class=\"main\"\n [imageQuality]=\"1\"\n #webcam\n fxFlex\n [trigger]=\"trigger\"\n (imageCapture)=\"handleImage($event)\"\n [allowCameraSwitch]=\"allowCameraSwitch\"\n [videoOptions]=\"videoOptions\"\n [switchCamera]=\"nextWebcamObservable\"\n (cameraSwitched)=\"cameraWasSwitched($event)\"\n (initError)=\"handleInitError($event)\"\n type=\"selfie\"\n [width]=\"width\"\n [height]=\"height\"\n (destroyed)=\"cameraOff($event)\"\n >\n </app-webcam>\n </ng-container>\n <div\n fxLayout=\"row\"\n fxFlex\n class=\"previewData\"\n *ngIf=\"preview\"\n style=\"z-index: 20; position: absolute; width: 100%; height: 100%\"\n >\n <div\n class=\"scanPreview\"\n fxFlex\n fxLayout=\"column\"\n *ngIf=\"!error && !scaning\"\n >\n <div\n fxFlex\n class=\"image\"\n [style.background-image]=\"'url(' + preview + ')'\"\n ></div>\n </div>\n </div>\n </div>\n\n <footer fxLayout=\"row\" class=\"p-8\">\n <button\n [disabled]=\"!cameraReady\"\n class=\"w-100-p\"\n *ngIf=\"!preview\"\n mat-raised-button\n (click)=\"scan()\"\n >\n <ng-container>\n TAKE SELFIE\n </ng-container>\n </button>\n\n <div\n class=\"w-100-p\"\n *ngIf=\"preview\"\n fxLayout=\"row\"\n fxLayoutAlign=\"start center\"\n fxFlex\n >\n <button fxFlex class=\"mr-4\" mat-raised-button (click)=\"retry()\">\n RETRY\n </button>\n\n <button\n [disabled]=\"error\"\n fxFlex\n class=\"ml-4\"\n mat-raised-button\n (click)=\"continue()\"\n >\n CONTINUE\n\n </button>\n </div>\n </footer>\n</div>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1;background-color:#f5f5f5}.element{margin-bottom:8px}.element label{font-size:14px}.element div{font-size:18px}.wraper{position:relative;overflow:hidden}h3{color:#459ae5;font-size:16px}.preview{width:100%;border-radius:1%}.documentTypeWraper{width:400px}.documentTypeWraper .label{font-size:14px;margin-bottom:20px}.documentTypeWraper button{box-shadow:none}.overPane{position:absolute;width:100%;height:100%;top:0;left:0}.overPane app-webcam{clip-path:url(#myClip)}.subhead{height:55px;padding-top:8px}.rectangle{z-index:2;position:absolute;top:50%;left:50%;width:85.6mm;height:53.98mm;transform:translate(-50%,-50%);box-sizing:border-box;border:2px dashed #459be5;border-radius:3mm}.mask{z-index:1;position:absolute;width:100%;height:100%;background-position:center center;background-size:380mm;background-repeat:no-repeat}.label{font-size:11px;margin-top:4px}footer button{box-shadow:none!important;height:45px;min-height:45px;border:1px solid rgba(0,0,0,.12);text-transform:uppercase}h4{font-size:16px}.images label{font-size:11px;color:#888;line-height:20px}.images .title{padding:8px 0;font-weight:600}.images img{margin-bottom:16px}.error .title{font-size:22px}.error ul{font-size:18px}.photo{width:120px;height:120px;overflow:hidden}.signature{width:200px}mat-card{box-shadow:none!important}.scanBlastWraper button{text-transform:uppercase}.scanBlastWraper.mobile mat-card{margin:4px!important}.scanBlastWraper.mobile .description{font-size:12px;flex-direction:row!important}.scanBlastWraper.mobile .description .imgWrap{padding:0!important}.scanBlastWraper.mobile .description .btnActions{position:absolute;right:0}.scanBlastWraper.mobile .description button{font-size:11px!important;margin:0!important;position:absolute;right:16px}.scanBlastWraper.mobile .description button.rotateButton{top:58px}.scanBlastWraper.mobile .description button.remButton{top:8px}.scanBlastWraper.mobile .description button mat-icon{margin:0!important}.scanBlastWraper.mobile .description button div.label{display:none}.mobile .scanBlast button{font-size:11px!important}.scanBlast{display:flex;flex-direction:row;flex:1;padding:0 4px}.scanBlast mat-card{padding:0;box-shadow:none;margin:8px 4px;flex:1}.scanBlast mat-card .head{display:flex;flex-direction:row;align-items:center;justify-items:center;border-bottom:1px solid rgba(0,0,0,.12);height:60px;padding:8px}.scanBlast mat-card .head.small{height:30px!important;padding:4px 8px!important}.scanBlast mat-card .head.small .title{font-size:12px!important;margin-left:4px!important}.scanBlast mat-card .head button{max-width:120px;height:40px;box-shadow:none;border:1px solid rgba(0,0,0,.12)}.scanBlast mat-card .head .title{margin-left:16px;color:#459ae5;font-size:16px}.scanBlast mat-card .content{margin:8px;flex:1}.scanBlast mat-card .description{text-align:center;color:#888;font-size:14px}.scanBlast mat-card .actions{background-color:#e9e9e9;display:flex;flex-direction:row}.scanBlast mat-card .actions .mat-button-disabled{background-color:#fff!important}.scanBlast mat-card .actions button{box-shadow:none;width:50%;margin:8px;height:40px;font-size:12px}.scanBlast mat-card .actions button mat-icon{margin-right:8px}.scanBlast mat-card .previewPlaceholder{flex:1;border-radius:6px;display:flex;flex-direction:column}.scanBlast mat-card .previewPlaceholder .description{display:flex;flex:1;flex-direction:column;justify-content:center}.scanBlast mat-card .previewPlaceholder button{box-shadow:none;margin-top:8px;height:40px;font-size:12px}.scanBlast mat-card .previewPlaceholder button mat-icon{margin-right:8px}.scanBlast mat-card .previewPlaceholder .imgWrap{flex-direction:column;flex:1;padding:8px;background-color:#f5f5f5;border-radius:4px}.scanBlast mat-card .previewPlaceholder .imgWrap img{width:100%;border-radius:4px}.scanBlast mat-card .previewPlaceholder .imgWrap .image{background-position:center;background-repeat:no-repeat;background-size:contain}.mr-4{margin-right:4px}.ml-4{margin-left:4px}.p-16{padding:16px}.p-8{padding:8px}.py-16{padding:16px 0}.w-100-p{width:100%}.scanPreview{padding:16px}.scanPreview .image{background-position:center;background-repeat:no-repeat;background-size:contain}.empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center}.summary label{font-size:12px;color:#888;margin-top:2px}.summary .name{font-size:14px}.selfieContainer{display:flex;flex-direction:column;margin-bottom:20px}.selfieContainer button{box-shadow:none;border:1px solid rgba(0,0,0,.12)}.selfieContainer .selfie{margin:8px auto;width:120px;height:120px;border-radius:60px;border:1px solid rgba(0,0,0,.12)}\n", ".page-header{z-index:2000;height:64px;padding:0;background-color:#fff;border-bottom:1px solid rgba(0,0,0,.12)}.page-header .title{padding-left:24px;line-height:64px;font-size:18px}.page-header .separator{width:1px;background-color:#0000001f;height:100%}.page-header .total{line-height:64px}.page-header .total span{font-weight:700}.page-footer{height:64px}.page-footer button{margin-left:24px;box-shadow:none!important}\n"], dependencies: [{ kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6$1.MatLabel, selector: "mat-label" }, { kind: "component", type: i7.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i8.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i9.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i1$4.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: WebcamComponent, selector: "app-webcam", inputs: ["imageHandler", "id", "type", "width", "height", "videoOptions", "allowCameraSwitch", "mirrorImage", "captureImageData", "imageType", "imageQuality", "trigger", "switchCamera"], outputs: ["imageCapture", "initError", "imageClick", "cameraSwitched", "videoReady", "destroyed"] }, { kind: "directive", type: i4.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i4.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i4.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i5$1.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2551
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanSelfieComponent, decorators: [{
2552
- type: Component,
2553
- args: [{ selector: 'app-scan-selfie', changeDetection: ChangeDetectionStrategy.OnPush, template: "<header class=\"page-header\" fxLayout=\"row\">\n <div class=\"title\" ngClass.lt-sm=\"title-small\">Selfie</div>\n\n <span fxFlex></span>\n <ng-container\n *ngIf=\"\n documentTypeSelected &&\n !result &&\n !error &&\n multipleWebcamsAvailable &&\n !preview\n \"\n >\n <div class=\"separator\"></div>\n <div style=\"padding: 0px 16px\">\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <mat-form-field\n style=\"font-size: 14px; width: 200px; margin-top: 8px\"\n class=\"w-200 mr-16 mt-8\"\n >\n <mat-label> Camera </mat-label>\n <mat-select\n (selectionChange)=\"selectCamera($event)\"\n [(ngModel)]=\"deviceId\"\n >\n <mat-option\n *ngFor=\"let device of mediaDevices\"\n [value]=\"device.deviceId\"\n >\n {{ device.label }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n </div>\n </ng-container>\n\n <ng-container>\n <div class=\"separator\"></div>\n\n <button mat-button (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button>\n </ng-container>\n <!-- <ng-container *ngIf=\"type === 'desktop'\">\n <div class=\"separator\"></div>\n <button mat-button (click)=\"sendMobile()\">\n <mat-icon>tablet_mac</mat-icon>\n </button>\n\n <div class=\"separator\"></div>\n\n <button mat-button (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button>\n </ng-container> -->\n</header>\n\n<div *ngIf=\"!result\" fxFlex fxLayout=\"column\">\n <div fxFlex #wraper class=\"wraper\" fxLayout=\"row\">\n <div\n style=\"\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n z-index: 20;\n background-color: whitesmoke;\n \"\n *ngIf=\"!cameraReady && !preview\"\n >\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n </div>\n\n <ng-container *ngIf=\"!error\">\n <!-- <div\n class=\"rectangle\"\n [ngStyle]=\"{\n 'width.px': videoHeight * 0.75 * 1.588,\n 'height.px': videoHeight * 0.75\n }\"\n ></div>\n <svg\n *ngIf=\"videoWidth\"\n style=\"position: absolute; left: 0px; top: 0px\"\n width=\"0\"\n height=\"0\"\n >\n <defs>\n <clipPath id=\"myClip\">\n <rect\n stroke-width=\"6\"\n stroke-color=\"red\"\n [attr.x]=\"(videoWidth - videoHeight * 0.75 * 1.588) / 2\"\n [attr.y]=\"(videoHeight * 0.25) / 2\"\n [attr.width]=\"videoHeight * 0.75 * 1.588\"\n [attr.height]=\"videoHeight * 0.75\"\n rx=\"25\"\n />\n </clipPath>\n </defs>\n </svg> -->\n\n <app-webcam\n *ngIf=\"!preview && !scaning\"\n class=\"main\"\n [imageQuality]=\"1\"\n #webcam\n fxFlex\n [trigger]=\"trigger\"\n (imageCapture)=\"handleImage($event)\"\n [allowCameraSwitch]=\"allowCameraSwitch\"\n [videoOptions]=\"videoOptions\"\n [switchCamera]=\"nextWebcamObservable\"\n (cameraSwitched)=\"cameraWasSwitched($event)\"\n (initError)=\"handleInitError($event)\"\n type=\"selfie\"\n [width]=\"width\"\n [height]=\"height\"\n (destroyed)=\"cameraOff($event)\"\n >\n </app-webcam>\n </ng-container>\n <div\n fxLayout=\"row\"\n fxFlex\n class=\"previewData\"\n *ngIf=\"preview\"\n style=\"z-index: 20; position: absolute; width: 100%; height: 100%\"\n >\n <div\n class=\"scanPreview\"\n fxFlex\n fxLayout=\"column\"\n *ngIf=\"!error && !scaning\"\n >\n <div\n fxFlex\n class=\"image\"\n [style.background-image]=\"'url(' + preview + ')'\"\n ></div>\n </div>\n </div>\n </div>\n\n <footer fxLayout=\"row\" class=\"p-8\">\n <button\n [disabled]=\"!cameraReady\"\n class=\"w-100-p\"\n *ngIf=\"!preview\"\n mat-raised-button\n (click)=\"scan()\"\n >\n <ng-container>\n TAKE SELFIE\n </ng-container>\n </button>\n\n <div\n class=\"w-100-p\"\n *ngIf=\"preview\"\n fxLayout=\"row\"\n fxLayoutAlign=\"start center\"\n fxFlex\n >\n <button fxFlex class=\"mr-4\" mat-raised-button (click)=\"retry()\">\n RETRY\n </button>\n\n <button\n [disabled]=\"error\"\n fxFlex\n class=\"ml-4\"\n mat-raised-button\n (click)=\"continue()\"\n >\n CONTINUE\n\n </button>\n </div>\n </footer>\n</div>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1;background-color:#f5f5f5}.element{margin-bottom:8px}.element label{font-size:14px}.element div{font-size:18px}.wraper{position:relative;overflow:hidden}h3{color:#459ae5;font-size:16px}.preview{width:100%;border-radius:1%}.documentTypeWraper{width:400px}.documentTypeWraper .label{font-size:14px;margin-bottom:20px}.documentTypeWraper button{box-shadow:none}.overPane{position:absolute;width:100%;height:100%;top:0;left:0}.overPane app-webcam{clip-path:url(#myClip)}.subhead{height:55px;padding-top:8px}.rectangle{z-index:2;position:absolute;top:50%;left:50%;width:85.6mm;height:53.98mm;transform:translate(-50%,-50%);box-sizing:border-box;border:2px dashed #459be5;border-radius:3mm}.mask{z-index:1;position:absolute;width:100%;height:100%;background-position:center center;background-size:380mm;background-repeat:no-repeat}.label{font-size:11px;margin-top:4px}footer button{box-shadow:none!important;height:45px;min-height:45px;border:1px solid rgba(0,0,0,.12);text-transform:uppercase}h4{font-size:16px}.images label{font-size:11px;color:#888;line-height:20px}.images .title{padding:8px 0;font-weight:600}.images img{margin-bottom:16px}.error .title{font-size:22px}.error ul{font-size:18px}.photo{width:120px;height:120px;overflow:hidden}.signature{width:200px}mat-card{box-shadow:none!important}.scanBlastWraper button{text-transform:uppercase}.scanBlastWraper.mobile mat-card{margin:4px!important}.scanBlastWraper.mobile .description{font-size:12px;flex-direction:row!important}.scanBlastWraper.mobile .description .imgWrap{padding:0!important}.scanBlastWraper.mobile .description .btnActions{position:absolute;right:0}.scanBlastWraper.mobile .description button{font-size:11px!important;margin:0!important;position:absolute;right:16px}.scanBlastWraper.mobile .description button.rotateButton{top:58px}.scanBlastWraper.mobile .description button.remButton{top:8px}.scanBlastWraper.mobile .description button mat-icon{margin:0!important}.scanBlastWraper.mobile .description button div.label{display:none}.mobile .scanBlast button{font-size:11px!important}.scanBlast{display:flex;flex-direction:row;flex:1;padding:0 4px}.scanBlast mat-card{padding:0;box-shadow:none;margin:8px 4px;flex:1}.scanBlast mat-card .head{display:flex;flex-direction:row;align-items:center;justify-items:center;border-bottom:1px solid rgba(0,0,0,.12);height:60px;padding:8px}.scanBlast mat-card .head.small{height:30px!important;padding:4px 8px!important}.scanBlast mat-card .head.small .title{font-size:12px!important;margin-left:4px!important}.scanBlast mat-card .head button{max-width:120px;height:40px;box-shadow:none;border:1px solid rgba(0,0,0,.12)}.scanBlast mat-card .head .title{margin-left:16px;color:#459ae5;font-size:16px}.scanBlast mat-card .content{margin:8px;flex:1}.scanBlast mat-card .description{text-align:center;color:#888;font-size:14px}.scanBlast mat-card .actions{background-color:#e9e9e9;display:flex;flex-direction:row}.scanBlast mat-card .actions .mat-button-disabled{background-color:#fff!important}.scanBlast mat-card .actions button{box-shadow:none;width:50%;margin:8px;height:40px;font-size:12px}.scanBlast mat-card .actions button mat-icon{margin-right:8px}.scanBlast mat-card .previewPlaceholder{flex:1;border-radius:6px;display:flex;flex-direction:column}.scanBlast mat-card .previewPlaceholder .description{display:flex;flex:1;flex-direction:column;justify-content:center}.scanBlast mat-card .previewPlaceholder button{box-shadow:none;margin-top:8px;height:40px;font-size:12px}.scanBlast mat-card .previewPlaceholder button mat-icon{margin-right:8px}.scanBlast mat-card .previewPlaceholder .imgWrap{flex-direction:column;flex:1;padding:8px;background-color:#f5f5f5;border-radius:4px}.scanBlast mat-card .previewPlaceholder .imgWrap img{width:100%;border-radius:4px}.scanBlast mat-card .previewPlaceholder .imgWrap .image{background-position:center;background-repeat:no-repeat;background-size:contain}.mr-4{margin-right:4px}.ml-4{margin-left:4px}.p-16{padding:16px}.p-8{padding:8px}.py-16{padding:16px 0}.w-100-p{width:100%}.scanPreview{padding:16px}.scanPreview .image{background-position:center;background-repeat:no-repeat;background-size:contain}.empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center}.summary label{font-size:12px;color:#888;margin-top:2px}.summary .name{font-size:14px}.selfieContainer{display:flex;flex-direction:column;margin-bottom:20px}.selfieContainer button{box-shadow:none;border:1px solid rgba(0,0,0,.12)}.selfieContainer .selfie{margin:8px auto;width:120px;height:120px;border-radius:60px;border:1px solid rgba(0,0,0,.12)}\n", ".page-header{z-index:2000;height:64px;padding:0;background-color:#fff;border-bottom:1px solid rgba(0,0,0,.12)}.page-header .title{padding-left:24px;line-height:64px;font-size:18px}.page-header .separator{width:1px;background-color:#0000001f;height:100%}.page-header .total{line-height:64px}.page-header .total span{font-weight:700}.page-footer{height:64px}.page-footer button{margin-left:24px;box-shadow:none!important}\n"] }]
2554
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: ScanProvider }, { type: DialogsCoreProvider }, { type: i4$1.TranslateService }]; }, propDecorators: { type: [{
2555
- type: Input
2556
- }], actions: [{
2557
- type: Output
2558
- }], wraper: [{
2559
- type: ViewChild,
2560
- args: ['wraper']
2561
- }], onResize: [{
2562
- type: HostListener,
2563
- args: ['window:resize', ['$event']]
2564
- }] } });
2565
-
2566
- class DialogsCoreProvider {
2567
- constructor(matDialog) {
2568
- this.matDialog = matDialog;
2569
- this.components = {
2570
- ScanProfile: { component: ScanProfileComponent },
2571
- Loading: { component: LoadingComponent },
2572
- ConfirmComponent: { component: ConfirmComponent },
2573
- ScanMobileComponent: { component: ScanMobileComponent },
2574
- ScanSelfie: { component: ScanSelfieComponent },
2575
- };
2576
- this.blank = BlankComponent;
2577
- }
2578
- getComponent(name) {
2579
- if (!this.components[name]) {
2580
- console.warn('Component missing', name, this.components);
2581
- }
2582
- return this.components[name].component;
2583
- }
2584
- open(config, withComponent = true) {
2585
- // console.log(config);
2586
- const panelClass = config.panelClass ? config.panelClass : config.name;
2587
- const component = this.getComponent(config.name);
2588
- const dialogRef = this.matDialog.open(this.blank, {
2589
- panelClass,
2590
- data: {
2591
- data: config.data,
2592
- withComponent,
2593
- component,
1940
+ update() {
1941
+ return [
1942
+ {
1943
+ fieldGroupClassName: 'px-16',
1944
+ fieldGroup: [
1945
+ {
1946
+ wrappers: [],
1947
+ type: 'checkbox',
1948
+ key: 'profile',
1949
+ class: 'checkbox ',
1950
+ defaultValue: true,
1951
+ templateOptions: {
1952
+ label: 'form.scan.document.update.profile',
1953
+ },
1954
+ },
1955
+ {
1956
+ wrappers: [],
1957
+ type: 'checkbox',
1958
+ class: 'checkbox ',
1959
+ key: 'document',
1960
+ defaultValue: true,
1961
+ templateOptions: {
1962
+ label: 'form.scan.document.update.document',
1963
+ },
1964
+ },
1965
+ {
1966
+ wrappers: [],
1967
+ type: 'checkbox',
1968
+ class: 'checkbox ',
1969
+ key: 'attachment',
1970
+ defaultValue: true,
1971
+ templateOptions: {
1972
+ label: 'form.scan.document.update.attachment',
1973
+ },
1974
+ },
1975
+ ].map((item) => this.translate.forms(item)),
2594
1976
  },
2595
- autoFocus: false,
2596
- width: config.width || '',
2597
- height: config.height || '',
2598
- maxWidth: config.maxWidth || '',
2599
- minWidth: config.minWidth || '',
2600
- maxHeight: config.maxHeight || '',
2601
- minHeight: config.minHeight || '',
2602
- position: config.position || {},
2603
- hasBackdrop: config.hasBackdrop === undefined ? true : config.hasBackdrop,
2604
- disableClose: config.disableClose === undefined ? true : config.disableClose,
2605
- });
2606
- return dialogRef;
2607
- }
2608
- scanProfile(data) {
2609
- return this.open({
2610
- name: 'ScanProfile',
2611
- panelClass: 'ScanProfileComponent',
2612
- data,
2613
- });
2614
- }
2615
- // Generic loading dialog
2616
- loading(title = '') {
2617
- return this.open({
2618
- name: 'Loading',
2619
- data: { title },
2620
- });
2621
- }
2622
- alert(title, text) {
2623
- return this.open({
2624
- name: 'ConfirmComponent',
2625
- maxWidth: '600px',
2626
- panelClass: 'DialogNoPadding',
2627
- minWidth: '440px',
2628
- data: { title, text, alert: true },
2629
- });
2630
- }
2631
- scanMobile(data) {
2632
- return this.open({
2633
- name: 'ScanMobileComponent',
2634
- maxWidth: '600px',
2635
- panelClass: 'DialogNoPadding',
2636
- minWidth: '440px',
2637
- data,
2638
- });
2639
- }
2640
- scanSelfie(data) {
2641
- return this.open({
2642
- name: 'ScanSelfie',
2643
- panelClass: 'ScanProfileComponent',
2644
- data,
2645
- });
2646
- }
2647
- }
2648
- DialogsCoreProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DialogsCoreProvider, deps: [{ token: i1$3.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
2649
- DialogsCoreProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DialogsCoreProvider, providedIn: 'root' });
2650
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DialogsCoreProvider, decorators: [{
2651
- type: Injectable,
2652
- args: [{
2653
- providedIn: 'root',
2654
- }]
2655
- }], ctorParameters: function () { return [{ type: i1$3.MatDialog }]; } });
2656
-
2657
- class TranslationProvider {
2658
- constructor(translate) {
2659
- this.translate = translate;
2660
- }
2661
- forms(item, namespace = null) {
2662
- if (item.fieldGroup) {
2663
- item.fieldGroup = item.fieldGroup.map((field) => this.forms(field));
2664
- }
2665
- const prefix = namespace ? namespace + '.' : '';
2666
- if (item.templateOptions &&
2667
- (item.templateOptions.label ||
2668
- item.templateOptions.placeholder ||
2669
- item.templateOptions.options)) {
2670
- if (!item.expressionProperties) {
2671
- item.expressionProperties = {};
2672
- }
2673
- if (item.templateOptions.label) {
2674
- item.expressionProperties['templateOptions.label'] =
2675
- this.translate.stream(prefix + item.templateOptions.label);
2676
- }
2677
- if (item.templateOptions.placeholder) {
2678
- item.expressionProperties['templateOptions.placeholder'] =
2679
- this.translate.stream(prefix + item.templateOptions.placeholder);
2680
- }
2681
- if (Array.isArray(item.templateOptions.options)) {
2682
- item.expressionProperties['templateOptions.options'] =
2683
- item.templateOptions.options.map((m) => {
2684
- // console.log(m);
2685
- if (m.label) {
2686
- m.label = this.translate.instant(prefix + m.label);
2687
- }
2688
- return m;
2689
- });
2690
- }
2691
- }
2692
- return item;
2693
- }
2694
- }
2695
- TranslationProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TranslationProvider, deps: [{ token: i4$1.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
2696
- TranslationProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TranslationProvider, providedIn: 'root' });
2697
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TranslationProvider, decorators: [{
2698
- type: Injectable,
2699
- args: [{
2700
- providedIn: 'root',
2701
- }]
2702
- }], ctorParameters: function () { return [{ type: i4$1.TranslateService }]; } });
2703
-
2704
- class ScanFieldsProvider {
2705
- constructor(translate, provider) {
2706
- this.translate = translate;
2707
- this.provider = provider;
2708
- }
2709
- update() {
2710
- return [
2711
- {
2712
- fieldGroupClassName: 'px-16',
2713
- fieldGroup: [
2714
- {
2715
- wrappers: [],
2716
- type: 'checkbox',
2717
- key: 'profile',
2718
- class: 'checkbox ',
2719
- defaultValue: true,
2720
- templateOptions: {
2721
- label: 'form.scan.document.update.profile',
2722
- },
2723
- },
2724
- {
2725
- wrappers: [],
2726
- type: 'checkbox',
2727
- class: 'checkbox ',
2728
- key: 'document',
2729
- defaultValue: true,
2730
- templateOptions: {
2731
- label: 'form.scan.document.update.document',
2732
- },
2733
- },
2734
- {
2735
- wrappers: [],
2736
- type: 'checkbox',
2737
- class: 'checkbox ',
2738
- key: 'attachment',
2739
- defaultValue: true,
2740
- templateOptions: {
2741
- label: 'form.scan.document.update.attachment',
2742
- },
2743
- },
2744
- ].map((item) => this.translate.forms(item)),
2745
- },
2746
- ];
1977
+ ];
2747
1978
  }
2748
1979
  document() {
2749
1980
  return [
@@ -3063,36 +2294,1179 @@ class ScanFieldsProvider {
3063
2294
  templateOptions: {
3064
2295
  label: 'form.profile.address.street',
3065
2296
  },
3066
- // expressionProperties: {
3067
- // 'templateOptions.disabled': (model: any) => !model.newAddress,
3068
- // },
3069
- },
3070
- ],
3071
- },
3072
- ],
3073
- },
3074
- ].map((item) => this.translate.forms(item));
2297
+ // expressionProperties: {
2298
+ // 'templateOptions.disabled': (model: any) => !model.newAddress,
2299
+ // },
2300
+ },
2301
+ ],
2302
+ },
2303
+ ],
2304
+ },
2305
+ ].map((item) => this.translate.forms(item));
2306
+ }
2307
+ }
2308
+ ScanFieldsProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanFieldsProvider, deps: [{ token: TranslationProvider }, { token: ScanProvider }], target: i0.ɵɵFactoryTarget.Injectable });
2309
+ ScanFieldsProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanFieldsProvider, providedIn: 'root' });
2310
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanFieldsProvider, decorators: [{
2311
+ type: Injectable,
2312
+ args: [{
2313
+ providedIn: 'root',
2314
+ }]
2315
+ }], ctorParameters: function () { return [{ type: TranslationProvider }, { type: ScanProvider }]; } });
2316
+
2317
+ class ScanResultsComponent {
2318
+ constructor(cameraProvider, formProvider) {
2319
+ this.cameraProvider = cameraProvider;
2320
+ this.formProvider = formProvider;
2321
+ this.action = new EventEmitter();
2322
+ }
2323
+ ngOnInit() {
2324
+ this.fields = this.formProvider.document();
2325
+ }
2326
+ ngOnDestroy() { }
2327
+ selfie() {
2328
+ this.action.emit({ selfie: true });
2329
+ }
2330
+ }
2331
+ ScanResultsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanResultsComponent, deps: [{ token: NgxScandocCameraProvider }, { token: ScanFieldsProvider }], target: i0.ɵɵFactoryTarget.Component });
2332
+ ScanResultsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScanResultsComponent, selector: "ngx-scan-results", inputs: { model: "model", images: "images", form: "form" }, outputs: { action: "action" }, ngImport: i0, template: "<div class=\"wraper\">\n <div style=\"flex: 1\">\n <mat-card style=\"margin: 4px; padding: 4px 16px\">\n <h3>Avatar</h3>\n <div class=\"selfieContainer\">\n <div class=\"selfie\">\n <img *ngIf=\"model?._avatar\" class=\"preview\" [src]=\"model._avatar\" />\n </div>\n <button (click)=\"selfie()\" mat-raised-button>Take selfie</button>\n </div>\n </mat-card>\n\n <form\n fxLayout=\"row\"\n fxLayoutAlign=\"start center\"\n class=\"px-16 py-0 w-100-p\"\n [formGroup]=\"form\"\n >\n <formly-form\n ngClass.lt-md=\"mobile\"\n fxFlex\n [form]=\"form\"\n [fields]=\"fields\"\n [model]=\"model\"\n >\n </formly-form>\n </form>\n </div>\n <div style=\"flex: 1\" class=\"pr-16 m-4\">\n <mat-card style=\"margin: 4px; padding-top: 2px\" class=\"images\">\n <h3>Images</h3>\n <ng-container *ngFor=\"let img of images\">\n <div fxLayout=\"column\">\n <ng-container *ngIf=\"img.side === 0\">\n <div class=\"title\">Front Side</div>\n </ng-container>\n <ng-container *ngIf=\"img.side === 1\">\n <div class=\"title\">Back Side</div>\n </ng-container>\n <img\n class=\"preview\"\n style=\"max-width: 460px; border-radius: 1rem\"\n [src]=\"img.data\"\n />\n </div>\n </ng-container>\n </mat-card>\n </div>\n</div>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1;overflow:hidden}.images .title{padding:8px 0;font-weight:600}.images img{margin-bottom:16px;width:100%}.wraper{padding:8px 8px 0 0;overflow:auto;flex:1;display:flex;flex-direction:row}mat-card{box-shadow:none!important}.selfieContainer{display:flex;flex-direction:row;align-items:center}.selfieContainer .selfie{width:150px}.selfieContainer .selfie .preview{width:120px;height:120px;border-radius:80px}.selfieContainer .button{box-shadow:none;border:1px solid rgba(0,0,0,.1)}\n"], dependencies: [{ kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "component", type: i5$1.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { kind: "component", type: i6.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7.FormlyForm, selector: "formly-form", inputs: ["form", "model", "fields", "options"], outputs: ["modelChange"] }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] });
2333
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanResultsComponent, decorators: [{
2334
+ type: Component,
2335
+ args: [{ selector: 'ngx-scan-results', template: "<div class=\"wraper\">\n <div style=\"flex: 1\">\n <mat-card style=\"margin: 4px; padding: 4px 16px\">\n <h3>Avatar</h3>\n <div class=\"selfieContainer\">\n <div class=\"selfie\">\n <img *ngIf=\"model?._avatar\" class=\"preview\" [src]=\"model._avatar\" />\n </div>\n <button (click)=\"selfie()\" mat-raised-button>Take selfie</button>\n </div>\n </mat-card>\n\n <form\n fxLayout=\"row\"\n fxLayoutAlign=\"start center\"\n class=\"px-16 py-0 w-100-p\"\n [formGroup]=\"form\"\n >\n <formly-form\n ngClass.lt-md=\"mobile\"\n fxFlex\n [form]=\"form\"\n [fields]=\"fields\"\n [model]=\"model\"\n >\n </formly-form>\n </form>\n </div>\n <div style=\"flex: 1\" class=\"pr-16 m-4\">\n <mat-card style=\"margin: 4px; padding-top: 2px\" class=\"images\">\n <h3>Images</h3>\n <ng-container *ngFor=\"let img of images\">\n <div fxLayout=\"column\">\n <ng-container *ngIf=\"img.side === 0\">\n <div class=\"title\">Front Side</div>\n </ng-container>\n <ng-container *ngIf=\"img.side === 1\">\n <div class=\"title\">Back Side</div>\n </ng-container>\n <img\n class=\"preview\"\n style=\"max-width: 460px; border-radius: 1rem\"\n [src]=\"img.data\"\n />\n </div>\n </ng-container>\n </mat-card>\n </div>\n</div>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1;overflow:hidden}.images .title{padding:8px 0;font-weight:600}.images img{margin-bottom:16px;width:100%}.wraper{padding:8px 8px 0 0;overflow:auto;flex:1;display:flex;flex-direction:row}mat-card{box-shadow:none!important}.selfieContainer{display:flex;flex-direction:row;align-items:center}.selfieContainer .selfie{width:150px}.selfieContainer .selfie .preview{width:120px;height:120px;border-radius:80px}.selfieContainer .button{box-shadow:none;border:1px solid rgba(0,0,0,.1)}\n"] }]
2336
+ }], ctorParameters: function () { return [{ type: NgxScandocCameraProvider }, { type: ScanFieldsProvider }]; }, propDecorators: { model: [{
2337
+ type: Input
2338
+ }], images: [{
2339
+ type: Input
2340
+ }], form: [{
2341
+ type: Input
2342
+ }], action: [{
2343
+ type: Output
2344
+ }] } });
2345
+
2346
+ class ScanComponent extends BaseComponent {
2347
+ constructor(cd, zone, translate, cameraProvider, injector, layoutProvider, auth // private api: ServerProvider
2348
+ ) {
2349
+ super();
2350
+ this.cd = cd;
2351
+ this.zone = zone;
2352
+ this.translate = translate;
2353
+ this.cameraProvider = cameraProvider;
2354
+ this.injector = injector;
2355
+ this.layoutProvider = layoutProvider;
2356
+ this.auth = auth;
2357
+ this.scanBlastData = [
2358
+ {
2359
+ title: 'pms.dialogs.components.scanProfile.front',
2360
+ description: 'pms.dialogs.components.scanProfile.frontDescription',
2361
+ side: 'FRONT',
2362
+ },
2363
+ {
2364
+ title: 'pms.dialogs.components.scanProfile.back',
2365
+ description: 'pms.dialogs.components.scanProfile.backDescription',
2366
+ disabled: true,
2367
+ side: 'BACK',
2368
+ },
2369
+ ];
2370
+ this.type = 'desktop';
2371
+ this.actions = new EventEmitter();
2372
+ this.mediaDevices = [];
2373
+ this.videoOptions = {
2374
+ width: 1920,
2375
+ height: 1080,
2376
+ facingMode: 'environment',
2377
+ };
2378
+ this.startTime = 0;
2379
+ this.isDebug = false;
2380
+ this.multipleWebcamsAvailable = false;
2381
+ this.scanInProgress = false;
2382
+ // webcam snapshot trigger
2383
+ this.documentTypeSelected = false;
2384
+ this.preview = null;
2385
+ this.errorCode = '1000';
2386
+ this.displayInfo = 'Position document inside rectange and hold steady.';
2387
+ this.allowCameraSwitch = true;
2388
+ this.verificationErrorSent = false;
2389
+ this.error = false;
2390
+ this.cameraReady = false;
2391
+ this.scaning = false;
2392
+ this.imageHandler = new Subject();
2393
+ this.logData = {
2394
+ AcceptTermsAndConditions: true,
2395
+ Request: null,
2396
+ Response: null,
2397
+ ExpectedOutput: null,
2398
+ };
2399
+ this.scanDatas = [];
2400
+ this.idScan = null;
2401
+ this.validation = false;
2402
+ this.scannedImages = [];
2403
+ this.scanDelay = 0;
2404
+ this.trigger = new Subject();
2405
+ // switch to next / previous / specific webcam; true/false: forward/backwards, string: deviceId
2406
+ this.nextWebcam = new Subject();
2407
+ this.imageVerified = false;
2408
+ this.form = new FormGroup({});
2409
+ this.isMobile = false;
2410
+ this.showDialog = false;
2411
+ this.scanImageTimestamps = {
2412
+ time: 0,
2413
+ load: 0,
2414
+ };
2415
+ this.scanProvider = this.injector.get(ScanProvider);
2416
+ }
2417
+ get class() {
2418
+ return this.isMobile;
2419
+ }
2420
+ onResize() {
2421
+ if (this.wraper) {
2422
+ this.width = this.wraper.nativeElement.clientWidth;
2423
+ this.height = this.wraper.nativeElement.clientHeight;
2424
+ setTimeout(() => {
2425
+ var _a;
2426
+ const video = (_a = this.wraper) === null || _a === void 0 ? void 0 : _a.nativeElement.querySelector('video');
2427
+ if (video) {
2428
+ // console.log(video.clientWidth, video.clientHeight);
2429
+ this.videoWidth = video.clientWidth;
2430
+ this.videoHeight = video.clientHeight;
2431
+ }
2432
+ this.cd.detectChanges();
2433
+ }, 100);
2434
+ this.cd.detectChanges();
2435
+ }
2436
+ }
2437
+ test() {
2438
+ this.dialogs.turnDocument('BACK');
2439
+ }
2440
+ resetLogData() {
2441
+ this.logData = {
2442
+ Request: null,
2443
+ Response: null,
2444
+ ExpectedOutput: null,
2445
+ AcceptTermsAndConditions: true,
2446
+ };
2447
+ }
2448
+ ngOnDestroy() {
2449
+ if (this.scanTimeout) {
2450
+ clearTimeout(this.scanTimeout);
2451
+ }
2452
+ if (this.imageHandlerSubscription) {
2453
+ this.imageHandlerSubscription.unsubscribe();
2454
+ }
2455
+ console.log('DESTROXY');
2456
+ this.__destroy();
2457
+ }
2458
+ init() {
2459
+ this.auth.accesToken.subscribe();
2460
+ this.resetLogData();
2461
+ // this.result=true;
2462
+ // this.result ={};
2463
+ console.log('INIT SCAN');
2464
+ }
2465
+ cameraOff(ev) {
2466
+ this.cameraReady = false;
2467
+ this.cd.detectChanges();
2468
+ }
2469
+ continue() {
2470
+ this.documentTypeSelected = false;
2471
+ setTimeout(() => {
2472
+ this.selectedSide.image = this.webcamImage;
2473
+ if (this.selectedSide.side === 'FRONT') {
2474
+ this.scanBlastData[1].disabled = false;
2475
+ }
2476
+ this.cd.detectChanges();
2477
+ }, 200);
2478
+ }
2479
+ scan() {
2480
+ // this.triggerSnapshot();
2481
+ // this.scanDatas[0] = true;
2482
+ // if (this.scanTimeout) {
2483
+ // clearTimeout(this.scanTimeout);
2484
+ // }
2485
+ // this.scanTimeout = setTimeout(() => {
2486
+ // this.scan();
2487
+ // }, 1);
2488
+ }
2489
+ handleImage(webcamImage) {
2490
+ // console.log('[received webcam image]', webcamImage);
2491
+ this.zone.runOutsideAngular(() => {
2492
+ const time = new Date().getTime();
2493
+ if (this.scanImageTimestamps.load > 0) {
2494
+ const { load } = this.scanImageTimestamps;
2495
+ const diff = time - load;
2496
+ // console.log('time:', diff);
2497
+ this.scanDelay = diff;
2498
+ }
2499
+ this.scanImageTimestamps.load = time;
2500
+ if (webcamImage.imageData) {
2501
+ this.scannedImages.push(webcamImage);
2502
+ }
2503
+ this.cd.detectChanges();
2504
+ if (this.scannedImages.length > 4 && !this.validation) {
2505
+ console.timeEnd('scan');
2506
+ console.time('scan');
2507
+ // get last 10
2508
+ console.log('CAPTURED:', this.scannedImages.length);
2509
+ const images = this.scannedImages.slice(-5);
2510
+ // set images to 0
2511
+ this.scannedImages = [];
2512
+ const imagesArray = images.map((m) => m.imageResized.split(',')[1]);
2513
+ this.validation = true;
2514
+ this.handleBurstData(imagesArray, images);
2515
+ }
2516
+ if (this.cameraReady) {
2517
+ this.trigger.next(new Date().getTime());
2518
+ }
2519
+ });
2520
+ }
2521
+ handleBurstData(imagesArray, images, type = 'plain') {
2522
+ this.__subs(this.scanProvider.burst(imagesArray)).subscribe((resp) => {
2523
+ this.displayInfo = resp.Info;
2524
+ console.timeEnd('validationPOST');
2525
+ console.log('AnalysisTime', resp.AnalysisTime);
2526
+ const { DocType, Series, Side, InfoCode } = resp;
2527
+ // if (InfoCode === '1006' && this.idScan) {
2528
+ // this.handleLongValidationError(image);
2529
+ // }
2530
+ if (resp.Validated) {
2531
+ console.log('[SCANNED INDEX]', resp.Index);
2532
+ const selectedImage = images[resp.Index];
2533
+ // this.preview = this.webcamImage.imageAsDataUrl;
2534
+ this.cd.detectChanges();
2535
+ let image = selectedImage;
2536
+ if (type == 'worker') {
2537
+ const dataUrl = this.handleBitmapImage(selectedImage.bitmap);
2538
+ image = { dataUrl };
2539
+ }
2540
+ if (InfoCode === '1007') {
2541
+ // For ID ask for other side
2542
+ if (Side === 'FRONT') {
2543
+ this.scanBlastData[0].image = image;
2544
+ }
2545
+ else {
2546
+ this.scanBlastData[1].image = image;
2547
+ }
2548
+ if (this.scanBlastData[0].image && this.scanBlastData[1].image) {
2549
+ console.warn('UPLOAD');
2550
+ if (type == 'worker') {
2551
+ this.imageHandler.next({ type: 'stop' });
2552
+ }
2553
+ this.scanBlastFinish();
2554
+ }
2555
+ else {
2556
+ const num = Side === 'FRONT' ? 1 : 0;
2557
+ this.singleScan(this.scanBlastData[num]);
2558
+ this.scan();
2559
+ this.idScan = this.scanBlastData[num].side;
2560
+ if (!this.showDialog) {
2561
+ this.showDialog = true;
2562
+ this.zone.run(() => {
2563
+ this.dialogs.turnDocument(this.idScan).subscribe(() => {
2564
+ this.showDialog = false;
2565
+ });
2566
+ });
2567
+ // this.actions.emit({
2568
+ // type: 'turnDocumentOver',
2569
+ // side: this.idScan,
2570
+ // });
2571
+ }
2572
+ console.log('ID SIDE', this.idScan);
2573
+ this.displayInfo = 'Please turn the document over!';
2574
+ this.validation = false;
2575
+ }
2576
+ }
2577
+ else {
2578
+ this.scanBlastData[0].image = image;
2579
+ console.warn('UPLOAD');
2580
+ if (type == 'worker') {
2581
+ this.imageHandler.next({ type: 'stop' });
2582
+ }
2583
+ this.scanBlastFinish();
2584
+ }
2585
+ this.scannedImages = [];
2586
+ // this.scanBlastData[0].image = selectedImage;
2587
+ //this.scanBlastFinish();
2588
+ }
2589
+ else {
2590
+ this.validation = false;
2591
+ }
2592
+ });
2593
+ }
2594
+ handleInitError(error) {
2595
+ console.log(error);
2596
+ }
2597
+ get scanBlastCanUpload() {
2598
+ return this.scanBlastData[0].image ? true : false;
2599
+ }
2600
+ cameraWasSwitched(deviceId) {
2601
+ console.log('[active device]', deviceId);
2602
+ this.deviceId = deviceId;
2603
+ this.cameraReady = true;
2604
+ this.defaultDevice = deviceId;
2605
+ setTimeout(() => {
2606
+ this.onResize();
2607
+ this.scan();
2608
+ }, 300);
2609
+ }
2610
+ get nextWebcamObservable() {
2611
+ return this.nextWebcam.asObservable();
2612
+ }
2613
+ handleLongValidationError(img) {
2614
+ // save current image after 10sec
2615
+ const diff = (Date.now() - this.startTime) / 1000;
2616
+ if (diff > 15 && !this.verificationErrorSent) {
2617
+ this.verificationErrorSent = true;
2618
+ const dataUrl = this.handleBitmapImage(img.bitmap);
2619
+ console.warn('SENT');
2620
+ this.displayInfo = 'Cant detect document!';
2621
+ this.logData.Request = this.__subs(this.scanProvider.sendLog({
2622
+ AcceptTermsAndConditions: true,
2623
+ ExpectedOutput: {},
2624
+ Request: {
2625
+ verification: dataUrl.split(',')[1],
2626
+ },
2627
+ Response: {
2628
+ TransactionID: v4(),
2629
+ },
2630
+ })).subscribe();
2631
+ }
2632
+ }
2633
+ ngAfterViewInit() {
2634
+ this.cd.detectChanges();
2635
+ this.autoScan();
2636
+ this.__subs(this.layoutProvider.breakpoint$).subscribe((v) => {
2637
+ this.isMobile = !v.matches;
2638
+ console.log('MNOBILE', this.isMobile);
2639
+ });
2640
+ this.imageHandlerSubscription = this.imageHandler.subscribe((webcamImage) => {
2641
+ // return;
2642
+ if (this.startTime === 0) {
2643
+ this.startTime = Date.now();
2644
+ }
2645
+ this.zone.runOutsideAngular(() => {
2646
+ if (webcamImage.base64) {
2647
+ const time = new Date().getTime();
2648
+ if (this.scanImageTimestamps.load > 0) {
2649
+ const { load } = this.scanImageTimestamps;
2650
+ const diff = time - load;
2651
+ // console.warn('TIME', diff);
2652
+ this.scanDelay = diff;
2653
+ }
2654
+ this.scanImageTimestamps.load = time;
2655
+ this.scannedImages.push(webcamImage);
2656
+ this.handleLongValidationError(webcamImage);
2657
+ }
2658
+ // this.cd.detectChanges();
2659
+ if (this.scannedImages.length > 4 && !this.validation) {
2660
+ // get last 10
2661
+ console.timeEnd('validationTOTAL_UI');
2662
+ console.time('validationTOTAL_UI');
2663
+ const images = this.scannedImages.slice(-5);
2664
+ // set images to 0
2665
+ this.scannedImages = [];
2666
+ console.log(images);
2667
+ const imagesArray = images.map((m) => m.base64.split(',')[1]);
2668
+ this.validation = true;
2669
+ this.handleBurstData(imagesArray, images, 'worker');
2670
+ console.time('validationPOST');
2671
+ }
2672
+ this.cd.detectChanges();
2673
+ });
2674
+ });
2675
+ }
2676
+ handleBitmapImage(bitmap) {
2677
+ const { width, height } = bitmap;
2678
+ const offscreenSmall = document.createElement('canvas');
2679
+ offscreenSmall.width = width;
2680
+ offscreenSmall.height = height;
2681
+ const ctx = offscreenSmall.getContext('bitmaprenderer');
2682
+ if (ctx) {
2683
+ ctx.imageSmoothingEnabled = false;
2684
+ ctx.transferFromImageBitmap(bitmap);
2685
+ bitmap.close();
2686
+ const data = ctx.canvas.toDataURL('image/jpeg');
2687
+ return data;
2688
+ }
2689
+ return null;
2690
+ }
2691
+ autoScan() {
2692
+ const side = this.scanBlastData[0];
2693
+ this.idScan = null;
2694
+ this.singleScan(side);
2695
+ }
2696
+ singleScan(side) {
2697
+ this.scanType = side.side;
2698
+ this.preview = null;
2699
+ this.selectedSide = side;
2700
+ this.selectedSide.image = null;
2701
+ this.documentTypeSelected = true;
2702
+ this.scanBlastData[1].disabled = false;
2703
+ this.cd.detectChanges();
2704
+ setTimeout(() => {
2705
+ this.onResize();
2706
+ }, 10);
2707
+ }
2708
+ getImgBase64(num) {
2709
+ console.log('GET 64');
2710
+ return this.scanBlastData[num].image.dataUrl.split(',')[1];
2711
+ }
2712
+ scanBlastFinish() {
2713
+ console.time('upload');
2714
+ if (this.type === 'mobile') {
2715
+ this.actions.emit({ data: this.scanBlastData });
2716
+ this.retake();
2717
+ return;
2718
+ }
2719
+ this.idScan = null;
2720
+ // const loading = this.dialogs.loading();
2721
+ this.scaning = true;
2722
+ this.cd.detectChanges();
2723
+ console.time('payload');
2724
+ const payload = {
2725
+ AcceptTermsAndConditions: true,
2726
+ DataFields: {
2727
+ FrontImageType: 'base64',
2728
+ FrontImageCropped: false,
2729
+ BackImageType: 'base64',
2730
+ BackImageCropped: false,
2731
+ FrontImage: this.getImgBase64(0),
2732
+ BackImage: this.scanBlastData[1].image ? this.getImgBase64(1) : null,
2733
+ },
2734
+ Settings: {
2735
+ ShouldValidate: true,
2736
+ ShouldReturnDocumentImage: true,
2737
+ ShouldReturnFaceIfDetected: true,
2738
+ SkipImageSizeCheck: true,
2739
+ CanStoreImages: this.scanProvider.canStoreImages,
2740
+ },
2741
+ // CallBackUrl: 'http://demo:5000/report/extracted/',
2742
+ };
2743
+ if (!this.scanBlastData[1].image) {
2744
+ payload.Settings.IgnoreBackImage = true;
2745
+ }
2746
+ this.logData.Request = JSON.parse(JSON.stringify(payload));
2747
+ console.timeEnd('payload');
2748
+ this.__subs(this.scanProvider.blastPost(payload)).subscribe((data) => {
2749
+ //console.log(data);
2750
+ const results = data.Data;
2751
+ console.timeEnd('upload');
2752
+ console.time('parse');
2753
+ // data.InfoCode = '1001';
2754
+ this.logData.Response = JSON.parse(JSON.stringify(data));
2755
+ //loading.close();
2756
+ this.documentTypeSelected = true;
2757
+ this.scaning = false;
2758
+ if (data.InfoCode === '1001') {
2759
+ this.error = true;
2760
+ console.log('[ERROR] 1001');
2761
+ this.errorCode = '1001';
2762
+ // this.scanSide = 0;
2763
+ this.preview = true;
2764
+ this.cd.detectChanges();
2765
+ return;
2766
+ }
2767
+ if (data.InfoCode === '1002') {
2768
+ this.error = true;
2769
+ console.log('[ERROR] 1002');
2770
+ this.errorCode = '1002';
2771
+ // this.scanSide = 0;
2772
+ this.preview = true;
2773
+ this.cd.detectChanges();
2774
+ return;
2775
+ }
2776
+ if (results && data.Metadata.length > 0 && data.InfoCode === '1000') {
2777
+ console.log('Extraction time', data.AnalysisTime);
2778
+ this.zone.run(() => {
2779
+ var _a, _b, _c;
2780
+ if ((_a = data.ImageData) === null || _a === void 0 ? void 0 : _a.Documents) {
2781
+ const { Documents } = data.ImageData;
2782
+ this.images = Documents.map((image, i) => {
2783
+ return { data: 'data:image/jpeg;base64,' + Documents[i] };
2784
+ });
2785
+ }
2786
+ this.result = this.scanProvider.parseBlast(results);
2787
+ console.log('RES', this.result);
2788
+ this.cd.detectChanges();
2789
+ this.model = this.result.model;
2790
+ if ((_b = data.ImageData) === null || _b === void 0 ? void 0 : _b.FaceImage) {
2791
+ this.model._avatar =
2792
+ 'data:image/jpeg;base64,' + ((_c = data.ImageData) === null || _c === void 0 ? void 0 : _c.FaceImage);
2793
+ }
2794
+ console.log('MODEL', this.model);
2795
+ this.cd.detectChanges();
2796
+ });
2797
+ }
2798
+ else {
2799
+ console.log('ERROR');
2800
+ // this.scanSide = 0;
2801
+ this.error = true;
2802
+ this.preview = true;
2803
+ this.cd.detectChanges();
2804
+ // this.documentTypeSelected = false;
2805
+ // this.retry();
2806
+ }
2807
+ this.cd.detectChanges();
2808
+ console.timeEnd('parse');
2809
+ }, (err) => {
2810
+ // loading.close();
2811
+ // this.scanSide = 0;
2812
+ this.error = true;
2813
+ this.preview = true;
2814
+ this.documentTypeSelected = true;
2815
+ this.scaning = false;
2816
+ });
2817
+ }
2818
+ retry() {
2819
+ this.preview = false;
2820
+ this.validation = false;
2821
+ this.errorCode = '1000';
2822
+ this.result = false;
2823
+ if (this.error) {
2824
+ this.documentTypeSelected = false;
2825
+ this.scanBlastData.forEach((element) => {
2826
+ element.image = null;
2827
+ });
2828
+ }
2829
+ this.error = false;
2830
+ this.autoScan();
2831
+ this.cd.detectChanges();
2832
+ }
2833
+ triggerSnapshot() {
2834
+ this.trigger.next(0);
2835
+ }
2836
+ retake() {
2837
+ this.validation = false;
2838
+ this.preview = false;
2839
+ this.error = false;
2840
+ this.result = false;
2841
+ this.scanSide = 0;
2842
+ this.imageVerified = false;
2843
+ this.scanDatas = [];
2844
+ this.scaning = false;
2845
+ this.images = [];
2846
+ this.scanInProgress = false;
2847
+ this.documentTypeSelected = false;
2848
+ this.scanBlastData.forEach((m) => {
2849
+ m.image = null;
2850
+ });
2851
+ this.autoScan();
2852
+ this.cd.detectChanges();
2853
+ }
2854
+ use() {
2855
+ var _a, _b;
2856
+ // save images??
2857
+ if (this.scanProvider.canStoreImages) {
2858
+ this.logData.ExpectedOutput = JSON.parse(JSON.stringify(this.model));
2859
+ if ((_a = this.logData.ExpectedOutput) === null || _a === void 0 ? void 0 : _a._avatar) {
2860
+ delete this.logData.ExpectedOutput._avatar;
2861
+ }
2862
+ this.__subs(this.scanProvider.sendLog(this.logData)).subscribe();
2863
+ console.log(this.logData);
2864
+ }
2865
+ (_b = this.dialogRef) === null || _b === void 0 ? void 0 : _b.close({
2866
+ model: this.model,
2867
+ images: this.images,
2868
+ });
2869
+ }
2870
+ selfie() {
2871
+ this.dialogs
2872
+ .scanSelfie({ avatar: this.model._avatar })
2873
+ .afterClosed()
2874
+ .subscribe((resp) => {
2875
+ if (resp) {
2876
+ console.log(resp);
2877
+ if (this.scanProvider.enableVerification) {
2878
+ this.imageVerified = true;
2879
+ }
2880
+ this.model._avatar = resp.imageAsDataUrl;
2881
+ this.cd.detectChanges();
2882
+ }
2883
+ });
2884
+ }
2885
+ videoReady(event) {
2886
+ this.cameraReady = event;
2887
+ if (this.cameraReady && !this.scanInProgress) {
2888
+ this.scanInProgress = true;
2889
+ setTimeout(() => {
2890
+ this.trigger.next(new Date().getTime());
2891
+ }, 1000);
2892
+ }
2893
+ }
2894
+ }
2895
+ ScanComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: i1$2.TranslateService }, { token: NgxScandocCameraProvider }, { token: i0.Injector }, { token: LayoutProvider }, { token: AuthProvider }], target: i0.ɵɵFactoryTarget.Component });
2896
+ ScanComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScanComponent, selector: "ngx-scan", inputs: { type: "type", dialogs: "dialogs", showDialog: "showDialog" }, outputs: { actions: "actions" }, host: { listeners: { "window:resize": "onResize($event)" }, properties: { "class.mobile": "this.class" } }, viewQueries: [{ propertyName: "wraper", first: true, predicate: ["wraper"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<section *ngIf=\"result\">\n <ngx-scan-results\n (action)=\"selfie()\"\n [form]=\"form\"\n [model]=\"model\"\n [images]=\"images\"\n ></ngx-scan-results>\n\n <footer>\n <div class=\"actions\">\n <button fxFlex class=\"mr-4\" mat-raised-button (click)=\"retake()\">\n {{ \"pms.dialogs.components.scanProfile.reTake\" | translate }}\n </button>\n <button\n [disabled]=\"error || form.invalid\"\n fxFlex\n class=\"ml-4\"\n mat-raised-button\n (click)=\"use()\"\n >\n {{ \"pms.dialogs.components.scanProfile.useData\" | translate }}\n </button>\n </div>\n </footer>\n</section>\n\n<section *ngIf=\"!result && documentTypeSelected\">\n <div #wraper class=\"wraper\">\n <div class=\"loading\" *ngIf=\"!cameraReady && !preview\">\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n </div>\n\n <ng-container *ngIf=\"!error\">\n <app-webcam\n *ngIf=\"!preview && !scaning\"\n class=\"main\"\n [imageQuality]=\"1\"\n #webcam\n fxFlex\n type=\"document\"\n [trigger]=\"trigger\"\n [imageHandler]=\"imageHandler\"\n (imageCapture)=\"handleImage($event)\"\n [allowCameraSwitch]=\"allowCameraSwitch\"\n [videoOptions]=\"videoOptions\"\n [switchCamera]=\"cameraProvider.nextWebcamObservable\"\n (cameraSwitched)=\"cameraWasSwitched($event)\"\n (initError)=\"handleInitError($event)\"\n [width]=\"width\"\n [height]=\"height\"\n (destroyed)=\"cameraOff($event)\"\n (videoReady)=\"videoReady($event)\"\n >\n </app-webcam>\n </ng-container>\n <div\n fxLayout=\"row\"\n fxFlex\n class=\"previewData\"\n *ngIf=\"preview\"\n style=\"z-index: 20; position: absolute; width: 100%; height: 100%\"\n >\n <div class=\"p-16 error\" *ngIf=\"error\">\n <div>\n <div class=\"title\" fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <mat-icon>error_outline</mat-icon\n ><span class=\"ml-8\">{{\n \"pms.dialogs.components.scanProfile.unableToDetectId\" | translate\n }}</span>\n </div>\n\n <ng-container *ngIf=\"errorCode === '1001'\">\n <div>\n Could not classify the given object as a supported document.\n </div>\n </ng-container>\n <ng-container *ngIf=\"errorCode === '1002'\">\n <div>\n Something is wrong with extraction data. Please try again.\n </div>\n </ng-container>\n\n <ul *ngIf=\"errorCode === '1000'\">\n <li>\n {{\n \"pms.dialogs.components.scanProfile.placeIdCloseToDevice\"\n | translate\n }}\n </li>\n <li>\n {{\n \"pms.dialogs.components.scanProfile.ensureSufficientLight\"\n | translate\n }}\n </li>\n <li>\n {{\n \"pms.dialogs.components.scanProfile.holdDocumentSteady\"\n | translate\n }}\n </li>\n <li>\n {{\n \"pms.dialogs.components.scanProfile.makeSureAllEdgesOfTheIdAreVisible\"\n | translate\n }}\n </li>\n <li>\n {{\n \"pms.dialogs.components.scanProfile.makeSureThereAreNoGlareAndShadowsOnTheId\"\n | translate\n }}\n </li>\n </ul>\n </div>\n </div>\n\n <div\n class=\"scanPreview\"\n fxFlex\n fxLayout=\"column\"\n *ngIf=\"!error && !scaning\"\n >\n <!-- <div class=\"py-16\" style=\"font-size: 16px\">\n {{\n \"pms.dialogs.components.scanProfile.ensureAllTextsAreVisible\"\n | translate\n }}\n </div> -->\n <div\n fxFlex\n class=\"image\"\n [style.background-image]=\"'url(' + preview + ')'\"\n ></div>\n </div>\n </div>\n </div>\n\n <footer>\n <div\n class=\"displayInfo\"\n ngClass.lt-sm=\"mobile\"\n *ngIf=\"!preview && cameraReady\"\n >\n {{ displayInfo }}\n </div>\n <!-- <div style=\"height: 26px\">\n <div\n style=\"text-align: center; font-size: 18px\"\n *ngIf=\"idScan && !preview && cameraReady\"\n >\n <ng-container *ngIf=\"idScan === 'BACK'\">\n Turn document and:\n {{ \"pms.dialogs.components.scanProfile.captureBack\" | translate }}\n </ng-container>\n <ng-container *ngIf=\"idScan === 'FRONT'\">\n Turn document and:\n {{ \"pms.dialogs.components.scanProfile.captureFront\" | translate }}\n </ng-container>\n </div>\n </div> -->\n\n <div class=\"actions\" *ngIf=\"preview\">\n <button fxFlex class=\"mr-4\" mat-raised-button (click)=\"retry()\">\n {{ \"pms.dialogs.components.scanProfile.retry\" | translate }}\n </button>\n\n <button\n [disabled]=\"error\"\n fxFlex\n class=\"ml-4\"\n mat-raised-button\n (click)=\"continue()\"\n >\n {{\n \"pms.dialogs.components.scanProfile.continueWithSelectedImage\"\n | translate\n }}\n </button>\n </div>\n </footer>\n</section>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1;background-color:#f5f5f5;overflow:hidden}section{flex:1;display:flex;flex-direction:column;position:relative;overflow:hidden}.wraper{position:relative;overflow:hidden;display:flex;flex-direction:column;flex:1}.wraper .loading{position:absolute;inset:0;z-index:20;background-color:#f5f5f5}.documentTurnOver{position:absolute;width:100%;height:100%;top:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.documentTurnOver mat-icon{width:200px;color:#fff;height:200px;font-size:100px}.displayInfo{text-align:center;flex:1;width:100%;background-color:#000;height:50px;line-height:50px;color:#fff;z-index:200}.displayInfo.mobile{font-size:12px}.preview{width:100%;border-radius:1%}footer button{box-shadow:none!important;height:45px;min-height:45px;text-transform:uppercase}footer .actions{display:flex;flex-direction:row;align-items:center;padding:8px}footer .actions button{flex:1}.error{display:flex;align-items:center;justify-content:center;flex:1}.error .title{font-size:20px;margin-bottom:8px}.error .title mat-icon{margin-right:8px}.error ul{font-size:18px;list-style-type:none}mat-card{box-shadow:none!important}.mr-4{margin-right:4px}.ml-4{margin-left:4px}.p-16{padding:16px}.p-8{padding:8px}.py-16{padding:16px 0}.w-100-p{width:100%}.scanPreview{padding:16px}.scanPreview .image{background-position:center;background-repeat:no-repeat;background-size:contain}.empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center}\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: WebcamComponent, selector: "app-webcam", inputs: ["imageHandler", "id", "type", "width", "height", "videoOptions", "allowCameraSwitch", "mirrorImage", "captureImageData", "imageType", "imageQuality", "trigger", "switchCamera"], outputs: ["imageCapture", "initError", "imageClick", "cameraSwitched", "videoReady", "destroyed"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i6.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i9.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: ScanResultsComponent, selector: "ngx-scan-results", inputs: ["model", "images", "form"], outputs: ["action"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2897
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanComponent, decorators: [{
2898
+ type: Component,
2899
+ args: [{ selector: 'ngx-scan', changeDetection: ChangeDetectionStrategy.OnPush, template: "<section *ngIf=\"result\">\n <ngx-scan-results\n (action)=\"selfie()\"\n [form]=\"form\"\n [model]=\"model\"\n [images]=\"images\"\n ></ngx-scan-results>\n\n <footer>\n <div class=\"actions\">\n <button fxFlex class=\"mr-4\" mat-raised-button (click)=\"retake()\">\n {{ \"pms.dialogs.components.scanProfile.reTake\" | translate }}\n </button>\n <button\n [disabled]=\"error || form.invalid\"\n fxFlex\n class=\"ml-4\"\n mat-raised-button\n (click)=\"use()\"\n >\n {{ \"pms.dialogs.components.scanProfile.useData\" | translate }}\n </button>\n </div>\n </footer>\n</section>\n\n<section *ngIf=\"!result && documentTypeSelected\">\n <div #wraper class=\"wraper\">\n <div class=\"loading\" *ngIf=\"!cameraReady && !preview\">\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n </div>\n\n <ng-container *ngIf=\"!error\">\n <app-webcam\n *ngIf=\"!preview && !scaning\"\n class=\"main\"\n [imageQuality]=\"1\"\n #webcam\n fxFlex\n type=\"document\"\n [trigger]=\"trigger\"\n [imageHandler]=\"imageHandler\"\n (imageCapture)=\"handleImage($event)\"\n [allowCameraSwitch]=\"allowCameraSwitch\"\n [videoOptions]=\"videoOptions\"\n [switchCamera]=\"cameraProvider.nextWebcamObservable\"\n (cameraSwitched)=\"cameraWasSwitched($event)\"\n (initError)=\"handleInitError($event)\"\n [width]=\"width\"\n [height]=\"height\"\n (destroyed)=\"cameraOff($event)\"\n (videoReady)=\"videoReady($event)\"\n >\n </app-webcam>\n </ng-container>\n <div\n fxLayout=\"row\"\n fxFlex\n class=\"previewData\"\n *ngIf=\"preview\"\n style=\"z-index: 20; position: absolute; width: 100%; height: 100%\"\n >\n <div class=\"p-16 error\" *ngIf=\"error\">\n <div>\n <div class=\"title\" fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <mat-icon>error_outline</mat-icon\n ><span class=\"ml-8\">{{\n \"pms.dialogs.components.scanProfile.unableToDetectId\" | translate\n }}</span>\n </div>\n\n <ng-container *ngIf=\"errorCode === '1001'\">\n <div>\n Could not classify the given object as a supported document.\n </div>\n </ng-container>\n <ng-container *ngIf=\"errorCode === '1002'\">\n <div>\n Something is wrong with extraction data. Please try again.\n </div>\n </ng-container>\n\n <ul *ngIf=\"errorCode === '1000'\">\n <li>\n {{\n \"pms.dialogs.components.scanProfile.placeIdCloseToDevice\"\n | translate\n }}\n </li>\n <li>\n {{\n \"pms.dialogs.components.scanProfile.ensureSufficientLight\"\n | translate\n }}\n </li>\n <li>\n {{\n \"pms.dialogs.components.scanProfile.holdDocumentSteady\"\n | translate\n }}\n </li>\n <li>\n {{\n \"pms.dialogs.components.scanProfile.makeSureAllEdgesOfTheIdAreVisible\"\n | translate\n }}\n </li>\n <li>\n {{\n \"pms.dialogs.components.scanProfile.makeSureThereAreNoGlareAndShadowsOnTheId\"\n | translate\n }}\n </li>\n </ul>\n </div>\n </div>\n\n <div\n class=\"scanPreview\"\n fxFlex\n fxLayout=\"column\"\n *ngIf=\"!error && !scaning\"\n >\n <!-- <div class=\"py-16\" style=\"font-size: 16px\">\n {{\n \"pms.dialogs.components.scanProfile.ensureAllTextsAreVisible\"\n | translate\n }}\n </div> -->\n <div\n fxFlex\n class=\"image\"\n [style.background-image]=\"'url(' + preview + ')'\"\n ></div>\n </div>\n </div>\n </div>\n\n <footer>\n <div\n class=\"displayInfo\"\n ngClass.lt-sm=\"mobile\"\n *ngIf=\"!preview && cameraReady\"\n >\n {{ displayInfo }}\n </div>\n <!-- <div style=\"height: 26px\">\n <div\n style=\"text-align: center; font-size: 18px\"\n *ngIf=\"idScan && !preview && cameraReady\"\n >\n <ng-container *ngIf=\"idScan === 'BACK'\">\n Turn document and:\n {{ \"pms.dialogs.components.scanProfile.captureBack\" | translate }}\n </ng-container>\n <ng-container *ngIf=\"idScan === 'FRONT'\">\n Turn document and:\n {{ \"pms.dialogs.components.scanProfile.captureFront\" | translate }}\n </ng-container>\n </div>\n </div> -->\n\n <div class=\"actions\" *ngIf=\"preview\">\n <button fxFlex class=\"mr-4\" mat-raised-button (click)=\"retry()\">\n {{ \"pms.dialogs.components.scanProfile.retry\" | translate }}\n </button>\n\n <button\n [disabled]=\"error\"\n fxFlex\n class=\"ml-4\"\n mat-raised-button\n (click)=\"continue()\"\n >\n {{\n \"pms.dialogs.components.scanProfile.continueWithSelectedImage\"\n | translate\n }}\n </button>\n </div>\n </footer>\n</section>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1;background-color:#f5f5f5;overflow:hidden}section{flex:1;display:flex;flex-direction:column;position:relative;overflow:hidden}.wraper{position:relative;overflow:hidden;display:flex;flex-direction:column;flex:1}.wraper .loading{position:absolute;inset:0;z-index:20;background-color:#f5f5f5}.documentTurnOver{position:absolute;width:100%;height:100%;top:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.documentTurnOver mat-icon{width:200px;color:#fff;height:200px;font-size:100px}.displayInfo{text-align:center;flex:1;width:100%;background-color:#000;height:50px;line-height:50px;color:#fff;z-index:200}.displayInfo.mobile{font-size:12px}.preview{width:100%;border-radius:1%}footer button{box-shadow:none!important;height:45px;min-height:45px;text-transform:uppercase}footer .actions{display:flex;flex-direction:row;align-items:center;padding:8px}footer .actions button{flex:1}.error{display:flex;align-items:center;justify-content:center;flex:1}.error .title{font-size:20px;margin-bottom:8px}.error .title mat-icon{margin-right:8px}.error ul{font-size:18px;list-style-type:none}mat-card{box-shadow:none!important}.mr-4{margin-right:4px}.ml-4{margin-left:4px}.p-16{padding:16px}.p-8{padding:8px}.py-16{padding:16px 0}.w-100-p{width:100%}.scanPreview{padding:16px}.scanPreview .image{background-position:center;background-repeat:no-repeat;background-size:contain}.empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center}\n"] }]
2900
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: i1$2.TranslateService }, { type: NgxScandocCameraProvider }, { type: i0.Injector }, { type: LayoutProvider }, { type: AuthProvider }]; }, propDecorators: { type: [{
2901
+ type: Input
2902
+ }], dialogs: [{
2903
+ type: Input
2904
+ }], actions: [{
2905
+ type: Output
2906
+ }], showDialog: [{
2907
+ type: Input
2908
+ }], wraper: [{
2909
+ type: ViewChild,
2910
+ args: ['wraper']
2911
+ }], class: [{
2912
+ type: HostBinding,
2913
+ args: ['class.mobile']
2914
+ }], onResize: [{
2915
+ type: HostListener,
2916
+ args: ['window:resize', ['$event']]
2917
+ }] } });
2918
+
2919
+ class MaterialModule {
2920
+ }
2921
+ MaterialModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MaterialModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2922
+ MaterialModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: MaterialModule, imports: [MatNativeDateModule,
2923
+ MatDatepickerModule,
2924
+ MatCardModule,
2925
+ MatMenuModule,
2926
+ MatIconModule,
2927
+ MatButtonModule,
2928
+ MatDialogModule,
2929
+ MatInputModule,
2930
+ MatSnackBarModule,
2931
+ MatProgressBarModule,
2932
+ MatTableModule,
2933
+ MatProgressSpinnerModule,
2934
+ MatPaginatorModule,
2935
+ MatSelectModule,
2936
+ MatCheckboxModule,
2937
+ MatChipsModule,
2938
+ MatBadgeModule,
2939
+ MatListModule,
2940
+ MatTabsModule,
2941
+ MatSliderModule,
2942
+ MatSlideToggleModule], exports: [MatNativeDateModule,
2943
+ MatDatepickerModule,
2944
+ MatSelectModule,
2945
+ MatCardModule,
2946
+ MatMenuModule,
2947
+ MatIconModule,
2948
+ MatButtonModule,
2949
+ MatDialogModule,
2950
+ MatInputModule,
2951
+ MatSnackBarModule,
2952
+ MatProgressBarModule,
2953
+ MatProgressSpinnerModule,
2954
+ MatTableModule,
2955
+ MatPaginatorModule,
2956
+ MatChipsModule,
2957
+ MatBadgeModule,
2958
+ MatCheckboxModule,
2959
+ MatListModule,
2960
+ MatTabsModule,
2961
+ MatSlideToggleModule,
2962
+ MatAutocompleteModule] });
2963
+ MaterialModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MaterialModule, imports: [MatNativeDateModule,
2964
+ MatDatepickerModule,
2965
+ MatCardModule,
2966
+ MatMenuModule,
2967
+ MatIconModule,
2968
+ MatButtonModule,
2969
+ MatDialogModule,
2970
+ MatInputModule,
2971
+ MatSnackBarModule,
2972
+ MatProgressBarModule,
2973
+ MatTableModule,
2974
+ MatProgressSpinnerModule,
2975
+ MatPaginatorModule,
2976
+ MatSelectModule,
2977
+ MatCheckboxModule,
2978
+ MatChipsModule,
2979
+ MatBadgeModule,
2980
+ MatListModule,
2981
+ MatTabsModule,
2982
+ MatSliderModule,
2983
+ MatSlideToggleModule, MatNativeDateModule,
2984
+ MatDatepickerModule,
2985
+ MatSelectModule,
2986
+ MatCardModule,
2987
+ MatMenuModule,
2988
+ MatIconModule,
2989
+ MatButtonModule,
2990
+ MatDialogModule,
2991
+ MatInputModule,
2992
+ MatSnackBarModule,
2993
+ MatProgressBarModule,
2994
+ MatProgressSpinnerModule,
2995
+ MatTableModule,
2996
+ MatPaginatorModule,
2997
+ MatChipsModule,
2998
+ MatBadgeModule,
2999
+ MatCheckboxModule,
3000
+ MatListModule,
3001
+ MatTabsModule,
3002
+ MatSlideToggleModule,
3003
+ MatAutocompleteModule] });
3004
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MaterialModule, decorators: [{
3005
+ type: NgModule,
3006
+ args: [{
3007
+ imports: [
3008
+ MatNativeDateModule,
3009
+ MatDatepickerModule,
3010
+ MatCardModule,
3011
+ MatMenuModule,
3012
+ MatIconModule,
3013
+ MatButtonModule,
3014
+ MatDialogModule,
3015
+ MatInputModule,
3016
+ MatSnackBarModule,
3017
+ MatProgressBarModule,
3018
+ MatTableModule,
3019
+ MatProgressSpinnerModule,
3020
+ MatPaginatorModule,
3021
+ MatSelectModule,
3022
+ MatCheckboxModule,
3023
+ MatChipsModule,
3024
+ MatBadgeModule,
3025
+ MatListModule,
3026
+ MatTabsModule,
3027
+ MatSliderModule,
3028
+ MatSlideToggleModule,
3029
+ ],
3030
+ exports: [
3031
+ MatNativeDateModule,
3032
+ MatDatepickerModule,
3033
+ MatSelectModule,
3034
+ MatCardModule,
3035
+ MatMenuModule,
3036
+ MatIconModule,
3037
+ MatButtonModule,
3038
+ MatDialogModule,
3039
+ MatInputModule,
3040
+ MatSnackBarModule,
3041
+ MatProgressBarModule,
3042
+ MatProgressSpinnerModule,
3043
+ MatTableModule,
3044
+ MatPaginatorModule,
3045
+ MatChipsModule,
3046
+ MatBadgeModule,
3047
+ MatCheckboxModule,
3048
+ MatListModule,
3049
+ MatTabsModule,
3050
+ MatSlideToggleModule,
3051
+ MatAutocompleteModule,
3052
+ ],
3053
+ providers: [],
3054
+ }]
3055
+ }] });
3056
+
3057
+ class AvatarTypeComponent extends FieldType {
3058
+ constructor(cd) {
3059
+ super();
3060
+ this.cd = cd;
3061
+ this.width = 'w-120';
3062
+ this.padding = 'px-32 pt-8 pb-8';
3063
+ }
3064
+ ngOnChange() { }
3065
+ ngAfterViewInit() {
3066
+ if (this.to.width) {
3067
+ this.width = this.to.width;
3068
+ }
3069
+ if (this.to.padding) {
3070
+ this.padding = this.to.padding;
3071
+ }
3072
+ this.cd.detectChanges();
3073
+ }
3074
+ }
3075
+ AvatarTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AvatarTypeComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3076
+ AvatarTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: AvatarTypeComponent, selector: "app-formly-avatar-type", usesInheritance: true, ngImport: i0, template: `
3077
+ <mat-card
3078
+ [ngClass]="padding"
3079
+ fxLayout="column"
3080
+ fxLayoutAlign="center center"
3081
+ >
3082
+ <ngx-avatars
3083
+ [name]="model[key.toString()]"
3084
+ [ngClass]="width"
3085
+ ></ngx-avatars>
3086
+ </mat-card>
3087
+ `, isInline: true, styles: ["mat-card{border-radius:0;box-shadow:none!important}\n"], dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i5$1.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { kind: "component", type: i3.AvatarComponent, selector: "ngx-avatars", inputs: ["round", "size", "textSizeRatio", "bgColor", "fgColor", "borderColor", "style", "cornerRadius", "facebookId", "twitterId", "googleId", "instagramId", "vkontakteId", "skypeId", "gravatarId", "githubId", "src", "name", "value", "referrerpolicy", "placeholder", "initialsSize"], outputs: ["clickOnAvatar"] }] });
3088
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AvatarTypeComponent, decorators: [{
3089
+ type: Component,
3090
+ args: [{ selector: 'app-formly-avatar-type', template: `
3091
+ <mat-card
3092
+ [ngClass]="padding"
3093
+ fxLayout="column"
3094
+ fxLayoutAlign="center center"
3095
+ >
3096
+ <ngx-avatars
3097
+ [name]="model[key.toString()]"
3098
+ [ngClass]="width"
3099
+ ></ngx-avatars>
3100
+ </mat-card>
3101
+ `, styles: ["mat-card{border-radius:0;box-shadow:none!important}\n"] }]
3102
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; } });
3103
+
3104
+ class TitleTypeComponent extends FieldType {
3105
+ constructor(cd) {
3106
+ super();
3107
+ this.cd = cd;
3108
+ }
3109
+ ngOnInit() {
3110
+ this.opt = {
3111
+ badge: this.to.badge,
3112
+ };
3113
+ }
3114
+ ngAfterViewInit() {
3115
+ this.cd.detectChanges();
3116
+ }
3117
+ }
3118
+ TitleTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TitleTypeComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3119
+ TitleTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TitleTypeComponent, selector: "app-formly-title-type", usesInheritance: true, ngImport: i0, template: `
3120
+ <div fxLayout="row" fxLayoutAlign="start center">
3121
+ <h3>
3122
+ <span>{{ to.label }}</span>
3123
+
3124
+ <span
3125
+ *ngIf="opt.badge && model[opt.badge] && model[opt.badge].length > 1"
3126
+ matBadgeSize="small"
3127
+ matBadgeColor="primary"
3128
+ matBadgeOverlap="false"
3129
+ ></span>
3130
+ </h3>
3131
+ <span fxFlex></span>
3132
+ <div *ngIf="to.chip" class="chip">
3133
+ {{ to.chip | translate }}
3134
+ </div>
3135
+ </div>
3136
+ `, isInline: true, styles: [".chip{background:whitesmoke;border-radius:6px;padding:4px 8px;font-size:12px;color:#888;font-weight:600}\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }] });
3137
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TitleTypeComponent, decorators: [{
3138
+ type: Component,
3139
+ args: [{ selector: 'app-formly-title-type', template: `
3140
+ <div fxLayout="row" fxLayoutAlign="start center">
3141
+ <h3>
3142
+ <span>{{ to.label }}</span>
3143
+
3144
+ <span
3145
+ *ngIf="opt.badge && model[opt.badge] && model[opt.badge].length > 1"
3146
+ matBadgeSize="small"
3147
+ matBadgeColor="primary"
3148
+ matBadgeOverlap="false"
3149
+ ></span>
3150
+ </h3>
3151
+ <span fxFlex></span>
3152
+ <div *ngIf="to.chip" class="chip">
3153
+ {{ to.chip | translate }}
3154
+ </div>
3155
+ </div>
3156
+ `, styles: [".chip{background:whitesmoke;border-radius:6px;padding:4px 8px;font-size:12px;color:#888;font-weight:600}\n"] }]
3157
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; } });
3158
+
3159
+ class ProfileImageTypeComponent extends FieldType {
3160
+ constructor(cd) {
3161
+ super();
3162
+ this.cd = cd;
3163
+ }
3164
+ ngOnChange() { }
3165
+ ngAfterViewInit() {
3166
+ if (this.to.width) {
3167
+ this.width = this.to.width;
3168
+ }
3169
+ if (this.to.padding) {
3170
+ this.padding = this.to.padding;
3171
+ }
3172
+ this.cd.detectChanges();
3173
+ }
3174
+ }
3175
+ ProfileImageTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ProfileImageTypeComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3176
+ ProfileImageTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ProfileImageTypeComponent, selector: "app-formly-profile-image-type", usesInheritance: true, ngImport: i0, template: `
3177
+ <mat-card
3178
+
3179
+ fxLayout="column"
3180
+ fxLayoutAlign="center center"
3181
+ >
3182
+ <ngx-avatars
3183
+ class="profile-image"
3184
+ [src]="model[key.toString()]"
3185
+ [size]="150"
3186
+
3187
+ ></ngx-avatars>
3188
+ </mat-card>
3189
+ `, isInline: true, styles: ["mat-card{border-radius:0;box-shadow:none!important}.profile-image{width:150px;height:150px;border-radius:50%}\n"], dependencies: [{ kind: "component", type: i5$1.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { kind: "component", type: i3.AvatarComponent, selector: "ngx-avatars", inputs: ["round", "size", "textSizeRatio", "bgColor", "fgColor", "borderColor", "style", "cornerRadius", "facebookId", "twitterId", "googleId", "instagramId", "vkontakteId", "skypeId", "gravatarId", "githubId", "src", "name", "value", "referrerpolicy", "placeholder", "initialsSize"], outputs: ["clickOnAvatar"] }] });
3190
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ProfileImageTypeComponent, decorators: [{
3191
+ type: Component,
3192
+ args: [{ selector: 'app-formly-profile-image-type', template: `
3193
+ <mat-card
3194
+
3195
+ fxLayout="column"
3196
+ fxLayoutAlign="center center"
3197
+ >
3198
+ <ngx-avatars
3199
+ class="profile-image"
3200
+ [src]="model[key.toString()]"
3201
+ [size]="150"
3202
+
3203
+ ></ngx-avatars>
3204
+ </mat-card>
3205
+ `, styles: ["mat-card{border-radius:0;box-shadow:none!important}.profile-image{width:150px;height:150px;border-radius:50%}\n"] }]
3206
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; } });
3207
+
3208
+ class AppFormModule {
3209
+ }
3210
+ AppFormModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AppFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3211
+ AppFormModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: AppFormModule, declarations: [TitleTypeComponent,
3212
+ AvatarTypeComponent,
3213
+ ProfileImageTypeComponent], imports: [CommonModule,
3214
+ FormsModule,
3215
+ FormlyMatDatepickerModule,
3216
+ FormlySelectModule,
3217
+ MaterialModule,
3218
+ AvatarModule,
3219
+ TranslateModule,
3220
+ FormlyMaterialModule, i7.FormlyModule], exports: [FormlyModule] });
3221
+ AppFormModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AppFormModule, imports: [CommonModule,
3222
+ FormsModule,
3223
+ FormlyMatDatepickerModule,
3224
+ FormlySelectModule,
3225
+ MaterialModule,
3226
+ AvatarModule,
3227
+ TranslateModule,
3228
+ FormlyMaterialModule,
3229
+ FormlyModule.forRoot({
3230
+ types: [
3231
+ {
3232
+ name: 'title',
3233
+ component: TitleTypeComponent,
3234
+ wrappers: [],
3235
+ },
3236
+ {
3237
+ name: 'profile-image',
3238
+ component: ProfileImageTypeComponent,
3239
+ wrappers: [],
3240
+ },
3241
+ ],
3242
+ }), FormlyModule] });
3243
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AppFormModule, decorators: [{
3244
+ type: NgModule,
3245
+ args: [{
3246
+ declarations: [
3247
+ TitleTypeComponent,
3248
+ AvatarTypeComponent,
3249
+ ProfileImageTypeComponent,
3250
+ ],
3251
+ imports: [
3252
+ CommonModule,
3253
+ FormsModule,
3254
+ FormlyMatDatepickerModule,
3255
+ FormlySelectModule,
3256
+ MaterialModule,
3257
+ AvatarModule,
3258
+ TranslateModule,
3259
+ FormlyMaterialModule,
3260
+ FormlyModule.forRoot({
3261
+ types: [
3262
+ {
3263
+ name: 'title',
3264
+ component: TitleTypeComponent,
3265
+ wrappers: [],
3266
+ },
3267
+ {
3268
+ name: 'profile-image',
3269
+ component: ProfileImageTypeComponent,
3270
+ wrappers: [],
3271
+ },
3272
+ ],
3273
+ }),
3274
+ ],
3275
+ providers: [],
3276
+ exports: [FormlyModule],
3277
+ }]
3278
+ }] });
3279
+
3280
+ class CameraSwitchComponent {
3281
+ constructor(cameraProvider) {
3282
+ this.cameraProvider = cameraProvider;
3075
3283
  }
3284
+ ngAfterViewInit() { }
3285
+ ngOnDestroy() { }
3076
3286
  }
3077
- ScanFieldsProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanFieldsProvider, deps: [{ token: TranslationProvider }, { token: ScanProvider }], target: i0.ɵɵFactoryTarget.Injectable });
3078
- ScanFieldsProviderprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanFieldsProvider, providedIn: 'root' });
3079
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanFieldsProvider, decorators: [{
3080
- type: Injectable,
3287
+ CameraSwitchComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CameraSwitchComponent, deps: [{ token: NgxScandocCameraProvider }], target: i0.ɵɵFactoryTarget.Component });
3288
+ CameraSwitchComponentcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: CameraSwitchComponent, selector: "ngx-scan-camera-switch", ngImport: i0, template: "<mat-form-field\n style=\"font-size: 14px; width: 200px; margin-top: 8px\"\n class=\"w-100 mr-16 mt-8\"\n>\n <mat-label> Camera </mat-label>\n <mat-select (selectionChange)=\"cameraProvider.selectCamera($event)\" [(ngModel)]=\"cameraProvider.deviceId\">\n <mat-option *ngFor=\"let device of cameraProvider.mediaDevices\" [value]=\"device.deviceId\">\n {{ device.label }}\n </mat-option>\n </mat-select>\n</mat-form-field>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1}\n"], dependencies: [{ kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$1.MatLabel, selector: "mat-label" }, { kind: "component", type: i5$2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i6$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }] });
3289
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CameraSwitchComponent, decorators: [{
3290
+ type: Component,
3291
+ args: [{ selector: 'ngx-scan-camera-switch', template: "<mat-form-field\n style=\"font-size: 14px; width: 200px; margin-top: 8px\"\n class=\"w-100 mr-16 mt-8\"\n>\n <mat-label> Camera </mat-label>\n <mat-select (selectionChange)=\"cameraProvider.selectCamera($event)\" [(ngModel)]=\"cameraProvider.deviceId\">\n <mat-option *ngFor=\"let device of cameraProvider.mediaDevices\" [value]=\"device.deviceId\">\n {{ device.label }}\n </mat-option>\n </mat-select>\n</mat-form-field>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1}\n"] }]
3292
+ }], ctorParameters: function () { return [{ type: NgxScandocCameraProvider }]; } });
3293
+
3294
+ class CoreComponentsModule {
3295
+ }
3296
+ CoreComponentsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CoreComponentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3297
+ CoreComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: CoreComponentsModule, declarations: [ScanComponent, ScanResultsComponent, CameraSwitchComponent], imports: [CommonModule,
3298
+ FormsModule,
3299
+ TranslateModule,
3300
+ WebcamModule,
3301
+ MaterialModule,
3302
+ AppFormModule,
3303
+ ReactiveFormsModule], exports: [WebcamModule, ScanComponent, CameraSwitchComponent] });
3304
+ CoreComponentsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CoreComponentsModule, imports: [CommonModule,
3305
+ FormsModule,
3306
+ TranslateModule,
3307
+ WebcamModule,
3308
+ MaterialModule,
3309
+ AppFormModule,
3310
+ ReactiveFormsModule, WebcamModule] });
3311
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CoreComponentsModule, decorators: [{
3312
+ type: NgModule,
3081
3313
  args: [{
3082
- providedIn: 'root',
3314
+ imports: [
3315
+ CommonModule,
3316
+ FormsModule,
3317
+ TranslateModule,
3318
+ WebcamModule,
3319
+ MaterialModule,
3320
+ AppFormModule,
3321
+ ReactiveFormsModule,
3322
+ ],
3323
+ declarations: [ScanComponent, ScanResultsComponent, CameraSwitchComponent],
3324
+ exports: [WebcamModule, ScanComponent, CameraSwitchComponent],
3325
+ providers: [],
3083
3326
  }]
3084
- }], ctorParameters: function () { return [{ type: TranslationProvider }, { type: ScanProvider }]; } });
3327
+ }] });
3085
3328
 
3086
- class ScanProfileComponent {
3087
- constructor(cd, scanProvider, dialogs, formProvider, zone, translate, auth // private api: ServerProvider
3088
- ) {
3329
+ class SafeResourceUrlPipe {
3330
+ constructor(sanitizer) {
3331
+ this.sanitizer = sanitizer;
3332
+ }
3333
+ transform(style) {
3334
+ return this.sanitizer.bypassSecurityTrustResourceUrl(style);
3335
+ // return this.sanitizer.bypassSecurityTrustStyle(style);
3336
+ // return this.sanitizer.bypassSecurityTrustXxx(style); - see docs
3337
+ }
3338
+ }
3339
+ SafeResourceUrlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SafeResourceUrlPipe, deps: [{ token: i1$3.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
3340
+ SafeResourceUrlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: SafeResourceUrlPipe, name: "safeResourceUrl" });
3341
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SafeResourceUrlPipe, decorators: [{
3342
+ type: Pipe,
3343
+ args: [{ name: 'safeResourceUrl' }]
3344
+ }], ctorParameters: function () { return [{ type: i1$3.DomSanitizer }]; } });
3345
+
3346
+ class CorePipesModule {
3347
+ }
3348
+ CorePipesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CorePipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3349
+ CorePipesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: CorePipesModule, declarations: [SafeResourceUrlPipe], exports: [SafeResourceUrlPipe] });
3350
+ CorePipesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CorePipesModule });
3351
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CorePipesModule, decorators: [{
3352
+ type: NgModule,
3353
+ args: [{
3354
+ declarations: [SafeResourceUrlPipe],
3355
+ imports: [],
3356
+ exports: [
3357
+ SafeResourceUrlPipe,
3358
+ ],
3359
+ }]
3360
+ }] });
3361
+
3362
+ class BlankComponent {
3363
+ constructor(dialogRef, data, cd) {
3364
+ this.dialogRef = dialogRef;
3365
+ this.data = data;
3366
+ this.cd = cd;
3367
+ this.initSet = false;
3368
+ }
3369
+ setModel(model) {
3370
+ this.data.data.model = model;
3371
+ this.init();
3372
+ }
3373
+ init() {
3374
+ var _a, _b;
3375
+ this.initSet = true;
3376
+ (_a = this.body) === null || _a === void 0 ? void 0 : _a.clear();
3377
+ const componentRef = (_b = this.body) === null || _b === void 0 ? void 0 : _b.createComponent(this.data.component);
3378
+ componentRef.instance.data = this.data.data;
3379
+ // componentRef.instance.dialogs = this.dialogs;
3380
+ componentRef.instance.dialogRef = this.dialogRef;
3381
+ if (componentRef.instance.init) {
3382
+ componentRef.instance.init();
3383
+ }
3384
+ this.cd.detectChanges();
3385
+ }
3386
+ ngAfterViewInit() {
3387
+ if (!this.initSet) {
3388
+ this.init();
3389
+ }
3390
+ }
3391
+ }
3392
+ BlankComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: BlankComponent, deps: [{ token: i1$4.MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3393
+ BlankComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: BlankComponent, selector: "app-dialog-blank", viewQueries: [{ propertyName: "body", first: true, predicate: ["body"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<ng-template #body></ng-template>\n", styles: [":host{display:flex;flex:1;flex-direction:column;overflow:hidden;height:100%}\n"] });
3394
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: BlankComponent, decorators: [{
3395
+ type: Component,
3396
+ args: [{ selector: 'app-dialog-blank', template: "<ng-template #body></ng-template>\n", styles: [":host{display:flex;flex:1;flex-direction:column;overflow:hidden;height:100%}\n"] }]
3397
+ }], ctorParameters: function () {
3398
+ return [{ type: i1$4.MatDialogRef }, { type: undefined, decorators: [{
3399
+ type: Inject,
3400
+ args: [MAT_DIALOG_DATA]
3401
+ }] }, { type: i0.ChangeDetectorRef }];
3402
+ }, propDecorators: { body: [{
3403
+ type: ViewChild,
3404
+ args: ['body', { read: ViewContainerRef, static: true }]
3405
+ }] } });
3406
+
3407
+ class LoadingComponent {
3408
+ }
3409
+ LoadingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoadingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3410
+ LoadingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: LoadingComponent, selector: "app-loading", ngImport: i0, template: "<div style=\"width:240px;\">\n\n <div class=\"pb-16\" style=\"font-size: 18px;padding-bottom:16px;\">\n Loading...\n </div>\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n</div>\n", styles: [""], dependencies: [{ kind: "component", type: i9.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }] });
3411
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoadingComponent, decorators: [{
3412
+ type: Component,
3413
+ args: [{ selector: 'app-loading', template: "<div style=\"width:240px;\">\n\n <div class=\"pb-16\" style=\"font-size: 18px;padding-bottom:16px;\">\n Loading...\n </div>\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n</div>\n" }]
3414
+ }] });
3415
+
3416
+ class ConfirmComponent {
3417
+ constructor(dialogRef, data) {
3418
+ this.dialogRef = dialogRef;
3419
+ this.data = data;
3420
+ this.showDetails = false;
3421
+ this.images = {
3422
+ alert: 'page-lost.svg',
3423
+ prompt: 'bedroom.svg',
3424
+ dirty: 'opps.svg',
3425
+ };
3426
+ this.options = {};
3427
+ }
3428
+ onEnterPress(e) {
3429
+ this.action(true);
3430
+ }
3431
+ onEscapePress(e) {
3432
+ this.action(false);
3433
+ }
3434
+ ngOnInit() {
3435
+ console.log(this.data);
3436
+ this.options = this.data.options || {};
3437
+ this.type = this.options.type || this.data.type || 'prompt';
3438
+ }
3439
+ action(key) {
3440
+ this.dialogRef.close(key);
3441
+ }
3442
+ close() { }
3443
+ }
3444
+ ConfirmComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ConfirmComponent, deps: [{ token: i1$4.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
3445
+ ConfirmComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ConfirmComponent, selector: "app-confirm", host: { listeners: { "document:keyup.enter": "onEnterPress($event)", "document:keyup.escape": "onEscapePress($event)" } }, ngImport: i0, template: "<header class=\"page-header\" fxLayout=\"row\" fxLayoutAlign=\"start center\">\n\n\n <div class=\"title\" ngClass.lt-sm=\"title-small\">\n {{ data.title | translate }}\n\n <!-- {{ data.text.statusText }} {{ data.text.status }} -->\n </div>\n\n <span fxFlex></span>\n\n <!-- <div class=\"separator\"></div>\n\n <button mat-button (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button> -->\n <!-- <mat-icon class=\"mr-16\" style=\"color:#888;\">info_outline</mat-icon> -->\n</header>\n\n<div fxLayout=\"column\" fxLayoutAlign=\"center center\">\n <!-- <img\n style=\"height: 240px; margin: 34px 0px;display: none;\"\n [src]=\"'/assets/images/illustrations/' + images[type]\"\n /> -->\n <!-- <img style=\"width:60px;\" src=\"/assets/images/illustrations/door-lock.png\"> -->\n\n <div class=\"text\" *ngIf=\"data.text\">\n <span [innerHtml]=\"data.text\"></span>\n </div>\n</div>\n\n<!-- -->\n\n<footer>\n\n <div class=\"actions\" fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <button\n *ngIf=\"!data.alert && !options?.hideCancelButton\"\n (click)=\"action(false)\"\n mat-raised-button\n >\n {{ data.cancel || 'core.page.cancel' | translate }}\n </button>\n\n <button\n *ngIf=\"data.no && !options?.hideNoButton\"\n (click)=\"action('no')\"\n\n mat-raised-button\n >\n {{ data.no }}\n </button>\n <button\n *ngIf=\"!data.hideOkButton && !options?.hideOkButton\"\n (click)=\"action(true)\"\n color=\"accent\"\n mat-raised-button\n >\n <ng-container *ngIf=\"!data.alert\">\n {{ data.ok || 'core.page.confirm' | translate }}\n </ng-container>\n\n <ng-container *ngIf=\"data.alert\">\n {{ data.ok || 'core.page.close' | translate }}\n </ng-container>\n </button>\n </div>\n</footer>\n", styles: [":host{display:flex;flex-direction:column;flex:1;height:100%;width:100%}.title{font-size:18px}.text{padding:0 30px;text-align:center;font-size:16px;margin:40px 0}.actions{min-height:60px}.actions button{min-width:120px;margin-right:16px;box-shadow:none;text-transform:uppercase}footer{background-color:#fff}footer button{box-shadow:none!important;border:1px solid rgba(0,0,0,.12);font-size:13px}\n", ".page-header{z-index:2000;height:64px;padding:0;background-color:#fff;border-bottom:1px solid rgba(0,0,0,.12)}.page-header .title{padding-left:24px;line-height:64px;font-size:18px}.page-header .separator{width:1px;background-color:#0000001f;height:100%}.page-header .total{line-height:64px}.page-header .total span{font-weight:700}.page-footer{height:64px}.page-footer button{margin-left:24px;box-shadow:none!important}\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i4$2.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i4$2.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i4$2.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i5$3.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }] });
3446
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ConfirmComponent, decorators: [{
3447
+ type: Component,
3448
+ args: [{ selector: 'app-confirm', template: "<header class=\"page-header\" fxLayout=\"row\" fxLayoutAlign=\"start center\">\n\n\n <div class=\"title\" ngClass.lt-sm=\"title-small\">\n {{ data.title | translate }}\n\n <!-- {{ data.text.statusText }} {{ data.text.status }} -->\n </div>\n\n <span fxFlex></span>\n\n <!-- <div class=\"separator\"></div>\n\n <button mat-button (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button> -->\n <!-- <mat-icon class=\"mr-16\" style=\"color:#888;\">info_outline</mat-icon> -->\n</header>\n\n<div fxLayout=\"column\" fxLayoutAlign=\"center center\">\n <!-- <img\n style=\"height: 240px; margin: 34px 0px;display: none;\"\n [src]=\"'/assets/images/illustrations/' + images[type]\"\n /> -->\n <!-- <img style=\"width:60px;\" src=\"/assets/images/illustrations/door-lock.png\"> -->\n\n <div class=\"text\" *ngIf=\"data.text\">\n <span [innerHtml]=\"data.text\"></span>\n </div>\n</div>\n\n<!-- -->\n\n<footer>\n\n <div class=\"actions\" fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <button\n *ngIf=\"!data.alert && !options?.hideCancelButton\"\n (click)=\"action(false)\"\n mat-raised-button\n >\n {{ data.cancel || 'core.page.cancel' | translate }}\n </button>\n\n <button\n *ngIf=\"data.no && !options?.hideNoButton\"\n (click)=\"action('no')\"\n\n mat-raised-button\n >\n {{ data.no }}\n </button>\n <button\n *ngIf=\"!data.hideOkButton && !options?.hideOkButton\"\n (click)=\"action(true)\"\n color=\"accent\"\n mat-raised-button\n >\n <ng-container *ngIf=\"!data.alert\">\n {{ data.ok || 'core.page.confirm' | translate }}\n </ng-container>\n\n <ng-container *ngIf=\"data.alert\">\n {{ data.ok || 'core.page.close' | translate }}\n </ng-container>\n </button>\n </div>\n</footer>\n", styles: [":host{display:flex;flex-direction:column;flex:1;height:100%;width:100%}.title{font-size:18px}.text{padding:0 30px;text-align:center;font-size:16px;margin:40px 0}.actions{min-height:60px}.actions button{min-width:120px;margin-right:16px;box-shadow:none;text-transform:uppercase}footer{background-color:#fff}footer button{box-shadow:none!important;border:1px solid rgba(0,0,0,.12);font-size:13px}\n", ".page-header{z-index:2000;height:64px;padding:0;background-color:#fff;border-bottom:1px solid rgba(0,0,0,.12)}.page-header .title{padding-left:24px;line-height:64px;font-size:18px}.page-header .separator{width:1px;background-color:#0000001f;height:100%}.page-header .total{line-height:64px}.page-header .total span{font-weight:700}.page-footer{height:64px}.page-footer button{margin-left:24px;box-shadow:none!important}\n"] }]
3449
+ }], ctorParameters: function () {
3450
+ return [{ type: i1$4.MatDialogRef }, { type: undefined, decorators: [{
3451
+ type: Inject,
3452
+ args: [MAT_DIALOG_DATA]
3453
+ }] }];
3454
+ }, propDecorators: { onEnterPress: [{
3455
+ type: HostListener,
3456
+ args: ['document:keyup.enter', ['$event']]
3457
+ }], onEscapePress: [{
3458
+ type: HostListener,
3459
+ args: ['document:keyup.escape', ['$event']]
3460
+ }] } });
3461
+
3462
+ class ScanSelfieComponent {
3463
+ constructor(cd, scanProvider, dialogs,
3464
+ // private formProvider: ScanFieldsProvider,
3465
+ translate) {
3089
3466
  this.cd = cd;
3090
3467
  this.scanProvider = scanProvider;
3091
3468
  this.dialogs = dialogs;
3092
- this.formProvider = formProvider;
3093
- this.zone = zone;
3094
3469
  this.translate = translate;
3095
- this.auth = auth;
3096
3470
  this.scanBlastData = [
3097
3471
  {
3098
3472
  title: 'pms.dialogs.components.scanProfile.front',
@@ -3113,47 +3487,26 @@ class ScanProfileComponent {
3113
3487
  width: 1920,
3114
3488
  height: 1080,
3115
3489
  facingMode: 'environment',
3116
- };
3117
- this.startTime = 0;
3118
- this.isDebug = false;
3490
+ };
3119
3491
  this.multipleWebcamsAvailable = false;
3120
- this.scanInProgress = false;
3121
3492
  // webcam snapshot trigger
3122
3493
  this.documentTypeSelected = false;
3123
3494
  this.preview = null;
3124
- this.errorCode = '1000';
3125
- this.displayInfo = 'Position document inside rectange and hold steady.';
3126
3495
  this.allowCameraSwitch = true;
3127
- this.verificationErrorSent = false;
3128
3496
  this.error = false;
3129
3497
  this.cameraReady = false;
3130
3498
  this.scaning = false;
3131
- this.imageHandler = new Subject();
3132
- this.logData = {
3133
- AcceptTermsAndConditions: true,
3134
- Request: null,
3135
- Response: null,
3136
- ExpectedOutput: null,
3137
- };
3138
3499
  this.scanDatas = [];
3139
- this.idScan = null;
3140
- this.validation = false;
3141
- this.scannedImages = [];
3142
- this.scanDelay = 0;
3143
3500
  this.trigger = new Subject();
3144
3501
  // switch to next / previous / specific webcam; true/false: forward/backwards, string: deviceId
3145
3502
  this.nextWebcam = new Subject();
3146
- this.imageVerified = false;
3147
3503
  this.form = new FormGroup({});
3148
- this.scanImageTimestamps = {
3149
- time: 0,
3150
- load: 0,
3151
- };
3152
3504
  }
3153
3505
  onResize() {
3154
3506
  if (this.wraper) {
3155
3507
  this.width = this.wraper.nativeElement.clientWidth;
3156
3508
  this.height = this.wraper.nativeElement.clientHeight;
3509
+ console.log(this.width, this.height);
3157
3510
  setTimeout(() => {
3158
3511
  var _a;
3159
3512
  const video = (_a = this.wraper) === null || _a === void 0 ? void 0 : _a.nativeElement.querySelector('video');
@@ -3162,214 +3515,27 @@ class ScanProfileComponent {
3162
3515
  this.videoWidth = video.clientWidth;
3163
3516
  this.videoHeight = video.clientHeight;
3164
3517
  }
3165
- this.cd.detectChanges();
3166
3518
  }, 100);
3167
3519
  this.cd.detectChanges();
3168
3520
  }
3169
3521
  }
3170
- resetLogData() {
3171
- this.logData = {
3172
- Request: null,
3173
- Response: null,
3174
- ExpectedOutput: null,
3175
- AcceptTermsAndConditions: true,
3176
- };
3177
- }
3178
- ngOnDestroy() {
3179
- if (this.scanTimeout) {
3180
- clearTimeout(this.scanTimeout);
3181
- }
3182
- if (this.imageHandlerSubscription) {
3183
- this.imageHandlerSubscription.unsubscribe();
3184
- }
3185
- }
3186
3522
  init() {
3187
- this.auth.accesToken.subscribe();
3188
- this.resetLogData();
3523
+ console.log('HAS MULTI');
3189
3524
  // this.result=true;
3190
3525
  // this.result ={};
3191
- this.fields = this.formProvider.document();
3526
+ this.fields = []; //this.formProvider.document();
3192
3527
  WebcamUtil.getAvailableVideoInputs().subscribe((mediaDevices) => {
3193
- console.log('[DEVICES]', mediaDevices.map((d) => d.label));
3528
+ console.log('[DEVICES]', mediaDevices);
3194
3529
  this.mediaDevices = mediaDevices;
3195
3530
  this.multipleWebcamsAvailable = mediaDevices && mediaDevices.length > 1;
3531
+ this.singleScan(this.scanBlastData[0]);
3196
3532
  });
3197
3533
  }
3198
- scan() {
3199
- // this.triggerSnapshot();
3200
- // this.scanDatas[0] = true;
3201
- // if (this.scanTimeout) {
3202
- // clearTimeout(this.scanTimeout);
3203
- // }
3204
- // this.scanTimeout = setTimeout(() => {
3205
- // this.scan();
3206
- // }, 1);
3207
- }
3208
- DataUrlFromImage() { }
3209
3534
  handleImage(webcamImage) {
3210
- // console.log('[received webcam image]', webcamImage);
3211
- this.zone.runOutsideAngular(() => {
3212
- const consoleBackground = "font-size:300px;background-image: url('" +
3213
- webcamImage.imageResized +
3214
- "');background-size: contain; background-repeat: no-repeat;";
3215
- // console.log('%c ', consoleBackground);
3216
- const time = new Date().getTime();
3217
- if (this.scanImageTimestamps.load > 0) {
3218
- const { load } = this.scanImageTimestamps;
3219
- const diff = time - load;
3220
- // console.log('time:', diff);
3221
- this.scanDelay = diff;
3222
- }
3223
- this.scanImageTimestamps.load = time;
3224
- if (webcamImage.imageData) {
3225
- this.scannedImages.push(webcamImage);
3226
- }
3227
- this.cd.detectChanges();
3228
- if (this.scannedImages.length > 4 && !this.validation) {
3229
- console.timeEnd('scan');
3230
- console.time('scan');
3231
- // get last 10
3232
- console.log('CAPTURED:', this.scannedImages.length);
3233
- const images = this.scannedImages.slice(-5);
3234
- // set images to 0
3235
- this.scannedImages = [];
3236
- const imagesArray = images.map((m) => m.imageResized.split(',')[1]);
3237
- this.validation = true;
3238
- this.handleBurstData(imagesArray, images);
3239
- // this.scanProvider.burst(imagesArray).subscribe((resp: any) => {
3240
- // // console.clear()
3241
- // console.log([resp.Info]);
3242
- // this.validation = false;
3243
- // this.displayInfo = resp.Info;
3244
- // if (resp.Validated) {
3245
- // if (this.scanTimeout) {
3246
- // clearTimeout(this.scanTimeout);
3247
- // }
3248
- // this.webcamImage = images[resp.Index];
3249
- // // this.preview = this.webcamImage.imageAsDataUrl;
3250
- // this.cd.detectChanges();
3251
- // const { DocType, Series, Side } = resp;
3252
- // // For ID ask for other side
3253
- // if (DocType === 'ID') {
3254
- // if (Side === 'FRONT') {
3255
- // this.scanBlastData[0].image = this.webcamImage;
3256
- // } else {
3257
- // this.scanBlastData[1].image = this.webcamImage;
3258
- // }
3259
- // if (this.scanBlastData[0].image && this.scanBlastData[1].image) {
3260
- // console.warn('UPLOAD');
3261
- // this.scanBlastFinish();
3262
- // } else {
3263
- // const num = Side === 'FRONT' ? 1 : 0;
3264
- // this.singleScan(this.scanBlastData[num]);
3265
- // this.scan();
3266
- // this.idScan = this.scanBlastData[num].side;
3267
- // console.log('ID SIDE', this.idScan);
3268
- // this.displayInfo = 'Please turn the document over!';
3269
- // }
3270
- // } else {
3271
- // this.scanBlastData[0].image = this.webcamImage;
3272
- // console.warn('UPLOAD');
3273
- // this.scanBlastFinish();
3274
- // }
3275
- // console.log(DocType, Series, Side);
3276
- // this.scannedImages = [];
3277
- // }
3278
- // });
3279
- }
3280
- if (this.cameraReady) {
3281
- // console.log('delay', this.scanDelay);
3282
- //console.log('timeD', new Date().getTime());
3283
- this.trigger.next(new Date().getTime());
3284
- // if (this.scanDelay < 100) {
3285
- // const diff = 100 - this.scanDelay;
3286
- // console.log(diff);
3287
- // const time2 = new Date().getTime();
3288
- // // const sub = of(1)
3289
- // // .pipe(delay(diff))
3290
- // // .subscribe((resp) => {
3291
- // // console.log(new Date().getTime()-time);
3292
- // // this.trigger.next();
3293
- // // sub.unsubscribe();
3294
- // // });
3295
- // const timeout = setTimeout(() => {
3296
- // console.log('TO', new Date().getTime() - time2);
3297
- // this.trigger.next();
3298
- // clearTimeout(timeout);
3299
- // }, diff);
3300
- // } else {
3301
- // this.trigger.next();
3302
- // }
3303
- }
3304
- });
3305
- // this.scanImageTimestamps = {
3306
- // time: new Date().getTime(),
3307
- // load:
3308
- // };
3309
- // this.webcamImage = webcamImage;
3310
- // this.preview = webcamImage.imageAsDataUrl;
3311
- // this.cd.detectChanges();
3312
- }
3313
- handleBurstData(imagesArray, images, type = 'plain') {
3314
- this.scanProvider.burst(imagesArray).subscribe((resp) => {
3315
- this.displayInfo = resp.Info;
3316
- console.timeEnd('validationPOST');
3317
- console.log('AnalysisTime', resp.AnalysisTime);
3318
- const { DocType, Series, Side, InfoCode } = resp;
3319
- // if (InfoCode === '1006' && this.idScan) {
3320
- // this.handleLongValidationError(image);
3321
- // }
3322
- if (resp.Validated) {
3323
- console.log('[SCANNED INDEX]', resp.Index);
3324
- const selectedImage = images[resp.Index];
3325
- // this.preview = this.webcamImage.imageAsDataUrl;
3326
- this.cd.detectChanges();
3327
- let image = selectedImage;
3328
- if (type == 'worker') {
3329
- const dataUrl = this.handleBitmapImage(selectedImage.bitmap);
3330
- image = { dataUrl };
3331
- }
3332
- if (InfoCode === '1007') {
3333
- // For ID ask for other side
3334
- if (Side === 'FRONT') {
3335
- this.scanBlastData[0].image = image;
3336
- }
3337
- else {
3338
- this.scanBlastData[1].image = image;
3339
- }
3340
- if (this.scanBlastData[0].image && this.scanBlastData[1].image) {
3341
- console.warn('UPLOAD');
3342
- if (type == 'worker') {
3343
- this.imageHandler.next({ type: 'stop' });
3344
- }
3345
- this.scanBlastFinish();
3346
- }
3347
- else {
3348
- const num = Side === 'FRONT' ? 1 : 0;
3349
- this.singleScan(this.scanBlastData[num]);
3350
- this.scan();
3351
- this.idScan = this.scanBlastData[num].side;
3352
- console.log('ID SIDE', this.idScan);
3353
- this.displayInfo = 'Please turn the document over!';
3354
- this.validation = false;
3355
- }
3356
- }
3357
- else {
3358
- this.scanBlastData[0].image = image;
3359
- console.warn('UPLOAD');
3360
- if (type == 'worker') {
3361
- this.imageHandler.next({ type: 'stop' });
3362
- }
3363
- this.scanBlastFinish();
3364
- }
3365
- this.scannedImages = [];
3366
- // this.scanBlastData[0].image = selectedImage;
3367
- //this.scanBlastFinish();
3368
- }
3369
- else {
3370
- this.validation = false;
3371
- }
3372
- });
3535
+ console.log('[received webcam image]', webcamImage);
3536
+ this.webcamImage = webcamImage;
3537
+ this.preview = webcamImage.imageAsDataUrl;
3538
+ this.cd.detectChanges();
3373
3539
  }
3374
3540
  handleInitError(error) {
3375
3541
  console.log(error);
@@ -3378,103 +3544,21 @@ class ScanProfileComponent {
3378
3544
  return this.scanBlastData[0].image ? true : false;
3379
3545
  }
3380
3546
  cameraWasSwitched(deviceId) {
3381
- console.log('[active device]', deviceId);
3547
+ console.log('active device: ' + deviceId);
3382
3548
  this.deviceId = deviceId;
3383
3549
  this.cameraReady = true;
3384
3550
  this.defaultDevice = deviceId;
3385
- setTimeout(() => {
3386
- this.onResize();
3387
- this.scan();
3388
- }, 300);
3551
+ this.onResize();
3389
3552
  }
3390
3553
  get nextWebcamObservable() {
3391
3554
  return this.nextWebcam.asObservable();
3392
3555
  }
3393
- handleLongValidationError(img) {
3394
- // save current image after 10sec
3395
- const diff = (Date.now() - this.startTime) / 1000;
3396
- if (diff > 15 && !this.verificationErrorSent) {
3397
- this.verificationErrorSent = true;
3398
- const dataUrl = this.handleBitmapImage(img.bitmap);
3399
- console.warn('SENT');
3400
- this.displayInfo = 'Cant detect document!';
3401
- this.logData.Request = this.scanProvider
3402
- .sendLog({
3403
- AcceptTermsAndConditions: true,
3404
- ExpectedOutput: {},
3405
- Request: {
3406
- verification: dataUrl.split(',')[1],
3407
- },
3408
- Response: {
3409
- TransactionID: v4(),
3410
- },
3411
- })
3412
- .subscribe();
3413
- }
3414
- }
3415
3556
  ngAfterViewInit() {
3416
3557
  this.cd.detectChanges();
3417
- this.autoScan();
3418
- this.imageHandlerSubscription = this.imageHandler.subscribe((webcamImage) => {
3419
- // return;
3420
- if (this.startTime === 0) {
3421
- this.startTime = Date.now();
3422
- }
3423
- this.zone.runOutsideAngular(() => {
3424
- if (webcamImage.base64) {
3425
- const time = new Date().getTime();
3426
- if (this.scanImageTimestamps.load > 0) {
3427
- const { load } = this.scanImageTimestamps;
3428
- const diff = time - load;
3429
- console.warn('TIME', diff);
3430
- this.scanDelay = diff;
3431
- }
3432
- this.scanImageTimestamps.load = time;
3433
- this.scannedImages.push(webcamImage);
3434
- this.handleLongValidationError(webcamImage);
3435
- }
3436
- // this.cd.detectChanges();
3437
- if (this.scannedImages.length > 4 && !this.validation) {
3438
- // get last 10
3439
- console.timeEnd('validationTOTAL_UI');
3440
- console.time('validationTOTAL_UI');
3441
- const images = this.scannedImages.slice(-5);
3442
- // set images to 0
3443
- this.scannedImages = [];
3444
- console.log(images);
3445
- const imagesArray = images.map((m) => m.base64.split(',')[1]);
3446
- this.validation = true;
3447
- this.handleBurstData(imagesArray, images, 'worker');
3448
- console.time('validationPOST');
3449
- }
3450
- this.cd.detectChanges();
3451
- });
3452
- });
3453
- }
3454
- handleBitmapImage(bitmap) {
3455
- const { width, height } = bitmap;
3456
- const offscreenSmall = document.createElement('canvas');
3457
- offscreenSmall.width = width;
3458
- offscreenSmall.height = height;
3459
- const ctx = offscreenSmall.getContext('bitmaprenderer');
3460
- if (ctx) {
3461
- ctx.imageSmoothingEnabled = false;
3462
- ctx.transferFromImageBitmap(bitmap);
3463
- bitmap.close();
3464
- const data = ctx.canvas.toDataURL('image/jpeg');
3465
- return data;
3466
- }
3467
- return null;
3468
- }
3469
- autoScan() {
3470
- const side = this.scanBlastData[0];
3471
- this.idScan = null;
3472
- this.singleScan(side);
3473
3558
  }
3474
3559
  selectCamera(event) {
3475
- this.cameraReady = false;
3560
+ console.log(event);
3476
3561
  this.nextWebcam.next(event.value);
3477
- this.scanInProgress = false;
3478
3562
  }
3479
3563
  close() {
3480
3564
  var _a;
@@ -3556,7 +3640,7 @@ class ScanProfileComponent {
3556
3640
  });
3557
3641
  }
3558
3642
  sendMobile() {
3559
- this.dialogs.scanMobile({ id: 1 });
3643
+ // this.dialogs.scanMobile({ id: 1 });
3560
3644
  }
3561
3645
  singleScanRotate(side) {
3562
3646
  console.log(side);
@@ -3596,21 +3680,16 @@ class ScanProfileComponent {
3596
3680
  });
3597
3681
  }
3598
3682
  getImgBase64(num) {
3599
- console.log('GET 64');
3600
3683
  return this.scanBlastData[num].image.dataUrl.split(',')[1];
3601
3684
  }
3602
3685
  scanBlastFinish() {
3603
- console.time('upload');
3604
3686
  if (this.type === 'mobile') {
3605
3687
  this.actions.emit({ data: this.scanBlastData });
3606
3688
  this.retake();
3607
3689
  return;
3608
3690
  }
3609
- this.idScan = null;
3610
- // const loading = this.dialogs.loading();
3691
+ const loading = this.dialogs.loading();
3611
3692
  this.scaning = true;
3612
- this.cd.detectChanges();
3613
- console.time('payload');
3614
3693
  const payload = {
3615
3694
  AcceptTermsAndConditions: true,
3616
3695
  DataFields: {
@@ -3633,73 +3712,39 @@ class ScanProfileComponent {
3633
3712
  if (!this.scanBlastData[1].image) {
3634
3713
  payload.Settings.IgnoreBackImage = true;
3635
3714
  }
3636
- this.logData.Request = JSON.parse(JSON.stringify(payload));
3637
- console.timeEnd('payload');
3638
- this.scanProvider
3639
- .blastPost(payload)
3640
- .subscribe((data) => {
3641
- //console.log(data);
3715
+ this.scanProvider.blastPost(payload).subscribe((data) => {
3716
+ var _a, _b, _c;
3642
3717
  const results = data.Data;
3643
- console.timeEnd('upload');
3644
- console.time('parse');
3645
- // data.InfoCode = '1001';
3646
- this.logData.Response = JSON.parse(JSON.stringify(data));
3647
- //loading.close();
3718
+ loading.close();
3648
3719
  this.documentTypeSelected = true;
3649
3720
  this.scaning = false;
3650
- if (data.InfoCode === '1001') {
3651
- this.error = true;
3652
- console.log('[ERROR] 1001');
3653
- this.errorCode = '1001';
3654
- // this.scanSide = 0;
3655
- this.preview = true;
3656
- this.cd.detectChanges();
3657
- return;
3658
- }
3659
- if (data.InfoCode === '1002') {
3660
- this.error = true;
3661
- console.log('[ERROR] 1002');
3662
- this.errorCode = '1002';
3663
- // this.scanSide = 0;
3664
- this.preview = true;
3665
- this.cd.detectChanges();
3666
- return;
3667
- }
3668
- if (results && data.Metadata.length > 0 && data.InfoCode === '1000') {
3669
- console.log('Extraction time', data.AnalysisTime);
3670
- this.zone.run(() => {
3671
- var _a, _b, _c;
3672
- if ((_a = data.ImageData) === null || _a === void 0 ? void 0 : _a.Documents) {
3673
- const { Documents } = data.ImageData;
3674
- this.images = Documents.map((image, i) => {
3675
- return { data: 'data:image/jpeg;base64,' + Documents[i] };
3676
- });
3677
- }
3678
- this.result = this.scanProvider.parseBlast(results);
3679
- console.log('RES', this.result);
3680
- this.cd.detectChanges();
3681
- this.model = this.result.model;
3682
- if ((_b = data.ImageData) === null || _b === void 0 ? void 0 : _b.FaceImage) {
3683
- this.model._avatar =
3684
- 'data:image/jpeg;base64,' + ((_c = data.ImageData) === null || _c === void 0 ? void 0 : _c.FaceImage);
3685
- }
3686
- console.log('MODEL', this.model);
3687
- this.cd.detectChanges();
3688
- });
3721
+ if (results && data.Metadata.length > 0) {
3722
+ if ((_a = data.ImageData) === null || _a === void 0 ? void 0 : _a.Documents) {
3723
+ const { Documents } = data.ImageData;
3724
+ this.images = Documents.map((image, i) => {
3725
+ return { data: 'data:image/jpeg;base64,' + Documents[i] };
3726
+ });
3727
+ }
3728
+ this.result = this.scanProvider.parseBlast(results);
3729
+ console.log('RES', this.result);
3730
+ this.model = this.result.model;
3731
+ if ((_b = data.ImageData) === null || _b === void 0 ? void 0 : _b.FaceImage) {
3732
+ this.model._avatar =
3733
+ 'data:image/jpeg;base64,' + ((_c = data.ImageData) === null || _c === void 0 ? void 0 : _c.FaceImage);
3734
+ }
3735
+ console.log('MODEL', this.model);
3689
3736
  }
3690
3737
  else {
3691
3738
  console.log('ERROR');
3692
3739
  // this.scanSide = 0;
3693
3740
  this.error = true;
3694
3741
  this.preview = true;
3695
- this.cd.detectChanges();
3696
3742
  // this.documentTypeSelected = false;
3697
3743
  // this.retry();
3698
3744
  }
3699
3745
  this.cd.detectChanges();
3700
- console.timeEnd('parse');
3701
3746
  }, (err) => {
3702
- // loading.close();
3747
+ loading.close();
3703
3748
  // this.scanSide = 0;
3704
3749
  this.error = true;
3705
3750
  this.preview = true;
@@ -3712,19 +3757,35 @@ class ScanProfileComponent {
3712
3757
  this.cd.detectChanges();
3713
3758
  }
3714
3759
  continue() {
3715
- this.documentTypeSelected = false;
3716
- setTimeout(() => {
3717
- this.selectedSide.image = this.webcamImage;
3718
- if (this.selectedSide.side === 'FRONT') {
3719
- this.scanBlastData[1].disabled = false;
3720
- }
3721
- this.cd.detectChanges();
3722
- }, 200);
3760
+ var _a, _b;
3761
+ if (this.scanProvider.enableVerification) {
3762
+ const loading = this.dialogs.loading();
3763
+ console.log(this.data.avatar);
3764
+ this.scanProvider
3765
+ .stateless(this.data.avatar.split(',')[1], (_a = this.webcamImage) === null || _a === void 0 ? void 0 : _a.imageAsDataUrl.split(',')[1])
3766
+ .subscribe((resp) => {
3767
+ var _a, _b;
3768
+ loading.close();
3769
+ if ((_a = resp.Data) === null || _a === void 0 ? void 0 : _a.Verified) {
3770
+ (_b = this.dialogRef) === null || _b === void 0 ? void 0 : _b.close(this.webcamImage);
3771
+ }
3772
+ else {
3773
+ this.dialogs.alert('Verification failed!', "We can't verify that your selfie is same as image on document.");
3774
+ }
3775
+ console.log(resp);
3776
+ }, (err) => {
3777
+ var _a;
3778
+ loading.close();
3779
+ (_a = this.dialogRef) === null || _a === void 0 ? void 0 : _a.close(this.webcamImage);
3780
+ });
3781
+ }
3782
+ else {
3783
+ (_b = this.dialogRef) === null || _b === void 0 ? void 0 : _b.close(this.webcamImage);
3784
+ }
3785
+ // this.dialogRef.close(this.webcamImage)
3723
3786
  }
3724
3787
  retry() {
3725
3788
  this.preview = false;
3726
- this.validation = false;
3727
- this.errorCode = '1000';
3728
3789
  this.result = false;
3729
3790
  if (this.error) {
3730
3791
  this.documentTypeSelected = false;
@@ -3733,80 +3794,38 @@ class ScanProfileComponent {
3733
3794
  });
3734
3795
  }
3735
3796
  this.error = false;
3736
- this.autoScan();
3737
- this.cd.detectChanges();
3738
3797
  }
3739
3798
  triggerSnapshot() {
3740
3799
  this.trigger.next(0);
3741
3800
  }
3801
+ scan() {
3802
+ console.log('SCAN');
3803
+ this.triggerSnapshot();
3804
+ this.scanDatas[0] = true;
3805
+ }
3742
3806
  retake() {
3743
- this.validation = false;
3744
3807
  this.preview = false;
3745
3808
  this.error = false;
3746
3809
  this.result = false;
3747
3810
  this.scanSide = 0;
3748
- this.imageVerified = false;
3749
3811
  this.scanDatas = [];
3750
3812
  this.scaning = false;
3751
3813
  this.images = [];
3752
- this.scanInProgress = false;
3753
3814
  this.documentTypeSelected = false;
3754
3815
  this.scanBlastData.forEach((m) => {
3755
3816
  m.image = null;
3756
3817
  });
3757
- this.autoScan();
3758
3818
  this.cd.detectChanges();
3759
3819
  }
3760
- cancel() {
3761
- this.documentTypeSelected = false;
3762
- }
3763
- use() {
3764
- var _a, _b;
3765
- // save images??
3766
- if (this.scanProvider.canStoreImages) {
3767
- this.logData.ExpectedOutput = JSON.parse(JSON.stringify(this.model));
3768
- if ((_a = this.logData.ExpectedOutput) === null || _a === void 0 ? void 0 : _a._avatar) {
3769
- delete this.logData.ExpectedOutput._avatar;
3770
- }
3771
- this.scanProvider.sendLog(this.logData).subscribe();
3772
- console.log(this.logData);
3773
- }
3774
- (_b = this.dialogRef) === null || _b === void 0 ? void 0 : _b.close({
3775
- model: this.model,
3776
- images: this.images,
3777
- });
3778
- }
3779
- selfie() {
3780
- this.dialogs
3781
- .scanSelfie({ avatar: this.model._avatar })
3782
- .afterClosed()
3783
- .subscribe((resp) => {
3784
- if (resp) {
3785
- console.log(resp);
3786
- if (this.scanProvider.enableVerification) {
3787
- this.imageVerified = true;
3788
- }
3789
- this.model._avatar = resp.imageAsDataUrl;
3790
- this.cd.detectChanges();
3791
- }
3792
- });
3793
- }
3794
- videoReady(event) {
3795
- this.cameraReady = event;
3796
- if (this.cameraReady && !this.scanInProgress) {
3797
- this.scanInProgress = true;
3798
- setTimeout(() => {
3799
- this.trigger.next(new Date().getTime());
3800
- }, 1000);
3801
- }
3802
- }
3820
+ use() { }
3821
+ selfie() { }
3803
3822
  }
3804
- ScanProfileComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanProfileComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: ScanProvider }, { token: DialogsCoreProvider }, { token: ScanFieldsProvider }, { token: i0.NgZone }, { token: i4$1.TranslateService }, { token: AuthProvider }], target: i0.ɵɵFactoryTarget.Component });
3805
- ScanProfileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScanProfileComponent, selector: "app-scan-profile", inputs: { type: "type" }, outputs: { actions: "actions" }, host: { listeners: { "window:resize": "onResize($event)" } }, viewQueries: [{ propertyName: "wraper", first: true, predicate: ["wraper"], descendants: true }], ngImport: i0, template: "<!-- <div *ngIf=\"isDebug\" class=\"debug\">\n <ng-container *ngFor=\"let img of scannedImages; let index = index\">\n <div style=\"display: flex; flex-direction: column\">\n <img [src]=\"img.imageResized\" />\n {{ index }}\n </div>\n </ng-container>\n</div> -->\n\n<header class=\"page-header\">\n <div class=\"title\" ngClass.lt-sm=\"title-small\">Scan</div>\n\n <span fxFlex></span>\n\n <!-- <mat-slide-toggle style=\"margin:0px 20px\" [(ngModel)]=\"isDebug\"\n >Debug</mat-slide-toggle\n > -->\n\n <ng-container\n *ngIf=\"\n documentTypeSelected &&\n !result &&\n !error &&\n multipleWebcamsAvailable &&\n !preview\n \"\n >\n <div class=\"separator\"></div>\n <div style=\"padding: 0px 16px\">\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <mat-form-field\n style=\"font-size: 14px; width: 200px; margin-top: 8px\"\n class=\"w-100 mr-16 mt-8\"\n >\n <mat-label> Camera </mat-label>\n <mat-select\n (selectionChange)=\"selectCamera($event)\"\n [(ngModel)]=\"deviceId\"\n >\n <mat-option\n *ngFor=\"let device of mediaDevices\"\n [value]=\"device.deviceId\"\n >\n {{ device.label }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"type === 'desktop'\">\n <!-- <div class=\"separator\"></div>\n <button mat-button (click)=\"sendMobile()\">\n <mat-icon>tablet_mac</mat-icon>\n </button> -->\n\n <div class=\"separator\"></div>\n\n <button mat-button (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button>\n </ng-container>\n</header>\n\n<div *ngIf=\"result\" fxFlex fxLayout=\"column\">\n <!-- <div *ngIf=\"result\" fxFlex fxLayout=\"column\"> -->\n <div\n fxFlex\n #wraper\n class=\"wraper\"\n fxLayout=\"row\"\n style=\"overflow: auto\"\n protelPerfectScrollbar\n class=\"pt-8 pr-8\"\n fxLayout.lt-md=\"column\"\n >\n <div fxFlex class=\"\">\n <div fxFlex>\n <mat-card style=\"margin: 4px; padding: 4px 16px\">\n <h3>Avatar</h3>\n <div\n style=\"display: flex; flex-direction: row; align-items: center\"\n class=\"selfieContainer\"\n >\n <div class=\"selfie\" style=\"width: 200px\">\n <img\n *ngIf=\"model?._avatar\"\n class=\"preview\"\n style=\"width: 120px; height: 120px; border-radius: 60px\"\n [src]=\"model._avatar\"\n />\n </div>\n <button\n [disabled]=\"imageVerified\"\n (click)=\"selfie()\"\n mat-raised-button\n >\n Take selfie\n </button>\n </div>\n </mat-card>\n\n <form\n fxLayout=\"row\"\n fxLayoutAlign=\"start center\"\n class=\"px-16 py-0 w-100-p\"\n [formGroup]=\"form\"\n >\n <formly-form\n ngClass.lt-md=\"mobile\"\n fxFlex\n [form]=\"form\"\n [fields]=\"fields\"\n [model]=\"model\"\n >\n </formly-form>\n </form>\n </div>\n </div>\n <div fxFlex class=\"pr-16 m-4\">\n <mat-card style=\"margin: 4px; padding-top: 2px\" class=\"images\">\n <h3>Images</h3>\n <ng-container *ngFor=\"let img of images\">\n <div fxLayout=\"column\">\n <ng-container *ngIf=\"img.side === 0\">\n <div class=\"title\">Front Side</div>\n </ng-container>\n <ng-container *ngIf=\"img.side === 1\">\n <div class=\"title\">Back Side</div>\n </ng-container>\n <img\n class=\"preview\"\n style=\"max-width: 460px; border-radius: 1rem\"\n [src]=\"img.data\"\n />\n </div>\n </ng-container>\n </mat-card>\n </div>\n </div>\n\n <div></div>\n\n <footer fxLayout=\"row\" class=\"p-8\">\n <div class=\"w-100-p\" fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <button fxFlex class=\"mr-8\" mat-raised-button (click)=\"retake()\">\n {{ \"pms.dialogs.components.scanProfile.reTake\" | translate }}\n </button>\n <button\n [disabled]=\"error || form.invalid\"\n fxFlex\n class=\"ml-8\"\n mat-raised-button\n (click)=\"use()\"\n >\n {{ \"pms.dialogs.components.scanProfile.useData\" | translate }}\n </button>\n </div>\n </footer>\n</div>\n\n<div\n style=\"position: relative\"\n *ngIf=\"!result && documentTypeSelected\"\n fxFlex\n fxLayout=\"column\"\n>\n <div fxFlex #wraper class=\"wraper\" fxLayout=\"row\">\n <div\n style=\"\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n z-index: 20;\n background-color: whitesmoke;\n \"\n *ngIf=\"!cameraReady && !preview\"\n >\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n </div>\n\n <div *ngIf=\"!preview\" style=\"position: absolute; left: 0px\">\n DELAY:{{ scanDelay }}\n </div>\n\n <div\n *ngIf=\"scaning\"\n style=\"\n position: absolute;\n z-index: 200;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n \"\n fxlayout=\"row\"\n fxLayoutAlign=\"center center\"\n >\n <!-- <mat-progress-spinner\n mode=\"indeterminate\"\n color=\"accent\"\n [strokeWidth]=\"10\"\n ></mat-progress-spinner> -->\n </div>\n\n <ng-container *ngIf=\"!error\">\n <!-- <div\n class=\"rectangle\"\n [ngStyle]=\"{\n 'width.px': videoHeight * 0.75 * 1.588,\n 'height.px': videoHeight * 0.75\n }\"\n ></div>\n <svg\n *ngIf=\"videoWidth\"\n style=\"position: absolute; left: 0px; top: 0px\"\n width=\"0\"\n height=\"0\"\n >\n <defs>\n <clipPath id=\"myClip\">\n <rect\n stroke-width=\"6\"\n stroke-color=\"red\"\n [attr.x]=\"(videoWidth - videoHeight * 0.75 * 1.588) / 2\"\n [attr.y]=\"(videoHeight * 0.25) / 2\"\n [attr.width]=\"videoHeight * 0.75 * 1.588\"\n [attr.height]=\"videoHeight * 0.75\"\n rx=\"25\"\n />\n </clipPath>\n </defs>\n </svg> -->\n\n <app-webcam\n *ngIf=\"!preview && !scaning\"\n class=\"main\"\n [imageQuality]=\"1\"\n #webcam\n fxFlex\n type=\"document\"\n [trigger]=\"trigger\"\n [imageHandler]=\"imageHandler\"\n (imageCapture)=\"handleImage($event)\"\n [allowCameraSwitch]=\"allowCameraSwitch\"\n [videoOptions]=\"videoOptions\"\n [switchCamera]=\"nextWebcamObservable\"\n (cameraSwitched)=\"cameraWasSwitched($event)\"\n (initError)=\"handleInitError($event)\"\n [width]=\"width\"\n [height]=\"height\"\n (destroyed)=\"cameraOff($event)\"\n (videoReady)=\"videoReady($event)\"\n >\n </app-webcam>\n </ng-container>\n <div\n fxLayout=\"row\"\n fxFlex\n class=\"previewData\"\n *ngIf=\"preview\"\n style=\"z-index: 20; position: absolute; width: 100%; height: 100%\"\n >\n <div class=\"p-16 error\" *ngIf=\"error\">\n <div style=\"max-width: \">\n <div class=\"title\" fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <mat-icon>error_outline</mat-icon\n ><span class=\"ml-8\">{{\n \"pms.dialogs.components.scanProfile.unableToDetectId\" | translate\n }}</span>\n </div>\n\n <ng-container *ngIf=\"errorCode === '1001'\">\n <div>\n Could not classify the given object as a supported document.\n </div>\n </ng-container>\n <ng-container *ngIf=\"errorCode === '1002'\">\n <div>\n Something is wrong with extraction data. Please try again.\n </div>\n </ng-container>\n\n <ul *ngIf=\"errorCode === '1000'\">\n <li>\n {{\n \"pms.dialogs.components.scanProfile.placeIdCloseToDevice\"\n | translate\n }}\n </li>\n <li>\n {{\n \"pms.dialogs.components.scanProfile.ensureSufficientLight\"\n | translate\n }}\n </li>\n <li>\n {{\n \"pms.dialogs.components.scanProfile.holdDocumentSteady\"\n | translate\n }}\n </li>\n <li>\n {{\n \"pms.dialogs.components.scanProfile.makeSureAllEdgesOfTheIdAreVisible\"\n | translate\n }}\n </li>\n <li>\n {{\n \"pms.dialogs.components.scanProfile.makeSureThereAreNoGlareAndShadowsOnTheId\"\n | translate\n }}\n </li>\n </ul>\n </div>\n </div>\n\n <div\n class=\"scanPreview\"\n fxFlex\n fxLayout=\"column\"\n *ngIf=\"!error && !scaning\"\n >\n <!-- <div class=\"py-16\" style=\"font-size: 16px\">\n {{\n \"pms.dialogs.components.scanProfile.ensureAllTextsAreVisible\"\n | translate\n }}\n </div> -->\n <div\n fxFlex\n class=\"image\"\n [style.background-image]=\"'url(' + preview + ')'\"\n ></div>\n </div>\n </div>\n </div>\n\n <footer fxLayout=\"row\" style=\"height: 80px\" class=\"p-8\">\n <div class=\"displayInfo\" ngClass.lt-sm=\"mobile\" *ngIf=\"!preview && cameraReady\">\n {{ displayInfo }}\n </div>\n <div style=\"height: 26px\">\n <div\n style=\"text-align: center; font-size: 18px\"\n *ngIf=\"idScan && !preview && cameraReady\"\n >\n <ng-container *ngIf=\"idScan === 'BACK'\">\n Turn document and:\n {{ \"pms.dialogs.components.scanProfile.captureBack\" | translate }}\n </ng-container>\n <ng-container *ngIf=\"idScan === 'FRONT'\">\n Turn document and:\n {{ \"pms.dialogs.components.scanProfile.captureFront\" | translate }}\n </ng-container>\n </div>\n </div>\n\n <!-- <button\n [disabled]=\"!cameraReady\"\n class=\"w-100-p\"\n *ngIf=\"!preview\"\n mat-raised-button\n (click)=\"scan()\"\n >\n <ng-container>\n <ng-container *ngIf=\"scanType === 'FRONT'\">{{\n \"pms.dialogs.components.scanProfile.captureFront\" | translate\n }}</ng-container>\n <ng-container *ngIf=\"scanType === 'BACK'\">{{\n \"pms.dialogs.components.scanProfile.captureBack\" | translate\n }}</ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"scanSide === 1\">{{\n \"pms.dialogs.components.scanProfile.captureBackOfId\" | translate\n }}</ng-container>\n </button> -->\n\n <div\n class=\"w-100-p\"\n *ngIf=\"preview\"\n fxLayout=\"row\"\n fxLayoutAlign=\"start center\"\n fxFlex\n >\n <button fxFlex class=\"mr-4\" mat-raised-button (click)=\"retry()\">\n {{ \"pms.dialogs.components.scanProfile.retry\" | translate }}\n </button>\n\n <button\n [disabled]=\"error\"\n fxFlex\n class=\"ml-4\"\n mat-raised-button\n (click)=\"continue()\"\n >\n {{\n \"pms.dialogs.components.scanProfile.continueWithSelectedImage\"\n | translate\n }}\n </button>\n </div>\n </footer>\n</div>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1;background-color:#f5f5f5}.page-header{display:flex;flex-direction:row;align-items:center}.page-header button{height:100%}.debug{position:absolute;left:0;width:100%;height:80px;top:0;border-bottom:1px solid #ccc;background-color:#f8f8f8;display:flex;overflow:hidden;color:#000}.debug img{height:50px;border:1px solid #000}.displayInfo{text-align:center;height:20px;flex:1;position:absolute;width:100%;background-color:#000;height:30px;bottom:55px;left:0;line-height:30px;color:#fff;z-index:200}.displayInfo.mobile{font-size:12px}.element{margin-bottom:8px}.element label{font-size:14px}.element div{font-size:18px}.wraper{position:relative;overflow:hidden}.preview{width:100%;border-radius:1%}.documentTypeWraper{width:400px}.documentTypeWraper .label{font-size:14px;margin-bottom:20px}.documentTypeWraper button{box-shadow:none}.overPane{position:absolute;width:100%;height:100%;top:0;left:0}.overPane app-webcam{clip-path:url(#myClip)}.subhead{height:55px;padding-top:8px}.rectangle{z-index:2;position:absolute;top:50%;left:50%;width:85.6mm;height:53.98mm;transform:translate(-50%,-50%);box-sizing:border-box;border:2px dashed #459be5;border-radius:3mm}.mask{z-index:1;position:absolute;width:100%;height:100%;background-position:center center;background-size:380mm;background-repeat:no-repeat}.label{font-size:11px;margin-top:4px}footer button{box-shadow:none!important;height:45px;min-height:45px;text-transform:uppercase}h4{font-size:16px}.images .title{padding:8px 0;font-weight:600}.images img{margin-bottom:16px}.error{display:flex;align-items:center;justify-content:center;flex:1}.error .title{font-size:20px;margin-bottom:8px}.error .title mat-icon{margin-right:8px}.error ul{font-size:18px;list-style-type:none}.photo{width:120px;height:120px;overflow:hidden}.signature{width:200px}mat-card{box-shadow:none!important}.scanBlastWraper button{text-transform:uppercase}.scanBlastWraper.mobile mat-card{margin:4px!important}.scanBlastWraper.mobile .description{flex-direction:row!important}.scanBlastWraper.mobile .description .imgWrap{padding:0!important}.scanBlastWraper.mobile .description .btnActions{position:absolute;right:0}.scanBlastWraper.mobile .description button{margin:0!important;position:absolute;right:16px}.scanBlastWraper.mobile .description button.rotateButton{top:58px}.scanBlastWraper.mobile .description button.remButton{top:8px}.scanBlastWraper.mobile .description button mat-icon{margin:0!important}.scanBlastWraper.mobile .description button div.label{display:none}.scanBlast{display:flex;flex-direction:row;flex:1;padding:0 4px}.scanBlast mat-card{padding:0;box-shadow:none;margin:8px 4px;flex:1}.scanBlast mat-card .head{display:flex;flex-direction:row;align-items:center;justify-items:center;border-bottom:1px solid rgba(0,0,0,.12);height:60px;padding:8px}.scanBlast mat-card .head.small{height:30px!important;padding:4px 8px!important}.scanBlast mat-card .head.small .title{font-size:12px!important;margin-left:4px!important}.scanBlast mat-card .head button{max-width:120px;height:40px;box-shadow:none;border:1px solid rgba(0,0,0,.12)}.scanBlast mat-card .head .title{margin-left:16px;color:#459ae5;font-size:16px}.scanBlast mat-card .content{margin:8px;flex:1}.scanBlast mat-card .description{text-align:center;color:#888}.scanBlast mat-card .actions{background-color:#e9e9e9;display:flex;flex-direction:row}.scanBlast mat-card .actions .mat-button-disabled{background-color:#fff!important}.scanBlast mat-card .actions button{box-shadow:none;width:50%;margin:8px;height:40px;font-size:12px}.scanBlast mat-card .actions button mat-icon{margin-right:8px}.scanBlast mat-card .previewPlaceholder{flex:1;border-radius:6px;display:flex;flex-direction:column}.scanBlast mat-card .previewPlaceholder .description{display:flex;flex:1;flex-direction:column;justify-content:center}.scanBlast mat-card .previewPlaceholder button{box-shadow:none;margin-top:8px;height:40px;font-size:12px}.scanBlast mat-card .previewPlaceholder button mat-icon{margin-right:8px}.scanBlast mat-card .previewPlaceholder .imgWrap{flex-direction:column;flex:1;padding:8px;background-color:#f5f5f5;border-radius:4px}.scanBlast mat-card .previewPlaceholder .imgWrap img{width:100%;border-radius:4px}.scanBlast mat-card .previewPlaceholder .imgWrap .image{background-position:center;background-repeat:no-repeat;background-size:contain}.mr-4{margin-right:4px}.ml-4{margin-left:4px}.p-16{padding:16px}.p-8{padding:8px}.py-16{padding:16px 0}.w-100-p{width:100%}.scanPreview{padding:16px}.scanPreview .image{background-position:center;background-repeat:no-repeat;background-size:contain}.empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center}\n", ".page-header{z-index:2000;height:64px;padding:0;background-color:#fff;border-bottom:1px solid rgba(0,0,0,.12)}.page-header .title{padding-left:24px;line-height:64px;font-size:18px}.page-header .separator{width:1px;background-color:#0000001f;height:100%}.page-header .total{line-height:64px}.page-header .total span{font-weight:700}.page-footer{height:64px}.page-footer button{margin-left:24px;box-shadow:none!important}\n"], dependencies: [{ kind: "directive", type: i6.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i6.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i8$1.FormlyForm, selector: "formly-form", inputs: ["form", "model", "fields", "options"], outputs: ["modelChange"] }, { kind: "component", type: i6$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6$1.MatLabel, selector: "mat-label" }, { kind: "component", type: i7.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i8.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i12.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { kind: "component", type: i9.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i1$4.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: WebcamComponent, selector: "app-webcam", inputs: ["imageHandler", "id", "type", "width", "height", "videoOptions", "allowCameraSwitch", "mirrorImage", "captureImageData", "imageType", "imageQuality", "trigger", "switchCamera"], outputs: ["imageCapture", "initError", "imageClick", "cameraSwitched", "videoReady", "destroyed"] }, { kind: "directive", type: i4.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i4.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i4.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i5$1.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3806
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanProfileComponent, decorators: [{
3823
+ ScanSelfieComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanSelfieComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: ScanProvider }, { token: DialogsCoreProvider }, { token: i1$2.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
3824
+ ScanSelfieComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScanSelfieComponent, selector: "app-scan-selfie", inputs: { type: "type" }, outputs: { actions: "actions" }, host: { listeners: { "window:resize": "onResize($event)" } }, viewQueries: [{ propertyName: "wraper", first: true, predicate: ["wraper"], descendants: true }], ngImport: i0, template: "<header class=\"page-header\" fxLayout=\"row\">\n <div class=\"title\" ngClass.lt-sm=\"title-small\">Selfie</div>\n\n <span fxFlex></span>\n <ng-container\n *ngIf=\"\n documentTypeSelected &&\n !result &&\n !error &&\n multipleWebcamsAvailable &&\n !preview\n \"\n >\n <div class=\"separator\"></div>\n <div style=\"padding: 0px 16px\">\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <mat-form-field\n style=\"font-size: 14px; width: 200px; margin-top: 8px\"\n class=\"w-200 mr-16 mt-8\"\n >\n <mat-label> Camera </mat-label>\n <mat-select\n (selectionChange)=\"selectCamera($event)\"\n [(ngModel)]=\"deviceId\"\n >\n <mat-option\n *ngFor=\"let device of mediaDevices\"\n [value]=\"device.deviceId\"\n >\n {{ device.label }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n </div>\n </ng-container>\n\n <ng-container>\n <div class=\"separator\"></div>\n\n <button mat-button (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button>\n </ng-container>\n <!-- <ng-container *ngIf=\"type === 'desktop'\">\n <div class=\"separator\"></div>\n <button mat-button (click)=\"sendMobile()\">\n <mat-icon>tablet_mac</mat-icon>\n </button>\n\n <div class=\"separator\"></div>\n\n <button mat-button (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button>\n </ng-container> -->\n</header>\n\n<div *ngIf=\"!result\" fxFlex fxLayout=\"column\">\n <div fxFlex #wraper class=\"wraper\" fxLayout=\"row\">\n <div\n style=\"\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n z-index: 20;\n background-color: whitesmoke;\n \"\n *ngIf=\"!cameraReady && !preview\"\n >\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n </div>\n\n <ng-container *ngIf=\"!error\">\n <!-- <div\n class=\"rectangle\"\n [ngStyle]=\"{\n 'width.px': videoHeight * 0.75 * 1.588,\n 'height.px': videoHeight * 0.75\n }\"\n ></div>\n <svg\n *ngIf=\"videoWidth\"\n style=\"position: absolute; left: 0px; top: 0px\"\n width=\"0\"\n height=\"0\"\n >\n <defs>\n <clipPath id=\"myClip\">\n <rect\n stroke-width=\"6\"\n stroke-color=\"red\"\n [attr.x]=\"(videoWidth - videoHeight * 0.75 * 1.588) / 2\"\n [attr.y]=\"(videoHeight * 0.25) / 2\"\n [attr.width]=\"videoHeight * 0.75 * 1.588\"\n [attr.height]=\"videoHeight * 0.75\"\n rx=\"25\"\n />\n </clipPath>\n </defs>\n </svg> -->\n\n <app-webcam\n *ngIf=\"!preview && !scaning\"\n class=\"main\"\n [imageQuality]=\"1\"\n #webcam\n fxFlex\n [trigger]=\"trigger\"\n (imageCapture)=\"handleImage($event)\"\n [allowCameraSwitch]=\"allowCameraSwitch\"\n [videoOptions]=\"videoOptions\"\n [switchCamera]=\"nextWebcamObservable\"\n (cameraSwitched)=\"cameraWasSwitched($event)\"\n (initError)=\"handleInitError($event)\"\n type=\"selfie\"\n [width]=\"width\"\n [height]=\"height\"\n (destroyed)=\"cameraOff($event)\"\n >\n </app-webcam>\n </ng-container>\n <div\n fxLayout=\"row\"\n fxFlex\n class=\"previewData\"\n *ngIf=\"preview\"\n style=\"z-index: 20; position: absolute; width: 100%; height: 100%\"\n >\n <div\n class=\"scanPreview\"\n fxFlex\n fxLayout=\"column\"\n *ngIf=\"!error && !scaning\"\n >\n <div\n fxFlex\n class=\"image\"\n [style.background-image]=\"'url(' + preview + ')'\"\n ></div>\n </div>\n </div>\n </div>\n\n <footer fxLayout=\"row\" class=\"p-8\">\n <button\n [disabled]=\"!cameraReady\"\n class=\"w-100-p\"\n *ngIf=\"!preview\"\n mat-raised-button\n (click)=\"scan()\"\n >\n <ng-container>\n TAKE SELFIE\n </ng-container>\n </button>\n\n <div\n class=\"w-100-p\"\n *ngIf=\"preview\"\n fxLayout=\"row\"\n fxLayoutAlign=\"start center\"\n fxFlex\n >\n <button fxFlex class=\"mr-4\" mat-raised-button (click)=\"retry()\">\n RETRY\n </button>\n\n <button\n [disabled]=\"error\"\n fxFlex\n class=\"ml-4\"\n mat-raised-button\n (click)=\"continue()\"\n >\n CONTINUE\n\n </button>\n </div>\n </footer>\n</div>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1;background-color:#f5f5f5}.element{margin-bottom:8px}.element label{font-size:14px}.element div{font-size:18px}.wraper{position:relative;overflow:hidden}h3{color:#459ae5;font-size:16px}.preview{width:100%;border-radius:1%}.documentTypeWraper{width:400px}.documentTypeWraper .label{font-size:14px;margin-bottom:20px}.documentTypeWraper button{box-shadow:none}.overPane{position:absolute;width:100%;height:100%;top:0;left:0}.overPane app-webcam{clip-path:url(#myClip)}.subhead{height:55px;padding-top:8px}.rectangle{z-index:2;position:absolute;top:50%;left:50%;width:85.6mm;height:53.98mm;transform:translate(-50%,-50%);box-sizing:border-box;border:2px dashed #459be5;border-radius:3mm}.mask{z-index:1;position:absolute;width:100%;height:100%;background-position:center center;background-size:380mm;background-repeat:no-repeat}.label{font-size:11px;margin-top:4px}footer button{box-shadow:none!important;height:45px;min-height:45px;border:1px solid rgba(0,0,0,.12);text-transform:uppercase}h4{font-size:16px}.images label{font-size:11px;color:#888;line-height:20px}.images .title{padding:8px 0;font-weight:600}.images img{margin-bottom:16px}.error .title{font-size:22px}.error ul{font-size:18px}.photo{width:120px;height:120px;overflow:hidden}.signature{width:200px}mat-card{box-shadow:none!important}.scanBlastWraper button{text-transform:uppercase}.scanBlastWraper.mobile mat-card{margin:4px!important}.scanBlastWraper.mobile .description{font-size:12px;flex-direction:row!important}.scanBlastWraper.mobile .description .imgWrap{padding:0!important}.scanBlastWraper.mobile .description .btnActions{position:absolute;right:0}.scanBlastWraper.mobile .description button{font-size:11px!important;margin:0!important;position:absolute;right:16px}.scanBlastWraper.mobile .description button.rotateButton{top:58px}.scanBlastWraper.mobile .description button.remButton{top:8px}.scanBlastWraper.mobile .description button mat-icon{margin:0!important}.scanBlastWraper.mobile .description button div.label{display:none}.mobile .scanBlast button{font-size:11px!important}.scanBlast{display:flex;flex-direction:row;flex:1;padding:0 4px}.scanBlast mat-card{padding:0;box-shadow:none;margin:8px 4px;flex:1}.scanBlast mat-card .head{display:flex;flex-direction:row;align-items:center;justify-items:center;border-bottom:1px solid rgba(0,0,0,.12);height:60px;padding:8px}.scanBlast mat-card .head.small{height:30px!important;padding:4px 8px!important}.scanBlast mat-card .head.small .title{font-size:12px!important;margin-left:4px!important}.scanBlast mat-card .head button{max-width:120px;height:40px;box-shadow:none;border:1px solid rgba(0,0,0,.12)}.scanBlast mat-card .head .title{margin-left:16px;color:#459ae5;font-size:16px}.scanBlast mat-card .content{margin:8px;flex:1}.scanBlast mat-card .description{text-align:center;color:#888;font-size:14px}.scanBlast mat-card .actions{background-color:#e9e9e9;display:flex;flex-direction:row}.scanBlast mat-card .actions .mat-button-disabled{background-color:#fff!important}.scanBlast mat-card .actions button{box-shadow:none;width:50%;margin:8px;height:40px;font-size:12px}.scanBlast mat-card .actions button mat-icon{margin-right:8px}.scanBlast mat-card .previewPlaceholder{flex:1;border-radius:6px;display:flex;flex-direction:column}.scanBlast mat-card .previewPlaceholder .description{display:flex;flex:1;flex-direction:column;justify-content:center}.scanBlast mat-card .previewPlaceholder button{box-shadow:none;margin-top:8px;height:40px;font-size:12px}.scanBlast mat-card .previewPlaceholder button mat-icon{margin-right:8px}.scanBlast mat-card .previewPlaceholder .imgWrap{flex-direction:column;flex:1;padding:8px;background-color:#f5f5f5;border-radius:4px}.scanBlast mat-card .previewPlaceholder .imgWrap img{width:100%;border-radius:4px}.scanBlast mat-card .previewPlaceholder .imgWrap .image{background-position:center;background-repeat:no-repeat;background-size:contain}.mr-4{margin-right:4px}.ml-4{margin-left:4px}.p-16{padding:16px}.p-8{padding:8px}.py-16{padding:16px 0}.w-100-p{width:100%}.scanPreview{padding:16px}.scanPreview .image{background-position:center;background-repeat:no-repeat;background-size:contain}.empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center}.summary label{font-size:12px;color:#888;margin-top:2px}.summary .name{font-size:14px}.selfieContainer{display:flex;flex-direction:column;margin-bottom:20px}.selfieContainer button{box-shadow:none;border:1px solid rgba(0,0,0,.12)}.selfieContainer .selfie{margin:8px auto;width:120px;height:120px;border-radius:60px;border:1px solid rgba(0,0,0,.12)}\n", ".page-header{z-index:2000;height:64px;padding:0;background-color:#fff;border-bottom:1px solid rgba(0,0,0,.12)}.page-header .title{padding-left:24px;line-height:64px;font-size:18px}.page-header .separator{width:1px;background-color:#0000001f;height:100%}.page-header .total{line-height:64px}.page-header .total span{font-weight:700}.page-footer{height:64px}.page-footer button{margin-left:24px;box-shadow:none!important}\n"], dependencies: [{ kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$1.MatLabel, selector: "mat-label" }, { kind: "component", type: i5$2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i6$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i6.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i9.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: WebcamComponent, selector: "app-webcam", inputs: ["imageHandler", "id", "type", "width", "height", "videoOptions", "allowCameraSwitch", "mirrorImage", "captureImageData", "imageType", "imageQuality", "trigger", "switchCamera"], outputs: ["imageCapture", "initError", "imageClick", "cameraSwitched", "videoReady", "destroyed"] }, { kind: "directive", type: i4$2.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i4$2.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i4$2.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i5$3.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3825
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanSelfieComponent, decorators: [{
3807
3826
  type: Component,
3808
- args: [{ selector: 'app-scan-profile', changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- <div *ngIf=\"isDebug\" class=\"debug\">\n <ng-container *ngFor=\"let img of scannedImages; let index = index\">\n <div style=\"display: flex; flex-direction: column\">\n <img [src]=\"img.imageResized\" />\n {{ index }}\n </div>\n </ng-container>\n</div> -->\n\n<header class=\"page-header\">\n <div class=\"title\" ngClass.lt-sm=\"title-small\">Scan</div>\n\n <span fxFlex></span>\n\n <!-- <mat-slide-toggle style=\"margin:0px 20px\" [(ngModel)]=\"isDebug\"\n >Debug</mat-slide-toggle\n > -->\n\n <ng-container\n *ngIf=\"\n documentTypeSelected &&\n !result &&\n !error &&\n multipleWebcamsAvailable &&\n !preview\n \"\n >\n <div class=\"separator\"></div>\n <div style=\"padding: 0px 16px\">\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <mat-form-field\n style=\"font-size: 14px; width: 200px; margin-top: 8px\"\n class=\"w-100 mr-16 mt-8\"\n >\n <mat-label> Camera </mat-label>\n <mat-select\n (selectionChange)=\"selectCamera($event)\"\n [(ngModel)]=\"deviceId\"\n >\n <mat-option\n *ngFor=\"let device of mediaDevices\"\n [value]=\"device.deviceId\"\n >\n {{ device.label }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"type === 'desktop'\">\n <!-- <div class=\"separator\"></div>\n <button mat-button (click)=\"sendMobile()\">\n <mat-icon>tablet_mac</mat-icon>\n </button> -->\n\n <div class=\"separator\"></div>\n\n <button mat-button (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button>\n </ng-container>\n</header>\n\n<div *ngIf=\"result\" fxFlex fxLayout=\"column\">\n <!-- <div *ngIf=\"result\" fxFlex fxLayout=\"column\"> -->\n <div\n fxFlex\n #wraper\n class=\"wraper\"\n fxLayout=\"row\"\n style=\"overflow: auto\"\n protelPerfectScrollbar\n class=\"pt-8 pr-8\"\n fxLayout.lt-md=\"column\"\n >\n <div fxFlex class=\"\">\n <div fxFlex>\n <mat-card style=\"margin: 4px; padding: 4px 16px\">\n <h3>Avatar</h3>\n <div\n style=\"display: flex; flex-direction: row; align-items: center\"\n class=\"selfieContainer\"\n >\n <div class=\"selfie\" style=\"width: 200px\">\n <img\n *ngIf=\"model?._avatar\"\n class=\"preview\"\n style=\"width: 120px; height: 120px; border-radius: 60px\"\n [src]=\"model._avatar\"\n />\n </div>\n <button\n [disabled]=\"imageVerified\"\n (click)=\"selfie()\"\n mat-raised-button\n >\n Take selfie\n </button>\n </div>\n </mat-card>\n\n <form\n fxLayout=\"row\"\n fxLayoutAlign=\"start center\"\n class=\"px-16 py-0 w-100-p\"\n [formGroup]=\"form\"\n >\n <formly-form\n ngClass.lt-md=\"mobile\"\n fxFlex\n [form]=\"form\"\n [fields]=\"fields\"\n [model]=\"model\"\n >\n </formly-form>\n </form>\n </div>\n </div>\n <div fxFlex class=\"pr-16 m-4\">\n <mat-card style=\"margin: 4px; padding-top: 2px\" class=\"images\">\n <h3>Images</h3>\n <ng-container *ngFor=\"let img of images\">\n <div fxLayout=\"column\">\n <ng-container *ngIf=\"img.side === 0\">\n <div class=\"title\">Front Side</div>\n </ng-container>\n <ng-container *ngIf=\"img.side === 1\">\n <div class=\"title\">Back Side</div>\n </ng-container>\n <img\n class=\"preview\"\n style=\"max-width: 460px; border-radius: 1rem\"\n [src]=\"img.data\"\n />\n </div>\n </ng-container>\n </mat-card>\n </div>\n </div>\n\n <div></div>\n\n <footer fxLayout=\"row\" class=\"p-8\">\n <div class=\"w-100-p\" fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <button fxFlex class=\"mr-8\" mat-raised-button (click)=\"retake()\">\n {{ \"pms.dialogs.components.scanProfile.reTake\" | translate }}\n </button>\n <button\n [disabled]=\"error || form.invalid\"\n fxFlex\n class=\"ml-8\"\n mat-raised-button\n (click)=\"use()\"\n >\n {{ \"pms.dialogs.components.scanProfile.useData\" | translate }}\n </button>\n </div>\n </footer>\n</div>\n\n<div\n style=\"position: relative\"\n *ngIf=\"!result && documentTypeSelected\"\n fxFlex\n fxLayout=\"column\"\n>\n <div fxFlex #wraper class=\"wraper\" fxLayout=\"row\">\n <div\n style=\"\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n z-index: 20;\n background-color: whitesmoke;\n \"\n *ngIf=\"!cameraReady && !preview\"\n >\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n </div>\n\n <div *ngIf=\"!preview\" style=\"position: absolute; left: 0px\">\n DELAY:{{ scanDelay }}\n </div>\n\n <div\n *ngIf=\"scaning\"\n style=\"\n position: absolute;\n z-index: 200;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n \"\n fxlayout=\"row\"\n fxLayoutAlign=\"center center\"\n >\n <!-- <mat-progress-spinner\n mode=\"indeterminate\"\n color=\"accent\"\n [strokeWidth]=\"10\"\n ></mat-progress-spinner> -->\n </div>\n\n <ng-container *ngIf=\"!error\">\n <!-- <div\n class=\"rectangle\"\n [ngStyle]=\"{\n 'width.px': videoHeight * 0.75 * 1.588,\n 'height.px': videoHeight * 0.75\n }\"\n ></div>\n <svg\n *ngIf=\"videoWidth\"\n style=\"position: absolute; left: 0px; top: 0px\"\n width=\"0\"\n height=\"0\"\n >\n <defs>\n <clipPath id=\"myClip\">\n <rect\n stroke-width=\"6\"\n stroke-color=\"red\"\n [attr.x]=\"(videoWidth - videoHeight * 0.75 * 1.588) / 2\"\n [attr.y]=\"(videoHeight * 0.25) / 2\"\n [attr.width]=\"videoHeight * 0.75 * 1.588\"\n [attr.height]=\"videoHeight * 0.75\"\n rx=\"25\"\n />\n </clipPath>\n </defs>\n </svg> -->\n\n <app-webcam\n *ngIf=\"!preview && !scaning\"\n class=\"main\"\n [imageQuality]=\"1\"\n #webcam\n fxFlex\n type=\"document\"\n [trigger]=\"trigger\"\n [imageHandler]=\"imageHandler\"\n (imageCapture)=\"handleImage($event)\"\n [allowCameraSwitch]=\"allowCameraSwitch\"\n [videoOptions]=\"videoOptions\"\n [switchCamera]=\"nextWebcamObservable\"\n (cameraSwitched)=\"cameraWasSwitched($event)\"\n (initError)=\"handleInitError($event)\"\n [width]=\"width\"\n [height]=\"height\"\n (destroyed)=\"cameraOff($event)\"\n (videoReady)=\"videoReady($event)\"\n >\n </app-webcam>\n </ng-container>\n <div\n fxLayout=\"row\"\n fxFlex\n class=\"previewData\"\n *ngIf=\"preview\"\n style=\"z-index: 20; position: absolute; width: 100%; height: 100%\"\n >\n <div class=\"p-16 error\" *ngIf=\"error\">\n <div style=\"max-width: \">\n <div class=\"title\" fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <mat-icon>error_outline</mat-icon\n ><span class=\"ml-8\">{{\n \"pms.dialogs.components.scanProfile.unableToDetectId\" | translate\n }}</span>\n </div>\n\n <ng-container *ngIf=\"errorCode === '1001'\">\n <div>\n Could not classify the given object as a supported document.\n </div>\n </ng-container>\n <ng-container *ngIf=\"errorCode === '1002'\">\n <div>\n Something is wrong with extraction data. Please try again.\n </div>\n </ng-container>\n\n <ul *ngIf=\"errorCode === '1000'\">\n <li>\n {{\n \"pms.dialogs.components.scanProfile.placeIdCloseToDevice\"\n | translate\n }}\n </li>\n <li>\n {{\n \"pms.dialogs.components.scanProfile.ensureSufficientLight\"\n | translate\n }}\n </li>\n <li>\n {{\n \"pms.dialogs.components.scanProfile.holdDocumentSteady\"\n | translate\n }}\n </li>\n <li>\n {{\n \"pms.dialogs.components.scanProfile.makeSureAllEdgesOfTheIdAreVisible\"\n | translate\n }}\n </li>\n <li>\n {{\n \"pms.dialogs.components.scanProfile.makeSureThereAreNoGlareAndShadowsOnTheId\"\n | translate\n }}\n </li>\n </ul>\n </div>\n </div>\n\n <div\n class=\"scanPreview\"\n fxFlex\n fxLayout=\"column\"\n *ngIf=\"!error && !scaning\"\n >\n <!-- <div class=\"py-16\" style=\"font-size: 16px\">\n {{\n \"pms.dialogs.components.scanProfile.ensureAllTextsAreVisible\"\n | translate\n }}\n </div> -->\n <div\n fxFlex\n class=\"image\"\n [style.background-image]=\"'url(' + preview + ')'\"\n ></div>\n </div>\n </div>\n </div>\n\n <footer fxLayout=\"row\" style=\"height: 80px\" class=\"p-8\">\n <div class=\"displayInfo\" ngClass.lt-sm=\"mobile\" *ngIf=\"!preview && cameraReady\">\n {{ displayInfo }}\n </div>\n <div style=\"height: 26px\">\n <div\n style=\"text-align: center; font-size: 18px\"\n *ngIf=\"idScan && !preview && cameraReady\"\n >\n <ng-container *ngIf=\"idScan === 'BACK'\">\n Turn document and:\n {{ \"pms.dialogs.components.scanProfile.captureBack\" | translate }}\n </ng-container>\n <ng-container *ngIf=\"idScan === 'FRONT'\">\n Turn document and:\n {{ \"pms.dialogs.components.scanProfile.captureFront\" | translate }}\n </ng-container>\n </div>\n </div>\n\n <!-- <button\n [disabled]=\"!cameraReady\"\n class=\"w-100-p\"\n *ngIf=\"!preview\"\n mat-raised-button\n (click)=\"scan()\"\n >\n <ng-container>\n <ng-container *ngIf=\"scanType === 'FRONT'\">{{\n \"pms.dialogs.components.scanProfile.captureFront\" | translate\n }}</ng-container>\n <ng-container *ngIf=\"scanType === 'BACK'\">{{\n \"pms.dialogs.components.scanProfile.captureBack\" | translate\n }}</ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"scanSide === 1\">{{\n \"pms.dialogs.components.scanProfile.captureBackOfId\" | translate\n }}</ng-container>\n </button> -->\n\n <div\n class=\"w-100-p\"\n *ngIf=\"preview\"\n fxLayout=\"row\"\n fxLayoutAlign=\"start center\"\n fxFlex\n >\n <button fxFlex class=\"mr-4\" mat-raised-button (click)=\"retry()\">\n {{ \"pms.dialogs.components.scanProfile.retry\" | translate }}\n </button>\n\n <button\n [disabled]=\"error\"\n fxFlex\n class=\"ml-4\"\n mat-raised-button\n (click)=\"continue()\"\n >\n {{\n \"pms.dialogs.components.scanProfile.continueWithSelectedImage\"\n | translate\n }}\n </button>\n </div>\n </footer>\n</div>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1;background-color:#f5f5f5}.page-header{display:flex;flex-direction:row;align-items:center}.page-header button{height:100%}.debug{position:absolute;left:0;width:100%;height:80px;top:0;border-bottom:1px solid #ccc;background-color:#f8f8f8;display:flex;overflow:hidden;color:#000}.debug img{height:50px;border:1px solid #000}.displayInfo{text-align:center;height:20px;flex:1;position:absolute;width:100%;background-color:#000;height:30px;bottom:55px;left:0;line-height:30px;color:#fff;z-index:200}.displayInfo.mobile{font-size:12px}.element{margin-bottom:8px}.element label{font-size:14px}.element div{font-size:18px}.wraper{position:relative;overflow:hidden}.preview{width:100%;border-radius:1%}.documentTypeWraper{width:400px}.documentTypeWraper .label{font-size:14px;margin-bottom:20px}.documentTypeWraper button{box-shadow:none}.overPane{position:absolute;width:100%;height:100%;top:0;left:0}.overPane app-webcam{clip-path:url(#myClip)}.subhead{height:55px;padding-top:8px}.rectangle{z-index:2;position:absolute;top:50%;left:50%;width:85.6mm;height:53.98mm;transform:translate(-50%,-50%);box-sizing:border-box;border:2px dashed #459be5;border-radius:3mm}.mask{z-index:1;position:absolute;width:100%;height:100%;background-position:center center;background-size:380mm;background-repeat:no-repeat}.label{font-size:11px;margin-top:4px}footer button{box-shadow:none!important;height:45px;min-height:45px;text-transform:uppercase}h4{font-size:16px}.images .title{padding:8px 0;font-weight:600}.images img{margin-bottom:16px}.error{display:flex;align-items:center;justify-content:center;flex:1}.error .title{font-size:20px;margin-bottom:8px}.error .title mat-icon{margin-right:8px}.error ul{font-size:18px;list-style-type:none}.photo{width:120px;height:120px;overflow:hidden}.signature{width:200px}mat-card{box-shadow:none!important}.scanBlastWraper button{text-transform:uppercase}.scanBlastWraper.mobile mat-card{margin:4px!important}.scanBlastWraper.mobile .description{flex-direction:row!important}.scanBlastWraper.mobile .description .imgWrap{padding:0!important}.scanBlastWraper.mobile .description .btnActions{position:absolute;right:0}.scanBlastWraper.mobile .description button{margin:0!important;position:absolute;right:16px}.scanBlastWraper.mobile .description button.rotateButton{top:58px}.scanBlastWraper.mobile .description button.remButton{top:8px}.scanBlastWraper.mobile .description button mat-icon{margin:0!important}.scanBlastWraper.mobile .description button div.label{display:none}.scanBlast{display:flex;flex-direction:row;flex:1;padding:0 4px}.scanBlast mat-card{padding:0;box-shadow:none;margin:8px 4px;flex:1}.scanBlast mat-card .head{display:flex;flex-direction:row;align-items:center;justify-items:center;border-bottom:1px solid rgba(0,0,0,.12);height:60px;padding:8px}.scanBlast mat-card .head.small{height:30px!important;padding:4px 8px!important}.scanBlast mat-card .head.small .title{font-size:12px!important;margin-left:4px!important}.scanBlast mat-card .head button{max-width:120px;height:40px;box-shadow:none;border:1px solid rgba(0,0,0,.12)}.scanBlast mat-card .head .title{margin-left:16px;color:#459ae5;font-size:16px}.scanBlast mat-card .content{margin:8px;flex:1}.scanBlast mat-card .description{text-align:center;color:#888}.scanBlast mat-card .actions{background-color:#e9e9e9;display:flex;flex-direction:row}.scanBlast mat-card .actions .mat-button-disabled{background-color:#fff!important}.scanBlast mat-card .actions button{box-shadow:none;width:50%;margin:8px;height:40px;font-size:12px}.scanBlast mat-card .actions button mat-icon{margin-right:8px}.scanBlast mat-card .previewPlaceholder{flex:1;border-radius:6px;display:flex;flex-direction:column}.scanBlast mat-card .previewPlaceholder .description{display:flex;flex:1;flex-direction:column;justify-content:center}.scanBlast mat-card .previewPlaceholder button{box-shadow:none;margin-top:8px;height:40px;font-size:12px}.scanBlast mat-card .previewPlaceholder button mat-icon{margin-right:8px}.scanBlast mat-card .previewPlaceholder .imgWrap{flex-direction:column;flex:1;padding:8px;background-color:#f5f5f5;border-radius:4px}.scanBlast mat-card .previewPlaceholder .imgWrap img{width:100%;border-radius:4px}.scanBlast mat-card .previewPlaceholder .imgWrap .image{background-position:center;background-repeat:no-repeat;background-size:contain}.mr-4{margin-right:4px}.ml-4{margin-left:4px}.p-16{padding:16px}.p-8{padding:8px}.py-16{padding:16px 0}.w-100-p{width:100%}.scanPreview{padding:16px}.scanPreview .image{background-position:center;background-repeat:no-repeat;background-size:contain}.empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center}\n", ".page-header{z-index:2000;height:64px;padding:0;background-color:#fff;border-bottom:1px solid rgba(0,0,0,.12)}.page-header .title{padding-left:24px;line-height:64px;font-size:18px}.page-header .separator{width:1px;background-color:#0000001f;height:100%}.page-header .total{line-height:64px}.page-header .total span{font-weight:700}.page-footer{height:64px}.page-footer button{margin-left:24px;box-shadow:none!important}\n"] }]
3809
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: ScanProvider }, { type: DialogsCoreProvider }, { type: ScanFieldsProvider }, { type: i0.NgZone }, { type: i4$1.TranslateService }, { type: AuthProvider }]; }, propDecorators: { type: [{
3827
+ args: [{ selector: 'app-scan-selfie', changeDetection: ChangeDetectionStrategy.OnPush, template: "<header class=\"page-header\" fxLayout=\"row\">\n <div class=\"title\" ngClass.lt-sm=\"title-small\">Selfie</div>\n\n <span fxFlex></span>\n <ng-container\n *ngIf=\"\n documentTypeSelected &&\n !result &&\n !error &&\n multipleWebcamsAvailable &&\n !preview\n \"\n >\n <div class=\"separator\"></div>\n <div style=\"padding: 0px 16px\">\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <mat-form-field\n style=\"font-size: 14px; width: 200px; margin-top: 8px\"\n class=\"w-200 mr-16 mt-8\"\n >\n <mat-label> Camera </mat-label>\n <mat-select\n (selectionChange)=\"selectCamera($event)\"\n [(ngModel)]=\"deviceId\"\n >\n <mat-option\n *ngFor=\"let device of mediaDevices\"\n [value]=\"device.deviceId\"\n >\n {{ device.label }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n </div>\n </ng-container>\n\n <ng-container>\n <div class=\"separator\"></div>\n\n <button mat-button (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button>\n </ng-container>\n <!-- <ng-container *ngIf=\"type === 'desktop'\">\n <div class=\"separator\"></div>\n <button mat-button (click)=\"sendMobile()\">\n <mat-icon>tablet_mac</mat-icon>\n </button>\n\n <div class=\"separator\"></div>\n\n <button mat-button (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button>\n </ng-container> -->\n</header>\n\n<div *ngIf=\"!result\" fxFlex fxLayout=\"column\">\n <div fxFlex #wraper class=\"wraper\" fxLayout=\"row\">\n <div\n style=\"\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n z-index: 20;\n background-color: whitesmoke;\n \"\n *ngIf=\"!cameraReady && !preview\"\n >\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n </div>\n\n <ng-container *ngIf=\"!error\">\n <!-- <div\n class=\"rectangle\"\n [ngStyle]=\"{\n 'width.px': videoHeight * 0.75 * 1.588,\n 'height.px': videoHeight * 0.75\n }\"\n ></div>\n <svg\n *ngIf=\"videoWidth\"\n style=\"position: absolute; left: 0px; top: 0px\"\n width=\"0\"\n height=\"0\"\n >\n <defs>\n <clipPath id=\"myClip\">\n <rect\n stroke-width=\"6\"\n stroke-color=\"red\"\n [attr.x]=\"(videoWidth - videoHeight * 0.75 * 1.588) / 2\"\n [attr.y]=\"(videoHeight * 0.25) / 2\"\n [attr.width]=\"videoHeight * 0.75 * 1.588\"\n [attr.height]=\"videoHeight * 0.75\"\n rx=\"25\"\n />\n </clipPath>\n </defs>\n </svg> -->\n\n <app-webcam\n *ngIf=\"!preview && !scaning\"\n class=\"main\"\n [imageQuality]=\"1\"\n #webcam\n fxFlex\n [trigger]=\"trigger\"\n (imageCapture)=\"handleImage($event)\"\n [allowCameraSwitch]=\"allowCameraSwitch\"\n [videoOptions]=\"videoOptions\"\n [switchCamera]=\"nextWebcamObservable\"\n (cameraSwitched)=\"cameraWasSwitched($event)\"\n (initError)=\"handleInitError($event)\"\n type=\"selfie\"\n [width]=\"width\"\n [height]=\"height\"\n (destroyed)=\"cameraOff($event)\"\n >\n </app-webcam>\n </ng-container>\n <div\n fxLayout=\"row\"\n fxFlex\n class=\"previewData\"\n *ngIf=\"preview\"\n style=\"z-index: 20; position: absolute; width: 100%; height: 100%\"\n >\n <div\n class=\"scanPreview\"\n fxFlex\n fxLayout=\"column\"\n *ngIf=\"!error && !scaning\"\n >\n <div\n fxFlex\n class=\"image\"\n [style.background-image]=\"'url(' + preview + ')'\"\n ></div>\n </div>\n </div>\n </div>\n\n <footer fxLayout=\"row\" class=\"p-8\">\n <button\n [disabled]=\"!cameraReady\"\n class=\"w-100-p\"\n *ngIf=\"!preview\"\n mat-raised-button\n (click)=\"scan()\"\n >\n <ng-container>\n TAKE SELFIE\n </ng-container>\n </button>\n\n <div\n class=\"w-100-p\"\n *ngIf=\"preview\"\n fxLayout=\"row\"\n fxLayoutAlign=\"start center\"\n fxFlex\n >\n <button fxFlex class=\"mr-4\" mat-raised-button (click)=\"retry()\">\n RETRY\n </button>\n\n <button\n [disabled]=\"error\"\n fxFlex\n class=\"ml-4\"\n mat-raised-button\n (click)=\"continue()\"\n >\n CONTINUE\n\n </button>\n </div>\n </footer>\n</div>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1;background-color:#f5f5f5}.element{margin-bottom:8px}.element label{font-size:14px}.element div{font-size:18px}.wraper{position:relative;overflow:hidden}h3{color:#459ae5;font-size:16px}.preview{width:100%;border-radius:1%}.documentTypeWraper{width:400px}.documentTypeWraper .label{font-size:14px;margin-bottom:20px}.documentTypeWraper button{box-shadow:none}.overPane{position:absolute;width:100%;height:100%;top:0;left:0}.overPane app-webcam{clip-path:url(#myClip)}.subhead{height:55px;padding-top:8px}.rectangle{z-index:2;position:absolute;top:50%;left:50%;width:85.6mm;height:53.98mm;transform:translate(-50%,-50%);box-sizing:border-box;border:2px dashed #459be5;border-radius:3mm}.mask{z-index:1;position:absolute;width:100%;height:100%;background-position:center center;background-size:380mm;background-repeat:no-repeat}.label{font-size:11px;margin-top:4px}footer button{box-shadow:none!important;height:45px;min-height:45px;border:1px solid rgba(0,0,0,.12);text-transform:uppercase}h4{font-size:16px}.images label{font-size:11px;color:#888;line-height:20px}.images .title{padding:8px 0;font-weight:600}.images img{margin-bottom:16px}.error .title{font-size:22px}.error ul{font-size:18px}.photo{width:120px;height:120px;overflow:hidden}.signature{width:200px}mat-card{box-shadow:none!important}.scanBlastWraper button{text-transform:uppercase}.scanBlastWraper.mobile mat-card{margin:4px!important}.scanBlastWraper.mobile .description{font-size:12px;flex-direction:row!important}.scanBlastWraper.mobile .description .imgWrap{padding:0!important}.scanBlastWraper.mobile .description .btnActions{position:absolute;right:0}.scanBlastWraper.mobile .description button{font-size:11px!important;margin:0!important;position:absolute;right:16px}.scanBlastWraper.mobile .description button.rotateButton{top:58px}.scanBlastWraper.mobile .description button.remButton{top:8px}.scanBlastWraper.mobile .description button mat-icon{margin:0!important}.scanBlastWraper.mobile .description button div.label{display:none}.mobile .scanBlast button{font-size:11px!important}.scanBlast{display:flex;flex-direction:row;flex:1;padding:0 4px}.scanBlast mat-card{padding:0;box-shadow:none;margin:8px 4px;flex:1}.scanBlast mat-card .head{display:flex;flex-direction:row;align-items:center;justify-items:center;border-bottom:1px solid rgba(0,0,0,.12);height:60px;padding:8px}.scanBlast mat-card .head.small{height:30px!important;padding:4px 8px!important}.scanBlast mat-card .head.small .title{font-size:12px!important;margin-left:4px!important}.scanBlast mat-card .head button{max-width:120px;height:40px;box-shadow:none;border:1px solid rgba(0,0,0,.12)}.scanBlast mat-card .head .title{margin-left:16px;color:#459ae5;font-size:16px}.scanBlast mat-card .content{margin:8px;flex:1}.scanBlast mat-card .description{text-align:center;color:#888;font-size:14px}.scanBlast mat-card .actions{background-color:#e9e9e9;display:flex;flex-direction:row}.scanBlast mat-card .actions .mat-button-disabled{background-color:#fff!important}.scanBlast mat-card .actions button{box-shadow:none;width:50%;margin:8px;height:40px;font-size:12px}.scanBlast mat-card .actions button mat-icon{margin-right:8px}.scanBlast mat-card .previewPlaceholder{flex:1;border-radius:6px;display:flex;flex-direction:column}.scanBlast mat-card .previewPlaceholder .description{display:flex;flex:1;flex-direction:column;justify-content:center}.scanBlast mat-card .previewPlaceholder button{box-shadow:none;margin-top:8px;height:40px;font-size:12px}.scanBlast mat-card .previewPlaceholder button mat-icon{margin-right:8px}.scanBlast mat-card .previewPlaceholder .imgWrap{flex-direction:column;flex:1;padding:8px;background-color:#f5f5f5;border-radius:4px}.scanBlast mat-card .previewPlaceholder .imgWrap img{width:100%;border-radius:4px}.scanBlast mat-card .previewPlaceholder .imgWrap .image{background-position:center;background-repeat:no-repeat;background-size:contain}.mr-4{margin-right:4px}.ml-4{margin-left:4px}.p-16{padding:16px}.p-8{padding:8px}.py-16{padding:16px 0}.w-100-p{width:100%}.scanPreview{padding:16px}.scanPreview .image{background-position:center;background-repeat:no-repeat;background-size:contain}.empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center}.summary label{font-size:12px;color:#888;margin-top:2px}.summary .name{font-size:14px}.selfieContainer{display:flex;flex-direction:column;margin-bottom:20px}.selfieContainer button{box-shadow:none;border:1px solid rgba(0,0,0,.12)}.selfieContainer .selfie{margin:8px auto;width:120px;height:120px;border-radius:60px;border:1px solid rgba(0,0,0,.12)}\n", ".page-header{z-index:2000;height:64px;padding:0;background-color:#fff;border-bottom:1px solid rgba(0,0,0,.12)}.page-header .title{padding-left:24px;line-height:64px;font-size:18px}.page-header .separator{width:1px;background-color:#0000001f;height:100%}.page-header .total{line-height:64px}.page-header .total span{font-weight:700}.page-footer{height:64px}.page-footer button{margin-left:24px;box-shadow:none!important}\n"] }]
3828
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: ScanProvider }, { type: DialogsCoreProvider }, { type: i1$2.TranslateService }]; }, propDecorators: { type: [{
3810
3829
  type: Input
3811
3830
  }], actions: [{
3812
3831
  type: Output
@@ -3818,228 +3837,167 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
3818
3837
  args: ['window:resize', ['$event']]
3819
3838
  }] } });
3820
3839
 
3821
- class AvatarTypeComponent extends FieldType {
3822
- constructor(cd) {
3823
- super();
3824
- this.cd = cd;
3825
- this.width = 'w-120';
3826
- this.padding = 'px-32 pt-8 pb-8';
3840
+ class TurnDocumentComponent {
3841
+ constructor(dialogRef, data) {
3842
+ this.dialogRef = dialogRef;
3843
+ this.data = data;
3827
3844
  }
3828
- ngOnChange() { }
3829
- ngAfterViewInit() {
3830
- if (this.to.width) {
3831
- this.width = this.to.width;
3832
- }
3833
- if (this.to.padding) {
3834
- this.padding = this.to.padding;
3835
- }
3836
- this.cd.detectChanges();
3845
+ ngOnInit() {
3846
+ console.log(this.data);
3847
+ }
3848
+ close() {
3849
+ console.log(this.dialogRef);
3850
+ this.dialogRef.close();
3837
3851
  }
3838
3852
  }
3839
- AvatarTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AvatarTypeComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3840
- AvatarTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: AvatarTypeComponent, selector: "app-formly-avatar-type", usesInheritance: true, ngImport: i0, template: `
3841
- <mat-card
3842
- [ngClass]="padding"
3843
- fxLayout="column"
3844
- fxLayoutAlign="center center"
3845
- >
3846
- <ngx-avatars
3847
- [name]="model[key.toString()]"
3848
- [ngClass]="width"
3849
- ></ngx-avatars>
3850
- </mat-card>
3851
- `, isInline: true, styles: ["mat-card{border-radius:0;box-shadow:none!important}\n"], dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i12.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { kind: "component", type: i3$2.AvatarComponent, selector: "ngx-avatars", inputs: ["round", "size", "textSizeRatio", "bgColor", "fgColor", "borderColor", "style", "cornerRadius", "facebookId", "twitterId", "googleId", "instagramId", "vkontakteId", "skypeId", "gravatarId", "githubId", "src", "name", "value", "referrerpolicy", "placeholder", "initialsSize"], outputs: ["clickOnAvatar"] }] });
3852
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AvatarTypeComponent, decorators: [{
3853
+ TurnDocumentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TurnDocumentComponent, deps: [{ token: i1$4.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
3854
+ TurnDocumentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TurnDocumentComponent, selector: "app-turndocuments", ngImport: i0, template: "<div class=\"inner\" fxLayout=\"column\" fxLayoutAlign=\"center center\">\n <!-- <img\n style=\"height: 240px; margin: 34px 0px;display: none;\"\n [src]=\"'/assets/images/illustrations/' + images[type]\"\n /> -->\n <!-- <img style=\"width:60px;\" src=\"/assets/images/illustrations/door-lock.png\"> -->\n\n <mat-icon>360</mat-icon>\n <div class=\"text\">\n <ng-container *ngIf=\"data.idScan === 'BACK'\">\n Turn document and:\n {{ \"pms.dialogs.components.scanProfile.captureBack\" | translate }}\n </ng-container>\n <ng-container *ngIf=\"data.idScan === 'FRONT'\">\n Turn document and:\n {{ \"pms.dialogs.components.scanProfile.captureFront\" | translate }}\n </ng-container>\n </div>\n</div>\n\n<!-- -->\n\n<footer>\n <button (click)=\"close()\" mat-raised-button>Ok</button>\n</footer>\n", styles: [":host{display:flex;flex-direction:column;flex:1;height:100%;width:100%}.inner{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:30px 20px 0}.inner mat-icon{width:60px;height:60px;font-size:60px}.inner .text{margin:20px 0}footer{display:flex;flex-direction:row;align-items:center;justify-content:center;padding-bottom:20px}footer button{min-width:200px;box-shadow:none;border:1px solid #ccc}\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i6.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i4$2.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i4$2.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }] });
3855
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TurnDocumentComponent, decorators: [{
3853
3856
  type: Component,
3854
- args: [{ selector: 'app-formly-avatar-type', template: `
3855
- <mat-card
3856
- [ngClass]="padding"
3857
- fxLayout="column"
3858
- fxLayoutAlign="center center"
3859
- >
3860
- <ngx-avatars
3861
- [name]="model[key.toString()]"
3862
- [ngClass]="width"
3863
- ></ngx-avatars>
3864
- </mat-card>
3865
- `, styles: ["mat-card{border-radius:0;box-shadow:none!important}\n"] }]
3866
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; } });
3857
+ args: [{ selector: 'app-turndocuments', template: "<div class=\"inner\" fxLayout=\"column\" fxLayoutAlign=\"center center\">\n <!-- <img\n style=\"height: 240px; margin: 34px 0px;display: none;\"\n [src]=\"'/assets/images/illustrations/' + images[type]\"\n /> -->\n <!-- <img style=\"width:60px;\" src=\"/assets/images/illustrations/door-lock.png\"> -->\n\n <mat-icon>360</mat-icon>\n <div class=\"text\">\n <ng-container *ngIf=\"data.idScan === 'BACK'\">\n Turn document and:\n {{ \"pms.dialogs.components.scanProfile.captureBack\" | translate }}\n </ng-container>\n <ng-container *ngIf=\"data.idScan === 'FRONT'\">\n Turn document and:\n {{ \"pms.dialogs.components.scanProfile.captureFront\" | translate }}\n </ng-container>\n </div>\n</div>\n\n<!-- -->\n\n<footer>\n <button (click)=\"close()\" mat-raised-button>Ok</button>\n</footer>\n", styles: [":host{display:flex;flex-direction:column;flex:1;height:100%;width:100%}.inner{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:30px 20px 0}.inner mat-icon{width:60px;height:60px;font-size:60px}.inner .text{margin:20px 0}footer{display:flex;flex-direction:row;align-items:center;justify-content:center;padding-bottom:20px}footer button{min-width:200px;box-shadow:none;border:1px solid #ccc}\n"] }]
3858
+ }], ctorParameters: function () {
3859
+ return [{ type: i1$4.MatDialogRef }, { type: undefined, decorators: [{
3860
+ type: Inject,
3861
+ args: [MAT_DIALOG_DATA]
3862
+ }] }];
3863
+ } });
3867
3864
 
3868
- class TitleTypeComponent extends FieldType {
3869
- constructor(cd) {
3870
- super();
3871
- this.cd = cd;
3865
+ class DialogsCoreProvider {
3866
+ constructor(matDialog) {
3867
+ this.matDialog = matDialog;
3868
+ this.components = {
3869
+ ScanProfile: { component: ScanProfileComponent },
3870
+ Loading: { component: LoadingComponent },
3871
+ ConfirmComponent: { component: ConfirmComponent },
3872
+ TurnDocumentComponent: { component: TurnDocumentComponent },
3873
+ ScanSelfie: { component: ScanSelfieComponent },
3874
+ };
3875
+ this.blank = BlankComponent;
3876
+ }
3877
+ getComponent(name) {
3878
+ if (!this.components[name]) {
3879
+ console.warn('Component missing', name, this.components);
3880
+ }
3881
+ return this.components[name].component;
3882
+ }
3883
+ open(config, withComponent = true) {
3884
+ // console.log(config);
3885
+ const panelClass = config.panelClass ? config.panelClass : config.name;
3886
+ const component = this.getComponent(config.name);
3887
+ const dialogRef = this.matDialog.open(this.blank, {
3888
+ panelClass,
3889
+ data: {
3890
+ data: config.data,
3891
+ withComponent,
3892
+ component,
3893
+ },
3894
+ autoFocus: false,
3895
+ width: config.width || '',
3896
+ height: config.height || '',
3897
+ maxWidth: config.maxWidth || '',
3898
+ minWidth: config.minWidth || '',
3899
+ maxHeight: config.maxHeight || '',
3900
+ minHeight: config.minHeight || '',
3901
+ position: config.position || {},
3902
+ hasBackdrop: config.hasBackdrop === undefined ? true : config.hasBackdrop,
3903
+ disableClose: config.disableClose === undefined ? true : config.disableClose,
3904
+ });
3905
+ return dialogRef;
3906
+ }
3907
+ scanProfile(data) {
3908
+ return this.open({
3909
+ name: 'ScanProfile',
3910
+ panelClass: 'ScanProfileComponent',
3911
+ data,
3912
+ });
3872
3913
  }
3873
- ngOnInit() {
3874
- this.opt = {
3875
- badge: this.to.badge,
3876
- };
3914
+ // Generic loading dialog
3915
+ loading(title = '') {
3916
+ return this.open({
3917
+ name: 'Loading',
3918
+ data: { title },
3919
+ });
3877
3920
  }
3878
- ngAfterViewInit() {
3879
- this.cd.detectChanges();
3921
+ alert(title, text) {
3922
+ return this.open({
3923
+ name: 'ConfirmComponent',
3924
+ maxWidth: '600px',
3925
+ panelClass: 'DialogNoPadding',
3926
+ minWidth: '440px',
3927
+ data: { title, text, alert: true },
3928
+ });
3929
+ }
3930
+ turnDocument(idScan) {
3931
+ return this.open({
3932
+ name: 'TurnDocumentComponent',
3933
+ maxWidth: '400px',
3934
+ panelClass: 'DialogNoPadding',
3935
+ minWidth: '300px',
3936
+ data: { idScan },
3937
+ }).afterClosed();
3938
+ }
3939
+ // public scanMobile(data: any) {
3940
+ // return this.open({
3941
+ // name: 'ScanMobileComponent',
3942
+ // maxWidth: '600px',
3943
+ // panelClass: 'DialogNoPadding',
3944
+ // minWidth: '440px',
3945
+ // data,
3946
+ // });
3947
+ // }
3948
+ scanSelfie(data) {
3949
+ return this.open({
3950
+ name: 'ScanSelfie',
3951
+ panelClass: 'ScanProfileComponent',
3952
+ data,
3953
+ });
3880
3954
  }
3881
3955
  }
3882
- TitleTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TitleTypeComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3883
- TitleTypeComponentcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TitleTypeComponent, selector: "app-formly-title-type", usesInheritance: true, ngImport: i0, template: `
3884
- <div fxLayout="row" fxLayoutAlign="start center">
3885
- <h3>
3886
- <span>{{ to.label }}</span>
3887
-
3888
- <span
3889
- *ngIf="opt.badge && model[opt.badge] && model[opt.badge].length > 1"
3890
- matBadgeSize="small"
3891
- matBadgeColor="primary"
3892
- matBadgeOverlap="false"
3893
- ></span>
3894
- </h3>
3895
- <span fxFlex></span>
3896
- <div *ngIf="to.chip" class="chip">
3897
- {{ to.chip | translate }}
3898
- </div>
3899
- </div>
3900
- `, isInline: true, styles: [".chip{background:whitesmoke;border-radius:6px;padding:4px 8px;font-size:12px;color:#888;font-weight:600}\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }] });
3901
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TitleTypeComponent, decorators: [{
3902
- type: Component,
3903
- args: [{ selector: 'app-formly-title-type', template: `
3904
- <div fxLayout="row" fxLayoutAlign="start center">
3905
- <h3>
3906
- <span>{{ to.label }}</span>
3907
-
3908
- <span
3909
- *ngIf="opt.badge && model[opt.badge] && model[opt.badge].length > 1"
3910
- matBadgeSize="small"
3911
- matBadgeColor="primary"
3912
- matBadgeOverlap="false"
3913
- ></span>
3914
- </h3>
3915
- <span fxFlex></span>
3916
- <div *ngIf="to.chip" class="chip">
3917
- {{ to.chip | translate }}
3918
- </div>
3919
- </div>
3920
- `, styles: [".chip{background:whitesmoke;border-radius:6px;padding:4px 8px;font-size:12px;color:#888;font-weight:600}\n"] }]
3921
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; } });
3956
+ DialogsCoreProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DialogsCoreProvider, deps: [{ token: i1$4.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
3957
+ DialogsCoreProviderprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DialogsCoreProvider, providedIn: 'root' });
3958
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DialogsCoreProvider, decorators: [{
3959
+ type: Injectable,
3960
+ args: [{
3961
+ providedIn: 'root',
3962
+ }]
3963
+ }], ctorParameters: function () { return [{ type: i1$4.MatDialog }]; } });
3922
3964
 
3923
- class ProfileImageTypeComponent extends FieldType {
3924
- constructor(cd) {
3965
+ class ScanProfileComponent extends BaseComponent {
3966
+ constructor(dialogs, dialogRef) {
3925
3967
  super();
3926
- this.cd = cd;
3968
+ this.dialogs = dialogs;
3969
+ this.dialogRef = dialogRef;
3970
+ this.type = 'desktop';
3971
+ this.showDialog = false;
3927
3972
  }
3928
- ngOnChange() { }
3929
- ngAfterViewInit() {
3930
- if (this.to.width) {
3931
- this.width = this.to.width;
3932
- }
3933
- if (this.to.padding) {
3934
- this.padding = this.to.padding;
3973
+ ngAfterViewInit() { }
3974
+ ngOnDestroy() {
3975
+ this.__destroy();
3976
+ console.log('DES');
3977
+ }
3978
+ actions(event) {
3979
+ console.log(event);
3980
+ switch (event.type) {
3981
+ case 'turnDocumentOver':
3982
+ this.dialogs.turnDocument(event.side).subscribe(() => {
3983
+ this.showDialog = false;
3984
+ });
3985
+ break;
3935
3986
  }
3936
- this.cd.detectChanges();
3987
+ }
3988
+ close() {
3989
+ var _a;
3990
+ (_a = this.dialogRef) === null || _a === void 0 ? void 0 : _a.close();
3937
3991
  }
3938
3992
  }
3939
- ProfileImageTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ProfileImageTypeComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3940
- ProfileImageTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ProfileImageTypeComponent, selector: "app-formly-profile-image-type", usesInheritance: true, ngImport: i0, template: `
3941
- <mat-card
3942
-
3943
- fxLayout="column"
3944
- fxLayoutAlign="center center"
3945
- >
3946
- <ngx-avatars
3947
- class="profile-image"
3948
- [src]="model[key.toString()]"
3949
- [size]="150"
3950
-
3951
- ></ngx-avatars>
3952
- </mat-card>
3953
- `, isInline: true, styles: ["mat-card{border-radius:0;box-shadow:none!important}.profile-image{width:150px;height:150px;border-radius:50%}\n"], dependencies: [{ kind: "component", type: i12.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { kind: "component", type: i3$2.AvatarComponent, selector: "ngx-avatars", inputs: ["round", "size", "textSizeRatio", "bgColor", "fgColor", "borderColor", "style", "cornerRadius", "facebookId", "twitterId", "googleId", "instagramId", "vkontakteId", "skypeId", "gravatarId", "githubId", "src", "name", "value", "referrerpolicy", "placeholder", "initialsSize"], outputs: ["clickOnAvatar"] }] });
3954
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ProfileImageTypeComponent, decorators: [{
3993
+ ScanProfileComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanProfileComponent, deps: [{ token: DialogsCoreProvider }, { token: i1$4.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
3994
+ ScanProfileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScanProfileComponent, selector: "app-scan-profile", inputs: { type: "type" }, usesInheritance: true, ngImport: i0, template: "<header class=\"page-header\">\n <div class=\"title\" ngClass.lt-sm=\"title-small\">Scan</div>\n\n <span fxFlex></span>\n\n <!-- <mat-slide-toggle style=\"margin:0px 20px\" [(ngModel)]=\"isDebug\"\n >Debug</mat-slide-toggle\n > -->\n\n <ng-container\n\n >\n <div class=\"separator\"></div>\n <div style=\"padding: 0px 16px\">\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <ngx-scan-camera-switch></ngx-scan-camera-switch>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"type === 'desktop'\">\n <!-- <div class=\"separator\"></div>\n <button mat-button (click)=\"sendMobile()\">\n <mat-icon>tablet_mac</mat-icon>\n </button> -->\n\n <div class=\"separator\"></div>\n\n <button mat-button (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button>\n </ng-container>\n</header>\n\n<ngx-scan (actions)=\"actions($event)\" [showDialog]=\"showDialog\" [dialogs]=\"dialogs\"></ngx-scan>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1;background-color:#f5f5f5;overflow:hidden}.page-header{display:flex;flex-direction:row;align-items:center}.page-header button{height:100%}\n", ".page-header{z-index:2000;height:64px;padding:0;background-color:#fff;border-bottom:1px solid rgba(0,0,0,.12)}.page-header .title{padding-left:24px;line-height:64px;font-size:18px}.page-header .separator{width:1px;background-color:#0000001f;height:100%}.page-header .total{line-height:64px}.page-header .total span{font-weight:700}.page-footer{height:64px}.page-footer button{margin-left:24px;box-shadow:none!important}\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i6.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: ScanComponent, selector: "ngx-scan", inputs: ["type", "dialogs", "showDialog"], outputs: ["actions"] }, { kind: "component", type: CameraSwitchComponent, selector: "ngx-scan-camera-switch" }, { kind: "directive", type: i4$2.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i4$2.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i4$2.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i5$3.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3995
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanProfileComponent, decorators: [{
3955
3996
  type: Component,
3956
- args: [{ selector: 'app-formly-profile-image-type', template: `
3957
- <mat-card
3958
-
3959
- fxLayout="column"
3960
- fxLayoutAlign="center center"
3961
- >
3962
- <ngx-avatars
3963
- class="profile-image"
3964
- [src]="model[key.toString()]"
3965
- [size]="150"
3966
-
3967
- ></ngx-avatars>
3968
- </mat-card>
3969
- `, styles: ["mat-card{border-radius:0;box-shadow:none!important}.profile-image{width:150px;height:150px;border-radius:50%}\n"] }]
3970
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; } });
3971
-
3972
- class AppFormModule {
3973
- }
3974
- AppFormModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AppFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3975
- AppFormModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: AppFormModule, declarations: [TitleTypeComponent,
3976
- AvatarTypeComponent,
3977
- ProfileImageTypeComponent], imports: [CommonModule,
3978
- FormsModule,
3979
- FormlyMatDatepickerModule,
3980
- FormlySelectModule,
3981
- MaterialModule,
3982
- AvatarModule,
3983
- TranslateModule,
3984
- FormlyMaterialModule, i8$1.FormlyModule], exports: [FormlyModule] });
3985
- AppFormModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AppFormModule, imports: [CommonModule,
3986
- FormsModule,
3987
- FormlyMatDatepickerModule,
3988
- FormlySelectModule,
3989
- MaterialModule,
3990
- AvatarModule,
3991
- TranslateModule,
3992
- FormlyMaterialModule,
3993
- FormlyModule.forRoot({
3994
- types: [
3995
- {
3996
- name: 'title',
3997
- component: TitleTypeComponent,
3998
- wrappers: [],
3999
- },
4000
- {
4001
- name: 'profile-image',
4002
- component: ProfileImageTypeComponent,
4003
- wrappers: [],
4004
- },
4005
- ],
4006
- }), FormlyModule] });
4007
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AppFormModule, decorators: [{
4008
- type: NgModule,
4009
- args: [{
4010
- declarations: [
4011
- TitleTypeComponent,
4012
- AvatarTypeComponent,
4013
- ProfileImageTypeComponent,
4014
- ],
4015
- imports: [
4016
- CommonModule,
4017
- FormsModule,
4018
- FormlyMatDatepickerModule,
4019
- FormlySelectModule,
4020
- MaterialModule,
4021
- AvatarModule,
4022
- TranslateModule,
4023
- FormlyMaterialModule,
4024
- FormlyModule.forRoot({
4025
- types: [
4026
- {
4027
- name: 'title',
4028
- component: TitleTypeComponent,
4029
- wrappers: [],
4030
- },
4031
- {
4032
- name: 'profile-image',
4033
- component: ProfileImageTypeComponent,
4034
- wrappers: [],
4035
- },
4036
- ],
4037
- }),
4038
- ],
4039
- providers: [],
4040
- exports: [FormlyModule],
4041
- }]
4042
- }] });
3997
+ args: [{ selector: 'app-scan-profile', changeDetection: ChangeDetectionStrategy.OnPush, template: "<header class=\"page-header\">\n <div class=\"title\" ngClass.lt-sm=\"title-small\">Scan</div>\n\n <span fxFlex></span>\n\n <!-- <mat-slide-toggle style=\"margin:0px 20px\" [(ngModel)]=\"isDebug\"\n >Debug</mat-slide-toggle\n > -->\n\n <ng-container\n\n >\n <div class=\"separator\"></div>\n <div style=\"padding: 0px 16px\">\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <ngx-scan-camera-switch></ngx-scan-camera-switch>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"type === 'desktop'\">\n <!-- <div class=\"separator\"></div>\n <button mat-button (click)=\"sendMobile()\">\n <mat-icon>tablet_mac</mat-icon>\n </button> -->\n\n <div class=\"separator\"></div>\n\n <button mat-button (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button>\n </ng-container>\n</header>\n\n<ngx-scan (actions)=\"actions($event)\" [showDialog]=\"showDialog\" [dialogs]=\"dialogs\"></ngx-scan>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1;background-color:#f5f5f5;overflow:hidden}.page-header{display:flex;flex-direction:row;align-items:center}.page-header button{height:100%}\n", ".page-header{z-index:2000;height:64px;padding:0;background-color:#fff;border-bottom:1px solid rgba(0,0,0,.12)}.page-header .title{padding-left:24px;line-height:64px;font-size:18px}.page-header .separator{width:1px;background-color:#0000001f;height:100%}.page-header .total{line-height:64px}.page-header .total span{font-weight:700}.page-footer{height:64px}.page-footer button{margin-left:24px;box-shadow:none!important}\n"] }]
3998
+ }], ctorParameters: function () { return [{ type: DialogsCoreProvider }, { type: i1$4.MatDialogRef }]; }, propDecorators: { type: [{
3999
+ type: Input
4000
+ }] } });
4043
4001
 
4044
4002
  class DialogsModule {
4045
4003
  }
@@ -4048,7 +4006,7 @@ DialogsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version:
4048
4006
  BlankComponent,
4049
4007
  LoadingComponent,
4050
4008
  ConfirmComponent,
4051
- ScanMobileComponent,
4009
+ TurnDocumentComponent,
4052
4010
  ScanSelfieComponent], imports: [QRCodeModule,
4053
4011
  ReactiveFormsModule,
4054
4012
  CommonModule,
@@ -4062,7 +4020,7 @@ DialogsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version:
4062
4020
  FlexLayoutModule], exports: [ScanProfileComponent,
4063
4021
  LoadingComponent,
4064
4022
  BlankComponent,
4065
- ScanMobileComponent,
4023
+ TurnDocumentComponent,
4066
4024
  MaterialModule,
4067
4025
  ScanSelfieComponent] });
4068
4026
  DialogsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DialogsModule, providers: [DialogsCoreProvider], imports: [QRCodeModule,
@@ -4084,14 +4042,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
4084
4042
  BlankComponent,
4085
4043
  LoadingComponent,
4086
4044
  ConfirmComponent,
4087
- ScanMobileComponent,
4045
+ TurnDocumentComponent,
4088
4046
  ScanSelfieComponent,
4089
4047
  ],
4090
4048
  exports: [
4091
4049
  ScanProfileComponent,
4092
4050
  LoadingComponent,
4093
4051
  BlankComponent,
4094
- ScanMobileComponent,
4052
+ TurnDocumentComponent,
4095
4053
  MaterialModule,
4096
4054
  ScanSelfieComponent,
4097
4055
  ],
@@ -4108,7 +4066,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
4108
4066
  FlexModule,
4109
4067
  FlexLayoutModule,
4110
4068
  ],
4111
- providers: [DialogsCoreProvider]
4069
+ providers: [DialogsCoreProvider],
4112
4070
  }]
4113
4071
  }] });
4114
4072
 
@@ -4117,7 +4075,7 @@ class HttpErrorInterceptor {
4117
4075
  this.injector = injector;
4118
4076
  }
4119
4077
  intercept(req, next) {
4120
- console.log(req.url);
4078
+ //console.log(req.url);
4121
4079
  if (req.url.indexOf('auth') >= 0 || req.url.indexOf('/assets/') >= 0) {
4122
4080
  return next.handle(req);
4123
4081
  }
@@ -4167,6 +4125,61 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
4167
4125
  type: Injectable
4168
4126
  }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
4169
4127
 
4128
+ class webRtcProvider {
4129
+ constructor() {
4130
+ this.pc = new RTCPeerConnection();
4131
+ }
4132
+ connect(id = 1) {
4133
+ this.subject = webSocket('wss://localhost:3000?id=' + id);
4134
+ }
4135
+ setup() {
4136
+ this.connect(1);
4137
+ // try {
4138
+ // this.pc = new RTCPeerConnection({
4139
+ // iceServers: [
4140
+ // { urls: 'stun:stun.services.mozilla.com' },
4141
+ // { urls: 'stun:stun.l.google.com:19302' },
4142
+ // ],
4143
+ // });
4144
+ // } catch (error) {
4145
+ // console.log(error);
4146
+ // this.pc = new RTCPeerConnection({
4147
+ // iceServers: [
4148
+ // { urls: 'stun:stun.services.mozilla.com' },
4149
+ // { urls: 'stun:stun.l.google.com:19302' },
4150
+ // ],
4151
+ // });
4152
+ // }
4153
+ // this.pc.onicecandidate = (event) => {
4154
+ // event.candidate
4155
+ // ? this.sendMessage({ ice: event.candidate })
4156
+ // : console.log('Sent All Ice');
4157
+ // };
4158
+ // if (this.pc) {
4159
+ // from(this.pc.createOffer())
4160
+ // .pipe(switchMap((offer) => from(this.pc.setLocalDescription(offer))))
4161
+ // .subscribe((data: any) => {
4162
+ // this.sendMessage({
4163
+ // type: 'offer',
4164
+ // sdp: this.pc.localDescription,
4165
+ // });
4166
+ // });
4167
+ // }
4168
+ }
4169
+ sendMessage(data) {
4170
+ console.log(data);
4171
+ this.subject.next(JSON.stringify(data));
4172
+ }
4173
+ }
4174
+ webRtcProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: webRtcProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4175
+ webRtcProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: webRtcProvider, providedIn: 'root' });
4176
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: webRtcProvider, decorators: [{
4177
+ type: Injectable,
4178
+ args: [{
4179
+ providedIn: 'root',
4180
+ }]
4181
+ }], ctorParameters: function () { return []; } });
4182
+
4170
4183
  class NgxScandocModule {
4171
4184
  static forRoot(config) {
4172
4185
  return {
@@ -4205,5 +4218,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
4205
4218
  * Generated bundle index. Do not edit.
4206
4219
  */
4207
4220
 
4208
- export { AppFormModule, AuthProvider, BlankComponent, CoreComponentsModule, CorePipesModule, DialogsCoreProvider, DialogsModule, HttpErrorInterceptor, LoadingComponent, MaterialModule, NgxScandocModule, SafeResourceUrlPipe, ScanFieldsProvider, ScanMobileComponent, ScanProfileComponent, ScanProvider, ScanSelfieComponent, TranslationProvider, WebcamComponent, WebcamModule, webRtcProvider };
4221
+ export { AppFormModule, AuthProvider, BlankComponent, CameraSwitchComponent, CoreComponentsModule, CorePipesModule, DialogsCoreProvider, DialogsModule, HttpErrorInterceptor, LoadingComponent, MaterialModule, NgxScandocModule, SafeResourceUrlPipe, ScanComponent, ScanFieldsProvider, ScanProfileComponent, ScanProvider, ScanSelfieComponent, TranslationProvider, TurnDocumentComponent, WebcamComponent, WebcamModule, webRtcProvider };
4209
4222
  //# sourceMappingURL=ngx-scandoc.mjs.map