import * as i0 from '@angular/core';
import { EventEmitter, input, effect, ElementRef, forwardRef, ViewChild, Output, Input, Optional, Inject, ChangeDetectionStrategy, ViewEncapsulation, Component, NgModule } from '@angular/core';
import * as i3 from '@angular/forms';
import { FormsModule, NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';
import * as i1 from '@fundamental-ngx/core/datetime';
import { DATE_TIME_FORMATS, TranslateDayPeriodPipe } from '@fundamental-ngx/core/datetime';
import * as i2 from '@fundamental-ngx/core/form';
import { FormMessageComponent, PopoverFormMessageService, registerFormItemControl } from '@fundamental-ngx/core/form';
import { InputGroupComponent, InputGroupInputDirective } from '@fundamental-ngx/core/input-group';
import { PopoverComponent, PopoverControlComponent, PopoverBodyComponent, PopoverService } from '@fundamental-ngx/core/popover';
import { TimeComponent } from '@fundamental-ngx/core/time';
import { NgTemplateOutlet } from '@angular/common';
import { FdTranslatePipe } from '@fundamental-ngx/i18n';

/** Creates an error to be thrown when attempting to use an invalid date implementation. */
function createMissingDateImplementationError(provider) {
    return Error(`FdTime: No provider found for ${provider}. You must import one of the following ` +
        `modules at your application root: FdDatetimeModule, or provide a ` +
        `custom implementation.`);
}

let timePickerCounter = 0;
class TimePickerComponent {
    /** Text displayed in message */
    set message(message) {
        this._message = message;
    }
    /** Type of the message. Can be 'success' | 'error' | 'warning' | 'information' */
    set messageType(messageType) {
        this._messageType = messageType;
    }
    /**
     * The trigger events that will open/close the message box.
     * Accepts any [HTML DOM Events](https://www.w3schools.com/jsref/dom_obj_event.asp).
     */
    set messageTriggers(triggers) {
        this._messageTriggers = triggers;
        this._popoverFormMessage.triggers = triggers;
    }
    /**
     *  The state of the form control - applies css classes.
     *  Also this is applied to message.
     *  Can be `success`, `error`, `warning`, `information` or blank for default.
     */
    set state(state) {
        this._state = state;
    }
    get state() {
        if (this._state == null && this.useValidation && this._isInvalidTimeInput) {
            return 'error';
        }
        return this._state ?? 'default';
    }
    /** @hidden */
    get _placeholder() {
        return this.placeholder || this._getPlaceholder();
    }
    /** @hidden */
    constructor(_changeDetectorRef, _elementRef, 
    // Use @Optional to avoid angular injection error message and throw our own which is more precise one
    _dateTimeAdapter, _dateTimeFormats, _popoverFormMessage) {
        this._changeDetectorRef = _changeDetectorRef;
        this._elementRef = _elementRef;
        this._dateTimeAdapter = _dateTimeAdapter;
        this._dateTimeFormats = _dateTimeFormats;
        this._popoverFormMessage = _popoverFormMessage;
        /** If it is mandatory field */
        this.required = false;
        /** Whether to show spinner buttons */
        this.spinnerButtons = true;
        /** Whether a null input is considered valid(success). */
        this.allowNull = true;
        /** Defines if time component should be used with tablet mode */
        this.tablet = false;
        /**
         *  The placement of the popover. It can be one of: top, top-start, top-end, bottom,
         *  bottom-start, bottom-end, right, right-start, right-end, left, left-start, left-end.
         */
        this.placement = 'bottom-start';
        /** Whether to validate the time picker input. */
        this.useValidation = true;
        /**
         * Whether AddOn Button should be focusable
         * @default true
         */
        this.buttonFocusable = true;
        /**
         * When set to true, time inputs won't allow to have 1 digit
         * for example 9 will become 09
         * but 12 will be kept as 12.
         */
        this.keepTwoDigitsTime = false;
        /** Event emitted when the state of the isOpen property changes. */
        this.isOpenChange = new EventEmitter();
        /**
         * The interval between selectable minutes (e.g., 1 for every minute, 5 for 5-minute intervals, 15 for 15-minute intervals).
         * Defaults to 1 (every minute).
         */
        this.minuteStep = input(1, ...(ngDevMode ? [{ debugName: "minuteStep" }] : []));
        /** @hidden */
        this._message = null;
        /** @hidden */
        this._messageType = null;
        /** @hidden */
        this._messageTriggers = ['focusin', 'focusout'];
        /**
         * @hidden
         * Whether the input time is valid(success). Internal use.
         */
        this._isInvalidTimeInput = false;
        /**
         * @hidden
         * Input field value
         */
        this._inputTimeValue = '';
        /** @hidden */
        this._formValueStateMessageId = `fd-time-picker-form-message-${timePickerCounter++}`;
        /** @hidden */
        this._state = null;
        /** @hidden */
        this.onChange = () => { };
        /** @hidden */
        this.onTouched = () => { };
        if (!this._dateTimeAdapter) {
            throw createMissingDateImplementationError('DateTimeAdapter');
        }
        if (!this._dateTimeFormats) {
            throw createMissingDateImplementationError('DATE_TIME_FORMATS');
        }
        effect(() => {
            this._dateTimeAdapter.locale();
            this._calculateTimeOptions();
            this._formatTimeInputField();
            this._changeDetectorRef.markForCheck();
        });
    }
    /** @hidden */
    ngOnInit() {
        this._calculateTimeOptions();
        this._formatTimeInputField();
    }
    /** @hidden */
    ngOnChanges(changes) {
        if (['displayHours', 'displayMinutes', 'displaySeconds', 'meridian', 'displayFormat'].some((change) => change in changes)) {
            this._calculateTimeOptions();
        }
        if (changes.displayFormat) {
            this._formatTimeInputField();
        }
    }
    /** @hidden */
    ngAfterViewInit() {
        this.initialiseVariablesInMessageService();
    }
    /**
     * @hidden
     * Function that implements Validator Interface, adds validation support for forms
     */
    validate() {
        if (this._isInvalidTimeInput) {
            return {
                timeValidation: {
                    valid: false
                }
            };
        }
        return null;
    }
    /**
     * Returns the current value of the time input.
     */
    getTime() {
        return this.time;
    }
    /**
     * Returns format options to be used during time formatting.
     */
    getDisplayFormat() {
        return this.displayFormat || this._dateTimeFormats.display.timeInput;
    }
    /**
     * Returns format options to be used during time parsing.
     */
    getParseFormat() {
        return this.parseFormat || this._dateTimeFormats.parse.timeInput;
    }
    /** @hidden */
    _getFormattedTime(time = this.time) {
        let formattedTime = '';
        try {
            if (this.allowNull && time === null) {
                return '';
            }
            formattedTime = this._dateTimeAdapter.format(time, this.getDisplayFormat());
        }
        catch { }
        return formattedTime;
    }
    /**
     *  @hidden
     *  When the open state is changed, there should be at least one active item, which by default is hour.
     */
    _setIsOpen(isOpen) {
        this.isOpen = isOpen;
        this._onOpenStateChanged(isOpen);
    }
    /**
     * @hidden
     * Time input field changes handler
     */
    _timeInputChanged(inputValue) {
        inputValue = inputValue.trim();
        // check if value has been changed
        if (this._inputTimeValue === inputValue) {
            return;
        }
        this._inputTimeValue = inputValue;
        if (inputValue === '') {
            this.time = null;
            this._isInvalidTimeInput = !this.allowNull;
        }
        if (inputValue !== '') {
            // Regex to detect and rearrange day period in the time string
            const dayPeriodPattern = /\b(night|morning|afternoon|evening)\b/g;
            inputValue = inputValue.replace(dayPeriodPattern, '').trim();
            this.time = this._dateTimeAdapter.parse(inputValue, this.getParseFormat());
            this._isInvalidTimeInput = !this._dateTimeAdapter.isValid(this.time);
        }
        this.onChange(this.time);
        this._changeDetectorRef.detectChanges();
    }
    /** @hidden */
    _inputGroupClicked($event) {
        if (!this.isOpen && !this.disabled) {
            $event.stopPropagation();
            this._setIsOpen(true);
        }
    }
    /** @hidden */
    _addOnButtonClicked() {
        if (!this.disabled) {
            this._setIsOpen(!this.isOpen);
        }
    }
    /** @hidden */
    _popoverClosed() {
        this._setIsOpen(false);
    }
    /** @hidden */
    _getPlaceholder() {
        let retVal = '';
        if (this._displayHours) {
            retVal = retVal + 'hh';
        }
        if (this._displayMinutes) {
            retVal = retVal + ':mm';
        }
        if (this._displaySeconds) {
            retVal = retVal + ':ss';
        }
        if (this._meridian) {
            retVal = retVal + ' am/pm';
        }
        return retVal;
    }
    /** @hidden */
    _timeComponentValueChanged(time) {
        if (this._dateTimeAdapter.dateTimesEqual(time, this.time)) {
            return;
        }
        this._inputTimeValue = this._getFormattedTime(time);
        this.time = time;
        this._isInvalidTimeInput = !this._dateTimeAdapter.isValid(time);
        this.onChange(time);
        this._changeDetectorRef.detectChanges();
    }
    // #region ControlValueAccessor
    /** @hidden */
    registerOnChange(fn) {
        this.onChange = fn;
    }
    /** @hidden */
    registerOnTouched(fn) {
        this.onTouched = fn;
    }
    /** @hidden */
    setDisabledState(isDisabled) {
        this.disabled = isDisabled;
        this._changeDetectorRef.detectChanges();
    }
    /** @hidden */
    writeValue(time) {
        if (!time) {
            this.time = null;
            this._inputTimeValue = '';
            this._isInvalidTimeInput = !this.allowNull;
        }
        else {
            this.time = this._dateTimeAdapter.parse(time, this.getParseFormat());
            this._inputTimeValue = this._getFormattedTime(time);
            this._isInvalidTimeInput = !this._dateTimeAdapter.isValid(time);
        }
        this._changeDetectorRef.markForCheck();
    }
    // #endregion ControlValueAccessor
    /** @hidden */
    _formatTimeInputField(time = this.time) {
        return (this._inputTimeValue = this._getFormattedTime(time));
    }
    /** @hidden */
    _changeMessageVisibility() {
        if (this.isOpen) {
            this._popoverFormMessage.hide();
        }
        else {
            this._popoverFormMessage.show();
        }
    }
    /** @hidden */
    _onOpenStateChanged(isOpen) {
        this.isOpenChange.emit(isOpen);
        this._changeMessageVisibility();
        if (isOpen) {
            this._changeDetectorRef.detectChanges();
            this.child.focusActiveColumn();
        }
        // focus input control every time popup is closed
        if (!isOpen && this._inputElement) {
            this._inputElement.nativeElement.focus();
        }
    }
    /** @hidden */
    _focusOut(event) {
        if (!this._elementRef.nativeElement.contains(event.relatedTarget)) {
            this.onTouched();
        }
    }
    /** @hidden */
    _calculateTimeOptions() {
        const format = this.getDisplayFormat();
        // default meridian option based on format option
        this._meridian =
            this.meridian != null ? this.meridian : this._dateTimeAdapter.isTimeFormatIncludesDayPeriod(format);
        // default seconds option based on format option
        this._displaySeconds =
            this.displaySeconds != null
                ? this.displaySeconds
                : this._dateTimeAdapter.isTimeFormatIncludesSeconds(format);
        // default minutes option based on format option
        this._displayMinutes =
            this.displayMinutes != null
                ? this.displayMinutes
                : this._dateTimeAdapter.isTimeFormatIncludesMinutes(format);
        // default hours option based on format option
        this._displayHours =
            this.displayHours != null ? this.displayHours : this._dateTimeAdapter.isTimeFormatIncludesHours(format);
    }
    /** @hidden */
    initialiseVariablesInMessageService() {
        this._popoverFormMessage.init(this._inputGroupElement);
        this._popoverFormMessage.message = this._formMessageTemplate;
        this._popoverFormMessage.triggers = this._messageTriggers;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: TimePickerComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i1.DatetimeAdapter, optional: true }, { token: DATE_TIME_FORMATS, optional: true }, { token: i2.PopoverFormMessageService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: TimePickerComponent, isStandalone: true, selector: "fd-time-picker", inputs: { time: { classPropertyName: "time", publicName: "time", isSignal: false, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: false, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: false, isRequired: false, transformFunction: null }, spinnerButtons: { classPropertyName: "spinnerButtons", publicName: "spinnerButtons", isSignal: false, isRequired: false, transformFunction: null }, meridian: { classPropertyName: "meridian", publicName: "meridian", isSignal: false, isRequired: false, transformFunction: null }, displaySeconds: { classPropertyName: "displaySeconds", publicName: "displaySeconds", isSignal: false, isRequired: false, transformFunction: null }, displayMinutes: { classPropertyName: "displayMinutes", publicName: "displayMinutes", isSignal: false, isRequired: false, transformFunction: null }, displayHours: { classPropertyName: "displayHours", publicName: "displayHours", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, timePickerInputLabel: { classPropertyName: "timePickerInputLabel", publicName: "timePickerInputLabel", isSignal: false, isRequired: false, transformFunction: null }, timePickerButtonLabel: { classPropertyName: "timePickerButtonLabel", publicName: "timePickerButtonLabel", isSignal: false, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "ariaLabelledBy", isSignal: false, isRequired: false, transformFunction: null }, allowNull: { classPropertyName: "allowNull", publicName: "allowNull", isSignal: false, isRequired: false, transformFunction: null }, tablet: { classPropertyName: "tablet", publicName: "tablet", isSignal: false, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: false, isRequired: false, transformFunction: null }, messageType: { classPropertyName: "messageType", publicName: "messageType", isSignal: false, isRequired: false, transformFunction: null }, messageTriggers: { classPropertyName: "messageTriggers", publicName: "messageTriggers", isSignal: false, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: false, isRequired: false, transformFunction: null }, useValidation: { classPropertyName: "useValidation", publicName: "useValidation", isSignal: false, isRequired: false, transformFunction: null }, state: { classPropertyName: "state", publicName: "state", isSignal: false, isRequired: false, transformFunction: null }, buttonFocusable: { classPropertyName: "buttonFocusable", publicName: "buttonFocusable", isSignal: false, isRequired: false, transformFunction: null }, keepTwoDigitsTime: { classPropertyName: "keepTwoDigitsTime", publicName: "keepTwoDigitsTime", isSignal: false, isRequired: false, transformFunction: null }, displayFormat: { classPropertyName: "displayFormat", publicName: "displayFormat", isSignal: false, isRequired: false, transformFunction: null }, parseFormat: { classPropertyName: "parseFormat", publicName: "parseFormat", isSignal: false, isRequired: false, transformFunction: null }, minuteStep: { classPropertyName: "minuteStep", publicName: "minuteStep", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isOpenChange: "isOpenChange" }, host: { listeners: { "focusout": "_focusOut($event)", "blur": "onTouched()" }, classAttribute: "fd-time-picker fd-timepicker-custom" }, providers: [
            {
                provide: NG_VALUE_ACCESSOR,
                useExisting: forwardRef(() => TimePickerComponent),
                multi: true
            },
            {
                provide: NG_VALIDATORS,
                useExisting: forwardRef(() => TimePickerComponent),
                multi: true
            },
            PopoverFormMessageService,
            PopoverService,
            registerFormItemControl(TimePickerComponent)
        ], viewQueries: [{ propertyName: "child", first: true, predicate: TimeComponent, descendants: true }, { propertyName: "_inputGroupElement", first: true, predicate: ["inputGroupComponent"], descendants: true, read: ElementRef }, { propertyName: "_inputElement", first: true, predicate: InputGroupInputDirective, descendants: true, read: ElementRef }, { propertyName: "_formMessageTemplate", first: true, predicate: ["formMessageTemplate"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<fd-popover\n    [(isOpen)]=\"isOpen\"\n    (isOpenChange)=\"_onOpenStateChanged($event)\"\n    [triggers]=\"[]\"\n    [disabled]=\"disabled\"\n    [placement]=\"placement\"\n    [closeOnEscapeKey]=\"true\"\n    [focusAutoCapture]=\"false\"\n    [focusTrapped]=\"true\"\n>\n    <fd-popover-control>\n        <fd-input-group\n            #inputGroupComponent\n            (addOnButtonClicked)=\"_addOnButtonClicked()\"\n            [button]=\"true\"\n            [state]=\"state\"\n            [disabled]=\"disabled\"\n            [buttonFocusable]=\"buttonFocusable\"\n            [isControl]=\"true\"\n            [isExpanded]=\"isOpen\"\n            [glyphAriaLabel]=\"timePickerButtonLabel || ('coreTimePicker.timePickerButtonLabel' | fdTranslate)()\"\n            glyph=\"fob-watch\"\n        >\n            <input\n                type=\"text\"\n                class=\"fd-input\"\n                fd-input-group-input\n                [value]=\"_inputTimeValue | translateDayPeriod\"\n                (focusout)=\"_timeInputChanged($any($event.currentTarget).value)\"\n                (keyup.enter)=\"_timeInputChanged($any($event.currentTarget).value)\"\n                [disabled]=\"disabled\"\n                [attr.id]=\"inputId\"\n                [placeholder]=\"_placeholder\"\n                [attr.aria-labelledby]=\"ariaLabelledBy\"\n                [attr.aria-label]=\"timePickerInputLabel || ('coreTimePicker.timePickerInputLabel' | fdTranslate)()\"\n                [attr.aria-describedby]=\"_formValueStateMessageId\"\n                [attr.aria-required]=\"required\"\n            />\n        </fd-input-group>\n    </fd-popover-control>\n    <fd-popover-body>\n        <ng-template [ngTemplateOutlet]=\"formMessageTemplate\"></ng-template>\n        <ng-content></ng-content>\n        @if (isOpen) {\n            <fd-time\n                [tablet]=\"tablet\"\n                [disabled]=\"disabled\"\n                [keepTwoDigits]=\"keepTwoDigitsTime\"\n                [ngModel]=\"time\"\n                (ngModelChange)=\"_timeComponentValueChanged($event)\"\n                [meridian]=\"_meridian\"\n                [displayHours]=\"_displayHours\"\n                [displayMinutes]=\"_displayMinutes\"\n                [displaySeconds]=\"_displaySeconds\"\n                [minuteStep]=\"minuteStep()\"\n                [spinnerButtons]=\"spinnerButtons\"\n            ></fd-time>\n        }\n    </fd-popover-body>\n</fd-popover>\n<div [style.display]=\"'none'\" aria-hidden=\"true\">\n    <div [attr.id]=\"_formValueStateMessageId\" aria-atomic=\"true\" aria-live=\"assertive\">\n        @switch (state) {\n            @case ('success') {\n                {{ ('coreTimePicker.valueStateSuccessMessage' | fdTranslate)() }}\n            }\n            @case ('information') {\n                {{ ('coreTimePicker.valueStateInformationMessage' | fdTranslate)() }}\n            }\n            @case ('warning') {\n                {{ ('coreTimePicker.valueStateWarningMessage' | fdTranslate)() }}\n            }\n            @case ('error') {\n                {{ ('coreTimePicker.valueStateErrorMessage' | fdTranslate)() }}\n            }\n        }\n        {{ _message }}\n    </div>\n</div>\n<ng-template #formMessageTemplate>\n    @if (_message) {\n        <fd-form-message [embedded]=\"true\" [type]=\"state\">\n            {{ _message }}\n        </fd-form-message>\n    }\n</ng-template>\n", styles: [".fd-timepicker-custom{display:inline-block}.fd-timepicker-custom fd-popover{display:block}.fd-timepicker-custom fd-time{width:auto}\n"], dependencies: [{ kind: "component", type: PopoverComponent, selector: "fd-popover", inputs: ["config", "title", "trigger", "id", "mobile", "mobileConfig", "preventSpaceKeyScroll", "placement", "maxWidth", "fillControlMode", "closeOnOutsideClick", "closeOnEscapeKey", "disabled", "triggers", "focusTrapped", "focusAutoCapture", "restoreFocusOnClose", "noArrow", "disableScrollbar", "appendTo", "placementContainer", "scrollStrategy", "cdkPositions", "applyOverlay", "additionalBodyClass", "additionalTriggerClass", "closeOnNavigation", "fixedPosition", "resizable", "bodyAriaLabel", "bodyRole", "bodyAriaLabelledBy", "isOpen"], outputs: ["triggerChange", "isOpenChange", "beforeOpen"] }, { kind: "component", type: PopoverControlComponent, selector: "fd-popover-control, [fdPopoverControl]" }, { kind: "component", type: InputGroupComponent, selector: "fd-input-group", inputs: ["placement", "required", "inline", "addOnText", "buttonFocusable", "type", "glyph", "glyphFont", "button", "isControl", "showFocus", "isExpanded", "glyphAriaLabel", "addonButtonAriaHidden", "iconTitle", "ariaLabelledBy", "ariaLabel"], outputs: ["addOnButtonClicked", "search"] }, { kind: "directive", type: InputGroupInputDirective, selector: "[fdInputGroupInput], [fd-input-group-input]", inputs: ["class"] }, { kind: "component", type: PopoverBodyComponent, selector: "fd-popover-body", inputs: ["minWidth", "maxWidth", "minHeight", "maxHeight"], outputs: ["onClose"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: FormMessageComponent, selector: "fd-form-message", inputs: ["type", "static", "embedded", "class"] }, { kind: "component", type: TimeComponent, selector: "fd-time", inputs: ["meridian", "validate", "keepTwoDigits", "disabled", "displaySeconds", "displayMinutes", "displayHours", "tablet", "elementsAtOnce", "time", "spinnerButtons", "minuteStep"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: FdTranslatePipe, name: "fdTranslate" }, { kind: "pipe", type: TranslateDayPeriodPipe, name: "translateDayPeriod" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: TimePickerComponent, decorators: [{
            type: Component,
            args: [{ selector: 'fd-time-picker', host: {
                        '(focusout)': '_focusOut($event)',
                        '(blur)': 'onTouched()',
                        class: 'fd-time-picker fd-timepicker-custom'
                    }, providers: [
                        {
                            provide: NG_VALUE_ACCESSOR,
                            useExisting: forwardRef(() => TimePickerComponent),
                            multi: true
                        },
                        {
                            provide: NG_VALIDATORS,
                            useExisting: forwardRef(() => TimePickerComponent),
                            multi: true
                        },
                        PopoverFormMessageService,
                        PopoverService,
                        registerFormItemControl(TimePickerComponent)
                    ], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
                        PopoverComponent,
                        PopoverControlComponent,
                        InputGroupComponent,
                        InputGroupInputDirective,
                        PopoverBodyComponent,
                        NgTemplateOutlet,
                        FormMessageComponent,
                        TimeComponent,
                        FormsModule,
                        FdTranslatePipe,
                        TranslateDayPeriodPipe
                    ], template: "<fd-popover\n    [(isOpen)]=\"isOpen\"\n    (isOpenChange)=\"_onOpenStateChanged($event)\"\n    [triggers]=\"[]\"\n    [disabled]=\"disabled\"\n    [placement]=\"placement\"\n    [closeOnEscapeKey]=\"true\"\n    [focusAutoCapture]=\"false\"\n    [focusTrapped]=\"true\"\n>\n    <fd-popover-control>\n        <fd-input-group\n            #inputGroupComponent\n            (addOnButtonClicked)=\"_addOnButtonClicked()\"\n            [button]=\"true\"\n            [state]=\"state\"\n            [disabled]=\"disabled\"\n            [buttonFocusable]=\"buttonFocusable\"\n            [isControl]=\"true\"\n            [isExpanded]=\"isOpen\"\n            [glyphAriaLabel]=\"timePickerButtonLabel || ('coreTimePicker.timePickerButtonLabel' | fdTranslate)()\"\n            glyph=\"fob-watch\"\n        >\n            <input\n                type=\"text\"\n                class=\"fd-input\"\n                fd-input-group-input\n                [value]=\"_inputTimeValue | translateDayPeriod\"\n                (focusout)=\"_timeInputChanged($any($event.currentTarget).value)\"\n                (keyup.enter)=\"_timeInputChanged($any($event.currentTarget).value)\"\n                [disabled]=\"disabled\"\n                [attr.id]=\"inputId\"\n                [placeholder]=\"_placeholder\"\n                [attr.aria-labelledby]=\"ariaLabelledBy\"\n                [attr.aria-label]=\"timePickerInputLabel || ('coreTimePicker.timePickerInputLabel' | fdTranslate)()\"\n                [attr.aria-describedby]=\"_formValueStateMessageId\"\n                [attr.aria-required]=\"required\"\n            />\n        </fd-input-group>\n    </fd-popover-control>\n    <fd-popover-body>\n        <ng-template [ngTemplateOutlet]=\"formMessageTemplate\"></ng-template>\n        <ng-content></ng-content>\n        @if (isOpen) {\n            <fd-time\n                [tablet]=\"tablet\"\n                [disabled]=\"disabled\"\n                [keepTwoDigits]=\"keepTwoDigitsTime\"\n                [ngModel]=\"time\"\n                (ngModelChange)=\"_timeComponentValueChanged($event)\"\n                [meridian]=\"_meridian\"\n                [displayHours]=\"_displayHours\"\n                [displayMinutes]=\"_displayMinutes\"\n                [displaySeconds]=\"_displaySeconds\"\n                [minuteStep]=\"minuteStep()\"\n                [spinnerButtons]=\"spinnerButtons\"\n            ></fd-time>\n        }\n    </fd-popover-body>\n</fd-popover>\n<div [style.display]=\"'none'\" aria-hidden=\"true\">\n    <div [attr.id]=\"_formValueStateMessageId\" aria-atomic=\"true\" aria-live=\"assertive\">\n        @switch (state) {\n            @case ('success') {\n                {{ ('coreTimePicker.valueStateSuccessMessage' | fdTranslate)() }}\n            }\n            @case ('information') {\n                {{ ('coreTimePicker.valueStateInformationMessage' | fdTranslate)() }}\n            }\n            @case ('warning') {\n                {{ ('coreTimePicker.valueStateWarningMessage' | fdTranslate)() }}\n            }\n            @case ('error') {\n                {{ ('coreTimePicker.valueStateErrorMessage' | fdTranslate)() }}\n            }\n        }\n        {{ _message }}\n    </div>\n</div>\n<ng-template #formMessageTemplate>\n    @if (_message) {\n        <fd-form-message [embedded]=\"true\" [type]=\"state\">\n            {{ _message }}\n        </fd-form-message>\n    }\n</ng-template>\n", styles: [".fd-timepicker-custom{display:inline-block}.fd-timepicker-custom fd-popover{display:block}.fd-timepicker-custom fd-time{width:auto}\n"] }]
        }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i1.DatetimeAdapter, decorators: [{
                    type: Optional
                }] }, { type: undefined, decorators: [{
                    type: Optional
                }, {
                    type: Inject,
                    args: [DATE_TIME_FORMATS]
                }] }, { type: i2.PopoverFormMessageService }], propDecorators: { time: [{
                type: Input
            }], inputId: [{
                type: Input
            }], disabled: [{
                type: Input
            }], required: [{
                type: Input
            }], spinnerButtons: [{
                type: Input
            }], meridian: [{
                type: Input
            }], displaySeconds: [{
                type: Input
            }], displayMinutes: [{
                type: Input
            }], displayHours: [{
                type: Input
            }], placeholder: [{
                type: Input
            }], timePickerInputLabel: [{
                type: Input
            }], timePickerButtonLabel: [{
                type: Input
            }], ariaLabelledBy: [{
                type: Input
            }], allowNull: [{
                type: Input
            }], tablet: [{
                type: Input
            }], message: [{
                type: Input
            }], messageType: [{
                type: Input
            }], messageTriggers: [{
                type: Input
            }], placement: [{
                type: Input
            }], useValidation: [{
                type: Input
            }], state: [{
                type: Input
            }], buttonFocusable: [{
                type: Input
            }], keepTwoDigitsTime: [{
                type: Input
            }], displayFormat: [{
                type: Input
            }], parseFormat: [{
                type: Input
            }], isOpenChange: [{
                type: Output
            }], child: [{
                type: ViewChild,
                args: [TimeComponent]
            }], _inputGroupElement: [{
                type: ViewChild,
                args: ['inputGroupComponent', { read: ElementRef }]
            }], _inputElement: [{
                type: ViewChild,
                args: [InputGroupInputDirective, { read: ElementRef }]
            }], _formMessageTemplate: [{
                type: ViewChild,
                args: ['formMessageTemplate']
            }], minuteStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "minuteStep", required: false }] }] } });

/**
 * @deprecated
 * Use direct import of `TimePickerComponent`
 */
class TimePickerModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: TimePickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.1.0", ngImport: i0, type: TimePickerModule, imports: [TimePickerComponent], exports: [TimePickerComponent] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: TimePickerModule, imports: [TimePickerComponent] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: TimePickerModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [TimePickerComponent],
                    exports: [TimePickerComponent]
                }]
        }] });

/**
 * Generated bundle index. Do not edit.
 */

export { TimePickerComponent, TimePickerModule };
//# sourceMappingURL=fundamental-ngx-core-time-picker.mjs.map
