import{o as F}from"./chunk-C6uGsfWa.js";import{F as Cx,Gr as Va,Nc as yx,Uo as m$,Wa as g,_s as ph,ga as ci,s as $x,vr as She}from"./chunk-B_pj7Jpm.js";import{n as we}from"./chunk-C7xC8igR.js";var v=[`contentWrapper`];var y=class a{customMarkupService=g(we);contentWrapper=She(`contentWrapper`);content=ph(void 0);displayed=!1;dynamicComponentRefs=[];ngOnChanges(){return F(this,null,function*(){yield this.rebuild()})}ngOnDestroy(){this.destroyDynamicComponents()}rebuild(){return F(this,null,function*(){this.destroyDynamicComponents();let n=this.contentWrapper();n&&(n.nativeElement.innerHTML=``);let e=this.content();if(e instanceof HTMLDivElement)return this.loadElement(e);let{rootElement:t,componentsLoaded:f,componentRefs:h}=yield this.customMarkupService.buildElement(e);return this.dynamicComponentRefs=h,yield f,this.loadElement(t)})}destroyDynamicComponents(){for(let n of this.dynamicComponentRefs)n.destroy();this.dynamicComponentRefs=[]}loadElement(n){this.contentWrapper().nativeElement.appendChild(n),this.displayed=!0}static ɵfac=function(e){return new(e||a)};static ɵcmp=Va({type:a,selectors:[[`my-custom-markup-container`]],viewQuery:function(e,t){e&1&&$x(t.contentWrapper,v,5),e&2&&m$()},inputs:{content:[1,`content`]},features:[ci],decls:2,vars:1,consts:[[`contentWrapper`,``],[1,`custom-markup-container`,3,`hidden`]],template:function(e,t){e&1&&yx(0,`div`,1,0),e&2&&Cx(`hidden`,!t.displayed)},encapsulation:2,changeDetection:1})};export{y as t};
//# debugId=79a1a675-9f8b-594d-bec1-eeff3be21db8
//# sourceMappingURL=chunk-CnHIWBBZ.js.map