const convertElement = (function(e) {
	if (e == null) return element;
	if (typeof e == "string") return tagNameFactory(e);
	if (typeof e == "object") return anyFactory(e);
	if (typeof e == "function") return castFactory(e);
	throw Error("Expected function, string, or array as `test`");
});
function anyFactory(t) {
	let n = [], i = -1;
	for (; ++i < t.length;) n[i] = convertElement(t[i]);
	return castFactory(a);
	function a(...e) {
		let t = -1;
		for (; ++t < n.length;) if (n[t].apply(this, e)) return !0;
		return !1;
	}
}
function tagNameFactory(e) {
	return castFactory(t);
	function t(t) {
		return t.tagName === e;
	}
}
function castFactory(e) {
	return t;
	function t(t, n, r) {
		return !!(looksLikeAnElement(t) && e.call(this, t, typeof n == "number" ? n : void 0, r || void 0));
	}
}
function element(e) {
	return !!(e && typeof e == "object" && "type" in e && e.type === "element" && "tagName" in e && typeof e.tagName == "string");
}
function looksLikeAnElement(e) {
	return typeof e == "object" && !!e && "type" in e && "tagName" in e;
}
export { convertElement };
