import * as _dayflow_blossom_color_picker_angular from '@dayflow/blossom-color-picker-angular';
import { ColorInput, BlossomColorPickerValue, SliderPosition, BlossomColorPickerColor } from '@dayflow/blossom-color-picker-angular';
import * as _angular_core from '@angular/core';
import { Signal, OnInit, ElementRef, TemplateRef } from '@angular/core';
import { ControlValueAccessor } from '@angular/forms';
import { ZPopoverControl } from '@shival99/z-ui/components/z-popover';
import { ZSelectOption } from '@shival99/z-ui/components/z-select';
import { ZEvent } from '@shival99/z-ui/utils';
import { ClassValue } from 'clsx';
import { Observable } from 'rxjs';
import * as class_variance_authority_types from 'class-variance-authority/types';
import { VariantProps } from 'class-variance-authority';

interface ZInputControl {
    /** Trigger validation and return true if valid */
    valid: () => boolean;
    /**
     * Trigger validation and return true if has error.
     * @deprecated Use `valid()` for boolean form-submit checks.
     */
    validate: () => boolean;
    /** Reset component to initial state */
    reset: () => void;
    /** Focus the input element */
    focus: () => void;
    /** Blur the input element */
    blur: () => void;
    /** Set value programmatically */
    setValue: (value: string | number | null) => void;
    /** Set custom error message (useful for server-side validation). Pass null to clear. */
    setErrorMessage: (message: string | null) => void;
    /** Signal indicating if component has validation error */
    hasError: Signal<boolean>;
    /** Signal indicating if async validation is in progress */
    isValidating: Signal<boolean>;
    /** Signal with current value */
    value: Signal<string | number | null>;
    /** Signal with current error message */
    errorMessage: Signal<string>;
}
interface ZInputValidator {
    error: string;
    message: string;
    pattern?: RegExp;
    min?: number;
    max?: number;
    validate?: (value: string | number | null) => boolean;
}
interface ZAsyncValidator {
    error: string;
    message: string;
    validate: (value: string | number | null) => Promise<boolean> | Observable<boolean>;
}
type ZInputType = 'text' | 'number' | 'password' | 'email' | 'tel' | 'url' | 'color' | 'textarea';
type ZInputSize = 'sm' | 'default' | 'lg';
type ZInputAlign = 'left' | 'center' | 'right';
type ZAsyncValidateOn = 'change' | 'blur';
type ZInputStatus = 'default' | 'disabled' | 'readonly' | 'error';
type ZInputColorFormat = 'hex' | 'rgb' | 'hsl' | 'hsv';
interface ZInputTypeConfig {
    isPassword: boolean;
    isColor: boolean;
    isTextarea: boolean;
    isNumber: boolean;
}
interface ZInputSlotConfig {
    isPrefixTemplate: boolean;
    isSuffixTemplate: boolean;
    hasPrefix: boolean;
    hasSuffix: boolean;
}
interface ZInputMaskConfig {
    effectiveMask: string;
    effectiveType: ZInputType;
    effectiveDecimalMarker: '.' | ',' | ['.', ','];
}
interface ZInputColorConfig {
    mode?: 'blossom' | 'picker';
    cacheKey?: string;
    count?: number | null;
    colors?: ColorInput[];
    savedColors?: string[];
    defaultValue?: BlossomColorPickerValue;
    openOnHover?: boolean;
    initialExpanded?: boolean;
    animationDuration?: number;
    showAlphaSlider?: boolean;
    showCoreColor?: boolean;
    adaptivePositioning?: boolean;
    sliderPosition?: SliderPosition;
    coreSize?: number;
    petalSize?: number;
}

