Socket
Socket
Sign inDemoInstall

react-leaf-carousel

Package Overview
Dependencies
13
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.0 to 1.2.1

2

lib/react-infinite-carusel.min.js

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.InfiniteCarousel=t(require("react")):e.InfiniteCarousel=t(e.React)}(this,function(e){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=5)}([function(t,n){t.exports=e},function(e,t,n){(function(t){if("production"!==t.env.NODE_ENV){var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,o=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r};e.exports=n(6)(o,!0)}else e.exports=n(9)()}).call(t,n(2))},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(c===setTimeout)return setTimeout(e,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function i(e){if(d===clearTimeout)return clearTimeout(e);if((d===r||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(e);try{return d(e)}catch(t){try{return d.call(null,e)}catch(t){return d.call(this,e)}}}function s(){v&&p&&(v=!1,p.length?h=p.concat(h):g=-1,h.length&&a())}function a(){if(!v){var e=o(s);v=!0;for(var t=h.length;t;){for(p=h,h=[];++g<t;)p&&p[g].run();g=-1,t=h.length}p=null,v=!1,i(e)}}function l(e,t){this.fun=e,this.array=t}function u(){}var c,d,f=e.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:n}catch(e){c=n}try{d="function"==typeof clearTimeout?clearTimeout:r}catch(e){d=r}}();var p,h=[],v=!1,g=-1;f.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];h.push(new l(e,t)),1!==h.length||v||o(a)},l.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=u,f.addListener=u,f.once=u,f.off=u,f.removeListener=u,f.removeAllListeners=u,f.emit=u,f.prependListener=u,f.prependOnceListener=u,f.listeners=function(e){return[]},f.binding=function(e){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(e){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t){function n(e,t){var n=0,r=e.length;for(n;n<r&&!1!==t(e[n],n);n++);}function r(e){return"[object Array]"===Object.prototype.toString.apply(e)}function o(e){return"function"==typeof e}e.exports={isFunction:o,isArray:r,each:n}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),c=r(u),d=n(1),f=r(d),p=n(10),h=n(18),v=n(19),g=r(v),y=n(20),m=r(y),b=n(21),w=r(b),S=function(e){function t(e){i(this,t);var n=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.setupBreakpointSettings=function(e){var t=e.map(function(e){return e.breakpoint}),r={};if(e.forEach(function(e){r[e.breakpoint]=e.settings}),t.length>0){t.sort(h.sortNumber),t.forEach(function(e,o){var i=void 0,s=void 0;0===o?(i=0,s=e-1):(i=t[o-1],s=e-1);var a={minWidth:i,maxWidth:s};(0,p.media)(a,function(){var t=n.props.scrollOnDevice&&(0,h.isTouchDevice)(),o=t?n.state.scrollOnDeviceProps:{},a=Object.assign({},n.defaultProps,n.props,r[e],o),l=n.getChildrenList(n.props.children,a.slidesToShow);n.setState({settings:a,children:l,lowerBreakpoint:i,higherBreakpoint:s},n.setDimensions)})}),t.reverse();var o={minWidth:t[0]};(0,p.media)(o,function(){var e=n.props.scrollOnDevice&&(0,h.isTouchDevice)(),t=e?n.state.scrollOnDeviceProps:{},r=Object.assign({},n.defaultProps,n.props,t),o=n.getChildrenList(n.props.children,r.slidesToShow);n.setState({settings:r,children:o,lowerBreakpoint:void 0,higherBreakpoint:void 0},n.setDimensions)})}},n.getSideSize=function(e,t,r){var o=n.state.settings.incrementalSides;if(void 0!==e&&void 0!==t&&o){return 50*(r-e)/(t-e)/100}return n.state.settings.sideSize},n.setDimensions=function(){var e=n.state,t=e.settings,r=e.lowerBreakpoint,o=e.higherBreakpoint,i=n.props.scrollOnDevice&&(0,h.isTouchDevice)(),s=(0,h.getScreenWidth)(),a=n.getSideSize(r,o,s),l=u.Children.count(n.props.children),c=i?l:u.Children.count(n.state.children),d=(0,h.getElementWidth)(n.frame),f=n.props.showSides,p=f?t.slidesToShow+2*a:t.slidesToShow,v=d/p-2*t.slidesSpacing,g=n.props.children.length,y=Math.ceil(n.state.currentIndex/t.slidesToShow),m=Math.ceil(g/t.slidesToShow),b=g>t.slidesToShow?m:1,w=b<=1,S=void 0,T=void 0;w||i?(S=n.state.children.map(function(e,t){return t}),T=n.state.children.map(function(e,t){return t})):(S=n.getLazyLoadedIndexes(n.props.children,n.state.currentIndex),T=n.getVisibleIndexes(n.props.children,n.state.currentIndex)),n.setState({activePage:y,childrenCount:l,slidesCount:c,slidesWidth:v,slidePages:b,singlePage:w,lazyLoadedList:S,visibleSlideList:T,sideSize:a})},n.getVisibleIndexes=function(e,t){var r=[],o=void 0,i=void 0,s=n.state.settings,a=s.showSides?1:0;if(o=e.length+s.slidesToShow+a,0===t){i=o+s.slidesToShow-1;for(var l=o;l<=i;l+=1)r.push(l)}if(o=0+a,t===e.length-s.slidesToShow){i=o+s.slidesToShow-1;for(var u=o;u<=i;u+=1)r.push(u)}o=t+n.state.settings.slidesToShow+a,i=o+(n.state.settings.slidesToShow-1);for(var c=o;c<=i;c+=1)r.push(c);return r},n.getLazyLoadedIndexes=function(e,t){var r=n.state.lazyLoadedList,o=void 0,i=void 0,s=n.state.settings,a=s.showSides?1:0;if(o=e.length+s.slidesToShow+a,0===t&&n.state.lazyLoadedList.indexOf(o)<0){i=o+s.slidesToShow+a-1;for(var l=o;l<=i;l+=1)r.push(l)}o=0;var u=t===e.length-s.slidesToShow,c=r.indexOf(o)<0;if(u&&c){i=o+s.slidesToShow+a-1;for(var d=o;d<=i;d+=1)r.push(d)}o=t+s.slidesToShow+a,i=o+(s.slidesToShow-1),n.state.settings.showSides&&(o-=1,i+=1);for(var f=o;f<=i;f+=1)n.state.lazyLoadedList.indexOf(f)<0&&r.push(f);return r},n.getChildrenList=function(e,t){return Array.isArray(e)?n.props.scrollOnDevice&&(0,h.isTouchDevice)()?e:e.length>t&&n.props.showSides?[].concat(o(e.slice(e.length-t-1,e.length)),o(e),o(e.slice(0,t+1))):e.length>t?[].concat(o(e.slice(e.length-t,e.length)),o(e),o(e.slice(0,t))):e:[e]},n.getTargetIndex=function(e,t){var r=n.state.childrenCount%t;return e<0?0===n.state.currentIndex?n.state.childrenCount-t:0:e>=n.state.childrenCount?0!==r?0:e-n.state.childrenCount:0!==r&&e===n.state.childrenCount-r?e-(t-r):e},n.onDotClick=function(e){if(e.preventDefault(),!n.state.animating){n.state.settings.autoCycle&&n.state.autoCycleTimer&&(clearInterval(n.state.autoCycleTimer),n.setState({autoCycleTimer:null}));var t=n.state.settings,r=t.slidesToShow,o=e.target.parentElement.getAttribute("data-index"),i=n.getTargetIndex(o*r,r);n.handleTrack(o*r,i),n.state.settings.autoCycle&&n.playAutoCycle()}},n.onWindowResized=function(){n.setDimensions()},n.onMouseEnter=function(){n.state.settings.autoCycle&&n.state.settings.pauseOnHover&&n.pauseAutoCycle()},n.onMouseOver=function(){n.state.settings.autoCycle&&n.state.settings.pauseOnHover&&n.pauseAutoCycle()},n.onMouseLeave=function(){n.state.settings.autoCycle&&n.state.settings.pauseOnHover&&n.playAutoCycle()},n.onSwipeStart=function(e){if(!(!1===n.state.settings.swipe||"ontouchend"in document&&!1===n.state.settings.swipe||!1===n.state.settings.draggable&&-1!==e.type.indexOf("mouse"))){var t=void 0!==e.touches?e.touches[0].pageX:e.clientX,r=void 0!==e.touches?e.touches[0].pageY:e.clientY;n.setState({dragging:!0,touchObject:{startX:t,startY:r}})}},n.onSwipeMove=function(e){if(!n.state.dragging)return void e.preventDefault();if(!n.state.animating){var t=void 0!==e.touches?e.touches[0].pageX:e.clientX,r=void 0!==e.touches?e.touches[0].pageY:e.clientY,o=n.state.touchObject,i=(0,h.getSwipeDirection)(o.startX,t,o.startY,r);0!==i&&e.preventDefault();var s=Math.round(Math.sqrt(Math.pow(t-o.startX,2)));n.setState({touchObject:{startX:o.startX,startY:o.startY,endX:t,endY:r,length:s,direction:i}})}},n.onSwipeEnd=function(){var e=n.state.touchObject.length;if(0!==e&&e>n.state.slidesWidth/2){n.state.settings.autoCycle&&n.state.autoCycleTimer&&(clearInterval(n.state.autoCycleTimer),n.setState({autoCycleTimer:null}));var t=n.state.settings,r=void 0,o=void 0;1===n.state.touchObject.direction?(r=n.state.currentIndex+t.slidesToScroll,o=n.getTargetIndex(r,t.slidesToScroll)):(r=n.state.currentIndex-t.slidesToScroll,o=n.getTargetIndex(r,t.slidesToScroll),r<0&&0!==n.state.currentIndex&&(r=0)),n.handleTrack(r,o),n.state.settings.autoCycle&&n.playAutoCycle()}else{var i=function(){setTimeout(function(){n.setState({animating:!1,dragging:!1,touchObject:{startX:0,startY:0,endX:0,endY:0,length:0,direction:-1}})},n.state.settings.animationDuration)};n.setState({animating:!0,touchObject:{direction:-1*n.state.touchObject.direction}},i)}},n.getTrackStyles=function(){var e=n.state.settings,t=n.state.touchObject,r=n.state.slidesWidth+2*e.slidesSpacing;r*=n.state.slidesCount+2*e.slidesToShow;var o=n.state.slidesWidth+2*e.slidesSpacing,i=e.showSides?1:0,s=o*(e.slidesToShow+i),a=n.state.animating?"transform "+e.animationDuration+"ms ease":"",l=e.swipe&&t.length,u=l?t.length*t.direction:0,c=o*n.state.currentIndex,d=s+c+u,f=o*n.state.sideSize;return e.showSides&&(d-=f),{position:"relative",display:"block",width:n.state.singlePage?"100%":r,height:"auto",padding:0,transition:a,transform:n.state.singlePage?"none":"translate("+-d+"px, 0px)",boxSizing:"border-box",MozBoxSizing:"border-box",marginLeft:n.state.singlePage&&e.showSides?f+"px":"0px"}},n.getScrollTrackStyles={clear:"both",position:"relative",display:"block",width:"100%",height:"auto",padding:0,boxSizing:"border-box",MozBoxSizing:"border-box"},n.getSlideStyles=function(e){var t=n.state.slidesWidth,r=n.props.scrollOnDevice&&(0,h.isTouchDevice)(),o=r?"none":"left",i=e?"1":n.state.settings.sidesOpacity;return{position:"relative",float:o,display:"inline-block",width:Number.isNaN(t)?1:t,height:"auto",margin:"0 "+n.state.settings.slidesSpacing+"px",opacity:i}},n.getFormatedChildren=function(e,t,r){return u.Children.map(e,function(e,o){var i=n.state.settings,s=r.indexOf(o)>=0;return!i.lazyLoad||t.indexOf(o)>=0?c.default.createElement("li",{className:w.default.InfiniteCarouselSlide,key:o,style:n.getSlideStyles(s)},e):c.default.createElement("li",{className:w.default.InfiniteCarouselSlide,key:o,style:n.getSlideStyles(s)},c.default.createElement("img",{alt:"placeholder",src:i.placeholderImageSrc}))})},n.autoCycle=function(){var e=n.state.settings,t=n.state.currentIndex+e.slidesToScroll,r=n.getTargetIndex(t,e.slidesToScroll);n.handleTrack(t,r)},n.playAutoCycle=function(){if(n.state.settings.autoCycle){var e=setInterval(n.autoCycle,n.state.settings.cycleInterval);n.setState({autoCycleTimer:e})}},n.pauseAutoCycle=function(){n.state.autoCycleTimer&&(clearInterval(n.state.autoCycleTimer),n.setState({autoCycleTimer:null}))},n.handleTrack=function(e,t){var r=n.state.settings,o=Math.ceil(t/r.slidesToShow),i=n.getLazyLoadedIndexes(n.props.children,t),s=n.getVisibleIndexes(n.props.children,t),a=function(){setTimeout(function(){n.setState({currentIndex:t,animating:!1,dragging:!1})},r.animationDuration)},l=function(){setTimeout(function(){n.setState({animating:!1,dragging:!1})},r.animationDuration)};e<0?n.setState({currentIndex:e,activePage:o,animating:!0,lazyLoadedList:i,visibleSlideList:s,touchObject:{startX:0,startY:0,endX:0,endY:0,length:0,direction:-1}},a):e>=n.props.children.length?n.setState({currentIndex:e,activePage:o,animating:!0,lazyLoadedList:i,visibleSlideList:s,touchObject:{startX:0,startY:0,endX:0,endY:0,length:0,direction:-1}},a):n.setState({currentIndex:t,activePage:o,animating:!0,lazyLoadedList:i,visibleSlideList:s,dragging:!1,touchObject:{startX:0,startY:0,endX:0,endY:0,length:0,direction:-1}},l),n.props.onSlideChange&&n.props.onSlideChange(o)},n.moveToNext=function(e){if(e.preventDefault(),!n.state.animating){n.state.settings.autoCycle&&n.state.autoCycleTimer&&(clearInterval(n.state.autoCycleTimer),n.setState({autoCycleTimer:null}));var t=n.state.settings,r=n.state.currentIndex+t.slidesToScroll,o=n.getTargetIndex(r,t.slidesToScroll);n.handleTrack(r,o),n.state.settings.autoCycle&&n.playAutoCycle()}},n.moveToPrevious=function(e){if(e.preventDefault(),!n.state.animating){n.state.settings.autoCycle&&n.state.autoCycleTimer&&(clearInterval(n.state.autoCycleTimer),n.setState({autoCycleTimer:null}));var t=n.state.settings,r=n.state.currentIndex-t.slidesToScroll,o=n.getTargetIndex(r,t.slidesToScroll);r<0&&0!==n.state.currentIndex&&(r=0),n.handleTrack(r,o),n.state.settings.autoCycle&&n.playAutoCycle()}},n.init=function(){var e=n.getChildrenList(n.props.children,n.props.slidesToShow),t=void 0;t=n.props.scrollOnDevice&&(0,h.isTouchDevice)()?Object.assign({},n.defaultProps,n.props,n.state.scrollOnDeviceProps):Object.assign({},n.defaultProps,n.props),n.setState({children:e,settings:t},function(){n.playAutoCycle()}),n.props.responsive&&n.setupBreakpointSettings(n.props.breakpoints)},n.storeFrameRef=function(e){null!==e&&(n.frame=e)},n.state={currentIndex:0,activePage:0,children:[],lazyLoadedList:[],visibleSlideList:[],childrenCount:0,slidesCount:0,slidesWidth:1,slidePages:1,singlePage:!0,settings:{},autoCycleTimer:null,dragging:!1,touchObject:{startX:0,startY:0,endX:0,endY:0,length:0,direction:-1},scrollOnDeviceProps:{arrows:!1,dots:!1,lazyLoad:!1,autoCycle:!1},lowerBreakpoint:void 0,higherBreakpoint:void 0},n}return a(t,e),l(t,[{key:"componentDidMount",value:function(){this.init(),this.setDimensions(),window&&(window.addEventListener?window.addEventListener("resize",this.onWindowResized):window.attachEvent("onresize",this.onWindowResized))}},{key:"componentWillUnmount",value:function(){window.addEventListener?window.removeEventListener("resize",this.onWindowResized):window.detachEvent("onresize",this.onWindowResized),this.state.autoCycleTimer&&clearInterval(this.state.autoCycleTimer)}},{key:"render",value:function(){var e=this.props.scrollOnDevice&&(0,h.isTouchDevice)(),t=this.state.settings,n=void 0,r=void 0,o=void 0;if(t.arrows&&!this.state.singlePage&&!e){if(null==t.prevArrow)n=c.default.createElement(g.default,{next:!1,styles:w.default,onClick:this.moveToPrevious});else{var i={onClick:this.moveToPrevious};n=c.default.cloneElement(t.prevArrow,i)}if(null==t.nextArrow)r=c.default.createElement(g.default,{styles:w.default,onClick:this.moveToNext});else{var s={onClick:this.moveToNext};r=c.default.cloneElement(t.nextArrow,s)}}!t.dots||this.state.singlePage||e||(o=c.default.createElement(m.default,{activePage:this.state.activePage,numberOfDots:this.state.slidePages,styles:w.default,onClick:this.onDotClick})),!t.paging||this.state.singlePage||e||(o=c.default.createElement("span",{className:w.default.InfiniteCarouselPaging},this.state.activePage+1+"/"+this.state.slidePages));var a=this.state,l=a.children,u=a.lazyLoadedList,d=a.visibleSlideList,f=this.getFormatedChildren(l,u,d),p=void 0,v=void 0;this.props.scrollOnDevice&&(0,h.isTouchDevice)()?(p=Object.assign({},this.getScrollTrackStyles),v=w.default.InfiniteCarouselScrollTrack):(p=this.getTrackStyles(),v="");var y=this.props.scrollOnDevice&&(0,h.isTouchDevice)();return c.default.createElement("div",{className:w.default.InfiniteCarousel,onFocus:this.onMouseOver,onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseOver:this.onMouseOver},n,c.default.createElement("div",{className:w.default.InfiniteCarouselFrame,ref:this.storeFrameRef},c.default.createElement("ul",{className:v,style:p,onMouseDown:y?null:this.onSwipeStart,onMouseLeave:this.state.dragging||!y?this.onSwipeEnd:null,onMouseMove:this.state.dragging||!y?this.onSwipeMove:null,onMouseUp:y?null:this.onSwipeEnd,onTouchCancel:this.state.dragging||!y?this.onSwipeEnd:null,onTouchEnd:y?null:this.onSwipeEnd,onTouchMove:this.state.dragging||!y?this.onSwipeMove:null,onTouchStart:y?null:this.onSwipeStart},f)),r,o)}}]),t}(u.Component);S.propTypes={children:f.default.oneOfType([f.default.arrayOf(f.default.node),f.default.node]),arrows:f.default.bool,dots:f.default.bool,paging:f.default.bool,lazyLoad:f.default.bool,swipe:f.default.bool,draggable:f.default.bool,animationDuration:f.default.number,slidesToShow:f.default.number,slidesToScroll:f.default.number,slidesSpacing:f.default.number,autoCycle:f.default.bool,cycleInterval:f.default.number,pauseOnHover:f.default.bool,responsive:f.default.bool,breakpoints:f.default.arrayOf(f.default.object),placeholderImageSrc:f.default.string,nextArrow:f.default.element,prevArrow:f.default.element,scrollOnDevice:f.default.bool,showSides:f.default.bool,sidesOpacity:f.default.number,sideSize:f.default.number,incrementalSides:f.default.bool,onSlideChange:f.default.func},S.defaultProps={children:[],arrows:!0,dots:!1,paging:!1,lazyLoad:!1,swipe:!0,draggable:!1,animationDuration:500,slidesToShow:1,slidesToScroll:1,slidesSpacing:10,autoCycle:!1,cycleInterval:5e3,pauseOnHover:!0,responsive:!0,breakpoints:[],placeholderImageSrc:"",nextArrow:null,prevArrow:null,scrollOnDevice:!1,showSides:!1,sidesOpacity:1,sideSize:.5,incrementalSides:!1,onSlideChange:void 0},t.default=S},function(e,t,n){"use strict";(function(t){function r(){return null}var o=n(7),i=n(3),s=n(8),a=function(){};"production"!==t.env.NODE_ENV&&(a=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),e.exports=function(e,n){function l(e){var t=e&&(I&&e[I]||e[E]);if("function"==typeof t)return t}function u(e,t){return e===t?0!==e||1/e==1/t:e!==e&&t!==t}function c(e){this.message=e,this.stack=""}function d(e){function r(r,l,u,d,f,p,h){if(d=d||k,p=p||u,h!==i){if(n){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}if("production"!==t.env.NODE_ENV&&"undefined"!=typeof console){var g=d+":"+u;!o[g]&&s<3&&(a("You are manually calling a React.PropTypes validation function for the `"+p+"` prop on `"+d+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),o[g]=!0,s++)}}return null==l[u]?r?new c(null===l[u]?"The "+f+" `"+p+"` is marked as required in `"+d+"`, but its value is `null`.":"The "+f+" `"+p+"` is marked as required in `"+d+"`, but its value is `undefined`."):null:e(l,u,d,f,p)}if("production"!==t.env.NODE_ENV)var o={},s=0;var l=r.bind(null,!1);return l.isRequired=r.bind(null,!0),l}function f(e){function t(t,n,r,o,i,s){var a=t[n];if(T(a)!==e)return new c("Invalid "+o+" `"+i+"` of type `"+x(a)+"` supplied to `"+r+"`, expected `"+e+"`.");return null}return d(t)}function p(e){function t(t,n,r,o,s){if("function"!=typeof e)return new c("Property `"+s+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a)){return new c("Invalid "+o+" `"+s+"` of type `"+T(a)+"` supplied to `"+r+"`, expected an array.")}for(var l=0;l<a.length;l++){var u=e(a,l,r,o,s+"["+l+"]",i);if(u instanceof Error)return u}return null}return d(t)}function h(e){function t(t,n,r,o,i){if(!(t[n]instanceof e)){var s=e.name||k;return new c("Invalid "+o+" `"+i+"` of type `"+O(t[n])+"` supplied to `"+r+"`, expected instance of `"+s+"`.")}return null}return d(t)}function v(e){function n(t,n,r,o,i){for(var s=t[n],a=0;a<e.length;a++)if(u(s,e[a]))return null;return new c("Invalid "+o+" `"+i+"` of value `"+s+"` supplied to `"+r+"`, expected one of "+JSON.stringify(e)+".")}return Array.isArray(e)?d(n):("production"!==t.env.NODE_ENV&&a("Invalid argument supplied to oneOf, expected an instance of array."),r)}function g(e){function t(t,n,r,o,s){if("function"!=typeof e)return new c("Property `"+s+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var a=t[n],l=T(a);if("object"!==l)return new c("Invalid "+o+" `"+s+"` of type `"+l+"` supplied to `"+r+"`, expected an object.");for(var u in a)if(a.hasOwnProperty(u)){var d=e(a,u,r,o,s+"."+u,i);if(d instanceof Error)return d}return null}return d(t)}function y(e){function n(t,n,r,o,s){for(var a=0;a<e.length;a++){if(null==(0,e[a])(t,n,r,o,s,i))return null}return new c("Invalid "+o+" `"+s+"` supplied to `"+r+"`.")}if(!Array.isArray(e))return"production"!==t.env.NODE_ENV&&a("Invalid argument supplied to oneOfType, expected an instance of array."),r;for(var o=0;o<e.length;o++){var s=e[o];if("function"!=typeof s)return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+C(s)+" at index "+o+"."),r}return d(n)}function m(e){function t(t,n,r,o,s){var a=t[n],l=T(a);if("object"!==l)return new c("Invalid "+o+" `"+s+"` of type `"+l+"` supplied to `"+r+"`, expected `object`.");for(var u in e){var d=e[u];if(d){var f=d(a,u,r,o,s+"."+u,i);if(f)return f}}return null}return d(t)}function b(e){function t(t,n,r,s,a){var l=t[n],u=T(l);if("object"!==u)return new c("Invalid "+s+" `"+a+"` of type `"+u+"` supplied to `"+r+"`, expected `object`.");var d=o({},t[n],e);for(var f in d){var p=e[f];if(!p)return new c("Invalid "+s+" `"+a+"` key `"+f+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var h=p(l,f,r,s,a+"."+f,i);if(h)return h}return null}return d(t)}function w(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(w);if(null===t||e(t))return!0;var n=l(t);if(!n)return!1;var r,o=n.call(t);if(n!==t.entries){for(;!(r=o.next()).done;)if(!w(r.value))return!1}else for(;!(r=o.next()).done;){var i=r.value;if(i&&!w(i[1]))return!1}return!0;default:return!1}}function S(e,t){return"symbol"===e||("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}function T(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":S(t,e)?"symbol":t}function x(e){if(void 0===e||null===e)return""+e;var t=T(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function C(e){var t=x(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}function O(e){return e.constructor&&e.constructor.name?e.constructor.name:k}var I="function"==typeof Symbol&&Symbol.iterator,E="@@iterator",k="<<anonymous>>",j={array:f("array"),bool:f("boolean"),func:f("function"),number:f("number"),object:f("object"),string:f("string"),symbol:f("symbol"),any:function(){return d(r)}(),arrayOf:p,element:function(){function t(t,n,r,o,i){var s=t[n];if(!e(s)){return new c("Invalid "+o+" `"+i+"` of type `"+T(s)+"` supplied to `"+r+"`, expected a single ReactElement.")}return null}return d(t)}(),instanceOf:h,node:function(){function e(e,t,n,r,o){return w(e[t])?null:new c("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}return d(e)}(),objectOf:g,oneOf:v,oneOfType:y,shape:m,exact:b};return c.prototype=Error.prototype,j.checkPropTypes=s,j.PropTypes=j,j}}).call(t,n(2))},function(e,t,n){"use strict";function r(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}/*
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.InfiniteCarousel=t(require("react")):e.InfiniteCarousel=t(e.React)}(this,function(e){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=5)}([function(t,n){t.exports=e},function(e,t,n){(function(t){if("production"!==t.env.NODE_ENV){var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,o=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r};e.exports=n(6)(o,!0)}else e.exports=n(9)()}).call(t,n(2))},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(c===setTimeout)return setTimeout(e,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function i(e){if(d===clearTimeout)return clearTimeout(e);if((d===r||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(e);try{return d(e)}catch(t){try{return d.call(null,e)}catch(t){return d.call(this,e)}}}function s(){v&&p&&(v=!1,p.length?h=p.concat(h):g=-1,h.length&&a())}function a(){if(!v){var e=o(s);v=!0;for(var t=h.length;t;){for(p=h,h=[];++g<t;)p&&p[g].run();g=-1,t=h.length}p=null,v=!1,i(e)}}function l(e,t){this.fun=e,this.array=t}function u(){}var c,d,f=e.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:n}catch(e){c=n}try{d="function"==typeof clearTimeout?clearTimeout:r}catch(e){d=r}}();var p,h=[],v=!1,g=-1;f.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];h.push(new l(e,t)),1!==h.length||v||o(a)},l.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=u,f.addListener=u,f.once=u,f.off=u,f.removeListener=u,f.removeAllListeners=u,f.emit=u,f.prependListener=u,f.prependOnceListener=u,f.listeners=function(e){return[]},f.binding=function(e){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(e){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t){function n(e,t){var n=0,r=e.length;for(n;n<r&&!1!==t(e[n],n);n++);}function r(e){return"[object Array]"===Object.prototype.toString.apply(e)}function o(e){return"function"==typeof e}e.exports={isFunction:o,isArray:r,each:n}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),c=r(u),d=n(1),f=r(d),p=n(10),h=n(18),v=n(19),g=r(v),y=n(20),m=r(y),b=n(21),w=r(b),S=function(e){function t(e){i(this,t);var n=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.setupBreakpointSettings=function(e){var t=e.map(function(e){return e.breakpoint}),r={};if(e.forEach(function(e){r[e.breakpoint]=e.settings}),t.length>0){t.sort(h.sortNumber),t.forEach(function(e,o){var i=void 0,s=void 0;0===o?(i=0,s=e-1):(i=t[o-1],s=e-1);var a={minWidth:i,maxWidth:s};(0,p.media)(a,function(){var t=n.props.scrollOnDevice&&(0,h.isTouchDevice)(),o=t?n.state.scrollOnDeviceProps:{},a=Object.assign({},n.defaultProps,n.props,r[e],o),l=n.getChildrenList(n.props.children,a.slidesToShow);n.setState({settings:a,children:l,lowerBreakpoint:i,higherBreakpoint:s},n.setDimensions)})}),t.reverse();var o={minWidth:t[0]};(0,p.media)(o,function(){var e=n.props.scrollOnDevice&&(0,h.isTouchDevice)(),t=e?n.state.scrollOnDeviceProps:{},r=Object.assign({},n.defaultProps,n.props,t),o=n.getChildrenList(n.props.children,r.slidesToShow);n.setState({settings:r,children:o,lowerBreakpoint:void 0,higherBreakpoint:void 0},n.setDimensions)})}},n.getSideSize=function(e,t,r){var o=n.state.settings.incrementalSides;if(void 0!==e&&void 0!==t&&o){return 50*(r-e)/(t-e)/100}return n.state.settings.sideSize},n.setDimensions=function(){var e=n.state,t=e.settings,r=e.lowerBreakpoint,o=e.higherBreakpoint,i=n.props.scrollOnDevice&&(0,h.isTouchDevice)(),s=(0,h.getScreenWidth)(),a=n.getSideSize(r,o,s),l=u.Children.count(n.props.children),c=i?l:u.Children.count(n.state.children),d=(0,h.getElementWidth)(n.frame),f=n.props.showSides,p=f?t.slidesToShow+2*a:t.slidesToShow,v=d/p-2*t.slidesSpacing,g=n.props.children.length,y=Math.ceil(n.state.currentIndex/t.slidesToShow),m=Math.ceil(g/t.slidesToShow),b=g>t.slidesToShow?m:1,w=b<=1,S=void 0,T=void 0;w||i?(S=n.state.children.map(function(e,t){return t}),T=n.state.children.map(function(e,t){return t})):(S=n.getLazyLoadedIndexes(n.props.children,n.state.currentIndex),T=n.getVisibleIndexes(n.props.children,n.state.currentIndex)),n.setState({activePage:y,childrenCount:l,slidesCount:c,slidesWidth:v,slidePages:b,singlePage:w,lazyLoadedList:S,visibleSlideList:T,sideSize:a})},n.getVisibleIndexes=function(e,t){var r=[],o=void 0,i=void 0,s=n.state.settings,a=s.showSides?1:0;if(o=e.length+s.slidesToShow+a,0===t){i=o+s.slidesToShow-1;for(var l=o;l<=i;l+=1)r.push(l)}if(o=0+a,t===e.length-s.slidesToShow){i=o+s.slidesToShow-1;for(var u=o;u<=i;u+=1)r.push(u)}o=t+n.state.settings.slidesToShow+a,i=o+(n.state.settings.slidesToShow-1);for(var c=o;c<=i;c+=1)r.push(c);return r},n.getLazyLoadedIndexes=function(e,t){var r=n.state.lazyLoadedList,o=void 0,i=void 0,s=n.state.settings,a=s.showSides?1:0;if(o=e.length+s.slidesToShow+a,0===t&&n.state.lazyLoadedList.indexOf(o)<0){i=o+s.slidesToShow+a-1;for(var l=o;l<=i;l+=1)r.push(l)}o=0;var u=t===e.length-s.slidesToShow,c=r.indexOf(o)<0;if(u&&c){i=o+s.slidesToShow+a-1;for(var d=o;d<=i;d+=1)r.push(d)}o=t+s.slidesToShow+a,i=o+(s.slidesToShow-1),n.state.settings.showSides&&(o-=1,i+=1);for(var f=o;f<=i;f+=1)n.state.lazyLoadedList.indexOf(f)<0&&r.push(f);return r},n.getChildrenList=function(e,t){return Array.isArray(e)?n.props.scrollOnDevice&&(0,h.isTouchDevice)()?e:e.length>t&&n.props.showSides?[].concat(o(e.slice(e.length-t-1,e.length)),o(e),o(e.slice(0,t+1))):e.length>t?[].concat(o(e.slice(e.length-t,e.length)),o(e),o(e.slice(0,t))):e:[e]},n.getTargetIndex=function(e,t){var r=n.state.childrenCount%t;return e<0?0===n.state.currentIndex?n.state.childrenCount-t:0:e>=n.state.childrenCount?0!==r?0:e-n.state.childrenCount:0!==r&&e===n.state.childrenCount-r?e-(t-r):e},n.onDotClick=function(e){if(e.preventDefault(),!n.state.animating){n.state.settings.autoCycle&&n.state.autoCycleTimer&&(clearInterval(n.state.autoCycleTimer),n.setState({autoCycleTimer:null}));var t=n.state.settings,r=t.slidesToShow,o=e.target.parentElement.getAttribute("data-index"),i=n.getTargetIndex(o*r,r);n.handleTrack(o*r,i),n.state.settings.autoCycle&&n.playAutoCycle()}},n.onWindowResized=function(){n.setDimensions()},n.onMouseEnter=function(){n.state.settings.autoCycle&&n.state.settings.pauseOnHover&&n.pauseAutoCycle()},n.onMouseOver=function(){n.state.settings.autoCycle&&n.state.settings.pauseOnHover&&n.pauseAutoCycle()},n.onMouseLeave=function(){n.state.settings.autoCycle&&n.state.settings.pauseOnHover&&n.playAutoCycle()},n.onSwipeStart=function(e){if(!(!1===n.state.settings.swipe||"ontouchend"in document&&!1===n.state.settings.swipe||!1===n.state.settings.draggable&&-1!==e.type.indexOf("mouse"))){var t=void 0!==e.touches?e.touches[0].pageX:e.clientX,r=void 0!==e.touches?e.touches[0].pageY:e.clientY;n.setState({dragging:!0,touchObject:{startX:t,startY:r}})}},n.onSwipeMove=function(e){if(!n.state.dragging)return void e.preventDefault();if(!n.state.animating){var t=void 0!==e.touches?e.touches[0].pageX:e.clientX,r=void 0!==e.touches?e.touches[0].pageY:e.clientY,o=n.state.touchObject,i=(0,h.getSwipeDirection)(o.startX,t,o.startY,r);0!==i&&e.preventDefault();var s=Math.round(Math.sqrt(Math.pow(t-o.startX,2)));n.setState({touchObject:{startX:o.startX,startY:o.startY,endX:t,endY:r,length:s,direction:i}})}},n.onSwipeEnd=function(){var e=n.state.touchObject.length;if(0!==e&&e>n.state.slidesWidth/2){n.state.settings.autoCycle&&n.state.autoCycleTimer&&(clearInterval(n.state.autoCycleTimer),n.setState({autoCycleTimer:null}));var t=n.state.settings,r=void 0,o=void 0;1===n.state.touchObject.direction?(r=n.state.currentIndex+t.slidesToScroll,o=n.getTargetIndex(r,t.slidesToScroll)):(r=n.state.currentIndex-t.slidesToScroll,o=n.getTargetIndex(r,t.slidesToScroll),r<0&&0!==n.state.currentIndex&&(r=0)),n.handleTrack(r,o),n.state.settings.autoCycle&&n.playAutoCycle()}else{var i=function(){setTimeout(function(){n.setState({animating:!1,dragging:!1,touchObject:{startX:0,startY:0,endX:0,endY:0,length:0,direction:-1}})},n.state.settings.animationDuration)};n.setState({animating:!0,touchObject:{direction:-1*n.state.touchObject.direction}},i)}},n.getTrackStyles=function(){var e=n.state.settings,t=n.state.touchObject,r=n.state.slidesWidth+2*e.slidesSpacing;r*=n.state.slidesCount+2*e.slidesToShow;var o=n.state.slidesWidth+2*e.slidesSpacing,i=e.showSides?1:0,s=o*(e.slidesToShow+i),a=n.state.animating?"transform "+e.animationDuration+"ms ease":"",l=e.swipe&&t.length,u=l?t.length*t.direction:0,c=o*n.state.currentIndex,d=s+c+u,f=o*n.state.sideSize;return e.showSides&&(d-=f),{position:"relative",display:"block",width:n.state.singlePage?"100%":r,height:"auto",padding:0,transition:a,transform:n.state.singlePage?"none":"translate("+-d+"px, 0px)",boxSizing:"border-box",MozBoxSizing:"border-box",marginLeft:n.state.singlePage&&e.showSides?f+"px":"0px"}},n.getScrollTrackStyles={clear:"both",position:"relative",display:"block",width:"100%",height:"auto",padding:0,boxSizing:"border-box",MozBoxSizing:"border-box"},n.getSlideStyles=function(e){var t=n.state.slidesWidth,r=n.props.scrollOnDevice&&(0,h.isTouchDevice)(),o=r?"none":"left",i=e?"1":n.state.settings.sidesOpacity;return{position:"relative",float:o,display:"inline-block",width:Number.isNaN(t)?1:t,height:"auto",margin:"0 "+n.state.settings.slidesSpacing+"px",opacity:i}},n.getFormatedChildren=function(e,t,r){return u.Children.map(e,function(e,o){var i=n.state.settings,s=r.indexOf(o)>=0;return!i.lazyLoad||t.indexOf(o)>=0?c.default.createElement("li",{className:w.default.InfiniteCarouselSlide,key:o,style:n.getSlideStyles(s)},e):c.default.createElement("li",{className:w.default.InfiniteCarouselSlide,key:o,style:n.getSlideStyles(s)},c.default.createElement("img",{alt:"placeholder",src:i.placeholderImageSrc}))})},n.autoCycle=function(){var e=n.state.settings,t=n.state.currentIndex+e.slidesToScroll,r=n.getTargetIndex(t,e.slidesToScroll);n.handleTrack(t,r)},n.playAutoCycle=function(){if(n.state.settings.autoCycle){var e=setInterval(n.autoCycle,n.state.settings.cycleInterval);n.setState({autoCycleTimer:e})}},n.pauseAutoCycle=function(){n.state.autoCycleTimer&&(clearInterval(n.state.autoCycleTimer),n.setState({autoCycleTimer:null}))},n.handleTrack=function(e,t){var r=n.state.settings,o=Math.ceil(t/r.slidesToShow),i=n.getLazyLoadedIndexes(n.props.children,t),s=n.getVisibleIndexes(n.props.children,t),a=function(){setTimeout(function(){n.setState({currentIndex:t,animating:!1,dragging:!1})},r.animationDuration)},l=function(){setTimeout(function(){n.setState({animating:!1,dragging:!1})},r.animationDuration)};e<0?n.setState({currentIndex:e,activePage:o,animating:!0,lazyLoadedList:i,visibleSlideList:s,touchObject:{startX:0,startY:0,endX:0,endY:0,length:0,direction:-1}},a):e>=n.props.children.length?n.setState({currentIndex:e,activePage:o,animating:!0,lazyLoadedList:i,visibleSlideList:s,touchObject:{startX:0,startY:0,endX:0,endY:0,length:0,direction:-1}},a):n.setState({currentIndex:t,activePage:o,animating:!0,lazyLoadedList:i,visibleSlideList:s,dragging:!1,touchObject:{startX:0,startY:0,endX:0,endY:0,length:0,direction:-1}},l),n.props.onSlideChange&&n.props.onSlideChange(o)},n.moveToNext=function(e){if(e.preventDefault(),!n.state.animating){n.state.settings.autoCycle&&n.state.autoCycleTimer&&(clearInterval(n.state.autoCycleTimer),n.setState({autoCycleTimer:null}));var t=n.state.settings,r=n.state.currentIndex+t.slidesToScroll,o=n.getTargetIndex(r,t.slidesToScroll);n.handleTrack(r,o),n.state.settings.autoCycle&&n.playAutoCycle()}},n.moveToPrevious=function(e){if(e.preventDefault(),!n.state.animating){n.state.settings.autoCycle&&n.state.autoCycleTimer&&(clearInterval(n.state.autoCycleTimer),n.setState({autoCycleTimer:null}));var t=n.state.settings,r=n.state.currentIndex-t.slidesToScroll,o=n.getTargetIndex(r,t.slidesToScroll);r<0&&0!==n.state.currentIndex&&(r=0),n.handleTrack(r,o),n.state.settings.autoCycle&&n.playAutoCycle()}},n.init=function(){var e=n.getChildrenList(n.props.children,n.props.slidesToShow),t=void 0;t=n.props.scrollOnDevice&&(0,h.isTouchDevice)()?Object.assign({},n.defaultProps,n.props,n.state.scrollOnDeviceProps):Object.assign({},n.defaultProps,n.props),n.setState({children:e,settings:t},function(){n.playAutoCycle()}),n.props.responsive&&n.setupBreakpointSettings(n.props.breakpoints)},n.storeFrameRef=function(e){null!==e&&(n.frame=e)},n.state={currentIndex:0,activePage:0,children:[],lazyLoadedList:[],visibleSlideList:[],childrenCount:0,slidesCount:0,slidesWidth:1,slidePages:1,singlePage:!0,settings:{},autoCycleTimer:null,dragging:!1,touchObject:{startX:0,startY:0,endX:0,endY:0,length:0,direction:-1},scrollOnDeviceProps:{arrows:!1,dots:!1,lazyLoad:!1,autoCycle:!1},lowerBreakpoint:void 0,higherBreakpoint:void 0},n}return a(t,e),l(t,[{key:"componentDidMount",value:function(){this.init(),this.setDimensions(),window&&(window.addEventListener?window.addEventListener("resize",this.onWindowResized):window.attachEvent("onresize",this.onWindowResized))}},{key:"componentWillUnmount",value:function(){window.addEventListener?window.removeEventListener("resize",this.onWindowResized):window.detachEvent("onresize",this.onWindowResized),this.state.autoCycleTimer&&clearInterval(this.state.autoCycleTimer)}},{key:"render",value:function(){var e=this.props.scrollOnDevice&&(0,h.isTouchDevice)(),t=this.state.settings,n=void 0,r=void 0,o=void 0;if(t.arrows&&!this.state.singlePage&&!e){if(null==t.prevArrow)n=c.default.createElement(g.default,{next:!1,styles:w.default,onClick:this.moveToPrevious});else{var i={onClick:this.moveToPrevious};n=c.default.cloneElement(t.prevArrow,i)}if(null==t.nextArrow)r=c.default.createElement(g.default,{styles:w.default,onClick:this.moveToNext});else{var s={onClick:this.moveToNext};r=c.default.cloneElement(t.nextArrow,s)}}!t.dots||this.state.singlePage||e||(o=c.default.createElement(m.default,{activePage:this.state.activePage,numberOfDots:this.state.slidePages,styles:w.default,onClick:this.onDotClick})),!t.paging||this.state.singlePage||e||(o=c.default.createElement("span",{className:w.default.InfiniteCarouselPaging},this.state.activePage+1+" "+this.props.pagingSeparator+" "+this.state.slidePages));var a=this.state,l=a.children,u=a.lazyLoadedList,d=a.visibleSlideList,f=this.getFormatedChildren(l,u,d),p=void 0,v=void 0;this.props.scrollOnDevice&&(0,h.isTouchDevice)()?(p=Object.assign({},this.getScrollTrackStyles),v=w.default.InfiniteCarouselScrollTrack):(p=this.getTrackStyles(),v="");var y=this.props.scrollOnDevice&&(0,h.isTouchDevice)();return c.default.createElement("div",{className:w.default.InfiniteCarousel,onFocus:this.onMouseOver,onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseOver:this.onMouseOver},n,c.default.createElement("div",{className:w.default.InfiniteCarouselFrame,ref:this.storeFrameRef},c.default.createElement("ul",{className:v,style:p,onMouseDown:y?null:this.onSwipeStart,onMouseLeave:this.state.dragging||!y?this.onSwipeEnd:null,onMouseMove:this.state.dragging||!y?this.onSwipeMove:null,onMouseUp:y?null:this.onSwipeEnd,onTouchCancel:this.state.dragging||!y?this.onSwipeEnd:null,onTouchEnd:y?null:this.onSwipeEnd,onTouchMove:this.state.dragging||!y?this.onSwipeMove:null,onTouchStart:y?null:this.onSwipeStart},f)),r,o)}}]),t}(u.Component);S.propTypes={children:f.default.oneOfType([f.default.arrayOf(f.default.node),f.default.node]),arrows:f.default.bool,dots:f.default.bool,paging:f.default.bool,pagingSeparator:f.default.string,lazyLoad:f.default.bool,swipe:f.default.bool,draggable:f.default.bool,animationDuration:f.default.number,slidesToShow:f.default.number,slidesToScroll:f.default.number,slidesSpacing:f.default.number,autoCycle:f.default.bool,cycleInterval:f.default.number,pauseOnHover:f.default.bool,responsive:f.default.bool,breakpoints:f.default.arrayOf(f.default.object),placeholderImageSrc:f.default.string,nextArrow:f.default.element,prevArrow:f.default.element,scrollOnDevice:f.default.bool,showSides:f.default.bool,sidesOpacity:f.default.number,sideSize:f.default.number,incrementalSides:f.default.bool,onSlideChange:f.default.func},S.defaultProps={children:[],arrows:!0,dots:!1,paging:!1,lazyLoad:!1,swipe:!0,draggable:!1,animationDuration:500,slidesToShow:1,slidesToScroll:1,slidesSpacing:10,autoCycle:!1,cycleInterval:5e3,pauseOnHover:!0,responsive:!0,breakpoints:[],placeholderImageSrc:"",pagingSeparator:"/",nextArrow:null,prevArrow:null,scrollOnDevice:!1,showSides:!1,sidesOpacity:1,sideSize:.5,incrementalSides:!1,onSlideChange:void 0},t.default=S},function(e,t,n){"use strict";(function(t){function r(){return null}var o=n(7),i=n(3),s=n(8),a=function(){};"production"!==t.env.NODE_ENV&&(a=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),e.exports=function(e,n){function l(e){var t=e&&(I&&e[I]||e[E]);if("function"==typeof t)return t}function u(e,t){return e===t?0!==e||1/e==1/t:e!==e&&t!==t}function c(e){this.message=e,this.stack=""}function d(e){function r(r,l,u,d,f,p,h){if(d=d||k,p=p||u,h!==i){if(n){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}if("production"!==t.env.NODE_ENV&&"undefined"!=typeof console){var g=d+":"+u;!o[g]&&s<3&&(a("You are manually calling a React.PropTypes validation function for the `"+p+"` prop on `"+d+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),o[g]=!0,s++)}}return null==l[u]?r?new c(null===l[u]?"The "+f+" `"+p+"` is marked as required in `"+d+"`, but its value is `null`.":"The "+f+" `"+p+"` is marked as required in `"+d+"`, but its value is `undefined`."):null:e(l,u,d,f,p)}if("production"!==t.env.NODE_ENV)var o={},s=0;var l=r.bind(null,!1);return l.isRequired=r.bind(null,!0),l}function f(e){function t(t,n,r,o,i,s){var a=t[n];if(T(a)!==e)return new c("Invalid "+o+" `"+i+"` of type `"+x(a)+"` supplied to `"+r+"`, expected `"+e+"`.");return null}return d(t)}function p(e){function t(t,n,r,o,s){if("function"!=typeof e)return new c("Property `"+s+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a)){return new c("Invalid "+o+" `"+s+"` of type `"+T(a)+"` supplied to `"+r+"`, expected an array.")}for(var l=0;l<a.length;l++){var u=e(a,l,r,o,s+"["+l+"]",i);if(u instanceof Error)return u}return null}return d(t)}function h(e){function t(t,n,r,o,i){if(!(t[n]instanceof e)){var s=e.name||k;return new c("Invalid "+o+" `"+i+"` of type `"+O(t[n])+"` supplied to `"+r+"`, expected instance of `"+s+"`.")}return null}return d(t)}function v(e){function n(t,n,r,o,i){for(var s=t[n],a=0;a<e.length;a++)if(u(s,e[a]))return null;return new c("Invalid "+o+" `"+i+"` of value `"+s+"` supplied to `"+r+"`, expected one of "+JSON.stringify(e)+".")}return Array.isArray(e)?d(n):("production"!==t.env.NODE_ENV&&a("Invalid argument supplied to oneOf, expected an instance of array."),r)}function g(e){function t(t,n,r,o,s){if("function"!=typeof e)return new c("Property `"+s+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var a=t[n],l=T(a);if("object"!==l)return new c("Invalid "+o+" `"+s+"` of type `"+l+"` supplied to `"+r+"`, expected an object.");for(var u in a)if(a.hasOwnProperty(u)){var d=e(a,u,r,o,s+"."+u,i);if(d instanceof Error)return d}return null}return d(t)}function y(e){function n(t,n,r,o,s){for(var a=0;a<e.length;a++){if(null==(0,e[a])(t,n,r,o,s,i))return null}return new c("Invalid "+o+" `"+s+"` supplied to `"+r+"`.")}if(!Array.isArray(e))return"production"!==t.env.NODE_ENV&&a("Invalid argument supplied to oneOfType, expected an instance of array."),r;for(var o=0;o<e.length;o++){var s=e[o];if("function"!=typeof s)return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+C(s)+" at index "+o+"."),r}return d(n)}function m(e){function t(t,n,r,o,s){var a=t[n],l=T(a);if("object"!==l)return new c("Invalid "+o+" `"+s+"` of type `"+l+"` supplied to `"+r+"`, expected `object`.");for(var u in e){var d=e[u];if(d){var f=d(a,u,r,o,s+"."+u,i);if(f)return f}}return null}return d(t)}function b(e){function t(t,n,r,s,a){var l=t[n],u=T(l);if("object"!==u)return new c("Invalid "+s+" `"+a+"` of type `"+u+"` supplied to `"+r+"`, expected `object`.");var d=o({},t[n],e);for(var f in d){var p=e[f];if(!p)return new c("Invalid "+s+" `"+a+"` key `"+f+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var h=p(l,f,r,s,a+"."+f,i);if(h)return h}return null}return d(t)}function w(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(w);if(null===t||e(t))return!0;var n=l(t);if(!n)return!1;var r,o=n.call(t);if(n!==t.entries){for(;!(r=o.next()).done;)if(!w(r.value))return!1}else for(;!(r=o.next()).done;){var i=r.value;if(i&&!w(i[1]))return!1}return!0;default:return!1}}function S(e,t){return"symbol"===e||("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}function T(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":S(t,e)?"symbol":t}function x(e){if(void 0===e||null===e)return""+e;var t=T(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function C(e){var t=x(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}function O(e){return e.constructor&&e.constructor.name?e.constructor.name:k}var I="function"==typeof Symbol&&Symbol.iterator,E="@@iterator",k="<<anonymous>>",j={array:f("array"),bool:f("boolean"),func:f("function"),number:f("number"),object:f("object"),string:f("string"),symbol:f("symbol"),any:function(){return d(r)}(),arrayOf:p,element:function(){function t(t,n,r,o,i){var s=t[n];if(!e(s)){return new c("Invalid "+o+" `"+i+"` of type `"+T(s)+"` supplied to `"+r+"`, expected a single ReactElement.")}return null}return d(t)}(),instanceOf:h,node:function(){function e(e,t,n,r,o){return w(e[t])?null:new c("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}return d(e)}(),objectOf:g,oneOf:v,oneOfType:y,shape:m,exact:b};return c.prototype=Error.prototype,j.checkPropTypes=s,j.PropTypes=j,j}}).call(t,n(2))},function(e,t,n){"use strict";function r(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}/*
object-assign

@@ -3,0 +3,0 @@ (c) Sindre Sorhus

{
"name": "react-leaf-carousel",
"version": "1.2.0",
"version": "1.2.1",
"description": "React simple infinite carousel with lazy loading and responsive support",

@@ -5,0 +5,0 @@ "scripts": {

@@ -167,3 +167,3 @@ # react-leaf-carousel

</InfiniteCarousel>
,
,
document.getElementById('root'));

@@ -177,4 +177,6 @@ ```

| arrows | bool | Enables tabbing and arrow key navigation | true |
| dots | bool | Enable dot pagination | false |
| lazyLoad | bool | Lazy load slides that are not visible at first load | true |
| dots | bool | Enable dot pagination | false |
| paging | bool | Enable 1/x pagination | false |
| pagingSeparator | string | 1/x pagination separator | '/' |
| lazyLoad | bool | Lazy load slides that are not visible at first load | true |
| swipe | bool | Add swipe event to scroll between slide pages | true |

@@ -181,0 +183,0 @@ | animationDuration | int | Slide animation duration | 500 |

@@ -27,2 +27,3 @@ import React, {

paging: PropTypes.bool, // eslint-disable-line react/no-unused-prop-types
pagingSeparator: PropTypes.string,
lazyLoad: PropTypes.bool, // eslint-disable-line react/no-unused-prop-types

@@ -68,2 +69,3 @@ swipe: PropTypes.bool, // eslint-disable-line react/no-unused-prop-types

placeholderImageSrc: '',
pagingSeparator: '/',
nextArrow: null,

@@ -851,3 +853,3 @@ prevArrow: null,

<span className={styles.InfiniteCarouselPaging}>
{ `${this.state.activePage + 1}/${this.state.slidePages}` }
{ `${this.state.activePage + 1} ${this.props.pagingSeparator} ${this.state.slidePages}` }
</span>

@@ -854,0 +856,0 @@ );

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc