@rxap/services 16.0.0-dev.16 → 16.0.0-dev.17

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.
@@ -1,13 +1,98 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, isDevMode, Injectable, Optional, Inject } from '@angular/core';
3
- import { Subject, BehaviorSubject, Subscription } from 'rxjs';
2
+ import { Injectable, InjectionToken, isDevMode, Optional, Inject, inject } from '@angular/core';
3
+ import { HttpRequest, HttpParams } from '@angular/common/http';
4
+ import { TinyColor } from '@ctrl/tinycolor';
5
+ import { Subject, BehaviorSubject, Subscription, Observable } from 'rxjs';
4
6
  import { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';
5
7
  import { map, filter, delay } from 'rxjs/operators';
6
- import * as i1 from '@angular/cdk/layout';
7
- import * as i1$1 from '@angular/router';
8
+ import * as i1 from '@angular/router';
8
9
  import { NavigationStart, NavigationEnd, NavigationCancel, Router } from '@angular/router';
9
- import { HttpRequest, HttpParams } from '@angular/common/http';
10
10
  import { ToggleSubject } from '@rxap/rxjs';
11
+ import * as i1$1 from '@angular/cdk/layout';
12
+ import { ConfigService } from '@rxap/config';
13
+
14
+ class AvatarImageService {
15
+ get({ name }) {
16
+ return new HttpRequest('GET', 'https://eu.ui-avatars.com/api', {
17
+ params: new HttpParams({ fromObject: { name } }),
18
+ }).urlWithParams;
19
+ }
20
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: AvatarImageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
21
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: AvatarImageService, providedIn: 'root' }); }
22
+ }
23
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: AvatarImageService, decorators: [{
24
+ type: Injectable,
25
+ args: [{ providedIn: 'root' }]
26
+ }] });
27
+
28
+ var ColorPaletteAlgorithm;
29
+ (function (ColorPaletteAlgorithm) {
30
+ ColorPaletteAlgorithm["CONSTANTIN"] = "constantin";
31
+ ColorPaletteAlgorithm["BUCKNER"] = "buckner";
32
+ })(ColorPaletteAlgorithm || (ColorPaletteAlgorithm = {}));
33
+ function ComputeColorPalette(color, colorPalette = {}, algorithm) {
34
+ colorPalette = { ...colorPalette };
35
+ const baseLight = new TinyColor('#ffffff');
36
+ const baseDark = multiply(new TinyColor(color).toRgb(), new TinyColor(color).toRgb());
37
+ const baseTriad = new TinyColor(color).tetrad();
38
+ switch (algorithm) {
39
+ case ColorPaletteAlgorithm.CONSTANTIN:
40
+ colorPalette[50] ??= baseLight.mix(color, 12).toHexString();
41
+ colorPalette[100] ??= baseLight.mix(color, 30).toHexString();
42
+ colorPalette[200] ??= baseLight.mix(color, 50).toHexString();
43
+ colorPalette[300] ??= baseLight.mix(color, 70).toHexString();
44
+ colorPalette[400] ??= baseLight.mix(color, 85).toHexString();
45
+ colorPalette[500] ??= baseLight.mix(color, 100).toHexString();
46
+ colorPalette[600] ??= baseDark.mix(color, 87).toHexString();
47
+ colorPalette[700] ??= baseDark.mix(color, 70).toHexString();
48
+ colorPalette[800] ??= baseDark.mix(color, 54).toHexString();
49
+ colorPalette[900] ??= baseDark.mix(color, 25).toHexString();
50
+ colorPalette.A100 ??= baseDark.mix(baseTriad[4], 15).saturate(80).lighten(65).toHexString();
51
+ colorPalette.A200 ??= baseDark.mix(baseTriad[4], 15).saturate(80).lighten(55).toHexString();
52
+ colorPalette.A400 ??= baseDark.mix(baseTriad[4], 15).saturate(100).lighten(45).toHexString();
53
+ colorPalette.A700 ??= baseDark.mix(baseTriad[4], 15).saturate(100).lighten(40).toHexString();
54
+ break;
55
+ case ColorPaletteAlgorithm.BUCKNER:
56
+ colorPalette[50] ??= baseLight.mix(color, 12).toHexString();
57
+ colorPalette[100] ??= baseLight.mix(color, 30).toHexString();
58
+ colorPalette[200] ??= baseLight.mix(color, 50).toHexString();
59
+ colorPalette[300] ??= baseLight.mix(color, 70).toHexString();
60
+ colorPalette[400] ??= baseLight.mix(color, 85).toHexString();
61
+ colorPalette[500] ??= baseLight.mix(color, 100).toHexString();
62
+ colorPalette[600] ??= baseDark.mix(color, 87).toHexString();
63
+ colorPalette[700] ??= baseDark.mix(color, 70).toHexString();
64
+ colorPalette[800] ??= baseDark.mix(color, 54).toHexString();
65
+ colorPalette[900] ??= baseDark.mix(color, 25).toHexString();
66
+ colorPalette.A100 ??= baseDark.mix(baseTriad[3], 15).saturate(80).lighten(48).toHexString();
67
+ colorPalette.A200 ??= baseDark.mix(baseTriad[3], 15).saturate(80).lighten(36).toHexString();
68
+ colorPalette.A400 ??= baseDark.mix(baseTriad[3], 15).saturate(100).lighten(31).toHexString();
69
+ colorPalette.A700 ??= baseDark.mix(baseTriad[3], 15).saturate(100).lighten(28).toHexString();
70
+ break;
71
+ default:
72
+ colorPalette[50] ??= new TinyColor(color).lighten(52).toHexString();
73
+ colorPalette[100] ??= new TinyColor(color).lighten(37).toHexString();
74
+ colorPalette[200] ??= new TinyColor(color).lighten(26).toHexString();
75
+ colorPalette[300] ??= new TinyColor(color).lighten(12).toHexString();
76
+ colorPalette[400] ??= new TinyColor(color).lighten(6).toHexString();
77
+ colorPalette[500] ??= new TinyColor(color).toHexString();
78
+ colorPalette[600] ??= new TinyColor(color).darken(6).toHexString();
79
+ colorPalette[700] ??= new TinyColor(color).darken(12).toHexString();
80
+ colorPalette[800] ??= new TinyColor(color).darken(18).toHexString();
81
+ colorPalette[900] ??= new TinyColor(color).darken(24).toHexString();
82
+ colorPalette.A100 ??= new TinyColor(color).lighten(50).saturate(30).toHexString();
83
+ colorPalette.A200 ??= new TinyColor(color).lighten(30).saturate(30).toHexString();
84
+ colorPalette.A400 ??= new TinyColor(color).lighten(10).saturate(15).toHexString();
85
+ colorPalette.A700 ??= new TinyColor(color).lighten(5).saturate(5).toHexString();
86
+ break;
87
+ }
88
+ return colorPalette;
89
+ }
90
+ function multiply(rgb1, rgb2) {
91
+ rgb1.b = Math.floor(rgb1.b * rgb2.b / 255);
92
+ rgb1.g = Math.floor(rgb1.g * rgb2.g / 255);
93
+ rgb1.r = Math.floor(rgb1.r * rgb2.r / 255);
94
+ return new TinyColor('rgb ' + rgb1.r + ' ' + rgb1.g + ' ' + rgb1.b);
95
+ }
11
96
 
