You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
52 KiB

2 years ago
{"ast":null,"code":"/**\n * @license React\n * scheduler.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function () {\n 'use strict';\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\n\n if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === 'function') {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());\n }\n\n var enableSchedulerDebugging = false;\n var enableProfiling = false;\n var frameYieldMs = 5;\n\n function push(heap, node) {\n var index = heap.length;\n heap.push(node);\n siftUp(heap, node, index);\n }\n\n function peek(heap) {\n return heap.length === 0 ? null : heap[0];\n }\n\n function pop(heap) {\n if (heap.length === 0) {\n return null;\n }\n\n var first = heap[0];\n var last = heap.pop();\n\n if (last !== first) {\n heap[0] = last;\n siftDown(heap, last, 0);\n }\n\n return first;\n }\n\n function siftUp(heap, node, i) {\n var index = i;\n\n while (index > 0) {\n var parentIndex = index - 1 >>> 1;\n var parent = heap[parentIndex];\n\n if (compare(parent, node) > 0) {\n // The parent is larger. Swap positions.\n heap[parentIndex] = node;\n heap[index] = parent;\n index = parentIndex;\n } else {\n // The parent is smaller. Exit.\n return;\n }\n }\n }\n\n function siftDown(heap, node, i) {\n var index = i;\n var length = heap.length;\n var halfLength = length >>> 1;\n\n while (index < halfLength) {\n var leftIndex = (index + 1) * 2 - 1;\n var left = heap[leftIndex];\n var rightIndex = leftIndex + 1;\n var right = heap[rightIndex]; // If the left or right node is smaller, swap with the smaller of those.\n\n if (compare(left, node) < 0) {\n if (rightIndex < length && compare(right, left) < 0) {\n heap[index] = right;\n heap[rightIndex] = node;\n index = rightIndex;\n } else {\n heap[index] = left;\n heap[leftIndex] = node;\n index = leftIndex;\n }\n } else if (rightIndex < length && compare(right, node) < 0) {\n heap[index] = right;\n heap[rightIndex] = node;\n index = rightIndex;\n } else {\n // Neither child is smaller. Exit.\n return;\n }\n }\n }\n\n function compare(a, b) {\n // Compare sort index first, then task id.\n var diff = a.sortIndex - b.sortIndex;\n return diff !== 0 ? diff : a.id - b.id;\n } // TODO: Use symbols?\n\n\n var ImmediatePriority = 1;\n var UserBlockingPriority = 2;\n var NormalPriority = 3;\n var LowPriority = 4;\n var IdlePriority = 5;\n\n function markTaskErrored(task, ms) {}\n /* eslint-disable no-var */\n\n\n var hasPerformanceNow = typeof performance === 'object' && typeof performance.now === 'function';\n\n if (hasPerformanceNow) {\n var localPerformance = performance;\n\n exports.unstable_now = function () {\n return localPerformance.now();\n };\n } else {\n var localDate = Date;\n var initialTime = localDate.now();\n\n exports.unstable_now = function () {\n return localDate.now() - initialTime;\n };\n } // Max 31 bit integer. The max integer size in V8 for 32-bit systems.\n // Math.pow(2, 30) - 1\n // 0b111111111111111111111111111111\n\n\n var maxSigned31BitInt = 1073741823; // Times out immediately\n\n var IMMEDIATE_PRIORITY_TIMEOUT = -1; // Eventually times out\n\n var USER_BLOCKING_PRIORITY_TIMEOUT = 250;\n var NORMAL_PRIORITY_TIMEOUT = 5000;\n var LOW_PRIORITY_TIMEOUT = 10000; // N