import _typeof from "@babel/runtime/helpers/esm/typeof";
var batchTimeoutId = null;
export function getDebugOptions() {
  var debug = window && window.sgTransitionDebug;
  var options = {
    speed: 1,
    outlines: false
  };

  if (!debug || _typeof(debug) !== 'object') {
    return options;
  }

  if (typeof debug.speed === 'number') {
    options.speed = debug.speed;
  }

  if (typeof debug.outlines === 'boolean') {
    options.outlines = debug.outlines;
  }

  var printWarning = function printWarning() {
    console.warn("Transition debug mode is enabled with options: ".concat(JSON.stringify(options)));
  };
  /**
   * The debugging mode applies to every Transition component,
   * therefore multiple references to this function should not
   * immediately print a warning.
   */


  clearTimeout(batchTimeoutId);
  batchTimeoutId = setTimeout(printWarning, 100);
  return options;
}