declare class ZInputComponent implements OnInit, ControlValueAccessor {
    private readonly _injector;
    private readonly _destroyRef;
    private readonly _toastService;
    private readonly _zTranslate;
    protected readonly inputRef: _angular_core.Signal<ElementRef<HTMLInputElement> | undefined>;
    protected readonly nativeColorInputRef: _angular_core.Signal<ElementRef<HTMLInputElement> | undefined>;
    readonly zOnSearch: _angular_core.OutputEmitterRef<string | number | null>;
    readonly zOnChange: _angular_core.OutputEmitterRef<string | number | null>;
    readonly zOnBlur: _angular_core.OutputEmitterRef<FocusEvent>;
    readonly zOnFocus: _angular_core.OutputEmitterRef<FocusEvent>;
    readonly zOnKeydown: _angular_core.OutputEmitterRef<KeyboardEvent>;
    readonly zOnEnter: _angular_core.OutputEmitterRef<string | number | null>;
    readonly zOnColorCollapse: _angular_core.OutputEmitterRef<BlossomColorPickerColor>;
    readonly zControl: _angular_core.OutputEmitterRef<ZInputControl>;
    readonly zEvent: _angular_core.OutputEmitterRef<ZEvent>;
    readonly class: _angular_core.InputSignal<ClassValue>;
    readonly zType: _angular_core.InputSignal<ZInputType>;
    readonly zSize: _angular_core.InputSignal<ZInputSize>;
    readonly zAlign: _angular_core.InputSignal<ZInputAlign>;
    readonly zLabel: _angular_core.InputSignal<string>;
    readonly zLabelClass: _angular_core.InputSignal<string>;
    readonly zPlaceholder: _angular_core.InputSignal<string>;
    readonly zRequired: _angular_core.InputSignalWithTransform<boolean, string | boolean>;
    readonly zDisabled: _angular_core.InputSignalWithTransform<boolean, string | boolean>;
    readonly zReadonly: _angular_core.InputSignalWithTransform<boolean, string | boolean>;
    readonly zPrefix: _angular_core.InputSignal<string | TemplateRef<unknown>>;
    readonly zSuffix: _angular_core.InputSignal<string | TemplateRef<unknown>>;
    readonly zMin: _angular_core.InputSignal<number | undefined>;
    readonly zMax: _angular_core.InputSignal<number | undefined>;
    readonly zStep: _angular_core.InputSignal<number>;
    readonly zShowArrows: _angular_core.InputSignalWithTransform<boolean, string | boolean>;
    readonly zMask: _angular_core.InputSignal<string>;
    readonly zDecimalPlaces: _angular_core.InputSignal<number | undefined>;
    readonly zAllowNegative: _angular_core.InputSignalWithTransform<boolean, string | boolean>;
    readonly zThousandSeparator: _angular_core.InputSignal<string>;
    readonly zDecimalMarker: _angular_core.InputSignal<"." | "," | [".", ","]>;
    readonly zValidators: _angular_core.InputSignal<ZInputValidator[]>;
    readonly zAsyncValidators: _angular_core.InputSignal<ZAsyncValidator[]>;
    readonly zAsyncDebounce: _angular_core.InputSignal<number>;
    readonly zAsyncValidateOn: _angular_core.InputSignal<ZAsyncValidateOn>;
    readonly zShowPasswordToggle: _angular_core.InputSignalWithTransform<boolean, string | boolean>;
    readonly zSearch: _angular_core.InputSignalWithTransform<boolean, string | boolean>;
    readonly zDebounce: _angular_core.InputSignal<number>;
    readonly zAutofocus: _angular_core.InputSignalWithTransform<boolean, string | boolean>;
    readonly zAutoComplete: _angular_core.InputSignal<string>;
    readonly zAllowClear: _angular_core.InputSignalWithTransform<boolean, string | boolean>;
    readonly zAutoSizeContent: _angular_core.InputSignalWithTransform<boolean, string | boolean>;
    readonly zRows: _angular_core.InputSignal<number>;
    readonly zResize: _angular_core.InputSignalWithTransform<boolean, string | boolean>;
    readonly zMaxLength: _angular_core.InputSignal<number | undefined>;
    readonly zAutoSuggest: _angular_core.InputSignal<string | undefined>;
    readonly zColorConfig: _angular_core.InputSignal<ZInputColorConfig>;
    private readonly _value;
    private readonly _disabled;
    private readonly _formControl;
    private readonly _formStateVersion;
    private readonly _isNgModel;
    private readonly _asyncErrors;
    private readonly _customError;
    private readonly _blossomColor;
    private readonly _colorPickerHsv;
    private readonly _colorPickerRgb;
    private readonly _colorPickerHsl;
    private readonly _colorPickerAlpha;
    private readonly _colorPickerFormat;
    private readonly _colorPickerSavedColors;
    protected readonly inputId: string;
    protected readonly suggestHistory: _angular_core.WritableSignal<string[]>;
    protected readonly suggestActiveIndex: _angular_core.WritableSignal<number>;
    protected readonly isValidating: _angular_core.WritableSignal<boolean>;
    protected readonly uiState: _angular_core.WritableSignal<{
        passwordVisible: boolean;
        isFocused: boolean;
        touched: boolean;
        dirty: boolean;
        showSuggestPopover: boolean;
        colorCopied: boolean;
    }>;
    protected readonly typeConfig: _angular_core.Signal<ZInputTypeConfig>;
    protected readonly slotConfig: _angular_core.Signal<ZInputSlotConfig>;
    protected readonly maskConfig: _angular_core.Signal<ZInputMaskConfig>;
    protected readonly displayValue: _angular_core.Signal<string>;
    protected readonly normalizedColorValue: _angular_core.Signal<string>;
    protected readonly colorMode: _angular_core.Signal<"blossom" | "picker">;
    protected readonly isBlossomColorMode: _angular_core.Signal<boolean>;
    protected readonly blossomCoreBorderColor: _angular_core.Signal<string>;
    protected readonly blossomColor: _angular_core.Signal<BlossomColorPickerValue>;
    protected readonly colorPickerHsv: _angular_core.Signal<{
        hue: number;
        saturation: number;
        value: number;
    }>;
    protected readonly colorPickerRgbValue: _angular_core.Signal<{
        red: number;
        green: number;
        blue: number;
    }>;
    protected readonly colorPickerHslValue: _angular_core.Signal<{
        hue: number;
        saturation: number;
        lightness: number;
    }>;
    protected readonly colorPickerAlpha: _angular_core.Signal<number>;
    protected readonly colorPickerFormat: _angular_core.Signal<ZInputColorFormat>;
    protected readonly colorPickerFormatOptions: ZSelectOption<ZInputColorFormat>[];
    protected readonly colorPickerHueColor: _angular_core.Signal<string>;
    protected readonly colorPickerSvStyle: _angular_core.Signal<{
        background: string;
    }>;
    protected readonly colorPickerCursorStyle: _angular_core.Signal<{
        left: string;
        top: string;
    }>;
    protected readonly defaultColorPickerSavedColors: _angular_core.Signal<string[]>;
    protected readonly colorPickerSavedColors: _angular_core.Signal<string[]>;
    protected readonly colorPickerSavedSwatches: _angular_core.Signal<{
        color: string;
        isLight: boolean;
    }[]>;
    protected readonly blossomCoreSize: _angular_core.Signal<22 | 30 | 26>;
    protected readonly blossomOptions: _angular_core.Signal<{
        defaultValue: BlossomColorPickerValue | undefined;
        openOnHover: boolean;
        initialExpanded: boolean;
        animationDuration: number;
        showAlphaSlider: boolean;
        showCoreColor: boolean;
        adaptivePositioning: boolean;
        sliderPosition: _dayflow_blossom_color_picker_angular.SliderPosition;
        coreSize: number;
        petalSize: number;
    }>;
    protected readonly blossomColors: _angular_core.Signal<ColorInput[] | undefined>;
    protected readonly hasValue: _angular_core.Signal<boolean>;
    protected readonly isDisabled: _angular_core.Signal<boolean>;
    protected readonly showArrows: _angular_core.Signal<boolean>;
    protected readonly hasAutoSuggest: _angular_core.Signal<boolean>;
    protected readonly showClearButton: _angular_core.Signal<boolean>;
    protected readonly currentStatus: _angular_core.Signal<ZInputStatus>;
    protected readonly alignClass: _angular_core.Signal<"" | "[&_.z-input-native]:text-center" | "[&_.z-input-native]:text-right">;
    protected readonly inputClasses: _angular_core.Signal<string>;
    protected readonly textareaClasses: _angular_core.Signal<string>;
    protected readonly filteredSuggestHistory: _angular_core.Signal<string[]>;
    private readonly _shouldShowValidation;
    protected readonly hasError: _angular_core.Signal<boolean>;
    protected readonly errorMessage: _angular_core.Signal<string>;
    private _translateValidationMessage;
    private readonly _searchSubject;
    private readonly _changeSubject;
    private readonly _asyncValidationSubject;
    private readonly _asyncCancelSubject;
    private _asyncValidationAbortController;
    private _onChange;
    private _onTouched;
    private _ngControl;
    private _colorPickerPopoverControl;
    ngOnInit(): void;
    writeValue(value: string | number | null): void;
    registerOnChange(fn: (value: string | number | null) => void): void;
    registerOnTouched(fn: () => void): void;
    setDisabledState(isDisabled: boolean): void;
    focus(): void;
    blur(): void;
    /** @deprecated Use `valid()` for boolean form-submit checks. */
    validate(): boolean;
    valid(): boolean;
    reset(): void;
    setValue(value: string | number | null): void;
    setErrorMessage(message: string | null): void;
    getValue(): string | number | null;
    saveToSuggestHistory(value: string): void;
    protected clearValue(event: MouseEvent): void;
    protected onInput(event: Event): void;
    protected onModelChange(rawValue: string | number | null): void;
    protected onBlur(event: FocusEvent): void;
    protected onFocus(event: FocusEvent): void;
    protected onKeydown(event: KeyboardEvent): void;
    protected onSuggestKeydown(event: KeyboardEvent): void;
    protected selectSuggestItem(item: string): void;
    protected closeSuggestPopover(): void;
    protected onArrowClick(event: MouseEvent, direction: 'up' | 'down'): void;
    protected togglePasswordVisibility(): void;
    protected copyColorToClipboard(): void;
    protected onBlossomColorChange(color: BlossomColorPickerColor): void;
    protected onBlossomColorCollapse(color: BlossomColorPickerColor): void;
    protected onColorPickerControl(control: ZPopoverControl): void;
    protected onColorPickerOpen(): void;
    protected onColorPickerFormatChange(value: ZInputColorFormat | ZInputColorFormat[] | null): void;
    protected onColorPickerHexChange(value: string | number | null): void;
    protected onColorPickerAlphaValueChange(value: string | number | null): void;
    protected onColorPickerRgbChange(channel: 'red' | 'green' | 'blue', value: string | number | null): void;
    protected onColorPickerHslChange(channel: 'hue' | 'saturation' | 'lightness', value: string | number | null): void;
    protected onColorPickerHsvValueChange(channel: 'hue' | 'saturation' | 'value', value: string | number | null): void;
    protected onColorPickerHueInput(event: Event): void;
    protected onColorPickerAlphaInput(event: Event): void;
    protected onColorPickerSvPointerDown(event: PointerEvent): void;
    protected onColorPickerSvPointerMove(event: PointerEvent): void;
    protected selectSavedColor(color: string): void;
    protected addCurrentColorToSaved(): void;
    protected openNativeColorPicker(): Promise<void>;
    protected closeColorPicker(): void;
    private _emitControl;
    private _runAsyncValidation;
    private _cancelAsyncValidation;
    private _showSuggestPopover;
    private _hideSuggestPopover;
    private _loadSuggestHistory;
    private _colorPickerCacheKey;
    private _loadColorPickerSavedColors;
    private _incrementValue;
    private _cleanNumberValue;
    private _parseNumberValue;
    private _getEffectiveMask;
    private _getEffectiveType;
    private _getEffectiveDecimalMarker;
    private _getValidationErrors;
    private _normalizeHexColor;
    private _tryNormalizeHexColor;
    private _syncBlossomColorFromHex;
    private _syncColorStateFromHex;
    private _syncColorPickerFromHex;
    private _commitColor;
    private _setColorPickerAlpha;
    private _parseBoundedNumber;
    private _normalizeColorList;
    private _isLightHexColor;
    private _getEyeDropper;
    private _updateColorPickerSv;
    private _hexToHsv;
    private _hsvToRgb;
    private _rgbToHex;
    private _rgbToHsl;
    private _hslToHex;
    private _hsvToHex;
    private _generateColorPalette;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<ZInputComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<ZInputComponent, "z-input", ["zInput"], { "class": { "alias": "class"; "required": false; "isSignal": true; }; "zType": { "alias": "zType"; "required": false; "isSignal": true; }; "zSize": { "alias": "zSize"; "required": false; "isSignal": true; }; "zAlign": { "alias": "zAlign"; "required": false; "isSignal": true; }; "zLabel": { "alias": "zLabel"; "required": false; "isSignal": true; }; "zLabelClass": { "alias": "zLabelClass"; "required": false; "isSignal": true; }; "zPlaceholder": { "alias": "zPlaceholder"; "required": false; "isSignal": true; }; "zRequired": { "alias": "zRequired"; "required": false; "isSignal": true; }; "zDisabled": { "alias": "zDisabled"; "required": false; "isSignal": true; }; "zReadonly": { "alias": "zReadonly"; "required": false; "isSignal": true; }; "zPrefix": { "alias": "zPrefix"; "required": false; "isSignal": true; }; "zSuffix": { "alias": "zSuffix"; "required": false; "isSignal": true; }; "zMin": { "alias": "zMin"; "required": false; "isSignal": true; }; "zMax": { "alias": "zMax"; "required": false; "isSignal": true; }; "zStep": { "alias": "zStep"; "required": false; "isSignal": true; }; "zShowArrows": { "alias": "zShowArrows"; "required": false; "isSignal": true; }; "zMask": { "alias": "zMask"; "required": false; "isSignal": true; }; "zDecimalPlaces": { "alias": "zDecimalPlaces"; "required": false; "isSignal": true; }; "zAllowNegative": { "alias": "zAllowNegative"; "required": false; "isSignal": true; }; "zThousandSeparator": { "alias": "zThousandSeparator"; "required": false; "isSignal": true; }; "zDecimalMarker": { "alias": "zDecimalMarker"; "required": false; "isSignal": true; }; "zValidators": { "alias": "zValidators"; "required": false; "isSignal": true; }; "zAsyncValidators": { "alias": "zAsyncValidators"; "required": false; "isSignal": true; }; "zAsyncDebounce": { "alias": "zAsyncDebounce"; "required": false; "isSignal": true; }; "zAsyncValidateOn": { "alias": "zAsyncValidateOn"; "required": false; "isSignal": true; }; "zShowPasswordToggle": { "alias": "zShowPasswordToggle"; "required": false; "isSignal": true; }; "zSearch": { "alias": "zSearch"; "required": false; "isSignal": true; }; "zDebounce": { "alias": "zDebounce"; "required": false; "isSignal": true; }; "zAutofocus": { "alias": "zAutofocus"; "required": false; "isSignal": true; }; "zAutoComplete": { "alias": "zAutoComplete"; "required": false; "isSignal": true; }; "zAllowClear": { "alias": "zAllowClear"; "required": false; "isSignal": true; }; "zAutoSizeContent": { "alias": "zAutoSizeContent"; "required": false; "isSignal": true; }; "zRows": { "alias": "zRows"; "required": false; "isSignal": true; }; "zResize": { "alias": "zResize"; "required": false; "isSignal": true; }; "zMaxLength": { "alias": "zMaxLength"; "required": false; "isSignal": true; }; "zAutoSuggest": { "alias": "zAutoSuggest"; "required": false; "isSignal": true; }; "zColorConfig": { "alias": "zColorConfig"; "required": false; "isSignal": true; }; }, { "zOnSearch": "zOnSearch"; "zOnChange": "zOnChange"; "zOnBlur": "zOnBlur"; "zOnFocus": "zOnFocus"; "zOnKeydown": "zOnKeydown"; "zOnEnter": "zOnEnter"; "zOnColorCollapse": "zOnColorCollapse"; "zControl": "zControl"; "zEvent": "zEvent"; }, never, never, true, never>;
}

declare const zInputVariants: (props?: ({
    zSize?: "sm" | "default" | "lg" | null | undefined;
    zStatus?: "default" | "disabled" | "readonly" | "error" | null | undefined;
} & class_variance_authority_types.ClassProp) | undefined) => string;
type ZInputVariants = VariantProps<typeof zInputVariants>;
declare const zTextareaVariants: (props?: ({
    zStatus?: "default" | "disabled" | "readonly" | "error" | null | undefined;
} & class_variance_authority_types.ClassProp) | undefined) => string;
type ZTextareaVariants = VariantProps<typeof zTextareaVariants>;

export { ZInputComponent, zInputVariants, zTextareaVariants };
export type { ZAsyncValidateOn, ZAsyncValidator, ZInputAlign, ZInputControl, ZInputSize, ZInputType, ZInputValidator, ZInputVariants, ZTextareaVariants };
