{"version":3,"file":"verben-ng-ui-src-lib-services.mjs","sources":["../../../projects/verben-ng-ui/src/lib/services/icon.service.ts","../../../projects/verben-ng-ui/src/lib/services/notification.services.ts","../../../projects/verben-ng-ui/src/lib/services/verben-ng-ui-src-lib-services.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { Observable, of } from 'rxjs';\nimport { catchError } from 'rxjs/operators';\n\n@Injectable({\n  providedIn: 'root',\n})\nexport class IconService {\n  constructor(private http: HttpClient) {}\n\n  getIcon(iconName: string): Observable<string> {\n    return this.http.get(`/icons/${iconName}.svg`, { responseType: 'text' }).pipe(\n      catchError(() => of('')) // Handle errors (e.g., if the SVG doesn't exist)\n    );\n  }\n}","import { Injectable } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\n\ninterface NotificationOptions {\n  timeout?: number;\n  position?: string;\n  buttons?: { text: string; bgColor?: string; primaryColor?: string }[];\n  type: 'success' | 'error' | 'warning' | 'info';\n}\n\ninterface NotificationStyles {\n  backgroundColor: string;\n  textColor: string;\n  iconName: string;\n  iconWidth: number;\n  iconHeight: number;\n  stroke: string;\n  fill: string;\n}\n\n@Injectable({\n  providedIn: 'root',\n})\nexport class NotificationService {\n  private notificationSubject = new BehaviorSubject<{\n    message: string;\n    options: NotificationOptions & NotificationStyles;\n  } | null>(null);\n  notification$ = this.notificationSubject.asObservable();\n\n  private getDefaultOptions(\n    type: NotificationOptions['type']\n  ): NotificationStyles {\n    const typeStyles: Record<NotificationOptions['type'], NotificationStyles> =\n      {\n        success: {\n          backgroundColor: '#D6F3E6',\n          textColor: '#2DB76F',\n          iconName: 'success',\n          iconWidth: 20,\n          iconHeight: 20,\n          stroke: '',\n          fill: '',\n        },\n        error: {\n          backgroundColor: '#FFE681',\n          textColor: '#E20000',\n          iconName: 'warning',\n          iconWidth: 20,\n          iconHeight: 20,\n          stroke: '#E20000',\n          fill: '#E20000',\n        },\n        warning: {\n          backgroundColor: '#eda73f1a',\n          textColor: '#EDA73F',\n          iconName: 'dangerInfo',\n          iconWidth: 20,\n          iconHeight: 20,\n          stroke: '#EDA73F',\n          fill: '#EDA73F',\n        },\n        info: {\n          backgroundColor: '#E7F1FF',\n          textColor: '#0552B5',\n          iconName: 'dangerInfo',\n          iconWidth: 20,\n          iconHeight: 20,\n          stroke: '#0552B5',\n          fill: '#0552B5',\n        },\n      };\n\n    return (\n      typeStyles[type] || {\n        backgroundColor: '#333',\n        textColor: '#fff',\n        iconName: '',\n        iconWidth: 20,\n        iconHeight: 20,\n        stroke: '',\n        fill: '',\n      }\n    );\n  }\n\n  showNotification(\n    type: NotificationOptions['type'],\n    message: string,\n    options: Partial<NotificationOptions> = {}\n  ) {\n    const defaultOptions: NotificationOptions & NotificationStyles = {\n      timeout: 2000,\n      position: 'top-right',\n      ...this.getDefaultOptions(type),\n      type,\n    };\n    this.notificationSubject.next({\n      message,\n      options: { ...defaultOptions, ...options },\n    });\n  }\n\n  clearNotification() {\n    this.notificationSubject.next(null);\n  }\n\n  success(message: string, options?: Partial<NotificationOptions>) {\n    this.showNotification('success', message, options);\n  }\n\n  warning(message: string, options?: Partial<NotificationOptions>) {\n    this.showNotification('warning', message, options);\n  }\n\n  error(message: string, options?: Partial<NotificationOptions>) {\n    this.showNotification('error', message, options);\n  }\n\n  info(message: string, options?: Partial<NotificationOptions>) {\n    this.showNotification('info', message, options);\n  }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAQa,WAAW,CAAA;AACF,IAAA,IAAA,CAAA;AAApB,IAAA,WAAA,CAAoB,IAAgB,EAAA;QAAhB,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAY;KAAI;AAExC,IAAA,OAAO,CAAC,QAAgB,EAAA;AACtB,QAAA,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAU,OAAA,EAAA,QAAQ,CAAM,IAAA,CAAA,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,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