ngx-scandoc 0.0.1 → 1.0.1

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 (71) hide show
  1. package/core/app.worker.d.ts +1 -0
  2. package/core/components/components.module.d.ts +8 -0
  3. package/core/components/webcam/domain/webcam-image.d.ts +35 -0
  4. package/core/components/webcam/domain/webcam-init-error.d.ts +4 -0
  5. package/core/components/webcam/domain/webcam-mirror-properties.d.ts +3 -0
  6. package/core/components/webcam/util/webcam.util.d.ts +8 -0
  7. package/core/components/webcam/webcam/webcam.component.d.ts +202 -0
  8. package/core/components/webcam/webcam.module.d.ts +9 -0
  9. package/core/pipes/pipes.module.d.ts +7 -0
  10. package/core/pipes/safeResourceUrl.pipe.d.ts +10 -0
  11. package/core/shared/material.module.d.ts +28 -0
  12. package/dialogs/components/blank/blank.component.d.ts +17 -0
  13. package/dialogs/components/confirm/confirm.component.d.ts +30 -0
  14. package/dialogs/components/loading/loading.component.d.ts +5 -0
  15. package/dialogs/components/scan-mobile/scan-mobile.component.d.ts +16 -0
  16. package/dialogs/components/scan-profile/scan-profile.component.d.ts +124 -0
  17. package/dialogs/components/scan-selfie/scan-selfie.component.d.ts +83 -0
  18. package/dialogs/dialogs.core.provider.d.ts +18 -0
  19. package/dialogs/dialogs.module.d.ts +21 -0
  20. package/esm2020/core/app.worker.mjs +236 -0
  21. package/esm2020/core/components/components.module.mjs +18 -0
  22. package/esm2020/core/components/webcam/domain/webcam-image.mjs +58 -0
  23. package/esm2020/core/components/webcam/domain/webcam-init-error.mjs +3 -0
  24. package/esm2020/core/components/webcam/domain/webcam-mirror-properties.mjs +3 -0
  25. package/esm2020/core/components/webcam/util/webcam.util.mjs +48 -0
  26. package/esm2020/core/components/webcam/webcam/webcam.component.mjs +861 -0
  27. package/esm2020/core/components/webcam/webcam.module.mjs +22 -0
  28. package/esm2020/core/pipes/pipes.module.mjs +19 -0
  29. package/esm2020/core/pipes/safeResourceUrl.pipe.mjs +20 -0
  30. package/esm2020/core/shared/material.module.mjs +162 -0
  31. package/esm2020/dialogs/components/blank/blank.component.mjs +47 -0
  32. package/esm2020/dialogs/components/confirm/confirm.component.mjs +53 -0
  33. package/esm2020/dialogs/components/loading/loading.component.mjs +12 -0
  34. package/esm2020/dialogs/components/scan-mobile/scan-mobile.component.mjs +43 -0
  35. package/esm2020/dialogs/components/scan-profile/scan-profile.component.mjs +756 -0
  36. package/esm2020/dialogs/components/scan-selfie/scan-selfie.component.mjs +392 -0
  37. package/esm2020/dialogs/dialogs.core.provider.mjs +100 -0
  38. package/esm2020/dialogs/dialogs.module.mjs +89 -0
  39. package/esm2020/forms/form.module.mjs +87 -0
  40. package/esm2020/forms/types/avatar.type.mjs +53 -0
  41. package/esm2020/forms/types/profile.image.type.mjs +54 -0
  42. package/esm2020/forms/types/title.type.mjs +60 -0
  43. package/esm2020/lib/ngx-scandoc.module.mjs +28 -11
  44. package/esm2020/providers/auth.provider.mjs +57 -0
  45. package/esm2020/providers/interceptor.provider.mjs +61 -0
  46. package/esm2020/providers/scan.form.mjs +386 -0
  47. package/esm2020/providers/scan.provider.mjs +490 -0
  48. package/esm2020/providers/translation.provider.mjs +50 -0
  49. package/esm2020/providers/webrtc.provider.mjs +58 -0
  50. package/esm2020/public-api.mjs +22 -4
  51. package/fesm2015/ngx-scandoc.mjs +4178 -32
  52. package/fesm2015/ngx-scandoc.mjs.map +1 -1
  53. package/fesm2020/ngx-scandoc.mjs +4154 -32
  54. package/fesm2020/ngx-scandoc.mjs.map +1 -1
  55. package/forms/form.module.d.ts +18 -0
  56. package/forms/types/avatar.type.d.ts +14 -0
  57. package/forms/types/profile.image.type.d.ts +14 -0
  58. package/forms/types/title.type.d.ts +12 -0
  59. package/lib/ngx-scandoc.module.d.ts +20 -2
  60. package/package.json +6 -2
  61. package/providers/auth.provider.d.ts +21 -0
  62. package/providers/interceptor.provider.d.ts +13 -0
  63. package/providers/scan.form.d.ts +13 -0
  64. package/providers/scan.provider.d.ts +239 -0
  65. package/providers/translation.provider.d.ts +9 -0
  66. package/providers/webrtc.provider.d.ts +11 -0
  67. package/public-api.d.ts +21 -3
  68. package/esm2020/lib/ngx-scandoc.component.mjs +0 -22
  69. package/esm2020/lib/ngx-scandoc.service.mjs +0 -14
  70. package/lib/ngx-scandoc.component.d.ts +0 -8
  71. package/lib/ngx-scandoc.service.d.ts +0 -6
