@igo2/core 1.15.4 → 16.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_index.scss +8 -0
- package/assets/icons/mdi.svg +1 -1
- package/core-theme.scss +5 -0
- package/{esm2020 → esm2022}/igo2-core.mjs +4 -4
- package/{esm2020 → esm2022}/lib/activity/activity.interceptor.mjs +32 -30
- package/{esm2020 → esm2022}/lib/activity/activity.module.mjs +30 -30
- package/esm2022/lib/activity/activity.service.mjs +32 -0
- package/{esm2020 → esm2022}/lib/activity/index.mjs +3 -3
- package/{esm2020 → esm2022}/lib/analytics/index.mjs +2 -2
- package/{esm2020 → esm2022}/lib/analytics/shared/analytics.interface.mjs +2 -2
- package/esm2022/lib/analytics/shared/analytics.service.mjs +84 -0
- package/{esm2020 → esm2022}/lib/analytics/shared/index.mjs +3 -3
- package/{esm2020 → esm2022}/lib/compression/compressedData.interface.mjs +2 -2
- package/esm2022/lib/compression/compression.service.mjs +142 -0
- package/{esm2020 → esm2022}/lib/compression/index.mjs +3 -3
- package/{esm2020 → esm2022}/lib/config/config.interface.mjs +1 -1
- package/{esm2020 → esm2022}/lib/config/config.module.mjs +23 -23
- package/{esm2020 → esm2022}/lib/config/config.provider.mjs +21 -21
- package/esm2022/lib/config/config.service.mjs +53 -0
- package/{esm2020 → esm2022}/lib/config/index.mjs +4 -4
- package/esm2022/lib/config/version.mjs +5 -0
- package/esm2022/lib/core.module.mjs +104 -0
- package/{esm2020 → esm2022}/lib/gesture/gesture.module.mjs +30 -30
- package/{esm2020 → esm2022}/lib/gesture/gesture.provider.mjs +16 -16
- package/{esm2020 → esm2022}/lib/language/index.mjs +2 -2
- package/esm2022/lib/language/language.module.mjs +39 -0
- package/{esm2020 → esm2022}/lib/language/shared/index.mjs +5 -5
- package/{esm2020 → esm2022}/lib/language/shared/language.interface.mjs +2 -2
- package/esm2022/lib/language/shared/language.loader.mjs +31 -0
- package/esm2022/lib/language/shared/language.provider.mjs +22 -0
- package/esm2022/lib/language/shared/language.service.mjs +38 -0
- package/{esm2020 → esm2022}/lib/language/shared/missing-translation.guard.mjs +16 -16
- package/{esm2020 → esm2022}/lib/media/index.mjs +3 -3
- package/{esm2020 → esm2022}/lib/media/media.enum.mjs +12 -12
- package/esm2022/lib/media/media.service.mjs +82 -0
- package/{esm2020 → esm2022}/lib/message/index.mjs +2 -2
- package/esm2022/lib/message/message.module.mjs +60 -0
- package/{esm2020 → esm2022}/lib/message/shared/index.mjs +4 -4
- package/{esm2020 → esm2022}/lib/message/shared/message.enum.mjs +10 -10
- package/{esm2020 → esm2022}/lib/message/shared/message.interface.mjs +2 -2
- package/esm2022/lib/message/shared/message.service.mjs +218 -0
- package/{esm2020 → esm2022}/lib/network/index.mjs +3 -3
- package/{esm2020 → esm2022}/lib/network/network.interfaces.mjs +2 -2
- package/esm2022/lib/network/network.service.mjs +66 -0
- package/{esm2020 → esm2022}/lib/regex/index.mjs +3 -3
- package/{esm2020 → esm2022}/lib/regex/regex.interface.mjs +2 -2
- package/esm2022/lib/regex/regex.service.mjs +30 -0
- package/esm2022/lib/request/error.interceptor.mjs +67 -0
- package/esm2022/lib/request/error.module.mjs +39 -0
- package/{esm2020 → esm2022}/lib/request/index.mjs +3 -3
- package/esm2022/lib/request/logging.interceptor.mjs +29 -0
- package/{esm2020 → esm2022}/lib/request/logging.module.mjs +30 -30
- package/esm2022/lib/route/route.interface.mjs +2 -0
- package/esm2022/lib/route/route.service.mjs +75 -0
- package/esm2022/lib/storage/index.mjs +4 -0
- package/{esm2020 → esm2022}/lib/storage/storage.interface.mjs +13 -13
- package/esm2022/lib/storage/storage.mjs +76 -0
- package/esm2022/lib/storage/storage.service.mjs +21 -0
- package/{esm2020 → esm2022}/public_api.mjs +27 -27
- package/{fesm2020 → fesm2022}/igo2-core.mjs +1364 -1288
- package/fesm2022/igo2-core.mjs.map +1 -0
- package/index.d.ts +5 -5
- package/lib/activity/activity.interceptor.d.ts +11 -11
- package/lib/activity/activity.module.d.ts +8 -8
- package/lib/activity/activity.service.d.ts +11 -11
- package/lib/activity/index.d.ts +2 -2
- package/lib/analytics/index.d.ts +1 -1
- package/lib/analytics/shared/analytics.interface.d.ts +6 -6
- package/lib/analytics/shared/analytics.service.d.ts +23 -23
- package/lib/analytics/shared/index.d.ts +2 -2
- package/lib/compression/compressedData.interface.d.ts +5 -5
- package/lib/compression/compression.service.d.ts +15 -15
- package/lib/compression/index.d.ts +2 -2
- package/lib/config/config.interface.d.ts +6 -6
- package/lib/config/config.module.d.ts +8 -8
- package/lib/config/config.provider.d.ts +15 -15
- package/lib/config/config.service.d.ts +18 -18
- package/lib/config/index.d.ts +3 -3
- package/lib/config/version.d.ts +5 -5
- package/lib/core.module.d.ts +19 -19
- package/lib/gesture/gesture.module.d.ts +9 -9
- package/lib/gesture/gesture.provider.d.ts +7 -7
- package/lib/language/index.d.ts +1 -1
- package/lib/language/language.module.d.ts +9 -9
- package/lib/language/shared/index.d.ts +4 -4
- package/lib/language/shared/language.interface.d.ts +3 -3
- package/lib/language/shared/language.loader.d.ts +11 -11
- package/lib/language/shared/language.provider.d.ts +15 -15
- package/lib/language/shared/language.service.d.ts +13 -13
- package/lib/language/shared/missing-translation.guard.d.ts +4 -4
- package/lib/media/index.d.ts +2 -2
- package/lib/media/media.enum.d.ts +9 -9
- package/lib/media/media.service.d.ts +16 -16
- package/lib/message/index.d.ts +1 -1
- package/lib/message/message.module.d.ts +10 -10
- package/lib/message/message.theming.scss +26 -0
- package/lib/message/shared/index.d.ts +4 -4
- package/lib/message/shared/message.enum.d.ts +8 -8
- package/lib/message/shared/message.interface.d.ts +21 -21
- package/lib/message/shared/message.service.d.ts +31 -31
- package/lib/network/index.d.ts +2 -2
- package/lib/network/network.interfaces.d.ts +3 -3
- package/lib/network/network.service.d.ts +21 -21
- package/lib/regex/index.d.ts +2 -2
- package/lib/regex/regex.interface.d.ts +3 -3
- package/lib/regex/regex.service.d.ts +12 -12
- package/lib/request/error.interceptor.d.ts +14 -14
- package/lib/request/error.module.d.ts +9 -9
- package/lib/request/index.d.ts +2 -2
- package/lib/request/logging.interceptor.d.ts +8 -8
- package/lib/request/logging.module.d.ts +8 -8
- package/lib/route/route.interface.d.ts +23 -23
- package/lib/route/route.service.d.ts +19 -19
- package/lib/storage/index.d.ts +3 -2
- package/lib/storage/storage.d.ts +15 -0
- package/lib/storage/storage.interface.d.ts +20 -20
- package/lib/storage/storage.service.d.ts +10 -19
- package/locale/en.core.json +1 -2
- package/locale/en.json +1 -1205
- package/locale/fr.core.json +1 -2
- package/locale/fr.json +1 -1210
- package/package.json +40 -30
- package/packages.import.scss +4 -0
- package/public_api.d.ts +24 -24
- package/style/all-style.css +793 -0
- package/style/all-style.scss +3 -0
- package/style/layout.scss +163 -0
- package/style/partial/core-utils.scss +5 -0
- package/style/partial/core.variables.scss +1 -1
- package/style/partial/media.scss +80 -80
- package/style/style.css +237 -0
- package/style/style.scss +19 -0
- package/theming/all-theme.scss +14 -0
- package/theming/material-theme-override.scss +39 -0
- package/theming/prebuilt-themes/blue-theme.css +2986 -0
- package/theming/prebuilt-themes/blue-theme.scss +34 -0
- package/theming/prebuilt-themes/bluedark-theme.css +2986 -0
- package/theming/prebuilt-themes/bluedark-theme.scss +67 -0
- package/theming/prebuilt-themes/bluedq-theme.css +2986 -0
- package/theming/prebuilt-themes/bluedq-theme.scss +66 -0
- package/theming/prebuilt-themes/bluegrey-theme.css +2986 -0
- package/theming/prebuilt-themes/bluegrey-theme.scss +25 -0
- package/theming/prebuilt-themes/dark-theme.css +2993 -0
- package/theming/prebuilt-themes/dark-theme.scss +25 -0
- package/theming/prebuilt-themes/deeppurple-theme.css +2986 -0
- package/theming/prebuilt-themes/deeppurple-theme.scss +25 -0
- package/theming/prebuilt-themes/indigo-theme.css +2986 -0
- package/theming/prebuilt-themes/indigo-theme.scss +25 -0
- package/theming/prebuilt-themes/orange-theme.css +2986 -0
- package/theming/prebuilt-themes/orange-theme.scss +25 -0
- package/theming/prebuilt-themes/qcca/_index.scss +2 -0
- package/theming/prebuilt-themes/qcca/base/_index.scss +4 -0
- package/theming/prebuilt-themes/qcca/base/breakpoints.scss +57 -0
- package/theming/prebuilt-themes/qcca/base/colors.scss +40 -0
- package/theming/prebuilt-themes/qcca/base/palette.scss +50 -0
- package/theming/prebuilt-themes/qcca/base/typography/_index.scss +2 -0
- package/theming/prebuilt-themes/qcca/base/typography/typography.scss +138 -0
- package/theming/prebuilt-themes/qcca/base/typography/typography.utils.scss +18 -0
- package/theming/prebuilt-themes/qcca/components/_index.scss +9 -0
- package/theming/prebuilt-themes/qcca/components/_index.theme.scss +5 -0
- package/theming/prebuilt-themes/qcca/components/button.scss +24 -0
- package/theming/prebuilt-themes/qcca/components/dialog.scss +36 -0
- package/theming/prebuilt-themes/qcca/components/form-field.scss +5 -0
- package/theming/prebuilt-themes/qcca/components/input.scss +6 -0
- package/theming/prebuilt-themes/qcca/components/list.scss +24 -0
- package/theming/prebuilt-themes/qcca/components/panel.scss +8 -0
- package/theming/prebuilt-themes/qcca/components/search-bar.scss +41 -0
- package/theming/prebuilt-themes/qcca/components/search-bar.theme.scss +29 -0
- package/theming/prebuilt-themes/qcca-theme.css +3373 -0
- package/theming/prebuilt-themes/qcca-theme.scss +47 -0
- package/theming/prebuilt-themes/teal-theme.css +2986 -0
- package/theming/prebuilt-themes/teal-theme.scss +25 -0
- package/theming/typography.scss +28 -0
- package/theming/utils/_foreground.scss +22 -0
- package/__ivy_ngcc__/locale/en.auth.json +0 -29
- package/__ivy_ngcc__/locale/en.common.json +0 -43
- package/__ivy_ngcc__/locale/en.context.json +0 -199
- package/__ivy_ngcc__/locale/en.core.json +0 -29
- package/__ivy_ngcc__/locale/en.geo.json +0 -805
- package/__ivy_ngcc__/locale/en.integration.json +0 -124
- package/__ivy_ngcc__/locale/en.json +0 -1205
- package/__ivy_ngcc__/locale/fr.auth.json +0 -32
- package/__ivy_ngcc__/locale/fr.common.json +0 -43
- package/__ivy_ngcc__/locale/fr.context.json +0 -199
- package/__ivy_ngcc__/locale/fr.core.json +0 -29
- package/__ivy_ngcc__/locale/fr.geo.json +0 -805
- package/__ivy_ngcc__/locale/fr.integration.json +0 -125
- package/__ivy_ngcc__/locale/fr.json +0 -1210
- package/esm2020/lib/activity/activity.service.mjs +0 -33
- package/esm2020/lib/analytics/shared/analytics.service.mjs +0 -81
- package/esm2020/lib/compression/compression.service.mjs +0 -140
- package/esm2020/lib/config/config.service.mjs +0 -52
- package/esm2020/lib/config/version.mjs +0 -5
- package/esm2020/lib/core.module.mjs +0 -92
- package/esm2020/lib/language/language.module.mjs +0 -39
- package/esm2020/lib/language/shared/language.loader.mjs +0 -26
- package/esm2020/lib/language/shared/language.provider.mjs +0 -22
- package/esm2020/lib/language/shared/language.service.mjs +0 -32
- package/esm2020/lib/media/media.service.mjs +0 -76
- package/esm2020/lib/message/message.module.mjs +0 -56
- package/esm2020/lib/message/shared/message.service.mjs +0 -201
- package/esm2020/lib/network/network.service.mjs +0 -60
- package/esm2020/lib/regex/regex.service.mjs +0 -27
- package/esm2020/lib/request/error.interceptor.mjs +0 -66
- package/esm2020/lib/request/error.module.mjs +0 -39
- package/esm2020/lib/request/logging.interceptor.mjs +0 -29
- package/esm2020/lib/route/route.interface.mjs +0 -2
- package/esm2020/lib/route/route.service.mjs +0 -71
- package/esm2020/lib/storage/index.mjs +0 -3
- package/esm2020/lib/storage/storage.service.mjs +0 -79
- package/fesm2015/igo2-core.mjs +0 -1418
- package/fesm2015/igo2-core.mjs.map +0 -1
- package/fesm2020/igo2-core.mjs.map +0 -1
- package/locale/en.auth.json +0 -29
- package/locale/en.common.json +0 -43
- package/locale/en.context.json +0 -199
- package/locale/en.geo.json +0 -805
- package/locale/en.integration.json +0 -124
- package/locale/fr.auth.json +0 -32
- package/locale/fr.common.json +0 -43
- package/locale/fr.context.json +0 -199
- package/locale/fr.geo.json +0 -805
- package/locale/fr.integration.json +0 -125
- package/style/all.theming.scss +0 -5
- package/style/core.theming.scss +0 -9
- package/style/foreground.scss +0 -20
- package/style/index.theming.scss +0 -1465
- package/style/material.font.scss +0 -10
- package/style/setup.scss +0 -2
- package/style/themes/blue.theme.scss +0 -19
- package/style/themes/bluedark.theme.scss +0 -52
- package/style/themes/bluedq.theme.scss +0 -52
- package/style/themes/bluegrey.theme.scss +0 -16
- package/style/themes/dark.theme.scss +0 -16
- package/style/themes/deeppurple.theme.scss +0 -16
- package/style/themes/indigo.theme.scss +0 -16
- package/style/themes/orange.theme.scss +0 -16
- package/style/themes/qcca.theme.scss +0 -98
- package/style/themes/teal.theme.scss +0 -16
- package/style/theming.scss +0 -5
- package/style/typography.scss +0 -17
|
@@ -1,1363 +1,1439 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Injectable, NgModule, InjectionToken, APP_INITIALIZER, Injector, Inject, Optional, SkipSelf, EventEmitter } from '@angular/core';
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
4
|
-
import
|
|
4
|
+
import * as i1 from '@angular/common/http';
|
|
5
|
+
import { HTTP_INTERCEPTORS, HttpClient, HttpBackend, HttpErrorResponse, HttpClientModule, HttpResponse } from '@angular/common/http';
|
|
6
|
+
import * as i2 from '@angular/platform-browser';
|
|
7
|
+
import { HammerGestureConfig, HAMMER_GESTURE_CONFIG, HammerModule } from '@angular/platform-browser';
|
|
8
|
+
import * as i1$3 from '@angular/material/icon';
|
|
5
9
|
import { finalize, catchError, debounceTime, first, tap, startWith } from 'rxjs/operators';
|
|
6
10
|
import { BehaviorSubject, throwError, forkJoin, map, combineLatest, Observable, fromEvent } from 'rxjs';
|
|
7
11
|
import { uuid, ObjectUtils } from '@igo2/utils';
|
|
8
|
-
import * as i1 from '@ngx-translate/core';
|
|
12
|
+
import * as i1$1 from '@ngx-translate/core';
|
|
9
13
|
import { TranslateLoader, TranslateModule, MissingTranslationHandler } from '@ngx-translate/core';
|
|
10
|
-
import * as i1$
|
|
14
|
+
import * as i1$2 from 'ngx-toastr';
|
|
11
15
|
import { ToastrModule, ToastrService } from 'ngx-toastr';
|
|
12
16
|
import * as i8 from 'ngx-indexed-db';
|
|
13
17
|
import { NgxIndexedDBModule } from 'ngx-indexed-db';
|
|
14
|
-
import * as i1$
|
|
15
|
-
import * as
|
|
16
|
-
import { HammerGestureConfig, HAMMER_GESTURE_CONFIG, HammerModule } from '@angular/platform-browser';
|
|
17
|
-
import * as i1$3 from '@angular/router';
|
|
18
|
-
import * as i1$4 from '@angular/cdk/layout';
|
|
18
|
+
import * as i1$4 from '@angular/router';
|
|
19
|
+
import * as i1$5 from '@angular/cdk/layout';
|
|
19
20
|
import { Breakpoints } from '@angular/cdk/layout';
|
|
20
21
|
|
|
21
|
-
class ActivityService {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
this.ids.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
this.ids.
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}]
|
|
22
|
+
class ActivityService {
|
|
23
|
+
counter$ = new BehaviorSubject(0);
|
|
24
|
+
ids = [];
|
|
25
|
+
constructor() { }
|
|
26
|
+
register() {
|
|
27
|
+
const id = uuid();
|
|
28
|
+
this.ids.push(id);
|
|
29
|
+
this.counter$.next(this.ids.length);
|
|
30
|
+
return id;
|
|
31
|
+
}
|
|
32
|
+
unregister(id) {
|
|
33
|
+
const index = this.ids.indexOf(id);
|
|
34
|
+
if (index === -1) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
this.ids.splice(index, 1);
|
|
38
|
+
this.counter$.next(this.ids.length);
|
|
39
|
+
}
|
|
40
|
+
static ɵfac = function ActivityService_Factory(t) { return new (t || ActivityService)(); };
|
|
41
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ActivityService, factory: ActivityService.ɵfac, providedIn: 'root' });
|
|
42
|
+
}
|
|
43
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActivityService, [{
|
|
44
|
+
type: Injectable,
|
|
45
|
+
args: [{
|
|
46
|
+
providedIn: 'root'
|
|
47
|
+
}]
|
|
48
48
|
}], function () { return []; }, null); })();
|
|
49
49
|
|
|
50
|
-
class ActivityInterceptor {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
50
|
+
class ActivityInterceptor {
|
|
51
|
+
activityService;
|
|
52
|
+
constructor(activityService) {
|
|
53
|
+
this.activityService = activityService;
|
|
54
|
+
}
|
|
55
|
+
intercept(req, next) {
|
|
56
|
+
const activity = req.headers.get('activityInterceptor');
|
|
57
|
+
if (activity) {
|
|
58
|
+
const actReq = req.clone({
|
|
59
|
+
headers: req.headers.delete('activityInterceptor')
|
|
60
|
+
});
|
|
61
|
+
if (activity === 'false') {
|
|
62
|
+
return next.handle(actReq);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const id = this.activityService.register();
|
|
66
|
+
return next.handle(req).pipe(finalize(() => {
|
|
67
|
+
this.activityService.unregister(id);
|
|
68
|
+
}));
|
|
69
|
+
}
|
|
70
|
+
static ɵfac = function ActivityInterceptor_Factory(t) { return new (t || ActivityInterceptor)(i0.ɵɵinject(ActivityService)); };
|
|
71
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ActivityInterceptor, factory: ActivityInterceptor.ɵfac });
|
|
72
|
+
}
|
|
73
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActivityInterceptor, [{
|
|
74
|
+
type: Injectable
|
|
74
75
|
}], function () { return [{ type: ActivityService }]; }, null); })();
|
|
75
76
|
|
|
76
|
-
class IgoActivityModule {
|
|
77
|
-
static forRoot() {
|
|
78
|
-
return {
|
|
79
|
-
ngModule: IgoActivityModule,
|
|
80
|
-
providers: [
|
|
81
|
-
{
|
|
82
|
-
provide: HTTP_INTERCEPTORS,
|
|
83
|
-
useClass: ActivityInterceptor,
|
|
84
|
-
multi: true
|
|
85
|
-
}
|
|
86
|
-
]
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoActivityModule, [{
|
|
94
|
-
type: NgModule,
|
|
95
|
-
args: [{
|
|
96
|
-
imports: [],
|
|
97
|
-
declarations: [],
|
|
98
|
-
exports: []
|
|
99
|
-
}]
|
|
77
|
+
class IgoActivityModule {
|
|
78
|
+
static forRoot() {
|
|
79
|
+
return {
|
|
80
|
+
ngModule: IgoActivityModule,
|
|
81
|
+
providers: [
|
|
82
|
+
{
|
|
83
|
+
provide: HTTP_INTERCEPTORS,
|
|
84
|
+
useClass: ActivityInterceptor,
|
|
85
|
+
multi: true
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
static ɵfac = function IgoActivityModule_Factory(t) { return new (t || IgoActivityModule)(); };
|
|
91
|
+
static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoActivityModule });
|
|
92
|
+
static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({});
|
|
93
|
+
}
|
|
94
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoActivityModule, [{
|
|
95
|
+
type: NgModule,
|
|
96
|
+
args: [{
|
|
97
|
+
imports: [],
|
|
98
|
+
declarations: [],
|
|
99
|
+
exports: []
|
|
100
|
+
}]
|
|
100
101
|
}], null, null); })();
|
|
101
102
|
|
|
102
|
-
const version = {
|
|
103
|
-
lib: '
|
|
104
|
-
releaseDate:
|
|
103
|
+
const version = {
|
|
104
|
+
lib: '16.0.0-rc.0',
|
|
105
|
+
releaseDate: 1695139270215
|
|
105
106
|
};
|
|
106
107
|
|
|
107
|
-
class ConfigService {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
return new Promise((resolve, _reject) => {
|
|
129
|
-
|
|
130
|
-
.get(options.path)
|
|
131
|
-
.pipe(catchError((error) => {
|
|
132
|
-
console.log(`Configuration file ${options.path} could not be read`);
|
|
133
|
-
resolve(true);
|
|
134
|
-
return throwError(error.error || 'Server error');
|
|
135
|
-
}))
|
|
136
|
-
.subscribe((configResponse) => {
|
|
137
|
-
this.config = ObjectUtils.mergeDeep(ObjectUtils.mergeDeep({ version }, baseConfig), configResponse);
|
|
138
|
-
resolve(true);
|
|
139
|
-
});
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ConfigService, [{
|
|
146
|
-
type: Injectable,
|
|
147
|
-
args: [{
|
|
148
|
-
providedIn: 'root'
|
|
149
|
-
}]
|
|
150
|
-
}], function () { return [{ type:
|
|
108
|
+
class ConfigService {
|
|
109
|
+
config = {};
|
|
110
|
+
httpClient;
|
|
111
|
+
constructor(handler) {
|
|
112
|
+
this.httpClient = new HttpClient(handler);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Use to get the data found in config file
|
|
116
|
+
*/
|
|
117
|
+
getConfig(key) {
|
|
118
|
+
return ObjectUtils.resolve(this.config, key);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* This method loads "[path]" to get all config's variables
|
|
122
|
+
*/
|
|
123
|
+
load(options) {
|
|
124
|
+
const baseConfig = options.default || {};
|
|
125
|
+
if (!options.path) {
|
|
126
|
+
this.config = baseConfig;
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
129
|
+
return new Promise((resolve, _reject) => {
|
|
130
|
+
this.httpClient
|
|
131
|
+
.get(options.path)
|
|
132
|
+
.pipe(catchError((error) => {
|
|
133
|
+
console.log(`Configuration file ${options.path} could not be read`);
|
|
134
|
+
resolve(true);
|
|
135
|
+
return throwError(error.error || 'Server error');
|
|
136
|
+
}))
|
|
137
|
+
.subscribe((configResponse) => {
|
|
138
|
+
this.config = ObjectUtils.mergeDeep(ObjectUtils.mergeDeep({ version }, baseConfig), configResponse);
|
|
139
|
+
resolve(true);
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
static ɵfac = function ConfigService_Factory(t) { return new (t || ConfigService)(i0.ɵɵinject(i1.HttpBackend)); };
|
|
144
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ConfigService, factory: ConfigService.ɵfac, providedIn: 'root' });
|
|
145
|
+
}
|
|
146
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ConfigService, [{
|
|
147
|
+
type: Injectable,
|
|
148
|
+
args: [{
|
|
149
|
+
providedIn: 'root'
|
|
150
|
+
}]
|
|
151
|
+
}], function () { return [{ type: i1.HttpBackend }]; }, null); })();
|
|
151
152
|
|
|
152
|
-
let CONFIG_OPTIONS = new InjectionToken('configOptions');
|
|
153
|
-
function provideConfigOptions(options) {
|
|
154
|
-
return {
|
|
155
|
-
provide: CONFIG_OPTIONS,
|
|
156
|
-
useValue: options
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
function configFactory(configService, options) {
|
|
160
|
-
return () => configService.load(options);
|
|
161
|
-
}
|
|
162
|
-
function provideConfigLoader() {
|
|
163
|
-
return {
|
|
164
|
-
provide: APP_INITIALIZER,
|
|
165
|
-
useFactory: configFactory,
|
|
166
|
-
multi: true,
|
|
167
|
-
deps: [ConfigService, CONFIG_OPTIONS]
|
|
168
|
-
};
|
|
153
|
+
let CONFIG_OPTIONS = new InjectionToken('configOptions');
|
|
154
|
+
function provideConfigOptions(options) {
|
|
155
|
+
return {
|
|
156
|
+
provide: CONFIG_OPTIONS,
|
|
157
|
+
useValue: options
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
function configFactory(configService, options) {
|
|
161
|
+
return () => configService.load(options);
|
|
162
|
+
}
|
|
163
|
+
function provideConfigLoader() {
|
|
164
|
+
return {
|
|
165
|
+
provide: APP_INITIALIZER,
|
|
166
|
+
useFactory: configFactory,
|
|
167
|
+
multi: true,
|
|
168
|
+
deps: [ConfigService, CONFIG_OPTIONS]
|
|
169
|
+
};
|
|
169
170
|
}
|
|
170
171
|
|
|
171
|
-
class IgoConfigModule {
|
|
172
|
-
static forRoot() {
|
|
173
|
-
return {
|
|
174
|
-
ngModule: IgoConfigModule,
|
|
175
|
-
providers: [provideConfigOptions({}), provideConfigLoader()]
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoConfigModule, [{
|
|
183
|
-
type: NgModule,
|
|
184
|
-
args: [{
|
|
185
|
-
imports: [],
|
|
186
|
-
declarations: [],
|
|
187
|
-
exports: []
|
|
188
|
-
}]
|
|
172
|
+
class IgoConfigModule {
|
|
173
|
+
static forRoot() {
|
|
174
|
+
return {
|
|
175
|
+
ngModule: IgoConfigModule,
|
|
176
|
+
providers: [provideConfigOptions({}), provideConfigLoader()]
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
static ɵfac = function IgoConfigModule_Factory(t) { return new (t || IgoConfigModule)(); };
|
|
180
|
+
static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoConfigModule });
|
|
181
|
+
static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({});
|
|
182
|
+
}
|
|
183
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoConfigModule, [{
|
|
184
|
+
type: NgModule,
|
|
185
|
+
args: [{
|
|
186
|
+
imports: [],
|
|
187
|
+
declarations: [],
|
|
188
|
+
exports: []
|
|
189
|
+
}]
|
|
189
190
|
}], null, null); })();
|
|
190
191
|
|
|
191
|
-
class LanguageLoader {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
}
|
|
204
|
-
if (
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
}));
|
|
212
|
-
|
|
192
|
+
class LanguageLoader {
|
|
193
|
+
prefix;
|
|
194
|
+
suffix;
|
|
195
|
+
config;
|
|
196
|
+
httpClient;
|
|
197
|
+
constructor(handler, prefix, suffix = '.json', config) {
|
|
198
|
+
this.prefix = prefix;
|
|
199
|
+
this.suffix = suffix;
|
|
200
|
+
this.config = config;
|
|
201
|
+
this.httpClient = new HttpClient(handler);
|
|
202
|
+
}
|
|
203
|
+
getTranslation(lang) {
|
|
204
|
+
const igoLocale$ = this.httpClient.get(`locale/libs_locale/${lang}.json`);
|
|
205
|
+
if (this.config && !this.prefix) {
|
|
206
|
+
const prefix = this.config.getConfig('language.prefix');
|
|
207
|
+
this.prefix = !prefix || Array.isArray(prefix) ? prefix : [prefix];
|
|
208
|
+
}
|
|
209
|
+
if (!this.prefix || this.prefix.length === 0) {
|
|
210
|
+
return igoLocale$;
|
|
211
|
+
}
|
|
212
|
+
const appLocale$ = this.prefix.map((prefix) => this.httpClient.get(`${prefix}${lang}${this.suffix}`));
|
|
213
|
+
const locale$ = forkJoin([igoLocale$, ...appLocale$]);
|
|
214
|
+
return locale$.pipe(map((translations) => {
|
|
215
|
+
return translations.reduce((acc, current) => ObjectUtils.mergeDeep(acc, current), {});
|
|
216
|
+
}));
|
|
217
|
+
}
|
|
213
218
|
}
|
|
214
219
|
|
|
215
|
-
function defaultLanguageLoader(http, config) {
|
|
216
|
-
return new LanguageLoader(http, undefined, undefined, config);
|
|
217
|
-
}
|
|
218
|
-
function provideLanguageLoader(loader) {
|
|
219
|
-
return {
|
|
220
|
-
provide: TranslateLoader,
|
|
221
|
-
useFactory: loader || defaultLanguageLoader,
|
|
222
|
-
deps: [
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
function provideDefaultLanguageLoader(loader) {
|
|
226
|
-
return {
|
|
227
|
-
provide: TranslateLoader,
|
|
228
|
-
useFactory: loader || defaultLanguageLoader,
|
|
229
|
-
deps: [
|
|
230
|
-
};
|
|
220
|
+
function defaultLanguageLoader(http, config) {
|
|
221
|
+
return new LanguageLoader(http, undefined, undefined, config);
|
|
222
|
+
}
|
|
223
|
+
function provideLanguageLoader(loader) {
|
|
224
|
+
return {
|
|
225
|
+
provide: TranslateLoader,
|
|
226
|
+
useFactory: loader || defaultLanguageLoader,
|
|
227
|
+
deps: [HttpBackend]
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
function provideDefaultLanguageLoader(loader) {
|
|
231
|
+
return {
|
|
232
|
+
provide: TranslateLoader,
|
|
233
|
+
useFactory: loader || defaultLanguageLoader,
|
|
234
|
+
deps: [HttpBackend, ConfigService]
|
|
235
|
+
};
|
|
231
236
|
}
|
|
232
237
|
|
|
233
|
-
class IgoMissingTranslationHandler {
|
|
234
|
-
handle(params) {
|
|
235
|
-
if (!params.translateService.langs.length) {
|
|
236
|
-
const error = 'Translations are not yet loaded. \
|
|
237
|
-
Check that the LanguageService is injected.';
|
|
238
|
-
throw new Error(error);
|
|
239
|
-
}
|
|
240
|
-
if (params.key.substr(0, 4) === 'igo.') {
|
|
241
|
-
throw new Error(`The Key "${params.key}" is missing in locale file.`);
|
|
242
|
-
}
|
|
243
|
-
else {
|
|
244
|
-
return params.key;
|
|
245
|
-
}
|
|
246
|
-
}
|
|
238
|
+
class IgoMissingTranslationHandler {
|
|
239
|
+
handle(params) {
|
|
240
|
+
if (!params.translateService.langs.length) {
|
|
241
|
+
const error = 'Translations are not yet loaded. \
|
|
242
|
+
Check that the LanguageService is injected.';
|
|
243
|
+
throw new Error(error);
|
|
244
|
+
}
|
|
245
|
+
if (params.key.substr(0, 4) === 'igo.') {
|
|
246
|
+
throw new Error(`The Key "${params.key}" is missing in locale file.`);
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
return params.key;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
247
252
|
}
|
|
248
253
|
|
|
249
|
-
class IgoLanguageModule {
|
|
250
|
-
static forRoot() {
|
|
251
|
-
return {
|
|
252
|
-
ngModule: IgoLanguageModule,
|
|
253
|
-
providers: [provideDefaultLanguageLoader()]
|
|
254
|
-
};
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoLanguageModule, [{
|
|
266
|
-
type: NgModule,
|
|
267
|
-
args: [{
|
|
268
|
-
imports: [
|
|
269
|
-
TranslateModule.forRoot({
|
|
270
|
-
missingTranslationHandler: {
|
|
271
|
-
provide: MissingTranslationHandler,
|
|
272
|
-
useClass: IgoMissingTranslationHandler
|
|
273
|
-
}
|
|
274
|
-
})
|
|
275
|
-
],
|
|
276
|
-
declarations: [],
|
|
277
|
-
exports: [TranslateModule]
|
|
278
|
-
}]
|
|
279
|
-
}], null, null); })();
|
|
280
|
-
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(IgoLanguageModule, { imports: [i1.TranslateModule], exports: [TranslateModule] }); })();
|
|
254
|
+
class IgoLanguageModule {
|
|
255
|
+
static forRoot() {
|
|
256
|
+
return {
|
|
257
|
+
ngModule: IgoLanguageModule,
|
|
258
|
+
providers: [provideDefaultLanguageLoader()]
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
static ɵfac = function IgoLanguageModule_Factory(t) { return new (t || IgoLanguageModule)(); };
|
|
262
|
+
static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoLanguageModule });
|
|
263
|
+
static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [TranslateModule.forRoot({
|
|
264
|
+
missingTranslationHandler: {
|
|
265
|
+
provide: MissingTranslationHandler,
|
|
266
|
+
useClass: IgoMissingTranslationHandler
|
|
267
|
+
}
|
|
268
|
+
}), TranslateModule] });
|
|
269
|
+
}
|
|
270
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoLanguageModule, [{
|
|
271
|
+
type: NgModule,
|
|
272
|
+
args: [{
|
|
273
|
+
imports: [
|
|
274
|
+
TranslateModule.forRoot({
|
|
275
|
+
missingTranslationHandler: {
|
|
276
|
+
provide: MissingTranslationHandler,
|
|
277
|
+
useClass: IgoMissingTranslationHandler
|
|
278
|
+
}
|
|
279
|
+
})
|
|
280
|
+
],
|
|
281
|
+
declarations: [],
|
|
282
|
+
exports: [TranslateModule]
|
|
283
|
+
}]
|
|
284
|
+
}], null, null); })();
|
|
285
|
+
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(IgoLanguageModule, { imports: [i1$1.TranslateModule], exports: [TranslateModule] }); })();
|
|
281
286
|
|
|
282
|
-
class IgoMessageModule {
|
|
283
|
-
static forRoot() {
|
|
284
|
-
return {
|
|
285
|
-
ngModule: IgoMessageModule,
|
|
286
|
-
providers: []
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
287
|
+
class IgoMessageModule {
|
|
288
|
+
static forRoot() {
|
|
289
|
+
return {
|
|
290
|
+
ngModule: IgoMessageModule,
|
|
291
|
+
providers: []
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
static ɵfac = function IgoMessageModule_Factory(t) { return new (t || IgoMessageModule)(); };
|
|
295
|
+
static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoMessageModule });
|
|
296
|
+
static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule,
|
|
297
|
+
ToastrModule.forRoot({
|
|
298
|
+
positionClass: 'toast-bottom-right',
|
|
299
|
+
timeOut: 10000,
|
|
300
|
+
extendedTimeOut: 10000,
|
|
301
|
+
titleClass: 'mat-subtitle-2',
|
|
302
|
+
messageClass: 'toast-message',
|
|
303
|
+
closeButton: true,
|
|
304
|
+
progressBar: true,
|
|
305
|
+
enableHtml: true,
|
|
306
|
+
tapToDismiss: true,
|
|
307
|
+
maxOpened: 4,
|
|
308
|
+
preventDuplicates: true,
|
|
309
|
+
resetTimeoutOnDuplicate: true,
|
|
310
|
+
countDuplicates: false,
|
|
311
|
+
includeTitleDuplicates: true
|
|
312
|
+
})] });
|
|
313
|
+
}
|
|
314
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoMessageModule, [{
|
|
315
|
+
type: NgModule,
|
|
316
|
+
args: [{
|
|
317
|
+
imports: [
|
|
318
|
+
CommonModule,
|
|
319
|
+
ToastrModule.forRoot({
|
|
320
|
+
positionClass: 'toast-bottom-right',
|
|
321
|
+
timeOut: 10000,
|
|
322
|
+
extendedTimeOut: 10000,
|
|
323
|
+
titleClass: 'mat-subtitle-2',
|
|
324
|
+
messageClass: 'toast-message',
|
|
325
|
+
closeButton: true,
|
|
326
|
+
progressBar: true,
|
|
327
|
+
enableHtml: true,
|
|
328
|
+
tapToDismiss: true,
|
|
329
|
+
maxOpened: 4,
|
|
330
|
+
preventDuplicates: true,
|
|
331
|
+
resetTimeoutOnDuplicate: true,
|
|
332
|
+
countDuplicates: false,
|
|
333
|
+
includeTitleDuplicates: true
|
|
334
|
+
})
|
|
335
|
+
],
|
|
336
|
+
declarations: [],
|
|
337
|
+
exports: []
|
|
338
|
+
}]
|
|
339
|
+
}], null, null); })();
|
|
340
|
+
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(IgoMessageModule, { imports: [CommonModule, i1$2.ToastrModule] }); })();
|
|
332
341
|
|
|
333
|
-
var MessageType;
|
|
334
|
-
(function (MessageType) {
|
|
335
|
-
MessageType["ERROR"] = "error";
|
|
336
|
-
MessageType["ALERT"] = "warning";
|
|
337
|
-
MessageType["WARNING"] = "warning";
|
|
338
|
-
MessageType["INFO"] = "info";
|
|
339
|
-
MessageType["SUCCESS"] = "success";
|
|
340
|
-
MessageType["SHOW"] = "show";
|
|
342
|
+
var MessageType;
|
|
343
|
+
(function (MessageType) {
|
|
344
|
+
MessageType["ERROR"] = "error";
|
|
345
|
+
MessageType["ALERT"] = "warning";
|
|
346
|
+
MessageType["WARNING"] = "warning";
|
|
347
|
+
MessageType["INFO"] = "info";
|
|
348
|
+
MessageType["SUCCESS"] = "success";
|
|
349
|
+
MessageType["SHOW"] = "show";
|
|
341
350
|
})(MessageType || (MessageType = {}));
|
|
342
351
|
|
|
343
|
-
class LanguageService {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
this.translate.
|
|
350
|
-
this.
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
352
|
+
class LanguageService {
|
|
353
|
+
translate;
|
|
354
|
+
language;
|
|
355
|
+
language$ = new BehaviorSubject(undefined);
|
|
356
|
+
constructor(translate) {
|
|
357
|
+
this.translate = translate;
|
|
358
|
+
this.language = this.translate.getBrowserLang();
|
|
359
|
+
const lang = this.getLanguage();
|
|
360
|
+
this.translate.setDefaultLang(lang);
|
|
361
|
+
this.language$.next(lang);
|
|
362
|
+
}
|
|
363
|
+
getLanguage() {
|
|
364
|
+
return this.language.match(/en|fr/) ? this.language : 'en';
|
|
365
|
+
}
|
|
366
|
+
setLanguage(language) {
|
|
367
|
+
this.language = language.match(/en|fr/) ? language : 'en';
|
|
368
|
+
combineLatest([
|
|
369
|
+
this.translate.use(this.language),
|
|
370
|
+
this.translate.reloadLang(this.language)
|
|
371
|
+
]).subscribe(() => {
|
|
372
|
+
this.language$.next(this.language);
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
static ɵfac = function LanguageService_Factory(t) { return new (t || LanguageService)(i0.ɵɵinject(i1$1.TranslateService)); };
|
|
376
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: LanguageService, factory: LanguageService.ɵfac, providedIn: 'root' });
|
|
377
|
+
}
|
|
378
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LanguageService, [{
|
|
379
|
+
type: Injectable,
|
|
380
|
+
args: [{
|
|
381
|
+
providedIn: 'root'
|
|
382
|
+
}]
|
|
383
|
+
}], function () { return [{ type: i1$1.TranslateService }]; }, null); })();
|
|
370
384
|
|
|
371
|
-
class MessageService {
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
this.
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
}
|
|
396
|
-
if (activeMessageTranslation.
|
|
397
|
-
Object.keys(activeMessageTranslation.
|
|
398
|
-
if (k) {
|
|
399
|
-
|
|
400
|
-
this.languageService.translate.instant(activeMessageTranslation.
|
|
401
|
-
}
|
|
402
|
-
});
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
(
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
385
|
+
class MessageService {
|
|
386
|
+
injector;
|
|
387
|
+
configService;
|
|
388
|
+
languageService;
|
|
389
|
+
messages$ = new BehaviorSubject([]);
|
|
390
|
+
options;
|
|
391
|
+
activeMessageTranslations = [];
|
|
392
|
+
constructor(injector, configService, languageService) {
|
|
393
|
+
this.injector = injector;
|
|
394
|
+
this.configService = configService;
|
|
395
|
+
this.languageService = languageService;
|
|
396
|
+
this.options = this.configService.getConfig('message');
|
|
397
|
+
this.languageService.language$.pipe(debounceTime(500)).subscribe((r) => {
|
|
398
|
+
if (this.toastr.toasts.length === 0) {
|
|
399
|
+
this.activeMessageTranslations = [];
|
|
400
|
+
}
|
|
401
|
+
this.toastr.toasts.map((toast) => {
|
|
402
|
+
const activeMessageTranslation = this.activeMessageTranslations.find((amt) => amt.id === toast.toastId);
|
|
403
|
+
if (activeMessageTranslation) {
|
|
404
|
+
const translatedTextInterpolateParams = {
|
|
405
|
+
...activeMessageTranslation.textInterpolateParams
|
|
406
|
+
};
|
|
407
|
+
const translatedTitleInterpolateParams = {
|
|
408
|
+
...activeMessageTranslation.titleInterpolateParams
|
|
409
|
+
};
|
|
410
|
+
if (activeMessageTranslation.textInterpolateParams) {
|
|
411
|
+
Object.keys(activeMessageTranslation.textInterpolateParams).map((k) => {
|
|
412
|
+
if (k) {
|
|
413
|
+
translatedTextInterpolateParams[k] =
|
|
414
|
+
this.languageService.translate.instant(activeMessageTranslation.textInterpolateParams[k]);
|
|
415
|
+
}
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
if (activeMessageTranslation.titleInterpolateParams) {
|
|
419
|
+
Object.keys(activeMessageTranslation.titleInterpolateParams).map((k) => {
|
|
420
|
+
if (k) {
|
|
421
|
+
translatedTitleInterpolateParams[k] =
|
|
422
|
+
this.languageService.translate.instant(activeMessageTranslation.titleInterpolateParams[k]);
|
|
423
|
+
}
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
forkJoin([
|
|
427
|
+
this.languageService.translate.get(activeMessageTranslation.textKey, translatedTextInterpolateParams),
|
|
428
|
+
this.languageService.translate.get(activeMessageTranslation.titleKey, translatedTitleInterpolateParams)
|
|
429
|
+
])
|
|
430
|
+
.pipe(first())
|
|
431
|
+
.subscribe((res) => {
|
|
432
|
+
toast.toastRef.componentInstance.message = res[0];
|
|
433
|
+
toast.toastRef.componentInstance.title = res[1];
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
});
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
get toastr() {
|
|
440
|
+
return this.injector.get(ToastrService);
|
|
441
|
+
}
|
|
442
|
+
showError(httpError) {
|
|
443
|
+
httpError.error.caught = true;
|
|
444
|
+
return this.error(httpError.error.message, httpError.error.title);
|
|
445
|
+
}
|
|
446
|
+
message(message) {
|
|
447
|
+
const messageType = message.type;
|
|
448
|
+
this.toastr.toastrConfig.iconClasses[messageType] = `toast-${messageType}`;
|
|
449
|
+
this.messages$.next(this.messages$.value.concat([message]));
|
|
450
|
+
message.options = message.options || {};
|
|
451
|
+
const currentDate = new Date();
|
|
452
|
+
message.options.from = message.options.from
|
|
453
|
+
? message.options.from
|
|
454
|
+
: new Date('1 jan 1900');
|
|
455
|
+
message.options.to = message.options.to
|
|
456
|
+
? message.options.to
|
|
457
|
+
: new Date('1 jan 3000');
|
|
458
|
+
if (typeof message.options.from === 'string') {
|
|
459
|
+
message.options.from = new Date(Date.parse(message.options.from.replace(/-/g, ' ')));
|
|
460
|
+
}
|
|
461
|
+
if (typeof message.options.to === 'string') {
|
|
462
|
+
message.options.to = new Date(Date.parse(message.options.to.replace(/-/g, ' ')));
|
|
463
|
+
}
|
|
464
|
+
if (currentDate > message.options.from &&
|
|
465
|
+
currentDate < message.options.to) {
|
|
466
|
+
if (message.showIcon === false) {
|
|
467
|
+
this.toastr.toastrConfig.iconClasses[messageType] = `toast-${messageType} toast-no-icon`;
|
|
468
|
+
}
|
|
469
|
+
message = this.handleTemplate(message);
|
|
470
|
+
if (message.text) {
|
|
471
|
+
let messageShown;
|
|
472
|
+
switch (message.type) {
|
|
473
|
+
case MessageType.SUCCESS:
|
|
474
|
+
messageShown = this.success(message.text, message.title, message.options, message.textInterpolateParams, message.titleInterpolateParams);
|
|
475
|
+
break;
|
|
476
|
+
case MessageType.ERROR:
|
|
477
|
+
messageShown = this.error(message.text, message.title, message.options, message.textInterpolateParams, message.titleInterpolateParams);
|
|
478
|
+
break;
|
|
479
|
+
case MessageType.INFO:
|
|
480
|
+
messageShown = this.info(message.text, message.title, message.options, message.textInterpolateParams, message.titleInterpolateParams);
|
|
481
|
+
break;
|
|
482
|
+
case MessageType.SHOW:
|
|
483
|
+
messageShown = this.show(message.text, message.title, message.options, message.textInterpolateParams, message.titleInterpolateParams);
|
|
484
|
+
break;
|
|
485
|
+
case MessageType.ALERT:
|
|
486
|
+
case MessageType.WARNING:
|
|
487
|
+
messageShown = this.alert(message.text, message.title, message.options, message.textInterpolateParams, message.titleInterpolateParams);
|
|
488
|
+
break;
|
|
489
|
+
default:
|
|
490
|
+
messageShown = this.info(message.text, message.title, message.options, message.textInterpolateParams, message.titleInterpolateParams);
|
|
491
|
+
break;
|
|
492
|
+
}
|
|
493
|
+
message.options.id = messageShown.toastId;
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
success(text, title = 'igo.core.message.success', options = {}, textInterpolateParams, titleInterpolateParams) {
|
|
498
|
+
return this.handleNgxToastr('success', text, title, options, textInterpolateParams, titleInterpolateParams);
|
|
499
|
+
}
|
|
500
|
+
error(text, title = 'igo.core.message.error', options = {}, textInterpolateParams, titleInterpolateParams) {
|
|
501
|
+
return this.handleNgxToastr('error', text, title, options, textInterpolateParams, titleInterpolateParams);
|
|
502
|
+
}
|
|
503
|
+
info(text, title = 'igo.core.message.info', options = {}, textInterpolateParams, titleInterpolateParams) {
|
|
504
|
+
return this.handleNgxToastr('info', text, title, options, textInterpolateParams, titleInterpolateParams);
|
|
505
|
+
}
|
|
506
|
+
alert(text, title = 'igo.core.message.alert', options = {}, textInterpolateParams, titleInterpolateParams) {
|
|
507
|
+
return this.handleNgxToastr('alert', text, title, options, textInterpolateParams, titleInterpolateParams);
|
|
508
|
+
}
|
|
509
|
+
show(text, title = 'igo.core.message.info', options = {}, textInterpolateParams, titleInterpolateParams) {
|
|
510
|
+
return this.handleNgxToastr('show', text, title, options, textInterpolateParams, titleInterpolateParams);
|
|
511
|
+
}
|
|
512
|
+
handleNgxToastr(type, text, title, options = {}, textInterpolateParams, titleInterpolateParams) {
|
|
513
|
+
const translatedTextInterpolateParams = { ...textInterpolateParams };
|
|
514
|
+
const translatedTitlenterpolateParams = { ...titleInterpolateParams };
|
|
515
|
+
if (textInterpolateParams) {
|
|
516
|
+
Object.keys(textInterpolateParams).map((k) => {
|
|
517
|
+
if (textInterpolateParams[k]) {
|
|
518
|
+
translatedTextInterpolateParams[k] =
|
|
519
|
+
this.languageService.translate.instant(textInterpolateParams[k]);
|
|
520
|
+
}
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
if (titleInterpolateParams) {
|
|
524
|
+
Object.keys(titleInterpolateParams).map((k) => {
|
|
525
|
+
if (k) {
|
|
526
|
+
translatedTitlenterpolateParams[k] =
|
|
527
|
+
this.languageService.translate.instant(titleInterpolateParams[k]);
|
|
528
|
+
}
|
|
529
|
+
});
|
|
530
|
+
}
|
|
531
|
+
const message = this.languageService.translate.instant(text, translatedTextInterpolateParams);
|
|
532
|
+
const translatedTitle = this.languageService.translate.instant(title, translatedTitlenterpolateParams);
|
|
533
|
+
let activeToast;
|
|
534
|
+
switch (type) {
|
|
535
|
+
case 'success':
|
|
536
|
+
activeToast = this.toastr.success(message, translatedTitle, options);
|
|
537
|
+
break;
|
|
538
|
+
case 'error':
|
|
539
|
+
activeToast = this.toastr.error(message, translatedTitle, options);
|
|
540
|
+
break;
|
|
541
|
+
case 'show':
|
|
542
|
+
case 'info':
|
|
543
|
+
activeToast = this.toastr.info(message, translatedTitle, options);
|
|
544
|
+
break;
|
|
545
|
+
case 'alert':
|
|
546
|
+
activeToast = this.toastr.warning(message, translatedTitle, options);
|
|
547
|
+
break;
|
|
548
|
+
}
|
|
549
|
+
this.activeMessageTranslations.push({
|
|
550
|
+
id: activeToast.toastId,
|
|
551
|
+
titleKey: title,
|
|
552
|
+
textKey: text,
|
|
553
|
+
textInterpolateParams,
|
|
554
|
+
titleInterpolateParams
|
|
555
|
+
});
|
|
556
|
+
return activeToast;
|
|
557
|
+
}
|
|
558
|
+
remove(id) {
|
|
559
|
+
this.toastr.remove(id);
|
|
560
|
+
}
|
|
561
|
+
removeAllAreNotError() {
|
|
562
|
+
for (const mess of this.messages$.value) {
|
|
563
|
+
if (mess.type !== MessageType.ERROR) {
|
|
564
|
+
this.remove(mess.options.id);
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
handleTemplate(message) {
|
|
569
|
+
if (!this.options?.template || message.html) {
|
|
570
|
+
return message;
|
|
571
|
+
}
|
|
572
|
+
let html = this.options?.template;
|
|
573
|
+
html = html.replace('${text}', message.text);
|
|
574
|
+
html = html.replace('${title}', message.title);
|
|
575
|
+
message.html = undefined;
|
|
576
|
+
message.text = html;
|
|
577
|
+
message.title = undefined;
|
|
578
|
+
return message;
|
|
579
|
+
}
|
|
580
|
+
static ɵfac = function MessageService_Factory(t) { return new (t || MessageService)(i0.ɵɵinject(Injector), i0.ɵɵinject(ConfigService), i0.ɵɵinject(LanguageService)); };
|
|
581
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: MessageService, factory: MessageService.ɵfac, providedIn: 'root' });
|
|
582
|
+
}
|
|
583
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MessageService, [{
|
|
584
|
+
type: Injectable,
|
|
585
|
+
args: [{
|
|
586
|
+
providedIn: 'root'
|
|
587
|
+
}]
|
|
588
|
+
}], function () { return [{ type: i0.Injector, decorators: [{
|
|
589
|
+
type: Inject,
|
|
590
|
+
args: [Injector]
|
|
562
591
|
}] }, { type: ConfigService }, { type: LanguageService }]; }, null); })();
|
|
563
592
|
|
|
564
|
-
class ErrorInterceptor {
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
const
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
this.
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
errorObj
|
|
586
|
-
errorObj.
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
messageService
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
593
|
+
class ErrorInterceptor {
|
|
594
|
+
injector;
|
|
595
|
+
constructor(injector) {
|
|
596
|
+
this.injector = injector;
|
|
597
|
+
}
|
|
598
|
+
intercept(originalReq, next) {
|
|
599
|
+
const interceptError = originalReq.headers.get('interceptError');
|
|
600
|
+
const req = originalReq.clone({
|
|
601
|
+
headers: originalReq.headers.delete('interceptError')
|
|
602
|
+
});
|
|
603
|
+
if (interceptError === 'false') {
|
|
604
|
+
return next.handle(req);
|
|
605
|
+
}
|
|
606
|
+
const errorContainer = { httpError: undefined };
|
|
607
|
+
return next.handle(req).pipe(catchError((error) => this.handleError(error, errorContainer)), finalize(() => {
|
|
608
|
+
this.handleCaughtError(errorContainer);
|
|
609
|
+
this.handleUncaughtError(errorContainer);
|
|
610
|
+
}));
|
|
611
|
+
}
|
|
612
|
+
handleError(httpError, errorContainer) {
|
|
613
|
+
if (httpError instanceof HttpErrorResponse) {
|
|
614
|
+
const errorObj = httpError.error === 'object' ? httpError.error : {};
|
|
615
|
+
errorObj.message = httpError.error?.message || httpError.statusText;
|
|
616
|
+
errorObj.caught = false;
|
|
617
|
+
httpError = new HttpErrorResponse({
|
|
618
|
+
error: errorObj,
|
|
619
|
+
headers: httpError.headers,
|
|
620
|
+
status: httpError.status,
|
|
621
|
+
statusText: httpError.statusText,
|
|
622
|
+
url: httpError.url
|
|
623
|
+
});
|
|
624
|
+
}
|
|
625
|
+
errorContainer.httpError = httpError;
|
|
626
|
+
return throwError(httpError);
|
|
627
|
+
}
|
|
628
|
+
handleCaughtError(errorContainer) {
|
|
629
|
+
const httpError = errorContainer.httpError;
|
|
630
|
+
if (httpError && httpError.error.toDisplay) {
|
|
631
|
+
httpError.error.caught = true;
|
|
632
|
+
const messageService = this.injector.get(MessageService);
|
|
633
|
+
messageService.error(httpError.error.message, httpError.error.title);
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
handleUncaughtError(errorContainer) {
|
|
637
|
+
const httpError = errorContainer.httpError;
|
|
638
|
+
if (httpError && !httpError.error.caught) {
|
|
639
|
+
const messageService = this.injector.get(MessageService);
|
|
640
|
+
httpError.error.caught = true;
|
|
641
|
+
messageService.error('igo.core.errors.uncaught.message', 'igo.core.errors.uncaught.title');
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
static ɵfac = function ErrorInterceptor_Factory(t) { return new (t || ErrorInterceptor)(i0.ɵɵinject(i0.Injector)); };
|
|
645
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ErrorInterceptor, factory: ErrorInterceptor.ɵfac, providedIn: 'root' });
|
|
646
|
+
}
|
|
647
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ErrorInterceptor, [{
|
|
648
|
+
type: Injectable,
|
|
649
|
+
args: [{
|
|
650
|
+
providedIn: 'root'
|
|
651
|
+
}]
|
|
622
652
|
}], function () { return [{ type: i0.Injector }]; }, null); })();
|
|
623
653
|
|
|
624
|
-
class IgoErrorModule {
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
}
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoErrorModule, [{
|
|
647
|
-
type: NgModule,
|
|
648
|
-
args: [{
|
|
649
|
-
imports: [],
|
|
650
|
-
declarations: [],
|
|
651
|
-
exports: []
|
|
652
|
-
}]
|
|
653
|
-
}], function () { return [{ type: IgoErrorModule, decorators: [{
|
|
654
|
-
type: Optional
|
|
655
|
-
}, {
|
|
656
|
-
type: SkipSelf
|
|
654
|
+
class IgoErrorModule {
|
|
655
|
+
static forRoot() {
|
|
656
|
+
return {
|
|
657
|
+
ngModule: IgoErrorModule,
|
|
658
|
+
providers: [
|
|
659
|
+
{
|
|
660
|
+
provide: HTTP_INTERCEPTORS,
|
|
661
|
+
useClass: ErrorInterceptor,
|
|
662
|
+
multi: true
|
|
663
|
+
}
|
|
664
|
+
]
|
|
665
|
+
};
|
|
666
|
+
}
|
|
667
|
+
constructor(parentModule) {
|
|
668
|
+
if (parentModule) {
|
|
669
|
+
throw new Error('IgoErrorModule is already loaded. Import it in the AppModule only');
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
static ɵfac = function IgoErrorModule_Factory(t) { return new (t || IgoErrorModule)(i0.ɵɵinject(IgoErrorModule, 12)); };
|
|
673
|
+
static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoErrorModule });
|
|
674
|
+
static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({});
|
|
675
|
+
}
|
|
676
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoErrorModule, [{
|
|
677
|
+
type: NgModule,
|
|
678
|
+
args: [{
|
|
679
|
+
imports: [],
|
|
680
|
+
declarations: [],
|
|
681
|
+
exports: []
|
|
682
|
+
}]
|
|
683
|
+
}], function () { return [{ type: IgoErrorModule, decorators: [{
|
|
684
|
+
type: Optional
|
|
685
|
+
}, {
|
|
686
|
+
type: SkipSelf
|
|
657
687
|
}] }]; }, null); })();
|
|
658
688
|
|
|
659
|
-
const dbConfig = {
|
|
660
|
-
name: 'igo2DB',
|
|
661
|
-
version: 2,
|
|
662
|
-
objectStoresMeta: [
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
{
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
}
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
(
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
689
|
+
const dbConfig = {
|
|
690
|
+
name: 'igo2DB',
|
|
691
|
+
version: 2,
|
|
692
|
+
objectStoresMeta: [
|
|
693
|
+
{
|
|
694
|
+
store: 'geoData',
|
|
695
|
+
storeConfig: { keyPath: 'url', autoIncrement: false },
|
|
696
|
+
storeSchema: [
|
|
697
|
+
{ name: 'regionID', keypath: 'regionID', options: { unique: false } }
|
|
698
|
+
]
|
|
699
|
+
},
|
|
700
|
+
{
|
|
701
|
+
store: 'layerData',
|
|
702
|
+
storeConfig: { keyPath: 'layerId', autoIncrement: false },
|
|
703
|
+
storeSchema: [
|
|
704
|
+
{
|
|
705
|
+
name: 'layerOptions',
|
|
706
|
+
keypath: 'layerOptions',
|
|
707
|
+
options: { unique: false }
|
|
708
|
+
},
|
|
709
|
+
{
|
|
710
|
+
name: 'sourceOptions',
|
|
711
|
+
keypath: 'sourceOptions',
|
|
712
|
+
options: { unique: false }
|
|
713
|
+
}
|
|
714
|
+
]
|
|
715
|
+
}
|
|
716
|
+
]
|
|
717
|
+
};
|
|
718
|
+
class IgoCoreModule {
|
|
719
|
+
static forRoot() {
|
|
720
|
+
return {
|
|
721
|
+
ngModule: IgoCoreModule,
|
|
722
|
+
providers: []
|
|
723
|
+
};
|
|
724
|
+
}
|
|
725
|
+
constructor(matIconRegistry, domSanitizer) {
|
|
726
|
+
matIconRegistry.addSvgIconSet(domSanitizer.bypassSecurityTrustResourceUrl('./assets/igo2/core/icons/mdi.svg'));
|
|
727
|
+
}
|
|
728
|
+
static ɵfac = function IgoCoreModule_Factory(t) { return new (t || IgoCoreModule)(i0.ɵɵinject(i1$3.MatIconRegistry), i0.ɵɵinject(i2.DomSanitizer)); };
|
|
729
|
+
static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoCoreModule });
|
|
730
|
+
static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule,
|
|
731
|
+
HttpClientModule,
|
|
732
|
+
IgoActivityModule.forRoot(),
|
|
733
|
+
IgoConfigModule.forRoot(),
|
|
734
|
+
IgoErrorModule.forRoot(),
|
|
735
|
+
IgoLanguageModule.forRoot(),
|
|
736
|
+
IgoMessageModule.forRoot(),
|
|
737
|
+
NgxIndexedDBModule.forRoot(dbConfig), IgoActivityModule,
|
|
738
|
+
IgoConfigModule,
|
|
739
|
+
IgoErrorModule,
|
|
740
|
+
IgoLanguageModule,
|
|
741
|
+
IgoMessageModule] });
|
|
742
|
+
}
|
|
743
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoCoreModule, [{
|
|
744
|
+
type: NgModule,
|
|
745
|
+
args: [{
|
|
746
|
+
imports: [
|
|
747
|
+
CommonModule,
|
|
748
|
+
HttpClientModule,
|
|
749
|
+
IgoActivityModule.forRoot(),
|
|
750
|
+
IgoConfigModule.forRoot(),
|
|
751
|
+
IgoErrorModule.forRoot(),
|
|
752
|
+
IgoLanguageModule.forRoot(),
|
|
753
|
+
IgoMessageModule.forRoot(),
|
|
754
|
+
NgxIndexedDBModule.forRoot(dbConfig)
|
|
755
|
+
],
|
|
756
|
+
declarations: [],
|
|
757
|
+
exports: [
|
|
758
|
+
IgoActivityModule,
|
|
759
|
+
IgoConfigModule,
|
|
760
|
+
IgoErrorModule,
|
|
761
|
+
IgoLanguageModule,
|
|
762
|
+
IgoMessageModule
|
|
763
|
+
]
|
|
764
|
+
}]
|
|
765
|
+
}], function () { return [{ type: i1$3.MatIconRegistry }, { type: i2.DomSanitizer }]; }, null); })();
|
|
766
|
+
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(IgoCoreModule, { imports: [CommonModule,
|
|
767
|
+
HttpClientModule, IgoActivityModule, IgoConfigModule, IgoErrorModule, IgoLanguageModule, IgoMessageModule, i8.NgxIndexedDBModule], exports: [IgoActivityModule,
|
|
768
|
+
IgoConfigModule,
|
|
769
|
+
IgoErrorModule,
|
|
770
|
+
IgoLanguageModule,
|
|
731
771
|
IgoMessageModule] }); })();
|
|
732
772
|
|
|
733
|
-
class IgoGestureConfig extends HammerGestureConfig {
|
|
734
|
-
buildHammer(element) {
|
|
735
|
-
const mc = super.buildHammer(element);
|
|
736
|
-
mc.set({ touchAction: 'pan-y' });
|
|
737
|
-
return mc;
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoGestureConfig, [{
|
|
743
|
-
type: Injectable
|
|
773
|
+
class IgoGestureConfig extends HammerGestureConfig {
|
|
774
|
+
buildHammer(element) {
|
|
775
|
+
const mc = super.buildHammer(element);
|
|
776
|
+
mc.set({ touchAction: 'pan-y' });
|
|
777
|
+
return mc;
|
|
778
|
+
}
|
|
779
|
+
static ɵfac = /*@__PURE__*/ function () { let ɵIgoGestureConfig_BaseFactory; return function IgoGestureConfig_Factory(t) { return (ɵIgoGestureConfig_BaseFactory || (ɵIgoGestureConfig_BaseFactory = i0.ɵɵgetInheritedFactory(IgoGestureConfig)))(t || IgoGestureConfig); }; }();
|
|
780
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: IgoGestureConfig, factory: IgoGestureConfig.ɵfac });
|
|
781
|
+
}
|
|
782
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoGestureConfig, [{
|
|
783
|
+
type: Injectable
|
|
744
784
|
}], null, null); })();
|
|
745
785
|
|
|
746
|
-
class IgoGestureModule {
|
|
747
|
-
static forRoot() {
|
|
748
|
-
return {
|
|
749
|
-
ngModule: IgoGestureModule,
|
|
750
|
-
providers: [
|
|
751
|
-
{
|
|
752
|
-
provide: HAMMER_GESTURE_CONFIG,
|
|
753
|
-
useClass: IgoGestureConfig
|
|
754
|
-
}
|
|
755
|
-
]
|
|
756
|
-
};
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoGestureModule, [{
|
|
763
|
-
type: NgModule,
|
|
764
|
-
args: [{
|
|
765
|
-
imports: [HammerModule],
|
|
766
|
-
declarations: [],
|
|
767
|
-
exports: []
|
|
768
|
-
}]
|
|
769
|
-
}], null, null); })();
|
|
786
|
+
class IgoGestureModule {
|
|
787
|
+
static forRoot() {
|
|
788
|
+
return {
|
|
789
|
+
ngModule: IgoGestureModule,
|
|
790
|
+
providers: [
|
|
791
|
+
{
|
|
792
|
+
provide: HAMMER_GESTURE_CONFIG,
|
|
793
|
+
useClass: IgoGestureConfig
|
|
794
|
+
}
|
|
795
|
+
]
|
|
796
|
+
};
|
|
797
|
+
}
|
|
798
|
+
static ɵfac = function IgoGestureModule_Factory(t) { return new (t || IgoGestureModule)(); };
|
|
799
|
+
static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoGestureModule });
|
|
800
|
+
static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [HammerModule] });
|
|
801
|
+
}
|
|
802
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoGestureModule, [{
|
|
803
|
+
type: NgModule,
|
|
804
|
+
args: [{
|
|
805
|
+
imports: [HammerModule],
|
|
806
|
+
declarations: [],
|
|
807
|
+
exports: []
|
|
808
|
+
}]
|
|
809
|
+
}], null, null); })();
|
|
770
810
|
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(IgoGestureModule, { imports: [HammerModule] }); })();
|
|
771
811
|
|
|
772
|
-
class LoggingInterceptor {
|
|
773
|
-
intercept(req, next) {
|
|
774
|
-
const started = Date.now();
|
|
775
|
-
let ok;
|
|
776
|
-
// extend server response observable with logging
|
|
777
|
-
return next.handle(req).pipe(tap(
|
|
778
|
-
// Succeeds when there is a response; ignore other events
|
|
779
|
-
event => (ok = event instanceof HttpResponse ? 'succeeded' : ''),
|
|
780
|
-
// Operation failed; error is an HttpErrorResponse
|
|
781
|
-
error => (ok = 'failed')),
|
|
782
|
-
// Log when response observable either completes or errors
|
|
783
|
-
finalize(() => {
|
|
784
|
-
const elapsed = Date.now() - started;
|
|
812
|
+
class LoggingInterceptor {
|
|
813
|
+
intercept(req, next) {
|
|
814
|
+
const started = Date.now();
|
|
815
|
+
let ok;
|
|
816
|
+
// extend server response observable with logging
|
|
817
|
+
return next.handle(req).pipe(tap(
|
|
818
|
+
// Succeeds when there is a response; ignore other events
|
|
819
|
+
(event) => (ok = event instanceof HttpResponse ? 'succeeded' : ''),
|
|
820
|
+
// Operation failed; error is an HttpErrorResponse
|
|
821
|
+
(error) => (ok = 'failed')),
|
|
822
|
+
// Log when response observable either completes or errors
|
|
823
|
+
finalize(() => {
|
|
824
|
+
const elapsed = Date.now() - started;
|
|
785
825
|
const msg = `${req.method} "${req.urlWithParams}"
|
|
786
|
-
${ok} in ${elapsed} ms.`;
|
|
787
|
-
console.log(msg);
|
|
788
|
-
}));
|
|
789
|
-
}
|
|
790
|
-
}
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LoggingInterceptor, [{
|
|
794
|
-
type: Injectable
|
|
826
|
+
${ok} in ${elapsed} ms.`;
|
|
827
|
+
console.log(msg);
|
|
828
|
+
}));
|
|
829
|
+
}
|
|
830
|
+
static ɵfac = function LoggingInterceptor_Factory(t) { return new (t || LoggingInterceptor)(); };
|
|
831
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: LoggingInterceptor, factory: LoggingInterceptor.ɵfac });
|
|
832
|
+
}
|
|
833
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LoggingInterceptor, [{
|
|
834
|
+
type: Injectable
|
|
795
835
|
}], null, null); })();
|
|
796
836
|
|
|
797
|
-
class IgoLoggingModule {
|
|
798
|
-
static forRoot() {
|
|
799
|
-
return {
|
|
800
|
-
ngModule: IgoLoggingModule,
|
|
801
|
-
providers: [
|
|
802
|
-
{
|
|
803
|
-
provide: HTTP_INTERCEPTORS,
|
|
804
|
-
useClass: LoggingInterceptor,
|
|
805
|
-
multi: true
|
|
806
|
-
}
|
|
807
|
-
]
|
|
808
|
-
};
|
|
809
|
-
}
|
|
810
|
-
}
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoLoggingModule, [{
|
|
815
|
-
type: NgModule,
|
|
816
|
-
args: [{
|
|
817
|
-
imports: [],
|
|
818
|
-
declarations: [],
|
|
819
|
-
exports: []
|
|
820
|
-
}]
|
|
837
|
+
class IgoLoggingModule {
|
|
838
|
+
static forRoot() {
|
|
839
|
+
return {
|
|
840
|
+
ngModule: IgoLoggingModule,
|
|
841
|
+
providers: [
|
|
842
|
+
{
|
|
843
|
+
provide: HTTP_INTERCEPTORS,
|
|
844
|
+
useClass: LoggingInterceptor,
|
|
845
|
+
multi: true
|
|
846
|
+
}
|
|
847
|
+
]
|
|
848
|
+
};
|
|
849
|
+
}
|
|
850
|
+
static ɵfac = function IgoLoggingModule_Factory(t) { return new (t || IgoLoggingModule)(); };
|
|
851
|
+
static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoLoggingModule });
|
|
852
|
+
static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({});
|
|
853
|
+
}
|
|
854
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoLoggingModule, [{
|
|
855
|
+
type: NgModule,
|
|
856
|
+
args: [{
|
|
857
|
+
imports: [],
|
|
858
|
+
declarations: [],
|
|
859
|
+
exports: []
|
|
860
|
+
}]
|
|
821
861
|
}], null, null); })();
|
|
822
862
|
|
|
823
|
-
let ROUTE_SERVICE_OPTIONS = new InjectionToken('routeServiceOptions');
|
|
824
|
-
function provideRouteServiceOptions(options) {
|
|
825
|
-
return {
|
|
826
|
-
provide: ROUTE_SERVICE_OPTIONS,
|
|
827
|
-
useValue: options
|
|
828
|
-
};
|
|
829
|
-
}
|
|
830
|
-
class RouteService {
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
.
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
}
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
type:
|
|
863
|
+
let ROUTE_SERVICE_OPTIONS = new InjectionToken('routeServiceOptions');
|
|
864
|
+
function provideRouteServiceOptions(options) {
|
|
865
|
+
return {
|
|
866
|
+
provide: ROUTE_SERVICE_OPTIONS,
|
|
867
|
+
useValue: options
|
|
868
|
+
};
|
|
869
|
+
}
|
|
870
|
+
class RouteService {
|
|
871
|
+
router;
|
|
872
|
+
route;
|
|
873
|
+
options;
|
|
874
|
+
constructor(router, route, options) {
|
|
875
|
+
this.router = router;
|
|
876
|
+
this.route = route;
|
|
877
|
+
const defaultOptions = {
|
|
878
|
+
centerKey: 'center',
|
|
879
|
+
zoomKey: 'zoom',
|
|
880
|
+
projectionKey: 'projection',
|
|
881
|
+
contextKey: 'context',
|
|
882
|
+
searchKey: 'search',
|
|
883
|
+
visibleOnLayersKey: 'visiblelayers',
|
|
884
|
+
visibleOffLayersKey: 'invisiblelayers',
|
|
885
|
+
directionsCoordKey: 'routing',
|
|
886
|
+
directionsOptionsKey: 'routingOptions',
|
|
887
|
+
toolKey: 'tool',
|
|
888
|
+
wmsUrlKey: 'wmsUrl',
|
|
889
|
+
wmsLayersKey: 'wmsLayers',
|
|
890
|
+
wmtsUrlKey: 'wmtsUrl',
|
|
891
|
+
wmtsLayersKey: 'wmtsLayers',
|
|
892
|
+
arcgisUrlKey: 'arcgisUrl',
|
|
893
|
+
arcgisLayersKey: 'arcgisLayers',
|
|
894
|
+
iarcgisUrlKey: 'iarcgisUrl',
|
|
895
|
+
iarcgisLayersKey: 'iarcgisLayers',
|
|
896
|
+
tarcgisUrlKey: 'tarcgisUrl',
|
|
897
|
+
tarcgisLayersKey: 'tarcgisLayers',
|
|
898
|
+
vectorKey: 'vector'
|
|
899
|
+
};
|
|
900
|
+
this.options = Object.assign({}, defaultOptions, options);
|
|
901
|
+
}
|
|
902
|
+
get queryParams() {
|
|
903
|
+
let url = decodeURIComponent(location.search);
|
|
904
|
+
if (url.includes('¢er=')) {
|
|
905
|
+
url = url.replace('¢er', '¢er');
|
|
906
|
+
const queryParams = url
|
|
907
|
+
.slice(1)
|
|
908
|
+
.split('&')
|
|
909
|
+
.map((p) => p.split('='))
|
|
910
|
+
.reduce((obj, pair) => {
|
|
911
|
+
const [key, value] = pair.map(decodeURIComponent);
|
|
912
|
+
obj[key] = value;
|
|
913
|
+
return obj;
|
|
914
|
+
}, {});
|
|
915
|
+
this.router.navigate([], { queryParams });
|
|
916
|
+
}
|
|
917
|
+
return this.route.queryParams;
|
|
918
|
+
}
|
|
919
|
+
static ɵfac = function RouteService_Factory(t) { return new (t || RouteService)(i0.ɵɵinject(i1$4.Router), i0.ɵɵinject(i1$4.ActivatedRoute), i0.ɵɵinject(ROUTE_SERVICE_OPTIONS, 8)); };
|
|
920
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: RouteService, factory: RouteService.ɵfac, providedIn: 'root' });
|
|
921
|
+
}
|
|
922
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RouteService, [{
|
|
923
|
+
type: Injectable,
|
|
924
|
+
args: [{
|
|
925
|
+
providedIn: 'root'
|
|
926
|
+
}]
|
|
927
|
+
}], function () { return [{ type: i1$4.Router }, { type: i1$4.ActivatedRoute }, { type: undefined, decorators: [{
|
|
928
|
+
type: Inject,
|
|
929
|
+
args: [ROUTE_SERVICE_OPTIONS]
|
|
930
|
+
}, {
|
|
931
|
+
type: Optional
|
|
889
932
|
}] }]; }, null); })();
|
|
890
933
|
|
|
891
|
-
class AnalyticsService {
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
(
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
g
|
|
917
|
-
|
|
918
|
-
g.
|
|
919
|
-
g.
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
this.paq.push(['
|
|
929
|
-
this.paq.push(['deleteCustomVariable',
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
this.paq.push(['
|
|
935
|
-
|
|
936
|
-
this.paq.push(['setCustomVariable',
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
934
|
+
class AnalyticsService {
|
|
935
|
+
config;
|
|
936
|
+
options;
|
|
937
|
+
get paq() {
|
|
938
|
+
return (window._paq = window._paq || []);
|
|
939
|
+
}
|
|
940
|
+
constructor(config) {
|
|
941
|
+
this.config = config;
|
|
942
|
+
this.options = this.config.getConfig('analytics') || {};
|
|
943
|
+
if (this.options.provider === 'matomo') {
|
|
944
|
+
this.initMatomo();
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
initMatomo() {
|
|
948
|
+
if (!this.options.url || !this.options.id) {
|
|
949
|
+
return;
|
|
950
|
+
}
|
|
951
|
+
const url = this.options.url.substr(-1) === '/'
|
|
952
|
+
? this.options.url + 'matomo'
|
|
953
|
+
: this.options.url;
|
|
954
|
+
// this.paq.push(['trackPageView']);
|
|
955
|
+
// this.paq.push(['enableLinkTracking']);
|
|
956
|
+
(() => {
|
|
957
|
+
this.paq.push(['setTrackerUrl', url + '.php']);
|
|
958
|
+
this.paq.push(['setSiteId', this.options.id]);
|
|
959
|
+
const g = document.createElement('script');
|
|
960
|
+
const s = document.getElementsByTagName('script')[0];
|
|
961
|
+
g.type = 'text/javascript';
|
|
962
|
+
g.async = true;
|
|
963
|
+
g.defer = true;
|
|
964
|
+
g.src = url + '.js';
|
|
965
|
+
s.parentNode.insertBefore(g, s);
|
|
966
|
+
})();
|
|
967
|
+
}
|
|
968
|
+
setUser(user, profils) {
|
|
969
|
+
if (this.options.provider === 'matomo') {
|
|
970
|
+
if (!user) {
|
|
971
|
+
this.paq.push(['resetUserId']);
|
|
972
|
+
this.paq.push(['deleteCustomVariable', 1, 'user']);
|
|
973
|
+
this.paq.push(['deleteCustomVariable', 2, 'name']);
|
|
974
|
+
this.paq.push(['deleteCustomVariable', 3, 'profils']);
|
|
975
|
+
}
|
|
976
|
+
else {
|
|
977
|
+
this.paq.push(['setUserId', user.id]);
|
|
978
|
+
const name = `${user.firstName} ${user.lastName}`;
|
|
979
|
+
this.paq.push(['setCustomVariable', 1, 'user', user.sourceId, 'visit']);
|
|
980
|
+
this.paq.push(['setCustomVariable', 2, 'name', name, 'visit']);
|
|
981
|
+
this.paq.push(['setCustomVariable', 3, 'profils', profils, 'visit']);
|
|
982
|
+
}
|
|
983
|
+
this.paq.push(['trackPageView']);
|
|
984
|
+
this.paq.push(['enableLinkTracking']);
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
trackSearch(term, nbResults) {
|
|
988
|
+
if (this.options.provider === 'matomo') {
|
|
989
|
+
this.paq.push(['trackSiteSearch', term, false, nbResults]);
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
trackEvent(category, action, name) {
|
|
993
|
+
if (this.options.provider === 'matomo') {
|
|
994
|
+
this.paq.push(['trackEvent', category, action, name]);
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
/**
|
|
998
|
+
* Function that tracks layers added to the map
|
|
999
|
+
*/
|
|
1000
|
+
trackLayer(category, action, parameters) {
|
|
1001
|
+
if (this.options.provider === 'matomo')
|
|
1002
|
+
this.paq.push(['trackEvent', category, action, parameters]);
|
|
1003
|
+
}
|
|
1004
|
+
static ɵfac = function AnalyticsService_Factory(t) { return new (t || AnalyticsService)(i0.ɵɵinject(ConfigService)); };
|
|
1005
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: AnalyticsService, factory: AnalyticsService.ɵfac, providedIn: 'root' });
|
|
1006
|
+
}
|
|
1007
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AnalyticsService, [{
|
|
1008
|
+
type: Injectable,
|
|
1009
|
+
args: [{
|
|
1010
|
+
providedIn: 'root'
|
|
1011
|
+
}]
|
|
967
1012
|
}], function () { return [{ type: ConfigService }]; }, null); })();
|
|
968
1013
|
|
|
969
|
-
var Media;
|
|
970
|
-
(function (Media) {
|
|
971
|
-
Media["Mobile"] = "mobile";
|
|
972
|
-
Media["Tablet"] = "tablet";
|
|
973
|
-
Media["Desktop"] = "desktop";
|
|
974
|
-
})(Media || (Media = {}));
|
|
975
|
-
var MediaOrientation;
|
|
976
|
-
(function (MediaOrientation) {
|
|
977
|
-
MediaOrientation["Portrait"] = "portrait";
|
|
978
|
-
MediaOrientation["Landscape"] = "landscape";
|
|
1014
|
+
var Media;
|
|
1015
|
+
(function (Media) {
|
|
1016
|
+
Media["Mobile"] = "mobile";
|
|
1017
|
+
Media["Tablet"] = "tablet";
|
|
1018
|
+
Media["Desktop"] = "desktop";
|
|
1019
|
+
})(Media || (Media = {}));
|
|
1020
|
+
var MediaOrientation;
|
|
1021
|
+
(function (MediaOrientation) {
|
|
1022
|
+
MediaOrientation["Portrait"] = "portrait";
|
|
1023
|
+
MediaOrientation["Landscape"] = "landscape";
|
|
979
1024
|
})(MediaOrientation || (MediaOrientation = {}));
|
|
980
1025
|
|
|
981
|
-
class MediaService {
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
breakpointObserver
|
|
986
|
-
.observe([Breakpoints.HandsetLandscape])
|
|
987
|
-
.subscribe(res => {
|
|
988
|
-
if (res.matches) {
|
|
989
|
-
this.media$.next(Media.Mobile);
|
|
990
|
-
this.orientation$.next(MediaOrientation.Landscape);
|
|
991
|
-
}
|
|
992
|
-
});
|
|
993
|
-
breakpointObserver
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
if (res.matches) {
|
|
1013
|
-
this.media$.next(Media.
|
|
1014
|
-
this.orientation$.next(MediaOrientation.
|
|
1015
|
-
}
|
|
1016
|
-
});
|
|
1017
|
-
breakpointObserver.observe([Breakpoints.
|
|
1018
|
-
if (res.matches) {
|
|
1019
|
-
this.media$.next(Media.Desktop);
|
|
1020
|
-
this.orientation$.next(MediaOrientation.
|
|
1021
|
-
}
|
|
1022
|
-
});
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
}
|
|
1030
|
-
|
|
1031
|
-
return
|
|
1032
|
-
}
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1026
|
+
class MediaService {
|
|
1027
|
+
media$ = new BehaviorSubject(undefined);
|
|
1028
|
+
orientation$ = new BehaviorSubject(undefined);
|
|
1029
|
+
constructor(breakpointObserver) {
|
|
1030
|
+
breakpointObserver
|
|
1031
|
+
.observe([Breakpoints.HandsetLandscape])
|
|
1032
|
+
.subscribe((res) => {
|
|
1033
|
+
if (res.matches) {
|
|
1034
|
+
this.media$.next(Media.Mobile);
|
|
1035
|
+
this.orientation$.next(MediaOrientation.Landscape);
|
|
1036
|
+
}
|
|
1037
|
+
});
|
|
1038
|
+
breakpointObserver
|
|
1039
|
+
.observe([Breakpoints.HandsetPortrait])
|
|
1040
|
+
.subscribe((res) => {
|
|
1041
|
+
if (res.matches) {
|
|
1042
|
+
this.media$.next(Media.Mobile);
|
|
1043
|
+
this.orientation$.next(MediaOrientation.Portrait);
|
|
1044
|
+
}
|
|
1045
|
+
});
|
|
1046
|
+
breakpointObserver
|
|
1047
|
+
.observe([Breakpoints.TabletLandscape])
|
|
1048
|
+
.subscribe((res) => {
|
|
1049
|
+
if (res.matches) {
|
|
1050
|
+
this.media$.next(Media.Tablet);
|
|
1051
|
+
this.orientation$.next(MediaOrientation.Landscape);
|
|
1052
|
+
}
|
|
1053
|
+
});
|
|
1054
|
+
breakpointObserver
|
|
1055
|
+
.observe([Breakpoints.TabletPortrait])
|
|
1056
|
+
.subscribe((res) => {
|
|
1057
|
+
if (res.matches) {
|
|
1058
|
+
this.media$.next(Media.Tablet);
|
|
1059
|
+
this.orientation$.next(MediaOrientation.Portrait);
|
|
1060
|
+
}
|
|
1061
|
+
});
|
|
1062
|
+
breakpointObserver.observe([Breakpoints.WebLandscape]).subscribe((res) => {
|
|
1063
|
+
if (res.matches) {
|
|
1064
|
+
this.media$.next(Media.Desktop);
|
|
1065
|
+
this.orientation$.next(MediaOrientation.Landscape);
|
|
1066
|
+
}
|
|
1067
|
+
});
|
|
1068
|
+
breakpointObserver.observe([Breakpoints.WebPortrait]).subscribe((res) => {
|
|
1069
|
+
if (res.matches) {
|
|
1070
|
+
this.media$.next(Media.Desktop);
|
|
1071
|
+
this.orientation$.next(MediaOrientation.Portrait);
|
|
1072
|
+
}
|
|
1073
|
+
});
|
|
1074
|
+
}
|
|
1075
|
+
getMedia() {
|
|
1076
|
+
return this.media$.value;
|
|
1077
|
+
}
|
|
1078
|
+
getOrientation() {
|
|
1079
|
+
return this.orientation$.value;
|
|
1080
|
+
}
|
|
1081
|
+
isTouchScreen() {
|
|
1082
|
+
return 'ontouchstart' in document.documentElement ? true : false;
|
|
1083
|
+
}
|
|
1084
|
+
isMobile() {
|
|
1085
|
+
const media = this.getMedia();
|
|
1086
|
+
return media === 'mobile';
|
|
1087
|
+
}
|
|
1088
|
+
isDesktop() {
|
|
1089
|
+
const media = this.getMedia();
|
|
1090
|
+
return media === 'desktop';
|
|
1091
|
+
}
|
|
1092
|
+
static ɵfac = function MediaService_Factory(t) { return new (t || MediaService)(i0.ɵɵinject(i1$5.BreakpointObserver)); };
|
|
1093
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: MediaService, factory: MediaService.ɵfac, providedIn: 'root' });
|
|
1094
|
+
}
|
|
1095
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MediaService, [{
|
|
1096
|
+
type: Injectable,
|
|
1097
|
+
args: [{
|
|
1098
|
+
providedIn: 'root'
|
|
1099
|
+
}]
|
|
1100
|
+
}], function () { return [{ type: i1$5.BreakpointObserver }]; }, null); })();
|
|
1050
1101
|
|
|
1051
|
-
var StorageScope;
|
|
1052
|
-
(function (StorageScope) {
|
|
1053
|
-
StorageScope["SESSION"] = "Session";
|
|
1054
|
-
StorageScope["LOCAL"] = "Local";
|
|
1055
|
-
})(StorageScope || (StorageScope = {}));
|
|
1056
|
-
var StorageServiceEventEnum;
|
|
1057
|
-
(function (StorageServiceEventEnum) {
|
|
1058
|
-
StorageServiceEventEnum["ADDED"] = "Added";
|
|
1059
|
-
StorageServiceEventEnum["MODIFIED"] = "Modified";
|
|
1060
|
-
StorageServiceEventEnum["REMOVED"] = "Removed";
|
|
1061
|
-
StorageServiceEventEnum["CLEARED"] = "Cleared";
|
|
1102
|
+
var StorageScope;
|
|
1103
|
+
(function (StorageScope) {
|
|
1104
|
+
StorageScope["SESSION"] = "Session";
|
|
1105
|
+
StorageScope["LOCAL"] = "Local";
|
|
1106
|
+
})(StorageScope || (StorageScope = {}));
|
|
1107
|
+
var StorageServiceEventEnum;
|
|
1108
|
+
(function (StorageServiceEventEnum) {
|
|
1109
|
+
StorageServiceEventEnum["ADDED"] = "Added";
|
|
1110
|
+
StorageServiceEventEnum["MODIFIED"] = "Modified";
|
|
1111
|
+
StorageServiceEventEnum["REMOVED"] = "Removed";
|
|
1112
|
+
StorageServiceEventEnum["CLEARED"] = "Cleared";
|
|
1062
1113
|
})(StorageServiceEventEnum || (StorageServiceEventEnum = {}));
|
|
1063
1114
|
|
|
1064
|
-
class
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
this.options =
|
|
1069
|
-
}
|
|
1070
|
-
/**
|
|
1071
|
-
* Use to get the data found in storage file
|
|
1072
|
-
*/
|
|
1073
|
-
get(key, scope) {
|
|
1074
|
-
let value;
|
|
1075
|
-
if (!scope || scope === StorageScope.SESSION) {
|
|
1076
|
-
value = sessionStorage.getItem(`${this.options.key}.${key}`);
|
|
1077
|
-
}
|
|
1078
|
-
if (scope === StorageScope.LOCAL || (!value && !scope)) {
|
|
1079
|
-
value = localStorage.getItem(`${this.options.key}.${key}`);
|
|
1080
|
-
}
|
|
1081
|
-
if (value) {
|
|
1082
|
-
try {
|
|
1083
|
-
value = JSON.parse(value);
|
|
1084
|
-
}
|
|
1085
|
-
catch {
|
|
1086
|
-
value = value;
|
|
1087
|
-
}
|
|
1088
|
-
}
|
|
1089
|
-
return value;
|
|
1090
|
-
}
|
|
1091
|
-
set(key, value, scope = StorageScope.LOCAL) {
|
|
1092
|
-
const previousValue = this.get(key, scope);
|
|
1093
|
-
if (scope === StorageScope.SESSION) {
|
|
1094
|
-
sessionStorage.setItem(`${this.options.key}.${key}`, JSON.stringify(value));
|
|
1095
|
-
}
|
|
1096
|
-
else {
|
|
1097
|
-
localStorage.setItem(`${this.options.key}.${key}`, JSON.stringify(value));
|
|
1098
|
-
}
|
|
1099
|
-
const currentValue = this.get(key, scope);
|
|
1100
|
-
if (currentValue !== previousValue) {
|
|
1101
|
-
this.storageChange$.next({
|
|
1102
|
-
key,
|
|
1103
|
-
|
|
1104
|
-
previousValue
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
}
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
}
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1115
|
+
class BaseStorage {
|
|
1116
|
+
options;
|
|
1117
|
+
storageChange$ = new BehaviorSubject(undefined);
|
|
1118
|
+
constructor(config) {
|
|
1119
|
+
this.options = config.getConfig('storage') || { key: 'igo' };
|
|
1120
|
+
}
|
|
1121
|
+
/**
|
|
1122
|
+
* Use to get the data found in storage file
|
|
1123
|
+
*/
|
|
1124
|
+
get(key, scope) {
|
|
1125
|
+
let value;
|
|
1126
|
+
if (!scope || scope === StorageScope.SESSION) {
|
|
1127
|
+
value = sessionStorage.getItem(`${this.options.key}.${key}`);
|
|
1128
|
+
}
|
|
1129
|
+
if (scope === StorageScope.LOCAL || (!value && !scope)) {
|
|
1130
|
+
value = localStorage.getItem(`${this.options.key}.${key}`);
|
|
1131
|
+
}
|
|
1132
|
+
if (value) {
|
|
1133
|
+
try {
|
|
1134
|
+
value = JSON.parse(value);
|
|
1135
|
+
}
|
|
1136
|
+
catch {
|
|
1137
|
+
value = value;
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
return value;
|
|
1141
|
+
}
|
|
1142
|
+
set(key, value, scope = StorageScope.LOCAL) {
|
|
1143
|
+
const previousValue = this.get(key, scope);
|
|
1144
|
+
if (scope === StorageScope.SESSION) {
|
|
1145
|
+
sessionStorage.setItem(`${this.options.key}.${key}`, JSON.stringify(value));
|
|
1146
|
+
}
|
|
1147
|
+
else {
|
|
1148
|
+
localStorage.setItem(`${this.options.key}.${key}`, JSON.stringify(value));
|
|
1149
|
+
}
|
|
1150
|
+
const currentValue = this.get(key, scope);
|
|
1151
|
+
if (currentValue !== previousValue) {
|
|
1152
|
+
this.storageChange$.next({
|
|
1153
|
+
key,
|
|
1154
|
+
scope,
|
|
1155
|
+
event: previousValue !== undefined
|
|
1156
|
+
? StorageServiceEventEnum.MODIFIED
|
|
1157
|
+
: StorageServiceEventEnum.ADDED,
|
|
1158
|
+
previousValue,
|
|
1159
|
+
currentValue
|
|
1160
|
+
});
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
remove(key, scope = StorageScope.LOCAL) {
|
|
1164
|
+
const previousValue = this.get(key, scope);
|
|
1165
|
+
if (scope === StorageScope.SESSION) {
|
|
1166
|
+
sessionStorage.removeItem(`${this.options.key}.${key}`);
|
|
1167
|
+
}
|
|
1168
|
+
else {
|
|
1169
|
+
localStorage.removeItem(`${this.options.key}.${key}`);
|
|
1170
|
+
}
|
|
1171
|
+
this.storageChange$.next({
|
|
1172
|
+
key,
|
|
1173
|
+
scope,
|
|
1174
|
+
event: StorageServiceEventEnum.REMOVED,
|
|
1175
|
+
previousValue
|
|
1176
|
+
});
|
|
1177
|
+
}
|
|
1178
|
+
clear(scope = StorageScope.LOCAL) {
|
|
1179
|
+
if (scope === StorageScope.SESSION) {
|
|
1180
|
+
sessionStorage.clear();
|
|
1181
|
+
}
|
|
1182
|
+
else {
|
|
1183
|
+
localStorage.clear();
|
|
1184
|
+
}
|
|
1185
|
+
this.storageChange$.next({ scope, event: StorageServiceEventEnum.CLEARED });
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
class StorageService extends BaseStorage {
|
|
1190
|
+
config;
|
|
1191
|
+
constructor(config) {
|
|
1192
|
+
super(config);
|
|
1193
|
+
this.config = config;
|
|
1194
|
+
}
|
|
1195
|
+
static ɵfac = function StorageService_Factory(t) { return new (t || StorageService)(i0.ɵɵinject(ConfigService)); };
|
|
1196
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: StorageService, factory: StorageService.ɵfac, providedIn: 'root' });
|
|
1197
|
+
}
|
|
1198
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(StorageService, [{
|
|
1199
|
+
type: Injectable,
|
|
1200
|
+
args: [{
|
|
1201
|
+
providedIn: 'root'
|
|
1202
|
+
}]
|
|
1136
1203
|
}], function () { return [{ type: ConfigService }]; }, null); })();
|
|
1137
1204
|
|
|
1138
|
-
function getNumber(v, endposition, length) {
|
|
1139
|
-
/* tslint:disable:no-bitwise*/
|
|
1140
|
-
const mask = (
|
|
1141
|
-
return (v >> endposition) & mask;
|
|
1142
|
-
/* tslint:enable:no-bitwise*/
|
|
1143
|
-
}
|
|
1144
|
-
class CompressionService {
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
this.generateBase64Index();
|
|
1149
|
-
}
|
|
1150
|
-
generateBase64Index() {
|
|
1151
|
-
// https://fr.wikipedia.org/wiki/Base64
|
|
1152
|
-
// A-Z => [0, 25]
|
|
1153
|
-
for (let i = 0; i < 26; i++) {
|
|
1154
|
-
this.base64Index.set(String.fromCharCode('A'.charCodeAt(0) + i), i);
|
|
1155
|
-
this.indexBase64.set(i, String.fromCharCode('A'.charCodeAt(0) + i));
|
|
1156
|
-
}
|
|
1157
|
-
// a-z => [26, 51]
|
|
1158
|
-
for (let i = 0; i < 26; i++) {
|
|
1159
|
-
this.base64Index.set(String.fromCharCode('a'.charCodeAt(0) + i), i + 26);
|
|
1160
|
-
this.indexBase64.set(i + 26, String.fromCharCode('a'.charCodeAt(0) + i));
|
|
1161
|
-
}
|
|
1162
|
-
// 0-9 => [52, 61]
|
|
1163
|
-
for (let i = 0; i < 10; i++) {
|
|
1164
|
-
this.base64Index.set(String.fromCharCode('0'.charCodeAt(0) + i), i + 52);
|
|
1165
|
-
this.indexBase64.set(i + 52, String.fromCharCode('0'.charCodeAt(0) + i));
|
|
1166
|
-
}
|
|
1167
|
-
// + / => [62, 63]
|
|
1168
|
-
this.base64Index.set('+', 62);
|
|
1169
|
-
this.base64Index.set('/', 63);
|
|
1170
|
-
this.indexBase64.set(62, '+');
|
|
1171
|
-
this.indexBase64.set(63, '/');
|
|
1172
|
-
}
|
|
1173
|
-
compressBlob(blob) {
|
|
1174
|
-
if (!blob) {
|
|
1175
|
-
return;
|
|
1176
|
-
}
|
|
1177
|
-
const observable = new Observable((observer) => {
|
|
1178
|
-
const reader = new FileReader();
|
|
1179
|
-
reader.readAsDataURL(blob);
|
|
1180
|
-
reader.onload = () => {
|
|
1181
|
-
const base64 = reader.result.valueOf();
|
|
1182
|
-
const text64 = base64.substr(base64.indexOf(',') + 1);
|
|
1183
|
-
const compressed = this.compressStringBase64(text64);
|
|
1184
|
-
const compressedData = {
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
const
|
|
1197
|
-
const
|
|
1198
|
-
const
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
let
|
|
1212
|
-
let
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
chr
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
let
|
|
1244
|
-
let
|
|
1245
|
-
let
|
|
1246
|
-
let
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
chr
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1205
|
+
function getNumber(v, endposition, length) {
|
|
1206
|
+
/* tslint:disable:no-bitwise*/
|
|
1207
|
+
const mask = (1 << length) - 1;
|
|
1208
|
+
return (v >> endposition) & mask;
|
|
1209
|
+
/* tslint:enable:no-bitwise*/
|
|
1210
|
+
}
|
|
1211
|
+
class CompressionService {
|
|
1212
|
+
base64Index = new Map();
|
|
1213
|
+
indexBase64 = new Map();
|
|
1214
|
+
constructor() {
|
|
1215
|
+
this.generateBase64Index();
|
|
1216
|
+
}
|
|
1217
|
+
generateBase64Index() {
|
|
1218
|
+
// https://fr.wikipedia.org/wiki/Base64
|
|
1219
|
+
// A-Z => [0, 25]
|
|
1220
|
+
for (let i = 0; i < 26; i++) {
|
|
1221
|
+
this.base64Index.set(String.fromCharCode('A'.charCodeAt(0) + i), i);
|
|
1222
|
+
this.indexBase64.set(i, String.fromCharCode('A'.charCodeAt(0) + i));
|
|
1223
|
+
}
|
|
1224
|
+
// a-z => [26, 51]
|
|
1225
|
+
for (let i = 0; i < 26; i++) {
|
|
1226
|
+
this.base64Index.set(String.fromCharCode('a'.charCodeAt(0) + i), i + 26);
|
|
1227
|
+
this.indexBase64.set(i + 26, String.fromCharCode('a'.charCodeAt(0) + i));
|
|
1228
|
+
}
|
|
1229
|
+
// 0-9 => [52, 61]
|
|
1230
|
+
for (let i = 0; i < 10; i++) {
|
|
1231
|
+
this.base64Index.set(String.fromCharCode('0'.charCodeAt(0) + i), i + 52);
|
|
1232
|
+
this.indexBase64.set(i + 52, String.fromCharCode('0'.charCodeAt(0) + i));
|
|
1233
|
+
}
|
|
1234
|
+
// + / => [62, 63]
|
|
1235
|
+
this.base64Index.set('+', 62);
|
|
1236
|
+
this.base64Index.set('/', 63);
|
|
1237
|
+
this.indexBase64.set(62, '+');
|
|
1238
|
+
this.indexBase64.set(63, '/');
|
|
1239
|
+
}
|
|
1240
|
+
compressBlob(blob) {
|
|
1241
|
+
if (!blob) {
|
|
1242
|
+
return;
|
|
1243
|
+
}
|
|
1244
|
+
const observable = new Observable((observer) => {
|
|
1245
|
+
const reader = new FileReader();
|
|
1246
|
+
reader.readAsDataURL(blob);
|
|
1247
|
+
reader.onload = () => {
|
|
1248
|
+
const base64 = reader.result.valueOf();
|
|
1249
|
+
const text64 = base64.substr(base64.indexOf(',') + 1);
|
|
1250
|
+
const compressed = this.compressStringBase64(text64);
|
|
1251
|
+
const compressedData = {
|
|
1252
|
+
length: text64.length,
|
|
1253
|
+
type: blob.type,
|
|
1254
|
+
object: compressed
|
|
1255
|
+
};
|
|
1256
|
+
observer.next(compressedData);
|
|
1257
|
+
};
|
|
1258
|
+
});
|
|
1259
|
+
return observable;
|
|
1260
|
+
}
|
|
1261
|
+
decompressBlob(compressedData) {
|
|
1262
|
+
/* tslint:disable:no-bitwise*/
|
|
1263
|
+
const object = compressedData.object;
|
|
1264
|
+
const length = compressedData.length;
|
|
1265
|
+
const decompressed = this.decompressStringBase64(object, length);
|
|
1266
|
+
const byteCharacters = atob(decompressed);
|
|
1267
|
+
const byteNumbers = new Array(byteCharacters.length);
|
|
1268
|
+
for (let i = 0; i < byteCharacters.length; i++) {
|
|
1269
|
+
byteNumbers[i] = byteCharacters.charCodeAt(i);
|
|
1270
|
+
}
|
|
1271
|
+
const byteArray = new Uint8Array(byteNumbers);
|
|
1272
|
+
const blob = new Blob([byteArray], { type: compressedData.type });
|
|
1273
|
+
/* tslint:enable:no-bitwise*/
|
|
1274
|
+
return blob;
|
|
1275
|
+
}
|
|
1276
|
+
compressStringBase64(s) {
|
|
1277
|
+
/* tslint:disable:no-bitwise*/
|
|
1278
|
+
let out = '';
|
|
1279
|
+
let bits = 16;
|
|
1280
|
+
let chr = 0;
|
|
1281
|
+
let rem = 0;
|
|
1282
|
+
for (const c of s) {
|
|
1283
|
+
const value = this.base64Index.get(c);
|
|
1284
|
+
if (bits > 6) {
|
|
1285
|
+
bits -= 6;
|
|
1286
|
+
chr += value << bits;
|
|
1287
|
+
}
|
|
1288
|
+
else {
|
|
1289
|
+
rem = 6 - bits;
|
|
1290
|
+
chr += value >> rem;
|
|
1291
|
+
out += String.fromCharCode(chr);
|
|
1292
|
+
chr = value << (16 - rem);
|
|
1293
|
+
bits = 16 - rem;
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
if (s.length % 8 !== 0) {
|
|
1297
|
+
out += String.fromCharCode(chr);
|
|
1298
|
+
}
|
|
1299
|
+
/* tslint:enable:no-bitwise*/
|
|
1300
|
+
return String.fromCharCode(9731) + out;
|
|
1301
|
+
}
|
|
1302
|
+
decompressStringBase64(c, length) {
|
|
1303
|
+
/* tslint:disable:no-bitwise*/
|
|
1304
|
+
if (!c) {
|
|
1305
|
+
return;
|
|
1306
|
+
}
|
|
1307
|
+
if (c.charCodeAt(0) !== 9731) {
|
|
1308
|
+
return c;
|
|
1309
|
+
}
|
|
1310
|
+
let chr = 0;
|
|
1311
|
+
let rem = 0;
|
|
1312
|
+
let bits = 16;
|
|
1313
|
+
let out = '';
|
|
1314
|
+
let j = 1;
|
|
1315
|
+
let value = c.charCodeAt(j);
|
|
1316
|
+
for (let i = 0; i < length; i++) {
|
|
1317
|
+
if (bits > 6) {
|
|
1318
|
+
bits -= 6;
|
|
1319
|
+
chr = getNumber(value, bits, 6);
|
|
1320
|
+
out += this.indexBase64.get(chr);
|
|
1321
|
+
}
|
|
1322
|
+
else {
|
|
1323
|
+
rem = 6 - bits;
|
|
1324
|
+
chr = getNumber(value, 0, bits) << rem;
|
|
1325
|
+
value = c.charCodeAt(++j);
|
|
1326
|
+
chr += getNumber(value, 16 - rem, rem);
|
|
1327
|
+
out += this.indexBase64.get(chr);
|
|
1328
|
+
bits = 16 - rem;
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
return out;
|
|
1332
|
+
/* tslint:enable:no-bitwise*/
|
|
1333
|
+
}
|
|
1334
|
+
static ɵfac = function CompressionService_Factory(t) { return new (t || CompressionService)(); };
|
|
1335
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CompressionService, factory: CompressionService.ɵfac, providedIn: 'root' });
|
|
1336
|
+
}
|
|
1337
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CompressionService, [{
|
|
1338
|
+
type: Injectable,
|
|
1339
|
+
args: [{
|
|
1340
|
+
providedIn: 'root'
|
|
1341
|
+
}]
|
|
1273
1342
|
}], function () { return []; }, null); })();
|
|
1274
1343
|
|
|
1275
|
-
class NetworkService {
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
}
|
|
1285
|
-
|
|
1286
|
-
this.
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
this.
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
this.
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
}
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1344
|
+
class NetworkService {
|
|
1345
|
+
messageService;
|
|
1346
|
+
injector;
|
|
1347
|
+
stateChangeEventEmitter = new EventEmitter();
|
|
1348
|
+
onlineSubscription;
|
|
1349
|
+
offlineSubscription;
|
|
1350
|
+
previousMessageId;
|
|
1351
|
+
state = {
|
|
1352
|
+
connection: window.navigator.onLine
|
|
1353
|
+
};
|
|
1354
|
+
constructor(messageService, injector) {
|
|
1355
|
+
this.messageService = messageService;
|
|
1356
|
+
this.injector = injector;
|
|
1357
|
+
this.checkNetworkState();
|
|
1358
|
+
}
|
|
1359
|
+
checkNetworkState() {
|
|
1360
|
+
this.onlineSubscription = fromEvent(window, 'online').subscribe(() => {
|
|
1361
|
+
if (this.previousMessageId) {
|
|
1362
|
+
this.messageService.remove(this.previousMessageId);
|
|
1363
|
+
}
|
|
1364
|
+
const messageObj = this.messageService.info('igo.core.network.online.message', 'igo.core.network.online.title');
|
|
1365
|
+
this.previousMessageId = messageObj.toastId;
|
|
1366
|
+
this.state.connection = true;
|
|
1367
|
+
this.emitEvent();
|
|
1368
|
+
});
|
|
1369
|
+
this.offlineSubscription = fromEvent(window, 'offline').subscribe(() => {
|
|
1370
|
+
if (this.previousMessageId) {
|
|
1371
|
+
this.messageService.remove(this.previousMessageId);
|
|
1372
|
+
}
|
|
1373
|
+
const messageObj = this.messageService.info('igo.core.network.offline.message', 'igo.core.network.offline.title');
|
|
1374
|
+
this.previousMessageId = messageObj.toastId;
|
|
1375
|
+
this.state.connection = false;
|
|
1376
|
+
this.emitEvent();
|
|
1377
|
+
});
|
|
1378
|
+
}
|
|
1379
|
+
emitEvent() {
|
|
1380
|
+
this.stateChangeEventEmitter.emit(this.state);
|
|
1381
|
+
}
|
|
1382
|
+
ngOnDestroy() {
|
|
1383
|
+
try {
|
|
1384
|
+
this.offlineSubscription.unsubscribe();
|
|
1385
|
+
this.onlineSubscription.unsubscribe();
|
|
1386
|
+
}
|
|
1387
|
+
catch (e) { }
|
|
1388
|
+
}
|
|
1389
|
+
currentState(reportState = true) {
|
|
1390
|
+
return reportState
|
|
1391
|
+
? this.stateChangeEventEmitter.pipe(debounceTime(300), startWith(this.state))
|
|
1392
|
+
: this.stateChangeEventEmitter.pipe(debounceTime(300));
|
|
1393
|
+
}
|
|
1394
|
+
static ɵfac = function NetworkService_Factory(t) { return new (t || NetworkService)(i0.ɵɵinject(MessageService), i0.ɵɵinject(i0.Injector)); };
|
|
1395
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: NetworkService, factory: NetworkService.ɵfac, providedIn: 'root' });
|
|
1396
|
+
}
|
|
1397
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NetworkService, [{
|
|
1398
|
+
type: Injectable,
|
|
1399
|
+
args: [{
|
|
1400
|
+
providedIn: 'root'
|
|
1401
|
+
}]
|
|
1328
1402
|
}], function () { return [{ type: MessageService }, { type: i0.Injector }]; }, null); })();
|
|
1329
1403
|
|
|
1330
|
-
class RegexService {
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1404
|
+
class RegexService {
|
|
1405
|
+
config;
|
|
1406
|
+
options;
|
|
1407
|
+
constructor(config) {
|
|
1408
|
+
this.config = config;
|
|
1409
|
+
this.options = this.config.getConfig('regex');
|
|
1410
|
+
}
|
|
1411
|
+
getAll() {
|
|
1412
|
+
return this.options;
|
|
1413
|
+
}
|
|
1414
|
+
get(key) {
|
|
1415
|
+
if (this.options) {
|
|
1416
|
+
return this.options[key];
|
|
1417
|
+
}
|
|
1418
|
+
return;
|
|
1419
|
+
}
|
|
1420
|
+
static ɵfac = function RegexService_Factory(t) { return new (t || RegexService)(i0.ɵɵinject(ConfigService)); };
|
|
1421
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: RegexService, factory: RegexService.ɵfac, providedIn: 'root' });
|
|
1422
|
+
}
|
|
1423
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RegexService, [{
|
|
1424
|
+
type: Injectable,
|
|
1425
|
+
args: [{
|
|
1426
|
+
providedIn: 'root'
|
|
1427
|
+
}]
|
|
1352
1428
|
}], function () { return [{ type: ConfigService }]; }, null); })();
|
|
1353
1429
|
|
|
1354
|
-
/*
|
|
1355
|
-
* Public API Surface of core
|
|
1430
|
+
/*
|
|
1431
|
+
* Public API Surface of core
|
|
1356
1432
|
*/
|
|
1357
1433
|
|
|
1358
|
-
/**
|
|
1359
|
-
* Generated bundle index. Do not edit.
|
|
1434
|
+
/**
|
|
1435
|
+
* Generated bundle index. Do not edit.
|
|
1360
1436
|
*/
|
|
1361
1437
|
|
|
1362
|
-
export { ActivityInterceptor, ActivityService, AnalyticsService, CONFIG_OPTIONS, CompressionService, ConfigService, ErrorInterceptor, IgoActivityModule, IgoConfigModule, IgoCoreModule, IgoErrorModule, IgoGestureConfig, IgoGestureModule, IgoLanguageModule, IgoLoggingModule, IgoMessageModule, IgoMissingTranslationHandler, LanguageLoader, LanguageService, LoggingInterceptor, Media, MediaOrientation, MediaService, MessageService, MessageType, NetworkService, ROUTE_SERVICE_OPTIONS, RegexService, RouteService, StorageScope, StorageService, StorageServiceEventEnum, configFactory, defaultLanguageLoader, provideConfigLoader, provideConfigOptions, provideDefaultLanguageLoader, provideLanguageLoader, provideRouteServiceOptions, version };
|
|
1438
|
+
export { ActivityInterceptor, ActivityService, AnalyticsService, BaseStorage, CONFIG_OPTIONS, CompressionService, ConfigService, ErrorInterceptor, IgoActivityModule, IgoConfigModule, IgoCoreModule, IgoErrorModule, IgoGestureConfig, IgoGestureModule, IgoLanguageModule, IgoLoggingModule, IgoMessageModule, IgoMissingTranslationHandler, LanguageLoader, LanguageService, LoggingInterceptor, Media, MediaOrientation, MediaService, MessageService, MessageType, NetworkService, ROUTE_SERVICE_OPTIONS, RegexService, RouteService, StorageScope, StorageService, StorageServiceEventEnum, configFactory, defaultLanguageLoader, provideConfigLoader, provideConfigOptions, provideDefaultLanguageLoader, provideLanguageLoader, provideRouteServiceOptions, version };
|
|
1363
1439
|
//# sourceMappingURL=igo2-core.mjs.map
|