import { ChangeDetectionStrategy, Component, forwardRef } from '@angular/core';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
import { IconSelectListBaseComponent } from '@ironsource/fusion-ui/components/icon-select-list/common/base';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@ironsource/fusion-ui/components/icon/v1";
import * as i3 from "@ironsource/fusion-ui/components/checkbox/v1";
import * as i4 from "@ironsource/fusion-ui/components/radio/v1";
function IconSelectListComponent_li_1_fusion_checkbox_4_Template(rf, ctx) { if (rf & 1) {
    const _r8 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "fusion-checkbox", 8);
    i0.ɵɵlistener("changed", function IconSelectListComponent_li_1_fusion_checkbox_4_Template_fusion_checkbox_changed_0_listener($event) { i0.ɵɵrestoreView(_r8); const option_r2 = i0.ɵɵnextContext().$implicit; const ctx_r6 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r6.onItemSelectionChanged($event, option_r2)); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const option_r2 = i0.ɵɵnextContext().$implicit;
    const ctx_r3 = i0.ɵɵnextContext();
    i0.ɵɵproperty("checked", ctx_r3.isItemChecked(option_r2))("isDisabled", option_r2.disabled)("name", option_r2.id)("label", option_r2.label)("value", option_r2.id);
} }
function IconSelectListComponent_li_1_ng_template_5_Template(rf, ctx) { if (rf & 1) {
    const _r12 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "fusion-radio", 9);
    i0.ɵɵlistener("changed", function IconSelectListComponent_li_1_ng_template_5_Template_fusion_radio_changed_0_listener($event) { i0.ɵɵrestoreView(_r12); const option_r2 = i0.ɵɵnextContext().$implicit; const ctx_r10 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r10.onItemSelectionChanged($event, option_r2)); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const option_r2 = i0.ɵɵnextContext().$implicit;
    const ctx_r4 = i0.ɵɵnextContext();
    i0.ɵɵproperty("name", ctx_r4.id)("value", option_r2.id)("label", option_r2.label)("checked", ctx_r4.isItemChecked(option_r2))("isDisabled", option_r2.disabled);
} }
const _c0 = a0 => ({ "disabled": a0 });
const _c1 = a0 => ({ "selected": a0 });
function IconSelectListComponent_li_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "li", 2)(1, "label", 3)(2, "div", 4);
    i0.ɵɵelement(3, "fusion-icon", 5);
    i0.ɵɵelementEnd();
    i0.ɵɵtemplate(4, IconSelectListComponent_li_1_fusion_checkbox_4_Template, 1, 5, "fusion-checkbox", 6)(5, IconSelectListComponent_li_1_ng_template_5_Template, 1, 5, "ng-template", null, 7, i0.ɵɵtemplateRefExtractor);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const option_r2 = ctx.$implicit;
    const _r5 = i0.ɵɵreference(6);
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(5, _c0, option_r2.disabled));
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(7, _c1, ctx_r0.isItemChecked(option_r2)));
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("name", option_r2.icon);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", ctx_r0.isMultiSelect)("ngIfElse", _r5);
} }
function IconSelectListComponent_div_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 10);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(ctx_r1.error);
} }
export class IconSelectListComponent extends IconSelectListBaseComponent {
    static { this.ɵfac = /*@__PURE__*/ (() => { let ɵIconSelectListComponent_BaseFactory; return function IconSelectListComponent_Factory(t) { return (ɵIconSelectListComponent_BaseFactory || (ɵIconSelectListComponent_BaseFactory = i0.ɵɵgetInheritedFactory(IconSelectListComponent)))(t || IconSelectListComponent); }; })(); }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: IconSelectListComponent, selectors: [["fusion-icon-select-list"]], features: [i0.ɵɵProvidersFeature([
                {
                    provide: NG_VALUE_ACCESSOR,
                    useExisting: forwardRef(() => IconSelectListComponent),
                    multi: true
                }
            ]), i0.ɵɵInheritDefinitionFeature], decls: 3, vars: 2, consts: [["class", "is-icon-select-item", 3, "ngClass", 4, "ngFor", "ngForOf"], ["class", "error-msg", 4, "ngIf"], [1, "is-icon-select-item", 3, "ngClass"], [3, "ngClass"], [1, "is-icon-holder"], [3, "name"], [3, "checked", "isDisabled", "name", "label", "value", "changed", 4, "ngIf", "ngIfElse"], ["radioButton", ""], [3, "checked", "isDisabled", "name", "label", "value", "changed"], [3, "name", "value", "label", "checked", "isDisabled", "changed"], [1, "error-msg"]], template: function IconSelectListComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "ul");
            i0.ɵɵtemplate(1, IconSelectListComponent_li_1_Template, 7, 9, "li", 0);
            i0.ɵɵelementEnd();
            i0.ɵɵtemplate(2, IconSelectListComponent_div_2_Template, 2, 1, "div", 1);
        } if (rf & 2) {
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngForOf", ctx.options);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", ctx.error);
        } }, dependencies: [i1.NgClass, i1.NgForOf, i1.NgIf, i2.IconComponent, i3.CheckboxComponent, i4.RadioComponent], styles: ["[_nghost-%COMP%]   .error-msg[_ngcontent-%COMP%]{font-size:12px;font-family:var(--regular-font-family, \"Open Sans\");font-weight:400}[_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.is-icon-select-item[_ngcontent-%COMP%]{display:inline-block;min-width:120px;border-left:solid 1px var(--light-color, #E1E6EB);text-align:center;margin-bottom:10px}[_nghost-%COMP%]   li.is-icon-select-item[_ngcontent-%COMP%]:first-child{border-left:none}[_nghost-%COMP%]   li.is-icon-select-item[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{cursor:pointer}[_nghost-%COMP%]   li.is-icon-select-item[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]   .is-icon-holder[_ngcontent-%COMP%]{margin-bottom:7px}[_nghost-%COMP%]   li.is-icon-select-item[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]   .is-icon-holder[_ngcontent-%COMP%]   svg[_ngcontent-%COMP%]{width:50px;height:50px}[_nghost-%COMP%]   li.is-icon-select-item[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]:hover     svg path, [_nghost-%COMP%]   li.is-icon-select-item[_ngcontent-%COMP%]   label.selected[_ngcontent-%COMP%]     svg path{fill:var(--primary-color, #3091F6)}[_nghost-%COMP%]   li.is-icon-select-item[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]:hover     svg circle, [_nghost-%COMP%]   li.is-icon-select-item[_ngcontent-%COMP%]   label.selected[_ngcontent-%COMP%]     svg circle{stroke:var(--primary-color, #3091F6)}[_nghost-%COMP%]   li.is-icon-select-item.disabled[_ngcontent-%COMP%]   fusion-icon[_ngcontent-%COMP%]{opacity:.6}[_nghost-%COMP%]   .error-msg[_ngcontent-%COMP%]{color:var(--negative-color, #e1174c);margin-left:20px}"], changeDetection: 0 }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IconSelectListComponent, [{
        type: Component,
        args: [{ selector: 'fusion-icon-select-list', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
                    {
                        provide: NG_VALUE_ACCESSOR,
                        useExisting: forwardRef(() => IconSelectListComponent),
                        multi: true
                    }
                ], template: "<ul>\n    <li class=\"is-icon-select-item\" *ngFor=\"let option of options\" [ngClass]=\"{'disabled':option.disabled}\">\n        <label [ngClass]=\"{'selected':isItemChecked(option)}\">\n            <div class=\"is-icon-holder\">\n                <fusion-icon [name]=\"option.icon\"></fusion-icon>\n            </div>\n            <fusion-checkbox *ngIf=\"isMultiSelect; else radioButton\" [checked]=\"isItemChecked(option)\" [isDisabled]=\"option.disabled\"\n                             [name]=\"option.id\" [label]=\"option.label\" [value]=\"option.id\"\n                             (changed)=\"onItemSelectionChanged($event, option)\"></fusion-checkbox>\n            <ng-template #radioButton>\n                <fusion-radio\n                    [name]=\"id\"\n                    [value]=\"option.id\"\n                    [label]=\"option.label\"\n                    [checked]=\"isItemChecked(option)\"\n                    [isDisabled]=\"option.disabled\"\n                    (changed)=\"onItemSelectionChanged($event, option)\"></fusion-radio>\n            </ng-template>\n        </label>\n    </li>\n</ul>\n<div class=\"error-msg\" *ngIf=\"error\">{{error}}</div>\n", styles: [":host .error-msg{font-size:12px;font-family:var(--regular-font-family, \"Open Sans\");font-weight:400}:host ul,:host ol{padding:0;margin:0}:host ul li,:host ol li{list-style:none}:host li.is-icon-select-item{display:inline-block;min-width:120px;border-left:solid 1px var(--light-color, #E1E6EB);text-align:center;margin-bottom:10px}:host li.is-icon-select-item:first-child{border-left:none}:host li.is-icon-select-item label{cursor:pointer}:host li.is-icon-select-item label .is-icon-holder{margin-bottom:7px}:host li.is-icon-select-item label .is-icon-holder svg{width:50px;height:50px}:host li.is-icon-select-item label:hover ::ng-deep svg path,:host li.is-icon-select-item label.selected ::ng-deep svg path{fill:var(--primary-color, #3091F6)}:host li.is-icon-select-item label:hover ::ng-deep svg circle,:host li.is-icon-select-item label.selected ::ng-deep svg circle{stroke:var(--primary-color, #3091F6)}:host li.is-icon-select-item.disabled fusion-icon{opacity:.6}:host .error-msg{color:var(--negative-color, #e1174c);margin-left:20px}\n"] }]
    }], null, null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(IconSelectListComponent, { className: "IconSelectListComponent", filePath: "icon-select-list.component.ts", lineNumber: 18 }); })();
//# sourceMappingURL=data:application/json;base64, 