1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | 'use strict';
|
12 |
|
13 | if (process.env.NODE_ENV !== "production") {
|
14 | (function() {
|
15 | 'use strict';
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 | var REACT_ELEMENT_TYPE = Symbol.for('react.element');
|
22 | var REACT_PORTAL_TYPE = Symbol.for('react.portal');
|
23 | var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
|
24 | var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
|
25 | var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
|
26 | var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
|
27 | var REACT_CONTEXT_TYPE = Symbol.for('react.context');
|
28 | var REACT_SERVER_CONTEXT_TYPE = Symbol.for('react.server_context');
|
29 | var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
|
30 | var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
|
31 | var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
|
32 | var REACT_MEMO_TYPE = Symbol.for('react.memo');
|
33 | var REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
34 | var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
|
35 |
|
36 |
|
37 |
|
38 | var enableScopeAPI = false;
|
39 | var enableCacheElement = false;
|
40 | var enableTransitionTracing = false;
|
41 |
|
42 | var enableLegacyHidden = false;
|
43 |
|
44 |
|
45 |
|
46 | var enableDebugTracing = false;
|
47 |
|
48 | var REACT_MODULE_REFERENCE;
|
49 |
|
50 | {
|
51 | REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
|
52 | }
|
53 |
|
54 | function isValidElementType(type) {
|
55 | if (typeof type === 'string' || typeof type === 'function') {
|
56 | return true;
|
57 | }
|
58 |
|
59 |
|
60 | if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {
|
61 | return true;
|
62 | }
|
63 |
|
64 | if (typeof type === 'object' && type !== null) {
|
65 | 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 ||
|
66 |
|
67 |
|
68 |
|
69 | type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
|
70 | return true;
|
71 | }
|
72 | }
|
73 |
|
74 | return false;
|
75 | }
|
76 |
|
77 | function typeOf(object) {
|
78 | if (typeof object === 'object' && object !== null) {
|
79 | var $$typeof = object.$$typeof;
|
80 |
|
81 | switch ($$typeof) {
|
82 | case REACT_ELEMENT_TYPE:
|
83 | var type = object.type;
|
84 |
|
85 | switch (type) {
|
86 | case REACT_FRAGMENT_TYPE:
|
87 | case REACT_PROFILER_TYPE:
|
88 | case REACT_STRICT_MODE_TYPE:
|
89 | case REACT_SUSPENSE_TYPE:
|
90 | case REACT_SUSPENSE_LIST_TYPE:
|
91 | return type;
|
92 |
|
93 | default:
|
94 | var $$typeofType = type && type.$$typeof;
|
95 |
|
96 | switch ($$typeofType) {
|
97 | case REACT_SERVER_CONTEXT_TYPE:
|
98 | case REACT_CONTEXT_TYPE:
|
99 | case REACT_FORWARD_REF_TYPE:
|
100 | case REACT_LAZY_TYPE:
|
101 | case REACT_MEMO_TYPE:
|
102 | case REACT_PROVIDER_TYPE:
|
103 | return $$typeofType;
|
104 |
|
105 | default:
|
106 | return $$typeof;
|
107 | }
|
108 |
|
109 | }
|
110 |
|
111 | case REACT_PORTAL_TYPE:
|
112 | return $$typeof;
|
113 | }
|
114 | }
|
115 |
|
116 | return undefined;
|
117 | }
|
118 | var ContextConsumer = REACT_CONTEXT_TYPE;
|
119 | var ContextProvider = REACT_PROVIDER_TYPE;
|
120 | var Element = REACT_ELEMENT_TYPE;
|
121 | var ForwardRef = REACT_FORWARD_REF_TYPE;
|
122 | var Fragment = REACT_FRAGMENT_TYPE;
|
123 | var Lazy = REACT_LAZY_TYPE;
|
124 | var Memo = REACT_MEMO_TYPE;
|
125 | var Portal = REACT_PORTAL_TYPE;
|
126 | var Profiler = REACT_PROFILER_TYPE;
|
127 | var StrictMode = REACT_STRICT_MODE_TYPE;
|
128 | var Suspense = REACT_SUSPENSE_TYPE;
|
129 | var SuspenseList = REACT_SUSPENSE_LIST_TYPE;
|
130 | var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
131 | var hasWarnedAboutDeprecatedIsConcurrentMode = false;
|
132 |
|
133 | function isAsyncMode(object) {
|
134 | {
|
135 | if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
136 | hasWarnedAboutDeprecatedIsAsyncMode = true;
|
137 |
|
138 | console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 18+.');
|
139 | }
|
140 | }
|
141 |
|
142 | return false;
|
143 | }
|
144 | function isConcurrentMode(object) {
|
145 | {
|
146 | if (!hasWarnedAboutDeprecatedIsConcurrentMode) {
|
147 | hasWarnedAboutDeprecatedIsConcurrentMode = true;
|
148 |
|
149 | console['warn']('The ReactIs.isConcurrentMode() alias has been deprecated, ' + 'and will be removed in React 18+.');
|
150 | }
|
151 | }
|
152 |
|
153 | return false;
|
154 | }
|
155 | function isContextConsumer(object) {
|
156 | return typeOf(object) === REACT_CONTEXT_TYPE;
|
157 | }
|
158 | function isContextProvider(object) {
|
159 | return typeOf(object) === REACT_PROVIDER_TYPE;
|
160 | }
|
161 | function isElement(object) {
|
162 | return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
163 | }
|
164 | function isForwardRef(object) {
|
165 | return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
166 | }
|
167 | function isFragment(object) {
|
168 | return typeOf(object) === REACT_FRAGMENT_TYPE;
|
169 | }
|
170 | function isLazy(object) {
|
171 | return typeOf(object) === REACT_LAZY_TYPE;
|
172 | }
|
173 | function isMemo(object) {
|
174 | return typeOf(object) === REACT_MEMO_TYPE;
|
175 | }
|
176 | function isPortal(object) {
|
177 | return typeOf(object) === REACT_PORTAL_TYPE;
|
178 | }
|
179 | function isProfiler(object) {
|
180 | return typeOf(object) === REACT_PROFILER_TYPE;
|
181 | }
|
182 | function isStrictMode(object) {
|
183 | return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
184 | }
|
185 | function isSuspense(object) {
|
186 | return typeOf(object) === REACT_SUSPENSE_TYPE;
|
187 | }
|
188 | function isSuspenseList(object) {
|
189 | return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
|
190 | }
|
191 |
|
192 | exports.ContextConsumer = ContextConsumer;
|
193 | exports.ContextProvider = ContextProvider;
|
194 | exports.Element = Element;
|
195 | exports.ForwardRef = ForwardRef;
|
196 | exports.Fragment = Fragment;
|
197 | exports.Lazy = Lazy;
|
198 | exports.Memo = Memo;
|
199 | exports.Portal = Portal;
|
200 | exports.Profiler = Profiler;
|
201 | exports.StrictMode = StrictMode;
|
202 | exports.Suspense = Suspense;
|
203 | exports.SuspenseList = SuspenseList;
|
204 | exports.isAsyncMode = isAsyncMode;
|
205 | exports.isConcurrentMode = isConcurrentMode;
|
206 | exports.isContextConsumer = isContextConsumer;
|
207 | exports.isContextProvider = isContextProvider;
|
208 | exports.isElement = isElement;
|
209 | exports.isForwardRef = isForwardRef;
|
210 | exports.isFragment = isFragment;
|
211 | exports.isLazy = isLazy;
|
212 | exports.isMemo = isMemo;
|
213 | exports.isPortal = isPortal;
|
214 | exports.isProfiler = isProfiler;
|
215 | exports.isStrictMode = isStrictMode;
|
216 | exports.isSuspense = isSuspense;
|
217 | exports.isSuspenseList = isSuspenseList;
|
218 | exports.isValidElementType = isValidElementType;
|
219 | exports.typeOf = typeOf;
|
220 | })();
|
221 | }
|