import * as i0 from '@angular/core';
import { forwardRef, Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
import * as i1 from '@angular/common';
import { CommonModule } from '@angular/common';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
import { HeaderOverlayBaseComponent } from '@ironsource/fusion-ui/components/header-overlay/common/base';
export { HeaderSizes } from '@ironsource/fusion-ui/components/header-overlay/common/base';
import * as i2 from '@ironsource/fusion-ui/components/modal/v1';
import { ModalModule } from '@ironsource/fusion-ui/components/modal/v1';
import * as i3 from '@ironsource/fusion-ui/components/dynamic-components/v1';
import { DynamicComponentsModule } from '@ironsource/fusion-ui/components/dynamic-components/v1';
import * as i4 from '@ironsource/fusion-ui/directives/click-outside';
import { ClickOutsideModule } from '@ironsource/fusion-ui/directives/click-outside';

const _c0 = (a0, a1) => ({ isOpen: a0, small: a1 });
function HeaderOverlayComponent_div_1_Template(rf, ctx) { if (rf & 1) {
    const _r4 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 3, 4);
    i0.ɵɵlistener("click", function HeaderOverlayComponent_div_1_Template_div_click_0_listener() { i0.ɵɵrestoreView(_r4); const ctx_r3 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r3.toggleOverlay()); });
    i0.ɵɵelement(2, "fusion-dynamic-components", 5);
    i0.ɵɵpipe(3, "async");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction2(6, _c0, ctx_r0.isOpen, ctx_r0.size === ctx_r0.headerSizes.Small));
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("component", ctx_r0.headerComponent)("componentData", i0.ɵɵpipeBind1(3, 4, ctx_r0.headerComponentData$))("element", ctx_r0.element);
} }
function HeaderOverlayComponent_div_2_fusion_modal_footer_5_Template(rf, ctx) { if (rf & 1) {
    const _r8 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "fusion-modal-footer", 11);
    i0.ɵɵlistener("onSave", function HeaderOverlayComponent_div_2_fusion_modal_footer_5_Template_fusion_modal_footer_onSave_0_listener() { i0.ɵɵrestoreView(_r8); const ctx_r7 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r7.saved.emit()); })("closeButtonClicked", function HeaderOverlayComponent_div_2_fusion_modal_footer_5_Template_fusion_modal_footer_closeButtonClicked_0_listener() { i0.ɵɵrestoreView(_r8); const ctx_r9 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r9.close()); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r6 = i0.ɵɵnextContext(2);
    i0.ɵɵproperty("error", ctx_r6.error);
} }
function HeaderOverlayComponent_div_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 6, 7)(2, "div", 8)(3, "div", 9);
    i0.ɵɵprojection(4);
    i0.ɵɵelementEnd();
    i0.ɵɵtemplate(5, HeaderOverlayComponent_div_2_fusion_modal_footer_5_Template, 1, 1, "fusion-modal-footer", 10);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵproperty("ngClass", ctx_r1.side);
    i0.ɵɵadvance(3);
    i0.ɵɵstyleProp("width", ctx_r1.width)("height", ctx_r1.height);
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", ctx_r1.showFooter);
} }
const _c1 = ["*"];
class HeaderOverlayComponent extends HeaderOverlayBaseComponent {
    static { this.ɵfac = /*@__PURE__*/ (() => { let ɵHeaderOverlayComponent_BaseFactory; return function HeaderOverlayComponent_Factory(t) { return (ɵHeaderOverlayComponent_BaseFactory || (ɵHeaderOverlayComponent_BaseFactory = i0.ɵɵgetInheritedFactory(HeaderOverlayComponent)))(t || HeaderOverlayComponent); }; })(); }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: HeaderOverlayComponent, selectors: [["fusion-header-overlay"]], features: [i0.ɵɵProvidersFeature([
                {
                    provide: NG_VALUE_ACCESSOR,
                    useExisting: forwardRef(() => HeaderOverlayComponent),
                    multi: true
                }
            ]), i0.ɵɵInheritDefinitionFeature], ngContentSelectors: _c1, decls: 3, vars: 3, consts: [[1, "wrap", 3, "clickOutsideActivate", "fusionClickOutside"], ["class", "header", 3, "ngClass", "click", 4, "ngIf"], ["class", "overlay", 3, "ngClass", 4, "ngIf"], [1, "header", 3, "ngClass", "click"], ["header", ""], [3, "component", "componentData", "element"], [1, "overlay", 3, "ngClass"], ["modal", ""], [1, "content"], [1, "body"], ["saveButtonText", "Apply", "cancelButtonText", "Cancel", 3, "error", "onSave", "closeButtonClicked", 4, "ngIf"], ["saveButtonText", "Apply", "cancelButtonText", "Cancel", 3, "error", "onSave", "closeButtonClicked"]], template: function HeaderOverlayComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵprojectionDef();
            i0.ɵɵelementStart(0, "div", 0);
            i0.ɵɵlistener("fusionClickOutside", function HeaderOverlayComponent_Template_div_fusionClickOutside_0_listener() { return ctx.onOutsideClick(); });
            i0.ɵɵtemplate(1, HeaderOverlayComponent_div_1_Template, 4, 9, "div", 1)(2, HeaderOverlayComponent_div_2_Template, 6, 6, "div", 2);
            i0.ɵɵelementEnd();
        } if (rf & 2) {
            i0.ɵɵproperty("clickOutsideActivate", ctx.clickOutsideActivate);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", ctx.headerComponent || ctx.element);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", ctx.isOpen);
        } }, dependencies: [i1.NgClass, i1.NgIf, i2.ModalFooterComponent, i3.DynamicComponentsComponent, i4.ClickOutsideDirective, i1.AsyncPipe], styles: [".body[_ngcontent-%COMP%]::-webkit-scrollbar-track{border-radius:4px;background-color:#fff}.body[_ngcontent-%COMP%]::-webkit-scrollbar{width:14px;height:14px;background-color:#fff}.body[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{border:5px solid rgba(0,0,0,0);background-clip:padding-box;border-radius:4px;background-color:var(--light-color-600, #C2CDD7)}.content[_ngcontent-%COMP%]{box-shadow:0 1px 3px #0000003b}.overlay[_ngcontent-%COMP%]{z-index:2000!important}.wrap[_ngcontent-%COMP%]{position:relative}.overlay[_ngcontent-%COMP%]{position:absolute;top:calc(100% + 1px);left:0;bottom:0;min-width:350px}.overlay.left[_ngcontent-%COMP%]{right:0;left:initial}.content[_ngcontent-%COMP%]{background-color:#fff}.body[_ngcontent-%COMP%]{overflow-y:auto;padding:24px 24px 20px}.header[_ngcontent-%COMP%]{cursor:pointer;min-height:38px;padding:10px 20px 8px 21px}.header.small[_ngcontent-%COMP%]{padding:10px 18px 8px}.header.isOpen[_ngcontent-%COMP%]{padding-top:8px;padding-bottom:10px;border-top:2px solid var(--primary-color, #3091F6)}.header[_ngcontent-%COMP%]:hover{background-color:var(--light-color-100, #F9FAFB)}"], changeDetection: 0 }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HeaderOverlayComponent, [{
        type: Component,
        args: [{ selector: 'fusion-header-overlay', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
                    {
                        provide: NG_VALUE_ACCESSOR,
                        useExisting: forwardRef(() => HeaderOverlayComponent),
                        multi: true
                    }
                ], template: "<div (fusionClickOutside)=\"onOutsideClick()\" [clickOutsideActivate]=\"clickOutsideActivate\" class=\"wrap\">\n  <div class=\"header\" (click)=\"toggleOverlay()\"\n       [ngClass]=\"{isOpen: isOpen, small: size === headerSizes.Small}\"\n       #header\n       *ngIf=\"headerComponent || element\">\n    <fusion-dynamic-components\n      [component]=\"headerComponent\"\n      [componentData]=\"headerComponentData$ | async\"\n      [element]=\"element\">\n    </fusion-dynamic-components>\n  </div>\n\n  <div class=\"overlay\" *ngIf=\"isOpen\" [ngClass]=\"side\" #modal>\n    <div class=\"content\">\n      <div class=\"body\" [style.width]=\"width\" [style.height]=\"height\">\n        <ng-content></ng-content>\n      </div>\n      <fusion-modal-footer\n        *ngIf=\"showFooter\"\n        [error]=\"error\"\n        saveButtonText=\"Apply\"\n        cancelButtonText=\"Cancel\"\n        (onSave)=\"saved.emit()\"\n        (closeButtonClicked)=\"close()\">\n      </fusion-modal-footer>\n    </div>\n  </div>\n</div>\n", styles: [".body::-webkit-scrollbar-track{border-radius:4px;background-color:#fff}.body::-webkit-scrollbar{width:14px;height:14px;background-color:#fff}.body::-webkit-scrollbar-thumb{border:5px solid rgba(0,0,0,0);background-clip:padding-box;border-radius:4px;background-color:var(--light-color-600, #C2CDD7)}.content{box-shadow:0 1px 3px #0000003b}.overlay{z-index:2000!important}.wrap{position:relative}.overlay{position:absolute;top:calc(100% + 1px);left:0;bottom:0;min-width:350px}.overlay.left{right:0;left:initial}.content{background-color:#fff}.body{overflow-y:auto;padding:24px 24px 20px}.header{cursor:pointer;min-height:38px;padding:10px 20px 8px 21px}.header.small{padding:10px 18px 8px}.header.isOpen{padding-top:8px;padding-bottom:10px;border-top:2px solid var(--primary-color, #3091F6)}.header:hover{background-color:var(--light-color-100, #F9FAFB)}\n"] }]
    }], null, null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(HeaderOverlayComponent, { className: "HeaderOverlayComponent", filePath: "header-overlay.component.ts", lineNumber: 18 }); })();

class HeaderOverlayModule {
    static { this.ɵfac = function HeaderOverlayModule_Factory(t) { return new (t || HeaderOverlayModule)(); }; }
    static { this.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: HeaderOverlayModule }); }
    static { this.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule, ModalModule, DynamicComponentsModule, ClickOutsideModule] }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HeaderOverlayModule, [{
        type: NgModule,
        args: [{
                declarations: [HeaderOverlayComponent],
                exports: [HeaderOverlayComponent],
                imports: [CommonModule, ModalModule, DynamicComponentsModule, ClickOutsideModule]
            }]
    }], null, null); })();
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(HeaderOverlayModule, { declarations: [HeaderOverlayComponent], imports: [CommonModule, ModalModule, DynamicComponentsModule, ClickOutsideModule], exports: [HeaderOverlayComponent] }); })();

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

export { HeaderOverlayComponent, HeaderOverlayModule };
//# sourceMappingURL=ironsource-fusion-ui-components-header-overlay-v1.mjs.map
