mesauth-angular 1.1.4 → 1.1.6

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,1233 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { InjectionToken, makeEnvironmentProviders, provideAppInitializer, inject, Injectable, NgModule, EventEmitter, signal, HostListener, HostBinding, Output, Component, ViewChild } from '@angular/core';
3
- import { HttpClient } from '@angular/common/http';
4
- import { HubConnectionBuilder, LogLevel } from '@microsoft/signalr';
5
- import { BehaviorSubject, Subject, throwError } from 'rxjs';
6
- import { filter, debounceTime, tap, catchError, takeUntil } from 'rxjs/operators';
7
- import * as i2 from '@angular/router';
8
- import { Router, NavigationEnd } from '@angular/router';
9
- import * as i3 from '@angular/common';
10
- import { NgIf, CommonModule, NgFor } from '@angular/common';
11
-
12
- /** Injection token for MesAuth configuration */
13
- const MES_AUTH_CONFIG = new InjectionToken('MES_AUTH_CONFIG');
14
- /**
15
- * Provides MesAuth with configuration.
16
- * This is the recommended way to set up mesauth-angular in standalone apps.
17
- *
18
- * @example
19
- * ```typescript
20
- * // app.config.ts
21
- * export const appConfig: ApplicationConfig = {
22
- * providers: [
23
- * provideHttpClient(withInterceptors([mesAuthInterceptor])),
24
- * provideMesAuth({
25
- * apiBaseUrl: 'https://auth.example.com',
26
- * userBaseUrl: 'https://app.example.com'
27
- * })
28
- * ]
29
- * };
30
- * ```
31
- */
32
- function provideMesAuth(config) {
33
- return makeEnvironmentProviders([
34
- { provide: MES_AUTH_CONFIG, useValue: config },
35
- MesAuthService,
36
- provideAppInitializer(() => {
37
- const mesAuthService = inject(MesAuthService);
38
- const httpClient = inject(HttpClient);
39
- const router = inject(Router);
40
- mesAuthService.init(config, httpClient, router);
41
- })
42
- ]);
43
- }
44
- var NotificationType;
45
- (function (NotificationType) {
46
- NotificationType["Info"] = "Info";
47
- NotificationType["Warning"] = "Warning";
48
- NotificationType["Error"] = "Error";
49
- NotificationType["Success"] = "Success";
50
- })(NotificationType || (NotificationType = {}));
51
- class MesAuthService {
52
- hubConnection = null;
53
- _currentUser = new BehaviorSubject(null);
54
- currentUser$ = this._currentUser.asObservable();
55
- _notifications = new Subject();
56
- notifications$ = this._notifications.asObservable();
57
- apiBase = '';
58
- config = null;
59
- http;
60
- router;
61
- constructor() {
62
- // Empty constructor - all dependencies passed to init()
63
- }
64
- isProtectedRoute(url) {
65
- // Consider routes protected if they don't include auth-related paths
66
- return !url.includes('/login') && !url.includes('/auth') && !url.includes('/signin') && !url.includes('/logout');
67
- }
68
- init(config, httpClient, router) {
69
- this.config = config;
70
- this.http = httpClient;
71
- this.router = router;
72
- this.apiBase = config.apiBaseUrl.replace(/\/$/, '');
73
- // Listen for route changes - only refresh user data if needed for SPA navigation
74
- // This helps maintain authentication state in single-page applications
75
- if (this.router) {
76
- this.router.events
77
- .pipe(filter(event => event instanceof NavigationEnd), debounceTime(1000) // Longer debounce to avoid interfering with login flow
78
- )
79
- .subscribe((event) => {
80
- // Only refresh if user is logged in and navigating to protected routes
81
- // Avoid refreshing during login/logout flows
82
- if (this._currentUser.value && this.isProtectedRoute(event.url)) {
83
- // Small delay to ensure any login/logout operations complete
84
- setTimeout(() => {
85
- if (this._currentUser.value) {
86
- this.refreshUser();
87
- }
88
- }, 100);
89
- }
90
- });
91
- }
92
- this.fetchCurrentUser();
93
- }
94
- getConfig() {
95
- return this.config;
96
- }
97
- fetchCurrentUser() {
98
- if (!this.apiBase)
99
- return;
100
- const url = `${this.apiBase}/auth/me`;
101
- this.http.get(url, { withCredentials: this.config?.withCredentials ?? true }).subscribe({
102
- next: (u) => {
103
- this._currentUser.next(u);
104
- if (u && this.config) {
105
- this.startConnection(this.config);
106
- // Only fetch notifications after confirming user is logged in
107
- this.fetchInitialNotifications();
108
- }
109
- },
110
- error: (err) => {
111
- // Silently handle auth errors (401/403) - user is not logged in
112
- if (err.status === 401 || err.status === 403) {
113
- this._currentUser.next(null);
114
- }
115
- }
116
- });
117
- }
118
- fetchInitialNotifications() {
119
- // Skip if no user is logged in or apiBase not set
120
- if (!this.apiBase || !this._currentUser.value)
121
- return;
122
- this.http.get(`${this.apiBase}/notif/me`, { withCredentials: this.config?.withCredentials ?? true }).subscribe({
123
- next: (notifications) => {
124
- if (Array.isArray(notifications?.items)) {
125
- notifications.items.forEach((n) => this._notifications.next(n));
126
- }
127
- },
128
- error: (err) => {
129
- // Silently handle auth errors (401/403) - user is not logged in
130
- // No need to emit anything
131
- }
132
- });
133
- }
134
- getUnreadCount() {
135
- return this.http.get(`${this.apiBase}/notif/me/unread-count`, { withCredentials: this.config?.withCredentials ?? true });
136
- }
137
- getNotifications(page = 1, pageSize = 20, includeRead = false, type) {
138
- let url = `${this.apiBase}/notif/me?page=${page}&pageSize=${pageSize}&includeRead=${includeRead}`;
139
- if (type) {
140
- url += `&type=${type}`;
141
- }
142
- return this.http.get(url, { withCredentials: this.config?.withCredentials ?? true });
143
- }
144
- markAsRead(notificationId) {
145
- return this.http.patch(`${this.apiBase}/notif/${notificationId}/read`, {}, { withCredentials: this.config?.withCredentials ?? true });
146
- }
147
- markAllAsRead() {
148
- return this.http.patch(`${this.apiBase}/notif/me/read-all`, {}, { withCredentials: this.config?.withCredentials ?? true });
149
- }
150
- deleteNotification(notificationId) {
151
- return this.http.delete(`${this.apiBase}/notif/${notificationId}`, { withCredentials: this.config?.withCredentials ?? true });
152
- }
153
- /**
154
- * Get frontend routes assigned to the current user
155
- * Returns routes grouped by application
156
- */
157
- getFrontEndRoutes() {
158
- if (!this.apiBase)
159
- throw new Error('MesAuth not initialized');
160
- return this.http.get(`${this.apiBase}/fe-routes/me`, { withCredentials: this.config?.withCredentials ?? true });
161
- }
162
- /**
163
- * Get master routes for a specific application
164
- * @param appId - The application ID
165
- */
166
- getRouteMasters(appId) {
167
- if (!this.apiBase)
168
- throw new Error('MesAuth not initialized');
169
- return this.http.get(`${this.apiBase}/fe-routes/masters/${appId}`, { withCredentials: this.config?.withCredentials ?? true });
170
- }
171
- /**
172
- * Register/sync frontend routes for an application
173
- * This is typically called on app startup to sync routes from the frontend app
174
- * @param appId - The application ID (passed via X-App-Id header)
175
- * @param routes - Array of route definitions
176
- */
177
- registerFrontEndRoutes(appId, routes) {
178
- if (!this.apiBase)
179
- throw new Error('MesAuth not initialized');
180
- const headers = { 'X-App-Id': appId };
181
- return this.http.post(`${this.apiBase}/fe-routes/register`, routes, {
182
- headers,
183
- withCredentials: this.config?.withCredentials ?? true
184
- });
185
- }
186
- /**
187
- * Create a new route master
188
- * @param appId - The application ID
189
- * @param route - Route details
190
- */
191
- createRouteMaster(appId, route) {
192
- if (!this.apiBase)
193
- throw new Error('MesAuth not initialized');
194
- return this.http.post(`${this.apiBase}/fe-routes/masters`, {
195
- appId,
196
- ...route
197
- }, { withCredentials: this.config?.withCredentials ?? true });
198
- }
199
- /**
200
- * Update an existing route master
201
- * @param routeId - The route master ID
202
- * @param route - Updated route details
203
- */
204
- updateRouteMaster(routeId, route) {
205
- if (!this.apiBase)
206
- throw new Error('MesAuth not initialized');
207
- return this.http.put(`${this.apiBase}/fe-routes/masters/${routeId}`, route, {
208
- withCredentials: this.config?.withCredentials ?? true
209
- });
210
- }
211
- /**
212
- * Delete a route master
213
- * @param routeId - The route master ID
214
- */
215
- deleteRouteMaster(routeId) {
216
- if (!this.apiBase)
217
- throw new Error('MesAuth not initialized');
218
- return this.http.delete(`${this.apiBase}/fe-routes/masters/${routeId}`, {
219
- withCredentials: this.config?.withCredentials ?? true
220
- });
221
- }
222
- /**
223
- * Assign a route to a role
224
- * @param routeMasterId - The route master ID
225
- * @param roleId - The role ID (GUID)
226
- */
227
- assignRouteToRole(routeMasterId, roleId) {
228
- if (!this.apiBase)
229
- throw new Error('MesAuth not initialized');
230
- return this.http.post(`${this.apiBase}/fe-routes/mappings`, {
231
- routeMasterId,
232
- roleId
233
- }, { withCredentials: this.config?.withCredentials ?? true });
234
- }
235
- /**
236
- * Remove a route assignment from a role
237
- * @param mappingId - The mapping ID
238
- */
239
- removeRouteFromRole(mappingId) {
240
- if (!this.apiBase)
241
- throw new Error('MesAuth not initialized');
242
- return this.http.delete(`${this.apiBase}/fe-routes/mappings/${mappingId}`, {
243
- withCredentials: this.config?.withCredentials ?? true
244
- });
245
- }
246
- /**
247
- * Get route-to-role mappings for a specific role
248
- * @param roleId - The role ID (GUID)
249
- */
250
- getRouteMappingsByRole(roleId) {
251
- if (!this.apiBase)
252
- throw new Error('MesAuth not initialized');
253
- return this.http.get(`${this.apiBase}/fe-routes/mappings?roleId=${roleId}`, {
254
- withCredentials: this.config?.withCredentials ?? true
255
- });
256
- }
257
- startConnection(config) {
258
- if (this.hubConnection)
259
- return;
260
- const signalrUrl = config.apiBaseUrl.replace(/\/$/, '') + '/hub/notification';
261
- const builder = new HubConnectionBuilder()
262
- .withUrl(signalrUrl, { withCredentials: config.withCredentials ?? true })
263
- .withAutomaticReconnect()
264
- .configureLogging(LogLevel.Warning);
265
- this.hubConnection = builder.build();
266
- this.hubConnection.on('ReceiveNotification', (n) => {
267
- this._notifications.next(n);
268
- });
269
- this.hubConnection.start().then(() => { }).catch((err) => { });
270
- this.hubConnection.onclose(() => { });
271
- this.hubConnection.onreconnecting(() => { });
272
- this.hubConnection.onreconnected(() => { });
273
- }
274
- stop() {
275
- if (!this.hubConnection)
276
- return;
277
- this.hubConnection.stop().catch(() => { });
278
- this.hubConnection = null;
279
- }
280
- logout() {
281
- const url = `${this.apiBase}/auth/logout`;
282
- return this.http.post(url, {}, { withCredentials: this.config?.withCredentials ?? true }).pipe(tap(() => {
283
- this._currentUser.next(null);
284
- this.stop();
285
- }));
286
- }
287
- get currentUser() {
288
- return this._currentUser.value;
289
- }
290
- get isAuthenticated() {
291
- return this._currentUser.value !== null;
292
- }
293
- refreshUser() {
294
- this.fetchCurrentUser();
295
- }
296
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MesAuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
297
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MesAuthService });
298
- }
299
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MesAuthService, decorators: [{
300
- type: Injectable
301
- }], ctorParameters: () => [] });
302
-
303
- // Track if we're currently redirecting to prevent loopback
304
- let isRedirecting = false;
305
- /**
306
- * Functional HTTP interceptor for handling 401/403 auth errors.
307
- * Redirects to login page on 401, and to 403 page on 403.
308
- * Includes loopback prevention to avoid infinite redirects.
309
- */
310
- const mesAuthInterceptor = (req, next) => {
311
- const authService = inject(MesAuthService);
312
- const router = inject(Router);
313
- return next(req).pipe(catchError((error) => {
314
- const status = error.status;
315
- // Check if we should handle this error and prevent loopback
316
- if ((status === 401 || status === 403) && !isRedirecting) {
317
- const config = authService.getConfig();
318
- const baseUrl = config?.userBaseUrl || '';
319
- // Use router URL for internal navigation (cleaner URLs)
320
- // Falls back to window.location for full URL if needed
321
- const currentUrl = router.url + (window.location.hash || '');
322
- const returnUrl = encodeURIComponent(currentUrl);
323
- // Avoid loops if already on auth/unauth pages
324
- const isLoginPage = currentUrl.includes('/login');
325
- const is403Page = currentUrl.includes('/403');
326
- const isAuthPage = currentUrl.includes('/auth');
327
- const isMeAuthPage = req.url.includes('/auth/me');
328
- // Check if user is authenticated
329
- const isAuthenticated = authService.isAuthenticated;
330
- if (status === 401 && !isLoginPage && !isAuthPage && !isAuthenticated && !isMeAuthPage) {
331
- isRedirecting = true;
332
- // Reset flag after a delay to allow future redirects after user returns
333
- setTimeout(() => { isRedirecting = false; }, 5000);
334
- window.location.href = `${baseUrl}/login?returnUrl=${returnUrl}`;
335
- }
336
- else if (status === 403 && !is403Page) {
337
- isRedirecting = true;
338
- setTimeout(() => { isRedirecting = false; }, 5000);
339
- window.location.href = `${baseUrl}/403?returnUrl=${returnUrl}`;
340
- }
341
- }
342
- return throwError(() => error);
343
- }));
344
- };
345
-
346
- class MesAuthModule {
347
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MesAuthModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
348
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.16", ngImport: i0, type: MesAuthModule });
349
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MesAuthModule, providers: [
350
- MesAuthService
351
- ] });
352
- }
353
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MesAuthModule, decorators: [{
354
- type: NgModule,
355
- args: [{
356
- providers: [
357
- MesAuthService
358
- ]
359
- }]
360
- }] });
361
-
362
- class ThemeService {
363
- _currentTheme = new BehaviorSubject('light');
364
- currentTheme$ = this._currentTheme.asObservable();
365
- observer = null;
366
- constructor() {
367
- this.detectTheme();
368
- this.startWatching();
369
- }
370
- ngOnDestroy() {
371
- this.stopWatching();
372
- }
373
- detectTheme() {
374
- const html = document.documentElement;
375
- const isDark = html.classList.contains('dark') ||
376
- html.getAttribute('data-theme') === 'dark' ||
377
- html.getAttribute('theme') === 'dark' ||
378
- html.getAttribute('data-coreui-theme') === 'dark';
379
- this._currentTheme.next(isDark ? 'dark' : 'light');
380
- }
381
- startWatching() {
382
- if (typeof MutationObserver === 'undefined') {
383
- // Fallback for older browsers - check periodically
384
- setInterval(() => this.detectTheme(), 1000);
385
- return;
386
- }
387
- this.observer = new MutationObserver(() => {
388
- this.detectTheme();
389
- });
390
- this.observer.observe(document.documentElement, {
391
- attributes: true,
392
- attributeFilter: ['class', 'data-theme', 'theme', 'data-coreui-theme']
393
- });
394
- }
395
- stopWatching() {
396
- if (this.observer) {
397
- this.observer.disconnect();
398
- this.observer = null;
399
- }
400
- }
401
- get currentTheme() {
402
- return this._currentTheme.value;
403
- }
404
- // Method to manually set theme if needed
405
- setTheme(theme) {
406
- this._currentTheme.next(theme);
407
- }
408
- // Re-detect theme from DOM
409
- refreshTheme() {
410
- this.detectTheme();
411
- }
412
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ThemeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
413
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ThemeService, providedIn: 'root' });
414
- }
415
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ThemeService, decorators: [{
416
- type: Injectable,
417
- args: [{
418
- providedIn: 'root'
419
- }]
420
- }], ctorParameters: () => [] });
421
-
422
- class UserProfileComponent {
423
- authService;
424
- router;
425
- themeService;
426
- cdr;
427
- notificationClick = new EventEmitter();
428
- get themeClass() {
429
- return `theme-${this.currentTheme}`;
430
- }
431
- currentUser = signal(null, ...(ngDevMode ? [{ debugName: "currentUser" }] : []));
432
- currentTheme = 'light';
433
- unreadCount = 0;
434
- dropdownOpen = false;
435
- hasUser = false;
436
- destroy$ = new Subject();
437
- // Signal to force avatar refresh
438
- avatarRefresh = signal(Date.now(), ...(ngDevMode ? [{ debugName: "avatarRefresh" }] : []));
439
- constructor(authService, router, themeService, cdr) {
440
- this.authService = authService;
441
- this.router = router;
442
- this.themeService = themeService;
443
- this.cdr = cdr;
444
- }
445
- ngOnInit() {
446
- this.authService.currentUser$
447
- .pipe(takeUntil(this.destroy$))
448
- .subscribe(user => {
449
- this.currentUser.set(user);
450
- this.hasUser = !!user;
451
- // Force avatar refresh when user changes
452
- this.avatarRefresh.set(Date.now());
453
- if (!this.hasUser) {
454
- this.unreadCount = 0;
455
- }
456
- else {
457
- this.loadUnreadCount();
458
- }
459
- this.cdr.markForCheck();
460
- });
461
- this.themeService.currentTheme$
462
- .pipe(takeUntil(this.destroy$))
463
- .subscribe(theme => {
464
- this.currentTheme = theme;
465
- });
466
- // Listen for new notifications
467
- this.authService.notifications$
468
- .pipe(takeUntil(this.destroy$))
469
- .subscribe(() => {
470
- console.log('Notification received, updating unread count');
471
- if (this.hasUser) {
472
- this.loadUnreadCount();
473
- }
474
- });
475
- }
476
- ngOnDestroy() {
477
- this.destroy$.next();
478
- this.destroy$.complete();
479
- }
480
- loadUnreadCount() {
481
- if (!this.hasUser) {
482
- this.unreadCount = 0;
483
- return;
484
- }
485
- this.authService.getUnreadCount().subscribe({
486
- next: (response) => {
487
- this.unreadCount = response.unreadCount || 0;
488
- },
489
- error: (err) => { }
490
- });
491
- }
492
- getAvatarUrl(user) {
493
- // Use the refresh signal to force update
494
- const refresh = this.avatarRefresh();
495
- const config = this.authService.getConfig();
496
- const baseUrl = config?.apiBaseUrl || '';
497
- // If user has avatarPath, use it directly
498
- if (user.avatarPath) {
499
- // If avatarPath is already a full URL, use it as-is
500
- if (user.avatarPath.startsWith('http://') || user.avatarPath.startsWith('https://')) {
501
- return user.avatarPath;
502
- }
503
- // If it's a relative path, construct full URL with refresh timestamp
504
- return `${baseUrl.replace(/\/$/, '')}${user.avatarPath}?t=${refresh}`;
505
- }
506
- // Fallback: construct URL using userId
507
- const userId = user.userId;
508
- if (userId && baseUrl) {
509
- return `${baseUrl.replace(/\/$/, '')}/auth/${userId}/avatar?t=${refresh}`;
510
- }
511
- // Fallback to UI avatars service if no userId or baseUrl
512
- const displayName = user.userName || user.userId || 'User';
513
- return `https://ui-avatars.com/api/?name=${encodeURIComponent(displayName)}&background=1976d2&color=fff`;
514
- }
515
- getLastNameInitial(user) {
516
- const fullName = user.fullName || user.userName || 'U';
517
- const parts = fullName.split(' ');
518
- const lastPart = parts[parts.length - 1];
519
- return lastPart.charAt(0).toUpperCase();
520
- }
521
- toggleDropdown() {
522
- this.dropdownOpen = !this.dropdownOpen;
523
- }
524
- onDocumentClick(event) {
525
- const target = event.target;
526
- const clickedInside = target.closest('.user-menu-wrapper');
527
- if (!clickedInside) {
528
- this.dropdownOpen = false;
529
- }
530
- }
531
- onLogin() {
532
- const config = this.authService.getConfig();
533
- const baseUrl = config?.userBaseUrl || '';
534
- const returnUrl = encodeURIComponent(this.router.url);
535
- window.location.href = `${baseUrl}/login?returnUrl=${returnUrl}`;
536
- }
537
- onViewProfile() {
538
- this.router.navigate(['/profile']);
539
- this.dropdownOpen = false;
540
- }
541
- onLogout() {
542
- this.authService.logout().subscribe({
543
- next: () => {
544
- // Clear current user after successful logout
545
- this.dropdownOpen = false;
546
- // Navigate to login with return URL
547
- const config = this.authService.getConfig();
548
- const baseUrl = config?.userBaseUrl || '';
549
- const returnUrl = encodeURIComponent(window.location.href);
550
- window.location.href = `${baseUrl}/login?returnUrl=${returnUrl}`;
551
- },
552
- error: (err) => {
553
- // Still navigate to login even if logout fails
554
- const config = this.authService.getConfig();
555
- const baseUrl = config?.userBaseUrl || '';
556
- window.location.href = `${baseUrl}/login`;
557
- }
558
- });
559
- }
560
- onNotificationClick() {
561
- this.notificationClick.emit();
562
- }
563
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: UserProfileComponent, deps: [{ token: MesAuthService }, { token: i2.Router }, { token: ThemeService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
564
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: UserProfileComponent, isStandalone: true, selector: "ma-user-profile", outputs: { notificationClick: "notificationClick" }, host: { listeners: { "document:click": "onDocumentClick($event)" }, properties: { "class": "this.themeClass" } }, ngImport: i0, template: `
565
- <div class="user-profile-container">
566
- <!-- Not logged in -->
567
- <ng-container *ngIf="!currentUser()">
568
- <button class="login-btn" (click)="onLogin()">
569
- Login
570
- </button>
571
- </ng-container>
572
-
573
- <!-- Logged in -->
574
- <ng-container *ngIf="currentUser()">
575
- <div class="user-header">
576
- <button class="notification-btn" (click)="onNotificationClick()" title="Notifications">
577
- <span class="icon">🔔</span>
578
- <span class="badge" *ngIf="unreadCount > 0">{{ unreadCount }}</span>
579
- </button>
580
-
581
- <div class="user-menu-wrapper">
582
- <button class="user-menu-btn" (click)="toggleDropdown()">
583
- <img
584
- *ngIf="currentUser().fullName || currentUser().userName"
585
- [src]="getAvatarUrl(currentUser())"
586
- [alt]="currentUser().fullName || currentUser().userName"
587
- class="avatar"
588
- />
589
- <span *ngIf="!(currentUser().fullName || currentUser().userName)" class="avatar-initial">
590
- {{ getLastNameInitial(currentUser()) }}
591
- </span>
592
- </button>
593
-
594
- <div class="mes-dropdown-menu" *ngIf="dropdownOpen">
595
- <div class="mes-dropdown-header">
596
- {{ currentUser().fullName || currentUser().userName }}
597
- </div>
598
- <button class="mes-dropdown-item profile-link" (click)="onViewProfile()">
599
- View Profile
600
- </button>
601
- <button class="mes-dropdown-item logout-item" (click)="onLogout()">
602
- Logout
603
- </button>
604
- </div>
605
- </div>
606
- </div>
607
- </ng-container>
608
- </div>
609
- `, isInline: true, styles: [":host{--primary-color: #1976d2;--primary-hover: #1565c0;--primary-light: rgba(25, 118, 210, .1);--error-color: #f44336;--error-light: #ffebee;--text-primary: #333;--text-secondary: #666;--text-muted: #999;--bg-primary: white;--bg-secondary: #f5f5f5;--bg-tertiary: #fafafa;--bg-hover: #f5f5f5;--border-color: #e0e0e0;--border-light: #f0f0f0;--shadow: rgba(0, 0, 0, .15);--shadow-light: rgba(0, 0, 0, .1)}:host(.theme-dark){--primary-color: #90caf9;--primary-hover: #64b5f6;--primary-light: rgba(144, 202, 249, .1);--error-color: #ef5350;--error-light: rgba(239, 83, 80, .1);--text-primary: #e0e0e0;--text-secondary: #b0b0b0;--text-muted: #888;--bg-primary: #1e1e1e;--bg-secondary: #2d2d2d;--bg-tertiary: #252525;--bg-hover: #333;--border-color: #404040;--border-light: #333;--shadow: rgba(0, 0, 0, .3);--shadow-light: rgba(0, 0, 0, .2)}.user-profile-container{display:flex;align-items:center;gap:16px;padding:0 16px}.login-btn{padding:8px 16px;background-color:var(--primary-color);color:#fff;border:none;border-radius:4px;cursor:pointer;font-weight:500;transition:background-color .3s}.login-btn:hover{background-color:var(--primary-hover)}.user-header{display:flex;align-items:center;gap:16px}.notification-btn{position:relative;background:none;border:none;font-size:24px;cursor:pointer;padding:8px;transition:opacity .2s}.notification-btn:hover{opacity:.7}.icon{display:inline-block}.badge{position:absolute;top:0;right:0;background-color:var(--error-color);color:#fff;border-radius:50%;width:20px;height:20px;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:700}.user-menu-wrapper{position:relative}.user-menu-btn{background:none;border:none;cursor:pointer;padding:4px;border-radius:50%;transition:background-color .2s;display:flex;align-items:center;justify-content:center}.user-menu-btn:hover{background-color:var(--primary-light)}.avatar{width:40px;height:40px;border-radius:50%;object-fit:cover;background-color:#e0e0e0}.avatar-initial{width:40px;height:40px;border-radius:50%;background-color:var(--primary-color);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:16px}.mes-dropdown-menu{position:absolute;top:calc(100% + 8px);right:0;background:var(--bg-primary);border:1px solid var(--border-color);border-radius:4px;box-shadow:0 2px 8px var(--shadow);min-width:200px;z-index:1000;overflow:hidden}.mes-dropdown-header{padding:12px 16px;border-bottom:1px solid var(--border-light);font-weight:600;color:var(--text-primary);font-size:14px}.mes-dropdown-item{display:block;width:100%;padding:12px 16px;border:none;background:none;text-align:left;cursor:pointer;font-size:14px;color:var(--text-primary);text-decoration:none;transition:background-color .2s}.mes-dropdown-item:hover{background-color:var(--bg-hover)}.profile-link{color:var(--primary-color)}.logout-item{border-top:1px solid var(--border-light);color:var(--error-color)}.logout-item:hover{background-color:var(--error-light)}.user-info{display:flex;flex-direction:column;gap:2px}.user-name{font-weight:500;font-size:14px;color:var(--text-primary)}.user-position{font-size:12px;color:var(--text-secondary)}.logout-btn{background:none;border:none;font-size:20px;cursor:pointer;color:var(--text-secondary);padding:4px 8px;transition:color .2s}.logout-btn:hover{color:var(--primary-color)}@media(max-width:768px){.user-info{display:none}.avatar{width:32px;height:32px}}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
610
- }
611
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: UserProfileComponent, decorators: [{
612
- type: Component,
613
- args: [{ selector: 'ma-user-profile', standalone: true, imports: [NgIf], template: `
614
- <div class="user-profile-container">
615
- <!-- Not logged in -->
616
- <ng-container *ngIf="!currentUser()">
617
- <button class="login-btn" (click)="onLogin()">
618
- Login
619
- </button>
620
- </ng-container>
621
-
622
- <!-- Logged in -->
623
- <ng-container *ngIf="currentUser()">
624
- <div class="user-header">
625
- <button class="notification-btn" (click)="onNotificationClick()" title="Notifications">
626
- <span class="icon">🔔</span>
627
- <span class="badge" *ngIf="unreadCount > 0">{{ unreadCount }}</span>
628
- </button>
629
-
630
- <div class="user-menu-wrapper">
631
- <button class="user-menu-btn" (click)="toggleDropdown()">
632
- <img
633
- *ngIf="currentUser().fullName || currentUser().userName"
634
- [src]="getAvatarUrl(currentUser())"
635
- [alt]="currentUser().fullName || currentUser().userName"
636
- class="avatar"
637
- />
638
- <span *ngIf="!(currentUser().fullName || currentUser().userName)" class="avatar-initial">
639
- {{ getLastNameInitial(currentUser()) }}
640
- </span>
641
- </button>
642
-
643
- <div class="mes-dropdown-menu" *ngIf="dropdownOpen">
644
- <div class="mes-dropdown-header">
645
- {{ currentUser().fullName || currentUser().userName }}
646
- </div>
647
- <button class="mes-dropdown-item profile-link" (click)="onViewProfile()">
648
- View Profile
649
- </button>
650
- <button class="mes-dropdown-item logout-item" (click)="onLogout()">
651
- Logout
652
- </button>
653
- </div>
654
- </div>
655
- </div>
656
- </ng-container>
657
- </div>
658
- `, styles: [":host{--primary-color: #1976d2;--primary-hover: #1565c0;--primary-light: rgba(25, 118, 210, .1);--error-color: #f44336;--error-light: #ffebee;--text-primary: #333;--text-secondary: #666;--text-muted: #999;--bg-primary: white;--bg-secondary: #f5f5f5;--bg-tertiary: #fafafa;--bg-hover: #f5f5f5;--border-color: #e0e0e0;--border-light: #f0f0f0;--shadow: rgba(0, 0, 0, .15);--shadow-light: rgba(0, 0, 0, .1)}:host(.theme-dark){--primary-color: #90caf9;--primary-hover: #64b5f6;--primary-light: rgba(144, 202, 249, .1);--error-color: #ef5350;--error-light: rgba(239, 83, 80, .1);--text-primary: #e0e0e0;--text-secondary: #b0b0b0;--text-muted: #888;--bg-primary: #1e1e1e;--bg-secondary: #2d2d2d;--bg-tertiary: #252525;--bg-hover: #333;--border-color: #404040;--border-light: #333;--shadow: rgba(0, 0, 0, .3);--shadow-light: rgba(0, 0, 0, .2)}.user-profile-container{display:flex;align-items:center;gap:16px;padding:0 16px}.login-btn{padding:8px 16px;background-color:var(--primary-color);color:#fff;border:none;border-radius:4px;cursor:pointer;font-weight:500;transition:background-color .3s}.login-btn:hover{background-color:var(--primary-hover)}.user-header{display:flex;align-items:center;gap:16px}.notification-btn{position:relative;background:none;border:none;font-size:24px;cursor:pointer;padding:8px;transition:opacity .2s}.notification-btn:hover{opacity:.7}.icon{display:inline-block}.badge{position:absolute;top:0;right:0;background-color:var(--error-color);color:#fff;border-radius:50%;width:20px;height:20px;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:700}.user-menu-wrapper{position:relative}.user-menu-btn{background:none;border:none;cursor:pointer;padding:4px;border-radius:50%;transition:background-color .2s;display:flex;align-items:center;justify-content:center}.user-menu-btn:hover{background-color:var(--primary-light)}.avatar{width:40px;height:40px;border-radius:50%;object-fit:cover;background-color:#e0e0e0}.avatar-initial{width:40px;height:40px;border-radius:50%;background-color:var(--primary-color);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:16px}.mes-dropdown-menu{position:absolute;top:calc(100% + 8px);right:0;background:var(--bg-primary);border:1px solid var(--border-color);border-radius:4px;box-shadow:0 2px 8px var(--shadow);min-width:200px;z-index:1000;overflow:hidden}.mes-dropdown-header{padding:12px 16px;border-bottom:1px solid var(--border-light);font-weight:600;color:var(--text-primary);font-size:14px}.mes-dropdown-item{display:block;width:100%;padding:12px 16px;border:none;background:none;text-align:left;cursor:pointer;font-size:14px;color:var(--text-primary);text-decoration:none;transition:background-color .2s}.mes-dropdown-item:hover{background-color:var(--bg-hover)}.profile-link{color:var(--primary-color)}.logout-item{border-top:1px solid var(--border-light);color:var(--error-color)}.logout-item:hover{background-color:var(--error-light)}.user-info{display:flex;flex-direction:column;gap:2px}.user-name{font-weight:500;font-size:14px;color:var(--text-primary)}.user-position{font-size:12px;color:var(--text-secondary)}.logout-btn{background:none;border:none;font-size:20px;cursor:pointer;color:var(--text-secondary);padding:4px 8px;transition:color .2s}.logout-btn:hover{color:var(--primary-color)}@media(max-width:768px){.user-info{display:none}.avatar{width:32px;height:32px}}\n"] }]
659
- }], ctorParameters: () => [{ type: MesAuthService }, { type: i2.Router }, { type: ThemeService }, { type: i0.ChangeDetectorRef }], propDecorators: { notificationClick: [{
660
- type: Output
661
- }], themeClass: [{
662
- type: HostBinding,
663
- args: ['class']
664
- }], onDocumentClick: [{
665
- type: HostListener,
666
- args: ['document:click', ['$event']]
667
- }] } });
668
-
669
- class ToastService {
670
- toasts$ = new BehaviorSubject([]);
671
- toasts = this.toasts$.asObservable();
672
- show(message, title, type = 'info', duration = 5000) {
673
- const id = Math.random().toString(36).substr(2, 9);
674
- const toast = {
675
- id,
676
- message,
677
- title,
678
- type,
679
- duration
680
- };
681
- const currentToasts = this.toasts$.value;
682
- this.toasts$.next([...currentToasts, toast]);
683
- if (duration > 0) {
684
- setTimeout(() => {
685
- this.remove(id);
686
- }, duration);
687
- }
688
- return id;
689
- }
690
- remove(id) {
691
- const currentToasts = this.toasts$.value;
692
- this.toasts$.next(currentToasts.filter(t => t.id !== id));
693
- }
694
- clear() {
695
- this.toasts$.next([]);
696
- }
697
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ToastService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
698
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ToastService, providedIn: 'root' });
699
- }
700
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ToastService, decorators: [{
701
- type: Injectable,
702
- args: [{ providedIn: 'root' }]
703
- }] });
704
-
705
- class ToastContainerComponent {
706
- toastService;
707
- themeService;
708
- get themeClass() {
709
- return `theme-${this.currentTheme}`;
710
- }
711
- toasts = [];
712
- currentTheme = 'light';
713
- destroy$ = new Subject();
714
- constructor(toastService, themeService) {
715
- this.toastService = toastService;
716
- this.themeService = themeService;
717
- }
718
- ngOnInit() {
719
- this.toastService.toasts
720
- .pipe(takeUntil(this.destroy$))
721
- .subscribe(toasts => {
722
- this.toasts = toasts;
723
- });
724
- this.themeService.currentTheme$
725
- .pipe(takeUntil(this.destroy$))
726
- .subscribe(theme => {
727
- this.currentTheme = theme;
728
- });
729
- }
730
- ngOnDestroy() {
731
- this.destroy$.next();
732
- this.destroy$.complete();
733
- }
734
- close(id) {
735
- this.toastService.remove(id);
736
- }
737
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ToastContainerComponent, deps: [{ token: ToastService }, { token: ThemeService }], target: i0.ɵɵFactoryTarget.Component });
738
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: ToastContainerComponent, isStandalone: true, selector: "ma-toast-container", host: { properties: { "class": "this.themeClass" } }, ngImport: i0, template: `
739
- <div class="toast-container">
740
- <div
741
- *ngFor="let toast of toasts"
742
- class="toast"
743
- [class]="'toast-' + toast.type"
744
- [@slideIn]
745
- >
746
- <div class="toast-content">
747
- <div *ngIf="toast.title" class="toast-title">{{ toast.title }}</div>
748
- <div class="toast-message" [innerHTML]="toast.message"></div>
749
- </div>
750
- <button class="toast-close" (click)="close(toast.id)" aria-label="Close">
751
-
752
- </button>
753
- </div>
754
- </div>
755
- `, isInline: true, styles: [":host{--info-color: #2196f3;--success-color: #4caf50;--warning-color: #ff9800;--error-color: #f44336;--text-primary: #333;--bg-primary: white;--shadow: rgba(0, 0, 0, .15);--text-secondary: #999;--border-color: rgba(0, 0, 0, .1)}:host(.theme-dark){--info-color: #64b5f6;--success-color: #81c784;--warning-color: #ffb74d;--error-color: #ef5350;--text-primary: #e0e0e0;--bg-primary: #1e1e1e;--shadow: rgba(0, 0, 0, .3);--text-secondary: #888;--border-color: rgba(255, 255, 255, .1)}.toast-container{position:fixed;top:20px;right:20px;z-index:9999;pointer-events:none}.toast{display:flex;align-items:flex-start;gap:12px;padding:12px 16px;margin-bottom:12px;border-radius:4px;background:var(--bg-primary);border:1px solid var(--border-color);box-shadow:0 4px 12px var(--shadow);pointer-events:auto;min-width:280px;max-width:400px;animation:slideIn .3s ease-out}.toast-content{flex:1}.toast-title{font-weight:600;font-size:14px;margin-bottom:4px}.toast-message{font-size:13px;line-height:1.4}.toast-close{background:none;border:none;cursor:pointer;font-size:18px;color:var(--text-secondary);padding:0;width:24px;height:24px;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:color .2s}.toast-close:hover{color:var(--text-primary)}.toast-info{border-left:4px solid var(--info-color)}.toast-info .toast-title{color:var(--info-color)}.toast-info .toast-message{color:var(--text-primary)}.toast-success{border-left:4px solid var(--success-color)}.toast-success .toast-title{color:var(--success-color)}.toast-success .toast-message{color:var(--text-primary)}.toast-warning{border-left:4px solid var(--warning-color)}.toast-warning .toast-title{color:var(--warning-color)}.toast-warning .toast-message{color:var(--text-primary)}.toast-error{border-left:4px solid var(--error-color)}.toast-error .toast-title{color:var(--error-color)}.toast-error .toast-message{color:var(--text-primary)}@keyframes slideIn{0%{transform:translate(400px);opacity:0}to{transform:translate(0);opacity:1}}@media(max-width:600px){.toast-container{top:10px;right:10px;left:10px}.toast{min-width:auto;max-width:100%}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
756
- }
757
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ToastContainerComponent, decorators: [{
758
- type: Component,
759
- args: [{ selector: 'ma-toast-container', standalone: true, imports: [CommonModule], template: `
760
- <div class="toast-container">
761
- <div
762
- *ngFor="let toast of toasts"
763
- class="toast"
764
- [class]="'toast-' + toast.type"
765
- [@slideIn]
766
- >
767
- <div class="toast-content">
768
- <div *ngIf="toast.title" class="toast-title">{{ toast.title }}</div>
769
- <div class="toast-message" [innerHTML]="toast.message"></div>
770
- </div>
771
- <button class="toast-close" (click)="close(toast.id)" aria-label="Close">
772
-
773
- </button>
774
- </div>
775
- </div>
776
- `, styles: [":host{--info-color: #2196f3;--success-color: #4caf50;--warning-color: #ff9800;--error-color: #f44336;--text-primary: #333;--bg-primary: white;--shadow: rgba(0, 0, 0, .15);--text-secondary: #999;--border-color: rgba(0, 0, 0, .1)}:host(.theme-dark){--info-color: #64b5f6;--success-color: #81c784;--warning-color: #ffb74d;--error-color: #ef5350;--text-primary: #e0e0e0;--bg-primary: #1e1e1e;--shadow: rgba(0, 0, 0, .3);--text-secondary: #888;--border-color: rgba(255, 255, 255, .1)}.toast-container{position:fixed;top:20px;right:20px;z-index:9999;pointer-events:none}.toast{display:flex;align-items:flex-start;gap:12px;padding:12px 16px;margin-bottom:12px;border-radius:4px;background:var(--bg-primary);border:1px solid var(--border-color);box-shadow:0 4px 12px var(--shadow);pointer-events:auto;min-width:280px;max-width:400px;animation:slideIn .3s ease-out}.toast-content{flex:1}.toast-title{font-weight:600;font-size:14px;margin-bottom:4px}.toast-message{font-size:13px;line-height:1.4}.toast-close{background:none;border:none;cursor:pointer;font-size:18px;color:var(--text-secondary);padding:0;width:24px;height:24px;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:color .2s}.toast-close:hover{color:var(--text-primary)}.toast-info{border-left:4px solid var(--info-color)}.toast-info .toast-title{color:var(--info-color)}.toast-info .toast-message{color:var(--text-primary)}.toast-success{border-left:4px solid var(--success-color)}.toast-success .toast-title{color:var(--success-color)}.toast-success .toast-message{color:var(--text-primary)}.toast-warning{border-left:4px solid var(--warning-color)}.toast-warning .toast-title{color:var(--warning-color)}.toast-warning .toast-message{color:var(--text-primary)}.toast-error{border-left:4px solid var(--error-color)}.toast-error .toast-title{color:var(--error-color)}.toast-error .toast-message{color:var(--text-primary)}@keyframes slideIn{0%{transform:translate(400px);opacity:0}to{transform:translate(0);opacity:1}}@media(max-width:600px){.toast-container{top:10px;right:10px;left:10px}.toast{min-width:auto;max-width:100%}}\n"] }]
777
- }], ctorParameters: () => [{ type: ToastService }, { type: ThemeService }], propDecorators: { themeClass: [{
778
- type: HostBinding,
779
- args: ['class']
780
- }] } });
781
-
782
- class NotificationPanelComponent {
783
- authService;
784
- toastService;
785
- themeService;
786
- notificationRead = new EventEmitter();
787
- get themeClass() {
788
- return `theme-${this.currentTheme}`;
789
- }
790
- isOpen = false;
791
- notifications = [];
792
- currentTheme = 'light';
793
- activeTab = 'unread'; // Default to unread tab
794
- destroy$ = new Subject();
795
- get unreadNotifications() {
796
- return this.notifications.filter(n => !n.isRead);
797
- }
798
- get readNotifications() {
799
- return this.notifications.filter(n => n.isRead);
800
- }
801
- get currentNotifications() {
802
- return this.activeTab === 'unread' ? this.unreadNotifications : this.readNotifications;
803
- }
804
- getNotificationMessage(notification) {
805
- return notification.messageHtml || notification.message || '';
806
- }
807
- constructor(authService, toastService, themeService) {
808
- this.authService = authService;
809
- this.toastService = toastService;
810
- this.themeService = themeService;
811
- }
812
- ngOnInit() {
813
- this.themeService.currentTheme$
814
- .pipe(takeUntil(this.destroy$))
815
- .subscribe(theme => {
816
- this.currentTheme = theme;
817
- });
818
- this.loadNotifications();
819
- // Listen for new real-time notifications
820
- this.authService.notifications$
821
- .pipe(takeUntil(this.destroy$))
822
- .subscribe((notification) => {
823
- // Show toast for new notification
824
- this.toastService.show(notification.messageHtml || notification.message || '', notification.title, 'info', 5000);
825
- // Reload notifications list
826
- this.loadNotifications();
827
- });
828
- }
829
- ngOnDestroy() {
830
- this.destroy$.next();
831
- this.destroy$.complete();
832
- }
833
- loadNotifications() {
834
- this.authService.getNotifications(1, 50, true).subscribe({
835
- next: (response) => {
836
- this.notifications = response.items || [];
837
- },
838
- error: (err) => { }
839
- });
840
- }
841
- open() {
842
- this.isOpen = true;
843
- this.activeTab = 'unread'; // Reset to unread tab when opening
844
- }
845
- close() {
846
- this.isOpen = false;
847
- }
848
- switchTab(tab) {
849
- this.activeTab = tab;
850
- }
851
- markAsRead(notificationId, event) {
852
- if (event) {
853
- event.stopPropagation();
854
- }
855
- this.authService.markAsRead(notificationId).subscribe({
856
- next: () => {
857
- const notification = this.notifications.find(n => n.id === notificationId);
858
- if (notification) {
859
- notification.isRead = true;
860
- this.notificationRead.emit();
861
- }
862
- },
863
- error: (err) => { }
864
- });
865
- }
866
- markAllAsRead() {
867
- this.authService.markAllAsRead().subscribe({
868
- next: () => {
869
- this.notifications.forEach(n => n.isRead = true);
870
- this.notificationRead.emit();
871
- },
872
- error: (err) => { }
873
- });
874
- }
875
- deleteAllRead() {
876
- const readNotificationIds = this.notifications
877
- .filter(n => n.isRead)
878
- .map(n => n.id);
879
- // Delete all read notifications
880
- const deletePromises = readNotificationIds.map(id => this.authService.deleteNotification(id).toPromise());
881
- Promise.all(deletePromises).then(() => {
882
- // Remove all read notifications from the local array
883
- this.notifications = this.notifications.filter(n => !n.isRead);
884
- }).catch((err) => {
885
- // If bulk delete fails, reload notifications to get current state
886
- this.loadNotifications();
887
- });
888
- }
889
- deleteAllUnread() {
890
- const unreadNotificationIds = this.notifications
891
- .filter(n => !n.isRead)
892
- .map(n => n.id);
893
- // Delete all unread notifications
894
- const deletePromises = unreadNotificationIds.map(id => this.authService.deleteNotification(id).toPromise());
895
- Promise.all(deletePromises).then(() => {
896
- // Remove all unread notifications from the local array
897
- this.notifications = this.notifications.filter(n => n.isRead);
898
- }).catch((err) => {
899
- // If bulk delete fails, reload notifications to get current state
900
- this.loadNotifications();
901
- });
902
- }
903
- delete(notificationId, event) {
904
- event.stopPropagation();
905
- this.authService.deleteNotification(notificationId).subscribe({
906
- next: () => {
907
- this.notifications = this.notifications.filter(n => n.id !== notificationId);
908
- },
909
- error: (err) => { }
910
- });
911
- }
912
- formatDate(dateString) {
913
- const date = new Date(dateString);
914
- const now = new Date();
915
- const diffMs = now.getTime() - date.getTime();
916
- const diffMins = Math.floor(diffMs / 60000);
917
- const diffHours = Math.floor(diffMs / 3600000);
918
- const diffDays = Math.floor(diffMs / 86400000);
919
- if (diffMins < 1)
920
- return 'Now';
921
- if (diffMins < 60)
922
- return `${diffMins}m ago`;
923
- if (diffHours < 24)
924
- return `${diffHours}h ago`;
925
- if (diffDays < 7)
926
- return `${diffDays}d ago`;
927
- return date.toLocaleDateString();
928
- }
929
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: NotificationPanelComponent, deps: [{ token: MesAuthService }, { token: ToastService }, { token: ThemeService }], target: i0.ɵɵFactoryTarget.Component });
930
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: NotificationPanelComponent, isStandalone: true, selector: "ma-notification-panel", outputs: { notificationRead: "notificationRead" }, host: { properties: { "class": "this.themeClass" } }, ngImport: i0, template: `
931
- <div class="notification-panel" [class.open]="isOpen">
932
- <!-- Header -->
933
- <div class="panel-header">
934
- <h3>Notifications</h3>
935
- <button class="close-btn" (click)="close()" title="Close">✕</button>
936
- </div>
937
-
938
- <!-- Tabs -->
939
- <div class="tabs">
940
- <button
941
- class="tab-btn"
942
- [class.active]="activeTab === 'unread'"
943
- (click)="switchTab('unread')"
944
- >
945
- Unread ({{ unreadNotifications.length }})
946
- </button>
947
- <button
948
- class="tab-btn"
949
- [class.active]="activeTab === 'read'"
950
- (click)="switchTab('read')"
951
- >
952
- Read ({{ readNotifications.length }})
953
- </button>
954
- </div>
955
-
956
- <!-- Notifications List -->
957
- <div class="notifications-list">
958
- <ng-container *ngIf="currentNotifications.length > 0">
959
- <div
960
- *ngFor="let notification of currentNotifications"
961
- class="notification-item"
962
- [class.unread]="!notification.isRead"
963
- (click)="markAsRead(notification.id)"
964
- >
965
- <div class="notification-content">
966
- <div class="notification-title">{{ notification.title }}</div>
967
- <div class="notification-message" [innerHTML]="getNotificationMessage(notification)"></div>
968
- <div class="notification-meta">
969
- <span class="app-name">{{ notification.sourceAppName }}</span>
970
- <span class="time">{{ formatDate(notification.createdAt) }}</span>
971
- </div>
972
- </div>
973
- <button
974
- class="read-btn"
975
- (click)="markAsRead(notification.id, $event)"
976
- title="Mark as read"
977
- *ngIf="!notification.isRead"
978
- >
979
-
980
- </button>
981
- <button
982
- class="delete-btn"
983
- (click)="delete(notification.id, $event)"
984
- title="Delete notification"
985
- *ngIf="notification.isRead"
986
- >
987
-
988
- </button>
989
- </div>
990
- </ng-container>
991
-
992
- <ng-container *ngIf="currentNotifications.length === 0">
993
- <div class="empty-state">
994
- No {{ activeTab }} notifications
995
- </div>
996
- </ng-container>
997
- </div>
998
-
999
- <!-- Footer Actions -->
1000
- <div class="panel-footer" *ngIf="currentNotifications.length > 0">
1001
- <div class="footer-actions" *ngIf="activeTab === 'unread'">
1002
- <button class="action-btn" (click)="markAllAsRead()" *ngIf="unreadNotifications.length > 0">
1003
- Mark all as read
1004
- </button>
1005
- <button class="action-btn delete-all-btn" (click)="deleteAllUnread()" *ngIf="unreadNotifications.length > 0">
1006
- Delete all
1007
- </button>
1008
- </div>
1009
- <button class="action-btn delete-all-btn" (click)="deleteAllRead()" *ngIf="activeTab === 'read' && readNotifications.length > 0">
1010
- Delete all
1011
- </button>
1012
- </div>
1013
- </div>
1014
- `, isInline: true, styles: [":host{--primary-color: #1976d2;--primary-hover: #1565c0;--success-color: #4caf50;--error-color: #f44336;--text-primary: #333;--text-secondary: #666;--text-muted: #999;--bg-primary: white;--bg-secondary: #f5f5f5;--bg-tertiary: #fafafa;--bg-hover: #f5f5f5;--bg-unread: #e3f2fd;--border-color: #e0e0e0;--border-light: #f0f0f0;--shadow: rgba(0, 0, 0, .1)}:host(.theme-dark){--primary-color: #90caf9;--primary-hover: #64b5f6;--success-color: #81c784;--error-color: #ef5350;--text-primary: #e0e0e0;--text-secondary: #b0b0b0;--text-muted: #888;--bg-primary: #1e1e1e;--bg-secondary: #2d2d2d;--bg-tertiary: #252525;--bg-hover: #333;--bg-unread: rgba(144, 202, 249, .1);--border-color: #404040;--border-light: #333;--shadow: rgba(0, 0, 0, .3)}.notification-panel{position:fixed;top:0;right:-350px;width:350px;height:100vh;background:var(--bg-primary);box-shadow:-2px 0 8px var(--shadow);display:flex;flex-direction:column;z-index:1000;transition:right .3s ease}.notification-panel.open{right:0}.panel-header{display:flex;justify-content:space-between;align-items:center;padding:16px;border-bottom:1px solid var(--border-color);background-color:var(--bg-secondary)}.panel-header h3{margin:0;font-size:18px;color:var(--text-primary)}.close-btn{background:none;border:none;font-size:20px;cursor:pointer;color:var(--text-secondary);padding:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center;transition:color .2s}.close-btn:hover{color:var(--text-primary)}.tabs{display:flex;border-bottom:1px solid var(--border-color);background-color:var(--bg-secondary)}.tab-btn{flex:1;padding:12px 16px;background:none;border:none;color:var(--text-secondary);cursor:pointer;font-size:14px;font-weight:500;transition:all .2s;border-bottom:2px solid transparent}.tab-btn:hover{background-color:var(--bg-hover);color:var(--text-primary)}.tab-btn.active{color:var(--primary-color);border-bottom-color:var(--primary-color);background-color:var(--bg-primary)}.notifications-list{flex:1;overflow-y:auto}.notification-item{display:flex;gap:12px;padding:12px 16px;border-bottom:1px solid var(--border-light);cursor:pointer;background-color:var(--bg-tertiary);transition:background-color .2s}.notification-item:hover{background-color:var(--bg-hover)}.notification-item.unread{background-color:var(--bg-unread)}.notification-content{flex:1;min-width:0}.notification-title{font-weight:600;color:var(--text-primary);font-size:14px;margin-bottom:4px}.notification-message{color:var(--text-secondary);font-size:13px;line-height:1.4;margin-bottom:6px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.notification-meta{display:flex;justify-content:space-between;font-size:12px;color:var(--text-muted)}.app-name{font-weight:500;color:var(--primary-color)}.read-btn{background:none;border:none;color:var(--text-muted);cursor:pointer;font-size:14px;padding:0;width:24px;height:24px;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:color .2s}.read-btn:hover{color:var(--success-color)}.delete-btn{background:none;border:none;color:var(--text-muted);cursor:pointer;font-size:14px;padding:0;width:24px;height:24px;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:color .2s}.delete-btn:hover{color:var(--error-color)}.empty-state{display:flex;align-items:center;justify-content:center;height:100%;color:var(--text-muted);font-size:14px}.panel-footer{padding:12px 16px;border-top:1px solid var(--border-color);background-color:var(--bg-secondary)}.footer-actions{display:flex;gap:8px}.footer-actions .action-btn{flex:1}.action-btn{width:100%;padding:8px;background-color:var(--primary-color);color:#fff;border:none;border-radius:4px;cursor:pointer;font-weight:500;transition:background-color .2s}.action-btn:hover{background-color:var(--primary-hover)}.delete-all-btn{background-color:var(--error-color);color:#fff}.delete-all-btn:hover{background-color:#d32f2f}@media(max-width:600px){.notification-panel{width:100%;right:-100%}}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
1015
- }
1016
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: NotificationPanelComponent, decorators: [{
1017
- type: Component,
1018
- args: [{ selector: 'ma-notification-panel', standalone: true, imports: [NgIf, NgFor], template: `
1019
- <div class="notification-panel" [class.open]="isOpen">
1020
- <!-- Header -->
1021
- <div class="panel-header">
1022
- <h3>Notifications</h3>
1023
- <button class="close-btn" (click)="close()" title="Close">✕</button>
1024
- </div>
1025
-
1026
- <!-- Tabs -->
1027
- <div class="tabs">
1028
- <button
1029
- class="tab-btn"
1030
- [class.active]="activeTab === 'unread'"
1031
- (click)="switchTab('unread')"
1032
- >
1033
- Unread ({{ unreadNotifications.length }})
1034
- </button>
1035
- <button
1036
- class="tab-btn"
1037
- [class.active]="activeTab === 'read'"
1038
- (click)="switchTab('read')"
1039
- >
1040
- Read ({{ readNotifications.length }})
1041
- </button>
1042
- </div>
1043
-
1044
- <!-- Notifications List -->
1045
- <div class="notifications-list">
1046
- <ng-container *ngIf="currentNotifications.length > 0">
1047
- <div
1048
- *ngFor="let notification of currentNotifications"
1049
- class="notification-item"
1050
- [class.unread]="!notification.isRead"
1051
- (click)="markAsRead(notification.id)"
1052
- >
1053
- <div class="notification-content">
1054
- <div class="notification-title">{{ notification.title }}</div>
1055
- <div class="notification-message" [innerHTML]="getNotificationMessage(notification)"></div>
1056
- <div class="notification-meta">
1057
- <span class="app-name">{{ notification.sourceAppName }}</span>
1058
- <span class="time">{{ formatDate(notification.createdAt) }}</span>
1059
- </div>
1060
- </div>
1061
- <button
1062
- class="read-btn"
1063
- (click)="markAsRead(notification.id, $event)"
1064
- title="Mark as read"
1065
- *ngIf="!notification.isRead"
1066
- >
1067
-
1068
- </button>
1069
- <button
1070
- class="delete-btn"
1071
- (click)="delete(notification.id, $event)"
1072
- title="Delete notification"
1073
- *ngIf="notification.isRead"
1074
- >
1075
-
1076
- </button>
1077
- </div>
1078
- </ng-container>
1079
-
1080
- <ng-container *ngIf="currentNotifications.length === 0">
1081
- <div class="empty-state">
1082
- No {{ activeTab }} notifications
1083
- </div>
1084
- </ng-container>
1085
- </div>
1086
-
1087
- <!-- Footer Actions -->
1088
- <div class="panel-footer" *ngIf="currentNotifications.length > 0">
1089
- <div class="footer-actions" *ngIf="activeTab === 'unread'">
1090
- <button class="action-btn" (click)="markAllAsRead()" *ngIf="unreadNotifications.length > 0">
1091
- Mark all as read
1092
- </button>
1093
- <button class="action-btn delete-all-btn" (click)="deleteAllUnread()" *ngIf="unreadNotifications.length > 0">
1094
- Delete all
1095
- </button>
1096
- </div>
1097
- <button class="action-btn delete-all-btn" (click)="deleteAllRead()" *ngIf="activeTab === 'read' && readNotifications.length > 0">
1098
- Delete all
1099
- </button>
1100
- </div>
1101
- </div>
1102
- `, styles: [":host{--primary-color: #1976d2;--primary-hover: #1565c0;--success-color: #4caf50;--error-color: #f44336;--text-primary: #333;--text-secondary: #666;--text-muted: #999;--bg-primary: white;--bg-secondary: #f5f5f5;--bg-tertiary: #fafafa;--bg-hover: #f5f5f5;--bg-unread: #e3f2fd;--border-color: #e0e0e0;--border-light: #f0f0f0;--shadow: rgba(0, 0, 0, .1)}:host(.theme-dark){--primary-color: #90caf9;--primary-hover: #64b5f6;--success-color: #81c784;--error-color: #ef5350;--text-primary: #e0e0e0;--text-secondary: #b0b0b0;--text-muted: #888;--bg-primary: #1e1e1e;--bg-secondary: #2d2d2d;--bg-tertiary: #252525;--bg-hover: #333;--bg-unread: rgba(144, 202, 249, .1);--border-color: #404040;--border-light: #333;--shadow: rgba(0, 0, 0, .3)}.notification-panel{position:fixed;top:0;right:-350px;width:350px;height:100vh;background:var(--bg-primary);box-shadow:-2px 0 8px var(--shadow);display:flex;flex-direction:column;z-index:1000;transition:right .3s ease}.notification-panel.open{right:0}.panel-header{display:flex;justify-content:space-between;align-items:center;padding:16px;border-bottom:1px solid var(--border-color);background-color:var(--bg-secondary)}.panel-header h3{margin:0;font-size:18px;color:var(--text-primary)}.close-btn{background:none;border:none;font-size:20px;cursor:pointer;color:var(--text-secondary);padding:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center;transition:color .2s}.close-btn:hover{color:var(--text-primary)}.tabs{display:flex;border-bottom:1px solid var(--border-color);background-color:var(--bg-secondary)}.tab-btn{flex:1;padding:12px 16px;background:none;border:none;color:var(--text-secondary);cursor:pointer;font-size:14px;font-weight:500;transition:all .2s;border-bottom:2px solid transparent}.tab-btn:hover{background-color:var(--bg-hover);color:var(--text-primary)}.tab-btn.active{color:var(--primary-color);border-bottom-color:var(--primary-color);background-color:var(--bg-primary)}.notifications-list{flex:1;overflow-y:auto}.notification-item{display:flex;gap:12px;padding:12px 16px;border-bottom:1px solid var(--border-light);cursor:pointer;background-color:var(--bg-tertiary);transition:background-color .2s}.notification-item:hover{background-color:var(--bg-hover)}.notification-item.unread{background-color:var(--bg-unread)}.notification-content{flex:1;min-width:0}.notification-title{font-weight:600;color:var(--text-primary);font-size:14px;margin-bottom:4px}.notification-message{color:var(--text-secondary);font-size:13px;line-height:1.4;margin-bottom:6px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.notification-meta{display:flex;justify-content:space-between;font-size:12px;color:var(--text-muted)}.app-name{font-weight:500;color:var(--primary-color)}.read-btn{background:none;border:none;color:var(--text-muted);cursor:pointer;font-size:14px;padding:0;width:24px;height:24px;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:color .2s}.read-btn:hover{color:var(--success-color)}.delete-btn{background:none;border:none;color:var(--text-muted);cursor:pointer;font-size:14px;padding:0;width:24px;height:24px;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:color .2s}.delete-btn:hover{color:var(--error-color)}.empty-state{display:flex;align-items:center;justify-content:center;height:100%;color:var(--text-muted);font-size:14px}.panel-footer{padding:12px 16px;border-top:1px solid var(--border-color);background-color:var(--bg-secondary)}.footer-actions{display:flex;gap:8px}.footer-actions .action-btn{flex:1}.action-btn{width:100%;padding:8px;background-color:var(--primary-color);color:#fff;border:none;border-radius:4px;cursor:pointer;font-weight:500;transition:background-color .2s}.action-btn:hover{background-color:var(--primary-hover)}.delete-all-btn{background-color:var(--error-color);color:#fff}.delete-all-btn:hover{background-color:#d32f2f}@media(max-width:600px){.notification-panel{width:100%;right:-100%}}\n"] }]
1103
- }], ctorParameters: () => [{ type: MesAuthService }, { type: ToastService }, { type: ThemeService }], propDecorators: { notificationRead: [{
1104
- type: Output
1105
- }], themeClass: [{
1106
- type: HostBinding,
1107
- args: ['class']
1108
- }] } });
1109
-
1110
- class MaUserComponent {
1111
- userProfile;
1112
- ngAfterViewInit() {
1113
- // Ensure proper initialization
1114
- if (this.userProfile) {
1115
- this.userProfile.loadUnreadCount();
1116
- }
1117
- }
1118
- onNotificationRead() {
1119
- if (this.userProfile) {
1120
- this.userProfile.loadUnreadCount();
1121
- }
1122
- }
1123
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MaUserComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1124
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: MaUserComponent, isStandalone: true, selector: "ma-user", viewQueries: [{ propertyName: "userProfile", first: true, predicate: UserProfileComponent, descendants: true }], ngImport: i0, template: `
1125
- <ma-toast-container></ma-toast-container>
1126
- <div class="user-header">
1127
- <ma-user-profile (notificationClick)="notificationPanel.open()"></ma-user-profile>
1128
- </div>
1129
- <ma-notification-panel #notificationPanel (notificationRead)="onNotificationRead()"></ma-notification-panel>
1130
- `, isInline: true, styles: [".user-header{display:flex;justify-content:flex-end}\n"], dependencies: [{ kind: "component", type: ToastContainerComponent, selector: "ma-toast-container" }, { kind: "component", type: UserProfileComponent, selector: "ma-user-profile", outputs: ["notificationClick"] }, { kind: "component", type: NotificationPanelComponent, selector: "ma-notification-panel", outputs: ["notificationRead"] }] });
1131
- }
1132
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MaUserComponent, decorators: [{
1133
- type: Component,
1134
- args: [{ selector: 'ma-user', standalone: true, imports: [ToastContainerComponent, UserProfileComponent, NotificationPanelComponent], template: `
1135
- <ma-toast-container></ma-toast-container>
1136
- <div class="user-header">
1137
- <ma-user-profile (notificationClick)="notificationPanel.open()"></ma-user-profile>
1138
- </div>
1139
- <ma-notification-panel #notificationPanel (notificationRead)="onNotificationRead()"></ma-notification-panel>
1140
- `, styles: [".user-header{display:flex;justify-content:flex-end}\n"] }]
1141
- }], propDecorators: { userProfile: [{
1142
- type: ViewChild,
1143
- args: [UserProfileComponent]
1144
- }] } });
1145
-
1146
- class NotificationBadgeComponent {
1147
- authService;
1148
- themeService;
1149
- notificationClick = new EventEmitter();
1150
- get themeClass() {
1151
- return `theme-${this.currentTheme}`;
1152
- }
1153
- unreadCount = 0;
1154
- currentTheme = 'light';
1155
- hasUser = false;
1156
- destroy$ = new Subject();
1157
- constructor(authService, themeService) {
1158
- this.authService = authService;
1159
- this.themeService = themeService;
1160
- }
1161
- ngOnInit() {
1162
- this.themeService.currentTheme$
1163
- .pipe(takeUntil(this.destroy$))
1164
- .subscribe(theme => {
1165
- this.currentTheme = theme;
1166
- });
1167
- this.authService.currentUser$
1168
- .pipe(takeUntil(this.destroy$))
1169
- .subscribe(user => {
1170
- this.hasUser = !!user;
1171
- if (!this.hasUser) {
1172
- this.unreadCount = 0;
1173
- return;
1174
- }
1175
- this.loadUnreadCount();
1176
- });
1177
- // Listen for new notifications
1178
- this.authService.notifications$
1179
- .pipe(takeUntil(this.destroy$))
1180
- .subscribe(() => {
1181
- if (this.hasUser) {
1182
- this.loadUnreadCount();
1183
- }
1184
- });
1185
- }
1186
- ngOnDestroy() {
1187
- this.destroy$.next();
1188
- this.destroy$.complete();
1189
- }
1190
- loadUnreadCount() {
1191
- if (!this.hasUser) {
1192
- this.unreadCount = 0;
1193
- return;
1194
- }
1195
- this.authService.getUnreadCount().subscribe({
1196
- next: (response) => {
1197
- this.unreadCount = response.unreadCount || 0;
1198
- },
1199
- error: (err) => console.error('Error loading unread count:', err)
1200
- });
1201
- }
1202
- onNotificationClick() {
1203
- this.notificationClick.emit();
1204
- }
1205
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: NotificationBadgeComponent, deps: [{ token: MesAuthService }, { token: ThemeService }], target: i0.ɵɵFactoryTarget.Component });
1206
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: NotificationBadgeComponent, isStandalone: true, selector: "ma-notification-badge", outputs: { notificationClick: "notificationClick" }, host: { properties: { "class": "this.themeClass" } }, ngImport: i0, template: `
1207
- <button class="notification-btn" (click)="onNotificationClick()" title="Notifications">
1208
- <span class="icon">🔔</span>
1209
- <span class="badge" *ngIf="unreadCount > 0">{{ unreadCount }}</span>
1210
- </button>
1211
- `, isInline: true, styles: [":host{--error-color: #f44336}:host(.theme-dark){--error-color: #ef5350}.notification-btn{position:relative;background:none;border:none;font-size:24px;cursor:pointer;padding:8px;transition:opacity .2s}.notification-btn:hover{opacity:.7}.icon{display:inline-block}.badge{position:absolute;top:0;right:0;background-color:var(--error-color);color:#fff;border-radius:50%;width:20px;height:20px;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:700}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1212
- }
1213
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: NotificationBadgeComponent, decorators: [{
1214
- type: Component,
1215
- args: [{ selector: 'ma-notification-badge', standalone: true, imports: [NgIf], template: `
1216
- <button class="notification-btn" (click)="onNotificationClick()" title="Notifications">
1217
- <span class="icon">🔔</span>
1218
- <span class="badge" *ngIf="unreadCount > 0">{{ unreadCount }}</span>
1219
- </button>
1220
- `, styles: [":host{--error-color: #f44336}:host(.theme-dark){--error-color: #ef5350}.notification-btn{position:relative;background:none;border:none;font-size:24px;cursor:pointer;padding:8px;transition:opacity .2s}.notification-btn:hover{opacity:.7}.icon{display:inline-block}.badge{position:absolute;top:0;right:0;background-color:var(--error-color);color:#fff;border-radius:50%;width:20px;height:20px;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:700}\n"] }]
1221
- }], ctorParameters: () => [{ type: MesAuthService }, { type: ThemeService }], propDecorators: { notificationClick: [{
1222
- type: Output
1223
- }], themeClass: [{
1224
- type: HostBinding,
1225
- args: ['class']
1226
- }] } });
1227
-
1228
- /**
1229
- * Generated bundle index. Do not edit.
1230
- */
1231
-
1232
- export { MES_AUTH_CONFIG, MaUserComponent, MesAuthModule, MesAuthService, NotificationBadgeComponent, NotificationPanelComponent, NotificationType, ThemeService, ToastContainerComponent, ToastService, UserProfileComponent, mesAuthInterceptor, provideMesAuth };
1233
- //# sourceMappingURL=mesauth-angular.mjs.map