{"version":3,"file":"cccteam-ccc-lib-ui-core-service.mjs","sources":["../../../projects/ccc-lib/ui-core-service/ui-core.service.ts","../../../projects/ccc-lib/ui-core-service/cccteam-ccc-lib-ui-core-service.ts"],"sourcesContent":["import { computed, inject, Injectable, signal } from '@angular/core';\nimport { CreateNotificationMessage } from '@cccteam/ccc-lib/types';\nimport { NotificationService } from '@cccteam/ccc-lib/ui-notification-service';\n\n@Injectable({\n  providedIn: 'root',\n})\nexport class UiCoreService {\n  notifications = inject(NotificationService);\n  loadingSignal = signal([] as string[]);\n  sidenavOpened = signal(true);\n  currentSidenavIdentifier = signal('');\n\n  private loading = this.loadingSignal.asReadonly();\n  isLoading = computed(() => this.loading().length > 0);\n\n  publishError(message: CreateNotificationMessage): void {\n    this.notifications.addGlobalNotification(message);\n  }\n\n  beginActivity(process: string): void {\n    if (!this.loading().includes(process)) {\n      this.loadingSignal.update((current) => [...current, process]);\n    }\n  }\n\n  endActivity(process: string): void {\n    this.loadingSignal.update((current) => current.filter((p) => p !== process));\n  }\n\n  toggleSidenav(): void {\n    this.sidenavOpened.update((opened) => !opened);\n  }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAOa,aAAa,CAAA;AACxB,IAAA,aAAa,GAAG,MAAM,CAAC,mBAAmB,CAAC;AAC3C,IAAA,aAAa,GAAG,MAAM,CAAC,EAAc,oFAAC;AACtC,IAAA,aAAa,GAAG,MAAM,CAAC,IAAI,oFAAC;AAC5B,IAAA,wBAAwB,GAAG,MAAM,CAAC,EAAE,+FAAC;AAE7B,IAAA,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE;AACjD,IAAA,SAAS,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,GAAG,CAAC,gFAAC;AAErD,IAAA,YAAY,CAAC,OAAkC,EAAA;AAC7C,QAAA,IAAI,CAAC,aAAa,CAAC,qBAAqB,CAAC,OAAO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