1 line
34 KiB
JSON
1 line
34 KiB
JSON
|
{"ast":null,"code":"/**\n * @license React\n * scheduler.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and 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\n\"use strict\";\n\n\"production\" !== process.env.NODE_ENV && function () {\n function performWorkUntilDeadline() {\n if (isMessageLoopRunning) {\n var currentTime = exports.unstable_now();\n startTime = currentTime;\n var hasMoreWork = !0;\n try {\n a: {\n isHostCallbackScheduled = !1;\n isHostTimeoutScheduled && (isHostTimeoutScheduled = !1, localClearTimeout(taskTimeoutID), taskTimeoutID = -1);\n isPerformingWork = !0;\n var previousPriorityLevel = currentPriorityLevel;\n try {\n b: {\n advanceTimers(currentTime);\n for (currentTask = peek(taskQueue); null !== currentTask && !(currentTask.expirationTime > currentTime && shouldYieldToHost());) {\n var callback = currentTask.callback;\n if (\"function\" === typeof callback) {\n currentTask.callback = null;\n currentPriorityLevel = currentTask.priorityLevel;\n var continuationCallback = callback(currentTask.expirationTime <= currentTime);\n currentTime = exports.unstable_now();\n if (\"function\" === typeof continuationCallback) {\n currentTask.callback = continuationCallback;\n advanceTimers(currentTime);\n hasMoreWork = !0;\n break b;\n }\n currentTask === peek(taskQueue) && pop(taskQueue);\n advanceTimers(currentTime);\n } else pop(taskQueue);\n currentTask = peek(taskQueue);\n }\n if (null !== currentTask) hasMoreWork = !0;else {\n var firstTimer = peek(timerQueue);\n null !== firstTimer && requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);\n hasMoreWork = !1;\n }\n }\n break a;\n } finally {\n currentTask = null, currentPriorityLevel = previousPriorityLevel, isPerformingWork = !1;\n }\n hasMoreWork = void 0;\n }\n } finally {\n hasMoreWork ? schedulePerformWorkUntilDeadline() : isMessageLoopRunning = !1;\n }\n }\n }\n function push(heap, node) {\n var index = heap.length;\n heap.push(node);\n a: for (; 0 < index;) {\n var parentIndex = index - 1 >>> 1,\n parent = heap[parentIndex];\n if (0 < compare(parent, node)) heap[parentIndex] = node, heap[index] = parent, index = parentIndex;else break a;\n }\n }\n function peek(heap) {\n return 0 === heap.length ? null : heap[0];\n }\n function pop(heap) {\n if (0 === heap.length) return null;\n var first = heap[0],\n last = heap.pop();\n if (last !== first) {\n heap[0] = last;\n a: for (var index = 0, length = heap.length, halfLength = length >>> 1; index < halfLength;) {\n var leftIndex = 2 * (index + 1) - 1,\n left = heap[leftIndex],\n rightIndex = leftIndex + 1,\n right = heap[rightIndex];\n if (0 > compare(left, last)) rightIndex < length && 0 > compare(right, left) ? (heap[index] = right, heap[rightIndex] = last, index = rightIndex) : (heap[index] = left, heap[leftIndex] = last, index = leftIndex);else if (rightIndex < length && 0 > compare(right, last)) heap[index] = right, heap[rightIndex] = last, index = rightIndex;else break a;\n }\n }\n return first;\n }\n function compare(a, b) {\n var diff = a.sortIndex - b.sortIndex;\n return 0 !== diff ? diff : a.id - b.id;\n }\n function advanceTimers(currentTime) {\n for (var timer = peek(timerQueue); null !== timer;) {\n if (null === timer.callback) pop(timerQueue);else if (timer.startTime <= currentTime) pop(time
|