import * as i1 from '@angular/common';
import { CommonModule } from '@angular/common';
import * as i0 from '@angular/core';
import { EventEmitter, TemplateRef, Component, Input, Output, ContentChild, ViewChild, ContentChildren, NgModule } from '@angular/core';
import * as i3$1 from '@angular/forms';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import * as i2$1 from 'primeng/inputtext';
import { InputTextModule } from 'primeng/inputtext';
import * as i2 from 'primeng/tooltip';
import { TooltipModule } from 'primeng/tooltip';
import * as i4 from '@seniorsistemas/angular-components/button';
import { ButtonModule } from '@seniorsistemas/angular-components/button';
import * as i6 from '@seniorsistemas/angular-components/empty-state';
import { EmptyStateModule } from '@seniorsistemas/angular-components/empty-state';
import { InfiniteScrollModule } from '@seniorsistemas/angular-components/infinite-scroll';
import * as i5 from '@seniorsistemas/angular-components/loading-state';
import { LoadingStateModule } from '@seniorsistemas/angular-components/loading-state';
import * as i3 from '@seniorsistemas/angular-components/thumbnail';
import { ThumbnailComponent, ThumbnailModule } from '@seniorsistemas/angular-components/thumbnail';
import { trigger, state, style, transition, animate } from '@angular/animations';
import { isNullOrUndefined } from '@seniorsistemas/angular-components/utils';

