export * from '@ironsource/fusion-ui/components/tags-input/entities';
import * as i0 from '@angular/core';
import { EventEmitter, Component, ChangeDetectionStrategy, Input, Output, ContentChild, ViewChild, forwardRef } from '@angular/core';
import * as i1 from '@angular/common';
import { CommonModule } from '@angular/common';
import * as i2 from '@ironsource/fusion-ui/components/input/v3';
import { InputSize, InputModule } from '@ironsource/fusion-ui/components/input/v3';
import { TagComponent } from '@ironsource/fusion-ui/components/tag';
import { BehaviorSubject, Subject } from 'rxjs';
import { ApiBase } from '@ironsource/fusion-ui/components/api-base';
import * as i1$1 from '@angular/forms';
import { FormControl, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms';
import { takeUntil } from 'rxjs/operators';
import * as i2$1 from '@ironsource/fusion-ui/components/dropdown-dual-multi-select/v3';
import { DropdownDualMultiSelectModule } from '@ironsource/fusion-ui/components/dropdown-dual-multi-select/v3';

const _c0 = ["apiBaseTriggerTemplate"];
const _c1 = ["tagInput"];
function TagsInputComponent_ng_template_0_ng_container_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainer(0, 5);
} if (rf & 2) {
    i0.ɵɵnextContext(2);
    const _r4 = i0.ɵɵreference(5);
    i0.ɵɵproperty("ngTemplateOutlet", _r4);
} }
function TagsInputComponent_ng_template_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵtemplate(0, TagsInputComponent_ng_template_0_ng_container_0_Template, 1, 1, "ng-container", 1);
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵproperty("ngIf", ctx_r0.apiBase);
} }
function TagsInputComponent_ng_container_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainer(0, 5);
} if (rf & 2) {
    i0.ɵɵnextContext();
    const _r4 = i0.ɵɵreference(5);
    i0.ɵɵproperty("ngTemplateOutlet", _r4);
} }
function TagsInputComponent_ng_template_4_fusion_tag_2_Template(rf, ctx) { if (rf & 1) {
    const _r13 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "fusion-tag", 10);
    i0.ɵɵlistener("onRemove", function TagsInputComponent_ng_template_4_fusion_tag_2_Template_fusion_tag_onRemove_0_listener($event) { i0.ɵɵrestoreView(_r13); const ctx_r12 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r12.tagRemoved($event)); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const tag_r11 = ctx.$implicit;
    i0.ɵɵclassProp("fu-tag-error", !!tag_r11.error);
    i0.ɵɵproperty("configuration", tag_r11)("removeEventOnly", true);
} }
function TagsInputComponent_ng_template_4_ng_container_4_Template(rf, ctx) { if (rf & 1) {
    const _r16 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "div", 11)(2, "fusion-input", 12, 13);
    i0.ɵɵlistener("ngEnter", function TagsInputComponent_ng_template_4_ng_container_4_Template_fusion_input_ngEnter_2_listener($event) { i0.ɵɵrestoreView(_r16); const ctx_r15 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r15.enterNewTag($event)); });
    i0.ɵɵelementEnd()();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const ctx_r9 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("placeholder", ctx_r9.inputPlaceholder)("options", ctx_r9.inputOptions);
} }
function TagsInputComponent_ng_template_4_ng_container_5_div_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 15);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r17 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(ctx_r17.placeholder);
} }
function TagsInputComponent_ng_template_4_ng_container_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, TagsInputComponent_ng_template_4_ng_container_5_div_1_Template, 2, 1, "div", 14);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const ctx_r10 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", ctx_r10.placeholder);
} }
function TagsInputComponent_ng_template_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 6)(1, "div", 7);
    i0.ɵɵtemplate(2, TagsInputComponent_ng_template_4_fusion_tag_2_Template, 1, 4, "fusion-tag", 8);
    i0.ɵɵpipe(3, "async");
    i0.ɵɵtemplate(4, TagsInputComponent_ng_template_4_ng_container_4_Template, 4, 2, "ng-container", 9)(5, TagsInputComponent_ng_template_4_ng_container_5_Template, 2, 1, "ng-container", 9);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext();
    i0.ɵɵclassProp("fu-trigger", ctx_r3.apiBase);
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngForOf", i0.ɵɵpipeBind1(3, 5, ctx_r3.displayedTags$));
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", !ctx_r3.apiBase);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", ctx_r3.apiBase);
} }
function TagsInputComponent_div_6_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "div", 16);
} if (rf & 2) {
    const ctx_r5 = i0.ɵɵnextContext();
    i0.ɵɵproperty("innerHTML", ctx_r5.error, i0.ɵɵsanitizeHtml);
} }
function TagsInputComponent_div_7_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "div", 17);
} if (rf & 2) {
    const ctx_r6 = i0.ɵɵnextContext();
    i0.ɵɵproperty("hidden", !!ctx_r6.error)("innerHTML", ctx_r6.helper, i0.ɵɵsanitizeHtml);
} }
const _c2 = [[["", 8, "filter-element"]]];
const _c3 = [".filter-element"];
class TagsInputComponent {
    /** Tags */
    set tags(value) {
        if (Array.isArray(value)) {
            this.displayedTags$.next(value);
        }
    }
    constructor() {
        /** Placeholder for input used for add new tag */
        this.inputPlaceholder = '...';
        /** On add new tag */
        this.addNewTag = new EventEmitter();
        /** On tag removed*/
        this.removeTag = new EventEmitter();
        /** @internal */
        this.inputOptions = { size: InputSize.Small };
        /** @ignore */
        this.displayedTags$ = new BehaviorSubject([]);
        this.onDestroy$ = new Subject();
    }
    ngOnInit() {
        if (this.apiBase) {
            this.apiBase.templateRef = this.apiBaseTriggerTemplate;
            this.apiBase.selectedTypeObject = true;
        }
    }
    ngOnDestroy() {
        this.onDestroy$.next();
        this.onDestroy$.complete();
    }
    /** @internal */
    enterNewTag(newTag) {
        newTag = newTag.trim();
        if (newTag) {
            this.addNewTag.emit(newTag);
        }
        this.tagInput.clearInput();
    }
    /** @internal */
    tagRemoved(tagRemoved) {
        this.removeTag.emit(tagRemoved);
    }
    static { this.ɵfac = function TagsInputComponent_Factory(t) { return new (t || TagsInputComponent)(); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TagsInputComponent, selectors: [["fusion-tags-input"]], contentQueries: function TagsInputComponent_ContentQueries(rf, ctx, dirIndex) { if (rf & 1) {
            i0.ɵɵcontentQuery(dirIndex, ApiBase, 7);
        } if (rf & 2) {
            let _t;
            i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.apiBase = _t.first);
        } }, viewQuery: function TagsInputComponent_Query(rf, ctx) { if (rf & 1) {
            i0.ɵɵviewQuery(_c0, 7);
            i0.ɵɵviewQuery(_c1, 5);
        } if (rf & 2) {
            let _t;
            i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.apiBaseTriggerTemplate = _t.first);
            i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.tagInput = _t.first);
        } }, inputs: { inputPlaceholder: "inputPlaceholder", placeholder: "placeholder", tags: "tags", error: "error", helper: "helper" }, outputs: { addNewTag: "addNewTag", removeTag: "removeTag" }, standalone: true, features: [i0.ɵɵStandaloneFeature], ngContentSelectors: _c3, decls: 8, vars: 3, consts: [["apiBaseTriggerTemplate", ""], [3, "ngTemplateOutlet", 4, "ngIf"], ["triggerComponent", ""], ["class", "fu-error-msg", 3, "innerHTML", 4, "ngIf"], ["class", "fu-helper-text", 3, "hidden", "innerHTML", 4, "ngIf"], [3, "ngTemplateOutlet"], [1, "fu-tags-input-wrapper"], [1, "fu-tags-holder"], [3, "configuration", "removeEventOnly", "fu-tag-error", "onRemove", 4, "ngFor", "ngForOf"], [4, "ngIf"], [3, "configuration", "removeEventOnly", "onRemove"], [1, "input-container"], [3, "placeholder", "options", "ngEnter"], ["tagInput", ""], ["class", "fu-tags-input-placeholder", 4, "ngIf"], [1, "fu-tags-input-placeholder"], [1, "fu-error-msg", 3, "innerHTML"], [1, "fu-helper-text", 3, "hidden", "innerHTML"]], template: function TagsInputComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵprojectionDef(_c2);
            i0.ɵɵtemplate(0, TagsInputComponent_ng_template_0_Template, 1, 1, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor)(2, TagsInputComponent_ng_container_2_Template, 1, 1, "ng-container", 1);
            i0.ɵɵprojection(3);
            i0.ɵɵtemplate(4, TagsInputComponent_ng_template_4_Template, 6, 7, "ng-template", null, 2, i0.ɵɵtemplateRefExtractor)(6, TagsInputComponent_div_6_Template, 1, 1, "div", 3)(7, TagsInputComponent_div_7_Template, 1, 2, "div", 4);
        } if (rf & 2) {
            i0.ɵɵadvance(2);
            i0.ɵɵproperty("ngIf", !ctx.apiBase);
            i0.ɵɵadvance(4);
            i0.ɵɵproperty("ngIf", ctx.error);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", ctx.helper);
        } }, dependencies: [CommonModule, i1.NgForOf, i1.NgIf, i1.NgTemplateOutlet, i1.AsyncPipe, InputModule, i2.InputComponent, TagComponent], styles: ["@font-face{font-family:NHaasGroteskDSPro;src:url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.eot);src:url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.eot?#iefix) format(\"embedded-opentype\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.woff2) format(\"woff2\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.woff) format(\"woff\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.ttf) format(\"truetype\")}@font-face{font-family:NHaasGroteskDSPro-65Md;src:url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.eot);src:url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.eot?#iefix) format(\"embedded-opentype\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.woff2) format(\"woff2\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.woff) format(\"woff\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.ttf) format(\"truetype\")}@font-face{font-family:HelveticaNeue;src:url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.eot);src:url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.eot?#iefix) format(\"embedded-opentype\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.woff2) format(\"woff2\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.woff) format(\"woff\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.ttf) format(\"truetype\")}@font-face{font-family:HelveticaNeue-Medium;src:url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.eot);src:url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.eot?#iefix) format(\"embedded-opentype\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.woff2) format(\"woff2\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.woff) format(\"woff\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.ttf) format(\"truetype\")}.font-heading-6[_ngcontent-%COMP%], .font-heading-5[_ngcontent-%COMP%], .font-heading-4[_ngcontent-%COMP%], .font-heading-3[_ngcontent-%COMP%], .font-heading-2[_ngcontent-%COMP%], .font-heading-1[_ngcontent-%COMP%]{font-family:NHaasGroteskDSPro,sans-serif}.font-heading-1[_ngcontent-%COMP%]{font-size:60px}.font-heading-2[_ngcontent-%COMP%]{font-size:32px}.font-heading-3[_ngcontent-%COMP%]{font-size:22px}.font-heading-4[_ngcontent-%COMP%]{font-size:18px}.font-heading-5[_ngcontent-%COMP%]{font-size:15px}.font-heading-6[_ngcontent-%COMP%]{font-size:13px}.font-heading-label[_ngcontent-%COMP%]{font-size:11px;font-family:NHaasGroteskDSPro-65Md,sans-serif;letter-spacing:.25px}[_nghost-%COMP%]   .fu-helper-text[_ngcontent-%COMP%], [_nghost-%COMP%]   .fu-error-msg[_ngcontent-%COMP%], .font-caption[_ngcontent-%COMP%], .font-bodyXSmall[_ngcontent-%COMP%], [_nghost-%COMP%]   .fu-tags-input-wrapper[_ngcontent-%COMP%]   .fu-tags-holder[_ngcontent-%COMP%]   .fu-tags-input-placeholder[_ngcontent-%COMP%], .font-bodySmall[_ngcontent-%COMP%], .font-bodyMedium[_ngcontent-%COMP%], .font-bodyLarge[_ngcontent-%COMP%]{font-family:HelveticaNeue,helvetica,sans-serif;line-height:1.5}.font-bodyXSmallStrong[_ngcontent-%COMP%], .font-bodySmallStrong[_ngcontent-%COMP%], .font-bodyMediumStrong[_ngcontent-%COMP%], .font-bodyLargeStrong[_ngcontent-%COMP%]{font-family:HelveticaNeue-Medium,helvetica,sans-serif;line-height:1.5}.font-bodyLarge[_ngcontent-%COMP%], .font-bodyLargeStrong[_ngcontent-%COMP%]{font-size:16px}.font-bodyMedium[_ngcontent-%COMP%], .font-bodyMediumStrong[_ngcontent-%COMP%]{font-size:14px}[_nghost-%COMP%]   .fu-tags-input-wrapper[_ngcontent-%COMP%]   .fu-tags-holder[_ngcontent-%COMP%]   .fu-tags-input-placeholder[_ngcontent-%COMP%], .font-bodySmall[_ngcontent-%COMP%]{font-size:13px;letter-spacing:.24px}.font-bodySmallStrong[_ngcontent-%COMP%]{font-size:13px;letter-spacing:.24px}.font-bodyXSmall[_ngcontent-%COMP%], .font-bodyXSmallStrong[_ngcontent-%COMP%]{font-size:12px;letter-spacing:.24px}[_nghost-%COMP%]   .fu-helper-text[_ngcontent-%COMP%], [_nghost-%COMP%]   .fu-error-msg[_ngcontent-%COMP%], .font-caption[_ngcontent-%COMP%]{font-size:11px}[_nghost-%COMP%]   *[_ngcontent-%COMP%]{box-sizing:border-box}[_nghost-%COMP%]{margin:0;padding:0;vertical-align:initial;text-align:initial}@keyframes _ngcontent-%COMP%_rotation{0%{transform:rotate(0)}to{transform:rotate(359deg)}}@keyframes _ngcontent-%COMP%_shineAnimation{0%{background-position:-750px 0}to{background-position:750px 0}}[_nghost-%COMP%]   .fu-tags-input-wrapper[_ngcontent-%COMP%]{width:100%;position:relative;display:inline-block;border-radius:8px;overflow-x:hidden}[_nghost-%COMP%]   .fu-tags-input-wrapper.fu-trigger[_ngcontent-%COMP%]{cursor:pointer}[_nghost-%COMP%]   .fu-tags-input-wrapper[_ngcontent-%COMP%]   .fu-tags-holder[_ngcontent-%COMP%]{background-color:var(--fu-light-100, #F1F3F4);border-radius:8px;padding:8px;display:flex;align-items:center;flex-wrap:wrap;gap:4px;min-height:40px}[_nghost-%COMP%]   .fu-tags-input-wrapper[_ngcontent-%COMP%]   .fu-tags-holder[_ngcontent-%COMP%]:hover{background-color:var(--fu-light-200, #EDEFF0)}[_nghost-%COMP%]   .fu-tags-input-wrapper[_ngcontent-%COMP%]   .fu-tags-holder[_ngcontent-%COMP%]:after{position:absolute;content:\"\";height:2px;width:100%;background-color:var(--fu-primary-500, #3083FF);bottom:0;left:0;display:none}[_nghost-%COMP%]   .fu-tags-input-wrapper[_ngcontent-%COMP%]   .fu-tags-holder[_ngcontent-%COMP%]:has(input:focus):after{display:unset}[_nghost-%COMP%]   .fu-tags-input-wrapper[_ngcontent-%COMP%]   .fu-tags-holder[_ngcontent-%COMP%]   .input-container[_ngcontent-%COMP%]{flex-grow:1}[_nghost-%COMP%]   .fu-tags-input-wrapper[_ngcontent-%COMP%]   .fu-tags-holder[_ngcontent-%COMP%]   .fu-tags-input-placeholder[_ngcontent-%COMP%]{color:var(--fu-black-500, #53575B)}[_nghost-%COMP%]   .fu-error-msg[_ngcontent-%COMP%]{color:var(--fu-negative-700, #DA564F);margin-top:4px;margin-left:2px;height:16px;line-height:16.5px;text-align:initial}[_nghost-%COMP%]   .fu-helper-text[_ngcontent-%COMP%]{color:var(--fu-black-200, #696A6B);margin-top:4px;margin-left:2px;height:16px;line-height:16.5px;text-align:initial}"], changeDetection: 0 }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TagsInputComponent, [{
        type: Component,
        args: [{ selector: 'fusion-tags-input', standalone: true, imports: [CommonModule, InputModule, TagComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template #apiBaseTriggerTemplate>\n    <ng-container *ngIf=\"apiBase\" [ngTemplateOutlet]=\"triggerComponent\"></ng-container>\n</ng-template>\n<ng-container *ngIf=\"!apiBase\" [ngTemplateOutlet]=\"triggerComponent\"></ng-container>\n<ng-content select=\".filter-element\"></ng-content>\n\n<ng-template #triggerComponent>\n    <div class=\"fu-tags-input-wrapper\" [class.fu-trigger]=\"apiBase\">\n        <div class=\"fu-tags-holder\">\n                <!--Tags-list-->\n                <fusion-tag *ngFor=\"let tag of (displayedTags$ | async)\"\n                            [configuration]=\"tag\"\n                            [removeEventOnly]=\"true\"\n                            [class.fu-tag-error]=\"!!tag.error\"\n                            (onRemove)=\"tagRemoved($event)\"\n                ></fusion-tag>\n                <!--Tags-list-->\n\n            <ng-container *ngIf=\"!apiBase\">\n                <!--Input new tag and search in existed-->\n                <div class=\"input-container\" >\n                    <fusion-input #tagInput\n                                  [placeholder]=\"inputPlaceholder\"\n                                  (ngEnter)=\"enterNewTag($event)\"\n                                  [options]=\"inputOptions\"\n                    ></fusion-input>\n                </div>\n                <!--Input new tag and search in existed-->\n            </ng-container>\n\n            <ng-container *ngIf=\"apiBase\">\n                <!--dropdown (include-exclude, multiselect)-->\n                <div *ngIf=\"placeholder\" class=\"fu-tags-input-placeholder\">{{placeholder}}</div>\n                <!--<ng-content select=\".filter-element\"></ng-content>-->\n                <!--dropdown (include-exclude, multiselect)-->\n            </ng-container>\n\n        </div>\n    </div>\n</ng-template>\n\n<div class=\"fu-error-msg\"\n     *ngIf=\"error\"\n     [innerHTML]=\"error\">\n</div>\n<div class=\"fu-helper-text\"\n     *ngIf=\"helper\"\n     [hidden]=\"!!error\"\n     [innerHTML]=\"helper\">\n</div>\n", styles: ["@font-face{font-family:NHaasGroteskDSPro;src:url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.eot);src:url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.eot?#iefix) format(\"embedded-opentype\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.woff2) format(\"woff2\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.woff) format(\"woff\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.ttf) format(\"truetype\")}@font-face{font-family:NHaasGroteskDSPro-65Md;src:url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.eot);src:url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.eot?#iefix) format(\"embedded-opentype\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.woff2) format(\"woff2\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.woff) format(\"woff\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.ttf) format(\"truetype\")}@font-face{font-family:HelveticaNeue;src:url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.eot);src:url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.eot?#iefix) format(\"embedded-opentype\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.woff2) format(\"woff2\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.woff) format(\"woff\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.ttf) format(\"truetype\")}@font-face{font-family:HelveticaNeue-Medium;src:url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.eot);src:url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.eot?#iefix) format(\"embedded-opentype\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.woff2) format(\"woff2\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.woff) format(\"woff\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.ttf) format(\"truetype\")}.font-heading-6,.font-heading-5,.font-heading-4,.font-heading-3,.font-heading-2,.font-heading-1{font-family:NHaasGroteskDSPro,sans-serif}.font-heading-1{font-size:60px}.font-heading-2{font-size:32px}.font-heading-3{font-size:22px}.font-heading-4{font-size:18px}.font-heading-5{font-size:15px}.font-heading-6{font-size:13px}.font-heading-label{font-size:11px;font-family:NHaasGroteskDSPro-65Md,sans-serif;letter-spacing:.25px}:host .fu-helper-text,:host .fu-error-msg,.font-caption,.font-bodyXSmall,:host .fu-tags-input-wrapper .fu-tags-holder .fu-tags-input-placeholder,.font-bodySmall,.font-bodyMedium,.font-bodyLarge{font-family:HelveticaNeue,helvetica,sans-serif;line-height:1.5}.font-bodyXSmallStrong,.font-bodySmallStrong,.font-bodyMediumStrong,.font-bodyLargeStrong{font-family:HelveticaNeue-Medium,helvetica,sans-serif;line-height:1.5}.font-bodyLarge,.font-bodyLargeStrong{font-size:16px}.font-bodyMedium,.font-bodyMediumStrong{font-size:14px}:host .fu-tags-input-wrapper .fu-tags-holder .fu-tags-input-placeholder,.font-bodySmall{font-size:13px;letter-spacing:.24px}.font-bodySmallStrong{font-size:13px;letter-spacing:.24px}.font-bodyXSmall,.font-bodyXSmallStrong{font-size:12px;letter-spacing:.24px}:host .fu-helper-text,:host .fu-error-msg,.font-caption{font-size:11px}:host *{box-sizing:border-box}:host{margin:0;padding:0;vertical-align:initial;text-align:initial}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(359deg)}}@keyframes shineAnimation{0%{background-position:-750px 0}to{background-position:750px 0}}:host .fu-tags-input-wrapper{width:100%;position:relative;display:inline-block;border-radius:8px;overflow-x:hidden}:host .fu-tags-input-wrapper.fu-trigger{cursor:pointer}:host .fu-tags-input-wrapper .fu-tags-holder{background-color:var(--fu-light-100, #F1F3F4);border-radius:8px;padding:8px;display:flex;align-items:center;flex-wrap:wrap;gap:4px;min-height:40px}:host .fu-tags-input-wrapper .fu-tags-holder:hover{background-color:var(--fu-light-200, #EDEFF0)}:host .fu-tags-input-wrapper .fu-tags-holder:after{position:absolute;content:\"\";height:2px;width:100%;background-color:var(--fu-primary-500, #3083FF);bottom:0;left:0;display:none}:host .fu-tags-input-wrapper .fu-tags-holder:has(input:focus):after{display:unset}:host .fu-tags-input-wrapper .fu-tags-holder .input-container{flex-grow:1}:host .fu-tags-input-wrapper .fu-tags-holder .fu-tags-input-placeholder{color:var(--fu-black-500, #53575B)}:host .fu-error-msg{color:var(--fu-negative-700, #DA564F);margin-top:4px;margin-left:2px;height:16px;line-height:16.5px;text-align:initial}:host .fu-helper-text{color:var(--fu-black-200, #696A6B);margin-top:4px;margin-left:2px;height:16px;line-height:16.5px;text-align:initial}\n"] }]
    }], () => [], { inputPlaceholder: [{
            type: Input
        }], placeholder: [{
            type: Input
        }], tags: [{
            type: Input
        }], error: [{
            type: Input
        }], helper: [{
            type: Input
        }], addNewTag: [{
            type: Output
        }], removeTag: [{
            type: Output
        }], apiBase: [{
            type: ContentChild,
            args: [ApiBase, { static: true }]
        }], apiBaseTriggerTemplate: [{
            type: ViewChild,
            args: ['apiBaseTriggerTemplate', { static: true }]
        }], tagInput: [{
            type: ViewChild,
            args: ['tagInput']
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TagsInputComponent, { className: "TagsInputComponent", filePath: "v3/tags-input.component.ts", lineNumber: 27 }); })();

/**
 * Combined component Tags-Input with Dropdown-Include-Exclude
 */
class TagsInputIncludeExcludeComponent {
    set placeholder(value) {
        this.initPlaceholder = value;
        this.tagInputPlaceholder = this.initPlaceholder;
    }
    constructor() {
        this.items = [];
        /** @internal */
        this.formControlIncludeExclude = new FormControl([]);
        /** @internal */
        this.tags = [];
        this.onDestroy$ = new Subject();
        // region Implement ControlValueAccessor methods
        /** @internal */
        this.propagateChange = (_) => { };
        /** @internal */
        this.propagateTouched = () => { };
    }
    ngOnInit() {
        this.formControlIncludeExclude.valueChanges.pipe(takeUntil(this.onDestroy$)).subscribe(this.setTags.bind(this));
    }
    ngOnDestroy() {
        this.onDestroy$.next();
        this.onDestroy$.complete();
    }
    /** @internal */
    writeValue(value) {
        if (!Array.isArray(value)) {
            value = [];
        }
        this.formControlIncludeExclude.setValue(value, { emitEvent: false });
        this.setTags(this.formControlIncludeExclude.value, false);
    }
    /** @internal */
    registerOnChange(fn) {
        this.propagateChange = fn;
    }
    /** @internal */
    registerOnTouched(fn) {
        this.propagateTouched = fn;
    }
    // endregion
    setTags(selected, propagateChange = true) {
        if (Array.isArray(selected) && selected.length) {
            if (selected.length === this.items.length) {
                this.tags = [];
                this.tagInputPlaceholder = 'All selected';
            }
            else {
                this.tagInputPlaceholder = '';
                this.tags = selected.map((option) => ({
                    id: option.id,
                    title: option.title ?? option.displayText,
                    image: option.image,
                    icon: option.icon,
                    flag: option.flag
                }));
            }
        }
        else {
            this.tagInputPlaceholder = this.initPlaceholder;
            this.tags = [];
            selected = [];
        }
        if (propagateChange) {
            this.propagateChange(selected);
        }
    }
    static { this.ɵfac = function TagsInputIncludeExcludeComponent_Factory(t) { return new (t || TagsInputIncludeExcludeComponent)(); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TagsInputIncludeExcludeComponent, selectors: [["fusion-tags-input-include-exclude"]], inputs: { placeholder: "placeholder", error: "error", helper: "helper", title: "title", items: "items" }, standalone: true, features: [i0.ɵɵProvidersFeature([
                {
                    provide: NG_VALUE_ACCESSOR,
                    useExisting: forwardRef(() => TagsInputIncludeExcludeComponent),
                    multi: true
                }
            ]), i0.ɵɵStandaloneFeature], decls: 3, vars: 7, consts: [[3, "placeholder", "tags", "error", "helper"], [1, "filter-element"], [3, "title", "formControl", "items"]], template: function TagsInputIncludeExcludeComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "fusion-tags-input", 0)(1, "div", 1);
            i0.ɵɵelement(2, "fusion-dropdown-dual-multi-select", 2);
            i0.ɵɵelementEnd()();
        } if (rf & 2) {
            i0.ɵɵproperty("placeholder", ctx.tagInputPlaceholder)("tags", ctx.tags)("error", ctx.error)("helper", ctx.helper);
            i0.ɵɵadvance(2);
            i0.ɵɵproperty("title", ctx.title)("formControl", ctx.formControlIncludeExclude)("items", ctx.items);
        } }, dependencies: [CommonModule, ReactiveFormsModule, i1$1.NgControlStatus, i1$1.FormControlDirective, TagsInputComponent, DropdownDualMultiSelectModule, i2$1.DropdownDualMultiSelectComponent], encapsulation: 2, changeDetection: 0 }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TagsInputIncludeExcludeComponent, [{
        type: Component,
        args: [{ selector: 'fusion-tags-input-include-exclude', standalone: true, imports: [CommonModule, ReactiveFormsModule, TagsInputComponent, DropdownDualMultiSelectModule], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
                    {
                        provide: NG_VALUE_ACCESSOR,
                        useExisting: forwardRef(() => TagsInputIncludeExcludeComponent),
                        multi: true
                    }
                ], template: "<fusion-tags-input\n    [placeholder]=\"tagInputPlaceholder\"\n    [tags]=\"tags\"\n    [error]=\"error\"\n    [helper]=\"helper\"\n>\n    <div class=\"filter-element\">\n        <fusion-dropdown-dual-multi-select\n            [title]=\"title\"\n            [formControl]=\"formControlIncludeExclude\"\n            [items]=\"items\"\n        ></fusion-dropdown-dual-multi-select>\n    </div>\n</fusion-tags-input>\n" }]
    }], () => [], { placeholder: [{
            type: Input
        }], error: [{
            type: Input
        }], helper: [{
            type: Input
        }], title: [{
            type: Input
        }], items: [{
            type: Input
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TagsInputIncludeExcludeComponent, { className: "TagsInputIncludeExcludeComponent", filePath: "v3/tags-input-include-exclude/tags-input-include-exclude.component.ts", lineNumber: 28 }); })();

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

export { TagsInputComponent, TagsInputIncludeExcludeComponent };
//# sourceMappingURL=ironsource-fusion-ui-components-tags-input.mjs.map
