import * as i0 from '@angular/core';
import { Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
import * as i1 from '@angular/common';
import { CommonModule } from '@angular/common';
import { ChartLabelsBaseComponent } from '@ironsource/fusion-ui/components/chart-labels/common/base';
import * as i2 from '@ironsource/fusion-ui/components/icon/v1';
import { IconModule } from '@ironsource/fusion-ui/components/icon/v1';
import * as i3 from '@angular/forms';
import { ReactiveFormsModule } from '@angular/forms';
import * as i4 from '@ironsource/fusion-ui/components/checkbox/v2';
import { CheckboxModule } from '@ironsource/fusion-ui/components/checkbox/v2';

function ChartLabelsComponent_ng_container_1_fusion_checkbox_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "fusion-checkbox", 5);
} if (rf & 2) {
    const ctx_r7 = i0.ɵɵnextContext();
    const isFirst_r2 = ctx_r7.first;
    const datasetLabel_r1 = ctx_r7.$implicit;
    i0.ɵɵclassMap(isFirst_r2 ? "font13" : "font14");
    i0.ɵɵproperty("formControl", datasetLabel_r1.labelVisible)("label", datasetLabel_r1.label)("tooltipContent", datasetLabel_r1.tooltip)("tooltipWidth", 240)("backgroundColor", datasetLabel_r1.color);
} }
function ChartLabelsComponent_ng_container_1_ng_template_3_label_0_div_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 9);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const datasetLabel_r1 = i0.ɵɵnextContext(3).$implicit;
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(datasetLabel_r1.labelSuffix);
} }
function ChartLabelsComponent_ng_container_1_ng_template_3_label_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "label")(1, "div", 7);
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd();
    i0.ɵɵtext(3);
    i0.ɵɵtemplate(4, ChartLabelsComponent_ng_container_1_ng_template_3_label_0_div_4_Template, 2, 1, "div", 8);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const datasetLabel_r1 = i0.ɵɵnextContext(2).$implicit;
    i0.ɵɵadvance();
    i0.ɵɵstyleProp("color", datasetLabel_r1.labelLetterColor)("background-color", datasetLabel_r1.color);
    i0.ɵɵclassProp("fu-label-letter", datasetLabel_r1.labelLetter);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(datasetLabel_r1.labelLetter);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1(" ", datasetLabel_r1.label, " ");
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", datasetLabel_r1.labelSuffix);
} }
function ChartLabelsComponent_ng_container_1_ng_template_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵtemplate(0, ChartLabelsComponent_ng_container_1_ng_template_3_label_0_Template, 5, 9, "label", 6);
} if (rf & 2) {
    const ctx_r4 = i0.ɵɵnextContext(2);
    i0.ɵɵproperty("ngIf", !ctx_r4.hasCheckboxes);
} }
function ChartLabelsComponent_ng_container_1_fusion_icon_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "fusion-icon", 10);
} if (rf & 2) {
    const datasetLabel_r1 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵproperty("name", datasetLabel_r1.icon);
} }
const _c0 = a0 => ({ "no-checkbox": a0 });
function ChartLabelsComponent_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    const _r14 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "li", 1);
    i0.ɵɵlistener("click", function ChartLabelsComponent_ng_container_1_Template_li_click_1_listener($event) { i0.ɵɵrestoreView(_r14); const ctx_r13 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r13.onLabelClicked($event)); });
    i0.ɵɵtemplate(2, ChartLabelsComponent_ng_container_1_fusion_checkbox_2_Template, 1, 7, "fusion-checkbox", 2)(3, ChartLabelsComponent_ng_container_1_ng_template_3_Template, 1, 1, "ng-template", null, 3, i0.ɵɵtemplateRefExtractor)(5, ChartLabelsComponent_ng_container_1_fusion_icon_5_Template, 1, 1, "fusion-icon", 4);
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const datasetLabel_r1 = ctx.$implicit;
    const _r5 = i0.ɵɵreference(4);
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(4, _c0, !ctx_r0.hasCheckboxes));
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", ctx_r0.hasCheckboxes)("ngIfElse", _r5);
    i0.ɵɵadvance(3);
    i0.ɵɵproperty("ngIf", datasetLabel_r1.icon);
} }
class ChartLabelsComponent extends ChartLabelsBaseComponent {
    static { this.ɵfac = /*@__PURE__*/ (() => { let ɵChartLabelsComponent_BaseFactory; return function ChartLabelsComponent_Factory(t) { return (ɵChartLabelsComponent_BaseFactory || (ɵChartLabelsComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ChartLabelsComponent)))(t || ChartLabelsComponent); }; })(); }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ChartLabelsComponent, selectors: [["fusion-chart-labels"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 2, vars: 1, consts: [[4, "ngFor", "ngForOf"], [1, "truncate", 3, "ngClass", "click"], [3, "formControl", "label", "tooltipContent", "tooltipWidth", "backgroundColor", "class", 4, "ngIf", "ngIfElse"], ["noCheckbox", ""], ["class", "is-platform-icon", 3, "name", 4, "ngIf"], [3, "formControl", "label", "tooltipContent", "tooltipWidth", "backgroundColor"], [4, "ngIf"], [1, "lbl-color"], ["class", "lbl-suffix", 4, "ngIf"], [1, "lbl-suffix"], [1, "is-platform-icon", 3, "name"]], template: function ChartLabelsComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "ul");
            i0.ɵɵtemplate(1, ChartLabelsComponent_ng_container_1_Template, 6, 6, "ng-container", 0);
            i0.ɵɵelementEnd();
        } if (rf & 2) {
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngForOf", ctx.labels);
        } }, dependencies: [i1.NgClass, i1.NgForOf, i1.NgIf, i2.IconComponent, i3.NgControlStatus, i3.FormControlDirective, i4.CheckboxComponent], styles: ["[_nghost-%COMP%]   *[_ngcontent-%COMP%]{box-sizing:border-box}[_nghost-%COMP%]   li.truncate[_ngcontent-%COMP%]{width:100%;display:inline-block;white-space:nowrap;overflow:hidden!important;text-overflow:ellipsis}[_nghost-%COMP%]   ul[_ngcontent-%COMP%], [_nghost-%COMP%]   ol[_ngcontent-%COMP%]{padding:0;margin:0}[_nghost-%COMP%]   ul[_ngcontent-%COMP%]   li[_ngcontent-%COMP%], [_nghost-%COMP%]   ol[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]{list-style:none}[_nghost-%COMP%]   li[_ngcontent-%COMP%]{border-bottom:1px solid var(--fu-light-500, #d2d5d8)}[_nghost-%COMP%]   li[_ngcontent-%COMP%]   .lbl-color.fu-label-letter[_ngcontent-%COMP%]{font-size:18px;font-family:NHaasGroteskDSPro-75Bd,sans-serif;font-weight:400}[_nghost-%COMP%]   .font13[_ngcontent-%COMP%]{font-size:12px;font-family:HelveticaNeue-Medium,helvetica,sans-serif;font-weight:400;letter-spacing:.04px}[_nghost-%COMP%]   .font14[_ngcontent-%COMP%], [_nghost-%COMP%]   li[_ngcontent-%COMP%]{font-size:12px;font-family:HelveticaNeue,helvetica,sans-serif;font-weight:400;letter-spacing:.04px}[_nghost-%COMP%]   li[_ngcontent-%COMP%]{padding:9px 20px 9px 7px;position:relative;height:32px;color:var(--fu-dark-700, #1d1c64);display:block}[_nghost-%COMP%]   li[_ngcontent-%COMP%]   fusion-icon.is-platform-icon[_ngcontent-%COMP%]{position:absolute;right:4px;top:2px}[_nghost-%COMP%]   li[_ngcontent-%COMP%]   fusion-icon.is-platform-icon[_ngcontent-%COMP%]     svg{width:12px;height:12px}[_nghost-%COMP%]   li[_ngcontent-%COMP%]   fusion-icon.is-platform-icon[_ngcontent-%COMP%]     svg *{fill:var(--fu-light-600, #b7bbc0)}[_nghost-%COMP%]   li[_ngcontent-%COMP%]:last-child{border-bottom:none}[_nghost-%COMP%]   li[_ngcontent-%COMP%]:hover{cursor:pointer;background-color:var(--fu-light-100, #f7f8f9)}[_nghost-%COMP%]   li.no-checkbox[_ngcontent-%COMP%]:hover{cursor:default}[_nghost-%COMP%]   li[_ngcontent-%COMP%]   .lbl-color[_ngcontent-%COMP%]{display:inline-block;width:8px;height:8px;border-radius:4px;margin-right:8px}[_nghost-%COMP%]   li[_ngcontent-%COMP%]   .lbl-color.fu-label-letter[_ngcontent-%COMP%]{color:var(--fu-white, #ffffff);height:16px;width:-moz-fit-content;width:fit-content;min-width:16px;border-radius:8px;font-size:10px;text-align:center;line-height:17px}[_nghost-%COMP%]   li[_ngcontent-%COMP%]   .lbl-suffix[_ngcontent-%COMP%]{position:absolute;top:9px;right:5px}"], changeDetection: 0 }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ChartLabelsComponent, [{
        type: Component,
        args: [{ selector: 'fusion-chart-labels', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ul>\n    <ng-container *ngFor=\"let datasetLabel of labels; let isFirst = first\">\n        <li class=\"truncate\" [ngClass]=\"{'no-checkbox': !hasCheckboxes}\" (click)=\"onLabelClicked($event)\">\n            <fusion-checkbox\n                *ngIf=\"hasCheckboxes; else noCheckbox\"\n                [formControl]=\"datasetLabel.labelVisible\"\n                [label]=\"datasetLabel.label\"\n                [tooltipContent]=\"datasetLabel.tooltip\"\n                [tooltipWidth]=\"240\"\n                [backgroundColor]=\"datasetLabel.color\"\n                [class]=\"isFirst ? 'font13' : 'font14'\"\n            ></fusion-checkbox>\n            <ng-template #noCheckbox>\n                <label *ngIf=\"!hasCheckboxes\"\n                    ><div class=\"lbl-color\" [class.fu-label-letter]=\"datasetLabel.labelLetter\" [style.color]=\"datasetLabel.labelLetterColor\" [style.background-color]=\"datasetLabel.color\">{{datasetLabel.labelLetter}}</div>\n                    {{ datasetLabel.label }}\n                    <div class=\"lbl-suffix\" *ngIf=\"datasetLabel.labelSuffix\">{{ datasetLabel.labelSuffix }}</div>\n                </label>\n            </ng-template>\n            <fusion-icon class=\"is-platform-icon\" *ngIf=\"datasetLabel.icon\" [name]=\"datasetLabel.icon\"></fusion-icon>\n        </li>\n    </ng-container>\n</ul>\n", styles: [":host *{box-sizing:border-box}:host li.truncate{width:100%;display:inline-block;white-space:nowrap;overflow:hidden!important;text-overflow:ellipsis}:host ul,:host ol{padding:0;margin:0}:host ul li,:host ol li{list-style:none}:host li{border-bottom:1px solid var(--fu-light-500, #d2d5d8)}:host li .lbl-color.fu-label-letter{font-size:18px;font-family:NHaasGroteskDSPro-75Bd,sans-serif;font-weight:400}:host .font13{font-size:12px;font-family:HelveticaNeue-Medium,helvetica,sans-serif;font-weight:400;letter-spacing:.04px}:host .font14,:host li{font-size:12px;font-family:HelveticaNeue,helvetica,sans-serif;font-weight:400;letter-spacing:.04px}:host li{padding:9px 20px 9px 7px;position:relative;height:32px;color:var(--fu-dark-700, #1d1c64);display:block}:host li fusion-icon.is-platform-icon{position:absolute;right:4px;top:2px}:host li fusion-icon.is-platform-icon ::ng-deep svg{width:12px;height:12px}:host li fusion-icon.is-platform-icon ::ng-deep svg *{fill:var(--fu-light-600, #b7bbc0)}:host li:last-child{border-bottom:none}:host li:hover{cursor:pointer;background-color:var(--fu-light-100, #f7f8f9)}:host li.no-checkbox:hover{cursor:default}:host li .lbl-color{display:inline-block;width:8px;height:8px;border-radius:4px;margin-right:8px}:host li .lbl-color.fu-label-letter{color:var(--fu-white, #ffffff);height:16px;width:-moz-fit-content;width:fit-content;min-width:16px;border-radius:8px;font-size:10px;text-align:center;line-height:17px}:host li .lbl-suffix{position:absolute;top:9px;right:5px}\n"] }]
    }], null, null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ChartLabelsComponent, { className: "ChartLabelsComponent", filePath: "chart-labels.component.ts", lineNumber: 10 }); })();

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

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

export { ChartLabelsComponent, ChartLabelsModule };
//# sourceMappingURL=ironsource-fusion-ui-components-chart-labels-v2.mjs.map
