123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239 |
- 'use strict';
- if (process.env.NODE_ENV !== "production") {
- (function() {
- 'use strict';
- if (
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
- 'function'
- ) {
- __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
- }
- var React = require('react');
- var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
- function error(format) {
- {
- {
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
- args[_key2 - 1] = arguments[_key2];
- }
- printWarning('error', format, args);
- }
- }
- }
- function printWarning(level, format, args) {
-
-
- {
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
- var stack = ReactDebugCurrentFrame.getStackAddendum();
- if (stack !== '') {
- format += '%s';
- args = args.concat([stack]);
- }
- var argsWithFormat = args.map(function (item) {
- return String(item);
- });
- argsWithFormat.unshift('Warning: ' + format);
-
-
- Function.prototype.apply.call(console[level], console, argsWithFormat);
- }
- }
- function is(x, y) {
- return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y
- ;
- }
- var objectIs = typeof Object.is === 'function' ? Object.is : is;
- var useState = React.useState,
- useEffect = React.useEffect,
- useLayoutEffect = React.useLayoutEffect,
- useDebugValue = React.useDebugValue;
- var didWarnOld18Alpha = false;
- var didWarnUncachedGetSnapshot = false;
- function useSyncExternalStore(subscribe, getSnapshot,
- getServerSnapshot) {
- {
- if (!didWarnOld18Alpha) {
- if (React.startTransition !== undefined) {
- didWarnOld18Alpha = true;
- error('You are using an outdated, pre-release alpha of React 18 that ' + 'does not support useSyncExternalStore. The ' + 'use-sync-external-store shim will not work correctly. Upgrade ' + 'to a newer pre-release.');
- }
- }
- }
-
-
-
- var value = getSnapshot();
- {
- if (!didWarnUncachedGetSnapshot) {
- var cachedValue = getSnapshot();
- if (!objectIs(value, cachedValue)) {
- error('The result of getSnapshot should be cached to avoid an infinite loop');
- didWarnUncachedGetSnapshot = true;
- }
- }
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
- var _useState = useState({
- inst: {
- value: value,
- getSnapshot: getSnapshot
- }
- }),
- inst = _useState[0].inst,
- forceUpdate = _useState[1];
-
-
- useLayoutEffect(function () {
- inst.value = value;
- inst.getSnapshot = getSnapshot;
-
-
-
- if (checkIfSnapshotChanged(inst)) {
-
- forceUpdate({
- inst: inst
- });
- }
- }, [subscribe, value, getSnapshot]);
- useEffect(function () {
-
-
- if (checkIfSnapshotChanged(inst)) {
-
- forceUpdate({
- inst: inst
- });
- }
- var handleStoreChange = function () {
-
-
-
-
-
-
- if (checkIfSnapshotChanged(inst)) {
-
- forceUpdate({
- inst: inst
- });
- }
- };
- return subscribe(handleStoreChange);
- }, [subscribe]);
- useDebugValue(value);
- return value;
- }
- function checkIfSnapshotChanged(inst) {
- var latestGetSnapshot = inst.getSnapshot;
- var prevValue = inst.value;
- try {
- var nextValue = latestGetSnapshot();
- return !objectIs(prevValue, nextValue);
- } catch (error) {
- return true;
- }
- }
- function useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {
-
-
-
-
- return getSnapshot();
- }
- var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');
- var isServerEnvironment = !canUseDOM;
- var shim = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore;
- var useSyncExternalStore$2 = React.useSyncExternalStore !== undefined ? React.useSyncExternalStore : shim;
- exports.useSyncExternalStore = useSyncExternalStore$2;
-
- if (
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
- 'function'
- ) {
- __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
- }
-
- })();
- }
|