Socket
Socket
Sign inDemoInstall

react-pannable

Package Overview
Dependencies
Maintainers
1
Versions
105
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-pannable - npm Package Compare versions

Comparing version 0.10.6 to 0.10.7

2

dist/react-pannable.min.js

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

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t=t||self).ReactPannable={},t.React)}(this,function(t,b){"use strict";function d(t,e){if(null==t)return{};var n,i,o={},r=Object.keys(t);for(i=0;i<r.length;i++)e.indexOf(n=r[i])<0&&(o[n]=t[n]);return o}function w(){return(w=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}function i(t,e){t.prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e}b=b&&b.hasOwnProperty("default")?b.default:b;var u=function(o){function t(){for(var n,t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];return(n=o.call.apply(o,[this].concat(e))||this).state={target:null,translation:null,interval:null,velocity:null,startPoint:null,movePoint:null,moveTime:null},n.elemRef=b.createRef(),n._onTouchStart=function(t){var e=n.props.onTouchStart;t.touches&&1===t.touches.length&&(n._addTouchPanListener(t.target),n._track(t.touches[0])),e&&e(t)},n._onTouchMove=function(t){t.touches&&1===t.touches.length&&n._move(t.touches[0])},n._onTouchEnd=function(t){n._removeTouchPanListener(t.target),n._end()},n._onTouchCancel=function(t){n._removeTouchPanListener(t.target),n._end()},n._onMouseDown=function(t){var e=n.props.onMouseDown;n._shouldPreventClick=!0,n._removeMousePanListener(),n._addMousePanListener(),n._track(t),e&&e(t)},n._onMouseMove=function(t){t.preventDefault(),n._move(t)},n._onMouseUp=function(t){t.preventDefault(),n._removeMousePanListener(),n._end()},n._onClick=function(t){var e=n.props.onClick;n._shouldPreventClick&&t.preventDefault(),n._shouldPreventClick=!1,e&&e(t)},n}i(t,o);var e=t.prototype;return e.componentDidUpdate=function(t){var e=this.props.enabled;e!==t.enabled&&(e||this._cancel())},e.componentWillUnmount=function(){this._removeMousePanListener()},e._track=function(t){this.setState({startPoint:{x:t.pageX,y:t.pageY},movePoint:{x:t.pageX,y:t.pageY},moveTime:(new Date).getTime()})},e._move=function(m){m={target:m.target,pageX:m.pageX,pageY:m.pageY},this.setState(function(t,e){var n=e.shouldStart,i=e.onStart,o=e.onMove,r=t.target,a=t.startPoint,s=t.movePoint,c=t.moveTime;if(!a)return null;var l=(new Date).getTime(),u={x:m.pageX,y:m.pageY},d=l-c,h={x:u.x-a.x,y:u.y-a.y},f={x:(u.x-s.x)/d,y:(u.y-s.y)/d},p={translation:h,velocity:f,interval:d,movePoint:u,moveTime:l};r?o({target:r,translation:h,velocity:f,interval:d}):0<Math.sqrt(h.x*h.x+h.y*h.y)&&n({target:m.target,translation:h,velocity:f,interval:d})&&(p.target=m.target,p.startPoint={x:m.pageX,y:m.pageY},p.translation=h={x:0,y:0},i({target:m.target,translation:h,velocity:f,interval:d}));return p})},e._end=function(){this.setState(function(t,e){var n=t.target;return n&&e.onEnd({target:n,translation:t.translation,velocity:t.velocity,interval:t.interval}),{target:null,translation:null,velocity:null,interval:null,startPoint:null,movePoint:null,moveTime:null}})},e._cancel=function(){this.setState(function(t,e){var n=t.target;return n&&e.onCancel({target:n,translation:t.translation,velocity:t.velocity,interval:t.interval}),{target:null,translation:null,velocity:null,interval:null,startPoint:null,movePoint:null,moveTime:null}})},e._addTouchPanListener=function(t){t.addEventListener("touchmove",this._onTouchMove,!1),t.addEventListener("touchend",this._onTouchEnd,!1),t.addEventListener("touchcancel",this._onTouchCancel,!1)},e._removeTouchPanListener=function(t){t.removeEventListener("touchmove",this._onTouchMove,!1),t.removeEventListener("touchend",this._onTouchEnd,!1),t.removeEventListener("touchcancel",this._onTouchCancel,!1)},e._addMousePanListener=function(){var t=document.documentElement;t.addEventListener("mousemove",this._onMouseMove,!1),t.addEventListener("mouseup",this._onMouseUp,!1)},e._removeMousePanListener=function(){var t=document.documentElement;t.removeEventListener("mousemove",this._onMouseMove,!1),t.removeEventListener("mouseup",this._onMouseUp,!1)},e.render=function(){var t=this.props,e=t.enabled,n=d(t,["enabled","shouldStart","onStart","onMove","onEnd","onCancel"]);return e&&(n.style=w({touchAction:"none"},n.style),n.onTouchStart=this._onTouchStart,n.onMouseDown=this._onMouseDown,n.onClick=this._onClick),b.createElement("div",w({},n,{ref:this.elemRef}))},t}(b.Component);u.defaultProps={enabled:!0,shouldStart:function(){return!0},onStart:function(){},onMove:function(){},onEnd:function(){},onCancel:function(){}};var e,h={create:function(t){var e=t.transformTranslate;return w({},d(t,["transformTranslate"]),function(t){return t?{transform:"translate3d("+t[0]+"px, "+t[1]+"px, 0)",WebkitTransform:"translate3d("+t[0]+"px, "+t[1]+"px, 0)",msTransform:"translate("+t[0]+"px, "+t[1]+"px)"}:null}(e))}},o=(e="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.msRequestAnimationFrame||e.setTimeout&&function(t){return e.setTimeout(t,20)}||function(){},r=e.cancelAnimationFrame||e.webkitCancelAnimationFrame||e.mozCancelAnimationFrame||e.clearTimeout||function(){};function f(t,e){var n=e.x,i=e.y,o=Math.sqrt(n*n+i*i);return 0==o?{x:0,y:0}:{x:t*(n/o),y:t*(i/o)}}function p(t,e,n,i,o){if(o){var r="y"===o?["y","height"]:["x","width"],a=r[0],s=r[1],c=e[s],l=Math.min(c-n[s],0),u=t[a];return i&&0<c&&(l=c*Math.ceil(l/c)),0<u?u=0:u<l?u=l:i&&0<c&&(u=c*Math.round(u/c)),u}var d={x:p(t,e,n,i,"x"),y:p(t,e,n,i,"y")};return d.x===t.x&&d.y===t.y?t:d}function m(t,e,n,i,o,r){if(r){var a="y"===r?["y","height"]:["x","width"],s=a[0],c=a[1],l=t[s];return o[s]&&(l+=.5*e[s]*(e[s]/o[s])),i&&0<n[c]&&(l=n[c]*Math.round(l/n[c])),l}return"number"==typeof o&&(o=f(o,e)),{x:m(t,e,n,i,o,"x"),y:m(t,e,n,i,o,"y")}}function g(t,e,n,i){var o,r,a={x:n.x-t.x,y:n.y-t.y},s=Math.sqrt(Math.pow(a.x,2)+Math.pow(a.y,2));if(s){var c=Math.sqrt(.5*Math.pow(o=(e.x*a.x+e.y*a.y)/s,2)+i*s),l=(c-o)/i;l<0&&(c=o,l=0),r=l+c/i}else o=Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2)),r=(1+Math.sqrt(2))*o/i;return 0<r?{points:{x:[t.x,t.x+e.x*(r/3),n.x,n.x],y:[t.y,t.y+e.y*(r/3),n.y,n.y]},duration:r,startTime:(new Date).getTime(),endOffset:n,rate:i}:null}function n(t,e){return t(e={exports:{}},e.exports),e.exports}function a(t){var e=(t=t||{}).reporter,n=l.getOption(t,"async",!0),i=l.getOption(t,"auto",!0);i&&!n&&(e&&e.warn("Invalid options combination. auto=true and async=false is invalid. Setting async=true."),n=!0);var o,r=v(),a=!1;function s(){for(a=!0;r.size();){var t=r;r=v(),t.process()}a=!1}function c(){o=function(t){return function(t){return setTimeout(t,0)}(t)}(s)}return{add:function(t,e){!a&&i&&n&&0===r.size()&&c(),r.add(t,e)},force:function(t){a||(void 0===t&&(t=n),o&&(function(t){clearTimeout(t)}(o),o=null),t?c():s())}}}var s=n(function(t){(t.exports={}).forEach=function(t,e){for(var n=0;n<t.length;n++){var i=e(t[n]);if(i)return i}}}),y=n(function(t){var e=t.exports={};e.isIE=function(t){return(-1!=(e=navigator.userAgent.toLowerCase()).indexOf("msie")||-1!=e.indexOf("trident")||-1!=e.indexOf(" edge/"))&&(!t||t===function(){for(var t=3,e=document.createElement("div"),n=e.getElementsByTagName("i");e.innerHTML="\x3c!--[if gt IE "+ ++t+"]><i></i><![endif]--\x3e",n[0];);return 4<t?t:void 0}());var e},e.isLegacyOpera=function(){return!!window.opera}}),l=n(function(t){(t.exports={}).getOption=function(t,e,n){var i=t[e];return null!=i||void 0===n?i:n}});function v(){var i={},n=0,o=0,r=0;return{add:function(t,e){e||(e=t,t=0),o<t?o=t:t<r&&(r=t),i[t]||(i[t]=[]),i[t].push(e),n++},process:function(){for(var t=r;t<=o;t++)for(var e=i[t],n=0;n<e.length;n++)(0,e[n])()},size:function(){return n}}}var c="_erd";function x(t){return t[c]}function z(t){var x=(t=t||{}).reporter,z=t.batchProcessor,_=t.stateHandler.getState,S=t.idHandler;if(!z)throw Error("Missing required dependency: batchProcessor");if(!x)throw Error("Missing required dependency: reporter.");var E=function(){var t=document.createElement("div");t.style.cssText="position: absolute; width: 1000px; height: 1000px; visibility: hidden; margin: 0; padding: 0;";var e=document.createElement("div");e.style.cssText="position: absolute; width: 500px; height: 500px; overflow: scroll; visibility: none; top: -1500px; left: -1500px; visibility: hidden; margin: 0; padding: 0;",e.appendChild(t),document.body.insertBefore(e,document.body.firstChild);var n=500-e.clientWidth,i=500-e.clientHeight;return document.body.removeChild(e),{width:n,height:i}}(),R="erd_scroll_detection_container";function D(t,e,n){if(t.addEventListener)t.addEventListener(e,n);else{if(!t.attachEvent)return x.error("[scroll] Don't know how to add event listeners.");t.attachEvent("on"+e,n)}}function n(t,e,n){if(t.removeEventListener)t.removeEventListener(e,n);else{if(!t.detachEvent)return x.error("[scroll] Don't know how to remove event listeners.");t.detachEvent("on"+e,n)}}function C(t){return _(t).container.childNodes[0].childNodes[0].childNodes[0]}function P(t){return _(t).container.childNodes[0].childNodes[0].childNodes[1]}return function(i,t){if(!document.getElementById(i)){var e=t+"_animation",n=t+"_animation_active",o="/* Created by the element-resize-detector library. */\n";o+="."+t+" > div::-webkit-scrollbar { display: none; }\n\n",o+="."+n+" { -webkit-animation-duration: 0.1s; animation-duration: 0.1s; -webkit-animation-name: "+e+"; animation-name: "+e+"; }\n",o+="@-webkit-keyframes "+e+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }\n",function(t,e){e=e||function(t){document.head.appendChild(t)};var n=document.createElement("style");n.innerHTML=t,n.id=i,e(n)}(o+="@keyframes "+e+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }")}}("erd_scroll_detection_scrollbar_style",R),{makeDetectable:function(a,g,t){function v(){if(a.debug){var t=Array.prototype.slice.call(arguments);if(t.unshift(S.get(g),"Scroll: "),x.log.apply)x.log.apply(null,t);else for(var e=0;e<t.length;e++)x.log(t[e])}}function s(t){var e=_(t).container.childNodes[0],n=window.getComputedStyle(e);return!n.width||-1==n.width.indexOf("px")}function e(){var t=window.getComputedStyle(g),e={};return e.position=t.position,e.width=g.offsetWidth,e.height=g.offsetHeight,e.top=t.top,e.right=t.right,e.bottom=t.bottom,e.left=t.left,e.widthCSS=t.width,e.heightCSS=t.height,e}function n(){if(v("storeStyle invoked."),_(g)){var t=e();_(g).style=t}else v("Aborting because element has been uninstalled")}function c(t,e,n){_(t).lastWidth=e,_(t).lastHeight=n}function l(){return 2*E.width+1}function u(){return 2*E.height+1}function d(t){return t+10+l()}function h(t){return t+10+u()}function f(t,e,n){var i=C(t),o=P(t),r=d(e),a=h(n),s=function(t){return 2*t+l()}(e),c=function(t){return 2*t+u()}(n);i.scrollLeft=r,i.scrollTop=a,o.scrollLeft=s,o.scrollTop=c}function y(){var t=_(g).container;if(!t){(t=document.createElement("div")).className=R,t.style.cssText="visibility: hidden; display: inline; width: 0px; height: 0px; z-index: -1; overflow: hidden; margin: 0; padding: 0;",function(t){t.className+=" "+R+"_animation_active"}(_(g).container=t),g.appendChild(t);var e=function(){_(g).onRendered&&_(g).onRendered()};D(t,"animationstart",e),_(g).onAnimationStart=e}return t}function i(){if(v("Injecting elements"),_(g)){!function(){var t=_(g).style;if("static"===t.position){g.style.position="relative";var e=function(t,e,n,i){var o=n[i];"auto"!==o&&"0"!==o.replace(/[^-\d\.]/g,"")&&(t.warn("An element that is positioned static has style."+i+"="+o+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+i+" will be set to 0. Element: ",e),e.style[i]=0)};e(x,g,t,"top"),e(x,g,t,"right"),e(x,g,t,"bottom"),e(x,g,t,"left")}}();var t=_(g).container;t||(t=y());var e,n,i,o,r=E.width,a=E.height,s="position: absolute; flex: none; overflow: hidden; z-index: -1; visibility: hidden; left: "+(e=(e=-(1+r))?e+"px":"0")+"; top: "+(n=(n=-(1+a))?n+"px":"0")+"; right: "+(o=(o=-r)?o+"px":"0")+"; bottom: "+(i=(i=-a)?i+"px":"0")+";",c=document.createElement("div"),l=document.createElement("div"),u=document.createElement("div"),d=document.createElement("div"),h=document.createElement("div"),f=document.createElement("div");c.dir="ltr",c.style.cssText="position: absolute; flex: none; overflow: hidden; z-index: -1; visibility: hidden; width: 100%; height: 100%; left: 0px; top: 0px;",l.className=c.className=R,l.style.cssText=s,u.style.cssText="position: absolute; flex: none; overflow: scroll; z-index: -1; visibility: hidden; width: 100%; height: 100%;",d.style.cssText="position: absolute; left: 0; top: 0;",h.style.cssText="position: absolute; flex: none; overflow: scroll; z-index: -1; visibility: hidden; width: 100%; height: 100%;",f.style.cssText="position: absolute; width: 200%; height: 200%;",u.appendChild(d),h.appendChild(f),l.appendChild(u),l.appendChild(h),c.appendChild(l),t.appendChild(c),D(u,"scroll",p),D(h,"scroll",m),_(g).onExpandScroll=p,_(g).onShrinkScroll=m}else v("Aborting because element has been uninstalled");function p(){_(g).onExpand&&_(g).onExpand()}function m(){_(g).onShrink&&_(g).onShrink()}}function o(){function i(t,e,n){var i=function(t){return C(t).childNodes[0]}(t),o=d(e),r=h(n);i.style.width=o+"px",i.style.height=r+"px"}function n(t){var e=g.offsetWidth,n=g.offsetHeight;v("Storing current size",e,n),c(g,e,n),z.add(0,function(){_(g)?o()?(a.debug&&(g.offsetWidth===e&&g.offsetHeight===n||x.warn(S.get(g),"Scroll: Size changed before updating detector elements.")),i(g,e,n)):v("Aborting because element container has not been initialized"):v("Aborting because element has been uninstalled")}),z.add(1,function(){_(g)?o()?f(g,e,n):v("Aborting because element container has not been initialized"):v("Aborting because element has been uninstalled")}),t&&z.add(2,function(){_(g)?o()?t():v("Aborting because element container has not been initialized"):v("Aborting because element has been uninstalled")})}function o(){return!!_(g).container}function r(){v("notifyListenersIfNeeded invoked");var t=_(g);return void 0===_(g).lastNotifiedWidth&&t.lastWidth===t.startSize.width&&t.lastHeight===t.startSize.height?v("Not notifying: Size is the same as the start size, and there has been no notification yet."):t.lastWidth===t.lastNotifiedWidth&&t.lastHeight===t.lastNotifiedHeight?v("Not notifying: Size already notified"):(v("Current size not notified, notifying..."),t.lastNotifiedWidth=t.lastWidth,t.lastNotifiedHeight=t.lastHeight,void M(_(g).listeners,function(t){t(g)}))}function t(){if(v("Scroll detected."),s(g))v("Scroll event fired while unrendered. Ignoring...");else{var t=g.offsetWidth,e=g.offsetHeight;t!==_(g).lastWidth||e!==_(g).lastHeight?(v("Element size changed."),n(r)):v("Element size has not changed ("+t+"x"+e+").")}}if(v("registerListenersAndPositionElements invoked."),_(g)){_(g).onRendered=function(){if(v("startanimation triggered."),s(g))v("Ignoring since element is still unrendered...");else{v("Element rendered.");var t=C(g),e=P(g);0!==t.scrollLeft&&0!==t.scrollTop&&0!==e.scrollLeft&&0!==e.scrollTop||(v("Scrollbars out of sync. Updating detector elements..."),n(r))}},_(g).onExpand=t,_(g).onShrink=t;var e=_(g).style;i(g,e.width,e.height)}else v("Aborting because element has been uninstalled")}function r(){if(v("finalizeDomMutation invoked."),_(g)){var t=_(g).style;c(g,t.width,t.height),f(g,t.width,t.height)}else v("Aborting because element has been uninstalled")}function p(){t(g)}function m(){v("Installing..."),_(g).listeners=[],function(){var t=e();_(g).startSize={width:t.width,height:t.height},v("Element start size",_(g).startSize)}(),z.add(0,n),z.add(1,i),z.add(2,o),z.add(3,r),z.add(4,p)}var b,w;t||(t=g,g=a,a=null),a=a||{},v("Making detectable..."),(w=b=g)!==w.ownerDocument.body&&!w.ownerDocument.body.contains(w)||null===window.getComputedStyle(b)?(v("Element is detached"),y(),v("Waiting until element is attached..."),_(g).onRendered=function(){v("Element is now attached"),m()}):m()},addListener:function(t,e){if(!_(t).listeners.push)throw Error("Cannot add listener to an element that is not detectable.");_(t).listeners.push(e)},uninstall:function(t){var e=_(t);e&&(e.onExpandScroll&&n(C(t),"scroll",e.onExpandScroll),e.onShrinkScroll&&n(P(t),"scroll",e.onShrinkScroll),e.onAnimationStart&&n(e.container,"animationstart",e.onAnimationStart),e.container&&t.removeChild(e.container))}}}var _={initState:function(t){return t[c]={},x(t)},getState:x,cleanState:function(t){delete t[c]}},M=s.forEach,S=s.forEach;function E(t){return Array.isArray(t)||void 0!==t.length}function R(t){if(Array.isArray(t))return t;var e=[];return S(t,function(t){e.push(t)}),e}function D(t){return t&&1===t.nodeType}function C(t,e,n){var i=t[e];return null==i&&void 0!==n?n:i}var P=function(e){var d;if((e=e||{}).idHandler)d={get:function(t){return e.idHandler.get(t,!0)},set:e.idHandler.set};else{var t=function(t){var i=t.idGenerator,o=t.stateHandler.getState;return{get:function(t){var e=o(t);return e&&void 0!==e.id?e.id:null},set:function(t){var e=o(t);if(!e)throw Error("setId required the element to have a resize detection state.");var n=i.generate();return e.id=n}}}({idGenerator:function(){var t=1;return{generate:function(){return t++}}}(),stateHandler:_});d=t}var h=e.reporter;h||(h=function(t){function e(){}var n={log:e,warn:e,error:e};if(!t&&window.console){var i=function(t,n){t[n]=function(){var t=console[n];if(t.apply)t.apply(console,arguments);else for(var e=0;e<arguments.length;e++)t(arguments[e])}};i(n,"log"),i(n,"warn"),i(n,"error")}return n}(!1===h));var n=C(e,"batchProcessor",a({reporter:h})),f={};f.callOnAdd=!!C(e,"callOnAdd",!0),f.debug=!!C(e,"debug",!1);var p,m=function(i){var o={};function r(t){var e=i.get(t);return void 0===e?[]:o[e]||[]}return{get:r,add:function(t,e){var n=i.get(t);o[n]||(o[n]=[]),o[n].push(e)},removeListener:function(t,e){for(var n=r(t),i=0,o=n.length;i<o;++i)if(n[i]===e){n.splice(i,1);break}},removeAllListeners:function(t){var e=r(t);e&&(e.length=0)}}}(d),g=function(t){var n=t.stateHandler.getState;return{isDetectable:function(t){var e=n(t);return e&&!!e.isDetectable},markAsDetectable:function(t){n(t).isDetectable=!0},isBusy:function(t){return!!n(t).busy},markBusy:function(t,e){n(t).busy=!!e}}}({stateHandler:_}),i=C(e,"strategy","object"),o={reporter:h,batchProcessor:n,stateHandler:_,idHandler:d};if("scroll"===i&&(y.isLegacyOpera()?(h.warn("Scroll strategy is not supported on legacy Opera. Changing to object strategy."),i="object"):y.isIE(9)&&(h.warn("Scroll strategy is not supported on IE9. Changing to object strategy."),i="object")),"scroll"===i)p=z(o);else{if("object"!==i)throw Error("Invalid strategy name: "+i);p=function(t){var s=(t=t||{}).reporter,c=t.batchProcessor,l=t.stateHandler.getState;if(!s)throw Error("Missing required dependency: reporter.");function i(t){return l(t).object}return{makeDetectable:function(t,e,n){n||(n=e,e=t,t=null),t=t||{},y.isIE(8)?n(e):function(n,i){var o=!1,r=window.getComputedStyle(n),t=n.offsetWidth,e=n.offsetHeight;function a(){function t(){if("static"===r.position){n.style.position="relative";var t=function(t,e,n,i){var o=n[i];"auto"!==o&&"0"!==o.replace(/[^-\d\.]/g,"")&&(t.warn("An element that is positioned static has style."+i+"="+o+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+i+" will be set to 0. Element: ",e),e.style[i]=0)};t(s,n,r,"top"),t(s,n,r,"right"),t(s,n,r,"bottom"),t(s,n,r,"left")}}""!==r.position&&(t(),o=!0);var e=document.createElement("object");e.style.cssText="display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; padding: 0; margin: 0; opacity: 0; z-index: -1000; pointer-events: none;",e.tabIndex=-1,e.type="text/html",e.setAttribute("aria-hidden","true"),e.onload=function(){o||t(),function t(e,n){e.contentDocument?n(e.contentDocument):setTimeout(function(){t(e,n)},100)}(this,function(t){i(n)})},y.isIE()||(e.data="about:blank"),n.appendChild(e),l(n).object=e,y.isIE()&&(e.data="about:blank")}l(n).startSize={width:t,height:e},c?c.add(a):a()}(e,n)},addListener:function(t,e){if(!i(t))throw Error("Element is not detectable by this strategy.");function n(){e(t)}y.isIE(8)?(l(t).object={proxy:n},t.attachEvent("onresize",n)):i(t).contentDocument.defaultView.addEventListener("resize",n)},uninstall:function(t){y.isIE(8)?t.detachEvent("onresize",l(t).object.proxy):t.removeChild(i(t)),delete l(t).object}}}(o)}var v={};return{listenTo:function(t,i,o){function r(e){var t=m.get(e);S(t,function(t){t(e)})}function a(t,e,n){m.add(e,n),t&&n(e)}if(o||(o=i,i=t,t={}),!i)throw Error("At least one element required.");if(!o)throw Error("Listener required.");if(D(i))i=[i];else{if(!E(i))return h.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");i=R(i)}var s=0,c=C(t,"callOnAdd",f.callOnAdd),l=C(t,"onReady",function(){}),u=C(t,"debug",f.debug);S(i,function(t){_.getState(t)||(_.initState(t),d.set(t));var n=d.get(t);if(u&&h.log("Attaching listener to element",n,t),!g.isDetectable(t))return u&&h.log(n,"Not detectable."),g.isBusy(t)?(u&&h.log(n,"System busy making it detectable"),a(c,t,o),v[n]=v[n]||[],void v[n].push(function(){++s===i.length&&l()})):(u&&h.log(n,"Making detectable..."),g.markBusy(t,!0),p.makeDetectable({debug:u},t,function(t){if(u&&h.log(n,"onElementDetectable"),_.getState(t)){g.markAsDetectable(t),g.markBusy(t,!1),p.addListener(t,r),a(c,t,o);var e=_.getState(t);e&&e.startSize&&(e.startSize.width===t.offsetWidth&&e.startSize.height===t.offsetHeight||r(t)),v[n]&&S(v[n],function(t){t()})}else u&&h.log(n,"Element uninstalled before being detectable.");delete v[n],++s===i.length&&l()}));u&&h.log(n,"Already detecable, adding listener."),a(c,t,o),s++}),s===i.length&&l()},removeListener:m.removeListener,removeAllListeners:m.removeAllListeners,uninstall:function(t){if(!t)return h.error("At least one element is required.");if(D(t))t=[t];else{if(!E(t))return h.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");t=R(t)}S(t,function(t){m.removeAllListeners(t),p.uninstall(t),_.cleanState(t)})}}}({strategy:"scroll"});function I(t){var e=window.getComputedStyle(t)||{},n=t.offsetWidth||0,i=t.offsetHeight||0;return e.paddingLeft&&(n-=parseInt(e.paddingLeft,10)),e.paddingRight&&(n-=parseInt(e.paddingRight,10)),e.borderLeftWidth&&(n-=parseInt(e.borderLeftWidth,10)),e.borderRightWidth&&(n-=parseInt(e.borderRightWidth,10)),e.paddingTop&&(i-=parseInt(e.paddingTop,10)),e.paddingBottom&&(i-=parseInt(e.paddingBottom,10)),e.borderTopWidth&&(i-=parseInt(e.borderTopWidth,10)),e.borderBottomWidth&&(i-=parseInt(e.borderBottomWidth,10)),{width:n,height:i}}function T(t,e){return t===e||!(!t||!e||t.width!==e.width||t.height!==e.height)}var O=function(n){function t(t){var e;return(e=n.call(this,t)||this).state={size:null,prevWidth:null,prevHeight:null},e.resizeRef=b.createRef(),e}i(t,n),t.getDerivedStateFromProps=function(t,e){var n=t.width,i=t.height,o=e.prevWidth,r=e.prevHeight,a=null;if(n!==o||i!==r){var s=null;"number"==typeof n&&"number"==typeof i&&(s={width:n,height:i}),a=a||{},T(s,e.size)||(a.size=s),n!==o&&(a.prevWidth=n),i!==r&&(a.prevHeight=i)}return a};var e=t.prototype;return e.componentDidMount=function(){var t=this.state.size;t?this.props.onResize(t):this.calculateSize()},e.componentDidUpdate=function(t,e){var n=this.state.size;n!==e.size&&(n?this.props.onResize(n):this.calculateSize())},e.getSize=function(){return this.state.size},e.calculateSize=function(){var o=this;this.setState(function(t){var e=o.resizeRef.current;if(!e)return null;var n=t.size,i=I(e);return T(i,n)?null:{size:i}})},e.render=function(){var t=this.props,e=t.width,n=t.height,i=d(t,["width","height","visibleRect","onResize","connectWithPad"]),o=this.state.size,r={position:"relative"};o&&(r.width=o.width,r.height=o.height),i.style=w({},r,i.style);var a=i.children;return"function"==typeof a&&(a=a(this)),"number"==typeof e&&"number"==typeof n||(a=b.createElement("div",{ref:this.resizeRef,style:{position:"absolute",width:"number"==typeof e?e:"auto",height:"number"==typeof n?n:"auto"}},a)),i.children=a,b.createElement("div",i)},t}(b.Component);O.defaultProps={width:null,height:null,visibleRect:{x:0,y:0,width:0,height:0},onResize:function(){},connectWithPad:!0};var L=function(n){function t(t){var e;return(e=n.call(this,t)||this).elemRef=b.createRef(),e}i(t,n);var e=t.prototype;return e.componentDidMount=function(){this._checkResizeNode()},e.componentDidUpdate=function(t){var e=this.props;e.width===t.width&&e.height===t.height||this._checkResizeNode()},e.componentWillUnmount=function(){this._detachResizeNode()},e.getSize=function(){return this.elemRef.current.getSize()},e.calculateSize=function(){return this.elemRef.current.calculateSize()},e._checkResizeNode=function(){var t=this.props;"number"==typeof t.width&&"number"==typeof t.height?this._detachResizeNode():this._attachResizeNode(this.elemRef.current.resizeRef.current)},e._attachResizeNode=function(t){var e=this;this._resizeNode||P.listenTo(this._resizeNode=t,function(){return e.calculateSize()})},e._detachResizeNode=function(){this._resizeNode&&(P.uninstall(this._resizeNode),this._resizeNode=void 0)},e.render=function(){return b.createElement(O,w({ref:this.elemRef},this.props))},t}(b.Component);L.defaultProps=w({},O.defaultProps);var k=.04,H=function(n){function t(t){var e;return(e=n.call(this,t)||this)._onDragStart=function(t){var r=t.velocity;e.setState(function(t,e){var n=t.contentOffset,i=e.directionalLockEnabled?Math.abs(r.y)<Math.abs(r.x)?{x:1,y:0}:{x:0,y:1}:{x:1,y:1},o={x:i.x*r.x,y:i.y*r.y};return{contentOffset:w({},n),contentVelocity:o,drag:{direction:i,startOffset:n},deceleration:null}})},e._onDragMove=function(t){var r=t.translation,a=t.interval;e.setState(function(t,e){var n=t.contentOffset,i=t.drag,o=function t(e,n,i,o,r){if(r){var a="y"===r?["y","height","width"]:["x","width","height"],s=a[0],c=a[1],l=a[2],u=e[s],d=Math.min(i[c]-o[c],0),h=.5*Math.min(i[c],i[l]);return 0<u?n[s]?h*(1-h/(h+u)):0:u<d?n[s]?d-h*(1-h/(h-u+d)):d:u}var f={x:t(e,n,i,o,"x"),y:t(e,n,i,o,"y")};return f.x===e.x&&f.y===e.y?e:f}({x:i.startOffset.x+i.direction.x*r.x,y:i.startOffset.y+i.direction.y*r.y},{x:e.alwaysBounceX,y:e.alwaysBounceY},t.size,t.contentSize);return{contentOffset:o,contentVelocity:{x:(o.x-n.x)/a,y:(o.y-n.y)/a}}})},e._onDragEnd=function(){e.setState(function(t,e){var n=t.contentOffset,i=t.size,o=e.pagingEnabled,r=function t(e,n,i,o){if(o){var r="y"===o?["y","height"]:["x","width"],a=r[0];if(!e[a])return 0;var s=e[a]<0?-1:1;return s*Math.min(s*e[a],Math.sqrt(.5*n[r[1]]*2*s*i[a]))}"number"==typeof i&&(i=f(i,e));var c={x:t(e,n,i,"x"),y:t(e,n,i,"y")};return c.x===e.x&&c.y===e.y?e:c}(t.contentVelocity,i,k),a=o?k:.004,s=m(n,r,i,o,a);return{contentOffset:w({},n),contentVelocity:r,drag:null,deceleration:g(n,r,s,a)}})},e._onDragCancel=function(){e.setState(function(t,e){var n=t.contentOffset,i=t.contentVelocity,o=m(t.drag.startOffset,{x:0,y:0},t.size,e.pagingEnabled,k);return{contentOffset:w({},n),drag:null,deceleration:g(n,i,o,k)}})},e.state={contentOffset:{x:0,y:0},contentVelocity:{x:0,y:0},size:{width:t.width,height:t.height},contentSize:{width:0,height:0},drag:null,deceleration:null},e.elemRef=b.createRef(),e}i(t,n);var e=t.prototype;return e.componentDidUpdate=function(t,e){var n=this.props,i=n.width,o=n.height,r=n.pagingEnabled,a=n.onScroll,s=n.onDragStart,c=n.onDragEnd,l=n.onDecelerationStart,u=n.onDecelerationEnd,d=n.onContentResize,h=this.state,f=h.contentOffset,p=h.contentSize,m=h.drag,g=h.deceleration;i===t.width&&o===t.height||this._setStateWithScroll({size:{width:i,height:o}}),r!==t.pagingEnabled&&r&&this._setStateWithScroll(null),f!==e.contentOffset&&(a(this._getPadEvent()),this._adjustContentOffsetIfNeeded(),g&&this._requestDecelerationTimer()),p!==e.contentSize&&d(p),m!==e.drag&&(e.drag?m||c(this._getPadEvent()):s(this._getPadEvent())),g!==e.deceleration&&(e.deceleration?g||u(this._getPadEvent()):l(this._getPadEvent()))},e.componentWillUnmount=function(){this._cancelDecelerationTimer()},e.getSize=function(){return this.state.size},e.getContentSize=function(){return this.state.contentSize},e.getContentOffset=function(){return this.state.contentOffset},e.getContentVelocity=function(){return this.state.contentVelocity},e.isDragging=function(){return!!this.state.drag},e.isDecelerating=function(){return!!this.state.deceleration},e.getVisibleRect=function(){return this._getVisibleRect(this.state)},e.setContentSize=function(t){this._setStateWithScroll({contentSize:t})},e.scrollToRect=function(t){var e=this,n=t.rect,i=t.align,o=void 0===i?"auto":i,r=t.animated;this._setContentOffset(function(t){return function t(e,n,i,o){if(o){var r="y"===o?["y","height"]:["x","width"],a=r[0],s=r[1],c=-e[a],l=n[s]-e[s];if("auto"===i[a]){var u=l<0?-1:1;c+=u*Math.max(0,Math.min(u*(-n[a]-c),u*l))}else"start"===i[a]?i[a]=0:"center"===i[a]?i[a]=.5:"end"===i[a]&&(i[a]=1),("number"!=typeof i[a]||isNaN(i[a]))&&(i[a]=.5),c+=i[a]*l;return c}return"object"!=typeof i&&(i={x:i,y:i}),{x:t(e,n,i,"x"),y:t(e,n,i,"y")}}(n,e._getVisibleRect(t),o)},void 0===r||r)},e.scrollTo=function(t){var e=t.animated;this._setContentOffset(t.offset,void 0===e||e)},e._getVisibleRect=function(t){var e=t.contentOffset,n=t.size;return{x:-e.x,y:-e.y,width:n.width,height:n.height}},e._getPadEvent=function(){var t=this.state;return{contentOffset:t.contentOffset,contentVelocity:t.contentVelocity,size:t.size,contentSize:t.contentSize,dragging:!!t.drag,decelerating:!!t.deceleration}},e._setContentOffset=function(u,d){this.setState(function(t,e){if("function"==typeof u&&(u=u(t,e)),!u)return null;var n=t.contentOffset,i=t.contentVelocity,o=t.size,r=t.drag,a=t.deceleration,s=e.pagingEnabled,c={};if(r||!d)c.contentOffset=u,r&&(c.drag=w({},r,{startOffset:{x:r.startOffset.x+u.x-n.x,y:r.startOffset.y+u.y-n.y}})),a&&(c.deceleration=g(u,i,{x:a.endOffset.x+u.x-n.x,y:a.endOffset.y+u.y-n.y},a.rate));else{var l=m(u,{x:0,y:0},o,s,.04);c.contentOffset=w({},n),c.deceleration=g(n,i,l,.04)}return c})},e._setStateWithScroll=function(r){this.setState(function(t,e){var n=t.contentOffset,i=t.contentVelocity;if(t.drag||t.deceleration)return r;var o=m(n,i,t.size,e.pagingEnabled,.04);return w({},r,{contentOffset:w({},n),deceleration:g(n,i,o,.04)})})},e._adjustContentOffsetIfNeeded=function(){this.setState(function(t,e){var n=t.contentOffset,i=t.contentVelocity,o=t.size,r=t.contentSize,a=t.drag,s=t.deceleration,c=e.pagingEnabled;if(n===p(n,o,r,!1))return null;var l;s?s.endOffset===p(s.endOffset,o,r,!1)||(l=p(l=s.rate!==k?m(n,i,o,c,.04):s.endOffset,o,r,c)):a||(l=p(n,o,r,c));return l?{contentOffset:w({},n),deceleration:g(n,i,l,.04)}:null})},e._requestDecelerationTimer=function(){var t=this;this._decelerationTimer&&r(this._decelerationTimer),this._decelerationTimer=o(function(){t._decelerationTimer=void 0,t._decelerate()})},e._cancelDecelerationTimer=function(){this._decelerationTimer&&(r(this._decelerationTimer),this._decelerationTimer=void 0)},e._decelerate=function(){this.setState(function(t){var e=t.deceleration;if(!e)return null;var n=(new Date).getTime();if(e.startTime+e.duration<=n)return{contentOffset:e.endOffset,contentVelocity:{x:0,y:0},deceleration:null};var i=function t(e,n,i){if(i){var o,r=("y"===i?["y"]:["x"])[0],a=e.points,s=e.duration,c=Math.max(0,Math.min((n-e.startTime)/s,1)),l=a[r],u=l[0],d=l[1],h=l[2],f=l[3],p=u-3*(u-d)*c+3*(u-2*d+h)*Math.pow(c,2)-(u-3*d+3*h-f)*Math.pow(c,3),m=(-3*(u-d)+6*(u-2*d+h)*c-3*(u-3*d+3*h-f)*Math.pow(c,2))/s;return(o={})[r+"Offset"]=p,o[r+"Velocity"]=m,o}return w({},t(e,n,"x"),t(e,n,"y"))}(e,n);return{contentOffset:{x:i.xOffset,y:i.yOffset},contentVelocity:{x:i.xVelocity,y:i.yVelocity}}})},e.render=function(){var e=this,t=this.props,n=d(t,["width","height","pagingEnabled","directionalLockEnabled","alwaysBounceX","alwaysBounceY","onScroll","onDragStart","onDragEnd","onDecelerationStart","onDecelerationEnd","onContentResize"]),i=this.state,o=i.size,r=i.contentSize,a=i.contentOffset,s=n.children;"function"==typeof s&&(s=s(this)),b.isValidElement(s)&&s.props.connectWithPad||(s=b.createElement(L,null,s));var c=s.props.onResize,l={ref:s.ref,style:h.create(w({position:"relative",width:r.width,height:r.height,transformTranslate:[a.x,a.y]},s.props.style)),visibleRect:this.getVisibleRect(),onResize:function(t){e._setStateWithScroll({contentSize:t}),c(t)}};return s=b.cloneElement(s,l),n.children=s,n.onStart=this._onDragStart,n.onMove=this._onDragMove,n.onEnd=this._onDragEnd,n.onCancel=this._onDragCancel,n.style=w({overflow:"hidden",position:"relative",width:o.width,height:o.height},n.style),b.createElement(u,w({},n,{ref:this.elemRef}))},t}(b.Component);function W(t,e,n){if(n){var i,o="y"===n?["y","height"]:["x","width"],r=o[0],a=o[1],s=Math.max(t[r],e[r]),c=Math.min(t[r]+t[a],e[r]+e[a]);return(i={})[r]=s-t[r],i[a]=Math.max(0,c-s),i}return w({},W(t,e,"x"),W(t,e,"y"))}function N(t,e,n){if(n){var i="y"===n?["y","height"]:["x","width"],o=i[0],r=i[1],a=t[o]-e[o];return-.25*e[r]<=a+t[r]&&a<=1.25*e[r]}return N(t,e,"x")&&N(t,e,"y")}function A(){}H.defaultProps=w({},u.defaultProps,{width:0,height:0,pagingEnabled:!1,directionalLockEnabled:!1,alwaysBounceX:!0,alwaysBounceY:!0,onScroll:function(){},onDragStart:function(){},onDragEnd:function(){},onDecelerationStart:function(){},onDecelerationEnd:function(){},onContentResize:function(){}});var V=function(n){function t(t){var e;return(e=n.call(this,t)||this).state=j(t),e}i(t,n);var e=t.prototype;return e.componentDidMount=function(){var t=this.state.size;t&&this.props.onResize(t)},e.componentDidUpdate=function(t,e){var n=this.props,i=n.onResize,o=this.state.size;t.direction===n.direction&&t.width===n.width&&t.height===n.height&&t.rowSpacing===n.rowSpacing&&t.columnSpacing===n.columnSpacing&&t.itemCount===n.itemCount&&t.itemWidth===n.itemWidth&&t.itemHeight===n.itemHeight||this._layout(),e.size!==o&&o&&i(o)},e.getSize=function(){return this.state.size},e.getCount=function(){return this.state.count},e.getItemRect=function(t){var e=t.itemIndex,n=t.rowIndex,i=t.columnIndex,o=this.state,r=o.layoutList;void 0!==n&&void 0!==i&&(e=function(t,e,n){var i="x"===n?["column","row"]:["row","column"],o=i[1];return t[o]+t[i[0]]*e[o]}({row:n,column:i},o.count,this.props.direction));var a=r[e];return a&&a.rect||null},e._layout=function(){this.setState(function(t,e){var n=t.size,i={},o=j(e);return i.count=o.count,i.layoutList=o.layoutList,T(o.size,n)||(i.size=o.size),i})},e._renderItem=function(t){var e,n,i=t.itemIndex,o=t.rect,r=t.visibleRect,a=t.needsRender,s=t.Item,c=(0,this.props.renderItem)(t),l={position:"absolute",left:o.x,top:o.y,width:o.width,height:o.height};if(b.isValidElement(c)&&c.type===s&&(c.props.style&&(l=w({},l,c.props.style)),e=c.props.forceRender,n=c.key,c=c.props.children),n||(n=""+i),!e&&!a)return null;b.isValidElement(c)&&c.props.connectWithPad||(c=b.createElement(O,null,c)),c.props.style&&(l=w({},l,c.props.style));var u={key:n,ref:c.ref,style:l,visibleRect:r};return"number"!=typeof c.props.width&&(u.width=o.width),"number"!=typeof c.props.height&&(u.height=o.height),b.cloneElement(c,u)},e.render=function(){var t=this.props,e=t.visibleRect,n=d(t,["direction","width","height","rowSpacing","columnSpacing","itemCount","itemWidth","itemHeight","renderItem","visibleRect","onResize","connectWithPad"]),i=this.state,o=i.size,r=i.layoutList,a={position:"relative"};o&&(a.width=o.width,a.height=o.height),n.style=w({},a,n.style);for(var s=[],c=0;c<r.length;c++){var l=r[c],u=w({},l,{itemIndex:c,visibleRect:W(l.rect,e),needsRender:N(l.rect,e),Item:A});s.push(this._renderItem(u))}return n.children=s,b.createElement("div",n)},t}(b.Component);function j(t){var e,n,i=t.itemCount,o={width:t.itemWidth,height:t.itemHeight},r={row:t.rowSpacing,column:t.columnSpacing},a="x"===t.direction?["y","x","height","width","column","row"]:["x","y","width","height","row","column"],s=a[0],c=a[1],l=a[2],u=a[3],d=a[4],h=a[5],f={width:t.width,height:t.height}[l],p=0,m=0,g=0,v=[];"number"!=typeof f?(g=i,0===o[l]?f=0:(f=i*o[l],1<i&&(f+=(i-1)*r[h]))):0===o[l]?g=i:(g=1,o[l]<f?g+=Math.floor((f-o[l])/(o[l]+r[h])):f=o[l]),0<g&&(m=Math.ceil(i/g));for(var y=0;y<m;y++){0<y&&(p+=r[d]);for(var b=0;b<g;b++){var w,x,z=b+y*g,_=0;if(1<g&&(_+=Math.round(b*((f-o[l])/(g-1)))),i<=z)break;v.push(((x={rect:(w={},w[s]=_,w[c]=p,w[l]=o[l],w[u]=o[u],w)})[d+"Index"]=y,x[h+"Index"]=b,x))}p+=o[u]}return{size:(e={},e[l]=f,e[u]=p,e),count:(n={},n[d]=m,n[h]=g,n),layoutList:v}}function q(){}V.defaultProps={direction:"y",width:null,height:null,rowSpacing:0,columnSpacing:0,itemCount:0,itemWidth:0,itemHeight:0,renderItem:function(){return null},visibleRect:{x:0,y:0,width:0,height:0},onResize:function(){},connectWithPad:!0};var B=function(o){function t(t){var e,n={},i={};return(e=o.call(this,t)||this).state=w({},U(t,n,i),{itemHashDict:n,itemSizeDict:i}),e}i(t,o);var e=t.prototype;return e.componentDidMount=function(){var t=this.state.size;t&&this.props.onResize(t),this._updateItemHashDict()},e.componentDidUpdate=function(t,e){var n=this.props,i=n.onResize,o=this.state,r=o.size;n.direction===t.direction&&n.width===t.width&&n.height===t.height&&n.spacing===t.spacing&&n.itemCount===t.itemCount&&n.estimatedItemWidth===t.estimatedItemWidth&&n.estimatedItemHeight===t.estimatedItemHeight&&o.itemHashDict===e.itemHashDict&&o.itemSizeDict===e.itemSizeDict||this._layout(),e.size!==r&&r&&i(r),this._updateItemHashDict()},e.getSize=function(){return this.state.size},e.getItemRect=function(t){var e=this.state.layoutList[t.itemIndex];return e&&e.rect||null},e._layout=function(){this.setState(function(t,e){var n=t.size,i={},o=U(e,t.itemHashDict,t.itemSizeDict);return i.fixed=o.fixed,i.layoutList=o.layoutList,T(o.size,n)||(i.size=o.size),i})},e._updateItemHashDict=function(){var n=this;this.setState(function(t){if(!n._itemHashDict)return null;var e=w({},t.itemHashDict,n._itemHashDict);return n._itemHashDict=void 0,{itemHashDict:e}})},e._renderItem=function(t){var e,i,n,o=this,r=this.state,a=r.fixed,s=r.itemHashDict,c=r.itemSizeDict,l=t.itemIndex,u=t.rect,d=t.visibleRect,h=t.needsRender,f=t.Item,p=(0,this.props.renderItem)(t),m={position:"absolute",left:u.x,top:u.y,width:u.width,height:u.height};if(b.isValidElement(p)&&p.type===f&&(p.props.style&&(m=w({},m,p.props.style)),e=p.props.forceRender,i=p.props.hash,n=p.key,p=p.props.children),n||(n=""+l),void 0===i&&(i=n),s[l]!==i&&(this._itemHashDict||(this._itemHashDict={}),this._itemHashDict[l]=i),!e&&!h)return null;b.isValidElement(p)&&p.props.connectWithPad||(p=b.createElement(O,null,p)),p.props.style&&(m=w({},m,p.props.style));var g=p.props.onResize,v={key:n,ref:p.ref,style:m,visibleRect:d,onResize:function(n){o.setState(function(t){var e;return{itemSizeDict:w({},t.itemSizeDict,(e={},e[i]=n,e))}}),g(n)}},y=c[i];return y?("number"!=typeof p.props.width&&(v.width=y.width),"number"!=typeof p.props.height&&(v.height=y.height)):("number"==typeof a.height&&"number"!=typeof p.props.height&&(v.height=a.height),"number"==typeof a.width&&"number"!=typeof p.props.width&&(v.width=a.width)),b.cloneElement(p,v)},e.render=function(){var t=this.props,e=t.visibleRect,n=d(t,["direction","width","height","spacing","itemCount","estimatedItemWidth","estimatedItemHeight","renderItem","visibleRect","onResize","connectWithPad"]),i=this.state,o=i.size,r=i.layoutList,a={position:"relative"};o&&(a.width=o.width,a.height=o.height),n.style=w({},a,n.style);for(var s=[],c=0;c<r.length;c++){var l=r[c],u=w({},l,{itemIndex:c,visibleRect:W(l.rect,e),needsRender:N(l.rect,e),Item:q});s.push(this._renderItem(u))}return n.children=s,b.createElement("div",n)},t}(b.Component);function U(t,e,n){var i,o=t.spacing,r=t.itemCount,a={width:t.width,height:t.height},s={width:t.estimatedItemWidth,height:t.estimatedItemHeight},c="x"===t.direction?["y","x","height","width"]:["x","y","width","height"],l=c[0],u=c[1],d=c[2],h=c[3],f=0,p=0,m=[],g={};"number"==typeof a[d]&&(g[d]=a[d]);for(var v=0;v<r;v++){var y,b,w=n[e[v]]||((y={})[d]=void 0===g[d]?s[d]:g[d],y[h]=s[h],y);m.push({rect:(b={},b[l]=0,b[u]=p,b[d]=w[d],b[h]=w[h],b)}),0<w[h]&&(p+=w[h],v<r-1&&(p+=o)),f<w[d]&&(f=w[d])}return{size:(i={},i[d]=f,i[h]=p,i),fixed:g,layoutList:m}}B.defaultProps={direction:"y",width:null,height:null,spacing:0,itemCount:0,estimatedItemWidth:0,estimatedItemHeight:0,renderItem:function(){return null},visibleRect:{x:0,y:0,width:0,height:0},onResize:function(){},connectWithPad:!0};var X=function(n){function t(t){var e;return(e=n.call(this,t)||this).state={size:null,prevWidth:null,prevHeight:null},e.resizeRef=b.createRef(),e}i(t,n),t.getDerivedStateFromProps=function(t,e){var n=t.width,i=t.height,o=e.prevWidth,r=e.prevHeight,a=null;if(n!==o||i!==r){var s=null;"number"==typeof n&&"number"==typeof i&&(s={width:n,height:i}),a=a||{},T(s,e.size)||(a.size=s),n!==o&&(a.prevWidth=n),i!==r&&(a.prevHeight=i)}return a};var e=t.prototype;return e.componentDidMount=function(){var t=this.state.size;t?this.props.onResize(t):this.calculateSize(),this._checkResizeNode()},e.componentDidUpdate=function(t,e){var n=this.props,i=n.onResize,o=this.state.size;n.width===t.width&&n.height===t.height||this._checkResizeNode(),o!==e.size&&(o?i(o):this.calculateSize())},e.componentWillUnmount=function(){this._detachResizeNode()},e.getSize=function(){return this.state.size},e.calculateSize=function(){var o=this;this.setState(function(t){var e=o.resizeRef.current;if(!e)return null;var n=t.size,i=I(e);return T(i,n)?null:{size:i}})},e._checkResizeNode=function(){var t=this.props;"number"==typeof t.width&&"number"==typeof t.height?this._detachResizeNode():this._attachResizeNode(this.resizeRef.current)},e._attachResizeNode=function(t){var e=this;this._resizeNode||P.listenTo(this._resizeNode=t,function(){return e.calculateSize()})},e._detachResizeNode=function(){this._resizeNode&&(P.uninstall(this._resizeNode),this._resizeNode=void 0)},e.render=function(){var t=this.props,e=t.width,n=t.height,i=d(t,["width","height","onResize"]),o=this.state.size,r=i.children;return o?"function"==typeof r&&(r=r(o)):r=null,i.children=r,i.style=w({width:"number"==typeof e?e:"100%",height:"number"==typeof n?n:"100%"},i.style),b.createElement("div",w({},i,{ref:this.resizeRef}))},t}(b.Component);X.defaultProps={width:null,height:null,onResize:function(){}};var Y=function(e){function t(t){var i;return(i=e.call(this,t)||this)._onPadDragStart=function(t){i._stopPlaying(),i.props.onDragStart(t)},i._onPadDragEnd=function(t){i._startPlaying(),i.props.onDragEnd(t)},i._onPadDecelerationStart=function(t){i._stopPlaying(),i.props.onDecelerationStart(t)},i._onPadDecelerationEnd=function(t){i._startPlaying(),i.props.onDecelerationEnd(t)},i._onPadMouseEnter=function(t){var e=i.props.onMouseEnter;i.setState({mouseEntered:!0},function(){i._stopPlaying()}),e&&e(t)},i._onPadMouseLeave=function(t){var e=i.props.onMouseLeave;i.setState({mouseEntered:!1},function(){i._startPlaying()}),e&&e(t)},i._onPadScroll=function(t){var e=i.props,h=e.direction,n=e.onScroll,f=i.state.loopCount;i.padRef.current.scrollTo({offset:function(t){var e,n=t.contentOffset,i=t.size,o=t.contentSize,r="y"===h?["height","y","x"]:["width","x","y"],a=r[0],s=r[1],c=r[2],l=o[a]/f,u=.5*(o[a]-l-i[a]),d=n[s];return i[a]-o[a]+u<d?0-u<d&&(d-=l):d+=l,d===n[s]?null:((e={})[s]=d,e[c]=n[c],e)},animated:!1}),n(t)},i._onPadContentResize=function(s){i.setState(function(t,e){var n=t.loopCount,i=1;if(e.loop){var o="y"===e.direction?"height":"width",r={width:e.width,height:e.height}[o],a=s[o]/n;a&&r&&(i+=1+Math.floor(r/a))}return i===n?null:{loopCount:i}}),i.props.onContentResize(s)},i.state={mouseEntered:!1,loopCount:1},i.padRef=b.createRef(),i}i(t,e);var n=t.prototype;return n.componentDidMount=function(){this.props.autoplayEnabled&&this._startPlaying()},n.componentDidUpdate=function(t){var e=this.props,n=e.autoplayEnabled;n===t.autoplayEnabled&&e.autoplayInterval===t.autoplayInterval||(this._stopPlaying(),n&&this._startPlaying())},n.componentWillUnmount=function(){this._stopPlaying()},n.go=function(t){var h=t.delta,f=this.props.direction,p=this.state.loopCount;this.padRef.current.scrollTo({offset:function(t,e){var n,i=t.contentOffset,o=e.pagingEnabled,r="y"===f?["height","y","x"]:["width","x","y"],a=r[0],s=r[1],c=r[2],l=t.size[a],u=i[s]-h*l;if(p<=1){var d=Math.min(l-t.contentSize[a],0);o&&0<l&&(d=l*Math.ceil(d/l)),u<d?u=d-l<u?d:0:0<u&&(u=u<l?0:d)}return(n={})[s]=u,n[c]=i[c],n},animated:t.animated})},n.rewind=function(){this.go({delta:-1})},n.forward=function(){this.go({delta:1})},n._startPlaying=function(){var t=this,e=this.padRef.current;if(e&&!e.isDragging()&&!e.isDecelerating()&&!this.state.mouseEntered){var n=this.props.autoplayInterval;this._autoplayTimer&&clearTimeout(this._autoplayTimer),this._autoplayTimer=setTimeout(function(){t._autoplayTimer=void 0,t.forward()},n)}},n._stopPlaying=function(){this._autoplayTimer&&(clearTimeout(this._autoplayTimer),this._autoplayTimer=void 0)},n.render=function(){var t=this.props,e=t.direction,n=t.autoplayEnabled,i=d(t,["direction","autoplayEnabled","autoplayInterval","loop","scrollsBackOnEdge"]),o=this.state.loopCount;"x"===e?i.alwaysBounceY=!1:i.alwaysBounceX=!1;var r=i.children;return"function"==typeof r&&(r=r(this)),i.children=b.createElement(B,{direction:e,itemCount:o,renderItem:function(t){return b.createElement(t.Item,{forceRender:!0},r)}}),i.onContentResize=this._onPadContentResize,1<o&&(i.onScroll=this._onPadScroll),n&&(i.onDragStart=this._onPadDragStart,i.onDragEnd=this._onPadDragEnd,i.onDecelerationStart=this._onPadDecelerationStart,i.onDecelerationEnd=this._onPadDecelerationEnd,i.onMouseEnter=this._onPadMouseEnter,i.onMouseLeave=this._onPadMouseLeave),b.createElement(H,w({},i,{ref:this.padRef}))},t}(b.Component);Y.defaultProps=w({},H.defaultProps,{direction:"x",autoplayEnabled:!0,autoplayInterval:3e3,loop:!0,pagingEnabled:!0});var F=function(e){function t(t){var n;return(n=e.call(this,t)||this)._onPlayerScroll=function(t){var e=n._calculateActiveIndex({size:t.size,contentOffset:t.contentOffset});e!==n.state.activeIndex&&n.setState({activeIndex:e}),n.props.onScroll(t)},n.state={activeIndex:0},n.playerRef=b.createRef(),n}i(t,e);var n=t.prototype;return n.componentDidUpdate=function(t,e){var n=this.props,i=this.state.activeIndex;e.activeIndex!==i&&(0,n.onSlideChange)({itemCount:n.itemCount,activeIndex:i})},n.getActiveIndex=function(){return this.state.activeIndex},n.slideTo=function(t){this.playerRef.current.go({delta:t.index-this.state.activeIndex,animated:t.animated})},n.slidePrev=function(){this.playerRef.current.rewind()},n.slideNext=function(){this.playerRef.current.forward()},n._calculateActiveIndex=function(t){var e=this.props,n=e.itemCount,i="x"===e.direction?["width","x"]:["height","y"];return Math.max(Math.round(-t.contentOffset[i[1]]/t.size[i[0]]),0)%n},n.render=function(){var t=this.props,e=t.itemCount,n=t.renderItem,i=d(t,["itemCount","renderItem","renderIndicator","onSlideChange"]),o=i.width,r=i.height,a=b.createElement(V,w({ref:this.gridRef},{width:o,height:r,itemWidth:o,itemHeight:r,direction:i.direction,itemCount:e,renderItem:n}));return i.children=a,i.onScroll=this._onPlayerScroll,b.createElement(Y,w({},i,{ref:this.playerRef}))},t}(b.Component);F.defaultProps=w({},Y.defaultProps,{itemCount:0,renderItem:function(){return null},renderIndicator:null,onSlideChange:function(){}}),t.AutoResizing=X,t.Carousel=F,t.GeneralContent=L,t.GridContent=V,t.ItemContent=O,t.ListContent=B,t.Pad=H,t.Pannable=u,t.Player=Y,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t=t||self).ReactPannable={},t.React)}(this,function(t,g){"use strict";function d(t,e){if(null==t)return{};var n,i,o={},r=Object.keys(t);for(i=0;i<r.length;i++)~e.indexOf(n=r[i])||(o[n]=t[n]);return o}function m(){return(m=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}function i(t,e){t.prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e}g=g&&g.hasOwnProperty("default")?g.default:g;var u=function(o){function t(){for(var n,t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];return(n=o.call.apply(o,[this].concat(e))||this).state={target:null,translation:null,interval:null,velocity:null,startPoint:null,movePoint:null,moveTime:null},n.elemRef=g.createRef(),n._onTouchStart=function(t){var e=n.props.onTouchStart;t.touches&&1===t.touches.length&&(n._addTouchPanListener(t.target),n._track(t.touches[0])),e&&e(t)},n._onTouchMove=function(t){t.touches&&1===t.touches.length&&n._move(t.touches[0])},n._onTouchEnd=function(t){n._removeTouchPanListener(t.target),n._end()},n._onTouchCancel=function(t){n._removeTouchPanListener(t.target),n._end()},n._onMouseDown=function(t){var e=n.props.onMouseDown;n._shouldPreventClick=!0,n._removeMousePanListener(),n._addMousePanListener(),n._track(t),e&&e(t)},n._onMouseMove=function(t){t.preventDefault(),n._move(t)},n._onMouseUp=function(t){t.preventDefault(),n._removeMousePanListener(),n._end()},n._onClick=function(t){var e=n.props.onClick;n._shouldPreventClick&&t.preventDefault(),n._shouldPreventClick=!1,e&&e(t)},n}i(t,o);var e=t.prototype;return e.componentDidUpdate=function(t){var e=this.props.enabled;e!==t.enabled&&(e||this._cancel())},e.componentWillUnmount=function(){this._removeMousePanListener()},e._track=function(t){this.setState({startPoint:{x:t.pageX,y:t.pageY},movePoint:{x:t.pageX,y:t.pageY},moveTime:(new Date).getTime()})},e._move=function(v){v={target:v.target,pageX:v.pageX,pageY:v.pageY},this.setState(function(t,e){var n=e.shouldStart,i=e.onStart,o=e.onMove,r=t.target,a=t.startPoint,s=t.movePoint,l=t.moveTime;if(!a)return null;var c=(new Date).getTime(),u={x:v.pageX,y:v.pageY},d=c-l,h={x:u.x-a.x,y:u.y-a.y},f={x:(u.x-s.x)/d,y:(u.y-s.y)/d},p={translation:h,velocity:f,interval:d,movePoint:u,moveTime:c};r?o({target:r,translation:h,velocity:f,interval:d}):0<Math.sqrt(h.x*h.x+h.y*h.y)&&n({target:v.target,translation:h,velocity:f,interval:d})&&(p.target=v.target,p.startPoint={x:v.pageX,y:v.pageY},p.translation=h={x:0,y:0},i({target:v.target,translation:h,velocity:f,interval:d}));return p})},e._end=function(){this.setState(function(t,e){var n=t.target;return n&&e.onEnd({target:n,translation:t.translation,velocity:t.velocity,interval:t.interval}),{target:null,translation:null,velocity:null,interval:null,startPoint:null,movePoint:null,moveTime:null}})},e._cancel=function(){this.setState(function(t,e){var n=t.target;return n&&e.onCancel({target:n,translation:t.translation,velocity:t.velocity,interval:t.interval}),{target:null,translation:null,velocity:null,interval:null,startPoint:null,movePoint:null,moveTime:null}})},e._addTouchPanListener=function(t){t.addEventListener("touchmove",this._onTouchMove,!1),t.addEventListener("touchend",this._onTouchEnd,!1),t.addEventListener("touchcancel",this._onTouchCancel,!1)},e._removeTouchPanListener=function(t){t.removeEventListener("touchmove",this._onTouchMove,!1),t.removeEventListener("touchend",this._onTouchEnd,!1),t.removeEventListener("touchcancel",this._onTouchCancel,!1)},e._addMousePanListener=function(){var t=document.documentElement;t.addEventListener("mousemove",this._onMouseMove,!1),t.addEventListener("mouseup",this._onMouseUp,!1)},e._removeMousePanListener=function(){var t=document.documentElement;t.removeEventListener("mousemove",this._onMouseMove,!1),t.removeEventListener("mouseup",this._onMouseUp,!1)},e.render=function(){var t=this.props,e=t.enabled,n=d(t,["enabled","shouldStart","onStart","onMove","onEnd","onCancel"]);return e&&(n.style=m({touchAction:"none"},n.style),n.onTouchStart=this._onTouchStart,n.onMouseDown=this._onMouseDown,n.onClick=this._onClick),g.createElement("div",m({},n,{ref:this.elemRef}))},t}(g.Component);u.defaultProps={enabled:!0,shouldStart:function(){return!0},onStart:function(){},onMove:function(){},onEnd:function(){},onCancel:function(){}};var e,h={create:function(t){var e=t.transformTranslate;return m({},d(t,["transformTranslate"]),function(t){return t?{transform:"translate3d("+t[0]+"px, "+t[1]+"px, 0)",WebkitTransform:"translate3d("+t[0]+"px, "+t[1]+"px, 0)",msTransform:"translate("+t[0]+"px, "+t[1]+"px)"}:null}(e))}},o=(e="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.msRequestAnimationFrame||e.setTimeout&&function(t){return e.setTimeout(t,20)}||function(){},r=e.cancelAnimationFrame||e.webkitCancelAnimationFrame||e.mozCancelAnimationFrame||e.clearTimeout||function(){};function f(t,e){var n=e.x,i=e.y,o=Math.sqrt(n*n+i*i);return 0==o?{x:0,y:0}:{x:t*(n/o),y:t*(i/o)}}function p(t,e,n,i,o){if(o){var r="y"===o?["y","height"]:["x","width"],a=r[0],s=r[1],l=e[s],c=Math.min(l-n[s],0),u=t[a];return i&&0<l&&(c=l*Math.ceil(c/l)),0<u?u=0:u<c?u=c:i&&0<l&&(u=l*Math.round(u/l)),u}var d={x:p(t,e,n,i,"x"),y:p(t,e,n,i,"y")};return d.x===t.x&&d.y===t.y?t:d}function v(t,e,n,i,o,r){if(r){var a="y"===r?["y","height"]:["x","width"],s=a[0],l=a[1],c=t[s];return o[s]&&(c+=.5*e[s]*(e[s]/o[s])),i&&0<n[l]&&(c=n[l]*Math.round(c/n[l])),c}return"number"==typeof o&&(o=f(o,e)),{x:v(t,e,n,i,o,"x"),y:v(t,e,n,i,o,"y")}}function y(t,e,n,i){var o,r,a={x:n.x-t.x,y:n.y-t.y},s=Math.sqrt(Math.pow(a.x,2)+Math.pow(a.y,2));if(s){var l=Math.sqrt(.5*Math.pow(o=(e.x*a.x+e.y*a.y)/s,2)+i*s),c=(l-o)/i;c<0&&(l=o,c=0),r=c+l/i}else o=Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2)),r=(1+Math.sqrt(2))*o/i;return 0<r?{points:{x:[t.x,t.x+e.x*(r/3),n.x,n.x],y:[t.y,t.y+e.y*(r/3),n.y,n.y]},duration:r,startTime:(new Date).getTime(),endOffset:n,rate:i}:null}function n(t,e){return t(e={exports:{}},e.exports),e.exports}function a(t){var e=(t=t||{}).reporter,n=c.getOption(t,"async",!0),i=c.getOption(t,"auto",!0);i&&!n&&(e&&e.warn("Invalid options combination. auto=true and async=false is invalid. Setting async=true."),n=!0);var o,r=w(),a=!1;function s(){for(a=!0;r.size();){var t=r;r=w(),t.process()}a=!1}function l(){o=function(t){return function(t){return setTimeout(t,0)}(t)}(s)}return{add:function(t,e){!a&&i&&n&&0===r.size()&&l(),r.add(t,e)},force:function(t){a||(void 0===t&&(t=n),o&&(function(t){clearTimeout(t)}(o),o=null),t?l():s())}}}var s=n(function(t){(t.exports={}).forEach=function(t,e){for(var n=0;n<t.length;n++){var i=e(t[n]);if(i)return i}}}),b=n(function(t){var e=t.exports={};e.isIE=function(t){return!!(~(e=navigator.userAgent.toLowerCase()).indexOf("msie")||~e.indexOf("trident")||~e.indexOf(" edge/"))&&(!t||t===function(){for(var t=3,e=document.createElement("div"),n=e.getElementsByTagName("i");e.innerHTML="\x3c!--[if gt IE "+ ++t+"]><i></i><![endif]--\x3e",n[0];);return 4<t?t:void 0}());var e},e.isLegacyOpera=function(){return!!window.opera}}),c=n(function(t){(t.exports={}).getOption=function(t,e,n){var i=t[e];return null!=i||void 0===n?i:n}});function w(){var i={},n=0,o=0,r=0;return{add:function(t,e){e||(e=t,t=0),o<t?o=t:t<r&&(r=t),i[t]||(i[t]=[]),i[t].push(e),n++},process:function(){for(var t=r;t<=o;t++)for(var e=i[t],n=0;n<e.length;n++)(0,e[n])()},size:function(){return n}}}var l="_erd";function x(t){return t[l]}function _(t){var x=(t=t||{}).reporter,_=t.batchProcessor,z=t.stateHandler.getState,S=t.idHandler;if(!_)throw Error("Missing required dependency: batchProcessor");if(!x)throw Error("Missing required dependency: reporter.");var E=function(){var t=document.createElement("div");t.style.cssText="position: absolute; width: 1000px; height: 1000px; visibility: hidden; margin: 0; padding: 0;";var e=document.createElement("div");e.style.cssText="position: absolute; width: 500px; height: 500px; overflow: scroll; visibility: none; top: -1500px; left: -1500px; visibility: hidden; margin: 0; padding: 0;",e.appendChild(t),document.body.insertBefore(e,document.body.firstChild);var n=500-e.clientWidth,i=500-e.clientHeight;return document.body.removeChild(e),{width:n,height:i}}(),R="erd_scroll_detection_container";function C(t,e,n){if(t.addEventListener)t.addEventListener(e,n);else{if(!t.attachEvent)return x.error("[scroll] Don't know how to add event listeners.");t.attachEvent("on"+e,n)}}function n(t,e,n){if(t.removeEventListener)t.removeEventListener(e,n);else{if(!t.detachEvent)return x.error("[scroll] Don't know how to remove event listeners.");t.detachEvent("on"+e,n)}}function D(t){return z(t).container.childNodes[0].childNodes[0].childNodes[0]}function P(t){return z(t).container.childNodes[0].childNodes[0].childNodes[1]}return function(i,t){if(!document.getElementById(i)){var e=t+"_animation",n=t+"_animation_active",o="/* Created by the element-resize-detector library. */\n";o+="."+t+" > div::-webkit-scrollbar { display: none; }\n\n",o+="."+n+" { -webkit-animation-duration: 0.1s; animation-duration: 0.1s; -webkit-animation-name: "+e+"; animation-name: "+e+"; }\n",o+="@-webkit-keyframes "+e+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }\n",function(t,e){e=e||function(t){document.head.appendChild(t)};var n=document.createElement("style");n.innerHTML=t,n.id=i,e(n)}(o+="@keyframes "+e+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }")}}("erd_scroll_detection_scrollbar_style",R),{makeDetectable:function(a,g,t){function m(){if(a.debug){var t=Array.prototype.slice.call(arguments);if(t.unshift(S.get(g),"Scroll: "),x.log.apply)x.log.apply(null,t);else for(var e=0;e<t.length;e++)x.log(t[e])}}function s(t){var e=z(t).container.childNodes[0],n=window.getComputedStyle(e);return!n.width||!~n.width.indexOf("px")}function e(){var t=window.getComputedStyle(g),e={};return e.position=t.position,e.width=g.offsetWidth,e.height=g.offsetHeight,e.top=t.top,e.right=t.right,e.bottom=t.bottom,e.left=t.left,e.widthCSS=t.width,e.heightCSS=t.height,e}function n(){if(m("storeStyle invoked."),z(g)){var t=e();z(g).style=t}else m("Aborting because element has been uninstalled")}function l(t,e,n){z(t).lastWidth=e,z(t).lastHeight=n}function c(){return 2*E.width+1}function u(){return 2*E.height+1}function d(t){return t+10+c()}function h(t){return t+10+u()}function f(t,e,n){var i=D(t),o=P(t),r=d(e),a=h(n),s=function(t){return 2*t+c()}(e),l=function(t){return 2*t+u()}(n);i.scrollLeft=r,i.scrollTop=a,o.scrollLeft=s,o.scrollTop=l}function y(){var t=z(g).container;if(!t){(t=document.createElement("div")).className=R,t.style.cssText="visibility: hidden; display: inline; width: 0px; height: 0px; z-index: -1; overflow: hidden; margin: 0; padding: 0;",function(t){t.className+=" "+R+"_animation_active"}(z(g).container=t),g.appendChild(t);var e=function(){z(g).onRendered&&z(g).onRendered()};C(t,"animationstart",e),z(g).onAnimationStart=e}return t}function i(){if(m("Injecting elements"),z(g)){!function(){var t=z(g).style;if("static"===t.position){g.style.position="relative";var e=function(t,e,n,i){var o=n[i];"auto"!==o&&"0"!==o.replace(/[^-\d\.]/g,"")&&(t.warn("An element that is positioned static has style."+i+"="+o+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+i+" will be set to 0. Element: ",e),e.style[i]=0)};e(x,g,t,"top"),e(x,g,t,"right"),e(x,g,t,"bottom"),e(x,g,t,"left")}}();var t=z(g).container;t||(t=y());var e,n,i,o,r=E.width,a=E.height,s="position: absolute; flex: none; overflow: hidden; z-index: -1; visibility: hidden; left: "+(e=(e=-(1+r))?e+"px":"0")+"; top: "+(n=(n=-(1+a))?n+"px":"0")+"; right: "+(o=(o=-r)?o+"px":"0")+"; bottom: "+(i=(i=-a)?i+"px":"0")+";",l=document.createElement("div"),c=document.createElement("div"),u=document.createElement("div"),d=document.createElement("div"),h=document.createElement("div"),f=document.createElement("div");l.dir="ltr",l.style.cssText="position: absolute; flex: none; overflow: hidden; z-index: -1; visibility: hidden; width: 100%; height: 100%; left: 0px; top: 0px;",c.className=l.className=R,c.style.cssText=s,u.style.cssText="position: absolute; flex: none; overflow: scroll; z-index: -1; visibility: hidden; width: 100%; height: 100%;",d.style.cssText="position: absolute; left: 0; top: 0;",h.style.cssText="position: absolute; flex: none; overflow: scroll; z-index: -1; visibility: hidden; width: 100%; height: 100%;",f.style.cssText="position: absolute; width: 200%; height: 200%;",u.appendChild(d),h.appendChild(f),c.appendChild(u),c.appendChild(h),l.appendChild(c),t.appendChild(l),C(u,"scroll",p),C(h,"scroll",v),z(g).onExpandScroll=p,z(g).onShrinkScroll=v}else m("Aborting because element has been uninstalled");function p(){z(g).onExpand&&z(g).onExpand()}function v(){z(g).onShrink&&z(g).onShrink()}}function o(){function i(t,e,n){var i=function(t){return D(t).childNodes[0]}(t),o=d(e),r=h(n);i.style.width=o+"px",i.style.height=r+"px"}function n(t){var e=g.offsetWidth,n=g.offsetHeight;m("Storing current size",e,n),l(g,e,n),_.add(0,function(){z(g)?o()?(a.debug&&(g.offsetWidth===e&&g.offsetHeight===n||x.warn(S.get(g),"Scroll: Size changed before updating detector elements.")),i(g,e,n)):m("Aborting because element container has not been initialized"):m("Aborting because element has been uninstalled")}),_.add(1,function(){z(g)?o()?f(g,e,n):m("Aborting because element container has not been initialized"):m("Aborting because element has been uninstalled")}),t&&_.add(2,function(){z(g)?o()?t():m("Aborting because element container has not been initialized"):m("Aborting because element has been uninstalled")})}function o(){return!!z(g).container}function r(){m("notifyListenersIfNeeded invoked");var t=z(g);return void 0===z(g).lastNotifiedWidth&&t.lastWidth===t.startSize.width&&t.lastHeight===t.startSize.height?m("Not notifying: Size is the same as the start size, and there has been no notification yet."):t.lastWidth===t.lastNotifiedWidth&&t.lastHeight===t.lastNotifiedHeight?m("Not notifying: Size already notified"):(m("Current size not notified, notifying..."),t.lastNotifiedWidth=t.lastWidth,t.lastNotifiedHeight=t.lastHeight,void M(z(g).listeners,function(t){t(g)}))}function t(){if(m("Scroll detected."),s(g))m("Scroll event fired while unrendered. Ignoring...");else{var t=g.offsetWidth,e=g.offsetHeight;t!==z(g).lastWidth||e!==z(g).lastHeight?(m("Element size changed."),n(r)):m("Element size has not changed ("+t+"x"+e+").")}}if(m("registerListenersAndPositionElements invoked."),z(g)){z(g).onRendered=function(){if(m("startanimation triggered."),s(g))m("Ignoring since element is still unrendered...");else{m("Element rendered.");var t=D(g),e=P(g);0!==t.scrollLeft&&0!==t.scrollTop&&0!==e.scrollLeft&&0!==e.scrollTop||(m("Scrollbars out of sync. Updating detector elements..."),n(r))}},z(g).onExpand=t,z(g).onShrink=t;var e=z(g).style;i(g,e.width,e.height)}else m("Aborting because element has been uninstalled")}function r(){if(m("finalizeDomMutation invoked."),z(g)){var t=z(g).style;l(g,t.width,t.height),f(g,t.width,t.height)}else m("Aborting because element has been uninstalled")}function p(){t(g)}function v(){m("Installing..."),z(g).listeners=[],function(){var t=e();z(g).startSize={width:t.width,height:t.height},m("Element start size",z(g).startSize)}(),_.add(0,n),_.add(1,i),_.add(2,o),_.add(3,r),_.add(4,p)}var b,w;t||(t=g,g=a,a=null),a=a||{},m("Making detectable..."),(w=b=g)!==w.ownerDocument.body&&!w.ownerDocument.body.contains(w)||null===window.getComputedStyle(b)?(m("Element is detached"),y(),m("Waiting until element is attached..."),z(g).onRendered=function(){m("Element is now attached"),v()}):v()},addListener:function(t,e){if(!z(t).listeners.push)throw Error("Cannot add listener to an element that is not detectable.");z(t).listeners.push(e)},uninstall:function(t){var e=z(t);e&&(e.onExpandScroll&&n(D(t),"scroll",e.onExpandScroll),e.onShrinkScroll&&n(P(t),"scroll",e.onShrinkScroll),e.onAnimationStart&&n(e.container,"animationstart",e.onAnimationStart),e.container&&t.removeChild(e.container))}}}var z={initState:function(t){return t[l]={},x(t)},getState:x,cleanState:function(t){delete t[l]}},M=s.forEach,S=s.forEach;function E(t){return Array.isArray(t)||void 0!==t.length}function R(t){if(Array.isArray(t))return t;var e=[];return S(t,function(t){e.push(t)}),e}function C(t){return t&&1===t.nodeType}function D(t,e,n){var i=t[e];return null==i&&void 0!==n?n:i}var P=function(e){var d;if((e=e||{}).idHandler)d={get:function(t){return e.idHandler.get(t,!0)},set:e.idHandler.set};else{var t=function(t){var i=t.idGenerator,o=t.stateHandler.getState;return{get:function(t){var e=o(t);return e&&void 0!==e.id?e.id:null},set:function(t){var e=o(t);if(!e)throw Error("setId required the element to have a resize detection state.");var n=i.generate();return e.id=n}}}({idGenerator:function(){var t=1;return{generate:function(){return t++}}}(),stateHandler:z});d=t}var h=e.reporter;h||(h=function(t){function e(){}var n={log:e,warn:e,error:e};if(!t&&window.console){var i=function(t,n){t[n]=function(){var t=console[n];if(t.apply)t.apply(console,arguments);else for(var e=0;e<arguments.length;e++)t(arguments[e])}};i(n,"log"),i(n,"warn"),i(n,"error")}return n}(!1===h));var n=D(e,"batchProcessor",a({reporter:h})),f={};f.callOnAdd=!!D(e,"callOnAdd",!0),f.debug=!!D(e,"debug",!1);var p,v=function(i){var o={};function r(t){var e=i.get(t);return void 0===e?[]:o[e]||[]}return{get:r,add:function(t,e){var n=i.get(t);o[n]||(o[n]=[]),o[n].push(e)},removeListener:function(t,e){for(var n=r(t),i=0,o=n.length;i<o;++i)if(n[i]===e){n.splice(i,1);break}},removeAllListeners:function(t){var e=r(t);e&&(e.length=0)}}}(d),g=function(t){var n=t.stateHandler.getState;return{isDetectable:function(t){var e=n(t);return e&&!!e.isDetectable},markAsDetectable:function(t){n(t).isDetectable=!0},isBusy:function(t){return!!n(t).busy},markBusy:function(t,e){n(t).busy=!!e}}}({stateHandler:z}),i=D(e,"strategy","object"),o={reporter:h,batchProcessor:n,stateHandler:z,idHandler:d};if("scroll"===i&&(b.isLegacyOpera()?(h.warn("Scroll strategy is not supported on legacy Opera. Changing to object strategy."),i="object"):b.isIE(9)&&(h.warn("Scroll strategy is not supported on IE9. Changing to object strategy."),i="object")),"scroll"===i)p=_(o);else{if("object"!==i)throw Error("Invalid strategy name: "+i);p=function(t){var u=(t=t||{}).reporter,d=t.batchProcessor,h=t.stateHandler.getState;if(!u)throw Error("Missing required dependency: reporter.");function i(t){return h(t).object}return{makeDetectable:function(t,e,n){var i,o,r,a,s,l;function c(){function t(){if("static"===a.position){i.style.position="relative";var t=function(t,e,n,i){var o=n[i];"auto"!==o&&"0"!==o.replace(/[^-\d\.]/g,"")&&(t.warn("An element that is positioned static has style."+i+"="+o+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+i+" will be set to 0. Element: ",e),e.style[i]=0)};t(u,i,a,"top"),t(u,i,a,"right"),t(u,i,a,"bottom"),t(u,i,a,"left")}}""!==a.position&&(t(),r=!0);var e=document.createElement("object");e.style.cssText="display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; padding: 0; margin: 0; opacity: 0; z-index: -1000; pointer-events: none;",e.tabIndex=-1,e.type="text/html",e.setAttribute("aria-hidden","true"),e.onload=function(){r||t(),function t(e,n){e.contentDocument?n(e.contentDocument):setTimeout(function(){t(e,n)},100)}(this,function(t){o(i)})},b.isIE()||(e.data="about:blank"),i.appendChild(e),h(i).object=e,b.isIE()&&(e.data="about:blank")}n||(n=e,e=t,t=null),t=t||{},b.isIE(8)?n(e):(i=e,o=n,r=!1,a=window.getComputedStyle(i),s=i.offsetWidth,l=i.offsetHeight,h(i).startSize={width:s,height:l},d?d.add(c):c())},addListener:function(t,e){if(!i(t))throw Error("Element is not detectable by this strategy.");function n(){e(t)}b.isIE(8)?(h(t).object={proxy:n},t.attachEvent("onresize",n)):i(t).contentDocument.defaultView.addEventListener("resize",n)},uninstall:function(t){b.isIE(8)?t.detachEvent("onresize",h(t).object.proxy):t.removeChild(i(t)),delete h(t).object}}}(o)}var m={};return{listenTo:function(t,i,o){function r(e){var t=v.get(e);S(t,function(t){t(e)})}function a(t,e,n){v.add(e,n),t&&n(e)}if(o||(o=i,i=t,t={}),!i)throw Error("At least one element required.");if(!o)throw Error("Listener required.");if(C(i))i=[i];else{if(!E(i))return h.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");i=R(i)}var s=0,l=D(t,"callOnAdd",f.callOnAdd),c=D(t,"onReady",function(){}),u=D(t,"debug",f.debug);S(i,function(t){z.getState(t)||(z.initState(t),d.set(t));var n=d.get(t);if(u&&h.log("Attaching listener to element",n,t),!g.isDetectable(t))return u&&h.log(n,"Not detectable."),g.isBusy(t)?(u&&h.log(n,"System busy making it detectable"),a(l,t,o),m[n]=m[n]||[],void m[n].push(function(){++s===i.length&&c()})):(u&&h.log(n,"Making detectable..."),g.markBusy(t,!0),p.makeDetectable({debug:u},t,function(t){if(u&&h.log(n,"onElementDetectable"),z.getState(t)){g.markAsDetectable(t),g.markBusy(t,!1),p.addListener(t,r),a(l,t,o);var e=z.getState(t);e&&e.startSize&&(e.startSize.width===t.offsetWidth&&e.startSize.height===t.offsetHeight||r(t)),m[n]&&S(m[n],function(t){t()})}else u&&h.log(n,"Element uninstalled before being detectable.");delete m[n],++s===i.length&&c()}));u&&h.log(n,"Already detecable, adding listener."),a(l,t,o),s++}),s===i.length&&c()},removeListener:v.removeListener,removeAllListeners:v.removeAllListeners,uninstall:function(t){if(!t)return h.error("At least one element is required.");if(C(t))t=[t];else{if(!E(t))return h.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");t=R(t)}S(t,function(t){v.removeAllListeners(t),p.uninstall(t),z.cleanState(t)})}}}({strategy:"scroll"});function T(t){var e=window.getComputedStyle(t)||{},n=t.offsetWidth||0,i=t.offsetHeight||0;return e.paddingLeft&&(n-=parseInt(e.paddingLeft,10)),e.paddingRight&&(n-=parseInt(e.paddingRight,10)),e.borderLeftWidth&&(n-=parseInt(e.borderLeftWidth,10)),e.borderRightWidth&&(n-=parseInt(e.borderRightWidth,10)),e.paddingTop&&(i-=parseInt(e.paddingTop,10)),e.paddingBottom&&(i-=parseInt(e.paddingBottom,10)),e.borderTopWidth&&(i-=parseInt(e.borderTopWidth,10)),e.borderBottomWidth&&(i-=parseInt(e.borderBottomWidth,10)),{width:n,height:i}}function I(t,e){return t===e||!(!t||!e||t.width!==e.width||t.height!==e.height)}var L=function(n){function t(t){var e;return(e=n.call(this,t)||this).state={size:null,prevWidth:null,prevHeight:null},e.resizeRef=g.createRef(),e}i(t,n),t.getDerivedStateFromProps=function(t,e){var n=t.width,i=t.height,o=e.prevWidth,r=e.prevHeight,a=null;if(n!==o||i!==r){var s=null;"number"==typeof n&&"number"==typeof i&&(s={width:n,height:i}),a=a||{},I(s,e.size)||(a.size=s),n!==o&&(a.prevWidth=n),i!==r&&(a.prevHeight=i)}return a};var e=t.prototype;return e.componentDidMount=function(){var t=this.state.size;t?this.props.onResize(t):this.calculateSize()},e.componentDidUpdate=function(t,e){var n=this.state.size;n!==e.size&&(n?this.props.onResize(n):this.calculateSize())},e.getSize=function(){return this.state.size},e.calculateSize=function(){var o=this;this.setState(function(t){var e=o.resizeRef.current;if(!e)return null;var n=t.size,i=T(e);return I(i,n)?null:{size:i}})},e.render=function(){var t=this.props,e=t.width,n=t.height,i=d(t,["width","height","visibleRect","onResize","connectWithPad"]),o=this.state.size,r={position:"relative"};o&&(r.width=o.width,r.height=o.height),i.style=m({},r,i.style);var a=i.children;return"function"==typeof a&&(a=a(this)),"number"==typeof e&&"number"==typeof n||(a=g.createElement("div",{ref:this.resizeRef,style:{position:"absolute",width:"number"==typeof e?e:"auto",height:"number"==typeof n?n:"auto"}},a)),i.children=a,g.createElement("div",i)},t}(g.Component);L.defaultProps={width:null,height:null,visibleRect:{x:0,y:0,width:0,height:0},onResize:function(){},connectWithPad:!0};var O=function(n){function t(t){var e;return(e=n.call(this,t)||this).elemRef=g.createRef(),e}i(t,n);var e=t.prototype;return e.componentDidMount=function(){this._checkResizeNode()},e.componentDidUpdate=function(t){var e=this.props;e.width===t.width&&e.height===t.height||this._checkResizeNode()},e.componentWillUnmount=function(){this._detachResizeNode()},e.getSize=function(){return this.elemRef.current.getSize()},e.calculateSize=function(){return this.elemRef.current.calculateSize()},e._checkResizeNode=function(){var t=this.props;"number"==typeof t.width&&"number"==typeof t.height?this._detachResizeNode():this._attachResizeNode(this.elemRef.current.resizeRef.current)},e._attachResizeNode=function(t){var e=this;this._resizeNode||P.listenTo(this._resizeNode=t,function(){return e.calculateSize()})},e._detachResizeNode=function(){this._resizeNode&&(P.uninstall(this._resizeNode),this._resizeNode=void 0)},e.render=function(){return g.createElement(L,m({ref:this.elemRef},this.props))},t}(g.Component);O.defaultProps=m({},L.defaultProps);var k=.04,W=function(n){function t(t){var e;return(e=n.call(this,t)||this)._onDragStart=function(t){var r=t.velocity;e.setState(function(t,e){var n=t.contentOffset,i=e.directionalLockEnabled?Math.abs(r.y)<Math.abs(r.x)?{x:1,y:0}:{x:0,y:1}:{x:1,y:1},o={x:i.x*r.x,y:i.y*r.y};return{contentOffset:m({},n),contentVelocity:o,drag:{direction:i,startOffset:n},deceleration:null}})},e._onDragMove=function(t){var r=t.translation,a=t.interval;e.setState(function(t,e){var n=t.contentOffset,i=t.drag,o=function t(e,n,i,o,r){if(r){var a="y"===r?["y","height","width"]:["x","width","height"],s=a[0],l=a[1],c=a[2],u=e[s],d=Math.min(i[l]-o[l],0),h=.5*Math.min(i[l],i[c]);return 0<u?n[s]?h*(1-h/(h+u)):0:u<d?n[s]?d-h*(1-h/(h-u+d)):d:u}var f={x:t(e,n,i,o,"x"),y:t(e,n,i,o,"y")};return f.x===e.x&&f.y===e.y?e:f}({x:i.startOffset.x+i.direction.x*r.x,y:i.startOffset.y+i.direction.y*r.y},{x:e.alwaysBounceX,y:e.alwaysBounceY},t.size,t.contentSize);return{contentOffset:o,contentVelocity:{x:(o.x-n.x)/a,y:(o.y-n.y)/a}}})},e._onDragEnd=function(){e.setState(function(t,e){var n=t.contentOffset,i=t.size,o=e.pagingEnabled,r=function t(e,n,i,o){if(o){var r="y"===o?["y","height"]:["x","width"],a=r[0];if(!e[a])return 0;var s=e[a]<0?-1:1;return s*Math.min(s*e[a],Math.sqrt(.5*n[r[1]]*2*s*i[a]))}"number"==typeof i&&(i=f(i,e));var l={x:t(e,n,i,"x"),y:t(e,n,i,"y")};return l.x===e.x&&l.y===e.y?e:l}(t.contentVelocity,i,k),a=o?k:.004,s=v(n,r,i,o,a);return{contentOffset:m({},n),contentVelocity:r,drag:null,deceleration:y(n,r,s,a)}})},e._onDragCancel=function(){e.setState(function(t,e){var n=t.contentOffset,i=t.contentVelocity,o=v(t.drag.startOffset,{x:0,y:0},t.size,e.pagingEnabled,k);return{contentOffset:m({},n),drag:null,deceleration:y(n,i,o,k)}})},e.state={contentOffset:{x:0,y:0},contentVelocity:{x:0,y:0},size:{width:t.width,height:t.height},contentSize:{width:0,height:0},drag:null,deceleration:null},e.elemRef=g.createRef(),e}i(t,n);var e=t.prototype;return e.componentDidUpdate=function(t,e){var n=this.props,i=n.width,o=n.height,r=n.pagingEnabled,a=n.onScroll,s=n.onDragStart,l=n.onDragEnd,c=n.onDecelerationStart,u=n.onDecelerationEnd,d=n.onContentResize,h=this.state,f=h.contentOffset,p=h.contentSize,v=h.drag,g=h.deceleration;i===t.width&&o===t.height||this._setStateWithScroll({size:{width:i,height:o}}),r===t.pagingEnabled||r&&this._setStateWithScroll(null),f!==e.contentOffset&&(a(this._getPadEvent()),this._adjustContentOffsetIfNeeded(),g&&this._requestDecelerationTimer()),p!==e.contentSize&&d(p),v!==e.drag&&(e.drag?v||l(this._getPadEvent()):s(this._getPadEvent())),g!==e.deceleration&&(e.deceleration?g||u(this._getPadEvent()):c(this._getPadEvent()))},e.componentWillUnmount=function(){this._cancelDecelerationTimer()},e.getSize=function(){return this.state.size},e.getContentSize=function(){return this.state.contentSize},e.getContentOffset=function(){return this.state.contentOffset},e.getContentVelocity=function(){return this.state.contentVelocity},e.isDragging=function(){return!!this.state.drag},e.isDecelerating=function(){return!!this.state.deceleration},e.getVisibleRect=function(){return this._getVisibleRect(this.state)},e.setContentSize=function(t){this._setStateWithScroll({contentSize:t})},e.scrollToRect=function(t){var e=this,n=t.rect,i=t.align,o=void 0===i?"auto":i,r=t.animated;this._setContentOffset(function(t){return function t(e,n,i,o){if(o){var r="y"===o?["y","height"]:["x","width"],a=r[0],s=r[1],l=-e[a],c=n[s]-e[s];if("auto"===i[a]){var u=c<0?-1:1;l+=u*Math.max(0,Math.min(u*(-n[a]-l),u*c))}else"start"===i[a]?i[a]=0:"center"===i[a]?i[a]=.5:"end"===i[a]&&(i[a]=1),"number"==typeof i[a]&&!isNaN(i[a])||(i[a]=.5),l+=i[a]*c;return l}return"object"!=typeof i&&(i={x:i,y:i}),{x:t(e,n,i,"x"),y:t(e,n,i,"y")}}(n,e._getVisibleRect(t),o)},void 0===r||r)},e.scrollTo=function(t){var e=t.animated;this._setContentOffset(t.offset,void 0===e||e)},e._getVisibleRect=function(t){var e=t.contentOffset,n=t.size;return{x:-e.x,y:-e.y,width:n.width,height:n.height}},e._getPadEvent=function(){var t=this.state;return{contentOffset:t.contentOffset,contentVelocity:t.contentVelocity,size:t.size,contentSize:t.contentSize,dragging:!!t.drag,decelerating:!!t.deceleration}},e._setContentOffset=function(u,d){this.setState(function(t,e){if("function"==typeof u&&(u=u(t,e)),!u)return null;var n=t.contentOffset,i=t.contentVelocity,o=t.size,r=t.drag,a=t.deceleration,s=e.pagingEnabled,l={};if(r||!d)l.contentOffset=u,r&&(l.drag=m({},r,{startOffset:{x:r.startOffset.x+u.x-n.x,y:r.startOffset.y+u.y-n.y}})),a&&(l.deceleration=y(u,i,{x:a.endOffset.x+u.x-n.x,y:a.endOffset.y+u.y-n.y},a.rate));else{var c=v(u,{x:0,y:0},o,s,.04);l.contentOffset=m({},n),l.deceleration=y(n,i,c,.04)}return l})},e._setStateWithScroll=function(r){this.setState(function(t,e){var n=t.contentOffset,i=t.contentVelocity;if(t.drag||t.deceleration)return r;var o=v(n,i,t.size,e.pagingEnabled,.04);return m({},r,{contentOffset:m({},n),deceleration:y(n,i,o,.04)})})},e._adjustContentOffsetIfNeeded=function(){this.setState(function(t,e){var n=t.contentOffset,i=t.contentVelocity,o=t.size,r=t.contentSize,a=t.drag,s=t.deceleration,l=e.pagingEnabled;if(n===p(n,o,r,!1))return null;var c;s?s.endOffset===p(s.endOffset,o,r,!1)||(c=p(c=s.rate!==k?v(n,i,o,l,.04):s.endOffset,o,r,l)):a||(c=p(n,o,r,l));return c?{contentOffset:m({},n),deceleration:y(n,i,c,.04)}:null})},e._requestDecelerationTimer=function(){var t=this;this._decelerationTimer&&r(this._decelerationTimer),this._decelerationTimer=o(function(){t._decelerationTimer=void 0,t._decelerate()})},e._cancelDecelerationTimer=function(){this._decelerationTimer&&(r(this._decelerationTimer),this._decelerationTimer=void 0)},e._decelerate=function(){this.setState(function(t){var e=t.deceleration;if(!e)return null;var n=(new Date).getTime();if(e.startTime+e.duration<=n)return{contentOffset:e.endOffset,contentVelocity:{x:0,y:0},deceleration:null};var i=function t(e,n,i){if(i){var o,r=("y"===i?["y"]:["x"])[0],a=e.points,s=e.duration,l=Math.max(0,Math.min((n-e.startTime)/s,1)),c=a[r],u=c[0],d=c[1],h=c[2],f=c[3],p=u-3*(u-d)*l+3*(u-2*d+h)*Math.pow(l,2)-(u-3*d+3*h-f)*Math.pow(l,3),v=(-3*(u-d)+6*(u-2*d+h)*l-3*(u-3*d+3*h-f)*Math.pow(l,2))/s;return(o={})[r+"Offset"]=p,o[r+"Velocity"]=v,o}return m({},t(e,n,"x"),t(e,n,"y"))}(e,n);return{contentOffset:{x:i.xOffset,y:i.yOffset},contentVelocity:{x:i.xVelocity,y:i.yVelocity}}})},e.render=function(){var e=this,t=this.props,n=d(t,["width","height","pagingEnabled","directionalLockEnabled","alwaysBounceX","alwaysBounceY","onScroll","onDragStart","onDragEnd","onDecelerationStart","onDecelerationEnd","onContentResize"]),i=this.state,o=i.size,r=i.contentSize,a=i.contentOffset,s=n.children;"function"==typeof s&&(s=s(this)),g.isValidElement(s)&&s.props.connectWithPad||(s=g.createElement(O,null,s));var l=s.props.onResize,c={ref:s.ref,style:h.create(m({position:"relative",width:r.width,height:r.height,transformTranslate:[a.x,a.y]},s.props.style)),visibleRect:this.getVisibleRect(),onResize:function(t){e._setStateWithScroll({contentSize:t}),l(t)}};return s=g.cloneElement(s,c),n.children=s,n.onStart=this._onDragStart,n.onMove=this._onDragMove,n.onEnd=this._onDragEnd,n.onCancel=this._onDragCancel,n.style=m({overflow:"hidden",position:"relative",width:o.width,height:o.height},n.style),g.createElement(u,m({},n,{ref:this.elemRef}))},t}(g.Component);function N(t,e,n){if(n){var i,o="y"===n?["y","height"]:["x","width"],r=o[0],a=o[1],s=Math.max(t[r],e[r]),l=Math.min(t[r]+t[a],e[r]+e[a]);return(i={})[r]=s-t[r],i[a]=Math.max(0,l-s),i}return m({},N(t,e,"x"),N(t,e,"y"))}function H(t,e,n){if(n){var i="y"===n?["y","height"]:["x","width"],o=i[0],r=i[1],a=t[o]-e[o];return-.25*e[r]<=a+t[r]&&a<=1.25*e[r]}return H(t,e,"x")&&H(t,e,"y")}function A(){}W.defaultProps=m({},u.defaultProps,{width:0,height:0,pagingEnabled:!1,directionalLockEnabled:!1,alwaysBounceX:!0,alwaysBounceY:!0,onScroll:function(){},onDragStart:function(){},onDragEnd:function(){},onDecelerationStart:function(){},onDecelerationEnd:function(){},onContentResize:function(){}});var V=function(n){function t(t){var e;return(e=n.call(this,t)||this).state=j(t),e}i(t,n);var e=t.prototype;return e.componentDidMount=function(){var t=this.state.size;t&&this.props.onResize(t)},e.componentDidUpdate=function(t,e){var n=this.props,i=n.onResize,o=this.state.size;t.direction===n.direction&&t.width===n.width&&t.height===n.height&&t.rowSpacing===n.rowSpacing&&t.columnSpacing===n.columnSpacing&&t.itemCount===n.itemCount&&t.itemWidth===n.itemWidth&&t.itemHeight===n.itemHeight||this._layout(),e.size===o||o&&i(o)},e.getSize=function(){return this.state.size},e.getCount=function(){return this.state.count},e.getItemRect=function(t){var e=t.itemIndex,n=t.rowIndex,i=t.columnIndex,o=this.state,r=o.layoutList;void 0!==n&&void 0!==i&&(e=function(t,e,n){var i="x"===n?["column","row"]:["row","column"],o=i[1];return t[o]+t[i[0]]*e[o]}({row:n,column:i},o.count,this.props.direction));var a=r[e];return a&&a.rect||null},e._layout=function(){this.setState(function(t,e){var n=t.size,i={},o=j(e);return i.count=o.count,i.layoutList=o.layoutList,I(o.size,n)||(i.size=o.size),i})},e._renderItem=function(t){var e,n,i=t.itemIndex,o=t.rect,r=t.visibleRect,a=t.needsRender,s=t.Item,l=(0,this.props.renderItem)(t),c={position:"absolute",left:o.x,top:o.y,width:o.width,height:o.height};if(g.isValidElement(l)&&l.type===s&&(l.props.style&&(c=m({},c,l.props.style)),e=l.props.forceRender,n=l.key,l=l.props.children),n||(n=""+i),!e&&!a)return null;g.isValidElement(l)&&l.props.connectWithPad||(l=g.createElement(L,null,l)),l.props.style&&(c=m({},c,l.props.style));var u={key:n,ref:l.ref,style:c,visibleRect:r};return"number"!=typeof l.props.width&&(u.width=o.width),"number"!=typeof l.props.height&&(u.height=o.height),g.cloneElement(l,u)},e.render=function(){var t=this.props,e=t.visibleRect,n=d(t,["direction","width","height","rowSpacing","columnSpacing","itemCount","itemWidth","itemHeight","renderItem","visibleRect","onResize","connectWithPad"]),i=this.state,o=i.size,r=i.layoutList,a={position:"relative"};o&&(a.width=o.width,a.height=o.height),n.style=m({},a,n.style);for(var s=[],l=0;l<r.length;l++){var c=r[l],u=m({},c,{itemIndex:l,visibleRect:N(c.rect,e),needsRender:H(c.rect,e),Item:A});s.push(this._renderItem(u))}return n.children=s,g.createElement("div",n)},t}(g.Component);function j(t){var e,n,i=t.itemCount,o={width:t.itemWidth,height:t.itemHeight},r={row:t.rowSpacing,column:t.columnSpacing},a="x"===t.direction?["y","x","height","width","column","row"]:["x","y","width","height","row","column"],s=a[0],l=a[1],c=a[2],u=a[3],d=a[4],h=a[5],f={width:t.width,height:t.height}[c],p=0,v=0,g=0,m=[];"number"!=typeof f?(g=i,0===o[c]?f=0:(f=i*o[c],1<i&&(f+=(i-1)*r[h]))):0===o[c]?g=i:(g=1,o[c]<f?g+=Math.floor((f-o[c])/(o[c]+r[h])):f=o[c]),0<g&&(v=Math.ceil(i/g));for(var y=0;y<v;y++){0<y&&(p+=r[d]);for(var b=0;b<g;b++){var w,x,_=b+y*g,z=0;if(1<g&&(z+=Math.round(b*((f-o[c])/(g-1)))),i<=_)break;m.push(((x={rect:(w={},w[s]=z,w[l]=p,w[c]=o[c],w[u]=o[u],w)})[d+"Index"]=y,x[h+"Index"]=b,x))}p+=o[u]}return{size:(e={},e[c]=f,e[u]=p,e),count:(n={},n[d]=v,n[h]=g,n),layoutList:m}}function q(){}V.defaultProps={direction:"y",width:null,height:null,rowSpacing:0,columnSpacing:0,itemCount:0,itemWidth:0,itemHeight:0,renderItem:function(){return null},visibleRect:{x:0,y:0,width:0,height:0},onResize:function(){},connectWithPad:!0};var B=function(n){function t(t){var e;return(e=n.call(this,t)||this)._itemHashList=[],e._itemSizeDict={},e._invalidLayout=!1,e.state=U(t,e._itemHashList,e._itemSizeDict),e}i(t,n);var e=t.prototype;return e.componentDidMount=function(){var t=this.state.size;t&&this.props.onResize(t),this._invalidLayout&&this._layout()},e.componentDidUpdate=function(t,e){var n=this.props,i=n.onResize,o=this.state.size;n.direction===t.direction&&n.width===t.width&&n.height===t.height&&n.spacing===t.spacing&&n.itemCount===t.itemCount&&n.estimatedItemWidth===t.estimatedItemWidth&&n.estimatedItemHeight===t.estimatedItemHeight||(this._invalidLayout=!0),e.size===o||o&&i(o),this._invalidLayout&&this._layout()},e.getSize=function(){return this.state.size},e.getItemRect=function(t){var e=this.state.layoutList[t.itemIndex];return e&&e.rect||null},e._layout=function(){var r=this;this._invalidLayout=!1,this.setState(function(t,e){var n=t.size,i={},o=U(e,r._itemHashList,r._itemSizeDict);return i.fixed=o.fixed,i.layoutList=o.layoutList,I(o.size,n)||(i.size=o.size),i})},e._renderItem=function(t){var e,n,i,o=this,r=this.state.fixed,a=t.itemIndex,s=t.rect,l=t.visibleRect,c=t.needsRender,u=t.Item,d=(0,this.props.renderItem)(t),h={position:"absolute",left:s.x,top:s.y,width:s.width,height:s.height};if(g.isValidElement(d)&&d.type===u&&(d.props.style&&(h=m({},h,d.props.style)),e=d.props.forceRender,n=d.props.hash,i=d.key,d=d.props.children),i||(i=""+a),void 0===n&&(n=i),n!==this._itemHashList[a]&&(this._invalidLayout=!0,this._itemHashList[a]=n),!e&&!c)return null;g.isValidElement(d)&&d.props.connectWithPad||(d=g.createElement(L,null,d)),d.props.style&&(h=m({},h,d.props.style));var f=d.props.onResize,p={key:i,ref:d.ref,style:h,visibleRect:l,onResize:function(t){I(t,o._itemSizeDict[n])||(o._itemSizeDict[n]=t,o._layout()),f(t)}},v=this._itemSizeDict[n];return v?(p.width=v.width,p.height=v.height):("number"==typeof r.height&&"number"!=typeof d.props.height&&(p.height=r.height),"number"==typeof r.width&&"number"!=typeof d.props.width&&(p.width=r.width)),g.cloneElement(d,p)},e.render=function(){var t=this.props,e=t.visibleRect,n=d(t,["direction","width","height","spacing","itemCount","estimatedItemWidth","estimatedItemHeight","renderItem","visibleRect","onResize","connectWithPad"]),i=this.state,o=i.size,r=i.layoutList,a={position:"relative"};o&&(a.width=o.width,a.height=o.height),n.style=m({},a,n.style);for(var s=[],l=0;l<r.length;l++){var c=r[l],u=m({},c,{itemIndex:l,visibleRect:N(c.rect,e),needsRender:H(c.rect,e),Item:q});s.push(this._renderItem(u))}return n.children=s,g.createElement("div",n)},t}(g.Component);function U(t,e,n){var i,o=t.spacing,r=t.itemCount,a={width:t.width,height:t.height},s={width:t.estimatedItemWidth,height:t.estimatedItemHeight},l="x"===t.direction?["y","x","height","width"]:["x","y","width","height"],c=l[0],u=l[1],d=l[2],h=l[3],f=0,p=0,v=[],g={};"number"==typeof a[d]&&(g[d]=a[d]);for(var m=0;m<r;m++){var y,b,w=n[e[m]]||((y={})[d]=void 0===g[d]?s[d]:g[d],y[h]=s[h],y);v.push({rect:(b={},b[c]=0,b[u]=p,b[d]=w[d],b[h]=w[h],b)}),0<w[h]&&(p+=w[h],m<r-1&&(p+=o)),f<w[d]&&(f=w[d])}return{size:(i={},i[d]=f,i[h]=p,i),fixed:g,layoutList:v}}B.defaultProps={direction:"y",width:null,height:null,spacing:0,itemCount:0,estimatedItemWidth:0,estimatedItemHeight:0,renderItem:function(){return null},visibleRect:{x:0,y:0,width:0,height:0},onResize:function(){},connectWithPad:!0};var X=function(n){function t(t){var e;return(e=n.call(this,t)||this).state={size:null,prevWidth:null,prevHeight:null},e.resizeRef=g.createRef(),e}i(t,n),t.getDerivedStateFromProps=function(t,e){var n=t.width,i=t.height,o=e.prevWidth,r=e.prevHeight,a=null;if(n!==o||i!==r){var s=null;"number"==typeof n&&"number"==typeof i&&(s={width:n,height:i}),a=a||{},I(s,e.size)||(a.size=s),n!==o&&(a.prevWidth=n),i!==r&&(a.prevHeight=i)}return a};var e=t.prototype;return e.componentDidMount=function(){var t=this.state.size;t?this.props.onResize(t):this.calculateSize(),this._checkResizeNode()},e.componentDidUpdate=function(t,e){var n=this.props,i=n.onResize,o=this.state.size;n.width===t.width&&n.height===t.height||this._checkResizeNode(),o!==e.size&&(o?i(o):this.calculateSize())},e.componentWillUnmount=function(){this._detachResizeNode()},e.getSize=function(){return this.state.size},e.calculateSize=function(){var o=this;this.setState(function(t){var e=o.resizeRef.current;if(!e)return null;var n=t.size,i=T(e);return I(i,n)?null:{size:i}})},e._checkResizeNode=function(){var t=this.props;"number"==typeof t.width&&"number"==typeof t.height?this._detachResizeNode():this._attachResizeNode(this.resizeRef.current)},e._attachResizeNode=function(t){var e=this;this._resizeNode||P.listenTo(this._resizeNode=t,function(){return e.calculateSize()})},e._detachResizeNode=function(){this._resizeNode&&(P.uninstall(this._resizeNode),this._resizeNode=void 0)},e.render=function(){var t=this.props,e=t.width,n=t.height,i=d(t,["width","height","onResize"]),o=this.state.size,r=i.children;return o?"function"==typeof r&&(r=r(o)):r=null,i.children=r,i.style=m({width:"number"==typeof e?e:"100%",height:"number"==typeof n?n:"100%"},i.style),g.createElement("div",m({},i,{ref:this.resizeRef}))},t}(g.Component);X.defaultProps={width:null,height:null,onResize:function(){}};var Y=function(e){function t(t){var i;return(i=e.call(this,t)||this)._onPadDragStart=function(t){i._stopPlaying(),i.props.onDragStart(t)},i._onPadDragEnd=function(t){i._startPlaying(),i.props.onDragEnd(t)},i._onPadDecelerationStart=function(t){i._stopPlaying(),i.props.onDecelerationStart(t)},i._onPadDecelerationEnd=function(t){i._startPlaying(),i.props.onDecelerationEnd(t)},i._onPadMouseEnter=function(t){var e=i.props.onMouseEnter;i.setState({mouseEntered:!0},function(){i._stopPlaying()}),e&&e(t)},i._onPadMouseLeave=function(t){var e=i.props.onMouseLeave;i.setState({mouseEntered:!1},function(){i._startPlaying()}),e&&e(t)},i._onPadScroll=function(t){var e=i.props,h=e.direction,n=e.onScroll,f=i.state.loopCount;i.padRef.current.scrollTo({offset:function(t){var e,n=t.contentOffset,i=t.size,o=t.contentSize,r="y"===h?["height","y","x"]:["width","x","y"],a=r[0],s=r[1],l=r[2],c=o[a]/f,u=.5*(o[a]-c-i[a]),d=n[s];return i[a]-o[a]+u<d?0-u<d&&(d-=c):d+=c,d===n[s]?null:((e={})[s]=d,e[l]=n[l],e)},animated:!1}),n(t)},i._onPadContentResize=function(s){i.setState(function(t,e){var n=t.loopCount,i=1;if(e.loop){var o="y"===e.direction?"height":"width",r={width:e.width,height:e.height}[o],a=s[o]/n;a&&r&&(i+=1+Math.floor(r/a))}return i===n?null:{loopCount:i}}),i.props.onContentResize(s)},i.state={mouseEntered:!1,loopCount:1},i.padRef=g.createRef(),i}i(t,e);var n=t.prototype;return n.componentDidMount=function(){this.props.autoplayEnabled&&this._startPlaying()},n.componentDidUpdate=function(t){var e=this.props,n=e.autoplayEnabled;n===t.autoplayEnabled&&e.autoplayInterval===t.autoplayInterval||(this._stopPlaying(),n&&this._startPlaying())},n.componentWillUnmount=function(){this._stopPlaying()},n.go=function(t){var h=t.delta,f=this.props.direction,p=this.state.loopCount;this.padRef.current.scrollTo({offset:function(t,e){var n,i=t.contentOffset,o=e.pagingEnabled,r="y"===f?["height","y","x"]:["width","x","y"],a=r[0],s=r[1],l=r[2],c=t.size[a],u=i[s]-h*c;if(p<=1){var d=Math.min(c-t.contentSize[a],0);o&&0<c&&(d=c*Math.ceil(d/c)),u<d?u=d-c<u?d:0:0<u&&(u=u<c?0:d)}return(n={})[s]=u,n[l]=i[l],n},animated:t.animated})},n.rewind=function(){this.go({delta:-1})},n.forward=function(){this.go({delta:1})},n._startPlaying=function(){var t=this,e=this.padRef.current;if(e&&!e.isDragging()&&!e.isDecelerating()&&!this.state.mouseEntered){var n=this.props.autoplayInterval;this._autoplayTimer&&clearTimeout(this._autoplayTimer),this._autoplayTimer=setTimeout(function(){t._autoplayTimer=void 0,t.forward()},n)}},n._stopPlaying=function(){this._autoplayTimer&&(clearTimeout(this._autoplayTimer),this._autoplayTimer=void 0)},n.render=function(){var t=this.props,e=t.direction,n=t.autoplayEnabled,i=d(t,["direction","autoplayEnabled","autoplayInterval","loop","scrollsBackOnEdge"]),o=this.state.loopCount;"x"===e?i.alwaysBounceY=!1:i.alwaysBounceX=!1;var r=i.children;return"function"==typeof r&&(r=r(this)),i.children=g.createElement(B,{direction:e,itemCount:o,renderItem:function(t){return g.createElement(t.Item,{forceRender:!0},r)}}),i.onContentResize=this._onPadContentResize,1<o&&(i.onScroll=this._onPadScroll),n&&(i.onDragStart=this._onPadDragStart,i.onDragEnd=this._onPadDragEnd,i.onDecelerationStart=this._onPadDecelerationStart,i.onDecelerationEnd=this._onPadDecelerationEnd,i.onMouseEnter=this._onPadMouseEnter,i.onMouseLeave=this._onPadMouseLeave),g.createElement(W,m({},i,{ref:this.padRef}))},t}(g.Component);Y.defaultProps=m({},W.defaultProps,{direction:"x",autoplayEnabled:!0,autoplayInterval:3e3,loop:!0,pagingEnabled:!0});var F=function(e){function t(t){var n;return(n=e.call(this,t)||this)._onPlayerScroll=function(t){var e=n._calculateActiveIndex({size:t.size,contentOffset:t.contentOffset});e!==n.state.activeIndex&&n.setState({activeIndex:e}),n.props.onScroll(t)},n.state={activeIndex:0},n.playerRef=g.createRef(),n}i(t,e);var n=t.prototype;return n.componentDidUpdate=function(t,e){var n=this.props,i=this.state.activeIndex;e.activeIndex!==i&&(0,n.onSlideChange)({itemCount:n.itemCount,activeIndex:i})},n.getActiveIndex=function(){return this.state.activeIndex},n.slideTo=function(t){this.playerRef.current.go({delta:t.index-this.state.activeIndex,animated:t.animated})},n.slidePrev=function(){this.playerRef.current.rewind()},n.slideNext=function(){this.playerRef.current.forward()},n._calculateActiveIndex=function(t){var e=this.props,n=e.itemCount,i="x"===e.direction?["width","x"]:["height","y"];return Math.max(Math.round(-t.contentOffset[i[1]]/t.size[i[0]]),0)%n},n.render=function(){var t=this.props,e=t.itemCount,n=t.renderItem,i=d(t,["itemCount","renderItem","renderIndicator","onSlideChange"]),o=i.width,r=i.height,a=g.createElement(V,m({ref:this.gridRef},{width:o,height:r,itemWidth:o,itemHeight:r,direction:i.direction,itemCount:e,renderItem:n}));return i.children=a,i.onScroll=this._onPlayerScroll,g.createElement(Y,m({},i,{ref:this.playerRef}))},t}(g.Component);F.defaultProps=m({},Y.defaultProps,{itemCount:0,renderItem:function(){return null},renderIndicator:null,onSlideChange:function(){}}),t.AutoResizing=X,t.Carousel=F,t.GeneralContent=O,t.GridContent=V,t.ItemContent=L,t.ListContent=B,t.Pad=W,t.Pannable=u,t.Player=Y,Object.defineProperty(t,"__esModule",{value:!0})});