12
97
  const RXAP_FOOTER_COMPONENT = new InjectionToken('rxap/services/footer-component');
13
98
  function IsFooterTemplate(obj) {
@@ -184,6 +269,161 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
184
269
  args: [RXAP_FOOTER_COMPONENT]
185
270
  }] }]; } });
186
271
 
272
+ class HeaderService {
273
+ constructor(router) {
274
+ this.router = router;
275
+ this.update$ = new Subject();
276
+ this.components = [];
277
+ this.navigating$ = this.router.events.pipe(filter(event => event instanceof NavigationStart ||
278
+ event instanceof NavigationEnd ||
279
+ event instanceof NavigationCancel), map(event => event instanceof NavigationStart));
280
+ }
281
+ get countComponent() {
282
+ return this.components.length + 1;
283
+ }
284
+ addComponent(component, order = 0) {
285
+ this.components.push({
286
+ component,
287
+ order,
288
+ });
289
+ this.update$.next();
290
+ }
291
+ /**
292
+ * Returns all added components ordered based on the order property
293
+ */
294
+ getComponents() {
295
+ return this
296
+ .components
297
+ .sort((a, b) => a.order - b.order)
298
+ .map(item => item.component);
299
+ }
300
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: HeaderService, deps: [{ token: Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
301
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: HeaderService, providedIn: 'root' }); }
302
+ }
303
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: HeaderService, decorators: [{
304
+ type: Injectable,
305
+ args: [{ providedIn: 'root' }]
306
+ }], ctorParameters: function () { return [{ type: i1.Router, decorators: [{
307
+ type: Inject,
308
+ args: [Router]
309
+ }] }]; } });
310
+
311
+ class ImageLoaderService {
312
+ constructor() {
313
+ this.loading = new Map();
314
+ this.loaded = new Map();
315
+ }
316
+ load(imageSrc) {
317
+ if (this.loaded.has(imageSrc)) {
318
+ return Promise.resolve();
319
+ }
320
+ if (this.loading.has(imageSrc)) {
321
+ return this.loading.get(imageSrc);
322
+ }
323
+ const loading = new Promise((resolve, reject) => {
324
+ const image = new Image();
325
+ image.src = imageSrc;
326
+ image.onerror = reject;
327
+ image.onload = () => resolve();
328
+ }).then(() => {
329
+ this.loaded.set(imageSrc, true);
330
+ }).finally(() => {
331
+ this.loading.delete(imageSrc);
332
+ });
333
+ this.loading.set(imageSrc, loading);
334
+ return loading;
335
+ }
336
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ImageLoaderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
337
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ImageLoaderService, providedIn: 'root' }); }
338
+ }
339
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ImageLoaderService, decorators: [{
340
+ type: Injectable,
341
+ args: [{ providedIn: 'root' }]
342
+ }] });
343
+
344
+ class LoadingIndicatorService {
345
+ constructor() {
346
+ this.loading$ = new ToggleSubject(true);
347
+ this._attachedLoadingSubscription = new Subscription();
348
+ this.isLoading$ = this.loading$.asObservable();
349
+ }
350
+ attachLoading(loading$) {
351
+ this._attachedLoadingSubscription.add(loading$.pipe(map(Boolean), delay(0)).subscribe(this.loading$.next));
352
+ }
353
+ ngOnDestroy() {
354
+ this._attachedLoadingSubscription.unsubscribe();
355
+ }
356
+ disable() {
357
+ setTimeout(() => {
358
+ this.loading$.disable();
359
+ });
360
+ }
361
+ enable() {
362
+ setTimeout(() => {
363
+ this.loading$.enable();
364
+ });
365
+ }
366
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LoadingIndicatorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
367
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LoadingIndicatorService }); }
368
+ }
369
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LoadingIndicatorService, decorators: [{
370
+ type: Injectable
371
+ }], ctorParameters: function () { return []; } });
372
+
373
+ class LocalStorageService {
374
+ has(key) {
375
+ return localStorage.getItem(key) !== null;
376
+ }
377
+ set(key, value) {
378
+ if (typeof value !== 'string') {
379
+ localStorage.setItem(key, JSON.stringify(value));
380
+ }
381
+ else {
382
+ localStorage.setItem(key, value);
383
+ }
384
+ }
385
+ get(key) {
386
+ return localStorage.getItem(key);
387
+ }
388
+ remove(key) {
389
+ localStorage.removeItem(key);
390
+ }
391
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LocalStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
392
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LocalStorageService, providedIn: 'root' }); }
393
+ }
394
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LocalStorageService, decorators: [{
395
+ type: Injectable,
396
+ args: [{ providedIn: 'root' }]
397
+ }] });
398
+
399
+ function ObserveCurrentThemeDensity() {
400
+ return new Observable((subscriber) => {
401
+ const observer = new MutationObserver((mutations) => {
402
+ mutations.forEach((mutation) => {
403
+ if (mutation.type === 'attributes' && mutation.attributeName === 'class') {
404
+ const classList = mutation.target.classList;
405
+ const matchingClasses = Array.from(classList).filter((className) => /density-\d/.test(className));
406
+ if (matchingClasses.length > 0) {
407
+ console.log(`Matched classes: ${matchingClasses}`);
408
+ const match = matchingClasses[0].match(/density-(\d)/);
409
+ if (match) {
410
+ subscriber.next(Number(match[1]) * -1);
411
+ }
412
+ }
413
+ else {
414
+ subscriber.next(0);
415
+ }
416
+ }
417
+ });
418
+ });
419
+ subscriber.add(() => observer.disconnect());
420
+ observer.observe(document.body, {
421
+ attributes: true,
422
+ attributeFilter: ['class'],
423
+ });
424
+ });
425
+ }
426
+
187
427
  class ResetService {
188
428
  constructor() {
189
429
  this.view$ = new Subject();
@@ -210,6 +450,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
210
450
 
211
451
  class ThemeService {
212
452
  constructor(mediaMatcher) {
453
+ this.config = inject(ConfigService);
213
454
  const darkModeCached = localStorage.getItem('rxap-dark-mode');
214
455
  const darkModeMediaQuery = mediaMatcher.matchMedia('(prefers-color-scheme: dark)');
215
456
  let darkMode = null;
@@ -249,52 +490,151 @@ class ThemeService {
249
490
  this.darkMode$.next(checked);
250
491
  }
251
492
  }
252
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ThemeService, deps: [{ token: i1.MediaMatcher }], target: i0.ɵɵFactoryTarget.Injectable }); }
253
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ThemeService, providedIn: 'root' }); }
254
- }
255
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ThemeService, decorators: [{
256
- type: Injectable,
257
- args: [{ providedIn: 'root' }]
258
- }], ctorParameters: function () { return [{ type: i1.MediaMatcher }]; } });
259
-
260
- class HeaderService {
261
- constructor(router) {
262
- this.router = router;
263
- this.update$ = new Subject();
264
- this.components = [];
265
- this.navigating$ = this.router.events.pipe(filter(event => event instanceof NavigationStart ||
266
- event instanceof NavigationEnd ||
267
- event instanceof NavigationCancel), map(event => event instanceof NavigationStart));
493
+ setDensity(density) {
494
+ document.body.classList.remove('density-0', 'density-1', 'density-2', 'density-3');
495
+ if (density < 0) {
496
+ document.body.classList.add(`density${density}`);
497
+ }
268
498
  }
269
- get countComponent() {
270
- return this.components.length + 1;
499
+ getDensity() {
500
+ let density = 0;
501
+ document.body.classList.forEach((className) => {
502
+ const match = className.match(/density-([123])/);
503
+ if (match) {
504
+ density = Number(match[1]) * -1;
505
+ }
506
+ });
507
+ return density;
508
+ }
509
+ setTypography(typography) {
510
+ const classRemoveList = [];
511
+ document.body.classList.forEach((className) => {
512
+ const match = className.match(/typography-/);
513
+ if (match) {
514
+ classRemoveList.push(className);
515
+ }
516
+ });
517
+ document.body.classList.remove(...classRemoveList);
518
+ if (typography) {
519
+ document.body.classList.add(`typography-${typography}`);
520
+ }
271
521
  }
272
- addComponent(component, order = 0) {
273
- this.components.push({
274
- component,
275
- order,
522
+ getTypography() {
523
+ let typography = null;
524
+ document.body.classList.forEach((className) => {
525
+ const match = className.match(/typography-(.*)/);
526
+ if (match) {
527
+ typography = match[1];
528
+ }
276
529
  });
277
- this.update$.next();
530
+ return typography;
531
+ }
532
+ getAvailableColorPalettes() {
533
+ const colorPalettesConfigs = this.config.get('colorPalettes', {});
534
+ const availableColorPalettes = Object.keys(colorPalettesConfigs);
535
+ availableColorPalettes.unshift('default');
536
+ return availableColorPalettes;
537
+ }
538
+ getColorPalette(colorPaletteName) {
539
+ const colorPaletteConfig = this.config.getOrThrow(`colorPalettes.${colorPaletteName}`);
540
+ return this.coerceColorPalette(colorPaletteConfig);
541
+ }
542
+ getAvailableThemes() {
543
+ const themeConfigs = this.config.get('themes', {});
544
+ const availableThemes = Object.keys(themeConfigs);
545
+ availableThemes.unshift('default');
546
+ return availableThemes;
547
+ }
548
+ setTheme(themeName) {
549
+ if (themeName === 'default') {
550
+ this.resetToDefaultTheme();
551
+ return;
552
+ }
553
+ const theme = this.getTheme(themeName);
554
+ if (theme.primaryColor?.color) {
555
+ this.setCssColorVariables('primary', theme.primaryColor.color);
556
+ }
557
+ if (theme.accentColor?.color) {
558
+ this.setCssColorVariables('accent', theme.accentColor.color);
559
+ }
560
+ if (theme.warnColor?.color) {
561
+ this.setCssColorVariables('warn', theme.warnColor.color);
562
+ }
563
+ if (theme.density !== undefined) {
564
+ this.setDensity(theme.density);
565
+ }
566
+ if (theme.typography) {
567
+ this.setTypography(theme.typography);
568
+ }
569
+ document.body.style.setProperty(`--theme-name`, themeName);
570
+ }
571
+ getCurrentTheme() {
572
+ return document.body.style.getPropertyValue('--theme-name') ?? 'default';
573
+ }
574
+ coerceColorPalette(colorPaletteConfig) {
575
+ let colorPalette = {};
576
+ if (colorPaletteConfig.color) {
577
+ if (Object.keys(colorPaletteConfig.color).length !== 14) {
578
+ // the color palette is not complete
579
+ if (colorPaletteConfig.base) {
580
+ colorPalette =
581
+ ComputeColorPalette(colorPaletteConfig.base, colorPaletteConfig.color, colorPaletteConfig.algorithm);
582
+ }
583
+ }
584
+ colorPalette = colorPaletteConfig.color;
585
+ }
586
+ else if (colorPaletteConfig.base) {
587
+ colorPalette = ComputeColorPalette(colorPaletteConfig.base, {}, colorPaletteConfig.algorithm);
588
+ }
589
+ if (Object.keys(colorPalette).length === 0) {
590
+ throw new Error('FATAL: The color palette has neither a base nor a color property');
591
+ }
592
+ return colorPalette;
278
593
  }
279
- /**
280
- * Returns all added components ordered based on the order property
281
- */
282
- getComponents() {
283
- return this
284
- .components
285
- .sort((a, b) => a.order - b.order)
286
- .map(item => item.component);
594
+ getTheme(themeName) {
595
+ const themeConfig = this.config.getOrThrow(`themes.${themeName}`);
596
+ if (themeConfig.accentColor) {
597
+ themeConfig.accentColor.color = this.coerceColorPalette(themeConfig.accentColor);
598
+ }
599
+ if (themeConfig.primaryColor) {
600
+ themeConfig.primaryColor.color = this.coerceColorPalette(themeConfig.primaryColor);
601
+ }
602
+ if (themeConfig.warnColor) {
603
+ themeConfig.warnColor.color = this.coerceColorPalette(themeConfig.warnColor);
604
+ }
605
+ return themeConfig;
606
+ }
607
+ resetToDefaultTheme() {
608
+ this.clearCssColorVariables('primary');
609
+ this.clearCssColorVariables('accent');
610
+ this.clearCssColorVariables('warn');
611
+ this.setDensity(0);
612
+ this.setTypography();
613
+ document.body.style.removeProperty(`--theme-name`);
614
+ }
615
+ setCssColorVariables(name, colorPalette) {
616
+ this.clearCssColorVariables(name);
617
+ for (const [index, color] of Object.entries(colorPalette)) {
618
+ document.body.style.setProperty(`--${name}-${index}`, color);
619
+ }
287
620
  }
288
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: HeaderService, deps: [{ token: Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
289
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: HeaderService, providedIn: 'root' }); }
621
+ clearCssColorVariables(name) {
622
+ document.body.style.removeProperty(`--${name}-50`);
623
+ for (let index = 100; index <= 900; index += 100) {
624
+ document.body.style.removeProperty(`--${name}-${index}`);
625
+ }
626
+ document.body.style.removeProperty(`--${name}-a100`);
627
+ document.body.style.removeProperty(`--${name}-a200`);
628
+ document.body.style.removeProperty(`--${name}-a400`);
629
+ document.body.style.removeProperty(`--${name}-a700`);
630
+ }
631
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ThemeService, deps: [{ token: i1$1.MediaMatcher }], target: i0.ɵɵFactoryTarget.Injectable }); }
632
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ThemeService, providedIn: 'root' }); }
290
633
  }
