define("galleriesCommon/utils/matrixCalculations",[],function(){"use strict";var a={getItemPosition:function(a,b,c,d,e){var f=d;var g=e;var h=a%g;var i=Math.floor((a-h)/g);return{left:h*(b+f),top:i*(c+f)}},getAvailableRowsNumber:function(a,b,c){var d=Math.ceil(c/b);return Math.min(a,d)},getItemHeight:function(a,b,c,d){var e=a;var f=b-d;return Math.max(Math.floor((f-(c-1)*e)/c),0)},getItemWidth:function(a,b,c,d){var e=a;var f=b;var g=c-d;return Math.max(Math.floor((g-(f-1)*e)/f),0)},getImageStyle:function(a,b,c,d){var e=d>b;var f=c>a;var g=e?"100%":"auto";var h=f?"100%":"auto";var i=f?0:(b-d*(a/c))/2;var j=e?0:(a-c*(b/d))/2;return{width:h,height:g,"margin-top":j,"margin-left":i}}};return a});define("galleriesCommon/utils/galleriesHelperFunctions",["skins","lodash","galleriesCommon/utils/matrixCalculations"],function(a,b,c){"use strict";var d=a.skins;function e(a){var b=d[a].exports;return b&&b.heightDiff||0}function f(a){var b=d[a].exports;return b&&b.widthDiff||0}function g(a,b,d,e,f){var g=d;var h=this.getSkinHeightDiff(e);var i=c.getItemHeight(d,f,a,h);return Math.floor(b*i+(b-1)*g)+h}function h(a,c,d){var e=0;var f=parseInt(c.imgHeightDiff&&c.imgHeightDiff.value,10)||0;var g=parseInt(c.topPadding&&c.topPadding.value,10)||0;if(f||g){e=f+g}else if(a&&a.exports){if(d==="mobileView"){e=b.isNumber(a.exports.m_heightDiff)?a.exports.m_heightDiff:a.exports.heightDiff||0}else{e=a.exports.heightDiff||0}}return e}function i(a,c){var d=0;if(a&&a.exports){if(c==="mobileView"){d=b.isNumber(a.exports.m_widthDiff)?a.exports.m_widthDiff:a.exports.widthDiff||0}else{d=a.exports.widthDiff||0}}return d}return{getSkinHeightDiff:e,getSkinWidthDiff:f,getGalleryHeight:g,getDisplayerHeightDiff:h,getDisplayerWidthDiff:i}});define("galleriesCommon/utils/matrixScalingCalculations",[],function(){"use strict";var a={getSizeAfterScaling:function(a){var b=a.imageMode||"clipImage";var c=a.itemHeight-a.bottomGap;var d=a.widthDiff;var e=a.heightDiff;var f={clipImage:this.getClipImage,flexibleHeight:this.getFlexibleHeight,flexibleWidth:this.getFlexibleWidth,flexibleWidthFixed:this.getFlexibleWidth};return f[b].call(this,a.itemWidth,c,d,e,a.displayerData,b)},getClipImage:function(a,b,c,d){return{displayerSize:{width:a,height:b},imageWrapperSize:this.getWrapperSize(a-c,b-d)}},getFlexibleHeight:function(a,b,c,d,e){var f=a-c;var g=Math.floor(f/this.getAspectRatio(e));return{displayerSize:{width:a,height:g},imageWrapperSize:this.getWrapperSize(f,g-d)}},getFlexibleWidth:function(a,b,c,d,e,f){var g=f==="flexibleWidth";var h=0;var i=0;var j=b-d;var k=j*this.getAspectRatio(e);if(!g&&k>a-c){if(k>a-c){var l=(a-c)/k;k=a-c;j=l*j}}if(!g){h=Math.floor((a-k-c)/2);i=Math.floor((b-j-d)/2)}return{displayerSize:{width:g?k:a,height:b},imageWrapperSize:this.getWrapperSize(k,j,h,i)}},getAspectRatio:function(a){return a.width/a.height},getWrapperSize:function(a,b,c,d){var e=b<0?0:b;var f=a<0?0:a;return{imageWrapperHeight:e,imageWrapperWidth:f,imageWrapperMarginLeft:c||0,imageWrapperMarginRight:c||0,imageWrapperMarginTop:d||0,imageWrapperMarginBottom:d||0}}};return a});define("galleriesCommon/mixins/galleryAutoPlayMixin",["santaProps"],function(a){"use strict";function b(a){return a.items.length>0}function c(a,c){return b(a)&&c.autoplay}return{propTypes:{compProp:a.Types.Component.compProp.isRequired,compData:a.Types.Component.compData.isRequired,isZoomOpened:a.Types.isZoomOpened.isRequired,id:a.Types.Component.id.isRequired,isPlayingAllowed:a.Types.RenderFlags.isPlayingAllowed},mixins:[a.santaTypesPropsMixin],getInitialState:function(){var a=c(this.santaTypesProps.compData,this.santaTypesProps.compProp);return{$showAutoPlayButton:this.shouldShowAutoPlay()?"showPlayButton":"hidePlayButton",shouldAutoPlay:a,$slideshow:a&&!this.santaTypesProps.isZoomOpened&&this.santaTypesProps.isPlayingAllowed?"autoplayOn":"autoplayOff"}},shouldShowAutoPlay:function(){if(this.santaTypesProps.compProp.isHidden){return false}return b(this.santaTypesProps.compData)&&this.santaTypesProps.compProp.showAutoplay},toggleAutoPlay:function(){if(!b(this.santaTypesProps.compData)){return}var a="autoplayOff";if(this.state.$slideshow==="autoplayOff"){if(!this.santaTypesProps.isPlayingAllowed){return}a="autoplayOn"}this.setState({shouldAutoPlay:!this.state.shouldAutoPlay,$slideshow:a},this.updateAutoplayState)},componentWillReceiveProps:function(){var a=this.state.shouldAutoPlay&&!this.nextSantaTypesProps.isZoomOpened&&this.nextSantaTypesProps.isPlayingAllowed?"autoplayOn":"autoplayOff";if(a!==this.state.$slideshow){this.setState({$slideshow:a},this.updateAutoplayState)}},updateAutoplayState:function(){this.clearTimeoutNamed(this.santaTypesProps.id);if(this.state.$slideshow==="autoplayOn"){this.setTimeoutNamed(this.santaTypesProps.id,this.autoplayCallback,this.getAutoplayInterval())}},autoplayCallback:function(){if(this.santaTypesProps.isZoomOpened){return}if(this.santaTypesProps.compProp.autoPlayDirection==="LTR"){this.prev()}else{this.next()}},getAutoplayInterval:function(){var a=this.santaTypesProps.compProp.autoplayInterval;return Math.floor(a*1e3)}}});define("galleriesCommon",["galleriesCommon/utils/galleriesHelperFunctions","galleriesCommon/utils/matrixCalculations","galleriesCommon/utils/matrixScalingCalculations","galleriesCommon/mixins/galleryAutoPlayMixin"],function(a,b,c,d){"use strict";return{utils:{galleriesHelperFunctions:a,matrixCalculations:b,matrixScalingCalculations:c},mixins:{galleryAutoPlayMixin:d}}});