From 81d0f745ce8636956f6950dca290326c6f859e79 Mon Sep 17 00:00:00 2001 From: Yuuto <55290516+JustYuuto@users.noreply.github.com> Date: Wed, 28 Aug 2024 02:11:31 +0200 Subject: [PATCH] 1.2.8 --- CHANGELOG.md | 6 + package.json | 6 +- src/functions.ts | 39 +- src/index.ts | 17 +- src/prompt.html | 97 - src/prompt.js | 5 - src/react-devtools/build/background.js | 272 - .../build/importFile.worker.worker.js | 4790 - src/react-devtools/build/installHook.js | 13347 --- src/react-devtools/build/main.js | 56723 ---------- src/react-devtools/build/panel.js | 110 - .../build/parseHookNames.chunk.js | 490 - .../parseSourceAndMetadata.worker.worker.js | 87709 ---------------- src/react-devtools/build/prepareInjection.js | 731 - src/react-devtools/build/proxy.js | 155 - .../build/react_devtools_backend.js | 16893 --- src/react-devtools/build/renderer.js | 12853 --- .../build/vendors~parseHookNames.chunk.js | 2095 - src/react-devtools/icons/128-deadcode.png | Bin 2101 -> 0 bytes src/react-devtools/icons/128-development.png | Bin 2101 -> 0 bytes src/react-devtools/icons/128-disabled.png | Bin 1936 -> 0 bytes src/react-devtools/icons/128-outdated.png | Bin 1992 -> 0 bytes src/react-devtools/icons/128-production.png | Bin 1920 -> 0 bytes src/react-devtools/icons/128-restricted.png | Bin 1936 -> 0 bytes src/react-devtools/icons/128-unminified.png | Bin 2101 -> 0 bytes src/react-devtools/icons/16-deadcode.png | Bin 338 -> 0 bytes src/react-devtools/icons/16-development.png | Bin 338 -> 0 bytes src/react-devtools/icons/16-disabled.png | Bin 288 -> 0 bytes src/react-devtools/icons/16-outdated.png | Bin 313 -> 0 bytes src/react-devtools/icons/16-production.png | Bin 272 -> 0 bytes src/react-devtools/icons/16-restricted.png | Bin 288 -> 0 bytes src/react-devtools/icons/16-unminified.png | Bin 338 -> 0 bytes src/react-devtools/icons/32-deadcode.png | Bin 561 -> 0 bytes src/react-devtools/icons/32-development.png | Bin 561 -> 0 bytes src/react-devtools/icons/32-disabled.png | Bin 490 -> 0 bytes src/react-devtools/icons/32-outdated.png | Bin 550 -> 0 bytes src/react-devtools/icons/32-production.png | Bin 474 -> 0 bytes src/react-devtools/icons/32-restricted.png | Bin 490 -> 0 bytes src/react-devtools/icons/32-unminified.png | Bin 561 -> 0 bytes src/react-devtools/icons/48-deadcode.png | Bin 826 -> 0 bytes src/react-devtools/icons/48-development.png | Bin 826 -> 0 bytes src/react-devtools/icons/48-disabled.png | Bin 730 -> 0 bytes src/react-devtools/icons/48-outdated.png | Bin 787 -> 0 bytes src/react-devtools/icons/48-production.png | Bin 714 -> 0 bytes src/react-devtools/icons/48-restricted.png | Bin 730 -> 0 bytes src/react-devtools/icons/48-unminified.png | Bin 826 -> 0 bytes src/react-devtools/icons/deadcode.svg | 1 - src/react-devtools/icons/development.svg | 1 - src/react-devtools/icons/disabled.svg | 1 - src/react-devtools/icons/outdated.svg | 1 - src/react-devtools/icons/production.svg | 1 - src/react-devtools/icons/restricted.svg | 1 - src/react-devtools/main.html | 9 - src/react-devtools/manifest.json | 55 - src/react-devtools/panel.html | 32 - src/react-devtools/popups/deadcode.html | 28 - src/react-devtools/popups/development.html | 24 - src/react-devtools/popups/disabled.html | 17 - src/react-devtools/popups/outdated.html | 25 - src/react-devtools/popups/production.html | 17 - src/react-devtools/popups/restricted.html | 14 - src/react-devtools/popups/shared.css | 7 - src/react-devtools/popups/shared.js | 25 - src/react-devtools/popups/unminified.html | 31 - src/utils/Activity.ts | 56 +- src/utils/DiscordWebSocket.ts | 42 - src/utils/RPC.ts | 13 +- src/utils/Tray.ts | 49 +- src/utils/Window.ts | 20 +- yarn.lock | 121 +- 70 files changed, 138 insertions(+), 196791 deletions(-) delete mode 100644 src/prompt.html delete mode 100644 src/prompt.js delete mode 100644 src/react-devtools/build/background.js delete mode 100644 src/react-devtools/build/importFile.worker.worker.js delete mode 100644 src/react-devtools/build/installHook.js delete mode 100644 src/react-devtools/build/main.js delete mode 100644 src/react-devtools/build/panel.js delete mode 100644 src/react-devtools/build/parseHookNames.chunk.js delete mode 100644 src/react-devtools/build/parseSourceAndMetadata.worker.worker.js delete mode 100644 src/react-devtools/build/prepareInjection.js delete mode 100644 src/react-devtools/build/proxy.js delete mode 100644 src/react-devtools/build/react_devtools_backend.js delete mode 100644 src/react-devtools/build/renderer.js delete mode 100644 src/react-devtools/build/vendors~parseHookNames.chunk.js delete mode 100644 src/react-devtools/icons/128-deadcode.png delete mode 100644 src/react-devtools/icons/128-development.png delete mode 100644 src/react-devtools/icons/128-disabled.png delete mode 100644 src/react-devtools/icons/128-outdated.png delete mode 100644 src/react-devtools/icons/128-production.png delete mode 100644 src/react-devtools/icons/128-restricted.png delete mode 100644 src/react-devtools/icons/128-unminified.png delete mode 100644 src/react-devtools/icons/16-deadcode.png delete mode 100644 src/react-devtools/icons/16-development.png delete mode 100644 src/react-devtools/icons/16-disabled.png delete mode 100644 src/react-devtools/icons/16-outdated.png delete mode 100644 src/react-devtools/icons/16-production.png delete mode 100644 src/react-devtools/icons/16-restricted.png delete mode 100644 src/react-devtools/icons/16-unminified.png delete mode 100644 src/react-devtools/icons/32-deadcode.png delete mode 100644 src/react-devtools/icons/32-development.png delete mode 100644 src/react-devtools/icons/32-disabled.png delete mode 100644 src/react-devtools/icons/32-outdated.png delete mode 100644 src/react-devtools/icons/32-production.png delete mode 100644 src/react-devtools/icons/32-restricted.png delete mode 100644 src/react-devtools/icons/32-unminified.png delete mode 100644 src/react-devtools/icons/48-deadcode.png delete mode 100644 src/react-devtools/icons/48-development.png delete mode 100644 src/react-devtools/icons/48-disabled.png delete mode 100644 src/react-devtools/icons/48-outdated.png delete mode 100644 src/react-devtools/icons/48-production.png delete mode 100644 src/react-devtools/icons/48-restricted.png delete mode 100644 src/react-devtools/icons/48-unminified.png delete mode 100644 src/react-devtools/icons/deadcode.svg delete mode 100644 src/react-devtools/icons/development.svg delete mode 100644 src/react-devtools/icons/disabled.svg delete mode 100644 src/react-devtools/icons/outdated.svg delete mode 100644 src/react-devtools/icons/production.svg delete mode 100644 src/react-devtools/icons/restricted.svg delete mode 100644 src/react-devtools/main.html delete mode 100644 src/react-devtools/manifest.json delete mode 100644 src/react-devtools/panel.html delete mode 100644 src/react-devtools/popups/deadcode.html delete mode 100644 src/react-devtools/popups/development.html delete mode 100644 src/react-devtools/popups/disabled.html delete mode 100644 src/react-devtools/popups/outdated.html delete mode 100644 src/react-devtools/popups/production.html delete mode 100644 src/react-devtools/popups/restricted.html delete mode 100644 src/react-devtools/popups/shared.css delete mode 100644 src/react-devtools/popups/shared.js delete mode 100644 src/react-devtools/popups/unminified.html delete mode 100644 src/utils/DiscordWebSocket.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 7831fd1..17fe24f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 1.2.8 + +* Fixed the app not working because of Deezer and Discord changes +* Made the "Listening to" mode not needing your token anymore +* Fixed the "Don't close to tray" option not making the RPC disconnect when closing the app + ## 1.2.7 * Added back and forward buttons (#53) diff --git a/package.json b/package.json index 4ff316e..e751232 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "deezer-discord-rpc", - "version": "1.2.7", + "version": "1.2.8", "description": "A Discord RPC for Deezer", "main": "./build/src/index.js", "scripts": { @@ -10,13 +10,13 @@ "run": "yarn build:ts && yarn run copy-assets && yarn start", "postinstall": "electron-builder install-app-deps", "lint": "eslint --fix --ext .ts ./src", - "copy-assets": "cpy ./src/img/* ./build/src/img/ && cpy ./src/prompt.html ./build/" + "copy-assets": "cpy ./src/img/* ./build/src/img/" }, "dependencies": { "@cliqz/adblocker-electron": "^1.27.1", + "@xhayper/discord-rpc": "^1.2.0", "axios": "^1.6.8", "chalk": "4.1.2", - "discord-rpc": "^4.0.1", "discord.js-selfbot-v13": "^2.14.9" }, "devDependencies": { diff --git a/src/functions.ts b/src/functions.ts index ef5a96d..41c12cd 100644 --- a/src/functions.ts +++ b/src/functions.ts @@ -1,45 +1,8 @@ -import { BrowserWindow, shell, ipcMain } from 'electron'; -import { join } from 'path'; -import * as Config from './utils/Config'; -import * as DiscordWebSocket from './utils/DiscordWebSocket'; import { win } from './utils/Window'; export const wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); -export async function prompt(message: string, app: Electron.App, options?: { - closable?: boolean -}) { - const win = new BrowserWindow({ - resizable: false, - minimizable: false, - maximizable: false, - closable: typeof options?.closable !== 'undefined' ? options?.closable : true, - webPreferences: { - preload: join(__dirname, 'prompt.js') - } - }); - - ipcMain.on('autocomplete-token', async () => { - if (Config.get(app, 'discord_token')) { - await runJs(`document.querySelector('input#discord-token').value = '${Config.get(app, 'discord_token')}'`); - } - }); - - ipcMain.on('token-received', async (e, data) => { - Config.set(app, 'discord_token', data); - Config.set(app, 'use_listening_to', true); - win.close(); - DiscordWebSocket.connect(data, app).catch(console.error); - }); - - win.webContents.setWindowOpenHandler((details) => { - shell.openExternal(details.url); - return { action: 'deny' }; - }); - win.setMenuBarVisibility(false); - await win.loadFile(join(__dirname, 'prompt.html'), { hash: message }); -} - export async function runJs(code: string) { + // return code; return win.webContents.executeJavaScript(code); } diff --git a/src/index.ts b/src/index.ts index 3f94ad6..8ac1411 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,19 +1,15 @@ -import { app, BrowserWindow, session } from 'electron'; +import { app, BrowserWindow } from 'electron'; import { log } from './utils/Log'; -import * as Config from './utils/Config'; import * as Tray from './utils/Tray'; import updater from './utils/Updater'; -import * as DiscordWebSocket from './utils/DiscordWebSocket'; import * as RPC from './utils/RPC'; import * as Window from './utils/Window'; -import { join } from 'path'; import { version } from '../package.json'; -import {showWindow} from './utils/Window'; +import { showWindow } from './utils/Window'; log('App', 'Deezer Discord RPC version', version, process.argv0.includes('node') ? '(debug)' : ''); app.whenReady().then(async () => { - const gotTheLock = app.requestSingleInstanceLock(); if (!gotTheLock) { @@ -26,17 +22,10 @@ app.whenReady().then(async () => { } await Tray.init(app, RPC.client); - if (process.argv0.includes('node')) { - await session.defaultSession.loadExtension(join(process.cwd(), 'src', 'react-devtools')); - } await Window.load(app); await updater(true); - if (Config.get(app, 'use_listening_to')) { - DiscordWebSocket.connect(Config.get(app, 'discord_token'), app).catch((e) => log('WebSocket', e.toString())); - } else { - RPC.connect(); - } + RPC.connect(); app.on('activate', async () => { if (BrowserWindow.getAllWindows().length > 0) { diff --git a/src/prompt.html b/src/prompt.html deleted file mode 100644 index 499963b..0000000 --- a/src/prompt.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - "Listening to" mode setup - - - -
-
- - -
-
- -
-
- - - diff --git a/src/prompt.js b/src/prompt.js deleted file mode 100644 index 8f3c7d7..0000000 --- a/src/prompt.js +++ /dev/null @@ -1,5 +0,0 @@ -const { contextBridge, ipcRenderer } = require('electron'); - -contextBridge.exposeInMainWorld('ipcRenderer', { - send: (channel, payload) => ipcRenderer.send(channel, payload) -}); diff --git a/src/react-devtools/build/background.js b/src/react-devtools/build/background.js deleted file mode 100644 index e9222fa..0000000 --- a/src/react-devtools/build/background.js +++ /dev/null @@ -1,272 +0,0 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = "/build/"; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 116); -/******/ }) -/************************************************************************/ -/******/ ({ - -/***/ 116: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* global chrome */ - - -const IS_FIREFOX = true; -const ports = {}; - -if (!IS_FIREFOX) { - // Manifest V3 method of injecting content scripts (not yet supported in Firefox) - // Note: the "world" option in registerContentScripts is only available in Chrome v102+ - // It's critical since it allows us to directly run scripts on the "main" world on the page - // "document_start" allows it to run before the page's scripts - // so the hook can be detected by react reconciler - chrome.scripting.registerContentScripts([{ - id: 'hook', - matches: [''], - js: ['build/installHook.js'], - runAt: 'document_start', - world: chrome.scripting.ExecutionWorld.MAIN - }, { - id: 'renderer', - matches: [''], - js: ['build/renderer.js'], - runAt: 'document_start', - world: chrome.scripting.ExecutionWorld.MAIN - }]); -} - -chrome.runtime.onConnect.addListener(function (port) { - let tab = null; - let name = null; - - if (isNumeric(port.name)) { - tab = port.name; - name = 'devtools'; - installProxy(+port.name); - } else { - tab = port.sender.tab.id; - name = 'content-script'; - } - - if (!ports[tab]) { - ports[tab] = { - devtools: null, - 'content-script': null - }; - } - - ports[tab][name] = port; - - if (ports[tab].devtools && ports[tab]['content-script']) { - doublePipe(ports[tab].devtools, ports[tab]['content-script']); - } -}); - -function isNumeric(str) { - return +str + '' === str; -} - -function installProxy(tabId) { - if (IS_FIREFOX) { - chrome.tabs.executeScript(tabId, { - file: '/build/proxy.js' - }, function () {}); - } else { - chrome.scripting.executeScript({ - target: { - tabId: tabId - }, - files: ['/build/proxy.js'] - }); - } -} - -function doublePipe(one, two) { - one.onMessage.addListener(lOne); - - function lOne(message) { - two.postMessage(message); - } - - two.onMessage.addListener(lTwo); - - function lTwo(message) { - one.postMessage(message); - } - - function shutdown() { - one.onMessage.removeListener(lOne); - two.onMessage.removeListener(lTwo); - one.disconnect(); - two.disconnect(); - } - - one.onDisconnect.addListener(shutdown); - two.onDisconnect.addListener(shutdown); -} - -function setIconAndPopup(reactBuildType, tabId) { - const action = IS_FIREFOX ? chrome.browserAction : chrome.action; - action.setIcon({ - tabId: tabId, - path: { - '16': chrome.runtime.getURL(`icons/16-${reactBuildType}.png`), - '32': chrome.runtime.getURL(`icons/32-${reactBuildType}.png`), - '48': chrome.runtime.getURL(`icons/48-${reactBuildType}.png`), - '128': chrome.runtime.getURL(`icons/128-${reactBuildType}.png`) - } - }); - action.setPopup({ - tabId: tabId, - popup: chrome.runtime.getURL(`popups/${reactBuildType}.html`) - }); -} - -function isRestrictedBrowserPage(url) { - return !url || new URL(url).protocol === 'chrome:'; -} - -function checkAndHandleRestrictedPageIfSo(tab) { - if (tab && isRestrictedBrowserPage(tab.url)) { - setIconAndPopup('restricted', tab.id); - } -} // update popup page of any existing open tabs, if they are restricted browser pages. -// we can't update for any other types (prod,dev,outdated etc) -// as the content script needs to be injected at document_start itself for those kinds of detection -// TODO: Show a different popup page(to reload current page probably) for old tabs, opened before the extension is installed - - -if (!IS_FIREFOX) { - chrome.tabs.query({}, tabs => tabs.forEach(checkAndHandleRestrictedPageIfSo)); - chrome.tabs.onCreated.addListener((tabId, changeInfo, tab) => checkAndHandleRestrictedPageIfSo(tab)); -} // Listen to URL changes on the active tab and update the DevTools icon. - - -chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => { - if (IS_FIREFOX) { - // We don't properly detect protected URLs in Firefox at the moment. - // However we can reset the DevTools icon to its loading state when the URL changes. - // It will be updated to the correct icon by the onMessage callback below. - if (tab.active && changeInfo.status === 'loading') { - setIconAndPopup('disabled', tabId); - } - } else { - // Don't reset the icon to the loading state for Chrome or Edge. - // The onUpdated callback fires more frequently for these browsers, - // often after onMessage has been called. - checkAndHandleRestrictedPageIfSo(tab); - } -}); -chrome.runtime.onMessage.addListener((request, sender) => { - var _request$payload, _ports$id; - - const tab = sender.tab; - - if (tab) { - const id = tab.id; // This is sent from the hook content script. - // It tells us a renderer has attached. - - if (request.hasDetectedReact) { - setIconAndPopup(request.reactBuildType, id); - } else { - switch ((_request$payload = request.payload) === null || _request$payload === void 0 ? void 0 : _request$payload.type) { - case 'fetch-file-with-cache-complete': - case 'fetch-file-with-cache-error': - // Forward the result of fetch-in-page requests back to the extension. - const devtools = (_ports$id = ports[id]) === null || _ports$id === void 0 ? void 0 : _ports$id.devtools; - - if (devtools) { - devtools.postMessage(request); - } - - break; - } - } - } -}); - -/***/ }) - -/******/ }); \ No newline at end of file diff --git a/src/react-devtools/build/importFile.worker.worker.js b/src/react-devtools/build/importFile.worker.worker.js deleted file mode 100644 index 8f58b7d..0000000 --- a/src/react-devtools/build/importFile.worker.worker.js +++ /dev/null @@ -1,4790 +0,0 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = "/build/"; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 13); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.decodeBase64 = exports.lazyStatic = exports.memoizeByReference = exports.memoizeByShallowEquality = exports.objectsHaveShallowEquality = exports.noop = exports.binarySearch = exports.triangle = exports.fract = exports.formatPercent = exports.zeroPad = exports.itReduce = exports.itForEach = exports.itMap = exports.KeyedSet = exports.getOrThrow = exports.getOrElse = exports.getOrInsert = exports.sortBy = exports.lastOf = void 0; - -function lastOf(ts) { - return ts[ts.length - 1] || null; -} - -exports.lastOf = lastOf; - -function sortBy(ts, key) { - function comparator(a, b) { - const keyA = key(a); - const keyB = key(b); - return keyA < keyB ? -1 : keyA > keyB ? 1 : 0; - } - - ts.sort(comparator); -} - -exports.sortBy = sortBy; - -function getOrInsert(map, k, fallback) { - if (!map.has(k)) map.set(k, fallback(k)); - return map.get(k); -} - -exports.getOrInsert = getOrInsert; - -function getOrElse(map, k, fallback) { - if (!map.has(k)) return fallback(k); - return map.get(k); -} - -exports.getOrElse = getOrElse; - -function getOrThrow(map, k) { - if (!map.has(k)) { - throw new Error(`Expected key ${k}`); - } - - return map.get(k); -} - -exports.getOrThrow = getOrThrow; - -class KeyedSet { - constructor() { - this.map = new Map(); - } - - getOrInsert(t) { - const key = t.key; - const existing = this.map.get(key); - if (existing) return existing; - this.map.set(key, t); - return t; - } - - forEach(fn) { - this.map.forEach(fn); - } - - [Symbol.iterator]() { - return this.map.values(); - } - -} - -exports.KeyedSet = KeyedSet; - -function* itMap(it, f) { - for (let t of it) { - yield f(t); - } -} - -exports.itMap = itMap; - -function itForEach(it, f) { - for (let t of it) { - f(t); - } -} - -exports.itForEach = itForEach; - -function itReduce(it, f, init) { - let accum = init; - - for (let t of it) { - accum = f(accum, t); - } - - return accum; -} - -exports.itReduce = itReduce; - -function zeroPad(s, width) { - return new Array(Math.max(width - s.length, 0) + 1).join('0') + s; -} - -exports.zeroPad = zeroPad; - -function formatPercent(percent) { - let formattedPercent = `${percent.toFixed(0)}%`; - if (percent === 100) formattedPercent = '100%';else if (percent > 99) formattedPercent = '>99%';else if (percent < 0.01) formattedPercent = '<0.01%';else if (percent < 1) formattedPercent = `${percent.toFixed(2)}%`;else if (percent < 10) formattedPercent = `${percent.toFixed(1)}%`; - return formattedPercent; -} - -exports.formatPercent = formatPercent; - -function fract(x) { - return x - Math.floor(x); -} - -exports.fract = fract; - -function triangle(x) { - return 2.0 * Math.abs(fract(x) - 0.5) - 1.0; -} - -exports.triangle = triangle; - -function binarySearch(lo, hi, f, target, targetRangeSize = 1) { - console.assert(!isNaN(targetRangeSize) && !isNaN(target)); - - while (true) { - if (hi - lo <= targetRangeSize) return [lo, hi]; - const mid = (hi + lo) / 2; - const val = f(mid); - if (val < target) lo = mid;else hi = mid; - } -} - -exports.binarySearch = binarySearch; - -function noop(...args) {} - -exports.noop = noop; - -function objectsHaveShallowEquality(a, b) { - for (let key in a) { - if (a[key] !== b[key]) return false; - } - - for (let key in b) { - if (a[key] !== b[key]) return false; - } - - return true; -} - -exports.objectsHaveShallowEquality = objectsHaveShallowEquality; - -function memoizeByShallowEquality(cb) { - let last = null; - return args => { - let result; - - if (last == null) { - result = cb(args); - last = { - args, - result - }; - return result; - } else if (objectsHaveShallowEquality(last.args, args)) { - return last.result; - } else { - last.args = args; - last.result = cb(args); - return last.result; - } - }; -} - -exports.memoizeByShallowEquality = memoizeByShallowEquality; - -function memoizeByReference(cb) { - let last = null; - return args => { - let result; - - if (last == null) { - result = cb(args); - last = { - args, - result - }; - return result; - } else if (last.args === args) { - return last.result; - } else { - last.args = args; - last.result = cb(args); - return last.result; - } - }; -} - -exports.memoizeByReference = memoizeByReference; - -function lazyStatic(cb) { - let last = null; - return () => { - if (last == null) { - last = { - result: cb() - }; - } - - return last.result; - }; -} - -exports.lazyStatic = lazyStatic; -const base64lookupTable = lazyStatic(() => { - const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; - const ret = new Map(); - - for (let i = 0; i < alphabet.length; i++) { - ret.set(alphabet.charAt(i), i); - } - - ret.set('=', -1); - return ret; -}); // NOTE: There are probably simpler solutions to this problem, but I have this written already, so -// until we run into problems with this, let's just use this. -// -// See: https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#The_Unicode_Problem#The_Unicode_Problem - -function decodeBase64(encoded) { - // Reference: https://www.rfc-editor.org/rfc/rfc4648.txt - const lookupTable = base64lookupTable(); // 3 byte groups are represented as sequneces of 4 characters. - // - // "The encoding process represents 24-bit groups of input bits as output - // strings of 4 encoded characters." - // - // "Special processing is performed if fewer than 24 bits are available - // at the end of the data being encoded. A full encoding quantum is - // always completed at the end of a quantity. When fewer than 24 input - // bits are available in an input group bits with value zero are added - // (on the right) to form an integral number of 6-bit groups." - - if (encoded.length % 4 !== 0) { - throw new Error(`Invalid length for base64 encoded string. Expected length % 4 = 0, got length = ${encoded.length}`); - } - - const quartetCount = encoded.length / 4; - let byteCount; // Special processing is performed if fewer than 24 bits are available - // at the end of the data being encoded. A full encoding quantum is - // always completed at the end of a quantity. When fewer than 24 input - // bits are available in an input group, bits with value zero are added - // (on the right) to form an integral number of 6-bit groups. Padding - // at the end of the data is performed using the '=' character. Since - // all base 64 input is an integral number of octets, only the following - // cases can arise: - // - // (1) The final quantum of encoding input is an integral multiple of 24 - // bits; here, the final unit of encoded output will be an integral - // multiple of 4 characters with no "=" padding. - // - // (2) The final quantum of encoding input is exactly 8 bits; here, the - // final unit of encoded output will be two characters followed by - // two "=" padding characters. - // - // (3) The final quantum of encoding input is exactly 16 bits; here, the - // final unit of encoded output will be three characters followed by - // one "=" padding character. - - if (encoded.length >= 4) { - if (encoded.charAt(encoded.length - 1) === '=') { - if (encoded.charAt(encoded.length - 2) === '=') { - // Case (2) - byteCount = quartetCount * 3 - 2; - } else { - // Case (3) - byteCount = quartetCount * 3 - 1; - } - } else { - // Case (1) - byteCount = quartetCount * 3; - } - } else { - // Case (1) - byteCount = quartetCount * 3; - } - - const bytes = new Uint8Array(byteCount); - let offset = 0; - - for (let i = 0; i < quartetCount; i++) { - const enc1 = encoded.charAt(i * 4 + 0); - const enc2 = encoded.charAt(i * 4 + 1); - const enc3 = encoded.charAt(i * 4 + 2); - const enc4 = encoded.charAt(i * 4 + 3); - const sextet1 = lookupTable.get(enc1); - const sextet2 = lookupTable.get(enc2); - const sextet3 = lookupTable.get(enc3); - const sextet4 = lookupTable.get(enc4); - - if (sextet1 == null || sextet2 == null || sextet3 == null || sextet4 == null) { - throw new Error(`Invalid quartet at indices ${i * 4} .. ${i * 4 + 3}: ${encoded.substring(i * 4, i * 4 + 3)}`); - } - - bytes[offset++] = sextet1 << 2 | sextet2 >> 4; - - if (enc3 !== '=') { - bytes[offset++] = (sextet2 & 15) << 4 | sextet3 >> 2; - } - - if (enc4 !== '=') { - bytes[offset++] = (sextet3 & 7) << 6 | sextet4; - } - } - - if (offset !== byteCount) { - throw new Error(`Expected to decode ${byteCount} bytes, but only decoded ${offset})`); - } - - return bytes; -} - -exports.decodeBase64 = decodeBase64; - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { - enumerable: true, - get: function () { - return m[k]; - } - }); -} : function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}); - -var __exportStar = this && this.__exportStar || function (m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -}; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -__exportStar(__webpack_require__(6), exports); - -__exportStar(__webpack_require__(10), exports); - -/***/ }), -/* 2 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.ByteFormatter = exports.TimeFormatter = exports.RawValueFormatter = void 0; - -const utils_1 = __webpack_require__(0); - -class RawValueFormatter { - constructor() { - this.unit = 'none'; - } - - format(v) { - return v.toLocaleString(); - } - -} - -exports.RawValueFormatter = RawValueFormatter; - -class TimeFormatter { - constructor(unit) { - this.unit = unit; - if (unit === 'nanoseconds') this.multiplier = 1e-9;else if (unit === 'microseconds') this.multiplier = 1e-6;else if (unit === 'milliseconds') this.multiplier = 1e-3;else this.multiplier = 1; - } - - formatUnsigned(v) { - const s = v * this.multiplier; - - if (s / 60 >= 1) { - const minutes = Math.floor(s / 60); - const seconds = Math.floor(s - minutes * 60).toString(); - return `${minutes}:${utils_1.zeroPad(seconds, 2)}`; - } - - if (s / 1 >= 1) return `${s.toFixed(2)}s`; - if (s / 1e-3 >= 1) return `${(s / 1e-3).toFixed(2)}ms`; - if (s / 1e-6 >= 1) return `${(s / 1e-6).toFixed(2)}µs`;else return `${(s / 1e-9).toFixed(2)}ns`; - } - - format(v) { - return `${v < 0 ? '-' : ''}${this.formatUnsigned(Math.abs(v))}`; - } - -} - -exports.TimeFormatter = TimeFormatter; - -class ByteFormatter { - constructor() { - this.unit = 'bytes'; - } - - format(v) { - if (v < 1024) return `${v.toFixed(0)} B`; - v /= 1024; - if (v < 1024) return `${v.toFixed(2)} KB`; - v /= 1024; - if (v < 1024) return `${v.toFixed(2)} MB`; - v /= 1024; - return `${v.toFixed(2)} GB`; - } - -} - -exports.ByteFormatter = ByteFormatter; - -/***/ }), -/* 3 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (root, factory) { - 'use strict'; // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers. - - /* istanbul ignore next */ - - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(12)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else {} -})(this, function ErrorStackParser(StackFrame) { - 'use strict'; - - var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\S+:\d+/; - var CHROME_IE_STACK_REGEXP = /^\s*at .*(\S+:\d+|\(native\))/m; - var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\[native code])?$/; - return { - /** - * Given an Error object, extract the most information from it. - * - * @param {Error} error object - * @return {Array} of StackFrames - */ - parse: function ErrorStackParser$$parse(error) { - if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') { - return this.parseOpera(error); - } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) { - return this.parseV8OrIE(error); - } else if (error.stack) { - return this.parseFFOrSafari(error); - } else { - throw new Error('Cannot parse given Error object'); - } - }, - // Separate line and column numbers from a string of the form: (URI:Line:Column) - extractLocation: function ErrorStackParser$$extractLocation(urlLike) { - // Fail-fast but return locations like "(native)" - if (urlLike.indexOf(':') === -1) { - return [urlLike]; - } - - var regExp = /(.+?)(?::(\d+))?(?::(\d+))?$/; - var parts = regExp.exec(urlLike.replace(/[()]/g, '')); - return [parts[1], parts[2] || undefined, parts[3] || undefined]; - }, - parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) { - var filtered = error.stack.split('\n').filter(function (line) { - return !!line.match(CHROME_IE_STACK_REGEXP); - }, this); - return filtered.map(function (line) { - if (line.indexOf('(eval ') > -1) { - // Throw away eval information until we implement stacktrace.js/stackframe#8 - line = line.replace(/eval code/g, 'eval').replace(/(\(eval at [^()]*)|(\),.*$)/g, ''); - } - - var sanitizedLine = line.replace(/^\s+/, '').replace(/\(eval code/g, '('); // capture and preseve the parenthesized location "(/foo/my bar.js:12:87)" in - // case it has spaces in it, as the string is split on \s+ later on - - var location = sanitizedLine.match(/ (\((.+):(\d+):(\d+)\)$)/); // remove the parenthesized location from the line, if it was matched - - sanitizedLine = location ? sanitizedLine.replace(location[0], '') : sanitizedLine; - var tokens = sanitizedLine.split(/\s+/).slice(1); // if a location was matched, pass it to extractLocation() otherwise pop the last token - - var locationParts = this.extractLocation(location ? location[1] : tokens.pop()); - var functionName = tokens.join(' ') || undefined; - var fileName = ['eval', ''].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0]; - return new StackFrame({ - functionName: functionName, - fileName: fileName, - lineNumber: locationParts[1], - columnNumber: locationParts[2], - source: line - }); - }, this); - }, - parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) { - var filtered = error.stack.split('\n').filter(function (line) { - return !line.match(SAFARI_NATIVE_CODE_REGEXP); - }, this); - return filtered.map(function (line) { - // Throw away eval information until we implement stacktrace.js/stackframe#8 - if (line.indexOf(' > eval') > -1) { - line = line.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ':$1'); - } - - if (line.indexOf('@') === -1 && line.indexOf(':') === -1) { - // Safari eval frames only have function names and nothing else - return new StackFrame({ - functionName: line - }); - } else { - var functionNameRegex = /((.*".+"[^@]*)?[^@]*)(?:@)/; - var matches = line.match(functionNameRegex); - var functionName = matches && matches[1] ? matches[1] : undefined; - var locationParts = this.extractLocation(line.replace(functionNameRegex, '')); - return new StackFrame({ - functionName: functionName, - fileName: locationParts[0], - lineNumber: locationParts[1], - columnNumber: locationParts[2], - source: line - }); - } - }, this); - }, - parseOpera: function ErrorStackParser$$parseOpera(e) { - if (!e.stacktrace || e.message.indexOf('\n') > -1 && e.message.split('\n').length > e.stacktrace.split('\n').length) { - return this.parseOpera9(e); - } else if (!e.stack) { - return this.parseOpera10(e); - } else { - return this.parseOpera11(e); - } - }, - parseOpera9: function ErrorStackParser$$parseOpera9(e) { - var lineRE = /Line (\d+).*script (?:in )?(\S+)/i; - var lines = e.message.split('\n'); - var result = []; - - for (var i = 2, len = lines.length; i < len; i += 2) { - var match = lineRE.exec(lines[i]); - - if (match) { - result.push(new StackFrame({ - fileName: match[2], - lineNumber: match[1], - source: lines[i] - })); - } - } - - return result; - }, - parseOpera10: function ErrorStackParser$$parseOpera10(e) { - var lineRE = /Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i; - var lines = e.stacktrace.split('\n'); - var result = []; - - for (var i = 0, len = lines.length; i < len; i += 2) { - var match = lineRE.exec(lines[i]); - - if (match) { - result.push(new StackFrame({ - functionName: match[3] || undefined, - fileName: match[2], - lineNumber: match[1], - source: lines[i] - })); - } - } - - return result; - }, - // Opera 10.65+ Error.stack very similar to FF/Safari - parseOpera11: function ErrorStackParser$$parseOpera11(error) { - var filtered = error.stack.split('\n').filter(function (line) { - return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && !line.match(/^Error created at/); - }, this); - return filtered.map(function (line) { - var tokens = line.split('@'); - var locationParts = this.extractLocation(tokens.pop()); - var functionCall = tokens.shift() || ''; - var functionName = functionCall.replace(//, '$2').replace(/\([^)]*\)/g, '') || undefined; - var argsRaw; - - if (functionCall.match(/\(([^)]*)\)/)) { - argsRaw = functionCall.replace(/^[^(]+\(([^)]*)\)$/, '$1'); - } - - var args = argsRaw === undefined || argsRaw === '[arguments not available]' ? undefined : argsRaw.split(','); - return new StackFrame({ - functionName: functionName, - args: args, - fileName: locationParts[0], - lineNumber: locationParts[1], - columnNumber: locationParts[2], - source: line - }); - }, this); - } - }; -}); - -/***/ }), -/* 4 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -function nullthrows(x, message) { - if (x != null) { - return x; - } - - var error = new Error(message !== undefined ? message : 'Got unexpected ' + x); - error.framesToPop = 1; // Skip nullthrows's own stack frame. - - throw error; -} - -module.exports = nullthrows; -module.exports.default = nullthrows; -Object.defineProperty(module.exports, '__esModule', { - value: true -}); - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * Copyright (c) 2014-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -var runtime = function (exports) { - "use strict"; - - var Op = Object.prototype; - var hasOwn = Op.hasOwnProperty; - var undefined; // More compressible than void 0. - - var $Symbol = typeof Symbol === "function" ? Symbol : {}; - var iteratorSymbol = $Symbol.iterator || "@@iterator"; - var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; - var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; - - function define(obj, key, value) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - return obj[key]; - } - - try { - // IE 8 has a broken Object.defineProperty that only works on DOM objects. - define({}, ""); - } catch (err) { - define = function (obj, key, value) { - return obj[key] = value; - }; - } - - function wrap(innerFn, outerFn, self, tryLocsList) { - // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. - var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; - var generator = Object.create(protoGenerator.prototype); - var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next, - // .throw, and .return methods. - - generator._invoke = makeInvokeMethod(innerFn, self, context); - return generator; - } - - exports.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion - // record like context.tryEntries[i].completion. This interface could - // have been (and was previously) designed to take a closure to be - // invoked without arguments, but in all the cases we care about we - // already have an existing method we want to call, so there's no need - // to create a new function object. We can even get away with assuming - // the method takes exactly one argument, since that happens to be true - // in every case, so we don't have to touch the arguments object. The - // only additional allocation required is the completion record, which - // has a stable shape and so hopefully should be cheap to allocate. - - function tryCatch(fn, obj, arg) { - try { - return { - type: "normal", - arg: fn.call(obj, arg) - }; - } catch (err) { - return { - type: "throw", - arg: err - }; - } - } - - var GenStateSuspendedStart = "suspendedStart"; - var GenStateSuspendedYield = "suspendedYield"; - var GenStateExecuting = "executing"; - var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as - // breaking out of the dispatch switch statement. - - var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and - // .constructor.prototype properties for functions that return Generator - // objects. For full spec compliance, you may wish to configure your - // minifier not to mangle the names of these two functions. - - function Generator() {} - - function GeneratorFunction() {} - - function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that - // don't natively support it. - - - var IteratorPrototype = {}; - - IteratorPrototype[iteratorSymbol] = function () { - return this; - }; - - var getProto = Object.getPrototypeOf; - var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); - - if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { - // This environment has a native %IteratorPrototype%; use it instead - // of the polyfill. - IteratorPrototype = NativeIteratorPrototype; - } - - var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); - GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; - GeneratorFunctionPrototype.constructor = GeneratorFunction; - GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"); // Helper for defining the .next, .throw, and .return methods of the - // Iterator interface in terms of a single ._invoke method. - - function defineIteratorMethods(prototype) { - ["next", "throw", "return"].forEach(function (method) { - define(prototype, method, function (arg) { - return this._invoke(method, arg); - }); - }); - } - - exports.isGeneratorFunction = function (genFun) { - var ctor = typeof genFun === "function" && genFun.constructor; - return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can - // do is to check its .name property. - (ctor.displayName || ctor.name) === "GeneratorFunction" : false; - }; - - exports.mark = function (genFun) { - if (Object.setPrototypeOf) { - Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); - } else { - genFun.__proto__ = GeneratorFunctionPrototype; - define(genFun, toStringTagSymbol, "GeneratorFunction"); - } - - genFun.prototype = Object.create(Gp); - return genFun; - }; // Within the body of any async function, `await x` is transformed to - // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test - // `hasOwn.call(value, "__await")` to determine if the yielded value is - // meant to be awaited. - - - exports.awrap = function (arg) { - return { - __await: arg - }; - }; - - function AsyncIterator(generator, PromiseImpl) { - function invoke(method, arg, resolve, reject) { - var record = tryCatch(generator[method], generator, arg); - - if (record.type === "throw") { - reject(record.arg); - } else { - var result = record.arg; - var value = result.value; - - if (value && typeof value === "object" && hasOwn.call(value, "__await")) { - return PromiseImpl.resolve(value.__await).then(function (value) { - invoke("next", value, resolve, reject); - }, function (err) { - invoke("throw", err, resolve, reject); - }); - } - - return PromiseImpl.resolve(value).then(function (unwrapped) { - // When a yielded Promise is resolved, its final value becomes - // the .value of the Promise<{value,done}> result for the - // current iteration. - result.value = unwrapped; - resolve(result); - }, function (error) { - // If a rejected Promise was yielded, throw the rejection back - // into the async generator function so it can be handled there. - return invoke("throw", error, resolve, reject); - }); - } - } - - var previousPromise; - - function enqueue(method, arg) { - function callInvokeWithMethodAndArg() { - return new PromiseImpl(function (resolve, reject) { - invoke(method, arg, resolve, reject); - }); - } - - return previousPromise = // If enqueue has been called before, then we want to wait until - // all previous Promises have been resolved before calling invoke, - // so that results are always delivered in the correct order. If - // enqueue has not been called before, then it is important to - // call invoke immediately, without waiting on a callback to fire, - // so that the async generator function has the opportunity to do - // any necessary setup in a predictable way. This predictability - // is why the Promise constructor synchronously invokes its - // executor callback, and why async functions synchronously - // execute code before the first await. Since we implement simple - // async functions in terms of async generators, it is especially - // important to get this right, even though it requires care. - previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later - // invocations of the iterator. - callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); - } // Define the unified helper method that is used to implement .next, - // .throw, and .return (see defineIteratorMethods). - - - this._invoke = enqueue; - } - - defineIteratorMethods(AsyncIterator.prototype); - - AsyncIterator.prototype[asyncIteratorSymbol] = function () { - return this; - }; - - exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of - // AsyncIterator objects; they just return a Promise for the value of - // the final result produced by the iterator. - - exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { - if (PromiseImpl === void 0) PromiseImpl = Promise; - var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); - return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator. - : iter.next().then(function (result) { - return result.done ? result.value : iter.next(); - }); - }; - - function makeInvokeMethod(innerFn, self, context) { - var state = GenStateSuspendedStart; - return function invoke(method, arg) { - if (state === GenStateExecuting) { - throw new Error("Generator is already running"); - } - - if (state === GenStateCompleted) { - if (method === "throw") { - throw arg; - } // Be forgiving, per 25.3.3.3.3 of the spec: - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume - - - return doneResult(); - } - - context.method = method; - context.arg = arg; - - while (true) { - var delegate = context.delegate; - - if (delegate) { - var delegateResult = maybeInvokeDelegate(delegate, context); - - if (delegateResult) { - if (delegateResult === ContinueSentinel) continue; - return delegateResult; - } - } - - if (context.method === "next") { - // Setting context._sent for legacy support of Babel's - // function.sent implementation. - context.sent = context._sent = context.arg; - } else if (context.method === "throw") { - if (state === GenStateSuspendedStart) { - state = GenStateCompleted; - throw context.arg; - } - - context.dispatchException(context.arg); - } else if (context.method === "return") { - context.abrupt("return", context.arg); - } - - state = GenStateExecuting; - var record = tryCatch(innerFn, self, context); - - if (record.type === "normal") { - // If an exception is thrown from innerFn, we leave state === - // GenStateExecuting and loop back for another invocation. - state = context.done ? GenStateCompleted : GenStateSuspendedYield; - - if (record.arg === ContinueSentinel) { - continue; - } - - return { - value: record.arg, - done: context.done - }; - } else if (record.type === "throw") { - state = GenStateCompleted; // Dispatch the exception by looping back around to the - // context.dispatchException(context.arg) call above. - - context.method = "throw"; - context.arg = record.arg; - } - } - }; - } // Call delegate.iterator[context.method](context.arg) and handle the - // result, either by returning a { value, done } result from the - // delegate iterator, or by modifying context.method and context.arg, - // setting context.delegate to null, and returning the ContinueSentinel. - - - function maybeInvokeDelegate(delegate, context) { - var method = delegate.iterator[context.method]; - - if (method === undefined) { - // A .throw or .return when the delegate iterator has no .throw - // method always terminates the yield* loop. - context.delegate = null; - - if (context.method === "throw") { - // Note: ["return"] must be used for ES3 parsing compatibility. - if (delegate.iterator["return"]) { - // If the delegate iterator has a return method, give it a - // chance to clean up. - context.method = "return"; - context.arg = undefined; - maybeInvokeDelegate(delegate, context); - - if (context.method === "throw") { - // If maybeInvokeDelegate(context) changed context.method from - // "return" to "throw", let that override the TypeError below. - return ContinueSentinel; - } - } - - context.method = "throw"; - context.arg = new TypeError("The iterator does not provide a 'throw' method"); - } - - return ContinueSentinel; - } - - var record = tryCatch(method, delegate.iterator, context.arg); - - if (record.type === "throw") { - context.method = "throw"; - context.arg = record.arg; - context.delegate = null; - return ContinueSentinel; - } - - var info = record.arg; - - if (!info) { - context.method = "throw"; - context.arg = new TypeError("iterator result is not an object"); - context.delegate = null; - return ContinueSentinel; - } - - if (info.done) { - // Assign the result of the finished delegate to the temporary - // variable specified by delegate.resultName (see delegateYield). - context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield). - - context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the - // exception, let the outer generator proceed normally. If - // context.method was "next", forget context.arg since it has been - // "consumed" by the delegate iterator. If context.method was - // "return", allow the original .return call to continue in the - // outer generator. - - if (context.method !== "return") { - context.method = "next"; - context.arg = undefined; - } - } else { - // Re-yield the result returned by the delegate method. - return info; - } // The delegate iterator is finished, so forget it and continue with - // the outer generator. - - - context.delegate = null; - return ContinueSentinel; - } // Define Generator.prototype.{next,throw,return} in terms of the - // unified ._invoke helper method. - - - defineIteratorMethods(Gp); - define(Gp, toStringTagSymbol, "Generator"); // A Generator should always return itself as the iterator object when the - // @@iterator function is called on it. Some browsers' implementations of the - // iterator prototype chain incorrectly implement this, causing the Generator - // object to not be returned from this call. This ensures that doesn't happen. - // See https://github.com/facebook/regenerator/issues/274 for more details. - - Gp[iteratorSymbol] = function () { - return this; - }; - - Gp.toString = function () { - return "[object Generator]"; - }; - - function pushTryEntry(locs) { - var entry = { - tryLoc: locs[0] - }; - - if (1 in locs) { - entry.catchLoc = locs[1]; - } - - if (2 in locs) { - entry.finallyLoc = locs[2]; - entry.afterLoc = locs[3]; - } - - this.tryEntries.push(entry); - } - - function resetTryEntry(entry) { - var record = entry.completion || {}; - record.type = "normal"; - delete record.arg; - entry.completion = record; - } - - function Context(tryLocsList) { - // The root entry object (effectively a try statement without a catch - // or a finally block) gives us a place to store values thrown from - // locations where there is no enclosing try statement. - this.tryEntries = [{ - tryLoc: "root" - }]; - tryLocsList.forEach(pushTryEntry, this); - this.reset(true); - } - - exports.keys = function (object) { - var keys = []; - - for (var key in object) { - keys.push(key); - } - - keys.reverse(); // Rather than returning an object with a next method, we keep - // things simple and return the next function itself. - - return function next() { - while (keys.length) { - var key = keys.pop(); - - if (key in object) { - next.value = key; - next.done = false; - return next; - } - } // To avoid creating an additional object, we just hang the .value - // and .done properties off the next function object itself. This - // also ensures that the minifier will not anonymize the function. - - - next.done = true; - return next; - }; - }; - - function values(iterable) { - if (iterable) { - var iteratorMethod = iterable[iteratorSymbol]; - - if (iteratorMethod) { - return iteratorMethod.call(iterable); - } - - if (typeof iterable.next === "function") { - return iterable; - } - - if (!isNaN(iterable.length)) { - var i = -1, - next = function next() { - while (++i < iterable.length) { - if (hasOwn.call(iterable, i)) { - next.value = iterable[i]; - next.done = false; - return next; - } - } - - next.value = undefined; - next.done = true; - return next; - }; - - return next.next = next; - } - } // Return an iterator with no values. - - - return { - next: doneResult - }; - } - - exports.values = values; - - function doneResult() { - return { - value: undefined, - done: true - }; - } - - Context.prototype = { - constructor: Context, - reset: function (skipTempReset) { - this.prev = 0; - this.next = 0; // Resetting context._sent for legacy support of Babel's - // function.sent implementation. - - this.sent = this._sent = undefined; - this.done = false; - this.delegate = null; - this.method = "next"; - this.arg = undefined; - this.tryEntries.forEach(resetTryEntry); - - if (!skipTempReset) { - for (var name in this) { - // Not sure about the optimal order of these conditions: - if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) { - this[name] = undefined; - } - } - } - }, - stop: function () { - this.done = true; - var rootEntry = this.tryEntries[0]; - var rootRecord = rootEntry.completion; - - if (rootRecord.type === "throw") { - throw rootRecord.arg; - } - - return this.rval; - }, - dispatchException: function (exception) { - if (this.done) { - throw exception; - } - - var context = this; - - function handle(loc, caught) { - record.type = "throw"; - record.arg = exception; - context.next = loc; - - if (caught) { - // If the dispatched exception was caught by a catch block, - // then let that catch block handle the exception normally. - context.method = "next"; - context.arg = undefined; - } - - return !!caught; - } - - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - var record = entry.completion; - - if (entry.tryLoc === "root") { - // Exception thrown outside of any try block that could handle - // it, so set the completion value of the entire function to - // throw the exception. - return handle("end"); - } - - if (entry.tryLoc <= this.prev) { - var hasCatch = hasOwn.call(entry, "catchLoc"); - var hasFinally = hasOwn.call(entry, "finallyLoc"); - - if (hasCatch && hasFinally) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } else if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } - } else if (hasCatch) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } - } else if (hasFinally) { - if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } - } else { - throw new Error("try statement without catch or finally"); - } - } - } - }, - abrupt: function (type, arg) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - - if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { - var finallyEntry = entry; - break; - } - } - - if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) { - // Ignore the finally entry if control is not jumping to a - // location outside the try/catch block. - finallyEntry = null; - } - - var record = finallyEntry ? finallyEntry.completion : {}; - record.type = type; - record.arg = arg; - - if (finallyEntry) { - this.method = "next"; - this.next = finallyEntry.finallyLoc; - return ContinueSentinel; - } - - return this.complete(record); - }, - complete: function (record, afterLoc) { - if (record.type === "throw") { - throw record.arg; - } - - if (record.type === "break" || record.type === "continue") { - this.next = record.arg; - } else if (record.type === "return") { - this.rval = this.arg = record.arg; - this.method = "return"; - this.next = "end"; - } else if (record.type === "normal" && afterLoc) { - this.next = afterLoc; - } - - return ContinueSentinel; - }, - finish: function (finallyLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - - if (entry.finallyLoc === finallyLoc) { - this.complete(entry.completion, entry.afterLoc); - resetTryEntry(entry); - return ContinueSentinel; - } - } - }, - "catch": function (tryLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - - if (entry.tryLoc === tryLoc) { - var record = entry.completion; - - if (record.type === "throw") { - var thrown = record.arg; - resetTryEntry(entry); - } - - return thrown; - } - } // The context.catch method must only be called with a location - // argument that corresponds to a known catch block. - - - throw new Error("illegal catch attempt"); - }, - delegateYield: function (iterable, resultName, nextLoc) { - this.delegate = { - iterator: values(iterable), - resultName: resultName, - nextLoc: nextLoc - }; - - if (this.method === "next") { - // Deliberately forget the last sent value so that we don't - // accidentally pass it on to the delegate. - this.arg = undefined; - } - - return ContinueSentinel; - } - }; // Regardless of whether this script is executing as a CommonJS module - // or not, return the runtime object so that we can declare the variable - // regeneratorRuntime in the outer scope, which allows this module to be - // injected easily by `bin/regenerator --include-runtime script.js`. - - return exports; -}( // If this script is executing as a CommonJS module, use module.exports -// as the regeneratorRuntime namespace. Otherwise create a new empty -// object. Either way, the resulting object will be used to initialize -// the regeneratorRuntime variable at the top of this file. - true ? module.exports : undefined); - -try { - regeneratorRuntime = runtime; -} catch (accidentalStrictMode) { - // This module should not be running in strict mode, so the above - // assignment should always work unless something is misconfigured. Just - // in case runtime.js accidentally runs in strict mode, we can escape - // strict mode using a global Function call. This could conceivably fail - // if a Content Security Policy forbids using Function, but in that case - // the proper solution is to fix the accidental strict mode problem. If - // you've misconfigured your bundler to force strict mode and applied a - // CSP to forbid Function, and you're not willing to fix either of those - // problems, please detail your unique predicament in a GitHub issue. - Function("r", "regeneratorRuntime = r")(runtime); -} - -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.importFromOldV8CPUProfile = exports.importFromChromeCPUProfile = exports.importFromChromeTimeline = exports.isChromeTimeline = void 0; - -const profile_1 = __webpack_require__(7); - -const utils_1 = __webpack_require__(0); - -const value_formatters_1 = __webpack_require__(2); - -const v8cpuFormatter_1 = __webpack_require__(9); - -function isChromeTimeline(rawProfile) { - if (!Array.isArray(rawProfile)) return false; - if (rawProfile.length < 1) return false; - const first = rawProfile[0]; - if (!('pid' in first && 'tid' in first && 'ph' in first && 'cat' in first)) return false; - if (!rawProfile.find(e => e.name === 'CpuProfile' || e.name === 'Profile' || e.name === 'ProfileChunk')) return false; - return true; -} - -exports.isChromeTimeline = isChromeTimeline; - -function importFromChromeTimeline(events, fileName) { - // It seems like sometimes Chrome timeline files contain multiple CpuProfiles? - // For now, choose the first one in the list. - const cpuProfileByID = new Map(); // Maps profile IDs (like "0x3") to pid/tid pairs formatted as `${pid}:${tid}` - - const pidTidById = new Map(); // Maps pid/tid pairs to thread names - - const threadNameByPidTid = new Map(); // The events aren't necessarily recorded in chronological order. Sort them so - // that they are. - - utils_1.sortBy(events, e => e.ts); - - for (let event of events) { - if (event.name === 'CpuProfile') { - const pidTid = `${event.pid}:${event.tid}`; - const id = event.id || pidTid; - cpuProfileByID.set(id, event.args.data.cpuProfile); - pidTidById.set(id, pidTid); - } - - if (event.name === 'Profile') { - const pidTid = `${event.pid}:${event.tid}`; - cpuProfileByID.set(event.id || pidTid, Object.assign({ - startTime: 0, - endTime: 0, - nodes: [], - samples: [], - timeDeltas: [] - }, event.args.data)); - - if (event.id) { - pidTidById.set(event.id, `${event.pid}:${event.tid}`); - } - } - - if (event.name === 'thread_name') { - threadNameByPidTid.set(`${event.pid}:${event.tid}`, event.args.name); - } - - if (event.name === 'ProfileChunk') { - const pidTid = `${event.pid}:${event.tid}`; - const cpuProfile = cpuProfileByID.get(event.id || pidTid); - - if (cpuProfile) { - const chunk = event.args.data; - - if (chunk.cpuProfile) { - if (chunk.cpuProfile.nodes) { - cpuProfile.nodes = cpuProfile.nodes.concat(chunk.cpuProfile.nodes); - } - - if (chunk.cpuProfile.samples) { - cpuProfile.samples = cpuProfile.samples.concat(chunk.cpuProfile.samples); - } - } - - if (chunk.timeDeltas) { - cpuProfile.timeDeltas = cpuProfile.timeDeltas.concat(chunk.timeDeltas); - } - - if (chunk.startTime != null) { - cpuProfile.startTime = chunk.startTime; - } - - if (chunk.endTime != null) { - cpuProfile.endTime = chunk.endTime; - } - } else { - console.warn(`Ignoring ProfileChunk for undeclared Profile with id ${event.id || pidTid}`); - } - } - } - - if (cpuProfileByID.size > 0) { - const profiles = []; - let indexToView = 0; - utils_1.itForEach(cpuProfileByID.keys(), profileId => { - let threadName = null; - let pidTid = pidTidById.get(profileId); - - if (pidTid) { - threadName = threadNameByPidTid.get(pidTid) || null; - - if (threadName) {} - } - - const profile = importFromChromeCPUProfile(cpuProfileByID.get(profileId)); - - if (threadName && cpuProfileByID.size > 1) { - profile.setName(`${fileName} - ${threadName}`); - - if (threadName === 'CrRendererMain') { - indexToView = profiles.length; - } - } else { - profile.setName(`${fileName}`); - } - - profiles.push(profile); - }); - return { - name: fileName, - indexToView, - profiles - }; - } else { - throw new Error('Could not find CPU profile in Timeline'); - } -} - -exports.importFromChromeTimeline = importFromChromeTimeline; -const callFrameToFrameInfo = new Map(); - -function frameInfoForCallFrame(callFrame) { - return utils_1.getOrInsert(callFrameToFrameInfo, callFrame, callFrame => { - const name = callFrame.functionName || '(anonymous)'; - const file = callFrame.url; - const line = callFrame.lineNumber; - const col = callFrame.columnNumber; - return { - key: `${name}:${file}:${line}:${col}`, - name, - file, - line, - col - }; - }); -} - -function shouldIgnoreFunction(callFrame) { - const { - functionName, - url - } = callFrame; - - if (url === 'native dummy.js') { - // I'm not really sure what this is about, but this seems to be used - // as a way of avoiding edge cases in V8's implementation. - // See: https://github.com/v8/v8/blob/b8626ca4/tools/js2c.py#L419-L424 - return true; - } - - return functionName === '(root)' || functionName === '(idle)'; -} - -function shouldPlaceOnTopOfPreviousStack(functionName) { - return functionName === '(garbage collector)' || functionName === '(program)'; -} - -function importFromChromeCPUProfile(chromeProfile) { - const profile = new profile_1.CallTreeProfileBuilder(chromeProfile.endTime - chromeProfile.startTime); - const nodeById = new Map(); - - for (let node of chromeProfile.nodes) { - nodeById.set(node.id, node); - } - - for (let node of chromeProfile.nodes) { - if (typeof node.parent === 'number') { - node.parent = nodeById.get(node.parent); - } - - if (!node.children) continue; - - for (let childId of node.children) { - const child = nodeById.get(childId); - if (!child) continue; - child.parent = node; - } - } - - const samples = []; - const sampleTimes = []; // The first delta is relative to the profile startTime. - // Ref: https://github.com/v8/v8/blob/44bd8fd7/src/inspector/js_protocol.json#L1485 - - let elapsed = chromeProfile.timeDeltas[0]; // Prevents negative time deltas from causing bad data. See - // https://github.com/jlfwong/speedscope/pull/305 for details. - - let lastValidElapsed = elapsed; - let lastNodeId = NaN; // The chrome CPU profile format doesn't collapse identical samples. We'll do that - // here to save a ton of work later doing mergers. - - for (let i = 0; i < chromeProfile.samples.length; i++) { - const nodeId = chromeProfile.samples[i]; - - if (nodeId != lastNodeId) { - samples.push(nodeId); - - if (elapsed < lastValidElapsed) { - sampleTimes.push(lastValidElapsed); - } else { - sampleTimes.push(elapsed); - lastValidElapsed = elapsed; - } - } - - if (i === chromeProfile.samples.length - 1) { - if (!isNaN(lastNodeId)) { - samples.push(lastNodeId); - - if (elapsed < lastValidElapsed) { - sampleTimes.push(lastValidElapsed); - } else { - sampleTimes.push(elapsed); - lastValidElapsed = elapsed; - } - } - } else { - const timeDelta = chromeProfile.timeDeltas[i + 1]; - elapsed += timeDelta; - lastNodeId = nodeId; - } - } - - let prevStack = []; - - for (let i = 0; i < samples.length; i++) { - const value = sampleTimes[i]; - const nodeId = samples[i]; - let stackTop = nodeById.get(nodeId); - if (!stackTop) continue; // Find lowest common ancestor of the current stack and the previous one - - let lca = null; // This is O(n^2), but n should be relatively small here (stack height), - // so hopefully this isn't much of a problem - - for (lca = stackTop; lca && prevStack.indexOf(lca) === -1; lca = shouldPlaceOnTopOfPreviousStack(lca.callFrame.functionName) ? utils_1.lastOf(prevStack) : lca.parent || null) {} // Close frames that are no longer open - - - while (prevStack.length > 0 && utils_1.lastOf(prevStack) != lca) { - const closingNode = prevStack.pop(); - const frame = frameInfoForCallFrame(closingNode.callFrame); - profile.leaveFrame(frame, value); - } // Open frames that are now becoming open - - - const toOpen = []; - - for (let node = stackTop; node && node != lca && !shouldIgnoreFunction(node.callFrame); // Place Chrome internal functions on top of the previous call stack - node = shouldPlaceOnTopOfPreviousStack(node.callFrame.functionName) ? utils_1.lastOf(prevStack) : node.parent || null) { - toOpen.push(node); - } - - toOpen.reverse(); - - for (let node of toOpen) { - profile.enterFrame(frameInfoForCallFrame(node.callFrame), value); - } - - prevStack = prevStack.concat(toOpen); - } // Close frames that are open at the end of the trace - - - for (let i = prevStack.length - 1; i >= 0; i--) { - profile.leaveFrame(frameInfoForCallFrame(prevStack[i].callFrame), utils_1.lastOf(sampleTimes)); - } - - profile.setValueFormatter(new value_formatters_1.TimeFormatter('microseconds')); - return profile.build(); -} - -exports.importFromChromeCPUProfile = importFromChromeCPUProfile; - -function importFromOldV8CPUProfile(content) { - return importFromChromeCPUProfile(v8cpuFormatter_1.chromeTreeToNodes(content)); -} - -exports.importFromOldV8CPUProfile = importFromOldV8CPUProfile; - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { - enumerable: true, - get: function () { - return m[k]; - } - }); -} : function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}); - -var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) { - Object.defineProperty(o, "default", { - enumerable: true, - value: v - }); -} : function (o, v) { - o["default"] = v; -}); - -var __importStar = this && this.__importStar || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - - __setModuleDefault(result, mod); - - return result; -}; - -var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function (resolve) { - resolve(value); - }); - } - - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); - } - - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.CallTreeProfileBuilder = exports.StackListProfileBuilder = exports.Profile = exports.CallTreeNode = exports.Frame = exports.HasWeights = void 0; - -const utils_1 = __webpack_require__(0); - -const value_formatters_1 = __webpack_require__(2); - -const demangleCppModule = Promise.resolve().then(() => __importStar(__webpack_require__(8))); // Force eager loading of the module - -demangleCppModule.then(() => {}); - -class HasWeights { - constructor() { - this.selfWeight = 0; - this.totalWeight = 0; - } - - getSelfWeight() { - return this.selfWeight; - } - - getTotalWeight() { - return this.totalWeight; - } - - addToTotalWeight(delta) { - this.totalWeight += delta; - } - - addToSelfWeight(delta) { - this.selfWeight += delta; - } - - overwriteWeightWith(other) { - this.selfWeight = other.selfWeight; - this.totalWeight = other.totalWeight; - } - -} - -exports.HasWeights = HasWeights; - -let Frame = -/** @class */ -(() => { - class Frame extends HasWeights { - constructor(info) { - super(); - this.key = info.key; - this.name = info.name; - this.file = info.file; - this.line = info.line; - this.col = info.col; - } - - static getOrInsert(set, info) { - return set.getOrInsert(new Frame(info)); - } - - } - - Frame.root = new Frame({ - key: '(speedscope root)', - name: '(speedscope root)' - }); - return Frame; -})(); - -exports.Frame = Frame; - -class CallTreeNode extends HasWeights { - constructor(frame, parent) { - super(); - this.frame = frame; - this.parent = parent; - this.children = []; // If a node is "frozen", it means it should no longer be mutated. - - this.frozen = false; - } - - isRoot() { - return this.frame === Frame.root; - } - - isFrozen() { - return this.frozen; - } - - freeze() { - this.frozen = true; - } - -} - -exports.CallTreeNode = CallTreeNode; - -class Profile { - constructor(totalWeight = 0) { - this.name = ''; - this.frames = new utils_1.KeyedSet(); // Profiles store two call-trees. - // - // The "append order" call tree is the one in which nodes are ordered in - // whatever order they were appended to their parent. - // - // The "grouped" call tree is one in which each node has at most one child per - // frame. Nodes are ordered in decreasing order of weight - - this.appendOrderCalltreeRoot = new CallTreeNode(Frame.root, null); - this.groupedCalltreeRoot = new CallTreeNode(Frame.root, null); // List of references to CallTreeNodes at the top of the - // stack at the time of the sample. - - this.samples = []; - this.weights = []; - this.valueFormatter = new value_formatters_1.RawValueFormatter(); - this.totalNonIdleWeight = null; - this.totalWeight = totalWeight; - } - - getAppendOrderCalltreeRoot() { - return this.appendOrderCalltreeRoot; - } - - getGroupedCalltreeRoot() { - return this.groupedCalltreeRoot; - } - - formatValue(v) { - return this.valueFormatter.format(v); - } - - setValueFormatter(f) { - this.valueFormatter = f; - } - - getWeightUnit() { - return this.valueFormatter.unit; - } - - getName() { - return this.name; - } - - setName(name) { - this.name = name; - } - - getTotalWeight() { - return this.totalWeight; - } - - getTotalNonIdleWeight() { - if (this.totalNonIdleWeight === null) { - this.totalNonIdleWeight = this.groupedCalltreeRoot.children.reduce((n, c) => n + c.getTotalWeight(), 0); - } - - return this.totalNonIdleWeight; - } // This is private because it should only be called in the ProfileBuilder - // classes. Once a Profile instance has been constructed, it should be treated - // as immutable. - - - sortGroupedCallTree() { - function visit(node) { - node.children.sort((a, b) => -(a.getTotalWeight() - b.getTotalWeight())); - node.children.forEach(visit); - } - - visit(this.groupedCalltreeRoot); - } - - forEachCallGrouped(openFrame, closeFrame) { - function visit(node, start) { - if (node.frame !== Frame.root) { - openFrame(node, start); - } - - let childTime = 0; - node.children.forEach(function (child) { - visit(child, start + childTime); - childTime += child.getTotalWeight(); - }); - - if (node.frame !== Frame.root) { - closeFrame(node, start + node.getTotalWeight()); - } - } - - visit(this.groupedCalltreeRoot, 0); - } - - forEachCall(openFrame, closeFrame) { - let prevStack = []; - let value = 0; - let sampleIndex = 0; - - for (let stackTop of this.samples) { - // Find lowest common ancestor of the current stack and the previous one - let lca = null; // This is O(n^2), but n should be relatively small here (stack height), - // so hopefully this isn't much of a problem - - for (lca = stackTop; lca && lca.frame != Frame.root && prevStack.indexOf(lca) === -1; lca = lca.parent) {} // Close frames that are no longer open - - - while (prevStack.length > 0 && utils_1.lastOf(prevStack) != lca) { - const node = prevStack.pop(); - closeFrame(node, value); - } // Open frames that are now becoming open - - - const toOpen = []; - - for (let node = stackTop; node && node.frame != Frame.root && node != lca; node = node.parent) { - toOpen.push(node); - } - - toOpen.reverse(); - - for (let node of toOpen) { - openFrame(node, value); - } - - prevStack = prevStack.concat(toOpen); - value += this.weights[sampleIndex++]; - } // Close frames that are open at the end of the trace - - - for (let i = prevStack.length - 1; i >= 0; i--) { - closeFrame(prevStack[i], value); - } - } - - forEachFrame(fn) { - this.frames.forEach(fn); - } - - getProfileWithRecursionFlattened() { - const builder = new CallTreeProfileBuilder(); - const stack = []; - const framesInStack = new Set(); - - function openFrame(node, value) { - if (framesInStack.has(node.frame)) { - stack.push(null); - } else { - framesInStack.add(node.frame); - stack.push(node); - builder.enterFrame(node.frame, value); - } - } - - function closeFrame(node, value) { - const stackTop = stack.pop(); - - if (stackTop) { - framesInStack.delete(stackTop.frame); - builder.leaveFrame(stackTop.frame, value); - } - } - - this.forEachCall(openFrame, closeFrame); - const flattenedProfile = builder.build(); - flattenedProfile.name = this.name; - flattenedProfile.valueFormatter = this.valueFormatter; // When constructing a profile with recursion flattened, - // counter-intuitive things can happen to "self time" measurements - // for functions. - // For example, given the following list of stacks w/ weights: - // - // a 1 - // a;b;a 1 - // a;b;a;b;a 1 - // a;b;a 1 - // - // The resulting profile with recursion flattened out will look like this: - // - // a 1 - // a;b 3 - // - // Which is useful to view, but it's counter-intuitive to move self-time - // for frames around, since analyzing the self-time of functions is an important - // thing to be able to do accurately, and we don't want this to change when recursion - // is flattened. To work around that, we'll just copy the weights directly from the - // un-flattened profile. - - this.forEachFrame(f => { - flattenedProfile.frames.getOrInsert(f).overwriteWeightWith(f); - }); - return flattenedProfile; - } - - getInvertedProfileForCallersOf(focalFrameInfo) { - const focalFrame = Frame.getOrInsert(this.frames, focalFrameInfo); - const builder = new StackListProfileBuilder(); // TODO(jlfwong): Could construct this at profile - // construction time rather than on demand. - - const nodes = []; - - function visit(node) { - if (node.frame === focalFrame) { - nodes.push(node); - } else { - for (let child of node.children) { - visit(child); - } - } - } - - visit(this.appendOrderCalltreeRoot); - - for (let node of nodes) { - const stack = []; - - for (let n = node; n != null && n.frame !== Frame.root; n = n.parent) { - stack.push(n.frame); - } - - builder.appendSampleWithWeight(stack, node.getTotalWeight()); - } - - const ret = builder.build(); - ret.name = this.name; - ret.valueFormatter = this.valueFormatter; - return ret; - } - - getProfileForCalleesOf(focalFrameInfo) { - const focalFrame = Frame.getOrInsert(this.frames, focalFrameInfo); - const builder = new StackListProfileBuilder(); - - function recordSubtree(focalFrameNode) { - const stack = []; - - function visit(node) { - stack.push(node.frame); - builder.appendSampleWithWeight(stack, node.getSelfWeight()); - - for (let child of node.children) { - visit(child); - } - - stack.pop(); - } - - visit(focalFrameNode); - } - - function findCalls(node) { - if (node.frame === focalFrame) { - recordSubtree(node); - } else { - for (let child of node.children) { - findCalls(child); - } - } - } - - findCalls(this.appendOrderCalltreeRoot); - const ret = builder.build(); - ret.name = this.name; - ret.valueFormatter = this.valueFormatter; - return ret; - } // Demangle symbols for readability - - - demangle() { - return __awaiter(this, void 0, void 0, function* () { - let demangleCpp = null; - - for (let frame of this.frames) { - // This function converts a mangled C++ name such as "__ZNK7Support6ColorFeqERKS0_" - // into a human-readable symbol (in this case "Support::ColorF::==(Support::ColorF&)") - if (frame.name.startsWith('__Z')) { - if (!demangleCpp) { - demangleCpp = (yield demangleCppModule).demangleCpp; - } - - frame.name = demangleCpp(frame.name); - } - } - }); - } - - remapNames(callback) { - for (let frame of this.frames) { - frame.name = callback(frame.name); - } - } - -} - -exports.Profile = Profile; - -class StackListProfileBuilder extends Profile { - constructor() { - super(...arguments); - this.pendingSample = null; - } - - _appendSample(stack, weight, useAppendOrder) { - if (isNaN(weight)) throw new Error('invalid weight'); - let node = useAppendOrder ? this.appendOrderCalltreeRoot : this.groupedCalltreeRoot; - let framesInStack = new Set(); - - for (let frameInfo of stack) { - const frame = Frame.getOrInsert(this.frames, frameInfo); - const last = useAppendOrder ? utils_1.lastOf(node.children) : node.children.find(c => c.frame === frame); - - if (last && !last.isFrozen() && last.frame == frame) { - node = last; - } else { - const parent = node; - node = new CallTreeNode(frame, node); - parent.children.push(node); - } - - node.addToTotalWeight(weight); // It's possible for the same frame to occur multiple - // times in the same call stack due to either direct - // or indirect recursion. We want to avoid counting that - // frame multiple times for a single sample, we so just - // track all of the unique frames that participated in - // this call stack, then add to their weight at the end. - - framesInStack.add(node.frame); - } - - node.addToSelfWeight(weight); - - if (useAppendOrder) { - for (let child of node.children) { - child.freeze(); - } - } - - if (useAppendOrder) { - node.frame.addToSelfWeight(weight); - - for (let frame of framesInStack) { - frame.addToTotalWeight(weight); - } - - if (node === utils_1.lastOf(this.samples)) { - this.weights[this.weights.length - 1] += weight; - } else { - this.samples.push(node); - this.weights.push(weight); - } - } - } - - appendSampleWithWeight(stack, weight) { - if (weight === 0) { - // Samples with zero weight have no effect, so let's ignore them - return; - } - - if (weight < 0) { - throw new Error('Samples must have positive weights'); - } - - this._appendSample(stack, weight, true); - - this._appendSample(stack, weight, false); - } - - appendSampleWithTimestamp(stack, timestamp) { - if (this.pendingSample) { - if (timestamp < this.pendingSample.centralTimestamp) { - throw new Error('Timestamps received out of order'); - } - - const endTimestamp = (timestamp + this.pendingSample.centralTimestamp) / 2; - this.appendSampleWithWeight(this.pendingSample.stack, endTimestamp - this.pendingSample.startTimestamp); - this.pendingSample = { - stack, - startTimestamp: endTimestamp, - centralTimestamp: timestamp - }; - } else { - this.pendingSample = { - stack, - startTimestamp: timestamp, - centralTimestamp: timestamp - }; - } - } - - build() { - if (this.pendingSample) { - if (this.samples.length > 0) { - this.appendSampleWithWeight(this.pendingSample.stack, this.pendingSample.centralTimestamp - this.pendingSample.startTimestamp); - } else { - // There is only a single sample. In this case, units will be meaningless, - // so we'll append with a weight of 1 and also clear any value formatter - this.appendSampleWithWeight(this.pendingSample.stack, 1); - this.setValueFormatter(new value_formatters_1.RawValueFormatter()); - } - } - - this.totalWeight = Math.max(this.totalWeight, this.weights.reduce((a, b) => a + b, 0)); - this.sortGroupedCallTree(); - return this; - } - -} - -exports.StackListProfileBuilder = StackListProfileBuilder; // As an alternative API for importing profiles more efficiently, provide a -// way to open & close frames directly without needing to construct tons of -// arrays as intermediaries. - -class CallTreeProfileBuilder extends Profile { - constructor() { - super(...arguments); - this.appendOrderStack = [this.appendOrderCalltreeRoot]; - this.groupedOrderStack = [this.groupedCalltreeRoot]; - this.framesInStack = new Map(); - this.stack = []; - this.lastValue = 0; - } - - addWeightsToFrames(value) { - const delta = value - this.lastValue; - - for (let frame of this.framesInStack.keys()) { - frame.addToTotalWeight(delta); - } - - const stackTop = utils_1.lastOf(this.stack); - - if (stackTop) { - stackTop.addToSelfWeight(delta); - } - } - - addWeightsToNodes(value, stack) { - const delta = value - this.lastValue; - - for (let node of stack) { - node.addToTotalWeight(delta); - } - - const stackTop = utils_1.lastOf(stack); - - if (stackTop) { - stackTop.addToSelfWeight(delta); - } - } - - _enterFrame(frame, value, useAppendOrder) { - let stack = useAppendOrder ? this.appendOrderStack : this.groupedOrderStack; - this.addWeightsToNodes(value, stack); - let prevTop = utils_1.lastOf(stack); - - if (prevTop) { - if (useAppendOrder) { - const delta = value - this.lastValue; - - if (delta > 0) { - this.samples.push(prevTop); - this.weights.push(value - this.lastValue); - } else if (delta < 0) { - throw new Error(`Samples must be provided in increasing order of cumulative value. Last sample was ${this.lastValue}, this sample was ${value}`); - } - } - - const last = useAppendOrder ? utils_1.lastOf(prevTop.children) : prevTop.children.find(c => c.frame === frame); - let node; - - if (last && !last.isFrozen() && last.frame == frame) { - node = last; - } else { - node = new CallTreeNode(frame, prevTop); - prevTop.children.push(node); - } - - stack.push(node); - } - } - - enterFrame(frameInfo, value) { - const frame = Frame.getOrInsert(this.frames, frameInfo); - this.addWeightsToFrames(value); - - this._enterFrame(frame, value, true); - - this._enterFrame(frame, value, false); - - this.stack.push(frame); - const frameCount = this.framesInStack.get(frame) || 0; - this.framesInStack.set(frame, frameCount + 1); - this.lastValue = value; - } - - _leaveFrame(frame, value, useAppendOrder) { - let stack = useAppendOrder ? this.appendOrderStack : this.groupedOrderStack; - this.addWeightsToNodes(value, stack); - - if (useAppendOrder) { - const leavingStackTop = this.appendOrderStack.pop(); - - if (leavingStackTop == null) { - throw new Error(`Trying to leave ${frame.key} when stack is empty`); - } - - if (this.lastValue == null) { - throw new Error(`Trying to leave a ${frame.key} before any have been entered`); - } - - leavingStackTop.freeze(); - - if (leavingStackTop.frame.key !== frame.key) { - throw new Error(`Tried to leave frame "${frame.name}" while frame "${leavingStackTop.frame.name}" was at the top at ${value}`); - } - - const delta = value - this.lastValue; - - if (delta > 0) { - this.samples.push(leavingStackTop); - this.weights.push(value - this.lastValue); - } else if (delta < 0) { - throw new Error(`Samples must be provided in increasing order of cumulative value. Last sample was ${this.lastValue}, this sample was ${value}`); - } - } else { - this.groupedOrderStack.pop(); - } - } - - leaveFrame(frameInfo, value) { - const frame = Frame.getOrInsert(this.frames, frameInfo); - this.addWeightsToFrames(value); - - this._leaveFrame(frame, value, true); - - this._leaveFrame(frame, value, false); - - this.stack.pop(); - const frameCount = this.framesInStack.get(frame); - if (frameCount == null) return; - - if (frameCount === 1) { - this.framesInStack.delete(frame); - } else { - this.framesInStack.set(frame, frameCount - 1); - } - - this.lastValue = value; - this.totalWeight = Math.max(this.totalWeight, this.lastValue); - } - - build() { - // Each stack is expected to contain a single node which we initialize to be - // the root node. - if (this.appendOrderStack.length > 1 || this.groupedOrderStack.length > 1) { - throw new Error('Tried to complete profile construction with a non-empty stack'); - } - - this.sortGroupedCallTree(); - return this; - } - -} - -exports.CallTreeProfileBuilder = CallTreeProfileBuilder; - -/***/ }), -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.demangleCpp = void 0; -let cppfilt; -const cache = new Map(); // This function converts a mangled C++ name such as "__ZNK7Support6ColorFeqERKS0_" -// into a human-readable symbol (in this case "Support::ColorF::==(Support::ColorF&)") - -function demangleCpp(name) { - if (name.startsWith('__Z')) { - let result = cache.get(name); - - if (result !== undefined) { - name = result; - } else { - if (!cppfilt) { - cppfilt = new Function('exports', code)(); - } - - result = cppfilt(name.slice(1)); - result = result === '(null)' ? name : result; - cache.set(name, result); - name = result; - } - } - - return name; -} - -exports.demangleCpp = demangleCpp; // This was taken from https://d.fuqu.jp/c++filtjs/ - -const code = ` -return function(){function r(r){eval.call(null,r)}function a(r){throw print(r+":\\n"+(new Error).stack),ke=!0,"Assertion: "+r}function e(r,e){r||a("Assertion failed: "+e)}function i(r,a,i,v){function t(r,a){if("string"==a){var e=Oe;return le.stackAlloc(r.length+1),A(r,e),e}return r}function f(r,a){return"string"==a?s(r):r}try{func=ce.Module["_"+r]}catch(r){}e(func,"Cannot call unknown function "+r+" (perhaps LLVM optimizations or closure removed it?)");var _=0,n=v?v.map(function(r){return t(r,i[_++])}):[];return f(func.apply(null,n),a)}function v(r,a,e){return function(){return i(r,a,e,Array.prototype.slice.call(arguments))}}function t(r,e,i,v){switch(i=i||"i8","*"===i[i.length-1]&&(i="i32"),i){case"i1":Ae[r]=e;break;case"i8":Ae[r]=e;break;case"i16":ye[r>>1]=e;break;case"i32":Se[r>>2]=e;break;case"i64":Se[r>>2]=e;break;case"float":Ce[r>>2]=e;break;case"double":ze[0]=e,Se[r>>2]=xe[0],Se[r+4>>2]=xe[1];break;default:a("invalid type for setValue: "+i)}}function f(r,e,i){switch(e=e||"i8","*"===e[e.length-1]&&(e="i32"),e){case"i1":return Ae[r];case"i8":return Ae[r];case"i16":return ye[r>>1];case"i32":return Se[r>>2];case"i64":return Se[r>>2];case"float":return Ce[r>>2];case"double":return xe[0]=Se[r>>2],xe[1]=Se[r+4>>2],ze[0];default:a("invalid type for setValue: "+e)}return null}function _(r,a,e){var i,v;"number"==typeof r?(i=!0,v=r):(i=!1,v=r.length);var f="string"==typeof a?a:null,_=[Jr,le.stackAlloc,le.staticAlloc][void 0===e?we:e](Math.max(v,f?1:a.length));if(i)return Fa(_,0,v),_;for(var s,n=0;n>12<<12}function l(){for(;Le<=Ie;)Le=o(2*Le);var r=Ae,a=new ArrayBuffer(Le);Ae=new Int8Array(a),ye=new Int16Array(a),Se=new Int32Array(a),ge=new Uint8Array(a),me=new Uint16Array(a),Me=new Uint32Array(a),Ce=new Float32Array(a),Re=new Float64Array(a),Ae.set(r)}function b(r){for(;r.length>0;){var a=r.shift(),e=a.func;"number"==typeof e&&(e=pe[e]),e(void 0===a.arg?null:a.arg)}}function k(){b(Ve)}function u(){b(Be),be.print()}function c(r,a){return Array.prototype.slice.call(Ae.subarray(r,r+a))}function h(r,a){for(var e=new Uint8Array(a),i=0;i255&&(v&=255),e.push(v),i+=1}return a||e.push(0),e}function E(r){for(var a=[],e=0;e255&&(i&=255),a.push(String.fromCharCode(i))}return a.join("")}function A(r,a,e){for(var i=0;i255&&(v&=255),Ae[a+i]=v,i+=1}e||(Ae[a+i]=0)}function g(r,a,e,i){return r>=0?r:a<=32?2*Math.abs(1<=v&&(a<=32||r>v)&&(r=-2*v+r),r}function m(r,a,e){if(0==(0|r)|0==(0|a)|0==(0|e))var i=0;else{Se[r>>2]=0,Se[r+4>>2]=a,Se[r+8>>2]=e;var i=1}var i;return i}function S(r,a,e){if(0==(0|r)|(0|a)<0|0==(0|e))var i=0;else{Se[r>>2]=41,Se[r+4>>2]=a,Se[r+8>>2]=e;var i=1}var i;return i}function M(r,a,e){if(0==(0|r)|0==(0|e))var i=0;else{Se[r>>2]=6,Se[r+4>>2]=a,Se[r+8>>2]=e;var i=1}var i;return i}function C(r,a,e){if(0==(0|r)|0==(0|e))var i=0;else{Se[r>>2]=7,Se[r+4>>2]=a,Se[r+8>>2]=e;var i=1}var i;return i}function R(r,a){var e,i=0==(0|a);do if(i)var v=0;else{var e=(r+32|0)>>2,t=Se[e];if((0|t)>=(0|Se[r+36>>2])){var v=0;break}var f=(t<<2)+Se[r+28>>2]|0;Se[f>>2]=a;var _=Se[e]+1|0;Se[e]=_;var v=1}while(0);var v;return v}function T(r,a){var e,e=(r+12|0)>>2,i=Se[e],v=i+1|0;Se[e]=v;var t=Ae[i]<<24>>24==95;do if(t){var f=i+2|0;if(Se[e]=f,Ae[v]<<24>>24!=90){var _=0;break}var s=O(r,a),_=s}else var _=0;while(0);var _;return _}function O(r,a){var e=r+12|0,i=Ae[Se[e>>2]];r:do if(i<<24>>24==71||i<<24>>24==84)var v=Tr(r),t=v;else{var f=Ar(r),_=0==(0|f)|0==(0|a);do if(!_){if(0!=(1&Se[r+8>>2]|0))break;var s=Me[f>>2],n=(s-25|0)>>>0<3;a:do if(n)for(var o=f;;){var o,l=Me[o+4>>2],b=Me[l>>2];if((b-25|0)>>>0>=3){var k=l,u=b;break a}var o=l}else var k=f,u=s;while(0);var u,k;if(2!=(0|u)){var t=k;break r}var c=k+8|0,h=Me[c>>2],d=(Se[h>>2]-25|0)>>>0<3;a:do if(d)for(var w=h;;){var w,p=Me[w+4>>2];if((Se[p>>2]-25|0)>>>0>=3){var E=p;break a}var w=p}else var E=h;while(0);var E;Se[c>>2]=E;var t=k;break r}while(0);var A=Ae[Se[e>>2]];if(A<<24>>24==0||A<<24>>24==69){var t=f;break}var g=Or(f),y=Sr(r,g),m=D(r,3,f,y),t=m}while(0);var t;return t}function N(r){var a,e,i=Oe;Oe+=4;var v=i,e=v>>2,a=(r+12|0)>>2,t=Me[a],f=Ae[t],_=f<<24>>24;r:do if(f<<24>>24==114||f<<24>>24==86||f<<24>>24==75){var s=I(r,v,0);if(0==(0|s)){var n=0;break}var o=N(r);Se[s>>2]=o;var l=Se[e],b=R(r,l);if(0==(0|b)){var n=0;break}var n=Se[e]}else{do{if(97==(0|_)||98==(0|_)||99==(0|_)||100==(0|_)||101==(0|_)||102==(0|_)||103==(0|_)||104==(0|_)||105==(0|_)||106==(0|_)||108==(0|_)||109==(0|_)||110==(0|_)||111==(0|_)||115==(0|_)||116==(0|_)||118==(0|_)||119==(0|_)||120==(0|_)||121==(0|_)||122==(0|_)){var k=ai+20*(_-97)|0,u=P(r,k);Se[e]=u;var c=r+48|0,h=Se[c>>2]+Se[Se[u+4>>2]+4>>2]|0;Se[c>>2]=h;var d=Se[a]+1|0;Se[a]=d;var n=u;break r}if(117==(0|_)){Se[a]=t+1|0;var w=L(r),p=D(r,34,w,0);Se[e]=p;var E=p}else if(70==(0|_)){var A=F(r);Se[e]=A;var E=A}else if(48==(0|_)||49==(0|_)||50==(0|_)||51==(0|_)||52==(0|_)||53==(0|_)||54==(0|_)||55==(0|_)||56==(0|_)||57==(0|_)||78==(0|_)||90==(0|_)){var g=X(r);Se[e]=g;var E=g}else if(65==(0|_)){var y=j(r);Se[e]=y;var E=y}else if(77==(0|_)){var m=U(r);Se[e]=m;var E=m}else if(84==(0|_)){var S=x(r);if(Se[e]=S,Ae[Se[a]]<<24>>24!=73){var E=S;break}var M=R(r,S);if(0==(0|M)){var n=0;break r}var C=Se[e],T=z(r),O=D(r,4,C,T);Se[e]=O;var E=O}else if(83==(0|_)){var B=ge[t+1|0];if((B-48&255&255)<10|B<<24>>24==95|(B-65&255&255)<26){var H=V(r,0);if(Se[e]=H,Ae[Se[a]]<<24>>24!=73){var n=H;break r}var K=z(r),Y=D(r,4,H,K);Se[e]=Y;var E=Y}else{var G=X(r);if(Se[e]=G,0==(0|G)){var E=0;break}if(21==(0|Se[G>>2])){var n=G;break r}var E=G}}else if(80==(0|_)){Se[a]=t+1|0;var W=N(r),Z=D(r,29,W,0);Se[e]=Z;var E=Z}else if(82==(0|_)){Se[a]=t+1|0;var Q=N(r),q=D(r,30,Q,0);Se[e]=q;var E=q}else if(67==(0|_)){Se[a]=t+1|0;var $=N(r),J=D(r,31,$,0);Se[e]=J;var E=J}else if(71==(0|_)){Se[a]=t+1|0;var rr=N(r),ar=D(r,32,rr,0);Se[e]=ar;var E=ar}else{if(85!=(0|_)){var n=0;break r}Se[a]=t+1|0;var er=L(r);Se[e]=er;var ir=N(r),vr=Se[e],tr=D(r,28,ir,vr);Se[e]=tr;var E=tr}}while(0);var E,fr=R(r,E);if(0==(0|fr)){var n=0;break}var n=Se[e]}while(0);var n;return Oe=i,n}function I(r,a,e){for(var i,v=r+12|0,t=0!=(0|e),f=t?25:22,i=(r+48|0)>>2,_=t?26:23,s=t?27:24,n=a;;){var n,o=Se[v>>2],l=Ae[o];if(l<<24>>24!=114&&l<<24>>24!=86&&l<<24>>24!=75){var b=n;break}var k=o+1|0;if(Se[v>>2]=k,l<<24>>24==114){var u=Se[i]+9|0;Se[i]=u;var c=f}else if(l<<24>>24==86){var h=Se[i]+9|0;Se[i]=h;var c=_}else{var d=Se[i]+6|0;Se[i]=d;var c=s}var c,w=D(r,c,0,0);if(Se[n>>2]=w,0==(0|w)){var b=0;break}var n=w+4|0}var b;return b}function P(r,a){var e=0==(0|a);do if(e)var i=0;else{var v=J(r);if(0==(0|v)){var i=0;break}Se[v>>2]=33,Se[v+4>>2]=a;var i=v}while(0);var i;return i}function D(r,a,e,i){var v,t;do{if(1==(0|a)||2==(0|a)||3==(0|a)||4==(0|a)||10==(0|a)||28==(0|a)||37==(0|a)||43==(0|a)||44==(0|a)||45==(0|a)||46==(0|a)||47==(0|a)||48==(0|a)||49==(0|a)||50==(0|a)){if(0==(0|e)|0==(0|i)){var f=0;t=7;break}t=5;break}if(8==(0|a)||9==(0|a)||11==(0|a)||12==(0|a)||13==(0|a)||14==(0|a)||15==(0|a)||16==(0|a)||17==(0|a)||18==(0|a)||19==(0|a)||20==(0|a)||29==(0|a)||30==(0|a)||31==(0|a)||32==(0|a)||34==(0|a)||38==(0|a)||39==(0|a)||42==(0|a)){if(0==(0|e)){var f=0;t=7;break}t=5;break}if(36==(0|a)){if(0==(0|i)){var f=0;t=7;break}t=5;break}if(35==(0|a)||22==(0|a)||23==(0|a)||24==(0|a)||25==(0|a)||26==(0|a)||27==(0|a))t=5;else{var f=0;t=7}}while(0);do if(5==t){var _=J(r),v=_>>2;if(0==(0|_)){var f=0;break}Se[v]=a,Se[v+1]=e,Se[v+2]=i;var f=_}while(0);var f;return f}function L(r){var a=sr(r);if((0|a)<1)var e=0;else{var i=Rr(r,a);Se[r+44>>2]=i;var e=i}var e;return e}function F(r){var a,a=(r+12|0)>>2,e=Se[a],i=e+1|0;if(Se[a]=i,Ae[e]<<24>>24==70){if(Ae[i]<<24>>24==89){var v=e+2|0;Se[a]=v}var t=Sr(r,1),f=Se[a],_=f+1|0;Se[a]=_;var s=Ae[f]<<24>>24==69?t:0,n=s}else var n=0;var n;return n}function X(r){var a=Ar(r);return a}function j(r){var a,a=(r+12|0)>>2,e=Se[a],i=e+1|0;Se[a]=i;var v=Ae[e]<<24>>24==65;do if(v){var t=Ae[i];if(t<<24>>24==95)var f=0;else if((t-48&255&255)<10){for(var _=i;;){var _,s=_+1|0;if(Se[a]=s,(Ae[s]-48&255&255)>=10)break;var _=s}var n=s-i|0,o=lr(r,i,n);if(0==(0|o)){var l=0;break}var f=o}else{var b=nr(r);if(0==(0|b)){var l=0;break}var f=b}var f,k=Se[a],u=k+1|0;if(Se[a]=u,Ae[k]<<24>>24!=95){var l=0;break}var c=N(r),h=D(r,36,f,c),l=h}else var l=0;while(0);var l;return l}function U(r){var a=Oe;Oe+=4;var e=a,i=r+12|0,v=Se[i>>2],t=v+1|0;Se[i>>2]=t;var f=Ae[v]<<24>>24==77;r:do if(f){var _=N(r),s=I(r,e,1);if(0==(0|s)){var n=0;break}var o=N(r);Se[s>>2]=o;var l=(0|s)==(0|e);do if(!l){if(35==(0|Se[o>>2]))break;var b=Se[e>>2],k=R(r,b);if(0==(0|k)){var n=0;break r}}while(0);var u=Se[e>>2],c=D(r,37,_,u),n=c}else var n=0;while(0);var n;return Oe=a,n}function x(r){var a,a=(r+12|0)>>2,e=Se[a],i=e+1|0;Se[a]=i;var v=Ae[e]<<24>>24==84;do if(v){if(Ae[i]<<24>>24==95)var t=0,f=i;else{var _=sr(r);if((0|_)<0){var s=0;break}var t=_+1|0,f=Se[a]}var f,t;if(Se[a]=f+1|0,Ae[f]<<24>>24!=95){var s=0;break}var n=r+40|0,o=Se[n>>2]+1|0;Se[n>>2]=o;var l=Er(r,t),s=l}else var s=0;while(0);var s;return s}function z(r){var a,e=Oe;Oe+=4;var i=e,v=r+44|0,t=Se[v>>2],a=(r+12|0)>>2,f=Se[a],_=f+1|0;Se[a]=_;var s=Ae[f]<<24>>24==73;r:do if(s){Se[i>>2]=0;for(var n=i;;){var n,o=_r(r);if(0==(0|o)){var l=0;break r}var b=D(r,39,o,0);if(Se[n>>2]=b,0==(0|b)){var l=0;break r}var k=Se[a];if(Ae[k]<<24>>24==69)break;var n=b+8|0}var u=k+1|0;Se[a]=u,Se[v>>2]=t;var l=Se[i>>2]}else var l=0;while(0);var l;return Oe=e,l}function V(r,a){var e,e=(r+12|0)>>2,i=Se[e],v=i+1|0;Se[e]=v;var t=Ae[i]<<24>>24==83;r:do if(t){var f=i+2|0;Se[e]=f;var _=ge[v];if(_<<24>>24==95)var s=0;else{if(!((_-48&255&255)<10|(_-65&255&255)<26)){var n=8&Se[r+8>>2],o=n>>>3,l=0!=(0|n)|0==(0|a);do if(l)var b=o;else{if((Ae[f]-67&255&255)>=2){var b=o;break}var b=1}while(0);for(var b,k=0|ei;;){var k;if(k>>>0>=(ei+196|0)>>>0){var u=0;break r}if(_<<24>>24==Ae[0|k]<<24>>24)break;var k=k+28|0}var c=Se[k+20>>2];if(0!=(0|c)){var h=Se[k+24>>2],d=fr(r,c,h);Se[r+44>>2]=d}if(0==(0|b))var w=k+8|0,p=k+4|0;else var w=k+16|0,p=k+12|0;var p,w,E=Se[w>>2],A=Se[p>>2],g=r+48|0,y=Se[g>>2]+E|0;Se[g>>2]=y;var m=fr(r,A,E),u=m;break}for(var S=_,M=0,C=f;;){var C,M,S;if((S-48&255&255)<10)var R=36*M-48|0;else{if((S-65&255&255)>=26){var u=0;break r}var R=36*M-55|0}var R,T=(S<<24>>24)+R|0;if((0|T)<0){var u=0;break r}var O=C+1|0;Se[e]=O;var N=ge[C];if(N<<24>>24==95)break;var S=N,M=T,C=O}var s=T+1|0}var s;if((0|s)>=(0|Se[r+32>>2])){var u=0;break}var I=r+40|0,P=Se[I>>2]+1|0;Se[I>>2]=P;var u=Se[Se[r+28>>2]+(s<<2)>>2]}else var u=0;while(0);var u;return u}function B(r,a,e,i){var v,t,f,_,s=Oe;Oe+=28;var n,o=s,_=o>>2;Se[_]=r;var l=e+1|0,f=(o+12|0)>>2;Se[f]=l;var b=Jr(l),t=(o+4|0)>>2;if(Se[t]=b,0==(0|b))var k=0,u=1;else{var v=(o+8|0)>>2;Se[v]=0,Se[_+4]=0,Se[_+5]=0;var c=o+24|0;Se[c>>2]=0,H(o,a);var h=Me[t],d=0==(0|h);do{if(!d){var w=Me[v];if(w>>>0>=Me[f]>>>0){n=5;break}Se[v]=w+1|0,Ae[h+w|0]=0,n=6;break}n=5}while(0);5==n&&Y(o,0);var p=Se[t],E=0==(0|p)?Se[c>>2]:Se[f],k=p,u=E}var u,k;return Se[i>>2]=u,Oe=s,k}function H(r,a){var e,i,v,t,f,_,s,n,o,l,b,k,u,c,h,d,w,p,E,A,g,y,m,S,M,C,R,T,O,N,I,P,D,L,F,X,j,U,x,z,V,B,K,G,W,J,vr,tr,fr,_r,sr,nr,or,lr,br,kr,ur,cr,hr,dr,wr,pr=a>>2,Er=r>>2,Ar=Oe;Oe+=184;var gr,yr=Ar,wr=yr>>2,mr=Ar+64,dr=mr>>2,Sr=Ar+72,Mr=Ar+88,Cr=Ar+104,hr=Cr>>2,Rr=Ar+168,Tr=0==(0|a);r:do if(Tr)Z(r);else{var cr=(r+4|0)>>2,Or=Me[cr];if(0==(0|Or))break;var Nr=0|a,Ir=Me[Nr>>2];a:do{if(0==(0|Ir)){if(0!=(4&Se[Er]|0)){var Pr=Se[pr+1],Dr=Se[pr+2];q(r,Pr,Dr);break r}var ur=(r+8|0)>>2,Lr=Me[ur],Fr=a+8|0,Xr=Me[Fr>>2];if((Xr+Lr|0)>>>0>Me[Er+3]>>>0){var jr=Se[pr+1];Q(r,jr,Xr);break r}var Ur=Or+Lr|0,xr=Se[pr+1];Pa(Ur,xr,Xr,1);var zr=Se[ur]+Se[Fr>>2]|0;Se[ur]=zr;break r}if(1==(0|Ir)||2==(0|Ir)){var Vr=Se[pr+1];H(r,Vr);var Br=0==(4&Se[Er]|0),Hr=Me[cr],Kr=0!=(0|Hr);e:do if(Br){do if(Kr){var kr=(r+8|0)>>2,Yr=Me[kr];if((Yr+2|0)>>>0>Me[Er+3]>>>0)break;var Gr=Hr+Yr|0;oe=14906,Ae[Gr]=255&oe,oe>>=8,Ae[Gr+1]=255&oe;var Wr=Se[kr]+2|0;Se[kr]=Wr;break e}while(0);Q(r,0|He.__str120,2)}else{do if(Kr){var Zr=r+8|0,Qr=Me[Zr>>2];if(Qr>>>0>=Me[Er+3]>>>0)break;Se[Zr>>2]=Qr+1|0,Ae[Hr+Qr|0]=46;break e}while(0);Y(r,46)}while(0);var qr=Se[pr+2];H(r,qr);break r}if(3==(0|Ir)){for(var br=(r+20|0)>>2,$r=Me[br],lr=(r+16|0)>>2,Jr=a,ra=0,aa=$r;;){var aa,ra,Jr,ea=Me[Jr+4>>2];if(0==(0|ea)){var ia=ra,va=0;gr=33;break}if(ra>>>0>3){Z(r);break r}var ta=(ra<<4)+yr|0;Se[ta>>2]=aa,Se[br]=ta,Se[((ra<<4)+4>>2)+wr]=ea,Se[((ra<<4)+8>>2)+wr]=0;var fa=Me[lr];Se[((ra<<4)+12>>2)+wr]=fa;var _a=ra+1|0,sa=0|ea,na=Me[sa>>2];if((na-25|0)>>>0>=3){gr=25;break}var Jr=ea,ra=_a,aa=ta}e:do if(25==gr){if(4==(0|na)){Se[dr]=fa,Se[lr]=mr,Se[dr+1]=ea;var oa=Se[sa>>2],la=mr}else var oa=na,la=fa;var la,oa;if(2!=(0|oa)){var ia=_a,va=sa;break}for(var ba=_a,ka=ea+8|0;;){var ka,ba,ua=Me[ka>>2];if((Se[ua>>2]-25|0)>>>0>=3){var ia=ba,va=sa;break e}if(ba>>>0>3)break;var ca=(ba<<4)+yr|0,ha=ba-1|0,da=(ha<<4)+yr|0,or=ca>>2,nr=da>>2;Se[or]=Se[nr],Se[or+1]=Se[nr+1],Se[or+2]=Se[nr+2],Se[or+3]=Se[nr+3],Se[ca>>2]=da,Se[br]=ca,Se[((ha<<4)+4>>2)+wr]=ua,Se[((ha<<4)+8>>2)+wr]=0,Se[((ha<<4)+12>>2)+wr]=la;var ba=ba+1|0,ka=ua+4|0}Z(r);break r}while(0);var va,ia,wa=Se[pr+2];if(H(r,wa),4==(0|Se[va>>2])){var pa=Se[dr];Se[lr]=pa}var Ea=0==(0|ia);e:do if(!Ea)for(var Aa=r+8|0,ga=r+12|0,ya=ia;;){var ya,ma=ya-1|0;if(0==(0|Se[((ma<<4)+8>>2)+wr])){var Sa=Me[cr],Ma=0==(0|Sa);do{if(!Ma){var Ca=Me[Aa>>2];if(Ca>>>0>=Me[ga>>2]>>>0){gr=41;break}Se[Aa>>2]=Ca+1|0,Ae[Sa+Ca|0]=32,gr=42;break}gr=41}while(0);41==gr&&Y(r,32);var Ra=Se[((ma<<4)+4>>2)+wr];$(r,Ra)}if(0==(0|ma))break e;var ya=ma}while(0);Se[br]=$r;break r}if(4==(0|Ir)){var sr=(r+20|0)>>2,Ta=Se[sr];Se[sr]=0;var Oa=Se[pr+1];H(r,Oa);var Na=Me[cr],Ia=0==(0|Na);do{if(!Ia){var _r=(r+8|0)>>2,Da=Me[_r],La=0==(0|Da);do if(!La){if(Ae[Na+(Da-1)|0]<<24>>24!=60)break;Da>>>0>>0?(Se[_r]=Da+1|0,Ae[Na+Da|0]=32):Y(r,32)}while(0);var Fa=Me[cr];if(0==(0|Fa)){gr=54;break}var Xa=Me[_r];if(Xa>>>0>=Me[Er+3]>>>0){gr=54;break}Se[_r]=Xa+1|0,Ae[Fa+Xa|0]=60,gr=55;break}gr=54}while(0);54==gr&&Y(r,60);var ja=Se[pr+2];H(r,ja);var Ua=Me[cr],xa=0==(0|Ua);do{if(!xa){var fr=(r+8|0)>>2,za=Me[fr],Va=0==(0|za);do if(!Va){if(Ae[Ua+(za-1)|0]<<24>>24!=62)break;za>>>0>>0?(Se[fr]=za+1|0,Ae[Ua+za|0]=32):Y(r,32)}while(0);var Ba=Me[cr];if(0==(0|Ba)){gr=64;break}var Ha=Me[fr];if(Ha>>>0>=Me[Er+3]>>>0){gr=64;break}Se[fr]=Ha+1|0,Ae[Ba+Ha|0]=62,gr=65;break}gr=64}while(0);64==gr&&Y(r,62),Se[sr]=Ta;break r}if(5==(0|Ir)){var tr=(r+16|0)>>2,Ka=Me[tr];if(0==(0|Ka)){Z(r);break r}for(var Ya=Se[pr+1],Ga=Se[Ka+4>>2];;){var Ga,Ya,Wa=Se[Ga+8>>2];if(0==(0|Wa))break;if(39!=(0|Se[Wa>>2])){Z(r);break r}if((0|Ya)<1){if(0!=(0|Ya))break;var Za=Se[Ka>>2];Se[tr]=Za;var Qa=Se[Wa+4>>2];H(r,Qa),Se[tr]=Ka;break r}var Ya=Ya-1|0,Ga=Wa}Z(r);break r}if(6==(0|Ir)){var qa=Se[pr+2];H(r,qa);break r}if(7==(0|Ir)){var $a=r+8|0,Ja=Me[$a>>2];Ja>>>0>>0?(Se[$a>>2]=Ja+1|0,Ae[Or+Ja|0]=126):Y(r,126);var re=Se[pr+2];H(r,re);break r}if(8==(0|Ir)){var vr=(r+8|0)>>2,ae=Me[vr];if((ae+11|0)>>>0>Me[Er+3]>>>0)Q(r,0|He.__str121,11);else{for(var ee=Or+ae|0,ie=0|He.__str121,ve=ee,te=ie+11;ie>2,se=Me[J];if((se+8|0)>>>0>Me[Er+3]>>>0)Q(r,0|He.__str122,8);else{var ne=Or+se|0,le=0|ne;oe=542397526,Ae[le]=255&oe,oe>>=8,Ae[le+1]=255&oe,oe>>=8,Ae[le+2]=255&oe,oe>>=8,Ae[le+3]=255&oe;var be=ne+4|0;oe=544370534,Ae[be]=255&oe,oe>>=8,Ae[be+1]=255&oe,oe>>=8,Ae[be+2]=255&oe,oe>>=8,Ae[be+3]=255&oe;var ke=Se[J]+8|0;Se[J]=ke}var ue=Se[pr+1];H(r,ue);break r}if(10==(0|Ir)){var W=(r+8|0)>>2,ce=Me[W],he=r+12|0;if((ce+24|0)>>>0>Me[he>>2]>>>0)Q(r,0|He.__str123,24);else{var de=Or+ce|0;Pa(de,0|He.__str123,24,1);var we=Se[W]+24|0;Se[W]=we}var pe=Se[pr+1];H(r,pe);var Ee=Me[cr],ge=0==(0|Ee);do{if(!ge){var ye=Me[W];if((ye+4|0)>>>0>Me[he>>2]>>>0){gr=96;break}var me=Ee+ye|0;oe=762210605,Ae[me]=255&oe,oe>>=8,Ae[me+1]=255&oe,oe>>=8,Ae[me+2]=255&oe,oe>>=8,Ae[me+3]=255&oe;var Ce=Se[W]+4|0;Se[W]=Ce,gr=97;break}gr=96}while(0);96==gr&&Q(r,0|He.__str124,4);var Re=Se[pr+2];H(r,Re);break r}if(11==(0|Ir)){var G=(r+8|0)>>2,Te=Me[G];if((Te+13|0)>>>0>Me[Er+3]>>>0)Q(r,0|He.__str125,13);else{for(var Ne=Or+Te|0,ie=0|He.__str125,ve=Ne,te=ie+13;ie>2,De=Me[K];if((De+18|0)>>>0>Me[Er+3]>>>0)Q(r,0|He.__str126,18);else{for(var Le=Or+De|0,ie=0|He.__str126,ve=Le,te=ie+18;ie>2,je=Me[B];if((je+16|0)>>>0>Me[Er+3]>>>0)Q(r,0|He.__str127,16);else{for(var Ue=Or+je|0,ie=0|He.__str127,ve=Ue,te=ie+16;ie>2,Ve=Me[V];if((Ve+21|0)>>>0>Me[Er+3]>>>0)Q(r,0|He.__str128,21);else{var Be=Or+Ve|0;Pa(Be,0|He.__str128,21,1);var Ke=Se[V]+21|0;Se[V]=Ke}var Ye=Se[pr+1];H(r,Ye);break r}if(15==(0|Ir)){var z=(r+8|0)>>2,Ge=Me[z];if((Ge+17|0)>>>0>Me[Er+3]>>>0)Q(r,0|He.__str129,17);else{for(var We=Or+Ge|0,ie=0|He.__str129,ve=We,te=ie+17;ie>2,qe=Me[x];if((qe+26|0)>>>0>Me[Er+3]>>>0)Q(r,0|He.__str130,26);else{var $e=Or+qe|0;Pa($e,0|He.__str130,26,1);var Je=Se[x]+26|0;Se[x]=Je}var ri=Se[pr+1];H(r,ri);break r}if(17==(0|Ir)){var U=(r+8|0)>>2,ai=Me[U];if((ai+15|0)>>>0>Me[Er+3]>>>0)Q(r,0|He.__str131,15);else{for(var ei=Or+ai|0,ie=0|He.__str131,ve=ei,te=ie+15;ie>2,ti=Me[j];if((ti+19|0)>>>0>Me[Er+3]>>>0)Q(r,0|He.__str132,19);else{for(var fi=Or+ti|0,ie=0|He.__str132,ve=fi,te=ie+19;ie>2,ni=Me[X];if((ni+24|0)>>>0>Me[Er+3]>>>0)Q(r,0|He.__str133,24);else{var oi=Or+ni|0;Pa(oi,0|He.__str133,24,1);var li=Se[X]+24|0;Se[X]=li}var bi=Se[pr+1];H(r,bi);break r}if(20==(0|Ir)){var F=(r+8|0)>>2,ki=Me[F];if((ki+17|0)>>>0>Me[Er+3]>>>0)Q(r,0|He.__str134,17);else{for(var ui=Or+ki|0,ie=0|He.__str134,ve=ui,te=ie+17;ie>2,di=Me[L],wi=a+8|0,pi=Me[wi>>2];if((pi+di|0)>>>0>Me[Er+3]>>>0){var Ei=Se[pr+1];Q(r,Ei,pi);break r}var Ai=Or+di|0,gi=Se[pr+1];Pa(Ai,gi,pi,1);var yi=Se[L]+Se[wi>>2]|0;Se[L]=yi;break r}if(22==(0|Ir)||23==(0|Ir)||24==(0|Ir)){for(var mi=r+20|0;;){var mi,Si=Me[mi>>2];if(0==(0|Si))break a;if(0==(0|Se[Si+8>>2])){var Mi=Me[Se[Si+4>>2]>>2];if((Mi-22|0)>>>0>=3)break a;if((0|Mi)==(0|Ir))break}var mi=0|Si}var Ci=Se[pr+1];H(r,Ci);break r}if(25!=(0|Ir)&&26!=(0|Ir)&&27!=(0|Ir)&&28!=(0|Ir)&&29!=(0|Ir)&&30!=(0|Ir)&&31!=(0|Ir)&&32!=(0|Ir)){if(33==(0|Ir)){var D=(r+8|0)>>2,Ri=Me[D],P=(a+4|0)>>2,I=Me[P]>>2;if(0==(4&Se[Er]|0)){var Ti=Me[I+1];if((Ti+Ri|0)>>>0>Me[Er+3]>>>0){var Oi=Se[I];Q(r,Oi,Ti);break r}var Ni=Or+Ri|0,Ii=Se[I];Pa(Ni,Ii,Ti,1);var Pi=Se[D]+Se[Se[P]+4>>2]|0;Se[D]=Pi;break r}var Di=Me[I+3];if((Di+Ri|0)>>>0>Me[Er+3]>>>0){var Li=Se[I+2];Q(r,Li,Di);break r}var Fi=Or+Ri|0,Xi=Se[I+2];Pa(Fi,Xi,Di,1);var ji=Se[D]+Se[Se[P]+12>>2]|0;Se[D]=ji;break r}if(34==(0|Ir)){var Ui=Se[pr+1];H(r,Ui);break r}if(35==(0|Ir)){var N=(0|r)>>2;if(0!=(32&Se[N]|0)){var xi=Se[Er+5];rr(r,a,xi)}var zi=a+4|0,Vi=0==(0|Se[zi>>2]);e:do if(!Vi){var O=(r+20|0)>>2,Bi=Se[O],Hi=0|Mr;Se[Hi>>2]=Bi,Se[O]=Mr,Se[Mr+4>>2]=a;var Ki=Mr+8|0;Se[Ki>>2]=0;var Yi=Se[Er+4];Se[Mr+12>>2]=Yi;var Gi=Se[zi>>2];H(r,Gi);var Wi=Se[Hi>>2];if(Se[O]=Wi,0!=(0|Se[Ki>>2]))break r;if(0!=(32&Se[N]|0))break;var Zi=Me[cr],Qi=0==(0|Zi);do if(!Qi){var qi=r+8|0,$i=Me[qi>>2];if($i>>>0>=Me[Er+3]>>>0)break;Se[qi>>2]=$i+1|0,Ae[Zi+$i|0]=32;break e}while(0);Y(r,32)}while(0);if(0!=(32&Se[N]|0))break r;var Ji=Se[Er+5];rr(r,a,Ji);break r}if(36==(0|Ir)){var T=(r+20|0)>>2,rv=Me[T],av=0|Cr;Se[hr]=rv,Se[T]=av,Se[hr+1]=a;var ev=Cr+8|0;Se[ev>>2]=0;var iv=Se[Er+4];Se[hr+3]=iv;for(var vv=rv,tv=1;;){var tv,vv;if(0==(0|vv))break;if((Se[Se[vv+4>>2]>>2]-22|0)>>>0>=3)break;var fv=vv+8|0;if(0==(0|Se[fv>>2])){if(tv>>>0>3){Z(r);break r}var _v=(tv<<4)+Cr|0,R=_v>>2,C=vv>>2;Se[R]=Se[C],Se[R+1]=Se[C+1],Se[R+2]=Se[C+2],Se[R+3]=Se[C+3];var sv=Se[T];Se[_v>>2]=sv,Se[T]=_v,Se[fv>>2]=1;var nv=tv+1|0}else var nv=tv;var nv,vv=Se[vv>>2],tv=nv}var ov=Se[pr+2];if(H(r,ov),Se[T]=rv,0!=(0|Se[ev>>2]))break r;if(tv>>>0>1){for(var lv=tv;;){var lv,bv=lv-1|0,kv=Se[((bv<<4)+4>>2)+hr];if($(r,kv),bv>>>0<=1)break;var lv=bv}var uv=Se[T]}else var uv=rv;var uv;ar(r,a,uv);break r}if(37==(0|Ir)){var M=(r+20|0)>>2,cv=Se[M],hv=0|Rr;Se[hv>>2]=cv,Se[M]=Rr,Se[Rr+4>>2]=a;var dv=Rr+8|0;Se[dv>>2]=0;var wv=Se[Er+4];Se[Rr+12>>2]=wv;var pv=a+4|0,Ev=Se[pr+2];H(r,Ev);var Av=0==(0|Se[dv>>2]);e:do if(Av){var gv=Me[cr],yv=0==(0|gv);do{if(!yv){var mv=r+8|0,Sv=Me[mv>>2];if(Sv>>>0>=Me[Er+3]>>>0){gr=187;break}Se[mv>>2]=Sv+1|0,Ae[gv+Sv|0]=32,gr=188;break}gr=187}while(0);187==gr&&Y(r,32);var Mv=Se[pv>>2];H(r,Mv);var Cv=Me[cr],Rv=0==(0|Cv);do if(!Rv){var S=(r+8|0)>>2,Tv=Me[S];if((Tv+3|0)>>>0>Me[Er+3]>>>0)break;var Ov=Cv+Tv|0;Ae[Ov]=Ae[0|He.__str135],Ae[Ov+1]=Ae[(0|He.__str135)+1],Ae[Ov+2]=Ae[(0|He.__str135)+2];var Nv=Se[S]+3|0;Se[S]=Nv;break e}while(0);Q(r,0|He.__str135,3)}while(0);var Iv=Se[hv>>2];Se[M]=Iv;break r}if(38==(0|Ir)||39==(0|Ir)){var Pv=Se[pr+1];H(r,Pv);var Dv=a+8|0;if(0==(0|Se[Dv>>2]))break r;var Lv=Me[cr],Fv=0==(0|Lv);do{if(!Fv){var m=(r+8|0)>>2,Xv=Me[m];if((Xv+2|0)>>>0>Me[Er+3]>>>0){gr=197;break}var jv=Lv+Xv|0;oe=8236,Ae[jv]=255&oe,oe>>=8,Ae[jv+1]=255&oe;var Uv=Se[m]+2|0;Se[m]=Uv,gr=198;break}gr=197}while(0);197==gr&&Q(r,0|He.__str136,2);var xv=Se[Dv>>2];H(r,xv);break r}if(40==(0|Ir)){var y=(r+8|0)>>2,zv=Me[y],g=(r+12|0)>>2;if((zv+8|0)>>>0>Me[g]>>>0)Q(r,0|He.__str137,8);else{var Vv=Or+zv|0,le=0|Vv;oe=1919250543,Ae[le]=255&oe,oe>>=8,Ae[le+1]=255&oe,oe>>=8,Ae[le+2]=255&oe,oe>>=8,Ae[le+3]=255&oe;var be=Vv+4|0;oe=1919906913,Ae[be]=255&oe,oe>>=8,Ae[be+1]=255&oe,oe>>=8,Ae[be+2]=255&oe,oe>>=8,Ae[be+3]=255&oe;var Bv=Se[y]+8|0;Se[y]=Bv}var A=(a+4|0)>>2,Hv=(Ae[Se[Se[A]+4>>2]]-97&255&255)<26;e:do if(Hv){var Kv=Me[cr],Yv=0==(0|Kv);do if(!Yv){var Gv=Me[y];if(Gv>>>0>=Me[g]>>>0)break;Se[y]=Gv+1|0,Ae[Kv+Gv|0]=32;break e}while(0);Y(r,32)}while(0);var Wv=Me[cr],Zv=0==(0|Wv);do{if(!Zv){var Qv=Me[y],qv=Me[A],$v=Me[qv+8>>2];if(($v+Qv|0)>>>0>Me[g]>>>0){var Jv=qv,rt=$v;break}var at=Wv+Qv|0,et=Se[qv+4>>2];Pa(at,et,$v,1);var it=Se[y]+Se[Se[A]+8>>2]|0;Se[y]=it;break r}var vt=Me[A],Jv=vt,rt=Se[vt+8>>2]}while(0);var rt,Jv,tt=Se[Jv+4>>2];Q(r,tt,rt);break r}if(41==(0|Ir)){var E=(r+8|0)>>2,ft=Me[E];if((ft+9|0)>>>0>Me[Er+3]>>>0)Q(r,0|He.__str10180,9);else{for(var _t=Or+ft|0,ie=0|He.__str10180,ve=_t,te=ie+9;ie>2,ot=Me[p];if((ot+9|0)>>>0>Me[Er+3]>>>0)Q(r,0|He.__str10180,9);else{for(var lt=Or+ot|0,ie=0|He.__str10180,ve=lt,te=ie+9;ie>2],ct=42==(0|Se[ut>>2]);e:do if(ct){var w=(r+8|0)>>2,ht=Me[w],dt=r+12|0;ht>>>0>2]>>>0?(Se[w]=ht+1|0,Ae[Or+ht|0]=40):Y(r,40);var wt=Se[kt>>2];er(r,wt);var pt=Me[cr],Et=0==(0|pt);do if(!Et){var At=Me[w];if(At>>>0>=Me[dt>>2]>>>0)break;Se[w]=At+1|0,Ae[pt+At|0]=41;break e}while(0);Y(r,41)}else ir(r,ut);while(0);var gt=Me[cr],yt=0==(0|gt);do{if(!yt){var mt=r+8|0,St=Me[mt>>2];if(St>>>0>=Me[Er+3]>>>0){gr=232;break}Se[mt>>2]=St+1|0,Ae[gt+St|0]=40,gr=233;break}gr=232}while(0);232==gr&&Y(r,40);var Mt=Se[pr+2];H(r,Mt);var Ct=Me[cr],Rt=0==(0|Ct);do if(!Rt){var Tt=r+8|0,Ot=Me[Tt>>2];if(Ot>>>0>=Me[Er+3]>>>0)break;Se[Tt>>2]=Ot+1|0,Ae[Ct+Ot|0]=41;break r}while(0);Y(r,41);break r}if(44==(0|Ir)){var d=(a+8|0)>>2;if(45==(0|Se[Se[d]>>2])){var h=(a+4|0)>>2,Nt=Se[h],It=40==(0|Se[Nt>>2]);do if(It){var Pt=Se[Nt+4>>2];if(1!=(0|Se[Pt+8>>2]))break;if(Ae[Se[Pt+4>>2]]<<24>>24!=62)break;var Dt=r+8|0,Lt=Me[Dt>>2];Lt>>>0>>0?(Se[Dt>>2]=Lt+1|0,Ae[Or+Lt|0]=40):Y(r,40)}while(0);var Ft=Me[cr],Xt=0==(0|Ft);do{if(!Xt){var jt=r+8|0,Ut=Me[jt>>2];if(Ut>>>0>=Me[Er+3]>>>0){gr=248;break}Se[jt>>2]=Ut+1|0,Ae[Ft+Ut|0]=40,gr=249;break}gr=248}while(0);248==gr&&Y(r,40);var xt=Se[Se[d]+4>>2];H(r,xt);var zt=Me[cr],Vt=0==(0|zt);do{if(!Vt){var c=(r+8|0)>>2,Bt=Me[c];if((Bt+2|0)>>>0>Me[Er+3]>>>0){gr=252;break}var Ht=zt+Bt|0;oe=8233,Ae[Ht]=255&oe,oe>>=8,Ae[Ht+1]=255&oe;var Kt=Se[c]+2|0;Se[c]=Kt,gr=253;break}gr=252}while(0);252==gr&&Q(r,0|He.__str139,2);var Yt=Se[h];ir(r,Yt);var Gt=Me[cr],Wt=0==(0|Gt);do{if(!Wt){var u=(r+8|0)>>2,Zt=Me[u];if((Zt+2|0)>>>0>Me[Er+3]>>>0){gr=256;break}var Qt=Gt+Zt|0;oe=10272,Ae[Qt]=255&oe,oe>>=8,Ae[Qt+1]=255&oe;var qt=Se[u]+2|0;Se[u]=qt,gr=257;break}gr=256}while(0);256==gr&&Q(r,0|He.__str140,2);var $t=Se[Se[d]+8>>2];H(r,$t);var Jt=Me[cr],rf=0==(0|Jt);do{if(!rf){var af=r+8|0,ef=Me[af>>2];if(ef>>>0>=Me[Er+3]>>>0){gr=260;break}Se[af>>2]=ef+1|0,Ae[Jt+ef|0]=41,gr=261;break}gr=260}while(0);260==gr&&Y(r,41);var vf=Se[h];if(40!=(0|Se[vf>>2]))break r;var tf=Se[vf+4>>2];if(1!=(0|Se[tf+8>>2]))break r;if(Ae[Se[tf+4>>2]]<<24>>24!=62)break r;var ff=Me[cr],_f=0==(0|ff);do if(!_f){var sf=r+8|0,nf=Me[sf>>2];if(nf>>>0>=Me[Er+3]>>>0)break;Se[sf>>2]=nf+1|0,Ae[ff+nf|0]=41;break r}while(0);Y(r,41);break r}Z(r);break r}if(45==(0|Ir)){Z(r);break r}if(46==(0|Ir)){var of=a+4|0,k=(a+8|0)>>2,lf=Se[k],bf=47==(0|Se[lf>>2]);do if(bf){if(48!=(0|Se[Se[lf+8>>2]>>2]))break;var b=(r+8|0)>>2,kf=Me[b],l=(r+12|0)>>2;kf>>>0>>0?(Se[b]=kf+1|0,Ae[Or+kf|0]=40):Y(r,40);var uf=Se[Se[k]+4>>2];H(r,uf);var cf=Me[cr],hf=0==(0|cf);do{if(!hf){var df=Me[b];if((df+2|0)>>>0>Me[l]>>>0){gr=278;break}var wf=cf+df|0;oe=8233,Ae[wf]=255&oe,oe>>=8,Ae[wf+1]=255&oe;var pf=Se[b]+2|0;Se[b]=pf,gr=279;break}gr=278}while(0);278==gr&&Q(r,0|He.__str139,2);var Ef=Se[of>>2];ir(r,Ef);var Af=Me[cr],gf=0==(0|Af);do{if(!gf){var yf=Me[b];if((yf+2|0)>>>0>Me[l]>>>0){gr=282;break}var mf=Af+yf|0;oe=10272,Ae[mf]=255&oe,oe>>=8,Ae[mf+1]=255&oe;var Sf=Se[b]+2|0;Se[b]=Sf,gr=283;break}gr=282}while(0);282==gr&&Q(r,0|He.__str140,2);var Mf=Se[Se[Se[k]+8>>2]+4>>2];H(r,Mf);var Cf=Me[cr],Rf=0==(0|Cf);do{if(!Rf){var Tf=Me[b];if((Tf+5|0)>>>0>Me[l]>>>0){gr=286;break}var Of=Cf+Tf|0;Ae[Of]=Ae[0|He.__str141],Ae[Of+1]=Ae[(0|He.__str141)+1],Ae[Of+2]=Ae[(0|He.__str141)+2],Ae[Of+3]=Ae[(0|He.__str141)+3],Ae[Of+4]=Ae[(0|He.__str141)+4];var Nf=Se[b]+5|0;Se[b]=Nf,gr=287;break}gr=286}while(0);286==gr&&Q(r,0|He.__str141,5);var If=Se[Se[Se[k]+8>>2]+8>>2];H(r,If);var Pf=Me[cr],Df=0==(0|Pf);do if(!Df){var Lf=Me[b];if(Lf>>>0>=Me[l]>>>0)break;Se[b]=Lf+1|0,Ae[Pf+Lf|0]=41;break r}while(0);Y(r,41);break r}while(0);Z(r);break r}if(47==(0|Ir)||48==(0|Ir)){Z(r);break r}if(49==(0|Ir)||50==(0|Ir)){var Ff=a+4|0,Xf=Se[Ff>>2],jf=33==(0|Se[Xf>>2]);do{if(jf){var Uf=Me[Se[Xf+4>>2]+16>>2];if(1==(0|Uf)||2==(0|Uf)||3==(0|Uf)||4==(0|Uf)||5==(0|Uf)||6==(0|Uf)){var xf=a+8|0;if(0!=(0|Se[Se[xf>>2]>>2])){var zf=Uf;break}if(50==(0|Ir)){var Vf=r+8|0,Bf=Me[Vf>>2];Bf>>>0>>0?(Se[Vf>>2]=Bf+1|0,Ae[Or+Bf|0]=45):Y(r,45)}var Hf=Se[xf>>2];if(H(r,Hf),2==(0|Uf)){var Kf=Me[cr],Yf=0==(0|Kf);do if(!Yf){var Gf=r+8|0,Wf=Me[Gf>>2];if(Wf>>>0>=Me[Er+3]>>>0)break;Se[Gf>>2]=Wf+1|0,Ae[Kf+Wf|0]=117;break r}while(0);Y(r,117);break r}if(3==(0|Uf)){var Zf=Me[cr],Qf=0==(0|Zf);do if(!Qf){var qf=r+8|0,$f=Me[qf>>2];if($f>>>0>=Me[Er+3]>>>0)break;Se[qf>>2]=$f+1|0,Ae[Zf+$f|0]=108;break r}while(0);Y(r,108);break r}if(4==(0|Uf)){var Jf=Me[cr],r_=0==(0|Jf);do if(!r_){var o=(r+8|0)>>2,a_=Me[o];if((a_+2|0)>>>0>Me[Er+3]>>>0)break;var e_=Jf+a_|0;oe=27765,Ae[e_]=255&oe,oe>>=8,Ae[e_+1]=255&oe;var i_=Se[o]+2|0;Se[o]=i_;break r}while(0);Q(r,0|He.__str142,2);break r}if(5==(0|Uf)){var v_=Me[cr],t_=0==(0|v_);do if(!t_){var n=(r+8|0)>>2,f_=Me[n];if((f_+2|0)>>>0>Me[Er+3]>>>0)break;var __=v_+f_|0;oe=27756,Ae[__]=255&oe,oe>>=8,Ae[__+1]=255&oe;var s_=Se[n]+2|0;Se[n]=s_;break r}while(0);Q(r,0|He.__str143,2);break r}if(6==(0|Uf)){var n_=Me[cr],o_=0==(0|n_);do if(!o_){var s=(r+8|0)>>2,l_=Me[s];if((l_+3|0)>>>0>Me[Er+3]>>>0)break;var b_=n_+l_|0;Ae[b_]=Ae[0|He.__str144],Ae[b_+1]=Ae[(0|He.__str144)+1],Ae[b_+2]=Ae[(0|He.__str144)+2];var k_=Se[s]+3|0;Se[s]=k_;break r}while(0);Q(r,0|He.__str144,3);break r}break r}if(7==(0|Uf)){var _=Se[pr+2]>>2;if(0!=(0|Se[_])){var zf=7;break}if(!(1==(0|Se[_+2])&49==(0|Ir))){var zf=Uf;break}var u_=Ae[Se[_+1]]<<24>>24;if(48==(0|u_)){var f=(r+8|0)>>2,c_=Me[f];if((c_+5|0)>>>0>Me[Er+3]>>>0){Q(r,0|He.__str145,5);break r}var h_=Or+c_|0;Ae[h_]=Ae[0|He.__str145],Ae[h_+1]=Ae[(0|He.__str145)+1],Ae[h_+2]=Ae[(0|He.__str145)+2],Ae[h_+3]=Ae[(0|He.__str145)+3],Ae[h_+4]=Ae[(0|He.__str145)+4];var d_=Se[f]+5|0;Se[f]=d_;break r}if(49==(0|u_)){var t=(r+8|0)>>2,w_=Me[t];if((w_+4|0)>>>0>Me[Er+3]>>>0){Q(r,0|He.__str146,4);break r}var p_=Or+w_|0;oe=1702195828,Ae[p_]=255&oe,oe>>=8,Ae[p_+1]=255&oe,oe>>=8,Ae[p_+2]=255&oe,oe>>=8,Ae[p_+3]=255&oe;var E_=Se[t]+4|0;Se[t]=E_;break r}var zf=Uf;break}var zf=Uf;break}var zf=0}while(0);var zf,v=(r+8|0)>>2,A_=Me[v],i=(r+12|0)>>2;A_>>>0>>0?(Se[v]=A_+1|0,Ae[Or+A_|0]=40):Y(r,40);var g_=Se[Ff>>2];H(r,g_);var y_=Me[cr],m_=0==(0|y_);do{if(!m_){var S_=Me[v];if(S_>>>0>=Me[i]>>>0){gr=335;break}Se[v]=S_+1|0,Ae[y_+S_|0]=41,gr=336;break}gr=335}while(0);335==gr&&Y(r,41);var M_=50==(0|Se[Nr>>2]);e:do if(M_){var C_=Me[cr],R_=0==(0|C_);do if(!R_){var T_=Me[v];if(T_>>>0>=Me[i]>>>0)break;Se[v]=T_+1|0,Ae[C_+T_|0]=45;break e}while(0);Y(r,45)}while(0);if(8==(0|zf)){var O_=Me[cr],N_=0==(0|O_);do{if(!N_){var I_=Me[v];if(I_>>>0>=Me[i]>>>0){gr=345;break}Se[v]=I_+1|0,Ae[O_+I_|0]=91,gr=346;break}gr=345}while(0);345==gr&&Y(r,91);var P_=Se[pr+2];H(r,P_);var D_=Me[cr],L_=0==(0|D_);do if(!L_){var F_=Me[v];if(F_>>>0>=Me[i]>>>0)break;Se[v]=F_+1|0,Ae[D_+F_|0]=93;break r}while(0);Y(r,93);break r}var X_=Se[pr+2];H(r,X_);break r}Z(r);break r}}while(0);var e=(r+20|0)>>2,j_=Se[e],U_=0|Sr;Se[U_>>2]=j_,Se[e]=Sr,Se[Sr+4>>2]=a;var x_=Sr+8|0;Se[x_>>2]=0;var z_=Se[Er+4];Se[Sr+12>>2]=z_;var V_=Se[pr+1];H(r,V_),0==(0|Se[x_>>2])&&$(r,a);var B_=Se[U_>>2];Se[e]=B_}while(0);Oe=Ar}function K(r,a,e,i){var v=i>>2;Se[v]=r,Se[v+1]=r+e|0,Se[v+2]=a,Se[v+3]=r,Se[v+6]=e<<1,Se[v+5]=0,Se[v+9]=e,Se[v+8]=0,Se[v+10]=0,Se[v+11]=0,Se[v+12]=0}function Y(r,a){var e,i=r+4|0,v=Me[i>>2],t=0==(0|v);do if(!t){var e=(r+8|0)>>2,f=Me[e];if(f>>>0>2]>>>0)var _=v,s=f;else{tr(r,1);var n=Me[i>>2];if(0==(0|n))break;var _=n,s=Se[e]}var s,_;Ae[_+s|0]=255&a;var o=Se[e]+1|0;Se[e]=o}while(0)}function G(r,a,e,i){var v,t=i>>2,f=Oe;Oe+=4;var _=f,v=_>>2,s=0==(0|r);do if(s){if(0==(0|i)){var n=0;break}Se[t]=-3;var n=0}else{var o=0==(0|e);if(0!=(0|a)&o){if(0==(0|i)){var n=0;break}Se[t]=-3;var n=0}else{var l=W(r,_);if(0==(0|l)){if(0==(0|i)){var n=0;break}if(1==(0|Se[v])){Se[t]=-1;var n=0}else{Se[t]=-2;var n=0}}else{var b=0==(0|a);do if(b){if(o){var k=l;break}var u=Se[v];Se[e>>2]=u;var k=l}else{var c=Ca(l);if(c>>>0>2]>>>0){Ra(a,l);va(l);var k=a}else{va(a);var h=Se[v];Se[e>>2]=h;var k=l}}while(0);var k;if(0==(0|i)){var n=k;break}Se[t]=0;var n=k}}}while(0);var n;return Oe=f,n}function W(r,a){var e,i=Oe;Oe+=52;var v,t=i,e=t>>2;Se[a>>2]=0;var f=Ca(r),_=Ae[r]<<24>>24==95;do{if(_){if(Ae[r+1|0]<<24>>24==90){var s=0;v=13;break}v=3;break}v=3}while(0);do if(3==v){var n=Na(r,0|He.__str117,8);if(0!=(0|n)){var s=1;v=13;break}var o=Ae[r+8|0];if(o<<24>>24!=46&&o<<24>>24!=95&&o<<24>>24!=36){var s=1;v=13;break}var l=r+9|0,b=Ae[l];if(b<<24>>24!=68&&b<<24>>24!=73){ -var s=1;v=13;break}if(Ae[r+10|0]<<24>>24!=95){var s=1;v=13;break}var k=f+29|0,u=Jr(k);if(0==(0|u)){Se[a>>2]=1;var c=0;v=19;break}Ae[l]<<24>>24==73?Pa(u,0|He.__str118,30,1):Pa(u,0|He.__str119,29,1);var h=r+11|0,c=(Ia(u,h),u);v=19;break}while(0);if(13==v){var s;K(r,17,f,t);var d=Se[e+6],w=Ta(),p=Oe;Oe+=12*d,Oe=Oe+3>>2<<2;var E=Oe;if(Oe+=4*Se[e+9],Oe=Oe+3>>2<<2,Se[e+4]=p,Se[e+7]=E,s)var A=N(t),g=A;else var y=T(t,1),g=y;var g,m=Ae[Se[e+3]]<<24>>24==0?g:0,S=Se[e+12]+f+10*Se[e+10]|0;if(0==(0|m))var M=0;else var C=S/8+S|0,R=B(17,m,C,a),M=R;var M;Oa(w);var c=M}var c;return Oe=i,c}function Z(r){var a=r+4|0,e=Se[a>>2];va(e),Se[a>>2]=0}function Q(r,a,e){var i,v=r+4|0,t=Me[v>>2],f=0==(0|t);do if(!f){var i=(r+8|0)>>2,_=Me[i];if((_+e|0)>>>0>Me[r+12>>2]>>>0){tr(r,e);var s=Me[v>>2];if(0==(0|s))break;var n=s,o=Se[i]}else var n=t,o=_;var o,n;Pa(n+o|0,a,e,1);var l=Se[i]+e|0;Se[i]=l}while(0)}function q(r,a,e){var i,v,t=a+e|0,f=(0|e)>0;r:do if(f)for(var _=t,s=r+4|0,i=(r+8|0)>>2,n=r+12|0,o=a;;){var o,l=(_-o|0)>3;a:do{if(l){if(Ae[o]<<24>>24!=95){v=21;break}if(Ae[o+1|0]<<24>>24!=95){v=21;break}if(Ae[o+2|0]<<24>>24!=85){v=21;break}for(var b=o+3|0,k=0;;){var k,b;if(b>>>0>=t>>>0){v=21;break a}var u=ge[b],c=u<<24>>24;if((u-48&255&255)<10)var h=c-48|0;else if((u-65&255&255)<6)var h=c-55|0;else{if((u-97&255&255)>=6)break;var h=c-87|0}var h,b=b+1|0,k=(k<<4)+h|0}if(!(u<<24>>24==95&k>>>0<256)){v=21;break}var d=Me[s>>2],w=0==(0|d);do if(!w){var p=Me[i];if(p>>>0>=Me[n>>2]>>>0)break;Se[i]=p+1|0,Ae[d+p|0]=255&k;var E=b;v=25;break a}while(0);Y(r,k);var E=b;v=25;break}v=21}while(0);a:do if(21==v){var A=Me[s>>2],g=0==(0|A);do if(!g){var y=Me[i];if(y>>>0>=Me[n>>2]>>>0)break;var m=Ae[o];Se[i]=y+1|0,Ae[A+y|0]=m;var E=o;break a}while(0);var S=Ae[o]<<24>>24;Y(r,S);var E=o}while(0);var E,M=E+1|0;if(M>>>0>=t>>>0)break r;var o=M}while(0)}function $(r,a){var e,i,v,t,f,_,s,n=r>>2,o=Se[a>>2];r:do if(22==(0|o)||25==(0|o)){var l=Me[n+1],b=0==(0|l);do if(!b){var _=(r+8|0)>>2,k=Me[_];if((k+9|0)>>>0>Me[n+3]>>>0)break;for(var u=l+k|0,c=0|He.__str147,h=u,d=c+9;c>2,A=Me[f];if((A+9|0)>>>0>Me[n+3]>>>0)break;for(var g=p+A|0,c=0|He.__str148,h=g,d=c+9;c>2,M=Me[t];if((M+6|0)>>>0>Me[n+3]>>>0)break;var C=m+M|0;Ae[C]=Ae[0|He.__str149],Ae[C+1]=Ae[(0|He.__str149)+1],Ae[C+2]=Ae[(0|He.__str149)+2],Ae[C+3]=Ae[(0|He.__str149)+3],Ae[C+4]=Ae[(0|He.__str149)+4],Ae[C+5]=Ae[(0|He.__str149)+5];var R=Se[t]+6|0;Se[t]=R;break r}while(0);Q(r,0|He.__str149,6)}else if(28==(0|o)){var T=Me[n+1],O=0==(0|T);do{if(!O){var N=r+8|0,I=Me[N>>2];if(I>>>0>=Me[n+3]>>>0){s=17;break}Se[N>>2]=I+1|0,Ae[T+I|0]=32,s=18;break}s=17}while(0);17==s&&Y(r,32);var P=Se[a+8>>2];H(r,P)}else if(29==(0|o)){if(0!=(4&Se[n]|0))break;var D=Me[n+1],L=0==(0|D);do if(!L){var F=r+8|0,X=Me[F>>2];if(X>>>0>=Me[n+3]>>>0)break;Se[F>>2]=X+1|0,Ae[D+X|0]=42;break r}while(0);Y(r,42)}else if(30==(0|o)){var j=Me[n+1],U=0==(0|j);do if(!U){var x=r+8|0,z=Me[x>>2];if(z>>>0>=Me[n+3]>>>0)break;Se[x>>2]=z+1|0,Ae[j+z|0]=38;break r}while(0);Y(r,38)}else if(31==(0|o)){var V=Me[n+1],B=0==(0|V);do if(!B){var v=(r+8|0)>>2,K=Me[v];if((K+8|0)>>>0>Me[n+3]>>>0)break;var G=V+K|0,W=0|G;oe=1886220131,Ae[W]=255&oe,oe>>=8,Ae[W+1]=255&oe,oe>>=8,Ae[W+2]=255&oe,oe>>=8,Ae[W+3]=255&oe;var Z=G+4|0;oe=544761196,Ae[Z]=255&oe,oe>>=8,Ae[Z+1]=255&oe,oe>>=8,Ae[Z+2]=255&oe,oe>>=8,Ae[Z+3]=255&oe;var q=Se[v]+8|0;Se[v]=q;break r}while(0);Q(r,0|He.__str150,8)}else if(32==(0|o)){var $=Me[n+1],J=0==(0|$);do if(!J){var i=(r+8|0)>>2,rr=Me[i];if((rr+10|0)>>>0>Me[n+3]>>>0)break;for(var ar=$+rr|0,c=0|He.__str151,h=ar,d=c+10;c>2],tr=0==(0|vr);do{if(!tr){var fr=r+8|0,_r=Me[fr>>2];if(0!=(0|_r)&&Ae[vr+(_r-1)|0]<<24>>24==40){s=42;break}if(_r>>>0>=Me[n+3]>>>0){s=41;break}Se[fr>>2]=_r+1|0,Ae[vr+_r|0]=32,s=42;break}s=41}while(0);41==s&&Y(r,32);var sr=Se[a+4>>2];H(r,sr);var nr=Me[ir>>2],or=0==(0|nr);do if(!or){var e=(r+8|0)>>2,lr=Me[e];if((lr+3|0)>>>0>Me[n+3]>>>0)break;var br=nr+lr|0;Ae[br]=Ae[0|He.__str135],Ae[br+1]=Ae[(0|He.__str135)+1],Ae[br+2]=Ae[(0|He.__str135)+2];var kr=Se[e]+3|0;Se[e]=kr;break r}while(0);Q(r,0|He.__str135,3)}else if(3==(0|o)){var ur=Se[a+4>>2];H(r,ur)}else H(r,a);while(0)}function J(r){var a=r+20|0,e=Se[a>>2];if((0|e)<(0|Se[r+24>>2])){var i=Se[r+16>>2]+12*e|0,v=e+1|0;Se[a>>2]=v;var t=i}else var t=0;var t;return t}function rr(r,a,e){var i,v,t,f,_=r>>2,s=e,t=s>>2,n=0;r:for(;;){var n,s,o=0==(0|s);do if(!o){if(0!=(0|Se[t+2]))break;var l=Se[Se[t+1]>>2];if(29==(0|l)||30==(0|l)){f=9;break r}if(22==(0|l)||23==(0|l)||24==(0|l)||28==(0|l)||31==(0|l)||32==(0|l)||37==(0|l)){var b=Se[_+1];f=12;break r}var s=Se[t],t=s>>2,n=1;continue r}while(0);if(0!=(0|Se[a+4>>2])&0==(0|n)){f=9;break}var k=0,u=r+4|0,v=u>>2;f=22;break}do if(9==f){var c=Se[_+1];if(0==(0|c)){f=17;break}var h=Se[_+2];if(0==(0|h)){var d=c;f=13;break}var w=Ae[c+(h-1)|0];if(w<<24>>24==40||w<<24>>24==42){f=18;break}var b=c;f=12;break}while(0);do if(12==f){var b;if(0==(0|b)){f=17;break}var d=b;f=13;break}while(0);do if(13==f){var d,p=r+8|0,E=Me[p>>2];if(0!=(0|E)&&Ae[d+(E-1)|0]<<24>>24==32){f=18;break}if(E>>>0>=Me[_+3]>>>0){f=17;break}Se[p>>2]=E+1|0,Ae[d+E|0]=32,f=18;break}while(0);do if(17==f){Y(r,32),f=18;break}while(0);r:do if(18==f){var A=r+4|0,g=Me[A>>2],y=0==(0|g);do if(!y){var m=r+8|0,S=Me[m>>2];if(S>>>0>=Me[_+3]>>>0)break;Se[m>>2]=S+1|0,Ae[g+S|0]=40;var k=1,u=A,v=u>>2;break r}while(0);Y(r,40);var k=1,u=A,v=u>>2}while(0);var u,k,i=(r+20|0)>>2,M=Se[i];Se[i]=0,vr(r,e,0);r:do if(k){var C=Me[v],R=0==(0|C);do if(!R){var T=r+8|0,O=Me[T>>2];if(O>>>0>=Me[_+3]>>>0)break;Se[T>>2]=O+1|0,Ae[C+O|0]=41;break r}while(0);Y(r,41)}while(0);var N=Me[v],I=0==(0|N);do{if(!I){var P=r+8|0,D=Me[P>>2];if(D>>>0>=Me[_+3]>>>0){f=30;break}Se[P>>2]=D+1|0,Ae[N+D|0]=40,f=31;break}f=30}while(0);30==f&&Y(r,40);var L=Se[a+8>>2];0!=(0|L)&&H(r,L);var F=Me[v],X=0==(0|F);do{if(!X){var j=r+8|0,U=Me[j>>2];if(U>>>0>=Me[_+3]>>>0){f=36;break}Se[j>>2]=U+1|0,Ae[F+U|0]=41,f=37;break}f=36}while(0);36==f&&Y(r,41),vr(r,e,1),Se[i]=M}function ar(r,a,e){var i,v,t,f=r>>2,_=0==(0|e);do{if(!_){var s=e,v=s>>2;r:for(;;){var s;if(0==(0|s)){var n=1;t=14;break}if(0==(0|Se[v+2])){var o=36==(0|Se[Se[v+1]>>2]),l=1&o^1;if(o){var n=l;t=14;break}var b=r+4|0,k=Me[b>>2],u=0==(0|k);do{if(!u){var i=(r+8|0)>>2,c=Me[i];if((c+2|0)>>>0>Me[f+3]>>>0){t=9;break}var h=k+c|0;oe=10272,Ae[h]=255&oe,oe>>=8,Ae[h+1]=255&oe;var d=Se[i]+2|0;Se[i]=d,vr(r,e,0),t=10;break}t=9}while(0);9==t&&(Q(r,0|He.__str140,2),vr(r,e,0));var w=Me[b>>2],p=0==(0|w);do if(!p){var E=r+8|0,A=Me[E>>2];if(A>>>0>=Me[f+3]>>>0)break;Se[E>>2]=A+1|0,Ae[w+A|0]=41;var g=l;t=15;break r}while(0);Y(r,41);var g=l;t=15;break}var s=Se[v],v=s>>2}if(14==t){var n;vr(r,e,0);var g=n}var g;if(0!=(0|g)){t=17;break}var y=r+4|0;t=21;break}t=17}while(0);r:do if(17==t){var m=r+4|0,S=Me[m>>2],M=0==(0|S);do if(!M){var C=r+8|0,R=Me[C>>2];if(R>>>0>=Me[f+3]>>>0)break;Se[C>>2]=R+1|0,Ae[S+R|0]=32;var y=m;break r}while(0);Y(r,32);var y=m}while(0);var y,T=Me[y>>2],O=0==(0|T);do{if(!O){var N=r+8|0,I=Me[N>>2];if(I>>>0>=Me[f+3]>>>0){t=24;break}Se[N>>2]=I+1|0,Ae[T+I|0]=91,t=25;break}t=24}while(0);24==t&&Y(r,91);var P=Se[a+4>>2];0!=(0|P)&&H(r,P);var D=Me[y>>2],L=0==(0|D);do{if(!L){var F=r+8|0,X=Me[F>>2];if(X>>>0>=Me[f+3]>>>0){t=30;break}Se[F>>2]=X+1|0,Ae[D+X|0]=93,t=31;break}t=30}while(0);30==t&&Y(r,93)}function er(r,a){var e,i,v,t,f,_,s=Oe;Oe+=8;var n,o=s,_=(a+4|0)>>2,l=Se[_];if(4==(0|Se[l>>2])){var f=(r+20|0)>>2,b=Se[f];Se[f]=0;var t=(r+16|0)>>2,k=Se[t],u=0|o;Se[u>>2]=k,Se[t]=o;var c=Se[_];Se[o+4>>2]=c;var h=Se[c+4>>2];H(r,h);var d=Se[u>>2];Se[t]=d;var v=(r+4|0)>>2,w=Me[v],p=0==(0|w);do{if(!p){var i=(r+8|0)>>2,E=Me[i],A=0==(0|E);do if(!A){if(Ae[w+(E-1)|0]<<24>>24!=60)break;E>>>0>2]>>>0?(Se[i]=E+1|0,Ae[w+E|0]=32):Y(r,32)}while(0);var g=Me[v];if(0==(0|g)){n=12;break}var y=Me[i];if(y>>>0>=Me[r+12>>2]>>>0){n=12;break}Se[i]=y+1|0,Ae[g+y|0]=60,n=13;break}n=12}while(0);12==n&&Y(r,60);var m=Se[Se[_]+8>>2];H(r,m);var S=Me[v],M=0==(0|S);do{if(!M){var e=(r+8|0)>>2,C=Me[e],R=0==(0|C);do if(!R){if(Ae[S+(C-1)|0]<<24>>24!=62)break;C>>>0>2]>>>0?(Se[e]=C+1|0,Ae[S+C|0]=32):Y(r,32)}while(0);var T=Me[v];if(0==(0|T)){n=22;break}var O=Me[e];if(O>>>0>=Me[r+12>>2]>>>0){n=22;break}Se[e]=O+1|0,Ae[T+O|0]=62,n=23;break}n=22}while(0);22==n&&Y(r,62),Se[f]=b}else H(r,l);Oe=s}function ir(r,a){var e,i=40==(0|Se[a>>2]);r:do if(i){var v=Me[r+4>>2],t=0==(0|v);do{if(!t){var e=(r+8|0)>>2,f=Me[e],_=a+4|0,s=Me[_>>2],n=Me[s+8>>2];if((n+f|0)>>>0>Me[r+12>>2]>>>0){var o=s,l=n;break}var b=v+f|0,k=Se[s+4>>2];Pa(b,k,n,1);var u=Se[e]+Se[Se[_>>2]+8>>2]|0;Se[e]=u;break r}var c=Me[a+4>>2],o=c,l=Se[c+8>>2]}while(0);var l,o,h=Se[o+4>>2];Q(r,h,l)}else H(r,a);while(0)}function vr(r,a,e){var i,v,t,f,_,f=(r+4|0)>>2,s=0==(0|e),t=(r+16|0)>>2;r:do if(s)for(var n=a;;){var n;if(0==(0|n)){_=29;break r}if(0==(0|Se[f])){_=29;break r}var o=n+8|0,l=0==(0|Se[o>>2]);do if(l){var b=n+4|0;if((Se[Se[b>>2]>>2]-25|0)>>>0<3)break;Se[o>>2]=1;var k=Me[t],u=Se[n+12>>2];Se[t]=u;var c=Me[b>>2],h=Se[c>>2];if(35==(0|h)){var d=n,w=k,p=c;_=14;break r}if(36==(0|h)){var E=n,A=k,g=c;_=15;break r}if(2==(0|h)){var y=k,m=b;_=16;break r}$(r,c),Se[t]=k}while(0);var n=Se[n>>2]}else for(var S=a;;){var S;if(0==(0|S)){_=29;break r}if(0==(0|Se[f])){_=29;break r}var M=S+8|0;if(0==(0|Se[M>>2])){Se[M>>2]=1;var C=Me[t],R=Se[S+12>>2];Se[t]=R;var T=S+4|0,O=Me[T>>2],N=Se[O>>2];if(35==(0|N)){var d=S,w=C,p=O;_=14;break r}if(36==(0|N)){var E=S,A=C,g=O;_=15;break r}if(2==(0|N)){var y=C,m=T;_=16;break r}$(r,O),Se[t]=C}var S=Se[S>>2]}while(0);if(14==_){var p,w,d,I=Se[d>>2];rr(r,p,I),Se[t]=w}else if(15==_){var g,A,E,P=Se[E>>2];ar(r,g,P),Se[t]=A}else if(16==_){var m,y,v=(r+20|0)>>2,D=Se[v];Se[v]=0;var L=Se[Se[m>>2]+4>>2];H(r,L),Se[v]=D;var F=0==(4&Se[r>>2]|0),X=Me[f],j=0!=(0|X);r:do if(F){do if(j){var i=(r+8|0)>>2,U=Me[i];if((U+2|0)>>>0>Me[r+12>>2]>>>0)break;var x=X+U|0;oe=14906,Ae[x]=255&oe,oe>>=8,Ae[x+1]=255&oe;var z=Se[i]+2|0;Se[i]=z;break r}while(0);Q(r,0|He.__str120,2)}else{do if(j){var V=r+8|0,B=Me[V>>2];if(B>>>0>=Me[r+12>>2]>>>0)break;Se[V>>2]=B+1|0,Ae[X+B|0]=46;break r}while(0);Y(r,46)}while(0);var K=Me[Se[m>>2]+8>>2],G=(Se[K>>2]-25|0)>>>0<3;r:do if(G)for(var W=K;;){var W,Z=Me[W+4>>2];if((Se[Z>>2]-25|0)>>>0>=3){var q=Z;break r}var W=Z}else var q=K;while(0);var q;H(r,q),Se[t]=y}}function tr(r,a){var e,e=(r+4|0)>>2,i=Se[e],v=0==(0|i);r:do if(!v){for(var t=Se[r+8>>2]+a|0,f=r+12|0,_=Se[f>>2],s=i;;){var s,_;if(t>>>0<=_>>>0)break r;var n=_<<1,o=fa(s,n);if(0==(0|o))break;Se[e]=o,Se[f>>2]=n;var _=n,s=o}var l=Se[e];va(l),Se[e]=0,Se[r+24>>2]=1}while(0)}function fr(r,a,e){var i,v=J(r),i=v>>2;return 0!=(0|v)&&(Se[i]=21,Se[i+1]=a,Se[i+2]=e),v}function _r(r){var a,a=(r+12|0)>>2,e=Se[a],i=Ae[e]<<24>>24;if(88==(0|i)){var v=e+1|0;Se[a]=v;var t=nr(r),f=Se[a],_=f+1|0;Se[a]=_;var s=Ae[f]<<24>>24==69?t:0,n=s}else if(76==(0|i))var o=or(r),n=o;else var l=N(r),n=l;var n;return n}function sr(r){var a,a=(r+12|0)>>2,e=Se[a],i=Ae[e];if(i<<24>>24==110){var v=e+1|0;Se[a]=v;var t=1,f=Ae[v],_=v}else var t=0,f=i,_=e;var _,f,t,s=(f-48&255&255)<10;r:do if(s)for(var n=f,o=0,l=_;;){var l,o,n,b=(n<<24>>24)-48+10*o|0,k=l+1|0;Se[a]=k;var u=ge[k];if((u-48&255&255)>=10){var c=b;break r}var n=u,o=b,l=k}else var c=0;while(0);var c,h=0==(0|t)?c:0|-c;return h}function nr(r){var a,e,a=(r+12|0)>>2,i=Se[a],v=Ae[i];do{if(v<<24>>24==76){var t=or(r),f=t;e=21;break}if(v<<24>>24==84){var _=x(r),f=_;e=21;break}if(v<<24>>24==115){if(Ae[i+1|0]<<24>>24!=114){e=8;break}var s=i+2|0;Se[a]=s;var n=N(r),o=br(r);if(Ae[Se[a]]<<24>>24==73){var l=z(r),b=D(r,4,o,l),k=D(r,1,n,b),f=k;e=21;break}var u=D(r,1,n,o),f=u;e=21;break}e=8}while(0);r:do if(8==e){var c=kr(r);if(0==(0|c)){var f=0;break}var h=0|c,d=Se[h>>2],w=40==(0|d);do{if(w){var p=c+4|0,E=r+48|0,A=Se[Se[p>>2]+8>>2]-2+Se[E>>2]|0;Se[E>>2]=A;var g=Se[h>>2];if(40!=(0|g)){var y=g;e=13;break}var m=Se[p>>2],S=Se[m>>2],M=Da(S,0|He.__str90);if(0!=(0|M)){var C=m;e=15;break}var R=N(r),T=D(r,43,c,R),f=T;break r}var y=d;e=13}while(0);do if(13==e){var y;if(40==(0|y)){var C=Se[c+4>>2];e=15;break}if(41==(0|y)){var O=c+4|0;e=17;break}if(42==(0|y)){e=18;break}var f=0;break r}while(0);do if(15==e){var C,O=C+12|0;e=17;break}while(0);do if(17==e){var O,I=Se[O>>2];if(1==(0|I))break;if(2==(0|I)){var P=nr(r),L=nr(r),F=D(r,45,P,L),X=D(r,44,c,F);return X}if(3==(0|I)){var j=nr(r),U=nr(r),V=nr(r),B=D(r,48,U,V),H=D(r,47,j,B),K=D(r,46,c,H);return K}var f=0;break r}while(0);var Y=nr(r),G=D(r,43,c,Y);return G}while(0);var f;return f}function or(r){var a,a=(r+12|0)>>2,e=Se[a],i=e+1|0;Se[a]=i;var v=Ae[e]<<24>>24==76;r:do if(v){if(Ae[i]<<24>>24==95)var t=T(r,0),f=t;else{var _=N(r);if(0==(0|_)){var s=0;break}var n=33==(0|Se[_>>2]);do if(n){var o=Se[_+4>>2];if(0==(0|Se[o+16>>2]))break;var l=r+48|0,b=Se[l>>2]-Se[o+4>>2]|0;Se[l>>2]=b}while(0);var k=Se[a];if(Ae[k]<<24>>24==110){var u=k+1|0;Se[a]=u;var c=50,h=u}else var c=49,h=k;for(var h,c,d=h;;){var d,w=Ae[d];if(w<<24>>24==69)break;if(w<<24>>24==0){var s=0;break r}var p=d+1|0;Se[a]=p;var d=p}var E=lr(r,h,d-h|0),A=D(r,c,_,E),f=A}var f,g=Se[a],y=g+1|0;Se[a]=y;var m=Ae[g]<<24>>24==69?f:0,s=m}else var s=0;while(0);var s;return s}function lr(r,a,e){var i=J(r),v=m(i,a,e),t=0==(0|v)?0:i;return t}function br(r){var a=r+12|0,e=Me[a>>2],i=ge[e],v=(i-48&255&255)<10;do if(v)var t=L(r),f=t;else if((i-97&255&255)<26){var _=kr(r);if(0==(0|_)){var f=0;break}if(40!=(0|Se[_>>2])){var f=_;break}var s=r+48|0,n=Se[Se[_+4>>2]+8>>2]+Se[s>>2]+7|0;Se[s>>2]=n;var f=_}else if(i<<24>>24==67||i<<24>>24==68)var o=hr(r),f=o;else{if(i<<24>>24!=76){var f=0;break}Se[a>>2]=e+1|0;var l=L(r);if(0==(0|l)){var f=0;break}var b=dr(r),k=0==(0|b)?0:l,f=k}while(0);var f;return f}function kr(r){var a,e,a=(r+12|0)>>2,i=Se[a],v=i+1|0;Se[a]=v;var t=ge[i],f=i+2|0;Se[a]=f;var _=ge[v];do{if(t<<24>>24==118){if((_-48&255&255)>=10){var s=49,n=0;e=6;break}var o=(_<<24>>24)-48|0,l=L(r),b=ur(r,o,l),k=b;e=14;break}if(t<<24>>24==99){if(_<<24>>24!=118){var s=49,n=0;e=6;break}var u=N(r),c=D(r,42,u,0),k=c;e=14;break}var s=49,n=0;e=6}while(0);r:do if(6==e){for(;;){var n,s,h=(s-n)/2+n|0,d=(h<<4)+ri|0,w=Se[d>>2],p=Ae[w],E=t<<24>>24==p<<24>>24;if(E&&_<<24>>24==Ae[w+1|0]<<24>>24)break;var A=t<<24>>24>24;do if(A)var g=h,y=n;else{if(E&&_<<24>>24>24){var g=h,y=n;break}var g=s,y=h+1|0}while(0);var y,g;if((0|y)==(0|g)){var k=0;break r}var s=g,n=y}var m=cr(r,d),k=m}while(0);var k;return k}function ur(r,a,e){var i=J(r),v=S(i,a,e),t=0==(0|v)?0:i;return t}function cr(r,a){var e=J(r);return 0!=(0|e)&&(Se[e>>2]=40,Se[e+4>>2]=a),e}function hr(r){var a,e,i=Se[r+44>>2],e=i>>2,v=0==(0|i);do if(!v){var t=Se[e];if(0==(0|t)){var f=r+48|0,_=Se[f>>2]+Se[e+2]|0;Se[f>>2]=_}else{if(21!=(0|t))break;var s=r+48|0,n=Se[s>>2]+Se[e+2]|0;Se[s>>2]=n}}while(0);var a=(r+12|0)>>2,o=Se[a],l=o+1|0;Se[a]=l;var b=Ae[o]<<24>>24;do if(67==(0|b)){var k=o+2|0;Se[a]=k;var u=Ae[l]<<24>>24;if(49==(0|u))var c=1;else if(50==(0|u))var c=2;else{if(51!=(0|u)){var h=0;break}var c=3}var c,d=wr(r,c,i),h=d}else if(68==(0|b)){var w=o+2|0;Se[a]=w;var p=Ae[l]<<24>>24;if(48==(0|p))var E=1;else if(49==(0|p))var E=2;else{if(50!=(0|p)){var h=0;break}var E=3}var E,A=pr(r,E,i),h=A}else var h=0;while(0);var h;return h}function dr(r){var a=r+12|0,e=Se[a>>2];if(Ae[e]<<24>>24==95){var i=e+1|0;Se[a>>2]=i;var v=sr(r),t=v>>>31^1}else var t=1;var t;return t}function wr(r,a,e){var i=J(r),v=M(i,a,e),t=0==(0|v)?0:i;return t}function pr(r,a,e){var i=J(r),v=C(i,a,e),t=0==(0|v)?0:i;return t}function Er(r,a){var e=J(r);return 0!=(0|e)&&(Se[e>>2]=5,Se[e+4>>2]=a),e}function Ar(r){var a,a=(r+12|0)>>2,e=Se[a],i=Ae[e]<<24>>24;do if(78==(0|i))var v=gr(r),t=v;else if(90==(0|i))var f=yr(r),t=f;else if(76==(0|i))var _=br(r),t=_;else if(83==(0|i)){if(Ae[e+1|0]<<24>>24==116){var s=e+2|0;Se[a]=s;var n=lr(r,0|He.__str152,3),o=br(r),l=D(r,1,n,o),b=r+48|0,k=Se[b>>2]+3|0;Se[b>>2]=k;var u=0,c=l}else var h=V(r,0),u=1,c=h;var c,u;if(Ae[Se[a]]<<24>>24!=73){var t=c;break}if(0==(0|u)){var d=R(r,c);if(0==(0|d)){var t=0;break}}var w=z(r),p=D(r,4,c,w),t=p}else{var E=br(r);if(Ae[Se[a]]<<24>>24!=73){var t=E;break}var A=R(r,E);if(0==(0|A)){var t=0;break}var g=z(r),y=D(r,4,E,g),t=y}while(0);var t;return t}function gr(r){var a,e=Oe;Oe+=4;var i=e,a=(r+12|0)>>2,v=Se[a],t=v+1|0;Se[a]=t;var f=Ae[v]<<24>>24==78;do if(f){var _=I(r,i,1);if(0==(0|_)){var s=0;break}var n=mr(r);if(Se[_>>2]=n,0==(0|n)){var s=0;break}var o=Se[a],l=o+1|0;if(Se[a]=l,Ae[o]<<24>>24!=69){var s=0;break}var s=Se[i>>2]}else var s=0;while(0);var s;return Oe=e,s}function yr(r){var a,a=(r+12|0)>>2,e=Se[a],i=e+1|0;Se[a]=i;var v=Ae[e]<<24>>24==90;do if(v){var t=O(r,0),f=Se[a],_=f+1|0;if(Se[a]=_,Ae[f]<<24>>24!=69){var s=0;break}if(Ae[_]<<24>>24==115){var n=f+2|0;Se[a]=n;var o=dr(r);if(0==(0|o)){var s=0;break}var l=lr(r,0|He.__str168,14),b=D(r,2,t,l),s=b}else{var k=Ar(r),u=dr(r);if(0==(0|u)){var s=0;break}var c=D(r,2,t,k),s=c}}else var s=0;while(0);var s;return s}function mr(r){var a,e=r+12|0,i=0;r:for(;;){var i,v=ge[Se[e>>2]];if(v<<24>>24==0){var t=0;break}var f=(v-48&255&255)<10|(v-97&255&255)<26;do{if(!f){if(v<<24>>24==76||v<<24>>24==68||v<<24>>24==67){a=5;break}if(v<<24>>24==83){var _=V(r,1),s=_;a=10;break}if(v<<24>>24==73){if(0==(0|i)){var t=0;break r}var n=z(r),o=4,l=n;a=11;break}if(v<<24>>24==84){var b=x(r),s=b;a=10;break}if(v<<24>>24==69){var t=i;break r}var t=0;break r}a=5}while(0);do if(5==a){var k=br(r),s=k;a=10;break}while(0);do if(10==a){var s;if(0==(0|i)){var u=s;a=12;break}var o=1,l=s;a=11;break}while(0);if(11==a)var l,o,c=D(r,o,i,l),u=c;var u;if(v<<24>>24!=83)if(Ae[Se[e>>2]]<<24>>24!=69){var h=R(r,u);if(0==(0|h)){var t=0;break}var i=u}else var i=u;else var i=u}var t;return t}function Sr(r,a){var e,i,v=Oe;Oe+=4;var t=v,i=t>>2,e=(r+12|0)>>2,f=Se[e];if(Ae[f]<<24>>24==74){var _=f+1|0;Se[e]=_;var s=1}else var s=a;var s;Se[i]=0;var n=s,o=0,l=t;r:for(;;)for(var l,o,n,b=n,k=o;;){var k,b,u=Ae[Se[e]];if(u<<24>>24==0||u<<24>>24==69){var c=Se[i];if(0==(0|c)){var h=0;break r}var d=0==(0|Se[c+8>>2]);do if(d){var w=Se[c+4>>2];if(33!=(0|Se[w>>2])){var p=c;break}var E=Se[w+4>>2];if(9!=(0|Se[E+16>>2])){var p=c;break}var A=r+48|0,g=Se[A>>2]-Se[E+4>>2]|0;Se[A>>2]=g,Se[i]=0;var p=0}else var p=c;while(0);var p,y=D(r,35,k,p),h=y;break r}var m=N(r);if(0==(0|m)){var h=0;break r}if(0==(0|b)){var S=D(r,38,m,0);if(Se[l>>2]=S,0==(0|S)){var h=0;break r}var n=0,o=k,l=S+8|0;continue r}var b=0,k=m}var h;return Oe=v,h}function Mr(r){for(var a=r;;){var a;if(0==(0|a)){var e=0;break}var i=Se[a>>2];if(1!=(0|i)&&2!=(0|i)){if(6==(0|i)||7==(0|i)||42==(0|i)){var e=1;break}var e=0;break}var a=Se[a+8>>2]}var e;return e}function Cr(r){var a=r>>2;Se[a+3]=0,Se[a+2]=0,Se[a+1]=0,Se[a]=0,Se[a+4]=0}function Rr(r,a){var e,e=(r+12|0)>>2,i=Se[e],v=(Se[r+4>>2]-i|0)<(0|a);r:do if(v)var t=0;else{var f=i+a|0;Se[e]=f;var _=0==(4&Se[r+8>>2]|0);do if(!_){if(Ae[f]<<24>>24!=36)break;var s=a+(i+1)|0;Se[e]=s}while(0);var n=(0|a)>9;do if(n){var o=La(i,0|He.__str117,8);if(0!=(0|o))break;var l=Ae[i+8|0];if(l<<24>>24!=46&&l<<24>>24!=95&&l<<24>>24!=36)break;if(Ae[i+9|0]<<24>>24!=78)break;var b=r+48|0,k=22-a+Se[b>>2]|0;Se[b>>2]=k;var u=lr(r,0|He.__str169,21),t=u;break r}while(0);var c=lr(r,i,a),t=c}while(0);var t;return t}function Tr(r){var a,e,e=(r+48|0)>>2,i=Se[e],v=i+20|0;Se[e]=v;var a=(r+12|0)>>2,t=Se[a],f=t+1|0;Se[a]=f;var _=Ae[t];do if(_<<24>>24==84){var s=t+2|0;Se[a]=s;var n=Ae[f]<<24>>24;if(86==(0|n)){var o=i+15|0;Se[e]=o;var l=N(r),b=D(r,8,l,0),k=b}else if(84==(0|n)){var u=i+10|0;Se[e]=u;var c=N(r),h=D(r,9,c,0),k=h}else if(73==(0|n))var d=N(r),w=D(r,11,d,0),k=w;else if(83==(0|n))var p=N(r),E=D(r,12,p,0),k=E;else if(104==(0|n)){var A=Nr(r,104);if(0==(0|A)){var k=0;break}var g=O(r,0),y=D(r,14,g,0),k=y}else if(118==(0|n)){var m=Nr(r,118);if(0==(0|m)){var k=0;break}var S=O(r,0),M=D(r,15,S,0),k=M}else if(99==(0|n)){var C=Nr(r,0);if(0==(0|C)){var k=0;break}var R=Nr(r,0);if(0==(0|R)){var k=0;break}var T=O(r,0),I=D(r,16,T,0),k=I}else if(67==(0|n)){var P=N(r),L=sr(r);if((0|L)<0){var k=0;break}var F=Se[a],X=F+1|0;if(Se[a]=X,Ae[F]<<24>>24!=95){var k=0;break}var j=N(r),U=Se[e]+5|0;Se[e]=U;var x=D(r,10,j,P),k=x}else if(70==(0|n))var z=N(r),V=D(r,13,z,0),k=V;else{if(74!=(0|n)){var k=0;break}var B=N(r),H=D(r,17,B,0),k=H}}else if(_<<24>>24==71){var K=t+2|0;Se[a]=K;var Y=Ae[f]<<24>>24;if(86==(0|Y))var G=Ar(r),W=D(r,18,G,0),k=W;else if(82==(0|Y))var Z=Ar(r),Q=D(r,19,Z,0),k=Q;else{if(65!=(0|Y)){var k=0;break}var q=O(r,0),$=D(r,20,q,0),k=$}}else var k=0;while(0);var k;return k}function Or(r){for(var a,e=r,a=e>>2;;){var e;if(0==(0|e)){var i=0;break}var v=Se[a];if(4==(0|v)){var t=Se[a+1],f=Mr(t),i=0==(0|f)&1;break}if(25!=(0|v)&&26!=(0|v)&&27!=(0|v)){var i=0;break}var e=Se[a+1],a=e>>2}var i;return i}function Nr(r,a){var e;if(0==(0|a)){var i=r+12|0,v=Se[i>>2],t=v+1|0;Se[i>>2]=t;var f=Ae[v]<<24>>24}else var f=a;var f;do{if(104==(0|f)){var _=(sr(r),r+12|0);e=7;break}if(118==(0|f)){var s=(sr(r),r+12|0),n=Se[s>>2],o=n+1|0;if(Se[s>>2]=o,Ae[n]<<24>>24!=95){var l=0;e=8;break}var _=(sr(r),s);e=7;break}var l=0;e=8}while(0);if(7==e){var _,b=Se[_>>2],k=b+1|0;Se[_>>2]=k;var l=Ae[b]<<24>>24==95&1}var l;return l}function Ir(r){var a,e,i=r>>2,v=Oe;Oe+=56;var t,f=v,_=v+8,s=v+16,n=v+36,e=(0|r)>>2,o=Se[e],l=0==(8192&o|0);r:do{if(l){var a=(r+12|0)>>2,b=Se[a];if(Ae[b]<<24>>24!=63){var k=0;t=111;break}var u=b+1|0;Se[a]=u;var c=Ae[u];do if(c<<24>>24==63){if(Ae[b+2|0]<<24>>24==36){var h=b+3|0;if(Ae[h]<<24>>24!=63){var d=5;t=90;break}Se[a]=h;var w=6,p=h}else var w=0,p=u;var p,w,E=p+1|0;Se[a]=E;var A=Ae[E]<<24>>24;do if(48==(0|A)){var g=1;t=81}else{if(49==(0|A)){var g=2;t=81;break}if(50!=(0|A)){if(51==(0|A)){var y=0|He.__str2172,m=E;t=82;break}if(52==(0|A)){var y=0|He.__str3173,m=E;t=82;break}if(53==(0|A)){var y=0|He.__str4174,m=E;t=82;break}if(54==(0|A)){var y=0|He.__str5175,m=E;t=82;break}if(55==(0|A)){var y=0|He.__str6176,m=E;t=82;break}if(56==(0|A)){var y=0|He.__str7177,m=E;t=82;break}if(57==(0|A)){var y=0|He.__str8178,m=E;t=82;break}if(65==(0|A)){var y=0|He.__str9179,m=E;t=82;break}if(66==(0|A)){Se[a]=p+2|0;var S=0|He.__str10180,M=3;t=88;break}if(67==(0|A)){var y=0|He.__str11181,m=E;t=82;break}if(68==(0|A)){var y=0|He.__str12182,m=E;t=82;break}if(69==(0|A)){var y=0|He.__str13183,m=E;t=82;break}if(70==(0|A)){var y=0|He.__str14184,m=E;t=82;break}if(71==(0|A)){var y=0|He.__str15185,m=E;t=82;break}if(72==(0|A)){var y=0|He.__str16186,m=E;t=82;break}if(73==(0|A)){var y=0|He.__str17187,m=E;t=82;break}if(74==(0|A)){var y=0|He.__str18188,m=E;t=82;break}if(75==(0|A)){var y=0|He.__str19189,m=E;t=82;break}if(76==(0|A)){var y=0|He.__str20190,m=E;t=82;break}if(77==(0|A)){var y=0|He.__str21191,m=E;t=82;break}if(78==(0|A)){var y=0|He.__str22192,m=E;t=82;break}if(79==(0|A)){var y=0|He.__str23193,m=E;t=82;break}if(80==(0|A)){var y=0|He.__str24194,m=E;t=82;break}if(81==(0|A)){var y=0|He.__str25195,m=E;t=82;break}if(82==(0|A)){var y=0|He.__str26196,m=E;t=82;break}if(83==(0|A)){var y=0|He.__str27197,m=E;t=82;break}if(84==(0|A)){var y=0|He.__str28198,m=E;t=82;break}if(85==(0|A)){var y=0|He.__str29199,m=E;t=82;break}if(86==(0|A)){var y=0|He.__str30200,m=E;t=82;break}if(87==(0|A)){var y=0|He.__str31201,m=E;t=82;break}if(88==(0|A)){var y=0|He.__str32202,m=E;t=82;break}if(89==(0|A)){var y=0|He.__str33203,m=E;t=82;break}if(90==(0|A)){var y=0|He.__str34204,m=E;t=82;break}if(95==(0|A)){var C=p+2|0;Se[a]=C;var R=Ae[C]<<24>>24;if(48==(0|R)){var y=0|He.__str35205,m=C;t=82;break}if(49==(0|R)){var y=0|He.__str36206,m=C;t=82;break}if(50==(0|R)){var y=0|He.__str37207,m=C;t=82;break}if(51==(0|R)){var y=0|He.__str38208,m=C;t=82;break}if(52==(0|R)){var y=0|He.__str39209,m=C;t=82;break}if(53==(0|R)){var y=0|He.__str40210,m=C;t=82;break}if(54==(0|R)){var y=0|He.__str41211,m=C;t=82;break}if(55==(0|R)){var y=0|He.__str42212,m=C;t=82;break}if(56==(0|R)){var y=0|He.__str43213,m=C;t=82;break}if(57==(0|R)){var y=0|He.__str44214,m=C;t=82;break}if(65==(0|R)){var y=0|He.__str45215,m=C;t=82;break}if(66==(0|R)){var y=0|He.__str46216,m=C;t=82;break}if(67==(0|R)){Se[a]=p+3|0;var T=0|He.__str47217;t=84;break}if(68==(0|R)){var y=0|He.__str48218,m=C;t=82;break}if(69==(0|R)){var y=0|He.__str49219,m=C;t=82;break}if(70==(0|R)){var y=0|He.__str50220,m=C;t=82;break}if(71==(0|R)){var y=0|He.__str51221,m=C;t=82;break}if(72==(0|R)){var y=0|He.__str52222,m=C;t=82;break}if(73==(0|R)){var y=0|He.__str53223,m=C;t=82;break}if(74==(0|R)){var y=0|He.__str54224,m=C;t=82;break}if(75==(0|R)){var y=0|He.__str55225,m=C;t=82;break}if(76==(0|R)){var y=0|He.__str56226,m=C;t=82;break}if(77==(0|R)){var y=0|He.__str57227,m=C;t=82;break}if(78==(0|R)){var y=0|He.__str58228,m=C;t=82;break}if(79==(0|R)){var y=0|He.__str59229,m=C;t=82;break}if(82==(0|R)){var O=4|o;Se[e]=O;var N=p+3|0;Se[a]=N;var I=Ae[N]<<24>>24;if(48==(0|I)){Se[a]=p+4|0,Cr(s);var P=(Pr(r,_,s,0),Se[_>>2]),D=Se[_+4>>2],L=Dr(r,0|He.__str60230,(ne=Oe,Oe+=8,Se[ne>>2]=P,Se[ne+4>>2]=D,ne)),F=Se[a]-1|0;Se[a]=F;var y=L,m=F;t=82;break}if(49==(0|I)){Se[a]=p+4|0;var X=Lr(r),j=Lr(r),U=Lr(r),x=Lr(r),z=Se[a]-1|0;Se[a]=z;var V=Dr(r,0|He.__str61231,(ne=Oe,Oe+=16,Se[ne>>2]=X,Se[ne+4>>2]=j,Se[ne+8>>2]=U,Se[ne+12>>2]=x,ne)),y=V,m=Se[a];t=82;break}if(50==(0|I)){var y=0|He.__str62232,m=N;t=82;break}if(51==(0|I)){var y=0|He.__str63233,m=N;t=82;break}if(52==(0|I)){var y=0|He.__str64234,m=N;t=82;break}var y=0,m=N;t=82;break}if(83==(0|R)){var y=0|He.__str65235,m=C;t=82;break}if(84==(0|R)){var y=0|He.__str66236,m=C;t=82;break}if(85==(0|R)){var y=0|He.__str67237,m=C;t=82;break}if(86==(0|R)){var y=0|He.__str68238,m=C;t=82;break}if(88==(0|R)){var y=0|He.__str69239,m=C;t=82;break}if(89==(0|R)){var y=0|He.__str70240,m=C;t=82;break}var k=0;t=111;break r}var k=0;t=111;break r}var y=0|He.__str1171,m=E;t=82}while(0);do{if(81==t){var g;Se[a]=p+2|0;var B=g;t=83;break}if(82==t){var m,y;if(Se[a]=m+1|0,1==(0|w)||2==(0|w)){var B=w;t=83;break}if(4==(0|w)){var T=y;t=84;break}if(6!=(0|w)){var S=y,M=w;t=88;break}Cr(n);var H=Xr(r,n,0,60,62);if(0==(0|H))var K=y;else var Y=Dr(r,0|He.__str170,(ne=Oe,Oe+=8,Se[ne>>2]=y,Se[ne+4>>2]=H,ne)),K=Y;var K;Se[i+6]=0;var S=K,M=w;t=88;break}}while(0);if(83==t){var B,G=r+40|0,W=Fr(r,0|He._symbol_demangle_dashed_null,-1,G);if(0==(0|W)){var k=0;t=111;break r}var d=B;t=90;break}if(84==t){var T;Se[i+4]=T;var Z=1,Q=T;t=109;break r}if(88==t){var M,S,q=r+40|0,$=Fr(r,S,-1,q);if(0==(0|$)){var k=0;t=111;break r}var d=M;t=90;break}}else{if(c<<24>>24==36){var J=b+2|0;Se[a]=J;var rr=jr(r);Se[i+4]=rr;var ar=0!=(0|rr)&1;t=107;break}var d=0;t=90}while(0);if(90==t){var d,er=Me[a],ir=Ae[er]<<24>>24;if(64==(0|ir))Se[a]=er+1|0;else if(36==(0|ir))t=93;else{var vr=zr(r);if(0==(0|vr)){var k=-1;t=111;break}}if(5==(0|d)){var tr=r+20|0,fr=Se[tr>>2]+1|0;Se[tr>>2]=fr}else if(1==(0|d)||2==(0|d)){if(Me[i+11]>>>0<2){var k=-1;t=111;break}var _r=r+56|0,sr=Me[_r>>2],nr=Se[sr+4>>2];if(1==(0|d))Se[sr>>2]=nr;else{var or=Dr(r,0|He.__str71241,(ne=Oe,Oe+=4,Se[ne>>2]=nr,ne)),lr=Se[_r>>2];Se[lr>>2]=or}var br=4|Se[e];Se[e]=br}else if(3==(0|d)){var kr=Se[e]&-5;Se[e]=kr}var ur=ge[Se[a]];if((ur-48&255&255)<10)var cr=Vr(r),ar=cr;else if((ur-65&255&255)<26)var hr=Br(r,3==(0|d)&1),ar=hr;else{if(ur<<24>>24!=36){var k=-1;t=111;break}var dr=Hr(r),ar=dr}}var ar;if(0==(0|ar)){var k=-1;t=111;break}var Z=ar,Q=Se[i+4];t=109;break}var wr=Pr(r,f,0,0);if(0==(0|wr)){var k=-1;t=111;break}var pr=Se[f>>2],Er=Se[f+4>>2],Ar=Dr(r,0|He.__str170,(ne=Oe,Oe+=8,Se[ne>>2]=pr,Se[ne+4>>2]=Er,ne));Se[i+4]=Ar;var Z=1,Q=Ar;t=109;break}while(0);do if(109==t){var Q,Z;if(0!=(0|Q)){var k=Z;break}Xa(0|He.__str72242,1499,0|He.___func___symbol_demangle,0|He.__str73243);var k=Z}while(0);var k;return Oe=v,k}function Pr(r,a,e,i){var v,t,f,_=Oe;Oe+=24;var s=_,n=_+4,o=_+8,l=_+16,b=_+20;0==(0|a)&&Xa(0|He.__str72242,829,0|He.___func___demangle_datatype,0|He.__str121291);var f=(a+4|0)>>2;Se[f]=0;var t=(0|a)>>2;Se[t]=0;var v=(r+12|0)>>2,k=Me[v],u=k+1|0;Se[v]=u;var c=Ae[k],h=c<<24>>24;do if(95==(0|h)){Se[v]=k+2|0;var d=Ae[u],w=Zr(d);Se[t]=w}else if(67==(0|h)||68==(0|h)||69==(0|h)||70==(0|h)||71==(0|h)||72==(0|h)||73==(0|h)||74==(0|h)||75==(0|h)||77==(0|h)||78==(0|h)||79==(0|h)||88==(0|h)||90==(0|h)){var p=Qr(c);Se[t]=p}else if(84==(0|h)||85==(0|h)||86==(0|h)||89==(0|h)){var E=qr(r);if(0==(0|E))break;var A=0==(32768&Se[r>>2]|0);do if(A)if(84==(0|h))var g=0|He.__str122292;else if(85==(0|h))var g=0|He.__str123293;else if(86==(0|h))var g=0|He.__str124294;else{if(89!=(0|h)){var g=0;break}var g=0|He.__str125295}else var g=0;while(0);var g,y=Dr(r,0|He.__str170,(ne=Oe,Oe+=8,Se[ne>>2]=g,Se[ne+4>>2]=E,ne));Se[t]=y}else if(63==(0|h))if(0==(0|i))$r(a,r,e,63,0);else{var m=Lr(r);if(0==(0|m))break;var S=Dr(r,0|He.__str126296,(ne=Oe,Oe+=4,Se[ne>>2]=m,ne));Se[t]=S}else if(65==(0|h)||66==(0|h))$r(a,r,e,c,i);else if(81==(0|h)||82==(0|h)||83==(0|h)){var M=0==(0|i)?80:c;$r(a,r,e,M,i)}else if(80==(0|h))if(((Ae[u]<<24>>24)-48|0)>>>0<10){var C=k+2|0;if(Se[v]=C,Ae[u]<<24>>24!=54)break;var R=r+44|0,T=Se[R>>2];Se[v]=k+3|0;var O=Ae[C],N=Se[r>>2]&-17,I=Ur(O,s,n,N);if(0==(0|I))break;var P=Pr(r,o,e,0);if(0==(0|P))break;var D=Xr(r,e,1,40,41);if(0==(0|D))break;Se[R>>2]=T;var L=Se[o>>2],F=Se[o+4>>2],X=Se[s>>2],j=Dr(r,0|He.__str127297,(ne=Oe,Oe+=12,Se[ne>>2]=L,Se[ne+4>>2]=F,Se[ne+8>>2]=X,ne));Se[t]=j;var U=Dr(r,0|He.__str128298,(ne=Oe,Oe+=4,Se[ne>>2]=D,ne));Se[f]=U}else $r(a,r,e,80,i);else if(87==(0|h)){if(Ae[u]<<24>>24!=52)break;Se[v]=k+2|0;var x=qr(r);if(0==(0|x))break;if(0==(32768&Se[r>>2]|0)){var z=Dr(r,0|He.__str129299,(ne=Oe,Oe+=4,Se[ne>>2]=x,ne));Se[t]=z}else Se[t]=x}else if(48==(0|h)||49==(0|h)||50==(0|h)||51==(0|h)||52==(0|h)||53==(0|h)||54==(0|h)||55==(0|h)||56==(0|h)||57==(0|h)){var V=h<<1,B=V-96|0,H=Yr(e,B);Se[t]=H;var K=V-95|0,Y=Yr(e,K);Se[f]=Y}else if(36==(0|h)){var G=k+2|0;Se[v]=G;var W=Ae[u]<<24>>24;if(48==(0|W)){var Z=Lr(r);Se[t]=Z}else if(68==(0|W)){var Q=Lr(r);if(0==(0|Q))break;var q=Dr(r,0|He.__str130300,(ne=Oe,Oe+=4,Se[ne>>2]=Q,ne));Se[t]=q}else if(70==(0|W)){var $=Lr(r);if(0==(0|$))break;var J=Lr(r);if(0==(0|J))break;var rr=Dr(r,0|He.__str131301,(ne=Oe,Oe+=8,Se[ne>>2]=$,Se[ne+4>>2]=J,ne));Se[t]=rr}else if(71==(0|W)){var ar=Lr(r);if(0==(0|ar))break;var er=Lr(r);if(0==(0|er))break;var ir=Lr(r);if(0==(0|ir))break;var vr=Dr(r,0|He.__str132302,(ne=Oe,Oe+=12,Se[ne>>2]=ar,Se[ne+4>>2]=er,Se[ne+8>>2]=ir,ne));Se[t]=vr}else if(81==(0|W)){var tr=Lr(r);if(0==(0|tr))break;var fr=Dr(r,0|He.__str133303,(ne=Oe,Oe+=4,Se[ne>>2]=tr,ne));Se[t]=fr}else{if(36!=(0|W))break;if(Ae[G]<<24>>24!=67)break;Se[v]=k+3|0;var _r=xr(r,l,b);if(0==(0|_r))break;var sr=Pr(r,a,e,i);if(0==(0|sr))break;var nr=Se[t],or=Se[l>>2],lr=Dr(r,0|He.__str83253,(ne=Oe,Oe+=8,Se[ne>>2]=nr,Se[ne+4>>2]=or,ne));Se[t]=lr}}while(0);var br=0!=(0|Se[t])&1;return Oe=_,br}function Dr(r,a){var e,i=Oe;Oe+=4;var v=i,e=v>>2,t=v;Se[t>>2]=arguments[Dr.length];var f=1,_=0;r:for(;;){var _,f,s=Ae[a+_|0];do{if(s<<24>>24==0)break r;if(s<<24>>24==37){var n=_+1|0,o=Ae[a+n|0]<<24>>24;if(115==(0|o)){var l=Se[e],b=l,k=l+4|0;Se[e]=k;var u=Se[b>>2];if(0==(0|u)){var c=f,h=n;break}var d=Ca(u),c=d+f|0,h=n;break}if(99==(0|o)){var w=Se[e]+4|0;Se[e]=w;var c=f+1|0,h=n;break}if(37==(0|o))var p=n;else var p=_;var p,c=f+1|0,h=p}else var c=f+1|0,h=_}while(0);var h,c,f=c,_=h+1|0}var E=Wr(r,f);if(0==(0|E))var A=0;else{Se[t>>2]=arguments[Dr.length];var g=E,y=0;r:for(;;){var y,g,m=Ae[a+y|0];do{if(m<<24>>24==0)break r;if(m<<24>>24==37){var S=y+1|0,M=Ae[a+S|0]<<24>>24;if(115==(0|M)){var C=Se[e],R=C,T=C+4|0;Se[e]=T;var O=Se[R>>2];if(0==(0|O)){var N=g,I=S;break}var P=Ca(O);Pa(g,O,P,1);var N=g+P|0,I=S;break}if(99==(0|M)){var D=Se[e],L=D,F=D+4|0;Se[e]=F,Ae[g]=255&Se[L>>2];var N=g+1|0,I=S;break}if(37==(0|M))var X=S;else var X=y;var X;Ae[g]=37;var N=g+1|0,I=X}else{Ae[g]=m;var N=g+1|0,I=y}}while(0);var I,N,g=N,y=I+1|0}Ae[g]=0;var A=E}var A;return Oe=i,A}function Lr(r){var a,a=(r+12|0)>>2,e=Se[a],i=Ae[e];if(i<<24>>24==63){var v=e+1|0;Se[a]=v;var t=1,f=v,_=Ae[v]}else var t=0,f=e,_=i;var _,f,t,s=(_-48&255&255)<9;do if(s){var n=Wr(r,3),o=0!=(0|t);o&&(Ae[n]=45);var l=Ae[Se[a]]+1&255;Ae[n+t|0]=l;var b=o?2:1; -Ae[n+b|0]=0;var k=Se[a]+1|0;Se[a]=k;var u=n}else if(_<<24>>24==57){var c=Wr(r,4),h=0!=(0|t);h&&(Ae[c]=45),Ae[c+t|0]=49;var d=h?2:1;Ae[c+d|0]=48;var w=h?3:2;Ae[c+w|0]=0;var p=Se[a]+1|0;Se[a]=p;var u=c}else{if((_-65&255&255)>=16){var u=0;break}for(var E=0,A=f;;){var A,E,g=A+1|0;Se[a]=g;var y=(Ae[A]<<24>>24)+((E<<4)-65)|0,m=ge[g];if((m-65&255&255)>=16)break;var E=y,A=g}if(m<<24>>24!=64){var u=0;break}var S=Wr(r,17),M=0!=(0|t)?0|He.__str119289:0|ii,C=(za(S,0|He.__str118288,(ne=Oe,Oe+=8,Se[ne>>2]=M,Se[ne+4>>2]=y,ne)),Se[a]+1|0);Se[a]=C;var u=S}while(0);var u;return u}function Fr(r,a,e,i){var v,t,f,_;0==(0|a)&&Xa(0|He.__str72242,212,0|He.___func___str_array_push,0|He.__str115285),0==(0|i)&&Xa(0|He.__str72242,213,0|He.___func___str_array_push,0|He.__str116286);var f=(i+12|0)>>2,s=Me[f],n=0==(0|s);do{if(n){Se[f]=32;var o=Wr(r,128);if(0==(0|o)){var l=0;_=17;break}Se[i+16>>2]=o,_=11;break}if(Me[i+8>>2]>>>0>>0){_=11;break}var b=s<<3,k=Wr(r,b);if(0==(0|k)){var l=0;_=17;break}var u=k,c=i+16|0,h=Se[c>>2],d=Se[f]<<2;Pa(k,h,d,1);var w=Se[f]<<1;Se[f]=w,Se[c>>2]=u,_=11;break}while(0);do if(11==_){if((0|e)==-1)var p=Ca(a),E=p;else var E=e;var E,A=ja(a),g=E+1|0,y=Wr(r,g),t=(i+4|0)>>2,v=(i+16|0)>>2,m=(Se[t]<<2)+Se[v]|0;Se[m>>2]=y;var S=Se[Se[v]+(Se[t]<<2)>>2];if(0==(0|S)){Xa(0|He.__str72242,233,0|He.___func___str_array_push,0|He.__str117287);var M=Se[Se[v]+(Se[t]<<2)>>2]}else var M=S;var M;Pa(M,A,E,1),va(A),Ae[Se[Se[v]+(Se[t]<<2)>>2]+g|0]=0;var C=Se[t]+1|0;Se[t]=C;var R=i+8|0;if(C>>>0>2]>>>0){var l=1;break}Se[R>>2]=C;var l=1}while(0);var l;return l}function Xr(r,a,e,i,v){var t,f,_=Oe;Oe+=28;var s,n=_,o=_+8;Cr(o);var f=(r+12|0)>>2,l=0==(0|e),t=(0|n)>>2,b=n+4|0;r:do if(l)for(;;){var k=Se[f],u=Ae[k];if(u<<24>>24==0){s=12;break r}if(u<<24>>24==64){var c=k;s=7;break r}var h=Pr(r,n,a,1);if(0==(0|h)){var d=0;s=25;break r}var w=Se[t],p=Se[b>>2],E=Dr(r,0|He.__str170,(ne=Oe,Oe+=8,Se[ne>>2]=w,Se[ne+4>>2]=p,ne)),A=Fr(r,E,-1,o);if(0==(0|A)){var d=0;s=25;break r}var g=Se[t],y=Da(g,0|He.__str110280);if(0==(0|y)){s=12;break r}}else for(;;){var m=Se[f],S=Ae[m];if(S<<24>>24==0){s=12;break r}if(S<<24>>24==64){var c=m;s=7;break r}var M=Pr(r,n,a,1);if(0==(0|M)){var d=0;s=25;break r}var C=Se[t],R=Da(C,0|He.__str84254);if(0==(0|R)){s=13;break r}var T=Se[b>>2],O=Dr(r,0|He.__str170,(ne=Oe,Oe+=8,Se[ne>>2]=C,Se[ne+4>>2]=T,ne)),N=Fr(r,O,-1,o);if(0==(0|N)){var d=0;s=25;break r}var I=Se[t],P=Da(I,0|He.__str110280);if(0==(0|P)){s=12;break r}}while(0);do if(7==s){var c;Se[f]=c+1|0,s=12;break}while(0);do if(12==s){if(l){s=14;break}s=13;break}while(0);do if(13==s){var D=Se[f],L=D+1|0;if(Se[f]=L,Ae[D]<<24>>24==90){s=14;break}var d=0;s=25;break}while(0);r:do if(14==s){var F=o+4|0,X=Me[F>>2];do{if(0!=(0|X)){if(1==(0|X)){var j=o+16|0,U=Se[Se[j>>2]>>2],x=Da(U,0|He.__str84254);if(0==(0|x)){s=17;break}var z=j;s=20;break}var V=o+16|0;if(X>>>0<=1){var z=V;s=20;break}for(var B=0,H=1;;){var H,B,K=Se[Se[V>>2]+(H<<2)>>2],Y=Dr(r,0|He.__str112282,(ne=Oe,Oe+=8,Se[ne>>2]=B,Se[ne+4>>2]=K,ne)),G=H+1|0;if(G>>>0>=Me[F>>2]>>>0)break;var B=Y,H=G}if(0==(0|Y)){var z=V;s=20;break}var W=Y,Z=Y;s=21;break}s=17}while(0);if(17==s){var Q=i<<24>>24,q=v<<24>>24,$=Dr(r,0|He.__str111281,(ne=Oe,Oe+=8,Se[ne>>2]=Q,Se[ne+4>>2]=q,ne)),d=$;break}if(20==s)var z,W=Se[Se[z>>2]>>2],Z=0;var Z,W,J=v<<24>>24,rr=v<<24>>24==62;do if(rr){var ar=Ca(W);if(Ae[W+(ar-1)|0]<<24>>24!=62)break;var er=i<<24>>24,ir=Se[Se[o+16>>2]>>2],vr=Dr(r,0|He.__str113283,(ne=Oe,Oe+=16,Se[ne>>2]=er,Se[ne+4>>2]=ir,Se[ne+8>>2]=Z,Se[ne+12>>2]=J,ne)),d=vr;break r}while(0);var tr=i<<24>>24,fr=Se[Se[o+16>>2]>>2],_r=Dr(r,0|He.__str114284,(ne=Oe,Oe+=16,Se[ne>>2]=tr,Se[ne+4>>2]=fr,Se[ne+8>>2]=Z,Se[ne+12>>2]=J,ne)),d=_r}while(0);var d;return Oe=_,d}function jr(r){var a,e=Oe;Oe+=20;var i=e,v=r+24|0,t=Se[v>>2],a=(r+20|0)>>2,f=Se[a],_=r+44|0,s=Se[_>>2];Se[a]=t;var n=Kr(r);if(0==(0|n))var o=0;else{Cr(i);var l=Xr(r,i,0,60,62);if(0==(0|l))var b=n;else var k=Dr(r,0|He.__str170,(ne=Oe,Oe+=8,Se[ne>>2]=n,Se[ne+4>>2]=l,ne)),b=k;var b;Se[v>>2]=t,Se[a]=f,Se[_>>2]=s;var o=b}var o;return Oe=e,o}function Ur(r,a,e,i){var v,t=a>>2;Se[e>>2]=0,Se[t]=0;var f=0==(18&i|0);do{if(f){var _=r<<24>>24,s=1==((_-65)%2|0);if(0==(1&i|0)){if(s?Se[e>>2]=0|He.__str95265:v=14,65==(0|_)||66==(0|_)){Se[t]=0|He.__str96266,v=21;break}if(67==(0|_)||68==(0|_)){Se[t]=0|He.__str97267,v=21;break}if(69==(0|_)||70==(0|_)){Se[t]=0|He.__str98268,v=21;break}if(71==(0|_)||72==(0|_)){Se[t]=0|He.__str99269,v=21;break}if(73==(0|_)||74==(0|_)){Se[t]=0|He.__str100270,v=21;break}if(75==(0|_)||76==(0|_)){v=21;break}if(77==(0|_)){Se[t]=0|He.__str101271,v=21;break}var n=0;v=22;break}if(s?Se[e>>2]=0|He.__str88258:v=5,65==(0|_)||66==(0|_)){Se[t]=0|He.__str89259,v=21;break}if(67==(0|_)||68==(0|_)){Se[t]=0|He.__str90260,v=21;break}if(69==(0|_)||70==(0|_)){Se[t]=0|He.__str91261,v=21;break}if(71==(0|_)||72==(0|_)){Se[t]=0|He.__str92262,v=21;break}if(73==(0|_)||74==(0|_)){Se[t]=0|He.__str93263,v=21;break}if(75==(0|_)||76==(0|_)){v=21;break}if(77==(0|_)){Se[t]=0|He.__str94264,v=21;break}var n=0;v=22;break}v=21}while(0);if(21==v)var n=1;var n;return n}function xr(r,a,e){var i;Se[e>>2]=0;var i=(r+12|0)>>2,v=Se[i];if(Ae[v]<<24>>24==69){Se[e>>2]=0|He.__str102272;var t=Se[i]+1|0;Se[i]=t;var f=t}else var f=v;var f;Se[i]=f+1|0;var _=Ae[f]<<24>>24;if(65==(0|_)){Se[a>>2]=0;var s=1}else if(66==(0|_)){Se[a>>2]=0|He.__str103273;var s=1}else if(67==(0|_)){Se[a>>2]=0|He.__str104274;var s=1}else if(68==(0|_)){Se[a>>2]=0|He.__str105275;var s=1}else var s=0;var s;return s}function zr(r){var a,e,a=(r+12|0)>>2,i=r+40|0,v=r+20|0,t=0|i,f=r+44|0,_=r+48|0,s=r+52|0,n=r+56|0,o=r+20|0,l=r+24|0,b=r+16|0,k=0;r:for(;;){var k,u=Se[a],c=Ae[u];if(c<<24>>24==64){var h=u+1|0;Se[a]=h;var d=1;break}var w=c<<24>>24;do{if(0==(0|w)){var d=0;break r}if(48==(0|w)||49==(0|w)||50==(0|w)||51==(0|w)||52==(0|w)||53==(0|w)||54==(0|w)||55==(0|w)||56==(0|w)||57==(0|w)){var p=u+1|0;Se[a]=p;var E=(Ae[u]<<24>>24)-48|0,A=Yr(v,E),g=A;e=14;break}if(63==(0|w)){var y=u+1|0;Se[a]=y;var m=Ae[y]<<24>>24;if(36==(0|m)){var S=u+2|0;Se[a]=S;var M=jr(r);if(0==(0|M)){var d=0;break r}var C=Fr(r,M,-1,v);if(0==(0|C)){var d=0;break r}var R=M;e=15;break}if(63==(0|m)){var T=Se[t>>2],O=Se[f>>2],N=Se[_>>2],I=Se[s>>2],P=Se[n>>2],D=Se[o>>2],L=Se[l>>2];Cr(i);var F=Ir(r);if(0==(0|F))var X=k;else var j=Se[b>>2],U=Dr(r,0|He.__str109279,(ne=Oe,Oe+=4,Se[ne>>2]=j,ne)),X=U;var X;Se[o>>2]=D,Se[l>>2]=L,Se[t>>2]=T,Se[f>>2]=O,Se[_>>2]=N,Se[s>>2]=I,Se[n>>2]=P;var g=X;e=14;break}var x=Lr(r);if(0==(0|x)){var d=0;break r}var z=Dr(r,0|He.__str109279,(ne=Oe,Oe+=4,Se[ne>>2]=x,ne)),g=z;e=14;break}var V=Kr(r),g=V;e=14;break}while(0);if(14==e){var g;if(0==(0|g)){var d=0;break}var R=g}var R,B=Fr(r,R,-1,i);if(0==(0|B)){var d=0;break}var k=R}var d;return d}function Vr(r){var a,e,i,v=Oe;Oe+=36;var t,f=v,i=f>>2,_=v+4,s=v+8,e=s>>2,n=v+16;Se[i]=0;var o=0|r,l=Se[o>>2],b=0==(128&l|0),k=r+12|0;do if(b){var u=Ae[Se[k>>2]]<<24>>24;if(48==(0|u))var c=0|He.__str76246,h=k,a=h>>2;else if(49==(0|u))var c=0|He.__str77247,h=k,a=h>>2;else{if(50!=(0|u)){var c=0,h=k,a=h>>2;break}var c=0|He.__str78248,h=k,a=h>>2}}else var c=0,h=k,a=h>>2;while(0);var h,c,d=0==(512&l|0);do if(d){if((Ae[Se[a]]-48&255&255)>=3){var w=0;break}var w=0|He.__str79249}else var w=0;while(0);var w,p=Gr(r,0),E=Se[a],A=E+1|0;Se[a]=A;var g=Ae[E]<<24>>24;do{if(48==(0|g)||49==(0|g)||50==(0|g)||51==(0|g)||52==(0|g)||53==(0|g)){var y=r+44|0,m=Se[y>>2];Cr(n);var S=Pr(r,s,n,0);if(0==(0|S)){var M=0;t=28;break}var C=xr(r,f,_);if(0==(0|C)){var M=0;t=28;break}var R=Se[i],T=0==(0|R),O=Se[_>>2];do if(T)Se[i]=O;else{if(0==(0|O))break;var N=Dr(r,0|He.__str83253,(ne=Oe,Oe+=8,Se[ne>>2]=R,Se[ne+4>>2]=O,ne));Se[i]=N}while(0);Se[y>>2]=m,t=22;break}if(54==(0|g)||55==(0|g)){var I=s+4|0;Se[I>>2]=0,Se[e]=0;var P=xr(r,f,_);if(0==(0|P)){var M=0;t=28;break}if(Ae[Se[a]]<<24>>24==64){t=22;break}var D=qr(r);if(0==(0|D)){var M=0;t=28;break}var L=Dr(r,0|He.__str107277,(ne=Oe,Oe+=4,Se[ne>>2]=D,ne));Se[I>>2]=L,t=22;break}if(56==(0|g)||57==(0|g)){Se[e+1]=0,Se[e]=0,Se[i]=0,t=22;break}var M=0;t=28}while(0);if(22==t){var F=0==(4096&Se[o>>2]|0);do{if(F){var X=Se[e],j=Se[i];if(0==(0|j)){var U=X;t=26;break}var x=0!=(0|X)?0|He.__str87257:0,z=0|He.__str87257,V=j,B=x,H=X;t=27;break}Se[i]=0,Se[e+1]=0,Se[e]=0;var U=0;t=26;break}while(0);if(26==t)var U,K=0!=(0|U)?0|He.__str87257:0,z=K,V=0,B=0,H=U;var H,B,V,z,Y=Se[e+1],G=Dr(r,0|He.__str108278,(ne=Oe,Oe+=32,Se[ne>>2]=c,Se[ne+4>>2]=w,Se[ne+8>>2]=H,Se[ne+12>>2]=B,Se[ne+16>>2]=V,Se[ne+20>>2]=z,Se[ne+24>>2]=p,Se[ne+28>>2]=Y,ne));Se[r+16>>2]=G;var M=1}var M;return Oe=v,M}function Br(r,a){var e,i,v,t,f=Oe;Oe+=44;var _,s=f,t=s>>2,n=f+8,o=f+12,v=o>>2,l=f+16,b=f+20,k=f+40;Se[v]=0;var i=(r+12|0)>>2,u=Se[i],c=u+1|0;Se[i]=c;var h=ge[u],d=h<<24>>24,w=(h-65&255&255)>25;r:do if(w)var p=0;else{var e=(0|r)>>2,E=Me[e],A=0==(128&E|0),g=d-65|0;do if(A){var y=g/8|0;if(0==(0|y))var m=0|He.__str76246,S=g;else if(1==(0|y))var m=0|He.__str77247,S=g;else{if(2!=(0|y)){var m=0,S=g;break}var m=0|He.__str78248,S=g}}else var m=0,S=g;while(0);var S,m,M=0==(512&E|0)&h<<24>>24<89,C=(0|S)%8;do if(M)if(2==(0|C)||3==(0|C))var R=m,T=0|He.__str79249;else if(4==(0|C)||5==(0|C))var R=m,T=0|He.__str80250;else{if(6!=(0|C)&&7!=(0|C)){var R=m,T=0;break}var O=Dr(r,0|He.__str81251,(ne=Oe,Oe+=4,Se[ne>>2]=m,ne)),R=O,T=0|He.__str80250}else var R=m,T=0;while(0);var T,R,N=Gr(r,0),I=6==(0|C);do{if(!I){if(7==((d-56)%8|0)){_=14;break}var P=N;_=15;break}_=14}while(0);if(14==_)var D=Lr(r),L=Dr(r,0|He.__str82252,(ne=Oe,Oe+=8,Se[ne>>2]=N,Se[ne+4>>2]=D,ne)),P=L;var P,F=h<<24>>24>88;do if(F)var X=0;else{if((C-2|0)>>>0<2){var X=0;break}var j=xr(r,o,k);if(0==(0|j)){var p=0;break r}var U=Me[v],x=Se[k>>2];if(0==(0|U)&0==(0|x)){var X=0;break}var z=Dr(r,0|He.__str83253,(ne=Oe,Oe+=8,Se[ne>>2]=U,Se[ne+4>>2]=x,ne));Se[v]=z;var X=z}while(0);var X,V=Se[i],B=V+1|0;Se[i]=B;var H=Ae[V],K=Se[e],Y=Ur(H,n,l,K);if(0==(0|Y)){var p=0;break}Cr(b);var G=Se[i];if(Ae[G]<<24>>24==64){Se[t]=0|He.__str84254,Se[t+1]=0;var W=G+1|0;Se[i]=W}else{var Z=Pr(r,s,b,0);if(0==(0|Z)){var p=0;break}}if(0!=(4&Se[e]|0)&&(Se[t+1]=0,Se[t]=0),0==(0|a))var Q=P;else{var q=0|s,$=Se[q>>2],J=s+4|0,rr=Se[J>>2],ar=Dr(r,0|He.__str85255,(ne=Oe,Oe+=12,Se[ne>>2]=P,Se[ne+4>>2]=$,Se[ne+8>>2]=rr,ne));Se[J>>2]=0,Se[q>>2]=0;var Q=ar}var Q,er=r+44|0,ir=Se[er>>2],vr=Xr(r,b,1,40,41);if(0==(0|vr)){var p=0;break}if(0==(4096&Se[e]|0))var tr=vr,fr=X;else{Se[v]=0;var tr=0,fr=0}var fr,tr;Se[er>>2]=ir;var _r=Se[t],sr=Se[t+1];if(0==(0|_r))var nr=0;else var or=0!=(0|sr)?0:0|He.__str87257,nr=or;var nr,lr=Se[n>>2],br=0!=(0|lr)?0|He.__str87257:0,kr=Se[l>>2],ur=Dr(r,0|He.__str86256,(ne=Oe,Oe+=44,Se[ne>>2]=R,Se[ne+4>>2]=T,Se[ne+8>>2]=_r,Se[ne+12>>2]=nr,Se[ne+16>>2]=lr,Se[ne+20>>2]=br,Se[ne+24>>2]=kr,Se[ne+28>>2]=Q,Se[ne+32>>2]=tr,Se[ne+36>>2]=fr,Se[ne+40>>2]=sr,ne));Se[r+16>>2]=ur;var p=1}while(0);var p;return Oe=f,p}function Hr(r){var a,a=(r+12|0)>>2,e=Se[a];if(Ae[e]<<24>>24==36)var i=e;else{Xa(0|He.__str72242,1252,0|He.___func___handle_template,0|He.__str74244);var i=Se[a]}var i;Se[a]=i+1|0;var v=Kr(r),t=0==(0|v);do if(t)var f=0;else{var _=Xr(r,0,0,60,62);if(0==(0|_)){var f=0;break}var s=Dr(r,0|He.__str170,(ne=Oe,Oe+=8,Se[ne>>2]=v,Se[ne+4>>2]=_,ne));Se[r+16>>2]=s;var f=1}while(0);var f;return f}function Kr(r){for(var a,a=(r+12|0)>>2,e=Me[a],i=e,v=Ae[e];;){var v,i;if(!((v-65&255&255)<26|(v-97&255&255)<26|(v-48&255&255)<10)&&v<<24>>24!=95&&v<<24>>24!=36){var t=0;break}var f=i+1|0;Se[a]=f;var _=ge[f];if(_<<24>>24==64){Se[a]=i+2|0;var s=f-e|0,n=r+20|0,o=Fr(r,e,s,n);if(0==(0|o)){var t=0;break}var l=Se[r+24>>2]-1-Se[n>>2]|0,b=Yr(n,l),t=b;break}var i=f,v=_}var t;return t}function Yr(r,a){0==(0|r)&&Xa(0|He.__str72242,263,0|He.___func___str_array_get_ref,0|He.__str75245);var e=Se[r>>2]+a|0;if(e>>>0>2]>>>0)var i=Se[Se[r+16>>2]+(e<<2)>>2];else var i=0;var i;return i}function Gr(r,a){var e,e=(r+44|0)>>2,i=Me[e];if(i>>>0>a>>>0){for(var v=r+56|0,t=a,f=0,_=Se[v>>2],s=i;;){var s,_,f,t,n=Me[_+(t<<2)>>2];if(0==(0|n)){Xa(0|He.__str72242,680,0|He.___func___get_class_string,0|He.__str106276);var o=Se[v>>2],l=o,b=Se[o+(t<<2)>>2],k=Se[e]}else var l=_,b=n,k=s;var k,b,l,u=Ca(b),c=u+(f+2)|0,h=t+1|0;if(h>>>0>=k>>>0)break;var t=h,f=c,_=l,s=k}var d=c-1|0}else var d=-1;var d,w=Wr(r,d);if(0==(0|w))var p=0;else{var E=Se[e]-1|0,A=(0|E)<(0|a);r:do if(A)var g=0;else for(var y=r+56|0,m=0,S=E;;){var S,m,M=Se[Se[y>>2]+(S<<2)>>2],C=Ca(M),R=w+m|0;Pa(R,M,C,1);var T=C+m|0;if((0|S)>(0|a)){var O=T+1|0;Ae[w+T|0]=58;var N=T+2|0;Ae[w+O|0]=58;var I=N}else var I=T;var I,P=S-1|0;if((0|P)<(0|a)){var g=I;break r}var m=I,S=P}while(0);var g;Ae[w+g|0]=0;var p=w}var p;return p}function Wr(r,a){var e,i=a>>>0>1020;do if(i){var v=Se[r+4>>2],t=a+4|0,f=pe[v](t);if(0==(0|f)){var _=0;break}var s=r+60|0,n=Se[s>>2],o=f;Se[o>>2]=n,Se[s>>2]=f,Se[r+64>>2]=0;var _=f+4|0}else{var e=(r+64|0)>>2,l=Me[e];if(l>>>0>>0){var b=Se[r+4>>2],k=pe[b](1024);if(0==(0|k)){var _=0;break}var u=r+60|0,c=Se[u>>2],h=k;Se[h>>2]=c,Se[u>>2]=k,Se[e]=1020;var d=1020,w=k}else var d=l,w=Se[r+60>>2];var w,d;Se[e]=d-a|0;var _=w+(1024-d)|0}while(0);var _;return _}function Zr(r){var a=r<<24>>24;if(68==(0|a))var e=0|He.__str157327;else if(69==(0|a))var e=0|He.__str158328;else if(70==(0|a))var e=0|He.__str159329;else if(71==(0|a))var e=0|He.__str160330;else if(72==(0|a))var e=0|He.__str161331;else if(73==(0|a))var e=0|He.__str162332;else if(74==(0|a))var e=0|He.__str163333;else if(75==(0|a))var e=0|He.__str164334;else if(76==(0|a))var e=0|He.__str165335;else if(77==(0|a))var e=0|He.__str166336;else if(78==(0|a))var e=0|He.__str167337;else if(87==(0|a))var e=0|He.__str168338;else var e=0;var e;return e}function Qr(r){var a=r<<24>>24;if(67==(0|a))var e=0|He.__str145315;else if(68==(0|a))var e=0|He.__str146316;else if(69==(0|a))var e=0|He.__str147317;else if(70==(0|a))var e=0|He.__str148318;else if(71==(0|a))var e=0|He.__str149319;else if(72==(0|a))var e=0|He.__str150320;else if(73==(0|a))var e=0|He.__str151321;else if(74==(0|a))var e=0|He.__str152322;else if(75==(0|a))var e=0|He.__str153323;else if(77==(0|a))var e=0|He.__str154324;else if(78==(0|a))var e=0|He.__str155325;else if(79==(0|a))var e=0|He.__str156326;else if(88==(0|a))var e=0|He.__str84254;else if(90==(0|a))var e=0|He.__str110280;else var e=0;var e;return e}function qr(r){var a=r+44|0,e=Se[a>>2],i=zr(r);if(0==(0|i))var v=0;else var t=Gr(r,e),v=t;var v;return Se[a>>2]=e,v}function $r(r,a,e,i,v){var t,f,_,s=Oe;Oe+=16;var n,o=s,_=o>>2,l=s+4,b=s+8,f=b>>2;Se[l>>2]=0|ii;var t=(a+12|0)>>2,k=Se[t];if(Ae[k]<<24>>24==69){Se[l>>2]=0|He.__str134304;var u=k+1|0;Se[t]=u;var c=0|He.__str134304}else var c=0|ii;var c,h=i<<24>>24;do{if(65==(0|h)){var d=Dr(a,0|He.__str135305,(ne=Oe,Oe+=4,Se[ne>>2]=c,ne)),w=d;n=10;break}if(66==(0|h)){var p=Dr(a,0|He.__str136306,(ne=Oe,Oe+=4,Se[ne>>2]=c,ne)),w=p;n=10;break}if(80==(0|h)){var E=Dr(a,0|He.__str137307,(ne=Oe,Oe+=4,Se[ne>>2]=c,ne)),w=E;n=10;break}if(81==(0|h)){var A=Dr(a,0|He.__str138308,(ne=Oe,Oe+=4,Se[ne>>2]=c,ne)),w=A;n=10;break}if(82==(0|h)){var g=Dr(a,0|He.__str139309,(ne=Oe,Oe+=4,Se[ne>>2]=c,ne)),w=g;n=10;break}if(83==(0|h)){var y=Dr(a,0|He.__str140310,(ne=Oe,Oe+=4,Se[ne>>2]=c,ne)),w=y;n=10;break}if(63==(0|h)){var w=0|ii;n=10}else n=31}while(0);r:do if(10==n){var w,m=xr(a,o,l);if(0==(0|m))break;var S=a+44|0,M=Se[S>>2],C=Se[t],R=Ae[C]<<24>>24==89;a:do if(R){var T=C+1|0;Se[t]=T;var O=Lr(a);if(0==(0|O))break r;var N=Ha(O),I=Ae[w]<<24>>24==32,P=Se[_],D=0==(0|P);do{if(I){if(!D){n=17;break}var L=w+1|0;n=18;break}if(D){var L=w;n=18;break}n=17;break}while(0);if(17==n){var F=Dr(a,0|He.__str141311,(ne=Oe,Oe+=8,Se[ne>>2]=P,Se[ne+4>>2]=w,ne));Se[_]=0;var X=F}else if(18==n)var L,j=Dr(a,0|He.__str142312,(ne=Oe,Oe+=4,Se[ne>>2]=L,ne)),X=j;var X;if(0==(0|N)){var U=X;break}for(var x=X,z=N;;){var z,x,V=z-1|0,B=Lr(a),H=Dr(a,0|He.__str143313,(ne=Oe,Oe+=8,Se[ne>>2]=x,Se[ne+4>>2]=B,ne));if(0==(0|V)){var U=H;break a}var x=H,z=V}}else var U=w;while(0);var U,K=Pr(a,b,e,0);if(0==(0|K))break;var Y=Se[_];if(0==(0|Y)){var G=0==(0|v);do if(G){if(Ae[U]<<24>>24==0){var W=U;break}var Z=U+1|0;if(Ae[Z]<<24>>24!=42){var W=U;break}var Q=Se[f],q=Ca(Q);if(Ae[Q+(q-1)|0]<<24>>24!=42){var W=U;break}var W=Z}else var W=U;while(0);var W,$=Se[f],J=Dr(a,0|He.__str170,(ne=Oe,Oe+=8,Se[ne>>2]=$,Se[ne+4>>2]=W,ne));Se[r>>2]=J}else{var rr=Se[f],ar=Dr(a,0|He.__str144314,(ne=Oe,Oe+=12,Se[ne>>2]=rr,Se[ne+4>>2]=Y,Se[ne+8>>2]=U,ne));Se[r>>2]=ar}var er=Se[f+1];Se[r+4>>2]=er,Se[S>>2]=M}while(0);Oe=s}function Jr(r){var a,e=r>>>0<245;do{if(e){if(r>>>0<11)var i=16;else var i=r+11&-8;var i,v=i>>>3,t=Me[vi>>2],f=t>>>(v>>>0);if(0!=(3&f|0)){var _=(1&f^1)+v|0,s=_<<1,n=(s<<2)+vi+40|0,o=(s+2<<2)+vi+40|0,l=Me[o>>2],b=l+8|0,k=Me[b>>2];if((0|n)==(0|k))Se[vi>>2]=t&(1<<_^-1);else{if(k>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[o>>2]=k,Se[k+12>>2]=n}var u=_<<3;Se[l+4>>2]=3|u;var c=l+(4|u)|0,h=1|Se[c>>2];Se[c>>2]=h;var d=b;a=38;break}if(i>>>0<=Me[vi+8>>2]>>>0){var w=i;a=30;break}if(0!=(0|f)){var p=2<>>12&16,y=A>>>(g>>>0),m=y>>>5&8,S=y>>>(m>>>0),M=S>>>2&4,C=S>>>(M>>>0),R=C>>>1&2,T=C>>>(R>>>0),O=T>>>1&1,N=(m|g|M|R|O)+(T>>>(O>>>0))|0,I=N<<1,P=(I<<2)+vi+40|0,D=(I+2<<2)+vi+40|0,L=Me[D>>2],F=L+8|0,X=Me[F>>2];if((0|P)==(0|X))Se[vi>>2]=t&(1<>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[D>>2]=X,Se[X+12>>2]=P}var j=N<<3,U=j-i|0;Se[L+4>>2]=3|i;var x=L,z=x+i|0;Se[x+(4|i)>>2]=1|U,Se[x+j>>2]=U;var V=Me[vi+8>>2];if(0!=(0|V)){var B=Se[vi+20>>2],H=V>>>2&1073741822,K=(H<<2)+vi+40|0,Y=Me[vi>>2],G=1<<(V>>>3),W=0==(Y&G|0);do{if(!W){var Z=(H+2<<2)+vi+40|0,Q=Me[Z>>2];if(Q>>>0>=Me[vi+16>>2]>>>0){var q=Q,$=Z;break}throw Ka(),"Reached an unreachable!"}Se[vi>>2]=Y|G;var q=K,$=(H+2<<2)+vi+40|0}while(0);var $,q;Se[$>>2]=B,Se[q+12>>2]=B;var J=B+8|0;Se[J>>2]=q;var rr=B+12|0;Se[rr>>2]=K}Se[vi+8>>2]=U,Se[vi+20>>2]=z;var d=F;a=38;break}if(0==(0|Se[vi+4>>2])){var w=i;a=30;break}var ar=ra(i);if(0==(0|ar)){var w=i;a=30;break}var d=ar;a=38;break}if(r>>>0>4294967231){var w=-1;a=30;break}var er=r+11&-8;if(0==(0|Se[vi+4>>2])){var w=er;a=30;break}var ir=ea(er);if(0==(0|ir)){var w=er;a=30;break}var d=ir;a=38;break}while(0);if(30==a){var w,vr=Me[vi+8>>2];if(w>>>0>vr>>>0){var tr=Me[vi+12>>2];if(w>>>0>>0){var fr=tr-w|0;Se[vi+12>>2]=fr;var _r=Me[vi+24>>2],sr=_r;Se[vi+24>>2]=sr+w|0,Se[w+(sr+4)>>2]=1|fr,Se[_r+4>>2]=3|w;var d=_r+8|0}else var nr=aa(w),d=nr}else{var or=vr-w|0,lr=Me[vi+20>>2];if(or>>>0>15){var br=lr;Se[vi+20>>2]=br+w|0,Se[vi+8>>2]=or,Se[w+(br+4)>>2]=1|or,Se[br+vr>>2]=or,Se[lr+4>>2]=3|w}else{Se[vi+8>>2]=0,Se[vi+20>>2]=0,Se[lr+4>>2]=3|vr;var kr=vr+(lr+4)|0,ur=1|Se[kr>>2];Se[kr>>2]=ur}var d=lr+8|0}}var d;return d}function ra(r){var a,e,i,v=Se[vi+4>>2],t=(v&-v)-1|0,f=t>>>12&16,_=t>>>(f>>>0),s=_>>>5&8,n=_>>>(s>>>0),o=n>>>2&4,l=n>>>(o>>>0),b=l>>>1&2,k=l>>>(b>>>0),u=k>>>1&1,c=Me[vi+((s|f|o|b|u)+(k>>>(u>>>0))<<2)+304>>2],h=c,e=h>>2,d=(Se[c+4>>2]&-8)-r|0;r:for(;;)for(var d,h,w=h;;){var w,p=Se[w+16>>2];if(0==(0|p)){var E=Se[w+20>>2];if(0==(0|E))break r;var A=E}else var A=p;var A,g=(Se[A+4>>2]&-8)-r|0;if(g>>>0>>0){var h=A,e=h>>2,d=g;continue r}var w=A}var y=h,m=Me[vi+16>>2],S=y>>>0>>0;do if(!S){var M=y+r|0,C=M;if(y>>>0>=M>>>0)break;var R=Me[e+6],T=Me[e+3],O=(0|T)==(0|h);do if(O){var N=h+20|0,I=Se[N>>2];if(0==(0|I)){var P=h+16|0,D=Se[P>>2];if(0==(0|D)){var L=0,a=L>>2;break}var F=P,X=D}else{var F=N,X=I;i=14}for(;;){var X,F,j=X+20|0,U=Se[j>>2];if(0==(0|U)){var x=X+16|0,z=Me[x>>2];if(0==(0|z))break;var F=x,X=z}else var F=j,X=U}if(F>>>0>>0)throw Ka(),"Reached an unreachable!";Se[F>>2]=0;var L=X,a=L>>2}else{var V=Me[e+2];if(V>>>0>>0)throw Ka(),"Reached an unreachable!";Se[V+12>>2]=T,Se[T+8>>2]=V;var L=T,a=L>>2}while(0);var L,B=0==(0|R);r:do if(!B){var H=h+28|0,K=(Se[H>>2]<<2)+vi+304|0,Y=(0|h)==(0|Se[K>>2]);do{if(Y){if(Se[K>>2]=L,0!=(0|L))break;var G=Se[vi+4>>2]&(1<>2]^-1);Se[vi+4>>2]=G;break r}if(R>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";var W=R+16|0;if((0|Se[W>>2])==(0|h)?Se[W>>2]=L:Se[R+20>>2]=L,0==(0|L))break r}while(0);if(L>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[a+6]=R;var Z=Me[e+4];if(0!=(0|Z)){if(Z>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[a+4]=Z,Se[Z+24>>2]=L}var Q=Me[e+5];if(0==(0|Q))break;if(Q>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[a+5]=Q,Se[Q+24>>2]=L}while(0);if(d>>>0<16){var q=d+r|0;Se[e+1]=3|q;var $=q+(y+4)|0,J=1|Se[$>>2];Se[$>>2]=J}else{Se[e+1]=3|r,Se[r+(y+4)>>2]=1|d,Se[y+d+r>>2]=d;var rr=Me[vi+8>>2];if(0!=(0|rr)){var ar=Me[vi+20>>2],er=rr>>>2&1073741822,ir=(er<<2)+vi+40|0,vr=Me[vi>>2],tr=1<<(rr>>>3),fr=0==(vr&tr|0);do{if(!fr){var _r=(er+2<<2)+vi+40|0,sr=Me[_r>>2];if(sr>>>0>=Me[vi+16>>2]>>>0){var nr=sr,or=_r;break}throw Ka(),"Reached an unreachable!"}Se[vi>>2]=vr|tr;var nr=ir,or=(er+2<<2)+vi+40|0}while(0);var or,nr;Se[or>>2]=ar,Se[nr+12>>2]=ar,Se[ar+8>>2]=nr,Se[ar+12>>2]=ir}Se[vi+8>>2]=d,Se[vi+20>>2]=C}return h+8|0}while(0);throw Ka(),"Reached an unreachable!"}function aa(r){var a,e;0==(0|Se[ti>>2])&&ba();var i=0==(4&Se[vi+440>>2]|0);do{if(i){var v=Se[vi+24>>2],t=0==(0|v);do{if(!t){var f=v,_=ua(f);if(0==(0|_)){e=6;break}var s=Se[ti+8>>2],n=r+47-Se[vi+12>>2]+s&-s;if(n>>>0>=2147483647){e=14;break}var o=re(n);if((0|o)==(Se[_>>2]+Se[_+4>>2]|0)){var l=o,b=n,k=o;e=13;break}var u=o,c=n;e=15;break}e=6}while(0);do if(6==e){var h=re(0);if((0|h)==-1){e=14;break}var d=Se[ti+8>>2],w=d+(r+47)&-d,p=h,E=Se[ti+4>>2],A=E-1|0;if(0==(A&p|0))var g=w;else var g=w-p+(A+p&-E)|0;var g;if(g>>>0>=2147483647){e=14;break}var y=re(g);if((0|y)==(0|h)){var l=h,b=g,k=y;e=13;break}var u=y,c=g;e=15;break}while(0);if(13==e){var k,b,l;if((0|l)!=-1){var m=b,S=l;e=26;break}var u=k,c=b}else if(14==e){var M=4|Se[vi+440>>2];Se[vi+440>>2]=M,e=23;break}var c,u,C=0|-c,R=(0|u)!=-1&c>>>0<2147483647;do{if(R){if(c>>>0>=(r+48|0)>>>0){var T=c;e=21;break}var O=Se[ti+8>>2],N=r+47-c+O&-O;if(N>>>0>=2147483647){var T=c;e=21;break}var I=re(N);if((0|I)==-1){re(C);e=22;break}var T=N+c|0;e=21;break}var T=c;e=21}while(0);if(21==e){var T;if((0|u)!=-1){var m=T,S=u;e=26;break}}var P=4|Se[vi+440>>2];Se[vi+440>>2]=P,e=23;break}e=23}while(0);do if(23==e){var D=Se[ti+8>>2],L=D+(r+47)&-D;if(L>>>0>=2147483647){e=49;break}var F=re(L),X=re(0);if(!((0|X)!=-1&(0|F)!=-1&F>>>0>>0)){e=49;break}var j=X-F|0;if(j>>>0<=(r+40|0)>>>0|(0|F)==-1){e=49;break}var m=j,S=F;e=26;break}while(0);r:do if(26==e){var S,m,U=Se[vi+432>>2]+m|0;Se[vi+432>>2]=U,U>>>0>Me[vi+436>>2]>>>0&&(Se[vi+436>>2]=U);var x=Me[vi+24>>2],z=0==(0|x);a:do if(z){var V=Me[vi+16>>2];0==(0|V)|S>>>0>>0&&(Se[vi+16>>2]=S),Se[vi+444>>2]=S,Se[vi+448>>2]=m,Se[vi+456>>2]=0;var B=Se[ti>>2];Se[vi+36>>2]=B,Se[vi+32>>2]=-1,ha(),ca(S,m-40|0)}else{for(var H=vi+444|0,a=H>>2;;){var H;if(0==(0|H))break;var K=Me[a],Y=H+4|0,G=Me[Y>>2],W=K+G|0;if((0|S)==(0|W)){if(0!=(8&Se[a+3]|0))break;var Z=x;if(!(Z>>>0>=K>>>0&Z>>>0>>0))break;Se[Y>>2]=G+m|0;var Q=Se[vi+24>>2],q=Se[vi+12>>2]+m|0;ca(Q,q);break a}var H=Se[a+2],a=H>>2}S>>>0>2]>>>0&&(Se[vi+16>>2]=S);for(var $=S+m|0,J=vi+444|0;;){var J;if(0==(0|J))break;var rr=0|J,ar=Me[rr>>2];if((0|ar)==(0|$)){if(0!=(8&Se[J+12>>2]|0))break;Se[rr>>2]=S;var er=J+4|0,ir=Se[er>>2]+m|0;Se[er>>2]=ir;var vr=da(S,ar,r),tr=vr;e=50;break r}var J=Se[J+8>>2]}Ma(S,m)}while(0);var fr=Me[vi+12>>2];if(fr>>>0<=r>>>0){e=49;break}var _r=fr-r|0;Se[vi+12>>2]=_r;var sr=Me[vi+24>>2],nr=sr;Se[vi+24>>2]=nr+r|0,Se[r+(nr+4)>>2]=1|_r,Se[sr+4>>2]=3|r;var tr=sr+8|0;e=50;break}while(0);if(49==e){var or=Je();Se[or>>2]=12;var tr=0}var tr;return tr}function ea(r){var a,e,i,v,t,f,_=r>>2,s=0|-r,n=r>>>8,o=0==(0|n);do if(o)var l=0;else{if(r>>>0>16777215){var l=31;break}var b=(n+1048320|0)>>>16&8,k=n<>>16&4,c=k<>>16&2,d=14-(u|b|h)+(c<>>15)|0,l=r>>>((d+7|0)>>>0)&1|d<<1}while(0);var l,w=Me[vi+(l<<2)+304>>2],p=0==(0|w);r:do if(p)var E=0,A=s,g=0;else{if(31==(0|l))var y=0;else var y=25-(l>>>1)|0;for(var y,m=0,S=s,M=w,t=M>>2,C=r<>>0>>0){if((0|T)==(0|r)){var E=M,A=O,g=M;break r}var N=M,I=O}else var N=m,I=S;var I,N,P=Me[t+5],D=Me[((C>>>31<<2)+16>>2)+t],L=0==(0|P)|(0|P)==(0|D)?R:P;if(0==(0|D)){var E=N,A=I,g=L;break r}var m=N,S=I,M=D,t=M>>2,C=C<<1,R=L}}while(0);var g,A,E,F=0==(0|g)&0==(0|E);do if(F){var X=2<>2]&(X|-X);if(0==(0|j)){var U=g;break}var x=(j&-j)-1|0,z=x>>>12&16,V=x>>>(z>>>0),B=V>>>5&8,H=V>>>(B>>>0),K=H>>>2&4,Y=H>>>(K>>>0),G=Y>>>1&2,W=Y>>>(G>>>0),Z=W>>>1&1,U=Se[vi+((B|z|K|G|Z)+(W>>>(Z>>>0))<<2)+304>>2]}else var U=g;while(0);var U,Q=0==(0|U);r:do if(Q)var q=A,$=E,v=$>>2;else for(var J=U,i=J>>2,rr=A,ar=E;;){var ar,rr,J,er=(Se[i+1]&-8)-r|0,ir=er>>>0>>0,vr=ir?er:rr,tr=ir?J:ar,fr=Me[i+4];if(0==(0|fr)){var _r=Me[i+5];if(0==(0|_r)){var q=vr,$=tr,v=$>>2;break r}var J=_r,i=J>>2,rr=vr,ar=tr}else var J=fr,i=J>>2,rr=vr,ar=tr}while(0);var $,q,sr=0==(0|$);r:do{if(!sr){if(q>>>0>=(Se[vi+8>>2]-r|0)>>>0){var nr=0;break}var or=$,e=or>>2,lr=Me[vi+16>>2],br=or>>>0>>0;do if(!br){var kr=or+r|0,ur=kr;if(or>>>0>=kr>>>0)break;var cr=Me[v+6],hr=Me[v+3],dr=(0|hr)==(0|$);do if(dr){var wr=$+20|0,pr=Se[wr>>2];if(0==(0|pr)){var Er=$+16|0,Ar=Se[Er>>2];if(0==(0|Ar)){var gr=0,a=gr>>2;break}var yr=Er,mr=Ar}else{var yr=wr,mr=pr;f=28}for(;;){var mr,yr,Sr=mr+20|0,Mr=Se[Sr>>2];if(0==(0|Mr)){var Cr=mr+16|0,Rr=Me[Cr>>2];if(0==(0|Rr))break;var yr=Cr,mr=Rr}else var yr=Sr,mr=Mr}if(yr>>>0>>0)throw Ka(),"Reached an unreachable!";Se[yr>>2]=0;var gr=mr,a=gr>>2}else{var Tr=Me[v+2];if(Tr>>>0>>0)throw Ka(),"Reached an unreachable!";Se[Tr+12>>2]=hr,Se[hr+8>>2]=Tr;var gr=hr,a=gr>>2}while(0);var gr,Or=0==(0|cr);a:do if(!Or){var Nr=$+28|0,Ir=(Se[Nr>>2]<<2)+vi+304|0,Pr=(0|$)==(0|Se[Ir>>2]);do{if(Pr){if(Se[Ir>>2]=gr,0!=(0|gr))break;var Dr=Se[vi+4>>2]&(1<>2]^-1);Se[vi+4>>2]=Dr;break a}if(cr>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";var Lr=cr+16|0;if((0|Se[Lr>>2])==(0|$)?Se[Lr>>2]=gr:Se[cr+20>>2]=gr,0==(0|gr))break a}while(0);if(gr>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[a+6]=cr;var Fr=Me[v+4];if(0!=(0|Fr)){if(Fr>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[a+4]=Fr,Se[Fr+24>>2]=gr}var Xr=Me[v+5];if(0==(0|Xr))break;if(Xr>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[a+5]=Xr,Se[Xr+24>>2]=gr}while(0);var jr=q>>>0<16;a:do if(jr){var Ur=q+r|0;Se[v+1]=3|Ur;var xr=Ur+(or+4)|0,zr=1|Se[xr>>2];Se[xr>>2]=zr}else if(Se[v+1]=3|r,Se[_+(e+1)]=1|q,Se[(q>>2)+e+_]=q,q>>>0<256){var Vr=q>>>2&1073741822,Br=(Vr<<2)+vi+40|0,Hr=Me[vi>>2],Kr=1<<(q>>>3),Yr=0==(Hr&Kr|0);do{if(!Yr){var Gr=(Vr+2<<2)+vi+40|0,Wr=Me[Gr>>2];if(Wr>>>0>=Me[vi+16>>2]>>>0){var Zr=Wr,Qr=Gr;break}throw Ka(),"Reached an unreachable!"}Se[vi>>2]=Hr|Kr;var Zr=Br,Qr=(Vr+2<<2)+vi+40|0}while(0);var Qr,Zr;Se[Qr>>2]=ur,Se[Zr+12>>2]=ur,Se[_+(e+2)]=Zr,Se[_+(e+3)]=Br}else{var qr=kr,$r=q>>>8,Jr=0==(0|$r);do if(Jr)var ra=0;else{if(q>>>0>16777215){var ra=31;break}var aa=($r+1048320|0)>>>16&8,ea=$r<>>16&4,va=ea<>>16&2,fa=14-(ia|aa|ta)+(va<>>15)|0,ra=q>>>((fa+7|0)>>>0)&1|fa<<1}while(0);var ra,_a=(ra<<2)+vi+304|0;Se[_+(e+7)]=ra;var sa=r+(or+16)|0;Se[_+(e+5)]=0,Se[sa>>2]=0;var na=Se[vi+4>>2],oa=1<>2]=la,Se[_a>>2]=qr,Se[_+(e+6)]=_a,Se[_+(e+3)]=qr,Se[_+(e+2)]=qr}else{if(31==(0|ra))var ba=0;else var ba=25-(ra>>>1)|0;for(var ba,ka=q<>2];;){var ua,ka;if((Se[ua+4>>2]&-8|0)==(0|q)){var ca=ua+8|0,ha=Me[ca>>2],da=Me[vi+16>>2],wa=ua>>>0>>0;do if(!wa){if(ha>>>0>>0)break;Se[ha+12>>2]=qr,Se[ca>>2]=qr,Se[_+(e+2)]=ha,Se[_+(e+3)]=ua,Se[_+(e+6)]=0;break a}while(0);throw Ka(),"Reached an unreachable!"}var pa=(ka>>>31<<2)+ua+16|0,Ea=Me[pa>>2];if(0==(0|Ea)){if(pa>>>0>=Me[vi+16>>2]>>>0){Se[pa>>2]=qr,Se[_+(e+6)]=ua,Se[_+(e+3)]=qr,Se[_+(e+2)]=qr;break a}throw Ka(),"Reached an unreachable!"}var ka=ka<<1,ua=Ea}}}while(0);var nr=$+8|0;break r}while(0);throw Ka(),"Reached an unreachable!"}var nr=0}while(0);var nr;return nr}function ia(r){var a;0==(0|Se[ti>>2])&&ba();var e=r>>>0<4294967232;r:do if(e){var i=Me[vi+24>>2];if(0==(0|i)){var v=0;break}var t=Me[vi+12>>2],f=t>>>0>(r+40|0)>>>0;do if(f){var _=Me[ti+8>>2],s=-40-r-1+t+_|0,n=Math.floor((s>>>0)/(_>>>0)),o=(n-1)*_|0,l=i,b=ua(l);if(0!=(8&Se[b+12>>2]|0))break;var k=re(0),a=(b+4|0)>>2;if((0|k)!=(Se[b>>2]+Se[a]|0))break;var u=o>>>0>2147483646?-2147483648-_|0:o,c=0|-u,h=re(c),d=re(0);if(!((0|h)!=-1&d>>>0>>0))break;var w=k-d|0;if((0|k)==(0|d))break;var p=Se[a]-w|0;Se[a]=p;var E=Se[vi+432>>2]-w|0;Se[vi+432>>2]=E;var A=Se[vi+24>>2],g=Se[vi+12>>2]-w|0;ca(A,g);var v=(0|k)!=(0|d);break r}while(0);if(Me[vi+12>>2]>>>0<=Me[vi+28>>2]>>>0){var v=0;break}Se[vi+28>>2]=-1;var v=0}else var v=0;while(0);var v;return 1&v}function va(r){var a,e,i,v,t,f,_,s=r>>2,n=0==(0|r);r:do if(!n){var o=r-8|0,l=o,b=Me[vi+16>>2],k=o>>>0>>0;a:do if(!k){var u=Me[r-4>>2],c=3&u;if(1==(0|c))break;var h=u&-8,f=h>>2,d=r+(h-8)|0,w=d,p=0==(1&u|0);e:do if(p){var E=Me[o>>2];if(0==(0|c))break r;var A=-8-E|0,t=A>>2,g=r+A|0,y=g,m=E+h|0;if(g>>>0>>0)break a;if((0|y)==(0|Se[vi+20>>2])){var v=(r+(h-4)|0)>>2;if(3!=(3&Se[v]|0)){var S=y,i=S>>2,M=m;break}Se[vi+8>>2]=m;var C=Se[v]&-2;Se[v]=C,Se[t+(s+1)]=1|m,Se[d>>2]=m;break r}if(E>>>0<256){var R=Me[t+(s+2)],T=Me[t+(s+3)];if((0|R)!=(0|T)){var O=((E>>>2&1073741822)<<2)+vi+40|0,N=(0|R)!=(0|O)&R>>>0>>0;do if(!N){if(!((0|T)==(0|O)|T>>>0>=b>>>0))break;Se[R+12>>2]=T,Se[T+8>>2]=R;var S=y,i=S>>2,M=m;break e}while(0);throw Ka(),"Reached an unreachable!"}var I=Se[vi>>2]&(1<<(E>>>3)^-1);Se[vi>>2]=I;var S=y,i=S>>2,M=m}else{var P=g,D=Me[t+(s+6)],L=Me[t+(s+3)],F=(0|L)==(0|P);do if(F){var X=A+(r+20)|0,j=Se[X>>2];if(0==(0|j)){var U=A+(r+16)|0,x=Se[U>>2];if(0==(0|x)){var z=0,e=z>>2;break}var V=U,B=x}else{var V=X,B=j;_=21}for(;;){var B,V,H=B+20|0,K=Se[H>>2];if(0==(0|K)){var Y=B+16|0,G=Me[Y>>2];if(0==(0|G))break;var V=Y,B=G}else var V=H,B=K}if(V>>>0>>0)throw Ka(),"Reached an unreachable!";Se[V>>2]=0;var z=B,e=z>>2}else{var W=Me[t+(s+2)];if(W>>>0>>0)throw Ka(),"Reached an unreachable!";Se[W+12>>2]=L,Se[L+8>>2]=W;var z=L,e=z>>2}while(0);var z;if(0==(0|D)){var S=y,i=S>>2,M=m;break}var Z=A+(r+28)|0,Q=(Se[Z>>2]<<2)+vi+304|0,q=(0|P)==(0|Se[Q>>2]);do{if(q){if(Se[Q>>2]=z,0!=(0|z))break;var $=Se[vi+4>>2]&(1<>2]^-1);Se[vi+4>>2]=$;var S=y,i=S>>2,M=m;break e}if(D>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";var J=D+16|0;if((0|Se[J>>2])==(0|P)?Se[J>>2]=z:Se[D+20>>2]=z,0==(0|z)){var S=y,i=S>>2,M=m;break e}}while(0);if(z>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[e+6]=D;var rr=Me[t+(s+4)];if(0!=(0|rr)){if(rr>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[e+4]=rr,Se[rr+24>>2]=z}var ar=Me[t+(s+5)];if(0==(0|ar)){var S=y,i=S>>2,M=m;break}if(ar>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[e+5]=ar,Se[ar+24>>2]=z;var S=y,i=S>>2,M=m}}else var S=l,i=S>>2,M=h;while(0);var M,S,er=S;if(er>>>0>=d>>>0)break;var ir=r+(h-4)|0,vr=Me[ir>>2];if(0==(1&vr|0))break;var tr=0==(2&vr|0);do{if(tr){if((0|w)==(0|Se[vi+24>>2])){var fr=Se[vi+12>>2]+M|0;Se[vi+12>>2]=fr,Se[vi+24>>2]=S;var _r=1|fr;if(Se[i+1]=_r,(0|S)==(0|Se[vi+20>>2])&&(Se[vi+20>>2]=0,Se[vi+8>>2]=0),fr>>>0<=Me[vi+28>>2]>>>0)break r;ia(0);break r}if((0|w)==(0|Se[vi+20>>2])){var sr=Se[vi+8>>2]+M|0;Se[vi+8>>2]=sr,Se[vi+20>>2]=S;var nr=1|sr;Se[i+1]=nr;var or=er+sr|0;Se[or>>2]=sr;break r}var lr=(vr&-8)+M|0,br=vr>>>3,kr=vr>>>0<256;e:do if(kr){var ur=Me[s+f],cr=Me[((4|h)>>2)+s];if((0|ur)!=(0|cr)){var hr=((vr>>>2&1073741822)<<2)+vi+40|0,dr=(0|ur)==(0|hr);do{if(!dr){if(ur>>>0>2]>>>0){_=66;break}_=63;break}_=63}while(0);do if(63==_){if((0|cr)!=(0|hr)&&cr>>>0>2]>>>0)break;Se[ur+12>>2]=cr,Se[cr+8>>2]=ur;break e}while(0);throw Ka(),"Reached an unreachable!"}var wr=Se[vi>>2]&(1<>2]=wr}else{var pr=d,Er=Me[f+(s+4)],Ar=Me[((4|h)>>2)+s],gr=(0|Ar)==(0|pr);do if(gr){var yr=h+(r+12)|0,mr=Se[yr>>2];if(0==(0|mr)){var Sr=h+(r+8)|0,Mr=Se[Sr>>2];if(0==(0|Mr)){var Cr=0,a=Cr>>2;break}var Rr=Sr,Tr=Mr}else{var Rr=yr,Tr=mr;_=73}for(;;){var Tr,Rr,Or=Tr+20|0,Nr=Se[Or>>2];if(0==(0|Nr)){var Ir=Tr+16|0,Pr=Me[Ir>>2];if(0==(0|Pr))break;var Rr=Ir,Tr=Pr}else var Rr=Or,Tr=Nr}if(Rr>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[Rr>>2]=0;var Cr=Tr,a=Cr>>2}else{var Dr=Me[s+f];if(Dr>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[Dr+12>>2]=Ar, -Se[Ar+8>>2]=Dr;var Cr=Ar,a=Cr>>2}while(0);var Cr;if(0==(0|Er))break;var Lr=h+(r+20)|0,Fr=(Se[Lr>>2]<<2)+vi+304|0,Xr=(0|pr)==(0|Se[Fr>>2]);do{if(Xr){if(Se[Fr>>2]=Cr,0!=(0|Cr))break;var jr=Se[vi+4>>2]&(1<>2]^-1);Se[vi+4>>2]=jr;break e}if(Er>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";var Ur=Er+16|0;if((0|Se[Ur>>2])==(0|pr)?Se[Ur>>2]=Cr:Se[Er+20>>2]=Cr,0==(0|Cr))break e}while(0);if(Cr>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[a+6]=Er;var xr=Me[f+(s+2)];if(0!=(0|xr)){if(xr>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[a+4]=xr,Se[xr+24>>2]=Cr}var zr=Me[f+(s+3)];if(0==(0|zr))break;if(zr>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[a+5]=zr,Se[zr+24>>2]=Cr}while(0);if(Se[i+1]=1|lr,Se[er+lr>>2]=lr,(0|S)!=(0|Se[vi+20>>2])){var Vr=lr;break}Se[vi+8>>2]=lr;break r}Se[ir>>2]=vr&-2,Se[i+1]=1|M,Se[er+M>>2]=M;var Vr=M}while(0);var Vr;if(Vr>>>0<256){var Br=Vr>>>2&1073741822,Hr=(Br<<2)+vi+40|0,Kr=Me[vi>>2],Yr=1<<(Vr>>>3),Gr=0==(Kr&Yr|0);do{if(!Gr){var Wr=(Br+2<<2)+vi+40|0,Zr=Me[Wr>>2];if(Zr>>>0>=Me[vi+16>>2]>>>0){var Qr=Zr,qr=Wr;break}throw Ka(),"Reached an unreachable!"}Se[vi>>2]=Kr|Yr;var Qr=Hr,qr=(Br+2<<2)+vi+40|0}while(0);var qr,Qr;Se[qr>>2]=S,Se[Qr+12>>2]=S,Se[i+2]=Qr,Se[i+3]=Hr;break r}var $r=S,Jr=Vr>>>8,ra=0==(0|Jr);do if(ra)var aa=0;else{if(Vr>>>0>16777215){var aa=31;break}var ea=(Jr+1048320|0)>>>16&8,va=Jr<>>16&4,_a=va<>>16&2,na=14-(fa|ea|sa)+(_a<>>15)|0,aa=Vr>>>((na+7|0)>>>0)&1|na<<1}while(0);var aa,oa=(aa<<2)+vi+304|0;Se[i+7]=aa,Se[i+5]=0,Se[i+4]=0;var la=Se[vi+4>>2],ba=1<>2]=ua,Se[oa>>2]=$r,Se[i+6]=oa,Se[i+3]=S,Se[i+2]=S}else{if(31==(0|aa))var ca=0;else var ca=25-(aa>>>1)|0;for(var ca,ha=Vr<>2];;){var da,ha;if((Se[da+4>>2]&-8|0)==(0|Vr)){var wa=da+8|0,pa=Me[wa>>2],Ea=Me[vi+16>>2],Aa=da>>>0>>0;do if(!Aa){if(pa>>>0>>0)break;Se[pa+12>>2]=$r,Se[wa>>2]=$r,Se[i+2]=pa,Se[i+3]=da,Se[i+6]=0;break e}while(0);throw Ka(),"Reached an unreachable!"}var ga=(ha>>>31<<2)+da+16|0,ya=Me[ga>>2];if(0==(0|ya)){if(ga>>>0>=Me[vi+16>>2]>>>0){Se[ga>>2]=$r,Se[i+6]=da,Se[i+3]=S,Se[i+2]=S;break e}throw Ka(),"Reached an unreachable!"}var ha=ha<<1,da=ya}}while(0);var ma=Se[vi+32>>2]-1|0;if(Se[vi+32>>2]=ma,0!=(0|ma))break r;ta();break r}while(0);throw Ka(),"Reached an unreachable!"}while(0)}function ta(){var r=Se[vi+452>>2],a=0==(0|r);r:do if(!a)for(var e=r;;){var e,i=Se[e+8>>2];if(0==(0|i))break r;var e=i}while(0);Se[vi+32>>2]=-1}function fa(r,a){if(0==(0|r))var e=Jr(a),i=e;else var v=la(r,a),i=v;var i;return i}function _a(r,a){var e,i=r>>>0<9;do if(i)var v=Jr(a),t=v;else{var f=r>>>0<16?16:r,_=0==(f-1&f|0);r:do if(_)var s=f;else{if(f>>>0<=16){var s=16;break}for(var n=16;;){var n,o=n<<1;if(o>>>0>=f>>>0){var s=o;break r}var n=o}}while(0);var s;if((-64-s|0)>>>0>a>>>0){if(a>>>0<11)var l=16;else var l=a+11&-8;var l,b=Jr(l+(s+12)|0);if(0==(0|b)){var t=0;break}var k=b-8|0;if(0==((b>>>0)%(s>>>0)|0))var u=k,c=0;else{var h=b+(s-1)&-s,d=h-8|0,w=k;if((d-w|0)>>>0>15)var p=d;else var p=h+(s-8)|0;var p,E=p-w|0,e=(b-4|0)>>2,A=Se[e],g=(A&-8)-E|0;if(0==(3&A|0)){var y=Se[k>>2]+E|0;Se[p>>2]=y,Se[p+4>>2]=g;var u=p,c=0}else{var m=p+4|0,S=g|1&Se[m>>2]|2;Se[m>>2]=S;var M=g+(p+4)|0,C=1|Se[M>>2];Se[M>>2]=C;var R=E|1&Se[e]|2;Se[e]=R;var T=b+(E-4)|0,O=1|Se[T>>2];Se[T>>2]=O;var u=p,c=b}}var c,u,N=u+4|0,I=Me[N>>2],P=0==(3&I|0);do if(P)var D=0;else{var L=I&-8;if(L>>>0<=(l+16|0)>>>0){var D=0;break}var F=L-l|0;Se[N>>2]=l|1&I|2,Se[u+(4|l)>>2]=3|F;var X=u+(4|L)|0,j=1|Se[X>>2];Se[X>>2]=j;var D=l+(u+8)|0}while(0);var D;0!=(0|c)&&va(c),0!=(0|D)&&va(D);var t=u+8|0}else{var U=Je();Se[U>>2]=12;var t=0}}while(0);var t;return t}function sa(r,a,e,i){var v,t;0==(0|Se[ti>>2])&&ba();var f=0==(0|i),_=0==(0|r);do{if(f){if(_){var s=Jr(0),n=s;t=30;break}var o=r<<2;if(o>>>0<11){var l=0,b=16;t=9;break}var l=0,b=o+11&-8;t=9;break}if(_){var n=i;t=30;break}var l=i,b=0;t=9;break}while(0);do if(9==t){var b,l,k=0==(1&e|0);r:do if(k){if(_){var u=0,c=0;break}for(var h=0,d=0;;){var d,h,w=Me[a+(d<<2)>>2];if(w>>>0<11)var p=16;else var p=w+11&-8;var p,E=p+h|0,A=d+1|0;if((0|A)==(0|r)){var u=0,c=E;break r}var h=E,d=A}}else{var g=Me[a>>2];if(g>>>0<11)var y=16;else var y=g+11&-8;var y,u=y,c=y*r|0}while(0);var c,u,m=Jr(b-4+c|0);if(0==(0|m)){var n=0;break}var S=m-8|0,M=Se[m-4>>2]&-8;if(0!=(2&e|0)){var C=-4-b+M|0;Fa(m,0,C,1)}if(0==(0|l)){var R=m+c|0,T=M-c|3;Se[m+(c-4)>>2]=T;var O=R,v=O>>2,N=c}else var O=l,v=O>>2,N=M;var N,O;Se[v]=m;var I=r-1|0,P=0==(0|I);r:do if(P)var D=S,L=N;else if(0==(0|u))for(var F=S,X=N,j=0;;){var j,X,F,U=Me[a+(j<<2)>>2];if(U>>>0<11)var x=16;else var x=U+11&-8;var x,z=X-x|0;Se[F+4>>2]=3|x;var V=F+x|0,B=j+1|0;if(Se[(B<<2>>2)+v]=x+(F+8)|0,(0|B)==(0|I)){var D=V,L=z;break r}var F=V,X=z,j=B}else for(var H=3|u,K=u+8|0,Y=S,G=N,W=0;;){var W,G,Y,Z=G-u|0;Se[Y+4>>2]=H;var Q=Y+u|0,q=W+1|0;if(Se[(q<<2>>2)+v]=Y+K|0,(0|q)==(0|I)){var D=Q,L=Z;break r}var Y=Q,G=Z,W=q}while(0);var L,D;Se[D+4>>2]=3|L;var n=O}while(0);var n;return n}function na(r){var a=r>>2;0==(0|Se[ti>>2])&&ba();var e=Me[vi+24>>2];if(0==(0|e))var i=0,v=0,t=0,f=0,_=0,s=0,n=0;else{for(var o=Me[vi+12>>2],l=o+40|0,b=vi+444|0,k=l,u=l,c=1;;){var c,u,k,b,h=Me[b>>2],d=h+8|0;if(0==(7&d|0))var w=0;else var w=7&-d;for(var w,p=b+4|0,E=h+w|0,A=c,g=u,y=k;;){var y,g,A,E;if(E>>>0>>0)break;if(E>>>0>=(h+Se[p>>2]|0)>>>0|(0|E)==(0|e))break;var m=Se[E+4>>2];if(7==(0|m))break;var S=m&-8,M=S+y|0;if(1==(3&m|0))var C=A+1|0,R=S+g|0;else var C=A,R=g;var R,C,E=E+S|0,A=C,g=R,y=M}var T=Me[b+8>>2];if(0==(0|T))break;var b=T,k=y,u=g,c=A}var O=Se[vi+432>>2],i=y,v=A,t=o,f=g,_=O-y|0,s=Se[vi+436>>2],n=O-g|0}var n,s,_,f,t,v,i;Se[a]=i,Se[a+1]=v,Se[a+2]=0,Se[a+3]=0,Se[a+4]=_,Se[a+5]=s,Se[a+6]=0,Se[a+7]=n,Se[a+8]=f,Se[a+9]=t}function oa(){0==(0|Se[ti>>2])&&ba();var r=Me[vi+24>>2],a=0==(0|r);r:do if(a)var e=0,i=0,v=0;else for(var t=Se[vi+436>>2],f=Me[vi+432>>2],_=vi+444|0,s=f-40-Se[vi+12>>2]|0;;){var s,_,n=Me[_>>2],o=n+8|0;if(0==(7&o|0))var l=0;else var l=7&-o;for(var l,b=_+4|0,k=n+l|0,u=s;;){var u,k;if(k>>>0>>0)break;if(k>>>0>=(n+Se[b>>2]|0)>>>0|(0|k)==(0|r))break;var c=Se[k+4>>2];if(7==(0|c))break;var h=c&-8,d=1==(3&c|0)?h:0,w=u-d|0,k=k+h|0,u=w}var p=Me[_+8>>2];if(0==(0|p)){var e=t,i=f,v=u;break r}var _=p,s=u}while(0);var v,i,e,E=Se[Se[qe>>2]+12>>2],A=(Qa(E,0|He.__str339,(ne=Oe,Oe+=4,Se[ne>>2]=e,ne)),Se[Se[qe>>2]+12>>2]),g=(Qa(A,0|He.__str1340,(ne=Oe,Oe+=4,Se[ne>>2]=i,ne)),Se[Se[qe>>2]+12>>2]);Qa(g,0|He.__str2341,(ne=Oe,Oe+=4,Se[ne>>2]=v,ne))}function la(r,a){var e,i,v,t=a>>>0>4294967231;r:do{if(!t){var f=r-8|0,_=f,i=(r-4|0)>>2,s=Me[i],n=s&-8,o=n-8|0,l=r+o|0,b=f>>>0>2]>>>0;do if(!b){var k=3&s;if(!(1!=(0|k)&(0|o)>-8))break;var e=(r+(n-4)|0)>>2;if(0==(1&Se[e]|0))break;if(a>>>0<11)var u=16;else var u=a+11&-8;var u,c=0==(0|k);do{if(c){var h=ka(_,u),d=0,w=h;v=17;break}if(n>>>0>>0){if((0|l)!=(0|Se[vi+24>>2])){v=21;break}var p=Se[vi+12>>2]+n|0;if(p>>>0<=u>>>0){v=21;break}var E=p-u|0,A=r+(u-8)|0;Se[i]=u|1&s|2;var g=1|E;Se[r+(u-4)>>2]=g,Se[vi+24>>2]=A,Se[vi+12>>2]=E;var d=0,w=_;v=17;break}var y=n-u|0;if(y>>>0<=15){var d=0,w=_;v=17;break}Se[i]=u|1&s|2,Se[r+(u-4)>>2]=3|y;var m=1|Se[e];Se[e]=m;var d=r+u|0,w=_;v=17;break}while(0);do if(17==v){var w,d;if(0==(0|w))break;0!=(0|d)&&va(d);var S=w+8|0;break r}while(0);var M=Jr(a);if(0==(0|M)){var S=0;break r}var C=0==(3&Se[i]|0)?8:4,R=n-C|0,T=R>>>0>>0?R:a;Pa(M,r,T,1),va(r);var S=M;break r}while(0);throw Ka(),"Reached an unreachable!"}var O=Je();Se[O>>2]=12;var S=0}while(0);var S;return S}function ba(){if(0==(0|Se[ti>>2])){var r=qa(8);if(0!=(r-1&r|0))throw Ka(),"Reached an unreachable!";Se[ti+8>>2]=r,Se[ti+4>>2]=r,Se[ti+12>>2]=-1,Se[ti+16>>2]=2097152,Se[ti+20>>2]=0,Se[vi+440>>2]=0;var a=$a(0);Se[ti>>2]=a&-16^1431655768}}function ka(r,a){var e=Se[r+4>>2]&-8,i=a>>>0<256;do if(i)var v=0;else{if(e>>>0>=(a+4|0)>>>0&&(e-a|0)>>>0<=Se[ti+8>>2]<<1>>>0){var v=r;break}var v=0}while(0);var v;return v}function ua(r){for(var a,e=vi+444|0,a=e>>2;;){var e,i=Me[a];if(i>>>0<=r>>>0&&(i+Se[a+1]|0)>>>0>r>>>0){var v=e;break}var t=Me[a+2];if(0==(0|t)){var v=0;break}var e=t,a=e>>2}var v;return v}function ca(r,a){var e=r,i=r+8|0;if(0==(7&i|0))var v=0;else var v=7&-i;var v,t=a-v|0;Se[vi+24>>2]=e+v|0,Se[vi+12>>2]=t,Se[v+(e+4)>>2]=1|t,Se[a+(e+4)>>2]=40;var f=Se[ti+16>>2];Se[vi+28>>2]=f}function ha(){for(var r=0;;){var r,a=r<<1,e=(a<<2)+vi+40|0;Se[vi+(a+3<<2)+40>>2]=e,Se[vi+(a+2<<2)+40>>2]=e;var i=r+1|0;if(32==(0|i))break;var r=i}}function da(r,a,e){var i,v,t,f,_=a>>2,s=r>>2,n=r+8|0;if(0==(7&n|0))var o=0;else var o=7&-n;var o,l=a+8|0;if(0==(7&l|0))var b=0,t=b>>2;else var b=7&-l,t=b>>2;var b,k=a+b|0,u=k,c=o+e|0,v=c>>2,h=r+c|0,d=h,w=k-(r+o)-e|0;Se[(o+4>>2)+s]=3|e;var p=(0|u)==(0|Se[vi+24>>2]);r:do if(p){var E=Se[vi+12>>2]+w|0;Se[vi+12>>2]=E,Se[vi+24>>2]=d;var A=1|E;Se[v+(s+1)]=A}else if((0|u)==(0|Se[vi+20>>2])){var g=Se[vi+8>>2]+w|0;Se[vi+8>>2]=g,Se[vi+20>>2]=d;var y=1|g;Se[v+(s+1)]=y;var m=r+g+c|0;Se[m>>2]=g}else{var S=Me[t+(_+1)];if(1==(3&S|0)){var M=S&-8,C=S>>>3,R=S>>>0<256;a:do if(R){var T=Me[((8|b)>>2)+_],O=Me[t+(_+3)];if((0|T)!=(0|O)){var N=((S>>>2&1073741822)<<2)+vi+40|0,I=(0|T)==(0|N);do{if(!I){if(T>>>0>2]>>>0){f=18;break}f=15;break}f=15}while(0);do if(15==f){if((0|O)!=(0|N)&&O>>>0>2]>>>0)break;Se[T+12>>2]=O,Se[O+8>>2]=T;break a}while(0);throw Ka(),"Reached an unreachable!"}var P=Se[vi>>2]&(1<>2]=P}else{var D=k,L=Me[((24|b)>>2)+_],F=Me[t+(_+3)],X=(0|F)==(0|D);do if(X){var j=16|b,U=j+(a+4)|0,x=Se[U>>2];if(0==(0|x)){var z=a+j|0,V=Se[z>>2];if(0==(0|V)){var B=0,i=B>>2;break}var H=z,K=V}else{var H=U,K=x;f=25}for(;;){var K,H,Y=K+20|0,G=Se[Y>>2];if(0==(0|G)){var W=K+16|0,Z=Me[W>>2];if(0==(0|Z))break;var H=W,K=Z}else var H=Y,K=G}if(H>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[H>>2]=0;var B=K,i=B>>2}else{var Q=Me[((8|b)>>2)+_];if(Q>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[Q+12>>2]=F,Se[F+8>>2]=Q;var B=F,i=B>>2}while(0);var B;if(0==(0|L))break;var q=b+(a+28)|0,$=(Se[q>>2]<<2)+vi+304|0,J=(0|D)==(0|Se[$>>2]);do{if(J){if(Se[$>>2]=B,0!=(0|B))break;var rr=Se[vi+4>>2]&(1<>2]^-1);Se[vi+4>>2]=rr;break a}if(L>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";var ar=L+16|0;if((0|Se[ar>>2])==(0|D)?Se[ar>>2]=B:Se[L+20>>2]=B,0==(0|B))break a}while(0);if(B>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[i+6]=L;var er=16|b,ir=Me[(er>>2)+_];if(0!=(0|ir)){if(ir>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[i+4]=ir,Se[ir+24>>2]=B}var vr=Me[(er+4>>2)+_];if(0==(0|vr))break;if(vr>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[i+5]=vr,Se[vr+24>>2]=B}while(0);var tr=a+(M|b)|0,fr=M+w|0}else var tr=u,fr=w;var fr,tr,_r=tr+4|0,sr=Se[_r>>2]&-2;if(Se[_r>>2]=sr,Se[v+(s+1)]=1|fr,Se[(fr>>2)+s+v]=fr,fr>>>0<256){var nr=fr>>>2&1073741822,or=(nr<<2)+vi+40|0,lr=Me[vi>>2],br=1<<(fr>>>3),kr=0==(lr&br|0);do{if(!kr){var ur=(nr+2<<2)+vi+40|0,cr=Me[ur>>2];if(cr>>>0>=Me[vi+16>>2]>>>0){var hr=cr,dr=ur;break}throw Ka(),"Reached an unreachable!"}Se[vi>>2]=lr|br;var hr=or,dr=(nr+2<<2)+vi+40|0}while(0);var dr,hr;Se[dr>>2]=d,Se[hr+12>>2]=d,Se[v+(s+2)]=hr,Se[v+(s+3)]=or}else{var wr=h,pr=fr>>>8,Er=0==(0|pr);do if(Er)var Ar=0;else{if(fr>>>0>16777215){var Ar=31;break}var gr=(pr+1048320|0)>>>16&8,yr=pr<>>16&4,Sr=yr<>>16&2,Cr=14-(mr|gr|Mr)+(Sr<>>15)|0,Ar=fr>>>((Cr+7|0)>>>0)&1|Cr<<1}while(0);var Ar,Rr=(Ar<<2)+vi+304|0;Se[v+(s+7)]=Ar;var Tr=c+(r+16)|0;Se[v+(s+5)]=0,Se[Tr>>2]=0;var Or=Se[vi+4>>2],Nr=1<>2]=Ir,Se[Rr>>2]=wr,Se[v+(s+6)]=Rr,Se[v+(s+3)]=wr,Se[v+(s+2)]=wr}else{if(31==(0|Ar))var Pr=0;else var Pr=25-(Ar>>>1)|0;for(var Pr,Dr=fr<>2];;){var Lr,Dr;if((Se[Lr+4>>2]&-8|0)==(0|fr)){var Fr=Lr+8|0,Xr=Me[Fr>>2],jr=Me[vi+16>>2],Ur=Lr>>>0>>0;do if(!Ur){if(Xr>>>0>>0)break;Se[Xr+12>>2]=wr,Se[Fr>>2]=wr,Se[v+(s+2)]=Xr,Se[v+(s+3)]=Lr,Se[v+(s+6)]=0;break r}while(0);throw Ka(),"Reached an unreachable!"}var xr=(Dr>>>31<<2)+Lr+16|0,zr=Me[xr>>2];if(0==(0|zr)){if(xr>>>0>=Me[vi+16>>2]>>>0){Se[xr>>2]=wr,Se[v+(s+6)]=Lr,Se[v+(s+3)]=wr,Se[v+(s+2)]=wr;break r}throw Ka(),"Reached an unreachable!"}var Dr=Dr<<1,Lr=zr}}}}while(0);return r+(8|o)|0}function wa(r){return 0|He.__str3342}function pa(r){return 0|He.__str14343}function Ea(r){Se[r>>2]=si+8|0}function Aa(r){0!=(0|r)&&va(r)}function ga(r){ya(r);var a=r;Aa(a)}function ya(r){var a=0|r;Ye(a)}function ma(r){var a=0|r;Ea(a),Se[r>>2]=ni+8|0}function Sa(r){var a=0|r;ya(a);var e=r;Aa(e)}function Ma(r,a){var e,i,v=Me[vi+24>>2],i=v>>2,t=v,f=ua(t),_=Se[f>>2],s=Se[f+4>>2],n=_+s|0,o=_+(s-39)|0;if(0==(7&o|0))var l=0;else var l=7&-o;var l,b=_+(s-47)+l|0,k=b>>>0<(v+16|0)>>>0?t:b,u=k+8|0,e=u>>2,c=u,h=r,d=a-40|0;ca(h,d);var w=k+4|0;Se[w>>2]=27,Se[e]=Se[vi+444>>2],Se[e+1]=Se[vi+448>>2],Se[e+2]=Se[vi+452>>2],Se[e+3]=Se[vi+456>>2],Se[vi+444>>2]=r,Se[vi+448>>2]=a,Se[vi+456>>2]=0,Se[vi+452>>2]=c;var p=k+28|0;Se[p>>2]=7;var E=(k+32|0)>>>0>>0;r:do if(E)for(var A=p;;){var A,g=A+4|0;if(Se[g>>2]=7,(A+8|0)>>>0>=n>>>0)break r;var A=g}while(0);var y=(0|k)==(0|t);r:do if(!y){var m=k-v|0,S=t+m|0,M=m+(t+4)|0,C=Se[M>>2]&-2;Se[M>>2]=C;var R=1|m;Se[i+1]=R;var T=S;if(Se[T>>2]=m,m>>>0<256){var O=m>>>2&1073741822,N=(O<<2)+vi+40|0,I=Me[vi>>2],P=1<<(m>>>3),D=0==(I&P|0);do{if(!D){var L=(O+2<<2)+vi+40|0,F=Me[L>>2];if(F>>>0>=Me[vi+16>>2]>>>0){var X=F,j=L;break}throw Ka(),"Reached an unreachable!"}var U=I|P;Se[vi>>2]=U;var X=N,j=(O+2<<2)+vi+40|0}while(0);var j,X;Se[j>>2]=v,Se[X+12>>2]=v,Se[i+2]=X,Se[i+3]=N}else{var x=v,z=m>>>8,V=0==(0|z);do if(V)var B=0;else{if(m>>>0>16777215){var B=31;break}var H=(z+1048320|0)>>>16&8,K=z<>>16&4,G=K<>>16&2,Z=14-(Y|H|W)+(G<>>15)|0,B=m>>>((Z+7|0)>>>0)&1|Z<<1}while(0);var B,Q=(B<<2)+vi+304|0;Se[i+7]=B,Se[i+5]=0,Se[i+4]=0;var q=Se[vi+4>>2],$=1<>2]=J,Se[Q>>2]=x,Se[i+6]=Q,Se[i+3]=v,Se[i+2]=v}else{if(31==(0|B))var rr=0;else var rr=25-(B>>>1)|0;for(var rr,ar=m<>2];;){var er,ar;if((Se[er+4>>2]&-8|0)==(0|m)){var ir=er+8|0,vr=Me[ir>>2],tr=Me[vi+16>>2],fr=er>>>0>>0;do if(!fr){if(vr>>>0>>0)break;Se[vr+12>>2]=x,Se[ir>>2]=x,Se[i+2]=vr,Se[i+3]=er,Se[i+6]=0;break r}while(0);throw Ka(),"Reached an unreachable!"}var _r=(ar>>>31<<2)+er+16|0,sr=Me[_r>>2];if(0==(0|sr)){if(_r>>>0>=Me[vi+16>>2]>>>0){Se[_r>>2]=x,Se[i+6]=er,Se[i+3]=v,Se[i+2]=v;break r}throw Ka(),"Reached an unreachable!"}var ar=ar<<1,er=sr}}}}while(0)}function Ca(r){return d(r)}function Ra(r,a){var e=0;do Ae[r+e]=Ae[a+e],e++;while(0!=Ae[a+e-1]);return r}function Ta(){var r=Ta;return r.LLVM_SAVEDSTACKS||(r.LLVM_SAVEDSTACKS=[]),r.LLVM_SAVEDSTACKS.push(le.stackSave()),r.LLVM_SAVEDSTACKS.length-1}function Oa(r){var a=Ta,e=a.LLVM_SAVEDSTACKS[r];a.LLVM_SAVEDSTACKS.splice(r,1),le.stackRestore(e)}function Na(r,a,e){for(var i=0;it?1:-1;i++}return 0}function Ia(r,a){var e=Ca(r),i=0;do Ae[r+e+i]=Ae[a+i],i++;while(0!=Ae[a+i-1]);return r}function Pa(r,a,e,i){if(e>=20&&a%2==r%2)if(a%4==r%4){for(var v=a+e;a%4;)Ae[r++]=Ae[a++];for(var t=a>>2,f=r>>2,_=v>>2;t<_;)Se[f++]=Se[t++];for(a=t<<2,r=f<<2;a>1,n=r>>1,o=v>>1;st?1:-1}return 0}function Fa(r,a,e,i){if(e>=20){for(var v=r+e;r%4;)Ae[r++]=a;a<0&&(a+=256);for(var t=r>>2,f=v>>2,_=a|a<<8|a<<16|a<<24;t>2],xe[1]=Se[a+_+4>>2],e=ze[0]):"i64"==r?e=[Se[a+_>>2],Se[a+_+4>>2]]:(r="i32",e=Se[a+_>>2]),_+=le.getNativeFieldSize(r),e}for(var i,v,t,f=r,_=0,s=[];;){var n=f;if(i=Ae[f],0===i)break;if(v=Ae[f+1],i=="%".charCodeAt(0)){var o=!1,l=!1,b=!1,k=!1;r:for(;;){switch(v){case"+".charCodeAt(0):o=!0;break;case"-".charCodeAt(0):l=!0;break;case"#".charCodeAt(0):b=!0;break;case"0".charCodeAt(0):if(k)break r;k=!0;break;default:break r}f++,v=Ae[f+1]}var u=0;if(v=="*".charCodeAt(0))u=e("i32"),f++,v=Ae[f+1];else for(;v>="0".charCodeAt(0)&&v<="9".charCodeAt(0);)u=10*u+(v-"0".charCodeAt(0)),f++,v=Ae[f+1];var c=!1;if(v==".".charCodeAt(0)){var h=0;if(c=!0,f++,v=Ae[f+1],v=="*".charCodeAt(0))h=e("i32"),f++;else for(;;){var d=Ae[f+1];if(d<"0".charCodeAt(0)||d>"9".charCodeAt(0))break;h=10*h+(d-"0".charCodeAt(0)),f++}v=Ae[f+1]}else var h=6;var E;switch(String.fromCharCode(v)){case"h":var A=Ae[f+2];A=="h".charCodeAt(0)?(f++,E=1):E=2;break;case"l":var A=Ae[f+2];A=="l".charCodeAt(0)?(f++,E=8):E=4;break;case"L":case"q":case"j":E=8;break;case"z":case"t":case"I":E=4;break;default:E=null}if(E&&f++,v=Ae[f+1],["d","i","u","o","x","X","p"].indexOf(String.fromCharCode(v))!=-1){var m=v=="d".charCodeAt(0)||v=="i".charCodeAt(0);E=E||4;var t=e("i"+8*E);if(8==E&&(t=le.makeBigInt(t[0],t[1],v=="u".charCodeAt(0))),E<=4){var S=Math.pow(256,E)-1;t=(m?y:g)(t&S,8*E)}var M,C=Math.abs(t),R="";if(v=="d".charCodeAt(0)||v=="i".charCodeAt(0))M=y(t,8*E,1).toString(10);else if(v=="u".charCodeAt(0))M=g(t,8*E,1).toString(10),t=Math.abs(t);else if(v=="o".charCodeAt(0))M=(b?"0":"")+C.toString(8);else if(v=="x".charCodeAt(0)||v=="X".charCodeAt(0)){if(R=b?"0x":"",t<0){t=-t,M=(C-1).toString(16);for(var T=[],O=0;OP&&P>=-4?(v=(v=="g".charCodeAt(0)?"f":"F").charCodeAt(0),h-=P+1):(v=(v=="g".charCodeAt(0)?"e":"E").charCodeAt(0),h--),I=Math.min(h,20)}v=="e".charCodeAt(0)||v=="E".charCodeAt(0)?(M=t.toExponential(I),/[eE][-+]\\d$/.test(M)&&(M=M.slice(0,-1)+"0"+M.slice(-1))):v!="f".charCodeAt(0)&&v!="F".charCodeAt(0)||(M=t.toFixed(I));var D=M.split("e");if(N&&!b)for(;D[0].length>1&&D[0].indexOf(".")!=-1&&("0"==D[0].slice(-1)||"."==D[0].slice(-1));)D[0]=D[0].slice(0,-1);else for(b&&M.indexOf(".")==-1&&(D[0]+=".");h>I++;)D[0]+="0";M=D[0]+(D.length>1?"e"+D[1]:""),v=="E".charCodeAt(0)&&(M=M.toUpperCase()),o&&t>=0&&(M="+"+M)}else M=(t<0?"-":"")+"inf",k=!1;for(;M.lengthh&&(L=L.slice(0,h))):L=p("(null)",!0),!l)for(;L.length0;)s.push(" ".charCodeAt(0));l||s.push(e("i8"))}else if(v=="n".charCodeAt(0)){var X=e("i32*");Se[X>>2]=s.length}else if(v=="%".charCodeAt(0))s.push(i);else for(var O=n;O="0".charCodeAt(0)&&r<="9".charCodeAt(0)}function Ha(r){for(var a;(a=Ae[r])&&Va(a);)r++;if(!a||!Ba(a))return 0;for(var e=r;(a=Ae[e])&&Ba(a);)e++;return Math.floor(Number(s(r).substr(0,e-r)))}function Ka(r){throw ke=!0,"ABORT: "+r+", at "+(new Error).stack}function Ya(r){return Ya.ret||(Ya.ret=_([0],"i32",we)),Se[Ya.ret>>2]=r,r}function Ga(r,a,e,i){var v=$e.streams[r];if(!v||v.object.isDevice)return Ya(Ge.EBADF),-1;if(v.isWrite){if(v.object.isFolder)return Ya(Ge.EISDIR),-1;if(e<0||i<0)return Ya(Ge.EINVAL),-1;for(var t=v.object.contents;t.length>2]=a),a}function Ja(){return Ya.ret}function re(r){var a=re;a.called||(Ie=o(Ie),a.called=!0);var e=Ie;return 0!=r&&le.staticAlloc(r),e}function ae(){return Se[ae.buf>>2]}function ee(r){r=r||Module.arguments,k();var a=null;return Module._main&&(a=Module.callMain(r),Module.noExitRuntime||u()),a}var ie=[],ve=false,te="object"==typeof window,fe="function"==typeof importScripts,_e=!te&&!ve&&!fe;if(ve){print=function(r){process.stdout.write(r+"\\n")},printErr=function(r){process.stderr.write(r+"\\n")};var se=require("fs");read=function(r){var a=se.readFileSync(r).toString();return a||"/"==r[0]||(r=__dirname.split("/").slice(0,-1).join("/")+"/src/"+r,a=se.readFileSync(r).toString()),a},load=function(a){r(read(a))},ie=process.argv.slice(2)}else if(_e)this.read||(this.read=function(r){snarf(r)}),"undefined"!=typeof scriptArgs?ie=scriptArgs:"undefined"!=typeof arguments&&(ie=arguments);else if(te)this.print=printErr=function(r){console.log(r)},this.read=function(r){var a=new XMLHttpRequest;return a.open("GET",r,!1),a.send(null),a.responseText},this.arguments&&(ie=arguments);else{if(!fe)throw"Unknown runtime environment. Where are we?";this.load=importScripts}"undefined"==typeof load&&"undefined"!=typeof read&&(this.load=function(a){r(read(a))}),"undefined"==typeof printErr&&(this.printErr=function(){}),"undefined"==typeof print&&(this.print=printErr);try{this.Module=Module}catch(r){this.Module=Module={}}Module.arguments||(Module.arguments=ie),Module.print&&(print=Module.print);var ne,oe,le={stackSave:function(){return Oe},stackRestore:function(r){Oe=r},forceAlign:function(r,a){if(a=a||4,1==a)return r;if(isNumber(r)&&isNumber(a))return Math.ceil(r/a)*a;if(isNumber(a)&&isPowerOfTwo(a)){var e=log2(a);return"(((("+r+")+"+(a-1)+")>>"+e+")<<"+e+")"}return"Math.ceil(("+r+")/"+a+")*"+a},isNumberType:function(r){return r in le.INT_TYPES||r in le.FLOAT_TYPES},isPointerType:function(r){return"*"==r[r.length-1]},isStructType:function(r){return!isPointerType(r)&&(!!/^\\[\\d+\\ x\\ (.*)\\]/.test(r)||(!!/?/.test(r)||"%"==r[0]))},INT_TYPES:{i1:0,i8:0,i16:0,i32:0,i64:0},FLOAT_TYPES:{float:0,double:0},bitshift64:function(r,e,i,v){var t=Math.pow(2,v)-1;if(v<32)switch(i){case"shl":return[r<>>32-v];case"ashr":return[(r>>>v|(e&t)<<32-v)>>0>>>0,e>>v>>>0];case"lshr":return[(r>>>v|(e&t)<<32-v)>>>0,e>>>v]}else if(32==v)switch(i){case"shl":return[0,r];case"ashr":return[e,(0|e)<0?t:0];case"lshr":return[e,0]}else switch(i){case"shl":return[0,r<>v-32>>>0,(0|e)<0?t:0];case"lshr":return[e>>>v-32,0]}a("unknown bitshift64 op: "+[value,i,v])},or64:function(r,a){var e=0|r|(0|a),i=4294967296*(Math.round(r/4294967296)|Math.round(a/4294967296));return e+i},and64:function(r,a){var e=(0|r)&(0|a),i=4294967296*(Math.round(r/4294967296)&Math.round(a/4294967296));return e+i},xor64:function(r,a){var e=(0|r)^(0|a),i=4294967296*(Math.round(r/4294967296)^Math.round(a/4294967296));return e+i},getNativeTypeSize:function(r,a){if(1==le.QUANTUM_SIZE)return 1;var i={"%i1":1,"%i8":1,"%i16":2,"%i32":4,"%i64":8,"%float":4,"%double":8}["%"+r];if(!i)if("*"==r[r.length-1])i=le.QUANTUM_SIZE;else if("i"==r[0]){var v=parseInt(r.substr(1));e(v%8==0),i=v/8}return i},getNativeFieldSize:function(r){return Math.max(le.getNativeTypeSize(r),le.QUANTUM_SIZE)},dedup:function(r,a){var e={};return a?r.filter(function(r){return!e[r[a]]&&(e[r[a]]=!0,!0)}):r.filter(function(r){return!e[r]&&(e[r]=!0,!0)})},set:function(){for(var r="object"==typeof arguments[0]?arguments[0]:arguments,a={},e=0;e=0&&a.push(f-e),e=f,f}),r.flatSize=le.alignMemory(r.flatSize,r.alignSize),0==a.length?r.flatFactor=r.flatSize:1==le.dedup(a).length&&(r.flatFactor=a[0]),r.needsFlattening=1!=r.flatFactor,r.flatIndexes},generateStructInfo:function(r,a,i){var v,t;if(a){if(i=i||0,v=("undefined"==typeof Types?le.typeInfo:Types.types)[a],!v)return null;e(v.fields.length===r.length,"Number of named fields must match the type for "+a),t=v.flatIndexes}else{var v={fields:r.map(function(r){return r[0]})};t=le.calculateStructAlignment(v)}var f={__size__:v.flatSize};return a?r.forEach(function(r,a){if("string"==typeof r)f[r]=t[a]+i;else{var e;for(var _ in r)e=_;f[e]=le.generateStructInfo(r[e],v.fields[a],t[a])}}):r.forEach(function(r,a){f[r[1]]=t[a]}),f},stackAlloc:function(r){var a=Oe;return Oe+=r,Oe=Oe+3>>2<<2,a},staticAlloc:function(r){var a=Ie;return Ie+=r,Ie=Ie+3>>2<<2,Ie>=Le&&l(),a},alignMemory:function(r,a){var e=r=Math.ceil(r/(a?a:4))*(a?a:4);return e},makeBigInt:function(r,a,e){var i=e?(r>>>0)+4294967296*(a>>>0):(r>>>0)+4294967296*(0|a);return i},QUANTUM_SIZE:4,__dummy__:0},be={MAX_ALLOWED:0,corrections:0,sigs:{},note:function(r,e,i){e||(this.corrections++,this.corrections>=this.MAX_ALLOWED&&a("\\n\\nToo many corrections!"))},print:function(){}},ke=!1,ue=0,ce=this;Module.ccall=i,Module.setValue=t,Module.getValue=f;var he=0,de=1,we=2;Module.ALLOC_NORMAL=he,Module.ALLOC_STACK=de,Module.ALLOC_STATIC=we,Module.allocate=_,Module.Pointer_stringify=s,Module.Array_stringify=n;var pe,Ee,Ae,ge,ye,me,Se,Me,Ce,Re,Te,Oe,Ne,Ie,Pe=4096,De=Module.TOTAL_STACK||5242880,Le=Module.TOTAL_MEMORY||10485760;Module.FAST_MEMORY||2097152;e(!!(Int32Array&&Float64Array&&new Int32Array(1).subarray&&new Int32Array(1).set),"Cannot fallback to non-typed array case: Code is too specialized");var Fe=new ArrayBuffer(Le);Ae=new Int8Array(Fe),ye=new Int16Array(Fe),Se=new Int32Array(Fe),ge=new Uint8Array(Fe),me=new Uint16Array(Fe),Me=new Uint32Array(Fe),Ce=new Float32Array(Fe),Re=new Float64Array(Fe),Se[0]=255,e(255===ge[0]&&0===ge[3],"Typed arrays 2 must be run on a little-endian system");var Xe=p("(null)");Ie=Xe.length;for(var je=0;je>2)),ze=(Ce.subarray(Ue>>2),Re.subarray(Ue>>3));Ne=Ue+8,Ie=o(Ne);var Ve=[],Be=[];Module.Array_copy=c,Module.TypedArray_copy=h,Module.String_len=d,Module.String_copy=w,Module.intArrayFromString=p,Module.intArrayToString=E,Module.writeStringToMemory=A;var He=[],Ke=0;O.X=1,N.X=1,V.X=1,H.X=1,G.X=1,W.X=1,q.X=1,$.X=1,rr.X=1,ar.X=1,er.X=1,vr.X=1,nr.X=1,or.X=1,kr.X=1,hr.X=1,Ar.X=1,Sr.X=1,Tr.X=1,Ir.X=1,Pr.X=1,Dr.X=1,Lr.X=1,Fr.X=1,Xr.X=1,zr.X=1,Vr.X=1,Br.X=1,Gr.X=1,$r.X=1,Module._malloc=Jr,Jr.X=1,ra.X=1,aa.X=1,ea.X=1,ia.X=1,Module._free=va,va.X=1,_a.X=1,sa.X=1,na.X=1,oa.X=1,la.X=1,da.X=1,Ma.X=1;var Ye,Ge={E2BIG:7,EACCES:13,EADDRINUSE:98,EADDRNOTAVAIL:99,EAFNOSUPPORT:97,EAGAIN:11,EALREADY:114,EBADF:9,EBADMSG:74,EBUSY:16,ECANCELED:125,ECHILD:10,ECONNABORTED:103,ECONNREFUSED:111,ECONNRESET:104,EDEADLK:35,EDESTADDRREQ:89,EDOM:33,EDQUOT:122,EEXIST:17,EFAULT:14,EFBIG:27,EHOSTUNREACH:113,EIDRM:43,EILSEQ:84,EINPROGRESS:115,EINTR:4,EINVAL:22,EIO:5,EISCONN:106,EISDIR:21,ELOOP:40,EMFILE:24,EMLINK:31,EMSGSIZE:90,EMULTIHOP:72,ENAMETOOLONG:36,ENETDOWN:100,ENETRESET:102,ENETUNREACH:101,ENFILE:23,ENOBUFS:105,ENODATA:61,ENODEV:19,ENOENT:2,ENOEXEC:8,ENOLCK:37,ENOLINK:67,ENOMEM:12,ENOMSG:42,ENOPROTOOPT:92,ENOSPC:28,ENOSR:63,ENOSTR:60,ENOSYS:38,ENOTCONN:107,ENOTDIR:20,ENOTEMPTY:39,ENOTRECOVERABLE:131,ENOTSOCK:88,ENOTSUP:95,ENOTTY:25,ENXIO:6,EOVERFLOW:75,EOWNERDEAD:130,EPERM:1,EPIPE:32,EPROTO:71,EPROTONOSUPPORT:93,EPROTOTYPE:91,ERANGE:34,EROFS:30,ESPIPE:29,ESRCH:3,ESTALE:116,ETIME:62,ETIMEDOUT:110,ETXTBSY:26,EWOULDBLOCK:11,EXDEV:18},We=0,Ze=0,Qe=0,qe=0,$e={currentPath:"/",nextInode:2,streams:[null],ignorePermissions:!0,absolutePath:function(r,a){if("string"!=typeof r)return null;void 0===a&&(a=$e.currentPath),r&&"/"==r[0]&&(a="");for(var e=a+"/"+r,i=e.split("/").reverse(),v=[""];i.length;){var t=i.pop();""==t||"."==t||(".."==t?v.length>1&&v.pop():v.push(t))}return 1==v.length?"/":v.join("/")},analyzePath:function(r,a,e){var i={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};if(r=$e.absolutePath(r),"/"==r)i.isRoot=!0,i.exists=i.parentExists=!0,i.name="/",i.path=i.parentPath="/",i.object=i.parentObject=$e.root;else if(null!==r){e=e||0,r=r.slice(1).split("/");for(var v=$e.root,t=[""];r.length;){1==r.length&&v.isFolder&&(i.parentExists=!0,i.parentPath=1==t.length?"/":t.join("/"),i.parentObject=v,i.name=r[0]);var f=r.shift();if(!v.isFolder){i.error=Ge.ENOTDIR;break}if(!v.read){i.error=Ge.EACCES;break}if(!v.contents.hasOwnProperty(f)){i.error=Ge.ENOENT;break}if(v=v.contents[f],v.link&&(!a||0!=r.length)){if(e>40){i.error=Ge.ELOOP;break}var _=$e.absolutePath(v.link,t.join("/"));return $e.analyzePath([_].concat(r).join("/"),a,e+1)}t.push(f),0==r.length&&(i.exists=!0,i.path=t.join("/"),i.object=v)}return i}return i},findObject:function(r,a){$e.ensureRoot();var e=$e.analyzePath(r,a);return e.exists?e.object:(Ya(e.error),null)},createObject:function(r,a,e,i,v){if(r||(r="/"),"string"==typeof r&&(r=$e.findObject(r)),!r)throw Ya(Ge.EACCES),new Error("Parent path must exist.");if(!r.isFolder)throw Ya(Ge.ENOTDIR), -new Error("Parent must be a folder.");if(!r.write&&!$e.ignorePermissions)throw Ya(Ge.EACCES),new Error("Parent folder must be writeable.");if(!a||"."==a||".."==a)throw Ya(Ge.ENOENT),new Error("Name must not be empty.");if(r.contents.hasOwnProperty(a))throw Ya(Ge.EEXIST),new Error("Can't overwrite object.");r.contents[a]={read:void 0===i||i,write:void 0!==v&&v,timestamp:Date.now(),inodeNumber:$e.nextInode++};for(var t in e)e.hasOwnProperty(t)&&(r.contents[a][t]=e[t]);return r.contents[a]},createFolder:function(r,a,e,i){var v={isFolder:!0,isDevice:!1,contents:{}};return $e.createObject(r,a,v,e,i)},createPath:function(r,a,e,i){var v=$e.findObject(r);if(null===v)throw new Error("Invalid parent.");for(a=a.split("/").reverse();a.length;){var t=a.pop();t&&(v.contents.hasOwnProperty(t)||$e.createFolder(v,t,e,i),v=v.contents[t])}return v},createFile:function(r,a,e,i,v){return e.isFolder=!1,$e.createObject(r,a,e,i,v)},createDataFile:function(r,a,e,i,v){if("string"==typeof e){for(var t=new Array(e.length),f=0,_=e.length;f<_;++f)t[f]=e.charCodeAt(f);e=t}var s={isDevice:!1,contents:e};return $e.createFile(r,a,s,i,v)},createLazyFile:function(r,a,e,i,v){var t={isDevice:!1,url:e};return $e.createFile(r,a,t,i,v)},createLink:function(r,a,e,i,v){var t={isDevice:!1,link:e};return $e.createFile(r,a,t,i,v)},createDevice:function(r,a,e,i){if(!e&&!i)throw new Error("A device must have at least one callback defined.");var v={isDevice:!0,input:e,output:i};return $e.createFile(r,a,v,Boolean(e),Boolean(i))},forceLoadFile:function(r){if(r.isDevice||r.isFolder||r.link||r.contents)return!0;var a=!0;if("undefined"!=typeof XMLHttpRequest)e("Cannot do synchronous binary XHRs in modern browsers. Use --embed-file or --preload-file in emcc");else{if("undefined"==typeof read)throw new Error("Cannot load without read() or XMLHttpRequest.");try{r.contents=p(read(r.url),!0)}catch(r){a=!1}}return a||Ya(Ge.EIO),a},ensureRoot:function(){$e.root||($e.root={read:!0,write:!0,isFolder:!0,isDevice:!1,timestamp:Date.now(),inodeNumber:1,contents:{}})},init:function(r,a,i){function v(r){null===r||r==="\\n".charCodeAt(0)?(a.printer(a.buffer.join("")),a.buffer=[]):a.buffer.push(String.fromCharCode(r))}e(!$e.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"),$e.init.initialized=!0,$e.ensureRoot(),r=r||Module.stdin,a=a||Module.stdout,i=i||Module.stderr;var t=!0,f=!0,s=!0;r||(t=!1,r=function(){if(!r.cache||!r.cache.length){var a;"undefined"!=typeof window&&"function"==typeof window.prompt?a=window.prompt("Input: "):"function"==typeof readline&&(a=readline()),a||(a=""),r.cache=p(a+"\\n",!0)}return r.cache.shift()}),a||(f=!1,a=v),a.printer||(a.printer=print),a.buffer||(a.buffer=[]),i||(s=!1,i=v),i.printer||(i.printer=print),i.buffer||(i.buffer=[]),$e.createFolder("/","tmp",!0,!0);var n=$e.createFolder("/","dev",!0,!0),o=$e.createDevice(n,"stdin",r),l=$e.createDevice(n,"stdout",null,a),b=$e.createDevice(n,"stderr",null,i);$e.createDevice(n,"tty",r,a),$e.streams[1]={path:"/dev/stdin",object:o,position:0,isRead:!0,isWrite:!1,isAppend:!1,isTerminal:!t,error:!1,eof:!1,ungotten:[]},$e.streams[2]={path:"/dev/stdout",object:l,position:0,isRead:!1,isWrite:!0,isAppend:!1,isTerminal:!f,error:!1,eof:!1,ungotten:[]},$e.streams[3]={path:"/dev/stderr",object:b,position:0,isRead:!1,isWrite:!0,isAppend:!1,isTerminal:!s,error:!1,eof:!1,ungotten:[]},We=_([1],"void*",we),Ze=_([2],"void*",we),Qe=_([3],"void*",we),$e.createPath("/","dev/shm/tmp",!0,!0),$e.streams[We]=$e.streams[1],$e.streams[Ze]=$e.streams[2],$e.streams[Qe]=$e.streams[3],qe=_([_([0,0,0,0,We,0,0,0,Ze,0,0,0,Qe,0,0,0],"void*",we)],"void*",we)},quit:function(){$e.init.initialized&&($e.streams[2]&&$e.streams[2].object.output.buffer.length>0&&$e.streams[2].object.output("\\n".charCodeAt(0)),$e.streams[3]&&$e.streams[3].object.output.buffer.length>0&&$e.streams[3].object.output("\\n".charCodeAt(0)))}},Je=Ja;Ve.unshift({func:function(){$e.ignorePermissions=!1,$e.init.initialized||$e.init()}}),Be.push({func:function(){$e.quit()}}),Ya(0),ae.buf=_(12,"void*",we),Module.callMain=function(r){function a(){for(var r=0;r<3;r++)i.push(0)}var e=r.length+1,i=[_(p("/bin/this.program"),"i8",we)];a();for(var v=0;v>2]=0|He.__str,Se[ri+4>>2]=0|He.__str1,Se[ri+16>>2]=0|He.__str2,Se[ri+20>>2]=0|He.__str3,Se[ri+32>>2]=0|He.__str4,Se[ri+36>>2]=0|He.__str5,Se[ri+48>>2]=0|He.__str6,Se[ri+52>>2]=0|He.__str7,Se[ri+64>>2]=0|He.__str8,Se[ri+68>>2]=0|He.__str7,Se[ri+80>>2]=0|He.__str9,Se[ri+84>>2]=0|He.__str10,Se[ri+96>>2]=0|He.__str11,Se[ri+100>>2]=0|He.__str12,Se[ri+112>>2]=0|He.__str13,Se[ri+116>>2]=0|He.__str14,Se[ri+128>>2]=0|He.__str15,Se[ri+132>>2]=0|He.__str16,Se[ri+144>>2]=0|He.__str17,Se[ri+148>>2]=0|He.__str18,Se[ri+160>>2]=0|He.__str19,Se[ri+164>>2]=0|He.__str20,Se[ri+176>>2]=0|He.__str21,Se[ri+180>>2]=0|He.__str22,Se[ri+192>>2]=0|He.__str23,Se[ri+196>>2]=0|He.__str24,Se[ri+208>>2]=0|He.__str25,Se[ri+212>>2]=0|He.__str26,Se[ri+224>>2]=0|He.__str27,Se[ri+228>>2]=0|He.__str28,Se[ri+240>>2]=0|He.__str29,Se[ri+244>>2]=0|He.__str30,Se[ri+256>>2]=0|He.__str31,Se[ri+260>>2]=0|He.__str32,Se[ri+272>>2]=0|He.__str33,Se[ri+276>>2]=0|He.__str34,Se[ri+288>>2]=0|He.__str35,Se[ri+292>>2]=0|He.__str36,Se[ri+304>>2]=0|He.__str37,Se[ri+308>>2]=0|He.__str38,Se[ri+320>>2]=0|He.__str39,Se[ri+324>>2]=0|He.__str40,Se[ri+336>>2]=0|He.__str41,Se[ri+340>>2]=0|He.__str42,Se[ri+352>>2]=0|He.__str43,Se[ri+356>>2]=0|He.__str44,Se[ri+368>>2]=0|He.__str45,Se[ri+372>>2]=0|He.__str46,Se[ri+384>>2]=0|He.__str47,Se[ri+388>>2]=0|He.__str48,Se[ri+400>>2]=0|He.__str49,Se[ri+404>>2]=0|He.__str119289,Se[ri+416>>2]=0|He.__str51,Se[ri+420>>2]=0|He.__str20,Se[ri+432>>2]=0|He.__str52,Se[ri+436>>2]=0|He.__str53,Se[ri+448>>2]=0|He.__str54,Se[ri+452>>2]=0|He.__str55,Se[ri+464>>2]=0|He.__str56,Se[ri+468>>2]=0|He.__str57,Se[ri+480>>2]=0|He.__str58,Se[ri+484>>2]=0|He.__str119289,Se[ri+496>>2]=0|He.__str59,Se[ri+500>>2]=0|He.__str60,Se[ri+512>>2]=0|He.__str61,Se[ri+516>>2]=0|He.__str62,Se[ri+528>>2]=0|He.__str63,Se[ri+532>>2]=0|He.__str64,Se[ri+544>>2]=0|He.__str65,Se[ri+548>>2]=0|He.__str66,Se[ri+560>>2]=0|He.__str67,Se[ri+564>>2]=0|He.__str68,Se[ri+576>>2]=0|He.__str69,Se[ri+580>>2]=0|He.__str70,Se[ri+592>>2]=0|He.__str71,Se[ri+596>>2]=0|He.__str72,Se[ri+608>>2]=0|He.__str73,Se[ri+612>>2]=0|He.__str74,Se[ri+624>>2]=0|He.__str75,Se[ri+628>>2]=0|He.__str76,Se[ri+640>>2]=0|He.__str77,Se[ri+644>>2]=0|He.__str72,Se[ri+656>>2]=0|He.__str78,Se[ri+660>>2]=0|He.__str79,Se[ri+672>>2]=0|He.__str80,Se[ri+676>>2]=0|He.__str81,Se[ri+688>>2]=0|He.__str82,Se[ri+692>>2]=0|He.__str83,Se[ri+704>>2]=0|He.__str84,Se[ri+708>>2]=0|He.__str85,Se[ri+720>>2]=0|He.__str86,Se[ri+724>>2]=0|He.__str87,Se[ri+736>>2]=0|He.__str88,Se[ri+740>>2]=0|He.__str89,Se[ri+752>>2]=0|He.__str90,Se[ri+756>>2]=0|He.__str91,Se[ri+768>>2]=0|He.__str92,Se[ri+772>>2]=0|He.__str91,Se[ai>>2]=0|He.__str145315,Se[ai+8>>2]=0|He.__str145315,Se[ai+20>>2]=0|He.__str167337,Se[ai+28>>2]=0|He.__str95,Se[ai+40>>2]=0|He.__str146316,Se[ai+48>>2]=0|He.__str97,Se[ai+60>>2]=0|He.__str155325,Se[ai+68>>2]=0|He.__str155325,Se[ai+80>>2]=0|He.__str156326,Se[ai+88>>2]=0|He.__str156326,Se[ai+100>>2]=0|He.__str154324,Se[ai+108>>2]=0|He.__str154324,Se[ai+120>>2]=0|He.__str101,Se[ai+128>>2]=0|He.__str101,Se[ai+140>>2]=0|He.__str147317,Se[ai+148>>2]=0|He.__str147317,Se[ai+160>>2]=0|He.__str150320,Se[ai+168>>2]=0|He.__str150320,Se[ai+180>>2]=0|He.__str151321,Se[ai+188>>2]=0|He.__str105,Se[ai+220>>2]=0|He.__str152322,Se[ai+228>>2]=0|He.__str152322,Se[ai+240>>2]=0|He.__str153323,Se[ai+248>>2]=0|He.__str153323,Se[ai+260>>2]=0|He.__str165335,Se[ai+268>>2]=0|He.__str165335,Se[ai+280>>2]=0|He.__str166336,Se[ai+288>>2]=0|He.__str166336,Se[ai+360>>2]=0|He.__str148318,Se[ai+368>>2]=0|He.__str148318,Se[ai+380>>2]=0|He.__str149319,Se[ai+388>>2]=0|He.__str149319,Se[ai+420>>2]=0|He.__str84254,Se[ai+428>>2]=0|He.__str84254,Se[ai+440>>2]=0|He.__str168338,Se[ai+448>>2]=0|He.__str146316,Se[ai+460>>2]=0|He.__str114,Se[ai+468>>2]=0|He.__str152322,Se[ai+480>>2]=0|He.__str115,Se[ai+488>>2]=0|He.__str115,Se[ai+500>>2]=0|He.__str110280,Se[ai+508>>2]=0|He.__str110280,Se[ei+4>>2]=0|He.__str152,Se[ei+12>>2]=0|He.__str152,Se[ei+32>>2]=0|He.__str153,Se[ei+40>>2]=0|He.__str153,Se[ei+48>>2]=0|He.__str154,Se[ei+60>>2]=0|He.__str155,Se[ei+68>>2]=0|He.__str155,Se[ei+76>>2]=0|He.__str156,Se[ei+88>>2]=0|He.__str157,Se[ei+96>>2]=0|He.__str158,Se[ei+104>>2]=0|He.__str156,Se[ei+116>>2]=0|He.__str159,Se[ei+124>>2]=0|He.__str160,Se[ei+132>>2]=0|He.__str161,Se[ei+144>>2]=0|He.__str162,Se[ei+152>>2]=0|He.__str163,Se[ei+160>>2]=0|He.__str164,Se[ei+172>>2]=0|He.__str165,Se[ei+180>>2]=0|He.__str166,Se[ei+188>>2]=0|He.__str167,Se[si+4>>2]=bi,Se[ni+4>>2]=ki,oi=_([2,0,0,0,0],["i8*",0,0,0,0],we),Se[bi>>2]=oi+8|0,Se[bi+4>>2]=0|He.__ZTSSt9bad_alloc,Se[bi+8>>2]=li,Se[ki>>2]=oi+8|0,Se[ki+4>>2]=0|He.__ZTSSt20bad_array_new_length,Se[ki+8>>2]=bi,ui=16,ci=6,hi=18,di=6,wi=6,pe=[0,0,Jr,0,va,0,ya,0,ga,0,wa,0,Sa,0,pa,0,Ea,0,ma,0],Module.FUNCTION_TABLE=pe,Module.run=ee,Module.preRun&&Module.preRun(),0==Ke){ee()}Module.postRun&&Module.postRun(),Module.___cxa_demangle=G;var pi=v("__cxa_demangle","string",["string","string","number","number"]);return function(r){return pi(r,"",1,0)}}(); -`; - -/***/ }), -/* 9 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.chromeTreeToNodes = void 0; - -function treeToArray(root) { - const nodes = []; - - function visit(node) { - nodes.push({ - id: node.id, - callFrame: { - columnNumber: 0, - functionName: node.functionName, - lineNumber: node.lineNumber, - scriptId: node.scriptId, - url: node.url - }, - hitCount: node.hitCount, - children: node.children.map(child => child.id) - }); - node.children.forEach(visit); - } - - visit(root); - return nodes; -} - -function timestampsToDeltas(timestamps, startTime) { - return timestamps.map((timestamp, index) => { - const lastTimestamp = index === 0 ? startTime * 1000000 : timestamps[index - 1]; - return timestamp - lastTimestamp; - }); -} -/** - * Convert the old tree-based format to the new flat-array based format - */ - - -function chromeTreeToNodes(content) { - // Note that both startTime and endTime are now in microseconds - return { - samples: content.samples, - startTime: content.startTime * 1000000, - endTime: content.endTime * 1000000, - nodes: treeToArray(content.head), - timeDeltas: timestampsToDeltas(content.timestamps, content.startTime) - }; -} - -exports.chromeTreeToNodes = chromeTreeToNodes; - -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Flamechart = void 0; - -const utils_1 = __webpack_require__(0); - -const math_1 = __webpack_require__(11); - -class Flamechart { - constructor(source) { - this.source = source; // Bottom to top - - this.layers = []; - this.totalWeight = 0; - this.minFrameWidth = 1; - const stack = []; - - const openFrame = (node, value) => { - const parent = utils_1.lastOf(stack); - const frame = { - node, - parent, - children: [], - start: value, - end: value - }; - - if (parent) { - parent.children.push(frame); - } - - stack.push(frame); - }; - - this.minFrameWidth = Infinity; - - const closeFrame = (node, value) => { - console.assert(stack.length > 0); - const stackTop = stack.pop(); - stackTop.end = value; - if (stackTop.end - stackTop.start === 0) return; - const layerIndex = stack.length; - - while (this.layers.length <= layerIndex) this.layers.push([]); - - this.layers[layerIndex].push(stackTop); - this.minFrameWidth = Math.min(this.minFrameWidth, stackTop.end - stackTop.start); - }; - - this.totalWeight = source.getTotalWeight(); - source.forEachCall(openFrame, closeFrame); - if (!isFinite(this.minFrameWidth)) this.minFrameWidth = 1; - } - - getTotalWeight() { - return this.totalWeight; - } - - getLayers() { - return this.layers; - } - - getColorBucketForFrame(frame) { - return this.source.getColorBucketForFrame(frame); - } - - getMinFrameWidth() { - return this.minFrameWidth; - } - - formatValue(v) { - return this.source.formatValue(v); - } - - getClampedViewportWidth(viewportWidth) { - const maxWidth = this.getTotalWeight(); // In order to avoid floating point error, we cap the maximum zoom. In - // particular, it's important that at the maximum zoom level, the total - // trace size + a viewport width is not equal to the trace size due to - // floating point rounding. - // - // For instance, if the profile's total weight is 2^60, and the viewport - // size is 1, trying to move one viewport width right will result in no - // change because 2^60 + 1 = 2^60 in floating point arithmetic. JavaScript - // numbers are 64 bit floats, and therefore have 53 mantissa bits. You can - // see this for yourself in the console. Try: - // - // > Math.pow(2, 60) + 1 === Math.pow(2, 60) - // true - // > Math.pow(2, 53) + 1 === Math.pow(2, 53) - // true - // > Math.pow(2, 52) + 1 === Math.pow(2, 52) - // false - // - // We use 2^40 as a cap instead, since we want to be able to make small - // adjustments within a viewport width. - // - // For reference, this will still allow you to zoom until 1 nanosecond fills - // the screen in a profile with a duration of over 18 minutes. - // - // > Math.pow(2, 40) / (60 * Math.pow(10, 9)) - // 18.325193796266667 - // - - const maxZoom = Math.pow(2, 40); // In addition to capping zoom to avoid floating point error, we further cap - // zoom to avoid letting you zoom in so that the smallest element more than - // fills the screen, since that probably isn't useful. The final zoom cap is - // determined by the minimum zoom of either 2^40x zoom or the necessary zoom - // for the smallest frame to fill the screen three times. - - const minWidth = math_1.clamp(3 * this.getMinFrameWidth(), maxWidth / maxZoom, maxWidth); - return math_1.clamp(viewportWidth, minWidth, maxWidth); - } // Given a desired config-space viewport rectangle, clamp the rectangle so - // that it fits within the given flamechart. This prevents the viewport from - // extending past the bounds of the flamechart or zooming in too far. - - - getClampedConfigSpaceViewportRect({ - configSpaceViewportRect, - renderInverted - }) { - const configSpaceSize = new math_1.Vec2(this.getTotalWeight(), this.getLayers().length); - const width = this.getClampedViewportWidth(configSpaceViewportRect.size.x); - const size = configSpaceViewportRect.size.withX(width); - const origin = math_1.Vec2.clamp(configSpaceViewportRect.origin, new math_1.Vec2(0, renderInverted ? 0 : -1), math_1.Vec2.max(math_1.Vec2.zero, configSpaceSize.minus(size).plus(new math_1.Vec2(0, 1)))); - return new math_1.Rect(origin, configSpaceViewportRect.size.withX(width)); - } - -} - -exports.Flamechart = Flamechart; - -/***/ }), -/* 11 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Rect = exports.AffineTransform = exports.Vec2 = exports.clamp = void 0; - -function clamp(x, minVal, maxVal) { - if (x < minVal) return minVal; - if (x > maxVal) return maxVal; - return x; -} - -exports.clamp = clamp; - -let Vec2 = -/** @class */ -(() => { - class Vec2 { - constructor(x, y) { - this.x = x; - this.y = y; - } - - withX(x) { - return new Vec2(x, this.y); - } - - withY(y) { - return new Vec2(this.x, y); - } - - plus(other) { - return new Vec2(this.x + other.x, this.y + other.y); - } - - minus(other) { - return new Vec2(this.x - other.x, this.y - other.y); - } - - times(scalar) { - return new Vec2(this.x * scalar, this.y * scalar); - } - - timesPointwise(other) { - return new Vec2(this.x * other.x, this.y * other.y); - } - - dividedByPointwise(other) { - return new Vec2(this.x / other.x, this.y / other.y); - } - - dot(other) { - return this.x * other.x + this.y * other.y; - } - - equals(other) { - return this.x === other.x && this.y === other.y; - } - - approxEquals(other, epsilon = 1e-9) { - return Math.abs(this.x - other.x) < epsilon && Math.abs(this.y - other.y) < epsilon; - } - - length2() { - return this.dot(this); - } - - length() { - return Math.sqrt(this.length2()); - } - - abs() { - return new Vec2(Math.abs(this.x), Math.abs(this.y)); - } - - static min(a, b) { - return new Vec2(Math.min(a.x, b.x), Math.min(a.y, b.y)); - } - - static max(a, b) { - return new Vec2(Math.max(a.x, b.x), Math.max(a.y, b.y)); - } - - static clamp(v, min, max) { - return new Vec2(clamp(v.x, min.x, max.x), clamp(v.y, min.y, max.y)); - } - - flatten() { - return [this.x, this.y]; - } - - } - - Vec2.zero = new Vec2(0, 0); - Vec2.unit = new Vec2(1, 1); - return Vec2; -})(); - -exports.Vec2 = Vec2; - -class AffineTransform { - constructor(m00 = 1, m01 = 0, m02 = 0, m10 = 0, m11 = 1, m12 = 0) { - this.m00 = m00; - this.m01 = m01; - this.m02 = m02; - this.m10 = m10; - this.m11 = m11; - this.m12 = m12; - } - - withScale(s) { - let { - m00, - m01, - m02, - m10, - m11, - m12 - } = this; - m00 = s.x; - m11 = s.y; - return new AffineTransform(m00, m01, m02, m10, m11, m12); - } - - static withScale(s) { - return new AffineTransform().withScale(s); - } - - scaledBy(s) { - return AffineTransform.withScale(s).times(this); - } - - getScale() { - return new Vec2(this.m00, this.m11); - } - - withTranslation(t) { - let { - m00, - m01, - m02, - m10, - m11, - m12 - } = this; - m02 = t.x; - m12 = t.y; - return new AffineTransform(m00, m01, m02, m10, m11, m12); - } - - static withTranslation(t) { - return new AffineTransform().withTranslation(t); - } - - getTranslation() { - return new Vec2(this.m02, this.m12); - } - - translatedBy(t) { - return AffineTransform.withTranslation(t).times(this); - } - - static betweenRects(from, to) { - return AffineTransform.withTranslation(from.origin.times(-1)).scaledBy(new Vec2(to.size.x / from.size.x, to.size.y / from.size.y)).translatedBy(to.origin); - } - - times(other) { - const m00 = this.m00 * other.m00 + this.m01 * other.m10; - const m01 = this.m00 * other.m01 + this.m01 * other.m11; - const m02 = this.m00 * other.m02 + this.m01 * other.m12 + this.m02; - const m10 = this.m10 * other.m00 + this.m11 * other.m10; - const m11 = this.m10 * other.m01 + this.m11 * other.m11; - const m12 = this.m10 * other.m02 + this.m11 * other.m12 + this.m12; - return new AffineTransform(m00, m01, m02, m10, m11, m12); - } - - equals(other) { - return this.m00 == other.m00 && this.m01 == other.m01 && this.m02 == other.m02 && this.m10 == other.m10 && this.m11 == other.m11 && this.m12 == other.m12; - } - - approxEquals(other, epsilon = 1e-9) { - return Math.abs(this.m00 - other.m00) < epsilon && Math.abs(this.m01 - other.m01) < epsilon && Math.abs(this.m02 - other.m02) < epsilon && Math.abs(this.m10 - other.m10) < epsilon && Math.abs(this.m11 - other.m11) < epsilon && Math.abs(this.m12 - other.m12) < epsilon; - } - - timesScalar(s) { - const { - m00, - m01, - m02, - m10, - m11, - m12 - } = this; - return new AffineTransform(s * m00, s * m01, s * m02, s * m10, s * m11, s * m12); - } - - det() { - const { - m00, - m01, - m02, - m10, - m11, - m12 - } = this; - const m20 = 0; - const m21 = 0; - const m22 = 1; - return m00 * (m11 * m22 - m12 * m21) - m01 * (m10 * m22 - m12 * m20) + m02 * (m10 * m21 - m11 * m20); - } - - adj() { - const { - m00, - m01, - m02, - m10, - m11, - m12 - } = this; - const m20 = 0; - const m21 = 0; - const m22 = 1; // Adjugate matrix (a) is the transpose of the - // cofactor matrix (c). - // - // 00 01 02 - // 10 11 12 - // 20 21 22 - - const a00 = - /* c00 = */ - +(m11 * m22 - m12 * m21); - const a01 = - /* c10 = */ - -(m01 * m22 - m02 * m21); - const a02 = - /* c20 = */ - +(m01 * m12 - m02 * m11); - const a10 = - /* c01 = */ - -(m10 * m22 - m12 * m20); - const a11 = - /* c11 = */ - +(m00 * m22 - m02 * m20); - const a12 = - /* c21 = */ - -(m00 * m12 - m02 * m10); - return new AffineTransform(a00, a01, a02, a10, a11, a12); - } - - inverted() { - const det = this.det(); - if (det === 0) return null; - const adj = this.adj(); - return adj.timesScalar(1 / det); - } - - transformVector(v) { - return new Vec2(v.x * this.m00 + v.y * this.m01, v.x * this.m10 + v.y * this.m11); - } - - inverseTransformVector(v) { - const inv = this.inverted(); - if (!inv) return null; - return inv.transformVector(v); - } - - transformPosition(v) { - return new Vec2(v.x * this.m00 + v.y * this.m01 + this.m02, v.x * this.m10 + v.y * this.m11 + this.m12); - } - - inverseTransformPosition(v) { - const inv = this.inverted(); - if (!inv) return null; - return inv.transformPosition(v); - } - - transformRect(r) { - const size = this.transformVector(r.size); - const origin = this.transformPosition(r.origin); - - if (size.x < 0 && size.y < 0) { - return new Rect(origin.plus(size), size.abs()); - } else if (size.x < 0) { - return new Rect(origin.withX(origin.x + size.x), size.abs()); - } else if (size.y < 0) { - return new Rect(origin.withY(origin.y + size.y), size.abs()); - } - - return new Rect(origin, size); - } - - inverseTransformRect(r) { - const inv = this.inverted(); - if (!inv) return null; - return inv.transformRect(r); - } - - flatten() { - // Flatten into GLSL format - // prettier-ignore - return [this.m00, this.m10, 0, this.m01, this.m11, 0, this.m02, this.m12, 1]; - } - -} - -exports.AffineTransform = AffineTransform; - -let Rect = -/** @class */ -(() => { - class Rect { - constructor(origin, size) { - this.origin = origin; - this.size = size; - } - - isEmpty() { - return this.width() == 0 || this.height() == 0; - } - - width() { - return this.size.x; - } - - height() { - return this.size.y; - } - - left() { - return this.origin.x; - } - - right() { - return this.left() + this.width(); - } - - top() { - return this.origin.y; - } - - bottom() { - return this.top() + this.height(); - } - - topLeft() { - return this.origin; - } - - topRight() { - return this.origin.plus(new Vec2(this.width(), 0)); - } - - bottomRight() { - return this.origin.plus(this.size); - } - - bottomLeft() { - return this.origin.plus(new Vec2(0, this.height())); - } - - withOrigin(origin) { - return new Rect(origin, this.size); - } - - withSize(size) { - return new Rect(this.origin, size); - } - - closestPointTo(p) { - return new Vec2(clamp(p.x, this.left(), this.right()), clamp(p.y, this.top(), this.bottom())); - } - - distanceFrom(p) { - return p.minus(this.closestPointTo(p)).length(); - } - - contains(p) { - return this.distanceFrom(p) === 0; - } - - hasIntersectionWith(other) { - const top = Math.max(this.top(), other.top()); - const bottom = Math.max(top, Math.min(this.bottom(), other.bottom())); - if (bottom - top === 0) return false; - const left = Math.max(this.left(), other.left()); - const right = Math.max(left, Math.min(this.right(), other.right())); - if (right - left === 0) return false; - return true; - } - - intersectWith(other) { - const topLeft = Vec2.max(this.topLeft(), other.topLeft()); - const bottomRight = Vec2.max(topLeft, Vec2.min(this.bottomRight(), other.bottomRight())); - return new Rect(topLeft, bottomRight.minus(topLeft)); - } - - equals(other) { - return this.origin.equals(other.origin) && this.size.equals(other.size); - } - - approxEquals(other) { - return this.origin.approxEquals(other.origin) && this.size.approxEquals(other.size); - } - - area() { - return this.size.x * this.size.y; - } - - } - - Rect.empty = new Rect(Vec2.zero, Vec2.zero); - Rect.unit = new Rect(Vec2.zero, Vec2.unit); - Rect.NDC = new Rect(new Vec2(-1, -1), new Vec2(2, 2)); - return Rect; -})(); - -exports.Rect = Rect; - -/***/ }), -/* 12 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (root, factory) { - 'use strict'; // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers. - - /* istanbul ignore next */ - - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else {} -})(this, function () { - 'use strict'; - - function _isNumber(n) { - return !isNaN(parseFloat(n)) && isFinite(n); - } - - function _capitalize(str) { - return str.charAt(0).toUpperCase() + str.substring(1); - } - - function _getter(p) { - return function () { - return this[p]; - }; - } - - var booleanProps = ['isConstructor', 'isEval', 'isNative', 'isToplevel']; - var numericProps = ['columnNumber', 'lineNumber']; - var stringProps = ['fileName', 'functionName', 'source']; - var arrayProps = ['args']; - var props = booleanProps.concat(numericProps, stringProps, arrayProps); - - function StackFrame(obj) { - if (!obj) return; - - for (var i = 0; i < props.length; i++) { - if (obj[props[i]] !== undefined) { - this['set' + _capitalize(props[i])](obj[props[i]]); - } - } - } - - StackFrame.prototype = { - getArgs: function () { - return this.args; - }, - setArgs: function (v) { - if (Object.prototype.toString.call(v) !== '[object Array]') { - throw new TypeError('Args must be an Array'); - } - - this.args = v; - }, - getEvalOrigin: function () { - return this.evalOrigin; - }, - setEvalOrigin: function (v) { - if (v instanceof StackFrame) { - this.evalOrigin = v; - } else if (v instanceof Object) { - this.evalOrigin = new StackFrame(v); - } else { - throw new TypeError('Eval Origin must be an Object or StackFrame'); - } - }, - toString: function () { - var fileName = this.getFileName() || ''; - var lineNumber = this.getLineNumber() || ''; - var columnNumber = this.getColumnNumber() || ''; - var functionName = this.getFunctionName() || ''; - - if (this.getIsEval()) { - if (fileName) { - return '[eval] (' + fileName + ':' + lineNumber + ':' + columnNumber + ')'; - } - - return '[eval]:' + lineNumber + ':' + columnNumber; - } - - if (functionName) { - return functionName + ' (' + fileName + ':' + lineNumber + ':' + columnNumber + ')'; - } - - return fileName + ':' + lineNumber + ':' + columnNumber; - } - }; - - StackFrame.fromString = function StackFrame$$fromString(str) { - var argsStartIndex = str.indexOf('('); - var argsEndIndex = str.lastIndexOf(')'); - var functionName = str.substring(0, argsStartIndex); - var args = str.substring(argsStartIndex + 1, argsEndIndex).split(','); - var locationString = str.substring(argsEndIndex + 1); - - if (locationString.indexOf('@') === 0) { - var parts = /@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(locationString, ''); - var fileName = parts[1]; - var lineNumber = parts[2]; - var columnNumber = parts[3]; - } - - return new StackFrame({ - functionName: functionName, - args: args || undefined, - fileName: fileName, - lineNumber: lineNumber || undefined, - columnNumber: columnNumber || undefined - }); - }; - - for (var i = 0; i < booleanProps.length; i++) { - StackFrame.prototype['get' + _capitalize(booleanProps[i])] = _getter(booleanProps[i]); - - StackFrame.prototype['set' + _capitalize(booleanProps[i])] = function (p) { - return function (v) { - this[p] = Boolean(v); - }; - }(booleanProps[i]); - } - - for (var j = 0; j < numericProps.length; j++) { - StackFrame.prototype['get' + _capitalize(numericProps[j])] = _getter(numericProps[j]); - - StackFrame.prototype['set' + _capitalize(numericProps[j])] = function (p) { - return function (v) { - if (!_isNumber(v)) { - throw new TypeError(p + ' must be a Number'); - } - - this[p] = Number(v); - }; - }(numericProps[j]); - } - - for (var k = 0; k < stringProps.length; k++) { - StackFrame.prototype['get' + _capitalize(stringProps[k])] = _getter(stringProps[k]); - - StackFrame.prototype['set' + _capitalize(stringProps[k])] = function (p) { - return function (v) { - this[p] = String(v); - }; - }(stringProps[k]); - } - - return StackFrame; -}); - -/***/ }), -/* 13 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -// ESM COMPAT FLAG -__webpack_require__.r(__webpack_exports__); - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "importFile", function() { return /* binding */ importFile_worker_importFile; }); - -// EXTERNAL MODULE: ../react-devtools-timeline/node_modules/regenerator-runtime/runtime.js -var runtime = __webpack_require__(5); - -// EXTERNAL MODULE: /Users/mengdi/workspace/git/react/node_modules/@elg/speedscope/dist/library/library.js -var library = __webpack_require__(1); - -// CONCATENATED MODULE: ../react-devtools-shared/src/constants.js -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ -const CHROME_WEBSTORE_EXTENSION_ID = 'fmkadmapgofadopljbjfkapdkoienihi'; -const INTERNAL_EXTENSION_ID = 'dnjnjgbfilfphmojnmhliehogmojhclc'; -const LOCAL_EXTENSION_ID = 'ikiahnapldjmdmpkmfhjdjilojjhgcbf'; // Flip this flag to true to enable verbose console debug logging. - -const __DEBUG__ = false; // Flip this flag to true to enable performance.mark() and performance.measure() timings. - -const __PERFORMANCE_PROFILE__ = false; -const TREE_OPERATION_ADD = 1; -const TREE_OPERATION_REMOVE = 2; -const TREE_OPERATION_REORDER_CHILDREN = 3; -const TREE_OPERATION_UPDATE_TREE_BASE_DURATION = 4; -const TREE_OPERATION_UPDATE_ERRORS_OR_WARNINGS = 5; -const TREE_OPERATION_REMOVE_ROOT = 6; -const TREE_OPERATION_SET_SUBTREE_MODE = 7; -const PROFILING_FLAG_BASIC_SUPPORT = 0b01; -const PROFILING_FLAG_TIMELINE_SUPPORT = 0b10; -const LOCAL_STORAGE_DEFAULT_TAB_KEY = 'React::DevTools::defaultTab'; -const LOCAL_STORAGE_COMPONENT_FILTER_PREFERENCES_KEY = 'React::DevTools::componentFilters'; -const SESSION_STORAGE_LAST_SELECTION_KEY = 'React::DevTools::lastSelection'; -const LOCAL_STORAGE_OPEN_IN_EDITOR_URL = 'React::DevTools::openInEditorUrl'; -const LOCAL_STORAGE_PARSE_HOOK_NAMES_KEY = 'React::DevTools::parseHookNames'; -const SESSION_STORAGE_RECORD_CHANGE_DESCRIPTIONS_KEY = 'React::DevTools::recordChangeDescriptions'; -const SESSION_STORAGE_RELOAD_AND_PROFILE_KEY = 'React::DevTools::reloadAndProfile'; -const LOCAL_STORAGE_SHOULD_BREAK_ON_CONSOLE_ERRORS = 'React::DevTools::breakOnConsoleErrors'; -const LOCAL_STORAGE_BROWSER_THEME = 'React::DevTools::theme'; -const LOCAL_STORAGE_SHOULD_APPEND_COMPONENT_STACK_KEY = 'React::DevTools::appendComponentStack'; -const LOCAL_STORAGE_SHOW_INLINE_WARNINGS_AND_ERRORS_KEY = 'React::DevTools::showInlineWarningsAndErrors'; -const LOCAL_STORAGE_TRACE_UPDATES_ENABLED_KEY = 'React::DevTools::traceUpdatesEnabled'; -const LOCAL_STORAGE_HIDE_CONSOLE_LOGS_IN_STRICT_MODE = 'React::DevTools::hideConsoleLogsInStrictMode'; -const PROFILER_EXPORT_VERSION = 5; -const CHANGE_LOG_URL = 'https://github.com/facebook/react/blob/main/packages/react-devtools/CHANGELOG.md'; -const UNSUPPORTED_VERSION_URL = 'https://reactjs.org/blog/2019/08/15/new-react-devtools.html#how-do-i-get-the-old-version-back'; -const REACT_DEVTOOLS_WORKPLACE_URL = 'https://fburl.com/react-devtools-workplace-group'; -const THEME_STYLES = { - light: { - '--color-attribute-name': '#ef6632', - '--color-attribute-name-not-editable': '#23272f', - '--color-attribute-name-inverted': 'rgba(255, 255, 255, 0.7)', - '--color-attribute-value': '#1a1aa6', - '--color-attribute-value-inverted': '#ffffff', - '--color-attribute-editable-value': '#1a1aa6', - '--color-background': '#ffffff', - '--color-background-hover': 'rgba(0, 136, 250, 0.1)', - '--color-background-inactive': '#e5e5e5', - '--color-background-invalid': '#fff0f0', - '--color-background-selected': '#0088fa', - '--color-button-background': '#ffffff', - '--color-button-background-focus': '#ededed', - '--color-button': '#5f6673', - '--color-button-disabled': '#cfd1d5', - '--color-button-active': '#0088fa', - '--color-button-focus': '#23272f', - '--color-button-hover': '#23272f', - '--color-border': '#eeeeee', - '--color-commit-did-not-render-fill': '#cfd1d5', - '--color-commit-did-not-render-fill-text': '#000000', - '--color-commit-did-not-render-pattern': '#cfd1d5', - '--color-commit-did-not-render-pattern-text': '#333333', - '--color-commit-gradient-0': '#37afa9', - '--color-commit-gradient-1': '#63b19e', - '--color-commit-gradient-2': '#80b393', - '--color-commit-gradient-3': '#97b488', - '--color-commit-gradient-4': '#abb67d', - '--color-commit-gradient-5': '#beb771', - '--color-commit-gradient-6': '#cfb965', - '--color-commit-gradient-7': '#dfba57', - '--color-commit-gradient-8': '#efbb49', - '--color-commit-gradient-9': '#febc38', - '--color-commit-gradient-text': '#000000', - '--color-component-name': '#6a51b2', - '--color-component-name-inverted': '#ffffff', - '--color-component-badge-background': 'rgba(0, 0, 0, 0.1)', - '--color-component-badge-background-inverted': 'rgba(255, 255, 255, 0.25)', - '--color-component-badge-count': '#777d88', - '--color-component-badge-count-inverted': 'rgba(255, 255, 255, 0.7)', - '--color-console-error-badge-text': '#ffffff', - '--color-console-error-background': '#fff0f0', - '--color-console-error-border': '#ffd6d6', - '--color-console-error-icon': '#eb3941', - '--color-console-error-text': '#fe2e31', - '--color-console-warning-badge-text': '#000000', - '--color-console-warning-background': '#fffbe5', - '--color-console-warning-border': '#fff5c1', - '--color-console-warning-icon': '#f4bd00', - '--color-console-warning-text': '#64460c', - '--color-context-background': 'rgba(0,0,0,.9)', - '--color-context-background-hover': 'rgba(255, 255, 255, 0.1)', - '--color-context-background-selected': '#178fb9', - '--color-context-border': '#3d424a', - '--color-context-text': '#ffffff', - '--color-context-text-selected': '#ffffff', - '--color-dim': '#777d88', - '--color-dimmer': '#cfd1d5', - '--color-dimmest': '#eff0f1', - '--color-error-background': 'hsl(0, 100%, 97%)', - '--color-error-border': 'hsl(0, 100%, 92%)', - '--color-error-text': '#ff0000', - '--color-expand-collapse-toggle': '#777d88', - '--color-link': '#0000ff', - '--color-modal-background': 'rgba(255, 255, 255, 0.75)', - '--color-bridge-version-npm-background': '#eff0f1', - '--color-bridge-version-npm-text': '#000000', - '--color-bridge-version-number': '#0088fa', - '--color-primitive-hook-badge-background': '#e5e5e5', - '--color-primitive-hook-badge-text': '#5f6673', - '--color-record-active': '#fc3a4b', - '--color-record-hover': '#3578e5', - '--color-record-inactive': '#0088fa', - '--color-resize-bar': '#eeeeee', - '--color-resize-bar-active': '#dcdcdc', - '--color-resize-bar-border': '#d1d1d1', - '--color-resize-bar-dot': '#333333', - '--color-timeline-internal-module': '#d1d1d1', - '--color-timeline-internal-module-hover': '#c9c9c9', - '--color-timeline-internal-module-text': '#444', - '--color-timeline-native-event': '#ccc', - '--color-timeline-native-event-hover': '#aaa', - '--color-timeline-network-primary': '#fcf3dc', - '--color-timeline-network-primary-hover': '#f0e7d1', - '--color-timeline-network-secondary': '#efc457', - '--color-timeline-network-secondary-hover': '#e3ba52', - '--color-timeline-priority-background': '#f6f6f6', - '--color-timeline-priority-border': '#eeeeee', - '--color-timeline-user-timing': '#c9cacd', - '--color-timeline-user-timing-hover': '#93959a', - '--color-timeline-react-idle': '#d3e5f6', - '--color-timeline-react-idle-hover': '#c3d9ef', - '--color-timeline-react-render': '#9fc3f3', - '--color-timeline-react-render-hover': '#83afe9', - '--color-timeline-react-render-text': '#11365e', - '--color-timeline-react-commit': '#c88ff0', - '--color-timeline-react-commit-hover': '#b281d6', - '--color-timeline-react-commit-text': '#3e2c4a', - '--color-timeline-react-layout-effects': '#b281d6', - '--color-timeline-react-layout-effects-hover': '#9d71bd', - '--color-timeline-react-layout-effects-text': '#3e2c4a', - '--color-timeline-react-passive-effects': '#b281d6', - '--color-timeline-react-passive-effects-hover': '#9d71bd', - '--color-timeline-react-passive-effects-text': '#3e2c4a', - '--color-timeline-react-schedule': '#9fc3f3', - '--color-timeline-react-schedule-hover': '#2683E2', - '--color-timeline-react-suspense-rejected': '#f1cc14', - '--color-timeline-react-suspense-rejected-hover': '#ffdf37', - '--color-timeline-react-suspense-resolved': '#a6e59f', - '--color-timeline-react-suspense-resolved-hover': '#89d281', - '--color-timeline-react-suspense-unresolved': '#c9cacd', - '--color-timeline-react-suspense-unresolved-hover': '#93959a', - '--color-timeline-thrown-error': '#ee1638', - '--color-timeline-thrown-error-hover': '#da1030', - '--color-timeline-text-color': '#000000', - '--color-timeline-text-dim-color': '#ccc', - '--color-timeline-react-work-border': '#eeeeee', - '--color-search-match': 'yellow', - '--color-search-match-current': '#f7923b', - '--color-selected-tree-highlight-active': 'rgba(0, 136, 250, 0.1)', - '--color-selected-tree-highlight-inactive': 'rgba(0, 0, 0, 0.05)', - '--color-scroll-caret': 'rgba(150, 150, 150, 0.5)', - '--color-tab-selected-border': '#0088fa', - '--color-text': '#000000', - '--color-text-invalid': '#ff0000', - '--color-text-selected': '#ffffff', - '--color-toggle-background-invalid': '#fc3a4b', - '--color-toggle-background-on': '#0088fa', - '--color-toggle-background-off': '#cfd1d5', - '--color-toggle-text': '#ffffff', - '--color-warning-background': '#fb3655', - '--color-warning-background-hover': '#f82042', - '--color-warning-text-color': '#ffffff', - '--color-warning-text-color-inverted': '#fd4d69', - // The styles below should be kept in sync with 'root.css' - // They are repeated there because they're used by e.g. tooltips or context menus - // which get rendered outside of the DOM subtree (where normal theme/styles are written). - '--color-scroll-thumb': '#c2c2c2', - '--color-scroll-track': '#fafafa', - '--color-tooltip-background': 'rgba(0, 0, 0, 0.9)', - '--color-tooltip-text': '#ffffff' - }, - dark: { - '--color-attribute-name': '#9d87d2', - '--color-attribute-name-not-editable': '#ededed', - '--color-attribute-name-inverted': '#282828', - '--color-attribute-value': '#cedae0', - '--color-attribute-value-inverted': '#ffffff', - '--color-attribute-editable-value': 'yellow', - '--color-background': '#282c34', - '--color-background-hover': 'rgba(255, 255, 255, 0.1)', - '--color-background-inactive': '#3d424a', - '--color-background-invalid': '#5c0000', - '--color-background-selected': '#178fb9', - '--color-button-background': '#282c34', - '--color-button-background-focus': '#3d424a', - '--color-button': '#afb3b9', - '--color-button-active': '#61dafb', - '--color-button-disabled': '#4f5766', - '--color-button-focus': '#a2e9fc', - '--color-button-hover': '#ededed', - '--color-border': '#3d424a', - '--color-commit-did-not-render-fill': '#777d88', - '--color-commit-did-not-render-fill-text': '#000000', - '--color-commit-did-not-render-pattern': '#666c77', - '--color-commit-did-not-render-pattern-text': '#ffffff', - '--color-commit-gradient-0': '#37afa9', - '--color-commit-gradient-1': '#63b19e', - '--color-commit-gradient-2': '#80b393', - '--color-commit-gradient-3': '#97b488', - '--color-commit-gradient-4': '#abb67d', - '--color-commit-gradient-5': '#beb771', - '--color-commit-gradient-6': '#cfb965', - '--color-commit-gradient-7': '#dfba57', - '--color-commit-gradient-8': '#efbb49', - '--color-commit-gradient-9': '#febc38', - '--color-commit-gradient-text': '#000000', - '--color-component-name': '#61dafb', - '--color-component-name-inverted': '#282828', - '--color-component-badge-background': 'rgba(255, 255, 255, 0.25)', - '--color-component-badge-background-inverted': 'rgba(0, 0, 0, 0.25)', - '--color-component-badge-count': '#8f949d', - '--color-component-badge-count-inverted': 'rgba(255, 255, 255, 0.7)', - '--color-console-error-badge-text': '#000000', - '--color-console-error-background': '#290000', - '--color-console-error-border': '#5c0000', - '--color-console-error-icon': '#eb3941', - '--color-console-error-text': '#fc7f7f', - '--color-console-warning-badge-text': '#000000', - '--color-console-warning-background': '#332b00', - '--color-console-warning-border': '#665500', - '--color-console-warning-icon': '#f4bd00', - '--color-console-warning-text': '#f5f2ed', - '--color-context-background': 'rgba(255,255,255,.95)', - '--color-context-background-hover': 'rgba(0, 136, 250, 0.1)', - '--color-context-background-selected': '#0088fa', - '--color-context-border': '#eeeeee', - '--color-context-text': '#000000', - '--color-context-text-selected': '#ffffff', - '--color-dim': '#8f949d', - '--color-dimmer': '#777d88', - '--color-dimmest': '#4f5766', - '--color-error-background': '#200', - '--color-error-border': '#900', - '--color-error-text': '#f55', - '--color-expand-collapse-toggle': '#8f949d', - '--color-link': '#61dafb', - '--color-modal-background': 'rgba(0, 0, 0, 0.75)', - '--color-bridge-version-npm-background': 'rgba(0, 0, 0, 0.25)', - '--color-bridge-version-npm-text': '#ffffff', - '--color-bridge-version-number': 'yellow', - '--color-primitive-hook-badge-background': 'rgba(0, 0, 0, 0.25)', - '--color-primitive-hook-badge-text': 'rgba(255, 255, 255, 0.7)', - '--color-record-active': '#fc3a4b', - '--color-record-hover': '#a2e9fc', - '--color-record-inactive': '#61dafb', - '--color-resize-bar': '#282c34', - '--color-resize-bar-active': '#31363f', - '--color-resize-bar-border': '#3d424a', - '--color-resize-bar-dot': '#cfd1d5', - '--color-timeline-internal-module': '#303542', - '--color-timeline-internal-module-hover': '#363b4a', - '--color-timeline-internal-module-text': '#7f8899', - '--color-timeline-native-event': '#b2b2b2', - '--color-timeline-native-event-hover': '#949494', - '--color-timeline-network-primary': '#fcf3dc', - '--color-timeline-network-primary-hover': '#e3dbc5', - '--color-timeline-network-secondary': '#efc457', - '--color-timeline-network-secondary-hover': '#d6af4d', - '--color-timeline-priority-background': '#1d2129', - '--color-timeline-priority-border': '#282c34', - '--color-timeline-user-timing': '#c9cacd', - '--color-timeline-user-timing-hover': '#93959a', - '--color-timeline-react-idle': '#3d485b', - '--color-timeline-react-idle-hover': '#465269', - '--color-timeline-react-render': '#2683E2', - '--color-timeline-react-render-hover': '#1a76d4', - '--color-timeline-react-render-text': '#11365e', - '--color-timeline-react-commit': '#731fad', - '--color-timeline-react-commit-hover': '#611b94', - '--color-timeline-react-commit-text': '#e5c1ff', - '--color-timeline-react-layout-effects': '#611b94', - '--color-timeline-react-layout-effects-hover': '#51167a', - '--color-timeline-react-layout-effects-text': '#e5c1ff', - '--color-timeline-react-passive-effects': '#611b94', - '--color-timeline-react-passive-effects-hover': '#51167a', - '--color-timeline-react-passive-effects-text': '#e5c1ff', - '--color-timeline-react-schedule': '#2683E2', - '--color-timeline-react-schedule-hover': '#1a76d4', - '--color-timeline-react-suspense-rejected': '#f1cc14', - '--color-timeline-react-suspense-rejected-hover': '#e4c00f', - '--color-timeline-react-suspense-resolved': '#a6e59f', - '--color-timeline-react-suspense-resolved-hover': '#89d281', - '--color-timeline-react-suspense-unresolved': '#c9cacd', - '--color-timeline-react-suspense-unresolved-hover': '#93959a', - '--color-timeline-thrown-error': '#fb3655', - '--color-timeline-thrown-error-hover': '#f82042', - '--color-timeline-text-color': '#282c34', - '--color-timeline-text-dim-color': '#555b66', - '--color-timeline-react-work-border': '#3d424a', - '--color-search-match': 'yellow', - '--color-search-match-current': '#f7923b', - '--color-selected-tree-highlight-active': 'rgba(23, 143, 185, 0.15)', - '--color-selected-tree-highlight-inactive': 'rgba(255, 255, 255, 0.05)', - '--color-scroll-caret': '#4f5766', - '--color-shadow': 'rgba(0, 0, 0, 0.5)', - '--color-tab-selected-border': '#178fb9', - '--color-text': '#ffffff', - '--color-text-invalid': '#ff8080', - '--color-text-selected': '#ffffff', - '--color-toggle-background-invalid': '#fc3a4b', - '--color-toggle-background-on': '#178fb9', - '--color-toggle-background-off': '#777d88', - '--color-toggle-text': '#ffffff', - '--color-warning-background': '#ee1638', - '--color-warning-background-hover': '#da1030', - '--color-warning-text-color': '#ffffff', - '--color-warning-text-color-inverted': '#ee1638', - // The styles below should be kept in sync with 'root.css' - // They are repeated there because they're used by e.g. tooltips or context menus - // which get rendered outside of the DOM subtree (where normal theme/styles are written). - '--color-scroll-thumb': '#afb3b9', - '--color-scroll-track': '#313640', - '--color-tooltip-background': 'rgba(255, 255, 255, 0.95)', - '--color-tooltip-text': '#000000' - }, - compact: { - '--font-size-monospace-small': '9px', - '--font-size-monospace-normal': '11px', - '--font-size-monospace-large': '15px', - '--font-size-sans-small': '10px', - '--font-size-sans-normal': '12px', - '--font-size-sans-large': '14px', - '--line-height-data': '18px' - }, - comfortable: { - '--font-size-monospace-small': '10px', - '--font-size-monospace-normal': '13px', - '--font-size-monospace-large': '17px', - '--font-size-sans-small': '12px', - '--font-size-sans-normal': '14px', - '--font-size-sans-large': '16px', - '--line-height-data': '22px' - } -}; // HACK -// -// Sometimes the inline target is rendered before root styles are applied, -// which would result in e.g. NaN itemSize being passed to react-window list. - -const COMFORTABLE_LINE_HEIGHT = parseInt(THEME_STYLES.comfortable['--line-height-data'], 10); -const COMPACT_LINE_HEIGHT = parseInt(THEME_STYLES.compact['--line-height-data'], 10); - -// CONCATENATED MODULE: ../react-devtools-timeline/src/constants.js -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - -const REACT_TOTAL_NUM_LANES = 31; // Increment this number any time a backwards breaking change is made to the profiler metadata. - -const SCHEDULING_PROFILER_VERSION = 1; -const SNAPSHOT_MAX_HEIGHT = 60; -// CONCATENATED MODULE: ../react-devtools-timeline/src/import-worker/InvalidProfileError.js -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - -/** - * An error thrown when an invalid profile could not be processed. - */ -class InvalidProfileError extends Error {} -// CONCATENATED MODULE: ../react-devtools-timeline/node_modules/memoize-one/dist/memoize-one.esm.js -function areInputsEqual(newInputs, lastInputs) { - if (newInputs.length !== lastInputs.length) { - return false; - } - - for (var i = 0; i < newInputs.length; i++) { - if (newInputs[i] !== lastInputs[i]) { - return false; - } - } - - return true; -} - -function memoizeOne(resultFn, isEqual) { - if (isEqual === void 0) { - isEqual = areInputsEqual; - } - - var lastThis; - var lastArgs = []; - var lastResult; - var calledOnce = false; - - function memoized() { - var newArgs = []; - - for (var _i = 0; _i < arguments.length; _i++) { - newArgs[_i] = arguments[_i]; - } - - if (calledOnce && lastThis === this && isEqual(newArgs, lastArgs)) { - return lastResult; - } - - lastResult = resultFn.apply(this, newArgs); - calledOnce = true; - lastThis = this; - lastArgs = newArgs; - return lastResult; - } - - return memoized; -} - -/* harmony default export */ var memoize_one_esm = (memoizeOne); -// CONCATENATED MODULE: ../react-devtools-timeline/src/utils/getBatchRange.js -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - -function unmemoizedGetBatchRange(batchUID, data, minStartTime = 0) { - const measures = data.batchUIDToMeasuresMap.get(batchUID); - - if (measures == null || measures.length === 0) { - throw Error(`Could not find measures with batch UID "${batchUID}"`); - } - - const lastMeasure = measures[measures.length - 1]; - const stopTime = lastMeasure.timestamp + lastMeasure.duration; - - if (stopTime < minStartTime) { - return [0, 0]; - } - - let startTime = minStartTime; - - for (let index = 0; index < measures.length; index++) { - const measure = measures[index]; - - if (measure.timestamp >= minStartTime) { - startTime = measure.timestamp; - break; - } - } - - return [startTime, stopTime]; -} - -const getBatchRange = memoize_one_esm(unmemoizedGetBatchRange); -// EXTERNAL MODULE: /Users/mengdi/workspace/git/react/node_modules/error-stack-parser/error-stack-parser.js -var error_stack_parser = __webpack_require__(3); -var error_stack_parser_default = /*#__PURE__*/__webpack_require__.n(error_stack_parser); - -// CONCATENATED MODULE: ../react-devtools-timeline/src/import-worker/preprocessData.js -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - - - -const NATIVE_EVENT_DURATION_THRESHOLD = 20; -const NESTED_UPDATE_DURATION_THRESHOLD = 20; -const WARNING_STRINGS = { - LONG_EVENT_HANDLER: 'An event handler scheduled a big update with React. Consider using the Transition API to defer some of this work.', - NESTED_UPDATE: 'A big nested update was scheduled during layout. ' + 'Nested updates require React to re-render synchronously before the browser can paint. ' + 'Consider delaying this update by moving it to a passive effect (useEffect).', - SUSPEND_DURING_UPDATE: 'A component suspended during an update which caused a fallback to be shown. ' + "Consider using the Transition API to avoid hiding components after they've been mounted." -}; // Exported for tests - -function getLanesFromTransportDecimalBitmask(laneBitmaskString) { - const laneBitmask = parseInt(laneBitmaskString, 10); // As negative numbers are stored in two's complement format, our bitmask - // checks will be thrown off by them. - - if (laneBitmask < 0) { - return []; - } - - const lanes = []; - let powersOfTwo = 0; - - while (powersOfTwo <= REACT_TOTAL_NUM_LANES) { - if (1 << powersOfTwo & laneBitmask) { - lanes.push(powersOfTwo); - } - - powersOfTwo++; - } - - return lanes; -} - -function updateLaneToLabelMap(profilerData, laneLabelTuplesString) { - // These marks appear multiple times in the data; - // We only need to extact them once. - if (profilerData.laneToLabelMap.size === 0) { - const laneLabelTuples = laneLabelTuplesString.split(','); - - for (let laneIndex = 0; laneIndex < laneLabelTuples.length; laneIndex++) { - // The numeric lane value (e.g. 64) isn't important. - // The profiler parses and stores the lane's position within the bitmap, - // (e.g. lane 1 is index 0, lane 16 is index 4). - profilerData.laneToLabelMap.set(laneIndex, laneLabelTuples[laneIndex]); - } - } -} - -let profilerVersion = null; - -function getLastType(stack) { - if (stack.length > 0) { - const { - type - } = stack[stack.length - 1]; - return type; - } - - return null; -} - -function getDepth(stack) { - if (stack.length > 0) { - const { - depth, - type - } = stack[stack.length - 1]; - return type === 'render-idle' ? depth : depth + 1; - } - - return 0; -} - -function markWorkStarted(type, startTime, lanes, currentProfilerData, state) { - const { - batchUID, - measureStack - } = state; - const depth = getDepth(measureStack); - const measure = { - type, - batchUID, - depth, - lanes, - timestamp: startTime, - duration: 0 - }; - state.measureStack.push({ - depth, - measure, - startTime, - type - }); // This array is pre-initialized when the batchUID is generated. - - const measures = currentProfilerData.batchUIDToMeasuresMap.get(batchUID); - - if (measures != null) { - measures.push(measure); - } else { - currentProfilerData.batchUIDToMeasuresMap.set(state.batchUID, [measure]); - } // This array is pre-initialized before processing starts. - - - lanes.forEach(lane => { - currentProfilerData.laneToReactMeasureMap.get(lane).push(measure); - }); -} - -function markWorkCompleted(type, stopTime, currentProfilerData, stack) { - if (stack.length === 0) { - console.error('Unexpected type "%s" completed at %sms while stack is empty.', type, stopTime); // Ignore work "completion" user timing mark that doesn't complete anything - - return; - } - - const last = stack[stack.length - 1]; - - if (last.type !== type) { - console.error('Unexpected type "%s" completed at %sms before "%s" completed.', type, stopTime, last.type); - } - - const { - measure, - startTime - } = stack.pop(); - - if (!measure) { - console.error('Could not find matching measure for type "%s".', type); - } // $FlowFixMe This property should not be writable outside of this function. - - - measure.duration = stopTime - startTime; -} - -function throwIfIncomplete(type, stack) { - const lastIndex = stack.length - 1; - - if (lastIndex >= 0) { - const last = stack[lastIndex]; - - if (last.stopTime === undefined && last.type === type) { - throw new InvalidProfileError(`Unexpected type "${type}" started before "${last.type}" completed.`); - } - } -} - -function processEventDispatch(event, timestamp, profilerData, state) { - const data = event.args.data; - const type = data.type; - - if (type.startsWith('react-')) { - const stackTrace = data.stackTrace; - - if (stackTrace) { - const topFrame = stackTrace[stackTrace.length - 1]; - - if (topFrame.url.includes('/react-dom.')) { - // Filter out fake React events dispatched by invokeGuardedCallbackDev. - return; - } - } - } // Reduce noise from events like DOMActivate, load/unload, etc. which are usually not relevant - - - if (type === 'blur' || type === 'click' || type === 'input' || type.startsWith('focus') || type.startsWith('key') || type.startsWith('mouse') || type.startsWith('pointer')) { - const duration = event.dur / 1000; - let depth = 0; - - while (state.nativeEventStack.length > 0) { - const prevNativeEvent = state.nativeEventStack[state.nativeEventStack.length - 1]; - const prevStopTime = prevNativeEvent.timestamp + prevNativeEvent.duration; - - if (timestamp < prevStopTime) { - depth = prevNativeEvent.depth + 1; - break; - } else { - state.nativeEventStack.pop(); - } - } - - const nativeEvent = { - depth, - duration, - timestamp, - type, - warning: null - }; - profilerData.nativeEvents.push(nativeEvent); // Keep track of curent event in case future ones overlap. - // We separate them into different vertical lanes in this case. - - state.nativeEventStack.push(nativeEvent); - } -} - -function processResourceFinish(event, timestamp, profilerData, state) { - const requestId = event.args.data.requestId; - const networkMeasure = state.requestIdToNetworkMeasureMap.get(requestId); - - if (networkMeasure != null) { - networkMeasure.finishTimestamp = timestamp; - - if (networkMeasure.firstReceivedDataTimestamp === 0) { - networkMeasure.firstReceivedDataTimestamp = timestamp; - } - - if (networkMeasure.lastReceivedDataTimestamp === 0) { - networkMeasure.lastReceivedDataTimestamp = timestamp; - } // Clean up now that the resource is done. - - - state.requestIdToNetworkMeasureMap.delete(event.args.data.requestId); - } -} - -function processResourceReceivedData(event, timestamp, profilerData, state) { - const requestId = event.args.data.requestId; - const networkMeasure = state.requestIdToNetworkMeasureMap.get(requestId); - - if (networkMeasure != null) { - if (networkMeasure.firstReceivedDataTimestamp === 0) { - networkMeasure.firstReceivedDataTimestamp = timestamp; - } - - networkMeasure.lastReceivedDataTimestamp = timestamp; - networkMeasure.finishTimestamp = timestamp; - } -} - -function processResourceReceiveResponse(event, timestamp, profilerData, state) { - const requestId = event.args.data.requestId; - const networkMeasure = state.requestIdToNetworkMeasureMap.get(requestId); - - if (networkMeasure != null) { - networkMeasure.receiveResponseTimestamp = timestamp; - } -} - -function processScreenshot(event, timestamp, profilerData, state) { - const encodedSnapshot = event.args.snapshot; // Base 64 encoded - - const snapshot = { - height: 0, - image: null, - imageSource: `data:image/png;base64,${encodedSnapshot}`, - timestamp, - width: 0 - }; // Delay processing until we've extracted snapshot dimensions. - - let resolveFn = null; - state.asyncProcessingPromises.push(new Promise(resolve => { - resolveFn = resolve; - })); // Parse the Base64 image data to determine native size. - // This will be used later to scale for display within the thumbnail strip. - - fetch(snapshot.imageSource).then(response => response.blob()).then(blob => { - // $FlowFixMe createImageBitmap - createImageBitmap(blob).then(bitmap => { - snapshot.height = bitmap.height; - snapshot.width = bitmap.width; - resolveFn(); - }); - }); - profilerData.snapshots.push(snapshot); -} - -function processResourceSendRequest(event, timestamp, profilerData, state) { - const data = event.args.data; - const requestId = data.requestId; - const availableDepths = new Array(state.requestIdToNetworkMeasureMap.size + 1).fill(true); - state.requestIdToNetworkMeasureMap.forEach(({ - depth - }) => { - availableDepths[depth] = false; - }); - let depth = 0; - - for (let i = 0; i < availableDepths.length; i++) { - if (availableDepths[i]) { - depth = i; - break; - } - } - - const networkMeasure = { - depth, - finishTimestamp: 0, - firstReceivedDataTimestamp: 0, - lastReceivedDataTimestamp: 0, - requestId, - requestMethod: data.requestMethod, - priority: data.priority, - sendRequestTimestamp: timestamp, - receiveResponseTimestamp: 0, - url: data.url - }; - state.requestIdToNetworkMeasureMap.set(requestId, networkMeasure); - profilerData.networkMeasures.push(networkMeasure); - networkMeasure.sendRequestTimestamp = timestamp; -} - -function processTimelineEvent(event, -/** Finalized profiler data up to `event`. May be mutated. */ -currentProfilerData, -/** Intermediate processor state. May be mutated. */ -state) { - const { - cat, - name, - ts, - ph - } = event; - const startTime = (ts - currentProfilerData.startTime) / 1000; - - switch (cat) { - case 'disabled-by-default-devtools.screenshot': - processScreenshot(event, startTime, currentProfilerData, state); - break; - - case 'devtools.timeline': - switch (name) { - case 'EventDispatch': - processEventDispatch(event, startTime, currentProfilerData, state); - break; - - case 'ResourceFinish': - processResourceFinish(event, startTime, currentProfilerData, state); - break; - - case 'ResourceReceivedData': - processResourceReceivedData(event, startTime, currentProfilerData, state); - break; - - case 'ResourceReceiveResponse': - processResourceReceiveResponse(event, startTime, currentProfilerData, state); - break; - - case 'ResourceSendRequest': - processResourceSendRequest(event, startTime, currentProfilerData, state); - break; - } - - break; - - case 'blink.user_timing': - if (name.startsWith('--react-version-')) { - const [reactVersion] = name.substr(16).split('-'); - currentProfilerData.reactVersion = reactVersion; - } else if (name.startsWith('--profiler-version-')) { - const [versionString] = name.substr(19).split('-'); - profilerVersion = parseInt(versionString, 10); - - if (profilerVersion !== SCHEDULING_PROFILER_VERSION) { - throw new InvalidProfileError(`This version of profiling data (${versionString}) is not supported by the current profiler.`); - } - } else if (name.startsWith('--react-lane-labels-')) { - const [laneLabelTuplesString] = name.substr(20).split('-'); - updateLaneToLabelMap(currentProfilerData, laneLabelTuplesString); - } else if (name.startsWith('--component-')) { - processReactComponentMeasure(name, startTime, currentProfilerData, state); - } else if (name.startsWith('--schedule-render-')) { - const [laneBitmaskString] = name.substr(18).split('-'); - currentProfilerData.schedulingEvents.push({ - type: 'schedule-render', - lanes: getLanesFromTransportDecimalBitmask(laneBitmaskString), - timestamp: startTime, - warning: null - }); - } else if (name.startsWith('--schedule-forced-update-')) { - const [laneBitmaskString, componentName] = name.substr(25).split('-'); - const forceUpdateEvent = { - type: 'schedule-force-update', - lanes: getLanesFromTransportDecimalBitmask(laneBitmaskString), - componentName, - timestamp: startTime, - warning: null - }; // If this is a nested update, make a note of it. - // Once we're done processing events, we'll check to see if it was a long update and warn about it. - - if (state.measureStack.find(({ - type - }) => type === 'commit')) { - state.potentialLongNestedUpdate = forceUpdateEvent; - } - - currentProfilerData.schedulingEvents.push(forceUpdateEvent); - } else if (name.startsWith('--schedule-state-update-')) { - const [laneBitmaskString, componentName] = name.substr(24).split('-'); - const stateUpdateEvent = { - type: 'schedule-state-update', - lanes: getLanesFromTransportDecimalBitmask(laneBitmaskString), - componentName, - timestamp: startTime, - warning: null - }; // If this is a nested update, make a note of it. - // Once we're done processing events, we'll check to see if it was a long update and warn about it. - - if (state.measureStack.find(({ - type - }) => type === 'commit')) { - state.potentialLongNestedUpdate = stateUpdateEvent; - } - - currentProfilerData.schedulingEvents.push(stateUpdateEvent); - } else if (name.startsWith('--error-')) { - const [componentName, phase, message] = name.substr(8).split('-'); - currentProfilerData.thrownErrors.push({ - componentName, - message, - phase: phase, - timestamp: startTime, - type: 'thrown-error' - }); - } else if (name.startsWith('--suspense-suspend-')) { - const [id, componentName, phase, laneBitmaskString, promiseName] = name.substr(19).split('-'); - const lanes = getLanesFromTransportDecimalBitmask(laneBitmaskString); - const availableDepths = new Array(state.unresolvedSuspenseEvents.size + 1).fill(true); - state.unresolvedSuspenseEvents.forEach(({ - depth - }) => { - availableDepths[depth] = false; - }); - let depth = 0; - - for (let i = 0; i < availableDepths.length; i++) { - if (availableDepths[i]) { - depth = i; - break; - } - } // TODO (timeline) Maybe we should calculate depth in post, - // so unresolved Suspense requests don't take up space. - // We can't know if they'll be resolved or not at this point. - // We'll just give them a default (fake) duration width. - - - const suspenseEvent = { - componentName, - depth, - duration: null, - id, - phase: phase, - promiseName: promiseName || null, - resolution: 'unresolved', - timestamp: startTime, - type: 'suspense', - warning: null - }; - - if (phase === 'update') { - // If a component suspended during an update, we should verify that it was during a transition. - // We need the lane metadata to verify this though. - // Since that data is only logged during commit, we may not have it yet. - // Store these events for post-processing then. - state.potentialSuspenseEventsOutsideOfTransition.push([suspenseEvent, lanes]); - } - - currentProfilerData.suspenseEvents.push(suspenseEvent); - state.unresolvedSuspenseEvents.set(id, suspenseEvent); - } else if (name.startsWith('--suspense-resolved-')) { - const [id] = name.substr(20).split('-'); - const suspenseEvent = state.unresolvedSuspenseEvents.get(id); - - if (suspenseEvent != null) { - state.unresolvedSuspenseEvents.delete(id); - suspenseEvent.duration = startTime - suspenseEvent.timestamp; - suspenseEvent.resolution = 'resolved'; - } - } else if (name.startsWith('--suspense-rejected-')) { - const [id] = name.substr(20).split('-'); - const suspenseEvent = state.unresolvedSuspenseEvents.get(id); - - if (suspenseEvent != null) { - state.unresolvedSuspenseEvents.delete(id); - suspenseEvent.duration = startTime - suspenseEvent.timestamp; - suspenseEvent.resolution = 'rejected'; - } - } else if (name.startsWith('--render-start-')) { - if (state.nextRenderShouldGenerateNewBatchID) { - state.nextRenderShouldGenerateNewBatchID = false; - state.batchUID = state.uidCounter++; - } // If this render is the result of a nested update, make a note of it. - // Once we're done processing events, we'll check to see if it was a long update and warn about it. - - - if (state.potentialLongNestedUpdate !== null) { - state.potentialLongNestedUpdates.push([state.potentialLongNestedUpdate, state.batchUID]); - state.potentialLongNestedUpdate = null; - } - - const [laneBitmaskString] = name.substr(15).split('-'); - throwIfIncomplete('render', state.measureStack); - - if (getLastType(state.measureStack) !== 'render-idle') { - markWorkStarted('render-idle', startTime, getLanesFromTransportDecimalBitmask(laneBitmaskString), currentProfilerData, state); - } - - markWorkStarted('render', startTime, getLanesFromTransportDecimalBitmask(laneBitmaskString), currentProfilerData, state); - - for (let i = 0; i < state.nativeEventStack.length; i++) { - const nativeEvent = state.nativeEventStack[i]; - const stopTime = nativeEvent.timestamp + nativeEvent.duration; // If React work was scheduled during an event handler, and the event had a long duration, - // it might be because the React render was long and stretched the event. - // It might also be that the React work was short and that something else stretched the event. - // Make a note of this event for now and we'll examine the batch of React render work later. - // (We can't know until we're done processing the React update anyway.) - - if (stopTime > startTime) { - state.potentialLongEvents.push([nativeEvent, state.batchUID]); - } - } - } else if (name.startsWith('--render-stop') || name.startsWith('--render-yield')) { - markWorkCompleted('render', startTime, currentProfilerData, state.measureStack); - } else if (name.startsWith('--commit-start-')) { - state.nextRenderShouldGenerateNewBatchID = true; - const [laneBitmaskString] = name.substr(15).split('-'); - markWorkStarted('commit', startTime, getLanesFromTransportDecimalBitmask(laneBitmaskString), currentProfilerData, state); - } else if (name.startsWith('--commit-stop')) { - markWorkCompleted('commit', startTime, currentProfilerData, state.measureStack); - markWorkCompleted('render-idle', startTime, currentProfilerData, state.measureStack); - } else if (name.startsWith('--layout-effects-start-')) { - const [laneBitmaskString] = name.substr(23).split('-'); - markWorkStarted('layout-effects', startTime, getLanesFromTransportDecimalBitmask(laneBitmaskString), currentProfilerData, state); - } else if (name.startsWith('--layout-effects-stop')) { - markWorkCompleted('layout-effects', startTime, currentProfilerData, state.measureStack); - } else if (name.startsWith('--passive-effects-start-')) { - const [laneBitmaskString] = name.substr(24).split('-'); - markWorkStarted('passive-effects', startTime, getLanesFromTransportDecimalBitmask(laneBitmaskString), currentProfilerData, state); - } else if (name.startsWith('--passive-effects-stop')) { - markWorkCompleted('passive-effects', startTime, currentProfilerData, state.measureStack); - } else if (name.startsWith('--react-internal-module-start-')) { - const stackFrameStart = name.substr(30); - - if (!state.internalModuleStackStringSet.has(stackFrameStart)) { - state.internalModuleStackStringSet.add(stackFrameStart); - const parsedStackFrameStart = parseStackFrame(stackFrameStart); - state.internalModuleCurrentStackFrame = parsedStackFrameStart; - } - } else if (name.startsWith('--react-internal-module-stop-')) { - const stackFrameStop = name.substr(29); - - if (!state.internalModuleStackStringSet.has(stackFrameStop)) { - state.internalModuleStackStringSet.add(stackFrameStop); - const parsedStackFrameStop = parseStackFrame(stackFrameStop); - - if (parsedStackFrameStop !== null && state.internalModuleCurrentStackFrame !== null) { - const parsedStackFrameStart = state.internalModuleCurrentStackFrame; - state.internalModuleCurrentStackFrame = null; - const range = [parsedStackFrameStart, parsedStackFrameStop]; - const ranges = currentProfilerData.internalModuleSourceToRanges.get(parsedStackFrameStart.fileName); - - if (ranges == null) { - currentProfilerData.internalModuleSourceToRanges.set(parsedStackFrameStart.fileName, [range]); - } else { - ranges.push(range); - } - } - } - } else if (ph === 'R' || ph === 'n') { - // User Timing mark - currentProfilerData.otherUserTimingMarks.push({ - name, - timestamp: startTime - }); - } else if (ph === 'b') {// TODO: Begin user timing measure - } else if (ph === 'e') {// TODO: End user timing measure - } else if (ph === 'i' || ph === 'I') {// Instant events. - // Note that the capital "I" is a deprecated value that exists in Chrome Canary traces. - } else { - throw new InvalidProfileError(`Unrecognized event ${JSON.stringify(event)}! This is likely a bug in this profiler tool.`); - } - - break; - } -} - -function assertNoOverlappingComponentMeasure(state) { - if (state.currentReactComponentMeasure !== null) { - console.error('Component measure started while another measure in progress:', state.currentReactComponentMeasure); - } -} - -function assertCurrentComponentMeasureType(state, type) { - if (state.currentReactComponentMeasure === null) { - console.error(`Component measure type "${type}" stopped while no measure was in progress`); - } else if (state.currentReactComponentMeasure.type !== type) { - console.error(`Component measure type "${type}" stopped while type ${state.currentReactComponentMeasure.type} in progress`); - } -} - -function processReactComponentMeasure(name, startTime, currentProfilerData, state) { - if (name.startsWith('--component-render-start-')) { - const [componentName] = name.substr(25).split('-'); - assertNoOverlappingComponentMeasure(state); - state.currentReactComponentMeasure = { - componentName, - timestamp: startTime, - duration: 0, - type: 'render', - warning: null - }; - } else if (name === '--component-render-stop') { - assertCurrentComponentMeasureType(state, 'render'); - - if (state.currentReactComponentMeasure !== null) { - const componentMeasure = state.currentReactComponentMeasure; - componentMeasure.duration = startTime - componentMeasure.timestamp; - state.currentReactComponentMeasure = null; - currentProfilerData.componentMeasures.push(componentMeasure); - } - } else if (name.startsWith('--component-layout-effect-mount-start-')) { - const [componentName] = name.substr(38).split('-'); - assertNoOverlappingComponentMeasure(state); - state.currentReactComponentMeasure = { - componentName, - timestamp: startTime, - duration: 0, - type: 'layout-effect-mount', - warning: null - }; - } else if (name === '--component-layout-effect-mount-stop') { - assertCurrentComponentMeasureType(state, 'layout-effect-mount'); - - if (state.currentReactComponentMeasure !== null) { - const componentMeasure = state.currentReactComponentMeasure; - componentMeasure.duration = startTime - componentMeasure.timestamp; - state.currentReactComponentMeasure = null; - currentProfilerData.componentMeasures.push(componentMeasure); - } - } else if (name.startsWith('--component-layout-effect-unmount-start-')) { - const [componentName] = name.substr(40).split('-'); - assertNoOverlappingComponentMeasure(state); - state.currentReactComponentMeasure = { - componentName, - timestamp: startTime, - duration: 0, - type: 'layout-effect-unmount', - warning: null - }; - } else if (name === '--component-layout-effect-unmount-stop') { - assertCurrentComponentMeasureType(state, 'layout-effect-unmount'); - - if (state.currentReactComponentMeasure !== null) { - const componentMeasure = state.currentReactComponentMeasure; - componentMeasure.duration = startTime - componentMeasure.timestamp; - state.currentReactComponentMeasure = null; - currentProfilerData.componentMeasures.push(componentMeasure); - } - } else if (name.startsWith('--component-passive-effect-mount-start-')) { - const [componentName] = name.substr(39).split('-'); - assertNoOverlappingComponentMeasure(state); - state.currentReactComponentMeasure = { - componentName, - timestamp: startTime, - duration: 0, - type: 'passive-effect-mount', - warning: null - }; - } else if (name === '--component-passive-effect-mount-stop') { - assertCurrentComponentMeasureType(state, 'passive-effect-mount'); - - if (state.currentReactComponentMeasure !== null) { - const componentMeasure = state.currentReactComponentMeasure; - componentMeasure.duration = startTime - componentMeasure.timestamp; - state.currentReactComponentMeasure = null; - currentProfilerData.componentMeasures.push(componentMeasure); - } - } else if (name.startsWith('--component-passive-effect-unmount-start-')) { - const [componentName] = name.substr(41).split('-'); - assertNoOverlappingComponentMeasure(state); - state.currentReactComponentMeasure = { - componentName, - timestamp: startTime, - duration: 0, - type: 'passive-effect-unmount', - warning: null - }; - } else if (name === '--component-passive-effect-unmount-stop') { - assertCurrentComponentMeasureType(state, 'passive-effect-unmount'); - - if (state.currentReactComponentMeasure !== null) { - const componentMeasure = state.currentReactComponentMeasure; - componentMeasure.duration = startTime - componentMeasure.timestamp; - state.currentReactComponentMeasure = null; - currentProfilerData.componentMeasures.push(componentMeasure); - } - } -} - -function preprocessFlamechart(rawData) { - let parsedData; - - try { - parsedData = Object(library["importFromChromeTimeline"])(rawData, 'react-devtools'); - } catch (error) { - // Assume any Speedscope errors are caused by bad profiles - const errorToRethrow = new InvalidProfileError(error.message); - errorToRethrow.stack = error.stack; - throw errorToRethrow; - } - - const profile = parsedData.profiles[0]; // TODO: Choose the main CPU thread only - - const speedscopeFlamechart = new library["Flamechart"]({ - // $FlowFixMe[method-unbinding] - getTotalWeight: profile.getTotalWeight.bind(profile), - // $FlowFixMe[method-unbinding] - forEachCall: profile.forEachCall.bind(profile), - // $FlowFixMe[method-unbinding] - formatValue: profile.formatValue.bind(profile), - getColorBucketForFrame: () => 0 - }); - const flamechart = speedscopeFlamechart.getLayers().map(layer => layer.map(({ - start, - end, - node: { - frame: { - name, - file, - line, - col - } - } - }) => ({ - name, - timestamp: start / 1000, - duration: (end - start) / 1000, - scriptUrl: file, - locationLine: line, - locationColumn: col - }))); - return flamechart; -} - -function parseStackFrame(stackFrame) { - const error = new Error(); - error.stack = stackFrame; - const frames = error_stack_parser_default.a.parse(error); - return frames.length === 1 ? frames[0] : null; -} - -async function preprocessData(timeline) { - const flamechart = preprocessFlamechart(timeline); - const laneToReactMeasureMap = new Map(); - - for (let lane = 0; lane < REACT_TOTAL_NUM_LANES; lane++) { - laneToReactMeasureMap.set(lane, []); - } - - const profilerData = { - batchUIDToMeasuresMap: new Map(), - componentMeasures: [], - duration: 0, - flamechart, - internalModuleSourceToRanges: new Map(), - laneToLabelMap: new Map(), - laneToReactMeasureMap, - nativeEvents: [], - networkMeasures: [], - otherUserTimingMarks: [], - reactVersion: null, - schedulingEvents: [], - snapshots: [], - snapshotHeight: 0, - startTime: 0, - suspenseEvents: [], - thrownErrors: [] - }; // Sort `timeline`. JSON Array Format trace events need not be ordered. See: - // https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview#heading=h.f2f0yd51wi15 - - timeline = timeline.filter(Boolean).sort((a, b) => a.ts > b.ts ? 1 : -1); // Events displayed in flamechart have timestamps relative to the profile - // event's startTime. Source: https://github.com/v8/v8/blob/44bd8fd7/src/inspector/js_protocol.json#L1486 - // - // We'll thus expect there to be a 'Profile' event; if there is not one, we - // can deduce that there are no flame chart events. As we expect React - // scheduling profiling user timing marks to be recorded together with browser - // flame chart events, we can futher deduce that the data is invalid and we - // don't bother finding React events. - - const indexOfProfileEvent = timeline.findIndex(event => event.name === 'Profile'); - - if (indexOfProfileEvent === -1) { - return profilerData; - } // Use Profile event's `startTime` as the start time to align with flame chart. - // TODO: Remove assumption that there'll only be 1 'Profile' event. If this - // assumption does not hold, the chart may start at the wrong time. - - - profilerData.startTime = timeline[indexOfProfileEvent].args.data.startTime; - profilerData.duration = (timeline[timeline.length - 1].ts - profilerData.startTime) / 1000; - const state = { - asyncProcessingPromises: [], - batchUID: 0, - currentReactComponentMeasure: null, - internalModuleCurrentStackFrame: null, - internalModuleStackStringSet: new Set(), - measureStack: [], - nativeEventStack: [], - nextRenderShouldGenerateNewBatchID: true, - potentialLongEvents: [], - potentialLongNestedUpdate: null, - potentialLongNestedUpdates: [], - potentialSuspenseEventsOutsideOfTransition: [], - requestIdToNetworkMeasureMap: new Map(), - uidCounter: 0, - unresolvedSuspenseEvents: new Map() - }; - timeline.forEach(event => processTimelineEvent(event, profilerData, state)); - - if (profilerVersion === null) { - if (profilerData.schedulingEvents.length === 0 && profilerData.batchUIDToMeasuresMap.size === 0) { - // No profiler version could indicate data was logged using an older build of React, - // before an explicitly profiler version was included in the logging data. - // But it could also indicate that the website was either not using React, or using a production build. - // The easiest way to check for this case is to see if the data contains any scheduled updates or render work. - throw new InvalidProfileError('No React marks were found in the provided profile.' + ' Please provide profiling data from an React application running in development or profiling mode.'); - } - - throw new InvalidProfileError(`This version of profiling data is not supported by the current profiler.`); - } // Validate that all events and measures are complete - - - const { - measureStack - } = state; - - if (measureStack.length > 0) { - console.error('Incomplete events or measures', measureStack); - } // Check for warnings. - - - state.potentialLongEvents.forEach(([nativeEvent, batchUID]) => { - // See how long the subsequent batch of React work was. - // Ignore any work that was already started. - const [startTime, stopTime] = getBatchRange(batchUID, profilerData, nativeEvent.timestamp); - - if (stopTime - startTime > NATIVE_EVENT_DURATION_THRESHOLD) { - nativeEvent.warning = WARNING_STRINGS.LONG_EVENT_HANDLER; - } - }); - state.potentialLongNestedUpdates.forEach(([schedulingEvent, batchUID]) => { - // See how long the subsequent batch of React work was. - const [startTime, stopTime] = getBatchRange(batchUID, profilerData); - - if (stopTime - startTime > NESTED_UPDATE_DURATION_THRESHOLD) { - // Don't warn about transition updates scheduled during the commit phase. - // e.g. useTransition, useDeferredValue - // These are allowed to be long-running. - if (!schedulingEvent.lanes.some(lane => profilerData.laneToLabelMap.get(lane) === 'Transition')) {// FIXME: This warning doesn't account for "nested updates" that are - // spawned by useDeferredValue. Disabling temporarily until we figure - // out the right way to handle this. - // schedulingEvent.warning = WARNING_STRINGS.NESTED_UPDATE; - } - } - }); - state.potentialSuspenseEventsOutsideOfTransition.forEach(([suspenseEvent, lanes]) => { - // HACK This is a bit gross but the numeric lane value might change between render versions. - if (!lanes.some(lane => profilerData.laneToLabelMap.get(lane) === 'Transition')) { - suspenseEvent.warning = WARNING_STRINGS.SUSPEND_DURING_UPDATE; - } - }); // Wait for any async processing to complete before returning. - // Since processing is done in a worker, async work must complete before data is serialized and returned. - - await Promise.all(state.asyncProcessingPromises); // Now that all images have been loaded, let's figure out the display size we're going to use for our thumbnails: - // both the ones rendered to the canvas and the ones shown on hover. - - if (profilerData.snapshots.length > 0) { - // NOTE We assume a static window size here, which is not necessarily true but should be for most cases. - // Regardless, Chrome also sets a single size/ratio and stick with it- so we'll do the same. - const snapshot = profilerData.snapshots[0]; - profilerData.snapshotHeight = Math.min(snapshot.height, SNAPSHOT_MAX_HEIGHT); - } - - return profilerData; -} -// EXTERNAL MODULE: /Users/mengdi/workspace/git/react/node_modules/nullthrows/nullthrows.js -var nullthrows = __webpack_require__(4); -var nullthrows_default = /*#__PURE__*/__webpack_require__.n(nullthrows); - -// CONCATENATED MODULE: ../react-devtools-timeline/src/import-worker/readInputData.js -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - -const readInputData = file => { - if (!file.name.endsWith('.json')) { - throw new InvalidProfileError('Invalid file type. Only JSON performance profiles are supported'); - } - - const fileReader = new FileReader(); - return new Promise((resolve, reject) => { - fileReader.onload = () => { - const result = nullthrows_default()(fileReader.result); - - if (typeof result === 'string') { - resolve(result); - } - - reject(new InvalidProfileError('Input file was not read as a string')); - }; - - fileReader.onerror = () => reject(fileReader.error); - - fileReader.readAsText(file); - }); -}; -// CONCATENATED MODULE: ../react-devtools-timeline/src/import-worker/importFile.js -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - - -async function importFile(file) { - try { - const readFile = await readInputData(file); - const events = JSON.parse(readFile); - - if (events.length === 0) { - throw new InvalidProfileError('No profiling data found in file.'); - } - - const processedData = await preprocessData(events); - return { - status: 'SUCCESS', - processedData - }; - } catch (error) { - if (error instanceof InvalidProfileError) { - return { - status: 'INVALID_PROFILE_ERROR', - error - }; - } else { - return { - status: 'UNEXPECTED_ERROR', - error - }; - } - } -} -// CONCATENATED MODULE: /Users/mengdi/workspace/git/react/node_modules/workerize-loader/dist/rpc-worker-loader.js!/Users/mengdi/workspace/git/react/node_modules/babel-loader/lib??ref--2-1!/Users/mengdi/workspace/git/react/node_modules/babel-loader/lib??ref--3!../react-devtools-timeline/src/import-worker/importFile.worker.js -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -const importFile_worker_importFile = importFile; -addEventListener('message', function (e) {var _e$data = e.data,type = _e$data.type,method = _e$data.method,id = _e$data.id,params = _e$data.params,f,p;if (type === 'RPC' && method) {if (f = __webpack_exports__[method]) {p = Promise.resolve().then(function () {return f.apply(__webpack_exports__, params);});} else {p = Promise.reject('No such method');}p.then(function (result) {postMessage({type: 'RPC',id: id,result: result});}).catch(function (e) {var error = {message: e};if (e.stack) {error.message = e.message;error.stack = e.stack;error.name = e.name;}postMessage({type: 'RPC',id: id,error: error});});}});postMessage({type: 'RPC',method: 'ready'}); - -/***/ }) -/******/ ]); \ No newline at end of file diff --git a/src/react-devtools/build/installHook.js b/src/react-devtools/build/installHook.js deleted file mode 100644 index 241f381..0000000 --- a/src/react-devtools/build/installHook.js +++ /dev/null @@ -1,13347 +0,0 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = "/build/"; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 208); -/******/ }) -/************************************************************************/ -/******/ ({ - -/***/ 0: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -if (true) { - module.exports = __webpack_require__(61); -} else {} - -/***/ }), - -/***/ 1: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return CHROME_WEBSTORE_EXTENSION_ID; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return INTERNAL_EXTENSION_ID; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return LOCAL_EXTENSION_ID; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F", function() { return __DEBUG__; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "G", function() { return __PERFORMANCE_PROFILE__; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "x", function() { return TREE_OPERATION_ADD; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "y", function() { return TREE_OPERATION_REMOVE; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "A", function() { return TREE_OPERATION_REORDER_CHILDREN; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "D", function() { return TREE_OPERATION_UPDATE_TREE_BASE_DURATION; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "C", function() { return TREE_OPERATION_UPDATE_ERRORS_OR_WARNINGS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "z", function() { return TREE_OPERATION_REMOVE_ROOT; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "B", function() { return TREE_OPERATION_SET_SUBTREE_MODE; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return PROFILING_FLAG_BASIC_SUPPORT; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return PROFILING_FLAG_TIMELINE_SUPPORT; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return LOCAL_STORAGE_DEFAULT_TAB_KEY; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return LOCAL_STORAGE_COMPONENT_FILTER_PREFERENCES_KEY; }); -/* unused harmony export SESSION_STORAGE_LAST_SELECTION_KEY */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return LOCAL_STORAGE_OPEN_IN_EDITOR_URL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return LOCAL_STORAGE_PARSE_HOOK_NAMES_KEY; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "u", function() { return SESSION_STORAGE_RECORD_CHANGE_DESCRIPTIONS_KEY; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "v", function() { return SESSION_STORAGE_RELOAD_AND_PROFILE_KEY; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return LOCAL_STORAGE_SHOULD_BREAK_ON_CONSOLE_ERRORS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return LOCAL_STORAGE_BROWSER_THEME; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return LOCAL_STORAGE_SHOULD_APPEND_COMPONENT_STACK_KEY; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return LOCAL_STORAGE_SHOW_INLINE_WARNINGS_AND_ERRORS_KEY; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return LOCAL_STORAGE_TRACE_UPDATES_ENABLED_KEY; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return LOCAL_STORAGE_HIDE_CONSOLE_LOGS_IN_STRICT_MODE; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return PROFILER_EXPORT_VERSION; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CHANGE_LOG_URL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "E", function() { return UNSUPPORTED_VERSION_URL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return REACT_DEVTOOLS_WORKPLACE_URL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "w", function() { return THEME_STYLES; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return COMFORTABLE_LINE_HEIGHT; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return COMPACT_LINE_HEIGHT; }); -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ -const CHROME_WEBSTORE_EXTENSION_ID = 'fmkadmapgofadopljbjfkapdkoienihi'; -const INTERNAL_EXTENSION_ID = 'dnjnjgbfilfphmojnmhliehogmojhclc'; -const LOCAL_EXTENSION_ID = 'ikiahnapldjmdmpkmfhjdjilojjhgcbf'; // Flip this flag to true to enable verbose console debug logging. - -const __DEBUG__ = false; // Flip this flag to true to enable performance.mark() and performance.measure() timings. - -const __PERFORMANCE_PROFILE__ = false; -const TREE_OPERATION_ADD = 1; -const TREE_OPERATION_REMOVE = 2; -const TREE_OPERATION_REORDER_CHILDREN = 3; -const TREE_OPERATION_UPDATE_TREE_BASE_DURATION = 4; -const TREE_OPERATION_UPDATE_ERRORS_OR_WARNINGS = 5; -const TREE_OPERATION_REMOVE_ROOT = 6; -const TREE_OPERATION_SET_SUBTREE_MODE = 7; -const PROFILING_FLAG_BASIC_SUPPORT = 0b01; -const PROFILING_FLAG_TIMELINE_SUPPORT = 0b10; -const LOCAL_STORAGE_DEFAULT_TAB_KEY = 'React::DevTools::defaultTab'; -const LOCAL_STORAGE_COMPONENT_FILTER_PREFERENCES_KEY = 'React::DevTools::componentFilters'; -const SESSION_STORAGE_LAST_SELECTION_KEY = 'React::DevTools::lastSelection'; -const LOCAL_STORAGE_OPEN_IN_EDITOR_URL = 'React::DevTools::openInEditorUrl'; -const LOCAL_STORAGE_PARSE_HOOK_NAMES_KEY = 'React::DevTools::parseHookNames'; -const SESSION_STORAGE_RECORD_CHANGE_DESCRIPTIONS_KEY = 'React::DevTools::recordChangeDescriptions'; -const SESSION_STORAGE_RELOAD_AND_PROFILE_KEY = 'React::DevTools::reloadAndProfile'; -const LOCAL_STORAGE_SHOULD_BREAK_ON_CONSOLE_ERRORS = 'React::DevTools::breakOnConsoleErrors'; -const LOCAL_STORAGE_BROWSER_THEME = 'React::DevTools::theme'; -const LOCAL_STORAGE_SHOULD_APPEND_COMPONENT_STACK_KEY = 'React::DevTools::appendComponentStack'; -const LOCAL_STORAGE_SHOW_INLINE_WARNINGS_AND_ERRORS_KEY = 'React::DevTools::showInlineWarningsAndErrors'; -const LOCAL_STORAGE_TRACE_UPDATES_ENABLED_KEY = 'React::DevTools::traceUpdatesEnabled'; -const LOCAL_STORAGE_HIDE_CONSOLE_LOGS_IN_STRICT_MODE = 'React::DevTools::hideConsoleLogsInStrictMode'; -const PROFILER_EXPORT_VERSION = 5; -const CHANGE_LOG_URL = 'https://github.com/facebook/react/blob/main/packages/react-devtools/CHANGELOG.md'; -const UNSUPPORTED_VERSION_URL = 'https://reactjs.org/blog/2019/08/15/new-react-devtools.html#how-do-i-get-the-old-version-back'; -const REACT_DEVTOOLS_WORKPLACE_URL = 'https://fburl.com/react-devtools-workplace-group'; -const THEME_STYLES = { - light: { - '--color-attribute-name': '#ef6632', - '--color-attribute-name-not-editable': '#23272f', - '--color-attribute-name-inverted': 'rgba(255, 255, 255, 0.7)', - '--color-attribute-value': '#1a1aa6', - '--color-attribute-value-inverted': '#ffffff', - '--color-attribute-editable-value': '#1a1aa6', - '--color-background': '#ffffff', - '--color-background-hover': 'rgba(0, 136, 250, 0.1)', - '--color-background-inactive': '#e5e5e5', - '--color-background-invalid': '#fff0f0', - '--color-background-selected': '#0088fa', - '--color-button-background': '#ffffff', - '--color-button-background-focus': '#ededed', - '--color-button': '#5f6673', - '--color-button-disabled': '#cfd1d5', - '--color-button-active': '#0088fa', - '--color-button-focus': '#23272f', - '--color-button-hover': '#23272f', - '--color-border': '#eeeeee', - '--color-commit-did-not-render-fill': '#cfd1d5', - '--color-commit-did-not-render-fill-text': '#000000', - '--color-commit-did-not-render-pattern': '#cfd1d5', - '--color-commit-did-not-render-pattern-text': '#333333', - '--color-commit-gradient-0': '#37afa9', - '--color-commit-gradient-1': '#63b19e', - '--color-commit-gradient-2': '#80b393', - '--color-commit-gradient-3': '#97b488', - '--color-commit-gradient-4': '#abb67d', - '--color-commit-gradient-5': '#beb771', - '--color-commit-gradient-6': '#cfb965', - '--color-commit-gradient-7': '#dfba57', - '--color-commit-gradient-8': '#efbb49', - '--color-commit-gradient-9': '#febc38', - '--color-commit-gradient-text': '#000000', - '--color-component-name': '#6a51b2', - '--color-component-name-inverted': '#ffffff', - '--color-component-badge-background': 'rgba(0, 0, 0, 0.1)', - '--color-component-badge-background-inverted': 'rgba(255, 255, 255, 0.25)', - '--color-component-badge-count': '#777d88', - '--color-component-badge-count-inverted': 'rgba(255, 255, 255, 0.7)', - '--color-console-error-badge-text': '#ffffff', - '--color-console-error-background': '#fff0f0', - '--color-console-error-border': '#ffd6d6', - '--color-console-error-icon': '#eb3941', - '--color-console-error-text': '#fe2e31', - '--color-console-warning-badge-text': '#000000', - '--color-console-warning-background': '#fffbe5', - '--color-console-warning-border': '#fff5c1', - '--color-console-warning-icon': '#f4bd00', - '--color-console-warning-text': '#64460c', - '--color-context-background': 'rgba(0,0,0,.9)', - '--color-context-background-hover': 'rgba(255, 255, 255, 0.1)', - '--color-context-background-selected': '#178fb9', - '--color-context-border': '#3d424a', - '--color-context-text': '#ffffff', - '--color-context-text-selected': '#ffffff', - '--color-dim': '#777d88', - '--color-dimmer': '#cfd1d5', - '--color-dimmest': '#eff0f1', - '--color-error-background': 'hsl(0, 100%, 97%)', - '--color-error-border': 'hsl(0, 100%, 92%)', - '--color-error-text': '#ff0000', - '--color-expand-collapse-toggle': '#777d88', - '--color-link': '#0000ff', - '--color-modal-background': 'rgba(255, 255, 255, 0.75)', - '--color-bridge-version-npm-background': '#eff0f1', - '--color-bridge-version-npm-text': '#000000', - '--color-bridge-version-number': '#0088fa', - '--color-primitive-hook-badge-background': '#e5e5e5', - '--color-primitive-hook-badge-text': '#5f6673', - '--color-record-active': '#fc3a4b', - '--color-record-hover': '#3578e5', - '--color-record-inactive': '#0088fa', - '--color-resize-bar': '#eeeeee', - '--color-resize-bar-active': '#dcdcdc', - '--color-resize-bar-border': '#d1d1d1', - '--color-resize-bar-dot': '#333333', - '--color-timeline-internal-module': '#d1d1d1', - '--color-timeline-internal-module-hover': '#c9c9c9', - '--color-timeline-internal-module-text': '#444', - '--color-timeline-native-event': '#ccc', - '--color-timeline-native-event-hover': '#aaa', - '--color-timeline-network-primary': '#fcf3dc', - '--color-timeline-network-primary-hover': '#f0e7d1', - '--color-timeline-network-secondary': '#efc457', - '--color-timeline-network-secondary-hover': '#e3ba52', - '--color-timeline-priority-background': '#f6f6f6', - '--color-timeline-priority-border': '#eeeeee', - '--color-timeline-user-timing': '#c9cacd', - '--color-timeline-user-timing-hover': '#93959a', - '--color-timeline-react-idle': '#d3e5f6', - '--color-timeline-react-idle-hover': '#c3d9ef', - '--color-timeline-react-render': '#9fc3f3', - '--color-timeline-react-render-hover': '#83afe9', - '--color-timeline-react-render-text': '#11365e', - '--color-timeline-react-commit': '#c88ff0', - '--color-timeline-react-commit-hover': '#b281d6', - '--color-timeline-react-commit-text': '#3e2c4a', - '--color-timeline-react-layout-effects': '#b281d6', - '--color-timeline-react-layout-effects-hover': '#9d71bd', - '--color-timeline-react-layout-effects-text': '#3e2c4a', - '--color-timeline-react-passive-effects': '#b281d6', - '--color-timeline-react-passive-effects-hover': '#9d71bd', - '--color-timeline-react-passive-effects-text': '#3e2c4a', - '--color-timeline-react-schedule': '#9fc3f3', - '--color-timeline-react-schedule-hover': '#2683E2', - '--color-timeline-react-suspense-rejected': '#f1cc14', - '--color-timeline-react-suspense-rejected-hover': '#ffdf37', - '--color-timeline-react-suspense-resolved': '#a6e59f', - '--color-timeline-react-suspense-resolved-hover': '#89d281', - '--color-timeline-react-suspense-unresolved': '#c9cacd', - '--color-timeline-react-suspense-unresolved-hover': '#93959a', - '--color-timeline-thrown-error': '#ee1638', - '--color-timeline-thrown-error-hover': '#da1030', - '--color-timeline-text-color': '#000000', - '--color-timeline-text-dim-color': '#ccc', - '--color-timeline-react-work-border': '#eeeeee', - '--color-search-match': 'yellow', - '--color-search-match-current': '#f7923b', - '--color-selected-tree-highlight-active': 'rgba(0, 136, 250, 0.1)', - '--color-selected-tree-highlight-inactive': 'rgba(0, 0, 0, 0.05)', - '--color-scroll-caret': 'rgba(150, 150, 150, 0.5)', - '--color-tab-selected-border': '#0088fa', - '--color-text': '#000000', - '--color-text-invalid': '#ff0000', - '--color-text-selected': '#ffffff', - '--color-toggle-background-invalid': '#fc3a4b', - '--color-toggle-background-on': '#0088fa', - '--color-toggle-background-off': '#cfd1d5', - '--color-toggle-text': '#ffffff', - '--color-warning-background': '#fb3655', - '--color-warning-background-hover': '#f82042', - '--color-warning-text-color': '#ffffff', - '--color-warning-text-color-inverted': '#fd4d69', - // The styles below should be kept in sync with 'root.css' - // They are repeated there because they're used by e.g. tooltips or context menus - // which get rendered outside of the DOM subtree (where normal theme/styles are written). - '--color-scroll-thumb': '#c2c2c2', - '--color-scroll-track': '#fafafa', - '--color-tooltip-background': 'rgba(0, 0, 0, 0.9)', - '--color-tooltip-text': '#ffffff' - }, - dark: { - '--color-attribute-name': '#9d87d2', - '--color-attribute-name-not-editable': '#ededed', - '--color-attribute-name-inverted': '#282828', - '--color-attribute-value': '#cedae0', - '--color-attribute-value-inverted': '#ffffff', - '--color-attribute-editable-value': 'yellow', - '--color-background': '#282c34', - '--color-background-hover': 'rgba(255, 255, 255, 0.1)', - '--color-background-inactive': '#3d424a', - '--color-background-invalid': '#5c0000', - '--color-background-selected': '#178fb9', - '--color-button-background': '#282c34', - '--color-button-background-focus': '#3d424a', - '--color-button': '#afb3b9', - '--color-button-active': '#61dafb', - '--color-button-disabled': '#4f5766', - '--color-button-focus': '#a2e9fc', - '--color-button-hover': '#ededed', - '--color-border': '#3d424a', - '--color-commit-did-not-render-fill': '#777d88', - '--color-commit-did-not-render-fill-text': '#000000', - '--color-commit-did-not-render-pattern': '#666c77', - '--color-commit-did-not-render-pattern-text': '#ffffff', - '--color-commit-gradient-0': '#37afa9', - '--color-commit-gradient-1': '#63b19e', - '--color-commit-gradient-2': '#80b393', - '--color-commit-gradient-3': '#97b488', - '--color-commit-gradient-4': '#abb67d', - '--color-commit-gradient-5': '#beb771', - '--color-commit-gradient-6': '#cfb965', - '--color-commit-gradient-7': '#dfba57', - '--color-commit-gradient-8': '#efbb49', - '--color-commit-gradient-9': '#febc38', - '--color-commit-gradient-text': '#000000', - '--color-component-name': '#61dafb', - '--color-component-name-inverted': '#282828', - '--color-component-badge-background': 'rgba(255, 255, 255, 0.25)', - '--color-component-badge-background-inverted': 'rgba(0, 0, 0, 0.25)', - '--color-component-badge-count': '#8f949d', - '--color-component-badge-count-inverted': 'rgba(255, 255, 255, 0.7)', - '--color-console-error-badge-text': '#000000', - '--color-console-error-background': '#290000', - '--color-console-error-border': '#5c0000', - '--color-console-error-icon': '#eb3941', - '--color-console-error-text': '#fc7f7f', - '--color-console-warning-badge-text': '#000000', - '--color-console-warning-background': '#332b00', - '--color-console-warning-border': '#665500', - '--color-console-warning-icon': '#f4bd00', - '--color-console-warning-text': '#f5f2ed', - '--color-context-background': 'rgba(255,255,255,.95)', - '--color-context-background-hover': 'rgba(0, 136, 250, 0.1)', - '--color-context-background-selected': '#0088fa', - '--color-context-border': '#eeeeee', - '--color-context-text': '#000000', - '--color-context-text-selected': '#ffffff', - '--color-dim': '#8f949d', - '--color-dimmer': '#777d88', - '--color-dimmest': '#4f5766', - '--color-error-background': '#200', - '--color-error-border': '#900', - '--color-error-text': '#f55', - '--color-expand-collapse-toggle': '#8f949d', - '--color-link': '#61dafb', - '--color-modal-background': 'rgba(0, 0, 0, 0.75)', - '--color-bridge-version-npm-background': 'rgba(0, 0, 0, 0.25)', - '--color-bridge-version-npm-text': '#ffffff', - '--color-bridge-version-number': 'yellow', - '--color-primitive-hook-badge-background': 'rgba(0, 0, 0, 0.25)', - '--color-primitive-hook-badge-text': 'rgba(255, 255, 255, 0.7)', - '--color-record-active': '#fc3a4b', - '--color-record-hover': '#a2e9fc', - '--color-record-inactive': '#61dafb', - '--color-resize-bar': '#282c34', - '--color-resize-bar-active': '#31363f', - '--color-resize-bar-border': '#3d424a', - '--color-resize-bar-dot': '#cfd1d5', - '--color-timeline-internal-module': '#303542', - '--color-timeline-internal-module-hover': '#363b4a', - '--color-timeline-internal-module-text': '#7f8899', - '--color-timeline-native-event': '#b2b2b2', - '--color-timeline-native-event-hover': '#949494', - '--color-timeline-network-primary': '#fcf3dc', - '--color-timeline-network-primary-hover': '#e3dbc5', - '--color-timeline-network-secondary': '#efc457', - '--color-timeline-network-secondary-hover': '#d6af4d', - '--color-timeline-priority-background': '#1d2129', - '--color-timeline-priority-border': '#282c34', - '--color-timeline-user-timing': '#c9cacd', - '--color-timeline-user-timing-hover': '#93959a', - '--color-timeline-react-idle': '#3d485b', - '--color-timeline-react-idle-hover': '#465269', - '--color-timeline-react-render': '#2683E2', - '--color-timeline-react-render-hover': '#1a76d4', - '--color-timeline-react-render-text': '#11365e', - '--color-timeline-react-commit': '#731fad', - '--color-timeline-react-commit-hover': '#611b94', - '--color-timeline-react-commit-text': '#e5c1ff', - '--color-timeline-react-layout-effects': '#611b94', - '--color-timeline-react-layout-effects-hover': '#51167a', - '--color-timeline-react-layout-effects-text': '#e5c1ff', - '--color-timeline-react-passive-effects': '#611b94', - '--color-timeline-react-passive-effects-hover': '#51167a', - '--color-timeline-react-passive-effects-text': '#e5c1ff', - '--color-timeline-react-schedule': '#2683E2', - '--color-timeline-react-schedule-hover': '#1a76d4', - '--color-timeline-react-suspense-rejected': '#f1cc14', - '--color-timeline-react-suspense-rejected-hover': '#e4c00f', - '--color-timeline-react-suspense-resolved': '#a6e59f', - '--color-timeline-react-suspense-resolved-hover': '#89d281', - '--color-timeline-react-suspense-unresolved': '#c9cacd', - '--color-timeline-react-suspense-unresolved-hover': '#93959a', - '--color-timeline-thrown-error': '#fb3655', - '--color-timeline-thrown-error-hover': '#f82042', - '--color-timeline-text-color': '#282c34', - '--color-timeline-text-dim-color': '#555b66', - '--color-timeline-react-work-border': '#3d424a', - '--color-search-match': 'yellow', - '--color-search-match-current': '#f7923b', - '--color-selected-tree-highlight-active': 'rgba(23, 143, 185, 0.15)', - '--color-selected-tree-highlight-inactive': 'rgba(255, 255, 255, 0.05)', - '--color-scroll-caret': '#4f5766', - '--color-shadow': 'rgba(0, 0, 0, 0.5)', - '--color-tab-selected-border': '#178fb9', - '--color-text': '#ffffff', - '--color-text-invalid': '#ff8080', - '--color-text-selected': '#ffffff', - '--color-toggle-background-invalid': '#fc3a4b', - '--color-toggle-background-on': '#178fb9', - '--color-toggle-background-off': '#777d88', - '--color-toggle-text': '#ffffff', - '--color-warning-background': '#ee1638', - '--color-warning-background-hover': '#da1030', - '--color-warning-text-color': '#ffffff', - '--color-warning-text-color-inverted': '#ee1638', - // The styles below should be kept in sync with 'root.css' - // They are repeated there because they're used by e.g. tooltips or context menus - // which get rendered outside of the DOM subtree (where normal theme/styles are written). - '--color-scroll-thumb': '#afb3b9', - '--color-scroll-track': '#313640', - '--color-tooltip-background': 'rgba(255, 255, 255, 0.95)', - '--color-tooltip-text': '#000000' - }, - compact: { - '--font-size-monospace-small': '9px', - '--font-size-monospace-normal': '11px', - '--font-size-monospace-large': '15px', - '--font-size-sans-small': '10px', - '--font-size-sans-normal': '12px', - '--font-size-sans-large': '14px', - '--line-height-data': '18px' - }, - comfortable: { - '--font-size-monospace-small': '10px', - '--font-size-monospace-normal': '13px', - '--font-size-monospace-large': '17px', - '--font-size-sans-small': '12px', - '--font-size-sans-normal': '14px', - '--font-size-sans-large': '16px', - '--line-height-data': '22px' - } -}; // HACK -// -// Sometimes the inline target is rendered before root styles are applied, -// which would result in e.g. NaN itemSize being passed to react-window list. - -const COMFORTABLE_LINE_HEIGHT = parseInt(THEME_STYLES.comfortable['--line-height-data'], 10); -const COMPACT_LINE_HEIGHT = parseInt(THEME_STYLES.compact['--line-height-data'], 10); - - -/***/ }), - -/***/ 11: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return meta; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return dehydrate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return fillInPath; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return hydrate; }); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3); -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - -const meta = { - inspectable: Symbol('inspectable'), - inspected: Symbol('inspected'), - name: Symbol('name'), - preview_long: Symbol('preview_long'), - preview_short: Symbol('preview_short'), - readonly: Symbol('readonly'), - size: Symbol('size'), - type: Symbol('type'), - unserializable: Symbol('unserializable') -}; -// This threshold determines the depth at which the bridge "dehydrates" nested data. -// Dehydration means that we don't serialize the data for e.g. postMessage or stringify, -// unless the frontend explicitly requests it (e.g. a user clicks to expand a props object). -// -// Reducing this threshold will improve the speed of initial component inspection, -// but may decrease the responsiveness of expanding objects/arrays to inspect further. -const LEVEL_THRESHOLD = 2; -/** - * Generate the dehydrated metadata for complex object instances - */ - -function createDehydrated(type, inspectable, data, cleaned, path) { - cleaned.push(path); - const dehydrated = { - inspectable, - type, - preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, true), - preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, false), - name: !data.constructor || data.constructor.name === 'Object' ? '' : data.constructor.name - }; - - if (type === 'array' || type === 'typed_array') { - dehydrated.size = data.length; - } else if (type === 'object') { - dehydrated.size = Object.keys(data).length; - } - - if (type === 'iterator' || type === 'typed_array') { - dehydrated.readonly = true; - } - - return dehydrated; -} -/** - * Strip out complex data (instances, functions, and data nested > LEVEL_THRESHOLD levels deep). - * The paths of the stripped out objects are appended to the `cleaned` list. - * On the other side of the barrier, the cleaned list is used to "re-hydrate" the cleaned representation into - * an object with symbols as attributes, so that a sanitized object can be distinguished from a normal object. - * - * Input: {"some": {"attr": fn()}, "other": AnInstance} - * Output: { - * "some": { - * "attr": {"name": the fn.name, type: "function"} - * }, - * "other": { - * "name": "AnInstance", - * "type": "object", - * }, - * } - * and cleaned = [["some", "attr"], ["other"]] - */ - - -function dehydrate(data, cleaned, unserializable, path, isPathAllowed, level = 0) { - const type = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* getDataType */ "h"])(data); - let isPathAllowedCheck; - - switch (type) { - case 'html_element': - cleaned.push(path); - return { - inspectable: false, - preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, false), - preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, true), - name: data.tagName, - type - }; - - case 'function': - cleaned.push(path); - return { - inspectable: false, - preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, false), - preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, true), - name: typeof data.name === 'function' || !data.name ? 'function' : data.name, - type - }; - - case 'string': - isPathAllowedCheck = isPathAllowed(path); - - if (isPathAllowedCheck) { - return data; - } else { - return data.length <= 500 ? data : data.slice(0, 500) + '...'; - } - - case 'bigint': - cleaned.push(path); - return { - inspectable: false, - preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, false), - preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, true), - name: data.toString(), - type - }; - - case 'symbol': - cleaned.push(path); - return { - inspectable: false, - preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, false), - preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, true), - name: data.toString(), - type - }; - // React Elements aren't very inspector-friendly, - // and often contain private fields or circular references. - - case 'react_element': - cleaned.push(path); - return { - inspectable: false, - preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, false), - preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, true), - name: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* getDisplayNameForReactElement */ "l"])(data) || 'Unknown', - type - }; - // ArrayBuffers error if you try to inspect them. - - case 'array_buffer': - case 'data_view': - cleaned.push(path); - return { - inspectable: false, - preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, false), - preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, true), - name: type === 'data_view' ? 'DataView' : 'ArrayBuffer', - size: data.byteLength, - type - }; - - case 'array': - isPathAllowedCheck = isPathAllowed(path); - - if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) { - return createDehydrated(type, true, data, cleaned, path); - } - - return data.map((item, i) => dehydrate(item, cleaned, unserializable, path.concat([i]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1)); - - case 'html_all_collection': - case 'typed_array': - case 'iterator': - isPathAllowedCheck = isPathAllowed(path); - - if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) { - return createDehydrated(type, true, data, cleaned, path); - } else { - const unserializableValue = { - unserializable: true, - type: type, - readonly: true, - size: type === 'typed_array' ? data.length : undefined, - preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, false), - preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, true), - name: !data.constructor || data.constructor.name === 'Object' ? '' : data.constructor.name - }; // TRICKY - // Don't use [...spread] syntax for this purpose. - // This project uses @babel/plugin-transform-spread in "loose" mode which only works with Array values. - // Other types (e.g. typed arrays, Sets) will not spread correctly. - - Array.from(data).forEach((item, i) => // $FlowFixMe[prop-missing] Unserializable doesn't have an index signature - unserializableValue[i] = dehydrate(item, cleaned, unserializable, path.concat([i]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1)); - unserializable.push(path); - return unserializableValue; - } - - case 'opaque_iterator': - cleaned.push(path); - return { - inspectable: false, - preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, false), - preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, true), - name: data[Symbol.toStringTag], - type - }; - - case 'date': - cleaned.push(path); - return { - inspectable: false, - preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, false), - preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, true), - name: data.toString(), - type - }; - - case 'regexp': - cleaned.push(path); - return { - inspectable: false, - preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, false), - preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "d"])(data, true), - name: data.toString(), - type - }; - - case 'object': - isPathAllowedCheck = isPathAllowed(path); - - if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) { - return createDehydrated(type, true, data, cleaned, path); - } else { - const object = {}; - Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* getAllEnumerableKeys */ "e"])(data).forEach(key => { - const name = key.toString(); - object[name] = dehydrate(data[key], cleaned, unserializable, path.concat([name]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1); - }); - return object; - } - - case 'infinity': - case 'nan': - case 'undefined': - // Some values are lossy when sent through a WebSocket. - // We dehydrate+rehydrate them to preserve their type. - cleaned.push(path); - return { - type - }; - - default: - return data; - } -} -function fillInPath(object, data, path, value) { - const target = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* getInObject */ "n"])(object, path); - - if (target != null) { - if (!target[meta.unserializable]) { - delete target[meta.inspectable]; - delete target[meta.inspected]; - delete target[meta.name]; - delete target[meta.preview_long]; - delete target[meta.preview_short]; - delete target[meta.readonly]; - delete target[meta.size]; - delete target[meta.type]; - } - } - - if (value !== null && data.unserializable.length > 0) { - const unserializablePath = data.unserializable[0]; - let isMatch = unserializablePath.length === path.length; - - for (let i = 0; i < path.length; i++) { - if (path[i] !== unserializablePath[i]) { - isMatch = false; - break; - } - } - - if (isMatch) { - upgradeUnserializable(value, value); - } - } - - Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* setInObject */ "v"])(object, path, value); -} -function hydrate(object, cleaned, unserializable) { - cleaned.forEach(path => { - const length = path.length; - const last = path[length - 1]; - const parent = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* getInObject */ "n"])(object, path.slice(0, length - 1)); - - if (!parent || !parent.hasOwnProperty(last)) { - return; - } - - const value = parent[last]; - - if (!value) { - return; - } else if (value.type === 'infinity') { - parent[last] = Infinity; - } else if (value.type === 'nan') { - parent[last] = NaN; - } else if (value.type === 'undefined') { - parent[last] = undefined; - } else { - // Replace the string keys with Symbols so they're non-enumerable. - const replaced = {}; - replaced[meta.inspectable] = !!value.inspectable; - replaced[meta.inspected] = false; - replaced[meta.name] = value.name; - replaced[meta.preview_long] = value.preview_long; - replaced[meta.preview_short] = value.preview_short; - replaced[meta.size] = value.size; - replaced[meta.readonly] = !!value.readonly; - replaced[meta.type] = value.type; - parent[last] = replaced; - } - }); - unserializable.forEach(path => { - const length = path.length; - const last = path[length - 1]; - const parent = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* getInObject */ "n"])(object, path.slice(0, length - 1)); - - if (!parent || !parent.hasOwnProperty(last)) { - return; - } - - const node = parent[last]; - const replacement = { ...node - }; - upgradeUnserializable(replacement, node); - parent[last] = replacement; - }); - return object; -} - -function upgradeUnserializable(destination, source) { - Object.defineProperties(destination, { - [meta.inspected]: { - configurable: true, - enumerable: false, - value: !!source.inspected - }, - [meta.name]: { - configurable: true, - enumerable: false, - value: source.name - }, - [meta.preview_long]: { - configurable: true, - enumerable: false, - value: source.preview_long - }, - [meta.preview_short]: { - configurable: true, - enumerable: false, - value: source.preview_short - }, - [meta.size]: { - configurable: true, - enumerable: false, - value: source.size - }, - [meta.readonly]: { - configurable: true, - enumerable: false, - value: !!source.readonly - }, - [meta.type]: { - configurable: true, - enumerable: false, - value: source.type - }, - [meta.unserializable]: { - configurable: true, - enumerable: false, - value: !!source.unserializable - } - }); - delete destination.inspected; - delete destination.name; - delete destination.preview_long; - delete destination.preview_short; - delete destination.size; - delete destination.readonly; - delete destination.type; - delete destination.unserializable; -} - -/***/ }), - -/***/ 12: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -if (true) { - module.exports = __webpack_require__(65); -} else {} - -/***/ }), - -/***/ 13: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return consoleManagedByDevToolsDuringStrictMode; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return enableLogger; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return enableNamedHooksFeature; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return enableProfilerChangedHookIndices; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return enableStyleXFeatures; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return isInternalFacebookBuild; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return enableProfilerComponentTree; }); -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - -/************************************************************************ - * This file is forked between different DevTools implementations. - * It should never be imported directly! - * It should always be imported from "react-devtools-feature-flags". - ************************************************************************/ -const consoleManagedByDevToolsDuringStrictMode = true; -const enableLogger = false; -const enableNamedHooksFeature = true; -const enableProfilerChangedHookIndices = true; -const enableStyleXFeatures = false; -const isInternalFacebookBuild = false; -const enableProfilerComponentTree = true; -/************************************************************************ - * Do not edit the code below. - * It ensures this fork exports the same types as the default flags file. - ************************************************************************/ - -// Flow magic to verify the exports of this file match the original version. -null; - -/***/ }), - -/***/ 15: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cleanForBridge; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return copyToClipboard; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return copyWithDelete; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return copyWithRename; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return copyWithSet; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return getEffectDurations; }); -/* unused harmony export serializeToString */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return formatWithStyles; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return format; }); -/* unused harmony export isSynchronousXHRSupported */ -/* harmony import */ var clipboard_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16); -/* harmony import */ var clipboard_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(clipboard_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _hydration__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11); -/* harmony import */ var shared_isArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23); -/** -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -function cleanForBridge(data, isPathAllowed, path = []) { - if (data !== null) { - const cleanedPaths = []; - const unserializablePaths = []; - const cleanedData = Object(_hydration__WEBPACK_IMPORTED_MODULE_1__[/* dehydrate */ "a"])(data, cleanedPaths, unserializablePaths, path, isPathAllowed); - return { - data: cleanedData, - cleaned: cleanedPaths, - unserializable: unserializablePaths - }; - } else { - return null; - } -} -function copyToClipboard(value) { - const safeToCopy = serializeToString(value); - const text = safeToCopy === undefined ? 'undefined' : safeToCopy; - const { - clipboardCopyText - } = window.__REACT_DEVTOOLS_GLOBAL_HOOK__; // On Firefox navigator.clipboard.writeText has to be called from - // the content script js code (because it requires the clipboardWrite - // permission to be allowed out of a "user handling" callback), - // clipboardCopyText is an helper injected into the page from. - // injectGlobalHook. - - if (typeof clipboardCopyText === 'function') { - clipboardCopyText(text).catch(err => {}); - } else { - Object(clipboard_js__WEBPACK_IMPORTED_MODULE_0__["copy"])(text); - } -} -function copyWithDelete(obj, path, index = 0) { - const key = path[index]; - const updated = Object(shared_isArray__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(obj) ? obj.slice() : { ...obj - }; - - if (index + 1 === path.length) { - if (Object(shared_isArray__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(updated)) { - updated.splice(key, 1); - } else { - delete updated[key]; - } - } else { - // $FlowFixMe number or string is fine here - updated[key] = copyWithDelete(obj[key], path, index + 1); - } - - return updated; -} // This function expects paths to be the same except for the final value. -// e.g. ['path', 'to', 'foo'] and ['path', 'to', 'bar'] - -function copyWithRename(obj, oldPath, newPath, index = 0) { - const oldKey = oldPath[index]; - const updated = Object(shared_isArray__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(obj) ? obj.slice() : { ...obj - }; - - if (index + 1 === oldPath.length) { - const newKey = newPath[index]; // $FlowFixMe number or string is fine here - - updated[newKey] = updated[oldKey]; - - if (Object(shared_isArray__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(updated)) { - updated.splice(oldKey, 1); - } else { - delete updated[oldKey]; - } - } else { - // $FlowFixMe number or string is fine here - updated[oldKey] = copyWithRename(obj[oldKey], oldPath, newPath, index + 1); - } - - return updated; -} -function copyWithSet(obj, path, value, index = 0) { - if (index >= path.length) { - return value; - } - - const key = path[index]; - const updated = Object(shared_isArray__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(obj) ? obj.slice() : { ...obj - }; // $FlowFixMe number or string is fine here - - updated[key] = copyWithSet(obj[key], path, value, index + 1); - return updated; -} -function getEffectDurations(root) { - // Profiling durations are only available for certain builds. - // If available, they'll be stored on the HostRoot. - let effectDuration = null; - let passiveEffectDuration = null; - const hostRoot = root.current; - - if (hostRoot != null) { - const stateNode = hostRoot.stateNode; - - if (stateNode != null) { - effectDuration = stateNode.effectDuration != null ? stateNode.effectDuration : null; - passiveEffectDuration = stateNode.passiveEffectDuration != null ? stateNode.passiveEffectDuration : null; - } - } - - return { - effectDuration, - passiveEffectDuration - }; -} -function serializeToString(data) { - const cache = new Set(); // Use a custom replacer function to protect against circular references. - - return JSON.stringify(data, (key, value) => { - if (typeof value === 'object' && value !== null) { - if (cache.has(value)) { - return; - } - - cache.add(value); - } - - if (typeof value === 'bigint') { - return value.toString() + 'n'; - } - - return value; - }); -} // Formats an array of args with a style for console methods, using -// the following algorithm: -// 1. The first param is a string that contains %c -// - Bail out and return the args without modifying the styles. -// We don't want to affect styles that the developer deliberately set. -// 2. The first param is a string that doesn't contain %c but contains -// string formatting -// - [`%c${args[0]}`, style, ...args.slice(1)] -// - Note: we assume that the string formatting that the developer uses -// is correct. -// 3. The first param is a string that doesn't contain string formatting -// OR is not a string -// - Create a formatting string where: -// boolean, string, symbol -> %s -// number -> %f OR %i depending on if it's an int or float -// default -> %o - -function formatWithStyles(inputArgs, style) { - if (inputArgs === undefined || inputArgs === null || inputArgs.length === 0 || // Matches any of %c but not %%c - typeof inputArgs[0] === 'string' && inputArgs[0].match(/([^%]|^)(%c)/g) || style === undefined) { - return inputArgs; - } // Matches any of %(o|O|d|i|s|f), but not %%(o|O|d|i|s|f) - - - const REGEXP = /([^%]|^)((%%)*)(%([oOdisf]))/g; - - if (typeof inputArgs[0] === 'string' && inputArgs[0].match(REGEXP)) { - return [`%c${inputArgs[0]}`, style, ...inputArgs.slice(1)]; - } else { - const firstArg = inputArgs.reduce((formatStr, elem, i) => { - if (i > 0) { - formatStr += ' '; - } - - switch (typeof elem) { - case 'string': - case 'boolean': - case 'symbol': - return formatStr += '%s'; - - case 'number': - const formatting = Number.isInteger(elem) ? '%i' : '%f'; - return formatStr += formatting; - - default: - return formatStr += '%o'; - } - }, '%c'); - return [firstArg, style, ...inputArgs]; - } -} // based on https://github.com/tmpfs/format-util/blob/0e62d430efb0a1c51448709abd3e2406c14d8401/format.js#L1 -// based on https://developer.mozilla.org/en-US/docs/Web/API/console#Using_string_substitutions -// Implements s, d, i and f placeholders -// NOTE: KEEP IN SYNC with src/hook.js - -function format(maybeMessage, ...inputArgs) { - const args = inputArgs.slice(); - let formatted = String(maybeMessage); // If the first argument is a string, check for substitutions. - - if (typeof maybeMessage === 'string') { - if (args.length) { - const REGEXP = /(%?)(%([jds]))/g; - formatted = formatted.replace(REGEXP, (match, escaped, ptn, flag) => { - let arg = args.shift(); - - switch (flag) { - case 's': - arg += ''; - break; - - case 'd': - case 'i': - arg = parseInt(arg, 10).toString(); - break; - - case 'f': - arg = parseFloat(arg).toString(); - break; - } - - if (!escaped) { - return arg; - } - - args.unshift(arg); - return match; - }); - } - } // Arguments that remain after formatting. - - - if (args.length) { - for (let i = 0; i < args.length; i++) { - formatted += ' ' + String(args[i]); - } - } // Update escaped %% values. - - - formatted = formatted.replace(/%{2,2}/g, '%'); - return String(formatted); -} -function isSynchronousXHRSupported() { - return !!(window.document && window.document.featurePolicy && window.document.featurePolicy.allowsFeature('sync-xhr')); -} - -/***/ }), - -/***/ 16: -/***/ (function(module, exports, __webpack_require__) { - -// Import support https://stackoverflow.com/questions/13673346/supporting-both-commonjs-and-amd -(function (name, definition) { - if (true) { - module.exports = definition(); - } else {} -})("clipboard", function () { - if (typeof document === 'undefined' || !document.addEventListener) { - return null; - } - - var clipboard = {}; - - clipboard.copy = function () { - var _intercept = false; - var _data = null; // Map from data type (e.g. "text/html") to value. - - var _bogusSelection = false; - - function cleanup() { - _intercept = false; - _data = null; - - if (_bogusSelection) { - window.getSelection().removeAllRanges(); - } - - _bogusSelection = false; - } - - document.addEventListener("copy", function (e) { - if (_intercept) { - for (var key in _data) { - e.clipboardData.setData(key, _data[key]); - } - - e.preventDefault(); - } - }); // Workaround for Safari: https://bugs.webkit.org/show_bug.cgi?id=156529 - - function bogusSelect() { - var sel = document.getSelection(); // If "nothing" is selected... - - if (!document.queryCommandEnabled("copy") && sel.isCollapsed) { - // ... temporarily select the entire body. - // - // We select the entire body because: - // - it's guaranteed to exist, - // - it works (unlike, say, document.head, or phantom element that is - // not inserted into the DOM), - // - it doesn't seem to flicker (due to the synchronous copy event), and - // - it avoids modifying the DOM (can trigger mutation observers). - // - // Because we can't do proper feature detection (we already checked - // document.queryCommandEnabled("copy") , which actually gives a false - // negative for Blink when nothing is selected) and UA sniffing is not - // reliable (a lot of UA strings contain "Safari"), this will also - // happen for some browsers other than Safari. :-() - var range = document.createRange(); - range.selectNodeContents(document.body); - sel.removeAllRanges(); - sel.addRange(range); - _bogusSelection = true; - } - } - - ; - return function (data) { - return new Promise(function (resolve, reject) { - _intercept = true; - - if (typeof data === "string") { - _data = { - "text/plain": data - }; - } else if (data instanceof Node) { - _data = { - "text/html": new XMLSerializer().serializeToString(data) - }; - } else if (data instanceof Object) { - _data = data; - } else { - reject("Invalid data type. Must be string, DOM node, or an object mapping MIME types to strings."); - } - - function triggerCopy(tryBogusSelect) { - try { - if (document.execCommand("copy")) { - // document.execCommand is synchronous: http://www.w3.org/TR/2015/WD-clipboard-apis-20150421/#integration-with-rich-text-editing-apis - // So we can call resolve() back here. - cleanup(); - resolve(); - } else { - if (!tryBogusSelect) { - bogusSelect(); - triggerCopy(true); - } else { - cleanup(); - throw new Error("Unable to copy. Perhaps it's not available in your browser?"); - } - } - } catch (e) { - cleanup(); - reject(e); - } - } - - triggerCopy(false); - }); - }; - }(); - - clipboard.paste = function () { - var _intercept = false; - - var _resolve; - - var _dataType; - - document.addEventListener("paste", function (e) { - if (_intercept) { - _intercept = false; - e.preventDefault(); - var resolve = _resolve; - _resolve = null; - resolve(e.clipboardData.getData(_dataType)); - } - }); - return function (dataType) { - return new Promise(function (resolve, reject) { - _intercept = true; - _resolve = resolve; - _dataType = dataType || "text/plain"; - - try { - if (!document.execCommand("paste")) { - _intercept = false; - reject(new Error("Unable to paste. Pasting only works in Internet Explorer at the moment.")); - } - } catch (e) { - _intercept = false; - reject(new Error(e)); - } - }); - }; - }(); // Handle IE behaviour. - - - if (typeof ClipboardEvent === "undefined" && typeof window.clipboardData !== "undefined" && typeof window.clipboardData.setData !== "undefined") { - /*! promise-polyfill 2.0.1 */ - (function (a) { - function b(a, b) { - return function () { - a.apply(b, arguments); - }; - } - - function c(a) { - if ("object" != typeof this) throw new TypeError("Promises must be constructed via new"); - if ("function" != typeof a) throw new TypeError("not a function"); - this._state = null, this._value = null, this._deferreds = [], i(a, b(e, this), b(f, this)); - } - - function d(a) { - var b = this; - return null === this._state ? void this._deferreds.push(a) : void j(function () { - var c = b._state ? a.onFulfilled : a.onRejected; - if (null === c) return void (b._state ? a.resolve : a.reject)(b._value); - var d; - - try { - d = c(b._value); - } catch (e) { - return void a.reject(e); - } - - a.resolve(d); - }); - } - - function e(a) { - try { - if (a === this) throw new TypeError("A promise cannot be resolved with itself."); - - if (a && ("object" == typeof a || "function" == typeof a)) { - var c = a.then; - if ("function" == typeof c) return void i(b(c, a), b(e, this), b(f, this)); - } - - this._state = !0, this._value = a, g.call(this); - } catch (d) { - f.call(this, d); - } - } - - function f(a) { - this._state = !1, this._value = a, g.call(this); - } - - function g() { - for (var a = 0, b = this._deferreds.length; b > a; a++) d.call(this, this._deferreds[a]); - - this._deferreds = null; - } - - function h(a, b, c, d) { - this.onFulfilled = "function" == typeof a ? a : null, this.onRejected = "function" == typeof b ? b : null, this.resolve = c, this.reject = d; - } - - function i(a, b, c) { - var d = !1; - - try { - a(function (a) { - d || (d = !0, b(a)); - }, function (a) { - d || (d = !0, c(a)); - }); - } catch (e) { - if (d) return; - d = !0, c(e); - } - } - - var j = c.immediateFn || "function" == typeof setImmediate && setImmediate || function (a) { - setTimeout(a, 1); - }, - k = Array.isArray || function (a) { - return "[object Array]" === Object.prototype.toString.call(a); - }; - - c.prototype["catch"] = function (a) { - return this.then(null, a); - }, c.prototype.then = function (a, b) { - var e = this; - return new c(function (c, f) { - d.call(e, new h(a, b, c, f)); - }); - }, c.all = function () { - var a = Array.prototype.slice.call(1 === arguments.length && k(arguments[0]) ? arguments[0] : arguments); - return new c(function (b, c) { - function d(f, g) { - try { - if (g && ("object" == typeof g || "function" == typeof g)) { - var h = g.then; - if ("function" == typeof h) return void h.call(g, function (a) { - d(f, a); - }, c); - } - - a[f] = g, 0 === --e && b(a); - } catch (i) { - c(i); - } - } - - if (0 === a.length) return b([]); - - for (var e = a.length, f = 0; f < a.length; f++) d(f, a[f]); - }); - }, c.resolve = function (a) { - return a && "object" == typeof a && a.constructor === c ? a : new c(function (b) { - b(a); - }); - }, c.reject = function (a) { - return new c(function (b, c) { - c(a); - }); - }, c.race = function (a) { - return new c(function (b, c) { - for (var d = 0, e = a.length; e > d; d++) a[d].then(b, c); - }); - }, true && module.exports ? module.exports = c : a.Promise || (a.Promise = c); - })(this); - - clipboard.copy = function (data) { - return new Promise(function (resolve, reject) { - // IE supports string and URL types: https://msdn.microsoft.com/en-us/library/ms536744(v=vs.85).aspx - // We only support the string type for now. - if (typeof data !== "string" && !("text/plain" in data)) { - throw new Error("You must provide a text/plain type."); - } - - var strData = typeof data === "string" ? data : data["text/plain"]; - var copySucceeded = window.clipboardData.setData("Text", strData); - - if (copySucceeded) { - resolve(); - } else { - reject(new Error("Copying was rejected.")); - } - }); - }; - - clipboard.paste = function () { - return new Promise(function (resolve, reject) { - var strData = window.clipboardData.getData("Text"); - - if (strData) { - resolve(strData); - } else { - // The user rejected the paste request. - reject(new Error("Pasting was rejected.")); - } - }); - }; - } - - return clipboard; -}); - -/***/ }), - -/***/ 17: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ -const isArray = Array.isArray; -/* harmony default export */ __webpack_exports__["a"] = (isArray); - -/***/ }), - -/***/ 2: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return ElementTypeClass; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return ElementTypeContext; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return ElementTypeFunction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return ElementTypeForwardRef; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return ElementTypeHostComponent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return ElementTypeMemo; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return ElementTypeOtherOrUnknown; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return ElementTypeProfiler; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return ElementTypeRoot; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return ElementTypeSuspense; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return ElementTypeSuspenseList; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return ElementTypeTracingMarker; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return ComponentFilterElementType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ComponentFilterDisplayName; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return ComponentFilterLocation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return ComponentFilterHOC; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return StrictMode; }); -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ -// WARNING -// The values below are referenced by ComponentFilters (which are saved via localStorage). -// Do not change them or it will break previously saved user customizations. -// If new element types are added, use new numbers rather than re-ordering existing ones. -// -// Changing these types is also a backwards breaking change for the standalone shell, -// since the frontend and backend must share the same values- -// and the backend is embedded in certain environments (like React Native). -const ElementTypeClass = 1; -const ElementTypeContext = 2; -const ElementTypeFunction = 5; -const ElementTypeForwardRef = 6; -const ElementTypeHostComponent = 7; -const ElementTypeMemo = 8; -const ElementTypeOtherOrUnknown = 9; -const ElementTypeProfiler = 10; -const ElementTypeRoot = 11; -const ElementTypeSuspense = 12; -const ElementTypeSuspenseList = 13; -const ElementTypeTracingMarker = 14; // Different types of elements displayed in the Elements tree. -// These types may be used to visually distinguish types, -// or to enable/disable certain functionality. - -// WARNING -// The values below are referenced by ComponentFilters (which are saved via localStorage). -// Do not change them or it will break previously saved user customizations. -// If new filter types are added, use new numbers rather than re-ordering existing ones. -const ComponentFilterElementType = 1; -const ComponentFilterDisplayName = 2; -const ComponentFilterLocation = 3; -const ComponentFilterHOC = 4; -const StrictMode = 1; - -/***/ }), - -/***/ 208: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -// ESM COMPAT FLAG -__webpack_require__.r(__webpack_exports__); - -// EXTERNAL MODULE: ../react-devtools-shared/src/backend/console.js -var backend_console = __webpack_require__(38); - -// CONCATENATED MODULE: ../react-devtools-shared/src/hook.js -/** - * Install the hook on window, which is an event emitter. - * Note because Chrome content scripts cannot directly modify the window object, - * we are evaling this function by inserting a script tag. - * That's why we have to inline the whole event emitter implementation, - * the string format implementation, and part of the console implementation here. - * - * - */ - -function installHook(target) { - if (target.hasOwnProperty('__REACT_DEVTOOLS_GLOBAL_HOOK__')) { - return null; - } - - let targetConsole = console; - let targetConsoleMethods = {}; - - for (const method in console) { - targetConsoleMethods[method] = console[method]; - } - - function dangerous_setTargetConsoleForTesting(targetConsoleForTesting) { - targetConsole = targetConsoleForTesting; - targetConsoleMethods = {}; - - for (const method in targetConsole) { - targetConsoleMethods[method] = console[method]; - } - } - - function detectReactBuildType(renderer) { - try { - if (typeof renderer.version === 'string') { - // React DOM Fiber (16+) - if (renderer.bundleType > 0) { - // This is not a production build. - // We are currently only using 0 (PROD) and 1 (DEV) - // but might add 2 (PROFILE) in the future. - return 'development'; - } // React 16 uses flat bundles. If we report the bundle as production - // version, it means we also minified and envified it ourselves. - - - return 'production'; // Note: There is still a risk that the CommonJS entry point has not - // been envified or uglified. In this case the user would have *both* - // development and production bundle, but only the prod one would run. - // This would be really bad. We have a separate check for this because - // it happens *outside* of the renderer injection. See `checkDCE` below. - } // $FlowFixMe[method-unbinding] - - - const toString = Function.prototype.toString; - - if (renderer.Mount && renderer.Mount._renderNewRootComponent) { - // React DOM Stack - const renderRootCode = toString.call(renderer.Mount._renderNewRootComponent); // Filter out bad results (if that is even possible): - - if (renderRootCode.indexOf('function') !== 0) { - // Hope for the best if we're not sure. - return 'production'; - } // Check for React DOM Stack < 15.1.0 in development. - // If it contains "storedMeasure" call, it's wrapped in ReactPerf (DEV only). - // This would be true even if it's minified, as method name still matches. - - - if (renderRootCode.indexOf('storedMeasure') !== -1) { - return 'development'; - } // For other versions (and configurations) it's not so easy. - // Let's quickly exclude proper production builds. - // If it contains a warning message, it's either a DEV build, - // or an PROD build without proper dead code elimination. - - - if (renderRootCode.indexOf('should be a pure function') !== -1) { - // Now how do we tell a DEV build from a bad PROD build? - // If we see NODE_ENV, we're going to assume this is a dev build - // because most likely it is referring to an empty shim. - if (renderRootCode.indexOf('NODE_ENV') !== -1) { - return 'development'; - } // If we see "development", we're dealing with an envified DEV build - // (such as the official React DEV UMD). - - - if (renderRootCode.indexOf('development') !== -1) { - return 'development'; - } // I've seen process.env.NODE_ENV !== 'production' being smartly - // replaced by `true` in DEV by Webpack. I don't know how that - // works but we can safely guard against it because `true` was - // never used in the function source since it was written. - - - if (renderRootCode.indexOf('true') !== -1) { - return 'development'; - } // By now either it is a production build that has not been minified, - // or (worse) this is a minified development build using non-standard - // environment (e.g. "staging"). We're going to look at whether - // the function argument name is mangled: - - - if ( // 0.13 to 15 - renderRootCode.indexOf('nextElement') !== -1 || // 0.12 - renderRootCode.indexOf('nextComponent') !== -1) { - // We can't be certain whether this is a development build or not, - // but it is definitely unminified. - return 'unminified'; - } else { - // This is likely a minified development build. - return 'development'; - } - } // By now we know that it's envified and dead code elimination worked, - // but what if it's still not minified? (Is this even possible?) - // Let's check matches for the first argument name. - - - if ( // 0.13 to 15 - renderRootCode.indexOf('nextElement') !== -1 || // 0.12 - renderRootCode.indexOf('nextComponent') !== -1) { - return 'unminified'; - } // Seems like we're using the production version. - // However, the branch above is Stack-only so this is 15 or earlier. - - - return 'outdated'; - } - } catch (err) {// Weird environments may exist. - // This code needs a higher fault tolerance - // because it runs even with closed DevTools. - // TODO: should we catch errors in all injected code, and not just this part? - } - - return 'production'; - } - - function checkDCE(fn) { - // This runs for production versions of React. - // Needs to be super safe. - try { - // $FlowFixMe[method-unbinding] - const toString = Function.prototype.toString; - const code = toString.call(fn); // This is a string embedded in the passed function under DEV-only - // condition. However the function executes only in PROD. Therefore, - // if we see it, dead code elimination did not work. - - if (code.indexOf('^_^') > -1) { - // Remember to report during next injection. - hasDetectedBadDCE = true; // Bonus: throw an exception hoping that it gets picked up by a reporting system. - // Not synchronously so that it doesn't break the calling code. - - setTimeout(function () { - 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'); - }); - } - } catch (err) {} - } // NOTE: KEEP IN SYNC with src/backend/utils.js - - - function formatWithStyles(inputArgs, style) { - if (inputArgs === undefined || inputArgs === null || inputArgs.length === 0 || // Matches any of %c but not %%c - typeof inputArgs[0] === 'string' && inputArgs[0].match(/([^%]|^)(%c)/g) || style === undefined) { - return inputArgs; - } // Matches any of %(o|O|d|i|s|f), but not %%(o|O|d|i|s|f) - - - const REGEXP = /([^%]|^)((%%)*)(%([oOdisf]))/g; - - if (typeof inputArgs[0] === 'string' && inputArgs[0].match(REGEXP)) { - return [`%c${inputArgs[0]}`, style, ...inputArgs.slice(1)]; - } else { - const firstArg = inputArgs.reduce((formatStr, elem, i) => { - if (i > 0) { - formatStr += ' '; - } - - switch (typeof elem) { - case 'string': - case 'boolean': - case 'symbol': - return formatStr += '%s'; - - case 'number': - const formatting = Number.isInteger(elem) ? '%i' : '%f'; - return formatStr += formatting; - - default: - return formatStr += '%o'; - } - }, '%c'); - return [firstArg, style, ...inputArgs]; - } - } - - let unpatchFn = null; // NOTE: KEEP IN SYNC with src/backend/console.js:patchForStrictMode - // This function hides or dims console logs during the initial double renderer - // in Strict Mode. We need this function because during initial render, - // React and DevTools are connecting and the renderer interface isn't avaiable - // and we want to be able to have consistent logging behavior for double logs - // during the initial renderer. - - function patchConsoleForInitialRenderInStrictMode({ - hideConsoleLogsInStrictMode, - browserTheme - }) { - const overrideConsoleMethods = ['error', 'group', 'groupCollapsed', 'info', 'log', 'trace', 'warn']; - - if (unpatchFn !== null) { - // Don't patch twice. - return; - } - - const originalConsoleMethods = {}; - - unpatchFn = () => { - for (const method in originalConsoleMethods) { - try { - targetConsole[method] = originalConsoleMethods[method]; - } catch (error) {} - } - }; - - overrideConsoleMethods.forEach(method => { - try { - const originalMethod = originalConsoleMethods[method] = targetConsole[method].__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__ ? targetConsole[method].__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__ : targetConsole[method]; - - const overrideMethod = (...args) => { - if (!hideConsoleLogsInStrictMode) { - // Dim the text color of the double logs if we're not - // hiding them. - let color; - - switch (method) { - case 'warn': - color = browserTheme === 'light' ? "rgba(250, 180, 50, 0.75)" : "rgba(250, 180, 50, 0.5)"; - break; - - case 'error': - color = browserTheme === 'light' ? "rgba(250, 123, 130, 0.75)" : "rgba(250, 123, 130, 0.5)"; - break; - - case 'log': - default: - color = browserTheme === 'light' ? "rgba(125, 125, 125, 0.75)" : "rgba(125, 125, 125, 0.5)"; - break; - } - - if (color) { - originalMethod(...formatWithStyles(args, `color: ${color}`)); - } else { - throw Error('Console color is not defined'); - } - } - }; - - overrideMethod.__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__ = originalMethod; - originalMethod.__REACT_DEVTOOLS_STRICT_MODE_OVERRIDE_METHOD__ = overrideMethod; - targetConsole[method] = overrideMethod; - } catch (error) {} - }); - } // NOTE: KEEP IN SYNC with src/backend/console.js:unpatchForStrictMode - - - function unpatchConsoleForInitialRenderInStrictMode() { - if (unpatchFn !== null) { - unpatchFn(); - unpatchFn = null; - } - } - - let uidCounter = 0; - - function inject(renderer) { - const id = ++uidCounter; - renderers.set(id, renderer); - const reactBuildType = hasDetectedBadDCE ? 'deadcode' : detectReactBuildType(renderer); // Patching the console enables DevTools to do a few useful things: - // * Append component stacks to warnings and error messages - // * Disabling or marking logs during a double render in Strict Mode - // * Disable logging during re-renders to inspect hooks (see inspectHooksOfFiber) - // - // For React Native, we intentionally patch early (during injection). - // This provides React Native developers with components stacks even if they don't run DevTools. - // - // This won't work for DOM though, since this entire file is eval'ed and inserted as a script tag. - // In that case, we'll only patch parts of the console that are needed during the first render - // and patch everything else later (when the frontend attaches). - // - // Don't patch in test environments because we don't want to interfere with Jest's own console overrides. - // - // Note that because this function is inlined, this conditional check must only use static booleans. - // Otherwise the extension will throw with an undefined error. - // (See comments in the try/catch below for more context on inlining.) - - if (false) {} // If we have just reloaded to profile, we need to inject the renderer interface before the app loads. - // Otherwise the renderer won't yet exist and we can skip this step. - - - const attach = target.__REACT_DEVTOOLS_ATTACH__; - - if (typeof attach === 'function') { - const rendererInterface = attach(hook, id, renderer, target); - hook.rendererInterfaces.set(id, rendererInterface); - } - - hook.emit('renderer', { - id, - renderer, - reactBuildType - }); - return id; - } - - let hasDetectedBadDCE = false; - - function sub(event, fn) { - hook.on(event, fn); - return () => hook.off(event, fn); - } - - function on(event, fn) { - if (!listeners[event]) { - listeners[event] = []; - } - - listeners[event].push(fn); - } - - function off(event, fn) { - if (!listeners[event]) { - return; - } - - const index = listeners[event].indexOf(fn); - - if (index !== -1) { - listeners[event].splice(index, 1); - } - - if (!listeners[event].length) { - delete listeners[event]; - } - } - - function emit(event, data) { - if (listeners[event]) { - listeners[event].map(fn => fn(data)); - } - } - - function getFiberRoots(rendererID) { - const roots = fiberRoots; - - if (!roots[rendererID]) { - roots[rendererID] = new Set(); - } - - return roots[rendererID]; - } - - function onCommitFiberUnmount(rendererID, fiber) { - const rendererInterface = rendererInterfaces.get(rendererID); - - if (rendererInterface != null) { - rendererInterface.handleCommitFiberUnmount(fiber); - } - } - - function onCommitFiberRoot(rendererID, root, priorityLevel) { - const mountedRoots = hook.getFiberRoots(rendererID); - const current = root.current; - const isKnownRoot = mountedRoots.has(root); - const isUnmounting = current.memoizedState == null || current.memoizedState.element == null; // Keep track of mounted roots so we can hydrate when DevTools connect. - - if (!isKnownRoot && !isUnmounting) { - mountedRoots.add(root); - } else if (isKnownRoot && isUnmounting) { - mountedRoots.delete(root); - } - - const rendererInterface = rendererInterfaces.get(rendererID); - - if (rendererInterface != null) { - rendererInterface.handleCommitFiberRoot(root, priorityLevel); - } - } - - function onPostCommitFiberRoot(rendererID, root) { - const rendererInterface = rendererInterfaces.get(rendererID); - - if (rendererInterface != null) { - rendererInterface.handlePostCommitFiberRoot(root); - } - } - - function setStrictMode(rendererID, isStrictMode) { - const rendererInterface = rendererInterfaces.get(rendererID); - - if (rendererInterface != null) { - if (isStrictMode) { - rendererInterface.patchConsoleForStrictMode(); - } else { - rendererInterface.unpatchConsoleForStrictMode(); - } - } else { - // This should only happen during initial render in the extension before DevTools - // finishes its handshake with the injected renderer - if (isStrictMode) { - const hideConsoleLogsInStrictMode = window.__REACT_DEVTOOLS_HIDE_CONSOLE_LOGS_IN_STRICT_MODE__ === true; - const browserTheme = window.__REACT_DEVTOOLS_BROWSER_THEME__; - patchConsoleForInitialRenderInStrictMode({ - hideConsoleLogsInStrictMode, - browserTheme - }); - } else { - unpatchConsoleForInitialRenderInStrictMode(); - } - } - } - - const openModuleRangesStack = []; - const moduleRanges = []; - - function getTopStackFrameString(error) { - const frames = error.stack.split('\n'); - const frame = frames.length > 1 ? frames[1] : null; - return frame; - } - - function getInternalModuleRanges() { - return moduleRanges; - } - - function registerInternalModuleStart(error) { - const startStackFrame = getTopStackFrameString(error); - - if (startStackFrame !== null) { - openModuleRangesStack.push(startStackFrame); - } - } - - function registerInternalModuleStop(error) { - if (openModuleRangesStack.length > 0) { - const startStackFrame = openModuleRangesStack.pop(); - const stopStackFrame = getTopStackFrameString(error); - - if (stopStackFrame !== null) { - moduleRanges.push([startStackFrame, stopStackFrame]); - } - } - } // TODO: More meaningful names for "rendererInterfaces" and "renderers". - - - const fiberRoots = {}; - const rendererInterfaces = new Map(); - const listeners = {}; - const renderers = new Map(); - const hook = { - rendererInterfaces, - listeners, - // Fast Refresh for web relies on this. - renderers, - emit, - getFiberRoots, - inject, - on, - off, - sub, - // This is a legacy flag. - // React v16 checks the hook for this to ensure DevTools is new enough. - supportsFiber: true, - // React calls these methods. - checkDCE, - onCommitFiberUnmount, - onCommitFiberRoot, - onPostCommitFiberRoot, - setStrictMode, - // Schedule Profiler runtime helpers. - // These internal React modules to report their own boundaries - // which in turn enables the profiler to dim or filter internal frames. - getInternalModuleRanges, - registerInternalModuleStart, - registerInternalModuleStop - }; - - if (false) {} - - Object.defineProperty(target, '__REACT_DEVTOOLS_GLOBAL_HOOK__', { - // This property needs to be configurable for the test environment, - // else we won't be able to delete and recreate it between tests. - configurable: false, - enumerable: false, - - get() { - return hook; - } - - }); - return hook; -} -// CONCATENATED MODULE: ./src/contentScripts/installHook.js - // avoid double execution - -if (!window.hasOwnProperty('__REACT_DEVTOOLS_GLOBAL_HOOK__')) { - installHook(window); // detect react - - window.__REACT_DEVTOOLS_GLOBAL_HOOK__.on('renderer', function ({ - reactBuildType - }) { - window.postMessage({ - source: 'react-devtools-detector', - reactBuildType - }, '*'); - }); // save native values - - - window.__REACT_DEVTOOLS_GLOBAL_HOOK__.nativeObjectCreate = Object.create; - window.__REACT_DEVTOOLS_GLOBAL_HOOK__.nativeMap = Map; - window.__REACT_DEVTOOLS_GLOBAL_HOOK__.nativeWeakMap = WeakMap; - window.__REACT_DEVTOOLS_GLOBAL_HOOK__.nativeSet = Set; -} - -/***/ }), - -/***/ 23: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ -const isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare - -function isArray(a) { - return isArrayImpl(a); -} - -/* harmony default export */ __webpack_exports__["a"] = (isArray); - -/***/ }), - -/***/ 26: -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(process) {exports = module.exports = SemVer; -var debug; -/* istanbul ignore next */ - -if (typeof process === 'object' && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { - debug = function () { - var args = Array.prototype.slice.call(arguments, 0); - args.unshift('SEMVER'); - console.log.apply(console, args); - }; -} else { - debug = function () {}; -} // Note: this is the semver.org version of the spec that it implements -// Not necessarily the package version of this code. - - -exports.SEMVER_SPEC_VERSION = '2.0.0'; -var MAX_LENGTH = 256; -var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || -/* istanbul ignore next */ -9007199254740991; // Max safe segment length for coercion. - -var MAX_SAFE_COMPONENT_LENGTH = 16; // The actual regexps go on exports.re - -var re = exports.re = []; -var src = exports.src = []; -var t = exports.tokens = {}; -var R = 0; - -function tok(n) { - t[n] = R++; -} // The following Regular Expressions can be used for tokenizing, -// validating, and parsing SemVer version strings. -// ## Numeric Identifier -// A single `0`, or a non-zero digit followed by zero or more digits. - - -tok('NUMERICIDENTIFIER'); -src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'; -tok('NUMERICIDENTIFIERLOOSE'); -src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'; // ## Non-numeric Identifier -// Zero or more digits, followed by a letter or hyphen, and then zero or -// more letters, digits, or hyphens. - -tok('NONNUMERICIDENTIFIER'); -src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'; // ## Main Version -// Three dot-separated numeric identifiers. - -tok('MAINVERSION'); -src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + '(' + src[t.NUMERICIDENTIFIER] + ')'; -tok('MAINVERSIONLOOSE'); -src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'; // ## Pre-release Version Identifier -// A numeric identifier, or a non-numeric identifier. - -tok('PRERELEASEIDENTIFIER'); -src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] + '|' + src[t.NONNUMERICIDENTIFIER] + ')'; -tok('PRERELEASEIDENTIFIERLOOSE'); -src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] + '|' + src[t.NONNUMERICIDENTIFIER] + ')'; // ## Pre-release Version -// Hyphen, followed by one or more dot-separated pre-release version -// identifiers. - -tok('PRERELEASE'); -src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] + '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'; -tok('PRERELEASELOOSE'); -src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] + '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'; // ## Build Metadata Identifier -// Any combination of digits, letters, or hyphens. - -tok('BUILDIDENTIFIER'); -src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'; // ## Build Metadata -// Plus sign, followed by one or more period-separated build metadata -// identifiers. - -tok('BUILD'); -src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] + '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'; // ## Full Version String -// A main version, followed optionally by a pre-release version and -// build metadata. -// Note that the only major, minor, patch, and pre-release sections of -// the version string are capturing groups. The build metadata is not a -// capturing group, because it should not ever be used in version -// comparison. - -tok('FULL'); -tok('FULLPLAIN'); -src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] + src[t.PRERELEASE] + '?' + src[t.BUILD] + '?'; -src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'; // like full, but allows v1.2.3 and =1.2.3, which people do sometimes. -// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty -// common in the npm registry. - -tok('LOOSEPLAIN'); -src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] + src[t.PRERELEASELOOSE] + '?' + src[t.BUILD] + '?'; -tok('LOOSE'); -src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'; -tok('GTLT'); -src[t.GTLT] = '((?:<|>)?=?)'; // Something like "2.*" or "1.2.x". -// Note that "x.x" is a valid xRange identifer, meaning "any version" -// Only the first item is strictly required. - -tok('XRANGEIDENTIFIERLOOSE'); -src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'; -tok('XRANGEIDENTIFIER'); -src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'; -tok('XRANGEPLAIN'); -src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' + '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + '(?:' + src[t.PRERELEASE] + ')?' + src[t.BUILD] + '?' + ')?)?'; -tok('XRANGEPLAINLOOSE'); -src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + '(?:' + src[t.PRERELEASELOOSE] + ')?' + src[t.BUILD] + '?' + ')?)?'; -tok('XRANGE'); -src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'; -tok('XRANGELOOSE'); -src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'; // Coercion. -// Extract anything that could conceivably be a part of a valid semver - -tok('COERCE'); -src[t.COERCE] = '(^|[^\\d])' + '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + '(?:$|[^\\d])'; -tok('COERCERTL'); -re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g'); // Tilde ranges. -// Meaning is "reasonably at or greater than" - -tok('LONETILDE'); -src[t.LONETILDE] = '(?:~>?)'; -tok('TILDETRIM'); -src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'; -re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g'); -var tildeTrimReplace = '$1~'; -tok('TILDE'); -src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'; -tok('TILDELOOSE'); -src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'; // Caret ranges. -// Meaning is "at least and backwards compatible with" - -tok('LONECARET'); -src[t.LONECARET] = '(?:\\^)'; -tok('CARETTRIM'); -src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'; -re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g'); -var caretTrimReplace = '$1^'; -tok('CARET'); -src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'; -tok('CARETLOOSE'); -src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'; // A simple gt/lt/eq thing, or just "" to indicate "any version" - -tok('COMPARATORLOOSE'); -src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'; -tok('COMPARATOR'); -src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'; // An expression to strip any whitespace between the gtlt and the thing -// it modifies, so that `> 1.2.3` ==> `>1.2.3` - -tok('COMPARATORTRIM'); -src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'; // this one has to use the /g flag - -re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g'); -var comparatorTrimReplace = '$1$2$3'; // Something like `1.2.3 - 1.2.4` -// Note that these all use the loose form, because they'll be -// checked against either the strict or loose comparator form -// later. - -tok('HYPHENRANGE'); -src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' + '\\s+-\\s+' + '(' + src[t.XRANGEPLAIN] + ')' + '\\s*$'; -tok('HYPHENRANGELOOSE'); -src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' + '\\s+-\\s+' + '(' + src[t.XRANGEPLAINLOOSE] + ')' + '\\s*$'; // Star ranges basically just allow anything at all. - -tok('STAR'); -src[t.STAR] = '(<|>)?=?\\s*\\*'; // Compile to actual regexp objects. -// All are flag-free, unless they were created above with a flag. - -for (var i = 0; i < R; i++) { - debug(i, src[i]); - - if (!re[i]) { - re[i] = new RegExp(src[i]); - } -} - -exports.parse = parse; - -function parse(version, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - }; - } - - if (version instanceof SemVer) { - return version; - } - - if (typeof version !== 'string') { - return null; - } - - if (version.length > MAX_LENGTH) { - return null; - } - - var r = options.loose ? re[t.LOOSE] : re[t.FULL]; - - if (!r.test(version)) { - return null; - } - - try { - return new SemVer(version, options); - } catch (er) { - return null; - } -} - -exports.valid = valid; - -function valid(version, options) { - var v = parse(version, options); - return v ? v.version : null; -} - -exports.clean = clean; - -function clean(version, options) { - var s = parse(version.trim().replace(/^[=v]+/, ''), options); - return s ? s.version : null; -} - -exports.SemVer = SemVer; - -function SemVer(version, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - }; - } - - if (version instanceof SemVer) { - if (version.loose === options.loose) { - return version; - } else { - version = version.version; - } - } else if (typeof version !== 'string') { - throw new TypeError('Invalid Version: ' + version); - } - - if (version.length > MAX_LENGTH) { - throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters'); - } - - if (!(this instanceof SemVer)) { - return new SemVer(version, options); - } - - debug('SemVer', version, options); - this.options = options; - this.loose = !!options.loose; - var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]); - - if (!m) { - throw new TypeError('Invalid Version: ' + version); - } - - this.raw = version; // these are actually numbers - - this.major = +m[1]; - this.minor = +m[2]; - this.patch = +m[3]; - - if (this.major > MAX_SAFE_INTEGER || this.major < 0) { - throw new TypeError('Invalid major version'); - } - - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError('Invalid minor version'); - } - - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError('Invalid patch version'); - } // numberify any prerelease numeric ids - - - if (!m[4]) { - this.prerelease = []; - } else { - this.prerelease = m[4].split('.').map(function (id) { - if (/^[0-9]+$/.test(id)) { - var num = +id; - - if (num >= 0 && num < MAX_SAFE_INTEGER) { - return num; - } - } - - return id; - }); - } - - this.build = m[5] ? m[5].split('.') : []; - this.format(); -} - -SemVer.prototype.format = function () { - this.version = this.major + '.' + this.minor + '.' + this.patch; - - if (this.prerelease.length) { - this.version += '-' + this.prerelease.join('.'); - } - - return this.version; -}; - -SemVer.prototype.toString = function () { - return this.version; -}; - -SemVer.prototype.compare = function (other) { - debug('SemVer.compare', this.version, this.options, other); - - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); - } - - return this.compareMain(other) || this.comparePre(other); -}; - -SemVer.prototype.compareMain = function (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); - } - - return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch); -}; - -SemVer.prototype.comparePre = function (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); - } // NOT having a prerelease is > having one - - - if (this.prerelease.length && !other.prerelease.length) { - return -1; - } else if (!this.prerelease.length && other.prerelease.length) { - return 1; - } else if (!this.prerelease.length && !other.prerelease.length) { - return 0; - } - - var i = 0; - - do { - var a = this.prerelease[i]; - var b = other.prerelease[i]; - debug('prerelease compare', i, a, b); - - if (a === undefined && b === undefined) { - return 0; - } else if (b === undefined) { - return 1; - } else if (a === undefined) { - return -1; - } else if (a === b) { - continue; - } else { - return compareIdentifiers(a, b); - } - } while (++i); -}; - -SemVer.prototype.compareBuild = function (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); - } - - var i = 0; - - do { - var a = this.build[i]; - var b = other.build[i]; - debug('prerelease compare', i, a, b); - - if (a === undefined && b === undefined) { - return 0; - } else if (b === undefined) { - return 1; - } else if (a === undefined) { - return -1; - } else if (a === b) { - continue; - } else { - return compareIdentifiers(a, b); - } - } while (++i); -}; // preminor will bump the version up to the next minor release, and immediately -// down to pre-release. premajor and prepatch work the same way. - - -SemVer.prototype.inc = function (release, identifier) { - switch (release) { - case 'premajor': - this.prerelease.length = 0; - this.patch = 0; - this.minor = 0; - this.major++; - this.inc('pre', identifier); - break; - - case 'preminor': - this.prerelease.length = 0; - this.patch = 0; - this.minor++; - this.inc('pre', identifier); - break; - - case 'prepatch': - // If this is already a prerelease, it will bump to the next version - // drop any prereleases that might already exist, since they are not - // relevant at this point. - this.prerelease.length = 0; - this.inc('patch', identifier); - this.inc('pre', identifier); - break; - // If the input is a non-prerelease version, this acts the same as - // prepatch. - - case 'prerelease': - if (this.prerelease.length === 0) { - this.inc('patch', identifier); - } - - this.inc('pre', identifier); - break; - - case 'major': - // If this is a pre-major version, bump up to the same major version. - // Otherwise increment major. - // 1.0.0-5 bumps to 1.0.0 - // 1.1.0 bumps to 2.0.0 - if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { - this.major++; - } - - this.minor = 0; - this.patch = 0; - this.prerelease = []; - break; - - case 'minor': - // If this is a pre-minor version, bump up to the same minor version. - // Otherwise increment minor. - // 1.2.0-5 bumps to 1.2.0 - // 1.2.1 bumps to 1.3.0 - if (this.patch !== 0 || this.prerelease.length === 0) { - this.minor++; - } - - this.patch = 0; - this.prerelease = []; - break; - - case 'patch': - // If this is not a pre-release version, it will increment the patch. - // If it is a pre-release it will bump up to the same patch version. - // 1.2.0-5 patches to 1.2.0 - // 1.2.0 patches to 1.2.1 - if (this.prerelease.length === 0) { - this.patch++; - } - - this.prerelease = []; - break; - // This probably shouldn't be used publicly. - // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. - - case 'pre': - if (this.prerelease.length === 0) { - this.prerelease = [0]; - } else { - var i = this.prerelease.length; - - while (--i >= 0) { - if (typeof this.prerelease[i] === 'number') { - this.prerelease[i]++; - i = -2; - } - } - - if (i === -1) { - // didn't increment anything - this.prerelease.push(0); - } - } - - if (identifier) { - // 1.2.0-beta.1 bumps to 1.2.0-beta.2, - // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 - if (this.prerelease[0] === identifier) { - if (isNaN(this.prerelease[1])) { - this.prerelease = [identifier, 0]; - } - } else { - this.prerelease = [identifier, 0]; - } - } - - break; - - default: - throw new Error('invalid increment argument: ' + release); - } - - this.format(); - this.raw = this.version; - return this; -}; - -exports.inc = inc; - -function inc(version, release, loose, identifier) { - if (typeof loose === 'string') { - identifier = loose; - loose = undefined; - } - - try { - return new SemVer(version, loose).inc(release, identifier).version; - } catch (er) { - return null; - } -} - -exports.diff = diff; - -function diff(version1, version2) { - if (eq(version1, version2)) { - return null; - } else { - var v1 = parse(version1); - var v2 = parse(version2); - var prefix = ''; - - if (v1.prerelease.length || v2.prerelease.length) { - prefix = 'pre'; - var defaultResult = 'prerelease'; - } - - for (var key in v1) { - if (key === 'major' || key === 'minor' || key === 'patch') { - if (v1[key] !== v2[key]) { - return prefix + key; - } - } - } - - return defaultResult; // may be undefined - } -} - -exports.compareIdentifiers = compareIdentifiers; -var numeric = /^[0-9]+$/; - -function compareIdentifiers(a, b) { - var anum = numeric.test(a); - var bnum = numeric.test(b); - - if (anum && bnum) { - a = +a; - b = +b; - } - - return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1; -} - -exports.rcompareIdentifiers = rcompareIdentifiers; - -function rcompareIdentifiers(a, b) { - return compareIdentifiers(b, a); -} - -exports.major = major; - -function major(a, loose) { - return new SemVer(a, loose).major; -} - -exports.minor = minor; - -function minor(a, loose) { - return new SemVer(a, loose).minor; -} - -exports.patch = patch; - -function patch(a, loose) { - return new SemVer(a, loose).patch; -} - -exports.compare = compare; - -function compare(a, b, loose) { - return new SemVer(a, loose).compare(new SemVer(b, loose)); -} - -exports.compareLoose = compareLoose; - -function compareLoose(a, b) { - return compare(a, b, true); -} - -exports.compareBuild = compareBuild; - -function compareBuild(a, b, loose) { - var versionA = new SemVer(a, loose); - var versionB = new SemVer(b, loose); - return versionA.compare(versionB) || versionA.compareBuild(versionB); -} - -exports.rcompare = rcompare; - -function rcompare(a, b, loose) { - return compare(b, a, loose); -} - -exports.sort = sort; - -function sort(list, loose) { - return list.sort(function (a, b) { - return exports.compareBuild(a, b, loose); - }); -} - -exports.rsort = rsort; - -function rsort(list, loose) { - return list.sort(function (a, b) { - return exports.compareBuild(b, a, loose); - }); -} - -exports.gt = gt; - -function gt(a, b, loose) { - return compare(a, b, loose) > 0; -} - -exports.lt = lt; - -function lt(a, b, loose) { - return compare(a, b, loose) < 0; -} - -exports.eq = eq; - -function eq(a, b, loose) { - return compare(a, b, loose) === 0; -} - -exports.neq = neq; - -function neq(a, b, loose) { - return compare(a, b, loose) !== 0; -} - -exports.gte = gte; - -function gte(a, b, loose) { - return compare(a, b, loose) >= 0; -} - -exports.lte = lte; - -function lte(a, b, loose) { - return compare(a, b, loose) <= 0; -} - -exports.cmp = cmp; - -function cmp(a, op, b, loose) { - switch (op) { - case '===': - if (typeof a === 'object') a = a.version; - if (typeof b === 'object') b = b.version; - return a === b; - - case '!==': - if (typeof a === 'object') a = a.version; - if (typeof b === 'object') b = b.version; - return a !== b; - - case '': - case '=': - case '==': - return eq(a, b, loose); - - case '!=': - return neq(a, b, loose); - - case '>': - return gt(a, b, loose); - - case '>=': - return gte(a, b, loose); - - case '<': - return lt(a, b, loose); - - case '<=': - return lte(a, b, loose); - - default: - throw new TypeError('Invalid operator: ' + op); - } -} - -exports.Comparator = Comparator; - -function Comparator(comp, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - }; - } - - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp; - } else { - comp = comp.value; - } - } - - if (!(this instanceof Comparator)) { - return new Comparator(comp, options); - } - - debug('comparator', comp, options); - this.options = options; - this.loose = !!options.loose; - this.parse(comp); - - if (this.semver === ANY) { - this.value = ''; - } else { - this.value = this.operator + this.semver.version; - } - - debug('comp', this); -} - -var ANY = {}; - -Comparator.prototype.parse = function (comp) { - var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]; - var m = comp.match(r); - - if (!m) { - throw new TypeError('Invalid comparator: ' + comp); - } - - this.operator = m[1] !== undefined ? m[1] : ''; - - if (this.operator === '=') { - this.operator = ''; - } // if it literally is just '>' or '' then allow anything. - - - if (!m[2]) { - this.semver = ANY; - } else { - this.semver = new SemVer(m[2], this.options.loose); - } -}; - -Comparator.prototype.toString = function () { - return this.value; -}; - -Comparator.prototype.test = function (version) { - debug('Comparator.test', version, this.options.loose); - - if (this.semver === ANY || version === ANY) { - return true; - } - - if (typeof version === 'string') { - try { - version = new SemVer(version, this.options); - } catch (er) { - return false; - } - } - - return cmp(version, this.operator, this.semver, this.options); -}; - -Comparator.prototype.intersects = function (comp, options) { - if (!(comp instanceof Comparator)) { - throw new TypeError('a Comparator is required'); - } - - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - }; - } - - var rangeTmp; - - if (this.operator === '') { - if (this.value === '') { - return true; - } - - rangeTmp = new Range(comp.value, options); - return satisfies(this.value, rangeTmp, options); - } else if (comp.operator === '') { - if (comp.value === '') { - return true; - } - - rangeTmp = new Range(this.value, options); - return satisfies(comp.semver, rangeTmp, options); - } - - var sameDirectionIncreasing = (this.operator === '>=' || this.operator === '>') && (comp.operator === '>=' || comp.operator === '>'); - var sameDirectionDecreasing = (this.operator === '<=' || this.operator === '<') && (comp.operator === '<=' || comp.operator === '<'); - var sameSemVer = this.semver.version === comp.semver.version; - var differentDirectionsInclusive = (this.operator === '>=' || this.operator === '<=') && (comp.operator === '>=' || comp.operator === '<='); - var oppositeDirectionsLessThan = cmp(this.semver, '<', comp.semver, options) && (this.operator === '>=' || this.operator === '>') && (comp.operator === '<=' || comp.operator === '<'); - var oppositeDirectionsGreaterThan = cmp(this.semver, '>', comp.semver, options) && (this.operator === '<=' || this.operator === '<') && (comp.operator === '>=' || comp.operator === '>'); - return sameDirectionIncreasing || sameDirectionDecreasing || sameSemVer && differentDirectionsInclusive || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan; -}; - -exports.Range = Range; - -function Range(range, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - }; - } - - if (range instanceof Range) { - if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { - return range; - } else { - return new Range(range.raw, options); - } - } - - if (range instanceof Comparator) { - return new Range(range.value, options); - } - - if (!(this instanceof Range)) { - return new Range(range, options); - } - - this.options = options; - this.loose = !!options.loose; - this.includePrerelease = !!options.includePrerelease; // First, split based on boolean or || - - this.raw = range; - this.set = range.split(/\s*\|\|\s*/).map(function (range) { - return this.parseRange(range.trim()); - }, this).filter(function (c) { - // throw out any that are not relevant for whatever reason - return c.length; - }); - - if (!this.set.length) { - throw new TypeError('Invalid SemVer Range: ' + range); - } - - this.format(); -} - -Range.prototype.format = function () { - this.range = this.set.map(function (comps) { - return comps.join(' ').trim(); - }).join('||').trim(); - return this.range; -}; - -Range.prototype.toString = function () { - return this.range; -}; - -Range.prototype.parseRange = function (range) { - var loose = this.options.loose; - range = range.trim(); // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - - var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]; - range = range.replace(hr, hyphenReplace); - debug('hyphen replace', range); // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - - range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace); - debug('comparator trim', range, re[t.COMPARATORTRIM]); // `~ 1.2.3` => `~1.2.3` - - range = range.replace(re[t.TILDETRIM], tildeTrimReplace); // `^ 1.2.3` => `^1.2.3` - - range = range.replace(re[t.CARETTRIM], caretTrimReplace); // normalize spaces - - range = range.split(/\s+/).join(' '); // At this point, the range is completely trimmed and - // ready to be split into comparators. - - var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]; - var set = range.split(' ').map(function (comp) { - return parseComparator(comp, this.options); - }, this).join(' ').split(/\s+/); - - if (this.options.loose) { - // in loose mode, throw out any that are not valid comparators - set = set.filter(function (comp) { - return !!comp.match(compRe); - }); - } - - set = set.map(function (comp) { - return new Comparator(comp, this.options); - }, this); - return set; -}; - -Range.prototype.intersects = function (range, options) { - if (!(range instanceof Range)) { - throw new TypeError('a Range is required'); - } - - return this.set.some(function (thisComparators) { - return isSatisfiable(thisComparators, options) && range.set.some(function (rangeComparators) { - return isSatisfiable(rangeComparators, options) && thisComparators.every(function (thisComparator) { - return rangeComparators.every(function (rangeComparator) { - return thisComparator.intersects(rangeComparator, options); - }); - }); - }); - }); -}; // take a set of comparators and determine whether there -// exists a version which can satisfy it - - -function isSatisfiable(comparators, options) { - var result = true; - var remainingComparators = comparators.slice(); - var testComparator = remainingComparators.pop(); - - while (result && remainingComparators.length) { - result = remainingComparators.every(function (otherComparator) { - return testComparator.intersects(otherComparator, options); - }); - testComparator = remainingComparators.pop(); - } - - return result; -} // Mostly just for testing and legacy API reasons - - -exports.toComparators = toComparators; - -function toComparators(range, options) { - return new Range(range, options).set.map(function (comp) { - return comp.map(function (c) { - return c.value; - }).join(' ').trim().split(' '); - }); -} // comprised of xranges, tildes, stars, and gtlt's at this point. -// already replaced the hyphen ranges -// turn into a set of JUST comparators. - - -function parseComparator(comp, options) { - debug('comp', comp, options); - comp = replaceCarets(comp, options); - debug('caret', comp); - comp = replaceTildes(comp, options); - debug('tildes', comp); - comp = replaceXRanges(comp, options); - debug('xrange', comp); - comp = replaceStars(comp, options); - debug('stars', comp); - return comp; -} - -function isX(id) { - return !id || id.toLowerCase() === 'x' || id === '*'; -} // ~, ~> --> * (any, kinda silly) -// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 -// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 -// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 -// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 -// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 - - -function replaceTildes(comp, options) { - return comp.trim().split(/\s+/).map(function (comp) { - return replaceTilde(comp, options); - }).join(' '); -} - -function replaceTilde(comp, options) { - var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]; - return comp.replace(r, function (_, M, m, p, pr) { - debug('tilde', comp, _, M, m, p, pr); - var ret; - - if (isX(M)) { - ret = ''; - } else if (isX(m)) { - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; - } else if (isX(p)) { - // ~1.2 == >=1.2.0 <1.3.0 - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; - } else if (pr) { - debug('replaceTilde pr', pr); - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + M + '.' + (+m + 1) + '.0'; - } else { - // ~1.2.3 == >=1.2.3 <1.3.0 - ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + (+m + 1) + '.0'; - } - - debug('tilde return', ret); - return ret; - }); -} // ^ --> * (any, kinda silly) -// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 -// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 -// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 -// ^1.2.3 --> >=1.2.3 <2.0.0 -// ^1.2.0 --> >=1.2.0 <2.0.0 - - -function replaceCarets(comp, options) { - return comp.trim().split(/\s+/).map(function (comp) { - return replaceCaret(comp, options); - }).join(' '); -} - -function replaceCaret(comp, options) { - debug('caret', comp, options); - var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]; - return comp.replace(r, function (_, M, m, p, pr) { - debug('caret', comp, _, M, m, p, pr); - var ret; - - if (isX(M)) { - ret = ''; - } else if (isX(m)) { - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; - } else if (isX(p)) { - if (M === '0') { - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; - } else { - ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'; - } - } else if (pr) { - debug('replaceCaret pr', pr); - - if (M === '0') { - if (m === '0') { - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + M + '.' + m + '.' + (+p + 1); - } else { - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + M + '.' + (+m + 1) + '.0'; - } - } else { - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + (+M + 1) + '.0.0'; - } - } else { - debug('no pr'); - - if (M === '0') { - if (m === '0') { - ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + m + '.' + (+p + 1); - } else { - ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + (+m + 1) + '.0'; - } - } else { - ret = '>=' + M + '.' + m + '.' + p + ' <' + (+M + 1) + '.0.0'; - } - } - - debug('caret return', ret); - return ret; - }); -} - -function replaceXRanges(comp, options) { - debug('replaceXRanges', comp, options); - return comp.split(/\s+/).map(function (comp) { - return replaceXRange(comp, options); - }).join(' '); -} - -function replaceXRange(comp, options) { - comp = comp.trim(); - var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]; - return comp.replace(r, function (ret, gtlt, M, m, p, pr) { - debug('xRange', comp, ret, gtlt, M, m, p, pr); - var xM = isX(M); - var xm = xM || isX(m); - var xp = xm || isX(p); - var anyX = xp; - - if (gtlt === '=' && anyX) { - gtlt = ''; - } // if we're including prereleases in the match, then we need - // to fix this to -0, the lowest possible prerelease value - - - pr = options.includePrerelease ? '-0' : ''; - - if (xM) { - if (gtlt === '>' || gtlt === '<') { - // nothing is allowed - ret = '<0.0.0-0'; - } else { - // nothing is forbidden - ret = '*'; - } - } else if (gtlt && anyX) { - // we know patch is an x, because we have any x at all. - // replace X with 0 - if (xm) { - m = 0; - } - - p = 0; - - if (gtlt === '>') { - // >1 => >=2.0.0 - // >1.2 => >=1.3.0 - // >1.2.3 => >= 1.2.4 - gtlt = '>='; - - if (xm) { - M = +M + 1; - m = 0; - p = 0; - } else { - m = +m + 1; - p = 0; - } - } else if (gtlt === '<=') { - // <=0.7.x is actually <0.8.0, since any 0.7.x should - // pass. Similarly, <=7.x is actually <8.0.0, etc. - gtlt = '<'; - - if (xm) { - M = +M + 1; - } else { - m = +m + 1; - } - } - - ret = gtlt + M + '.' + m + '.' + p + pr; - } else if (xm) { - ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr; - } else if (xp) { - ret = '>=' + M + '.' + m + '.0' + pr + ' <' + M + '.' + (+m + 1) + '.0' + pr; - } - - debug('xRange return', ret); - return ret; - }); -} // Because * is AND-ed with everything else in the comparator, -// and '' means "any version", just remove the *s entirely. - - -function replaceStars(comp, options) { - debug('replaceStars', comp, options); // Looseness is ignored here. star is always as loose as it gets! - - return comp.trim().replace(re[t.STAR], ''); -} // This function is passed to string.replace(re[t.HYPHENRANGE]) -// M, m, patch, prerelease, build -// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 -// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do -// 1.2 - 3.4 => >=1.2.0 <3.5.0 - - -function hyphenReplace($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) { - if (isX(fM)) { - from = ''; - } else if (isX(fm)) { - from = '>=' + fM + '.0.0'; - } else if (isX(fp)) { - from = '>=' + fM + '.' + fm + '.0'; - } else { - from = '>=' + from; - } - - if (isX(tM)) { - to = ''; - } else if (isX(tm)) { - to = '<' + (+tM + 1) + '.0.0'; - } else if (isX(tp)) { - to = '<' + tM + '.' + (+tm + 1) + '.0'; - } else if (tpr) { - to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; - } else { - to = '<=' + to; - } - - return (from + ' ' + to).trim(); -} // if ANY of the sets match ALL of its comparators, then pass - - -Range.prototype.test = function (version) { - if (!version) { - return false; - } - - if (typeof version === 'string') { - try { - version = new SemVer(version, this.options); - } catch (er) { - return false; - } - } - - for (var i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version, this.options)) { - return true; - } - } - - return false; -}; - -function testSet(set, version, options) { - for (var i = 0; i < set.length; i++) { - if (!set[i].test(version)) { - return false; - } - } - - if (version.prerelease.length && !options.includePrerelease) { - // Find the set of versions that are allowed to have prereleases - // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 - // That should allow `1.2.3-pr.2` to pass. - // However, `1.2.4-alpha.notready` should NOT be allowed, - // even though it's within the range set by the comparators. - for (i = 0; i < set.length; i++) { - debug(set[i].semver); - - if (set[i].semver === ANY) { - continue; - } - - if (set[i].semver.prerelease.length > 0) { - var allowed = set[i].semver; - - if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { - return true; - } - } - } // Version has a -pre, but it's not one of the ones we like. - - - return false; - } - - return true; -} - -exports.satisfies = satisfies; - -function satisfies(version, range, options) { - try { - range = new Range(range, options); - } catch (er) { - return false; - } - - return range.test(version); -} - -exports.maxSatisfying = maxSatisfying; - -function maxSatisfying(versions, range, options) { - var max = null; - var maxSV = null; - - try { - var rangeObj = new Range(range, options); - } catch (er) { - return null; - } - - versions.forEach(function (v) { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!max || maxSV.compare(v) === -1) { - // compare(max, v, true) - max = v; - maxSV = new SemVer(max, options); - } - } - }); - return max; -} - -exports.minSatisfying = minSatisfying; - -function minSatisfying(versions, range, options) { - var min = null; - var minSV = null; - - try { - var rangeObj = new Range(range, options); - } catch (er) { - return null; - } - - versions.forEach(function (v) { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!min || minSV.compare(v) === 1) { - // compare(min, v, true) - min = v; - minSV = new SemVer(min, options); - } - } - }); - return min; -} - -exports.minVersion = minVersion; - -function minVersion(range, loose) { - range = new Range(range, loose); - var minver = new SemVer('0.0.0'); - - if (range.test(minver)) { - return minver; - } - - minver = new SemVer('0.0.0-0'); - - if (range.test(minver)) { - return minver; - } - - minver = null; - - for (var i = 0; i < range.set.length; ++i) { - var comparators = range.set[i]; - comparators.forEach(function (comparator) { - // Clone to avoid manipulating the comparator's semver object. - var compver = new SemVer(comparator.semver.version); - - switch (comparator.operator) { - case '>': - if (compver.prerelease.length === 0) { - compver.patch++; - } else { - compver.prerelease.push(0); - } - - compver.raw = compver.format(); - - /* fallthrough */ - - case '': - case '>=': - if (!minver || gt(minver, compver)) { - minver = compver; - } - - break; - - case '<': - case '<=': - /* Ignore maximum versions */ - break; - - /* istanbul ignore next */ - - default: - throw new Error('Unexpected operation: ' + comparator.operator); - } - }); - } - - if (minver && range.test(minver)) { - return minver; - } - - return null; -} - -exports.validRange = validRange; - -function validRange(range, options) { - try { - // Return '*' instead of '' so that truthiness works. - // This will throw if it's invalid anyway - return new Range(range, options).range || '*'; - } catch (er) { - return null; - } -} // Determine if version is less than all the versions possible in the range - - -exports.ltr = ltr; - -function ltr(version, range, options) { - return outside(version, range, '<', options); -} // Determine if version is greater than all the versions possible in the range. - - -exports.gtr = gtr; - -function gtr(version, range, options) { - return outside(version, range, '>', options); -} - -exports.outside = outside; - -function outside(version, range, hilo, options) { - version = new SemVer(version, options); - range = new Range(range, options); - var gtfn, ltefn, ltfn, comp, ecomp; - - switch (hilo) { - case '>': - gtfn = gt; - ltefn = lte; - ltfn = lt; - comp = '>'; - ecomp = '>='; - break; - - case '<': - gtfn = lt; - ltefn = gte; - ltfn = gt; - comp = '<'; - ecomp = '<='; - break; - - default: - throw new TypeError('Must provide a hilo val of "<" or ">"'); - } // If it satisifes the range it is not outside - - - if (satisfies(version, range, options)) { - return false; - } // From now on, variable terms are as if we're in "gtr" mode. - // but note that everything is flipped for the "ltr" function. - - - for (var i = 0; i < range.set.length; ++i) { - var comparators = range.set[i]; - var high = null; - var low = null; - comparators.forEach(function (comparator) { - if (comparator.semver === ANY) { - comparator = new Comparator('>=0.0.0'); - } - - high = high || comparator; - low = low || comparator; - - if (gtfn(comparator.semver, high.semver, options)) { - high = comparator; - } else if (ltfn(comparator.semver, low.semver, options)) { - low = comparator; - } - }); // If the edge version comparator has a operator then our version - // isn't outside it - - if (high.operator === comp || high.operator === ecomp) { - return false; - } // If the lowest version comparator has an operator and our version - // is less than it then it isn't higher than the range - - - if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { - return false; - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false; - } - } - - return true; -} - -exports.prerelease = prerelease; - -function prerelease(version, options) { - var parsed = parse(version, options); - return parsed && parsed.prerelease.length ? parsed.prerelease : null; -} - -exports.intersects = intersects; - -function intersects(r1, r2, options) { - r1 = new Range(r1, options); - r2 = new Range(r2, options); - return r1.intersects(r2); -} - -exports.coerce = coerce; - -function coerce(version, options) { - if (version instanceof SemVer) { - return version; - } - - if (typeof version === 'number') { - version = String(version); - } - - if (typeof version !== 'string') { - return null; - } - - options = options || {}; - var match = null; - - if (!options.rtl) { - match = version.match(re[t.COERCE]); - } else { - // Find the right-most coercible string that does not share - // a terminus with a more left-ward coercible string. - // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' - // - // Walk through the string checking with a /g regexp - // Manually set the index so as to pick up overlapping matches. - // Stop when we get a match that ends at the string end, since no - // coercible string can be more right-ward without the same terminus. - var next; - - while ((next = re[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) { - if (!match || next.index + next[0].length !== match.index + match[0].length) { - match = next; - } - - re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; - } // leave it in a clean state - - - re[t.COERCERTL].lastIndex = -1; - } - - if (match === null) { - return null; - } - - return parse(match[2] + '.' + (match[3] || '0') + '.' + (match[4] || '0'), options); -} -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(62))) - -/***/ }), - -/***/ 3: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "e", function() { return /* binding */ getAllEnumerableKeys; }); -__webpack_require__.d(__webpack_exports__, "s", function() { return /* binding */ getWrappedDisplayName; }); -__webpack_require__.d(__webpack_exports__, "k", function() { return /* binding */ getDisplayName; }); -__webpack_require__.d(__webpack_exports__, "r", function() { return /* binding */ getUID; }); -__webpack_require__.d(__webpack_exports__, "y", function() { return /* binding */ utfDecodeString; }); -__webpack_require__.d(__webpack_exports__, "z", function() { return /* binding */ utfEncodeString; }); -__webpack_require__.d(__webpack_exports__, "i", function() { return /* binding */ getDefaultComponentFilters; }); -__webpack_require__.d(__webpack_exports__, "p", function() { return /* binding */ getSavedComponentFilters; }); -__webpack_require__.d(__webpack_exports__, "w", function() { return /* binding */ setSavedComponentFilters; }); -__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ castBool; }); -__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ castBrowserTheme; }); -__webpack_require__.d(__webpack_exports__, "f", function() { return /* binding */ getAppendComponentStack; }); -__webpack_require__.d(__webpack_exports__, "g", function() { return /* binding */ getBreakOnConsoleErrors; }); -__webpack_require__.d(__webpack_exports__, "m", function() { return /* binding */ getHideConsoleLogsInStrictMode; }); -__webpack_require__.d(__webpack_exports__, "q", function() { return /* binding */ getShowInlineWarningsAndErrors; }); -__webpack_require__.d(__webpack_exports__, "j", function() { return /* binding */ getDefaultOpenInEditorURL; }); -__webpack_require__.d(__webpack_exports__, "o", function() { return /* binding */ getOpenInEditorURL; }); -__webpack_require__.d(__webpack_exports__, "u", function() { return /* binding */ separateDisplayNameAndHOCs; }); -__webpack_require__.d(__webpack_exports__, "x", function() { return /* binding */ shallowDiffers; }); -__webpack_require__.d(__webpack_exports__, "n", function() { return /* binding */ getInObject; }); -__webpack_require__.d(__webpack_exports__, "c", function() { return /* binding */ deletePathInObject; }); -__webpack_require__.d(__webpack_exports__, "t", function() { return /* binding */ renamePathInObject; }); -__webpack_require__.d(__webpack_exports__, "v", function() { return /* binding */ setInObject; }); -__webpack_require__.d(__webpack_exports__, "h", function() { return /* binding */ getDataType; }); -__webpack_require__.d(__webpack_exports__, "l", function() { return /* binding */ getDisplayNameForReactElement; }); -__webpack_require__.d(__webpack_exports__, "d", function() { return /* binding */ formatDataForPreview; }); - -// UNUSED EXPORTS: alphaSortKeys, printOperationsArray - -// EXTERNAL MODULE: /Users/mengdi/workspace/git/react/node_modules/lru-cache/index.js -var lru_cache = __webpack_require__(41); -var lru_cache_default = /*#__PURE__*/__webpack_require__.n(lru_cache); - -// EXTERNAL MODULE: /Users/mengdi/workspace/git/react/build/oss-experimental/react-is/index.js -var react_is = __webpack_require__(12); - -// CONCATENATED MODULE: ../shared/ReactSymbols.js -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ -// ATTENTION -// When adding new symbols to this file, -// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' -// The Symbol used to tag the ReactElement-like types. -const REACT_ELEMENT_TYPE = Symbol.for('react.element'); -const REACT_PORTAL_TYPE = Symbol.for('react.portal'); -const REACT_FRAGMENT_TYPE = Symbol.for('react.fragment'); -const REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode'); -const REACT_PROFILER_TYPE = Symbol.for('react.profiler'); -const REACT_PROVIDER_TYPE = Symbol.for('react.provider'); -const REACT_CONTEXT_TYPE = Symbol.for('react.context'); -const REACT_SERVER_CONTEXT_TYPE = Symbol.for('react.server_context'); -const REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref'); -const REACT_SUSPENSE_TYPE = Symbol.for('react.suspense'); -const REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list'); -const REACT_MEMO_TYPE = Symbol.for('react.memo'); -const REACT_LAZY_TYPE = Symbol.for('react.lazy'); -const REACT_SCOPE_TYPE = Symbol.for('react.scope'); -const REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for('react.debug_trace_mode'); -const REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen'); -const REACT_LEGACY_HIDDEN_TYPE = Symbol.for('react.legacy_hidden'); -const REACT_CACHE_TYPE = Symbol.for('react.cache'); -const REACT_TRACING_MARKER_TYPE = Symbol.for('react.tracing_marker'); -const REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED = Symbol.for('react.default_value'); -const REACT_MEMO_CACHE_SENTINEL = Symbol.for('react.memo_cache_sentinel'); -const MAYBE_ITERATOR_SYMBOL = Symbol.iterator; -const FAUX_ITERATOR_SYMBOL = '@@iterator'; -function getIteratorFn(maybeIterable) { - if (maybeIterable === null || typeof maybeIterable !== 'object') { - return null; - } - - const maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; - - if (typeof maybeIterator === 'function') { - return maybeIterator; - } - - return null; -} -// EXTERNAL MODULE: ../react-devtools-shared/src/constants.js -var constants = __webpack_require__(1); - -// EXTERNAL MODULE: ../react-devtools-shared/src/types.js -var types = __webpack_require__(2); - -// EXTERNAL MODULE: ../react-devtools-shared/src/storage.js -var storage = __webpack_require__(8); - -// EXTERNAL MODULE: ../react-devtools-shared/src/hydration.js -var hydration = __webpack_require__(11); - -// EXTERNAL MODULE: ../react-devtools-shared/src/isArray.js -var isArray = __webpack_require__(17); - -// CONCATENATED MODULE: ../react-devtools-shared/src/utils.js -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - - - - - - - -// $FlowFixMe[method-unbinding] -const utils_hasOwnProperty = Object.prototype.hasOwnProperty; -const cachedDisplayNames = new WeakMap(); // On large trees, encoding takes significant time. -// Try to reuse the already encoded strings. - -const encodedStringCache = new lru_cache_default.a({ - max: 1000 -}); -function alphaSortKeys(a, b) { - if (a.toString() > b.toString()) { - return 1; - } else if (b.toString() > a.toString()) { - return -1; - } else { - return 0; - } -} -function getAllEnumerableKeys(obj) { - const keys = new Set(); - let current = obj; - - while (current != null) { - const currentKeys = [...Object.keys(current), ...Object.getOwnPropertySymbols(current)]; - const descriptors = Object.getOwnPropertyDescriptors(current); - currentKeys.forEach(key => { - // $FlowFixMe: key can be a Symbol https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor - if (descriptors[key].enumerable) { - keys.add(key); - } - }); - current = Object.getPrototypeOf(current); - } - - return keys; -} // Mirror https://github.com/facebook/react/blob/7c21bf72ace77094fd1910cc350a548287ef8350/packages/shared/getComponentName.js#L27-L37 - -function getWrappedDisplayName(outerType, innerType, wrapperName, fallbackName) { - const displayName = outerType.displayName; - return displayName || `${wrapperName}(${getDisplayName(innerType, fallbackName)})`; -} -function getDisplayName(type, fallbackName = 'Anonymous') { - const nameFromCache = cachedDisplayNames.get(type); - - if (nameFromCache != null) { - return nameFromCache; - } - - let displayName = fallbackName; // The displayName property is not guaranteed to be a string. - // It's only safe to use for our purposes if it's a string. - // github.com/facebook/react-devtools/issues/803 - - if (typeof type.displayName === 'string') { - displayName = type.displayName; - } else if (typeof type.name === 'string' && type.name !== '') { - displayName = type.name; - } - - cachedDisplayNames.set(type, displayName); - return displayName; -} -let uidCounter = 0; -function getUID() { - return ++uidCounter; -} -function utfDecodeString(array) { - // Avoid spreading the array (e.g. String.fromCodePoint(...array)) - // Functions arguments are first placed on the stack before the function is called - // which throws a RangeError for large arrays. - // See github.com/facebook/react/issues/22293 - let string = ''; - - for (let i = 0; i < array.length; i++) { - const char = array[i]; - string += String.fromCodePoint(char); - } - - return string; -} - -function surrogatePairToCodePoint(charCode1, charCode2) { - return ((charCode1 & 0x3ff) << 10) + (charCode2 & 0x3ff) + 0x10000; -} // Credit for this encoding approach goes to Tim Down: -// https://stackoverflow.com/questions/4877326/how-can-i-tell-if-a-string-contains-multibyte-characters-in-javascript - - -function utfEncodeString(string) { - const cached = encodedStringCache.get(string); - - if (cached !== undefined) { - return cached; - } - - const encoded = []; - let i = 0; - let charCode; - - while (i < string.length) { - charCode = string.charCodeAt(i); // Handle multibyte unicode characters (like emoji). - - if ((charCode & 0xf800) === 0xd800) { - encoded.push(surrogatePairToCodePoint(charCode, string.charCodeAt(++i))); - } else { - encoded.push(charCode); - } - - ++i; - } - - encodedStringCache.set(string, encoded); - return encoded; -} -function printOperationsArray(operations) { - // The first two values are always rendererID and rootID - const rendererID = operations[0]; - const rootID = operations[1]; - const logs = [`operations for renderer:${rendererID} and root:${rootID}`]; - let i = 2; // Reassemble the string table. - - const stringTable = [null // ID = 0 corresponds to the null string. - ]; - const stringTableSize = operations[i++]; - const stringTableEnd = i + stringTableSize; - - while (i < stringTableEnd) { - const nextLength = operations[i++]; - const nextString = utfDecodeString(operations.slice(i, i + nextLength)); - stringTable.push(nextString); - i += nextLength; - } - - while (i < operations.length) { - const operation = operations[i]; - - switch (operation) { - case constants["x" /* TREE_OPERATION_ADD */]: - { - const id = operations[i + 1]; - const type = operations[i + 2]; - i += 3; - - if (type === types["m" /* ElementTypeRoot */]) { - logs.push(`Add new root node ${id}`); - i++; // isStrictModeCompliant - - i++; // supportsProfiling - - i++; // supportsStrictMode - - i++; // hasOwnerMetadata - } else { - const parentID = operations[i]; - i++; - i++; // ownerID - - const displayNameStringID = operations[i]; - const displayName = stringTable[displayNameStringID]; - i++; - i++; // key - - logs.push(`Add node ${id} (${displayName || 'null'}) as child of ${parentID}`); - } - - break; - } - - case constants["y" /* TREE_OPERATION_REMOVE */]: - { - const removeLength = operations[i + 1]; - i += 2; - - for (let removeIndex = 0; removeIndex < removeLength; removeIndex++) { - const id = operations[i]; - i += 1; - logs.push(`Remove node ${id}`); - } - - break; - } - - case constants["z" /* TREE_OPERATION_REMOVE_ROOT */]: - { - i += 1; - logs.push(`Remove root ${rootID}`); - break; - } - - case constants["B" /* TREE_OPERATION_SET_SUBTREE_MODE */]: - { - const id = operations[i + 1]; - const mode = operations[i + 1]; - i += 3; - logs.push(`Mode ${mode} set for subtree with root ${id}`); - break; - } - - case constants["A" /* TREE_OPERATION_REORDER_CHILDREN */]: - { - const id = operations[i + 1]; - const numChildren = operations[i + 2]; - i += 3; - const children = operations.slice(i, i + numChildren); - i += numChildren; - logs.push(`Re-order node ${id} children ${children.join(',')}`); - break; - } - - case constants["D" /* TREE_OPERATION_UPDATE_TREE_BASE_DURATION */]: - // Base duration updates are only sent while profiling is in progress. - // We can ignore them at this point. - // The profiler UI uses them lazily in order to generate the tree. - i += 3; - break; - - case constants["C" /* TREE_OPERATION_UPDATE_ERRORS_OR_WARNINGS */]: - const id = operations[i + 1]; - const numErrors = operations[i + 2]; - const numWarnings = operations[i + 3]; - i += 4; - logs.push(`Node ${id} has ${numErrors} errors and ${numWarnings} warnings`); - break; - - default: - throw Error(`Unsupported Bridge operation "${operation}"`); - } - } - - console.log(logs.join('\n ')); -} -function getDefaultComponentFilters() { - return [{ - type: types["b" /* ComponentFilterElementType */], - value: types["i" /* ElementTypeHostComponent */], - isEnabled: true - }]; -} -function getSavedComponentFilters() { - try { - const raw = Object(storage["a" /* localStorageGetItem */])(constants["h" /* LOCAL_STORAGE_COMPONENT_FILTER_PREFERENCES_KEY */]); - - if (raw != null) { - return JSON.parse(raw); - } - } catch (error) {} - - return getDefaultComponentFilters(); -} -function setSavedComponentFilters(componentFilters) { - Object(storage["c" /* localStorageSetItem */])(constants["h" /* LOCAL_STORAGE_COMPONENT_FILTER_PREFERENCES_KEY */], JSON.stringify(componentFilters)); -} - -function parseBool(s) { - if (s === 'true') { - return true; - } - - if (s === 'false') { - return false; - } -} - -function castBool(v) { - if (v === true || v === false) { - return v; - } -} -function castBrowserTheme(v) { - if (v === 'light' || v === 'dark' || v === 'auto') { - return v; - } -} -function getAppendComponentStack() { - var _parseBool; - - const raw = Object(storage["a" /* localStorageGetItem */])(constants["m" /* LOCAL_STORAGE_SHOULD_APPEND_COMPONENT_STACK_KEY */]); - return (_parseBool = parseBool(raw)) !== null && _parseBool !== void 0 ? _parseBool : true; -} -function getBreakOnConsoleErrors() { - var _parseBool2; - - const raw = Object(storage["a" /* localStorageGetItem */])(constants["n" /* LOCAL_STORAGE_SHOULD_BREAK_ON_CONSOLE_ERRORS */]); - return (_parseBool2 = parseBool(raw)) !== null && _parseBool2 !== void 0 ? _parseBool2 : false; -} -function getHideConsoleLogsInStrictMode() { - var _parseBool3; - - const raw = Object(storage["a" /* localStorageGetItem */])(constants["j" /* LOCAL_STORAGE_HIDE_CONSOLE_LOGS_IN_STRICT_MODE */]); - return (_parseBool3 = parseBool(raw)) !== null && _parseBool3 !== void 0 ? _parseBool3 : false; -} -function getShowInlineWarningsAndErrors() { - var _parseBool4; - - const raw = Object(storage["a" /* localStorageGetItem */])(constants["o" /* LOCAL_STORAGE_SHOW_INLINE_WARNINGS_AND_ERRORS_KEY */]); - return (_parseBool4 = parseBool(raw)) !== null && _parseBool4 !== void 0 ? _parseBool4 : true; -} -function getDefaultOpenInEditorURL() { - return typeof null === 'string' ? null : ''; -} -function getOpenInEditorURL() { - try { - const raw = Object(storage["a" /* localStorageGetItem */])(constants["k" /* LOCAL_STORAGE_OPEN_IN_EDITOR_URL */]); - - if (raw != null) { - return JSON.parse(raw); - } - } catch (error) {} - - return getDefaultOpenInEditorURL(); -} -function separateDisplayNameAndHOCs(displayName, type) { - if (displayName === null) { - return [null, null]; - } - - let hocDisplayNames = null; - - switch (type) { - case types["e" /* ElementTypeClass */]: - case types["g" /* ElementTypeForwardRef */]: - case types["h" /* ElementTypeFunction */]: - case types["j" /* ElementTypeMemo */]: - if (displayName.indexOf('(') >= 0) { - const matches = displayName.match(/[^()]+/g); - - if (matches != null) { - displayName = matches.pop(); - hocDisplayNames = matches; - } - } - - break; - - default: - break; - } - - return [displayName, hocDisplayNames]; -} // Pulled from react-compat -// https://github.com/developit/preact-compat/blob/7c5de00e7c85e2ffd011bf3af02899b63f699d3a/src/index.js#L349 - -function shallowDiffers(prev, next) { - for (const attribute in prev) { - if (!(attribute in next)) { - return true; - } - } - - for (const attribute in next) { - if (prev[attribute] !== next[attribute]) { - return true; - } - } - - return false; -} -function getInObject(object, path) { - return path.reduce((reduced, attr) => { - if (reduced) { - if (utils_hasOwnProperty.call(reduced, attr)) { - return reduced[attr]; - } - - if (typeof reduced[Symbol.iterator] === 'function') { - // Convert iterable to array and return array[index] - // - // TRICKY - // Don't use [...spread] syntax for this purpose. - // This project uses @babel/plugin-transform-spread in "loose" mode which only works with Array values. - // Other types (e.g. typed arrays, Sets) will not spread correctly. - return Array.from(reduced)[attr]; - } - } - - return null; - }, object); -} -function deletePathInObject(object, path) { - const length = path.length; - const last = path[length - 1]; - - if (object != null) { - const parent = getInObject(object, path.slice(0, length - 1)); - - if (parent) { - if (Object(isArray["a" /* default */])(parent)) { - parent.splice(last, 1); - } else { - delete parent[last]; - } - } - } -} -function renamePathInObject(object, oldPath, newPath) { - const length = oldPath.length; - - if (object != null) { - const parent = getInObject(object, oldPath.slice(0, length - 1)); - - if (parent) { - const lastOld = oldPath[length - 1]; - const lastNew = newPath[length - 1]; - parent[lastNew] = parent[lastOld]; - - if (Object(isArray["a" /* default */])(parent)) { - parent.splice(lastOld, 1); - } else { - delete parent[lastOld]; - } - } - } -} -function setInObject(object, path, value) { - const length = path.length; - const last = path[length - 1]; - - if (object != null) { - const parent = getInObject(object, path.slice(0, length - 1)); - - if (parent) { - parent[last] = value; - } - } -} - -/** - * Get a enhanced/artificial type string based on the object instance - */ -function getDataType(data) { - if (data === null) { - return 'null'; - } else if (data === undefined) { - return 'undefined'; - } - - if (Object(react_is["isElement"])(data)) { - return 'react_element'; - } - - if (typeof HTMLElement !== 'undefined' && data instanceof HTMLElement) { - return 'html_element'; - } - - const type = typeof data; - - switch (type) { - case 'bigint': - return 'bigint'; - - case 'boolean': - return 'boolean'; - - case 'function': - return 'function'; - - case 'number': - if (Number.isNaN(data)) { - return 'nan'; - } else if (!Number.isFinite(data)) { - return 'infinity'; - } else { - return 'number'; - } - - case 'object': - if (Object(isArray["a" /* default */])(data)) { - return 'array'; - } else if (ArrayBuffer.isView(data)) { - return utils_hasOwnProperty.call(data.constructor, 'BYTES_PER_ELEMENT') ? 'typed_array' : 'data_view'; - } else if (data.constructor && data.constructor.name === 'ArrayBuffer') { - // HACK This ArrayBuffer check is gross; is there a better way? - // We could try to create a new DataView with the value. - // If it doesn't error, we know it's an ArrayBuffer, - // but this seems kind of awkward and expensive. - return 'array_buffer'; - } else if (typeof data[Symbol.iterator] === 'function') { - const iterator = data[Symbol.iterator](); - - if (!iterator) {// Proxies might break assumptoins about iterators. - // See github.com/facebook/react/issues/21654 - } else { - return iterator === data ? 'opaque_iterator' : 'iterator'; - } - } else if (data.constructor && data.constructor.name === 'RegExp') { - return 'regexp'; - } else { - // $FlowFixMe[method-unbinding] - const toStringValue = Object.prototype.toString.call(data); - - if (toStringValue === '[object Date]') { - return 'date'; - } else if (toStringValue === '[object HTMLAllCollection]') { - return 'html_all_collection'; - } - } - - return 'object'; - - case 'string': - return 'string'; - - case 'symbol': - return 'symbol'; - - case 'undefined': - if ( // $FlowFixMe[method-unbinding] - Object.prototype.toString.call(data) === '[object HTMLAllCollection]') { - return 'html_all_collection'; - } - - return 'undefined'; - - default: - return 'unknown'; - } -} -function getDisplayNameForReactElement(element) { - const elementType = Object(react_is["typeOf"])(element); - - switch (elementType) { - case react_is["ContextConsumer"]: - return 'ContextConsumer'; - - case react_is["ContextProvider"]: - return 'ContextProvider'; - - case react_is["ForwardRef"]: - return 'ForwardRef'; - - case react_is["Fragment"]: - return 'Fragment'; - - case react_is["Lazy"]: - return 'Lazy'; - - case react_is["Memo"]: - return 'Memo'; - - case react_is["Portal"]: - return 'Portal'; - - case react_is["Profiler"]: - return 'Profiler'; - - case react_is["StrictMode"]: - return 'StrictMode'; - - case react_is["Suspense"]: - return 'Suspense'; - - case REACT_SUSPENSE_LIST_TYPE: - return 'SuspenseList'; - - case REACT_TRACING_MARKER_TYPE: - return 'TracingMarker'; - - default: - const { - type - } = element; - - if (typeof type === 'string') { - return type; - } else if (typeof type === 'function') { - return getDisplayName(type, 'Anonymous'); - } else if (type != null) { - return 'NotImplementedInDevtools'; - } else { - return 'Element'; - } - - } -} -const MAX_PREVIEW_STRING_LENGTH = 50; - -function truncateForDisplay(string, length = MAX_PREVIEW_STRING_LENGTH) { - if (string.length > length) { - return string.substr(0, length) + '…'; - } else { - return string; - } -} // Attempts to mimic Chrome's inline preview for values. -// For example, the following value... -// { -// foo: 123, -// bar: "abc", -// baz: [true, false], -// qux: { ab: 1, cd: 2 } -// }; -// -// Would show a preview of... -// {foo: 123, bar: "abc", baz: Array(2), qux: {…}} -// -// And the following value... -// [ -// 123, -// "abc", -// [true, false], -// { foo: 123, bar: "abc" } -// ]; -// -// Would show a preview of... -// [123, "abc", Array(2), {…}] - - -function formatDataForPreview(data, showFormattedValue) { - if (data != null && utils_hasOwnProperty.call(data, hydration["d" /* meta */].type)) { - return showFormattedValue ? data[hydration["d" /* meta */].preview_long] : data[hydration["d" /* meta */].preview_short]; - } - - const type = getDataType(data); - - switch (type) { - case 'html_element': - return `<${truncateForDisplay(data.tagName.toLowerCase())} />`; - - case 'function': - return truncateForDisplay(`ƒ ${typeof data.name === 'function' ? '' : data.name}() {}`); - - case 'string': - return `"${data}"`; - - case 'bigint': - return truncateForDisplay(data.toString() + 'n'); - - case 'regexp': - return truncateForDisplay(data.toString()); - - case 'symbol': - return truncateForDisplay(data.toString()); - - case 'react_element': - return `<${truncateForDisplay(getDisplayNameForReactElement(data) || 'Unknown')} />`; - - case 'array_buffer': - return `ArrayBuffer(${data.byteLength})`; - - case 'data_view': - return `DataView(${data.buffer.byteLength})`; - - case 'array': - if (showFormattedValue) { - let formatted = ''; - - for (let i = 0; i < data.length; i++) { - if (i > 0) { - formatted += ', '; - } - - formatted += formatDataForPreview(data[i], false); - - if (formatted.length > MAX_PREVIEW_STRING_LENGTH) { - // Prevent doing a lot of unnecessary iteration... - break; - } - } - - return `[${truncateForDisplay(formatted)}]`; - } else { - const length = utils_hasOwnProperty.call(data, hydration["d" /* meta */].size) ? data[hydration["d" /* meta */].size] : data.length; - return `Array(${length})`; - } - - case 'typed_array': - const shortName = `${data.constructor.name}(${data.length})`; - - if (showFormattedValue) { - let formatted = ''; - - for (let i = 0; i < data.length; i++) { - if (i > 0) { - formatted += ', '; - } - - formatted += data[i]; - - if (formatted.length > MAX_PREVIEW_STRING_LENGTH) { - // Prevent doing a lot of unnecessary iteration... - break; - } - } - - return `${shortName} [${truncateForDisplay(formatted)}]`; - } else { - return shortName; - } - - case 'iterator': - const name = data.constructor.name; - - if (showFormattedValue) { - // TRICKY - // Don't use [...spread] syntax for this purpose. - // This project uses @babel/plugin-transform-spread in "loose" mode which only works with Array values. - // Other types (e.g. typed arrays, Sets) will not spread correctly. - const array = Array.from(data); - let formatted = ''; - - for (let i = 0; i < array.length; i++) { - const entryOrEntries = array[i]; - - if (i > 0) { - formatted += ', '; - } // TRICKY - // Browsers display Maps and Sets differently. - // To mimic their behavior, detect if we've been given an entries tuple. - // Map(2) {"abc" => 123, "def" => 123} - // Set(2) {"abc", 123} - - - if (Object(isArray["a" /* default */])(entryOrEntries)) { - const key = formatDataForPreview(entryOrEntries[0], true); - const value = formatDataForPreview(entryOrEntries[1], false); - formatted += `${key} => ${value}`; - } else { - formatted += formatDataForPreview(entryOrEntries, false); - } - - if (formatted.length > MAX_PREVIEW_STRING_LENGTH) { - // Prevent doing a lot of unnecessary iteration... - break; - } - } - - return `${name}(${data.size}) {${truncateForDisplay(formatted)}}`; - } else { - return `${name}(${data.size})`; - } - - case 'opaque_iterator': - { - return data[Symbol.toStringTag]; - } - - case 'date': - return data.toString(); - - case 'object': - if (showFormattedValue) { - const keys = Array.from(getAllEnumerableKeys(data)).sort(alphaSortKeys); - let formatted = ''; - - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - - if (i > 0) { - formatted += ', '; - } - - formatted += `${key.toString()}: ${formatDataForPreview(data[key], false)}`; - - if (formatted.length > MAX_PREVIEW_STRING_LENGTH) { - // Prevent doing a lot of unnecessary iteration... - break; - } - } - - return `{${truncateForDisplay(formatted)}}`; - } else { - return '{…}'; - } - - case 'boolean': - case 'number': - case 'infinity': - case 'nan': - case 'null': - case 'undefined': - return data; - - default: - try { - return truncateForDisplay(String(data)); - } catch (error) { - return 'unserializable'; - } - - } -} - -/***/ }), - -/***/ 33: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return REACT_TOTAL_NUM_LANES; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return SCHEDULING_PROFILER_VERSION; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return SNAPSHOT_MAX_HEIGHT; }); -/* harmony import */ var react_devtools_shared_src_constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - -const REACT_TOTAL_NUM_LANES = 31; // Increment this number any time a backwards breaking change is made to the profiler metadata. - -const SCHEDULING_PROFILER_VERSION = 1; -const SNAPSHOT_MAX_HEIGHT = 60; - -/***/ }), - -/***/ 38: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(global) {/* unused harmony export isStringComponentStack */ -/* unused harmony export dangerous_setTargetConsoleForTesting */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return registerRenderer; }); -/* unused harmony export patch */ -/* unused harmony export unpatch */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return patchForStrictMode; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return unpatchForStrictMode; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return patchConsoleUsingWindowValues; }); -/* unused harmony export writeConsolePatchSettingsToWindow */ -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15); -/* harmony import */ var _renderer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(50); -/* harmony import */ var _DevToolsFiberComponentStack__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44); -/* harmony import */ var react_devtools_feature_flags__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(13); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3); -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - - - -const OVERRIDE_CONSOLE_METHODS = ['error', 'trace', 'warn']; -const DIMMED_NODE_CONSOLE_COLOR = '\x1b[2m%s\x1b[0m'; // React's custom built component stack strings match "\s{4}in" -// Chrome's prefix matches "\s{4}at" - -const PREFIX_REGEX = /\s{4}(in|at)\s{1}/; // Firefox and Safari have no prefix ("") -// but we can fallback to looking for location info (e.g. "foo.js:12:345") - -const ROW_COLUMN_NUMBER_REGEX = /:\d+:\d+(\n|$)/; -function isStringComponentStack(text) { - return PREFIX_REGEX.test(text) || ROW_COLUMN_NUMBER_REGEX.test(text); -} -const STYLE_DIRECTIVE_REGEX = /^%c/; // This function tells whether or not the arguments for a console -// method has been overridden by the patchForStrictMode function. -// If it has we'll need to do some special formatting of the arguments -// so the console color stays consistent - -function isStrictModeOverride(args, method) { - return args.length >= 2 && STYLE_DIRECTIVE_REGEX.test(args[0]) && args[1] === `color: ${getConsoleColor(method) || ''}`; -} - -function getConsoleColor(method) { - switch (method) { - case 'warn': - return consoleSettingsRef.browserTheme === 'light' ? "rgba(250, 180, 50, 0.75)" : "rgba(250, 180, 50, 0.5)"; - - case 'error': - return consoleSettingsRef.browserTheme === 'light' ? "rgba(250, 123, 130, 0.75)" : "rgba(250, 123, 130, 0.5)"; - - case 'log': - default: - return consoleSettingsRef.browserTheme === 'light' ? "rgba(125, 125, 125, 0.75)" : "rgba(125, 125, 125, 0.5)"; - } -} - -const injectedRenderers = new Map(); -let targetConsole = console; -let targetConsoleMethods = {}; - -for (const method in console) { - targetConsoleMethods[method] = console[method]; -} - -let unpatchFn = null; -let isNode = false; - -try { - isNode = undefined === global; -} catch (error) {} // Enables e.g. Jest tests to inject a mock console object. - - -function dangerous_setTargetConsoleForTesting(targetConsoleForTesting) { - targetConsole = targetConsoleForTesting; - targetConsoleMethods = {}; - - for (const method in targetConsole) { - targetConsoleMethods[method] = console[method]; - } -} // v16 renderers should use this method to inject internals necessary to generate a component stack. -// These internals will be used if the console is patched. -// Injecting them separately allows the console to easily be patched or un-patched later (at runtime). - -function registerRenderer(renderer, onErrorOrWarning) { - const { - currentDispatcherRef, - getCurrentFiber, - findFiberByHostInstance, - version - } = renderer; // Ignore React v15 and older because they don't expose a component stack anyway. - - if (typeof findFiberByHostInstance !== 'function') { - return; - } // currentDispatcherRef gets injected for v16.8+ to support hooks inspection. - // getCurrentFiber gets injected for v16.9+. - - - if (currentDispatcherRef != null && typeof getCurrentFiber === 'function') { - const { - ReactTypeOfWork - } = Object(_renderer__WEBPACK_IMPORTED_MODULE_1__[/* getInternalReactConstants */ "b"])(version); - injectedRenderers.set(renderer, { - currentDispatcherRef, - getCurrentFiber, - workTagMap: ReactTypeOfWork, - onErrorOrWarning - }); - } -} -const consoleSettingsRef = { - appendComponentStack: false, - breakOnConsoleErrors: false, - showInlineWarningsAndErrors: false, - hideConsoleLogsInStrictMode: false, - browserTheme: 'dark' -}; -// Patches console methods to append component stack for the current fiber. -// Call unpatch() to remove the injected behavior. -function patch({ - appendComponentStack, - breakOnConsoleErrors, - showInlineWarningsAndErrors, - hideConsoleLogsInStrictMode, - browserTheme -}) { - // Settings may change after we've patched the console. - // Using a shared ref allows the patch function to read the latest values. - consoleSettingsRef.appendComponentStack = appendComponentStack; - consoleSettingsRef.breakOnConsoleErrors = breakOnConsoleErrors; - consoleSettingsRef.showInlineWarningsAndErrors = showInlineWarningsAndErrors; - consoleSettingsRef.hideConsoleLogsInStrictMode = hideConsoleLogsInStrictMode; - consoleSettingsRef.browserTheme = browserTheme; - - if (appendComponentStack || breakOnConsoleErrors || showInlineWarningsAndErrors) { - if (unpatchFn !== null) { - // Don't patch twice. - return; - } - - const originalConsoleMethods = {}; - - unpatchFn = () => { - for (const method in originalConsoleMethods) { - try { - targetConsole[method] = originalConsoleMethods[method]; - } catch (error) {} - } - }; - - OVERRIDE_CONSOLE_METHODS.forEach(method => { - try { - const originalMethod = originalConsoleMethods[method] = targetConsole[method].__REACT_DEVTOOLS_ORIGINAL_METHOD__ ? targetConsole[method].__REACT_DEVTOOLS_ORIGINAL_METHOD__ : targetConsole[method]; // $FlowFixMe[missing-local-annot] - - const overrideMethod = (...args) => { - let shouldAppendWarningStack = false; - - if (method !== 'log') { - if (consoleSettingsRef.appendComponentStack) { - const lastArg = args.length > 0 ? args[args.length - 1] : null; - const alreadyHasComponentStack = typeof lastArg === 'string' && isStringComponentStack(lastArg); // If we are ever called with a string that already has a component stack, - // e.g. a React error/warning, don't append a second stack. - - shouldAppendWarningStack = !alreadyHasComponentStack; - } - } - - const shouldShowInlineWarningsAndErrors = consoleSettingsRef.showInlineWarningsAndErrors && (method === 'error' || method === 'warn'); // Search for the first renderer that has a current Fiber. - // We don't handle the edge case of stacks for more than one (e.g. interleaved renderers?) - // eslint-disable-next-line no-for-of-loops/no-for-of-loops - - for (const { - currentDispatcherRef, - getCurrentFiber, - onErrorOrWarning, - workTagMap - } of injectedRenderers.values()) { - const current = getCurrentFiber(); - - if (current != null) { - try { - if (shouldShowInlineWarningsAndErrors) { - // patch() is called by two places: (1) the hook and (2) the renderer backend. - // The backend is what implements a message queue, so it's the only one that injects onErrorOrWarning. - if (typeof onErrorOrWarning === 'function') { - onErrorOrWarning(current, method, // Copy args before we mutate them (e.g. adding the component stack) - args.slice()); - } - } - - if (shouldAppendWarningStack) { - const componentStack = Object(_DevToolsFiberComponentStack__WEBPACK_IMPORTED_MODULE_2__[/* getStackByFiberInDevAndProd */ "b"])(workTagMap, current, currentDispatcherRef); - - if (componentStack !== '') { - if (isStrictModeOverride(args, method)) { - args[0] = `${args[0]} %s`; - args.push(componentStack); - } else { - args.push(componentStack); - } - } - } - } catch (error) { - // Don't let a DevTools or React internal error interfere with logging. - setTimeout(() => { - throw error; - }, 0); - } finally { - break; - } - } - } - - if (consoleSettingsRef.breakOnConsoleErrors) { - // --- Welcome to debugging with React DevTools --- - // This debugger statement means that you've enabled the "break on warnings" feature. - // Use the browser's Call Stack panel to step out of this override function- - // to where the original warning or error was logged. - // eslint-disable-next-line no-debugger - debugger; - } - - originalMethod(...args); - }; - - overrideMethod.__REACT_DEVTOOLS_ORIGINAL_METHOD__ = originalMethod; - originalMethod.__REACT_DEVTOOLS_OVERRIDE_METHOD__ = overrideMethod; - targetConsole[method] = overrideMethod; - } catch (error) {} - }); - } else { - unpatch(); - } -} // Removed component stack patch from console methods. - -function unpatch() { - if (unpatchFn !== null) { - unpatchFn(); - unpatchFn = null; - } -} -let unpatchForStrictModeFn = null; // NOTE: KEEP IN SYNC with src/hook.js:patchConsoleForInitialRenderInStrictMode - -function patchForStrictMode() { - if (react_devtools_feature_flags__WEBPACK_IMPORTED_MODULE_3__[/* consoleManagedByDevToolsDuringStrictMode */ "a"]) { - const overrideConsoleMethods = ['error', 'group', 'groupCollapsed', 'info', 'log', 'trace', 'warn']; - - if (unpatchForStrictModeFn !== null) { - // Don't patch twice. - return; - } - - const originalConsoleMethods = {}; - - unpatchForStrictModeFn = () => { - for (const method in originalConsoleMethods) { - try { - targetConsole[method] = originalConsoleMethods[method]; - } catch (error) {} - } - }; - - overrideConsoleMethods.forEach(method => { - try { - const originalMethod = originalConsoleMethods[method] = targetConsole[method].__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__ ? targetConsole[method].__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__ : targetConsole[method]; // $FlowFixMe[missing-local-annot] - - const overrideMethod = (...args) => { - if (!consoleSettingsRef.hideConsoleLogsInStrictMode) { - // Dim the text color of the double logs if we're not - // hiding them. - if (isNode) { - originalMethod(DIMMED_NODE_CONSOLE_COLOR, Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* format */ "f"])(...args)); - } else { - const color = getConsoleColor(method); - - if (color) { - originalMethod(...Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatWithStyles */ "g"])(args, `color: ${color}`)); - } else { - throw Error('Console color is not defined'); - } - } - } - }; - - overrideMethod.__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__ = originalMethod; - originalMethod.__REACT_DEVTOOLS_STRICT_MODE_OVERRIDE_METHOD__ = overrideMethod; - targetConsole[method] = overrideMethod; - } catch (error) {} - }); - } -} // NOTE: KEEP IN SYNC with src/hook.js:unpatchConsoleForInitialRenderInStrictMode - -function unpatchForStrictMode() { - if (react_devtools_feature_flags__WEBPACK_IMPORTED_MODULE_3__[/* consoleManagedByDevToolsDuringStrictMode */ "a"]) { - if (unpatchForStrictModeFn !== null) { - unpatchForStrictModeFn(); - unpatchForStrictModeFn = null; - } - } -} -function patchConsoleUsingWindowValues() { - var _castBool, _castBool2, _castBool3, _castBool4, _castBrowserTheme; - - const appendComponentStack = (_castBool = Object(_utils__WEBPACK_IMPORTED_MODULE_4__[/* castBool */ "a"])(window.__REACT_DEVTOOLS_APPEND_COMPONENT_STACK__)) !== null && _castBool !== void 0 ? _castBool : true; - const breakOnConsoleErrors = (_castBool2 = Object(_utils__WEBPACK_IMPORTED_MODULE_4__[/* castBool */ "a"])(window.__REACT_DEVTOOLS_BREAK_ON_CONSOLE_ERRORS__)) !== null && _castBool2 !== void 0 ? _castBool2 : false; - const showInlineWarningsAndErrors = (_castBool3 = Object(_utils__WEBPACK_IMPORTED_MODULE_4__[/* castBool */ "a"])(window.__REACT_DEVTOOLS_SHOW_INLINE_WARNINGS_AND_ERRORS__)) !== null && _castBool3 !== void 0 ? _castBool3 : true; - const hideConsoleLogsInStrictMode = (_castBool4 = Object(_utils__WEBPACK_IMPORTED_MODULE_4__[/* castBool */ "a"])(window.__REACT_DEVTOOLS_HIDE_CONSOLE_LOGS_IN_STRICT_MODE__)) !== null && _castBool4 !== void 0 ? _castBool4 : false; - const browserTheme = (_castBrowserTheme = Object(_utils__WEBPACK_IMPORTED_MODULE_4__[/* castBrowserTheme */ "b"])(window.__REACT_DEVTOOLS_BROWSER_THEME__)) !== null && _castBrowserTheme !== void 0 ? _castBrowserTheme : 'dark'; - patch({ - appendComponentStack, - breakOnConsoleErrors, - showInlineWarningsAndErrors, - hideConsoleLogsInStrictMode, - browserTheme - }); -} // After receiving cached console patch settings from React Native, we set them on window. -// When the console is initially patched (in renderer.js and hook.js), these values are read. -// The browser extension (etc.) sets these values on window, but through another method. - -function writeConsolePatchSettingsToWindow(settings) { - window.__REACT_DEVTOOLS_APPEND_COMPONENT_STACK__ = settings.appendComponentStack; - window.__REACT_DEVTOOLS_BREAK_ON_CONSOLE_ERRORS__ = settings.breakOnConsoleErrors; - window.__REACT_DEVTOOLS_SHOW_INLINE_WARNINGS_AND_ERRORS__ = settings.showInlineWarningsAndErrors; - window.__REACT_DEVTOOLS_HIDE_CONSOLE_LOGS_IN_STRICT_MODE__ = settings.hideConsoleLogsInStrictMode; - window.__REACT_DEVTOOLS_BROWSER_THEME__ = settings.browserTheme; -} -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(55))) - -/***/ }), - -/***/ 4: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CONCURRENT_MODE_NUMBER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return CONCURRENT_MODE_SYMBOL_STRING; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return CONTEXT_NUMBER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return CONTEXT_SYMBOL_STRING; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return SERVER_CONTEXT_SYMBOL_STRING; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return DEPRECATED_ASYNC_MODE_SYMBOL_STRING; }); -/* unused harmony export ELEMENT_NUMBER */ -/* unused harmony export ELEMENT_SYMBOL_STRING */ -/* unused harmony export DEBUG_TRACING_MODE_NUMBER */ -/* unused harmony export DEBUG_TRACING_MODE_SYMBOL_STRING */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return FORWARD_REF_NUMBER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return FORWARD_REF_SYMBOL_STRING; }); -/* unused harmony export FRAGMENT_NUMBER */ -/* unused harmony export FRAGMENT_SYMBOL_STRING */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return LAZY_NUMBER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return LAZY_SYMBOL_STRING; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return MEMO_NUMBER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return MEMO_SYMBOL_STRING; }); -/* unused harmony export PORTAL_NUMBER */ -/* unused harmony export PORTAL_SYMBOL_STRING */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return PROFILER_NUMBER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return PROFILER_SYMBOL_STRING; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return PROVIDER_NUMBER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return PROVIDER_SYMBOL_STRING; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return SCOPE_NUMBER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return SCOPE_SYMBOL_STRING; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return STRICT_MODE_NUMBER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return STRICT_MODE_SYMBOL_STRING; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "w", function() { return SUSPENSE_NUMBER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "x", function() { return SUSPENSE_SYMBOL_STRING; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "u", function() { return SUSPENSE_LIST_NUMBER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "v", function() { return SUSPENSE_LIST_SYMBOL_STRING; }); -/* unused harmony export SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED_SYMBOL_STRING */ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ -// This list should be kept updated to reflect additions to 'shared/ReactSymbols'. -// DevTools can't import symbols from 'shared/ReactSymbols' directly for two reasons: -// 1. DevTools requires symbols which may have been deleted in more recent versions (e.g. concurrent mode) -// 2. DevTools must support both Symbol and numeric forms of each symbol; -// Since e.g. standalone DevTools runs in a separate process, it can't rely on its own ES capabilities. -const CONCURRENT_MODE_NUMBER = 0xeacf; -const CONCURRENT_MODE_SYMBOL_STRING = 'Symbol(react.concurrent_mode)'; -const CONTEXT_NUMBER = 0xeace; -const CONTEXT_SYMBOL_STRING = 'Symbol(react.context)'; -const SERVER_CONTEXT_SYMBOL_STRING = 'Symbol(react.server_context)'; -const DEPRECATED_ASYNC_MODE_SYMBOL_STRING = 'Symbol(react.async_mode)'; -const ELEMENT_NUMBER = 0xeac7; -const ELEMENT_SYMBOL_STRING = 'Symbol(react.element)'; -const DEBUG_TRACING_MODE_NUMBER = 0xeae1; -const DEBUG_TRACING_MODE_SYMBOL_STRING = 'Symbol(react.debug_trace_mode)'; -const FORWARD_REF_NUMBER = 0xead0; -const FORWARD_REF_SYMBOL_STRING = 'Symbol(react.forward_ref)'; -const FRAGMENT_NUMBER = 0xeacb; -const FRAGMENT_SYMBOL_STRING = 'Symbol(react.fragment)'; -const LAZY_NUMBER = 0xead4; -const LAZY_SYMBOL_STRING = 'Symbol(react.lazy)'; -const MEMO_NUMBER = 0xead3; -const MEMO_SYMBOL_STRING = 'Symbol(react.memo)'; -const PORTAL_NUMBER = 0xeaca; -const PORTAL_SYMBOL_STRING = 'Symbol(react.portal)'; -const PROFILER_NUMBER = 0xead2; -const PROFILER_SYMBOL_STRING = 'Symbol(react.profiler)'; -const PROVIDER_NUMBER = 0xeacd; -const PROVIDER_SYMBOL_STRING = 'Symbol(react.provider)'; -const SCOPE_NUMBER = 0xead7; -const SCOPE_SYMBOL_STRING = 'Symbol(react.scope)'; -const STRICT_MODE_NUMBER = 0xeacc; -const STRICT_MODE_SYMBOL_STRING = 'Symbol(react.strict_mode)'; -const SUSPENSE_NUMBER = 0xead1; -const SUSPENSE_SYMBOL_STRING = 'Symbol(react.suspense)'; -const SUSPENSE_LIST_NUMBER = 0xead8; -const SUSPENSE_LIST_SYMBOL_STRING = 'Symbol(react.suspense_list)'; -const SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED_SYMBOL_STRING = 'Symbol(react.server_context.defaultValue)'; - -/***/ }), - -/***/ 41: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - // A linked list to keep track of recently-used-ness - -const Yallist = __webpack_require__(63); - -const MAX = Symbol('max'); -const LENGTH = Symbol('length'); -const LENGTH_CALCULATOR = Symbol('lengthCalculator'); -const ALLOW_STALE = Symbol('allowStale'); -const MAX_AGE = Symbol('maxAge'); -const DISPOSE = Symbol('dispose'); -const NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet'); -const LRU_LIST = Symbol('lruList'); -const CACHE = Symbol('cache'); -const UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet'); - -const naiveLength = () => 1; // lruList is a yallist where the head is the youngest -// item, and the tail is the oldest. the list contains the Hit -// objects as the entries. -// Each Hit object has a reference to its Yallist.Node. This -// never changes. -// -// cache is a Map (or PseudoMap) that matches the keys to -// the Yallist.Node object. - - -class LRUCache { - constructor(options) { - if (typeof options === 'number') options = { - max: options - }; - if (!options) options = {}; - if (options.max && (typeof options.max !== 'number' || options.max < 0)) throw new TypeError('max must be a non-negative number'); // Kind of weird to have a default max of Infinity, but oh well. - - const max = this[MAX] = options.max || Infinity; - const lc = options.length || naiveLength; - this[LENGTH_CALCULATOR] = typeof lc !== 'function' ? naiveLength : lc; - this[ALLOW_STALE] = options.stale || false; - if (options.maxAge && typeof options.maxAge !== 'number') throw new TypeError('maxAge must be a number'); - this[MAX_AGE] = options.maxAge || 0; - this[DISPOSE] = options.dispose; - this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false; - this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false; - this.reset(); - } // resize the cache when the max changes. - - - set max(mL) { - if (typeof mL !== 'number' || mL < 0) throw new TypeError('max must be a non-negative number'); - this[MAX] = mL || Infinity; - trim(this); - } - - get max() { - return this[MAX]; - } - - set allowStale(allowStale) { - this[ALLOW_STALE] = !!allowStale; - } - - get allowStale() { - return this[ALLOW_STALE]; - } - - set maxAge(mA) { - if (typeof mA !== 'number') throw new TypeError('maxAge must be a non-negative number'); - this[MAX_AGE] = mA; - trim(this); - } - - get maxAge() { - return this[MAX_AGE]; - } // resize the cache when the lengthCalculator changes. - - - set lengthCalculator(lC) { - if (typeof lC !== 'function') lC = naiveLength; - - if (lC !== this[LENGTH_CALCULATOR]) { - this[LENGTH_CALCULATOR] = lC; - this[LENGTH] = 0; - this[LRU_LIST].forEach(hit => { - hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key); - this[LENGTH] += hit.length; - }); - } - - trim(this); - } - - get lengthCalculator() { - return this[LENGTH_CALCULATOR]; - } - - get length() { - return this[LENGTH]; - } - - get itemCount() { - return this[LRU_LIST].length; - } - - rforEach(fn, thisp) { - thisp = thisp || this; - - for (let walker = this[LRU_LIST].tail; walker !== null;) { - const prev = walker.prev; - forEachStep(this, fn, walker, thisp); - walker = prev; - } - } - - forEach(fn, thisp) { - thisp = thisp || this; - - for (let walker = this[LRU_LIST].head; walker !== null;) { - const next = walker.next; - forEachStep(this, fn, walker, thisp); - walker = next; - } - } - - keys() { - return this[LRU_LIST].toArray().map(k => k.key); - } - - values() { - return this[LRU_LIST].toArray().map(k => k.value); - } - - reset() { - if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) { - this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value)); - } - - this[CACHE] = new Map(); // hash of items by key - - this[LRU_LIST] = new Yallist(); // list of items in order of use recency - - this[LENGTH] = 0; // length of items in the list - } - - dump() { - return this[LRU_LIST].map(hit => isStale(this, hit) ? false : { - k: hit.key, - v: hit.value, - e: hit.now + (hit.maxAge || 0) - }).toArray().filter(h => h); - } - - dumpLru() { - return this[LRU_LIST]; - } - - set(key, value, maxAge) { - maxAge = maxAge || this[MAX_AGE]; - if (maxAge && typeof maxAge !== 'number') throw new TypeError('maxAge must be a number'); - const now = maxAge ? Date.now() : 0; - const len = this[LENGTH_CALCULATOR](value, key); - - if (this[CACHE].has(key)) { - if (len > this[MAX]) { - del(this, this[CACHE].get(key)); - return false; - } - - const node = this[CACHE].get(key); - const item = node.value; // dispose of the old one before overwriting - // split out into 2 ifs for better coverage tracking - - if (this[DISPOSE]) { - if (!this[NO_DISPOSE_ON_SET]) this[DISPOSE](key, item.value); - } - - item.now = now; - item.maxAge = maxAge; - item.value = value; - this[LENGTH] += len - item.length; - item.length = len; - this.get(key); - trim(this); - return true; - } - - const hit = new Entry(key, value, len, now, maxAge); // oversized objects fall out of cache automatically. - - if (hit.length > this[MAX]) { - if (this[DISPOSE]) this[DISPOSE](key, value); - return false; - } - - this[LENGTH] += hit.length; - this[LRU_LIST].unshift(hit); - this[CACHE].set(key, this[LRU_LIST].head); - trim(this); - return true; - } - - has(key) { - if (!this[CACHE].has(key)) return false; - const hit = this[CACHE].get(key).value; - return !isStale(this, hit); - } - - get(key) { - return get(this, key, true); - } - - peek(key) { - return get(this, key, false); - } - - pop() { - const node = this[LRU_LIST].tail; - if (!node) return null; - del(this, node); - return node.value; - } - - del(key) { - del(this, this[CACHE].get(key)); - } - - load(arr) { - // reset the cache - this.reset(); - const now = Date.now(); // A previous serialized cache has the most recent items first - - for (let l = arr.length - 1; l >= 0; l--) { - const hit = arr[l]; - const expiresAt = hit.e || 0; - if (expiresAt === 0) // the item was created without expiration in a non aged cache - this.set(hit.k, hit.v);else { - const maxAge = expiresAt - now; // dont add already expired items - - if (maxAge > 0) { - this.set(hit.k, hit.v, maxAge); - } - } - } - } - - prune() { - this[CACHE].forEach((value, key) => get(this, key, false)); - } - -} - -const get = (self, key, doUse) => { - const node = self[CACHE].get(key); - - if (node) { - const hit = node.value; - - if (isStale(self, hit)) { - del(self, node); - if (!self[ALLOW_STALE]) return undefined; - } else { - if (doUse) { - if (self[UPDATE_AGE_ON_GET]) node.value.now = Date.now(); - self[LRU_LIST].unshiftNode(node); - } - } - - return hit.value; - } -}; - -const isStale = (self, hit) => { - if (!hit || !hit.maxAge && !self[MAX_AGE]) return false; - const diff = Date.now() - hit.now; - return hit.maxAge ? diff > hit.maxAge : self[MAX_AGE] && diff > self[MAX_AGE]; -}; - -const trim = self => { - if (self[LENGTH] > self[MAX]) { - for (let walker = self[LRU_LIST].tail; self[LENGTH] > self[MAX] && walker !== null;) { - // We know that we're about to delete this one, and also - // what the next least recently used key will be, so just - // go ahead and set it now. - const prev = walker.prev; - del(self, walker); - walker = prev; - } - } -}; - -const del = (self, node) => { - if (node) { - const hit = node.value; - if (self[DISPOSE]) self[DISPOSE](hit.key, hit.value); - self[LENGTH] -= hit.length; - self[CACHE].delete(hit.key); - self[LRU_LIST].removeNode(node); - } -}; - -class Entry { - constructor(key, value, length, now, maxAge) { - this.key = key; - this.value = value; - this.length = length; - this.now = now; - this.maxAge = maxAge || 0; - } - -} - -const forEachStep = (self, fn, node, thisp) => { - let hit = node.value; - - if (isStale(self, hit)) { - del(self, node); - if (!self[ALLOW_STALE]) hit = undefined; - } - - if (hit) fn.call(thisp, hit.value, hit.key, self); -}; - -module.exports = LRUCache; - -/***/ }), - -/***/ 44: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ describeFiber; }); -__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ getStackByFiberInDevAndProd; }); - -// EXTERNAL MODULE: ../react-devtools-shared/src/backend/ReactSymbols.js -var ReactSymbols = __webpack_require__(4); - -// CONCATENATED MODULE: ../react-devtools-shared/src/backend/DevToolsConsolePatching.js -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ -// This is a DevTools fork of shared/ConsolePatchingDev. -// The shared console patching code is DEV-only. -// We can't use it since DevTools only ships production builds. -// Helpers to patch console.logs to avoid logging during side-effect free -// replaying on render function. This currently only patches the object -// lazily which won't cover if the log function was extracted eagerly. -// We could also eagerly patch the method. -let disabledDepth = 0; -let prevLog; -let prevInfo; -let prevWarn; -let prevError; -let prevGroup; -let prevGroupCollapsed; -let prevGroupEnd; - -function disabledLog() {} - -disabledLog.__reactDisabledLog = true; -function disableLogs() { - if (disabledDepth === 0) { - /* eslint-disable react-internal/no-production-logging */ - prevLog = console.log; - prevInfo = console.info; - prevWarn = console.warn; - prevError = console.error; - prevGroup = console.group; - prevGroupCollapsed = console.groupCollapsed; - prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099 - - const props = { - configurable: true, - enumerable: true, - value: disabledLog, - writable: true - }; // $FlowFixMe Flow thinks console is immutable. - - Object.defineProperties(console, { - info: props, - log: props, - warn: props, - error: props, - group: props, - groupCollapsed: props, - groupEnd: props - }); - /* eslint-enable react-internal/no-production-logging */ - } - - disabledDepth++; -} -function reenableLogs() { - disabledDepth--; - - if (disabledDepth === 0) { - /* eslint-disable react-internal/no-production-logging */ - const props = { - configurable: true, - enumerable: true, - writable: true - }; // $FlowFixMe Flow thinks console is immutable. - - Object.defineProperties(console, { - log: { ...props, - value: prevLog - }, - info: { ...props, - value: prevInfo - }, - warn: { ...props, - value: prevWarn - }, - error: { ...props, - value: prevError - }, - group: { ...props, - value: prevGroup - }, - groupCollapsed: { ...props, - value: prevGroupCollapsed - }, - groupEnd: { ...props, - value: prevGroupEnd - } - }); - /* eslint-enable react-internal/no-production-logging */ - } - - if (disabledDepth < 0) { - console.error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.'); - } -} -// CONCATENATED MODULE: ../react-devtools-shared/src/backend/DevToolsComponentStackFrame.js -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ -// This is a DevTools fork of ReactComponentStackFrame. -// This fork enables DevTools to use the same "native" component stack format, -// while still maintaining support for multiple renderer versions -// (which use different values for ReactTypeOfWork). - // The shared console patching code is DEV-only. -// We can't use it since DevTools only ships production builds. - - -let prefix; -function describeBuiltInComponentFrame(name, ownerFn) { - if (prefix === undefined) { - // Extract the VM specific prefix used by each line. - try { - throw Error(); - } catch (x) { - const match = x.stack.trim().match(/\n( *(at )?)/); - prefix = match && match[1] || ''; - } - } // We use the prefix to ensure our stacks line up with native stack frames. - - - return '\n' + prefix + name; -} -let reentry = false; -let componentFrameCache; - -if (false) {} - -function describeNativeComponentFrame(fn, construct, currentDispatcherRef) { - // If something asked for a stack inside a fake render, it should get ignored. - if (!fn || reentry) { - return ''; - } - - if (false) {} - - let control; - const previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined. - - Error.prepareStackTrace = undefined; - reentry = true; // Override the dispatcher so effects scheduled by this shallow render are thrown away. - // - // Note that unlike the code this was forked from (in ReactComponentStackFrame) - // DevTools should override the dispatcher even when DevTools is compiled in production mode, - // because the app itself may be in development mode and log errors/warnings. - - const previousDispatcher = currentDispatcherRef.current; - currentDispatcherRef.current = null; - disableLogs(); - - try { - // This should throw. - if (construct) { - // Something should be setting the props in the constructor. - const Fake = function () { - throw Error(); - }; // $FlowFixMe - - - Object.defineProperty(Fake.prototype, 'props', { - set: function () { - // We use a throwing setter instead of frozen or non-writable props - // because that won't throw in a non-strict mode function. - throw Error(); - } - }); - - if (typeof Reflect === 'object' && Reflect.construct) { - // We construct a different control for this case to include any extra - // frames added by the construct call. - try { - Reflect.construct(Fake, []); - } catch (x) { - control = x; - } - - Reflect.construct(fn, [], Fake); - } else { - try { - Fake.call(); - } catch (x) { - control = x; - } // $FlowFixMe[prop-missing] found when upgrading Flow - - - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x) { - control = x; - } - - fn(); - } - } catch (sample) { - // This is inlined manually because closure doesn't do it for us. - if (sample && control && typeof sample.stack === 'string') { - // This extracts the first frame from the sample that isn't also in the control. - // Skipping one frame that we assume is the frame that calls the two. - const sampleLines = sample.stack.split('\n'); - const controlLines = control.stack.split('\n'); - let s = sampleLines.length - 1; - let c = controlLines.length - 1; - - while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { - // We expect at least one stack frame to be shared. - // Typically this will be the root most one. However, stack frames may be - // cut off due to maximum stack limits. In this case, one maybe cut off - // earlier than the other. We assume that the sample is longer or the same - // and there for cut off earlier. So we should find the root most frame in - // the sample somewhere in the control. - c--; - } - - for (; s >= 1 && c >= 0; s--, c--) { - // Next we find the first one that isn't the same which should be the - // frame that called our sample function and the control. - if (sampleLines[s] !== controlLines[c]) { - // In V8, the first line is describing the message but other VMs don't. - // If we're about to return the first line, and the control is also on the same - // line, that's a pretty good indicator that our sample threw at same line as - // the control. I.e. before we entered the sample frame. So we ignore this result. - // This can happen if you passed a class to function component, or non-function. - if (s !== 1 || c !== 1) { - do { - s--; - c--; // We may still have similar intermediate frames from the construct call. - // The next one that isn't the same should be our match though. - - if (c < 0 || sampleLines[s] !== controlLines[c]) { - // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier. - const frame = '\n' + sampleLines[s].replace(' at new ', ' at '); - - if (false) {} // Return the line we found. - - - return frame; - } - } while (s >= 1 && c >= 0); - } - - break; - } - } - } - } finally { - reentry = false; - Error.prepareStackTrace = previousPrepareStackTrace; - currentDispatcherRef.current = previousDispatcher; - reenableLogs(); - } // Fallback to just using the name if we couldn't make it throw. - - - const name = fn ? fn.displayName || fn.name : ''; - const syntheticFrame = name ? describeBuiltInComponentFrame(name) : ''; - - if (false) {} - - return syntheticFrame; -} -function describeClassComponentFrame(ctor, ownerFn, currentDispatcherRef) { - return describeNativeComponentFrame(ctor, true, currentDispatcherRef); -} -function describeFunctionComponentFrame(fn, ownerFn, currentDispatcherRef) { - return describeNativeComponentFrame(fn, false, currentDispatcherRef); -} - -function shouldConstruct(Component) { - const prototype = Component.prototype; - return !!(prototype && prototype.isReactComponent); -} - -function describeUnknownElementTypeFrameInDEV(type, ownerFn, currentDispatcherRef) { - if (true) { - return ''; - } - - if (type == null) { - return ''; - } - - if (typeof type === 'function') { - return describeNativeComponentFrame(type, shouldConstruct(type), currentDispatcherRef); - } - - if (typeof type === 'string') { - return describeBuiltInComponentFrame(type, ownerFn); - } - - switch (type) { - case ReactSymbols["w" /* SUSPENSE_NUMBER */]: - case ReactSymbols["x" /* SUSPENSE_SYMBOL_STRING */]: - return describeBuiltInComponentFrame('Suspense', ownerFn); - - case ReactSymbols["u" /* SUSPENSE_LIST_NUMBER */]: - case ReactSymbols["v" /* SUSPENSE_LIST_SYMBOL_STRING */]: - return describeBuiltInComponentFrame('SuspenseList', ownerFn); - } - - if (typeof type === 'object') { - switch (type.$$typeof) { - case ReactSymbols["f" /* FORWARD_REF_NUMBER */]: - case ReactSymbols["g" /* FORWARD_REF_SYMBOL_STRING */]: - return describeFunctionComponentFrame(type.render, ownerFn, currentDispatcherRef); - - case ReactSymbols["j" /* MEMO_NUMBER */]: - case ReactSymbols["k" /* MEMO_SYMBOL_STRING */]: - // Memo may contain any component type so we recursively resolve it. - return describeUnknownElementTypeFrameInDEV(type.type, ownerFn, currentDispatcherRef); - - case ReactSymbols["h" /* LAZY_NUMBER */]: - case ReactSymbols["i" /* LAZY_SYMBOL_STRING */]: - { - const lazyComponent = type; - const payload = lazyComponent._payload; - const init = lazyComponent._init; - - try { - // Lazy may contain any component type so we recursively resolve it. - return describeUnknownElementTypeFrameInDEV(init(payload), ownerFn, currentDispatcherRef); - } catch (x) {} - } - } - } - - return ''; -} -// CONCATENATED MODULE: ../react-devtools-shared/src/backend/DevToolsFiberComponentStack.js -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ -// This is a DevTools fork of ReactFiberComponentStack. -// This fork enables DevTools to use the same "native" component stack format, -// while still maintaining support for multiple renderer versions -// (which use different values for ReactTypeOfWork). - -function describeFiber(workTagMap, workInProgress, currentDispatcherRef) { - const { - HostComponent, - LazyComponent, - SuspenseComponent, - SuspenseListComponent, - FunctionComponent, - IndeterminateComponent, - SimpleMemoComponent, - ForwardRef, - ClassComponent - } = workTagMap; - const owner = false ? undefined : null; - - switch (workInProgress.tag) { - case HostComponent: - return describeBuiltInComponentFrame(workInProgress.type, owner); - - case LazyComponent: - return describeBuiltInComponentFrame('Lazy', owner); - - case SuspenseComponent: - return describeBuiltInComponentFrame('Suspense', owner); - - case SuspenseListComponent: - return describeBuiltInComponentFrame('SuspenseList', owner); - - case FunctionComponent: - case IndeterminateComponent: - case SimpleMemoComponent: - return describeFunctionComponentFrame(workInProgress.type, owner, currentDispatcherRef); - - case ForwardRef: - return describeFunctionComponentFrame(workInProgress.type.render, owner, currentDispatcherRef); - - case ClassComponent: - return describeClassComponentFrame(workInProgress.type, owner, currentDispatcherRef); - - default: - return ''; - } -} -function getStackByFiberInDevAndProd(workTagMap, workInProgress, currentDispatcherRef) { - try { - let info = ''; - let node = workInProgress; - - do { - info += describeFiber(workTagMap, node, currentDispatcherRef); // $FlowFixMe[incompatible-type] we bail out when we get a null - - node = node.return; - } while (node); - - return info; - } catch (x) { - return '\nError generating stack: ' + x.message + '\n' + x.stack; - } -} - -/***/ }), - -/***/ 48: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ -// $FlowFixMe[method-unbinding] -const hasOwnProperty = Object.prototype.hasOwnProperty; -/* harmony default export */ __webpack_exports__["a"] = (hasOwnProperty); - -/***/ }), - -/***/ 50: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ getInternalReactConstants; }); -__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ attach; }); - -// EXTERNAL MODULE: ../react-devtools-shared/node_modules/semver/semver.js -var semver = __webpack_require__(26); - -// EXTERNAL MODULE: ../react-devtools-shared/src/types.js -var types = __webpack_require__(2); - -// EXTERNAL MODULE: ../react-devtools-shared/src/utils.js + 1 modules -var utils = __webpack_require__(3); - -// EXTERNAL MODULE: ../react-devtools-shared/src/storage.js -var storage = __webpack_require__(8); - -// EXTERNAL MODULE: ../react-devtools-shared/src/backend/utils.js -var backend_utils = __webpack_require__(15); - -// EXTERNAL MODULE: ../react-devtools-shared/src/constants.js -var constants = __webpack_require__(1); - -// EXTERNAL MODULE: /Users/mengdi/workspace/git/react/build/oss-experimental/react-debug-tools/index.js -var react_debug_tools = __webpack_require__(67); - -// EXTERNAL MODULE: ../react-devtools-shared/src/backend/console.js -var backend_console = __webpack_require__(38); - -// EXTERNAL MODULE: ../react-devtools-shared/src/backend/ReactSymbols.js -var ReactSymbols = __webpack_require__(4); - -// CONCATENATED MODULE: ../react-devtools-shared/src/backend/ReactFiberFlags.js -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ -// This list of flags must be synced with the following file: -// https://github.com/facebook/react/blob/main/packages/react-reconciler/src/ReactFiberFlags.js -const NoFlags = -/* */ -0b000000000000000000000000000; -const PerformedWork = -/* */ -0b000000000000000000000000001; -const Placement = -/* */ -0b000000000000000000000000010; -const DidCapture = -/* */ -0b000000000000000000010000000; -const Hydrating = -/* */ -0b000000000000001000000000000; -// EXTERNAL MODULE: ../react-devtools-shared/src/config/DevToolsFeatureFlags.extension-oss.js -var DevToolsFeatureFlags_extension_oss = __webpack_require__(13); - -// CONCATENATED MODULE: ../shared/objectIs.js -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - -/** - * inlined Object.is polyfill to avoid requiring consumers ship their own - * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is - */ -function is(x, y) { - return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare - ; -} - -const objectIs = // $FlowFixMe[method-unbinding] -typeof Object.is === 'function' ? Object.is : is; -/* harmony default export */ var shared_objectIs = (objectIs); -// EXTERNAL MODULE: ../shared/hasOwnProperty.js -var shared_hasOwnProperty = __webpack_require__(48); - -// EXTERNAL MODULE: ../react-devtools-shared/src/isArray.js -var isArray = __webpack_require__(17); - -// CONCATENATED MODULE: ../react-devtools-shared/src/backend/StyleX/utils.js -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - -const cachedStyleNameToValueMap = new Map(); -function getStyleXData(data) { - const sources = new Set(); - const resolvedStyles = {}; - crawlData(data, sources, resolvedStyles); - return { - sources: Array.from(sources).sort(), - resolvedStyles - }; -} -function crawlData(data, sources, resolvedStyles) { - if (data == null) { - return; - } - - if (Object(isArray["a" /* default */])(data)) { - data.forEach(entry => { - if (entry == null) { - return; - } - - if (Object(isArray["a" /* default */])(entry)) { - crawlData(entry, sources, resolvedStyles); - } else { - crawlObjectProperties(entry, sources, resolvedStyles); - } - }); - } else { - crawlObjectProperties(data, sources, resolvedStyles); - } - - resolvedStyles = Object.fromEntries(Object.entries(resolvedStyles).sort()); -} - -function crawlObjectProperties(entry, sources, resolvedStyles) { - const keys = Object.keys(entry); - keys.forEach(key => { - const value = entry[key]; - - if (typeof value === 'string') { - if (key === value) { - // Special case; this key is the name of the style's source/file/module. - sources.add(key); - } else { - resolvedStyles[key] = getPropertyValueForStyleName(value); - } - } else { - const nestedStyle = {}; - resolvedStyles[key] = nestedStyle; - crawlData([value], sources, nestedStyle); - } - }); -} - -function getPropertyValueForStyleName(styleName) { - if (cachedStyleNameToValueMap.has(styleName)) { - return cachedStyleNameToValueMap.get(styleName); - } - - for (let styleSheetIndex = 0; styleSheetIndex < document.styleSheets.length; styleSheetIndex++) { - const styleSheet = document.styleSheets[styleSheetIndex]; // $FlowFixMe Flow doesn't konw about these properties - - const rules = styleSheet.rules || styleSheet.cssRules; // $FlowFixMe `rules` is mixed - - for (let ruleIndex = 0; ruleIndex < rules.length; ruleIndex++) { - // $FlowFixMe `rules` is mixed - const rule = rules[ruleIndex]; // $FlowFixMe Flow doesn't konw about these properties - - const { - cssText, - selectorText, - style - } = rule; - - if (selectorText != null) { - if (selectorText.startsWith(`.${styleName}`)) { - const match = cssText.match(/{ *([a-z\-]+):/); - - if (match !== null) { - const property = match[1]; - const value = style.getPropertyValue(property); - cachedStyleNameToValueMap.set(styleName, value); - return value; - } else { - return null; - } - } - } - } - } - - return null; -} -// EXTERNAL MODULE: ../shared/isArray.js -var shared_isArray = __webpack_require__(23); - -// EXTERNAL MODULE: ../react-devtools-timeline/src/constants.js -var src_constants = __webpack_require__(33); - -// EXTERNAL MODULE: ../react-devtools-shared/src/backend/DevToolsFiberComponentStack.js + 2 modules -var DevToolsFiberComponentStack = __webpack_require__(44); - -// CONCATENATED MODULE: ../react-devtools-shared/src/backend/profilingHooks.js -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - // Add padding to the start/stop time of the profile. -// This makes the UI nicer to use. - -const TIME_OFFSET = 10; -let performanceTarget = null; // If performance exists and supports the subset of the User Timing API that we require. - -let supportsUserTiming = typeof performance !== 'undefined' && // $FlowFixMe[method-unbinding] -typeof performance.mark === 'function' && // $FlowFixMe[method-unbinding] -typeof performance.clearMarks === 'function'; -let supportsUserTimingV3 = false; - -if (supportsUserTiming) { - const CHECK_V3_MARK = '__v3'; - const markOptions = {}; - Object.defineProperty(markOptions, 'startTime', { - get: function () { - supportsUserTimingV3 = true; - return 0; - }, - set: function () {} - }); - - try { - // $FlowFixMe: Flow expects the User Timing level 2 API. - performance.mark(CHECK_V3_MARK, markOptions); - } catch (error) {// Ignore - } finally { - performance.clearMarks(CHECK_V3_MARK); - } -} - -if (supportsUserTimingV3) { - performanceTarget = performance; -} // Some environments (e.g. React Native / Hermes) don't support the performance API yet. - - -const getCurrentTime = // $FlowFixMe[method-unbinding] -typeof performance === 'object' && typeof performance.now === 'function' ? () => performance.now() : () => Date.now(); // Mocking the Performance Object (and User Timing APIs) for testing is fragile. -// This API allows tests to directly override the User Timing APIs. - -function setPerformanceMock_ONLY_FOR_TESTING(performanceMock) { - performanceTarget = performanceMock; - supportsUserTiming = performanceMock !== null; - supportsUserTimingV3 = performanceMock !== null; -} -function createProfilingHooks({ - getDisplayNameForFiber, - getIsProfiling, - getLaneLabelMap, - workTagMap, - currentDispatcherRef, - reactVersion -}) { - let currentBatchUID = 0; - let currentReactComponentMeasure = null; - let currentReactMeasuresStack = []; - let currentTimelineData = null; - let currentFiberStacks = new Map(); - let isProfiling = false; - let nextRenderShouldStartNewBatch = false; - - function getRelativeTime() { - const currentTime = getCurrentTime(); - - if (currentTimelineData) { - if (currentTimelineData.startTime === 0) { - currentTimelineData.startTime = currentTime - TIME_OFFSET; - } - - return currentTime - currentTimelineData.startTime; - } - - return 0; - } - - function getInternalModuleRanges() { - /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ - if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.getInternalModuleRanges === 'function') { - // Ask the DevTools hook for module ranges that may have been reported by the current renderer(s). - // Don't do this eagerly like the laneToLabelMap, - // because some modules might not yet have registered their boundaries when the renderer is injected. - const ranges = __REACT_DEVTOOLS_GLOBAL_HOOK__.getInternalModuleRanges(); // This check would not be required, - // except that it's possible for things to override __REACT_DEVTOOLS_GLOBAL_HOOK__. - - - if (Object(shared_isArray["a" /* default */])(ranges)) { - return ranges; - } - } - - return null; - } - - function getTimelineData() { - return currentTimelineData; - } - - function laneToLanesArray(lanes) { - const lanesArray = []; - let lane = 1; - - for (let index = 0; index < src_constants["a" /* REACT_TOTAL_NUM_LANES */]; index++) { - if (lane & lanes) { - lanesArray.push(lane); - } - - lane *= 2; - } - - return lanesArray; - } - - const laneToLabelMap = typeof getLaneLabelMap === 'function' ? getLaneLabelMap() : null; - - function markMetadata() { - markAndClear(`--react-version-${reactVersion}`); - markAndClear(`--profiler-version-${src_constants["b" /* SCHEDULING_PROFILER_VERSION */]}`); - const ranges = getInternalModuleRanges(); - - if (ranges) { - for (let i = 0; i < ranges.length; i++) { - const range = ranges[i]; - - if (Object(shared_isArray["a" /* default */])(range) && range.length === 2) { - const [startStackFrame, stopStackFrame] = ranges[i]; - markAndClear(`--react-internal-module-start-${startStackFrame}`); - markAndClear(`--react-internal-module-stop-${stopStackFrame}`); - } - } - } - - if (laneToLabelMap != null) { - const labels = Array.from(laneToLabelMap.values()).join(','); - markAndClear(`--react-lane-labels-${labels}`); - } - } - - function markAndClear(markName) { - // This method won't be called unless these functions are defined, so we can skip the extra typeof check. - performanceTarget.mark(markName); - performanceTarget.clearMarks(markName); - } - - function recordReactMeasureStarted(type, lanes) { - // Decide what depth thi work should be rendered at, based on what's on the top of the stack. - // It's okay to render over top of "idle" work but everything else should be on its own row. - let depth = 0; - - if (currentReactMeasuresStack.length > 0) { - const top = currentReactMeasuresStack[currentReactMeasuresStack.length - 1]; - depth = top.type === 'render-idle' ? top.depth : top.depth + 1; - } - - const lanesArray = laneToLanesArray(lanes); - const reactMeasure = { - type, - batchUID: currentBatchUID, - depth, - lanes: lanesArray, - timestamp: getRelativeTime(), - duration: 0 - }; - currentReactMeasuresStack.push(reactMeasure); - - if (currentTimelineData) { - const { - batchUIDToMeasuresMap, - laneToReactMeasureMap - } = currentTimelineData; - let reactMeasures = batchUIDToMeasuresMap.get(currentBatchUID); - - if (reactMeasures != null) { - reactMeasures.push(reactMeasure); - } else { - batchUIDToMeasuresMap.set(currentBatchUID, [reactMeasure]); - } - - lanesArray.forEach(lane => { - reactMeasures = laneToReactMeasureMap.get(lane); - - if (reactMeasures) { - reactMeasures.push(reactMeasure); - } - }); - } - } - - function recordReactMeasureCompleted(type) { - const currentTime = getRelativeTime(); - - if (currentReactMeasuresStack.length === 0) { - console.error('Unexpected type "%s" completed at %sms while currentReactMeasuresStack is empty.', type, currentTime); // Ignore work "completion" user timing mark that doesn't complete anything - - return; - } - - const top = currentReactMeasuresStack.pop(); - - if (top.type !== type) { - console.error('Unexpected type "%s" completed at %sms before "%s" completed.', type, currentTime, top.type); - } // $FlowFixMe This property should not be writable outside of this function. - - - top.duration = currentTime - top.timestamp; - - if (currentTimelineData) { - currentTimelineData.duration = getRelativeTime() + TIME_OFFSET; - } - } - - function markCommitStarted(lanes) { - if (isProfiling) { - recordReactMeasureStarted('commit', lanes); // TODO (timeline) Re-think this approach to "batching"; I don't think it works for Suspense or pre-rendering. - // This issue applies to the User Timing data also. - - nextRenderShouldStartNewBatch = true; - } - - if (supportsUserTimingV3) { - markAndClear(`--commit-start-${lanes}`); // Some metadata only needs to be logged once per session, - // but if profiling information is being recorded via the Performance tab, - // DevTools has no way of knowing when the recording starts. - // Because of that, we log thie type of data periodically (once per commit). - - markMetadata(); - } - } - - function markCommitStopped() { - if (isProfiling) { - recordReactMeasureCompleted('commit'); - recordReactMeasureCompleted('render-idle'); - } - - if (supportsUserTimingV3) { - markAndClear('--commit-stop'); - } - } - - function markComponentRenderStarted(fiber) { - if (isProfiling || supportsUserTimingV3) { - const componentName = getDisplayNameForFiber(fiber) || 'Unknown'; - - if (isProfiling) { - // TODO (timeline) Record and cache component stack - if (isProfiling) { - currentReactComponentMeasure = { - componentName, - duration: 0, - timestamp: getRelativeTime(), - type: 'render', - warning: null - }; - } - } - - if (supportsUserTimingV3) { - markAndClear(`--component-render-start-${componentName}`); - } - } - } - - function markComponentRenderStopped() { - if (isProfiling) { - if (currentReactComponentMeasure) { - if (currentTimelineData) { - currentTimelineData.componentMeasures.push(currentReactComponentMeasure); - } // $FlowFixMe[incompatible-use] found when upgrading Flow - - - currentReactComponentMeasure.duration = // $FlowFixMe[incompatible-use] found when upgrading Flow - getRelativeTime() - currentReactComponentMeasure.timestamp; - currentReactComponentMeasure = null; - } - } - - if (supportsUserTimingV3) { - markAndClear('--component-render-stop'); - } - } - - function markComponentLayoutEffectMountStarted(fiber) { - if (isProfiling || supportsUserTimingV3) { - const componentName = getDisplayNameForFiber(fiber) || 'Unknown'; - - if (isProfiling) { - // TODO (timeline) Record and cache component stack - if (isProfiling) { - currentReactComponentMeasure = { - componentName, - duration: 0, - timestamp: getRelativeTime(), - type: 'layout-effect-mount', - warning: null - }; - } - } - - if (supportsUserTimingV3) { - markAndClear(`--component-layout-effect-mount-start-${componentName}`); - } - } - } - - function markComponentLayoutEffectMountStopped() { - if (isProfiling) { - if (currentReactComponentMeasure) { - if (currentTimelineData) { - currentTimelineData.componentMeasures.push(currentReactComponentMeasure); - } // $FlowFixMe[incompatible-use] found when upgrading Flow - - - currentReactComponentMeasure.duration = // $FlowFixMe[incompatible-use] found when upgrading Flow - getRelativeTime() - currentReactComponentMeasure.timestamp; - currentReactComponentMeasure = null; - } - } - - if (supportsUserTimingV3) { - markAndClear('--component-layout-effect-mount-stop'); - } - } - - function markComponentLayoutEffectUnmountStarted(fiber) { - if (isProfiling || supportsUserTimingV3) { - const componentName = getDisplayNameForFiber(fiber) || 'Unknown'; - - if (isProfiling) { - // TODO (timeline) Record and cache component stack - if (isProfiling) { - currentReactComponentMeasure = { - componentName, - duration: 0, - timestamp: getRelativeTime(), - type: 'layout-effect-unmount', - warning: null - }; - } - } - - if (supportsUserTimingV3) { - markAndClear(`--component-layout-effect-unmount-start-${componentName}`); - } - } - } - - function markComponentLayoutEffectUnmountStopped() { - if (isProfiling) { - if (currentReactComponentMeasure) { - if (currentTimelineData) { - currentTimelineData.componentMeasures.push(currentReactComponentMeasure); - } // $FlowFixMe[incompatible-use] found when upgrading Flow - - - currentReactComponentMeasure.duration = // $FlowFixMe[incompatible-use] found when upgrading Flow - getRelativeTime() - currentReactComponentMeasure.timestamp; - currentReactComponentMeasure = null; - } - } - - if (supportsUserTimingV3) { - markAndClear('--component-layout-effect-unmount-stop'); - } - } - - function markComponentPassiveEffectMountStarted(fiber) { - if (isProfiling || supportsUserTimingV3) { - const componentName = getDisplayNameForFiber(fiber) || 'Unknown'; - - if (isProfiling) { - // TODO (timeline) Record and cache component stack - if (isProfiling) { - currentReactComponentMeasure = { - componentName, - duration: 0, - timestamp: getRelativeTime(), - type: 'passive-effect-mount', - warning: null - }; - } - } - - if (supportsUserTimingV3) { - markAndClear(`--component-passive-effect-mount-start-${componentName}`); - } - } - } - - function markComponentPassiveEffectMountStopped() { - if (isProfiling) { - if (currentReactComponentMeasure) { - if (currentTimelineData) { - currentTimelineData.componentMeasures.push(currentReactComponentMeasure); - } // $FlowFixMe[incompatible-use] found when upgrading Flow - - - currentReactComponentMeasure.duration = // $FlowFixMe[incompatible-use] found when upgrading Flow - getRelativeTime() - currentReactComponentMeasure.timestamp; - currentReactComponentMeasure = null; - } - } - - if (supportsUserTimingV3) { - markAndClear('--component-passive-effect-mount-stop'); - } - } - - function markComponentPassiveEffectUnmountStarted(fiber) { - if (isProfiling || supportsUserTimingV3) { - const componentName = getDisplayNameForFiber(fiber) || 'Unknown'; - - if (isProfiling) { - // TODO (timeline) Record and cache component stack - if (isProfiling) { - currentReactComponentMeasure = { - componentName, - duration: 0, - timestamp: getRelativeTime(), - type: 'passive-effect-unmount', - warning: null - }; - } - } - - if (supportsUserTimingV3) { - markAndClear(`--component-passive-effect-unmount-start-${componentName}`); - } - } - } - - function markComponentPassiveEffectUnmountStopped() { - if (isProfiling) { - if (currentReactComponentMeasure) { - if (currentTimelineData) { - currentTimelineData.componentMeasures.push(currentReactComponentMeasure); - } // $FlowFixMe[incompatible-use] found when upgrading Flow - - - currentReactComponentMeasure.duration = // $FlowFixMe[incompatible-use] found when upgrading Flow - getRelativeTime() - currentReactComponentMeasure.timestamp; - currentReactComponentMeasure = null; - } - } - - if (supportsUserTimingV3) { - markAndClear('--component-passive-effect-unmount-stop'); - } - } - - function markComponentErrored(fiber, thrownValue, lanes) { - if (isProfiling || supportsUserTimingV3) { - const componentName = getDisplayNameForFiber(fiber) || 'Unknown'; - const phase = fiber.alternate === null ? 'mount' : 'update'; - let message = ''; - - if (thrownValue !== null && typeof thrownValue === 'object' && typeof thrownValue.message === 'string') { - message = thrownValue.message; - } else if (typeof thrownValue === 'string') { - message = thrownValue; - } - - if (isProfiling) { - // TODO (timeline) Record and cache component stack - if (currentTimelineData) { - currentTimelineData.thrownErrors.push({ - componentName, - message, - phase, - timestamp: getRelativeTime(), - type: 'thrown-error' - }); - } - } - - if (supportsUserTimingV3) { - markAndClear(`--error-${componentName}-${phase}-${message}`); - } - } - } - - const PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; // $FlowFixMe: Flow cannot handle polymorphic WeakMaps - - const wakeableIDs = new PossiblyWeakMap(); - let wakeableID = 0; - - function getWakeableID(wakeable) { - if (!wakeableIDs.has(wakeable)) { - wakeableIDs.set(wakeable, wakeableID++); - } - - return wakeableIDs.get(wakeable); - } - - function markComponentSuspended(fiber, wakeable, lanes) { - if (isProfiling || supportsUserTimingV3) { - const eventType = wakeableIDs.has(wakeable) ? 'resuspend' : 'suspend'; - const id = getWakeableID(wakeable); - const componentName = getDisplayNameForFiber(fiber) || 'Unknown'; - const phase = fiber.alternate === null ? 'mount' : 'update'; // Following the non-standard fn.displayName convention, - // frameworks like Relay may also annotate Promises with a displayName, - // describing what operation/data the thrown Promise is related to. - // When this is available we should pass it along to the Timeline. - - const displayName = wakeable.displayName || ''; - let suspenseEvent = null; - - if (isProfiling) { - // TODO (timeline) Record and cache component stack - suspenseEvent = { - componentName, - depth: 0, - duration: 0, - id: `${id}`, - phase, - promiseName: displayName, - resolution: 'unresolved', - timestamp: getRelativeTime(), - type: 'suspense', - warning: null - }; - - if (currentTimelineData) { - currentTimelineData.suspenseEvents.push(suspenseEvent); - } - } - - if (supportsUserTimingV3) { - markAndClear(`--suspense-${eventType}-${id}-${componentName}-${phase}-${lanes}-${displayName}`); - } - - wakeable.then(() => { - if (suspenseEvent) { - suspenseEvent.duration = getRelativeTime() - suspenseEvent.timestamp; - suspenseEvent.resolution = 'resolved'; - } - - if (supportsUserTimingV3) { - markAndClear(`--suspense-resolved-${id}-${componentName}`); - } - }, () => { - if (suspenseEvent) { - suspenseEvent.duration = getRelativeTime() - suspenseEvent.timestamp; - suspenseEvent.resolution = 'rejected'; - } - - if (supportsUserTimingV3) { - markAndClear(`--suspense-rejected-${id}-${componentName}`); - } - }); - } - } - - function markLayoutEffectsStarted(lanes) { - if (isProfiling) { - recordReactMeasureStarted('layout-effects', lanes); - } - - if (supportsUserTimingV3) { - markAndClear(`--layout-effects-start-${lanes}`); - } - } - - function markLayoutEffectsStopped() { - if (isProfiling) { - recordReactMeasureCompleted('layout-effects'); - } - - if (supportsUserTimingV3) { - markAndClear('--layout-effects-stop'); - } - } - - function markPassiveEffectsStarted(lanes) { - if (isProfiling) { - recordReactMeasureStarted('passive-effects', lanes); - } - - if (supportsUserTimingV3) { - markAndClear(`--passive-effects-start-${lanes}`); - } - } - - function markPassiveEffectsStopped() { - if (isProfiling) { - recordReactMeasureCompleted('passive-effects'); - } - - if (supportsUserTimingV3) { - markAndClear('--passive-effects-stop'); - } - } - - function markRenderStarted(lanes) { - if (isProfiling) { - if (nextRenderShouldStartNewBatch) { - nextRenderShouldStartNewBatch = false; - currentBatchUID++; - } // If this is a new batch of work, wrap an "idle" measure around it. - // Log it before the "render" measure to preserve the stack ordering. - - - if (currentReactMeasuresStack.length === 0 || currentReactMeasuresStack[currentReactMeasuresStack.length - 1].type !== 'render-idle') { - recordReactMeasureStarted('render-idle', lanes); - } - - recordReactMeasureStarted('render', lanes); - } - - if (supportsUserTimingV3) { - markAndClear(`--render-start-${lanes}`); - } - } - - function markRenderYielded() { - if (isProfiling) { - recordReactMeasureCompleted('render'); - } - - if (supportsUserTimingV3) { - markAndClear('--render-yield'); - } - } - - function markRenderStopped() { - if (isProfiling) { - recordReactMeasureCompleted('render'); - } - - if (supportsUserTimingV3) { - markAndClear('--render-stop'); - } - } - - function markRenderScheduled(lane) { - if (isProfiling) { - if (currentTimelineData) { - currentTimelineData.schedulingEvents.push({ - lanes: laneToLanesArray(lane), - timestamp: getRelativeTime(), - type: 'schedule-render', - warning: null - }); - } - } - - if (supportsUserTimingV3) { - markAndClear(`--schedule-render-${lane}`); - } - } - - function markForceUpdateScheduled(fiber, lane) { - if (isProfiling || supportsUserTimingV3) { - const componentName = getDisplayNameForFiber(fiber) || 'Unknown'; - - if (isProfiling) { - // TODO (timeline) Record and cache component stack - if (currentTimelineData) { - currentTimelineData.schedulingEvents.push({ - componentName, - lanes: laneToLanesArray(lane), - timestamp: getRelativeTime(), - type: 'schedule-force-update', - warning: null - }); - } - } - - if (supportsUserTimingV3) { - markAndClear(`--schedule-forced-update-${lane}-${componentName}`); - } - } - } - - function getParentFibers(fiber) { - const parents = []; - let parent = fiber; - - while (parent !== null) { - parents.push(parent); - parent = parent.return; - } - - return parents; - } - - function markStateUpdateScheduled(fiber, lane) { - if (isProfiling || supportsUserTimingV3) { - const componentName = getDisplayNameForFiber(fiber) || 'Unknown'; - - if (isProfiling) { - // TODO (timeline) Record and cache component stack - if (currentTimelineData) { - const event = { - componentName, - // Store the parent fibers so we can post process - // them after we finish profiling - lanes: laneToLanesArray(lane), - timestamp: getRelativeTime(), - type: 'schedule-state-update', - warning: null - }; - currentFiberStacks.set(event, getParentFibers(fiber)); // $FlowFixMe[incompatible-use] found when upgrading Flow - - currentTimelineData.schedulingEvents.push(event); - } - } - - if (supportsUserTimingV3) { - markAndClear(`--schedule-state-update-${lane}-${componentName}`); - } - } - } - - function toggleProfilingStatus(value) { - if (isProfiling !== value) { - isProfiling = value; - - if (isProfiling) { - const internalModuleSourceToRanges = new Map(); - - if (supportsUserTimingV3) { - const ranges = getInternalModuleRanges(); - - if (ranges) { - for (let i = 0; i < ranges.length; i++) { - const range = ranges[i]; - - if (Object(shared_isArray["a" /* default */])(range) && range.length === 2) { - const [startStackFrame, stopStackFrame] = ranges[i]; - markAndClear(`--react-internal-module-start-${startStackFrame}`); - markAndClear(`--react-internal-module-stop-${stopStackFrame}`); - } - } - } - } - - const laneToReactMeasureMap = new Map(); - let lane = 1; - - for (let index = 0; index < src_constants["a" /* REACT_TOTAL_NUM_LANES */]; index++) { - laneToReactMeasureMap.set(lane, []); - lane *= 2; - } - - currentBatchUID = 0; - currentReactComponentMeasure = null; - currentReactMeasuresStack = []; - currentFiberStacks = new Map(); - currentTimelineData = { - // Session wide metadata; only collected once. - internalModuleSourceToRanges, - laneToLabelMap: laneToLabelMap || new Map(), - reactVersion, - // Data logged by React during profiling session. - componentMeasures: [], - schedulingEvents: [], - suspenseEvents: [], - thrownErrors: [], - // Data inferred based on what React logs. - batchUIDToMeasuresMap: new Map(), - duration: 0, - laneToReactMeasureMap, - startTime: 0, - // Data only available in Chrome profiles. - flamechart: [], - nativeEvents: [], - networkMeasures: [], - otherUserTimingMarks: [], - snapshots: [], - snapshotHeight: 0 - }; - nextRenderShouldStartNewBatch = true; - } else { - // Postprocess Profile data - if (currentTimelineData !== null) { - currentTimelineData.schedulingEvents.forEach(event => { - if (event.type === 'schedule-state-update') { - // TODO(luna): We can optimize this by creating a map of - // fiber to component stack instead of generating the stack - // for every fiber every time - const fiberStack = currentFiberStacks.get(event); - - if (fiberStack && currentDispatcherRef != null) { - event.componentStack = fiberStack.reduce((trace, fiber) => { - return trace + Object(DevToolsFiberComponentStack["a" /* describeFiber */])(workTagMap, fiber, currentDispatcherRef); - }, ''); - } - } - }); - } // Clear the current fiber stacks so we don't hold onto the fibers - // in memory after profiling finishes - - - currentFiberStacks.clear(); - } - } - } - - return { - getTimelineData, - profilingHooks: { - markCommitStarted, - markCommitStopped, - markComponentRenderStarted, - markComponentRenderStopped, - markComponentPassiveEffectMountStarted, - markComponentPassiveEffectMountStopped, - markComponentPassiveEffectUnmountStarted, - markComponentPassiveEffectUnmountStopped, - markComponentLayoutEffectMountStarted, - markComponentLayoutEffectMountStopped, - markComponentLayoutEffectUnmountStarted, - markComponentLayoutEffectUnmountStopped, - markComponentErrored, - markComponentSuspended, - markLayoutEffectsStarted, - markLayoutEffectsStopped, - markPassiveEffectsStarted, - markPassiveEffectsStopped, - markRenderStarted, - markRenderYielded, - markRenderStopped, - markRenderScheduled, - markForceUpdateScheduled, - markStateUpdateScheduled - }, - toggleProfilingStatus - }; -} -// CONCATENATED MODULE: ../react-devtools-shared/src/backend/renderer.js -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - - - - - - - - - - - - - - - -function getFiberFlags(fiber) { - // The name of this field changed from "effectTag" to "flags" - return fiber.flags !== undefined ? fiber.flags : fiber.effectTag; -} // Some environments (e.g. React Native / Hermes) don't support the performance API yet. - - -const renderer_getCurrentTime = // $FlowFixMe[method-unbinding] -typeof performance === 'object' && typeof performance.now === 'function' ? () => performance.now() : () => Date.now(); -function getInternalReactConstants(version) { - // ********************************************************** - // The section below is copied from files in React repo. - // Keep it in sync, and add version guards if it changes. - // - // Technically these priority levels are invalid for versions before 16.9, - // but 16.9 is the first version to report priority level to DevTools, - // so we can avoid checking for earlier versions and support pre-16.9 canary releases in the process. - let ReactPriorityLevels = { - ImmediatePriority: 99, - UserBlockingPriority: 98, - NormalPriority: 97, - LowPriority: 96, - IdlePriority: 95, - NoPriority: 90 - }; - - if (Object(semver["gt"])(version, '17.0.2')) { - ReactPriorityLevels = { - ImmediatePriority: 1, - UserBlockingPriority: 2, - NormalPriority: 3, - LowPriority: 4, - IdlePriority: 5, - NoPriority: 0 - }; - } - - let StrictModeBits = 0; - - if (Object(semver["gte"])(version, '18.0.0-alpha')) { - // 18+ - StrictModeBits = 0b011000; - } else if (Object(semver["gte"])(version, '16.9.0')) { - // 16.9 - 17 - StrictModeBits = 0b1; - } else if (Object(semver["gte"])(version, '16.3.0')) { - // 16.3 - 16.8 - StrictModeBits = 0b10; - } - - let ReactTypeOfWork = null; // ********************************************************** - // The section below is copied from files in React repo. - // Keep it in sync, and add version guards if it changes. - // - // TODO Update the gt() check below to be gte() whichever the next version number is. - // Currently the version in Git is 17.0.2 (but that version has not been/may not end up being released). - - if (Object(semver["gt"])(version, '17.0.1')) { - ReactTypeOfWork = { - CacheComponent: 24, - // Experimental - ClassComponent: 1, - ContextConsumer: 9, - ContextProvider: 10, - CoroutineComponent: -1, - // Removed - CoroutineHandlerPhase: -1, - // Removed - DehydratedSuspenseComponent: 18, - // Behind a flag - ForwardRef: 11, - Fragment: 7, - FunctionComponent: 0, - HostComponent: 5, - HostPortal: 4, - HostRoot: 3, - HostResource: 26, - // In reality, 18.2+. But doesn't hurt to include it here - HostSingleton: 27, - // Same as above - HostText: 6, - IncompleteClassComponent: 17, - IndeterminateComponent: 2, - LazyComponent: 16, - LegacyHiddenComponent: 23, - MemoComponent: 14, - Mode: 8, - OffscreenComponent: 22, - // Experimental - Profiler: 12, - ScopeComponent: 21, - // Experimental - SimpleMemoComponent: 15, - SuspenseComponent: 13, - SuspenseListComponent: 19, - // Experimental - TracingMarkerComponent: 25, - // Experimental - This is technically in 18 but we don't - // want to fork again so we're adding it here instead - YieldComponent: -1 // Removed - - }; - } else if (Object(semver["gte"])(version, '17.0.0-alpha')) { - ReactTypeOfWork = { - CacheComponent: -1, - // Doesn't exist yet - ClassComponent: 1, - ContextConsumer: 9, - ContextProvider: 10, - CoroutineComponent: -1, - // Removed - CoroutineHandlerPhase: -1, - // Removed - DehydratedSuspenseComponent: 18, - // Behind a flag - ForwardRef: 11, - Fragment: 7, - FunctionComponent: 0, - HostComponent: 5, - HostPortal: 4, - HostRoot: 3, - HostResource: -1, - // Doesn't exist yet - HostSingleton: -1, - // Doesn't exist yet - HostText: 6, - IncompleteClassComponent: 17, - IndeterminateComponent: 2, - LazyComponent: 16, - LegacyHiddenComponent: 24, - MemoComponent: 14, - Mode: 8, - OffscreenComponent: 23, - // Experimental - Profiler: 12, - ScopeComponent: 21, - // Experimental - SimpleMemoComponent: 15, - SuspenseComponent: 13, - SuspenseListComponent: 19, - // Experimental - TracingMarkerComponent: -1, - // Doesn't exist yet - YieldComponent: -1 // Removed - - }; - } else if (Object(semver["gte"])(version, '16.6.0-beta.0')) { - ReactTypeOfWork = { - CacheComponent: -1, - // Doesn't exist yet - ClassComponent: 1, - ContextConsumer: 9, - ContextProvider: 10, - CoroutineComponent: -1, - // Removed - CoroutineHandlerPhase: -1, - // Removed - DehydratedSuspenseComponent: 18, - // Behind a flag - ForwardRef: 11, - Fragment: 7, - FunctionComponent: 0, - HostComponent: 5, - HostPortal: 4, - HostRoot: 3, - HostResource: -1, - // Doesn't exist yet - HostSingleton: -1, - // Doesn't exist yet - HostText: 6, - IncompleteClassComponent: 17, - IndeterminateComponent: 2, - LazyComponent: 16, - LegacyHiddenComponent: -1, - MemoComponent: 14, - Mode: 8, - OffscreenComponent: -1, - // Experimental - Profiler: 12, - ScopeComponent: -1, - // Experimental - SimpleMemoComponent: 15, - SuspenseComponent: 13, - SuspenseListComponent: 19, - // Experimental - TracingMarkerComponent: -1, - // Doesn't exist yet - YieldComponent: -1 // Removed - - }; - } else if (Object(semver["gte"])(version, '16.4.3-alpha')) { - ReactTypeOfWork = { - CacheComponent: -1, - // Doesn't exist yet - ClassComponent: 2, - ContextConsumer: 11, - ContextProvider: 12, - CoroutineComponent: -1, - // Removed - CoroutineHandlerPhase: -1, - // Removed - DehydratedSuspenseComponent: -1, - // Doesn't exist yet - ForwardRef: 13, - Fragment: 9, - FunctionComponent: 0, - HostComponent: 7, - HostPortal: 6, - HostRoot: 5, - HostResource: -1, - // Doesn't exist yet - HostSingleton: -1, - // Doesn't exist yet - HostText: 8, - IncompleteClassComponent: -1, - // Doesn't exist yet - IndeterminateComponent: 4, - LazyComponent: -1, - // Doesn't exist yet - LegacyHiddenComponent: -1, - MemoComponent: -1, - // Doesn't exist yet - Mode: 10, - OffscreenComponent: -1, - // Experimental - Profiler: 15, - ScopeComponent: -1, - // Experimental - SimpleMemoComponent: -1, - // Doesn't exist yet - SuspenseComponent: 16, - SuspenseListComponent: -1, - // Doesn't exist yet - TracingMarkerComponent: -1, - // Doesn't exist yet - YieldComponent: -1 // Removed - - }; - } else { - ReactTypeOfWork = { - CacheComponent: -1, - // Doesn't exist yet - ClassComponent: 2, - ContextConsumer: 12, - ContextProvider: 13, - CoroutineComponent: 7, - CoroutineHandlerPhase: 8, - DehydratedSuspenseComponent: -1, - // Doesn't exist yet - ForwardRef: 14, - Fragment: 10, - FunctionComponent: 1, - HostComponent: 5, - HostPortal: 4, - HostRoot: 3, - HostResource: -1, - // Doesn't exist yet - HostSingleton: -1, - // Doesn't exist yet - HostText: 6, - IncompleteClassComponent: -1, - // Doesn't exist yet - IndeterminateComponent: 0, - LazyComponent: -1, - // Doesn't exist yet - LegacyHiddenComponent: -1, - MemoComponent: -1, - // Doesn't exist yet - Mode: 11, - OffscreenComponent: -1, - // Experimental - Profiler: 15, - ScopeComponent: -1, - // Experimental - SimpleMemoComponent: -1, - // Doesn't exist yet - SuspenseComponent: 16, - SuspenseListComponent: -1, - // Doesn't exist yet - TracingMarkerComponent: -1, - // Doesn't exist yet - YieldComponent: 9 - }; - } // ********************************************************** - // End of copied code. - // ********************************************************** - - - function getTypeSymbol(type) { - const symbolOrNumber = typeof type === 'object' && type !== null ? type.$$typeof : type; - return typeof symbolOrNumber === 'symbol' ? // $FlowFixMe `toString()` doesn't match the type signature? - symbolOrNumber.toString() : symbolOrNumber; - } - - const { - CacheComponent, - ClassComponent, - IncompleteClassComponent, - FunctionComponent, - IndeterminateComponent, - ForwardRef, - HostRoot, - HostResource, - HostSingleton, - HostComponent, - HostPortal, - HostText, - Fragment, - LazyComponent, - LegacyHiddenComponent, - MemoComponent, - OffscreenComponent, - Profiler, - ScopeComponent, - SimpleMemoComponent, - SuspenseComponent, - SuspenseListComponent, - TracingMarkerComponent - } = ReactTypeOfWork; - - function resolveFiberType(type) { - const typeSymbol = getTypeSymbol(type); - - switch (typeSymbol) { - case ReactSymbols["j" /* MEMO_NUMBER */]: - case ReactSymbols["k" /* MEMO_SYMBOL_STRING */]: - // recursively resolving memo type in case of memo(forwardRef(Component)) - return resolveFiberType(type.type); - - case ReactSymbols["f" /* FORWARD_REF_NUMBER */]: - case ReactSymbols["g" /* FORWARD_REF_SYMBOL_STRING */]: - return type.render; - - default: - return type; - } - } // NOTICE Keep in sync with shouldFilterFiber() and other get*ForFiber methods - - - function getDisplayNameForFiber(fiber) { - const { - elementType, - type, - tag - } = fiber; - let resolvedType = type; - - if (typeof type === 'object' && type !== null) { - resolvedType = resolveFiberType(type); - } - - let resolvedContext = null; - - switch (tag) { - case CacheComponent: - return 'Cache'; - - case ClassComponent: - case IncompleteClassComponent: - return Object(utils["k" /* getDisplayName */])(resolvedType); - - case FunctionComponent: - case IndeterminateComponent: - return Object(utils["k" /* getDisplayName */])(resolvedType); - - case ForwardRef: - return Object(utils["s" /* getWrappedDisplayName */])(elementType, resolvedType, 'ForwardRef', 'Anonymous'); - - case HostRoot: - const fiberRoot = fiber.stateNode; - - if (fiberRoot != null && fiberRoot._debugRootType !== null) { - return fiberRoot._debugRootType; - } - - return null; - - case HostComponent: - case HostSingleton: - case HostResource: - return type; - - case HostPortal: - case HostText: - return null; - - case Fragment: - return 'Fragment'; - - case LazyComponent: - // This display name will not be user visible. - // Once a Lazy component loads its inner component, React replaces the tag and type. - // This display name will only show up in console logs when DevTools DEBUG mode is on. - return 'Lazy'; - - case MemoComponent: - case SimpleMemoComponent: - // Display name in React does not use `Memo` as a wrapper but fallback name. - return Object(utils["s" /* getWrappedDisplayName */])(elementType, resolvedType, 'Memo', 'Anonymous'); - - case SuspenseComponent: - return 'Suspense'; - - case LegacyHiddenComponent: - return 'LegacyHidden'; - - case OffscreenComponent: - return 'Offscreen'; - - case ScopeComponent: - return 'Scope'; - - case SuspenseListComponent: - return 'SuspenseList'; - - case Profiler: - return 'Profiler'; - - case TracingMarkerComponent: - return 'TracingMarker'; - - default: - const typeSymbol = getTypeSymbol(type); - - switch (typeSymbol) { - case ReactSymbols["a" /* CONCURRENT_MODE_NUMBER */]: - case ReactSymbols["b" /* CONCURRENT_MODE_SYMBOL_STRING */]: - case ReactSymbols["e" /* DEPRECATED_ASYNC_MODE_SYMBOL_STRING */]: - return null; - - case ReactSymbols["n" /* PROVIDER_NUMBER */]: - case ReactSymbols["o" /* PROVIDER_SYMBOL_STRING */]: - // 16.3.0 exposed the context object as "context" - // PR #12501 changed it to "_context" for 16.3.1+ - // NOTE Keep in sync with inspectElementRaw() - resolvedContext = fiber.type._context || fiber.type.context; - return `${resolvedContext.displayName || 'Context'}.Provider`; - - case ReactSymbols["c" /* CONTEXT_NUMBER */]: - case ReactSymbols["d" /* CONTEXT_SYMBOL_STRING */]: - case ReactSymbols["r" /* SERVER_CONTEXT_SYMBOL_STRING */]: - // 16.3-16.5 read from "type" because the Consumer is the actual context object. - // 16.6+ should read from "type._context" because Consumer can be different (in DEV). - // NOTE Keep in sync with inspectElementRaw() - resolvedContext = fiber.type._context || fiber.type; // NOTE: TraceUpdatesBackendManager depends on the name ending in '.Consumer' - // If you change the name, figure out a more resilient way to detect it. - - return `${resolvedContext.displayName || 'Context'}.Consumer`; - - case ReactSymbols["s" /* STRICT_MODE_NUMBER */]: - case ReactSymbols["t" /* STRICT_MODE_SYMBOL_STRING */]: - return null; - - case ReactSymbols["l" /* PROFILER_NUMBER */]: - case ReactSymbols["m" /* PROFILER_SYMBOL_STRING */]: - return `Profiler(${fiber.memoizedProps.id})`; - - case ReactSymbols["p" /* SCOPE_NUMBER */]: - case ReactSymbols["q" /* SCOPE_SYMBOL_STRING */]: - return 'Scope'; - - default: - // Unknown element type. - // This may mean a new element type that has not yet been added to DevTools. - return null; - } - - } - } - - return { - getDisplayNameForFiber, - getTypeSymbol, - ReactPriorityLevels, - ReactTypeOfWork, - StrictModeBits - }; -} // Map of one or more Fibers in a pair to their unique id number. -// We track both Fibers to support Fast Refresh, -// which may forcefully replace one of the pair as part of hot reloading. -// In that case it's still important to be able to locate the previous ID during subsequent renders. - -const fiberToIDMap = new Map(); // Map of id to one (arbitrary) Fiber in a pair. -// This Map is used to e.g. get the display name for a Fiber or schedule an update, -// operations that should be the same whether the current and work-in-progress Fiber is used. - -const idToArbitraryFiberMap = new Map(); -function attach(hook, rendererID, renderer, global) { - // Newer versions of the reconciler package also specific reconciler version. - // If that version number is present, use it. - // Third party renderer versions may not match the reconciler version, - // and the latter is what's important in terms of tags and symbols. - const version = renderer.reconcilerVersion || renderer.version; - const { - getDisplayNameForFiber, - getTypeSymbol, - ReactPriorityLevels, - ReactTypeOfWork, - StrictModeBits - } = getInternalReactConstants(version); - const { - CacheComponent, - ClassComponent, - ContextConsumer, - DehydratedSuspenseComponent, - ForwardRef, - Fragment, - FunctionComponent, - HostRoot, - HostResource, - HostSingleton, - HostPortal, - HostComponent, - HostText, - IncompleteClassComponent, - IndeterminateComponent, - LegacyHiddenComponent, - MemoComponent, - OffscreenComponent, - SimpleMemoComponent, - SuspenseComponent, - SuspenseListComponent, - TracingMarkerComponent - } = ReactTypeOfWork; - const { - ImmediatePriority, - UserBlockingPriority, - NormalPriority, - LowPriority, - IdlePriority, - NoPriority - } = ReactPriorityLevels; - const { - getLaneLabelMap, - injectProfilingHooks, - overrideHookState, - overrideHookStateDeletePath, - overrideHookStateRenamePath, - overrideProps, - overridePropsDeletePath, - overridePropsRenamePath, - scheduleRefresh, - setErrorHandler, - setSuspenseHandler, - scheduleUpdate - } = renderer; - const supportsTogglingError = typeof setErrorHandler === 'function' && typeof scheduleUpdate === 'function'; - const supportsTogglingSuspense = typeof setSuspenseHandler === 'function' && typeof scheduleUpdate === 'function'; - - if (typeof scheduleRefresh === 'function') { - // When Fast Refresh updates a component, the frontend may need to purge cached information. - // For example, ASTs cached for the component (for named hooks) may no longer be valid. - // Send a signal to the frontend to purge this cached information. - // The "fastRefreshScheduled" dispatched is global (not Fiber or even Renderer specific). - // This is less effecient since it means the front-end will need to purge the entire cache, - // but this is probably an okay trade off in order to reduce coupling between the DevTools and Fast Refresh. - renderer.scheduleRefresh = (...args) => { - try { - hook.emit('fastRefreshScheduled'); - } finally { - return scheduleRefresh(...args); - } - }; - } - - let getTimelineData = null; - let toggleProfilingStatus = null; - - if (typeof injectProfilingHooks === 'function') { - const response = createProfilingHooks({ - getDisplayNameForFiber, - getIsProfiling: () => isProfiling, - getLaneLabelMap, - currentDispatcherRef: renderer.currentDispatcherRef, - workTagMap: ReactTypeOfWork, - reactVersion: version - }); // Pass the Profiling hooks to the reconciler for it to call during render. - - injectProfilingHooks(response.profilingHooks); // Hang onto this toggle so we can notify the external methods of profiling status changes. - - getTimelineData = response.getTimelineData; - toggleProfilingStatus = response.toggleProfilingStatus; - } // Tracks Fibers with recently changed number of error/warning messages. - // These collections store the Fiber rather than the ID, - // in order to avoid generating an ID for Fibers that never get mounted - // (due to e.g. Suspense or error boundaries). - // onErrorOrWarning() adds Fibers and recordPendingErrorsAndWarnings() later clears them. - - - const fibersWithChangedErrorOrWarningCounts = new Set(); - const pendingFiberToErrorsMap = new Map(); - const pendingFiberToWarningsMap = new Map(); // Mapping of fiber IDs to error/warning messages and counts. - - const fiberIDToErrorsMap = new Map(); - const fiberIDToWarningsMap = new Map(); - - function clearErrorsAndWarnings() { - // eslint-disable-next-line no-for-of-loops/no-for-of-loops - for (const id of fiberIDToErrorsMap.keys()) { - const fiber = idToArbitraryFiberMap.get(id); - - if (fiber != null) { - fibersWithChangedErrorOrWarningCounts.add(fiber); - updateMostRecentlyInspectedElementIfNecessary(id); - } - } // eslint-disable-next-line no-for-of-loops/no-for-of-loops - - - for (const id of fiberIDToWarningsMap.keys()) { - const fiber = idToArbitraryFiberMap.get(id); - - if (fiber != null) { - fibersWithChangedErrorOrWarningCounts.add(fiber); - updateMostRecentlyInspectedElementIfNecessary(id); - } - } - - fiberIDToErrorsMap.clear(); - fiberIDToWarningsMap.clear(); - flushPendingEvents(); - } - - function clearMessageCountHelper(fiberID, pendingFiberToMessageCountMap, fiberIDToMessageCountMap) { - const fiber = idToArbitraryFiberMap.get(fiberID); - - if (fiber != null) { - // Throw out any pending changes. - pendingFiberToErrorsMap.delete(fiber); - - if (fiberIDToMessageCountMap.has(fiberID)) { - fiberIDToMessageCountMap.delete(fiberID); // If previous flushed counts have changed, schedule an update too. - - fibersWithChangedErrorOrWarningCounts.add(fiber); - flushPendingEvents(); - updateMostRecentlyInspectedElementIfNecessary(fiberID); - } else { - fibersWithChangedErrorOrWarningCounts.delete(fiber); - } - } - } - - function clearErrorsForFiberID(fiberID) { - clearMessageCountHelper(fiberID, pendingFiberToErrorsMap, fiberIDToErrorsMap); - } - - function clearWarningsForFiberID(fiberID) { - clearMessageCountHelper(fiberID, pendingFiberToWarningsMap, fiberIDToWarningsMap); - } - - function updateMostRecentlyInspectedElementIfNecessary(fiberID) { - if (mostRecentlyInspectedElement !== null && mostRecentlyInspectedElement.id === fiberID) { - hasElementUpdatedSinceLastInspected = true; - } - } // Called when an error or warning is logged during render, commit, or passive (including unmount functions). - - - function onErrorOrWarning(fiber, type, args) { - if (type === 'error') { - const maybeID = getFiberIDUnsafe(fiber); // if this is an error simulated by us to trigger error boundary, ignore - - if (maybeID != null && forceErrorForFiberIDs.get(maybeID) === true) { - return; - } - } - - const message = Object(backend_utils["f" /* format */])(...args); - - if (constants["F" /* __DEBUG__ */]) { - debug('onErrorOrWarning', fiber, null, `${type}: "${message}"`); - } // Mark this Fiber as needed its warning/error count updated during the next flush. - - - fibersWithChangedErrorOrWarningCounts.add(fiber); // Track the warning/error for later. - - const fiberMap = type === 'error' ? pendingFiberToErrorsMap : pendingFiberToWarningsMap; - const messageMap = fiberMap.get(fiber); - - if (messageMap != null) { - const count = messageMap.get(message) || 0; - messageMap.set(message, count + 1); - } else { - fiberMap.set(fiber, new Map([[message, 1]])); - } // Passive effects may trigger errors or warnings too; - // In this case, we should wait until the rest of the passive effects have run, - // but we shouldn't wait until the next commit because that might be a long time. - // This would also cause "tearing" between an inspected Component and the tree view. - // Then again we don't want to flush too soon because this could be an error during async rendering. - // Use a debounce technique to ensure that we'll eventually flush. - - - flushPendingErrorsAndWarningsAfterDelay(); - } // Patching the console enables DevTools to do a few useful things: - // * Append component stacks to warnings and error messages - // * Disable logging during re-renders to inspect hooks (see inspectHooksOfFiber) - - - Object(backend_console["c" /* registerRenderer */])(renderer, onErrorOrWarning); // The renderer interface can't read these preferences directly, - // because it is stored in localStorage within the context of the extension. - // It relies on the extension to pass the preference through via the global. - - Object(backend_console["a" /* patchConsoleUsingWindowValues */])(); - - const debug = (name, fiber, parentFiber, extraString = '') => { - if (constants["F" /* __DEBUG__ */]) { - const displayName = fiber.tag + ':' + (getDisplayNameForFiber(fiber) || 'null'); - const maybeID = getFiberIDUnsafe(fiber) || ''; - const parentDisplayName = parentFiber ? parentFiber.tag + ':' + (getDisplayNameForFiber(parentFiber) || 'null') : ''; - const maybeParentID = parentFiber ? getFiberIDUnsafe(parentFiber) || '' : ''; - console.groupCollapsed(`[renderer] %c${name} %c${displayName} (${maybeID}) %c${parentFiber ? `${parentDisplayName} (${maybeParentID})` : ''} %c${extraString}`, 'color: red; font-weight: bold;', 'color: blue;', 'color: purple;', 'color: black;'); - console.log(new Error().stack.split('\n').slice(1).join('\n')); - console.groupEnd(); - } - }; // Configurable Components tree filters. - - - const hideElementsWithDisplayNames = new Set(); - const hideElementsWithPaths = new Set(); - const hideElementsWithTypes = new Set(); // Highlight updates - - let traceUpdatesEnabled = false; - const traceUpdatesForNodes = new Set(); - - function applyComponentFilters(componentFilters) { - hideElementsWithTypes.clear(); - hideElementsWithDisplayNames.clear(); - hideElementsWithPaths.clear(); - componentFilters.forEach(componentFilter => { - if (!componentFilter.isEnabled) { - return; - } - - switch (componentFilter.type) { - case types["a" /* ComponentFilterDisplayName */]: - if (componentFilter.isValid && componentFilter.value !== '') { - hideElementsWithDisplayNames.add(new RegExp(componentFilter.value, 'i')); - } - - break; - - case types["b" /* ComponentFilterElementType */]: - hideElementsWithTypes.add(componentFilter.value); - break; - - case types["d" /* ComponentFilterLocation */]: - if (componentFilter.isValid && componentFilter.value !== '') { - hideElementsWithPaths.add(new RegExp(componentFilter.value, 'i')); - } - - break; - - case types["c" /* ComponentFilterHOC */]: - hideElementsWithDisplayNames.add(new RegExp('\\(')); - break; - - default: - console.warn(`Invalid component filter type "${componentFilter.type}"`); - break; - } - }); - } // The renderer interface can't read saved component filters directly, - // because they are stored in localStorage within the context of the extension. - // Instead it relies on the extension to pass filters through. - - - if (window.__REACT_DEVTOOLS_COMPONENT_FILTERS__ != null) { - applyComponentFilters(window.__REACT_DEVTOOLS_COMPONENT_FILTERS__); - } else { - // Unfortunately this feature is not expected to work for React Native for now. - // It would be annoying for us to spam YellowBox warnings with unactionable stuff, - // so for now just skip this message... - //console.warn('⚛️ DevTools: Could not locate saved component filters'); - // Fallback to assuming the default filters in this case. - applyComponentFilters(Object(utils["i" /* getDefaultComponentFilters */])()); - } // If necessary, we can revisit optimizing this operation. - // For example, we could add a new recursive unmount tree operation. - // The unmount operations are already significantly smaller than mount operations though. - // This is something to keep in mind for later. - - - function updateComponentFilters(componentFilters) { - if (isProfiling) { - // Re-mounting a tree while profiling is in progress might break a lot of assumptions. - // If necessary, we could support this- but it doesn't seem like a necessary use case. - throw Error('Cannot modify filter preferences while profiling'); - } // Recursively unmount all roots. - - - hook.getFiberRoots(rendererID).forEach(root => { - currentRootID = getOrGenerateFiberID(root.current); // The TREE_OPERATION_REMOVE_ROOT operation serves two purposes: - // 1. It avoids sending unnecessary bridge traffic to clear a root. - // 2. It preserves Fiber IDs when remounting (below) which in turn ID to error/warning mapping. - - pushOperation(constants["z" /* TREE_OPERATION_REMOVE_ROOT */]); - flushPendingEvents(root); - currentRootID = -1; - }); - applyComponentFilters(componentFilters); // Reset pseudo counters so that new path selections will be persisted. - - rootDisplayNameCounter.clear(); // Recursively re-mount all roots with new filter criteria applied. - - hook.getFiberRoots(rendererID).forEach(root => { - currentRootID = getOrGenerateFiberID(root.current); - setRootPseudoKey(currentRootID, root.current); - mountFiberRecursively(root.current, null, false, false); - flushPendingEvents(root); - currentRootID = -1; - }); // Also re-evaluate all error and warning counts given the new filters. - - reevaluateErrorsAndWarnings(); - flushPendingEvents(); - } // NOTICE Keep in sync with get*ForFiber methods - - - function shouldFilterFiber(fiber) { - const { - _debugSource, - tag, - type, - key - } = fiber; - - switch (tag) { - case DehydratedSuspenseComponent: - // TODO: ideally we would show dehydrated Suspense immediately. - // However, it has some special behavior (like disconnecting - // an alternate and turning into real Suspense) which breaks DevTools. - // For now, ignore it, and only show it once it gets hydrated. - // https://github.com/bvaughn/react-devtools-experimental/issues/197 - return true; - - case HostPortal: - case HostText: - case LegacyHiddenComponent: - case OffscreenComponent: - return true; - - case HostRoot: - // It is never valid to filter the root element. - return false; - - case Fragment: - return key === null; - - default: - const typeSymbol = getTypeSymbol(type); - - switch (typeSymbol) { - case ReactSymbols["a" /* CONCURRENT_MODE_NUMBER */]: - case ReactSymbols["b" /* CONCURRENT_MODE_SYMBOL_STRING */]: - case ReactSymbols["e" /* DEPRECATED_ASYNC_MODE_SYMBOL_STRING */]: - case ReactSymbols["s" /* STRICT_MODE_NUMBER */]: - case ReactSymbols["t" /* STRICT_MODE_SYMBOL_STRING */]: - return true; - - default: - break; - } - - } - - const elementType = getElementTypeForFiber(fiber); - - if (hideElementsWithTypes.has(elementType)) { - return true; - } - - if (hideElementsWithDisplayNames.size > 0) { - const displayName = getDisplayNameForFiber(fiber); - - if (displayName != null) { - // eslint-disable-next-line no-for-of-loops/no-for-of-loops - for (const displayNameRegExp of hideElementsWithDisplayNames) { - if (displayNameRegExp.test(displayName)) { - return true; - } - } - } - } - - if (_debugSource != null && hideElementsWithPaths.size > 0) { - const { - fileName - } = _debugSource; // eslint-disable-next-line no-for-of-loops/no-for-of-loops - - for (const pathRegExp of hideElementsWithPaths) { - if (pathRegExp.test(fileName)) { - return true; - } - } - } - - return false; - } // NOTICE Keep in sync with shouldFilterFiber() and other get*ForFiber methods - - - function getElementTypeForFiber(fiber) { - const { - type, - tag - } = fiber; - - switch (tag) { - case ClassComponent: - case IncompleteClassComponent: - return types["e" /* ElementTypeClass */]; - - case FunctionComponent: - case IndeterminateComponent: - return types["h" /* ElementTypeFunction */]; - - case ForwardRef: - return types["g" /* ElementTypeForwardRef */]; - - case HostRoot: - return types["m" /* ElementTypeRoot */]; - - case HostComponent: - case HostResource: - case HostSingleton: - return types["i" /* ElementTypeHostComponent */]; - - case HostPortal: - case HostText: - case Fragment: - return types["k" /* ElementTypeOtherOrUnknown */]; - - case MemoComponent: - case SimpleMemoComponent: - return types["j" /* ElementTypeMemo */]; - - case SuspenseComponent: - return types["n" /* ElementTypeSuspense */]; - - case SuspenseListComponent: - return types["o" /* ElementTypeSuspenseList */]; - - case TracingMarkerComponent: - return types["p" /* ElementTypeTracingMarker */]; - - default: - const typeSymbol = getTypeSymbol(type); - - switch (typeSymbol) { - case ReactSymbols["a" /* CONCURRENT_MODE_NUMBER */]: - case ReactSymbols["b" /* CONCURRENT_MODE_SYMBOL_STRING */]: - case ReactSymbols["e" /* DEPRECATED_ASYNC_MODE_SYMBOL_STRING */]: - return types["k" /* ElementTypeOtherOrUnknown */]; - - case ReactSymbols["n" /* PROVIDER_NUMBER */]: - case ReactSymbols["o" /* PROVIDER_SYMBOL_STRING */]: - return types["f" /* ElementTypeContext */]; - - case ReactSymbols["c" /* CONTEXT_NUMBER */]: - case ReactSymbols["d" /* CONTEXT_SYMBOL_STRING */]: - return types["f" /* ElementTypeContext */]; - - case ReactSymbols["s" /* STRICT_MODE_NUMBER */]: - case ReactSymbols["t" /* STRICT_MODE_SYMBOL_STRING */]: - return types["k" /* ElementTypeOtherOrUnknown */]; - - case ReactSymbols["l" /* PROFILER_NUMBER */]: - case ReactSymbols["m" /* PROFILER_SYMBOL_STRING */]: - return types["l" /* ElementTypeProfiler */]; - - default: - return types["k" /* ElementTypeOtherOrUnknown */]; - } - - } - } // When profiling is supported, we store the latest tree base durations for each Fiber. - // This is so that we can quickly capture a snapshot of those values if profiling starts. - // If we didn't store these values, we'd have to crawl the tree when profiling started, - // and use a slow path to find each of the current Fibers. - - - const idToTreeBaseDurationMap = new Map(); // When profiling is supported, we store the latest tree base durations for each Fiber. - // This map enables us to filter these times by root when sending them to the frontend. - - const idToRootMap = new Map(); // When a mount or update is in progress, this value tracks the root that is being operated on. - - let currentRootID = -1; // Returns the unique ID for a Fiber or generates and caches a new one if the Fiber hasn't been seen before. - // Once this method has been called for a Fiber, untrackFiberID() should always be called later to avoid leaking. - - function getOrGenerateFiberID(fiber) { - let id = null; - - if (fiberToIDMap.has(fiber)) { - id = fiberToIDMap.get(fiber); - } else { - const { - alternate - } = fiber; - - if (alternate !== null && fiberToIDMap.has(alternate)) { - id = fiberToIDMap.get(alternate); - } - } - - let didGenerateID = false; - - if (id === null) { - didGenerateID = true; - id = Object(utils["r" /* getUID */])(); - } // This refinement is for Flow purposes only. - - - const refinedID = id; // Make sure we're tracking this Fiber - // e.g. if it just mounted or an error was logged during initial render. - - if (!fiberToIDMap.has(fiber)) { - fiberToIDMap.set(fiber, refinedID); - idToArbitraryFiberMap.set(refinedID, fiber); - } // Also make sure we're tracking its alternate, - // e.g. in case this is the first update after mount. - - - const { - alternate - } = fiber; - - if (alternate !== null) { - if (!fiberToIDMap.has(alternate)) { - fiberToIDMap.set(alternate, refinedID); - } - } - - if (constants["F" /* __DEBUG__ */]) { - if (didGenerateID) { - debug('getOrGenerateFiberID()', fiber, fiber.return, 'Generated a new UID'); - } - } - - return refinedID; - } // Returns an ID if one has already been generated for the Fiber or throws. - - - function getFiberIDThrows(fiber) { - const maybeID = getFiberIDUnsafe(fiber); - - if (maybeID !== null) { - return maybeID; - } - - throw Error(`Could not find ID for Fiber "${getDisplayNameForFiber(fiber) || ''}"`); - } // Returns an ID if one has already been generated for the Fiber or null if one has not been generated. - // Use this method while e.g. logging to avoid over-retaining Fibers. - - - function getFiberIDUnsafe(fiber) { - if (fiberToIDMap.has(fiber)) { - return fiberToIDMap.get(fiber); - } else { - const { - alternate - } = fiber; - - if (alternate !== null && fiberToIDMap.has(alternate)) { - return fiberToIDMap.get(alternate); - } - } - - return null; - } // Removes a Fiber (and its alternate) from the Maps used to track their id. - // This method should always be called when a Fiber is unmounting. - - - function untrackFiberID(fiber) { - if (constants["F" /* __DEBUG__ */]) { - debug('untrackFiberID()', fiber, fiber.return, 'schedule after delay'); - } // Untrack Fibers after a slight delay in order to support a Fast Refresh edge case: - // 1. Component type is updated and Fast Refresh schedules an update+remount. - // 2. flushPendingErrorsAndWarningsAfterDelay() runs, sees the old Fiber is no longer mounted - // (it's been disconnected by Fast Refresh), and calls untrackFiberID() to clear it from the Map. - // 3. React flushes pending passive effects before it runs the next render, - // which logs an error or warning, which causes a new ID to be generated for this Fiber. - // 4. DevTools now tries to unmount the old Component with the new ID. - // - // The underlying problem here is the premature clearing of the Fiber ID, - // but DevTools has no way to detect that a given Fiber has been scheduled for Fast Refresh. - // (The "_debugNeedsRemount" flag won't necessarily be set.) - // - // The best we can do is to delay untracking by a small amount, - // and give React time to process the Fast Refresh delay. - - - untrackFibersSet.add(fiber); // React may detach alternate pointers during unmount; - // Since our untracking code is async, we should explicily track the pending alternate here as well. - - const alternate = fiber.alternate; - - if (alternate !== null) { - untrackFibersSet.add(alternate); - } - - if (untrackFibersTimeoutID === null) { - untrackFibersTimeoutID = setTimeout(untrackFibers, 1000); - } - } - - const untrackFibersSet = new Set(); - let untrackFibersTimeoutID = null; - - function untrackFibers() { - if (untrackFibersTimeoutID !== null) { - clearTimeout(untrackFibersTimeoutID); - untrackFibersTimeoutID = null; - } - - untrackFibersSet.forEach(fiber => { - const fiberID = getFiberIDUnsafe(fiber); - - if (fiberID !== null) { - idToArbitraryFiberMap.delete(fiberID); // Also clear any errors/warnings associated with this fiber. - - clearErrorsForFiberID(fiberID); - clearWarningsForFiberID(fiberID); - } - - fiberToIDMap.delete(fiber); - const { - alternate - } = fiber; - - if (alternate !== null) { - fiberToIDMap.delete(alternate); - } - - if (forceErrorForFiberIDs.has(fiberID)) { - forceErrorForFiberIDs.delete(fiberID); - - if (forceErrorForFiberIDs.size === 0 && setErrorHandler != null) { - setErrorHandler(shouldErrorFiberAlwaysNull); - } - } - }); - untrackFibersSet.clear(); - } - - function getChangeDescription(prevFiber, nextFiber) { - switch (getElementTypeForFiber(nextFiber)) { - case types["e" /* ElementTypeClass */]: - case types["h" /* ElementTypeFunction */]: - case types["j" /* ElementTypeMemo */]: - case types["g" /* ElementTypeForwardRef */]: - if (prevFiber === null) { - return { - context: null, - didHooksChange: false, - isFirstMount: true, - props: null, - state: null - }; - } else { - const data = { - context: getContextChangedKeys(nextFiber), - didHooksChange: false, - isFirstMount: false, - props: getChangedKeys(prevFiber.memoizedProps, nextFiber.memoizedProps), - state: getChangedKeys(prevFiber.memoizedState, nextFiber.memoizedState) - }; // Only traverse the hooks list once, depending on what info we're returning. - - if (DevToolsFeatureFlags_extension_oss["d" /* enableProfilerChangedHookIndices */]) { - const indices = getChangedHooksIndices(prevFiber.memoizedState, nextFiber.memoizedState); - data.hooks = indices; - data.didHooksChange = indices !== null && indices.length > 0; - } else { - data.didHooksChange = didHooksChange(prevFiber.memoizedState, nextFiber.memoizedState); - } - - return data; - } - - default: - return null; - } - } - - function updateContextsForFiber(fiber) { - switch (getElementTypeForFiber(fiber)) { - case types["e" /* ElementTypeClass */]: - case types["g" /* ElementTypeForwardRef */]: - case types["h" /* ElementTypeFunction */]: - case types["j" /* ElementTypeMemo */]: - if (idToContextsMap !== null) { - const id = getFiberIDThrows(fiber); - const contexts = getContextsForFiber(fiber); - - if (contexts !== null) { - // $FlowFixMe[incompatible-use] found when upgrading Flow - idToContextsMap.set(id, contexts); - } - } - - break; - - default: - break; - } - } // Differentiates between a null context value and no context. - - - const NO_CONTEXT = {}; - - function getContextsForFiber(fiber) { - let legacyContext = NO_CONTEXT; - let modernContext = NO_CONTEXT; - - switch (getElementTypeForFiber(fiber)) { - case types["e" /* ElementTypeClass */]: - const instance = fiber.stateNode; - - if (instance != null) { - if (instance.constructor && instance.constructor.contextType != null) { - modernContext = instance.context; - } else { - legacyContext = instance.context; - - if (legacyContext && Object.keys(legacyContext).length === 0) { - legacyContext = NO_CONTEXT; - } - } - } - - return [legacyContext, modernContext]; - - case types["g" /* ElementTypeForwardRef */]: - case types["h" /* ElementTypeFunction */]: - case types["j" /* ElementTypeMemo */]: - const dependencies = fiber.dependencies; - - if (dependencies && dependencies.firstContext) { - modernContext = dependencies.firstContext; - } - - return [legacyContext, modernContext]; - - default: - return null; - } - } // Record all contexts at the time profiling is started. - // Fibers only store the current context value, - // so we need to track them separately in order to determine changed keys. - - - function crawlToInitializeContextsMap(fiber) { - const id = getFiberIDUnsafe(fiber); // Not all Fibers in the subtree have mounted yet. - // For example, Offscreen (hidden) or Suspense (suspended) subtrees won't yet be tracked. - // We can safely skip these subtrees. - - if (id !== null) { - updateContextsForFiber(fiber); - let current = fiber.child; - - while (current !== null) { - crawlToInitializeContextsMap(current); - current = current.sibling; - } - } - } - - function getContextChangedKeys(fiber) { - if (idToContextsMap !== null) { - const id = getFiberIDThrows(fiber); // $FlowFixMe[incompatible-use] found when upgrading Flow - - const prevContexts = idToContextsMap.has(id) ? // $FlowFixMe[incompatible-use] found when upgrading Flow - idToContextsMap.get(id) : null; - const nextContexts = getContextsForFiber(fiber); - - if (prevContexts == null || nextContexts == null) { - return null; - } - - const [prevLegacyContext, prevModernContext] = prevContexts; - const [nextLegacyContext, nextModernContext] = nextContexts; - - switch (getElementTypeForFiber(fiber)) { - case types["e" /* ElementTypeClass */]: - if (prevContexts && nextContexts) { - if (nextLegacyContext !== NO_CONTEXT) { - return getChangedKeys(prevLegacyContext, nextLegacyContext); - } else if (nextModernContext !== NO_CONTEXT) { - return prevModernContext !== nextModernContext; - } - } - - break; - - case types["g" /* ElementTypeForwardRef */]: - case types["h" /* ElementTypeFunction */]: - case types["j" /* ElementTypeMemo */]: - if (nextModernContext !== NO_CONTEXT) { - let prevContext = prevModernContext; - let nextContext = nextModernContext; - - while (prevContext && nextContext) { - // Note this only works for versions of React that support this key (e.v. 18+) - // For older versions, there's no good way to read the current context value after render has completed. - // This is because React maintains a stack of context values during render, - // but by the time DevTools is called, render has finished and the stack is empty. - if (!shared_objectIs(prevContext.memoizedValue, nextContext.memoizedValue)) { - return true; - } - - prevContext = prevContext.next; - nextContext = nextContext.next; - } - - return false; - } - - break; - - default: - break; - } - } - - return null; - } - - function isHookThatCanScheduleUpdate(hookObject) { - const queue = hookObject.queue; - - if (!queue) { - return false; - } - - const boundHasOwnProperty = shared_hasOwnProperty["a" /* default */].bind(queue); // Detect the shape of useState() or useReducer() - // using the attributes that are unique to these hooks - // but also stable (e.g. not tied to current Lanes implementation) - - const isStateOrReducer = boundHasOwnProperty('pending') && boundHasOwnProperty('dispatch') && typeof queue.dispatch === 'function'; // Detect useSyncExternalStore() - - const isSyncExternalStore = boundHasOwnProperty('value') && boundHasOwnProperty('getSnapshot') && typeof queue.getSnapshot === 'function'; // These are the only types of hooks that can schedule an update. - - return isStateOrReducer || isSyncExternalStore; - } - - function didStatefulHookChange(prev, next) { - const prevMemoizedState = prev.memoizedState; - const nextMemoizedState = next.memoizedState; - - if (isHookThatCanScheduleUpdate(prev)) { - return prevMemoizedState !== nextMemoizedState; - } - - return false; - } - - function didHooksChange(prev, next) { - if (prev == null || next == null) { - return false; - } // We can't report anything meaningful for hooks changes. - - - if (next.hasOwnProperty('baseState') && next.hasOwnProperty('memoizedState') && next.hasOwnProperty('next') && next.hasOwnProperty('queue')) { - while (next !== null) { - if (didStatefulHookChange(prev, next)) { - return true; - } else { - next = next.next; - prev = prev.next; - } - } - } - - return false; - } - - function getChangedHooksIndices(prev, next) { - if (DevToolsFeatureFlags_extension_oss["d" /* enableProfilerChangedHookIndices */]) { - if (prev == null || next == null) { - return null; - } - - const indices = []; - let index = 0; - - if (next.hasOwnProperty('baseState') && next.hasOwnProperty('memoizedState') && next.hasOwnProperty('next') && next.hasOwnProperty('queue')) { - while (next !== null) { - if (didStatefulHookChange(prev, next)) { - indices.push(index); - } - - next = next.next; - prev = prev.next; - index++; - } - } - - return indices; - } - - return null; - } - - function getChangedKeys(prev, next) { - if (prev == null || next == null) { - return null; - } // We can't report anything meaningful for hooks changes. - - - if (next.hasOwnProperty('baseState') && next.hasOwnProperty('memoizedState') && next.hasOwnProperty('next') && next.hasOwnProperty('queue')) { - return null; - } - - const keys = new Set([...Object.keys(prev), ...Object.keys(next)]); - const changedKeys = []; // eslint-disable-next-line no-for-of-loops/no-for-of-loops - - for (const key of keys) { - if (prev[key] !== next[key]) { - changedKeys.push(key); - } - } - - return changedKeys; - } // eslint-disable-next-line no-unused-vars - - - function didFiberRender(prevFiber, nextFiber) { - switch (nextFiber.tag) { - case ClassComponent: - case FunctionComponent: - case ContextConsumer: - case MemoComponent: - case SimpleMemoComponent: - case ForwardRef: - // For types that execute user code, we check PerformedWork effect. - // We don't reflect bailouts (either referential or sCU) in DevTools. - // eslint-disable-next-line no-bitwise - return (getFiberFlags(nextFiber) & PerformedWork) === PerformedWork; - // Note: ContextConsumer only gets PerformedWork effect in 16.3.3+ - // so it won't get highlighted with React 16.3.0 to 16.3.2. - - default: - // For host components and other types, we compare inputs - // to determine whether something is an update. - return prevFiber.memoizedProps !== nextFiber.memoizedProps || prevFiber.memoizedState !== nextFiber.memoizedState || prevFiber.ref !== nextFiber.ref; - } - } - - const pendingOperations = []; - const pendingRealUnmountedIDs = []; - const pendingSimulatedUnmountedIDs = []; - let pendingOperationsQueue = []; - const pendingStringTable = new Map(); - let pendingStringTableLength = 0; - let pendingUnmountedRootID = null; - - function pushOperation(op) { - if (false) {} - - pendingOperations.push(op); - } - - function shouldBailoutWithPendingOperations() { - if (isProfiling) { - if (currentCommitProfilingMetadata != null && currentCommitProfilingMetadata.durations.length > 0) { - return false; - } - } - - return pendingOperations.length === 0 && pendingRealUnmountedIDs.length === 0 && pendingSimulatedUnmountedIDs.length === 0 && pendingUnmountedRootID === null; - } - - function flushOrQueueOperations(operations) { - if (shouldBailoutWithPendingOperations()) { - return; - } - - if (pendingOperationsQueue !== null) { - pendingOperationsQueue.push(operations); - } else { - hook.emit('operations', operations); - } - } - - let flushPendingErrorsAndWarningsAfterDelayTimeoutID = null; - - function clearPendingErrorsAndWarningsAfterDelay() { - if (flushPendingErrorsAndWarningsAfterDelayTimeoutID !== null) { - clearTimeout(flushPendingErrorsAndWarningsAfterDelayTimeoutID); - flushPendingErrorsAndWarningsAfterDelayTimeoutID = null; - } - } - - function flushPendingErrorsAndWarningsAfterDelay() { - clearPendingErrorsAndWarningsAfterDelay(); - flushPendingErrorsAndWarningsAfterDelayTimeoutID = setTimeout(() => { - flushPendingErrorsAndWarningsAfterDelayTimeoutID = null; - - if (pendingOperations.length > 0) { - // On the off chance that something else has pushed pending operations, - // we should bail on warnings; it's probably not safe to push midway. - return; - } - - recordPendingErrorsAndWarnings(); - - if (shouldBailoutWithPendingOperations()) { - // No warnings or errors to flush; we can bail out early here too. - return; - } // We can create a smaller operations array than flushPendingEvents() - // because we only need to flush warning and error counts. - // Only a few pieces of fixed information are required up front. - - - const operations = new Array(3 + pendingOperations.length); - operations[0] = rendererID; - operations[1] = currentRootID; - operations[2] = 0; // String table size - - for (let j = 0; j < pendingOperations.length; j++) { - operations[3 + j] = pendingOperations[j]; - } - - flushOrQueueOperations(operations); - pendingOperations.length = 0; - }, 1000); - } - - function reevaluateErrorsAndWarnings() { - fibersWithChangedErrorOrWarningCounts.clear(); - fiberIDToErrorsMap.forEach((countMap, fiberID) => { - const fiber = idToArbitraryFiberMap.get(fiberID); - - if (fiber != null) { - fibersWithChangedErrorOrWarningCounts.add(fiber); - } - }); - fiberIDToWarningsMap.forEach((countMap, fiberID) => { - const fiber = idToArbitraryFiberMap.get(fiberID); - - if (fiber != null) { - fibersWithChangedErrorOrWarningCounts.add(fiber); - } - }); - recordPendingErrorsAndWarnings(); - } - - function mergeMapsAndGetCountHelper(fiber, fiberID, pendingFiberToMessageCountMap, fiberIDToMessageCountMap) { - let newCount = 0; - let messageCountMap = fiberIDToMessageCountMap.get(fiberID); - const pendingMessageCountMap = pendingFiberToMessageCountMap.get(fiber); - - if (pendingMessageCountMap != null) { - if (messageCountMap == null) { - messageCountMap = pendingMessageCountMap; - fiberIDToMessageCountMap.set(fiberID, pendingMessageCountMap); - } else { - // This Flow refinement should not be necessary and yet... - const refinedMessageCountMap = messageCountMap; - pendingMessageCountMap.forEach((pendingCount, message) => { - const previousCount = refinedMessageCountMap.get(message) || 0; - refinedMessageCountMap.set(message, previousCount + pendingCount); - }); - } - } - - if (!shouldFilterFiber(fiber)) { - if (messageCountMap != null) { - messageCountMap.forEach(count => { - newCount += count; - }); - } - } - - pendingFiberToMessageCountMap.delete(fiber); - return newCount; - } - - function recordPendingErrorsAndWarnings() { - clearPendingErrorsAndWarningsAfterDelay(); - fibersWithChangedErrorOrWarningCounts.forEach(fiber => { - const fiberID = getFiberIDUnsafe(fiber); - - if (fiberID === null) {// Don't send updates for Fibers that didn't mount due to e.g. Suspense or an error boundary. - } else { - const errorCount = mergeMapsAndGetCountHelper(fiber, fiberID, pendingFiberToErrorsMap, fiberIDToErrorsMap); - const warningCount = mergeMapsAndGetCountHelper(fiber, fiberID, pendingFiberToWarningsMap, fiberIDToWarningsMap); - pushOperation(constants["C" /* TREE_OPERATION_UPDATE_ERRORS_OR_WARNINGS */]); - pushOperation(fiberID); - pushOperation(errorCount); - pushOperation(warningCount); - } // Always clean up so that we don't leak. - - - pendingFiberToErrorsMap.delete(fiber); - pendingFiberToWarningsMap.delete(fiber); - }); - fibersWithChangedErrorOrWarningCounts.clear(); - } - - function flushPendingEvents(root) { - // Add any pending errors and warnings to the operations array. - // We do this just before flushing, so we can ignore errors for no-longer-mounted Fibers. - recordPendingErrorsAndWarnings(); - - if (shouldBailoutWithPendingOperations()) { - // If we aren't profiling, we can just bail out here. - // No use sending an empty update over the bridge. - // - // The Profiler stores metadata for each commit and reconstructs the app tree per commit using: - // (1) an initial tree snapshot and - // (2) the operations array for each commit - // Because of this, it's important that the operations and metadata arrays align, - // So it's important not to omit even empty operations while profiling is active. - return; - } - - const numUnmountIDs = pendingRealUnmountedIDs.length + pendingSimulatedUnmountedIDs.length + (pendingUnmountedRootID === null ? 0 : 1); - const operations = new Array( // Identify which renderer this update is coming from. - 2 + // [rendererID, rootFiberID] - // How big is the string table? - 1 + // [stringTableLength] - // Then goes the actual string table. - pendingStringTableLength + ( // All unmounts are batched in a single message. - // [TREE_OPERATION_REMOVE, removedIDLength, ...ids] - numUnmountIDs > 0 ? 2 + numUnmountIDs : 0) + // Regular operations - pendingOperations.length); // Identify which renderer this update is coming from. - // This enables roots to be mapped to renderers, - // Which in turn enables fiber props, states, and hooks to be inspected. - - let i = 0; - operations[i++] = rendererID; - operations[i++] = currentRootID; // Now fill in the string table. - // [stringTableLength, str1Length, ...str1, str2Length, ...str2, ...] - - operations[i++] = pendingStringTableLength; - pendingStringTable.forEach((entry, stringKey) => { - const encodedString = entry.encodedString; // Don't use the string length. - // It won't work for multibyte characters (like emoji). - - const length = encodedString.length; - operations[i++] = length; - - for (let j = 0; j < length; j++) { - operations[i + j] = encodedString[j]; - } - - i += length; - }); - - if (numUnmountIDs > 0) { - // All unmounts except roots are batched in a single message. - operations[i++] = constants["y" /* TREE_OPERATION_REMOVE */]; // The first number is how many unmounted IDs we're gonna send. - - operations[i++] = numUnmountIDs; // Fill in the real unmounts in the reverse order. - // They were inserted parents-first by React, but we want children-first. - // So we traverse our array backwards. - - for (let j = pendingRealUnmountedIDs.length - 1; j >= 0; j--) { - operations[i++] = pendingRealUnmountedIDs[j]; - } // Fill in the simulated unmounts (hidden Suspense subtrees) in their order. - // (We want children to go before parents.) - // They go *after* the real unmounts because we know for sure they won't be - // children of already pushed "real" IDs. If they were, we wouldn't be able - // to discover them during the traversal, as they would have been deleted. - - - for (let j = 0; j < pendingSimulatedUnmountedIDs.length; j++) { - operations[i + j] = pendingSimulatedUnmountedIDs[j]; - } - - i += pendingSimulatedUnmountedIDs.length; // The root ID should always be unmounted last. - - if (pendingUnmountedRootID !== null) { - operations[i] = pendingUnmountedRootID; - i++; - } - } // Fill in the rest of the operations. - - - for (let j = 0; j < pendingOperations.length; j++) { - operations[i + j] = pendingOperations[j]; - } - - i += pendingOperations.length; // Let the frontend know about tree operations. - - flushOrQueueOperations(operations); // Reset all of the pending state now that we've told the frontend about it. - - pendingOperations.length = 0; - pendingRealUnmountedIDs.length = 0; - pendingSimulatedUnmountedIDs.length = 0; - pendingUnmountedRootID = null; - pendingStringTable.clear(); - pendingStringTableLength = 0; - } - - function getStringID(string) { - if (string === null) { - return 0; - } - - const existingEntry = pendingStringTable.get(string); - - if (existingEntry !== undefined) { - return existingEntry.id; - } - - const id = pendingStringTable.size + 1; - const encodedString = Object(utils["z" /* utfEncodeString */])(string); - pendingStringTable.set(string, { - encodedString, - id - }); // The string table total length needs to account both for the string length, - // and for the array item that contains the length itself. - // - // Don't use string length for this table. - // It won't work for multibyte characters (like emoji). - - pendingStringTableLength += encodedString.length + 1; - return id; - } - - function recordMount(fiber, parentFiber) { - const isRoot = fiber.tag === HostRoot; - const id = getOrGenerateFiberID(fiber); - - if (constants["F" /* __DEBUG__ */]) { - debug('recordMount()', fiber, parentFiber); - } - - const hasOwnerMetadata = fiber.hasOwnProperty('_debugOwner'); - const isProfilingSupported = fiber.hasOwnProperty('treeBaseDuration'); // Adding a new field here would require a bridge protocol version bump (a backwads breaking change). - // Instead let's re-purpose a pre-existing field to carry more information. - - let profilingFlags = 0; - - if (isProfilingSupported) { - profilingFlags = constants["r" /* PROFILING_FLAG_BASIC_SUPPORT */]; - - if (typeof injectProfilingHooks === 'function') { - profilingFlags |= constants["s" /* PROFILING_FLAG_TIMELINE_SUPPORT */]; - } - } - - if (isRoot) { - pushOperation(constants["x" /* TREE_OPERATION_ADD */]); - pushOperation(id); - pushOperation(types["m" /* ElementTypeRoot */]); - pushOperation((fiber.mode & StrictModeBits) !== 0 ? 1 : 0); - pushOperation(profilingFlags); - pushOperation(StrictModeBits !== 0 ? 1 : 0); - pushOperation(hasOwnerMetadata ? 1 : 0); - - if (isProfiling) { - if (displayNamesByRootID !== null) { - displayNamesByRootID.set(id, getDisplayNameForRoot(fiber)); - } - } - } else { - const { - key - } = fiber; - const displayName = getDisplayNameForFiber(fiber); - const elementType = getElementTypeForFiber(fiber); - const { - _debugOwner - } = fiber; // Ideally we should call getFiberIDThrows() for _debugOwner, - // since owners are almost always higher in the tree (and so have already been processed), - // but in some (rare) instances reported in open source, a descendant mounts before an owner. - // Since this is a DEV only field it's probably okay to also just lazily generate and ID here if needed. - // See https://github.com/facebook/react/issues/21445 - - const ownerID = _debugOwner != null ? getOrGenerateFiberID(_debugOwner) : 0; - const parentID = parentFiber ? getFiberIDThrows(parentFiber) : 0; - const displayNameStringID = getStringID(displayName); // This check is a guard to handle a React element that has been modified - // in such a way as to bypass the default stringification of the "key" property. - - const keyString = key === null ? null : String(key); - const keyStringID = getStringID(keyString); - pushOperation(constants["x" /* TREE_OPERATION_ADD */]); - pushOperation(id); - pushOperation(elementType); - pushOperation(parentID); - pushOperation(ownerID); - pushOperation(displayNameStringID); - pushOperation(keyStringID); // If this subtree has a new mode, let the frontend know. - - if ((fiber.mode & StrictModeBits) !== 0 && (parentFiber.mode & StrictModeBits) === 0) { - pushOperation(constants["B" /* TREE_OPERATION_SET_SUBTREE_MODE */]); - pushOperation(id); - pushOperation(types["q" /* StrictMode */]); - } - } - - if (isProfilingSupported) { - idToRootMap.set(id, currentRootID); - recordProfilingDurations(fiber); - } - } - - function recordUnmount(fiber, isSimulated) { - if (constants["F" /* __DEBUG__ */]) { - debug('recordUnmount()', fiber, null, isSimulated ? 'unmount is simulated' : ''); - } - - if (trackedPathMatchFiber !== null) { - // We're in the process of trying to restore previous selection. - // If this fiber matched but is being unmounted, there's no use trying. - // Reset the state so we don't keep holding onto it. - if (fiber === trackedPathMatchFiber || fiber === trackedPathMatchFiber.alternate) { - setTrackedPath(null); - } - } - - const unsafeID = getFiberIDUnsafe(fiber); - - if (unsafeID === null) { - // If we've never seen this Fiber, it might be inside of a legacy render Suspense fragment (so the store is not even aware of it). - // In that case we can just ignore it or it will cause errors later on. - // One example of this is a Lazy component that never resolves before being unmounted. - // - // This also might indicate a Fast Refresh force-remount scenario. - // - // TODO: This is fragile and can obscure actual bugs. - return; - } // Flow refinement. - - - const id = unsafeID; - const isRoot = fiber.tag === HostRoot; - - if (isRoot) { - // Roots must be removed only after all children (pending and simulated) have been removed. - // So we track it separately. - pendingUnmountedRootID = id; - } else if (!shouldFilterFiber(fiber)) { - // To maintain child-first ordering, - // we'll push it into one of these queues, - // and later arrange them in the correct order. - if (isSimulated) { - pendingSimulatedUnmountedIDs.push(id); - } else { - pendingRealUnmountedIDs.push(id); - } - } - - if (!fiber._debugNeedsRemount) { - untrackFiberID(fiber); - const isProfilingSupported = fiber.hasOwnProperty('treeBaseDuration'); - - if (isProfilingSupported) { - idToRootMap.delete(id); - idToTreeBaseDurationMap.delete(id); - } - } - } - - function mountFiberRecursively(firstChild, parentFiber, traverseSiblings, traceNearestHostComponentUpdate) { - // Iterate over siblings rather than recursing. - // This reduces the chance of stack overflow for wide trees (e.g. lists with many items). - let fiber = firstChild; - - while (fiber !== null) { - // Generate an ID even for filtered Fibers, in case it's needed later (e.g. for Profiling). - getOrGenerateFiberID(fiber); - - if (constants["F" /* __DEBUG__ */]) { - debug('mountFiberRecursively()', fiber, parentFiber); - } // If we have the tree selection from previous reload, try to match this Fiber. - // Also remember whether to do the same for siblings. - - - const mightSiblingsBeOnTrackedPath = updateTrackedPathStateBeforeMount(fiber); - const shouldIncludeInTree = !shouldFilterFiber(fiber); - - if (shouldIncludeInTree) { - recordMount(fiber, parentFiber); - } - - if (traceUpdatesEnabled) { - if (traceNearestHostComponentUpdate) { - const elementType = getElementTypeForFiber(fiber); // If an ancestor updated, we should mark the nearest host nodes for highlighting. - - if (elementType === types["i" /* ElementTypeHostComponent */]) { - traceUpdatesForNodes.add(fiber.stateNode); - traceNearestHostComponentUpdate = false; - } - } // We intentionally do not re-enable the traceNearestHostComponentUpdate flag in this branch, - // because we don't want to highlight every host node inside of a newly mounted subtree. - - } - - const isSuspense = fiber.tag === ReactTypeOfWork.SuspenseComponent; - - if (isSuspense) { - const isTimedOut = fiber.memoizedState !== null; - - if (isTimedOut) { - // Special case: if Suspense mounts in a timed-out state, - // get the fallback child from the inner fragment and mount - // it as if it was our own child. Updates handle this too. - const primaryChildFragment = fiber.child; - const fallbackChildFragment = primaryChildFragment ? primaryChildFragment.sibling : null; - const fallbackChild = fallbackChildFragment ? fallbackChildFragment.child : null; - - if (fallbackChild !== null) { - mountFiberRecursively(fallbackChild, shouldIncludeInTree ? fiber : parentFiber, true, traceNearestHostComponentUpdate); - } - } else { - let primaryChild = null; - const areSuspenseChildrenConditionallyWrapped = OffscreenComponent === -1; - - if (areSuspenseChildrenConditionallyWrapped) { - primaryChild = fiber.child; - } else if (fiber.child !== null) { - primaryChild = fiber.child.child; - } - - if (primaryChild !== null) { - mountFiberRecursively(primaryChild, shouldIncludeInTree ? fiber : parentFiber, true, traceNearestHostComponentUpdate); - } - } - } else { - if (fiber.child !== null) { - mountFiberRecursively(fiber.child, shouldIncludeInTree ? fiber : parentFiber, true, traceNearestHostComponentUpdate); - } - } // We're exiting this Fiber now, and entering its siblings. - // If we have selection to restore, we might need to re-activate tracking. - - - updateTrackedPathStateAfterMount(mightSiblingsBeOnTrackedPath); - fiber = traverseSiblings ? fiber.sibling : null; - } - } // We use this to simulate unmounting for Suspense trees - // when we switch from primary to fallback. - - - function unmountFiberChildrenRecursively(fiber) { - if (constants["F" /* __DEBUG__ */]) { - debug('unmountFiberChildrenRecursively()', fiber); - } // We might meet a nested Suspense on our way. - - - const isTimedOutSuspense = fiber.tag === ReactTypeOfWork.SuspenseComponent && fiber.memoizedState !== null; - let child = fiber.child; - - if (isTimedOutSuspense) { - // If it's showing fallback tree, let's traverse it instead. - const primaryChildFragment = fiber.child; - const fallbackChildFragment = primaryChildFragment ? primaryChildFragment.sibling : null; // Skip over to the real Fiber child. - - child = fallbackChildFragment ? fallbackChildFragment.child : null; - } - - while (child !== null) { - // Record simulated unmounts children-first. - // We skip nodes without return because those are real unmounts. - if (child.return !== null) { - unmountFiberChildrenRecursively(child); - recordUnmount(child, true); - } - - child = child.sibling; - } - } - - function recordProfilingDurations(fiber) { - const id = getFiberIDThrows(fiber); - const { - actualDuration, - treeBaseDuration - } = fiber; - idToTreeBaseDurationMap.set(id, treeBaseDuration || 0); - - if (isProfiling) { - const { - alternate - } = fiber; // It's important to update treeBaseDuration even if the current Fiber did not render, - // because it's possible that one of its descendants did. - - if (alternate == null || treeBaseDuration !== alternate.treeBaseDuration) { - // Tree base duration updates are included in the operations typed array. - // So we have to convert them from milliseconds to microseconds so we can send them as ints. - const convertedTreeBaseDuration = Math.floor((treeBaseDuration || 0) * 1000); - pushOperation(constants["D" /* TREE_OPERATION_UPDATE_TREE_BASE_DURATION */]); - pushOperation(id); - pushOperation(convertedTreeBaseDuration); - } - - if (alternate == null || didFiberRender(alternate, fiber)) { - if (actualDuration != null) { - // The actual duration reported by React includes time spent working on children. - // This is useful information, but it's also useful to be able to exclude child durations. - // The frontend can't compute this, since the immediate children may have been filtered out. - // So we need to do this on the backend. - // Note that this calculated self duration is not the same thing as the base duration. - // The two are calculated differently (tree duration does not accumulate). - let selfDuration = actualDuration; - let child = fiber.child; - - while (child !== null) { - selfDuration -= child.actualDuration || 0; - child = child.sibling; - } // If profiling is active, store durations for elements that were rendered during the commit. - // Note that we should do this for any fiber we performed work on, regardless of its actualDuration value. - // In some cases actualDuration might be 0 for fibers we worked on (particularly if we're using Date.now) - // In other cases (e.g. Memo) actualDuration might be greater than 0 even if we "bailed out". - - - const metadata = currentCommitProfilingMetadata; - metadata.durations.push(id, actualDuration, selfDuration); - metadata.maxActualDuration = Math.max(metadata.maxActualDuration, actualDuration); - - if (recordChangeDescriptions) { - const changeDescription = getChangeDescription(alternate, fiber); - - if (changeDescription !== null) { - if (metadata.changeDescriptions !== null) { - metadata.changeDescriptions.set(id, changeDescription); - } - } - - updateContextsForFiber(fiber); - } - } - } - } - } - - function recordResetChildren(fiber, childSet) { - if (constants["F" /* __DEBUG__ */]) { - debug('recordResetChildren()', childSet, fiber); - } // The frontend only really cares about the displayName, key, and children. - // The first two don't really change, so we are only concerned with the order of children here. - // This is trickier than a simple comparison though, since certain types of fibers are filtered. - - - const nextChildren = []; // This is a naive implementation that shallowly recourses children. - // We might want to revisit this if it proves to be too inefficient. - - let child = childSet; - - while (child !== null) { - findReorderedChildrenRecursively(child, nextChildren); - child = child.sibling; - } - - const numChildren = nextChildren.length; - - if (numChildren < 2) { - // No need to reorder. - return; - } - - pushOperation(constants["A" /* TREE_OPERATION_REORDER_CHILDREN */]); - pushOperation(getFiberIDThrows(fiber)); - pushOperation(numChildren); - - for (let i = 0; i < nextChildren.length; i++) { - pushOperation(nextChildren[i]); - } - } - - function findReorderedChildrenRecursively(fiber, nextChildren) { - if (!shouldFilterFiber(fiber)) { - nextChildren.push(getFiberIDThrows(fiber)); - } else { - let child = fiber.child; - const isTimedOutSuspense = fiber.tag === SuspenseComponent && fiber.memoizedState !== null; - - if (isTimedOutSuspense) { - // Special case: if Suspense mounts in a timed-out state, - // get the fallback child from the inner fragment, - // and skip over the primary child. - const primaryChildFragment = fiber.child; - const fallbackChildFragment = primaryChildFragment ? primaryChildFragment.sibling : null; - const fallbackChild = fallbackChildFragment ? fallbackChildFragment.child : null; - - if (fallbackChild !== null) { - child = fallbackChild; - } - } - - while (child !== null) { - findReorderedChildrenRecursively(child, nextChildren); - child = child.sibling; - } - } - } // Returns whether closest unfiltered fiber parent needs to reset its child list. - - - function updateFiberRecursively(nextFiber, prevFiber, parentFiber, traceNearestHostComponentUpdate) { - const id = getOrGenerateFiberID(nextFiber); - - if (constants["F" /* __DEBUG__ */]) { - debug('updateFiberRecursively()', nextFiber, parentFiber); - } - - if (traceUpdatesEnabled) { - const elementType = getElementTypeForFiber(nextFiber); - - if (traceNearestHostComponentUpdate) { - // If an ancestor updated, we should mark the nearest host nodes for highlighting. - if (elementType === types["i" /* ElementTypeHostComponent */]) { - traceUpdatesForNodes.add(nextFiber.stateNode); - traceNearestHostComponentUpdate = false; - } - } else { - if (elementType === types["h" /* ElementTypeFunction */] || elementType === types["e" /* ElementTypeClass */] || elementType === types["f" /* ElementTypeContext */] || elementType === types["j" /* ElementTypeMemo */] || elementType === types["g" /* ElementTypeForwardRef */]) { - // Otherwise if this is a traced ancestor, flag for the nearest host descendant(s). - traceNearestHostComponentUpdate = didFiberRender(prevFiber, nextFiber); - } - } - } - - if (mostRecentlyInspectedElement !== null && mostRecentlyInspectedElement.id === id && didFiberRender(prevFiber, nextFiber)) { - // If this Fiber has updated, clear cached inspected data. - // If it is inspected again, it may need to be re-run to obtain updated hooks values. - hasElementUpdatedSinceLastInspected = true; - } - - const shouldIncludeInTree = !shouldFilterFiber(nextFiber); - const isSuspense = nextFiber.tag === SuspenseComponent; - let shouldResetChildren = false; // The behavior of timed-out Suspense trees is unique. - // Rather than unmount the timed out content (and possibly lose important state), - // React re-parents this content within a hidden Fragment while the fallback is showing. - // This behavior doesn't need to be observable in the DevTools though. - // It might even result in a bad user experience for e.g. node selection in the Elements panel. - // The easiest fix is to strip out the intermediate Fragment fibers, - // so the Elements panel and Profiler don't need to special case them. - // Suspense components only have a non-null memoizedState if they're timed-out. - - const prevDidTimeout = isSuspense && prevFiber.memoizedState !== null; - const nextDidTimeOut = isSuspense && nextFiber.memoizedState !== null; // The logic below is inspired by the code paths in updateSuspenseComponent() - // inside ReactFiberBeginWork in the React source code. - - if (prevDidTimeout && nextDidTimeOut) { - // Fallback -> Fallback: - // 1. Reconcile fallback set. - const nextFiberChild = nextFiber.child; - const nextFallbackChildSet = nextFiberChild ? nextFiberChild.sibling : null; // Note: We can't use nextFiber.child.sibling.alternate - // because the set is special and alternate may not exist. - - const prevFiberChild = prevFiber.child; - const prevFallbackChildSet = prevFiberChild ? prevFiberChild.sibling : null; - - if (nextFallbackChildSet != null && prevFallbackChildSet != null && updateFiberRecursively(nextFallbackChildSet, prevFallbackChildSet, nextFiber, traceNearestHostComponentUpdate)) { - shouldResetChildren = true; - } - } else if (prevDidTimeout && !nextDidTimeOut) { - // Fallback -> Primary: - // 1. Unmount fallback set - // Note: don't emulate fallback unmount because React actually did it. - // 2. Mount primary set - const nextPrimaryChildSet = nextFiber.child; - - if (nextPrimaryChildSet !== null) { - mountFiberRecursively(nextPrimaryChildSet, shouldIncludeInTree ? nextFiber : parentFiber, true, traceNearestHostComponentUpdate); - } - - shouldResetChildren = true; - } else if (!prevDidTimeout && nextDidTimeOut) { - // Primary -> Fallback: - // 1. Hide primary set - // This is not a real unmount, so it won't get reported by React. - // We need to manually walk the previous tree and record unmounts. - unmountFiberChildrenRecursively(prevFiber); // 2. Mount fallback set - - const nextFiberChild = nextFiber.child; - const nextFallbackChildSet = nextFiberChild ? nextFiberChild.sibling : null; - - if (nextFallbackChildSet != null) { - mountFiberRecursively(nextFallbackChildSet, shouldIncludeInTree ? nextFiber : parentFiber, true, traceNearestHostComponentUpdate); - shouldResetChildren = true; - } - } else { - // Common case: Primary -> Primary. - // This is the same code path as for non-Suspense fibers. - if (nextFiber.child !== prevFiber.child) { - // If the first child is different, we need to traverse them. - // Each next child will be either a new child (mount) or an alternate (update). - let nextChild = nextFiber.child; - let prevChildAtSameIndex = prevFiber.child; - - while (nextChild) { - // We already know children will be referentially different because - // they are either new mounts or alternates of previous children. - // Schedule updates and mounts depending on whether alternates exist. - // We don't track deletions here because they are reported separately. - if (nextChild.alternate) { - const prevChild = nextChild.alternate; - - if (updateFiberRecursively(nextChild, prevChild, shouldIncludeInTree ? nextFiber : parentFiber, traceNearestHostComponentUpdate)) { - // If a nested tree child order changed but it can't handle its own - // child order invalidation (e.g. because it's filtered out like host nodes), - // propagate the need to reset child order upwards to this Fiber. - shouldResetChildren = true; - } // However we also keep track if the order of the children matches - // the previous order. They are always different referentially, but - // if the instances line up conceptually we'll want to know that. - - - if (prevChild !== prevChildAtSameIndex) { - shouldResetChildren = true; - } - } else { - mountFiberRecursively(nextChild, shouldIncludeInTree ? nextFiber : parentFiber, false, traceNearestHostComponentUpdate); - shouldResetChildren = true; - } // Try the next child. - - - nextChild = nextChild.sibling; // Advance the pointer in the previous list so that we can - // keep comparing if they line up. - - if (!shouldResetChildren && prevChildAtSameIndex !== null) { - prevChildAtSameIndex = prevChildAtSameIndex.sibling; - } - } // If we have no more children, but used to, they don't line up. - - - if (prevChildAtSameIndex !== null) { - shouldResetChildren = true; - } - } else { - if (traceUpdatesEnabled) { - // If we're tracing updates and we've bailed out before reaching a host node, - // we should fall back to recursively marking the nearest host descendants for highlight. - if (traceNearestHostComponentUpdate) { - const hostFibers = findAllCurrentHostFibers(getFiberIDThrows(nextFiber)); - hostFibers.forEach(hostFiber => { - traceUpdatesForNodes.add(hostFiber.stateNode); - }); - } - } - } - } - - if (shouldIncludeInTree) { - const isProfilingSupported = nextFiber.hasOwnProperty('treeBaseDuration'); - - if (isProfilingSupported) { - recordProfilingDurations(nextFiber); - } - } - - if (shouldResetChildren) { - // We need to crawl the subtree for closest non-filtered Fibers - // so that we can display them in a flat children set. - if (shouldIncludeInTree) { - // Normally, search for children from the rendered child. - let nextChildSet = nextFiber.child; - - if (nextDidTimeOut) { - // Special case: timed-out Suspense renders the fallback set. - const nextFiberChild = nextFiber.child; - nextChildSet = nextFiberChild ? nextFiberChild.sibling : null; - } - - if (nextChildSet != null) { - recordResetChildren(nextFiber, nextChildSet); - } // We've handled the child order change for this Fiber. - // Since it's included, there's no need to invalidate parent child order. - - - return false; - } else { - // Let the closest unfiltered parent Fiber reset its child order instead. - return true; - } - } else { - return false; - } - } - - function cleanup() {// We don't patch any methods so there is no cleanup. - } - - function rootSupportsProfiling(root) { - if (root.memoizedInteractions != null) { - // v16 builds include this field for the scheduler/tracing API. - return true; - } else if (root.current != null && root.current.hasOwnProperty('treeBaseDuration')) { - // The scheduler/tracing API was removed in v17 though - // so we need to check a non-root Fiber. - return true; - } else { - return false; - } - } - - function flushInitialOperations() { - const localPendingOperationsQueue = pendingOperationsQueue; - pendingOperationsQueue = null; - - if (localPendingOperationsQueue !== null && localPendingOperationsQueue.length > 0) { - // We may have already queued up some operations before the frontend connected - // If so, let the frontend know about them. - localPendingOperationsQueue.forEach(operations => { - hook.emit('operations', operations); - }); - } else { - // Before the traversals, remember to start tracking - // our path in case we have selection to restore. - if (trackedPath !== null) { - mightBeOnTrackedPath = true; - } // If we have not been profiling, then we can just walk the tree and build up its current state as-is. - - - hook.getFiberRoots(rendererID).forEach(root => { - currentRootID = getOrGenerateFiberID(root.current); - setRootPseudoKey(currentRootID, root.current); // Handle multi-renderer edge-case where only some v16 renderers support profiling. - - if (isProfiling && rootSupportsProfiling(root)) { - // If profiling is active, store commit time and duration. - // The frontend may request this information after profiling has stopped. - currentCommitProfilingMetadata = { - changeDescriptions: recordChangeDescriptions ? new Map() : null, - durations: [], - commitTime: renderer_getCurrentTime() - profilingStartTime, - maxActualDuration: 0, - priorityLevel: null, - updaters: getUpdatersList(root), - effectDuration: null, - passiveEffectDuration: null - }; - } - - mountFiberRecursively(root.current, null, false, false); - flushPendingEvents(root); - currentRootID = -1; - }); - } - } - - function getUpdatersList(root) { - return root.memoizedUpdaters != null ? Array.from(root.memoizedUpdaters).filter(fiber => getFiberIDUnsafe(fiber) !== null).map(fiberToSerializedElement) : null; - } - - function handleCommitFiberUnmount(fiber) { - // If the untrackFiberSet already has the unmounted Fiber, this means we've already - // recordedUnmount, so we don't need to do it again. If we don't do this, we might - // end up double-deleting Fibers in some cases (like Legacy Suspense). - if (!untrackFibersSet.has(fiber)) { - // This is not recursive. - // We can't traverse fibers after unmounting so instead - // we rely on React telling us about each unmount. - recordUnmount(fiber, false); - } - } - - function handlePostCommitFiberRoot(root) { - if (isProfiling && rootSupportsProfiling(root)) { - if (currentCommitProfilingMetadata !== null) { - const { - effectDuration, - passiveEffectDuration - } = Object(backend_utils["h" /* getEffectDurations */])(root); // $FlowFixMe[incompatible-use] found when upgrading Flow - - currentCommitProfilingMetadata.effectDuration = effectDuration; // $FlowFixMe[incompatible-use] found when upgrading Flow - - currentCommitProfilingMetadata.passiveEffectDuration = passiveEffectDuration; - } - } - } - - function handleCommitFiberRoot(root, priorityLevel) { - const current = root.current; - const alternate = current.alternate; // Flush any pending Fibers that we are untracking before processing the new commit. - // If we don't do this, we might end up double-deleting Fibers in some cases (like Legacy Suspense). - - untrackFibers(); - currentRootID = getOrGenerateFiberID(current); // Before the traversals, remember to start tracking - // our path in case we have selection to restore. - - if (trackedPath !== null) { - mightBeOnTrackedPath = true; - } - - if (traceUpdatesEnabled) { - traceUpdatesForNodes.clear(); - } // Handle multi-renderer edge-case where only some v16 renderers support profiling. - - - const isProfilingSupported = rootSupportsProfiling(root); - - if (isProfiling && isProfilingSupported) { - // If profiling is active, store commit time and duration. - // The frontend may request this information after profiling has stopped. - currentCommitProfilingMetadata = { - changeDescriptions: recordChangeDescriptions ? new Map() : null, - durations: [], - commitTime: renderer_getCurrentTime() - profilingStartTime, - maxActualDuration: 0, - priorityLevel: priorityLevel == null ? null : formatPriorityLevel(priorityLevel), - updaters: getUpdatersList(root), - // Initialize to null; if new enough React version is running, - // these values will be read during separate handlePostCommitFiberRoot() call. - effectDuration: null, - passiveEffectDuration: null - }; - } - - if (alternate) { - // TODO: relying on this seems a bit fishy. - const wasMounted = alternate.memoizedState != null && alternate.memoizedState.element != null && // A dehydrated root is not considered mounted - alternate.memoizedState.isDehydrated !== true; - const isMounted = current.memoizedState != null && current.memoizedState.element != null && // A dehydrated root is not considered mounted - current.memoizedState.isDehydrated !== true; - - if (!wasMounted && isMounted) { - // Mount a new root. - setRootPseudoKey(currentRootID, current); - mountFiberRecursively(current, null, false, false); - } else if (wasMounted && isMounted) { - // Update an existing root. - updateFiberRecursively(current, alternate, null, false); - } else if (wasMounted && !isMounted) { - // Unmount an existing root. - removeRootPseudoKey(currentRootID); - recordUnmount(current, false); - } - } else { - // Mount a new root. - setRootPseudoKey(currentRootID, current); - mountFiberRecursively(current, null, false, false); - } - - if (isProfiling && isProfilingSupported) { - if (!shouldBailoutWithPendingOperations()) { - const commitProfilingMetadata = rootToCommitProfilingMetadataMap.get(currentRootID); - - if (commitProfilingMetadata != null) { - commitProfilingMetadata.push(currentCommitProfilingMetadata); - } else { - rootToCommitProfilingMetadataMap.set(currentRootID, [currentCommitProfilingMetadata]); - } - } - } // We're done here. - - - flushPendingEvents(root); - - if (traceUpdatesEnabled) { - hook.emit('traceUpdates', traceUpdatesForNodes); - } - - currentRootID = -1; - } - - function findAllCurrentHostFibers(id) { - const fibers = []; - const fiber = findCurrentFiberUsingSlowPathById(id); - - if (!fiber) { - return fibers; - } // Next we'll drill down this component to find all HostComponent/Text. - - - let node = fiber; - - while (true) { - if (node.tag === HostComponent || node.tag === HostText) { - fibers.push(node); - } else if (node.child) { - node.child.return = node; - node = node.child; - continue; - } - - if (node === fiber) { - return fibers; - } - - while (!node.sibling) { - if (!node.return || node.return === fiber) { - return fibers; - } - - node = node.return; - } - - node.sibling.return = node.return; - node = node.sibling; - } // Flow needs the return here, but ESLint complains about it. - // eslint-disable-next-line no-unreachable - - - return fibers; - } - - function findNativeNodesForFiberID(id) { - try { - let fiber = findCurrentFiberUsingSlowPathById(id); - - if (fiber === null) { - return null; - } // Special case for a timed-out Suspense. - - - const isTimedOutSuspense = fiber.tag === SuspenseComponent && fiber.memoizedState !== null; - - if (isTimedOutSuspense) { - // A timed-out Suspense's findDOMNode is useless. - // Try our best to find the fallback directly. - const maybeFallbackFiber = fiber.child && fiber.child.sibling; - - if (maybeFallbackFiber != null) { - fiber = maybeFallbackFiber; - } - } - - const hostFibers = findAllCurrentHostFibers(id); - return hostFibers.map(hostFiber => hostFiber.stateNode).filter(Boolean); - } catch (err) { - // The fiber might have unmounted by now. - return null; - } - } - - function getDisplayNameForFiberID(id) { - const fiber = idToArbitraryFiberMap.get(id); - return fiber != null ? getDisplayNameForFiber(fiber) : null; - } - - function getFiberForNative(hostInstance) { - return renderer.findFiberByHostInstance(hostInstance); - } - - function getFiberIDForNative(hostInstance, findNearestUnfilteredAncestor = false) { - let fiber = renderer.findFiberByHostInstance(hostInstance); - - if (fiber != null) { - if (findNearestUnfilteredAncestor) { - while (fiber !== null && shouldFilterFiber(fiber)) { - fiber = fiber.return; - } - } - - return getFiberIDThrows(fiber); - } - - return null; - } // This function is copied from React and should be kept in sync: - // https://github.com/facebook/react/blob/main/packages/react-reconciler/src/ReactFiberTreeReflection.js - - - function assertIsMounted(fiber) { - if (getNearestMountedFiber(fiber) !== fiber) { - throw new Error('Unable to find node on an unmounted component.'); - } - } // This function is copied from React and should be kept in sync: - // https://github.com/facebook/react/blob/main/packages/react-reconciler/src/ReactFiberTreeReflection.js - - - function getNearestMountedFiber(fiber) { - let node = fiber; - let nearestMounted = fiber; - - if (!fiber.alternate) { - // If there is no alternate, this might be a new tree that isn't inserted - // yet. If it is, then it will have a pending insertion effect on it. - let nextNode = node; - - do { - node = nextNode; - - if ((node.flags & (Placement | Hydrating)) !== NoFlags) { - // This is an insertion or in-progress hydration. The nearest possible - // mounted fiber is the parent but we need to continue to figure out - // if that one is still mounted. - nearestMounted = node.return; - } // $FlowFixMe[incompatible-type] we bail out when we get a null - - - nextNode = node.return; - } while (nextNode); - } else { - while (node.return) { - node = node.return; - } - } - - if (node.tag === HostRoot) { - // TODO: Check if this was a nested HostRoot when used with - // renderContainerIntoSubtree. - return nearestMounted; - } // If we didn't hit the root, that means that we're in an disconnected tree - // that has been unmounted. - - - return null; - } // This function is copied from React and should be kept in sync: - // https://github.com/facebook/react/blob/main/packages/react-reconciler/src/ReactFiberTreeReflection.js - // It would be nice if we updated React to inject this function directly (vs just indirectly via findDOMNode). - // BEGIN copied code - - - function findCurrentFiberUsingSlowPathById(id) { - const fiber = idToArbitraryFiberMap.get(id); - - if (fiber == null) { - console.warn(`Could not find Fiber with id "${id}"`); - return null; - } - - const alternate = fiber.alternate; - - if (!alternate) { - // If there is no alternate, then we only need to check if it is mounted. - const nearestMounted = getNearestMountedFiber(fiber); - - if (nearestMounted === null) { - throw new Error('Unable to find node on an unmounted component.'); - } - - if (nearestMounted !== fiber) { - return null; - } - - return fiber; - } // If we have two possible branches, we'll walk backwards up to the root - // to see what path the root points to. On the way we may hit one of the - // special cases and we'll deal with them. - - - let a = fiber; - let b = alternate; - - while (true) { - const parentA = a.return; - - if (parentA === null) { - // We're at the root. - break; - } - - const parentB = parentA.alternate; - - if (parentB === null) { - // There is no alternate. This is an unusual case. Currently, it only - // happens when a Suspense component is hidden. An extra fragment fiber - // is inserted in between the Suspense fiber and its children. Skip - // over this extra fragment fiber and proceed to the next parent. - const nextParent = parentA.return; - - if (nextParent !== null) { - a = b = nextParent; - continue; - } // If there's no parent, we're at the root. - - - break; - } // If both copies of the parent fiber point to the same child, we can - // assume that the child is current. This happens when we bailout on low - // priority: the bailed out fiber's child reuses the current child. - - - if (parentA.child === parentB.child) { - let child = parentA.child; - - while (child) { - if (child === a) { - // We've determined that A is the current branch. - assertIsMounted(parentA); - return fiber; - } - - if (child === b) { - // We've determined that B is the current branch. - assertIsMounted(parentA); - return alternate; - } - - child = child.sibling; - } // We should never have an alternate for any mounting node. So the only - // way this could possibly happen is if this was unmounted, if at all. - - - throw new Error('Unable to find node on an unmounted component.'); - } - - if (a.return !== b.return) { - // The return pointer of A and the return pointer of B point to different - // fibers. We assume that return pointers never criss-cross, so A must - // belong to the child set of A.return, and B must belong to the child - // set of B.return. - a = parentA; - b = parentB; - } else { - // The return pointers point to the same fiber. We'll have to use the - // default, slow path: scan the child sets of each parent alternate to see - // which child belongs to which set. - // - // Search parent A's child set - let didFindChild = false; - let child = parentA.child; - - while (child) { - if (child === a) { - didFindChild = true; - a = parentA; - b = parentB; - break; - } - - if (child === b) { - didFindChild = true; - b = parentA; - a = parentB; - break; - } - - child = child.sibling; - } - - if (!didFindChild) { - // Search parent B's child set - child = parentB.child; - - while (child) { - if (child === a) { - didFindChild = true; - a = parentB; - b = parentA; - break; - } - - if (child === b) { - didFindChild = true; - b = parentB; - a = parentA; - break; - } - - child = child.sibling; - } - - if (!didFindChild) { - throw new Error('Child was not found in either parent set. This indicates a bug ' + 'in React related to the return pointer. Please file an issue.'); - } - } - } - - if (a.alternate !== b) { - throw new Error("Return fibers should always be each others' alternates. " + 'This error is likely caused by a bug in React. Please file an issue.'); - } - } // If the root is not a host container, we're in a disconnected tree. I.e. - // unmounted. - - - if (a.tag !== HostRoot) { - throw new Error('Unable to find node on an unmounted component.'); - } - - if (a.stateNode.current === a) { - // We've determined that A is the current branch. - return fiber; - } // Otherwise B has to be current branch. - - - return alternate; - } // END copied code - - - function prepareViewAttributeSource(id, path) { - if (isMostRecentlyInspectedElement(id)) { - window.$attribute = Object(utils["n" /* getInObject */])(mostRecentlyInspectedElement, path); - } - } - - function prepareViewElementSource(id) { - const fiber = idToArbitraryFiberMap.get(id); - - if (fiber == null) { - console.warn(`Could not find Fiber with id "${id}"`); - return; - } - - const { - elementType, - tag, - type - } = fiber; - - switch (tag) { - case ClassComponent: - case IncompleteClassComponent: - case IndeterminateComponent: - case FunctionComponent: - global.$type = type; - break; - - case ForwardRef: - global.$type = type.render; - break; - - case MemoComponent: - case SimpleMemoComponent: - global.$type = elementType != null && elementType.type != null ? elementType.type : type; - break; - - default: - global.$type = null; - break; - } - } - - function fiberToSerializedElement(fiber) { - return { - displayName: getDisplayNameForFiber(fiber) || 'Anonymous', - id: getFiberIDThrows(fiber), - key: fiber.key, - type: getElementTypeForFiber(fiber) - }; - } - - function getOwnersList(id) { - const fiber = findCurrentFiberUsingSlowPathById(id); - - if (fiber == null) { - return null; - } - - const { - _debugOwner - } = fiber; - const owners = [fiberToSerializedElement(fiber)]; - - if (_debugOwner) { - let owner = _debugOwner; - - while (owner !== null) { - owners.unshift(fiberToSerializedElement(owner)); - owner = owner._debugOwner || null; - } - } - - return owners; - } // Fast path props lookup for React Native style editor. - // Could use inspectElementRaw() but that would require shallow rendering hooks components, - // and could also mess with memoization. - - - function getInstanceAndStyle(id) { - let instance = null; - let style = null; - const fiber = findCurrentFiberUsingSlowPathById(id); - - if (fiber !== null) { - instance = fiber.stateNode; - - if (fiber.memoizedProps !== null) { - style = fiber.memoizedProps.style; - } - } - - return { - instance, - style - }; - } - - function isErrorBoundary(fiber) { - const { - tag, - type - } = fiber; - - switch (tag) { - case ClassComponent: - case IncompleteClassComponent: - const instance = fiber.stateNode; - return typeof type.getDerivedStateFromError === 'function' || instance !== null && typeof instance.componentDidCatch === 'function'; - - default: - return false; - } - } - - function getNearestErrorBoundaryID(fiber) { - let parent = fiber.return; - - while (parent !== null) { - if (isErrorBoundary(parent)) { - return getFiberIDUnsafe(parent); - } - - parent = parent.return; - } - - return null; - } - - function inspectElementRaw(id) { - const fiber = findCurrentFiberUsingSlowPathById(id); - - if (fiber == null) { - return null; - } - - const { - _debugOwner, - _debugSource, - stateNode, - key, - memoizedProps, - memoizedState, - dependencies, - tag, - type - } = fiber; - const elementType = getElementTypeForFiber(fiber); - const usesHooks = (tag === FunctionComponent || tag === SimpleMemoComponent || tag === ForwardRef) && (!!memoizedState || !!dependencies); // TODO Show custom UI for Cache like we do for Suspense - // For now, just hide state data entirely since it's not meant to be inspected. - - const showState = !usesHooks && tag !== CacheComponent; - const typeSymbol = getTypeSymbol(type); - let canViewSource = false; - let context = null; - - if (tag === ClassComponent || tag === FunctionComponent || tag === IncompleteClassComponent || tag === IndeterminateComponent || tag === MemoComponent || tag === ForwardRef || tag === SimpleMemoComponent) { - canViewSource = true; - - if (stateNode && stateNode.context != null) { - // Don't show an empty context object for class components that don't use the context API. - const shouldHideContext = elementType === types["e" /* ElementTypeClass */] && !(type.contextTypes || type.contextType); - - if (!shouldHideContext) { - context = stateNode.context; - } - } - } else if (typeSymbol === ReactSymbols["c" /* CONTEXT_NUMBER */] || typeSymbol === ReactSymbols["d" /* CONTEXT_SYMBOL_STRING */]) { - // 16.3-16.5 read from "type" because the Consumer is the actual context object. - // 16.6+ should read from "type._context" because Consumer can be different (in DEV). - // NOTE Keep in sync with getDisplayNameForFiber() - const consumerResolvedContext = type._context || type; // Global context value. - - context = consumerResolvedContext._currentValue || null; // Look for overridden value. - - let current = fiber.return; - - while (current !== null) { - const currentType = current.type; - const currentTypeSymbol = getTypeSymbol(currentType); - - if (currentTypeSymbol === ReactSymbols["n" /* PROVIDER_NUMBER */] || currentTypeSymbol === ReactSymbols["o" /* PROVIDER_SYMBOL_STRING */]) { - // 16.3.0 exposed the context object as "context" - // PR #12501 changed it to "_context" for 16.3.1+ - // NOTE Keep in sync with getDisplayNameForFiber() - const providerResolvedContext = currentType._context || currentType.context; - - if (providerResolvedContext === consumerResolvedContext) { - context = current.memoizedProps.value; - break; - } - } - - current = current.return; - } - } - - let hasLegacyContext = false; - - if (context !== null) { - hasLegacyContext = !!type.contextTypes; // To simplify hydration and display logic for context, wrap in a value object. - // Otherwise simple values (e.g. strings, booleans) become harder to handle. - - context = { - value: context - }; - } - - let owners = null; - - if (_debugOwner) { - owners = []; - let owner = _debugOwner; - - while (owner !== null) { - owners.push(fiberToSerializedElement(owner)); - owner = owner._debugOwner || null; - } - } - - const isTimedOutSuspense = tag === SuspenseComponent && memoizedState !== null; - let hooks = null; - - if (usesHooks) { - const originalConsoleMethods = {}; // Temporarily disable all console logging before re-running the hook. - - for (const method in console) { - try { - originalConsoleMethods[method] = console[method]; // $FlowFixMe[prop-missing] - - console[method] = () => {}; - } catch (error) {} - } - - try { - hooks = Object(react_debug_tools["inspectHooksOfFiber"])(fiber, renderer.currentDispatcherRef, true // Include source location info for hooks - ); - } finally { - // Restore original console functionality. - for (const method in originalConsoleMethods) { - try { - // $FlowFixMe[prop-missing] - console[method] = originalConsoleMethods[method]; - } catch (error) {} - } - } - } - - let rootType = null; - let current = fiber; - - while (current.return !== null) { - current = current.return; - } - - const fiberRoot = current.stateNode; - - if (fiberRoot != null && fiberRoot._debugRootType !== null) { - rootType = fiberRoot._debugRootType; - } - - const errors = fiberIDToErrorsMap.get(id) || new Map(); - const warnings = fiberIDToWarningsMap.get(id) || new Map(); - const isErrored = (fiber.flags & DidCapture) !== NoFlags || forceErrorForFiberIDs.get(id) === true; - let targetErrorBoundaryID; - - if (isErrorBoundary(fiber)) { - // if the current inspected element is an error boundary, - // either that we want to use it to toggle off error state - // or that we allow to force error state on it if it's within another - // error boundary - targetErrorBoundaryID = isErrored ? id : getNearestErrorBoundaryID(fiber); - } else { - targetErrorBoundaryID = getNearestErrorBoundaryID(fiber); - } - - const plugins = { - stylex: null - }; - - if (DevToolsFeatureFlags_extension_oss["f" /* enableStyleXFeatures */]) { - if (memoizedProps.hasOwnProperty('xstyle')) { - plugins.stylex = getStyleXData(memoizedProps.xstyle); - } - } - - return { - id, - // Does the current renderer support editable hooks and function props? - canEditHooks: typeof overrideHookState === 'function', - canEditFunctionProps: typeof overrideProps === 'function', - // Does the current renderer support advanced editing interface? - canEditHooksAndDeletePaths: typeof overrideHookStateDeletePath === 'function', - canEditHooksAndRenamePaths: typeof overrideHookStateRenamePath === 'function', - canEditFunctionPropsDeletePaths: typeof overridePropsDeletePath === 'function', - canEditFunctionPropsRenamePaths: typeof overridePropsRenamePath === 'function', - canToggleError: supportsTogglingError && targetErrorBoundaryID != null, - // Is this error boundary in error state. - isErrored, - targetErrorBoundaryID, - canToggleSuspense: supportsTogglingSuspense && ( // If it's showing the real content, we can always flip fallback. - !isTimedOutSuspense || // If it's showing fallback because we previously forced it to, - // allow toggling it back to remove the fallback override. - forceFallbackForSuspenseIDs.has(id)), - // Can view component source location. - canViewSource, - // Does the component have legacy context attached to it. - hasLegacyContext, - key: key != null ? key : null, - displayName: getDisplayNameForFiber(fiber), - type: elementType, - // Inspectable properties. - // TODO Review sanitization approach for the below inspectable values. - context, - hooks, - props: memoizedProps, - state: showState ? memoizedState : null, - errors: Array.from(errors.entries()), - warnings: Array.from(warnings.entries()), - // List of owners - owners, - // Location of component in source code. - source: _debugSource || null, - rootType, - rendererPackageName: renderer.rendererPackageName, - rendererVersion: renderer.version, - plugins - }; - } - - let mostRecentlyInspectedElement = null; - let hasElementUpdatedSinceLastInspected = false; - let currentlyInspectedPaths = {}; - - function isMostRecentlyInspectedElement(id) { - return mostRecentlyInspectedElement !== null && mostRecentlyInspectedElement.id === id; - } - - function isMostRecentlyInspectedElementCurrent(id) { - return isMostRecentlyInspectedElement(id) && !hasElementUpdatedSinceLastInspected; - } // Track the intersection of currently inspected paths, - // so that we can send their data along if the element is re-rendered. - - - function mergeInspectedPaths(path) { - let current = currentlyInspectedPaths; - path.forEach(key => { - if (!current[key]) { - current[key] = {}; - } - - current = current[key]; - }); - } - - function createIsPathAllowed(key, secondaryCategory) { - // This function helps prevent previously-inspected paths from being dehydrated in updates. - // This is important to avoid a bad user experience where expanded toggles collapse on update. - return function isPathAllowed(path) { - switch (secondaryCategory) { - case 'hooks': - if (path.length === 1) { - // Never dehydrate the "hooks" object at the top levels. - return true; - } - - if (path[path.length - 2] === 'hookSource' && path[path.length - 1] === 'fileName') { - // It's important to preserve the full file name (URL) for hook sources - // in case the user has enabled the named hooks feature. - // Otherwise the frontend may end up with a partial URL which it can't load. - return true; - } - - if (path[path.length - 1] === 'subHooks' || path[path.length - 2] === 'subHooks') { - // Dehydrating the 'subHooks' property makes the HooksTree UI a lot more complicated, - // so it's easiest for now if we just don't break on this boundary. - // We can always dehydrate a level deeper (in the value object). - return true; - } - - break; - - default: - break; - } - - let current = key === null ? currentlyInspectedPaths : currentlyInspectedPaths[key]; - - if (!current) { - return false; - } - - for (let i = 0; i < path.length; i++) { - current = current[path[i]]; - - if (!current) { - return false; - } - } - - return true; - }; - } - - function updateSelectedElement(inspectedElement) { - const { - hooks, - id, - props - } = inspectedElement; - const fiber = idToArbitraryFiberMap.get(id); - - if (fiber == null) { - console.warn(`Could not find Fiber with id "${id}"`); - return; - } - - const { - elementType, - stateNode, - tag, - type - } = fiber; - - switch (tag) { - case ClassComponent: - case IncompleteClassComponent: - case IndeterminateComponent: - global.$r = stateNode; - break; - - case FunctionComponent: - global.$r = { - hooks, - props, - type - }; - break; - - case ForwardRef: - global.$r = { - hooks, - props, - type: type.render - }; - break; - - case MemoComponent: - case SimpleMemoComponent: - global.$r = { - hooks, - props, - type: elementType != null && elementType.type != null ? elementType.type : type - }; - break; - - default: - global.$r = null; - break; - } - } - - function storeAsGlobal(id, path, count) { - if (isMostRecentlyInspectedElement(id)) { - const value = Object(utils["n" /* getInObject */])(mostRecentlyInspectedElement, path); - const key = `$reactTemp${count}`; - window[key] = value; - console.log(key); - console.log(value); - } - } - - function copyElementPath(id, path) { - if (isMostRecentlyInspectedElement(id)) { - Object(backend_utils["b" /* copyToClipboard */])(Object(utils["n" /* getInObject */])(mostRecentlyInspectedElement, path)); - } - } - - function inspectElement(requestID, id, path, forceFullData) { - if (path !== null) { - mergeInspectedPaths(path); - } - - if (isMostRecentlyInspectedElement(id) && !forceFullData) { - if (!hasElementUpdatedSinceLastInspected) { - if (path !== null) { - let secondaryCategory = null; - - if (path[0] === 'hooks') { - secondaryCategory = 'hooks'; - } // If this element has not been updated since it was last inspected, - // we can just return the subset of data in the newly-inspected path. - - - return { - id, - responseID: requestID, - type: 'hydrated-path', - path, - value: Object(backend_utils["a" /* cleanForBridge */])(Object(utils["n" /* getInObject */])(mostRecentlyInspectedElement, path), createIsPathAllowed(null, secondaryCategory), path) - }; - } else { - // If this element has not been updated since it was last inspected, we don't need to return it. - // Instead we can just return the ID to indicate that it has not changed. - return { - id, - responseID: requestID, - type: 'no-change' - }; - } - } - } else { - currentlyInspectedPaths = {}; - } - - hasElementUpdatedSinceLastInspected = false; - - try { - mostRecentlyInspectedElement = inspectElementRaw(id); - } catch (error) { - // the error name is synced with ReactDebugHooks - if (error.name === 'ReactDebugToolsRenderError') { - let message = 'Error rendering inspected element.'; - let stack; // Log error & cause for user to debug - - console.error(message + '\n\n', error); - - if (error.cause != null) { - const fiber = findCurrentFiberUsingSlowPathById(id); - const componentName = fiber != null ? getDisplayNameForFiber(fiber) : null; - console.error('React DevTools encountered an error while trying to inspect hooks. ' + 'This is most likely caused by an error in current inspected component' + (componentName != null ? `: "${componentName}".` : '.') + '\nThe error thrown in the component is: \n\n', error.cause); - - if (error.cause instanceof Error) { - message = error.cause.message || message; - stack = error.cause.stack; - } - } - - return { - type: 'error', - errorType: 'user', - id, - responseID: requestID, - message, - stack - }; - } // the error name is synced with ReactDebugHooks - - - if (error.name === 'ReactDebugToolsUnsupportedHookError') { - return { - type: 'error', - errorType: 'unknown-hook', - id, - responseID: requestID, - message: 'Unsupported hook in the react-debug-tools package: ' + error.message - }; - } // Log Uncaught Error - - - console.error('Error inspecting element.\n\n', error); - return { - type: 'error', - errorType: 'uncaught', - id, - responseID: requestID, - message: error.message, - stack: error.stack - }; - } - - if (mostRecentlyInspectedElement === null) { - return { - id, - responseID: requestID, - type: 'not-found' - }; - } // Any time an inspected element has an update, - // we should update the selected $r value as wel. - // Do this before dehydration (cleanForBridge). - - - updateSelectedElement(mostRecentlyInspectedElement); // Clone before cleaning so that we preserve the full data. - // This will enable us to send patches without re-inspecting if hydrated paths are requested. - // (Reducing how often we shallow-render is a better DX for function components that use hooks.) - - const cleanedInspectedElement = { ...mostRecentlyInspectedElement - }; // $FlowFixMe[prop-missing] found when upgrading Flow - - cleanedInspectedElement.context = Object(backend_utils["a" /* cleanForBridge */])(cleanedInspectedElement.context, createIsPathAllowed('context', null)); // $FlowFixMe[prop-missing] found when upgrading Flow - - cleanedInspectedElement.hooks = Object(backend_utils["a" /* cleanForBridge */])(cleanedInspectedElement.hooks, createIsPathAllowed('hooks', 'hooks')); // $FlowFixMe[prop-missing] found when upgrading Flow - - cleanedInspectedElement.props = Object(backend_utils["a" /* cleanForBridge */])(cleanedInspectedElement.props, createIsPathAllowed('props', null)); // $FlowFixMe[prop-missing] found when upgrading Flow - - cleanedInspectedElement.state = Object(backend_utils["a" /* cleanForBridge */])(cleanedInspectedElement.state, createIsPathAllowed('state', null)); - return { - id, - responseID: requestID, - type: 'full-data', - // $FlowFixMe[prop-missing] found when upgrading Flow - value: cleanedInspectedElement - }; - } - - function logElementToConsole(id) { - const result = isMostRecentlyInspectedElementCurrent(id) ? mostRecentlyInspectedElement : inspectElementRaw(id); - - if (result === null) { - console.warn(`Could not find Fiber with id "${id}"`); - return; - } - - const supportsGroup = typeof console.groupCollapsed === 'function'; - - if (supportsGroup) { - 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. - 'color: var(--dom-tag-name-color); font-weight: normal;'); - } - - if (result.props !== null) { - console.log('Props:', result.props); - } - - if (result.state !== null) { - console.log('State:', result.state); - } - - if (result.hooks !== null) { - console.log('Hooks:', result.hooks); - } - - const nativeNodes = findNativeNodesForFiberID(id); - - if (nativeNodes !== null) { - console.log('Nodes:', nativeNodes); - } - - if (result.source !== null) { - console.log('Location:', result.source); - } - - if (window.chrome || /firefox/i.test(navigator.userAgent)) { - console.log('Right-click any value to save it as a global variable for further inspection.'); - } - - if (supportsGroup) { - console.groupEnd(); - } - } - - function deletePath(type, id, hookID, path) { - const fiber = findCurrentFiberUsingSlowPathById(id); - - if (fiber !== null) { - const instance = fiber.stateNode; - - switch (type) { - case 'context': - // To simplify hydration and display of primitive context values (e.g. number, string) - // the inspectElement() method wraps context in a {value: ...} object. - // We need to remove the first part of the path (the "value") before continuing. - path = path.slice(1); - - switch (fiber.tag) { - case ClassComponent: - if (path.length === 0) {// Simple context value (noop) - } else { - Object(utils["c" /* deletePathInObject */])(instance.context, path); - } - - instance.forceUpdate(); - break; - - case FunctionComponent: - // Function components using legacy context are not editable - // because there's no instance on which to create a cloned, mutated context. - break; - } - - break; - - case 'hooks': - if (typeof overrideHookStateDeletePath === 'function') { - overrideHookStateDeletePath(fiber, hookID, path); - } - - break; - - case 'props': - if (instance === null) { - if (typeof overridePropsDeletePath === 'function') { - overridePropsDeletePath(fiber, path); - } - } else { - fiber.pendingProps = Object(backend_utils["c" /* copyWithDelete */])(instance.props, path); - instance.forceUpdate(); - } - - break; - - case 'state': - Object(utils["c" /* deletePathInObject */])(instance.state, path); - instance.forceUpdate(); - break; - } - } - } - - function renamePath(type, id, hookID, oldPath, newPath) { - const fiber = findCurrentFiberUsingSlowPathById(id); - - if (fiber !== null) { - const instance = fiber.stateNode; - - switch (type) { - case 'context': - // To simplify hydration and display of primitive context values (e.g. number, string) - // the inspectElement() method wraps context in a {value: ...} object. - // We need to remove the first part of the path (the "value") before continuing. - oldPath = oldPath.slice(1); - newPath = newPath.slice(1); - - switch (fiber.tag) { - case ClassComponent: - if (oldPath.length === 0) {// Simple context value (noop) - } else { - Object(utils["t" /* renamePathInObject */])(instance.context, oldPath, newPath); - } - - instance.forceUpdate(); - break; - - case FunctionComponent: - // Function components using legacy context are not editable - // because there's no instance on which to create a cloned, mutated context. - break; - } - - break; - - case 'hooks': - if (typeof overrideHookStateRenamePath === 'function') { - overrideHookStateRenamePath(fiber, hookID, oldPath, newPath); - } - - break; - - case 'props': - if (instance === null) { - if (typeof overridePropsRenamePath === 'function') { - overridePropsRenamePath(fiber, oldPath, newPath); - } - } else { - fiber.pendingProps = Object(backend_utils["d" /* copyWithRename */])(instance.props, oldPath, newPath); - instance.forceUpdate(); - } - - break; - - case 'state': - Object(utils["t" /* renamePathInObject */])(instance.state, oldPath, newPath); - instance.forceUpdate(); - break; - } - } - } - - function overrideValueAtPath(type, id, hookID, path, value) { - const fiber = findCurrentFiberUsingSlowPathById(id); - - if (fiber !== null) { - const instance = fiber.stateNode; - - switch (type) { - case 'context': - // To simplify hydration and display of primitive context values (e.g. number, string) - // the inspectElement() method wraps context in a {value: ...} object. - // We need to remove the first part of the path (the "value") before continuing. - path = path.slice(1); - - switch (fiber.tag) { - case ClassComponent: - if (path.length === 0) { - // Simple context value - instance.context = value; - } else { - Object(utils["v" /* setInObject */])(instance.context, path, value); - } - - instance.forceUpdate(); - break; - - case FunctionComponent: - // Function components using legacy context are not editable - // because there's no instance on which to create a cloned, mutated context. - break; - } - - break; - - case 'hooks': - if (typeof overrideHookState === 'function') { - overrideHookState(fiber, hookID, path, value); - } - - break; - - case 'props': - switch (fiber.tag) { - case ClassComponent: - fiber.pendingProps = Object(backend_utils["e" /* copyWithSet */])(instance.props, path, value); - instance.forceUpdate(); - break; - - default: - if (typeof overrideProps === 'function') { - overrideProps(fiber, path, value); - } - - break; - } - - break; - - case 'state': - switch (fiber.tag) { - case ClassComponent: - Object(utils["v" /* setInObject */])(instance.state, path, value); - instance.forceUpdate(); - break; - } - - break; - } - } - } - - let currentCommitProfilingMetadata = null; - let displayNamesByRootID = null; - let idToContextsMap = null; - let initialTreeBaseDurationsMap = null; - let initialIDToRootMap = null; - let isProfiling = false; - let profilingStartTime = 0; - let recordChangeDescriptions = false; - let rootToCommitProfilingMetadataMap = null; - - function getProfilingData() { - const dataForRoots = []; - - if (rootToCommitProfilingMetadataMap === null) { - throw Error('getProfilingData() called before any profiling data was recorded'); - } - - rootToCommitProfilingMetadataMap.forEach((commitProfilingMetadata, rootID) => { - const commitData = []; - const initialTreeBaseDurations = []; - const displayName = displayNamesByRootID !== null && displayNamesByRootID.get(rootID) || 'Unknown'; - - if (initialTreeBaseDurationsMap != null) { - initialTreeBaseDurationsMap.forEach((treeBaseDuration, id) => { - if (initialIDToRootMap != null && initialIDToRootMap.get(id) === rootID) { - // We don't need to convert milliseconds to microseconds in this case, - // because the profiling summary is JSON serialized. - initialTreeBaseDurations.push([id, treeBaseDuration]); - } - }); - } - - commitProfilingMetadata.forEach((commitProfilingData, commitIndex) => { - const { - changeDescriptions, - durations, - effectDuration, - maxActualDuration, - passiveEffectDuration, - priorityLevel, - commitTime, - updaters - } = commitProfilingData; - const fiberActualDurations = []; - const fiberSelfDurations = []; - - for (let i = 0; i < durations.length; i += 3) { - const fiberID = durations[i]; - fiberActualDurations.push([fiberID, durations[i + 1]]); - fiberSelfDurations.push([fiberID, durations[i + 2]]); - } - - commitData.push({ - changeDescriptions: changeDescriptions !== null ? Array.from(changeDescriptions.entries()) : null, - duration: maxActualDuration, - effectDuration, - fiberActualDurations, - fiberSelfDurations, - passiveEffectDuration, - priorityLevel, - timestamp: commitTime, - updaters - }); - }); - dataForRoots.push({ - commitData, - displayName, - initialTreeBaseDurations, - rootID - }); - }); - let timelineData = null; - - if (typeof getTimelineData === 'function') { - const currentTimelineData = getTimelineData(); - - if (currentTimelineData) { - const { - batchUIDToMeasuresMap, - internalModuleSourceToRanges, - laneToLabelMap, - laneToReactMeasureMap, - ...rest - } = currentTimelineData; - timelineData = { ...rest, - // Most of the data is safe to parse as-is, - // but we need to convert the nested Arrays back to Maps. - // Most of the data is safe to serialize as-is, - // but we need to convert the Maps to nested Arrays. - batchUIDToMeasuresKeyValueArray: Array.from(batchUIDToMeasuresMap.entries()), - internalModuleSourceToRanges: Array.from(internalModuleSourceToRanges.entries()), - laneToLabelKeyValueArray: Array.from(laneToLabelMap.entries()), - laneToReactMeasureKeyValueArray: Array.from(laneToReactMeasureMap.entries()) - }; - } - } - - return { - dataForRoots, - rendererID, - timelineData - }; - } - - function startProfiling(shouldRecordChangeDescriptions) { - if (isProfiling) { - return; - } - - recordChangeDescriptions = shouldRecordChangeDescriptions; // Capture initial values as of the time profiling starts. - // It's important we snapshot both the durations and the id-to-root map, - // since either of these may change during the profiling session - // (e.g. when a fiber is re-rendered or when a fiber gets removed). - - displayNamesByRootID = new Map(); - initialTreeBaseDurationsMap = new Map(idToTreeBaseDurationMap); - initialIDToRootMap = new Map(idToRootMap); - idToContextsMap = new Map(); - hook.getFiberRoots(rendererID).forEach(root => { - const rootID = getFiberIDThrows(root.current); - displayNamesByRootID.set(rootID, getDisplayNameForRoot(root.current)); - - if (shouldRecordChangeDescriptions) { - // Record all contexts at the time profiling is started. - // Fibers only store the current context value, - // so we need to track them separately in order to determine changed keys. - crawlToInitializeContextsMap(root.current); - } - }); - isProfiling = true; - profilingStartTime = renderer_getCurrentTime(); - rootToCommitProfilingMetadataMap = new Map(); - - if (toggleProfilingStatus !== null) { - toggleProfilingStatus(true); - } - } - - function stopProfiling() { - isProfiling = false; - recordChangeDescriptions = false; - - if (toggleProfilingStatus !== null) { - toggleProfilingStatus(false); - } - } // Automatically start profiling so that we don't miss timing info from initial "mount". - - - if (Object(storage["d" /* sessionStorageGetItem */])(constants["v" /* SESSION_STORAGE_RELOAD_AND_PROFILE_KEY */]) === 'true') { - startProfiling(Object(storage["d" /* sessionStorageGetItem */])(constants["u" /* SESSION_STORAGE_RECORD_CHANGE_DESCRIPTIONS_KEY */]) === 'true'); - } // React will switch between these implementations depending on whether - // we have any manually suspended/errored-out Fibers or not. - - - function shouldErrorFiberAlwaysNull() { - return null; - } // Map of id and its force error status: true (error), false (toggled off), - // null (do nothing) - - - const forceErrorForFiberIDs = new Map(); - - function shouldErrorFiberAccordingToMap(fiber) { - if (typeof setErrorHandler !== 'function') { - throw new Error('Expected overrideError() to not get called for earlier React versions.'); - } - - const id = getFiberIDUnsafe(fiber); - - if (id === null) { - return null; - } - - let status = null; - - if (forceErrorForFiberIDs.has(id)) { - status = forceErrorForFiberIDs.get(id); - - if (status === false) { - // TRICKY overrideError adds entries to this Map, - // so ideally it would be the method that clears them too, - // but that would break the functionality of the feature, - // since DevTools needs to tell React to act differently than it normally would - // (don't just re-render the failed boundary, but reset its errored state too). - // So we can only clear it after telling React to reset the state. - // Technically this is premature and we should schedule it for later, - // since the render could always fail without committing the updated error boundary, - // but since this is a DEV-only feature, the simplicity is worth the trade off. - forceErrorForFiberIDs.delete(id); - - if (forceErrorForFiberIDs.size === 0) { - // Last override is gone. Switch React back to fast path. - setErrorHandler(shouldErrorFiberAlwaysNull); - } - } - } - - return status; - } - - function overrideError(id, forceError) { - if (typeof setErrorHandler !== 'function' || typeof scheduleUpdate !== 'function') { - throw new Error('Expected overrideError() to not get called for earlier React versions.'); - } - - forceErrorForFiberIDs.set(id, forceError); - - if (forceErrorForFiberIDs.size === 1) { - // First override is added. Switch React to slower path. - setErrorHandler(shouldErrorFiberAccordingToMap); - } - - const fiber = idToArbitraryFiberMap.get(id); - - if (fiber != null) { - scheduleUpdate(fiber); - } - } - - function shouldSuspendFiberAlwaysFalse() { - return false; - } - - const forceFallbackForSuspenseIDs = new Set(); - - function shouldSuspendFiberAccordingToSet(fiber) { - const maybeID = getFiberIDUnsafe(fiber); - return maybeID !== null && forceFallbackForSuspenseIDs.has(maybeID); - } - - function overrideSuspense(id, forceFallback) { - if (typeof setSuspenseHandler !== 'function' || typeof scheduleUpdate !== 'function') { - throw new Error('Expected overrideSuspense() to not get called for earlier React versions.'); - } - - if (forceFallback) { - forceFallbackForSuspenseIDs.add(id); - - if (forceFallbackForSuspenseIDs.size === 1) { - // First override is added. Switch React to slower path. - setSuspenseHandler(shouldSuspendFiberAccordingToSet); - } - } else { - forceFallbackForSuspenseIDs.delete(id); - - if (forceFallbackForSuspenseIDs.size === 0) { - // Last override is gone. Switch React back to fast path. - setSuspenseHandler(shouldSuspendFiberAlwaysFalse); - } - } - - const fiber = idToArbitraryFiberMap.get(id); - - if (fiber != null) { - scheduleUpdate(fiber); - } - } // Remember if we're trying to restore the selection after reload. - // In that case, we'll do some extra checks for matching mounts. - - - let trackedPath = null; - let trackedPathMatchFiber = null; - let trackedPathMatchDepth = -1; - let mightBeOnTrackedPath = false; - - function setTrackedPath(path) { - if (path === null) { - trackedPathMatchFiber = null; - trackedPathMatchDepth = -1; - mightBeOnTrackedPath = false; - } - - trackedPath = path; - } // We call this before traversing a new mount. - // It remembers whether this Fiber is the next best match for tracked path. - // The return value signals whether we should keep matching siblings or not. - - - function updateTrackedPathStateBeforeMount(fiber) { - if (trackedPath === null || !mightBeOnTrackedPath) { - // Fast path: there's nothing to track so do nothing and ignore siblings. - return false; - } - - const returnFiber = fiber.return; - const returnAlternate = returnFiber !== null ? returnFiber.alternate : null; // By now we know there's some selection to restore, and this is a new Fiber. - // Is this newly mounted Fiber a direct child of the current best match? - // (This will also be true for new roots if we haven't matched anything yet.) - - if (trackedPathMatchFiber === returnFiber || trackedPathMatchFiber === returnAlternate && returnAlternate !== null) { - // Is this the next Fiber we should select? Let's compare the frames. - const actualFrame = getPathFrame(fiber); // $FlowFixMe[incompatible-use] found when upgrading Flow - - const expectedFrame = trackedPath[trackedPathMatchDepth + 1]; - - if (expectedFrame === undefined) { - throw new Error('Expected to see a frame at the next depth.'); - } - - if (actualFrame.index === expectedFrame.index && actualFrame.key === expectedFrame.key && actualFrame.displayName === expectedFrame.displayName) { - // We have our next match. - trackedPathMatchFiber = fiber; - trackedPathMatchDepth++; // Are we out of frames to match? - // $FlowFixMe[incompatible-use] found when upgrading Flow - - if (trackedPathMatchDepth === trackedPath.length - 1) { - // There's nothing that can possibly match afterwards. - // Don't check the children. - mightBeOnTrackedPath = false; - } else { - // Check the children, as they might reveal the next match. - mightBeOnTrackedPath = true; - } // In either case, since we have a match, we don't need - // to check the siblings. They'll never match. - - - return false; - } - } // This Fiber's parent is on the path, but this Fiber itself isn't. - // There's no need to check its children--they won't be on the path either. - - - mightBeOnTrackedPath = false; // However, one of its siblings may be on the path so keep searching. - - return true; - } - - function updateTrackedPathStateAfterMount(mightSiblingsBeOnTrackedPath) { - // updateTrackedPathStateBeforeMount() told us whether to match siblings. - // Now that we're entering siblings, let's use that information. - mightBeOnTrackedPath = mightSiblingsBeOnTrackedPath; - } // Roots don't have a real persistent identity. - // A root's "pseudo key" is "childDisplayName:indexWithThatName". - // For example, "App:0" or, in case of similar roots, "Story:0", "Story:1", etc. - // We will use this to try to disambiguate roots when restoring selection between reloads. - - - const rootPseudoKeys = new Map(); - const rootDisplayNameCounter = new Map(); - - function setRootPseudoKey(id, fiber) { - const name = getDisplayNameForRoot(fiber); - const counter = rootDisplayNameCounter.get(name) || 0; - rootDisplayNameCounter.set(name, counter + 1); - const pseudoKey = `${name}:${counter}`; - rootPseudoKeys.set(id, pseudoKey); - } - - function removeRootPseudoKey(id) { - const pseudoKey = rootPseudoKeys.get(id); - - if (pseudoKey === undefined) { - throw new Error('Expected root pseudo key to be known.'); - } - - const name = pseudoKey.substring(0, pseudoKey.lastIndexOf(':')); - const counter = rootDisplayNameCounter.get(name); - - if (counter === undefined) { - throw new Error('Expected counter to be known.'); - } - - if (counter > 1) { - rootDisplayNameCounter.set(name, counter - 1); - } else { - rootDisplayNameCounter.delete(name); - } - - rootPseudoKeys.delete(id); - } - - function getDisplayNameForRoot(fiber) { - let preferredDisplayName = null; - let fallbackDisplayName = null; - let child = fiber.child; // Go at most three levels deep into direct children - // while searching for a child that has a displayName. - - for (let i = 0; i < 3; i++) { - if (child === null) { - break; - } - - const displayName = getDisplayNameForFiber(child); - - if (displayName !== null) { - // Prefer display names that we get from user-defined components. - // We want to avoid using e.g. 'Suspense' unless we find nothing else. - if (typeof child.type === 'function') { - // There's a few user-defined tags, but we'll prefer the ones - // that are usually explicitly named (function or class components). - preferredDisplayName = displayName; - } else if (fallbackDisplayName === null) { - fallbackDisplayName = displayName; - } - } - - if (preferredDisplayName !== null) { - break; - } - - child = child.child; - } - - return preferredDisplayName || fallbackDisplayName || 'Anonymous'; - } - - function getPathFrame(fiber) { - const { - key - } = fiber; - let displayName = getDisplayNameForFiber(fiber); - const index = fiber.index; - - switch (fiber.tag) { - case HostRoot: - // Roots don't have a real displayName, index, or key. - // Instead, we'll use the pseudo key (childDisplayName:indexWithThatName). - const id = getFiberIDThrows(fiber); - const pseudoKey = rootPseudoKeys.get(id); - - if (pseudoKey === undefined) { - throw new Error('Expected mounted root to have known pseudo key.'); - } - - displayName = pseudoKey; - break; - - case HostComponent: - displayName = fiber.type; - break; - - default: - break; - } - - return { - displayName, - key, - index - }; - } // Produces a serializable representation that does a best effort - // of identifying a particular Fiber between page reloads. - // The return path will contain Fibers that are "invisible" to the store - // because their keys and indexes are important to restoring the selection. - - - function getPathForElement(id) { - let fiber = idToArbitraryFiberMap.get(id); - - if (fiber == null) { - return null; - } - - const keyPath = []; - - while (fiber !== null) { - // $FlowFixMe[incompatible-call] found when upgrading Flow - keyPath.push(getPathFrame(fiber)); // $FlowFixMe[incompatible-use] found when upgrading Flow - - fiber = fiber.return; - } - - keyPath.reverse(); - return keyPath; - } - - function getBestMatchForTrackedPath() { - if (trackedPath === null) { - // Nothing to match. - return null; - } - - if (trackedPathMatchFiber === null) { - // We didn't find anything. - return null; - } // Find the closest Fiber store is aware of. - - - let fiber = trackedPathMatchFiber; - - while (fiber !== null && shouldFilterFiber(fiber)) { - fiber = fiber.return; - } - - if (fiber === null) { - return null; - } - - return { - id: getFiberIDThrows(fiber), - // $FlowFixMe[incompatible-use] found when upgrading Flow - isFullMatch: trackedPathMatchDepth === trackedPath.length - 1 - }; - } - - const formatPriorityLevel = priorityLevel => { - if (priorityLevel == null) { - return 'Unknown'; - } - - switch (priorityLevel) { - case ImmediatePriority: - return 'Immediate'; - - case UserBlockingPriority: - return 'User-Blocking'; - - case NormalPriority: - return 'Normal'; - - case LowPriority: - return 'Low'; - - case IdlePriority: - return 'Idle'; - - case NoPriority: - default: - return 'Unknown'; - } - }; - - function setTraceUpdatesEnabled(isEnabled) { - traceUpdatesEnabled = isEnabled; - } - - return { - cleanup, - clearErrorsAndWarnings, - clearErrorsForFiberID, - clearWarningsForFiberID, - copyElementPath, - deletePath, - findNativeNodesForFiberID, - flushInitialOperations, - getBestMatchForTrackedPath, - getDisplayNameForFiberID, - getFiberForNative, - getFiberIDForNative, - getInstanceAndStyle, - getOwnersList, - getPathForElement, - getProfilingData, - handleCommitFiberRoot, - handleCommitFiberUnmount, - handlePostCommitFiberRoot, - inspectElement, - logElementToConsole, - patchConsoleForStrictMode: backend_console["b" /* patchForStrictMode */], - prepareViewAttributeSource, - prepareViewElementSource, - overrideError, - overrideSuspense, - overrideValueAtPath, - renamePath, - renderer, - setTraceUpdatesEnabled, - setTrackedPath, - startProfiling, - stopProfiling, - storeAsGlobal, - unpatchConsoleForStrictMode: backend_console["d" /* unpatchForStrictMode */], - updateComponentFilters - }; -} - -/***/ }), - -/***/ 55: -/***/ (function(module, exports) { - -var g; // This works in non-strict mode - -g = function () { - return this; -}(); - -try { - // This works if eval is allowed (see CSP) - g = g || new Function("return this")(); -} catch (e) { - // This works if the window reference is available - if (typeof window === "object") g = window; -} // g can still be undefined, but nothing to do about it... -// We return undefined, instead of nothing here, so it's -// easier to handle this case. if(!global) { ...} - - -module.exports = g; - -/***/ }), - -/***/ 56: -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (root, factory) { - 'use strict'; // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers. - - /* istanbul ignore next */ - - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(66)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else {} -})(this, function ErrorStackParser(StackFrame) { - 'use strict'; - - var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\S+:\d+/; - var CHROME_IE_STACK_REGEXP = /^\s*at .*(\S+:\d+|\(native\))/m; - var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\[native code])?$/; - return { - /** - * Given an Error object, extract the most information from it. - * - * @param {Error} error object - * @return {Array} of StackFrames - */ - parse: function ErrorStackParser$$parse(error) { - if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') { - return this.parseOpera(error); - } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) { - return this.parseV8OrIE(error); - } else if (error.stack) { - return this.parseFFOrSafari(error); - } else { - throw new Error('Cannot parse given Error object'); - } - }, - // Separate line and column numbers from a string of the form: (URI:Line:Column) - extractLocation: function ErrorStackParser$$extractLocation(urlLike) { - // Fail-fast but return locations like "(native)" - if (urlLike.indexOf(':') === -1) { - return [urlLike]; - } - - var regExp = /(.+?)(?::(\d+))?(?::(\d+))?$/; - var parts = regExp.exec(urlLike.replace(/[()]/g, '')); - return [parts[1], parts[2] || undefined, parts[3] || undefined]; - }, - parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) { - var filtered = error.stack.split('\n').filter(function (line) { - return !!line.match(CHROME_IE_STACK_REGEXP); - }, this); - return filtered.map(function (line) { - if (line.indexOf('(eval ') > -1) { - // Throw away eval information until we implement stacktrace.js/stackframe#8 - line = line.replace(/eval code/g, 'eval').replace(/(\(eval at [^()]*)|(\),.*$)/g, ''); - } - - var sanitizedLine = line.replace(/^\s+/, '').replace(/\(eval code/g, '('); // capture and preseve the parenthesized location "(/foo/my bar.js:12:87)" in - // case it has spaces in it, as the string is split on \s+ later on - - var location = sanitizedLine.match(/ (\((.+):(\d+):(\d+)\)$)/); // remove the parenthesized location from the line, if it was matched - - sanitizedLine = location ? sanitizedLine.replace(location[0], '') : sanitizedLine; - var tokens = sanitizedLine.split(/\s+/).slice(1); // if a location was matched, pass it to extractLocation() otherwise pop the last token - - var locationParts = this.extractLocation(location ? location[1] : tokens.pop()); - var functionName = tokens.join(' ') || undefined; - var fileName = ['eval', ''].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0]; - return new StackFrame({ - functionName: functionName, - fileName: fileName, - lineNumber: locationParts[1], - columnNumber: locationParts[2], - source: line - }); - }, this); - }, - parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) { - var filtered = error.stack.split('\n').filter(function (line) { - return !line.match(SAFARI_NATIVE_CODE_REGEXP); - }, this); - return filtered.map(function (line) { - // Throw away eval information until we implement stacktrace.js/stackframe#8 - if (line.indexOf(' > eval') > -1) { - line = line.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ':$1'); - } - - if (line.indexOf('@') === -1 && line.indexOf(':') === -1) { - // Safari eval frames only have function names and nothing else - return new StackFrame({ - functionName: line - }); - } else { - var functionNameRegex = /((.*".+"[^@]*)?[^@]*)(?:@)/; - var matches = line.match(functionNameRegex); - var functionName = matches && matches[1] ? matches[1] : undefined; - var locationParts = this.extractLocation(line.replace(functionNameRegex, '')); - return new StackFrame({ - functionName: functionName, - fileName: locationParts[0], - lineNumber: locationParts[1], - columnNumber: locationParts[2], - source: line - }); - } - }, this); - }, - parseOpera: function ErrorStackParser$$parseOpera(e) { - if (!e.stacktrace || e.message.indexOf('\n') > -1 && e.message.split('\n').length > e.stacktrace.split('\n').length) { - return this.parseOpera9(e); - } else if (!e.stack) { - return this.parseOpera10(e); - } else { - return this.parseOpera11(e); - } - }, - parseOpera9: function ErrorStackParser$$parseOpera9(e) { - var lineRE = /Line (\d+).*script (?:in )?(\S+)/i; - var lines = e.message.split('\n'); - var result = []; - - for (var i = 2, len = lines.length; i < len; i += 2) { - var match = lineRE.exec(lines[i]); - - if (match) { - result.push(new StackFrame({ - fileName: match[2], - lineNumber: match[1], - source: lines[i] - })); - } - } - - return result; - }, - parseOpera10: function ErrorStackParser$$parseOpera10(e) { - var lineRE = /Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i; - var lines = e.stacktrace.split('\n'); - var result = []; - - for (var i = 0, len = lines.length; i < len; i += 2) { - var match = lineRE.exec(lines[i]); - - if (match) { - result.push(new StackFrame({ - functionName: match[3] || undefined, - fileName: match[2], - lineNumber: match[1], - source: lines[i] - })); - } - } - - return result; - }, - // Opera 10.65+ Error.stack very similar to FF/Safari - parseOpera11: function ErrorStackParser$$parseOpera11(error) { - var filtered = error.stack.split('\n').filter(function (line) { - return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && !line.match(/^Error created at/); - }, this); - return filtered.map(function (line) { - var tokens = line.split('@'); - var locationParts = this.extractLocation(tokens.pop()); - var functionCall = tokens.shift() || ''; - var functionName = functionCall.replace(//, '$2').replace(/\([^)]*\)/g, '') || undefined; - var argsRaw; - - if (functionCall.match(/\(([^)]*)\)/)) { - argsRaw = functionCall.replace(/^[^(]+\(([^)]*)\)$/, '$1'); - } - - var args = argsRaw === undefined || argsRaw === '[arguments not available]' ? undefined : argsRaw.split(','); - return new StackFrame({ - functionName: functionName, - args: args, - fileName: locationParts[0], - lineNumber: locationParts[1], - columnNumber: locationParts[2], - source: line - }); - }, this); - } - }; -}); - -/***/ }), - -/***/ 61: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * @license React - * react.production.min.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - -var l = Symbol.for("react.element"), - n = Symbol.for("react.portal"), - p = Symbol.for("react.fragment"), - q = Symbol.for("react.strict_mode"), - r = Symbol.for("react.profiler"), - t = Symbol.for("react.provider"), - u = Symbol.for("react.context"), - v = Symbol.for("react.server_context"), - w = Symbol.for("react.forward_ref"), - x = Symbol.for("react.suspense"), - y = Symbol.for("react.suspense_list"), - z = Symbol.for("react.memo"), - A = Symbol.for("react.lazy"), - aa = Symbol.for("react.debug_trace_mode"), - ba = Symbol.for("react.offscreen"), - ca = Symbol.for("react.cache"), - B = Symbol.for("react.default_value"), - C = Symbol.iterator; - -function da(a) { - if (null === a || "object" !== typeof a) return null; - a = C && a[C] || a["@@iterator"]; - return "function" === typeof a ? a : null; -} - -var D = { - isMounted: function () { - return !1; - }, - enqueueForceUpdate: function () {}, - enqueueReplaceState: function () {}, - enqueueSetState: function () {} -}, - E = Object.assign, - F = {}; - -function G(a, b, d) { - this.props = a; - this.context = b; - this.refs = F; - this.updater = d || D; -} - -G.prototype.isReactComponent = {}; - -G.prototype.setState = function (a, b) { - if ("object" !== typeof a && "function" !== typeof a && null != a) throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables."); - this.updater.enqueueSetState(this, a, b, "setState"); -}; - -G.prototype.forceUpdate = function (a) { - this.updater.enqueueForceUpdate(this, a, "forceUpdate"); -}; - -function H() {} - -H.prototype = G.prototype; - -function I(a, b, d) { - this.props = a; - this.context = b; - this.refs = F; - this.updater = d || D; -} - -var J = I.prototype = new H(); -J.constructor = I; -E(J, G.prototype); -J.isPureReactComponent = !0; -var K = Array.isArray, - L = Object.prototype.hasOwnProperty, - M = { - current: null -}, - N = { - key: !0, - ref: !0, - __self: !0, - __source: !0 -}; - -function O(a, b, d) { - var c, - e = {}, - f = null, - g = null; - if (null != b) for (c in void 0 !== b.ref && (g = b.ref), void 0 !== b.key && (f = "" + b.key), b) L.call(b, c) && !N.hasOwnProperty(c) && (e[c] = b[c]); - var h = arguments.length - 2; - if (1 === h) e.children = d;else if (1 < h) { - for (var k = Array(h), m = 0; m < h; m++) k[m] = arguments[m + 2]; - - e.children = k; - } - if (a && a.defaultProps) for (c in h = a.defaultProps, h) void 0 === e[c] && (e[c] = h[c]); - return { - $$typeof: l, - type: a, - key: f, - ref: g, - props: e, - _owner: M.current - }; -} - -function ea(a, b) { - return { - $$typeof: l, - type: a.type, - key: b, - ref: a.ref, - props: a.props, - _owner: a._owner - }; -} - -function P(a) { - return "object" === typeof a && null !== a && a.$$typeof === l; -} - -function escape(a) { - var b = { - "=": "=0", - ":": "=2" - }; - return "$" + a.replace(/[=:]/g, function (a) { - return b[a]; - }); -} - -var Q = /\/+/g; - -function R(a, b) { - return "object" === typeof a && null !== a && null != a.key ? escape("" + a.key) : b.toString(36); -} - -function S(a, b, d, c, e) { - var f = typeof a; - if ("undefined" === f || "boolean" === f) a = null; - var g = !1; - if (null === a) g = !0;else switch (f) { - case "string": - case "number": - g = !0; - break; - - case "object": - switch (a.$$typeof) { - case l: - case n: - g = !0; - } - - } - if (g) return g = a, e = e(g), a = "" === c ? "." + R(g, 0) : c, K(e) ? (d = "", null != a && (d = a.replace(Q, "$&/") + "/"), S(e, b, d, "", function (a) { - return a; - })) : null != e && (P(e) && (e = ea(e, d + (!e.key || g && g.key === e.key ? "" : ("" + e.key).replace(Q, "$&/") + "/") + a)), b.push(e)), 1; - g = 0; - c = "" === c ? "." : c + ":"; - if (K(a)) for (var h = 0; h < a.length; h++) { - f = a[h]; - var k = c + R(f, h); - g += S(f, b, d, k, e); - } else if (k = da(a), "function" === typeof k) for (a = k.call(a), h = 0; !(f = a.next()).done;) f = f.value, k = c + R(f, h++), g += S(f, b, d, k, e);else if ("object" === f) throw b = String(a), Error("Objects are not valid as a React child (found: " + ("[object Object]" === b ? "object with keys {" + Object.keys(a).join(", ") + "}" : b) + "). If you meant to render a collection of children, use an array instead."); - return g; -} - -function T(a, b, d) { - if (null == a) return a; - var c = [], - e = 0; - S(a, c, "", "", function (a) { - return b.call(d, a, e++); - }); - return c; -} - -function fa(a) { - if (-1 === a._status) { - var b = a._result; - b = b(); - b.then(function (b) { - if (0 === a._status || -1 === a._status) a._status = 1, a._result = b; - }, function (b) { - if (0 === a._status || -1 === a._status) a._status = 2, a._result = b; - }); - -1 === a._status && (a._status = 0, a._result = b); - } - - if (1 === a._status) return a._result.default; - throw a._result; -} - -var U = { - current: null -}; - -function ha() { - return new WeakMap(); -} - -function V() { - return { - s: 0, - v: void 0, - o: null, - p: null - }; -} - -var W = { - current: null -}, - X = { - transition: null -}, - Y = { - ReactCurrentDispatcher: W, - ReactCurrentCache: U, - ReactCurrentBatchConfig: X, - ReactCurrentOwner: M, - ContextRegistry: {} -}, - Z = Y.ContextRegistry; -exports.Children = { - map: T, - forEach: function (a, b, d) { - T(a, function () { - b.apply(this, arguments); - }, d); - }, - count: function (a) { - var b = 0; - T(a, function () { - b++; - }); - return b; - }, - toArray: function (a) { - return T(a, function (a) { - return a; - }) || []; - }, - only: function (a) { - if (!P(a)) throw Error("React.Children.only expected to receive a single React element child."); - return a; - } -}; -exports.Component = G; -exports.Fragment = p; -exports.Profiler = r; -exports.PureComponent = I; -exports.StrictMode = q; -exports.Suspense = x; -exports.SuspenseList = y; -exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Y; - -exports.cache = function (a) { - return function () { - var b = U.current; - if (!b) return a.apply(null, arguments); - var d = b.getCacheForType(ha); - b = d.get(a); - void 0 === b && (b = V(), d.set(a, b)); - d = 0; - - for (var c = arguments.length; d < c; d++) { - var e = arguments[d]; - - if ("function" === typeof e || "object" === typeof e && null !== e) { - var f = b.o; - null === f && (b.o = f = new WeakMap()); - b = f.get(e); - void 0 === b && (b = V(), f.set(e, b)); - } else f = b.p, null === f && (b.p = f = new Map()), b = f.get(e), void 0 === b && (b = V(), f.set(e, b)); - } - - if (1 === b.s) return b.v; - if (2 === b.s) throw b.v; - - try { - var g = a.apply(null, arguments); - d = b; - d.s = 1; - return d.v = g; - } catch (h) { - throw g = b, g.s = 2, g.v = h, h; - } - }; -}; - -exports.cloneElement = function (a, b, d) { - if (null === a || void 0 === a) throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + a + "."); - var c = E({}, a.props), - e = a.key, - f = a.ref, - g = a._owner; - - if (null != b) { - void 0 !== b.ref && (f = b.ref, g = M.current); - void 0 !== b.key && (e = "" + b.key); - if (a.type && a.type.defaultProps) var h = a.type.defaultProps; - - for (k in b) L.call(b, k) && !N.hasOwnProperty(k) && (c[k] = void 0 === b[k] && void 0 !== h ? h[k] : b[k]); - } - - var k = arguments.length - 2; - if (1 === k) c.children = d;else if (1 < k) { - h = Array(k); - - for (var m = 0; m < k; m++) h[m] = arguments[m + 2]; - - c.children = h; - } - return { - $$typeof: l, - type: a.type, - key: e, - ref: f, - props: c, - _owner: g - }; -}; - -exports.createContext = function (a) { - a = { - $$typeof: u, - _currentValue: a, - _currentValue2: a, - _threadCount: 0, - Provider: null, - Consumer: null, - _defaultValue: null, - _globalName: null - }; - a.Provider = { - $$typeof: t, - _context: a - }; - return a.Consumer = a; -}; - -exports.createElement = O; - -exports.createFactory = function (a) { - var b = O.bind(null, a); - b.type = a; - return b; -}; - -exports.createRef = function () { - return { - current: null - }; -}; - -exports.createServerContext = function (a, b) { - var d = !0; - - if (!Z[a]) { - d = !1; - var c = { - $$typeof: v, - _currentValue: b, - _currentValue2: b, - _defaultValue: b, - _threadCount: 0, - Provider: null, - Consumer: null, - _globalName: a - }; - c.Provider = { - $$typeof: t, - _context: c - }; - Z[a] = c; - } - - c = Z[a]; - if (c._defaultValue === B) c._defaultValue = b, c._currentValue === B && (c._currentValue = b), c._currentValue2 === B && (c._currentValue2 = b);else if (d) throw Error("ServerContext: " + a + " already defined"); - return c; -}; - -exports.experimental_useEffectEvent = function (a) { - return W.current.useEffectEvent(a); -}; - -exports.forwardRef = function (a) { - return { - $$typeof: w, - render: a - }; -}; - -exports.isValidElement = P; - -exports.lazy = function (a) { - return { - $$typeof: A, - _payload: { - _status: -1, - _result: a - }, - _init: fa - }; -}; - -exports.memo = function (a, b) { - return { - $$typeof: z, - type: a, - compare: void 0 === b ? null : b - }; -}; - -exports.startTransition = function (a) { - var b = X.transition; - X.transition = {}; - - try { - a(); - } finally { - X.transition = b; - } -}; - -exports.unstable_Cache = ca; -exports.unstable_DebugTracingMode = aa; -exports.unstable_Offscreen = ba; - -exports.unstable_act = function () { - throw Error("act(...) is not supported in production builds of React."); -}; - -exports.unstable_getCacheForType = function (a) { - var b = U.current; - return b ? b.getCacheForType(a) : a(); -}; - -exports.unstable_getCacheSignal = function () { - var a = U.current; - return a ? a.getCacheSignal() : (a = new AbortController(), a.abort(Error("This CacheSignal was requested outside React which means that it is immediately aborted.")), a.signal); -}; - -exports.unstable_useCacheRefresh = function () { - return W.current.useCacheRefresh(); -}; - -exports.unstable_useMemoCache = function (a) { - return W.current.useMemoCache(a); -}; - -exports.use = function (a) { - return W.current.use(a); -}; - -exports.useCallback = function (a, b) { - return W.current.useCallback(a, b); -}; - -exports.useContext = function (a) { - return W.current.useContext(a); -}; - -exports.useDebugValue = function () {}; - -exports.useDeferredValue = function (a) { - return W.current.useDeferredValue(a); -}; - -exports.useEffect = function (a, b) { - return W.current.useEffect(a, b); -}; - -exports.useId = function () { - return W.current.useId(); -}; - -exports.useImperativeHandle = function (a, b, d) { - return W.current.useImperativeHandle(a, b, d); -}; - -exports.useInsertionEffect = function (a, b) { - return W.current.useInsertionEffect(a, b); -}; - -exports.useLayoutEffect = function (a, b) { - return W.current.useLayoutEffect(a, b); -}; - -exports.useMemo = function (a, b) { - return W.current.useMemo(a, b); -}; - -exports.useReducer = function (a, b, d) { - return W.current.useReducer(a, b, d); -}; - -exports.useRef = function (a) { - return W.current.useRef(a); -}; - -exports.useState = function (a) { - return W.current.useState(a); -}; - -exports.useSyncExternalStore = function (a, b, d) { - return W.current.useSyncExternalStore(a, b, d); -}; - -exports.useTransition = function () { - return W.current.useTransition(); -}; - -exports.version = "18.2.0"; - -/***/ }), - -/***/ 62: -/***/ (function(module, exports) { - -// shim for using process in browser -var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. - -var cachedSetTimeout; -var cachedClearTimeout; - -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); -} - -function defaultClearTimeout() { - throw new Error('clearTimeout has not been defined'); -} - -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -})(); - -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } // if setTimeout wasn't available but was latter defined - - - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch (e) { - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch (e) { - // 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 - return cachedSetTimeout.call(this, fun, 0); - } - } -} - -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } // if clearTimeout wasn't available but was latter defined - - - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e) { - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e) { - // 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. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } -} - -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - - draining = false; - - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - - var timeout = runTimeout(cleanUpNextTick); - draining = true; - var len = queue.length; - - while (len) { - currentQueue = queue; - queue = []; - - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - - queueIndex = -1; - len = queue.length; - } - - currentQueue = null; - draining = false; - runClearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - - queue.push(new Item(fun, args)); - - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; // v8 likes predictible objects - - -function Item(fun, array) { - this.fun = fun; - this.array = array; -} - -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; - -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues - -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; - -process.listeners = function (name) { - return []; -}; - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { - return '/'; -}; - -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; - -process.umask = function () { - return 0; -}; - -/***/ }), - -/***/ 63: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = Yallist; -Yallist.Node = Node; -Yallist.create = Yallist; - -function Yallist(list) { - var self = this; - - if (!(self instanceof Yallist)) { - self = new Yallist(); - } - - self.tail = null; - self.head = null; - self.length = 0; - - if (list && typeof list.forEach === 'function') { - list.forEach(function (item) { - self.push(item); - }); - } else if (arguments.length > 0) { - for (var i = 0, l = arguments.length; i < l; i++) { - self.push(arguments[i]); - } - } - - return self; -} - -Yallist.prototype.removeNode = function (node) { - if (node.list !== this) { - throw new Error('removing node which does not belong to this list'); - } - - var next = node.next; - var prev = node.prev; - - if (next) { - next.prev = prev; - } - - if (prev) { - prev.next = next; - } - - if (node === this.head) { - this.head = next; - } - - if (node === this.tail) { - this.tail = prev; - } - - node.list.length--; - node.next = null; - node.prev = null; - node.list = null; - return next; -}; - -Yallist.prototype.unshiftNode = function (node) { - if (node === this.head) { - return; - } - - if (node.list) { - node.list.removeNode(node); - } - - var head = this.head; - node.list = this; - node.next = head; - - if (head) { - head.prev = node; - } - - this.head = node; - - if (!this.tail) { - this.tail = node; - } - - this.length++; -}; - -Yallist.prototype.pushNode = function (node) { - if (node === this.tail) { - return; - } - - if (node.list) { - node.list.removeNode(node); - } - - var tail = this.tail; - node.list = this; - node.prev = tail; - - if (tail) { - tail.next = node; - } - - this.tail = node; - - if (!this.head) { - this.head = node; - } - - this.length++; -}; - -Yallist.prototype.push = function () { - for (var i = 0, l = arguments.length; i < l; i++) { - push(this, arguments[i]); - } - - return this.length; -}; - -Yallist.prototype.unshift = function () { - for (var i = 0, l = arguments.length; i < l; i++) { - unshift(this, arguments[i]); - } - - return this.length; -}; - -Yallist.prototype.pop = function () { - if (!this.tail) { - return undefined; - } - - var res = this.tail.value; - this.tail = this.tail.prev; - - if (this.tail) { - this.tail.next = null; - } else { - this.head = null; - } - - this.length--; - return res; -}; - -Yallist.prototype.shift = function () { - if (!this.head) { - return undefined; - } - - var res = this.head.value; - this.head = this.head.next; - - if (this.head) { - this.head.prev = null; - } else { - this.tail = null; - } - - this.length--; - return res; -}; - -Yallist.prototype.forEach = function (fn, thisp) { - thisp = thisp || this; - - for (var walker = this.head, i = 0; walker !== null; i++) { - fn.call(thisp, walker.value, i, this); - walker = walker.next; - } -}; - -Yallist.prototype.forEachReverse = function (fn, thisp) { - thisp = thisp || this; - - for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { - fn.call(thisp, walker.value, i, this); - walker = walker.prev; - } -}; - -Yallist.prototype.get = function (n) { - for (var i = 0, walker = this.head; walker !== null && i < n; i++) { - // abort out of the list early if we hit a cycle - walker = walker.next; - } - - if (i === n && walker !== null) { - return walker.value; - } -}; - -Yallist.prototype.getReverse = function (n) { - for (var i = 0, walker = this.tail; walker !== null && i < n; i++) { - // abort out of the list early if we hit a cycle - walker = walker.prev; - } - - if (i === n && walker !== null) { - return walker.value; - } -}; - -Yallist.prototype.map = function (fn, thisp) { - thisp = thisp || this; - var res = new Yallist(); - - for (var walker = this.head; walker !== null;) { - res.push(fn.call(thisp, walker.value, this)); - walker = walker.next; - } - - return res; -}; - -Yallist.prototype.mapReverse = function (fn, thisp) { - thisp = thisp || this; - var res = new Yallist(); - - for (var walker = this.tail; walker !== null;) { - res.push(fn.call(thisp, walker.value, this)); - walker = walker.prev; - } - - return res; -}; - -Yallist.prototype.reduce = function (fn, initial) { - var acc; - var walker = this.head; - - if (arguments.length > 1) { - acc = initial; - } else if (this.head) { - walker = this.head.next; - acc = this.head.value; - } else { - throw new TypeError('Reduce of empty list with no initial value'); - } - - for (var i = 0; walker !== null; i++) { - acc = fn(acc, walker.value, i); - walker = walker.next; - } - - return acc; -}; - -Yallist.prototype.reduceReverse = function (fn, initial) { - var acc; - var walker = this.tail; - - if (arguments.length > 1) { - acc = initial; - } else if (this.tail) { - walker = this.tail.prev; - acc = this.tail.value; - } else { - throw new TypeError('Reduce of empty list with no initial value'); - } - - for (var i = this.length - 1; walker !== null; i--) { - acc = fn(acc, walker.value, i); - walker = walker.prev; - } - - return acc; -}; - -Yallist.prototype.toArray = function () { - var arr = new Array(this.length); - - for (var i = 0, walker = this.head; walker !== null; i++) { - arr[i] = walker.value; - walker = walker.next; - } - - return arr; -}; - -Yallist.prototype.toArrayReverse = function () { - var arr = new Array(this.length); - - for (var i = 0, walker = this.tail; walker !== null; i++) { - arr[i] = walker.value; - walker = walker.prev; - } - - return arr; -}; - -Yallist.prototype.slice = function (from, to) { - to = to || this.length; - - if (to < 0) { - to += this.length; - } - - from = from || 0; - - if (from < 0) { - from += this.length; - } - - var ret = new Yallist(); - - if (to < from || to < 0) { - return ret; - } - - if (from < 0) { - from = 0; - } - - if (to > this.length) { - to = this.length; - } - - for (var i = 0, walker = this.head; walker !== null && i < from; i++) { - walker = walker.next; - } - - for (; walker !== null && i < to; i++, walker = walker.next) { - ret.push(walker.value); - } - - return ret; -}; - -Yallist.prototype.sliceReverse = function (from, to) { - to = to || this.length; - - if (to < 0) { - to += this.length; - } - - from = from || 0; - - if (from < 0) { - from += this.length; - } - - var ret = new Yallist(); - - if (to < from || to < 0) { - return ret; - } - - if (from < 0) { - from = 0; - } - - if (to > this.length) { - to = this.length; - } - - for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) { - walker = walker.prev; - } - - for (; walker !== null && i > from; i--, walker = walker.prev) { - ret.push(walker.value); - } - - return ret; -}; - -Yallist.prototype.splice = function (start, deleteCount -/*, ...nodes */ -) { - if (start > this.length) { - start = this.length - 1; - } - - if (start < 0) { - start = this.length + start; - } - - for (var i = 0, walker = this.head; walker !== null && i < start; i++) { - walker = walker.next; - } - - var ret = []; - - for (var i = 0; walker && i < deleteCount; i++) { - ret.push(walker.value); - walker = this.removeNode(walker); - } - - if (walker === null) { - walker = this.tail; - } - - if (walker !== this.head && walker !== this.tail) { - walker = walker.prev; - } - - for (var i = 2; i < arguments.length; i++) { - walker = insert(this, walker, arguments[i]); - } - - return ret; -}; - -Yallist.prototype.reverse = function () { - var head = this.head; - var tail = this.tail; - - for (var walker = head; walker !== null; walker = walker.prev) { - var p = walker.prev; - walker.prev = walker.next; - walker.next = p; - } - - this.head = tail; - this.tail = head; - return this; -}; - -function insert(self, node, value) { - var inserted = node === self.head ? new Node(value, null, node, self) : new Node(value, node, node.next, self); - - if (inserted.next === null) { - self.tail = inserted; - } - - if (inserted.prev === null) { - self.head = inserted; - } - - self.length++; - return inserted; -} - -function push(self, item) { - self.tail = new Node(item, self.tail, null, self); - - if (!self.head) { - self.head = self.tail; - } - - self.length++; -} - -function unshift(self, item) { - self.head = new Node(item, null, self.head, self); - - if (!self.tail) { - self.tail = self.head; - } - - self.length++; -} - -function Node(value, prev, next, list) { - if (!(this instanceof Node)) { - return new Node(value, prev, next, list); - } - - this.list = list; - this.value = value; - - if (prev) { - prev.next = this; - this.prev = prev; - } else { - this.prev = null; - } - - if (next) { - next.prev = this; - this.next = next; - } else { - this.next = null; - } -} - -try { - // add if support for Symbol.iterator is present - __webpack_require__(64)(Yallist); -} catch (er) {} - -/***/ }), - -/***/ 64: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = function (Yallist) { - Yallist.prototype[Symbol.iterator] = function* () { - for (let walker = this.head; walker; walker = walker.next) { - yield walker.value; - } - }; -}; - -/***/ }), - -/***/ 65: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * @license React - * react-is.production.min.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - -var b = Symbol.for("react.element"), - c = Symbol.for("react.portal"), - d = Symbol.for("react.fragment"), - e = Symbol.for("react.strict_mode"), - f = Symbol.for("react.profiler"), - g = Symbol.for("react.provider"), - h = Symbol.for("react.context"), - k = Symbol.for("react.server_context"), - l = Symbol.for("react.forward_ref"), - m = Symbol.for("react.suspense"), - n = Symbol.for("react.suspense_list"), - p = Symbol.for("react.memo"), - q = Symbol.for("react.lazy"), - t = Symbol.for("react.offscreen"), - u = Symbol.for("react.cache"), - v = Symbol.for("react.module.reference"); - -function w(a) { - if ("object" === typeof a && null !== a) { - var r = a.$$typeof; - - switch (r) { - case b: - switch (a = a.type, a) { - case d: - case f: - case e: - case m: - case n: - return a; - - default: - switch (a = a && a.$$typeof, a) { - case k: - case h: - case l: - case q: - case p: - case g: - return a; - - default: - return r; - } - - } - - case c: - return r; - } - } -} - -exports.ContextConsumer = h; -exports.ContextProvider = g; -exports.Element = b; -exports.ForwardRef = l; -exports.Fragment = d; -exports.Lazy = q; -exports.Memo = p; -exports.Portal = c; -exports.Profiler = f; -exports.StrictMode = e; -exports.Suspense = m; -exports.SuspenseList = n; - -exports.isAsyncMode = function () { - return !1; -}; - -exports.isConcurrentMode = function () { - return !1; -}; - -exports.isContextConsumer = function (a) { - return w(a) === h; -}; - -exports.isContextProvider = function (a) { - return w(a) === g; -}; - -exports.isElement = function (a) { - return "object" === typeof a && null !== a && a.$$typeof === b; -}; - -exports.isForwardRef = function (a) { - return w(a) === l; -}; - -exports.isFragment = function (a) { - return w(a) === d; -}; - -exports.isLazy = function (a) { - return w(a) === q; -}; - -exports.isMemo = function (a) { - return w(a) === p; -}; - -exports.isPortal = function (a) { - return w(a) === c; -}; - -exports.isProfiler = function (a) { - return w(a) === f; -}; - -exports.isStrictMode = function (a) { - return w(a) === e; -}; - -exports.isSuspense = function (a) { - return w(a) === m; -}; - -exports.isSuspenseList = function (a) { - return w(a) === n; -}; - -exports.isValidElementType = function (a) { - return "string" === typeof a || "function" === typeof a || a === d || a === f || a === e || a === m || a === n || a === t || a === u || "object" === typeof a && null !== a && (a.$$typeof === q || a.$$typeof === p || a.$$typeof === g || a.$$typeof === h || a.$$typeof === l || a.$$typeof === v || void 0 !== a.getModuleId) ? !0 : !1; -}; - -exports.typeOf = w; - -/***/ }), - -/***/ 66: -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (root, factory) { - 'use strict'; // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers. - - /* istanbul ignore next */ - - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else {} -})(this, function () { - 'use strict'; - - function _isNumber(n) { - return !isNaN(parseFloat(n)) && isFinite(n); - } - - function _capitalize(str) { - return str.charAt(0).toUpperCase() + str.substring(1); - } - - function _getter(p) { - return function () { - return this[p]; - }; - } - - var booleanProps = ['isConstructor', 'isEval', 'isNative', 'isToplevel']; - var numericProps = ['columnNumber', 'lineNumber']; - var stringProps = ['fileName', 'functionName', 'source']; - var arrayProps = ['args']; - var props = booleanProps.concat(numericProps, stringProps, arrayProps); - - function StackFrame(obj) { - if (!obj) return; - - for (var i = 0; i < props.length; i++) { - if (obj[props[i]] !== undefined) { - this['set' + _capitalize(props[i])](obj[props[i]]); - } - } - } - - StackFrame.prototype = { - getArgs: function () { - return this.args; - }, - setArgs: function (v) { - if (Object.prototype.toString.call(v) !== '[object Array]') { - throw new TypeError('Args must be an Array'); - } - - this.args = v; - }, - getEvalOrigin: function () { - return this.evalOrigin; - }, - setEvalOrigin: function (v) { - if (v instanceof StackFrame) { - this.evalOrigin = v; - } else if (v instanceof Object) { - this.evalOrigin = new StackFrame(v); - } else { - throw new TypeError('Eval Origin must be an Object or StackFrame'); - } - }, - toString: function () { - var fileName = this.getFileName() || ''; - var lineNumber = this.getLineNumber() || ''; - var columnNumber = this.getColumnNumber() || ''; - var functionName = this.getFunctionName() || ''; - - if (this.getIsEval()) { - if (fileName) { - return '[eval] (' + fileName + ':' + lineNumber + ':' + columnNumber + ')'; - } - - return '[eval]:' + lineNumber + ':' + columnNumber; - } - - if (functionName) { - return functionName + ' (' + fileName + ':' + lineNumber + ':' + columnNumber + ')'; - } - - return fileName + ':' + lineNumber + ':' + columnNumber; - } - }; - - StackFrame.fromString = function StackFrame$$fromString(str) { - var argsStartIndex = str.indexOf('('); - var argsEndIndex = str.lastIndexOf(')'); - var functionName = str.substring(0, argsStartIndex); - var args = str.substring(argsStartIndex + 1, argsEndIndex).split(','); - var locationString = str.substring(argsEndIndex + 1); - - if (locationString.indexOf('@') === 0) { - var parts = /@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(locationString, ''); - var fileName = parts[1]; - var lineNumber = parts[2]; - var columnNumber = parts[3]; - } - - return new StackFrame({ - functionName: functionName, - args: args || undefined, - fileName: fileName, - lineNumber: lineNumber || undefined, - columnNumber: columnNumber || undefined - }); - }; - - for (var i = 0; i < booleanProps.length; i++) { - StackFrame.prototype['get' + _capitalize(booleanProps[i])] = _getter(booleanProps[i]); - - StackFrame.prototype['set' + _capitalize(booleanProps[i])] = function (p) { - return function (v) { - this[p] = Boolean(v); - }; - }(booleanProps[i]); - } - - for (var j = 0; j < numericProps.length; j++) { - StackFrame.prototype['get' + _capitalize(numericProps[j])] = _getter(numericProps[j]); - - StackFrame.prototype['set' + _capitalize(numericProps[j])] = function (p) { - return function (v) { - if (!_isNumber(v)) { - throw new TypeError(p + ' must be a Number'); - } - - this[p] = Number(v); - }; - }(numericProps[j]); - } - - for (var k = 0; k < stringProps.length; k++) { - StackFrame.prototype['get' + _capitalize(stringProps[k])] = _getter(stringProps[k]); - - StackFrame.prototype['set' + _capitalize(stringProps[k])] = function (p) { - return function (v) { - this[p] = String(v); - }; - }(stringProps[k]); - } - - return StackFrame; -}); - -/***/ }), - -/***/ 67: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -if (true) { - module.exports = __webpack_require__(83); -} else {} - -/***/ }), - -/***/ 8: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return localStorageGetItem; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return localStorageRemoveItem; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return localStorageSetItem; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return sessionStorageGetItem; }); -/* unused harmony export sessionStorageRemoveItem */ -/* unused harmony export sessionStorageSetItem */ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ -function localStorageGetItem(key) { - try { - return localStorage.getItem(key); - } catch (error) { - return null; - } -} -function localStorageRemoveItem(key) { - try { - localStorage.removeItem(key); - } catch (error) {} -} -function localStorageSetItem(key, value) { - try { - return localStorage.setItem(key, value); - } catch (error) {} -} -function sessionStorageGetItem(key) { - try { - return sessionStorage.getItem(key); - } catch (error) { - return null; - } -} -function sessionStorageRemoveItem(key) { - try { - sessionStorage.removeItem(key); - } catch (error) {} -} -function sessionStorageSetItem(key, value) { - try { - return sessionStorage.setItem(key, value); - } catch (error) {} -} - -/***/ }), - -/***/ 83: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * @license React - * react-debug-tools.production.min.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - -var h = __webpack_require__(56), - p = __webpack_require__(0), - q = Object.assign, - w = p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, - x = [], - y = null; - -function z() { - if (null === y) { - var a = new Map(); - - try { - A.useContext({ - _currentValue: null - }), A.useState(null), A.useReducer(function (a) { - return a; - }, null), A.useRef(null), "function" === typeof A.useCacheRefresh && A.useCacheRefresh(), A.useLayoutEffect(function () {}), A.useInsertionEffect(function () {}), A.useEffect(function () {}), A.useImperativeHandle(void 0, function () { - return null; - }), A.useDebugValue(null), A.useCallback(function () {}), A.useMemo(function () { - return null; - }); - } finally { - var b = x; - x = []; - } - - for (var e = 0; e < b.length; e++) { - var g = b[e]; - a.set(g.primitive, h.parse(g.stackError)); - } - - y = a; - } - - return y; -} - -var B = null; - -function C() { - var a = B; - null !== a && (B = a.next); - return a; -} - -var A = { - readContext: function (a) { - return a._currentValue; - }, - useCacheRefresh: function () { - var a = C(); - x.push({ - primitive: "CacheRefresh", - stackError: Error(), - value: null !== a ? a.memoizedState : function () {} - }); - return function () {}; - }, - useCallback: function (a) { - var b = C(); - x.push({ - primitive: "Callback", - stackError: Error(), - value: null !== b ? b.memoizedState[0] : a - }); - return a; - }, - useContext: function (a) { - x.push({ - primitive: "Context", - stackError: Error(), - value: a._currentValue - }); - return a._currentValue; - }, - useEffect: function (a) { - C(); - x.push({ - primitive: "Effect", - stackError: Error(), - value: a - }); - }, - useImperativeHandle: function (a) { - C(); - var b = void 0; - null !== a && "object" === typeof a && (b = a.current); - x.push({ - primitive: "ImperativeHandle", - stackError: Error(), - value: b - }); - }, - useDebugValue: function (a, b) { - x.push({ - primitive: "DebugValue", - stackError: Error(), - value: "function" === typeof b ? b(a) : a - }); - }, - useLayoutEffect: function (a) { - C(); - x.push({ - primitive: "LayoutEffect", - stackError: Error(), - value: a - }); - }, - useInsertionEffect: function (a) { - C(); - x.push({ - primitive: "InsertionEffect", - stackError: Error(), - value: a - }); - }, - useMemo: function (a) { - var b = C(); - a = null !== b ? b.memoizedState[0] : a(); - x.push({ - primitive: "Memo", - stackError: Error(), - value: a - }); - return a; - }, - useReducer: function (a, b, e) { - a = C(); - b = null !== a ? a.memoizedState : void 0 !== e ? e(b) : b; - x.push({ - primitive: "Reducer", - stackError: Error(), - value: b - }); - return [b, function () {}]; - }, - useRef: function (a) { - var b = C(); - a = null !== b ? b.memoizedState : { - current: a - }; - x.push({ - primitive: "Ref", - stackError: Error(), - value: a.current - }); - return a; - }, - useState: function (a) { - var b = C(); - a = null !== b ? b.memoizedState : "function" === typeof a ? a() : a; - x.push({ - primitive: "State", - stackError: Error(), - value: a - }); - return [a, function () {}]; - }, - useTransition: function () { - C(); - C(); - x.push({ - primitive: "Transition", - stackError: Error(), - value: void 0 - }); - return [!1, function () {}]; - }, - useMutableSource: function (a, b) { - C(); - C(); - C(); - C(); - a = b(a._source); - x.push({ - primitive: "MutableSource", - stackError: Error(), - value: a - }); - return a; - }, - useSyncExternalStore: function (a, b) { - C(); - C(); - a = b(); - x.push({ - primitive: "SyncExternalStore", - stackError: Error(), - value: a - }); - return a; - }, - useDeferredValue: function (a) { - var b = C(); - x.push({ - primitive: "DeferredValue", - stackError: Error(), - value: null !== b ? b.memoizedState : a - }); - return a; - }, - useId: function () { - var a = C(); - a = null !== a ? a.memoizedState : ""; - x.push({ - primitive: "Id", - stackError: Error(), - value: a - }); - return a; - } -}, - D = { - get: function (a, b) { - if (a.hasOwnProperty(b)) return a[b]; - a = Error("Missing method in Dispatcher: " + b); - a.name = "ReactDebugToolsUnsupportedHookError"; - throw a; - } -}, - E = "undefined" === typeof Proxy ? A : new Proxy(A, D), - F = 0; - -function G(a, b, e) { - var g = b[e].source, - c = 0; - - a: for (; c < a.length; c++) if (a[c].source === g) { - for (var l = e + 1, r = c + 1; l < b.length && r < a.length; l++, r++) if (a[r].source !== b[l].source) continue a; - - return c; - } - - return -1; -} - -function H(a, b) { - if (!a) return !1; - b = "use" + b; - return a.length < b.length ? !1 : a.lastIndexOf(b) === a.length - b.length; -} - -function I(a, b, e) { - for (var g = [], c = null, l = g, r = 0, t = [], v = 0; v < b.length; v++) { - var u = b[v]; - var d = a; - var k = h.parse(u.stackError); - - b: { - var m = k, - n = G(m, d, F); - if (-1 !== n) d = n;else { - for (var f = 0; f < d.length && 5 > f; f++) if (n = G(m, d, f), -1 !== n) { - F = f; - d = n; - break b; - } - - d = -1; - } - } - - b: { - m = k; - n = z().get(u.primitive); - if (void 0 !== n) for (f = 0; f < n.length && f < m.length; f++) if (n[f].source !== m[f].source) { - f < m.length - 1 && H(m[f].functionName, u.primitive) && f++; - f < m.length - 1 && H(m[f].functionName, u.primitive) && f++; - m = f; - break b; - } - m = -1; - } - - k = -1 === d || -1 === m || 2 > d - m ? null : k.slice(m, d - 1); - - if (null !== k) { - d = 0; - - if (null !== c) { - for (; d < k.length && d < c.length && k[k.length - d - 1].source === c[c.length - d - 1].source;) d++; - - for (c = c.length - 1; c > d; c--) l = t.pop(); - } - - for (c = k.length - d - 1; 1 <= c; c--) d = [], m = k[c], (n = k[c - 1].functionName) ? (f = n.lastIndexOf("."), -1 === f && (f = 0), "use" === n.substr(f, 3) && (f += 3), n = n.substr(f)) : n = "", n = { - id: null, - isStateEditable: !1, - name: n, - value: void 0, - subHooks: d - }, e && (n.hookSource = { - lineNumber: m.lineNumber, - columnNumber: m.columnNumber, - functionName: m.functionName, - fileName: m.fileName - }), l.push(n), t.push(l), l = d; - - c = k; - } - - d = u.primitive; - u = { - id: "Context" === d || "DebugValue" === d ? null : r++, - isStateEditable: "Reducer" === d || "State" === d, - name: d, - value: u.value, - subHooks: [] - }; - e && (d = { - lineNumber: null, - functionName: null, - fileName: null, - columnNumber: null - }, k && 1 <= k.length && (k = k[0], d.lineNumber = k.lineNumber, d.functionName = k.functionName, d.fileName = k.fileName, d.columnNumber = k.columnNumber), u.hookSource = d); - l.push(u); - } - - J(g, null); - return g; -} - -function J(a, b) { - for (var e = [], g = 0; g < a.length; g++) { - var c = a[g]; - "DebugValue" === c.name && 0 === c.subHooks.length ? (a.splice(g, 1), g--, e.push(c)) : J(c.subHooks, c); - } - - null !== b && (1 === e.length ? b.value = e[0].value : 1 < e.length && (b.value = e.map(function (a) { - return a.value; - }))); -} - -function K(a) { - if (a instanceof Error && "ReactDebugToolsUnsupportedHookError" === a.name) throw a; - var b = Error("Error rendering inspected component", { - cause: a - }); - b.name = "ReactDebugToolsRenderError"; - b.cause = a; - throw b; -} - -function L(a, b, e) { - var g = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : !1; - null == e && (e = w.ReactCurrentDispatcher); - var c = e.current; - e.current = E; - - try { - var l = Error(); - a(b); - } catch (t) { - K(t); - } finally { - var r = x; - x = []; - e.current = c; - } - - c = h.parse(l); - return I(c, r, g); -} - -function M(a) { - a.forEach(function (a, e) { - return e._currentValue = a; - }); -} - -exports.inspectHooks = L; - -exports.inspectHooksOfFiber = function (a, b) { - var e = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : !1; - null == b && (b = w.ReactCurrentDispatcher); - if (0 !== a.tag && 15 !== a.tag && 11 !== a.tag) throw Error("Unknown Fiber. Needs to be a function component to inspect hooks."); - z(); - var g = a.type, - c = a.memoizedProps; - - if (g !== a.elementType && g && g.defaultProps) { - c = q({}, c); - var l = g.defaultProps; - - for (r in l) void 0 === c[r] && (c[r] = l[r]); - } - - B = a.memoizedState; - var r = new Map(); - - try { - for (l = a; l;) { - if (10 === l.tag) { - var t = l.type._context; - r.has(t) || (r.set(t, t._currentValue), t._currentValue = l.memoizedProps.value); - } - - l = l.return; - } - - if (11 === a.tag) { - var v = g.render; - g = c; - var u = a.ref; - t = b; - var d = t.current; - t.current = E; - - try { - var k = Error(); - v(g, u); - } catch (f) { - K(f); - } finally { - var m = x; - x = []; - t.current = d; - } - - var n = h.parse(k); - return I(n, m, e); - } - - return L(g, c, b, e); - } finally { - B = null, M(r); - } -}; - -/***/ }) - -/******/ }); \ No newline at end of file diff --git a/src/react-devtools/build/main.js b/src/react-devtools/build/main.js deleted file mode 100644 index 73c1592..0000000 --- a/src/react-devtools/build/main.js +++ /dev/null @@ -1,56723 +0,0 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // install a JSONP callback for chunk loading -/******/ function webpackJsonpCallback(data) { -/******/ var chunkIds = data[0]; -/******/ var moreModules = data[1]; -/******/ -/******/ -/******/ // add "moreModules" to the modules object, -/******/ // then flag all "chunkIds" as loaded and fire callback -/******/ var moduleId, chunkId, i = 0, resolves = []; -/******/ for(;i < chunkIds.length; i++) { -/******/ chunkId = chunkIds[i]; -/******/ if(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) { -/******/ resolves.push(installedChunks[chunkId][0]); -/******/ } -/******/ installedChunks[chunkId] = 0; -/******/ } -/******/ for(moduleId in moreModules) { -/******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) { -/******/ modules[moduleId] = moreModules[moduleId]; -/******/ } -/******/ } -/******/ if(parentJsonpFunction) parentJsonpFunction(data); -/******/ -/******/ while(resolves.length) { -/******/ resolves.shift()(); -/******/ } -/******/ -/******/ }; -/******/ -/******/ -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // object to store loaded and loading chunks -/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched -/******/ // Promise = chunk loading, 0 = chunk loaded -/******/ var installedChunks = { -/******/ 2: 0 -/******/ }; -/******/ -/******/ -/******/ -/******/ // script path function -/******/ function jsonpScriptSrc(chunkId) { -/******/ return __webpack_require__.p + "" + ({"4":"parseHookNames","8":"vendors~parseHookNames"}[chunkId]||chunkId) + ".chunk.js" -/******/ } -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ // This file contains only the entry chunk. -/******/ // The chunk loading function for additional chunks -/******/ __webpack_require__.e = function requireEnsure(chunkId) { -/******/ var promises = []; -/******/ -/******/ -/******/ // JSONP chunk loading for javascript -/******/ -/******/ var installedChunkData = installedChunks[chunkId]; -/******/ if(installedChunkData !== 0) { // 0 means "already installed". -/******/ -/******/ // a Promise means "currently loading". -/******/ if(installedChunkData) { -/******/ promises.push(installedChunkData[2]); -/******/ } else { -/******/ // setup Promise in chunk cache -/******/ var promise = new Promise(function(resolve, reject) { -/******/ installedChunkData = installedChunks[chunkId] = [resolve, reject]; -/******/ }); -/******/ promises.push(installedChunkData[2] = promise); -/******/ -/******/ // start chunk loading -/******/ var script = document.createElement('script'); -/******/ var onScriptComplete; -/******/ -/******/ script.charset = 'utf-8'; -/******/ script.timeout = 120; -/******/ if (__webpack_require__.nc) { -/******/ script.setAttribute("nonce", __webpack_require__.nc); -/******/ } -/******/ script.src = jsonpScriptSrc(chunkId); -/******/ -/******/ // create error before stack unwound to get useful stacktrace later -/******/ var error = new Error(); -/******/ onScriptComplete = function (event) { -/******/ // avoid mem leaks in IE. -/******/ script.onerror = script.onload = null; -/******/ clearTimeout(timeout); -/******/ var chunk = installedChunks[chunkId]; -/******/ if(chunk !== 0) { -/******/ if(chunk) { -/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); -/******/ var realSrc = event && event.target && event.target.src; -/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; -/******/ error.name = 'ChunkLoadError'; -/******/ error.type = errorType; -/******/ error.request = realSrc; -/******/ chunk[1](error); -/******/ } -/******/ installedChunks[chunkId] = undefined; -/******/ } -/******/ }; -/******/ var timeout = setTimeout(function(){ -/******/ onScriptComplete({ type: 'timeout', target: script }); -/******/ }, 120000); -/******/ script.onerror = script.onload = onScriptComplete; -/******/ document.head.appendChild(script); -/******/ } -/******/ } -/******/ return Promise.all(promises); -/******/ }; -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = "/build/"; -/******/ -/******/ // on error function for async loading -/******/ __webpack_require__.oe = function(err) { console.error(err); throw err; }; -/******/ -/******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || []; -/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray); -/******/ jsonpArray.push = webpackJsonpCallback; -/******/ jsonpArray = jsonpArray.slice(); -/******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]); -/******/ var parentJsonpFunction = oldJsonpFunction; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 207); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -if (true) { - module.exports = __webpack_require__(61); -} else {} - -/***/ }), -/* 1 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return CHROME_WEBSTORE_EXTENSION_ID; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return INTERNAL_EXTENSION_ID; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return LOCAL_EXTENSION_ID; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F", function() { return __DEBUG__; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "G", function() { return __PERFORMANCE_PROFILE__; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "x", function() { return TREE_OPERATION_ADD; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "y", function() { return TREE_OPERATION_REMOVE; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "A", function() { return TREE_OPERATION_REORDER_CHILDREN; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "D", function() { return TREE_OPERATION_UPDATE_TREE_BASE_DURATION; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "C", function() { return TREE_OPERATION_UPDATE_ERRORS_OR_WARNINGS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "z", function() { return TREE_OPERATION_REMOVE_ROOT; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "B", function() { return TREE_OPERATION_SET_SUBTREE_MODE; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return PROFILING_FLAG_BASIC_SUPPORT; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return PROFILING_FLAG_TIMELINE_SUPPORT; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return LOCAL_STORAGE_DEFAULT_TAB_KEY; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return LOCAL_STORAGE_COMPONENT_FILTER_PREFERENCES_KEY; }); -/* unused harmony export SESSION_STORAGE_LAST_SELECTION_KEY */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return LOCAL_STORAGE_OPEN_IN_EDITOR_URL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return LOCAL_STORAGE_PARSE_HOOK_NAMES_KEY; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "u", function() { return SESSION_STORAGE_RECORD_CHANGE_DESCRIPTIONS_KEY; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "v", function() { return SESSION_STORAGE_RELOAD_AND_PROFILE_KEY; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return LOCAL_STORAGE_SHOULD_BREAK_ON_CONSOLE_ERRORS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return LOCAL_STORAGE_BROWSER_THEME; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return LOCAL_STORAGE_SHOULD_APPEND_COMPONENT_STACK_KEY; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return LOCAL_STORAGE_SHOW_INLINE_WARNINGS_AND_ERRORS_KEY; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return LOCAL_STORAGE_TRACE_UPDATES_ENABLED_KEY; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return LOCAL_STORAGE_HIDE_CONSOLE_LOGS_IN_STRICT_MODE; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return PROFILER_EXPORT_VERSION; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CHANGE_LOG_URL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "E", function() { return UNSUPPORTED_VERSION_URL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return REACT_DEVTOOLS_WORKPLACE_URL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "w", function() { return THEME_STYLES; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return COMFORTABLE_LINE_HEIGHT; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return COMPACT_LINE_HEIGHT; }); -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ -const CHROME_WEBSTORE_EXTENSION_ID = 'fmkadmapgofadopljbjfkapdkoienihi'; -const INTERNAL_EXTENSION_ID = 'dnjnjgbfilfphmojnmhliehogmojhclc'; -const LOCAL_EXTENSION_ID = 'ikiahnapldjmdmpkmfhjdjilojjhgcbf'; // Flip this flag to true to enable verbose console debug logging. - -const __DEBUG__ = false; // Flip this flag to true to enable performance.mark() and performance.measure() timings. - -const __PERFORMANCE_PROFILE__ = false; -const TREE_OPERATION_ADD = 1; -const TREE_OPERATION_REMOVE = 2; -const TREE_OPERATION_REORDER_CHILDREN = 3; -const TREE_OPERATION_UPDATE_TREE_BASE_DURATION = 4; -const TREE_OPERATION_UPDATE_ERRORS_OR_WARNINGS = 5; -const TREE_OPERATION_REMOVE_ROOT = 6; -const TREE_OPERATION_SET_SUBTREE_MODE = 7; -const PROFILING_FLAG_BASIC_SUPPORT = 0b01; -const PROFILING_FLAG_TIMELINE_SUPPORT = 0b10; -const LOCAL_STORAGE_DEFAULT_TAB_KEY = 'React::DevTools::defaultTab'; -const LOCAL_STORAGE_COMPONENT_FILTER_PREFERENCES_KEY = 'React::DevTools::componentFilters'; -const SESSION_STORAGE_LAST_SELECTION_KEY = 'React::DevTools::lastSelection'; -const LOCAL_STORAGE_OPEN_IN_EDITOR_URL = 'React::DevTools::openInEditorUrl'; -const LOCAL_STORAGE_PARSE_HOOK_NAMES_KEY = 'React::DevTools::parseHookNames'; -const SESSION_STORAGE_RECORD_CHANGE_DESCRIPTIONS_KEY = 'React::DevTools::recordChangeDescriptions'; -const SESSION_STORAGE_RELOAD_AND_PROFILE_KEY = 'React::DevTools::reloadAndProfile'; -const LOCAL_STORAGE_SHOULD_BREAK_ON_CONSOLE_ERRORS = 'React::DevTools::breakOnConsoleErrors'; -const LOCAL_STORAGE_BROWSER_THEME = 'React::DevTools::theme'; -const LOCAL_STORAGE_SHOULD_APPEND_COMPONENT_STACK_KEY = 'React::DevTools::appendComponentStack'; -const LOCAL_STORAGE_SHOW_INLINE_WARNINGS_AND_ERRORS_KEY = 'React::DevTools::showInlineWarningsAndErrors'; -const LOCAL_STORAGE_TRACE_UPDATES_ENABLED_KEY = 'React::DevTools::traceUpdatesEnabled'; -const LOCAL_STORAGE_HIDE_CONSOLE_LOGS_IN_STRICT_MODE = 'React::DevTools::hideConsoleLogsInStrictMode'; -const PROFILER_EXPORT_VERSION = 5; -const CHANGE_LOG_URL = 'https://github.com/facebook/react/blob/main/packages/react-devtools/CHANGELOG.md'; -const UNSUPPORTED_VERSION_URL = 'https://reactjs.org/blog/2019/08/15/new-react-devtools.html#how-do-i-get-the-old-version-back'; -const REACT_DEVTOOLS_WORKPLACE_URL = 'https://fburl.com/react-devtools-workplace-group'; -const THEME_STYLES = { - light: { - '--color-attribute-name': '#ef6632', - '--color-attribute-name-not-editable': '#23272f', - '--color-attribute-name-inverted': 'rgba(255, 255, 255, 0.7)', - '--color-attribute-value': '#1a1aa6', - '--color-attribute-value-inverted': '#ffffff', - '--color-attribute-editable-value': '#1a1aa6', - '--color-background': '#ffffff', - '--color-background-hover': 'rgba(0, 136, 250, 0.1)', - '--color-background-inactive': '#e5e5e5', - '--color-background-invalid': '#fff0f0', - '--color-background-selected': '#0088fa', - '--color-button-background': '#ffffff', - '--color-button-background-focus': '#ededed', - '--color-button': '#5f6673', - '--color-button-disabled': '#cfd1d5', - '--color-button-active': '#0088fa', - '--color-button-focus': '#23272f', - '--color-button-hover': '#23272f', - '--color-border': '#eeeeee', - '--color-commit-did-not-render-fill': '#cfd1d5', - '--color-commit-did-not-render-fill-text': '#000000', - '--color-commit-did-not-render-pattern': '#cfd1d5', - '--color-commit-did-not-render-pattern-text': '#333333', - '--color-commit-gradient-0': '#37afa9', - '--color-commit-gradient-1': '#63b19e', - '--color-commit-gradient-2': '#80b393', - '--color-commit-gradient-3': '#97b488', - '--color-commit-gradient-4': '#abb67d', - '--color-commit-gradient-5': '#beb771', - '--color-commit-gradient-6': '#cfb965', - '--color-commit-gradient-7': '#dfba57', - '--color-commit-gradient-8': '#efbb49', - '--color-commit-gradient-9': '#febc38', - '--color-commit-gradient-text': '#000000', - '--color-component-name': '#6a51b2', - '--color-component-name-inverted': '#ffffff', - '--color-component-badge-background': 'rgba(0, 0, 0, 0.1)', - '--color-component-badge-background-inverted': 'rgba(255, 255, 255, 0.25)', - '--color-component-badge-count': '#777d88', - '--color-component-badge-count-inverted': 'rgba(255, 255, 255, 0.7)', - '--color-console-error-badge-text': '#ffffff', - '--color-console-error-background': '#fff0f0', - '--color-console-error-border': '#ffd6d6', - '--color-console-error-icon': '#eb3941', - '--color-console-error-text': '#fe2e31', - '--color-console-warning-badge-text': '#000000', - '--color-console-warning-background': '#fffbe5', - '--color-console-warning-border': '#fff5c1', - '--color-console-warning-icon': '#f4bd00', - '--color-console-warning-text': '#64460c', - '--color-context-background': 'rgba(0,0,0,.9)', - '--color-context-background-hover': 'rgba(255, 255, 255, 0.1)', - '--color-context-background-selected': '#178fb9', - '--color-context-border': '#3d424a', - '--color-context-text': '#ffffff', - '--color-context-text-selected': '#ffffff', - '--color-dim': '#777d88', - '--color-dimmer': '#cfd1d5', - '--color-dimmest': '#eff0f1', - '--color-error-background': 'hsl(0, 100%, 97%)', - '--color-error-border': 'hsl(0, 100%, 92%)', - '--color-error-text': '#ff0000', - '--color-expand-collapse-toggle': '#777d88', - '--color-link': '#0000ff', - '--color-modal-background': 'rgba(255, 255, 255, 0.75)', - '--color-bridge-version-npm-background': '#eff0f1', - '--color-bridge-version-npm-text': '#000000', - '--color-bridge-version-number': '#0088fa', - '--color-primitive-hook-badge-background': '#e5e5e5', - '--color-primitive-hook-badge-text': '#5f6673', - '--color-record-active': '#fc3a4b', - '--color-record-hover': '#3578e5', - '--color-record-inactive': '#0088fa', - '--color-resize-bar': '#eeeeee', - '--color-resize-bar-active': '#dcdcdc', - '--color-resize-bar-border': '#d1d1d1', - '--color-resize-bar-dot': '#333333', - '--color-timeline-internal-module': '#d1d1d1', - '--color-timeline-internal-module-hover': '#c9c9c9', - '--color-timeline-internal-module-text': '#444', - '--color-timeline-native-event': '#ccc', - '--color-timeline-native-event-hover': '#aaa', - '--color-timeline-network-primary': '#fcf3dc', - '--color-timeline-network-primary-hover': '#f0e7d1', - '--color-timeline-network-secondary': '#efc457', - '--color-timeline-network-secondary-hover': '#e3ba52', - '--color-timeline-priority-background': '#f6f6f6', - '--color-timeline-priority-border': '#eeeeee', - '--color-timeline-user-timing': '#c9cacd', - '--color-timeline-user-timing-hover': '#93959a', - '--color-timeline-react-idle': '#d3e5f6', - '--color-timeline-react-idle-hover': '#c3d9ef', - '--color-timeline-react-render': '#9fc3f3', - '--color-timeline-react-render-hover': '#83afe9', - '--color-timeline-react-render-text': '#11365e', - '--color-timeline-react-commit': '#c88ff0', - '--color-timeline-react-commit-hover': '#b281d6', - '--color-timeline-react-commit-text': '#3e2c4a', - '--color-timeline-react-layout-effects': '#b281d6', - '--color-timeline-react-layout-effects-hover': '#9d71bd', - '--color-timeline-react-layout-effects-text': '#3e2c4a', - '--color-timeline-react-passive-effects': '#b281d6', - '--color-timeline-react-passive-effects-hover': '#9d71bd', - '--color-timeline-react-passive-effects-text': '#3e2c4a', - '--color-timeline-react-schedule': '#9fc3f3', - '--color-timeline-react-schedule-hover': '#2683E2', - '--color-timeline-react-suspense-rejected': '#f1cc14', - '--color-timeline-react-suspense-rejected-hover': '#ffdf37', - '--color-timeline-react-suspense-resolved': '#a6e59f', - '--color-timeline-react-suspense-resolved-hover': '#89d281', - '--color-timeline-react-suspense-unresolved': '#c9cacd', - '--color-timeline-react-suspense-unresolved-hover': '#93959a', - '--color-timeline-thrown-error': '#ee1638', - '--color-timeline-thrown-error-hover': '#da1030', - '--color-timeline-text-color': '#000000', - '--color-timeline-text-dim-color': '#ccc', - '--color-timeline-react-work-border': '#eeeeee', - '--color-search-match': 'yellow', - '--color-search-match-current': '#f7923b', - '--color-selected-tree-highlight-active': 'rgba(0, 136, 250, 0.1)', - '--color-selected-tree-highlight-inactive': 'rgba(0, 0, 0, 0.05)', - '--color-scroll-caret': 'rgba(150, 150, 150, 0.5)', - '--color-tab-selected-border': '#0088fa', - '--color-text': '#000000', - '--color-text-invalid': '#ff0000', - '--color-text-selected': '#ffffff', - '--color-toggle-background-invalid': '#fc3a4b', - '--color-toggle-background-on': '#0088fa', - '--color-toggle-background-off': '#cfd1d5', - '--color-toggle-text': '#ffffff', - '--color-warning-background': '#fb3655', - '--color-warning-background-hover': '#f82042', - '--color-warning-text-color': '#ffffff', - '--color-warning-text-color-inverted': '#fd4d69', - // The styles below should be kept in sync with 'root.css' - // They are repeated there because they're used by e.g. tooltips or context menus - // which get rendered outside of the DOM subtree (where normal theme/styles are written). - '--color-scroll-thumb': '#c2c2c2', - '--color-scroll-track': '#fafafa', - '--color-tooltip-background': 'rgba(0, 0, 0, 0.9)', - '--color-tooltip-text': '#ffffff' - }, - dark: { - '--color-attribute-name': '#9d87d2', - '--color-attribute-name-not-editable': '#ededed', - '--color-attribute-name-inverted': '#282828', - '--color-attribute-value': '#cedae0', - '--color-attribute-value-inverted': '#ffffff', - '--color-attribute-editable-value': 'yellow', - '--color-background': '#282c34', - '--color-background-hover': 'rgba(255, 255, 255, 0.1)', - '--color-background-inactive': '#3d424a', - '--color-background-invalid': '#5c0000', - '--color-background-selected': '#178fb9', - '--color-button-background': '#282c34', - '--color-button-background-focus': '#3d424a', - '--color-button': '#afb3b9', - '--color-button-active': '#61dafb', - '--color-button-disabled': '#4f5766', - '--color-button-focus': '#a2e9fc', - '--color-button-hover': '#ededed', - '--color-border': '#3d424a', - '--color-commit-did-not-render-fill': '#777d88', - '--color-commit-did-not-render-fill-text': '#000000', - '--color-commit-did-not-render-pattern': '#666c77', - '--color-commit-did-not-render-pattern-text': '#ffffff', - '--color-commit-gradient-0': '#37afa9', - '--color-commit-gradient-1': '#63b19e', - '--color-commit-gradient-2': '#80b393', - '--color-commit-gradient-3': '#97b488', - '--color-commit-gradient-4': '#abb67d', - '--color-commit-gradient-5': '#beb771', - '--color-commit-gradient-6': '#cfb965', - '--color-commit-gradient-7': '#dfba57', - '--color-commit-gradient-8': '#efbb49', - '--color-commit-gradient-9': '#febc38', - '--color-commit-gradient-text': '#000000', - '--color-component-name': '#61dafb', - '--color-component-name-inverted': '#282828', - '--color-component-badge-background': 'rgba(255, 255, 255, 0.25)', - '--color-component-badge-background-inverted': 'rgba(0, 0, 0, 0.25)', - '--color-component-badge-count': '#8f949d', - '--color-component-badge-count-inverted': 'rgba(255, 255, 255, 0.7)', - '--color-console-error-badge-text': '#000000', - '--color-console-error-background': '#290000', - '--color-console-error-border': '#5c0000', - '--color-console-error-icon': '#eb3941', - '--color-console-error-text': '#fc7f7f', - '--color-console-warning-badge-text': '#000000', - '--color-console-warning-background': '#332b00', - '--color-console-warning-border': '#665500', - '--color-console-warning-icon': '#f4bd00', - '--color-console-warning-text': '#f5f2ed', - '--color-context-background': 'rgba(255,255,255,.95)', - '--color-context-background-hover': 'rgba(0, 136, 250, 0.1)', - '--color-context-background-selected': '#0088fa', - '--color-context-border': '#eeeeee', - '--color-context-text': '#000000', - '--color-context-text-selected': '#ffffff', - '--color-dim': '#8f949d', - '--color-dimmer': '#777d88', - '--color-dimmest': '#4f5766', - '--color-error-background': '#200', - '--color-error-border': '#900', - '--color-error-text': '#f55', - '--color-expand-collapse-toggle': '#8f949d', - '--color-link': '#61dafb', - '--color-modal-background': 'rgba(0, 0, 0, 0.75)', - '--color-bridge-version-npm-background': 'rgba(0, 0, 0, 0.25)', - '--color-bridge-version-npm-text': '#ffffff', - '--color-bridge-version-number': 'yellow', - '--color-primitive-hook-badge-background': 'rgba(0, 0, 0, 0.25)', - '--color-primitive-hook-badge-text': 'rgba(255, 255, 255, 0.7)', - '--color-record-active': '#fc3a4b', - '--color-record-hover': '#a2e9fc', - '--color-record-inactive': '#61dafb', - '--color-resize-bar': '#282c34', - '--color-resize-bar-active': '#31363f', - '--color-resize-bar-border': '#3d424a', - '--color-resize-bar-dot': '#cfd1d5', - '--color-timeline-internal-module': '#303542', - '--color-timeline-internal-module-hover': '#363b4a', - '--color-timeline-internal-module-text': '#7f8899', - '--color-timeline-native-event': '#b2b2b2', - '--color-timeline-native-event-hover': '#949494', - '--color-timeline-network-primary': '#fcf3dc', - '--color-timeline-network-primary-hover': '#e3dbc5', - '--color-timeline-network-secondary': '#efc457', - '--color-timeline-network-secondary-hover': '#d6af4d', - '--color-timeline-priority-background': '#1d2129', - '--color-timeline-priority-border': '#282c34', - '--color-timeline-user-timing': '#c9cacd', - '--color-timeline-user-timing-hover': '#93959a', - '--color-timeline-react-idle': '#3d485b', - '--color-timeline-react-idle-hover': '#465269', - '--color-timeline-react-render': '#2683E2', - '--color-timeline-react-render-hover': '#1a76d4', - '--color-timeline-react-render-text': '#11365e', - '--color-timeline-react-commit': '#731fad', - '--color-timeline-react-commit-hover': '#611b94', - '--color-timeline-react-commit-text': '#e5c1ff', - '--color-timeline-react-layout-effects': '#611b94', - '--color-timeline-react-layout-effects-hover': '#51167a', - '--color-timeline-react-layout-effects-text': '#e5c1ff', - '--color-timeline-react-passive-effects': '#611b94', - '--color-timeline-react-passive-effects-hover': '#51167a', - '--color-timeline-react-passive-effects-text': '#e5c1ff', - '--color-timeline-react-schedule': '#2683E2', - '--color-timeline-react-schedule-hover': '#1a76d4', - '--color-timeline-react-suspense-rejected': '#f1cc14', - '--color-timeline-react-suspense-rejected-hover': '#e4c00f', - '--color-timeline-react-suspense-resolved': '#a6e59f', - '--color-timeline-react-suspense-resolved-hover': '#89d281', - '--color-timeline-react-suspense-unresolved': '#c9cacd', - '--color-timeline-react-suspense-unresolved-hover': '#93959a', - '--color-timeline-thrown-error': '#fb3655', - '--color-timeline-thrown-error-hover': '#f82042', - '--color-timeline-text-color': '#282c34', - '--color-timeline-text-dim-color': '#555b66', - '--color-timeline-react-work-border': '#3d424a', - '--color-search-match': 'yellow', - '--color-search-match-current': '#f7923b', - '--color-selected-tree-highlight-active': 'rgba(23, 143, 185, 0.15)', - '--color-selected-tree-highlight-inactive': 'rgba(255, 255, 255, 0.05)', - '--color-scroll-caret': '#4f5766', - '--color-shadow': 'rgba(0, 0, 0, 0.5)', - '--color-tab-selected-border': '#178fb9', - '--color-text': '#ffffff', - '--color-text-invalid': '#ff8080', - '--color-text-selected': '#ffffff', - '--color-toggle-background-invalid': '#fc3a4b', - '--color-toggle-background-on': '#178fb9', - '--color-toggle-background-off': '#777d88', - '--color-toggle-text': '#ffffff', - '--color-warning-background': '#ee1638', - '--color-warning-background-hover': '#da1030', - '--color-warning-text-color': '#ffffff', - '--color-warning-text-color-inverted': '#ee1638', - // The styles below should be kept in sync with 'root.css' - // They are repeated there because they're used by e.g. tooltips or context menus - // which get rendered outside of the DOM subtree (where normal theme/styles are written). - '--color-scroll-thumb': '#afb3b9', - '--color-scroll-track': '#313640', - '--color-tooltip-background': 'rgba(255, 255, 255, 0.95)', - '--color-tooltip-text': '#000000' - }, - compact: { - '--font-size-monospace-small': '9px', - '--font-size-monospace-normal': '11px', - '--font-size-monospace-large': '15px', - '--font-size-sans-small': '10px', - '--font-size-sans-normal': '12px', - '--font-size-sans-large': '14px', - '--line-height-data': '18px' - }, - comfortable: { - '--font-size-monospace-small': '10px', - '--font-size-monospace-normal': '13px', - '--font-size-monospace-large': '17px', - '--font-size-sans-small': '12px', - '--font-size-sans-normal': '14px', - '--font-size-sans-large': '16px', - '--line-height-data': '22px' - } -}; // HACK -// -// Sometimes the inline target is rendered before root styles are applied, -// which would result in e.g. NaN itemSize being passed to react-window list. - -const COMFORTABLE_LINE_HEIGHT = parseInt(THEME_STYLES.comfortable['--line-height-data'], 10); -const COMPACT_LINE_HEIGHT = parseInt(THEME_STYLES.compact['--line-height-data'], 10); - - -/***/ }), -/* 2 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return ElementTypeClass; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return ElementTypeContext; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return ElementTypeFunction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return ElementTypeForwardRef; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return ElementTypeHostComponent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return ElementTypeMemo; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return ElementTypeOtherOrUnknown; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return ElementTypeProfiler; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return ElementTypeRoot; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return ElementTypeSuspense; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return ElementTypeSuspenseList; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return ElementTypeTracingMarker; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return ComponentFilterElementType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ComponentFilterDisplayName; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return ComponentFilterLocation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return ComponentFilterHOC; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return StrictMode; }); -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ -// WARNING -// The values below are referenced by ComponentFilters (which are saved via localStorage). -// Do not change them or it will break previously saved user customizations. -// If new element types are added, use new numbers rather than re-ordering existing ones. -// -// Changing these types is also a backwards breaking change for the standalone shell, -// since the frontend and backend must share the same values- -// and the backend is embedded in certain environments (like React Native). -const ElementTypeClass = 1; -const ElementTypeContext = 2; -const ElementTypeFunction = 5; -const ElementTypeForwardRef = 6; -const ElementTypeHostComponent = 7; -const ElementTypeMemo = 8; -const ElementTypeOtherOrUnknown = 9; -const ElementTypeProfiler = 10; -const ElementTypeRoot = 11; -const ElementTypeSuspense = 12; -const ElementTypeSuspenseList = 13; -const ElementTypeTracingMarker = 14; // Different types of elements displayed in the Elements tree. -// These types may be used to visually distinguish types, -// or to enable/disable certain functionality. - -// WARNING -// The values below are referenced by ComponentFilters (which are saved via localStorage). -// Do not change them or it will break previously saved user customizations. -// If new filter types are added, use new numbers rather than re-ordering existing ones. -const ComponentFilterElementType = 1; -const ComponentFilterDisplayName = 2; -const ComponentFilterLocation = 3; -const ComponentFilterHOC = 4; -const StrictMode = 1; - -/***/ }), -/* 3 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "e", function() { return /* binding */ getAllEnumerableKeys; }); -__webpack_require__.d(__webpack_exports__, "s", function() { return /* binding */ getWrappedDisplayName; }); -__webpack_require__.d(__webpack_exports__, "k", function() { return /* binding */ getDisplayName; }); -__webpack_require__.d(__webpack_exports__, "r", function() { return /* binding */ getUID; }); -__webpack_require__.d(__webpack_exports__, "y", function() { return /* binding */ utfDecodeString; }); -__webpack_require__.d(__webpack_exports__, "z", function() { return /* binding */ utfEncodeString; }); -__webpack_require__.d(__webpack_exports__, "i", function() { return /* binding */ getDefaultComponentFilters; }); -__webpack_require__.d(__webpack_exports__, "p", function() { return /* binding */ getSavedComponentFilters; }); -__webpack_require__.d(__webpack_exports__, "w", function() { return /* binding */ setSavedComponentFilters; }); -__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ castBool; }); -__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ castBrowserTheme; }); -__webpack_require__.d(__webpack_exports__, "f", function() { return /* binding */ getAppendComponentStack; }); -__webpack_require__.d(__webpack_exports__, "g", function() { return /* binding */ getBreakOnConsoleErrors; }); -__webpack_require__.d(__webpack_exports__, "m", function() { return /* binding */ getHideConsoleLogsInStrictMode; }); -__webpack_require__.d(__webpack_exports__, "q", function() { return /* binding */ getShowInlineWarningsAndErrors; }); -__webpack_require__.d(__webpack_exports__, "j", function() { return /* binding */ getDefaultOpenInEditorURL; }); -__webpack_require__.d(__webpack_exports__, "o", function() { return /* binding */ getOpenInEditorURL; }); -__webpack_require__.d(__webpack_exports__, "u", function() { return /* binding */ separateDisplayNameAndHOCs; }); -__webpack_require__.d(__webpack_exports__, "x", function() { return /* binding */ shallowDiffers; }); -__webpack_require__.d(__webpack_exports__, "n", function() { return /* binding */ getInObject; }); -__webpack_require__.d(__webpack_exports__, "c", function() { return /* binding */ deletePathInObject; }); -__webpack_require__.d(__webpack_exports__, "t", function() { return /* binding */ renamePathInObject; }); -__webpack_require__.d(__webpack_exports__, "v", function() { return /* binding */ setInObject; }); -__webpack_require__.d(__webpack_exports__, "h", function() { return /* binding */ getDataType; }); -__webpack_require__.d(__webpack_exports__, "l", function() { return /* binding */ getDisplayNameForReactElement; }); -__webpack_require__.d(__webpack_exports__, "d", function() { return /* binding */ formatDataForPreview; }); - -// UNUSED EXPORTS: alphaSortKeys, printOperationsArray - -// EXTERNAL MODULE: /Users/mengdi/workspace/git/react/node_modules/lru-cache/index.js -var lru_cache = __webpack_require__(41); -var lru_cache_default = /*#__PURE__*/__webpack_require__.n(lru_cache); - -// EXTERNAL MODULE: /Users/mengdi/workspace/git/react/build/oss-experimental/react-is/index.js -var react_is = __webpack_require__(12); - -// CONCATENATED MODULE: ../shared/ReactSymbols.js -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ -// ATTENTION -// When adding new symbols to this file, -// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' -// The Symbol used to tag the ReactElement-like types. -const REACT_ELEMENT_TYPE = Symbol.for('react.element'); -const REACT_PORTAL_TYPE = Symbol.for('react.portal'); -const REACT_FRAGMENT_TYPE = Symbol.for('react.fragment'); -const REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode'); -const REACT_PROFILER_TYPE = Symbol.for('react.profiler'); -const REACT_PROVIDER_TYPE = Symbol.for('react.provider'); -const REACT_CONTEXT_TYPE = Symbol.for('react.context'); -const REACT_SERVER_CONTEXT_TYPE = Symbol.for('react.server_context'); -const REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref'); -const REACT_SUSPENSE_TYPE = Symbol.for('react.suspense'); -const REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list'); -const REACT_MEMO_TYPE = Symbol.for('react.memo'); -const REACT_LAZY_TYPE = Symbol.for('react.lazy'); -const REACT_SCOPE_TYPE = Symbol.for('react.scope'); -const REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for('react.debug_trace_mode'); -const REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen'); -const REACT_LEGACY_HIDDEN_TYPE = Symbol.for('react.legacy_hidden'); -const REACT_CACHE_TYPE = Symbol.for('react.cache'); -const REACT_TRACING_MARKER_TYPE = Symbol.for('react.tracing_marker'); -const REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED = Symbol.for('react.default_value'); -const REACT_MEMO_CACHE_SENTINEL = Symbol.for('react.memo_cache_sentinel'); -const MAYBE_ITERATOR_SYMBOL = Symbol.iterator; -const FAUX_ITERATOR_SYMBOL = '@@iterator'; -function getIteratorFn(maybeIterable) { - if (maybeIterable === null || typeof maybeIterable !== 'object') { - return null; - } - - const maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; - - if (typeof maybeIterator === 'function') { - return maybeIterator; - } - - return null; -} -// EXTERNAL MODULE: ../react-devtools-shared/src/constants.js -var constants = __webpack_require__(1); - -// EXTERNAL MODULE: ../react-devtools-shared/src/types.js -var types = __webpack_require__(2); - -// EXTERNAL MODULE: ../react-devtools-shared/src/storage.js -var storage = __webpack_require__(8); - -// EXTERNAL MODULE: ../react-devtools-shared/src/hydration.js -var hydration = __webpack_require__(11); - -// EXTERNAL MODULE: ../react-devtools-shared/src/isArray.js -var isArray = __webpack_require__(17); - -// CONCATENATED MODULE: ../react-devtools-shared/src/utils.js -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - - - - - - - -// $FlowFixMe[method-unbinding] -const utils_hasOwnProperty = Object.prototype.hasOwnProperty; -const cachedDisplayNames = new WeakMap(); // On large trees, encoding takes significant time. -// Try to reuse the already encoded strings. - -const encodedStringCache = new lru_cache_default.a({ - max: 1000 -}); -function alphaSortKeys(a, b) { - if (a.toString() > b.toString()) { - return 1; - } else if (b.toString() > a.toString()) { - return -1; - } else { - return 0; - } -} -function getAllEnumerableKeys(obj) { - const keys = new Set(); - let current = obj; - - while (current != null) { - const currentKeys = [...Object.keys(current), ...Object.getOwnPropertySymbols(current)]; - const descriptors = Object.getOwnPropertyDescriptors(current); - currentKeys.forEach(key => { - // $FlowFixMe: key can be a Symbol https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor - if (descriptors[key].enumerable) { - keys.add(key); - } - }); - current = Object.getPrototypeOf(current); - } - - return keys; -} // Mirror https://github.com/facebook/react/blob/7c21bf72ace77094fd1910cc350a548287ef8350/packages/shared/getComponentName.js#L27-L37 - -function getWrappedDisplayName(outerType, innerType, wrapperName, fallbackName) { - const displayName = outerType.displayName; - return displayName || `${wrapperName}(${getDisplayName(innerType, fallbackName)})`; -} -function getDisplayName(type, fallbackName = 'Anonymous') { - const nameFromCache = cachedDisplayNames.get(type); - - if (nameFromCache != null) { - return nameFromCache; - } - - let displayName = fallbackName; // The displayName property is not guaranteed to be a string. - // It's only safe to use for our purposes if it's a string. - // github.com/facebook/react-devtools/issues/803 - - if (typeof type.displayName === 'string') { - displayName = type.displayName; - } else if (typeof type.name === 'string' && type.name !== '') { - displayName = type.name; - } - - cachedDisplayNames.set(type, displayName); - return displayName; -} -let uidCounter = 0; -function getUID() { - return ++uidCounter; -} -function utfDecodeString(array) { - // Avoid spreading the array (e.g. String.fromCodePoint(...array)) - // Functions arguments are first placed on the stack before the function is called - // which throws a RangeError for large arrays. - // See github.com/facebook/react/issues/22293 - let string = ''; - - for (let i = 0; i < array.length; i++) { - const char = array[i]; - string += String.fromCodePoint(char); - } - - return string; -} - -function surrogatePairToCodePoint(charCode1, charCode2) { - return ((charCode1 & 0x3ff) << 10) + (charCode2 & 0x3ff) + 0x10000; -} // Credit for this encoding approach goes to Tim Down: -// https://stackoverflow.com/questions/4877326/how-can-i-tell-if-a-string-contains-multibyte-characters-in-javascript - - -function utfEncodeString(string) { - const cached = encodedStringCache.get(string); - - if (cached !== undefined) { - return cached; - } - - const encoded = []; - let i = 0; - let charCode; - - while (i < string.length) { - charCode = string.charCodeAt(i); // Handle multibyte unicode characters (like emoji). - - if ((charCode & 0xf800) === 0xd800) { - encoded.push(surrogatePairToCodePoint(charCode, string.charCodeAt(++i))); - } else { - encoded.push(charCode); - } - - ++i; - } - - encodedStringCache.set(string, encoded); - return encoded; -} -function printOperationsArray(operations) { - // The first two values are always rendererID and rootID - const rendererID = operations[0]; - const rootID = operations[1]; - const logs = [`operations for renderer:${rendererID} and root:${rootID}`]; - let i = 2; // Reassemble the string table. - - const stringTable = [null // ID = 0 corresponds to the null string. - ]; - const stringTableSize = operations[i++]; - const stringTableEnd = i + stringTableSize; - - while (i < stringTableEnd) { - const nextLength = operations[i++]; - const nextString = utfDecodeString(operations.slice(i, i + nextLength)); - stringTable.push(nextString); - i += nextLength; - } - - while (i < operations.length) { - const operation = operations[i]; - - switch (operation) { - case constants["x" /* TREE_OPERATION_ADD */]: - { - const id = operations[i + 1]; - const type = operations[i + 2]; - i += 3; - - if (type === types["m" /* ElementTypeRoot */]) { - logs.push(`Add new root node ${id}`); - i++; // isStrictModeCompliant - - i++; // supportsProfiling - - i++; // supportsStrictMode - - i++; // hasOwnerMetadata - } else { - const parentID = operations[i]; - i++; - i++; // ownerID - - const displayNameStringID = operations[i]; - const displayName = stringTable[displayNameStringID]; - i++; - i++; // key - - logs.push(`Add node ${id} (${displayName || 'null'}) as child of ${parentID}`); - } - - break; - } - - case constants["y" /* TREE_OPERATION_REMOVE */]: - { - const removeLength = operations[i + 1]; - i += 2; - - for (let removeIndex = 0; removeIndex < removeLength; removeIndex++) { - const id = operations[i]; - i += 1; - logs.push(`Remove node ${id}`); - } - - break; - } - - case constants["z" /* TREE_OPERATION_REMOVE_ROOT */]: - { - i += 1; - logs.push(`Remove root ${rootID}`); - break; - } - - case constants["B" /* TREE_OPERATION_SET_SUBTREE_MODE */]: - { - const id = operations[i + 1]; - const mode = operations[i + 1]; - i += 3; - logs.push(`Mode ${mode} set for subtree with root ${id}`); - break; - } - - case constants["A" /* TREE_OPERATION_REORDER_CHILDREN */]: - { - const id = operations[i + 1]; - const numChildren = operations[i + 2]; - i += 3; - const children = operations.slice(i, i + numChildren); - i += numChildren; - logs.push(`Re-order node ${id} children ${children.join(',')}`); - break; - } - - case constants["D" /* TREE_OPERATION_UPDATE_TREE_BASE_DURATION */]: - // Base duration updates are only sent while profiling is in progress. - // We can ignore them at this point. - // The profiler UI uses them lazily in order to generate the tree. - i += 3; - break; - - case constants["C" /* TREE_OPERATION_UPDATE_ERRORS_OR_WARNINGS */]: - const id = operations[i + 1]; - const numErrors = operations[i + 2]; - const numWarnings = operations[i + 3]; - i += 4; - logs.push(`Node ${id} has ${numErrors} errors and ${numWarnings} warnings`); - break; - - default: - throw Error(`Unsupported Bridge operation "${operation}"`); - } - } - - console.log(logs.join('\n ')); -} -function getDefaultComponentFilters() { - return [{ - type: types["b" /* ComponentFilterElementType */], - value: types["i" /* ElementTypeHostComponent */], - isEnabled: true - }]; -} -function getSavedComponentFilters() { - try { - const raw = Object(storage["a" /* localStorageGetItem */])(constants["h" /* LOCAL_STORAGE_COMPONENT_FILTER_PREFERENCES_KEY */]); - - if (raw != null) { - return JSON.parse(raw); - } - } catch (error) {} - - return getDefaultComponentFilters(); -} -function setSavedComponentFilters(componentFilters) { - Object(storage["c" /* localStorageSetItem */])(constants["h" /* LOCAL_STORAGE_COMPONENT_FILTER_PREFERENCES_KEY */], JSON.stringify(componentFilters)); -} - -function parseBool(s) { - if (s === 'true') { - return true; - } - - if (s === 'false') { - return false; - } -} - -function castBool(v) { - if (v === true || v === false) { - return v; - } -} -function castBrowserTheme(v) { - if (v === 'light' || v === 'dark' || v === 'auto') { - return v; - } -} -function getAppendComponentStack() { - var _parseBool; - - const raw = Object(storage["a" /* localStorageGetItem */])(constants["m" /* LOCAL_STORAGE_SHOULD_APPEND_COMPONENT_STACK_KEY */]); - return (_parseBool = parseBool(raw)) !== null && _parseBool !== void 0 ? _parseBool : true; -} -function getBreakOnConsoleErrors() { - var _parseBool2; - - const raw = Object(storage["a" /* localStorageGetItem */])(constants["n" /* LOCAL_STORAGE_SHOULD_BREAK_ON_CONSOLE_ERRORS */]); - return (_parseBool2 = parseBool(raw)) !== null && _parseBool2 !== void 0 ? _parseBool2 : false; -} -function getHideConsoleLogsInStrictMode() { - var _parseBool3; - - const raw = Object(storage["a" /* localStorageGetItem */])(constants["j" /* LOCAL_STORAGE_HIDE_CONSOLE_LOGS_IN_STRICT_MODE */]); - return (_parseBool3 = parseBool(raw)) !== null && _parseBool3 !== void 0 ? _parseBool3 : false; -} -function getShowInlineWarningsAndErrors() { - var _parseBool4; - - const raw = Object(storage["a" /* localStorageGetItem */])(constants["o" /* LOCAL_STORAGE_SHOW_INLINE_WARNINGS_AND_ERRORS_KEY */]); - return (_parseBool4 = parseBool(raw)) !== null && _parseBool4 !== void 0 ? _parseBool4 : true; -} -function getDefaultOpenInEditorURL() { - return typeof null === 'string' ? null : ''; -} -function getOpenInEditorURL() { - try { - const raw = Object(storage["a" /* localStorageGetItem */])(constants["k" /* LOCAL_STORAGE_OPEN_IN_EDITOR_URL */]); - - if (raw != null) { - return JSON.parse(raw); - } - } catch (error) {} - - return getDefaultOpenInEditorURL(); -} -function separateDisplayNameAndHOCs(displayName, type) { - if (displayName === null) { - return [null, null]; - } - - let hocDisplayNames = null; - - switch (type) { - case types["e" /* ElementTypeClass */]: - case types["g" /* ElementTypeForwardRef */]: - case types["h" /* ElementTypeFunction */]: - case types["j" /* ElementTypeMemo */]: - if (displayName.indexOf('(') >= 0) { - const matches = displayName.match(/[^()]+/g); - - if (matches != null) { - displayName = matches.pop(); - hocDisplayNames = matches; - } - } - - break; - - default: - break; - } - - return [displayName, hocDisplayNames]; -} // Pulled from react-compat -// https://github.com/developit/preact-compat/blob/7c5de00e7c85e2ffd011bf3af02899b63f699d3a/src/index.js#L349 - -function shallowDiffers(prev, next) { - for (const attribute in prev) { - if (!(attribute in next)) { - return true; - } - } - - for (const attribute in next) { - if (prev[attribute] !== next[attribute]) { - return true; - } - } - - return false; -} -function getInObject(object, path) { - return path.reduce((reduced, attr) => { - if (reduced) { - if (utils_hasOwnProperty.call(reduced, attr)) { - return reduced[attr]; - } - - if (typeof reduced[Symbol.iterator] === 'function') { - // Convert iterable to array and return array[index] - // - // TRICKY - // Don't use [...spread] syntax for this purpose. - // This project uses @babel/plugin-transform-spread in "loose" mode which only works with Array values. - // Other types (e.g. typed arrays, Sets) will not spread correctly. - return Array.from(reduced)[attr]; - } - } - - return null; - }, object); -} -function deletePathInObject(object, path) { - const length = path.length; - const last = path[length - 1]; - - if (object != null) { - const parent = getInObject(object, path.slice(0, length - 1)); - - if (parent) { - if (Object(isArray["a" /* default */])(parent)) { - parent.splice(last, 1); - } else { - delete parent[last]; - } - } - } -} -function renamePathInObject(object, oldPath, newPath) { - const length = oldPath.length; - - if (object != null) { - const parent = getInObject(object, oldPath.slice(0, length - 1)); - - if (parent) { - const lastOld = oldPath[length - 1]; - const lastNew = newPath[length - 1]; - parent[lastNew] = parent[lastOld]; - - if (Object(isArray["a" /* default */])(parent)) { - parent.splice(lastOld, 1); - } else { - delete parent[lastOld]; - } - } - } -} -function setInObject(object, path, value) { - const length = path.length; - const last = path[length - 1]; - - if (object != null) { - const parent = getInObject(object, path.slice(0, length - 1)); - - if (parent) { - parent[last] = value; - } - } -} - -/** - * Get a enhanced/artificial type string based on the object instance - */ -function getDataType(data) { - if (data === null) { - return 'null'; - } else if (data === undefined) { - return 'undefined'; - } - - if (Object(react_is["isElement"])(data)) { - return 'react_element'; - } - - if (typeof HTMLElement !== 'undefined' && data instanceof HTMLElement) { - return 'html_element'; - } - - const type = typeof data; - - switch (type) { - case 'bigint': - return 'bigint'; - - case 'boolean': - return 'boolean'; - - case 'function': - return 'function'; - - case 'number': - if (Number.isNaN(data)) { - return 'nan'; - } else if (!Number.isFinite(data)) { - return 'infinity'; - } else { - return 'number'; - } - - case 'object': - if (Object(isArray["a" /* default */])(data)) { - return 'array'; - } else if (ArrayBuffer.isView(data)) { - return utils_hasOwnProperty.call(data.constructor, 'BYTES_PER_ELEMENT') ? 'typed_array' : 'data_view'; - } else if (data.constructor && data.constructor.name === 'ArrayBuffer') { - // HACK This ArrayBuffer check is gross; is there a better way? - // We could try to create a new DataView with the value. - // If it doesn't error, we know it's an ArrayBuffer, - // but this seems kind of awkward and expensive. - return 'array_buffer'; - } else if (typeof data[Symbol.iterator] === 'function') { - const iterator = data[Symbol.iterator](); - - if (!iterator) {// Proxies might break assumptoins about iterators. - // See github.com/facebook/react/issues/21654 - } else { - return iterator === data ? 'opaque_iterator' : 'iterator'; - } - } else if (data.constructor && data.constructor.name === 'RegExp') { - return 'regexp'; - } else { - // $FlowFixMe[method-unbinding] - const toStringValue = Object.prototype.toString.call(data); - - if (toStringValue === '[object Date]') { - return 'date'; - } else if (toStringValue === '[object HTMLAllCollection]') { - return 'html_all_collection'; - } - } - - return 'object'; - - case 'string': - return 'string'; - - case 'symbol': - return 'symbol'; - - case 'undefined': - if ( // $FlowFixMe[method-unbinding] - Object.prototype.toString.call(data) === '[object HTMLAllCollection]') { - return 'html_all_collection'; - } - - return 'undefined'; - - default: - return 'unknown'; - } -} -function getDisplayNameForReactElement(element) { - const elementType = Object(react_is["typeOf"])(element); - - switch (elementType) { - case react_is["ContextConsumer"]: - return 'ContextConsumer'; - - case react_is["ContextProvider"]: - return 'ContextProvider'; - - case react_is["ForwardRef"]: - return 'ForwardRef'; - - case react_is["Fragment"]: - return 'Fragment'; - - case react_is["Lazy"]: - return 'Lazy'; - - case react_is["Memo"]: - return 'Memo'; - - case react_is["Portal"]: - return 'Portal'; - - case react_is["Profiler"]: - return 'Profiler'; - - case react_is["StrictMode"]: - return 'StrictMode'; - - case react_is["Suspense"]: - return 'Suspense'; - - case REACT_SUSPENSE_LIST_TYPE: - return 'SuspenseList'; - - case REACT_TRACING_MARKER_TYPE: - return 'TracingMarker'; - - default: - const { - type - } = element; - - if (typeof type === 'string') { - return type; - } else if (typeof type === 'function') { - return getDisplayName(type, 'Anonymous'); - } else if (type != null) { - return 'NotImplementedInDevtools'; - } else { - return 'Element'; - } - - } -} -const MAX_PREVIEW_STRING_LENGTH = 50; - -function truncateForDisplay(string, length = MAX_PREVIEW_STRING_LENGTH) { - if (string.length > length) { - return string.substr(0, length) + '…'; - } else { - return string; - } -} // Attempts to mimic Chrome's inline preview for values. -// For example, the following value... -// { -// foo: 123, -// bar: "abc", -// baz: [true, false], -// qux: { ab: 1, cd: 2 } -// }; -// -// Would show a preview of... -// {foo: 123, bar: "abc", baz: Array(2), qux: {…}} -// -// And the following value... -// [ -// 123, -// "abc", -// [true, false], -// { foo: 123, bar: "abc" } -// ]; -// -// Would show a preview of... -// [123, "abc", Array(2), {…}] - - -function formatDataForPreview(data, showFormattedValue) { - if (data != null && utils_hasOwnProperty.call(data, hydration["d" /* meta */].type)) { - return showFormattedValue ? data[hydration["d" /* meta */].preview_long] : data[hydration["d" /* meta */].preview_short]; - } - - const type = getDataType(data); - - switch (type) { - case 'html_element': - return `<${truncateForDisplay(data.tagName.toLowerCase())} />`; - - case 'function': - return truncateForDisplay(`ƒ ${typeof data.name === 'function' ? '' : data.name}() {}`); - - case 'string': - return `"${data}"`; - - case 'bigint': - return truncateForDisplay(data.toString() + 'n'); - - case 'regexp': - return truncateForDisplay(data.toString()); - - case 'symbol': - return truncateForDisplay(data.toString()); - - case 'react_element': - return `<${truncateForDisplay(getDisplayNameForReactElement(data) || 'Unknown')} />`; - - case 'array_buffer': - return `ArrayBuffer(${data.byteLength})`; - - case 'data_view': - return `DataView(${data.buffer.byteLength})`; - - case 'array': - if (showFormattedValue) { - let formatted = ''; - - for (let i = 0; i < data.length; i++) { - if (i > 0) { - formatted += ', '; - } - - formatted += formatDataForPreview(data[i], false); - - if (formatted.length > MAX_PREVIEW_STRING_LENGTH) { - // Prevent doing a lot of unnecessary iteration... - break; - } - } - - return `[${truncateForDisplay(formatted)}]`; - } else { - const length = utils_hasOwnProperty.call(data, hydration["d" /* meta */].size) ? data[hydration["d" /* meta */].size] : data.length; - return `Array(${length})`; - } - - case 'typed_array': - const shortName = `${data.constructor.name}(${data.length})`; - - if (showFormattedValue) { - let formatted = ''; - - for (let i = 0; i < data.length; i++) { - if (i > 0) { - formatted += ', '; - } - - formatted += data[i]; - - if (formatted.length > MAX_PREVIEW_STRING_LENGTH) { - // Prevent doing a lot of unnecessary iteration... - break; - } - } - - return `${shortName} [${truncateForDisplay(formatted)}]`; - } else { - return shortName; - } - - case 'iterator': - const name = data.constructor.name; - - if (showFormattedValue) { - // TRICKY - // Don't use [...spread] syntax for this purpose. - // This project uses @babel/plugin-transform-spread in "loose" mode which only works with Array values. - // Other types (e.g. typed arrays, Sets) will not spread correctly. - const array = Array.from(data); - let formatted = ''; - - for (let i = 0; i < array.length; i++) { - const entryOrEntries = array[i]; - - if (i > 0) { - formatted += ', '; - } // TRICKY - // Browsers display Maps and Sets differently. - // To mimic their behavior, detect if we've been given an entries tuple. - // Map(2) {"abc" => 123, "def" => 123} - // Set(2) {"abc", 123} - - - if (Object(isArray["a" /* default */])(entryOrEntries)) { - const key = formatDataForPreview(entryOrEntries[0], true); - const value = formatDataForPreview(entryOrEntries[1], false); - formatted += `${key} => ${value}`; - } else { - formatted += formatDataForPreview(entryOrEntries, false); - } - - if (formatted.length > MAX_PREVIEW_STRING_LENGTH) { - // Prevent doing a lot of unnecessary iteration... - break; - } - } - - return `${name}(${data.size}) {${truncateForDisplay(formatted)}}`; - } else { - return `${name}(${data.size})`; - } - - case 'opaque_iterator': - { - return data[Symbol.toStringTag]; - } - - case 'date': - return data.toString(); - - case 'object': - if (showFormattedValue) { - const keys = Array.from(getAllEnumerableKeys(data)).sort(alphaSortKeys); - let formatted = ''; - - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - - if (i > 0) { - formatted += ', '; - } - - formatted += `${key.toString()}: ${formatDataForPreview(data[key], false)}`; - - if (formatted.length > MAX_PREVIEW_STRING_LENGTH) { - // Prevent doing a lot of unnecessary iteration... - break; - } - } - - return `{${truncateForDisplay(formatted)}}`; - } else { - return '{…}'; - } - - case 'boolean': - case 'number': - case 'infinity': - case 'nan': - case 'null': - case 'undefined': - return data; - - default: - try { - return truncateForDisplay(String(data)); - } catch (error) { - return 'unserializable'; - } - - } -} - -/***/ }), -/* 4 */, -/* 5 */ -/***/ (function(module, exports) { - -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -// css base code, injected by the css-loader -module.exports = function (useSourceMap) { - var list = []; // return the list of modules as css string - - list.toString = function toString() { - return this.map(function (item) { - var content = cssWithMappingToString(item, useSourceMap); - - if (item[2]) { - return "@media " + item[2] + "{" + content + "}"; - } else { - return content; - } - }).join(""); - }; // import a list of modules into the list - - - list.i = function (modules, mediaQuery) { - if (typeof modules === "string") modules = [[null, modules, ""]]; - var alreadyImportedModules = {}; - - for (var i = 0; i < this.length; i++) { - var id = this[i][0]; - if (typeof id === "number") alreadyImportedModules[id] = true; - } - - for (i = 0; i < modules.length; i++) { - var item = modules[i]; // skip already imported module - // this implementation is not 100% perfect for weird media query combinations - // when a module is imported multiple times with different media queries. - // I hope this will never occur (Hey this way we have smaller bundles) - - if (typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { - if (mediaQuery && !item[2]) { - item[2] = mediaQuery; - } else if (mediaQuery) { - item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; - } - - list.push(item); - } - } - }; - - return list; -}; - -function cssWithMappingToString(item, useSourceMap) { - var content = item[1] || ''; - var cssMapping = item[3]; - - if (!cssMapping) { - return content; - } - - if (useSourceMap && typeof btoa === 'function') { - var sourceMapping = toComment(cssMapping); - var sourceURLs = cssMapping.sources.map(function (source) { - return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'; - }); - return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); - } - - return [content].join('\n'); -} // Adapted from convert-source-map (MIT) - - -function toComment(sourceMap) { - // eslint-disable-next-line no-undef - var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); - var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; - return '/*# ' + data + ' */'; -} - -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -var stylesInDom = {}; - -var memoize = function (fn) { - var memo; - - return function () { - if (typeof memo === "undefined") memo = fn.apply(this, arguments); - return memo; - }; -}; - -var isOldIE = memoize(function () { - // Test for IE <= 9 as proposed by Browserhacks - // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805 - // Tests for existence of standard globals is to allow style-loader - // to operate correctly into non-standard environments - // @see https://github.com/webpack-contrib/style-loader/issues/177 - return window && document && document.all && !window.atob; -}); - -var getTarget = function (target, parent) { - if (parent){ - return parent.querySelector(target); - } - return document.querySelector(target); -}; - -var getElement = (function (fn) { - var memo = {}; - - return function(target, parent) { - // If passing function in options, then use it for resolve "head" element. - // Useful for Shadow Root style i.e - // { - // insertInto: function () { return document.querySelector("#foo").shadowRoot } - // } - if (typeof target === 'function') { - return target(); - } - if (typeof memo[target] === "undefined") { - var styleTarget = getTarget.call(this, target, parent); - // Special case to return head of iframe instead of iframe itself - if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) { - try { - // This will throw an exception if access to iframe is blocked - // due to cross-origin restrictions - styleTarget = styleTarget.contentDocument.head; - } catch(e) { - styleTarget = null; - } - } - memo[target] = styleTarget; - } - return memo[target] - }; -})(); - -var singleton = null; -var singletonCounter = 0; -var stylesInsertedAtTop = []; - -var fixUrls = __webpack_require__(124); - -module.exports = function(list, options) { - if (typeof DEBUG !== "undefined" && DEBUG) { - if (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment"); - } - - options = options || {}; - - options.attrs = typeof options.attrs === "object" ? options.attrs : {}; - - // Force single-tag solution on IE6-9, which has a hard limit on the # of development780780 \ No newline at end of file diff --git a/src/react-devtools/icons/development.svg b/src/react-devtools/icons/development.svg deleted file mode 100644 index b4930e4..0000000 --- a/src/react-devtools/icons/development.svg +++ /dev/null @@ -1 +0,0 @@ -development780780 \ No newline at end of file diff --git a/src/react-devtools/icons/disabled.svg b/src/react-devtools/icons/disabled.svg deleted file mode 100644 index 12d6914..0000000 --- a/src/react-devtools/icons/disabled.svg +++ /dev/null @@ -1 +0,0 @@ -disabled \ No newline at end of file diff --git a/src/react-devtools/icons/outdated.svg b/src/react-devtools/icons/outdated.svg deleted file mode 100644 index d11c0be..0000000 --- a/src/react-devtools/icons/outdated.svg +++ /dev/null @@ -1 +0,0 @@ -outdated \ No newline at end of file diff --git a/src/react-devtools/icons/production.svg b/src/react-devtools/icons/production.svg deleted file mode 100644 index 2eab4bf..0000000 --- a/src/react-devtools/icons/production.svg +++ /dev/null @@ -1 +0,0 @@ -production \ No newline at end of file diff --git a/src/react-devtools/icons/restricted.svg b/src/react-devtools/icons/restricted.svg deleted file mode 100644 index 12d6914..0000000 --- a/src/react-devtools/icons/restricted.svg +++ /dev/null @@ -1 +0,0 @@ -disabled \ No newline at end of file diff --git a/src/react-devtools/main.html b/src/react-devtools/main.html deleted file mode 100644 index f1c96d4..0000000 --- a/src/react-devtools/main.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/src/react-devtools/manifest.json b/src/react-devtools/manifest.json deleted file mode 100644 index 2479542..0000000 --- a/src/react-devtools/manifest.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "manifest_version": 2, - "name": "React Developer Tools", - "description": "Adds React debugging tools to the Firefox Developer Tools.\n\nCreated from revision f7d56173f on 1/27/2023.", - "version": "4.27.1", - "version_name": "4.27.1 (1/27/2023)", - "minimum_chrome_version": "60", - "icons": { - "16": "icons/16-production.png", - "32": "icons/32-production.png", - "48": "icons/48-production.png", - "128": "icons/128-production.png" - }, - "browser_action": { - "default_icon": { - "16": "icons/16-disabled.png", - "32": "icons/32-disabled.png", - "48": "icons/48-disabled.png", - "128": "icons/128-disabled.png" - }, - "default_popup": "popups/disabled.html", - "browser_style": true - }, - "devtools_page": "main.html", - "content_security_policy": "script-src 'self' 'unsafe-eval' blob:; object-src 'self'", - "web_accessible_resources": [ - "main.html", - "panel.html", - "build/react_devtools_backend.js", - "build/proxy.js", - "build/renderer.js", - "build/installHook.js" - ], - "background": { - "scripts": [ - "build/background.js" - ] - }, - "permissions": [ - "file:///*", - "http://*/*", - "https://*/*" - ], - "content_scripts": [ - { - "matches": [ - "" - ], - "js": [ - "build/prepareInjection.js" - ], - "run_at": "document_start" - } - ] -} \ No newline at end of file diff --git a/src/react-devtools/panel.html b/src/react-devtools/panel.html deleted file mode 100644 index 60fd1bd..0000000 --- a/src/react-devtools/panel.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - -
Unable to find React on the page.
- - - diff --git a/src/react-devtools/popups/deadcode.html b/src/react-devtools/popups/deadcode.html deleted file mode 100644 index 5b45898..0000000 --- a/src/react-devtools/popups/deadcode.html +++ /dev/null @@ -1,28 +0,0 @@ - - - -

- This page includes an extra development build of React. 🚧 -

-

- The React build on this page includes both development and production versions because dead code elimination has not been applied correctly. -
-
- This makes its size larger, and causes React to run slower. -
-
- Make sure to
set up dead code elimination before deployment. -

-
-

- Open the developer tools, and "Components" and "Profiler" tabs will appear to the right. -

diff --git a/src/react-devtools/popups/development.html b/src/react-devtools/popups/development.html deleted file mode 100644 index a0d27ec..0000000 --- a/src/react-devtools/popups/development.html +++ /dev/null @@ -1,24 +0,0 @@ - - - -

- This page is using the development build of React. 🚧 -

-

- Note that the development build is not suitable for production. -
- Make sure to use the production build before deployment. -

-
-

- Open the developer tools, and "Components" and "Profiler" tabs will appear to the right. -

diff --git a/src/react-devtools/popups/disabled.html b/src/react-devtools/popups/disabled.html deleted file mode 100644 index 52f7622..0000000 --- a/src/react-devtools/popups/disabled.html +++ /dev/null @@ -1,17 +0,0 @@ - - - -

- This page doesn’t appear to be using React. -
- If this seems wrong, follow the troubleshooting instructions. -

diff --git a/src/react-devtools/popups/outdated.html b/src/react-devtools/popups/outdated.html deleted file mode 100644 index ebeabc7..0000000 --- a/src/react-devtools/popups/outdated.html +++ /dev/null @@ -1,25 +0,0 @@ - - - -

- This page is using an outdated version of React. ⌛ -

-

- We recommend updating React to ensure that you receive important bugfixes and performance improvements. -
-
- You can find the upgrade instructions on the React blog. -

-
-

- Open the developer tools, and "Components" and "Profiler" tabs will appear to the right. -

diff --git a/src/react-devtools/popups/production.html b/src/react-devtools/popups/production.html deleted file mode 100644 index 44ae179..0000000 --- a/src/react-devtools/popups/production.html +++ /dev/null @@ -1,17 +0,0 @@ - - - -

- This page is using the production build of React. ✅ -
- Open the developer tools, and "Components" and "Profiler" tabs will appear to the right. -

diff --git a/src/react-devtools/popups/restricted.html b/src/react-devtools/popups/restricted.html deleted file mode 100644 index 77acf08..0000000 --- a/src/react-devtools/popups/restricted.html +++ /dev/null @@ -1,14 +0,0 @@ - - - -

- This is a restricted browser page. -
- React devtools cannot access this page. -

diff --git a/src/react-devtools/popups/shared.css b/src/react-devtools/popups/shared.css deleted file mode 100644 index cd3d35d..0000000 --- a/src/react-devtools/popups/shared.css +++ /dev/null @@ -1,7 +0,0 @@ -html, body { - font-size: 14px; -} - -body { - margin: 8px; -} \ No newline at end of file diff --git a/src/react-devtools/popups/shared.js b/src/react-devtools/popups/shared.js deleted file mode 100644 index 53b2bc1..0000000 --- a/src/react-devtools/popups/shared.js +++ /dev/null @@ -1,25 +0,0 @@ -/* globals chrome */ - -'use strict'; - -document.addEventListener('DOMContentLoaded', function() { - // Make links work - const links = document.getElementsByTagName('a'); - for (let i = 0; i < links.length; i++) { - (function() { - const ln = links[i]; - const location = ln.href; - ln.onclick = function() { - chrome.tabs.create({active: true, url: location}); - return false; - }; - })(); - } - - // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=428044 - document.body.style.opacity = 0; - document.body.style.transition = 'opacity ease-out .4s'; - requestAnimationFrame(function() { - document.body.style.opacity = 1; - }); -}); diff --git a/src/react-devtools/popups/unminified.html b/src/react-devtools/popups/unminified.html deleted file mode 100644 index b61fb78..0000000 --- a/src/react-devtools/popups/unminified.html +++ /dev/null @@ -1,31 +0,0 @@ - - -

- This page is using an unminified build of React. 🚧 -

-

- The React build on this page appears to be unminified. -
- This makes its size larger, and causes React to run slower. -
-
- Make sure to set up minification before deployment. -

-
-

- Open the developer tools, and "Components" and "Profiler" tabs will appear to the right. -

diff --git a/src/utils/Activity.ts b/src/utils/Activity.ts index cc60c9a..625a5a0 100644 --- a/src/utils/Activity.ts +++ b/src/utils/Activity.ts @@ -1,11 +1,10 @@ import * as Config from './Config'; import { tray } from './Tray'; -import { clientId } from '../variables'; import { version } from '../../package.json'; -import { RichPresence } from 'discord.js-selfbot-v13'; +import { ActivityType } from 'discord-api-types/v10'; export async function setActivity(options: { - client: import('discord-rpc').Client | import('discord.js-selfbot-v13').Client, albumId: number, trackId: string, playing: boolean, timeLeft: number, + client: import('@xhayper/discord-rpc').Client, albumId: number, trackId: string, playing: boolean, timeLeft: number, // eslint-disable-next-line @typescript-eslint/no-explicit-any trackTitle: string, trackArtists: any, albumCover: string, albumTitle: string, app: Electron.App, type: string }) { @@ -32,16 +31,10 @@ export async function setActivity(options: { break; } if (!client) return; - const isRPC = client instanceof (await import('discord-rpc')).Client; if (Config.get(app, 'only_show_if_playing') && !playing) { - if (isRPC) { - await client.clearActivity(process.pid); - return; - } else { - client.user.setActivity(null); - return; - } + await client.user.clearActivity(); + return; } const getTrackLink = () => { @@ -55,33 +48,16 @@ export async function setActivity(options: { const button = (getTrackLink() && parseInt(trackId) > 0) && { label: 'Play on Deezer', url: getTrackLink() }; const isLivestream = (Date.now() + timeLeft) < Date.now(); - if (isRPC) { - client.setActivity({ - details: trackTitle, - state: trackArtists, - largeImageKey: albumCover, - largeImageText: albumTitle, - instance: false, - startTimestamp: playing && Date.now(), - [isLivestream ? 'startTimestamp' : 'endTimestamp']: playing && Date.now() + timeLeft, - buttons: button ? [button] : undefined - }).catch(() => {}); - } else { - const presence = new RichPresence() - .setType('LISTENING') - .setName('Deezer') - .setDetails(trackTitle) - .setState(trackArtists) - // @ts-expect-error wrong type - .setStartTimestamp(playing && Date.now()) - // @ts-expect-error wrong type too - // eslint-disable-next-line no-unexpected-multiline - [isLivestream ? 'setStartTimestamp' : 'setEndTimestamp'](playing && Date.now() + timeLeft) - .setApplicationId(clientId) - .setAssetsLargeImage('mp:'.concat((await RichPresence.getExternal(client, clientId, albumCover, ''))[0].external_asset_path)) - .setAssetsLargeText(albumTitle) - ; - if (button) presence.addButton(button.label, button.url); - client.user.setActivity(presence); - } + const useListening = Config.get(app, 'use_listening_to'); + client.user.setActivity({ + type: useListening ? ActivityType.Listening : ActivityType.Playing, + details: trackTitle, + state: trackArtists, + largeImageKey: albumCover, + largeImageText: albumTitle, + instance: false, + startTimestamp: playing && Date.now(), + [isLivestream ? 'startTimestamp' : 'endTimestamp']: playing && Date.now() + timeLeft, + buttons: button ? [button] : undefined, + }).catch(() => {}); } diff --git a/src/utils/DiscordWebSocket.ts b/src/utils/DiscordWebSocket.ts deleted file mode 100644 index d15dbcb..0000000 --- a/src/utils/DiscordWebSocket.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { log } from './Log'; -import * as RPC from './RPC'; -import { Client, RawUserSettingsData } from 'discord.js-selfbot-v13'; -import { dialog } from 'electron'; -import * as Config from './Config'; - -export const client = new Client({ - checkUpdate: false -}); - -export async function connect(token: string, app: Electron.App) { - client.on('ready', async () => { - if (RPC.client && RPC.client.user) { - await RPC.client.clearActivity(process.pid); - await RPC.client.destroy(); - } - - log('WebSocket', `Logged in as ${client.user.tag}`); - - client.user.setStatus((client.settings.rawSetting).status); - }); - - client.on('userSettingsUpdate', (settings) => { - if (!settings.status) return; - client.user.setStatus(settings.status); - }); - - try { - await client.login(token); - } catch (e) { - log('WebSocket', 'Failed to log in'); - Config.set(app, 'discord_token', ''); - Config.set(app, 'use_listening_to', false); - dialog.showErrorBox('Error', 'The token you provided for the "Listening to" mode is invalid.'); - } -} - -export function disconnect() { - log('WebSocket', 'Disconnecting...'); - client.destroy(); - log('WebSocket', 'Disconnected'); -} diff --git a/src/utils/RPC.ts b/src/utils/RPC.ts index d702f72..558368a 100644 --- a/src/utils/RPC.ts +++ b/src/utils/RPC.ts @@ -1,9 +1,12 @@ -import * as RPC from 'discord-rpc'; +import * as RPC from '@xhayper/discord-rpc'; import { log } from './Log'; import { clientId } from '../variables'; export const client = new RPC.Client({ - transport: 'ipc', + transport: { + type: 'ipc', + }, + clientId }); export function connect() { @@ -15,7 +18,7 @@ export function connect() { log('RPC', 'Disconnected, trying to reconnect...'); const attempts = 0; const attemptsInterval = setInterval(() => { - client.login({ clientId }).then(() => { + client.login().then(() => { clearInterval(attemptsInterval); }).catch(console.error); log('RPC', `Reconnecting... Attempt ${attempts + 1}`); @@ -25,11 +28,11 @@ export function connect() { }, 8000); }); - client.login({ clientId }).catch(console.error); + client.login().catch(console.error); } export async function disconnect() { log('RPC', 'Disconnecting...'); - await client.clearActivity(process.pid); + await client.user.clearActivity(process.pid); await client.destroy().then(() => log('RPC', 'Disconnected')); } diff --git a/src/utils/Tray.ts b/src/utils/Tray.ts index 8b9a29e..e9b3e91 100644 --- a/src/utils/Tray.ts +++ b/src/utils/Tray.ts @@ -1,19 +1,16 @@ import { join } from 'path'; import updater from './Updater'; -import { clientId } from '../variables'; import * as Config from './Config'; import * as RPC from './RPC'; -import { prompt } from '../functions'; -import { dialog, Menu, Tray } from 'electron'; +import { Menu, Tray } from 'electron'; import { version } from '../../package.json'; import { log } from './Log'; import { win } from './Window'; -import * as DiscordWebSocket from './DiscordWebSocket'; const iconPath = join(__dirname, '..', 'img', 'tray.png'); export let tray: Tray | null = null; -export async function init(app: Electron.App, client: import('discord-rpc').Client) { +export async function init(app: Electron.App, client: import('@xhayper/discord-rpc').Client) { app?.whenReady().then(() => { tray = new Tray(iconPath); const contextMenu = Menu.buildFromTemplate([ @@ -43,18 +40,13 @@ export async function init(app: Electron.App, client: import('discord-rpc').Clie }, { id: 'reconnect', - label: Config.get(app, 'use_listening_to') ? 'Reconnect to WebSocket' : 'Reconnect RPC', + label: 'Reconnect RPC', type: 'normal', - visible: false, // how tf do I reconnect to the fcking ipc - click: (menuItem) => { - ( - Config.get(app, 'use_listening_to') ? - DiscordWebSocket.connect(Config.get(app, 'discord_token'), app).catch((e) => log('WebSocket', e.toString())) : - client.login({ clientId }) - ) + visible: false, + click: () => { + client.login() .then(() => { - log(Config.get(app, 'use_listening_to') ? 'WebSocket' : 'RPC', 'Reconnected'); - menuItem.label = Config.get(app, 'use_listening_to') ? 'Reconnect to WebSocket' : 'Reconnect RPC'; + log('RPC', 'Reconnected'); }) .catch(console.error); } @@ -62,34 +54,17 @@ export async function init(app: Electron.App, client: import('discord-rpc').Clie { label: 'Use "Listening to" instead of "Playing"', type: 'checkbox', checked: Config.get(app, 'use_listening_to'), click: async (menuItem) => { - if (!menuItem.checked) { - menuItem.enabled = false; - menuItem.checked = true; - await dialog.showMessageBox(null, { - type: 'question', - buttons: ['No', 'Yes'], - title: '"Listening to" status', - message: 'Do you want to disable the "Listening to" status and use the "Playing" status?', - }).then(({ response }) => { - menuItem.enabled = true; - if (response === 1) { - menuItem.checked = false; - Config.set(app, 'use_listening_to', false); - DiscordWebSocket.disconnect(); - RPC.client.login({ clientId }).catch(() => RPC.client.connect(clientId).catch(console.error)); - } - }); - } else { - menuItem.enabled = false; - menuItem.checked = false; - await prompt('ws', app); + Config.set(app, 'use_listening_to', menuItem.checked); + if (menuItem.checked) { + await RPC.disconnect(); + await RPC.connect(); } } }, { type: 'separator' }, { label: 'Quit', type: 'normal', click: async () => { - Config.get(app, 'use_listening_to') ? DiscordWebSocket.disconnect() : RPC.disconnect().catch(console.error); + RPC.disconnect().catch(console.error); win.close(); app.quit(); process.exit(0); diff --git a/src/utils/Window.ts b/src/utils/Window.ts index 6e7cd8e..6c1f784 100644 --- a/src/utils/Window.ts +++ b/src/utils/Window.ts @@ -2,7 +2,6 @@ import { userAgent } from '../variables'; import { join, resolve } from 'path'; import loadAdBlock from './AdBlock'; import * as Config from './Config'; -import * as DiscordWebSocket from './DiscordWebSocket'; import * as RPC from './RPC'; import { log } from './Log'; import { runJs, wait } from '../functions'; @@ -40,8 +39,6 @@ export async function load(app: Electron.App) { userAgent }); - await setThumbarButtons(); - session.defaultSession.webRequest.onBeforeSendHeaders((details, callback) => { if (details.url.includes('deezer.com')) { details.requestHeaders['User-Agent'] = userAgent; @@ -83,8 +80,9 @@ export async function load(app: Electron.App) { } }); - win.on('close', (e) => { + win.on('close', async (e) => { if (Config.get(app, 'dont_close_to_tray')) { + await RPC.disconnect(); return true; } e.preventDefault(); @@ -140,9 +138,9 @@ export async function showWindow() { } export async function setThumbarButtons() { - const hasPreviousSong = await runJs('!!dzPlayer.getPrevSong()'); - const hasNextSong = await runJs('!!dzPlayer.getNextSong()'); - const isPlaying = await runJs('dzPlayer.isPlaying()'); + const hasPreviousSong = await runJs('dzPlayer && !!dzPlayer.getPrevSong()'); + const hasNextSong = await runJs('dzPlayer && !!dzPlayer.getNextSong()'); + const isPlaying = await runJs('dzPlayer && dzPlayer.isPlaying()'); const updated = win.setThumbarButtons([ { @@ -174,7 +172,7 @@ const UpdateReason = { async function updateActivity(app: Electron.App, currentTimeChanged?: boolean) { setThumbarButtons(); - const client = (Config.get(app, 'use_listening_to') ? DiscordWebSocket : RPC).client; + const client = RPC.client; const code = `(() => { const albumId = document.querySelector('.track-link[href*="album"]')?.getAttribute('href').split('/')[3]; @@ -183,12 +181,12 @@ async function updateActivity(app: Electron.App, currentTimeChanged?: boolean) { const playerType = dzPlayer.getPlayerType(); const mediaType = dzPlayer.getMediaType(); const isLivestreamRadio = playerType === 'radio' && radioType === 'livestream'; - const playerInfo = document.querySelector('.track-title .marquee-content')?.textContent; - const trackName = dzPlayer.getSongTitle() + (dzPlayer.getCurrentSong()?.VERSION ? ' ' + dzPlayer.getCurrentSong()?.VERSION : '') || + const playerInfo = document.querySelector('[data-testid="miniplayer_container"] .marquee-content')?.textContent; + const trackName = dzPlayer.getSongTitle() + (dzPlayer.getCurrentSong()?.VERSION ? ' ' + dzPlayer.getCurrentSong()?.VERSION : '') || dzPlayer.getCurrentSong()?.LIVESTREAM_TITLE || dzPlayer.getCurrentSong()?.EPISODE_TITLE || playerInfo; const albumName = (!isLivestreamRadio ? dzPlayer.getAlbumTitle() : dzPlayer.getCurrentSong().LIVESTREAM_TITLE) || dzPlayer.getCurrentSong()?.SHOW_NAME || playerInfo; - const artists = dzPlayer.getCurrentSong()?.ARTISTS?.map(art => art.ART_NAME)?.join(', ') || dzPlayer.getArtistName() || + const artists = dzPlayer.getCurrentSong()?.ARTISTS?.map(art => art.ART_NAME)?.join(', ') || dzPlayer.getArtistName() || dzPlayer.getCurrentSong()?.SHOW_NAME || playerInfo?.split(' · ')?.[1]; const playing = dzPlayer.isPlaying(); const songTime = Math.floor(dzPlayer.getDuration() * 1000); diff --git a/yarn.lock b/yarn.lock index 18db340..15d0f9e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -92,6 +92,11 @@ resolved "https://registry.yarnpkg.com/@discordjs/collection/-/collection-1.5.2.tgz#3ba34c216e920999b5075f8fdc62f70bb2a7e0fb" integrity sha512-LDplPy8SPbc8MYkuCdnLRGWqygAX97E8NH7gA9uz+NZ/hXknUKJHuxsOmhC6pmHnF9Zmg0kvfwrDjGsRIljt9g== +"@discordjs/collection@^2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@discordjs/collection/-/collection-2.1.0.tgz#f327d944ab2dcf9a1f674470a481f78a120a5e3b" + integrity sha512-mLcTACtXUuVgutoznkh6hS3UFqYirDYAg5Dc1m8xn6OvPjetnUlf/xjtqnnc47OwWdaoCQnHmHh9KofhD6uRqw== + "@discordjs/formatters@^0.3.1": version "0.3.1" resolved "https://registry.yarnpkg.com/@discordjs/formatters/-/formatters-0.3.1.tgz#81393cf25e6e3223361061629752ea727475e842" @@ -99,11 +104,31 @@ dependencies: discord-api-types "^0.37.41" +"@discordjs/rest@^2.3.0": + version "2.3.0" + resolved "https://registry.yarnpkg.com/@discordjs/rest/-/rest-2.3.0.tgz#06d37c7fb54a9be61134b5bbb201abd760343472" + integrity sha512-C1kAJK8aSYRv3ZwMG8cvrrW4GN0g5eMdP8AuN8ODH5DyOCbHgJspze1my3xHOAgwLJdKUbWNVyAeJ9cEdduqIg== + dependencies: + "@discordjs/collection" "^2.1.0" + "@discordjs/util" "^1.1.0" + "@sapphire/async-queue" "^1.5.2" + "@sapphire/snowflake" "^3.5.3" + "@vladfrangu/async_event_emitter" "^2.2.4" + discord-api-types "0.37.83" + magic-bytes.js "^1.10.0" + tslib "^2.6.2" + undici "6.13.0" + "@discordjs/util@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@discordjs/util/-/util-1.0.0.tgz#8b4d3756ee725f6fc1a4999834d6ca7c4a353837" integrity sha512-U2Iiab0mo8cFe+o4ZY4GROoAetGjFYA1PhhxiXEW82LuPUjOU/seHZDtVjDpOf6n3rz4IRm84wNtgHdpqRY5CA== +"@discordjs/util@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@discordjs/util/-/util-1.1.0.tgz#dcffd2b61aab8eadd66bea67811bc34fc769bb2a" + integrity sha512-IndcI5hzlNZ7GS96RV3Xw1R2kaDuXEp7tRIy/KlhidpN/BQ1qh1NZt3377dMLTa44xDUNKT7hnXkA/oUAzD/lg== + "@discordjs/voice@^0.16.0": version "0.16.0" resolved "https://registry.yarnpkg.com/@discordjs/voice/-/voice-0.16.0.tgz#9df1e492c8fea95113236a3de3ac52702c587729" @@ -321,6 +346,11 @@ resolved "https://registry.yarnpkg.com/@sapphire/async-queue/-/async-queue-1.5.0.tgz#2f255a3f186635c4fb5a2381e375d3dfbc5312d8" integrity sha512-JkLdIsP8fPAdh9ZZjrbHWR/+mZj0wvKS5ICibcLrRI1j84UmLMshx5n9QmL8b95d4onJ2xxiyugTgSAX7AalmA== +"@sapphire/async-queue@^1.5.2": + version "1.5.3" + resolved "https://registry.yarnpkg.com/@sapphire/async-queue/-/async-queue-1.5.3.tgz#03cd2a2f3665068f314736bdc56eee2025352422" + integrity sha512-x7zadcfJGxFka1Q3f8gCts1F0xMwCKbZweM85xECGI0hBTeIZJGGCrHgLggihBoprlQ/hBmDR5LKfIPqnmHM3w== + "@sapphire/shapeshift@^3.9.2": version "3.9.2" resolved "https://registry.yarnpkg.com/@sapphire/shapeshift/-/shapeshift-3.9.2.tgz#a9c12cd51e1bc467619bb56df804450dd14871ac" @@ -329,6 +359,11 @@ fast-deep-equal "^3.1.3" lodash "^4.17.21" +"@sapphire/snowflake@^3.5.3": + version "3.5.3" + resolved "https://registry.yarnpkg.com/@sapphire/snowflake/-/snowflake-3.5.3.tgz#0c102aa2ec5b34f806e9bc8625fc6a5e1d0a0c6a" + integrity sha512-jjmJywLAFoWeBi1W7994zZyiNWPIiqRRNAmSERxyg93xRGzNYvGjlZ0gR6x0F4gPRi2+0O6S71kOZYyr3cxaIQ== + "@sindresorhus/is@^4.0.0": version "4.6.0" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.6.0.tgz#3c7c9c46e678feefe7a2e5bb609d3dbd665ffb3f" @@ -616,6 +651,21 @@ resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== +"@vladfrangu/async_event_emitter@^2.2.4", "@vladfrangu/async_event_emitter@^2.4.4": + version "2.4.5" + resolved "https://registry.yarnpkg.com/@vladfrangu/async_event_emitter/-/async_event_emitter-2.4.5.tgz#7bc35026fdc3398a5e1aac801edd21b28cdf4cfa" + integrity sha512-J7T3gUr3Wz0l7Ni1f9upgBZ7+J22/Q1B7dl0X6fG+fTsD+H+31DIosMHj4Um1dWQwqbcQ3oQf+YS2foYkDc9cQ== + +"@xhayper/discord-rpc@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@xhayper/discord-rpc/-/discord-rpc-1.2.0.tgz#8b2238cff7c8d55da37e847f8274978c2f46dae3" + integrity sha512-cKjs9TKzN/7JoozijjszQjUEK1qnLHpEvcJQ2OGFBZjymUzIOH7l14KUu7TQtaIEk0Aw9Bx2w7TfQ0O6tp5mCw== + dependencies: + "@discordjs/rest" "^2.3.0" + "@vladfrangu/async_event_emitter" "^2.4.4" + discord-api-types "^0.37.93" + ws "^8.18.0" + "@xmldom/xmldom@^0.8.8": version "0.8.10" resolved "https://registry.yarnpkg.com/@xmldom/xmldom/-/xmldom-0.8.10.tgz#a1337ca426aa61cef9fe15b5b28e340a72f6fa99" @@ -795,13 +845,6 @@ bignumber.js@^9.0.0: resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.1.1.tgz#c4df7dc496bd849d4c9464344c1aa74228b4dac6" integrity sha512-pHm4LsMJ6lzgNGVfZHjMoO8sdoRhOzOH4MLmY65Jg70bpxCKu5iOHNJyfF6OyvYw7t8Fpf35RuzUyqnQsj8Vig== -bindings@^1.3.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" - integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== - dependencies: - file-uri-to-path "1.0.0" - bluebird-lst@^1.0.9: version "1.0.9" resolved "https://registry.yarnpkg.com/bluebird-lst/-/bluebird-lst-1.0.9.tgz#a64a0e4365658b9ab5fe875eb9dfb694189bb41c" @@ -1132,20 +1175,20 @@ dir-glob@^3.0.1: dependencies: path-type "^4.0.0" +discord-api-types@0.37.83: + version "0.37.83" + resolved "https://registry.yarnpkg.com/discord-api-types/-/discord-api-types-0.37.83.tgz#a22a799729ceded8176ea747157837ddf4708b1f" + integrity sha512-urGGYeWtWNYMKnYlZnOnDHm8fVRffQs3U0SpE8RHeiuLKb/u92APS8HoQnPTFbnXmY1vVnXjXO4dOxcAn3J+DA== + discord-api-types@^0.37.37, discord-api-types@^0.37.41, discord-api-types@^0.37.49, discord-api-types@^0.37.50: version "0.37.52" resolved "https://registry.yarnpkg.com/discord-api-types/-/discord-api-types-0.37.52.tgz#0d47a4409f1e17252dc895f2615dea3d161f7b5f" integrity sha512-TP99aMgY6rHuDIy056GDm1j2nGOcaLbFpjVbvAmv6N6vhkjHNqHXCHVqKtGisaQ8D15slbxTHNl/SSkPdx2syg== -discord-rpc@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/discord-rpc/-/discord-rpc-4.0.1.tgz#a89aa04a048aa83ad4f347d53fa0162501eae0d8" - integrity sha512-HOvHpbq5STRZJjQIBzwoKnQ0jHplbEWFWlPDwXXKm/bILh4nzjcg7mNqll0UY7RsjFoaXA7e/oYb/4lvpda2zA== - dependencies: - node-fetch "^2.6.1" - ws "^7.3.1" - optionalDependencies: - register-scheme "github:devsnek/node-register-scheme" +discord-api-types@^0.37.93: + version "0.37.93" + resolved "https://registry.yarnpkg.com/discord-api-types/-/discord-api-types-0.37.93.tgz#fd2d34738ec2984cc5f904fe245dccf1cc35ffcd" + integrity sha512-M5jn0x3bcXk8EI2c6F6V6LeOWq10B/cJf+YJSyqNmg7z4bdXK+Z7g9zGJwHS0h9Bfgs0nun2LQISFOzwck7G9A== discord.js-selfbot-v13@^2.14.9: version "2.14.9" @@ -1467,11 +1510,6 @@ file-entry-cache@^6.0.1: dependencies: flat-cache "^3.0.4" -file-uri-to-path@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" - integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== - filelist@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/filelist/-/filelist-1.0.4.tgz#f78978a1e944775ff9e62e744424f215e58352b5" @@ -2010,6 +2048,11 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" +magic-bytes.js@^1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/magic-bytes.js/-/magic-bytes.js-1.10.0.tgz#c41cf4bc2f802992b05e64962411c9dd44fdef92" + integrity sha512-/k20Lg2q8LE5xiaaSkMXk4sfvI+9EGEykFS4b0CHHGWqDYU0bGUFSwchNOMA56D7TCs9GwVTkqe9als1/ns8UQ== + make-error@^1.1.1: version "1.3.6" resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" @@ -2133,18 +2176,11 @@ nested-error-stacks@^2.1.1: resolved "https://registry.yarnpkg.com/nested-error-stacks/-/nested-error-stacks-2.1.1.tgz#26c8a3cee6cc05fbcf1e333cd2fc3e003326c0b5" integrity sha512-9iN1ka/9zmX1ZvLV9ewJYEk9h7RyRRtqdK0woXcqohu8EWIerfPUjYJPg0ULy0UqP7cslmdGc8xKDJcojlKiaw== -node-addon-api@^1.3.0, node-addon-api@^1.6.3: +node-addon-api@^1.6.3: version "1.7.2" resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-1.7.2.tgz#3df30b95720b53c24e59948b49532b662444f54d" integrity sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg== -node-fetch@^2.6.1: - version "2.6.9" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.9.tgz#7c7f744b5cc6eb5fd404e0c7a9fec630a55657e6" - integrity sha512-DJm/CJkZkRjKKj4Zi4BsKVZh3ValV5IR5s7LVZnW+6YMh0W1BfNA8XSs6DLMGYlId5F3KnA70uu2qepcR08Qqg== - dependencies: - whatwg-url "^5.0.0" - node-fetch@^2.6.9: version "2.6.12" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.12.tgz#02eb8e22074018e3d5a83016649d04df0e348fba" @@ -2372,13 +2408,6 @@ read-config-file@6.3.2: json5 "^2.2.0" lazy-val "^1.0.4" -"register-scheme@github:devsnek/node-register-scheme": - version "0.0.2" - resolved "https://codeload.github.com/devsnek/node-register-scheme/tar.gz/e7cc9a63a1f512565da44cb57316d9fb10750e17" - dependencies: - bindings "^1.3.0" - node-addon-api "^1.3.0" - require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" @@ -2732,6 +2761,11 @@ tslib@^2.5.0, tslib@^2.6.1: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.1.tgz#fd8c9a0ff42590b25703c0acb3de3d3f4ede0410" integrity sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig== +tslib@^2.6.2: + version "2.6.3" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.3.tgz#0438f810ad7a9edcde7a241c3d80db693c8cbfe0" + integrity sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ== + type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" @@ -2764,6 +2798,11 @@ undici-types@~5.26.4: resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== +undici@6.13.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/undici/-/undici-6.13.0.tgz#7edbf4b7f3aac5f8a681d515151bf55cb3589d72" + integrity sha512-Q2rtqmZWrbP8nePMq7mOJIN98M0fYvSgV89vwl/BQRT4mDOeY2GXZngfGpcBBhtky3woM7G24wZV3Q304Bv6cw== + universalify@^0.1.0: version "0.1.2" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" @@ -2847,16 +2886,16 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== -ws@^7.3.1: - version "7.5.9" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" - integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== - ws@^8.13.0: version "8.13.0" resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0" integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA== +ws@^8.18.0: + version "8.18.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc" + integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw== + xmlbuilder@>=11.0.1, xmlbuilder@^15.1.1: version "15.1.1" resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-15.1.1.tgz#9dcdce49eea66d8d10b42cae94a79c3c8d0c2ec5"