class GlobalSearchDropdownItemComponent {
    static nextId = 0;
    id = `s-global-search-dropdown-item-${GlobalSearchDropdownItemComponent.nextId++}`;
    primaryLabel;
    secondaryEmptyLabel;
    tertiaryEmptyLabel;
    imageSource;
    imageAlt;
    iconClass;
    secondaryLabel;
    tertiaryLabel;
    size = 'standart';
    template = null;
    buttonClick = new EventEmitter();
    thumbnailComponent = null;
    content = null;
    isMediumSize() {
        return this.size === 'medium';
    }
    isSmallSize() {
        return this.size === 'small';
    }
    getImageSize() {
        return this._isStandardSize() ? 'medium' : 'small';
    }
    _isStandardSize() {
        return this.size === 'standart';
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: GlobalSearchDropdownItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: GlobalSearchDropdownItemComponent, selector: "s-global-search-dropdown-item", inputs: { id: "id", primaryLabel: "primaryLabel", secondaryEmptyLabel: "secondaryEmptyLabel", tertiaryEmptyLabel: "tertiaryEmptyLabel", imageSource: "imageSource", imageAlt: "imageAlt", iconClass: "iconClass", secondaryLabel: "secondaryLabel", tertiaryLabel: "tertiaryLabel", size: "size", template: "template" }, outputs: { buttonClick: "buttonClick" }, queries: [{ propertyName: "thumbnailComponent", first: true, predicate: ThumbnailComponent, descendants: true, static: true }], viewQueries: [{ propertyName: "content", first: true, predicate: TemplateRef, descendants: true, static: true }], ngImport: i0, template: "<ng-template>\n    <div class=\"global-search-dropdown-item\" [class.ui-grid]=\"isSmallSize()\">\n        <ng-content select=\"s-thumbnail\"></ng-content>\n\n        @if (!thumbnailComponent && (imageSource || iconClass) && !isSmallSize()) {\n            <s-thumbnail\n                [id]=\"id + '-thumbnail'\"\n                [imageSource]=\"imageSource\"\n                [imageAlt]=\"imageAlt || primaryLabel\"\n                [iconClass]=\"iconClass ?? ''\"\n                [size]=\"getImageSize()\"\n            ></s-thumbnail>\n        }\n\n        <div class=\"global-search-item__container {{ !isSmallSize() ? 'global-search-item__container--width-60' : '' }}\">\n            <div #titleTemplate>\n                <ng-content select=\"[titleTemplate]\"></ng-content>\n            </div>\n            @if (!titleTemplate.children.length) {\n                <s-button\n                    styleClass=\"no-padding\"\n                    class=\"{{ isSmallSize() ? 'ui-grid-col-6 no-padding' : '' }}\"\n                    [id]=\"id + '-title'\"\n                    priority=\"link\"\n                    [pTooltip]=\"primaryLabel\"\n                    [label]=\"primaryLabel\"\n                    size=\"small\"\n                    (clicked)=\"buttonClick.emit()\"\n                >\n                </s-button>\n            }\n\n            <div #labelTemplate>\n                <ng-content select=\"[labelTemplate]\"></ng-content>\n            </div>\n\n            @if (!labelTemplate.children.length) {\n                <span\n                    [id]=\"id + '-label'\"\n                    [ngClass]=\"{\n                        'ui-grid-col-6 global-search-item__text-align--right': isSmallSize(),\n                        'global-search-item__italic': !secondaryLabel,\n                    }\"\n                    class=\"label\"\n                    [pTooltip]=\"secondaryLabel\"\n                    tooltipPosition=\"top\"\n                    showDelay=\"500\"\n                    >{{ secondaryLabel ? secondaryLabel : secondaryEmptyLabel }}</span\n                >\n            }\n\n            <div #descriptionTemplate>\n                <ng-content select=\"[descriptionTemplate]\"></ng-content>\n            </div>\n\n            @if (!descriptionTemplate.children.length && !isMediumSize() && !isSmallSize()) {\n                <span\n                    [id]=\"id + '-description'\"\n                    class=\"description\"\n                    [ngClass]=\"{ 'global-search-item__italic': !secondaryLabel }\"\n                    [pTooltip]=\"tertiaryLabel\"\n                    tooltipPosition=\"top\"\n                    showDelay=\"500\"\n                >\n                    {{ tertiaryLabel ? tertiaryLabel : tertiaryEmptyLabel }}\n                </span>\n            }\n        </div>\n        @if (!isSmallSize()) {\n            <div class=\"global-search-item__container--width-40 global-search__dropdown--template\">\n                <ng-container *ngTemplateOutlet=\"template\"></ng-container>\n            </div>\n        }\n    </div>\n</ng-template>\n", styles: [".global-search-dropdown{align-items:center;display:flex;height:100%;border-bottom:solid 1px #ccc;padding:15px 5px;margin:0 10px}::ng-deep .no-padding{padding:0!important;min-width:0px!important}::ng-deep .s-button-with-text{min-width:0px!important}.global-search-item__italic{font-style:italic}.global-search-item__container{margin-left:10px;width:100%}.global-search-item__container,.global-search-item__container span{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.global-search-item__container .label{color:#333;display:block}.global-search-item__container .description{color:#999;display:block}.global-search-item__container--width-60{width:60%}.global-search-item__container--width-40{width:40%}.global-search-item__text-align--right{text-align:right;padding:2px 0 0 15px}.global-search__dropdown--template{display:flex;flex-direction:column;text-align:right!important}@media all and (-ms-high-contrast: none),(-ms-high-contrast: active){.global-search-item__container{flex:1}}@media (max-width: 767px){.global-search-item__container,.global-search-item__container span{white-space:normal}}.global-search-item__container:only-child{margin-left:0}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "component", type: i3.ThumbnailComponent, selector: "s-thumbnail", inputs: ["id", "size", "imageSource", "imageFallback", "imageAlt", "iconClass", "hasAction", "actionIconClass", "isTile", "isBrand"] }, { kind: "component", type: i4.ButtonComponent, selector: "s-button", inputs: ["id", "label", "tooltip", "tooltipPosition", "iconClass", "rightIconClass", "caret", "styleClass", "baseZIndex", "disabled", "auxiliary", "type", "priority", "menuOptions", "size", "slide", "animation", "badge", "iconColor"], outputs: ["clicked"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: GlobalSearchDropdownItemComponent, decorators: [{
            type: Component,
            args: [{ selector: 's-global-search-dropdown-item', template: "<ng-template>\n    <div class=\"global-search-dropdown-item\" [class.ui-grid]=\"isSmallSize()\">\n        <ng-content select=\"s-thumbnail\"></ng-content>\n\n        @if (!thumbnailComponent && (imageSource || iconClass) && !isSmallSize()) {\n            <s-thumbnail\n                [id]=\"id + '-thumbnail'\"\n                [imageSource]=\"imageSource\"\n                [imageAlt]=\"imageAlt || primaryLabel\"\n                [iconClass]=\"iconClass ?? ''\"\n                [size]=\"getImageSize()\"\n            ></s-thumbnail>\n        }\n\n        <div class=\"global-search-item__container {{ !isSmallSize() ? 'global-search-item__container--width-60' : '' }}\">\n            <div #titleTemplate>\n                <ng-content select=\"[titleTemplate]\"></ng-content>\n            </div>\n            @if (!titleTemplate.children.length) {\n                <s-button\n                    styleClass=\"no-padding\"\n                    class=\"{{ isSmallSize() ? 'ui-grid-col-6 no-padding' : '' }}\"\n                    [id]=\"id + '-title'\"\n                    priority=\"link\"\n                    [pTooltip]=\"primaryLabel\"\n                    [label]=\"primaryLabel\"\n                    size=\"small\"\n                    (clicked)=\"buttonClick.emit()\"\n                >\n                </s-button>\n            }\n\n            <div #labelTemplate>\n                <ng-content select=\"[labelTemplate]\"></ng-content>\n            </div>\n\n            @if (!labelTemplate.children.length) {\n                <span\n                    [id]=\"id + '-label'\"\n                    [ngClass]=\"{\n                        'ui-grid-col-6 global-search-item__text-align--right': isSmallSize(),\n                        'global-search-item__italic': !secondaryLabel,\n                    }\"\n                    class=\"label\"\n                    [pTooltip]=\"secondaryLabel\"\n                    tooltipPosition=\"top\"\n                    showDelay=\"500\"\n                    >{{ secondaryLabel ? secondaryLabel : secondaryEmptyLabel }}</span\n                >\n            }\n\n            <div #descriptionTemplate>\n                <ng-content select=\"[descriptionTemplate]\"></ng-content>\n            </div>\n\n            @if (!descriptionTemplate.children.length && !isMediumSize() && !isSmallSize()) {\n                <span\n                    [id]=\"id + '-description'\"\n                    class=\"description\"\n                    [ngClass]=\"{ 'global-search-item__italic': !secondaryLabel }\"\n                    [pTooltip]=\"tertiaryLabel\"\n                    tooltipPosition=\"top\"\n                    showDelay=\"500\"\n                >\n                    {{ tertiaryLabel ? tertiaryLabel : tertiaryEmptyLabel }}\n                </span>\n            }\n        </div>\n        @if (!isSmallSize()) {\n            <div class=\"global-search-item__container--width-40 global-search__dropdown--template\">\n                <ng-container *ngTemplateOutlet=\"template\"></ng-container>\n            </div>\n        }\n    </div>\n</ng-template>\n", styles: [".global-search-dropdown{align-items:center;display:flex;height:100%;border-bottom:solid 1px #ccc;padding:15px 5px;margin:0 10px}::ng-deep .no-padding{padding:0!important;min-width:0px!important}::ng-deep .s-button-with-text{min-width:0px!important}.global-search-item__italic{font-style:italic}.global-search-item__container{margin-left:10px;width:100%}.global-search-item__container,.global-search-item__container span{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.global-search-item__container .label{color:#333;display:block}.global-search-item__container .description{color:#999;display:block}.global-search-item__container--width-60{width:60%}.global-search-item__container--width-40{width:40%}.global-search-item__text-align--right{text-align:right;padding:2px 0 0 15px}.global-search__dropdown--template{display:flex;flex-direction:column;text-align:right!important}@media all and (-ms-high-contrast: none),(-ms-high-contrast: active){.global-search-item__container{flex:1}}@media (max-width: 767px){.global-search-item__container,.global-search-item__container span{white-space:normal}}.global-search-item__container:only-child{margin-left:0}\n"] }]
        }], propDecorators: { id: [{
                type: Input
            }], primaryLabel: [{
                type: Input
            }], secondaryEmptyLabel: [{
                type: Input
            }], tertiaryEmptyLabel: [{
                type: Input
            }], imageSource: [{
                type: Input
            }], imageAlt: [{
                type: Input
            }], iconClass: [{
                type: Input
            }], secondaryLabel: [{
                type: Input
            }], tertiaryLabel: [{
                type: Input
            }], size: [{
                type: Input
            }], template: [{
                type: Input
            }], buttonClick: [{
                type: Output
            }], thumbnailComponent: [{
                type: ContentChild,
                args: [ThumbnailComponent, { static: true }]
            }], content: [{
                type: ViewChild,
                args: [TemplateRef, { static: true }]
            }] } });

