(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("devtools/client/shared/vendor/react"), require("Services"), require("devtools/shared/flags"), require("devtools/client/sourceeditor/editor"));
else if(typeof define === 'function' && define.amd)
define(["devtools/client/shared/vendor/react", "Services", "devtools/shared/flags", "devtools/client/sourceeditor/editor"], factory);
else {
var a = typeof exports === 'object' ? factory(require("devtools/client/shared/vendor/react"), require("Services"), require("devtools/shared/flags"), require("devtools/client/sourceeditor/editor")) : factory(root["devtools/client/shared/vendor/react"], root["Services"], root["devtools/shared/flags"], root["devtools/client/sourceeditor/editor"]);
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
}
})(this, function(__WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_29__, __WEBPACK_EXTERNAL_MODULE_121__, __WEBPACK_EXTERNAL_MODULE_994__) {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "/assets/build";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(1);
/***/ },
/* 1 */
/***/ function(module, exports, __webpack_require__) {
"use strict";
var React = __webpack_require__(2);
var ReactDOM = __webpack_require__(22);
//
// if (process.env.NODE_ENV !== "production") {
// const Perf = require("react-addons-perf");
// window.Perf = Perf;
// }
var _require = __webpack_require__(131),
bootstrap = _require.bootstrap,
L10N = _require.L10N,
unmountRoot = _require.unmountRoot;
var _require2 = __webpack_require__(828),
isFirefoxPanel = _require2.isFirefoxPanel;
var _require3 = __webpack_require__(888),
onConnect = _require3.onConnect;
var _require4 = __webpack_require__(897),
teardownWorkers = _require4.teardownWorkers;
if (isFirefoxPanel()) {
module.exports = {
bootstrap: (_ref) => {
var threadClient = _ref.threadClient,
tabTarget = _ref.tabTarget,
debuggerClient = _ref.debuggerClient,
sourceMaps = _ref.sourceMaps;
return onConnect({
tab: { clientType: "firefox" },
tabConnection: {
tabTarget,
threadClient,
debuggerClient
}
}, {
sourceMaps
});
},
destroy: () => {
unmountRoot(ReactDOM);
teardownWorkers();
}
};
} else {
window.L10N = L10N;
// $FlowIgnore:
window.L10N.setBundle(__webpack_require__(960));
bootstrap(React, ReactDOM).then(connection => {
onConnect(connection, {
sourceMaps: __webpack_require__(898)
});
});
}
/***/ },
/* 2 */
/***/ function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_2__;
/***/ },
/* 3 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.compose = exports.applyMiddleware = exports.bindActionCreators = exports.combineReducers = exports.createStore = undefined;
var _createStore = __webpack_require__(4);
var _createStore2 = _interopRequireDefault(_createStore);
var _combineReducers = __webpack_require__(17);
var _combineReducers2 = _interopRequireDefault(_combineReducers);
var _bindActionCreators = __webpack_require__(19);
var _bindActionCreators2 = _interopRequireDefault(_bindActionCreators);
var _applyMiddleware = __webpack_require__(20);
var _applyMiddleware2 = _interopRequireDefault(_applyMiddleware);
var _compose = __webpack_require__(21);
var _compose2 = _interopRequireDefault(_compose);
var _warning = __webpack_require__(18);
var _warning2 = _interopRequireDefault(_warning);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
/*
* This is a dummy function to check if the function name has been altered by minification.
* If the function has been minified and NODE_ENV !== 'production', warn the user.
*/
function isCrushed() {}
if (false) {
(0, _warning2["default"])('You are currently using minified code outside of NODE_ENV === \'production\'. ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) ' + 'to ensure you have the correct code for your production build.');
}
exports.createStore = _createStore2["default"];
exports.combineReducers = _combineReducers2["default"];
exports.bindActionCreators = _bindActionCreators2["default"];
exports.applyMiddleware = _applyMiddleware2["default"];
exports.compose = _compose2["default"];
/***/ },
/* 4 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.ActionTypes = undefined;
exports["default"] = createStore;
var _isPlainObject = __webpack_require__(5);
var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
var _symbolObservable = __webpack_require__(15);
var _symbolObservable2 = _interopRequireDefault(_symbolObservable);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
/**
* These are private action types reserved by Redux.
* For any unknown actions, you must return the current state.
* If the current state is undefined, you must return the initial state.
* Do not reference these action types directly in your code.
*/
var ActionTypes = exports.ActionTypes = {
INIT: '@@redux/INIT'
};
/**
* Creates a Redux store that holds the state tree.
* The only way to change the data in the store is to call `dispatch()` on it.
*
* There should only be a single store in your app. To specify how different
* parts of the state tree respond to actions, you may combine several reducers
* into a single reducer function by using `combineReducers`.
*
* @param {Function} reducer A function that returns the next state tree, given
* the current state tree and the action to handle.
*
* @param {any} [initialState] The initial state. You may optionally specify it
* to hydrate the state from the server in universal apps, or to restore a
* previously serialized user session.
* If you use `combineReducers` to produce the root reducer function, this must be
* an object with the same shape as `combineReducers` keys.
*
* @param {Function} enhancer The store enhancer. You may optionally specify it
* to enhance the store with third-party capabilities such as middleware,
* time travel, persistence, etc. The only store enhancer that ships with Redux
* is `applyMiddleware()`.
*
* @returns {Store} A Redux store that lets you read the state, dispatch actions
* and subscribe to changes.
*/
function createStore(reducer, initialState, enhancer) {
var _ref2;
if (typeof initialState === 'function' && typeof enhancer === 'undefined') {
enhancer = initialState;
initialState = undefined;
}
if (typeof enhancer !== 'undefined') {
if (typeof enhancer !== 'function') {
throw new Error('Expected the enhancer to be a function.');
}
return enhancer(createStore)(reducer, initialState);
}
if (typeof reducer !== 'function') {
throw new Error('Expected the reducer to be a function.');
}
var currentReducer = reducer;
var currentState = initialState;
var currentListeners = [];
var nextListeners = currentListeners;
var isDispatching = false;
function ensureCanMutateNextListeners() {
if (nextListeners === currentListeners) {
nextListeners = currentListeners.slice();
}
}
/**
* Reads the state tree managed by the store.
*
* @returns {any} The current state tree of your application.
*/
function getState() {
return currentState;
}
/**
* Adds a change listener. It will be called any time an action is dispatched,
* and some part of the state tree may potentially have changed. You may then
* call `getState()` to read the current state tree inside the callback.
*
* You may call `dispatch()` from a change listener, with the following
* caveats:
*
* 1. The subscriptions are snapshotted just before every `dispatch()` call.
* If you subscribe or unsubscribe while the listeners are being invoked, this
* will not have any effect on the `dispatch()` that is currently in progress.
* However, the next `dispatch()` call, whether nested or not, will use a more
* recent snapshot of the subscription list.
*
* 2. The listener should not expect to see all state changes, as the state
* might have been updated multiple times during a nested `dispatch()` before
* the listener is called. It is, however, guaranteed that all subscribers
* registered before the `dispatch()` started will be called with the latest
* state by the time it exits.
*
* @param {Function} listener A callback to be invoked on every dispatch.
* @returns {Function} A function to remove this change listener.
*/
function subscribe(listener) {
if (typeof listener !== 'function') {
throw new Error('Expected listener to be a function.');
}
var isSubscribed = true;
ensureCanMutateNextListeners();
nextListeners.push(listener);
return function unsubscribe() {
if (!isSubscribed) {
return;
}
isSubscribed = false;
ensureCanMutateNextListeners();
var index = nextListeners.indexOf(listener);
nextListeners.splice(index, 1);
};
}
/**
* Dispatches an action. It is the only way to trigger a state change.
*
* The `reducer` function, used to create the store, will be called with the
* current state tree and the given `action`. Its return value will
* be considered the **next** state of the tree, and the change listeners
* will be notified.
*
* The base implementation only supports plain object actions. If you want to
* dispatch a Promise, an Observable, a thunk, or something else, you need to
* wrap your store creating function into the corresponding middleware. For
* example, see the documentation for the `redux-thunk` package. Even the
* middleware will eventually dispatch plain object actions using this method.
*
* @param {Object} action A plain object representing “what changed”. It is
* a good idea to keep actions serializable so you can record and replay user
* sessions, or use the time travelling `redux-devtools`. An action must have
* a `type` property which may not be `undefined`. It is a good idea to use
* string constants for action types.
*
* @returns {Object} For convenience, the same action object you dispatched.
*
* Note that, if you use a custom middleware, it may wrap `dispatch()` to
* return something else (for example, a Promise you can await).
*/
function dispatch(action) {
if (!(0, _isPlainObject2["default"])(action)) {
throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');
}
if (typeof action.type === 'undefined') {
throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?');
}
if (isDispatching) {
throw new Error('Reducers may not dispatch actions.');
}
try {
isDispatching = true;
currentState = currentReducer(currentState, action);
} finally {
isDispatching = false;
}
var listeners = currentListeners = nextListeners;
for (var i = 0; i < listeners.length; i++) {
listeners[i]();
}
return action;
}
/**
* Replaces the reducer currently used by the store to calculate the state.
*
* You might need this if your app implements code splitting and you want to
* load some of the reducers dynamically. You might also need this if you
* implement a hot reloading mechanism for Redux.
*
* @param {Function} nextReducer The reducer for the store to use instead.
* @returns {void}
*/
function replaceReducer(nextReducer) {
if (typeof nextReducer !== 'function') {
throw new Error('Expected the nextReducer to be a function.');
}
currentReducer = nextReducer;
dispatch({ type: ActionTypes.INIT });
}
/**
* Interoperability point for observable/reactive libraries.
* @returns {observable} A minimal observable of state changes.
* For more information, see the observable proposal:
* https://github.com/zenparsing/es-observable
*/
function observable() {
var _ref;
var outerSubscribe = subscribe;
return _ref = {
/**
* The minimal observable subscription method.
* @param {Object} observer Any object that can be used as an observer.
* The observer object should have a `next` method.
* @returns {subscription} An object with an `unsubscribe` method that can
* be used to unsubscribe the observable from the store, and prevent further
* emission of values from the observable.
*/
subscribe: function subscribe(observer) {
if (typeof observer !== 'object') {
throw new TypeError('Expected the observer to be an object.');
}
function observeState() {
if (observer.next) {
observer.next(getState());
}
}
observeState();
var unsubscribe = outerSubscribe(observeState);
return { unsubscribe: unsubscribe };
}
}, _ref[_symbolObservable2["default"]] = function () {
return this;
}, _ref;
}
// When a store is created, an "INIT" action is dispatched so that every
// reducer returns their initial state. This effectively populates
// the initial state tree.
dispatch({ type: ActionTypes.INIT });
return _ref2 = {
dispatch: dispatch,
subscribe: subscribe,
getState: getState,
replaceReducer: replaceReducer
}, _ref2[_symbolObservable2["default"]] = observable, _ref2;
}
/***/ },
/* 5 */
/***/ function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(6),
getPrototype = __webpack_require__(12),
isObjectLike = __webpack_require__(14);
/** `Object#toString` result references. */
var objectTag = '[object Object]';
/** Used for built-in method references. */
var funcProto = Function.prototype,
objectProto = Object.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Used to infer the `Object` constructor. */
var objectCtorString = funcToString.call(Object);
/**
* Checks if `value` is a plain object, that is, an object created by the
* `Object` constructor or one with a `[[Prototype]]` of `null`.
*
* @static
* @memberOf _
* @since 0.8.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
* @example
*
* function Foo() {
* this.a = 1;
* }
*
* _.isPlainObject(new Foo);
* // => false
*
* _.isPlainObject([1, 2, 3]);
* // => false
*
* _.isPlainObject({ 'x': 0, 'y': 0 });
* // => true
*
* _.isPlainObject(Object.create(null));
* // => true
*/
function isPlainObject(value) {
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
return false;
}
var proto = getPrototype(value);
if (proto === null) {
return true;
}
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
return typeof Ctor == 'function' && Ctor instanceof Ctor &&
funcToString.call(Ctor) == objectCtorString;
}
module.exports = isPlainObject;
/***/ },
/* 6 */
/***/ function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(7),
getRawTag = __webpack_require__(10),
objectToString = __webpack_require__(11);
/** `Object#toString` result references. */
var nullTag = '[object Null]',
undefinedTag = '[object Undefined]';
/** Built-in value references. */
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
/**
* The base implementation of `getTag` without fallbacks for buggy environments.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the `toStringTag`.
*/
function baseGetTag(value) {
if (value == null) {
return value === undefined ? undefinedTag : nullTag;
}
return (symToStringTag && symToStringTag in Object(value))
? getRawTag(value)
: objectToString(value);
}
module.exports = baseGetTag;
/***/ },
/* 7 */
/***/ function(module, exports, __webpack_require__) {
var root = __webpack_require__(8);
/** Built-in value references. */
var Symbol = root.Symbol;
module.exports = Symbol;
/***/ },
/* 8 */
/***/ function(module, exports, __webpack_require__) {
var freeGlobal = __webpack_require__(9);
/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();
module.exports = root;
/***/ },
/* 9 */
/***/ function(module, exports) {
/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
module.exports = freeGlobal;
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ },
/* 10 */
/***/ function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(7);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString = objectProto.toString;
/** Built-in value references. */
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
/**
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the raw `toStringTag`.
*/
function getRawTag(value) {
var isOwn = hasOwnProperty.call(value, symToStringTag),
tag = value[symToStringTag];
try {
value[symToStringTag] = undefined;
var unmasked = true;
} catch (e) {}
var result = nativeObjectToString.call(value);
if (unmasked) {
if (isOwn) {
value[symToStringTag] = tag;
} else {
delete value[symToStringTag];
}
}
return result;
}
module.exports = getRawTag;
/***/ },
/* 11 */
/***/ function(module, exports) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString = objectProto.toString;
/**
* Converts `value` to a string using `Object.prototype.toString`.
*
* @private
* @param {*} value The value to convert.
* @returns {string} Returns the converted string.
*/
function objectToString(value) {
return nativeObjectToString.call(value);
}
module.exports = objectToString;
/***/ },
/* 12 */
/***/ function(module, exports, __webpack_require__) {
var overArg = __webpack_require__(13);
/** Built-in value references. */
var getPrototype = overArg(Object.getPrototypeOf, Object);
module.exports = getPrototype;
/***/ },
/* 13 */
/***/ function(module, exports) {
/**
* Creates a unary function that invokes `func` with its argument transformed.
*
* @private
* @param {Function} func The function to wrap.
* @param {Function} transform The argument transform.
* @returns {Function} Returns the new function.
*/
function overArg(func, transform) {
return function(arg) {
return func(transform(arg));
};
}
module.exports = overArg;
/***/ },
/* 14 */
/***/ function(module, exports) {
/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
return value != null && typeof value == 'object';
}
module.exports = isObjectLike;
/***/ },
/* 15 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {/* global window */
'use strict';
module.exports = __webpack_require__(16)(global || window || this);
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ },
/* 16 */
/***/ function(module, exports) {
'use strict';
module.exports = function symbolObservablePonyfill(root) {
var result;
var Symbol = root.Symbol;
if (typeof Symbol === 'function') {
if (Symbol.observable) {
result = Symbol.observable;
} else {
result = Symbol('observable');
Symbol.observable = result;
}
} else {
result = '@@observable';
}
return result;
};
/***/ },
/* 17 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports["default"] = combineReducers;
var _createStore = __webpack_require__(4);
var _isPlainObject = __webpack_require__(5);
var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
var _warning = __webpack_require__(18);
var _warning2 = _interopRequireDefault(_warning);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function getUndefinedStateErrorMessage(key, action) {
var actionType = action && action.type;
var actionName = actionType && '"' + actionType.toString() + '"' || 'an action';
return 'Given action ' + actionName + ', reducer "' + key + '" returned undefined. ' + 'To ignore an action, you must explicitly return the previous state.';
}
function getUnexpectedStateShapeWarningMessage(inputState, reducers, action) {
var reducerKeys = Object.keys(reducers);
var argumentName = action && action.type === _createStore.ActionTypes.INIT ? 'initialState argument passed to createStore' : 'previous state received by the reducer';
if (reducerKeys.length === 0) {
return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
}
if (!(0, _isPlainObject2["default"])(inputState)) {
return 'The ' + argumentName + ' has unexpected type of "' + {}.toString.call(inputState).match(/\s([a-z|A-Z]+)/)[1] + '". Expected argument to be an object with the following ' + ('keys: "' + reducerKeys.join('", "') + '"');
}
var unexpectedKeys = Object.keys(inputState).filter(function (key) {
return !reducers.hasOwnProperty(key);
});
if (unexpectedKeys.length > 0) {
return 'Unexpected ' + (unexpectedKeys.length > 1 ? 'keys' : 'key') + ' ' + ('"' + unexpectedKeys.join('", "') + '" found in ' + argumentName + '. ') + 'Expected to find one of the known reducer keys instead: ' + ('"' + reducerKeys.join('", "') + '". Unexpected keys will be ignored.');
}
}
function assertReducerSanity(reducers) {
Object.keys(reducers).forEach(function (key) {
var reducer = reducers[key];
var initialState = reducer(undefined, { type: _createStore.ActionTypes.INIT });
if (typeof initialState === 'undefined') {
throw new Error('Reducer "' + key + '" returned undefined during initialization. ' + 'If the state passed to the reducer is undefined, you must ' + 'explicitly return the initial state. The initial state may ' + 'not be undefined.');
}
var type = '@@redux/PROBE_UNKNOWN_ACTION_' + Math.random().toString(36).substring(7).split('').join('.');
if (typeof reducer(undefined, { type: type }) === 'undefined') {
throw new Error('Reducer "' + key + '" returned undefined when probed with a random type. ' + ('Don\'t try to handle ' + _createStore.ActionTypes.INIT + ' or other actions in "redux/*" ') + 'namespace. They are considered private. Instead, you must return the ' + 'current state for any unknown actions, unless it is undefined, ' + 'in which case you must return the initial state, regardless of the ' + 'action type. The initial state may not be undefined.');
}
});
}
/**
* Turns an object whose values are different reducer functions, into a single
* reducer function. It will call every child reducer, and gather their results
* into a single state object, whose keys correspond to the keys of the passed
* reducer functions.
*
* @param {Object} reducers An object whose values correspond to different
* reducer functions that need to be combined into one. One handy way to obtain
* it is to use ES6 `import * as reducers` syntax. The reducers may never return
* undefined for any action. Instead, they should return their initial state
* if the state passed to them was undefined, and the current state for any
* unrecognized action.
*
* @returns {Function} A reducer function that invokes every reducer inside the
* passed object, and builds a state object with the same shape.
*/
function combineReducers(reducers) {
var reducerKeys = Object.keys(reducers);
var finalReducers = {};
for (var i = 0; i < reducerKeys.length; i++) {
var key = reducerKeys[i];
if (typeof reducers[key] === 'function') {
finalReducers[key] = reducers[key];
}
}
var finalReducerKeys = Object.keys(finalReducers);
var sanityError;
try {
assertReducerSanity(finalReducers);
} catch (e) {
sanityError = e;
}
return function combination() {
var state = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
var action = arguments[1];
if (sanityError) {
throw sanityError;
}
if (false) {
var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action);
if (warningMessage) {
(0, _warning2["default"])(warningMessage);
}
}
var hasChanged = false;
var nextState = {};
for (var i = 0; i < finalReducerKeys.length; i++) {
var key = finalReducerKeys[i];
var reducer = finalReducers[key];
var previousStateForKey = state[key];
var nextStateForKey = reducer(previousStateForKey, action);
if (typeof nextStateForKey === 'undefined') {
var errorMessage = getUndefinedStateErrorMessage(key, action);
throw new Error(errorMessage);
}
nextState[key] = nextStateForKey;
hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
}
return hasChanged ? nextState : state;
};
}
/***/ },
/* 18 */
/***/ function(module, exports) {
'use strict';
exports.__esModule = true;
exports["default"] = warning;
/**
* Prints a warning in the console if it exists.
*
* @param {String} message The warning message.
* @returns {void}
*/
function warning(message) {
/* eslint-disable no-console */
if (typeof console !== 'undefined' && typeof console.error === 'function') {
console.error(message);
}
/* eslint-enable no-console */
try {
// This error was thrown as a convenience so that if you enable
// "break on all exceptions" in your console,
// it would pause the execution at this line.
throw new Error(message);
/* eslint-disable no-empty */
} catch (e) {}
/* eslint-enable no-empty */
}
/***/ },
/* 19 */
/***/ function(module, exports) {
'use strict';
exports.__esModule = true;
exports["default"] = bindActionCreators;
function bindActionCreator(actionCreator, dispatch) {
return function () {
return dispatch(actionCreator.apply(undefined, arguments));
};
}
/**
* Turns an object whose values are action creators, into an object with the
* same keys, but with every function wrapped into a `dispatch` call so they
* may be invoked directly. This is just a convenience method, as you can call
* `store.dispatch(MyActionCreators.doSomething())` yourself just fine.
*
* For convenience, you can also pass a single function as the first argument,
* and get a function in return.
*
* @param {Function|Object} actionCreators An object whose values are action
* creator functions. One handy way to obtain it is to use ES6 `import * as`
* syntax. You may also pass a single function.
*
* @param {Function} dispatch The `dispatch` function available on your Redux
* store.
*
* @returns {Function|Object} The object mimicking the original object, but with
* every action creator wrapped into the `dispatch` call. If you passed a
* function as `actionCreators`, the return value will also be a single
* function.
*/
function bindActionCreators(actionCreators, dispatch) {
if (typeof actionCreators === 'function') {
return bindActionCreator(actionCreators, dispatch);
}
if (typeof actionCreators !== 'object' || actionCreators === null) {
throw new Error('bindActionCreators expected an object or a function, instead received ' + (actionCreators === null ? 'null' : typeof actionCreators) + '. ' + 'Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');
}
var keys = Object.keys(actionCreators);
var boundActionCreators = {};
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
var actionCreator = actionCreators[key];
if (typeof actionCreator === 'function') {
boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
}
}
return boundActionCreators;
}
/***/ },
/* 20 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
exports["default"] = applyMiddleware;
var _compose = __webpack_require__(21);
var _compose2 = _interopRequireDefault(_compose);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
/**
* Creates a store enhancer that applies middleware to the dispatch method
* of the Redux store. This is handy for a variety of tasks, such as expressing
* asynchronous actions in a concise manner, or logging every action payload.
*
* See `redux-thunk` package as an example of the Redux middleware.
*
* Because middleware is potentially asynchronous, this should be the first
* store enhancer in the composition chain.
*
* Note that each middleware will be given the `dispatch` and `getState` functions
* as named arguments.
*
* @param {...Function} middlewares The middleware chain to be applied.
* @returns {Function} A store enhancer applying the middleware.
*/
function applyMiddleware() {
for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) {
middlewares[_key] = arguments[_key];
}
return function (createStore) {
return function (reducer, initialState, enhancer) {
var store = createStore(reducer, initialState, enhancer);
var _dispatch = store.dispatch;
var chain = [];
var middlewareAPI = {
getState: store.getState,
dispatch: function dispatch(action) {
return _dispatch(action);
}
};
chain = middlewares.map(function (middleware) {
return middleware(middlewareAPI);
});
_dispatch = _compose2["default"].apply(undefined, chain)(store.dispatch);
return _extends({}, store, {
dispatch: _dispatch
});
};
};
}
/***/ },
/* 21 */
/***/ function(module, exports) {
"use strict";
exports.__esModule = true;
exports["default"] = compose;
/**
* Composes single-argument functions from right to left. The rightmost
* function can take multiple arguments as it provides the signature for
* the resulting composite function.
*
* @param {...Function} funcs The functions to compose.
* @returns {Function} A function obtained by composing the argument functions
* from right to left. For example, compose(f, g, h) is identical to doing
* (...args) => f(g(h(...args))).
*/
function compose() {
for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {
funcs[_key] = arguments[_key];
}
if (funcs.length === 0) {
return function (arg) {
return arg;
};
} else {
var _ret = function () {
var last = funcs[funcs.length - 1];
var rest = funcs.slice(0, -1);
return {
v: function v() {
return rest.reduceRight(function (composed, f) {
return f(composed);
}, last.apply(undefined, arguments));
}
};
}();
if (typeof _ret === "object") return _ret.v;
}
}
/***/ },
/* 22 */
/***/ function(module, exports, __webpack_require__) {
/**
* ReactDOM v15.3.2
*
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
// Based off https://github.com/ForbesLindesay/umd/blob/master/template.js
;(function(f) {
// CommonJS
if (true) {
module.exports = f(__webpack_require__(2));
// RequireJS
} else if (typeof define === "function" && define.amd) {
define(['react'], f);
// "
/***/ },
/* 997 */
/***/ function(module, exports) {
module.exports = ""
/***/ },
/* 998 */
/***/ function(module, exports) {
module.exports = ""
/***/ },
/* 999 */
/***/ function(module, exports) {
module.exports = ""
/***/ },
/* 1000 */
/***/ function(module, exports, __webpack_require__) {
"use strict";
var Tree = __webpack_require__(1001);
module.exports = {
Tree
};
/***/ },
/* 1001 */
/***/ function(module, exports, __webpack_require__) {
"use strict";
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
var _require = __webpack_require__(2),
dom = _require.DOM,
createClass = _require.createClass,
createFactory = _require.createFactory,
PropTypes = _require.PropTypes;
var AUTO_EXPAND_DEPTH = 0; // depth
/**
* An arrow that displays whether its node is expanded (▼) or collapsed
* (▶). When its node has no children, it is hidden.
*/
var ArrowExpander = createFactory(createClass({
displayName: "ArrowExpander",
shouldComponentUpdate(nextProps, nextState) {
return this.props.item !== nextProps.item || this.props.visible !== nextProps.visible || this.props.expanded !== nextProps.expanded;
},
render() {
var attrs = {
className: "arrow theme-twisty",
onClick: this.props.expanded ? () => this.props.onCollapse(this.props.item) : e => this.props.onExpand(this.props.item, e.altKey)
};
if (this.props.expanded) {
attrs.className += " open";
}
if (!this.props.visible) {
attrs.style = Object.assign({}, this.props.style || {}, {
visibility: "hidden"
});
}
return dom.div(attrs, this.props.children);
}
}));
var TreeNode = createFactory(createClass({
displayName: "TreeNode",
componentDidMount() {
if (this.props.focused) {
this.refs.button.focus();
}
},
componentDidUpdate() {
if (this.props.focused) {
this.refs.button.focus();
}
},
shouldComponentUpdate(nextProps) {
return this.props.item !== nextProps.item || this.props.focused !== nextProps.focused || this.props.expanded !== nextProps.expanded;
},
render() {
var arrow = ArrowExpander({
item: this.props.item,
expanded: this.props.expanded,
visible: this.props.hasChildren,
onExpand: this.props.onExpand,
onCollapse: this.props.onCollapse
});
var isOddRow = this.props.index % 2;
return dom.div({
className: `tree-node div ${isOddRow ? "tree-node-odd" : ""}`,
onFocus: this.props.onFocus,
onClick: this.props.onFocus,
onBlur: this.props.onBlur,
style: {
padding: 0,
margin: 0
}
}, this.props.renderItem(this.props.item, this.props.depth, this.props.focused, arrow, this.props.expanded),
// XXX: OSX won't focus/blur regular elements even if you set tabindex
// unless there is an input/button child.
dom.button(this._buttonAttrs));
},
_buttonAttrs: {
ref: "button",
style: {
opacity: 0,
width: "0 !important",
height: "0 !important",
padding: "0 !important",
outline: "none",
MozAppearance: "none",
// XXX: Despite resetting all of the above properties (and margin), the
// button still ends up with ~79px width, so we set a large negative
// margin to completely hide it.
MozMarginStart: "-1000px !important"
}
}
}));
/**
* Create a function that calls the given function `fn` only once per animation
* frame.
*
* @param {Function} fn
* @returns {Function}
*/
function oncePerAnimationFrame(fn) {
var animationId = null;
var argsToPass = null;
return function () {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
argsToPass = args;
if (animationId !== null) {
return;
}
animationId = requestAnimationFrame(() => {
fn.call.apply(fn, [this].concat(_toConsumableArray(argsToPass)));
animationId = null;
argsToPass = null;
});
};
}
var NUMBER_OF_OFFSCREEN_ITEMS = 1;
/**
* A generic tree component. See propTypes for the public API.
*
* @see `devtools/client/memory/components/test/mochitest/head.js` for usage
* @see `devtools/client/memory/components/heap.js` for usage
*/
var Tree = module.exports = createClass({
displayName: "Tree",
propTypes: {
// Required props
// A function to get an item's parent, or null if it is a root.
getParent: PropTypes.func.isRequired,
// A function to get an item's children.
getChildren: PropTypes.func.isRequired,
// A function which takes an item and ArrowExpander and returns a
// component.
renderItem: PropTypes.func.isRequired,
// A function which returns the roots of the tree (forest).
getRoots: PropTypes.func.isRequired,
// A function to get a unique key for the given item.
getKey: PropTypes.func.isRequired,
// A function to get whether an item is expanded or not. If an item is not
// expanded, then it must be collapsed.
isExpanded: PropTypes.func.isRequired,
// The height of an item in the tree including margin and padding, in
// pixels.
itemHeight: PropTypes.number.isRequired,
// Optional props
// The currently focused item, if any such item exists.
focused: PropTypes.any,
// Handle when a new item is focused.
onFocus: PropTypes.func,
// The depth to which we should automatically expand new items.
autoExpandDepth: PropTypes.number,
// Should auto expand all new items or just the new items under the first
// root item.
autoExpandAll: PropTypes.bool,
// Optional event handlers for when items are expanded or collapsed.
onExpand: PropTypes.func,
onCollapse: PropTypes.func
},
getDefaultProps() {
return {
autoExpandDepth: AUTO_EXPAND_DEPTH,
autoExpandAll: true
};
},
getInitialState() {
return {
scroll: 0,
height: window.innerHeight,
seen: new Set()
};
},
componentDidMount() {
window.addEventListener("resize", this._updateHeight);
this._autoExpand(this.props);
this._updateHeight();
},
componentWillUnmount() {
window.removeEventListener("resize", this._updateHeight);
},
componentWillReceiveProps(nextProps) {
this._autoExpand(nextProps);
this._updateHeight();
},
_autoExpand(props) {
if (!props.autoExpandDepth) {
return;
}
// Automatically expand the first autoExpandDepth levels for new items. Do
// not use the usual DFS infrastructure because we don't want to ignore
// collapsed nodes.
var autoExpand = (item, currentDepth) => {
if (currentDepth >= props.autoExpandDepth || this.state.seen.has(item)) {
return;
}
props.onExpand(item);
this.state.seen.add(item);
var children = props.getChildren(item);
var length = children.length;
for (var i = 0; i < length; i++) {
autoExpand(children[i], currentDepth + 1);
}
};
var roots = props.getRoots();
var length = roots.length;
if (props.autoExpandAll) {
for (var i = 0; i < length; i++) {
autoExpand(roots[i], 0);
}
} else if (length != 0) {
autoExpand(roots[0], 0);
}
},
render() {
var traversal = this._dfsFromRoots();
var renderItem = i => {
var _traversal$i = traversal[i],
item = _traversal$i.item,
depth = _traversal$i.depth;
return TreeNode({
key: this.props.getKey(item, i),
index: i,
item: item,
depth: depth,
renderItem: this.props.renderItem,
focused: this.props.focused === item,
expanded: this.props.isExpanded(item),
hasChildren: !!this.props.getChildren(item).length,
onExpand: this._onExpand,
onCollapse: this._onCollapse,
onFocus: () => this._focus(i, item)
});
};
var style = Object.assign({}, this.props.style || {}, {
padding: 0,
margin: 0
});
return dom.div({
className: "tree",
ref: "tree",
onKeyDown: this._onKeyDown,
onKeyPress: this._preventArrowKeyScrolling,
onKeyUp: this._preventArrowKeyScrolling,
onScroll: this._onScroll,
style
}, traversal.map((v, i) => renderItem(i)));
},
_preventArrowKeyScrolling(e) {
switch (e.key) {
case "ArrowUp":
case "ArrowDown":
case "ArrowLeft":
case "ArrowRight":
e.preventDefault();
e.stopPropagation();
if (e.nativeEvent) {
if (e.nativeEvent.preventDefault) {
e.nativeEvent.preventDefault();
}
if (e.nativeEvent.stopPropagation) {
e.nativeEvent.stopPropagation();
}
}
}
},
/**
* Updates the state's height based on clientHeight.
*/
_updateHeight() {
this.setState({
height: this.refs.tree.clientHeight
});
},
/**
* Perform a pre-order depth-first search from item.
*/
_dfs(item) {
var maxDepth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;
var traversal = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
var _depth = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
traversal.push({ item, depth: _depth });
if (!this.props.isExpanded(item)) {
return traversal;
}
var nextDepth = _depth + 1;
if (nextDepth > maxDepth) {
return traversal;
}
var children = this.props.getChildren(item);
var length = children.length;
for (var i = 0; i < length; i++) {
this._dfs(children[i], maxDepth, traversal, nextDepth);
}
return traversal;
},
/**
* Perform a pre-order depth-first search over the whole forest.
*/
_dfsFromRoots() {
var maxDepth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Infinity;
var traversal = [];
var roots = this.props.getRoots();
var length = roots.length;
for (var i = 0; i < length; i++) {
this._dfs(roots[i], maxDepth, traversal);
}
return traversal;
},
/**
* Expands current row.
*
* @param {Object} item
* @param {Boolean} expandAllChildren
*/
_onExpand: oncePerAnimationFrame(function (item, expandAllChildren) {
if (this.props.onExpand) {
this.props.onExpand(item);
if (expandAllChildren) {
var children = this._dfs(item);
var length = children.length;
for (var i = 0; i < length; i++) {
this.props.onExpand(children[i].item);
}
}
}
}),
/**
* Collapses current row.
*
* @param {Object} item
*/
_onCollapse: oncePerAnimationFrame(function (item) {
if (this.props.onCollapse) {
this.props.onCollapse(item);
}
}),
/**
* Sets the passed in item to be the focused item.
*
* @param {Number} index
* The index of the item in a full DFS traversal (ignoring collapsed
* nodes). Ignored if `item` is undefined.
*
* @param {Object|undefined} item
* The item to be focused, or undefined to focus no item.
*/
_focus(index, item) {
if (item !== undefined) {
var itemStartPosition = index * this.props.itemHeight;
var itemEndPosition = (index + 1) * this.props.itemHeight;
// Note that if the height of the viewport (this.state.height) is less than
// `this.props.itemHeight`, we could accidentally try and scroll both up and
// down in a futile attempt to make both the item's start and end positions
// visible. Instead, give priority to the start of the item by checking its
// position first, and then using an "else if", rather than a separate "if",
// for the end position.
if (this.state.scroll > itemStartPosition) {
this.refs.tree.scrollTop = itemStartPosition;
} else if (this.state.scroll + this.state.height < itemEndPosition) {
this.refs.tree.scrollTop = itemEndPosition - this.state.height;
}
}
if (this.props.onFocus) {
this.props.onFocus(item);
}
},
/**
* Sets the state to have no focused item.
*/
_onBlur() {
this._focus(0, undefined);
},
/**
* Fired on a scroll within the tree's container, updates
* the stored position of the view port to handle virtual view rendering.
*
* @param {Event} e
*/
_onScroll: oncePerAnimationFrame(function (e) {
this.setState({
scroll: Math.max(this.refs.tree.scrollTop, 0),
height: this.refs.tree.clientHeight
});
}),
/**
* Handles key down events in the tree's container.
*
* @param {Event} e
*/
_onKeyDown(e) {
if (this.props.focused == null) {
return;
}
// Allow parent nodes to use navigation arrows with modifiers.
if (e.altKey || e.ctrlKey || e.shiftKey || e.metaKey) {
return;
}
this._preventArrowKeyScrolling(e);
switch (e.key) {
case "ArrowUp":
this._focusPrevNode();
return;
case "ArrowDown":
this._focusNextNode();
return;
case "ArrowLeft":
if (this.props.isExpanded(this.props.focused) && this.props.getChildren(this.props.focused).length) {
this._onCollapse(this.props.focused);
} else {
this._focusParentNode();
}
return;
case "ArrowRight":
if (!this.props.isExpanded(this.props.focused)) {
this._onExpand(this.props.focused);
}
return;
}
},
/**
* Sets the previous node relative to the currently focused item, to focused.
*/
_focusPrevNode: oncePerAnimationFrame(function () {
// Start a depth first search and keep going until we reach the currently
// focused node. Focus the previous node in the DFS, if it exists. If it
// doesn't exist, we're at the first node already.
var prev = void 0;
var prevIndex = void 0;
var traversal = this._dfsFromRoots();
var length = traversal.length;
for (var i = 0; i < length; i++) {
var item = traversal[i].item;
if (item === this.props.focused) {
break;
}
prev = item;
prevIndex = i;
}
if (prev === undefined) {
return;
}
this._focus(prevIndex, prev);
}),
/**
* Handles the down arrow key which will focus either the next child
* or sibling row.
*/
_focusNextNode: oncePerAnimationFrame(function () {
// Start a depth first search and keep going until we reach the currently
// focused node. Focus the next node in the DFS, if it exists. If it
// doesn't exist, we're at the last node already.
var traversal = this._dfsFromRoots();
var length = traversal.length;
var i = 0;
while (i < length) {
if (traversal[i].item === this.props.focused) {
break;
}
i++;
}
if (i + 1 < traversal.length) {
this._focus(i + 1, traversal[i + 1].item);
}
}),
/**
* Handles the left arrow key, going back up to the current rows'
* parent row.
*/
_focusParentNode: oncePerAnimationFrame(function () {
var parent = this.props.getParent(this.props.focused);
if (!parent) {
return;
}
var traversal = this._dfsFromRoots();
var length = traversal.length;
var parentIndex = 0;
for (; parentIndex < length; parentIndex++) {
if (traversal[parentIndex].item === parent) {
break;
}
}
this._focus(parentIndex, parent);
})
});
/***/ },
/* 1002 */
/***/ function(module, exports) {
// removed by extract-text-webpack-plugin
/***/ },
/* 1003 */,
/* 1004 */
/***/ function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(2);
var _devtoolsConfig = __webpack_require__(828);
var _Svg = __webpack_require__(344);
var _Svg2 = _interopRequireDefault(_Svg);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var ReactDOM = __webpack_require__(22);
var breakpointSvg = document.createElement("div");
ReactDOM.render((0, _Svg2.default)("breakpoint"), breakpointSvg);
function makeBookmark() {
var widget = document.createElement("span");
widget.innerText = "+";
widget.classList.add("inline-bp");
return widget;
}
class ColumnBreakpoint extends _react.Component {
constructor() {
super();
this.bookmark = undefined;
var self = this;
self.addBreakpoint = this.addBreakpoint.bind(this);
}
addBreakpoint() {
if (!(0, _devtoolsConfig.isEnabled)("columnBreakpoints")) {
return;
}
var bp = this.props.breakpoint;
var line = bp.location.line - 1;
var column = bp.location.column;
var editor = this.props.editor;
var widget = makeBookmark();
var bookmark = editor.setBookmark({ line, ch: column }, { widget });
this.bookmark = bookmark;
}
shouldComponentUpdate(nextProps) {
return this.props.editor !== nextProps.editor || this.props.breakpoint.disabled !== nextProps.breakpoint.disabled || this.props.breakpoint.condition !== nextProps.breakpoint.condition;
}
componentDidMount() {
if (!this.props.editor) {
return;
}
this.addBreakpoint();
}
componentDidUpdate() {
this.addBreakpoint();
}
componentWillUnmount() {
if (!this.props.editor || !this.bookmark) {
return;
}
this.bookmark.clear();
}
render() {
return null;
}
}
ColumnBreakpoint.propTypes = {
breakpoint: _react.PropTypes.object.isRequired,
editor: _react.PropTypes.object.isRequired
};
ColumnBreakpoint.displayName = "ColumnBreakpoint";
exports.default = ColumnBreakpoint;
/***/ },
/* 1005 */
/***/ function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(2);
var _redux = __webpack_require__(3);
var _reactRedux = __webpack_require__(151);
var _Frame = __webpack_require__(1006);
var _Frame2 = _interopRequireDefault(_Frame);
var _Group2 = __webpack_require__(1008);
var _Group3 = _interopRequireDefault(_Group2);
var _actions = __webpack_require__(244);
var _actions2 = _interopRequireDefault(_actions);
var _frame = __webpack_require__(1007);
var _selectors = __webpack_require__(242);
__webpack_require__(1011);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// NOTE: using require because `import get` breaks atom's syntax highlighting
var get = __webpack_require__(67);
var FrameComponent = (0, _react.createFactory)(_Frame2.default);
var Group = (0, _react.createFactory)(_Group3.default);
var NUM_FRAMES_SHOWN = 7;
class Frames extends _react.Component {
constructor() {
super(...arguments);
this.state = {
showAllFrames: false
};
this.toggleFramesDisplay = this.toggleFramesDisplay.bind(this);
}
shouldComponentUpdate(nextProps, nextState) {
var _props = this.props,
frames = _props.frames,
selectedFrame = _props.selectedFrame;
var showAllFrames = this.state.showAllFrames;
return frames !== nextProps.frames || selectedFrame !== nextProps.selectedFrame || showAllFrames !== nextState.showAllFrames;
}
toggleFramesDisplay() {
this.setState({
showAllFrames: !this.state.showAllFrames
});
}
truncateFrames(frames) {
var numFramesToShow = this.state.showAllFrames ? frames.length : NUM_FRAMES_SHOWN;
return frames.slice(0, numFramesToShow);
}
renderFrames(frames) {
var _props2 = this.props,
selectFrame = _props2.selectFrame,
selectedFrame = _props2.selectedFrame;
var framesOrGroups = this.truncateFrames((0, _frame.collapseFrames)(frames));
return _react.DOM.ul({}, framesOrGroups.map(frameOrGroup => frameOrGroup.id ? FrameComponent({
frame: frameOrGroup,
frames,
selectFrame,
selectedFrame,
key: frameOrGroup.id
}) : Group({
group: frameOrGroup,
selectFrame,
selectedFrame,
key: frameOrGroup[0].id
})));
}
renderToggleButton(frames) {
var buttonMessage = this.state.showAllFrames ? L10N.getStr("callStack.collapse") : L10N.getStr("callStack.expand");
frames = (0, _frame.collapseFrames)(frames);
if (frames.length < NUM_FRAMES_SHOWN) {
return null;
}
return _react.DOM.div({ className: "show-more", onClick: this.toggleFramesDisplay }, buttonMessage);
}
render() {
var frames = this.props.frames;
if (!frames) {
return _react.DOM.div({ className: "pane frames" }, _react.DOM.div({ className: "pane-info empty" }, L10N.getStr("callStack.notPaused")));
}
return _react.DOM.div({ className: "pane frames" }, this.renderFrames(frames), this.renderToggleButton(frames));
}
}
Frames.propTypes = {
frames: _react.PropTypes.array,
selectedFrame: _react.PropTypes.object,
selectFrame: _react.PropTypes.func.isRequired
};
Frames.displayName = "Frames";
function getSourceForFrame(state, frame) {
return (0, _selectors.getSource)(state, frame.location.sourceId);
}
function appendSource(state, frame) {
return Object.assign({}, frame, {
source: getSourceForFrame(state, frame).toJS()
});
}
function getAndProcessFrames(state) {
var frames = (0, _selectors.getFrames)(state);
if (!frames) {
return null;
}
frames = frames.toJS().filter(frame => getSourceForFrame(state, frame)).filter(frame => !get(frame, "source.isBlackBoxed")).map(frame => appendSource(state, frame)).map(_frame.annotateFrame);
// frames = filterFrameworkFrames(frames);
return frames;
}
exports.default = (0, _reactRedux.connect)(state => ({
frames: getAndProcessFrames(state),
selectedFrame: (0, _selectors.getSelectedFrame)(state)
}), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Frames);
/***/ },
/* 1006 */
/***/ function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(2);
var _devtoolsLaunchpad = __webpack_require__(131);
var _classnames = __webpack_require__(175);
var _classnames2 = _interopRequireDefault(_classnames);
var _Svg = __webpack_require__(344);
var _Svg2 = _interopRequireDefault(_Svg);
var _clipboard = __webpack_require__(423);
var _frame = __webpack_require__(1007);
var _source = __webpack_require__(233);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function renderFrameTitle(frame, options) {
var displayName = (0, _frame.formatDisplayName)(frame, options);
return _react.DOM.div({ className: "title" }, displayName);
}
function renderFrameLocation(_ref) {
var source = _ref.source,
location = _ref.location,
library = _ref.library;
if (!source) {
return;
}
if (library) {
return _react.DOM.div({ className: "location" }, library, (0, _Svg2.default)(library.toLowerCase(), { className: "annotation-logo" }));
}
var filename = (0, _source.getFilename)(source);
return _react.DOM.div({ className: "location" }, `${filename}: ${location.line}`);
}
class FrameComponent extends _react.Component {
constructor() {
super(...arguments);
}
onContextMenu(event, frame, frames) {
var copySourceUrlLabel = L10N.getStr("copySourceUrl");
var copySourceUrlKey = L10N.getStr("copySourceUrl.accesskey");
var copyStackTraceLabel = L10N.getStr("copyStackTrace");
var copyStackTraceKey = L10N.getStr("copyStackTrace.accesskey");
event.stopPropagation();
event.preventDefault();
var menuOptions = [];
var source = frame.source;
if (source) {
var copySourceUrl = {
id: "node-menu-copy-source",
label: copySourceUrlLabel,
accesskey: copySourceUrlKey,
disabled: false,
click: () => (0, _clipboard.copyToTheClipboard)(source.url)
};
menuOptions.push(copySourceUrl);
}
var framesToCopy = frames.map(f => (0, _frame.formatCopyName)(f)).join("\n");
var copyStackTrace = {
id: "node-menu-copy-source",
label: copyStackTraceLabel,
accesskey: copyStackTraceKey,
disabled: false,
click: () => (0, _clipboard.copyToTheClipboard)(framesToCopy)
};
menuOptions.push(copyStackTrace);
(0, _devtoolsLaunchpad.showMenu)(event, menuOptions);
}
onMouseDown(e, frame, selectedFrame) {
if (e.nativeEvent.which == 3 && selectedFrame.id != frame.id) {
return;
}
this.props.selectFrame(frame);
}
onKeyUp(event, frame, selectedFrame) {
if (event.key != "Enter" || selectedFrame.id == frame.id) {
return;
}
this.props.selectFrame(frame);
}
render() {
var _props = this.props,
frame = _props.frame,
frames = _props.frames,
selectedFrame = _props.selectedFrame,
hideLocation = _props.hideLocation,
shouldMapDisplayName = _props.shouldMapDisplayName;
return _react.DOM.li({
key: frame.id,
className: (0, _classnames2.default)("frame", {
selected: selectedFrame && selectedFrame.id === frame.id
}),
onMouseDown: e => this.onMouseDown(e, frame, selectedFrame),
onKeyUp: e => this.onKeyUp(e, frame, selectedFrame),
onContextMenu: e => this.onContextMenu(e, frame, frames),
tabIndex: 0
}, renderFrameTitle(frame, { shouldMapDisplayName }), !hideLocation ? renderFrameLocation(frame) : null);
}
}
exports.default = FrameComponent;
FrameComponent.propTypes = {
frame: _react.PropTypes.object.isRequired,
frames: _react.PropTypes.array,
selectedFrame: _react.PropTypes.object,
selectFrame: _react.PropTypes.func.isRequired,
hideLocation: _react.PropTypes.bool,
shouldMapDisplayName: _react.PropTypes.bool
};
FrameComponent.defaultProps = {
hideLocation: false,
shouldMapDisplayName: true
};
FrameComponent.displayName = "Frame";
/***/ },
/* 1007 */
/***/ function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getLibraryFromUrl = getLibraryFromUrl;
exports.annotateFrame = annotateFrame;
exports.simplifyDisplayName = simplifyDisplayName;
exports.formatDisplayName = formatDisplayName;
exports.formatCopyName = formatCopyName;
exports.collapseFrames = collapseFrames;
var _devtoolsConfig = __webpack_require__(828);
var _utils = __webpack_require__(234);
var _source = __webpack_require__(233);
var _findIndex = __webpack_require__(262);
var _findIndex2 = _interopRequireDefault(_findIndex);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var get = __webpack_require__(67);
function getFrameUrl(frame) {
return get(frame, "source.url", "") || "";
}
function isBackbone(frame) {
return getFrameUrl(frame).match(/backbone/i);
}
function isJQuery(frame) {
return getFrameUrl(frame).match(/jquery/i);
}
function isReact(frame) {
return getFrameUrl(frame).match(/react/i);
}
function isWebpack(frame) {
return getFrameUrl(frame).match(/webpack\/bootstrap/i);
}
function getLibraryFromUrl(frame) {
if (isBackbone(frame)) {
return "Backbone";
}
if (isJQuery(frame)) {
return "jQuery";
}
if (isReact(frame)) {
return "React";
}
if (isWebpack(frame)) {
return "Webpack";
}
}
var displayNameMap = {
Backbone: {
"extend/child": "Create Class",
".create": "Create Model"
},
jQuery: {
"jQuery.event.dispatch": "Dispatch Event"
},
React: {
// eslint-disable-next-line max-len
"ReactCompositeComponent._renderValidatedComponentWithoutOwnerOrContext/renderedElement<": "Render"
},
Webpack: {
// eslint-disable-next-line camelcase
__webpack_require__: "Bootstrap"
}
};
function mapDisplayNames(frame, library) {
var map = displayNameMap[library];
var displayName = frame.displayName;
return map && map[displayName] || displayName;
}
function annotateFrame(frame) {
if (!(0, _devtoolsConfig.isEnabled)("collapseFrame")) {
return frame;
}
var library = getLibraryFromUrl(frame);
if (library) {
return Object.assign({}, frame, { library });
}
return frame;
}
// Decodes an anonymous naming scheme that
// spider monkey implements based on "Naming Anonymous JavaScript Functions"
// http://johnjbarton.github.io/nonymous/index.html
var objectProperty = /([\w\d]+)$/;
var arrayProperty = /\[(.*?)\]$/;
var functionProperty = /([\w\d]+)[\/\.<]*?$/;
var annonymousProperty = /([\w\d]+)\(\^\)$/;
function simplifyDisplayName(displayName) {
// if the display name has a space it has already been mapped
if (/\s/.exec(displayName)) {
return displayName;
}
var scenarios = [objectProperty, arrayProperty, functionProperty, annonymousProperty];
for (var reg of scenarios) {
var match = reg.exec(displayName);
if (match) {
return match[1];
}
}
return displayName;
}
function formatDisplayName(frame) {
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
_ref$shouldMapDisplay = _ref.shouldMapDisplayName,
shouldMapDisplayName = _ref$shouldMapDisplay === undefined ? true : _ref$shouldMapDisplay;
var displayName = frame.displayName,
library = frame.library;
if (library && shouldMapDisplayName) {
displayName = mapDisplayNames(frame, library);
}
displayName = simplifyDisplayName(displayName);
return (0, _utils.endTruncateStr)(displayName, 25);
}
function formatCopyName(frame) {
var displayName = formatDisplayName(frame);
var fileName = (0, _source.getFilename)(frame.source);
var frameLocation = frame.location.line;
return `${displayName} (${fileName}#${frameLocation})`;
}
function collapseFrames(frames) {
// We collapse groups of one so that user frames
// are not in a group of one
function addGroupToList(group, list) {
if (!group) {
return list;
}
if (group.length > 1) {
list.push(group);
} else {
list = list.concat(group);
}
return list;
}
var _collapseLastFrames = collapseLastFrames(frames),
newFrames = _collapseLastFrames.newFrames,
lastGroup = _collapseLastFrames.lastGroup;
frames = newFrames;
var items = [];
var currentGroup = null;
var prevItem = null;
for (var frame of frames) {
var prevLibrary = get(prevItem, "library");
if (!currentGroup) {
currentGroup = [frame];
} else if (prevLibrary && prevLibrary == frame.library) {
currentGroup.push(frame);
} else {
items = addGroupToList(currentGroup, items);
currentGroup = [frame];
}
prevItem = frame;
}
items = addGroupToList(currentGroup, items);
items = addGroupToList(lastGroup, items);
return items;
}
function collapseLastFrames(frames) {
var index = (0, _findIndex2.default)(frames, isWebpack);
if (index == -1) {
return { newFrames: frames, lastGroup: [] };
}
var newFrames = frames.slice(0, index);
var lastGroup = frames.slice(index);
return { newFrames, lastGroup };
}
/***/ },
/* 1008 */
/***/ function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(2);
var _classnames = __webpack_require__(175);
var _classnames2 = _interopRequireDefault(_classnames);
var _Svg = __webpack_require__(344);
var _Svg2 = _interopRequireDefault(_Svg);
var _frame = __webpack_require__(1007);
__webpack_require__(1009);
var _Frame = __webpack_require__(1006);
var _Frame2 = _interopRequireDefault(_Frame);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var FrameComponent = (0, _react.createFactory)(_Frame2.default);
function renderFrameLocation(frame) {
var library = (0, _frame.getLibraryFromUrl)(frame);
if (!library) {
return null;
}
return _react.DOM.div({ className: "location" }, library, (0, _Svg2.default)(library.toLowerCase(), { className: "annotation-logo" }));
}
class Group extends _react.Component {
constructor() {
super(...arguments);
this.state = { expanded: false };
var self = this;
self.toggleFrames = this.toggleFrames.bind(this);
}
toggleFrames() {
this.setState({ expanded: !this.state.expanded });
}
renderFrames() {
var _props = this.props,
group = _props.group,
selectFrame = _props.selectFrame,
selectedFrame = _props.selectedFrame;
var expanded = this.state.expanded;
if (!expanded) {
return null;
}
return _react.DOM.div({ className: "frames-list" }, group.map(frame => FrameComponent({
frame,
selectFrame,
selectedFrame,
key: frame.id,
hideLocation: true,
shouldMapDisplayName: false
})));
}
renderDescription() {
var frame = this.props.group[0];
var displayName = (0, _frame.formatDisplayName)(frame);
return _react.DOM.li({
key: frame.id,
className: (0, _classnames2.default)("group"),
onClick: this.toggleFrames,
tabIndex: 0
}, _react.DOM.div({ className: "title" }, displayName), renderFrameLocation(frame));
}
render() {
var expanded = this.state.expanded;
return _react.DOM.div({ className: (0, _classnames2.default)("frames-group", { expanded }) }, this.renderDescription(), this.renderFrames());
}
}
exports.default = Group;
Group.propTypes = {
group: _react.PropTypes.array.isRequired,
selectFrame: _react.PropTypes.func.isRequired,
selectedFrame: _react.PropTypes.object
};
Group.displayName = "Group";
/***/ },
/* 1009 */
/***/ function(module, exports) {
// removed by extract-text-webpack-plugin
/***/ },
/* 1010 */,
/* 1011 */
/***/ function(module, exports) {
// removed by extract-text-webpack-plugin
/***/ }
/******/ ])
});
;