!function(e){"use strict";jQuery(window),window.nocturne={},nocturne.storageKey="theme-preference",nocturne.getColorPreference=function(){return"dark"===document.documentElement.getAttribute("data-scheme")?"dark":localStorage.getItem(nocturne.storageKey)?localStorage.getItem(nocturne.storageKey):window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"},nocturne.theme={value:nocturne.getColorPreference()},nocturne.reflectPreference=function(){document.firstElementChild.classList.remove("light","dark"),document.firstElementChild.classList.add(nocturne.theme.value),document.querySelectorAll(".nocturne-dark-mode-trigger").forEach((e=>{e?.setAttribute("aria-label",nocturne.theme.value)}))},nocturne.setPreference=function(){localStorage.setItem(nocturne.storageKey,nocturne.theme.value),nocturne.reflectPreference()},window.addEventListener("load",(()=>{nocturne.reflectPreference(),document.querySelectorAll(".js-dark-mode-trigger").forEach((e=>{e.addEventListener("click",(e=>function(e){e.preventDefault(),nocturne.theme.value="light"===nocturne.theme.value?"dark":"light",nocturne.setPreference()}(e)))}))})),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",(({matches:e})=>{nocturne.theme.value=e?"dark":"light",nocturne.setPreference()})),nocturne.reflectPreference()}();