/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { EventEmitter, Component, ViewChild, ChangeDetectionStrategy, ViewContainerRef } from '@angular/core';
import * as i0 from "@angular/core";
var IgxComponentRendererContainerComponent = /** @class */ /*@__PURE__*/ (function () {
    function IgxComponentRendererContainerComponent(_renderer, _elRef, _ngZone, _componentFactoryResolver, _injector) {
        this._renderer = _renderer;
        this._elRef = _elRef;
        this._ngZone = _ngZone;
        this._componentFactoryResolver = _componentFactoryResolver;
        this._injector = _injector;
        this.listeners = [];
        this._currentRoot = null;
        this._currentRootRef = null;
    }
    IgxComponentRendererContainerComponent.isEvent = function (ev) {
        return ev instanceof EventEmitter;
    };
    IgxComponentRendererContainerComponent.prototype.replaceRootItem = function (t, continueActions) {
        if (this._currentRoot != null) {
            this._currentRoot;
        }
        var cf = this._componentFactoryResolver.resolveComponentFactory(t);
        var cr = this._dynamicContent.createComponent(cf);
        this._currentRootRef = cr;
        this._currentRoot = cr.instance;
        this._currentRoot.width = "100%";
        this._currentRoot.height = "100%";
        continueActions(false);
    };
    IgxComponentRendererContainerComponent.prototype.clearContainer = function (continueActions) {
        if (this._currentRootRef) {
            this._currentRootRef.destroy();
            this._currentRootRef = null;
            this._currentRoot = null;
        }
        continueActions(false);
    };
    IgxComponentRendererContainerComponent.prototype.getRootObject = function () {
        return this._currentRoot;
    };
    IgxComponentRendererContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: IgxComponentRendererContainerComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ViewContainerRef }, { token: i0.NgZone }, { token: i0.ComponentFactoryResolver }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
    IgxComponentRendererContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.14", type: IgxComponentRendererContainerComponent, selector: "igx-component-renderer-container", viewQueries: [{ propertyName: "_dynamicContent", first: true, predicate: ["dynamicContent"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "\n    <ng-container #dynamicContent></ng-container>\n  ", isInline: true, styles: ["\n  :host {\n    display: block;\n  }"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
    return IgxComponentRendererContainerComponent;
}());
export { IgxComponentRendererContainerComponent };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: IgxComponentRendererContainerComponent, decorators: [{
            type: Component,
            args: [{
                    selector: 'igx-component-renderer-container',
                    changeDetection: ChangeDetectionStrategy.OnPush,
                    template: "\n    <ng-container #dynamicContent></ng-container>\n  ",
                    styles: ["\n  :host {\n    display: block;\n  }"]
                }]
        }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ViewContainerRef }, { type: i0.NgZone }, { type: i0.ComponentFactoryResolver }, { type: i0.Injector }]; }, propDecorators: { _dynamicContent: [{
                type: ViewChild,
                args: ["dynamicContent", { read: ViewContainerRef, static: true }]
            }] } });
