document.addEventListener("DOMContentLoaded", function() {
    var illustrator_designer_togglerIconImg = document.querySelector(".toggler_icon a");
    var illustrator_designer_TogglerBody = document.querySelector(".library_toggler_body");
    var illustrator_designer_closeButton = document.querySelector(".library_toggler_body .toggler_close a");

    illustrator_designer_togglerIconImg.addEventListener("click", function() {
        if (illustrator_designer_TogglerBody.style.display === "none" || !illustrator_designer_TogglerBody.style.display) {
            illustrator_designer_TogglerBody.style.display = "block";
            illustrator_designer_TogglerBody.style.transition = "display 1s";
        } else {
            illustrator_designer_TogglerBody.style.display = "none";
        }
    });

    illustrator_designer_closeButton.addEventListener("click", function() {
        illustrator_designer_TogglerBody.style.display = "none";
    });
});

jQuery(document).ready(function () {
	
	function illustrator_designer_search_loop_focus(element) {
		var illustrator_designer_focus = element.find('select, input, textarea, button, a[href] , a');
		var illustrator_designer_firstFocus = illustrator_designer_focus[0];  
		var illustrator_designer_lastFocus = illustrator_designer_focus[illustrator_designer_focus.length - 1];
		var KEYCODE_TAB = 9;

		element.on('keydown', function illustrator_designer_search_loop_focus(e) {
			var isTabPressed = (e.key === 'Tab' || e.keyCode === KEYCODE_TAB);

			if (!isTabPressed) {
			  return; 
			}

			if ( e.shiftKey ) /* shift + tab */ {
			  if (document.activeElement === illustrator_designer_firstFocus) {
		    illustrator_designer_lastFocus.focus();
		      e.preventDefault();
		    }
		  } else /* tab */ {
		  	if (document.activeElement === illustrator_designer_lastFocus) {
		    	illustrator_designer_firstFocus.focus();
		      e.preventDefault();
		    }
		  }
		});
	}

    illustrator_designer_search_loop_focus(jQuery('.toggler_content_col'));

});

// swiper js
jQuery(document).ready(function () {
  var illustrator_designer_swiper_testimonials = new Swiper(".testimonial-swiper-slider.mySwiper", {
    slidesPerView: 3,
      spaceBetween: 15,
      speed: 1000,
      autoplay: {
        delay: 3000,
        disableOnInteraction: false,
      },
      navigation: {
        nextEl: ".testimonial-swiper-button-next",
        prevEl: ".testimonial-swiper-button-prev",
      },
      breakpoints: {
        0: {
          slidesPerView: 1,
        },
        767: {
          slidesPerView: 2,
        },
        1023: {
          slidesPerView: 3,
        }
      },
  })
});