import * as i0 from '@angular/core';
import { Component, TemplateRef, Input, Directive, HostBinding, NgModule } from '@angular/core';
import { Subject, fromEvent } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import * as i1 from '@angular/common';
import { CommonModule } from '@angular/common';

class IconGroupComponent {
}
IconGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: IconGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
IconGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: IconGroupComponent, selector: "d-icon-group", ngImport: i0, template: "<ng-content></ng-content>\r\n", styles: [":host ::ng-deep d-icon .devui-icon-container:not(.devui-icon-can-interactive){padding:8px;margin-left:-8px}:host ::ng-deep>*:not(:first-child){margin-left:8px}:host{display:inline-flex;align-items:center}\n"] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: IconGroupComponent, decorators: [{
            type: Component,
            args: [{ selector: 'd-icon-group', template: "<ng-content></ng-content>\r\n", styles: [":host ::ng-deep d-icon .devui-icon-container:not(.devui-icon-can-interactive){padding:8px;margin-left:-8px}:host ::ng-deep>*:not(:first-child){margin-left:8px}:host{display:inline-flex;align-items:center}\n"] }]
        }] });

class IconComponent {
    constructor(ngZone, elementRef) {
        this.ngZone = ngZone;
        this.elementRef = elementRef;
        this.operable = false;
        this.disabled = false;
        this.destroy$ = new Subject();
    }
    get template() {
        return this.icon instanceof TemplateRef ? this.icon : null;
    }
    ngOnInit() {
        this.ngZone.runOutsideAngular(() => {
            fromEvent(this.elementRef.nativeElement, 'click', { capture: true })
                .pipe(takeUntil(this.destroy$))
                .subscribe(event => {
                if (this.disabled) {
                    event.preventDefault();
                    event.stopImmediatePropagation();
                }
            });
        });
    }
    ngOnDestroy() {
        this.destroy$.next();
        this.destroy$.complete();
    }
}
IconComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: IconComponent, deps: [{ token: i0.NgZone }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
IconComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: IconComponent, selector: "d-icon", inputs: { icon: "icon", operable: "operable", disabled: "disabled", rotate: "rotate", color: "color" }, ngImport: i0, template: "<div [class.devui-icon-can-interactive]=\"operable\" class=\"devui-icon-container\" [class.disabled]=\"disabled\">\r\n  <ng-content select=\"[iconPrefix]\"></ng-content>\r\n  <ng-template [ngTemplateOutlet]=\"template || defaultTemplate\"> </ng-template>\r\n  <ng-template #defaultTemplate>\r\n    <i\r\n      class=\"devui-icon {{ icon }}\"\r\n      [class.devui-icon-spin]=\"rotate === 'infinite'\"\r\n      [style.transform]=\"'rotate(' + rotate + 'deg)'\"\r\n      [style.color]=\"color\"\r\n    >\r\n    </i>\r\n  </ng-template>\r\n  <ng-content select=\"[iconSuffix]\"></ng-content>\r\n</div>\r\n", styles: [":host{display:inline-flex}.devui-icon{font-size:16px;font-size:var(--devui-icon-font-size, 16px);display:inline-block;vertical-align:middle;transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-icon-can-interactive:not(.disabled){cursor:pointer;transition:color .3s cubic-bezier(.645,.045,.355,1);transition:color var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-icon-can-interactive:not(.disabled) .devui-icon{cursor:pointer}.devui-icon-can-interactive:hover:not(.disabled){color:var(--devui-icon-fill-hover, #252b3a);color:#252b3a;color:var(--devui-icon-hover-color, var(--devui-icon-fill-hover, #252b3a))}.devui-icon-can-interactive:hover:not(.disabled).devui-icon-container{background-color:var(--devui-list-item-hover-bg, #f2f2f3);background-color:#f2f2f3;background-color:var(--devui-icon-hover-bg, var(--devui-list-item-hover-bg, #f2f2f3))}.devui-icon-can-interactive:hover:not(.disabled) .devui-icon{color:var(--devui-icon-fill-hover, #252b3a);color:#252b3a;color:var(--devui-icon-hover-color, var(--devui-icon-fill-hover, #252b3a))}.devui-icon-can-interactive:active:not(.disabled){color:var(--devui-icon-fill-active, #252b3a);color:#252b3a;color:var(--devui-icon-active-color, var(--devui-icon-fill-active, #252b3a))}.devui-icon-can-interactive:active:not(.disabled).devui-icon-container{background-color:var(--devui-list-item-active-bg, #f2f5fc);background-color:#f2f5fc;background-color:var(--devui-icon-active-bg, var(--devui-list-item-active-bg, #f2f5fc))}.devui-icon-can-interactive:active:not(.disabled) .devui-icon{color:var(--devui-icon-fill-active, #252b3a);color:#252b3a;color:var(--devui-icon-active-color, var(--devui-icon-fill-active, #252b3a))}.devui-icon-can-interactive.devui-icon-container{height:32px;height:var(--devui-icon-height, 32px);padding:0 8px;margin-left:-8px;border-radius:2px;border-radius:var(--devui-border-radius, 2px);border-radius:2px;border-radius:var(--devui-icon-border-radius, var(--devui-border-radius, 2px));transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-icon-container{display:inline-flex;align-items:center;color:var(--devui-icon-fill, #71757f);color:#71757f;color:var(--devui-icon-color, var(--devui-icon-fill, #71757f))}.disabled{color:var(--devui-disabled-text, #cfd0d3);color:#cfd0d3;color:var(--devui-icon-disabled-color, var(--devui-disabled-text, #cfd0d3));cursor:not-allowed}.disabled .devui-icon{color:var(--devui-disabled-text, #cfd0d3);color:#cfd0d3;color:var(--devui-icon-disabled-color, var(--devui-disabled-text, #cfd0d3))}::ng-deep .devui-icon-container [iconPrefix]{vertical-align:middle;margin-right:8px;margin-right:var(--devui-icon-space, 8px)}::ng-deep .devui-icon-container [iconSuffix]{vertical-align:middle;margin-left:8px;margin-left:var(--devui-icon-space, 8px)}::ng-deep .devui-icon-container span,::ng-deep .devui-icon-container svg,::ng-deep .devui-icon-container i{vertical-align:middle}::ng-deep d-icon.devui-icon-hover{cursor:pointer}::ng-deep d-icon.devui-icon-hover:hover .devui-icon-container .devui-icon{color:#252b3a;color:var(--devui-icon-fill-hover, #252b3a)}::ng-deep d-icon.devui-icon-link{cursor:pointer}::ng-deep d-icon.devui-icon-link a{color:#71757f;color:var(--devui-aide-text, #71757f)}::ng-deep d-icon.devui-icon-link:hover .devui-icon-container .devui-icon{color:#5e7ce0;color:var(--devui-brand, #5e7ce0)}\n"], dependencies: [{ kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: IconComponent, decorators: [{
            type: Component,
            args: [{ selector: 'd-icon', template: "<div [class.devui-icon-can-interactive]=\"operable\" class=\"devui-icon-container\" [class.disabled]=\"disabled\">\r\n  <ng-content select=\"[iconPrefix]\"></ng-content>\r\n  <ng-template [ngTemplateOutlet]=\"template || defaultTemplate\"> </ng-template>\r\n  <ng-template #defaultTemplate>\r\n    <i\r\n      class=\"devui-icon {{ icon }}\"\r\n      [class.devui-icon-spin]=\"rotate === 'infinite'\"\r\n      [style.transform]=\"'rotate(' + rotate + 'deg)'\"\r\n      [style.color]=\"color\"\r\n    >\r\n    </i>\r\n  </ng-template>\r\n  <ng-content select=\"[iconSuffix]\"></ng-content>\r\n</div>\r\n", styles: [":host{display:inline-flex}.devui-icon{font-size:16px;font-size:var(--devui-icon-font-size, 16px);display:inline-block;vertical-align:middle;transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-icon-can-interactive:not(.disabled){cursor:pointer;transition:color .3s cubic-bezier(.645,.045,.355,1);transition:color var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-icon-can-interactive:not(.disabled) .devui-icon{cursor:pointer}.devui-icon-can-interactive:hover:not(.disabled){color:var(--devui-icon-fill-hover, #252b3a);color:#252b3a;color:var(--devui-icon-hover-color, var(--devui-icon-fill-hover, #252b3a))}.devui-icon-can-interactive:hover:not(.disabled).devui-icon-container{background-color:var(--devui-list-item-hover-bg, #f2f2f3);background-color:#f2f2f3;background-color:var(--devui-icon-hover-bg, var(--devui-list-item-hover-bg, #f2f2f3))}.devui-icon-can-interactive:hover:not(.disabled) .devui-icon{color:var(--devui-icon-fill-hover, #252b3a);color:#252b3a;color:var(--devui-icon-hover-color, var(--devui-icon-fill-hover, #252b3a))}.devui-icon-can-interactive:active:not(.disabled){color:var(--devui-icon-fill-active, #252b3a);color:#252b3a;color:var(--devui-icon-active-color, var(--devui-icon-fill-active, #252b3a))}.devui-icon-can-interactive:active:not(.disabled).devui-icon-container{background-color:var(--devui-list-item-active-bg, #f2f5fc);background-color:#f2f5fc;background-color:var(--devui-icon-active-bg, var(--devui-list-item-active-bg, #f2f5fc))}.devui-icon-can-interactive:active:not(.disabled) .devui-icon{color:var(--devui-icon-fill-active, #252b3a);color:#252b3a;color:var(--devui-icon-active-color, var(--devui-icon-fill-active, #252b3a))}.devui-icon-can-interactive.devui-icon-container{height:32px;height:var(--devui-icon-height, 32px);padding:0 8px;margin-left:-8px;border-radius:2px;border-radius:var(--devui-border-radius, 2px);border-radius:2px;border-radius:var(--devui-icon-border-radius, var(--devui-border-radius, 2px));transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-icon-container{display:inline-flex;align-items:center;color:var(--devui-icon-fill, #71757f);color:#71757f;color:var(--devui-icon-color, var(--devui-icon-fill, #71757f))}.disabled{color:var(--devui-disabled-text, #cfd0d3);color:#cfd0d3;color:var(--devui-icon-disabled-color, var(--devui-disabled-text, #cfd0d3));cursor:not-allowed}.disabled .devui-icon{color:var(--devui-disabled-text, #cfd0d3);color:#cfd0d3;color:var(--devui-icon-disabled-color, var(--devui-disabled-text, #cfd0d3))}::ng-deep .devui-icon-container [iconPrefix]{vertical-align:middle;margin-right:8px;margin-right:var(--devui-icon-space, 8px)}::ng-deep .devui-icon-container [iconSuffix]{vertical-align:middle;margin-left:8px;margin-left:var(--devui-icon-space, 8px)}::ng-deep .devui-icon-container span,::ng-deep .devui-icon-container svg,::ng-deep .devui-icon-container i{vertical-align:middle}::ng-deep d-icon.devui-icon-hover{cursor:pointer}::ng-deep d-icon.devui-icon-hover:hover .devui-icon-container .devui-icon{color:#252b3a;color:var(--devui-icon-fill-hover, #252b3a)}::ng-deep d-icon.devui-icon-link{cursor:pointer}::ng-deep d-icon.devui-icon-link a{color:#71757f;color:var(--devui-aide-text, #71757f)}::ng-deep d-icon.devui-icon-link:hover .devui-icon-container .devui-icon{color:#5e7ce0;color:var(--devui-brand, #5e7ce0)}\n"] }]
        }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.ElementRef }]; }, propDecorators: { icon: [{
                type: Input
            }], operable: [{
                type: Input
            }], disabled: [{
                type: Input
            }], rotate: [{
                type: Input
            }], color: [{
                type: Input
            }] } });
