import { Component, ViewEncapsulation, Input, Output, EventEmitter, ElementRef, ViewContainerRef, ContentChildren, ViewChild } from "@angular/core";
import { NSBaseComponent } from "../ns-base";
import { NSDynamicComponentService } from "../../services";
import * as i0 from "@angular/core";
import * as i1 from "../../services";
export class NSMessageBoxAngular extends NSBaseComponent {
    constructor(dynamicComponentService) {
        super();
        this.dynamicComponentService = dynamicComponentService;
        this.dragStaring = new EventEmitter();
        this.dragging = new EventEmitter();
        this.dragEnd = new EventEmitter();
        this.resizeStaring = new EventEmitter();
        this.resizing = new EventEmitter();
        this.resizeEnd = new EventEmitter();
        this.collapseStarting = new EventEmitter();
        this.collapseEnd = new EventEmitter();
        this.expansionStarting = new EventEmitter();
        this.expansionEnd = new EventEmitter();
        this.minimizeStarting = new EventEmitter();
        this.minimizeEnd = new EventEmitter();
        this.maximizeStarting = new EventEmitter();
        this.maximizeEnd = new EventEmitter();
        this.fullScreenStarting = new EventEmitter();
        this.fullScreenEnd = new EventEmitter();
        this.restoreStarting = new EventEmitter();
        this.restoreEnd = new EventEmitter();
        this.closed = new EventEmitter();
        this.rendererComponentCreated = new EventEmitter();
        this.initializeScripts(['NSPanel', 'NSMessageBox']);
    }
    ;
    ngOnInit() {
        if (this.element) {
            this.__objBodyContent = this.element;
        }
        this.__createComponent();
    }
    ;
    ngAfterContentInit() {
        if (this.contentChildren.length === 0) {
            //const componentRef = this.dynamicContainer.createComponent();
            // Access component instance if needed
            // const instance = componentRef.instance;
        }
    }
    ngOnChanges(changes) {
    }
    ;
    //elements children are created in ngAfterViewInit and not in ngOnInit
    ngAfterViewInit() {
    }
    ;
    ngOnDestroy() {
    }
    ;
    minimize() {
        if (this.__objNSPanel) {
            this.__objNSPanel.minimize();
        }
    }
    ;
    maximize() {
        if (this.__objNSPanel) {
            this.__objNSPanel.maximize();
        }
    }
    ;
    collapse() {
        if (this.__objNSPanel) {
            this.__objNSPanel.collapse();
        }
    }
    ;
    expand() {
        if (this.__objNSPanel) {
            this.__objNSPanel.expand();
        }
    }
    ;
    fullScreen() {
        if (this.__objNSPanel) {
            this.__objNSPanel.fullScreen();
        }
    }
    ;
    restore() {
        if (this.__objNSPanel) {
            this.__objNSPanel.restore();
        }
    }
    ;
    disableResize() {
        if (this.__objNSPanel) {
            this.__objNSPanel.disableResize();
        }
    }
    ;
    disableDrag() {
        if (this.__objNSPanel) {
            this.__objNSPanel.disableDrag();
        }
    }
    ;
    disableCollapse() {
        if (this.__objNSPanel) {
            this.__objNSPanel.disableCollapse();
        }
    }
    ;
    disableMinMax() {
        if (this.__objNSPanel) {
            this.__objNSPanel.disableCollapse();
        }
    }
    ;
    disableFullScreen() {
        if (this.__objNSPanel) {
            this.__objNSPanel.disableCollapse();
        }
    }
    ;
    isCollapsed() {
        if (this.__objNSPanel) {
            return this.__objNSPanel.isCollapsed();
        }
        return false;
    }
    ;
    isMinimized() {
        if (this.__objNSPanel) {
            return this.__objNSPanel.isMinimized();
        }
        return false;
    }
    ;
    isFullScreen() {
        if (this.__objNSPanel) {
            return this.__objNSPanel.isFullScreen();
        }
        return false;
    }
    ;
    alert(message, title, callback) {
        this.__createComponent();
        this.__objNSMessageBox.alert(message, title, callback);
        this.__creationHandler();
    }
    ;
    confirm(message, title, confirmCallback, cancelCallback) {
        this.__createComponent();
        this.__objNSMessageBox.confirm(message, title, confirmCallback, cancelCallback);
        this.__creationHandler();
    }
    ;
    custom(setting) {
        this.__createComponent();
        if (!setting) {
            setting = {};
        }
        if (setting.bodyComponent) {
            setting.bodyComponent = this.__customBodyComponent(setting.bodyComponent, (instance) => {
                setting["bodyComponentInstance"] = instance;
                this.__bodyComponentInstance = instance;
            });
            /*setting.contentComponent = this.customEditor(setting.contentComponent, instance => {
                setting["bodyComponentInstance"] = instance;
                this.__bodyComponentInstance = instance;
                this.__objNSMessageBox.custom(setting);
                this.__creationHandler();
            });*/
        }
        else if (!setting.bodyContent && !setting.bodyTemplate && !setting.bodyContent) {
            if (!setting.bodyContent && this.__objBodyContent) {
                setting.bodyContent = this.__objBodyContent;
            }
        }
        this.__objNSMessageBox.custom(setting);
        this.__creationHandler();
    }
    ;
    close() {
        this.__createComponent();
        this.__objNSMessageBox.close();
    }
    ;
    removeModal() {
        if (this.__objNSMessageBox) {
            this.__objNSMessageBox.removeModal();
        }
        this.__objNSPanel = null;
    }
    ;
    changeButtonStyle(btnIdentifier, objStyle) {
        if (this.__objNSMessageBox) {
            this.__objNSMessageBox.changeButtonStyle(btnIdentifier, objStyle);
        }
    }
    getPanel() {
        return this.__objNSPanel;
    }
    ;
    __createComponent() {
        if (!this.__objNSMessageBox) {
            this.__objNSMessageBox = new NSMessageBox(this.setting);
            this.initializeEvents([NSPanel.DRAG_STARTING,
                NSPanel.DRAGGING,
                NSPanel.DRAG_END,
                NSPanel.RESIZE_STARTING,
                NSPanel.RESIZING,
                NSPanel.RESIZE_END,
                NSPanel.COLLAPSE_STARTING,
                NSPanel.COLLAPSE_END,
                NSPanel.EXPANSION_STARTING,
                NSPanel.EXPANSION_END,
                NSPanel.MINIMIZE_STARTING,
                NSPanel.MINIMIZE_END,
                NSPanel.FULLSCREEN_STARTING,
                NSPanel.FULLSCREEN_END,
                NSPanel.RESTORE_STARTING,
                NSPanel.RESTORE_END,
                NSPanel.CLOSED
            ]);
        }
    }
    ;
    __customBodyComponent(customEditorComponent, mainCallback) {
        const parentIns = this;
        return class extends CustomBodyComponent {
            constructor() {
                super(parentIns, customEditorComponent, mainCallback);
            }
        };
    }
    ;
    __creationHandler() {
        this.__objNSPanel = this.__objNSMessageBox.getPanel();
        if (!this.element) {
            this.element = this.__objNSPanel.getBaseElement();
        }
    }
    ;
    __getComponent(rendererComponent, paramCallback, prop) {
        return new Promise((parResolve, parReject) => {
            let params = {};
            if (prop) {
                params = prop;
            }
            const instance = this.dynamicComponentService.createComponentRef(rendererComponent, this.dynamicContainer);
            const componentRef = instance;
            const objComponent = this.dynamicComponentService.getInstance(componentRef);
            /*this.__objCustomComponent = {
                instance: objComponent,
                componentRef: componentRef,
                component: rendererComponent,
                data: params,
            };*/
            paramCallback && paramCallback(instance, objComponent);
            parResolve({ instance, objComponent, params });
            /*const onInstanceCreated = (instance: any, container: HTMLElement | null, portal: React.ReactPortal) => {
                paramCallback && paramCallback(null, instance, container);
                parResolve({ instance, container, portal });
            };
    
            const portal = this.createUpdatedPortal(rendererComponent, params, onInstanceCreated);
            this.setState((prevState: any) => {
                //console.log("Previous State:", prevState);
                this.hasPortalUpdated = true;
                return {
                    dynamicComponents: [...prevState.dynamicComponents, portal],
                };
            });*/
        });
    }
    ;
    /*private customEditor(customEditorComponent: any, mainCallback: (instance: any) => void): any {
        const self: any = this;
        const editor = function(this: any) {
            let componentRef: any;
            let objComponent: any;

            this.init = async (data: any): Promise<any> => {
                const instance  = await self.dynamicComponentService.createComponentRef(customEditorComponent, self.dynamicContainer);
                componentRef = instance;
                objComponent = self.dynamicComponentService.getInstance(componentRef);
                if (objComponent?.init) {
                    mainCallback(objComponent);
                    objComponent.init(data);
                }
                self.__objCustomComponent = { instance: objComponent, componentRef, component: customEditorComponent, data };
                self.emitRendererComponentCreated(self.__objCustomComponent);
            };

            this.getElement = () => objComponent?.getElement();
            this.elementAdded = () => objComponent?.elementAdded();
            this.fullScreenChanged = (isFullScreen: boolean) => objComponent?.fullScreenChanged(isFullScreen);
            this.destroy = () => objComponent?.destroy();
        };

        return editor;
    }*/
    __emitRendererComponentCreated(objItem) {
        this.rendererComponentCreated.emit(objItem);
    }
    ;
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NSMessageBoxAngular, deps: [{ token: i1.NSDynamicComponentService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: NSMessageBoxAngular, selector: "ns-messageBox-angular", inputs: { setting: "setting" }, outputs: { dragStaring: "dragStaring", dragging: "dragging", dragEnd: "dragEnd", resizeStaring: "resizeStaring", resizing: "resizing", resizeEnd: "resizeEnd", collapseStarting: "collapseStarting", collapseEnd: "collapseEnd", expansionStarting: "expansionStarting", expansionEnd: "expansionEnd", minimizeStarting: "minimizeStarting", minimizeEnd: "minimizeEnd", maximizeStarting: "maximizeStarting", maximizeEnd: "maximizeEnd", fullScreenStarting: "fullScreenStarting", fullScreenEnd: "fullScreenEnd", restoreStarting: "restoreStarting", restoreEnd: "restoreEnd", closed: "closed", rendererComponentCreated: "rendererComponentCreated" }, providers: [NSDynamicComponentService], queries: [{ propertyName: "contentChildren", predicate: ElementRef, descendants: true }], viewQueries: [{ propertyName: "dynamicContainer", first: true, predicate: ["dynamicContainer"], descendants: true, read: ViewContainerRef, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `<ng-template #dynamicContainer></ng-template>
               <ng-content></ng-content>`, isInline: true, styles: [".nsPanelModalProp{display:none;position:fixed;z-index:1;padding-top:100px;left:0;top:0;width:100%;height:100%;overflow:auto;-webkit-backface-visibility:hidden;backface-visibility:hidden;background-color:#0006;transition:opacity .3s}.nsPanelModalAnimation{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.nsPanelModalProp.nsPanelModalOpen{overflow-x:hidden;overflow-y:auto}.nsPanelModalAnimation.nsPanelModalOpen{opacity:1}.nsPanel{padding:0;width:100%;pointer-events:auto;border-radius:.3rem}.nsPanel.nsPanelModalContent{position:relative;margin:auto;padding:0;width:40%;box-shadow:0 4px 8px #0003,0 6px 20px #00000030;z-Index:100}.nsPanel.nsPanelModalContentDrag{left:20%}.nsPanel.nsPanelOpen.nsPanelModalZoom{-webkit-animation-name:nsAnimateZoomIn;-webkit-animation-duration:.5s;animation-name:nsAnimateZoomIn;animation-duration:.5s}.nsPanel.nsPanelModalZoom{-webkit-animation-name:nsAnimateZoomOut;-webkit-animation-duration:.5s;animation-name:nsAnimateZoomOut;animation-duration:.5s}.nsPanel.nsPanelOpen.nsPanelModalLeft{-webkit-animation-name:nsAnimateLeftIn;-webkit-animation-duration:.5s;animation-name:nsAnimateLeftIn;animation-duration:.5s}.nsPanel.nsPanelModalLeft{-webkit-animation-name:nsAnimateLeftOut;-webkit-animation-duration:.5s;animation-name:nsAnimateLeftOut;animation-duration:.5s}.nsPanel.nsPanelOpen.nsPanelModalRight{-webkit-animation-name:nsAnimateRightIn;-webkit-animation-duration:.5s;animation-name:nsAnimateRightIn;animation-duration:.5s}.nsPanel.nsPanelModalRight{-webkit-animation-name:nsAnimateRightOut;-webkit-animation-duration:.5s;animation-name:nsAnimateRightOut;animation-duration:.5s}.nsPanel.nsPanelOpen.nsPanelModalTop{-webkit-animation-name:nsAnimateTopIn;-webkit-animation-duration:.5s;animation-name:nsAnimateTopIn;animation-duration:.5s}.nsPanel.nsPanelModalTop{-webkit-animation-name:nsAnimateTopOut;-webkit-animation-duration:.5s;animation-name:nsAnimateTopOut;animation-duration:.5s}.nsPanel.nsPanelOpen.nsPanelModalBottom{-webkit-animation-name:nsAnimateBottomIn;-webkit-animation-duration:.5s;animation-name:nsAnimateBottomIn;animation-duration:.5s}.nsPanel.nsPanelModalBottom{-webkit-animation-name:nsAnimateBottomOut;-webkit-animation-duration:.5s;animation-name:nsAnimateBottomOut;animation-duration:.5s}.nsPanel.nsPanelOpen.nsPanelModalFlipX{-webkit-animation-name:nsAnimateFlipXIn;-webkit-animation-duration:.5s;animation-name:nsAnimateFlipXIn;animation-duration:.5s}.nsPanel.nsPanelModalFlipX{-webkit-animation-name:nsAnimateFlipXOut;-webkit-animation-duration:.5s;animation-name:nsAnimateFlipXOut;animation-duration:.5s}.nsPanel.nsPanelOpen.nsPanelModalFlipY{-webkit-animation-name:nsAnimateFlipYIn;-webkit-animation-duration:.5s;animation-name:nsAnimateFlipYIn;animation-duration:.5s}.nsPanel.nsPanelModalFlipY{-webkit-animation-name:nsAnimateFlipYOut;-webkit-animation-duration:.5s;animation-name:nsAnimateFlipYOut;animation-duration:.5s}.nsPanel.nsPanelOpen.nsPanelModalRoll{-webkit-animation-name:nsAnimateRollIn;-webkit-animation-duration:.5s;animation-name:nsAnimateRollIn;animation-duration:.5s}.nsPanel.nsPanelModalRoll{-webkit-animation-name:nsAnimateRollOut;-webkit-animation-duration:.5s;animation-name:nsAnimateRollOut;animation-duration:.5s}.nsPanel.nsPanelOpen.nsPanelModalBounce{-webkit-animation-name:nsAnimateBounceIn;-webkit-animation-duration:.5s;animation-name:nsAnimateBounceIn;animation-duration:.5s}.nsPanel.nsPanelModalBounce{-webkit-animation-name:nsAnimateBounceOut;-webkit-animation-duration:.5s;animation-name:nsAnimateBounceOut;animation-duration:.5s}.nsPanel.nsPanelOpen.nsPanelModalRotate{-webkit-animation-name:nsAnimateRotateIn;-webkit-animation-duration:.5s;animation-name:nsAnimateRotateIn;animation-duration:.5s}.nsPanel.nsPanelModalRotate{-webkit-animation-name:nsAnimateRotateOut;-webkit-animation-duration:.5s;animation-name:nsAnimateRotateOut;animation-duration:.5s}.nsPanel.nsPanelOpen.nsPanelWidget{width:45%;height:45%;background:#f6f6f6}.nsPanel .nsPanelTitleBar{text-align:left;min-height:20px;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-box-align:center;-ms-flex-align:center;-ms-grid-row-align:center;align-items:center}.nsPanel .nsPanelTitleBarContent{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;cursor:move;overflow:hidden}.nsPanel .nsPanelControlbar{display:flex;-webkit-box-align:center;-ms-flex-align:center;-ms-grid-row-align:center;align-items:center;float:right}.nsPanel .nsPanelControlbar .nsPanelControlButton{padding:0 3px;cursor:pointer}.nsPanel .nsPanelBody{overflow:auto;height:91%;width:100%}.nsPanel .nsPanelExpColIcon,.nsPanel .nsPanelMinMaxIcon,.nsPanel .nsPanelFullScreenIcon,.nsPanel .nsPanelCloseIcon{width:14px;height:14px}.nsPanelMinimizeContainer{bottom:0;left:0;position:fixed;width:100%;z-index:9999}.nsPanelMinimized{height:auto!important;left:auto!important;opacity:1;top:auto!important;width:auto!important;position:static!important}.nsPanelMinimized.nsPanelMinimizedright{float:right}.nsPanelMinimized.nsPanelMinimizedleft{float:left}.nsPanelFullScreen{height:100%!important;width:100%!important;height:100vh!important;width:100vw!important;position:fixed!important;inset:0!important;margin:0;z-index:100;opacity:1}@keyframes nsAnimateZoomIn{0%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes nsAnimateZoomOut{0%{opacity:1}50%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}to{opacity:0}}@keyframes nsAnimateTopIn{0%{opacity:0;-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}to{opacity:1;-webkit-transform:none;transform:none}}@keyframes nsAnimateTopOut{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes nsAnimateBottomIn{0%{opacity:0;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}to{opacity:1;-webkit-transform:none;transform:none}}@keyframes nsAnimateBottomOut{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}}@keyframes nsAnimateLeftIn{0%{opacity:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}to{opacity:1;-webkit-transform:none;transform:none}}@keyframes nsAnimateLeftOut{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}}@keyframes nsAnimateRightIn{0%{opacity:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}to{opacity:1;-webkit-transform:none;transform:none}}@keyframes nsAnimateRightOut{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}}@keyframes nsAnimateFlipXIn{0%{-webkit-transform:perspective(400px) rotate3d(1,0,0,90deg);transform:perspective(400px) rotateX(90deg);-webkit-transition-timing-function:ease-in;transition-timing-function:ease-in;opacity:0}40%{-webkit-transform:perspective(400px) rotate3d(1,0,0,-20deg);transform:perspective(400px) rotateX(-20deg);-webkit-transition-timing-function:ease-in;transition-timing-function:ease-in}60%{-webkit-transform:perspective(400px) rotate3d(1,0,0,10deg);transform:perspective(400px) rotateX(10deg);opacity:1}80%{-webkit-transform:perspective(400px) rotate3d(1,0,0,-5deg);transform:perspective(400px) rotateX(-5deg)}to{-webkit-transform:perspective(400px);transform:perspective(400px)}}@keyframes nsAnimateFlipXOut{0%{-webkit-transform:perspective(400px);transform:perspective(400px)}30%{-webkit-transform:perspective(400px) rotate3d(1,0,0,-20deg);transform:perspective(400px) rotateX(-20deg);opacity:1}to{-webkit-transform:perspective(400px) rotate3d(1,0,0,90deg);transform:perspective(400px) rotateX(90deg);opacity:0}}@keyframes nsAnimateFlipYIn{0%{-webkit-transform:perspective(400px) rotate3d(0,1,0,90deg);transform:perspective(400px) rotateY(90deg);-webkit-transition-timing-function:ease-in;transition-timing-function:ease-in;opacity:0}40%{-webkit-transform:perspective(400px) rotate3d(0,1,0,-20deg);transform:perspective(400px) rotateY(-20deg);-webkit-transition-timing-function:ease-in;transition-timing-function:ease-in}60%{-webkit-transform:perspective(400px) rotate3d(0,1,0,10deg);transform:perspective(400px) rotateY(10deg);opacity:1}80%{-webkit-transform:perspective(400px) rotate3d(0,1,0,-5deg);transform:perspective(400px) rotateY(-5deg)}to{-webkit-transform:perspective(400px);transform:perspective(400px)}}@keyframes nsAnimateFlipYOut{0%{-webkit-transform:perspective(400px);transform:perspective(400px)}30%{-webkit-transform:perspective(400px) rotate3d(0,1,0,-15deg);transform:perspective(400px) rotateY(-15deg);opacity:1}to{-webkit-transform:perspective(400px) rotate3d(0,1,0,90deg);transform:perspective(400px) rotateY(90deg);opacity:0}}@keyframes nsAnimateRollIn{0%{opacity:0;-webkit-transform:translate3d(-100%,0,0) rotate3d(0,0,1,-120deg);transform:translate3d(-100%,0,0) rotate3d(0,0,1,-120deg)}to{opacity:1;-webkit-transform:none;transform:none}}@keyframes nsAnimateRollOut{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(100%,0,0) rotate3d(0,0,1,120deg);transform:translate3d(100%,0,0) rotate3d(0,0,1,120deg)}}@keyframes nsAnimateBounceIn{0%,to,20%,40%,60%,80%{-webkit-transition-timing-function:cubic-bezier(.215,.61,.355,1);transition-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}20%{-webkit-transform:scale3d(1.1,1.1,1.1);transform:scale3d(1.1,1.1,1.1)}40%{-webkit-transform:scale3d(.9,.9,.9);transform:scale3d(.9,.9,.9)}60%{opacity:1;-webkit-transform:scale3d(1.03,1.03,1.03);transform:scale3d(1.03,1.03,1.03)}80%{-webkit-transform:scale3d(.97,.97,.97);transform:scale3d(.97,.97,.97)}to{opacity:1;-webkit-transform:scale3d(1,1,1);transform:scaleZ(1)}}@keyframes nsAnimateBounceOut{20%{-webkit-transform:scale3d(.9,.9,.9);transform:scale3d(.9,.9,.9)}50%,55%{opacity:1;-webkit-transform:scale3d(1.1,1.1,1.1);transform:scale3d(1.1,1.1,1.1)}to{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}}@keyframes nsAnimateRotateIn{0%{-webkit-transform-origin:center;transform-origin:center;-webkit-transform:rotate3d(0,0,1,-200deg);transform:rotate3d(0,0,1,-200deg);opacity:0}to{-webkit-transform-origin:center;transform-origin:center;-webkit-transform:none;transform:none;opacity:1}}@keyframes nsAnimateRotateOut{0%{-webkit-transform-origin:center;transform-origin:center;opacity:1}to{-webkit-transform-origin:center;transform-origin:center;-webkit-transform:rotate3d(0,0,1,200deg);transform:rotate3d(0,0,1,200deg);opacity:0}}.nsPanelWhite{background-color:#fefefe;border:5px solid #157fcc}.nsPanelModalWhite .nsPanelWhite{background-color:#fff;border:5px solid #157fcc}.nsPanelWhite .nsPanelTitleBar{background-color:#157fcc;font-weight:700}.nsPanelWhite .nsPanelTitleBarContent{color:#fefefe}.nsPanelWhite .nsPanelExpColIconUse{fill:#848484;color:#f6f6f6}.nsPanelWhite .nsPanelMinMaxIconUse{fill:#f6f6f6;color:#848484}.nsPanelWhite .nsPanelCloseIconUse,.nsPanelWhite .nsPanelFullScreenIcon{fill:#848484;color:#f6f6f6}.nsMessageBox .nsPanelBody{overflow:hidden}.nsMessageBox .nsMessageBoxHeader{padding:15px;border-bottom:1px solid #e5e5e5}.nsMessageBox .nsMessageBoxTitle{margin:0;line-height:1.42857143}.nsMessageBox .nsMessageBoxContainer{height:95%}.nsMessageBox .nsMessageBoxBody{position:relative;padding:15px;height:80%;overflow:auto}.nsMessageBox .nsMessageBoxFooter{padding:15px;border-top:1px solid #e5e5e5;height:20%}.nsMessageBox .nsMessageBoxFooter .nsMessageBoxFooterLeft{width:50%;float:left;text-align:left;height:100%}.nsMessageBox .nsMessageBoxFooter .nsMessageBoxFooterRight{width:50%;float:left;text-align:right;height:100%}.nsMessageBox .nsMessageBoxClose{-webkit-appearance:none;padding:0;cursor:pointer;background:transparent;border:0;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.nsMessageBox .nsMessageBoxButtonContainer{margin:5px;display:inline-block;position:relative}.nsPanelMessageBoxWhite{background-color:#fefefe}.nsPanelMessageBoxWhite .nsPanelTitleBar{background-color:#fff}.nsPanelMessageBoxWhite .nsPanelTitleBarContent{color:#333}.nsPanelMessageBoxWhite .nsPanelExpColIconUse{fill:#848484;color:#f6f6f6}.nsPanelMessageBoxWhite .nsPanelMinMaxIconUse{fill:#f6f6f6;color:#848484}.nsPanelMessageBoxWhite .nsPanelFullScreenIcon{fill:#848484;color:#f6f6f6}\n"], encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NSMessageBoxAngular, decorators: [{
            type: Component,
            args: [{ selector: 'ns-messageBox-angular', template: `<ng-template #dynamicContainer></ng-template>
               <ng-content></ng-content>`, encapsulation: ViewEncapsulation.None, providers: [NSDynamicComponentService], styles: [".nsPanelModalProp{display:none;position:fixed;z-index:1;padding-top:100px;left:0;top:0;width:100%;height:100%;overflow:auto;-webkit-backface-visibility:hidden;backface-visibility:hidden;background-color:#0006;transition:opacity .3s}.nsPanelModalAnimation{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.nsPanelModalProp.nsPanelModalOpen{overflow-x:hidden;overflow-y:auto}.nsPanelModalAnimation.nsPanelModalOpen{opacity:1}.nsPanel{padding:0;width:100%;pointer-events:auto;border-radius:.3rem}.nsPanel.nsPanelModalContent{position:relative;margin:auto;padding:0;width:40%;box-shadow:0 4px 8px #0003,0 6px 20px #00000030;z-Index:100}.nsPanel.nsPanelModalContentDrag{left:20%}.nsPanel.nsPanelOpen.nsPanelModalZoom{-webkit-animation-name:nsAnimateZoomIn;-webkit-animation-duration:.5s;animation-name:nsAnimateZoomIn;animation-duration:.5s}.nsPanel.nsPanelModalZoom{-webkit-animation-name:nsAnimateZoomOut;-webkit-animation-duration:.5s;animation-name:nsAnimateZoomOut;animation-duration:.5s}.nsPanel.nsPanelOpen.nsPanelModalLeft{-webkit-animation-name:nsAnimateLeftIn;-webkit-animation-duration:.5s;animation-name:nsAnimateLeftIn;animation-duration:.5s}.nsPanel.nsPanelModalLeft{-webkit-animation-name:nsAnimateLeftOut;-webkit-animation-duration:.5s;animation-name:nsAnimateLeftOut;animation-duration:.5s}.nsPanel.nsPanelOpen.nsPanelModalRight{-webkit-animation-name:nsAnimateRightIn;-webkit-animation-duration:.5s;animation-name:nsAnimateRightIn;animation-duration:.5s}.nsPanel.nsPanelModalRight{-webkit-animation-name:nsAnimateRightOut;-webkit-animation-duration:.5s;animation-name:nsAnimateRightOut;animation-duration:.5s}.nsPanel.nsPanelOpen.nsPanelModalTop{-webkit-animation-name:nsAnimateTopIn;-webkit-animation-duration:.5s;animation-name:nsAnimateTopIn;animation-duration:.5s}.nsPanel.nsPanelModalTop{-webkit-animation-name:nsAnimateTopOut;-webkit-animation-duration:.5s;animation-name:nsAnimateTopOut;animation-duration:.5s}.nsPanel.nsPanelOpen.nsPanelModalBottom{-webkit-animation-name:nsAnimateBottomIn;-webkit-animation-duration:.5s;animation-name:nsAnimateBottomIn;animation-duration:.5s}.nsPanel.nsPanelModalBottom{-webkit-animation-name:nsAnimateBottomOut;-webkit-animation-duration:.5s;animation-name:nsAnimateBottomOut;animation-duration:.5s}.nsPanel.nsPanelOpen.nsPanelModalFlipX{-webkit-animation-name:nsAnimateFlipXIn;-webkit-animation-duration:.5s;animation-name:nsAnimateFlipXIn;animation-duration:.5s}.nsPanel.nsPanelModalFlipX{-webkit-animation-name:nsAnimateFlipXOut;-webkit-animation-duration:.5s;animation-name:nsAnimateFlipXOut;animation-duration:.5s}.nsPanel.nsPanelOpen.nsPanelModalFlipY{-webkit-animation-name:nsAnimateFlipYIn;-webkit-animation-duration:.5s;animation-name:nsAnimateFlipYIn;animation-duration:.5s}.nsPanel.nsPanelModalFlipY{-webkit-animation-name:nsAnimateFlipYOut;-webkit-animation-duration:.5s;animation-name:nsAnimateFlipYOut;animation-duration:.5s}.nsPanel.nsPanelOpen.nsPanelModalRoll{-webkit-animation-name:nsAnimateRollIn;-webkit-animation-duration:.5s;animation-name:nsAnimateRollIn;animation-duration:.5s}.nsPanel.nsPanelModalRoll{-webkit-animation-name:nsAnimateRollOut;-webkit-animation-duration:.5s;animation-name:nsAnimateRollOut;animation-duration:.5s}.nsPanel.nsPanelOpen.nsPanelModalBounce{-webkit-animation-name:nsAnimateBounceIn;-webkit-animation-duration:.5s;animation-name:nsAnimateBounceIn;animation-duration:.5s}.nsPanel.nsPanelModalBounce{-webkit-animation-name:nsAnimateBounceOut;-webkit-animation-duration:.5s;animation-name:nsAnimateBounceOut;animation-duration:.5s}.nsPanel.nsPanelOpen.nsPanelModalRotate{-webkit-animation-name:nsAnimateRotateIn;-webkit-animation-duration:.5s;animation-name:nsAnimateRotateIn;animation-duration:.5s}.nsPanel.nsPanelModalRotate{-webkit-animation-name:nsAnimateRotateOut;-webkit-animation-duration:.5s;animation-name:nsAnimateRotateOut;animation-duration:.5s}.nsPanel.nsPanelOpen.nsPanelWidget{width:45%;height:45%;background:#f6f6f6}.nsPanel .nsPanelTitleBar{text-align:left;min-height:20px;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-box-align:center;-ms-flex-align:center;-ms-grid-row-align:center;align-items:center}.nsPanel .nsPanelTitleBarContent{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;cursor:move;overflow:hidden}.nsPanel .nsPanelControlbar{display:flex;-webkit-box-align:center;-ms-flex-align:center;-ms-grid-row-align:center;align-items:center;float:right}.nsPanel .nsPanelControlbar .nsPanelControlButton{padding:0 3px;cursor:pointer}.nsPanel .nsPanelBody{overflow:auto;height:91%;width:100%}.nsPanel .nsPanelExpColIcon,.nsPanel .nsPanelMinMaxIcon,.nsPanel .nsPanelFullScreenIcon,.nsPanel .nsPanelCloseIcon{width:14px;height:14px}.nsPanelMinimizeContainer{bottom:0;left:0;position:fixed;width:100%;z-index:9999}.nsPanelMinimized{height:auto!important;left:auto!important;opacity:1;top:auto!important;width:auto!important;position:static!important}.nsPanelMinimized.nsPanelMinimizedright{float:right}.nsPanelMinimized.nsPanelMinimizedleft{float:left}.nsPanelFullScreen{height:100%!important;width:100%!important;height:100vh!important;width:100vw!important;position:fixed!important;inset:0!important;margin:0;z-index:100;opacity:1}@keyframes nsAnimateZoomIn{0%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes nsAnimateZoomOut{0%{opacity:1}50%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}to{opacity:0}}@keyframes nsAnimateTopIn{0%{opacity:0;-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}to{opacity:1;-webkit-transform:none;transform:none}}@keyframes nsAnimateTopOut{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes nsAnimateBottomIn{0%{opacity:0;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}to{opacity:1;-webkit-transform:none;transform:none}}@keyframes nsAnimateBottomOut{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}}@keyframes nsAnimateLeftIn{0%{opacity:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}to{opacity:1;-webkit-transform:none;transform:none}}@keyframes nsAnimateLeftOut{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}}@keyframes nsAnimateRightIn{0%{opacity:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}to{opacity:1;-webkit-transform:none;transform:none}}@keyframes nsAnimateRightOut{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}}@keyframes nsAnimateFlipXIn{0%{-webkit-transform:perspective(400px) rotate3d(1,0,0,90deg);transform:perspective(400px) rotateX(90deg);-webkit-transition-timing-function:ease-in;transition-timing-function:ease-in;opacity:0}40%{-webkit-transform:perspective(400px) rotate3d(1,0,0,-20deg);transform:perspective(400px) rotateX(-20deg);-webkit-transition-timing-function:ease-in;transition-timing-function:ease-in}60%{-webkit-transform:perspective(400px) rotate3d(1,0,0,10deg);transform:perspective(400px) rotateX(10deg);opacity:1}80%{-webkit-transform:perspective(400px) rotate3d(1,0,0,-5deg);transform:perspective(400px) rotateX(-5deg)}to{-webkit-transform:perspective(400px);transform:perspective(400px)}}@keyframes nsAnimateFlipXOut{0%{-webkit-transform:perspective(400px);transform:perspective(400px)}30%{-webkit-transform:perspective(400px) rotate3d(1,0,0,-20deg);transform:perspective(400px) rotateX(-20deg);opacity:1}to{-webkit-transform:perspective(400px) rotate3d(1,0,0,90deg);transform:perspective(400px) rotateX(90deg);opacity:0}}@keyframes nsAnimateFlipYIn{0%{-webkit-transform:perspective(400px) rotate3d(0,1,0,90deg);transform:perspective(400px) rotateY(90deg);-webkit-transition-timing-function:ease-in;transition-timing-function:ease-in;opacity:0}40%{-webkit-transform:perspective(400px) rotate3d(0,1,0,-20deg);transform:perspective(400px) rotateY(-20deg);-webkit-transition-timing-function:ease-in;transition-timing-function:ease-in}60%{-webkit-transform:perspective(400px) rotate3d(0,1,0,10deg);transform:perspective(400px) rotateY(10deg);opacity:1}80%{-webkit-transform:perspective(400px) rotate3d(0,1,0,-5deg);transform:perspective(400px) rotateY(-5deg)}to{-webkit-transform:perspective(400px);transform:perspective(400px)}}@keyframes nsAnimateFlipYOut{0%{-webkit-transform:perspective(400px);transform:perspective(400px)}30%{-webkit-transform:perspective(400px) rotate3d(0,1,0,-15deg);transform:perspective(400px) rotateY(-15deg);opacity:1}to{-webkit-transform:perspective(400px) rotate3d(0,1,0,90deg);transform:perspective(400px) rotateY(90deg);opacity:0}}@keyframes nsAnimateRollIn{0%{opacity:0;-webkit-transform:translate3d(-100%,0,0) rotate3d(0,0,1,-120deg);transform:translate3d(-100%,0,0) rotate3d(0,0,1,-120deg)}to{opacity:1;-webkit-transform:none;transform:none}}@keyframes nsAnimateRollOut{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(100%,0,0) rotate3d(0,0,1,120deg);transform:translate3d(100%,0,0) rotate3d(0,0,1,120deg)}}@keyframes nsAnimateBounceIn{0%,to,20%,40%,60%,80%{-webkit-transition-timing-function:cubic-bezier(.215,.61,.355,1);transition-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}20%{-webkit-transform:scale3d(1.1,1.1,1.1);transform:scale3d(1.1,1.1,1.1)}40%{-webkit-transform:scale3d(.9,.9,.9);transform:scale3d(.9,.9,.9)}60%{opacity:1;-webkit-transform:scale3d(1.03,1.03,1.03);transform:scale3d(1.03,1.03,1.03)}80%{-webkit-transform:scale3d(.97,.97,.97);transform:scale3d(.97,.97,.97)}to{opacity:1;-webkit-transform:scale3d(1,1,1);transform:scaleZ(1)}}@keyframes nsAnimateBounceOut{20%{-webkit-transform:scale3d(.9,.9,.9);transform:scale3d(.9,.9,.9)}50%,55%{opacity:1;-webkit-transform:scale3d(1.1,1.1,1.1);transform:scale3d(1.1,1.1,1.1)}to{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}}@keyframes nsAnimateRotateIn{0%{-webkit-transform-origin:center;transform-origin:center;-webkit-transform:rotate3d(0,0,1,-200deg);transform:rotate3d(0,0,1,-200deg);opacity:0}to{-webkit-transform-origin:center;transform-origin:center;-webkit-transform:none;transform:none;opacity:1}}@keyframes nsAnimateRotateOut{0%{-webkit-transform-origin:center;transform-origin:center;opacity:1}to{-webkit-transform-origin:center;transform-origin:center;-webkit-transform:rotate3d(0,0,1,200deg);transform:rotate3d(0,0,1,200deg);opacity:0}}.nsPanelWhite{background-color:#fefefe;border:5px solid #157fcc}.nsPanelModalWhite .nsPanelWhite{background-color:#fff;border:5px solid #157fcc}.nsPanelWhite .nsPanelTitleBar{background-color:#157fcc;font-weight:700}.nsPanelWhite .nsPanelTitleBarContent{color:#fefefe}.nsPanelWhite .nsPanelExpColIconUse{fill:#848484;color:#f6f6f6}.nsPanelWhite .nsPanelMinMaxIconUse{fill:#f6f6f6;color:#848484}.nsPanelWhite .nsPanelCloseIconUse,.nsPanelWhite .nsPanelFullScreenIcon{fill:#848484;color:#f6f6f6}.nsMessageBox .nsPanelBody{overflow:hidden}.nsMessageBox .nsMessageBoxHeader{padding:15px;border-bottom:1px solid #e5e5e5}.nsMessageBox .nsMessageBoxTitle{margin:0;line-height:1.42857143}.nsMessageBox .nsMessageBoxContainer{height:95%}.nsMessageBox .nsMessageBoxBody{position:relative;padding:15px;height:80%;overflow:auto}.nsMessageBox .nsMessageBoxFooter{padding:15px;border-top:1px solid #e5e5e5;height:20%}.nsMessageBox .nsMessageBoxFooter .nsMessageBoxFooterLeft{width:50%;float:left;text-align:left;height:100%}.nsMessageBox .nsMessageBoxFooter .nsMessageBoxFooterRight{width:50%;float:left;text-align:right;height:100%}.nsMessageBox .nsMessageBoxClose{-webkit-appearance:none;padding:0;cursor:pointer;background:transparent;border:0;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.nsMessageBox .nsMessageBoxButtonContainer{margin:5px;display:inline-block;position:relative}.nsPanelMessageBoxWhite{background-color:#fefefe}.nsPanelMessageBoxWhite .nsPanelTitleBar{background-color:#fff}.nsPanelMessageBoxWhite .nsPanelTitleBarContent{color:#333}.nsPanelMessageBoxWhite .nsPanelExpColIconUse{fill:#848484;color:#f6f6f6}.nsPanelMessageBoxWhite .nsPanelMinMaxIconUse{fill:#f6f6f6;color:#848484}.nsPanelMessageBoxWhite .nsPanelFullScreenIcon{fill:#848484;color:#f6f6f6}\n"] }]
        }], ctorParameters: () => [{ type: i1.NSDynamicComponentService }], propDecorators: { dynamicContainer: [{
                type: ViewChild,
                args: ['dynamicContainer', { read: ViewContainerRef, static: true }]
            }], contentChildren: [{
                type: ContentChildren,
                args: [ElementRef, { descendants: true }]
            }], setting: [{
                type: Input
            }], dragStaring: [{
                type: Output
            }], dragging: [{
                type: Output
            }], dragEnd: [{
                type: Output
            }], resizeStaring: [{
                type: Output
            }], resizing: [{
                type: Output
            }], resizeEnd: [{
                type: Output
            }], collapseStarting: [{
                type: Output
            }], collapseEnd: [{
                type: Output
            }], expansionStarting: [{
                type: Output
            }], expansionEnd: [{
                type: Output
            }], minimizeStarting: [{
                type: Output
            }], minimizeEnd: [{
                type: Output
            }], maximizeStarting: [{
                type: Output
            }], maximizeEnd: [{
                type: Output
            }], fullScreenStarting: [{
                type: Output
            }], fullScreenEnd: [{
                type: Output
            }], restoreStarting: [{
                type: Output
            }], restoreEnd: [{
                type: Output
            }], closed: [{
                type: Output
            }], rendererComponentCreated: [{
                type: Output
            }] } });
class CustomBodyComponent {
    constructor(parentInstance, customEditorComponent, mainCallback) {
        this.objComponent = null;
        this.componentRef = null;
        this.parentInstance = parentInstance;
        this.customEditorComponent = customEditorComponent;
        this.mainCallback = mainCallback;
    }
    init(data) {
        return new Promise((parResolve, parReject) => {
            const callback = (dynamicCompRef, localComponentRef, container) => {
                this.componentRef = dynamicCompRef;
                this.containerRef = container;
                if (localComponentRef) {
                    this.objComponent = localComponentRef["component"] ? localComponentRef["component"] : localComponentRef;
                    this.containerRef = this.objComponent.getElement();
                    if (this.objComponent && this.objComponent.init) {
                        this.mainCallback && this.mainCallback(this.objComponent);
                        this.objComponent.init(data);
                    }
                    this.parentInstance.__objCustomComponent = {
                        instance: this.objComponent,
                        componentRef: this.componentRef,
                        component: this.customEditorComponent,
                        data: data,
                    };
                    this.parentInstance.__emitRendererComponentCreated(this.parentInstance.__objCustomComponent);
                    parResolve(localComponentRef);
                } /*else {
                    this.parentInstance.updateCallbacksOnUpdate.push({
                        callback: callback,
                        dynamicCompRef: dynamicCompRef,
                        container: container,
                        data: data
                    });
                }*/
            };
            this.parentInstance.__getComponent(this.customEditorComponent, callback, data);
        });
    }
    getElement() {
        return this.containerRef;
    }
    elementAdded() {
        if (this.objComponent && this.objComponent.elementAdded) {
            this.objComponent.elementAdded();
        }
    }
    destroy() {
        if (this.objComponent && this.objComponent.destroy) {
            this.objComponent.destroy();
        }
    }
}
//# sourceMappingURL=data:application/json;base64, 