import{V as h,w as o,a1 as S,I as T,K as b,a2 as l,a3 as v}from"./BfUaJvxP.js";function n(a,f){return a===f||a?.[v]===f}function E(a={},f,i,c){var w=h.r,d=b;return o(()=>{var s,r;return S(()=>{s=r,r=c?.()||[],T(()=>{a!==i(...r)&&(f(a,...r),s&&n(i(...s),a)&&f(null,...s))})}),()=>{let t=d;for(;t!==w&&t.parent!==null&&t.parent.f&l;)t=t.parent;const p=()=>{r&&n(i(...r),a)&&f(null,...r)},u=t.teardown;t.teardown=()=>{p(),u?.()}}}),a}export{E as b};
