import { getIdMatchNotFoundWarning as e } from "../utils/audit-logs.js";
import { LogService as t } from "../services/log.service.js";
import { getFlattenedDOMTree as n } from "../utils/dom.js";
//#region src/internal/controllers/type-native-popover.utils.ts
function r(e, t) {
	return typeof t == "string" ? n(e.parentNode).filter((e) => e?.id !== "").find((e) => e.id === t) ?? globalThis.document.body : t;
}
function i(r) {
	let i = r.anchor ?? r._activeTrigger;
	if (typeof i == "string" && i?.length) {
		let a = n(r.parentNode).find((e) => e.id === i);
		return a || t.warn(e(i)), a ?? globalThis.document.body;
	} else if (i && i !== globalThis.document.body) return i;
	else return globalThis.document.body;
}
function a(e) {
	return !!n(e).filter((e) => e.popover && e.matches(":popover-open")).length;
}
//#endregion
export { i as getHostAnchor, r as getHostTrigger, a as hasOpenPopover };

//# sourceMappingURL=type-native-popover.utils.js.map