@idscan/idvc2 2.2.2 → 2.2.3

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 (41) hide show
  1. package/LICENSE.txt +202 -202
  2. package/README.md +158 -156
  3. package/dist/idvc.js +1 -1
  4. package/dist/index.html +95 -95
  5. package/dist/js/defaultConfig.ts +254 -254
  6. package/dist/js/environment/capturingModes.json +4 -4
  7. package/dist/js/environment/cssVariables.json +191 -191
  8. package/dist/js/environment/designations.ts +19 -19
  9. package/dist/js/environment/documentTypes.ts +145 -145
  10. package/dist/js/environment/langs.ts +293 -293
  11. package/dist/js/environment/loadModes.json +11 -11
  12. package/dist/js/environment/loopResult.ts +14 -14
  13. package/dist/js/environment/networkNames.json +20 -20
  14. package/dist/js/environment/realFaceModes.ts +15 -15
  15. package/dist/js/environment/stepsDescription.ts +85 -85
  16. package/dist/js/environment/triangulation.ts +188 -188
  17. package/dist/js/geometry.d.ts +8 -8
  18. package/dist/js/idvc.d.ts +3 -3
  19. package/dist/js/image.d.ts +4 -4
  20. package/dist/js/index.d.ts +12 -12
  21. package/dist/js/loop.d.ts +21 -21
  22. package/dist/js/mrz.d.ts +105 -105
  23. package/dist/networks/{130.0b466182.js → 130.f9cf8b7f.js} +0 -0
  24. package/dist/networks/{215.bf164218.js → 215.d4dcf9f8.js} +0 -0
  25. package/dist/networks/{400.8e839581.js → 400.c10b35da.js} +0 -0
  26. package/dist/networks/716.0ae8557d.js +1 -0
  27. package/dist/networks/{Face.728ec3c6.js → Face.caf8a3ec.js} +0 -0
  28. package/dist/networks/{MRZ.16515b82.js → MRZ.4736053a.js} +0 -0
  29. package/dist/networks/{PDF.04105754.js → PDF.e3b27d00.js} +0 -0
  30. package/dist/networks/{ZXing.d5fea691.js → ZXing.ccc17251.js} +0 -0
  31. package/dist/networks/angles20210831.json +1 -1
  32. package/dist/networks/asyncLoader.9bf3066b.js +1 -0
  33. package/dist/networks/cdnLoader.edab76a1.js +1 -0
  34. package/dist/networks/classLocal20220112.json +1 -1
  35. package/dist/networks/detectormodel20220817.json +1 -1
  36. package/dist/networks/landmarkmodel20220817.json +1 -1
  37. package/dist/networks/mrz20220531.json +1953 -1953
  38. package/package.json +4 -4
  39. package/dist/networks/716.7c63165d.js +0 -1
  40. package/dist/networks/asyncLoader.c80a6980.js +0 -1
  41. package/dist/networks/cdnLoader.64c17c7d.js +0 -1
