@gravity-ui/navigation 1.1.3 → 1.2.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.
Files changed (120) hide show
  1. package/README.md +27 -0
  2. package/build/cjs/ActionBar-393db3ea.js +62 -0
  3. package/build/cjs/ActionBar-393db3ea.js.map +1 -0
  4. package/build/cjs/AsideHeader.js +50 -0
  5. package/build/cjs/AsideHeader.js.map +1 -0
  6. package/build/cjs/AsideHeaderContext.js +41 -0
  7. package/build/cjs/AsideHeaderContext.js.map +1 -0
  8. package/build/cjs/Content-64d5738a.js +20 -0
  9. package/build/cjs/Content-64d5738a.js.map +1 -0
  10. package/build/cjs/Drawer.js +3091 -0
  11. package/build/cjs/Drawer.js.map +1 -0
  12. package/build/cjs/FooterItem-01b32eb7.js +286 -0
  13. package/build/cjs/FooterItem-01b32eb7.js.map +1 -0
  14. package/build/cjs/FooterItem.js +30 -0
  15. package/build/cjs/FooterItem.js.map +1 -0
  16. package/build/cjs/HotkeysPanel-9e5af200.js +66 -0
  17. package/build/cjs/HotkeysPanel-9e5af200.js.map +1 -0
  18. package/build/cjs/Item-ff00938b.js +294 -0
  19. package/build/cjs/Item-ff00938b.js.map +1 -0
  20. package/build/cjs/PageLayout.js +36 -0
  21. package/build/cjs/PageLayout.js.map +1 -0
  22. package/build/cjs/PageLayoutAside.js +967 -0
  23. package/build/cjs/PageLayoutAside.js.map +1 -0
  24. package/build/cjs/Settings-014971f7.js +489 -0
  25. package/build/cjs/Settings-014971f7.js.map +1 -0
  26. package/build/cjs/Title-d58ff158.js +41 -0
  27. package/build/cjs/Title-d58ff158.js.map +1 -0
  28. package/build/cjs/components/AsideHeader/AsideHeader.d.ts +15 -1
  29. package/build/cjs/components/AsideHeader/AsideHeaderContext.d.ts +1 -2
  30. package/build/cjs/components/AsideHeader/__stories__/AsideHeader.stories.d.ts +1 -0
  31. package/build/cjs/components/AsideHeader/components/PageLayout/PageLayout.d.ts +11 -0
  32. package/build/cjs/components/AsideHeader/components/PageLayout/PageLayoutAside.d.ts +5 -0
  33. package/build/cjs/components/AsideHeader/types.d.ts +8 -3
  34. package/build/cjs/components/CompositeBar/utils.d.ts +1 -1
  35. package/build/cjs/components/Content/Content.d.ts +1 -2
  36. package/build/cjs/components/index.d.ts +2 -0
  37. package/build/cjs/constants-9783dc2d.js +10 -0
  38. package/build/cjs/constants-9783dc2d.js.map +1 -0
  39. package/build/cjs/debounce-8772fd80.js +545 -0
  40. package/build/cjs/debounce-8772fd80.js.map +1 -0
  41. package/build/cjs/index.js +47 -6036
  42. package/build/cjs/index.js.map +1 -1
  43. package/build/cjs/index2.js +13 -0
  44. package/build/cjs/index2.js.map +1 -0
  45. package/build/cjs/index3.js +16 -0
  46. package/build/cjs/index3.js.map +1 -0
  47. package/build/cjs/index4.js +17 -0
  48. package/build/cjs/index4.js.map +1 -0
  49. package/build/cjs/index5.js +20 -0
  50. package/build/cjs/index5.js.map +1 -0
  51. package/build/cjs/index6.js +19 -0
  52. package/build/cjs/index6.js.map +1 -0
  53. package/build/cjs/registerKeyset-f4ce9ee7.js +215 -0
  54. package/build/cjs/registerKeyset-f4ce9ee7.js.map +1 -0
  55. package/build/cjs/style-inject.es-935afc04.js +38 -0
  56. package/build/cjs/style-inject.es-935afc04.js.map +1 -0
  57. package/build/cjs/tslib.es6-705c6589.js +36 -0
  58. package/build/cjs/tslib.es6-705c6589.js.map +1 -0
  59. package/build/cjs/utils-e82025ce.js +8 -0
  60. package/build/cjs/utils-e82025ce.js.map +1 -0
  61. package/build/esm/ActionBar-f1c9a2d3.js +56 -0
  62. package/build/esm/ActionBar-f1c9a2d3.js.map +1 -0
  63. package/build/esm/AsideHeader.js +42 -0
  64. package/build/esm/AsideHeader.js.map +1 -0
  65. package/build/esm/AsideHeaderContext.js +28 -0
  66. package/build/esm/AsideHeaderContext.js.map +1 -0
  67. package/build/esm/Content-f94ba85d.js +14 -0
  68. package/build/esm/Content-f94ba85d.js.map +1 -0
  69. package/build/esm/Drawer.js +3081 -0
  70. package/build/esm/Drawer.js.map +1 -0
  71. package/build/esm/FooterItem-d66ab545.js +279 -0
  72. package/build/esm/FooterItem-d66ab545.js.map +1 -0
  73. package/build/esm/FooterItem.js +22 -0
  74. package/build/esm/FooterItem.js.map +1 -0
  75. package/build/esm/HotkeysPanel-67f3066d.js +60 -0
  76. package/build/esm/HotkeysPanel-67f3066d.js.map +1 -0
  77. package/build/esm/Item-30c88899.js +280 -0
  78. package/build/esm/Item-30c88899.js.map +1 -0
  79. package/build/esm/PageLayout.js +28 -0
  80. package/build/esm/PageLayout.js.map +1 -0
  81. package/build/esm/PageLayoutAside.js +941 -0
  82. package/build/esm/PageLayoutAside.js.map +1 -0
  83. package/build/esm/Settings-ea96388d.js +464 -0
  84. package/build/esm/Settings-ea96388d.js.map +1 -0
  85. package/build/esm/Title-3d579ca4.js +35 -0
  86. package/build/esm/Title-3d579ca4.js.map +1 -0
  87. package/build/esm/components/AsideHeader/AsideHeader.d.ts +15 -1
  88. package/build/esm/components/AsideHeader/AsideHeaderContext.d.ts +1 -2
  89. package/build/esm/components/AsideHeader/__stories__/AsideHeader.stories.d.ts +1 -0
  90. package/build/esm/components/AsideHeader/components/PageLayout/PageLayout.d.ts +11 -0
  91. package/build/esm/components/AsideHeader/components/PageLayout/PageLayoutAside.d.ts +5 -0
  92. package/build/esm/components/AsideHeader/types.d.ts +8 -3
  93. package/build/esm/components/CompositeBar/utils.d.ts +1 -1
  94. package/build/esm/components/Content/Content.d.ts +1 -2
  95. package/build/esm/components/index.d.ts +2 -0
  96. package/build/esm/constants-b3a73cd1.js +6 -0
  97. package/build/esm/constants-b3a73cd1.js.map +1 -0
  98. package/build/esm/debounce-64cd2b4c.js +543 -0
  99. package/build/esm/debounce-64cd2b4c.js.map +1 -0
  100. package/build/esm/index.js +24 -6000
  101. package/build/esm/index.js.map +1 -1
  102. package/build/esm/index2.js +5 -0
  103. package/build/esm/index2.js.map +1 -0
  104. package/build/esm/index3.js +8 -0
  105. package/build/esm/index3.js.map +1 -0
  106. package/build/esm/index4.js +9 -0
  107. package/build/esm/index4.js.map +1 -0
  108. package/build/esm/index5.js +11 -0
  109. package/build/esm/index5.js.map +1 -0
  110. package/build/esm/index6.js +10 -0
  111. package/build/esm/index6.js.map +1 -0
  112. package/build/esm/registerKeyset-35f1ea08.js +212 -0
  113. package/build/esm/registerKeyset-35f1ea08.js.map +1 -0
  114. package/build/esm/style-inject.es-cfd97593.js +35 -0
  115. package/build/esm/style-inject.es-cfd97593.js.map +1 -0
  116. package/build/esm/tslib.es6-3cd4e99f.js +34 -0
  117. package/build/esm/tslib.es6-3cd4e99f.js.map +1 -0
  118. package/build/esm/utils-cc9b1968.js +6 -0
  119. package/build/esm/utils-cc9b1968.js.map +1 -0
  120. package/package.json +3 -3
