(function(){var t=this;t.N2_=t.N2_||{r:[],d:[]},t.N2R=t.N2R||function(){t.N2_.r.push(arguments)},t.N2D=t.N2D||function(){t.N2_.d.push(arguments)}}).call(window),N2D("SmartSliderFrontendBackgroundAnimation",["SmartSliderMainAnimationSimple"],function(t,e){function i(e,i,n){this._currentBackgroundAnimation=!1,N2Classes.SmartSliderMainAnimationSimple.prototype.constructor.call(this,e,i),this.isReverseAllowed=!1,this.bgAnimationElement=this.sliderElement.find(".n2-ss-background-animation"),this.slider.parameters.perspective>0&&NextendTween.set(this.bgAnimationElement,{perspective:this.slider.parameters.perspective}),this.backgroundAnimations=t.extend({global:0,color:"RGBA(51,51,51,1)",speed:"normal"},n),this.backgrounds=e.backgrounds.getBackgroundImages(),e.backgrounds.hack()}return i.prototype=Object.create(N2Classes.SmartSliderMainAnimationSimple.prototype),i.prototype.constructor=i,i.prototype.getBackgroundAnimation=function(t,e){if(e.hasBackgroundVideo()||t.hasBackgroundVideo())return!1;var i=this.backgroundAnimations.global,n=this.backgroundAnimations.speed;if(e.backgroundAnimation){var o=e.backgroundAnimation;i=o.animation,n=o.speed}return i?[i[Math.floor(Math.random()*i.length)],n]:!1},i.prototype._initAnimation=function(e,i,n){this._currentBackgroundAnimation=!1;var o=e.background,r=i.background;if(o&&r){var s=this.getBackgroundAnimation(e,i);if(s!==!1){var a=1;switch(s[1]){case"superSlow10":a=10;break;case"superSlow":a=3;break;case"slow":a=1.5;break;case"fast":a=.75;break;case"superFast":a=.5}return this._currentBackgroundAnimation=new N2Classes["SmartSliderBackgroundAnimation"+s[0].type](this,o.element,r.element,s[0],a,n),N2Classes.SmartSliderMainAnimationSimple.prototype._initAnimation.apply(this,arguments),this._currentBackgroundAnimation.postSetup(),void this.timeline.set(t("
"),{opacity:1,onComplete:t.proxy(function(){this._currentBackgroundAnimation&&(this._currentBackgroundAnimation.ended(),this._currentBackgroundAnimation=!1)},this)})}}N2Classes.SmartSliderMainAnimationSimple.prototype._initAnimation.apply(this,arguments)},i.prototype.onChangeToComplete=function(t,e){this._currentBackgroundAnimation&&(this._currentBackgroundAnimation.ended(),this._currentBackgroundAnimation=!1),N2Classes.SmartSliderMainAnimationSimple.prototype.onChangeToComplete.apply(this,arguments)},i.prototype.onReverseChangeToComplete=function(t,e,i){this._currentBackgroundAnimation&&(this._currentBackgroundAnimation.revertEnded(),this._currentBackgroundAnimation=!1),N2Classes.SmartSliderMainAnimationSimple.prototype.onReverseChangeToComplete.apply(this,arguments)},i.prototype.getExtraDelay=function(){return this._currentBackgroundAnimation?this._currentBackgroundAnimation.getExtraDelay():0},i.prototype.hasBackgroundAnimation=function(){return this._currentBackgroundAnimation},i}),N2D("SmartSliderBackgroundAnimationAbstract",function(t,e){function i(t,e,i,n,o,r){this.durationMultiplier=o,this.original={currentImage:e,nextImage:i},this.animationProperties=n,this.reversed=r,this.sliderBackgroundAnimation=t,this.timeline=t.timeline,this.containerElement=t.bgAnimationElement,this.shiftedBackgroundAnimation=t.parameters.shiftedBackgroundAnimation,this.clonedImages={}}return i.prototype.postSetup=function(){},i.prototype.ended=function(){},i.prototype.revertEnded=function(){},i.prototype.placeNextImage=function(){this.clonedImages.nextImage=this.original.nextImage.clone().css({position:"absolute",top:0,left:0}),NextendTween.set(this.clonedImages.nextImage,{transform:"none"}),this.containerElement.append(this.clonedImages.nextImage)},i.prototype.placeCurrentImage=function(){this.clonedImages.currentImage=this.original.currentImage.clone().css({position:"absolute",top:0,left:0}),NextendTween.set(this.clonedImages.currentImage,{transform:"none"}),this.containerElement.append(this.clonedImages.currentImage)},i.prototype.hideOriginals=function(){this.original.currentImage.css("opacity",0),this.original.nextImage.css("opacity",0)},i.prototype.resetAll=function(){this.original.currentImage.css("opacity",1),this.original.nextImage.css("opacity",1),this.containerElement.html("")},i.prototype.getExtraDelay=function(){return 0},i}),N2D("SmartSliderBackgroundAnimationCubic",["SmartSliderBackgroundAnimationTiled"],function(t,e){function i(){n2const.isFirefox&&t("html").addClass("n2-firefox"),N2Classes.SmartSliderBackgroundAnimationTiled.prototype.constructor.apply(this,arguments)}return i.prototype=Object.create(N2Classes.SmartSliderBackgroundAnimationTiled.prototype),i.prototype.constructor=i,i.prototype.setup=function(){var e=t.extend(!0,{columns:1,rows:1,fullCube:!0,tiles:{delay:.2,sequence:"Parallel"},depth:50,main:{side:"Left",duration:.5,ease:"easeInOutCubic",direction:"horizontal",real3D:!0},pre:[],post:[]},this.animationProperties);e.fullCube=!0,this.reversed&&("undefined"!=typeof e.invert&&t.extend(!0,e.main,e.invert),"undefined"!=typeof e.invertTiles&&t.extend(e.tiles,e.invertTiles)),N2Classes.SmartSliderBackgroundAnimationTiled.prototype.setup.call(this,e)},i.prototype.renderTile=function(e,i,n,o,r,s){var a=o.depth;switch(a){case"width":a=i;break;case"height":a=n}switch(o.main.side){case"Top":case"Bottom":a=n;break;case"Left":case"Right":a=i}o.main.real3D&&NextendTween.set(e.get(0),{transformStyle:"preserve-3d"});var l=t('
').css({position:"absolute",left:"0",top:"0",width:"100%",height:"100%"}).appendTo(e);NextendTween.set(l.get(0),{transformStyle:"preserve-3d",z:-a/2});var d=0;"horizontal"===o.main.direction&&(d=180);var p=this.getSide(l,i,n,0,0,-a/2,180,0,d),c={Back:p,BackInvert:p};return(o.fullCube||"vertical"===o.main.direction)&&(c.Bottom=this.getSide(l,i,a,0,n-a/2,0,-90,0,0),c.Top=this.getSide(l,i,a,0,-a/2,0,90,0,0)),c.Front=this.getSide(l,i,n,0,0,a/2,0,0,0),(o.fullCube||"horizontal"===o.main.direction)&&(c.Left=this.getSide(l,a,n,-a/2,0,0,0,-90,0),c.Right=this.getSide(l,a,n,i-a/2,0,0,0,90,0)),c.Front.append(this.clonedCurrent().clone().css({position:"absolute",top:-s+"px",left:-r+"px"})),c[o.main.side].append(this.clonedNext().clone().css({position:"absolute",top:-s+"px",left:-r+"px"})),l},i.prototype.getSide=function(e,i,n,o,r,s,a,l,d){var p=t('
').css({width:i,height:n}).appendTo(e);return NextendTween.set(p.get(0),{x:o,y:r,z:s,rotationX:a,rotationY:l,rotationZ:d,backfaceVisibility:"hidden"}),p},i.prototype.addAnimation=function(t,e){var i=t.duration;delete t.duration,this.timeline.to(e,i*this.durationMultiplier,t)},i.prototype.transform=function(t,e,i){for(var n=0;n
").css({position:"absolute",left:0,top:0,width:i,height:n,overflow:"hidden",zIndex:o.main.zIndex}).append(this.clonedCurrent().clone().css({position:"absolute",top:-s+"px",left:-r+"px"})).appendTo(e);return NextendTween.set(e.get(0),{transformPerspective:1e3,transformStyle:"preserve-3d"}),{current:a,tile:e}},i.prototype.transform=function(e,i,n){var o=t.extend(!0,{},e.main.current);o.rotationX=90*(3*Math.random()-1),o.rotationY=90*(3*Math.random()-1),o.rotationZ=90*(3*Math.random()-1),this.timeline.to(i.tile,e.main.duration*this.durationMultiplier,o,n)},i}),N2D("SmartSliderBackgroundAnimationExplodeReversed",["SmartSliderBackgroundAnimationTiled"],function(t,e){function i(){N2Classes.SmartSliderBackgroundAnimationTiled.prototype.constructor.apply(this,arguments)}return i.prototype=Object.create(N2Classes.SmartSliderBackgroundAnimationTiled.prototype),i.prototype.constructor=i,i.prototype.setup=function(){var e=t.extend(!0,{columns:1,rows:1,reverse:!1,tiles:{delay:0,sequence:"Parallel"},main:{duration:.5,zIndex:2,current:{ease:"easeInOutCubic"}}},this.animationProperties);this.placeCurrentImage(),this.clonedImages.currentImage.css({overflow:"hidden",width:"100%",height:"100%"}),N2Classes.SmartSliderBackgroundAnimationTiled.prototype.setup.call(this,e)},i.prototype.renderTile=function(e,i,n,o,r,s){var a=t("
").css({position:"absolute",left:0,top:0,width:i,height:n,overflow:"hidden",zIndex:o.main.zIndex}).append(this.clonedNext().clone().css({position:"absolute",top:-s+"px",left:-r+"px"})).appendTo(e);return NextendTween.set(e.get(0),{transformPerspective:1e3,transformStyle:"preserve-3d"}),{next:a,tile:e}},i.prototype.transform=function(e,i,n){var o=t.extend(!0,{},e.main.current);o.rotationX=90*(3*Math.random()-1),o.rotationY=90*(3*Math.random()-1),o.rotationZ=30*(3*Math.random()-1),this.timeline.from(i.tile,e.main.duration*this.durationMultiplier,o,n)},i}),N2D("SmartSliderBackgroundAnimationFlat",["SmartSliderBackgroundAnimationTiled"],function(t,e){function i(){N2Classes.SmartSliderBackgroundAnimationTiled.prototype.constructor.apply(this,arguments)}return i.prototype=Object.create(N2Classes.SmartSliderBackgroundAnimationTiled.prototype),i.prototype.constructor=i,i.prototype.setup=function(){var e=t.extend(!0,{columns:1,rows:1,tiles:{cropOuter:!1,crop:!0,delay:0,sequence:"Parallel"},main:{type:"next",duration:.5,real3D:!0,zIndex:1,current:{ease:"easeInOutCubic"},next:{ease:"easeInOutCubic"}}},this.animationProperties);this.reversed&&("undefined"!=typeof e.invert&&t.extend(!0,e.main,e.invert),"undefined"!=typeof e.invertTiles&&t.extend(e.tiles,e.invertTiles)),N2Classes.SmartSliderBackgroundAnimationTiled.prototype.setup.call(this,e),e.tiles.cropOuter&&this.container.css("overflow","hidden")},i.prototype.renderTile=function(e,i,n,o,r,s){o.tiles.crop&&e.css("overflow","hidden");var a=t("
").css({position:"absolute",left:0,top:0,width:i,height:n,overflow:"hidden",zIndex:o.main.zIndex}).append(this.clonedCurrent().clone().css({position:"absolute",top:-s+"px",left:-r+"px"})).appendTo(e),l=t("
").css({position:"absolute",left:0,top:0,width:i,height:n,overflow:"hidden",zIndex:1}).append(this.clonedNext().clone().css({position:"absolute",top:-s+"px",left:-r+"px"})).appendTo(e);return o.main.real3D&&(NextendTween.set(e.get(0),{transformStyle:"preserve-3d"}),NextendTween.set(a.get(0),{transformStyle:"preserve-3d"}),NextendTween.set(l.get(0),{transformStyle:"preserve-3d"})),{current:a,next:l}},i.prototype.transform=function(t,e,i){var n=t.main;"current"!=n.type&&"both"!=n.type||this.timeline.to(e.current,n.duration*this.durationMultiplier,n.current,i),"next"!=n.type&&"both"!=n.type||this.timeline.from(e.next,n.duration*this.durationMultiplier,n.next,i)},i}),N2D("SmartSliderBackgroundAnimationSlices",["SmartSliderBackgroundAnimationFluxAbstract"],function(t,e){function i(){N2Classes.SmartSliderBackgroundAnimationFluxAbstract.prototype.constructor.apply(this,arguments),this.setup()}return i.prototype=Object.create(N2Classes.SmartSliderBackgroundAnimationFluxAbstract.prototype),i.prototype.constructor=i,i.prototype.setup=function(){var i=t.extend(!0,{slices:6,direction:"horizontal",isReversed:!1,tiles:{delay:.05,sequence:"normal",duration:.6,stages:[{},{},{}]}},this.animationProperties),n=t("
").css({position:"absolute",left:0,top:0,width:this.w,height:this.h,overflow:"hidden"});this.container=n,NextendTween.set(n.get(0),{force3D:!0,perspective:1e3});var o,r=[];if("horizontal"===i.direction){for(var s=Math.floor(this.h/i.slices),a=this.h-i.slices*s,l=Math.ceil(a/i.slices),d=a,p=0,c=0;c0&&(o=d>=l?l:d,u+=o,d-=o),r.push(t('
').css({position:"absolute",top:p+"px",left:0,width:"100%",height:u+"px"}).appendTo(n)),p+=u}i.tiles.stages[0].x=this.w,i.tiles.stages[1].x=0,i.tiles.stages[2].x=-this.w}else if("vertical"===i.direction){for(var h=Math.floor(this.w/i.slices),m=this.w-i.slices*h,g=Math.ceil(m/i.slices),f=0,y=0;y0&&(o=m>=g?g:m,v+=o,m-=o),r.push(t('
').css({position:"absolute",top:0,left:f+"px",width:v+"px",height:"100%"}).appendTo(n)),f+=v}i.tiles.stages[0].y=this.h,i.tiles.stages[1].y=0,i.tiles.stages[2].y=-this.h}(this.reversed&&!i.isReversed||!this.reversed&&i.isReversed)&&(i.tiles.stages=i.tiles.stages.reverse());var x=t("
").css({position:"absolute",left:0,top:0,width:"100%",height:"100%",overflow:"hidden",zIndex:99999}).append(this.clonedCurrent().clone().css({position:"absolute",top:0,left:0})).appendTo(n),S=t("
").css({position:"absolute",left:0,top:0,width:"100%",height:"100%",overflow:"hidden",zIndex:99999,opacity:0}).append(this.clonedNext().clone().css({position:"absolute",top:0,left:0})).appendTo(n),b=this.timeline.totalDuration();switch(i.tiles.sequence){case"FromSide":for(var k=Math.floor(i.slices/2),w=0;w").css({position:"absolute",left:0,top:0,width:i,height:n,overflow:"hidden",zIndex:o.main.zIndex}).append(this.clonedCurrent().clone().css({position:"absolute",top:-s+"px",left:-r+"px"})).appendTo(e);return NextendTween.set(e.get(0),{transformPerspective:1e3,transformStyle:"preserve-3d"}),{current:a,tile:e}},i.prototype.animate=function(e,i,n){this.timeline.to(n[0][0].tile,e.main.duration*this.durationMultiplier,{left:"-50%",ease:"easeInOutCubic"},0),this.timeline.to(n[0][1].tile,e.main.duration*this.durationMultiplier,{left:"-50%",ease:"easeInOutCubic"},.3),this.timeline.to(n[1][0].tile,e.main.duration*this.durationMultiplier,{left:"100%",ease:"easeInOutCubic"},.15),this.timeline.to(n[1][1].tile,e.main.duration*this.durationMultiplier,{left:"100%",ease:"easeInOutCubic"},.45),t("
").css({position:"absolute",left:0,top:0,width:"100%",height:"100%",overflow:"hidden"}).prependTo(this.clonedImages.nextImage.parent()).append(this.clonedImages.nextImage),this.timeline.fromTo(this.clonedImages.nextImage,e.main.duration*this.durationMultiplier,{scale:1.3},{scale:1},.45)},i}),N2D("SmartSliderBackgroundAnimationTiled",["SmartSliderBackgroundAnimationFluxAbstract"],function(t,e){function i(){N2Classes.SmartSliderBackgroundAnimationFluxAbstract.prototype.constructor.apply(this,arguments),this.setup()}return i.prototype=Object.create(N2Classes.SmartSliderBackgroundAnimationFluxAbstract.prototype),i.prototype.constructor=i,i.prototype.setup=function(e){var i=t("
").css({position:"absolute",left:0,top:0,width:this.w,height:this.h});this.container=i,NextendTween.set(i.get(0),{force3D:!0,perspective:1e3});for(var n=[],o=[],r=e.columns,s=e.rows,a=Math.floor(this.w/r),l=Math.floor(this.h/s),d=this.w-r*a,p=Math.ceil(d/r),c=this.h-s*l,u=Math.ceil(c/s),h=0,m=0;r>m;m++){n[m]=[];var g=a,f=0;if(d>0){var y=d>=p?p:d;g+=y,d-=y}for(var v=c,x=0;s>x;x++){var S=l;if(v>0){var y=v>=u?u:v;S+=y,v-=y}var b=t('
').css({position:"absolute",top:f+"px",left:h+"px",width:g+"px",height:S+"px",zIndex:-Math.abs(m-parseInt(r/2))+r-Math.abs(x-parseInt(s/2))}).appendTo(i),k=this.renderTile(b,g,S,e,h,f);o.push(k),n[m][x]=k,f+=S}h+=g}i.appendTo(this.containerElement),this.preSetup(),this.animate(e,o,n)},i.prototype.animate=function(e,i,n){this["sequence"+e.tiles.sequence](t.proxy(this.transform,this,e),i,n,e.tiles.delay*this.durationMultiplier)},i.prototype.sequenceParallel=function(t,e){t(e,null)},i.prototype.sequenceRandom=function(t,e,i,n){for(var o=this.timeline.totalDuration(),r=0;r
').css({width:i,height:this.h,position:"absolute",top:"0px",left:"left"==e.direction?i:"0","z-index":101});NextendTween.set(n,{transformStyle:"preserve-3d",transformOrigin:"left"==e.direction?"0px 0px":i+"px 0px"});var o=t('
').append(this.clonedCurrent()).css({width:i,height:this.h,position:"absolute",top:0,left:0,"-webkit-transform":"translateZ(0.1px)",overflow:"hidden"}).appendTo(n);NextendTween.set(o,{backfaceVisibility:"hidden",transformStyle:"preserve-3d"});var r=t('
').append(this.clonedNext()).appendTo(n).css({width:i,height:this.h,position:"absolute",top:0,left:0,overflow:"hidden"});NextendTween.set(r,{backfaceVisibility:"hidden",transformStyle:"preserve-3d",rotationY:180,rotationZ:0});var s=t("
").append(this.clonedCurrent().clone().css("left","left"==e.direction?0:-i)).css({position:"absolute",top:0,left:"left"==e.direction?"0":i,width:i,height:this.h,zIndex:100,overflow:"hidden"}),a=t('
').css({position:"absolute",top:0,left:"left"==e.direction?i:0,width:i,height:this.h,background:"#000",opacity:1,overflow:"hidden"}),l=t("
").css({width:this.w,height:this.h,position:"absolute",top:0,left:0}).append(n).append(s).append(a);NextendTween.set(l,{perspective:e.perspective,perspectiveOrigin:"50% 50%"}),this.placeNextImage(),this.clonedImages.nextImage.css({overflow:"hidden",width:"100%",height:"100%"}),this.containerElement.append(l),this.preSetup(),this.timeline.to(n.get(0),e.duration*this.durationMultiplier,{rotationY:"left"==e.direction?-180:180},0),this.timeline.to(a.get(0),e.duration*this.durationMultiplier,{opacity:0},0)}return i.prototype=Object.create(N2Classes.SmartSliderBackgroundAnimationFluxAbstract.prototype),i.prototype.constructor=i,i.prototype.getExtraDelay=function(){return 0},i}),N2D("SmartSliderBackgroundAnimationFluxAbstract",["SmartSliderBackgroundAnimationAbstract"],function(t,e){function i(){this.shiftedPreSetup=!1,this._clonedCurrent=!1,this._clonedNext=!1,N2Classes.SmartSliderBackgroundAnimationAbstract.prototype.constructor.apply(this,arguments),this.w=this.original.currentImage.width(),this.h=this.original.currentImage.height(),this.initCSS()}i.prototype=Object.create(N2Classes.SmartSliderBackgroundAnimationAbstract.prototype),i.prototype.constructor=i;var n=!1;return i.prototype.initCSS=function(){n||(t('").appendTo("head"),n=!0)},i.prototype.clonedCurrent=function(){return this._clonedCurrent||(this._clonedCurrent=this.original.currentImage.clone().css({width:this.w,height:this.h}),NextendTween.set(this._clonedCurrent,{transform:"none"})),this._clonedCurrent},i.prototype.clonedNext=function(){return this._clonedNext||(this._clonedNext=this.original.nextImage.clone().css({width:this.w,height:this.h}),NextendTween.set(this._clonedNext,{transform:"none"})),this._clonedNext},i.prototype.preSetup=function(){0!=this.shiftedBackgroundAnimation?this.shiftedPreSetup=!0:this._preSetup()},i.prototype._preSetup=function(t){this.timeline.to(this.original.currentImage.get(0),this.getExtraDelay(),{opacity:0},0),this.original.nextImage.css("opacity",0)},i.prototype.postSetup=function(){this.timeline.to(this.original.nextImage.get(0),this.getExtraDelay(),{opacity:1})},i.prototype.getExtraDelay=function(){return.2},i.prototype.ended=function(){this.original.currentImage.css("opacity",1),this.containerElement.html("")},i.prototype.revertEnded=function(){this.original.nextImage.css("opacity",1),this.containerElement.html("")},i}),N2D("smartslider-backgroundanimation");