class GlobalSearchComponent {
    _cdr;
    static nextId = 0;
    globalSearch = null;
    id = `s-global-search-${GlobalSearchDropdownItemComponent.nextId++}`;
    delay = 500;
    totalItensLabel;
    showMoreLabel;
    placeholder;
    isLoading = false;
    totalElements;
    emptyTitle;
    emptyDescription;
    emptyIcon;
    showFooter = true;
    dropdownItens = null;
    searched = new EventEmitter();
    focused = new EventEmitter();
    moreShown = new EventEmitter();
    search = null;
    wasSearched = false;
    isModalLoading = false;
    expanded = true;
    constructor(_cdr) {
        this._cdr = _cdr;
    }
    onChange() {
        const search = this.search;
        setTimeout(() => {
            if (this.search === search) {
                this._canShowGlobalSearchActive();
                this.searched.emit(this.search ?? '');
            }
        }, this.delay);
    }
    focusIn() {
        this.focused.emit(true);
    }
    focusOut() {
        this.focused.emit(false);
    }
    showMore() {
        this.moreShown.emit();
    }
    close() {
        this.search = null;
        this.wasSearched = false;
        this.dropdownItens = null;
        this.isModalLoading = false;
        this._removeActiveClassByGlobalSearch();
    }
    _removeActiveClassByGlobalSearch() {
        if (isNullOrUndefined(this.globalSearch))
            return;
        this.globalSearch.nativeElement.classList.remove('global-search__input-active');
    }
    _canShowGlobalSearchActive() {
        this.wasSearched = !!this.search;
        if (this.search) {
            if (isNullOrUndefined(this.globalSearch))
                return;
            this.globalSearch.nativeElement.classList.add('global-search__input-active');
        }
        else {
            this._removeActiveClassByGlobalSearch();
            this.close();
        }
        this._cdr.detectChanges();
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: GlobalSearchComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: GlobalSearchComponent, selector: "s-global-search", inputs: { id: "id", delay: "delay", totalItensLabel: "totalItensLabel", showMoreLabel: "showMoreLabel", placeholder: "placeholder", isLoading: "isLoading", totalElements: "totalElements", emptyTitle: "emptyTitle", emptyDescription: "emptyDescription", emptyIcon: "emptyIcon", showFooter: "showFooter" }, outputs: { searched: "searched", focused: "focused", moreShown: "moreShown" }, queries: [{ propertyName: "dropdownItens", predicate: GlobalSearchDropdownItemComponent }], viewQueries: [{ propertyName: "globalSearch", first: true, predicate: ["globalSearch"], descendants: true }], ngImport: i0, template: "<div class=\"p-inputGroup\">\n    <input\n        #globalSearch\n        class=\"global-search__input\"\n        [(ngModel)]=\"search\"\n        (ngModelChange)=\"onChange()\"\n        pInputText\n        [placeholder]=\"placeholder\"\n        (focus)=\"focusIn()\"\n        (blur)=\"focusOut()\"\n    />\n    <span class=\"p-inputGroup-addon global-search__span\">\n        <em class=\"fas fa-search\"></em>\n    </span>\n\n    @if (wasSearched) {\n        <div class=\"global-search__modal\">\n            <div\n                *sLoadingState=\"isLoading && !isModalLoading\"\n                class=\"global-search__loader\"\n            >\n                @if ((dropdownItens && dropdownItens.length > 0) || isLoading) {\n                    <div class=\"global-search__container\">\n                        @if (dropdownItens && dropdownItens.length > 0) {\n                            <div>\n                                <div class=\"global-search__modal--total-itens-title\">\n                                    <span class=\"ui-grid-col-11 no-space\">{{ totalItensLabel }}</span>\n                                    <span\n                                        class=\"ui-grid-col-1 no-space global-search__modal--total-itens-title-icon\"\n                                        (click)=\"close()\"\n                                    >\n                                        <em class=\"fas fa-times\"></em>\n                                    </span>\n                                </div>\n                                <div\n                                    class=\"no-space global-search__dropdown--itens\"\n                                    [@expandableContent]=\"expanded\"\n                                >\n                                    @for (item of dropdownItens; track item.id) {\n                                        <div class=\"s-object-card-field no-space global-search__dropdown--itens-container\">\n                                            <ng-container *ngTemplateOutlet=\"item.content\"></ng-container>\n                                        </div>\n                                    }\n                                </div>\n\n                                @if (showFooter) {\n                                    <div class=\"ui-grid-col-12 global-search__modal--footer\">\n                                        <s-button\n                                            class=\"global-search__show-more\"\n                                            (click)=\"showMore()\"\n                                            priority=\"link\"\n                                        >\n                                            {{ showMoreLabel }}\n                                        </s-button>\n                                    </div>\n                                }\n                            </div>\n                        }\n                    </div>\n                }\n\n                @if ((!dropdownItens || !dropdownItens.length) && !isLoading) {\n                    <s-empty-state\n                        [title]=\"emptyTitle ?? ''\"\n                        [description]=\"emptyDescription\"\n                        ngClass=\"global-search__empty-state--icon\"\n                        [iconClass]=\"emptyIcon ? emptyIcon : 'fas fa-search'\"\n                    >\n                    </s-empty-state>\n                }\n            </div>\n        </div>\n    }\n\n    @if (wasSearched) {\n        <div\n            class=\"global-search__background\"\n            (click)=\"close()\"\n        ></div>\n    }\n</div>\n", styles: [".p-inputGroup{display:flex;max-width:100%}.global-search__input{border-radius:20px 0 0 20px;border-right:none;cursor:pointer;height:25px;min-height:25px;padding:0 0 0 15px;transition:all .3s;width:136px}.global-search__input:active,.global-search__input:focus,.global-search__input-active{border-bottom:solid 1px #428bca;border-left:solid 1px #428bca;border-top:solid 1px #428bca;cursor:default;transition:all .3s;width:466px}.global-search__input:active,.global-search__input:focus+.global-search__span{border-bottom:solid 1px #428bca;border-left:none;border-right:solid 1px #428bca;border-top:solid 1px #428bca;transition:all .3s}.global-search__span{align-items:center;background:transparent;border:1px solid #ccc;border-left:none;border-radius:0 20px 20px 0;display:flex;height:25px;justify-content:center;padding:0 8px;transition:all .3s}.global-search__modal{background:#fff;border-radius:5px;box-shadow:0 2px 8px #0006;margin-top:60px;min-height:50px;position:absolute;width:500px;z-index:6}.global-search__modal--total-itens-title{border-bottom:solid 1px #ccc;color:#333;font-weight:600;height:50px;padding:15px}.global-search__modal--footer{border-top:solid 1px #ccc;height:50px}.global-search__modal--total-itens-title-icon{cursor:pointer;text-align:right}.global-search__container{min-height:50px;width:100%}.global-search__dropdown--itens{max-height:510px;overflow:auto}.global-search__dropdown--itens-container:hover{background:#dbe0e4}.global-search__background{background:#0006;cursor:pointer;height:calc(100vh - 70px);left:0;margin-top:50px;position:absolute;width:100%;z-index:5}.no-space{margin:0;padding:0}.global-search__show-more{display:flex;flex-direction:column}.global-search__show-more--button{color:#428bca!important}.modal{height:calc(100vh - 90px);left:1%;position:absolute;width:98%}.global-search__empty-state--icon{margin:42px 134px}::ng-deep s-global-search{width:100%}::ng-deep s-global-search .global-search__loader{border-radius:5px!important;width:100%}::ng-deep s-global-search .global-search__empty-state--icon .empty-state .icon{font-size:40px}::ng-deep s-global-search .s-button-priority-link{color:#428bca}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2$1.InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }, { kind: "directive", type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4.ButtonComponent, selector: "s-button", inputs: ["id", "label", "tooltip", "tooltipPosition", "iconClass", "rightIconClass", "caret", "styleClass", "baseZIndex", "disabled", "auxiliary", "type", "priority", "menuOptions", "size", "slide", "animation", "badge", "iconColor"], outputs: ["clicked"] }, { kind: "directive", type: i5.LoadingStateDirective, selector: "[sLoadingState]", inputs: ["sLoadingState"] }, { kind: "component", type: i6.EmptyStateComponent, selector: "s-empty-state", inputs: ["id", "title", "iconClass", "description", "showPrimaryAction", "showSecondaryAction", "primaryActionLabel", "secondaryActionLabel", "primaryModel"], outputs: ["primaryAction", "secondaryAction"] }], animations: [
            trigger('expandableContent', [
                state('*', style({ height: '0' })),
                state('false', style({ height: '0' })),
                state('true', style({ height: '*' })),
                transition('* => true', animate('200ms ease-out')),
                transition('false <=> true', animate('200ms ease-out')),
            ]),
        ] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: GlobalSearchComponent, decorators: [{
            type: Component,
            args: [{ selector: 's-global-search', animations: [
                        trigger('expandableContent', [
                            state('*', style({ height: '0' })),
                            state('false', style({ height: '0' })),
                            state('true', style({ height: '*' })),
                            transition('* => true', animate('200ms ease-out')),
                            transition('false <=> true', animate('200ms ease-out')),
                        ]),
                    ], template: "<div class=\"p-inputGroup\">\n    <input\n        #globalSearch\n        class=\"global-search__input\"\n        [(ngModel)]=\"search\"\n        (ngModelChange)=\"onChange()\"\n        pInputText\n        [placeholder]=\"placeholder\"\n        (focus)=\"focusIn()\"\n        (blur)=\"focusOut()\"\n    />\n    <span class=\"p-inputGroup-addon global-search__span\">\n        <em class=\"fas fa-search\"></em>\n    </span>\n\n    @if (wasSearched) {\n        <div class=\"global-search__modal\">\n            <div\n                *sLoadingState=\"isLoading && !isModalLoading\"\n                class=\"global-search__loader\"\n            >\n                @if ((dropdownItens && dropdownItens.length > 0) || isLoading) {\n                    <div class=\"global-search__container\">\n                        @if (dropdownItens && dropdownItens.length > 0) {\n                            <div>\n                                <div class=\"global-search__modal--total-itens-title\">\n                                    <span class=\"ui-grid-col-11 no-space\">{{ totalItensLabel }}</span>\n                                    <span\n                                        class=\"ui-grid-col-1 no-space global-search__modal--total-itens-title-icon\"\n                                        (click)=\"close()\"\n                                    >\n                                        <em class=\"fas fa-times\"></em>\n                                    </span>\n                                </div>\n                                <div\n                                    class=\"no-space global-search__dropdown--itens\"\n                                    [@expandableContent]=\"expanded\"\n                                >\n                                    @for (item of dropdownItens; track item.id) {\n                                        <div class=\"s-object-card-field no-space global-search__dropdown--itens-container\">\n                                            <ng-container *ngTemplateOutlet=\"item.content\"></ng-container>\n                                        </div>\n                                    }\n                                </div>\n\n                                @if (showFooter) {\n                                    <div class=\"ui-grid-col-12 global-search__modal--footer\">\n                                        <s-button\n                                            class=\"global-search__show-more\"\n                                            (click)=\"showMore()\"\n                                            priority=\"link\"\n                                        >\n                                            {{ showMoreLabel }}\n                                        </s-button>\n                                    </div>\n                                }\n                            </div>\n                        }\n                    </div>\n                }\n\n                @if ((!dropdownItens || !dropdownItens.length) && !isLoading) {\n                    <s-empty-state\n                        [title]=\"emptyTitle ?? ''\"\n                        [description]=\"emptyDescription\"\n                        ngClass=\"global-search__empty-state--icon\"\n                        [iconClass]=\"emptyIcon ? emptyIcon : 'fas fa-search'\"\n                    >\n                    </s-empty-state>\n                }\n            </div>\n        </div>\n    }\n\n    @if (wasSearched) {\n        <div\n            class=\"global-search__background\"\n            (click)=\"close()\"\n        ></div>\n    }\n</div>\n", styles: [".p-inputGroup{display:flex;max-width:100%}.global-search__input{border-radius:20px 0 0 20px;border-right:none;cursor:pointer;height:25px;min-height:25px;padding:0 0 0 15px;transition:all .3s;width:136px}.global-search__input:active,.global-search__input:focus,.global-search__input-active{border-bottom:solid 1px #428bca;border-left:solid 1px #428bca;border-top:solid 1px #428bca;cursor:default;transition:all .3s;width:466px}.global-search__input:active,.global-search__input:focus+.global-search__span{border-bottom:solid 1px #428bca;border-left:none;border-right:solid 1px #428bca;border-top:solid 1px #428bca;transition:all .3s}.global-search__span{align-items:center;background:transparent;border:1px solid #ccc;border-left:none;border-radius:0 20px 20px 0;display:flex;height:25px;justify-content:center;padding:0 8px;transition:all .3s}.global-search__modal{background:#fff;border-radius:5px;box-shadow:0 2px 8px #0006;margin-top:60px;min-height:50px;position:absolute;width:500px;z-index:6}.global-search__modal--total-itens-title{border-bottom:solid 1px #ccc;color:#333;font-weight:600;height:50px;padding:15px}.global-search__modal--footer{border-top:solid 1px #ccc;height:50px}.global-search__modal--total-itens-title-icon{cursor:pointer;text-align:right}.global-search__container{min-height:50px;width:100%}.global-search__dropdown--itens{max-height:510px;overflow:auto}.global-search__dropdown--itens-container:hover{background:#dbe0e4}.global-search__background{background:#0006;cursor:pointer;height:calc(100vh - 70px);left:0;margin-top:50px;position:absolute;width:100%;z-index:5}.no-space{margin:0;padding:0}.global-search__show-more{display:flex;flex-direction:column}.global-search__show-more--button{color:#428bca!important}.modal{height:calc(100vh - 90px);left:1%;position:absolute;width:98%}.global-search__empty-state--icon{margin:42px 134px}::ng-deep s-global-search{width:100%}::ng-deep s-global-search .global-search__loader{border-radius:5px!important;width:100%}::ng-deep s-global-search .global-search__empty-state--icon .empty-state .icon{font-size:40px}::ng-deep s-global-search .s-button-priority-link{color:#428bca}\n"] }]
        }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { globalSearch: [{
                type: ViewChild,
                args: ['globalSearch', { static: false }]
            }], id: [{
                type: Input
            }], delay: [{
                type: Input
            }], totalItensLabel: [{
                type: Input,
                args: [{ required: true }]
            }], showMoreLabel: [{
                type: Input,
                args: [{ required: true }]
            }], placeholder: [{
                type: Input
            }], isLoading: [{
                type: Input
            }], totalElements: [{
                type: Input
            }], emptyTitle: [{
                type: Input
            }], emptyDescription: [{
                type: Input
            }], emptyIcon: [{
                type: Input
            }], showFooter: [{
                type: Input
            }], dropdownItens: [{
                type: ContentChildren,
                args: [GlobalSearchDropdownItemComponent]
            }], searched: [{
                type: Output
            }], focused: [{
                type: Output
            }], moreShown: [{
                type: Output
            }] } });

class GlobalSearchModule {
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: GlobalSearchModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
    static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: GlobalSearchModule, declarations: [GlobalSearchComponent,
            GlobalSearchDropdownItemComponent], imports: [CommonModule,
            InputTextModule,
            FormsModule,
            ReactiveFormsModule,
            TooltipModule,
            ThumbnailModule,
            ButtonModule,
            LoadingStateModule,
            InfiniteScrollModule,
            EmptyStateModule], exports: [GlobalSearchComponent,
            GlobalSearchDropdownItemComponent,
            TooltipModule,
            ThumbnailModule,
            ButtonModule,
            LoadingStateModule,
            EmptyStateModule] });
    static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: GlobalSearchModule, imports: [CommonModule,
            InputTextModule,
            FormsModule,
            ReactiveFormsModule,
            TooltipModule,
            ThumbnailModule,
            ButtonModule,
            LoadingStateModule,
            InfiniteScrollModule,
            EmptyStateModule, TooltipModule,
            ThumbnailModule,
            ButtonModule,
            LoadingStateModule,
            EmptyStateModule] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: GlobalSearchModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [
                        GlobalSearchComponent,
                        GlobalSearchDropdownItemComponent
                    ],
                    imports: [
                        CommonModule,
                        InputTextModule,
                        FormsModule,
                        ReactiveFormsModule,
                        TooltipModule,
                        ThumbnailModule,
                        ButtonModule,
                        LoadingStateModule,
                        InfiniteScrollModule,
                        EmptyStateModule
                    ],
                    exports: [
                        GlobalSearchComponent,
                        GlobalSearchDropdownItemComponent,
                        TooltipModule,
                        ThumbnailModule,
                        ButtonModule,
                        LoadingStateModule,
                        EmptyStateModule
                    ]
                }]
        }] });

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

export { GlobalSearchComponent, GlobalSearchDropdownItemComponent, GlobalSearchModule };
//# sourceMappingURL=seniorsistemas-angular-components-global-search.mjs.map
