(e=>{"function"==typeof define&&define.amd?define("carousel",e):e()})(function(){jQuery(function(r){r(".gallery-prev-btn").click(function(e){e.preventDefault(),r(this).parents(".element").find(".gallery-carousel.owl-carousel").trigger("prev.owl.carousel")}),r(".gallery-next-btn").click(function(e){e.preventDefault(),r(this).parents(".element").find(".gallery-carousel.owl-carousel").trigger("next.owl.carousel")}),r(".element.video-block").on("click",".prev-next-pagination a.prev",function(e){e.preventDefault(),r(this).hasClass("disabled")||r(this).closest(".element.video-block").find(".video-gallery-carousel.owl-carousel").trigger("prev.owl.carousel")}),r(".element.video-block").on("click",".prev-next-pagination a.next",function(e){e.preventDefault(),r(this).hasClass("disabled")||r(this).closest(".element.video-block").find(".video-gallery-carousel.owl-carousel").trigger("next.owl.carousel")}),r(".element.video-block .video-gallery-carousel.owl-carousel").on("initialized.owl.carousel changed.owl.carousel refreshed.owl.carousel resized.owl.carousel",function(e){var t,l,i,a,n,o;t=r(this),e=e,(o=t.closest(".element.video-block")).length&&(t=t.data("owl.carousel"))&&(l=o.find(".prev-next-pagination a.prev").first(),o=o.find(".prev-next-pagination a.next").first(),l.length)&&o.length&&(a=i=!0,a=e&&e.page&&"number"==typeof e.page.index&&"number"==typeof e.page.count?(i=0===e.page.index,e.page.index>=e.page.count-1):e&&e.item&&"number"==typeof e.item.index?(n="number"==typeof e.item.count?e.item.count:t.items().length,i=(e=t.relative(e.item.index))<=0,n-1<=e):(i=(n=t.relative(t.current()))<=0,n>=t.items().length-1),l.toggleClass("disabled",i).attr("aria-disabled",i?"true":"false"),o.toggleClass("disabled",a).attr("aria-disabled",a?"true":"false"))})}),MyListing.GalleryCarousel=function(){jQuery(function(a){a(".gallery-carousel").each(function(e,t){var l=a(t).data("items")?a(t).data("items"):3,i=a(t).data("items-mobile")?a(t).data("items-mobile"):2;a(t).owlCarousel({margin:10,items:l,mouseDrag:!1,responsive:{0:{items:i},600:{items:3<l?3:l},1e3:{items:l}}}),a(t).on("changed.owl.carousel",function(){a(this).find("video").each(function(){!1===this.paused&&this.pause()})})})})},MyListing.GalleryCarousel()});
