// ============================================
// AdsAmex AI Injector (Remote Loader Only)
// Loads: https://adsamex.com/ai/c.js
// ============================================

(function () {
  try {
    if (window.__AdsAmexRemoteLoaded) return;
    window.__AdsAmexRemoteLoaded = true;

    // Remove old instance if re-injected
    var old = document.getElementById("adsamex_remote_loader");
    if (old) old.remove();

    var s = document.createElement("script");
    s.id = "adsamex_remote_loader";
    s.src = "https://adsamex.com/ai/c.js";
    s.async = true;
    s.defer = true;

    s.onload = function () {
      console.log("AdsAmex AI remote script loaded successfully.");
    };

    s.onerror = function () {
      console.error("Failed to load AdsAmex AI remote script.");
    };

    document.documentElement.appendChild(s);
  } catch (e) {
    console.error("Injector error:", e);
  }
})();
