{"version":3,"file":"odx-angular-components-timepicker.mjs","sources":["../../../../libs/angular/components/timepicker/src/lib/timepicker.token.ts","../../../../libs/angular/components/timepicker/src/lib/components/timepicker-option.component.ts","../../../../libs/angular/components/timepicker/src/lib/timepicker.service.ts","../../../../libs/angular/components/timepicker/src/lib/directives/timepicker-input-control.directive.ts","../../../../libs/angular/components/timepicker/src/lib/utils/generate-time-stamps.ts","../../../../libs/angular/components/timepicker/src/lib/timepicker.component.ts","../../../../libs/angular/components/timepicker/src/lib/timepicker.component.html","../../../../libs/angular/components/timepicker/src/lib/timepicker.module.ts","../../../../libs/angular/components/timepicker/src/lib/utils/ngx-mask-helper.ts","../../../../libs/angular/components/timepicker/src/odx-angular-components-timepicker.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { TimepickerComponent } from './timepicker.component';\n\n/**\n * An InjectionToken used for injecting an instance of TimepickerComponent.\n * This token facilitates the decoupling of the TimepickerComponent's implementation from its consumption,\n * allowing for more flexible and maintainable code, especially in scenarios requiring custom time picker\n * behavior or appearance.\n */\nexport const TIMEPICKER_CONTROL = new InjectionToken<TimepickerComponent>('@odx/angular/components/timepicker::TimepickerComponent');\n","import { ChangeDetectionStrategy, Component, EventEmitter, OnInit, Output, ViewEncapsulation, inject } from '@angular/core';\nimport { DisabledController, WithDisabledState, detectControllerChanges } from '@odx/angular';\nimport { OptionControl } from '@odx/angular/cdk/option-control';\nimport { CSSComponent } from '@odx/angular/internal';\nimport { TIMEPICKER_CONTROL } from '../timepicker.token';\n\n/**\n * Represents a selectable option within a timepicker component. This component allows for\n * individual time values to be selected from a dropdown menu as part of the timepicker interface.\n * It integrates with the timepicker's control to manage selection state and accessibility.\n *\n * @extends {OptionControl<string>}\n */\n@CSSComponent('timepicker-option')\n@Component({\n  selector: 'odx-timepicker-option',\n  template: `<ng-content />`,\n  standalone: true,\n  encapsulation: ViewEncapsulation.None,\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  providers: [DisabledController.connect()],\n  hostDirectives: [WithDisabledState],\n})\nexport class TimepickerOptionComponent extends OptionControl<string> implements OnInit {\n  private readonly timepicker = inject(TIMEPICKER_CONTROL);\n  protected readonly disabledController = DisabledController.inject();\n\n  /**\n   * Indicates whether this time option is currently selected.\n   * @type {boolean}\n   * @default false\n   */\n  public override isSelected = false;\n  /**\n   * Indicates whether this time option is currently active (e.g., highlighted by keyboard navigation).\n   * This is an override from the base `OptionControl`.\n   * @type {boolean}\n   * @default false\n   */\n  public override isActive = false;\n\n  /**\n   * Whether the option is disabled. This is used to determine whether the option should be selectable.\n   *\n   * @type {boolean}\n   */\n  public get disabled(): boolean {\n    return !!this.disabledController?.disabled;\n  }\n\n  /**\n   * Emits an event when the option is selected, allowing the timepicker component to update its value\n   * and close the dropdown.\n   *\n   * @emits {TimepickerOptionComponent}\n   */\n  @Output()\n  public selected = new EventEmitter<TimepickerOptionComponent>();\n\n  constructor() {\n    super();\n    detectControllerChanges(this.timepicker).pipe(this.takeUntilDestroyed()).subscribe();\n  }\n\n  public ngOnInit(): void {\n    this.isSelected = this.timepicker.isTimeOptionSelected(this);\n  }\n\n  /**\n   * Sets the active styles for the option, typically indicating that it is\n   * focused or highlighted via keyboard navigation.\n   */\n  public setActiveStyles(): void {\n    this.isActive = true;\n  }\n\n  protected selectOption(): void {\n    this.selected.emit(this);\n  }\n}\n","import { Injectable, inject, signal } from '@angular/core';\nimport { WindowRef } from '@odx/angular';\nimport { isAfter, isBefore, isEqual } from 'date-fns';\n\n/**\n * Service to provide utility functions for timepicker components, including validation, placeholder generation, and finding the closest time.\n * It also handles locale-based time formatting.\n */\n@Injectable({ providedIn: 'root' })\nexport class TimepickerService {\n  private readonly windowRef = inject(WindowRef);\n\n  public useLocale = signal(false);\n\n  /**\n   * Validates if the given time is less than or equal to a maximum time constraint.\n   *\n   * @param {string} time - The time to validate.\n   * @param {string} max - The maximum allowable time.\n   * @returns {boolean} True if the time is valid (i.e., not after max), false otherwise.\n   */\n  public maxValidation(time: string, max: string): boolean {\n    const [targetValue, maxValue] = this.convertToDates([time, max]);\n    return isBefore(targetValue, maxValue) || isEqual(targetValue, maxValue);\n  }\n\n  /**\n   * Checks if the provided value is a valid time string in HH:mm or HH:mm AM/PM format.\n   * This method also acts as a type guard.\n   *\n   * @param {unknown} time - The value to validate.\n   * @returns {time is string} True if the value is a valid time string, false otherwise.\n   */\n  public isValidTime(time: unknown): time is string {\n    if (typeof time !== 'string') return false;\n    const trimmedTime = time.trim();\n    if (!trimmedTime) return false;\n    return Boolean(this.parseTimeString(trimmedTime.toUpperCase()));\n  }\n\n  public is12HourFormat(value: string): boolean {\n    return this.isValidTime(value) && !!this.parseTimeString(value.toUpperCase())?.hour12;\n  }\n\n  /**\n   * Validates if the given time is greater than or equal to a minimum time constraint.\n   *\n   * @param {string} time - The time to validate.\n   * @param {string} min - The minimum allowable time.\n   * @returns {boolean} True if the time is valid (i.e., not before min), false otherwise.\n   */\n  public minValidation(time: string, min: string): boolean {\n    const [targetValue, minValue] = this.convertToDates([time, min]);\n    return isAfter(targetValue, minValue) || isEqual(targetValue, minValue);\n  }\n\n  /**\n   * Finds the closest time to a target time from a list of times.\n   *\n   * @param {string[]} timeStamps - The list of time strings to search through (e.g., [\"10:00\", \"10:30\", \"11:00\"]).\n   * @param {string} targetTime - The target time string to find the closest match for (e.g., \"10:35\").\n   * @returns {string} The closest time string from the list to the target, formatted according to locale.\n   */\n  public findClosestDate(timeStamps: string[], targetTime: string): string {\n    const [target] = this.convertToDates([targetTime]);\n    const datesArray = this.convertToDates(timeStamps);\n\n    if (datesArray.length === 0) return this.getLocalizedTimeFormat(targetTime);\n\n    const closestDate = datesArray.reduce((prev, curr) => {\n      const prevDiff = Math.abs(prev.getTime() - target.getTime());\n      const currDiff = Math.abs(curr.getTime() - target.getTime());\n      return currDiff < prevDiff ? curr : prev;\n    });\n\n    const hours = closestDate.getHours().toString().padStart(2, '0');\n    const minutes = closestDate.getMinutes().toString().padStart(2, '0');\n    return this.getLocalizedTimeFormat(`${hours}:${minutes}`);\n  }\n\n  /**\n   * Formats a time string to a localized time format using Intl.DateTimeFormat.\n   *\n   * @param {unknown} time - The time string to format (e.g., \"14:30\").\n   * @param {boolean} [hour12=false] - Specifies if the output should use 12-hour format with AM/PM notation.\n   * @returns {string} The formatted time string, or an empty string if the input time is invalid.\n   */\n  public getLocalizedTimeFormat(time: unknown, hour12?: boolean): string {\n    if (!this.isValidTime(time)) return '';\n    const shouldUseHour12 = typeof hour12 === 'boolean' ? hour12 : this.useLocale();\n    const locale = shouldUseHour12 ? 'en-US' : 'en-GB';\n    const [date] = this.convertToDates([time]);\n    return new this.windowRef.nativeWindow.Intl.DateTimeFormat(locale, {\n      hour: '2-digit',\n      minute: '2-digit',\n      hour12: shouldUseHour12,\n    }).format(date);\n  }\n\n  private convertToDates(times: string[]): Date[] {\n    return times.map((time) => {\n      if (typeof time !== 'string') return new Date(NaN);\n      const parsed = this.parseTimeString(time.toUpperCase());\n      if (!parsed) return new Date(NaN);\n      const { hours, minutes } = parsed;\n      return new Date(2022, 11, 19, hours, minutes, 0, 0);\n    });\n  }\n\n  private parseTimeString(time: string): { hours: number; minutes: number; hour12: boolean } | null {\n    const match = time.trim().match(/^([01]?\\d|2[0-3]):([0-5]\\d)(?:\\s?(AM|PM))?$/);\n    if (!match) return null;\n\n    let hours = Number(match[1]);\n    const minutes = Number(match[2]);\n    const period = match[3]?.toUpperCase();\n\n    if (period) {\n      if (period === 'PM' && hours < 12) hours += 12;\n      if (period === 'AM' && hours === 12) hours = 0;\n    }\n\n    return { hours, minutes, hour12: Boolean(period) };\n  }\n}\n","import { Directive, inject } from '@angular/core';\nimport { WithDisabledState, WithTabIndex } from '@odx/angular';\nimport { InputControlDirective } from '@odx/angular/cdk/custom-form-control';\nimport { initNgxMask, ngxMaskProviderConfig } from '@odx/angular/cdk/date-input';\nimport { CSSComponent } from '@odx/angular/internal';\nimport { isString } from '@odx/angular/utils';\nimport { NgxMaskDirective, provideNgxMask } from 'ngx-mask';\nimport { TimepickerService } from '../timepicker.service';\nimport { TIMEPICKER_CONTROL } from '../timepicker.token';\n\n/**\n * Directive to enhance a standard input element for time picking, integrating mask functionality for time format.\n * It automatically adapts to locale settings provided by the enclosing `TimepickerComponent` to display time in the appropriate format.\n *\n * @extends {InputControlDirective}\n */\n@CSSComponent('timepicker__control')\n@Directive({\n  standalone: true,\n  selector: 'input[odxTimepickerControl]',\n  host: {\n    '[attr.readonly]': 'isReadonly || null',\n    '[attr.placeholder]': 'placeholder',\n  },\n  providers: [provideNgxMask(ngxMaskProviderConfig)],\n  hostDirectives: [WithTabIndex, WithDisabledState, NgxMaskDirective],\n})\nexport class TimepickerInputControlDirective extends InputControlDirective {\n  private readonly timepicker = inject(TIMEPICKER_CONTROL);\n  private readonly timepickerService = inject(TimepickerService);\n  public readonly ngxMaskDirective = inject(NgxMaskDirective, { self: true, optional: true });\n\n  /**\n   * Returns the placeholder text for the input based on locale settings.\n   *\n   * @returns {string} The placeholder text for the input.\n   */\n  public get placeholder(): string {\n    return this.timepickerService.useLocale() ? '--:-- --' : '--:--';\n  }\n\n  /**\n   * Determines whether the timepicker input is readonly, based on the state of the parent timepicker component.\n   *\n   * @returns {boolean} `true` if the input should be readonly; otherwise, `false`.\n   */\n  protected get isReadonly(): boolean {\n    return this.timepicker.isReadonly;\n  }\n\n  /**\n   * Applies the time format mask to the input value, transforming and returning the masked value.\n   *\n   * @param {Event} event - The input event triggering the mask application.\n   * @returns {string} The masked input value.\n   */\n  public applyMask(useLocale: boolean): void {\n    if (!this.ngxMaskDirective) return;\n    const mask = useLocale ? 'Hh:m0 AM' : 'Hh:m0';\n    useLocale !== this.ngxMaskDirective._maskService.apm && (this.ngxMaskDirective._maskService.apm = useLocale);\n    if (Object.hasOwn(this.ngxMaskDirective, '_maskValue') && this.ngxMaskDirective['_maskValue'] !== mask) {\n      initNgxMask(this.ngxMaskDirective, mask);\n    }\n  }\n\n  /**\n   * Updates the input value through ngx-mask directive.\n   *\n   * @param {string | null} value - The new value to set in the input.\n   */\n  public setMaskedValue(value: string | null): void {\n    const normalized = isString(value) ? value : '';\n    this.ngxMaskDirective?.writeValue(normalized);\n  }\n}\n","/**\n * Generates an array of time stamps within a 24-hour period based on the specified step interval.\n * The time stamps can be formatted in 24-hour format or 12-hour format with AM/PM based on locale preference.\n *\n * @param {number} step - The interval, in minutes, between each time stamp.\n * @param {boolean} useLocale - Determines if the time stamps should use the 12-hour format with AM/PM (`true`) or the 24-hour format (`false`).\n * @returns {string[]} An array of formatted time stamps as strings.\n * @example\n * ```ts\n * // Generate time stamps every 30 minutes using 24-hour format\n * generateTimeStamps(30, false);\n * // Returns [\"00:00\", \"00:30\", \"01:00\", ..., \"23:30\"]\n *\n * // Generate time stamps every 60 minutes using 12-hour format with AM/PM\n * generateTimeStamps(60, true);\n * // Returns [\"12:00 AM\", \"01:00 AM\", ..., \"11:00 PM\"]\n * ```\n */\nexport function generateTimeStamps(step: number, useLocale: boolean): string[] {\n  const roundedStep = Math.round(step);\n\n  return Array.from({ length: Math.ceil(24 * (60 / roundedStep)) }, (_, i) => {\n    const hours = Math.floor((i * roundedStep) / 60);\n    const minutes = (i * roundedStep) % 60;\n    return formatTime(hours, minutes, useLocale);\n  });\n}\n\n/**\n * Formats a given time as a string based on the specified hour, minute, and locale preference.\n * Can format time in either 24-hour format or 12-hour format with AM/PM.\n *\n * @param {number} hours - The hour component of the time.\n * @param {number} minutes - The minute component of the time.\n * @param {boolean} useLocale - Determines if the time should be formatted using the 12-hour format with AM/PM (`true`) or the 24-hour format (`false`).\n * @returns {string} The formatted time as a string.\n * @example\n * ```ts\n * // Format time using 24-hour format\n * formatTime(14, 30, false); // \"14:30\"\n *\n * // Format time using 12-hour format with AM/PM\n * formatTime(14, 30, true); // \"2:30 PM\"\n * ```\n */\nfunction formatTime(hours: number, minutes: number, useLocale: boolean): string {\n  if (useLocale) {\n    const period = hours >= 12 ? 'PM' : 'AM';\n    const displayHours = hours % 12 === 0 ? 12 : hours % 12;\n    return `${displayHours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')} ${period}`;\n  } else {\n    return `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}`;\n  }\n}\n","import { A11yModule, ActiveDescendantKeyManager } from '@angular/cdk/a11y';\nimport {\n  AfterViewInit,\n  ChangeDetectionStrategy,\n  Component,\n  HostListener,\n  Input,\n  OnDestroy,\n  QueryList,\n  ViewChild,\n  ViewChildren,\n  ViewEncapsulation,\n  booleanAttribute,\n  forwardRef,\n  inject,\n  input,\n  numberAttribute,\n} from '@angular/core';\nimport { DisabledController, ReadonlyController } from '@odx/angular';\nimport { CustomFormControl } from '@odx/angular/cdk/custom-form-control';\nimport { OptionControl } from '@odx/angular/cdk/option-control';\nimport { ActionGroupComponent } from '@odx/angular/components/action-group';\nimport { ButtonComponent } from '@odx/angular/components/button';\nimport { DropdownDirective, DropdownModule } from '@odx/angular/components/dropdown';\nimport { IconComponent } from '@odx/angular/components/icon';\nimport { CSSComponent } from '@odx/angular/internal';\nimport { injectElement, isFunction, untilDestroyed } from '@odx/angular/utils';\nimport { TimepickerOptionComponent } from './components/timepicker-option.component';\nimport { TimepickerInputControlDirective } from './directives/timepicker-input-control.directive';\nimport { TimepickerService } from './timepicker.service';\nimport { TIMEPICKER_CONTROL } from './timepicker.token';\nimport { generateTimeStamps } from './utils/generate-time-stamps';\n\n/**\n * Represents a time picker component allowing users to select a time from a dropdown list.\n * This component integrates with Angular forms and supports customization for locale, time range, and step intervals.\n *\n * @see {CustomFormControl}\n */\n@CSSComponent('timepicker')\n@Component({\n  standalone: true,\n  selector: 'odx-timepicker',\n  templateUrl: 'timepicker.component.html',\n  providers: [\n    DisabledController.connect(),\n    ReadonlyController.connect(),\n    {\n      provide: TIMEPICKER_CONTROL,\n      useExisting: forwardRef(() => TimepickerComponent),\n    },\n    TimepickerService,\n  ],\n  encapsulation: ViewEncapsulation.None,\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  imports: [A11yModule, ActionGroupComponent, ButtonComponent, DropdownModule, TimepickerOptionComponent, IconComponent, TimepickerInputControlDirective],\n  host: {\n    '[attr.readonly]': 'readonlyController?.readonly || null',\n  },\n})\nexport class TimepickerComponent extends CustomFormControl<string | null> implements AfterViewInit, OnDestroy {\n  private readonly timepickerService = inject(TimepickerService);\n  private _useLocale = false;\n  private openAnimationFrameId?: number;\n  protected keyManager?: ActiveDescendantKeyManager<OptionControl<string>>;\n\n  protected readonly takeUntilDestroyed = untilDestroyed();\n\n  @ViewChild(DropdownDirective)\n  protected readonly dropdown?: DropdownDirective;\n\n  @ViewChildren(TimepickerOptionComponent, { emitDistinctChangesOnly: true })\n  protected options!: QueryList<TimepickerOptionComponent>;\n\n  public readonly element = injectElement();\n\n  /**\n   * Controls whether the timepicker should use locale-specific time formats AM/PM.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  @Input({ transform: booleanAttribute })\n  public set useLocale(val: boolean) {\n    this.timepickerService.useLocale.set(val);\n    this.dateField?.applyMask(val);\n    if (this.value && this.dateField) {\n      const time = this.timepickerService.getLocalizedTimeFormat(this.value);\n      this.updateValue(time);\n      this.dateField.setMaskedValue(time);\n    }\n    this._useLocale = val;\n  }\n\n  /**\n   * Gets a boolean value indicating whether the locale is being used.\n   *\n   * @returns {boolean} A boolean value indicating whether the locale is being used.\n   */\n  public get useLocale(): boolean {\n    return this._useLocale;\n  }\n\n  /**\n   * When set to true, the select will display a reset button.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  public clearable = input(false, { transform: booleanAttribute });\n\n  /**\n   * Controls the step interval between time options in minutes.\n   *\n   * @type {number}\n   * @default 30\n   */\n  @Input({ transform: numberAttribute })\n  public step = 30;\n\n  /**\n   * Specifies the minimum time value that can be selected ('05:00' or '05:00 AM').\n   *\n   * @type {string}\n   * @default '00:00'\n   */\n  @Input()\n  public min = '00:00';\n\n  /**\n   * Specifies the maximum time value that can be selected ('22:00' or '10:00 PM').\n   *\n   * @type {string}\n   * @default '23:59'\n   */\n  @Input()\n  public max = '23:59';\n\n  /**\n   * The directive for the timepicker input control.\n   *\n   * @type {TimepickerInputControlDirective | undefined}\n   */\n  @ViewChild(TimepickerInputControlDirective)\n  public dateField?: TimepickerInputControlDirective;\n\n  constructor() {\n    super(null);\n  }\n\n  public ngAfterViewInit(): void {\n    this.handleDateFieldChanges();\n    this.updateInputValue();\n  }\n\n  public override ngOnDestroy(): void {\n    super.ngOnDestroy();\n    if (this.openAnimationFrameId !== undefined) cancelAnimationFrame(this.openAnimationFrameId);\n  }\n\n  /**\n   * Checks if the given time option is selected.\n   *\n   * @param {TimepickerOptionComponent} option - The time option to check.\n   * @returns {boolean} True if the option is selected, false otherwise.\n   */\n  public isTimeOptionSelected(option: TimepickerOptionComponent): boolean {\n    return this.value === option.value;\n  }\n\n  /**\n   * Handles the selection of a time option from the dropdown, updating the input field and closing the dropdown.\n   *\n   * @param {TimepickerOptionComponent | undefined} option - The selected time option component.\n   */\n  public timeSelected(option?: TimepickerOptionComponent): void {\n    this.setOption(option);\n    this.dropdown?.isOpen && this.dropdown?.close();\n  }\n\n  /**\n   * Determines whether the specified time is within the allowed time range.\n   *\n   * @param {string} time - The time to check, in 'HH:mm' or 'HH:mm AM/PM' format.\n   * @returns {boolean} True if the time is within the range; otherwise, false.\n   */\n  public inTimeRange(time: string): boolean {\n    return this.timepickerService.maxValidation(time, this.max) && this.timepickerService.minValidation(time, this.min);\n  }\n\n  /**\n   * Generates the list of time options based on the configured step interval and locale settings AM/PM.\n   *\n   * @returns {string[]} An array of time strings in 'HH:mm' format.\n   */\n  public get timeStampsList(): string[] {\n    return generateTimeStamps(this.step, this.useLocale);\n  }\n\n  /**\n   * @internal\n   * Writes a new value to the element.\n   * Part of the ControlValueAccessor interface.\n   * @param {string | null} value - The new value.\n   */\n  public override writeValue(value: string | null): void {\n    super.writeValue(value);\n    if (value === null || this.timepickerService.isValidTime(value)) {\n      this.updateInputValue();\n    }\n  }\n\n  protected onOpen(): void {\n    this.openAnimationFrameId = requestAnimationFrame(() => {\n      this.keyManager = new ActiveDescendantKeyManager<OptionControl<string>>(this.options).withHomeAndEnd();\n      this.setActiveOptionBasedOnCurrentValue();\n    });\n  }\n\n  @HostListener('click')\n  protected handleControllerClick(): void {\n    if (this.readonlyController?.readonly) return;\n    const activeOption = this.getActiveOption();\n    if (activeOption) {\n      this.scrollToActiveOption(activeOption, { behavior: 'smooth' });\n    }\n  }\n\n  @HostListener('keydown', ['$event'])\n  protected handleControllerKeydown(event: KeyboardEvent): void {\n    if (this.readonlyController?.readonly) return;\n    this.keyManager?.onKeydown(event);\n    const activeOption = this.getActiveOption();\n    if (activeOption) {\n      this.scrollToActiveOption(activeOption, { behavior: 'smooth' });\n    }\n    if (event.key === 'Enter' || event.key === ' ' || event.key === 'Spacebar') {\n      event.stopImmediatePropagation();\n      this.setOption(activeOption);\n    }\n  }\n\n  protected handleDateFieldChanges(): void {\n    this.dateField?.applyMask(this.useLocale);\n    this.dateField?.valueChange$.pipe(this.takeUntilDestroyed()).subscribe((time) => {\n      const normalized = typeof time === 'string' ? time.trim() : '';\n      if (!normalized) {\n        this.updateValue(null);\n        return;\n      }\n      if (!this.timepickerService.isValidTime(normalized)) return;\n      const is12HourInput = this.timepickerService.is12HourFormat(normalized);\n      if (is12HourInput !== this._useLocale) return;\n      this.updateValue(this.timepickerService.getLocalizedTimeFormat(normalized));\n    });\n  }\n\n  protected resetValue(e: Event): void {\n    e.stopImmediatePropagation();\n    this.updateValue(null);\n  }\n\n  private setActiveOptionBasedOnCurrentValue(): void {\n    const isSelected = this.options.find((option) => option.isSelected);\n    if (isSelected) {\n      this.activateOption(isSelected);\n      return;\n    }\n    this.activateNearestTimeOption();\n  }\n\n  private activateOption(option: TimepickerOptionComponent): void {\n    this.keyManager && this.keyManager.setActiveItem(option);\n    this.scrollToActiveOption(option);\n  }\n\n  private activateNearestTimeOption(): void {\n    if (!this.value) {\n      const currentDate = new Date();\n      const isNearest = this.findNearestTimeOption(currentDate);\n      if (isNearest) {\n        this.activateOption(isNearest);\n      }\n    }\n  }\n\n  private getActiveOption(): TimepickerOptionComponent | undefined {\n    return this.keyManager?.activeItem as TimepickerOptionComponent | undefined;\n  }\n\n  private findNearestTimeOption(currentDate: Date): TimepickerOptionComponent | undefined {\n    const availableTimeSlots = this.options.filter((option) => !option.disabled);\n    const nearestTimeValue = this.timepickerService.findClosestDate(\n      availableTimeSlots.map((option) => option.value) as string[],\n      `${currentDate.getHours()}:${currentDate.getMinutes()}`,\n    );\n\n    return availableTimeSlots.find((option) => option.value === nearestTimeValue);\n  }\n\n  private updateInputValue(): void {\n    if (!this.dateField) return;\n    this.dateField.setMaskedValue(this.timepickerService.getLocalizedTimeFormat(this.value));\n  }\n\n  private scrollToActiveOption(option: TimepickerOptionComponent, _opts: ScrollIntoViewOptions = {}): void {\n    if (isFunction(option.element.nativeElement.scrollIntoView)) {\n      option.element.nativeElement.scrollIntoView({ block: 'center', ..._opts });\n    }\n  }\n\n  private setOption(option?: TimepickerOptionComponent): void {\n    if (!option || option.disabled) return;\n    const time = this.timepickerService.getLocalizedTimeFormat(option.getLabel());\n    this.dateField?.setMaskedValue(time);\n    this.updateValue(time);\n  }\n}\n","<div class=\"odx-timepicker__wrapper\">\n  <input [value]=\"value\" odxTimepickerControl type=\"text\" />\n</div>\n\n<odx-action-group class=\"odx-timepicker__trigger-wrapper odx-no-margin\">\n  @if (clearable() && value) {\n    <button class=\"odx-timepicker__clear\" odxButton size=\"small\" aria-label=\"Reset time\" (click)=\"resetValue($event)\">\n      <odx-icon name=\"core::close\" />\n    </button>\n  }\n  <button\n    #dropdownTrigger\n    class=\"odx-timepicker__trigger\"\n    odxButton\n    size=\"small\"\n    variant=\"ghost\"\n    aria-label=\"Select time\"\n    [odxDropdown]=\"timeList\"\n    [odxDropdownOptions]=\"{ matchReferenceWidth: true, position: 'bottom-start' }\"\n    [odxDropdownTriggerElement]=\"dropdownTrigger.element.nativeElement\"\n    [odxDropdownReferenceElement]=\"element.nativeElement\"\n    (odxDropdownBeforeClose)=\"onTouched()\"\n    (odxDropdownAfterOpen)=\"onOpen()\"\n  >\n    <odx-icon name=\"core::chevron-down\" />\n  </button>\n</odx-action-group>\n\n<ng-template #timeList>\n  <div class=\"odx-timepicker__option-list\" role=\"listbox\">\n    @for (time of timeStampsList; track $index) {\n      <odx-timepicker-option [value]=\"time\" [disabled]=\"!inTimeRange(time)\" (selected)=\"timeSelected($event)\">{{ time }}</odx-timepicker-option>\n    }\n  </div>\n</ng-template>\n","import { NgModule } from '@angular/core';\nimport { CoreModule } from '@odx/angular';\nimport { TimepickerOptionComponent } from './components/timepicker-option.component';\nimport { TimepickerInputControlDirective } from './directives/timepicker-input-control.directive';\nimport { TimepickerComponent } from './timepicker.component';\n\nconst modules = [TimepickerComponent, TimepickerInputControlDirective, TimepickerOptionComponent];\n@NgModule({\n  imports: modules,\n  exports: [CoreModule, ...modules],\n})\nexport class TimepickerModule {}\n","/**\n * Processes and formats a time input value based on specific rules. It adjusts the input for valid time format,\n * especially focusing on single-digit hour inputs, ensuring minute values start with 0 if the last digit is greater\n * than 5, and appending 'M' to AM/PM indicators.\n *\n * @param {string} value - The current input value of the time field.\n * @param {InputEvent} event - The input event triggered by the user's interaction with the field.\n * @returns {string} The processed and potentially reformatted value.\n *\n * @example\n * ```ts\n * // Prepend 0 to single-digit hours greater than 1\n * processInputValue(\"2\", { inputType: \"insertText\" }); // Returns \"02\"\n *\n * // Ensure minute values are within valid ranges\n * processInputValue(\"11:8\", { inputType: \"insertText\" }); // Returns \"11:08\"\n *\n * // Append 'M' to AM/PM indicators\n * processInputValue(\"2 p\", { inputType: \"insertText\" }); // Returns \"2 PM\"\n * ```\n */\nexport function processInputValue(value: string, event: InputEvent): string {\n  if (value.length === 1 && Number(value) > 1) {\n    value = `0${value}`;\n  } else if (value.length === 4 && Number(value.at(-1)) > 5) {\n    value = `${value.slice(0, -1)}0${value.slice(-1)}`;\n  }\n\n  if (/[AaPp]/.test(value) && event.inputType === 'insertText') {\n    value = `${value.toUpperCase()}M`;\n  }\n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