@@ -0,0 +1 @@
1
+ export declare const workertext = "\n\n\nlet readStream = true;\nasync function blobToBase64(blob) {\n return new Promise((resolve, _) => {\n const reader = new FileReader();\n reader.onloadend = () => resolve(reader.result);\n reader.readAsDataURL(blob);\n });\n}\nasync function delay(ms) {\n return new Promise((resolve) =>\n ms > 0 ? setTimeout(resolve, ms) : resolve(0)\n );\n}\n\nfunction calculateDelay(startTime) {\n const endTime = Date.now();\n // difference in ms\n const dt = endTime - startTime;\n const delay = 100 - dt;\n // console.log('[WORKER TIME]', dt, '[DELAY 100-x]', delay);\n return delay > 4 ? delay : 0;\n}\nasync function parseFrame(frameStream, trackSettings) {\n const reader = frameStream.getReader();\n\n while (readStream) {\n const time = Date.now();\n const result = await reader.read();\n if (result.done) break;\n\n const frameFromCamera = result.value;\n\n await parseFrameFromCamera(frameFromCamera, trackSettings);\n // wait\n await delay(calculateDelay(time));\n }\n}\n\nasync function parseFrameFast(frameStream, trackSettings) {\n console.warn('FAST', performance.now());\n const reader = frameStream.getReader();\n const { width, height } = trackSettings;\n const offscreenSmall = new OffscreenCanvas(384, 384);\n const context = offscreenSmall.getContext('2d');\n let time = 0;\n while (true) {\n // const t0 = performance.now();\n // console.time('result');\n const result = reader.read();\n // console.timeEnd('result');\n if (result.done) break;\n\n const frameFromCamera = result.value;\n // console.log(frameFromCamera.timestamp);\n\n // const tt = frameFromCamera.timestamp - time;\n // console.log(tt / 1000);\n // time = frameFromCamera.timestamp;\n\n // console.time('bitmap');\n const bitmap = await createImageBitmap(frameFromCamera, {\n premultiplyAlpha: 'default',\n });\n console.warn(new Date().getTime());\n // console.timeEnd('bitmap');\n\n // context.clearRect(0, 0, 384, 384);\n // console.time('draw');\n // context.drawImage(bitmap, 0, 0, width, height, 0, 0, 384, 384);\n // console.timeEnd('draw');\n // console.time('transfer');\n // const bitmapSmall = offscreenSmall.transferToImageBitmap();\n // console.timeEnd('transfer');\n\n frameFromCamera.close();\n // //\n // const t1 = performance.now();\n\n\n // await parseFrameFromCamera(frameFromCamera, trackSettings);\n }\n}\n\nasync function parseFrameFromCamera(frameFromCamera, trackSettings) {\n const { width, height } = trackSettings;\n const offscreenSmall = new OffscreenCanvas(384, 384);\n // console.time('bit2');\n const bitmap = await createImageBitmap(frameFromCamera, {\n premultiplyAlpha: 'default',\n });\n // console.timeEnd('bit2');\n const context = offscreenSmall.getContext('2d');\n\n // console.time('buffer');\n // const buffer = new Uint8Array(frameFromCamera.allocationSize());\n // let layout = await frameFromCamera.copyTo(buffer);\n\n // const base64 = await blobToBase64(new Blob([buffer]));\n // console.log(base64)\n // console.timeEnd('buffer');\n\n if (context) {\n context.imageSmoothingEnabled = false;\n\n // let videoFrame2 = frameFromCamera.clone();\n\n // createImageBitmap();\n\n // console.time('clear');\n // context.clearRect(0, 0, width, height);\n // console.timeEnd('clear');\n // console.time('draw');\n context.drawImage(bitmap, 0, 0, width, height, 0, 0, 384, 384);\n // console.timeEnd('draw');\n // context.drawImage(bit, 0, 0);\n // bit2.close();\n // bit.close();\n // console.timeEnd('draw');\n // console.time('capture');\n\n // const bitmapsmall = offscreenSmall.transferToImageBitmap();\n\n // const imageData = context.getImageData(0, 0, 384, 384);\n // console.timeEnd('capture');\n // console.time('blob');\n const resized = await offscreenSmall.convertToBlob({\n type: 'image/jpeg',\n });\n // console.timeEnd('blob');\n // console.log(resized);\n // console.time('base64');\n const base64 = await blobToBase64(resized);\n //console.timeEnd('base64');\n // console.log(blob);\n\n // console.time('convert')\n // await convert(bitmap, trackSettings)\n // console.timeEnd('convert');\n // console.log(\n // '%c ',\n // 'font-size:384px; background:url('+blob+') no-repeat;'\n // );\n\n // console.timeEnd('blob');\n postMessage({ base64, bitmap }, [bitmap]);\n // videoFrame2.close();\n }\n frameFromCamera.close();\n}\n\nasync function convert(image, trackSettings) {\n const { width, height } = trackSettings;\n\n const offscreenSmall = new OffscreenCanvas(width, height);\n\n const context = offscreenSmall.getContext('2d');\n\n // console.time('buffer');\n // const buffer = new Uint8Array(frameFromCamera.allocationSize());\n // let layout = await frameFromCamera.copyTo(buffer);\n // console.timeEnd('buffer');\n\n if (context) {\n context.imageSmoothingEnabled = false;\n // let videoFrame2 = frameFromCamera.clone();\n console.warn(image);\n // createImageBitmap();\n\n // console.time('clear');\n // context.clearRect(0, 0, width, height);\n // console.timeEnd('clear');\n\n context.drawImage(image, 0, 0);\n // context.drawImage(bit, 0, 0);\n // image.close();\n // console.timeEnd('drawB');\n console.time('blob2');\n const resized = await offscreenSmall.convertToBlob({\n type: 'image/jpeg',\n });\n console.timeEnd('blob2');\n\n // image.close();\n // console.time('base64');\n const base64 = await blobToBase64(resized);\n\n // console.log(blob);\n\n // console.log(\n // '%c ',\n // 'font-size:384px; background:url(' + base64 + ') no-repeat;'\n // );\n\n // console.timeEnd('base64');\n //postMessage({ type: 'convert', base64 });\n }\n}\naddEventListener('message', ({ data }) => {\n const { type, image, frameStream, trackSettings } = data;\n // console.log(data);\n switch (type) {\n case 'start':\n readStream = true;\n parseFrame(frameStream, trackSettings);\n break;\n\n case 'fast':\n readStream = true;\n parseFrameFast(frameStream, trackSettings);\n break;\n\n case 'stop':\n console.warn('STOP WORKER');\n readStream = false;\n break;\n\n case 'convert':\n convert(image, trackSettings);\n break;\n }\n\n // const canvas = document.createElement('canvas');\n // const ctx = canvas.getContext('2d');\n\n // if (data.canvas) {\n // postMessage('ok');\n // } else {\n\n // postMessage(response);\n // }\n});\n";
@@ -0,0 +1,8 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "@angular/common";
3
+ import * as i2 from "./webcam/webcam.module";
4
+ export declare class CoreComponentsModule {
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<CoreComponentsModule, never>;
6
+ static ɵmod: i0.ɵɵNgModuleDeclaration<CoreComponentsModule, never, [typeof i1.CommonModule, typeof i2.WebcamModule], [typeof i2.WebcamModule]>;
7
+ static ɵinj: i0.ɵɵInjectorDeclaration<CoreComponentsModule>;
8
+ }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Container class for a captured webcam image
3
+ * @author basst314, davidshen84
4
+ */
5
+ export declare class WebcamImage {
6
+ constructor(imageAsDataUrl: string, mimeType: string, imageData: ImageData, resized: any);
7
+ private readonly _mimeType;
8
+ private _imageAsBase64?;
9
+ private readonly _imageAsDataUrl;
10
+ private readonly _imageData;
11
+ private readonly _imageResized;
12
+ /**
13
+ * Extracts the Base64 data out of the given dataUrl.
14
+ * @param dataUrl the given dataUrl
15
+ * @param mimeType the mimeType of the data
16
+ */
17
+ private static getDataFromDataUrl;
18
+ /**
19
+ * Get the base64 encoded image data
20
+ * @returns base64 data of the image
21
+ */
22
+ get imageAsBase64(): string;
23
+ /**
24
+ * Get the encoded image as dataUrl
25
+ * @returns the dataUrl of the image
26
+ */
27
+ get imageAsDataUrl(): string;
28
+ /**
29
+ * Get the ImageData object associated with the canvas' 2d context.
30
+ * @returns the ImageData of the canvas's 2d context.
31
+ */
32
+ get imageData(): ImageData;
33
+ get imageResized(): string;
34
+ get dataUrl(): string;
35
+ }
@@ -0,0 +1,4 @@
1
+ export declare class WebcamInitError {
2
+ message?: string;
3
+ mediaStreamError?: any;
4
+ }
@@ -0,0 +1,3 @@
1
+ export declare class WebcamMirrorProperties {
2
+ x?: string;
3
+ }
@@ -0,0 +1,8 @@
1
+ import { Observable } from 'rxjs';
2
+ export declare class WebcamUtil {
3
+ /**
4
+ * Lists available videoInput devices
5
+ * @returns a list of media device info.
6
+ */
7
+ static getAvailableVideoInputs(): Observable<MediaDeviceInfo[]>;
8
+ }
@@ -0,0 +1,202 @@
1
+ import { AfterViewInit, ChangeDetectorRef, EventEmitter, NgZone, OnDestroy } from '@angular/core';
2
+ import { WebcamInitError } from '../domain/webcam-init-error';
3
+ import { WebcamImage } from '../domain/webcam-image';
4
+ import { Observable, Subject } from 'rxjs';
5
+ import { WebcamMirrorProperties } from '../domain/webcam-mirror-properties';
6
+ import { BreakpointObserver } from '@angular/cdk/layout';
7
+ import { Platform } from '@angular/cdk/platform';
8
+ import * as i0 from "@angular/core";
9
+ export declare class WebcamComponent implements AfterViewInit, OnDestroy {
10
+ breakpointObserver: BreakpointObserver;
11
+ platform: Platform;
12
+ private cd;
13
+ private zone;
14
+ trackProcessor: any;
15
+ trackSettings: any;
16
+ imageHandler: Subject<any>;
17
+ private static DEFAULT_VIDEO_OPTIONS;
18
+ private static DEFAULT_IMAGE_TYPE;
19
+ private static DEFAULT_IMAGE_QUALITY;
20
+ id?: any;
21
+ type?: 'document' | 'selfie';
22
+ /** Defines the max width of the webcam area in px */
23
+ width: number;
24
+ /** Defines the max height of the webcam area in px */
25
+ height: number;
26
+ /** Defines base constraints to apply when requesting video track from UserMedia */
27
+ videoOptions: MediaTrackConstraints;
28
+ /** Flag to enable/disable camera switch. If enabled, a switch icon will be displayed if multiple cameras were found */
29
+ allowCameraSwitch: boolean;
30
+ /** Parameter to control image mirroring (i.e. for user-facing camera). ["auto", "always", "never"] */
31
+ mirrorImage?: string | WebcamMirrorProperties;
32
+ /** Flag to control whether an ImageData object is stored into the WebcamImage object. */
33
+ captureImageData: boolean;
34
+ /** The image type to use when capturing snapshots */
35
+ imageType: string;
36
+ /** The image quality to use when capturing snapshots (number between 0 and 1) */
37
+ imageQuality: number;
38
+ /** EventEmitter which fires when an image has been captured */
39
+ imageCapture: EventEmitter<WebcamImage>;
40
+ /** Emits a mediaError if webcam cannot be initialized (e.g. missing user permissions) */
41
+ initError: EventEmitter<WebcamInitError>;
42
+ /** Emits when the webcam video was clicked */
43
+ imageClick: EventEmitter<void>;
44
+ /** Emits the active deviceId after the active video device was switched */
45
+ cameraSwitched: EventEmitter<string>;
46
+ videoReady: EventEmitter<boolean>;
47
+ showVideo: boolean;
48
+ destroyed: EventEmitter<any>;
49
+ /** available video devices */
50
+ availableVideoInputs: MediaDeviceInfo[];
51
+ /** Indicates whether the video device is ready to be switched */
52
+ videoInitialized: boolean;
53
+ canvasEl: HTMLCanvasElement;
54
+ /** If the Observable represented by this subscription emits, an image will be captured and emitted through
55
+ * the 'imageCapture' EventEmitter */
56
+ private triggerSubscription?;
57
+ /** Index of active video in availableVideoInputs */
58
+ private activeVideoInputIndex;
59
+ /** Subscription to switchCamera events */
60
+ private switchCameraSubscription?;
61
+ /** MediaStream object in use for streaming UserMedia data */
62
+ private mediaStream;
63
+ private video;
64
+ private videoStreamer;
65
+ /** Canvas for Video Snapshots */
66
+ private canvas;
67
+ /** Canvas for Video Snapshots */
68
+ private canvasSnapshot;
69
+ private canvasResize;
70
+ /** width and height of the active video stream */
71
+ activeVideoSettings: any;
72
+ shutdown: boolean;
73
+ private canStart;
74
+ videoSize: any;
75
+ canvasSize: any;
76
+ worker?: Worker;
77
+ /**
78
+ * If the given Observable emits, an image will be captured and emitted through 'imageCapture' EventEmitter
79
+ */
80
+ set trigger(trigger: Observable<number>);
81
+ /**
82
+ * If the given Observable emits, the active webcam will be switched to the one indicated by the emitted value.
83
+ * @param switchCamera Indicates which webcam to switch to
84
+ * true: cycle forwards through available webcams
85
+ * false: cycle backwards through available webcams
86
+ * string: activate the webcam with the given id
87
+ */
88
+ switchCamera: any;
89
+ onResize(): void;
90
+ constructor(breakpointObserver: BreakpointObserver, platform: Platform, cd: ChangeDetectorRef, zone: NgZone);
91
+ /**
92
+ * Get MediaTrackConstraints to request streaming the given device
93
+ * @param deviceId
94
+ * @param baseMediaTrackConstraints base constraints to merge deviceId-constraint into
95
+ * @returns
96
+ */
97
+ private static getMediaConstraintsForDevice;
98
+ /**
99
+ * Tries to harvest the deviceId from the given mediaStreamTrack object.
100
+ * Browsers populate this object differently; this method tries some different approaches
101
+ * to read the id.
102
+ * @param mediaStreamTrack
103
+ * @returns deviceId if found in the mediaStreamTrack
104
+ */
105
+ private static getDeviceIdFromMediaStreamTrack;
106
+ /**
107
+ * Tries to harvest the facingMode from the given mediaStreamTrack object.
108
+ * Browsers populate this object differently; this method tries some different approaches
109
+ * to read the value.
110
+ * @param mediaStreamTrack
111
+ * @returns facingMode if found in the mediaStreamTrack
112
+ */
113
+ private static getFacingModeFromMediaStreamTrack;
114
+ /**
115
+ * Determines whether the given mediaStreamTrack claims itself as user facing
116
+ * @param mediaStreamTrack
117
+ */
118
+ private static isUserFacing;
119
+ landscape: boolean;
120
+ /**
121
+ * Extracts the value from the given ConstrainDOMString
122
+ * @param constrainDOMString
123
+ */
124
+ private static getValueFromConstrainDOMString;
125
+ resizeStage(): void;
126
+ get canvasHeight(): number;
127
+ updatecanvasSize(): void;
128
+ private setupWorker;
129
+ ngAfterViewInit(): void;
130
+ ngOnDestroy(): void;
131
+ private takeSelfie;
132
+ /**
133
+ * Takes a snapshot of the current webcam's view and emits the image as an event
134
+ */
135
+ takeSnapshot(time: number): void;
136
+ private update;
137
+ resizeImage(base64data: any): Observable<any>;
138
+ /**
139
+ * Switches to the next/previous video device
140
+ * @param forward
141
+ */
142
+ rotateVideoInput(forward: boolean): void;
143
+ /**
144
+ * Switches the camera-view to the specified video device
145
+ */
146
+ switchToVideoInput(deviceId: string): void;
147
+ /**
148
+ * Event-handler for video resize event.
149
+ * Triggers Angular change detection so that new video dimensions get applied
150
+ */
151
+ videoResize(): void;
152
+ get videoWidth(): number;
153
+ get videoHeight(): number;
154
+ get videoStyleClasses(): string;
155
+ get nativeVideoElement(): any;
156
+ /**
157
+ * Returns the video aspect ratio of the active video stream
158
+ */
159
+ private getVideoAspectRatio;
160
+ private updateSize;
161
+ getStreamTrack(stream: MediaStream): MediaStreamTrack;
162
+ getTrackSettings(): void;
163
+ accesVideoTrack(videoTrackConstraints: MediaStreamConstraints): any;
164
+ private drawRectangle;
165
+ getMaxAvailableResolution(): void;
166
+ /**
167
+ * Init webcam live view
168
+ */
169
+ private initWebcam;
170
+ get isMobile(): boolean;
171
+ get cardRectangle(): {
172
+ padding: number;
173
+ top: number;
174
+ rWidth: number;
175
+ rHeight: number;
176
+ };
177
+ get snapRectangle(): {
178
+ padding: number;
179
+ top: number;
180
+ rWidth: number;
181
+ rHeight: number;
182
+ };
183
+ private setActiveCamera;
184
+ private getActiveVideoTrack;
185
+ private isMirrorImage;
186
+ /**
187
+ * Stops all active media tracks.
188
+ * This prevents the webcam from being indicated as active,
189
+ * even if it is no longer used by this component.
190
+ */
191
+ private stopMediaTracks;
192
+ /**
193
+ * Unsubscribe from all open subscriptions
194
+ */
195
+ private unsubscribeFromSubscriptions;
196
+ /**
197
+ * Reads available input devices
198
+ */
199
+ private detectAvailableDevices;
200
+ static ɵfac: i0.ɵɵFactoryDeclaration<WebcamComponent, never>;
201
+ static ɵcmp: i0.ɵɵComponentDeclaration<WebcamComponent, "app-webcam", never, { "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"; }, { "imageCapture": "imageCapture"; "initError": "initError"; "imageClick": "imageClick"; "cameraSwitched": "cameraSwitched"; "videoReady": "videoReady"; "destroyed": "destroyed"; }, never, never, false>;
202
+ }
@@ -0,0 +1,9 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./webcam/webcam.component";
3
+ import * as i2 from "@angular/common";
4
+ import * as i3 from "@angular/cdk/platform";
5
+ export declare class WebcamModule {
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<WebcamModule, never>;
7
+ static ɵmod: i0.ɵɵNgModuleDeclaration<WebcamModule, [typeof i1.WebcamComponent], [typeof i2.CommonModule, typeof i3.PlatformModule], [typeof i1.WebcamComponent]>;
8
+ static ɵinj: i0.ɵɵInjectorDeclaration<WebcamModule>;
9
+ }
@@ -0,0 +1,7 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./safeResourceUrl.pipe";
3
+ export declare class CorePipesModule {
4
+ static ɵfac: i0.ɵɵFactoryDeclaration<CorePipesModule, never>;
5
+ static ɵmod: i0.ɵɵNgModuleDeclaration<CorePipesModule, [typeof i1.SafeResourceUrlPipe], never, [typeof i1.SafeResourceUrlPipe]>;
6
+ static ɵinj: i0.ɵɵInjectorDeclaration<CorePipesModule>;
7
+ }
@@ -0,0 +1,10 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import { DomSanitizer } from '@angular/platform-browser';
3
+ import * as i0 from "@angular/core";
4
+ export declare class SafeResourceUrlPipe implements PipeTransform {
5
+ private sanitizer;
6
+ constructor(sanitizer: DomSanitizer);
7
+ transform(style: any): import("@angular/platform-browser").SafeResourceUrl;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<SafeResourceUrlPipe, never>;
9
+ static ɵpipe: i0.ɵɵPipeDeclaration<SafeResourceUrlPipe, "safeResourceUrl", false>;
10
+ }
@@ -0,0 +1,28 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "@angular/material/core";
3
+ import * as i2 from "@angular/material/datepicker";
4
+ import * as i3 from "@angular/material/card";
5
+ import * as i4 from "@angular/material/menu";
6
+ import * as i5 from "@angular/material/icon";
7
+ import * as i6 from "@angular/material/button";
8
+ import * as i7 from "@angular/material/dialog";
9
+ import * as i8 from "@angular/material/input";
10
+ import * as i9 from "@angular/material/snack-bar";
11
+ import * as i10 from "@angular/material/progress-bar";
12
+ import * as i11 from "@angular/material/table";
13
+ import * as i12 from "@angular/material/progress-spinner";
14
+ import * as i13 from "@angular/material/paginator";
15
+ import * as i14 from "@angular/material/select";
16
+ import * as i15 from "@angular/material/checkbox";
17
+ import * as i16 from "@angular/material/chips";
18
+ import * as i17 from "@angular/material/badge";
19
+ import * as i18 from "@angular/material/list";
20
+ import * as i19 from "@angular/material/tabs";
21
+ import * as i20 from "@angular/material/slider";
22
+ import * as i21 from "@angular/material/slide-toggle";
23
+ import * as i22 from "@angular/material/autocomplete";
24
+ export declare class MaterialModule {
25
+ static ɵfac: i0.ɵɵFactoryDeclaration<MaterialModule, never>;
26
+ static ɵmod: i0.ɵɵNgModuleDeclaration<MaterialModule, never, [typeof i1.MatNativeDateModule, typeof i2.MatDatepickerModule, typeof i3.MatCardModule, typeof i4.MatMenuModule, typeof i5.MatIconModule, typeof i6.MatButtonModule, typeof i7.MatDialogModule, typeof i8.MatInputModule, typeof i9.MatSnackBarModule, typeof i10.MatProgressBarModule, typeof i11.MatTableModule, typeof i12.MatProgressSpinnerModule, typeof i13.MatPaginatorModule, typeof i14.MatSelectModule, typeof i15.MatCheckboxModule, typeof i16.MatChipsModule, typeof i17.MatBadgeModule, typeof i18.MatListModule, typeof i19.MatTabsModule, typeof i20.MatSliderModule, typeof i21.MatSlideToggleModule], [typeof i1.MatNativeDateModule, typeof i2.MatDatepickerModule, typeof i14.MatSelectModule, typeof i3.MatCardModule, typeof i4.MatMenuModule, typeof i5.MatIconModule, typeof i6.MatButtonModule, typeof i7.MatDialogModule, typeof i8.MatInputModule, typeof i9.MatSnackBarModule, typeof i10.MatProgressBarModule, typeof i12.MatProgressSpinnerModule, typeof i11.MatTableModule, typeof i13.MatPaginatorModule, typeof i16.MatChipsModule, typeof i17.MatBadgeModule, typeof i15.MatCheckboxModule, typeof i18.MatListModule, typeof i19.MatTabsModule, typeof i21.MatSlideToggleModule, typeof i22.MatAutocompleteModule]>;
27
+ static ɵinj: i0.ɵɵInjectorDeclaration<MaterialModule>;
28
+ }
@@ -0,0 +1,17 @@
1
+ import { ComponentFactoryResolver, ViewContainerRef, AfterViewInit, ChangeDetectorRef } from '@angular/core';
2
+ import { MatDialogRef } from '@angular/material/dialog';
3
+ import * as i0 from "@angular/core";
4
+ export declare class BlankComponent implements AfterViewInit {
5
+ dialogRef: MatDialogRef<BlankComponent>;
6
+ data: any;
7
+ private componentFactoryResolver;
8
+ cd: ChangeDetectorRef;
9
+ body?: ViewContainerRef;
10
+ initSet: boolean;
11
+ constructor(dialogRef: MatDialogRef<BlankComponent>, data: any, componentFactoryResolver: ComponentFactoryResolver, cd: ChangeDetectorRef);
12
+ setModel(model: any): void;
13
+ init(): void;
14
+ ngAfterViewInit(): void;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<BlankComponent, never>;
16
+ static ɵcmp: i0.ɵɵComponentDeclaration<BlankComponent, "app-dialog-blank", never, {}, {}, never, never, false>;
17
+ }
@@ -0,0 +1,30 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { MatDialogRef } from '@angular/material/dialog';
3
+ import * as i0 from "@angular/core";
4
+ interface options {
5
+ hideOkButton?: boolean;
6
+ hideCancelButton?: boolean;
7
+ hideNoButton?: boolean;
8
+ type?: string;
9
+ }
10
+ export declare class ConfirmComponent implements OnInit {
11
+ dialogRef: MatDialogRef<ConfirmComponent>;
12
+ data: any;
13
+ showDetails: boolean;
14
+ images: {
15
+ alert: string;
16
+ prompt: string;
17
+ dirty: string;
18
+ };
19
+ type: any;
20
+ options: options;
21
+ onEnterPress(e: KeyboardEvent): void;
22
+ onEscapePress(e: KeyboardEvent): void;
23
+ constructor(dialogRef: MatDialogRef<ConfirmComponent>, data: any);
24
+ ngOnInit(): void;
25
+ action(key: any): void;
26
+ close(): void;
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<ConfirmComponent, never>;
28
+ static ɵcmp: i0.ɵɵComponentDeclaration<ConfirmComponent, "app-confirm", never, {}, {}, never, never, false>;
29
+ }
30
+ export {};
@@ -0,0 +1,5 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class LoadingComponent {
3
+ static ɵfac: i0.ɵɵFactoryDeclaration<LoadingComponent, never>;
4
+ static ɵcmp: i0.ɵɵComponentDeclaration<LoadingComponent, "app-loading", never, {}, {}, never, never, false>;
5
+ }
@@ -0,0 +1,16 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { MatDialogRef } from '@angular/material/dialog';
3
+ import { webRtcProvider } from '../../../providers/webrtc.provider';
4
+ import * as i0 from "@angular/core";
5
+ export declare class ScanMobileComponent implements OnInit {
6
+ dialogRef: MatDialogRef<ScanMobileComponent>;
7
+ data: any;
8
+ private rtcProvider;
9
+ code: any;
10
+ constructor(dialogRef: MatDialogRef<ScanMobileComponent>, data: any, rtcProvider: webRtcProvider);
11
+ ngOnInit(): void;
12
+ close(): void;
13
+ action(): void;
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<ScanMobileComponent, never>;
15
+ static ɵcmp: i0.ɵɵComponentDeclaration<ScanMobileComponent, "app-scan-mobile", never, {}, {}, never, never, false>;
16
+ }
@@ -0,0 +1,124 @@
1
+ import { EventEmitter, ElementRef, ChangeDetectorRef, AfterViewInit, OnDestroy, NgZone } from '@angular/core';
2
+ import { MatDialogRef } from '@angular/material/dialog';
3
+ import { Subject, Observable, Subscription } from 'rxjs';
4
+ import { FormGroup } from '@angular/forms';
5
+ import { TranslateService } from '@ngx-translate/core';
6
+ import { ScanProvider } from '../../../providers/scan.provider';
7
+ import { DialogsCoreProvider } from '../../../dialogs/dialogs.core.provider';
8
+ import { WebcamImage } from '../../../core/components/webcam/domain/webcam-image';
9
+ import { WebcamInitError } from '../../../core/components/webcam/domain/webcam-init-error';
10
+ import { ScanFieldsProvider } from '../../../providers/scan.form';
11
+ import { AuthProvider } from '../../../providers/auth.provider';
12
+ import * as i0 from "@angular/core";
13
+ export interface IWindow extends Window {
14
+ TextDetector: any;
15
+ }
16
+ interface Troubleshooting {
17
+ Request: any;
18
+ Response: any;
19
+ ExpectedOutput: any;
20
+ AcceptTermsAndConditions: boolean;
21
+ }
22
+ interface Timestamps {
23
+ time: number;
24
+ load: number;
25
+ }
26
+ export declare class ScanProfileComponent implements AfterViewInit, OnDestroy {
27
+ cd: ChangeDetectorRef;
28
+ scanProvider: ScanProvider;
29
+ private dialogs;
30
+ private formProvider;
31
+ private zone;
32
+ private translate;
33
+ private auth;
34
+ scanBlastData: any;
35
+ type: string;
36
+ actions: EventEmitter<any>;
37
+ mediaDevices: any;
38
+ deviceId?: string;
39
+ videoOptions: MediaTrackConstraints;
40
+ dialogRef?: MatDialogRef<any>;
41
+ data: any;
42
+ startTime: number;
43
+ isDebug: boolean;
44
+ multipleWebcamsAvailable: boolean;
45
+ scanInProgress: boolean;
46
+ fields: any;
47
+ documentTypeSelected: boolean;
48
+ imageHandlerSubscription: Subscription;
49
+ selectedSide: any;
50
+ images: any;
51
+ scanTimeout: any;
52
+ preview: any;
53
+ scanType: any;
54
+ width: any;
55
+ height: any;
56
+ videoWidth: any;
57
+ videoHeight: any;
58
+ errorCode: string;
59
+ displayInfo: any;
60
+ allowCameraSwitch: boolean;
61
+ verificationErrorSent: boolean;
62
+ error: boolean;
63
+ cameraReady: boolean;
64
+ result: any;
65
+ scaning: boolean;
66
+ imageHandler: Subject<unknown>;
67
+ logData: Troubleshooting;
68
+ defaultDevice: any;
69
+ scanDatas: any;
70
+ scanSide: any;
71
+ idScan: any;
72
+ webcamImage?: WebcamImage;
73
+ model: any;
74
+ validation: boolean;
75
+ scannedImages: any[];
76
+ scanDelay: any;
77
+ trigger: Subject<number>;
78
+ nextWebcam: Subject<boolean | string>;
79
+ imageVerified: boolean;
80
+ form: FormGroup<{}>;
81
+ scanImageTimestamps: Timestamps;
82
+ wraper?: ElementRef;
83
+ onResize(): void;
84
+ constructor(cd: ChangeDetectorRef, scanProvider: ScanProvider, dialogs: DialogsCoreProvider, formProvider: ScanFieldsProvider, zone: NgZone, translate: TranslateService, auth: AuthProvider);
85
+ private resetLogData;
86
+ ngOnDestroy(): void;
87
+ init(): void;
88
+ scan(): void;
89
+ private DataUrlFromImage;
90
+ handleImage(webcamImage: WebcamImage): void;
91
+ private handleBurstData;
92
+ handleInitError(error: WebcamInitError): void;
93
+ get scanBlastCanUpload(): boolean;
94
+ cameraWasSwitched(deviceId: string): void;
95
+ get nextWebcamObservable(): Observable<boolean | string>;
96
+ private handleLongValidationError;
97
+ ngAfterViewInit(): void;
98
+ handleBitmapImage(bitmap: any): any;
99
+ autoScan(): void;
100
+ selectCamera(event: any): void;
101
+ close(): void;
102
+ singleScan(side: any): void;
103
+ getBase64(file: any): Observable<unknown>;
104
+ handleFileInput(target: any, event: any, side: any): void;
105
+ rotateBase64Image(base64data: any): Observable<unknown>;
106
+ sendMobile(): void;
107
+ singleScanRotate(side: any): void;
108
+ singleScanRemove(side: any): void;
109
+ resolutionLimit(file: any): Observable<unknown>;
110
+ private getImgBase64;
111
+ scanBlastFinish(): void;
112
+ cameraOff(ev: any): void;
113
+ continue(): void;
114
+ retry(): void;
115
+ triggerSnapshot(): void;
116
+ retake(): void;
117
+ cancel(): void;
118
+ use(): void;
119
+ selfie(): void;
120
+ videoReady(event: boolean): void;
121
+ static ɵfac: i0.ɵɵFactoryDeclaration<ScanProfileComponent, never>;
122
+ static ɵcmp: i0.ɵɵComponentDeclaration<ScanProfileComponent, "app-scan-profile", never, { "type": "type"; }, { "actions": "actions"; }, never, never, false>;
123
+ }
124
+ export {};
@@ -0,0 +1,83 @@
1
+ import { EventEmitter, ElementRef, ChangeDetectorRef, AfterViewInit } from '@angular/core';
2
+ import { MatDialogRef } from '@angular/material/dialog';
3
+ import { Subject, Observable } from 'rxjs';
4
+ import { FormGroup } from '@angular/forms';
5
+ import { WebcamImage } from '../../../core/components/webcam/domain/webcam-image';
6
+ import { WebcamInitError } from '../../../core/components/webcam/domain/webcam-init-error';
7
+ import { DialogsCoreProvider } from '../../../dialogs/dialogs.core.provider';
8
+ import { TranslateService } from '@ngx-translate/core';
9
+ import { ScanProvider } from '../../../providers/scan.provider';
10
+ import * as i0 from "@angular/core";
11
+ export interface IWindow extends Window {
12
+ TextDetector: any;
13
+ }
14
+ export declare class ScanSelfieComponent implements AfterViewInit {
15
+ cd: ChangeDetectorRef;
16
+ scanProvider: ScanProvider;
17
+ private dialogs;
18
+ private translate;
19
+ scanBlastData: any;
20
+ type: string;
21
+ actions: EventEmitter<any>;
22
+ mediaDevices: any;
23
+ deviceId?: string;
24
+ videoOptions: MediaTrackConstraints;
25
+ dialogRef?: MatDialogRef<any>;
26
+ data: any;
27
+ multipleWebcamsAvailable: boolean;
28
+ fields: any;
29
+ documentTypeSelected: boolean;
30
+ selectedSide: any;
31
+ images: any;
32
+ preview: any;
33
+ scanType: any;
34
+ width: any;
35
+ height: any;
36
+ videoWidth: any;
37
+ videoHeight: any;
38
+ allowCameraSwitch: boolean;
39
+ error: boolean;
40
+ cameraReady: boolean;
41
+ result: any;
42
+ scaning: boolean;
43
+ defaultDevice: any;
44
+ scanDatas: any;
45
+ scanSide: any;
46
+ webcamImage?: WebcamImage;
47
+ model: any;
48
+ trigger: Subject<number>;
49
+ nextWebcam: Subject<boolean | string>;
50
+ form: FormGroup<{}>;
51
+ wraper?: ElementRef;
52
+ onResize(): void;
53
+ constructor(cd: ChangeDetectorRef, scanProvider: ScanProvider, dialogs: DialogsCoreProvider, translate: TranslateService);
54
+ init(): void;
55
+ handleImage(webcamImage: WebcamImage): void;
56
+ handleInitError(error: WebcamInitError): void;
57
+ get scanBlastCanUpload(): boolean;
58
+ cameraWasSwitched(deviceId: string): void;
59
+ get nextWebcamObservable(): Observable<boolean | string>;
60
+ ngAfterViewInit(): void;
61
+ selectCamera(event: any): void;
62
+ close(): void;
63
+ singleScan(side: any): void;
64
+ getBase64(file: any): Observable<unknown>;
65
+ handleFileInput(target: any, event: any, side: any): void;
66
+ rotateBase64Image(base64data: any): Observable<unknown>;
67
+ sendMobile(): void;
68
+ singleScanRotate(side: any): void;
69
+ singleScanRemove(side: any): void;
70
+ resolutionLimit(file: any): Observable<unknown>;
71
+ private getImgBase64;
72
+ scanBlastFinish(): void;
73
+ cameraOff(ev: any): void;
74
+ continue(): void;
75
+ retry(): void;
76
+ triggerSnapshot(): void;
77
+ scan(): void;
78
+ retake(): void;
79
+ use(): void;
80
+ selfie(): void;
81
+ static ɵfac: i0.ɵɵFactoryDeclaration<ScanSelfieComponent, never>;
82
+ static ɵcmp: i0.ɵɵComponentDeclaration<ScanSelfieComponent, "app-scan-selfie", never, { "type": "type"; }, { "actions": "actions"; }, never, never, false>;
83
+ }
@@ -0,0 +1,18 @@
1
+ import { MatDialog, MatDialogRef } from '@angular/material/dialog';
2
+ import { BlankComponent } from './components/blank/blank.component';
3
+ import * as i0 from "@angular/core";
4
+ export declare class DialogsCoreProvider {
5
+ private matDialog;
6
+ components: any;
7
+ private blank;
8
+ constructor(matDialog: MatDialog);
9
+ private getComponent;
10
+ open(config: any, withComponent?: boolean): MatDialogRef<BlankComponent, any>;
11
+ scanProfile(data: any): MatDialogRef<BlankComponent, any>;
12
+ loading(title?: string): MatDialogRef<BlankComponent, any>;
13
+ alert(title: string, text: string): MatDialogRef<BlankComponent, any>;
14
+ scanMobile(data: any): MatDialogRef<BlankComponent, any>;
15
+ scanSelfie(data: any): MatDialogRef<BlankComponent, any>;
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<DialogsCoreProvider, never>;
17
+ static ɵprov: i0.ɵɵInjectableDeclaration<DialogsCoreProvider>;
18
+ }