@igo2/core 1.10.0 → 1.12.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/__ivy_ngcc__/locale/en.auth.json +29 -29
- package/__ivy_ngcc__/locale/en.common.json +43 -43
- package/__ivy_ngcc__/locale/en.context.json +198 -198
- package/__ivy_ngcc__/locale/en.core.json +29 -29
- package/__ivy_ngcc__/locale/en.geo.json +737 -709
- package/__ivy_ngcc__/locale/en.integration.json +123 -105
- package/__ivy_ngcc__/locale/en.json +55 -9
- package/__ivy_ngcc__/locale/fr.auth.json +32 -32
- package/__ivy_ngcc__/locale/fr.common.json +43 -43
- package/__ivy_ngcc__/locale/fr.context.json +198 -198
- package/__ivy_ngcc__/locale/fr.core.json +29 -29
- package/__ivy_ngcc__/locale/fr.geo.json +737 -709
- package/__ivy_ngcc__/locale/fr.integration.json +125 -107
- package/__ivy_ngcc__/locale/fr.json +51 -5
- package/bundles/igo2-core.umd.js +227 -40
- package/bundles/igo2-core.umd.js.map +1 -1
- package/esm2015/lib/activity/activity.interceptor.js +1 -1
- package/esm2015/lib/activity/activity.module.js +1 -1
- package/esm2015/lib/activity/activity.service.js +1 -1
- package/esm2015/lib/activity/index.js +1 -1
- package/esm2015/lib/analytics/index.js +1 -1
- package/esm2015/lib/analytics/shared/analytics.interface.js +1 -1
- package/esm2015/lib/analytics/shared/analytics.service.js +1 -1
- package/esm2015/lib/analytics/shared/index.js +1 -1
- package/esm2015/lib/compression/compressedData.interface.js +2 -0
- package/esm2015/lib/compression/compression.service.js +140 -0
- package/esm2015/lib/compression/index.js +3 -0
- package/esm2015/lib/config/config.interface.js +1 -1
- package/esm2015/lib/config/config.module.js +1 -1
- package/esm2015/lib/config/config.provider.js +1 -1
- package/esm2015/lib/config/config.service.js +1 -1
- package/esm2015/lib/config/index.js +1 -1
- package/esm2015/lib/config/version.js +3 -3
- package/esm2015/lib/core.module.js +19 -4
- package/esm2015/lib/gesture/gesture.module.js +1 -1
- package/esm2015/lib/gesture/gesture.provider.js +1 -1
- package/esm2015/lib/language/index.js +1 -1
- package/esm2015/lib/language/language.module.js +1 -1
- package/esm2015/lib/language/shared/index.js +1 -1
- package/esm2015/lib/language/shared/language.interface.js +1 -1
- package/esm2015/lib/language/shared/language.loader.js +1 -1
- package/esm2015/lib/language/shared/language.provider.js +1 -1
- package/esm2015/lib/language/shared/language.service.js +1 -1
- package/esm2015/lib/language/shared/missing-translation.guard.js +2 -2
- package/esm2015/lib/media/index.js +1 -1
- package/esm2015/lib/media/media.enum.js +1 -1
- package/esm2015/lib/media/media.service.js +1 -1
- package/esm2015/lib/message/index.js +1 -1
- package/esm2015/lib/message/message.module.js +3 -3
- package/esm2015/lib/message/shared/index.js +1 -1
- package/esm2015/lib/message/shared/message.enum.js +1 -1
- package/esm2015/lib/message/shared/message.interface.js +1 -1
- package/esm2015/lib/message/shared/message.service.js +14 -8
- package/esm2015/lib/network/index.js +1 -1
- package/esm2015/lib/network/network.interfaces.js +1 -1
- package/esm2015/lib/network/network.service.js +11 -3
- package/esm2015/lib/request/error.interceptor.js +1 -1
- package/esm2015/lib/request/error.module.js +1 -1
- package/esm2015/lib/request/index.js +1 -1
- package/esm2015/lib/request/logging.interceptor.js +2 -2
- package/esm2015/lib/request/logging.module.js +1 -1
- package/esm2015/lib/route/route.interface.js +1 -1
- package/esm2015/lib/route/route.service.js +1 -1
- package/esm2015/lib/storage/index.js +1 -1
- package/esm2015/lib/storage/storage.interface.js +1 -1
- package/esm2015/lib/storage/storage.service.js +1 -1
- package/esm2015/public_api.js +2 -1
- package/fesm2015/igo2-core.js +197 -31
- package/fesm2015/igo2-core.js.map +1 -1
- package/lib/compression/compressedData.interface.d.ts +5 -0
- package/lib/compression/compression.service.d.ts +15 -0
- package/lib/compression/index.d.ts +2 -0
- package/lib/core.module.d.ts +2 -1
- package/lib/message/shared/message.service.d.ts +5 -3
- package/lib/network/network.service.d.ts +1 -0
- package/locale/en.auth.json +29 -29
- package/locale/en.common.json +43 -43
- package/locale/en.context.json +198 -198
- package/locale/en.core.json +29 -29
- package/locale/en.geo.json +737 -709
- package/locale/en.integration.json +123 -105
- package/locale/en.json +55 -9
- package/locale/fr.auth.json +32 -32
- package/locale/fr.common.json +43 -43
- package/locale/fr.context.json +198 -198
- package/locale/fr.core.json +29 -29
- package/locale/fr.geo.json +737 -709
- package/locale/fr.integration.json +125 -107
- package/locale/fr.json +51 -5
- package/package.json +3 -2
- package/public_api.d.ts +1 -0
- package/style/all.theming.scss +5 -5
- package/style/core.theming.scss +9 -9
- package/style/foreground.scss +20 -20
- package/style/index.theming.scss +823 -740
- package/style/material.font.scss +9 -9
- package/style/partial/core.variables.scss +4 -4
- package/style/partial/media.scss +80 -80
- package/style/themes/blue.theme.scss +19 -19
- package/style/themes/bluedq.theme.scss +52 -52
- package/style/themes/bluegrey.theme.scss +16 -16
- package/style/themes/dark.theme.scss +16 -16
- package/style/themes/deeppurple.theme.scss +16 -16
- package/style/themes/indigo.theme.scss +16 -16
- package/style/themes/orange.theme.scss +16 -16
- package/style/themes/qcca.theme.scss +66 -0
- package/style/themes/teal.theme.scss +16 -16
- package/style/theming.scss +7 -7
- package/style/typography.scss +15 -15
package/fesm2015/igo2-core.js
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, NgModule, InjectionToken, APP_INITIALIZER, Optional, SkipSelf,
|
|
2
|
+
import { Injectable, NgModule, InjectionToken, APP_INITIALIZER, Injector, Inject, Optional, SkipSelf, EventEmitter } from '@angular/core';
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
4
4
|
import { HTTP_INTERCEPTORS, HttpClient, HttpErrorResponse, HttpClientModule, HttpResponse } from '@angular/common/http';
|
|
5
5
|
import { finalize, catchError, map, tap, debounceTime, startWith } from 'rxjs/operators';
|
|
6
|
-
import { BehaviorSubject, throwError, of, combineLatest, fromEvent } from 'rxjs';
|
|
6
|
+
import { BehaviorSubject, throwError, of, combineLatest, Observable, fromEvent } from 'rxjs';
|
|
7
7
|
import { uuid, ObjectUtils } from '@igo2/utils';
|
|
8
8
|
import * as i1 from '@ngx-translate/core';
|
|
9
9
|
import { TranslateLoader, TranslateModule, MissingTranslationHandler } from '@ngx-translate/core';
|
|
10
|
-
import * as
|
|
11
|
-
import { ToastrModule } from 'ngx-toastr';
|
|
12
|
-
import * as
|
|
13
|
-
import
|
|
10
|
+
import * as i1$1 from 'ngx-toastr';
|
|
11
|
+
import { ToastrModule, ToastrService } from 'ngx-toastr';
|
|
12
|
+
import * as i8 from 'ngx-indexed-db';
|
|
13
|
+
import { NgxIndexedDBModule } from 'ngx-indexed-db';
|
|
14
|
+
import * as i1$2 from '@angular/material/icon';
|
|
15
|
+
import * as i2 from '@angular/platform-browser';
|
|
14
16
|
import { HammerGestureConfig, HAMMER_GESTURE_CONFIG, HammerModule } from '@angular/platform-browser';
|
|
15
|
-
import * as i1$
|
|
16
|
-
import * as i1$
|
|
17
|
+
import * as i1$3 from '@angular/router';
|
|
18
|
+
import * as i1$4 from '@angular/cdk/layout';
|
|
17
19
|
import { Breakpoints } from '@angular/cdk/layout';
|
|
18
20
|
|
|
19
21
|
class ActivityService {
|
|
@@ -98,8 +100,8 @@ IgoActivityModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[]] })
|
|
|
98
100
|
}], null, null); })();
|
|
99
101
|
|
|
100
102
|
const version = {
|
|
101
|
-
lib: '1.
|
|
102
|
-
releaseDate:
|
|
103
|
+
lib: '1.12.0',
|
|
104
|
+
releaseDate: 1656013761086
|
|
103
105
|
};
|
|
104
106
|
|
|
105
107
|
class ConfigService {
|
|
@@ -232,7 +234,7 @@ function provideDefaultLanguageLoader(loader) {
|
|
|
232
234
|
class IgoMissingTranslationHandler {
|
|
233
235
|
handle(params) {
|
|
234
236
|
if (!params.translateService.langs.length) {
|
|
235
|
-
const error = 'Translations are not yet loaded. \
|
|
237
|
+
const error = 'Translations are not yet loaded. \
|
|
236
238
|
Check that the LanguageService is injected.';
|
|
237
239
|
throw new Error(error);
|
|
238
240
|
}
|
|
@@ -303,7 +305,7 @@ IgoMessageModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[Common
|
|
|
303
305
|
maxOpened: 4,
|
|
304
306
|
preventDuplicates: true,
|
|
305
307
|
resetTimeoutOnDuplicate: true,
|
|
306
|
-
countDuplicates:
|
|
308
|
+
countDuplicates: false,
|
|
307
309
|
includeTitleDuplicates: true
|
|
308
310
|
})]] });
|
|
309
311
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoMessageModule, [{
|
|
@@ -322,14 +324,14 @@ IgoMessageModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[Common
|
|
|
322
324
|
maxOpened: 4,
|
|
323
325
|
preventDuplicates: true,
|
|
324
326
|
resetTimeoutOnDuplicate: true,
|
|
325
|
-
countDuplicates:
|
|
327
|
+
countDuplicates: false,
|
|
326
328
|
includeTitleDuplicates: true
|
|
327
329
|
})],
|
|
328
330
|
declarations: [],
|
|
329
331
|
exports: []
|
|
330
332
|
}]
|
|
331
333
|
}], null, null); })();
|
|
332
|
-
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(IgoMessageModule, { imports: [CommonModule,
|
|
334
|
+
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(IgoMessageModule, { imports: [CommonModule, i1$1.ToastrModule] }); })();
|
|
333
335
|
|
|
334
336
|
class LanguageService {
|
|
335
337
|
constructor(translate) {
|
|
@@ -366,13 +368,16 @@ var MessageType;
|
|
|
366
368
|
})(MessageType || (MessageType = {}));
|
|
367
369
|
|
|
368
370
|
class MessageService {
|
|
369
|
-
constructor(
|
|
371
|
+
constructor(injector, configService, languageService) {
|
|
372
|
+
this.injector = injector;
|
|
370
373
|
this.configService = configService;
|
|
371
|
-
this.toastr = toastr;
|
|
372
374
|
this.languageService = languageService;
|
|
373
375
|
this.messages$ = new BehaviorSubject([]);
|
|
374
376
|
this.options = this.configService.getConfig('message') || {};
|
|
375
377
|
}
|
|
378
|
+
get toastr() {
|
|
379
|
+
return this.injector.get(ToastrService);
|
|
380
|
+
}
|
|
376
381
|
showError(httpError) {
|
|
377
382
|
httpError.error.caught = true;
|
|
378
383
|
return this.error(httpError.error.message, httpError.error.title);
|
|
@@ -458,14 +463,17 @@ class MessageService {
|
|
|
458
463
|
return message;
|
|
459
464
|
}
|
|
460
465
|
}
|
|
461
|
-
MessageService.ɵfac = function MessageService_Factory(t) { return new (t || MessageService)(i0.ɵɵinject(
|
|
466
|
+
MessageService.ɵfac = function MessageService_Factory(t) { return new (t || MessageService)(i0.ɵɵinject(Injector), i0.ɵɵinject(ConfigService), i0.ɵɵinject(LanguageService)); };
|
|
462
467
|
MessageService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: MessageService, factory: MessageService.ɵfac, providedIn: 'root' });
|
|
463
468
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MessageService, [{
|
|
464
469
|
type: Injectable,
|
|
465
470
|
args: [{
|
|
466
471
|
providedIn: 'root'
|
|
467
472
|
}]
|
|
468
|
-
}], function () { return [{ type:
|
|
473
|
+
}], function () { return [{ type: i0.Injector, decorators: [{
|
|
474
|
+
type: Inject,
|
|
475
|
+
args: [Injector]
|
|
476
|
+
}] }, { type: ConfigService }, { type: LanguageService }]; }, null); })();
|
|
469
477
|
|
|
470
478
|
class ErrorInterceptor {
|
|
471
479
|
constructor(messageService, injector) {
|
|
@@ -557,6 +565,17 @@ IgoErrorModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[]] });
|
|
|
557
565
|
type: SkipSelf
|
|
558
566
|
}] }]; }, null); })();
|
|
559
567
|
|
|
568
|
+
const dbConfig = {
|
|
569
|
+
name: 'igo2DB',
|
|
570
|
+
version: 1,
|
|
571
|
+
objectStoresMeta: [{
|
|
572
|
+
store: 'geoData',
|
|
573
|
+
storeConfig: { keyPath: 'url', autoIncrement: false },
|
|
574
|
+
storeSchema: [
|
|
575
|
+
{ name: 'regionID', keypath: 'regionID', options: { unique: false } }
|
|
576
|
+
]
|
|
577
|
+
}]
|
|
578
|
+
};
|
|
560
579
|
class IgoCoreModule {
|
|
561
580
|
constructor(matIconRegistry, domSanitizer) {
|
|
562
581
|
matIconRegistry.addSvgIconSet(domSanitizer.bypassSecurityTrustResourceUrl('./assets/igo2/core/icons/mdi.svg'));
|
|
@@ -568,7 +587,7 @@ class IgoCoreModule {
|
|
|
568
587
|
};
|
|
569
588
|
}
|
|
570
589
|
}
|
|
571
|
-
IgoCoreModule.ɵfac = function IgoCoreModule_Factory(t) { return new (t || IgoCoreModule)(i0.ɵɵinject(i1$
|
|
590
|
+
IgoCoreModule.ɵfac = function IgoCoreModule_Factory(t) { return new (t || IgoCoreModule)(i0.ɵɵinject(i1$2.MatIconRegistry), i0.ɵɵinject(i2.DomSanitizer)); };
|
|
572
591
|
IgoCoreModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoCoreModule });
|
|
573
592
|
IgoCoreModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[
|
|
574
593
|
CommonModule,
|
|
@@ -577,7 +596,8 @@ IgoCoreModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[
|
|
|
577
596
|
IgoConfigModule.forRoot(),
|
|
578
597
|
IgoErrorModule.forRoot(),
|
|
579
598
|
IgoLanguageModule.forRoot(),
|
|
580
|
-
IgoMessageModule.forRoot()
|
|
599
|
+
IgoMessageModule.forRoot(),
|
|
600
|
+
NgxIndexedDBModule.forRoot(dbConfig)
|
|
581
601
|
], IgoActivityModule,
|
|
582
602
|
IgoConfigModule,
|
|
583
603
|
IgoErrorModule,
|
|
@@ -593,7 +613,8 @@ IgoCoreModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[
|
|
|
593
613
|
IgoConfigModule.forRoot(),
|
|
594
614
|
IgoErrorModule.forRoot(),
|
|
595
615
|
IgoLanguageModule.forRoot(),
|
|
596
|
-
IgoMessageModule.forRoot()
|
|
616
|
+
IgoMessageModule.forRoot(),
|
|
617
|
+
NgxIndexedDBModule.forRoot(dbConfig)
|
|
597
618
|
],
|
|
598
619
|
declarations: [],
|
|
599
620
|
exports: [
|
|
@@ -604,9 +625,9 @@ IgoCoreModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[
|
|
|
604
625
|
IgoMessageModule
|
|
605
626
|
]
|
|
606
627
|
}]
|
|
607
|
-
}], function () { return [{ type: i1$
|
|
628
|
+
}], function () { return [{ type: i1$2.MatIconRegistry }, { type: i2.DomSanitizer }]; }, null); })();
|
|
608
629
|
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(IgoCoreModule, { imports: [CommonModule,
|
|
609
|
-
HttpClientModule, IgoActivityModule, IgoConfigModule, IgoErrorModule, IgoLanguageModule, IgoMessageModule], exports: [IgoActivityModule,
|
|
630
|
+
HttpClientModule, IgoActivityModule, IgoConfigModule, IgoErrorModule, IgoLanguageModule, IgoMessageModule, i8.NgxIndexedDBModule], exports: [IgoActivityModule,
|
|
610
631
|
IgoConfigModule,
|
|
611
632
|
IgoErrorModule,
|
|
612
633
|
IgoLanguageModule,
|
|
@@ -664,7 +685,7 @@ class LoggingInterceptor {
|
|
|
664
685
|
// Log when response observable either completes or errors
|
|
665
686
|
finalize(() => {
|
|
666
687
|
const elapsed = Date.now() - started;
|
|
667
|
-
const msg = `${req.method} "${req.urlWithParams}"
|
|
688
|
+
const msg = `${req.method} "${req.urlWithParams}"
|
|
668
689
|
${ok} in ${elapsed} ms.`;
|
|
669
690
|
console.log(msg);
|
|
670
691
|
}));
|
|
@@ -756,14 +777,14 @@ class RouteService {
|
|
|
756
777
|
return this.route.queryParams;
|
|
757
778
|
}
|
|
758
779
|
}
|
|
759
|
-
RouteService.ɵfac = function RouteService_Factory(t) { return new (t || RouteService)(i0.ɵɵinject(i1$
|
|
780
|
+
RouteService.ɵfac = function RouteService_Factory(t) { return new (t || RouteService)(i0.ɵɵinject(i1$3.Router), i0.ɵɵinject(i1$3.ActivatedRoute), i0.ɵɵinject(ROUTE_SERVICE_OPTIONS, 8)); };
|
|
760
781
|
RouteService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: RouteService, factory: RouteService.ɵfac, providedIn: 'root' });
|
|
761
782
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RouteService, [{
|
|
762
783
|
type: Injectable,
|
|
763
784
|
args: [{
|
|
764
785
|
providedIn: 'root'
|
|
765
786
|
}]
|
|
766
|
-
}], function () { return [{ type: i1$
|
|
787
|
+
}], function () { return [{ type: i1$3.Router }, { type: i1$3.ActivatedRoute }, { type: undefined, decorators: [{
|
|
767
788
|
type: Inject,
|
|
768
789
|
args: [ROUTE_SERVICE_OPTIONS]
|
|
769
790
|
}, {
|
|
@@ -914,14 +935,14 @@ class MediaService {
|
|
|
914
935
|
return media === 'desktop';
|
|
915
936
|
}
|
|
916
937
|
}
|
|
917
|
-
MediaService.ɵfac = function MediaService_Factory(t) { return new (t || MediaService)(i0.ɵɵinject(i1$
|
|
938
|
+
MediaService.ɵfac = function MediaService_Factory(t) { return new (t || MediaService)(i0.ɵɵinject(i1$4.BreakpointObserver)); };
|
|
918
939
|
MediaService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: MediaService, factory: MediaService.ɵfac, providedIn: 'root' });
|
|
919
940
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MediaService, [{
|
|
920
941
|
type: Injectable,
|
|
921
942
|
args: [{
|
|
922
943
|
providedIn: 'root'
|
|
923
944
|
}]
|
|
924
|
-
}], function () { return [{ type: i1$
|
|
945
|
+
}], function () { return [{ type: i1$4.BreakpointObserver }]; }, null); })();
|
|
925
946
|
|
|
926
947
|
var StorageScope;
|
|
927
948
|
(function (StorageScope) {
|
|
@@ -1010,6 +1031,143 @@ StorageService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: StorageSe
|
|
|
1010
1031
|
}]
|
|
1011
1032
|
}], function () { return [{ type: ConfigService }]; }, null); })();
|
|
1012
1033
|
|
|
1034
|
+
function getNumber(v, endposition, length) {
|
|
1035
|
+
/* tslint:disable:no-bitwise*/
|
|
1036
|
+
const mask = ((1 << length) - 1);
|
|
1037
|
+
return (v >> endposition) & mask;
|
|
1038
|
+
/* tslint:enable:no-bitwise*/
|
|
1039
|
+
}
|
|
1040
|
+
class CompressionService {
|
|
1041
|
+
constructor() {
|
|
1042
|
+
this.base64Index = new Map();
|
|
1043
|
+
this.indexBase64 = new Map();
|
|
1044
|
+
this.generateBase64Index();
|
|
1045
|
+
}
|
|
1046
|
+
generateBase64Index() {
|
|
1047
|
+
// https://fr.wikipedia.org/wiki/Base64
|
|
1048
|
+
// A-Z => [0, 25]
|
|
1049
|
+
for (let i = 0; i < 26; i++) {
|
|
1050
|
+
this.base64Index.set(String.fromCharCode('A'.charCodeAt(0) + i), i);
|
|
1051
|
+
this.indexBase64.set(i, String.fromCharCode('A'.charCodeAt(0) + i));
|
|
1052
|
+
}
|
|
1053
|
+
// a-z => [26, 51]
|
|
1054
|
+
for (let i = 0; i < 26; i++) {
|
|
1055
|
+
this.base64Index.set(String.fromCharCode('a'.charCodeAt(0) + i), i + 26);
|
|
1056
|
+
this.indexBase64.set(i + 26, String.fromCharCode('a'.charCodeAt(0) + i));
|
|
1057
|
+
}
|
|
1058
|
+
// 0-9 => [52, 61]
|
|
1059
|
+
for (let i = 0; i < 10; i++) {
|
|
1060
|
+
this.base64Index.set(String.fromCharCode('0'.charCodeAt(0) + i), i + 52);
|
|
1061
|
+
this.indexBase64.set(i + 52, String.fromCharCode('0'.charCodeAt(0) + i));
|
|
1062
|
+
}
|
|
1063
|
+
// + / => [62, 63]
|
|
1064
|
+
this.base64Index.set('+', 62);
|
|
1065
|
+
this.base64Index.set('/', 63);
|
|
1066
|
+
this.indexBase64.set(62, '+');
|
|
1067
|
+
this.indexBase64.set(63, '/');
|
|
1068
|
+
}
|
|
1069
|
+
compressBlob(blob) {
|
|
1070
|
+
if (!blob) {
|
|
1071
|
+
return;
|
|
1072
|
+
}
|
|
1073
|
+
const observable = new Observable((observer) => {
|
|
1074
|
+
const reader = new FileReader();
|
|
1075
|
+
reader.readAsDataURL(blob);
|
|
1076
|
+
reader.onload = () => {
|
|
1077
|
+
const base64 = reader.result.valueOf();
|
|
1078
|
+
const text64 = base64.substr(base64.indexOf(',') + 1);
|
|
1079
|
+
const compressed = this.compressStringBase64(text64);
|
|
1080
|
+
const compressedData = { length: text64.length,
|
|
1081
|
+
type: blob.type,
|
|
1082
|
+
object: compressed };
|
|
1083
|
+
observer.next(compressedData);
|
|
1084
|
+
};
|
|
1085
|
+
});
|
|
1086
|
+
return observable;
|
|
1087
|
+
}
|
|
1088
|
+
decompressBlob(compressedData) {
|
|
1089
|
+
/* tslint:disable:no-bitwise*/
|
|
1090
|
+
const object = compressedData.object;
|
|
1091
|
+
const length = compressedData.length;
|
|
1092
|
+
const decompressed = this.decompressStringBase64(object, length);
|
|
1093
|
+
const byteCharacters = atob(decompressed);
|
|
1094
|
+
const byteNumbers = new Array(byteCharacters.length);
|
|
1095
|
+
for (let i = 0; i < byteCharacters.length; i++) {
|
|
1096
|
+
byteNumbers[i] = byteCharacters.charCodeAt(i);
|
|
1097
|
+
}
|
|
1098
|
+
const byteArray = new Uint8Array(byteNumbers);
|
|
1099
|
+
const blob = new Blob([byteArray], { type: compressedData.type });
|
|
1100
|
+
/* tslint:enable:no-bitwise*/
|
|
1101
|
+
return blob;
|
|
1102
|
+
}
|
|
1103
|
+
compressStringBase64(s) {
|
|
1104
|
+
/* tslint:disable:no-bitwise*/
|
|
1105
|
+
let out = '';
|
|
1106
|
+
let bits = 16;
|
|
1107
|
+
let chr = 0;
|
|
1108
|
+
let rem = 0;
|
|
1109
|
+
for (const c of s) {
|
|
1110
|
+
const value = this.base64Index.get(c);
|
|
1111
|
+
if (bits > 6) {
|
|
1112
|
+
bits -= 6;
|
|
1113
|
+
chr += value << bits;
|
|
1114
|
+
}
|
|
1115
|
+
else {
|
|
1116
|
+
rem = 6 - bits;
|
|
1117
|
+
chr += value >> rem;
|
|
1118
|
+
out += String.fromCharCode(chr);
|
|
1119
|
+
chr = (value) << (16 - rem);
|
|
1120
|
+
bits = 16 - rem;
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
if (s.length % 8 !== 0) {
|
|
1124
|
+
out += String.fromCharCode(chr);
|
|
1125
|
+
}
|
|
1126
|
+
/* tslint:enable:no-bitwise*/
|
|
1127
|
+
return String.fromCharCode(9731) + out;
|
|
1128
|
+
}
|
|
1129
|
+
decompressStringBase64(c, length) {
|
|
1130
|
+
/* tslint:disable:no-bitwise*/
|
|
1131
|
+
if (!c) {
|
|
1132
|
+
return;
|
|
1133
|
+
}
|
|
1134
|
+
if (c.charCodeAt(0) !== 9731) {
|
|
1135
|
+
return c;
|
|
1136
|
+
}
|
|
1137
|
+
let chr = 0;
|
|
1138
|
+
let rem = 0;
|
|
1139
|
+
let bits = 16;
|
|
1140
|
+
let out = '';
|
|
1141
|
+
let j = 1;
|
|
1142
|
+
let value = c.charCodeAt(j);
|
|
1143
|
+
for (let i = 0; i < length; i++) {
|
|
1144
|
+
if (bits > 6) {
|
|
1145
|
+
bits -= 6;
|
|
1146
|
+
chr = getNumber(value, bits, 6);
|
|
1147
|
+
out += this.indexBase64.get(chr);
|
|
1148
|
+
}
|
|
1149
|
+
else {
|
|
1150
|
+
rem = 6 - bits;
|
|
1151
|
+
chr = getNumber(value, 0, bits) << rem;
|
|
1152
|
+
value = c.charCodeAt(++j);
|
|
1153
|
+
chr += getNumber(value, 16 - rem, rem);
|
|
1154
|
+
out += this.indexBase64.get(chr);
|
|
1155
|
+
bits = 16 - rem;
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
return out;
|
|
1159
|
+
/* tslint:enable:no-bitwise*/
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
CompressionService.ɵfac = function CompressionService_Factory(t) { return new (t || CompressionService)(); };
|
|
1163
|
+
CompressionService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CompressionService, factory: CompressionService.ɵfac, providedIn: 'root' });
|
|
1164
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CompressionService, [{
|
|
1165
|
+
type: Injectable,
|
|
1166
|
+
args: [{
|
|
1167
|
+
providedIn: 'root'
|
|
1168
|
+
}]
|
|
1169
|
+
}], function () { return []; }, null); })();
|
|
1170
|
+
|
|
1013
1171
|
class NetworkService {
|
|
1014
1172
|
constructor(messageService, injector) {
|
|
1015
1173
|
this.messageService = messageService;
|
|
@@ -1022,18 +1180,26 @@ class NetworkService {
|
|
|
1022
1180
|
}
|
|
1023
1181
|
checkNetworkState() {
|
|
1024
1182
|
this.onlineSubscription = fromEvent(window, 'online').subscribe(() => {
|
|
1183
|
+
if (this.previousMessageId) {
|
|
1184
|
+
this.messageService.remove(this.previousMessageId);
|
|
1185
|
+
}
|
|
1025
1186
|
const translate = this.injector.get(LanguageService).translate;
|
|
1026
1187
|
const message = translate.instant('igo.core.network.online.message');
|
|
1027
1188
|
const title = translate.instant('igo.core.network.online.title');
|
|
1028
|
-
this.messageService.info(message, title);
|
|
1189
|
+
const messageObj = this.messageService.info(message, title);
|
|
1190
|
+
this.previousMessageId = messageObj.toastId;
|
|
1029
1191
|
this.state.connection = true;
|
|
1030
1192
|
this.emitEvent();
|
|
1031
1193
|
});
|
|
1032
1194
|
this.offlineSubscription = fromEvent(window, 'offline').subscribe(() => {
|
|
1195
|
+
if (this.previousMessageId) {
|
|
1196
|
+
this.messageService.remove(this.previousMessageId);
|
|
1197
|
+
}
|
|
1033
1198
|
const translate = this.injector.get(LanguageService).translate;
|
|
1034
1199
|
const message = translate.instant('igo.core.network.offline.message');
|
|
1035
1200
|
const title = translate.instant('igo.core.network.offline.title');
|
|
1036
|
-
this.messageService.info(message, title);
|
|
1201
|
+
const messageObj = this.messageService.info(message, title);
|
|
1202
|
+
this.previousMessageId = messageObj.toastId;
|
|
1037
1203
|
this.state.connection = false;
|
|
1038
1204
|
this.emitEvent();
|
|
1039
1205
|
});
|
|
@@ -1071,5 +1237,5 @@ NetworkService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: NetworkSe
|
|
|
1071
1237
|
* Generated bundle index. Do not edit.
|
|
1072
1238
|
*/
|
|
1073
1239
|
|
|
1074
|
-
export { ActivityInterceptor, ActivityService, AnalyticsService, CONFIG_OPTIONS, ConfigService, ErrorInterceptor, IgoActivityModule, IgoConfigModule, IgoCoreModule, IgoErrorModule, IgoGestureConfig, IgoGestureModule, IgoLanguageModule, IgoLoggingModule, IgoMessageModule, IgoMissingTranslationHandler, LanguageLoader, LanguageService, LoggingInterceptor, Media, MediaOrientation, MediaService, MessageService, MessageType, NetworkService, ROUTE_SERVICE_OPTIONS, RouteService, StorageScope, StorageService, StorageServiceEventEnum, configFactory, defaultLanguageLoader, provideConfigLoader, provideConfigOptions, provideDefaultLanguageLoader, provideLanguageLoader, provideRouteServiceOptions, version };
|
|
1240
|
+
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, RouteService, StorageScope, StorageService, StorageServiceEventEnum, configFactory, defaultLanguageLoader, provideConfigLoader, provideConfigOptions, provideDefaultLanguageLoader, provideLanguageLoader, provideRouteServiceOptions, version };
|
|
1075
1241
|
//# sourceMappingURL=igo2-core.js.map
|