(function ($, root, undefined) {
  $(function () {
    "use strict";
    $(document).ready(function () {
      let windowH = $(window).outerHeight();
      // console.log(windowH)
      const mainSlider = () => {
        var revapi225, tpj;
        (function () {
          if (!/loaded|interactive|complete/.test(document.readyState))
            document.addEventListener("DOMContentLoaded", onLoad);
          else onLoad();

          function onLoad() {
            if (tpj === undefined) {
              tpj = jQuery;
              if ("off" == "on") tpj.noConflict();
            }

            if (tpj("#rev_slider_225_1").revolution == undefined) {
              revslider_showDoubleJqueryError("#rev_slider_225_1");
            } else {
              revapi225 = tpj("#rev_slider_225_1")
                .show()
                .revolution({
                  sliderType: "standard",
                  jsFileLocation: "/include/rs-plugin/js/",
                  sliderLayout: "fullwidth",
                  dottedOverlay: "none",
                  delay: 9000,
                  navigation: {
                    keyboardNavigation: "off",
                    keyboard_direction: "horizontal",
                    mouseScrollNavigation: "off",
                    mouseScrollReverse: "default",
                    onHoverStop: "off",
                    arrows: {
                      style: "uranus",
                      enable: true,
                      hide_onmobile: false,
                      hide_onleave: false,
                      tmp: "",
                      left: {
                        h_align: "left",
                        v_align: "center",
                        h_offset: 20,
                        v_offset: 0,
                      },
                      right: {
                        h_align: "right",
                        v_align: "center",
                        h_offset: 20,
                        v_offset: 0,
                      },
                    },
                    bullets: {
                      enable: true,
                      hide_onmobile: false,
                      style: "light-bars",
                      hide_onleave: false,
                      direction: "horizontal",
                      h_align: "center",
                      v_align: "bottom",
                      h_offset: 0,
                      v_offset: 30,
                      space: 10,
                      tmp: "",
                    },
                  },
                  responsiveLevels: [1240, 1024, 778, 480],
                  visibilityLevels: [1240, 1024, 778, 480],
                  gridwidth: [1240, 1024, 778, 480],
                  gridheight: [650, 650, windowH + 100, windowH + 100],
                  lazyType: "none",
                  parallax: {
                    type: "scroll",
                    origo: "slidercenter",
                    speed: 1000,
                    speedbg: 0,
                    speedls: 0,
                    levels: [
                      2, 4, 6, 8, 10, 12, 14, 40, 45, -5, -10, -15, -20, 50, 51,
                      55,
                    ],
                  },
                  shadow: 0,
                  spinner: "spinner3",
                  stopLoop: "off",
                  stopAfterLoops: -1,
                  stopAtSlide: -1,
                  shuffle: "off",
                  autoHeight: "off",
                  hideThumbsOnMobile: "off",
                  hideSliderAtLimit: 0,
                  hideCaptionAtLimit: 0,
                  hideAllCaptionAtLilmit: 0,
                  debugMode: false,
                  fallbacks: {
                    simplifyAll: "off",
                    nextSlideOnWindowFocus: "off",
                    disableFocusListener: false,
                  },
                });
            }

            BubbleMorphAddOn(jQuery, revapi225, false);

            if (typeof ExplodingLayersAddOn !== "undefined")
              ExplodingLayersAddOn(tpj, revapi225);
          }
        })();
      };

      $("#mobile-menu-trigger a svg").on("click", function () {
        $(".mobile-menu-area").addClass("active");
        $("body").addClass("menu-shadow");
      });
      $(".close-mobile-menu").on("click", function () {
        $(".mobile-menu-area").removeClass("active");
        $("body").removeClass("menu-shadow");
      });

      if ($(window).width() < 992) {
        $(".vid-bg-section a").attr("target", "_blank");
      }

      $(".close-cart-mobile a").on("click", function () {
        $("#top-cart").removeClass("top-cart-open");
      });

      const FooterFix = () => {
        if ($(window).width() > 991) {
          $("#footer li.nav-item").addClass("wide-footer-link");
          $("#footer li.nav-item .dropdown-menu").addClass("show");
          $(".nav-item .nav-link").hide();
          $(".nav-item .big-footer-nav-title").show();
        } else {
          $("#footer li.nav-item").removeClass("wide-footer-link");
          $("#footer li.nav-item .dropdown-menu").removeClass("show");
          $(".nav-item .big-footer-nav-title").hide();
          $(".nav-item .nav-link").show();
        }
      };

      $(window).resize(function () {
        FooterFix();
      });

      mainSlider();
      FooterFix();
    });
  });
})(jQuery, this);
