import * as i0 from '@angular/core';
import { Injectable, EventEmitter, HostListener, Output, Input, Directive, HostBinding, forwardRef, ViewChild, ChangeDetectionStrategy, ViewEncapsulation, Component, NgModule } from '@angular/core';
import { parserFileSize, KeyUtil } from '@fundamental-ngx/cdk/utils';
import { ENTER, SPACE, TAB } from '@angular/cdk/keycodes';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
import { ButtonComponent } from '@fundamental-ngx/core/button';
import * as i2 from '@fundamental-ngx/core/content-density';
import { contentDensityObserverProviders } from '@fundamental-ngx/core/content-density';
import { registerFormItemControl } from '@fundamental-ngx/core/form';
import { Subscription } from 'rxjs';

class FileUploaderService {
    /**
     * Method that validates files passed. It is based on
     * @param files File[]
     * @param minFileSize string
     * @param maxFileSize string
     * @param acceptedExtensions string
     */
    validateFiles(files, minFileSize, maxFileSize, acceptedExtensions) {
        const maxSize = parserFileSize(maxFileSize);
        const minSize = parserFileSize(minFileSize);
        let allowedExtensions = null;
        if (acceptedExtensions) {
            allowedExtensions = acceptedExtensions.toLocaleLowerCase().replace(/[\s.]/g, '').split(',');
        }
        const fileUploadOutput = {};
        fileUploadOutput.validFiles = files.filter((file) => this._checkSize(file.size, maxSize, minSize) && this._checkExtension(file, allowedExtensions));
        fileUploadOutput.invalidFiles = files.filter((file) => !this._checkSize(file.size, maxSize, minSize) || !this._checkExtension(file, allowedExtensions));
        return fileUploadOutput;
    }
    /** @hidden */
    _checkExtension(file, allowedExtensions) {
        if (!allowedExtensions) {
            return true;
        }
        const extension = file.name.split('.')[file.name.split('.').length - 1].toLocaleLowerCase();
        return allowedExtensions.lastIndexOf(extension) !== -1;
    }
    /** @hidden */
    _checkSize(fileSize, maxSize, minSize) {
        if (maxSize && fileSize > maxSize) {
            return false;
        }
        if (minSize && fileSize < minSize) {
            return false;
        }
        return true;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: FileUploaderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: FileUploaderService, providedIn: 'root' }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: FileUploaderService, decorators: [{
            type: Injectable,
            args: [{ providedIn: 'root' }]
        }] });

/**
 * Directive that handles the drag and drop feature of the file input.
 */
class FileUploaderDragndropDirective {
    /** @hidden */
    constructor(_fileUploadService) {
        this._fileUploadService = _fileUploadService;
        /** Whether multiple files can be dropped at once. */
        this.multiple = true;
        /** Max file size in bytes that the input will accept. */
        this.maxFileSize = '';
        /** Min file size in bytes that the input will accept. */
        this.minFileSize = '';
        /** Whether selecting of new files is disabled. */
        this.disabled = false;
        /** Whether drag and drop is enabled. Disables this directive. */
        this.dragndrop = true;
        /** Event emitted when files are dropped. Passes back an array of files. */
        this.fileChanged = new EventEmitter();
        /** Event emitted when the dragged file enters the dropzone. */
        this.dragEntered = new EventEmitter();
        /** Event emitted when the dragged file exits the dropzone. */
        this.dragLeave = new EventEmitter();
        /** @hidden */
        this.elementStateCounter = 0;
    }
    /** @hidden */
    onDragover(event) {
        if (this.dragndrop) {
            this._muteEvent(event);
        }
    }
    /** @hidden */
    onDragenter() {
        ++this.elementStateCounter;
        if (this.dragndrop && this.elementStateCounter === 1) {
            this.dragEntered.emit();
        }
    }
    /** @hidden */
    onDragleave(event) {
        --this.elementStateCounter;
        if (this.dragndrop && this.elementStateCounter === 0) {
            this._muteEvent(event);
            this.dragLeave.emit();
        }
    }
    /** @hidden */
    onDrop(event) {
        this.elementStateCounter = 0;
        if (!this.dragndrop || this.disabled) {
            return;
        }
        this._muteEvent(event);
        const rawFiles = event.dataTransfer.files;
        const files = Array.from(rawFiles);
        if (!this.multiple && files.length > 1) {
            this.fileChanged.emit({
                validFiles: [],
                invalidFiles: files
            });
            return;
        }
        const fileOutput = this._fileUploadService.validateFiles(files, this.minFileSize, this.maxFileSize, this.accept);
        this.fileChanged.emit(fileOutput);
    }
    /** @hidden */
    _muteEvent(event) {
        event.preventDefault();
        event.stopPropagation();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: FileUploaderDragndropDirective, deps: [{ token: FileUploaderService }], target: i0.ɵɵFactoryTarget.Directive }); }
    static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.0", type: FileUploaderDragndropDirective, isStandalone: true, selector: "[fdFileDragnDrop], [fd-file-drag-n-drop]", inputs: { multiple: "multiple", accept: "accept", maxFileSize: "maxFileSize", minFileSize: "minFileSize", disabled: "disabled", dragndrop: "dragndrop" }, outputs: { fileChanged: "fileChanged", dragEntered: "dragEntered", dragLeave: "dragLeave" }, host: { listeners: { "dragover": "onDragover($event)", "dragenter": "onDragenter()", "dragleave": "onDragleave($event)", "drop": "onDrop($event)" } }, ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: FileUploaderDragndropDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: '[fdFileDragnDrop], [fd-file-drag-n-drop]',
                    standalone: true
                }]
        }], ctorParameters: () => [{ type: FileUploaderService }], propDecorators: { multiple: [{
                type: Input
            }], accept: [{
                type: Input
            }], maxFileSize: [{
                type: Input
            }], minFileSize: [{
                type: Input
            }], disabled: [{
                type: Input
            }], dragndrop: [{
                type: Input
            }], fileChanged: [{
                type: Output
            }], dragEntered: [{
                type: Output
            }], dragLeave: [{
                type: Output
            }], onDragover: [{
                type: HostListener,
                args: ['dragover', ['$event']]
            }], onDragenter: [{
                type: HostListener,
                args: ['dragenter', []]
            }], onDragleave: [{
                type: HostListener,
                args: ['dragleave', ['$event']]
            }], onDrop: [{
                type: HostListener,
                args: ['drop', ['$event']]
            }] } });

/**
 * Directive tool to facilitate interacting with a native file input element.
 */
class FileUploaderSelectDirective {
    constructor() {
        /** Whether the input should accept multiple file selections. */
        this.multiple = true;
        /** Event emitted when files are selected. */
        this.fileSelected = new EventEmitter();
    }
    /** @hidden */
    get multipleBinding() {
        return this.multiple ? true : undefined;
    }
    /** @hidden */
    onChange(event) {
        if (event.target instanceof HTMLInputElement) {
            const elRef = event.target;
            const files = elRef.files;
            if (files?.length) {
                const fileArray = Array.from(files);
                this.fileSelected.emit(fileArray);
            }
        }
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: FileUploaderSelectDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
    static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.0", type: FileUploaderSelectDirective, isStandalone: true, selector: "[fdFileSelect]", inputs: { multiple: "multiple" }, outputs: { fileSelected: "fileSelected" }, host: { listeners: { "change": "onChange($event)" }, properties: { "attr.multiple": "this.multipleBinding" } }, ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: FileUploaderSelectDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: '[fdFileSelect]',
                    standalone: true
                }]
        }], propDecorators: { multiple: [{
                type: Input
            }], fileSelected: [{
                type: Output
            }], multipleBinding: [{
                type: HostBinding,
                args: ['attr.multiple']
            }], onChange: [{
                type: HostListener,
                args: ['change', ['$event']]
            }] } });

let fileUploaderInputUniqueId = 0;
/**
 * Tool to facilitate the input of files from the user.
 * It supports drag and drop, multiple input, max file size and more.
 * The drag events make it very easy to create and style elements like a dropzone.
 */
