{"version":3,"file":"ngx-smart-forms-smart-error-display.mjs","sources":["../../../../libs/smart-error-display/src/lib/utils/themes.ts","../../../../libs/smart-error-display/src/lib/utils/styles.utils.ts","../../../../libs/smart-error-display/src/lib/smart-error-display/smart-error-display.component.ts","../../../../libs/smart-error-display/src/ngx-smart-forms-smart-error-display.ts"],"sourcesContent":["export const THEMES: { [key: string]: object } = {\n  light: {\n    color: '#d32f2f',\n    fontSize: '12px',\n    backgroundColor: '#ffffff',\n  },\n  dark: {\n    color: '#ff5252',\n    fontSize: '12px',\n    backgroundColor: '#333333',\n  },\n  compact: {\n    fontSize: '10px',\n    color: '#d32f2f',\n    backgroundColor: '#ffffff',\n  },\n};\n","import { THEMES } from './themes';\n\n// Define the configuration interface for flexibility in controlling behavior\ninterface StyleUtilConfig {\n  cacheEnabled?: boolean; // Toggle caching on or off\n  stylePriority?: Array<'theme' | 'class' | 'custom'>; // Set priority order of style sources\n  errorHandler?: (error: unknown, styleSheetHref?: string) => void; // Custom error handler function\n}\n\n// Default configuration settings for the utility\nconst defaultConfig: StyleUtilConfig = {\n  cacheEnabled: true,\n  stylePriority: ['theme', 'class', 'custom'],\n  errorHandler: (error, styleSheetHref) => {\n    console.warn('Cannot access stylesheet:', styleSheetHref, error);\n  },\n};\n\n// Cache to store extracted styles for class names\nconst styleCache: { [key: string]: { [key: string]: string } } = {};\n\n/**\n * Merges styles from a specified theme, class, and any custom styles provided.\n *\n * @param themeName - The name of the theme to retrieve styles from (e.g., 'light', 'dark').\n * @param className - The class name(s) applied to the element for additional styling. Overrides theme styles.\n * @param customStyles - An object containing custom inline styles that will override both theme and class styles.\n * @param config - Configuration options to control caching, style source priority, and error handling.\n * @returns An object containing the merged styles with the specified precedence order.\n */\nexport function getMergedStyles(\n  themeName: string,\n  className: string | null,\n  customStyles: { [key: string]: string } = {},\n  config: StyleUtilConfig = defaultConfig\n): { [key: string]: string } {\n  // Retrieve base theme styles if no class styles are specified\n  const themeStyles = THEMES[themeName] || {};\n\n  // Handle multiple classes if provided, merge extracted styles\n  const classStyles = className\n    ? mergeMultipleClassStyles(className.split(' '), config)\n    : {};\n\n  // Determine the order of merging based on the config priority\n  const styles = {\n    theme: themeStyles,\n    class: classStyles,\n    custom: customStyles,\n  };\n\n  // Merge styles based on the configured priority\n  const mergedStyles = config.stylePriority?.reduce(\n    (acc, key) => ({ ...acc, ...styles[key] }),\n    {}\n  );\n\n  return mergedStyles || {};\n}\n\n/**\n * Merges styles from multiple classes, ensuring later classes override earlier ones.\n * Caches results to improve performance for frequently used classes.\n *\n * @param classNames - An array of class names to extract and merge styles from.\n * @param config - Configuration options that control caching and error handling.\n * @returns An object containing the merged CSS properties and values from all specified classes.\n */\nfunction mergeMultipleClassStyles(\n  classNames: string[],\n  config: StyleUtilConfig\n): { [key: string]: string } {\n  return classNames.reduce((acc, className) => {\n    // Use caching if enabled\n    if (config.cacheEnabled && styleCache[className]) {\n      return { ...acc, ...styleCache[className] };\n    }\n\n    // Extract styles for the class and cache if enabled\n    const extractedStyles = extractStylesFromClass(`.${className}`, config);\n    if (config.cacheEnabled) {\n      styleCache[className] = extractedStyles;\n    }\n\n    return { ...acc, ...extractedStyles };\n  }, {});\n}\n\n/**\n * Extracts styles from the specified class name by accessing document style sheets.\n * Handles large projects efficiently by caching results and handling errors gracefully.\n *\n * @param className - The class name (e.g., '.error') whose styles you want to extract.\n * @param config - Configuration options that control error handling.\n * @returns An object containing the extracted CSS properties and their values.\n */\nfunction extractStylesFromClass(\n  className: string,\n  config: StyleUtilConfig\n): { [key: string]: string } {\n  const extractedStyles: { [key: string]: string } = {};\n  const styleSheets = Array.from(document.styleSheets);\n\n  // Iterate through each style sheet\n  styleSheets.forEach((styleSheet) => {\n    // Some style sheets may not be accessible due to CORS policies; use error handler if set\n    try {\n      const cssRules = styleSheet.cssRules || styleSheet.rules; // Get CSS rules\n\n      // Iterate through each rule in the style sheet\n      Array.from(cssRules).forEach((rule: CSSRule) => {\n        // Check if the rule is a style rule and matches the class name\n        if (\n          rule instanceof CSSStyleRule &&\n          rule.selectorText.includes(className)\n        ) {\n          // Extract styles from the matched rule\n          for (let i = 0; i < rule.style.length; i++) {\n            const propertyName = rule.style[i];\n            const propertyValue = rule.style.getPropertyValue(propertyName);\n            extractedStyles[propertyName] = propertyValue;\n          }\n        }\n      });\n    } catch (error) {\n      // Use the custom error handler defined in the configuration\n      config.errorHandler?.(error, styleSheet.href || '');\n    }\n  });\n\n  return extractedStyles;\n}\n","import { CommonModule } from '@angular/common';\nimport {\n  AfterViewInit,\n  ChangeDetectionStrategy,\n  ChangeDetectorRef,\n  Component,\n  ElementRef,\n  HostListener,\n  Input,\n  OnDestroy,\n  OnInit,\n  Optional,\n  Renderer2,\n  Self,\n} from '@angular/core';\nimport {\n  AbstractControl,\n  FormsModule,\n  NgControl,\n  ReactiveFormsModule,\n} from '@angular/forms';\n\nimport { debounceTime, distinctUntilChanged, Subscription } from 'rxjs';\n\nimport { getMergedStyles } from '../utils';\n\n/**\n * SmartErrorDisplayComponent\n *\n * A robust Angular component that displays validation errors for a given form control or form group.\n * This component offers advanced theming, localization, custom error formatting, accessibility features,\n * performance optimizations, and analytics integration, making it suitable for production use in any Angular application.\n */\n@Component({\n  selector: 'smart-error-display',\n  standalone: true,\n  imports: [CommonModule, ReactiveFormsModule, FormsModule],\n  template: `\n    <div\n      *ngIf=\"shouldDisplayError\"\n      [ngStyle]=\"mergedStyles\"\n      aria-live=\"assertive\"\n      role=\"alert\"\n      id=\"smart-error-display\"\n    >\n      <div *ngFor=\"let error of errorMessages\">\n        {{ error }}\n      </div>\n    </div>\n  `,\n  changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SmartErrorDisplay implements OnInit, AfterViewInit, OnDestroy {\n  /**\n   * The form control or form group whose errors will be displayed.\n   * Supports both reactive form controls (AbstractControl) and template-driven form controls (NgControl).\n   */\n  @Input() control: AbstractControl | null = null;\n\n  /**\n   * Custom error messages to override default messages.\n   * The key represents the error type (e.g., 'required'), and the value is the custom message.\n   */\n  @Input() customMessages: { [key: string]: string } | null = null;\n\n  /**\n   * Inline styles to apply to the error message container, allowing for custom theming.\n   */\n  @Input() themeStyles: { [key: string]: string } = {};\n\n  /**\n   * CSS class to apply to the error message container for additional styling or theming.\n   */\n  @Input() themeClass: string | null = null;\n\n  /**\n   * Predefined theme option for the error messages ('light', 'dark', or 'compact').\n   * Accepted values: 'light', 'dark', 'compact'.\n   */\n  @Input() theme: 'light' | 'dark' | 'compact' = 'light';\n\n  /**\n   * Custom formatter function to format error messages dynamically based on the error key and value.\n   */\n  @Input() errorFormatter: (\n    errorKey: string,\n    errorValue: unknown,\n    controlName?: string\n  ) => string | null = () => null;\n\n  /**\n   * Controls when the error messages are displayed: on value change, focus, blur, or hover.\n   * Accepted values: 'change', 'focus', 'blur', 'hover'.\n   */\n  @Input() displayOn: 'change' | 'focus' | 'blur' | 'hover' = 'change';\n\n  /**\n   * Configurable debounce time for value changes in milliseconds. Default is 300ms.\n   */\n  @Input() debounceTime = 300;\n\n  /**\n   * Optional translation service for localizing error messages.\n   * Should implement a `translate()` method that takes a message string and returns the translated version.\n   */\n  @Input() translationService: {\n    translate: (message: string) => string;\n  } | null = null;\n\n  /**\n   * Optional analytics service for logging errors, useful for tracking user behavior and form issues.\n   * Should implement a `logEvent()` method that logs the error event.\n   */\n  @Input() analyticsService: {\n    logEvent?: (eventName: string, eventData: unknown) => void;\n  } | null = null;\n\n  /**\n   * Hook to customize how logging is handled. Allows integration with various analytics services.\n   * Defaults to using `analyticsService.logEvent`.\n   */\n  @Input() logError: (errorKey: string, controlName?: string) => void =\n    this.defaultLogError;\n\n  /**\n   * Default messages used when custom messages are not provided.\n   */\n  @Input() defaultMessages: { [key: string]: string } = {\n    required: 'This field is required.',\n    minlength: 'The value is too short.',\n    maxlength: 'The value is too long.',\n    email: 'Please enter a valid email address.',\n    pattern: 'The value does not match the required pattern.',\n    min: 'The value is too low.',\n    max: 'The value is too high.',\n  };\n\n  /**\n   * Template reference for the associated input element.\n   */\n  @Input() inputRef!: ElementRef;\n\n  /**\n   * Merged styles applied to the error display container.\n   * Combines the styles from the selected theme and any custom styles provided via `themeStyles`.\n   * This object uses an index signature to allow flexible CSS property-value pairs.\n   */\n  mergedStyles: { [key: string]: string } = {};\n\n  /**\n   * Flag to determine if errors should be displayed based on the control's state and the display trigger.\n   */\n  shouldDisplayError = false;\n\n  /**\n   * Internal state variables to track focus.\n   */\n  private _focused = false;\n\n  /**\n   * Internal state variables to track hover.\n   */\n  private _hovered = false;\n\n  /**\n   * Subscription management to handle clean up.\n   */\n  private valueChangeSubscription: Subscription | null = null;\n\n  constructor(\n    @Optional() @Self() private ngControl: NgControl,\n    private cdr: ChangeDetectorRef,\n    private renderer: Renderer2\n  ) {}\n\n  /**\n   * Initializes the component and sets up subscriptions to form control value changes.\n   * Automatically detects whether the control is provided via reactive forms or template-driven forms.\n   */\n  ngOnInit() {\n    // Use the injected NgControl if control input is not provided (for template-driven forms)\n    if (!this.control && this.ngControl) {\n      this.control = this.ngControl.control;\n    }\n\n    // Validate inputs\n    this.validateInputs();\n\n    if (this.control) {\n      // Subscribe to value changes with configurable debounce time\n      this.valueChangeSubscription = this.control.valueChanges\n        .pipe(debounceTime(this.debounceTime), distinctUntilChanged())\n        .subscribe({\n          next: () => {\n            this.updateDisplayErrorState();\n            this.cdr.detectChanges();\n          },\n          error: (err) => this.handleComponentError(err),\n        });\n    }\n  }\n\n  /**\n   * Lifecycle hook that is called after a component's view has been fully initialized.\n   * This method attaches input listeners and merges styles based on the provided theme,\n   * theme class, and theme styles.\n   */\n  ngAfterViewInit() {\n    this.attachInputListeners();\n    this.mergedStyles = getMergedStyles(\n      this.theme,\n      this.themeClass,\n      this.themeStyles\n    );\n  }\n\n  /**\n   * Returns a list of formatted error messages based on the control's current errors.\n   * It uses custom messages, default messages, or a provided error formatter function.\n   */\n  get errorMessages(): string[] {\n    if (!this.control || !this.control.errors) {\n      return [];\n    }\n\n    const errors = Object.entries(this.control.errors);\n    return errors.map(([errorKey, errorValue]) => {\n      const controlName = this.control?.parent\n        ? this.control.parent.getError(errorKey)\n        : undefined;\n      const message =\n        (this.errorFormatter &&\n          this.errorFormatter(errorKey, errorValue, controlName)) ||\n        this.customMessages?.[errorKey] ||\n        this.getDefaultMessage(errorKey);\n\n      this.logError(errorKey);\n      return message;\n    });\n  }\n\n  /**\n   * Provides default error messages for common validation errors.\n   * Supports localization through an optional translation service.\n   *\n   * @param errorKey - The key representing the type of error (e.g., 'required').\n   * @returns The default error message or a translated message if a translation service is provided.\n   */\n  private getDefaultMessage(errorKey: string): string {\n    const message = this.defaultMessages[errorKey] || 'Invalid input.';\n    return this.translationService\n      ? this.translationService.translate(message)\n      : message;\n  }\n\n  /**\n   * Default logging function that uses the provided analytics service if available.\n   *\n   * @param errorKey - The key representing the type of error (e.g., 'required').\n   */\n  private defaultLogError(errorKey: string) {\n    if (this.analyticsService?.logEvent) {\n      this.analyticsService.logEvent('form_error', { error: errorKey });\n    }\n  }\n\n  /**\n   * Attaches input listeners directly to the provided input reference.\n   */\n  private attachInputListeners() {\n    if (this.displayOn === 'change') {\n      return;\n    }\n\n    if (!this.inputRef) {\n      console.warn(\n        `No input reference provided for display type ${this.displayOn}. Error display may not work as expected.`\n      );\n      return;\n    }\n    const inputElement = this.inputRef?.nativeElement;\n\n    // Ensure listeners are correctly attached\n    this.renderer.listen(inputElement, 'focus', this.handleFocus.bind(this));\n    this.renderer.listen(inputElement, 'blur', this.handleBlur.bind(this));\n    this.renderer.listen(\n      inputElement,\n      'mouseenter',\n      this.handleMouseEnter.bind(this)\n    );\n    this.renderer.listen(\n      inputElement,\n      'mouseleave',\n      this.handleMouseLeave.bind(this)\n    );\n  }\n  /**\n   * Updates the state of whether errors should be displayed based on the control's status and user interactions.\n   */\n  private updateDisplayErrorState() {\n    if (!this.control) {\n      this.shouldDisplayError = false;\n      return;\n    }\n\n    // Update error display state based on current interaction mode\n    const isInvalidAndTouched = this.control.invalid && this.control.touched;\n\n    switch (this.displayOn) {\n      case 'change':\n        this.shouldDisplayError = isInvalidAndTouched || this.control.dirty;\n        break;\n      case 'focus':\n        this.shouldDisplayError = this.control.invalid && this._focused;\n        break;\n      case 'blur':\n        this.shouldDisplayError = isInvalidAndTouched && !this._focused;\n        break;\n      case 'hover':\n        this.shouldDisplayError = this.control.invalid && this._hovered;\n        break;\n      default:\n        this.shouldDisplayError = isInvalidAndTouched;\n    }\n    this.cdr.detectChanges();\n  }\n\n  /**\n   * Handles the focus event of the error display container.\n   * Sets the internal state variable `_focused` to true and updates the display error state.\n   */\n  @HostListener('focus', ['$event.target'])\n  handleFocus() {\n    this._focused = true;\n    this.updateDisplayErrorState();\n  }\n\n  /**\n   * Handles the blur event of the error display container.\n   * Sets the internal state variable `_focused` to false and updates the display error state.\n   */\n  @HostListener('blur', ['$event.target'])\n  handleBlur() {\n    this._focused = false;\n    this.updateDisplayErrorState();\n  }\n\n  /**\n   * Handles the mouse enter event of the error display container.\n   * Sets the internal state variable `_hovered` to true and updates the display error state.\n   */\n  @HostListener('mouseenter', ['$event.target'])\n  handleMouseEnter() {\n    this._hovered = true;\n    this.updateDisplayErrorState();\n  }\n\n  /**\n   * Handles the mouse leave event of the error display container.\n   * Sets the internal state variable `_hovered` to false and updates the display error state.\n   */\n  @HostListener('mouseleave', ['$event.target'])\n  handleMouseLeave() {\n    this._hovered = false;\n    this.updateDisplayErrorState();\n  }\n\n  /**\n   * Cleanup logic to prevent memory leaks by unsubscribing from value changes.\n   */\n  ngOnDestroy() {\n    this.valueChangeSubscription?.unsubscribe();\n  }\n\n  /**\n   * Validates inputs to ensure they are within expected ranges and types.\n   */\n  private validateInputs() {\n    // Validate theme input\n    const validThemes = ['light', 'dark', 'compact'];\n    if (!validThemes.includes(this.theme)) {\n      console.warn(`Invalid theme '${this.theme}'. Defaulting to 'light'.`);\n      this.theme = 'light';\n    }\n\n    // Validate displayOn input\n    const validDisplayOn = ['change', 'focus', 'blur', 'hover'];\n    if (!validDisplayOn.includes(this.displayOn)) {\n      console.warn(\n        `Invalid displayOn value '${this.displayOn}'. Defaulting to 'change'.`\n      );\n      this.displayOn = 'change';\n    }\n\n    // Validate debounceTime input\n    if (this.debounceTime < 0) {\n      console.warn(\n        `Invalid debounceTime '${this.debounceTime}'. Defaulting to 300ms.`\n      );\n      this.debounceTime = 300;\n    }\n  }\n\n  /**\n   * Handles component errors and provides a fallback mechanism.\n   *\n   * @param error - The error object caught during the execution of the component.\n   */\n  private handleComponentError(error: unknown) {\n    console.error('Error detected in SmartErrorDisplayComponent:', error);\n    // Display generic error message or highlight the affected input field\n    this.shouldDisplayError = true;\n    this.mergedStyles = { ...this.mergedStyles, border: '1px solid red' };\n    this.cdr.markForCheck();\n  }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAAO,MAAM,MAAM,GAA8B;AAC/C,IAAA,KAAK,EAAE;AACL,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,QAAQ,EAAE,MAAM;AAChB,QAAA,eAAe,EAAE,SAAS;AAC3B,KAAA;AACD,IAAA,IAAI,EAAE;AACJ,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,QAAQ,EAAE,MAAM;AAChB,QAAA,eAAe,EAAE,SAAS;AAC3B,KAAA;AACD,IAAA,OAAO,EAAE;AACP,QAAA,QAAQ,EAAE,MAAM;AAChB,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,eAAe,EAAE,SAAS;AAC3B,KAAA;CACF;;ACPD;AACA,MAAM,aAAa,GAAoB;AACrC,IAAA,YAAY,EAAE,IAAI;AAClB,IAAA,aAAa,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC;AAC3C,IAAA,YAAY,EAAE,CAAC,KAAK,EAAE,cAAc,KAAI;QACtC,OAAO,CAAC,IAAI,CAAC,2BAA2B,EAAE,cAAc,EAAE,KAAK,CAAC,CAAC;KAClE;CACF,CAAC;AAEF;AACA,MAAM,UAAU,GAAiD,EAAE,CAAC;A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