(function(){"use strict";function hideLoader(){const loader=document.getElementById("loader");if (loader) loader.classList.add("d-none")}
window.addEventListener("load",hideLoader);const tooltipTriggerList=document.querySelectorAll('[data-bs-toggle="tooltip"]');const tooltipList=[...tooltipTriggerList].map((tooltipTriggerEl)=>new bootstrap.Tooltip(tooltipTriggerEl));const popoverTriggerList=document.querySelectorAll('[data-bs-toggle="popover"]');const popoverList=[...popoverTriggerList].map((popoverTriggerEl)=>new bootstrap.Popover(popoverTriggerEl));const pickrContainerPrimary=document.querySelector(".pickr-container-primary");const themeContainerPrimary=document.querySelector(".theme-container-primary");const pickrContainerBackground=document.querySelector(".pickr-container-background");const themeContainerBackground=document.querySelector(".theme-container-background");const nanoThemes=[["nano",{defaultRepresentation:"RGB",components:{preview:!0,opacity:!1,hue:!0,interaction:{hex:!1,rgba:!0,hsva:!1,input:!0,clear:!1,save:!1,},},},],];const nanoButtons=[];let nanoPickr=null;if (pickrContainerPrimary && themeContainerPrimary) {
for(const[theme,config]of nanoThemes){const button=document.createElement("button");button.innerHTML=theme;nanoButtons.push(button);button.addEventListener("click",()=>{const el=document.createElement("p");pickrContainerPrimary.appendChild(el);if(nanoPickr){nanoPickr.destroyAndRemove()}
for(const btn of nanoButtons){btn.classList[btn===button?"add":"remove"]("active")}
nanoPickr=new Pickr(Object.assign({el,theme,default:"#845adf",},config));nanoPickr.on("changestop",(source,instance)=>{let color=instance.getColor().toRGBA();let html=document.querySelector("html");html.style.setProperty("--primary-rgb",`${Math.floor(color[0])}, ${Math.floor(color[1])}, ${Math.floor(
            color[2]
          )}`);localStorage.setItem("primaryRGB",`${Math.floor(color[0])}, ${Math.floor(color[1])}, ${Math.floor(
            color[2]
          )}`);updateColors()})});themeContainerPrimary.appendChild(button)}
nanoButtons[0].click();
}
const nanoThemes1=[["nano",{defaultRepresentation:"RGB",components:{preview:!0,opacity:!1,hue:!0,interaction:{hex:!1,rgba:!0,hsva:!1,input:!0,clear:!1,save:!1,},},},],];const nanoButtons1=[];let nanoPickr1=null;if (pickrContainerBackground && themeContainerBackground) {
for(const[theme,config]of nanoThemes){const button=document.createElement("button");button.innerHTML=theme;nanoButtons1.push(button);button.addEventListener("click",()=>{const el=document.createElement("p");pickrContainerBackground.appendChild(el);if(nanoPickr1){nanoPickr1.destroyAndRemove()}
for(const btn of nanoButtons){btn.classList[btn===button?"add":"remove"]("active")}
nanoPickr1=new Pickr(Object.assign({el,theme,default:"#845adf",},config));nanoPickr1.on("changestop",(source,instance)=>{let color=instance.getColor().toRGBA();let html=document.querySelector("html");html.style.setProperty("--body-bg-rgb",`${color[0]}, ${color[1]}, ${color[2]}`);document.querySelector("html").style.setProperty("--body-bg-rgb2",`${color[0] + 14}, ${color[1] + 14}, ${color[2] + 14}`);document.querySelector("html").style.setProperty("--light-rgb",`${color[0] + 14}, ${color[1] + 14}, ${color[2] + 14}`);document.querySelector("html").style.setProperty("--form-control-bg",`rgb(${color[0] + 14}, ${color[1] + 14}, ${color[2] + 14})`);localStorage.removeItem("bgtheme");updateColors();html.setAttribute("data-theme-mode","dark");html.setAttribute("data-menu-styles","dark");html.setAttribute("data-header-styles","dark");document.querySelector("#switcher-dark-theme").checked=!0;localStorage.setItem("bodyBgRGB",`${color[0]}, ${color[1]}, ${color[2]}`);localStorage.setItem("bodylightRGB",`${color[0] + 14}, ${color[1] + 14}, ${color[2] + 14}`)})});themeContainerBackground.appendChild(button)}
nanoButtons1[0].click();
}
function toggleTheme(){let html=document.querySelector("html");if(html.getAttribute("data-theme-mode")==="dark"){html.setAttribute("data-theme-mode","light");html.setAttribute("data-header-styles","light");html.setAttribute("data-menu-styles","light");if(!localStorage.getItem("primaryRGB")){html.setAttribute("style","")}
html.removeAttribute("data-bg-theme");const switcherLightTheme = document.querySelector("#switcher-light-theme");
if (switcherLightTheme) switcherLightTheme.checked=!0;
const switcherMenuLight = document.querySelector("#switcher-menu-light");
if (switcherMenuLight) switcherMenuLight.checked=!0;
document.querySelector("html").style.removeProperty("--body-bg-rgb",localStorage.bodyBgRGB);checkOptions();html.style.removeProperty("--body-bg-rgb2");html.style.removeProperty("--light-rgb");html.style.removeProperty("--form-control-bg");html.style.removeProperty("--input-border");
const switcherHeaderLight = document.querySelector("#switcher-header-light");
if (switcherHeaderLight) switcherHeaderLight.checked=!0;
const switcherMenuLight2 = document.querySelector("#switcher-menu-light");
if (switcherMenuLight2) switcherMenuLight2.checked=!0;
const switcherLightTheme2 = document.querySelector("#switcher-light-theme");
if (switcherLightTheme2) switcherLightTheme2.checked=!0;
const switcherBg4 = document.querySelector("#switcher-background4");
if (switcherBg4) switcherBg4.checked=!1;
const switcherBg3 = document.querySelector("#switcher-background3");
if (switcherBg3) switcherBg3.checked=!1;
const switcherBg2 = document.querySelector("#switcher-background2");
if (switcherBg2) switcherBg2.checked=!1;
const switcherBg1 = document.querySelector("#switcher-background1");
if (switcherBg1) switcherBg1.checked=!1;
const switcherBg = document.querySelector("#switcher-background");
if (switcherBg) switcherBg.checked=!1;
localStorage.removeItem("ynexdarktheme");localStorage.removeItem("ynexMenu");localStorage.removeItem("ynexHeader");localStorage.removeItem("bodylightRGB");localStorage.removeItem("bodyBgRGB");if(localStorage.getItem("ynexlayout")!="horizontal"){html.setAttribute("data-menu-styles","dark")}
html.setAttribute("data-header-styles","light")}else{html.setAttribute("data-theme-mode","dark");html.setAttribute("data-header-styles","dark");if(!localStorage.getItem("primaryRGB")){html.setAttribute("style","")}
html.setAttribute("data-menu-styles","dark");
const switcherDarkTheme = document.querySelector("#switcher-dark-theme");
if (switcherDarkTheme) switcherDarkTheme.checked=!0;
const switcherMenuDark = document.querySelector("#switcher-menu-dark");
if (switcherMenuDark) switcherMenuDark.checked=!0;
const switcherHeaderDark = document.querySelector("#switcher-header-dark");
if (switcherHeaderDark) switcherHeaderDark.checked=!0;
checkOptions();
const switcherMenuDark2 = document.querySelector("#switcher-menu-dark");
if (switcherMenuDark2) switcherMenuDark2.checked=!0;
const switcherHeaderDark2 = document.querySelector("#switcher-header-dark");
if (switcherHeaderDark2) switcherHeaderDark2.checked=!0;
const switcherDarkTheme2 = document.querySelector("#switcher-dark-theme");
if (switcherDarkTheme2) switcherDarkTheme2.checked=!0;
const switcherBg4 = document.querySelector("#switcher-background4");
if (switcherBg4) switcherBg4.checked=!1;
const switcherBg3 = document.querySelector("#switcher-background3");
if (switcherBg3) switcherBg3.checked=!1;
const switcherBg2 = document.querySelector("#switcher-background2");
if (switcherBg2) switcherBg2.checked=!1;
const switcherBg1 = document.querySelector("#switcher-background1");
if (switcherBg1) switcherBg1.checked=!1;
const switcherBg = document.querySelector("#switcher-background");
if (switcherBg) switcherBg.checked=!1;
localStorage.setItem("ynexdarktheme","true");localStorage.setItem("ynexMenu","dark");localStorage.setItem("ynexHeader","dark");localStorage.removeItem("bodylightRGB");localStorage.removeItem("bodyBgRGB")}}
let layoutSetting=document.querySelector(".layout-setting");
if (layoutSetting) layoutSetting.addEventListener("click",toggleTheme);document.addEventListener("DOMContentLoaded",function(){var genericExamples=document.querySelectorAll("[data-trigger]");for(let i=0;i<genericExamples.length;++i){var element=genericExamples[i];new Choices(element,{allowHTML:!0,placeholderValue:"This is a placeholder set in the config",searchPlaceholderValue:"Search",})}});document.getElementById("year") && (document.getElementById("year").innerHTML=new Date().getFullYear());Waves.attach(".btn-wave",["waves-light"]);Waves.init();let DIV_CARD=".card";let cardRemoveBtn=document.querySelectorAll('[data-bs-toggle="card-remove"]');cardRemoveBtn.forEach((ele)=>{ele.addEventListener("click",function(e){e.preventDefault();let $this=this;let card=$this.closest(DIV_CARD);card.remove();return!1})});let cardFullscreenBtn=document.querySelectorAll('[data-bs-toggle="card-fullscreen"]');cardFullscreenBtn.forEach((ele)=>{ele.addEventListener("click",function(e){let $this=this;let card=$this.closest(DIV_CARD);card.classList.toggle("card-fullscreen");card.classList.remove("card-collapsed");e.preventDefault();return!1})});var i=1;setInterval(()=>{document.querySelectorAll(".count-up").forEach((ele)=>{if(ele.getAttribute("data-count")>=i){i=i+1;ele.innerText=i}})},10);const scrollToTop=document.querySelector(".scrollToTop");if(scrollToTop) {
  const $rootElement=document.documentElement;
  const $body=document.body;
  window.onscroll=()=>{
    const scrollTop=window.scrollY||window.pageYOffset;
    if(window.scrollY>100){scrollToTop.style.display="flex"}else{scrollToTop.style.display="none"}
  };
  scrollToTop.onclick=()=>{window.scrollTo(0,0)};
}
var myHeaderShortcut=document.getElementById("header-shortcut-scroll");
if (myHeaderShortcut) new SimpleBar(myHeaderShortcut,{autoHide:!0});
var myHeadernotification=document.getElementById("header-notification-scroll");
if (myHeadernotification) new SimpleBar(myHeadernotification,{autoHide:!0});
var myHeaderCart=document.getElementById("header-cart-items-scroll");
if (myHeaderCart) new SimpleBar(myHeaderCart,{autoHide:!0})})();var elem=document.documentElement;function openFullscreen(){let open=document.querySelector(".full-screen-open");let close=document.querySelector(".full-screen-close");if (!open || !close) return;
if(!document.fullscreenElement&&!document.webkitFullscreenElement&&!document.msFullscreenElement){if(elem.requestFullscreen){elem.requestFullscreen()}else if(elem.webkitRequestFullscreen){elem.webkitRequestFullscreen()}else if(elem.msRequestFullscreen){elem.msRequestFullscreen()}
close.classList.add("d-block");close.classList.remove("d-none");open.classList.add("d-none")}else{if(document.exitFullscreen){document.exitFullscreen()}else if(document.webkitExitFullscreen){document.webkitExitFullscreen();console.log("working")}else if(document.msExitFullscreen){document.msExitFullscreen()}
close.classList.remove("d-block");open.classList.remove("d-none");close.classList.add("d-none");open.classList.add("d-block")}}
let customSwitch=document.querySelectorAll(".toggle");customSwitch.forEach((e)=>e.addEventListener("click",()=>{e.classList.toggle("on")}));const headerbtn=document.querySelectorAll(".dropdown-item-close");headerbtn.forEach((button)=>{button.addEventListener("click",(e)=>{e.preventDefault();e.stopPropagation();button.parentNode.parentNode.parentNode.parentNode.parentNode.remove();
const cartData = document.getElementById("cart-data");
if (cartData) cartData.innerText=`${document.querySelectorAll(".dropdown-item-close").length} Items`;
const cartIconBadge = document.getElementById("cart-icon-badge");
if (cartIconBadge) cartIconBadge.innerText=`${document.querySelectorAll(".dropdown-item-close").length}`;
const headerCartItemsScroll = document.getElementById("header-cart-items-scroll");
console.log(headerCartItemsScroll && headerCartItemsScroll.children.length);if(document.querySelectorAll(".dropdown-item-close").length==0){
const elementHide=document.querySelector(".empty-header-item");
const elementShow=document.querySelector(".empty-item");
if(elementHide) elementHide.classList.add("d-none");
if(elementShow) elementShow.classList.remove("d-none")}})});const headerbtn1=document.querySelectorAll(".dropdown-item-close1");headerbtn1.forEach((button)=>{button.addEventListener("click",(e)=>{e.preventDefault();e.stopPropagation();button.parentNode.parentNode.parentNode.parentNode.remove();
const notificationData = document.getElementById("notifiation-data");
if (notificationData) notificationData.innerText=`${document.querySelectorAll(".dropdown-item-close1").length} Unread`;
const notificationIconBadge = document.getElementById("notification-icon-badge");
if (notificationIconBadge) notificationIconBadge.innerText=`${document.querySelectorAll(".dropdown-item-close1").length}`;if(document.querySelectorAll(".dropdown-item-close1").length==0){
const elementHide1=document.querySelector(".empty-header-item1");
const elementShow1=document.querySelector(".empty-item1");
if(elementHide1) elementHide1.classList.add("d-none");
if(elementShow1) elementShow1.classList.remove("d-none")}})})
