"use strict";var e=require("@babel/runtime/helpers/objectWithoutProperties"),r=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/slicedToArray"),n=require("react"),i=require("react/jsx-runtime"),c=require("hoist-non-react-statics"),u=function(e,r,t){return e=(e=e<=t?e:t)>=r?e:r},o=function(e){n.useEffect(e,[])};function s(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}var f=function(e){return++e%1e6},a=function(){var e,i,c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},u=(e=n.useState(0),i=t(e,2)[1],n.useCallback(function(){return i(f)},[])),o=n.useRef(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}({},c));return[n.useCallback(function(){return o.current},[]),n.useCallback(function(e){e&&(Object.assign(o.current,e),u())},[])]},l=function(e,r){var t,i=(t=n.useRef(!0)).current?(t.current=!1,!0):t.current;n.useEffect(function(){if(!i)return e()},r)};function p(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var O={isFinished:!0,progress:0,sideEffect:function(){}},v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.animationDuration,i=void 0===r?200:r,c=e.incrementDuration,s=void 0===c?200:c,f=e.isAnimating,p=void 0!==f&&f,v=e.minimum,d=void 0===v?.08:v,j=a(O),g=t(j,2),y=g[0],h=g[1],P=n.useRef(null),m=n.useRef(null);o(function(){var e,r,t,n,i;P.current=(e=!1,r=[],t=function(){e=!0;var n=r.shift();if(n)return n(t);e=!1},{clear:function(){e=!1,r=[]},enqueue:function(n){r.push(n),e||1!==r.length||t()}}),m.current={cancel:i=function(){void 0!==n&&window.cancelAnimationFrame(n)},schedule:function(e,r){var t;i();var c=function(i){i-(t=t||i)>r?e():n=window.requestAnimationFrame(c)};n=window.requestAnimationFrame(c)}}});var w=n.useCallback(function(){var e,r;null===(e=m.current)||void 0===e||e.cancel(),null===(r=P.current)||void 0===r||r.clear()},[]),D=n.useCallback(function(e){var r,t,n;if(1===(e=u(e,d,1)))return w(),null===(t=P.current)||void 0===t||t.enqueue(function(r){h({progress:e,sideEffect:function(){var e;return null===(e=m.current)||void 0===e?void 0:e.schedule(r,i)}})}),void(null===(n=P.current)||void 0===n||n.enqueue(function(){h({isFinished:!0,sideEffect:w})}));null===(r=P.current)||void 0===r||r.enqueue(function(r){h({isFinished:!1,progress:e,sideEffect:r})})},[i,w,d,P,h,m]),E=n.useCallback(function(){var e,r;D((e=y().progress,r=0,e>=0&&e<.2?r=.1:e>=.2&&e<.5?r=.04:e>=.5&&e<.8?r=.02:e>=.8&&e<.99&&(r=.005),u(e+r,0,.994)))},[y,D]),q=n.useCallback(function(){var e=function(){var r;E(),null===(r=P.current)||void 0===r||r.enqueue(function(r){var t;null===(t=m.current)||void 0===t||t.schedule(function(){e(),r()},s)})};e()},[s,P,m,E]),k=y().sideEffect;return o(function(){return p&&q(),w}),l(function(){y().sideEffect()},[y,k]),l(function(){p?h(b(b({},O),{},{sideEffect:q})):D(1)},[p,D,h,q]),{animationDuration:i,isFinished:y().isFinished,progress:y().progress}},d=["children"];function j(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?j(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}exports.NProgress=function(r){var t=r.children,n=e(r,d);return t(v(n))},exports.useNProgress=v,exports.withNProgress=function(e){var r=function(r){var t=v(r);return i.jsx(e,g(g({},r),t))};return c(r,e),r};
//# sourceMappingURL=react-nprogress.cjs.production.js.map
