import * as $ from "jquery";
import { InobyModule } from "@lib/inoby-module";
import KeenSlider from "keen-slider";
import { dots, arrows } from "@lib/keen-slider-plugins";
class HeroSliderComponent extends InobyModule {
  run() {
    const $elements = $(".inoby-hero-slider .hero-slider");

    $elements.each(function () {
      var numslides = Number($(this).parent().data("numslides"));
      const plugins = [];
      if (numslides > 1) {
        plugins.push(dots);
        plugins.push(arrows);
        $(this).addClass("keen-slider");
      }
      var slider = new KeenSlider(
        this,
        {
          selector: ".hero-slider-wrap",
          slides: {
            perView: 1,
          },
        },
        plugins
      );
    });
  }
}
new HeroSliderComponent().runOnReady();
