From 75f5127300f41593af0fc319285a32f9b1db6848 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Auswo=CC=88ger?= Date: Tue, 23 Mar 2021 08:22:20 +0100 Subject: [PATCH] Update jQuery plugin to version 1.6.11 --- src/Resources/public/js/rocksolid-slider.js | 41 ++++++++++--------- .../public/js/rocksolid-slider.min.js | 4 +- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/src/Resources/public/js/rocksolid-slider.js b/src/Resources/public/js/rocksolid-slider.js index 02fbb2c..5674dca 100644 --- a/src/Resources/public/js/rocksolid-slider.js +++ b/src/Resources/public/js/rocksolid-slider.js @@ -1,4 +1,4 @@ -/*! rocksolid-slider v1.6.10 */ +/*! rocksolid-slider v1.6.11 */ (function($, window, document) { var Rst = {}; @@ -756,12 +756,7 @@ Rst.Slide = (function() { src += '&start=' + time; } - this.videoElement = $(document.createElement('iframe')) - .addClass(this.slider.options.cssPrefix + 'video-iframe') - .attr('src', src) - .attr('frameborder', 0) - .attr('allowfullscreen', 'allowfullscreen') - .appendTo(this.element); + this.videoElement = this.createVideoIframe(src).appendTo(this.element); apiCallback = function() { if (self.videoElement && window.YT) { @@ -813,12 +808,7 @@ Rst.Slide = (function() { src += '#t=' + time; } - this.videoElement = $(document.createElement('iframe')) - .addClass(this.slider.options.cssPrefix + 'video-iframe') - .attr('src', src) - .attr('frameborder', 0) - .attr('allowfullscreen', 'allowfullscreen') - .appendTo(this.element); + this.videoElement = this.createVideoIframe(src).appendTo(this.element); this.eventNamespace = 'rsts' + new Date().getTime(); $(window).on('message.' + this.eventNamespace, function(event) { @@ -841,12 +831,7 @@ Rst.Slide = (function() { this.element.addClass(this.slider.options.cssPrefix + 'video-unknown'); - this.videoElement = $(document.createElement('iframe')) - .addClass(this.slider.options.cssPrefix + 'video-iframe') - .attr('src', this.data.video) - .attr('frameborder', 0) - .attr('allowfullscreen', 'allowfullscreen') - .appendTo(this.element); + this.videoElement = this.createVideoIframe(this.data.video).appendTo(this.element); } @@ -866,6 +851,18 @@ Rst.Slide = (function() { }; + /** + * @return {jQuery.} + */ + Slide.prototype.createVideoIframe = function(src) { + return $(document.createElement('iframe')) + .addClass(this.slider.options.cssPrefix + 'video-iframe') + .attr('frameborder', 0) + .attr('allowfullscreen', 'allowfullscreen') + .attr('allow', 'autoplay; encrypted-media; picture-in-picture; fullscreen') + .attr('src', src); + }; + /** * Set index */ @@ -2569,6 +2566,12 @@ Rst.Slider = (function() { } } + // Fix issues with min-content contribution in grid and flex layouts + this.modify(this.elements.crop, { + width: '', + height: '' + }); + this.nav.resize(); var size = this.getViewSize(this.slideIndex); diff --git a/src/Resources/public/js/rocksolid-slider.min.js b/src/Resources/public/js/rocksolid-slider.min.js index 83138a6..1e8f8e4 100644 --- a/src/Resources/public/js/rocksolid-slider.min.js +++ b/src/Resources/public/js/rocksolid-slider.min.js @@ -1,5 +1,5 @@ -/*! rocksolid-slider v1.6.10 */ -(function(d,c,a){var b={};b.Slide=(function(){function e(g,h){var f=this;this.slider=h;this.element=d(a.createElement("div")).addClass(h.options.cssPrefix+"slide");this.data={name:undefined,sliderClasses:[]};this.backgrounds=d([]);if(g.nodeName.toLowerCase()==="script"&&g.type==="text/html"){this.contentHtml=g.innerHTML.replace(/\\(.)/gi,"$1");this.data.name=d(g).attr("data-rsts-name")||undefined;this.data.thumbUrl=d(g).attr("data-rsts-thumb")||undefined;this.data.thumbHtml=d(g).attr("data-rsts-thumb-html")||undefined}else{this.init(g)}this.setState("inactive")}e.prototype.init=function(j){var i=this;if(this.isInitialized()){return}if(!j&&this.contentHtml){j=d(this.contentHtml)[0];delete this.contentHtml}this.content=d(j);var l=this.content.attr("data-rsts-class");this.data.name=this.content.attr("data-rsts-name")||this.content.attr("title");this.data.sliderClasses=(l&&l.split(" "))||[];if(this.content.attr("data-rsts-autoplay")){this.data.autoplay=parseFloat(this.content.attr("data-rsts-autoplay"))}if(j.nodeName.toLowerCase()==="img"||j.nodeName.toLowerCase()==="picture"){this.type="image"}if(j.nodeName.toLowerCase()==="video"){this.type="video"}this.type=this.content.attr("data-rsts-type")||this.type||"default";this.centerContent=this.content.attr("data-rsts-center")!==undefined?this.content.attr("data-rsts-center"):this.slider.options.centerContent;if(this.centerContent!=="x"&&this.centerContent!=="y"){this.centerContent=!!this.centerContent}if(this.type==="image"||this.type==="video"){this.centerContent=false}this.element.addClass(this.slider.options.cssPrefix+"slide-"+this.type).append(j);if(!a.createElement("video").canPlayType||(/^iPhone|^iPod/.test(navigator.platform)&&!c.matchMedia("(-webkit-video-playable-inline)").matches)){this.element.find("video[data-rsts-background]").each(function(){var m=d(this);if(m.attr("poster")){d(a.createElement("img")).attr("src",m.attr("poster")).attr("data-rsts-background","").attr("data-rsts-position",m.attr("data-rsts-position")).attr("data-rsts-scale-mode",m.attr("data-rsts-scale-mode")).insertBefore(m)}m.detach()})}if(this.type==="video"&&!this.content.attr("data-rsts-video")&&!a.createElement("video").canPlayType){this.element.find("video").each(function(){var m=d(this);if(!m.find("img").length){d(a.createElement("img")).attr("src",m.attr("poster")).attr("data-rsts-position",m.attr("data-rsts-position")).attr("data-rsts-scale-mode",m.attr("data-rsts-scale-mode")).appendTo(m)}});this.type="image"}this.backgrounds=[];this.element.find("[data-rsts-background]").each(function(){var m=d(this);if(m.is("img")&&m.parent().is("picture")){m=m.parent()}if(m.is("video")){m.attr("autoplay",true).attr("loop",true).attr("playsinline",true).attr("webkit-playsinline",true)}m.css({position:"absolute",top:0,left:0});i.backgrounds.push(m[0])});this.backgrounds=d(this.backgrounds).prependTo(this.element);if(this.backgrounds.length){this.element.children().last().css({position:"relative"});if(this.backgrounds.filter("video").length){this.element.children().last().css({"-webkit-transform":"translateZ(0)"})}}this.element.find("video[autoplay]").each(function(){if(this.pause){this.pause()}});this.element.find("img[loading=lazy]").each(function(){this.loading="eager"});if(this.content.attr("data-rsts-thumb")){this.data.thumbUrl=this.content.attr("data-rsts-thumb")}if(this.content.attr("data-rsts-thumb-html")){this.data.thumbHtml=this.content.attr("data-rsts-thumb-html")}if(this.type==="image"){this.data.name=this.data.name||this.element.find("img").last().attr("alt");if(this.element.find("img").last().attr("data-rsts-thumb")){this.data.thumbUrl=this.element.find("img").last().attr("data-rsts-thumb")}if(!this.data.thumbUrl){this.data.thumbUrl=this.element.find("img").last().attr("src")}}if(!this.data.thumbUrl&&this.type==="video"){if(!this.content.attr("data-rsts-video")&&this.element.find("video").last().attr("poster")){this.data.thumbUrl=this.element.find("video").last().attr("poster")}else{if(this.element.find("img").last().length){this.data.thumbUrl=this.element.find("img").last().attr("data-rsts-thumb")||this.element.find("img").last().attr("src")}}}if(this.data.name&&this.slider.options.captions){d(a.createElement("div")).addClass(this.slider.options.cssPrefix+"caption").text(this.data.name).appendTo(this.element)}var f=false;var k={};var h=function(m){f=true;var n=m&&m.target&&(m.target.currentSrc||m.target.src);if(n){var o=((m&&m.type)||"none")+"\n"+n;if(k[o]){return}k[o]=true}i.slider.resize(i.data.index);if(i.slider.css3Supported){i.slider.elements.crop.css("transform","translateZ(0)");i.slider.elements.crop.css("transform");i.slider.elements.crop.css("transform","")}};this.element.find("img").on("load",h);this.element.find("video").on("loadedmetadata loadeddata",h);if(this.element.find("img").length&&!this.element.find("img")[0].complete){setTimeout(function(){if(!f&&i.element.find("img")[0].complete){h()}},1000)}var g=this.element.find("h1,h2,h3,h4,h5,h6");if(!this.data.name&&g.length){this.data.name=g.text()}if(this.type==="video"){this.data.video=this.content.attr("data-rsts-video");this.videoStartButton=d(a.createElement("a")).attr("href",this.data.video||"").text(this.slider.options.labels.play).addClass(this.slider.options.cssPrefix+"video-play").on("click",function(m){m.preventDefault();i.startVideo()}).appendTo(this.element);if(!this.data.video&&this.element.find("video").last().length){this.videoControlsEnabled=!!this.element.find("video").last()[0].controls;this.element.find("video").last()[0].controls=false;this.element.find("video").last().on("ended",function(){i.stopVideo(true)})}}};e.prototype.videoRegExp={youtube:/^https?:\/\/(?:(?:www\.)?youtube(?:-nocookie)?\.com\/(?:watch\?v=|v\/|embed\/)|youtu\.be\/)([0-9a-z_\-]{11})(?:$|&|\?|#|\/)(?:(?:.*[?&#]|)t=([0-9hms]+))?/i,youtubePlayer:/^https?:\/\/(?:www\.)?youtube(?:-nocookie)?\.com\/embed\/[0-9a-z_\-]{11}/i,vimeo:/^https?:\/\/(?:player\.)?vimeo\.com\/(?:video\/)?([0-9]+)(?:.*#t=([0-9hms]+))?/i,vimeoPlayer:/^https?:\/\/player\.vimeo\.com\/video\/[0-9]+/i};e.prototype.isInjected=function(){return !!(this.element.get(0).parentNode&&this.element.get(0).parentNode.tagName)};e.prototype.isInitialized=function(){return !!this.content};e.prototype.isMediaLoaded=function(){var f=true;this.element.find("img").each(function(){if(this.complete===false){f=false;return false}});return f};e.prototype.size=function(f,h,g){this.updateResponsiveImages(true);if(!this.isInjected()){return{x:g?(f||0):f,y:g?(h||0):h}}if(f&&!h){this.slider.modify(this.element,{width:f,height:""});this.scaleContent(f,h);if(g||this.backgrounds.length){h=this.element.outerHeight()}}else{if(h&&!f){this.slider.modify(this.element,{height:h,width:""});this.scaleContent(f,h);if(g||this.backgrounds.length){f=this.element.outerWidth()}}else{if(f&&h){this.slider.modify(this.element,{width:f,height:h});this.scaleContent(f,h)}else{this.scaleContent(f,h);f=this.element.outerWidth();h=this.element.outerHeight()}}}this.scaleBackground(f,h);return{x:f,y:h}};e.prototype.updateResponsiveImages=function(g){var f=c.picturefill||c.respimage;if(!f){return}f({elements:this.element.find("img").get(),reevaluate:!!g})};e.prototype.scaleContent=function(f,h){if(this.centerContent){if(this.content.css("display")==="inline"){this.content.css("display","inline-block")}var g={"margin-top":"","margin-left":""};if(this.centerContent!=="y"&&f){g["margin-left"]=Math.round((f-this.content.outerWidth())/2)}if(this.centerContent!=="x"&&h){g["margin-top"]=Math.round((h-this.content.outerHeight())/2)}this.content.css(g)}if(this.type==="video"&&!this.data.video){this.element.find("video").last().css({width:f,height:h,display:"block"})}else{if(this.type==="image"||this.type==="video"){this.scaleImage(this.element.find("img").last(),f,h)}}};e.prototype.scaleBackground=function(f,h){var g=this;this.backgrounds.each(function(){var i=d(this);if(i.is("picture")){i=i.find("img").first()}g.scaleImage(i,f,h)})};e.prototype.scaleImage=function(f,m,l){var n=f.attr("data-rsts-scale-mode")||this.slider.options.scaleMode;var g=f.attr("data-rsts-position")||this.slider.options.imagePosition;var i=this.getOriginalSize(f);if(!i.x||!i.y){return}var j=i.x/i.y;if(m&&!l){l=m/j}else{if(l&&!m){m=l*j}else{if(!m&&!l){m=i.x;l=i.y}}}var k=m/l;var h={display:"block",width:i.x,height:i.y,"min-width":0,"min-height":0,"max-width":"none","max-height":"none"};if(n==="fit"||n==="crop"){if((j>=k&&n==="fit")||(j<=k&&n==="crop")){h.width=m;h.height=m/j}else{h.width=l*j;h.height=l}}else{if(n==="scale"){h.width=m;h.height=l}}h["margin-top"]=(l-h.height)/2;h["margin-left"]=(m-h.width)/2;if(g==="top"||g==="top-left"||g==="top-right"){h["margin-top"]=0}else{if(g==="bottom"||g==="bottom-left"||g==="bottom-right"){h["margin-top"]=l-h.height}}if(g==="left"||g==="top-left"||g==="bottom-left"){h["margin-left"]=0}else{if(g==="right"||g==="top-right"||g==="bottom-right"){h["margin-left"]=m-h.width}}f.css(h)};e.prototype.getOriginalSize=function(h){h=d(h);var g={};if(h[0].nodeName.toLowerCase()==="img"){if("naturalWidth" in new Image()){g.x=h[0].naturalWidth;g.y=h[0].naturalHeight}else{var f=new Image();f.src=h[0].src;g.x=f.width;g.y=f.height}}else{if(h[0].nodeName.toLowerCase()==="video"){g.x=h[0].videoWidth;g.y=h[0].videoHeight}}if(!g.x||!g.y){if(h.attr("width")||h.attr("height")){g.x=parseFloat(h.attr("width")||h.attr("height"));g.y=parseFloat(h.attr("height")||h.attr("width"))}else{g.x=g.y=0}}return g};e.prototype.setState=function(g){if(g==="active"&&g!==this.state&&this.state!=="preactive"){this.setState("preactive");this.element.css("opacity")}if(this.type==="video"&&this.state&&g==="inactive"&&g!==this.state){this.stopVideo()}if(this.type==="video"&&this.state&&g==="active"&&g!==this.state&&this.slider.options.videoAutoplay){this.startVideo()}if((g==="preactive"||g==="active")&&g!==this.state){this.element.find("video[autoplay]").each(function(){if(this.play){this.play()}})}else{if(g!=="active"&&g!=="preactive"&&(this.state==="active"||this.state==="preactive")){this.element.find("video").each(function(){if(this.pause){this.pause()}})}}this.state=g;var f=this.slider.options.cssPrefix;this.element.removeClass(f+"active").removeClass(f+"inactive").removeClass(f+"preactive").removeClass(f+"postactive").addClass(f+g)};e.prototype.stopVideo=function(h,g){if(!this.isVideoPlaying){return}this.isVideoPlaying=false;if(this.eventNamespace){d(c).off("message."+this.eventNamespace);delete this.eventNamespace}if(!this.data.video){var f=this.element.find("video").last();f[0].controls=false;f[0].pause();f[0].currentTime=0;if(f[0].poster){f[0].src="";f.removeAttr("src")}}if(this.videoElement){this.videoElement.attr("src","");this.videoElement.remove();delete this.videoElement}if(this.videoStopButton){this.videoStopButton.remove();delete this.videoStopButton}if(this.videoStartButton){this.videoStartButton.css("display","")}this.slider.elements.main.removeClass(this.slider.options.cssPrefix+"video-playing");if(h&&this.slider.options.autoplayRestart){this.slider.autoplay(200)}else{if(g){this.slider.stopAutoplay()}}};e.prototype.startVideo=function(){var f=this;var k,g,i,j,l;if(this.isVideoPlaying){return}this.isVideoPlaying=true;this.slider.stopAutoplay(true);if(!this.data.video){var h=this.element.find("video").last();h[0].controls=this.videoControlsEnabled;h[0].play();this.videoStartButton.css("display","none")}else{if((i=this.data.video.match(this.videoRegExp.youtube))){this.element.addClass(this.slider.options.cssPrefix+"video-youtube");k=i[1];j=i[2];if(j){j=j.split(/[hm]/).reverse();j[0]=parseInt(j[0]||0,10);j[1]=parseInt(j[1]||0,10);j[2]=parseInt(j[2]||0,10);j=j[0]+(j[1]*60)+(j[2]*60*60)}l="https://www.youtube"+(this.data.video.indexOf("youtube-nocookie.com")===-1?"":"-nocookie")+".com/embed/"+k;if(this.data.video.match(this.videoRegExp.youtubePlayer)){l=this.data.video}if(!l.match(/[?&]autoplay=/i)){l+=(l.match(/\?/)?"&":"?")+"autoplay=1"}if(!l.match(/[?&]enablejsapi=/i)){l+="&enablejsapi=1"}if(!l.match(/[?&]wmode=/i)){l+="&wmode=opaque"}if(j&&!l.match(/[?&]start=/i)){l+="&start="+j}this.videoElement=d(a.createElement("iframe")).addClass(this.slider.options.cssPrefix+"video-iframe").attr("src",l).attr("frameborder",0).attr("allowfullscreen","allowfullscreen").appendTo(this.element);g=function(){if(f.videoElement&&c.YT){new YT.Player(f.videoElement.get(0),{events:{onStateChange:function(m){if(m.data===YT.PlayerState.ENDED){f.stopVideo(true)}}}})}};if(c.YT&&YT.Player){g()}else{d(a.createElement("script")).attr("src","//www.youtube.com/iframe_api").appendTo(a.head);c.onYouTubeIframeAPIReady=function(){delete c.onYouTubeIframeAPIReady;g()}}}else{if((i=this.data.video.match(this.videoRegExp.vimeo))){this.element.addClass(this.slider.options.cssPrefix+"video-vimeo");k=i[1];j=i[2];l="https://player.vimeo.com/video/"+k;if(this.data.video.match(this.videoRegExp.vimeoPlayer)){l=this.data.video}if(!l.match(/[?&]autoplay=/i)){l+=(l.match(/\?/)?"&":"?")+"autoplay=1"}if(!l.match(/[?&]api=/i)){l+="&api=1"}if(j&&!l.match(/#t=/i)){l+="#t="+j}this.videoElement=d(a.createElement("iframe")).addClass(this.slider.options.cssPrefix+"video-iframe").attr("src",l).attr("frameborder",0).attr("allowfullscreen","allowfullscreen").appendTo(this.element);this.eventNamespace="rsts"+new Date().getTime();d(c).on("message."+this.eventNamespace,function(m){var n=JSON.parse(m.originalEvent.data);if(n&&n.event){if(n.event==="ready"){f.videoElement.get(0).contentWindow.postMessage('{"method":"addEventListener","value":"finish"}',f.videoElement.attr("src").split("?")[0])}else{if(n.event==="finish"){f.stopVideo(true)}}}})}else{this.element.addClass(this.slider.options.cssPrefix+"video-unknown");this.videoElement=d(a.createElement("iframe")).addClass(this.slider.options.cssPrefix+"video-iframe").attr("src",this.data.video).attr("frameborder",0).attr("allowfullscreen","allowfullscreen").appendTo(this.element)}}}this.videoStopButton=d(a.createElement("a")).attr("href",this.data.video||"").text(this.slider.options.labels.stop).addClass(this.slider.options.cssPrefix+"video-stop").on("click",function(m){m.preventDefault();f.stopVideo(false,true)}).appendTo(this.element);this.slider.elements.main.addClass(this.slider.options.cssPrefix+"video-playing")};e.prototype.setIndex=function(f){this.data.index=f};e.prototype.getData=function(){return this.data};e.prototype.getThumbUrl=function(){return this.data.thumbUrl||"data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs="};e.prototype.getThumbHtml=function(){return this.data.thumbHtml||d(a.createElement("div")).append(d(a.createElement("img")).attr("src",this.getThumbUrl()).attr("alt",this.data.name)).html()};return e})();b.Slider=(function(){function e(i,h){var g=this;this.slides=[];this.elements={};this.elements.main=i;this.options=d.extend(true,{},this.defaultOptions,h);if(this.options.height==="auto"&&this.options.direction==="y"){throw new Error('height "auto" with direction "y" ist not possible')}if(this.options.type!=="slide"){this.options.visibleArea=1;this.options.visibleAreaMax=0;this.options.slideMaxCount=0;this.options.slideMinSize=0;this.options.slideMaxSize=0;this.options.rowMaxCount=0;this.options.rowMinSize=0;this.options.rowSlideRatio=0}this.checkCss3Support();this.readSlides();if(this.options.random){this.slides.sort(function(){return Math.random()-0.5})}d.each(this.slides,function(k){this.setIndex(k)});this.slideIndex=this.getIndexFromUrl();if(this.slideIndex===false){this.slideIndex=0}this.activeSlideOffset=0;d(c).on("hashchange.rsts",function(){var k=g.getIndexFromUrl();if(k!==false&&k!==g.slideIndex){g.goTo(k)}});this.elements.main.addClass(this.options.cssPrefix+"main").addClass(this.options.cssPrefix+"direction-"+this.options.direction).addClass(this.options.cssPrefix+"type-"+this.options.type).addClass(this.options.cssPrefix+"skin-"+this.options.skin);if(this.options.direction==="x"&&this.options.height==="normalize"){this.normalizeSize=true;this.options.height="auto"}else{if(this.options.direction==="x"&&(this.options.height==="auto"||(this.options.height==="css"&&this.elements.main.height()<1))){this.autoSize=true}else{if(this.options.direction==="y"&&this.options.width==="normalize"){this.normalizeSize=true;this.options.width="auto"}else{if(this.options.direction==="y"&&(this.options.width==="auto"||(this.options.width==="css"&&this.elements.main.width()<1))){this.autoSize=true}}}}var j=this.options.width.match(/([0-9.]+)[^0-9.]*x[^0-9.]*([0-9.]+)/i);if(j){this.proportion=j[1]/j[2];delete this.options.width;this.elements.main.css({width:"auto"})}j=this.options.height.match(/([0-9.]+)[^0-9.]*x[^0-9.]*([0-9.]+)/i);if(j){this.proportion=j[1]/j[2];delete this.options.height;this.elements.main.css({height:"auto"})}if(this.options.width&&this.options.width!=="css"){this.elements.main.css({width:this.options.width});if(this.options.width==="auto"){this.options.width="css"}}if(this.options.height&&this.options.height!=="css"){this.elements.main.css({height:this.options.height})}if(this.elements.header){this.elements.header.addClass(this.options.cssPrefix+"header").appendTo(this.elements.main)}this.elements.view=d(a.createElement("div")).addClass(this.options.cssPrefix+"view").appendTo(this.elements.main);this.elements.crop=d(a.createElement("div")).addClass(this.options.cssPrefix+"crop").on("scroll",function(){d(this).scrollLeft(0).scrollTop(0)}).appendTo(this.elements.view);this.elements.slides=d(a.createElement("div")).addClass(this.options.cssPrefix+"slides").appendTo(this.elements.crop);if(this.options.autoplay&&this.options.autoplayProgress){this.elements.progress=d(a.createElement("div")).addClass(this.options.cssPrefix+"progress").appendTo(this.elements.view);this.elements.progressBar=d(a.createElement("div")).appendTo(this.elements.progress)}this.elements.overlayPrev=d(a.createElement("div")).addClass(this.options.cssPrefix+"overlay-prev").appendTo(this.elements.view);this.elements.overlayNext=d(a.createElement("div")).addClass(this.options.cssPrefix+"overlay-next").appendTo(this.elements.view);this.nav=new b.SliderNav(this);if(this.elements.footer){this.elements.footer.addClass(this.options.cssPrefix+"footer").appendTo(this.elements.main)}this.preloadSlides(this.slideIndex);this.cleanupSlides();d(c).on("resize.rsts",function(){g.resize()});this.resize();this.nav.combineItems();this.resize();if(!this.autoplayStopped){this.autoplay()}d(c).on("domready.rsts load.rsts",function(){if(g.windowSizeHasChanged()){g.resize()}});if(this.options.type==="slide"){this.setDragEvents()}else{this.modify(this.slides[this.slideIndex].element,{opacity:1})}if(this.css3Supported){this.elements.slides.on("transitionend webkitTransitionEnd oTransitionEnd msTransitionEnd",function(k){if((g.options.type==="slide"&&k.target===g.elements.slides.get(0))||(g.options.type!=="slide"&&k.target.parentNode===g.elements.slides.get(0))){g.cleanupSlides()}})}if(this.options.pauseAutoplayOnHover){this.elements.view.on("mouseenter",function(){if(!g.isTouch){g.pauseAutoplay()}});this.elements.view.on("mouseleave",function(){g.playAutoplay()})}this.isVisible=true;d(a).on("visibilitychange webkitvisibilitychange",function(k){g.checkVisibility()});var f;d(c).on("scroll",function(k){clearTimeout(f);f=setTimeout(function(){g.checkVisibility()},100)});this.checkVisibility();if(this.options.keyboard){d(a.body).on("keydown.rsts",function(m){var l=g.options.direction==="x"?37:38;var k=g.options.direction==="x"?39:40;if((m.which===l||m.which===k)&&(m.target===a.body||d(m.target).closest(g.elements.main).length)){if(m.which===l){g.prev()}else{g.next()}}})}}e.prototype.defaultOptions={type:"slide",direction:"x",visibleArea:1,visibleAreaMax:0,visibleAreaAlign:0.5,random:false,loop:false,cssPrefix:"rsts-",skin:"default",width:"css",height:"css",preloadSlides:2,slideMaxCount:0,slideMinSize:0,slideMaxSize:0,rowMaxCount:0,rowMinSize:0,rowSlideRatio:0,combineNavItems:true,prevNextSteps:0,centerContent:false,gapSize:20,duration:400,autoplay:false,videoAutoplay:false,autoplayRestart:false,autoplayProgress:false,pauseAutoplayOnHover:false,navType:"bullets",controls:true,thumbControls:false,scaleMode:"fit",imagePosition:"center",deepLinkPrefix:false,keyboard:true,captions:true,labels:{prev:"Previous",next:"Next",play:"Play",stop:"Stop",},thumbs:{cssPrefix:"rsts-thumbs-",navType:"none",slideMinSize:50,slideMaxSize:50,preloadSlides:10,gapSize:5,width:"100%",height:"1x1",scaleMode:"crop",keyboard:false,captions:false}};e.prototype.goTo=function(l,o,j){var r=this;if(!j){this.stopAutoplay()}var m=this.getVisibleCount();var k=this.getVisibleRowsCount();var s=false;var v=0;var g=this.slideIndex;var w=l-this.slideIndex<0?-1:l===this.slideIndex?0:1;if((l<0||l>this.slides.length-1)&&this.options.loop){v=l-this.slideIndex;l=this.getSlideIndex(l)}else{if((l<0||l>this.slides.length-m)&&!this.options.loop){if(this.options.type!=="slide"){return}s=l<0?-1:1;l=l<0?0:this.slides.length-m}}if(!s&&this.slideIndex===l&&!o){return}var x=[];for(var u=this.slideIndex;u<=this.slideIndex+m-1;u++){x.push(this.getSlideIndex(u))}var t=[];for(u=l;u<=l+m-1;u++){t.push(this.getSlideIndex(u))}d.each(x,function(y,z){if(d.inArray(z,t)===-1){r.slides[z].setState("postactive")}});d.each(t,function(y,z){if(d.inArray(z,x)===-1){r.slides[z].setState("preactive")}});var h=this.slideSize+this.getGapSize();if(v){this.activeSlideOffset=this.getSlideOffset(this.slideIndex+v)}else{if(l>this.slideIndex&&l-this.slideIndex-m>this.options.preloadSlides*k*2){this.activeSlideOffset+=(this.options.preloadSlides*k*2+m)*h/k}else{if(lthis.options.preloadSlides*k*2){this.activeSlideOffset-=(this.options.preloadSlides*k*2+m)*h/k}else{this.activeSlideOffset=this.getSlideOffset(l)}}}this.slideIndex=l;var n=true;if(!o){n=false}else{d.each(t,function(y,z){if(!r.slides[z].isInjected()||Math.round(r.slides[z].element.position()[{x:"left",y:"top"}[r.options.direction]])!==Math.round(r.getSlideOffset(r.slideIndex+y))){n=false;return false}})}if(n){this.preloadOnCleanup=true}else{this.preloadSlides(l,g)}var q=this.getViewSize(l);var p;var f=-this.getSlideOffset(l)+Math.round(q[this.options.direction]*(1-this.visibleAreaRate)*this.options.visibleAreaAlign);if(o&&!s){p=Math.abs((this.getOffset(this.elements.slides)-f)/h)}else{if(o&&s){p=0.7}}if(this.options.type==="slide"){if(/Apple/.test(navigator.vendor)){this.elements.crop.css("transform","translateZ(0)");this.elements.crop.css("transform");this.elements.crop.css("transform","")}this.modify(this.elements.slides,{offset:f},true,p,o,!o&&s)}else{if(this.options.type==="fade"||this.options.type==="fade-in-out"){if(this.options.type==="fade-in-out"){d.each(x,function(y,z){if(t.indexOf(z)===-1){r.modify(r.slides[z].element,{opacity:0},true)}})}this.modify(this.slides[this.slideIndex].element,{opacity:1},true)}else{if(this.options.type==="side-slide"){this.modify(this.slides[this.slideIndex].element,{offset:w*this.slideSize});this.slides[this.slideIndex].element.position();this.modify(this.slides[this.slideIndex].element,{offset:0},true)}else{this.modify(this.slides[this.slideIndex].element,{},true)}}}this.nav.setActive(t);if(this.autoSize){this.modify(this.elements.crop,{width:q.x,height:q.y},true,p,o)}this.elements.main.trigger({type:"rsts-slidestart",rstSlider:this})};e.prototype.getIndexFromUrl=function(){if(!this.options.deepLinkPrefix){return false}var f="#"+this.options.deepLinkPrefix;if(c.location.hash.substr(0,f.length)===f){var g=Math.abs(parseInt(c.location.hash.substr(f.length),10));if(g){if(g>this.slides.length){g=this.slides.length}return g-1}}return 0};e.prototype.stopAutoplay=function(g){var f=this;clearTimeout(this.autoplayTimeout);this.autoplayStopped=true;if(this.options.autoplay&&this.options.autoplayProgress){this.elements.progress.removeClass(this.options.cssPrefix+"progress-active")}if(this.options.autoplayRestart&&!g){this.autoplayTimeout=setTimeout(function(){f.autoplay()},this.options.autoplayRestart-this.options.autoplay+(this.options.duration*2))}};e.prototype.pauseAutoplay=function(){if(!this.options.autoplay||this.autoplayPaused){return}if(!this.autoplayStopped){clearTimeout(this.autoplayTimeout)}this.autoplayPaused=true;if(this.options.autoplay&&this.options.autoplayProgress&&!this.autoplayStopped){this.pauseAutoplayProgressBar()}};e.prototype.playAutoplay=function(){if(!this.options.autoplay||!this.autoplayPaused){return}this.autoplayPaused=false;if(!this.autoplayStopped){this.autoplay((1-(this.options.autoplayProgress?this.elements.progressBar.outerWidth()/this.elements.progress.width():0))*(this.slides[this.slideIndex].getData().autoplay||this.options.autoplay))}};e.prototype.autoplay=function(g){var f=this;if(!this.options.autoplay||this.getVisibleCount()>=this.slides.length){return}clearTimeout(this.autoplayTimeout);this.autoplayStopped=false;if(this.autoplayPaused){this.pauseAutoplayProgressBar(0);return}g=(g||g===0)?g:((this.slides[this.slideIndex].getData().autoplay||this.options.autoplay)-this.options.duration);this.startAutoplayProgressBar(g);var h=function(){var k=f.getVisibleCount();var j=f.slideIndex+(Math.min(f.options.prevNextSteps*f.getVisibleRowsCount(),k)||k);if(j>f.slides.length-k&&!f.options.loop){if(f.slideIndexthis.slides.length-g&&this.slideIndex0){f=0}this.goTo(f)};e.prototype.readSlides=function(){var f=this;this.elements.main.children().each(function(){var g=d(this);if(g.is('h1, h2, h3, h4, h5, h6, [data-rsts-type="header"]')){if(!f.elements.header){f.elements.header=d(a.createElement("div"))}g.appendTo(f.elements.header)}else{if(g.is('[data-rsts-type="footer"]')){if(!f.elements.footer){f.elements.footer=d(a.createElement("div"))}g.appendTo(f.elements.footer)}else{f.slides.push(new b.Slide(this,f))}}});this.elements.main.empty();if(this.slides.length===0){throw new Error("No slides found")}};e.prototype.preloadSlides=function(k,l){var p=this;var q=this.getViewSizeFixed();q[this.options.direction]=this.slideSize;if(this.getVisibleRowsCount()>1){q[this.options.direction==="x"?"y":"x"]=this.rowSize}var o=this.getVisibleCount();var f=0;if(this.options.loop){f=Math.min(Math.floor((this.slides.length-o)/2),this.options.preloadSlides*this.getVisibleRowsCount())}else{f=this.options.preloadSlides*this.getVisibleRowsCount()}var n=this.getActiveSlides(k);var j=0;var h,m;for(var g=k-f;g<=k+f+o-1;g++){m=this.getSlideIndex(g);h=this.slides[m];if(!this.options.loop&&(g<0||g>=this.slides.length)){continue}if(!h.isInitialized()){h.init();j++}if(p.options.type!=="slide"&&g!==k){continue}if(p.options.type==="slide"){if(l!==undefined&&d.inArray(m,n)===-1&&(g<0||g>=this.slides.length)&&h.isInjected()){this.preloadOnCleanup=true;continue}p.modify(h.element,{offset:p.getSlideOffset(g),rowOffset:p.getRowOffset(g)})}if(!h.isInjected()){if(p.options.type==="fade"||p.options.type==="fade-in-out"){p.modify(h.element,{opacity:0})}p.elements.slides.append(h.element);h.size(q.x,q.y)}else{if(p.options.type!=="slide"&&g===p.slideIndex&&h.element.next().length){if(p.options.type==="fade"||p.options.type==="fade-in-out"){if(h.element.next().length===1){p.modify(h.element,{opacity:1-h.element.next().css("opacity")});p.modify(h.element.next(),{opacity:1})}else{p.modify(h.element,{opacity:0})}}p.elements.slides.append(h.element)}}}if(this.normalizeSize&&j){this.resize()}};e.prototype.getActiveSlides=function(j){j=j!==undefined?j:this.slideIndex;var h=[];var g=this.getVisibleCount();for(var f=j;f<=j+g-1;f++){h.push(this.getSlideIndex(f))}return h};e.prototype.cleanupSlides=function(){clearTimeout(this.cleanupSlidesTimeout);var o=this;var n=this.getVisibleCount();var g=this.options.type==="slide"?this.options.preloadSlides*this.getVisibleRowsCount():0;var k=[];var m=[];var h=[];var f=[];for(var j=this.slideIndex-g;j<=this.slideIndex+g+n-1;j++){k.push(this.getSlideIndex(j))}for(j=this.slideIndex;j<=this.slideIndex+n-1;j++){m.push(this.getSlideIndex(j))}d.each(this.slides,function(q,p){d.merge(h,p.data.sliderClasses);if(p.isInjected()&&d.inArray(q,k)===-1){if((o.options.type==="fade"||o.options.type==="fade-in-out")&&o.slides[o.slideIndex].element.css("opacity")<1){return}if(o.options.type==="side-slide"){var r=o.options.direction==="x"?"left":"top";if(o.slides[o.slideIndex].element.position()[r]!==0){return}}p.element.detach()}if(d.inArray(q,m)===-1&&p.state!=="inactive"){p.setState("inactive")}});this.nav.setActive(m);d.each(m,function(p,q){o.slides[q].setState("active");d.merge(f,o.slides[q].data.sliderClasses)});this.elements.main.removeClass(d.grep(h,function(i){return d.inArray(i,f)===-1}).join(" "));this.elements.main.addClass(f.join(" "));if(this.options.deepLinkPrefix&&this.getIndexFromUrl()!==this.slideIndex){if(this.slideIndex){c.location.hash="#"+this.options.deepLinkPrefix+(this.slideIndex+1)}else{if(c.history&&c.history.pushState){c.history.pushState("",a.title,c.location.pathname+c.location.search)}else{var l={x:d(c).scrollLeft(),y:d(c).scrollTop()};c.location.hash="";d(c).scrollLeft(l.x);d(c).scrollTop(l.y)}}}if(this.preloadOnCleanup){this.preloadOnCleanup=false;this.preloadSlides(this.slideIndex)}if(this.windowSizeHasChanged()){this.resize()}this.elements.main.trigger({type:"rsts-slidestop",rstSlider:this})};e.prototype.getSlideOffset=function(f){var g=this.getViewSizeFixed(true);var j=this.getVisibleSlidesCount();var h=this.getVisibleRowsCount();var k=this.getGapSize();var i=this.slidesCutOff?0:(this.slideSize+k)-(((g[this.options.direction]*this.visibleAreaRate)+k)/j);return Math.floor((f-this.slideIndex)/h)*(this.slideSize+k)-Math.round(i*Math.floor((f-this.slideIndex)/h))+this.activeSlideOffset};e.prototype.getRowOffset=function(l){var n=this.getViewSizeFixed(true);var k=this.getVisibleRowsCount();var o=((((l-this.slideIndex)%k)+k)%k);var h=0;var m=this.options.direction==="x"?"y":"x";var f=this.getGapSize();if(this.autoSize){var p={};p[this.options.direction]=this.slideSize;for(var j=l-o;jthis.options.slideMaxSize)){g=Math.ceil((f+h)/(this.options.slideMaxSize+h))}if(this.options.slideMinSize&&(f-(h*(g-1)))/gthis.options.rowMaxCount)){g=this.options.rowMaxCount}if(f&&!this.normalizeSize&&this.options.rowMinSize&&(!g||(f-(i*(g-1)))/gthis.options.visibleAreaMax){this.visibleAreaRate=this.options.visibleAreaMax/(this.options.direction==="x"?f:k)}if(this.options.slideMaxSize&&(this.options.direction==="x"?f:k)*this.visibleAreaRate>this.slides.length*(this.options.slideMaxSize+j)-j){this.visibleAreaRate=(this.slides.length*(this.options.slideMaxSize+j)-j)/(this.options.direction==="x"?f:k)}var h=this.getVisibleSlidesCount();var i=this.getVisibleRowsCount();if(!this.options.width&&this.proportion){f=this.viewSizeFixedCache.x=Math.round((((((((k+j)/i)-j)*this.proportion)+j)*h)-j)/this.visibleAreaRate)}if(!this.options.height&&this.proportion){k=this.viewSizeFixedCache.y=Math.round(((Math.round(((((f*this.visibleAreaRate)+j)/h)-j)/this.proportion)+j)*i)-j)}if(this.normalizeSize&&this.normalizedSize){if(this.options.direction==="x"){k=this.viewSizeFixedCache.y=((this.normalizedSize+j)*i)-j}else{f=this.viewSizeFixedCache.x=((this.normalizedSize+j)*i)-j}}this.slideSize=(j>0?Math.round:Math.ceil)((((this.options.direction==="x"?f:k)*this.visibleAreaRate)-(j*(h-1)))/h);this.slidesCutOff=false;if((this.options.slideMinSize&&this.slideSize1)||(this.options.slideMaxSize&&this.slideSize>this.options.slideMaxSize)){this.slideSize=this.options.slideMaxSize||this.options.slideMinSize;this.slidesCutOff=true;this.visibleAreaRate=(h*(this.slideSize+j)-j)/(this.options.direction==="x"?f:k);if(!this.options.width&&this.proportion){f=this.viewSizeFixedCache.x=Math.round((((((((k+j)/i)-j)*this.proportion)+j)*h)-j)/this.visibleAreaRate)}if(!this.options.height&&this.proportion){k=this.viewSizeFixedCache.y=Math.round(((Math.round(((((f*this.visibleAreaRate)+j)/h)-j)/this.proportion)+j)*i)-j)}}if(this.options.direction==="x"?k:f){this.rowSize=(j>0?Math.round:Math.ceil)(((this.options.direction==="x"?k:f)-(j*(i-1)))/i)}else{this.rowSize=undefined}return d.extend({},this.viewSizeFixedCache)};e.prototype.getViewSize=function(j){j=j||0;var p=this.getViewSizeFixed();var q=p[this.options.direction];p[this.options.direction]=this.slideSize;if(!p.x||!p.y){var m=this.getVisibleSlidesCount();var l=this.getVisibleRowsCount();var f=this.getGapSize();var n=!p.x?"x":"y";var i=0;var g,o,h,k;for(g=0;g=this.slides.length){this.elements.main.addClass(this.options.cssPrefix+"dragging-disabled");this.nav.hide();this.stopAutoplay(true)}else{this.elements.main.removeClass(this.options.cssPrefix+"dragging-disabled");this.nav.show();if(f>=this.slides.length){this.stopAutoplay()}}if(f!==this.getVisibleCount()){this.nav.combineItems();this.cleanupSlides()}this.checkVisibility();this.windowSizeHasChanged()};e.prototype.checkVisibility=function(){var g=!(a.hidden||a.webkitHidden);var h=false;var f=this.elements.main;var j=f.offset();var i=d(c);if(g&&j.lefti.scrollLeft()&&j.topi.scrollTop()){h=true}if(this.isVisible!==h){this.isVisible=h;if(h){this.playAutoplay()}else{this.pauseAutoplay()}}};e.prototype.getSlides=function(){return this.slides};e.prototype.getSlide=function(f){return this.slides[this.getSlideIndex(f)]};e.prototype.getSlideIndex=function(f){return((f%this.slides.length)+this.slides.length)%this.slides.length};e.prototype.setTouch=function(f){if(f!==this.isTouch){if(f){this.elements.main.addClass(this.options.cssPrefix+"touch").removeClass(this.options.cssPrefix+"no-touch")}else{this.elements.main.addClass(this.options.cssPrefix+"no-touch").removeClass(this.options.cssPrefix+"touch")}}if(f){this.lastTouchTime=new Date().getTime()}this.isTouch=f};e.prototype.setDragEvents=function(){var f=this;this.lastTouchTime=0;this.setTouch(false);var g={start:"mousedown",stop:"mouseup",move:"mousemove"};if(c.navigator.pointerEnabled&&c.navigator.maxTouchPoints){g={start:"pointerdown",stop:"pointerup",move:"pointermove"};this.elements.crop.css("touch-action","pan-"+(this.options.direction==="x"?"y":"x")+" pinch-zoom double-tap-zoom");this.elements.main.on("pointerdown",function(h){if(h.originalEvent.pointerType==="touch"){f.setTouch(true)}})}else{if(c.navigator.msPointerEnabled&&c.navigator.msMaxTouchPoints){g={start:"MSPointerDown",stop:"MSPointerUp",move:"MSPointerMove"};this.elements.crop.css("-ms-touch-action","pan-"+(this.options.direction==="x"?"y":"x")+" pinch-zoom double-tap-zoom");this.elements.main.on("MSPointerDown",function(h){if(h.originalEvent.pointerType===h.originalEvent.MSPOINTER_TYPE_TOUCH){f.setTouch(true)}})}else{if("ontouchstart" in c||"ontouchend" in a){g={start:g.start+" touchstart",stop:g.stop+" touchend touchcancel",move:g.move+" touchmove"};this.elements.main.on("touchstart",function(h){f.setTouch(true)})}}}this.elements.crop.on(g.start,function(h){return f.onDragStart(h)});d(a).on(g.stop+".rsts",function(h){return f.onDragStop(h)});d(a).on(g.move+".rsts",function(h){return f.onDragMove(h)});this.elements.crop.on("dragstart",function(h){if(f.isDragging){h.preventDefault()}});if(this.elements.crop[0].addEventListener){this.elements.crop[0].addEventListener("click",function(h){return f.onClickCapturing(d.event.fix(h))},true)}};e.prototype.onDragStart=function(f){if(this.isDragging||(f.type==="mousedown"&&f.which!==1)||this.getVisibleCount()>=this.slides.length){return}this.dragLastDiff=0;this.touchAxis="";if(d(f.target).closest("."+this.options.cssPrefix+"no-drag",this.elements.slides).length){return}if(c.navigator.pointerEnabled&&c.navigator.maxTouchPoints){this.setTouch(f.originalEvent.pointerType==="touch")}else{if(c.navigator.msPointerEnabled&&c.navigator.msMaxTouchPoints){this.setTouch(f.originalEvent.pointerType===f.originalEvent.MSPOINTER_TYPE_TOUCH)}else{this.setTouch(f.type!=="mousedown"||new Date().getTime()-this.lastTouchTime<1000)}}var g=this.getPositionFromEvent(f);this.isDragging=true;this.isDraggingStarted=false;this.dragStartPos={x:g.x-this.elements.slides.offset().left+this.elements.crop.offset().left,y:g.y-this.elements.slides.offset().top+this.elements.crop.offset().top};this.dragLastPos=g[this.options.direction];this.rawStartPos=g;this.modify(this.elements.slides,{offset:g[this.options.direction]-this.dragStartPos[this.options.direction]});this.onDragMove(f)};e.prototype.onDragStop=function(f){if(!this.isDragging){return}this.isDragging=false;this.isDraggingStarted=false;this.elements.main.removeClass(this.options.cssPrefix+"dragging");if(this.dragLastDiff===0||this.dragLastDiff===undefined){return}var g=this.slideIndex+(Math.floor((-Math.round(this.getOffset(this.elements.slides))-this.activeSlideOffset+(this.getViewSizeFixed(true)[this.options.direction]*(1-this.visibleAreaRate)*this.options.visibleAreaAlign))/(this.slideSize+this.getGapSize()))*this.getVisibleRowsCount());if(this.dragLastDiff<=0){this.goTo(g,true)}else{this.goTo(g+this.getVisibleRowsCount(),true)}};e.prototype.onDragMove=function(j){if(!this.isDragging||(this.isTouch&&j.type==="mousemove")){return}if(j.originalEvent.touches&&j.originalEvent.touches[1]){return this.onDragStop()}var k=this.getPositionFromEvent(j);var g;if(!this.touchAxis){g=Math.abs(k.x-this.rawStartPos.x)-Math.abs(k.y-this.rawStartPos.y);if(g>(this.isTouch?4:2)){this.touchAxis="x"}else{if(g<-(this.isTouch?4:2)){this.touchAxis="y"}}}if(this.touchAxis===this.options.direction){j.preventDefault();this.stopAutoplay()}else{if(!this.touchAxis){return}else{return this.onDragStop()}}if(!this.isDraggingStarted){this.isDraggingStarted=true;this.elements.main.addClass(this.options.cssPrefix+"dragging");(function(){var l=(c.getSelection&&c.getSelection())||a.selection||{};(l.empty||l.removeAllRanges||function(){}).apply(l)})()}var f=this.dragLastPos-k[this.options.direction];var i=k[this.options.direction]-this.dragStartPos[this.options.direction];var h=this.getVisibleCount();if(!this.options.loop){if(i>-this.getSlideOffset(0)+(this.getViewSizeFixed(true)[this.options.direction]*(1-this.visibleAreaRate)*this.options.visibleAreaAlign)){i=(i*0.4)-((this.getSlideOffset(0)-(this.getViewSizeFixed(true)[this.options.direction]*(1-this.visibleAreaRate)*this.options.visibleAreaAlign))*0.6)}if(i<-this.getSlideOffset(this.slides.length-h)+(this.getViewSizeFixed(true)[this.options.direction]*(1-this.visibleAreaRate)*this.options.visibleAreaAlign)){i=(i*0.4)-((this.getSlideOffset(this.slides.length-h)-(this.getViewSizeFixed(true)[this.options.direction]*(1-this.visibleAreaRate)*this.options.visibleAreaAlign))*0.6)}}this.modify(this.elements.slides,{offset:i});if(f<0||f>0){this.dragLastDiff=f}this.dragLastPos=k[this.options.direction]};e.prototype.onClickCapturing=function(f){if(this.dragLastDiff!==0&&typeof this.dragLastDiff!=="undefined"){f.stopPropagation();f.preventDefault()}};e.prototype.getPositionFromEvent=function(f){var g={x:f.pageX,y:f.pageY};if(typeof g.x!=="number"){g={x:f.originalEvent.pageX,y:f.originalEvent.pageY}}if(f.originalEvent.touches&&f.originalEvent.touches[0]){g={x:f.originalEvent.touches[0].pageX,y:f.originalEvent.touches[0].pageY}}return g};return e})();b.SliderNav=(function(){function e(h){var g=this;this.slider=h;this.elements={};if(h.options.controls){this.elements.prev=d(a.createElement("a")).attr("href","").append(d(a.createElement("span")).addClass(h.options.cssPrefix+"prev-label").text(h.options.labels.prev)).addClass(h.options.cssPrefix+"prev").on("click",function(i){i.preventDefault();g.slider.prev()});this.elements.next=d(a.createElement("a")).attr("href","").append(d(a.createElement("span")).addClass(h.options.cssPrefix+"next-label").text(h.options.labels.next)).on("click",function(i){i.preventDefault();g.slider.next()}).addClass(h.options.cssPrefix+"next");if(this.slider.options.thumbControls){this.elements.prevThumb=d(a.createElement("div")).addClass(h.options.cssPrefix+"prev-thumb").appendTo(this.elements.prev);this.elements.nextThumb=d(a.createElement("div")).addClass(h.options.cssPrefix+"next-thumb").appendTo(this.elements.next)}h.elements.view.append(this.elements.prev).append(this.elements.next)}if(h.options.navType!=="none"){this.elements.main=d(a.createElement("div")).addClass(h.options.cssPrefix+"nav "+h.options.cssPrefix+"nav-"+h.options.navType);if(h.options.navType==="thumbs"){this.elements.thumbs=d(a.createElement("div"));d.each(this.slider.getSlides(),function(k,j){g.createThumb(k,j).appendTo(g.elements.thumbs)});this.elements.main.append(this.elements.thumbs);h.elements.main.append(this.elements.main);this.thumbsSlider=new b.Slider(this.elements.thumbs,d.extend({visibleArea:h.options.visibleArea,visibleAreaMax:h.options.visibleAreaMax,visibleAreaAlign:h.options.visibleAreaAlign,loop:h.options.loop,duration:h.options.duration,controls:h.options.controls,labels:h.options.labels},h.options.thumbs||{}));this.setActive([0])}else{this.elements.mainPrev=d(a.createElement("a")).attr("href","").text(h.options.labels.prev).on("click",function(i){i.preventDefault();g.slider.prev()}).appendTo(d(a.createElement("li")).addClass(h.options.cssPrefix+"nav-prev"));this.elements.mainNext=d(a.createElement("a")).attr("href","").text(h.options.labels.next).on("click",function(i){i.preventDefault();g.slider.next()}).appendTo(d(a.createElement("li")).addClass(h.options.cssPrefix+"nav-next"));var f=a.createElement("ul");d.each(this.slider.getSlides(),function(k,j){g.elements[k]=g.createNavItem(k,j.getData()).appendTo(f)});this.elements.mainPrev.parent().prependTo(f);this.elements.mainNext.parent().appendTo(f);this.elements.main.append(f);h.elements.main.append(this.elements.main)}}}e.prototype.setActive=function(g){var f=this;var j=this.slider.getSlides();if(this.slider.options.navType==="thumbs"){var h=this.thumbsSlider.getVisibleCount();var i=this.thumbsSlider.getVisibleRowsCount();var k=g[Math.floor((g.length-1)/2)]-Math.floor((h-1)/2);if(!this.thumbsSlider.options.loop){k=Math.min(this.thumbsSlider.slides.length-h,Math.max(0,k))}else{k=this.thumbsSlider.getSlideIndex(k);k=this.getNearestIndex(k,this.thumbsSlider.slideIndex,this.thumbsSlider.getSlides().length)}k-=((((k+Math.floor(i/2)-this.thumbsSlider.slideIndex)%i)+i)%i)-Math.floor(i/2);d.each(this.activeIndexes||[],function(n,m){f.thumbsSlider.getSlide(m).element.removeClass(f.thumbsSlider.options.cssPrefix+"active-thumb")});d.each(g,function(n,m){f.thumbsSlider.getSlide(m).element.addClass(f.thumbsSlider.options.cssPrefix+"active-thumb")});this.thumbsSlider.resize();this.thumbsSlider.goTo(k)}if(this.activeIndexes){d.each(this.activeIndexes,function(n,m){if(!f.elements[m]){return}f.elements[m].children("a").removeClass("active")})}if(this.elements[j.length]&&d.inArray(j.length-1,g)!==-1){g=[j.length]}this.activeIndexes=g;var l=false;d.each(this.activeIndexes,function(n,m){if(!f.elements[m]){return}if(f.elements[m][0].style.display!=="none"){l=true}f.elements[m].children("a").addClass("active")});if(!l&&this.elements[j.length]){d.each(this.activeIndexes,function(n,m){if(!f.elements[m]){return}f.elements[m].children("a").removeClass("active")});this.activeIndexes=[j.length];this.elements[j.length].children("a").addClass("active")}if(this.elements.prevThumb&&this.elements.nextThumb){this.elements.prevThumb.html(this.slider.getSlide(g[0]-1).getThumbHtml());this.elements.nextThumb.html(this.slider.getSlide(g[g.length-1]+1).getThumbHtml())}};e.prototype.getNearestIndex=function(h,f,g){if(Math.abs(h-f)>Math.abs(h-g-f)){h-=g}else{if(Math.abs(h-f)>Math.abs(h+g-f)){h+=g}}return h};e.prototype.combineItems=function(){if(!this.elements[0]){return}var k=this.slider.getVisibleCount();var l=this.slider.getSlides();if(this.elements[l.length]){this.elements[l.length].remove();delete this.elements[l.length]}d.each(this.elements,function(){this.css("display","")});if(k>=2&&this.slider.options.combineNavItems){var n;for(var h=0;this.elements[h];h++){if((h-Math.floor((k-1)/2))%k||(h-Math.floor((k-1)/2))>l.length-k){this.elements[h].css("display","none")}else{n=h}}if(l.length%k===0){this.elements[l.length-k+Math.floor((k-1)/2)].css("display","")}else{var g=l.length-(l.length%k||k)+Math.floor((k-1)/2);this.elements[l.length]=this.createNavItem(g,l[g>=l.length?l.length-1:g].getData()).insertAfter(this.elements[l.length-1])}}if(this.slider.options.navType==="numbers"){for(var f=0,m=0;this.elements[f];f++){if(this.elements[f][0].style.display!=="none"){m++;this.elements[f].children().text(m)}}}};e.prototype.show=function(){d([]).add(this.elements.prev).add(this.elements.next).add(this.elements.main).css("display","")};e.prototype.hide=function(){d([]).add(this.elements.prev).add(this.elements.next).add(this.elements.main).css("display","none")};e.prototype.createNavItem=function(g,h){var f=this;return d(a.createElement("li")).addClass(f.slider.options.cssPrefix+"nav-item").append(d(a.createElement("a")).attr("href","").text((f.slider.options.navType!=="numbers"&&h.name)?h.name:(h.index+1)).on("click",function(i){i.preventDefault();f.itemOnClick(g)}))};e.prototype.createThumb=function(i,f){var h=this;var g=d(a.createElement("a")).attr("href","").html(f.getThumbHtml()).on("click",function(k){k.preventDefault();h.itemOnClick(i)});var j=g.children();if(j.length===1){if(j[0].nodeName.toLowerCase()==="img"||j[0].nodeName.toLowerCase()==="picture"){g.attr("data-rsts-type","image")}if(j[0].nodeName.toLowerCase()==="video"){g.attr("data-rsts-type","video")}}if(j.length){d.each(j[0].attributes,function(l,k){if(k.name.substr(0,10)==="data-rsts-"){g.attr(k.name,k.value)}})}return g};e.prototype.itemOnClick=function(f){var g=this.slider.getVisibleCount();var h=this.slider.getVisibleRowsCount();var i=f-Math.floor((g-1)/2);if(!this.slider.options.loop){i=Math.min(this.slider.slides.length-g,Math.max(0,i))}else{i=this.getNearestIndex(this.slider.getSlideIndex(i),this.slider.slideIndex,this.slider.getSlides().length)}i-=((((i+Math.floor(h/2)-this.slider.slideIndex)%h)+h)%h)-Math.floor(h/2);this.slider.goTo(i)};e.prototype.resize=function(){if(this.thumbsSlider){this.thumbsSlider.resize()}};e.prototype.getSize=function(){if(!this.elements.main||this.elements.main.css("position")==="absolute"){return{x:0,y:0}}return{x:this.elements.main.outerWidth(true),y:this.elements.main.outerHeight(true)}};return e})();d.fn.rstSlider=function(f){var e=arguments;return this.each(function(){var h=d(this);if(typeof f==="string"){var g=h.data("rstSlider");if(g&&g[f]){return g[f].apply(g,Array.prototype.slice.call(e,1))}}else{if(!h.data("rstSlider")){h.data("rstSlider",new b.Slider(h,f))}}})}})(jQuery,window,document); +/*! rocksolid-slider v1.6.11 */ +(function(d,c,a){var b={};b.Slide=(function(){function e(g,h){var f=this;this.slider=h;this.element=d(a.createElement("div")).addClass(h.options.cssPrefix+"slide");this.data={name:undefined,sliderClasses:[]};this.backgrounds=d([]);if(g.nodeName.toLowerCase()==="script"&&g.type==="text/html"){this.contentHtml=g.innerHTML.replace(/\\(.)/gi,"$1");this.data.name=d(g).attr("data-rsts-name")||undefined;this.data.thumbUrl=d(g).attr("data-rsts-thumb")||undefined;this.data.thumbHtml=d(g).attr("data-rsts-thumb-html")||undefined}else{this.init(g)}this.setState("inactive")}e.prototype.init=function(j){var i=this;if(this.isInitialized()){return}if(!j&&this.contentHtml){j=d(this.contentHtml)[0];delete this.contentHtml}this.content=d(j);var l=this.content.attr("data-rsts-class");this.data.name=this.content.attr("data-rsts-name")||this.content.attr("title");this.data.sliderClasses=(l&&l.split(" "))||[];if(this.content.attr("data-rsts-autoplay")){this.data.autoplay=parseFloat(this.content.attr("data-rsts-autoplay"))}if(j.nodeName.toLowerCase()==="img"||j.nodeName.toLowerCase()==="picture"){this.type="image"}if(j.nodeName.toLowerCase()==="video"){this.type="video"}this.type=this.content.attr("data-rsts-type")||this.type||"default";this.centerContent=this.content.attr("data-rsts-center")!==undefined?this.content.attr("data-rsts-center"):this.slider.options.centerContent;if(this.centerContent!=="x"&&this.centerContent!=="y"){this.centerContent=!!this.centerContent}if(this.type==="image"||this.type==="video"){this.centerContent=false}this.element.addClass(this.slider.options.cssPrefix+"slide-"+this.type).append(j);if(!a.createElement("video").canPlayType||(/^iPhone|^iPod/.test(navigator.platform)&&!c.matchMedia("(-webkit-video-playable-inline)").matches)){this.element.find("video[data-rsts-background]").each(function(){var m=d(this);if(m.attr("poster")){d(a.createElement("img")).attr("src",m.attr("poster")).attr("data-rsts-background","").attr("data-rsts-position",m.attr("data-rsts-position")).attr("data-rsts-scale-mode",m.attr("data-rsts-scale-mode")).insertBefore(m)}m.detach()})}if(this.type==="video"&&!this.content.attr("data-rsts-video")&&!a.createElement("video").canPlayType){this.element.find("video").each(function(){var m=d(this);if(!m.find("img").length){d(a.createElement("img")).attr("src",m.attr("poster")).attr("data-rsts-position",m.attr("data-rsts-position")).attr("data-rsts-scale-mode",m.attr("data-rsts-scale-mode")).appendTo(m)}});this.type="image"}this.backgrounds=[];this.element.find("[data-rsts-background]").each(function(){var m=d(this);if(m.is("img")&&m.parent().is("picture")){m=m.parent()}if(m.is("video")){m.attr("autoplay",true).attr("loop",true).attr("playsinline",true).attr("webkit-playsinline",true)}m.css({position:"absolute",top:0,left:0});i.backgrounds.push(m[0])});this.backgrounds=d(this.backgrounds).prependTo(this.element);if(this.backgrounds.length){this.element.children().last().css({position:"relative"});if(this.backgrounds.filter("video").length){this.element.children().last().css({"-webkit-transform":"translateZ(0)"})}}this.element.find("video[autoplay]").each(function(){if(this.pause){this.pause()}});this.element.find("img[loading=lazy]").each(function(){this.loading="eager"});if(this.content.attr("data-rsts-thumb")){this.data.thumbUrl=this.content.attr("data-rsts-thumb")}if(this.content.attr("data-rsts-thumb-html")){this.data.thumbHtml=this.content.attr("data-rsts-thumb-html")}if(this.type==="image"){this.data.name=this.data.name||this.element.find("img").last().attr("alt");if(this.element.find("img").last().attr("data-rsts-thumb")){this.data.thumbUrl=this.element.find("img").last().attr("data-rsts-thumb")}if(!this.data.thumbUrl){this.data.thumbUrl=this.element.find("img").last().attr("src")}}if(!this.data.thumbUrl&&this.type==="video"){if(!this.content.attr("data-rsts-video")&&this.element.find("video").last().attr("poster")){this.data.thumbUrl=this.element.find("video").last().attr("poster")}else{if(this.element.find("img").last().length){this.data.thumbUrl=this.element.find("img").last().attr("data-rsts-thumb")||this.element.find("img").last().attr("src")}}}if(this.data.name&&this.slider.options.captions){d(a.createElement("div")).addClass(this.slider.options.cssPrefix+"caption").text(this.data.name).appendTo(this.element)}var f=false;var k={};var h=function(m){f=true;var n=m&&m.target&&(m.target.currentSrc||m.target.src);if(n){var o=((m&&m.type)||"none")+"\n"+n;if(k[o]){return}k[o]=true}i.slider.resize(i.data.index);if(i.slider.css3Supported){i.slider.elements.crop.css("transform","translateZ(0)");i.slider.elements.crop.css("transform");i.slider.elements.crop.css("transform","")}};this.element.find("img").on("load",h);this.element.find("video").on("loadedmetadata loadeddata",h);if(this.element.find("img").length&&!this.element.find("img")[0].complete){setTimeout(function(){if(!f&&i.element.find("img")[0].complete){h()}},1000)}var g=this.element.find("h1,h2,h3,h4,h5,h6");if(!this.data.name&&g.length){this.data.name=g.text()}if(this.type==="video"){this.data.video=this.content.attr("data-rsts-video");this.videoStartButton=d(a.createElement("a")).attr("href",this.data.video||"").text(this.slider.options.labels.play).addClass(this.slider.options.cssPrefix+"video-play").on("click",function(m){m.preventDefault();i.startVideo()}).appendTo(this.element);if(!this.data.video&&this.element.find("video").last().length){this.videoControlsEnabled=!!this.element.find("video").last()[0].controls;this.element.find("video").last()[0].controls=false;this.element.find("video").last().on("ended",function(){i.stopVideo(true)})}}};e.prototype.videoRegExp={youtube:/^https?:\/\/(?:(?:www\.)?youtube(?:-nocookie)?\.com\/(?:watch\?v=|v\/|embed\/)|youtu\.be\/)([0-9a-z_\-]{11})(?:$|&|\?|#|\/)(?:(?:.*[?&#]|)t=([0-9hms]+))?/i,youtubePlayer:/^https?:\/\/(?:www\.)?youtube(?:-nocookie)?\.com\/embed\/[0-9a-z_\-]{11}/i,vimeo:/^https?:\/\/(?:player\.)?vimeo\.com\/(?:video\/)?([0-9]+)(?:.*#t=([0-9hms]+))?/i,vimeoPlayer:/^https?:\/\/player\.vimeo\.com\/video\/[0-9]+/i};e.prototype.isInjected=function(){return !!(this.element.get(0).parentNode&&this.element.get(0).parentNode.tagName)};e.prototype.isInitialized=function(){return !!this.content};e.prototype.isMediaLoaded=function(){var f=true;this.element.find("img").each(function(){if(this.complete===false){f=false;return false}});return f};e.prototype.size=function(f,h,g){this.updateResponsiveImages(true);if(!this.isInjected()){return{x:g?(f||0):f,y:g?(h||0):h}}if(f&&!h){this.slider.modify(this.element,{width:f,height:""});this.scaleContent(f,h);if(g||this.backgrounds.length){h=this.element.outerHeight()}}else{if(h&&!f){this.slider.modify(this.element,{height:h,width:""});this.scaleContent(f,h);if(g||this.backgrounds.length){f=this.element.outerWidth()}}else{if(f&&h){this.slider.modify(this.element,{width:f,height:h});this.scaleContent(f,h)}else{this.scaleContent(f,h);f=this.element.outerWidth();h=this.element.outerHeight()}}}this.scaleBackground(f,h);return{x:f,y:h}};e.prototype.updateResponsiveImages=function(g){var f=c.picturefill||c.respimage;if(!f){return}f({elements:this.element.find("img").get(),reevaluate:!!g})};e.prototype.scaleContent=function(f,h){if(this.centerContent){if(this.content.css("display")==="inline"){this.content.css("display","inline-block")}var g={"margin-top":"","margin-left":""};if(this.centerContent!=="y"&&f){g["margin-left"]=Math.round((f-this.content.outerWidth())/2)}if(this.centerContent!=="x"&&h){g["margin-top"]=Math.round((h-this.content.outerHeight())/2)}this.content.css(g)}if(this.type==="video"&&!this.data.video){this.element.find("video").last().css({width:f,height:h,display:"block"})}else{if(this.type==="image"||this.type==="video"){this.scaleImage(this.element.find("img").last(),f,h)}}};e.prototype.scaleBackground=function(f,h){var g=this;this.backgrounds.each(function(){var i=d(this);if(i.is("picture")){i=i.find("img").first()}g.scaleImage(i,f,h)})};e.prototype.scaleImage=function(f,m,l){var n=f.attr("data-rsts-scale-mode")||this.slider.options.scaleMode;var g=f.attr("data-rsts-position")||this.slider.options.imagePosition;var i=this.getOriginalSize(f);if(!i.x||!i.y){return}var j=i.x/i.y;if(m&&!l){l=m/j}else{if(l&&!m){m=l*j}else{if(!m&&!l){m=i.x;l=i.y}}}var k=m/l;var h={display:"block",width:i.x,height:i.y,"min-width":0,"min-height":0,"max-width":"none","max-height":"none"};if(n==="fit"||n==="crop"){if((j>=k&&n==="fit")||(j<=k&&n==="crop")){h.width=m;h.height=m/j}else{h.width=l*j;h.height=l}}else{if(n==="scale"){h.width=m;h.height=l}}h["margin-top"]=(l-h.height)/2;h["margin-left"]=(m-h.width)/2;if(g==="top"||g==="top-left"||g==="top-right"){h["margin-top"]=0}else{if(g==="bottom"||g==="bottom-left"||g==="bottom-right"){h["margin-top"]=l-h.height}}if(g==="left"||g==="top-left"||g==="bottom-left"){h["margin-left"]=0}else{if(g==="right"||g==="top-right"||g==="bottom-right"){h["margin-left"]=m-h.width}}f.css(h)};e.prototype.getOriginalSize=function(h){h=d(h);var g={};if(h[0].nodeName.toLowerCase()==="img"){if("naturalWidth" in new Image()){g.x=h[0].naturalWidth;g.y=h[0].naturalHeight}else{var f=new Image();f.src=h[0].src;g.x=f.width;g.y=f.height}}else{if(h[0].nodeName.toLowerCase()==="video"){g.x=h[0].videoWidth;g.y=h[0].videoHeight}}if(!g.x||!g.y){if(h.attr("width")||h.attr("height")){g.x=parseFloat(h.attr("width")||h.attr("height"));g.y=parseFloat(h.attr("height")||h.attr("width"))}else{g.x=g.y=0}}return g};e.prototype.setState=function(g){if(g==="active"&&g!==this.state&&this.state!=="preactive"){this.setState("preactive");this.element.css("opacity")}if(this.type==="video"&&this.state&&g==="inactive"&&g!==this.state){this.stopVideo()}if(this.type==="video"&&this.state&&g==="active"&&g!==this.state&&this.slider.options.videoAutoplay){this.startVideo()}if((g==="preactive"||g==="active")&&g!==this.state){this.element.find("video[autoplay]").each(function(){if(this.play){this.play()}})}else{if(g!=="active"&&g!=="preactive"&&(this.state==="active"||this.state==="preactive")){this.element.find("video").each(function(){if(this.pause){this.pause()}})}}this.state=g;var f=this.slider.options.cssPrefix;this.element.removeClass(f+"active").removeClass(f+"inactive").removeClass(f+"preactive").removeClass(f+"postactive").addClass(f+g)};e.prototype.stopVideo=function(h,g){if(!this.isVideoPlaying){return}this.isVideoPlaying=false;if(this.eventNamespace){d(c).off("message."+this.eventNamespace);delete this.eventNamespace}if(!this.data.video){var f=this.element.find("video").last();f[0].controls=false;f[0].pause();f[0].currentTime=0;if(f[0].poster){f[0].src="";f.removeAttr("src")}}if(this.videoElement){this.videoElement.attr("src","");this.videoElement.remove();delete this.videoElement}if(this.videoStopButton){this.videoStopButton.remove();delete this.videoStopButton}if(this.videoStartButton){this.videoStartButton.css("display","")}this.slider.elements.main.removeClass(this.slider.options.cssPrefix+"video-playing");if(h&&this.slider.options.autoplayRestart){this.slider.autoplay(200)}else{if(g){this.slider.stopAutoplay()}}};e.prototype.startVideo=function(){var f=this;var k,g,i,j,l;if(this.isVideoPlaying){return}this.isVideoPlaying=true;this.slider.stopAutoplay(true);if(!this.data.video){var h=this.element.find("video").last();h[0].controls=this.videoControlsEnabled;h[0].play();this.videoStartButton.css("display","none")}else{if((i=this.data.video.match(this.videoRegExp.youtube))){this.element.addClass(this.slider.options.cssPrefix+"video-youtube");k=i[1];j=i[2];if(j){j=j.split(/[hm]/).reverse();j[0]=parseInt(j[0]||0,10);j[1]=parseInt(j[1]||0,10);j[2]=parseInt(j[2]||0,10);j=j[0]+(j[1]*60)+(j[2]*60*60)}l="https://www.youtube"+(this.data.video.indexOf("youtube-nocookie.com")===-1?"":"-nocookie")+".com/embed/"+k;if(this.data.video.match(this.videoRegExp.youtubePlayer)){l=this.data.video}if(!l.match(/[?&]autoplay=/i)){l+=(l.match(/\?/)?"&":"?")+"autoplay=1"}if(!l.match(/[?&]enablejsapi=/i)){l+="&enablejsapi=1"}if(!l.match(/[?&]wmode=/i)){l+="&wmode=opaque"}if(j&&!l.match(/[?&]start=/i)){l+="&start="+j}this.videoElement=this.createVideoIframe(l).appendTo(this.element);g=function(){if(f.videoElement&&c.YT){new YT.Player(f.videoElement.get(0),{events:{onStateChange:function(m){if(m.data===YT.PlayerState.ENDED){f.stopVideo(true)}}}})}};if(c.YT&&YT.Player){g()}else{d(a.createElement("script")).attr("src","//www.youtube.com/iframe_api").appendTo(a.head);c.onYouTubeIframeAPIReady=function(){delete c.onYouTubeIframeAPIReady;g()}}}else{if((i=this.data.video.match(this.videoRegExp.vimeo))){this.element.addClass(this.slider.options.cssPrefix+"video-vimeo");k=i[1];j=i[2];l="https://player.vimeo.com/video/"+k;if(this.data.video.match(this.videoRegExp.vimeoPlayer)){l=this.data.video}if(!l.match(/[?&]autoplay=/i)){l+=(l.match(/\?/)?"&":"?")+"autoplay=1"}if(!l.match(/[?&]api=/i)){l+="&api=1"}if(j&&!l.match(/#t=/i)){l+="#t="+j}this.videoElement=this.createVideoIframe(l).appendTo(this.element);this.eventNamespace="rsts"+new Date().getTime();d(c).on("message."+this.eventNamespace,function(m){var n=JSON.parse(m.originalEvent.data);if(n&&n.event){if(n.event==="ready"){f.videoElement.get(0).contentWindow.postMessage('{"method":"addEventListener","value":"finish"}',f.videoElement.attr("src").split("?")[0])}else{if(n.event==="finish"){f.stopVideo(true)}}}})}else{this.element.addClass(this.slider.options.cssPrefix+"video-unknown");this.videoElement=this.createVideoIframe(this.data.video).appendTo(this.element)}}}this.videoStopButton=d(a.createElement("a")).attr("href",this.data.video||"").text(this.slider.options.labels.stop).addClass(this.slider.options.cssPrefix+"video-stop").on("click",function(m){m.preventDefault();f.stopVideo(false,true)}).appendTo(this.element);this.slider.elements.main.addClass(this.slider.options.cssPrefix+"video-playing")};e.prototype.createVideoIframe=function(f){return d(a.createElement("iframe")).addClass(this.slider.options.cssPrefix+"video-iframe").attr("frameborder",0).attr("allowfullscreen","allowfullscreen").attr("allow","autoplay; encrypted-media; picture-in-picture; fullscreen").attr("src",f)};e.prototype.setIndex=function(f){this.data.index=f};e.prototype.getData=function(){return this.data};e.prototype.getThumbUrl=function(){return this.data.thumbUrl||"data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs="};e.prototype.getThumbHtml=function(){return this.data.thumbHtml||d(a.createElement("div")).append(d(a.createElement("img")).attr("src",this.getThumbUrl()).attr("alt",this.data.name)).html()};return e})();b.Slider=(function(){function e(i,h){var g=this;this.slides=[];this.elements={};this.elements.main=i;this.options=d.extend(true,{},this.defaultOptions,h);if(this.options.height==="auto"&&this.options.direction==="y"){throw new Error('height "auto" with direction "y" ist not possible')}if(this.options.type!=="slide"){this.options.visibleArea=1;this.options.visibleAreaMax=0;this.options.slideMaxCount=0;this.options.slideMinSize=0;this.options.slideMaxSize=0;this.options.rowMaxCount=0;this.options.rowMinSize=0;this.options.rowSlideRatio=0}this.checkCss3Support();this.readSlides();if(this.options.random){this.slides.sort(function(){return Math.random()-0.5})}d.each(this.slides,function(k){this.setIndex(k)});this.slideIndex=this.getIndexFromUrl();if(this.slideIndex===false){this.slideIndex=0}this.activeSlideOffset=0;d(c).on("hashchange.rsts",function(){var k=g.getIndexFromUrl();if(k!==false&&k!==g.slideIndex){g.goTo(k)}});this.elements.main.addClass(this.options.cssPrefix+"main").addClass(this.options.cssPrefix+"direction-"+this.options.direction).addClass(this.options.cssPrefix+"type-"+this.options.type).addClass(this.options.cssPrefix+"skin-"+this.options.skin);if(this.options.direction==="x"&&this.options.height==="normalize"){this.normalizeSize=true;this.options.height="auto"}else{if(this.options.direction==="x"&&(this.options.height==="auto"||(this.options.height==="css"&&this.elements.main.height()<1))){this.autoSize=true}else{if(this.options.direction==="y"&&this.options.width==="normalize"){this.normalizeSize=true;this.options.width="auto"}else{if(this.options.direction==="y"&&(this.options.width==="auto"||(this.options.width==="css"&&this.elements.main.width()<1))){this.autoSize=true}}}}var j=this.options.width.match(/([0-9.]+)[^0-9.]*x[^0-9.]*([0-9.]+)/i);if(j){this.proportion=j[1]/j[2];delete this.options.width;this.elements.main.css({width:"auto"})}j=this.options.height.match(/([0-9.]+)[^0-9.]*x[^0-9.]*([0-9.]+)/i);if(j){this.proportion=j[1]/j[2];delete this.options.height;this.elements.main.css({height:"auto"})}if(this.options.width&&this.options.width!=="css"){this.elements.main.css({width:this.options.width});if(this.options.width==="auto"){this.options.width="css"}}if(this.options.height&&this.options.height!=="css"){this.elements.main.css({height:this.options.height})}if(this.elements.header){this.elements.header.addClass(this.options.cssPrefix+"header").appendTo(this.elements.main)}this.elements.view=d(a.createElement("div")).addClass(this.options.cssPrefix+"view").appendTo(this.elements.main);this.elements.crop=d(a.createElement("div")).addClass(this.options.cssPrefix+"crop").on("scroll",function(){d(this).scrollLeft(0).scrollTop(0)}).appendTo(this.elements.view);this.elements.slides=d(a.createElement("div")).addClass(this.options.cssPrefix+"slides").appendTo(this.elements.crop);if(this.options.autoplay&&this.options.autoplayProgress){this.elements.progress=d(a.createElement("div")).addClass(this.options.cssPrefix+"progress").appendTo(this.elements.view);this.elements.progressBar=d(a.createElement("div")).appendTo(this.elements.progress)}this.elements.overlayPrev=d(a.createElement("div")).addClass(this.options.cssPrefix+"overlay-prev").appendTo(this.elements.view);this.elements.overlayNext=d(a.createElement("div")).addClass(this.options.cssPrefix+"overlay-next").appendTo(this.elements.view);this.nav=new b.SliderNav(this);if(this.elements.footer){this.elements.footer.addClass(this.options.cssPrefix+"footer").appendTo(this.elements.main)}this.preloadSlides(this.slideIndex);this.cleanupSlides();d(c).on("resize.rsts",function(){g.resize()});this.resize();this.nav.combineItems();this.resize();if(!this.autoplayStopped){this.autoplay()}d(c).on("domready.rsts load.rsts",function(){if(g.windowSizeHasChanged()){g.resize()}});if(this.options.type==="slide"){this.setDragEvents()}else{this.modify(this.slides[this.slideIndex].element,{opacity:1})}if(this.css3Supported){this.elements.slides.on("transitionend webkitTransitionEnd oTransitionEnd msTransitionEnd",function(k){if((g.options.type==="slide"&&k.target===g.elements.slides.get(0))||(g.options.type!=="slide"&&k.target.parentNode===g.elements.slides.get(0))){g.cleanupSlides()}})}if(this.options.pauseAutoplayOnHover){this.elements.view.on("mouseenter",function(){if(!g.isTouch){g.pauseAutoplay()}});this.elements.view.on("mouseleave",function(){g.playAutoplay()})}this.isVisible=true;d(a).on("visibilitychange webkitvisibilitychange",function(k){g.checkVisibility()});var f;d(c).on("scroll",function(k){clearTimeout(f);f=setTimeout(function(){g.checkVisibility()},100)});this.checkVisibility();if(this.options.keyboard){d(a.body).on("keydown.rsts",function(m){var l=g.options.direction==="x"?37:38;var k=g.options.direction==="x"?39:40;if((m.which===l||m.which===k)&&(m.target===a.body||d(m.target).closest(g.elements.main).length)){if(m.which===l){g.prev()}else{g.next()}}})}}e.prototype.defaultOptions={type:"slide",direction:"x",visibleArea:1,visibleAreaMax:0,visibleAreaAlign:0.5,random:false,loop:false,cssPrefix:"rsts-",skin:"default",width:"css",height:"css",preloadSlides:2,slideMaxCount:0,slideMinSize:0,slideMaxSize:0,rowMaxCount:0,rowMinSize:0,rowSlideRatio:0,combineNavItems:true,prevNextSteps:0,centerContent:false,gapSize:20,duration:400,autoplay:false,videoAutoplay:false,autoplayRestart:false,autoplayProgress:false,pauseAutoplayOnHover:false,navType:"bullets",controls:true,thumbControls:false,scaleMode:"fit",imagePosition:"center",deepLinkPrefix:false,keyboard:true,captions:true,labels:{prev:"Previous",next:"Next",play:"Play",stop:"Stop",},thumbs:{cssPrefix:"rsts-thumbs-",navType:"none",slideMinSize:50,slideMaxSize:50,preloadSlides:10,gapSize:5,width:"100%",height:"1x1",scaleMode:"crop",keyboard:false,captions:false}};e.prototype.goTo=function(l,o,j){var r=this;if(!j){this.stopAutoplay()}var m=this.getVisibleCount();var k=this.getVisibleRowsCount();var s=false;var v=0;var g=this.slideIndex;var w=l-this.slideIndex<0?-1:l===this.slideIndex?0:1;if((l<0||l>this.slides.length-1)&&this.options.loop){v=l-this.slideIndex;l=this.getSlideIndex(l)}else{if((l<0||l>this.slides.length-m)&&!this.options.loop){if(this.options.type!=="slide"){return}s=l<0?-1:1;l=l<0?0:this.slides.length-m}}if(!s&&this.slideIndex===l&&!o){return}var x=[];for(var u=this.slideIndex;u<=this.slideIndex+m-1;u++){x.push(this.getSlideIndex(u))}var t=[];for(u=l;u<=l+m-1;u++){t.push(this.getSlideIndex(u))}d.each(x,function(y,z){if(d.inArray(z,t)===-1){r.slides[z].setState("postactive")}});d.each(t,function(y,z){if(d.inArray(z,x)===-1){r.slides[z].setState("preactive")}});var h=this.slideSize+this.getGapSize();if(v){this.activeSlideOffset=this.getSlideOffset(this.slideIndex+v)}else{if(l>this.slideIndex&&l-this.slideIndex-m>this.options.preloadSlides*k*2){this.activeSlideOffset+=(this.options.preloadSlides*k*2+m)*h/k}else{if(lthis.options.preloadSlides*k*2){this.activeSlideOffset-=(this.options.preloadSlides*k*2+m)*h/k}else{this.activeSlideOffset=this.getSlideOffset(l)}}}this.slideIndex=l;var n=true;if(!o){n=false}else{d.each(t,function(y,z){if(!r.slides[z].isInjected()||Math.round(r.slides[z].element.position()[{x:"left",y:"top"}[r.options.direction]])!==Math.round(r.getSlideOffset(r.slideIndex+y))){n=false;return false}})}if(n){this.preloadOnCleanup=true}else{this.preloadSlides(l,g)}var q=this.getViewSize(l);var p;var f=-this.getSlideOffset(l)+Math.round(q[this.options.direction]*(1-this.visibleAreaRate)*this.options.visibleAreaAlign);if(o&&!s){p=Math.abs((this.getOffset(this.elements.slides)-f)/h)}else{if(o&&s){p=0.7}}if(this.options.type==="slide"){if(/Apple/.test(navigator.vendor)){this.elements.crop.css("transform","translateZ(0)");this.elements.crop.css("transform");this.elements.crop.css("transform","")}this.modify(this.elements.slides,{offset:f},true,p,o,!o&&s)}else{if(this.options.type==="fade"||this.options.type==="fade-in-out"){if(this.options.type==="fade-in-out"){d.each(x,function(y,z){if(t.indexOf(z)===-1){r.modify(r.slides[z].element,{opacity:0},true)}})}this.modify(this.slides[this.slideIndex].element,{opacity:1},true)}else{if(this.options.type==="side-slide"){this.modify(this.slides[this.slideIndex].element,{offset:w*this.slideSize});this.slides[this.slideIndex].element.position();this.modify(this.slides[this.slideIndex].element,{offset:0},true)}else{this.modify(this.slides[this.slideIndex].element,{},true)}}}this.nav.setActive(t);if(this.autoSize){this.modify(this.elements.crop,{width:q.x,height:q.y},true,p,o)}this.elements.main.trigger({type:"rsts-slidestart",rstSlider:this})};e.prototype.getIndexFromUrl=function(){if(!this.options.deepLinkPrefix){return false}var f="#"+this.options.deepLinkPrefix;if(c.location.hash.substr(0,f.length)===f){var g=Math.abs(parseInt(c.location.hash.substr(f.length),10));if(g){if(g>this.slides.length){g=this.slides.length}return g-1}}return 0};e.prototype.stopAutoplay=function(g){var f=this;clearTimeout(this.autoplayTimeout);this.autoplayStopped=true;if(this.options.autoplay&&this.options.autoplayProgress){this.elements.progress.removeClass(this.options.cssPrefix+"progress-active")}if(this.options.autoplayRestart&&!g){this.autoplayTimeout=setTimeout(function(){f.autoplay()},this.options.autoplayRestart-this.options.autoplay+(this.options.duration*2))}};e.prototype.pauseAutoplay=function(){if(!this.options.autoplay||this.autoplayPaused){return}if(!this.autoplayStopped){clearTimeout(this.autoplayTimeout)}this.autoplayPaused=true;if(this.options.autoplay&&this.options.autoplayProgress&&!this.autoplayStopped){this.pauseAutoplayProgressBar()}};e.prototype.playAutoplay=function(){if(!this.options.autoplay||!this.autoplayPaused){return}this.autoplayPaused=false;if(!this.autoplayStopped){this.autoplay((1-(this.options.autoplayProgress?this.elements.progressBar.outerWidth()/this.elements.progress.width():0))*(this.slides[this.slideIndex].getData().autoplay||this.options.autoplay))}};e.prototype.autoplay=function(g){var f=this;if(!this.options.autoplay||this.getVisibleCount()>=this.slides.length){return}clearTimeout(this.autoplayTimeout);this.autoplayStopped=false;if(this.autoplayPaused){this.pauseAutoplayProgressBar(0);return}g=(g||g===0)?g:((this.slides[this.slideIndex].getData().autoplay||this.options.autoplay)-this.options.duration);this.startAutoplayProgressBar(g);var h=function(){var k=f.getVisibleCount();var j=f.slideIndex+(Math.min(f.options.prevNextSteps*f.getVisibleRowsCount(),k)||k);if(j>f.slides.length-k&&!f.options.loop){if(f.slideIndexthis.slides.length-g&&this.slideIndex0){f=0}this.goTo(f)};e.prototype.readSlides=function(){var f=this;this.elements.main.children().each(function(){var g=d(this);if(g.is('h1, h2, h3, h4, h5, h6, [data-rsts-type="header"]')){if(!f.elements.header){f.elements.header=d(a.createElement("div"))}g.appendTo(f.elements.header)}else{if(g.is('[data-rsts-type="footer"]')){if(!f.elements.footer){f.elements.footer=d(a.createElement("div"))}g.appendTo(f.elements.footer)}else{f.slides.push(new b.Slide(this,f))}}});this.elements.main.empty();if(this.slides.length===0){throw new Error("No slides found")}};e.prototype.preloadSlides=function(k,l){var p=this;var q=this.getViewSizeFixed();q[this.options.direction]=this.slideSize;if(this.getVisibleRowsCount()>1){q[this.options.direction==="x"?"y":"x"]=this.rowSize}var o=this.getVisibleCount();var f=0;if(this.options.loop){f=Math.min(Math.floor((this.slides.length-o)/2),this.options.preloadSlides*this.getVisibleRowsCount())}else{f=this.options.preloadSlides*this.getVisibleRowsCount()}var n=this.getActiveSlides(k);var j=0;var h,m;for(var g=k-f;g<=k+f+o-1;g++){m=this.getSlideIndex(g);h=this.slides[m];if(!this.options.loop&&(g<0||g>=this.slides.length)){continue}if(!h.isInitialized()){h.init();j++}if(p.options.type!=="slide"&&g!==k){continue}if(p.options.type==="slide"){if(l!==undefined&&d.inArray(m,n)===-1&&(g<0||g>=this.slides.length)&&h.isInjected()){this.preloadOnCleanup=true;continue}p.modify(h.element,{offset:p.getSlideOffset(g),rowOffset:p.getRowOffset(g)})}if(!h.isInjected()){if(p.options.type==="fade"||p.options.type==="fade-in-out"){p.modify(h.element,{opacity:0})}p.elements.slides.append(h.element);h.size(q.x,q.y)}else{if(p.options.type!=="slide"&&g===p.slideIndex&&h.element.next().length){if(p.options.type==="fade"||p.options.type==="fade-in-out"){if(h.element.next().length===1){p.modify(h.element,{opacity:1-h.element.next().css("opacity")});p.modify(h.element.next(),{opacity:1})}else{p.modify(h.element,{opacity:0})}}p.elements.slides.append(h.element)}}}if(this.normalizeSize&&j){this.resize()}};e.prototype.getActiveSlides=function(j){j=j!==undefined?j:this.slideIndex;var h=[];var g=this.getVisibleCount();for(var f=j;f<=j+g-1;f++){h.push(this.getSlideIndex(f))}return h};e.prototype.cleanupSlides=function(){clearTimeout(this.cleanupSlidesTimeout);var o=this;var n=this.getVisibleCount();var g=this.options.type==="slide"?this.options.preloadSlides*this.getVisibleRowsCount():0;var k=[];var m=[];var h=[];var f=[];for(var j=this.slideIndex-g;j<=this.slideIndex+g+n-1;j++){k.push(this.getSlideIndex(j))}for(j=this.slideIndex;j<=this.slideIndex+n-1;j++){m.push(this.getSlideIndex(j))}d.each(this.slides,function(q,p){d.merge(h,p.data.sliderClasses);if(p.isInjected()&&d.inArray(q,k)===-1){if((o.options.type==="fade"||o.options.type==="fade-in-out")&&o.slides[o.slideIndex].element.css("opacity")<1){return}if(o.options.type==="side-slide"){var r=o.options.direction==="x"?"left":"top";if(o.slides[o.slideIndex].element.position()[r]!==0){return}}p.element.detach()}if(d.inArray(q,m)===-1&&p.state!=="inactive"){p.setState("inactive")}});this.nav.setActive(m);d.each(m,function(p,q){o.slides[q].setState("active");d.merge(f,o.slides[q].data.sliderClasses)});this.elements.main.removeClass(d.grep(h,function(i){return d.inArray(i,f)===-1}).join(" "));this.elements.main.addClass(f.join(" "));if(this.options.deepLinkPrefix&&this.getIndexFromUrl()!==this.slideIndex){if(this.slideIndex){c.location.hash="#"+this.options.deepLinkPrefix+(this.slideIndex+1)}else{if(c.history&&c.history.pushState){c.history.pushState("",a.title,c.location.pathname+c.location.search)}else{var l={x:d(c).scrollLeft(),y:d(c).scrollTop()};c.location.hash="";d(c).scrollLeft(l.x);d(c).scrollTop(l.y)}}}if(this.preloadOnCleanup){this.preloadOnCleanup=false;this.preloadSlides(this.slideIndex)}if(this.windowSizeHasChanged()){this.resize()}this.elements.main.trigger({type:"rsts-slidestop",rstSlider:this})};e.prototype.getSlideOffset=function(f){var g=this.getViewSizeFixed(true);var j=this.getVisibleSlidesCount();var h=this.getVisibleRowsCount();var k=this.getGapSize();var i=this.slidesCutOff?0:(this.slideSize+k)-(((g[this.options.direction]*this.visibleAreaRate)+k)/j);return Math.floor((f-this.slideIndex)/h)*(this.slideSize+k)-Math.round(i*Math.floor((f-this.slideIndex)/h))+this.activeSlideOffset};e.prototype.getRowOffset=function(l){var n=this.getViewSizeFixed(true);var k=this.getVisibleRowsCount();var o=((((l-this.slideIndex)%k)+k)%k);var h=0;var m=this.options.direction==="x"?"y":"x";var f=this.getGapSize();if(this.autoSize){var p={};p[this.options.direction]=this.slideSize;for(var j=l-o;jthis.options.slideMaxSize)){g=Math.ceil((f+h)/(this.options.slideMaxSize+h))}if(this.options.slideMinSize&&(f-(h*(g-1)))/gthis.options.rowMaxCount)){g=this.options.rowMaxCount}if(f&&!this.normalizeSize&&this.options.rowMinSize&&(!g||(f-(i*(g-1)))/gthis.options.visibleAreaMax){this.visibleAreaRate=this.options.visibleAreaMax/(this.options.direction==="x"?f:k)}if(this.options.slideMaxSize&&(this.options.direction==="x"?f:k)*this.visibleAreaRate>this.slides.length*(this.options.slideMaxSize+j)-j){this.visibleAreaRate=(this.slides.length*(this.options.slideMaxSize+j)-j)/(this.options.direction==="x"?f:k)}var h=this.getVisibleSlidesCount();var i=this.getVisibleRowsCount();if(!this.options.width&&this.proportion){f=this.viewSizeFixedCache.x=Math.round((((((((k+j)/i)-j)*this.proportion)+j)*h)-j)/this.visibleAreaRate)}if(!this.options.height&&this.proportion){k=this.viewSizeFixedCache.y=Math.round(((Math.round(((((f*this.visibleAreaRate)+j)/h)-j)/this.proportion)+j)*i)-j)}if(this.normalizeSize&&this.normalizedSize){if(this.options.direction==="x"){k=this.viewSizeFixedCache.y=((this.normalizedSize+j)*i)-j}else{f=this.viewSizeFixedCache.x=((this.normalizedSize+j)*i)-j}}this.slideSize=(j>0?Math.round:Math.ceil)((((this.options.direction==="x"?f:k)*this.visibleAreaRate)-(j*(h-1)))/h);this.slidesCutOff=false;if((this.options.slideMinSize&&this.slideSize1)||(this.options.slideMaxSize&&this.slideSize>this.options.slideMaxSize)){this.slideSize=this.options.slideMaxSize||this.options.slideMinSize;this.slidesCutOff=true;this.visibleAreaRate=(h*(this.slideSize+j)-j)/(this.options.direction==="x"?f:k);if(!this.options.width&&this.proportion){f=this.viewSizeFixedCache.x=Math.round((((((((k+j)/i)-j)*this.proportion)+j)*h)-j)/this.visibleAreaRate)}if(!this.options.height&&this.proportion){k=this.viewSizeFixedCache.y=Math.round(((Math.round(((((f*this.visibleAreaRate)+j)/h)-j)/this.proportion)+j)*i)-j)}}if(this.options.direction==="x"?k:f){this.rowSize=(j>0?Math.round:Math.ceil)(((this.options.direction==="x"?k:f)-(j*(i-1)))/i)}else{this.rowSize=undefined}return d.extend({},this.viewSizeFixedCache)};e.prototype.getViewSize=function(j){j=j||0;var p=this.getViewSizeFixed();var q=p[this.options.direction];p[this.options.direction]=this.slideSize;if(!p.x||!p.y){var m=this.getVisibleSlidesCount();var l=this.getVisibleRowsCount();var f=this.getGapSize();var n=!p.x?"x":"y";var i=0;var g,o,h,k;for(g=0;g=this.slides.length){this.elements.main.addClass(this.options.cssPrefix+"dragging-disabled");this.nav.hide();this.stopAutoplay(true)}else{this.elements.main.removeClass(this.options.cssPrefix+"dragging-disabled");this.nav.show();if(f>=this.slides.length){this.stopAutoplay()}}if(f!==this.getVisibleCount()){this.nav.combineItems();this.cleanupSlides()}this.checkVisibility();this.windowSizeHasChanged()};e.prototype.checkVisibility=function(){var g=!(a.hidden||a.webkitHidden);var h=false;var f=this.elements.main;var j=f.offset();var i=d(c);if(g&&j.lefti.scrollLeft()&&j.topi.scrollTop()){h=true}if(this.isVisible!==h){this.isVisible=h;if(h){this.playAutoplay()}else{this.pauseAutoplay()}}};e.prototype.getSlides=function(){return this.slides};e.prototype.getSlide=function(f){return this.slides[this.getSlideIndex(f)]};e.prototype.getSlideIndex=function(f){return((f%this.slides.length)+this.slides.length)%this.slides.length};e.prototype.setTouch=function(f){if(f!==this.isTouch){if(f){this.elements.main.addClass(this.options.cssPrefix+"touch").removeClass(this.options.cssPrefix+"no-touch")}else{this.elements.main.addClass(this.options.cssPrefix+"no-touch").removeClass(this.options.cssPrefix+"touch")}}if(f){this.lastTouchTime=new Date().getTime()}this.isTouch=f};e.prototype.setDragEvents=function(){var f=this;this.lastTouchTime=0;this.setTouch(false);var g={start:"mousedown",stop:"mouseup",move:"mousemove"};if(c.navigator.pointerEnabled&&c.navigator.maxTouchPoints){g={start:"pointerdown",stop:"pointerup",move:"pointermove"};this.elements.crop.css("touch-action","pan-"+(this.options.direction==="x"?"y":"x")+" pinch-zoom double-tap-zoom");this.elements.main.on("pointerdown",function(h){if(h.originalEvent.pointerType==="touch"){f.setTouch(true)}})}else{if(c.navigator.msPointerEnabled&&c.navigator.msMaxTouchPoints){g={start:"MSPointerDown",stop:"MSPointerUp",move:"MSPointerMove"};this.elements.crop.css("-ms-touch-action","pan-"+(this.options.direction==="x"?"y":"x")+" pinch-zoom double-tap-zoom");this.elements.main.on("MSPointerDown",function(h){if(h.originalEvent.pointerType===h.originalEvent.MSPOINTER_TYPE_TOUCH){f.setTouch(true)}})}else{if("ontouchstart" in c||"ontouchend" in a){g={start:g.start+" touchstart",stop:g.stop+" touchend touchcancel",move:g.move+" touchmove"};this.elements.main.on("touchstart",function(h){f.setTouch(true)})}}}this.elements.crop.on(g.start,function(h){return f.onDragStart(h)});d(a).on(g.stop+".rsts",function(h){return f.onDragStop(h)});d(a).on(g.move+".rsts",function(h){return f.onDragMove(h)});this.elements.crop.on("dragstart",function(h){if(f.isDragging){h.preventDefault()}});if(this.elements.crop[0].addEventListener){this.elements.crop[0].addEventListener("click",function(h){return f.onClickCapturing(d.event.fix(h))},true)}};e.prototype.onDragStart=function(f){if(this.isDragging||(f.type==="mousedown"&&f.which!==1)||this.getVisibleCount()>=this.slides.length){return}this.dragLastDiff=0;this.touchAxis="";if(d(f.target).closest("."+this.options.cssPrefix+"no-drag",this.elements.slides).length){return}if(c.navigator.pointerEnabled&&c.navigator.maxTouchPoints){this.setTouch(f.originalEvent.pointerType==="touch")}else{if(c.navigator.msPointerEnabled&&c.navigator.msMaxTouchPoints){this.setTouch(f.originalEvent.pointerType===f.originalEvent.MSPOINTER_TYPE_TOUCH)}else{this.setTouch(f.type!=="mousedown"||new Date().getTime()-this.lastTouchTime<1000)}}var g=this.getPositionFromEvent(f);this.isDragging=true;this.isDraggingStarted=false;this.dragStartPos={x:g.x-this.elements.slides.offset().left+this.elements.crop.offset().left,y:g.y-this.elements.slides.offset().top+this.elements.crop.offset().top};this.dragLastPos=g[this.options.direction];this.rawStartPos=g;this.modify(this.elements.slides,{offset:g[this.options.direction]-this.dragStartPos[this.options.direction]});this.onDragMove(f)};e.prototype.onDragStop=function(f){if(!this.isDragging){return}this.isDragging=false;this.isDraggingStarted=false;this.elements.main.removeClass(this.options.cssPrefix+"dragging");if(this.dragLastDiff===0||this.dragLastDiff===undefined){return}var g=this.slideIndex+(Math.floor((-Math.round(this.getOffset(this.elements.slides))-this.activeSlideOffset+(this.getViewSizeFixed(true)[this.options.direction]*(1-this.visibleAreaRate)*this.options.visibleAreaAlign))/(this.slideSize+this.getGapSize()))*this.getVisibleRowsCount());if(this.dragLastDiff<=0){this.goTo(g,true)}else{this.goTo(g+this.getVisibleRowsCount(),true)}};e.prototype.onDragMove=function(j){if(!this.isDragging||(this.isTouch&&j.type==="mousemove")){return}if(j.originalEvent.touches&&j.originalEvent.touches[1]){return this.onDragStop()}var k=this.getPositionFromEvent(j);var g;if(!this.touchAxis){g=Math.abs(k.x-this.rawStartPos.x)-Math.abs(k.y-this.rawStartPos.y);if(g>(this.isTouch?4:2)){this.touchAxis="x"}else{if(g<-(this.isTouch?4:2)){this.touchAxis="y"}}}if(this.touchAxis===this.options.direction){j.preventDefault();this.stopAutoplay()}else{if(!this.touchAxis){return}else{return this.onDragStop()}}if(!this.isDraggingStarted){this.isDraggingStarted=true;this.elements.main.addClass(this.options.cssPrefix+"dragging");(function(){var l=(c.getSelection&&c.getSelection())||a.selection||{};(l.empty||l.removeAllRanges||function(){}).apply(l)})()}var f=this.dragLastPos-k[this.options.direction];var i=k[this.options.direction]-this.dragStartPos[this.options.direction];var h=this.getVisibleCount();if(!this.options.loop){if(i>-this.getSlideOffset(0)+(this.getViewSizeFixed(true)[this.options.direction]*(1-this.visibleAreaRate)*this.options.visibleAreaAlign)){i=(i*0.4)-((this.getSlideOffset(0)-(this.getViewSizeFixed(true)[this.options.direction]*(1-this.visibleAreaRate)*this.options.visibleAreaAlign))*0.6)}if(i<-this.getSlideOffset(this.slides.length-h)+(this.getViewSizeFixed(true)[this.options.direction]*(1-this.visibleAreaRate)*this.options.visibleAreaAlign)){i=(i*0.4)-((this.getSlideOffset(this.slides.length-h)-(this.getViewSizeFixed(true)[this.options.direction]*(1-this.visibleAreaRate)*this.options.visibleAreaAlign))*0.6)}}this.modify(this.elements.slides,{offset:i});if(f<0||f>0){this.dragLastDiff=f}this.dragLastPos=k[this.options.direction]};e.prototype.onClickCapturing=function(f){if(this.dragLastDiff!==0&&typeof this.dragLastDiff!=="undefined"){f.stopPropagation();f.preventDefault()}};e.prototype.getPositionFromEvent=function(f){var g={x:f.pageX,y:f.pageY};if(typeof g.x!=="number"){g={x:f.originalEvent.pageX,y:f.originalEvent.pageY}}if(f.originalEvent.touches&&f.originalEvent.touches[0]){g={x:f.originalEvent.touches[0].pageX,y:f.originalEvent.touches[0].pageY}}return g};return e})();b.SliderNav=(function(){function e(h){var g=this;this.slider=h;this.elements={};if(h.options.controls){this.elements.prev=d(a.createElement("a")).attr("href","").append(d(a.createElement("span")).addClass(h.options.cssPrefix+"prev-label").text(h.options.labels.prev)).addClass(h.options.cssPrefix+"prev").on("click",function(i){i.preventDefault();g.slider.prev()});this.elements.next=d(a.createElement("a")).attr("href","").append(d(a.createElement("span")).addClass(h.options.cssPrefix+"next-label").text(h.options.labels.next)).on("click",function(i){i.preventDefault();g.slider.next()}).addClass(h.options.cssPrefix+"next");if(this.slider.options.thumbControls){this.elements.prevThumb=d(a.createElement("div")).addClass(h.options.cssPrefix+"prev-thumb").appendTo(this.elements.prev);this.elements.nextThumb=d(a.createElement("div")).addClass(h.options.cssPrefix+"next-thumb").appendTo(this.elements.next)}h.elements.view.append(this.elements.prev).append(this.elements.next)}if(h.options.navType!=="none"){this.elements.main=d(a.createElement("div")).addClass(h.options.cssPrefix+"nav "+h.options.cssPrefix+"nav-"+h.options.navType);if(h.options.navType==="thumbs"){this.elements.thumbs=d(a.createElement("div"));d.each(this.slider.getSlides(),function(k,j){g.createThumb(k,j).appendTo(g.elements.thumbs)});this.elements.main.append(this.elements.thumbs);h.elements.main.append(this.elements.main);this.thumbsSlider=new b.Slider(this.elements.thumbs,d.extend({visibleArea:h.options.visibleArea,visibleAreaMax:h.options.visibleAreaMax,visibleAreaAlign:h.options.visibleAreaAlign,loop:h.options.loop,duration:h.options.duration,controls:h.options.controls,labels:h.options.labels},h.options.thumbs||{}));this.setActive([0])}else{this.elements.mainPrev=d(a.createElement("a")).attr("href","").text(h.options.labels.prev).on("click",function(i){i.preventDefault();g.slider.prev()}).appendTo(d(a.createElement("li")).addClass(h.options.cssPrefix+"nav-prev"));this.elements.mainNext=d(a.createElement("a")).attr("href","").text(h.options.labels.next).on("click",function(i){i.preventDefault();g.slider.next()}).appendTo(d(a.createElement("li")).addClass(h.options.cssPrefix+"nav-next"));var f=a.createElement("ul");d.each(this.slider.getSlides(),function(k,j){g.elements[k]=g.createNavItem(k,j.getData()).appendTo(f)});this.elements.mainPrev.parent().prependTo(f);this.elements.mainNext.parent().appendTo(f);this.elements.main.append(f);h.elements.main.append(this.elements.main)}}}e.prototype.setActive=function(g){var f=this;var j=this.slider.getSlides();if(this.slider.options.navType==="thumbs"){var h=this.thumbsSlider.getVisibleCount();var i=this.thumbsSlider.getVisibleRowsCount();var k=g[Math.floor((g.length-1)/2)]-Math.floor((h-1)/2);if(!this.thumbsSlider.options.loop){k=Math.min(this.thumbsSlider.slides.length-h,Math.max(0,k))}else{k=this.thumbsSlider.getSlideIndex(k);k=this.getNearestIndex(k,this.thumbsSlider.slideIndex,this.thumbsSlider.getSlides().length)}k-=((((k+Math.floor(i/2)-this.thumbsSlider.slideIndex)%i)+i)%i)-Math.floor(i/2);d.each(this.activeIndexes||[],function(n,m){f.thumbsSlider.getSlide(m).element.removeClass(f.thumbsSlider.options.cssPrefix+"active-thumb")});d.each(g,function(n,m){f.thumbsSlider.getSlide(m).element.addClass(f.thumbsSlider.options.cssPrefix+"active-thumb")});this.thumbsSlider.resize();this.thumbsSlider.goTo(k)}if(this.activeIndexes){d.each(this.activeIndexes,function(n,m){if(!f.elements[m]){return}f.elements[m].children("a").removeClass("active")})}if(this.elements[j.length]&&d.inArray(j.length-1,g)!==-1){g=[j.length]}this.activeIndexes=g;var l=false;d.each(this.activeIndexes,function(n,m){if(!f.elements[m]){return}if(f.elements[m][0].style.display!=="none"){l=true}f.elements[m].children("a").addClass("active")});if(!l&&this.elements[j.length]){d.each(this.activeIndexes,function(n,m){if(!f.elements[m]){return}f.elements[m].children("a").removeClass("active")});this.activeIndexes=[j.length];this.elements[j.length].children("a").addClass("active")}if(this.elements.prevThumb&&this.elements.nextThumb){this.elements.prevThumb.html(this.slider.getSlide(g[0]-1).getThumbHtml());this.elements.nextThumb.html(this.slider.getSlide(g[g.length-1]+1).getThumbHtml())}};e.prototype.getNearestIndex=function(h,f,g){if(Math.abs(h-f)>Math.abs(h-g-f)){h-=g}else{if(Math.abs(h-f)>Math.abs(h+g-f)){h+=g}}return h};e.prototype.combineItems=function(){if(!this.elements[0]){return}var k=this.slider.getVisibleCount();var l=this.slider.getSlides();if(this.elements[l.length]){this.elements[l.length].remove();delete this.elements[l.length]}d.each(this.elements,function(){this.css("display","")});if(k>=2&&this.slider.options.combineNavItems){var n;for(var h=0;this.elements[h];h++){if((h-Math.floor((k-1)/2))%k||(h-Math.floor((k-1)/2))>l.length-k){this.elements[h].css("display","none")}else{n=h}}if(l.length%k===0){this.elements[l.length-k+Math.floor((k-1)/2)].css("display","")}else{var g=l.length-(l.length%k||k)+Math.floor((k-1)/2);this.elements[l.length]=this.createNavItem(g,l[g>=l.length?l.length-1:g].getData()).insertAfter(this.elements[l.length-1])}}if(this.slider.options.navType==="numbers"){for(var f=0,m=0;this.elements[f];f++){if(this.elements[f][0].style.display!=="none"){m++;this.elements[f].children().text(m)}}}};e.prototype.show=function(){d([]).add(this.elements.prev).add(this.elements.next).add(this.elements.main).css("display","")};e.prototype.hide=function(){d([]).add(this.elements.prev).add(this.elements.next).add(this.elements.main).css("display","none")};e.prototype.createNavItem=function(g,h){var f=this;return d(a.createElement("li")).addClass(f.slider.options.cssPrefix+"nav-item").append(d(a.createElement("a")).attr("href","").text((f.slider.options.navType!=="numbers"&&h.name)?h.name:(h.index+1)).on("click",function(i){i.preventDefault();f.itemOnClick(g)}))};e.prototype.createThumb=function(i,f){var h=this;var g=d(a.createElement("a")).attr("href","").html(f.getThumbHtml()).on("click",function(k){k.preventDefault();h.itemOnClick(i)});var j=g.children();if(j.length===1){if(j[0].nodeName.toLowerCase()==="img"||j[0].nodeName.toLowerCase()==="picture"){g.attr("data-rsts-type","image")}if(j[0].nodeName.toLowerCase()==="video"){g.attr("data-rsts-type","video")}}if(j.length){d.each(j[0].attributes,function(l,k){if(k.name.substr(0,10)==="data-rsts-"){g.attr(k.name,k.value)}})}return g};e.prototype.itemOnClick=function(f){var g=this.slider.getVisibleCount();var h=this.slider.getVisibleRowsCount();var i=f-Math.floor((g-1)/2);if(!this.slider.options.loop){i=Math.min(this.slider.slides.length-g,Math.max(0,i))}else{i=this.getNearestIndex(this.slider.getSlideIndex(i),this.slider.slideIndex,this.slider.getSlides().length)}i-=((((i+Math.floor(h/2)-this.slider.slideIndex)%h)+h)%h)-Math.floor(h/2);this.slider.goTo(i)};e.prototype.resize=function(){if(this.thumbsSlider){this.thumbsSlider.resize()}};e.prototype.getSize=function(){if(!this.elements.main||this.elements.main.css("position")==="absolute"){return{x:0,y:0}}return{x:this.elements.main.outerWidth(true),y:this.elements.main.outerHeight(true)}};return e})();d.fn.rstSlider=function(f){var e=arguments;return this.each(function(){var h=d(this);if(typeof f==="string"){var g=h.data("rstSlider");if(g&&g[f]){return g[f].apply(g,Array.prototype.slice.call(e,1))}}else{if(!h.data("rstSlider")){h.data("rstSlider",new b.Slider(h,f))}}})}})(jQuery,window,document); /*! * jQuery UI Effects 1.10.1 * http://jqueryui.com