1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | 'use strict';
|
11 |
|
12 | (function (global, factory) {
|
13 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('react')) :
|
14 | typeof define === 'function' && define.amd ? define(['react'], factory) :
|
15 | (global.ReactDOMServer = factory(global.React));
|
16 | }(this, (function (React) { 'use strict';
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 | function ReactError(error) {
|
27 | error.name = 'Invariant Violation';
|
28 | return error;
|
29 | }
|
30 |
|
31 |
|
32 |
|
33 | var ReactVersion = '16.9.0-rc.0';
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 | var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
47 |
|
48 | var _assign = ReactInternals.assign;
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 | var warningWithoutStack = function () {};
|
58 |
|
59 | {
|
60 | warningWithoutStack = function (condition, format) {
|
61 | for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
62 | args[_key - 2] = arguments[_key];
|
63 | }
|
64 |
|
65 | if (format === undefined) {
|
66 | throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
|
67 | }
|
68 | if (args.length > 8) {
|
69 |
|
70 | throw new Error('warningWithoutStack() currently supports at most 8 arguments.');
|
71 | }
|
72 | if (condition) {
|
73 | return;
|
74 | }
|
75 | if (typeof console !== 'undefined') {
|
76 | var argsWithFormat = args.map(function (item) {
|
77 | return '' + item;
|
78 | });
|
79 | argsWithFormat.unshift('Warning: ' + format);
|
80 |
|
81 |
|
82 |
|
83 | Function.prototype.apply.call(console.error, console, argsWithFormat);
|
84 | }
|
85 | try {
|
86 |
|
87 |
|
88 |
|
89 | var argIndex = 0;
|
90 | var message = 'Warning: ' + format.replace(/%s/g, function () {
|
91 | return args[argIndex++];
|
92 | });
|
93 | throw new Error(message);
|
94 | } catch (x) {}
|
95 | };
|
96 | }
|
97 |
|
98 | var warningWithoutStack$1 = warningWithoutStack;
|
99 |
|
100 |
|
101 |
|
102 | var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
103 |
|
104 |
|
105 | var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
106 | var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
107 | var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
108 | var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
109 | var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
110 | var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
|
111 |
|
112 |
|
113 |
|
114 | var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
115 | var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
116 | var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
117 | var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
118 | var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
119 | var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
120 | var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
121 |
|
122 | var Resolved = 1;
|
123 |
|
124 |
|
125 | function refineResolvedLazyComponent(lazyComponent) {
|
126 | return lazyComponent._status === Resolved ? lazyComponent._result : null;
|
127 | }
|
128 |
|
129 | function getWrappedName(outerType, innerType, wrapperName) {
|
130 | var functionName = innerType.displayName || innerType.name || '';
|
131 | return outerType.displayName || (functionName !== '' ? wrapperName + '(' + functionName + ')' : wrapperName);
|
132 | }
|
133 |
|
134 | function getComponentName(type) {
|
135 | if (type == null) {
|
136 |
|
137 | return null;
|
138 | }
|
139 | {
|
140 | if (typeof type.tag === 'number') {
|
141 | warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
|
142 | }
|
143 | }
|
144 | if (typeof type === 'function') {
|
145 | return type.displayName || type.name || null;
|
146 | }
|
147 | if (typeof type === 'string') {
|
148 | return type;
|
149 | }
|
150 | switch (type) {
|
151 | case REACT_FRAGMENT_TYPE:
|
152 | return 'Fragment';
|
153 | case REACT_PORTAL_TYPE:
|
154 | return 'Portal';
|
155 | case REACT_PROFILER_TYPE:
|
156 | return 'Profiler';
|
157 | case REACT_STRICT_MODE_TYPE:
|
158 | return 'StrictMode';
|
159 | case REACT_SUSPENSE_TYPE:
|
160 | return 'Suspense';
|
161 | case REACT_SUSPENSE_LIST_TYPE:
|
162 | return 'SuspenseList';
|
163 | }
|
164 | if (typeof type === 'object') {
|
165 | switch (type.$$typeof) {
|
166 | case REACT_CONTEXT_TYPE:
|
167 | return 'Context.Consumer';
|
168 | case REACT_PROVIDER_TYPE:
|
169 | return 'Context.Provider';
|
170 | case REACT_FORWARD_REF_TYPE:
|
171 | return getWrappedName(type, type.render, 'ForwardRef');
|
172 | case REACT_MEMO_TYPE:
|
173 | return getComponentName(type.type);
|
174 | case REACT_LAZY_TYPE:
|
175 | {
|
176 | var thenable = type;
|
177 | var resolvedThenable = refineResolvedLazyComponent(thenable);
|
178 | if (resolvedThenable) {
|
179 | return getComponentName(resolvedThenable);
|
180 | }
|
181 | break;
|
182 | }
|
183 | }
|
184 | }
|
185 | return null;
|
186 | }
|
187 |
|
188 |
|
189 |
|
190 |
|
191 |
|
192 |
|
193 |
|
194 |
|
195 |
|
196 |
|
197 |
|
198 |
|
199 |
|
200 |
|
201 |
|
202 | var lowPriorityWarning = function () {};
|
203 |
|
204 | {
|
205 | var printWarning = function (format) {
|
206 | for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
207 | args[_key - 1] = arguments[_key];
|
208 | }
|
209 |
|
210 | var argIndex = 0;
|
211 | var message = 'Warning: ' + format.replace(/%s/g, function () {
|
212 | return args[argIndex++];
|
213 | });
|
214 | if (typeof console !== 'undefined') {
|
215 | console.warn(message);
|
216 | }
|
217 | try {
|
218 |
|
219 |
|
220 |
|
221 | throw new Error(message);
|
222 | } catch (x) {}
|
223 | };
|
224 |
|
225 | lowPriorityWarning = function (condition, format) {
|
226 | if (format === undefined) {
|
227 | throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');
|
228 | }
|
229 | if (!condition) {
|
230 | for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
231 | args[_key2 - 2] = arguments[_key2];
|
232 | }
|
233 |
|
234 | printWarning.apply(undefined, [format].concat(args));
|
235 | }
|
236 | };
|
237 | }
|
238 |
|
239 | var lowPriorityWarning$1 = lowPriorityWarning;
|
240 |
|
241 | var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
242 |
|
243 |
|
244 |
|
245 |
|
246 | if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) {
|
247 | ReactSharedInternals.ReactCurrentDispatcher = {
|
248 | current: null
|
249 | };
|
250 | }
|
251 | if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) {
|
252 | ReactSharedInternals.ReactCurrentBatchConfig = {
|
253 | suspense: null
|
254 | };
|
255 | }
|
256 |
|
257 |
|
258 |
|
259 |
|
260 |
|
261 |
|
262 |
|
263 |
|
264 | var warning = warningWithoutStack$1;
|
265 |
|
266 | {
|
267 | warning = function (condition, format) {
|
268 | if (condition) {
|
269 | return;
|
270 | }
|
271 | var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
272 | var stack = ReactDebugCurrentFrame.getStackAddendum();
|
273 |
|
274 |
|
275 | for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
276 | args[_key - 2] = arguments[_key];
|
277 | }
|
278 |
|
279 | warningWithoutStack$1.apply(undefined, [false, format + '%s'].concat(args, [stack]));
|
280 | };
|
281 | }
|
282 |
|
283 | var warning$1 = warning;
|
284 |
|
285 | var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
|
286 |
|
287 | var describeComponentFrame = function (name, source, ownerName) {
|
288 | var sourceInfo = '';
|
289 | if (source) {
|
290 | var path = source.fileName;
|
291 | var fileName = path.replace(BEFORE_SLASH_RE, '');
|
292 | {
|
293 |
|
294 |
|
295 | if (/^index\./.test(fileName)) {
|
296 | var match = path.match(BEFORE_SLASH_RE);
|
297 | if (match) {
|
298 | var pathBeforeSlash = match[1];
|
299 | if (pathBeforeSlash) {
|
300 | var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
|
301 | fileName = folderName + '/' + fileName;
|
302 | }
|
303 | }
|
304 | }
|
305 | }
|
306 | sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
|
307 | } else if (ownerName) {
|
308 | sourceInfo = ' (created by ' + ownerName + ')';
|
309 | }
|
310 | return '\n in ' + (name || 'Unknown') + sourceInfo;
|
311 | };
|
312 |
|
313 |
|
314 |
|
315 |
|
316 |
|
317 |
|
318 |
|
319 |
|
320 |
|
321 |
|
322 |
|
323 |
|
324 |
|
325 |
|
326 |
|
327 | var warnAboutDeprecatedLifecycles = true;
|
328 |
|
329 |
|
330 |
|
331 |
|
332 |
|
333 |
|
334 |
|
335 |
|
336 | var enableSuspenseServerRenderer = false;
|
337 |
|
338 |
|
339 |
|
340 |
|
341 |
|
342 |
|
343 |
|
344 |
|
345 | var disableJavaScriptURLs = false;
|
346 |
|
347 |
|
348 |
|
349 |
|
350 |
|
351 |
|
352 |
|
353 |
|
354 |
|
355 |
|
356 |
|
357 |
|
358 |
|
359 |
|
360 |
|
361 |
|
362 | var enableFlareAPI = false;
|
363 |
|
364 |
|
365 | var enableFundamentalAPI = false;
|
366 |
|
367 |
|
368 |
|
369 |
|
370 |
|
371 |
|
372 |
|
373 |
|
374 |
|
375 |
|
376 |
|
377 |
|
378 |
|
379 |
|
380 |
|
381 |
|
382 |
|
383 |
|
384 |
|
385 |
|
386 |
|
387 |
|
388 |
|
389 |
|
390 |
|
391 |
|
392 |
|
393 |
|
394 |
|
395 | var disableLegacyContext = false;
|
396 |
|
397 |
|
398 |
|
399 |
|
400 |
|
401 |
|
402 |
|
403 |
|
404 |
|
405 |
|
406 | var ReactPropTypesSecret$1 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
407 |
|
408 | var ReactPropTypesSecret_1 = ReactPropTypesSecret$1;
|
409 |
|
410 |
|
411 |
|
412 |
|
413 |
|
414 |
|
415 |
|
416 |
|
417 |
|
418 |
|
419 | var printWarning$1 = function() {};
|
420 |
|
421 | {
|
422 | var ReactPropTypesSecret = ReactPropTypesSecret_1;
|
423 | var loggedTypeFailures = {};
|
424 |
|
425 | printWarning$1 = function(text) {
|
426 | var message = 'Warning: ' + text;
|
427 | if (typeof console !== 'undefined') {
|
428 | console.error(message);
|
429 | }
|
430 | try {
|
431 |
|
432 |
|
433 |
|
434 | throw new Error(message);
|
435 | } catch (x) {}
|
436 | };
|
437 | }
|
438 |
|
439 |
|
440 |
|
441 |
|
442 |
|
443 |
|
444 |
|
445 |
|
446 |
|
447 |
|
448 |
|
449 |
|
450 | function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
451 | {
|
452 | for (var typeSpecName in typeSpecs) {
|
453 | if (typeSpecs.hasOwnProperty(typeSpecName)) {
|
454 | var error;
|
455 |
|
456 |
|
457 |
|
458 | try {
|
459 |
|
460 |
|
461 | if (typeof typeSpecs[typeSpecName] !== 'function') {
|
462 | var err = Error(
|
463 | (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
|
464 | 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
|
465 | );
|
466 | err.name = 'Invariant Violation';
|
467 | throw err;
|
468 | }
|
469 | error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
470 | } catch (ex) {
|
471 | error = ex;
|
472 | }
|
473 | if (error && !(error instanceof Error)) {
|
474 | printWarning$1(
|
475 | (componentName || 'React class') + ': type specification of ' +
|
476 | location + ' `' + typeSpecName + '` is invalid; the type checker ' +
|
477 | 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
|
478 | 'You may have forgotten to pass an argument to the type checker ' +
|
479 | 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
|
480 | 'shape all require an argument).'
|
481 | );
|
482 |
|
483 | }
|
484 | if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
485 |
|
486 |
|
487 | loggedTypeFailures[error.message] = true;
|
488 |
|
489 | var stack = getStack ? getStack() : '';
|
490 |
|
491 | printWarning$1(
|
492 | 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
|
493 | );
|
494 | }
|
495 | }
|
496 | }
|
497 | }
|
498 | }
|
499 |
|
500 | var checkPropTypes_1 = checkPropTypes;
|
501 |
|
502 | var ReactDebugCurrentFrame$1 = void 0;
|
503 | var didWarnAboutInvalidateContextType = void 0;
|
504 | {
|
505 | ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
506 | didWarnAboutInvalidateContextType = new Set();
|
507 | }
|
508 |
|
509 | var emptyObject = {};
|
510 | {
|
511 | Object.freeze(emptyObject);
|
512 | }
|
513 |
|
514 | function maskContext(type, context) {
|
515 | var contextTypes = type.contextTypes;
|
516 | if (!contextTypes) {
|
517 | return emptyObject;
|
518 | }
|
519 | var maskedContext = {};
|
520 | for (var contextName in contextTypes) {
|
521 | maskedContext[contextName] = context[contextName];
|
522 | }
|
523 | return maskedContext;
|
524 | }
|
525 |
|
526 | function checkContextTypes(typeSpecs, values, location) {
|
527 | {
|
528 | checkPropTypes_1(typeSpecs, values, location, 'Component', ReactDebugCurrentFrame$1.getCurrentStack);
|
529 | }
|
530 | }
|
531 |
|
532 | function validateContextBounds(context, threadID) {
|
533 |
|
534 |
|
535 |
|
536 |
|
537 | for (var i = context._threadCount | 0; i <= threadID; i++) {
|
538 |
|
539 |
|
540 |
|
541 | context[i] = context._currentValue2;
|
542 | context._threadCount = i + 1;
|
543 | }
|
544 | }
|
545 |
|
546 | function processContext(type, context, threadID, isClass) {
|
547 | if (isClass) {
|
548 | var contextType = type.contextType;
|
549 | {
|
550 | if ('contextType' in type) {
|
551 | var isValid =
|
552 |
|
553 | contextType === null || contextType !== undefined && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === undefined;
|
554 |
|
555 | if (!isValid && !didWarnAboutInvalidateContextType.has(type)) {
|
556 | didWarnAboutInvalidateContextType.add(type);
|
557 |
|
558 | var addendum = '';
|
559 | if (contextType === undefined) {
|
560 | addendum = ' However, it is set to undefined. ' + 'This can be caused by a typo or by mixing up named and default imports. ' + 'This can also happen due to a circular dependency, so ' + 'try moving the createContext() call to a separate file.';
|
561 | } else if (typeof contextType !== 'object') {
|
562 | addendum = ' However, it is set to a ' + typeof contextType + '.';
|
563 | } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) {
|
564 | addendum = ' Did you accidentally pass the Context.Provider instead?';
|
565 | } else if (contextType._context !== undefined) {
|
566 |
|
567 | addendum = ' Did you accidentally pass the Context.Consumer instead?';
|
568 | } else {
|
569 | addendum = ' However, it is set to an object with keys {' + Object.keys(contextType).join(', ') + '}.';
|
570 | }
|
571 | warningWithoutStack$1(false, '%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext().%s', getComponentName(type) || 'Component', addendum);
|
572 | }
|
573 | }
|
574 | }
|
575 | if (typeof contextType === 'object' && contextType !== null) {
|
576 | validateContextBounds(contextType, threadID);
|
577 | return contextType[threadID];
|
578 | }
|
579 | if (disableLegacyContext) {
|
580 | {
|
581 | if (type.contextTypes) {
|
582 | warningWithoutStack$1(false, '%s uses the legacy contextTypes API which is no longer supported. ' + 'Use React.createContext() with static contextType instead.', getComponentName(type) || 'Unknown');
|
583 | }
|
584 | }
|
585 | return emptyObject;
|
586 | } else {
|
587 | var maskedContext = maskContext(type, context);
|
588 | {
|
589 | if (type.contextTypes) {
|
590 | checkContextTypes(type.contextTypes, maskedContext, 'context');
|
591 | }
|
592 | }
|
593 | return maskedContext;
|
594 | }
|
595 | } else {
|
596 | if (disableLegacyContext) {
|
597 | {
|
598 | if (type.contextTypes) {
|
599 | warningWithoutStack$1(false, '%s uses the legacy contextTypes API which is no longer supported. ' + 'Use React.createContext() with React.useContext() instead.', getComponentName(type) || 'Unknown');
|
600 | }
|
601 | }
|
602 | return undefined;
|
603 | } else {
|
604 | var _maskedContext = maskContext(type, context);
|
605 | {
|
606 | if (type.contextTypes) {
|
607 | checkContextTypes(type.contextTypes, _maskedContext, 'context');
|
608 | }
|
609 | }
|
610 | return _maskedContext;
|
611 | }
|
612 | }
|
613 | }
|
614 |
|
615 |
|
616 |
|
617 |
|
618 |
|
619 | var nextAvailableThreadIDs = new Uint16Array(16);
|
620 | for (var i = 0; i < 15; i++) {
|
621 | nextAvailableThreadIDs[i] = i + 1;
|
622 | }
|
623 | nextAvailableThreadIDs[15] = 0;
|
624 |
|
625 | function growThreadCountAndReturnNextAvailable() {
|
626 | var oldArray = nextAvailableThreadIDs;
|
627 | var oldSize = oldArray.length;
|
628 | var newSize = oldSize * 2;
|
629 | (function () {
|
630 | if (!(newSize <= 0x10000)) {
|
631 | {
|
632 | throw ReactError(Error('Maximum number of concurrent React renderers exceeded. This can happen if you are not properly destroying the Readable provided by React. Ensure that you call .destroy() on it if you no longer want to read from it, and did not read to the end. If you use .pipe() this should be automatic.'));
|
633 | }
|
634 | }
|
635 | })();
|
636 | var newArray = new Uint16Array(newSize);
|
637 | newArray.set(oldArray);
|
638 | nextAvailableThreadIDs = newArray;
|
639 | nextAvailableThreadIDs[0] = oldSize + 1;
|
640 | for (var _i = oldSize; _i < newSize - 1; _i++) {
|
641 | nextAvailableThreadIDs[_i] = _i + 1;
|
642 | }
|
643 | nextAvailableThreadIDs[newSize - 1] = 0;
|
644 | return oldSize;
|
645 | }
|
646 |
|
647 | function allocThreadID() {
|
648 | var nextID = nextAvailableThreadIDs[0];
|
649 | if (nextID === 0) {
|
650 | return growThreadCountAndReturnNextAvailable();
|
651 | }
|
652 | nextAvailableThreadIDs[0] = nextAvailableThreadIDs[nextID];
|
653 | return nextID;
|
654 | }
|
655 |
|
656 | function freeThreadID(id) {
|
657 | nextAvailableThreadIDs[id] = nextAvailableThreadIDs[0];
|
658 | nextAvailableThreadIDs[0] = id;
|
659 | }
|
660 |
|
661 |
|
662 |
|
663 | var RESERVED = 0;
|
664 |
|
665 |
|
666 |
|
667 | var STRING = 1;
|
668 |
|
669 |
|
670 |
|
671 |
|
672 |
|
673 | var BOOLEANISH_STRING = 2;
|
674 |
|
675 |
|
676 |
|
677 |
|
678 | var BOOLEAN = 3;
|
679 |
|
680 |
|
681 |
|
682 |
|
683 |
|
684 | var OVERLOADED_BOOLEAN = 4;
|
685 |
|
686 |
|
687 |
|
688 | var NUMERIC = 5;
|
689 |
|
690 |
|
691 |
|
692 | var POSITIVE_NUMERIC = 6;
|
693 |
|
694 |
|
695 | var ATTRIBUTE_NAME_START_CHAR = ':A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD';
|
696 |
|
697 | var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040';
|
698 |
|
699 |
|
700 | var ROOT_ATTRIBUTE_NAME = 'data-reactroot';
|
701 | var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');
|
702 |
|
703 | var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
704 | var illegalAttributeNameCache = {};
|
705 | var validatedAttributeNameCache = {};
|
706 |
|
707 | function isAttributeNameSafe(attributeName) {
|
708 | if (hasOwnProperty$1.call(validatedAttributeNameCache, attributeName)) {
|
709 | return true;
|
710 | }
|
711 | if (hasOwnProperty$1.call(illegalAttributeNameCache, attributeName)) {
|
712 | return false;
|
713 | }
|
714 | if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
|
715 | validatedAttributeNameCache[attributeName] = true;
|
716 | return true;
|
717 | }
|
718 | illegalAttributeNameCache[attributeName] = true;
|
719 | {
|
720 | warning$1(false, 'Invalid attribute name: `%s`', attributeName);
|
721 | }
|
722 | return false;
|
723 | }
|
724 |
|
725 | function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {
|
726 | if (propertyInfo !== null) {
|
727 | return propertyInfo.type === RESERVED;
|
728 | }
|
729 | if (isCustomComponentTag) {
|
730 | return false;
|
731 | }
|
732 | if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {
|
733 | return true;
|
734 | }
|
735 | return false;
|
736 | }
|
737 |
|
738 | function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {
|
739 | if (propertyInfo !== null && propertyInfo.type === RESERVED) {
|
740 | return false;
|
741 | }
|
742 | switch (typeof value) {
|
743 | case 'function':
|
744 |
|
745 | case 'symbol':
|
746 |
|
747 | return true;
|
748 | case 'boolean':
|
749 | {
|
750 | if (isCustomComponentTag) {
|
751 | return false;
|
752 | }
|
753 | if (propertyInfo !== null) {
|
754 | return !propertyInfo.acceptsBooleans;
|
755 | } else {
|
756 | var prefix = name.toLowerCase().slice(0, 5);
|
757 | return prefix !== 'data-' && prefix !== 'aria-';
|
758 | }
|
759 | }
|
760 | default:
|
761 | return false;
|
762 | }
|
763 | }
|
764 |
|
765 | function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
|
766 | if (value === null || typeof value === 'undefined') {
|
767 | return true;
|
768 | }
|
769 | if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
|
770 | return true;
|
771 | }
|
772 | if (isCustomComponentTag) {
|
773 | return false;
|
774 | }
|
775 | if (propertyInfo !== null) {
|
776 | switch (propertyInfo.type) {
|
777 | case BOOLEAN:
|
778 | return !value;
|
779 | case OVERLOADED_BOOLEAN:
|
780 | return value === false;
|
781 | case NUMERIC:
|
782 | return isNaN(value);
|
783 | case POSITIVE_NUMERIC:
|
784 | return isNaN(value) || value < 1;
|
785 | }
|
786 | }
|
787 | return false;
|
788 | }
|
789 |
|
790 | function getPropertyInfo(name) {
|
791 | return properties.hasOwnProperty(name) ? properties[name] : null;
|
792 | }
|
793 |
|
794 | function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL) {
|
795 | this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
|
796 | this.attributeName = attributeName;
|
797 | this.attributeNamespace = attributeNamespace;
|
798 | this.mustUseProperty = mustUseProperty;
|
799 | this.propertyName = name;
|
800 | this.type = type;
|
801 | this.sanitizeURL = sanitizeURL;
|
802 | }
|
803 |
|
804 |
|
805 |
|
806 |
|
807 | var properties = {};
|
808 |
|
809 |
|
810 | ['children', 'dangerouslySetInnerHTML',
|
811 |
|
812 |
|
813 |
|
814 | 'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'].forEach(function (name) {
|
815 | properties[name] = new PropertyInfoRecord(name, RESERVED, false,
|
816 | name,
|
817 | null,
|
818 | false);
|
819 | }
|
820 | );
|
821 |
|
822 |
|
823 |
|
824 | [['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {
|
825 | var name = _ref[0],
|
826 | attributeName = _ref[1];
|
827 |
|
828 | properties[name] = new PropertyInfoRecord(name, STRING, false,
|
829 | attributeName,
|
830 | null,
|
831 | false);
|
832 | }
|
833 | );
|
834 |
|
835 |
|
836 |
|
837 |
|
838 | ['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) {
|
839 | properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false,
|
840 | name.toLowerCase(),
|
841 | null,
|
842 | false);
|
843 | }
|
844 | );
|
845 |
|
846 |
|
847 |
|
848 |
|
849 |
|
850 | ['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) {
|
851 | properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false,
|
852 | name,
|
853 | null,
|
854 | false);
|
855 | }
|
856 | );
|
857 |
|
858 |
|
859 | ['allowFullScreen', 'async',
|
860 |
|
861 |
|
862 | 'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless',
|
863 |
|
864 | 'itemScope'].forEach(function (name) {
|
865 | properties[name] = new PropertyInfoRecord(name, BOOLEAN, false,
|
866 | name.toLowerCase(),
|
867 | null,
|
868 | false);
|
869 | }
|
870 | );
|
871 |
|
872 |
|
873 |
|
874 | ['checked',
|
875 |
|
876 |
|
877 | 'multiple', 'muted', 'selected'].forEach(function (name) {
|
878 | properties[name] = new PropertyInfoRecord(name, BOOLEAN, true,
|
879 | name,
|
880 | null,
|
881 | false);
|
882 | }
|
883 | );
|
884 |
|
885 |
|
886 |
|
887 | ['capture', 'download'].forEach(function (name) {
|
888 | properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false,
|
889 | name,
|
890 | null,
|
891 | false);
|
892 | }
|
893 | );
|
894 |
|
895 |
|
896 | ['cols', 'rows', 'size', 'span'].forEach(function (name) {
|
897 | properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false,
|
898 | name,
|
899 | null,
|
900 | false);
|
901 | }
|
902 | );
|
903 |
|
904 |
|
905 | ['rowSpan', 'start'].forEach(function (name) {
|
906 | properties[name] = new PropertyInfoRecord(name, NUMERIC, false,
|
907 | name.toLowerCase(),
|
908 | null,
|
909 | false);
|
910 | }
|
911 | );
|
912 |
|
913 | var CAMELIZE = /[\-\:]([a-z])/g;
|
914 | var capitalize = function (token) {
|
915 | return token[1].toUpperCase();
|
916 | };
|
917 |
|
918 |
|
919 |
|
920 |
|
921 |
|
922 |
|
923 | ['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height'].forEach(function (attributeName) {
|
924 | var name = attributeName.replace(CAMELIZE, capitalize);
|
925 | properties[name] = new PropertyInfoRecord(name, STRING, false,
|
926 | attributeName, null,
|
927 | false);
|
928 | }
|
929 | );
|
930 |
|
931 |
|
932 | ['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type'].forEach(function (attributeName) {
|
933 | var name = attributeName.replace(CAMELIZE, capitalize);
|
934 | properties[name] = new PropertyInfoRecord(name, STRING, false,
|
935 | attributeName, 'http://www.w3.org/1999/xlink', false);
|
936 | }
|
937 | );
|
938 |
|
939 |
|
940 | ['xml:base', 'xml:lang', 'xml:space'].forEach(function (attributeName) {
|
941 | var name = attributeName.replace(CAMELIZE, capitalize);
|
942 | properties[name] = new PropertyInfoRecord(name, STRING, false,
|
943 | attributeName, 'http://www.w3.org/XML/1998/namespace', false);
|
944 | }
|
945 | );
|
946 |
|
947 |
|
948 |
|
949 |
|
950 | ['tabIndex', 'crossOrigin'].forEach(function (attributeName) {
|
951 | properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false,
|
952 | attributeName.toLowerCase(),
|
953 | null,
|
954 | false);
|
955 | }
|
956 | );
|
957 |
|
958 |
|
959 |
|
960 | var xlinkHref = 'xlinkHref';
|
961 | properties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false,
|
962 | 'xlink:href', 'http://www.w3.org/1999/xlink', true);
|
963 |
|
964 | ['src', 'href', 'action', 'formAction'].forEach(function (attributeName) {
|
965 | properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false,
|
966 | attributeName.toLowerCase(),
|
967 | null,
|
968 | true);
|
969 | }
|
970 | );
|
971 |
|
972 | var ReactDebugCurrentFrame$2 = null;
|
973 | {
|
974 | ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame;
|
975 | }
|
976 |
|
977 |
|
978 |
|
979 |
|
980 |
|
981 |
|
982 |
|
983 |
|
984 |
|
985 |
|
986 |
|
987 | var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;
|
988 |
|
989 | var didWarn = false;
|
990 |
|
991 | function sanitizeURL(url) {
|
992 | if (disableJavaScriptURLs) {
|
993 | (function () {
|
994 | if (!!isJavaScriptProtocol.test(url)) {
|
995 | {
|
996 | throw ReactError(Error('React has blocked a javascript: URL as a security precaution.' + (ReactDebugCurrentFrame$2.getStackAddendum())));
|
997 | }
|
998 | }
|
999 | })();
|
1000 | } else if (true && !didWarn && isJavaScriptProtocol.test(url)) {
|
1001 | didWarn = true;
|
1002 | warning$1(false, 'A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url));
|
1003 | }
|
1004 | }
|
1005 |
|
1006 |
|
1007 |
|
1008 |
|
1009 |
|
1010 |
|
1011 |
|
1012 | var matchHtmlRegExp = /["'&<>]/;
|
1013 |
|
1014 |
|
1015 |
|
1016 |
|
1017 |
|
1018 |
|
1019 |
|
1020 |
|
1021 |
|
1022 | function escapeHtml(string) {
|
1023 | var str = '' + string;
|
1024 | var match = matchHtmlRegExp.exec(str);
|
1025 |
|
1026 | if (!match) {
|
1027 | return str;
|
1028 | }
|
1029 |
|
1030 | var escape = void 0;
|
1031 | var html = '';
|
1032 | var index = void 0;
|
1033 | var lastIndex = 0;
|
1034 |
|
1035 | for (index = match.index; index < str.length; index++) {
|
1036 | switch (str.charCodeAt(index)) {
|
1037 | case 34:
|
1038 |
|
1039 | escape = '"';
|
1040 | break;
|
1041 | case 38:
|
1042 |
|
1043 | escape = '&';
|
1044 | break;
|
1045 | case 39:
|
1046 |
|
1047 | escape = ''';
|
1048 | break;
|
1049 | case 60:
|
1050 |
|
1051 | escape = '<';
|
1052 | break;
|
1053 | case 62:
|
1054 |
|
1055 | escape = '>';
|
1056 | break;
|
1057 | default:
|
1058 | continue;
|
1059 | }
|
1060 |
|
1061 | if (lastIndex !== index) {
|
1062 | html += str.substring(lastIndex, index);
|
1063 | }
|
1064 |
|
1065 | lastIndex = index + 1;
|
1066 | html += escape;
|
1067 | }
|
1068 |
|
1069 | return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
|
1070 | }
|
1071 |
|
1072 |
|
1073 |
|
1074 |
|
1075 |
|
1076 |
|
1077 |
|
1078 |
|
1079 | function escapeTextForBrowser(text) {
|
1080 | if (typeof text === 'boolean' || typeof text === 'number') {
|
1081 |
|
1082 |
|
1083 |
|
1084 | return '' + text;
|
1085 | }
|
1086 | return escapeHtml(text);
|
1087 | }
|
1088 |
|
1089 |
|
1090 |
|
1091 |
|
1092 |
|
1093 |
|
1094 |
|
1095 | function quoteAttributeValueForBrowser(value) {
|
1096 | return '"' + escapeTextForBrowser(value) + '"';
|
1097 | }
|
1098 |
|
1099 |
|
1100 |
|
1101 |
|
1102 |
|
1103 |
|
1104 |
|
1105 |
|
1106 |
|
1107 |
|
1108 |
|
1109 |
|
1110 |
|
1111 | function createMarkupForRoot() {
|
1112 | return ROOT_ATTRIBUTE_NAME + '=""';
|
1113 | }
|
1114 |
|
1115 |
|
1116 |
|
1117 |
|
1118 |
|
1119 |
|
1120 |
|
1121 |
|
1122 | function createMarkupForProperty(name, value) {
|
1123 | var propertyInfo = getPropertyInfo(name);
|
1124 | if (name !== 'style' && shouldIgnoreAttribute(name, propertyInfo, false)) {
|
1125 | return '';
|
1126 | }
|
1127 | if (shouldRemoveAttribute(name, value, propertyInfo, false)) {
|
1128 | return '';
|
1129 | }
|
1130 | if (propertyInfo !== null) {
|
1131 | var attributeName = propertyInfo.attributeName;
|
1132 | var type = propertyInfo.type;
|
1133 |
|
1134 | if (type === BOOLEAN || type === OVERLOADED_BOOLEAN && value === true) {
|
1135 | return attributeName + '=""';
|
1136 | } else {
|
1137 | if (propertyInfo.sanitizeURL) {
|
1138 | value = '' + value;
|
1139 | sanitizeURL(value);
|
1140 | }
|
1141 | return attributeName + '=' + quoteAttributeValueForBrowser(value);
|
1142 | }
|
1143 | } else if (isAttributeNameSafe(name)) {
|
1144 | return name + '=' + quoteAttributeValueForBrowser(value);
|
1145 | }
|
1146 | return '';
|
1147 | }
|
1148 |
|
1149 |
|
1150 |
|
1151 |
|
1152 |
|
1153 |
|
1154 |
|
1155 |
|
1156 | function createMarkupForCustomAttribute(name, value) {
|
1157 | if (!isAttributeNameSafe(name) || value == null) {
|
1158 | return '';
|
1159 | }
|
1160 | return name + '=' + quoteAttributeValueForBrowser(value);
|
1161 | }
|
1162 |
|
1163 |
|
1164 |
|
1165 |
|
1166 |
|
1167 | function is(x, y) {
|
1168 | return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y
|
1169 | ;
|
1170 | }
|
1171 |
|
1172 | var currentlyRenderingComponent = null;
|
1173 | var firstWorkInProgressHook = null;
|
1174 | var workInProgressHook = null;
|
1175 |
|
1176 | var isReRender = false;
|
1177 |
|
1178 | var didScheduleRenderPhaseUpdate = false;
|
1179 |
|
1180 | var renderPhaseUpdates = null;
|
1181 |
|
1182 | var numberOfReRenders = 0;
|
1183 | var RE_RENDER_LIMIT = 25;
|
1184 |
|
1185 | var isInHookUserCodeInDev = false;
|
1186 |
|
1187 |
|
1188 | var currentHookNameInDev = void 0;
|
1189 |
|
1190 | function resolveCurrentlyRenderingComponent() {
|
1191 | (function () {
|
1192 | if (!(currentlyRenderingComponent !== null)) {
|
1193 | {
|
1194 | throw ReactError(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://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.'));
|
1195 | }
|
1196 | }
|
1197 | })();
|
1198 | {
|
1199 | !!isInHookUserCodeInDev ? warning$1(false, 'Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. ' + 'You can only call Hooks at the top level of your React function. ' + 'For more information, see ' + 'https://fb.me/rules-of-hooks') : void 0;
|
1200 | }
|
1201 | return currentlyRenderingComponent;
|
1202 | }
|
1203 |
|
1204 | function areHookInputsEqual(nextDeps, prevDeps) {
|
1205 | if (prevDeps === null) {
|
1206 | {
|
1207 | warning$1(false, '%s received a final argument during this render, but not during ' + 'the previous render. Even though the final argument is optional, ' + 'its type cannot change between renders.', currentHookNameInDev);
|
1208 | }
|
1209 | return false;
|
1210 | }
|
1211 |
|
1212 | {
|
1213 |
|
1214 |
|
1215 | if (nextDeps.length !== prevDeps.length) {
|
1216 | warning$1(false, 'The final argument passed to %s changed size between renders. The ' + 'order and size of this array must remain constant.\n\n' + 'Previous: %s\n' + 'Incoming: %s', currentHookNameInDev, '[' + nextDeps.join(', ') + ']', '[' + prevDeps.join(', ') + ']');
|
1217 | }
|
1218 | }
|
1219 | for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) {
|
1220 | if (is(nextDeps[i], prevDeps[i])) {
|
1221 | continue;
|
1222 | }
|
1223 | return false;
|
1224 | }
|
1225 | return true;
|
1226 | }
|
1227 |
|
1228 | function createHook() {
|
1229 | if (numberOfReRenders > 0) {
|
1230 | (function () {
|
1231 | {
|
1232 | {
|
1233 | throw ReactError(Error('Rendered more hooks than during the previous render'));
|
1234 | }
|
1235 | }
|
1236 | })();
|
1237 | }
|
1238 | return {
|
1239 | memoizedState: null,
|
1240 | queue: null,
|
1241 | next: null
|
1242 | };
|
1243 | }
|
1244 |
|
1245 | function createWorkInProgressHook() {
|
1246 | if (workInProgressHook === null) {
|
1247 |
|
1248 | if (firstWorkInProgressHook === null) {
|
1249 | isReRender = false;
|
1250 | firstWorkInProgressHook = workInProgressHook = createHook();
|
1251 | } else {
|
1252 |
|
1253 | isReRender = true;
|
1254 | workInProgressHook = firstWorkInProgressHook;
|
1255 | }
|
1256 | } else {
|
1257 | if (workInProgressHook.next === null) {
|
1258 | isReRender = false;
|
1259 |
|
1260 | workInProgressHook = workInProgressHook.next = createHook();
|
1261 | } else {
|
1262 |
|
1263 | isReRender = true;
|
1264 | workInProgressHook = workInProgressHook.next;
|
1265 | }
|
1266 | }
|
1267 | return workInProgressHook;
|
1268 | }
|
1269 |
|
1270 | function prepareToUseHooks(componentIdentity) {
|
1271 | currentlyRenderingComponent = componentIdentity;
|
1272 | {
|
1273 | isInHookUserCodeInDev = false;
|
1274 | }
|
1275 |
|
1276 |
|
1277 |
|
1278 |
|
1279 |
|
1280 |
|
1281 |
|
1282 | }
|
1283 |
|
1284 | function finishHooks(Component, props, children, refOrContext) {
|
1285 |
|
1286 |
|
1287 |
|
1288 | while (didScheduleRenderPhaseUpdate) {
|
1289 |
|
1290 |
|
1291 |
|
1292 |
|
1293 | didScheduleRenderPhaseUpdate = false;
|
1294 | numberOfReRenders += 1;
|
1295 |
|
1296 |
|
1297 | workInProgressHook = null;
|
1298 |
|
1299 | children = Component(props, refOrContext);
|
1300 | }
|
1301 | currentlyRenderingComponent = null;
|
1302 | firstWorkInProgressHook = null;
|
1303 | numberOfReRenders = 0;
|
1304 | renderPhaseUpdates = null;
|
1305 | workInProgressHook = null;
|
1306 | {
|
1307 | isInHookUserCodeInDev = false;
|
1308 | }
|
1309 |
|
1310 |
|
1311 |
|
1312 |
|
1313 |
|
1314 |
|
1315 |
|
1316 |
|
1317 |
|
1318 | return children;
|
1319 | }
|
1320 |
|
1321 | function readContext(context, observedBits) {
|
1322 | var threadID = currentThreadID;
|
1323 | validateContextBounds(context, threadID);
|
1324 | {
|
1325 | !!isInHookUserCodeInDev ? warning$1(false, 'Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().') : void 0;
|
1326 | }
|
1327 | return context[threadID];
|
1328 | }
|
1329 |
|
1330 | function useContext(context, observedBits) {
|
1331 | {
|
1332 | currentHookNameInDev = 'useContext';
|
1333 | }
|
1334 | resolveCurrentlyRenderingComponent();
|
1335 | var threadID = currentThreadID;
|
1336 | validateContextBounds(context, threadID);
|
1337 | return context[threadID];
|
1338 | }
|
1339 |
|
1340 | function basicStateReducer(state, action) {
|
1341 | return typeof action === 'function' ? action(state) : action;
|
1342 | }
|
1343 |
|
1344 | function useState(initialState) {
|
1345 | {
|
1346 | currentHookNameInDev = 'useState';
|
1347 | }
|
1348 | return useReducer(basicStateReducer,
|
1349 |
|
1350 | initialState);
|
1351 | }
|
1352 |
|
1353 | function useReducer(reducer, initialArg, init) {
|
1354 | {
|
1355 | if (reducer !== basicStateReducer) {
|
1356 | currentHookNameInDev = 'useReducer';
|
1357 | }
|
1358 | }
|
1359 | currentlyRenderingComponent = resolveCurrentlyRenderingComponent();
|
1360 | workInProgressHook = createWorkInProgressHook();
|
1361 | if (isReRender) {
|
1362 |
|
1363 | var _queue = workInProgressHook.queue;
|
1364 | var _dispatch = _queue.dispatch;
|
1365 | if (renderPhaseUpdates !== null) {
|
1366 |
|
1367 | var firstRenderPhaseUpdate = renderPhaseUpdates.get(_queue);
|
1368 | if (firstRenderPhaseUpdate !== undefined) {
|
1369 | renderPhaseUpdates.delete(_queue);
|
1370 | var newState = workInProgressHook.memoizedState;
|
1371 | var update = firstRenderPhaseUpdate;
|
1372 | do {
|
1373 |
|
1374 |
|
1375 |
|
1376 | var _action = update.action;
|
1377 | {
|
1378 | isInHookUserCodeInDev = true;
|
1379 | }
|
1380 | newState = reducer(newState, _action);
|
1381 | {
|
1382 | isInHookUserCodeInDev = false;
|
1383 | }
|
1384 | update = update.next;
|
1385 | } while (update !== null);
|
1386 |
|
1387 | workInProgressHook.memoizedState = newState;
|
1388 |
|
1389 | return [newState, _dispatch];
|
1390 | }
|
1391 | }
|
1392 | return [workInProgressHook.memoizedState, _dispatch];
|
1393 | } else {
|
1394 | {
|
1395 | isInHookUserCodeInDev = true;
|
1396 | }
|
1397 | var initialState = void 0;
|
1398 | if (reducer === basicStateReducer) {
|
1399 |
|
1400 | initialState = typeof initialArg === 'function' ? initialArg() : initialArg;
|
1401 | } else {
|
1402 | initialState = init !== undefined ? init(initialArg) : initialArg;
|
1403 | }
|
1404 | {
|
1405 | isInHookUserCodeInDev = false;
|
1406 | }
|
1407 | workInProgressHook.memoizedState = initialState;
|
1408 | var _queue2 = workInProgressHook.queue = {
|
1409 | last: null,
|
1410 | dispatch: null
|
1411 | };
|
1412 | var _dispatch2 = _queue2.dispatch = dispatchAction.bind(null, currentlyRenderingComponent, _queue2);
|
1413 | return [workInProgressHook.memoizedState, _dispatch2];
|
1414 | }
|
1415 | }
|
1416 |
|
1417 | function useMemo(nextCreate, deps) {
|
1418 | currentlyRenderingComponent = resolveCurrentlyRenderingComponent();
|
1419 | workInProgressHook = createWorkInProgressHook();
|
1420 |
|
1421 | var nextDeps = deps === undefined ? null : deps;
|
1422 |
|
1423 | if (workInProgressHook !== null) {
|
1424 | var prevState = workInProgressHook.memoizedState;
|
1425 | if (prevState !== null) {
|
1426 | if (nextDeps !== null) {
|
1427 | var prevDeps = prevState[1];
|
1428 | if (areHookInputsEqual(nextDeps, prevDeps)) {
|
1429 | return prevState[0];
|
1430 | }
|
1431 | }
|
1432 | }
|
1433 | }
|
1434 |
|
1435 | {
|
1436 | isInHookUserCodeInDev = true;
|
1437 | }
|
1438 | var nextValue = nextCreate();
|
1439 | {
|
1440 | isInHookUserCodeInDev = false;
|
1441 | }
|
1442 | workInProgressHook.memoizedState = [nextValue, nextDeps];
|
1443 | return nextValue;
|
1444 | }
|
1445 |
|
1446 | function useRef(initialValue) {
|
1447 | currentlyRenderingComponent = resolveCurrentlyRenderingComponent();
|
1448 | workInProgressHook = createWorkInProgressHook();
|
1449 | var previousRef = workInProgressHook.memoizedState;
|
1450 | if (previousRef === null) {
|
1451 | var ref = { current: initialValue };
|
1452 | {
|
1453 | Object.seal(ref);
|
1454 | }
|
1455 | workInProgressHook.memoizedState = ref;
|
1456 | return ref;
|
1457 | } else {
|
1458 | return previousRef;
|
1459 | }
|
1460 | }
|
1461 |
|
1462 | function useLayoutEffect(create, inputs) {
|
1463 | {
|
1464 | currentHookNameInDev = 'useLayoutEffect';
|
1465 | }
|
1466 | warning$1(false, 'useLayoutEffect does nothing on the server, because its effect cannot ' + "be encoded into the server renderer's output format. This will lead " + 'to a mismatch between the initial, non-hydrated UI and the intended ' + 'UI. To avoid this, useLayoutEffect should only be used in ' + 'components that render exclusively on the client. ' + 'See https://fb.me/react-uselayouteffect-ssr for common fixes.');
|
1467 | }
|
1468 |
|
1469 | function dispatchAction(componentIdentity, queue, action) {
|
1470 | (function () {
|
1471 | if (!(numberOfReRenders < RE_RENDER_LIMIT)) {
|
1472 | {
|
1473 | throw ReactError(Error('Too many re-renders. React limits the number of renders to prevent an infinite loop.'));
|
1474 | }
|
1475 | }
|
1476 | })();
|
1477 |
|
1478 | if (componentIdentity === currentlyRenderingComponent) {
|
1479 |
|
1480 |
|
1481 |
|
1482 | didScheduleRenderPhaseUpdate = true;
|
1483 | var update = {
|
1484 | action: action,
|
1485 | next: null
|
1486 | };
|
1487 | if (renderPhaseUpdates === null) {
|
1488 | renderPhaseUpdates = new Map();
|
1489 | }
|
1490 | var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue);
|
1491 | if (firstRenderPhaseUpdate === undefined) {
|
1492 | renderPhaseUpdates.set(queue, update);
|
1493 | } else {
|
1494 |
|
1495 | var lastRenderPhaseUpdate = firstRenderPhaseUpdate;
|
1496 | while (lastRenderPhaseUpdate.next !== null) {
|
1497 | lastRenderPhaseUpdate = lastRenderPhaseUpdate.next;
|
1498 | }
|
1499 | lastRenderPhaseUpdate.next = update;
|
1500 | }
|
1501 | } else {
|
1502 |
|
1503 |
|
1504 |
|
1505 | }
|
1506 | }
|
1507 |
|
1508 | function useCallback(callback, deps) {
|
1509 |
|
1510 | return callback;
|
1511 | }
|
1512 |
|
1513 | function useResponder(responder, props) {
|
1514 | return {
|
1515 | props: props,
|
1516 | responder: responder
|
1517 | };
|
1518 | }
|
1519 |
|
1520 | function noop() {}
|
1521 |
|
1522 | var currentThreadID = 0;
|
1523 |
|
1524 | function setCurrentThreadID(threadID) {
|
1525 | currentThreadID = threadID;
|
1526 | }
|
1527 |
|
1528 | var Dispatcher = {
|
1529 | readContext: readContext,
|
1530 | useContext: useContext,
|
1531 | useMemo: useMemo,
|
1532 | useReducer: useReducer,
|
1533 | useRef: useRef,
|
1534 | useState: useState,
|
1535 | useLayoutEffect: useLayoutEffect,
|
1536 | useCallback: useCallback,
|
1537 |
|
1538 | useImperativeHandle: noop,
|
1539 |
|
1540 | useEffect: noop,
|
1541 |
|
1542 | useDebugValue: noop,
|
1543 | useResponder: useResponder
|
1544 | };
|
1545 |
|
1546 | var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
|
1547 | var MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
|
1548 | var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
|
1549 |
|
1550 | var Namespaces = {
|
1551 | html: HTML_NAMESPACE,
|
1552 | mathml: MATH_NAMESPACE,
|
1553 | svg: SVG_NAMESPACE
|
1554 | };
|
1555 |
|
1556 |
|
1557 | function getIntrinsicNamespace(type) {
|
1558 | switch (type) {
|
1559 | case 'svg':
|
1560 | return SVG_NAMESPACE;
|
1561 | case 'math':
|
1562 | return MATH_NAMESPACE;
|
1563 | default:
|
1564 | return HTML_NAMESPACE;
|
1565 | }
|
1566 | }
|
1567 |
|
1568 | function getChildNamespace(parentNamespace, type) {
|
1569 | if (parentNamespace == null || parentNamespace === HTML_NAMESPACE) {
|
1570 |
|
1571 | return getIntrinsicNamespace(type);
|
1572 | }
|
1573 | if (parentNamespace === SVG_NAMESPACE && type === 'foreignObject') {
|
1574 |
|
1575 | return HTML_NAMESPACE;
|
1576 | }
|
1577 |
|
1578 | return parentNamespace;
|
1579 | }
|
1580 |
|
1581 | var ReactDebugCurrentFrame$3 = null;
|
1582 |
|
1583 | var ReactControlledValuePropTypes = {
|
1584 | checkPropTypes: null
|
1585 | };
|
1586 |
|
1587 | {
|
1588 | ReactDebugCurrentFrame$3 = ReactSharedInternals.ReactDebugCurrentFrame;
|
1589 |
|
1590 | var hasReadOnlyValue = {
|
1591 | button: true,
|
1592 | checkbox: true,
|
1593 | image: true,
|
1594 | hidden: true,
|
1595 | radio: true,
|
1596 | reset: true,
|
1597 | submit: true
|
1598 | };
|
1599 |
|
1600 | var propTypes = {
|
1601 | value: function (props, propName, componentName) {
|
1602 | if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null || enableFlareAPI && props.listeners) {
|
1603 | return null;
|
1604 | }
|
1605 | return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
|
1606 | },
|
1607 | checked: function (props, propName, componentName) {
|
1608 | if (props.onChange || props.readOnly || props.disabled || props[propName] == null || enableFlareAPI && props.listeners) {
|
1609 | return null;
|
1610 | }
|
1611 | return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
|
1612 | }
|
1613 | };
|
1614 |
|
1615 | |
1616 |
|
1617 |
|
1618 |
|
1619 | ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) {
|
1620 | checkPropTypes_1(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$3.getStackAddendum);
|
1621 | };
|
1622 | }
|
1623 |
|
1624 |
|
1625 |
|
1626 |
|
1627 | var omittedCloseTags = {
|
1628 | area: true,
|
1629 | base: true,
|
1630 | br: true,
|
1631 | col: true,
|
1632 | embed: true,
|
1633 | hr: true,
|
1634 | img: true,
|
1635 | input: true,
|
1636 | keygen: true,
|
1637 | link: true,
|
1638 | meta: true,
|
1639 | param: true,
|
1640 | source: true,
|
1641 | track: true,
|
1642 | wbr: true
|
1643 |
|
1644 | };
|
1645 |
|
1646 |
|
1647 |
|
1648 |
|
1649 | var voidElementTags = _assign({
|
1650 | menuitem: true
|
1651 | }, omittedCloseTags);
|
1652 |
|
1653 |
|
1654 |
|
1655 | var HTML = '__html';
|
1656 |
|
1657 | var ReactDebugCurrentFrame$4 = null;
|
1658 | {
|
1659 | ReactDebugCurrentFrame$4 = ReactSharedInternals.ReactDebugCurrentFrame;
|
1660 | }
|
1661 |
|
1662 | function assertValidProps(tag, props) {
|
1663 | if (!props) {
|
1664 | return;
|
1665 | }
|
1666 |
|
1667 | if (voidElementTags[tag]) {
|
1668 | (function () {
|
1669 | if (!(props.children == null && props.dangerouslySetInnerHTML == null)) {
|
1670 | {
|
1671 | throw ReactError(Error(tag + ' is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.' + (ReactDebugCurrentFrame$4.getStackAddendum())));
|
1672 | }
|
1673 | }
|
1674 | })();
|
1675 | }
|
1676 | if (props.dangerouslySetInnerHTML != null) {
|
1677 | (function () {
|
1678 | if (!(props.children == null)) {
|
1679 | {
|
1680 | throw ReactError(Error('Can only set one of `children` or `props.dangerouslySetInnerHTML`.'));
|
1681 | }
|
1682 | }
|
1683 | })();
|
1684 | (function () {
|
1685 | if (!(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML)) {
|
1686 | {
|
1687 | throw ReactError(Error('`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information.'));
|
1688 | }
|
1689 | }
|
1690 | })();
|
1691 | }
|
1692 | {
|
1693 | !(props.suppressContentEditableWarning || !props.contentEditable || props.children == null) ? warning$1(false, 'A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.') : void 0;
|
1694 | }
|
1695 | (function () {
|
1696 | if (!(props.style == null || typeof props.style === 'object')) {
|
1697 | {
|
1698 | throw ReactError(Error('The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + \'em\'}} when using JSX.' + (ReactDebugCurrentFrame$4.getStackAddendum())));
|
1699 | }
|
1700 | }
|
1701 | })();
|
1702 | }
|
1703 |
|
1704 |
|
1705 |
|
1706 |
|
1707 | var isUnitlessNumber = {
|
1708 | animationIterationCount: true,
|
1709 | borderImageOutset: true,
|
1710 | borderImageSlice: true,
|
1711 | borderImageWidth: true,
|
1712 | boxFlex: true,
|
1713 | boxFlexGroup: true,
|
1714 | boxOrdinalGroup: true,
|
1715 | columnCount: true,
|
1716 | columns: true,
|
1717 | flex: true,
|
1718 | flexGrow: true,
|
1719 | flexPositive: true,
|
1720 | flexShrink: true,
|
1721 | flexNegative: true,
|
1722 | flexOrder: true,
|
1723 | gridArea: true,
|
1724 | gridRow: true,
|
1725 | gridRowEnd: true,
|
1726 | gridRowSpan: true,
|
1727 | gridRowStart: true,
|
1728 | gridColumn: true,
|
1729 | gridColumnEnd: true,
|
1730 | gridColumnSpan: true,
|
1731 | gridColumnStart: true,
|
1732 | fontWeight: true,
|
1733 | lineClamp: true,
|
1734 | lineHeight: true,
|
1735 | opacity: true,
|
1736 | order: true,
|
1737 | orphans: true,
|
1738 | tabSize: true,
|
1739 | widows: true,
|
1740 | zIndex: true,
|
1741 | zoom: true,
|
1742 |
|
1743 |
|
1744 | fillOpacity: true,
|
1745 | floodOpacity: true,
|
1746 | stopOpacity: true,
|
1747 | strokeDasharray: true,
|
1748 | strokeDashoffset: true,
|
1749 | strokeMiterlimit: true,
|
1750 | strokeOpacity: true,
|
1751 | strokeWidth: true
|
1752 | };
|
1753 |
|
1754 |
|
1755 |
|
1756 |
|
1757 |
|
1758 |
|
1759 |
|
1760 | function prefixKey(prefix, key) {
|
1761 | return prefix + key.charAt(0).toUpperCase() + key.substring(1);
|
1762 | }
|
1763 |
|
1764 |
|
1765 |
|
1766 |
|
1767 |
|
1768 | var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
|
1769 |
|
1770 |
|
1771 |
|
1772 | Object.keys(isUnitlessNumber).forEach(function (prop) {
|
1773 | prefixes.forEach(function (prefix) {
|
1774 | isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
|
1775 | });
|
1776 | });
|
1777 |
|
1778 |
|
1779 |
|
1780 |
|
1781 |
|
1782 |
|
1783 |
|
1784 |
|
1785 |
|
1786 |
|
1787 | function dangerousStyleValue(name, value, isCustomProperty) {
|
1788 |
|
1789 |
|
1790 |
|
1791 |
|
1792 |
|
1793 |
|
1794 |
|
1795 |
|
1796 |
|
1797 |
|
1798 | var isEmpty = value == null || typeof value === 'boolean' || value === '';
|
1799 | if (isEmpty) {
|
1800 | return '';
|
1801 | }
|
1802 |
|
1803 | if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {
|
1804 | return value + 'px';
|
1805 | }
|
1806 |
|
1807 | return ('' + value).trim();
|
1808 | }
|
1809 |
|
1810 | var uppercasePattern = /([A-Z])/g;
|
1811 | var msPattern = /^ms-/;
|
1812 |
|
1813 |
|
1814 |
|
1815 |
|
1816 |
|
1817 |
|
1818 |
|
1819 |
|
1820 |
|
1821 |
|
1822 |
|
1823 |
|
1824 |
|
1825 |
|
1826 | function hyphenateStyleName(name) {
|
1827 | return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');
|
1828 | }
|
1829 |
|
1830 | function isCustomComponent(tagName, props) {
|
1831 | if (tagName.indexOf('-') === -1) {
|
1832 | return typeof props.is === 'string';
|
1833 | }
|
1834 | switch (tagName) {
|
1835 |
|
1836 |
|
1837 |
|
1838 |
|
1839 | case 'annotation-xml':
|
1840 | case 'color-profile':
|
1841 | case 'font-face':
|
1842 | case 'font-face-src':
|
1843 | case 'font-face-uri':
|
1844 | case 'font-face-format':
|
1845 | case 'font-face-name':
|
1846 | case 'missing-glyph':
|
1847 | return false;
|
1848 | default:
|
1849 | return true;
|
1850 | }
|
1851 | }
|
1852 |
|
1853 | var warnValidStyle = function () {};
|
1854 |
|
1855 | {
|
1856 |
|
1857 | var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
|
1858 | var msPattern$1 = /^-ms-/;
|
1859 | var hyphenPattern = /-(.)/g;
|
1860 |
|
1861 |
|
1862 | var badStyleValueWithSemicolonPattern = /;\s*$/;
|
1863 |
|
1864 | var warnedStyleNames = {};
|
1865 | var warnedStyleValues = {};
|
1866 | var warnedForNaNValue = false;
|
1867 | var warnedForInfinityValue = false;
|
1868 |
|
1869 | var camelize = function (string) {
|
1870 | return string.replace(hyphenPattern, function (_, character) {
|
1871 | return character.toUpperCase();
|
1872 | });
|
1873 | };
|
1874 |
|
1875 | var warnHyphenatedStyleName = function (name) {
|
1876 | if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
|
1877 | return;
|
1878 | }
|
1879 |
|
1880 | warnedStyleNames[name] = true;
|
1881 | warning$1(false, 'Unsupported style property %s. Did you mean %s?', name,
|
1882 |
|
1883 |
|
1884 |
|
1885 | camelize(name.replace(msPattern$1, 'ms-')));
|
1886 | };
|
1887 |
|
1888 | var warnBadVendoredStyleName = function (name) {
|
1889 | if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
|
1890 | return;
|
1891 | }
|
1892 |
|
1893 | warnedStyleNames[name] = true;
|
1894 | warning$1(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1));
|
1895 | };
|
1896 |
|
1897 | var warnStyleValueWithSemicolon = function (name, value) {
|
1898 | if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
|
1899 | return;
|
1900 | }
|
1901 |
|
1902 | warnedStyleValues[value] = true;
|
1903 | warning$1(false, "Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, ''));
|
1904 | };
|
1905 |
|
1906 | var warnStyleValueIsNaN = function (name, value) {
|
1907 | if (warnedForNaNValue) {
|
1908 | return;
|
1909 | }
|
1910 |
|
1911 | warnedForNaNValue = true;
|
1912 | warning$1(false, '`NaN` is an invalid value for the `%s` css style property.', name);
|
1913 | };
|
1914 |
|
1915 | var warnStyleValueIsInfinity = function (name, value) {
|
1916 | if (warnedForInfinityValue) {
|
1917 | return;
|
1918 | }
|
1919 |
|
1920 | warnedForInfinityValue = true;
|
1921 | warning$1(false, '`Infinity` is an invalid value for the `%s` css style property.', name);
|
1922 | };
|
1923 |
|
1924 | warnValidStyle = function (name, value) {
|
1925 | if (name.indexOf('-') > -1) {
|
1926 | warnHyphenatedStyleName(name);
|
1927 | } else if (badVendoredStyleNamePattern.test(name)) {
|
1928 | warnBadVendoredStyleName(name);
|
1929 | } else if (badStyleValueWithSemicolonPattern.test(value)) {
|
1930 | warnStyleValueWithSemicolon(name, value);
|
1931 | }
|
1932 |
|
1933 | if (typeof value === 'number') {
|
1934 | if (isNaN(value)) {
|
1935 | warnStyleValueIsNaN(name, value);
|
1936 | } else if (!isFinite(value)) {
|
1937 | warnStyleValueIsInfinity(name, value);
|
1938 | }
|
1939 | }
|
1940 | };
|
1941 | }
|
1942 |
|
1943 | var warnValidStyle$1 = warnValidStyle;
|
1944 |
|
1945 | var ariaProperties = {
|
1946 | 'aria-current': 0,
|
1947 | 'aria-details': 0,
|
1948 | 'aria-disabled': 0,
|
1949 | 'aria-hidden': 0,
|
1950 | 'aria-invalid': 0,
|
1951 | 'aria-keyshortcuts': 0,
|
1952 | 'aria-label': 0,
|
1953 | 'aria-roledescription': 0,
|
1954 |
|
1955 | 'aria-autocomplete': 0,
|
1956 | 'aria-checked': 0,
|
1957 | 'aria-expanded': 0,
|
1958 | 'aria-haspopup': 0,
|
1959 | 'aria-level': 0,
|
1960 | 'aria-modal': 0,
|
1961 | 'aria-multiline': 0,
|
1962 | 'aria-multiselectable': 0,
|
1963 | 'aria-orientation': 0,
|
1964 | 'aria-placeholder': 0,
|
1965 | 'aria-pressed': 0,
|
1966 | 'aria-readonly': 0,
|
1967 | 'aria-required': 0,
|
1968 | 'aria-selected': 0,
|
1969 | 'aria-sort': 0,
|
1970 | 'aria-valuemax': 0,
|
1971 | 'aria-valuemin': 0,
|
1972 | 'aria-valuenow': 0,
|
1973 | 'aria-valuetext': 0,
|
1974 |
|
1975 | 'aria-atomic': 0,
|
1976 | 'aria-busy': 0,
|
1977 | 'aria-live': 0,
|
1978 | 'aria-relevant': 0,
|
1979 |
|
1980 | 'aria-dropeffect': 0,
|
1981 | 'aria-grabbed': 0,
|
1982 |
|
1983 | 'aria-activedescendant': 0,
|
1984 | 'aria-colcount': 0,
|
1985 | 'aria-colindex': 0,
|
1986 | 'aria-colspan': 0,
|
1987 | 'aria-controls': 0,
|
1988 | 'aria-describedby': 0,
|
1989 | 'aria-errormessage': 0,
|
1990 | 'aria-flowto': 0,
|
1991 | 'aria-labelledby': 0,
|
1992 | 'aria-owns': 0,
|
1993 | 'aria-posinset': 0,
|
1994 | 'aria-rowcount': 0,
|
1995 | 'aria-rowindex': 0,
|
1996 | 'aria-rowspan': 0,
|
1997 | 'aria-setsize': 0
|
1998 | };
|
1999 |
|
2000 | var warnedProperties = {};
|
2001 | var rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
|
2002 | var rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');
|
2003 |
|
2004 | var hasOwnProperty$2 = Object.prototype.hasOwnProperty;
|
2005 |
|
2006 | function validateProperty(tagName, name) {
|
2007 | if (hasOwnProperty$2.call(warnedProperties, name) && warnedProperties[name]) {
|
2008 | return true;
|
2009 | }
|
2010 |
|
2011 | if (rARIACamel.test(name)) {
|
2012 | var ariaName = 'aria-' + name.slice(4).toLowerCase();
|
2013 | var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null;
|
2014 |
|
2015 |
|
2016 |
|
2017 | if (correctName == null) {
|
2018 | warning$1(false, 'Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.', name);
|
2019 | warnedProperties[name] = true;
|
2020 | return true;
|
2021 | }
|
2022 |
|
2023 | if (name !== correctName) {
|
2024 | warning$1(false, 'Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName);
|
2025 | warnedProperties[name] = true;
|
2026 | return true;
|
2027 | }
|
2028 | }
|
2029 |
|
2030 | if (rARIA.test(name)) {
|
2031 | var lowerCasedName = name.toLowerCase();
|
2032 | var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null;
|
2033 |
|
2034 |
|
2035 |
|
2036 | if (standardName == null) {
|
2037 | warnedProperties[name] = true;
|
2038 | return false;
|
2039 | }
|
2040 |
|
2041 | if (name !== standardName) {
|
2042 | warning$1(false, 'Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName);
|
2043 | warnedProperties[name] = true;
|
2044 | return true;
|
2045 | }
|
2046 | }
|
2047 |
|
2048 | return true;
|
2049 | }
|
2050 |
|
2051 | function warnInvalidARIAProps(type, props) {
|
2052 | var invalidProps = [];
|
2053 |
|
2054 | for (var key in props) {
|
2055 | var isValid = validateProperty(type, key);
|
2056 | if (!isValid) {
|
2057 | invalidProps.push(key);
|
2058 | }
|
2059 | }
|
2060 |
|
2061 | var unknownPropString = invalidProps.map(function (prop) {
|
2062 | return '`' + prop + '`';
|
2063 | }).join(', ');
|
2064 |
|
2065 | if (invalidProps.length === 1) {
|
2066 | warning$1(false, 'Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);
|
2067 | } else if (invalidProps.length > 1) {
|
2068 | warning$1(false, 'Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);
|
2069 | }
|
2070 | }
|
2071 |
|
2072 | function validateProperties(type, props) {
|
2073 | if (isCustomComponent(type, props)) {
|
2074 | return;
|
2075 | }
|
2076 | warnInvalidARIAProps(type, props);
|
2077 | }
|
2078 |
|
2079 | var didWarnValueNull = false;
|
2080 |
|
2081 | function validateProperties$1(type, props) {
|
2082 | if (type !== 'input' && type !== 'textarea' && type !== 'select') {
|
2083 | return;
|
2084 | }
|
2085 |
|
2086 | if (props != null && props.value === null && !didWarnValueNull) {
|
2087 | didWarnValueNull = true;
|
2088 | if (type === 'select' && props.multiple) {
|
2089 | warning$1(false, '`value` prop on `%s` should not be null. ' + 'Consider using an empty array when `multiple` is set to `true` ' + 'to clear the component or `undefined` for uncontrolled components.', type);
|
2090 | } else {
|
2091 | warning$1(false, '`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.', type);
|
2092 | }
|
2093 | }
|
2094 | }
|
2095 |
|
2096 |
|
2097 |
|
2098 |
|
2099 |
|
2100 |
|
2101 |
|
2102 |
|
2103 |
|
2104 |
|
2105 |
|
2106 |
|
2107 |
|
2108 |
|
2109 |
|
2110 |
|
2111 |
|
2112 |
|
2113 |
|
2114 |
|
2115 | var registrationNameModules = {};
|
2116 |
|
2117 |
|
2118 |
|
2119 |
|
2120 |
|
2121 |
|
2122 |
|
2123 |
|
2124 |
|
2125 |
|
2126 |
|
2127 |
|
2128 | var possibleRegistrationNames = {};
|
2129 |
|
2130 |
|
2131 |
|
2132 |
|
2133 |
|
2134 |
|
2135 |
|
2136 |
|
2137 |
|
2138 |
|
2139 |
|
2140 |
|
2141 |
|
2142 |
|
2143 |
|
2144 |
|
2145 |
|
2146 |
|
2147 |
|
2148 |
|
2149 |
|
2150 |
|
2151 |
|
2152 |
|
2153 |
|
2154 |
|
2155 |
|
2156 | var possibleStandardNames = {
|
2157 |
|
2158 | accept: 'accept',
|
2159 | acceptcharset: 'acceptCharset',
|
2160 | 'accept-charset': 'acceptCharset',
|
2161 | accesskey: 'accessKey',
|
2162 | action: 'action',
|
2163 | allowfullscreen: 'allowFullScreen',
|
2164 | alt: 'alt',
|
2165 | as: 'as',
|
2166 | async: 'async',
|
2167 | autocapitalize: 'autoCapitalize',
|
2168 | autocomplete: 'autoComplete',
|
2169 | autocorrect: 'autoCorrect',
|
2170 | autofocus: 'autoFocus',
|
2171 | autoplay: 'autoPlay',
|
2172 | autosave: 'autoSave',
|
2173 | capture: 'capture',
|
2174 | cellpadding: 'cellPadding',
|
2175 | cellspacing: 'cellSpacing',
|
2176 | challenge: 'challenge',
|
2177 | charset: 'charSet',
|
2178 | checked: 'checked',
|
2179 | children: 'children',
|
2180 | cite: 'cite',
|
2181 | class: 'className',
|
2182 | classid: 'classID',
|
2183 | classname: 'className',
|
2184 | cols: 'cols',
|
2185 | colspan: 'colSpan',
|
2186 | content: 'content',
|
2187 | contenteditable: 'contentEditable',
|
2188 | contextmenu: 'contextMenu',
|
2189 | controls: 'controls',
|
2190 | controlslist: 'controlsList',
|
2191 | coords: 'coords',
|
2192 | crossorigin: 'crossOrigin',
|
2193 | dangerouslysetinnerhtml: 'dangerouslySetInnerHTML',
|
2194 | data: 'data',
|
2195 | datetime: 'dateTime',
|
2196 | default: 'default',
|
2197 | defaultchecked: 'defaultChecked',
|
2198 | defaultvalue: 'defaultValue',
|
2199 | defer: 'defer',
|
2200 | dir: 'dir',
|
2201 | disabled: 'disabled',
|
2202 | disablepictureinpicture: 'disablePictureInPicture',
|
2203 | download: 'download',
|
2204 | draggable: 'draggable',
|
2205 | enctype: 'encType',
|
2206 | for: 'htmlFor',
|
2207 | form: 'form',
|
2208 | formmethod: 'formMethod',
|
2209 | formaction: 'formAction',
|
2210 | formenctype: 'formEncType',
|
2211 | formnovalidate: 'formNoValidate',
|
2212 | formtarget: 'formTarget',
|
2213 | frameborder: 'frameBorder',
|
2214 | headers: 'headers',
|
2215 | height: 'height',
|
2216 | hidden: 'hidden',
|
2217 | high: 'high',
|
2218 | href: 'href',
|
2219 | hreflang: 'hrefLang',
|
2220 | htmlfor: 'htmlFor',
|
2221 | httpequiv: 'httpEquiv',
|
2222 | 'http-equiv': 'httpEquiv',
|
2223 | icon: 'icon',
|
2224 | id: 'id',
|
2225 | innerhtml: 'innerHTML',
|
2226 | inputmode: 'inputMode',
|
2227 | integrity: 'integrity',
|
2228 | is: 'is',
|
2229 | itemid: 'itemID',
|
2230 | itemprop: 'itemProp',
|
2231 | itemref: 'itemRef',
|
2232 | itemscope: 'itemScope',
|
2233 | itemtype: 'itemType',
|
2234 | keyparams: 'keyParams',
|
2235 | keytype: 'keyType',
|
2236 | kind: 'kind',
|
2237 | label: 'label',
|
2238 | lang: 'lang',
|
2239 | list: 'list',
|
2240 | loop: 'loop',
|
2241 | low: 'low',
|
2242 | manifest: 'manifest',
|
2243 | marginwidth: 'marginWidth',
|
2244 | marginheight: 'marginHeight',
|
2245 | max: 'max',
|
2246 | maxlength: 'maxLength',
|
2247 | media: 'media',
|
2248 | mediagroup: 'mediaGroup',
|
2249 | method: 'method',
|
2250 | min: 'min',
|
2251 | minlength: 'minLength',
|
2252 | multiple: 'multiple',
|
2253 | muted: 'muted',
|
2254 | name: 'name',
|
2255 | nomodule: 'noModule',
|
2256 | nonce: 'nonce',
|
2257 | novalidate: 'noValidate',
|
2258 | open: 'open',
|
2259 | optimum: 'optimum',
|
2260 | pattern: 'pattern',
|
2261 | placeholder: 'placeholder',
|
2262 | playsinline: 'playsInline',
|
2263 | poster: 'poster',
|
2264 | preload: 'preload',
|
2265 | profile: 'profile',
|
2266 | radiogroup: 'radioGroup',
|
2267 | readonly: 'readOnly',
|
2268 | referrerpolicy: 'referrerPolicy',
|
2269 | rel: 'rel',
|
2270 | required: 'required',
|
2271 | reversed: 'reversed',
|
2272 | role: 'role',
|
2273 | rows: 'rows',
|
2274 | rowspan: 'rowSpan',
|
2275 | sandbox: 'sandbox',
|
2276 | scope: 'scope',
|
2277 | scoped: 'scoped',
|
2278 | scrolling: 'scrolling',
|
2279 | seamless: 'seamless',
|
2280 | selected: 'selected',
|
2281 | shape: 'shape',
|
2282 | size: 'size',
|
2283 | sizes: 'sizes',
|
2284 | span: 'span',
|
2285 | spellcheck: 'spellCheck',
|
2286 | src: 'src',
|
2287 | srcdoc: 'srcDoc',
|
2288 | srclang: 'srcLang',
|
2289 | srcset: 'srcSet',
|
2290 | start: 'start',
|
2291 | step: 'step',
|
2292 | style: 'style',
|
2293 | summary: 'summary',
|
2294 | tabindex: 'tabIndex',
|
2295 | target: 'target',
|
2296 | title: 'title',
|
2297 | type: 'type',
|
2298 | usemap: 'useMap',
|
2299 | value: 'value',
|
2300 | width: 'width',
|
2301 | wmode: 'wmode',
|
2302 | wrap: 'wrap',
|
2303 |
|
2304 |
|
2305 | about: 'about',
|
2306 | accentheight: 'accentHeight',
|
2307 | 'accent-height': 'accentHeight',
|
2308 | accumulate: 'accumulate',
|
2309 | additive: 'additive',
|
2310 | alignmentbaseline: 'alignmentBaseline',
|
2311 | 'alignment-baseline': 'alignmentBaseline',
|
2312 | allowreorder: 'allowReorder',
|
2313 | alphabetic: 'alphabetic',
|
2314 | amplitude: 'amplitude',
|
2315 | arabicform: 'arabicForm',
|
2316 | 'arabic-form': 'arabicForm',
|
2317 | ascent: 'ascent',
|
2318 | attributename: 'attributeName',
|
2319 | attributetype: 'attributeType',
|
2320 | autoreverse: 'autoReverse',
|
2321 | azimuth: 'azimuth',
|
2322 | basefrequency: 'baseFrequency',
|
2323 | baselineshift: 'baselineShift',
|
2324 | 'baseline-shift': 'baselineShift',
|
2325 | baseprofile: 'baseProfile',
|
2326 | bbox: 'bbox',
|
2327 | begin: 'begin',
|
2328 | bias: 'bias',
|
2329 | by: 'by',
|
2330 | calcmode: 'calcMode',
|
2331 | capheight: 'capHeight',
|
2332 | 'cap-height': 'capHeight',
|
2333 | clip: 'clip',
|
2334 | clippath: 'clipPath',
|
2335 | 'clip-path': 'clipPath',
|
2336 | clippathunits: 'clipPathUnits',
|
2337 | cliprule: 'clipRule',
|
2338 | 'clip-rule': 'clipRule',
|
2339 | color: 'color',
|
2340 | colorinterpolation: 'colorInterpolation',
|
2341 | 'color-interpolation': 'colorInterpolation',
|
2342 | colorinterpolationfilters: 'colorInterpolationFilters',
|
2343 | 'color-interpolation-filters': 'colorInterpolationFilters',
|
2344 | colorprofile: 'colorProfile',
|
2345 | 'color-profile': 'colorProfile',
|
2346 | colorrendering: 'colorRendering',
|
2347 | 'color-rendering': 'colorRendering',
|
2348 | contentscripttype: 'contentScriptType',
|
2349 | contentstyletype: 'contentStyleType',
|
2350 | cursor: 'cursor',
|
2351 | cx: 'cx',
|
2352 | cy: 'cy',
|
2353 | d: 'd',
|
2354 | datatype: 'datatype',
|
2355 | decelerate: 'decelerate',
|
2356 | descent: 'descent',
|
2357 | diffuseconstant: 'diffuseConstant',
|
2358 | direction: 'direction',
|
2359 | display: 'display',
|
2360 | divisor: 'divisor',
|
2361 | dominantbaseline: 'dominantBaseline',
|
2362 | 'dominant-baseline': 'dominantBaseline',
|
2363 | dur: 'dur',
|
2364 | dx: 'dx',
|
2365 | dy: 'dy',
|
2366 | edgemode: 'edgeMode',
|
2367 | elevation: 'elevation',
|
2368 | enablebackground: 'enableBackground',
|
2369 | 'enable-background': 'enableBackground',
|
2370 | end: 'end',
|
2371 | exponent: 'exponent',
|
2372 | externalresourcesrequired: 'externalResourcesRequired',
|
2373 | fill: 'fill',
|
2374 | fillopacity: 'fillOpacity',
|
2375 | 'fill-opacity': 'fillOpacity',
|
2376 | fillrule: 'fillRule',
|
2377 | 'fill-rule': 'fillRule',
|
2378 | filter: 'filter',
|
2379 | filterres: 'filterRes',
|
2380 | filterunits: 'filterUnits',
|
2381 | floodopacity: 'floodOpacity',
|
2382 | 'flood-opacity': 'floodOpacity',
|
2383 | floodcolor: 'floodColor',
|
2384 | 'flood-color': 'floodColor',
|
2385 | focusable: 'focusable',
|
2386 | fontfamily: 'fontFamily',
|
2387 | 'font-family': 'fontFamily',
|
2388 | fontsize: 'fontSize',
|
2389 | 'font-size': 'fontSize',
|
2390 | fontsizeadjust: 'fontSizeAdjust',
|
2391 | 'font-size-adjust': 'fontSizeAdjust',
|
2392 | fontstretch: 'fontStretch',
|
2393 | 'font-stretch': 'fontStretch',
|
2394 | fontstyle: 'fontStyle',
|
2395 | 'font-style': 'fontStyle',
|
2396 | fontvariant: 'fontVariant',
|
2397 | 'font-variant': 'fontVariant',
|
2398 | fontweight: 'fontWeight',
|
2399 | 'font-weight': 'fontWeight',
|
2400 | format: 'format',
|
2401 | from: 'from',
|
2402 | fx: 'fx',
|
2403 | fy: 'fy',
|
2404 | g1: 'g1',
|
2405 | g2: 'g2',
|
2406 | glyphname: 'glyphName',
|
2407 | 'glyph-name': 'glyphName',
|
2408 | glyphorientationhorizontal: 'glyphOrientationHorizontal',
|
2409 | 'glyph-orientation-horizontal': 'glyphOrientationHorizontal',
|
2410 | glyphorientationvertical: 'glyphOrientationVertical',
|
2411 | 'glyph-orientation-vertical': 'glyphOrientationVertical',
|
2412 | glyphref: 'glyphRef',
|
2413 | gradienttransform: 'gradientTransform',
|
2414 | gradientunits: 'gradientUnits',
|
2415 | hanging: 'hanging',
|
2416 | horizadvx: 'horizAdvX',
|
2417 | 'horiz-adv-x': 'horizAdvX',
|
2418 | horizoriginx: 'horizOriginX',
|
2419 | 'horiz-origin-x': 'horizOriginX',
|
2420 | ideographic: 'ideographic',
|
2421 | imagerendering: 'imageRendering',
|
2422 | 'image-rendering': 'imageRendering',
|
2423 | in2: 'in2',
|
2424 | in: 'in',
|
2425 | inlist: 'inlist',
|
2426 | intercept: 'intercept',
|
2427 | k1: 'k1',
|
2428 | k2: 'k2',
|
2429 | k3: 'k3',
|
2430 | k4: 'k4',
|
2431 | k: 'k',
|
2432 | kernelmatrix: 'kernelMatrix',
|
2433 | kernelunitlength: 'kernelUnitLength',
|
2434 | kerning: 'kerning',
|
2435 | keypoints: 'keyPoints',
|
2436 | keysplines: 'keySplines',
|
2437 | keytimes: 'keyTimes',
|
2438 | lengthadjust: 'lengthAdjust',
|
2439 | letterspacing: 'letterSpacing',
|
2440 | 'letter-spacing': 'letterSpacing',
|
2441 | lightingcolor: 'lightingColor',
|
2442 | 'lighting-color': 'lightingColor',
|
2443 | limitingconeangle: 'limitingConeAngle',
|
2444 | local: 'local',
|
2445 | markerend: 'markerEnd',
|
2446 | 'marker-end': 'markerEnd',
|
2447 | markerheight: 'markerHeight',
|
2448 | markermid: 'markerMid',
|
2449 | 'marker-mid': 'markerMid',
|
2450 | markerstart: 'markerStart',
|
2451 | 'marker-start': 'markerStart',
|
2452 | markerunits: 'markerUnits',
|
2453 | markerwidth: 'markerWidth',
|
2454 | mask: 'mask',
|
2455 | maskcontentunits: 'maskContentUnits',
|
2456 | maskunits: 'maskUnits',
|
2457 | mathematical: 'mathematical',
|
2458 | mode: 'mode',
|
2459 | numoctaves: 'numOctaves',
|
2460 | offset: 'offset',
|
2461 | opacity: 'opacity',
|
2462 | operator: 'operator',
|
2463 | order: 'order',
|
2464 | orient: 'orient',
|
2465 | orientation: 'orientation',
|
2466 | origin: 'origin',
|
2467 | overflow: 'overflow',
|
2468 | overlineposition: 'overlinePosition',
|
2469 | 'overline-position': 'overlinePosition',
|
2470 | overlinethickness: 'overlineThickness',
|
2471 | 'overline-thickness': 'overlineThickness',
|
2472 | paintorder: 'paintOrder',
|
2473 | 'paint-order': 'paintOrder',
|
2474 | panose1: 'panose1',
|
2475 | 'panose-1': 'panose1',
|
2476 | pathlength: 'pathLength',
|
2477 | patterncontentunits: 'patternContentUnits',
|
2478 | patterntransform: 'patternTransform',
|
2479 | patternunits: 'patternUnits',
|
2480 | pointerevents: 'pointerEvents',
|
2481 | 'pointer-events': 'pointerEvents',
|
2482 | points: 'points',
|
2483 | pointsatx: 'pointsAtX',
|
2484 | pointsaty: 'pointsAtY',
|
2485 | pointsatz: 'pointsAtZ',
|
2486 | prefix: 'prefix',
|
2487 | preservealpha: 'preserveAlpha',
|
2488 | preserveaspectratio: 'preserveAspectRatio',
|
2489 | primitiveunits: 'primitiveUnits',
|
2490 | property: 'property',
|
2491 | r: 'r',
|
2492 | radius: 'radius',
|
2493 | refx: 'refX',
|
2494 | refy: 'refY',
|
2495 | renderingintent: 'renderingIntent',
|
2496 | 'rendering-intent': 'renderingIntent',
|
2497 | repeatcount: 'repeatCount',
|
2498 | repeatdur: 'repeatDur',
|
2499 | requiredextensions: 'requiredExtensions',
|
2500 | requiredfeatures: 'requiredFeatures',
|
2501 | resource: 'resource',
|
2502 | restart: 'restart',
|
2503 | result: 'result',
|
2504 | results: 'results',
|
2505 | rotate: 'rotate',
|
2506 | rx: 'rx',
|
2507 | ry: 'ry',
|
2508 | scale: 'scale',
|
2509 | security: 'security',
|
2510 | seed: 'seed',
|
2511 | shaperendering: 'shapeRendering',
|
2512 | 'shape-rendering': 'shapeRendering',
|
2513 | slope: 'slope',
|
2514 | spacing: 'spacing',
|
2515 | specularconstant: 'specularConstant',
|
2516 | specularexponent: 'specularExponent',
|
2517 | speed: 'speed',
|
2518 | spreadmethod: 'spreadMethod',
|
2519 | startoffset: 'startOffset',
|
2520 | stddeviation: 'stdDeviation',
|
2521 | stemh: 'stemh',
|
2522 | stemv: 'stemv',
|
2523 | stitchtiles: 'stitchTiles',
|
2524 | stopcolor: 'stopColor',
|
2525 | 'stop-color': 'stopColor',
|
2526 | stopopacity: 'stopOpacity',
|
2527 | 'stop-opacity': 'stopOpacity',
|
2528 | strikethroughposition: 'strikethroughPosition',
|
2529 | 'strikethrough-position': 'strikethroughPosition',
|
2530 | strikethroughthickness: 'strikethroughThickness',
|
2531 | 'strikethrough-thickness': 'strikethroughThickness',
|
2532 | string: 'string',
|
2533 | stroke: 'stroke',
|
2534 | strokedasharray: 'strokeDasharray',
|
2535 | 'stroke-dasharray': 'strokeDasharray',
|
2536 | strokedashoffset: 'strokeDashoffset',
|
2537 | 'stroke-dashoffset': 'strokeDashoffset',
|
2538 | strokelinecap: 'strokeLinecap',
|
2539 | 'stroke-linecap': 'strokeLinecap',
|
2540 | strokelinejoin: 'strokeLinejoin',
|
2541 | 'stroke-linejoin': 'strokeLinejoin',
|
2542 | strokemiterlimit: 'strokeMiterlimit',
|
2543 | 'stroke-miterlimit': 'strokeMiterlimit',
|
2544 | strokewidth: 'strokeWidth',
|
2545 | 'stroke-width': 'strokeWidth',
|
2546 | strokeopacity: 'strokeOpacity',
|
2547 | 'stroke-opacity': 'strokeOpacity',
|
2548 | suppresscontenteditablewarning: 'suppressContentEditableWarning',
|
2549 | suppresshydrationwarning: 'suppressHydrationWarning',
|
2550 | surfacescale: 'surfaceScale',
|
2551 | systemlanguage: 'systemLanguage',
|
2552 | tablevalues: 'tableValues',
|
2553 | targetx: 'targetX',
|
2554 | targety: 'targetY',
|
2555 | textanchor: 'textAnchor',
|
2556 | 'text-anchor': 'textAnchor',
|
2557 | textdecoration: 'textDecoration',
|
2558 | 'text-decoration': 'textDecoration',
|
2559 | textlength: 'textLength',
|
2560 | textrendering: 'textRendering',
|
2561 | 'text-rendering': 'textRendering',
|
2562 | to: 'to',
|
2563 | transform: 'transform',
|
2564 | typeof: 'typeof',
|
2565 | u1: 'u1',
|
2566 | u2: 'u2',
|
2567 | underlineposition: 'underlinePosition',
|
2568 | 'underline-position': 'underlinePosition',
|
2569 | underlinethickness: 'underlineThickness',
|
2570 | 'underline-thickness': 'underlineThickness',
|
2571 | unicode: 'unicode',
|
2572 | unicodebidi: 'unicodeBidi',
|
2573 | 'unicode-bidi': 'unicodeBidi',
|
2574 | unicoderange: 'unicodeRange',
|
2575 | 'unicode-range': 'unicodeRange',
|
2576 | unitsperem: 'unitsPerEm',
|
2577 | 'units-per-em': 'unitsPerEm',
|
2578 | unselectable: 'unselectable',
|
2579 | valphabetic: 'vAlphabetic',
|
2580 | 'v-alphabetic': 'vAlphabetic',
|
2581 | values: 'values',
|
2582 | vectoreffect: 'vectorEffect',
|
2583 | 'vector-effect': 'vectorEffect',
|
2584 | version: 'version',
|
2585 | vertadvy: 'vertAdvY',
|
2586 | 'vert-adv-y': 'vertAdvY',
|
2587 | vertoriginx: 'vertOriginX',
|
2588 | 'vert-origin-x': 'vertOriginX',
|
2589 | vertoriginy: 'vertOriginY',
|
2590 | 'vert-origin-y': 'vertOriginY',
|
2591 | vhanging: 'vHanging',
|
2592 | 'v-hanging': 'vHanging',
|
2593 | videographic: 'vIdeographic',
|
2594 | 'v-ideographic': 'vIdeographic',
|
2595 | viewbox: 'viewBox',
|
2596 | viewtarget: 'viewTarget',
|
2597 | visibility: 'visibility',
|
2598 | vmathematical: 'vMathematical',
|
2599 | 'v-mathematical': 'vMathematical',
|
2600 | vocab: 'vocab',
|
2601 | widths: 'widths',
|
2602 | wordspacing: 'wordSpacing',
|
2603 | 'word-spacing': 'wordSpacing',
|
2604 | writingmode: 'writingMode',
|
2605 | 'writing-mode': 'writingMode',
|
2606 | x1: 'x1',
|
2607 | x2: 'x2',
|
2608 | x: 'x',
|
2609 | xchannelselector: 'xChannelSelector',
|
2610 | xheight: 'xHeight',
|
2611 | 'x-height': 'xHeight',
|
2612 | xlinkactuate: 'xlinkActuate',
|
2613 | 'xlink:actuate': 'xlinkActuate',
|
2614 | xlinkarcrole: 'xlinkArcrole',
|
2615 | 'xlink:arcrole': 'xlinkArcrole',
|
2616 | xlinkhref: 'xlinkHref',
|
2617 | 'xlink:href': 'xlinkHref',
|
2618 | xlinkrole: 'xlinkRole',
|
2619 | 'xlink:role': 'xlinkRole',
|
2620 | xlinkshow: 'xlinkShow',
|
2621 | 'xlink:show': 'xlinkShow',
|
2622 | xlinktitle: 'xlinkTitle',
|
2623 | 'xlink:title': 'xlinkTitle',
|
2624 | xlinktype: 'xlinkType',
|
2625 | 'xlink:type': 'xlinkType',
|
2626 | xmlbase: 'xmlBase',
|
2627 | 'xml:base': 'xmlBase',
|
2628 | xmllang: 'xmlLang',
|
2629 | 'xml:lang': 'xmlLang',
|
2630 | xmlns: 'xmlns',
|
2631 | 'xml:space': 'xmlSpace',
|
2632 | xmlnsxlink: 'xmlnsXlink',
|
2633 | 'xmlns:xlink': 'xmlnsXlink',
|
2634 | xmlspace: 'xmlSpace',
|
2635 | y1: 'y1',
|
2636 | y2: 'y2',
|
2637 | y: 'y',
|
2638 | ychannelselector: 'yChannelSelector',
|
2639 | z: 'z',
|
2640 | zoomandpan: 'zoomAndPan'
|
2641 | };
|
2642 |
|
2643 | var validateProperty$1 = function () {};
|
2644 |
|
2645 | {
|
2646 | var warnedProperties$1 = {};
|
2647 | var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
2648 | var EVENT_NAME_REGEX = /^on./;
|
2649 | var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/;
|
2650 | var rARIA$1 = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
|
2651 | var rARIACamel$1 = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');
|
2652 |
|
2653 | validateProperty$1 = function (tagName, name, value, canUseEventSystem) {
|
2654 | if (_hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) {
|
2655 | return true;
|
2656 | }
|
2657 |
|
2658 | var lowerCasedName = name.toLowerCase();
|
2659 | if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') {
|
2660 | warning$1(false, 'React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.');
|
2661 | warnedProperties$1[name] = true;
|
2662 | return true;
|
2663 | }
|
2664 |
|
2665 |
|
2666 | if (canUseEventSystem) {
|
2667 | if (registrationNameModules.hasOwnProperty(name)) {
|
2668 | return true;
|
2669 | }
|
2670 | var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null;
|
2671 | if (registrationName != null) {
|
2672 | warning$1(false, 'Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName);
|
2673 | warnedProperties$1[name] = true;
|
2674 | return true;
|
2675 | }
|
2676 | if (EVENT_NAME_REGEX.test(name)) {
|
2677 | warning$1(false, 'Unknown event handler property `%s`. It will be ignored.', name);
|
2678 | warnedProperties$1[name] = true;
|
2679 | return true;
|
2680 | }
|
2681 | } else if (EVENT_NAME_REGEX.test(name)) {
|
2682 |
|
2683 |
|
2684 |
|
2685 | if (INVALID_EVENT_NAME_REGEX.test(name)) {
|
2686 | warning$1(false, 'Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name);
|
2687 | }
|
2688 | warnedProperties$1[name] = true;
|
2689 | return true;
|
2690 | }
|
2691 |
|
2692 |
|
2693 | if (rARIA$1.test(name) || rARIACamel$1.test(name)) {
|
2694 | return true;
|
2695 | }
|
2696 |
|
2697 | if (lowerCasedName === 'innerhtml') {
|
2698 | warning$1(false, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.');
|
2699 | warnedProperties$1[name] = true;
|
2700 | return true;
|
2701 | }
|
2702 |
|
2703 | if (lowerCasedName === 'aria') {
|
2704 | warning$1(false, 'The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.');
|
2705 | warnedProperties$1[name] = true;
|
2706 | return true;
|
2707 | }
|
2708 |
|
2709 | if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') {
|
2710 | warning$1(false, 'Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', typeof value);
|
2711 | warnedProperties$1[name] = true;
|
2712 | return true;
|
2713 | }
|
2714 |
|
2715 | if (typeof value === 'number' && isNaN(value)) {
|
2716 | warning$1(false, 'Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name);
|
2717 | warnedProperties$1[name] = true;
|
2718 | return true;
|
2719 | }
|
2720 |
|
2721 | var propertyInfo = getPropertyInfo(name);
|
2722 | var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED;
|
2723 |
|
2724 |
|
2725 | if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {
|
2726 | var standardName = possibleStandardNames[lowerCasedName];
|
2727 | if (standardName !== name) {
|
2728 | warning$1(false, 'Invalid DOM property `%s`. Did you mean `%s`?', name, standardName);
|
2729 | warnedProperties$1[name] = true;
|
2730 | return true;
|
2731 | }
|
2732 | } else if (!isReserved && name !== lowerCasedName) {
|
2733 |
|
2734 |
|
2735 | warning$1(false, 'React does not recognize the `%s` prop on a DOM element. If you ' + 'intentionally want it to appear in the DOM as a custom ' + 'attribute, spell it as lowercase `%s` instead. ' + 'If you accidentally passed it from a parent component, remove ' + 'it from the DOM element.', name, lowerCasedName);
|
2736 | warnedProperties$1[name] = true;
|
2737 | return true;
|
2738 | }
|
2739 |
|
2740 | if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
|
2741 | if (value) {
|
2742 | warning$1(false, 'Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.', value, name, name, value, name);
|
2743 | } else {
|
2744 | warning$1(false, 'Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name);
|
2745 | }
|
2746 | warnedProperties$1[name] = true;
|
2747 | return true;
|
2748 | }
|
2749 |
|
2750 |
|
2751 |
|
2752 | if (isReserved) {
|
2753 | return true;
|
2754 | }
|
2755 |
|
2756 |
|
2757 | if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
|
2758 | warnedProperties$1[name] = true;
|
2759 | return false;
|
2760 | }
|
2761 |
|
2762 |
|
2763 | if ((value === 'false' || value === 'true') && propertyInfo !== null && propertyInfo.type === BOOLEAN) {
|
2764 | warning$1(false, 'Received the string `%s` for the boolean attribute `%s`. ' + '%s ' + 'Did you mean %s={%s}?', value, name, value === 'false' ? 'The browser will interpret it as a truthy value.' : 'Although this works, it will not work as expected if you pass the string "false".', name, value);
|
2765 | warnedProperties$1[name] = true;
|
2766 | return true;
|
2767 | }
|
2768 |
|
2769 | return true;
|
2770 | };
|
2771 | }
|
2772 |
|
2773 | var warnUnknownProperties = function (type, props, canUseEventSystem) {
|
2774 | var unknownProps = [];
|
2775 | for (var key in props) {
|
2776 | var isValid = validateProperty$1(type, key, props[key], canUseEventSystem);
|
2777 | if (!isValid) {
|
2778 | unknownProps.push(key);
|
2779 | }
|
2780 | }
|
2781 |
|
2782 | var unknownPropString = unknownProps.map(function (prop) {
|
2783 | return '`' + prop + '`';
|
2784 | }).join(', ');
|
2785 | if (unknownProps.length === 1) {
|
2786 | warning$1(false, 'Invalid value for prop %s on <%s> tag. Either remove it from the element, ' + 'or pass a string or number value to keep it in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior', unknownPropString, type);
|
2787 | } else if (unknownProps.length > 1) {
|
2788 | warning$1(false, 'Invalid values for props %s on <%s> tag. Either remove them from the element, ' + 'or pass a string or number value to keep them in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior', unknownPropString, type);
|
2789 | }
|
2790 | };
|
2791 |
|
2792 | function validateProperties$2(type, props, canUseEventSystem) {
|
2793 | if (isCustomComponent(type, props)) {
|
2794 | return;
|
2795 | }
|
2796 | warnUnknownProperties(type, props, canUseEventSystem);
|
2797 | }
|
2798 |
|
2799 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
2800 |
|
2801 |
|
2802 |
|
2803 | var toArray = React.Children.toArray;
|
2804 |
|
2805 |
|
2806 |
|
2807 |
|
2808 |
|
2809 | var currentDebugStacks = [];
|
2810 |
|
2811 | var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
2812 | var ReactDebugCurrentFrame = void 0;
|
2813 | var prevGetCurrentStackImpl = null;
|
2814 | var getCurrentServerStackImpl = function () {
|
2815 | return '';
|
2816 | };
|
2817 | var describeStackFrame = function (element) {
|
2818 | return '';
|
2819 | };
|
2820 |
|
2821 | var validatePropertiesInDevelopment = function (type, props) {};
|
2822 | var pushCurrentDebugStack = function (stack) {};
|
2823 | var pushElementToDebugStack = function (element) {};
|
2824 | var popCurrentDebugStack = function () {};
|
2825 | var hasWarnedAboutUsingContextAsConsumer = false;
|
2826 |
|
2827 | {
|
2828 | ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
2829 |
|
2830 | validatePropertiesInDevelopment = function (type, props) {
|
2831 | validateProperties(type, props);
|
2832 | validateProperties$1(type, props);
|
2833 | validateProperties$2(type, props, false);
|
2834 | };
|
2835 |
|
2836 | describeStackFrame = function (element) {
|
2837 | var source = element._source;
|
2838 | var type = element.type;
|
2839 | var name = getComponentName(type);
|
2840 | var ownerName = null;
|
2841 | return describeComponentFrame(name, source, ownerName);
|
2842 | };
|
2843 |
|
2844 | pushCurrentDebugStack = function (stack) {
|
2845 | currentDebugStacks.push(stack);
|
2846 |
|
2847 | if (currentDebugStacks.length === 1) {
|
2848 |
|
2849 |
|
2850 | prevGetCurrentStackImpl = ReactDebugCurrentFrame.getCurrentStack;
|
2851 | ReactDebugCurrentFrame.getCurrentStack = getCurrentServerStackImpl;
|
2852 | }
|
2853 | };
|
2854 |
|
2855 | pushElementToDebugStack = function (element) {
|
2856 |
|
2857 | var stack = currentDebugStacks[currentDebugStacks.length - 1];
|
2858 |
|
2859 | var frame = stack[stack.length - 1];
|
2860 |
|
2861 | frame.debugElementStack.push(element);
|
2862 |
|
2863 |
|
2864 |
|
2865 | };
|
2866 |
|
2867 | popCurrentDebugStack = function () {
|
2868 | currentDebugStacks.pop();
|
2869 |
|
2870 | if (currentDebugStacks.length === 0) {
|
2871 |
|
2872 |
|
2873 | ReactDebugCurrentFrame.getCurrentStack = prevGetCurrentStackImpl;
|
2874 | prevGetCurrentStackImpl = null;
|
2875 | }
|
2876 | };
|
2877 |
|
2878 | getCurrentServerStackImpl = function () {
|
2879 | if (currentDebugStacks.length === 0) {
|
2880 |
|
2881 | return '';
|
2882 | }
|
2883 |
|
2884 |
|
2885 | var frames = currentDebugStacks[currentDebugStacks.length - 1];
|
2886 | var stack = '';
|
2887 |
|
2888 | for (var i = frames.length - 1; i >= 0; i--) {
|
2889 | var frame = frames[i];
|
2890 |
|
2891 |
|
2892 |
|
2893 | var _debugElementStack = frame.debugElementStack;
|
2894 | for (var ii = _debugElementStack.length - 1; ii >= 0; ii--) {
|
2895 | stack += describeStackFrame(_debugElementStack[ii]);
|
2896 | }
|
2897 | }
|
2898 | return stack;
|
2899 | };
|
2900 | }
|
2901 |
|
2902 | var didWarnDefaultInputValue = false;
|
2903 | var didWarnDefaultChecked = false;
|
2904 | var didWarnDefaultSelectValue = false;
|
2905 | var didWarnDefaultTextareaValue = false;
|
2906 | var didWarnInvalidOptionChildren = false;
|
2907 | var didWarnAboutNoopUpdateForComponent = {};
|
2908 | var didWarnAboutBadClass = {};
|
2909 | var didWarnAboutModulePatternComponent = {};
|
2910 | var didWarnAboutDeprecatedWillMount = {};
|
2911 | var didWarnAboutUndefinedDerivedState = {};
|
2912 | var didWarnAboutUninitializedState = {};
|
2913 | var valuePropNames = ['value', 'defaultValue'];
|
2914 | var newlineEatingTags = {
|
2915 | listing: true,
|
2916 | pre: true,
|
2917 | textarea: true
|
2918 | };
|
2919 |
|
2920 |
|
2921 |
|
2922 |
|
2923 | var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/;
|
2924 | var validatedTagCache = {};
|
2925 | function validateDangerousTag(tag) {
|
2926 | if (!validatedTagCache.hasOwnProperty(tag)) {
|
2927 | (function () {
|
2928 | if (!VALID_TAG_REGEX.test(tag)) {
|
2929 | {
|
2930 | throw ReactError(Error('Invalid tag: ' + tag));
|
2931 | }
|
2932 | }
|
2933 | })();
|
2934 | validatedTagCache[tag] = true;
|
2935 | }
|
2936 | }
|
2937 |
|
2938 | var styleNameCache = {};
|
2939 | var processStyleName = function (styleName) {
|
2940 | if (styleNameCache.hasOwnProperty(styleName)) {
|
2941 | return styleNameCache[styleName];
|
2942 | }
|
2943 | var result = hyphenateStyleName(styleName);
|
2944 | styleNameCache[styleName] = result;
|
2945 | return result;
|
2946 | };
|
2947 |
|
2948 | function createMarkupForStyles(styles) {
|
2949 | var serialized = '';
|
2950 | var delimiter = '';
|
2951 | for (var styleName in styles) {
|
2952 | if (!styles.hasOwnProperty(styleName)) {
|
2953 | continue;
|
2954 | }
|
2955 | var isCustomProperty = styleName.indexOf('--') === 0;
|
2956 | var styleValue = styles[styleName];
|
2957 | {
|
2958 | if (!isCustomProperty) {
|
2959 | warnValidStyle$1(styleName, styleValue);
|
2960 | }
|
2961 | }
|
2962 | if (styleValue != null) {
|
2963 | serialized += delimiter + (isCustomProperty ? styleName : processStyleName(styleName)) + ':';
|
2964 | serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);
|
2965 |
|
2966 | delimiter = ';';
|
2967 | }
|
2968 | }
|
2969 | return serialized || null;
|
2970 | }
|
2971 |
|
2972 | function warnNoop(publicInstance, callerName) {
|
2973 | {
|
2974 | var _constructor = publicInstance.constructor;
|
2975 | var componentName = _constructor && getComponentName(_constructor) || 'ReactClass';
|
2976 | var warningKey = componentName + '.' + callerName;
|
2977 | if (didWarnAboutNoopUpdateForComponent[warningKey]) {
|
2978 | return;
|
2979 | }
|
2980 |
|
2981 | warningWithoutStack$1(false, '%s(...): Can only update a mounting component. ' + 'This usually means you called %s() outside componentWillMount() on the server. ' + 'This is a no-op.\n\nPlease check the code for the %s component.', callerName, callerName, componentName);
|
2982 | didWarnAboutNoopUpdateForComponent[warningKey] = true;
|
2983 | }
|
2984 | }
|
2985 |
|
2986 | function shouldConstruct(Component) {
|
2987 | return Component.prototype && Component.prototype.isReactComponent;
|
2988 | }
|
2989 |
|
2990 | function getNonChildrenInnerMarkup(props) {
|
2991 | var innerHTML = props.dangerouslySetInnerHTML;
|
2992 | if (innerHTML != null) {
|
2993 | if (innerHTML.__html != null) {
|
2994 | return innerHTML.__html;
|
2995 | }
|
2996 | } else {
|
2997 | var content = props.children;
|
2998 | if (typeof content === 'string' || typeof content === 'number') {
|
2999 | return escapeTextForBrowser(content);
|
3000 | }
|
3001 | }
|
3002 | return null;
|
3003 | }
|
3004 |
|
3005 | function flattenTopLevelChildren(children) {
|
3006 | if (!React.isValidElement(children)) {
|
3007 | return toArray(children);
|
3008 | }
|
3009 | var element = children;
|
3010 | if (element.type !== REACT_FRAGMENT_TYPE) {
|
3011 | return [element];
|
3012 | }
|
3013 | var fragmentChildren = element.props.children;
|
3014 | if (!React.isValidElement(fragmentChildren)) {
|
3015 | return toArray(fragmentChildren);
|
3016 | }
|
3017 | var fragmentChildElement = fragmentChildren;
|
3018 | return [fragmentChildElement];
|
3019 | }
|
3020 |
|
3021 | function flattenOptionChildren(children) {
|
3022 | if (children === undefined || children === null) {
|
3023 | return children;
|
3024 | }
|
3025 | var content = '';
|
3026 |
|
3027 |
|
3028 | React.Children.forEach(children, function (child) {
|
3029 | if (child == null) {
|
3030 | return;
|
3031 | }
|
3032 | content += child;
|
3033 | {
|
3034 | if (!didWarnInvalidOptionChildren && typeof child !== 'string' && typeof child !== 'number') {
|
3035 | didWarnInvalidOptionChildren = true;
|
3036 | warning$1(false, 'Only strings and numbers are supported as <option> children.');
|
3037 | }
|
3038 | }
|
3039 | });
|
3040 | return content;
|
3041 | }
|
3042 |
|
3043 | var hasOwnProperty = Object.prototype.hasOwnProperty;
|
3044 | var STYLE = 'style';
|
3045 | var RESERVED_PROPS = {
|
3046 | children: null,
|
3047 | dangerouslySetInnerHTML: null,
|
3048 | suppressContentEditableWarning: null,
|
3049 | suppressHydrationWarning: null
|
3050 | };
|
3051 |
|
3052 | function createOpenTagMarkup(tagVerbatim, tagLowercase, props, namespace, makeStaticMarkup, isRootElement) {
|
3053 | var ret = '<' + tagVerbatim;
|
3054 |
|
3055 | for (var propKey in props) {
|
3056 | if (!hasOwnProperty.call(props, propKey)) {
|
3057 | continue;
|
3058 | }
|
3059 | if (enableFlareAPI && propKey === 'listeners') {
|
3060 | continue;
|
3061 | }
|
3062 | var propValue = props[propKey];
|
3063 | if (propValue == null) {
|
3064 | continue;
|
3065 | }
|
3066 | if (propKey === STYLE) {
|
3067 | propValue = createMarkupForStyles(propValue);
|
3068 | }
|
3069 | var markup = null;
|
3070 | if (isCustomComponent(tagLowercase, props)) {
|
3071 | if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
|
3072 | markup = createMarkupForCustomAttribute(propKey, propValue);
|
3073 | }
|
3074 | } else {
|
3075 | markup = createMarkupForProperty(propKey, propValue);
|
3076 | }
|
3077 | if (markup) {
|
3078 | ret += ' ' + markup;
|
3079 | }
|
3080 | }
|
3081 |
|
3082 |
|
3083 |
|
3084 | if (makeStaticMarkup) {
|
3085 | return ret;
|
3086 | }
|
3087 |
|
3088 | if (isRootElement) {
|
3089 | ret += ' ' + createMarkupForRoot();
|
3090 | }
|
3091 | return ret;
|
3092 | }
|
3093 |
|
3094 | function validateRenderResult(child, type) {
|
3095 | if (child === undefined) {
|
3096 | (function () {
|
3097 | {
|
3098 | {
|
3099 | throw ReactError(Error((getComponentName(type) || 'Component') + '(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.'));
|
3100 | }
|
3101 | }
|
3102 | })();
|
3103 | }
|
3104 | }
|
3105 |
|
3106 | function resolve(child, context, threadID) {
|
3107 | while (React.isValidElement(child)) {
|
3108 |
|
3109 | var element = child;
|
3110 | var Component = element.type;
|
3111 | {
|
3112 | pushElementToDebugStack(element);
|
3113 | }
|
3114 | if (typeof Component !== 'function') {
|
3115 | break;
|
3116 | }
|
3117 | processChild(element, Component);
|
3118 | }
|
3119 |
|
3120 |
|
3121 | function processChild(element, Component) {
|
3122 | var isClass = shouldConstruct(Component);
|
3123 | var publicContext = processContext(Component, context, threadID, isClass);
|
3124 |
|
3125 | var queue = [];
|
3126 | var replace = false;
|
3127 | var updater = {
|
3128 | isMounted: function (publicInstance) {
|
3129 | return false;
|
3130 | },
|
3131 | enqueueForceUpdate: function (publicInstance) {
|
3132 | if (queue === null) {
|
3133 | warnNoop(publicInstance, 'forceUpdate');
|
3134 | return null;
|
3135 | }
|
3136 | },
|
3137 | enqueueReplaceState: function (publicInstance, completeState) {
|
3138 | replace = true;
|
3139 | queue = [completeState];
|
3140 | },
|
3141 | enqueueSetState: function (publicInstance, currentPartialState) {
|
3142 | if (queue === null) {
|
3143 | warnNoop(publicInstance, 'setState');
|
3144 | return null;
|
3145 | }
|
3146 | queue.push(currentPartialState);
|
3147 | }
|
3148 | };
|
3149 |
|
3150 | var inst = void 0;
|
3151 | if (isClass) {
|
3152 | inst = new Component(element.props, publicContext, updater);
|
3153 |
|
3154 | if (typeof Component.getDerivedStateFromProps === 'function') {
|
3155 | {
|
3156 | if (inst.state === null || inst.state === undefined) {
|
3157 | var componentName = getComponentName(Component) || 'Unknown';
|
3158 | if (!didWarnAboutUninitializedState[componentName]) {
|
3159 | warningWithoutStack$1(false, '`%s` uses `getDerivedStateFromProps` but its initial state is ' + '%s. This is not recommended. Instead, define the initial state by ' + 'assigning an object to `this.state` in the constructor of `%s`. ' + 'This ensures that `getDerivedStateFromProps` arguments have a consistent shape.', componentName, inst.state === null ? 'null' : 'undefined', componentName);
|
3160 | didWarnAboutUninitializedState[componentName] = true;
|
3161 | }
|
3162 | }
|
3163 | }
|
3164 |
|
3165 | var partialState = Component.getDerivedStateFromProps.call(null, element.props, inst.state);
|
3166 |
|
3167 | {
|
3168 | if (partialState === undefined) {
|
3169 | var _componentName = getComponentName(Component) || 'Unknown';
|
3170 | if (!didWarnAboutUndefinedDerivedState[_componentName]) {
|
3171 | warningWithoutStack$1(false, '%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', _componentName);
|
3172 | didWarnAboutUndefinedDerivedState[_componentName] = true;
|
3173 | }
|
3174 | }
|
3175 | }
|
3176 |
|
3177 | if (partialState != null) {
|
3178 | inst.state = _assign({}, inst.state, partialState);
|
3179 | }
|
3180 | }
|
3181 | } else {
|
3182 | {
|
3183 | if (Component.prototype && typeof Component.prototype.render === 'function') {
|
3184 | var _componentName2 = getComponentName(Component) || 'Unknown';
|
3185 |
|
3186 | if (!didWarnAboutBadClass[_componentName2]) {
|
3187 | warningWithoutStack$1(false, "The <%s /> component appears to have a render method, but doesn't extend React.Component. " + 'This is likely to cause errors. Change %s to extend React.Component instead.', _componentName2, _componentName2);
|
3188 | didWarnAboutBadClass[_componentName2] = true;
|
3189 | }
|
3190 | }
|
3191 | }
|
3192 | var componentIdentity = {};
|
3193 | prepareToUseHooks(componentIdentity);
|
3194 | inst = Component(element.props, publicContext, updater);
|
3195 | inst = finishHooks(Component, element.props, inst, publicContext);
|
3196 |
|
3197 | if (inst == null || inst.render == null) {
|
3198 | child = inst;
|
3199 | validateRenderResult(child, Component);
|
3200 | return;
|
3201 | }
|
3202 |
|
3203 | {
|
3204 | var _componentName3 = getComponentName(Component) || 'Unknown';
|
3205 | if (!didWarnAboutModulePatternComponent[_componentName3]) {
|
3206 | warningWithoutStack$1(false, 'The <%s /> component appears to be a function component that returns a class instance. ' + 'Change %s to a class that extends React.Component instead. ' + "If you can't use a class try assigning the prototype on the function as a workaround. " + "`%s.prototype = React.Component.prototype`. Don't use an arrow function since it " + 'cannot be called with `new` by React.', _componentName3, _componentName3, _componentName3);
|
3207 | didWarnAboutModulePatternComponent[_componentName3] = true;
|
3208 | }
|
3209 | }
|
3210 | }
|
3211 |
|
3212 | inst.props = element.props;
|
3213 | inst.context = publicContext;
|
3214 | inst.updater = updater;
|
3215 |
|
3216 | var initialState = inst.state;
|
3217 | if (initialState === undefined) {
|
3218 | inst.state = initialState = null;
|
3219 | }
|
3220 | if (typeof inst.UNSAFE_componentWillMount === 'function' || typeof inst.componentWillMount === 'function') {
|
3221 | if (typeof inst.componentWillMount === 'function') {
|
3222 | {
|
3223 | if (warnAboutDeprecatedLifecycles && inst.componentWillMount.__suppressDeprecationWarning !== true) {
|
3224 | var _componentName4 = getComponentName(Component) || 'Unknown';
|
3225 |
|
3226 | if (!didWarnAboutDeprecatedWillMount[_componentName4]) {
|
3227 | lowPriorityWarning$1(false,
|
3228 |
|
3229 | 'componentWillMount has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-async-component-lifecycle-hooks for details.\n\n' + '* Move code from componentWillMount to componentDidMount (preferred in most cases) ' + 'or the constructor.\n' + '\nPlease update the following components: %s', _componentName4);
|
3230 | didWarnAboutDeprecatedWillMount[_componentName4] = true;
|
3231 | }
|
3232 | }
|
3233 | }
|
3234 |
|
3235 |
|
3236 |
|
3237 | if (typeof Component.getDerivedStateFromProps !== 'function') {
|
3238 | inst.componentWillMount();
|
3239 | }
|
3240 | }
|
3241 | if (typeof inst.UNSAFE_componentWillMount === 'function' && typeof Component.getDerivedStateFromProps !== 'function') {
|
3242 |
|
3243 |
|
3244 | inst.UNSAFE_componentWillMount();
|
3245 | }
|
3246 | if (queue.length) {
|
3247 | var oldQueue = queue;
|
3248 | var oldReplace = replace;
|
3249 | queue = null;
|
3250 | replace = false;
|
3251 |
|
3252 | if (oldReplace && oldQueue.length === 1) {
|
3253 | inst.state = oldQueue[0];
|
3254 | } else {
|
3255 | var nextState = oldReplace ? oldQueue[0] : inst.state;
|
3256 | var dontMutate = true;
|
3257 | for (var i = oldReplace ? 1 : 0; i < oldQueue.length; i++) {
|
3258 | var partial = oldQueue[i];
|
3259 | var _partialState = typeof partial === 'function' ? partial.call(inst, nextState, element.props, publicContext) : partial;
|
3260 | if (_partialState != null) {
|
3261 | if (dontMutate) {
|
3262 | dontMutate = false;
|
3263 | nextState = _assign({}, nextState, _partialState);
|
3264 | } else {
|
3265 | _assign(nextState, _partialState);
|
3266 | }
|
3267 | }
|
3268 | }
|
3269 | inst.state = nextState;
|
3270 | }
|
3271 | } else {
|
3272 | queue = null;
|
3273 | }
|
3274 | }
|
3275 | child = inst.render();
|
3276 |
|
3277 | {
|
3278 | if (child === undefined && inst.render._isMockFunction) {
|
3279 |
|
3280 |
|
3281 | child = null;
|
3282 | }
|
3283 | }
|
3284 | validateRenderResult(child, Component);
|
3285 |
|
3286 | var childContext = void 0;
|
3287 | if (disableLegacyContext) {
|
3288 | {
|
3289 | var childContextTypes = Component.childContextTypes;
|
3290 | if (childContextTypes !== undefined) {
|
3291 | warningWithoutStack$1(false, '%s uses the legacy childContextTypes API which is no longer supported. ' + 'Use React.createContext() instead.', getComponentName(Component) || 'Unknown');
|
3292 | }
|
3293 | }
|
3294 | } else {
|
3295 | if (typeof inst.getChildContext === 'function') {
|
3296 | var _childContextTypes = Component.childContextTypes;
|
3297 | if (typeof _childContextTypes === 'object') {
|
3298 | childContext = inst.getChildContext();
|
3299 | for (var contextKey in childContext) {
|
3300 | (function () {
|
3301 | if (!(contextKey in _childContextTypes)) {
|
3302 | {
|
3303 | throw ReactError(Error((getComponentName(Component) || 'Unknown') + '.getChildContext(): key "' + contextKey + '" is not defined in childContextTypes.'));
|
3304 | }
|
3305 | }
|
3306 | })();
|
3307 | }
|
3308 | } else {
|
3309 | warningWithoutStack$1(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', getComponentName(Component) || 'Unknown');
|
3310 | }
|
3311 | }
|
3312 | if (childContext) {
|
3313 | context = _assign({}, context, childContext);
|
3314 | }
|
3315 | }
|
3316 | }
|
3317 | return { child: child, context: context };
|
3318 | }
|
3319 |
|
3320 | var ReactDOMServerRenderer = function () {
|
3321 |
|
3322 |
|
3323 |
|
3324 | function ReactDOMServerRenderer(children, makeStaticMarkup) {
|
3325 | _classCallCheck(this, ReactDOMServerRenderer);
|
3326 |
|
3327 | var flatChildren = flattenTopLevelChildren(children);
|
3328 |
|
3329 | var topFrame = {
|
3330 | type: null,
|
3331 |
|
3332 |
|
3333 | domNamespace: Namespaces.html,
|
3334 | children: flatChildren,
|
3335 | childIndex: 0,
|
3336 | context: emptyObject,
|
3337 | footer: ''
|
3338 | };
|
3339 | {
|
3340 | topFrame.debugElementStack = [];
|
3341 | }
|
3342 | this.threadID = allocThreadID();
|
3343 | this.stack = [topFrame];
|
3344 | this.exhausted = false;
|
3345 | this.currentSelectValue = null;
|
3346 | this.previousWasTextNode = false;
|
3347 | this.makeStaticMarkup = makeStaticMarkup;
|
3348 | this.suspenseDepth = 0;
|
3349 |
|
3350 |
|
3351 | this.contextIndex = -1;
|
3352 | this.contextStack = [];
|
3353 | this.contextValueStack = [];
|
3354 | {
|
3355 | this.contextProviderStack = [];
|
3356 | }
|
3357 | }
|
3358 |
|
3359 | ReactDOMServerRenderer.prototype.destroy = function destroy() {
|
3360 | if (!this.exhausted) {
|
3361 | this.exhausted = true;
|
3362 | this.clearProviders();
|
3363 | freeThreadID(this.threadID);
|
3364 | }
|
3365 | };
|
3366 |
|
3367 | |
3368 |
|
3369 |
|
3370 |
|
3371 |
|
3372 |
|
3373 |
|
3374 |
|
3375 |
|
3376 |
|
3377 | ReactDOMServerRenderer.prototype.pushProvider = function pushProvider(provider) {
|
3378 | var index = ++this.contextIndex;
|
3379 | var context = provider.type._context;
|
3380 | var threadID = this.threadID;
|
3381 | validateContextBounds(context, threadID);
|
3382 | var previousValue = context[threadID];
|
3383 |
|
3384 |
|
3385 | this.contextStack[index] = context;
|
3386 | this.contextValueStack[index] = previousValue;
|
3387 | {
|
3388 |
|
3389 | this.contextProviderStack[index] = provider;
|
3390 | }
|
3391 |
|
3392 |
|
3393 | context[threadID] = provider.props.value;
|
3394 | };
|
3395 |
|
3396 | ReactDOMServerRenderer.prototype.popProvider = function popProvider(provider) {
|
3397 | var index = this.contextIndex;
|
3398 | {
|
3399 | !(index > -1 && provider === this.contextProviderStack[index]) ? warningWithoutStack$1(false, 'Unexpected pop.') : void 0;
|
3400 | }
|
3401 |
|
3402 | var context = this.contextStack[index];
|
3403 | var previousValue = this.contextValueStack[index];
|
3404 |
|
3405 |
|
3406 |
|
3407 |
|
3408 | this.contextStack[index] = null;
|
3409 | this.contextValueStack[index] = null;
|
3410 | {
|
3411 | this.contextProviderStack[index] = null;
|
3412 | }
|
3413 | this.contextIndex--;
|
3414 |
|
3415 |
|
3416 |
|
3417 |
|
3418 | context[this.threadID] = previousValue;
|
3419 | };
|
3420 |
|
3421 | ReactDOMServerRenderer.prototype.clearProviders = function clearProviders() {
|
3422 |
|
3423 | for (var index = this.contextIndex; index >= 0; index--) {
|
3424 | var _context = this.contextStack[index];
|
3425 | var previousValue = this.contextValueStack[index];
|
3426 | _context[this.threadID] = previousValue;
|
3427 | }
|
3428 | };
|
3429 |
|
3430 | ReactDOMServerRenderer.prototype.read = function read(bytes) {
|
3431 | if (this.exhausted) {
|
3432 | return null;
|
3433 | }
|
3434 |
|
3435 | var prevThreadID = currentThreadID;
|
3436 | setCurrentThreadID(this.threadID);
|
3437 | var prevDispatcher = ReactCurrentDispatcher.current;
|
3438 | ReactCurrentDispatcher.current = Dispatcher;
|
3439 | try {
|
3440 |
|
3441 |
|
3442 | var out = [''];
|
3443 | var suspended = false;
|
3444 | while (out[0].length < bytes) {
|
3445 | if (this.stack.length === 0) {
|
3446 | this.exhausted = true;
|
3447 | freeThreadID(this.threadID);
|
3448 | break;
|
3449 | }
|
3450 | var frame = this.stack[this.stack.length - 1];
|
3451 | if (suspended || frame.childIndex >= frame.children.length) {
|
3452 | var _footer = frame.footer;
|
3453 | if (_footer !== '') {
|
3454 | this.previousWasTextNode = false;
|
3455 | }
|
3456 | this.stack.pop();
|
3457 | if (frame.type === 'select') {
|
3458 | this.currentSelectValue = null;
|
3459 | } else if (frame.type != null && frame.type.type != null && frame.type.type.$$typeof === REACT_PROVIDER_TYPE) {
|
3460 | var provider = frame.type;
|
3461 | this.popProvider(provider);
|
3462 | } else if (frame.type === REACT_SUSPENSE_TYPE) {
|
3463 | this.suspenseDepth--;
|
3464 | var buffered = out.pop();
|
3465 |
|
3466 | if (suspended) {
|
3467 | suspended = false;
|
3468 |
|
3469 | var _fallbackFrame = frame.fallbackFrame;
|
3470 | (function () {
|
3471 | if (!_fallbackFrame) {
|
3472 | {
|
3473 | throw ReactError(Error('suspense fallback not found, something is broken'));
|
3474 | }
|
3475 | }
|
3476 | })();
|
3477 | this.stack.push(_fallbackFrame);
|
3478 | out[this.suspenseDepth] += '<!--$!-->';
|
3479 |
|
3480 | continue;
|
3481 | } else {
|
3482 | out[this.suspenseDepth] += buffered;
|
3483 | }
|
3484 | }
|
3485 |
|
3486 |
|
3487 | out[this.suspenseDepth] += _footer;
|
3488 | continue;
|
3489 | }
|
3490 | var child = frame.children[frame.childIndex++];
|
3491 |
|
3492 | var outBuffer = '';
|
3493 | {
|
3494 | pushCurrentDebugStack(this.stack);
|
3495 |
|
3496 | frame.debugElementStack.length = 0;
|
3497 | }
|
3498 | try {
|
3499 | outBuffer += this.render(child, frame.context, frame.domNamespace);
|
3500 | } catch (err) {
|
3501 | if (enableSuspenseServerRenderer && typeof err.then === 'function') {
|
3502 | suspended = true;
|
3503 | } else {
|
3504 | throw err;
|
3505 | }
|
3506 | } finally {
|
3507 | {
|
3508 | popCurrentDebugStack();
|
3509 | }
|
3510 | }
|
3511 | if (out.length <= this.suspenseDepth) {
|
3512 | out.push('');
|
3513 | }
|
3514 | out[this.suspenseDepth] += outBuffer;
|
3515 | }
|
3516 | return out[0];
|
3517 | } finally {
|
3518 | ReactCurrentDispatcher.current = prevDispatcher;
|
3519 | setCurrentThreadID(prevThreadID);
|
3520 | }
|
3521 | };
|
3522 |
|
3523 | ReactDOMServerRenderer.prototype.render = function render(child, context, parentNamespace) {
|
3524 | if (typeof child === 'string' || typeof child === 'number') {
|
3525 | var text = '' + child;
|
3526 | if (text === '') {
|
3527 | return '';
|
3528 | }
|
3529 | if (this.makeStaticMarkup) {
|
3530 | return escapeTextForBrowser(text);
|
3531 | }
|
3532 | if (this.previousWasTextNode) {
|
3533 | return '<!-- -->' + escapeTextForBrowser(text);
|
3534 | }
|
3535 | this.previousWasTextNode = true;
|
3536 | return escapeTextForBrowser(text);
|
3537 | } else {
|
3538 | var nextChild = void 0;
|
3539 |
|
3540 | var _resolve = resolve(child, context, this.threadID);
|
3541 |
|
3542 | nextChild = _resolve.child;
|
3543 | context = _resolve.context;
|
3544 |
|
3545 | if (nextChild === null || nextChild === false) {
|
3546 | return '';
|
3547 | } else if (!React.isValidElement(nextChild)) {
|
3548 | if (nextChild != null && nextChild.$$typeof != null) {
|
3549 |
|
3550 | var $$typeof = nextChild.$$typeof;
|
3551 | (function () {
|
3552 | if (!($$typeof !== REACT_PORTAL_TYPE)) {
|
3553 | {
|
3554 | throw ReactError(Error('Portals are not currently supported by the server renderer. Render them conditionally so that they only appear on the client render.'));
|
3555 | }
|
3556 | }
|
3557 | })();
|
3558 |
|
3559 | (function () {
|
3560 | {
|
3561 | {
|
3562 | throw ReactError(Error('Unknown element-like object type: ' + $$typeof.toString() + '. This is likely a bug in React. Please file an issue.'));
|
3563 | }
|
3564 | }
|
3565 | })();
|
3566 | }
|
3567 | var nextChildren = toArray(nextChild);
|
3568 | var frame = {
|
3569 | type: null,
|
3570 | domNamespace: parentNamespace,
|
3571 | children: nextChildren,
|
3572 | childIndex: 0,
|
3573 | context: context,
|
3574 | footer: ''
|
3575 | };
|
3576 | {
|
3577 | frame.debugElementStack = [];
|
3578 | }
|
3579 | this.stack.push(frame);
|
3580 | return '';
|
3581 | }
|
3582 |
|
3583 | var nextElement = nextChild;
|
3584 | var elementType = nextElement.type;
|
3585 |
|
3586 | if (typeof elementType === 'string') {
|
3587 | return this.renderDOM(nextElement, context, parentNamespace);
|
3588 | }
|
3589 |
|
3590 | switch (elementType) {
|
3591 | case REACT_STRICT_MODE_TYPE:
|
3592 | case REACT_CONCURRENT_MODE_TYPE:
|
3593 | case REACT_PROFILER_TYPE:
|
3594 | case REACT_SUSPENSE_LIST_TYPE:
|
3595 | case REACT_FRAGMENT_TYPE:
|
3596 | {
|
3597 | var _nextChildren = toArray(nextChild.props.children);
|
3598 | var _frame = {
|
3599 | type: null,
|
3600 | domNamespace: parentNamespace,
|
3601 | children: _nextChildren,
|
3602 | childIndex: 0,
|
3603 | context: context,
|
3604 | footer: ''
|
3605 | };
|
3606 | {
|
3607 | _frame.debugElementStack = [];
|
3608 | }
|
3609 | this.stack.push(_frame);
|
3610 | return '';
|
3611 | }
|
3612 | case REACT_SUSPENSE_TYPE:
|
3613 | {
|
3614 | if (enableSuspenseServerRenderer) {
|
3615 | var fallback = nextChild.props.fallback;
|
3616 | if (fallback === undefined) {
|
3617 |
|
3618 | var _nextChildren3 = toArray(nextChild.props.children);
|
3619 | var _frame3 = {
|
3620 | type: null,
|
3621 | domNamespace: parentNamespace,
|
3622 | children: _nextChildren3,
|
3623 | childIndex: 0,
|
3624 | context: context,
|
3625 | footer: ''
|
3626 | };
|
3627 | {
|
3628 | _frame3.debugElementStack = [];
|
3629 | }
|
3630 | this.stack.push(_frame3);
|
3631 | return '';
|
3632 | }
|
3633 | var fallbackChildren = toArray(fallback);
|
3634 | var _nextChildren2 = toArray(nextChild.props.children);
|
3635 | var _fallbackFrame2 = {
|
3636 | type: null,
|
3637 | domNamespace: parentNamespace,
|
3638 | children: fallbackChildren,
|
3639 | childIndex: 0,
|
3640 | context: context,
|
3641 | footer: '<!--/$-->'
|
3642 | };
|
3643 | var _frame2 = {
|
3644 | fallbackFrame: _fallbackFrame2,
|
3645 | type: REACT_SUSPENSE_TYPE,
|
3646 | domNamespace: parentNamespace,
|
3647 | children: _nextChildren2,
|
3648 | childIndex: 0,
|
3649 | context: context,
|
3650 | footer: '<!--/$-->'
|
3651 | };
|
3652 | {
|
3653 | _frame2.debugElementStack = [];
|
3654 | _fallbackFrame2.debugElementStack = [];
|
3655 | }
|
3656 | this.stack.push(_frame2);
|
3657 | this.suspenseDepth++;
|
3658 | return '<!--$-->';
|
3659 | } else {
|
3660 | (function () {
|
3661 | {
|
3662 | {
|
3663 | throw ReactError(Error('ReactDOMServer does not yet support Suspense.'));
|
3664 | }
|
3665 | }
|
3666 | })();
|
3667 | }
|
3668 | }
|
3669 |
|
3670 | default:
|
3671 | break;
|
3672 | }
|
3673 | if (typeof elementType === 'object' && elementType !== null) {
|
3674 | switch (elementType.$$typeof) {
|
3675 | case REACT_FORWARD_REF_TYPE:
|
3676 | {
|
3677 | var element = nextChild;
|
3678 | var _nextChildren4 = void 0;
|
3679 | var componentIdentity = {};
|
3680 | prepareToUseHooks(componentIdentity);
|
3681 | _nextChildren4 = elementType.render(element.props, element.ref);
|
3682 | _nextChildren4 = finishHooks(elementType.render, element.props, _nextChildren4, element.ref);
|
3683 | _nextChildren4 = toArray(_nextChildren4);
|
3684 | var _frame4 = {
|
3685 | type: null,
|
3686 | domNamespace: parentNamespace,
|
3687 | children: _nextChildren4,
|
3688 | childIndex: 0,
|
3689 | context: context,
|
3690 | footer: ''
|
3691 | };
|
3692 | {
|
3693 | _frame4.debugElementStack = [];
|
3694 | }
|
3695 | this.stack.push(_frame4);
|
3696 | return '';
|
3697 | }
|
3698 | case REACT_MEMO_TYPE:
|
3699 | {
|
3700 | var _element = nextChild;
|
3701 | var _nextChildren5 = [React.createElement(elementType.type, _assign({ ref: _element.ref }, _element.props))];
|
3702 | var _frame5 = {
|
3703 | type: null,
|
3704 | domNamespace: parentNamespace,
|
3705 | children: _nextChildren5,
|
3706 | childIndex: 0,
|
3707 | context: context,
|
3708 | footer: ''
|
3709 | };
|
3710 | {
|
3711 | _frame5.debugElementStack = [];
|
3712 | }
|
3713 | this.stack.push(_frame5);
|
3714 | return '';
|
3715 | }
|
3716 | case REACT_PROVIDER_TYPE:
|
3717 | {
|
3718 | var provider = nextChild;
|
3719 | var nextProps = provider.props;
|
3720 | var _nextChildren6 = toArray(nextProps.children);
|
3721 | var _frame6 = {
|
3722 | type: provider,
|
3723 | domNamespace: parentNamespace,
|
3724 | children: _nextChildren6,
|
3725 | childIndex: 0,
|
3726 | context: context,
|
3727 | footer: ''
|
3728 | };
|
3729 | {
|
3730 | _frame6.debugElementStack = [];
|
3731 | }
|
3732 |
|
3733 | this.pushProvider(provider);
|
3734 |
|
3735 | this.stack.push(_frame6);
|
3736 | return '';
|
3737 | }
|
3738 | case REACT_CONTEXT_TYPE:
|
3739 | {
|
3740 | var reactContext = nextChild.type;
|
3741 |
|
3742 |
|
3743 |
|
3744 |
|
3745 |
|
3746 |
|
3747 |
|
3748 | {
|
3749 | if (reactContext._context === undefined) {
|
3750 |
|
3751 |
|
3752 |
|
3753 | if (reactContext !== reactContext.Consumer) {
|
3754 | if (!hasWarnedAboutUsingContextAsConsumer) {
|
3755 | hasWarnedAboutUsingContextAsConsumer = true;
|
3756 | warning$1(false, 'Rendering <Context> directly is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
|
3757 | }
|
3758 | }
|
3759 | } else {
|
3760 | reactContext = reactContext._context;
|
3761 | }
|
3762 | }
|
3763 | var _nextProps = nextChild.props;
|
3764 | var threadID = this.threadID;
|
3765 | validateContextBounds(reactContext, threadID);
|
3766 | var nextValue = reactContext[threadID];
|
3767 |
|
3768 | var _nextChildren7 = toArray(_nextProps.children(nextValue));
|
3769 | var _frame7 = {
|
3770 | type: nextChild,
|
3771 | domNamespace: parentNamespace,
|
3772 | children: _nextChildren7,
|
3773 | childIndex: 0,
|
3774 | context: context,
|
3775 | footer: ''
|
3776 | };
|
3777 | {
|
3778 | _frame7.debugElementStack = [];
|
3779 | }
|
3780 | this.stack.push(_frame7);
|
3781 | return '';
|
3782 | }
|
3783 |
|
3784 | case REACT_FUNDAMENTAL_TYPE:
|
3785 | {
|
3786 | if (enableFundamentalAPI) {
|
3787 | var fundamentalImpl = elementType.impl;
|
3788 | var open = fundamentalImpl.getServerSideString(null, nextElement.props);
|
3789 | var getServerSideStringClose = fundamentalImpl.getServerSideStringClose;
|
3790 | var close = getServerSideStringClose !== undefined ? getServerSideStringClose(null, nextElement.props) : '';
|
3791 | var _nextChildren8 = fundamentalImpl.reconcileChildren !== false ? toArray(nextChild.props.children) : [];
|
3792 | var _frame8 = {
|
3793 | type: null,
|
3794 | domNamespace: parentNamespace,
|
3795 | children: _nextChildren8,
|
3796 | childIndex: 0,
|
3797 | context: context,
|
3798 | footer: close
|
3799 | };
|
3800 | {
|
3801 | _frame8.debugElementStack = [];
|
3802 | }
|
3803 | this.stack.push(_frame8);
|
3804 | return open;
|
3805 | }
|
3806 | (function () {
|
3807 | {
|
3808 | {
|
3809 | throw ReactError(Error('ReactDOMServer does not yet support the fundamental API.'));
|
3810 | }
|
3811 | }
|
3812 | })();
|
3813 | }
|
3814 |
|
3815 | case REACT_LAZY_TYPE:
|
3816 | (function () {
|
3817 | {
|
3818 | {
|
3819 | throw ReactError(Error('ReactDOMServer does not yet support lazy-loaded components.'));
|
3820 | }
|
3821 | }
|
3822 | })();
|
3823 | }
|
3824 | }
|
3825 |
|
3826 | var info = '';
|
3827 | {
|
3828 | var owner = nextElement._owner;
|
3829 | if (elementType === undefined || typeof elementType === 'object' && elementType !== null && Object.keys(elementType).length === 0) {
|
3830 | 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.';
|
3831 | }
|
3832 | var ownerName = owner ? getComponentName(owner) : null;
|
3833 | if (ownerName) {
|
3834 | info += '\n\nCheck the render method of `' + ownerName + '`.';
|
3835 | }
|
3836 | }
|
3837 | (function () {
|
3838 | {
|
3839 | {
|
3840 | throw ReactError(Error('Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: ' + (elementType == null ? elementType : typeof elementType) + '.' + info));
|
3841 | }
|
3842 | }
|
3843 | })();
|
3844 | }
|
3845 | };
|
3846 |
|
3847 | ReactDOMServerRenderer.prototype.renderDOM = function renderDOM(element, context, parentNamespace) {
|
3848 | var tag = element.type.toLowerCase();
|
3849 |
|
3850 | var namespace = parentNamespace;
|
3851 | if (parentNamespace === Namespaces.html) {
|
3852 | namespace = getIntrinsicNamespace(tag);
|
3853 | }
|
3854 |
|
3855 | {
|
3856 | if (namespace === Namespaces.html) {
|
3857 |
|
3858 |
|
3859 | !(tag === element.type) ? warning$1(false, '<%s /> is using incorrect casing. ' + 'Use PascalCase for React components, ' + 'or lowercase for HTML elements.', element.type) : void 0;
|
3860 | }
|
3861 | }
|
3862 |
|
3863 | validateDangerousTag(tag);
|
3864 |
|
3865 | var props = element.props;
|
3866 | if (tag === 'input') {
|
3867 | {
|
3868 | ReactControlledValuePropTypes.checkPropTypes('input', props);
|
3869 |
|
3870 | if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnDefaultChecked) {
|
3871 | warning$1(false, '%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', 'A component', props.type);
|
3872 | didWarnDefaultChecked = true;
|
3873 | }
|
3874 | if (props.value !== undefined && props.defaultValue !== undefined && !didWarnDefaultInputValue) {
|
3875 | warning$1(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', 'A component', props.type);
|
3876 | didWarnDefaultInputValue = true;
|
3877 | }
|
3878 | }
|
3879 |
|
3880 | props = _assign({
|
3881 | type: undefined
|
3882 | }, props, {
|
3883 | defaultChecked: undefined,
|
3884 | defaultValue: undefined,
|
3885 | value: props.value != null ? props.value : props.defaultValue,
|
3886 | checked: props.checked != null ? props.checked : props.defaultChecked
|
3887 | });
|
3888 | } else if (tag === 'textarea') {
|
3889 | {
|
3890 | ReactControlledValuePropTypes.checkPropTypes('textarea', props);
|
3891 | if (props.value !== undefined && props.defaultValue !== undefined && !didWarnDefaultTextareaValue) {
|
3892 | warning$1(false, 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components');
|
3893 | didWarnDefaultTextareaValue = true;
|
3894 | }
|
3895 | }
|
3896 |
|
3897 | var initialValue = props.value;
|
3898 | if (initialValue == null) {
|
3899 | var defaultValue = props.defaultValue;
|
3900 |
|
3901 | var textareaChildren = props.children;
|
3902 | if (textareaChildren != null) {
|
3903 | {
|
3904 | warning$1(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.');
|
3905 | }
|
3906 | (function () {
|
3907 | if (!(defaultValue == null)) {
|
3908 | {
|
3909 | throw ReactError(Error('If you supply `defaultValue` on a <textarea>, do not pass children.'));
|
3910 | }
|
3911 | }
|
3912 | })();
|
3913 | if (Array.isArray(textareaChildren)) {
|
3914 | (function () {
|
3915 | if (!(textareaChildren.length <= 1)) {
|
3916 | {
|
3917 | throw ReactError(Error('<textarea> can only have at most one child.'));
|
3918 | }
|
3919 | }
|
3920 | })();
|
3921 | textareaChildren = textareaChildren[0];
|
3922 | }
|
3923 |
|
3924 | defaultValue = '' + textareaChildren;
|
3925 | }
|
3926 | if (defaultValue == null) {
|
3927 | defaultValue = '';
|
3928 | }
|
3929 | initialValue = defaultValue;
|
3930 | }
|
3931 |
|
3932 | props = _assign({}, props, {
|
3933 | value: undefined,
|
3934 | children: '' + initialValue
|
3935 | });
|
3936 | } else if (tag === 'select') {
|
3937 | {
|
3938 | ReactControlledValuePropTypes.checkPropTypes('select', props);
|
3939 |
|
3940 | for (var i = 0; i < valuePropNames.length; i++) {
|
3941 | var propName = valuePropNames[i];
|
3942 | if (props[propName] == null) {
|
3943 | continue;
|
3944 | }
|
3945 | var isArray = Array.isArray(props[propName]);
|
3946 | if (props.multiple && !isArray) {
|
3947 | warning$1(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.', propName);
|
3948 | } else if (!props.multiple && isArray) {
|
3949 | warning$1(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.', propName);
|
3950 | }
|
3951 | }
|
3952 |
|
3953 | if (props.value !== undefined && props.defaultValue !== undefined && !didWarnDefaultSelectValue) {
|
3954 | warning$1(false, 'Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components');
|
3955 | didWarnDefaultSelectValue = true;
|
3956 | }
|
3957 | }
|
3958 | this.currentSelectValue = props.value != null ? props.value : props.defaultValue;
|
3959 | props = _assign({}, props, {
|
3960 | value: undefined
|
3961 | });
|
3962 | } else if (tag === 'option') {
|
3963 | var selected = null;
|
3964 | var selectValue = this.currentSelectValue;
|
3965 | var optionChildren = flattenOptionChildren(props.children);
|
3966 | if (selectValue != null) {
|
3967 | var value = void 0;
|
3968 | if (props.value != null) {
|
3969 | value = props.value + '';
|
3970 | } else {
|
3971 | value = optionChildren;
|
3972 | }
|
3973 | selected = false;
|
3974 | if (Array.isArray(selectValue)) {
|
3975 |
|
3976 | for (var j = 0; j < selectValue.length; j++) {
|
3977 | if ('' + selectValue[j] === value) {
|
3978 | selected = true;
|
3979 | break;
|
3980 | }
|
3981 | }
|
3982 | } else {
|
3983 | selected = '' + selectValue === value;
|
3984 | }
|
3985 |
|
3986 | props = _assign({
|
3987 | selected: undefined,
|
3988 | children: undefined
|
3989 | }, props, {
|
3990 | selected: selected,
|
3991 | children: optionChildren
|
3992 | });
|
3993 | }
|
3994 | }
|
3995 |
|
3996 | {
|
3997 | validatePropertiesInDevelopment(tag, props);
|
3998 | }
|
3999 |
|
4000 | assertValidProps(tag, props);
|
4001 |
|
4002 | var out = createOpenTagMarkup(element.type, tag, props, namespace, this.makeStaticMarkup, this.stack.length === 1);
|
4003 | var footer = '';
|
4004 | if (omittedCloseTags.hasOwnProperty(tag)) {
|
4005 | out += '/>';
|
4006 | } else {
|
4007 | out += '>';
|
4008 | footer = '</' + element.type + '>';
|
4009 | }
|
4010 | var children = void 0;
|
4011 | var innerMarkup = getNonChildrenInnerMarkup(props);
|
4012 | if (innerMarkup != null) {
|
4013 | children = [];
|
4014 | if (newlineEatingTags[tag] && innerMarkup.charAt(0) === '\n') {
|
4015 |
|
4016 |
|
4017 |
|
4018 |
|
4019 |
|
4020 |
|
4021 |
|
4022 |
|
4023 |
|
4024 |
|
4025 | out += '\n';
|
4026 | }
|
4027 | out += innerMarkup;
|
4028 | } else {
|
4029 | children = toArray(props.children);
|
4030 | }
|
4031 | var frame = {
|
4032 | domNamespace: getChildNamespace(parentNamespace, element.type),
|
4033 | type: tag,
|
4034 | children: children,
|
4035 | childIndex: 0,
|
4036 | context: context,
|
4037 | footer: footer
|
4038 | };
|
4039 | {
|
4040 | frame.debugElementStack = [];
|
4041 | }
|
4042 | this.stack.push(frame);
|
4043 | this.previousWasTextNode = false;
|
4044 | return out;
|
4045 | };
|
4046 |
|
4047 | return ReactDOMServerRenderer;
|
4048 | }();
|
4049 |
|
4050 |
|
4051 |
|
4052 |
|
4053 |
|
4054 |
|
4055 | function renderToString(element) {
|
4056 | var renderer = new ReactDOMServerRenderer(element, false);
|
4057 | try {
|
4058 | var markup = renderer.read(Infinity);
|
4059 | return markup;
|
4060 | } finally {
|
4061 | renderer.destroy();
|
4062 | }
|
4063 | }
|
4064 |
|
4065 |
|
4066 |
|
4067 |
|
4068 |
|
4069 |
|
4070 | function renderToStaticMarkup(element) {
|
4071 | var renderer = new ReactDOMServerRenderer(element, true);
|
4072 | try {
|
4073 | var markup = renderer.read(Infinity);
|
4074 | return markup;
|
4075 | } finally {
|
4076 | renderer.destroy();
|
4077 | }
|
4078 | }
|
4079 |
|
4080 | function renderToNodeStream() {
|
4081 | (function () {
|
4082 | {
|
4083 | {
|
4084 | throw ReactError(Error('ReactDOMServer.renderToNodeStream(): The streaming API is not available in the browser. Use ReactDOMServer.renderToString() instead.'));
|
4085 | }
|
4086 | }
|
4087 | })();
|
4088 | }
|
4089 |
|
4090 | function renderToStaticNodeStream() {
|
4091 | (function () {
|
4092 | {
|
4093 | {
|
4094 | throw ReactError(Error('ReactDOMServer.renderToStaticNodeStream(): The streaming API is not available in the browser. Use ReactDOMServer.renderToStaticMarkup() instead.'));
|
4095 | }
|
4096 | }
|
4097 | })();
|
4098 | }
|
4099 |
|
4100 |
|
4101 | var ReactDOMServerBrowser = {
|
4102 | renderToString: renderToString,
|
4103 | renderToStaticMarkup: renderToStaticMarkup,
|
4104 | renderToNodeStream: renderToNodeStream,
|
4105 | renderToStaticNodeStream: renderToStaticNodeStream,
|
4106 | version: ReactVersion
|
4107 | };
|
4108 |
|
4109 | var ReactDOMServerBrowser$1 = Object.freeze({
|
4110 | default: ReactDOMServerBrowser
|
4111 | });
|
4112 |
|
4113 | var ReactDOMServer = ( ReactDOMServerBrowser$1 && ReactDOMServerBrowser ) || ReactDOMServerBrowser$1;
|
4114 |
|
4115 |
|
4116 |
|
4117 | var server_browser = ReactDOMServer.default || ReactDOMServer;
|
4118 |
|
4119 | return server_browser;
|
4120 |
|
4121 | })));
|