UNPKG

85 kBJavaScriptView Raw
1'use strict';
2
3Object.defineProperty(exports, '__esModule', { value: true });
4
5var tslib = require('tslib');
6
7function convertToBezierString(_a) {
8 var _b = tslib.__read(_a, 4), a = _b[0], b = _b[1], c = _b[2], d = _b[3];
9 return "cubic-bezier(" + a + ", " + b + ", " + c + ", " + d + ")";
10}
11
12function secondsToMilliseconds(seconds) {
13 return seconds * 1000;
14}
15
16function getTargetKeyframe(keyframes) {
17 return Array.isArray(keyframes) ? keyframes[keyframes.length - 1] : keyframes;
18}
19
20function animate(element,
21// elements: Element | Element[] | NodeListOf<Element> | string,
22keyframes, options) {
23 // if (typeof elements === "string") {
24 // elements = document.querySelectorAll(elements)
25 // }
26 if (options === void 0) { options = {}; }
27 // if (Array.isArray(elements) || elements instanceof NodeList) {
28 // const { stagger = 0, delay = 0 } = options
29 // return Array.from(elements).map((element, i) => {
30 // animate(element, keyframes, { ...options, delay: delay + stagger * i })
31 // })
32 // }
33 // const element = elements as HTMLElement
34 var _a = options.delay, delay = _a === void 0 ? 0 : _a, _b = options.duration, duration = _b === void 0 ? 0.3 : _b, _c = options.repeat, repeat = _c === void 0 ? 0 : _c, _d = options.initialProgress, iterationStart = _d === void 0 ? 0 : _d, _e = options.easing, easing = _e === void 0 ? "linear" : _e;
35 delay = secondsToMilliseconds(delay);
36 duration = secondsToMilliseconds(duration);
37 console.log({
38 delay: delay,
39 duration: duration,
40 easing: Array.isArray(easing) ? convertToBezierString(easing) : easing,
41 iterations: repeat + 1,
42 iterationStart: iterationStart,
43 });
44 function onComplete() {
45 Object.assign(element.style, getTargetKeyframe(keyframes));
46 }
47 var animation = element.animate(keyframes, {
48 delay: delay,
49 duration: duration,
50 easing: Array.isArray(easing) ? convertToBezierString(easing) : easing,
51 iterations: repeat + 1,
52 iterationStart: iterationStart,
53 });
54 animation.finished.then(onComplete);
55}
56
57var react = {exports: {}};
58
59var react_production_min = {};
60
61/*
62object-assign
63(c) Sindre Sorhus
64@license MIT
65*/
66/* eslint-disable no-unused-vars */
67var getOwnPropertySymbols = Object.getOwnPropertySymbols;
68var hasOwnProperty = Object.prototype.hasOwnProperty;
69var propIsEnumerable = Object.prototype.propertyIsEnumerable;
70
71function toObject(val) {
72 if (val === null || val === undefined) {
73 throw new TypeError('Object.assign cannot be called with null or undefined');
74 }
75
76 return Object(val);
77}
78
79function shouldUseNative() {
80 try {
81 if (!Object.assign) {
82 return false;
83 }
84
85 // Detect buggy property enumeration order in older V8 versions.
86
87 // https://bugs.chromium.org/p/v8/issues/detail?id=4118
88 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
89 test1[5] = 'de';
90 if (Object.getOwnPropertyNames(test1)[0] === '5') {
91 return false;
92 }
93
94 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
95 var test2 = {};
96 for (var i = 0; i < 10; i++) {
97 test2['_' + String.fromCharCode(i)] = i;
98 }
99 var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
100 return test2[n];
101 });
102 if (order2.join('') !== '0123456789') {
103 return false;
104 }
105
106 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
107 var test3 = {};
108 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
109 test3[letter] = letter;
110 });
111 if (Object.keys(Object.assign({}, test3)).join('') !==
112 'abcdefghijklmnopqrst') {
113 return false;
114 }
115
116 return true;
117 } catch (err) {
118 // We don't expect any of the above to throw, but better to be safe.
119 return false;
120 }
121}
122
123var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
124 var from;
125 var to = toObject(target);
126 var symbols;
127
128 for (var s = 1; s < arguments.length; s++) {
129 from = Object(arguments[s]);
130
131 for (var key in from) {
132 if (hasOwnProperty.call(from, key)) {
133 to[key] = from[key];
134 }
135 }
136
137 if (getOwnPropertySymbols) {
138 symbols = getOwnPropertySymbols(from);
139 for (var i = 0; i < symbols.length; i++) {
140 if (propIsEnumerable.call(from, symbols[i])) {
141 to[symbols[i]] = from[symbols[i]];
142 }
143 }
144 }
145 }
146
147 return to;
148};
149
150/** @license React v17.0.2
151 * react.production.min.js
152 *
153 * Copyright (c) Facebook, Inc. and its affiliates.
154 *
155 * This source code is licensed under the MIT license found in the
156 * LICENSE file in the root directory of this source tree.
157 */
158var l=objectAssign,n=60103,p=60106;react_production_min.Fragment=60107;react_production_min.StrictMode=60108;react_production_min.Profiler=60114;var q=60109,r=60110,t=60112;react_production_min.Suspense=60113;var u=60115,v=60116;
159if("function"===typeof Symbol&&Symbol.for){var w=Symbol.for;n=w("react.element");p=w("react.portal");react_production_min.Fragment=w("react.fragment");react_production_min.StrictMode=w("react.strict_mode");react_production_min.Profiler=w("react.profiler");q=w("react.provider");r=w("react.context");t=w("react.forward_ref");react_production_min.Suspense=w("react.suspense");u=w("react.memo");v=w("react.lazy");}var x="function"===typeof Symbol&&Symbol.iterator;
160function y(a){if(null===a||"object"!==typeof a)return null;a=x&&a[x]||a["@@iterator"];return "function"===typeof a?a:null}function z(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)b+="&args[]="+encodeURIComponent(arguments[c]);return "Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}
161var A={isMounted:function(){return !1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},B={};function C(a,b,c){this.props=a;this.context=b;this.refs=B;this.updater=c||A;}C.prototype.isReactComponent={};C.prototype.setState=function(a,b){if("object"!==typeof a&&"function"!==typeof a&&null!=a)throw Error(z(85));this.updater.enqueueSetState(this,a,b,"setState");};C.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate");};
162function D(){}D.prototype=C.prototype;function E(a,b,c){this.props=a;this.context=b;this.refs=B;this.updater=c||A;}var F=E.prototype=new D;F.constructor=E;l(F,C.prototype);F.isPureReactComponent=!0;var G={current:null},H=Object.prototype.hasOwnProperty,I={key:!0,ref:!0,__self:!0,__source:!0};
163function J(a,b,c){var e,d={},k=null,h=null;if(null!=b)for(e in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=""+b.key),b)H.call(b,e)&&!I.hasOwnProperty(e)&&(d[e]=b[e]);var g=arguments.length-2;if(1===g)d.children=c;else if(1<g){for(var f=Array(g),m=0;m<g;m++)f[m]=arguments[m+2];d.children=f;}if(a&&a.defaultProps)for(e in g=a.defaultProps,g)void 0===d[e]&&(d[e]=g[e]);return {$$typeof:n,type:a,key:k,ref:h,props:d,_owner:G.current}}
164function K(a,b){return {$$typeof:n,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function L(a){return "object"===typeof a&&null!==a&&a.$$typeof===n}function escape(a){var b={"=":"=0",":":"=2"};return "$"+a.replace(/[=:]/g,function(a){return b[a]})}var M=/\/+/g;function N(a,b){return "object"===typeof a&&null!==a&&null!=a.key?escape(""+a.key):b.toString(36)}
165function O(a,b,c,e,d){var k=typeof a;if("undefined"===k||"boolean"===k)a=null;var h=!1;if(null===a)h=!0;else switch(k){case "string":case "number":h=!0;break;case "object":switch(a.$$typeof){case n:case p:h=!0;}}if(h)return h=a,d=d(h),a=""===e?"."+N(h,0):e,Array.isArray(d)?(c="",null!=a&&(c=a.replace(M,"$&/")+"/"),O(d,b,c,"",function(a){return a})):null!=d&&(L(d)&&(d=K(d,c+(!d.key||h&&h.key===d.key?"":(""+d.key).replace(M,"$&/")+"/")+a)),b.push(d)),1;h=0;e=""===e?".":e+":";if(Array.isArray(a))for(var g=
1660;g<a.length;g++){k=a[g];var f=e+N(k,g);h+=O(k,b,c,f,d);}else if(f=y(a),"function"===typeof f)for(a=f.call(a),g=0;!(k=a.next()).done;)k=k.value,f=e+N(k,g++),h+=O(k,b,c,f,d);else if("object"===k)throw b=""+a,Error(z(31,"[object Object]"===b?"object with keys {"+Object.keys(a).join(", ")+"}":b));return h}function P(a,b,c){if(null==a)return a;var e=[],d=0;O(a,e,"","",function(a){return b.call(c,a,d++)});return e}
167function Q(a){if(-1===a._status){var b=a._result;b=b();a._status=0;a._result=b;b.then(function(b){0===a._status&&(b=b.default,a._status=1,a._result=b);},function(b){0===a._status&&(a._status=2,a._result=b);});}if(1===a._status)return a._result;throw a._result;}var R={current:null};function S(){var a=R.current;if(null===a)throw Error(z(321));return a}var T={ReactCurrentDispatcher:R,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:G,IsSomeRendererActing:{current:!1},assign:l};
168react_production_min.Children={map:P,forEach:function(a,b,c){P(a,function(){b.apply(this,arguments);},c);},count:function(a){var b=0;P(a,function(){b++;});return b},toArray:function(a){return P(a,function(a){return a})||[]},only:function(a){if(!L(a))throw Error(z(143));return a}};react_production_min.Component=C;react_production_min.PureComponent=E;react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=T;
169react_production_min.cloneElement=function(a,b,c){if(null===a||void 0===a)throw Error(z(267,a));var e=l({},a.props),d=a.key,k=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,h=G.current);void 0!==b.key&&(d=""+b.key);if(a.type&&a.type.defaultProps)var g=a.type.defaultProps;for(f in b)H.call(b,f)&&!I.hasOwnProperty(f)&&(e[f]=void 0===b[f]&&void 0!==g?g[f]:b[f]);}var f=arguments.length-2;if(1===f)e.children=c;else if(1<f){g=Array(f);for(var m=0;m<f;m++)g[m]=arguments[m+2];e.children=g;}return {$$typeof:n,type:a.type,
170key:d,ref:k,props:e,_owner:h}};react_production_min.createContext=function(a,b){void 0===b&&(b=null);a={$$typeof:r,_calculateChangedBits:b,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null};a.Provider={$$typeof:q,_context:a};return a.Consumer=a};react_production_min.createElement=J;react_production_min.createFactory=function(a){var b=J.bind(null,a);b.type=a;return b};react_production_min.createRef=function(){return {current:null}};react_production_min.forwardRef=function(a){return {$$typeof:t,render:a}};react_production_min.isValidElement=L;
171react_production_min.lazy=function(a){return {$$typeof:v,_payload:{_status:-1,_result:a},_init:Q}};react_production_min.memo=function(a,b){return {$$typeof:u,type:a,compare:void 0===b?null:b}};react_production_min.useCallback=function(a,b){return S().useCallback(a,b)};react_production_min.useContext=function(a,b){return S().useContext(a,b)};react_production_min.useDebugValue=function(){};react_production_min.useEffect=function(a,b){return S().useEffect(a,b)};react_production_min.useImperativeHandle=function(a,b,c){return S().useImperativeHandle(a,b,c)};
172react_production_min.useLayoutEffect=function(a,b){return S().useLayoutEffect(a,b)};react_production_min.useMemo=function(a,b){return S().useMemo(a,b)};react_production_min.useReducer=function(a,b,c){return S().useReducer(a,b,c)};react_production_min.useRef=function(a){return S().useRef(a)};react_production_min.useState=function(a){return S().useState(a)};react_production_min.version="17.0.2";
173
174var react_development = {};
175
176/** @license React v17.0.2
177 * react.development.js
178 *
179 * Copyright (c) Facebook, Inc. and its affiliates.
180 *
181 * This source code is licensed under the MIT license found in the
182 * LICENSE file in the root directory of this source tree.
183 */
184
185(function (exports) {
186
187if (process.env.NODE_ENV !== "production") {
188 (function() {
189
190var _assign = objectAssign;
191
192// TODO: this is special because it gets imported during build.
193var ReactVersion = '17.0.2';
194
195// ATTENTION
196// When adding new symbols to this file,
197// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
198// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
199// nor polyfill, then a plain number is used for performance.
200var REACT_ELEMENT_TYPE = 0xeac7;
201var REACT_PORTAL_TYPE = 0xeaca;
202exports.Fragment = 0xeacb;
203exports.StrictMode = 0xeacc;
204exports.Profiler = 0xead2;
205var REACT_PROVIDER_TYPE = 0xeacd;
206var REACT_CONTEXT_TYPE = 0xeace;
207var REACT_FORWARD_REF_TYPE = 0xead0;
208exports.Suspense = 0xead1;
209var REACT_SUSPENSE_LIST_TYPE = 0xead8;
210var REACT_MEMO_TYPE = 0xead3;
211var REACT_LAZY_TYPE = 0xead4;
212var REACT_BLOCK_TYPE = 0xead9;
213var REACT_SERVER_BLOCK_TYPE = 0xeada;
214var REACT_FUNDAMENTAL_TYPE = 0xead5;
215var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
216var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;
217
218if (typeof Symbol === 'function' && Symbol.for) {
219 var symbolFor = Symbol.for;
220 REACT_ELEMENT_TYPE = symbolFor('react.element');
221 REACT_PORTAL_TYPE = symbolFor('react.portal');
222 exports.Fragment = symbolFor('react.fragment');
223 exports.StrictMode = symbolFor('react.strict_mode');
224 exports.Profiler = symbolFor('react.profiler');
225 REACT_PROVIDER_TYPE = symbolFor('react.provider');
226 REACT_CONTEXT_TYPE = symbolFor('react.context');
227 REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
228 exports.Suspense = symbolFor('react.suspense');
229 REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
230 REACT_MEMO_TYPE = symbolFor('react.memo');
231 REACT_LAZY_TYPE = symbolFor('react.lazy');
232 REACT_BLOCK_TYPE = symbolFor('react.block');
233 REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');
234 REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
235 symbolFor('react.scope');
236 symbolFor('react.opaque.id');
237 REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
238 symbolFor('react.offscreen');
239 REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
240}
241
242var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
243var FAUX_ITERATOR_SYMBOL = '@@iterator';
244function getIteratorFn(maybeIterable) {
245 if (maybeIterable === null || typeof maybeIterable !== 'object') {
246 return null;
247 }
248
249 var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
250
251 if (typeof maybeIterator === 'function') {
252 return maybeIterator;
253 }
254
255 return null;
256}
257
258/**
259 * Keeps track of the current dispatcher.
260 */
261var ReactCurrentDispatcher = {
262 /**
263 * @internal
264 * @type {ReactComponent}
265 */
266 current: null
267};
268
269/**
270 * Keeps track of the current batch's configuration such as how long an update
271 * should suspend for if it needs to.
272 */
273var ReactCurrentBatchConfig = {
274 transition: 0
275};
276
277/**
278 * Keeps track of the current owner.
279 *
280 * The current owner is the component who should own any components that are
281 * currently being constructed.
282 */
283var ReactCurrentOwner = {
284 /**
285 * @internal
286 * @type {ReactComponent}
287 */
288 current: null
289};
290
291var ReactDebugCurrentFrame = {};
292var currentExtraStackFrame = null;
293function setExtraStackFrame(stack) {
294 {
295 currentExtraStackFrame = stack;
296 }
297}
298
299{
300 ReactDebugCurrentFrame.setExtraStackFrame = function (stack) {
301 {
302 currentExtraStackFrame = stack;
303 }
304 }; // Stack implementation injected by the current renderer.
305
306
307 ReactDebugCurrentFrame.getCurrentStack = null;
308
309 ReactDebugCurrentFrame.getStackAddendum = function () {
310 var stack = ''; // Add an extra top frame while an element is being validated
311
312 if (currentExtraStackFrame) {
313 stack += currentExtraStackFrame;
314 } // Delegate to the injected renderer-specific implementation
315
316
317 var impl = ReactDebugCurrentFrame.getCurrentStack;
318
319 if (impl) {
320 stack += impl() || '';
321 }
322
323 return stack;
324 };
325}
326
327/**
328 * Used by act() to track whether you're inside an act() scope.
329 */
330var IsSomeRendererActing = {
331 current: false
332};
333
334var ReactSharedInternals = {
335 ReactCurrentDispatcher: ReactCurrentDispatcher,
336 ReactCurrentBatchConfig: ReactCurrentBatchConfig,
337 ReactCurrentOwner: ReactCurrentOwner,
338 IsSomeRendererActing: IsSomeRendererActing,
339 // Used by renderers to avoid bundling object-assign twice in UMD bundles:
340 assign: _assign
341};
342
343{
344 ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
345}
346
347// by calls to these methods by a Babel plugin.
348//
349// In PROD (or in packages without access to React internals),
350// they are left as they are instead.
351
352function warn(format) {
353 {
354 for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
355 args[_key - 1] = arguments[_key];
356 }
357
358 printWarning('warn', format, args);
359 }
360}
361function error(format) {
362 {
363 for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
364 args[_key2 - 1] = arguments[_key2];
365 }
366
367 printWarning('error', format, args);
368 }
369}
370
371function printWarning(level, format, args) {
372 // When changing this logic, you might want to also
373 // update consoleWithStackDev.www.js as well.
374 {
375 var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
376 var stack = ReactDebugCurrentFrame.getStackAddendum();
377
378 if (stack !== '') {
379 format += '%s';
380 args = args.concat([stack]);
381 }
382
383 var argsWithFormat = args.map(function (item) {
384 return '' + item;
385 }); // Careful: RN currently depends on this prefix
386
387 argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
388 // breaks IE9: https://github.com/facebook/react/issues/13610
389 // eslint-disable-next-line react-internal/no-production-logging
390
391 Function.prototype.apply.call(console[level], console, argsWithFormat);
392 }
393}
394
395var didWarnStateUpdateForUnmountedComponent = {};
396
397function warnNoop(publicInstance, callerName) {
398 {
399 var _constructor = publicInstance.constructor;
400 var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
401 var warningKey = componentName + "." + callerName;
402
403 if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
404 return;
405 }
406
407 error("Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);
408
409 didWarnStateUpdateForUnmountedComponent[warningKey] = true;
410 }
411}
412/**
413 * This is the abstract API for an update queue.
414 */
415
416
417var ReactNoopUpdateQueue = {
418 /**
419 * Checks whether or not this composite component is mounted.
420 * @param {ReactClass} publicInstance The instance we want to test.
421 * @return {boolean} True if mounted, false otherwise.
422 * @protected
423 * @final
424 */
425 isMounted: function (publicInstance) {
426 return false;
427 },
428
429 /**
430 * Forces an update. This should only be invoked when it is known with
431 * certainty that we are **not** in a DOM transaction.
432 *
433 * You may want to call this when you know that some deeper aspect of the
434 * component's state has changed but `setState` was not called.
435 *
436 * This will not invoke `shouldComponentUpdate`, but it will invoke
437 * `componentWillUpdate` and `componentDidUpdate`.
438 *
439 * @param {ReactClass} publicInstance The instance that should rerender.
440 * @param {?function} callback Called after component is updated.
441 * @param {?string} callerName name of the calling function in the public API.
442 * @internal
443 */
444 enqueueForceUpdate: function (publicInstance, callback, callerName) {
445 warnNoop(publicInstance, 'forceUpdate');
446 },
447
448 /**
449 * Replaces all of the state. Always use this or `setState` to mutate state.
450 * You should treat `this.state` as immutable.
451 *
452 * There is no guarantee that `this.state` will be immediately updated, so
453 * accessing `this.state` after calling this method may return the old value.
454 *
455 * @param {ReactClass} publicInstance The instance that should rerender.
456 * @param {object} completeState Next state.
457 * @param {?function} callback Called after component is updated.
458 * @param {?string} callerName name of the calling function in the public API.
459 * @internal
460 */
461 enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
462 warnNoop(publicInstance, 'replaceState');
463 },
464
465 /**
466 * Sets a subset of the state. This only exists because _pendingState is
467 * internal. This provides a merging strategy that is not available to deep
468 * properties which is confusing. TODO: Expose pendingState or don't use it
469 * during the merge.
470 *
471 * @param {ReactClass} publicInstance The instance that should rerender.
472 * @param {object} partialState Next partial state to be merged with state.
473 * @param {?function} callback Called after component is updated.
474 * @param {?string} Name of the calling function in the public API.
475 * @internal
476 */
477 enqueueSetState: function (publicInstance, partialState, callback, callerName) {
478 warnNoop(publicInstance, 'setState');
479 }
480};
481
482var emptyObject = {};
483
484{
485 Object.freeze(emptyObject);
486}
487/**
488 * Base class helpers for the updating state of a component.
489 */
490
491
492function Component(props, context, updater) {
493 this.props = props;
494 this.context = context; // If a component has string refs, we will assign a different object later.
495
496 this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the
497 // renderer.
498
499 this.updater = updater || ReactNoopUpdateQueue;
500}
501
502Component.prototype.isReactComponent = {};
503/**
504 * Sets a subset of the state. Always use this to mutate
505 * state. You should treat `this.state` as immutable.
506 *
507 * There is no guarantee that `this.state` will be immediately updated, so
508 * accessing `this.state` after calling this method may return the old value.
509 *
510 * There is no guarantee that calls to `setState` will run synchronously,
511 * as they may eventually be batched together. You can provide an optional
512 * callback that will be executed when the call to setState is actually
513 * completed.
514 *
515 * When a function is provided to setState, it will be called at some point in
516 * the future (not synchronously). It will be called with the up to date
517 * component arguments (state, props, context). These values can be different
518 * from this.* because your function may be called after receiveProps but before
519 * shouldComponentUpdate, and this new state, props, and context will not yet be
520 * assigned to this.
521 *
522 * @param {object|function} partialState Next partial state or function to
523 * produce next partial state to be merged with current state.
524 * @param {?function} callback Called after state is updated.
525 * @final
526 * @protected
527 */
528
529Component.prototype.setState = function (partialState, callback) {
530 if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) {
531 {
532 throw Error( "setState(...): takes an object of state variables to update or a function which returns an object of state variables." );
533 }
534 }
535
536 this.updater.enqueueSetState(this, partialState, callback, 'setState');
537};
538/**
539 * Forces an update. This should only be invoked when it is known with
540 * certainty that we are **not** in a DOM transaction.
541 *
542 * You may want to call this when you know that some deeper aspect of the
543 * component's state has changed but `setState` was not called.
544 *
545 * This will not invoke `shouldComponentUpdate`, but it will invoke
546 * `componentWillUpdate` and `componentDidUpdate`.
547 *
548 * @param {?function} callback Called after update is complete.
549 * @final
550 * @protected
551 */
552
553
554Component.prototype.forceUpdate = function (callback) {
555 this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
556};
557/**
558 * Deprecated APIs. These APIs used to exist on classic React classes but since
559 * we would like to deprecate them, we're not going to move them over to this
560 * modern base class. Instead, we define a getter that warns if it's accessed.
561 */
562
563
564{
565 var deprecatedAPIs = {
566 isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
567 replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
568 };
569
570 var defineDeprecationWarning = function (methodName, info) {
571 Object.defineProperty(Component.prototype, methodName, {
572 get: function () {
573 warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
574
575 return undefined;
576 }
577 });
578 };
579
580 for (var fnName in deprecatedAPIs) {
581 if (deprecatedAPIs.hasOwnProperty(fnName)) {
582 defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
583 }
584 }
585}
586
587function ComponentDummy() {}
588
589ComponentDummy.prototype = Component.prototype;
590/**
591 * Convenience component with default shallow equality check for sCU.
592 */
593
594function PureComponent(props, context, updater) {
595 this.props = props;
596 this.context = context; // If a component has string refs, we will assign a different object later.
597
598 this.refs = emptyObject;
599 this.updater = updater || ReactNoopUpdateQueue;
600}
601
602var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
603pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.
604
605_assign(pureComponentPrototype, Component.prototype);
606
607pureComponentPrototype.isPureReactComponent = true;
608
609// an immutable object with a single mutable value
610function createRef() {
611 var refObject = {
612 current: null
613 };
614
615 {
616 Object.seal(refObject);
617 }
618
619 return refObject;
620}
621
622function getWrappedName(outerType, innerType, wrapperName) {
623 var functionName = innerType.displayName || innerType.name || '';
624 return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
625}
626
627function getContextName(type) {
628 return type.displayName || 'Context';
629}
630
631function getComponentName(type) {
632 if (type == null) {
633 // Host root, text node or just invalid type.
634 return null;
635 }
636
637 {
638 if (typeof type.tag === 'number') {
639 error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
640 }
641 }
642
643 if (typeof type === 'function') {
644 return type.displayName || type.name || null;
645 }
646
647 if (typeof type === 'string') {
648 return type;
649 }
650
651 switch (type) {
652 case exports.Fragment:
653 return 'Fragment';
654
655 case REACT_PORTAL_TYPE:
656 return 'Portal';
657
658 case exports.Profiler:
659 return 'Profiler';
660
661 case exports.StrictMode:
662 return 'StrictMode';
663
664 case exports.Suspense:
665 return 'Suspense';
666
667 case REACT_SUSPENSE_LIST_TYPE:
668 return 'SuspenseList';
669 }
670
671 if (typeof type === 'object') {
672 switch (type.$$typeof) {
673 case REACT_CONTEXT_TYPE:
674 var context = type;
675 return getContextName(context) + '.Consumer';
676
677 case REACT_PROVIDER_TYPE:
678 var provider = type;
679 return getContextName(provider._context) + '.Provider';
680
681 case REACT_FORWARD_REF_TYPE:
682 return getWrappedName(type, type.render, 'ForwardRef');
683
684 case REACT_MEMO_TYPE:
685 return getComponentName(type.type);
686
687 case REACT_BLOCK_TYPE:
688 return getComponentName(type._render);
689
690 case REACT_LAZY_TYPE:
691 {
692 var lazyComponent = type;
693 var payload = lazyComponent._payload;
694 var init = lazyComponent._init;
695
696 try {
697 return getComponentName(init(payload));
698 } catch (x) {
699 return null;
700 }
701 }
702 }
703 }
704
705 return null;
706}
707
708var hasOwnProperty = Object.prototype.hasOwnProperty;
709var RESERVED_PROPS = {
710 key: true,
711 ref: true,
712 __self: true,
713 __source: true
714};
715var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
716
717{
718 didWarnAboutStringRefs = {};
719}
720
721function hasValidRef(config) {
722 {
723 if (hasOwnProperty.call(config, 'ref')) {
724 var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
725
726 if (getter && getter.isReactWarning) {
727 return false;
728 }
729 }
730 }
731
732 return config.ref !== undefined;
733}
734
735function hasValidKey(config) {
736 {
737 if (hasOwnProperty.call(config, 'key')) {
738 var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
739
740 if (getter && getter.isReactWarning) {
741 return false;
742 }
743 }
744 }
745
746 return config.key !== undefined;
747}
748
749function defineKeyPropWarningGetter(props, displayName) {
750 var warnAboutAccessingKey = function () {
751 {
752 if (!specialPropKeyWarningShown) {
753 specialPropKeyWarningShown = true;
754
755 error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
756 }
757 }
758 };
759
760 warnAboutAccessingKey.isReactWarning = true;
761 Object.defineProperty(props, 'key', {
762 get: warnAboutAccessingKey,
763 configurable: true
764 });
765}
766
767function defineRefPropWarningGetter(props, displayName) {
768 var warnAboutAccessingRef = function () {
769 {
770 if (!specialPropRefWarningShown) {
771 specialPropRefWarningShown = true;
772
773 error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
774 }
775 }
776 };
777
778 warnAboutAccessingRef.isReactWarning = true;
779 Object.defineProperty(props, 'ref', {
780 get: warnAboutAccessingRef,
781 configurable: true
782 });
783}
784
785function warnIfStringRefCannotBeAutoConverted(config) {
786 {
787 if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
788 var componentName = getComponentName(ReactCurrentOwner.current.type);
789
790 if (!didWarnAboutStringRefs[componentName]) {
791 error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref);
792
793 didWarnAboutStringRefs[componentName] = true;
794 }
795 }
796 }
797}
798/**
799 * Factory method to create a new React element. This no longer adheres to
800 * the class pattern, so do not use new to call it. Also, instanceof check
801 * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
802 * if something is a React Element.
803 *
804 * @param {*} type
805 * @param {*} props
806 * @param {*} key
807 * @param {string|object} ref
808 * @param {*} owner
809 * @param {*} self A *temporary* helper to detect places where `this` is
810 * different from the `owner` when React.createElement is called, so that we
811 * can warn. We want to get rid of owner and replace string `ref`s with arrow
812 * functions, and as long as `this` and owner are the same, there will be no
813 * change in behavior.
814 * @param {*} source An annotation object (added by a transpiler or otherwise)
815 * indicating filename, line number, and/or other information.
816 * @internal
817 */
818
819
820var ReactElement = function (type, key, ref, self, source, owner, props) {
821 var element = {
822 // This tag allows us to uniquely identify this as a React Element
823 $$typeof: REACT_ELEMENT_TYPE,
824 // Built-in properties that belong on the element
825 type: type,
826 key: key,
827 ref: ref,
828 props: props,
829 // Record the component responsible for creating this element.
830 _owner: owner
831 };
832
833 {
834 // The validation flag is currently mutative. We put it on
835 // an external backing store so that we can freeze the whole object.
836 // This can be replaced with a WeakMap once they are implemented in
837 // commonly used development environments.
838 element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
839 // the validation flag non-enumerable (where possible, which should
840 // include every environment we run tests in), so the test framework
841 // ignores it.
842
843 Object.defineProperty(element._store, 'validated', {
844 configurable: false,
845 enumerable: false,
846 writable: true,
847 value: false
848 }); // self and source are DEV only properties.
849
850 Object.defineProperty(element, '_self', {
851 configurable: false,
852 enumerable: false,
853 writable: false,
854 value: self
855 }); // Two elements created in two different places should be considered
856 // equal for testing purposes and therefore we hide it from enumeration.
857
858 Object.defineProperty(element, '_source', {
859 configurable: false,
860 enumerable: false,
861 writable: false,
862 value: source
863 });
864
865 if (Object.freeze) {
866 Object.freeze(element.props);
867 Object.freeze(element);
868 }
869 }
870
871 return element;
872};
873/**
874 * Create and return a new ReactElement of the given type.
875 * See https://reactjs.org/docs/react-api.html#createelement
876 */
877
878function createElement(type, config, children) {
879 var propName; // Reserved names are extracted
880
881 var props = {};
882 var key = null;
883 var ref = null;
884 var self = null;
885 var source = null;
886
887 if (config != null) {
888 if (hasValidRef(config)) {
889 ref = config.ref;
890
891 {
892 warnIfStringRefCannotBeAutoConverted(config);
893 }
894 }
895
896 if (hasValidKey(config)) {
897 key = '' + config.key;
898 }
899
900 self = config.__self === undefined ? null : config.__self;
901 source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object
902
903 for (propName in config) {
904 if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
905 props[propName] = config[propName];
906 }
907 }
908 } // Children can be more than one argument, and those are transferred onto
909 // the newly allocated props object.
910
911
912 var childrenLength = arguments.length - 2;
913
914 if (childrenLength === 1) {
915 props.children = children;
916 } else if (childrenLength > 1) {
917 var childArray = Array(childrenLength);
918
919 for (var i = 0; i < childrenLength; i++) {
920 childArray[i] = arguments[i + 2];
921 }
922
923 {
924 if (Object.freeze) {
925 Object.freeze(childArray);
926 }
927 }
928
929 props.children = childArray;
930 } // Resolve default props
931
932
933 if (type && type.defaultProps) {
934 var defaultProps = type.defaultProps;
935
936 for (propName in defaultProps) {
937 if (props[propName] === undefined) {
938 props[propName] = defaultProps[propName];
939 }
940 }
941 }
942
943 {
944 if (key || ref) {
945 var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
946
947 if (key) {
948 defineKeyPropWarningGetter(props, displayName);
949 }
950
951 if (ref) {
952 defineRefPropWarningGetter(props, displayName);
953 }
954 }
955 }
956
957 return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
958}
959function cloneAndReplaceKey(oldElement, newKey) {
960 var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
961 return newElement;
962}
963/**
964 * Clone and return a new ReactElement using element as the starting point.
965 * See https://reactjs.org/docs/react-api.html#cloneelement
966 */
967
968function cloneElement(element, config, children) {
969 if (!!(element === null || element === undefined)) {
970 {
971 throw Error( "React.cloneElement(...): The argument must be a React element, but you passed " + element + "." );
972 }
973 }
974
975 var propName; // Original props are copied
976
977 var props = _assign({}, element.props); // Reserved names are extracted
978
979
980 var key = element.key;
981 var ref = element.ref; // Self is preserved since the owner is preserved.
982
983 var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a
984 // transpiler, and the original source is probably a better indicator of the
985 // true owner.
986
987 var source = element._source; // Owner will be preserved, unless ref is overridden
988
989 var owner = element._owner;
990
991 if (config != null) {
992 if (hasValidRef(config)) {
993 // Silently steal the ref from the parent.
994 ref = config.ref;
995 owner = ReactCurrentOwner.current;
996 }
997
998 if (hasValidKey(config)) {
999 key = '' + config.key;
1000 } // Remaining properties override existing props
1001
1002
1003 var defaultProps;
1004
1005 if (element.type && element.type.defaultProps) {
1006 defaultProps = element.type.defaultProps;
1007 }
1008
1009 for (propName in config) {
1010 if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
1011 if (config[propName] === undefined && defaultProps !== undefined) {
1012 // Resolve default props
1013 props[propName] = defaultProps[propName];
1014 } else {
1015 props[propName] = config[propName];
1016 }
1017 }
1018 }
1019 } // Children can be more than one argument, and those are transferred onto
1020 // the newly allocated props object.
1021
1022
1023 var childrenLength = arguments.length - 2;
1024
1025 if (childrenLength === 1) {
1026 props.children = children;
1027 } else if (childrenLength > 1) {
1028 var childArray = Array(childrenLength);
1029
1030 for (var i = 0; i < childrenLength; i++) {
1031 childArray[i] = arguments[i + 2];
1032 }
1033
1034 props.children = childArray;
1035 }
1036
1037 return ReactElement(element.type, key, ref, self, source, owner, props);
1038}
1039/**
1040 * Verifies the object is a ReactElement.
1041 * See https://reactjs.org/docs/react-api.html#isvalidelement
1042 * @param {?object} object
1043 * @return {boolean} True if `object` is a ReactElement.
1044 * @final
1045 */
1046
1047function isValidElement(object) {
1048 return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
1049}
1050
1051var SEPARATOR = '.';
1052var SUBSEPARATOR = ':';
1053/**
1054 * Escape and wrap key so it is safe to use as a reactid
1055 *
1056 * @param {string} key to be escaped.
1057 * @return {string} the escaped key.
1058 */
1059
1060function escape(key) {
1061 var escapeRegex = /[=:]/g;
1062 var escaperLookup = {
1063 '=': '=0',
1064 ':': '=2'
1065 };
1066 var escapedString = key.replace(escapeRegex, function (match) {
1067 return escaperLookup[match];
1068 });
1069 return '$' + escapedString;
1070}
1071/**
1072 * TODO: Test that a single child and an array with one item have the same key
1073 * pattern.
1074 */
1075
1076
1077var didWarnAboutMaps = false;
1078var userProvidedKeyEscapeRegex = /\/+/g;
1079
1080function escapeUserProvidedKey(text) {
1081 return text.replace(userProvidedKeyEscapeRegex, '$&/');
1082}
1083/**
1084 * Generate a key string that identifies a element within a set.
1085 *
1086 * @param {*} element A element that could contain a manual key.
1087 * @param {number} index Index that is used if a manual key is not provided.
1088 * @return {string}
1089 */
1090
1091
1092function getElementKey(element, index) {
1093 // Do some typechecking here since we call this blindly. We want to ensure
1094 // that we don't block potential future ES APIs.
1095 if (typeof element === 'object' && element !== null && element.key != null) {
1096 // Explicit key
1097 return escape('' + element.key);
1098 } // Implicit key determined by the index in the set
1099
1100
1101 return index.toString(36);
1102}
1103
1104function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
1105 var type = typeof children;
1106
1107 if (type === 'undefined' || type === 'boolean') {
1108 // All of the above are perceived as null.
1109 children = null;
1110 }
1111
1112 var invokeCallback = false;
1113
1114 if (children === null) {
1115 invokeCallback = true;
1116 } else {
1117 switch (type) {
1118 case 'string':
1119 case 'number':
1120 invokeCallback = true;
1121 break;
1122
1123 case 'object':
1124 switch (children.$$typeof) {
1125 case REACT_ELEMENT_TYPE:
1126 case REACT_PORTAL_TYPE:
1127 invokeCallback = true;
1128 }
1129
1130 }
1131 }
1132
1133 if (invokeCallback) {
1134 var _child = children;
1135 var mappedChild = callback(_child); // If it's the only child, treat the name as if it was wrapped in an array
1136 // so that it's consistent if the number of children grows:
1137
1138 var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;
1139
1140 if (Array.isArray(mappedChild)) {
1141 var escapedChildKey = '';
1142
1143 if (childKey != null) {
1144 escapedChildKey = escapeUserProvidedKey(childKey) + '/';
1145 }
1146
1147 mapIntoArray(mappedChild, array, escapedChildKey, '', function (c) {
1148 return c;
1149 });
1150 } else if (mappedChild != null) {
1151 if (isValidElement(mappedChild)) {
1152 mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as
1153 // traverseAllChildren used to do for objects as children
1154 escapedPrefix + ( // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
1155 mappedChild.key && (!_child || _child.key !== mappedChild.key) ? // $FlowFixMe Flow incorrectly thinks existing element's key can be a number
1156 escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey);
1157 }
1158
1159 array.push(mappedChild);
1160 }
1161
1162 return 1;
1163 }
1164
1165 var child;
1166 var nextName;
1167 var subtreeCount = 0; // Count of children found in the current subtree.
1168
1169 var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
1170
1171 if (Array.isArray(children)) {
1172 for (var i = 0; i < children.length; i++) {
1173 child = children[i];
1174 nextName = nextNamePrefix + getElementKey(child, i);
1175 subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
1176 }
1177 } else {
1178 var iteratorFn = getIteratorFn(children);
1179
1180 if (typeof iteratorFn === 'function') {
1181 var iterableChildren = children;
1182
1183 {
1184 // Warn about using Maps as children
1185 if (iteratorFn === iterableChildren.entries) {
1186 if (!didWarnAboutMaps) {
1187 warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');
1188 }
1189
1190 didWarnAboutMaps = true;
1191 }
1192 }
1193
1194 var iterator = iteratorFn.call(iterableChildren);
1195 var step;
1196 var ii = 0;
1197
1198 while (!(step = iterator.next()).done) {
1199 child = step.value;
1200 nextName = nextNamePrefix + getElementKey(child, ii++);
1201 subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
1202 }
1203 } else if (type === 'object') {
1204 var childrenString = '' + children;
1205
1206 {
1207 {
1208 throw Error( "Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + "). If you meant to render a collection of children, use an array instead." );
1209 }
1210 }
1211 }
1212 }
1213
1214 return subtreeCount;
1215}
1216
1217/**
1218 * Maps children that are typically specified as `props.children`.
1219 *
1220 * See https://reactjs.org/docs/react-api.html#reactchildrenmap
1221 *
1222 * The provided mapFunction(child, index) will be called for each
1223 * leaf child.
1224 *
1225 * @param {?*} children Children tree container.
1226 * @param {function(*, int)} func The map function.
1227 * @param {*} context Context for mapFunction.
1228 * @return {object} Object containing the ordered map of results.
1229 */
1230function mapChildren(children, func, context) {
1231 if (children == null) {
1232 return children;
1233 }
1234
1235 var result = [];
1236 var count = 0;
1237 mapIntoArray(children, result, '', '', function (child) {
1238 return func.call(context, child, count++);
1239 });
1240 return result;
1241}
1242/**
1243 * Count the number of children that are typically specified as
1244 * `props.children`.
1245 *
1246 * See https://reactjs.org/docs/react-api.html#reactchildrencount
1247 *
1248 * @param {?*} children Children tree container.
1249 * @return {number} The number of children.
1250 */
1251
1252
1253function countChildren(children) {
1254 var n = 0;
1255 mapChildren(children, function () {
1256 n++; // Don't return anything
1257 });
1258 return n;
1259}
1260
1261/**
1262 * Iterates through children that are typically specified as `props.children`.
1263 *
1264 * See https://reactjs.org/docs/react-api.html#reactchildrenforeach
1265 *
1266 * The provided forEachFunc(child, index) will be called for each
1267 * leaf child.
1268 *
1269 * @param {?*} children Children tree container.
1270 * @param {function(*, int)} forEachFunc
1271 * @param {*} forEachContext Context for forEachContext.
1272 */
1273function forEachChildren(children, forEachFunc, forEachContext) {
1274 mapChildren(children, function () {
1275 forEachFunc.apply(this, arguments); // Don't return anything.
1276 }, forEachContext);
1277}
1278/**
1279 * Flatten a children object (typically specified as `props.children`) and
1280 * return an array with appropriately re-keyed children.
1281 *
1282 * See https://reactjs.org/docs/react-api.html#reactchildrentoarray
1283 */
1284
1285
1286function toArray(children) {
1287 return mapChildren(children, function (child) {
1288 return child;
1289 }) || [];
1290}
1291/**
1292 * Returns the first child in a collection of children and verifies that there
1293 * is only one child in the collection.
1294 *
1295 * See https://reactjs.org/docs/react-api.html#reactchildrenonly
1296 *
1297 * The current implementation of this function assumes that a single child gets
1298 * passed without a wrapper, but the purpose of this helper function is to
1299 * abstract away the particular structure of children.
1300 *
1301 * @param {?object} children Child collection structure.
1302 * @return {ReactElement} The first and only `ReactElement` contained in the
1303 * structure.
1304 */
1305
1306
1307function onlyChild(children) {
1308 if (!isValidElement(children)) {
1309 {
1310 throw Error( "React.Children.only expected to receive a single React element child." );
1311 }
1312 }
1313
1314 return children;
1315}
1316
1317function createContext(defaultValue, calculateChangedBits) {
1318 if (calculateChangedBits === undefined) {
1319 calculateChangedBits = null;
1320 } else {
1321 {
1322 if (calculateChangedBits !== null && typeof calculateChangedBits !== 'function') {
1323 error('createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits);
1324 }
1325 }
1326 }
1327
1328 var context = {
1329 $$typeof: REACT_CONTEXT_TYPE,
1330 _calculateChangedBits: calculateChangedBits,
1331 // As a workaround to support multiple concurrent renderers, we categorize
1332 // some renderers as primary and others as secondary. We only expect
1333 // there to be two concurrent renderers at most: React Native (primary) and
1334 // Fabric (secondary); React DOM (primary) and React ART (secondary).
1335 // Secondary renderers store their context values on separate fields.
1336 _currentValue: defaultValue,
1337 _currentValue2: defaultValue,
1338 // Used to track how many concurrent renderers this context currently
1339 // supports within in a single renderer. Such as parallel server rendering.
1340 _threadCount: 0,
1341 // These are circular
1342 Provider: null,
1343 Consumer: null
1344 };
1345 context.Provider = {
1346 $$typeof: REACT_PROVIDER_TYPE,
1347 _context: context
1348 };
1349 var hasWarnedAboutUsingNestedContextConsumers = false;
1350 var hasWarnedAboutUsingConsumerProvider = false;
1351 var hasWarnedAboutDisplayNameOnConsumer = false;
1352
1353 {
1354 // A separate object, but proxies back to the original context object for
1355 // backwards compatibility. It has a different $$typeof, so we can properly
1356 // warn for the incorrect usage of Context as a Consumer.
1357 var Consumer = {
1358 $$typeof: REACT_CONTEXT_TYPE,
1359 _context: context,
1360 _calculateChangedBits: context._calculateChangedBits
1361 }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here
1362
1363 Object.defineProperties(Consumer, {
1364 Provider: {
1365 get: function () {
1366 if (!hasWarnedAboutUsingConsumerProvider) {
1367 hasWarnedAboutUsingConsumerProvider = true;
1368
1369 error('Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');
1370 }
1371
1372 return context.Provider;
1373 },
1374 set: function (_Provider) {
1375 context.Provider = _Provider;
1376 }
1377 },
1378 _currentValue: {
1379 get: function () {
1380 return context._currentValue;
1381 },
1382 set: function (_currentValue) {
1383 context._currentValue = _currentValue;
1384 }
1385 },
1386 _currentValue2: {
1387 get: function () {
1388 return context._currentValue2;
1389 },
1390 set: function (_currentValue2) {
1391 context._currentValue2 = _currentValue2;
1392 }
1393 },
1394 _threadCount: {
1395 get: function () {
1396 return context._threadCount;
1397 },
1398 set: function (_threadCount) {
1399 context._threadCount = _threadCount;
1400 }
1401 },
1402 Consumer: {
1403 get: function () {
1404 if (!hasWarnedAboutUsingNestedContextConsumers) {
1405 hasWarnedAboutUsingNestedContextConsumers = true;
1406
1407 error('Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
1408 }
1409
1410 return context.Consumer;
1411 }
1412 },
1413 displayName: {
1414 get: function () {
1415 return context.displayName;
1416 },
1417 set: function (displayName) {
1418 if (!hasWarnedAboutDisplayNameOnConsumer) {
1419 warn('Setting `displayName` on Context.Consumer has no effect. ' + "You should set it directly on the context with Context.displayName = '%s'.", displayName);
1420
1421 hasWarnedAboutDisplayNameOnConsumer = true;
1422 }
1423 }
1424 }
1425 }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty
1426
1427 context.Consumer = Consumer;
1428 }
1429
1430 {
1431 context._currentRenderer = null;
1432 context._currentRenderer2 = null;
1433 }
1434
1435 return context;
1436}
1437
1438var Uninitialized = -1;
1439var Pending = 0;
1440var Resolved = 1;
1441var Rejected = 2;
1442
1443function lazyInitializer(payload) {
1444 if (payload._status === Uninitialized) {
1445 var ctor = payload._result;
1446 var thenable = ctor(); // Transition to the next state.
1447
1448 var pending = payload;
1449 pending._status = Pending;
1450 pending._result = thenable;
1451 thenable.then(function (moduleObject) {
1452 if (payload._status === Pending) {
1453 var defaultExport = moduleObject.default;
1454
1455 {
1456 if (defaultExport === undefined) {
1457 error('lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies.
1458 'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))", moduleObject);
1459 }
1460 } // Transition to the next state.
1461
1462
1463 var resolved = payload;
1464 resolved._status = Resolved;
1465 resolved._result = defaultExport;
1466 }
1467 }, function (error) {
1468 if (payload._status === Pending) {
1469 // Transition to the next state.
1470 var rejected = payload;
1471 rejected._status = Rejected;
1472 rejected._result = error;
1473 }
1474 });
1475 }
1476
1477 if (payload._status === Resolved) {
1478 return payload._result;
1479 } else {
1480 throw payload._result;
1481 }
1482}
1483
1484function lazy(ctor) {
1485 var payload = {
1486 // We use these fields to store the result.
1487 _status: -1,
1488 _result: ctor
1489 };
1490 var lazyType = {
1491 $$typeof: REACT_LAZY_TYPE,
1492 _payload: payload,
1493 _init: lazyInitializer
1494 };
1495
1496 {
1497 // In production, this would just set it on the object.
1498 var defaultProps;
1499 var propTypes; // $FlowFixMe
1500
1501 Object.defineProperties(lazyType, {
1502 defaultProps: {
1503 configurable: true,
1504 get: function () {
1505 return defaultProps;
1506 },
1507 set: function (newDefaultProps) {
1508 error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
1509
1510 defaultProps = newDefaultProps; // Match production behavior more closely:
1511 // $FlowFixMe
1512
1513 Object.defineProperty(lazyType, 'defaultProps', {
1514 enumerable: true
1515 });
1516 }
1517 },
1518 propTypes: {
1519 configurable: true,
1520 get: function () {
1521 return propTypes;
1522 },
1523 set: function (newPropTypes) {
1524 error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
1525
1526 propTypes = newPropTypes; // Match production behavior more closely:
1527 // $FlowFixMe
1528
1529 Object.defineProperty(lazyType, 'propTypes', {
1530 enumerable: true
1531 });
1532 }
1533 }
1534 });
1535 }
1536
1537 return lazyType;
1538}
1539
1540function forwardRef(render) {
1541 {
1542 if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
1543 error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
1544 } else if (typeof render !== 'function') {
1545 error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
1546 } else {
1547 if (render.length !== 0 && render.length !== 2) {
1548 error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.');
1549 }
1550 }
1551
1552 if (render != null) {
1553 if (render.defaultProps != null || render.propTypes != null) {
1554 error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?');
1555 }
1556 }
1557 }
1558
1559 var elementType = {
1560 $$typeof: REACT_FORWARD_REF_TYPE,
1561 render: render
1562 };
1563
1564 {
1565 var ownName;
1566 Object.defineProperty(elementType, 'displayName', {
1567 enumerable: false,
1568 configurable: true,
1569 get: function () {
1570 return ownName;
1571 },
1572 set: function (name) {
1573 ownName = name;
1574
1575 if (render.displayName == null) {
1576 render.displayName = name;
1577 }
1578 }
1579 });
1580 }
1581
1582 return elementType;
1583}
1584
1585// Filter certain DOM attributes (e.g. src, href) if their values are empty strings.
1586
1587var enableScopeAPI = false; // Experimental Create Event Handle API.
1588
1589function isValidElementType(type) {
1590 if (typeof type === 'string' || typeof type === 'function') {
1591 return true;
1592 } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
1593
1594
1595 if (type === exports.Fragment || type === exports.Profiler || type === REACT_DEBUG_TRACING_MODE_TYPE || type === exports.StrictMode || type === exports.Suspense || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) {
1596 return true;
1597 }
1598
1599 if (typeof type === 'object' && type !== null) {
1600 if (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_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {
1601 return true;
1602 }
1603 }
1604
1605 return false;
1606}
1607
1608function memo(type, compare) {
1609 {
1610 if (!isValidElementType(type)) {
1611 error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
1612 }
1613 }
1614
1615 var elementType = {
1616 $$typeof: REACT_MEMO_TYPE,
1617 type: type,
1618 compare: compare === undefined ? null : compare
1619 };
1620
1621 {
1622 var ownName;
1623 Object.defineProperty(elementType, 'displayName', {
1624 enumerable: false,
1625 configurable: true,
1626 get: function () {
1627 return ownName;
1628 },
1629 set: function (name) {
1630 ownName = name;
1631
1632 if (type.displayName == null) {
1633 type.displayName = name;
1634 }
1635 }
1636 });
1637 }
1638
1639 return elementType;
1640}
1641
1642function resolveDispatcher() {
1643 var dispatcher = ReactCurrentDispatcher.current;
1644
1645 if (!(dispatcher !== null)) {
1646 {
1647 throw Error( "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem." );
1648 }
1649 }
1650
1651 return dispatcher;
1652}
1653
1654function useContext(Context, unstable_observedBits) {
1655 var dispatcher = resolveDispatcher();
1656
1657 {
1658 if (unstable_observedBits !== undefined) {
1659 error('useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\n\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://reactjs.org/link/rules-of-hooks' : '');
1660 } // TODO: add a more generic warning for invalid values.
1661
1662
1663 if (Context._context !== undefined) {
1664 var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs
1665 // and nobody should be using this in existing code.
1666
1667 if (realContext.Consumer === Context) {
1668 error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');
1669 } else if (realContext.Provider === Context) {
1670 error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');
1671 }
1672 }
1673 }
1674
1675 return dispatcher.useContext(Context, unstable_observedBits);
1676}
1677function useState(initialState) {
1678 var dispatcher = resolveDispatcher();
1679 return dispatcher.useState(initialState);
1680}
1681function useReducer(reducer, initialArg, init) {
1682 var dispatcher = resolveDispatcher();
1683 return dispatcher.useReducer(reducer, initialArg, init);
1684}
1685function useRef(initialValue) {
1686 var dispatcher = resolveDispatcher();
1687 return dispatcher.useRef(initialValue);
1688}
1689function useEffect(create, deps) {
1690 var dispatcher = resolveDispatcher();
1691 return dispatcher.useEffect(create, deps);
1692}
1693function useLayoutEffect(create, deps) {
1694 var dispatcher = resolveDispatcher();
1695 return dispatcher.useLayoutEffect(create, deps);
1696}
1697function useCallback(callback, deps) {
1698 var dispatcher = resolveDispatcher();
1699 return dispatcher.useCallback(callback, deps);
1700}
1701function useMemo(create, deps) {
1702 var dispatcher = resolveDispatcher();
1703 return dispatcher.useMemo(create, deps);
1704}
1705function useImperativeHandle(ref, create, deps) {
1706 var dispatcher = resolveDispatcher();
1707 return dispatcher.useImperativeHandle(ref, create, deps);
1708}
1709function useDebugValue(value, formatterFn) {
1710 {
1711 var dispatcher = resolveDispatcher();
1712 return dispatcher.useDebugValue(value, formatterFn);
1713 }
1714}
1715
1716// Helpers to patch console.logs to avoid logging during side-effect free
1717// replaying on render function. This currently only patches the object
1718// lazily which won't cover if the log function was extracted eagerly.
1719// We could also eagerly patch the method.
1720var disabledDepth = 0;
1721var prevLog;
1722var prevInfo;
1723var prevWarn;
1724var prevError;
1725var prevGroup;
1726var prevGroupCollapsed;
1727var prevGroupEnd;
1728
1729function disabledLog() {}
1730
1731disabledLog.__reactDisabledLog = true;
1732function disableLogs() {
1733 {
1734 if (disabledDepth === 0) {
1735 /* eslint-disable react-internal/no-production-logging */
1736 prevLog = console.log;
1737 prevInfo = console.info;
1738 prevWarn = console.warn;
1739 prevError = console.error;
1740 prevGroup = console.group;
1741 prevGroupCollapsed = console.groupCollapsed;
1742 prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
1743
1744 var props = {
1745 configurable: true,
1746 enumerable: true,
1747 value: disabledLog,
1748 writable: true
1749 }; // $FlowFixMe Flow thinks console is immutable.
1750
1751 Object.defineProperties(console, {
1752 info: props,
1753 log: props,
1754 warn: props,
1755 error: props,
1756 group: props,
1757 groupCollapsed: props,
1758 groupEnd: props
1759 });
1760 /* eslint-enable react-internal/no-production-logging */
1761 }
1762
1763 disabledDepth++;
1764 }
1765}
1766function reenableLogs() {
1767 {
1768 disabledDepth--;
1769
1770 if (disabledDepth === 0) {
1771 /* eslint-disable react-internal/no-production-logging */
1772 var props = {
1773 configurable: true,
1774 enumerable: true,
1775 writable: true
1776 }; // $FlowFixMe Flow thinks console is immutable.
1777
1778 Object.defineProperties(console, {
1779 log: _assign({}, props, {
1780 value: prevLog
1781 }),
1782 info: _assign({}, props, {
1783 value: prevInfo
1784 }),
1785 warn: _assign({}, props, {
1786 value: prevWarn
1787 }),
1788 error: _assign({}, props, {
1789 value: prevError
1790 }),
1791 group: _assign({}, props, {
1792 value: prevGroup
1793 }),
1794 groupCollapsed: _assign({}, props, {
1795 value: prevGroupCollapsed
1796 }),
1797 groupEnd: _assign({}, props, {
1798 value: prevGroupEnd
1799 })
1800 });
1801 /* eslint-enable react-internal/no-production-logging */
1802 }
1803
1804 if (disabledDepth < 0) {
1805 error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
1806 }
1807 }
1808}
1809
1810var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
1811var prefix;
1812function describeBuiltInComponentFrame(name, source, ownerFn) {
1813 {
1814 if (prefix === undefined) {
1815 // Extract the VM specific prefix used by each line.
1816 try {
1817 throw Error();
1818 } catch (x) {
1819 var match = x.stack.trim().match(/\n( *(at )?)/);
1820 prefix = match && match[1] || '';
1821 }
1822 } // We use the prefix to ensure our stacks line up with native stack frames.
1823
1824
1825 return '\n' + prefix + name;
1826 }
1827}
1828var reentry = false;
1829var componentFrameCache;
1830
1831{
1832 var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
1833 componentFrameCache = new PossiblyWeakMap();
1834}
1835
1836function describeNativeComponentFrame(fn, construct) {
1837 // If something asked for a stack inside a fake render, it should get ignored.
1838 if (!fn || reentry) {
1839 return '';
1840 }
1841
1842 {
1843 var frame = componentFrameCache.get(fn);
1844
1845 if (frame !== undefined) {
1846 return frame;
1847 }
1848 }
1849
1850 var control;
1851 reentry = true;
1852 var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
1853
1854 Error.prepareStackTrace = undefined;
1855 var previousDispatcher;
1856
1857 {
1858 previousDispatcher = ReactCurrentDispatcher$1.current; // Set the dispatcher in DEV because this might be call in the render function
1859 // for warnings.
1860
1861 ReactCurrentDispatcher$1.current = null;
1862 disableLogs();
1863 }
1864
1865 try {
1866 // This should throw.
1867 if (construct) {
1868 // Something should be setting the props in the constructor.
1869 var Fake = function () {
1870 throw Error();
1871 }; // $FlowFixMe
1872
1873
1874 Object.defineProperty(Fake.prototype, 'props', {
1875 set: function () {
1876 // We use a throwing setter instead of frozen or non-writable props
1877 // because that won't throw in a non-strict mode function.
1878 throw Error();
1879 }
1880 });
1881
1882 if (typeof Reflect === 'object' && Reflect.construct) {
1883 // We construct a different control for this case to include any extra
1884 // frames added by the construct call.
1885 try {
1886 Reflect.construct(Fake, []);
1887 } catch (x) {
1888 control = x;
1889 }
1890
1891 Reflect.construct(fn, [], Fake);
1892 } else {
1893 try {
1894 Fake.call();
1895 } catch (x) {
1896 control = x;
1897 }
1898
1899 fn.call(Fake.prototype);
1900 }
1901 } else {
1902 try {
1903 throw Error();
1904 } catch (x) {
1905 control = x;
1906 }
1907
1908 fn();
1909 }
1910 } catch (sample) {
1911 // This is inlined manually because closure doesn't do it for us.
1912 if (sample && control && typeof sample.stack === 'string') {
1913 // This extracts the first frame from the sample that isn't also in the control.
1914 // Skipping one frame that we assume is the frame that calls the two.
1915 var sampleLines = sample.stack.split('\n');
1916 var controlLines = control.stack.split('\n');
1917 var s = sampleLines.length - 1;
1918 var c = controlLines.length - 1;
1919
1920 while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
1921 // We expect at least one stack frame to be shared.
1922 // Typically this will be the root most one. However, stack frames may be
1923 // cut off due to maximum stack limits. In this case, one maybe cut off
1924 // earlier than the other. We assume that the sample is longer or the same
1925 // and there for cut off earlier. So we should find the root most frame in
1926 // the sample somewhere in the control.
1927 c--;
1928 }
1929
1930 for (; s >= 1 && c >= 0; s--, c--) {
1931 // Next we find the first one that isn't the same which should be the
1932 // frame that called our sample function and the control.
1933 if (sampleLines[s] !== controlLines[c]) {
1934 // In V8, the first line is describing the message but other VMs don't.
1935 // If we're about to return the first line, and the control is also on the same
1936 // line, that's a pretty good indicator that our sample threw at same line as
1937 // the control. I.e. before we entered the sample frame. So we ignore this result.
1938 // This can happen if you passed a class to function component, or non-function.
1939 if (s !== 1 || c !== 1) {
1940 do {
1941 s--;
1942 c--; // We may still have similar intermediate frames from the construct call.
1943 // The next one that isn't the same should be our match though.
1944
1945 if (c < 0 || sampleLines[s] !== controlLines[c]) {
1946 // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
1947 var _frame = '\n' + sampleLines[s].replace(' at new ', ' at ');
1948
1949 {
1950 if (typeof fn === 'function') {
1951 componentFrameCache.set(fn, _frame);
1952 }
1953 } // Return the line we found.
1954
1955
1956 return _frame;
1957 }
1958 } while (s >= 1 && c >= 0);
1959 }
1960
1961 break;
1962 }
1963 }
1964 }
1965 } finally {
1966 reentry = false;
1967
1968 {
1969 ReactCurrentDispatcher$1.current = previousDispatcher;
1970 reenableLogs();
1971 }
1972
1973 Error.prepareStackTrace = previousPrepareStackTrace;
1974 } // Fallback to just using the name if we couldn't make it throw.
1975
1976
1977 var name = fn ? fn.displayName || fn.name : '';
1978 var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
1979
1980 {
1981 if (typeof fn === 'function') {
1982 componentFrameCache.set(fn, syntheticFrame);
1983 }
1984 }
1985
1986 return syntheticFrame;
1987}
1988function describeFunctionComponentFrame(fn, source, ownerFn) {
1989 {
1990 return describeNativeComponentFrame(fn, false);
1991 }
1992}
1993
1994function shouldConstruct(Component) {
1995 var prototype = Component.prototype;
1996 return !!(prototype && prototype.isReactComponent);
1997}
1998
1999function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
2000
2001 if (type == null) {
2002 return '';
2003 }
2004
2005 if (typeof type === 'function') {
2006 {
2007 return describeNativeComponentFrame(type, shouldConstruct(type));
2008 }
2009 }
2010
2011 if (typeof type === 'string') {
2012 return describeBuiltInComponentFrame(type);
2013 }
2014
2015 switch (type) {
2016 case exports.Suspense:
2017 return describeBuiltInComponentFrame('Suspense');
2018
2019 case REACT_SUSPENSE_LIST_TYPE:
2020 return describeBuiltInComponentFrame('SuspenseList');
2021 }
2022
2023 if (typeof type === 'object') {
2024 switch (type.$$typeof) {
2025 case REACT_FORWARD_REF_TYPE:
2026 return describeFunctionComponentFrame(type.render);
2027
2028 case REACT_MEMO_TYPE:
2029 // Memo may contain any component type so we recursively resolve it.
2030 return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
2031
2032 case REACT_BLOCK_TYPE:
2033 return describeFunctionComponentFrame(type._render);
2034
2035 case REACT_LAZY_TYPE:
2036 {
2037 var lazyComponent = type;
2038 var payload = lazyComponent._payload;
2039 var init = lazyComponent._init;
2040
2041 try {
2042 // Lazy may contain any component type so we recursively resolve it.
2043 return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
2044 } catch (x) {}
2045 }
2046 }
2047 }
2048
2049 return '';
2050}
2051
2052var loggedTypeFailures = {};
2053var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
2054
2055function setCurrentlyValidatingElement(element) {
2056 {
2057 if (element) {
2058 var owner = element._owner;
2059 var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
2060 ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
2061 } else {
2062 ReactDebugCurrentFrame$1.setExtraStackFrame(null);
2063 }
2064 }
2065}
2066
2067function checkPropTypes(typeSpecs, values, location, componentName, element) {
2068 {
2069 // $FlowFixMe This is okay but Flow doesn't know it.
2070 var has = Function.call.bind(Object.prototype.hasOwnProperty);
2071
2072 for (var typeSpecName in typeSpecs) {
2073 if (has(typeSpecs, typeSpecName)) {
2074 var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
2075 // fail the render phase where it didn't fail before. So we log it.
2076 // After these have been cleaned up, we'll let them throw.
2077
2078 try {
2079 // This is intentionally an invariant that gets caught. It's the same
2080 // behavior as without this statement except with a better message.
2081 if (typeof typeSpecs[typeSpecName] !== 'function') {
2082 var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
2083 err.name = 'Invariant Violation';
2084 throw err;
2085 }
2086
2087 error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
2088 } catch (ex) {
2089 error$1 = ex;
2090 }
2091
2092 if (error$1 && !(error$1 instanceof Error)) {
2093 setCurrentlyValidatingElement(element);
2094
2095 error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);
2096
2097 setCurrentlyValidatingElement(null);
2098 }
2099
2100 if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
2101 // Only monitor this failure once because there tends to be a lot of the
2102 // same error.
2103 loggedTypeFailures[error$1.message] = true;
2104 setCurrentlyValidatingElement(element);
2105
2106 error('Failed %s type: %s', location, error$1.message);
2107
2108 setCurrentlyValidatingElement(null);
2109 }
2110 }
2111 }
2112 }
2113}
2114
2115function setCurrentlyValidatingElement$1(element) {
2116 {
2117 if (element) {
2118 var owner = element._owner;
2119 var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
2120 setExtraStackFrame(stack);
2121 } else {
2122 setExtraStackFrame(null);
2123 }
2124 }
2125}
2126
2127var propTypesMisspellWarningShown;
2128
2129{
2130 propTypesMisspellWarningShown = false;
2131}
2132
2133function getDeclarationErrorAddendum() {
2134 if (ReactCurrentOwner.current) {
2135 var name = getComponentName(ReactCurrentOwner.current.type);
2136
2137 if (name) {
2138 return '\n\nCheck the render method of `' + name + '`.';
2139 }
2140 }
2141
2142 return '';
2143}
2144
2145function getSourceInfoErrorAddendum(source) {
2146 if (source !== undefined) {
2147 var fileName = source.fileName.replace(/^.*[\\\/]/, '');
2148 var lineNumber = source.lineNumber;
2149 return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
2150 }
2151
2152 return '';
2153}
2154
2155function getSourceInfoErrorAddendumForProps(elementProps) {
2156 if (elementProps !== null && elementProps !== undefined) {
2157 return getSourceInfoErrorAddendum(elementProps.__source);
2158 }
2159
2160 return '';
2161}
2162/**
2163 * Warn if there's no key explicitly set on dynamic arrays of children or
2164 * object keys are not valid. This allows us to keep track of children between
2165 * updates.
2166 */
2167
2168
2169var ownerHasKeyUseWarning = {};
2170
2171function getCurrentComponentErrorInfo(parentType) {
2172 var info = getDeclarationErrorAddendum();
2173
2174 if (!info) {
2175 var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
2176
2177 if (parentName) {
2178 info = "\n\nCheck the top-level render call using <" + parentName + ">.";
2179 }
2180 }
2181
2182 return info;
2183}
2184/**
2185 * Warn if the element doesn't have an explicit key assigned to it.
2186 * This element is in an array. The array could grow and shrink or be
2187 * reordered. All children that haven't already been validated are required to
2188 * have a "key" property assigned to it. Error statuses are cached so a warning
2189 * will only be shown once.
2190 *
2191 * @internal
2192 * @param {ReactElement} element Element that requires a key.
2193 * @param {*} parentType element's parent's type.
2194 */
2195
2196
2197function validateExplicitKey(element, parentType) {
2198 if (!element._store || element._store.validated || element.key != null) {
2199 return;
2200 }
2201
2202 element._store.validated = true;
2203 var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
2204
2205 if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
2206 return;
2207 }
2208
2209 ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
2210 // property, it may be the creator of the child that's responsible for
2211 // assigning it a key.
2212
2213 var childOwner = '';
2214
2215 if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
2216 // Give the component that originally created this child.
2217 childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
2218 }
2219
2220 {
2221 setCurrentlyValidatingElement$1(element);
2222
2223 error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
2224
2225 setCurrentlyValidatingElement$1(null);
2226 }
2227}
2228/**
2229 * Ensure that every element either is passed in a static location, in an
2230 * array with an explicit keys property defined, or in an object literal
2231 * with valid key property.
2232 *
2233 * @internal
2234 * @param {ReactNode} node Statically passed child of any type.
2235 * @param {*} parentType node's parent's type.
2236 */
2237
2238
2239function validateChildKeys(node, parentType) {
2240 if (typeof node !== 'object') {
2241 return;
2242 }
2243
2244 if (Array.isArray(node)) {
2245 for (var i = 0; i < node.length; i++) {
2246 var child = node[i];
2247
2248 if (isValidElement(child)) {
2249 validateExplicitKey(child, parentType);
2250 }
2251 }
2252 } else if (isValidElement(node)) {
2253 // This element was passed in a valid location.
2254 if (node._store) {
2255 node._store.validated = true;
2256 }
2257 } else if (node) {
2258 var iteratorFn = getIteratorFn(node);
2259
2260 if (typeof iteratorFn === 'function') {
2261 // Entry iterators used to provide implicit keys,
2262 // but now we print a separate warning for them later.
2263 if (iteratorFn !== node.entries) {
2264 var iterator = iteratorFn.call(node);
2265 var step;
2266
2267 while (!(step = iterator.next()).done) {
2268 if (isValidElement(step.value)) {
2269 validateExplicitKey(step.value, parentType);
2270 }
2271 }
2272 }
2273 }
2274 }
2275}
2276/**
2277 * Given an element, validate that its props follow the propTypes definition,
2278 * provided by the type.
2279 *
2280 * @param {ReactElement} element
2281 */
2282
2283
2284function validatePropTypes(element) {
2285 {
2286 var type = element.type;
2287
2288 if (type === null || type === undefined || typeof type === 'string') {
2289 return;
2290 }
2291
2292 var propTypes;
2293
2294 if (typeof type === 'function') {
2295 propTypes = type.propTypes;
2296 } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
2297 // Inner props are checked in the reconciler.
2298 type.$$typeof === REACT_MEMO_TYPE)) {
2299 propTypes = type.propTypes;
2300 } else {
2301 return;
2302 }
2303
2304 if (propTypes) {
2305 // Intentionally inside to avoid triggering lazy initializers:
2306 var name = getComponentName(type);
2307 checkPropTypes(propTypes, element.props, 'prop', name, element);
2308 } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
2309 propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
2310
2311 var _name = getComponentName(type);
2312
2313 error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
2314 }
2315
2316 if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
2317 error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
2318 }
2319 }
2320}
2321/**
2322 * Given a fragment, validate that it can only be provided with fragment props
2323 * @param {ReactElement} fragment
2324 */
2325
2326
2327function validateFragmentProps(fragment) {
2328 {
2329 var keys = Object.keys(fragment.props);
2330
2331 for (var i = 0; i < keys.length; i++) {
2332 var key = keys[i];
2333
2334 if (key !== 'children' && key !== 'key') {
2335 setCurrentlyValidatingElement$1(fragment);
2336
2337 error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
2338
2339 setCurrentlyValidatingElement$1(null);
2340 break;
2341 }
2342 }
2343
2344 if (fragment.ref !== null) {
2345 setCurrentlyValidatingElement$1(fragment);
2346
2347 error('Invalid attribute `ref` supplied to `React.Fragment`.');
2348
2349 setCurrentlyValidatingElement$1(null);
2350 }
2351 }
2352}
2353function createElementWithValidation(type, props, children) {
2354 var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
2355 // succeed and there will likely be errors in render.
2356
2357 if (!validType) {
2358 var info = '';
2359
2360 if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
2361 info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
2362 }
2363
2364 var sourceInfo = getSourceInfoErrorAddendumForProps(props);
2365
2366 if (sourceInfo) {
2367 info += sourceInfo;
2368 } else {
2369 info += getDeclarationErrorAddendum();
2370 }
2371
2372 var typeString;
2373
2374 if (type === null) {
2375 typeString = 'null';
2376 } else if (Array.isArray(type)) {
2377 typeString = 'array';
2378 } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
2379 typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
2380 info = ' Did you accidentally export a JSX literal instead of a component?';
2381 } else {
2382 typeString = typeof type;
2383 }
2384
2385 {
2386 error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
2387 }
2388 }
2389
2390 var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.
2391 // TODO: Drop this when these are no longer allowed as the type argument.
2392
2393 if (element == null) {
2394 return element;
2395 } // Skip key warning if the type isn't valid since our key validation logic
2396 // doesn't expect a non-string/function type and can throw confusing errors.
2397 // We don't want exception behavior to differ between dev and prod.
2398 // (Rendering will throw with a helpful message and as soon as the type is
2399 // fixed, the key warnings will appear.)
2400
2401
2402 if (validType) {
2403 for (var i = 2; i < arguments.length; i++) {
2404 validateChildKeys(arguments[i], type);
2405 }
2406 }
2407
2408 if (type === exports.Fragment) {
2409 validateFragmentProps(element);
2410 } else {
2411 validatePropTypes(element);
2412 }
2413
2414 return element;
2415}
2416var didWarnAboutDeprecatedCreateFactory = false;
2417function createFactoryWithValidation(type) {
2418 var validatedFactory = createElementWithValidation.bind(null, type);
2419 validatedFactory.type = type;
2420
2421 {
2422 if (!didWarnAboutDeprecatedCreateFactory) {
2423 didWarnAboutDeprecatedCreateFactory = true;
2424
2425 warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.');
2426 } // Legacy hook: remove it
2427
2428
2429 Object.defineProperty(validatedFactory, 'type', {
2430 enumerable: false,
2431 get: function () {
2432 warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
2433
2434 Object.defineProperty(this, 'type', {
2435 value: type
2436 });
2437 return type;
2438 }
2439 });
2440 }
2441
2442 return validatedFactory;
2443}
2444function cloneElementWithValidation(element, props, children) {
2445 var newElement = cloneElement.apply(this, arguments);
2446
2447 for (var i = 2; i < arguments.length; i++) {
2448 validateChildKeys(arguments[i], newElement.type);
2449 }
2450
2451 validatePropTypes(newElement);
2452 return newElement;
2453}
2454
2455{
2456
2457 try {
2458 var frozenObject = Object.freeze({});
2459 /* eslint-disable no-new */
2460
2461 new Map([[frozenObject, null]]);
2462 new Set([frozenObject]);
2463 /* eslint-enable no-new */
2464 } catch (e) {
2465 }
2466}
2467
2468var createElement$1 = createElementWithValidation ;
2469var cloneElement$1 = cloneElementWithValidation ;
2470var createFactory = createFactoryWithValidation ;
2471var Children = {
2472 map: mapChildren,
2473 forEach: forEachChildren,
2474 count: countChildren,
2475 toArray: toArray,
2476 only: onlyChild
2477};
2478
2479exports.Children = Children;
2480exports.Component = Component;
2481exports.PureComponent = PureComponent;
2482exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
2483exports.cloneElement = cloneElement$1;
2484exports.createContext = createContext;
2485exports.createElement = createElement$1;
2486exports.createFactory = createFactory;
2487exports.createRef = createRef;
2488exports.forwardRef = forwardRef;
2489exports.isValidElement = isValidElement;
2490exports.lazy = lazy;
2491exports.memo = memo;
2492exports.useCallback = useCallback;
2493exports.useContext = useContext;
2494exports.useDebugValue = useDebugValue;
2495exports.useEffect = useEffect;
2496exports.useImperativeHandle = useImperativeHandle;
2497exports.useLayoutEffect = useLayoutEffect;
2498exports.useMemo = useMemo;
2499exports.useReducer = useReducer;
2500exports.useRef = useRef;
2501exports.useState = useState;
2502exports.version = ReactVersion;
2503 })();
2504}
2505}(react_development));
2506
2507if (process.env.NODE_ENV === 'production') {
2508 react.exports = react_production_min;
2509} else {
2510 react.exports = react_development;
2511}
2512
2513function useAnimation(ref, target, options) {
2514 var prevTarget = react.exports.useRef({});
2515 react.exports.useEffect(function () {
2516 if (!target)
2517 return;
2518 var targetKeyframe = {};
2519 for (var key in target) {
2520 if (target !== prevTarget.current[key]) {
2521 targetKeyframe[key] = target[key];
2522 }
2523 }
2524 if (Object.keys(targetKeyframe).length && ref.current) {
2525 animate(ref.current, targetKeyframe, options);
2526 }
2527 prevTarget.current = target;
2528 });
2529}
2530function useInitialRender() {
2531 var isInitialRender = react.exports.useRef(true);
2532 react.exports.useEffect(function () {
2533 isInitialRender.current = false;
2534 }, []);
2535 return isInitialRender.current;
2536}
2537function createAnimatedComponent(Component) {
2538 function Animated(_a, _externalRef) {
2539 var options = _a.options, style = _a.style, first = _a.first, props = tslib.__rest(_a, ["options", "style", "first"]);
2540 var ref = react.exports.useRef(null);
2541 useAnimation(ref, style, options);
2542 var isInitialRender = useInitialRender();
2543 return react.exports.createElement(Component, tslib.__assign(tslib.__assign({}, props), { style: isInitialRender && first ? first : style, ref: ref }));
2544 }
2545 return react.exports.forwardRef(Animated);
2546}
2547var components = new Map();
2548var animated = new Proxy({}, {
2549 get: function (_, key) {
2550 if (!components.has(key)) {
2551 components.set(key, createAnimatedComponent(key));
2552 }
2553 return components.get(key);
2554 },
2555});
2556
2557exports.animate = animate;
2558exports.animated = animated;
2559exports.useAnimation = useAnimation;