@@ -0,0 +1,3091 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var ReactDOM = require('react-dom');
7
+ var uikit = require('@gravity-ui/uikit');
8
+ var styleInject_es = require('./style-inject.es-935afc04.js');
9
+ require('@bem-react/classname');
10
+
11
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
+
13
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
14
+ var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
15
+
16
+ function _extends() {
17
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
18
+ for (var i = 1; i < arguments.length; i++) {
19
+ var source = arguments[i];
20
+ for (var key in source) {
21
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
22
+ target[key] = source[key];
23
+ }
24
+ }
25
+ }
26
+ return target;
27
+ };
28
+ return _extends.apply(this, arguments);
29
+ }
30
+
31
+ function _objectWithoutPropertiesLoose(source, excluded) {
32
+ if (source == null) return {};
33
+ var target = {};
34
+ var sourceKeys = Object.keys(source);
35
+ var key, i;
36
+ for (i = 0; i < sourceKeys.length; i++) {
37
+ key = sourceKeys[i];
38
+ if (excluded.indexOf(key) >= 0) continue;
39
+ target[key] = source[key];
40
+ }
41
+ return target;
42
+ }
43
+
44
+ function _setPrototypeOf(o, p) {
45
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
46
+ o.__proto__ = p;
47
+ return o;
48
+ };
49
+ return _setPrototypeOf(o, p);
50
+ }
51
+
52
+ function _inheritsLoose(subClass, superClass) {
53
+ subClass.prototype = Object.create(superClass.prototype);
54
+ subClass.prototype.constructor = subClass;
55
+ _setPrototypeOf(subClass, superClass);
56
+ }
57
+
58
+ var propTypes = {exports: {}};
59
+
60
+ var reactIs = {exports: {}};
61
+
62
+ var reactIs_production_min = {};
63
+
64
+ /** @license React v16.13.1
65
+ * react-is.production.min.js
66
+ *
67
+ * Copyright (c) Facebook, Inc. and its affiliates.
68
+ *
69
+ * This source code is licensed under the MIT license found in the
70
+ * LICENSE file in the root directory of this source tree.
71
+ */
72
+
73
+ var hasRequiredReactIs_production_min;
74
+
75
+ function requireReactIs_production_min () {
76
+ if (hasRequiredReactIs_production_min) return reactIs_production_min;
77
+ hasRequiredReactIs_production_min = 1;
78
+ 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?
79
+ Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
80
+ function z(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 A(a){return z(a)===m}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m;reactIs_production_min.ContextConsumer=k;reactIs_production_min.ContextProvider=h;reactIs_production_min.Element=c;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r;reactIs_production_min.Portal=d;
81
+ reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(a){return z(a)===k};reactIs_production_min.isContextProvider=function(a){return z(a)===h};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min.isForwardRef=function(a){return z(a)===n};reactIs_production_min.isFragment=function(a){return z(a)===e};reactIs_production_min.isLazy=function(a){return z(a)===t};
82
+ reactIs_production_min.isMemo=function(a){return z(a)===r};reactIs_production_min.isPortal=function(a){return z(a)===d};reactIs_production_min.isProfiler=function(a){return z(a)===g};reactIs_production_min.isStrictMode=function(a){return z(a)===f};reactIs_production_min.isSuspense=function(a){return z(a)===p};
83
+ reactIs_production_min.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===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};reactIs_production_min.typeOf=z;
84
+ return reactIs_production_min;
85
+ }
86
+
87
+ var reactIs_development = {};
88
+
89
+ /** @license React v16.13.1
90
+ * react-is.development.js
91
+ *
92
+ * Copyright (c) Facebook, Inc. and its affiliates.
93
+ *
94
+ * This source code is licensed under the MIT license found in the
95
+ * LICENSE file in the root directory of this source tree.
96
+ */
97
+
98
+ var hasRequiredReactIs_development;
99
+
100
+ function requireReactIs_development () {
101
+ if (hasRequiredReactIs_development) return reactIs_development;
102
+ hasRequiredReactIs_development = 1;
103
+
104
+
105
+
106
+ if (process.env.NODE_ENV !== "production") {
107
+ (function() {
108
+
109
+ // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
110
+ // nor polyfill, then a plain number is used for performance.
111
+ var hasSymbol = typeof Symbol === 'function' && Symbol.for;
112
+ var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
113
+ var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
114
+ var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
115
+ var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
116
+ var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
117
+ var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
118
+ var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
119
+ // (unstable) APIs that have been removed. Can we remove the symbols?
120
+
121
+ var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
122
+ var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
123
+ var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
124
+ var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
125
+ var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
126
+ var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
127
+ var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
128
+ var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
129
+ var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
130
+ var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
131
+ var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
132
+
133
+ function isValidElementType(type) {
134
+ return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
135
+ 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 || type.$$typeof === REACT_BLOCK_TYPE);
136
+ }
137
+
138
+ function typeOf(object) {
139
+ if (typeof object === 'object' && object !== null) {
140
+ var $$typeof = object.$$typeof;
141
+
142
+ switch ($$typeof) {
143
+ case REACT_ELEMENT_TYPE:
144
+ var type = object.type;
145
+
146
+ switch (type) {
147
+ case REACT_ASYNC_MODE_TYPE:
148
+ case REACT_CONCURRENT_MODE_TYPE:
149
+ case REACT_FRAGMENT_TYPE:
150
+ case REACT_PROFILER_TYPE:
151
+ case REACT_STRICT_MODE_TYPE:
152
+ case REACT_SUSPENSE_TYPE:
153
+ return type;
154
+
155
+ default:
156
+ var $$typeofType = type && type.$$typeof;
157
+
158
+ switch ($$typeofType) {
159
+ case REACT_CONTEXT_TYPE:
160
+ case REACT_FORWARD_REF_TYPE:
161
+ case REACT_LAZY_TYPE:
162
+ case REACT_MEMO_TYPE:
163
+ case REACT_PROVIDER_TYPE:
164
+ return $$typeofType;
165
+
166
+ default:
167
+ return $$typeof;
168
+ }
169
+
170
+ }
171
+
172
+ case REACT_PORTAL_TYPE:
173
+ return $$typeof;
174
+ }
175
+ }
176
+
177
+ return undefined;
178
+ } // AsyncMode is deprecated along with isAsyncMode
179
+
180
+ var AsyncMode = REACT_ASYNC_MODE_TYPE;
181
+ var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
182
+ var ContextConsumer = REACT_CONTEXT_TYPE;
183
+ var ContextProvider = REACT_PROVIDER_TYPE;
184
+ var Element = REACT_ELEMENT_TYPE;
185
+ var ForwardRef = REACT_FORWARD_REF_TYPE;
186
+ var Fragment = REACT_FRAGMENT_TYPE;
187
+ var Lazy = REACT_LAZY_TYPE;
188
+ var Memo = REACT_MEMO_TYPE;
189
+ var Portal = REACT_PORTAL_TYPE;
190
+ var Profiler = REACT_PROFILER_TYPE;
191
+ var StrictMode = REACT_STRICT_MODE_TYPE;
192
+ var Suspense = REACT_SUSPENSE_TYPE;
193
+ var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
194
+
195
+ function isAsyncMode(object) {
196
+ {
197
+ if (!hasWarnedAboutDeprecatedIsAsyncMode) {
198
+ hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
199
+
200
+ console['warn']('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.');
201
+ }
202
+ }
203
+
204
+ return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
205
+ }
206
+ function isConcurrentMode(object) {
207
+ return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
208
+ }
209
+ function isContextConsumer(object) {
210
+ return typeOf(object) === REACT_CONTEXT_TYPE;
211
+ }
212
+ function isContextProvider(object) {
213
+ return typeOf(object) === REACT_PROVIDER_TYPE;
214
+ }
215
+ function isElement(object) {
216
+ return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
217
+ }
218
+ function isForwardRef(object) {
219
+ return typeOf(object) === REACT_FORWARD_REF_TYPE;
220
+ }
221
+ function isFragment(object) {
222
+ return typeOf(object) === REACT_FRAGMENT_TYPE;
223
+ }
224
+ function isLazy(object) {
225
+ return typeOf(object) === REACT_LAZY_TYPE;
226
+ }
227
+ function isMemo(object) {
228
+ return typeOf(object) === REACT_MEMO_TYPE;
229
+ }
230
+ function isPortal(object) {
231
+ return typeOf(object) === REACT_PORTAL_TYPE;
232
+ }
233
+ function isProfiler(object) {
234
+ return typeOf(object) === REACT_PROFILER_TYPE;
235
+ }
236
+ function isStrictMode(object) {
237
+ return typeOf(object) === REACT_STRICT_MODE_TYPE;
238
+ }
239
+ function isSuspense(object) {
240
+ return typeOf(object) === REACT_SUSPENSE_TYPE;
241
+ }
242
+
243
+ reactIs_development.AsyncMode = AsyncMode;
244
+ reactIs_development.ConcurrentMode = ConcurrentMode;
245
+ reactIs_development.ContextConsumer = ContextConsumer;
246
+ reactIs_development.ContextProvider = ContextProvider;
247
+ reactIs_development.Element = Element;
248
+ reactIs_development.ForwardRef = ForwardRef;
249
+ reactIs_development.Fragment = Fragment;
250
+ reactIs_development.Lazy = Lazy;
251
+ reactIs_development.Memo = Memo;
252
+ reactIs_development.Portal = Portal;
253
+ reactIs_development.Profiler = Profiler;
254
+ reactIs_development.StrictMode = StrictMode;
255
+ reactIs_development.Suspense = Suspense;
256
+ reactIs_development.isAsyncMode = isAsyncMode;
257
+ reactIs_development.isConcurrentMode = isConcurrentMode;
258
+ reactIs_development.isContextConsumer = isContextConsumer;
259
+ reactIs_development.isContextProvider = isContextProvider;
260
+ reactIs_development.isElement = isElement;
261
+ reactIs_development.isForwardRef = isForwardRef;
262
+ reactIs_development.isFragment = isFragment;
263
+ reactIs_development.isLazy = isLazy;
264
+ reactIs_development.isMemo = isMemo;
265
+ reactIs_development.isPortal = isPortal;
266
+ reactIs_development.isProfiler = isProfiler;
267
+ reactIs_development.isStrictMode = isStrictMode;
268
+ reactIs_development.isSuspense = isSuspense;
269
+ reactIs_development.isValidElementType = isValidElementType;
270
+ reactIs_development.typeOf = typeOf;
271
+ })();
272
+ }
273
+ return reactIs_development;
274
+ }
275
+
276
+ var hasRequiredReactIs;
277
+
278
+ function requireReactIs () {
279
+ if (hasRequiredReactIs) return reactIs.exports;
280
+ hasRequiredReactIs = 1;
281
+ (function (module) {
282
+
283
+ if (process.env.NODE_ENV === 'production') {
284
+ module.exports = requireReactIs_production_min();
285
+ } else {
286
+ module.exports = requireReactIs_development();
287
+ }
288
+ } (reactIs));
289
+ return reactIs.exports;
290
+ }
291
+
292
+ /*
293
+ object-assign
294
+ (c) Sindre Sorhus
295
+ @license MIT
296
+ */
297
+
298
+ var objectAssign;
299
+ var hasRequiredObjectAssign;
300
+
301
+ function requireObjectAssign () {
302
+ if (hasRequiredObjectAssign) return objectAssign;
303
+ hasRequiredObjectAssign = 1;
304
+ /* eslint-disable no-unused-vars */
305
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
306
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
307
+ var propIsEnumerable = Object.prototype.propertyIsEnumerable;
308
+
309
+ function toObject(val) {
310
+ if (val === null || val === undefined) {
311
+ throw new TypeError('Object.assign cannot be called with null or undefined');
312
+ }
313
+
314
+ return Object(val);
315
+ }
316
+
317
+ function shouldUseNative() {
318
+ try {
319
+ if (!Object.assign) {
320
+ return false;
321
+ }
322
+
323
+ // Detect buggy property enumeration order in older V8 versions.
324
+
325
+ // https://bugs.chromium.org/p/v8/issues/detail?id=4118
326
+ var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
327
+ test1[5] = 'de';
328
+ if (Object.getOwnPropertyNames(test1)[0] === '5') {
329
+ return false;
330
+ }
331
+
332
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
333
+ var test2 = {};
334
+ for (var i = 0; i < 10; i++) {
335
+ test2['_' + String.fromCharCode(i)] = i;
336
+ }
337
+ var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
338
+ return test2[n];
339
+ });
340
+ if (order2.join('') !== '0123456789') {
341
+ return false;
342
+ }
343
+
344
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
345
+ var test3 = {};
346
+ 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
347
+ test3[letter] = letter;
348
+ });
349
+ if (Object.keys(Object.assign({}, test3)).join('') !==
350
+ 'abcdefghijklmnopqrst') {
351
+ return false;
352
+ }
353
+
354
+ return true;
355
+ } catch (err) {
356
+ // We don't expect any of the above to throw, but better to be safe.
357
+ return false;
358
+ }
359
+ }
360
+
361
+ objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
362
+ var from;
363
+ var to = toObject(target);
364
+ var symbols;
365
+
366
+ for (var s = 1; s < arguments.length; s++) {
367
+ from = Object(arguments[s]);
368
+
369
+ for (var key in from) {
370
+ if (hasOwnProperty.call(from, key)) {
371
+ to[key] = from[key];
372
+ }
373
+ }
374
+
375
+ if (getOwnPropertySymbols) {
376
+ symbols = getOwnPropertySymbols(from);
377
+ for (var i = 0; i < symbols.length; i++) {
378
+ if (propIsEnumerable.call(from, symbols[i])) {
379
+ to[symbols[i]] = from[symbols[i]];
380
+ }
381
+ }
382
+ }
383
+ }
384
+
385
+ return to;
386
+ };
387
+ return objectAssign;
388
+ }
389
+
390
+ /**
391
+ * Copyright (c) 2013-present, Facebook, Inc.
392
+ *
393
+ * This source code is licensed under the MIT license found in the
394
+ * LICENSE file in the root directory of this source tree.
395
+ */
396
+
397
+ var ReactPropTypesSecret_1;
398
+ var hasRequiredReactPropTypesSecret;
399
+
400
+ function requireReactPropTypesSecret () {
401
+ if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
402
+ hasRequiredReactPropTypesSecret = 1;
403
+
404
+ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
405
+
406
+ ReactPropTypesSecret_1 = ReactPropTypesSecret;
407
+ return ReactPropTypesSecret_1;
408
+ }
409
+
410
+ var has;
411
+ var hasRequiredHas;
412
+
413
+ function requireHas () {
414
+ if (hasRequiredHas) return has;
415
+ hasRequiredHas = 1;
416
+ has = Function.call.bind(Object.prototype.hasOwnProperty);
417
+ return has;
418
+ }
419
+
420
+ /**
421
+ * Copyright (c) 2013-present, Facebook, Inc.
422
+ *
423
+ * This source code is licensed under the MIT license found in the
424
+ * LICENSE file in the root directory of this source tree.
425
+ */
426
+
427
+ var checkPropTypes_1;
428
+ var hasRequiredCheckPropTypes;
429
+
430
+ function requireCheckPropTypes () {
431
+ if (hasRequiredCheckPropTypes) return checkPropTypes_1;
432
+ hasRequiredCheckPropTypes = 1;
433
+
434
+ var printWarning = function() {};
435
+
436
+ if (process.env.NODE_ENV !== 'production') {
437
+ var ReactPropTypesSecret = requireReactPropTypesSecret();
438
+ var loggedTypeFailures = {};
439
+ var has = requireHas();
440
+
441
+ printWarning = function(text) {
442
+ var message = 'Warning: ' + text;
443
+ if (typeof console !== 'undefined') {
444
+ console.error(message);
445
+ }
446
+ try {
447
+ // --- Welcome to debugging React ---
448
+ // This error was thrown as a convenience so that you can use this stack
449
+ // to find the callsite that caused this warning to fire.
450
+ throw new Error(message);
451
+ } catch (x) { /**/ }
452
+ };
453
+ }
454
+
455
+ /**
456
+ * Assert that the values match with the type specs.
457
+ * Error messages are memorized and will only be shown once.
458
+ *
459
+ * @param {object} typeSpecs Map of name to a ReactPropType
460
+ * @param {object} values Runtime values that need to be type-checked
461
+ * @param {string} location e.g. "prop", "context", "child context"
462
+ * @param {string} componentName Name of the component for error messages.
463
+ * @param {?Function} getStack Returns the component stack.
464
+ * @private
465
+ */
466
+ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
467
+ if (process.env.NODE_ENV !== 'production') {
468
+ for (var typeSpecName in typeSpecs) {
469
+ if (has(typeSpecs, typeSpecName)) {
470
+ var error;
471
+ // Prop type validation may throw. In case they do, we don't want to
472
+ // fail the render phase where it didn't fail before. So we log it.
473
+ // After these have been cleaned up, we'll let them throw.
474
+ try {
475
+ // This is intentionally an invariant that gets caught. It's the same
476
+ // behavior as without this statement except with a better message.
477
+ if (typeof typeSpecs[typeSpecName] !== 'function') {
478
+ var err = Error(
479
+ (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
480
+ 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
481
+ 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
482
+ );
483
+ err.name = 'Invariant Violation';
484
+ throw err;
485
+ }
486
+ error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
487
+ } catch (ex) {
488
+ error = ex;
489
+ }
490
+ if (error && !(error instanceof Error)) {
491
+ printWarning(
492
+ (componentName || 'React class') + ': type specification of ' +
493
+ location + ' `' + typeSpecName + '` is invalid; the type checker ' +
494
+ 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
495
+ 'You may have forgotten to pass an argument to the type checker ' +
496
+ 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
497
+ 'shape all require an argument).'
498
+ );
499
+ }
500
+ if (error instanceof Error && !(error.message in loggedTypeFailures)) {
501
+ // Only monitor this failure once because there tends to be a lot of the
502
+ // same error.
503
+ loggedTypeFailures[error.message] = true;
504
+
505
+ var stack = getStack ? getStack() : '';
506
+
507
+ printWarning(
508
+ 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
509
+ );
510
+ }
511
+ }
512
+ }
513
+ }
514
+ }
515
+
516
+ /**
517
+ * Resets warning cache when testing.
518
+ *
519
+ * @private
520
+ */
521
+ checkPropTypes.resetWarningCache = function() {
522
+ if (process.env.NODE_ENV !== 'production') {
523
+ loggedTypeFailures = {};
524
+ }
525
+ };
526
+
527
+ checkPropTypes_1 = checkPropTypes;
528
+ return checkPropTypes_1;
529
+ }
530
+
531
+ /**
532
+ * Copyright (c) 2013-present, Facebook, Inc.
533
+ *
534
+ * This source code is licensed under the MIT license found in the
535
+ * LICENSE file in the root directory of this source tree.
536
+ */
537
+
538
+ var factoryWithTypeCheckers;
539
+ var hasRequiredFactoryWithTypeCheckers;
540
+
541
+ function requireFactoryWithTypeCheckers () {
542
+ if (hasRequiredFactoryWithTypeCheckers) return factoryWithTypeCheckers;
543
+ hasRequiredFactoryWithTypeCheckers = 1;
544
+
545
+ var ReactIs = requireReactIs();
546
+ var assign = requireObjectAssign();
547
+
548
+ var ReactPropTypesSecret = requireReactPropTypesSecret();
549
+ var has = requireHas();
550
+ var checkPropTypes = requireCheckPropTypes();
551
+
552
+ var printWarning = function() {};
553
+
554
+ if (process.env.NODE_ENV !== 'production') {
555
+ printWarning = function(text) {
556
+ var message = 'Warning: ' + text;
557
+ if (typeof console !== 'undefined') {
558
+ console.error(message);
559
+ }
560
+ try {
561
+ // --- Welcome to debugging React ---
562
+ // This error was thrown as a convenience so that you can use this stack
563
+ // to find the callsite that caused this warning to fire.
564
+ throw new Error(message);
565
+ } catch (x) {}
566
+ };
567
+ }
568
+
569
+ function emptyFunctionThatReturnsNull() {
570
+ return null;
571
+ }
572
+
573
+ factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
574
+ /* global Symbol */
575
+ var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
576
+ var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
577
+
578
+ /**
579
+ * Returns the iterator method function contained on the iterable object.
580
+ *
581
+ * Be sure to invoke the function with the iterable as context:
582
+ *
583
+ * var iteratorFn = getIteratorFn(myIterable);
584
+ * if (iteratorFn) {
585
+ * var iterator = iteratorFn.call(myIterable);
586
+ * ...
587
+ * }
588
+ *
589
+ * @param {?object} maybeIterable
590
+ * @return {?function}
591
+ */
592
+ function getIteratorFn(maybeIterable) {
593
+ var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
594
+ if (typeof iteratorFn === 'function') {
595
+ return iteratorFn;
596
+ }
597
+ }
598
+
599
+ /**
600
+ * Collection of methods that allow declaration and validation of props that are
601
+ * supplied to React components. Example usage:
602
+ *
603
+ * var Props = require('ReactPropTypes');
604
+ * var MyArticle = React.createClass({
605
+ * propTypes: {
606
+ * // An optional string prop named "description".
607
+ * description: Props.string,
608
+ *
609
+ * // A required enum prop named "category".
610
+ * category: Props.oneOf(['News','Photos']).isRequired,
611
+ *
612
+ * // A prop named "dialog" that requires an instance of Dialog.
613
+ * dialog: Props.instanceOf(Dialog).isRequired
614
+ * },
615
+ * render: function() { ... }
616
+ * });
617
+ *
618
+ * A more formal specification of how these methods are used:
619
+ *
620
+ * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
621
+ * decl := ReactPropTypes.{type}(.isRequired)?
622
+ *
623
+ * Each and every declaration produces a function with the same signature. This
624
+ * allows the creation of custom validation functions. For example:
625
+ *
626
+ * var MyLink = React.createClass({
627
+ * propTypes: {
628
+ * // An optional string or URI prop named "href".
629
+ * href: function(props, propName, componentName) {
630
+ * var propValue = props[propName];
631
+ * if (propValue != null && typeof propValue !== 'string' &&
632
+ * !(propValue instanceof URI)) {
633
+ * return new Error(
634
+ * 'Expected a string or an URI for ' + propName + ' in ' +
635
+ * componentName
636
+ * );
637
+ * }
638
+ * }
639
+ * },
640
+ * render: function() {...}
641
+ * });
642
+ *
643
+ * @internal
644
+ */
645
+
646
+ var ANONYMOUS = '<<anonymous>>';
647
+
648
+ // Important!
649
+ // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
650
+ var ReactPropTypes = {
651
+ array: createPrimitiveTypeChecker('array'),
652
+ bigint: createPrimitiveTypeChecker('bigint'),
653
+ bool: createPrimitiveTypeChecker('boolean'),
654
+ func: createPrimitiveTypeChecker('function'),
655
+ number: createPrimitiveTypeChecker('number'),
656
+ object: createPrimitiveTypeChecker('object'),
657
+ string: createPrimitiveTypeChecker('string'),
658
+ symbol: createPrimitiveTypeChecker('symbol'),
659
+
660
+ any: createAnyTypeChecker(),
661
+ arrayOf: createArrayOfTypeChecker,
662
+ element: createElementTypeChecker(),
663
+ elementType: createElementTypeTypeChecker(),
664
+ instanceOf: createInstanceTypeChecker,
665
+ node: createNodeChecker(),
666
+ objectOf: createObjectOfTypeChecker,
667
+ oneOf: createEnumTypeChecker,
668
+ oneOfType: createUnionTypeChecker,
669
+ shape: createShapeTypeChecker,
670
+ exact: createStrictShapeTypeChecker,
671
+ };
672
+
673
+ /**
674
+ * inlined Object.is polyfill to avoid requiring consumers ship their own
675
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
676
+ */
677
+ /*eslint-disable no-self-compare*/
678
+ function is(x, y) {
679
+ // SameValue algorithm
680
+ if (x === y) {
681
+ // Steps 1-5, 7-10
682
+ // Steps 6.b-6.e: +0 != -0
683
+ return x !== 0 || 1 / x === 1 / y;
684
+ } else {
685
+ // Step 6.a: NaN == NaN
686
+ return x !== x && y !== y;
687
+ }
688
+ }
689
+ /*eslint-enable no-self-compare*/
690
+
691
+ /**
692
+ * We use an Error-like object for backward compatibility as people may call
693
+ * PropTypes directly and inspect their output. However, we don't use real
694
+ * Errors anymore. We don't inspect their stack anyway, and creating them
695
+ * is prohibitively expensive if they are created too often, such as what
696
+ * happens in oneOfType() for any type before the one that matched.
697
+ */
698
+ function PropTypeError(message, data) {
699
+ this.message = message;
700
+ this.data = data && typeof data === 'object' ? data: {};
701
+ this.stack = '';
702
+ }
703
+ // Make `instanceof Error` still work for returned errors.
704
+ PropTypeError.prototype = Error.prototype;
705
+
706
+ function createChainableTypeChecker(validate) {
707
+ if (process.env.NODE_ENV !== 'production') {
708
+ var manualPropTypeCallCache = {};
709
+ var manualPropTypeWarningCount = 0;
710
+ }
711
+ function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
712
+ componentName = componentName || ANONYMOUS;
713
+ propFullName = propFullName || propName;
714
+
715
+ if (secret !== ReactPropTypesSecret) {
716
+ if (throwOnDirectAccess) {
717
+ // New behavior only for users of `prop-types` package
718
+ var err = new Error(
719
+ 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
720
+ 'Use `PropTypes.checkPropTypes()` to call them. ' +
721
+ 'Read more at http://fb.me/use-check-prop-types'
722
+ );
723
+ err.name = 'Invariant Violation';
724
+ throw err;
725
+ } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
726
+ // Old behavior for people using React.PropTypes
727
+ var cacheKey = componentName + ':' + propName;
728
+ if (
729
+ !manualPropTypeCallCache[cacheKey] &&
730
+ // Avoid spamming the console because they are often not actionable except for lib authors
731
+ manualPropTypeWarningCount < 3
732
+ ) {
733
+ printWarning(
734
+ 'You are manually calling a React.PropTypes validation ' +
735
+ 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
736
+ 'and will throw in the standalone `prop-types` package. ' +
737
+ 'You may be seeing this warning due to a third-party PropTypes ' +
738
+ 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
739
+ );
740
+ manualPropTypeCallCache[cacheKey] = true;
741
+ manualPropTypeWarningCount++;
742
+ }
743
+ }
744
+ }
745
+ if (props[propName] == null) {
746
+ if (isRequired) {
747
+ if (props[propName] === null) {
748
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
749
+ }
750
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
751
+ }
752
+ return null;
753
+ } else {
754
+ return validate(props, propName, componentName, location, propFullName);
755
+ }
756
+ }
757
+
758
+ var chainedCheckType = checkType.bind(null, false);
759
+ chainedCheckType.isRequired = checkType.bind(null, true);
760
+
761
+ return chainedCheckType;
762
+ }
763
+
764
+ function createPrimitiveTypeChecker(expectedType) {
765
+ function validate(props, propName, componentName, location, propFullName, secret) {
766
+ var propValue = props[propName];
767
+ var propType = getPropType(propValue);
768
+ if (propType !== expectedType) {
769
+ // `propValue` being instance of, say, date/regexp, pass the 'object'
770
+ // check, but we can offer a more precise error message here rather than
771
+ // 'of type `object`'.
772
+ var preciseType = getPreciseType(propValue);
773
+
774
+ return new PropTypeError(
775
+ 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
776
+ {expectedType: expectedType}
777
+ );
778
+ }
779
+ return null;
780
+ }
781
+ return createChainableTypeChecker(validate);
782
+ }
783
+
784
+ function createAnyTypeChecker() {
785
+ return createChainableTypeChecker(emptyFunctionThatReturnsNull);
786
+ }
787
+
788
+ function createArrayOfTypeChecker(typeChecker) {
789
+ function validate(props, propName, componentName, location, propFullName) {
790
+ if (typeof typeChecker !== 'function') {
791
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
792
+ }
793
+ var propValue = props[propName];
794
+ if (!Array.isArray(propValue)) {
795
+ var propType = getPropType(propValue);
796
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
797
+ }
798
+ for (var i = 0; i < propValue.length; i++) {
799
+ var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
800
+ if (error instanceof Error) {
801
+ return error;
802
+ }
803
+ }
804
+ return null;
805
+ }
806
+ return createChainableTypeChecker(validate);
807
+ }
808
+
809
+ function createElementTypeChecker() {
810
+ function validate(props, propName, componentName, location, propFullName) {
811
+ var propValue = props[propName];
812
+ if (!isValidElement(propValue)) {
813
+ var propType = getPropType(propValue);
814
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
815
+ }
816
+ return null;
817
+ }
818
+ return createChainableTypeChecker(validate);
819
+ }
820
+
821
+ function createElementTypeTypeChecker() {
822
+ function validate(props, propName, componentName, location, propFullName) {
823
+ var propValue = props[propName];
824
+ if (!ReactIs.isValidElementType(propValue)) {
825
+ var propType = getPropType(propValue);
826
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
827
+ }
828
+ return null;
829
+ }
830
+ return createChainableTypeChecker(validate);
831
+ }
832
+
833
+ function createInstanceTypeChecker(expectedClass) {
834
+ function validate(props, propName, componentName, location, propFullName) {
835
+ if (!(props[propName] instanceof expectedClass)) {
836
+ var expectedClassName = expectedClass.name || ANONYMOUS;
837
+ var actualClassName = getClassName(props[propName]);
838
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
839
+ }
840
+ return null;
841
+ }
842
+ return createChainableTypeChecker(validate);
843
+ }
844
+
845
+ function createEnumTypeChecker(expectedValues) {
846
+ if (!Array.isArray(expectedValues)) {
847
+ if (process.env.NODE_ENV !== 'production') {
848
+ if (arguments.length > 1) {
849
+ printWarning(
850
+ 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
851
+ 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
852
+ );
853
+ } else {
854
+ printWarning('Invalid argument supplied to oneOf, expected an array.');
855
+ }
856
+ }
857
+ return emptyFunctionThatReturnsNull;
858
+ }
859
+
860
+ function validate(props, propName, componentName, location, propFullName) {
861
+ var propValue = props[propName];
862
+ for (var i = 0; i < expectedValues.length; i++) {
863
+ if (is(propValue, expectedValues[i])) {
864
+ return null;
865
+ }
866
+ }
867
+
868
+ var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
869
+ var type = getPreciseType(value);
870
+ if (type === 'symbol') {
871
+ return String(value);
872
+ }
873
+ return value;
874
+ });
875
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
876
+ }
877
+ return createChainableTypeChecker(validate);
878
+ }
879
+
880
+ function createObjectOfTypeChecker(typeChecker) {
881
+ function validate(props, propName, componentName, location, propFullName) {
882
+ if (typeof typeChecker !== 'function') {
883
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
884
+ }
885
+ var propValue = props[propName];
886
+ var propType = getPropType(propValue);
887
+ if (propType !== 'object') {
888
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
889
+ }
890
+ for (var key in propValue) {
891
+ if (has(propValue, key)) {
892
+ var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
893
+ if (error instanceof Error) {
894
+ return error;
895
+ }
896
+ }
897
+ }
898
+ return null;
899
+ }
900
+ return createChainableTypeChecker(validate);
901
+ }
902
+
903
+ function createUnionTypeChecker(arrayOfTypeCheckers) {
904
+ if (!Array.isArray(arrayOfTypeCheckers)) {
905
+ process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
906
+ return emptyFunctionThatReturnsNull;
907
+ }
908
+
909
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
910
+ var checker = arrayOfTypeCheckers[i];
911
+ if (typeof checker !== 'function') {
912
+ printWarning(
913
+ 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
914
+ 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
915
+ );
916
+ return emptyFunctionThatReturnsNull;
917
+ }
918
+ }
919
+
920
+ function validate(props, propName, componentName, location, propFullName) {
921
+ var expectedTypes = [];
922
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
923
+ var checker = arrayOfTypeCheckers[i];
924
+ var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
925
+ if (checkerResult == null) {
926
+ return null;
927
+ }
928
+ if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
929
+ expectedTypes.push(checkerResult.data.expectedType);
930
+ }
931
+ }
932
+ var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
933
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
934
+ }
935
+ return createChainableTypeChecker(validate);
936
+ }
937
+
938
+ function createNodeChecker() {
939
+ function validate(props, propName, componentName, location, propFullName) {
940
+ if (!isNode(props[propName])) {
941
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
942
+ }
943
+ return null;
944
+ }
945
+ return createChainableTypeChecker(validate);
946
+ }
947
+
948
+ function invalidValidatorError(componentName, location, propFullName, key, type) {
949
+ return new PropTypeError(
950
+ (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
951
+ 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
952
+ );
953
+ }
954
+
955
+ function createShapeTypeChecker(shapeTypes) {
956
+ function validate(props, propName, componentName, location, propFullName) {
957
+ var propValue = props[propName];
958
+ var propType = getPropType(propValue);
959
+ if (propType !== 'object') {
960
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
961
+ }
962
+ for (var key in shapeTypes) {
963
+ var checker = shapeTypes[key];
964
+ if (typeof checker !== 'function') {
965
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
966
+ }
967
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
968
+ if (error) {
969
+ return error;
970
+ }
971
+ }
972
+ return null;
973
+ }
974
+ return createChainableTypeChecker(validate);
975
+ }
976
+
977
+ function createStrictShapeTypeChecker(shapeTypes) {
978
+ function validate(props, propName, componentName, location, propFullName) {
979
+ var propValue = props[propName];
980
+ var propType = getPropType(propValue);
981
+ if (propType !== 'object') {
982
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
983
+ }
984
+ // We need to check all keys in case some are required but missing from props.
985
+ var allKeys = assign({}, props[propName], shapeTypes);
986
+ for (var key in allKeys) {
987
+ var checker = shapeTypes[key];
988
+ if (has(shapeTypes, key) && typeof checker !== 'function') {
989
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
990
+ }
991
+ if (!checker) {
992
+ return new PropTypeError(
993
+ 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
994
+ '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
995
+ '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
996
+ );
997
+ }
998
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
999
+ if (error) {
1000
+ return error;
1001
+ }
1002
+ }
1003
+ return null;
1004
+ }
1005
+
1006
+ return createChainableTypeChecker(validate);
1007
+ }
1008
+
1009
+ function isNode(propValue) {
1010
+ switch (typeof propValue) {
1011
+ case 'number':
1012
+ case 'string':
1013
+ case 'undefined':
1014
+ return true;
1015
+ case 'boolean':
1016
+ return !propValue;
1017
+ case 'object':
1018
+ if (Array.isArray(propValue)) {
1019
+ return propValue.every(isNode);
1020
+ }
1021
+ if (propValue === null || isValidElement(propValue)) {
1022
+ return true;
1023
+ }
1024
+
1025
+ var iteratorFn = getIteratorFn(propValue);
1026
+ if (iteratorFn) {
1027
+ var iterator = iteratorFn.call(propValue);
1028
+ var step;
1029
+ if (iteratorFn !== propValue.entries) {
1030
+ while (!(step = iterator.next()).done) {
1031
+ if (!isNode(step.value)) {
1032
+ return false;
1033
+ }
1034
+ }
1035
+ } else {
1036
+ // Iterator will provide entry [k,v] tuples rather than values.
1037
+ while (!(step = iterator.next()).done) {
1038
+ var entry = step.value;
1039
+ if (entry) {
1040
+ if (!isNode(entry[1])) {
1041
+ return false;
1042
+ }
1043
+ }
1044
+ }
1045
+ }
1046
+ } else {
1047
+ return false;
1048
+ }
1049
+
1050
+ return true;
1051
+ default:
1052
+ return false;
1053
+ }
1054
+ }
1055
+
1056
+ function isSymbol(propType, propValue) {
1057
+ // Native Symbol.
1058
+ if (propType === 'symbol') {
1059
+ return true;
1060
+ }
1061
+
1062
+ // falsy value can't be a Symbol
1063
+ if (!propValue) {
1064
+ return false;
1065
+ }
1066
+
1067
+ // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
1068
+ if (propValue['@@toStringTag'] === 'Symbol') {
1069
+ return true;
1070
+ }
1071
+
1072
+ // Fallback for non-spec compliant Symbols which are polyfilled.
1073
+ if (typeof Symbol === 'function' && propValue instanceof Symbol) {
1074
+ return true;
1075
+ }
1076
+
1077
+ return false;
1078
+ }
1079
+
1080
+ // Equivalent of `typeof` but with special handling for array and regexp.
1081
+ function getPropType(propValue) {
1082
+ var propType = typeof propValue;
1083
+ if (Array.isArray(propValue)) {
1084
+ return 'array';
1085
+ }
1086
+ if (propValue instanceof RegExp) {
1087
+ // Old webkits (at least until Android 4.0) return 'function' rather than
1088
+ // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
1089
+ // passes PropTypes.object.
1090
+ return 'object';
1091
+ }
1092
+ if (isSymbol(propType, propValue)) {
1093
+ return 'symbol';
1094
+ }
1095
+ return propType;
1096
+ }
1097
+
1098
+ // This handles more types than `getPropType`. Only used for error messages.
1099
+ // See `createPrimitiveTypeChecker`.
1100
+ function getPreciseType(propValue) {
1101
+ if (typeof propValue === 'undefined' || propValue === null) {
1102
+ return '' + propValue;
1103
+ }
1104
+ var propType = getPropType(propValue);
1105
+ if (propType === 'object') {
1106
+ if (propValue instanceof Date) {
1107
+ return 'date';
1108
+ } else if (propValue instanceof RegExp) {
1109
+ return 'regexp';
1110
+ }
1111
+ }
1112
+ return propType;
1113
+ }
1114
+
1115
+ // Returns a string that is postfixed to a warning about an invalid type.
1116
+ // For example, "undefined" or "of type array"
1117
+ function getPostfixForTypeWarning(value) {
1118
+ var type = getPreciseType(value);
1119
+ switch (type) {
1120
+ case 'array':
1121
+ case 'object':
1122
+ return 'an ' + type;
1123
+ case 'boolean':
1124
+ case 'date':
1125
+ case 'regexp':
1126
+ return 'a ' + type;
1127
+ default:
1128
+ return type;
1129
+ }
1130
+ }
1131
+
1132
+ // Returns class name of the object, if any.
1133
+ function getClassName(propValue) {
1134
+ if (!propValue.constructor || !propValue.constructor.name) {
1135
+ return ANONYMOUS;
1136
+ }
1137
+ return propValue.constructor.name;
1138
+ }
1139
+
1140
+ ReactPropTypes.checkPropTypes = checkPropTypes;
1141
+ ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
1142
+ ReactPropTypes.PropTypes = ReactPropTypes;
1143
+
1144
+ return ReactPropTypes;
1145
+ };
1146
+ return factoryWithTypeCheckers;
1147
+ }
1148
+
1149
+ /**
1150
+ * Copyright (c) 2013-present, Facebook, Inc.
1151
+ *
1152
+ * This source code is licensed under the MIT license found in the
1153
+ * LICENSE file in the root directory of this source tree.
1154
+ */
1155
+
1156
+ var factoryWithThrowingShims;
1157
+ var hasRequiredFactoryWithThrowingShims;
1158
+
1159
+ function requireFactoryWithThrowingShims () {
1160
+ if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
1161
+ hasRequiredFactoryWithThrowingShims = 1;
1162
+
1163
+ var ReactPropTypesSecret = requireReactPropTypesSecret();
1164
+
1165
+ function emptyFunction() {}
1166
+ function emptyFunctionWithReset() {}
1167
+ emptyFunctionWithReset.resetWarningCache = emptyFunction;
1168
+
1169
+ factoryWithThrowingShims = function() {
1170
+ function shim(props, propName, componentName, location, propFullName, secret) {
1171
+ if (secret === ReactPropTypesSecret) {
1172
+ // It is still safe when called from React.
1173
+ return;
1174
+ }
1175
+ var err = new Error(
1176
+ 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
1177
+ 'Use PropTypes.checkPropTypes() to call them. ' +
1178
+ 'Read more at http://fb.me/use-check-prop-types'
1179
+ );
1180
+ err.name = 'Invariant Violation';
1181
+ throw err;
1182
+ } shim.isRequired = shim;
1183
+ function getShim() {
1184
+ return shim;
1185
+ } // Important!
1186
+ // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
1187
+ var ReactPropTypes = {
1188
+ array: shim,
1189
+ bigint: shim,
1190
+ bool: shim,
1191
+ func: shim,
1192
+ number: shim,
1193
+ object: shim,
1194
+ string: shim,
1195
+ symbol: shim,
1196
+
1197
+ any: shim,
1198
+ arrayOf: getShim,
1199
+ element: shim,
1200
+ elementType: shim,
1201
+ instanceOf: getShim,
1202
+ node: shim,
1203
+ objectOf: getShim,
1204
+ oneOf: getShim,
1205
+ oneOfType: getShim,
1206
+ shape: getShim,
1207
+ exact: getShim,
1208
+
1209
+ checkPropTypes: emptyFunctionWithReset,
1210
+ resetWarningCache: emptyFunction
1211
+ };
1212
+
1213
+ ReactPropTypes.PropTypes = ReactPropTypes;
1214
+
1215
+ return ReactPropTypes;
1216
+ };
1217
+ return factoryWithThrowingShims;
1218
+ }
1219
+
1220
+ /**
1221
+ * Copyright (c) 2013-present, Facebook, Inc.
1222
+ *
1223
+ * This source code is licensed under the MIT license found in the
1224
+ * LICENSE file in the root directory of this source tree.
1225
+ */
1226
+
1227
+ if (process.env.NODE_ENV !== 'production') {
1228
+ var ReactIs = requireReactIs();
1229
+
1230
+ // By explicitly using `prop-types` you are opting into new development behavior.
1231
+ // http://fb.me/prop-types-in-prod
1232
+ var throwOnDirectAccess = true;
1233
+ propTypes.exports = requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
1234
+ } else {
1235
+ // By explicitly using `prop-types` you are opting into new production behavior.
1236
+ // http://fb.me/prop-types-in-prod
1237
+ propTypes.exports = requireFactoryWithThrowingShims()();
1238
+ }
1239
+
1240
+ /**
1241
+ * Checks if a given element has a CSS class.
1242
+ *
1243
+ * @param element the element
1244
+ * @param className the CSS class name
1245
+ */
1246
+ function hasClass(element, className) {
1247
+ if (element.classList) return !!className && element.classList.contains(className);
1248
+ return (" " + (element.className.baseVal || element.className) + " ").indexOf(" " + className + " ") !== -1;
1249
+ }
1250
+
1251
+ /**
1252
+ * Adds a CSS class to a given element.
1253
+ *
1254
+ * @param element the element
1255
+ * @param className the CSS class name
1256
+ */
1257
+
1258
+ function addClass(element, className) {
1259
+ if (element.classList) element.classList.add(className);else if (!hasClass(element, className)) if (typeof element.className === 'string') element.className = element.className + " " + className;else element.setAttribute('class', (element.className && element.className.baseVal || '') + " " + className);
1260
+ }
1261
+
1262
+ function replaceClassName(origClass, classToRemove) {
1263
+ return origClass.replace(new RegExp("(^|\\s)" + classToRemove + "(?:\\s|$)", 'g'), '$1').replace(/\s+/g, ' ').replace(/^\s*|\s*$/g, '');
1264
+ }
1265
+ /**
1266
+ * Removes a CSS class from a given element.
1267
+ *
1268
+ * @param element the element
1269
+ * @param className the CSS class name
1270
+ */
1271
+
1272
+
1273
+ function removeClass$1(element, className) {
1274
+ if (element.classList) {
1275
+ element.classList.remove(className);
1276
+ } else if (typeof element.className === 'string') {
1277
+ element.className = replaceClassName(element.className, className);
1278
+ } else {
1279
+ element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));
1280
+ }
1281
+ }
1282
+
1283
+ var config = {
1284
+ disabled: false
1285
+ };
1286
+
1287
+ var timeoutsShape = process.env.NODE_ENV !== 'production' ? propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.shape({
1288
+ enter: propTypes.exports.number,
1289
+ exit: propTypes.exports.number,
1290
+ appear: propTypes.exports.number
1291
+ }).isRequired]) : null;
1292
+ var classNamesShape = process.env.NODE_ENV !== 'production' ? propTypes.exports.oneOfType([propTypes.exports.string, propTypes.exports.shape({
1293
+ enter: propTypes.exports.string,
1294
+ exit: propTypes.exports.string,
1295
+ active: propTypes.exports.string
1296
+ }), propTypes.exports.shape({
1297
+ enter: propTypes.exports.string,
1298
+ enterDone: propTypes.exports.string,
1299
+ enterActive: propTypes.exports.string,
1300
+ exit: propTypes.exports.string,
1301
+ exitDone: propTypes.exports.string,
1302
+ exitActive: propTypes.exports.string
1303
+ })]) : null;
1304
+
1305
+ var TransitionGroupContext = React__default["default"].createContext(null);
1306
+
1307
+ var forceReflow = function forceReflow(node) {
1308
+ return node.scrollTop;
1309
+ };
1310
+
1311
+ var UNMOUNTED = 'unmounted';
1312
+ var EXITED = 'exited';
1313
+ var ENTERING = 'entering';
1314
+ var ENTERED = 'entered';
1315
+ var EXITING = 'exiting';
1316
+ /**
1317
+ * The Transition component lets you describe a transition from one component
1318
+ * state to another _over time_ with a simple declarative API. Most commonly
1319
+ * it's used to animate the mounting and unmounting of a component, but can also
1320
+ * be used to describe in-place transition states as well.
1321
+ *
1322
+ * ---
1323
+ *
1324
+ * **Note**: `Transition` is a platform-agnostic base component. If you're using
1325
+ * transitions in CSS, you'll probably want to use
1326
+ * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)
1327
+ * instead. It inherits all the features of `Transition`, but contains
1328
+ * additional features necessary to play nice with CSS transitions (hence the
1329
+ * name of the component).
1330
+ *
1331
+ * ---
1332
+ *
1333
+ * By default the `Transition` component does not alter the behavior of the
1334
+ * component it renders, it only tracks "enter" and "exit" states for the
1335
+ * components. It's up to you to give meaning and effect to those states. For
1336
+ * example we can add styles to a component when it enters or exits:
1337
+ *
1338
+ * ```jsx
1339
+ * import { Transition } from 'react-transition-group';
1340
+ *
1341
+ * const duration = 300;
1342
+ *
1343
+ * const defaultStyle = {
1344
+ * transition: `opacity ${duration}ms ease-in-out`,
1345
+ * opacity: 0,
1346
+ * }
1347
+ *
1348
+ * const transitionStyles = {
1349
+ * entering: { opacity: 1 },
1350
+ * entered: { opacity: 1 },
1351
+ * exiting: { opacity: 0 },
1352
+ * exited: { opacity: 0 },
1353
+ * };
1354
+ *
1355
+ * const Fade = ({ in: inProp }) => (
1356
+ * <Transition in={inProp} timeout={duration}>
1357
+ * {state => (
1358
+ * <div style={{
1359
+ * ...defaultStyle,
1360
+ * ...transitionStyles[state]
1361
+ * }}>
1362
+ * I'm a fade Transition!
1363
+ * </div>
1364
+ * )}
1365
+ * </Transition>
1366
+ * );
1367
+ * ```
1368
+ *
1369
+ * There are 4 main states a Transition can be in:
1370
+ * - `'entering'`
1371
+ * - `'entered'`
1372
+ * - `'exiting'`
1373
+ * - `'exited'`
1374
+ *
1375
+ * Transition state is toggled via the `in` prop. When `true` the component
1376
+ * begins the "Enter" stage. During this stage, the component will shift from
1377
+ * its current transition state, to `'entering'` for the duration of the
1378
+ * transition and then to the `'entered'` stage once it's complete. Let's take
1379
+ * the following example (we'll use the
1380
+ * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):
1381
+ *
1382
+ * ```jsx
1383
+ * function App() {
1384
+ * const [inProp, setInProp] = useState(false);
1385
+ * return (
1386
+ * <div>
1387
+ * <Transition in={inProp} timeout={500}>
1388
+ * {state => (
1389
+ * // ...
1390
+ * )}
1391
+ * </Transition>
1392
+ * <button onClick={() => setInProp(true)}>
1393
+ * Click to Enter
1394
+ * </button>
1395
+ * </div>
1396
+ * );
1397
+ * }
1398
+ * ```
1399
+ *
1400
+ * When the button is clicked the component will shift to the `'entering'` state
1401
+ * and stay there for 500ms (the value of `timeout`) before it finally switches
1402
+ * to `'entered'`.
1403
+ *
1404
+ * When `in` is `false` the same thing happens except the state moves from
1405
+ * `'exiting'` to `'exited'`.
1406
+ */
1407
+
1408
+ var Transition = /*#__PURE__*/function (_React$Component) {
1409
+ _inheritsLoose(Transition, _React$Component);
1410
+
1411
+ function Transition(props, context) {
1412
+ var _this;
1413
+
1414
+ _this = _React$Component.call(this, props, context) || this;
1415
+ var parentGroup = context; // In the context of a TransitionGroup all enters are really appears
1416
+
1417
+ var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
1418
+ var initialStatus;
1419
+ _this.appearStatus = null;
1420
+
1421
+ if (props.in) {
1422
+ if (appear) {
1423
+ initialStatus = EXITED;
1424
+ _this.appearStatus = ENTERING;
1425
+ } else {
1426
+ initialStatus = ENTERED;
1427
+ }
1428
+ } else {
1429
+ if (props.unmountOnExit || props.mountOnEnter) {
1430
+ initialStatus = UNMOUNTED;
1431
+ } else {
1432
+ initialStatus = EXITED;
1433
+ }
1434
+ }
1435
+
1436
+ _this.state = {
1437
+ status: initialStatus
1438
+ };
1439
+ _this.nextCallback = null;
1440
+ return _this;
1441
+ }
1442
+
1443
+ Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
1444
+ var nextIn = _ref.in;
1445
+
1446
+ if (nextIn && prevState.status === UNMOUNTED) {
1447
+ return {
1448
+ status: EXITED
1449
+ };
1450
+ }
1451
+
1452
+ return null;
1453
+ } // getSnapshotBeforeUpdate(prevProps) {
1454
+ // let nextStatus = null
1455
+ // if (prevProps !== this.props) {
1456
+ // const { status } = this.state
1457
+ // if (this.props.in) {
1458
+ // if (status !== ENTERING && status !== ENTERED) {
1459
+ // nextStatus = ENTERING
1460
+ // }
1461
+ // } else {
1462
+ // if (status === ENTERING || status === ENTERED) {
1463
+ // nextStatus = EXITING
1464
+ // }
1465
+ // }
1466
+ // }
1467
+ // return { nextStatus }
1468
+ // }
1469
+ ;
1470
+
1471
+ var _proto = Transition.prototype;
1472
+
1473
+ _proto.componentDidMount = function componentDidMount() {
1474
+ this.updateStatus(true, this.appearStatus);
1475
+ };
1476
+
1477
+ _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
1478
+ var nextStatus = null;
1479
+
1480
+ if (prevProps !== this.props) {
1481
+ var status = this.state.status;
1482
+
1483
+ if (this.props.in) {
1484
+ if (status !== ENTERING && status !== ENTERED) {
1485
+ nextStatus = ENTERING;
1486
+ }
1487
+ } else {
1488
+ if (status === ENTERING || status === ENTERED) {
1489
+ nextStatus = EXITING;
1490
+ }
1491
+ }
1492
+ }
1493
+
1494
+ this.updateStatus(false, nextStatus);
1495
+ };
1496
+
1497
+ _proto.componentWillUnmount = function componentWillUnmount() {
1498
+ this.cancelNextCallback();
1499
+ };
1500
+
1501
+ _proto.getTimeouts = function getTimeouts() {
1502
+ var timeout = this.props.timeout;
1503
+ var exit, enter, appear;
1504
+ exit = enter = appear = timeout;
1505
+
1506
+ if (timeout != null && typeof timeout !== 'number') {
1507
+ exit = timeout.exit;
1508
+ enter = timeout.enter; // TODO: remove fallback for next major
1509
+
1510
+ appear = timeout.appear !== undefined ? timeout.appear : enter;
1511
+ }
1512
+
1513
+ return {
1514
+ exit: exit,
1515
+ enter: enter,
1516
+ appear: appear
1517
+ };
1518
+ };
1519
+
1520
+ _proto.updateStatus = function updateStatus(mounting, nextStatus) {
1521
+ if (mounting === void 0) {
1522
+ mounting = false;
1523
+ }
1524
+
1525
+ if (nextStatus !== null) {
1526
+ // nextStatus will always be ENTERING or EXITING.
1527
+ this.cancelNextCallback();
1528
+
1529
+ if (nextStatus === ENTERING) {
1530
+ if (this.props.unmountOnExit || this.props.mountOnEnter) {
1531
+ var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM__default["default"].findDOMNode(this); // https://github.com/reactjs/react-transition-group/pull/749
1532
+ // With unmountOnExit or mountOnEnter, the enter animation should happen at the transition between `exited` and `entering`.
1533
+ // To make the animation happen, we have to separate each rendering and avoid being processed as batched.
1534
+
1535
+ if (node) forceReflow(node);
1536
+ }
1537
+
1538
+ this.performEnter(mounting);
1539
+ } else {
1540
+ this.performExit();
1541
+ }
1542
+ } else if (this.props.unmountOnExit && this.state.status === EXITED) {
1543
+ this.setState({
1544
+ status: UNMOUNTED
1545
+ });
1546
+ }
1547
+ };
1548
+
1549
+ _proto.performEnter = function performEnter(mounting) {
1550
+ var _this2 = this;
1551
+
1552
+ var enter = this.props.enter;
1553
+ var appearing = this.context ? this.context.isMounting : mounting;
1554
+
1555
+ var _ref2 = this.props.nodeRef ? [appearing] : [ReactDOM__default["default"].findDOMNode(this), appearing],
1556
+ maybeNode = _ref2[0],
1557
+ maybeAppearing = _ref2[1];
1558
+
1559
+ var timeouts = this.getTimeouts();
1560
+ var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED
1561
+ // if we are mounting and running this it means appear _must_ be set
1562
+
1563
+ if (!mounting && !enter || config.disabled) {
1564
+ this.safeSetState({
1565
+ status: ENTERED
1566
+ }, function () {
1567
+ _this2.props.onEntered(maybeNode);
1568
+ });
1569
+ return;
1570
+ }
1571
+
1572
+ this.props.onEnter(maybeNode, maybeAppearing);
1573
+ this.safeSetState({
1574
+ status: ENTERING
1575
+ }, function () {
1576
+ _this2.props.onEntering(maybeNode, maybeAppearing);
1577
+
1578
+ _this2.onTransitionEnd(enterTimeout, function () {
1579
+ _this2.safeSetState({
1580
+ status: ENTERED
1581
+ }, function () {
1582
+ _this2.props.onEntered(maybeNode, maybeAppearing);
1583
+ });
1584
+ });
1585
+ });
1586
+ };
1587
+
1588
+ _proto.performExit = function performExit() {
1589
+ var _this3 = this;
1590
+
1591
+ var exit = this.props.exit;
1592
+ var timeouts = this.getTimeouts();
1593
+ var maybeNode = this.props.nodeRef ? undefined : ReactDOM__default["default"].findDOMNode(this); // no exit animation skip right to EXITED
1594
+
1595
+ if (!exit || config.disabled) {
1596
+ this.safeSetState({
1597
+ status: EXITED
1598
+ }, function () {
1599
+ _this3.props.onExited(maybeNode);
1600
+ });
1601
+ return;
1602
+ }
1603
+
1604
+ this.props.onExit(maybeNode);
1605
+ this.safeSetState({
1606
+ status: EXITING
1607
+ }, function () {
1608
+ _this3.props.onExiting(maybeNode);
1609
+
1610
+ _this3.onTransitionEnd(timeouts.exit, function () {
1611
+ _this3.safeSetState({
1612
+ status: EXITED
1613
+ }, function () {
1614
+ _this3.props.onExited(maybeNode);
1615
+ });
1616
+ });
1617
+ });
1618
+ };
1619
+
1620
+ _proto.cancelNextCallback = function cancelNextCallback() {
1621
+ if (this.nextCallback !== null) {
1622
+ this.nextCallback.cancel();
1623
+ this.nextCallback = null;
1624
+ }
1625
+ };
1626
+
1627
+ _proto.safeSetState = function safeSetState(nextState, callback) {
1628
+ // This shouldn't be necessary, but there are weird race conditions with
1629
+ // setState callbacks and unmounting in testing, so always make sure that
1630
+ // we can cancel any pending setState callbacks after we unmount.
1631
+ callback = this.setNextCallback(callback);
1632
+ this.setState(nextState, callback);
1633
+ };
1634
+
1635
+ _proto.setNextCallback = function setNextCallback(callback) {
1636
+ var _this4 = this;
1637
+
1638
+ var active = true;
1639
+
1640
+ this.nextCallback = function (event) {
1641
+ if (active) {
1642
+ active = false;
1643
+ _this4.nextCallback = null;
1644
+ callback(event);
1645
+ }
1646
+ };
1647
+
1648
+ this.nextCallback.cancel = function () {
1649
+ active = false;
1650
+ };
1651
+
1652
+ return this.nextCallback;
1653
+ };
1654
+
1655
+ _proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {
1656
+ this.setNextCallback(handler);
1657
+ var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM__default["default"].findDOMNode(this);
1658
+ var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;
1659
+
1660
+ if (!node || doesNotHaveTimeoutOrListener) {
1661
+ setTimeout(this.nextCallback, 0);
1662
+ return;
1663
+ }
1664
+
1665
+ if (this.props.addEndListener) {
1666
+ var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback],
1667
+ maybeNode = _ref3[0],
1668
+ maybeNextCallback = _ref3[1];
1669
+
1670
+ this.props.addEndListener(maybeNode, maybeNextCallback);
1671
+ }
1672
+
1673
+ if (timeout != null) {
1674
+ setTimeout(this.nextCallback, timeout);
1675
+ }
1676
+ };
1677
+
1678
+ _proto.render = function render() {
1679
+ var status = this.state.status;
1680
+
1681
+ if (status === UNMOUNTED) {
1682
+ return null;
1683
+ }
1684
+
1685
+ var _this$props = this.props,
1686
+ children = _this$props.children;
1687
+ _this$props.in;
1688
+ _this$props.mountOnEnter;
1689
+ _this$props.unmountOnExit;
1690
+ _this$props.appear;
1691
+ _this$props.enter;
1692
+ _this$props.exit;
1693
+ _this$props.timeout;
1694
+ _this$props.addEndListener;
1695
+ _this$props.onEnter;
1696
+ _this$props.onEntering;
1697
+ _this$props.onEntered;
1698
+ _this$props.onExit;
1699
+ _this$props.onExiting;
1700
+ _this$props.onExited;
1701
+ _this$props.nodeRef;
1702
+ var childProps = _objectWithoutPropertiesLoose(_this$props, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
1703
+
1704
+ return (
1705
+ /*#__PURE__*/
1706
+ // allows for nested Transitions
1707
+ React__default["default"].createElement(TransitionGroupContext.Provider, {
1708
+ value: null
1709
+ }, typeof children === 'function' ? children(status, childProps) : React__default["default"].cloneElement(React__default["default"].Children.only(children), childProps))
1710
+ );
1711
+ };
1712
+
1713
+ return Transition;
1714
+ }(React__default["default"].Component);
1715
+
1716
+ Transition.contextType = TransitionGroupContext;
1717
+ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
1718
+ /**
1719
+ * A React reference to DOM element that need to transition:
1720
+ * https://stackoverflow.com/a/51127130/4671932
1721
+ *
1722
+ * - When `nodeRef` prop is used, `node` is not passed to callback functions
1723
+ * (e.g. `onEnter`) because user already has direct access to the node.
1724
+ * - When changing `key` prop of `Transition` in a `TransitionGroup` a new
1725
+ * `nodeRef` need to be provided to `Transition` with changed `key` prop
1726
+ * (see
1727
+ * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).
1728
+ */
1729
+ nodeRef: propTypes.exports.shape({
1730
+ current: typeof Element === 'undefined' ? propTypes.exports.any : function (propValue, key, componentName, location, propFullName, secret) {
1731
+ var value = propValue[key];
1732
+ return propTypes.exports.instanceOf(value && 'ownerDocument' in value ? value.ownerDocument.defaultView.Element : Element)(propValue, key, componentName, location, propFullName, secret);
1733
+ }
1734
+ }),
1735
+
1736
+ /**
1737
+ * A `function` child can be used instead of a React element. This function is
1738
+ * called with the current transition status (`'entering'`, `'entered'`,
1739
+ * `'exiting'`, `'exited'`), which can be used to apply context
1740
+ * specific props to a component.
1741
+ *
1742
+ * ```jsx
1743
+ * <Transition in={this.state.in} timeout={150}>
1744
+ * {state => (
1745
+ * <MyComponent className={`fade fade-${state}`} />
1746
+ * )}
1747
+ * </Transition>
1748
+ * ```
1749
+ */
1750
+ children: propTypes.exports.oneOfType([propTypes.exports.func.isRequired, propTypes.exports.element.isRequired]).isRequired,
1751
+
1752
+ /**
1753
+ * Show the component; triggers the enter or exit states
1754
+ */
1755
+ in: propTypes.exports.bool,
1756
+
1757
+ /**
1758
+ * By default the child component is mounted immediately along with
1759
+ * the parent `Transition` component. If you want to "lazy mount" the component on the
1760
+ * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay
1761
+ * mounted, even on "exited", unless you also specify `unmountOnExit`.
1762
+ */
1763
+ mountOnEnter: propTypes.exports.bool,
1764
+
1765
+ /**
1766
+ * By default the child component stays mounted after it reaches the `'exited'` state.
1767
+ * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.
1768
+ */
1769
+ unmountOnExit: propTypes.exports.bool,
1770
+
1771
+ /**
1772
+ * By default the child component does not perform the enter transition when
1773
+ * it first mounts, regardless of the value of `in`. If you want this
1774
+ * behavior, set both `appear` and `in` to `true`.
1775
+ *
1776
+ * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop
1777
+ * > only adds an additional enter transition. However, in the
1778
+ * > `<CSSTransition>` component that first enter transition does result in
1779
+ * > additional `.appear-*` classes, that way you can choose to style it
1780
+ * > differently.
1781
+ */
1782
+ appear: propTypes.exports.bool,
1783
+
1784
+ /**
1785
+ * Enable or disable enter transitions.
1786
+ */
1787
+ enter: propTypes.exports.bool,
1788
+
1789
+ /**
1790
+ * Enable or disable exit transitions.
1791
+ */
1792
+ exit: propTypes.exports.bool,
1793
+
1794
+ /**
1795
+ * The duration of the transition, in milliseconds.
1796
+ * Required unless `addEndListener` is provided.
1797
+ *
1798
+ * You may specify a single timeout for all transitions:
1799
+ *
1800
+ * ```jsx
1801
+ * timeout={500}
1802
+ * ```
1803
+ *
1804
+ * or individually:
1805
+ *
1806
+ * ```jsx
1807
+ * timeout={{
1808
+ * appear: 500,
1809
+ * enter: 300,
1810
+ * exit: 500,
1811
+ * }}
1812
+ * ```
1813
+ *
1814
+ * - `appear` defaults to the value of `enter`
1815
+ * - `enter` defaults to `0`
1816
+ * - `exit` defaults to `0`
1817
+ *
1818
+ * @type {number | { enter?: number, exit?: number, appear?: number }}
1819
+ */
1820
+ timeout: function timeout(props) {
1821
+ var pt = timeoutsShape;
1822
+ if (!props.addEndListener) pt = pt.isRequired;
1823
+
1824
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1825
+ args[_key - 1] = arguments[_key];
1826
+ }
1827
+
1828
+ return pt.apply(void 0, [props].concat(args));
1829
+ },
1830
+
1831
+ /**
1832
+ * Add a custom transition end trigger. Called with the transitioning
1833
+ * DOM node and a `done` callback. Allows for more fine grained transition end
1834
+ * logic. Timeouts are still used as a fallback if provided.
1835
+ *
1836
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
1837
+ *
1838
+ * ```jsx
1839
+ * addEndListener={(node, done) => {
1840
+ * // use the css transitionend event to mark the finish of a transition
1841
+ * node.addEventListener('transitionend', done, false);
1842
+ * }}
1843
+ * ```
1844
+ */
1845
+ addEndListener: propTypes.exports.func,
1846
+
1847
+ /**
1848
+ * Callback fired before the "entering" status is applied. An extra parameter
1849
+ * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
1850
+ *
1851
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
1852
+ *
1853
+ * @type Function(node: HtmlElement, isAppearing: bool) -> void
1854
+ */
1855
+ onEnter: propTypes.exports.func,
1856
+
1857
+ /**
1858
+ * Callback fired after the "entering" status is applied. An extra parameter
1859
+ * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
1860
+ *
1861
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
1862
+ *
1863
+ * @type Function(node: HtmlElement, isAppearing: bool)
1864
+ */
1865
+ onEntering: propTypes.exports.func,
1866
+
1867
+ /**
1868
+ * Callback fired after the "entered" status is applied. An extra parameter
1869
+ * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
1870
+ *
1871
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
1872
+ *
1873
+ * @type Function(node: HtmlElement, isAppearing: bool) -> void
1874
+ */
1875
+ onEntered: propTypes.exports.func,
1876
+
1877
+ /**
1878
+ * Callback fired before the "exiting" status is applied.
1879
+ *
1880
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
1881
+ *
1882
+ * @type Function(node: HtmlElement) -> void
1883
+ */
1884
+ onExit: propTypes.exports.func,
1885
+
1886
+ /**
1887
+ * Callback fired after the "exiting" status is applied.
1888
+ *
1889
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
1890
+ *
1891
+ * @type Function(node: HtmlElement) -> void
1892
+ */
1893
+ onExiting: propTypes.exports.func,
1894
+
1895
+ /**
1896
+ * Callback fired after the "exited" status is applied.
1897
+ *
1898
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed
1899
+ *
1900
+ * @type Function(node: HtmlElement) -> void
1901
+ */
1902
+ onExited: propTypes.exports.func
1903
+ } : {}; // Name the function so it is clearer in the documentation
1904
+
1905
+ function noop() {}
1906
+
1907
+ Transition.defaultProps = {
1908
+ in: false,
1909
+ mountOnEnter: false,
1910
+ unmountOnExit: false,
1911
+ appear: false,
1912
+ enter: true,
1913
+ exit: true,
1914
+ onEnter: noop,
1915
+ onEntering: noop,
1916
+ onEntered: noop,
1917
+ onExit: noop,
1918
+ onExiting: noop,
1919
+ onExited: noop
1920
+ };
1921
+ Transition.UNMOUNTED = UNMOUNTED;
1922
+ Transition.EXITED = EXITED;
1923
+ Transition.ENTERING = ENTERING;
1924
+ Transition.ENTERED = ENTERED;
1925
+ Transition.EXITING = EXITING;
1926
+
1927
+ var _addClass = function addClass$1(node, classes) {
1928
+ return node && classes && classes.split(' ').forEach(function (c) {
1929
+ return addClass(node, c);
1930
+ });
1931
+ };
1932
+
1933
+ var removeClass = function removeClass(node, classes) {
1934
+ return node && classes && classes.split(' ').forEach(function (c) {
1935
+ return removeClass$1(node, c);
1936
+ });
1937
+ };
1938
+ /**
1939
+ * A transition component inspired by the excellent
1940
+ * [ng-animate](https://docs.angularjs.org/api/ngAnimate) library, you should
1941
+ * use it if you're using CSS transitions or animations. It's built upon the
1942
+ * [`Transition`](https://reactcommunity.org/react-transition-group/transition)
1943
+ * component, so it inherits all of its props.
1944
+ *
1945
+ * `CSSTransition` applies a pair of class names during the `appear`, `enter`,
1946
+ * and `exit` states of the transition. The first class is applied and then a
1947
+ * second `*-active` class in order to activate the CSS transition. After the
1948
+ * transition, matching `*-done` class names are applied to persist the
1949
+ * transition state.
1950
+ *
1951
+ * ```jsx
1952
+ * function App() {
1953
+ * const [inProp, setInProp] = useState(false);
1954
+ * return (
1955
+ * <div>
1956
+ * <CSSTransition in={inProp} timeout={200} classNames="my-node">
1957
+ * <div>
1958
+ * {"I'll receive my-node-* classes"}
1959
+ * </div>
1960
+ * </CSSTransition>
1961
+ * <button type="button" onClick={() => setInProp(true)}>
1962
+ * Click to Enter
1963
+ * </button>
1964
+ * </div>
1965
+ * );
1966
+ * }
1967
+ * ```
1968
+ *
1969
+ * When the `in` prop is set to `true`, the child component will first receive
1970
+ * the class `example-enter`, then the `example-enter-active` will be added in
1971
+ * the next tick. `CSSTransition` [forces a
1972
+ * reflow](https://github.com/reactjs/react-transition-group/blob/5007303e729a74be66a21c3e2205e4916821524b/src/CSSTransition.js#L208-L215)
1973
+ * between before adding the `example-enter-active`. This is an important trick
1974
+ * because it allows us to transition between `example-enter` and
1975
+ * `example-enter-active` even though they were added immediately one after
1976
+ * another. Most notably, this is what makes it possible for us to animate
1977
+ * _appearance_.
1978
+ *
1979
+ * ```css
1980
+ * .my-node-enter {
1981
+ * opacity: 0;
1982
+ * }
1983
+ * .my-node-enter-active {
1984
+ * opacity: 1;
1985
+ * transition: opacity 200ms;
1986
+ * }
1987
+ * .my-node-exit {
1988
+ * opacity: 1;
1989
+ * }
1990
+ * .my-node-exit-active {
1991
+ * opacity: 0;
1992
+ * transition: opacity 200ms;
1993
+ * }
1994
+ * ```
1995
+ *
1996
+ * `*-active` classes represent which styles you want to animate **to**, so it's
1997
+ * important to add `transition` declaration only to them, otherwise transitions
1998
+ * might not behave as intended! This might not be obvious when the transitions
1999
+ * are symmetrical, i.e. when `*-enter-active` is the same as `*-exit`, like in
2000
+ * the example above (minus `transition`), but it becomes apparent in more
2001
+ * complex transitions.
2002
+ *
2003
+ * **Note**: If you're using the
2004
+ * [`appear`](http://reactcommunity.org/react-transition-group/transition#Transition-prop-appear)
2005
+ * prop, make sure to define styles for `.appear-*` classes as well.
2006
+ */
2007
+
2008
+
2009
+ var CSSTransition = /*#__PURE__*/function (_React$Component) {
2010
+ _inheritsLoose(CSSTransition, _React$Component);
2011
+
2012
+ function CSSTransition() {
2013
+ var _this;
2014
+
2015
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2016
+ args[_key] = arguments[_key];
2017
+ }
2018
+
2019
+ _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
2020
+ _this.appliedClasses = {
2021
+ appear: {},
2022
+ enter: {},
2023
+ exit: {}
2024
+ };
2025
+
2026
+ _this.onEnter = function (maybeNode, maybeAppearing) {
2027
+ var _this$resolveArgument = _this.resolveArguments(maybeNode, maybeAppearing),
2028
+ node = _this$resolveArgument[0],
2029
+ appearing = _this$resolveArgument[1];
2030
+
2031
+ _this.removeClasses(node, 'exit');
2032
+
2033
+ _this.addClass(node, appearing ? 'appear' : 'enter', 'base');
2034
+
2035
+ if (_this.props.onEnter) {
2036
+ _this.props.onEnter(maybeNode, maybeAppearing);
2037
+ }
2038
+ };
2039
+
2040
+ _this.onEntering = function (maybeNode, maybeAppearing) {
2041
+ var _this$resolveArgument2 = _this.resolveArguments(maybeNode, maybeAppearing),
2042
+ node = _this$resolveArgument2[0],
2043
+ appearing = _this$resolveArgument2[1];
2044
+
2045
+ var type = appearing ? 'appear' : 'enter';
2046
+
2047
+ _this.addClass(node, type, 'active');
2048
+
2049
+ if (_this.props.onEntering) {
2050
+ _this.props.onEntering(maybeNode, maybeAppearing);
2051
+ }
2052
+ };
2053
+
2054
+ _this.onEntered = function (maybeNode, maybeAppearing) {
2055
+ var _this$resolveArgument3 = _this.resolveArguments(maybeNode, maybeAppearing),
2056
+ node = _this$resolveArgument3[0],
2057
+ appearing = _this$resolveArgument3[1];
2058
+
2059
+ var type = appearing ? 'appear' : 'enter';
2060
+
2061
+ _this.removeClasses(node, type);
2062
+
2063
+ _this.addClass(node, type, 'done');
2064
+
2065
+ if (_this.props.onEntered) {
2066
+ _this.props.onEntered(maybeNode, maybeAppearing);
2067
+ }
2068
+ };
2069
+
2070
+ _this.onExit = function (maybeNode) {
2071
+ var _this$resolveArgument4 = _this.resolveArguments(maybeNode),
2072
+ node = _this$resolveArgument4[0];
2073
+
2074
+ _this.removeClasses(node, 'appear');
2075
+
2076
+ _this.removeClasses(node, 'enter');
2077
+
2078
+ _this.addClass(node, 'exit', 'base');
2079
+
2080
+ if (_this.props.onExit) {
2081
+ _this.props.onExit(maybeNode);
2082
+ }
2083
+ };
2084
+
2085
+ _this.onExiting = function (maybeNode) {
2086
+ var _this$resolveArgument5 = _this.resolveArguments(maybeNode),
2087
+ node = _this$resolveArgument5[0];
2088
+
2089
+ _this.addClass(node, 'exit', 'active');
2090
+
2091
+ if (_this.props.onExiting) {
2092
+ _this.props.onExiting(maybeNode);
2093
+ }
2094
+ };
2095
+
2096
+ _this.onExited = function (maybeNode) {
2097
+ var _this$resolveArgument6 = _this.resolveArguments(maybeNode),
2098
+ node = _this$resolveArgument6[0];
2099
+
2100
+ _this.removeClasses(node, 'exit');
2101
+
2102
+ _this.addClass(node, 'exit', 'done');
2103
+
2104
+ if (_this.props.onExited) {
2105
+ _this.props.onExited(maybeNode);
2106
+ }
2107
+ };
2108
+
2109
+ _this.resolveArguments = function (maybeNode, maybeAppearing) {
2110
+ return _this.props.nodeRef ? [_this.props.nodeRef.current, maybeNode] // here `maybeNode` is actually `appearing`
2111
+ : [maybeNode, maybeAppearing];
2112
+ };
2113
+
2114
+ _this.getClassNames = function (type) {
2115
+ var classNames = _this.props.classNames;
2116
+ var isStringClassNames = typeof classNames === 'string';
2117
+ var prefix = isStringClassNames && classNames ? classNames + "-" : '';
2118
+ var baseClassName = isStringClassNames ? "" + prefix + type : classNames[type];
2119
+ var activeClassName = isStringClassNames ? baseClassName + "-active" : classNames[type + "Active"];
2120
+ var doneClassName = isStringClassNames ? baseClassName + "-done" : classNames[type + "Done"];
2121
+ return {
2122
+ baseClassName: baseClassName,
2123
+ activeClassName: activeClassName,
2124
+ doneClassName: doneClassName
2125
+ };
2126
+ };
2127
+
2128
+ return _this;
2129
+ }
2130
+
2131
+ var _proto = CSSTransition.prototype;
2132
+
2133
+ _proto.addClass = function addClass(node, type, phase) {
2134
+ var className = this.getClassNames(type)[phase + "ClassName"];
2135
+
2136
+ var _this$getClassNames = this.getClassNames('enter'),
2137
+ doneClassName = _this$getClassNames.doneClassName;
2138
+
2139
+ if (type === 'appear' && phase === 'done' && doneClassName) {
2140
+ className += " " + doneClassName;
2141
+ } // This is to force a repaint,
2142
+ // which is necessary in order to transition styles when adding a class name.
2143
+
2144
+
2145
+ if (phase === 'active') {
2146
+ if (node) forceReflow(node);
2147
+ }
2148
+
2149
+ if (className) {
2150
+ this.appliedClasses[type][phase] = className;
2151
+
2152
+ _addClass(node, className);
2153
+ }
2154
+ };
2155
+
2156
+ _proto.removeClasses = function removeClasses(node, type) {
2157
+ var _this$appliedClasses$ = this.appliedClasses[type],
2158
+ baseClassName = _this$appliedClasses$.base,
2159
+ activeClassName = _this$appliedClasses$.active,
2160
+ doneClassName = _this$appliedClasses$.done;
2161
+ this.appliedClasses[type] = {};
2162
+
2163
+ if (baseClassName) {
2164
+ removeClass(node, baseClassName);
2165
+ }
2166
+
2167
+ if (activeClassName) {
2168
+ removeClass(node, activeClassName);
2169
+ }
2170
+
2171
+ if (doneClassName) {
2172
+ removeClass(node, doneClassName);
2173
+ }
2174
+ };
2175
+
2176
+ _proto.render = function render() {
2177
+ var _this$props = this.props;
2178
+ _this$props.classNames;
2179
+ var props = _objectWithoutPropertiesLoose(_this$props, ["classNames"]);
2180
+
2181
+ return /*#__PURE__*/React__default["default"].createElement(Transition, _extends({}, props, {
2182
+ onEnter: this.onEnter,
2183
+ onEntered: this.onEntered,
2184
+ onEntering: this.onEntering,
2185
+ onExit: this.onExit,
2186
+ onExiting: this.onExiting,
2187
+ onExited: this.onExited
2188
+ }));
2189
+ };
2190
+
2191
+ return CSSTransition;
2192
+ }(React__default["default"].Component);
2193
+
2194
+ CSSTransition.defaultProps = {
2195
+ classNames: ''
2196
+ };
2197
+ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, Transition.propTypes, {
2198
+ /**
2199
+ * The animation classNames applied to the component as it appears, enters,
2200
+ * exits or has finished the transition. A single name can be provided, which
2201
+ * will be suffixed for each stage, e.g. `classNames="fade"` applies:
2202
+ *
2203
+ * - `fade-appear`, `fade-appear-active`, `fade-appear-done`
2204
+ * - `fade-enter`, `fade-enter-active`, `fade-enter-done`
2205
+ * - `fade-exit`, `fade-exit-active`, `fade-exit-done`
2206
+ *
2207
+ * A few details to note about how these classes are applied:
2208
+ *
2209
+ * 1. They are _joined_ with the ones that are already defined on the child
2210
+ * component, so if you want to add some base styles, you can use
2211
+ * `className` without worrying that it will be overridden.
2212
+ *
2213
+ * 2. If the transition component mounts with `in={false}`, no classes are
2214
+ * applied yet. You might be expecting `*-exit-done`, but if you think
2215
+ * about it, a component cannot finish exiting if it hasn't entered yet.
2216
+ *
2217
+ * 2. `fade-appear-done` and `fade-enter-done` will _both_ be applied. This
2218
+ * allows you to define different behavior for when appearing is done and
2219
+ * when regular entering is done, using selectors like
2220
+ * `.fade-enter-done:not(.fade-appear-done)`. For example, you could apply
2221
+ * an epic entrance animation when element first appears in the DOM using
2222
+ * [Animate.css](https://daneden.github.io/animate.css/). Otherwise you can
2223
+ * simply use `fade-enter-done` for defining both cases.
2224
+ *
2225
+ * Each individual classNames can also be specified independently like:
2226
+ *
2227
+ * ```js
2228
+ * classNames={{
2229
+ * appear: 'my-appear',
2230
+ * appearActive: 'my-active-appear',
2231
+ * appearDone: 'my-done-appear',
2232
+ * enter: 'my-enter',
2233
+ * enterActive: 'my-active-enter',
2234
+ * enterDone: 'my-done-enter',
2235
+ * exit: 'my-exit',
2236
+ * exitActive: 'my-active-exit',
2237
+ * exitDone: 'my-done-exit',
2238
+ * }}
2239
+ * ```
2240
+ *
2241
+ * If you want to set these classes using CSS Modules:
2242
+ *
2243
+ * ```js
2244
+ * import styles from './styles.css';
2245
+ * ```
2246
+ *
2247
+ * you might want to use camelCase in your CSS file, that way could simply
2248
+ * spread them instead of listing them one by one:
2249
+ *
2250
+ * ```js
2251
+ * classNames={{ ...styles }}
2252
+ * ```
2253
+ *
2254
+ * @type {string | {
2255
+ * appear?: string,
2256
+ * appearActive?: string,
2257
+ * appearDone?: string,
2258
+ * enter?: string,
2259
+ * enterActive?: string,
2260
+ * enterDone?: string,
2261
+ * exit?: string,
2262
+ * exitActive?: string,
2263
+ * exitDone?: string,
2264
+ * }}
2265
+ */
2266
+ classNames: classNamesShape,
2267
+
2268
+ /**
2269
+ * A `<Transition>` callback fired immediately after the 'enter' or 'appear' class is
2270
+ * applied.
2271
+ *
2272
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
2273
+ *
2274
+ * @type Function(node: HtmlElement, isAppearing: bool)
2275
+ */
2276
+ onEnter: propTypes.exports.func,
2277
+
2278
+ /**
2279
+ * A `<Transition>` callback fired immediately after the 'enter-active' or
2280
+ * 'appear-active' class is applied.
2281
+ *
2282
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
2283
+ *
2284
+ * @type Function(node: HtmlElement, isAppearing: bool)
2285
+ */
2286
+ onEntering: propTypes.exports.func,
2287
+
2288
+ /**
2289
+ * A `<Transition>` callback fired immediately after the 'enter' or
2290
+ * 'appear' classes are **removed** and the `done` class is added to the DOM node.
2291
+ *
2292
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
2293
+ *
2294
+ * @type Function(node: HtmlElement, isAppearing: bool)
2295
+ */
2296
+ onEntered: propTypes.exports.func,
2297
+
2298
+ /**
2299
+ * A `<Transition>` callback fired immediately after the 'exit' class is
2300
+ * applied.
2301
+ *
2302
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed
2303
+ *
2304
+ * @type Function(node: HtmlElement)
2305
+ */
2306
+ onExit: propTypes.exports.func,
2307
+
2308
+ /**
2309
+ * A `<Transition>` callback fired immediately after the 'exit-active' is applied.
2310
+ *
2311
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed
2312
+ *
2313
+ * @type Function(node: HtmlElement)
2314
+ */
2315
+ onExiting: propTypes.exports.func,
2316
+
2317
+ /**
2318
+ * A `<Transition>` callback fired immediately after the 'exit' classes
2319
+ * are **removed** and the `exit-done` class is added to the DOM node.
2320
+ *
2321
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed
2322
+ *
2323
+ * @type Function(node: HtmlElement)
2324
+ */
2325
+ onExited: propTypes.exports.func
2326
+ }) : {};
2327
+
2328
+ function _assertThisInitialized(self) {
2329
+ if (self === void 0) {
2330
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
2331
+ }
2332
+ return self;
2333
+ }
2334
+
2335
+ /**
2336
+ * Given `this.props.children`, return an object mapping key to child.
2337
+ *
2338
+ * @param {*} children `this.props.children`
2339
+ * @return {object} Mapping of key to child
2340
+ */
2341
+
2342
+ function getChildMapping(children, mapFn) {
2343
+ var mapper = function mapper(child) {
2344
+ return mapFn && React.isValidElement(child) ? mapFn(child) : child;
2345
+ };
2346
+
2347
+ var result = Object.create(null);
2348
+ if (children) React.Children.map(children, function (c) {
2349
+ return c;
2350
+ }).forEach(function (child) {
2351
+ // run the map function here instead so that the key is the computed one
2352
+ result[child.key] = mapper(child);
2353
+ });
2354
+ return result;
2355
+ }
2356
+ /**
2357
+ * When you're adding or removing children some may be added or removed in the
2358
+ * same render pass. We want to show *both* since we want to simultaneously
2359
+ * animate elements in and out. This function takes a previous set of keys
2360
+ * and a new set of keys and merges them with its best guess of the correct
2361
+ * ordering. In the future we may expose some of the utilities in
2362
+ * ReactMultiChild to make this easy, but for now React itself does not
2363
+ * directly have this concept of the union of prevChildren and nextChildren
2364
+ * so we implement it here.
2365
+ *
2366
+ * @param {object} prev prev children as returned from
2367
+ * `ReactTransitionChildMapping.getChildMapping()`.
2368
+ * @param {object} next next children as returned from
2369
+ * `ReactTransitionChildMapping.getChildMapping()`.
2370
+ * @return {object} a key set that contains all keys in `prev` and all keys
2371
+ * in `next` in a reasonable order.
2372
+ */
2373
+
2374
+ function mergeChildMappings(prev, next) {
2375
+ prev = prev || {};
2376
+ next = next || {};
2377
+
2378
+ function getValueForKey(key) {
2379
+ return key in next ? next[key] : prev[key];
2380
+ } // For each key of `next`, the list of keys to insert before that key in
2381
+ // the combined list
2382
+
2383
+
2384
+ var nextKeysPending = Object.create(null);
2385
+ var pendingKeys = [];
2386
+
2387
+ for (var prevKey in prev) {
2388
+ if (prevKey in next) {
2389
+ if (pendingKeys.length) {
2390
+ nextKeysPending[prevKey] = pendingKeys;
2391
+ pendingKeys = [];
2392
+ }
2393
+ } else {
2394
+ pendingKeys.push(prevKey);
2395
+ }
2396
+ }
2397
+
2398
+ var i;
2399
+ var childMapping = {};
2400
+
2401
+ for (var nextKey in next) {
2402
+ if (nextKeysPending[nextKey]) {
2403
+ for (i = 0; i < nextKeysPending[nextKey].length; i++) {
2404
+ var pendingNextKey = nextKeysPending[nextKey][i];
2405
+ childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);
2406
+ }
2407
+ }
2408
+
2409
+ childMapping[nextKey] = getValueForKey(nextKey);
2410
+ } // Finally, add the keys which didn't appear before any key in `next`
2411
+
2412
+
2413
+ for (i = 0; i < pendingKeys.length; i++) {
2414
+ childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);
2415
+ }
2416
+
2417
+ return childMapping;
2418
+ }
2419
+
2420
+ function getProp(child, prop, props) {
2421
+ return props[prop] != null ? props[prop] : child.props[prop];
2422
+ }
2423
+
2424
+ function getInitialChildMapping(props, onExited) {
2425
+ return getChildMapping(props.children, function (child) {
2426
+ return React.cloneElement(child, {
2427
+ onExited: onExited.bind(null, child),
2428
+ in: true,
2429
+ appear: getProp(child, 'appear', props),
2430
+ enter: getProp(child, 'enter', props),
2431
+ exit: getProp(child, 'exit', props)
2432
+ });
2433
+ });
2434
+ }
2435
+ function getNextChildMapping(nextProps, prevChildMapping, onExited) {
2436
+ var nextChildMapping = getChildMapping(nextProps.children);
2437
+ var children = mergeChildMappings(prevChildMapping, nextChildMapping);
2438
+ Object.keys(children).forEach(function (key) {
2439
+ var child = children[key];
2440
+ if (!React.isValidElement(child)) return;
2441
+ var hasPrev = (key in prevChildMapping);
2442
+ var hasNext = (key in nextChildMapping);
2443
+ var prevChild = prevChildMapping[key];
2444
+ var isLeaving = React.isValidElement(prevChild) && !prevChild.props.in; // item is new (entering)
2445
+
2446
+ if (hasNext && (!hasPrev || isLeaving)) {
2447
+ // console.log('entering', key)
2448
+ children[key] = React.cloneElement(child, {
2449
+ onExited: onExited.bind(null, child),
2450
+ in: true,
2451
+ exit: getProp(child, 'exit', nextProps),
2452
+ enter: getProp(child, 'enter', nextProps)
2453
+ });
2454
+ } else if (!hasNext && hasPrev && !isLeaving) {
2455
+ // item is old (exiting)
2456
+ // console.log('leaving', key)
2457
+ children[key] = React.cloneElement(child, {
2458
+ in: false
2459
+ });
2460
+ } else if (hasNext && hasPrev && React.isValidElement(prevChild)) {
2461
+ // item hasn't changed transition states
2462
+ // copy over the last transition props;
2463
+ // console.log('unchanged', key)
2464
+ children[key] = React.cloneElement(child, {
2465
+ onExited: onExited.bind(null, child),
2466
+ in: prevChild.props.in,
2467
+ exit: getProp(child, 'exit', nextProps),
2468
+ enter: getProp(child, 'enter', nextProps)
2469
+ });
2470
+ }
2471
+ });
2472
+ return children;
2473
+ }
2474
+
2475
+ var values = Object.values || function (obj) {
2476
+ return Object.keys(obj).map(function (k) {
2477
+ return obj[k];
2478
+ });
2479
+ };
2480
+
2481
+ var defaultProps = {
2482
+ component: 'div',
2483
+ childFactory: function childFactory(child) {
2484
+ return child;
2485
+ }
2486
+ };
2487
+ /**
2488
+ * The `<TransitionGroup>` component manages a set of transition components
2489
+ * (`<Transition>` and `<CSSTransition>`) in a list. Like with the transition
2490
+ * components, `<TransitionGroup>` is a state machine for managing the mounting
2491
+ * and unmounting of components over time.
2492
+ *
2493
+ * Consider the example below. As items are removed or added to the TodoList the
2494
+ * `in` prop is toggled automatically by the `<TransitionGroup>`.
2495
+ *
2496
+ * Note that `<TransitionGroup>` does not define any animation behavior!
2497
+ * Exactly _how_ a list item animates is up to the individual transition
2498
+ * component. This means you can mix and match animations across different list
2499
+ * items.
2500
+ */
2501
+
2502
+ var TransitionGroup = /*#__PURE__*/function (_React$Component) {
2503
+ _inheritsLoose(TransitionGroup, _React$Component);
2504
+
2505
+ function TransitionGroup(props, context) {
2506
+ var _this;
2507
+
2508
+ _this = _React$Component.call(this, props, context) || this;
2509
+
2510
+ var handleExited = _this.handleExited.bind(_assertThisInitialized(_this)); // Initial children should all be entering, dependent on appear
2511
+
2512
+
2513
+ _this.state = {
2514
+ contextValue: {
2515
+ isMounting: true
2516
+ },
2517
+ handleExited: handleExited,
2518
+ firstRender: true
2519
+ };
2520
+ return _this;
2521
+ }
2522
+
2523
+ var _proto = TransitionGroup.prototype;
2524
+
2525
+ _proto.componentDidMount = function componentDidMount() {
2526
+ this.mounted = true;
2527
+ this.setState({
2528
+ contextValue: {
2529
+ isMounting: false
2530
+ }
2531
+ });
2532
+ };
2533
+
2534
+ _proto.componentWillUnmount = function componentWillUnmount() {
2535
+ this.mounted = false;
2536
+ };
2537
+
2538
+ TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {
2539
+ var prevChildMapping = _ref.children,
2540
+ handleExited = _ref.handleExited,
2541
+ firstRender = _ref.firstRender;
2542
+ return {
2543
+ children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),
2544
+ firstRender: false
2545
+ };
2546
+ } // node is `undefined` when user provided `nodeRef` prop
2547
+ ;
2548
+
2549
+ _proto.handleExited = function handleExited(child, node) {
2550
+ var currentChildMapping = getChildMapping(this.props.children);
2551
+ if (child.key in currentChildMapping) return;
2552
+
2553
+ if (child.props.onExited) {
2554
+ child.props.onExited(node);
2555
+ }
2556
+
2557
+ if (this.mounted) {
2558
+ this.setState(function (state) {
2559
+ var children = _extends({}, state.children);
2560
+
2561
+ delete children[child.key];
2562
+ return {
2563
+ children: children
2564
+ };
2565
+ });
2566
+ }
2567
+ };
2568
+
2569
+ _proto.render = function render() {
2570
+ var _this$props = this.props,
2571
+ Component = _this$props.component,
2572
+ childFactory = _this$props.childFactory,
2573
+ props = _objectWithoutPropertiesLoose(_this$props, ["component", "childFactory"]);
2574
+
2575
+ var contextValue = this.state.contextValue;
2576
+ var children = values(this.state.children).map(childFactory);
2577
+ delete props.appear;
2578
+ delete props.enter;
2579
+ delete props.exit;
2580
+
2581
+ if (Component === null) {
2582
+ return /*#__PURE__*/React__default["default"].createElement(TransitionGroupContext.Provider, {
2583
+ value: contextValue
2584
+ }, children);
2585
+ }
2586
+
2587
+ return /*#__PURE__*/React__default["default"].createElement(TransitionGroupContext.Provider, {
2588
+ value: contextValue
2589
+ }, /*#__PURE__*/React__default["default"].createElement(Component, props, children));
2590
+ };
2591
+
2592
+ return TransitionGroup;
2593
+ }(React__default["default"].Component);
2594
+
2595
+ TransitionGroup.propTypes = process.env.NODE_ENV !== "production" ? {
2596
+ /**
2597
+ * `<TransitionGroup>` renders a `<div>` by default. You can change this
2598
+ * behavior by providing a `component` prop.
2599
+ * If you use React v16+ and would like to avoid a wrapping `<div>` element
2600
+ * you can pass in `component={null}`. This is useful if the wrapping div
2601
+ * borks your css styles.
2602
+ */
2603
+ component: propTypes.exports.any,
2604
+
2605
+ /**
2606
+ * A set of `<Transition>` components, that are toggled `in` and out as they
2607
+ * leave. the `<TransitionGroup>` will inject specific transition props, so
2608
+ * remember to spread them through if you are wrapping the `<Transition>` as
2609
+ * with our `<Fade>` example.
2610
+ *
2611
+ * While this component is meant for multiple `Transition` or `CSSTransition`
2612
+ * children, sometimes you may want to have a single transition child with
2613
+ * content that you want to be transitioned out and in when you change it
2614
+ * (e.g. routes, images etc.) In that case you can change the `key` prop of
2615
+ * the transition child as you change its content, this will cause
2616
+ * `TransitionGroup` to transition the child out and back in.
2617
+ */
2618
+ children: propTypes.exports.node,
2619
+
2620
+ /**
2621
+ * A convenience prop that enables or disables appear animations
2622
+ * for all children. Note that specifying this will override any defaults set
2623
+ * on individual children Transitions.
2624
+ */
2625
+ appear: propTypes.exports.bool,
2626
+
2627
+ /**
2628
+ * A convenience prop that enables or disables enter animations
2629
+ * for all children. Note that specifying this will override any defaults set
2630
+ * on individual children Transitions.
2631
+ */
2632
+ enter: propTypes.exports.bool,
2633
+
2634
+ /**
2635
+ * A convenience prop that enables or disables exit animations
2636
+ * for all children. Note that specifying this will override any defaults set
2637
+ * on individual children Transitions.
2638
+ */
2639
+ exit: propTypes.exports.bool,
2640
+
2641
+ /**
2642
+ * You may need to apply reactive updates to a child as it is exiting.
2643
+ * This is generally done by using `cloneElement` however in the case of an exiting
2644
+ * child the element has already been removed and not accessible to the consumer.
2645
+ *
2646
+ * If you do need to update a child as it leaves you can provide a `childFactory`
2647
+ * to wrap every child, even the ones that are leaving.
2648
+ *
2649
+ * @type Function(child: ReactElement) -> ReactElement
2650
+ */
2651
+ childFactory: propTypes.exports.func
2652
+ } : {};
2653
+ TransitionGroup.defaultProps = defaultProps;
2654
+
2655
+ /**
2656
+ * The `<ReplaceTransition>` component is a specialized `Transition` component
2657
+ * that animates between two children.
2658
+ *
2659
+ * ```jsx
2660
+ * <ReplaceTransition in>
2661
+ * <Fade><div>I appear first</div></Fade>
2662
+ * <Fade><div>I replace the above</div></Fade>
2663
+ * </ReplaceTransition>
2664
+ * ```
2665
+ */
2666
+
2667
+ var ReplaceTransition = /*#__PURE__*/function (_React$Component) {
2668
+ _inheritsLoose(ReplaceTransition, _React$Component);
2669
+
2670
+ function ReplaceTransition() {
2671
+ var _this;
2672
+
2673
+ for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
2674
+ _args[_key] = arguments[_key];
2675
+ }
2676
+
2677
+ _this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this;
2678
+
2679
+ _this.handleEnter = function () {
2680
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
2681
+ args[_key2] = arguments[_key2];
2682
+ }
2683
+
2684
+ return _this.handleLifecycle('onEnter', 0, args);
2685
+ };
2686
+
2687
+ _this.handleEntering = function () {
2688
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
2689
+ args[_key3] = arguments[_key3];
2690
+ }
2691
+
2692
+ return _this.handleLifecycle('onEntering', 0, args);
2693
+ };
2694
+
2695
+ _this.handleEntered = function () {
2696
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
2697
+ args[_key4] = arguments[_key4];
2698
+ }
2699
+
2700
+ return _this.handleLifecycle('onEntered', 0, args);
2701
+ };
2702
+
2703
+ _this.handleExit = function () {
2704
+ for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
2705
+ args[_key5] = arguments[_key5];
2706
+ }
2707
+
2708
+ return _this.handleLifecycle('onExit', 1, args);
2709
+ };
2710
+
2711
+ _this.handleExiting = function () {
2712
+ for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
2713
+ args[_key6] = arguments[_key6];
2714
+ }
2715
+
2716
+ return _this.handleLifecycle('onExiting', 1, args);
2717
+ };
2718
+
2719
+ _this.handleExited = function () {
2720
+ for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
2721
+ args[_key7] = arguments[_key7];
2722
+ }
2723
+
2724
+ return _this.handleLifecycle('onExited', 1, args);
2725
+ };
2726
+
2727
+ return _this;
2728
+ }
2729
+
2730
+ var _proto = ReplaceTransition.prototype;
2731
+
2732
+ _proto.handleLifecycle = function handleLifecycle(handler, idx, originalArgs) {
2733
+ var _child$props;
2734
+
2735
+ var children = this.props.children;
2736
+ var child = React__default["default"].Children.toArray(children)[idx];
2737
+ if (child.props[handler]) (_child$props = child.props)[handler].apply(_child$props, originalArgs);
2738
+
2739
+ if (this.props[handler]) {
2740
+ var maybeNode = child.props.nodeRef ? undefined : ReactDOM__default["default"].findDOMNode(this);
2741
+ this.props[handler](maybeNode);
2742
+ }
2743
+ };
2744
+
2745
+ _proto.render = function render() {
2746
+ var _this$props = this.props,
2747
+ children = _this$props.children,
2748
+ inProp = _this$props.in,
2749
+ props = _objectWithoutPropertiesLoose(_this$props, ["children", "in"]);
2750
+
2751
+ var _React$Children$toArr = React__default["default"].Children.toArray(children),
2752
+ first = _React$Children$toArr[0],
2753
+ second = _React$Children$toArr[1];
2754
+
2755
+ delete props.onEnter;
2756
+ delete props.onEntering;
2757
+ delete props.onEntered;
2758
+ delete props.onExit;
2759
+ delete props.onExiting;
2760
+ delete props.onExited;
2761
+ return /*#__PURE__*/React__default["default"].createElement(TransitionGroup, props, inProp ? React__default["default"].cloneElement(first, {
2762
+ key: 'first',
2763
+ onEnter: this.handleEnter,
2764
+ onEntering: this.handleEntering,
2765
+ onEntered: this.handleEntered
2766
+ }) : React__default["default"].cloneElement(second, {
2767
+ key: 'second',
2768
+ onEnter: this.handleExit,
2769
+ onEntering: this.handleExiting,
2770
+ onEntered: this.handleExited
2771
+ }));
2772
+ };
2773
+
2774
+ return ReplaceTransition;
2775
+ }(React__default["default"].Component);
2776
+
2777
+ ReplaceTransition.propTypes = process.env.NODE_ENV !== "production" ? {
2778
+ in: propTypes.exports.bool.isRequired,
2779
+ children: function children(props, propName) {
2780
+ if (React__default["default"].Children.count(props[propName]) !== 2) return new Error("\"" + propName + "\" must be exactly two transition components.");
2781
+ return null;
2782
+ }
2783
+ } : {};
2784
+
2785
+ var _leaveRenders, _enterRenders;
2786
+
2787
+ function areChildrenDifferent(oldChildren, newChildren) {
2788
+ if (oldChildren === newChildren) return false;
2789
+
2790
+ if (React__default["default"].isValidElement(oldChildren) && React__default["default"].isValidElement(newChildren) && oldChildren.key != null && oldChildren.key === newChildren.key) {
2791
+ return false;
2792
+ }
2793
+
2794
+ return true;
2795
+ }
2796
+ /**
2797
+ * Enum of modes for SwitchTransition component
2798
+ * @enum { string }
2799
+ */
2800
+
2801
+
2802
+ var modes = {
2803
+ out: 'out-in',
2804
+ in: 'in-out'
2805
+ };
2806
+
2807
+ var callHook = function callHook(element, name, cb) {
2808
+ return function () {
2809
+ var _element$props;
2810
+
2811
+ element.props[name] && (_element$props = element.props)[name].apply(_element$props, arguments);
2812
+ cb();
2813
+ };
2814
+ };
2815
+
2816
+ var leaveRenders = (_leaveRenders = {}, _leaveRenders[modes.out] = function (_ref) {
2817
+ var current = _ref.current,
2818
+ changeState = _ref.changeState;
2819
+ return React__default["default"].cloneElement(current, {
2820
+ in: false,
2821
+ onExited: callHook(current, 'onExited', function () {
2822
+ changeState(ENTERING, null);
2823
+ })
2824
+ });
2825
+ }, _leaveRenders[modes.in] = function (_ref2) {
2826
+ var current = _ref2.current,
2827
+ changeState = _ref2.changeState,
2828
+ children = _ref2.children;
2829
+ return [current, React__default["default"].cloneElement(children, {
2830
+ in: true,
2831
+ onEntered: callHook(children, 'onEntered', function () {
2832
+ changeState(ENTERING);
2833
+ })
2834
+ })];
2835
+ }, _leaveRenders);
2836
+ var enterRenders = (_enterRenders = {}, _enterRenders[modes.out] = function (_ref3) {
2837
+ var children = _ref3.children,
2838
+ changeState = _ref3.changeState;
2839
+ return React__default["default"].cloneElement(children, {
2840
+ in: true,
2841
+ onEntered: callHook(children, 'onEntered', function () {
2842
+ changeState(ENTERED, React__default["default"].cloneElement(children, {
2843
+ in: true
2844
+ }));
2845
+ })
2846
+ });
2847
+ }, _enterRenders[modes.in] = function (_ref4) {
2848
+ var current = _ref4.current,
2849
+ children = _ref4.children,
2850
+ changeState = _ref4.changeState;
2851
+ return [React__default["default"].cloneElement(current, {
2852
+ in: false,
2853
+ onExited: callHook(current, 'onExited', function () {
2854
+ changeState(ENTERED, React__default["default"].cloneElement(children, {
2855
+ in: true
2856
+ }));
2857
+ })
2858
+ }), React__default["default"].cloneElement(children, {
2859
+ in: true
2860
+ })];
2861
+ }, _enterRenders);
2862
+ /**
2863
+ * A transition component inspired by the [vue transition modes](https://vuejs.org/v2/guide/transitions.html#Transition-Modes).
2864
+ * You can use it when you want to control the render between state transitions.
2865
+ * Based on the selected mode and the child's key which is the `Transition` or `CSSTransition` component, the `SwitchTransition` makes a consistent transition between them.
2866
+ *
2867
+ * If the `out-in` mode is selected, the `SwitchTransition` waits until the old child leaves and then inserts a new child.
2868
+ * If the `in-out` mode is selected, the `SwitchTransition` inserts a new child first, waits for the new child to enter and then removes the old child.
2869
+ *
2870
+ * **Note**: If you want the animation to happen simultaneously
2871
+ * (that is, to have the old child removed and a new child inserted **at the same time**),
2872
+ * you should use
2873
+ * [`TransitionGroup`](https://reactcommunity.org/react-transition-group/transition-group)
2874
+ * instead.
2875
+ *
2876
+ * ```jsx
2877
+ * function App() {
2878
+ * const [state, setState] = useState(false);
2879
+ * return (
2880
+ * <SwitchTransition>
2881
+ * <CSSTransition
2882
+ * key={state ? "Goodbye, world!" : "Hello, world!"}
2883
+ * addEndListener={(node, done) => node.addEventListener("transitionend", done, false)}
2884
+ * classNames='fade'
2885
+ * >
2886
+ * <button onClick={() => setState(state => !state)}>
2887
+ * {state ? "Goodbye, world!" : "Hello, world!"}
2888
+ * </button>
2889
+ * </CSSTransition>
2890
+ * </SwitchTransition>
2891
+ * );
2892
+ * }
2893
+ * ```
2894
+ *
2895
+ * ```css
2896
+ * .fade-enter{
2897
+ * opacity: 0;
2898
+ * }
2899
+ * .fade-exit{
2900
+ * opacity: 1;
2901
+ * }
2902
+ * .fade-enter-active{
2903
+ * opacity: 1;
2904
+ * }
2905
+ * .fade-exit-active{
2906
+ * opacity: 0;
2907
+ * }
2908
+ * .fade-enter-active,
2909
+ * .fade-exit-active{
2910
+ * transition: opacity 500ms;
2911
+ * }
2912
+ * ```
2913
+ */
2914
+
2915
+ var SwitchTransition = /*#__PURE__*/function (_React$Component) {
2916
+ _inheritsLoose(SwitchTransition, _React$Component);
2917
+
2918
+ function SwitchTransition() {
2919
+ var _this;
2920
+
2921
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2922
+ args[_key] = arguments[_key];
2923
+ }
2924
+
2925
+ _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
2926
+ _this.state = {
2927
+ status: ENTERED,
2928
+ current: null
2929
+ };
2930
+ _this.appeared = false;
2931
+
2932
+ _this.changeState = function (status, current) {
2933
+ if (current === void 0) {
2934
+ current = _this.state.current;
2935
+ }
2936
+
2937
+ _this.setState({
2938
+ status: status,
2939
+ current: current
2940
+ });
2941
+ };
2942
+
2943
+ return _this;
2944
+ }
2945
+
2946
+ var _proto = SwitchTransition.prototype;
2947
+
2948
+ _proto.componentDidMount = function componentDidMount() {
2949
+ this.appeared = true;
2950
+ };
2951
+
2952
+ SwitchTransition.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
2953
+ if (props.children == null) {
2954
+ return {
2955
+ current: null
2956
+ };
2957
+ }
2958
+
2959
+ if (state.status === ENTERING && props.mode === modes.in) {
2960
+ return {
2961
+ status: ENTERING
2962
+ };
2963
+ }
2964
+
2965
+ if (state.current && areChildrenDifferent(state.current, props.children)) {
2966
+ return {
2967
+ status: EXITING
2968
+ };
2969
+ }
2970
+
2971
+ return {
2972
+ current: React__default["default"].cloneElement(props.children, {
2973
+ in: true
2974
+ })
2975
+ };
2976
+ };
2977
+
2978
+ _proto.render = function render() {
2979
+ var _this$props = this.props,
2980
+ children = _this$props.children,
2981
+ mode = _this$props.mode,
2982
+ _this$state = this.state,
2983
+ status = _this$state.status,
2984
+ current = _this$state.current;
2985
+ var data = {
2986
+ children: children,
2987
+ current: current,
2988
+ changeState: this.changeState,
2989
+ status: status
2990
+ };
2991
+ var component;
2992
+
2993
+ switch (status) {
2994
+ case ENTERING:
2995
+ component = enterRenders[mode](data);
2996
+ break;
2997
+
2998
+ case EXITING:
2999
+ component = leaveRenders[mode](data);
3000
+ break;
3001
+
3002
+ case ENTERED:
3003
+ component = current;
3004
+ }
3005
+
3006
+ return /*#__PURE__*/React__default["default"].createElement(TransitionGroupContext.Provider, {
3007
+ value: {
3008
+ isMounting: !this.appeared
3009
+ }
3010
+ }, component);
3011
+ };
3012
+
3013
+ return SwitchTransition;
3014
+ }(React__default["default"].Component);
3015
+
3016
+ SwitchTransition.propTypes = process.env.NODE_ENV !== "production" ? {
3017
+ /**
3018
+ * Transition modes.
3019
+ * `out-in`: Current element transitions out first, then when complete, the new element transitions in.
3020
+ * `in-out`: New element transitions in first, then when complete, the current element transitions out.
3021
+ *
3022
+ * @type {'out-in'|'in-out'}
3023
+ */
3024
+ mode: propTypes.exports.oneOf([modes.in, modes.out]),
3025
+
3026
+ /**
3027
+ * Any `Transition` or `CSSTransition` component.
3028
+ */
3029
+ children: propTypes.exports.oneOfType([propTypes.exports.element.isRequired])
3030
+ } : {};
3031
+ SwitchTransition.defaultProps = {
3032
+ mode: modes.out
3033
+ };
3034
+
3035
+ var css_248z = ".gn-drawer__item{background-color:var(--g-color-base-background);bottom:0;height:100%;left:0;position:absolute;top:0;will-change:transform}.gn-drawer__item_direction_right{left:auto;right:0}.gn-drawer__item-transition-enter{transform:translate(-100%)}.gn-drawer__item-transition_direction_right-enter{transform:translate(100%)}.gn-drawer__item-transition-enter-active,.gn-drawer__item-transition_direction_right-enter-active{transform:translate(0);transition:transform .3s}.gn-drawer__item-transition-enter-done,.gn-drawer__item-transition_direction_right-enter-done{filter:blur(0);transform:translateZ(0)}.gn-drawer__item-transition-exit,.gn-drawer__item-transition_direction_right-exit{transform:translate(0)}.gn-drawer__item-transition-exit-active,.gn-drawer__item-transition_direction_right-exit-active{transition:transform .3s}.gn-drawer__item-transition-exit-active{transform:translate(-100%)}.gn-drawer__item-transition_direction_right-exit-active{transform:translate(100%)}.gn-drawer__item-transition-exit-done,.gn-drawer__item-transition_direction_right-exit-done{visibility:hidden}.gn-drawer__veil{background-color:var(--g-color-sfx-veil);bottom:0;left:0;position:absolute;right:0;top:0}.gn-drawer__veil-transition-enter{opacity:0}.gn-drawer__veil-transition-enter-active{opacity:1;transition:opacity .3s}.gn-drawer__veil-transition-exit{opacity:1}.gn-drawer__veil-transition-exit-active{opacity:0;transition:opacity .3s}.gn-drawer__veil-transition-exit-done{visibility:hidden}";
3036
+ styleInject_es.styleInject(css_248z);
3037
+
3038
+ const b = styleInject_es.block('drawer');
3039
+ const TIMEOUT = 300;
3040
+ const DrawerItem = ({ visible, content, direction, className }) => {
3041
+ const itemRef = React__default["default"].useRef(null);
3042
+ const cssDirection = direction === 'left' ? undefined : direction;
3043
+ return (React__default["default"].createElement(CSSTransition, { in: visible, timeout: TIMEOUT, unmountOnExit: true, classNames: b('item-transition', { direction: cssDirection }), nodeRef: itemRef },
3044
+ React__default["default"].createElement("div", { ref: itemRef, className: b('item', { direction: cssDirection }, className) }, content)));
3045
+ };
3046
+ const Drawer = ({ className, children, style, onVeilClick, onEscape, preventScrollBody = true, }) => {
3047
+ let someItemVisible = false;
3048
+ React__default["default"].Children.forEach(children, (child) => {
3049
+ const childElem = child;
3050
+ if (childElem.type === DrawerItem) {
3051
+ const childVisible = Boolean(childElem.props.visible);
3052
+ if (childVisible) {
3053
+ someItemVisible = true;
3054
+ }
3055
+ }
3056
+ });
3057
+ React__default["default"].useEffect(() => {
3058
+ function onKeyDown(event) {
3059
+ if (event.key === 'Escape') {
3060
+ onEscape === null || onEscape === void 0 ? void 0 : onEscape();
3061
+ }
3062
+ }
3063
+ if (someItemVisible) {
3064
+ window.addEventListener('keydown', onKeyDown);
3065
+ }
3066
+ return () => {
3067
+ window.removeEventListener('keydown', onKeyDown);
3068
+ };
3069
+ }, [onEscape, someItemVisible]);
3070
+ uikit.useBodyScrollLock({ enabled: preventScrollBody && someItemVisible });
3071
+ const containerRef = React__default["default"].useRef(null);
3072
+ const veilRef = React__default["default"].useRef(null);
3073
+ return (React__default["default"].createElement(Transition, { in: someItemVisible, timeout: { enter: 0, exit: TIMEOUT }, mountOnEnter: true, unmountOnExit: true, nodeRef: containerRef }, (state) => {
3074
+ const childrenVisible = someItemVisible && state === 'entered';
3075
+ return (React__default["default"].createElement("div", { ref: containerRef, className: b(null, className), style: style },
3076
+ React__default["default"].createElement(CSSTransition, { in: childrenVisible, timeout: TIMEOUT, unmountOnExit: true, classNames: b('veil-transition'), nodeRef: veilRef },
3077
+ React__default["default"].createElement("div", { ref: veilRef, className: b('veil'), onClick: onVeilClick })),
3078
+ React__default["default"].Children.map(children, (child) => {
3079
+ const childElem = child;
3080
+ if (childElem.type === DrawerItem) {
3081
+ const childVisible = Boolean(childElem.props.visible);
3082
+ return React__default["default"].cloneElement(childElem, Object.assign(Object.assign({}, childElem.props), { visible: childVisible && childrenVisible }));
3083
+ }
3084
+ return child;
3085
+ })));
3086
+ }));
3087
+ };
3088
+
3089
+ exports.Drawer = Drawer;
3090
+ exports.DrawerItem = DrawerItem;
3091
+ //# sourceMappingURL=Drawer.js.map