react-test-renderer 16.10.2 → 16.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-test-renderer",
3
- "version": "16.10.2",
3
+ "version": "16.11.0",
4
4
  "description": "React package for snapshot testing.",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -22,7 +22,7 @@
22
22
  "object-assign": "^4.1.1",
23
23
  "prop-types": "^15.6.2",
24
24
  "react-is": "^16.8.6",
25
- "scheduler": "^0.16.2"
25
+ "scheduler": "^0.17.0"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "react": "^16.0.0"
@@ -1,4 +1,4 @@
1
- /** @license React v16.10.2
1
+ /** @license React v16.11.0
2
2
  * react-test-renderer-shallow.development.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -16,16 +16,8 @@
16
16
  }(this, (function (React) { 'use strict';
17
17
 
18
18
  // Do not require this module directly! Use normal `invariant` calls with
19
- // template literal strings. The messages will be converted to ReactError during
20
- // build, and in production they will be minified.
21
-
22
- // Do not require this module directly! Use normal `invariant` calls with
23
- // template literal strings. The messages will be converted to ReactError during
24
- // build, and in production they will be minified.
25
- function ReactError(error) {
26
- error.name = 'Invariant Violation';
27
- return error;
28
- }
19
+ // template literal strings. The messages will be replaced with error codes
20
+ // during build.
29
21
 
30
22
  var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
31
23
  var _assign = ReactInternals.assign;
@@ -663,40 +655,36 @@ function () {
663
655
  };
664
656
 
665
657
  _proto2._validateCurrentlyRenderingComponent = function _validateCurrentlyRenderingComponent() {
666
- var _this = this;
667
-
668
- (function () {
669
- if (!(_this._rendering && !_this._instance)) {
670
- {
671
- throw ReactError(Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem."));
672
- }
658
+ if (!(this._rendering && !this._instance)) {
659
+ {
660
+ throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.");
673
661
  }
674
- })();
662
+ }
675
663
  };
676
664
 
677
665
  _proto2._createDispatcher = function _createDispatcher() {
678
- var _this2 = this;
666
+ var _this = this;
679
667
 
680
668
  var useReducer = function (reducer, initialArg, init) {
681
- _this2._validateCurrentlyRenderingComponent();
669
+ _this._validateCurrentlyRenderingComponent();
682
670
 
683
- _this2._createWorkInProgressHook();
671
+ _this._createWorkInProgressHook();
684
672
 
685
- var workInProgressHook = _this2._workInProgressHook;
673
+ var workInProgressHook = _this._workInProgressHook;
686
674
 
687
- if (_this2._isReRender) {
675
+ if (_this._isReRender) {
688
676
  // This is a re-render.
689
677
  var queue = workInProgressHook.queue;
690
678
  var dispatch = queue.dispatch;
691
679
 
692
- if (_this2._numberOfReRenders > 0) {
680
+ if (_this._numberOfReRenders > 0) {
693
681
  // Apply the new render phase updates to the previous current hook.
694
- if (_this2._renderPhaseUpdates !== null) {
682
+ if (_this._renderPhaseUpdates !== null) {
695
683
  // Render phase updates are stored in a map of queue -> linked list
696
- var firstRenderPhaseUpdate = _this2._renderPhaseUpdates.get(queue);
684
+ var firstRenderPhaseUpdate = _this._renderPhaseUpdates.get(queue);
697
685
 
698
686
  if (firstRenderPhaseUpdate !== undefined) {
699
- _this2._renderPhaseUpdates.delete(queue);
687
+ _this._renderPhaseUpdates.delete(queue);
700
688
 
701
689
  var _newState = workInProgressHook.memoizedState;
702
690
  var _update = firstRenderPhaseUpdate;
@@ -748,7 +736,7 @@ function () {
748
736
  dispatch: null
749
737
  };
750
738
 
751
- var _dispatch = _queue.dispatch = _this2._dispatchAction.bind(_this2, _queue);
739
+ var _dispatch = _queue.dispatch = _this._dispatchAction.bind(_this, _queue);
752
740
 
753
741
  return [workInProgressHook.memoizedState, _dispatch];
754
742
  }
@@ -760,14 +748,14 @@ function () {
760
748
  };
761
749
 
762
750
  var useMemo = function (nextCreate, deps) {
763
- _this2._validateCurrentlyRenderingComponent();
751
+ _this._validateCurrentlyRenderingComponent();
764
752
 
765
- _this2._createWorkInProgressHook();
753
+ _this._createWorkInProgressHook();
766
754
 
767
755
  var nextDeps = deps !== undefined ? deps : null;
768
756
 
769
- if (_this2._workInProgressHook !== null && _this2._workInProgressHook.memoizedState !== null) {
770
- var prevState = _this2._workInProgressHook.memoizedState;
757
+ if (_this._workInProgressHook !== null && _this._workInProgressHook.memoizedState !== null) {
758
+ var prevState = _this._workInProgressHook.memoizedState;
771
759
  var prevDeps = prevState[1];
772
760
 
773
761
  if (nextDeps !== null) {
@@ -778,16 +766,16 @@ function () {
778
766
  }
779
767
 
780
768
  var nextValue = nextCreate();
781
- _this2._workInProgressHook.memoizedState = [nextValue, nextDeps];
769
+ _this._workInProgressHook.memoizedState = [nextValue, nextDeps];
782
770
  return nextValue;
783
771
  };
784
772
 
785
773
  var useRef = function (initialValue) {
786
- _this2._validateCurrentlyRenderingComponent();
774
+ _this._validateCurrentlyRenderingComponent();
787
775
 
788
- _this2._createWorkInProgressHook();
776
+ _this._createWorkInProgressHook();
789
777
 
790
- var previousRef = _this2._workInProgressHook.memoizedState;
778
+ var previousRef = _this._workInProgressHook.memoizedState;
791
779
 
792
780
  if (previousRef === null) {
793
781
  var ref = {
@@ -798,7 +786,7 @@ function () {
798
786
  Object.seal(ref);
799
787
  }
800
788
 
801
- _this2._workInProgressHook.memoizedState = ref;
789
+ _this._workInProgressHook.memoizedState = ref;
802
790
  return ref;
803
791
  } else {
804
792
  return previousRef;
@@ -810,7 +798,7 @@ function () {
810
798
  };
811
799
 
812
800
  var noOp = function () {
813
- _this2._validateCurrentlyRenderingComponent();
801
+ _this._validateCurrentlyRenderingComponent();
814
802
  };
815
803
 
816
804
  var identity = function (fn) {
@@ -822,13 +810,31 @@ function () {
822
810
  props: props,
823
811
  responder: responder
824
812
  };
813
+ }; // TODO: implement if we decide to keep the shallow renderer
814
+
815
+
816
+ var useTransition = function (config) {
817
+ _this._validateCurrentlyRenderingComponent();
818
+
819
+ var startTransition = function (callback) {
820
+ callback();
821
+ };
822
+
823
+ return [startTransition, false];
824
+ }; // TODO: implement if we decide to keep the shallow renderer
825
+
826
+
827
+ var useDeferredValue = function (value, config) {
828
+ _this._validateCurrentlyRenderingComponent();
829
+
830
+ return value;
825
831
  };
826
832
 
827
833
  return {
828
834
  readContext: readContext,
829
835
  useCallback: identity,
830
836
  useContext: function (context) {
831
- _this2._validateCurrentlyRenderingComponent();
837
+ _this._validateCurrentlyRenderingComponent();
832
838
 
833
839
  return readContext(context);
834
840
  },
@@ -840,20 +846,18 @@ function () {
840
846
  useReducer: useReducer,
841
847
  useRef: useRef,
842
848
  useState: useState,
843
- useResponder: useResponder
849
+ useResponder: useResponder,
850
+ useTransition: useTransition,
851
+ useDeferredValue: useDeferredValue
844
852
  };
845
853
  };
846
854
 
847
855
  _proto2._dispatchAction = function _dispatchAction(queue, action) {
848
- var _this3 = this;
849
-
850
- (function () {
851
- if (!(_this3._numberOfReRenders < RE_RENDER_LIMIT)) {
852
- {
853
- throw ReactError(Error("Too many re-renders. React limits the number of renders to prevent an infinite loop."));
854
- }
856
+ if (!(this._numberOfReRenders < RE_RENDER_LIMIT)) {
857
+ {
858
+ throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");
855
859
  }
856
- })();
860
+ }
857
861
 
858
862
  if (this._rendering) {
859
863
  // This is a render phase update. Stash it in a lazily-created map of
@@ -963,31 +967,25 @@ function () {
963
967
  _proto2.render = function render(element) {
964
968
  var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : emptyObject;
965
969
 
966
- (function () {
967
- if (!React.isValidElement(element)) {
968
- {
969
- throw ReactError(Error("ReactShallowRenderer render(): Invalid component element." + (typeof element === 'function' ? ' Instead of passing a component class, make sure to instantiate ' + 'it by passing it to React.createElement.' : '')));
970
- }
970
+ if (!React.isValidElement(element)) {
971
+ {
972
+ throw Error("ReactShallowRenderer render(): Invalid component element." + (typeof element === 'function' ? ' Instead of passing a component class, make sure to instantiate ' + 'it by passing it to React.createElement.' : ''));
971
973
  }
972
- })();
974
+ }
973
975
 
974
976
  element = element; // Show a special message for host elements since it's a common case.
975
977
 
976
- (function () {
977
- if (!(typeof element.type !== 'string')) {
978
- {
979
- throw ReactError(Error("ReactShallowRenderer render(): Shallow rendering works only with custom components, not primitives (" + element.type + "). Instead of calling `.render(el)` and inspecting the rendered output, look at `el.props` directly instead."));
980
- }
978
+ if (!(typeof element.type !== 'string')) {
979
+ {
980
+ throw Error("ReactShallowRenderer render(): Shallow rendering works only with custom components, not primitives (" + element.type + "). Instead of calling `.render(el)` and inspecting the rendered output, look at `el.props` directly instead.");
981
981
  }
982
- })();
982
+ }
983
983
 
984
- (function () {
985
- if (!(isForwardRef(element) || typeof element.type === 'function' || isMemo(element.type))) {
986
- {
987
- throw ReactError(Error("ReactShallowRenderer render(): Shallow rendering works only with custom components, but the provided element type was `" + (Array.isArray(element.type) ? 'array' : element.type === null ? 'null' : typeof element.type) + "`."));
988
- }
984
+ if (!(isForwardRef(element) || typeof element.type === 'function' || isMemo(element.type))) {
985
+ {
986
+ throw Error("ReactShallowRenderer render(): Shallow rendering works only with custom components, but the provided element type was `" + (Array.isArray(element.type) ? 'array' : element.type === null ? 'null' : typeof element.type) + "`.");
989
987
  }
990
- })();
988
+ }
991
989
 
992
990
  if (this._rendering) {
993
991
  return;
@@ -1049,13 +1047,11 @@ function () {
1049
1047
  // elementType could still be a ForwardRef if it was
1050
1048
  // nested inside Memo.
1051
1049
  if (elementType.$$typeof === ForwardRef) {
1052
- (function () {
1053
- if (!(typeof elementType.render === 'function')) {
1054
- {
1055
- throw ReactError(Error("forwardRef requires a render function but was given " + typeof elementType.render + "."));
1056
- }
1050
+ if (!(typeof elementType.render === 'function')) {
1051
+ {
1052
+ throw Error("forwardRef requires a render function but was given " + typeof elementType.render + ".");
1057
1053
  }
1058
- })();
1054
+ }
1059
1055
 
1060
1056
  this._rendered = elementType.render.call(undefined, element.props, element.ref);
1061
1057
  } else {
@@ -1,4 +1,4 @@
1
- /** @license React v16.10.2
1
+ /** @license React v16.11.0
2
2
  * react-test-renderer-shallow.production.min.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -6,26 +6,26 @@
6
6
  * This source code is licensed under the MIT license found in the
7
7
  * LICENSE file in the root directory of this source tree.
8
8
  */
