{"version":3,"sources":["node_modules\\react-dom\\lib\\ReactDebugTool.js"],"names":["ReactInvalidSetStateWarningHook","require","ReactHostOperationHistoryHook","ReactComponentTreeHook","ExecutionEnvironment","performanceNow","warning","hooks","didHookThrowForEvent","callHook","event","fn","context","arg1","arg2","arg3","arg4","arg5","call","e","process","env","NODE_ENV","stack","emitEvent","i","length","hook","isProfiling","flushHistory","lifeCycleTimerStack","currentFlushNesting","currentFlushMeasurements","currentFlushStartTime","currentTimerDebugID","currentTimerStartTime","currentTimerNestedFlushDuration","currentTimerType","lifeCycleTimerHasWarned","clearHistory","purgeUnmountedComponents","getTreeSnapshot","registeredIDs","reduce","tree","id","ownerID","getOwnerID","parentID","getParentID","displayName","getDisplayName","text","getText","updateCount","getUpdateCount","childIDs","getChildIDs","resetMeasurements","previousStartTime","previousMeasurements","previousOperations","getHistory","getRegisteredIDs","push","duration","measurements","operations","treeSnapshot","checkDebugID","debugID","allowRoot","arguments","undefined","beginLifeCycleTimer","timerType","endLifeCycleTimer","instanceID","pauseCurrentLifeCycleTimer","currentTimer","startTime","nestedFlushStartTime","resumeCurrentLifeCycleTimer","_lifeCycleTimerStack$","pop","nestedFlushDuration","lastMarkTimeStamp","canUsePerformanceMeasure","performance","mark","clearMarks","measure","clearMeasures","shouldMark","element","getElement","isHostElement","type","markBegin","markType","markName","markEnd","timeStamp","measurementName","ReactDebugTool","addHook","removeHook","splice","beginProfiling","endProfiling","getFlushHistory","onBeginFlush","onEndFlush","onBeginLifeCycleTimer","onEndLifeCycleTimer","onBeginProcessingChildContext","onEndProcessingChildContext","onHostOperation","operation","onSetState","onSetChildren","childDebugIDs","forEach","onBeforeMountComponent","parentDebugID","onMountComponent","onBeforeUpdateComponent","onUpdateComponent","onBeforeUnmountComponent","onUnmountComponent","onTestEvent","addDevtool","removeDevtool","url","canUseDOM","window","location","href","test","module","exports"],"mappings":";;;;;;;;;;;AAWA;;AAEA,GAAIA,iCAAkCC,QAAQ,mCAAR,CAAtC;AACA,GAAIC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eAAeI,cAAf;AACD;;AAED+B,OAAOC,OAAP,CAAiBpC,cAAjB","file":"ReactDebugTool.js","sourceRoot":"d:/Work/Office/react-native-on-web/cli/tmpl/project","sourcesContent":["/**\n * Copyright 2016-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * \n */\n\n'use strict';\n\nvar ReactInvalidSetStateWarningHook = require('./ReactInvalidSetStateWarningHook');\nvar ReactHostOperationHistoryHook = require('./ReactHostOperationHistoryHook');\nvar ReactComponentTreeHook = require('react/lib/ReactComponentTreeHook');\nvar ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');\n\nvar performanceNow = require('fbjs/lib/performanceNow');\nvar warning = require('fbjs/lib/warning');\n\nvar hooks = [];\nvar didHookThrowForEvent = {};\n\nfunction callHook(event, fn, context, arg1, arg2, arg3, arg4, arg5) {\n  try {\n    fn.call(context, arg1, arg2, arg3, arg4, arg5);\n  } catch (e) {\n    process.env.NODE_ENV !== 'production' ? warning(didHookThrowForEvent[event], 'Exception thrown by hook while handling %s: %s', event, e + '\\n' + e.stack) : void 0;\n    didHookThrowForEvent[event] = true;\n  }\n}\n\nfunction emitEvent(event, arg1, arg2, arg3, arg4, arg5) {\n  for (var i = 0; i < hooks.length; i++) {\n    var hook = hooks[i];\n    var fn = hook[event];\n    if (fn) {\n      callHook(event, fn, hook, arg1, arg2, arg3, arg4, arg5);\n    }\n  }\n}\n\nvar isProfiling = false;\nvar flushHistory = [];\nvar lifeCycleTimerStack = [];\nvar currentFlushNesting = 0;\nvar currentFlushMeasurements = [];\nvar currentFlushStartTime = 0;\nvar currentTimerDebugID = null;\nvar currentTimerStartTime = 0;\nvar currentTimerNestedFlushDuration = 0;\nvar currentTimerType = null;\n\nvar lifeCycleTimerHasWarned = false;\n\nfunction clearHistory() {\n  ReactComponentTreeHook.purgeUnmountedComponents();\n  ReactHostOperationHistoryHook.clearHistory();\n}\n\nfunction getTreeSnapshot(registeredIDs) {\n  return registeredIDs.reduce(function (tree, id) {\n    var ownerID = ReactComponentTreeHook.getOwnerID(id);\n    var parentID = ReactComponentTreeHook.getParentID(id);\n    tree[id] = {\n      displayName: ReactComponentTreeHook.getDisplayName(id),\n      text: ReactComponentTreeHook.getText(id),\n      updateCount: ReactComponentTreeHook.getUpdateCount(id),\n      childIDs: ReactComponentTreeHook.getChildIDs(id),\n      // Text nodes don't have owners but this is close enough.\n      ownerID: ownerID || parentID && ReactComponentTreeHook.getOwnerID(parentID) || 0,\n      parentID: parentID\n    };\n    return tree;\n  }, {});\n}\n\nfunction resetMeasurements() {\n  var previousStartTime = currentFlushStartTime;\n  var previousMeasurements = currentFlushMeasurements;\n  var previousOperations = ReactHostOperationHistoryHook.getHistory();\n\n  if (currentFlushNesting === 0) {\n    currentFlushStartTime = 0;\n    currentFlushMeasurements = [];\n    clearHistory();\n    return;\n  }\n\n  if (previousMeasurements.length || previousOperations.length) {\n    var registeredIDs = ReactComponentTreeHook.getRegisteredIDs();\n    flushHistory.push({\n      duration: performanceNow() - previousStartTime,\n      measurements: previousMeasurements || [],\n      operations: previousOperations || [],\n      treeSnapshot: getTreeSnapshot(registeredIDs)\n    });\n  }\n\n  clearHistory();\n  currentFlushStartTime = performanceNow();\n  currentFlushMeasurements = [];\n}\n\nfunction checkDebugID(debugID) {\n  var allowRoot = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n  if (allowRoot && debugID === 0) {\n    return;\n  }\n  if (!debugID) {\n    process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDebugTool: debugID may not be empty.') : void 0;\n  }\n}\n\nfunction beginLifeCycleTimer(debugID, timerType) {\n  if (currentFlushNesting === 0) {\n    return;\n  }\n  if (currentTimerType && !lifeCycleTimerHasWarned) {\n    process.env.NODE_ENV !== 'production' ? warning(false, 'There is an internal error in the React performance measurement code. ' + 'Did not expect %s timer to start while %s timer is still in ' + 'progress for %s instance.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0;\n    lifeCycleTimerHasWarned = true;\n  }\n  currentTimerStartTime = performanceNow();\n  currentTimerNestedFlushDuration = 0;\n  currentTimerDebugID = debugID;\n  currentTimerType = timerType;\n}\n\nfunction endLifeCycleTimer(debugID, timerType) {\n  if (currentFlushNesting === 0) {\n    return;\n  }\n  if (currentTimerType !== timerType && !lifeCycleTimerHasWarned) {\n    process.env.NODE_ENV !== 'production' ? warning(false, 'There is an internal error in the React performance measurement code. ' + 'We did not expect %s timer to stop while %s timer is still in ' + 'progress for %s instance. Please report this as a bug in React.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0;\n    lifeCycleTimerHasWarned = true;\n  }\n  if (isProfiling) {\n    currentFlushMeasurements.push({\n      timerType: timerType,\n      instanceID: debugID,\n      duration: performanceNow() - currentTimerStartTime - currentTimerNestedFlushDuration\n    });\n  }\n  currentTimerStartTime = 0;\n  currentTimerNestedFlushDuration = 0;\n  currentTimerDebugID = null;\n  currentTimerType = null;\n}\n\nfunction pauseCurrentLifeCycleTimer() {\n  var currentTimer = {\n    startTime: currentTimerStartTime,\n    nestedFlushStartTime: performanceNow(),\n    debugID: currentTimerDebugID,\n    timerType: currentTimerType\n  };\n  lifeCycleTimerStack.push(currentTimer);\n  currentTimerStartTime = 0;\n  currentTimerNestedFlushDuration = 0;\n  currentTimerDebugID = null;\n  currentTimerType = null;\n}\n\nfunction resumeCurrentLifeCycleTimer() {\n  var _lifeCycleTimerStack$ = lifeCycleTimerStack.pop(),\n      startTime = _lifeCycleTimerStack$.startTime,\n      nestedFlushStartTime = _lifeCycleTimerStack$.nestedFlushStartTime,\n      debugID = _lifeCycleTimerStack$.debugID,\n      timerType = _lifeCycleTimerStack$.timerType;\n\n  var nestedFlushDuration = performanceNow() - nestedFlushStartTime;\n  currentTimerStartTime = startTime;\n  currentTimerNestedFlushDuration += nestedFlushDuration;\n  currentTimerDebugID = debugID;\n  currentTimerType = timerType;\n}\n\nvar lastMarkTimeStamp = 0;\nvar canUsePerformanceMeasure = typeof performance !== 'undefined' && typeof performance.mark === 'function' && typeof performance.clearMarks === 'function' && typeof performance.measure === 'function' && typeof performance.clearMeasures === 'function';\n\nfunction shouldMark(debugID) {\n  if (!isProfiling || !canUsePerformanceMeasure) {\n    return false;\n  }\n  var element = ReactComponentTreeHook.getElement(debugID);\n  if (element == null || typeof element !== 'object') {\n    return false;\n  }\n  var isHostElement = typeof element.type === 'string';\n  if (isHostElement) {\n    return false;\n  }\n  return true;\n}\n\nfunction markBegin(debugID, markType) {\n  if (!shouldMark(debugID)) {\n    return;\n  }\n\n  var markName = debugID + '::' + markType;\n  lastMarkTimeStamp = performanceNow();\n  performance.mark(markName);\n}\n\nfunction markEnd(debugID, markType) {\n  if (!shouldMark(debugID)) {\n    return;\n  }\n\n  var markName = debugID + '::' + markType;\n  var displayName = ReactComponentTreeHook.getDisplayName(debugID) || 'Unknown';\n\n  // Chrome has an issue of dropping markers recorded too fast:\n  // https://bugs.chromium.org/p/chromium/issues/detail?id=640652\n  // To work around this, we will not report very small measurements.\n  // I determined the magic number by tweaking it back and forth.\n  // 0.05ms was enough to prevent the issue, but I set it to 0.1ms to be safe.\n  // When the bug is fixed, we can `measure()` unconditionally if we want to.\n  var timeStamp = performanceNow();\n  if (timeStamp - lastMarkTimeStamp > 0.1) {\n    var measurementName = displayName + ' [' + markType + ']';\n    performance.measure(measurementName, markName);\n  }\n\n  performance.clearMarks(markName);\n  if (measurementName) {\n    performance.clearMeasures(measurementName);\n  }\n}\n\nvar ReactDebugTool = {\n  addHook: function (hook) {\n    hooks.push(hook);\n  },\n  removeHook: function (hook) {\n    for (var i = 0; i < hooks.length; i++) {\n      if (hooks[i] === hook) {\n        hooks.splice(i, 1);\n        i--;\n      }\n    }\n  },\n  isProfiling: function () {\n    return isProfiling;\n  },\n  beginProfiling: function () {\n    if (isProfiling) {\n      return;\n    }\n\n    isProfiling = true;\n    flushHistory.length = 0;\n    resetMeasurements();\n    ReactDebugTool.addHook(ReactHostOperationHistoryHook);\n  },\n  endProfiling: function () {\n    if (!isProfiling) {\n      return;\n    }\n\n    isProfiling = false;\n    resetMeasurements();\n    ReactDebugTool.removeHook(ReactHostOperationHistoryHook);\n  },\n  getFlushHistory: function () {\n    return flushHistory;\n  },\n  onBeginFlush: function () {\n    currentFlushNesting++;\n    resetMeasurements();\n    pauseCurrentLifeCycleTimer();\n    emitEvent('onBeginFlush');\n  },\n  onEndFlush: function () {\n    resetMeasurements();\n    currentFlushNesting--;\n    resumeCurrentLifeCycleTimer();\n    emitEvent('onEndFlush');\n  },\n  onBeginLifeCycleTimer: function (debugID, timerType) {\n    checkDebugID(debugID);\n    emitEvent('onBeginLifeCycleTimer', debugID, timerType);\n    markBegin(debugID, timerType);\n    beginLifeCycleTimer(debugID, timerType);\n  },\n  onEndLifeCycleTimer: function (debugID, timerType) {\n    checkDebugID(debugID);\n    endLifeCycleTimer(debugID, timerType);\n    markEnd(debugID, timerType);\n    emitEvent('onEndLifeCycleTimer', debugID, timerType);\n  },\n  onBeginProcessingChildContext: function () {\n    emitEvent('onBeginProcessingChildContext');\n  },\n  onEndProcessingChildContext: function () {\n    emitEvent('onEndProcessingChildContext');\n  },\n  onHostOperation: function (operation) {\n    checkDebugID(operation.instanceID);\n    emitEvent('onHostOperation', operation);\n  },\n  onSetState: function () {\n    emitEvent('onSetState');\n  },\n  onSetChildren: function (debugID, childDebugIDs) {\n    checkDebugID(debugID);\n    childDebugIDs.forEach(checkDebugID);\n    emitEvent('onSetChildren', debugID, childDebugIDs);\n  },\n  onBeforeMountComponent: function (debugID, element, parentDebugID) {\n    checkDebugID(debugID);\n    checkDebugID(parentDebugID, true);\n    emitEvent('onBeforeMountComponent', debugID, element, parentDebugID);\n    markBegin(debugID, 'mount');\n  },\n  onMountComponent: function (debugID) {\n    checkDebugID(debugID);\n    markEnd(debugID, 'mount');\n    emitEvent('onMountComponent', debugID);\n  },\n  onBeforeUpdateComponent: function (debugID, element) {\n    checkDebugID(debugID);\n    emitEvent('onBeforeUpdateComponent', debugID, element);\n    markBegin(debugID, 'update');\n  },\n  onUpdateComponent: function (debugID) {\n    checkDebugID(debugID);\n    markEnd(debugID, 'update');\n    emitEvent('onUpdateComponent', debugID);\n  },\n  onBeforeUnmountComponent: function (debugID) {\n    checkDebugID(debugID);\n    emitEvent('onBeforeUnmountComponent', debugID);\n    markBegin(debugID, 'unmount');\n  },\n  onUnmountComponent: function (debugID) {\n    checkDebugID(debugID);\n    markEnd(debugID, 'unmount');\n    emitEvent('onUnmountComponent', debugID);\n  },\n  onTestEvent: function () {\n    emitEvent('onTestEvent');\n  }\n};\n\n// TODO remove these when RN/www gets updated\nReactDebugTool.addDevtool = ReactDebugTool.addHook;\nReactDebugTool.removeDevtool = ReactDebugTool.removeHook;\n\nReactDebugTool.addHook(ReactInvalidSetStateWarningHook);\nReactDebugTool.addHook(ReactComponentTreeHook);\nvar url = ExecutionEnvironment.canUseDOM && window.location.href || '';\nif (/[?&]react_perf\\b/.test(url)) {\n  ReactDebugTool.beginProfiling();\n}\n\nmodule.exports = ReactDebugTool;"]}