(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9986],{94184:function(e,t){var r;/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */!function(){"use strict";var o={}.hasOwnProperty;function n(){for(var e=[],t=0;t0}},{key:"_getScrollDimension",value:function(){var e=document,t=this.props.rootEl;return{scrollTop:t?e.querySelector(t).scrollTop:e.documentElement.scrollTop||e.body.parentNode.scrollTop||e.body.scrollTop,scrollHeight:t?e.querySelector(t).scrollHeight:e.documentElement.scrollHeight||e.body.parentNode.scrollHeight||e.body.scrollHeight}}},{key:"_getElemsViewState",value:function(e){for(var t=[],r=[],o=[],n=e||this.state.targetItems,s=!1,u=0,l=n.length;uu}},{key:"_isAtBottom",value:function(){var e=this.props.rootEl,t=this._getScrollDimension(),r=t.scrollTop,o=t.scrollHeight;return r+(e?document.querySelector(e).getBoundingClientRect().height:window.innerHeight)>=o}},{key:"_getScrolledPast",value:function(e){if(!e.some(function(e){return e}))return e;var t=!1;return e.map(function(e){return e&&!t?(t=!0,!1):!t})}},{key:"_spy",value:function(e){var t=this,r=this._getElemsViewState(e),o=this.state.inViewState;this.setState({inViewState:r.viewStatusList,isScrolledPast:r.scrolledPast},function(){t._update(o)})}},{key:"_update",value:function(e){var t;(t=this.state.inViewState).length===e.length&&t.every(function(t,r){return t===e[r]})||this.props.onUpdate(this.state.targetItems[this.state.inViewState.indexOf(!0)])}},{key:"_handleSpy",value:function(){(0,v.default)(this._spy(),100)}},{key:"_initFromProps",value:function(){var e=this._initSpyTarget(this.props.items);this.setState({targetItems:e}),this._spy(e)}},{key:"offEvent",value:function(){(this.props.rootEl?document.querySelector(this.props.rootEl):window).removeEventListener("scroll",this._handleSpy)}},{key:"onEvent",value:function(){(this.props.rootEl?document.querySelector(this.props.rootEl):window).addEventListener("scroll",this._handleSpy)}},{key:"componentDidMount",value:function(){this._initFromProps(),this.onEvent()}},{key:"componentWillUnmount",value:function(){this.offEvent()}},{key:"UNSAFE_componentWillReceiveProps",value:function(){this._initFromProps()}},{key:"render",value:function(){var e=this,t=this.props.componentTag,r=this.props,o=r.children,i=r.className,u=r.scrolledPastClassName,l=r.style,a=0,p=y.default.Children.map(o,function(t,r){if(!t)return null;var o,i=t.type,l=u&&e.state.isScrolledPast[r],p=(0,h.default)((o={},(0,s.default)(o,"".concat(t.props.className),t.props.className),(0,s.default)(o,"".concat(e.props.currentClassName),e.state.inViewState[r]),(0,s.default)(o,"".concat(e.props.scrolledPastClassName),l),o));return y.default.createElement(i,(0,n.default)({},t.props,{className:p,key:a++}),t.props.children)}),c=(0,h.default)((0,s.default)({},"".concat(i),i));return y.default.createElement(t,{className:c,style:l},p)}}]),t}(y.default.Component);t.Z=_},12502:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=function(e){var t,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return function(){var n=+new Date;t&&ne.length)&&(t=e.length);for(var r=0,o=Array(t);r