import { GLOBAL_OBJ } from "./worldwide.js";
//#region node_modules/@sentry/core/build/esm/utils/browser.js
var WINDOW = GLOBAL_OBJ;
function getLocationHref() {
	try {
		return WINDOW.document.location.href;
	} catch {
		return "";
	}
}
function getComponentName(elem, maxTraverseHeight = 5) {
	if (!WINDOW.HTMLElement) return null;
	let currentElem = elem;
	for (let i = 0; i < maxTraverseHeight; i++) {
		if (!currentElem) return null;
		if (currentElem instanceof HTMLElement) {
			if (currentElem.dataset["sentryComponent"]) return currentElem.dataset["sentryComponent"];
			if (currentElem.dataset["sentryElement"]) return currentElem.dataset["sentryElement"];
		}
		currentElem = currentElem.parentNode;
	}
	return null;
}
//#endregion
export { getComponentName, getLocationHref };
