!function(e){"use strict";window.jnews=window.jnews||{},window.jnews.video=window.jnews.video||{},window.jnews.video.carousel=window.jnews.video.carousel||{};var t=function(){var t="object"==typeof jnews&&"object"==typeof jnews.library,n="function"==typeof jnews.tns;if(n&&t){var a=jnews.library;return function(t){var n=t.container;if(!a.hasClass(n,"jeg_tns_active")){var i=n.getElementsByClassName("jeg_carousel_post");if(i.length){t.container=i[0];var o=function(e){var t={textDirection:"ltr",container:e.container,controls:!1,gutter:20,controlsText:["",""],nav:!1,loop:!0,items:3,autoplay:!1,autoplayTimeout:3e3,center:!1,animateOut:"tns-fadeOut",autoHeight:!1,mouseDrag:!0,responsive:!1,edgePadding:0,lazyload:!1,lazyloadSelector:"img",mode:"carousel",speed:300,onInit:!1,sliderStyle:"slider_1",prevVideo:!1},i=!1;return t.controls=void 0===t.container.dataset.nav?t.controls:t.container.dataset.nav,t.autoplay=void 0===t.container.dataset.autoplay?t.autoplay:t.container.dataset.autoplay,t.autoplayTimeout=void 0===t.container.dataset.delay?t.autoplayTimeout:parseInt(t.container.dataset.delay),t.items=void 0===t.container.dataset.items?t.items:parseInt(t.container.dataset.items),t.gutter=void 0===t.container.dataset.margin?t.gutter:parseInt(t.container.dataset.margin),t.center=void 0===t.container.dataset.center?t.center:t.container.dataset.center,t.edgePadding=void 0===t.container.dataset.stagepadding?t.edgePadding:t.container.dataset.stagepadding,t.sliderStyle=void 0===t.container.dataset.sliderstyle?t.sliderStyle:t.container.dataset.sliderstyle,t.prevVideo=void 0===t.container.dataset.preview?t.prevVideo:t.container.dataset.preview,"false"===t.center&&(t.center=!1),"true"===t.center&&(t.center=!0),"undefined"!=typeof jnewsoption&&(i=1==jnewsoption.rtl),"undefined"!=typeof jnewsgutenbergoption&&(i=1==jnewsgutenbergoption.rtl),t.textDirection=i?"rtl":"ltr",a.hasClass(n,"jeg_col_12")&&(t.items=void 0===t.container.dataset.items?5:parseInt(t.container.dataset.items)),t.responsive={0:{items:1,edgePadding:0},321:{items:1,gutter:t.gutter>15?15:t.gutter,edgePadding:t.edgePadding>0?30:0},568:{items:2,gutter:t.gutter>15?15:t.gutter,edgePadding:t.edgePadding>0?50:0},1024:{items:t.items,edgePadding:t.edgePadding>0?t.edgePadding:0}},t.onInit=function(){"slider_4"==t.sliderStyle&&function(e,t){var n=t.querySelectorAll(".tns-controls button");if(n.length){var i=e.getElementsByClassName("thumbnail-container");if(i.length){var o=i[0].getBoundingClientRect().height;a.forEach(n,(function(e,t){var n=e.getBoundingClientRect().height,a=.5*o-.5*n;e.style.top=a+"px"}))}}}(t.container,n)},t}(t);if(void 0!==t.onInit){var r=o.onInit,d=t.onInit;t.onInit=function(n){d(n),r(n),"yes"===t.prevVideo&&e(t.container).data("video").injectEvent()}}if(t=a.extend(o,t||{}),!a.hasClass(t.container,"jeg_tns_active")){t.items>t.container.children.length&&(t.items=t.container.children.length-1>1?t.container.children.length-1:1);var s=jnews.tns(t);return void 0!==s&&(s.events.on("dragStart",(function(e){e.event.preventDefault(),e.event.stopPropagation()})),a.addClass(t.container,"jeg_tns_active"),a.dataStorage.put(t.container,"tiny-slider",s)),s}}}}}n||console.warn("Tiny Slider could not be found"),t||console.warn("JNews Library could not be found")}();window.jnews.video.carousel=t}(jQuery);