var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
const UNLBannerUrl = "/wdn/templates_6.1/js/components/component.banner.js?v=6.1.1", UNLAnalyticsUrl = "/wdn/templates_6.1/js/components/component.analytics.js?v=6.1.1", UNLAlertUrl = "/wdn/templates_6.1/js/components/component.alert.js?v=6.1.1";
function loadJS(jsSrc, module = !1) {
  return new Promise((resolve, reject) => {
    if (document.querySelector(`script[src="${jsSrc}"]`) !== null) {
      resolve();
      return;
    }
    const newScript = document.createElement("script");
    newScript.src = jsSrc, module && newScript.setAttribute("type", "module"), newScript.addEventListener("load", () => {
      resolve();
    }), newScript.addEventListener("error", () => {
      reject(new Error(`Failed to load script: ${jsSrc}`));
    }), document.head.appendChild(newScript);
  });
}
__name(loadJS, "loadJS");
window.UNL = window.UNL || {};
window.UNL.banner = window.UNL.banner || {};
window.UNL.banner.config = window.UNL.banner.config || {};
window.UNL.alert = window.UNL.alert || {};
window.UNL.alert.config = window.UNL.alert.config || {};
window.UNL.analytics = window.UNL.analytics || {};
window.UNL.analytics.config = window.UNL.analytics.config || {};
window.UNL.chat = window.UNL.chat || {};
window.UNL.chat.config = window.UNL.chat.config || {};
const bannerEnabled = window.UNL.banner.config?.enabled ?? !0, alertEnabled = window.UNL.alert.config?.enabled ?? !0, analyticsEnabled = window.UNL.analytics.config?.enabled ?? !0, chatEnabled = window.UNL.chat.config?.enabled ?? !0;
bannerEnabled !== !1 && loadBanner();
alertEnabled !== !1 && loadAlert();
analyticsEnabled !== !1 && loadAnalytics();
chatEnabled !== !1 && loadChat();
async function loadBanner() {
  const UNLBanner = await import(UNLBannerUrl);
  new UNLBanner.default(), window.UNL.banner.loaded = !0;
}
__name(loadBanner, "loadBanner");
async function loadAlert() {
  const UNLAlert = await import(UNLAlertUrl);
  new UNLAlert.default(), window.UNL.alert.loaded = !0;
}
__name(loadAlert, "loadAlert");
async function loadAnalytics() {
  const UNLAnalytics = await import(UNLAnalyticsUrl);
  new UNLAnalytics.default(), window.UNL.analytics.loaded = !0;
}
__name(loadAnalytics, "loadAnalytics");
async function loadChat() {
  const unlChatUrl = "https://ucommchat.unl.edu/assets/js", todayParts = (/* @__PURE__ */ new Date()).toLocaleDateString().split("/");
  loadJS(`${unlChatUrl}?for=client&version=6.1&cb=${todayParts[2]}${todayParts[0]}${todayParts[1]}`, !0), window.UNL.chat.loaded = !0;
}
__name(loadChat, "loadChat");
//# sourceMappingURL=header-global-1.js.map
