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,KAAM,EAAI/H,KAAKoB,sBACdpB,KAAK4C,MAAMJ,+BACdxC,KAAKa,MAAMmH,wBACXhI,KAAKa,MAAMoH,2BACrBjI,KAAKa,MAAMyG,UACVtH,KAAK4C,MAAMiB,aACPwD,aACDrH,KAAKa,MAAM+C,SACX5D,KAAKa,MAAMqH,OACflI,KAAK4C,MAAMiB,YAAc7D,KAAKa,MAAM+C,SAAW5D,KAAKa,MAAMqH,QACzDlI,KAAKa,MAAM+C,SAAW5D,KAAKa,MAAMsH,cAEvCxH,eA1PwB,CA2PjC,mCAAAyH,WAEF","sources":["webpack://giveeasy.cloud/./node_modules/react-infinite-scroll-component/dist/index.es.js"],"sourcesContent":["import React, { Component } from 'react';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n    extendStatics = Object.setPrototypeOf ||\r\n        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n    return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n    extendStatics(d, b);\r\n    function __() { this.constructor = d; }\r\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nvar __assign = function() {\r\n    __assign = Object.assign || function __assign(t) {\r\n        for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n            s = arguments[i];\r\n            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n        }\r\n        return t;\r\n    };\r\n    return __assign.apply(this, arguments);\r\n};\n\n/* eslint-disable no-undefined,no-param-reassign,no-shadow */\n\n/**\n * Throttle execution of a function. Especially useful for rate limiting\n * execution of handlers on events like resize and scroll.\n *\n * @param  {Number}    delay          A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.\n * @param  {Boolean}   [noTrailing]   Optional, defaults to false. If noTrailing is true, callback will only execute every `delay` milliseconds while the\n *                                    throttled-function is being called. If noTrailing is false or unspecified, callback will be executed one final time\n *                                    after the last throttled-function call. (After the throttled-function has not been called for `delay` milliseconds,\n *                                    the internal counter is reset)\n * @param  {Function}  callback       A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,\n *                                    to `callback` when the throttled-function is executed.\n * @param  {Boolean}   [debounceMode] If `debounceMode` is true (at begin), schedule `clear` to execute after `delay` ms. If `debounceMode` is false (at end),\n *                                    schedule `callback` to execute after `delay` ms.\n *\n * @return {Function}  A new, throttled, function.\n */\nfunction throttle (delay, noTrailing, callback, debounceMode) {\n  /*\n   * After wrapper has stopped being called, this timeout ensures that\n   * `callback` is executed at the proper times in `throttle` and `end`\n   * debounce modes.\n   */\n  var timeoutID;\n  var cancelled = false; // Keep track of the last time `callback` was executed.\n\n  var lastExec = 0; // Function to clear existing timeout\n\n  function clearExistingTimeout() {\n    if (timeoutID) {\n      clearTimeout(timeoutID);\n    }\n  } // Function to cancel next exec\n\n\n  function cancel() {\n    clearExistingTimeout();\n    cancelled = true;\n  } // `noTrailing` defaults to falsy.\n\n\n  if (typeof noTrailing !== 'boolean') {\n    debounceMode = callback;\n    callback = noTrailing;\n    noTrailing = undefined;\n  }\n  /*\n   * The `wrapper` function encapsulates all of the throttling / debouncing\n   * functionality and when executed will limit the rate at which `callback`\n   * is executed.\n   */\n\n\n  function wrapper() {\n    var self = this;\n    var elapsed = Date.now() - lastExec;\n    var args = arguments;\n\n    if (cancelled) {\n      return;\n    } // Execute `callback` and update the `lastExec` timestamp.\n\n\n    function exec() {\n      lastExec = Date.now();\n      callback.apply(self, args);\n    }\n    /*\n     * If `debounceMode` is true (at begin) this is used to clear the flag\n     * to allow future `callback` executions.\n     */\n\n\n    function clear() {\n      timeoutID = undefined;\n    }\n\n    if (debounceMode && !timeoutID) {\n      /*\n       * Since `wrapper` is being called for the first time and\n       * `debounceMode` is true (at begin), execute `callback`.\n       */\n      exec();\n    }\n\n    clearExistingTimeout();\n\n    if (debounceMode === undefined && elapsed > delay) {\n      /*\n       * In throttle mode, if `delay` time has been exceeded, execute\n       * `callback`.\n       */\n      exec();\n    } else if (noTrailing !== true) {\n      /*\n       * In trailing throttle mode, since `delay` time has not been\n       * exceeded, schedule `callback` to execute `delay` ms after most\n       * recent execution.\n       *\n       * If `debounceMode` is true (at begin), schedule `clear` to execute\n       * after `delay` ms.\n       *\n       * If `debounceMode` is false (at end), schedule `callback` to\n       * execute after `delay` ms.\n       */\n      timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);\n    }\n  }\n\n  wrapper.cancel = cancel; // Return the wrapper function.\n\n  return wrapper;\n}\n\nvar ThresholdUnits = {\r\n    Pixel: 'Pixel',\r\n    Percent: 'Percent',\r\n};\r\nvar defaultThreshold = {\r\n    unit: ThresholdUnits.Percent,\r\n    value: 0.8,\r\n};\r\nfunction parseThreshold(scrollThreshold) {\r\n    if (typeof scrollThreshold === 'number') {\r\n        return {\r\n            unit: ThresholdUnits.Percent,\r\n            value: scrollThreshold * 100,\r\n        };\r\n    }\r\n    if (typeof scrollThreshold === 'string') {\r\n        if (scrollThreshold.match(/^(\\d*(\\.\\d+)?)px$/)) {\r\n            return {\r\n                unit: ThresholdUnits.Pixel,\r\n                value: parseFloat(scrollThreshold),\r\n            };\r\n        }\r\n        if (scrollThreshold.match(/^(\\d*(\\.\\d+)?)%$/)) {\r\n            return {\r\n                unit: ThresholdUnits.Percent,\r\n                value: parseFloat(scrollThreshold),\r\n            };\r\n        }\r\n        console.warn('scrollThreshold format is invalid. Valid formats: \"120px\", \"50%\"...');\r\n        return defaultThreshold;\r\n    }\r\n    console.warn('scrollThreshold should be string or number');\r\n    return defaultThreshold;\r\n}\n\nvar InfiniteScroll = /** @class */ (function (_super) {\r\n    __extends(InfiniteScroll, _super);\r\n    function InfiniteScroll(props) {\r\n        var _this = _super.call(this, props) || this;\r\n        _this.lastScrollTop = 0;\r\n        _this.actionTriggered = false;\r\n        // variables to keep track of pull down behaviour\r\n        _this.startY = 0;\r\n        _this.currentY = 0;\r\n        _this.dragging = false;\r\n        // will be populated in componentDidMount\r\n        // based on the height of the pull down element\r\n        _this.maxPullDownDistance = 0;\r\n        _this.getScrollableTarget = function () {\r\n            if (_this.props.scrollableTarget instanceof HTMLElement)\r\n                return _this.props.scrollableTarget;\r\n            if (typeof _this.props.scrollableTarget === 'string') {\r\n                return document.getElementById(_this.props.scrollableTarget);\r\n            }\r\n            if (_this.props.scrollableTarget === null) {\r\n                console.warn(\"You are trying to pass scrollableTarget but it is null. This might\\n        happen because the element may not have been added to DOM yet.\\n        See https://github.com/ankeetmaini/react-infinite-scroll-component/issues/59 for more info.\\n      \");\r\n            }\r\n            return null;\r\n        };\r\n        _this.onStart = function (evt) {\r\n            if (_this.lastScrollTop)\r\n                return;\r\n            _this.dragging = true;\r\n            if (evt instanceof MouseEvent) {\r\n                _this.startY = evt.pageY;\r\n            }\r\n            else if (evt instanceof TouchEvent) {\r\n                _this.startY = evt.touches[0].pageY;\r\n            }\r\n            _this.currentY = _this.startY;\r\n            if (_this._infScroll) {\r\n                _this._infScroll.style.willChange = 'transform';\r\n                _this._infScroll.style.transition = \"transform 0.2s cubic-bezier(0,0,0.31,1)\";\r\n            }\r\n        };\r\n        _this.onMove = function (evt) {\r\n            if (!_this.dragging)\r\n                return;\r\n            if (evt instanceof MouseEvent) {\r\n                _this.currentY = evt.pageY;\r\n            }\r\n            else if (evt instanceof TouchEvent) {\r\n                _this.currentY = evt.touches[0].pageY;\r\n            }\r\n            // user is scrolling down to up\r\n            if (_this.currentY < _this.startY)\r\n                return;\r\n            if (_this.currentY - _this.startY >=\r\n                Number(_this.props.pullDownToRefreshThreshold)) {\r\n                _this.setState({\r\n                    pullToRefreshThresholdBreached: true,\r\n                });\r\n            }\r\n            // so you can drag upto 1.5 times of the maxPullDownDistance\r\n            if (_this.currentY - _this.startY > _this.maxPullDownDistance * 1.5)\r\n                return;\r\n            if (_this._infScroll) {\r\n                _this._infScroll.style.overflow = 'visible';\r\n                _this._infScroll.style.transform = \"translate3d(0px, \" + (_this.currentY -\r\n                    _this.startY) + \"px, 0px)\";\r\n            }\r\n        };\r\n        _this.onEnd = function () {\r\n            _this.startY = 0;\r\n            _this.currentY = 0;\r\n            _this.dragging = false;\r\n            if (_this.state.pullToRefreshThresholdBreached) {\r\n                _this.props.refreshFunction && _this.props.refreshFunction();\r\n                _this.setState({\r\n                    pullToRefreshThresholdBreached: false,\r\n                });\r\n            }\r\n            requestAnimationFrame(function () {\r\n                // this._infScroll\r\n                if (_this._infScroll) {\r\n                    _this._infScroll.style.overflow = 'auto';\r\n                    _this._infScroll.style.transform = 'none';\r\n                    _this._infScroll.style.willChange = 'unset';\r\n                }\r\n            });\r\n        };\r\n        _this.onScrollListener = function (event) {\r\n            if (typeof _this.props.onScroll === 'function') {\r\n                // Execute this callback in next tick so that it does not affect the\r\n                // functionality of the library.\r\n                setTimeout(function () { return _this.props.onScroll && _this.props.onScroll(event); }, 0);\r\n            }\r\n            var target = _this.props.height || _this._scrollableNode\r\n                ? event.target\r\n                : document.documentElement.scrollTop\r\n                    ? document.documentElement\r\n                    : document.body;\r\n            // return immediately if the action has already been triggered,\r\n            // prevents multiple triggers.\r\n            if (_this.actionTriggered)\r\n                return;\r\n            var atBottom = _this.props.inverse\r\n                ? _this.isElementAtTop(target, _this.props.scrollThreshold)\r\n                : _this.isElementAtBottom(target, _this.props.scrollThreshold);\r\n            // call the `next` function in the props to trigger the next data fetch\r\n            if (atBottom && _this.props.hasMore) {\r\n                _this.actionTriggered = true;\r\n                _this.setState({ showLoader: true });\r\n                _this.props.next && _this.props.next();\r\n            }\r\n            _this.lastScrollTop = target.scrollTop;\r\n        };\r\n        _this.state = {\r\n            showLoader: false,\r\n            pullToRefreshThresholdBreached: false,\r\n            prevDataLength: props.dataLength,\r\n        };\r\n        _this.throttledOnScrollListener = throttle(150, _this.onScrollListener).bind(_this);\r\n        _this.onStart = _this.onStart.bind(_this);\r\n        _this.onMove = _this.onMove.bind(_this);\r\n        _this.onEnd = _this.onEnd.bind(_this);\r\n        return _this;\r\n    }\r\n    InfiniteScroll.prototype.componentDidMount = function () {\r\n        if (typeof this.props.dataLength === 'undefined') {\r\n            throw new Error(\"mandatory prop \\\"dataLength\\\" is missing. The prop is needed\" +\r\n                \" when loading more content. Check README.md for usage\");\r\n        }\r\n        this._scrollableNode = this.getScrollableTarget();\r\n        this.el = this.props.height\r\n            ? this._infScroll\r\n            : this._scrollableNode || window;\r\n        if (this.el) {\r\n            this.el.addEventListener('scroll', this\r\n                .throttledOnScrollListener);\r\n        }\r\n        if (typeof this.props.initialScrollY === 'number' &&\r\n            this.el &&\r\n            this.el instanceof HTMLElement &&\r\n            this.el.scrollHeight > this.props.initialScrollY) {\r\n            this.el.scrollTo(0, this.props.initialScrollY);\r\n        }\r\n        if (this.props.pullDownToRefresh && this.el) {\r\n            this.el.addEventListener('touchstart', this.onStart);\r\n            this.el.addEventListener('touchmove', this.onMove);\r\n            this.el.addEventListener('touchend', this.onEnd);\r\n            this.el.addEventListener('mousedown', this.onStart);\r\n            this.el.addEventListener('mousemove', this.onMove);\r\n            this.el.addEventListener('mouseup', this.onEnd);\r\n            // get BCR of pullDown element to position it above\r\n            this.maxPullDownDistance =\r\n                (this._pullDown &&\r\n                    this._pullDown.firstChild &&\r\n                    this._pullDown.firstChild.getBoundingClientRect()\r\n                        .height) ||\r\n                    0;\r\n            this.forceUpdate();\r\n            if (typeof this.props.refreshFunction !== 'function') {\r\n                throw new Error(\"Mandatory prop \\\"refreshFunction\\\" missing.\\n          Pull Down To Refresh functionality will not work\\n          as expected. Check README.md for usage'\");\r\n            }\r\n        }\r\n    };\r\n    InfiniteScroll.prototype.componentWillUnmount = function () {\r\n        if (this.el) {\r\n            this.el.removeEventListener('scroll', this\r\n                .throttledOnScrollListener);\r\n            if (this.props.pullDownToRefresh) {\r\n                this.el.removeEventListener('touchstart', this.onStart);\r\n                this.el.removeEventListener('touchmove', this.onMove);\r\n                this.el.removeEventListener('touchend', this.onEnd);\r\n                this.el.removeEventListener('mousedown', this.onStart);\r\n                this.el.removeEventListener('mousemove', this.onMove);\r\n                this.el.removeEventListener('mouseup', this.onEnd);\r\n            }\r\n        }\r\n    };\r\n    InfiniteScroll.prototype.componentDidUpdate = function (prevProps) {\r\n        // do nothing when dataLength is unchanged\r\n        if (this.props.dataLength === prevProps.dataLength)\r\n            return;\r\n        this.actionTriggered = false;\r\n        // update state when new data was sent in\r\n        this.setState({\r\n            showLoader: false,\r\n        });\r\n    };\r\n    InfiniteScroll.getDerivedStateFromProps = function (nextProps, prevState) {\r\n        var dataLengthChanged = nextProps.dataLength !== prevState.prevDataLength;\r\n        // reset when data changes\r\n        if (dataLengthChanged) {\r\n            return __assign(__assign({}, prevState), { prevDataLength: nextProps.dataLength });\r\n        }\r\n        return null;\r\n    };\r\n    InfiniteScroll.prototype.isElementAtTop = function (target, scrollThreshold) {\r\n        if (scrollThreshold === void 0) { scrollThreshold = 0.8; }\r\n        var clientHeight = target === document.body || target === document.documentElement\r\n            ? window.screen.availHeight\r\n            : target.clientHeight;\r\n        var threshold = parseThreshold(scrollThreshold);\r\n        if (threshold.unit === ThresholdUnits.Pixel) {\r\n            return (target.scrollTop <=\r\n                threshold.value + clientHeight - target.scrollHeight + 1);\r\n        }\r\n        return (target.scrollTop <=\r\n            threshold.value / 100 + clientHeight - target.scrollHeight + 1);\r\n    };\r\n    InfiniteScroll.prototype.isElementAtBottom = function (target, scrollThreshold) {\r\n        if (scrollThreshold === void 0) { scrollThreshold = 0.8; }\r\n        var clientHeight = target === document.body || target === document.documentElement\r\n            ? window.screen.availHeight\r\n            : target.clientHeight;\r\n        var threshold = parseThreshold(scrollThreshold);\r\n        if (threshold.unit === ThresholdUnits.Pixel) {\r\n            return (target.scrollTop + clientHeight >= target.scrollHeight - threshold.value);\r\n        }\r\n        return (target.scrollTop + clientHeight >=\r\n            (threshold.value / 100) * target.scrollHeight);\r\n    };\r\n    InfiniteScroll.prototype.render = function () {\r\n        var _this = this;\r\n        var style = __assign({ height: this.props.height || 'auto', overflow: 'auto', WebkitOverflowScrolling: 'touch' }, this.props.style);\r\n        var hasChildren = this.props.hasChildren ||\r\n            !!(this.props.children &&\r\n                this.props.children instanceof Array &&\r\n                this.props.children.length);\r\n        // because heighted infiniteScroll visualy breaks\r\n        // on drag down as overflow becomes visible\r\n        var outerDivStyle = this.props.pullDownToRefresh && this.props.height\r\n            ? { overflow: 'auto' }\r\n            : {};\r\n        return (React.createElement(\"div\", { style: outerDivStyle, className: \"infinite-scroll-component__outerdiv\" },\r\n            React.createElement(\"div\", { className: \"infinite-scroll-component \" + (this.props.className || ''), ref: function (infScroll) { return (_this._infScroll = infScroll); }, style: style },\r\n                this.props.pullDownToRefresh && (React.createElement(\"div\", { style: { position: 'relative' }, ref: function (pullDown) { return (_this._pullDown = pullDown); } },\r\n                    React.createElement(\"div\", { style: {\r\n                            position: 'absolute',\r\n                            left: 0,\r\n                            right: 0,\r\n                            top: -1 * this.maxPullDownDistance,\r\n                        } }, this.state.pullToRefreshThresholdBreached\r\n                        ? this.props.releaseToRefreshContent\r\n                        : this.props.pullDownToRefreshContent))),\r\n                this.props.children,\r\n                !this.state.showLoader &&\r\n                    !hasChildren &&\r\n                    this.props.hasMore &&\r\n                    this.props.loader,\r\n                this.state.showLoader && this.props.hasMore && this.props.loader,\r\n                !this.props.hasMore && this.props.endMessage)));\r\n    };\r\n    return InfiniteScroll;\r\n}(Component));\n\nexport default InfiniteScroll;\n//# sourceMappingURL=index.es.js.map\n"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","hasOwnProperty","__assign","assign","t","s","i","n","arguments","length","prototype","call","apply","this","ThresholdUnits","defaultThreshold","unit","value","parseThreshold","scrollThreshold","match","parseFloat","console","warn","InfiniteScroll","_super","props","_this","lastScrollTop","actionTriggered","startY","currentY","dragging","maxPullDownDistance","getScrollableTarget","scrollableTarget","HTMLElement","document","getElementById","onStart","evt","MouseEvent","pageY","TouchEvent","touches","_infScroll","style","willChange","transition","onMove","Number","pullDownToRefreshThreshold","setState","pullToRefreshThresholdBreached","overflow","transform","onEnd","state","refreshFunction","requestAnimationFrame","onScrollListener","event","onScroll","setTimeout","target","height","_scrollableNode","documentElement","scrollTop","body","inverse","isElementAtTop","isElementAtBottom","hasMore","showLoader","next","prevDataLength","dataLength","throttledOnScrollListener","throttle","delay","noTrailing","callback","debounceMode","timeoutID","cancelled","lastExec","clearExistingTimeout","clearTimeout","wrapper","self","elapsed","Date","now","args","exec","clear","undefined","cancel","bind","__extends","__","constructor","create","componentDidMount","Error","el","window","addEventListener","initialScrollY","scrollHeight","scrollTo","pullDownToRefresh","_pullDown","firstChild","getBoundingClientRect","forceUpdate","componentWillUnmount","removeEventListener","componentDidUpdate","prevProps","getDerivedStateFromProps","nextProps","prevState","clientHeight","screen","availHeight","threshold","render","WebkitOverflowScrolling","hasChildren","children","outerDivStyle","className","ref","infScroll","position","pullDown","left","right","top","releaseToRefreshContent","pullDownToRefreshContent","loader","endMessage","Component"],"sourceRoot":""}