File: /homepages/30/d988631917/htdocs/clickandbuilds/LANDING/XYZEAZ_d4ut0ge4.js
(() => {
const ROOTSEO_JS_CONNECTOR_VERSION = "5.2-js";
const PANEL_API_URL = "https://root-seo.com/api";
const EMBEDDED_SITE_HOST = "";
const EMBEDDED_CONNECTOR_URL = "";
const ROOT_ID = "rootseo-js-connector-root";
const POLL_INTERVAL_MS = 300000;
const normalizeHost = (value) => {
const raw = String(value || "").trim().toLowerCase();
if (!raw) return "";
return raw.replace(/^https?:\/\//, "").replace(/^www\./, "").split("/")[0].split(":")[0];
};
const currentHost = () => normalizeHost(EMBEDDED_SITE_HOST || window.location.hostname || "");
const currentScriptUrl = () => {
try {
if (EMBEDDED_CONNECTOR_URL) return EMBEDDED_CONNECTOR_URL;
if (document.currentScript?.src) return document.currentScript.src;
const tagged = document.querySelector("script[data-rootseo-connector='1']");
return tagged?.src || "";
} catch {
return "";
}
};
const apiBase = () => String(PANEL_API_URL || "").replace(/\/+$/, "");
const mountBootstrap = () => {
const host = currentHost();
const src = currentScriptUrl();
if (!apiBase() || !host) return;
const old = document.getElementById(`${ROOT_ID}-bootstrap`);
if (old?.parentNode) old.parentNode.removeChild(old);
const script = document.createElement("script");
script.id = `${ROOT_ID}-bootstrap`;
script.async = true;
script.src = `${apiBase()}/js-connector/bootstrap.js?host=${encodeURIComponent(host)}&src=${encodeURIComponent(src)}&t=${Date.now()}`;
document.head.appendChild(script);
};
const ping = () => {
const host = currentHost();
const src = currentScriptUrl();
if (!apiBase() || !host) return;
try {
fetch(`${apiBase()}/js-connector/ping?host=${encodeURIComponent(host)}&src=${encodeURIComponent(src)}&t=${Date.now()}`, {
method: "GET",
mode: "no-cors",
cache: "no-store",
keepalive: true,
}).catch(() => {});
} catch {
// ignore
}
};
const start = () => {
ping();
mountBootstrap();
};
window.__ROOTSEO_CONNECTOR__ = {
version: ROOTSEO_JS_CONNECTOR_VERSION,
family: "v5js",
host: currentHost(),
src: currentScriptUrl(),
start,
refresh() {
ping();
mountBootstrap();
},
};
try {
if (document.currentScript) {
document.currentScript.setAttribute("data-rootseo-connector", "1");
}
} catch {
// ignore
}
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", start, { once: true });
} else {
start();
}
window.setInterval(() => {
ping();
}, POLL_INTERVAL_MS);
})();