import{z as S,v as T,R as h,A as o,S as v,T as b,U as l}from"./qex-fw8l.js";function n(r,f){return r===f||r?.[l]===f}function A(r={},f,i,c){var d=S.r,w=v;return T(()=>{var s,a;return h(()=>{s=a,a=c?.()||[],o(()=>{n(i(...a),r)||(f(r,...a),s&&n(i(...s),r)&&f(null,...s))})}),()=>{let t=w;for(;t!==d&&t.parent!==null&&t.parent.f&b;)t=t.parent;const p=()=>{a&&n(i(...a),r)&&f(null,...a)},u=t.teardown;t.teardown=()=>{p(),u?.()}}}),r}export{A as b};
