import { FocusMonitor } from '@angular/cdk/a11y';
import { isPlatformBrowser } from '@angular/common';
import { booleanAttribute, ChangeDetectionStrategy, Component, ContentChildren, ElementRef, EventEmitter, inject, input, Input, Output, PLATFORM_ID, QueryList, ViewChild, ViewEncapsulation } from '@angular/core';
import { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';
import { ErrorStateMatcher, ruRULocaleData } from '@koobiq/components/core';
import { KbqHint } from '@koobiq/components/form-field';
import { BehaviorSubject, skip } from 'rxjs';
import { distinctUntilChanged } from 'rxjs/operators';
import { KBQ_FILE_UPLOAD_CONFIGURATION, KbqFileUploadBase } from './file-upload';
import * as i0 from "@angular/core";
import * as i1 from "@koobiq/components/progress-spinner";
import * as i2 from "@koobiq/components/icon";
import * as i3 from "@koobiq/components/ellipsis-center";
import * as i4 from "@koobiq/components/link";
import * as i5 from "./file-drop";
import * as i6 from "@koobiq/components/core";
import * as i7 from "@angular/common";
let nextSingleFileUploadUniqueId = 0;
export const KBQ_SINGLE_FILE_UPLOAD_DEFAULT_CONFIGURATION = ruRULocaleData.fileUpload.single;
export class KbqSingleFileUploadComponent extends KbqFileUploadBase {
    get file() {
        return this._file;
    }
    set file(currentFile) {
        this._file = currentFile;
        this.cvaOnChange(this._file);
        this.cdr.markForCheck();
    }
    /** @docs-private */
    get acceptedFiles() {
        return this.accept?.join(',') || '*/*';
    }
    /** @docs-private */
    get hasHint() {
        return this.hint.length > 0;
    }
    /**
     * Indicates an invalid state based on file errors or `errorState`,
     * applying a CSS class in HTML for visual feedback.
     * @docs-private
     */
    get invalid() {
        return !!this.file?.hasError || this.errorState;
    }
    constructor() {
        super();
        /**
         * A value responsible for progress spinner type.
         * Loading logic depends on selected mode */
        this.progressMode = 'determinate';
        this.disabled = false;
        /**
         * @deprecated use `FormControl.errors`
         */
        this.errors = [];
        this.inputId = `kbq-single-file-upload-${nextSingleFileUploadUniqueId++}`;
        this._file = null;
        /**
         * Controls whether to display the file size information.
         * @default true
         */
        this.showFileSize = true;
        /** Optional configuration to override default labels with localized text.*/
        this.localeConfig = input();
        /** Emits an event containing updated file.
         * public output will be renamed to fileChange in next major release (#DS-3700) */
        this.fileChange = new EventEmitter();
        /** cvaOnChange function registered via registerOnChange (ControlValueAccessor).
         * @docs-private
         */
        this.cvaOnChange = (_) => { };
        /** onTouch function registered via registerOnTouch (ControlValueAccessor).
         * @docs-private
         */
        this.onTouched = () => { };
        /** @docs-private */
        this.configuration = inject(KBQ_FILE_UPLOAD_CONFIGURATION, {
            optional: true
        });
        this.focusMonitor = inject(FocusMonitor);
        this.platformId = inject(PLATFORM_ID);
        this.updateLocaleParams = () => {
            this.config = this.buildConfig(this.configuration || this.localeService?.getParams('fileUpload').multiple);
            this.getCaptionText();
            this.cdr.markForCheck();
        };
        this.localeService?.changes.pipe(takeUntilDestroyed()).subscribe(this.updateLocaleParams);
        if (!this.localeService) {
            this.initDefaultParams();
        }
        if (this.ngControl) {
            // Note: we provide the value accessor through here, instead of
            // the `providers` to avoid running into a circular import.
            this.ngControl.valueAccessor = this;
        }
        toObservable(this.localeConfig)
            .pipe(skip(1), takeUntilDestroyed())
            .subscribe(() => {
            this.localeService ? this.updateLocaleParams() : this.initDefaultParams();
        });
    }
    ngDoCheck() {
        if (this.ngControl) {
            // We need to re-evaluate this on every change detection cycle, because there are some
            // error triggers that we can't subscribe to (e.g. parent form submissions). This means
            // that whatever logic is in here has to be super lean or we risk destroying the performance.
            this.updateErrorState();
        }
    }
    ngAfterViewInit() {
        // FormControl specific errors update
        this.ngControl?.statusChanges
            ?.pipe(distinctUntilChanged(), takeUntilDestroyed(this.destroyRef))
            .subscribe((status) => {
            if (this._file) {
                this._file.hasError = status === 'INVALID';
            }
            this.errors = Object.values(this.ngControl?.errors || {});
            this.cdr.markForCheck();
        });
        this.stateChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => this.cdr.markForCheck());
    }
    /** Implemented as part of ControlValueAccessor.
     * @docs-private */
    writeValue(file) {
        // @TODO: remove File from arguments since it redundant. It resolves SSR (#DS-4414)
        if (!isPlatformBrowser(this.platformId))
            return;
        this.file = file instanceof File ? this.mapToFileItem(file) : file;
        this.fileChange.emit(this.file);
    }
    /** Implemented as part of ControlValueAccessor.
     * @docs-private */
    registerOnChange(fn) {
        this.cvaOnChange = fn;
    }
    /** Implemented as part of ControlValueAccessor.
     * @docs-private */
    registerOnTouched(fn) {
        this.onTouched = fn;
    }
    /**
     * Sets the disabled state of the control. Implemented as a part of ControlValueAccessor.
     * @param isDisabled Whether the control should be disabled.
     * @docs-private
     */
    setDisabledState(isDisabled) {
        this.disabled = isDisabled;
        this.cdr.markForCheck();
    }
    /** @docs-private */
    onFileSelectedViaClick({ target }) {
        if (this.disabled) {
            return;
        }
        const fileToAdd = target.files?.item(0);
        if (fileToAdd) {
            this.file = this.mapToFileItem(fileToAdd);
            this.fileChange.emit(this.file);
        }
        this.onTouched();
        // allows the same file selection every time user clicks on the control.
        this.renderer.setProperty(target, 'value', null);
    }
    /** @docs-private */
    deleteItem(event) {
        if (this.disabled)
            return;
        event?.stopPropagation();
        this.file = null;
        this.fileChange.emit(this.file);
        this.errors = [];
        // mark as touched after file drop even if file wasn't correct
        this.onTouched();
        if (this.file === null) {
            setTimeout(() => {
                this.focusMonitor.focusVia(this.input, 'keyboard');
            });
            return;
        }
    }
    /** @docs-private */
    onFileDropped(files) {
        if (this.disabled) {
            return;
        }
        if (files?.length) {
            this.file = this.mapToFileItem(files[0]);
            this.fileChange.emit(this.file);
        }
        // mark as touched after file drop even if file wasn't correct
        this.onTouched();
    }
    mapToFileItem(file) {
        return {
            file,
            hasError: this.validateFile(file),
            progress: new BehaviorSubject(0),
            loading: new BehaviorSubject(false)
        };
    }
    validateFile(file) {
        if (!this.customValidation?.length)
            return;
        this.errors = this.customValidation
            .reduce((errors, validatorFn) => {
            errors.push(validatorFn(file));
            return errors;
        }, [])
            .filter(Boolean);
        return !!this.errors.length;
    }
    initDefaultParams() {
        this.config = this.buildConfig(KBQ_SINGLE_FILE_UPLOAD_DEFAULT_CONFIGURATION);
        this.getCaptionText();
    }
    getCaptionText() {
        this.separatedCaptionText = this.config.captionText.split('{{ browseLink }}');
    }
    /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqSingleFileUploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: KbqSingleFileUploadComponent, selector: "kbq-single-file-upload,kbq-file-upload:not([multiple])", inputs: { progressMode: { classPropertyName: "progressMode", publicName: "progressMode", isSignal: false, isRequired: false, transformFunction: null }, accept: { classPropertyName: "accept", publicName: "accept", isSignal: false, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: false, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: false, isRequired: false, transformFunction: null }, customValidation: { classPropertyName: "customValidation", publicName: "customValidation", isSignal: false, isRequired: false, transformFunction: null }, errorStateMatcher: { classPropertyName: "errorStateMatcher", publicName: "errorStateMatcher", isSignal: false, isRequired: false, transformFunction: null }, file: { classPropertyName: "file", publicName: "file", isSignal: false, isRequired: false, transformFunction: null }, showFileSize: { classPropertyName: "showFileSize", publicName: "showFileSize", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, localeConfig: { classPropertyName: "localeConfig", publicName: "localeConfig", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { fileChange: "fileQueueChange" }, host: { classAttribute: "kbq-single-file-upload" }, queries: [{ propertyName: "hint", predicate: KbqHint }], viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div\n    kbqFileDrop\n    class=\"kbq-file-upload\"\n    [class.kbq-disabled]=\"disabled\"\n    [class.kbq-error]=\"invalid\"\n    (filesDropped)=\"onFileDropped($event)\"\n>\n    @if (!file) {\n        <div class=\"kbq-file-dropzone\">\n            <i kbq-icon=\"kbq-cloud-arrow-up-o_24\" class=\"kbq-file-dropzone__icon\"></i>\n            <!-- prettier-ignore -->\n            <span class=\"kbq-file-dropzone__text\">{{ separatedCaptionText[0] }}<label kbq-link pseudo [disabled]=\"disabled\" [tabIndex]=\"-1\" [for]=\"inputId\">{{ config.browseLink }}<input #input type=\"file\" class=\"cdk-visually-hidden\" tabindex=\"0\" [id]=\"inputId\" [accept]=\"acceptedFiles\" [disabled]=\"disabled\" (change)=\"onFileSelectedViaClick($event)\"></label>{{ separatedCaptionText[1] }}</span>\n        </div>\n    } @else {\n        @if (file) {\n            <div class=\"kbq-file-item\">\n                <div class=\"kbq-file-item__text-wrapper\">\n                    @if ({ loading: file.loading | async, progress: file.progress | async }; as asyncData) {\n                        @if (!asyncData.loading) {\n                            <ng-content select=\"[kbq-icon]\" />\n                        }\n                        @if (asyncData.loading) {\n                            <kbq-progress-spinner [mode]=\"progressMode\" [value]=\"asyncData.progress || 0\" />\n                        }\n                    }\n                    <div class=\"kbq-file-item__text\" [kbqEllipsisCenter]=\"file.file.name\" [minVisibleLength]=\"10\"></div>\n                </div>\n                @if (showFileSize) {\n                    <div class=\"kbq-file-item__size\">\n                        {{ file.file.size | kbqDataSize }}\n                    </div>\n                }\n                <i\n                    kbq-icon-button=\"kbq-xmark-circle_16\"\n                    class=\"kbq-file-upload__action\"\n                    [disabled]=\"disabled\"\n                    (click)=\"deleteItem($event)\"\n                    (keydown.backspace)=\"deleteItem()\"\n                    (keydown.delete)=\"deleteItem()\"\n                ></i>\n            </div>\n        }\n    }\n</div>\n\n@if (hasHint) {\n    <div class=\"kbq-file-upload__hint\">\n        <ng-content select=\"kbq-hint\" />\n    </div>\n}\n", styles: [".kbq-file-upload{box-sizing:border-box;display:flex;align-items:center;position:relative}.kbq-file-upload .kbq-file-dropzone,.kbq-file-upload .kbq-file-item{display:flex;align-items:center}.kbq-file-upload .kbq-ellipsis-center{position:relative;display:flex}.kbq-file-upload .kbq-ellipsis-center .kbq-ellipsis-center_data-text-start{flex:0 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:pre}.kbq-file-upload .kbq-ellipsis-center .kbq-ellipsis-center_data-text-end{flex:1 0 auto;overflow:hidden;white-space:pre}.kbq-file-upload__hint .kbq-hint{margin-top:var(--kbq-size-xxs)}.kbq-single-file-upload .kbq-file-upload{background-color:var(--kbq-file-upload-single-default-container-background);border-color:var(--kbq-file-upload-single-default-container-border)!important}.kbq-single-file-upload .kbq-file-upload .kbq-focused,.kbq-single-file-upload .kbq-file-upload .kbq-link.kbq-focused{border:2px solid var(--kbq-file-upload-single-states-focused-focus-outline-color)}.kbq-single-file-upload .kbq-file-upload:not(.kbq-disabled,.kbq-error) .kbq-file-upload__action{color:var(--kbq-file-upload-single-default-icon-button-color)}.kbq-single-file-upload .kbq-file-upload:not(.kbq-disabled,.kbq-error) .kbq-file-dropzone__icon{color:var(--kbq-file-upload-single-default-upload-icon-color)}.kbq-single-file-upload .kbq-file-upload:not(.kbq-disabled,.kbq-error) .kbq-file-item__text-wrapper .kbq-icon.kbq-empty{color:var(--kbq-file-upload-single-default-left-icon-color)}.kbq-single-file-upload .kbq-file-upload:not(.kbq-disabled,.kbq-error) .kbq-file-item__size{color:var(--kbq-file-upload-single-default-file-size-text-color)}.kbq-single-file-upload .kbq-file-upload.kbq-file-drop_dragover{background-color:var(--kbq-file-upload-single-states-on-drag-container-background);border-color:var(--kbq-file-upload-single-states-on-drag-container-border)!important}.kbq-single-file-upload .kbq-file-upload.kbq-error:not(.kbq-disabled):not(.kbq-file-drop_dragover){background-color:var(--kbq-file-upload-single-states-error-container-background);border-color:var(--kbq-file-upload-single-states-error-container-border)!important}.kbq-single-file-upload .kbq-file-upload.kbq-error:not(.kbq-disabled) .kbq-file-dropzone__icon{color:var(--kbq-file-upload-single-states-error-upload-icon-color)}.kbq-single-file-upload .kbq-file-upload.kbq-error:not(.kbq-disabled) .kbq-file-item__text-wrapper .kbq-icon.kbq-empty{color:var(--kbq-file-upload-single-states-error-left-icon-color)}.kbq-single-file-upload .kbq-file-upload.kbq-error:not(.kbq-disabled) .kbq-file-item__text,.kbq-single-file-upload .kbq-file-upload.kbq-error:not(.kbq-disabled) .kbq-file-dropzone__text:not(.kbq-link){color:var(--kbq-file-upload-single-states-error-text-block-color)}.kbq-single-file-upload .kbq-file-upload.kbq-error:not(.kbq-disabled) .kbq-file-item__size{color:var(--kbq-file-upload-single-states-error-file-size-text-color)}.kbq-single-file-upload .kbq-file-upload.kbq-error:not(.kbq-disabled) .kbq-file-upload__action{color:var(--kbq-file-upload-single-states-error-icon-button-color)}.kbq-single-file-upload .kbq-file-upload.kbq-disabled{background-color:var(--kbq-file-upload-single-states-disabled-container-background);border-color:var(--kbq-file-upload-single-states-disabled-container-border)!important}.kbq-single-file-upload .kbq-file-upload.kbq-disabled .kbq-file-dropzone__icon{color:var(--kbq-file-upload-single-states-disabled-upload-icon-color)}.kbq-single-file-upload .kbq-file-upload.kbq-disabled .kbq-file-item__text-wrapper .kbq-icon.kbq-empty{color:var(--kbq-file-upload-single-states-disabled-left-icon-color)}.kbq-single-file-upload .kbq-file-upload.kbq-disabled .kbq-file-dropzone__text,.kbq-single-file-upload .kbq-file-upload.kbq-disabled .kbq-file-item__text{color:var(--kbq-file-upload-single-states-disabled-text-block-color)}.kbq-single-file-upload .kbq-file-upload.kbq-disabled .kbq-file-item__size{color:var(--kbq-file-upload-single-states-disabled-file-size-text-color)}.kbq-single-file-upload .kbq-file-upload.kbq-disabled .kbq-file-upload__action{color:var(--kbq-file-upload-single-states-disabled-icon-button-color)}.kbq-multiple-file-upload .kbq-file-upload{background-color:var(--kbq-file-upload-multiple-default-container-background);border-color:var(--kbq-file-upload-multiple-default-container-border)!important}.kbq-multiple-file-upload .kbq-file-upload .kbq-focused:not(.kbq-list-option),.kbq-multiple-file-upload .kbq-file-upload .kbq-link.kbq-focused{border:2px solid var(--kbq-file-upload-multiple-states-focused-focus-outline-color)}.kbq-multiple-file-upload .kbq-file-upload .kbq-file-btn-upload{border-top-color:var(--kbq-file-upload-multiple-default-container-border)}.kbq-multiple-file-upload .kbq-file-upload .kbq-file-multiple-uploaded__header{color:var(--kbq-foreground-contrast-secondary);border-bottom-color:var(--kbq-file-upload-multiple-default-grid-divider-color)}.kbq-multiple-file-upload .kbq-file-upload:not(.kbq-disabled,.kbq-error) .kbq-file-dropzone__icon{color:var(--kbq-file-upload-multiple-default-upload-icon-color)}.kbq-multiple-file-upload .kbq-file-upload.kbq-file-drop_dragover{background-color:var(--kbq-file-upload-multiple-states-on-drag-container-background);border-color:var(--kbq-file-upload-multiple-states-on-drag-container-border)!important}.kbq-multiple-file-upload .kbq-file-upload.kbq-file-drop_dragover .kbq-file-btn-upload{border-top-color:var(--kbq-file-upload-multiple-states-on-drag-container-border)}.kbq-multiple-file-upload .kbq-file-upload.kbq-file-drop_dragover .kbq-file-multiple-uploaded__header{border-bottom-color:var(--kbq-file-upload-multiple-states-on-drag-grid-divider-color)!important}.kbq-multiple-file-upload .kbq-file-upload.kbq-file-drop_dragover .kbq-file-dropzone__icon{color:var(--kbq-file-upload-multiple-states-on-drag-upload-icon-color)}.kbq-multiple-file-upload .kbq-file-upload.kbq-disabled{background-color:var(--kbq-file-upload-multiple-states-disabled-container-background);border-color:var(--kbq-file-upload-multiple-states-disabled-container-border)!important}.kbq-multiple-file-upload .kbq-file-upload.kbq-disabled .kbq-file-dropzone__icon{color:var(--kbq-file-upload-multiple-states-disabled-upload-icon-color)}.kbq-multiple-file-upload .kbq-file-upload.kbq-disabled .kbq-file-dropzone__text,.kbq-multiple-file-upload .kbq-file-upload.kbq-disabled .kbq-file-multiple-uploaded__header{color:var(--kbq-file-upload-multiple-states-disabled-text-block-color)}.kbq-multiple-file-upload .kbq-file-upload.kbq-disabled .kbq-file-multiple-uploaded__header{border-bottom-color:var(--kbq-file-upload-multiple-states-disabled-grid-divider-color)!important}.kbq-multiple-file-upload .kbq-file-upload.kbq-disabled .kbq-file-multiple__uploaded-item .kbq-file-upload__file .kbq-icon.kbq-empty{color:var(--kbq-file-upload-multiple-states-disabled-left-icon-color)}.kbq-multiple-file-upload .kbq-file-upload.kbq-disabled .kbq-file-multiple__uploaded-item .kbq-file-item__text,.kbq-multiple-file-upload .kbq-file-upload.kbq-disabled .kbq-file-multiple__uploaded-item .kbq-file-upload__size{color:var(--kbq-file-upload-multiple-states-disabled-text-block-color)}.kbq-multiple-file-upload .kbq-file-upload.kbq-disabled .kbq-file-multiple__uploaded-item .kbq-file-upload__action .kbq-icon.kbq-empty{color:var(--kbq-file-upload-multiple-states-disabled-icon-button-color)}.kbq-multiple-file-upload .kbq-file-upload:not(.kbq-disabled).kbq-error{background-color:var(--kbq-background-error-less);border-color:var(--kbq-line-error)!important}.kbq-multiple-file-upload .kbq-file-upload:not(.kbq-disabled).kbq-error .kbq-file-dropzone__icon{color:var(--kbq-file-upload-multiple-states-error-upload-icon-color)}.kbq-multiple-file-upload .kbq-file-upload:not(.kbq-disabled).kbq-error .kbq-file-dropzone__text:not(.kbq-link),.kbq-multiple-file-upload .kbq-file-upload:not(.kbq-disabled).kbq-error .kbq-file-multiple-uploaded__header{color:var(--kbq-file-upload-multiple-states-error-text-block-color)}.kbq-multiple-file-upload .kbq-file-upload:not(.kbq-disabled) .kbq-file-multiple__uploaded-item:has(.kbq-file-upload__row.kbq-error){background-color:var(--kbq-background-error-less)}.kbq-multiple-file-upload .kbq-file-upload:not(.kbq-disabled) .kbq-file-multiple__uploaded-item:has(.kbq-file-upload__row.kbq-error) .kbq-file-item__text,.kbq-multiple-file-upload .kbq-file-upload:not(.kbq-disabled) .kbq-file-multiple__uploaded-item:has(.kbq-file-upload__row.kbq-error) .kbq-file-upload__size{color:var(--kbq-foreground-error)}.kbq-multiple-file-upload .kbq-file-upload:not(.kbq-disabled) .kbq-file-multiple__uploaded-item:has(.kbq-file-upload__row.kbq-error) .kbq-file-upload__file .kbq-icon.kbq-empty{color:var(--kbq-file-upload-multiple-states-error-left-icon-color)}.kbq-multiple-file-upload .kbq-file-upload:not(.kbq-disabled) .kbq-file-multiple__uploaded-item:has(.kbq-file-upload__row.kbq-error) .kbq-file-upload__action .kbq-icon.kbq-empty{color:var(--kbq-file-upload-multiple-states-error-icon-button-color)}.kbq-multiple-file-upload .kbq-file-upload .kbq-file-multiple__uploaded-item .kbq-file-upload__file .kbq-icon.kbq-empty{color:var(--kbq-file-upload-multiple-default-left-icon-color)}.kbq-multiple-file-upload .kbq-file-upload .kbq-file-multiple__uploaded-item .kbq-file-upload__size{color:var(--kbq-file-upload-multiple-default-file-size-text-color)}.kbq-multiple-file-upload .kbq-file-upload .kbq-file-multiple__uploaded-item .kbq-file-upload__action .kbq-icon.kbq-empty{color:var(--kbq-file-upload-multiple-default-icon-button-color)}:where(.kbq-file-upload__hint .kbq-hint){color:var(--kbq-foreground-contrast-secondary)}.kbq-file-upload,.kbq-single-file-upload .kbq-file-item__text-wrapper,.kbq-single-file-upload .kbq-file-dropzone__text{font-size:var(--kbq-typography-text-normal-font-size);font-style:var(--kbq-typography-text-normal-font-style);font-weight:var(--kbq-typography-text-normal-font-weight);line-height:var(--kbq-typography-text-normal-line-height);font-family:var(--kbq-typography-text-normal-font-family);text-transform:var(--kbq-typography-text-normal-text-transform);font-feature-settings:var(--kbq-typography-text-normal-font-feature-settings);letter-spacing:var(--kbq-typography-text-normal-letter-spacing)}.kbq-multiple-file-upload .kbq-file-multiple__header{font-size:var(--kbq-typography-subheading-font-size);font-style:var(--kbq-typography-subheading-font-style);font-weight:var(--kbq-typography-subheading-font-weight);line-height:var(--kbq-typography-subheading-line-height);font-family:var(--kbq-typography-subheading-font-family);text-transform:var(--kbq-typography-subheading-text-transform);font-feature-settings:var(--kbq-typography-subheading-font-feature-settings);letter-spacing:var(--kbq-typography-subheading-letter-spacing)}.kbq-multiple-file-upload .kbq-file-multiple__caption,.kbq-multiple-file-upload .kbq-file-multiple__caption .kbq-link,.kbq-multiple-file-upload .kbq-file-multiple-uploaded__header,.kbq-multiple-file-upload .kbq-file-multiple__uploaded-item,.kbq-multiple-file-upload .kbq-file-upload .kbq-list-item,.kbq-multiple-file-upload .kbq-file-upload .kbq-list-option{font-size:var(--kbq-typography-text-normal-font-size);font-style:var(--kbq-typography-text-normal-font-style);font-weight:var(--kbq-typography-text-normal-font-weight);line-height:var(--kbq-typography-text-normal-line-height);font-family:var(--kbq-typography-text-normal-font-family);text-transform:var(--kbq-typography-text-normal-text-transform);font-feature-settings:var(--kbq-typography-text-normal-font-feature-settings);letter-spacing:var(--kbq-typography-text-normal-letter-spacing)}.kbq-file-upload__hint .kbq-hint .kbq-hint__text{font-size:var(--kbq-typography-text-compact-font-size);font-style:var(--kbq-typography-text-compact-font-style);font-weight:var(--kbq-typography-text-compact-font-weight);line-height:var(--kbq-typography-text-compact-line-height);font-family:var(--kbq-typography-text-compact-font-family);text-transform:var(--kbq-typography-text-compact-text-transform);font-feature-settings:var(--kbq-typography-text-compact-font-feature-settings);letter-spacing:var(--kbq-typography-text-compact-letter-spacing)}\n", ":where(.kbq-file-upload){--kbq-form-field-hint-text: var(--kbq-foreground-contrast-secondary)}:where(.kbq-single-file-upload){--kbq-file-upload-size-single-container-border-radius: var(--kbq-size-s);--kbq-file-upload-size-single-container-border-width: 1px;--kbq-file-upload-size-single-container-content-gap-horizontal: var(--kbq-size-s);--kbq-file-upload-size-single-container-padding-vertical: var(--kbq-size-m);--kbq-file-upload-size-single-container-padding-horizontal: var(--kbq-size-m);--kbq-file-upload-size-single-text-block-padding-vertical: var(--kbq-size-3xs);--kbq-file-upload-size-single-text-block-content-gap-horizontal: var(--kbq-size-xxs);--kbq-file-upload-single-min-height: var(--kbq-size-5xl);--kbq-file-upload-single-default-container-border: var(--kbq-line-contrast-fade);--kbq-file-upload-single-default-container-background: var(--kbq-background-bg);--kbq-file-upload-single-default-upload-icon-color: var(--kbq-icon-contrast-fade);--kbq-file-upload-single-default-left-icon-color: var(--kbq-icon-contrast-fade);--kbq-file-upload-single-default-text-block-color: var(--kbq-foreground-contrast);--kbq-file-upload-single-default-icon-button-color: var(--kbq-icon-contrast);--kbq-file-upload-single-default-file-size-text-color: var(--kbq-foreground-contrast-secondary);--kbq-file-upload-single-states-on-drag-container-border: var(--kbq-line-theme-fade);--kbq-file-upload-single-states-on-drag-container-background: var(--kbq-background-theme-fade);--kbq-file-upload-single-states-on-drag-upload-icon-color: var(--kbq-icon-contrast-fade);--kbq-file-upload-single-states-on-drag-left-icon-color: var(--kbq-icon-contrast-fade);--kbq-file-upload-single-states-on-drag-text-block-color: var(--kbq-foreground-contrast);--kbq-file-upload-single-states-error-container-border: var(--kbq-line-error);--kbq-file-upload-single-states-error-container-background: var(--kbq-background-error-less);--kbq-file-upload-single-states-error-upload-icon-color: var(--kbq-icon-error);--kbq-file-upload-single-states-error-left-icon-color: var(--kbq-icon-error);--kbq-file-upload-single-states-error-text-block-color: var(--kbq-foreground-error);--kbq-file-upload-single-states-error-icon-button-color: var(--kbq-icon-error);--kbq-file-upload-single-states-error-file-size-text-color: var(--kbq-foreground-error);--kbq-file-upload-single-states-disabled-container-border: var(--kbq-states-line-disabled);--kbq-file-upload-single-states-disabled-container-background: var(--kbq-states-background-disabled);--kbq-file-upload-single-states-disabled-upload-icon-color: var(--kbq-states-icon-disabled);--kbq-file-upload-single-states-disabled-left-icon-color: var(--kbq-states-icon-disabled);--kbq-file-upload-single-states-disabled-icon-button-color: var(--kbq-states-icon-disabled);--kbq-file-upload-single-states-disabled-text-block-color: var(--kbq-states-foreground-disabled);--kbq-file-upload-single-states-disabled-file-size-text-color: var(--kbq-states-foreground-disabled);--kbq-file-upload-single-states-focused-focus-outline-color: var(--kbq-states-line-focus-theme)}:where(.kbq-multiple-file-upload){--kbq-file-upload-size-multiple-big-container-min-height: 192px;--kbq-file-upload-size-multiple-big-container-min-width: 320px;--kbq-file-upload-size-multiple-big-container-border-radius: var(--kbq-size-s);--kbq-file-upload-size-multiple-big-container-border-width: 1px;--kbq-file-upload-size-multiple-big-container-content-gap-horizontal: var(--kbq-size-m);--kbq-file-upload-size-multiple-big-container-padding-vertical: var(--kbq-size-xxl);--kbq-file-upload-size-multiple-big-container-padding-horizontal: var(--kbq-size-xxl);--kbq-file-upload-size-multiple-big-dropzone-content-gap-horizontal: var(--kbq-size-s);--kbq-file-upload-size-multiple-big-text-block-content-gap-vertical: 0px;--kbq-file-upload-size-multiple-big-text-block-content-gap-horizontal: var(--kbq-size-xxs);--kbq-file-upload-size-multiple-big-grid-cell-padding-horizontal: var(--kbq-size-s);--kbq-file-upload-size-multiple-big-grid-cell-padding-vertical: var(--kbq-size-s);--kbq-file-upload-size-multiple-big-grid-cell-content-gap-horizontal: var(--kbq-size-xxs);--kbq-file-upload-size-multiple-big-grid-cell-file-size-width: var(--kbq-size-7xl);--kbq-file-upload-multiple-default-container-border: var(--kbq-line-contrast-fade);--kbq-file-upload-multiple-default-container-background: var(--kbq-background-bg);--kbq-file-upload-multiple-default-upload-icon-color: var(--kbq-icon-contrast-fade);--kbq-file-upload-multiple-default-left-icon-color: var(--kbq-icon-contrast-fade);--kbq-file-upload-multiple-default-text-block-color: var(--kbq-foreground-contrast);--kbq-file-upload-multiple-default-icon-button-color: var(--kbq-icon-contrast);--kbq-file-upload-multiple-default-grid-divider-color: var(--kbq-line-contrast-less);--kbq-file-upload-multiple-default-file-size-text-color: var(--kbq-foreground-contrast-secondary);--kbq-file-upload-multiple-states-on-drag-container-border: var(--kbq-line-theme-fade);--kbq-file-upload-multiple-states-on-drag-container-background: var(--kbq-background-theme-fade);--kbq-file-upload-multiple-states-on-drag-upload-icon-color: var(--kbq-icon-contrast-fade);--kbq-file-upload-multiple-states-on-drag-left-icon-color: var(--kbq-icon-contrast-fade);--kbq-file-upload-multiple-states-on-drag-icon-button-color: var(--kbq-icon-contrast);--kbq-file-upload-multiple-states-on-drag-text-block-color: var(--kbq-foreground-contrast);--kbq-file-upload-multiple-states-on-drag-grid-divider-color: var(--kbq-line-contrast-less);--kbq-file-upload-multiple-states-error-grid-cell-background: var(--kbq-background-error-less);--kbq-file-upload-multiple-states-error-upload-icon-color: var(--kbq-icon-error);--kbq-file-upload-multiple-states-error-left-icon-color: var(--kbq-icon-error);--kbq-file-upload-multiple-states-error-text-block-color: var(--kbq-foreground-error);--kbq-file-upload-multiple-states-error-icon-button-color: var(--kbq-icon-error);--kbq-file-upload-multiple-states-disabled-container-border: var(--kbq-states-line-disabled);--kbq-file-upload-multiple-states-disabled-container-background: var(--kbq-states-background-disabled);--kbq-file-upload-multiple-states-disabled-upload-icon-color: var(--kbq-states-icon-disabled);--kbq-file-upload-multiple-states-disabled-left-icon-color: var(--kbq-states-icon-disabled);--kbq-file-upload-multiple-states-disabled-icon-button-color: var(--kbq-states-icon-disabled);--kbq-file-upload-multiple-states-disabled-text-block-color: var(--kbq-states-foreground-disabled);--kbq-file-upload-multiple-states-disabled-grid-divider-color: var(--kbq-states-line-disabled);--kbq-file-upload-multiple-states-focused-focus-outline-color: var(--kbq-states-line-focus-theme)}:where(.kbq-file-upload.kbq-file-upload_compact){--kbq-file-upload-multiple-compact-container-content-gap-horizontal: var(--kbq-size-s);--kbq-file-upload-multiple-compact-text-block-padding-vertical: var(--kbq-size-3xs);--kbq-file-upload-multiple-compact-container-padding-vertical: 11px;--kbq-file-upload-multiple-compact-container-padding-horizontal: 11px}\n", ".kbq-single-file-upload .kbq-file-upload{padding:calc(var(--kbq-file-upload-size-single-container-padding-vertical) - var(--kbq-file-upload-size-single-container-border-width)) calc(var(--kbq-file-upload-size-single-container-padding-horizontal) - var(--kbq-file-upload-size-single-container-border-width));min-height:var(--kbq-file-upload-single-min-height);border-radius:var(--kbq-file-upload-size-single-container-border-radius);border-width:var(--kbq-file-upload-size-single-container-border-width);border-style:dashed}.kbq-single-file-upload .kbq-file-upload .kbq-file-dropzone__text{padding-top:var(--kbq-file-upload-size-single-text-block-padding-vertical);padding-bottom:var(--kbq-file-upload-size-single-text-block-padding-vertical);gap:var(--kbq-file-upload-size-single-text-block-content-gap-horizontal)}.kbq-single-file-upload .kbq-file-upload .kbq-file-dropzone{gap:var(--kbq-file-upload-size-single-container-content-gap-horizontal)}.kbq-single-file-upload .kbq-file-upload .kbq-file-item{width:100%}.kbq-single-file-upload .kbq-file-upload .kbq-file-item .kbq-file-item__text-wrapper{display:flex;align-items:center;width:100%;gap:var(--kbq-file-upload-size-single-container-content-gap-horizontal)}.kbq-single-file-upload .kbq-file-upload .kbq-file-item .kbq-file-item__text-wrapper .kbq-file-item__text{width:120px;flex-grow:1}.kbq-single-file-upload .kbq-file-upload .kbq-file-item .kbq-file-item__size{padding:0 var(--kbq-size-s)}.kbq-single-file-upload .kbq-file-upload .kbq-file-item .kbq-file-upload__action{padding:var(--kbq-size-xxs)}\n"], dependencies: [{ kind: "component", type: i1.KbqProgressSpinner, selector: "kbq-progress-spinner", inputs: ["id", "value", "mode", "size"] }, { kind: "component", type: i2.KbqIcon, selector: "[kbq-icon]", inputs: ["small", "autoColor", "kbq-icon"] }, { kind: "component", type: i2.KbqIconButton, selector: "[kbq-icon-button]", inputs: ["small", "kbq-icon-button", "tabindex", "disabled"] }, { kind: "directive", type: i3.KbqEllipsisCenterDirective, selector: "[kbqEllipsisCenter]", inputs: ["kbqEllipsisCenter", "minVisibleLength", "charWidth", "debounceInterval"] }, { kind: "directive", type: i4.KbqLink, selector: "[kbq-link]", inputs: ["disabled", "tabIndex", "pseudo", "noUnderline", "big", "compact", "useVisited", "print"], exportAs: ["kbqLink"] }, { kind: "directive", type: i5.KbqFileDropDirective, selector: "[kbqFileDrop]", outputs: ["filesDropped"], exportAs: ["kbqFileDrop"] }, { kind: "pipe", type: i6.KbqDataSizePipe, name: "kbqDataSize" }, { kind: "pipe", type: i7.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqSingleFileUploadComponent, decorators: [{
            type: Component,
            args: [{ selector: 'kbq-single-file-upload,kbq-file-upload:not([multiple])', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
                        class: 'kbq-single-file-upload'
                    }, template: "<div\n    kbqFileDrop\n    class=\"kbq-file-upload\"\n    [class.kbq-disabled]=\"disabled\"\n    [class.kbq-error]=\"invalid\"\n    (filesDropped)=\"onFileDropped($event)\"\n>\n    @if (!file) {\n        <div class=\"kbq-file-dropzone\">\n            <i kbq-icon=\"kbq-cloud-arrow-up-o_24\" class=\"kbq-file-dropzone__icon\"></i>\n            <!-- prettier-ignore -->\n            <span class=\"kbq-file-dropzone__text\">{{ separatedCaptionText[0] }}<label kbq-link pseudo [disabled]=\"disabled\" [tabIndex]=\"-1\" [for]=\"inputId\">{{ config.browseLink }}<input #input type=\"file\" class=\"cdk-visually-hidden\" tabindex=\"0\" [id]=\"inputId\" [accept]=\"acceptedFiles\" [disabled]=\"disabled\" (change)=\"onFileSelectedViaClick($event)\"></label>{{ separatedCaptionText[1] }}</span>\n        </div>\n    } @else {\n        @if (file) {\n            <div class=\"kbq-file-item\">\n                <div class=\"kbq-file-item__text-wrapper\">\n                    @if ({ loading: file.loading | async, progress: file.progress | async }; as asyncData) {\n                        @if (!asyncData.loading) {\n                            <ng-content select=\"[kbq-icon]\" />\n                        }\n                        @if (asyncData.loading) {\n                            <kbq-progress-spinner [mode]=\"progressMode\" [value]=\"asyncData.progress || 0\" />\n                        }\n                    }\n                    <div class=\"kbq-file-item__text\" [kbqEllipsisCenter]=\"file.file.name\" [minVisibleLength]=\"10\"></div>\n                </div>\n                @if (showFileSize) {\n                    <div class=\"kbq-file-item__size\">\n                        {{ file.file.size | kbqDataSize }}\n                    </div>\n                }\n                <i\n                    kbq-icon-button=\"kbq-xmark-circle_16\"\n                    class=\"kbq-file-upload__action\"\n                    [disabled]=\"disabled\"\n                    (click)=\"deleteItem($event)\"\n                    (keydown.backspace)=\"deleteItem()\"\n                    (keydown.delete)=\"deleteItem()\"\n                ></i>\n            </div>\n        }\n    }\n</div>\n\n@if (hasHint) {\n    <div class=\"kbq-file-upload__hint\">\n        <ng-content select=\"kbq-hint\" />\n    </div>\n}\n", styles: [".kbq-file-upload{box-sizing:border-box;display:flex;align-items:center;position:relative}.kbq-file-upload .kbq-file-dropzone,.kbq-file-upload .kbq-file-item{display:flex;align-items:center}.kbq-file-upload .kbq-ellipsis-center{position:relative;display:flex}.kbq-file-upload .kbq-ellipsis-center .kbq-ellipsis-center_data-text-start{flex:0 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:pre}.kbq-file-upload .kbq-ellipsis-center .kbq-ellipsis-center_data-text-end{flex:1 0 auto;overflow:hidden;white-space:pre}.kbq-file-upload__hint .kbq-hint{margin-top:var(--kbq-size-xxs)}.kbq-single-file-upload .kbq-file-upload{background-color:var(--kbq-file-upload-single-default-container-background);border-color:var(--kbq-file-upload-single-default-container-border)!important}.kbq-single-file-upload .kbq-file-upload .kbq-focused,.kbq-single-file-upload .kbq-file-upload .kbq-link.kbq-focused{border:2px solid var(--kbq-file-upload-single-states-focused-focus-outline-color)}.kbq-single-file-upload .kbq-file-upload:not(.kbq-disabled,.kbq-error) .kbq-file-upload__action{color:var(--kbq-file-upload-single-default-icon-button-color)}.kbq-single-file-upload .kbq-file-upload:not(.kbq-disabled,.kbq-error) .kbq-file-dropzone__icon{color:var(--kbq-file-upload-single-default-upload-icon-color)}.kbq-single-file-upload .kbq-file-upload:not(.kbq-disabled,.kbq-error) .kbq-file-item__text-wrapper .kbq-icon.kbq-empty{color:var(--kbq-file-upload-single-default-left-icon-color)}.kbq-single-file-upload .kbq-file-upload:not(.kbq-disabled,.kbq-error) .kbq-file-item__size{color:var(--kbq-file-upload-single-default-file-size-text-color)}.kbq-single-file-upload .kbq-file-upload.kbq-file-drop_dragover{background-color:var(--kbq-file-upload-single-states-on-drag-container-background);border-color:var(--kbq-file-upload-single-states-on-drag-container-border)!important}.kbq-single-file-upload .kbq-file-upload.kbq-error:not(.kbq-disabled):not(.kbq-file-drop_dragover){background-color:var(--kbq-file-upload-single-states-error-container-background);border-color:var(--kbq-file-upload-single-states-error-container-border)!important}.kbq-single-file-upload .kbq-file-upload.kbq-error:not(.kbq-disabled) .kbq-file-dropzone__icon{color:var(--kbq-file-upload-single-states-error-upload-icon-color)}.kbq-single-file-upload .kbq-file-upload.kbq-error:not(.kbq-disabled) .kbq-file-item__text-wrapper .kbq-icon.kbq-empty{color:var(--kbq-file-upload-single-states-error-left-icon-color)}.kbq-single-file-upload .kbq-file-upload.kbq-error:not(.kbq-disabled) .kbq-file-item__text,.kbq-single-file-upload .kbq-file-upload.kbq-error:not(.kbq-disabled) .kbq-file-dropzone__text:not(.kbq-link){color:var(--kbq-file-upload-single-states-error-text-block-color)}.kbq-single-file-upload .kbq-file-upload.kbq-error:not(.kbq-disabled) .kbq-file-item__size{color:var(--kbq-file-upload-single-states-error-file-size-text-color)}.kbq-single-file-upload .kbq-file-upload.kbq-error:not(.kbq-disabled) .kbq-file-upload__action{color:var(--kbq-file-upload-single-states-error-icon-button-color)}.kbq-single-file-upload .kbq-file-upload.kbq-disabled{background-color:var(--kbq-file-upload-single-states-disabled-container-background);border-color:var(--kbq-file-upload-single-states-disabled-container-border)!important}.kbq-single-file-upload .kbq-file-upload.kbq-disabled .kbq-file-dropzone__icon{color:var(--kbq-file-upload-single-states-disabled-upload-icon-color)}.kbq-single-file-upload .kbq-file-upload.kbq-disabled .kbq-file-item__text-wrapper .kbq-icon.kbq-empty{color:var(--kbq-file-upload-single-states-disabled-left-icon-color)}.kbq-single-file-upload .kbq-file-upload.kbq-disabled .kbq-file-dropzone__text,.kbq-single-file-upload .kbq-file-upload.kbq-disabled .kbq-file-item__text{color:var(--kbq-file-upload-single-states-disabled-text-block-color)}.kbq-single-file-upload .kbq-file-upload.kbq-disabled .kbq-file-item__size{color:var(--kbq-file-upload-single-states-disabled-file-size-text-color)}.kbq-single-file-upload .kbq-file-upload.kbq-disabled .kbq-file-upload__action{color:var(--kbq-file-upload-single-states-disabled-icon-button-color)}.kbq-multiple-file-upload .kbq-file-upload{background-color:var(--kbq-file-upload-multiple-default-container-background);border-color:var(--kbq-file-upload-multiple-default-container-border)!important}.kbq-multiple-file-upload .kbq-file-upload .kbq-focused:not(.kbq-list-option),.kbq-multiple-file-upload .kbq-file-upload .kbq-link.kbq-focused{border:2px solid var(--kbq-file-upload-multiple-states-focused-focus-outline-color)}.kbq-multiple-file-upload .kbq-file-upload .kbq-file-btn-upload{border-top-color:var(--kbq-file-upload-multiple-default-container-border)}.kbq-multiple-file-upload .kbq-file-upload .kbq-file-multiple-uploaded__header{color:var(--kbq-foreground-contrast-secondary);border-bottom-color:var(--kbq-file-upload-multiple-default-grid-divider-color)}.kbq-multiple-file-upload .kbq-file-upload:not(.kbq-disabled,.kbq-error) .kbq-file-dropzone__icon{color:var(--kbq-file-upload-multiple-default-upload-icon-color)}.kbq-multiple-file-upload .kbq-file-upload.kbq-file-drop_dragover{background-color:var(--kbq-file-upload-multiple-states-on-drag-container-background);border-color:var(--kbq-file-upload-multiple-states-on-drag-container-border)!important}.kbq-multiple-file-upload .kbq-file-upload.kbq-file-drop_dragover .kbq-file-btn-upload{border-top-color:var(--kbq-file-upload-multiple-states-on-drag-container-border)}.kbq-multiple-file-upload .kbq-file-upload.kbq-file-drop_dragover .kbq-file-multiple-uploaded__header{border-bottom-color:var(--kbq-file-upload-multiple-states-on-drag-grid-divider-color)!important}.kbq-multiple-file-upload .kbq-file-upload.kbq-file-drop_dragover .kbq-file-dropzone__icon{color:var(--kbq-file-upload-multiple-states-on-drag-upload-icon-color)}.kbq-multiple-file-upload .kbq-file-upload.kbq-disabled{background-color:var(--kbq-file-upload-multiple-states-disabled-container-background);border-color:var(--kbq-file-upload-multiple-states-disabled-container-border)!important}.kbq-multiple-file-upload .kbq-file-upload.kbq-disabled .kbq-file-dropzone__icon{color:var(--kbq-file-upload-multiple-states-disabled-upload-icon-color)}.kbq-multiple-file-upload .kbq-file-upload.kbq-disabled .kbq-file-dropzone__text,.kbq-multiple-file-upload .kbq-file-upload.kbq-disabled .kbq-file-multiple-uploaded__header{color:var(--kbq-file-upload-multiple-states-disabled-text-block-color)}.kbq-multiple-file-upload .kbq-file-upload.kbq-disabled .kbq-file-multiple-uploaded__header{border-bottom-color:var(--kbq-file-upload-multiple-states-disabled-grid-divider-color)!important}.kbq-multiple-file-upload .kbq-file-upload.kbq-disabled .kbq-file-multiple__uploaded-item .kbq-file-upload__file .kbq-icon.kbq-empty{color:var(--kbq-file-upload-multiple-states-disabled-left-icon-color)}.kbq-multiple-file-upload .kbq-file-upload.kbq-disabled .kbq-file-multiple__uploaded-item .kbq-file-item__text,.kbq-multiple-file-upload .kbq-file-upload.kbq-disabled .kbq-file-multiple__uploaded-item .kbq-file-upload__size{color:var(--kbq-file-upload-multiple-states-disabled-text-block-color)}.kbq-multiple-file-upload .kbq-file-upload.kbq-disabled .kbq-file-multiple__uploaded-item .kbq-file-upload__action .kbq-icon.kbq-empty{color:var(--kbq-file-upload-multiple-states-disabled-icon-button-color)}.kbq-multiple-file-upload .kbq-file-upload:not(.kbq-disabled).kbq-error{background-color:var(--kbq-background-error-less);border-color:var(--kbq-line-error)!important}.kbq-multiple-file-upload .kbq-file-upload:not(.kbq-disabled).kbq-error .kbq-file-dropzone__icon{color:var(--kbq-file-upload-multiple-states-error-upload-icon-color)}.kbq-multiple-file-upload .kbq-file-upload:not(.kbq-disabled).kbq-error .kbq-file-dropzone__text:not(.kbq-link),.kbq-multiple-file-upload .kbq-file-upload:not(.kbq-disabled).kbq-error .kbq-file-multiple-uploaded__header{color:var(--kbq-file-upload-multiple-states-error-text-block-color)}.kbq-multiple-file-upload .kbq-file-upload:not(.kbq-disabled) .kbq-file-multiple__uploaded-item:has(.kbq-file-upload__row.kbq-error){background-color:var(--kbq-background-error-less)}.kbq-multiple-file-upload .kbq-file-upload:not(.kbq-disabled) .kbq-file-multiple__uploaded-item:has(.kbq-file-upload__row.kbq-error) .kbq-file-item__text,.kbq-multiple-file-upload .kbq-file-upload:not(.kbq-disabled) .kbq-file-multiple__uploaded-item:has(.kbq-file-upload__row.kbq-error) .kbq-file-upload__size{color:var(--kbq-foreground-error)}.kbq-multiple-file-upload .kbq-file-upload:not(.kbq-disabled) .kbq-file-multiple__uploaded-item:has(.kbq-file-upload__row.kbq-error) .kbq-file-upload__file .kbq-icon.kbq-empty{color:var(--kbq-file-upload-multiple-states-error-left-icon-color)}.kbq-multiple-file-upload .kbq-file-upload:not(.kbq-disabled) .kbq-file-multiple__uploaded-item:has(.kbq-file-upload__row.kbq-error) .kbq-file-upload__action .kbq-icon.kbq-empty{color:var(--kbq-file-upload-multiple-states-error-icon-button-color)}.kbq-multiple-file-upload .kbq-file-upload .kbq-file-multiple__uploaded-item .kbq-file-upload__file .kbq-icon.kbq-empty{color:var(--kbq-file-upload-multiple-default-left-icon-color)}.kbq-multiple-file-upload .kbq-file-upload .kbq-file-multiple__uploaded-item .kbq-file-upload__size{color:var(--kbq-file-upload-multiple-default-file-size-text-color)}.kbq-multiple-file-upload .kbq-file-upload .kbq-file-multiple__uploaded-item .kbq-file-upload__action .kbq-icon.kbq-empty{color:var(--kbq-file-upload-multiple-default-icon-button-color)}:where(.kbq-file-upload__hint .kbq-hint){color:var(--kbq-foreground-contrast-secondary)}.kbq-file-upload,.kbq-single-file-upload .kbq-file-item__text-wrapper,.kbq-single-file-upload .kbq-file-dropzone__text{font-size:var(--kbq-typography-text-normal-font-size);font-style:var(--kbq-typography-text-normal-font-style);font-weight:var(--kbq-typography-text-normal-font-weight);line-height:var(--kbq-typography-text-normal-line-height);font-family:var(--kbq-typography-text-normal-font-family);text-transform:var(--kbq-typography-text-normal-text-transform);font-feature-settings:var(--kbq-typography-text-normal-font-feature-settings);letter-spacing:var(--kbq-typography-text-normal-letter-spacing)}.kbq-multiple-file-upload .kbq-file-multiple__header{font-size:var(--kbq-typography-subheading-font-size);font-style:var(--kbq-typography-subheading-font-style);font-weight:var(--kbq-typography-subheading-font-weight);line-height:var(--kbq-typography-subheading-line-height);font-family:var(--kbq-typography-subheading-font-family);text-transform:var(--kbq-typography-subheading-text-transform);font-feature-settings:var(--kbq-typography-subheading-font-feature-settings);letter-spacing:var(--kbq-typography-subheading-letter-spacing)}.kbq-multiple-file-upload .kbq-file-multiple__caption,.kbq-multiple-file-upload .kbq-file-multiple__caption .kbq-link,.kbq-multiple-file-upload .kbq-file-multiple-uploaded__header,.kbq-multiple-file-upload .kbq-file-multiple__uploaded-item,.kbq-multiple-file-upload .kbq-file-upload .kbq-list-item,.kbq-multiple-file-upload .kbq-file-upload .kbq-list-option{font-size:var(--kbq-typography-text-normal-font-size);font-style:var(--kbq-typography-text-normal-font-style);font-weight:var(--kbq-typography-text-normal-font-weight);line-height:var(--kbq-typography-text-normal-line-height);font-family:var(--kbq-typography-text-normal-font-family);text-transform:var(--kbq-typography-text-normal-text-transform);font-feature-settings:var(--kbq-typography-text-normal-font-feature-settings);letter-spacing:var(--kbq-typography-text-normal-letter-spacing)}.kbq-file-upload__hint .kbq-hint .kbq-hint__text{font-size:var(--kbq-typography-text-compact-font-size);font-style:var(--kbq-typography-text-compact-font-style);font-weight:var(--kbq-typography-text-compact-font-weight);line-height:var(--kbq-typography-text-compact-line-height);font-family:var(--kbq-typography-text-compact-font-family);text-transform:var(--kbq-typography-text-compact-text-transform);font-feature-settings:var(--kbq-typography-text-compact-font-feature-settings);letter-spacing:var(--kbq-typography-text-compact-letter-spacing)}\n", ":where(.kbq-file-upload){--kbq-form-field-hint-text: var(--kbq-foreground-contrast-secondary)}:where(.kbq-single-file-upload){--kbq-file-upload-size-single-container-border-radius: var(--kbq-size-s);--kbq-file-upload-size-single-container-border-width: 1px;--kbq-file-upload-size-single-container-content-gap-horizontal: var(--kbq-size-s);--kbq-file-upload-size-single-container-padding-vertical: var(--kbq-size-m);--kbq-file-upload-size-single-container-padding-horizontal: var(--kbq-size-m);--kbq-file-upload-size-single-text-block-padding-vertical: var(--kbq-size-3xs);--kbq-file-upload-size-single-text-block-content-gap-horizontal: var(--kbq-size-xxs);--kbq-file-upload-single-min-height: var(--kbq-size-5xl);--kbq-file-upload-single-default-container-border: var(--kbq-line-contrast-fade);--kbq-file-upload-single-default-container-background: var(--kbq-background-bg);--kbq-file-upload-single-default-upload-icon-color: var(--kbq-icon-contrast-fade);--kbq-file-upload-single-default-left-icon-color: var(--kbq-icon-contrast-fade);--kbq-file-upload-single-default-text-block-color: var(--kbq-foreground-contrast);--kbq-file-upload-single-default-icon-button-color: var(--kbq-icon-contrast);--kbq-file-upload-single-default-file-size-text-color: var(--kbq-foreground-contrast-secondary);--kbq-file-upload-single-states-on-drag-container-border: var(--kbq-line-theme-fade);--kbq-file-upload-single-states-on-drag-container-background: var(--kbq-background-theme-fade);--kbq-file-upload-single-states-on-drag-upload-icon-color: var(--kbq-icon-contrast-fade);--kbq-file-upload-single-states-on-drag-left-icon-color: var(--kbq-icon-contrast-fade);--kbq-file-upload-single-states-on-drag-text-block-color: var(--kbq-foreground-contrast);--kbq-file-upload-single-states-error-container-border: var(--kbq-line-error);--kbq-file-upload-single-states-error-container-background: var(--kbq-background-error-less);--kbq-file-upload-single-states-error-upload-icon-color: var(--kbq-icon-error);--kbq-file-upload-single-states-error-left-icon-color: var(--kbq-icon-error);--kbq-file-upload-single-states-error-text-block-color: var(--kbq-foreground-error);--kbq-file-upload-single-states-error-icon-button-color: var(--kbq-icon-error);--kbq-file-upload-single-states-error-file-size-text-color: var(--kbq-foreground-error);--kbq-file-upload-single-states-disabled-container-border: var(--kbq-states-line-disabled);--kbq-file-upload-single-states-disabled-container-background: var(--kbq-states-background-disabled);--kbq-file-upload-single-states-disabled-upload-icon-color: var(--kbq-states-icon-disabled);--kbq-file-upload-single-states-disabled-left-icon-color: var(--kbq-states-icon-disabled);--kbq-file-upload-single-states-disabled-icon-button-color: var(--kbq-states-icon-disabled);--kbq-file-upload-single-states-disabled-text-block-color: var(--kbq-states-foreground-disabled);--kbq-file-upload-single-states-disabled-file-size-text-color: var(--kbq-states-foreground-disabled);--kbq-file-upload-single-states-focused-focus-outline-color: var(--kbq-states-line-focus-theme)}:where(.kbq-multiple-file-upload){--kbq-file-upload-size-multiple-big-container-min-height: 192px;--kbq-file-upload-size-multiple-big-container-min-width: 320px;--kbq-file-upload-size-multiple-big-container-border-radius: var(--kbq-size-s);--kbq-file-upload-size-multiple-big-container-border-width: 1px;--kbq-file-upload-size-multiple-big-container-content-gap-horizontal: var(--kbq-size-m);--kbq-file-upload-size-multiple-big-container-padding-vertical: var(--kbq-size-xxl);--kbq-file-upload-size-multiple-big-container-padding-horizontal: var(--kbq-size-xxl);--kbq-file-upload-size-multiple-big-dropzone-content-gap-horizontal: var(--kbq-size-s);--kbq-file-upload-size-multiple-big-text-block-content-gap-vertical: 0px;--kbq-file-upload-size-multiple-big-text-block-content-gap-horizontal: var(--kbq-size-xxs);--kbq-file-upload-size-multiple-big-grid-cell-padding-horizontal: var(--kbq-size-s);--kbq-file-upload-size-multiple-big-grid-cell-padding-vertical: var(--kbq-size-s);--kbq-file-upload-size-multiple-big-grid-cell-content-gap-horizontal: var(--kbq-size-xxs);--kbq-file-upload-size-multiple-big-grid-cell-file-size-width: var(--kbq-size-7xl);--kbq-file-upload-multiple-default-container-border: var(--kbq-line-contrast-fade);--kbq-file-upload-multiple-default-container-background: var(--kbq-background-bg);--kbq-file-upload-multiple-default-upload-icon-color: var(--kbq-icon-contrast-fade);--kbq-file-upload-multiple-default-left-icon-color: var(--kbq-icon-contrast-fade);--kbq-file-upload-multiple-default-text-block-color: var(--kbq-foreground-contrast);--kbq-file-upload-multiple-default-icon-button-color: var(--kbq-icon-contrast);--kbq-file-upload-multiple-default-grid-divider-color: var(--kbq-line-contrast-less);--kbq-file-upload-multiple-default-file-size-text-color: var(--kbq-foreground-contrast-secondary);--kbq-file-upload-multiple-states-on-drag-container-border: var(--kbq-line-theme-fade);--kbq-file-upload-multiple-states-on-drag-container-background: var(--kbq-background-theme-fade);--kbq-file-upload-multiple-states-on-drag-upload-icon-color: var(--kbq-icon-contrast-fade);--kbq-file-upload-multiple-states-on-drag-left-icon-color: var(--kbq-icon-contrast-fade);--kbq-file-upload-multiple-states-on-drag-icon-button-color: var(--kbq-icon-contrast);--kbq-file-upload-multiple-states-on-drag-text-block-color: var(--kbq-foreground-contrast);--kbq-file-upload-multiple-states-on-drag-grid-divider-color: var(--kbq-line-contrast-less);--kbq-file-upload-multiple-states-error-grid-cell-background: var(--kbq-background-error-less);--kbq-file-upload-multiple-states-error-upload-icon-color: var(--kbq-icon-error);--kbq-file-upload-multiple-states-error-left-icon-color: var(--kbq-icon-error);--kbq-file-upload-multiple-states-error-text-block-color: var(--kbq-foreground-error);--kbq-file-upload-multiple-states-error-icon-button-color: var(--kbq-icon-error);--kbq-file-upload-multiple-states-disabled-container-border: var(--kbq-states-line-disabled);--kbq-file-upload-multiple-states-disabled-container-background: var(--kbq-states-background-disabled);--kbq-file-upload-multiple-states-disabled-upload-icon-color: var(--kbq-states-icon-disabled);--kbq-file-upload-multiple-states-disabled-left-icon-color: var(--kbq-states-icon-disabled);--kbq-file-upload-multiple-states-disabled-icon-button-color: var(--kbq-states-icon-disabled);--kbq-file-upload-multiple-states-disabled-text-block-color: var(--kbq-states-foreground-disabled);--kbq-file-upload-multiple-states-disabled-grid-divider-color: var(--kbq-states-line-disabled);--kbq-file-upload-multiple-states-focused-focus-outline-color: var(--kbq-states-line-focus-theme)}:where(.kbq-file-upload.kbq-file-upload_compact){--kbq-file-upload-multiple-compact-container-content-gap-horizontal: var(--kbq-size-s);--kbq-file-upload-multiple-compact-text-block-padding-vertical: var(--kbq-size-3xs);--kbq-file-upload-multiple-compact-container-padding-vertical: 11px;--kbq-file-upload-multiple-compact-container-padding-horizontal: 11px}\n", ".kbq-single-file-upload .kbq-file-upload{padding:calc(var(--kbq-file-upload-size-single-container-padding-vertical) - var(--kbq-file-upload-size-single-container-border-width)) calc(var(--kbq-file-upload-size-single-container-padding-horizontal) - var(--kbq-file-upload-size-single-container-border-width));min-height:var(--kbq-file-upload-single-min-height);border-radius:var(--kbq-file-upload-size-single-container-border-radius);border-width:var(--kbq-file-upload-size-single-container-border-width);border-style:dashed}.kbq-single-file-upload .kbq-file-upload .kbq-file-dropzone__text{padding-top:var(--kbq-file-upload-size-single-text-block-padding-vertical);padding-bottom:var(--kbq-file-upload-size-single-text-block-padding-vertical);gap:var(--kbq-file-upload-size-single-text-block-content-gap-horizontal)}.kbq-single-file-upload .kbq-file-upload .kbq-file-dropzone{gap:var(--kbq-file-upload-size-single-container-content-gap-horizontal)}.kbq-single-file-upload .kbq-file-upload .kbq-file-item{width:100%}.kbq-single-file-upload .kbq-file-upload .kbq-file-item .kbq-file-item__text-wrapper{display:flex;align-items:center;width:100%;gap:var(--kbq-file-upload-size-single-container-content-gap-horizontal)}.kbq-single-file-upload .kbq-file-upload .kbq-file-item .kbq-file-item__text-wrapper .kbq-file-item__text{width:120px;flex-grow:1}.kbq-single-file-upload .kbq-file-upload .kbq-file-item .kbq-file-item__size{padding:0 var(--kbq-size-s)}.kbq-single-file-upload .kbq-file-upload .kbq-file-item .kbq-file-upload__action{padding:var(--kbq-size-xxs)}\n"] }]
        }], ctorParameters: () => [], propDecorators: { progressMode: [{
                type: Input
            }], accept: [{
                type: Input
            }], disabled: [{
                type: Input
            }], errors: [{
                type: Input
            }], inputId: [{
                type: Input
            }], customValidation: [{
                type: Input
            }], errorStateMatcher: [{
                type: Input
            }], file: [{
                type: Input
            }], showFileSize: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], fileChange: [{
                type: Output,
                args: ['fileQueueChange']
            }], input: [{
                type: ViewChild,
                args: ['input']
            }], hint: [{
                type: ContentChildren,
                args: [KbqHint]
            }] } });
//# sourceMappingURL=data:application/json;base64, 