import e from"../../_util/raf.mjs";import{onUnmounted as t,ref as n,watch as r}from"vue";function i(i,a,o,s){let c=new Map,l=new Map,u=n(Symbol(`update`));r(i,()=>{u.value=Symbol(`update`)});let d;function f(){e.cancel(d)}function p(){f(),d=e(()=>{c.forEach((e,t)=>{if(e&&e.offsetParent){let{offsetHeight:n}=e;l.get(t)!==n&&(u.value=Symbol(`update`),l.set(t,e.offsetHeight))}})})}function m(e,t){let n=a(e),r=c.get(n);t?(c.set(n,t.$el||t),p()):c.delete(n),!r!=!t&&(t?o?.(e):s?.(e))}return t(()=>{f()}),[m,p,l,u]}export{i as default};