import{b as m,c as w,i as _}from"./index-7263344e-1727674273374.js";import{U as v,A as y,r as h,bR as R,q as S}from"./index-d5d3228c-1727674273374.js";function f(e){var n;const o=w(e);return(n=o==null?void 0:o.$el)!=null?n:o}const $=_?window:void 0;function j(){const e=h(!1);return R()&&S(()=>{e.value=!0}),e}function M(e){const n=j();return v(()=>(n.value,!!e()))}var c=Object.getOwnPropertySymbols,P=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable,z=(e,n)=>{var o={};for(var t in e)P.call(e,t)&&n.indexOf(t)<0&&(o[t]=e[t]);if(e!=null&&c)for(var t of c(e))n.indexOf(t)<0&&g.call(e,t)&&(o[t]=e[t]);return o};function I(e,n,o={}){const t=o,{window:s=$}=t,d=z(t,["window"]);let r;const i=M(()=>s&&"ResizeObserver"in s),u=()=>{r&&(r.disconnect(),r=void 0)},b=v(()=>Array.isArray(e)?e.map(a=>f(a)):[f(e)]),O=y(b,a=>{if(u(),i.value&&s){r=new ResizeObserver(n);for(const p of a)p&&r.observe(p,d)}},{immediate:!0,flush:"post",deep:!0}),l=()=>{u(),O()};return m(l),{isSupported:i,stop:l}}export{I as u};
