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