UNPKG

55.9 kBJavaScriptView Raw
1/**
2 * @license React
3 * react.development.js
4 *
5 * Copyright (c) Meta Platforms, Inc. and affiliates.
6 *
7 * This source code is licensed under the MIT license found in the
8 * LICENSE file in the root directory of this source tree.
9 */
10
11"use strict";
12"production" !== process.env.NODE_ENV &&
13 (function () {
14 function defineDeprecationWarning(methodName, info) {
15 Object.defineProperty(Component.prototype, methodName, {
16 get: function () {
17 console.warn(
18 "%s(...) is deprecated in plain JavaScript React classes. %s",
19 info[0],
20 info[1]
21 );
22 }
23 });
24 }
25 function getIteratorFn(maybeIterable) {
26 if (null === maybeIterable || "object" !== typeof maybeIterable)
27 return null;
28 maybeIterable =
29 (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
30 maybeIterable["@@iterator"];
31 return "function" === typeof maybeIterable ? maybeIterable : null;
32 }
33 function warnNoop(publicInstance, callerName) {
34 publicInstance =
35 ((publicInstance = publicInstance.constructor) &&
36 (publicInstance.displayName || publicInstance.name)) ||
37 "ReactClass";
38 var warningKey = publicInstance + "." + callerName;
39 didWarnStateUpdateForUnmountedComponent[warningKey] ||
40 (console.error(
41 "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.",
42 callerName,
43 publicInstance
44 ),
45 (didWarnStateUpdateForUnmountedComponent[warningKey] = !0));
46 }
47 function Component(props, context, updater) {
48 this.props = props;
49 this.context = context;
50 this.refs = emptyObject;
51 this.updater = updater || ReactNoopUpdateQueue;
52 }
53 function ComponentDummy() {}
54 function PureComponent(props, context, updater) {
55 this.props = props;
56 this.context = context;
57 this.refs = emptyObject;
58 this.updater = updater || ReactNoopUpdateQueue;
59 }
60 function testStringCoercion(value) {
61 return "" + value;
62 }
63 function checkKeyStringCoercion(value) {
64 try {
65 testStringCoercion(value);
66 var JSCompiler_inline_result = !1;
67 } catch (e) {
68 JSCompiler_inline_result = !0;
69 }
70 if (JSCompiler_inline_result) {
71 JSCompiler_inline_result = console;
72 var JSCompiler_temp_const = JSCompiler_inline_result.error;
73 var JSCompiler_inline_result$jscomp$0 =
74 ("function" === typeof Symbol &&
75 Symbol.toStringTag &&
76 value[Symbol.toStringTag]) ||
77 value.constructor.name ||
78 "Object";
79 JSCompiler_temp_const.call(
80 JSCompiler_inline_result,
81 "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
82 JSCompiler_inline_result$jscomp$0
83 );
84 return testStringCoercion(value);
85 }
86 }
87 function getComponentNameFromType(type) {
88 if (null == type) return null;
89 if ("function" === typeof type)
90 return type.$$typeof === REACT_CLIENT_REFERENCE$2
91 ? null
92 : type.displayName || type.name || null;
93 if ("string" === typeof type) return type;
94 switch (type) {
95 case REACT_FRAGMENT_TYPE:
96 return "Fragment";
97 case REACT_PORTAL_TYPE:
98 return "Portal";
99 case REACT_PROFILER_TYPE:
100 return "Profiler";
101 case REACT_STRICT_MODE_TYPE:
102 return "StrictMode";
103 case REACT_SUSPENSE_TYPE:
104 return "Suspense";
105 case REACT_SUSPENSE_LIST_TYPE:
106 return "SuspenseList";
107 }
108 if ("object" === typeof type)
109 switch (
110 ("number" === typeof type.tag &&
111 console.error(
112 "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
113 ),
114 type.$$typeof)
115 ) {
116 case REACT_CONTEXT_TYPE:
117 return (type.displayName || "Context") + ".Provider";
118 case REACT_CONSUMER_TYPE:
119 return (type._context.displayName || "Context") + ".Consumer";
120 case REACT_FORWARD_REF_TYPE:
121 var innerType = type.render;
122 type = type.displayName;
123 type ||
124 ((type = innerType.displayName || innerType.name || ""),
125 (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
126 return type;
127 case REACT_MEMO_TYPE:
128 return (
129 (innerType = type.displayName || null),
130 null !== innerType
131 ? innerType
132 : getComponentNameFromType(type.type) || "Memo"
133 );
134 case REACT_LAZY_TYPE:
135 innerType = type._payload;
136 type = type._init;
137 try {
138 return getComponentNameFromType(type(innerType));
139 } catch (x) {}
140 }
141 return null;
142 }
143 function isValidElementType(type) {
144 return "string" === typeof type ||
145 "function" === typeof type ||
146 type === REACT_FRAGMENT_TYPE ||
147 type === REACT_PROFILER_TYPE ||
148 type === REACT_STRICT_MODE_TYPE ||
149 type === REACT_SUSPENSE_TYPE ||
150 type === REACT_SUSPENSE_LIST_TYPE ||
151 type === REACT_OFFSCREEN_TYPE ||
152 ("object" === typeof type &&
153 null !== type &&
154 (type.$$typeof === REACT_LAZY_TYPE ||
155 type.$$typeof === REACT_MEMO_TYPE ||
156 type.$$typeof === REACT_CONTEXT_TYPE ||
157 type.$$typeof === REACT_CONSUMER_TYPE ||
158 type.$$typeof === REACT_FORWARD_REF_TYPE ||
159 type.$$typeof === REACT_CLIENT_REFERENCE$1 ||
160 void 0 !== type.getModuleId))
161 ? !0
162 : !1;
163 }
164 function disabledLog() {}
165 function disableLogs() {
166 if (0 === disabledDepth) {
167 prevLog = console.log;
168 prevInfo = console.info;
169 prevWarn = console.warn;
170 prevError = console.error;
171 prevGroup = console.group;
172 prevGroupCollapsed = console.groupCollapsed;
173 prevGroupEnd = console.groupEnd;
174 var props = {
175 configurable: !0,
176 enumerable: !0,
177 value: disabledLog,
178 writable: !0
179 };
180 Object.defineProperties(console, {
181 info: props,
182 log: props,
183 warn: props,
184 error: props,
185 group: props,
186 groupCollapsed: props,
187 groupEnd: props
188 });
189 }
190 disabledDepth++;
191 }
192 function reenableLogs() {
193 disabledDepth--;
194 if (0 === disabledDepth) {
195 var props = { configurable: !0, enumerable: !0, writable: !0 };
196 Object.defineProperties(console, {
197 log: assign({}, props, { value: prevLog }),
198 info: assign({}, props, { value: prevInfo }),
199 warn: assign({}, props, { value: prevWarn }),
200 error: assign({}, props, { value: prevError }),
201 group: assign({}, props, { value: prevGroup }),
202 groupCollapsed: assign({}, props, { value: prevGroupCollapsed }),
203 groupEnd: assign({}, props, { value: prevGroupEnd })
204 });
205 }
206 0 > disabledDepth &&
207 console.error(
208 "disabledDepth fell below zero. This is a bug in React. Please file an issue."
209 );
210 }
211 function describeBuiltInComponentFrame(name) {
212 if (void 0 === prefix)
213 try {
214 throw Error();
215 } catch (x) {
216 var match = x.stack.trim().match(/\n( *(at )?)/);
217 prefix = (match && match[1]) || "";
218 suffix =
219 -1 < x.stack.indexOf("\n at")
220 ? " (<anonymous>)"
221 : -1 < x.stack.indexOf("@")
222 ? "@unknown:0:0"
223 : "";
224 }
225 return "\n" + prefix + name + suffix;
226 }
227 function describeNativeComponentFrame(fn, construct) {
228 if (!fn || reentry) return "";
229 var frame = componentFrameCache.get(fn);
230 if (void 0 !== frame) return frame;
231 reentry = !0;
232 frame = Error.prepareStackTrace;
233 Error.prepareStackTrace = void 0;
234 var previousDispatcher = null;
235 previousDispatcher = ReactSharedInternals.H;
236 ReactSharedInternals.H = null;
237 disableLogs();
238 try {
239 var RunInRootFrame = {
240 DetermineComponentFrameRoot: function () {
241 try {
242 if (construct) {
243 var Fake = function () {
244 throw Error();
245 };
246 Object.defineProperty(Fake.prototype, "props", {
247 set: function () {
248 throw Error();
249 }
250 });
251 if ("object" === typeof Reflect && Reflect.construct) {
252 try {
253 Reflect.construct(Fake, []);
254 } catch (x) {
255 var control = x;
256 }
257 Reflect.construct(fn, [], Fake);
258 } else {
259 try {
260 Fake.call();
261 } catch (x$0) {
262 control = x$0;
263 }
264 fn.call(Fake.prototype);
265 }
266 } else {
267 try {
268 throw Error();
269 } catch (x$1) {
270 control = x$1;
271 }
272 (Fake = fn()) &&
273 "function" === typeof Fake.catch &&
274 Fake.catch(function () {});
275 }
276 } catch (sample) {
277 if (sample && control && "string" === typeof sample.stack)
278 return [sample.stack, control.stack];
279 }
280 return [null, null];
281 }
282 };
283 RunInRootFrame.DetermineComponentFrameRoot.displayName =
284 "DetermineComponentFrameRoot";
285 var namePropDescriptor = Object.getOwnPropertyDescriptor(
286 RunInRootFrame.DetermineComponentFrameRoot,
287 "name"
288 );
289 namePropDescriptor &&
290 namePropDescriptor.configurable &&
291 Object.defineProperty(
292 RunInRootFrame.DetermineComponentFrameRoot,
293 "name",
294 { value: "DetermineComponentFrameRoot" }
295 );
296 var _RunInRootFrame$Deter =
297 RunInRootFrame.DetermineComponentFrameRoot(),
298 sampleStack = _RunInRootFrame$Deter[0],
299 controlStack = _RunInRootFrame$Deter[1];
300 if (sampleStack && controlStack) {
301 var sampleLines = sampleStack.split("\n"),
302 controlLines = controlStack.split("\n");
303 for (
304 _RunInRootFrame$Deter = namePropDescriptor = 0;
305 namePropDescriptor < sampleLines.length &&
306 !sampleLines[namePropDescriptor].includes(
307 "DetermineComponentFrameRoot"
308 );
309
310 )
311 namePropDescriptor++;
312 for (
313 ;
314 _RunInRootFrame$Deter < controlLines.length &&
315 !controlLines[_RunInRootFrame$Deter].includes(
316 "DetermineComponentFrameRoot"
317 );
318
319 )
320 _RunInRootFrame$Deter++;
321 if (
322 namePropDescriptor === sampleLines.length ||
323 _RunInRootFrame$Deter === controlLines.length
324 )
325 for (
326 namePropDescriptor = sampleLines.length - 1,
327 _RunInRootFrame$Deter = controlLines.length - 1;
328 1 <= namePropDescriptor &&
329 0 <= _RunInRootFrame$Deter &&
330 sampleLines[namePropDescriptor] !==
331 controlLines[_RunInRootFrame$Deter];
332
333 )
334 _RunInRootFrame$Deter--;
335 for (
336 ;
337 1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter;
338 namePropDescriptor--, _RunInRootFrame$Deter--
339 )
340 if (
341 sampleLines[namePropDescriptor] !==
342 controlLines[_RunInRootFrame$Deter]
343 ) {
344 if (1 !== namePropDescriptor || 1 !== _RunInRootFrame$Deter) {
345 do
346 if (
347 (namePropDescriptor--,
348 _RunInRootFrame$Deter--,
349 0 > _RunInRootFrame$Deter ||
350 sampleLines[namePropDescriptor] !==
351 controlLines[_RunInRootFrame$Deter])
352 ) {
353 var _frame =
354 "\n" +
355 sampleLines[namePropDescriptor].replace(
356 " at new ",
357 " at "
358 );
359 fn.displayName &&
360 _frame.includes("<anonymous>") &&
361 (_frame = _frame.replace("<anonymous>", fn.displayName));
362 "function" === typeof fn &&
363 componentFrameCache.set(fn, _frame);
364 return _frame;
365 }
366 while (1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter);
367 }
368 break;
369 }
370 }
371 } finally {
372 (reentry = !1),
373 (ReactSharedInternals.H = previousDispatcher),
374 reenableLogs(),
375 (Error.prepareStackTrace = frame);
376 }
377 sampleLines = (sampleLines = fn ? fn.displayName || fn.name : "")
378 ? describeBuiltInComponentFrame(sampleLines)
379 : "";
380 "function" === typeof fn && componentFrameCache.set(fn, sampleLines);
381 return sampleLines;
382 }
383 function describeUnknownElementTypeFrameInDEV(type) {
384 if (null == type) return "";
385 if ("function" === typeof type) {
386 var prototype = type.prototype;
387 return describeNativeComponentFrame(
388 type,
389 !(!prototype || !prototype.isReactComponent)
390 );
391 }
392 if ("string" === typeof type) return describeBuiltInComponentFrame(type);
393 switch (type) {
394 case REACT_SUSPENSE_TYPE:
395 return describeBuiltInComponentFrame("Suspense");
396 case REACT_SUSPENSE_LIST_TYPE:
397 return describeBuiltInComponentFrame("SuspenseList");
398 }
399 if ("object" === typeof type)
400 switch (type.$$typeof) {
401 case REACT_FORWARD_REF_TYPE:
402 return (type = describeNativeComponentFrame(type.render, !1)), type;
403 case REACT_MEMO_TYPE:
404 return describeUnknownElementTypeFrameInDEV(type.type);
405 case REACT_LAZY_TYPE:
406 prototype = type._payload;
407 type = type._init;
408 try {
409 return describeUnknownElementTypeFrameInDEV(type(prototype));
410 } catch (x) {}
411 }
412 return "";
413 }
414 function getOwner() {
415 var dispatcher = ReactSharedInternals.A;
416 return null === dispatcher ? null : dispatcher.getOwner();
417 }
418 function hasValidKey(config) {
419 if (hasOwnProperty.call(config, "key")) {
420 var getter = Object.getOwnPropertyDescriptor(config, "key").get;
421 if (getter && getter.isReactWarning) return !1;
422 }
423 return void 0 !== config.key;
424 }
425 function defineKeyPropWarningGetter(props, displayName) {
426 function warnAboutAccessingKey() {
427 specialPropKeyWarningShown ||
428 ((specialPropKeyWarningShown = !0),
429 console.error(
430 "%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://react.dev/link/special-props)",
431 displayName
432 ));
433 }
434 warnAboutAccessingKey.isReactWarning = !0;
435 Object.defineProperty(props, "key", {
436 get: warnAboutAccessingKey,
437 configurable: !0
438 });
439 }
440 function elementRefGetterWithDeprecationWarning() {
441 var componentName = getComponentNameFromType(this.type);
442 didWarnAboutElementRef[componentName] ||
443 ((didWarnAboutElementRef[componentName] = !0),
444 console.error(
445 "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
446 ));
447 componentName = this.props.ref;
448 return void 0 !== componentName ? componentName : null;
449 }
450 function ReactElement(type, key, self, source, owner, props) {
451 self = props.ref;
452 type = {
453 $$typeof: REACT_ELEMENT_TYPE,
454 type: type,
455 key: key,
456 props: props,
457 _owner: owner
458 };
459 null !== (void 0 !== self ? self : null)
460 ? Object.defineProperty(type, "ref", {
461 enumerable: !1,
462 get: elementRefGetterWithDeprecationWarning
463 })
464 : Object.defineProperty(type, "ref", { enumerable: !1, value: null });
465 type._store = {};
466 Object.defineProperty(type._store, "validated", {
467 configurable: !1,
468 enumerable: !1,
469 writable: !0,
470 value: 0
471 });
472 Object.defineProperty(type, "_debugInfo", {
473 configurable: !1,
474 enumerable: !1,
475 writable: !0,
476 value: null
477 });
478 Object.freeze && (Object.freeze(type.props), Object.freeze(type));
479 return type;
480 }
481 function cloneAndReplaceKey(oldElement, newKey) {
482 newKey = ReactElement(
483 oldElement.type,
484 newKey,
485 void 0,
486 void 0,
487 oldElement._owner,
488 oldElement.props
489 );
490 newKey._store.validated = oldElement._store.validated;
491 return newKey;
492 }
493 function validateChildKeys(node, parentType) {
494 if (
495 "object" === typeof node &&
496 node &&
497 node.$$typeof !== REACT_CLIENT_REFERENCE
498 )
499 if (isArrayImpl(node))
500 for (var i = 0; i < node.length; i++) {
501 var child = node[i];
502 isValidElement(child) && validateExplicitKey(child, parentType);
503 }
504 else if (isValidElement(node))
505 node._store && (node._store.validated = 1);
506 else if (
507 ((i = getIteratorFn(node)),
508 "function" === typeof i &&
509 i !== node.entries &&
510 ((i = i.call(node)), i !== node))
511 )
512 for (; !(node = i.next()).done; )
513 isValidElement(node.value) &&
514 validateExplicitKey(node.value, parentType);
515 }
516 function isValidElement(object) {
517 return (
518 "object" === typeof object &&
519 null !== object &&
520 object.$$typeof === REACT_ELEMENT_TYPE
521 );
522 }
523 function validateExplicitKey(element, parentType) {
524 if (
525 element._store &&
526 !element._store.validated &&
527 null == element.key &&
528 ((element._store.validated = 1),
529 (parentType = getCurrentComponentErrorInfo(parentType)),
530 !ownerHasKeyUseWarning[parentType])
531 ) {
532 ownerHasKeyUseWarning[parentType] = !0;
533 var childOwner = "";
534 element &&
535 null != element._owner &&
536 element._owner !== getOwner() &&
537 ((childOwner = null),
538 "number" === typeof element._owner.tag
539 ? (childOwner = getComponentNameFromType(element._owner.type))
540 : "string" === typeof element._owner.name &&
541 (childOwner = element._owner.name),
542 (childOwner = " It was passed a child from " + childOwner + "."));
543 var prevGetCurrentStack = ReactSharedInternals.getCurrentStack;
544 ReactSharedInternals.getCurrentStack = function () {
545 var stack = describeUnknownElementTypeFrameInDEV(element.type);
546 prevGetCurrentStack && (stack += prevGetCurrentStack() || "");
547 return stack;
548 };
549 console.error(
550 'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',
551 parentType,
552 childOwner
553 );
554 ReactSharedInternals.getCurrentStack = prevGetCurrentStack;
555 }
556 }
557 function getCurrentComponentErrorInfo(parentType) {
558 var info = "",
559 owner = getOwner();
560 owner &&
561 (owner = getComponentNameFromType(owner.type)) &&
562 (info = "\n\nCheck the render method of `" + owner + "`.");
563 info ||
564 ((parentType = getComponentNameFromType(parentType)) &&
565 (info =
566 "\n\nCheck the top-level render call using <" + parentType + ">."));
567 return info;
568 }
569 function escape(key) {
570 var escaperLookup = { "=": "=0", ":": "=2" };
571 return (
572 "$" +
573 key.replace(/[=:]/g, function (match) {
574 return escaperLookup[match];
575 })
576 );
577 }
578 function getElementKey(element, index) {
579 return "object" === typeof element &&
580 null !== element &&
581 null != element.key
582 ? (checkKeyStringCoercion(element.key), escape("" + element.key))
583 : index.toString(36);
584 }
585 function noop$1() {}
586 function resolveThenable(thenable) {
587 switch (thenable.status) {
588 case "fulfilled":
589 return thenable.value;
590 case "rejected":
591 throw thenable.reason;
592 default:
593 switch (
594 ("string" === typeof thenable.status
595 ? thenable.then(noop$1, noop$1)
596 : ((thenable.status = "pending"),
597 thenable.then(
598 function (fulfilledValue) {
599 "pending" === thenable.status &&
600 ((thenable.status = "fulfilled"),
601 (thenable.value = fulfilledValue));
602 },
603 function (error) {
604 "pending" === thenable.status &&
605 ((thenable.status = "rejected"),
606 (thenable.reason = error));
607 }
608 )),
609 thenable.status)
610 ) {
611 case "fulfilled":
612 return thenable.value;
613 case "rejected":
614 throw thenable.reason;
615 }
616 }
617 throw thenable;
618 }
619 function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
620 var type = typeof children;
621 if ("undefined" === type || "boolean" === type) children = null;
622 var invokeCallback = !1;
623 if (null === children) invokeCallback = !0;
624 else
625 switch (type) {
626 case "bigint":
627 case "string":
628 case "number":
629 invokeCallback = !0;
630 break;
631 case "object":
632 switch (children.$$typeof) {
633 case REACT_ELEMENT_TYPE:
634 case REACT_PORTAL_TYPE:
635 invokeCallback = !0;
636 break;
637 case REACT_LAZY_TYPE:
638 return (
639 (invokeCallback = children._init),
640 mapIntoArray(
641 invokeCallback(children._payload),
642 array,
643 escapedPrefix,
644 nameSoFar,
645 callback
646 )
647 );
648 }
649 }
650 if (invokeCallback) {
651 invokeCallback = children;
652 callback = callback(invokeCallback);
653 var childKey =
654 "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar;
655 isArrayImpl(callback)
656 ? ((escapedPrefix = ""),
657 null != childKey &&
658 (escapedPrefix =
659 childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"),
660 mapIntoArray(callback, array, escapedPrefix, "", function (c) {
661 return c;
662 }))
663 : null != callback &&
664 (isValidElement(callback) &&
665 (null != callback.key &&
666 ((invokeCallback && invokeCallback.key === callback.key) ||
667 checkKeyStringCoercion(callback.key)),
668 (escapedPrefix = cloneAndReplaceKey(
669 callback,
670 escapedPrefix +
671 (null == callback.key ||
672 (invokeCallback && invokeCallback.key === callback.key)
673 ? ""
674 : ("" + callback.key).replace(
675 userProvidedKeyEscapeRegex,
676 "$&/"
677 ) + "/") +
678 childKey
679 )),
680 "" !== nameSoFar &&
681 null != invokeCallback &&
682 isValidElement(invokeCallback) &&
683 null == invokeCallback.key &&
684 invokeCallback._store &&
685 !invokeCallback._store.validated &&
686 (escapedPrefix._store.validated = 2),
687 (callback = escapedPrefix)),
688 array.push(callback));
689 return 1;
690 }
691 invokeCallback = 0;
692 childKey = "" === nameSoFar ? "." : nameSoFar + ":";
693 if (isArrayImpl(children))
694 for (var i = 0; i < children.length; i++)
695 (nameSoFar = children[i]),
696 (type = childKey + getElementKey(nameSoFar, i)),
697 (invokeCallback += mapIntoArray(
698 nameSoFar,
699 array,
700 escapedPrefix,
701 type,
702 callback
703 ));
704 else if (((i = getIteratorFn(children)), "function" === typeof i))
705 for (
706 i === children.entries &&
707 (didWarnAboutMaps ||
708 console.warn(
709 "Using Maps as children is not supported. Use an array of keyed ReactElements instead."
710 ),
711 (didWarnAboutMaps = !0)),
712 children = i.call(children),
713 i = 0;
714 !(nameSoFar = children.next()).done;
715
716 )
717 (nameSoFar = nameSoFar.value),
718 (type = childKey + getElementKey(nameSoFar, i++)),
719 (invokeCallback += mapIntoArray(
720 nameSoFar,
721 array,
722 escapedPrefix,
723 type,
724 callback
725 ));
726 else if ("object" === type) {
727 if ("function" === typeof children.then)
728 return mapIntoArray(
729 resolveThenable(children),
730 array,
731 escapedPrefix,
732 nameSoFar,
733 callback
734 );
735 array = String(children);
736 throw Error(
737 "Objects are not valid as a React child (found: " +
738 ("[object Object]" === array
739 ? "object with keys {" + Object.keys(children).join(", ") + "}"
740 : array) +
741 "). If you meant to render a collection of children, use an array instead."
742 );
743 }
744 return invokeCallback;
745 }
746 function mapChildren(children, func, context) {
747 if (null == children) return children;
748 var result = [],
749 count = 0;
750 mapIntoArray(children, result, "", "", function (child) {
751 return func.call(context, child, count++);
752 });
753 return result;
754 }
755 function lazyInitializer(payload) {
756 if (-1 === payload._status) {
757 var ctor = payload._result;
758 ctor = ctor();
759 ctor.then(
760 function (moduleObject) {
761 if (0 === payload._status || -1 === payload._status)
762 (payload._status = 1), (payload._result = moduleObject);
763 },
764 function (error) {
765 if (0 === payload._status || -1 === payload._status)
766 (payload._status = 2), (payload._result = error);
767 }
768 );
769 -1 === payload._status &&
770 ((payload._status = 0), (payload._result = ctor));
771 }
772 if (1 === payload._status)
773 return (
774 (ctor = payload._result),
775 void 0 === ctor &&
776 console.error(
777 "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?",
778 ctor
779 ),
780 "default" in ctor ||
781 console.error(
782 "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",
783 ctor
784 ),
785 ctor.default
786 );
787 throw payload._result;
788 }
789 function resolveDispatcher() {
790 var dispatcher = ReactSharedInternals.H;
791 null === dispatcher &&
792 console.error(
793 "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://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
794 );
795 return dispatcher;
796 }
797 function noop() {}
798 function enqueueTask(task) {
799 if (null === enqueueTaskImpl)
800 try {
801 var requireString = ("require" + Math.random()).slice(0, 7);
802 enqueueTaskImpl = (module && module[requireString]).call(
803 module,
804 "timers"
805 ).setImmediate;
806 } catch (_err) {
807 enqueueTaskImpl = function (callback) {
808 !1 === didWarnAboutMessageChannel &&
809 ((didWarnAboutMessageChannel = !0),
810 "undefined" === typeof MessageChannel &&
811 console.error(
812 "This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."
813 ));
814 var channel = new MessageChannel();
815 channel.port1.onmessage = callback;
816 channel.port2.postMessage(void 0);
817 };
818 }
819 return enqueueTaskImpl(task);
820 }
821 function aggregateErrors(errors) {
822 return 1 < errors.length && "function" === typeof AggregateError
823 ? new AggregateError(errors)
824 : errors[0];
825 }
826 function popActScope(prevActQueue, prevActScopeDepth) {
827 prevActScopeDepth !== actScopeDepth - 1 &&
828 console.error(
829 "You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "
830 );
831 actScopeDepth = prevActScopeDepth;
832 }
833 function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
834 var queue = ReactSharedInternals.actQueue;
835 if (null !== queue)
836 if (0 !== queue.length)
837 try {
838 flushActQueue(queue);
839 enqueueTask(function () {
840 return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
841 });
842 return;
843 } catch (error) {
844 ReactSharedInternals.thrownErrors.push(error);
845 }
846 else ReactSharedInternals.actQueue = null;
847 0 < ReactSharedInternals.thrownErrors.length
848 ? ((queue = aggregateErrors(ReactSharedInternals.thrownErrors)),
849 (ReactSharedInternals.thrownErrors.length = 0),
850 reject(queue))
851 : resolve(returnValue);
852 }
853 function flushActQueue(queue) {
854 if (!isFlushing) {
855 isFlushing = !0;
856 var i = 0;
857 try {
858 for (; i < queue.length; i++) {
859 var callback = queue[i];
860 do {
861 ReactSharedInternals.didUsePromise = !1;
862 var continuation = callback(!1);
863 if (null !== continuation) {
864 if (ReactSharedInternals.didUsePromise) {
865 queue[i] = callback;
866 queue.splice(0, i);
867 return;
868 }
869 callback = continuation;
870 } else break;
871 } while (1);
872 }
873 queue.length = 0;
874 } catch (error) {
875 queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error);
876 } finally {
877 isFlushing = !1;
878 }
879 }
880 }
881 "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
882 "function" ===
883 typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&
884 __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
885 var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
886 REACT_PORTAL_TYPE = Symbol.for("react.portal"),
887 REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
888 REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
889 REACT_PROFILER_TYPE = Symbol.for("react.profiler");
890 Symbol.for("react.provider");
891 var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
892 REACT_CONTEXT_TYPE = Symbol.for("react.context"),
893 REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
894 REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
895 REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
896 REACT_MEMO_TYPE = Symbol.for("react.memo"),
897 REACT_LAZY_TYPE = Symbol.for("react.lazy"),
898 REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"),
899 MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
900 didWarnStateUpdateForUnmountedComponent = {},
901 ReactNoopUpdateQueue = {
902 isMounted: function () {
903 return !1;
904 },
905 enqueueForceUpdate: function (publicInstance) {
906 warnNoop(publicInstance, "forceUpdate");
907 },
908 enqueueReplaceState: function (publicInstance) {
909 warnNoop(publicInstance, "replaceState");
910 },
911 enqueueSetState: function (publicInstance) {
912 warnNoop(publicInstance, "setState");
913 }
914 },
915 assign = Object.assign,
916 emptyObject = {};
917 Object.freeze(emptyObject);
918 Component.prototype.isReactComponent = {};
919 Component.prototype.setState = function (partialState, callback) {
920 if (
921 "object" !== typeof partialState &&
922 "function" !== typeof partialState &&
923 null != partialState
924 )
925 throw Error(
926 "takes an object of state variables to update or a function which returns an object of state variables."
927 );
928 this.updater.enqueueSetState(this, partialState, callback, "setState");
929 };
930 Component.prototype.forceUpdate = function (callback) {
931 this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
932 };
933 var deprecatedAPIs = {
934 isMounted: [
935 "isMounted",
936 "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."
937 ],
938 replaceState: [
939 "replaceState",
940 "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."
941 ]
942 },
943 fnName;
944 for (fnName in deprecatedAPIs)
945 deprecatedAPIs.hasOwnProperty(fnName) &&
946 defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
947 ComponentDummy.prototype = Component.prototype;
948 deprecatedAPIs = PureComponent.prototype = new ComponentDummy();
949 deprecatedAPIs.constructor = PureComponent;
950 assign(deprecatedAPIs, Component.prototype);
951 deprecatedAPIs.isPureReactComponent = !0;
952 var isArrayImpl = Array.isArray,
953 REACT_CLIENT_REFERENCE$2 = Symbol.for("react.client.reference"),
954 ReactSharedInternals = {
955 H: null,
956 A: null,
957 T: null,
958 S: null,
959 actQueue: null,
960 isBatchingLegacy: !1,
961 didScheduleLegacyUpdate: !1,
962 didUsePromise: !1,
963 thrownErrors: [],
964 getCurrentStack: null
965 },
966 hasOwnProperty = Object.prototype.hasOwnProperty,
967 REACT_CLIENT_REFERENCE$1 = Symbol.for("react.client.reference"),
968 disabledDepth = 0,
969 prevLog,
970 prevInfo,
971 prevWarn,
972 prevError,
973 prevGroup,
974 prevGroupCollapsed,
975 prevGroupEnd;
976 disabledLog.__reactDisabledLog = !0;
977 var prefix,
978 suffix,
979 reentry = !1;
980 var componentFrameCache = new (
981 "function" === typeof WeakMap ? WeakMap : Map
982 )();
983 var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
984 specialPropKeyWarningShown,
985 didWarnAboutOldJSXRuntime;
986 var didWarnAboutElementRef = {};
987 var ownerHasKeyUseWarning = {},
988 didWarnAboutMaps = !1,
989 userProvidedKeyEscapeRegex = /\/+/g,
990 reportGlobalError =
991 "function" === typeof reportError
992 ? reportError
993 : function (error) {
994 if (
995 "object" === typeof window &&
996 "function" === typeof window.ErrorEvent
997 ) {
998 var event = new window.ErrorEvent("error", {
999 bubbles: !0,
1000 cancelable: !0,
1001 message:
1002 "object" === typeof error &&
1003 null !== error &&
1004 "string" === typeof error.message
1005 ? String(error.message)
1006 : String(error),
1007 error: error
1008 });
1009 if (!window.dispatchEvent(event)) return;
1010 } else if (
1011 "object" === typeof process &&
1012 "function" === typeof process.emit
1013 ) {
1014 process.emit("uncaughtException", error);
1015 return;
1016 }
1017 console.error(error);
1018 },
1019 didWarnAboutMessageChannel = !1,
1020 enqueueTaskImpl = null,
1021 actScopeDepth = 0,
1022 didWarnNoAwaitAct = !1,
1023 isFlushing = !1,
1024 queueSeveralMicrotasks =
1025 "function" === typeof queueMicrotask
1026 ? function (callback) {
1027 queueMicrotask(function () {
1028 return queueMicrotask(callback);
1029 });
1030 }
1031 : enqueueTask;
1032 exports.Children = {
1033 map: mapChildren,
1034 forEach: function (children, forEachFunc, forEachContext) {
1035 mapChildren(
1036 children,
1037 function () {
1038 forEachFunc.apply(this, arguments);
1039 },
1040 forEachContext
1041 );
1042 },
1043 count: function (children) {
1044 var n = 0;
1045 mapChildren(children, function () {
1046 n++;
1047 });
1048 return n;
1049 },
1050 toArray: function (children) {
1051 return (
1052 mapChildren(children, function (child) {
1053 return child;
1054 }) || []
1055 );
1056 },
1057 only: function (children) {
1058 if (!isValidElement(children))
1059 throw Error(
1060 "React.Children.only expected to receive a single React element child."
1061 );
1062 return children;
1063 }
1064 };
1065 exports.Component = Component;
1066 exports.Fragment = REACT_FRAGMENT_TYPE;
1067 exports.Profiler = REACT_PROFILER_TYPE;
1068 exports.PureComponent = PureComponent;
1069 exports.StrictMode = REACT_STRICT_MODE_TYPE;
1070 exports.Suspense = REACT_SUSPENSE_TYPE;
1071 exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
1072 ReactSharedInternals;
1073 exports.act = function (callback) {
1074 var prevActQueue = ReactSharedInternals.actQueue,
1075 prevActScopeDepth = actScopeDepth;
1076 actScopeDepth++;
1077 var queue = (ReactSharedInternals.actQueue =
1078 null !== prevActQueue ? prevActQueue : []),
1079 didAwaitActCall = !1;
1080 try {
1081 var result = callback();
1082 } catch (error) {
1083 ReactSharedInternals.thrownErrors.push(error);
1084 }
1085 if (0 < ReactSharedInternals.thrownErrors.length)
1086 throw (
1087 (popActScope(prevActQueue, prevActScopeDepth),
1088 (callback = aggregateErrors(ReactSharedInternals.thrownErrors)),
1089 (ReactSharedInternals.thrownErrors.length = 0),
1090 callback)
1091 );
1092 if (
1093 null !== result &&
1094 "object" === typeof result &&
1095 "function" === typeof result.then
1096 ) {
1097 var thenable = result;
1098 queueSeveralMicrotasks(function () {
1099 didAwaitActCall ||
1100 didWarnNoAwaitAct ||
1101 ((didWarnNoAwaitAct = !0),
1102 console.error(
1103 "You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"
1104 ));
1105 });
1106 return {
1107 then: function (resolve, reject) {
1108 didAwaitActCall = !0;
1109 thenable.then(
1110 function (returnValue) {
1111 popActScope(prevActQueue, prevActScopeDepth);
1112 if (0 === prevActScopeDepth) {
1113 try {
1114 flushActQueue(queue),
1115 enqueueTask(function () {
1116 return recursivelyFlushAsyncActWork(
1117 returnValue,
1118 resolve,
1119 reject
1120 );
1121 });
1122 } catch (error$2) {
1123 ReactSharedInternals.thrownErrors.push(error$2);
1124 }
1125 if (0 < ReactSharedInternals.thrownErrors.length) {
1126 var _thrownError = aggregateErrors(
1127 ReactSharedInternals.thrownErrors
1128 );
1129 ReactSharedInternals.thrownErrors.length = 0;
1130 reject(_thrownError);
1131 }
1132 } else resolve(returnValue);
1133 },
1134 function (error) {
1135 popActScope(prevActQueue, prevActScopeDepth);
1136 0 < ReactSharedInternals.thrownErrors.length
1137 ? ((error = aggregateErrors(
1138 ReactSharedInternals.thrownErrors
1139 )),
1140 (ReactSharedInternals.thrownErrors.length = 0),
1141 reject(error))
1142 : reject(error);
1143 }
1144 );
1145 }
1146 };
1147 }
1148 var returnValue$jscomp$0 = result;
1149 popActScope(prevActQueue, prevActScopeDepth);
1150 0 === prevActScopeDepth &&
1151 (flushActQueue(queue),
1152 0 !== queue.length &&
1153 queueSeveralMicrotasks(function () {
1154 didAwaitActCall ||
1155 didWarnNoAwaitAct ||
1156 ((didWarnNoAwaitAct = !0),
1157 console.error(
1158 "A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"
1159 ));
1160 }),
1161 (ReactSharedInternals.actQueue = null));
1162 if (0 < ReactSharedInternals.thrownErrors.length)
1163 throw (
1164 ((callback = aggregateErrors(ReactSharedInternals.thrownErrors)),
1165 (ReactSharedInternals.thrownErrors.length = 0),
1166 callback)
1167 );
1168 return {
1169 then: function (resolve, reject) {
1170 didAwaitActCall = !0;
1171 0 === prevActScopeDepth
1172 ? ((ReactSharedInternals.actQueue = queue),
1173 enqueueTask(function () {
1174 return recursivelyFlushAsyncActWork(
1175 returnValue$jscomp$0,
1176 resolve,
1177 reject
1178 );
1179 }))
1180 : resolve(returnValue$jscomp$0);
1181 }
1182 };
1183 };
1184 exports.cache = function (fn) {
1185 return function () {
1186 return fn.apply(null, arguments);
1187 };
1188 };
1189 exports.cloneElement = function (element, config, children) {
1190 if (null === element || void 0 === element)
1191 throw Error(
1192 "The argument must be a React element, but you passed " +
1193 element +
1194 "."
1195 );
1196 var props = assign({}, element.props),
1197 key = element.key,
1198 owner = element._owner;
1199 if (null != config) {
1200 var JSCompiler_inline_result;
1201 a: {
1202 if (
1203 hasOwnProperty.call(config, "ref") &&
1204 (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(
1205 config,
1206 "ref"
1207 ).get) &&
1208 JSCompiler_inline_result.isReactWarning
1209 ) {
1210 JSCompiler_inline_result = !1;
1211 break a;
1212 }
1213 JSCompiler_inline_result = void 0 !== config.ref;
1214 }
1215 JSCompiler_inline_result && (owner = getOwner());
1216 hasValidKey(config) &&
1217 (checkKeyStringCoercion(config.key), (key = "" + config.key));
1218 for (propName in config)
1219 !hasOwnProperty.call(config, propName) ||
1220 "key" === propName ||
1221 "__self" === propName ||
1222 "__source" === propName ||
1223 ("ref" === propName && void 0 === config.ref) ||
1224 (props[propName] = config[propName]);
1225 }
1226 var propName = arguments.length - 2;
1227 if (1 === propName) props.children = children;
1228 else if (1 < propName) {
1229 JSCompiler_inline_result = Array(propName);
1230 for (var i = 0; i < propName; i++)
1231 JSCompiler_inline_result[i] = arguments[i + 2];
1232 props.children = JSCompiler_inline_result;
1233 }
1234 props = ReactElement(element.type, key, void 0, void 0, owner, props);
1235 for (key = 2; key < arguments.length; key++)
1236 validateChildKeys(arguments[key], props.type);
1237 return props;
1238 };
1239 exports.createContext = function (defaultValue) {
1240 defaultValue = {
1241 $$typeof: REACT_CONTEXT_TYPE,
1242 _currentValue: defaultValue,
1243 _currentValue2: defaultValue,
1244 _threadCount: 0,
1245 Provider: null,
1246 Consumer: null
1247 };
1248 defaultValue.Provider = defaultValue;
1249 defaultValue.Consumer = {
1250 $$typeof: REACT_CONSUMER_TYPE,
1251 _context: defaultValue
1252 };
1253 defaultValue._currentRenderer = null;
1254 defaultValue._currentRenderer2 = null;
1255 return defaultValue;
1256 };
1257 exports.createElement = function (type, config, children) {
1258 if (isValidElementType(type))
1259 for (var i = 2; i < arguments.length; i++)
1260 validateChildKeys(arguments[i], type);
1261 else {
1262 i = "";
1263 if (
1264 void 0 === type ||
1265 ("object" === typeof type &&
1266 null !== type &&
1267 0 === Object.keys(type).length)
1268 )
1269 i +=
1270 " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
1271 if (null === type) var typeString = "null";
1272 else
1273 isArrayImpl(type)
1274 ? (typeString = "array")
1275 : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE
1276 ? ((typeString =
1277 "<" +
1278 (getComponentNameFromType(type.type) || "Unknown") +
1279 " />"),
1280 (i =
1281 " Did you accidentally export a JSX literal instead of a component?"))
1282 : (typeString = typeof type);
1283 console.error(
1284 "React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",
1285 typeString,
1286 i
1287 );
1288 }
1289 var propName;
1290 i = {};
1291 typeString = null;
1292 if (null != config)
1293 for (propName in (didWarnAboutOldJSXRuntime ||
1294 !("__self" in config) ||
1295 "key" in config ||
1296 ((didWarnAboutOldJSXRuntime = !0),
1297 console.warn(
1298 "Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform"
1299 )),
1300 hasValidKey(config) &&
1301 (checkKeyStringCoercion(config.key), (typeString = "" + config.key)),
1302 config))
1303 hasOwnProperty.call(config, propName) &&
1304 "key" !== propName &&
1305 "__self" !== propName &&
1306 "__source" !== propName &&
1307 (i[propName] = config[propName]);
1308 var childrenLength = arguments.length - 2;
1309 if (1 === childrenLength) i.children = children;
1310 else if (1 < childrenLength) {
1311 for (
1312 var childArray = Array(childrenLength), _i = 0;
1313 _i < childrenLength;
1314 _i++
1315 )
1316 childArray[_i] = arguments[_i + 2];
1317 Object.freeze && Object.freeze(childArray);
1318 i.children = childArray;
1319 }
1320 if (type && type.defaultProps)
1321 for (propName in ((childrenLength = type.defaultProps), childrenLength))
1322 void 0 === i[propName] && (i[propName] = childrenLength[propName]);
1323 typeString &&
1324 defineKeyPropWarningGetter(
1325 i,
1326 "function" === typeof type
1327 ? type.displayName || type.name || "Unknown"
1328 : type
1329 );
1330 return ReactElement(type, typeString, void 0, void 0, getOwner(), i);
1331 };
1332 exports.createRef = function () {
1333 var refObject = { current: null };
1334 Object.seal(refObject);
1335 return refObject;
1336 };
1337 exports.forwardRef = function (render) {
1338 null != render && render.$$typeof === REACT_MEMO_TYPE
1339 ? console.error(
1340 "forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
1341 )
1342 : "function" !== typeof render
1343 ? console.error(
1344 "forwardRef requires a render function but was given %s.",
1345 null === render ? "null" : typeof render
1346 )
1347 : 0 !== render.length &&
1348 2 !== render.length &&
1349 console.error(
1350 "forwardRef render functions accept exactly two parameters: props and ref. %s",
1351 1 === render.length
1352 ? "Did you forget to use the ref parameter?"
1353 : "Any additional parameter will be undefined."
1354 );
1355 null != render &&
1356 null != render.defaultProps &&
1357 console.error(
1358 "forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
1359 );
1360 var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render: render },
1361 ownName;
1362 Object.defineProperty(elementType, "displayName", {
1363 enumerable: !1,
1364 configurable: !0,
1365 get: function () {
1366 return ownName;
1367 },
1368 set: function (name) {
1369 ownName = name;
1370 render.name ||
1371 render.displayName ||
1372 (Object.defineProperty(render, "name", { value: name }),
1373 (render.displayName = name));
1374 }
1375 });
1376 return elementType;
1377 };
1378 exports.isValidElement = isValidElement;
1379 exports.lazy = function (ctor) {
1380 return {
1381 $$typeof: REACT_LAZY_TYPE,
1382 _payload: { _status: -1, _result: ctor },
1383 _init: lazyInitializer
1384 };
1385 };
1386 exports.memo = function (type, compare) {
1387 isValidElementType(type) ||
1388 console.error(
1389 "memo: The first argument must be a component. Instead received: %s",
1390 null === type ? "null" : typeof type
1391 );
1392 compare = {
1393 $$typeof: REACT_MEMO_TYPE,
1394 type: type,
1395 compare: void 0 === compare ? null : compare
1396 };
1397 var ownName;
1398 Object.defineProperty(compare, "displayName", {
1399 enumerable: !1,
1400 configurable: !0,
1401 get: function () {
1402 return ownName;
1403 },
1404 set: function (name) {
1405 ownName = name;
1406 type.name ||
1407 type.displayName ||
1408 (Object.defineProperty(type, "name", { value: name }),
1409 (type.displayName = name));
1410 }
1411 });
1412 return compare;
1413 };
1414 exports.startTransition = function (scope) {
1415 var prevTransition = ReactSharedInternals.T,
1416 currentTransition = {};
1417 ReactSharedInternals.T = currentTransition;
1418 currentTransition._updatedFibers = new Set();
1419 try {
1420 var returnValue = scope(),
1421 onStartTransitionFinish = ReactSharedInternals.S;
1422 null !== onStartTransitionFinish &&
1423 onStartTransitionFinish(currentTransition, returnValue);
1424 "object" === typeof returnValue &&
1425 null !== returnValue &&
1426 "function" === typeof returnValue.then &&
1427 returnValue.then(noop, reportGlobalError);
1428 } catch (error) {
1429 reportGlobalError(error);
1430 } finally {
1431 null === prevTransition &&
1432 currentTransition._updatedFibers &&
1433 ((scope = currentTransition._updatedFibers.size),
1434 currentTransition._updatedFibers.clear(),
1435 10 < scope &&
1436 console.warn(
1437 "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
1438 )),
1439 (ReactSharedInternals.T = prevTransition);
1440 }
1441 };
1442 exports.unstable_useCacheRefresh = function () {
1443 return resolveDispatcher().useCacheRefresh();
1444 };
1445 exports.use = function (usable) {
1446 return resolveDispatcher().use(usable);
1447 };
1448 exports.useActionState = function (action, initialState, permalink) {
1449 return resolveDispatcher().useActionState(
1450 action,
1451 initialState,
1452 permalink
1453 );
1454 };
1455 exports.useCallback = function (callback, deps) {
1456 return resolveDispatcher().useCallback(callback, deps);
1457 };
1458 exports.useContext = function (Context) {
1459 var dispatcher = resolveDispatcher();
1460 Context.$$typeof === REACT_CONSUMER_TYPE &&
1461 console.error(
1462 "Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
1463 );
1464 return dispatcher.useContext(Context);
1465 };
1466 exports.useDebugValue = function (value, formatterFn) {
1467 return resolveDispatcher().useDebugValue(value, formatterFn);
1468 };
1469 exports.useDeferredValue = function (value, initialValue) {
1470 return resolveDispatcher().useDeferredValue(value, initialValue);
1471 };
1472 exports.useEffect = function (create, deps) {
1473 return resolveDispatcher().useEffect(create, deps);
1474 };
1475 exports.useId = function () {
1476 return resolveDispatcher().useId();
1477 };
1478 exports.useImperativeHandle = function (ref, create, deps) {
1479 return resolveDispatcher().useImperativeHandle(ref, create, deps);
1480 };
1481 exports.useInsertionEffect = function (create, deps) {
1482 return resolveDispatcher().useInsertionEffect(create, deps);
1483 };
1484 exports.useLayoutEffect = function (create, deps) {
1485 return resolveDispatcher().useLayoutEffect(create, deps);
1486 };
1487 exports.useMemo = function (create, deps) {
1488 return resolveDispatcher().useMemo(create, deps);
1489 };
1490 exports.useOptimistic = function (passthrough, reducer) {
1491 return resolveDispatcher().useOptimistic(passthrough, reducer);
1492 };
1493 exports.useReducer = function (reducer, initialArg, init) {
1494 return resolveDispatcher().useReducer(reducer, initialArg, init);
1495 };
1496 exports.useRef = function (initialValue) {
1497 return resolveDispatcher().useRef(initialValue);
1498 };
1499 exports.useState = function (initialState) {
1500 return resolveDispatcher().useState(initialState);
1501 };
1502 exports.useSyncExternalStore = function (
1503 subscribe,
1504 getSnapshot,
1505 getServerSnapshot
1506 ) {
1507 return resolveDispatcher().useSyncExternalStore(
1508 subscribe,
1509 getSnapshot,
1510 getServerSnapshot
1511 );
1512 };
1513 exports.useTransition = function () {
1514 return resolveDispatcher().useTransition();
1515 };
1516 exports.version = "19.0.0";
1517 "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1518 "function" ===
1519 typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
1520 __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
1521 })();