@@ -20,8 +20,6 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";

_this = _React$Component.call(this, props) || this;
var itemHashDict = {};
var itemSizeDict = {};
_this.state = _extends({}, calculateLayout(props, itemHashDict, itemSizeDict), {
itemHashDict: itemHashDict,
itemSizeDict: itemSizeDict
});
_this._itemHashList = [];
_this._itemSizeDict = {};
_this._invalidLayout = false;
_this.state = calculateLayout(props, _this._itemHashList, _this._itemSizeDict);
return _this;

@@ -39,3 +37,5 @@ }

this._updateItemHashDict();
if (this._invalidLayout) {
this._layout();
}
};

@@ -53,9 +53,6 @@

onResize = _this$props.onResize;
var _this$state = this.state,
size = _this$state.size,
itemHashDict = _this$state.itemHashDict,
itemSizeDict = _this$state.itemSizeDict;
var size = this.state.size;
if (direction !== prevProps.direction || width !== prevProps.width || height !== prevProps.height || spacing !== prevProps.spacing || itemCount !== prevProps.itemCount || estimatedItemWidth !== prevProps.estimatedItemWidth || estimatedItemHeight !== prevProps.estimatedItemHeight || itemHashDict !== prevState.itemHashDict || itemSizeDict !== prevState.itemSizeDict) {
this._layout();
if (direction !== prevProps.direction || width !== prevProps.width || height !== prevProps.height || spacing !== prevProps.spacing || itemCount !== prevProps.itemCount || estimatedItemWidth !== prevProps.estimatedItemWidth || estimatedItemHeight !== prevProps.estimatedItemHeight) {
this._invalidLayout = true;
}

@@ -69,3 +66,5 @@

this._updateItemHashDict();
if (this._invalidLayout) {
this._layout();
}
};

