· 5 years ago · Nov 02, 2020, 09:30 PM
1/******/
2(function(modules) {
3 // webpackBootstrap
4 /******/
5 // The module cache
6 /******/
7 var installedModules = {};
8 /******/
9 /******/
10 // The require function
11 /******/
12 function __webpack_require__(moduleId) {
13 /******/
14 /******/
15 // Check if module is in cache
16 /******/
17 if (installedModules[moduleId]) {
18 /******/
19 return installedModules[moduleId].exports;
20 /******/
21 }
22 /******/
23 // Create a new module (and put it into the cache)
24 /******/
25 var module = installedModules[moduleId] = {
26 /******/
27 i: moduleId,
28 /******/
29 l: false,
30 /******/
31 exports: {}/******/
32 };
33 /******/
34 /******/
35 // Execute the module function
36 /******/
37 modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
38 /******/
39 /******/
40 // Flag the module as loaded
41 /******/
42 module.l = true;
43 /******/
44 /******/
45 // Return the exports of the module
46 /******/
47 return module.exports;
48 /******/
49 }
50 /******/
51 /******/
52 /******/
53 // expose the modules object (__webpack_modules__)
54 /******/
55 __webpack_require__.m = modules;
56 /******/
57 /******/
58 // expose the module cache
59 /******/
60 __webpack_require__.c = installedModules;
61 /******/
62 /******/
63 // define getter function for harmony exports
64 /******/
65 __webpack_require__.d = function(exports, name, getter) {
66 /******/
67 if (!__webpack_require__.o(exports, name)) {
68 /******/
69 Object.defineProperty(exports, name, {
70 enumerable: true,
71 get: getter
72 });
73 /******/
74 }
75 /******/
76 }
77 ;
78 /******/
79 /******/
80 // define __esModule on exports
81 /******/
82 __webpack_require__.r = function(exports) {
83 /******/
84 if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
85 /******/
86 Object.defineProperty(exports, Symbol.toStringTag, {
87 value: 'Module'
88 });
89 /******/
90 }
91 /******/
92 Object.defineProperty(exports, '__esModule', {
93 value: true
94 });
95 /******/
96 }
97 ;
98 /******/
99 /******/
100 // create a fake namespace object
101 /******/
102 // mode & 1: value is a module id, require it
103 /******/
104 // mode & 2: merge all properties of value into the ns
105 /******/
106 // mode & 4: return value when already ns object
107 /******/
108 // mode & 8|1: behave like require
109 /******/
110 __webpack_require__.t = function(value, mode) {
111 /******/
112 if (mode & 1)
113 value = __webpack_require__(value);
114 /******/
115 if (mode & 8)
116 return value;
117 /******/
118 if ((mode & 4) && typeof value === 'object' && value && value.__esModule)
119 return value;
120 /******/
121 var ns = Object.create(null);
122 /******/
123 __webpack_require__.r(ns);
124 /******/
125 Object.defineProperty(ns, 'default', {
126 enumerable: true,
127 value: value
128 });
129 /******/
130 if (mode & 2 && typeof value != 'string')
131 for (var key in value)
132 __webpack_require__.d(ns, key, function(key) {
133 return value[key];
134 }
135 .bind(null, key));
136 /******/
137 return ns;
138 /******/
139 }
140 ;
141 /******/
142 /******/
143 // getDefaultExport function for compatibility with non-harmony modules
144 /******/
145 __webpack_require__.n = function(module) {
146 /******/
147 var getter = module && module.__esModule ? /******/
148 function getDefault() {
149 return module['default'];
150 }
151 : /******/
152 function getModuleExports() {
153 return module;
154 }
155 ;
156 /******/
157 __webpack_require__.d(getter, 'a', getter);
158 /******/
159 return getter;
160 /******/
161 }
162 ;
163 /******/
164 /******/
165 // Object.prototype.hasOwnProperty.call
166 /******/
167 __webpack_require__.o = function(object, property) {
168 return Object.prototype.hasOwnProperty.call(object, property);
169 }
170 ;
171 /******/
172 /******/
173 // __webpack_public_path__
174 /******/
175 __webpack_require__.p = "";
176 /******/
177 /******/
178 /******/
179 // Load entry module and return exports
180 /******/
181 return __webpack_require__(__webpack_require__.s = 168);
182 /******/
183}
184)/************************************************************************/
185/******/
186({
187
188 /***/
189 0: /***/
190 (function(module, exports, __webpack_require__) {
191
192 "use strict";
193
194 if (true) {
195 module.exports = __webpack_require__(50);
196 } else {}
197
198 /***/
199 }
200 ),
201
202 /***/
203 1: /***/
204 (function(module, __webpack_exports__, __webpack_require__) {
205
206 "use strict";
207 /* harmony export (binding) */
208 __webpack_require__.d(__webpack_exports__, "e", function() {
209 return ElementTypeClass;
210 });
211 /* harmony export (binding) */
212 __webpack_require__.d(__webpack_exports__, "f", function() {
213 return ElementTypeContext;
214 });
215 /* harmony export (binding) */
216 __webpack_require__.d(__webpack_exports__, "h", function() {
217 return ElementTypeFunction;
218 });
219 /* harmony export (binding) */
220 __webpack_require__.d(__webpack_exports__, "g", function() {
221 return ElementTypeForwardRef;
222 });
223 /* harmony export (binding) */
224 __webpack_require__.d(__webpack_exports__, "i", function() {
225 return ElementTypeHostComponent;
226 });
227 /* harmony export (binding) */
228 __webpack_require__.d(__webpack_exports__, "j", function() {
229 return ElementTypeMemo;
230 });
231 /* harmony export (binding) */
232 __webpack_require__.d(__webpack_exports__, "k", function() {
233 return ElementTypeOtherOrUnknown;
234 });
235 /* harmony export (binding) */
236 __webpack_require__.d(__webpack_exports__, "l", function() {
237 return ElementTypeProfiler;
238 });
239 /* harmony export (binding) */
240 __webpack_require__.d(__webpack_exports__, "m", function() {
241 return ElementTypeRoot;
242 });
243 /* harmony export (binding) */
244 __webpack_require__.d(__webpack_exports__, "n", function() {
245 return ElementTypeSuspense;
246 });
247 /* harmony export (binding) */
248 __webpack_require__.d(__webpack_exports__, "o", function() {
249 return ElementTypeSuspenseList;
250 });
251 /* harmony export (binding) */
252 __webpack_require__.d(__webpack_exports__, "b", function() {
253 return ComponentFilterElementType;
254 });
255 /* harmony export (binding) */
256 __webpack_require__.d(__webpack_exports__, "a", function() {
257 return ComponentFilterDisplayName;
258 });
259 /* harmony export (binding) */
260 __webpack_require__.d(__webpack_exports__, "d", function() {
261 return ComponentFilterLocation;
262 });
263 /* harmony export (binding) */
264 __webpack_require__.d(__webpack_exports__, "c", function() {
265 return ComponentFilterHOC;
266 });
267 /**
268 * Copyright (c) Facebook, Inc. and its affiliates.
269 *
270 * This source code is licensed under the MIT license found in the
271 * LICENSE file in the root directory of this source tree.
272 *
273 *
274 */
275 // WARNING
276 // The values below are referenced by ComponentFilters (which are saved via localStorage).
277 // Do not change them or it will break previously saved user customizations.
278 // If new element types are added, use new numbers rather than re-ordering existing ones.
279 //
280 // Changing these types is also a backwards breaking change for the standalone shell,
281 // since the frontend and backend must share the same values-
282 // and the backend is embedded in certain environments (like React Native).
283 const ElementTypeClass = 1;
284 const ElementTypeContext = 2;
285 const ElementTypeFunction = 5;
286 const ElementTypeForwardRef = 6;
287 const ElementTypeHostComponent = 7;
288 const ElementTypeMemo = 8;
289 const ElementTypeOtherOrUnknown = 9;
290 const ElementTypeProfiler = 10;
291 const ElementTypeRoot = 11;
292 const ElementTypeSuspense = 12;
293 const ElementTypeSuspenseList = 13;
294 // Different types of elements displayed in the Elements tree.
295 // These types may be used to visually distinguish types,
296 // or to enable/disable certain functionality.
297
298 // WARNING
299 // The values below are referenced by ComponentFilters (which are saved via localStorage).
300 // Do not change them or it will break previously saved user customizations.
301 // If new filter types are added, use new numbers rather than re-ordering existing ones.
302 const ComponentFilterElementType = 1;
303 const ComponentFilterDisplayName = 2;
304 const ComponentFilterLocation = 3;
305 const ComponentFilterHOC = 4;
306
307 /***/
308 }
309 ),
310
311 /***/
312 10: /***/
313 (function(module, exports, __webpack_require__) {
314
315 "use strict";
316
317 if (true) {
318 module.exports = __webpack_require__(48);
319 } else {}
320
321 /***/
322 }
323 ),
324
325 /***/
326 168: /***/
327 (function(module, __webpack_exports__, __webpack_require__) {
328
329 "use strict";
330 // ESM COMPAT FLAG
331 __webpack_require__.r(__webpack_exports__);
332
333 // EXTERNAL MODULE: /Users/bvaughn/Documents/git/react.alt2/node_modules/nullthrows/nullthrows.js
334 var nullthrows = __webpack_require__(68);
335 var nullthrows_default = /*#__PURE__*/
336 __webpack_require__.n(nullthrows);
337
338 // EXTERNAL MODULE: ../react-devtools-shared/src/backend/console.js + 3 modules
339 var console = __webpack_require__(35);
340
341 // CONCATENATED MODULE: ../react-devtools-shared/src/hook.js
342 /**
343 * Install the hook on window, which is an event emitter.
344 * Note because Chrome content scripts cannot directly modify the window object,
345 * we are evaling this function by inserting a script tag.
346 * That's why we have to inline the whole event emitter implementation here.
347 *
348 *
349 */
350
351 function installHook(target) {
352 if (target.hasOwnProperty('__REACT_DEVTOOLS_GLOBAL_HOOK__')) {
353 return null;
354 }
355
356 function detectReactBuildType(renderer) {
357 try {
358 if (typeof renderer.version === 'string') {
359 // React DOM Fiber (16+)
360 if (renderer.bundleType > 0) {
361 // This is not a production build.
362 // We are currently only using 0 (PROD) and 1 (DEV)
363 // but might add 2 (PROFILE) in the future.
364 return 'development';
365 }
366 // React 16 uses flat bundles. If we report the bundle as production
367 // version, it means we also minified and envified it ourselves.
368
369 return 'production';
370 // Note: There is still a risk that the CommonJS entry point has not
371 // been envified or uglified. In this case the user would have *both*
372 // development and production bundle, but only the prod one would run.
373 // This would be really bad. We have a separate check for this because
374 // it happens *outside* of the renderer injection. See `checkDCE` below.
375 }
376
377 const toString = Function.prototype.toString;
378
379 if (renderer.Mount && renderer.Mount._renderNewRootComponent) {
380 // React DOM Stack
381 const renderRootCode = toString.call(renderer.Mount._renderNewRootComponent);
382 // Filter out bad results (if that is even possible):
383
384 if (renderRootCode.indexOf('function') !== 0) {
385 // Hope for the best if we're not sure.
386 return 'production';
387 }
388 // Check for React DOM Stack < 15.1.0 in development.
389 // If it contains "storedMeasure" call, it's wrapped in ReactPerf (DEV only).
390 // This would be true even if it's minified, as method name still matches.
391
392 if (renderRootCode.indexOf('storedMeasure') !== -1) {
393 return 'development';
394 }
395 // For other versions (and configurations) it's not so easy.
396 // Let's quickly exclude proper production builds.
397 // If it contains a warning message, it's either a DEV build,
398 // or an PROD build without proper dead code elimination.
399
400 if (renderRootCode.indexOf('should be a pure function') !== -1) {
401 // Now how do we tell a DEV build from a bad PROD build?
402 // If we see NODE_ENV, we're going to assume this is a dev build
403 // because most likely it is referring to an empty shim.
404 if (renderRootCode.indexOf('NODE_ENV') !== -1) {
405 return 'development';
406 }
407 // If we see "development", we're dealing with an envified DEV build
408 // (such as the official React DEV UMD).
409
410 if (renderRootCode.indexOf('development') !== -1) {
411 return 'development';
412 }
413 // I've seen process.env.NODE_ENV !== 'production' being smartly
414 // replaced by `true` in DEV by Webpack. I don't know how that
415 // works but we can safely guard against it because `true` was
416 // never used in the function source since it was written.
417
418 if (renderRootCode.indexOf('true') !== -1) {
419 return 'development';
420 }
421 // By now either it is a production build that has not been minified,
422 // or (worse) this is a minified development build using non-standard
423 // environment (e.g. "staging"). We're going to look at whether
424 // the function argument name is mangled:
425
426 if (// 0.13 to 15
427 renderRootCode.indexOf('nextElement') !== -1 || // 0.12
428 renderRootCode.indexOf('nextComponent') !== -1) {
429 // We can't be certain whether this is a development build or not,
430 // but it is definitely unminified.
431 return 'unminified';
432 } else {
433 // This is likely a minified development build.
434 return 'development';
435 }
436 }
437 // By now we know that it's envified and dead code elimination worked,
438 // but what if it's still not minified? (Is this even possible?)
439 // Let's check matches for the first argument name.
440
441 if (// 0.13 to 15
442 renderRootCode.indexOf('nextElement') !== -1 || // 0.12
443 renderRootCode.indexOf('nextComponent') !== -1) {
444 return 'unminified';
445 }
446 // Seems like we're using the production version.
447 // However, the branch above is Stack-only so this is 15 or earlier.
448
449 return 'outdated';
450 }
451 } catch (err) {// Weird environments may exist.
452 // This code needs a higher fault tolerance
453 // because it runs even with closed DevTools.
454 // TODO: should we catch errors in all injected code, and not just this part?
455 }
456
457 return 'production';
458 }
459
460 function checkDCE(fn) {
461 // This runs for production versions of React.
462 // Needs to be super safe.
463 try {
464 const toString = Function.prototype.toString;
465 const code = toString.call(fn);
466 // This is a string embedded in the passed function under DEV-only
467 // condition. However the function executes only in PROD. Therefore,
468 // if we see it, dead code elimination did not work.
469
470 if (code.indexOf('^_^') > -1) {
471 // Remember to report during next injection.
472 hasDetectedBadDCE = true;
473 // Bonus: throw an exception hoping that it gets picked up by a reporting system.
474 // Not synchronously so that it doesn't break the calling code.
475
476 setTimeout(function() {
477 throw new Error('React is running in production mode, but dead code ' + 'elimination has not been applied. Read how to correctly ' + 'configure React for production: ' + 'https://reactjs.org/link/perf-use-production-build');
478 });
479 }
480 } catch (err) {}
481 }
482
483 let uidCounter = 0;
484
485 function inject(renderer) {
486 const id = ++uidCounter;
487 renderers.set(id, renderer);
488 const reactBuildType = hasDetectedBadDCE ? 'deadcode' : detectReactBuildType(renderer);
489 // Patching the console enables DevTools to do a few useful things:
490 // * Append component stacks to warnings and error messages
491 // * Disable logging during re-renders to inspect hooks (see inspectHooksOfFiber)
492 //
493 // For React Native, we intentionally patch early (during injection).
494 // This provides React Native developers with components stacks even if they don't run DevTools.
495 // This won't work for DOM though, since this entire file is eval'ed and inserted as a script tag.
496 // In that case, we'll patch later (when the frontend attaches).
497 //
498 // Don't patch in test environments because we don't want to interfere with Jest's own console overrides.
499 //
500 // Note that because this function is inlined, this conditional check must only use static booleans.
501 // Otherwise the extension will throw with an undefined error.
502 // (See comments in the try/catch below for more context on inlining.)
503
504 if (false) {}
505 // If we have just reloaded to profile, we need to inject the renderer interface before the app loads.
506 // Otherwise the renderer won't yet exist and we can skip this step.
507
508 const attach = target.__REACT_DEVTOOLS_ATTACH__;
509
510 if (typeof attach === 'function') {
511 const rendererInterface = attach(hook, id, renderer, target);
512 hook.rendererInterfaces.set(id, rendererInterface);
513 }
514
515 hook.emit('renderer', {
516 id,
517 renderer,
518 reactBuildType
519 });
520 return id;
521 }
522
523 let hasDetectedBadDCE = false;
524
525 function sub(event, fn) {
526 hook.on(event, fn);
527 return ()=>hook.off(event, fn);
528 }
529
530 function on(event, fn) {
531 if (!listeners[event]) {
532 listeners[event] = [];
533 }
534
535 listeners[event].push(fn);
536 }
537
538 function off(event, fn) {
539 if (!listeners[event]) {
540 return;
541 }
542
543 const index = listeners[event].indexOf(fn);
544
545 if (index !== -1) {
546 listeners[event].splice(index, 1);
547 }
548
549 if (!listeners[event].length) {
550 delete listeners[event];
551 }
552 }
553
554 function emit(event, data) {
555 if (listeners[event]) {
556 listeners[event].map(fn=>fn(data));
557 }
558 }
559
560 function getFiberRoots(rendererID) {
561 const roots = fiberRoots;
562
563 if (!roots[rendererID]) {
564 roots[rendererID] = new Set();
565 }
566
567 return roots[rendererID];
568 }
569
570 function onCommitFiberUnmount(rendererID, fiber) {
571 const rendererInterface = rendererInterfaces.get(rendererID);
572
573 if (rendererInterface != null) {
574 rendererInterface.handleCommitFiberUnmount(fiber);
575 }
576 }
577
578 function onCommitFiberRoot(rendererID, root, priorityLevel) {
579 const mountedRoots = hook.getFiberRoots(rendererID);
580 const current = root.current;
581 const isKnownRoot = mountedRoots.has(root);
582 const isUnmounting = current.memoizedState == null || current.memoizedState.element == null;
583 // Keep track of mounted roots so we can hydrate when DevTools connect.
584
585 if (!isKnownRoot && !isUnmounting) {
586 mountedRoots.add(root);
587 } else if (isKnownRoot && isUnmounting) {
588 mountedRoots.delete(root);
589 }
590
591 const rendererInterface = rendererInterfaces.get(rendererID);
592
593 if (rendererInterface != null) {
594 rendererInterface.handleCommitFiberRoot(root, priorityLevel);
595 }
596 }
597 // TODO: More meaningful names for "rendererInterfaces" and "renderers".
598
599 const fiberRoots = {};
600 const rendererInterfaces = new Map();
601 const listeners = {};
602 const renderers = new Map();
603 const hook = {
604 rendererInterfaces,
605 listeners,
606 // Fast Refresh for web relies on this.
607 renderers,
608 emit,
609 getFiberRoots,
610 inject,
611 on,
612 off,
613 sub,
614 // This is a legacy flag.
615 // React v16 checks the hook for this to ensure DevTools is new enough.
616 supportsFiber: true,
617 // React calls these methods.
618 checkDCE,
619 onCommitFiberUnmount,
620 onCommitFiberRoot
621 };
622 Object.defineProperty(target, '__REACT_DEVTOOLS_GLOBAL_HOOK__', {
623 // This property needs to be configurable for the test environment,
624 // else we won't be able to delete and recreate it beween tests.
625 configurable: false,
626 enumerable: false,
627
628 get() {
629 return hook;
630 }
631
632 });
633 return hook;
634 }
635 // EXTERNAL MODULE: ../react-devtools-shared/src/constants.js
636 var constants = __webpack_require__(3);
637
638 // EXTERNAL MODULE: ../react-devtools-shared/src/storage.js
639 var storage = __webpack_require__(7);
640
641 // CONCATENATED MODULE: ./src/injectGlobalHook.js
642 /* global chrome */
643
644 function injectCode(code) {
645 const script = document.createElement('script');
646 script.textContent = code;
647 // This script runs before the <head> element is created,
648 // so we add the script to <html> instead.
649
650 nullthrows_default()(document.documentElement).appendChild(script);
651 nullthrows_default()(script.parentNode).removeChild(script);
652 }
653
654 let lastDetectionResult;
655 // We want to detect when a renderer attaches, and notify the "background page"
656 // (which is shared between tabs and can highlight the React icon).
657 // Currently we are in "content script" context, so we can't listen to the hook directly
658 // (it will be injected directly into the page).
659 // So instead, the hook will use postMessage() to pass message to us here.
660 // And when this happens, we'll send a message to the "background page".
661
662 window.addEventListener('message', function(evt) {
663 if (evt.source !== window || !evt.data) {
664 return;
665 }
666
667 if (evt.data.source === 'react-devtools-detector') {
668 lastDetectionResult = {
669 hasDetectedReact: true,
670 reactBuildType: evt.data.reactBuildType
671 };
672 chrome.runtime.sendMessage(lastDetectionResult);
673 } else if (evt.data.source === 'react-devtools-inject-backend') {
674 const script = document.createElement('script');
675 script.src = chrome.runtime.getURL('build/react_devtools_backend.js');
676 document.documentElement.appendChild(script);
677 script.parentNode.removeChild(script);
678 }
679 });
680 // NOTE: Firefox WebExtensions content scripts are still alive and not re-injected
681 // while navigating the history to a document that has not been destroyed yet,
682 // replay the last detection result if the content script is active and the
683 // document has been hidden and shown again.
684
685 window.addEventListener('pageshow', function(evt) {
686 if (!lastDetectionResult || evt.target !== window.document) {
687 return;
688 }
689
690 chrome.runtime.sendMessage(lastDetectionResult);
691 });
692 const detectReact = `
693window.__REACT_DEVTOOLS_GLOBAL_HOOK__.on('renderer', function(evt) {
694 window.postMessage({
695 source: 'react-devtools-detector',
696 reactBuildType: evt.reactBuildType,
697 }, '*');
698});
699`;
700 const saveNativeValues = `
701window.__REACT_DEVTOOLS_GLOBAL_HOOK__.nativeObjectCreate = Object.create;
702window.__REACT_DEVTOOLS_GLOBAL_HOOK__.nativeMap = Map;
703window.__REACT_DEVTOOLS_GLOBAL_HOOK__.nativeWeakMap = WeakMap;
704window.__REACT_DEVTOOLS_GLOBAL_HOOK__.nativeSet = Set;
705`;
706 // If we have just reloaded to profile, we need to inject the renderer interface before the app loads.
707
708 if (Object(storage["d"/* sessionStorageGetItem */
709 ])(constants["j"/* SESSION_STORAGE_RELOAD_AND_PROFILE_KEY */
710 ]) === 'true') {
711 const rendererURL = chrome.runtime.getURL('build/renderer.js');
712 let rendererCode;
713 // We need to inject in time to catch the initial mount.
714 // This means we need to synchronously read the renderer code itself,
715 // and synchronously inject it into the page.
716 // There are very few ways to actually do this.
717 // This seems to be the best approach.
718
719 const request = new XMLHttpRequest();
720 request.addEventListener('load', function() {
721 rendererCode = this.responseText;
722 });
723 request.open('GET', rendererURL, false);
724 request.send();
725 injectCode(rendererCode);
726 }
727 // Inject a __REACT_DEVTOOLS_GLOBAL_HOOK__ global for React to interact with.
728 // Only do this for HTML documents though, to avoid e.g. breaking syntax highlighting for XML docs.
729
730 if ('text/html' === document.contentType) {
731 injectCode(';(' + installHook.toString() + '(window))' + saveNativeValues + detectReact);
732 }
733
734 if (typeof exportFunction === 'function') {
735 // eslint-disable-next-line no-undef
736 exportFunction(text=>{
737 // Call clipboard.writeText from the extension content script
738 // (as it has the clipboardWrite permission) and return a Promise
739 // accessible to the webpage js code.
740 return new window.Promise((resolve,reject)=>window.navigator.clipboard.writeText(text).then(resolve, reject));
741 }
742 , window.wrappedJSObject.__REACT_DEVTOOLS_GLOBAL_HOOK__, {
743 defineAs: 'clipboardCopyText'
744 });
745 }
746
747 /***/
748 }
749 ),
750
751 /***/
752 17: /***/
753 (function(module, exports, __webpack_require__) {
754
755 // Import support https://stackoverflow.com/questions/13673346/supporting-both-commonjs-and-amd
756 (function(name, definition) {
757 if (true) {
758 module.exports = definition();
759 } else {}
760 }
761 )("clipboard", function() {
762 if (typeof document === 'undefined' || !document.addEventListener) {
763 return null;
764 }
765
766 var clipboard = {};
767
768 clipboard.copy = function() {
769 var _intercept = false;
770 var _data = null;
771 // Map from data type (e.g. "text/html") to value.
772
773 var _bogusSelection = false;
774
775 function cleanup() {
776 _intercept = false;
777 _data = null;
778
779 if (_bogusSelection) {
780 window.getSelection().removeAllRanges();
781 }
782
783 _bogusSelection = false;
784 }
785
786 document.addEventListener("copy", function(e) {
787 if (_intercept) {
788 for (var key in _data) {
789 e.clipboardData.setData(key, _data[key]);
790 }
791
792 e.preventDefault();
793 }
794 });
795 // Workaround for Safari: https://bugs.webkit.org/show_bug.cgi?id=156529
796
797 function bogusSelect() {
798 var sel = document.getSelection();
799 // If "nothing" is selected...
800
801 if (!document.queryCommandEnabled("copy") && sel.isCollapsed) {
802 // ... temporarily select the entire body.
803 //
804 // We select the entire body because:
805 // - it's guaranteed to exist,
806 // - it works (unlike, say, document.head, or phantom element that is
807 // not inserted into the DOM),
808 // - it doesn't seem to flicker (due to the synchronous copy event), and
809 // - it avoids modifying the DOM (can trigger mutation observers).
810 //
811 // Because we can't do proper feature detection (we already checked
812 // document.queryCommandEnabled("copy") , which actually gives a false
813 // negative for Blink when nothing is selected) and UA sniffing is not
814 // reliable (a lot of UA strings contain "Safari"), this will also
815 // happen for some browsers other than Safari. :-()
816 var range = document.createRange();
817 range.selectNodeContents(document.body);
818 sel.removeAllRanges();
819 sel.addRange(range);
820 _bogusSelection = true;
821 }
822 }
823
824 ;return function(data) {
825 return new Promise(function(resolve, reject) {
826 _intercept = true;
827
828 if (typeof data === "string") {
829 _data = {
830 "text/plain": data
831 };
832 } else if (data instanceof Node) {
833 _data = {
834 "text/html": new XMLSerializer().serializeToString(data)
835 };
836 } else if (data instanceof Object) {
837 _data = data;
838 } else {
839 reject("Invalid data type. Must be string, DOM node, or an object mapping MIME types to strings.");
840 }
841
842 function triggerCopy(tryBogusSelect) {
843 try {
844 if (document.execCommand("copy")) {
845 // document.execCommand is synchronous: http://www.w3.org/TR/2015/WD-clipboard-apis-20150421/#integration-with-rich-text-editing-apis
846 // So we can call resolve() back here.
847 cleanup();
848 resolve();
849 } else {
850 if (!tryBogusSelect) {
851 bogusSelect();
852 triggerCopy(true);
853 } else {
854 cleanup();
855 throw new Error("Unable to copy. Perhaps it's not available in your browser?");
856 }
857 }
858 } catch (e) {
859 cleanup();
860 reject(e);
861 }
862 }
863
864 triggerCopy(false);
865 }
866 );
867 }
868 ;
869 }();
870
871 clipboard.paste = function() {
872 var _intercept = false;
873
874 var _resolve;
875
876 var _dataType;
877
878 document.addEventListener("paste", function(e) {
879 if (_intercept) {
880 _intercept = false;
881 e.preventDefault();
882 var resolve = _resolve;
883 _resolve = null;
884 resolve(e.clipboardData.getData(_dataType));
885 }
886 });
887 return function(dataType) {
888 return new Promise(function(resolve, reject) {
889 _intercept = true;
890 _resolve = resolve;
891 _dataType = dataType || "text/plain";
892
893 try {
894 if (!document.execCommand("paste")) {
895 _intercept = false;
896 reject(new Error("Unable to paste. Pasting only works in Internet Explorer at the moment."));
897 }
898 } catch (e) {
899 _intercept = false;
900 reject(new Error(e));
901 }
902 }
903 );
904 }
905 ;
906 }();
907 // Handle IE behaviour.
908
909 if (typeof ClipboardEvent === "undefined" && typeof window.clipboardData !== "undefined" && typeof window.clipboardData.setData !== "undefined") {
910 /*! promise-polyfill 2.0.1 */
911 (function(a) {
912 function b(a, b) {
913 return function() {
914 a.apply(b, arguments);
915 }
916 ;
917 }
918
919 function c(a) {
920 if ("object" != typeof this)
921 throw new TypeError("Promises must be constructed via new");
922 if ("function" != typeof a)
923 throw new TypeError("not a function");
924 this._state = null,
925 this._value = null,
926 this._deferreds = [],
927 i(a, b(e, this), b(f, this));
928 }
929
930 function d(a) {
931 var b = this;
932 return null === this._state ? void this._deferreds.push(a) : void j(function() {
933 var c = b._state ? a.onFulfilled : a.onRejected;
934 if (null === c)
935 return void (b._state ? a.resolve : a.reject)(b._value);
936 var d;
937
938 try {
939 d = c(b._value);
940 } catch (e) {
941 return void a.reject(e);
942 }
943
944 a.resolve(d);
945 });
946 }
947
948 function e(a) {
949 try {
950 if (a === this)
951 throw new TypeError("A promise cannot be resolved with itself.");
952
953 if (a && ("object" == typeof a || "function" == typeof a)) {
954 var c = a.then;
955 if ("function" == typeof c)
956 return void i(b(c, a), b(e, this), b(f, this));
957 }
958
959 this._state = !0,
960 this._value = a,
961 g.call(this);
962 } catch (d) {
963 f.call(this, d);
964 }
965 }
966
967 function f(a) {
968 this._state = !1,
969 this._value = a,
970 g.call(this);
971 }
972
973 function g() {
974 for (var a = 0, b = this._deferreds.length; b > a; a++)
975 d.call(this, this._deferreds[a]);
976
977 this._deferreds = null;
978 }
979
980 function h(a, b, c, d) {
981 this.onFulfilled = "function" == typeof a ? a : null,
982 this.onRejected = "function" == typeof b ? b : null,
983 this.resolve = c,
984 this.reject = d;
985 }
986
987 function i(a, b, c) {
988 var d = !1;
989
990 try {
991 a(function(a) {
992 d || (d = !0,
993 b(a));
994 }, function(a) {
995 d || (d = !0,
996 c(a));
997 });
998 } catch (e) {
999 if (d)
1000 return;
1001 d = !0,
1002 c(e);
1003 }
1004 }
1005
1006 var j = c.immediateFn || "function" == typeof setImmediate && setImmediate || function(a) {
1007 setTimeout(a, 1);
1008 }
1009 , k = Array.isArray || function(a) {
1010 return "[object Array]" === Object.prototype.toString.call(a);
1011 }
1012 ;
1013
1014 c.prototype["catch"] = function(a) {
1015 return this.then(null, a);
1016 }
1017 ,
1018 c.prototype.then = function(a, b) {
1019 var e = this;
1020 return new c(function(c, f) {
1021 d.call(e, new h(a,b,c,f));
1022 }
1023 );
1024 }
1025 ,
1026 c.all = function() {
1027 var a = Array.prototype.slice.call(1 === arguments.length && k(arguments[0]) ? arguments[0] : arguments);
1028 return new c(function(b, c) {
1029 function d(f, g) {
1030 try {
1031 if (g && ("object" == typeof g || "function" == typeof g)) {
1032 var h = g.then;
1033 if ("function" == typeof h)
1034 return void h.call(g, function(a) {
1035 d(f, a);
1036 }, c);
1037 }
1038
1039 a[f] = g,
1040 0 === --e && b(a);
1041 } catch (i) {
1042 c(i);
1043 }
1044 }
1045
1046 if (0 === a.length)
1047 return b([]);
1048
1049 for (var e = a.length, f = 0; f < a.length; f++)
1050 d(f, a[f]);
1051 }
1052 );
1053 }
1054 ,
1055 c.resolve = function(a) {
1056 return a && "object" == typeof a && a.constructor === c ? a : new c(function(b) {
1057 b(a);
1058 }
1059 );
1060 }
1061 ,
1062 c.reject = function(a) {
1063 return new c(function(b, c) {
1064 c(a);
1065 }
1066 );
1067 }
1068 ,
1069 c.race = function(a) {
1070 return new c(function(b, c) {
1071 for (var d = 0, e = a.length; e > d; d++)
1072 a[d].then(b, c);
1073 }
1074 );
1075 }
1076 ,
1077 true && module.exports ? module.exports = c : a.Promise || (a.Promise = c);
1078 }
1079 )(this);
1080
1081 clipboard.copy = function(data) {
1082 return new Promise(function(resolve, reject) {
1083 // IE supports string and URL types: https://msdn.microsoft.com/en-us/library/ms536744(v=vs.85).aspx
1084 // We only support the string type for now.
1085 if (typeof data !== "string" && !("text/plain"in data)) {
1086 throw new Error("You must provide a text/plain type.");
1087 }
1088
1089 var strData = typeof data === "string" ? data : data["text/plain"];
1090 var copySucceeded = window.clipboardData.setData("Text", strData);
1091
1092 if (copySucceeded) {
1093 resolve();
1094 } else {
1095 reject(new Error("Copying was rejected."));
1096 }
1097 }
1098 );
1099 }
1100 ;
1101
1102 clipboard.paste = function() {
1103 return new Promise(function(resolve, reject) {
1104 var strData = window.clipboardData.getData("Text");
1105
1106 if (strData) {
1107 resolve(strData);
1108 } else {
1109 // The user rejected the paste request.
1110 reject(new Error("Pasting was rejected."));
1111 }
1112 }
1113 );
1114 }
1115 ;
1116 }
1117
1118 return clipboard;
1119 });
1120
1121 /***/
1122 }
1123 ),
1124
1125 /***/
1126 2: /***/
1127 (function(module, __webpack_exports__, __webpack_require__) {
1128
1129 "use strict";
1130
1131 // EXPORTS
1132 __webpack_require__.d(__webpack_exports__, "c", function() {
1133 return /* binding */
1134 getAllEnumerableKeys;
1135 });
1136 __webpack_require__.d(__webpack_exports__, "h", function() {
1137 return /* binding */
1138 getDisplayName;
1139 });
1140 __webpack_require__.d(__webpack_exports__, "l", function() {
1141 return /* binding */
1142 getUID;
1143 });
1144 __webpack_require__.d(__webpack_exports__, "r", function() {
1145 return /* binding */
1146 utfDecodeString;
1147 });
1148 __webpack_require__.d(__webpack_exports__, "s", function() {
1149 return /* binding */
1150 utfEncodeString;
1151 });
1152 __webpack_require__.d(__webpack_exports__, "g", function() {
1153 return /* binding */
1154 getDefaultComponentFilters;
1155 });
1156 __webpack_require__.d(__webpack_exports__, "k", function() {
1157 return /* binding */
1158 getSavedComponentFilters;
1159 });
1160 __webpack_require__.d(__webpack_exports__, "n", function() {
1161 return /* binding */
1162 saveComponentFilters;
1163 });
1164 __webpack_require__.d(__webpack_exports__, "d", function() {
1165 return /* binding */
1166 getAppendComponentStack;
1167 });
1168 __webpack_require__.d(__webpack_exports__, "e", function() {
1169 return /* binding */
1170 getBreakOnConsoleErrors;
1171 });
1172 __webpack_require__.d(__webpack_exports__, "o", function() {
1173 return /* binding */
1174 separateDisplayNameAndHOCs;
1175 });
1176 __webpack_require__.d(__webpack_exports__, "q", function() {
1177 return /* binding */
1178 shallowDiffers;
1179 });
1180 __webpack_require__.d(__webpack_exports__, "j", function() {
1181 return /* binding */
1182 getInObject;
1183 });
1184 __webpack_require__.d(__webpack_exports__, "a", function() {
1185 return /* binding */
1186 deletePathInObject;
1187 });
1188 __webpack_require__.d(__webpack_exports__, "m", function() {
1189 return /* binding */
1190 renamePathInObject;
1191 });
1192 __webpack_require__.d(__webpack_exports__, "p", function() {
1193 return /* binding */
1194 setInObject;
1195 });
1196 __webpack_require__.d(__webpack_exports__, "f", function() {
1197 return /* binding */
1198 getDataType;
1199 });
1200 __webpack_require__.d(__webpack_exports__, "i", function() {
1201 return /* binding */
1202 getDisplayNameForReactElement;
1203 });
1204 __webpack_require__.d(__webpack_exports__, "b", function() {
1205 return /* binding */
1206 formatDataForPreview;
1207 });
1208
1209 // UNUSED EXPORTS: alphaSortKeys, printOperationsArray, setAppendComponentStack, setBreakOnConsoleErrors
1210
1211 // EXTERNAL MODULE: /Users/bvaughn/Documents/git/react.alt2/node_modules/lru-cache/index.js
1212 var lru_cache = __webpack_require__(34);
1213 var lru_cache_default = /*#__PURE__*/
1214 __webpack_require__.n(lru_cache);
1215
1216 // EXTERNAL MODULE: /Users/bvaughn/Documents/git/react.alt2/build/node_modules/react-is/index.js
1217 var react_is = __webpack_require__(10);
1218
1219 // CONCATENATED MODULE: ../shared/ReactSymbols.js
1220 /**
1221 * Copyright (c) Facebook, Inc. and its affiliates.
1222 *
1223 * This source code is licensed under the MIT license found in the
1224 * LICENSE file in the root directory of this source tree.
1225 *
1226 *
1227 */
1228 // ATTENTION
1229 // When adding new symbols to this file,
1230 // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
1231 // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
1232 // nor polyfill, then a plain number is used for performance.
1233 let REACT_ELEMENT_TYPE = 0xeac7;
1234 let REACT_PORTAL_TYPE = 0xeaca;
1235 let REACT_FRAGMENT_TYPE = 0xeacb;
1236 let REACT_STRICT_MODE_TYPE = 0xeacc;
1237 let REACT_PROFILER_TYPE = 0xead2;
1238 let REACT_PROVIDER_TYPE = 0xeacd;
1239 let REACT_CONTEXT_TYPE = 0xeace;
1240 let REACT_FORWARD_REF_TYPE = 0xead0;
1241 let REACT_SUSPENSE_TYPE = 0xead1;
1242 let REACT_SUSPENSE_LIST_TYPE = 0xead8;
1243 let REACT_MEMO_TYPE = 0xead3;
1244 let REACT_LAZY_TYPE = 0xead4;
1245 let REACT_BLOCK_TYPE = 0xead9;
1246 let REACT_SERVER_BLOCK_TYPE = 0xeada;
1247 let REACT_FUNDAMENTAL_TYPE = 0xead5;
1248 let REACT_SCOPE_TYPE = 0xead7;
1249 let REACT_OPAQUE_ID_TYPE = 0xeae0;
1250 let REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
1251 let REACT_OFFSCREEN_TYPE = 0xeae2;
1252 let REACT_LEGACY_HIDDEN_TYPE = 0xeae3;
1253
1254 if (typeof Symbol === 'function' && Symbol.for) {
1255 const symbolFor = Symbol.for;
1256 REACT_ELEMENT_TYPE = symbolFor('react.element');
1257 REACT_PORTAL_TYPE = symbolFor('react.portal');
1258 REACT_FRAGMENT_TYPE = symbolFor('react.fragment');
1259 REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode');
1260 REACT_PROFILER_TYPE = symbolFor('react.profiler');
1261 REACT_PROVIDER_TYPE = symbolFor('react.provider');
1262 REACT_CONTEXT_TYPE = symbolFor('react.context');
1263 REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
1264 REACT_SUSPENSE_TYPE = symbolFor('react.suspense');
1265 REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
1266 REACT_MEMO_TYPE = symbolFor('react.memo');
1267 REACT_LAZY_TYPE = symbolFor('react.lazy');
1268 REACT_BLOCK_TYPE = symbolFor('react.block');
1269 REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');
1270 REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
1271 REACT_SCOPE_TYPE = symbolFor('react.scope');
1272 REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id');
1273 REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
1274 REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen');
1275 REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
1276 }
1277
1278 const MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
1279 const FAUX_ITERATOR_SYMBOL = '@@iterator';
1280 function getIteratorFn(maybeIterable) {
1281 if (maybeIterable === null || typeof maybeIterable !== 'object') {
1282 return null;
1283 }
1284
1285 const maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
1286
1287 if (typeof maybeIterator === 'function') {
1288 return maybeIterator;
1289 }
1290
1291 return null;
1292 }
1293 // EXTERNAL MODULE: ../react-devtools-shared/src/constants.js
1294 var constants = __webpack_require__(3);
1295
1296 // EXTERNAL MODULE: ../react-devtools-shared/src/types.js
1297 var types = __webpack_require__(1);
1298
1299 // EXTERNAL MODULE: ../react-devtools-shared/src/storage.js
1300 var storage = __webpack_require__(7);
1301
1302 // EXTERNAL MODULE: ../react-devtools-shared/src/hydration.js
1303 var hydration = __webpack_require__(8);
1304
1305 // CONCATENATED MODULE: ../react-devtools-shared/src/utils.js
1306 /**
1307 * Copyright (c) Facebook, Inc. and its affiliates.
1308 *
1309 * This source code is licensed under the MIT license found in the
1310 * LICENSE file in the root directory of this source tree.
1311 *
1312 *
1313 */
1314
1315 const cachedDisplayNames = new WeakMap();
1316 // On large trees, encoding takes significant time.
1317 // Try to reuse the already encoded strings.
1318
1319 const encodedStringCache = new lru_cache_default.a({
1320 max: 1000
1321 });
1322 function alphaSortKeys(a, b) {
1323 if (a.toString() > b.toString()) {
1324 return 1;
1325 } else if (b.toString() > a.toString()) {
1326 return -1;
1327 } else {
1328 return 0;
1329 }
1330 }
1331 function getAllEnumerableKeys(obj) {
1332 const keys = [];
1333 let current = obj;
1334
1335 while (current != null) {
1336 const currentKeys = [...Object.keys(current), ...Object.getOwnPropertySymbols(current)];
1337 const descriptors = Object.getOwnPropertyDescriptors(current);
1338 currentKeys.forEach(key=>{
1339 // $FlowFixMe: key can be a Symbol https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor
1340 if (descriptors[key].enumerable) {
1341 keys.push(key);
1342 }
1343 }
1344 );
1345 current = Object.getPrototypeOf(current);
1346 }
1347
1348 return keys;
1349 }
1350 function getDisplayName(type, fallbackName='Anonymous') {
1351 const nameFromCache = cachedDisplayNames.get(type);
1352
1353 if (nameFromCache != null) {
1354 return nameFromCache;
1355 }
1356
1357 let displayName = fallbackName;
1358 // The displayName property is not guaranteed to be a string.
1359 // It's only safe to use for our purposes if it's a string.
1360 // github.com/facebook/react-devtools/issues/803
1361
1362 if (typeof type.displayName === 'string') {
1363 displayName = type.displayName;
1364 } else if (typeof type.name === 'string' && type.name !== '') {
1365 displayName = type.name;
1366 }
1367
1368 cachedDisplayNames.set(type, displayName);
1369 return displayName;
1370 }
1371 let uidCounter = 0;
1372 function getUID() {
1373 return ++uidCounter;
1374 }
1375 function utfDecodeString(array) {
1376 return String.fromCodePoint(...array);
1377 }
1378 function utfEncodeString(string) {
1379 const cached = encodedStringCache.get(string);
1380
1381 if (cached !== undefined) {
1382 return cached;
1383 }
1384
1385 const encoded = new Array(string.length);
1386
1387 for (let i = 0; i < string.length; i++) {
1388 encoded[i] = string.codePointAt(i);
1389 }
1390
1391 encodedStringCache.set(string, encoded);
1392 return encoded;
1393 }
1394 function printOperationsArray(operations) {
1395 // The first two values are always rendererID and rootID
1396 const rendererID = operations[0];
1397 const rootID = operations[1];
1398 const logs = [`operations for renderer:${rendererID} and root:${rootID}`];
1399 let i = 2;
1400 // Reassemble the string table.
1401
1402 const stringTable = [null // ID = 0 corresponds to the null string.
1403 ];
1404 const stringTableSize = operations[i++];
1405 const stringTableEnd = i + stringTableSize;
1406
1407 while (i < stringTableEnd) {
1408 const nextLength = operations[i++];
1409 const nextString = utfDecodeString(operations.slice(i, i + nextLength));
1410 stringTable.push(nextString);
1411 i += nextLength;
1412 }
1413
1414 while (i < operations.length) {
1415 const operation = operations[i];
1416
1417 switch (operation) {
1418 case constants["k"/* TREE_OPERATION_ADD */
1419 ]:
1420 {
1421 const id = operations[i + 1];
1422 const type = operations[i + 2];
1423 i += 3;
1424
1425 if (type === types["m"/* ElementTypeRoot */
1426 ]) {
1427 logs.push(`Add new root node ${id}`);
1428 i++;
1429 // supportsProfiling
1430
1431 i++;
1432 // hasOwnerMetadata
1433 } else {
1434 const parentID = operations[i];
1435 i++;
1436 i++;
1437 // ownerID
1438
1439 const displayNameStringID = operations[i];
1440 const displayName = stringTable[displayNameStringID];
1441 i++;
1442 i++;
1443 // key
1444
1445 logs.push(`Add node ${id} (${displayName || 'null'}) as child of ${parentID}`);
1446 }
1447
1448 break;
1449 }
1450
1451 case constants["l"/* TREE_OPERATION_REMOVE */
1452 ]:
1453 {
1454 const removeLength = operations[i + 1];
1455 i += 2;
1456
1457 for (let removeIndex = 0; removeIndex < removeLength; removeIndex++) {
1458 const id = operations[i];
1459 i += 1;
1460 logs.push(`Remove node ${id}`);
1461 }
1462
1463 break;
1464 }
1465
1466 case constants["m"/* TREE_OPERATION_REORDER_CHILDREN */
1467 ]:
1468 {
1469 const id = operations[i + 1];
1470 const numChildren = operations[i + 2];
1471 i += 3;
1472 const children = operations.slice(i, i + numChildren);
1473 i += numChildren;
1474 logs.push(`Re-order node ${id} children ${children.join(',')}`);
1475 break;
1476 }
1477
1478 case constants["n"/* TREE_OPERATION_UPDATE_TREE_BASE_DURATION */
1479 ]:
1480 // Base duration updates are only sent while profiling is in progress.
1481 // We can ignore them at this point.
1482 // The profiler UI uses them lazily in order to generate the tree.
1483 i += 3;
1484 break;
1485
1486 default:
1487 throw Error(`Unsupported Bridge operation ${operation}`);
1488 }
1489 }
1490
1491 console.log(logs.join('\n '));
1492 }
1493 function getDefaultComponentFilters() {
1494 return [{
1495 type: types["b"/* ComponentFilterElementType */
1496 ],
1497 value: types["i"/* ElementTypeHostComponent */
1498 ],
1499 isEnabled: true
1500 }];
1501 }
1502 function getSavedComponentFilters() {
1503 try {
1504 const raw = Object(storage["a"/* localStorageGetItem */
1505 ])(constants["d"/* LOCAL_STORAGE_FILTER_PREFERENCES_KEY */
1506 ]);
1507
1508 if (raw != null) {
1509 return JSON.parse(raw);
1510 }
1511 } catch (error) {}
1512
1513 return getDefaultComponentFilters();
1514 }
1515 function saveComponentFilters(componentFilters) {
1516 Object(storage["c"/* localStorageSetItem */
1517 ])(constants["d"/* LOCAL_STORAGE_FILTER_PREFERENCES_KEY */
1518 ], JSON.stringify(componentFilters));
1519 }
1520 function getAppendComponentStack() {
1521 try {
1522 const raw = Object(storage["a"/* localStorageGetItem */
1523 ])(constants["f"/* LOCAL_STORAGE_SHOULD_PATCH_CONSOLE_KEY */
1524 ]);
1525
1526 if (raw != null) {
1527 return JSON.parse(raw);
1528 }
1529 } catch (error) {}
1530
1531 return true;
1532 }
1533 function setAppendComponentStack(value) {
1534 Object(storage["c"/* localStorageSetItem */
1535 ])(constants["f"/* LOCAL_STORAGE_SHOULD_PATCH_CONSOLE_KEY */
1536 ], JSON.stringify(value));
1537 }
1538 function getBreakOnConsoleErrors() {
1539 try {
1540 const raw = Object(storage["a"/* localStorageGetItem */
1541 ])(constants["e"/* LOCAL_STORAGE_SHOULD_BREAK_ON_CONSOLE_ERRORS */
1542 ]);
1543
1544 if (raw != null) {
1545 return JSON.parse(raw);
1546 }
1547 } catch (error) {}
1548
1549 return false;
1550 }
1551 function setBreakOnConsoleErrors(value) {
1552 Object(storage["c"/* localStorageSetItem */
1553 ])(constants["e"/* LOCAL_STORAGE_SHOULD_BREAK_ON_CONSOLE_ERRORS */
1554 ], JSON.stringify(value));
1555 }
1556 function separateDisplayNameAndHOCs(displayName, type) {
1557 if (displayName === null) {
1558 return [null, null];
1559 }
1560
1561 let hocDisplayNames = null;
1562
1563 switch (type) {
1564 case types["e"/* ElementTypeClass */
1565 ]:
1566 case types["g"/* ElementTypeForwardRef */
1567 ]:
1568 case types["h"/* ElementTypeFunction */
1569 ]:
1570 case types["j"/* ElementTypeMemo */
1571 ]:
1572 if (displayName.indexOf('(') >= 0) {
1573 const matches = displayName.match(/[^()]+/g);
1574
1575 if (matches != null) {
1576 displayName = matches.pop();
1577 hocDisplayNames = matches;
1578 }
1579 }
1580
1581 break;
1582
1583 default:
1584 break;
1585 }
1586
1587 if (type === types["j"/* ElementTypeMemo */
1588 ]) {
1589 if (hocDisplayNames === null) {
1590 hocDisplayNames = ['Memo'];
1591 } else {
1592 hocDisplayNames.unshift('Memo');
1593 }
1594 } else if (type === types["g"/* ElementTypeForwardRef */
1595 ]) {
1596 if (hocDisplayNames === null) {
1597 hocDisplayNames = ['ForwardRef'];
1598 } else {
1599 hocDisplayNames.unshift('ForwardRef');
1600 }
1601 }
1602
1603 return [displayName, hocDisplayNames];
1604 }
1605 // Pulled from react-compat
1606 // https://github.com/developit/preact-compat/blob/7c5de00e7c85e2ffd011bf3af02899b63f699d3a/src/index.js#L349
1607
1608 function shallowDiffers(prev, next) {
1609 for (const attribute in prev) {
1610 if (!(attribute in next)) {
1611 return true;
1612 }
1613 }
1614
1615 for (const attribute in next) {
1616 if (prev[attribute] !== next[attribute]) {
1617 return true;
1618 }
1619 }
1620
1621 return false;
1622 }
1623 function getInObject(object, path) {
1624 return path.reduce((reduced,attr)=>{
1625 if (reduced) {
1626 if (hasOwnProperty.call(reduced, attr)) {
1627 return reduced[attr];
1628 }
1629
1630 if (typeof reduced[Symbol.iterator] === 'function') {
1631 // Convert iterable to array and return array[index]
1632 //
1633 // TRICKY
1634 // Don't use [...spread] syntax for this purpose.
1635 // This project uses @babel/plugin-transform-spread in "loose" mode which only works with Array values.
1636 // Other types (e.g. typed arrays, Sets) will not spread correctly.
1637 return Array.from(reduced)[attr];
1638 }
1639 }
1640
1641 return null;
1642 }
1643 , object);
1644 }
1645 function deletePathInObject(object, path) {
1646 const length = path.length;
1647 const last = path[length - 1];
1648
1649 if (object != null) {
1650 const parent = getInObject(object, path.slice(0, length - 1));
1651
1652 if (parent) {
1653 if (Array.isArray(parent)) {
1654 parent.splice(last, 1);
1655 } else {
1656 delete parent[last];
1657 }
1658 }
1659 }
1660 }
1661 function renamePathInObject(object, oldPath, newPath) {
1662 const length = oldPath.length;
1663
1664 if (object != null) {
1665 const parent = getInObject(object, oldPath.slice(0, length - 1));
1666
1667 if (parent) {
1668 const lastOld = oldPath[length - 1];
1669 const lastNew = newPath[length - 1];
1670 parent[lastNew] = parent[lastOld];
1671
1672 if (Array.isArray(parent)) {
1673 parent.splice(lastOld, 1);
1674 } else {
1675 delete parent[lastOld];
1676 }
1677 }
1678 }
1679 }
1680 function setInObject(object, path, value) {
1681 const length = path.length;
1682 const last = path[length - 1];
1683
1684 if (object != null) {
1685 const parent = getInObject(object, path.slice(0, length - 1));
1686
1687 if (parent) {
1688 parent[last] = value;
1689 }
1690 }
1691 }
1692
1693 /**
1694 * Get a enhanced/artificial type string based on the object instance
1695 */
1696 function getDataType(data) {
1697 if (data === null) {
1698 return 'null';
1699 } else if (data === undefined) {
1700 return 'undefined';
1701 }
1702
1703 if (Object(react_is["isElement"])(data)) {
1704 return 'react_element';
1705 }
1706
1707 if (typeof HTMLElement !== 'undefined' && data instanceof HTMLElement) {
1708 return 'html_element';
1709 }
1710
1711 const type = typeof data;
1712
1713 switch (type) {
1714 case 'bigint':
1715 return 'bigint';
1716
1717 case 'boolean':
1718 return 'boolean';
1719
1720 case 'function':
1721 return 'function';
1722
1723 case 'number':
1724 if (Number.isNaN(data)) {
1725 return 'nan';
1726 } else if (!Number.isFinite(data)) {
1727 return 'infinity';
1728 } else {
1729 return 'number';
1730 }
1731
1732 case 'object':
1733 if (Array.isArray(data)) {
1734 return 'array';
1735 } else if (ArrayBuffer.isView(data)) {
1736 return hasOwnProperty.call(data.constructor, 'BYTES_PER_ELEMENT') ? 'typed_array' : 'data_view';
1737 } else if (data.constructor && data.constructor.name === 'ArrayBuffer') {
1738 // HACK This ArrayBuffer check is gross; is there a better way?
1739 // We could try to create a new DataView with the value.
1740 // If it doesn't error, we know it's an ArrayBuffer,
1741 // but this seems kind of awkward and expensive.
1742 return 'array_buffer';
1743 } else if (typeof data[Symbol.iterator] === 'function') {
1744 return data[Symbol.iterator]() === data ? 'opaque_iterator' : 'iterator';
1745 } else if (data.constructor && data.constructor.name === 'RegExp') {
1746 return 'regexp';
1747 } else {
1748 const toStringValue = Object.prototype.toString.call(data);
1749
1750 if (toStringValue === '[object Date]') {
1751 return 'date';
1752 } else if (toStringValue === '[object HTMLAllCollection]') {
1753 return 'html_all_collection';
1754 }
1755 }
1756
1757 return 'object';
1758
1759 case 'string':
1760 return 'string';
1761
1762 case 'symbol':
1763 return 'symbol';
1764
1765 case 'undefined':
1766 if (Object.prototype.toString.call(data) === '[object HTMLAllCollection]') {
1767 return 'html_all_collection';
1768 }
1769
1770 return 'undefined';
1771
1772 default:
1773 return 'unknown';
1774 }
1775 }
1776 function getDisplayNameForReactElement(element) {
1777 const elementType = Object(react_is["typeOf"])(element);
1778
1779 switch (elementType) {
1780 case react_is["ContextConsumer"]:
1781 return 'ContextConsumer';
1782
1783 case react_is["ContextProvider"]:
1784 return 'ContextProvider';
1785
1786 case react_is["ForwardRef"]:
1787 return 'ForwardRef';
1788
1789 case react_is["Fragment"]:
1790 return 'Fragment';
1791
1792 case react_is["Lazy"]:
1793 return 'Lazy';
1794
1795 case react_is["Memo"]:
1796 return 'Memo';
1797
1798 case react_is["Portal"]:
1799 return 'Portal';
1800
1801 case react_is["Profiler"]:
1802 return 'Profiler';
1803
1804 case react_is["StrictMode"]:
1805 return 'StrictMode';
1806
1807 case react_is["Suspense"]:
1808 return 'Suspense';
1809
1810 case REACT_SUSPENSE_LIST_TYPE:
1811 return 'SuspenseList';
1812
1813 default:
1814 const type = element.type;
1815
1816 if (typeof type === 'string') {
1817 return type;
1818 } else if (typeof type === 'function') {
1819 return getDisplayName(type, 'Anonymous');
1820 } else if (type != null) {
1821 return 'NotImplementedInDevtools';
1822 } else {
1823 return 'Element';
1824 }
1825
1826 }
1827 }
1828 const MAX_PREVIEW_STRING_LENGTH = 50;
1829
1830 function truncateForDisplay(string, length=MAX_PREVIEW_STRING_LENGTH) {
1831 if (string.length > length) {
1832 return string.substr(0, length) + '…';
1833 } else {
1834 return string;
1835 }
1836 }
1837 // Attempts to mimic Chrome's inline preview for values.
1838 // For example, the following value...
1839 // {
1840 // foo: 123,
1841 // bar: "abc",
1842 // baz: [true, false],
1843 // qux: { ab: 1, cd: 2 }
1844 // };
1845 //
1846 // Would show a preview of...
1847 // {foo: 123, bar: "abc", baz: Array(2), qux: {…}}
1848 //
1849 // And the following value...
1850 // [
1851 // 123,
1852 // "abc",
1853 // [true, false],
1854 // { foo: 123, bar: "abc" }
1855 // ];
1856 //
1857 // Would show a preview of...
1858 // [123, "abc", Array(2), {…}]
1859
1860 function formatDataForPreview(data, showFormattedValue) {
1861 if (data != null && hasOwnProperty.call(data, hydration["d"/* meta */
1862 ].type)) {
1863 return showFormattedValue ? data[hydration["d"/* meta */
1864 ].preview_long] : data[hydration["d"/* meta */
1865 ].preview_short];
1866 }
1867
1868 const type = getDataType(data);
1869
1870 switch (type) {
1871 case 'html_element':
1872 return `<${truncateForDisplay(data.tagName.toLowerCase())} />`;
1873
1874 case 'function':
1875 return truncateForDisplay(`ƒ ${typeof data.name === 'function' ? '' : data.name}() {}`);
1876
1877 case 'string':
1878 return `"${data}"`;
1879
1880 case 'bigint':
1881 return truncateForDisplay(data.toString() + 'n');
1882
1883 case 'regexp':
1884 return truncateForDisplay(data.toString());
1885
1886 case 'symbol':
1887 return truncateForDisplay(data.toString());
1888
1889 case 'react_element':
1890 return `<${truncateForDisplay(getDisplayNameForReactElement(data) || 'Unknown')} />`;
1891
1892 case 'array_buffer':
1893 return `ArrayBuffer(${data.byteLength})`;
1894
1895 case 'data_view':
1896 return `DataView(${data.buffer.byteLength})`;
1897
1898 case 'array':
1899 if (showFormattedValue) {
1900 let formatted = '';
1901
1902 for (let i = 0; i < data.length; i++) {
1903 if (i > 0) {
1904 formatted += ', ';
1905 }
1906
1907 formatted += formatDataForPreview(data[i], false);
1908
1909 if (formatted.length > MAX_PREVIEW_STRING_LENGTH) {
1910 // Prevent doing a lot of unnecessary iteration...
1911 break;
1912 }
1913 }
1914
1915 return `[${truncateForDisplay(formatted)}]`;
1916 } else {
1917 const length = hasOwnProperty.call(data, hydration["d"/* meta */
1918 ].size) ? data[hydration["d"/* meta */
1919 ].size] : data.length;
1920 return `Array(${length})`;
1921 }
1922
1923 case 'typed_array':
1924 const shortName = `${data.constructor.name}(${data.length})`;
1925
1926 if (showFormattedValue) {
1927 let formatted = '';
1928
1929 for (let i = 0; i < data.length; i++) {
1930 if (i > 0) {
1931 formatted += ', ';
1932 }
1933
1934 formatted += data[i];
1935
1936 if (formatted.length > MAX_PREVIEW_STRING_LENGTH) {
1937 // Prevent doing a lot of unnecessary iteration...
1938 break;
1939 }
1940 }
1941
1942 return `${shortName} [${truncateForDisplay(formatted)}]`;
1943 } else {
1944 return shortName;
1945 }
1946
1947 case 'iterator':
1948 const name = data.constructor.name;
1949
1950 if (showFormattedValue) {
1951 // TRICKY
1952 // Don't use [...spread] syntax for this purpose.
1953 // This project uses @babel/plugin-transform-spread in "loose" mode which only works with Array values.
1954 // Other types (e.g. typed arrays, Sets) will not spread correctly.
1955 const array = Array.from(data);
1956 let formatted = '';
1957
1958 for (let i = 0; i < array.length; i++) {
1959 const entryOrEntries = array[i];
1960
1961 if (i > 0) {
1962 formatted += ', ';
1963 }
1964 // TRICKY
1965 // Browsers display Maps and Sets differently.
1966 // To mimic their behavior, detect if we've been given an entries tuple.
1967 // Map(2) {"abc" => 123, "def" => 123}
1968 // Set(2) {"abc", 123}
1969
1970 if (Array.isArray(entryOrEntries)) {
1971 const key = formatDataForPreview(entryOrEntries[0], true);
1972 const value = formatDataForPreview(entryOrEntries[1], false);
1973 formatted += `${key} => ${value}`;
1974 } else {
1975 formatted += formatDataForPreview(entryOrEntries, false);
1976 }
1977
1978 if (formatted.length > MAX_PREVIEW_STRING_LENGTH) {
1979 // Prevent doing a lot of unnecessary iteration...
1980 break;
1981 }
1982 }
1983
1984 return `${name}(${data.size}) {${truncateForDisplay(formatted)}}`;
1985 } else {
1986 return `${name}(${data.size})`;
1987 }
1988
1989 case 'opaque_iterator':
1990 {
1991 return data[Symbol.toStringTag];
1992 }
1993
1994 case 'date':
1995 return data.toString();
1996
1997 case 'object':
1998 if (showFormattedValue) {
1999 const keys = getAllEnumerableKeys(data).sort(alphaSortKeys);
2000 let formatted = '';
2001
2002 for (let i = 0; i < keys.length; i++) {
2003 const key = keys[i];
2004
2005 if (i > 0) {
2006 formatted += ', ';
2007 }
2008
2009 formatted += `${key.toString()}: ${formatDataForPreview(data[key], false)}`;
2010
2011 if (formatted.length > MAX_PREVIEW_STRING_LENGTH) {
2012 // Prevent doing a lot of unnecessary iteration...
2013 break;
2014 }
2015 }
2016
2017 return `{${truncateForDisplay(formatted)}}`;
2018 } else {
2019 return '{…}';
2020 }
2021
2022 case 'boolean':
2023 case 'number':
2024 case 'infinity':
2025 case 'nan':
2026 case 'null':
2027 case 'undefined':
2028 return data;
2029
2030 default:
2031 try {
2032 return truncateForDisplay('' + data);
2033 } catch (error) {
2034 return 'unserializable';
2035 }
2036
2037 }
2038 }
2039
2040 /***/
2041 }
2042 ),
2043
2044 /***/
2045 29: /***/
2046 (function(module, exports, __webpack_require__) {
2047
2048 /* WEBPACK VAR INJECTION */
2049 (function(process) {
2050 exports = module.exports = SemVer;
2051 var debug;
2052 /* istanbul ignore next */
2053
2054 if (typeof process === 'object' && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
2055 debug = function debug() {
2056 var args = Array.prototype.slice.call(arguments, 0);
2057 args.unshift('SEMVER');
2058 console.log.apply(console, args);
2059 }
2060 ;
2061 } else {
2062 debug = function debug() {}
2063 ;
2064 }
2065 // Note: this is the semver.org version of the spec that it implements
2066 // Not necessarily the package version of this code.
2067
2068 exports.SEMVER_SPEC_VERSION = '2.0.0';
2069 var MAX_LENGTH = 256;
2070 var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
2071 9007199254740991;
2072 // Max safe segment length for coercion.
2073
2074 var MAX_SAFE_COMPONENT_LENGTH = 16;
2075 // The actual regexps go on exports.re
2076
2077 var re = exports.re = [];
2078 var src = exports.src = [];
2079 var t = exports.tokens = {};
2080 var R = 0;
2081
2082 function tok(n) {
2083 t[n] = R++;
2084 }
2085 // The following Regular Expressions can be used for tokenizing,
2086 // validating, and parsing SemVer version strings.
2087 // ## Numeric Identifier
2088 // A single `0`, or a non-zero digit followed by zero or more digits.
2089
2090 tok('NUMERICIDENTIFIER');
2091 src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*';
2092 tok('NUMERICIDENTIFIERLOOSE');
2093 src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+';
2094 // ## Non-numeric Identifier
2095 // Zero or more digits, followed by a letter or hyphen, and then zero or
2096 // more letters, digits, or hyphens.
2097
2098 tok('NONNUMERICIDENTIFIER');
2099 src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*';
2100 // ## Main Version
2101 // Three dot-separated numeric identifiers.
2102
2103 tok('MAINVERSION');
2104 src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + '(' + src[t.NUMERICIDENTIFIER] + ')';
2105 tok('MAINVERSIONLOOSE');
2106 src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')';
2107 // ## Pre-release Version Identifier
2108 // A numeric identifier, or a non-numeric identifier.
2109
2110 tok('PRERELEASEIDENTIFIER');
2111 src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] + '|' + src[t.NONNUMERICIDENTIFIER] + ')';
2112 tok('PRERELEASEIDENTIFIERLOOSE');
2113 src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] + '|' + src[t.NONNUMERICIDENTIFIER] + ')';
2114 // ## Pre-release Version
2115 // Hyphen, followed by one or more dot-separated pre-release version
2116 // identifiers.
2117
2118 tok('PRERELEASE');
2119 src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] + '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))';
2120 tok('PRERELEASELOOSE');
2121 src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] + '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))';
2122 // ## Build Metadata Identifier
2123 // Any combination of digits, letters, or hyphens.
2124
2125 tok('BUILDIDENTIFIER');
2126 src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+';
2127 // ## Build Metadata
2128 // Plus sign, followed by one or more period-separated build metadata
2129 // identifiers.
2130
2131 tok('BUILD');
2132 src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] + '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))';
2133 // ## Full Version String
2134 // A main version, followed optionally by a pre-release version and
2135 // build metadata.
2136 // Note that the only major, minor, patch, and pre-release sections of
2137 // the version string are capturing groups. The build metadata is not a
2138 // capturing group, because it should not ever be used in version
2139 // comparison.
2140
2141 tok('FULL');
2142 tok('FULLPLAIN');
2143 src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] + src[t.PRERELEASE] + '?' + src[t.BUILD] + '?';
2144 src[t.FULL] = '^' + src[t.FULLPLAIN] + '$';
2145 // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
2146 // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
2147 // common in the npm registry.
2148
2149 tok('LOOSEPLAIN');
2150 src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] + src[t.PRERELEASELOOSE] + '?' + src[t.BUILD] + '?';
2151 tok('LOOSE');
2152 src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$';
2153 tok('GTLT');
2154 src[t.GTLT] = '((?:<|>)?=?)';
2155 // Something like "2.*" or "1.2.x".
2156 // Note that "x.x" is a valid xRange identifer, meaning "any version"
2157 // Only the first item is strictly required.
2158
2159 tok('XRANGEIDENTIFIERLOOSE');
2160 src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*';
2161 tok('XRANGEIDENTIFIER');
2162 src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*';
2163 tok('XRANGEPLAIN');
2164 src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' + '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + '(?:' + src[t.PRERELEASE] + ')?' + src[t.BUILD] + '?' + ')?)?';
2165 tok('XRANGEPLAINLOOSE');
2166 src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + '(?:' + src[t.PRERELEASELOOSE] + ')?' + src[t.BUILD] + '?' + ')?)?';
2167 tok('XRANGE');
2168 src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$';
2169 tok('XRANGELOOSE');
2170 src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$';
2171 // Coercion.
2172 // Extract anything that could conceivably be a part of a valid semver
2173
2174 tok('COERCE');
2175 src[t.COERCE] = '(^|[^\\d])' + '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + '(?:$|[^\\d])';
2176 tok('COERCERTL');
2177 re[t.COERCERTL] = new RegExp(src[t.COERCE],'g');
2178 // Tilde ranges.
2179 // Meaning is "reasonably at or greater than"
2180
2181 tok('LONETILDE');
2182 src[t.LONETILDE] = '(?:~>?)';
2183 tok('TILDETRIM');
2184 src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+';
2185 re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM],'g');
2186 var tildeTrimReplace = '$1~';
2187 tok('TILDE');
2188 src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$';
2189 tok('TILDELOOSE');
2190 src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$';
2191 // Caret ranges.
2192 // Meaning is "at least and backwards compatible with"
2193
2194 tok('LONECARET');
2195 src[t.LONECARET] = '(?:\\^)';
2196 tok('CARETTRIM');
2197 src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+';
2198 re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM],'g');
2199 var caretTrimReplace = '$1^';
2200 tok('CARET');
2201 src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$';
2202 tok('CARETLOOSE');
2203 src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$';
2204 // A simple gt/lt/eq thing, or just "" to indicate "any version"
2205
2206 tok('COMPARATORLOOSE');
2207 src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$';
2208 tok('COMPARATOR');
2209 src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$';
2210 // An expression to strip any whitespace between the gtlt and the thing
2211 // it modifies, so that `> 1.2.3` ==> `>1.2.3`
2212
2213 tok('COMPARATORTRIM');
2214 src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')';
2215 // this one has to use the /g flag
2216
2217 re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM],'g');
2218 var comparatorTrimReplace = '$1$2$3';
2219 // Something like `1.2.3 - 1.2.4`
2220 // Note that these all use the loose form, because they'll be
2221 // checked against either the strict or loose comparator form
2222 // later.
2223
2224 tok('HYPHENRANGE');
2225 src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' + '\\s+-\\s+' + '(' + src[t.XRANGEPLAIN] + ')' + '\\s*$';
2226 tok('HYPHENRANGELOOSE');
2227 src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' + '\\s+-\\s+' + '(' + src[t.XRANGEPLAINLOOSE] + ')' + '\\s*$';
2228 // Star ranges basically just allow anything at all.
2229
2230 tok('STAR');
2231 src[t.STAR] = '(<|>)?=?\\s*\\*';
2232 // Compile to actual regexp objects.
2233 // All are flag-free, unless they were created above with a flag.
2234
2235 for (var i = 0; i < R; i++) {
2236 debug(i, src[i]);
2237
2238 if (!re[i]) {
2239 re[i] = new RegExp(src[i]);
2240 }
2241 }
2242
2243 exports.parse = parse;
2244
2245 function parse(version, options) {
2246 if (!options || typeof options !== 'object') {
2247 options = {
2248 loose: !!options,
2249 includePrerelease: false
2250 };
2251 }
2252
2253 if (version instanceof SemVer) {
2254 return version;
2255 }
2256
2257 if (typeof version !== 'string') {
2258 return null;
2259 }
2260
2261 if (version.length > MAX_LENGTH) {
2262 return null;
2263 }
2264
2265 var r = options.loose ? re[t.LOOSE] : re[t.FULL];
2266
2267 if (!r.test(version)) {
2268 return null;
2269 }
2270
2271 try {
2272 return new SemVer(version,options);
2273 } catch (er) {
2274 return null;
2275 }
2276 }
2277
2278 exports.valid = valid;
2279
2280 function valid(version, options) {
2281 var v = parse(version, options);
2282 return v ? v.version : null;
2283 }
2284
2285 exports.clean = clean;
2286
2287 function clean(version, options) {
2288 var s = parse(version.trim().replace(/^[=v]+/, ''), options);
2289 return s ? s.version : null;
2290 }
2291
2292 exports.SemVer = SemVer;
2293
2294 function SemVer(version, options) {
2295 if (!options || typeof options !== 'object') {
2296 options = {
2297 loose: !!options,
2298 includePrerelease: false
2299 };
2300 }
2301
2302 if (version instanceof SemVer) {
2303 if (version.loose === options.loose) {
2304 return version;
2305 } else {
2306 version = version.version;
2307 }
2308 } else if (typeof version !== 'string') {
2309 throw new TypeError('Invalid Version: ' + version);
2310 }
2311
2312 if (version.length > MAX_LENGTH) {
2313 throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters');
2314 }
2315
2316 if (!(this instanceof SemVer)) {
2317 return new SemVer(version,options);
2318 }
2319
2320 debug('SemVer', version, options);
2321 this.options = options;
2322 this.loose = !!options.loose;
2323 var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
2324
2325 if (!m) {
2326 throw new TypeError('Invalid Version: ' + version);
2327 }
2328
2329 this.raw = version;
2330 // these are actually numbers
2331
2332 this.major = +m[1];
2333 this.minor = +m[2];
2334 this.patch = +m[3];
2335
2336 if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
2337 throw new TypeError('Invalid major version');
2338 }
2339
2340 if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
2341 throw new TypeError('Invalid minor version');
2342 }
2343
2344 if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
2345 throw new TypeError('Invalid patch version');
2346 }
2347 // numberify any prerelease numeric ids
2348
2349 if (!m[4]) {
2350 this.prerelease = [];
2351 } else {
2352 this.prerelease = m[4].split('.').map(function(id) {
2353 if (/^[0-9]+$/.test(id)) {
2354 var num = +id;
2355
2356 if (num >= 0 && num < MAX_SAFE_INTEGER) {
2357 return num;
2358 }
2359 }
2360
2361 return id;
2362 });
2363 }
2364
2365 this.build = m[5] ? m[5].split('.') : [];
2366 this.format();
2367 }
2368
2369 SemVer.prototype.format = function() {
2370 this.version = this.major + '.' + this.minor + '.' + this.patch;
2371
2372 if (this.prerelease.length) {
2373 this.version += '-' + this.prerelease.join('.');
2374 }
2375
2376 return this.version;
2377 }
2378 ;
2379
2380 SemVer.prototype.toString = function() {
2381 return this.version;
2382 }
2383 ;
2384
2385 SemVer.prototype.compare = function(other) {
2386 debug('SemVer.compare', this.version, this.options, other);
2387
2388 if (!(other instanceof SemVer)) {
2389 other = new SemVer(other,this.options);
2390 }
2391
2392 return this.compareMain(other) || this.comparePre(other);
2393 }
2394 ;
2395
2396 SemVer.prototype.compareMain = function(other) {
2397 if (!(other instanceof SemVer)) {
2398 other = new SemVer(other,this.options);
2399 }
2400
2401 return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
2402 }
2403 ;
2404
2405 SemVer.prototype.comparePre = function(other) {
2406 if (!(other instanceof SemVer)) {
2407 other = new SemVer(other,this.options);
2408 }
2409 // NOT having a prerelease is > having one
2410
2411 if (this.prerelease.length && !other.prerelease.length) {
2412 return -1;
2413 } else if (!this.prerelease.length && other.prerelease.length) {
2414 return 1;
2415 } else if (!this.prerelease.length && !other.prerelease.length) {
2416 return 0;
2417 }
2418
2419 var i = 0;
2420
2421 do {
2422 var a = this.prerelease[i];
2423 var b = other.prerelease[i];
2424 debug('prerelease compare', i, a, b);
2425
2426 if (a === undefined && b === undefined) {
2427 return 0;
2428 } else if (b === undefined) {
2429 return 1;
2430 } else if (a === undefined) {
2431 return -1;
2432 } else if (a === b) {
2433 continue;
2434 } else {
2435 return compareIdentifiers(a, b);
2436 }
2437 } while (++i);
2438 }
2439 ;
2440
2441 SemVer.prototype.compareBuild = function(other) {
2442 if (!(other instanceof SemVer)) {
2443 other = new SemVer(other,this.options);
2444 }
2445
2446 var i = 0;
2447
2448 do {
2449 var a = this.build[i];
2450 var b = other.build[i];
2451 debug('prerelease compare', i, a, b);
2452
2453 if (a === undefined && b === undefined) {
2454 return 0;
2455 } else if (b === undefined) {
2456 return 1;
2457 } else if (a === undefined) {
2458 return -1;
2459 } else if (a === b) {
2460 continue;
2461 } else {
2462 return compareIdentifiers(a, b);
2463 }
2464 } while (++i);
2465 }
2466 ;
2467 // preminor will bump the version up to the next minor release, and immediately
2468 // down to pre-release. premajor and prepatch work the same way.
2469
2470 SemVer.prototype.inc = function(release, identifier) {
2471 switch (release) {
2472 case 'premajor':
2473 this.prerelease.length = 0;
2474 this.patch = 0;
2475 this.minor = 0;
2476 this.major++;
2477 this.inc('pre', identifier);
2478 break;
2479
2480 case 'preminor':
2481 this.prerelease.length = 0;
2482 this.patch = 0;
2483 this.minor++;
2484 this.inc('pre', identifier);
2485 break;
2486
2487 case 'prepatch':
2488 // If this is already a prerelease, it will bump to the next version
2489 // drop any prereleases that might already exist, since they are not
2490 // relevant at this point.
2491 this.prerelease.length = 0;
2492 this.inc('patch', identifier);
2493 this.inc('pre', identifier);
2494 break;
2495 // If the input is a non-prerelease version, this acts the same as
2496 // prepatch.
2497
2498 case 'prerelease':
2499 if (this.prerelease.length === 0) {
2500 this.inc('patch', identifier);
2501 }
2502
2503 this.inc('pre', identifier);
2504 break;
2505
2506 case 'major':
2507 // If this is a pre-major version, bump up to the same major version.
2508 // Otherwise increment major.
2509 // 1.0.0-5 bumps to 1.0.0
2510 // 1.1.0 bumps to 2.0.0
2511 if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
2512 this.major++;
2513 }
2514
2515 this.minor = 0;
2516 this.patch = 0;
2517 this.prerelease = [];
2518 break;
2519
2520 case 'minor':
2521 // If this is a pre-minor version, bump up to the same minor version.
2522 // Otherwise increment minor.
2523 // 1.2.0-5 bumps to 1.2.0
2524 // 1.2.1 bumps to 1.3.0
2525 if (this.patch !== 0 || this.prerelease.length === 0) {
2526 this.minor++;
2527 }
2528
2529 this.patch = 0;
2530 this.prerelease = [];
2531 break;
2532
2533 case 'patch':
2534 // If this is not a pre-release version, it will increment the patch.
2535 // If it is a pre-release it will bump up to the same patch version.
2536 // 1.2.0-5 patches to 1.2.0
2537 // 1.2.0 patches to 1.2.1
2538 if (this.prerelease.length === 0) {
2539 this.patch++;
2540 }
2541
2542 this.prerelease = [];
2543 break;
2544 // This probably shouldn't be used publicly.
2545 // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
2546
2547 case 'pre':
2548 if (this.prerelease.length === 0) {
2549 this.prerelease = [0];
2550 } else {
2551 var i = this.prerelease.length;
2552
2553 while (--i >= 0) {
2554 if (typeof this.prerelease[i] === 'number') {
2555 this.prerelease[i]++;
2556 i = -2;
2557 }
2558 }
2559
2560 if (i === -1) {
2561 // didn't increment anything
2562 this.prerelease.push(0);
2563 }
2564 }
2565
2566 if (identifier) {
2567 // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
2568 // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
2569 if (this.prerelease[0] === identifier) {
2570 if (isNaN(this.prerelease[1])) {
2571 this.prerelease = [identifier, 0];
2572 }
2573 } else {
2574 this.prerelease = [identifier, 0];
2575 }
2576 }
2577
2578 break;
2579
2580 default:
2581 throw new Error('invalid increment argument: ' + release);
2582 }
2583
2584 this.format();
2585 this.raw = this.version;
2586 return this;
2587 }
2588 ;
2589
2590 exports.inc = inc;
2591
2592 function inc(version, release, loose, identifier) {
2593 if (typeof loose === 'string') {
2594 identifier = loose;
2595 loose = undefined;
2596 }
2597
2598 try {
2599 return new SemVer(version,loose).inc(release, identifier).version;
2600 } catch (er) {
2601 return null;
2602 }
2603 }
2604
2605 exports.diff = diff;
2606
2607 function diff(version1, version2) {
2608 if (eq(version1, version2)) {
2609 return null;
2610 } else {
2611 var v1 = parse(version1);
2612 var v2 = parse(version2);
2613 var prefix = '';
2614
2615 if (v1.prerelease.length || v2.prerelease.length) {
2616 prefix = 'pre';
2617 var defaultResult = 'prerelease';
2618 }
2619
2620 for (var key in v1) {
2621 if (key === 'major' || key === 'minor' || key === 'patch') {
2622 if (v1[key] !== v2[key]) {
2623 return prefix + key;
2624 }
2625 }
2626 }
2627
2628 return defaultResult;
2629 // may be undefined
2630 }
2631 }
2632
2633 exports.compareIdentifiers = compareIdentifiers;
2634 var numeric = /^[0-9]+$/;
2635
2636 function compareIdentifiers(a, b) {
2637 var anum = numeric.test(a);
2638 var bnum = numeric.test(b);
2639
2640 if (anum && bnum) {
2641 a = +a;
2642 b = +b;
2643 }
2644
2645 return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
2646 }
2647
2648 exports.rcompareIdentifiers = rcompareIdentifiers;
2649
2650 function rcompareIdentifiers(a, b) {
2651 return compareIdentifiers(b, a);
2652 }
2653
2654 exports.major = major;
2655
2656 function major(a, loose) {
2657 return new SemVer(a,loose).major;
2658 }
2659
2660 exports.minor = minor;
2661
2662 function minor(a, loose) {
2663 return new SemVer(a,loose).minor;
2664 }
2665
2666 exports.patch = patch;
2667
2668 function patch(a, loose) {
2669 return new SemVer(a,loose).patch;
2670 }
2671
2672 exports.compare = compare;
2673
2674 function compare(a, b, loose) {
2675 return new SemVer(a,loose).compare(new SemVer(b,loose));
2676 }
2677
2678 exports.compareLoose = compareLoose;
2679
2680 function compareLoose(a, b) {
2681 return compare(a, b, true);
2682 }
2683
2684 exports.compareBuild = compareBuild;
2685
2686 function compareBuild(a, b, loose) {
2687 var versionA = new SemVer(a,loose);
2688 var versionB = new SemVer(b,loose);
2689 return versionA.compare(versionB) || versionA.compareBuild(versionB);
2690 }
2691
2692 exports.rcompare = rcompare;
2693
2694 function rcompare(a, b, loose) {
2695 return compare(b, a, loose);
2696 }
2697
2698 exports.sort = sort;
2699
2700 function sort(list, loose) {
2701 return list.sort(function(a, b) {
2702 return exports.compareBuild(a, b, loose);
2703 });
2704 }
2705
2706 exports.rsort = rsort;
2707
2708 function rsort(list, loose) {
2709 return list.sort(function(a, b) {
2710 return exports.compareBuild(b, a, loose);
2711 });
2712 }
2713
2714 exports.gt = gt;
2715
2716 function gt(a, b, loose) {
2717 return compare(a, b, loose) > 0;
2718 }
2719
2720 exports.lt = lt;
2721
2722 function lt(a, b, loose) {
2723 return compare(a, b, loose) < 0;
2724 }
2725
2726 exports.eq = eq;
2727
2728 function eq(a, b, loose) {
2729 return compare(a, b, loose) === 0;
2730 }
2731
2732 exports.neq = neq;
2733
2734 function neq(a, b, loose) {
2735 return compare(a, b, loose) !== 0;
2736 }
2737
2738 exports.gte = gte;
2739
2740 function gte(a, b, loose) {
2741 return compare(a, b, loose) >= 0;
2742 }
2743
2744 exports.lte = lte;
2745
2746 function lte(a, b, loose) {
2747 return compare(a, b, loose) <= 0;
2748 }
2749
2750 exports.cmp = cmp;
2751
2752 function cmp(a, op, b, loose) {
2753 switch (op) {
2754 case '===':
2755 if (typeof a === 'object')
2756 a = a.version;
2757 if (typeof b === 'object')
2758 b = b.version;
2759 return a === b;
2760
2761 case '!==':
2762 if (typeof a === 'object')
2763 a = a.version;
2764 if (typeof b === 'object')
2765 b = b.version;
2766 return a !== b;
2767
2768 case '':
2769 case '=':
2770 case '==':
2771 return eq(a, b, loose);
2772
2773 case '!=':
2774 return neq(a, b, loose);
2775
2776 case '>':
2777 return gt(a, b, loose);
2778
2779 case '>=':
2780 return gte(a, b, loose);
2781
2782 case '<':
2783 return lt(a, b, loose);
2784
2785 case '<=':
2786 return lte(a, b, loose);
2787
2788 default:
2789 throw new TypeError('Invalid operator: ' + op);
2790 }
2791 }
2792
2793 exports.Comparator = Comparator;
2794
2795 function Comparator(comp, options) {
2796 if (!options || typeof options !== 'object') {
2797 options = {
2798 loose: !!options,
2799 includePrerelease: false
2800 };
2801 }
2802
2803 if (comp instanceof Comparator) {
2804 if (comp.loose === !!options.loose) {
2805 return comp;
2806 } else {
2807 comp = comp.value;
2808 }
2809 }
2810
2811 if (!(this instanceof Comparator)) {
2812 return new Comparator(comp,options);
2813 }
2814
2815 debug('comparator', comp, options);
2816 this.options = options;
2817 this.loose = !!options.loose;
2818 this.parse(comp);
2819
2820 if (this.semver === ANY) {
2821 this.value = '';
2822 } else {
2823 this.value = this.operator + this.semver.version;
2824 }
2825
2826 debug('comp', this);
2827 }
2828
2829 var ANY = {};
2830
2831 Comparator.prototype.parse = function(comp) {
2832 var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
2833 var m = comp.match(r);
2834
2835 if (!m) {
2836 throw new TypeError('Invalid comparator: ' + comp);
2837 }
2838
2839 this.operator = m[1] !== undefined ? m[1] : '';
2840
2841 if (this.operator === '=') {
2842 this.operator = '';
2843 }
2844 // if it literally is just '>' or '' then allow anything.
2845
2846 if (!m[2]) {
2847 this.semver = ANY;
2848 } else {
2849 this.semver = new SemVer(m[2],this.options.loose);
2850 }
2851 }
2852 ;
2853
2854 Comparator.prototype.toString = function() {
2855 return this.value;
2856 }
2857 ;
2858
2859 Comparator.prototype.test = function(version) {
2860 debug('Comparator.test', version, this.options.loose);
2861
2862 if (this.semver === ANY || version === ANY) {
2863 return true;
2864 }
2865
2866 if (typeof version === 'string') {
2867 try {
2868 version = new SemVer(version,this.options);
2869 } catch (er) {
2870 return false;
2871 }
2872 }
2873
2874 return cmp(version, this.operator, this.semver, this.options);
2875 }
2876 ;
2877
2878 Comparator.prototype.intersects = function(comp, options) {
2879 if (!(comp instanceof Comparator)) {
2880 throw new TypeError('a Comparator is required');
2881 }
2882
2883 if (!options || typeof options !== 'object') {
2884 options = {
2885 loose: !!options,
2886 includePrerelease: false
2887 };
2888 }
2889
2890 var rangeTmp;
2891
2892 if (this.operator === '') {
2893 if (this.value === '') {
2894 return true;
2895 }
2896
2897 rangeTmp = new Range(comp.value,options);
2898 return satisfies(this.value, rangeTmp, options);
2899 } else if (comp.operator === '') {
2900 if (comp.value === '') {
2901 return true;
2902 }
2903
2904 rangeTmp = new Range(this.value,options);
2905 return satisfies(comp.semver, rangeTmp, options);
2906 }
2907
2908 var sameDirectionIncreasing = (this.operator === '>=' || this.operator === '>') && (comp.operator === '>=' || comp.operator === '>');
2909 var sameDirectionDecreasing = (this.operator === '<=' || this.operator === '<') && (comp.operator === '<=' || comp.operator === '<');
2910 var sameSemVer = this.semver.version === comp.semver.version;
2911 var differentDirectionsInclusive = (this.operator === '>=' || this.operator === '<=') && (comp.operator === '>=' || comp.operator === '<=');
2912 var oppositeDirectionsLessThan = cmp(this.semver, '<', comp.semver, options) && (this.operator === '>=' || this.operator === '>') && (comp.operator === '<=' || comp.operator === '<');
2913 var oppositeDirectionsGreaterThan = cmp(this.semver, '>', comp.semver, options) && (this.operator === '<=' || this.operator === '<') && (comp.operator === '>=' || comp.operator === '>');
2914 return sameDirectionIncreasing || sameDirectionDecreasing || sameSemVer && differentDirectionsInclusive || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan;
2915 }
2916 ;
2917
2918 exports.Range = Range;
2919
2920 function Range(range, options) {
2921 if (!options || typeof options !== 'object') {
2922 options = {
2923 loose: !!options,
2924 includePrerelease: false
2925 };
2926 }
2927
2928 if (range instanceof Range) {
2929 if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
2930 return range;
2931 } else {
2932 return new Range(range.raw,options);
2933 }
2934 }
2935
2936 if (range instanceof Comparator) {
2937 return new Range(range.value,options);
2938 }
2939
2940 if (!(this instanceof Range)) {
2941 return new Range(range,options);
2942 }
2943
2944 this.options = options;
2945 this.loose = !!options.loose;
2946 this.includePrerelease = !!options.includePrerelease;
2947 // First, split based on boolean or ||
2948
2949 this.raw = range;
2950 this.set = range.split(/\s*\|\|\s*/).map(function(range) {
2951 return this.parseRange(range.trim());
2952 }, this).filter(function(c) {
2953 // throw out any that are not relevant for whatever reason
2954 return c.length;
2955 });
2956
2957 if (!this.set.length) {
2958 throw new TypeError('Invalid SemVer Range: ' + range);
2959 }
2960
2961 this.format();
2962 }
2963
2964 Range.prototype.format = function() {
2965 this.range = this.set.map(function(comps) {
2966 return comps.join(' ').trim();
2967 }).join('||').trim();
2968 return this.range;
2969 }
2970 ;
2971
2972 Range.prototype.toString = function() {
2973 return this.range;
2974 }
2975 ;
2976
2977 Range.prototype.parseRange = function(range) {
2978 var loose = this.options.loose;
2979 range = range.trim();
2980 // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
2981
2982 var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
2983 range = range.replace(hr, hyphenReplace);
2984 debug('hyphen replace', range);
2985 // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
2986
2987 range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
2988 debug('comparator trim', range, re[t.COMPARATORTRIM]);
2989 // `~ 1.2.3` => `~1.2.3`
2990
2991 range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
2992 // `^ 1.2.3` => `^1.2.3`
2993
2994 range = range.replace(re[t.CARETTRIM], caretTrimReplace);
2995 // normalize spaces
2996
2997 range = range.split(/\s+/).join(' ');
2998 // At this point, the range is completely trimmed and
2999 // ready to be split into comparators.
3000
3001 var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
3002 var set = range.split(' ').map(function(comp) {
3003 return parseComparator(comp, this.options);
3004 }, this).join(' ').split(/\s+/);
3005
3006 if (this.options.loose) {
3007 // in loose mode, throw out any that are not valid comparators
3008 set = set.filter(function(comp) {
3009 return !!comp.match(compRe);
3010 });
3011 }
3012
3013 set = set.map(function(comp) {
3014 return new Comparator(comp,this.options);
3015 }, this);
3016 return set;
3017 }
3018 ;
3019
3020 Range.prototype.intersects = function(range, options) {
3021 if (!(range instanceof Range)) {
3022 throw new TypeError('a Range is required');
3023 }
3024
3025 return this.set.some(function(thisComparators) {
3026 return isSatisfiable(thisComparators, options) && range.set.some(function(rangeComparators) {
3027 return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) {
3028 return rangeComparators.every(function(rangeComparator) {
3029 return thisComparator.intersects(rangeComparator, options);
3030 });
3031 });
3032 });
3033 });
3034 }
3035 ;
3036 // take a set of comparators and determine whether there
3037 // exists a version which can satisfy it
3038
3039 function isSatisfiable(comparators, options) {
3040 var result = true;
3041 var remainingComparators = comparators.slice();
3042 var testComparator = remainingComparators.pop();
3043
3044 while (result && remainingComparators.length) {
3045 result = remainingComparators.every(function(otherComparator) {
3046 return testComparator.intersects(otherComparator, options);
3047 });
3048 testComparator = remainingComparators.pop();
3049 }
3050
3051 return result;
3052 }
3053 // Mostly just for testing and legacy API reasons
3054
3055 exports.toComparators = toComparators;
3056
3057 function toComparators(range, options) {
3058 return new Range(range,options).set.map(function(comp) {
3059 return comp.map(function(c) {
3060 return c.value;
3061 }).join(' ').trim().split(' ');
3062 });
3063 }
3064 // comprised of xranges, tildes, stars, and gtlt's at this point.
3065 // already replaced the hyphen ranges
3066 // turn into a set of JUST comparators.
3067
3068 function parseComparator(comp, options) {
3069 debug('comp', comp, options);
3070 comp = replaceCarets(comp, options);
3071 debug('caret', comp);
3072 comp = replaceTildes(comp, options);
3073 debug('tildes', comp);
3074 comp = replaceXRanges(comp, options);
3075 debug('xrange', comp);
3076 comp = replaceStars(comp, options);
3077 debug('stars', comp);
3078 return comp;
3079 }
3080
3081 function isX(id) {
3082 return !id || id.toLowerCase() === 'x' || id === '*';
3083 }
3084 // ~, ~> --> * (any, kinda silly)
3085 // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
3086 // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
3087 // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
3088 // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
3089 // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
3090
3091 function replaceTildes(comp, options) {
3092 return comp.trim().split(/\s+/).map(function(comp) {
3093 return replaceTilde(comp, options);
3094 }).join(' ');
3095 }
3096
3097 function replaceTilde(comp, options) {
3098 var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
3099 return comp.replace(r, function(_, M, m, p, pr) {
3100 debug('tilde', comp, _, M, m, p, pr);
3101 var ret;
3102
3103 if (isX(M)) {
3104 ret = '';
3105 } else if (isX(m)) {
3106 ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0';
3107 } else if (isX(p)) {
3108 // ~1.2 == >=1.2.0 <1.3.0
3109 ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0';
3110 } else if (pr) {
3111 debug('replaceTilde pr', pr);
3112 ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + M + '.' + (+m + 1) + '.0';
3113 } else {
3114 // ~1.2.3 == >=1.2.3 <1.3.0
3115 ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + (+m + 1) + '.0';
3116 }
3117
3118 debug('tilde return', ret);
3119 return ret;
3120 });
3121 }
3122 // ^ --> * (any, kinda silly)
3123 // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
3124 // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
3125 // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
3126 // ^1.2.3 --> >=1.2.3 <2.0.0
3127 // ^1.2.0 --> >=1.2.0 <2.0.0
3128
3129 function replaceCarets(comp, options) {
3130 return comp.trim().split(/\s+/).map(function(comp) {
3131 return replaceCaret(comp, options);
3132 }).join(' ');
3133 }
3134
3135 function replaceCaret(comp, options) {
3136 debug('caret', comp, options);
3137 var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
3138 return comp.replace(r, function(_, M, m, p, pr) {
3139 debug('caret', comp, _, M, m, p, pr);
3140 var ret;
3141
3142 if (isX(M)) {
3143 ret = '';
3144 } else if (isX(m)) {
3145 ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0';
3146 } else if (isX(p)) {
3147 if (M === '0') {
3148 ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0';
3149 } else {
3150 ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0';
3151 }
3152 } else if (pr) {
3153 debug('replaceCaret pr', pr);
3154
3155 if (M === '0') {
3156 if (m === '0') {
3157 ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + M + '.' + m + '.' + (+p + 1);
3158 } else {
3159 ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + M + '.' + (+m + 1) + '.0';
3160 }
3161 } else {
3162 ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + (+M + 1) + '.0.0';
3163 }
3164 } else {
3165 debug('no pr');
3166
3167 if (M === '0') {
3168 if (m === '0') {
3169 ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + m + '.' + (+p + 1);
3170 } else {
3171 ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + (+m + 1) + '.0';
3172 }
3173 } else {
3174 ret = '>=' + M + '.' + m + '.' + p + ' <' + (+M + 1) + '.0.0';
3175 }
3176 }
3177
3178 debug('caret return', ret);
3179 return ret;
3180 });
3181 }
3182
3183 function replaceXRanges(comp, options) {
3184 debug('replaceXRanges', comp, options);
3185 return comp.split(/\s+/).map(function(comp) {
3186 return replaceXRange(comp, options);
3187 }).join(' ');
3188 }
3189
3190 function replaceXRange(comp, options) {
3191 comp = comp.trim();
3192 var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
3193 return comp.replace(r, function(ret, gtlt, M, m, p, pr) {
3194 debug('xRange', comp, ret, gtlt, M, m, p, pr);
3195 var xM = isX(M);
3196 var xm = xM || isX(m);
3197 var xp = xm || isX(p);
3198 var anyX = xp;
3199
3200 if (gtlt === '=' && anyX) {
3201 gtlt = '';
3202 }
3203 // if we're including prereleases in the match, then we need
3204 // to fix this to -0, the lowest possible prerelease value
3205
3206 pr = options.includePrerelease ? '-0' : '';
3207
3208 if (xM) {
3209 if (gtlt === '>' || gtlt === '<') {
3210 // nothing is allowed
3211 ret = '<0.0.0-0';
3212 } else {
3213 // nothing is forbidden
3214 ret = '*';
3215 }
3216 } else if (gtlt && anyX) {
3217 // we know patch is an x, because we have any x at all.
3218 // replace X with 0
3219 if (xm) {
3220 m = 0;
3221 }
3222
3223 p = 0;
3224
3225 if (gtlt === '>') {
3226 // >1 => >=2.0.0
3227 // >1.2 => >=1.3.0
3228 // >1.2.3 => >= 1.2.4
3229 gtlt = '>=';
3230
3231 if (xm) {
3232 M = +M + 1;
3233 m = 0;
3234 p = 0;
3235 } else {
3236 m = +m + 1;
3237 p = 0;
3238 }
3239 } else if (gtlt === '<=') {
3240 // <=0.7.x is actually <0.8.0, since any 0.7.x should
3241 // pass. Similarly, <=7.x is actually <8.0.0, etc.
3242 gtlt = '<';
3243
3244 if (xm) {
3245 M = +M + 1;
3246 } else {
3247 m = +m + 1;
3248 }
3249 }
3250
3251 ret = gtlt + M + '.' + m + '.' + p + pr;
3252 } else if (xm) {
3253 ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr;
3254 } else if (xp) {
3255 ret = '>=' + M + '.' + m + '.0' + pr + ' <' + M + '.' + (+m + 1) + '.0' + pr;
3256 }
3257
3258 debug('xRange return', ret);
3259 return ret;
3260 });
3261 }
3262 // Because * is AND-ed with everything else in the comparator,
3263 // and '' means "any version", just remove the *s entirely.
3264
3265 function replaceStars(comp, options) {
3266 debug('replaceStars', comp, options);
3267 // Looseness is ignored here. star is always as loose as it gets!
3268
3269 return comp.trim().replace(re[t.STAR], '');
3270 }
3271 // This function is passed to string.replace(re[t.HYPHENRANGE])
3272 // M, m, patch, prerelease, build
3273 // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
3274 // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
3275 // 1.2 - 3.4 => >=1.2.0 <3.5.0
3276
3277 function hyphenReplace($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) {
3278 if (isX(fM)) {
3279 from = '';
3280 } else if (isX(fm)) {
3281 from = '>=' + fM + '.0.0';
3282 } else if (isX(fp)) {
3283 from = '>=' + fM + '.' + fm + '.0';
3284 } else {
3285 from = '>=' + from;
3286 }
3287
3288 if (isX(tM)) {
3289 to = '';
3290 } else if (isX(tm)) {
3291 to = '<' + (+tM + 1) + '.0.0';
3292 } else if (isX(tp)) {
3293 to = '<' + tM + '.' + (+tm + 1) + '.0';
3294 } else if (tpr) {
3295 to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr;
3296 } else {
3297 to = '<=' + to;
3298 }
3299
3300 return (from + ' ' + to).trim();
3301 }
3302 // if ANY of the sets match ALL of its comparators, then pass
3303
3304 Range.prototype.test = function(version) {
3305 if (!version) {
3306 return false;
3307 }
3308
3309 if (typeof version === 'string') {
3310 try {
3311 version = new SemVer(version,this.options);
3312 } catch (er) {
3313 return false;
3314 }
3315 }
3316
3317 for (var i = 0; i < this.set.length; i++) {
3318 if (testSet(this.set[i], version, this.options)) {
3319 return true;
3320 }
3321 }
3322
3323 return false;
3324 }
3325 ;
3326
3327 function testSet(set, version, options) {
3328 for (var i = 0; i < set.length; i++) {
3329 if (!set[i].test(version)) {
3330 return false;
3331 }
3332 }
3333
3334 if (version.prerelease.length && !options.includePrerelease) {
3335 // Find the set of versions that are allowed to have prereleases
3336 // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
3337 // That should allow `1.2.3-pr.2` to pass.
3338 // However, `1.2.4-alpha.notready` should NOT be allowed,
3339 // even though it's within the range set by the comparators.
3340 for (i = 0; i < set.length; i++) {
3341 debug(set[i].semver);
3342
3343 if (set[i].semver === ANY) {
3344 continue;
3345 }
3346
3347 if (set[i].semver.prerelease.length > 0) {
3348 var allowed = set[i].semver;
3349
3350 if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
3351 return true;
3352 }
3353 }
3354 }
3355 // Version has a -pre, but it's not one of the ones we like.
3356
3357 return false;
3358 }
3359
3360 return true;
3361 }
3362
3363 exports.satisfies = satisfies;
3364
3365 function satisfies(version, range, options) {
3366 try {
3367 range = new Range(range,options);
3368 } catch (er) {
3369 return false;
3370 }
3371
3372 return range.test(version);
3373 }
3374
3375 exports.maxSatisfying = maxSatisfying;
3376
3377 function maxSatisfying(versions, range, options) {
3378 var max = null;
3379 var maxSV = null;
3380
3381 try {
3382 var rangeObj = new Range(range,options);
3383 } catch (er) {
3384 return null;
3385 }
3386
3387 versions.forEach(function(v) {
3388 if (rangeObj.test(v)) {
3389 // satisfies(v, range, options)
3390 if (!max || maxSV.compare(v) === -1) {
3391 // compare(max, v, true)
3392 max = v;
3393 maxSV = new SemVer(max,options);
3394 }
3395 }
3396 });
3397 return max;
3398 }
3399
3400 exports.minSatisfying = minSatisfying;
3401
3402 function minSatisfying(versions, range, options) {
3403 var min = null;
3404 var minSV = null;
3405
3406 try {
3407 var rangeObj = new Range(range,options);
3408 } catch (er) {
3409 return null;
3410 }
3411
3412 versions.forEach(function(v) {
3413 if (rangeObj.test(v)) {
3414 // satisfies(v, range, options)
3415 if (!min || minSV.compare(v) === 1) {
3416 // compare(min, v, true)
3417 min = v;
3418 minSV = new SemVer(min,options);
3419 }
3420 }
3421 });
3422 return min;
3423 }
3424
3425 exports.minVersion = minVersion;
3426
3427 function minVersion(range, loose) {
3428 range = new Range(range,loose);
3429 var minver = new SemVer('0.0.0');
3430
3431 if (range.test(minver)) {
3432 return minver;
3433 }
3434
3435 minver = new SemVer('0.0.0-0');
3436
3437 if (range.test(minver)) {
3438 return minver;
3439 }
3440
3441 minver = null;
3442
3443 for (var i = 0; i < range.set.length; ++i) {
3444 var comparators = range.set[i];
3445 comparators.forEach(function(comparator) {
3446 // Clone to avoid manipulating the comparator's semver object.
3447 var compver = new SemVer(comparator.semver.version);
3448
3449 switch (comparator.operator) {
3450 case '>':
3451 if (compver.prerelease.length === 0) {
3452 compver.patch++;
3453 } else {
3454 compver.prerelease.push(0);
3455 }
3456
3457 compver.raw = compver.format();
3458
3459 /* fallthrough */
3460
3461 case '':
3462 case '>=':
3463 if (!minver || gt(minver, compver)) {
3464 minver = compver;
3465 }
3466
3467 break;
3468
3469 case '<':
3470 case '<=':
3471 /* Ignore maximum versions */
3472 break;
3473
3474 /* istanbul ignore next */
3475
3476 default:
3477 throw new Error('Unexpected operation: ' + comparator.operator);
3478 }
3479 });
3480 }
3481
3482 if (minver && range.test(minver)) {
3483 return minver;
3484 }
3485
3486 return null;
3487 }
3488
3489 exports.validRange = validRange;
3490
3491 function validRange(range, options) {
3492 try {
3493 // Return '*' instead of '' so that truthiness works.
3494 // This will throw if it's invalid anyway
3495 return new Range(range,options).range || '*';
3496 } catch (er) {
3497 return null;
3498 }
3499 }
3500 // Determine if version is less than all the versions possible in the range
3501
3502 exports.ltr = ltr;
3503
3504 function ltr(version, range, options) {
3505 return outside(version, range, '<', options);
3506 }
3507 // Determine if version is greater than all the versions possible in the range.
3508
3509 exports.gtr = gtr;
3510
3511 function gtr(version, range, options) {
3512 return outside(version, range, '>', options);
3513 }
3514
3515 exports.outside = outside;
3516
3517 function outside(version, range, hilo, options) {
3518 version = new SemVer(version,options);
3519 range = new Range(range,options);
3520 var gtfn, ltefn, ltfn, comp, ecomp;
3521
3522 switch (hilo) {
3523 case '>':
3524 gtfn = gt;
3525 ltefn = lte;
3526 ltfn = lt;
3527 comp = '>';
3528 ecomp = '>=';
3529 break;
3530
3531 case '<':
3532 gtfn = lt;
3533 ltefn = gte;
3534 ltfn = gt;
3535 comp = '<';
3536 ecomp = '<=';
3537 break;
3538
3539 default:
3540 throw new TypeError('Must provide a hilo val of "<" or ">"');
3541 }
3542 // If it satisifes the range it is not outside
3543
3544 if (satisfies(version, range, options)) {
3545 return false;
3546 }
3547 // From now on, variable terms are as if we're in "gtr" mode.
3548 // but note that everything is flipped for the "ltr" function.
3549
3550 for (var i = 0; i < range.set.length; ++i) {
3551 var comparators = range.set[i];
3552 var high = null;
3553 var low = null;
3554 comparators.forEach(function(comparator) {
3555 if (comparator.semver === ANY) {
3556 comparator = new Comparator('>=0.0.0');
3557 }
3558
3559 high = high || comparator;
3560 low = low || comparator;
3561
3562 if (gtfn(comparator.semver, high.semver, options)) {
3563 high = comparator;
3564 } else if (ltfn(comparator.semver, low.semver, options)) {
3565 low = comparator;
3566 }
3567 });
3568 // If the edge version comparator has a operator then our version
3569 // isn't outside it
3570
3571 if (high.operator === comp || high.operator === ecomp) {
3572 return false;
3573 }
3574 // If the lowest version comparator has an operator and our version
3575 // is less than it then it isn't higher than the range
3576
3577 if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
3578 return false;
3579 } else if (low.operator === ecomp && ltfn(version, low.semver)) {
3580 return false;
3581 }
3582 }
3583
3584 return true;
3585 }
3586
3587 exports.prerelease = prerelease;
3588
3589 function prerelease(version, options) {
3590 var parsed = parse(version, options);
3591 return parsed && parsed.prerelease.length ? parsed.prerelease : null;
3592 }
3593
3594 exports.intersects = intersects;
3595
3596 function intersects(r1, r2, options) {
3597 r1 = new Range(r1,options);
3598 r2 = new Range(r2,options);
3599 return r1.intersects(r2);
3600 }
3601
3602 exports.coerce = coerce;
3603
3604 function coerce(version, options) {
3605 if (version instanceof SemVer) {
3606 return version;
3607 }
3608
3609 if (typeof version === 'number') {
3610 version = String(version);
3611 }
3612
3613 if (typeof version !== 'string') {
3614 return null;
3615 }
3616
3617 options = options || {};
3618 var match = null;
3619
3620 if (!options.rtl) {
3621 match = version.match(re[t.COERCE]);
3622 } else {
3623 // Find the right-most coercible string that does not share
3624 // a terminus with a more left-ward coercible string.
3625 // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
3626 //
3627 // Walk through the string checking with a /g regexp
3628 // Manually set the index so as to pick up overlapping matches.
3629 // Stop when we get a match that ends at the string end, since no
3630 // coercible string can be more right-ward without the same terminus.
3631 var next;
3632
3633 while ((next = re[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) {
3634 if (!match || next.index + next[0].length !== match.index + match[0].length) {
3635 match = next;
3636 }
3637
3638 re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length;
3639 }
3640 // leave it in a clean state
3641
3642 re[t.COERCERTL].lastIndex = -1;
3643 }
3644
3645 if (match === null) {
3646 return null;
3647 }
3648
3649 return parse(match[2] + '.' + (match[3] || '0') + '.' + (match[4] || '0'), options);
3650 }
3651 /* WEBPACK VAR INJECTION */
3652 }
3653 .call(this, __webpack_require__(45)))
3654
3655 /***/
3656 }
3657 ),
3658
3659 /***/
3660 3: /***/
3661 (function(module, __webpack_exports__, __webpack_require__) {
3662
3663 "use strict";
3664 /* harmony export (binding) */
3665 __webpack_require__.d(__webpack_exports__, "p", function() {
3666 return __DEBUG__;
3667 });
3668 /* harmony export (binding) */
3669 __webpack_require__.d(__webpack_exports__, "k", function() {
3670 return TREE_OPERATION_ADD;
3671 });
3672 /* harmony export (binding) */
3673 __webpack_require__.d(__webpack_exports__, "l", function() {
3674 return TREE_OPERATION_REMOVE;
3675 });
3676 /* harmony export (binding) */
3677 __webpack_require__.d(__webpack_exports__, "m", function() {
3678 return TREE_OPERATION_REORDER_CHILDREN;
3679 });
3680 /* harmony export (binding) */
3681 __webpack_require__.d(__webpack_exports__, "n", function() {
3682 return TREE_OPERATION_UPDATE_TREE_BASE_DURATION;
3683 });
3684 /* harmony export (binding) */
3685 __webpack_require__.d(__webpack_exports__, "d", function() {
3686 return LOCAL_STORAGE_FILTER_PREFERENCES_KEY;
3687 });
3688 /* unused harmony export SESSION_STORAGE_LAST_SELECTION_KEY */
3689 /* harmony export (binding) */
3690 __webpack_require__.d(__webpack_exports__, "i", function() {
3691 return SESSION_STORAGE_RECORD_CHANGE_DESCRIPTIONS_KEY;
3692 });
3693 /* harmony export (binding) */
3694 __webpack_require__.d(__webpack_exports__, "j", function() {
3695 return SESSION_STORAGE_RELOAD_AND_PROFILE_KEY;
3696 });
3697 /* harmony export (binding) */
3698 __webpack_require__.d(__webpack_exports__, "e", function() {
3699 return LOCAL_STORAGE_SHOULD_BREAK_ON_CONSOLE_ERRORS;
3700 });
3701 /* harmony export (binding) */
3702 __webpack_require__.d(__webpack_exports__, "f", function() {
3703 return LOCAL_STORAGE_SHOULD_PATCH_CONSOLE_KEY;
3704 });
3705 /* harmony export (binding) */
3706 __webpack_require__.d(__webpack_exports__, "g", function() {
3707 return LOCAL_STORAGE_TRACE_UPDATES_ENABLED_KEY;
3708 });
3709 /* harmony export (binding) */
3710 __webpack_require__.d(__webpack_exports__, "h", function() {
3711 return PROFILER_EXPORT_VERSION;
3712 });
3713 /* harmony export (binding) */
3714 __webpack_require__.d(__webpack_exports__, "a", function() {
3715 return CHANGE_LOG_URL;
3716 });
3717 /* harmony export (binding) */
3718 __webpack_require__.d(__webpack_exports__, "o", function() {
3719 return UNSUPPORTED_VERSION_URL;
3720 });
3721 /* harmony export (binding) */
3722 __webpack_require__.d(__webpack_exports__, "b", function() {
3723 return COMFORTABLE_LINE_HEIGHT;
3724 });
3725 /* harmony export (binding) */
3726 __webpack_require__.d(__webpack_exports__, "c", function() {
3727 return COMPACT_LINE_HEIGHT;
3728 });
3729 /**
3730 * Copyright (c) Facebook, Inc. and its affiliates.
3731 *
3732 * This source code is licensed under the MIT license found in the
3733 * LICENSE file in the root directory of this source tree.
3734 *
3735 *
3736 */
3737 // Flip this flag to true to enable verbose console debug logging.
3738 const __DEBUG__ = false;
3739 const TREE_OPERATION_ADD = 1;
3740 const TREE_OPERATION_REMOVE = 2;
3741 const TREE_OPERATION_REORDER_CHILDREN = 3;
3742 const TREE_OPERATION_UPDATE_TREE_BASE_DURATION = 4;
3743 const LOCAL_STORAGE_FILTER_PREFERENCES_KEY = 'React::DevTools::componentFilters';
3744 const SESSION_STORAGE_LAST_SELECTION_KEY = 'React::DevTools::lastSelection';
3745 const SESSION_STORAGE_RECORD_CHANGE_DESCRIPTIONS_KEY = 'React::DevTools::recordChangeDescriptions';
3746 const SESSION_STORAGE_RELOAD_AND_PROFILE_KEY = 'React::DevTools::reloadAndProfile';
3747 const LOCAL_STORAGE_SHOULD_BREAK_ON_CONSOLE_ERRORS = 'React::DevTools::breakOnConsoleErrors';
3748 const LOCAL_STORAGE_SHOULD_PATCH_CONSOLE_KEY = 'React::DevTools::appendComponentStack';
3749 const LOCAL_STORAGE_TRACE_UPDATES_ENABLED_KEY = 'React::DevTools::traceUpdatesEnabled';
3750 const PROFILER_EXPORT_VERSION = 4;
3751 const CHANGE_LOG_URL = 'https://github.com/facebook/react/blob/master/packages/react-devtools/CHANGELOG.md';
3752 const UNSUPPORTED_VERSION_URL = 'https://reactjs.org/blog/2019/08/15/new-react-devtools.html#how-do-i-get-the-old-version-back';
3753 // HACK
3754 //
3755 // Extracting during build time avoids a temporarily invalid state for the inline target.
3756 // Sometimes the inline target is rendered before root styles are applied,
3757 // which would result in e.g. NaN itemSize being passed to react-window list.
3758 //
3759
3760 let COMFORTABLE_LINE_HEIGHT;
3761 let COMPACT_LINE_HEIGHT;
3762
3763 try {
3764 // $FlowFixMe
3765 const rawStyleString = __webpack_require__(49).default;
3766
3767 const extractVar = varName=>{
3768 const regExp = new RegExp(`${varName}: ([0-9]+)`);
3769 const match = rawStyleString.match(regExp);
3770 return parseInt(match[1], 10);
3771 }
3772 ;
3773
3774 COMFORTABLE_LINE_HEIGHT = extractVar('comfortable-line-height-data');
3775 COMPACT_LINE_HEIGHT = extractVar('compact-line-height-data');
3776 } catch (error) {
3777 // We can't use the Webpack loader syntax in the context of Jest,
3778 // so tests need some reasonably meaningful fallback value.
3779 COMFORTABLE_LINE_HEIGHT = 15;
3780 COMPACT_LINE_HEIGHT = 10;
3781 }
3782
3783 /***/
3784 }
3785 ),
3786
3787 /***/
3788 33: /***/
3789 (function(module, exports, __webpack_require__) {
3790
3791 "use strict";
3792 /*
3793object-assign
3794(c) Sindre Sorhus
3795@license MIT
3796*/
3797
3798 /* eslint-disable no-unused-vars */
3799
3800 var getOwnPropertySymbols = Object.getOwnPropertySymbols;
3801 var hasOwnProperty = Object.prototype.hasOwnProperty;
3802 var propIsEnumerable = Object.prototype.propertyIsEnumerable;
3803
3804 function toObject(val) {
3805 if (val === null || val === undefined) {
3806 throw new TypeError('Object.assign cannot be called with null or undefined');
3807 }
3808
3809 return Object(val);
3810 }
3811
3812 function shouldUseNative() {
3813 try {
3814 if (!Object.assign) {
3815 return false;
3816 }
3817 // Detect buggy property enumeration order in older V8 versions.
3818 // https://bugs.chromium.org/p/v8/issues/detail?id=4118
3819
3820 var test1 = new String('abc');
3821 // eslint-disable-line no-new-wrappers
3822
3823 test1[5] = 'de';
3824
3825 if (Object.getOwnPropertyNames(test1)[0] === '5') {
3826 return false;
3827 }
3828 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
3829
3830 var test2 = {};
3831
3832 for (var i = 0; i < 10; i++) {
3833 test2['_' + String.fromCharCode(i)] = i;
3834 }
3835
3836 var order2 = Object.getOwnPropertyNames(test2).map(function(n) {
3837 return test2[n];
3838 });
3839
3840 if (order2.join('') !== '0123456789') {
3841 return false;
3842 }
3843 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
3844
3845 var test3 = {};
3846 'abcdefghijklmnopqrst'.split('').forEach(function(letter) {
3847 test3[letter] = letter;
3848 });
3849
3850 if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') {
3851 return false;
3852 }
3853
3854 return true;
3855 } catch (err) {
3856 // We don't expect any of the above to throw, but better to be safe.
3857 return false;
3858 }
3859 }
3860
3861 module.exports = shouldUseNative() ? Object.assign : function(target, source) {
3862 var from;
3863 var to = toObject(target);
3864 var symbols;
3865
3866 for (var s = 1; s < arguments.length; s++) {
3867 from = Object(arguments[s]);
3868
3869 for (var key in from) {
3870 if (hasOwnProperty.call(from, key)) {
3871 to[key] = from[key];
3872 }
3873 }
3874
3875 if (getOwnPropertySymbols) {
3876 symbols = getOwnPropertySymbols(from);
3877
3878 for (var i = 0; i < symbols.length; i++) {
3879 if (propIsEnumerable.call(from, symbols[i])) {
3880 to[symbols[i]] = from[symbols[i]];
3881 }
3882 }
3883 }
3884 }
3885
3886 return to;
3887 }
3888 ;
3889
3890 /***/
3891 }
3892 ),
3893
3894 /***/
3895 34: /***/
3896 (function(module, exports, __webpack_require__) {
3897
3898 "use strict";
3899 // A linked list to keep track of recently-used-ness
3900
3901 const Yallist = __webpack_require__(46);
3902
3903 const MAX = Symbol('max');
3904 const LENGTH = Symbol('length');
3905 const LENGTH_CALCULATOR = Symbol('lengthCalculator');
3906 const ALLOW_STALE = Symbol('allowStale');
3907 const MAX_AGE = Symbol('maxAge');
3908 const DISPOSE = Symbol('dispose');
3909 const NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet');
3910 const LRU_LIST = Symbol('lruList');
3911 const CACHE = Symbol('cache');
3912 const UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet');
3913
3914 const naiveLength = ()=>1;
3915 // lruList is a yallist where the head is the youngest
3916 // item, and the tail is the oldest. the list contains the Hit
3917 // objects as the entries.
3918 // Each Hit object has a reference to its Yallist.Node. This
3919 // never changes.
3920 //
3921 // cache is a Map (or PseudoMap) that matches the keys to
3922 // the Yallist.Node object.
3923
3924 class LRUCache {
3925 constructor(options) {
3926 if (typeof options === 'number')
3927 options = {
3928 max: options
3929 };
3930 if (!options)
3931 options = {};
3932 if (options.max && (typeof options.max !== 'number' || options.max < 0))
3933 throw new TypeError('max must be a non-negative number');
3934 // Kind of weird to have a default max of Infinity, but oh well.
3935
3936 const max = this[MAX] = options.max || Infinity;
3937 const lc = options.length || naiveLength;
3938 this[LENGTH_CALCULATOR] = typeof lc !== 'function' ? naiveLength : lc;
3939 this[ALLOW_STALE] = options.stale || false;
3940 if (options.maxAge && typeof options.maxAge !== 'number')
3941 throw new TypeError('maxAge must be a number');
3942 this[MAX_AGE] = options.maxAge || 0;
3943 this[DISPOSE] = options.dispose;
3944 this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;
3945 this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false;
3946 this.reset();
3947 }
3948 // resize the cache when the max changes.
3949
3950 set max(mL) {
3951 if (typeof mL !== 'number' || mL < 0)
3952 throw new TypeError('max must be a non-negative number');
3953 this[MAX] = mL || Infinity;
3954 trim(this);
3955 }
3956
3957 get max() {
3958 return this[MAX];
3959 }
3960
3961 set allowStale(allowStale) {
3962 this[ALLOW_STALE] = !!allowStale;
3963 }
3964
3965 get allowStale() {
3966 return this[ALLOW_STALE];
3967 }
3968
3969 set maxAge(mA) {
3970 if (typeof mA !== 'number')
3971 throw new TypeError('maxAge must be a non-negative number');
3972 this[MAX_AGE] = mA;
3973 trim(this);
3974 }
3975
3976 get maxAge() {
3977 return this[MAX_AGE];
3978 }
3979 // resize the cache when the lengthCalculator changes.
3980
3981 set lengthCalculator(lC) {
3982 if (typeof lC !== 'function')
3983 lC = naiveLength;
3984
3985 if (lC !== this[LENGTH_CALCULATOR]) {
3986 this[LENGTH_CALCULATOR] = lC;
3987 this[LENGTH] = 0;
3988 this[LRU_LIST].forEach(hit=>{
3989 hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
3990 this[LENGTH] += hit.length;
3991 }
3992 );
3993 }
3994
3995 trim(this);
3996 }
3997
3998 get lengthCalculator() {
3999 return this[LENGTH_CALCULATOR];
4000 }
4001
4002 get length() {
4003 return this[LENGTH];
4004 }
4005
4006 get itemCount() {
4007 return this[LRU_LIST].length;
4008 }
4009
4010 rforEach(fn, thisp) {
4011 thisp = thisp || this;
4012
4013 for (let walker = this[LRU_LIST].tail; walker !== null; ) {
4014 const prev = walker.prev;
4015 forEachStep(this, fn, walker, thisp);
4016 walker = prev;
4017 }
4018 }
4019
4020 forEach(fn, thisp) {
4021 thisp = thisp || this;
4022
4023 for (let walker = this[LRU_LIST].head; walker !== null; ) {
4024 const next = walker.next;
4025 forEachStep(this, fn, walker, thisp);
4026 walker = next;
4027 }
4028 }
4029
4030 keys() {
4031 return this[LRU_LIST].toArray().map(k=>k.key);
4032 }
4033
4034 values() {
4035 return this[LRU_LIST].toArray().map(k=>k.value);
4036 }
4037
4038 reset() {
4039 if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) {
4040 this[LRU_LIST].forEach(hit=>this[DISPOSE](hit.key, hit.value));
4041 }
4042
4043 this[CACHE] = new Map();
4044 // hash of items by key
4045
4046 this[LRU_LIST] = new Yallist();
4047 // list of items in order of use recency
4048
4049 this[LENGTH] = 0;
4050 // length of items in the list
4051 }
4052
4053 dump() {
4054 return this[LRU_LIST].map(hit=>isStale(this, hit) ? false : {
4055 k: hit.key,
4056 v: hit.value,
4057 e: hit.now + (hit.maxAge || 0)
4058 }).toArray().filter(h=>h);
4059 }
4060
4061 dumpLru() {
4062 return this[LRU_LIST];
4063 }
4064
4065 set(key, value, maxAge) {
4066 maxAge = maxAge || this[MAX_AGE];
4067 if (maxAge && typeof maxAge !== 'number')
4068 throw new TypeError('maxAge must be a number');
4069 const now = maxAge ? Date.now() : 0;
4070 const len = this[LENGTH_CALCULATOR](value, key);
4071
4072 if (this[CACHE].has(key)) {
4073 if (len > this[MAX]) {
4074 del(this, this[CACHE].get(key));
4075 return false;
4076 }
4077
4078 const node = this[CACHE].get(key);
4079 const item = node.value;
4080 // dispose of the old one before overwriting
4081 // split out into 2 ifs for better coverage tracking
4082
4083 if (this[DISPOSE]) {
4084 if (!this[NO_DISPOSE_ON_SET])
4085 this[DISPOSE](key, item.value);
4086 }
4087
4088 item.now = now;
4089 item.maxAge = maxAge;
4090 item.value = value;
4091 this[LENGTH] += len - item.length;
4092 item.length = len;
4093 this.get(key);
4094 trim(this);
4095 return true;
4096 }
4097
4098 const hit = new Entry(key,value,len,now,maxAge);
4099 // oversized objects fall out of cache automatically.
4100
4101 if (hit.length > this[MAX]) {
4102 if (this[DISPOSE])
4103 this[DISPOSE](key, value);
4104 return false;
4105 }
4106
4107 this[LENGTH] += hit.length;
4108 this[LRU_LIST].unshift(hit);
4109 this[CACHE].set(key, this[LRU_LIST].head);
4110 trim(this);
4111 return true;
4112 }
4113
4114 has(key) {
4115 if (!this[CACHE].has(key))
4116 return false;
4117 const hit = this[CACHE].get(key).value;
4118 return !isStale(this, hit);
4119 }
4120
4121 get(key) {
4122 return get(this, key, true);
4123 }
4124
4125 peek(key) {
4126 return get(this, key, false);
4127 }
4128
4129 pop() {
4130 const node = this[LRU_LIST].tail;
4131 if (!node)
4132 return null;
4133 del(this, node);
4134 return node.value;
4135 }
4136
4137 del(key) {
4138 del(this, this[CACHE].get(key));
4139 }
4140
4141 load(arr) {
4142 // reset the cache
4143 this.reset();
4144 const now = Date.now();
4145 // A previous serialized cache has the most recent items first
4146
4147 for (let l = arr.length - 1; l >= 0; l--) {
4148 const hit = arr[l];
4149 const expiresAt = hit.e || 0;
4150 if (expiresAt === 0)
4151 // the item was created without expiration in a non aged cache
4152 this.set(hit.k, hit.v);
4153 else {
4154 const maxAge = expiresAt - now;
4155 // dont add already expired items
4156
4157 if (maxAge > 0) {
4158 this.set(hit.k, hit.v, maxAge);
4159 }
4160 }
4161 }
4162 }
4163
4164 prune() {
4165 this[CACHE].forEach((value,key)=>get(this, key, false));
4166 }
4167
4168 }
4169
4170 const get = (self,key,doUse)=>{
4171 const node = self[CACHE].get(key);
4172
4173 if (node) {
4174 const hit = node.value;
4175
4176 if (isStale(self, hit)) {
4177 del(self, node);
4178 if (!self[ALLOW_STALE])
4179 return undefined;
4180 } else {
4181 if (doUse) {
4182 if (self[UPDATE_AGE_ON_GET])
4183 node.value.now = Date.now();
4184 self[LRU_LIST].unshiftNode(node);
4185 }
4186 }
4187
4188 return hit.value;
4189 }
4190 }
4191 ;
4192
4193 const isStale = (self,hit)=>{
4194 if (!hit || !hit.maxAge && !self[MAX_AGE])
4195 return false;
4196 const diff = Date.now() - hit.now;
4197 return hit.maxAge ? diff > hit.maxAge : self[MAX_AGE] && diff > self[MAX_AGE];
4198 }
4199 ;
4200
4201 const trim = self=>{
4202 if (self[LENGTH] > self[MAX]) {
4203 for (let walker = self[LRU_LIST].tail; self[LENGTH] > self[MAX] && walker !== null; ) {
4204 // We know that we're about to delete this one, and also
4205 // what the next least recently used key will be, so just
4206 // go ahead and set it now.
4207 const prev = walker.prev;
4208 del(self, walker);
4209 walker = prev;
4210 }
4211 }
4212 }
4213 ;
4214
4215 const del = (self,node)=>{
4216 if (node) {
4217 const hit = node.value;
4218 if (self[DISPOSE])
4219 self[DISPOSE](hit.key, hit.value);
4220 self[LENGTH] -= hit.length;
4221 self[CACHE].delete(hit.key);
4222 self[LRU_LIST].removeNode(node);
4223 }
4224 }
4225 ;
4226
4227 class Entry {
4228 constructor(key, value, length, now, maxAge) {
4229 this.key = key;
4230 this.value = value;
4231 this.length = length;
4232 this.now = now;
4233 this.maxAge = maxAge || 0;
4234 }
4235
4236 }
4237
4238 const forEachStep = (self,fn,node,thisp)=>{
4239 let hit = node.value;
4240
4241 if (isStale(self, hit)) {
4242 del(self, node);
4243 if (!self[ALLOW_STALE])
4244 hit = undefined;
4245 }
4246
4247 if (hit)
4248 fn.call(thisp, hit.value, hit.key, self);
4249 }
4250 ;
4251
4252 module.exports = LRUCache;
4253
4254 /***/
4255 }
4256 ),
4257
4258 /***/
4259 35: /***/
4260 (function(module, __webpack_exports__, __webpack_require__) {
4261
4262 "use strict";
4263
4264 // EXPORTS
4265 __webpack_require__.d(__webpack_exports__, "b", function() {
4266 return /* binding */
4267 registerRenderer;
4268 });
4269 __webpack_require__.d(__webpack_exports__, "a", function() {
4270 return /* binding */
4271 patch;
4272 });
4273
4274 // UNUSED EXPORTS: dangerous_setTargetConsoleForTesting, unpatch
4275
4276 // EXTERNAL MODULE: ../react-devtools-shared/src/backend/renderer.js + 1 modules
4277 var backend_renderer = __webpack_require__(37);
4278
4279 // EXTERNAL MODULE: ../react-devtools-shared/src/backend/ReactSymbols.js
4280 var ReactSymbols = __webpack_require__(4);
4281
4282 // CONCATENATED MODULE: ../shared/ConsolePatchingDev.js
4283 function ownKeys(object, enumerableOnly) {
4284 var keys = Object.keys(object);
4285 if (Object.getOwnPropertySymbols) {
4286 var symbols = Object.getOwnPropertySymbols(object);
4287 if (enumerableOnly)
4288 symbols = symbols.filter(function(sym) {
4289 return Object.getOwnPropertyDescriptor(object, sym).enumerable;
4290 });
4291 keys.push.apply(keys, symbols);
4292 }
4293 return keys;
4294 }
4295
4296 function _objectSpread(target) {
4297 for (var i = 1; i < arguments.length; i++) {
4298 var source = arguments[i] != null ? arguments[i] : {};
4299 if (i % 2) {
4300 ownKeys(Object(source), true).forEach(function(key) {
4301 _defineProperty(target, key, source[key]);
4302 });
4303 } else if (Object.getOwnPropertyDescriptors) {
4304 Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
4305 } else {
4306 ownKeys(Object(source)).forEach(function(key) {
4307 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
4308 });
4309 }
4310 }
4311 return target;
4312 }
4313
4314 function _defineProperty(obj, key, value) {
4315 if (key in obj) {
4316 Object.defineProperty(obj, key, {
4317 value: value,
4318 enumerable: true,
4319 configurable: true,
4320 writable: true
4321 });
4322 } else {
4323 obj[key] = value;
4324 }
4325 return obj;
4326 }
4327
4328 /**
4329 * Copyright (c) Facebook, Inc. and its affiliates.
4330 *
4331 * This source code is licensed under the MIT license found in the
4332 * LICENSE file in the root directory of this source tree.
4333 *
4334 *
4335 */
4336 // Helpers to patch console.logs to avoid logging during side-effect free
4337 // replaying on render function. This currently only patches the object
4338 // lazily which won't cover if the log function was extracted eagerly.
4339 // We could also eagerly patch the method.
4340 let disabledDepth = 0;
4341 let prevLog;
4342 let prevInfo;
4343 let prevWarn;
4344 let prevError;
4345 let prevGroup;
4346 let prevGroupCollapsed;
4347 let prevGroupEnd;
4348
4349 function disabledLog() {}
4350
4351 disabledLog.__reactDisabledLog = true;
4352 function disableLogs() {
4353 if (false) {}
4354 }
4355 function reenableLogs() {
4356 if (false) {}
4357 }
4358 // CONCATENATED MODULE: ../react-devtools-shared/src/backend/DevToolsComponentStackFrame.js
4359 /**
4360 * Copyright (c) Facebook, Inc. and its affiliates.
4361 *
4362 * This source code is licensed under the MIT license found in the
4363 * LICENSE file in the root directory of this source tree.
4364 *
4365 *
4366 */
4367 // This is a DevTools fork of ReactComponentStackFrame.
4368 // This fork enables DevTools to use the same "native" component stack format,
4369 // while still maintaining support for multiple renderer versions
4370 // (which use different values for ReactTypeOfWork).
4371 // These methods are safe to import from shared;
4372 // there is no React-specific logic here.
4373
4374 let prefix;
4375 function describeBuiltInComponentFrame(name, source, ownerFn) {
4376 if (prefix === undefined) {
4377 // Extract the VM specific prefix used by each line.
4378 try {
4379 throw Error();
4380 } catch (x) {
4381 const match = x.stack.trim().match(/\n( *(at )?)/);
4382 prefix = match && match[1] || '';
4383 }
4384 }
4385 // We use the prefix to ensure our stacks line up with native stack frames.
4386
4387 return '\n' + prefix + name;
4388 }
4389 let reentry = false;
4390 let componentFrameCache;
4391
4392 if (false) {}
4393
4394 function describeNativeComponentFrame(fn, construct, currentDispatcherRef) {
4395 // If something asked for a stack inside a fake render, it should get ignored.
4396 if (!fn || reentry) {
4397 return '';
4398 }
4399
4400 if (false) {}
4401
4402 let control;
4403 const previousPrepareStackTrace = Error.prepareStackTrace;
4404 // $FlowFixMe It does accept undefined.
4405
4406 Error.prepareStackTrace = undefined;
4407 reentry = true;
4408 // Override the dispatcher so effects scheduled by this shallow render are thrown away.
4409 //
4410 // Note that unlike the code this was forked from (in ReactComponentStackFrame)
4411 // DevTools should override the dispatcher even when DevTools is compiled in production mode,
4412 // because the app itself may be in development mode and log errors/warnings.
4413
4414 const previousDispatcher = currentDispatcherRef.current;
4415 currentDispatcherRef.current = null;
4416 disableLogs();
4417
4418 try {
4419 // This should throw.
4420 if (construct) {
4421 // Something should be setting the props in the constructor.
4422 const Fake = function Fake() {
4423 throw Error();
4424 };
4425 // $FlowFixMe
4426
4427 Object.defineProperty(Fake.prototype, 'props', {
4428 set: function set() {
4429 // We use a throwing setter instead of frozen or non-writable props
4430 // because that won't throw in a non-strict mode function.
4431 throw Error();
4432 }
4433 });
4434
4435 if (typeof Reflect === 'object' && Reflect.construct) {
4436 // We construct a different control for this case to include any extra
4437 // frames added by the construct call.
4438 try {
4439 Reflect.construct(Fake, []);
4440 } catch (x) {
4441 control = x;
4442 }
4443
4444 Reflect.construct(fn, [], Fake);
4445 } else {
4446 try {
4447 Fake.call();
4448 } catch (x) {
4449 control = x;
4450 }
4451
4452 fn.call(Fake.prototype);
4453 }
4454 } else {
4455 try {
4456 throw Error();
4457 } catch (x) {
4458 control = x;
4459 }
4460
4461 fn();
4462 }
4463 } catch (sample) {
4464 // This is inlined manually because closure doesn't do it for us.
4465 if (sample && control && typeof sample.stack === 'string') {
4466 // This extracts the first frame from the sample that isn't also in the control.
4467 // Skipping one frame that we assume is the frame that calls the two.
4468 const sampleLines = sample.stack.split('\n');
4469 const controlLines = control.stack.split('\n');
4470 let s = sampleLines.length - 1;
4471 let c = controlLines.length - 1;
4472
4473 while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
4474 // We expect at least one stack frame to be shared.
4475 // Typically this will be the root most one. However, stack frames may be
4476 // cut off due to maximum stack limits. In this case, one maybe cut off
4477 // earlier than the other. We assume that the sample is longer or the same
4478 // and there for cut off earlier. So we should find the root most frame in
4479 // the sample somewhere in the control.
4480 c--;
4481 }
4482
4483 for (; s >= 1 && c >= 0; s--,
4484 c--) {
4485 // Next we find the first one that isn't the same which should be the
4486 // frame that called our sample function and the control.
4487 if (sampleLines[s] !== controlLines[c]) {
4488 // In V8, the first line is describing the message but other VMs don't.
4489 // If we're about to return the first line, and the control is also on the same
4490 // line, that's a pretty good indicator that our sample threw at same line as
4491 // the control. I.e. before we entered the sample frame. So we ignore this result.
4492 // This can happen if you passed a class to function component, or non-function.
4493 if (s !== 1 || c !== 1) {
4494 do {
4495 s--;
4496 c--;
4497 // We may still have similar intermediate frames from the construct call.
4498 // The next one that isn't the same should be our match though.
4499
4500 if (c < 0 || sampleLines[s] !== controlLines[c]) {
4501 // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
4502 const frame = '\n' + sampleLines[s].replace(' at new ', ' at ');
4503
4504 if (false) {}
4505 // Return the line we found.
4506
4507 return frame;
4508 }
4509 } while (s >= 1 && c >= 0);
4510 }
4511
4512 break;
4513 }
4514 }
4515 }
4516 } finally {
4517 reentry = false;
4518 Error.prepareStackTrace = previousPrepareStackTrace;
4519 currentDispatcherRef.current = previousDispatcher;
4520 reenableLogs();
4521 }
4522 // Fallback to just using the name if we couldn't make it throw.
4523
4524 const name = fn ? fn.displayName || fn.name : '';
4525 const syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
4526
4527 if (false) {}
4528
4529 return syntheticFrame;
4530 }
4531 function describeClassComponentFrame(ctor, source, ownerFn, currentDispatcherRef) {
4532 return describeNativeComponentFrame(ctor, true, currentDispatcherRef);
4533 }
4534 function describeFunctionComponentFrame(fn, source, ownerFn, currentDispatcherRef) {
4535 return describeNativeComponentFrame(fn, false, currentDispatcherRef);
4536 }
4537
4538 function shouldConstruct(Component) {
4539 const prototype = Component.prototype;
4540 return !!(prototype && prototype.isReactComponent);
4541 }
4542
4543 function describeUnknownElementTypeFrameInDEV(type, source, ownerFn, currentDispatcherRef) {
4544 if (true) {
4545 return '';
4546 }
4547
4548 if (type == null) {
4549 return '';
4550 }
4551
4552 if (typeof type === 'function') {
4553 return describeNativeComponentFrame(type, shouldConstruct(type), currentDispatcherRef);
4554 }
4555
4556 if (typeof type === 'string') {
4557 return describeBuiltInComponentFrame(type, source, ownerFn);
4558 }
4559
4560 switch (type) {
4561 case ReactSymbols["x"/* SUSPENSE_NUMBER */
4562 ]:
4563 case ReactSymbols["y"/* SUSPENSE_SYMBOL_STRING */
4564 ]:
4565 return describeBuiltInComponentFrame('Suspense', source, ownerFn);
4566
4567 case ReactSymbols["v"/* SUSPENSE_LIST_NUMBER */
4568 ]:
4569 case ReactSymbols["w"/* SUSPENSE_LIST_SYMBOL_STRING */
4570 ]:
4571 return describeBuiltInComponentFrame('SuspenseList', source, ownerFn);
4572 }
4573
4574 if (typeof type === 'object') {
4575 switch (type.$$typeof) {
4576 case ReactSymbols["h"/* FORWARD_REF_NUMBER */
4577 ]:
4578 case ReactSymbols["i"/* FORWARD_REF_SYMBOL_STRING */
4579 ]:
4580 return describeFunctionComponentFrame(type.render, source, ownerFn, currentDispatcherRef);
4581
4582 case ReactSymbols["l"/* MEMO_NUMBER */
4583 ]:
4584 case ReactSymbols["m"/* MEMO_SYMBOL_STRING */
4585 ]:
4586 // Memo may contain any component type so we recursively resolve it.
4587 return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn, currentDispatcherRef);
4588
4589 case ReactSymbols["a"/* BLOCK_NUMBER */
4590 ]:
4591 case ReactSymbols["b"/* BLOCK_SYMBOL_STRING */
4592 ]:
4593 return describeFunctionComponentFrame(type._render, source, ownerFn, currentDispatcherRef);
4594
4595 case ReactSymbols["j"/* LAZY_NUMBER */
4596 ]:
4597 case ReactSymbols["k"/* LAZY_SYMBOL_STRING */
4598 ]:
4599 {
4600 const lazyComponent = type;
4601 const payload = lazyComponent._payload;
4602 const init = lazyComponent._init;
4603
4604 try {
4605 // Lazy may contain any component type so we recursively resolve it.
4606 return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn, currentDispatcherRef);
4607 } catch (x) {}
4608 }
4609 }
4610 }
4611
4612 return '';
4613 }
4614 // CONCATENATED MODULE: ../react-devtools-shared/src/backend/DevToolsFiberComponentStack.js
4615 /**
4616 * Copyright (c) Facebook, Inc. and its affiliates.
4617 *
4618 * This source code is licensed under the MIT license found in the
4619 * LICENSE file in the root directory of this source tree.
4620 *
4621 *
4622 */
4623 // This is a DevTools fork of ReactFiberComponentStack.
4624 // This fork enables DevTools to use the same "native" component stack format,
4625 // while still maintaining support for multiple renderer versions
4626 // (which use different values for ReactTypeOfWork).
4627
4628 function describeFiber(workTagMap, workInProgress, currentDispatcherRef) {
4629 const HostComponent = workTagMap.HostComponent
4630 , LazyComponent = workTagMap.LazyComponent
4631 , SuspenseComponent = workTagMap.SuspenseComponent
4632 , SuspenseListComponent = workTagMap.SuspenseListComponent
4633 , FunctionComponent = workTagMap.FunctionComponent
4634 , IndeterminateComponent = workTagMap.IndeterminateComponent
4635 , SimpleMemoComponent = workTagMap.SimpleMemoComponent
4636 , ForwardRef = workTagMap.ForwardRef
4637 , Block = workTagMap.Block
4638 , ClassComponent = workTagMap.ClassComponent;
4639 const owner = false ? undefined : null;
4640 const source = false ? undefined : null;
4641
4642 switch (workInProgress.tag) {
4643 case HostComponent:
4644 return describeBuiltInComponentFrame(workInProgress.type, source, owner);
4645
4646 case LazyComponent:
4647 return describeBuiltInComponentFrame('Lazy', source, owner);
4648
4649 case SuspenseComponent:
4650 return describeBuiltInComponentFrame('Suspense', source, owner);
4651
4652 case SuspenseListComponent:
4653 return describeBuiltInComponentFrame('SuspenseList', source, owner);
4654
4655 case FunctionComponent:
4656 case IndeterminateComponent:
4657 case SimpleMemoComponent:
4658 return describeFunctionComponentFrame(workInProgress.type, source, owner, currentDispatcherRef);
4659
4660 case ForwardRef:
4661 return describeFunctionComponentFrame(workInProgress.type.render, source, owner, currentDispatcherRef);
4662
4663 case Block:
4664 return describeFunctionComponentFrame(workInProgress.type._render, source, owner, currentDispatcherRef);
4665
4666 case ClassComponent:
4667 return describeClassComponentFrame(workInProgress.type, source, owner, currentDispatcherRef);
4668
4669 default:
4670 return '';
4671 }
4672 }
4673
4674 function getStackByFiberInDevAndProd(workTagMap, workInProgress, currentDispatcherRef) {
4675 try {
4676 let info = '';
4677 let node = workInProgress;
4678
4679 do {
4680 info += describeFiber(workTagMap, node, currentDispatcherRef);
4681 node = node.return;
4682 } while (node);
4683 return info;
4684 } catch (x) {
4685 return '\nError generating stack: ' + x.message + '\n' + x.stack;
4686 }
4687 }
4688 // CONCATENATED MODULE: ../react-devtools-shared/src/backend/console.js
4689 function _createForOfIteratorHelper(o, allowArrayLike) {
4690 var it;
4691 if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
4692 if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
4693 if (it)
4694 o = it;
4695 var i = 0;
4696 var F = function F() {};
4697 return {
4698 s: F,
4699 n: function n() {
4700 if (i >= o.length)
4701 return {
4702 done: true
4703 };
4704 return {
4705 done: false,
4706 value: o[i++]
4707 };
4708 },
4709 e: function e(_e) {
4710 throw _e;
4711 },
4712 f: F
4713 };
4714 }
4715 throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
4716 }
4717 var normalCompletion = true, didErr = false, err;
4718 return {
4719 s: function s() {
4720 it = o[Symbol.iterator]();
4721 },
4722 n: function n() {
4723 var step = it.next();
4724 normalCompletion = step.done;
4725 return step;
4726 },
4727 e: function e(_e2) {
4728 didErr = true;
4729 err = _e2;
4730 },
4731 f: function f() {
4732 try {
4733 if (!normalCompletion && it.return != null)
4734 it.return();
4735 } finally {
4736 if (didErr)
4737 throw err;
4738 }
4739 }
4740 };
4741 }
4742
4743 function _unsupportedIterableToArray(o, minLen) {
4744 if (!o)
4745 return;
4746 if (typeof o === "string")
4747 return _arrayLikeToArray(o, minLen);
4748 var n = Object.prototype.toString.call(o).slice(8, -1);
4749 if (n === "Object" && o.constructor)
4750 n = o.constructor.name;
4751 if (n === "Map" || n === "Set")
4752 return Array.from(o);
4753 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
4754 return _arrayLikeToArray(o, minLen);
4755 }
4756
4757 function _arrayLikeToArray(arr, len) {
4758 if (len == null || len > arr.length)
4759 len = arr.length;
4760 for (var i = 0, arr2 = new Array(len); i < len; i++)
4761 arr2[i] = arr[i];
4762 return arr2;
4763 }
4764
4765 /**
4766 * Copyright (c) Facebook, Inc. and its affiliates.
4767 *
4768 * This source code is licensed under the MIT license found in the
4769 * LICENSE file in the root directory of this source tree.
4770 *
4771 *
4772 */
4773
4774 const APPEND_STACK_TO_METHODS = ['error', 'trace', 'warn'];
4775 // React's custom built component stack strings match "\s{4}in"
4776 // Chrome's prefix matches "\s{4}at"
4777
4778 const PREFIX_REGEX = /\s{4}(in|at)\s{1}/;
4779 // Firefox and Safari have no prefix ("")
4780 // but we can fallback to looking for location info (e.g. "foo.js:12:345")
4781
4782 const ROW_COLUMN_NUMBER_REGEX = /:\d+:\d+(\n|$)/;
4783 const injectedRenderers = new Map();
4784 let targetConsole = console;
4785 let targetConsoleMethods = {};
4786
4787 for (const method in console) {
4788 targetConsoleMethods[method] = console[method];
4789 }
4790
4791 let unpatchFn = null;
4792 // Enables e.g. Jest tests to inject a mock console object.
4793
4794 function dangerous_setTargetConsoleForTesting(targetConsoleForTesting) {
4795 targetConsole = targetConsoleForTesting;
4796 targetConsoleMethods = {};
4797
4798 for (const method in targetConsole) {
4799 targetConsoleMethods[method] = console[method];
4800 }
4801 }
4802 // v16 renderers should use this method to inject internals necessary to generate a component stack.
4803 // These internals will be used if the console is patched.
4804 // Injecting them separately allows the console to easily be patched or un-patched later (at runtime).
4805
4806 function registerRenderer(renderer) {
4807 const currentDispatcherRef = renderer.currentDispatcherRef
4808 , getCurrentFiber = renderer.getCurrentFiber
4809 , findFiberByHostInstance = renderer.findFiberByHostInstance
4810 , version = renderer.version;
4811 // Ignore React v15 and older because they don't expose a component stack anyway.
4812
4813 if (typeof findFiberByHostInstance !== 'function') {
4814 return;
4815 }
4816 // currentDispatcherRef gets injected for v16.8+ to support hooks inspection.
4817 // getCurrentFiber gets injected for v16.9+.
4818
4819 if (currentDispatcherRef != null && typeof getCurrentFiber === 'function') {
4820 const _getInternalReactCons = Object(backend_renderer["b"/* getInternalReactConstants */
4821 ])(version)
4822 , ReactTypeOfWork = _getInternalReactCons.ReactTypeOfWork;
4823
4824 injectedRenderers.set(renderer, {
4825 currentDispatcherRef,
4826 getCurrentFiber,
4827 workTagMap: ReactTypeOfWork
4828 });
4829 }
4830 }
4831 const consoleSettingsRef = {
4832 appendComponentStack: false,
4833 breakOnConsoleErrors: false
4834 };
4835 // Patches console methods to append component stack for the current fiber.
4836 // Call unpatch() to remove the injected behavior.
4837
4838 function patch({appendComponentStack, breakOnConsoleErrors}) {
4839 // Settings may change after we've patched the console.
4840 // Using a shared ref allows the patch function to read the latest values.
4841 consoleSettingsRef.appendComponentStack = appendComponentStack;
4842 consoleSettingsRef.breakOnConsoleErrors = breakOnConsoleErrors;
4843
4844 if (unpatchFn !== null) {
4845 // Don't patch twice.
4846 return;
4847 }
4848
4849 const originalConsoleMethods = {};
4850
4851 unpatchFn = ()=>{
4852 for (const method in originalConsoleMethods) {
4853 try {
4854 // $FlowFixMe property error|warn is not writable.
4855 targetConsole[method] = originalConsoleMethods[method];
4856 } catch (error) {}
4857 }
4858 }
4859 ;
4860
4861 APPEND_STACK_TO_METHODS.forEach(method=>{
4862 try {
4863 const originalMethod = originalConsoleMethods[method] = targetConsole[method];
4864
4865 const overrideMethod = (...args)=>{
4866 const latestAppendComponentStack = consoleSettingsRef.appendComponentStack;
4867 const latestBreakOnConsoleErrors = consoleSettingsRef.breakOnConsoleErrors;
4868
4869 if (latestAppendComponentStack) {
4870 try {
4871 // If we are ever called with a string that already has a component stack, e.g. a React error/warning,
4872 // don't append a second stack.
4873 const lastArg = args.length > 0 ? args[args.length - 1] : null;
4874 const alreadyHasComponentStack = lastArg !== null && (PREFIX_REGEX.test(lastArg) || ROW_COLUMN_NUMBER_REGEX.test(lastArg));
4875
4876 if (!alreadyHasComponentStack) {
4877 // If there's a component stack for at least one of the injected renderers, append it.
4878 // We don't handle the edge case of stacks for more than one (e.g. interleaved renderers?)
4879 // eslint-disable-next-line no-for-of-loops/no-for-of-loops
4880 var _iterator = _createForOfIteratorHelper(injectedRenderers.values()), _step;
4881
4882 try {
4883 for (_iterator.s(); !(_step = _iterator.n()).done; ) {
4884 const _step$value = _step.value
4885 , currentDispatcherRef = _step$value.currentDispatcherRef
4886 , getCurrentFiber = _step$value.getCurrentFiber
4887 , workTagMap = _step$value.workTagMap;
4888 const current = getCurrentFiber();
4889
4890 if (current != null) {
4891 const componentStack = getStackByFiberInDevAndProd(workTagMap, current, currentDispatcherRef);
4892
4893 if (componentStack !== '') {
4894 args.push(componentStack);
4895 }
4896
4897 break;
4898 }
4899 }
4900 } catch (err) {
4901 _iterator.e(err);
4902 } finally {
4903 _iterator.f();
4904 }
4905 }
4906 } catch (error) {// Don't let a DevTools or React internal error interfere with logging.
4907 }
4908 }
4909
4910 if (latestBreakOnConsoleErrors) {
4911 // --- Welcome to debugging with React DevTools ---
4912 // This debugger statement means that you've enabled the "break on warnings" feature.
4913 // Use the browser's Call Stack panel to step out of this override function-
4914 // to where the original warning or error was logged.
4915 // eslint-disable-next-line no-debugger
4916 debugger ;
4917 }
4918
4919 originalMethod(...args);
4920 }
4921 ;
4922
4923 overrideMethod.__REACT_DEVTOOLS_ORIGINAL_METHOD__ = originalMethod;
4924 // $FlowFixMe property error|warn is not writable.
4925
4926 targetConsole[method] = overrideMethod;
4927 } catch (error) {}
4928 }
4929 );
4930 }
4931 // Removed component stack patch from console methods.
4932
4933 function unpatch() {
4934 if (unpatchFn !== null) {
4935 unpatchFn();
4936 unpatchFn = null;
4937 }
4938 }
4939
4940 /***/
4941 }
4942 ),
4943
4944 /***/
4945 37: /***/
4946 (function(module, __webpack_exports__, __webpack_require__) {
4947
4948 "use strict";
4949
4950 // EXPORTS
4951 __webpack_require__.d(__webpack_exports__, "b", function() {
4952 return /* binding */
4953 getInternalReactConstants;
4954 });
4955 __webpack_require__.d(__webpack_exports__, "a", function() {
4956 return /* binding */
4957 attach;
4958 });
4959
4960 // EXTERNAL MODULE: ../react-devtools-shared/node_modules/semver/semver.js
4961 var semver = __webpack_require__(29);
4962
4963 // EXTERNAL MODULE: ../react-devtools-shared/src/types.js
4964 var types = __webpack_require__(1);
4965
4966 // EXTERNAL MODULE: ../react-devtools-shared/src/utils.js + 1 modules
4967 var utils = __webpack_require__(2);
4968
4969 // EXTERNAL MODULE: ../react-devtools-shared/src/storage.js
4970 var storage = __webpack_require__(7);
4971
4972 // EXTERNAL MODULE: /Users/bvaughn/Documents/git/react.alt2/node_modules/clipboard-js/clipboard.js
4973 var clipboard = __webpack_require__(17);
4974
4975 // EXTERNAL MODULE: ../react-devtools-shared/src/hydration.js
4976 var hydration = __webpack_require__(8);
4977
4978 // CONCATENATED MODULE: ../react-devtools-shared/src/backend/utils.js
4979 function ownKeys(object, enumerableOnly) {
4980 var keys = Object.keys(object);
4981 if (Object.getOwnPropertySymbols) {
4982 var symbols = Object.getOwnPropertySymbols(object);
4983 if (enumerableOnly)
4984 symbols = symbols.filter(function(sym) {
4985 return Object.getOwnPropertyDescriptor(object, sym).enumerable;
4986 });
4987 keys.push.apply(keys, symbols);
4988 }
4989 return keys;
4990 }
4991
4992 function _objectSpread(target) {
4993 for (var i = 1; i < arguments.length; i++) {
4994 var source = arguments[i] != null ? arguments[i] : {};
4995 if (i % 2) {
4996 ownKeys(Object(source), true).forEach(function(key) {
4997 _defineProperty(target, key, source[key]);
4998 });
4999 } else if (Object.getOwnPropertyDescriptors) {
5000 Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
5001 } else {
5002 ownKeys(Object(source)).forEach(function(key) {
5003 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
5004 });
5005 }
5006 }
5007 return target;
5008 }
5009
5010 function _defineProperty(obj, key, value) {
5011 if (key in obj) {
5012 Object.defineProperty(obj, key, {
5013 value: value,
5014 enumerable: true,
5015 configurable: true,
5016 writable: true
5017 });
5018 } else {
5019 obj[key] = value;
5020 }
5021 return obj;
5022 }
5023
5024 /**
5025 * Copyright (c) Facebook, Inc. and its affiliates.
5026 *
5027 * This source code is licensed under the MIT license found in the
5028 * LICENSE file in the root directory of this source tree.
5029 *
5030 *
5031 */
5032
5033 function cleanForBridge(data, isPathAllowed, path=[]) {
5034 if (data !== null) {
5035 const cleanedPaths = [];
5036 const unserializablePaths = [];
5037 const cleanedData = Object(hydration["a"/* dehydrate */
5038 ])(data, cleanedPaths, unserializablePaths, path, isPathAllowed);
5039 return {
5040 data: cleanedData,
5041 cleaned: cleanedPaths,
5042 unserializable: unserializablePaths
5043 };
5044 } else {
5045 return null;
5046 }
5047 }
5048 function copyToClipboard(value) {
5049 const safeToCopy = serializeToString(value);
5050 const text = safeToCopy === undefined ? 'undefined' : safeToCopy;
5051 const clipboardCopyText = window.__REACT_DEVTOOLS_GLOBAL_HOOK__.clipboardCopyText;
5052 // On Firefox navigator.clipboard.writeText has to be called from
5053 // the content script js code (because it requires the clipboardWrite
5054 // permission to be allowed out of a "user handling" callback),
5055 // clipboardCopyText is an helper injected into the page from.
5056 // injectGlobalHook.
5057
5058 if (typeof clipboardCopyText === 'function') {
5059 clipboardCopyText(text).catch(err=>{}
5060 );
5061 } else {
5062 Object(clipboard["copy"])(text);
5063 }
5064 }
5065 function copyWithDelete(obj, path, index=0) {
5066 const key = path[index];
5067 const updated = Array.isArray(obj) ? obj.slice() : _objectSpread({}, obj);
5068
5069 if (index + 1 === path.length) {
5070 if (Array.isArray(updated)) {
5071 updated.splice(key, 1);
5072 } else {
5073 delete updated[key];
5074 }
5075 } else {
5076 // $FlowFixMe number or string is fine here
5077 updated[key] = copyWithDelete(obj[key], path, index + 1);
5078 }
5079
5080 return updated;
5081 }
5082 // This function expects paths to be the same except for the final value.
5083 // e.g. ['path', 'to', 'foo'] and ['path', 'to', 'bar']
5084
5085 function copyWithRename(obj, oldPath, newPath, index=0) {
5086 const oldKey = oldPath[index];
5087 const updated = Array.isArray(obj) ? obj.slice() : _objectSpread({}, obj);
5088
5089 if (index + 1 === oldPath.length) {
5090 const newKey = newPath[index];
5091 // $FlowFixMe number or string is fine here
5092
5093 updated[newKey] = updated[oldKey];
5094
5095 if (Array.isArray(updated)) {
5096 updated.splice(oldKey, 1);
5097 } else {
5098 delete updated[oldKey];
5099 }
5100 } else {
5101 // $FlowFixMe number or string is fine here
5102 updated[oldKey] = copyWithRename(obj[oldKey], oldPath, newPath, index + 1);
5103 }
5104
5105 return updated;
5106 }
5107 function copyWithSet(obj, path, value, index=0) {
5108 if (index >= path.length) {
5109 return value;
5110 }
5111
5112 const key = path[index];
5113 const updated = Array.isArray(obj) ? obj.slice() : _objectSpread({}, obj);
5114 // $FlowFixMe number or string is fine here
5115
5116 updated[key] = copyWithSet(obj[key], path, value, index + 1);
5117 return updated;
5118 }
5119 function serializeToString(data) {
5120 const cache = new Set();
5121 // Use a custom replacer function to protect against circular references.
5122
5123 return JSON.stringify(data, (key,value)=>{
5124 if (typeof value === 'object' && value !== null) {
5125 if (cache.has(value)) {
5126 return;
5127 }
5128
5129 cache.add(value);
5130 }
5131 // $FlowFixMe
5132
5133 if (typeof value === 'bigint') {
5134 return value.toString() + 'n';
5135 }
5136
5137 return value;
5138 }
5139 );
5140 }
5141 // EXTERNAL MODULE: ../react-devtools-shared/src/constants.js
5142 var constants = __webpack_require__(3);
5143
5144 // EXTERNAL MODULE: /Users/bvaughn/Documents/git/react.alt2/build/node_modules/react-debug-tools/index.js
5145 var react_debug_tools = __webpack_require__(51);
5146
5147 // EXTERNAL MODULE: ../react-devtools-shared/src/backend/console.js + 3 modules
5148 var backend_console = __webpack_require__(35);
5149
5150 // EXTERNAL MODULE: ../react-devtools-shared/src/backend/ReactSymbols.js
5151 var ReactSymbols = __webpack_require__(4);
5152
5153 // CONCATENATED MODULE: ../react-devtools-shared/src/backend/renderer.js
5154 function renderer_ownKeys(object, enumerableOnly) {
5155 var keys = Object.keys(object);
5156 if (Object.getOwnPropertySymbols) {
5157 var symbols = Object.getOwnPropertySymbols(object);
5158 if (enumerableOnly)
5159 symbols = symbols.filter(function(sym) {
5160 return Object.getOwnPropertyDescriptor(object, sym).enumerable;
5161 });
5162 keys.push.apply(keys, symbols);
5163 }
5164 return keys;
5165 }
5166
5167 function renderer_objectSpread(target) {
5168 for (var i = 1; i < arguments.length; i++) {
5169 var source = arguments[i] != null ? arguments[i] : {};
5170 if (i % 2) {
5171 renderer_ownKeys(Object(source), true).forEach(function(key) {
5172 renderer_defineProperty(target, key, source[key]);
5173 });
5174 } else if (Object.getOwnPropertyDescriptors) {
5175 Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
5176 } else {
5177 renderer_ownKeys(Object(source)).forEach(function(key) {
5178 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
5179 });
5180 }
5181 }
5182 return target;
5183 }
5184
5185 function renderer_defineProperty(obj, key, value) {
5186 if (key in obj) {
5187 Object.defineProperty(obj, key, {
5188 value: value,
5189 enumerable: true,
5190 configurable: true,
5191 writable: true
5192 });
5193 } else {
5194 obj[key] = value;
5195 }
5196 return obj;
5197 }
5198
5199 function _slicedToArray(arr, i) {
5200 return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
5201 }
5202
5203 function _nonIterableRest() {
5204 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5205 }
5206
5207 function _iterableToArrayLimit(arr, i) {
5208 if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr)))
5209 return;
5210 var _arr = [];
5211 var _n = true;
5212 var _d = false;
5213 var _e = undefined;
5214 try {
5215 for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
5216 _arr.push(_s.value);
5217 if (i && _arr.length === i)
5218 break;
5219 }
5220 } catch (err) {
5221 _d = true;
5222 _e = err;
5223 } finally {
5224 try {
5225 if (!_n && _i["return"] != null)
5226 _i["return"]();
5227 } finally {
5228 if (_d)
5229 throw _e;
5230 }
5231 }
5232 return _arr;
5233 }
5234
5235 function _arrayWithHoles(arr) {
5236 if (Array.isArray(arr))
5237 return arr;
5238 }
5239
5240 function _createForOfIteratorHelper(o, allowArrayLike) {
5241 var it;
5242 if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
5243 if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
5244 if (it)
5245 o = it;
5246 var i = 0;
5247 var F = function F() {};
5248 return {
5249 s: F,
5250 n: function n() {
5251 if (i >= o.length)
5252 return {
5253 done: true
5254 };
5255 return {
5256 done: false,
5257 value: o[i++]
5258 };
5259 },
5260 e: function e(_e2) {
5261 throw _e2;
5262 },
5263 f: F
5264 };
5265 }
5266 throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5267 }
5268 var normalCompletion = true, didErr = false, err;
5269 return {
5270 s: function s() {
5271 it = o[Symbol.iterator]();
5272 },
5273 n: function n() {
5274 var step = it.next();
5275 normalCompletion = step.done;
5276 return step;
5277 },
5278 e: function e(_e3) {
5279 didErr = true;
5280 err = _e3;
5281 },
5282 f: function f() {
5283 try {
5284 if (!normalCompletion && it.return != null)
5285 it.return();
5286 } finally {
5287 if (didErr)
5288 throw err;
5289 }
5290 }
5291 };
5292 }
5293
5294 function _unsupportedIterableToArray(o, minLen) {
5295 if (!o)
5296 return;
5297 if (typeof o === "string")
5298 return _arrayLikeToArray(o, minLen);
5299 var n = Object.prototype.toString.call(o).slice(8, -1);
5300 if (n === "Object" && o.constructor)
5301 n = o.constructor.name;
5302 if (n === "Map" || n === "Set")
5303 return Array.from(o);
5304 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
5305 return _arrayLikeToArray(o, minLen);
5306 }
5307
5308 function _arrayLikeToArray(arr, len) {
5309 if (len == null || len > arr.length)
5310 len = arr.length;
5311 for (var i = 0, arr2 = new Array(len); i < len; i++)
5312 arr2[i] = arr[i];
5313 return arr2;
5314 }
5315
5316 /**
5317 * Copyright (c) Facebook, Inc. and its affiliates.
5318 *
5319 * This source code is licensed under the MIT license found in the
5320 * LICENSE file in the root directory of this source tree.
5321 *
5322 *
5323 */
5324
5325 function getFiberFlags(fiber) {
5326 // The name of this field changed from "effectTag" to "flags"
5327 return fiber.flags !== undefined ? fiber.flags : fiber.effectTag;
5328 }
5329 // Some environments (e.g. React Native / Hermes) don't support the performance API yet.
5330
5331 const getCurrentTime = typeof performance === 'object' && typeof performance.now === 'function' ? ()=>performance.now() : ()=>Date.now();
5332 function getInternalReactConstants(version) {
5333 const ReactTypeOfSideEffect = {
5334 NoFlags: 0b00,
5335 PerformedWork: 0b01,
5336 Placement: 0b10
5337 };
5338 // **********************************************************
5339 // The section below is copied from files in React repo.
5340 // Keep it in sync, and add version guards if it changes.
5341 //
5342 // Technically these priority levels are invalid for versions before 16.9,
5343 // but 16.9 is the first version to report priority level to DevTools,
5344 // so we can avoid checking for earlier versions and support pre-16.9 canary releases in the process.
5345
5346 const ReactPriorityLevels = {
5347 ImmediatePriority: 99,
5348 UserBlockingPriority: 98,
5349 NormalPriority: 97,
5350 LowPriority: 96,
5351 IdlePriority: 95,
5352 NoPriority: 90
5353 };
5354 let ReactTypeOfWork = null;
5355 // **********************************************************
5356 // The section below is copied from files in React repo.
5357 // Keep it in sync, and add version guards if it changes.
5358
5359 if (Object(semver["gte"])(version, '17.0.0-alpha')) {
5360 // TODO (Offscreen) Update the version number above to reflect the first Offscreen alpha/beta release.
5361 ReactTypeOfWork = {
5362 Block: 22,
5363 ClassComponent: 1,
5364 ContextConsumer: 9,
5365 ContextProvider: 10,
5366 CoroutineComponent: -1,
5367 // Removed
5368 CoroutineHandlerPhase: -1,
5369 // Removed
5370 DehydratedSuspenseComponent: 18,
5371 // Behind a flag
5372 ForwardRef: 11,
5373 Fragment: 7,
5374 FunctionComponent: 0,
5375 HostComponent: 5,
5376 HostPortal: 4,
5377 HostRoot: 3,
5378 HostText: 6,
5379 IncompleteClassComponent: 17,
5380 IndeterminateComponent: 2,
5381 LazyComponent: 16,
5382 MemoComponent: 14,
5383 Mode: 8,
5384 OffscreenComponent: 23,
5385 // Experimental
5386 Profiler: 12,
5387 SimpleMemoComponent: 15,
5388 SuspenseComponent: 13,
5389 SuspenseListComponent: 19,
5390 // Experimental
5391 YieldComponent: -1 // Removed
5392
5393 };
5394 } else if (Object(semver["gte"])(version, '16.6.0-beta.0')) {
5395 ReactTypeOfWork = {
5396 Block: 22,
5397 ClassComponent: 1,
5398 ContextConsumer: 9,
5399 ContextProvider: 10,
5400 CoroutineComponent: -1,
5401 // Removed
5402 CoroutineHandlerPhase: -1,
5403 // Removed
5404 DehydratedSuspenseComponent: 18,
5405 // Behind a flag
5406 ForwardRef: 11,
5407 Fragment: 7,
5408 FunctionComponent: 0,
5409 HostComponent: 5,
5410 HostPortal: 4,
5411 HostRoot: 3,
5412 HostText: 6,
5413 IncompleteClassComponent: 17,
5414 IndeterminateComponent: 2,
5415 LazyComponent: 16,
5416 MemoComponent: 14,
5417 Mode: 8,
5418 OffscreenComponent: -1,
5419 // Experimental
5420 Profiler: 12,
5421 SimpleMemoComponent: 15,
5422 SuspenseComponent: 13,
5423 SuspenseListComponent: 19,
5424 // Experimental
5425 YieldComponent: -1 // Removed
5426
5427 };
5428 } else if (Object(semver["gte"])(version, '16.4.3-alpha')) {
5429 ReactTypeOfWork = {
5430 Block: -1,
5431 // Doesn't exist yet
5432 ClassComponent: 2,
5433 ContextConsumer: 11,
5434 ContextProvider: 12,
5435 CoroutineComponent: -1,
5436 // Removed
5437 CoroutineHandlerPhase: -1,
5438 // Removed
5439 DehydratedSuspenseComponent: -1,
5440 // Doesn't exist yet
5441 ForwardRef: 13,
5442 Fragment: 9,
5443 FunctionComponent: 0,
5444 HostComponent: 7,
5445 HostPortal: 6,
5446 HostRoot: 5,
5447 HostText: 8,
5448 IncompleteClassComponent: -1,
5449 // Doesn't exist yet
5450 IndeterminateComponent: 4,
5451 LazyComponent: -1,
5452 // Doesn't exist yet
5453 MemoComponent: -1,
5454 // Doesn't exist yet
5455 Mode: 10,
5456 OffscreenComponent: -1,
5457 // Experimental
5458 Profiler: 15,
5459 SimpleMemoComponent: -1,
5460 // Doesn't exist yet
5461 SuspenseComponent: 16,
5462 SuspenseListComponent: -1,
5463 // Doesn't exist yet
5464 YieldComponent: -1 // Removed
5465
5466 };
5467 } else {
5468 ReactTypeOfWork = {
5469 Block: -1,
5470 // Doesn't exist yet
5471 ClassComponent: 2,
5472 ContextConsumer: 12,
5473 ContextProvider: 13,
5474 CoroutineComponent: 7,
5475 CoroutineHandlerPhase: 8,
5476 DehydratedSuspenseComponent: -1,
5477 // Doesn't exist yet
5478 ForwardRef: 14,
5479 Fragment: 10,
5480 FunctionComponent: 1,
5481 HostComponent: 5,
5482 HostPortal: 4,
5483 HostRoot: 3,
5484 HostText: 6,
5485 IncompleteClassComponent: -1,
5486 // Doesn't exist yet
5487 IndeterminateComponent: 0,
5488 LazyComponent: -1,
5489 // Doesn't exist yet
5490 MemoComponent: -1,
5491 // Doesn't exist yet
5492 Mode: 11,
5493 OffscreenComponent: -1,
5494 // Experimental
5495 Profiler: 15,
5496 SimpleMemoComponent: -1,
5497 // Doesn't exist yet
5498 SuspenseComponent: 16,
5499 SuspenseListComponent: -1,
5500 // Doesn't exist yet
5501 YieldComponent: 9
5502 };
5503 }
5504 // **********************************************************
5505 // End of copied code.
5506 // **********************************************************
5507
5508 function getTypeSymbol(type) {
5509 const symbolOrNumber = typeof type === 'object' && type !== null ? type.$$typeof : type;
5510 // $FlowFixMe Flow doesn't know about typeof "symbol"
5511
5512 return typeof symbolOrNumber === 'symbol' ? symbolOrNumber.toString() : symbolOrNumber;
5513 }
5514
5515 const _ReactTypeOfWork = ReactTypeOfWork
5516 , ClassComponent = _ReactTypeOfWork.ClassComponent
5517 , IncompleteClassComponent = _ReactTypeOfWork.IncompleteClassComponent
5518 , FunctionComponent = _ReactTypeOfWork.FunctionComponent
5519 , IndeterminateComponent = _ReactTypeOfWork.IndeterminateComponent
5520 , ForwardRef = _ReactTypeOfWork.ForwardRef
5521 , HostRoot = _ReactTypeOfWork.HostRoot
5522 , HostComponent = _ReactTypeOfWork.HostComponent
5523 , HostPortal = _ReactTypeOfWork.HostPortal
5524 , HostText = _ReactTypeOfWork.HostText
5525 , Fragment = _ReactTypeOfWork.Fragment
5526 , MemoComponent = _ReactTypeOfWork.MemoComponent
5527 , SimpleMemoComponent = _ReactTypeOfWork.SimpleMemoComponent
5528 , SuspenseComponent = _ReactTypeOfWork.SuspenseComponent
5529 , SuspenseListComponent = _ReactTypeOfWork.SuspenseListComponent;
5530
5531 function resolveFiberType(type) {
5532 const typeSymbol = getTypeSymbol(type);
5533
5534 switch (typeSymbol) {
5535 case ReactSymbols["l"/* MEMO_NUMBER */
5536 ]:
5537 case ReactSymbols["m"/* MEMO_SYMBOL_STRING */
5538 ]:
5539 // recursively resolving memo type in case of memo(forwardRef(Component))
5540 return resolveFiberType(type.type);
5541
5542 case ReactSymbols["h"/* FORWARD_REF_NUMBER */
5543 ]:
5544 case ReactSymbols["i"/* FORWARD_REF_SYMBOL_STRING */
5545 ]:
5546 return type.render;
5547
5548 default:
5549 return type;
5550 }
5551 }
5552 // NOTICE Keep in sync with shouldFilterFiber() and other get*ForFiber methods
5553
5554 function getDisplayNameForFiber(fiber) {
5555 const type = fiber.type
5556 , tag = fiber.tag;
5557 let resolvedType = type;
5558
5559 if (typeof type === 'object' && type !== null) {
5560 resolvedType = resolveFiberType(type);
5561 }
5562
5563 let resolvedContext = null;
5564
5565 switch (tag) {
5566 case ClassComponent:
5567 case IncompleteClassComponent:
5568 return Object(utils["h"/* getDisplayName */
5569 ])(resolvedType);
5570
5571 case FunctionComponent:
5572 case IndeterminateComponent:
5573 return Object(utils["h"/* getDisplayName */
5574 ])(resolvedType);
5575
5576 case ForwardRef:
5577 // Mirror https://github.com/facebook/react/blob/7c21bf72ace77094fd1910cc350a548287ef8350/packages/shared/getComponentName.js#L27-L37
5578 return type && type.displayName || Object(utils["h"/* getDisplayName */
5579 ])(resolvedType, 'Anonymous');
5580
5581 case HostRoot:
5582 return null;
5583
5584 case HostComponent:
5585 return type;
5586
5587 case HostPortal:
5588 case HostText:
5589 case Fragment:
5590 return null;
5591
5592 case MemoComponent:
5593 case SimpleMemoComponent:
5594 return Object(utils["h"/* getDisplayName */
5595 ])(resolvedType, 'Anonymous');
5596
5597 case SuspenseComponent:
5598 return 'Suspense';
5599
5600 case SuspenseListComponent:
5601 return 'SuspenseList';
5602
5603 default:
5604 const typeSymbol = getTypeSymbol(type);
5605
5606 switch (typeSymbol) {
5607 case ReactSymbols["c"/* CONCURRENT_MODE_NUMBER */
5608 ]:
5609 case ReactSymbols["d"/* CONCURRENT_MODE_SYMBOL_STRING */
5610 ]:
5611 case ReactSymbols["g"/* DEPRECATED_ASYNC_MODE_SYMBOL_STRING */
5612 ]:
5613 return null;
5614
5615 case ReactSymbols["p"/* PROVIDER_NUMBER */
5616 ]:
5617 case ReactSymbols["q"/* PROVIDER_SYMBOL_STRING */
5618 ]:
5619 // 16.3.0 exposed the context object as "context"
5620 // PR #12501 changed it to "_context" for 16.3.1+
5621 // NOTE Keep in sync with inspectElementRaw()
5622 resolvedContext = fiber.type._context || fiber.type.context;
5623 return `${resolvedContext.displayName || 'Context'}.Provider`;
5624
5625 case ReactSymbols["e"/* CONTEXT_NUMBER */
5626 ]:
5627 case ReactSymbols["f"/* CONTEXT_SYMBOL_STRING */
5628 ]:
5629 // 16.3-16.5 read from "type" because the Consumer is the actual context object.
5630 // 16.6+ should read from "type._context" because Consumer can be different (in DEV).
5631 // NOTE Keep in sync with inspectElementRaw()
5632 resolvedContext = fiber.type._context || fiber.type;
5633 // NOTE: TraceUpdatesBackendManager depends on the name ending in '.Consumer'
5634 // If you change the name, figure out a more resilient way to detect it.
5635
5636 return `${resolvedContext.displayName || 'Context'}.Consumer`;
5637
5638 case ReactSymbols["t"/* STRICT_MODE_NUMBER */
5639 ]:
5640 case ReactSymbols["u"/* STRICT_MODE_SYMBOL_STRING */
5641 ]:
5642 return null;
5643
5644 case ReactSymbols["n"/* PROFILER_NUMBER */
5645 ]:
5646 case ReactSymbols["o"/* PROFILER_SYMBOL_STRING */
5647 ]:
5648 return `Profiler(${fiber.memoizedProps.id})`;
5649
5650 case ReactSymbols["r"/* SCOPE_NUMBER */
5651 ]:
5652 case ReactSymbols["s"/* SCOPE_SYMBOL_STRING */
5653 ]:
5654 return 'Scope';
5655
5656 default:
5657 // Unknown element type.
5658 // This may mean a new element type that has not yet been added to DevTools.
5659 return null;
5660 }
5661
5662 }
5663 }
5664
5665 return {
5666 getDisplayNameForFiber,
5667 getTypeSymbol,
5668 ReactPriorityLevels,
5669 ReactTypeOfWork,
5670 ReactTypeOfSideEffect
5671 };
5672 }
5673 function attach(hook, rendererID, renderer, global) {
5674 const _getInternalReactCons = getInternalReactConstants(renderer.version)
5675 , getDisplayNameForFiber = _getInternalReactCons.getDisplayNameForFiber
5676 , getTypeSymbol = _getInternalReactCons.getTypeSymbol
5677 , ReactPriorityLevels = _getInternalReactCons.ReactPriorityLevels
5678 , ReactTypeOfWork = _getInternalReactCons.ReactTypeOfWork
5679 , ReactTypeOfSideEffect = _getInternalReactCons.ReactTypeOfSideEffect;
5680
5681 const NoFlags = ReactTypeOfSideEffect.NoFlags
5682 , PerformedWork = ReactTypeOfSideEffect.PerformedWork
5683 , Placement = ReactTypeOfSideEffect.Placement;
5684 const FunctionComponent = ReactTypeOfWork.FunctionComponent
5685 , ClassComponent = ReactTypeOfWork.ClassComponent
5686 , ContextConsumer = ReactTypeOfWork.ContextConsumer
5687 , DehydratedSuspenseComponent = ReactTypeOfWork.DehydratedSuspenseComponent
5688 , Fragment = ReactTypeOfWork.Fragment
5689 , ForwardRef = ReactTypeOfWork.ForwardRef
5690 , HostRoot = ReactTypeOfWork.HostRoot
5691 , HostPortal = ReactTypeOfWork.HostPortal
5692 , HostComponent = ReactTypeOfWork.HostComponent
5693 , HostText = ReactTypeOfWork.HostText
5694 , IncompleteClassComponent = ReactTypeOfWork.IncompleteClassComponent
5695 , IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent
5696 , MemoComponent = ReactTypeOfWork.MemoComponent
5697 , OffscreenComponent = ReactTypeOfWork.OffscreenComponent
5698 , SimpleMemoComponent = ReactTypeOfWork.SimpleMemoComponent
5699 , SuspenseComponent = ReactTypeOfWork.SuspenseComponent
5700 , SuspenseListComponent = ReactTypeOfWork.SuspenseListComponent;
5701 const ImmediatePriority = ReactPriorityLevels.ImmediatePriority
5702 , UserBlockingPriority = ReactPriorityLevels.UserBlockingPriority
5703 , NormalPriority = ReactPriorityLevels.NormalPriority
5704 , LowPriority = ReactPriorityLevels.LowPriority
5705 , IdlePriority = ReactPriorityLevels.IdlePriority
5706 , NoPriority = ReactPriorityLevels.NoPriority;
5707 const overrideHookState = renderer.overrideHookState
5708 , overrideHookStateDeletePath = renderer.overrideHookStateDeletePath
5709 , overrideHookStateRenamePath = renderer.overrideHookStateRenamePath
5710 , overrideProps = renderer.overrideProps
5711 , overridePropsDeletePath = renderer.overridePropsDeletePath
5712 , overridePropsRenamePath = renderer.overridePropsRenamePath
5713 , setSuspenseHandler = renderer.setSuspenseHandler
5714 , scheduleUpdate = renderer.scheduleUpdate;
5715 const supportsTogglingSuspense = typeof setSuspenseHandler === 'function' && typeof scheduleUpdate === 'function';
5716 // Patching the console enables DevTools to do a few useful things:
5717 // * Append component stacks to warnings and error messages
5718 // * Disable logging during re-renders to inspect hooks (see inspectHooksOfFiber)
5719 //
5720 // Don't patch in test environments because we don't want to interfere with Jest's own console overrides.
5721
5722 if (true) {
5723 Object(backend_console["b"/* registerRenderer */
5724 ])(renderer);
5725 // The renderer interface can't read these preferences directly,
5726 // because it is stored in localStorage within the context of the extension.
5727 // It relies on the extension to pass the preference through via the global.
5728
5729 const appendComponentStack = window.__REACT_DEVTOOLS_APPEND_COMPONENT_STACK__ !== false;
5730 const breakOnConsoleErrors = window.__REACT_DEVTOOLS_BREAK_ON_CONSOLE_ERRORS__ === true;
5731
5732 if (appendComponentStack || breakOnConsoleErrors) {
5733 Object(backend_console["a"/* patch */
5734 ])({
5735 appendComponentStack,
5736 breakOnConsoleErrors
5737 });
5738 }
5739 }
5740
5741 const debug = (name,fiber,parentFiber)=>{
5742 if (constants["p"/* __DEBUG__ */
5743 ]) {
5744 const displayName = getDisplayNameForFiber(fiber) || 'null';
5745 const id = getFiberID(fiber);
5746 const parentDisplayName = parentFiber != null && getDisplayNameForFiber(parentFiber) || 'null';
5747 const parentID = parentFiber ? getFiberID(parentFiber) : '';
5748 // NOTE: calling getFiberID or getPrimaryFiber is unsafe here
5749 // because it will put them in the map. For now, we'll omit them.
5750 // TODO: better debugging story for this.
5751
5752 console.log(`[renderer] %c${name} %c${displayName} (${id}) %c${parentFiber ? `${parentDisplayName} (${parentID})` : ''}`, 'color: red; font-weight: bold;', 'color: blue;', 'color: purple;');
5753 }
5754 }
5755 ;
5756 // Configurable Components tree filters.
5757
5758 const hideElementsWithDisplayNames = new Set();
5759 const hideElementsWithPaths = new Set();
5760 const hideElementsWithTypes = new Set();
5761 // Highlight updates
5762
5763 let traceUpdatesEnabled = false;
5764 const traceUpdatesForNodes = new Set();
5765
5766 function applyComponentFilters(componentFilters) {
5767 hideElementsWithTypes.clear();
5768 hideElementsWithDisplayNames.clear();
5769 hideElementsWithPaths.clear();
5770 componentFilters.forEach(componentFilter=>{
5771 if (!componentFilter.isEnabled) {
5772 return;
5773 }
5774
5775 switch (componentFilter.type) {
5776 case types["a"/* ComponentFilterDisplayName */
5777 ]:
5778 if (componentFilter.isValid && componentFilter.value !== '') {
5779 hideElementsWithDisplayNames.add(new RegExp(componentFilter.value,'i'));
5780 }
5781
5782 break;
5783
5784 case types["b"/* ComponentFilterElementType */
5785 ]:
5786 hideElementsWithTypes.add(componentFilter.value);
5787 break;
5788
5789 case types["d"/* ComponentFilterLocation */
5790 ]:
5791 if (componentFilter.isValid && componentFilter.value !== '') {
5792 hideElementsWithPaths.add(new RegExp(componentFilter.value,'i'));
5793 }
5794
5795 break;
5796
5797 case types["c"/* ComponentFilterHOC */
5798 ]:
5799 hideElementsWithDisplayNames.add(new RegExp('\\('));
5800 break;
5801
5802 default:
5803 console.warn(`Invalid component filter type "${componentFilter.type}"`);
5804 break;
5805 }
5806 }
5807 );
5808 }
5809 // The renderer interface can't read saved component filters directly,
5810 // because they are stored in localStorage within the context of the extension.
5811 // Instead it relies on the extension to pass filters through.
5812
5813 if (window.__REACT_DEVTOOLS_COMPONENT_FILTERS__ != null) {
5814 applyComponentFilters(window.__REACT_DEVTOOLS_COMPONENT_FILTERS__);
5815 } else {
5816 // Unfortunately this feature is not expected to work for React Native for now.
5817 // It would be annoying for us to spam YellowBox warnings with unactionable stuff,
5818 // so for now just skip this message...
5819 //console.warn('⚛️ DevTools: Could not locate saved component filters');
5820 // Fallback to assuming the default filters in this case.
5821 applyComponentFilters(Object(utils["g"/* getDefaultComponentFilters */
5822 ])());
5823 }
5824 // If necessary, we can revisit optimizing this operation.
5825 // For example, we could add a new recursive unmount tree operation.
5826 // The unmount operations are already significantly smaller than mount operations though.
5827 // This is something to keep in mind for later.
5828
5829 function updateComponentFilters(componentFilters) {
5830 if (isProfiling) {
5831 // Re-mounting a tree while profiling is in progress might break a lot of assumptions.
5832 // If necessary, we could support this- but it doesn't seem like a necessary use case.
5833 throw Error('Cannot modify filter preferences while profiling');
5834 }
5835 // Recursively unmount all roots.
5836
5837 hook.getFiberRoots(rendererID).forEach(root=>{
5838 currentRootID = getFiberID(getPrimaryFiber(root.current));
5839 unmountFiberChildrenRecursively(root.current);
5840 recordUnmount(root.current, false);
5841 currentRootID = -1;
5842 }
5843 );
5844 applyComponentFilters(componentFilters);
5845 // Reset pseudo counters so that new path selections will be persisted.
5846
5847 rootDisplayNameCounter.clear();
5848 // Recursively re-mount all roots with new filter criteria applied.
5849
5850 hook.getFiberRoots(rendererID).forEach(root=>{
5851 currentRootID = getFiberID(getPrimaryFiber(root.current));
5852 setRootPseudoKey(currentRootID, root.current);
5853 mountFiberRecursively(root.current, null, false, false);
5854 flushPendingEvents(root);
5855 currentRootID = -1;
5856 }
5857 );
5858 }
5859 // NOTICE Keep in sync with get*ForFiber methods
5860
5861 function shouldFilterFiber(fiber) {
5862 const _debugSource = fiber._debugSource
5863 , tag = fiber.tag
5864 , type = fiber.type;
5865
5866 switch (tag) {
5867 case DehydratedSuspenseComponent:
5868 // TODO: ideally we would show dehydrated Suspense immediately.
5869 // However, it has some special behavior (like disconnecting
5870 // an alternate and turning into real Suspense) which breaks DevTools.
5871 // For now, ignore it, and only show it once it gets hydrated.
5872 // https://github.com/bvaughn/react-devtools-experimental/issues/197
5873 return true;
5874
5875 case HostPortal:
5876 case HostText:
5877 case Fragment:
5878 case OffscreenComponent:
5879 return true;
5880
5881 case HostRoot:
5882 // It is never valid to filter the root element.
5883 return false;
5884
5885 default:
5886 const typeSymbol = getTypeSymbol(type);
5887
5888 switch (typeSymbol) {
5889 case ReactSymbols["c"/* CONCURRENT_MODE_NUMBER */
5890 ]:
5891 case ReactSymbols["d"/* CONCURRENT_MODE_SYMBOL_STRING */
5892 ]:
5893 case ReactSymbols["g"/* DEPRECATED_ASYNC_MODE_SYMBOL_STRING */
5894 ]:
5895 case ReactSymbols["t"/* STRICT_MODE_NUMBER */
5896 ]:
5897 case ReactSymbols["u"/* STRICT_MODE_SYMBOL_STRING */
5898 ]:
5899 return true;
5900
5901 default:
5902 break;
5903 }
5904
5905 }
5906
5907 const elementType = getElementTypeForFiber(fiber);
5908
5909 if (hideElementsWithTypes.has(elementType)) {
5910 return true;
5911 }
5912
5913 if (hideElementsWithDisplayNames.size > 0) {
5914 const displayName = getDisplayNameForFiber(fiber);
5915
5916 if (displayName != null) {
5917 // eslint-disable-next-line no-for-of-loops/no-for-of-loops
5918 var _iterator = _createForOfIteratorHelper(hideElementsWithDisplayNames), _step;
5919
5920 try {
5921 for (_iterator.s(); !(_step = _iterator.n()).done; ) {
5922 const displayNameRegExp = _step.value;
5923
5924 if (displayNameRegExp.test(displayName)) {
5925 return true;
5926 }
5927 }
5928 } catch (err) {
5929 _iterator.e(err);
5930 } finally {
5931 _iterator.f();
5932 }
5933 }
5934 }
5935
5936 if (_debugSource != null && hideElementsWithPaths.size > 0) {
5937 const fileName = _debugSource.fileName;
5938 // eslint-disable-next-line no-for-of-loops/no-for-of-loops
5939
5940 var _iterator2 = _createForOfIteratorHelper(hideElementsWithPaths), _step2;
5941
5942 try {
5943 for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
5944 const pathRegExp = _step2.value;
5945
5946 if (pathRegExp.test(fileName)) {
5947 return true;
5948 }
5949 }
5950 } catch (err) {
5951 _iterator2.e(err);
5952 } finally {
5953 _iterator2.f();
5954 }
5955 }
5956
5957 return false;
5958 }
5959 // NOTICE Keep in sync with shouldFilterFiber() and other get*ForFiber methods
5960
5961 function getElementTypeForFiber(fiber) {
5962 const type = fiber.type
5963 , tag = fiber.tag;
5964
5965 switch (tag) {
5966 case ClassComponent:
5967 case IncompleteClassComponent:
5968 return types["e"/* ElementTypeClass */
5969 ];
5970
5971 case FunctionComponent:
5972 case IndeterminateComponent:
5973 return types["h"/* ElementTypeFunction */
5974 ];
5975
5976 case ForwardRef:
5977 return types["g"/* ElementTypeForwardRef */
5978 ];
5979
5980 case HostRoot:
5981 return types["m"/* ElementTypeRoot */
5982 ];
5983
5984 case HostComponent:
5985 return types["i"/* ElementTypeHostComponent */
5986 ];
5987
5988 case HostPortal:
5989 case HostText:
5990 case Fragment:
5991 return types["k"/* ElementTypeOtherOrUnknown */
5992 ];
5993
5994 case MemoComponent:
5995 case SimpleMemoComponent:
5996 return types["j"/* ElementTypeMemo */
5997 ];
5998
5999 case SuspenseComponent:
6000 return types["n"/* ElementTypeSuspense */
6001 ];
6002
6003 case SuspenseListComponent:
6004 return types["o"/* ElementTypeSuspenseList */
6005 ];
6006
6007 default:
6008 const typeSymbol = getTypeSymbol(type);
6009
6010 switch (typeSymbol) {
6011 case ReactSymbols["c"/* CONCURRENT_MODE_NUMBER */
6012 ]:
6013 case ReactSymbols["d"/* CONCURRENT_MODE_SYMBOL_STRING */
6014 ]:
6015 case ReactSymbols["g"/* DEPRECATED_ASYNC_MODE_SYMBOL_STRING */
6016 ]:
6017 return types["k"/* ElementTypeOtherOrUnknown */
6018 ];
6019
6020 case ReactSymbols["p"/* PROVIDER_NUMBER */
6021 ]:
6022 case ReactSymbols["q"/* PROVIDER_SYMBOL_STRING */
6023 ]:
6024 return types["f"/* ElementTypeContext */
6025 ];
6026
6027 case ReactSymbols["e"/* CONTEXT_NUMBER */
6028 ]:
6029 case ReactSymbols["f"/* CONTEXT_SYMBOL_STRING */
6030 ]:
6031 return types["f"/* ElementTypeContext */
6032 ];
6033
6034 case ReactSymbols["t"/* STRICT_MODE_NUMBER */
6035 ]:
6036 case ReactSymbols["u"/* STRICT_MODE_SYMBOL_STRING */
6037 ]:
6038 return types["k"/* ElementTypeOtherOrUnknown */
6039 ];
6040
6041 case ReactSymbols["n"/* PROFILER_NUMBER */
6042 ]:
6043 case ReactSymbols["o"/* PROFILER_SYMBOL_STRING */
6044 ]:
6045 return types["l"/* ElementTypeProfiler */
6046 ];
6047
6048 default:
6049 return types["k"/* ElementTypeOtherOrUnknown */
6050 ];
6051 }
6052
6053 }
6054 }
6055 // This is a slightly annoying indirection.
6056 // It is currently necessary because DevTools wants to use unique objects as keys for instances.
6057 // However fibers have two versions.
6058 // We use this set to remember first encountered fiber for each conceptual instance.
6059
6060 function getPrimaryFiber(fiber) {
6061 if (primaryFibers.has(fiber)) {
6062 return fiber;
6063 }
6064
6065 const alternate = fiber.alternate;
6066
6067 if (alternate != null && primaryFibers.has(alternate)) {
6068 return alternate;
6069 }
6070
6071 primaryFibers.add(fiber);
6072 return fiber;
6073 }
6074
6075 const fiberToIDMap = new Map();
6076 const idToFiberMap = new Map();
6077 const primaryFibers = new Set();
6078 // When profiling is supported, we store the latest tree base durations for each Fiber.
6079 // This is so that we can quickly capture a snapshot of those values if profiling starts.
6080 // If we didn't store these values, we'd have to crawl the tree when profiling started,
6081 // and use a slow path to find each of the current Fibers.
6082
6083 const idToTreeBaseDurationMap = new Map();
6084 // When profiling is supported, we store the latest tree base durations for each Fiber.
6085 // This map enables us to filter these times by root when sending them to the frontend.
6086
6087 const idToRootMap = new Map();
6088 // When a mount or update is in progress, this value tracks the root that is being operated on.
6089
6090 let currentRootID = -1;
6091
6092 function getFiberID(primaryFiber) {
6093 if (!fiberToIDMap.has(primaryFiber)) {
6094 const id = Object(utils["l"/* getUID */
6095 ])();
6096 fiberToIDMap.set(primaryFiber, id);
6097 idToFiberMap.set(id, primaryFiber);
6098 }
6099
6100 return fiberToIDMap.get(primaryFiber);
6101 }
6102
6103 function getChangeDescription(prevFiber, nextFiber) {
6104 switch (getElementTypeForFiber(nextFiber)) {
6105 case types["e"/* ElementTypeClass */
6106 ]:
6107 case types["h"/* ElementTypeFunction */
6108 ]:
6109 case types["j"/* ElementTypeMemo */
6110 ]:
6111 case types["g"/* ElementTypeForwardRef */
6112 ]:
6113 if (prevFiber === null) {
6114 return {
6115 context: null,
6116 didHooksChange: false,
6117 isFirstMount: true,
6118 props: null,
6119 state: null
6120 };
6121 } else {
6122 return {
6123 context: getContextChangedKeys(nextFiber),
6124 didHooksChange: didHooksChange(prevFiber.memoizedState, nextFiber.memoizedState),
6125 isFirstMount: false,
6126 props: getChangedKeys(prevFiber.memoizedProps, nextFiber.memoizedProps),
6127 state: getChangedKeys(prevFiber.memoizedState, nextFiber.memoizedState)
6128 };
6129 }
6130
6131 default:
6132 return null;
6133 }
6134 }
6135
6136 function updateContextsForFiber(fiber) {
6137 switch (getElementTypeForFiber(fiber)) {
6138 case types["e"/* ElementTypeClass */
6139 ]:
6140 if (idToContextsMap !== null) {
6141 const id = getFiberID(getPrimaryFiber(fiber));
6142 const contexts = getContextsForFiber(fiber);
6143
6144 if (contexts !== null) {
6145 idToContextsMap.set(id, contexts);
6146 }
6147 }
6148
6149 break;
6150
6151 default:
6152 break;
6153 }
6154 }
6155 // Differentiates between a null context value and no context.
6156
6157 const NO_CONTEXT = {};
6158
6159 function getContextsForFiber(fiber) {
6160 switch (getElementTypeForFiber(fiber)) {
6161 case types["e"/* ElementTypeClass */
6162 ]:
6163 const instance = fiber.stateNode;
6164 let legacyContext = NO_CONTEXT;
6165 let modernContext = NO_CONTEXT;
6166
6167 if (instance != null) {
6168 if (instance.constructor && instance.constructor.contextType != null) {
6169 modernContext = instance.context;
6170 } else {
6171 legacyContext = instance.context;
6172
6173 if (legacyContext && Object.keys(legacyContext).length === 0) {
6174 legacyContext = NO_CONTEXT;
6175 }
6176 }
6177 }
6178
6179 return [legacyContext, modernContext];
6180
6181 default:
6182 return null;
6183 }
6184 }
6185 // Record all contexts at the time profiling is started.
6186 // Fibers only store the current context value,
6187 // so we need to track them separately in order to determine changed keys.
6188
6189 function crawlToInitializeContextsMap(fiber) {
6190 updateContextsForFiber(fiber);
6191 let current = fiber.child;
6192
6193 while (current !== null) {
6194 crawlToInitializeContextsMap(current);
6195 current = current.sibling;
6196 }
6197 }
6198
6199 function getContextChangedKeys(fiber) {
6200 switch (getElementTypeForFiber(fiber)) {
6201 case types["e"/* ElementTypeClass */
6202 ]:
6203 if (idToContextsMap !== null) {
6204 const id = getFiberID(getPrimaryFiber(fiber));
6205 const prevContexts = idToContextsMap.has(id) ? idToContextsMap.get(id) : null;
6206 const nextContexts = getContextsForFiber(fiber);
6207
6208 if (prevContexts == null || nextContexts == null) {
6209 return null;
6210 }
6211
6212 const _prevContexts = _slicedToArray(prevContexts, 2)
6213 , prevLegacyContext = _prevContexts[0]
6214 , prevModernContext = _prevContexts[1];
6215
6216 const _nextContexts = _slicedToArray(nextContexts, 2)
6217 , nextLegacyContext = _nextContexts[0]
6218 , nextModernContext = _nextContexts[1];
6219
6220 if (nextLegacyContext !== NO_CONTEXT) {
6221 return getChangedKeys(prevLegacyContext, nextLegacyContext);
6222 } else if (nextModernContext !== NO_CONTEXT) {
6223 return prevModernContext !== nextModernContext;
6224 }
6225 }
6226
6227 break;
6228
6229 default:
6230 break;
6231 }
6232
6233 return null;
6234 }
6235
6236 function didHooksChange(prev, next) {
6237 if (prev == null || next == null) {
6238 return false;
6239 }
6240 // We can't report anything meaningful for hooks changes.
6241
6242 if (next.hasOwnProperty('baseState') && next.hasOwnProperty('memoizedState') && next.hasOwnProperty('next') && next.hasOwnProperty('queue')) {
6243 while (next !== null) {
6244 if (next.memoizedState !== prev.memoizedState) {
6245 return true;
6246 } else {
6247 next = next.next;
6248 prev = prev.next;
6249 }
6250 }
6251 }
6252
6253 return false;
6254 }
6255
6256 function getChangedKeys(prev, next) {
6257 if (prev == null || next == null) {
6258 return null;
6259 }
6260 // We can't report anything meaningful for hooks changes.
6261
6262 if (next.hasOwnProperty('baseState') && next.hasOwnProperty('memoizedState') && next.hasOwnProperty('next') && next.hasOwnProperty('queue')) {
6263 return null;
6264 }
6265
6266 const keys = new Set([...Object.keys(prev), ...Object.keys(next)]);
6267 const changedKeys = [];
6268 // eslint-disable-next-line no-for-of-loops/no-for-of-loops
6269
6270 var _iterator3 = _createForOfIteratorHelper(keys), _step3;
6271
6272 try {
6273 for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
6274 const key = _step3.value;
6275
6276 if (prev[key] !== next[key]) {
6277 changedKeys.push(key);
6278 }
6279 }
6280 } catch (err) {
6281 _iterator3.e(err);
6282 } finally {
6283 _iterator3.f();
6284 }
6285
6286 return changedKeys;
6287 }
6288 // eslint-disable-next-line no-unused-vars
6289
6290 function didFiberRender(prevFiber, nextFiber) {
6291 switch (nextFiber.tag) {
6292 case ClassComponent:
6293 case FunctionComponent:
6294 case ContextConsumer:
6295 case MemoComponent:
6296 case SimpleMemoComponent:
6297 // For types that execute user code, we check PerformedWork effect.
6298 // We don't reflect bailouts (either referential or sCU) in DevTools.
6299 // eslint-disable-next-line no-bitwise
6300 return (getFiberFlags(nextFiber) & PerformedWork) === PerformedWork;
6301 // Note: ContextConsumer only gets PerformedWork effect in 16.3.3+
6302 // so it won't get highlighted with React 16.3.0 to 16.3.2.
6303
6304 default:
6305 // For host components and other types, we compare inputs
6306 // to determine whether something is an update.
6307 return prevFiber.memoizedProps !== nextFiber.memoizedProps || prevFiber.memoizedState !== nextFiber.memoizedState || prevFiber.ref !== nextFiber.ref;
6308 }
6309 }
6310
6311 const pendingOperations = [];
6312 const pendingRealUnmountedIDs = [];
6313 const pendingSimulatedUnmountedIDs = [];
6314 let pendingOperationsQueue = [];
6315 const pendingStringTable = new Map();
6316 let pendingStringTableLength = 0;
6317 let pendingUnmountedRootID = null;
6318
6319 function pushOperation(op) {
6320 if (false) {}
6321
6322 pendingOperations.push(op);
6323 }
6324
6325 function flushPendingEvents(root) {
6326 if (pendingOperations.length === 0 && pendingRealUnmountedIDs.length === 0 && pendingSimulatedUnmountedIDs.length === 0 && pendingUnmountedRootID === null) {
6327 // If we aren't profiling, we can just bail out here.
6328 // No use sending an empty update over the bridge.
6329 //
6330 // The Profiler stores metadata for each commit and reconstructs the app tree per commit using:
6331 // (1) an initial tree snapshot and
6332 // (2) the operations array for each commit
6333 // Because of this, it's important that the operations and metadata arrays align,
6334 // So it's important not to omit even empty operations while profiling is active.
6335 if (!isProfiling) {
6336 return;
6337 }
6338 }
6339
6340 const numUnmountIDs = pendingRealUnmountedIDs.length + pendingSimulatedUnmountedIDs.length + (pendingUnmountedRootID === null ? 0 : 1);
6341 const operations = new Array(// Identify which renderer this update is coming from.
6342 2 + // [rendererID, rootFiberID]
6343 // How big is the string table?
6344 1 + // [stringTableLength]
6345 // Then goes the actual string table.
6346 pendingStringTableLength + (// All unmounts are batched in a single message.
6347 // [TREE_OPERATION_REMOVE, removedIDLength, ...ids]
6348 numUnmountIDs > 0 ? 2 + numUnmountIDs : 0) + // Regular operations
6349 pendingOperations.length);
6350 // Identify which renderer this update is coming from.
6351 // This enables roots to be mapped to renderers,
6352 // Which in turn enables fiber props, states, and hooks to be inspected.
6353
6354 let i = 0;
6355 operations[i++] = rendererID;
6356 operations[i++] = currentRootID;
6357 // Use this ID in case the root was unmounted!
6358 // Now fill in the string table.
6359 // [stringTableLength, str1Length, ...str1, str2Length, ...str2, ...]
6360
6361 operations[i++] = pendingStringTableLength;
6362 pendingStringTable.forEach((value,key)=>{
6363 operations[i++] = key.length;
6364 const encodedKey = Object(utils["s"/* utfEncodeString */
6365 ])(key);
6366
6367 for (let j = 0; j < encodedKey.length; j++) {
6368 operations[i + j] = encodedKey[j];
6369 }
6370
6371 i += key.length;
6372 }
6373 );
6374
6375 if (numUnmountIDs > 0) {
6376 // All unmounts except roots are batched in a single message.
6377 operations[i++] = constants["l"/* TREE_OPERATION_REMOVE */
6378 ];
6379 // The first number is how many unmounted IDs we're gonna send.
6380
6381 operations[i++] = numUnmountIDs;
6382 // Fill in the real unmounts in the reverse order.
6383 // They were inserted parents-first by React, but we want children-first.
6384 // So we traverse our array backwards.
6385
6386 for (let j = pendingRealUnmountedIDs.length - 1; j >= 0; j--) {
6387 operations[i++] = pendingRealUnmountedIDs[j];
6388 }
6389 // Fill in the simulated unmounts (hidden Suspense subtrees) in their order.
6390 // (We want children to go before parents.)
6391 // They go *after* the real unmounts because we know for sure they won't be
6392 // children of already pushed "real" IDs. If they were, we wouldn't be able
6393 // to discover them during the traversal, as they would have been deleted.
6394
6395 for (let j = 0; j < pendingSimulatedUnmountedIDs.length; j++) {
6396 operations[i + j] = pendingSimulatedUnmountedIDs[j];
6397 }
6398
6399 i += pendingSimulatedUnmountedIDs.length;
6400 // The root ID should always be unmounted last.
6401
6402 if (pendingUnmountedRootID !== null) {
6403 operations[i] = pendingUnmountedRootID;
6404 i++;
6405 }
6406 }
6407 // Fill in the rest of the operations.
6408
6409 for (let j = 0; j < pendingOperations.length; j++) {
6410 operations[i + j] = pendingOperations[j];
6411 }
6412
6413 i += pendingOperations.length;
6414 // Let the frontend know about tree operations.
6415 // The first value in this array will identify which root it corresponds to,
6416 // so we do no longer need to dispatch a separate root-committed event.
6417
6418 if (pendingOperationsQueue !== null) {
6419 // Until the frontend has been connected, store the tree operations.
6420 // This will let us avoid walking the tree later when the frontend connects,
6421 // and it enables the Profiler's reload-and-profile functionality to work as well.
6422 pendingOperationsQueue.push(operations);
6423 } else {
6424 // If we've already connected to the frontend, just pass the operations through.
6425 hook.emit('operations', operations);
6426 }
6427
6428 pendingOperations.length = 0;
6429 pendingRealUnmountedIDs.length = 0;
6430 pendingSimulatedUnmountedIDs.length = 0;
6431 pendingUnmountedRootID = null;
6432 pendingStringTable.clear();
6433 pendingStringTableLength = 0;
6434 }
6435
6436 function getStringID(str) {
6437 if (str === null) {
6438 return 0;
6439 }
6440
6441 const existingID = pendingStringTable.get(str);
6442
6443 if (existingID !== undefined) {
6444 return existingID;
6445 }
6446
6447 const stringID = pendingStringTable.size + 1;
6448 pendingStringTable.set(str, stringID);
6449 // The string table total length needs to account
6450 // both for the string length, and for the array item
6451 // that contains the length itself. Hence + 1.
6452
6453 pendingStringTableLength += str.length + 1;
6454 return stringID;
6455 }
6456
6457 function recordMount(fiber, parentFiber) {
6458 if (constants["p"/* __DEBUG__ */
6459 ]) {
6460 debug('recordMount()', fiber, parentFiber);
6461 }
6462
6463 const isRoot = fiber.tag === HostRoot;
6464 const id = getFiberID(getPrimaryFiber(fiber));
6465 const hasOwnerMetadata = fiber.hasOwnProperty('_debugOwner');
6466 const isProfilingSupported = fiber.hasOwnProperty('treeBaseDuration');
6467
6468 if (isRoot) {
6469 pushOperation(constants["k"/* TREE_OPERATION_ADD */
6470 ]);
6471 pushOperation(id);
6472 pushOperation(types["m"/* ElementTypeRoot */
6473 ]);
6474 pushOperation(isProfilingSupported ? 1 : 0);
6475 pushOperation(hasOwnerMetadata ? 1 : 0);
6476
6477 if (isProfiling) {
6478 if (displayNamesByRootID !== null) {
6479 displayNamesByRootID.set(id, getDisplayNameForRoot(fiber));
6480 }
6481 }
6482 } else {
6483 const key = fiber.key;
6484 const displayName = getDisplayNameForFiber(fiber);
6485 const elementType = getElementTypeForFiber(fiber);
6486 const _debugOwner = fiber._debugOwner;
6487 const ownerID = _debugOwner != null ? getFiberID(getPrimaryFiber(_debugOwner)) : 0;
6488 const parentID = parentFiber ? getFiberID(getPrimaryFiber(parentFiber)) : 0;
6489 const displayNameStringID = getStringID(displayName);
6490 // This check is a guard to handle a React element that has been modified
6491 // in such a way as to bypass the default stringification of the "key" property.
6492
6493 const keyString = key === null ? null : '' + key;
6494 const keyStringID = getStringID(keyString);
6495 pushOperation(constants["k"/* TREE_OPERATION_ADD */
6496 ]);
6497 pushOperation(id);
6498 pushOperation(elementType);
6499 pushOperation(parentID);
6500 pushOperation(ownerID);
6501 pushOperation(displayNameStringID);
6502 pushOperation(keyStringID);
6503 }
6504
6505 if (isProfilingSupported) {
6506 idToRootMap.set(id, currentRootID);
6507 recordProfilingDurations(fiber);
6508 }
6509 }
6510
6511 function recordUnmount(fiber, isSimulated) {
6512 if (constants["p"/* __DEBUG__ */
6513 ]) {
6514 debug('recordUnmount()', fiber);
6515 }
6516
6517 if (trackedPathMatchFiber !== null) {
6518 // We're in the process of trying to restore previous selection.
6519 // If this fiber matched but is being unmounted, there's no use trying.
6520 // Reset the state so we don't keep holding onto it.
6521 if (fiber === trackedPathMatchFiber || fiber === trackedPathMatchFiber.alternate) {
6522 setTrackedPath(null);
6523 }
6524 }
6525
6526 const isRoot = fiber.tag === HostRoot;
6527 const primaryFiber = getPrimaryFiber(fiber);
6528
6529 if (!fiberToIDMap.has(primaryFiber)) {
6530 // If we've never seen this Fiber, it might be because
6531 // it is inside a non-current Suspense fragment tree,
6532 // and so the store is not even aware of it.
6533 // In that case we can just ignore it, or otherwise
6534 // there will be errors later on.
6535 primaryFibers.delete(primaryFiber);
6536 // TODO: this is fragile and can obscure actual bugs.
6537
6538 return;
6539 }
6540
6541 const id = getFiberID(primaryFiber);
6542
6543 if (isRoot) {
6544 // Roots must be removed only after all children (pending and simulated) have been removed.
6545 // So we track it separately.
6546 pendingUnmountedRootID = id;
6547 } else if (!shouldFilterFiber(fiber)) {
6548 // To maintain child-first ordering,
6549 // we'll push it into one of these queues,
6550 // and later arrange them in the correct order.
6551 if (isSimulated) {
6552 pendingSimulatedUnmountedIDs.push(id);
6553 } else {
6554 pendingRealUnmountedIDs.push(id);
6555 }
6556 }
6557
6558 fiberToIDMap.delete(primaryFiber);
6559 idToFiberMap.delete(id);
6560 primaryFibers.delete(primaryFiber);
6561 const isProfilingSupported = fiber.hasOwnProperty('treeBaseDuration');
6562
6563 if (isProfilingSupported) {
6564 idToRootMap.delete(id);
6565 idToTreeBaseDurationMap.delete(id);
6566 }
6567 }
6568
6569 function mountFiberRecursively(fiber, parentFiber, traverseSiblings, traceNearestHostComponentUpdate) {
6570 if (constants["p"/* __DEBUG__ */
6571 ]) {
6572 debug('mountFiberRecursively()', fiber, parentFiber);
6573 }
6574 // If we have the tree selection from previous reload, try to match this Fiber.
6575 // Also remember whether to do the same for siblings.
6576
6577 const mightSiblingsBeOnTrackedPath = updateTrackedPathStateBeforeMount(fiber);
6578 const shouldIncludeInTree = !shouldFilterFiber(fiber);
6579
6580 if (shouldIncludeInTree) {
6581 recordMount(fiber, parentFiber);
6582 }
6583
6584 if (traceUpdatesEnabled) {
6585 if (traceNearestHostComponentUpdate) {
6586 const elementType = getElementTypeForFiber(fiber);
6587 // If an ancestor updated, we should mark the nearest host nodes for highlighting.
6588
6589 if (elementType === types["i"/* ElementTypeHostComponent */
6590 ]) {
6591 traceUpdatesForNodes.add(fiber.stateNode);
6592 traceNearestHostComponentUpdate = false;
6593 }
6594 }
6595 // We intentionally do not re-enable the traceNearestHostComponentUpdate flag in this branch,
6596 // because we don't want to highlight every host node inside of a newly mounted subtree.
6597
6598 }
6599
6600 const isSuspense = fiber.tag === ReactTypeOfWork.SuspenseComponent;
6601
6602 if (isSuspense) {
6603 const isTimedOut = fiber.memoizedState !== null;
6604
6605 if (isTimedOut) {
6606 // Special case: if Suspense mounts in a timed-out state,
6607 // get the fallback child from the inner fragment and mount
6608 // it as if it was our own child. Updates handle this too.
6609 const primaryChildFragment = fiber.child;
6610 const fallbackChildFragment = primaryChildFragment ? primaryChildFragment.sibling : null;
6611 const fallbackChild = fallbackChildFragment ? fallbackChildFragment.child : null;
6612
6613 if (fallbackChild !== null) {
6614 mountFiberRecursively(fallbackChild, shouldIncludeInTree ? fiber : parentFiber, true, traceNearestHostComponentUpdate);
6615 }
6616 } else {
6617 let primaryChild = null;
6618 const areSuspenseChildrenConditionallyWrapped = OffscreenComponent === -1;
6619
6620 if (areSuspenseChildrenConditionallyWrapped) {
6621 primaryChild = fiber.child;
6622 } else if (fiber.child !== null) {
6623 primaryChild = fiber.child.child;
6624 }
6625
6626 if (primaryChild !== null) {
6627 mountFiberRecursively(primaryChild, shouldIncludeInTree ? fiber : parentFiber, true, traceNearestHostComponentUpdate);
6628 }
6629 }
6630 } else {
6631 if (fiber.child !== null) {
6632 mountFiberRecursively(fiber.child, shouldIncludeInTree ? fiber : parentFiber, true, traceNearestHostComponentUpdate);
6633 }
6634 }
6635 // We're exiting this Fiber now, and entering its siblings.
6636 // If we have selection to restore, we might need to re-activate tracking.
6637
6638 updateTrackedPathStateAfterMount(mightSiblingsBeOnTrackedPath);
6639
6640 if (traverseSiblings && fiber.sibling !== null) {
6641 mountFiberRecursively(fiber.sibling, parentFiber, true, traceNearestHostComponentUpdate);
6642 }
6643 }
6644 // We use this to simulate unmounting for Suspense trees
6645 // when we switch from primary to fallback.
6646
6647 function unmountFiberChildrenRecursively(fiber) {
6648 if (constants["p"/* __DEBUG__ */
6649 ]) {
6650 debug('unmountFiberChildrenRecursively()', fiber);
6651 }
6652 // We might meet a nested Suspense on our way.
6653
6654 const isTimedOutSuspense = fiber.tag === ReactTypeOfWork.SuspenseComponent && fiber.memoizedState !== null;
6655 let child = fiber.child;
6656
6657 if (isTimedOutSuspense) {
6658 // If it's showing fallback tree, let's traverse it instead.
6659 const primaryChildFragment = fiber.child;
6660 const fallbackChildFragment = primaryChildFragment ? primaryChildFragment.sibling : null;
6661 // Skip over to the real Fiber child.
6662
6663 child = fallbackChildFragment ? fallbackChildFragment.child : null;
6664 }
6665
6666 while (child !== null) {
6667 // Record simulated unmounts children-first.
6668 // We skip nodes without return because those are real unmounts.
6669 if (child.return !== null) {
6670 unmountFiberChildrenRecursively(child);
6671 recordUnmount(child, true);
6672 }
6673
6674 child = child.sibling;
6675 }
6676 }
6677
6678 function recordProfilingDurations(fiber) {
6679 const id = getFiberID(getPrimaryFiber(fiber));
6680 const actualDuration = fiber.actualDuration
6681 , treeBaseDuration = fiber.treeBaseDuration;
6682 idToTreeBaseDurationMap.set(id, treeBaseDuration || 0);
6683
6684 if (isProfiling) {
6685 const alternate = fiber.alternate;
6686 // It's important to update treeBaseDuration even if the current Fiber did not render,
6687 // because it's possible that one of its descendants did.
6688
6689 if (alternate == null || treeBaseDuration !== alternate.treeBaseDuration) {
6690 // Tree base duration updates are included in the operations typed array.
6691 // So we have to convert them from milliseconds to microseconds so we can send them as ints.
6692 const convertedTreeBaseDuration = Math.floor((treeBaseDuration || 0) * 1000);
6693 pushOperation(constants["n"/* TREE_OPERATION_UPDATE_TREE_BASE_DURATION */
6694 ]);
6695 pushOperation(id);
6696 pushOperation(convertedTreeBaseDuration);
6697 }
6698
6699 if (alternate == null || didFiberRender(alternate, fiber)) {
6700 if (actualDuration != null) {
6701 // The actual duration reported by React includes time spent working on children.
6702 // This is useful information, but it's also useful to be able to exclude child durations.
6703 // The frontend can't compute this, since the immediate children may have been filtered out.
6704 // So we need to do this on the backend.
6705 // Note that this calculated self duration is not the same thing as the base duration.
6706 // The two are calculated differently (tree duration does not accumulate).
6707 let selfDuration = actualDuration;
6708 let child = fiber.child;
6709
6710 while (child !== null) {
6711 selfDuration -= child.actualDuration || 0;
6712 child = child.sibling;
6713 }
6714 // If profiling is active, store durations for elements that were rendered during the commit.
6715 // Note that we should do this for any fiber we performed work on, regardless of its actualDuration value.
6716 // In some cases actualDuration might be 0 for fibers we worked on (particularly if we're using Date.now)
6717 // In other cases (e.g. Memo) actualDuration might be greater than 0 even if we "bailed out".
6718
6719 const metadata = currentCommitProfilingMetadata;
6720 metadata.durations.push(id, actualDuration, selfDuration);
6721 metadata.maxActualDuration = Math.max(metadata.maxActualDuration, actualDuration);
6722
6723 if (recordChangeDescriptions) {
6724 const changeDescription = getChangeDescription(alternate, fiber);
6725
6726 if (changeDescription !== null) {
6727 if (metadata.changeDescriptions !== null) {
6728 metadata.changeDescriptions.set(id, changeDescription);
6729 }
6730 }
6731
6732 updateContextsForFiber(fiber);
6733 }
6734 }
6735 }
6736 }
6737 }
6738
6739 function recordResetChildren(fiber, childSet) {
6740 if (constants["p"/* __DEBUG__ */
6741 ]) {
6742 debug('recordResetChildren()', childSet, fiber);
6743 }
6744 // The frontend only really cares about the displayName, key, and children.
6745 // The first two don't really change, so we are only concerned with the order of children here.
6746 // This is trickier than a simple comparison though, since certain types of fibers are filtered.
6747
6748 const nextChildren = [];
6749 // This is a naive implementation that shallowly recourses children.
6750 // We might want to revisit this if it proves to be too inefficient.
6751
6752 let child = childSet;
6753
6754 while (child !== null) {
6755 findReorderedChildrenRecursively(child, nextChildren);
6756 child = child.sibling;
6757 }
6758
6759 const numChildren = nextChildren.length;
6760
6761 if (numChildren < 2) {
6762 // No need to reorder.
6763 return;
6764 }
6765
6766 pushOperation(constants["m"/* TREE_OPERATION_REORDER_CHILDREN */
6767 ]);
6768 pushOperation(getFiberID(getPrimaryFiber(fiber)));
6769 pushOperation(numChildren);
6770
6771 for (let i = 0; i < nextChildren.length; i++) {
6772 pushOperation(nextChildren[i]);
6773 }
6774 }
6775
6776 function findReorderedChildrenRecursively(fiber, nextChildren) {
6777 if (!shouldFilterFiber(fiber)) {
6778 nextChildren.push(getFiberID(getPrimaryFiber(fiber)));
6779 } else {
6780 let child = fiber.child;
6781 const isTimedOutSuspense = fiber.tag === SuspenseComponent && fiber.memoizedState !== null;
6782
6783 if (isTimedOutSuspense) {
6784 // Special case: if Suspense mounts in a timed-out state,
6785 // get the fallback child from the inner fragment,
6786 // and skip over the primary child.
6787 const primaryChildFragment = fiber.child;
6788 const fallbackChildFragment = primaryChildFragment ? primaryChildFragment.sibling : null;
6789 const fallbackChild = fallbackChildFragment ? fallbackChildFragment.child : null;
6790
6791 if (fallbackChild !== null) {
6792 child = fallbackChild;
6793 }
6794 }
6795
6796 while (child !== null) {
6797 findReorderedChildrenRecursively(child, nextChildren);
6798 child = child.sibling;
6799 }
6800 }
6801 }
6802 // Returns whether closest unfiltered fiber parent needs to reset its child list.
6803
6804 function updateFiberRecursively(nextFiber, prevFiber, parentFiber, traceNearestHostComponentUpdate) {
6805 if (constants["p"/* __DEBUG__ */
6806 ]) {
6807 debug('updateFiberRecursively()', nextFiber, parentFiber);
6808 }
6809
6810 if (traceUpdatesEnabled) {
6811 const elementType = getElementTypeForFiber(nextFiber);
6812
6813 if (traceNearestHostComponentUpdate) {
6814 // If an ancestor updated, we should mark the nearest host nodes for highlighting.
6815 if (elementType === types["i"/* ElementTypeHostComponent */
6816 ]) {
6817 traceUpdatesForNodes.add(nextFiber.stateNode);
6818 traceNearestHostComponentUpdate = false;
6819 }
6820 } else {
6821 if (elementType === types["h"/* ElementTypeFunction */
6822 ] || elementType === types["e"/* ElementTypeClass */
6823 ] || elementType === types["f"/* ElementTypeContext */
6824 ]) {
6825 // Otherwise if this is a traced ancestor, flag for the nearest host descendant(s).
6826 traceNearestHostComponentUpdate = didFiberRender(prevFiber, nextFiber);
6827 }
6828 }
6829 }
6830
6831 if (mostRecentlyInspectedElement !== null && mostRecentlyInspectedElement.id === getFiberID(getPrimaryFiber(nextFiber)) && didFiberRender(prevFiber, nextFiber)) {
6832 // If this Fiber has updated, clear cached inspected data.
6833 // If it is inspected again, it may need to be re-run to obtain updated hooks values.
6834 hasElementUpdatedSinceLastInspected = true;
6835 }
6836
6837 const shouldIncludeInTree = !shouldFilterFiber(nextFiber);
6838 const isSuspense = nextFiber.tag === SuspenseComponent;
6839 let shouldResetChildren = false;
6840 // The behavior of timed-out Suspense trees is unique.
6841 // Rather than unmount the timed out content (and possibly lose important state),
6842 // React re-parents this content within a hidden Fragment while the fallback is showing.
6843 // This behavior doesn't need to be observable in the DevTools though.
6844 // It might even result in a bad user experience for e.g. node selection in the Elements panel.
6845 // The easiest fix is to strip out the intermediate Fragment fibers,
6846 // so the Elements panel and Profiler don't need to special case them.
6847 // Suspense components only have a non-null memoizedState if they're timed-out.
6848
6849 const prevDidTimeout = isSuspense && prevFiber.memoizedState !== null;
6850 const nextDidTimeOut = isSuspense && nextFiber.memoizedState !== null;
6851 // The logic below is inspired by the code paths in updateSuspenseComponent()
6852 // inside ReactFiberBeginWork in the React source code.
6853
6854 if (prevDidTimeout && nextDidTimeOut) {
6855 // Fallback -> Fallback:
6856 // 1. Reconcile fallback set.
6857 const nextFiberChild = nextFiber.child;
6858 const nextFallbackChildSet = nextFiberChild ? nextFiberChild.sibling : null;
6859 // Note: We can't use nextFiber.child.sibling.alternate
6860 // because the set is special and alternate may not exist.
6861
6862 const prevFiberChild = prevFiber.child;
6863 const prevFallbackChildSet = prevFiberChild ? prevFiberChild.sibling : null;
6864
6865 if (nextFallbackChildSet != null && prevFallbackChildSet != null && updateFiberRecursively(nextFallbackChildSet, prevFallbackChildSet, nextFiber, traceNearestHostComponentUpdate)) {
6866 shouldResetChildren = true;
6867 }
6868 } else if (prevDidTimeout && !nextDidTimeOut) {
6869 // Fallback -> Primary:
6870 // 1. Unmount fallback set
6871 // Note: don't emulate fallback unmount because React actually did it.
6872 // 2. Mount primary set
6873 const nextPrimaryChildSet = nextFiber.child;
6874
6875 if (nextPrimaryChildSet !== null) {
6876 mountFiberRecursively(nextPrimaryChildSet, shouldIncludeInTree ? nextFiber : parentFiber, true, traceNearestHostComponentUpdate);
6877 }
6878
6879 shouldResetChildren = true;
6880 } else if (!prevDidTimeout && nextDidTimeOut) {
6881 // Primary -> Fallback:
6882 // 1. Hide primary set
6883 // This is not a real unmount, so it won't get reported by React.
6884 // We need to manually walk the previous tree and record unmounts.
6885 unmountFiberChildrenRecursively(prevFiber);
6886 // 2. Mount fallback set
6887
6888 const nextFiberChild = nextFiber.child;
6889 const nextFallbackChildSet = nextFiberChild ? nextFiberChild.sibling : null;
6890
6891 if (nextFallbackChildSet != null) {
6892 mountFiberRecursively(nextFallbackChildSet, shouldIncludeInTree ? nextFiber : parentFiber, true, traceNearestHostComponentUpdate);
6893 shouldResetChildren = true;
6894 }
6895 } else {
6896 // Common case: Primary -> Primary.
6897 // This is the same code path as for non-Suspense fibers.
6898 if (nextFiber.child !== prevFiber.child) {
6899 // If the first child is different, we need to traverse them.
6900 // Each next child will be either a new child (mount) or an alternate (update).
6901 let nextChild = nextFiber.child;
6902 let prevChildAtSameIndex = prevFiber.child;
6903
6904 while (nextChild) {
6905 // We already know children will be referentially different because
6906 // they are either new mounts or alternates of previous children.
6907 // Schedule updates and mounts depending on whether alternates exist.
6908 // We don't track deletions here because they are reported separately.
6909 if (nextChild.alternate) {
6910 const prevChild = nextChild.alternate;
6911
6912 if (updateFiberRecursively(nextChild, prevChild, shouldIncludeInTree ? nextFiber : parentFiber, traceNearestHostComponentUpdate)) {
6913 // If a nested tree child order changed but it can't handle its own
6914 // child order invalidation (e.g. because it's filtered out like host nodes),
6915 // propagate the need to reset child order upwards to this Fiber.
6916 shouldResetChildren = true;
6917 }
6918 // However we also keep track if the order of the children matches
6919 // the previous order. They are always different referentially, but
6920 // if the instances line up conceptually we'll want to know that.
6921
6922 if (prevChild !== prevChildAtSameIndex) {
6923 shouldResetChildren = true;
6924 }
6925 } else {
6926 mountFiberRecursively(nextChild, shouldIncludeInTree ? nextFiber : parentFiber, false, traceNearestHostComponentUpdate);
6927 shouldResetChildren = true;
6928 }
6929 // Try the next child.
6930
6931 nextChild = nextChild.sibling;
6932 // Advance the pointer in the previous list so that we can
6933 // keep comparing if they line up.
6934
6935 if (!shouldResetChildren && prevChildAtSameIndex !== null) {
6936 prevChildAtSameIndex = prevChildAtSameIndex.sibling;
6937 }
6938 }
6939 // If we have no more children, but used to, they don't line up.
6940
6941 if (prevChildAtSameIndex !== null) {
6942 shouldResetChildren = true;
6943 }
6944 } else {
6945 if (traceUpdatesEnabled) {
6946 // If we're tracing updates and we've bailed out before reaching a host node,
6947 // we should fall back to recursively marking the nearest host descendants for highlight.
6948 if (traceNearestHostComponentUpdate) {
6949 const hostFibers = findAllCurrentHostFibers(getFiberID(getPrimaryFiber(nextFiber)));
6950 hostFibers.forEach(hostFiber=>{
6951 traceUpdatesForNodes.add(hostFiber.stateNode);
6952 }
6953 );
6954 }
6955 }
6956 }
6957 }
6958
6959 if (shouldIncludeInTree) {
6960 const isProfilingSupported = nextFiber.hasOwnProperty('treeBaseDuration');
6961
6962 if (isProfilingSupported) {
6963 recordProfilingDurations(nextFiber);
6964 }
6965 }
6966
6967 if (shouldResetChildren) {
6968 // We need to crawl the subtree for closest non-filtered Fibers
6969 // so that we can display them in a flat children set.
6970 if (shouldIncludeInTree) {
6971 // Normally, search for children from the rendered child.
6972 let nextChildSet = nextFiber.child;
6973
6974 if (nextDidTimeOut) {
6975 // Special case: timed-out Suspense renders the fallback set.
6976 const nextFiberChild = nextFiber.child;
6977 nextChildSet = nextFiberChild ? nextFiberChild.sibling : null;
6978 }
6979
6980 if (nextChildSet != null) {
6981 recordResetChildren(nextFiber, nextChildSet);
6982 }
6983 // We've handled the child order change for this Fiber.
6984 // Since it's included, there's no need to invalidate parent child order.
6985
6986 return false;
6987 } else {
6988 // Let the closest unfiltered parent Fiber reset its child order instead.
6989 return true;
6990 }
6991 } else {
6992 return false;
6993 }
6994 }
6995
6996 function cleanup() {// We don't patch any methods so there is no cleanup.
6997 }
6998
6999 function flushInitialOperations() {
7000 const localPendingOperationsQueue = pendingOperationsQueue;
7001 pendingOperationsQueue = null;
7002
7003 if (localPendingOperationsQueue !== null && localPendingOperationsQueue.length > 0) {
7004 // We may have already queued up some operations before the frontend connected
7005 // If so, let the frontend know about them.
7006 localPendingOperationsQueue.forEach(operations=>{
7007 hook.emit('operations', operations);
7008 }
7009 );
7010 } else {
7011 // Before the traversals, remember to start tracking
7012 // our path in case we have selection to restore.
7013 if (trackedPath !== null) {
7014 mightBeOnTrackedPath = true;
7015 }
7016 // If we have not been profiling, then we can just walk the tree and build up its current state as-is.
7017
7018 hook.getFiberRoots(rendererID).forEach(root=>{
7019 currentRootID = getFiberID(getPrimaryFiber(root.current));
7020 setRootPseudoKey(currentRootID, root.current);
7021 // Checking root.memoizedInteractions handles multi-renderer edge-case-
7022 // where some v16 renderers support profiling and others don't.
7023
7024 if (isProfiling && root.memoizedInteractions != null) {
7025 // If profiling is active, store commit time and duration, and the current interactions.
7026 // The frontend may request this information after profiling has stopped.
7027 currentCommitProfilingMetadata = {
7028 changeDescriptions: recordChangeDescriptions ? new Map() : null,
7029 durations: [],
7030 commitTime: getCurrentTime() - profilingStartTime,
7031 interactions: Array.from(root.memoizedInteractions).map(interaction=>renderer_objectSpread(renderer_objectSpread({}, interaction), {}, {
7032 timestamp: interaction.timestamp - profilingStartTime
7033 })),
7034 maxActualDuration: 0,
7035 priorityLevel: null
7036 };
7037 }
7038
7039 mountFiberRecursively(root.current, null, false, false);
7040 flushPendingEvents(root);
7041 currentRootID = -1;
7042 }
7043 );
7044 }
7045 }
7046
7047 function handleCommitFiberUnmount(fiber) {
7048 // This is not recursive.
7049 // We can't traverse fibers after unmounting so instead
7050 // we rely on React telling us about each unmount.
7051 recordUnmount(fiber, false);
7052 }
7053
7054 function handleCommitFiberRoot(root, priorityLevel) {
7055 const current = root.current;
7056 const alternate = current.alternate;
7057 currentRootID = getFiberID(getPrimaryFiber(current));
7058 // Before the traversals, remember to start tracking
7059 // our path in case we have selection to restore.
7060
7061 if (trackedPath !== null) {
7062 mightBeOnTrackedPath = true;
7063 }
7064
7065 if (traceUpdatesEnabled) {
7066 traceUpdatesForNodes.clear();
7067 }
7068 // Checking root.memoizedInteractions handles multi-renderer edge-case-
7069 // where some v16 renderers support profiling and others don't.
7070
7071 const isProfilingSupported = root.memoizedInteractions != null;
7072
7073 if (isProfiling && isProfilingSupported) {
7074 // If profiling is active, store commit time and duration, and the current interactions.
7075 // The frontend may request this information after profiling has stopped.
7076 currentCommitProfilingMetadata = {
7077 changeDescriptions: recordChangeDescriptions ? new Map() : null,
7078 durations: [],
7079 commitTime: getCurrentTime() - profilingStartTime,
7080 interactions: Array.from(root.memoizedInteractions).map(interaction=>renderer_objectSpread(renderer_objectSpread({}, interaction), {}, {
7081 timestamp: interaction.timestamp - profilingStartTime
7082 })),
7083 maxActualDuration: 0,
7084 priorityLevel: priorityLevel == null ? null : formatPriorityLevel(priorityLevel)
7085 };
7086 }
7087
7088 if (alternate) {
7089 // TODO: relying on this seems a bit fishy.
7090 const wasMounted = alternate.memoizedState != null && alternate.memoizedState.element != null;
7091 const isMounted = current.memoizedState != null && current.memoizedState.element != null;
7092
7093 if (!wasMounted && isMounted) {
7094 // Mount a new root.
7095 setRootPseudoKey(currentRootID, current);
7096 mountFiberRecursively(current, null, false, false);
7097 } else if (wasMounted && isMounted) {
7098 // Update an existing root.
7099 updateFiberRecursively(current, alternate, null, false);
7100 } else if (wasMounted && !isMounted) {
7101 // Unmount an existing root.
7102 removeRootPseudoKey(currentRootID);
7103 recordUnmount(current, false);
7104 }
7105 } else {
7106 // Mount a new root.
7107 setRootPseudoKey(currentRootID, current);
7108 mountFiberRecursively(current, null, false, false);
7109 }
7110
7111 if (isProfiling && isProfilingSupported) {
7112 const commitProfilingMetadata = rootToCommitProfilingMetadataMap.get(currentRootID);
7113
7114 if (commitProfilingMetadata != null) {
7115 commitProfilingMetadata.push(currentCommitProfilingMetadata);
7116 } else {
7117 rootToCommitProfilingMetadataMap.set(currentRootID, [currentCommitProfilingMetadata]);
7118 }
7119 }
7120 // We're done here.
7121
7122 flushPendingEvents(root);
7123
7124 if (traceUpdatesEnabled) {
7125 hook.emit('traceUpdates', traceUpdatesForNodes);
7126 }
7127
7128 currentRootID = -1;
7129 }
7130
7131 function findAllCurrentHostFibers(id) {
7132 const fibers = [];
7133 const fiber = findCurrentFiberUsingSlowPathById(id);
7134
7135 if (!fiber) {
7136 return fibers;
7137 }
7138 // Next we'll drill down this component to find all HostComponent/Text.
7139
7140 let node = fiber;
7141
7142 while (true) {
7143 if (node.tag === HostComponent || node.tag === HostText) {
7144 fibers.push(node);
7145 } else if (node.child) {
7146 node.child.return = node;
7147 node = node.child;
7148 continue;
7149 }
7150
7151 if (node === fiber) {
7152 return fibers;
7153 }
7154
7155 while (!node.sibling) {
7156 if (!node.return || node.return === fiber) {
7157 return fibers;
7158 }
7159
7160 node = node.return;
7161 }
7162
7163 node.sibling.return = node.return;
7164 node = node.sibling;
7165 }
7166 // Flow needs the return here, but ESLint complains about it.
7167 // eslint-disable-next-line no-unreachable
7168
7169 return fibers;
7170 }
7171
7172 function findNativeNodesForFiberID(id) {
7173 try {
7174 let fiber = findCurrentFiberUsingSlowPathById(id);
7175
7176 if (fiber === null) {
7177 return null;
7178 }
7179 // Special case for a timed-out Suspense.
7180
7181 const isTimedOutSuspense = fiber.tag === SuspenseComponent && fiber.memoizedState !== null;
7182
7183 if (isTimedOutSuspense) {
7184 // A timed-out Suspense's findDOMNode is useless.
7185 // Try our best to find the fallback directly.
7186 const maybeFallbackFiber = fiber.child && fiber.child.sibling;
7187
7188 if (maybeFallbackFiber != null) {
7189 fiber = maybeFallbackFiber;
7190 }
7191 }
7192
7193 const hostFibers = findAllCurrentHostFibers(id);
7194 return hostFibers.map(hostFiber=>hostFiber.stateNode).filter(Boolean);
7195 } catch (err) {
7196 // The fiber might have unmounted by now.
7197 return null;
7198 }
7199 }
7200
7201 function getDisplayNameForFiberID(id) {
7202 const fiber = idToFiberMap.get(id);
7203 return fiber != null ? getDisplayNameForFiber(fiber) : null;
7204 }
7205
7206 function getFiberIDForNative(hostInstance, findNearestUnfilteredAncestor=false) {
7207 let fiber = renderer.findFiberByHostInstance(hostInstance);
7208
7209 if (fiber != null) {
7210 if (findNearestUnfilteredAncestor) {
7211 while (fiber !== null && shouldFilterFiber(fiber)) {
7212 fiber = fiber.return;
7213 }
7214 }
7215
7216 return getFiberID(getPrimaryFiber(fiber));
7217 }
7218
7219 return null;
7220 }
7221
7222 const MOUNTING = 1;
7223 const MOUNTED = 2;
7224 const UNMOUNTED = 3;
7225 // This function is copied from React and should be kept in sync:
7226 // https://github.com/facebook/react/blob/master/packages/react-reconciler/src/ReactFiberTreeReflection.js
7227
7228 function isFiberMountedImpl(fiber) {
7229 let node = fiber;
7230
7231 if (!fiber.alternate) {
7232 // If there is no alternate, this might be a new tree that isn't inserted
7233 // yet. If it is, then it will have a pending insertion effect on it.
7234 if ((getFiberFlags(node) & Placement) !== NoFlags) {
7235 return MOUNTING;
7236 }
7237
7238 while (node.return) {
7239 node = node.return;
7240
7241 if ((getFiberFlags(node) & Placement) !== NoFlags) {
7242 return MOUNTING;
7243 }
7244 }
7245 } else {
7246 while (node.return) {
7247 node = node.return;
7248 }
7249 }
7250
7251 if (node.tag === HostRoot) {
7252 // TODO: Check if this was a nested HostRoot when used with
7253 // renderContainerIntoSubtree.
7254 return MOUNTED;
7255 }
7256 // If we didn't hit the root, that means that we're in an disconnected tree
7257 // that has been unmounted.
7258
7259 return UNMOUNTED;
7260 }
7261 // This function is copied from React and should be kept in sync:
7262 // https://github.com/facebook/react/blob/master/packages/react-reconciler/src/ReactFiberTreeReflection.js
7263 // It would be nice if we updated React to inject this function directly (vs just indirectly via findDOMNode).
7264 // BEGIN copied code
7265
7266 function findCurrentFiberUsingSlowPathById(id) {
7267 const fiber = idToFiberMap.get(id);
7268
7269 if (fiber == null) {
7270 console.warn(`Could not find Fiber with id "${id}"`);
7271 return null;
7272 }
7273
7274 const alternate = fiber.alternate;
7275
7276 if (!alternate) {
7277 // If there is no alternate, then we only need to check if it is mounted.
7278 const state = isFiberMountedImpl(fiber);
7279
7280 if (state === UNMOUNTED) {
7281 throw Error('Unable to find node on an unmounted component.');
7282 }
7283
7284 if (state === MOUNTING) {
7285 return null;
7286 }
7287
7288 return fiber;
7289 }
7290 // If we have two possible branches, we'll walk backwards up to the root
7291 // to see what path the root points to. On the way we may hit one of the
7292 // special cases and we'll deal with them.
7293
7294 let a = fiber;
7295 let b = alternate;
7296
7297 while (true) {
7298 const parentA = a.return;
7299
7300 if (parentA === null) {
7301 // We're at the root.
7302 break;
7303 }
7304
7305 const parentB = parentA.alternate;
7306
7307 if (parentB === null) {
7308 // There is no alternate. This is an unusual case. Currently, it only
7309 // happens when a Suspense component is hidden. An extra fragment fiber
7310 // is inserted in between the Suspense fiber and its children. Skip
7311 // over this extra fragment fiber and proceed to the next parent.
7312 const nextParent = parentA.return;
7313
7314 if (nextParent !== null) {
7315 a = b = nextParent;
7316 continue;
7317 }
7318 // If there's no parent, we're at the root.
7319
7320 break;
7321 }
7322 // If both copies of the parent fiber point to the same child, we can
7323 // assume that the child is current. This happens when we bailout on low
7324 // priority: the bailed out fiber's child reuses the current child.
7325
7326 if (parentA.child === parentB.child) {
7327 let child = parentA.child;
7328
7329 while (child) {
7330 if (child === a) {
7331 // We've determined that A is the current branch.
7332 if (isFiberMountedImpl(parentA) !== MOUNTED) {
7333 throw Error('Unable to find node on an unmounted component.');
7334 }
7335
7336 return fiber;
7337 }
7338
7339 if (child === b) {
7340 // We've determined that B is the current branch.
7341 if (isFiberMountedImpl(parentA) !== MOUNTED) {
7342 throw Error('Unable to find node on an unmounted component.');
7343 }
7344
7345 return alternate;
7346 }
7347
7348 child = child.sibling;
7349 }
7350 // We should never have an alternate for any mounting node. So the only
7351 // way this could possibly happen is if this was unmounted, if at all.
7352
7353 throw Error('Unable to find node on an unmounted component.');
7354 }
7355
7356 if (a.return !== b.return) {
7357 // The return pointer of A and the return pointer of B point to different
7358 // fibers. We assume that return pointers never criss-cross, so A must
7359 // belong to the child set of A.return, and B must belong to the child
7360 // set of B.return.
7361 a = parentA;
7362 b = parentB;
7363 } else {
7364 // The return pointers point to the same fiber. We'll have to use the
7365 // default, slow path: scan the child sets of each parent alternate to see
7366 // which child belongs to which set.
7367 //
7368 // Search parent A's child set
7369 let didFindChild = false;
7370 let child = parentA.child;
7371
7372 while (child) {
7373 if (child === a) {
7374 didFindChild = true;
7375 a = parentA;
7376 b = parentB;
7377 break;
7378 }
7379
7380 if (child === b) {
7381 didFindChild = true;
7382 b = parentA;
7383 a = parentB;
7384 break;
7385 }
7386
7387 child = child.sibling;
7388 }
7389
7390 if (!didFindChild) {
7391 // Search parent B's child set
7392 child = parentB.child;
7393
7394 while (child) {
7395 if (child === a) {
7396 didFindChild = true;
7397 a = parentB;
7398 b = parentA;
7399 break;
7400 }
7401
7402 if (child === b) {
7403 didFindChild = true;
7404 b = parentB;
7405 a = parentA;
7406 break;
7407 }
7408
7409 child = child.sibling;
7410 }
7411
7412 if (!didFindChild) {
7413 throw Error('Child was not found in either parent set. This indicates a bug ' + 'in React related to the return pointer. Please file an issue.');
7414 }
7415 }
7416 }
7417
7418 if (a.alternate !== b) {
7419 throw Error("Return fibers should always be each others' alternates. " + 'This error is likely caused by a bug in React. Please file an issue.');
7420 }
7421 }
7422 // If the root is not a host container, we're in a disconnected tree. I.e.
7423 // unmounted.
7424
7425 if (a.tag !== HostRoot) {
7426 throw Error('Unable to find node on an unmounted component.');
7427 }
7428
7429 if (a.stateNode.current === a) {
7430 // We've determined that A is the current branch.
7431 return fiber;
7432 }
7433 // Otherwise B has to be current branch.
7434
7435 return alternate;
7436 }
7437 // END copied code
7438
7439 function prepareViewAttributeSource(id, path) {
7440 const isCurrent = isMostRecentlyInspectedElementCurrent(id);
7441
7442 if (isCurrent) {
7443 window.$attribute = Object(utils["j"/* getInObject */
7444 ])(mostRecentlyInspectedElement, path);
7445 }
7446 }
7447
7448 function prepareViewElementSource(id) {
7449 const fiber = idToFiberMap.get(id);
7450
7451 if (fiber == null) {
7452 console.warn(`Could not find Fiber with id "${id}"`);
7453 return;
7454 }
7455
7456 const elementType = fiber.elementType
7457 , tag = fiber.tag
7458 , type = fiber.type;
7459
7460 switch (tag) {
7461 case ClassComponent:
7462 case IncompleteClassComponent:
7463 case IndeterminateComponent:
7464 case FunctionComponent:
7465 global.$type = type;
7466 break;
7467
7468 case ForwardRef:
7469 global.$type = type.render;
7470 break;
7471
7472 case MemoComponent:
7473 case SimpleMemoComponent:
7474 global.$type = elementType != null && elementType.type != null ? elementType.type : type;
7475 break;
7476
7477 default:
7478 global.$type = null;
7479 break;
7480 }
7481 }
7482
7483 function getOwnersList(id) {
7484 const fiber = findCurrentFiberUsingSlowPathById(id);
7485
7486 if (fiber == null) {
7487 return null;
7488 }
7489
7490 const _debugOwner = fiber._debugOwner;
7491 const owners = [{
7492 displayName: getDisplayNameForFiber(fiber) || 'Anonymous',
7493 id,
7494 type: getElementTypeForFiber(fiber)
7495 }];
7496
7497 if (_debugOwner) {
7498 let owner = _debugOwner;
7499
7500 while (owner !== null) {
7501 owners.unshift({
7502 displayName: getDisplayNameForFiber(owner) || 'Anonymous',
7503 id: getFiberID(getPrimaryFiber(owner)),
7504 type: getElementTypeForFiber(owner)
7505 });
7506 owner = owner._debugOwner || null;
7507 }
7508 }
7509
7510 return owners;
7511 }
7512 // Fast path props lookup for React Native style editor.
7513 // Could use inspectElementRaw() but that would require shallow rendering hooks components,
7514 // and could also mess with memoization.
7515
7516 function getInstanceAndStyle(id) {
7517 let instance = null;
7518 let style = null;
7519 const fiber = findCurrentFiberUsingSlowPathById(id);
7520
7521 if (fiber !== null) {
7522 instance = fiber.stateNode;
7523
7524 if (fiber.memoizedProps !== null) {
7525 style = fiber.memoizedProps.style;
7526 }
7527 }
7528
7529 return {
7530 instance,
7531 style
7532 };
7533 }
7534
7535 function inspectElementRaw(id) {
7536 const fiber = findCurrentFiberUsingSlowPathById(id);
7537
7538 if (fiber == null) {
7539 return null;
7540 }
7541
7542 const _debugOwner = fiber._debugOwner
7543 , _debugSource = fiber._debugSource
7544 , stateNode = fiber.stateNode
7545 , key = fiber.key
7546 , memoizedProps = fiber.memoizedProps
7547 , memoizedState = fiber.memoizedState
7548 , dependencies = fiber.dependencies
7549 , tag = fiber.tag
7550 , type = fiber.type;
7551 const elementType = getElementTypeForFiber(fiber);
7552 const usesHooks = (tag === FunctionComponent || tag === SimpleMemoComponent || tag === ForwardRef) && (!!memoizedState || !!dependencies);
7553 const typeSymbol = getTypeSymbol(type);
7554 let canViewSource = false;
7555 let context = null;
7556
7557 if (tag === ClassComponent || tag === FunctionComponent || tag === IncompleteClassComponent || tag === IndeterminateComponent || tag === MemoComponent || tag === ForwardRef || tag === SimpleMemoComponent) {
7558 canViewSource = true;
7559
7560 if (stateNode && stateNode.context != null) {
7561 // Don't show an empty context object for class components that don't use the context API.
7562 const shouldHideContext = elementType === types["e"/* ElementTypeClass */
7563 ] && !(type.contextTypes || type.contextType);
7564
7565 if (!shouldHideContext) {
7566 context = stateNode.context;
7567 }
7568 }
7569 } else if (typeSymbol === ReactSymbols["e"/* CONTEXT_NUMBER */
7570 ] || typeSymbol === ReactSymbols["f"/* CONTEXT_SYMBOL_STRING */
7571 ]) {
7572 // 16.3-16.5 read from "type" because the Consumer is the actual context object.
7573 // 16.6+ should read from "type._context" because Consumer can be different (in DEV).
7574 // NOTE Keep in sync with getDisplayNameForFiber()
7575 const consumerResolvedContext = type._context || type;
7576 // Global context value.
7577
7578 context = consumerResolvedContext._currentValue || null;
7579 // Look for overridden value.
7580
7581 let current = fiber.return;
7582
7583 while (current !== null) {
7584 const currentType = current.type;
7585 const currentTypeSymbol = getTypeSymbol(currentType);
7586
7587 if (currentTypeSymbol === ReactSymbols["p"/* PROVIDER_NUMBER */
7588 ] || currentTypeSymbol === ReactSymbols["q"/* PROVIDER_SYMBOL_STRING */
7589 ]) {
7590 // 16.3.0 exposed the context object as "context"
7591 // PR #12501 changed it to "_context" for 16.3.1+
7592 // NOTE Keep in sync with getDisplayNameForFiber()
7593 const providerResolvedContext = currentType._context || currentType.context;
7594
7595 if (providerResolvedContext === consumerResolvedContext) {
7596 context = current.memoizedProps.value;
7597 break;
7598 }
7599 }
7600
7601 current = current.return;
7602 }
7603 }
7604
7605 let hasLegacyContext = false;
7606
7607 if (context !== null) {
7608 hasLegacyContext = !!type.contextTypes;
7609 // To simplify hydration and display logic for context, wrap in a value object.
7610 // Otherwise simple values (e.g. strings, booleans) become harder to handle.
7611
7612 context = {
7613 value: context
7614 };
7615 }
7616
7617 let owners = null;
7618
7619 if (_debugOwner) {
7620 owners = [];
7621 let owner = _debugOwner;
7622
7623 while (owner !== null) {
7624 owners.push({
7625 displayName: getDisplayNameForFiber(owner) || 'Anonymous',
7626 id: getFiberID(getPrimaryFiber(owner)),
7627 type: getElementTypeForFiber(owner)
7628 });
7629 owner = owner._debugOwner || null;
7630 }
7631 }
7632
7633 const isTimedOutSuspense = tag === SuspenseComponent && memoizedState !== null;
7634 let hooks = null;
7635
7636 if (usesHooks) {
7637 const originalConsoleMethods = {};
7638 // Temporarily disable all console logging before re-running the hook.
7639
7640 for (const method in console) {
7641 try {
7642 originalConsoleMethods[method] = console[method];
7643 // $FlowFixMe property error|warn is not writable.
7644
7645 console[method] = ()=>{}
7646 ;
7647 } catch (error) {}
7648 }
7649
7650 try {
7651 hooks = Object(react_debug_tools["inspectHooksOfFiber"])(fiber, renderer.currentDispatcherRef);
7652 } finally {
7653 // Restore original console functionality.
7654 for (const method in originalConsoleMethods) {
7655 try {
7656 // $FlowFixMe property error|warn is not writable.
7657 console[method] = originalConsoleMethods[method];
7658 } catch (error) {}
7659 }
7660 }
7661 }
7662
7663 let rootType = null;
7664 let current = fiber;
7665
7666 while (current.return !== null) {
7667 current = current.return;
7668 }
7669
7670 const fiberRoot = current.stateNode;
7671
7672 if (fiberRoot != null && fiberRoot._debugRootType !== null) {
7673 rootType = fiberRoot._debugRootType;
7674 }
7675
7676 return {
7677 id,
7678 // Does the current renderer support editable hooks and function props?
7679 canEditHooks: typeof overrideHookState === 'function',
7680 canEditFunctionProps: typeof overrideProps === 'function',
7681 // Does the current renderer support advanced editing interface?
7682 canEditHooksAndDeletePaths: typeof overrideHookStateDeletePath === 'function',
7683 canEditHooksAndRenamePaths: typeof overrideHookStateRenamePath === 'function',
7684 canEditFunctionPropsDeletePaths: typeof overridePropsDeletePath === 'function',
7685 canEditFunctionPropsRenamePaths: typeof overridePropsRenamePath === 'function',
7686 canToggleSuspense: supportsTogglingSuspense && (// If it's showing the real content, we can always flip fallback.
7687 !isTimedOutSuspense || // If it's showing fallback because we previously forced it to,
7688 // allow toggling it back to remove the fallback override.
7689 forceFallbackForSuspenseIDs.has(id)),
7690 // Can view component source location.
7691 canViewSource,
7692 // Does the component have legacy context attached to it.
7693 hasLegacyContext,
7694 key: key != null ? key : null,
7695 displayName: getDisplayNameForFiber(fiber),
7696 type: elementType,
7697 // Inspectable properties.
7698 // TODO Review sanitization approach for the below inspectable values.
7699 context,
7700 hooks,
7701 props: memoizedProps,
7702 state: usesHooks ? null : memoizedState,
7703 // List of owners
7704 owners,
7705 // Location of component in source code.
7706 source: _debugSource || null,
7707 rootType,
7708 rendererPackageName: renderer.rendererPackageName,
7709 rendererVersion: renderer.version
7710 };
7711 }
7712
7713 let mostRecentlyInspectedElement = null;
7714 let hasElementUpdatedSinceLastInspected = false;
7715 let currentlyInspectedPaths = {};
7716
7717 function isMostRecentlyInspectedElementCurrent(id) {
7718 return mostRecentlyInspectedElement !== null && mostRecentlyInspectedElement.id === id && !hasElementUpdatedSinceLastInspected;
7719 }
7720 // Track the intersection of currently inspected paths,
7721 // so that we can send their data along if the element is re-rendered.
7722
7723 function mergeInspectedPaths(path) {
7724 let current = currentlyInspectedPaths;
7725 path.forEach(key=>{
7726 if (!current[key]) {
7727 current[key] = {};
7728 }
7729
7730 current = current[key];
7731 }
7732 );
7733 }
7734
7735 function createIsPathAllowed(key, secondaryCategory) {
7736 // This function helps prevent previously-inspected paths from being dehydrated in updates.
7737 // This is important to avoid a bad user experience where expanded toggles collapse on update.
7738 return function isPathAllowed(path) {
7739 switch (secondaryCategory) {
7740 case 'hooks':
7741 if (path.length === 1) {
7742 // Never dehydrate the "hooks" object at the top levels.
7743 return true;
7744 }
7745
7746 if (path[path.length - 1] === 'subHooks' || path[path.length - 2] === 'subHooks') {
7747 // Dehydrating the 'subHooks' property makes the HooksTree UI a lot more complicated,
7748 // so it's easiest for now if we just don't break on this boundary.
7749 // We can always dehydrate a level deeper (in the value object).
7750 return true;
7751 }
7752
7753 break;
7754
7755 default:
7756 break;
7757 }
7758
7759 let current = key === null ? currentlyInspectedPaths : currentlyInspectedPaths[key];
7760
7761 if (!current) {
7762 return false;
7763 }
7764
7765 for (let i = 0; i < path.length; i++) {
7766 current = current[path[i]];
7767
7768 if (!current) {
7769 return false;
7770 }
7771 }
7772
7773 return true;
7774 }
7775 ;
7776 }
7777
7778 function updateSelectedElement(inspectedElement) {
7779 const hooks = inspectedElement.hooks
7780 , id = inspectedElement.id
7781 , props = inspectedElement.props;
7782 const fiber = idToFiberMap.get(id);
7783
7784 if (fiber == null) {
7785 console.warn(`Could not find Fiber with id "${id}"`);
7786 return;
7787 }
7788
7789 const elementType = fiber.elementType
7790 , stateNode = fiber.stateNode
7791 , tag = fiber.tag
7792 , type = fiber.type;
7793
7794 switch (tag) {
7795 case ClassComponent:
7796 case IncompleteClassComponent:
7797 case IndeterminateComponent:
7798 global.$r = stateNode;
7799 break;
7800
7801 case FunctionComponent:
7802 global.$r = {
7803 hooks,
7804 props,
7805 type
7806 };
7807 break;
7808
7809 case ForwardRef:
7810 global.$r = {
7811 props,
7812 type: type.render
7813 };
7814 break;
7815
7816 case MemoComponent:
7817 case SimpleMemoComponent:
7818 global.$r = {
7819 props,
7820 type: elementType != null && elementType.type != null ? elementType.type : type
7821 };
7822 break;
7823
7824 default:
7825 global.$r = null;
7826 break;
7827 }
7828 }
7829
7830 function storeAsGlobal(id, path, count) {
7831 const isCurrent = isMostRecentlyInspectedElementCurrent(id);
7832
7833 if (isCurrent) {
7834 const value = Object(utils["j"/* getInObject */
7835 ])(mostRecentlyInspectedElement, path);
7836 const key = `$reactTemp${count}`;
7837 window[key] = value;
7838 console.log(key);
7839 console.log(value);
7840 }
7841 }
7842
7843 function copyElementPath(id, path) {
7844 const isCurrent = isMostRecentlyInspectedElementCurrent(id);
7845
7846 if (isCurrent) {
7847 copyToClipboard(Object(utils["j"/* getInObject */
7848 ])(mostRecentlyInspectedElement, path));
7849 }
7850 }
7851
7852 function inspectElement(id, path) {
7853 const isCurrent = isMostRecentlyInspectedElementCurrent(id);
7854
7855 if (isCurrent) {
7856 if (path != null) {
7857 mergeInspectedPaths(path);
7858 let secondaryCategory = null;
7859
7860 if (path[0] === 'hooks') {
7861 secondaryCategory = 'hooks';
7862 }
7863 // If this element has not been updated since it was last inspected,
7864 // we can just return the subset of data in the newly-inspected path.
7865
7866 return {
7867 id,
7868 type: 'hydrated-path',
7869 path,
7870 value: cleanForBridge(Object(utils["j"/* getInObject */
7871 ])(mostRecentlyInspectedElement, path), createIsPathAllowed(null, secondaryCategory), path)
7872 };
7873 } else {
7874 // If this element has not been updated since it was last inspected, we don't need to re-run it.
7875 // Instead we can just return the ID to indicate that it has not changed.
7876 return {
7877 id,
7878 type: 'no-change'
7879 };
7880 }
7881 } else {
7882 hasElementUpdatedSinceLastInspected = false;
7883
7884 if (mostRecentlyInspectedElement === null || mostRecentlyInspectedElement.id !== id) {
7885 currentlyInspectedPaths = {};
7886 }
7887
7888 mostRecentlyInspectedElement = inspectElementRaw(id);
7889
7890 if (mostRecentlyInspectedElement === null) {
7891 return {
7892 id,
7893 type: 'not-found'
7894 };
7895 }
7896
7897 if (path != null) {
7898 mergeInspectedPaths(path);
7899 }
7900 // Any time an inspected element has an update,
7901 // we should update the selected $r value as wel.
7902 // Do this before dehydration (cleanForBridge).
7903
7904 updateSelectedElement(mostRecentlyInspectedElement);
7905 // Clone before cleaning so that we preserve the full data.
7906 // This will enable us to send patches without re-inspecting if hydrated paths are requested.
7907 // (Reducing how often we shallow-render is a better DX for function components that use hooks.)
7908
7909 const cleanedInspectedElement = renderer_objectSpread({}, mostRecentlyInspectedElement);
7910
7911 cleanedInspectedElement.context = cleanForBridge(cleanedInspectedElement.context, createIsPathAllowed('context', null));
7912 cleanedInspectedElement.hooks = cleanForBridge(cleanedInspectedElement.hooks, createIsPathAllowed('hooks', 'hooks'));
7913 cleanedInspectedElement.props = cleanForBridge(cleanedInspectedElement.props, createIsPathAllowed('props', null));
7914 cleanedInspectedElement.state = cleanForBridge(cleanedInspectedElement.state, createIsPathAllowed('state', null));
7915 return {
7916 id,
7917 type: 'full-data',
7918 value: cleanedInspectedElement
7919 };
7920 }
7921 }
7922
7923 function logElementToConsole(id) {
7924 const result = isMostRecentlyInspectedElementCurrent(id) ? mostRecentlyInspectedElement : inspectElementRaw(id);
7925
7926 if (result === null) {
7927 console.warn(`Could not find Fiber with id "${id}"`);
7928 return;
7929 }
7930
7931 const supportsGroup = typeof console.groupCollapsed === 'function';
7932
7933 if (supportsGroup) {
7934 console.groupCollapsed(`[Click to expand] %c<${result.displayName || 'Component'} />`, // --dom-tag-name-color is the CSS variable Chrome styles HTML elements with in the console.
7935 'color: var(--dom-tag-name-color); font-weight: normal;');
7936 }
7937
7938 if (result.props !== null) {
7939 console.log('Props:', result.props);
7940 }
7941
7942 if (result.state !== null) {
7943 console.log('State:', result.state);
7944 }
7945
7946 if (result.hooks !== null) {
7947 console.log('Hooks:', result.hooks);
7948 }
7949
7950 const nativeNodes = findNativeNodesForFiberID(id);
7951
7952 if (nativeNodes !== null) {
7953 console.log('Nodes:', nativeNodes);
7954 }
7955
7956 if (result.source !== null) {
7957 console.log('Location:', result.source);
7958 }
7959
7960 if (window.chrome || /firefox/i.test(navigator.userAgent)) {
7961 console.log('Right-click any value to save it as a global variable for further inspection.');
7962 }
7963
7964 if (supportsGroup) {
7965 console.groupEnd();
7966 }
7967 }
7968
7969 function deletePath(type, id, hookID, path) {
7970 const fiber = findCurrentFiberUsingSlowPathById(id);
7971
7972 if (fiber !== null) {
7973 const instance = fiber.stateNode;
7974
7975 switch (type) {
7976 case 'context':
7977 // To simplify hydration and display of primitive context values (e.g. number, string)
7978 // the inspectElement() method wraps context in a {value: ...} object.
7979 // We need to remove the first part of the path (the "value") before continuing.
7980 path = path.slice(1);
7981
7982 switch (fiber.tag) {
7983 case ClassComponent:
7984 if (path.length === 0) {// Simple context value (noop)
7985 } else {
7986 Object(utils["a"/* deletePathInObject */
7987 ])(instance.context, path);
7988 }
7989
7990 instance.forceUpdate();
7991 break;
7992
7993 case FunctionComponent:
7994 // Function components using legacy context are not editable
7995 // because there's no instance on which to create a cloned, mutated context.
7996 break;
7997 }
7998
7999 break;
8000
8001 case 'hooks':
8002 if (typeof overrideHookStateDeletePath === 'function') {
8003 overrideHookStateDeletePath(fiber, hookID, path);
8004 }
8005
8006 break;
8007
8008 case 'props':
8009 if (instance === null) {
8010 if (typeof overridePropsDeletePath === 'function') {
8011 overridePropsDeletePath(fiber, path);
8012 }
8013 } else {
8014 fiber.pendingProps = copyWithDelete(instance.props, path);
8015 instance.forceUpdate();
8016 }
8017
8018 break;
8019
8020 case 'state':
8021 Object(utils["a"/* deletePathInObject */
8022 ])(instance.state, path);
8023 instance.forceUpdate();
8024 break;
8025 }
8026 }
8027 }
8028
8029 function renamePath(type, id, hookID, oldPath, newPath) {
8030 const fiber = findCurrentFiberUsingSlowPathById(id);
8031
8032 if (fiber !== null) {
8033 const instance = fiber.stateNode;
8034
8035 switch (type) {
8036 case 'context':
8037 // To simplify hydration and display of primitive context values (e.g. number, string)
8038 // the inspectElement() method wraps context in a {value: ...} object.
8039 // We need to remove the first part of the path (the "value") before continuing.
8040 oldPath = oldPath.slice(1);
8041 newPath = newPath.slice(1);
8042
8043 switch (fiber.tag) {
8044 case ClassComponent:
8045 if (oldPath.length === 0) {// Simple context value (noop)
8046 } else {
8047 Object(utils["m"/* renamePathInObject */
8048 ])(instance.context, oldPath, newPath);
8049 }
8050
8051 instance.forceUpdate();
8052 break;
8053
8054 case FunctionComponent:
8055 // Function components using legacy context are not editable
8056 // because there's no instance on which to create a cloned, mutated context.
8057 break;
8058 }
8059
8060 break;
8061
8062 case 'hooks':
8063 if (typeof overrideHookStateRenamePath === 'function') {
8064 overrideHookStateRenamePath(fiber, hookID, oldPath, newPath);
8065 }
8066
8067 break;
8068
8069 case 'props':
8070 if (instance === null) {
8071 if (typeof overridePropsRenamePath === 'function') {
8072 overridePropsRenamePath(fiber, oldPath, newPath);
8073 }
8074 } else {
8075 fiber.pendingProps = copyWithRename(instance.props, oldPath, newPath);
8076 instance.forceUpdate();
8077 }
8078
8079 break;
8080
8081 case 'state':
8082 Object(utils["m"/* renamePathInObject */
8083 ])(instance.state, oldPath, newPath);
8084 instance.forceUpdate();
8085 break;
8086 }
8087 }
8088 }
8089
8090 function overrideValueAtPath(type, id, hookID, path, value) {
8091 const fiber = findCurrentFiberUsingSlowPathById(id);
8092
8093 if (fiber !== null) {
8094 const instance = fiber.stateNode;
8095
8096 switch (type) {
8097 case 'context':
8098 // To simplify hydration and display of primitive context values (e.g. number, string)
8099 // the inspectElement() method wraps context in a {value: ...} object.
8100 // We need to remove the first part of the path (the "value") before continuing.
8101 path = path.slice(1);
8102
8103 switch (fiber.tag) {
8104 case ClassComponent:
8105 if (path.length === 0) {
8106 // Simple context value
8107 instance.context = value;
8108 } else {
8109 Object(utils["p"/* setInObject */
8110 ])(instance.context, path, value);
8111 }
8112
8113 instance.forceUpdate();
8114 break;
8115
8116 case FunctionComponent:
8117 // Function components using legacy context are not editable
8118 // because there's no instance on which to create a cloned, mutated context.
8119 break;
8120 }
8121
8122 break;
8123
8124 case 'hooks':
8125 if (typeof overrideHookState === 'function') {
8126 overrideHookState(fiber, hookID, path, value);
8127 }
8128
8129 break;
8130
8131 case 'props':
8132 switch (fiber.tag) {
8133 case ClassComponent:
8134 fiber.pendingProps = copyWithSet(instance.props, path, value);
8135 instance.forceUpdate();
8136 break;
8137
8138 default:
8139 if (typeof overrideProps === 'function') {
8140 overrideProps(fiber, path, value);
8141 }
8142
8143 break;
8144 }
8145
8146 break;
8147
8148 case 'state':
8149 switch (fiber.tag) {
8150 case ClassComponent:
8151 Object(utils["p"/* setInObject */
8152 ])(instance.state, path, value);
8153 instance.forceUpdate();
8154 break;
8155 }
8156
8157 break;
8158 }
8159 }
8160 }
8161
8162 let currentCommitProfilingMetadata = null;
8163 let displayNamesByRootID = null;
8164 let idToContextsMap = null;
8165 let initialTreeBaseDurationsMap = null;
8166 let initialIDToRootMap = null;
8167 let isProfiling = false;
8168 let profilingStartTime = 0;
8169 let recordChangeDescriptions = false;
8170 let rootToCommitProfilingMetadataMap = null;
8171
8172 function getProfilingData() {
8173 const dataForRoots = [];
8174
8175 if (rootToCommitProfilingMetadataMap === null) {
8176 throw Error('getProfilingData() called before any profiling data was recorded');
8177 }
8178
8179 rootToCommitProfilingMetadataMap.forEach((commitProfilingMetadata,rootID)=>{
8180 const commitData = [];
8181 const initialTreeBaseDurations = [];
8182 const allInteractions = new Map();
8183 const interactionCommits = new Map();
8184 const displayName = displayNamesByRootID !== null && displayNamesByRootID.get(rootID) || 'Unknown';
8185
8186 if (initialTreeBaseDurationsMap != null) {
8187 initialTreeBaseDurationsMap.forEach((treeBaseDuration,id)=>{
8188 if (initialIDToRootMap != null && initialIDToRootMap.get(id) === rootID) {
8189 // We don't need to convert milliseconds to microseconds in this case,
8190 // because the profiling summary is JSON serialized.
8191 initialTreeBaseDurations.push([id, treeBaseDuration]);
8192 }
8193 }
8194 );
8195 }
8196
8197 commitProfilingMetadata.forEach((commitProfilingData,commitIndex)=>{
8198 const changeDescriptions = commitProfilingData.changeDescriptions
8199 , durations = commitProfilingData.durations
8200 , interactions = commitProfilingData.interactions
8201 , maxActualDuration = commitProfilingData.maxActualDuration
8202 , priorityLevel = commitProfilingData.priorityLevel
8203 , commitTime = commitProfilingData.commitTime;
8204 const interactionIDs = [];
8205 interactions.forEach(interaction=>{
8206 if (!allInteractions.has(interaction.id)) {
8207 allInteractions.set(interaction.id, interaction);
8208 }
8209
8210 interactionIDs.push(interaction.id);
8211 const commitIndices = interactionCommits.get(interaction.id);
8212
8213 if (commitIndices != null) {
8214 commitIndices.push(commitIndex);
8215 } else {
8216 interactionCommits.set(interaction.id, [commitIndex]);
8217 }
8218 }
8219 );
8220 const fiberActualDurations = [];
8221 const fiberSelfDurations = [];
8222
8223 for (let i = 0; i < durations.length; i += 3) {
8224 const fiberID = durations[i];
8225 fiberActualDurations.push([fiberID, durations[i + 1]]);
8226 fiberSelfDurations.push([fiberID, durations[i + 2]]);
8227 }
8228
8229 commitData.push({
8230 changeDescriptions: changeDescriptions !== null ? Array.from(changeDescriptions.entries()) : null,
8231 duration: maxActualDuration,
8232 fiberActualDurations,
8233 fiberSelfDurations,
8234 interactionIDs,
8235 priorityLevel,
8236 timestamp: commitTime
8237 });
8238 }
8239 );
8240 dataForRoots.push({
8241 commitData,
8242 displayName,
8243 initialTreeBaseDurations,
8244 interactionCommits: Array.from(interactionCommits.entries()),
8245 interactions: Array.from(allInteractions.entries()),
8246 rootID
8247 });
8248 }
8249 );
8250 return {
8251 dataForRoots,
8252 rendererID
8253 };
8254 }
8255
8256 function startProfiling(shouldRecordChangeDescriptions) {
8257 if (isProfiling) {
8258 return;
8259 }
8260
8261 recordChangeDescriptions = shouldRecordChangeDescriptions;
8262 // Capture initial values as of the time profiling starts.
8263 // It's important we snapshot both the durations and the id-to-root map,
8264 // since either of these may change during the profiling session
8265 // (e.g. when a fiber is re-rendered or when a fiber gets removed).
8266
8267 displayNamesByRootID = new Map();
8268 initialTreeBaseDurationsMap = new Map(idToTreeBaseDurationMap);
8269 initialIDToRootMap = new Map(idToRootMap);
8270 idToContextsMap = new Map();
8271 hook.getFiberRoots(rendererID).forEach(root=>{
8272 const rootID = getFiberID(getPrimaryFiber(root.current));
8273 displayNamesByRootID.set(rootID, getDisplayNameForRoot(root.current));
8274
8275 if (shouldRecordChangeDescriptions) {
8276 // Record all contexts at the time profiling is started.
8277 // Fibers only store the current context value,
8278 // so we need to track them separately in order to determine changed keys.
8279 crawlToInitializeContextsMap(root.current);
8280 }
8281 }
8282 );
8283 isProfiling = true;
8284 profilingStartTime = getCurrentTime();
8285 rootToCommitProfilingMetadataMap = new Map();
8286 }
8287
8288 function stopProfiling() {
8289 isProfiling = false;
8290 recordChangeDescriptions = false;
8291 }
8292 // Automatically start profiling so that we don't miss timing info from initial "mount".
8293
8294 if (Object(storage["d"/* sessionStorageGetItem */
8295 ])(constants["j"/* SESSION_STORAGE_RELOAD_AND_PROFILE_KEY */
8296 ]) === 'true') {
8297 startProfiling(Object(storage["d"/* sessionStorageGetItem */
8298 ])(constants["i"/* SESSION_STORAGE_RECORD_CHANGE_DESCRIPTIONS_KEY */
8299 ]) === 'true');
8300 }
8301 // React will switch between these implementations depending on whether
8302 // we have any manually suspended Fibers or not.
8303
8304 function shouldSuspendFiberAlwaysFalse() {
8305 return false;
8306 }
8307
8308 const forceFallbackForSuspenseIDs = new Set();
8309
8310 function shouldSuspendFiberAccordingToSet(fiber) {
8311 const id = getFiberID(getPrimaryFiber(fiber));
8312 return forceFallbackForSuspenseIDs.has(id);
8313 }
8314
8315 function overrideSuspense(id, forceFallback) {
8316 if (typeof setSuspenseHandler !== 'function' || typeof scheduleUpdate !== 'function') {
8317 throw new Error('Expected overrideSuspense() to not get called for earlier React versions.');
8318 }
8319
8320 if (forceFallback) {
8321 forceFallbackForSuspenseIDs.add(id);
8322
8323 if (forceFallbackForSuspenseIDs.size === 1) {
8324 // First override is added. Switch React to slower path.
8325 setSuspenseHandler(shouldSuspendFiberAccordingToSet);
8326 }
8327 } else {
8328 forceFallbackForSuspenseIDs.delete(id);
8329
8330 if (forceFallbackForSuspenseIDs.size === 0) {
8331 // Last override is gone. Switch React back to fast path.
8332 setSuspenseHandler(shouldSuspendFiberAlwaysFalse);
8333 }
8334 }
8335
8336 const fiber = idToFiberMap.get(id);
8337
8338 if (fiber != null) {
8339 scheduleUpdate(fiber);
8340 }
8341 }
8342 // Remember if we're trying to restore the selection after reload.
8343 // In that case, we'll do some extra checks for matching mounts.
8344
8345 let trackedPath = null;
8346 let trackedPathMatchFiber = null;
8347 let trackedPathMatchDepth = -1;
8348 let mightBeOnTrackedPath = false;
8349
8350 function setTrackedPath(path) {
8351 if (path === null) {
8352 trackedPathMatchFiber = null;
8353 trackedPathMatchDepth = -1;
8354 mightBeOnTrackedPath = false;
8355 }
8356
8357 trackedPath = path;
8358 }
8359 // We call this before traversing a new mount.
8360 // It remembers whether this Fiber is the next best match for tracked path.
8361 // The return value signals whether we should keep matching siblings or not.
8362
8363 function updateTrackedPathStateBeforeMount(fiber) {
8364 if (trackedPath === null || !mightBeOnTrackedPath) {
8365 // Fast path: there's nothing to track so do nothing and ignore siblings.
8366 return false;
8367 }
8368
8369 const returnFiber = fiber.return;
8370 const returnAlternate = returnFiber !== null ? returnFiber.alternate : null;
8371 // By now we know there's some selection to restore, and this is a new Fiber.
8372 // Is this newly mounted Fiber a direct child of the current best match?
8373 // (This will also be true for new roots if we haven't matched anything yet.)
8374
8375 if (trackedPathMatchFiber === returnFiber || trackedPathMatchFiber === returnAlternate && returnAlternate !== null) {
8376 // Is this the next Fiber we should select? Let's compare the frames.
8377 const actualFrame = getPathFrame(fiber);
8378 const expectedFrame = trackedPath[trackedPathMatchDepth + 1];
8379
8380 if (expectedFrame === undefined) {
8381 throw new Error('Expected to see a frame at the next depth.');
8382 }
8383
8384 if (actualFrame.index === expectedFrame.index && actualFrame.key === expectedFrame.key && actualFrame.displayName === expectedFrame.displayName) {
8385 // We have our next match.
8386 trackedPathMatchFiber = fiber;
8387 trackedPathMatchDepth++;
8388 // Are we out of frames to match?
8389
8390 if (trackedPathMatchDepth === trackedPath.length - 1) {
8391 // There's nothing that can possibly match afterwards.
8392 // Don't check the children.
8393 mightBeOnTrackedPath = false;
8394 } else {
8395 // Check the children, as they might reveal the next match.
8396 mightBeOnTrackedPath = true;
8397 }
8398 // In either case, since we have a match, we don't need
8399 // to check the siblings. They'll never match.
8400
8401 return false;
8402 }
8403 }
8404 // This Fiber's parent is on the path, but this Fiber itself isn't.
8405 // There's no need to check its children--they won't be on the path either.
8406
8407 mightBeOnTrackedPath = false;
8408 // However, one of its siblings may be on the path so keep searching.
8409
8410 return true;
8411 }
8412
8413 function updateTrackedPathStateAfterMount(mightSiblingsBeOnTrackedPath) {
8414 // updateTrackedPathStateBeforeMount() told us whether to match siblings.
8415 // Now that we're entering siblings, let's use that information.
8416 mightBeOnTrackedPath = mightSiblingsBeOnTrackedPath;
8417 }
8418 // Roots don't have a real persistent identity.
8419 // A root's "pseudo key" is "childDisplayName:indexWithThatName".
8420 // For example, "App:0" or, in case of similar roots, "Story:0", "Story:1", etc.
8421 // We will use this to try to disambiguate roots when restoring selection between reloads.
8422
8423 const rootPseudoKeys = new Map();
8424 const rootDisplayNameCounter = new Map();
8425
8426 function setRootPseudoKey(id, fiber) {
8427 const name = getDisplayNameForRoot(fiber);
8428 const counter = rootDisplayNameCounter.get(name) || 0;
8429 rootDisplayNameCounter.set(name, counter + 1);
8430 const pseudoKey = `${name}:${counter}`;
8431 rootPseudoKeys.set(id, pseudoKey);
8432 }
8433
8434 function removeRootPseudoKey(id) {
8435 const pseudoKey = rootPseudoKeys.get(id);
8436
8437 if (pseudoKey === undefined) {
8438 throw new Error('Expected root pseudo key to be known.');
8439 }
8440
8441 const name = pseudoKey.substring(0, pseudoKey.lastIndexOf(':'));
8442 const counter = rootDisplayNameCounter.get(name);
8443
8444 if (counter === undefined) {
8445 throw new Error('Expected counter to be known.');
8446 }
8447
8448 if (counter > 1) {
8449 rootDisplayNameCounter.set(name, counter - 1);
8450 } else {
8451 rootDisplayNameCounter.delete(name);
8452 }
8453
8454 rootPseudoKeys.delete(id);
8455 }
8456
8457 function getDisplayNameForRoot(fiber) {
8458 let preferredDisplayName = null;
8459 let fallbackDisplayName = null;
8460 let child = fiber.child;
8461 // Go at most three levels deep into direct children
8462 // while searching for a child that has a displayName.
8463
8464 for (let i = 0; i < 3; i++) {
8465 if (child === null) {
8466 break;
8467 }
8468
8469 const displayName = getDisplayNameForFiber(child);
8470
8471 if (displayName !== null) {
8472 // Prefer display names that we get from user-defined components.
8473 // We want to avoid using e.g. 'Suspense' unless we find nothing else.
8474 if (typeof child.type === 'function') {
8475 // There's a few user-defined tags, but we'll prefer the ones
8476 // that are usually explicitly named (function or class components).
8477 preferredDisplayName = displayName;
8478 } else if (fallbackDisplayName === null) {
8479 fallbackDisplayName = displayName;
8480 }
8481 }
8482
8483 if (preferredDisplayName !== null) {
8484 break;
8485 }
8486
8487 child = child.child;
8488 }
8489
8490 return preferredDisplayName || fallbackDisplayName || 'Anonymous';
8491 }
8492
8493 function getPathFrame(fiber) {
8494 const key = fiber.key;
8495 let displayName = getDisplayNameForFiber(fiber);
8496 const index = fiber.index;
8497
8498 switch (fiber.tag) {
8499 case HostRoot:
8500 // Roots don't have a real displayName, index, or key.
8501 // Instead, we'll use the pseudo key (childDisplayName:indexWithThatName).
8502 const id = getFiberID(getPrimaryFiber(fiber));
8503 const pseudoKey = rootPseudoKeys.get(id);
8504
8505 if (pseudoKey === undefined) {
8506 throw new Error('Expected mounted root to have known pseudo key.');
8507 }
8508
8509 displayName = pseudoKey;
8510 break;
8511
8512 case HostComponent:
8513 displayName = fiber.type;
8514 break;
8515
8516 default:
8517 break;
8518 }
8519
8520 return {
8521 displayName,
8522 key,
8523 index
8524 };
8525 }
8526 // Produces a serializable representation that does a best effort
8527 // of identifying a particular Fiber between page reloads.
8528 // The return path will contain Fibers that are "invisible" to the store
8529 // because their keys and indexes are important to restoring the selection.
8530
8531 function getPathForElement(id) {
8532 let fiber = idToFiberMap.get(id);
8533
8534 if (fiber == null) {
8535 return null;
8536 }
8537
8538 const keyPath = [];
8539
8540 while (fiber !== null) {
8541 keyPath.push(getPathFrame(fiber));
8542 fiber = fiber.return;
8543 }
8544
8545 keyPath.reverse();
8546 return keyPath;
8547 }
8548
8549 function getBestMatchForTrackedPath() {
8550 if (trackedPath === null) {
8551 // Nothing to match.
8552 return null;
8553 }
8554
8555 if (trackedPathMatchFiber === null) {
8556 // We didn't find anything.
8557 return null;
8558 }
8559 // Find the closest Fiber store is aware of.
8560
8561 let fiber = trackedPathMatchFiber;
8562
8563 while (fiber !== null && shouldFilterFiber(fiber)) {
8564 fiber = fiber.return;
8565 }
8566
8567 if (fiber === null) {
8568 return null;
8569 }
8570
8571 return {
8572 id: getFiberID(getPrimaryFiber(fiber)),
8573 isFullMatch: trackedPathMatchDepth === trackedPath.length - 1
8574 };
8575 }
8576
8577 const formatPriorityLevel = priorityLevel=>{
8578 if (priorityLevel == null) {
8579 return 'Unknown';
8580 }
8581
8582 switch (priorityLevel) {
8583 case ImmediatePriority:
8584 return 'Immediate';
8585
8586 case UserBlockingPriority:
8587 return 'User-Blocking';
8588
8589 case NormalPriority:
8590 return 'Normal';
8591
8592 case LowPriority:
8593 return 'Low';
8594
8595 case IdlePriority:
8596 return 'Idle';
8597
8598 case NoPriority:
8599 default:
8600 return 'Unknown';
8601 }
8602 }
8603 ;
8604
8605 function setTraceUpdatesEnabled(isEnabled) {
8606 traceUpdatesEnabled = isEnabled;
8607 }
8608
8609 return {
8610 cleanup,
8611 copyElementPath,
8612 deletePath,
8613 findNativeNodesForFiberID,
8614 flushInitialOperations,
8615 getBestMatchForTrackedPath,
8616 getDisplayNameForFiberID,
8617 getFiberIDForNative,
8618 getInstanceAndStyle,
8619 getOwnersList,
8620 getPathForElement,
8621 getProfilingData,
8622 handleCommitFiberRoot,
8623 handleCommitFiberUnmount,
8624 inspectElement,
8625 logElementToConsole,
8626 prepareViewAttributeSource,
8627 prepareViewElementSource,
8628 overrideSuspense,
8629 overrideValueAtPath,
8630 renamePath,
8631 renderer,
8632 setTraceUpdatesEnabled,
8633 setTrackedPath,
8634 startProfiling,
8635 stopProfiling,
8636 storeAsGlobal,
8637 updateComponentFilters
8638 };
8639 }
8640
8641 /***/
8642 }
8643 ),
8644
8645 /***/
8646 4: /***/
8647 (function(module, __webpack_exports__, __webpack_require__) {
8648
8649 "use strict";
8650 /* harmony export (binding) */
8651 __webpack_require__.d(__webpack_exports__, "a", function() {
8652 return BLOCK_NUMBER;
8653 });
8654 /* harmony export (binding) */
8655 __webpack_require__.d(__webpack_exports__, "b", function() {
8656 return BLOCK_SYMBOL_STRING;
8657 });
8658 /* harmony export (binding) */
8659 __webpack_require__.d(__webpack_exports__, "c", function() {
8660 return CONCURRENT_MODE_NUMBER;
8661 });
8662 /* harmony export (binding) */
8663 __webpack_require__.d(__webpack_exports__, "d", function() {
8664 return CONCURRENT_MODE_SYMBOL_STRING;
8665 });
8666 /* harmony export (binding) */
8667 __webpack_require__.d(__webpack_exports__, "e", function() {
8668 return CONTEXT_NUMBER;
8669 });
8670 /* harmony export (binding) */
8671 __webpack_require__.d(__webpack_exports__, "f", function() {
8672 return CONTEXT_SYMBOL_STRING;
8673 });
8674 /* harmony export (binding) */
8675 __webpack_require__.d(__webpack_exports__, "g", function() {
8676 return DEPRECATED_ASYNC_MODE_SYMBOL_STRING;
8677 });
8678 /* unused harmony export ELEMENT_NUMBER */
8679 /* unused harmony export ELEMENT_SYMBOL_STRING */
8680 /* unused harmony export DEBUG_TRACING_MODE_NUMBER */
8681 /* unused harmony export DEBUG_TRACING_MODE_SYMBOL_STRING */
8682 /* harmony export (binding) */
8683 __webpack_require__.d(__webpack_exports__, "h", function() {
8684 return FORWARD_REF_NUMBER;
8685 });
8686 /* harmony export (binding) */
8687 __webpack_require__.d(__webpack_exports__, "i", function() {
8688 return FORWARD_REF_SYMBOL_STRING;
8689 });
8690 /* unused harmony export FRAGMENT_NUMBER */
8691 /* unused harmony export FRAGMENT_SYMBOL_STRING */
8692 /* unused harmony export FUNDAMENTAL_NUMBER */
8693 /* unused harmony export FUNDAMENTAL_SYMBOL_STRING */
8694 /* harmony export (binding) */
8695 __webpack_require__.d(__webpack_exports__, "j", function() {
8696 return LAZY_NUMBER;
8697 });
8698 /* harmony export (binding) */
8699 __webpack_require__.d(__webpack_exports__, "k", function() {
8700 return LAZY_SYMBOL_STRING;
8701 });
8702 /* harmony export (binding) */
8703 __webpack_require__.d(__webpack_exports__, "l", function() {
8704 return MEMO_NUMBER;
8705 });
8706 /* harmony export (binding) */
8707 __webpack_require__.d(__webpack_exports__, "m", function() {
8708 return MEMO_SYMBOL_STRING;
8709 });
8710 /* unused harmony export OPAQUE_ID_NUMBER */
8711 /* unused harmony export OPAQUE_ID_SYMBOL_STRING */
8712 /* unused harmony export PORTAL_NUMBER */
8713 /* unused harmony export PORTAL_SYMBOL_STRING */
8714 /* harmony export (binding) */
8715 __webpack_require__.d(__webpack_exports__, "n", function() {
8716 return PROFILER_NUMBER;
8717 });
8718 /* harmony export (binding) */
8719 __webpack_require__.d(__webpack_exports__, "o", function() {
8720 return PROFILER_SYMBOL_STRING;
8721 });
8722 /* harmony export (binding) */
8723 __webpack_require__.d(__webpack_exports__, "p", function() {
8724 return PROVIDER_NUMBER;
8725 });
8726 /* harmony export (binding) */
8727 __webpack_require__.d(__webpack_exports__, "q", function() {
8728 return PROVIDER_SYMBOL_STRING;
8729 });
8730 /* harmony export (binding) */
8731 __webpack_require__.d(__webpack_exports__, "r", function() {
8732 return SCOPE_NUMBER;
8733 });
8734 /* harmony export (binding) */
8735 __webpack_require__.d(__webpack_exports__, "s", function() {
8736 return SCOPE_SYMBOL_STRING;
8737 });
8738 /* unused harmony export SERVER_BLOCK_NUMBER */
8739 /* unused harmony export SERVER_BLOCK_SYMBOL_STRING */
8740 /* harmony export (binding) */
8741 __webpack_require__.d(__webpack_exports__, "t", function() {
8742 return STRICT_MODE_NUMBER;
8743 });
8744 /* harmony export (binding) */
8745 __webpack_require__.d(__webpack_exports__, "u", function() {
8746 return STRICT_MODE_SYMBOL_STRING;
8747 });
8748 /* harmony export (binding) */
8749 __webpack_require__.d(__webpack_exports__, "x", function() {
8750 return SUSPENSE_NUMBER;
8751 });
8752 /* harmony export (binding) */
8753 __webpack_require__.d(__webpack_exports__, "y", function() {
8754 return SUSPENSE_SYMBOL_STRING;
8755 });
8756 /* harmony export (binding) */
8757 __webpack_require__.d(__webpack_exports__, "v", function() {
8758 return SUSPENSE_LIST_NUMBER;
8759 });
8760 /* harmony export (binding) */
8761 __webpack_require__.d(__webpack_exports__, "w", function() {
8762 return SUSPENSE_LIST_SYMBOL_STRING;
8763 });
8764 /**
8765 * Copyright (c) Facebook, Inc. and its affiliates.
8766 *
8767 * This source code is licensed under the MIT license found in the
8768 * LICENSE file in the root directory of this source tree.
8769 *
8770 *
8771 */
8772 // This list should be kept updated to reflect additions to 'shared/ReactSymbols'.
8773 // DevTools can't import symbols from 'shared/ReactSymbols' directly for two reasons:
8774 // 1. DevTools requires symbols which may have been deleted in more recent versions (e.g. concurrent mode)
8775 // 2. DevTools must support both Symbol and numeric forms of each symbol;
8776 // Since e.g. standalone DevTools runs in a separate process, it can't rely on its own ES capabilities.
8777 const BLOCK_NUMBER = 0xead9;
8778 const BLOCK_SYMBOL_STRING = 'Symbol(react.block)';
8779 const CONCURRENT_MODE_NUMBER = 0xeacf;
8780 const CONCURRENT_MODE_SYMBOL_STRING = 'Symbol(react.concurrent_mode)';
8781 const CONTEXT_NUMBER = 0xeace;
8782 const CONTEXT_SYMBOL_STRING = 'Symbol(react.context)';
8783 const DEPRECATED_ASYNC_MODE_SYMBOL_STRING = 'Symbol(react.async_mode)';
8784 const ELEMENT_NUMBER = 0xeac7;
8785 const ELEMENT_SYMBOL_STRING = 'Symbol(react.element)';
8786 const DEBUG_TRACING_MODE_NUMBER = 0xeae1;
8787 const DEBUG_TRACING_MODE_SYMBOL_STRING = 'Symbol(react.debug_trace_mode)';
8788 const FORWARD_REF_NUMBER = 0xead0;
8789 const FORWARD_REF_SYMBOL_STRING = 'Symbol(react.forward_ref)';
8790 const FRAGMENT_NUMBER = 0xeacb;
8791 const FRAGMENT_SYMBOL_STRING = 'Symbol(react.fragment)';
8792 const FUNDAMENTAL_NUMBER = 0xead5;
8793 const FUNDAMENTAL_SYMBOL_STRING = 'Symbol(react.fundamental)';
8794 const LAZY_NUMBER = 0xead4;
8795 const LAZY_SYMBOL_STRING = 'Symbol(react.lazy)';
8796 const MEMO_NUMBER = 0xead3;
8797 const MEMO_SYMBOL_STRING = 'Symbol(react.memo)';
8798 const OPAQUE_ID_NUMBER = 0xeae0;
8799 const OPAQUE_ID_SYMBOL_STRING = 'Symbol(react.opaque.id)';
8800 const PORTAL_NUMBER = 0xeaca;
8801 const PORTAL_SYMBOL_STRING = 'Symbol(react.portal)';
8802 const PROFILER_NUMBER = 0xead2;
8803 const PROFILER_SYMBOL_STRING = 'Symbol(react.profiler)';
8804 const PROVIDER_NUMBER = 0xeacd;
8805 const PROVIDER_SYMBOL_STRING = 'Symbol(react.provider)';
8806 const SCOPE_NUMBER = 0xead7;
8807 const SCOPE_SYMBOL_STRING = 'Symbol(react.scope)';
8808 const SERVER_BLOCK_NUMBER = 0xeada;
8809 const SERVER_BLOCK_SYMBOL_STRING = 'Symbol(react.server.block)';
8810 const STRICT_MODE_NUMBER = 0xeacc;
8811 const STRICT_MODE_SYMBOL_STRING = 'Symbol(react.strict_mode)';
8812 const SUSPENSE_NUMBER = 0xead1;
8813 const SUSPENSE_SYMBOL_STRING = 'Symbol(react.suspense)';
8814 const SUSPENSE_LIST_NUMBER = 0xead8;
8815 const SUSPENSE_LIST_SYMBOL_STRING = 'Symbol(react.suspense_list)';
8816
8817 /***/
8818 }
8819 ),
8820
8821 /***/
8822 45: /***/
8823 (function(module, exports) {
8824
8825 // shim for using process in browser
8826 var process = module.exports = {};
8827 // cached from whatever global is present so that test runners that stub it
8828 // don't break things. But we need to wrap it in a try catch in case it is
8829 // wrapped in strict mode code which doesn't define any globals. It's inside a
8830 // function because try/catches deoptimize in certain engines.
8831
8832 var cachedSetTimeout;
8833 var cachedClearTimeout;
8834
8835 function defaultSetTimout() {
8836 throw new Error('setTimeout has not been defined');
8837 }
8838
8839 function defaultClearTimeout() {
8840 throw new Error('clearTimeout has not been defined');
8841 }
8842
8843 (function() {
8844 try {
8845 if (typeof setTimeout === 'function') {
8846 cachedSetTimeout = setTimeout;
8847 } else {
8848 cachedSetTimeout = defaultSetTimout;
8849 }
8850 } catch (e) {
8851 cachedSetTimeout = defaultSetTimout;
8852 }
8853
8854 try {
8855 if (typeof clearTimeout === 'function') {
8856 cachedClearTimeout = clearTimeout;
8857 } else {
8858 cachedClearTimeout = defaultClearTimeout;
8859 }
8860 } catch (e) {
8861 cachedClearTimeout = defaultClearTimeout;
8862 }
8863 }
8864 )();
8865
8866 function runTimeout(fun) {
8867 if (cachedSetTimeout === setTimeout) {
8868 //normal enviroments in sane situations
8869 return setTimeout(fun, 0);
8870 }
8871 // if setTimeout wasn't available but was latter defined
8872
8873 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
8874 cachedSetTimeout = setTimeout;
8875 return setTimeout(fun, 0);
8876 }
8877
8878 try {
8879 // when when somebody has screwed with setTimeout but no I.E. maddness
8880 return cachedSetTimeout(fun, 0);
8881 } catch (e) {
8882 try {
8883 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
8884 return cachedSetTimeout.call(null, fun, 0);
8885 } catch (e) {
8886 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
8887 return cachedSetTimeout.call(this, fun, 0);
8888 }
8889 }
8890 }
8891
8892 function runClearTimeout(marker) {
8893 if (cachedClearTimeout === clearTimeout) {
8894 //normal enviroments in sane situations
8895 return clearTimeout(marker);
8896 }
8897 // if clearTimeout wasn't available but was latter defined
8898
8899 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
8900 cachedClearTimeout = clearTimeout;
8901 return clearTimeout(marker);
8902 }
8903
8904 try {
8905 // when when somebody has screwed with setTimeout but no I.E. maddness
8906 return cachedClearTimeout(marker);
8907 } catch (e) {
8908 try {
8909 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
8910 return cachedClearTimeout.call(null, marker);
8911 } catch (e) {
8912 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
8913 // Some versions of I.E. have different rules for clearTimeout vs setTimeout
8914 return cachedClearTimeout.call(this, marker);
8915 }
8916 }
8917 }
8918
8919 var queue = [];
8920 var draining = false;
8921 var currentQueue;
8922 var queueIndex = -1;
8923
8924 function cleanUpNextTick() {
8925 if (!draining || !currentQueue) {
8926 return;
8927 }
8928
8929 draining = false;
8930
8931 if (currentQueue.length) {
8932 queue = currentQueue.concat(queue);
8933 } else {
8934 queueIndex = -1;
8935 }
8936
8937 if (queue.length) {
8938 drainQueue();
8939 }
8940 }
8941
8942 function drainQueue() {
8943 if (draining) {
8944 return;
8945 }
8946
8947 var timeout = runTimeout(cleanUpNextTick);
8948 draining = true;
8949 var len = queue.length;
8950
8951 while (len) {
8952 currentQueue = queue;
8953 queue = [];
8954
8955 while (++queueIndex < len) {
8956 if (currentQueue) {
8957 currentQueue[queueIndex].run();
8958 }
8959 }
8960
8961 queueIndex = -1;
8962 len = queue.length;
8963 }
8964
8965 currentQueue = null;
8966 draining = false;
8967 runClearTimeout(timeout);
8968 }
8969
8970 process.nextTick = function(fun) {
8971 var args = new Array(arguments.length - 1);
8972
8973 if (arguments.length > 1) {
8974 for (var i = 1; i < arguments.length; i++) {
8975 args[i - 1] = arguments[i];
8976 }
8977 }
8978
8979 queue.push(new Item(fun,args));
8980
8981 if (queue.length === 1 && !draining) {
8982 runTimeout(drainQueue);
8983 }
8984 }
8985 ;
8986 // v8 likes predictible objects
8987
8988 function Item(fun, array) {
8989 this.fun = fun;
8990 this.array = array;
8991 }
8992
8993 Item.prototype.run = function() {
8994 this.fun.apply(null, this.array);
8995 }
8996 ;
8997
8998 process.title = 'browser';
8999 process.browser = true;
9000 process.env = {};
9001 process.argv = [];
9002 process.version = '';
9003 // empty string to avoid regexp issues
9004
9005 process.versions = {};
9006
9007 function noop() {}
9008
9009 process.on = noop;
9010 process.addListener = noop;
9011 process.once = noop;
9012 process.off = noop;
9013 process.removeListener = noop;
9014 process.removeAllListeners = noop;
9015 process.emit = noop;
9016 process.prependListener = noop;
9017 process.prependOnceListener = noop;
9018
9019 process.listeners = function(name) {
9020 return [];
9021 }
9022 ;
9023
9024 process.binding = function(name) {
9025 throw new Error('process.binding is not supported');
9026 }
9027 ;
9028
9029 process.cwd = function() {
9030 return '/';
9031 }
9032 ;
9033
9034 process.chdir = function(dir) {
9035 throw new Error('process.chdir is not supported');
9036 }
9037 ;
9038
9039 process.umask = function() {
9040 return 0;
9041 }
9042 ;
9043
9044 /***/
9045 }
9046 ),
9047
9048 /***/
9049 46: /***/
9050 (function(module, exports, __webpack_require__) {
9051
9052 "use strict";
9053
9054 module.exports = Yallist;
9055 Yallist.Node = Node;
9056 Yallist.create = Yallist;
9057
9058 function Yallist(list) {
9059 var self = this;
9060
9061 if (!(self instanceof Yallist)) {
9062 self = new Yallist();
9063 }
9064
9065 self.tail = null;
9066 self.head = null;
9067 self.length = 0;
9068
9069 if (list && typeof list.forEach === 'function') {
9070 list.forEach(function(item) {
9071 self.push(item);
9072 });
9073 } else if (arguments.length > 0) {
9074 for (var i = 0, l = arguments.length; i < l; i++) {
9075 self.push(arguments[i]);
9076 }
9077 }
9078
9079 return self;
9080 }
9081
9082 Yallist.prototype.removeNode = function(node) {
9083 if (node.list !== this) {
9084 throw new Error('removing node which does not belong to this list');
9085 }
9086
9087 var next = node.next;
9088 var prev = node.prev;
9089
9090 if (next) {
9091 next.prev = prev;
9092 }
9093
9094 if (prev) {
9095 prev.next = next;
9096 }
9097
9098 if (node === this.head) {
9099 this.head = next;
9100 }
9101
9102 if (node === this.tail) {
9103 this.tail = prev;
9104 }
9105
9106 node.list.length--;
9107 node.next = null;
9108 node.prev = null;
9109 node.list = null;
9110 return next;
9111 }
9112 ;
9113
9114 Yallist.prototype.unshiftNode = function(node) {
9115 if (node === this.head) {
9116 return;
9117 }
9118
9119 if (node.list) {
9120 node.list.removeNode(node);
9121 }
9122
9123 var head = this.head;
9124 node.list = this;
9125 node.next = head;
9126
9127 if (head) {
9128 head.prev = node;
9129 }
9130
9131 this.head = node;
9132
9133 if (!this.tail) {
9134 this.tail = node;
9135 }
9136
9137 this.length++;
9138 }
9139 ;
9140
9141 Yallist.prototype.pushNode = function(node) {
9142 if (node === this.tail) {
9143 return;
9144 }
9145
9146 if (node.list) {
9147 node.list.removeNode(node);
9148 }
9149
9150 var tail = this.tail;
9151 node.list = this;
9152 node.prev = tail;
9153
9154 if (tail) {
9155 tail.next = node;
9156 }
9157
9158 this.tail = node;
9159
9160 if (!this.head) {
9161 this.head = node;
9162 }
9163
9164 this.length++;
9165 }
9166 ;
9167
9168 Yallist.prototype.push = function() {
9169 for (var i = 0, l = arguments.length; i < l; i++) {
9170 push(this, arguments[i]);
9171 }
9172
9173 return this.length;
9174 }
9175 ;
9176
9177 Yallist.prototype.unshift = function() {
9178 for (var i = 0, l = arguments.length; i < l; i++) {
9179 unshift(this, arguments[i]);
9180 }
9181
9182 return this.length;
9183 }
9184 ;
9185
9186 Yallist.prototype.pop = function() {
9187 if (!this.tail) {
9188 return undefined;
9189 }
9190
9191 var res = this.tail.value;
9192 this.tail = this.tail.prev;
9193
9194 if (this.tail) {
9195 this.tail.next = null;
9196 } else {
9197 this.head = null;
9198 }
9199
9200 this.length--;
9201 return res;
9202 }
9203 ;
9204
9205 Yallist.prototype.shift = function() {
9206 if (!this.head) {
9207 return undefined;
9208 }
9209
9210 var res = this.head.value;
9211 this.head = this.head.next;
9212
9213 if (this.head) {
9214 this.head.prev = null;
9215 } else {
9216 this.tail = null;
9217 }
9218
9219 this.length--;
9220 return res;
9221 }
9222 ;
9223
9224 Yallist.prototype.forEach = function(fn, thisp) {
9225 thisp = thisp || this;
9226
9227 for (var walker = this.head, i = 0; walker !== null; i++) {
9228 fn.call(thisp, walker.value, i, this);
9229 walker = walker.next;
9230 }
9231 }
9232 ;
9233
9234 Yallist.prototype.forEachReverse = function(fn, thisp) {
9235 thisp = thisp || this;
9236
9237 for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
9238 fn.call(thisp, walker.value, i, this);
9239 walker = walker.prev;
9240 }
9241 }
9242 ;
9243
9244 Yallist.prototype.get = function(n) {
9245 for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
9246 // abort out of the list early if we hit a cycle
9247 walker = walker.next;
9248 }
9249
9250 if (i === n && walker !== null) {
9251 return walker.value;
9252 }
9253 }
9254 ;
9255
9256 Yallist.prototype.getReverse = function(n) {
9257 for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
9258 // abort out of the list early if we hit a cycle
9259 walker = walker.prev;
9260 }
9261
9262 if (i === n && walker !== null) {
9263 return walker.value;
9264 }
9265 }
9266 ;
9267
9268 Yallist.prototype.map = function(fn, thisp) {
9269 thisp = thisp || this;
9270 var res = new Yallist();
9271
9272 for (var walker = this.head; walker !== null; ) {
9273 res.push(fn.call(thisp, walker.value, this));
9274 walker = walker.next;
9275 }
9276
9277 return res;
9278 }
9279 ;
9280
9281 Yallist.prototype.mapReverse = function(fn, thisp) {
9282 thisp = thisp || this;
9283 var res = new Yallist();
9284
9285 for (var walker = this.tail; walker !== null; ) {
9286 res.push(fn.call(thisp, walker.value, this));
9287 walker = walker.prev;
9288 }
9289
9290 return res;
9291 }
9292 ;
9293
9294 Yallist.prototype.reduce = function(fn, initial) {
9295 var acc;
9296 var walker = this.head;
9297
9298 if (arguments.length > 1) {
9299 acc = initial;
9300 } else if (this.head) {
9301 walker = this.head.next;
9302 acc = this.head.value;
9303 } else {
9304 throw new TypeError('Reduce of empty list with no initial value');
9305 }
9306
9307 for (var i = 0; walker !== null; i++) {
9308 acc = fn(acc, walker.value, i);
9309 walker = walker.next;
9310 }
9311
9312 return acc;
9313 }
9314 ;
9315
9316 Yallist.prototype.reduceReverse = function(fn, initial) {
9317 var acc;
9318 var walker = this.tail;
9319
9320 if (arguments.length > 1) {
9321 acc = initial;
9322 } else if (this.tail) {
9323 walker = this.tail.prev;
9324 acc = this.tail.value;
9325 } else {
9326 throw new TypeError('Reduce of empty list with no initial value');
9327 }
9328
9329 for (var i = this.length - 1; walker !== null; i--) {
9330 acc = fn(acc, walker.value, i);
9331 walker = walker.prev;
9332 }
9333
9334 return acc;
9335 }
9336 ;
9337
9338 Yallist.prototype.toArray = function() {
9339 var arr = new Array(this.length);
9340
9341 for (var i = 0, walker = this.head; walker !== null; i++) {
9342 arr[i] = walker.value;
9343 walker = walker.next;
9344 }
9345
9346 return arr;
9347 }
9348 ;
9349
9350 Yallist.prototype.toArrayReverse = function() {
9351 var arr = new Array(this.length);
9352
9353 for (var i = 0, walker = this.tail; walker !== null; i++) {
9354 arr[i] = walker.value;
9355 walker = walker.prev;
9356 }
9357
9358 return arr;
9359 }
9360 ;
9361
9362 Yallist.prototype.slice = function(from, to) {
9363 to = to || this.length;
9364
9365 if (to < 0) {
9366 to += this.length;
9367 }
9368
9369 from = from || 0;
9370
9371 if (from < 0) {
9372 from += this.length;
9373 }
9374
9375 var ret = new Yallist();
9376
9377 if (to < from || to < 0) {
9378 return ret;
9379 }
9380
9381 if (from < 0) {
9382 from = 0;
9383 }
9384
9385 if (to > this.length) {
9386 to = this.length;
9387 }
9388
9389 for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
9390 walker = walker.next;
9391 }
9392
9393 for (; walker !== null && i < to; i++,
9394 walker = walker.next) {
9395 ret.push(walker.value);
9396 }
9397
9398 return ret;
9399 }
9400 ;
9401
9402 Yallist.prototype.sliceReverse = function(from, to) {
9403 to = to || this.length;
9404
9405 if (to < 0) {
9406 to += this.length;
9407 }
9408
9409 from = from || 0;
9410
9411 if (from < 0) {
9412 from += this.length;
9413 }
9414
9415 var ret = new Yallist();
9416
9417 if (to < from || to < 0) {
9418 return ret;
9419 }
9420
9421 if (from < 0) {
9422 from = 0;
9423 }
9424
9425 if (to > this.length) {
9426 to = this.length;
9427 }
9428
9429 for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
9430 walker = walker.prev;
9431 }
9432
9433 for (; walker !== null && i > from; i--,
9434 walker = walker.prev) {
9435 ret.push(walker.value);
9436 }
9437
9438 return ret;
9439 }
9440 ;
9441
9442 Yallist.prototype.splice = function(start, deleteCount /*, ...nodes */
9443 ) {
9444 if (start > this.length) {
9445 start = this.length - 1;
9446 }
9447
9448 if (start < 0) {
9449 start = this.length + start;
9450 }
9451
9452 for (var i = 0, walker = this.head; walker !== null && i < start; i++) {
9453 walker = walker.next;
9454 }
9455
9456 var ret = [];
9457
9458 for (var i = 0; walker && i < deleteCount; i++) {
9459 ret.push(walker.value);
9460 walker = this.removeNode(walker);
9461 }
9462
9463 if (walker === null) {
9464 walker = this.tail;
9465 }
9466
9467 if (walker !== this.head && walker !== this.tail) {
9468 walker = walker.prev;
9469 }
9470
9471 for (var i = 2; i < arguments.length; i++) {
9472 walker = insert(this, walker, arguments[i]);
9473 }
9474
9475 return ret;
9476 }
9477 ;
9478
9479 Yallist.prototype.reverse = function() {
9480 var head = this.head;
9481 var tail = this.tail;
9482
9483 for (var walker = head; walker !== null; walker = walker.prev) {
9484 var p = walker.prev;
9485 walker.prev = walker.next;
9486 walker.next = p;
9487 }
9488
9489 this.head = tail;
9490 this.tail = head;
9491 return this;
9492 }
9493 ;
9494
9495 function insert(self, node, value) {
9496 var inserted = node === self.head ? new Node(value,null,node,self) : new Node(value,node,node.next,self);
9497
9498 if (inserted.next === null) {
9499 self.tail = inserted;
9500 }
9501
9502 if (inserted.prev === null) {
9503 self.head = inserted;
9504 }
9505
9506 self.length++;
9507 return inserted;
9508 }
9509
9510 function push(self, item) {
9511 self.tail = new Node(item,self.tail,null,self);
9512
9513 if (!self.head) {
9514 self.head = self.tail;
9515 }
9516
9517 self.length++;
9518 }
9519
9520 function unshift(self, item) {
9521 self.head = new Node(item,null,self.head,self);
9522
9523 if (!self.tail) {
9524 self.tail = self.head;
9525 }
9526
9527 self.length++;
9528 }
9529
9530 function Node(value, prev, next, list) {
9531 if (!(this instanceof Node)) {
9532 return new Node(value,prev,next,list);
9533 }
9534
9535 this.list = list;
9536 this.value = value;
9537
9538 if (prev) {
9539 prev.next = this;
9540 this.prev = prev;
9541 } else {
9542 this.prev = null;
9543 }
9544
9545 if (next) {
9546 next.prev = this;
9547 this.next = next;
9548 } else {
9549 this.next = null;
9550 }
9551 }
9552
9553 try {
9554 // add if support for Symbol.iterator is present
9555 __webpack_require__(47)(Yallist);
9556 } catch (er) {}
9557
9558 /***/
9559 }
9560 ),
9561
9562 /***/
9563 47: /***/
9564 (function(module, exports, __webpack_require__) {
9565
9566 "use strict";
9567
9568 module.exports = function(Yallist) {
9569 Yallist.prototype[Symbol.iterator] = /*#__PURE__*/
9570 regeneratorRuntime.mark(function _callee() {
9571 var walker;
9572 return regeneratorRuntime.wrap(function _callee$(_context) {
9573 while (1)
9574 switch (_context.prev = _context.next) {
9575 case 0:
9576 walker = this.head;
9577
9578 case 1:
9579 if (!walker) {
9580 _context.next = 7;
9581 break;
9582 }
9583
9584 _context.next = 4;
9585 return walker.value;
9586
9587 case 4:
9588 walker = walker.next;
9589 _context.next = 1;
9590 break;
9591
9592 case 7:
9593 case "end":
9594 return _context.stop();
9595 }
9596 }, _callee, this);
9597 });
9598 }
9599 ;
9600
9601 /***/
9602 }
9603 ),
9604
9605 /***/
9606 48: /***/
9607 (function(module, exports, __webpack_require__) {
9608
9609 "use strict";
9610 /** @license React v0.0.0-experimental-51a3aa6af
9611 * react-is.production.min.js
9612 *
9613 * Copyright (c) Facebook, Inc. and its affiliates.
9614 *
9615 * This source code is licensed under the MIT license found in the
9616 * LICENSE file in the root directory of this source tree.
9617 */
9618
9619 var b = 60103
9620 , c = 60106
9621 , d = 60107
9622 , e = 60108
9623 , f = 60114
9624 , g = 60109
9625 , h = 60110
9626 , k = 60112
9627 , l = 60113
9628 , m = 60120
9629 , n = 60115
9630 , p = 60116
9631 , q = 60121
9632 , r = 60122
9633 , u = 60117
9634 , v = 60129
9635 , w = 60131;
9636
9637 if ("function" === typeof Symbol && Symbol.for) {
9638 var x = Symbol.for;
9639 b = x("react.element");
9640 c = x("react.portal");
9641 d = x("react.fragment");
9642 e = x("react.strict_mode");
9643 f = x("react.profiler");
9644 g = x("react.provider");
9645 h = x("react.context");
9646 k = x("react.forward_ref");
9647 l = x("react.suspense");
9648 m = x("react.suspense_list");
9649 n = x("react.memo");
9650 p = x("react.lazy");
9651 q = x("react.block");
9652 r = x("react.server.block");
9653 u = x("react.fundamental");
9654 v = x("react.debug_trace_mode");
9655 w = x("react.legacy_hidden");
9656 }
9657
9658 function y(a) {
9659 if ("object" === typeof a && null !== a) {
9660 var t = a.$$typeof;
9661
9662 switch (t) {
9663 case b:
9664 switch (a = a.type,
9665 a) {
9666 case d:
9667 case f:
9668 case e:
9669 case l:
9670 case m:
9671 return a;
9672
9673 default:
9674 switch (a = a && a.$$typeof,
9675 a) {
9676 case h:
9677 case k:
9678 case p:
9679 case n:
9680 case g:
9681 return a;
9682
9683 default:
9684 return t;
9685 }
9686
9687 }
9688
9689 case c:
9690 return t;
9691 }
9692 }
9693 }
9694
9695 var z = g
9696 , A = b
9697 , B = k
9698 , C = d
9699 , D = p
9700 , E = n
9701 , F = c
9702 , G = f
9703 , H = e
9704 , I = l;
9705 exports.ContextConsumer = h;
9706 exports.ContextProvider = z;
9707 exports.Element = A;
9708 exports.ForwardRef = B;
9709 exports.Fragment = C;
9710 exports.Lazy = D;
9711 exports.Memo = E;
9712 exports.Portal = F;
9713 exports.Profiler = G;
9714 exports.StrictMode = H;
9715 exports.Suspense = I;
9716
9717 exports.isAsyncMode = function() {
9718 return !1;
9719 }
9720 ;
9721
9722 exports.isConcurrentMode = function() {
9723 return !1;
9724 }
9725 ;
9726
9727 exports.isContextConsumer = function(a) {
9728 return y(a) === h;
9729 }
9730 ;
9731
9732 exports.isContextProvider = function(a) {
9733 return y(a) === g;
9734 }
9735 ;
9736
9737 exports.isElement = function(a) {
9738 return "object" === typeof a && null !== a && a.$$typeof === b;
9739 }
9740 ;
9741
9742 exports.isForwardRef = function(a) {
9743 return y(a) === k;
9744 }
9745 ;
9746
9747 exports.isFragment = function(a) {
9748 return y(a) === d;
9749 }
9750 ;
9751
9752 exports.isLazy = function(a) {
9753 return y(a) === p;
9754 }
9755 ;
9756
9757 exports.isMemo = function(a) {
9758 return y(a) === n;
9759 }
9760 ;
9761
9762 exports.isPortal = function(a) {
9763 return y(a) === c;
9764 }
9765 ;
9766
9767 exports.isProfiler = function(a) {
9768 return y(a) === f;
9769 }
9770 ;
9771
9772 exports.isStrictMode = function(a) {
9773 return y(a) === e;
9774 }
9775 ;
9776
9777 exports.isSuspense = function(a) {
9778 return y(a) === l;
9779 }
9780 ;
9781
9782 exports.isValidElementType = function(a) {
9783 return "string" === typeof a || "function" === typeof a || a === d || a === f || a === v || a === e || a === l || a === m || a === w || "object" === typeof a && null !== a && (a.$$typeof === p || a.$$typeof === n || a.$$typeof === g || a.$$typeof === h || a.$$typeof === k || a.$$typeof === u || a.$$typeof === q || a[0] === r) ? !0 : !1;
9784 }
9785 ;
9786
9787 exports.typeOf = y;
9788
9789 /***/
9790 }
9791 ),
9792
9793 /***/
9794 49: /***/
9795 (function(module, __webpack_exports__, __webpack_require__) {
9796
9797 "use strict";
9798 __webpack_require__.r(__webpack_exports__);
9799 /* harmony default export */
9800 __webpack_exports__["default"] = (":root {\n /**\n * IMPORTANT: When new theme variables are added below– also add them to SettingsContext updateThemeVariables()\n */\n\n /* Light theme */\n --light-color-attribute-name: #ef6632;\n --light-color-attribute-name-not-editable: #23272f;\n --light-color-attribute-name-inverted: rgba(255, 255, 255, 0.7);\n --light-color-attribute-value: #1a1aa6;\n --light-color-attribute-value-inverted: #ffffff;\n --light-color-attribute-editable-value: #1a1aa6;\n --light-color-background: #ffffff;\n --light-color-background-hover: rgba(0, 136, 250, 0.1);\n --light-color-background-inactive: #e5e5e5;\n --light-color-background-invalid: #fff0f0;\n --light-color-background-selected: #0088fa;\n --light-color-button-background: #ffffff;\n --light-color-button-background-focus: #ededed;\n --light-color-button: #5f6673;\n --light-color-button-disabled: #cfd1d5;\n --light-color-button-active: #0088fa;\n --light-color-button-focus: #23272f;\n --light-color-button-hover: #23272f;\n --light-color-border: #eeeeee;\n --light-color-commit-did-not-render-fill: #cfd1d5;\n --light-color-commit-did-not-render-fill-text: #000000;\n --light-color-commit-did-not-render-pattern: #cfd1d5;\n --light-color-commit-did-not-render-pattern-text: #333333;\n --light-color-commit-gradient-0: #37afa9;\n --light-color-commit-gradient-1: #63b19e;\n --light-color-commit-gradient-2: #80b393;\n --light-color-commit-gradient-3: #97b488;\n --light-color-commit-gradient-4: #abb67d;\n --light-color-commit-gradient-5: #beb771;\n --light-color-commit-gradient-6: #cfb965;\n --light-color-commit-gradient-7: #dfba57;\n --light-color-commit-gradient-8: #efbb49;\n --light-color-commit-gradient-9: #febc38;\n --light-color-commit-gradient-text: #000000;\n --light-color-component-name: #6a51b2;\n --light-color-component-name-inverted: #ffffff;\n --light-color-component-badge-background: rgba(0, 0, 0, 0.1);\n --light-color-component-badge-background-inverted: rgba(255, 255, 255, 0.25);\n --light-color-component-badge-count: #777d88;\n --light-color-component-badge-count-inverted: rgba(255, 255, 255, 0.7);\n --light-color-context-background: rgba(0,0,0,.9);\n --light-color-context-background-hover: rgba(255, 255, 255, 0.1);\n --light-color-context-background-selected: #178fb9;\n --light-color-context-border: #3d424a;\n --light-color-context-text: #ffffff;\n --light-color-context-text-selected: #ffffff;\n --light-color-dim: #777d88;\n --light-color-dimmer: #cfd1d5;\n --light-color-dimmest: #eff0f1;\n --light-color-error-background: hsl(0, 100%, 97%);\n --light-color-error-border: hsl(0, 100%, 92%);\n --light-color-error-text: #ff0000;\n --light-color-expand-collapse-toggle: #777d88;\n --light-color-link: #0000ff;\n --light-color-modal-background: rgba(255, 255, 255, 0.75);\n --light-color-record-active: #fc3a4b;\n --light-color-record-hover: #3578e5;\n --light-color-record-inactive: #0088fa;\n --light-color-scroll-thumb: #c2c2c2;\n --light-color-scroll-track: #fafafa;\n --light-color-search-match: yellow;\n --light-color-search-match-current: #f7923b;\n --light-color-selected-tree-highlight-active: rgba(0, 136, 250, 0.1);\n --light-color-selected-tree-highlight-inactive: rgba(0, 0, 0, 0.05);\n --light-color-shadow: rgba(0, 0, 0, 0.25);\n --light-color-tab-selected-border: #0088fa;\n --light-color-text: #000000;\n --light-color-text-invalid: #ff0000;\n --light-color-text-selected: #ffffff;\n --light-color-toggle-background-invalid: #fc3a4b;\n --light-color-toggle-background-on: #0088fa;\n --light-color-toggle-background-off: #cfd1d5;\n --light-color-toggle-text: #ffffff;\n --light-color-tooltip-background: rgba(0, 0, 0, 0.9);\n --light-color-tooltip-text: #ffffff;\n\n /* Dark theme */\n --dark-color-attribute-name: #9d87d2;\n --dark-color-attribute-name-not-editable: #ededed;\n --dark-color-attribute-name-inverted: #282828;\n --dark-color-attribute-value: #cedae0;\n --dark-color-attribute-value-inverted: #ffffff;\n --dark-color-attribute-editable-value: yellow;\n --dark-color-background: #282c34;\n --dark-color-background-hover: rgba(255, 255, 255, 0.1);\n --dark-color-background-inactive: #3d424a;\n --dark-color-background-invalid: #5c0000;\n --dark-color-background-selected: #178fb9;\n --dark-color-button-background: #282c34;\n --dark-color-button-background-focus: #3d424a;\n --dark-color-button: #afb3b9;\n --dark-color-button-active: #61dafb;\n --dark-color-button-disabled: #4f5766;\n --dark-color-button-focus: #a2e9fc;\n --dark-color-button-hover: #ededed;\n --dark-color-border: #3d424a;\n --dark-color-commit-did-not-render-fill: #777d88;\n --dark-color-commit-did-not-render-fill-text: #000000;\n --dark-color-commit-did-not-render-pattern: #666c77;\n --dark-color-commit-did-not-render-pattern-text: #ffffff;\n --dark-color-commit-gradient-0: #37afa9;\n --dark-color-commit-gradient-1: #63b19e;\n --dark-color-commit-gradient-2: #80b393;\n --dark-color-commit-gradient-3: #97b488;\n --dark-color-commit-gradient-4: #abb67d;\n --dark-color-commit-gradient-5: #beb771;\n --dark-color-commit-gradient-6: #cfb965;\n --dark-color-commit-gradient-7: #dfba57;\n --dark-color-commit-gradient-8: #efbb49;\n --dark-color-commit-gradient-9: #febc38;\n --dark-color-commit-gradient-text: #000000;\n --dark-color-component-name: #61dafb;\n --dark-color-component-name-inverted: #282828;\n --dark-color-component-badge-background: rgba(255, 255, 255, 0.25);\n --dark-color-component-badge-background-inverted: rgba(0, 0, 0, 0.25);\n --dark-color-component-badge-count: #8f949d;\n --dark-color-component-badge-count-inverted: rgba(255, 255, 255, 0.7);\n --dark-color-context-background: rgba(255,255,255,.9);\n --dark-color-context-background-hover: rgba(0, 136, 250, 0.1);\n --dark-color-context-background-selected: #0088fa;\n --dark-color-context-border: #eeeeee;\n --dark-color-context-text: #000000;\n --dark-color-context-text-selected: #ffffff;\n --dark-color-dim: #8f949d;\n --dark-color-dimmer: #777d88;\n --dark-color-dimmest: #4f5766;\n --dark-color-error-background: #200;\n --dark-color-error-border: #900;\n --dark-color-error-text: #f55;\n --dark-color-expand-collapse-toggle: #8f949d;\n --dark-color-link: #61dafb;\n --dark-color-modal-background: rgba(0, 0, 0, 0.75);\n --dark-color-record-active: #fc3a4b;\n --dark-color-record-hover: #a2e9fc;\n --dark-color-record-inactive: #61dafb;\n --dark-color-scroll-thumb: #afb3b9;\n --dark-color-scroll-track: #313640;\n --dark-color-search-match: yellow;\n --dark-color-search-match-current: #f7923b;\n --dark-color-selected-tree-highlight-active: rgba(23, 143, 185, 0.15);\n --dark-color-selected-tree-highlight-inactive: rgba(255, 255, 255, 0.05);\n --dark-color-shadow: rgba(0, 0, 0, 0.5);\n --dark-color-tab-selected-border: #178fb9;\n --dark-color-text: #ffffff;\n --dark-color-text-invalid: #ff8080;\n --dark-color-text-selected: #ffffff;\n --dark-color-toggle-background-invalid: #fc3a4b;\n --dark-color-toggle-background-on: #178fb9;\n --dark-color-toggle-background-off: #777d88;\n --dark-color-toggle-text: #ffffff;\n --dark-color-tooltip-background: rgba(255, 255, 255, 0.9);\n --dark-color-tooltip-text: #000000;\n\n /* Font smoothing */\n --light-font-smoothing: auto;\n --dark-font-smoothing: antialiased;\n --font-smoothing: auto;\n\n /* Compact density */\n --compact-font-size-monospace-small: 9px;\n --compact-font-size-monospace-normal: 11px;\n --compact-font-size-monospace-large: 15px;\n --compact-font-size-sans-small: 10px;\n --compact-font-size-sans-normal: 12px;\n --compact-font-size-sans-large: 14px;\n --compact-line-height-data: 18px;\n --compact-root-font-size: 16px;\n\n /* Comfortable density */\n --comfortable-font-size-monospace-small: 10px;\n --comfortable-font-size-monospace-normal: 13px;\n --comfortable-font-size-monospace-large: 17px;\n --comfortable-font-size-sans-small: 12px;\n --comfortable-font-size-sans-normal: 14px;\n --comfortable-font-size-sans-large: 16px;\n --comfortable-line-height-data: 22px;\n --comfortable-root-font-size: 20px;\n\n /* GitHub.com system fonts */\n --font-family-monospace: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo,\n Courier, monospace;\n --font-family-sans: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica,\n Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;\n\n /* Constant values shared between JS and CSS */\n --interaction-commit-size: 10px;\n --interaction-label-width: 200px;\n}\n");
9801
9802 /***/
9803 }
9804 ),
9805
9806 /***/
9807 50: /***/
9808 (function(module, exports, __webpack_require__) {
9809
9810 "use strict";
9811 /** @license React v0.0.0-experimental-51a3aa6af
9812 * react.production.min.js
9813 *
9814 * Copyright (c) Facebook, Inc. and its affiliates.
9815 *
9816 * This source code is licensed under the MIT license found in the
9817 * LICENSE file in the root directory of this source tree.
9818 */
9819
9820 var l = __webpack_require__(33)
9821 , m = 60103
9822 , p = 60106;
9823
9824 exports.Fragment = 60107;
9825 exports.StrictMode = 60108;
9826 exports.Profiler = 60114;
9827 var q = 60109
9828 , r = 60110
9829 , t = 60112;
9830 exports.Suspense = 60113;
9831 exports.unstable_SuspenseList = 60120;
9832 var u = 60115
9833 , v = 60116
9834 , w = 60121;
9835 exports.unstable_DebugTracingMode = 60129;
9836 exports.unstable_LegacyHidden = 60131;
9837
9838 if ("function" === typeof Symbol && Symbol.for) {
9839 var x = Symbol.for;
9840 m = x("react.element");
9841 p = x("react.portal");
9842 exports.Fragment = x("react.fragment");
9843 exports.StrictMode = x("react.strict_mode");
9844 exports.Profiler = x("react.profiler");
9845 q = x("react.provider");
9846 r = x("react.context");
9847 t = x("react.forward_ref");
9848 exports.Suspense = x("react.suspense");
9849 exports.unstable_SuspenseList = x("react.suspense_list");
9850 u = x("react.memo");
9851 v = x("react.lazy");
9852 w = x("react.block");
9853 exports.unstable_DebugTracingMode = x("react.debug_trace_mode");
9854 exports.unstable_LegacyHidden = x("react.legacy_hidden");
9855 }
9856
9857 var y = "function" === typeof Symbol && Symbol.iterator;
9858
9859 function z(a) {
9860 if (null === a || "object" !== typeof a)
9861 return null;
9862 a = y && a[y] || a["@@iterator"];
9863 return "function" === typeof a ? a : null;
9864 }
9865
9866 function A(a) {
9867 for (var b = "https://reactjs.org/docs/error-decoder.html?invariant=" + a, c = 1; c < arguments.length; c++)
9868 b += "&args[]=" + encodeURIComponent(arguments[c]);
9869
9870 return "Minified React error #" + a + "; visit " + b + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
9871 }
9872
9873 var B = {
9874 isMounted: function isMounted() {
9875 return !1;
9876 },
9877 enqueueForceUpdate: function enqueueForceUpdate() {},
9878 enqueueReplaceState: function enqueueReplaceState() {},
9879 enqueueSetState: function enqueueSetState() {}
9880 }
9881 , C = {};
9882
9883 function D(a, b, c) {
9884 this.props = a;
9885 this.context = b;
9886 this.refs = C;
9887 this.updater = c || B;
9888 }
9889
9890 D.prototype.isReactComponent = {};
9891
9892 D.prototype.setState = function(a, b) {
9893 if ("object" !== typeof a && "function" !== typeof a && null != a)
9894 throw Error(A(85));
9895 this.updater.enqueueSetState(this, a, b, "setState");
9896 }
9897 ;
9898
9899 D.prototype.forceUpdate = function(a) {
9900 this.updater.enqueueForceUpdate(this, a, "forceUpdate");
9901 }
9902 ;
9903
9904 function E() {}
9905
9906 E.prototype = D.prototype;
9907
9908 function F(a, b, c) {
9909 this.props = a;
9910 this.context = b;
9911 this.refs = C;
9912 this.updater = c || B;
9913 }
9914
9915 var G = F.prototype = new E();
9916 G.constructor = F;
9917 l(G, D.prototype);
9918 G.isPureReactComponent = !0;
9919 var H = {
9920 current: null
9921 }
9922 , I = Object.prototype.hasOwnProperty
9923 , J = {
9924 key: !0,
9925 ref: !0,
9926 __self: !0,
9927 __source: !0
9928 };
9929
9930 function K(a, b, c) {
9931 var e, d = {}, k = null, h = null;
9932 if (null != b)
9933 for (e in void 0 !== b.ref && (h = b.ref),
9934 void 0 !== b.key && (k = "" + b.key),
9935 b)
9936 I.call(b, e) && !J.hasOwnProperty(e) && (d[e] = b[e]);
9937 var g = arguments.length - 2;
9938 if (1 === g)
9939 d.children = c;
9940 else if (1 < g) {
9941 for (var f = Array(g), n = 0; n < g; n++)
9942 f[n] = arguments[n + 2];
9943
9944 d.children = f;
9945 }
9946 if (a && a.defaultProps)
9947 for (e in g = a.defaultProps,
9948 g)
9949 void 0 === d[e] && (d[e] = g[e]);
9950 return {
9951 $$typeof: m,
9952 type: a,
9953 key: k,
9954 ref: h,
9955 props: d,
9956 _owner: H.current
9957 };
9958 }
9959
9960 function L(a, b) {
9961 return {
9962 $$typeof: m,
9963 type: a.type,
9964 key: b,
9965 ref: a.ref,
9966 props: a.props,
9967 _owner: a._owner
9968 };
9969 }
9970
9971 function M(a) {
9972 return "object" === typeof a && null !== a && a.$$typeof === m;
9973 }
9974
9975 function escape(a) {
9976 var b = {
9977 "=": "=0",
9978 ":": "=2"
9979 };
9980 return "$" + a.replace(/[=:]/g, function(a) {
9981 return b[a];
9982 });
9983 }
9984
9985 var N = /\/+/g;
9986
9987 function O(a, b) {
9988 return "object" === typeof a && null !== a && null != a.key ? escape("" + a.key) : b.toString(36);
9989 }
9990
9991 function P(a, b, c, e, d) {
9992 var k = typeof a;
9993 if ("undefined" === k || "boolean" === k)
9994 a = null;
9995 var h = !1;
9996 if (null === a)
9997 h = !0;
9998 else
9999 switch (k) {
10000 case "string":
10001 case "number":
10002 h = !0;
10003 break;
10004
10005 case "object":
10006 switch (a.$$typeof) {
10007 case m:
10008 case p:
10009 h = !0;
10010 }
10011
10012 }
10013 if (h)
10014 return h = a,
10015 d = d(h),
10016 a = "" === e ? "." + O(h, 0) : e,
10017 Array.isArray(d) ? (c = "",
10018 null != a && (c = a.replace(N, "$&/") + "/"),
10019 P(d, b, c, "", function(a) {
10020 return a;
10021 })) : null != d && (M(d) && (d = L(d, c + (!d.key || h && h.key === d.key ? "" : ("" + d.key).replace(N, "$&/") + "/") + a)),
10022 b.push(d)),
10023 1;
10024 h = 0;
10025 e = "" === e ? "." : e + ":";
10026 if (Array.isArray(a))
10027 for (var g = 0; g < a.length; g++) {
10028 k = a[g];
10029 var f = e + O(k, g);
10030 h += P(k, b, c, f, d);
10031 }
10032 else if (f = z(a),
10033 "function" === typeof f)
10034 for (a = f.call(a),
10035 g = 0; !(k = a.next()).done; )
10036 k = k.value,
10037 f = e + O(k, g++),
10038 h += P(k, b, c, f, d);
10039 else if ("object" === k)
10040 throw b = "" + a,
10041 Error(A(31, "[object Object]" === b ? "object with keys {" + Object.keys(a).join(", ") + "}" : b));
10042 return h;
10043 }
10044
10045 function Q(a, b, c) {
10046 if (null == a)
10047 return a;
10048 var e = []
10049 , d = 0;
10050 P(a, e, "", "", function(a) {
10051 return b.call(c, a, d++);
10052 });
10053 return e;
10054 }
10055
10056 function R(a) {
10057 if (-1 === a._status) {
10058 var b = a._result;
10059 b = b();
10060 a._status = 0;
10061 a._result = b;
10062 b.then(function(b) {
10063 0 === a._status && (b = b.default,
10064 a._status = 1,
10065 a._result = b);
10066 }, function(b) {
10067 0 === a._status && (a._status = 2,
10068 a._result = b);
10069 });
10070 }
10071
10072 if (1 === a._status)
10073 return a._result;
10074 throw a._result;
10075 }
10076
10077 function S(a) {
10078 return {
10079 $$typeof: w,
10080 _data: a.load.apply(null, a.args),
10081 _render: a.render
10082 };
10083 }
10084
10085 var T = {
10086 current: null
10087 };
10088
10089 function U() {
10090 var a = T.current;
10091 if (null === a)
10092 throw Error(A(321));
10093 return a;
10094 }
10095
10096 var V = {
10097 transition: 0
10098 }
10099 , W = {
10100 ReactCurrentDispatcher: T,
10101 ReactCurrentBatchConfig: V,
10102 ReactCurrentOwner: H,
10103 IsSomeRendererActing: {
10104 current: !1
10105 },
10106 assign: l
10107 };
10108 exports.Children = {
10109 map: Q,
10110 forEach: function forEach(a, b, c) {
10111 Q(a, function() {
10112 b.apply(this, arguments);
10113 }, c);
10114 },
10115 count: function count(a) {
10116 var b = 0;
10117 Q(a, function() {
10118 b++;
10119 });
10120 return b;
10121 },
10122 toArray: function toArray(a) {
10123 return Q(a, function(a) {
10124 return a;
10125 }) || [];
10126 },
10127 only: function only(a) {
10128 if (!M(a))
10129 throw Error(A(143));
10130 return a;
10131 }
10132 };
10133 exports.Component = D;
10134 exports.PureComponent = F;
10135 exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = W;
10136
10137 exports.cloneElement = function(a, b, c) {
10138 if (null === a || void 0 === a)
10139 throw Error(A(267, a));
10140 var e = l({}, a.props)
10141 , d = a.key
10142 , k = a.ref
10143 , h = a._owner;
10144
10145 if (null != b) {
10146 void 0 !== b.ref && (k = b.ref,
10147 h = H.current);
10148 void 0 !== b.key && (d = "" + b.key);
10149 if (a.type && a.type.defaultProps)
10150 var g = a.type.defaultProps;
10151
10152 for (f in b)
10153 I.call(b, f) && !J.hasOwnProperty(f) && (e[f] = void 0 === b[f] && void 0 !== g ? g[f] : b[f]);
10154 }
10155
10156 var f = arguments.length - 2;
10157 if (1 === f)
10158 e.children = c;
10159 else if (1 < f) {
10160 g = Array(f);
10161
10162 for (var n = 0; n < f; n++)
10163 g[n] = arguments[n + 2];
10164
10165 e.children = g;
10166 }
10167 return {
10168 $$typeof: m,
10169 type: a.type,
10170 key: d,
10171 ref: k,
10172 props: e,
10173 _owner: h
10174 };
10175 }
10176 ;
10177
10178 exports.createContext = function(a, b) {
10179 void 0 === b && (b = null);
10180 a = {
10181 $$typeof: r,
10182 _calculateChangedBits: b,
10183 _currentValue: a,
10184 _currentValue2: a,
10185 _threadCount: 0,
10186 Provider: null,
10187 Consumer: null
10188 };
10189 a.Provider = {
10190 $$typeof: q,
10191 _context: a
10192 };
10193 return a.Consumer = a;
10194 }
10195 ;
10196
10197 exports.createElement = K;
10198
10199 exports.createFactory = function(a) {
10200 var b = K.bind(null, a);
10201 b.type = a;
10202 return b;
10203 }
10204 ;
10205
10206 exports.createRef = function() {
10207 return {
10208 current: null
10209 };
10210 }
10211 ;
10212
10213 exports.forwardRef = function(a) {
10214 return {
10215 $$typeof: t,
10216 render: a
10217 };
10218 }
10219 ;
10220
10221 exports.isValidElement = M;
10222
10223 exports.lazy = function(a) {
10224 return {
10225 $$typeof: v,
10226 _payload: {
10227 _status: -1,
10228 _result: a
10229 },
10230 _init: R
10231 };
10232 }
10233 ;
10234
10235 exports.memo = function(a, b) {
10236 return {
10237 $$typeof: u,
10238 type: a,
10239 compare: void 0 === b ? null : b
10240 };
10241 }
10242 ;
10243
10244 exports.unstable_block = function(a, b) {
10245 return void 0 === b ? function() {
10246 return {
10247 $$typeof: w,
10248 _data: void 0,
10249 _render: a
10250 };
10251 }
10252 : function() {
10253 return {
10254 $$typeof: v,
10255 _payload: {
10256 load: b,
10257 args: arguments,
10258 render: a
10259 },
10260 _init: S
10261 };
10262 }
10263 ;
10264 }
10265 ;
10266
10267 exports.unstable_createMutableSource = function(a, b) {
10268 return {
10269 _getVersion: b,
10270 _source: a,
10271 _workInProgressVersionPrimary: null,
10272 _workInProgressVersionSecondary: null
10273 };
10274 }
10275 ;
10276
10277 exports.unstable_startTransition = function(a) {
10278 var b = V.transition;
10279 V.transition = 1;
10280
10281 try {
10282 a();
10283 } finally {
10284 V.transition = b;
10285 }
10286 }
10287 ;
10288
10289 exports.unstable_useDeferredValue = function(a) {
10290 return U().useDeferredValue(a);
10291 }
10292 ;
10293
10294 exports.unstable_useMutableSource = function(a, b, c) {
10295 return U().useMutableSource(a, b, c);
10296 }
10297 ;
10298
10299 exports.unstable_useOpaqueIdentifier = function() {
10300 return U().useOpaqueIdentifier();
10301 }
10302 ;
10303
10304 exports.unstable_useTransition = function() {
10305 return U().useTransition();
10306 }
10307 ;
10308
10309 exports.useCallback = function(a, b) {
10310 return U().useCallback(a, b);
10311 }
10312 ;
10313
10314 exports.useContext = function(a, b) {
10315 return U().useContext(a, b);
10316 }
10317 ;
10318
10319 exports.useDebugValue = function() {}
10320 ;
10321
10322 exports.useEffect = function(a, b) {
10323 return U().useEffect(a, b);
10324 }
10325 ;
10326
10327 exports.useImperativeHandle = function(a, b, c) {
10328 return U().useImperativeHandle(a, b, c);
10329 }
10330 ;
10331
10332 exports.useLayoutEffect = function(a, b) {
10333 return U().useLayoutEffect(a, b);
10334 }
10335 ;
10336
10337 exports.useMemo = function(a, b) {
10338 return U().useMemo(a, b);
10339 }
10340 ;
10341
10342 exports.useReducer = function(a, b, c) {
10343 return U().useReducer(a, b, c);
10344 }
10345 ;
10346
10347 exports.useRef = function(a) {
10348 return U().useRef(a);
10349 }
10350 ;
10351
10352 exports.useState = function(a) {
10353 return U().useState(a);
10354 }
10355 ;
10356
10357 exports.version = "17.0.0-alpha.0-experimental-51a3aa6af";
10358
10359 /***/
10360 }
10361 ),
10362
10363 /***/
10364 51: /***/
10365 (function(module, exports, __webpack_require__) {
10366
10367 "use strict";
10368
10369 if (true) {
10370 module.exports = __webpack_require__(65);
10371 } else {}
10372
10373 /***/
10374 }
10375 ),
10376
10377 /***/
10378 65: /***/
10379 (function(module, exports, __webpack_require__) {
10380
10381 "use strict";
10382 /** @license React v0.0.0-experimental-51a3aa6af
10383 * react-debug-tools.production.min.js
10384 *
10385 * Copyright (c) Facebook, Inc. and its affiliates.
10386 *
10387 * This source code is licensed under the MIT license found in the
10388 * LICENSE file in the root directory of this source tree.
10389 */
10390
10391 var g = __webpack_require__(33)
10392 , k = __webpack_require__(66)
10393 , p = __webpack_require__(0).__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
10394 , v = 60128;
10395
10396 if ("function" === typeof Symbol && Symbol.for) {
10397 var w = Symbol.for;
10398 v = w("react.opaque.id");
10399 }
10400
10401 var x = []
10402 , y = null
10403 , z = null;
10404
10405 function A() {
10406 if (null === y) {
10407 var a = new Map();
10408
10409 try {
10410 B.useContext({
10411 _currentValue: null
10412 }),
10413 B.useState(null),
10414 B.useReducer(function(a) {
10415 return a;
10416 }, null),
10417 B.useRef(null),
10418 B.useLayoutEffect(function() {}),
10419 B.useEffect(function() {}),
10420 B.useImperativeHandle(void 0, function() {
10421 return null;
10422 }),
10423 B.useDebugValue(null),
10424 B.useCallback(function() {}),
10425 B.useMemo(function() {
10426 return null;
10427 });
10428 } finally {
10429 var b = x;
10430 x = [];
10431 }
10432
10433 for (var c = 0; c < b.length; c++) {
10434 var d = b[c];
10435 a.set(d.primitive, k.parse(d.stackError));
10436 }
10437
10438 y = a;
10439 }
10440
10441 return y;
10442 }
10443
10444 var C = null;
10445
10446 function D() {
10447 var a = C;
10448 null !== a && (C = a.next);
10449 return a;
10450 }
10451
10452 var B = {
10453 readContext: function readContext(a) {
10454 return a._currentValue;
10455 },
10456 useCallback: function useCallback(a) {
10457 var b = D();
10458 x.push({
10459 primitive: "Callback",
10460 stackError: Error(),
10461 value: null !== b ? b.memoizedState[0] : a
10462 });
10463 return a;
10464 },
10465 useContext: function useContext(a) {
10466 x.push({
10467 primitive: "Context",
10468 stackError: Error(),
10469 value: a._currentValue
10470 });
10471 return a._currentValue;
10472 },
10473 useEffect: function useEffect(a) {
10474 D();
10475 x.push({
10476 primitive: "Effect",
10477 stackError: Error(),
10478 value: a
10479 });
10480 },
10481 useImperativeHandle: function useImperativeHandle(a) {
10482 D();
10483 var b = void 0;
10484 null !== a && "object" === typeof a && (b = a.current);
10485 x.push({
10486 primitive: "ImperativeHandle",
10487 stackError: Error(),
10488 value: b
10489 });
10490 },
10491 useDebugValue: function useDebugValue(a, b) {
10492 x.push({
10493 primitive: "DebugValue",
10494 stackError: Error(),
10495 value: "function" === typeof b ? b(a) : a
10496 });
10497 },
10498 useLayoutEffect: function useLayoutEffect(a) {
10499 D();
10500 x.push({
10501 primitive: "LayoutEffect",
10502 stackError: Error(),
10503 value: a
10504 });
10505 },
10506 useMemo: function useMemo(a) {
10507 var b = D();
10508 a = null !== b ? b.memoizedState[0] : a();
10509 x.push({
10510 primitive: "Memo",
10511 stackError: Error(),
10512 value: a
10513 });
10514 return a;
10515 },
10516 useReducer: function useReducer(a, b, c) {
10517 a = D();
10518 b = null !== a ? a.memoizedState : void 0 !== c ? c(b) : b;
10519 x.push({
10520 primitive: "Reducer",
10521 stackError: Error(),
10522 value: b
10523 });
10524 return [b, function() {}
10525 ];
10526 },
10527 useRef: function useRef(a) {
10528 var b = D();
10529 a = null !== b ? b.memoizedState : {
10530 current: a
10531 };
10532 x.push({
10533 primitive: "Ref",
10534 stackError: Error(),
10535 value: a.current
10536 });
10537 return a;
10538 },
10539 useState: function useState(a) {
10540 var b = D();
10541 a = null !== b ? b.memoizedState : "function" === typeof a ? a() : a;
10542 x.push({
10543 primitive: "State",
10544 stackError: Error(),
10545 value: a
10546 });
10547 return [a, function() {}
10548 ];
10549 },
10550 useTransition: function useTransition() {
10551 D();
10552 D();
10553 x.push({
10554 primitive: "Transition",
10555 stackError: Error(),
10556 value: void 0
10557 });
10558 return [function() {}
10559 , !1];
10560 },
10561 useMutableSource: function useMutableSource(a, b) {
10562 D();
10563 D();
10564 D();
10565 D();
10566 a = b(a._source);
10567 x.push({
10568 primitive: "MutableSource",
10569 stackError: Error(),
10570 value: a
10571 });
10572 return a;
10573 },
10574 useDeferredValue: function useDeferredValue(a) {
10575 D();
10576 D();
10577 x.push({
10578 primitive: "DeferredValue",
10579 stackError: Error(),
10580 value: a
10581 });
10582 return a;
10583 },
10584 useOpaqueIdentifier: function useOpaqueIdentifier() {
10585 var a = D();
10586 z && 0 === z.mode && D();
10587 (a = null === a ? void 0 : a.memoizedState) && a.$$typeof === v && (a = void 0);
10588 x.push({
10589 primitive: "OpaqueIdentifier",
10590 stackError: Error(),
10591 value: a
10592 });
10593 return a;
10594 }
10595 }
10596 , E = 0;
10597
10598 function F(a, b, c) {
10599 var d = b[c].source
10600 , e = 0;
10601
10602 a: for (; e < a.length; e++)
10603 if (a[e].source === d) {
10604 for (var n = c + 1, q = e + 1; n < b.length && q < a.length; n++,
10605 q++)
10606 if (a[q].source !== b[n].source)
10607 continue a;
10608
10609 return e;
10610 }
10611
10612 return -1;
10613 }
10614
10615 function G(a, b) {
10616 if (!a)
10617 return !1;
10618 b = "use" + b;
10619 return a.length < b.length ? !1 : a.lastIndexOf(b) === a.length - b.length;
10620 }
10621
10622 function H(a) {
10623 if (!a)
10624 return "";
10625 var b = a.lastIndexOf(".");
10626 -1 === b && (b = 0);
10627 "use" === a.substr(b, 3) && (b += 3);
10628 return a.substr(b);
10629 }
10630
10631 function I(a, b) {
10632 for (var c = [], d = null, e = c, n = 0, q = [], u = 0; u < b.length; u++) {
10633 var t = b[u];
10634 var f = a;
10635 var h = k.parse(t.stackError);
10636
10637 b: {
10638 var m = h
10639 , r = F(m, f, E);
10640 if (-1 !== r)
10641 f = r;
10642 else {
10643 for (var l = 0; l < f.length && 5 > l; l++)
10644 if (r = F(m, f, l),
10645 -1 !== r) {
10646 E = l;
10647 f = r;
10648 break b;
10649 }
10650
10651 f = -1;
10652 }
10653 }
10654
10655 b: {
10656 m = h;
10657 r = A().get(t.primitive);
10658 if (void 0 !== r)
10659 for (l = 0; l < r.length && l < m.length; l++)
10660 if (r[l].source !== m[l].source) {
10661 l < m.length - 1 && G(m[l].functionName, t.primitive) && l++;
10662 l < m.length - 1 && G(m[l].functionName, t.primitive) && l++;
10663 m = l;
10664 break b;
10665 }
10666 m = -1;
10667 }
10668
10669 h = -1 === f || -1 === m || 2 > f - m ? null : h.slice(m, f - 1);
10670
10671 if (null !== h) {
10672 f = 0;
10673
10674 if (null !== d) {
10675 for (; f < h.length && f < d.length && h[h.length - f - 1].source === d[d.length - f - 1].source; )
10676 f++;
10677
10678 for (d = d.length - 1; d > f; d--)
10679 e = q.pop();
10680 }
10681
10682 for (d = h.length - f - 1; 1 <= d; d--)
10683 f = [],
10684 e.push({
10685 id: null,
10686 isStateEditable: !1,
10687 name: H(h[d - 1].functionName),
10688 value: void 0,
10689 subHooks: f
10690 }),
10691 q.push(e),
10692 e = f;
10693
10694 d = h;
10695 }
10696
10697 h = t.primitive;
10698 f = "Context" === h || "DebugValue" === h ? null : n++;
10699 e.push({
10700 id: f,
10701 isStateEditable: "Reducer" === h || "State" === h,
10702 name: h,
10703 value: t.value,
10704 subHooks: []
10705 });
10706 }
10707
10708 J(c, null);
10709 return c;
10710 }
10711
10712 function J(a, b) {
10713 for (var c = [], d = 0; d < a.length; d++) {
10714 var e = a[d];
10715 "DebugValue" === e.name && 0 === e.subHooks.length ? (a.splice(d, 1),
10716 d--,
10717 c.push(e)) : J(e.subHooks, e);
10718 }
10719
10720 null !== b && (1 === c.length ? b.value = c[0].value : 1 < c.length && (b.value = c.map(function(a) {
10721 return a.value;
10722 })));
10723 }
10724
10725 function K(a, b, c) {
10726 null == c && (c = p.ReactCurrentDispatcher);
10727 var d = c.current;
10728 c.current = B;
10729
10730 try {
10731 var e = Error();
10732 a(b);
10733 } finally {
10734 a = x,
10735 x = [],
10736 c.current = d;
10737 }
10738
10739 c = k.parse(e);
10740 return I(c, a);
10741 }
10742
10743 function L(a) {
10744 a.forEach(function(a, c) {
10745 return c._currentValue = a;
10746 });
10747 }
10748
10749 exports.inspectHooks = K;
10750
10751 exports.inspectHooksOfFiber = function(a, b) {
10752 null == b && (b = p.ReactCurrentDispatcher);
10753 z = a;
10754 if (0 !== a.tag && 15 !== a.tag && 11 !== a.tag && 22 !== a.tag)
10755 throw Error("Unknown Fiber. Needs to be a function component to inspect hooks.");
10756 A();
10757 var c = a.type
10758 , d = a.memoizedProps;
10759
10760 if (c !== a.elementType && c && c.defaultProps) {
10761 d = g({}, d);
10762 var e = c.defaultProps;
10763
10764 for (n in e)
10765 void 0 === d[n] && (d[n] = e[n]);
10766 }
10767
10768 C = a.memoizedState;
10769 var n = new Map();
10770
10771 try {
10772 for (e = a; e; ) {
10773 if (10 === e.tag) {
10774 var q = e.type._context;
10775 n.has(q) || (n.set(q, q._currentValue),
10776 q._currentValue = e.memoizedProps.value);
10777 }
10778
10779 e = e.return;
10780 }
10781
10782 if (11 === a.tag) {
10783 var u = c.render;
10784 c = d;
10785 var t = a.ref;
10786 a = b;
10787 var f = a.current;
10788 a.current = B;
10789
10790 try {
10791 var h = Error();
10792 u(c, t);
10793 } finally {
10794 var m = x;
10795 x = [];
10796 a.current = f;
10797 }
10798
10799 var r = k.parse(h);
10800 return I(r, m);
10801 }
10802
10803 return K(c, d, b);
10804 } finally {
10805 C = null,
10806 L(n);
10807 }
10808 }
10809 ;
10810
10811 /***/
10812 }
10813 ),
10814
10815 /***/
10816 66: /***/
10817 (function(module, exports, __webpack_require__) {
10818
10819 var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
10820 (function(root, factory) {
10821 'use strict';
10822 // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.
10823
10824 /* istanbul ignore next */
10825
10826 if (true) {
10827 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(67)],
10828 __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
10829 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
10830 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
10831 } else {}
10832 }
10833 )(this, function ErrorStackParser(StackFrame) {
10834 'use strict';
10835
10836 var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\S+:\d+/;
10837 var CHROME_IE_STACK_REGEXP = /^\s*at .*(\S+:\d+|\(native\))/m;
10838 var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\[native code])?$/;
10839 return {
10840 /**
10841 * Given an Error object, extract the most information from it.
10842 *
10843 * @param {Error} error object
10844 * @return {Array} of StackFrames
10845 */
10846 parse: function ErrorStackParser$$parse(error) {
10847 if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') {
10848 return this.parseOpera(error);
10849 } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {
10850 return this.parseV8OrIE(error);
10851 } else if (error.stack) {
10852 return this.parseFFOrSafari(error);
10853 } else {
10854 throw new Error('Cannot parse given Error object');
10855 }
10856 },
10857 // Separate line and column numbers from a string of the form: (URI:Line:Column)
10858 extractLocation: function ErrorStackParser$$extractLocation(urlLike) {
10859 // Fail-fast but return locations like "(native)"
10860 if (urlLike.indexOf(':') === -1) {
10861 return [urlLike];
10862 }
10863
10864 var regExp = /(.+?)(?::(\d+))?(?::(\d+))?$/;
10865 var parts = regExp.exec(urlLike.replace(/[()]/g, ''));
10866 return [parts[1], parts[2] || undefined, parts[3] || undefined];
10867 },
10868 parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {
10869 var filtered = error.stack.split('\n').filter(function(line) {
10870 return !!line.match(CHROME_IE_STACK_REGEXP);
10871 }, this);
10872 return filtered.map(function(line) {
10873 if (line.indexOf('(eval ') > -1) {
10874 // Throw away eval information until we implement stacktrace.js/stackframe#8
10875 line = line.replace(/eval code/g, 'eval').replace(/(\(eval at [^()]*)|(\),.*$)/g, '');
10876 }
10877
10878 var sanitizedLine = line.replace(/^\s+/, '').replace(/\(eval code/g, '(');
10879 // capture and preseve the parenthesized location "(/foo/my bar.js:12:87)" in
10880 // case it has spaces in it, as the string is split on \s+ later on
10881
10882 var location = sanitizedLine.match(/ (\((.+):(\d+):(\d+)\)$)/);
10883 // remove the parenthesized location from the line, if it was matched
10884
10885 sanitizedLine = location ? sanitizedLine.replace(location[0], '') : sanitizedLine;
10886 var tokens = sanitizedLine.split(/\s+/).slice(1);
10887 // if a location was matched, pass it to extractLocation() otherwise pop the last token
10888
10889 var locationParts = this.extractLocation(location ? location[1] : tokens.pop());
10890 var functionName = tokens.join(' ') || undefined;
10891 var fileName = ['eval', '<anonymous>'].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0];
10892 return new StackFrame({
10893 functionName: functionName,
10894 fileName: fileName,
10895 lineNumber: locationParts[1],
10896 columnNumber: locationParts[2],
10897 source: line
10898 });
10899 }, this);
10900 },
10901 parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {
10902 var filtered = error.stack.split('\n').filter(function(line) {
10903 return !line.match(SAFARI_NATIVE_CODE_REGEXP);
10904 }, this);
10905 return filtered.map(function(line) {
10906 // Throw away eval information until we implement stacktrace.js/stackframe#8
10907 if (line.indexOf(' > eval') > -1) {
10908 line = line.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ':$1');
10909 }
10910
10911 if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {
10912 // Safari eval frames only have function names and nothing else
10913 return new StackFrame({
10914 functionName: line
10915 });
10916 } else {
10917 var functionNameRegex = /((.*".+"[^@]*)?[^@]*)(?:@)/;
10918 var matches = line.match(functionNameRegex);
10919 var functionName = matches && matches[1] ? matches[1] : undefined;
10920 var locationParts = this.extractLocation(line.replace(functionNameRegex, ''));
10921 return new StackFrame({
10922 functionName: functionName,
10923 fileName: locationParts[0],
10924 lineNumber: locationParts[1],
10925 columnNumber: locationParts[2],
10926 source: line
10927 });
10928 }
10929 }, this);
10930 },
10931 parseOpera: function ErrorStackParser$$parseOpera(e) {
10932 if (!e.stacktrace || e.message.indexOf('\n') > -1 && e.message.split('\n').length > e.stacktrace.split('\n').length) {
10933 return this.parseOpera9(e);
10934 } else if (!e.stack) {
10935 return this.parseOpera10(e);
10936 } else {
10937 return this.parseOpera11(e);
10938 }
10939 },
10940 parseOpera9: function ErrorStackParser$$parseOpera9(e) {
10941 var lineRE = /Line (\d+).*script (?:in )?(\S+)/i;
10942 var lines = e.message.split('\n');
10943 var result = [];
10944
10945 for (var i = 2, len = lines.length; i < len; i += 2) {
10946 var match = lineRE.exec(lines[i]);
10947
10948 if (match) {
10949 result.push(new StackFrame({
10950 fileName: match[2],
10951 lineNumber: match[1],
10952 source: lines[i]
10953 }));
10954 }
10955 }
10956
10957 return result;
10958 },
10959 parseOpera10: function ErrorStackParser$$parseOpera10(e) {
10960 var lineRE = /Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i;
10961 var lines = e.stacktrace.split('\n');
10962 var result = [];
10963
10964 for (var i = 0, len = lines.length; i < len; i += 2) {
10965 var match = lineRE.exec(lines[i]);
10966
10967 if (match) {
10968 result.push(new StackFrame({
10969 functionName: match[3] || undefined,
10970 fileName: match[2],
10971 lineNumber: match[1],
10972 source: lines[i]
10973 }));
10974 }
10975 }
10976
10977 return result;
10978 },
10979 // Opera 10.65+ Error.stack very similar to FF/Safari
10980 parseOpera11: function ErrorStackParser$$parseOpera11(error) {
10981 var filtered = error.stack.split('\n').filter(function(line) {
10982 return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && !line.match(/^Error created at/);
10983 }, this);
10984 return filtered.map(function(line) {
10985 var tokens = line.split('@');
10986 var locationParts = this.extractLocation(tokens.pop());
10987 var functionCall = tokens.shift() || '';
10988 var functionName = functionCall.replace(/<anonymous function(: (\w+))?>/, '$2').replace(/\([^)]*\)/g, '') || undefined;
10989 var argsRaw;
10990
10991 if (functionCall.match(/\(([^)]*)\)/)) {
10992 argsRaw = functionCall.replace(/^[^(]+\(([^)]*)\)$/, '$1');
10993 }
10994
10995 var args = argsRaw === undefined || argsRaw === '[arguments not available]' ? undefined : argsRaw.split(',');
10996 return new StackFrame({
10997 functionName: functionName,
10998 args: args,
10999 fileName: locationParts[0],
11000 lineNumber: locationParts[1],
11001 columnNumber: locationParts[2],
11002 source: line
11003 });
11004 }, this);
11005 }
11006 };
11007 });
11008
11009 /***/
11010 }
11011 ),
11012
11013 /***/
11014 67: /***/
11015 (function(module, exports, __webpack_require__) {
11016
11017 var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
11018 (function(root, factory) {
11019 'use strict';
11020 // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.
11021
11022 /* istanbul ignore next */
11023
11024 if (true) {
11025 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [],
11026 __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
11027 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
11028 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
11029 } else {}
11030 }
11031 )(this, function() {
11032 'use strict';
11033
11034 function _isNumber(n) {
11035 return !isNaN(parseFloat(n)) && isFinite(n);
11036 }
11037
11038 function _capitalize(str) {
11039 return str.charAt(0).toUpperCase() + str.substring(1);
11040 }
11041
11042 function _getter(p) {
11043 return function() {
11044 return this[p];
11045 }
11046 ;
11047 }
11048
11049 var booleanProps = ['isConstructor', 'isEval', 'isNative', 'isToplevel'];
11050 var numericProps = ['columnNumber', 'lineNumber'];
11051 var stringProps = ['fileName', 'functionName', 'source'];
11052 var arrayProps = ['args'];
11053 var props = booleanProps.concat(numericProps, stringProps, arrayProps);
11054
11055 function StackFrame(obj) {
11056 if (!obj)
11057 return;
11058
11059 for (var i = 0; i < props.length; i++) {
11060 if (obj[props[i]] !== undefined) {
11061 this['set' + _capitalize(props[i])](obj[props[i]]);
11062 }
11063 }
11064 }
11065
11066 StackFrame.prototype = {
11067 getArgs: function getArgs() {
11068 return this.args;
11069 },
11070 setArgs: function setArgs(v) {
11071 if (Object.prototype.toString.call(v) !== '[object Array]') {
11072 throw new TypeError('Args must be an Array');
11073 }
11074
11075 this.args = v;
11076 },
11077 getEvalOrigin: function getEvalOrigin() {
11078 return this.evalOrigin;
11079 },
11080 setEvalOrigin: function setEvalOrigin(v) {
11081 if (v instanceof StackFrame) {
11082 this.evalOrigin = v;
11083 } else if (v instanceof Object) {
11084 this.evalOrigin = new StackFrame(v);
11085 } else {
11086 throw new TypeError('Eval Origin must be an Object or StackFrame');
11087 }
11088 },
11089 toString: function toString() {
11090 var fileName = this.getFileName() || '';
11091 var lineNumber = this.getLineNumber() || '';
11092 var columnNumber = this.getColumnNumber() || '';
11093 var functionName = this.getFunctionName() || '';
11094
11095 if (this.getIsEval()) {
11096 if (fileName) {
11097 return '[eval] (' + fileName + ':' + lineNumber + ':' + columnNumber + ')';
11098 }
11099
11100 return '[eval]:' + lineNumber + ':' + columnNumber;
11101 }
11102
11103 if (functionName) {
11104 return functionName + ' (' + fileName + ':' + lineNumber + ':' + columnNumber + ')';
11105 }
11106
11107 return fileName + ':' + lineNumber + ':' + columnNumber;
11108 }
11109 };
11110
11111 StackFrame.fromString = function StackFrame$$fromString(str) {
11112 var argsStartIndex = str.indexOf('(');
11113 var argsEndIndex = str.lastIndexOf(')');
11114 var functionName = str.substring(0, argsStartIndex);
11115 var args = str.substring(argsStartIndex + 1, argsEndIndex).split(',');
11116 var locationString = str.substring(argsEndIndex + 1);
11117
11118 if (locationString.indexOf('@') === 0) {
11119 var parts = /@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(locationString, '');
11120 var fileName = parts[1];
11121 var lineNumber = parts[2];
11122 var columnNumber = parts[3];
11123 }
11124
11125 return new StackFrame({
11126 functionName: functionName,
11127 args: args || undefined,
11128 fileName: fileName,
11129 lineNumber: lineNumber || undefined,
11130 columnNumber: columnNumber || undefined
11131 });
11132 }
11133 ;
11134
11135 for (var i = 0; i < booleanProps.length; i++) {
11136 StackFrame.prototype['get' + _capitalize(booleanProps[i])] = _getter(booleanProps[i]);
11137
11138 StackFrame.prototype['set' + _capitalize(booleanProps[i])] = function(p) {
11139 return function(v) {
11140 this[p] = Boolean(v);
11141 }
11142 ;
11143 }(booleanProps[i]);
11144 }
11145
11146 for (var j = 0; j < numericProps.length; j++) {
11147 StackFrame.prototype['get' + _capitalize(numericProps[j])] = _getter(numericProps[j]);
11148
11149 StackFrame.prototype['set' + _capitalize(numericProps[j])] = function(p) {
11150 return function(v) {
11151 if (!_isNumber(v)) {
11152 throw new TypeError(p + ' must be a Number');
11153 }
11154
11155 this[p] = Number(v);
11156 }
11157 ;
11158 }(numericProps[j]);
11159 }
11160
11161 for (var k = 0; k < stringProps.length; k++) {
11162 StackFrame.prototype['get' + _capitalize(stringProps[k])] = _getter(stringProps[k]);
11163
11164 StackFrame.prototype['set' + _capitalize(stringProps[k])] = function(p) {
11165 return function(v) {
11166 this[p] = String(v);
11167 }
11168 ;
11169 }(stringProps[k]);
11170 }
11171
11172 return StackFrame;
11173 });
11174
11175 /***/
11176 }
11177 ),
11178
11179 /***/
11180 68: /***/
11181 (function(module, exports, __webpack_require__) {
11182
11183 "use strict";
11184
11185 function nullthrows(x, message) {
11186 if (x != null) {
11187 return x;
11188 }
11189
11190 var error = new Error(message !== undefined ? message : 'Got unexpected ' + x);
11191 error.framesToPop = 1;
11192 // Skip nullthrows's own stack frame.
11193
11194 throw error;
11195 }
11196
11197 module.exports = nullthrows;
11198 module.exports.default = nullthrows;
11199 Object.defineProperty(module.exports, '__esModule', {
11200 value: true
11201 });
11202
11203 /***/
11204 }
11205 ),
11206
11207 /***/
11208 7: /***/
11209 (function(module, __webpack_exports__, __webpack_require__) {
11210
11211 "use strict";
11212 /* harmony export (binding) */
11213 __webpack_require__.d(__webpack_exports__, "a", function() {
11214 return localStorageGetItem;
11215 });
11216 /* harmony export (binding) */
11217 __webpack_require__.d(__webpack_exports__, "b", function() {
11218 return localStorageRemoveItem;
11219 });
11220 /* harmony export (binding) */
11221 __webpack_require__.d(__webpack_exports__, "c", function() {
11222 return localStorageSetItem;
11223 });
11224 /* harmony export (binding) */
11225 __webpack_require__.d(__webpack_exports__, "d", function() {
11226 return sessionStorageGetItem;
11227 });
11228 /* unused harmony export sessionStorageRemoveItem */
11229 /* unused harmony export sessionStorageSetItem */
11230 /**
11231 * Copyright (c) Facebook, Inc. and its affiliates.
11232 *
11233 * This source code is licensed under the MIT license found in the
11234 * LICENSE file in the root directory of this source tree.
11235 *
11236 *
11237 */
11238 function localStorageGetItem(key) {
11239 try {
11240 return localStorage.getItem(key);
11241 } catch (error) {
11242 return null;
11243 }
11244 }
11245 function localStorageRemoveItem(key) {
11246 try {
11247 localStorage.removeItem(key);
11248 } catch (error) {}
11249 }
11250 function localStorageSetItem(key, value) {
11251 try {
11252 return localStorage.setItem(key, value);
11253 } catch (error) {}
11254 }
11255 function sessionStorageGetItem(key) {
11256 try {
11257 return sessionStorage.getItem(key);
11258 } catch (error) {
11259 return null;
11260 }
11261 }
11262 function sessionStorageRemoveItem(key) {
11263 try {
11264 sessionStorage.removeItem(key);
11265 } catch (error) {}
11266 }
11267 function sessionStorageSetItem(key, value) {
11268 try {
11269 return sessionStorage.setItem(key, value);
11270 } catch (error) {}
11271 }
11272
11273 /***/
11274 }
11275 ),
11276
11277 /***/
11278 8: /***/
11279 (function(module, __webpack_exports__, __webpack_require__) {
11280
11281 "use strict";
11282 /* harmony export (binding) */
11283 __webpack_require__.d(__webpack_exports__, "d", function() {
11284 return meta;
11285 });
11286 /* harmony export (binding) */
11287 __webpack_require__.d(__webpack_exports__, "a", function() {
11288 return dehydrate;
11289 });
11290 /* harmony export (binding) */
11291 __webpack_require__.d(__webpack_exports__, "b", function() {
11292 return fillInPath;
11293 });
11294 /* harmony export (binding) */
11295 __webpack_require__.d(__webpack_exports__, "c", function() {
11296 return hydrate;
11297 });
11298 /* harmony import */
11299 var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
11300 function ownKeys(object, enumerableOnly) {
11301 var keys = Object.keys(object);
11302 if (Object.getOwnPropertySymbols) {
11303 var symbols = Object.getOwnPropertySymbols(object);
11304 if (enumerableOnly)
11305 symbols = symbols.filter(function(sym) {
11306 return Object.getOwnPropertyDescriptor(object, sym).enumerable;
11307 });
11308 keys.push.apply(keys, symbols);
11309 }
11310 return keys;
11311 }
11312
11313 function _objectSpread(target) {
11314 for (var i = 1; i < arguments.length; i++) {
11315 var source = arguments[i] != null ? arguments[i] : {};
11316 if (i % 2) {
11317 ownKeys(Object(source), true).forEach(function(key) {
11318 _defineProperty(target, key, source[key]);
11319 });
11320 } else if (Object.getOwnPropertyDescriptors) {
11321 Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
11322 } else {
11323 ownKeys(Object(source)).forEach(function(key) {
11324 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
11325 });
11326 }
11327 }
11328 return target;
11329 }
11330
11331 function _defineProperty(obj, key, value) {
11332 if (key in obj) {
11333 Object.defineProperty(obj, key, {
11334 value: value,
11335 enumerable: true,
11336 configurable: true,
11337 writable: true
11338 });
11339 } else {
11340 obj[key] = value;
11341 }
11342 return obj;
11343 }
11344
11345 /**
11346 * Copyright (c) Facebook, Inc. and its affiliates.
11347 *
11348 * This source code is licensed under the MIT license found in the
11349 * LICENSE file in the root directory of this source tree.
11350 *
11351 *
11352 */
11353
11354 const meta = {
11355 inspectable: Symbol('inspectable'),
11356 inspected: Symbol('inspected'),
11357 name: Symbol('name'),
11358 preview_long: Symbol('preview_long'),
11359 preview_short: Symbol('preview_short'),
11360 readonly: Symbol('readonly'),
11361 size: Symbol('size'),
11362 type: Symbol('type'),
11363 unserializable: Symbol('unserializable')
11364 };
11365 // This threshold determines the depth at which the bridge "dehydrates" nested data.
11366 // Dehydration means that we don't serialize the data for e.g. postMessage or stringify,
11367 // unless the frontend explicitly requests it (e.g. a user clicks to expand a props object).
11368 //
11369 // Reducing this threshold will improve the speed of initial component inspection,
11370 // but may decrease the responsiveness of expanding objects/arrays to inspect further.
11371 const LEVEL_THRESHOLD = 2;
11372 /**
11373 * Generate the dehydrated metadata for complex object instances
11374 */
11375
11376 function createDehydrated(type, inspectable, data, cleaned, path) {
11377 cleaned.push(path);
11378 const dehydrated = {
11379 inspectable,
11380 type,
11381 preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */
11382 "b"])(data, true),
11383 preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */
11384 "b"])(data, false),
11385 name: !data.constructor || data.constructor.name === 'Object' ? '' : data.constructor.name
11386 };
11387
11388 if (type === 'array' || type === 'typed_array') {
11389 dehydrated.size = data.length;
11390 } else if (type === 'object') {
11391 dehydrated.size = Object.keys(data).length;
11392 }
11393
11394 if (type === 'iterator' || type === 'typed_array') {
11395 dehydrated.readonly = true;
11396 }
11397
11398 return dehydrated;
11399 }
11400 /**
11401 * Strip out complex data (instances, functions, and data nested > LEVEL_THRESHOLD levels deep).
11402 * The paths of the stripped out objects are appended to the `cleaned` list.
11403 * On the other side of the barrier, the cleaned list is used to "re-hydrate" the cleaned representation into
11404 * an object with symbols as attributes, so that a sanitized object can be distinguished from a normal object.
11405 *
11406 * Input: {"some": {"attr": fn()}, "other": AnInstance}
11407 * Output: {
11408 * "some": {
11409 * "attr": {"name": the fn.name, type: "function"}
11410 * },
11411 * "other": {
11412 * "name": "AnInstance",
11413 * "type": "object",
11414 * },
11415 * }
11416 * and cleaned = [["some", "attr"], ["other"]]
11417 */
11418
11419 function dehydrate(data, cleaned, unserializable, path, isPathAllowed, level=0) {
11420 const type = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* getDataType */
11421 "f"])(data);
11422 let isPathAllowedCheck;
11423
11424 switch (type) {
11425 case 'html_element':
11426 cleaned.push(path);
11427 return {
11428 inspectable: false,
11429 preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */
11430 "b"])(data, false),
11431 preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */
11432 "b"])(data, true),
11433 name: data.tagName,
11434 type
11435 };
11436
11437 case 'function':
11438 cleaned.push(path);
11439 return {
11440 inspectable: false,
11441 preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */
11442 "b"])(data, false),
11443 preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */
11444 "b"])(data, true),
11445 name: typeof data.name === 'function' || !data.name ? 'function' : data.name,
11446 type
11447 };
11448
11449 case 'string':
11450 return data.length <= 500 ? data : data.slice(0, 500) + '...';
11451
11452 case 'bigint':
11453 cleaned.push(path);
11454 return {
11455 inspectable: false,
11456 preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */
11457 "b"])(data, false),
11458 preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */
11459 "b"])(data, true),
11460 name: data.toString(),
11461 type
11462 };
11463
11464 case 'symbol':
11465 cleaned.push(path);
11466 return {
11467 inspectable: false,
11468 preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */
11469 "b"])(data, false),
11470 preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */
11471 "b"])(data, true),
11472 name: data.toString(),
11473 type
11474 };
11475 // React Elements aren't very inspector-friendly,
11476 // and often contain private fields or circular references.
11477
11478 case 'react_element':
11479 cleaned.push(path);
11480 return {
11481 inspectable: false,
11482 preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */
11483 "b"])(data, false),
11484 preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */
11485 "b"])(data, true),
11486 name: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* getDisplayNameForReactElement */
11487 "i"])(data) || 'Unknown',
11488 type
11489 };
11490 // ArrayBuffers error if you try to inspect them.
11491
11492 case 'array_buffer':
11493 case 'data_view':
11494 cleaned.push(path);
11495 return {
11496 inspectable: false,
11497 preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */
11498 "b"])(data, false),
11499 preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */
11500 "b"])(data, true),
11501 name: type === 'data_view' ? 'DataView' : 'ArrayBuffer',
11502 size: data.byteLength,
11503 type
11504 };
11505
11506 case 'array':
11507 isPathAllowedCheck = isPathAllowed(path);
11508
11509 if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
11510 return createDehydrated(type, true, data, cleaned, path);
11511 }
11512
11513 return data.map((item,i)=>dehydrate(item, cleaned, unserializable, path.concat([i]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1));
11514
11515 case 'html_all_collection':
11516 case 'typed_array':
11517 case 'iterator':
11518 isPathAllowedCheck = isPathAllowed(path);
11519
11520 if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
11521 return createDehydrated(type, true, data, cleaned, path);
11522 } else {
11523 const unserializableValue = {
11524 unserializable: true,
11525 type: type,
11526 readonly: true,
11527 size: type === 'typed_array' ? data.length : undefined,
11528 preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */
11529 "b"])(data, false),
11530 preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */
11531 "b"])(data, true),
11532 name: !data.constructor || data.constructor.name === 'Object' ? '' : data.constructor.name
11533 };
11534
11535 if (typeof data[Symbol.iterator]) {
11536 // TRICKY
11537 // Don't use [...spread] syntax for this purpose.
11538 // This project uses @babel/plugin-transform-spread in "loose" mode which only works with Array values.
11539 // Other types (e.g. typed arrays, Sets) will not spread correctly.
11540 Array.from(data).forEach((item,i)=>unserializableValue[i] = dehydrate(item, cleaned, unserializable, path.concat([i]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1));
11541 }
11542
11543 unserializable.push(path);
11544 return unserializableValue;
11545 }
11546
11547 case 'opaque_iterator':
11548 cleaned.push(path);
11549 return {
11550 inspectable: false,
11551 preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */
11552 "b"])(data, false),
11553 preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */
11554 "b"])(data, true),
11555 name: data[Symbol.toStringTag],
11556 type
11557 };
11558
11559 case 'date':
11560 cleaned.push(path);
11561 return {
11562 inspectable: false,
11563 preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */
11564 "b"])(data, false),
11565 preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */
11566 "b"])(data, true),
11567 name: data.toString(),
11568 type
11569 };
11570
11571 case 'regexp':
11572 cleaned.push(path);
11573 return {
11574 inspectable: false,
11575 preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */
11576 "b"])(data, false),
11577 preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */
11578 "b"])(data, true),
11579 name: data.toString(),
11580 type
11581 };
11582
11583 case 'object':
11584 isPathAllowedCheck = isPathAllowed(path);
11585
11586 if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
11587 return createDehydrated(type, true, data, cleaned, path);
11588 } else {
11589 const object = {};
11590 Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* getAllEnumerableKeys */
11591 "c"])(data).forEach(key=>{
11592 const name = key.toString();
11593 object[name] = dehydrate(data[key], cleaned, unserializable, path.concat([name]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
11594 }
11595 );
11596 return object;
11597 }
11598
11599 case 'infinity':
11600 case 'nan':
11601 case 'undefined':
11602 // Some values are lossy when sent through a WebSocket.
11603 // We dehydrate+rehydrate them to preserve their type.
11604 cleaned.push(path);
11605 return {
11606 type
11607 };
11608
11609 default:
11610 return data;
11611 }
11612 }
11613 function fillInPath(object, data, path, value) {
11614 const target = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* getInObject */
11615 "j"])(object, path);
11616
11617 if (target != null) {
11618 if (!target[meta.unserializable]) {
11619 delete target[meta.inspectable];
11620 delete target[meta.inspected];
11621 delete target[meta.name];
11622 delete target[meta.preview_long];
11623 delete target[meta.preview_short];
11624 delete target[meta.readonly];
11625 delete target[meta.size];
11626 delete target[meta.type];
11627 }
11628 }
11629
11630 if (value !== null && data.unserializable.length > 0) {
11631 const unserializablePath = data.unserializable[0];
11632 let isMatch = unserializablePath.length === path.length;
11633
11634 for (let i = 0; i < path.length; i++) {
11635 if (path[i] !== unserializablePath[i]) {
11636 isMatch = false;
11637 break;
11638 }
11639 }
11640
11641 if (isMatch) {
11642 upgradeUnserializable(value, value);
11643 }
11644 }
11645
11646 Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* setInObject */
11647 "p"])(object, path, value);
11648 }
11649 function hydrate(object, cleaned, unserializable) {
11650 cleaned.forEach(path=>{
11651 const length = path.length;
11652 const last = path[length - 1];
11653 const parent = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* getInObject */
11654 "j"])(object, path.slice(0, length - 1));
11655
11656 if (!parent || !parent.hasOwnProperty(last)) {
11657 return;
11658 }
11659
11660 const value = parent[last];
11661
11662 if (value.type === 'infinity') {
11663 parent[last] = Infinity;
11664 } else if (value.type === 'nan') {
11665 parent[last] = NaN;
11666 } else if (value.type === 'undefined') {
11667 parent[last] = undefined;
11668 } else {
11669 // Replace the string keys with Symbols so they're non-enumerable.
11670 const replaced = {};
11671 replaced[meta.inspectable] = !!value.inspectable;
11672 replaced[meta.inspected] = false;
11673 replaced[meta.name] = value.name;
11674 replaced[meta.preview_long] = value.preview_long;
11675 replaced[meta.preview_short] = value.preview_short;
11676 replaced[meta.size] = value.size;
11677 replaced[meta.readonly] = !!value.readonly;
11678 replaced[meta.type] = value.type;
11679 parent[last] = replaced;
11680 }
11681 }
11682 );
11683 unserializable.forEach(path=>{
11684 const length = path.length;
11685 const last = path[length - 1];
11686 const parent = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* getInObject */
11687 "j"])(object, path.slice(0, length - 1));
11688
11689 if (!parent || !parent.hasOwnProperty(last)) {
11690 return;
11691 }
11692
11693 const node = parent[last];
11694
11695 const replacement = _objectSpread({}, node);
11696
11697 upgradeUnserializable(replacement, node);
11698 parent[last] = replacement;
11699 }
11700 );
11701 return object;
11702 }
11703
11704 function upgradeUnserializable(destination, source) {
11705 Object.defineProperties(destination, {
11706 [meta.inspected]: {
11707 configurable: true,
11708 enumerable: false,
11709 value: !!source.inspected
11710 },
11711 [meta.name]: {
11712 configurable: true,
11713 enumerable: false,
11714 value: source.name
11715 },
11716 [meta.preview_long]: {
11717 configurable: true,
11718 enumerable: false,
11719 value: source.preview_long
11720 },
11721 [meta.preview_short]: {
11722 configurable: true,
11723 enumerable: false,
11724 value: source.preview_short
11725 },
11726 [meta.size]: {
11727 configurable: true,
11728 enumerable: false,
11729 value: source.size
11730 },
11731 [meta.readonly]: {
11732 configurable: true,
11733 enumerable: false,
11734 value: !!source.readonly
11735 },
11736 [meta.type]: {
11737 configurable: true,
11738 enumerable: false,
11739 value: source.type
11740 },
11741 [meta.unserializable]: {
11742 configurable: true,
11743 enumerable: false,
11744 value: !!source.unserializable
11745 }
11746 });
11747 delete destination.inspected;
11748 delete destination.name;
11749 delete destination.preview_long;
11750 delete destination.preview_short;
11751 delete destination.size;
11752 delete destination.readonly;
11753 delete destination.type;
11754 delete destination.unserializable;
11755 }
11756
11757 /***/
11758 }
11759 )
11760 /******/
11761});
11762//# sourceMappingURL=injectGlobalHook.js.map
11763