class IconLinkDirective {
    constructor() {
        this.default = true;
    }
}
IconLinkDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: IconLinkDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
IconLinkDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.0", type: IconLinkDirective, selector: "d-icon-link, [dIconLink]", host: { properties: { "class.devui-icon-link": "this.default" } }, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: IconLinkDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: `d-icon-link, [dIconLink]`,
                }]
        }], propDecorators: { default: [{
                type: HostBinding,
                args: ['class.devui-icon-link']
            }] } });
class IconHoverDirective {
    constructor() {
        this.default = true;
    }
}
IconHoverDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: IconHoverDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
IconHoverDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.0", type: IconHoverDirective, selector: "d-icon-hover, [dIconHover]", host: { properties: { "class.devui-icon-hover": "this.default" } }, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: IconHoverDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: `d-icon-hover, [dIconHover]`,
                }]
        }], propDecorators: { default: [{
                type: HostBinding,
                args: ['class.devui-icon-hover']
            }] } });

class IconModule {
}
IconModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: IconModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
IconModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.0", ngImport: i0, type: IconModule, declarations: [IconComponent, IconGroupComponent, IconLinkDirective, IconHoverDirective], imports: [CommonModule], exports: [IconComponent, IconGroupComponent, IconLinkDirective, IconHoverDirective] });
IconModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: IconModule, imports: [CommonModule] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: IconModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [IconComponent, IconGroupComponent, IconLinkDirective, IconHoverDirective],
                    imports: [
                        CommonModule
                    ],
                    exports: [IconComponent, IconGroupComponent, IconLinkDirective, IconHoverDirective]
                }]
        }] });

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

export { IconComponent, IconGroupComponent, IconHoverDirective, IconLinkDirective, IconModule };
//# sourceMappingURL=ng-devui-icon.mjs.map
