import{i as E,U as S,V as T,m as x,E as O,W as Y,X as k}from"./M0Oc_jcV.js";function n(r,f){return r===f||(r==null?void 0:r[k])===f}function D(r={},f,i,A){var p=E.r,h=O;return S(()=>{var a,t;return T(()=>{a=t,t=[],x(()=>{r!==i(...t)&&(f(r,...t),a&&n(i(...a),r)&&f(null,...a))})}),()=>{let s=h;for(;s!==p&&s.parent!==null&&s.parent.f&Y;)s=s.parent;const w=()=>{t&&n(i(...t),r)&&f(null,...t)},c=s.teardown;s.teardown=()=>{w(),c==null||c()}}}),r}export{D as b};