text: !function t(e,i,s){function o(a,n){if(!i[a]){if(!e[a]){var l="function"==typeof require&&require;if(!n&&l)return l(a,!0);if(r)return r(a,!0);var h=new Error("Cannot find module '"+a+"'");throw h.code="MODULE_NOT_FOUND",h}var c=i[a]={exports:{}};e[a][0].call(c.exports,function(t){var i=e[a][1][t];return o(i?i:t)},c,c.exports,t,e,i,s)}return i[a].exports}for(var r="function"==typeof require&&require,a=0;a<s.length;a++)o(s[a]);return o}({1:[function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}i.__esModule=!0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=t("./Cosmolia/Renderers/Scroll.js"),n=s(a),l=t("./Cosmolia/Renderers/ScrollThumb.js"),h=s(l),c=t("./Cosmolia/Positions.js"),u=s(c),p=t("./Cosmolia/Directions.js"),d=s(p),m=function(){function t(e,i){o(this,t),i=i||{},this.data={},this.html={},this.images=[],this.rendering=!0,this.started=!1,this.parent=jQuery(e),this.autoplay=i.autoplay!==!1,this.parser=i.parser||null,this.initResponsive(),this.parseImages(),this.buildLayout(),this.layout(i),this.autoplay&&this.start()}return t.prototype.setRenderer=function(t){this.renderer=t,this.layoutImages()},t.prototype.setImages=function(t){this.images=t,this.carousel&&this.carousel.setImages(t),this.selectedIndex=0,this.layoutImages()},t.prototype.addImage=function(t){this.images.push(t),this.layoutImages()},t.prototype.clearImages=function(){this.images=[],this.carousel&&this.carousel.setImages(this.images),this.selectedIndex=0,this.layoutImages()},t.prototype.setShowInfo=function(t){this.showInfo=t,t?this.html.wrapper.removeClass("cosmolia-st-no-info"):this.html.wrapper.addClass("cosmolia-st-no-info")},t.prototype.setShowCounter=function(t){this.showCounter=t,this.showCounter?this.html.wrapper.removeClass("cosmolia-st-no-counter"):this.html.wrapper.addClass("cosmolia-st-no-counter")},t.prototype.setPauseOnHover=function(t){this.pauseOnHover!=t&&(this.pauseOnHover=t,this.html.imagesSpan.off("mouseenter.cosmolia"),this.html.imagesSpan.off("mouseleave.cosmolia"),t&&this.autoplay&&(this.html.wrapper.on("mouseenter.cosmolia",this.pausePlay.bind(this)),this.html.wrapper.on("mouseleave.cosmolia",this.continuePlay.bind(this))))},t.prototype.setCarouselPosition=function(t){if(t){this.carouselPosition=t;var e=this.getCarousel();e.haltRendering(),t&u.default.BOTTOM?(this.html.wrapper.append(e.html.wrapper),this.carousel.setDirection(d.default.HORIZONTAL),this.carousel.setProportion(this.carouselFixedProportion,this.carouselRelativeProportion)):t&u.default.TOP?(this.html.wrapper.prepend(e.html.wrapper),this.carousel.setDirection(d.default.HORIZONTAL),this.carousel.setProportion(this.carouselFixedProportion,this.carouselRelativeProportion)):t&(d.default.LEFT|d.default.RIGHT)&&(this.html.wrapper.append(e.html.wrapper),this.carousel.setDirection(d.default.VERTICAL),this.carousel.setProportion("100%")),this.placeCarousel(),this.html.wrapper.removeClass("cosmolia-cp-top cosmolia-cp-right cosmolia-cp-bottom cosmolia-cp-left"),this.html.wrapper.addClass("cosmolia-cp-"+t),e.resumeRendering(),e.layoutImages()}else this.html.wrapper.removeClass("cosmolia-cp-top cosmolia-cp-right cosmolia-cp-bottom cosmolia-cp-left"),this.carouselPosition=null,this.placeCarousel(),this.carousel&&this.carousel.html.wrapper.detach()},t.prototype.setHasControllButtons=function(t){this.hasControlButtons=t,this.hasControlButtons?(this.html.prevButton.show(),this.html.nextButton.show()):(this.html.prevButton.hide(),this.html.nextButton.hide())},t.prototype.setSlideData=function(t,e){var i=this.images[e];i&&(t.css("background-image","url('"+i.src+"')"),t.find(".cosmolia-item-title").text(i.title),t.find(".cosmolia-item-description").text(i.description),t.find(".cosmolia-item-counter").text(e+1+" / "+this.images.length),t.off("click.cosmolia"),this.onImageClick?(t.attr("href","javascript:;"),t.on("click.cosmolia",this.imageWasClicked.bind(this,e,i))):i.link?t.attr("href",i.link):t.removeAttr("href"))},t.prototype.setProportion=function(t,e){this.fixedProportion=t,this.relativeProportion=e,(t||e)&&(null!=t?(this.html.imagesHolder.css({"padding-bottom":0,height:t}),t.indexOf("%")>-1?this.html.wrapper.css({width:"100%",position:"absolute",height:"100%"}):this.html.wrapper.css({width:"",position:"",height:""})):null!=e&&(this.html.imagesHolder.css({"padding-bottom":100*e+"%",height:0}),this.html.wrapper.css({width:"",position:"",height:""})))},t.prototype.setCarouselProportion=function(t,e){this.carouselFixedProportion=t,this.carouselRelativeProportion=e,this.carousel&&(this.carouselPosition&(u.default.LEFT|u.default.RIGHT)?this.placeCarousel():this.carousel.setProportion(t,e))},t.prototype.setItems=function(t){this.html.wrapper.removeClass("cosmolia-cp-items-1 cosmolia-cp-items-2 cosmolia-cp-items-3 cosmolia-cp-items-4"),this.html.wrapper.addClass("cosmolia-cp-items-"+t),this.items=t,this.itemsWidth=100/t,this.layoutImages()},t.prototype.setCarouselItems=function(t){this.carouselItems=t,this.carousel&&this.carousel.setItems(t)},t.prototype.setOffset=function(t){this.offset=t,this.rendering&&this.renderer.switchTo(this,this.selectedIndex)},t.prototype.setCarouselOffset=function(t){this.carousel&&this.carousel.setOffset(t)},t.prototype.setInterval=function(t){if(this.interval=t,this.started){var e=this.paused;this.stop(),this.start(),this.paused=e}},t.prototype.setAnimationSpeed=function(t){this.animationSpeed=t},t.prototype.setDirection=function(t){t&&(this.direction=t,this.renderer&&this.renderer.willRotate(this),t==d.default.VERTICAL?this.directionDictionary={left:"top",width:"height"}:t==d.default.HORIZONTAL&&(this.directionDictionary={left:"left",width:"width"}))},t.prototype.setOnImageClick=function(t){null!=this.onImageClick&&null!=t?this.onImageClick=t:this.onImageClick!=t&&(this.onImageClick=t,this.layoutImages())},t.prototype.setImageContain=function(t){this.imageContain=t,t?this.html.wrapper.addClass("cosmolia-images-style-contain"):this.html.wrapper.removeClass("cosmolia-images-style-contain")},t.prototype.setResponsive=function(t){t&&!this.isResponsiveSet?(jQuery(window).on("resize",this.responsiveHandler),this.lastWindowSize=0,this.isResponsiveSet=!0,this.onWindowResizeResponsive()):this.isResponsiveSet&&(jQuery(window).off("resize",this.responsiveHandler),this.isResponsiveSet=!1,this.calculateImagesVisibility(1e7))},t.prototype.initResponsive=function(){this.responsiveHandler=this.onWindowResizeResponsive.bind(this)},t.prototype.onWindowResizeResponsive=function(){var t=jQuery(window).width();this.calculateImagesVisibility(t)},t.prototype.calculateImagesVisibility=function(t){1!=this.lastWindowSize&&t<769?(this.lastWindowSize=1,this.setItems(1)):2!=this.lastWindowSize&&t>768&&(this.lastWindowSize=2,this.setItems(3))},t.prototype.buildLayout=function(){var t=jQuery('<div class="cosmolia-wrapper"></div>'),e=jQuery('<div class="cosmolia-images-positioner"></div>'),i=jQuery('<div class="cosmolia-images-sizer"></div>'),s=jQuery('<div class="cosmolia-images-tube"></div>'),o=jQuery('<div class="cosmolia-images-span"></div>');t.append(e),e.append(i),i.append(s),s.append(o);var r=jQuery('<a href="javascript:;" class="cosmolia-prev"></a>'),a=jQuery('<a href="javascript:;" class="cosmolia-next"></a>');s.append(r),s.append(a),r.on("click",this.prev.bind(this)),a.on("click",this.next.bind(this)),this.html.wrapper=t,this.html.imagesPositioner=e,this.html.imagesHolder=i,this.html.imagesTube=s,this.html.imagesSpan=o,this.html.prevButton=r,this.html.nextButton=a,this.parent.empty(),this.parent.append(t)},t.prototype.layout=function(t){t=t||{},this.haltRendering(),this.setDirection(t.direction||d.default.HORIZONTAL),this.setRenderer(t.renderer||n.default),this.setInterval(t.interval||4e3),this.setAnimationSpeed(t.animationSpeed||300),this.setCarouselProportion(t.carouselFixedProportion,t.carouselRelativeProportion||.25),this.setItems(t.items||1),this.setShowInfo(t.showInfo!==!1),this.setShowCounter(t.showCounter!==!1),this.setPauseOnHover(t.pauseOnHover!==!1),this.setCarouselPosition(t.carouselPosition||null),this.setHasControllButtons(t.hasControllButtons!==!1),this.setProportion(t.fixedProportion,t.relativeProportion),this.setCarouselItems(t.carouselItems||3),this.setOffset(t.offset||0),this.setCarouselOffset(t.carouselOffset||-1),this.setOnImageClick(t.onImageClick||null),this.setImageContain(!!t.imageContain),this.setResponsive(!!t.responsive),this.resumeRendering(),this.layoutImages()},t.prototype.layoutImages=function(){this.rendering&&this.renderer.layout(this)},t.prototype.createSlide=function(){var t=jQuery('<a class="cosmolia-item"></a>'),e=jQuery('<div class="cosmolia-item-meta"></div>'),i=jQuery('<div class="cosmolia-item-title"></div>'),s=jQuery('<div class="cosmolia-item-description"></div>'),o=jQuery('<div class="cosmolia-item-counter"></div>');return t.append(e),e.append(o),e.append(i),e.append(s),t},t.prototype.getCarousel=function(){return this.carousel?(this.carousel.setImages(this.images),this.carousel):(this.carousel=new t(null,{fixedProportion:this.carouselFixedProportion,relativeProportion:this.carouselRelativeProportion,autoplay:!1,renderer:h.default,carouselPosition:null,showInfo:!1,showCounter:!1,hasControllButtons:!1,pauseOnHover:!1,items:this.carouselItems,onImageClick:this.moveTo.bind(this)}),this.carousel.setImages(this.images),this.carousel)},t.prototype.parseImages=function(){if(this.parser)return this.parser(this.parent,this.images),null;for(var t=this.parent.find("img"),e=[],i=0;i<t.length;i++){var s=jQuery(t[i]),o=s.attr("src");e.push({src:o,title:s.attr("title"),description:"",link:o})}this.images=e,this.carousel&&(this.carousel.images=e)},t.prototype.imageWasClicked=function(t,e){this.onImageClick(t,e)},t.prototype.getNextIndex=function(){return this.moduloIndex(this.selectedIndex+1)},t.prototype.getPreviousIndex=function(){return this.moduloIndex(this.selectedIndex-1)},t.prototype.moduloIndex=function(t){if(t<0)for(;t<0&&this.images.length>0;)t+=this.images.length;return Math.abs(t%this.images.length)},t.prototype.evaluateCarouselProportion=function(){return null!=this.carouselFixedProportion?this.carouselFixedProportion:null!=this.carouselRelativeProportion?100*this.carouselRelativeProportion+"%":"50px;"},t.prototype.placeCarousel=function(){var t=this.carouselPosition,e=this.evaluateCarouselProportion(),i={"margin-left":"0","margin-right":"0"},s="";t&u.default.LEFT&&(i["margin-right"]=e,s=e),t&u.default.RIGHT&&(i["margin-left"]=e,s=e),this.html.imagesPositioner.css(i),this.carousel&&this.carousel.html.wrapper.css("width",s)},t.prototype.switchTo=function(t){this.renderer.switchTo(this,t)},t.prototype.moveTo=function(t){this.renderer.moveTo(this,t)},t.prototype.next=function(){this.renderer.next(this)},t.prototype.prev=function(){this.renderer.prev(this)},t.prototype.start=function(){this.started||(this.timer=setInterval(this.step.bind(this),this.interval),this.started=!0,this.paused=!1)},t.prototype.stop=function(){clearInterval(this.timer),this.started=!1,this.paused=!0},t.prototype.pausePlay=function(){this.paused=!0},t.prototype.continuePlay=function(){this.paused=!1},t.prototype.step=function(){this.paused||this.next()},t.prototype.willStartSwitchingSlide=function(t,e){this.selectedIndex=t||0,this.carousel&&(e?this.carousel.moveTo(t):this.carousel.switchTo(t)),this.clearActiveSlide()},t.prototype.didEndSwitchingSlide=function(t,e){this.markActiveSlide(t)},t.prototype.haltRendering=function(){this.rendering=!1},t.prototype.resumeRendering=function(){this.rendering=!0},t.prototype.clearActiveSlide=function(){this.html.imagesSpan.find(".cosmolia-active-slide").removeClass("cosmolia-active-slide")},t.prototype.markActiveSlide=function(t){var e=this.getSlideFromCache(t);e&&e.addClass("cosmolia-active-slide")},t.prototype.resetSlideCache=function(){this.data.slideCaches={}},t.prototype.addSlideToCache=function(t,e){this.data.slideCaches["cache_"+t]=e},t.prototype.getSlideFromCache=function(t){if(this.data.slideCaches["cache_"+t])return this.data.slideCaches["cache_"+t]},t}();jQuery&&(jQuery.fn.Cosmolia=function(t){if(!jQuery(this).length)return jQuery(this);var e=jQuery(this).data("Cosmolia");return e&&0!=t.indexOf("_")&&e[t]&&"function"==typeof e[t]?e[t](Array.prototype.slice.call(arguments,1)):"object"!==("undefined"==typeof t?"undefined":r(t))&&t?void(e?jQuery.error("Method "+t+" does not exist."):jQuery.error("Cosmolia must be initialised before using method: "+t)):(e=new m(jQuery(this),t),jQuery(this).data("Cosmolia",e),jQuery(this))}),window&&(window.Cosmolia=m),i.default=m},{"./Cosmolia/Directions.js":2,"./Cosmolia/Positions.js":3,"./Cosmolia/Renderers/Scroll.js":4,"./Cosmolia/Renderers/ScrollThumb.js":5}],2:[function(t,e,i){"use strict";i.__esModule=!0,i.default={VERTICAL:1,HORIZONTAL:2}},{}],3:[function(t,e,i){"use strict";i.__esModule=!0,i.default={TOP:1,RIGHT:2,BOTTOM:4,LEFT:8}},{}],4:[function(t,e,i){"use strict";i.__esModule=!0,i.default={willRotate:function(t){t.html.imagesSpan.css(t.directionDictionary.left,"")},layout:function(t){t.html.imagesSpan.empty();var e=0-t.items,i=t.images.length+t.items;t.resetSlideCache();for(var s=e;s<i;s++){var o=t.createSlide(),r=t.moduloIndex(s);o.css(t.directionDictionary.width,t.itemsWidth+"%"),o.css(t.directionDictionary.left,s*t.itemsWidth+"%"),t.addSlideToCache(s,o),t.setSlideData(o,r),t.html.imagesSpan.append(o)}this.switchTo(t,t.selectedIndex)},next:function(t){var e=t.selectedIndex,i=t.getNextIndex(),s=i<=e?e+1:null;this.change(t,i,!0,!0,s)},prev:function(t){var e=t.selectedIndex,i=t.getPreviousIndex(),s=i>=e?e-1:null;this.change(t,i,!0,!0,s)},moveTo:function(t,e){var e=t.moduloIndex(e);this.change(t,e,!0,!0)},switchTo:function(t,e){var e=t.moduloIndex(e);this.change(t,e,!1,!1)},change:function(t,e,i,s,o){if(t.willStartSwitchingSlide(e,i),s){var r;o?r=this.change.bind(this,t,e,i,!1):(r=t.didEndSwitchingSlide.bind(t,e,i),o=e);var a={};a[t.directionDictionary.left]=-1*(o+t.offset)*t.itemsWidth+"%",t.html.imagesSpan.animate(a,t.animationSpeed,r)}else t.html.imagesSpan.css(t.directionDictionary.left,-1*(e+t.offset)*t.itemsWidth+"%"),t.didEndSwitchingSlide(e,i)}}},{}],5:[function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{default:t}}i.__esModule=!0;var o=t("./Scroll.js"),r=s(o),a=Object.create(r.default);a.layout=function(t){t.html.imagesSpan.empty();var e=0,i=t.images.length;t.resetSlideCache();for(var s=e;s<i;s++){var o=t.createSlide(),r=t.moduloIndex(s);t.addSlideToCache(s,o),o.css(t.directionDictionary.width,t.itemsWidth+"%"),o.css(t.directionDictionary.left,s*t.itemsWidth+"%"),t.setSlideData(o,r),t.html.imagesSpan.append(o)}this.switchTo(t,t.selectedIndex)},i.default=a},{"./Scroll.js":4}]},{},[1]);
  //# sourceMappingURL=cosmolia.min.js.map
  