@@ -85,8 +84,9 @@

_proto._layout = function _layout() {
var _this2 = this;
this._invalidLayout = false;
this.setState(function (state, props) {
var size = state.size,
itemHashDict = state.itemHashDict,
itemSizeDict = state.itemSizeDict;
var size = state.size;
var nextState = {};
var layout = calculateLayout(props, itemHashDict, itemSizeDict);
var layout = calculateLayout(props, _this2._itemHashList, _this2._itemSizeDict);
nextState.fixed = layout.fixed;

@@ -103,19 +103,2 @@ nextState.layoutList = layout.layoutList;

_proto._updateItemHashDict = function _updateItemHashDict() {
var _this2 = this;
this.setState(function (state) {
if (!_this2._itemHashDict) {
return null;
}
var itemHashDict = _extends({}, state.itemHashDict, _this2._itemHashDict);
_this2._itemHashDict = undefined;
return {
itemHashDict: itemHashDict
};
});
};
_proto._renderItem = function _renderItem(layoutAttrs) {

@@ -125,6 +108,3 @@ var _this3 = this;

var renderItem = this.props.renderItem;
var _this$state2 = this.state,
fixed = _this$state2.fixed,
itemHashDict = _this$state2.itemHashDict,
itemSizeDict = _this$state2.itemSizeDict;
var fixed = this.state.fixed;
var itemIndex = layoutAttrs.itemIndex,

@@ -166,8 +146,5 @@ rect = layoutAttrs.rect,

if (itemHashDict[itemIndex] !== hash) {
if (!this._itemHashDict) {
this._itemHashDict = {};
}
this._itemHashDict[itemIndex] = hash;
if (hash !== this._itemHashList[itemIndex]) {
this._invalidLayout = true;
this._itemHashList[itemIndex] = hash;
}

@@ -187,3 +164,3 @@

var _onResize = element.props.onResize;
var onItemResize = element.props.onResize;
var elemProps = {

@@ -195,23 +172,16 @@ key: key,

onResize: function onResize(size) {
_this3.setState(function (state) {
var _extends2;
if (!isEqualSize(size, _this3._itemSizeDict[hash])) {
_this3._itemSizeDict[hash] = size;
return {
itemSizeDict: _extends({}, state.itemSizeDict, (_extends2 = {}, _extends2[hash] = size, _extends2))
};
});
_this3._layout();
}
_onResize(size);
onItemResize(size);
}
};
var itemSize = itemSizeDict[hash];
var itemSize = this._itemSizeDict[hash];
if (itemSize) {
if (typeof element.props.width !== 'number') {
elemProps.width = itemSize.width;
}
if (typeof element.props.height !== 'number') {
elemProps.height = itemSize.height;
}
elemProps.width = itemSize.width;
elemProps.height = itemSize.height;
} else {

@@ -245,5 +215,5 @@ if (typeof fixed.height === 'number' && typeof element.props.height !== 'number') {

var _this$state3 = this.state,
size = _this$state3.size,
layoutList = _this$state3.layoutList;
var _this$state = this.state,
size = _this$state.size,
layoutList = _this$state.layoutList;
var elemStyle = {

@@ -303,3 +273,3 @@ position: 'relative'

function calculateLayout(props, itemHashDict, itemSizeDict) {
function calculateLayout(props, itemHashList, itemSizeDict) {
var _size;

@@ -337,3 +307,3 @@

var itemHash = itemHashDict[itemIndex];
var itemHash = itemHashList[itemIndex];
var itemSize = itemSizeDict[itemHash] || (_ref3 = {}, _ref3[width] = fixed[width] === undefined ? estimatedItemSize[width] : fixed[width], _ref3[height] = estimatedItemSize[height], _ref3);

@@ -340,0 +310,0 @@ layoutList.push({

@@ -10,3 +10,3 @@ "use strict";

var _extends3 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

@@ -34,8 +34,6 @@ var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));

_this = _React$Component.call(this, props) || this;
var itemHashDict = {};
var itemSizeDict = {};
_this.state = (0, _extends3["default"])({}, calculateLayout(props, itemHashDict, itemSizeDict), {
itemHashDict: itemHashDict,
itemSizeDict: itemSizeDict
});
_this._itemHashList = [];
_this._itemSizeDict = {};
_this._invalidLayout = false;
_this.state = calculateLayout(props, _this._itemHashList, _this._itemSizeDict);
return _this;

@@ -53,3 +51,5 @@ }

this._updateItemHashDict();
if (this._invalidLayout) {
this._layout();
}
};

@@ -67,9 +67,6 @@

onResize = _this$props.onResize;
var _this$state = this.state,
size = _this$state.size,
itemHashDict = _this$state.itemHashDict,
itemSizeDict = _this$state.itemSizeDict;
var size = this.state.size;
if (direction !== prevProps.direction || width !== prevProps.width || height !== prevProps.height || spacing !== prevProps.spacing || itemCount !== prevProps.itemCount || estimatedItemWidth !== prevProps.estimatedItemWidth || estimatedItemHeight !== prevProps.estimatedItemHeight || itemHashDict !== prevState.itemHashDict || itemSizeDict !== prevState.itemSizeDict) {
this._layout();
if (direction !== prevProps.direction || width !== prevProps.width || height !== prevProps.height || spacing !== prevProps.spacing || itemCount !== prevProps.itemCount || estimatedItemWidth !== prevProps.estimatedItemWidth || estimatedItemHeight !== prevProps.estimatedItemHeight) {
this._invalidLayout = true;
}

@@ -83,3 +80,5 @@

this._updateItemHashDict();
if (this._invalidLayout) {
this._layout();
}
};

@@ -99,8 +98,9 @@

_proto._layout = function _layout() {
var _this2 = this;
this._invalidLayout = false;
this.setState(function (state, props) {
var size = state.size,
itemHashDict = state.itemHashDict,
itemSizeDict = state.itemSizeDict;
var size = state.size;
var nextState = {};
var layout = calculateLayout(props, itemHashDict, itemSizeDict);
var layout = calculateLayout(props, _this2._itemHashList, _this2._itemSizeDict);
nextState.fixed = layout.fixed;

@@ -117,18 +117,2 @@ nextState.layoutList = layout.layoutList;

_proto._updateItemHashDict = function _updateItemHashDict() {
var _this2 = this;
this.setState(function (state) {
if (!_this2._itemHashDict) {
return null;
}
var itemHashDict = (0, _extends3["default"])({}, state.itemHashDict, _this2._itemHashDict);
_this2._itemHashDict = undefined;
return {
itemHashDict: itemHashDict
};
});
};
_proto._renderItem = function _renderItem(layoutAttrs) {

@@ -138,6 +122,3 @@ var _this3 = this;

var renderItem = this.props.renderItem;
var _this$state2 = this.state,
fixed = _this$state2.fixed,
itemHashDict = _this$state2.itemHashDict,
itemSizeDict = _this$state2.itemSizeDict;
var fixed = this.state.fixed;
var itemIndex = layoutAttrs.itemIndex,

@@ -162,3 +143,3 @@ rect = layoutAttrs.rect,

if (element.props.style) {
itemStyle = (0, _extends3["default"])({}, itemStyle, element.props.style);
itemStyle = (0, _extends2["default"])({}, itemStyle, element.props.style);
}

@@ -180,8 +161,5 @@

if (itemHashDict[itemIndex] !== hash) {
if (!this._itemHashDict) {
this._itemHashDict = {};
}
this._itemHashDict[itemIndex] = hash;
if (hash !== this._itemHashList[itemIndex]) {
this._invalidLayout = true;
this._itemHashList[itemIndex] = hash;
}

@@ -198,6 +176,6 @@

if (element.props.style) {
itemStyle = (0, _extends3["default"])({}, itemStyle, element.props.style);
itemStyle = (0, _extends2["default"])({}, itemStyle, element.props.style);
}
var _onResize = element.props.onResize;
var onItemResize = element.props.onResize;
var elemProps = {

@@ -209,23 +187,16 @@ key: key,

onResize: function onResize(size) {
_this3.setState(function (state) {
var _extends2;
if (!(0, _geometry.isEqualSize)(size, _this3._itemSizeDict[hash])) {
_this3._itemSizeDict[hash] = size;
return {
itemSizeDict: (0, _extends3["default"])({}, state.itemSizeDict, (_extends2 = {}, _extends2[hash] = size, _extends2))
};
});
_this3._layout();
}
_onResize(size);
onItemResize(size);
}
};
var itemSize = itemSizeDict[hash];
var itemSize = this._itemSizeDict[hash];
if (itemSize) {
if (typeof element.props.width !== 'number') {
elemProps.width = itemSize.width;
}
if (typeof element.props.height !== 'number') {
elemProps.height = itemSize.height;
}
elemProps.width = itemSize.width;
elemProps.height = itemSize.height;
} else {

@@ -258,5 +229,5 @@ if (typeof fixed.height === 'number' && typeof element.props.height !== 'number') {

props = (0, _objectWithoutPropertiesLoose2["default"])(_this$props2, ["direction", "width", "height", "spacing", "itemCount", "estimatedItemWidth", "estimatedItemHeight", "renderItem", "visibleRect", "onResize", "connectWithPad"]);
var _this$state3 = this.state,
size = _this$state3.size,
layoutList = _this$state3.layoutList;
var _this$state = this.state,
size = _this$state.size,
layoutList = _this$state.layoutList;
var elemStyle = {

@@ -271,3 +242,3 @@ position: 'relative'

props.style = (0, _extends3["default"])({}, elemStyle, props.style);
props.style = (0, _extends2["default"])({}, elemStyle, props.style);
var items = [];

@@ -277,3 +248,3 @@

var attrs = layoutList[itemIndex];
var layoutAttrs = (0, _extends3["default"])({}, attrs, {
var layoutAttrs = (0, _extends2["default"])({}, attrs, {
itemIndex: itemIndex,

@@ -316,3 +287,3 @@ visibleRect: (0, _visible.getItemVisibleRect)(attrs.rect, visibleRect),

function calculateLayout(props, itemHashDict, itemSizeDict) {
function calculateLayout(props, itemHashList, itemSizeDict) {
var _size;

@@ -350,3 +321,3 @@

var itemHash = itemHashDict[itemIndex];
var itemHash = itemHashList[itemIndex];
var itemSize = itemSizeDict[itemHash] || (_ref3 = {}, _ref3[width] = fixed[width] === undefined ? estimatedItemSize[width] : fixed[width], _ref3[height] = estimatedItemSize[height], _ref3);

@@ -353,0 +324,0 @@ layoutList.push({

{
"name": "react-pannable",
"version": "0.10.6",
"version": "0.10.7",
"description": "Simulate pan gesture and scroll view for touch devices with React",

@@ -5,0 +5,0 @@ "keywords": [

@@ -22,13 +22,14 @@ # react-pannable

- [Draggable Notes](https://n43.github.io/react-pannable/?selectedKind=Pannable&selectedStory=Note&full=0&addons=0&stories=1&panelRight=0)
- [Adjustable Sticker](https://n43.github.io/react-pannable/?selectedKind=Pannable&selectedStory=Sticker&full=0&addons=0&stories=1&panelRight=0)
- [Draggable Notes](https://n43.github.io/react-pannable/?path=/story/pannable--note)
- [Adjustable Sticker](https://n43.github.io/react-pannable/?path=/story/pannable--sticker)
Some `Pad` demos
- [Scrollable Content](https://n43.github.io/react-pannable/?selectedKind=Pad&selectedStory=Scrollable%20Content&full=0&addons=0&stories=1&panelRight=0)
- [Locating Specified Content](https://n43.github.io/react-pannable/?selectedKind=Pad&selectedStory=Locating%20Specified%20Content&full=0&addons=0&stories=1&panelRight=0)
- [Auto Resizing with Pad](https://n43.github.io/react-pannable/?selectedKind=Pad&selectedStory=Auto%20Resizing%20with%20Pad&full=0&addons=0&stories=1&panelRight=0)
- [Layout with General Content](https://n43.github.io/react-pannable/?selectedKind=Pad&selectedStory=Layout%20with%20General%20Content&full=0&addons=0&stories=1&panelRight=0)
- [Layout with Grid Content](https://n43.github.io/react-pannable/?selectedKind=Pad&selectedStory=Layout%20with%20Grid%20Content&full=0&addons=0&stories=1&panelRight=0)
- [Layout with List Content](https://n43.github.io/react-pannable/?selectedKind=Pad&selectedStory=Layout%20with%20List%20Content&full=0&addons=0&stories=1&panelRight=0)
- [Scrollable Content](https://n43.github.io/react-pannable/?path=/story/pad--scrollable-content)
- [Locating Specified Content](https://n43.github.io/react-pannable/?path=/story/pad--locating-specified-content)
- [Auto Resizing with Pad](https://n43.github.io/react-pannable/?path=/story/pad--auto-resizing-with-pad)
- [Layout with General Content](https://n43.github.io/react-pannable/?path=/story/pad--layout-with-general-content)
- [Layout with Grid Content](https://n43.github.io/react-pannable/?path=/story/pad--layout-with-grid-content)
- [Layout with List Content](https://n43.github.io/react-pannable/?path=/story/pad--layout-with-list-content)
- [Layout with Nested Content](https://n43.github.io/react-pannable/?path=/story/pad--layout-with-nested-content)

@@ -35,0 +36,0 @@ ## API Reference

@@ -26,10 +26,7 @@ import React from 'react';

const itemHashDict = {};
const itemSizeDict = {};
this._itemHashList = [];
this._itemSizeDict = {};
this._invalidLayout = false;
this.state = {
...calculateLayout(props, itemHashDict, itemSizeDict),
itemHashDict,
itemSizeDict,
};
this.state = calculateLayout(props, this._itemHashList, this._itemSizeDict);
}

@@ -44,3 +41,5 @@

this._updateItemHashDict();
if (this._invalidLayout) {
this._layout();
}
}

@@ -59,3 +58,3 @@

} = this.props;
const { size, itemHashDict, itemSizeDict } = this.state;
const { size } = this.state;

@@ -69,7 +68,5 @@ if (

estimatedItemWidth !== prevProps.estimatedItemWidth ||
estimatedItemHeight !== prevProps.estimatedItemHeight ||
itemHashDict !== prevState.itemHashDict ||
itemSizeDict !== prevState.itemSizeDict
estimatedItemHeight !== prevProps.estimatedItemHeight
) {
this._layout();
this._invalidLayout = true;
}

@@ -82,3 +79,5 @@ if (prevState.size !== size) {

this._updateItemHashDict();
if (this._invalidLayout) {
this._layout();
}
}

@@ -98,7 +97,13 @@

_layout() {
this._invalidLayout = false;
this.setState((state, props) => {
const { size, itemHashDict, itemSizeDict } = state;
const { size } = state;
const nextState = {};
const layout = calculateLayout(props, itemHashDict, itemSizeDict);
const layout = calculateLayout(
props,
this._itemHashList,
this._itemSizeDict
);

@@ -116,18 +121,5 @@ nextState.fixed = layout.fixed;

_updateItemHashDict() {
this.setState(state => {
if (!this._itemHashDict) {
return null;
}
const itemHashDict = { ...state.itemHashDict, ...this._itemHashDict };
this._itemHashDict = undefined;
return { itemHashDict };
});
}
_renderItem(layoutAttrs) {
const { renderItem } = this.props;
const { fixed, itemHashDict, itemSizeDict } = this.state;
const { fixed } = this.state;

@@ -165,7 +157,5 @@ const { itemIndex, rect, visibleRect, needsRender, Item } = layoutAttrs;

if (itemHashDict[itemIndex] !== hash) {
if (!this._itemHashDict) {
this._itemHashDict = {};
}
this._itemHashDict[itemIndex] = hash;
if (hash !== this._itemHashList[itemIndex]) {
this._invalidLayout = true;
this._itemHashList[itemIndex] = hash;
}

@@ -184,3 +174,3 @@

const onResize = element.props.onResize;
const onItemResize = element.props.onResize;
const elemProps = {

@@ -192,19 +182,16 @@ key,

onResize: size => {
this.setState(state => ({
itemSizeDict: { ...state.itemSizeDict, [hash]: size },
}));
if (!isEqualSize(size, this._itemSizeDict[hash])) {
this._itemSizeDict[hash] = size;
this._layout();
}
onResize(size);
onItemResize(size);
},
};
const itemSize = itemSizeDict[hash];
const itemSize = this._itemSizeDict[hash];
if (itemSize) {
if (typeof element.props.width !== 'number') {
elemProps.width = itemSize.width;
}
if (typeof element.props.height !== 'number') {
elemProps.height = itemSize.height;
}
elemProps.width = itemSize.width;
elemProps.height = itemSize.height;
} else {

@@ -278,3 +265,3 @@ if (

function calculateLayout(props, itemHashDict, itemSizeDict) {
function calculateLayout(props, itemHashList, itemSizeDict) {
const { direction, spacing, itemCount } = props;

@@ -302,3 +289,3 @@ const size = { width: props.width, height: props.height };

for (let itemIndex = 0; itemIndex < itemCount; itemIndex++) {
const itemHash = itemHashDict[itemIndex];
const itemHash = itemHashList[itemIndex];
let itemSize = itemSizeDict[itemHash] || {

@@ -305,0 +292,0 @@ [width]:

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc