import * as i0 from '@angular/core';
import { Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
import { TagBaseComponent } from '@ironsource/fusion-ui/components/tag/common/base';
import * as i1 from '@angular/common';
import { CommonModule } from '@angular/common';
import * as i2 from '@ironsource/fusion-ui/components/icon/v1';
import { IconModule } from '@ironsource/fusion-ui/components/icon/v1';
import * as i3 from '@ironsource/fusion-ui/components/flag/v1';
import { FlagModule } from '@ironsource/fusion-ui/components/flag/v1';
import * as i4 from '@ironsource/fusion-ui/components/tooltip/v1';
import { TooltipModule } from '@ironsource/fusion-ui/components/tooltip/v1';
export * from '@ironsource/fusion-ui/components/tag/common/entities';

function TagComponent_fusion_icon_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "fusion-icon", 4);
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵproperty("name", ctx_r0.icon);
} }
function TagComponent_fusion_flag_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "fusion-flag", 5);
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵproperty("name", ctx_r1.flag);
} }
function TagComponent_ng_content_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵprojection(0, 0, ["*ngIf", "!title"]);
} }
function TagComponent_ng_container_5_fusion_icon_1_Template(rf, ctx) { if (rf & 1) {
    const _r7 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "fusion-icon", 7);
    i0.ɵɵlistener("click", function TagComponent_ng_container_5_fusion_icon_1_Template_fusion_icon_click_0_listener($event) { i0.ɵɵrestoreView(_r7); const ctx_r6 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r6.closeClicked($event)); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const closeIconName_r4 = i0.ɵɵnextContext().ngIf;
    i0.ɵɵproperty("name", closeIconName_r4);
} }
function TagComponent_ng_container_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, TagComponent_ng_container_5_fusion_icon_1_Template, 1, 1, "fusion-icon", 6);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", ctx_r3.close);
} }
const _c0 = ["*"];
class TagComponent extends TagBaseComponent {
    ngOnInit() {
        super.ngOnInit();
        this.closeIconName$.next({ iconName: 'clear-full-circle', iconVersion: 'v1' });
    }
    static { this.ɵfac = /*@__PURE__*/ (() => { let ɵTagComponent_BaseFactory; return function TagComponent_Factory(t) { return (ɵTagComponent_BaseFactory || (ɵTagComponent_BaseFactory = i0.ɵɵgetInheritedFactory(TagComponent)))(t || TagComponent); }; })(); }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TagComponent, selectors: [["fusion-tag"]], features: [i0.ɵɵInheritDefinitionFeature], ngContentSelectors: _c0, decls: 7, vars: 9, consts: [["class", "tag-icon", 3, "name", 4, "ngIf"], [3, "name", 4, "ngIf"], [1, "truncate", 3, "tooltipWidth", "fusionTooltip"], [4, "ngIf"], [1, "tag-icon", 3, "name"], [3, "name"], ["class", "icon-close", 3, "name", "click", 4, "ngIf"], [1, "icon-close", 3, "name", "click"]], template: function TagComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵprojectionDef();
            i0.ɵɵtemplate(0, TagComponent_fusion_icon_0_Template, 1, 1, "fusion-icon", 0)(1, TagComponent_fusion_flag_1_Template, 1, 1, "fusion-flag", 1);
            i0.ɵɵelementStart(2, "span", 2);
            i0.ɵɵtext(3);
            i0.ɵɵtemplate(4, TagComponent_ng_content_4_Template, 1, 0, "ng-content", 3);
            i0.ɵɵelementEnd();
            i0.ɵɵtemplate(5, TagComponent_ng_container_5_Template, 2, 1, "ng-container", 3);
            i0.ɵɵpipe(6, "async");
        } if (rf & 2) {
            i0.ɵɵproperty("ngIf", ctx.icon);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", ctx.flag);
            i0.ɵɵadvance();
            i0.ɵɵproperty("tooltipWidth", ctx.tooltipWidth)("fusionTooltip", ctx.tooltipContent);
            i0.ɵɵadvance();
            i0.ɵɵtextInterpolate(ctx.title);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", !ctx.title);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(6, 7, ctx.closeIconName$));
        } }, dependencies: [i1.NgIf, i2.IconComponent, i3.FlagComponent, i4.TooltipDirective, i1.AsyncPipe], styles: ["[_nghost-%COMP%]{font-size:12px;font-family:var(--regular-font-family, \"Open Sans\");font-weight:600}[_nghost-%COMP%] > span[_ngcontent-%COMP%]{font-size:12px;font-family:var(--body-font-family, \"HelveticaNeue\");font-weight:400}[_nghost-%COMP%]   *[_ngcontent-%COMP%]{box-sizing:border-box}[_nghost-%COMP%] > span[_ngcontent-%COMP%]{width:100%;display:inline-block;white-space:nowrap;overflow:hidden!important;text-overflow:ellipsis}.disabled[_nghost-%COMP%]{pointer-events:none;cursor:default;touch-callout:none;-webkit-user-select:none;user-select:none}[_nghost-%COMP%]{margin:0;padding:0;vertical-align:initial;text-align:initial}[_nghost-%COMP%]{height:24px;line-height:23px;position:relative;background-color:var(--light-color-300, #EAEEF1);display:inline-block;padding:0 8px;border-radius:24px;border:solid 1px transparent;color:var(--dark-color-300, #172D4C);margin-right:4px}[_nghost-%COMP%]   fusion-icon[class^=tag-icon][_ngcontent-%COMP%]{vertical-align:middle}[_nghost-%COMP%]   fusion-icon[class^=tag-icon][_ngcontent-%COMP%]     svg{width:13px;height:13px}[_nghost-%COMP%]   fusion-icon[class^=tag-icon][_ngcontent-%COMP%]     svg *{fill:var(--light-color-900, #52677B)}[_nghost-%COMP%] > span[_ngcontent-%COMP%]{min-width:54px;max-width:250px;color:var(--dark-color-300, #172D4C);margin-left:2px;vertical-align:top;display:inline-block}.disabled[_nghost-%COMP%]{background-color:var(--light-color-300, #EAEEF1)}.disabled[_nghost-%COMP%] > span[_ngcontent-%COMP%]{color:var(--light-color-800, #678099)}[_nghost-%COMP%]:hover{color:var(--dark-color-300, #172D4C);background-color:var(--light-color, #E1E6EB);border:solid 1px var(--light-color-700, #95A6B8)}.selected[_nghost-%COMP%]{background-color:var(--primary-color, #3091F6);color:#fff;border:solid 1px var(--primary-color, #3091F6);cursor:pointer}.selected[_nghost-%COMP%]   fusion-icon[_ngcontent-%COMP%]   svg[_ngcontent-%COMP%]   *[_ngcontent-%COMP%]{fill:#fff}.with-closed-icon[_nghost-%COMP%]{padding-right:20px;cursor:default}.with-closed-icon[_nghost-%COMP%]   fusion-icon[class^=icon-close][_ngcontent-%COMP%]{position:absolute;vertical-align:middle;right:5px;top:1px;cursor:pointer}.with-closed-icon[_nghost-%COMP%]   fusion-icon[class^=icon-close][_ngcontent-%COMP%]     svg{width:12px;height:12px}.with-closed-icon[_nghost-%COMP%]   fusion-icon[class^=icon-close][_ngcontent-%COMP%]     svg .background{fill:var(--light-color-700, #95A6B8)}.with-closed-icon[_nghost-%COMP%]   fusion-icon[class^=icon-close][_ngcontent-%COMP%]     svg .inner{fill:#fff}.with-closed-icon[_nghost-%COMP%] > span[_ngcontent-%COMP%]{width:calc(100% - 30px)}"], changeDetection: 0 }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TagComponent, [{
        type: Component,
        args: [{ selector: 'fusion-tag', changeDetection: ChangeDetectionStrategy.OnPush, template: "<fusion-icon class=\"tag-icon\" [name]=\"icon\" *ngIf=\"icon\"></fusion-icon>\n<fusion-flag [name]=\"flag\" *ngIf=\"flag\"></fusion-flag>\n<span class=\"truncate\" [tooltipWidth]=\"tooltipWidth\" [fusionTooltip]=\"tooltipContent\">{{ title }}<ng-content *ngIf=\"!title\"></ng-content></span>\n<ng-container *ngIf=\"closeIconName$ | async as closeIconName\">\n    <fusion-icon class=\"icon-close\" *ngIf=\"close\" (click)=\"closeClicked($event)\" [name]=\"closeIconName\"></fusion-icon>\n</ng-container>\n", styles: [":host{font-size:12px;font-family:var(--regular-font-family, \"Open Sans\");font-weight:600}:host>span{font-size:12px;font-family:var(--body-font-family, \"HelveticaNeue\");font-weight:400}:host *{box-sizing:border-box}:host>span{width:100%;display:inline-block;white-space:nowrap;overflow:hidden!important;text-overflow:ellipsis}:host.disabled{pointer-events:none;cursor:default;touch-callout:none;-webkit-user-select:none;user-select:none}:host{margin:0;padding:0;vertical-align:initial;text-align:initial}:host{height:24px;line-height:23px;position:relative;background-color:var(--light-color-300, #EAEEF1);display:inline-block;padding:0 8px;border-radius:24px;border:solid 1px transparent;color:var(--dark-color-300, #172D4C);margin-right:4px}:host fusion-icon[class^=tag-icon]{vertical-align:middle}:host fusion-icon[class^=tag-icon] ::ng-deep svg{width:13px;height:13px}:host fusion-icon[class^=tag-icon] ::ng-deep svg *{fill:var(--light-color-900, #52677B)}:host>span{min-width:54px;max-width:250px;color:var(--dark-color-300, #172D4C);margin-left:2px;vertical-align:top;display:inline-block}:host.disabled{background-color:var(--light-color-300, #EAEEF1)}:host.disabled>span{color:var(--light-color-800, #678099)}:host:hover{color:var(--dark-color-300, #172D4C);background-color:var(--light-color, #E1E6EB);border:solid 1px var(--light-color-700, #95A6B8)}:host.selected{background-color:var(--primary-color, #3091F6);color:#fff;border:solid 1px var(--primary-color, #3091F6);cursor:pointer}:host.selected fusion-icon svg *{fill:#fff}:host.with-closed-icon{padding-right:20px;cursor:default}:host.with-closed-icon fusion-icon[class^=icon-close]{position:absolute;vertical-align:middle;right:5px;top:1px;cursor:pointer}:host.with-closed-icon fusion-icon[class^=icon-close] ::ng-deep svg{width:12px;height:12px}:host.with-closed-icon fusion-icon[class^=icon-close] ::ng-deep svg .background{fill:var(--light-color-700, #95A6B8)}:host.with-closed-icon fusion-icon[class^=icon-close] ::ng-deep svg .inner{fill:#fff}:host.with-closed-icon>span{width:calc(100% - 30px)}\n"] }]
    }], null, null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TagComponent, { className: "TagComponent", filePath: "tag.component.ts", lineNumber: 10 }); })();

class TagModule {
    static { this.ɵfac = function TagModule_Factory(t) { return new (t || TagModule)(); }; }
    static { this.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: TagModule }); }
    static { this.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule, IconModule, FlagModule, TooltipModule] }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TagModule, [{
        type: NgModule,
        args: [{
                declarations: [TagComponent],
                exports: [TagComponent],
                imports: [CommonModule, IconModule, FlagModule, TooltipModule]
            }]
    }], null, null); })();
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(TagModule, { declarations: [TagComponent], imports: [CommonModule, IconModule, FlagModule, TooltipModule], exports: [TagComponent] }); })();

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

export { TagComponent, TagModule };
//# sourceMappingURL=ironsource-fusion-ui-components-tag-v1.mjs.map