291
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: HeaderService, decorators: [{
634
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ThemeService, decorators: [{
292
635
  type: Injectable,
293
636
  args: [{ providedIn: 'root' }]
294
- }], ctorParameters: function () { return [{ type: i1$1.Router, decorators: [{
295
- type: Inject,
296
- args: [Router]
297
- }] }]; } });
637
+ }], ctorParameters: function () { return [{ type: i1$1.MediaMatcher }]; } });
298
638
 
299
639
  class VersionService {
300
640
  constructor() {
@@ -320,32 +660,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
320
660
  args: [{ providedIn: 'root' }]
321
661
  }] });
322
662
 
323
- class LocalStorageService {
324
- has(key) {
325
- return localStorage.getItem(key) !== null;
326
- }
327
- set(key, value) {
328
- if (typeof value !== 'string') {
329
- localStorage.setItem(key, JSON.stringify(value));
330
- }
331
- else {
332
- localStorage.setItem(key, value);
333
- }
334
- }
335
- get(key) {
336
- return localStorage.getItem(key);
337
- }
338
- remove(key) {
339
- localStorage.removeItem(key);
340
- }
341
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LocalStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
342
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LocalStorageService, providedIn: 'root' }); }
343
- }
344
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LocalStorageService, decorators: [{
345
- type: Injectable,
346
- args: [{ providedIn: 'root' }]
347
- }] });
348
-
349
663
  class WindowContainerSidenavService {
350
664
  constructor() {
351
665
  this.add$ = new Subject();
@@ -377,85 +691,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
377
691
  args: [{ providedIn: 'root' }]
378
692
  }] });
