import { CONTINUE, EXIT, SKIP, visitParents } from "../../unist-util-visit-parents/lib/index.js";
function visit(e, t, n, i) {
	let a, o, s;
	typeof t == "function" && typeof n != "function" ? (o = void 0, s = t, a = n) : (o = t, s = n, a = i), visitParents(e, o, c, a);
	function c(e, t) {
		let n = t[t.length - 1], r = n ? n.children.indexOf(e) : void 0;
		return s(e, r, n);
	}
}
export { visit };