9
- 'use strict';(function(m,h){"object"===typeof exports&&"undefined"!==typeof module?module.exports=h(require("react")):"function"===typeof define&&define.amd?define(["react"],h):m.ReactShallowRenderer=h(m.React)})(this,function(m){function h(a){for(var b=a.message,c="https://reactjs.org/docs/error-decoder.html?invariant="+b,d=1;d<arguments.length;d++)c+="&args[]="+encodeURIComponent(arguments[d]);a.message="Minified React error #"+b+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ";
10
- return a}function p(a){if("object"===typeof a&&null!==a){var b=a.$$typeof;switch(b){case K:switch(a=a.type,a){case L:case M:case z:case A:case B:case C:return a;default:switch(a=a&&a.$$typeof,a){case D:case q:case E:return a;default:return b}}case F:case n:case G:return b}}}function u(a){if(null==a)return null;if("function"===typeof a)return a.displayName||a.name||null;if("string"===typeof a)return a;switch(a){case z:return"Fragment";case G:return"Portal";case A:return"Profiler";case B:return"StrictMode";
11
- case C:return"Suspense";case N:return"SuspenseList"}if("object"===typeof a)switch(a.$$typeof){case D:return"Context.Consumer";case E:return"Context.Provider";case q:var b=a.render;b=b.displayName||b.name||"";return a.displayName||(""!==b?"ForwardRef("+b+")":"ForwardRef");case n:return u(a.type);case F:if(a=1===a._status?a._result:null)return u(a)}return null}function O(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}function v(a,b){if(w(a,b))return!0;if("object"!==typeof a||null===a||"object"!==
12
- typeof b||null===b)return!1;var c=Object.keys(a),d=Object.keys(b);if(c.length!==d.length)return!1;for(d=0;d<c.length;d++)if(!P.call(b,c[d])||!w(a[c[d]],b[c[d]]))return!1;return!0}function H(){return{memoizedState:null,queue:null,next:null}}function I(a,b){return"function"===typeof b?b(a):b}var x=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.assign,e="function"===typeof Symbol&&Symbol.for,K=e?Symbol.for("react.element"):60103,G=e?Symbol.for("react.portal"):60106,z=e?Symbol.for("react.fragment"):
9
+ 'use strict';(function(m,l){"object"===typeof exports&&"undefined"!==typeof module?module.exports=l(require("react")):"function"===typeof define&&define.amd?define(["react"],l):m.ReactShallowRenderer=l(m.React)})(this,function(m){function l(a){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+a,b=1;b<arguments.length;b++)c+="&args[]="+encodeURIComponent(arguments[b]);return"Minified React error #"+a+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}
10
+ function p(a){if("object"===typeof a&&null!==a){var c=a.$$typeof;switch(c){case K:switch(a=a.type,a){case L:case M:case z:case A:case B:case C:return a;default:switch(a=a&&a.$$typeof,a){case D:case q:case E:return a;default:return c}}case F:case n:case G:return c}}}function u(a){if(null==a)return null;if("function"===typeof a)return a.displayName||a.name||null;if("string"===typeof a)return a;switch(a){case z:return"Fragment";case G:return"Portal";case A:return"Profiler";case B:return"StrictMode";
11
+ case C:return"Suspense";case N:return"SuspenseList"}if("object"===typeof a)switch(a.$$typeof){case D:return"Context.Consumer";case E:return"Context.Provider";case q:var c=a.render;c=c.displayName||c.name||"";return a.displayName||(""!==c?"ForwardRef("+c+")":"ForwardRef");case n:return u(a.type);case F:if(a=1===a._status?a._result:null)return u(a)}return null}function O(a,c){return a===c&&(0!==a||1/a===1/c)||a!==a&&c!==c}function v(a,c){if(w(a,c))return!0;if("object"!==typeof a||null===a||"object"!==
12
+ typeof c||null===c)return!1;var b=Object.keys(a),d=Object.keys(c);if(b.length!==d.length)return!1;for(d=0;d<b.length;d++)if(!P.call(c,b[d])||!w(a[b[d]],c[b[d]]))return!1;return!0}function H(){return{memoizedState:null,queue:null,next:null}}function I(a,c){return"function"===typeof c?c(a):c}var x=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.assign,e="function"===typeof Symbol&&Symbol.for,K=e?Symbol.for("react.element"):60103,G=e?Symbol.for("react.portal"):60106,z=e?Symbol.for("react.fragment"):
13
13
  60107,B=e?Symbol.for("react.strict_mode"):60108,A=e?Symbol.for("react.profiler"):60114,E=e?Symbol.for("react.provider"):60109,D=e?Symbol.for("react.context"):60110,L=e?Symbol.for("react.async_mode"):60111,M=e?Symbol.for("react.concurrent_mode"):60111,q=e?Symbol.for("react.forward_ref"):60112,C=e?Symbol.for("react.suspense"):60113,N=e?Symbol.for("react.suspense_list"):60120,n=e?Symbol.for("react.memo"):60115,F=e?Symbol.for("react.lazy"):60116,Q=q;e=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
14
- e.hasOwnProperty("ReactCurrentDispatcher")||(e.ReactCurrentDispatcher={current:null});e.hasOwnProperty("ReactCurrentBatchConfig")||(e.ReactCurrentBatchConfig={suspense:null});var w="function"===typeof Object.is?Object.is:O,P=Object.prototype.hasOwnProperty,y=e.ReactCurrentDispatcher,r={},R=function(){function a(c){this._renderer=c;this._callbacks=[]}var b=a.prototype;b._enqueueCallback=function(c,d){"function"===typeof c&&d&&this._callbacks.push({callback:c,publicInstance:d})};b._invokeCallbacks=
15
- function(){var c=this._callbacks;this._callbacks=[];c.forEach(function(c){c.callback.call(c.publicInstance)})};b.isMounted=function(c){return!!this._renderer._element};b.enqueueForceUpdate=function(c,d,a){this._enqueueCallback(d,c);this._renderer._forcedUpdate=!0;this._renderer.render(this._renderer._element,this._renderer._context)};b.enqueueReplaceState=function(c,d,a,b){this._enqueueCallback(a,c);this._renderer._newState=d;this._renderer.render(this._renderer._element,this._renderer._context)};
16
- b.enqueueSetState=function(c,d,a,b){this._enqueueCallback(a,c);a=this._renderer._newState||c.state;"function"===typeof d&&(d=d.call(c,a,c.props));null!==d&&void 0!==d&&(this._renderer._newState=x({},a,{},d),this._renderer.render(this._renderer._element,this._renderer._context))};return a}(),t=function(){function a(){this._reset()}var b=a.prototype;b._reset=function(){this._rendered=this._newState=this._instance=this._element=this._context=null;this._forcedUpdate=this._rendering=!1;this._updater=new R(this);
17
- this._dispatcher=this._createDispatcher();this._firstWorkInProgressHook=this._workInProgressHook=null;this._didScheduleRenderPhaseUpdate=this._isReRender=!1;this._renderPhaseUpdates=null;this._numberOfReRenders=0};b._validateCurrentlyRenderingComponent=function(){if(!this._rendering||this._instance)throw h(Error(321));};b._createDispatcher=function(){var c=this,d=function(a,d,b){c._validateCurrentlyRenderingComponent();c._createWorkInProgressHook();var f=c._workInProgressHook;if(c._isReRender){b=
18
- f.queue;d=b.dispatch;if(0<c._numberOfReRenders){if(null!==c._renderPhaseUpdates){var k=c._renderPhaseUpdates.get(b);if(void 0!==k){c._renderPhaseUpdates.delete(b);b=f.memoizedState;do b=a(b,k.action),k=k.next;while(null!==k);f.memoizedState=b;return[b,d]}}return[f.memoizedState,d]}k=f.memoizedState;var e=b.first;if(null!==e){do k=a(k,e.action),e=e.next;while(null!==e);b.first=null;f.memoizedState=k}return[k,d]}a=a===I?"function"===typeof d?d():d:void 0!==b?b(d):d;f.memoizedState=a;a=f.queue={first:null,
19
- dispatch:null};a=a.dispatch=c._dispatchAction.bind(c,a);return[f.memoizedState,a]},a=function(){c._validateCurrentlyRenderingComponent()};return{readContext:function(c,a){return c._currentValue},useCallback:function(c){return c},useContext:function(a){c._validateCurrentlyRenderingComponent();return a._currentValue},useDebugValue:a,useEffect:a,useImperativeHandle:a,useLayoutEffect:a,useMemo:function(a,d){c._validateCurrentlyRenderingComponent();c._createWorkInProgressHook();d=void 0!==d?d:null;if(null!==
20
- c._workInProgressHook&&null!==c._workInProgressHook.memoizedState){var b=c._workInProgressHook.memoizedState,f=b[1];if(null!==d){a:if(null===f)f=!1;else{for(var e=0;e<f.length&&e<d.length;e++)if(!w(d[e],f[e])){f=!1;break a}f=!0}if(f)return b[0]}}a=a();c._workInProgressHook.memoizedState=[a,d];return a},useReducer:d,useRef:function(a){c._validateCurrentlyRenderingComponent();c._createWorkInProgressHook();var d=c._workInProgressHook.memoizedState;return null===d?(a={current:a},c._workInProgressHook.memoizedState=
21
- a):d},useState:function(c){return d(I,c)},useResponder:function(c,a){return{props:a,responder:c}}}};b._dispatchAction=function(c,a){if(!(25>this._numberOfReRenders))throw h(Error(301));if(this._rendering){this._didScheduleRenderPhaseUpdate=!0;a={action:a,next:null};var d=this._renderPhaseUpdates;null===d&&(this._renderPhaseUpdates=d=new Map);var b=d.get(c);if(void 0===b)d.set(c,a);else{for(c=b;null!==c.next;)c=c.next;c.next=a}}else{a={action:a,next:null};d=c.first;if(null===d)c.first=a;else{for(;null!==
22
- d.next;)d=d.next;d.next=a}this.render(this._element,this._context)}};b._createWorkInProgressHook=function(){null===this._workInProgressHook?null===this._firstWorkInProgressHook?(this._isReRender=!1,this._firstWorkInProgressHook=this._workInProgressHook=H()):(this._isReRender=!0,this._workInProgressHook=this._firstWorkInProgressHook):null===this._workInProgressHook.next?(this._isReRender=!1,this._workInProgressHook=this._workInProgressHook.next=H()):(this._isReRender=!0,this._workInProgressHook=this._workInProgressHook.next);
23
- return this._workInProgressHook};b._finishHooks=function(c,a){this._didScheduleRenderPhaseUpdate?(this._didScheduleRenderPhaseUpdate=!1,this._numberOfReRenders+=1,this._workInProgressHook=null,this._rendering=!1,this.render(c,a)):(this._renderPhaseUpdates=this._workInProgressHook=null,this._numberOfReRenders=0)};b.getMountedInstance=function(){return this._instance};b.getRenderOutput=function(){return this._rendered};b.render=function(c){var a=1<arguments.length&&void 0!==arguments[1]?arguments[1]:
24
- r;if(!m.isValidElement(c))throw h(Error(12),"function"===typeof c?" Instead of passing a component class, make sure to instantiate it by passing it to React.createElement.":"");if("string"===typeof c.type)throw h(Error(13),c.type);if(p(c)!==q&&"function"!==typeof c.type&&p(c.type)!==n)throw h(Error(249),Array.isArray(c.type)?"array":null===c.type?"null":typeof c.type);if(!this._rendering){null!=this._element&&this._element.type!==c.type&&this._reset();var b=p(c.type)===n?c.type.type:c.type,e=this._element;
25
- this._rendering=!0;this._element=c;var l;if((l=b.contextTypes)&&a){var J={},g;for(g in l)J[g]=a[g];l=J}else l=r;this._context=l;p(c.type)===n&&b.propTypes&&u(b);if(this._instance)this._updateClassComponent(b,c,this._context);else if(b.prototype&&b.prototype.isReactComponent)this._instance=new b(c.props,this._context,this._updater),"function"===typeof b.getDerivedStateFromProps&&(a=b.getDerivedStateFromProps.call(null,c.props,this._instance.state),null!=a&&(this._instance.state=x({},this._instance.state,
26
- a))),this._mountClassComponent(b,c,this._context);else if(l=!0,p(c.type)===n&&null!==e&&(c.type.compare||v)(e.props,c.props)&&(l=!1),l){e=y.current;y.current=this._dispatcher;try{if(b.$$typeof===Q){if("function"!==typeof b.render)throw h(Error(322),typeof b.render);this._rendered=b.render.call(void 0,c.props,c.ref)}else this._rendered=b(c.props,this._context)}finally{y.current=e}this._finishHooks(c,a)}this._rendering=!1;this._updater._invokeCallbacks();return this.getRenderOutput()}};b.unmount=function(){this._instance&&
27
- "function"===typeof this._instance.componentWillUnmount&&this._instance.componentWillUnmount();this._reset()};b._mountClassComponent=function(a,b,e){this._instance.context=e;this._instance.props=b.props;this._instance.state=this._instance.state||null;this._instance.updater=this._updater;if("function"===typeof this._instance.UNSAFE_componentWillMount||"function"===typeof this._instance.componentWillMount)b=this._newState,"function"!==typeof a.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&
28
- ("function"===typeof this._instance.componentWillMount&&this._instance.componentWillMount(),"function"===typeof this._instance.UNSAFE_componentWillMount&&this._instance.UNSAFE_componentWillMount()),b!==this._newState&&(this._instance.state=this._newState||r);this._rendered=this._instance.render()};b._updateClassComponent=function(a,b,e){b=b.props;var c=this._instance.state||r,d=this._instance.props;d!==b&&"function"!==typeof a.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&
29
- ("function"===typeof this._instance.componentWillReceiveProps&&this._instance.componentWillReceiveProps(b,e),"function"===typeof this._instance.UNSAFE_componentWillReceiveProps&&this._instance.UNSAFE_componentWillReceiveProps(b,e));var f=this._newState||c;if("function"===typeof a.getDerivedStateFromProps){var g=a.getDerivedStateFromProps.call(null,b,f);null!=g&&(f=x({},f,g))}g=!0;this._forcedUpdate?(g=!0,this._forcedUpdate=!1):"function"===typeof this._instance.shouldComponentUpdate?g=!!this._instance.shouldComponentUpdate(b,
30
- f,e):a.prototype&&a.prototype.isPureReactComponent&&(g=!v(d,b)||!v(c,f));g&&"function"!==typeof a.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillUpdate&&this._instance.componentWillUpdate(b,f,e),"function"===typeof this._instance.UNSAFE_componentWillUpdate&&this._instance.UNSAFE_componentWillUpdate(b,f,e));this._instance.context=e;this._instance.props=b;this._instance.state=f;this._newState=null;g&&(this._rendered=
31
- this._instance.render())};return a}();t.createRenderer=function(){return new t};e=(e={default:t},t)||e;return e.default||e});
14
+ e.hasOwnProperty("ReactCurrentDispatcher")||(e.ReactCurrentDispatcher={current:null});e.hasOwnProperty("ReactCurrentBatchConfig")||(e.ReactCurrentBatchConfig={suspense:null});var w="function"===typeof Object.is?Object.is:O,P=Object.prototype.hasOwnProperty,y=e.ReactCurrentDispatcher,r={},R=function(){function a(b){this._renderer=b;this._callbacks=[]}var c=a.prototype;c._enqueueCallback=function(b,d){"function"===typeof b&&d&&this._callbacks.push({callback:b,publicInstance:d})};c._invokeCallbacks=
15
+ function(){var b=this._callbacks;this._callbacks=[];b.forEach(function(b){b.callback.call(b.publicInstance)})};c.isMounted=function(b){return!!this._renderer._element};c.enqueueForceUpdate=function(b,d,a){this._enqueueCallback(d,b);this._renderer._forcedUpdate=!0;this._renderer.render(this._renderer._element,this._renderer._context)};c.enqueueReplaceState=function(b,d,a,c){this._enqueueCallback(a,b);this._renderer._newState=d;this._renderer.render(this._renderer._element,this._renderer._context)};
16
+ c.enqueueSetState=function(b,d,a,c){this._enqueueCallback(a,b);a=this._renderer._newState||b.state;"function"===typeof d&&(d=d.call(b,a,b.props));null!==d&&void 0!==d&&(this._renderer._newState=x({},a,{},d),this._renderer.render(this._renderer._element,this._renderer._context))};return a}(),t=function(){function a(){this._reset()}var c=a.prototype;c._reset=function(){this._rendered=this._newState=this._instance=this._element=this._context=null;this._forcedUpdate=this._rendering=!1;this._updater=new R(this);
17
+ this._dispatcher=this._createDispatcher();this._firstWorkInProgressHook=this._workInProgressHook=null;this._didScheduleRenderPhaseUpdate=this._isReRender=!1;this._renderPhaseUpdates=null;this._numberOfReRenders=0};c._validateCurrentlyRenderingComponent=function(){if(!this._rendering||this._instance)throw Error(l(321));};c._createDispatcher=function(){var b=this,a=function(a,c,d){b._validateCurrentlyRenderingComponent();b._createWorkInProgressHook();var f=b._workInProgressHook;if(b._isReRender){d=
18
+ f.queue;c=d.dispatch;if(0<b._numberOfReRenders){if(null!==b._renderPhaseUpdates){var g=b._renderPhaseUpdates.get(d);if(void 0!==g){b._renderPhaseUpdates.delete(d);d=f.memoizedState;do d=a(d,g.action),g=g.next;while(null!==g);f.memoizedState=d;return[d,c]}}return[f.memoizedState,c]}g=f.memoizedState;var h=d.first;if(null!==h){do g=a(g,h.action),h=h.next;while(null!==h);d.first=null;f.memoizedState=g}return[g,c]}a=a===I?"function"===typeof c?c():c:void 0!==d?d(c):c;f.memoizedState=a;a=f.queue={first:null,
19
+ dispatch:null};a=a.dispatch=b._dispatchAction.bind(b,a);return[f.memoizedState,a]},c=function(){b._validateCurrentlyRenderingComponent()};return{readContext:function(b,a){return b._currentValue},useCallback:function(b){return b},useContext:function(a){b._validateCurrentlyRenderingComponent();return a._currentValue},useDebugValue:c,useEffect:c,useImperativeHandle:c,useLayoutEffect:c,useMemo:function(a,d){b._validateCurrentlyRenderingComponent();b._createWorkInProgressHook();d=void 0!==d?d:null;if(null!==
20
+ b._workInProgressHook&&null!==b._workInProgressHook.memoizedState){var c=b._workInProgressHook.memoizedState,f=c[1];if(null!==d){a:if(null===f)f=!1;else{for(var g=0;g<f.length&&g<d.length;g++)if(!w(d[g],f[g])){f=!1;break a}f=!0}if(f)return c[0]}}a=a();b._workInProgressHook.memoizedState=[a,d];return a},useReducer:a,useRef:function(a){b._validateCurrentlyRenderingComponent();b._createWorkInProgressHook();var d=b._workInProgressHook.memoizedState;return null===d?(a={current:a},b._workInProgressHook.memoizedState=
21
+ a):d},useState:function(b){return a(I,b)},useResponder:function(b,a){return{props:a,responder:b}},useTransition:function(a){b._validateCurrentlyRenderingComponent();return[function(b){b()},!1]},useDeferredValue:function(a,d){b._validateCurrentlyRenderingComponent();return a}}};c._dispatchAction=function(b,a){if(!(25>this._numberOfReRenders))throw Error(l(301));if(this._rendering){this._didScheduleRenderPhaseUpdate=!0;a={action:a,next:null};var d=this._renderPhaseUpdates;null===d&&(this._renderPhaseUpdates=
22
+ d=new Map);var c=d.get(b);if(void 0===c)d.set(b,a);else{for(b=c;null!==b.next;)b=b.next;b.next=a}}else{a={action:a,next:null};d=b.first;if(null===d)b.first=a;else{for(;null!==d.next;)d=d.next;d.next=a}this.render(this._element,this._context)}};c._createWorkInProgressHook=function(){null===this._workInProgressHook?null===this._firstWorkInProgressHook?(this._isReRender=!1,this._firstWorkInProgressHook=this._workInProgressHook=H()):(this._isReRender=!0,this._workInProgressHook=this._firstWorkInProgressHook):
23
+ null===this._workInProgressHook.next?(this._isReRender=!1,this._workInProgressHook=this._workInProgressHook.next=H()):(this._isReRender=!0,this._workInProgressHook=this._workInProgressHook.next);return this._workInProgressHook};c._finishHooks=function(b,a){this._didScheduleRenderPhaseUpdate?(this._didScheduleRenderPhaseUpdate=!1,this._numberOfReRenders+=1,this._workInProgressHook=null,this._rendering=!1,this.render(b,a)):(this._renderPhaseUpdates=this._workInProgressHook=null,this._numberOfReRenders=
24
+ 0)};c.getMountedInstance=function(){return this._instance};c.getRenderOutput=function(){return this._rendered};c.render=function(b){var a=1<arguments.length&&void 0!==arguments[1]?arguments[1]:r;if(!m.isValidElement(b))throw Error(l(12,"function"===typeof b?" Instead of passing a component class, make sure to instantiate it by passing it to React.createElement.":""));if("string"===typeof b.type)throw Error(l(13,b.type));if(p(b)!==q&&"function"!==typeof b.type&&p(b.type)!==n)throw Error(l(249,Array.isArray(b.type)?
25
+ "array":null===b.type?"null":typeof b.type));if(!this._rendering){null!=this._element&&this._element.type!==b.type&&this._reset();var c=p(b.type)===n?b.type.type:b.type,e=this._element;this._rendering=!0;this._element=b;var h;if((h=c.contextTypes)&&a){var J={},k;for(k in h)J[k]=a[k];h=J}else h=r;this._context=h;p(b.type)===n&&c.propTypes&&u(c);if(this._instance)this._updateClassComponent(c,b,this._context);else if(c.prototype&&c.prototype.isReactComponent)this._instance=new c(b.props,this._context,
26
+ this._updater),"function"===typeof c.getDerivedStateFromProps&&(a=c.getDerivedStateFromProps.call(null,b.props,this._instance.state),null!=a&&(this._instance.state=x({},this._instance.state,a))),this._mountClassComponent(c,b,this._context);else if(h=!0,p(b.type)===n&&null!==e&&(b.type.compare||v)(e.props,b.props)&&(h=!1),h){e=y.current;y.current=this._dispatcher;try{if(c.$$typeof===Q){if("function"!==typeof c.render)throw Error(l(322,typeof c.render));this._rendered=c.render.call(void 0,b.props,b.ref)}else this._rendered=
27
+ c(b.props,this._context)}finally{y.current=e}this._finishHooks(b,a)}this._rendering=!1;this._updater._invokeCallbacks();return this.getRenderOutput()}};c.unmount=function(){this._instance&&"function"===typeof this._instance.componentWillUnmount&&this._instance.componentWillUnmount();this._reset()};c._mountClassComponent=function(b,a,c){this._instance.context=c;this._instance.props=a.props;this._instance.state=this._instance.state||null;this._instance.updater=this._updater;if("function"===typeof this._instance.UNSAFE_componentWillMount||
28
+ "function"===typeof this._instance.componentWillMount)a=this._newState,"function"!==typeof b.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillMount&&this._instance.componentWillMount(),"function"===typeof this._instance.UNSAFE_componentWillMount&&this._instance.UNSAFE_componentWillMount()),a!==this._newState&&(this._instance.state=this._newState||r);this._rendered=this._instance.render()};c._updateClassComponent=
29
+ function(a,c,e){c=c.props;var b=this._instance.state||r,d=this._instance.props;d!==c&&"function"!==typeof a.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillReceiveProps&&this._instance.componentWillReceiveProps(c,e),"function"===typeof this._instance.UNSAFE_componentWillReceiveProps&&this._instance.UNSAFE_componentWillReceiveProps(c,e));var f=this._newState||b;if("function"===typeof a.getDerivedStateFromProps){var k=
30
+ a.getDerivedStateFromProps.call(null,c,f);null!=k&&(f=x({},f,k))}k=!0;this._forcedUpdate?(k=!0,this._forcedUpdate=!1):"function"===typeof this._instance.shouldComponentUpdate?k=!!this._instance.shouldComponentUpdate(c,f,e):a.prototype&&a.prototype.isPureReactComponent&&(k=!v(d,c)||!v(b,f));k&&"function"!==typeof a.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillUpdate&&this._instance.componentWillUpdate(c,f,e),
31
+ "function"===typeof this._instance.UNSAFE_componentWillUpdate&&this._instance.UNSAFE_componentWillUpdate(c,f,e));this._instance.context=e;this._instance.props=c;this._instance.state=f;this._newState=null;k&&(this._rendered=this._instance.render())};return a}();t.createRenderer=function(){return new t};e=(e={default:t},t)||e;return e.default||e});