1 | (function (global, factory) {
|
2 | typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
|
3 | typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :
|
4 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.NProgress = {}, global.React));
|
5 | }(this, (function (exports, React) { 'use strict';
|
6 |
|
7 | function _objectWithoutPropertiesLoose(source, excluded) {
|
8 | if (source == null) return {};
|
9 | var target = {};
|
10 | var sourceKeys = Object.keys(source);
|
11 | var key, i;
|
12 |
|
13 | for (i = 0; i < sourceKeys.length; i++) {
|
14 | key = sourceKeys[i];
|
15 | if (excluded.indexOf(key) >= 0) continue;
|
16 | target[key] = source[key];
|
17 | }
|
18 |
|
19 | return target;
|
20 | }
|
21 |
|
22 | var objectWithoutPropertiesLoose = _objectWithoutPropertiesLoose;
|
23 |
|
24 | function unwrapExports (x) {
|
25 | return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
26 | }
|
27 |
|
28 | function createCommonjsModule(fn, module) {
|
29 | return module = { exports: {} }, fn(module, module.exports), module.exports;
|
30 | }
|
31 |
|
32 | var _extends_1 = createCommonjsModule(function (module) {
|
33 | function _extends() {
|
34 | module.exports = _extends = Object.assign || function (target) {
|
35 | for (var i = 1; i < arguments.length; i++) {
|
36 | var source = arguments[i];
|
37 |
|
38 | for (var key in source) {
|
39 | if (Object.prototype.hasOwnProperty.call(source, key)) {
|
40 | target[key] = source[key];
|
41 | }
|
42 | }
|
43 | }
|
44 |
|
45 | return target;
|
46 | };
|
47 |
|
48 | return _extends.apply(this, arguments);
|
49 | }
|
50 |
|
51 | module.exports = _extends;
|
52 | });
|
53 |
|
54 | function useFirstMountState() {
|
55 | var isFirst = React.useRef(true);
|
56 | if (isFirst.current) {
|
57 | isFirst.current = false;
|
58 | return true;
|
59 | }
|
60 | return isFirst.current;
|
61 | }
|
62 |
|
63 | var useUpdateEffect = function (effect, deps) {
|
64 | var isFirstMount = useFirstMountState();
|
65 | React.useEffect(function () {
|
66 | if (!isFirstMount) {
|
67 | return effect();
|
68 | }
|
69 | }, deps);
|
70 | };
|
71 |
|
72 | |
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 |
|
87 | var __assign = function() {
|
88 | __assign = Object.assign || function __assign(t) {
|
89 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
90 | s = arguments[i];
|
91 | for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
92 | }
|
93 | return t;
|
94 | };
|
95 | return __assign.apply(this, arguments);
|
96 | };
|
97 |
|
98 | var updateReducer = function (num) { return (num + 1) % 1000000; };
|
99 | var useUpdate = function () {
|
100 | var _a = React.useReducer(updateReducer, 0), update = _a[1];
|
101 | return update;
|
102 | };
|
103 |
|
104 | var useEffectOnce = function (effect) {
|
105 | React.useEffect(effect, []);
|
106 | };
|
107 |
|
108 | var useGetSetState = function (initialState) {
|
109 | if (initialState === void 0) { initialState = {}; }
|
110 | {
|
111 | if (typeof initialState !== 'object') {
|
112 | console.error('useGetSetState initial state must be an object.');
|
113 | }
|
114 | }
|
115 | var update = useUpdate();
|
116 | var state = React.useRef(__assign({}, initialState));
|
117 | var get = React.useCallback(function () { return state.current; }, []);
|
118 | var set = React.useCallback(function (patch) {
|
119 | if (!patch) {
|
120 | return;
|
121 | }
|
122 | {
|
123 | if (typeof patch !== 'object') {
|
124 | console.error('useGetSetState setter patch must be an object.');
|
125 | }
|
126 | }
|
127 | Object.assign(state.current, patch);
|
128 | update();
|
129 | }, []);
|
130 | return [get, set];
|
131 | };
|
132 |
|
133 | var clamp = function clamp(num, lower, upper) {
|
134 | num = num <= upper ? num : upper;
|
135 | num = num >= lower ? num : lower;
|
136 | return num;
|
137 | };
|
138 |
|
139 | var increment = function increment(progress) {
|
140 | var amount = 0;
|
141 |
|
142 | if (progress >= 0 && progress < 0.2) {
|
143 | amount = 0.1;
|
144 | } else if (progress >= 0.2 && progress < 0.5) {
|
145 | amount = 0.04;
|
146 | } else if (progress >= 0.5 && progress < 0.8) {
|
147 | amount = 0.02;
|
148 | } else if (progress >= 0.8 && progress < 0.99) {
|
149 | amount = 0.005;
|
150 | }
|
151 |
|
152 | return clamp(progress + amount, 0, 0.994);
|
153 | };
|
154 |
|
155 | var isRunning = false;
|
156 | var pending = [];
|
157 |
|
158 | var next = function next() {
|
159 | isRunning = true;
|
160 | var cb = pending.shift();
|
161 |
|
162 | if (cb) {
|
163 | return cb(next);
|
164 | }
|
165 |
|
166 | isRunning = false;
|
167 | };
|
168 |
|
169 | var clear = function clear() {
|
170 | isRunning = false;
|
171 | pending = [];
|
172 | };
|
173 | var queue = function queue(cb) {
|
174 | pending.push(cb);
|
175 |
|
176 | if (!isRunning && pending.length === 1) {
|
177 | next();
|
178 | }
|
179 | };
|
180 |
|
181 | var handle;
|
182 | var cancel = function cancel() {
|
183 | if (handle) {
|
184 | window.cancelAnimationFrame(handle);
|
185 | }
|
186 | };
|
187 | var timeout = function timeout(callback, delay) {
|
188 | var deltaTime;
|
189 | var start;
|
190 |
|
191 | var frame = function frame(time) {
|
192 | start = start || time;
|
193 | deltaTime = time - start;
|
194 |
|
195 | if (deltaTime > delay) {
|
196 | callback();
|
197 | return;
|
198 | }
|
199 |
|
200 | handle = window.requestAnimationFrame(frame);
|
201 | };
|
202 |
|
203 | handle = window.requestAnimationFrame(frame);
|
204 | };
|
205 |
|
206 |
|
207 |
|
208 | var noop = function noop() {
|
209 | return undefined;
|
210 | };
|
211 |
|
212 | var initialState = {
|
213 | isFinished: false,
|
214 | progress: 0,
|
215 | sideEffect: noop
|
216 | };
|
217 |
|
218 | var cleanup = function cleanup() {
|
219 | cancel();
|
220 | clear();
|
221 | };
|
222 |
|
223 | var useNProgress = function useNProgress(_temp) {
|
224 | var _ref = _temp === void 0 ? {} : _temp,
|
225 | _ref$animationDuratio = _ref.animationDuration,
|
226 | animationDuration = _ref$animationDuratio === void 0 ? 200 : _ref$animationDuratio,
|
227 | _ref$incrementDuratio = _ref.incrementDuration,
|
228 | incrementDuration = _ref$incrementDuratio === void 0 ? 800 : _ref$incrementDuratio,
|
229 | _ref$isAnimating = _ref.isAnimating,
|
230 | isAnimating = _ref$isAnimating === void 0 ? false : _ref$isAnimating,
|
231 | _ref$minimum = _ref.minimum,
|
232 | minimum = _ref$minimum === void 0 ? 0.08 : _ref$minimum;
|
233 |
|
234 | var _useGetSetState = useGetSetState(initialState),
|
235 | get = _useGetSetState[0],
|
236 | setState = _useGetSetState[1];
|
237 |
|
238 | var set = React.useCallback(function (n) {
|
239 | n = clamp(n, minimum, 1);
|
240 |
|
241 | if (n === 1) {
|
242 | cleanup();
|
243 | queue(function (next) {
|
244 | setState({
|
245 | progress: n,
|
246 | sideEffect: function sideEffect() {
|
247 | return timeout(next, animationDuration);
|
248 | }
|
249 | });
|
250 | });
|
251 | queue(function () {
|
252 | setState({
|
253 | isFinished: true,
|
254 | sideEffect: cleanup
|
255 | });
|
256 | });
|
257 | return;
|
258 | }
|
259 |
|
260 | queue(function (next) {
|
261 | setState({
|
262 | progress: n,
|
263 | sideEffect: function sideEffect() {
|
264 | return timeout(next, animationDuration);
|
265 | }
|
266 | });
|
267 | });
|
268 | }, [animationDuration, minimum, setState]);
|
269 | var trickle = React.useCallback(function () {
|
270 | set(increment(get().progress));
|
271 | }, [get, set]);
|
272 | var start = React.useCallback(function () {
|
273 | var work = function work() {
|
274 | trickle();
|
275 | queue(function (next) {
|
276 | timeout(function () {
|
277 | work();
|
278 | next();
|
279 | }, incrementDuration);
|
280 | });
|
281 | };
|
282 |
|
283 | work();
|
284 | }, [incrementDuration, trickle]);
|
285 | var savedTrickle = React.useRef(noop);
|
286 | var sideEffect = get().sideEffect;
|
287 | React.useEffect(function () {
|
288 | savedTrickle.current = trickle;
|
289 | });
|
290 | useEffectOnce(function () {
|
291 | if (isAnimating) {
|
292 | start();
|
293 | }
|
294 |
|
295 | return cleanup;
|
296 | });
|
297 | useUpdateEffect(function () {
|
298 | get().sideEffect();
|
299 | }, [get, sideEffect]);
|
300 | useUpdateEffect(function () {
|
301 | if (!isAnimating) {
|
302 | set(1);
|
303 | } else {
|
304 | setState(_extends_1({}, initialState, {
|
305 | sideEffect: start
|
306 | }));
|
307 | }
|
308 | }, [isAnimating, set, setState, start]);
|
309 | return {
|
310 | animationDuration: animationDuration,
|
311 | isFinished: get().isFinished,
|
312 | progress: get().progress
|
313 | };
|
314 | };
|
315 |
|
316 | var NProgress = function NProgress(_ref) {
|
317 | var children = _ref.children,
|
318 | restProps = objectWithoutPropertiesLoose(_ref, ["children"]);
|
319 |
|
320 | var renderProps = useNProgress(restProps);
|
321 | return children(renderProps);
|
322 | };
|
323 |
|
324 | var reactIs_production_min = createCommonjsModule(function (module, exports) {
|
325 | Object.defineProperty(exports,"__esModule",{value:!0});
|
326 | var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?Symbol.for("react.suspense_list"):
|
327 | 60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.fundamental"):60117,w=b?Symbol.for("react.responder"):60118,x=b?Symbol.for("react.scope"):60119;function y(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function z(a){return y(a)===m}
|
328 | exports.typeOf=y;exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;
|
329 | exports.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===v||a.$$typeof===w||a.$$typeof===x)};exports.isAsyncMode=function(a){return z(a)||y(a)===l};exports.isConcurrentMode=z;exports.isContextConsumer=function(a){return y(a)===k};exports.isContextProvider=function(a){return y(a)===h};
|
330 | exports.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return y(a)===n};exports.isFragment=function(a){return y(a)===e};exports.isLazy=function(a){return y(a)===t};exports.isMemo=function(a){return y(a)===r};exports.isPortal=function(a){return y(a)===d};exports.isProfiler=function(a){return y(a)===g};exports.isStrictMode=function(a){return y(a)===f};exports.isSuspense=function(a){return y(a)===p};
|
331 | });
|
332 |
|
333 | unwrapExports(reactIs_production_min);
|
334 | var reactIs_production_min_1 = reactIs_production_min.typeOf;
|
335 | var reactIs_production_min_2 = reactIs_production_min.AsyncMode;
|
336 | var reactIs_production_min_3 = reactIs_production_min.ConcurrentMode;
|
337 | var reactIs_production_min_4 = reactIs_production_min.ContextConsumer;
|
338 | var reactIs_production_min_5 = reactIs_production_min.ContextProvider;
|
339 | var reactIs_production_min_6 = reactIs_production_min.Element;
|
340 | var reactIs_production_min_7 = reactIs_production_min.ForwardRef;
|
341 | var reactIs_production_min_8 = reactIs_production_min.Fragment;
|
342 | var reactIs_production_min_9 = reactIs_production_min.Lazy;
|
343 | var reactIs_production_min_10 = reactIs_production_min.Memo;
|
344 | var reactIs_production_min_11 = reactIs_production_min.Portal;
|
345 | var reactIs_production_min_12 = reactIs_production_min.Profiler;
|
346 | var reactIs_production_min_13 = reactIs_production_min.StrictMode;
|
347 | var reactIs_production_min_14 = reactIs_production_min.Suspense;
|
348 | var reactIs_production_min_15 = reactIs_production_min.isValidElementType;
|
349 | var reactIs_production_min_16 = reactIs_production_min.isAsyncMode;
|
350 | var reactIs_production_min_17 = reactIs_production_min.isConcurrentMode;
|
351 | var reactIs_production_min_18 = reactIs_production_min.isContextConsumer;
|
352 | var reactIs_production_min_19 = reactIs_production_min.isContextProvider;
|
353 | var reactIs_production_min_20 = reactIs_production_min.isElement;
|
354 | var reactIs_production_min_21 = reactIs_production_min.isForwardRef;
|
355 | var reactIs_production_min_22 = reactIs_production_min.isFragment;
|
356 | var reactIs_production_min_23 = reactIs_production_min.isLazy;
|
357 | var reactIs_production_min_24 = reactIs_production_min.isMemo;
|
358 | var reactIs_production_min_25 = reactIs_production_min.isPortal;
|
359 | var reactIs_production_min_26 = reactIs_production_min.isProfiler;
|
360 | var reactIs_production_min_27 = reactIs_production_min.isStrictMode;
|
361 | var reactIs_production_min_28 = reactIs_production_min.isSuspense;
|
362 |
|
363 | var reactIs_development = createCommonjsModule(function (module, exports) {
|
364 |
|
365 |
|
366 |
|
367 | {
|
368 | (function() {
|
369 |
|
370 | Object.defineProperty(exports, '__esModule', { value: true });
|
371 |
|
372 |
|
373 |
|
374 | var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
375 | var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
376 | var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
377 | var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
378 | var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
379 | var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
380 | var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
381 | var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
|
382 |
|
383 |
|
384 | var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
385 | var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
386 | var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
387 | var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
388 | var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
389 | var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
390 | var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
391 | var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
392 | var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
393 | var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
394 |
|
395 | function isValidElementType(type) {
|
396 | return typeof type === 'string' || typeof type === 'function' ||
|
397 | type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE);
|
398 | }
|
399 |
|
400 | |
401 |
|
402 |
|
403 |
|
404 |
|
405 |
|
406 |
|
407 |
|
408 |
|
409 |
|
410 |
|
411 |
|
412 |
|
413 | var lowPriorityWarningWithoutStack = function () {};
|
414 |
|
415 | {
|
416 | var printWarning = function (format) {
|
417 | for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
418 | args[_key - 1] = arguments[_key];
|
419 | }
|
420 |
|
421 | var argIndex = 0;
|
422 | var message = 'Warning: ' + format.replace(/%s/g, function () {
|
423 | return args[argIndex++];
|
424 | });
|
425 |
|
426 | if (typeof console !== 'undefined') {
|
427 | console.warn(message);
|
428 | }
|
429 |
|
430 | try {
|
431 |
|
432 |
|
433 |
|
434 | throw new Error(message);
|
435 | } catch (x) {}
|
436 | };
|
437 |
|
438 | lowPriorityWarningWithoutStack = function (condition, format) {
|
439 | if (format === undefined) {
|
440 | throw new Error('`lowPriorityWarningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
|
441 | }
|
442 |
|
443 | if (!condition) {
|
444 | for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
445 | args[_key2 - 2] = arguments[_key2];
|
446 | }
|
447 |
|
448 | printWarning.apply(void 0, [format].concat(args));
|
449 | }
|
450 | };
|
451 | }
|
452 |
|
453 | var lowPriorityWarningWithoutStack$1 = lowPriorityWarningWithoutStack;
|
454 |
|
455 | function typeOf(object) {
|
456 | if (typeof object === 'object' && object !== null) {
|
457 | var $$typeof = object.$$typeof;
|
458 |
|
459 | switch ($$typeof) {
|
460 | case REACT_ELEMENT_TYPE:
|
461 | var type = object.type;
|
462 |
|
463 | switch (type) {
|
464 | case REACT_ASYNC_MODE_TYPE:
|
465 | case REACT_CONCURRENT_MODE_TYPE:
|
466 | case REACT_FRAGMENT_TYPE:
|
467 | case REACT_PROFILER_TYPE:
|
468 | case REACT_STRICT_MODE_TYPE:
|
469 | case REACT_SUSPENSE_TYPE:
|
470 | return type;
|
471 |
|
472 | default:
|
473 | var $$typeofType = type && type.$$typeof;
|
474 |
|
475 | switch ($$typeofType) {
|
476 | case REACT_CONTEXT_TYPE:
|
477 | case REACT_FORWARD_REF_TYPE:
|
478 | case REACT_LAZY_TYPE:
|
479 | case REACT_MEMO_TYPE:
|
480 | case REACT_PROVIDER_TYPE:
|
481 | return $$typeofType;
|
482 |
|
483 | default:
|
484 | return $$typeof;
|
485 | }
|
486 |
|
487 | }
|
488 |
|
489 | case REACT_PORTAL_TYPE:
|
490 | return $$typeof;
|
491 | }
|
492 | }
|
493 |
|
494 | return undefined;
|
495 | }
|
496 |
|
497 | var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
498 | var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
499 | var ContextConsumer = REACT_CONTEXT_TYPE;
|
500 | var ContextProvider = REACT_PROVIDER_TYPE;
|
501 | var Element = REACT_ELEMENT_TYPE;
|
502 | var ForwardRef = REACT_FORWARD_REF_TYPE;
|
503 | var Fragment = REACT_FRAGMENT_TYPE;
|
504 | var Lazy = REACT_LAZY_TYPE;
|
505 | var Memo = REACT_MEMO_TYPE;
|
506 | var Portal = REACT_PORTAL_TYPE;
|
507 | var Profiler = REACT_PROFILER_TYPE;
|
508 | var StrictMode = REACT_STRICT_MODE_TYPE;
|
509 | var Suspense = REACT_SUSPENSE_TYPE;
|
510 | var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
511 |
|
512 | function isAsyncMode(object) {
|
513 | {
|
514 | if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
515 | hasWarnedAboutDeprecatedIsAsyncMode = true;
|
516 | lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
|
517 | }
|
518 | }
|
519 |
|
520 | return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
521 | }
|
522 | function isConcurrentMode(object) {
|
523 | return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
524 | }
|
525 | function isContextConsumer(object) {
|
526 | return typeOf(object) === REACT_CONTEXT_TYPE;
|
527 | }
|
528 | function isContextProvider(object) {
|
529 | return typeOf(object) === REACT_PROVIDER_TYPE;
|
530 | }
|
531 | function isElement(object) {
|
532 | return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
533 | }
|
534 | function isForwardRef(object) {
|
535 | return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
536 | }
|
537 | function isFragment(object) {
|
538 | return typeOf(object) === REACT_FRAGMENT_TYPE;
|
539 | }
|
540 | function isLazy(object) {
|
541 | return typeOf(object) === REACT_LAZY_TYPE;
|
542 | }
|
543 | function isMemo(object) {
|
544 | return typeOf(object) === REACT_MEMO_TYPE;
|
545 | }
|
546 | function isPortal(object) {
|
547 | return typeOf(object) === REACT_PORTAL_TYPE;
|
548 | }
|
549 | function isProfiler(object) {
|
550 | return typeOf(object) === REACT_PROFILER_TYPE;
|
551 | }
|
552 | function isStrictMode(object) {
|
553 | return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
554 | }
|
555 | function isSuspense(object) {
|
556 | return typeOf(object) === REACT_SUSPENSE_TYPE;
|
557 | }
|
558 |
|
559 | exports.typeOf = typeOf;
|
560 | exports.AsyncMode = AsyncMode;
|
561 | exports.ConcurrentMode = ConcurrentMode;
|
562 | exports.ContextConsumer = ContextConsumer;
|
563 | exports.ContextProvider = ContextProvider;
|
564 | exports.Element = Element;
|
565 | exports.ForwardRef = ForwardRef;
|
566 | exports.Fragment = Fragment;
|
567 | exports.Lazy = Lazy;
|
568 | exports.Memo = Memo;
|
569 | exports.Portal = Portal;
|
570 | exports.Profiler = Profiler;
|
571 | exports.StrictMode = StrictMode;
|
572 | exports.Suspense = Suspense;
|
573 | exports.isValidElementType = isValidElementType;
|
574 | exports.isAsyncMode = isAsyncMode;
|
575 | exports.isConcurrentMode = isConcurrentMode;
|
576 | exports.isContextConsumer = isContextConsumer;
|
577 | exports.isContextProvider = isContextProvider;
|
578 | exports.isElement = isElement;
|
579 | exports.isForwardRef = isForwardRef;
|
580 | exports.isFragment = isFragment;
|
581 | exports.isLazy = isLazy;
|
582 | exports.isMemo = isMemo;
|
583 | exports.isPortal = isPortal;
|
584 | exports.isProfiler = isProfiler;
|
585 | exports.isStrictMode = isStrictMode;
|
586 | exports.isSuspense = isSuspense;
|
587 | })();
|
588 | }
|
589 | });
|
590 |
|
591 | unwrapExports(reactIs_development);
|
592 | var reactIs_development_1 = reactIs_development.typeOf;
|
593 | var reactIs_development_2 = reactIs_development.AsyncMode;
|
594 | var reactIs_development_3 = reactIs_development.ConcurrentMode;
|
595 | var reactIs_development_4 = reactIs_development.ContextConsumer;
|
596 | var reactIs_development_5 = reactIs_development.ContextProvider;
|
597 | var reactIs_development_6 = reactIs_development.Element;
|
598 | var reactIs_development_7 = reactIs_development.ForwardRef;
|
599 | var reactIs_development_8 = reactIs_development.Fragment;
|
600 | var reactIs_development_9 = reactIs_development.Lazy;
|
601 | var reactIs_development_10 = reactIs_development.Memo;
|
602 | var reactIs_development_11 = reactIs_development.Portal;
|
603 | var reactIs_development_12 = reactIs_development.Profiler;
|
604 | var reactIs_development_13 = reactIs_development.StrictMode;
|
605 | var reactIs_development_14 = reactIs_development.Suspense;
|
606 | var reactIs_development_15 = reactIs_development.isValidElementType;
|
607 | var reactIs_development_16 = reactIs_development.isAsyncMode;
|
608 | var reactIs_development_17 = reactIs_development.isConcurrentMode;
|
609 | var reactIs_development_18 = reactIs_development.isContextConsumer;
|
610 | var reactIs_development_19 = reactIs_development.isContextProvider;
|
611 | var reactIs_development_20 = reactIs_development.isElement;
|
612 | var reactIs_development_21 = reactIs_development.isForwardRef;
|
613 | var reactIs_development_22 = reactIs_development.isFragment;
|
614 | var reactIs_development_23 = reactIs_development.isLazy;
|
615 | var reactIs_development_24 = reactIs_development.isMemo;
|
616 | var reactIs_development_25 = reactIs_development.isPortal;
|
617 | var reactIs_development_26 = reactIs_development.isProfiler;
|
618 | var reactIs_development_27 = reactIs_development.isStrictMode;
|
619 | var reactIs_development_28 = reactIs_development.isSuspense;
|
620 |
|
621 | var reactIs = createCommonjsModule(function (module) {
|
622 |
|
623 | {
|
624 | module.exports = reactIs_development;
|
625 | }
|
626 | });
|
627 |
|
628 | |
629 |
|
630 |
|
631 |
|
632 | var REACT_STATICS = {
|
633 | childContextTypes: true,
|
634 | contextType: true,
|
635 | contextTypes: true,
|
636 | defaultProps: true,
|
637 | displayName: true,
|
638 | getDefaultProps: true,
|
639 | getDerivedStateFromError: true,
|
640 | getDerivedStateFromProps: true,
|
641 | mixins: true,
|
642 | propTypes: true,
|
643 | type: true
|
644 | };
|
645 | var KNOWN_STATICS = {
|
646 | name: true,
|
647 | length: true,
|
648 | prototype: true,
|
649 | caller: true,
|
650 | callee: true,
|
651 | arguments: true,
|
652 | arity: true
|
653 | };
|
654 | var FORWARD_REF_STATICS = {
|
655 | '$$typeof': true,
|
656 | render: true,
|
657 | defaultProps: true,
|
658 | displayName: true,
|
659 | propTypes: true
|
660 | };
|
661 | var MEMO_STATICS = {
|
662 | '$$typeof': true,
|
663 | compare: true,
|
664 | defaultProps: true,
|
665 | displayName: true,
|
666 | propTypes: true,
|
667 | type: true
|
668 | };
|
669 | var TYPE_STATICS = {};
|
670 | TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
|
671 | TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
|
672 |
|
673 | function getStatics(component) {
|
674 |
|
675 | if (reactIs.isMemo(component)) {
|
676 | return MEMO_STATICS;
|
677 | }
|
678 |
|
679 |
|
680 | return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;
|
681 | }
|
682 |
|
683 | var defineProperty = Object.defineProperty;
|
684 | var getOwnPropertyNames = Object.getOwnPropertyNames;
|
685 | var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
686 | var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
687 | var getPrototypeOf = Object.getPrototypeOf;
|
688 | var objectPrototype = Object.prototype;
|
689 | function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
|
690 | if (typeof sourceComponent !== 'string') {
|
691 |
|
692 | if (objectPrototype) {
|
693 | var inheritedComponent = getPrototypeOf(sourceComponent);
|
694 |
|
695 | if (inheritedComponent && inheritedComponent !== objectPrototype) {
|
696 | hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
|
697 | }
|
698 | }
|
699 |
|
700 | var keys = getOwnPropertyNames(sourceComponent);
|
701 |
|
702 | if (getOwnPropertySymbols) {
|
703 | keys = keys.concat(getOwnPropertySymbols(sourceComponent));
|
704 | }
|
705 |
|
706 | var targetStatics = getStatics(targetComponent);
|
707 | var sourceStatics = getStatics(sourceComponent);
|
708 |
|
709 | for (var i = 0; i < keys.length; ++i) {
|
710 | var key = keys[i];
|
711 |
|
712 | if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
|
713 | var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
|
714 |
|
715 | try {
|
716 |
|
717 | defineProperty(targetComponent, key, descriptor);
|
718 | } catch (e) {}
|
719 | }
|
720 | }
|
721 | }
|
722 |
|
723 | return targetComponent;
|
724 | }
|
725 |
|
726 | var hoistNonReactStatics_cjs = hoistNonReactStatics;
|
727 |
|
728 | function withNProgress(BaseComponent) {
|
729 | var WithNProgress = function WithNProgress(props) {
|
730 | var hookProps = useNProgress(props);
|
731 | return React.createElement(BaseComponent, Object.assign({}, props, hookProps));
|
732 | };
|
733 |
|
734 | hoistNonReactStatics_cjs(WithNProgress, BaseComponent);
|
735 | return WithNProgress;
|
736 | }
|
737 |
|
738 | exports.NProgress = NProgress;
|
739 | exports.useNProgress = useNProgress;
|
740 | exports.withNProgress = withNProgress;
|
741 |
|
742 | Object.defineProperty(exports, '__esModule', { value: true });
|
743 |
|
744 | })));
|
745 |
|