text:   var requestHostCallback;
    var requestHostTimeout;
    var cancelHostTimeout;
    var shouldYieldToHost;
    var requestPaint;
    var getCurrentTime;
    var forceFrameRate;
    var hasPerformanceNow = typeof performance === 'object' && typeof performance.now === 'function';
  
    if (hasPerformanceNow) {
      var localPerformance = performance;
  
      getCurrentTime = function () {
        return localPerformance.now();
      };
    } else {
      var localDate = Date;
      var initialTime = localDate.now();
  
      getCurrentTime = function () {
        return localDate.now() - initialTime;
      };
    }
  
    if ( // If Scheduler runs in a non-DOM environment, it falls back to a naive
    // implementation using setTimeout.
    typeof window === 'undefined' || // Check if MessageChannel is supported, too.
    typeof MessageChannel !== 'function') {
      // If this accidentally gets imported in a non-browser environment, e.g. JavaScriptCore,
      // fallback to a naive implementation.
      var _callback = null;
      var _timeoutID = null;
  
      var _flushCallback = function () {
        if (_callback !== null) {
          try {
            var currentTime = getCurrentTime();
            var hasRemainingTime = true;
  
            _callback(hasRemainingTime, currentTime);
  
            _callback = null;
          } catch (e) {
            setTimeout(_flushCallback, 0);
            throw e;
          }
        }
      };
  
      requestHostCallback = function (cb) {
        if (_callback !== null) {
          // Protect against re-entrancy.
          setTimeout(requestHostCallback, 0, cb);
        } else {
          _callback = cb;
          setTimeout(_flushCallback, 0);
        }
      };
  
      requestHostTimeout = function (cb, ms) {
        _timeoutID = setTimeout(cb, ms);
      };
  
      cancelHostTimeout = function () {
        clearTimeout(_timeoutID);
      };
  
      shouldYieldToHost = function () {
        return false;
      };
  
      requestPaint = forceFrameRate = function () {};
    } else {
      // Capture local references to native APIs, in case a polyfill overrides them.
      var _setTimeout = window.setTimeout;
      var _clearTimeout = window.clearTimeout;
  
      if (typeof console !== 'undefined') {
        // TODO: Scheduler no longer requires these methods to be polyfilled. But
        // maybe we want to continue warning if they don't exist, to preserve the
        // option to rely on it in the future?
        var requestAnimationFrame = window.requestAnimationFrame;
        var cancelAnimationFrame = window.cancelAnimationFrame;
  
        if (typeof requestAnimationFrame !== 'function') {
          // Using console['error'] to evade Babel and ESLint
          console['error']("This browser doesn't support requestAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://reactjs.org/link/react-polyfills');
        }
  
        if (typeof cancelAnimationFrame !== 'function') {
          // Using console['error'] to evade Babel and ESLint
          console['error']("This browser doesn't support cancelAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://reactjs.org/link/react-polyfills');
        }
      }
  
      var isMessageLoopRunning = false;
      var scheduledHostCallback = null;
      var taskTimeoutID = -1; // Scheduler periodically yields in case there is other work on the main
      // thread, like user events. By default, it yields multiple times per frame.
      // It does not attempt to align with frame boundaries, since most tasks don't
      // need to be frame aligned; for those that do, use requestAnimationFrame.
  
      var yieldInterval = 5;
      var deadline = 0; // TODO: Make this configurable
  
      {
        // `isInputPending` is not available. Since we have no way of knowing if
        // there's pending input, always yield at the end of the frame.
        shouldYieldToHost = function () {
          return getCurrentTime() >= deadline;
        }; // Since we yield every frame regardless, `requestPaint` has no effect.
  
  
        requestPaint = function () {};
      }
  
      forceFrameRate = function (fps) {
        if (fps < 0 || fps > 125) {
          // Using console['error'] to evade Babel and ESLint
          console['error']('forceFrameRate takes a positive int between 0 and 125, ' + 'forcing frame rates higher than 125 fps is not supported');
          return;
        }
  
        if (fps > 0) {
          yieldInterval = Math.floor(1000 / fps);
        } else {
          // reset the framerate
          yieldInterval = 5;
        }
      };
  
      var performWorkUntilDeadline = function () {
        if (scheduledHostCallback !== null) {
          var currentTime = getCurrentTime(); // Yield after `yieldInterval` ms, regardless of where we are in the vsync
          // cycle. This means there's always time remaining at the beginning of
          // the message event.
  
          deadline = currentTime + yieldInterval;
          var hasTimeRemaining = true;
  
          try {
            var hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime);
  
            if (!hasMoreWork) {
              isMessageLoopRunning = false;
              scheduledHostCallback = null;
            } else {
              // If there's more work, schedule the next message event at the end
              // of the preceding one.
              port.postMessage(null);
            }
          } catch (error) {
            // If a scheduler task throws, exit the current browser task so the
            // error can be observed.
            port.postMessage(null);
            throw error;
          }
        } else {
          isMessageLoopRunning = false;
        } // Yielding to the browser will give it a chance to paint, so we can
      };
  
      var channel = new MessageChannel();
      var port = channel.port2;
      channel.port1.onmessage = performWorkUntilDeadline;
  
      requestHostCallback = function (callback) {
        scheduledHostCallback = callback;
  
        if (!isMessageLoopRunning) {
          isMessageLoopRunning = true;
          port.postMessage(null);
        }
      };
  
      requestHostTimeout = function (callback, ms) {
        taskTimeoutID = _setTimeout(function () {
          callback(getCurrentTime());
        }, ms);
      };
  
      cancelHostTimeout = function () {
        _clearTimeout(taskTimeoutID);
  
        taskTimeoutID = -1;
      };
    }