class FileUploaderComponent {
    /** @hidden */
    constructor(_fileUploadService, _changeDetRef, _contentDensityObserver) {
        this._fileUploadService = _fileUploadService;
        this._changeDetRef = _changeDetRef;
        this._contentDensityObserver = _contentDensityObserver;
        /** Whether the file input is disabled. */
        this.disabled = false;
        /** If it is mandatory field */
        this.required = false;
        /** Whether the file input should accept multiple files. */
        this.multiple = true;
        /** Whether the file input accepts drag and dropped files. */
        this.dragndrop = true;
        /** Max file size in bytes that the input will accept. */
        this.maxFileSize = '';
        /** Min file size in bytes that the input will accept. */
        this.minFileSize = '';
        /** Id for the input element. */
        this.id = 'fd-file-uploader-input' + fileUploaderInputUniqueId++;
        /** The field to set state of radio button using:
         * 'success' | 'error' | 'warning' | 'default' | 'information'
         * by default value is set to 'default'
         */
        this.state = 'default';
        /** Whether or not to hide the input, leaving only the upload/browse button. */
        this.inputHidden = false;
        /** Event fired when files are selected. Passed object is the array of files selected. */
        this.selectedFilesChanged = new EventEmitter();
        /** Event fired when some invalid files are selected. Passed object is the array of invalid files. */
        this.selectedInvalidFiles = new EventEmitter();
        /** Event fired when the dragged file enters the component boundaries. */
        this.onDragEnter = new EventEmitter();
        /** Event fired when the dragged file exits the component boundaries. */
        this.onDragLeave = new EventEmitter();
        /** * It stores the valid files  */
        this.validFiles = [];
        /** * It stores the invalid files  */
        this.invalidFiles = [];
        /** @hidden */
        this._subscriptions = new Subscription();
        /** @hidden */
        this.onChange = () => { };
        /** @hidden */
        this.onTouched = () => { };
    }
    /** @hidden */
    ngOnDestroy() {
        this._subscriptions.unsubscribe();
    }
    /** @hidden */
    registerOnChange(fn) {
        this.onChange = fn;
    }
    /** @hidden */
    registerOnTouched(fn) {
        this.onTouched = fn;
    }
    /** @hidden */
    setDisabledState(isDisabled) {
        this.disabled = isDisabled;
        this._changeDetRef.detectChanges();
    }
    /** @hidden */
    writeValue(files) {
        if (this.validFiles.length > 0 && files && files.length === 0) {
            this.clear();
        }
        else if (!files?.length) {
            return;
        }
        else {
            this._propagateFiles(false);
        }
    }
    /** @hidden */
    handleDrop(files) {
        this.validFiles = files.validFiles ?? [];
        this.invalidFiles = files.invalidFiles ?? [];
        this._propagateFiles();
    }
    /** @hidden */
    selectHandler(event) {
        this.validateFiles(event);
        this._propagateFiles();
    }
    /** @hidden */
    validateFiles(event) {
        if (this.fileLimit && event.length > this.fileLimit) {
            throw new Error('FileLimitError - Selected files count is more than specified limit ');
        }
        const fileOutput = this._fileUploadService.validateFiles(event, this.minFileSize, this.maxFileSize, this.accept);
        this.validFiles = fileOutput.validFiles ?? [];
        this.invalidFiles = fileOutput.invalidFiles ?? [];
    }
    /** @hidden */
    setInputValue(selectedFiles, fromClear = false) {
        const fileName = selectedFiles.map((file) => file.name).join(' ');
        if (!this.inputRefText) {
            return;
        }
        this.inputRefText.nativeElement.value = fileName;
        this.inputRefText.nativeElement.title = fileName || this.placeholder;
        this.inputRefText.nativeElement.placeholder = fileName || this.placeholder;
        if (!fromClear) {
            this.inputRefText.nativeElement.focus();
        }
    }
    /** @hidden */
    keyDownHandle(event) {
        if (KeyUtil.isKeyCode(event, [ENTER, SPACE])) {
            this.open();
        }
        if (!KeyUtil.isKeyCode(event, [TAB])) {
            event.preventDefault();
        }
    }
    /**
     * Opens the file selector.
     */
    open() {
        this.inputRef.nativeElement.click();
    }
    /**
     * Clears the files from the input.
     */
    clear() {
        const shouldPropagate = this.validFiles.length > 0 || this.invalidFiles.length > 0;
        this.validFiles = [];
        this.invalidFiles = [];
        this.inputRef.nativeElement.value = '';
        if (shouldPropagate) {
            this._propagateFiles();
        }
    }
    /** @hidden */
    _propagateFiles(handleOnChange = true) {
        this.setInputValue(this.validFiles);
        if (handleOnChange) {
            this.onChange(this.validFiles);
        }
        if (this._previousValidFiles !== this.validFiles) {
            this._previousValidFiles = this.validFiles;
            this.selectedFilesChanged.emit(this.validFiles);
        }
        if (this._previousInvalidFiles !== this.invalidFiles) {
            this._previousInvalidFiles = this.invalidFiles;
            this.selectedInvalidFiles.emit(this.invalidFiles);
        }
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: FileUploaderComponent, deps: [{ token: FileUploaderService }, { token: i0.ChangeDetectorRef }, { token: i2.ContentDensityObserver }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: FileUploaderComponent, isStandalone: true, selector: "fd-file-uploader", inputs: { disabled: "disabled", required: "required", multiple: "multiple", accept: "accept", dragndrop: "dragndrop", maxFileSize: "maxFileSize", minFileSize: "minFileSize", id: "id", ariaLabel: "ariaLabel", ariaLabelledBy: "ariaLabelledBy", placeholder: "placeholder", buttonLabel: "buttonLabel", buttonAriaLabel: "buttonAriaLabel", state: "state", fileLimit: "fileLimit", inputHidden: "inputHidden", width: "width" }, outputs: { selectedFilesChanged: "selectedFilesChanged", selectedInvalidFiles: "selectedInvalidFiles", onDragEnter: "onDragEnter", onDragLeave: "onDragLeave" }, host: { listeners: { "blur": "onTouched()" }, classAttribute: "fd-file-uploader" }, providers: [
            {
                provide: NG_VALUE_ACCESSOR,
                useExisting: forwardRef(() => FileUploaderComponent),
                multi: true
            },
            registerFormItemControl(FileUploaderComponent),
            contentDensityObserverProviders()
        ], viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["fileInput"], descendants: true }, { propertyName: "inputRefText", first: true, predicate: ["textInput"], descendants: true }], ngImport: i0, template: "<div\n    class=\"fd-file-uploader__container\"\n    fdFileDragnDrop\n    [accept]=\"accept\"\n    [maxFileSize]=\"maxFileSize\"\n    [minFileSize]=\"minFileSize\"\n    [dragndrop]=\"dragndrop\"\n    [disabled]=\"disabled\"\n    [multiple]=\"multiple\"\n    (fileChanged)=\"handleDrop($event)\"\n    (dragEntered)=\"onDragEnter.emit()\"\n    (dragLeave)=\"onDragLeave.emit()\"\n>\n    <input\n        #textInput\n        class=\"fd-input fd-file-uploader__input\"\n        [class]=\"state ? ' is-' + state : ''\"\n        aria-live=\"polite\"\n        autocomplete=\"off\"\n        type=\"text\"\n        tabindex=\"0\"\n        [id]=\"id\"\n        [attr.aria-label]=\"ariaLabel\"\n        [attr.aria-labelledby]=\"ariaLabelledBy\"\n        [attr.aria-required]=\"required\"\n        [title]=\"ariaLabel\"\n        [placeholder]=\"placeholder\"\n        [value]=\"\"\n        [style.width]=\"width\"\n        [hidden]=\"inputHidden\"\n        [disabled]=\"disabled\"\n        (click)=\"open()\"\n        (keydown)=\"keyDownHandle($event)\"\n    />\n\n    <button\n        fd-button\n        [attr.aria-label]=\"buttonAriaLabel\"\n        [label]=\"buttonLabel\"\n        [disabled]=\"disabled\"\n        (click)=\"open()\"\n    ></button>\n    <ng-content select=\"[fd-form-control]\"></ng-content>\n</div>\n\n<input\n    #fileInput\n    fdFileSelect\n    class=\"fd-file-uploader__hidden\"\n    type=\"file\"\n    [attr.accept]=\"accept\"\n    [multiple]=\"multiple\"\n    [disabled]=\"disabled\"\n    (fileSelected)=\"selectHandler($event)\"\n/>\n", styles: [".fd-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--sapField_BackgroundStyle,var(--sapField_BackgroundStyle));background-color:var(--sapField_Background,var(--sapField_Background));border:0;border:var(--sapField_BorderWidth) var(--sapField_BorderStyle) var(--sapField_BorderColor);border-radius:var(--sapField_BorderCornerRadius);-webkit-box-shadow:var(--sapField_Shadow);box-shadow:var(--sapField_Shadow);-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);color:var(--sapField_TextColor);cursor:text;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;height:var(--fdInput_Height,var(--sapElement_Height));line-height:normal;margin-block:0;margin-block:var(--fdInput_Field_Margin_Block,.25rem);margin-inline:0;min-height:var(--fdInput_Height,var(--sapElement_Height));min-width:2.75rem;outline:none;overflow:hidden;padding-block:0;padding-inline:0;padding-inline:var(--fdInput_Field_Padding_Inline,.625rem);text-overflow:ellipsis;text-shadow:var(--fdInput_Text_Shadow);white-space:nowrap;width:100%;z-index:1}.fd-input:after,.fd-input:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-input::-webkit-input-placeholder{color:var(--sapField_PlaceholderTextColor);font-style:var(--fdPlaceholder_Font_Style)}.fd-input::-moz-placeholder{color:var(--sapField_PlaceholderTextColor);font-style:var(--fdPlaceholder_Font_Style)}.fd-input:-ms-input-placeholder{color:var(--sapField_PlaceholderTextColor);font-style:var(--fdPlaceholder_Font_Style)}.fd-input::-ms-input-placeholder{color:var(--sapField_PlaceholderTextColor);font-style:var(--fdPlaceholder_Font_Style)}.fd-input::placeholder{color:var(--sapField_PlaceholderTextColor);font-style:var(--fdPlaceholder_Font_Style)}.fd-input[dir=rtl]::-webkit-input-placeholder,[dir=rtl] .fd-input::-webkit-input-placeholder{text-indent:.125rem}.fd-input[dir=rtl]::-moz-placeholder,[dir=rtl] .fd-input::-moz-placeholder{text-indent:.125rem}.fd-input[dir=rtl]:-ms-input-placeholder,[dir=rtl] .fd-input:-ms-input-placeholder{text-indent:.125rem}.fd-input[dir=rtl]::-ms-input-placeholder,[dir=rtl] .fd-input::-ms-input-placeholder{text-indent:.125rem}.fd-input[dir=rtl]::placeholder,[dir=rtl] .fd-input::placeholder{text-indent:.125rem}.fd-input::-moz-selection{background-color:var(--sapSelectedColor);color:var(--sapContent_ContrastTextColor)}.fd-input::selection{background-color:var(--sapSelectedColor);color:var(--sapContent_ContrastTextColor)}.fd-input::-ms-clear{display:none}.fd-input.is-hover,.fd-input:hover{background:var(--sapField_Hover_BackgroundStyle,var(--sapField_Hover_BackgroundStyle));background-color:var(--sapField_Hover_Background,var(--sapField_Hover_Background));border-color:var(--sapField_Hover_BorderColor);-webkit-box-shadow:var(--fdInput_Box_Shadow_Hover);box-shadow:var(--fdInput_Box_Shadow_Hover)}.fd-input.is-focus,.fd-input:focus{background:var(--sapField_Focus_Background,var(--sapField_Focus_Background));-webkit-box-shadow:none;box-shadow:none;outline:var(--fdInput_Outline_Color) var(--sapContent_FocusStyle) var(--sapContent_FocusWidth);outline-offset:var(--fdInput_Outline_Offset);z-index:5}.fd-input[type=search]::-webkit-search-cancel-button,.fd-input[type=search]::-webkit-search-decoration,.fd-input[type=search]::-webkit-search-results-button,.fd-input[type=search]::-webkit-search-results-decoration{-webkit-appearance:none;appearance:none}.fd-input[aria-expanded=false]{z-index:0}.fd-input.is-expanded,.fd-input[aria-expanded=true]{z-index:4}.fd-input[class*=-compact],.fd-input[class*=-condensed],[class*=-compact] .fd-input:not([class*=-cozy]),[class*=-condensed] .fd-input:not([class*=-cozy]){-webkit-box-sizing:border-box;box-sizing:border-box;height:var(--fdInput_Compact_Height,var(--sapElement_Compact_Height));margin-block:var(--fdInput_Field_Compact_Margin_Block,.1875rem);margin-inline:0;min-height:var(--fdInput_Compact_Height,var(--sapElement_Compact_Height));min-width:var(--fdInput_Field_Compact_Min_Width,2rem);padding-block:0;padding-inline:var(--fdInput_Field_Compact_Padding,.5rem)}.fd-input--no-number-spinner{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.fd-input--no-number-spinner::-webkit-inner-spin-button,.fd-input--no-number-spinner::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin-block:0;margin-inline:0}.fd-input.right-align{text-align:right}.fd-input__sr-only{position:absolute;clip:rect(0 0 0 0);border:0;height:1px;margin-block:-1px;margin-inline:-1px;overflow:hidden;padding-block:0;padding-inline:0;white-space:nowrap;width:1px}.fd-input.is-success{background:var(--sapField_SuccessBackgroundStyle);background-color:var(--sapField_SuccessBackground);border:var(--sapField_SuccessColor) var(--sapField_SuccessBorderWidth) var(--sapField_SuccessBorderStyle);-webkit-box-shadow:var(--sapField_SuccessShadow);box-shadow:var(--sapField_SuccessShadow)}.fd-input.is-success.is-hover,.fd-input.is-success:hover{background-color:var(--fdInput_Success_Background_Color_Hover);border-color:var(--sapField_SuccessColor);-webkit-box-shadow:var(--fdInput_Success_Box_Shadow_Hover);box-shadow:var(--fdInput_Success_Box_Shadow_Hover)}.fd-input.is-success.is-focus,.fd-input.is-success:focus{background:var(--sapField_Focus_Background);outline-color:var(--fdInput_Success_Outline_Color);z-index:5}.fd-input.is-success.is-focus.is-hover,.fd-input.is-success.is-focus:hover,.fd-input.is-success:focus.is-hover,.fd-input.is-success:focus:hover{-webkit-box-shadow:none;box-shadow:none}.fd-input.is-success.is-expanded,.fd-input.is-success[aria-expanded=true]{background:var(--sapField_Focus_Background);-webkit-box-shadow:none;box-shadow:none;outline:var(--sapContent_FocusWidth) var(--sapContent_FocusStyle) var(--fdInput_Success_Outline_Color);outline-offset:var(--fdInput_Outline_Offset)}.fd-input.is-error{background:var(--sapField_InvalidBackgroundStyle);background-color:var(--sapField_InvalidBackground);border:var(--sapField_InvalidColor) var(--sapField_InvalidBorderWidth) var(--sapField_InvalidBorderStyle);-webkit-box-shadow:var(--sapField_InvalidShadow);box-shadow:var(--sapField_InvalidShadow)}.fd-input.is-error.is-hover,.fd-input.is-error:hover{background-color:var(--fdInput_Error_Background_Color_Hover);border-color:var(--sapField_InvalidColor);-webkit-box-shadow:var(--fdInput_Error_Box_Shadow_Hover);box-shadow:var(--fdInput_Error_Box_Shadow_Hover)}.fd-input.is-error.is-focus,.fd-input.is-error:focus{background:var(--sapField_Focus_Background);outline-color:var(--fdInput_Error_Outline_Color);z-index:5}.fd-input.is-error.is-focus.is-hover,.fd-input.is-error.is-focus:hover,.fd-input.is-error:focus.is-hover,.fd-input.is-error:focus:hover{-webkit-box-shadow:none;box-shadow:none}.fd-input.is-error.is-expanded,.fd-input.is-error[aria-expanded=true]{background:var(--sapField_Focus_Background);-webkit-box-shadow:none;box-shadow:none;outline:var(--sapContent_FocusWidth) var(--sapContent_FocusStyle) var(--fdInput_Error_Outline_Color);outline-offset:var(--fdInput_Outline_Offset)}.fd-input.is-warning{background:var(--sapField_WarningBackgroundStyle);background-color:var(--sapField_WarningBackground);border:var(--sapField_WarningColor) var(--sapField_WarningBorderWidth) var(--sapField_WarningBorderStyle);-webkit-box-shadow:var(--sapField_WarningShadow);box-shadow:var(--sapField_WarningShadow)}.fd-input.is-warning.is-hover,.fd-input.is-warning:hover{background-color:var(--fdInput_Warning_Background_Color_Hover);border-color:var(--sapField_WarningColor);-webkit-box-shadow:var(--fdInput_Warning_Box_Shadow_Hover);box-shadow:var(--fdInput_Warning_Box_Shadow_Hover)}.fd-input.is-warning.is-focus,.fd-input.is-warning:focus{background:var(--sapField_Focus_Background);outline-color:var(--fdInput_Warning_Outline_Color);z-index:5}.fd-input.is-warning.is-focus.is-hover,.fd-input.is-warning.is-focus:hover,.fd-input.is-warning:focus.is-hover,.fd-input.is-warning:focus:hover{-webkit-box-shadow:none;box-shadow:none}.fd-input.is-warning.is-expanded,.fd-input.is-warning[aria-expanded=true]{background:var(--sapField_Focus_Background);-webkit-box-shadow:none;box-shadow:none;outline:var(--sapContent_FocusWidth) var(--sapContent_FocusStyle) var(--fdInput_Warning_Outline_Color);outline-offset:var(--fdInput_Outline_Offset)}.fd-input.is-alert{background:var(--sapField_WarningBackgroundStyle);background-color:var(--sapField_WarningBackground);border:var(--sapField_WarningColor) var(--sapField_WarningBorderWidth) var(--sapField_WarningBorderStyle)}.fd-input.is-alert.is-hover,.fd-input.is-alert:hover{background-color:var(--fdInput_Warning_Background_Color_Hover);border-color:var(--sapField_WarningColor);-webkit-box-shadow:var(--fdInput_Warning_Box_Shadow_Hover);box-shadow:var(--fdInput_Warning_Box_Shadow_Hover)}.fd-input.is-alert.is-focus,.fd-input.is-alert:focus{background:var(--sapField_Focus_Background);outline-color:var(--fdInput_Warning_Outline_Color);z-index:5}.fd-input.is-alert.is-focus.is-hover,.fd-input.is-alert.is-focus:hover,.fd-input.is-alert:focus.is-hover,.fd-input.is-alert:focus:hover{-webkit-box-shadow:none;box-shadow:none}.fd-input.is-alert.is-expanded,.fd-input.is-alert[aria-expanded=true]{background:var(--sapField_Focus_Background);-webkit-box-shadow:none;box-shadow:none;outline:var(--sapContent_FocusWidth) var(--sapContent_FocusStyle) var(--fdInput_Warning_Outline_Color);outline-offset:var(--fdInput_Outline_Offset)}.fd-input.is-information{background:var(--sapField_InformationBackgroundStyle);background-color:var(--sapField_InformationBackground);border:var(--sapField_InformationColor) var(--sapField_InformationBorderWidth) var(--sapField_InformationBorderStyle);-webkit-box-shadow:var(--sapField_InformationShadow);box-shadow:var(--sapField_InformationShadow)}.fd-input.is-information.is-hover,.fd-input.is-information:hover{background-color:var(--fdInput_Information_Background_Color_Hover);border-color:var(--sapField_InformationColor);-webkit-box-shadow:var(--fdInput_Information_Box_Shadow_Hover);box-shadow:var(--fdInput_Information_Box_Shadow_Hover)}.fd-input.is-information.is-focus,.fd-input.is-information:focus{background:var(--sapField_Focus_Background);outline-color:var(--fdInput_Information_Outline_Color);z-index:5}.fd-input.is-information.is-focus.is-hover,.fd-input.is-information.is-focus:hover,.fd-input.is-information:focus.is-hover,.fd-input.is-information:focus:hover{-webkit-box-shadow:none;box-shadow:none}.fd-input.is-information.is-expanded,.fd-input.is-information[aria-expanded=true]{background:var(--sapField_Focus_Background);-webkit-box-shadow:none;box-shadow:none;outline:var(--sapContent_FocusWidth) var(--sapContent_FocusStyle) var(--fdInput_Information_Outline_Color);outline-offset:var(--fdInput_Outline_Offset)}.fd-input.is-alert,.fd-input.is-error,.fd-input.is-warning{font-style:var(--fdInput_State_Text_Style);font-weight:var(--fdInput_State_Font_Weight)}.fd-input.is-alert::-webkit-input-placeholder,.fd-input.is-error::-webkit-input-placeholder,.fd-input.is-warning::-webkit-input-placeholder{font-weight:var(--fdInput_State_Font_Weight)}.fd-input.is-alert::-moz-placeholder,.fd-input.is-error::-moz-placeholder,.fd-input.is-warning::-moz-placeholder{font-weight:var(--fdInput_State_Font_Weight)}.fd-input.is-alert:-ms-input-placeholder,.fd-input.is-error:-ms-input-placeholder,.fd-input.is-warning:-ms-input-placeholder{font-weight:var(--fdInput_State_Font_Weight)}.fd-input.is-alert::-ms-input-placeholder,.fd-input.is-error::-ms-input-placeholder,.fd-input.is-warning::-ms-input-placeholder{font-weight:var(--fdInput_State_Font_Weight)}.fd-input.is-alert::placeholder,.fd-input.is-error::placeholder,.fd-input.is-warning::placeholder{font-weight:var(--fdInput_State_Font_Weight)}.fd-input.is-alert.is-focus,.fd-input.is-alert:focus,.fd-input.is-error.is-focus,.fd-input.is-error:focus,.fd-input.is-information.is-focus,.fd-input.is-information:focus,.fd-input.is-warning.is-focus,.fd-input.is-warning:focus{outline-offset:var(--fdInput_Outline_Offset_States);z-index:5}.fd-input.is-error::-webkit-input-placeholder{color:var(--sapField_TextColor)}.fd-input.is-error::-moz-placeholder{color:var(--sapField_TextColor)}.fd-input.is-error:-ms-input-placeholder{color:var(--sapField_TextColor)}.fd-input.is-error::-ms-input-placeholder{color:var(--sapField_TextColor)}.fd-input.is-error::placeholder{color:var(--sapField_TextColor)}.fd-input.is-disabled,.fd-input:disabled,.fd-input[aria-disabled=true]{opacity:var(--sapContent_DisabledOpacity);pointer-events:none}.fd-input.is-disabled::-webkit-input-placeholder,.fd-input:disabled::-webkit-input-placeholder,.fd-input[aria-disabled=true]::-webkit-input-placeholder{color:var(--fdInput_Non_Interactive_State_Placeholder_Color);opacity:0}.fd-input.is-disabled::-moz-placeholder,.fd-input:disabled::-moz-placeholder,.fd-input[aria-disabled=true]::-moz-placeholder{color:var(--fdInput_Non_Interactive_State_Placeholder_Color);opacity:0}.fd-input.is-disabled:-ms-input-placeholder,.fd-input:disabled:-ms-input-placeholder,.fd-input[aria-disabled=true]:-ms-input-placeholder{color:var(--fdInput_Non_Interactive_State_Placeholder_Color);opacity:0}.fd-input.is-disabled::-ms-input-placeholder,.fd-input:disabled::-ms-input-placeholder,.fd-input[aria-disabled=true]::-ms-input-placeholder{color:var(--fdInput_Non_Interactive_State_Placeholder_Color);opacity:0}.fd-input.is-disabled::placeholder,.fd-input:disabled::placeholder,.fd-input[aria-disabled=true]::placeholder{color:var(--fdInput_Non_Interactive_State_Placeholder_Color);opacity:0}.fd-input.is-readonly,.fd-input[aria-readonly=true],.fd-input[readonly]{--fdInput_Outline_Offset:-.25rem;background:var(--sapField_ReadOnly_BackgroundStyle);background-color:var(--sapField_ReadOnly_Background);border-color:var(--sapField_ReadOnly_BorderColor);-webkit-box-shadow:none;box-shadow:none}.fd-input.is-readonly::-webkit-input-placeholder,.fd-input[aria-readonly=true]::-webkit-input-placeholder,.fd-input[readonly]::-webkit-input-placeholder{color:var(--fdInput_Non_Interactive_State_Placeholder_Color);opacity:0}.fd-input.is-readonly::-moz-placeholder,.fd-input[aria-readonly=true]::-moz-placeholder,.fd-input[readonly]::-moz-placeholder{color:var(--fdInput_Non_Interactive_State_Placeholder_Color);opacity:0}.fd-input.is-readonly:-ms-input-placeholder,.fd-input[aria-readonly=true]:-ms-input-placeholder,.fd-input[readonly]:-ms-input-placeholder{color:var(--fdInput_Non_Interactive_State_Placeholder_Color);opacity:0}.fd-input.is-readonly::-ms-input-placeholder,.fd-input[aria-readonly=true]::-ms-input-placeholder,.fd-input[readonly]::-ms-input-placeholder{color:var(--fdInput_Non_Interactive_State_Placeholder_Color);opacity:0}.fd-input.is-readonly::placeholder,.fd-input[aria-readonly=true]::placeholder,.fd-input[readonly]::placeholder{color:var(--fdInput_Non_Interactive_State_Placeholder_Color);opacity:0}.fd-input.is-readonly.is-focus,.fd-input.is-readonly.is-hover,.fd-input.is-readonly:focus,.fd-input.is-readonly:hover,.fd-input[aria-readonly=true].is-focus,.fd-input[aria-readonly=true].is-hover,.fd-input[aria-readonly=true]:focus,.fd-input[aria-readonly=true]:hover,.fd-input[readonly].is-focus,.fd-input[readonly].is-hover,.fd-input[readonly]:focus,.fd-input[readonly]:hover{--fdInput_Outline_Offset:-.25rem;background:var(--sapField_ReadOnly_BackgroundStyle);background-color:var(--sapField_ReadOnly_Background);border-color:var(--sapField_ReadOnly_BorderColor);-webkit-box-shadow:none;box-shadow:none}.fd-input.is-readonly.is-focus,.fd-input.is-readonly:focus,.fd-input[aria-readonly=true].is-focus,.fd-input[aria-readonly=true]:focus,.fd-input[readonly].is-focus,.fd-input[readonly]:focus{z-index:5}.fd-file-uploader{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0}.fd-file-uploader:after,.fd-file-uploader:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-file-uploader__container{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);display:-webkit-box;display:-ms-flexbox;display:flex;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:.25rem}.fd-file-uploader__container:after,.fd-file-uploader__container:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-file-uploader .fd-file-uploader__input{-webkit-box-flex:1;background-color:var(--sapField_Background);color:transparent;cursor:pointer;-ms-flex:1;flex:1;text-shadow:0 0 0 var(--sapTextColor);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.fd-file-uploader .fd-file-uploader__input::-webkit-input-placeholder{color:var(--sapTextColor)}.fd-file-uploader .fd-file-uploader__input::-moz-placeholder{color:var(--sapTextColor)}.fd-file-uploader .fd-file-uploader__input:-ms-input-placeholder{color:var(--sapTextColor)}.fd-file-uploader .fd-file-uploader__input::-ms-input-placeholder{color:var(--sapTextColor)}.fd-file-uploader .fd-file-uploader__input::placeholder{color:var(--sapTextColor)}.fd-file-uploader__hidden{display:none}.fd-file-uploader__uploaded-files{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0}.fd-file-uploader__uploaded-files:after,.fd-file-uploader__uploaded-files:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-file-uploader__label{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);color:var(--sapContent_LabelColor);display:block;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;line-height:1.1875rem;margin-block:0;margin-inline:0;margin-top:1.5rem;padding-block:0;padding-inline:0}.fd-file-uploader__label:after,.fd-file-uploader__label:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-file-uploader__list{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;list-style-type:none;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0}.fd-file-uploader__list:after,.fd-file-uploader__list:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-file-uploader__list-item{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);display:-webkit-box;display:-ms-flexbox;display:flex;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;gap:calc(1rem + var(--fdFileUploaderButtonsSpacing));justify-content:space-between;margin-top:.5rem}.fd-file-uploader__list-item:after,.fd-file-uploader__list-item:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-file-uploader__actions{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);display:-webkit-box;display:-ms-flexbox;display:flex;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:var(--fdFileUploaderButtonsSpacing)}.fd-file-uploader__actions:after,.fd-file-uploader__actions:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-file-uploader{display:flex}\n/*! Bundled license information:\n\nfundamental-styles/dist/file-uploader.css:\n  (*!\n   * Fundamental Library Styles v0.41.7\n   * Copyright (c) 2026 SAP SE or an SAP affiliate company.\n   * Licensed under Apache License 2.0 (https://github.com/SAP/fundamental-styles/blob/main/LICENSE)\n   *)\n*/\n"], dependencies: [{ kind: "directive", type: FileUploaderDragndropDirective, selector: "[fdFileDragnDrop], [fd-file-drag-n-drop]", inputs: ["multiple", "accept", "maxFileSize", "minFileSize", "disabled", "dragndrop"], outputs: ["fileChanged", "dragEntered", "dragLeave"] }, { kind: "component", type: ButtonComponent, selector: "button[fd-button], a[fd-button], span[fd-button]", inputs: ["id"], exportAs: ["fd-button"] }, { kind: "directive", type: FileUploaderSelectDirective, selector: "[fdFileSelect]", inputs: ["multiple"], outputs: ["fileSelected"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: FileUploaderComponent, decorators: [{
            type: Component,
            args: [{ selector: 'fd-file-uploader', host: {
                        '(blur)': 'onTouched()',
                        class: 'fd-file-uploader'
                    }, providers: [
                        {
                            provide: NG_VALUE_ACCESSOR,
                            useExisting: forwardRef(() => FileUploaderComponent),
                            multi: true
                        },
                        registerFormItemControl(FileUploaderComponent),
                        contentDensityObserverProviders()
                    ], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [FileUploaderDragndropDirective, ButtonComponent, FileUploaderSelectDirective], template: "<div\n    class=\"fd-file-uploader__container\"\n    fdFileDragnDrop\n    [accept]=\"accept\"\n    [maxFileSize]=\"maxFileSize\"\n    [minFileSize]=\"minFileSize\"\n    [dragndrop]=\"dragndrop\"\n    [disabled]=\"disabled\"\n    [multiple]=\"multiple\"\n    (fileChanged)=\"handleDrop($event)\"\n    (dragEntered)=\"onDragEnter.emit()\"\n    (dragLeave)=\"onDragLeave.emit()\"\n>\n    <input\n        #textInput\n        class=\"fd-input fd-file-uploader__input\"\n        [class]=\"state ? ' is-' + state : ''\"\n        aria-live=\"polite\"\n        autocomplete=\"off\"\n        type=\"text\"\n        tabindex=\"0\"\n        [id]=\"id\"\n        [attr.aria-label]=\"ariaLabel\"\n        [attr.aria-labelledby]=\"ariaLabelledBy\"\n        [attr.aria-required]=\"required\"\n        [title]=\"ariaLabel\"\n        [placeholder]=\"placeholder\"\n        [value]=\"\"\n        [style.width]=\"width\"\n        [hidden]=\"inputHidden\"\n        [disabled]=\"disabled\"\n        (click)=\"open()\"\n        (keydown)=\"keyDownHandle($event)\"\n    />\n\n    <button\n        fd-button\n        [attr.aria-label]=\"buttonAriaLabel\"\n        [label]=\"buttonLabel\"\n        [disabled]=\"disabled\"\n        (click)=\"open()\"\n    ></button>\n    <ng-content select=\"[fd-form-control]\"></ng-content>\n</div>\n\n<input\n    #fileInput\n    fdFileSelect\n    class=\"fd-file-uploader__hidden\"\n    type=\"file\"\n    [attr.accept]=\"accept\"\n    [multiple]=\"multiple\"\n    [disabled]=\"disabled\"\n    (fileSelected)=\"selectHandler($event)\"\n/>\n", styles: [".fd-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--sapField_BackgroundStyle,var(--sapField_BackgroundStyle));background-color:var(--sapField_Background,var(--sapField_Background));border:0;border:var(--sapField_BorderWidth) var(--sapField_BorderStyle) var(--sapField_BorderColor);border-radius:var(--sapField_BorderCornerRadius);-webkit-box-shadow:var(--sapField_Shadow);box-shadow:var(--sapField_Shadow);-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);color:var(--sapField_TextColor);cursor:text;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;height:var(--fdInput_Height,var(--sapElement_Height));line-height:normal;margin-block:0;margin-block:var(--fdInput_Field_Margin_Block,.25rem);margin-inline:0;min-height:var(--fdInput_Height,var(--sapElement_Height));min-width:2.75rem;outline:none;overflow:hidden;padding-block:0;padding-inline:0;padding-inline:var(--fdInput_Field_Padding_Inline,.625rem);text-overflow:ellipsis;text-shadow:var(--fdInput_Text_Shadow);white-space:nowrap;width:100%;z-index:1}.fd-input:after,.fd-input:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-input::-webkit-input-placeholder{color:var(--sapField_PlaceholderTextColor);font-style:var(--fdPlaceholder_Font_Style)}.fd-input::-moz-placeholder{color:var(--sapField_PlaceholderTextColor);font-style:var(--fdPlaceholder_Font_Style)}.fd-input:-ms-input-placeholder{color:var(--sapField_PlaceholderTextColor);font-style:var(--fdPlaceholder_Font_Style)}.fd-input::-ms-input-placeholder{color:var(--sapField_PlaceholderTextColor);font-style:var(--fdPlaceholder_Font_Style)}.fd-input::placeholder{color:var(--sapField_PlaceholderTextColor);font-style:var(--fdPlaceholder_Font_Style)}.fd-input[dir=rtl]::-webkit-input-placeholder,[dir=rtl] .fd-input::-webkit-input-placeholder{text-indent:.125rem}.fd-input[dir=rtl]::-moz-placeholder,[dir=rtl] .fd-input::-moz-placeholder{text-indent:.125rem}.fd-input[dir=rtl]:-ms-input-placeholder,[dir=rtl] .fd-input:-ms-input-placeholder{text-indent:.125rem}.fd-input[dir=rtl]::-ms-input-placeholder,[dir=rtl] .fd-input::-ms-input-placeholder{text-indent:.125rem}.fd-input[dir=rtl]::placeholder,[dir=rtl] .fd-input::placeholder{text-indent:.125rem}.fd-input::-moz-selection{background-color:var(--sapSelectedColor);color:var(--sapContent_ContrastTextColor)}.fd-input::selection{background-color:var(--sapSelectedColor);color:var(--sapContent_ContrastTextColor)}.fd-input::-ms-clear{display:none}.fd-input.is-hover,.fd-input:hover{background:var(--sapField_Hover_BackgroundStyle,var(--sapField_Hover_BackgroundStyle));background-color:var(--sapField_Hover_Background,var(--sapField_Hover_Background));border-color:var(--sapField_Hover_BorderColor);-webkit-box-shadow:var(--fdInput_Box_Shadow_Hover);box-shadow:var(--fdInput_Box_Shadow_Hover)}.fd-input.is-focus,.fd-input:focus{background:var(--sapField_Focus_Background,var(--sapField_Focus_Background));-webkit-box-shadow:none;box-shadow:none;outline:var(--fdInput_Outline_Color) var(--sapContent_FocusStyle) var(--sapContent_FocusWidth);outline-offset:var(--fdInput_Outline_Offset);z-index:5}.fd-input[type=search]::-webkit-search-cancel-button,.fd-input[type=search]::-webkit-search-decoration,.fd-input[type=search]::-webkit-search-results-button,.fd-input[type=search]::-webkit-search-results-decoration{-webkit-appearance:none;appearance:none}.fd-input[aria-expanded=false]{z-index:0}.fd-input.is-expanded,.fd-input[aria-expanded=true]{z-index:4}.fd-input[class*=-compact],.fd-input[class*=-condensed],[class*=-compact] .fd-input:not([class*=-cozy]),[class*=-condensed] .fd-input:not([class*=-cozy]){-webkit-box-sizing:border-box;box-sizing:border-box;height:var(--fdInput_Compact_Height,var(--sapElement_Compact_Height));margin-block:var(--fdInput_Field_Compact_Margin_Block,.1875rem);margin-inline:0;min-height:var(--fdInput_Compact_Height,var(--sapElement_Compact_Height));min-width:var(--fdInput_Field_Compact_Min_Width,2rem);padding-block:0;padding-inline:var(--fdInput_Field_Compact_Padding,.5rem)}.fd-input--no-number-spinner{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.fd-input--no-number-spinner::-webkit-inner-spin-button,.fd-input--no-number-spinner::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin-block:0;margin-inline:0}.fd-input.right-align{text-align:right}.fd-input__sr-only{position:absolute;clip:rect(0 0 0 0);border:0;height:1px;margin-block:-1px;margin-inline:-1px;overflow:hidden;padding-block:0;padding-inline:0;white-space:nowrap;width:1px}.fd-input.is-success{background:var(--sapField_SuccessBackgroundStyle);background-color:var(--sapField_SuccessBackground);border:var(--sapField_SuccessColor) var(--sapField_SuccessBorderWidth) var(--sapField_SuccessBorderStyle);-webkit-box-shadow:var(--sapField_SuccessShadow);box-shadow:var(--sapField_SuccessShadow)}.fd-input.is-success.is-hover,.fd-input.is-success:hover{background-color:var(--fdInput_Success_Background_Color_Hover);border-color:var(--sapField_SuccessColor);-webkit-box-shadow:var(--fdInput_Success_Box_Shadow_Hover);box-shadow:var(--fdInput_Success_Box_Shadow_Hover)}.fd-input.is-success.is-focus,.fd-input.is-success:focus{background:var(--sapField_Focus_Background);outline-color:var(--fdInput_Success_Outline_Color);z-index:5}.fd-input.is-success.is-focus.is-hover,.fd-input.is-success.is-focus:hover,.fd-input.is-success:focus.is-hover,.fd-input.is-success:focus:hover{-webkit-box-shadow:none;box-shadow:none}.fd-input.is-success.is-expanded,.fd-input.is-success[aria-expanded=true]{background:var(--sapField_Focus_Background);-webkit-box-shadow:none;box-shadow:none;outline:var(--sapContent_FocusWidth) var(--sapContent_FocusStyle) var(--fdInput_Success_Outline_Color);outline-offset:var(--fdInput_Outline_Offset)}.fd-input.is-error{background:var(--sapField_InvalidBackgroundStyle);background-color:var(--sapField_InvalidBackground);border:var(--sapField_InvalidColor) var(--sapField_InvalidBorderWidth) var(--sapField_InvalidBorderStyle);-webkit-box-shadow:var(--sapField_InvalidShadow);box-shadow:var(--sapField_InvalidShadow)}.fd-input.is-error.is-hover,.fd-input.is-error:hover{background-color:var(--fdInput_Error_Background_Color_Hover);border-color:var(--sapField_InvalidColor);-webkit-box-shadow:var(--fdInput_Error_Box_Shadow_Hover);box-shadow:var(--fdInput_Error_Box_Shadow_Hover)}.fd-input.is-error.is-focus,.fd-input.is-error:focus{background:var(--sapField_Focus_Background);outline-color:var(--fdInput_Error_Outline_Color);z-index:5}.fd-input.is-error.is-focus.is-hover,.fd-input.is-error.is-focus:hover,.fd-input.is-error:focus.is-hover,.fd-input.is-error:focus:hover{-webkit-box-shadow:none;box-shadow:none}.fd-input.is-error.is-expanded,.fd-input.is-error[aria-expanded=true]{background:var(--sapField_Focus_Background);-webkit-box-shadow:none;box-shadow:none;outline:var(--sapContent_FocusWidth) var(--sapContent_FocusStyle) var(--fdInput_Error_Outline_Color);outline-offset:var(--fdInput_Outline_Offset)}.fd-input.is-warning{background:var(--sapField_WarningBackgroundStyle);background-color:var(--sapField_WarningBackground);border:var(--sapField_WarningColor) var(--sapField_WarningBorderWidth) var(--sapField_WarningBorderStyle);-webkit-box-shadow:var(--sapField_WarningShadow);box-shadow:var(--sapField_WarningShadow)}.fd-input.is-warning.is-hover,.fd-input.is-warning:hover{background-color:var(--fdInput_Warning_Background_Color_Hover);border-color:var(--sapField_WarningColor);-webkit-box-shadow:var(--fdInput_Warning_Box_Shadow_Hover);box-shadow:var(--fdInput_Warning_Box_Shadow_Hover)}.fd-input.is-warning.is-focus,.fd-input.is-warning:focus{background:var(--sapField_Focus_Background);outline-color:var(--fdInput_Warning_Outline_Color);z-index:5}.fd-input.is-warning.is-focus.is-hover,.fd-input.is-warning.is-focus:hover,.fd-input.is-warning:focus.is-hover,.fd-input.is-warning:focus:hover{-webkit-box-shadow:none;box-shadow:none}.fd-input.is-warning.is-expanded,.fd-input.is-warning[aria-expanded=true]{background:var(--sapField_Focus_Background);-webkit-box-shadow:none;box-shadow:none;outline:var(--sapContent_FocusWidth) var(--sapContent_FocusStyle) var(--fdInput_Warning_Outline_Color);outline-offset:var(--fdInput_Outline_Offset)}.fd-input.is-alert{background:var(--sapField_WarningBackgroundStyle);background-color:var(--sapField_WarningBackground);border:var(--sapField_WarningColor) var(--sapField_WarningBorderWidth) var(--sapField_WarningBorderStyle)}.fd-input.is-alert.is-hover,.fd-input.is-alert:hover{background-color:var(--fdInput_Warning_Background_Color_Hover);border-color:var(--sapField_WarningColor);-webkit-box-shadow:var(--fdInput_Warning_Box_Shadow_Hover);box-shadow:var(--fdInput_Warning_Box_Shadow_Hover)}.fd-input.is-alert.is-focus,.fd-input.is-alert:focus{background:var(--sapField_Focus_Background);outline-color:var(--fdInput_Warning_Outline_Color);z-index:5}.fd-input.is-alert.is-focus.is-hover,.fd-input.is-alert.is-focus:hover,.fd-input.is-alert:focus.is-hover,.fd-input.is-alert:focus:hover{-webkit-box-shadow:none;box-shadow:none}.fd-input.is-alert.is-expanded,.fd-input.is-alert[aria-expanded=true]{background:var(--sapField_Focus_Background);-webkit-box-shadow:none;box-shadow:none;outline:var(--sapContent_FocusWidth) var(--sapContent_FocusStyle) var(--fdInput_Warning_Outline_Color);outline-offset:var(--fdInput_Outline_Offset)}.fd-input.is-information{background:var(--sapField_InformationBackgroundStyle);background-color:var(--sapField_InformationBackground);border:var(--sapField_InformationColor) var(--sapField_InformationBorderWidth) var(--sapField_InformationBorderStyle);-webkit-box-shadow:var(--sapField_InformationShadow);box-shadow:var(--sapField_InformationShadow)}.fd-input.is-information.is-hover,.fd-input.is-information:hover{background-color:var(--fdInput_Information_Background_Color_Hover);border-color:var(--sapField_InformationColor);-webkit-box-shadow:var(--fdInput_Information_Box_Shadow_Hover);box-shadow:var(--fdInput_Information_Box_Shadow_Hover)}.fd-input.is-information.is-focus,.fd-input.is-information:focus{background:var(--sapField_Focus_Background);outline-color:var(--fdInput_Information_Outline_Color);z-index:5}.fd-input.is-information.is-focus.is-hover,.fd-input.is-information.is-focus:hover,.fd-input.is-information:focus.is-hover,.fd-input.is-information:focus:hover{-webkit-box-shadow:none;box-shadow:none}.fd-input.is-information.is-expanded,.fd-input.is-information[aria-expanded=true]{background:var(--sapField_Focus_Background);-webkit-box-shadow:none;box-shadow:none;outline:var(--sapContent_FocusWidth) var(--sapContent_FocusStyle) var(--fdInput_Information_Outline_Color);outline-offset:var(--fdInput_Outline_Offset)}.fd-input.is-alert,.fd-input.is-error,.fd-input.is-warning{font-style:var(--fdInput_State_Text_Style);font-weight:var(--fdInput_State_Font_Weight)}.fd-input.is-alert::-webkit-input-placeholder,.fd-input.is-error::-webkit-input-placeholder,.fd-input.is-warning::-webkit-input-placeholder{font-weight:var(--fdInput_State_Font_Weight)}.fd-input.is-alert::-moz-placeholder,.fd-input.is-error::-moz-placeholder,.fd-input.is-warning::-moz-placeholder{font-weight:var(--fdInput_State_Font_Weight)}.fd-input.is-alert:-ms-input-placeholder,.fd-input.is-error:-ms-input-placeholder,.fd-input.is-warning:-ms-input-placeholder{font-weight:var(--fdInput_State_Font_Weight)}.fd-input.is-alert::-ms-input-placeholder,.fd-input.is-error::-ms-input-placeholder,.fd-input.is-warning::-ms-input-placeholder{font-weight:var(--fdInput_State_Font_Weight)}.fd-input.is-alert::placeholder,.fd-input.is-error::placeholder,.fd-input.is-warning::placeholder{font-weight:var(--fdInput_State_Font_Weight)}.fd-input.is-alert.is-focus,.fd-input.is-alert:focus,.fd-input.is-error.is-focus,.fd-input.is-error:focus,.fd-input.is-information.is-focus,.fd-input.is-information:focus,.fd-input.is-warning.is-focus,.fd-input.is-warning:focus{outline-offset:var(--fdInput_Outline_Offset_States);z-index:5}.fd-input.is-error::-webkit-input-placeholder{color:var(--sapField_TextColor)}.fd-input.is-error::-moz-placeholder{color:var(--sapField_TextColor)}.fd-input.is-error:-ms-input-placeholder{color:var(--sapField_TextColor)}.fd-input.is-error::-ms-input-placeholder{color:var(--sapField_TextColor)}.fd-input.is-error::placeholder{color:var(--sapField_TextColor)}.fd-input.is-disabled,.fd-input:disabled,.fd-input[aria-disabled=true]{opacity:var(--sapContent_DisabledOpacity);pointer-events:none}.fd-input.is-disabled::-webkit-input-placeholder,.fd-input:disabled::-webkit-input-placeholder,.fd-input[aria-disabled=true]::-webkit-input-placeholder{color:var(--fdInput_Non_Interactive_State_Placeholder_Color);opacity:0}.fd-input.is-disabled::-moz-placeholder,.fd-input:disabled::-moz-placeholder,.fd-input[aria-disabled=true]::-moz-placeholder{color:var(--fdInput_Non_Interactive_State_Placeholder_Color);opacity:0}.fd-input.is-disabled:-ms-input-placeholder,.fd-input:disabled:-ms-input-placeholder,.fd-input[aria-disabled=true]:-ms-input-placeholder{color:var(--fdInput_Non_Interactive_State_Placeholder_Color);opacity:0}.fd-input.is-disabled::-ms-input-placeholder,.fd-input:disabled::-ms-input-placeholder,.fd-input[aria-disabled=true]::-ms-input-placeholder{color:var(--fdInput_Non_Interactive_State_Placeholder_Color);opacity:0}.fd-input.is-disabled::placeholder,.fd-input:disabled::placeholder,.fd-input[aria-disabled=true]::placeholder{color:var(--fdInput_Non_Interactive_State_Placeholder_Color);opacity:0}.fd-input.is-readonly,.fd-input[aria-readonly=true],.fd-input[readonly]{--fdInput_Outline_Offset:-.25rem;background:var(--sapField_ReadOnly_BackgroundStyle);background-color:var(--sapField_ReadOnly_Background);border-color:var(--sapField_ReadOnly_BorderColor);-webkit-box-shadow:none;box-shadow:none}.fd-input.is-readonly::-webkit-input-placeholder,.fd-input[aria-readonly=true]::-webkit-input-placeholder,.fd-input[readonly]::-webkit-input-placeholder{color:var(--fdInput_Non_Interactive_State_Placeholder_Color);opacity:0}.fd-input.is-readonly::-moz-placeholder,.fd-input[aria-readonly=true]::-moz-placeholder,.fd-input[readonly]::-moz-placeholder{color:var(--fdInput_Non_Interactive_State_Placeholder_Color);opacity:0}.fd-input.is-readonly:-ms-input-placeholder,.fd-input[aria-readonly=true]:-ms-input-placeholder,.fd-input[readonly]:-ms-input-placeholder{color:var(--fdInput_Non_Interactive_State_Placeholder_Color);opacity:0}.fd-input.is-readonly::-ms-input-placeholder,.fd-input[aria-readonly=true]::-ms-input-placeholder,.fd-input[readonly]::-ms-input-placeholder{color:var(--fdInput_Non_Interactive_State_Placeholder_Color);opacity:0}.fd-input.is-readonly::placeholder,.fd-input[aria-readonly=true]::placeholder,.fd-input[readonly]::placeholder{color:var(--fdInput_Non_Interactive_State_Placeholder_Color);opacity:0}.fd-input.is-readonly.is-focus,.fd-input.is-readonly.is-hover,.fd-input.is-readonly:focus,.fd-input.is-readonly:hover,.fd-input[aria-readonly=true].is-focus,.fd-input[aria-readonly=true].is-hover,.fd-input[aria-readonly=true]:focus,.fd-input[aria-readonly=true]:hover,.fd-input[readonly].is-focus,.fd-input[readonly].is-hover,.fd-input[readonly]:focus,.fd-input[readonly]:hover{--fdInput_Outline_Offset:-.25rem;background:var(--sapField_ReadOnly_BackgroundStyle);background-color:var(--sapField_ReadOnly_Background);border-color:var(--sapField_ReadOnly_BorderColor);-webkit-box-shadow:none;box-shadow:none}.fd-input.is-readonly.is-focus,.fd-input.is-readonly:focus,.fd-input[aria-readonly=true].is-focus,.fd-input[aria-readonly=true]:focus,.fd-input[readonly].is-focus,.fd-input[readonly]:focus{z-index:5}.fd-file-uploader{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0}.fd-file-uploader:after,.fd-file-uploader:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-file-uploader__container{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);display:-webkit-box;display:-ms-flexbox;display:flex;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:.25rem}.fd-file-uploader__container:after,.fd-file-uploader__container:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-file-uploader .fd-file-uploader__input{-webkit-box-flex:1;background-color:var(--sapField_Background);color:transparent;cursor:pointer;-ms-flex:1;flex:1;text-shadow:0 0 0 var(--sapTextColor);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.fd-file-uploader .fd-file-uploader__input::-webkit-input-placeholder{color:var(--sapTextColor)}.fd-file-uploader .fd-file-uploader__input::-moz-placeholder{color:var(--sapTextColor)}.fd-file-uploader .fd-file-uploader__input:-ms-input-placeholder{color:var(--sapTextColor)}.fd-file-uploader .fd-file-uploader__input::-ms-input-placeholder{color:var(--sapTextColor)}.fd-file-uploader .fd-file-uploader__input::placeholder{color:var(--sapTextColor)}.fd-file-uploader__hidden{display:none}.fd-file-uploader__uploaded-files{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0}.fd-file-uploader__uploaded-files:after,.fd-file-uploader__uploaded-files:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-file-uploader__label{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);color:var(--sapContent_LabelColor);display:block;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;line-height:1.1875rem;margin-block:0;margin-inline:0;margin-top:1.5rem;padding-block:0;padding-inline:0}.fd-file-uploader__label:after,.fd-file-uploader__label:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-file-uploader__list{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;list-style-type:none;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0}.fd-file-uploader__list:after,.fd-file-uploader__list:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-file-uploader__list-item{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);display:-webkit-box;display:-ms-flexbox;display:flex;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;gap:calc(1rem + var(--fdFileUploaderButtonsSpacing));justify-content:space-between;margin-top:.5rem}.fd-file-uploader__list-item:after,.fd-file-uploader__list-item:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-file-uploader__actions{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);display:-webkit-box;display:-ms-flexbox;display:flex;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:var(--fdFileUploaderButtonsSpacing)}.fd-file-uploader__actions:after,.fd-file-uploader__actions:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-file-uploader{display:flex}\n/*! Bundled license information:\n\nfundamental-styles/dist/file-uploader.css:\n  (*!\n   * Fundamental Library Styles v0.41.7\n   * Copyright (c) 2026 SAP SE or an SAP affiliate company.\n   * Licensed under Apache License 2.0 (https://github.com/SAP/fundamental-styles/blob/main/LICENSE)\n   *)\n*/\n"] }]
        }], ctorParameters: () => [{ type: FileUploaderService }, { type: i0.ChangeDetectorRef }, { type: i2.ContentDensityObserver }], propDecorators: { inputRef: [{
                type: ViewChild,
                args: ['fileInput']
            }], inputRefText: [{
                type: ViewChild,
                args: ['textInput']
            }], disabled: [{
                type: Input
            }], required: [{
                type: Input
            }], multiple: [{
                type: Input
            }], accept: [{
                type: Input
            }], dragndrop: [{
                type: Input
            }], maxFileSize: [{
                type: Input
            }], minFileSize: [{
                type: Input
            }], id: [{
                type: Input
            }], ariaLabel: [{
                type: Input
            }], ariaLabelledBy: [{
                type: Input
            }], placeholder: [{
                type: Input
            }], buttonLabel: [{
                type: Input
            }], buttonAriaLabel: [{
                type: Input
            }], state: [{
                type: Input
            }], fileLimit: [{
                type: Input
            }], inputHidden: [{
                type: Input
            }], width: [{
                type: Input
            }], selectedFilesChanged: [{
                type: Output
            }], selectedInvalidFiles: [{
                type: Output
            }], onDragEnter: [{
                type: Output
            }], onDragLeave: [{
                type: Output
            }] } });

const components = [FileUploaderComponent, FileUploaderSelectDirective, FileUploaderDragndropDirective];
/**
 * @deprecated
 * Use direct imports of components and directives.
 */
class FileUploaderModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: FileUploaderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.1.0", ngImport: i0, type: FileUploaderModule, imports: [FileUploaderComponent, FileUploaderSelectDirective, FileUploaderDragndropDirective], exports: [FileUploaderComponent, FileUploaderSelectDirective, FileUploaderDragndropDirective] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: FileUploaderModule, imports: [FileUploaderComponent] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: FileUploaderModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [...components],
                    exports: [...components]
                }]
        }] });

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

export { FileUploaderComponent, FileUploaderDragndropDirective, FileUploaderModule, FileUploaderSelectDirective, FileUploaderService };
//# sourceMappingURL=fundamental-ngx-core-file-uploader.mjs.map
