/* * ----------------------------------------------------------------------------- * Halfmoon JS * Version: 1.1.1 * https://www.gethalfmoon.com * Copyright, Halfmoon UI * Licensed under MIT (https://www.gethalfmoon.com/license) * ----------------------------------------------------------------------------- * The above notice must be included in its entirety when this file is used. */ Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;do{if(t.matches(e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null}),"document"in self&&("classList"in document.createElement("_")&&(!document.createElementNS||"classList"in document.createElementNS("http://www.w3.org/2000/svg","g"))||function(e){"use strict";if("Element"in e){var t="classList",o="prototype",a=e.Element[o],s=Object,n=String[o].trim||function(){return this.replace(/^\s+|\s+$/g,"")},i=Array[o].indexOf||function(e){for(var t=0,o=this.length;t"+o+""+t),r.classList.add("alert"),a&&r.classList.add(a),s&&r.classList.add(s),n&&(t=""+t),r.innerHTML=t,this.stickyAlerts.insertBefore(r,this.stickyAlerts.childNodes[0]),this.toastAlert(r.getAttribute("id"),i)},clickHandler:function(e){},keydownHandler:function(e){}};function halfmoonOnDOMContentLoaded(){halfmoon.pageWrapper||(halfmoon.pageWrapper=document.getElementsByClassName("page-wrapper")[0]),halfmoon.stickyAlerts||(halfmoon.stickyAlerts=document.getElementsByClassName("sticky-alerts")[0]),halfmoon.readCookie("halfmoon_preferredMode")?"dark-mode"==halfmoon.readCookie("halfmoon_preferredMode")?halfmoon.darkModeOn=!0:halfmoon.darkModeOn=!1:window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches||document.body.classList.contains("dark-mode")?halfmoon.darkModeOn=!0:halfmoon.darkModeOn=!1,(document.body.getAttribute("data-set-preferred-mode-onload")||document.body.getAttribute("data-set-preferred-theme-onload"))&&(halfmoon.darkModeOn?document.body.classList.contains("dark-mode")||document.body.classList.add("dark-mode"):document.body.classList.contains("dark-mode")&&document.body.classList.remove("dark-mode")),document.documentElement.clientWidth<=768?halfmoon.pageWrapper&&(halfmoon.pageWrapper.getAttribute("data-show-sidebar-onload-sm-and-down")||halfmoon.pageWrapper.setAttribute("data-sidebar-hidden","hidden")):halfmoon.pageWrapper&&"overlayed-all"===halfmoon.pageWrapper.getAttribute("data-sidebar-type")&&halfmoon.pageWrapper.setAttribute("data-sidebar-hidden","hidden"),document.addEventListener("click",function(e){var t,o,a=e,s=e.target;s.matches("[data-toggle='dropdown']")||s.matches("[data-toggle='dropdown'] *")?(s.matches("[data-toggle='dropdown'] *")&&(s=s.closest("[data-toggle='dropdown']")),s.classList.contains("active")?(s.classList.remove("active"),s.closest(".dropdown").classList.remove("show")):(halfmoon.deactivateAllDropdownToggles(),s.classList.add("active"),s.closest(".dropdown").classList.add("show"))):s.matches(".dropdown-menu *")||halfmoon.deactivateAllDropdownToggles(),(s.matches(".alert [data-dismiss='alert']")||s.matches(".alert [data-dismiss='alert'] *"))&&(s.matches(".alert [data-dismiss='alert'] *")&&(s=s.closest(".alert [data-dismiss='alert']")),s.parentNode.classList.add("dispose")),(s.matches("[data-toggle='modal']")||s.matches("[data-toggle='modal'] *"))&&(s.matches("[data-toggle='modal'] *")&&(s=s.closest("[data-toggle='modal']")),(t=document.getElementById(s.getAttribute("data-target")))&&t.classList.contains("modal")&&halfmoon.toggleModal(s.getAttribute("data-target"))),(s.matches(".modal [data-dismiss='modal']")||s.matches(".modal [data-dismiss='modal'] *"))&&(s.matches(".modal [data-dismiss='modal'] *")&&(s=s.closest(".modal [data-dismiss='modal']")),s.closest(".modal").classList.remove("show")),s.matches(".modal-dialog")&&((o=s.closest(".modal")).getAttribute("data-overlay-dismissal-disabled")||(o.classList.contains("show")?o.classList.remove("show"):window.location.hash="#")),halfmoon.clickHandler(a)},!1),document.addEventListener("keydown",function(e){var t,o,a,s=e;document.querySelector("input:focus")||document.querySelector("textarea:focus")||document.querySelector("select:focus")||(e=e||window.event).ctrlKey||e.metaKey||(document.body.getAttribute("data-sidebar-shortcut-enabled")&&e.shiftKey&&83==e.which&&(t=!1,window.location.hash&&(o=window.location.hash.substring(1),(a=document.getElementById(o))&&a.classList.contains("modal")&&(t=!0)),document.querySelector(".modal.show")&&(t=!0),t||(halfmoon.toggleSidebar(),e.preventDefault())),document.body.getAttribute("data-dm-shortcut-enabled")&&e.shiftKey&&68==e.which&&(halfmoon.toggleDarkMode(),e.preventDefault())),27===e.which&&(document.querySelector("[data-toggle='dropdown'].active")?((a=document.querySelector("[data-toggle='dropdown'].active")).classList.remove("active"),a.closest(".dropdown").classList.remove("show"),e.preventDefault()):(window.location.hash&&(o=window.location.hash.substring(1),(a=document.getElementById(o))&&a.classList.contains("modal")&&(a.getAttribute("data-esc-dismissal-disabled")||(window.location.hash="#",e.preventDefault()))),document.querySelector(".modal.show")&&((a=document.querySelector(".modal.show")).getAttribute("data-esc-dismissal-disabled")||(a.classList.remove("show"),e.preventDefault())))),halfmoon.keydownHandler(s)});for(var e=document.querySelectorAll(".custom-file input"),t=0;t