379
693
 
380
- class ImageLoaderService {
381
- constructor() {
382
- this.loading = new Map();
383
- this.loaded = new Map();
384
- }
385
- load(imageSrc) {
386
- if (this.loaded.has(imageSrc)) {
387
- return Promise.resolve();
388
- }
389
- if (this.loading.has(imageSrc)) {
390
- return this.loading.get(imageSrc);
391
- }
392
- const loading = new Promise((resolve, reject) => {
393
- const image = new Image();
394
- image.src = imageSrc;
395
- image.onerror = reject;
396
- image.onload = () => resolve();
397
- }).then(() => {
398
- this.loaded.set(imageSrc, true);
399
- }).finally(() => {
400
- this.loading.delete(imageSrc);
401
- });
402
- this.loading.set(imageSrc, loading);
403
- return loading;
404
- }
405
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ImageLoaderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
406
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ImageLoaderService, providedIn: 'root' }); }
407
- }
408
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ImageLoaderService, decorators: [{
409
- type: Injectable,
410
- args: [{ providedIn: 'root' }]
411
- }] });
412
-
413
- class AvatarImageService {
414
- get({ name }) {
415
- return new HttpRequest('GET', 'https://eu.ui-avatars.com/api', {
416
- params: new HttpParams({ fromObject: { name } }),
417
- }).urlWithParams;
418
- }
419
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: AvatarImageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
420
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: AvatarImageService, providedIn: 'root' }); }
421
- }
422
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: AvatarImageService, decorators: [{
423
- type: Injectable,
424
- args: [{ providedIn: 'root' }]
425
- }] });
426
-
427
- class LoadingIndicatorService {
428
- constructor() {
429
- this.loading$ = new ToggleSubject(true);
430
- this._attachedLoadingSubscription = new Subscription();
431
- this.isLoading$ = this.loading$.asObservable();
432
- }
433
- attachLoading(loading$) {
434
- this._attachedLoadingSubscription.add(loading$.pipe(map(Boolean), delay(0)).subscribe(this.loading$.next));
435
- }
436
- ngOnDestroy() {
437
- this._attachedLoadingSubscription.unsubscribe();
438
- }
439
- disable() {
440
- setTimeout(() => {
441
- this.loading$.disable();
442
- });
443
- }
444
- enable() {
445
- setTimeout(() => {
446
- this.loading$.enable();
447
- });
448
- }
449
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LoadingIndicatorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
450
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LoadingIndicatorService }); }
451
- }
452
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LoadingIndicatorService, decorators: [{
453
- type: Injectable
454
- }], ctorParameters: function () { return []; } });
694
+ // region
695
+ // endregion
455
696
 
456
697
  /**
457
698
  * Generated bundle index. Do not edit.
458
699
  */
459
700
 
460
- export { AvatarImageService, FooterService, HeaderService, ImageLoaderService, IsFooterComponent, IsFooterTemplate, LoadingIndicatorService, LocalStorageService, RXAP_FOOTER_COMPONENT, ResetService, ThemeService, VersionService, WindowContainerSidenavService };
701
+ export { AvatarImageService, ColorPaletteAlgorithm, ComputeColorPalette, FooterService, HeaderService, ImageLoaderService, IsFooterComponent, IsFooterTemplate, LoadingIndicatorService, LocalStorageService, ObserveCurrentThemeDensity, RXAP_FOOTER_COMPONENT, ResetService, ThemeService, VersionService, WindowContainerSidenavService };
461
702
  //# sourceMappingURL=rxap-services.mjs.map