import { ChangeDetectionStrategy, Component, forwardRef } from '@angular/core';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
import { ModalBaseComponent } from '@ironsource/fusion-ui/components/modal/common/base';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "./components/modal-footer/modal-footer.component";
import * as i3 from "./components/modal-content/modal-content.component";
import * as i4 from "./components/modal-header/modal-header.component";
function ModalComponent_fusion_modal_content_5_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainer(0);
} }
const _c0 = a0 => ({ "fu-has-height": a0 });
function ModalComponent_fusion_modal_content_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "fusion-modal-content", 9);
    i0.ɵɵtemplate(1, ModalComponent_fusion_modal_content_5_ng_container_1_Template, 1, 0, "ng-container", 10);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r2 = i0.ɵɵnextContext();
    const _r5 = i0.ɵɵreference(8);
    i0.ɵɵproperty("padding", ctx_r2.padding)("waiting", ctx_r2.waiting)("ngClass", i0.ɵɵpureFunction1(4, _c0, !!ctx_r2.height));
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngTemplateOutlet", _r5);
} }
function ModalComponent_ng_container_6_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainer(0);
} }
function ModalComponent_ng_container_6_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, ModalComponent_ng_container_6_ng_container_1_Template, 1, 0, "ng-container", 10);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    i0.ɵɵnextContext();
    const _r5 = i0.ɵɵreference(8);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngTemplateOutlet", _r5);
} }
function ModalComponent_ng_template_7_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵprojection(0);
} }
function ModalComponent_fusion_modal_footer_9_Template(rf, ctx) { if (rf & 1) {
    const _r10 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "fusion-modal-footer", 11);
    i0.ɵɵlistener("onSave", function ModalComponent_fusion_modal_footer_9_Template_fusion_modal_footer_onSave_0_listener() { i0.ɵɵrestoreView(_r10); const ctx_r9 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r9.onSave.emit()); })("closeButtonClicked", function ModalComponent_fusion_modal_footer_9_Template_fusion_modal_footer_closeButtonClicked_0_listener() { i0.ɵɵrestoreView(_r10); const ctx_r11 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r11.close()); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r6 = i0.ɵɵnextContext();
    i0.ɵɵproperty("loading", ctx_r6.loading)("error", ctx_r6.error)("saveButtonText", ctx_r6.saveButtonText)("saveButtonDisabled", ctx_r6.saveButtonDisabled)("cancelButtonHidden", ctx_r6.cancelButtonHidden)("cancelButtonText", ctx_r6.cancelButtonText)("saveButtonLoading", ctx_r6.waiting);
} }
const _c1 = (a0, a1) => ({ waiting: a0, loading: a1 });
const _c2 = ["*"];
export class ModalComponent extends ModalBaseComponent {
    static { this.ɵfac = /*@__PURE__*/ (() => { let ɵModalComponent_BaseFactory; return function ModalComponent_Factory(t) { return (ɵModalComponent_BaseFactory || (ɵModalComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ModalComponent)))(t || ModalComponent); }; })(); }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ModalComponent, selectors: [["fusion-modal"]], features: [i0.ɵɵProvidersFeature([
                {
                    provide: NG_VALUE_ACCESSOR,
                    useExisting: forwardRef(() => ModalComponent),
                    multi: true
                }
            ]), i0.ɵɵInheritDefinitionFeature], ngContentSelectors: _c2, decls: 10, vars: 17, consts: [[1, "modal", 3, "ngClass"], ["modalHolder", ""], [1, "modal-body"], ["modalBody", ""], [3, "headerText", "noHeaderBorder", "closed"], [3, "padding", "waiting", "ngClass", 4, "ngIf"], [4, "ngIf"], ["content", ""], [3, "loading", "error", "saveButtonText", "saveButtonDisabled", "cancelButtonHidden", "cancelButtonText", "saveButtonLoading", "onSave", "closeButtonClicked", 4, "ngIf"], [3, "padding", "waiting", "ngClass"], [4, "ngTemplateOutlet"], [3, "loading", "error", "saveButtonText", "saveButtonDisabled", "cancelButtonHidden", "cancelButtonText", "saveButtonLoading", "onSave", "closeButtonClicked"]], template: function ModalComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵprojectionDef();
            i0.ɵɵelementStart(0, "div", 0, 1)(2, "div", 2, 3)(4, "fusion-modal-header", 4);
            i0.ɵɵlistener("closed", function ModalComponent_Template_fusion_modal_header_closed_4_listener() { return ctx.close(); });
            i0.ɵɵelementEnd();
            i0.ɵɵtemplate(5, ModalComponent_fusion_modal_content_5_Template, 2, 6, "fusion-modal-content", 5)(6, ModalComponent_ng_container_6_Template, 2, 1, "ng-container", 6)(7, ModalComponent_ng_template_7_Template, 1, 0, "ng-template", null, 7, i0.ɵɵtemplateRefExtractor)(9, ModalComponent_fusion_modal_footer_9_Template, 1, 7, "fusion-modal-footer", 8);
            i0.ɵɵelementEnd()();
        } if (rf & 2) {
            i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction2(14, _c1, ctx.waiting, ctx.loading));
            i0.ɵɵadvance(2);
            i0.ɵɵstyleProp("width", ctx.width)("height", ctx.height);
            i0.ɵɵclassProp("has-footer", ctx.footer)("has-header", ctx.headerText);
            i0.ɵɵadvance(2);
            i0.ɵɵproperty("headerText", ctx.headerText)("noHeaderBorder", ctx.noHeaderBorder);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", ctx.headerText || ctx.footer);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", !ctx.headerText && !ctx.footer);
            i0.ɵɵadvance(3);
            i0.ɵɵproperty("ngIf", ctx.footer);
        } }, dependencies: [i1.NgClass, i1.NgIf, i1.NgTemplateOutlet, i2.ModalFooterComponent, i3.ModalContentComponent, i4.ModalHeaderComponent], styles: ["[_nghost-%COMP%]   *[_ngcontent-%COMP%]{box-sizing:border-box}[_nghost-%COMP%]{margin:0;padding:0;vertical-align:initial;text-align:initial}[_nghost-%COMP%]{position:fixed;inset:0;background:rgba(0,0,0,.5);overflow-x:auto;z-index:3010}[_nghost-%COMP%]   .modal[_ngcontent-%COMP%]{height:calc(100vh - 20px);display:flex;flex-direction:column;align-items:center;justify-content:center;padding:10px 0;overflow:auto;color:var(--dark-color-300, #172D4C)}[_nghost-%COMP%]   .modal[_ngcontent-%COMP%]   .modal-body[_ngcontent-%COMP%]{position:relative;background:#fff;margin:0 auto;border-radius:var(--border-radius, 3px);display:grid}[_nghost-%COMP%]   .modal[_ngcontent-%COMP%]   .modal-body.has-header[_ngcontent-%COMP%]{grid-template-rows:50px 1fr 0px}[_nghost-%COMP%]   .modal[_ngcontent-%COMP%]   .modal-body.has-footer[_ngcontent-%COMP%]{grid-template-rows:0px 1fr 62px}[_nghost-%COMP%]   .modal[_ngcontent-%COMP%]   .modal-body.has-footer.has-header[_ngcontent-%COMP%]{grid-template-rows:50px 1fr 62px}"], changeDetection: 0 }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ModalComponent, [{
        type: Component,
        args: [{ selector: 'fusion-modal', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
                    {
                        provide: NG_VALUE_ACCESSOR,
                        useExisting: forwardRef(() => ModalComponent),
                        multi: true
                    }
                ], template: "<div class=\"modal\" [ngClass]=\"{waiting: waiting, loading: loading}\" #modalHolder>\n    <div class=\"modal-body\" [class.has-footer]=\"footer\" [class.has-header]=\"headerText\" [style.width]=\"width\" [style.height]=\"height\" #modalBody>\n\n        <fusion-modal-header [headerText]=\"headerText\" [noHeaderBorder]=\"noHeaderBorder\" (closed)=\"close()\"></fusion-modal-header>\n\n        <fusion-modal-content\n            *ngIf=\"headerText || footer\"\n            [padding]=\"padding\"\n            [waiting]=\"waiting\"\n            [ngClass]=\"{'fu-has-height': !!height}\"\n        >\n            <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n        </fusion-modal-content>\n\n        <ng-container *ngIf=\"!headerText && !footer\">\n            <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n        </ng-container>\n\n        <!--can use <ng-content> tag twice in html page unless we use select attribute -->\n        <ng-template #content>\n            <ng-content></ng-content>\n        </ng-template>\n\n        <fusion-modal-footer\n            *ngIf=\"footer\"\n            [loading]=\"loading\"\n            [error]=\"error\"\n            [saveButtonText]=\"saveButtonText\"\n            [saveButtonDisabled]=\"saveButtonDisabled\"\n            [cancelButtonHidden]=\"cancelButtonHidden\"\n            [cancelButtonText]=\"cancelButtonText\"\n            (onSave)=\"onSave.emit()\"\n            (closeButtonClicked)=\"close()\"\n            [saveButtonLoading]=\"waiting\"\n        ></fusion-modal-footer>\n\n    </div>\n</div>\n\n", styles: [":host *{box-sizing:border-box}:host{margin:0;padding:0;vertical-align:initial;text-align:initial}:host{position:fixed;inset:0;background:rgba(0,0,0,.5);overflow-x:auto;z-index:3010}:host .modal{height:calc(100vh - 20px);display:flex;flex-direction:column;align-items:center;justify-content:center;padding:10px 0;overflow:auto;color:var(--dark-color-300, #172D4C)}:host .modal .modal-body{position:relative;background:#fff;margin:0 auto;border-radius:var(--border-radius, 3px);display:grid}:host .modal .modal-body.has-header{grid-template-rows:50px 1fr 0px}:host .modal .modal-body.has-footer{grid-template-rows:0px 1fr 62px}:host .modal .modal-body.has-footer.has-header{grid-template-rows:50px 1fr 62px}\n"] }]
    }], null, null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ModalComponent, { className: "ModalComponent", filePath: "modal.component.ts", lineNumber: 18 }); })();
//# sourceMappingURL=data:application/json;base64, 