import{C as O,_ as l}from"./bootstrap-DToyB3NB.js";import{i as R}from"./ResizeObserver.es-CDE7jhPe.js";import{a4 as w,T as x,a9 as M,p as H,ax as W,Y as _,q as B}from"../jse/index-index-DT9LOzen.js";const q=w({compatConfig:{MODE:3},name:"ResizeObserver",props:{disabled:Boolean,onResize:Function},emits:["resize"],setup(i,v){let{slots:c}=v;const n=x({width:0,height:0,offsetHeight:0,offsetWidth:0});let h=null,s=null;const r=()=>{s&&(s.disconnect(),s=null)},b=e=>{const{onResize:t}=i,o=e[0].target,{width:z,height:C}=o.getBoundingClientRect(),{offsetWidth:d,offsetHeight:f}=o,g=Math.floor(z),m=Math.floor(C);if(n.width!==g||n.height!==m||n.offsetWidth!==d||n.offsetHeight!==f){const u={width:g,height:m,offsetWidth:d,offsetHeight:f};l(n,u),t&&Promise.resolve().then(()=>{t(l(l({},u),{offsetWidth:d,offsetHeight:f}),o)})}},p=B(),a=()=>{const{disabled:e}=i;if(e){r();return}const t=O(p);t!==h&&(r(),h=t),!s&&t&&(s=new R(b),s.observe(t))};return M(()=>{a()}),H(()=>{a()}),W(()=>{r()}),_(()=>i.disabled,()=>{a()},{flush:"post"}),()=>{var e;return(e=c.default)===null||e===void 0?void 0:e.call(c)[0]}}});export{q as R};
