const e=e=>document.createElement(e),t=(e,t)=>e.appendChild(t);class i extends HTMLElement{constructor(){super();const i=this.attachShadow({mode:"open"}),n=e("style");n.textContent=":host {\n      display: block;\n      overflow: hidden\n    }",this._wrapper=e("div");const s=e("slot");t(i,n),t(i,this._wrapper),t(this._wrapper,s)}connectedCallback(){null!=window.ResizeObserver&&(this._ro=new ResizeObserver((()=>{if(null==this.animate||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let e=this._oldHeight;null!=this._animation&&"finished"!==this._animation.playState&&(this._animation.pause(),e=getComputedStyle(this).height,this._animation.finish());const t=getComputedStyle(this).height;e!==t&&(null!=e&&(this._animation=this.animate([{height:e},{height:t}],{duration:300,easing:"ease-in-out"})),this._oldHeight=t)})),this._ro.observe(this._wrapper))}disconnectedCallback(){null!=window.ResizeObserver&&this._ro.unobserve(this._wrapper)}}window.customElements.define("cc-expand",i);export{i as CcExpand};
//# sourceMappingURL=cc-expand.js.map
