import{b as h}from"./chunk-KVVNWLBL.js";import{Ab as d,Ec as f,Fc as y,Na as p,Rb as u,Sb as l,ba as s,ra as c,sb as m}from"./chunk-ZSQR4KTU.js";import{i as r,j as a}from"./chunk-IQVXR75E.js";var g=["contentWrapper"],W=(()=>{let t=class t{customMarkupService=s(h);contentWrapper=y("contentWrapper");content=f(void 0);displayed=!1;dynamicComponentRefs=[];ngOnChanges(){return a(this,null,function*(){yield this.rebuild()})}ngOnDestroy(){this.destroyDynamicComponents()}rebuild(){return a(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:o,componentsLoaded:v,componentRefs:C}=yield this.customMarkupService.buildElement(e);return this.dynamicComponentRefs=C,yield v,this.loadElement(o)})}destroyDynamicComponents(){for(let n of this.dynamicComponentRefs)n.destroy();this.dynamicComponentRefs=[]}loadElement(n){this.contentWrapper().nativeElement.appendChild(n),this.displayed=!0}};r(t,"\u0275fac",function(e){return new(e||t)}),r(t,"\u0275cmp",p({type:t,selectors:[["my-custom-markup-container"]],viewQuery:function(e,o){e&1&&u(o.contentWrapper,g,5),e&2&&l()},inputs:{content:[1,"content"]},features:[c],decls:2,vars:1,consts:[["contentWrapper",""],[1,"custom-markup-container",3,"hidden"]],template:function(e,o){e&1&&m(0,"div",1,0),e&2&&d("hidden",!o.displayed)},encapsulation:2}));let i=t;return i})();export{W as a};
/**i18n:347eeb695970c32bc275618edc2e751c67145d9fc3012e70543c114a99b9e016*/
//# sourceMappingURL=chunk-F7TPA7YV.js.map