@@ -1,293 +1,293 @@
1
- import { CameraNotSupportedReason } from '../types/modules/camera.enum';
2
-
3
- type LabelGroup = 'errorCodes' | 'hintTexts' | 'keyErrors' | 'typeError'
4
- | 'camera' | 'general' | 'uploaderDescription' | 'documentsTypes';
5
-
6
- type AllTypes = IErrorCodes | IHintTexts | KeyError | ITypeError
7
- | ICameraLabels | IGeneral | IDocumentsTypes | IUploaderDescription;
8
-
9
- type Label = Record<LabelGroup, AllTypes>;
10
- type AllLabels = Record<SupportedLanguage, Label>;
11
- type KeyError = string[];
12
- type GetTranslation = {
13
- (): Label,
14
- (groupName: 'errorCodes'): IErrorCodes,
15
- (groupName: 'hintTexts'): IHintTexts,
16
- (groupName: 'keyErrors'): KeyError,
17
- (groupName: 'typeError'): ITypeError,
18
- (groupName: 'camera'): ICameraLabels,
19
- (groupName: 'general'): IGeneral,
20
- (groupName: LabelGroup): AllTypes,
21
- };
22
- export type ErrorCodeNames =
23
- 'mrz'
24
- | 'barcode'
25
- | 'heic'
26
- | 'fileType'
27
- | 'fileTypeHeic'
28
- | 'disableStepFileUpload'
29
- | 'notAllowedDocument'
30
- | 'frontSide'
31
- | 'default'
32
- | keyof typeof CameraNotSupportedReason;
33
- export type SupportedLanguage = typeof supportedLanguages[number];
34
- type IErrorCodes = Record<ErrorCodeNames, string>;
35
-
36
- interface IHintTexts {
37
- front: string,
38
- frontMRZ: string,
39
- mrz: string,
40
- capturing: string,
41
- pdf: string,
42
- back: string,
43
- barcode: string,
44
- hold: string,
45
- dontSee: string,
46
- dontMove: string,
47
- turnFaceLeft: string,
48
- turnFaceRight: string,
49
- turnFaceUp: string,
50
- turnFaceDown: string,
51
- faceCam: string,
52
- camAway: string,
53
- moveCenter: string,
54
- comeCloser: string,
55
- holdCamera: string,
56
- }
57
-
58
- export interface ITypeError {
59
- typeSelectHeader: string,
60
- typeErrorHeader: string,
61
- typeErrorBody: string,
62
- }
63
-
64
- interface ICameraLabels {
65
- loading: string,
66
- awaiting: string,
67
- }
68
-
69
- interface IGeneral {
70
- documentType: string,
71
- selectDocumentTypeText: string,
72
- changeBtn: string,
73
- correctBtn: string,
74
- cancelBtn: string,
75
- doneBtn: string,
76
- closeBtn: string,
77
- retakeBtn: string,
78
- continueBtn: string,
79
- submitBtn: string,
80
- resetAllStepsBtn: string,
81
- btnUploader: string,
82
- btnCamera: string,
83
- pressToUpdateText: string,
84
- pressToUpdateTextSuccess: string
85
- }
86
-
87
- interface IDocumentsTypes {
88
- ID: string,
89
- Passport: string,
90
- PassportCard: string,
91
- GreenCard: string,
92
- InternationalId: string
93
- }
94
-
95
- interface IUploaderDescription {
96
- textFront: string,
97
- textBack: string,
98
- textFace: string,
99
- textPdf: string,
100
- textMrz: string,
101
- textFrontBack: string,
102
- textPass: string,
103
- textFacePosition: string,
104
- }
105
-
106
- export type CameraLabels = keyof ICameraLabels;
107
-
108
- export const supportedLanguages = ['en', 'es'] as const;
109
-
110
- const labels: AllLabels = {
111
- es: {
112
- errorCodes: {
113
- mrz: 'MRZ no fue reconocido',
114
- barcode: 'Advertencia: <br/>No se pudieron leer los datos del código de barras.<br/>Intenta tomar una imagen de mayor calidad.',
115
- heic: 'El archivo HEIC está dañado',
116
- fileTypeHeic: 'Error de tipo de archivo. Solo se admiten los tipos de archivo JPEG, PNG y HEIC.',
117
- fileType: 'Error de tipo de archivo. Solo se admiten los tipos de archivo JPEG y PNG.',
118
- disableStepFileUpload: 'Se debe utilizar un dispositivo con una cámara para capturar esta imagen',
119
- notAllowedDocument: 'Este tipo de documento no está permitido',
120
- frontSide: 'Advertencia: <br/>No se pudo leer la parte frontal del documento. <br/>Intenta tomar una imagen de mayor calidad',
121
- default: 'Lo sentimos, pero algo salió mal. Inténtalo de nuevo',
122
- CameraNotFound: 'No se encontró ninguna cámara en su dispositivo',
123
- CameraNotAllowed: 'Se le ha denegado el permiso para acceder a la cámara',
124
- CameraNotAvailable: 'La cámara no está disponible en este momento',
125
- CameraInUse: 'La cámara ya está en uso',
126
- MediaDevicesNotSupported: 'Tu navegador no es compatible',
127
- },
128
- hintTexts: {
129
- front: 'Coloque el anverso del documento',
130
- frontMRZ: 'Haga zoom para capturar el código en la parte inferior',
131
- mrz: 'Haga zoom para capturar el código en la parte posterior',
132
- capturing: 'Coloque el anverso del documento',
133
- pdf: 'Coloque el código de barras dentro del marco',
134
- back: 'Da la vuelta a tu documento',
135
- barcode: 'Coloque el código de barras dentro del marco',
136
- hold: 'Sostener el **placeholder** lado del documento <br> dentro de la caja',
137
- dontSee: 'No te veo',
138
- dontMove: 'No te muevas',
139
- turnFaceLeft: 'Gira la cara a la izquierda',
140
- turnFaceRight: 'Gira la cara a la derecha',
141
- turnFaceUp: 'Levanta tu cara',
142
- turnFaceDown: 'Bajar la cara',
143
- faceCam: 'Enfréntate a la cámara',
144
- camAway: 'Mover la cámara más lejos',
145
- moveCenter: 'Mover al centro',
146
- comeCloser: 'Acércate',
147
- holdCamera: 'Manténgase firme, analizando el documento <br>',
148
- },
149
- keyErrors: ['La clave de licencia ha caducado', 'Clave de licencia no válida'],
150
- typeError: {
151
- typeSelectHeader: 'Tipo no definido. <br> Seleccione manualmente',
152
- typeErrorHeader: 'Este tipo de documento no está permitido',
153
- typeErrorBody: 'Solo se permiten los siguientes tipos de documentos:',
154
- },
155
- camera: {
156
- loading: 'Carga',
157
- awaiting: 'A la espera de la respuesta de la cámara',
158
- },
159
- general: {
160
- documentType: 'Su Tipo de Documento es',
161
- selectDocumentTypeText: 'Seleccionar Tipo de Documento',
162
- changeBtn: 'Cambiar',
163
- correctBtn: 'Corregir',
164
- cancelBtn: 'Cancelar',
165
- doneBtn: 'Hecho',
166
- closeBtn: 'Cerrar',
167
- retakeBtn: 'VOLVER',
168
- continueBtn: 'CONTINUAR',
169
- submitBtn: 'ENVIAR',
170
- resetAllStepsBtn: 'Restablecer todos los pasos',
171
- btnUploader: 'Cambiar a cargador manual',
172
- btnCamera: 'Cambiar al modo de cámara',
173
- pressToUpdateText: 'Pulse para actualizar',
174
- pressToUpdateTextSuccess: 'Pulse para actualizar',
175
- },
176
- uploaderDescription: {
177
- textFront: 'Haga clic aquí para cargar el frente de su identificación',
178
- textBack: 'Haga clic aquí para cargar el reverso de una identificación',
179
- textFace: 'Haga clic aquí para cargar una foto de su rostro',
180
- textPdf: 'Haga clic aquí para cargar el reverso de una identificación',
181
- textMrz: 'Haga clic aquí para cargar una foto de su documento\'',
182
- textFrontBack: 'Asegúrese de que su identificación llene toda la pantalla de la cámara con poco o ningún fondo.',
183
- textPass: 'Asegúrese de que su identificación llene toda la pantalla de la cámara <br> con poco o ningún fondo, y que se incluya el código MRZ completo',
184
- textFacePosition: 'Coloque su rostro para ocupar toda la pantalla de la cámara con poco o ningún fondo.',
185
- },
186
- documentsTypes: {
187
- ID: 'Licencia de Conducir',
188
- Passport: 'Pasaporte',
189
- PassportCard: 'Tarjeta de Pasaporte',
190
- GreenCard: 'Tarjeta Verde o Autorización de Empleo',
191
- InternationalId: 'Identificación Internacional',
192
- },
193
- },
194
- en: {
195
- errorCodes: {
196
- mrz: 'MRZ not recognized',
197
- barcode: 'Warning: <br/>Barcode data could not be read.<br/>Try taking a higher quality image.',
198
- heic: 'HEIC file incorrupted',
199
- fileType: 'Error file type. Only jpeg and png supported.',
200
- fileTypeHeic: 'Error file type. Only jpeg, png and heic supported.',
201
- disableStepFileUpload: 'A device with a camera must be used to capture this image',
202
- notAllowedDocument: 'This document type is not allowed',
203
- frontSide: 'Warning: <br/>Front of the document could not be read. <br/>Try taking a higher quality image',
204
- default: 'We\'re sorry, but something went wrong. Please try again',
205
- CameraNotFound: 'No camera was found on your device',
206
- CameraNotAllowed: 'You have denied camera access permission',
207
- CameraNotAvailable: 'Camera is not available at this moment',
208
- CameraInUse: 'Camera is already in use',
209
- MediaDevicesNotSupported: 'Your browser is not supported',
210
- },
211
- hintTexts: {
212
- front: 'Position the front of the document',
213
- frontMRZ: 'Zoom in to capture code at bottom',
214
- mrz: 'Zoom in to capture code on back side',
215
- capturing: 'Position the front of the document',
216
- pdf: 'Position the barcode inside the frame',
217
- back: 'Turn around your document',
218
- barcode: 'Position the barcode inside the frame',
219
- hold: 'Hold the **placeholder** side of the document <br> inside the box',
220
- dontSee: 'I don\'t see you',
221
- dontMove: 'Don\'t move',
222
- turnFaceLeft: 'Turn your face left',
223
- turnFaceRight: 'Turn your face right',
224
- turnFaceUp: 'Turn your face up',
225
- turnFaceDown: 'Turn your face down',
226
- faceCam: 'Face the camera',
227
- camAway: 'Move camera further away',
228
- moveCenter: 'Move to the center',
229
- comeCloser: 'Come closer',
230
- holdCamera: 'Hold steady, analyzing document <br>',
231
- },
232
- keyErrors: ['License Key has expired', 'Invalid license key'],
233
- typeError: {
234
- typeSelectHeader: 'Type not defined. <br> Please select manually',
235
- typeErrorHeader: 'This document type is not allowed',
236
- typeErrorBody: 'Only the following document types are allowed:',
237
- },
238
- camera: {
239
- loading: 'Loading',
240
- awaiting: 'Awaiting camera response',
241
- },
242
- general: {
243
- documentType: 'Your document type is',
244
- selectDocumentTypeText: 'Select Document Type',
245
- changeBtn: 'Change',
246
- correctBtn: 'Correct',
247
- cancelBtn: 'Cancel',
248
- doneBtn: 'Done',
249
- closeBtn: 'CLOSE',
250
- retakeBtn: 'Retake',
251
- continueBtn: 'CONTINUE',
252
- submitBtn: 'SUBMIT',
253
- resetAllStepsBtn: 'Reset all steps',
254
- btnUploader: 'Switch to manual uploader',
255
- btnCamera: 'Switch to camera mode',
256
- pressToUpdateText: 'Press to update',
257
- pressToUpdateTextSuccess: 'Press to update',
258
- },
259
- documentsTypes: {
260
- ID: "Driver\'s License",
261
- Passport: 'Passport',
262
- PassportCard: 'Passport Card',
263
- GreenCard: 'Green Card or Employment Authorization',
264
- InternationalId: 'International ID',
265
- },
266
- uploaderDescription: {
267
- textFront: 'Click here to upload the front of your ID',
268
- textBack: 'Click here to upload the back of your ID',
269
- textFace: 'Click here to upload a photo of your face',
270
- textPdf: 'Click here to upload the back of a ID',
271
- textMrz: 'Click here to upload a photo of your document',
272
- textFrontBack: 'Please make sure your ID fills up the entire <br> camera screen with little to no background.',
273
- textPass: 'Please make sure your ID fills up the entire camera screen <br> with little to no background, and the full MRZ code is included.',
274
- textFacePosition: 'Please position your face to take up <br> the full camera screen with little to no background.',
275
- },
276
- },
277
- };
278
-
279
- let translation:Label = labels.en;
280
-
281
- export const setTranslation = (translationLang?: SupportedLanguage): void => {
282
- if (translationLang) {
283
- const lang = translationLang.toLowerCase();
284
- const trnaslation = Object.keys(labels).includes(lang) ? lang as SupportedLanguage : 'en';
285
- translation = labels[trnaslation];
286
- } else {
287
- translation = labels.en;
288
- }
289
- };
290
-
291
- export const getTranslation: GetTranslation = (groupName?) => (groupName
292
- ? translation[groupName]
293
- : translation);
1
+ import { CameraNotSupportedReason } from '../types/modules/camera.enum';
2
+
3
+ type LabelGroup = 'errorCodes' | 'hintTexts' | 'keyErrors' | 'typeError'
4
+ | 'camera' | 'general' | 'uploaderDescription' | 'documentsTypes';
5
+
6
+ type AllTypes = IErrorCodes | IHintTexts | KeyError | ITypeError
7
+ | ICameraLabels | IGeneral | IDocumentsTypes | IUploaderDescription;
8
+
9
+ type Label = Record<LabelGroup, AllTypes>;
10
+ type AllLabels = Record<SupportedLanguage, Label>;
11
+ type KeyError = string[];
12
+ type GetTranslation = {
13
+ (): Label,
14
+ (groupName: 'errorCodes'): IErrorCodes,
15
+ (groupName: 'hintTexts'): IHintTexts,
16
+ (groupName: 'keyErrors'): KeyError,
17
+ (groupName: 'typeError'): ITypeError,
18
+ (groupName: 'camera'): ICameraLabels,
19
+ (groupName: 'general'): IGeneral,
20
+ (groupName: LabelGroup): AllTypes,
21
+ };
22
+ export type ErrorCodeNames =
23
+ 'mrz'
24
+ | 'barcode'
25
+ | 'heic'
26
+ | 'fileType'
27
+ | 'fileTypeHeic'
28
+ | 'disableStepFileUpload'
29
+ | 'notAllowedDocument'
30
+ | 'frontSide'
31
+ | 'default'
32
+ | keyof typeof CameraNotSupportedReason;
33
+ export type SupportedLanguage = typeof supportedLanguages[number];
34
+ type IErrorCodes = Record<ErrorCodeNames, string>;
35
+
36
+ interface IHintTexts {
37
+ front: string,
38
+ frontMRZ: string,
39
+ mrz: string,
40
+ capturing: string,
41
+ pdf: string,
42
+ back: string,
43
+ barcode: string,
44
+ hold: string,
45
+ dontSee: string,
46
+ dontMove: string,
47
+ turnFaceLeft: string,
48
+ turnFaceRight: string,
49
+ turnFaceUp: string,
50
+ turnFaceDown: string,
51
+ faceCam: string,
52
+ camAway: string,
53
+ moveCenter: string,
54
+ comeCloser: string,
55
+ holdCamera: string,
56
+ }
57
+
58
+ export interface ITypeError {
59
+ typeSelectHeader: string,
60
+ typeErrorHeader: string,
61
+ typeErrorBody: string,
62
+ }
63
+
64
+ interface ICameraLabels {
65
+ loading: string,
66
+ awaiting: string,
67
+ }
68
+
69
+ interface IGeneral {
70
+ documentType: string,
71
+ selectDocumentTypeText: string,
72
+ changeBtn: string,
73
+ correctBtn: string,
74
+ cancelBtn: string,
75
+ doneBtn: string,
76
+ closeBtn: string,
77
+ retakeBtn: string,
78
+ continueBtn: string,
79
+ submitBtn: string,
80
+ resetAllStepsBtn: string,
81
+ btnUploader: string,
82
+ btnCamera: string,
83
+ pressToUpdateText: string,
84
+ pressToUpdateTextSuccess: string
85
+ }
86
+
87
+ interface IDocumentsTypes {
88
+ ID: string,
89
+ Passport: string,
90
+ PassportCard: string,
91
+ GreenCard: string,
92
+ InternationalId: string
93
+ }
94
+
95
+ interface IUploaderDescription {
96
+ textFront: string,
97
+ textBack: string,
98
+ textFace: string,
99
+ textPdf: string,
100
+ textMrz: string,
101
+ textFrontBack: string,
102
+ textPass: string,
103
+ textFacePosition: string,
104
+ }
105
+
106
+ export type CameraLabels = keyof ICameraLabels;
107
+
108
+ export const supportedLanguages = ['en', 'es'] as const;
109
+
110
+ const labels: AllLabels = {
111
+ es: {
112
+ errorCodes: {
113
+ mrz: 'MRZ no fue reconocido',
114
+ barcode: 'Advertencia: <br/>No se pudieron leer los datos del código de barras.<br/>Intenta tomar una imagen de mayor calidad.',
115
+ heic: 'El archivo HEIC está dañado',
116
+ fileTypeHeic: 'Error de tipo de archivo. Solo se admiten los tipos de archivo JPEG, PNG y HEIC.',
117
+ fileType: 'Error de tipo de archivo. Solo se admiten los tipos de archivo JPEG y PNG.',
118
+ disableStepFileUpload: 'Se debe utilizar un dispositivo con una cámara para capturar esta imagen',
119
+ notAllowedDocument: 'Este tipo de documento no está permitido',
120
+ frontSide: 'Advertencia: <br/>No se pudo leer la parte frontal del documento. <br/>Intenta tomar una imagen de mayor calidad',
121
+ default: 'Lo sentimos, pero algo salió mal. Inténtalo de nuevo',
122
+ CameraNotFound: 'No se encontró ninguna cámara en su dispositivo',
123
+ CameraNotAllowed: 'Se le ha denegado el permiso para acceder a la cámara',
124
+ CameraNotAvailable: 'La cámara no está disponible en este momento',
125
+ CameraInUse: 'La cámara ya está en uso',
126
+ MediaDevicesNotSupported: 'Tu navegador no es compatible',
127
+ },
128
+ hintTexts: {
129
+ front: 'Coloque el anverso del documento',
130
+ frontMRZ: 'Haga zoom para capturar el código en la parte inferior',
131
+ mrz: 'Haga zoom para capturar el código en la parte posterior',
132
+ capturing: 'Coloque el anverso del documento',
133
+ pdf: 'Coloque el código de barras dentro del marco',
134
+ back: 'Da la vuelta a tu documento',
135
+ barcode: 'Coloque el código de barras dentro del marco',
136
+ hold: 'Sostener el **placeholder** lado del documento <br> dentro de la caja',
137
+ dontSee: 'No te veo',
138
+ dontMove: 'No te muevas',
139
+ turnFaceLeft: 'Gira la cara a la izquierda',
140
+ turnFaceRight: 'Gira la cara a la derecha',
141
+ turnFaceUp: 'Levanta tu cara',
142
+ turnFaceDown: 'Bajar la cara',
143
+ faceCam: 'Enfréntate a la cámara',
144
+ camAway: 'Mover la cámara más lejos',
145
+ moveCenter: 'Mover al centro',
146
+ comeCloser: 'Acércate',
147
+ holdCamera: 'Manténgase firme, analizando el documento <br>',
148
+ },
149
+ keyErrors: ['La clave de licencia ha caducado', 'Clave de licencia no válida'],
150
+ typeError: {
151
+ typeSelectHeader: 'Tipo no definido. <br> Seleccione manualmente',
152
+ typeErrorHeader: 'Este tipo de documento no está permitido',
153
+ typeErrorBody: 'Solo se permiten los siguientes tipos de documentos:',
154
+ },
155
+ camera: {
156
+ loading: 'Carga',
157
+ awaiting: 'A la espera de la respuesta de la cámara',
158
+ },
159
+ general: {
160
+ documentType: 'Su Tipo de Documento es',
161
+ selectDocumentTypeText: 'Seleccionar Tipo de Documento',
162
+ changeBtn: 'Cambiar',
163
+ correctBtn: 'Corregir',
164
+ cancelBtn: 'Cancelar',
165
+ doneBtn: 'Hecho',
166
+ closeBtn: 'Cerrar',
167
+ retakeBtn: 'VOLVER',
168
+ continueBtn: 'CONTINUAR',
169
+ submitBtn: 'ENVIAR',
170
+ resetAllStepsBtn: 'Restablecer todos los pasos',
171
+ btnUploader: 'Cambiar a cargador manual',
172
+ btnCamera: 'Cambiar al modo de cámara',
173
+ pressToUpdateText: 'Pulse para actualizar',
174
+ pressToUpdateTextSuccess: 'Pulse para actualizar',
175
+ },
176
+ uploaderDescription: {
177
+ textFront: 'Haga clic aquí para cargar el frente de su identificación',
178
+ textBack: 'Haga clic aquí para cargar el reverso de una identificación',
179
+ textFace: 'Haga clic aquí para cargar una foto de su rostro',
180
+ textPdf: 'Haga clic aquí para cargar el reverso de una identificación',
181
+ textMrz: 'Haga clic aquí para cargar una foto de su documento\'',
182
+ textFrontBack: 'Asegúrese de que su identificación llene toda la pantalla de la cámara con poco o ningún fondo.',
183
+ textPass: 'Asegúrese de que su identificación llene toda la pantalla de la cámara <br> con poco o ningún fondo, y que se incluya el código MRZ completo',
184
+ textFacePosition: 'Coloque su rostro para ocupar toda la pantalla de la cámara con poco o ningún fondo.',
185
+ },
186
+ documentsTypes: {
187
+ ID: 'Licencia de Conducir',
188
+ Passport: 'Pasaporte',
189
+ PassportCard: 'Tarjeta de Pasaporte',
190
+ GreenCard: 'Tarjeta Verde o Autorización de Empleo',
191
+ InternationalId: 'Identificación Internacional',
192
+ },
193
+ },
194
+ en: {
195
+ errorCodes: {
196
+ mrz: 'MRZ not recognized',
197
+ barcode: 'Warning: <br/>Barcode data could not be read.<br/>Try taking a higher quality image.',
198
+ heic: 'HEIC file incorrupted',
199
+ fileType: 'Error file type. Only jpeg and png supported.',
200
+ fileTypeHeic: 'Error file type. Only jpeg, png and heic supported.',
201
+ disableStepFileUpload: 'A device with a camera must be used to capture this image',
202
+ notAllowedDocument: 'This document type is not allowed',
203
+ frontSide: 'Warning: <br/>Front of the document could not be read. <br/>Try taking a higher quality image',
204
+ default: 'We\'re sorry, but something went wrong. Please try again',
205
+ CameraNotFound: 'No camera was found on your device',
206
+ CameraNotAllowed: 'You have denied camera access permission',
207
+ CameraNotAvailable: 'Camera is not available at this moment',
208
+ CameraInUse: 'Camera is already in use',
209
+ MediaDevicesNotSupported: 'Your browser is not supported',
210
+ },
211
+ hintTexts: {
212
+ front: 'Position the front of the document',
213
+ frontMRZ: 'Zoom in to capture code at bottom',
214
+ mrz: 'Zoom in to capture code on back side',
215
+ capturing: 'Position the front of the document',
216
+ pdf: 'Position the barcode inside the frame',
217
+ back: 'Turn around your document',
218
+ barcode: 'Position the barcode inside the frame',
219
+ hold: 'Hold the **placeholder** side of the document <br> inside the box',
220
+ dontSee: 'I don\'t see you',
221
+ dontMove: 'Don\'t move',
222
+ turnFaceLeft: 'Turn your face left',
223
+ turnFaceRight: 'Turn your face right',
224
+ turnFaceUp: 'Turn your face up',
225
+ turnFaceDown: 'Turn your face down',
226
+ faceCam: 'Face the camera',
227
+ camAway: 'Move camera further away',
228
+ moveCenter: 'Move to the center',
229
+ comeCloser: 'Come closer',
230
+ holdCamera: 'Hold steady, analyzing document <br>',
231
+ },
232
+ keyErrors: ['License Key has expired', 'Invalid license key'],
233
+ typeError: {
234
+ typeSelectHeader: 'Type not defined. <br> Please select manually',
235
+ typeErrorHeader: 'This document type is not allowed',
236
+ typeErrorBody: 'Only the following document types are allowed:',
237
+ },
238
+ camera: {
239
+ loading: 'Loading',
240
+ awaiting: 'Awaiting camera response',
241
+ },
242
+ general: {
243
+ documentType: 'Your document type is',
244
+ selectDocumentTypeText: 'Select Document Type',
245
+ changeBtn: 'Change',
246
+ correctBtn: 'Correct',
247
+ cancelBtn: 'Cancel',
248
+ doneBtn: 'Done',
249
+ closeBtn: 'CLOSE',
250
+ retakeBtn: 'Retake',
251
+ continueBtn: 'CONTINUE',
252
+ submitBtn: 'SUBMIT',
253
+ resetAllStepsBtn: 'Reset all steps',
254
+ btnUploader: 'Switch to manual uploader',
255
+ btnCamera: 'Switch to camera mode',
256
+ pressToUpdateText: 'Press to update',
257
+ pressToUpdateTextSuccess: 'Press to update',
258
+ },
259
+ documentsTypes: {
260
+ ID: "Driver\'s License",
261
+ Passport: 'Passport',
262
+ PassportCard: 'Passport Card',
263
+ GreenCard: 'Green Card or Employment Authorization',
264
+ InternationalId: 'International ID',
265
+ },
266
+ uploaderDescription: {
267
+ textFront: 'Click here to upload the front of your ID',
268
+ textBack: 'Click here to upload the back of your ID',
269
+ textFace: 'Click here to upload a photo of your face',
270
+ textPdf: 'Click here to upload the back of a ID',
271
+ textMrz: 'Click here to upload a photo of your document',
272
+ textFrontBack: 'Please make sure your ID fills up the entire <br> camera screen with little to no background.',
273
+ textPass: 'Please make sure your ID fills up the entire camera screen <br> with little to no background, and the full MRZ code is included.',
274
+ textFacePosition: 'Please position your face to take up <br> the full camera screen with little to no background.',
275
+ },
276
+ },
277
+ };
278
+
279
+ let translation:Label = labels.en;
280
+
281
+ export const setTranslation = (translationLang?: SupportedLanguage): void => {
282
+ if (translationLang) {
283
+ const lang = translationLang.toLowerCase();
284
+ const trnaslation = Object.keys(labels).includes(lang) ? lang as SupportedLanguage : 'en';
285
+ translation = labels[trnaslation];
286
+ } else {
287
+ translation = labels.en;
288
+ }
289
+ };
290
+
291
+ export const getTranslation: GetTranslation = (groupName?) => (groupName
292
+ ? translation[groupName]
293
+ : translation);
@@ -1,11 +1,11 @@
1
- {
2
- "cdn": {
3
- "description": "Take loaders from cdn. No additional webpack config."
4
- },
5
- "asyncLocal": {
6
- "description": "Take local loaders. Required additional webpack config."
7
- },
8
- "syncLocal": {
9
- "description": "Loads all required modules synchronous. No additional webpack config."
10
- }
11
- }
1
+ {
2
+ "cdn": {
3
+ "description": "Take loaders from cdn. No additional webpack config."
4
+ },
5
+ "asyncLocal": {
6
+ "description": "Take local loaders. Required additional webpack config."
7
+ },
8
+ "syncLocal": {
9
+ "description": "Loads all required modules synchronous. No additional webpack config."
10
+ }
11
+ }
@@ -1,14 +1,14 @@
1
- export interface ILoopResult {
2
- status: boolean,
3
- cancel: boolean,
4
- touch: boolean,
5
- image: ImageData | null,
6
- }
7
-
8
- const defaultLoopResult: ILoopResult = {
9
- status: false,
10
- cancel: false,
11
- touch: false,
12
- image: null,
13
- };
14
- export default defaultLoopResult;
1
+ export interface ILoopResult {
2
+ status: boolean,
3
+ cancel: boolean,
4
+ touch: boolean,
5
+ image: ImageData | null,
6
+ }
7
+
8
+ const defaultLoopResult: ILoopResult = {
9
+ status: false,
10
+ cancel: false,
11
+ touch: false,
12
+ image: null,
13
+ };
14
+ export default defaultLoopResult;