(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(require("devtools/client/shared/vendor/react"), require("devtools/client/shared/vendor/lodash"), require("devtools/client/shared/vendor/react-dom"), require("Services"), require("devtools/shared/flags"), require("devtools/client/sourceeditor/editor"), require("devtools/client/shared/vendor/WasmParser"), require("devtools/client/shared/vendor/WasmDis")); else if(typeof define === 'function' && define.amd) define(["devtools/client/shared/vendor/react", "devtools/client/shared/vendor/lodash", "devtools/client/shared/vendor/react-dom", "Services", "devtools/shared/flags", "devtools/client/sourceeditor/editor", "devtools/client/shared/vendor/WasmParser", "devtools/client/shared/vendor/WasmDis"], factory); else { var a = typeof exports === 'object' ? factory(require("devtools/client/shared/vendor/react"), require("devtools/client/shared/vendor/lodash"), require("devtools/client/shared/vendor/react-dom"), require("Services"), require("devtools/shared/flags"), require("devtools/client/sourceeditor/editor"), require("devtools/client/shared/vendor/WasmParser"), require("devtools/client/shared/vendor/WasmDis")) : factory(root["devtools/client/shared/vendor/react"], root["devtools/client/shared/vendor/lodash"], root["devtools/client/shared/vendor/react-dom"], root["Services"], root["devtools/shared/flags"], root["devtools/client/sourceeditor/editor"], root["devtools/client/shared/vendor/WasmParser"], root["devtools/client/shared/vendor/WasmDis"]); for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; } })(this, function(__WEBPACK_EXTERNAL_MODULE_0__, __WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_4__, __WEBPACK_EXTERNAL_MODULE_22__, __WEBPACK_EXTERNAL_MODULE_52__, __WEBPACK_EXTERNAL_MODULE_197__, __WEBPACK_EXTERNAL_MODULE_677__, __WEBPACK_EXTERNAL_MODULE_678__) { 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] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = 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; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); /******/ } /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = "/assets/build"; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 46); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_0__; /***/ }), /* 1 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactDom = __webpack_require__(4); var _reactDom2 = _interopRequireDefault(_reactDom); var _devtoolsLaunchpad = __webpack_require__(131); var _devtoolsConfig = __webpack_require__(828); var _client = __webpack_require__(888); var _bootstrap = __webpack_require__(897); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } if (false) { window.Perf = require("react-addons-perf"); } if ((0, _devtoolsConfig.isFirefoxPanel)()) { module.exports = { bootstrap: (_ref) => { var threadClient = _ref.threadClient, tabTarget = _ref.tabTarget, debuggerClient = _ref.debuggerClient, sourceMaps = _ref.sourceMaps, toolboxActions = _ref.toolboxActions; return (0, _client.onConnect)({ tab: { clientType: "firefox" }, tabConnection: { tabTarget, threadClient, debuggerClient } }, { services: { sourceMaps }, toolboxActions }); }, destroy: () => { (0, _devtoolsLaunchpad.unmountRoot)(_reactDom2.default); (0, _bootstrap.teardownWorkers)(); } }; } else { window.L10N = _devtoolsLaunchpad.L10N; // $FlowIgnore: window.L10N.setBundle(__webpack_require__(960)); (0, _devtoolsLaunchpad.bootstrap)(_react2.default, _reactDom2.default).then(connection => { (0, _client.onConnect)(connection, { services: { sourceMaps: __webpack_require__(898) }, toolboxActions: {} }); }); } /***/ }), /* 2 */ /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_2__; /***/ }), /* 3 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createStore__ = __webpack_require__(32); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__combineReducers__ = __webpack_require__(171); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__bindActionCreators__ = __webpack_require__(173); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__applyMiddleware__ = __webpack_require__(174); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__compose__ = __webpack_require__(36); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__utils_warning__ = __webpack_require__(35); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "createStore", function() { return __WEBPACK_IMPORTED_MODULE_0__createStore__["b"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "combineReducers", function() { return __WEBPACK_IMPORTED_MODULE_1__combineReducers__["a"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bindActionCreators", function() { return __WEBPACK_IMPORTED_MODULE_2__bindActionCreators__["a"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "applyMiddleware", function() { return __WEBPACK_IMPORTED_MODULE_3__applyMiddleware__["a"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "compose", function() { return __WEBPACK_IMPORTED_MODULE_4__compose__["a"]; }); /* * 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) { warning('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.'); } /***/ }), /* 4 */ /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_4__; /***/ }), /* 5 */, /* 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_require__) { /* 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, __webpack_require__(792))) /***/ }), /* 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 */, /* 13 */, /* 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__) { module.exports = __webpack_require__(168); /***/ }), /* 16 */, /* 17 */, /* 18 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.nodeHasChildren = nodeHasChildren; exports.isExactUrlMatch = isExactUrlMatch; exports.isDirectory = isDirectory; exports.isNotJavaScript = isNotJavaScript; exports.isInvalidUrl = isInvalidUrl; exports.partIsFile = partIsFile; exports.createNode = createNode; exports.createParentMap = createParentMap; exports.getRelativePath = getRelativePath; var _url = __webpack_require__(334); var _source = __webpack_require__(233); var IGNORED_URLS = ["debugger eval code", "XStringBundle"]; function nodeHasChildren(item) { return Array.isArray(item.contents); } function isExactUrlMatch(pathPart, debuggeeUrl) { // compare to hostname with an optional 'www.' prefix var _parse = (0, _url.parse)(debuggeeUrl), host = _parse.host; if (!host) { return false; } return host.replace(/^www\./, "") === pathPart.replace(/^www\./, ""); } function isDirectory(url) { var parts = url.path.split("/").filter(p => p !== ""); // Assume that all urls point to files except when they end with '/' // Or directory node has children return parts.length === 0 || url.path.slice(-1) === "/" || nodeHasChildren(url); } function isNotJavaScript(source) { var parsedUrl = (0, _url.parse)(source.url).pathname; if (!parsedUrl) { return false; } var parsedExtension = parsedUrl.split(".").pop(); return ["css", "svg", "png"].includes(parsedExtension); } function isInvalidUrl(url, source) { return IGNORED_URLS.indexOf(url) != -1 || !source.get("url") || source.get("loadedState") === "loading" || !url.group || (0, _source.isPretty)(source.toJS()) || isNotJavaScript(source.toJS()); } function partIsFile(index, parts, url) { var isLastPart = index === parts.length - 1; return !isDirectory(url) && isLastPart; } function createNode(name, path, contents) { return { name, path, contents }; } function createParentMap(tree) { var map = new WeakMap(); function _traverse(subtree) { if (nodeHasChildren(subtree)) { for (var child of subtree.contents) { map.set(child, subtree); _traverse(child); } } } // Don't link each top-level path to the "root" node because the // user never sees the root tree.contents.forEach(_traverse); return map; } function getRelativePath(url) { var _parse2 = (0, _url.parse)(url), pathname = _parse2.pathname; if (!pathname) { return url; } var path = pathname.split("/"); path.shift(); return path.join("/"); } /***/ }), /* 19 */, /* 20 */ /***/ (function(module, exports, __webpack_require__) { /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ if (false) { var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' && Symbol.for && Symbol.for('react.element')) || 0xeac7; var isValidElement = function(object) { return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; }; // By explicitly using `prop-types` you are opting into new development behavior. // http://fb.me/prop-types-in-prod var throwOnDirectAccess = true; module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess); } else { // By explicitly using `prop-types` you are opting into new production behavior. // http://fb.me/prop-types-in-prod module.exports = __webpack_require__(177)(); } /***/ }), /* 21 */, /* 22 */ /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_22__; /***/ }), /* 23 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.renderWasmText = exports.clearWasmStates = exports.wasmOffsetToLine = exports.lineToWasmOffset = exports.isWasm = exports.getWasmLineNumberFormatter = exports.getWasmText = undefined; var _WasmParser = __webpack_require__(677); var _WasmDis = __webpack_require__(678); var wasmStates = Object.create(null); /** * @memberof utils/wasm * @static */ function getWasmText(sourceId, data) { var parser = new _WasmParser.BinaryReader(); parser.setData(data.buffer, 0, data.length); var dis = new _WasmDis.WasmDisassembler(); dis.addOffsets = true; var done = dis.disassembleChunk(parser); var result = dis.getResult(); if (result.lines.length === 0) { result = { lines: ["No luck with wast conversion"], offsets: [0], done }; } var offsets = result.offsets; var lines = []; for (var i = 0; i < offsets.length; i++) { lines[offsets[i]] = i; } wasmStates[sourceId] = { offsets, lines }; return { lines: result.lines, done: result.done }; } /** * @memberof utils/wasm * @static */ function getWasmLineNumberFormatter(sourceId) { var codeOf0 = 48, codeOfA = 65; var buffer = [codeOf0, codeOf0, codeOf0, codeOf0, codeOf0, codeOf0, codeOf0, codeOf0]; var last0 = 7; return function (number) { var offset = lineToWasmOffset(sourceId, number - 1); if (offset == undefined) { return ""; } var i = 7; for (var n = offset; n !== 0 && i >= 0; n >>= 4, i--) { var nibble = n & 15; buffer[i] = nibble < 10 ? codeOf0 + nibble : codeOfA - 10 + nibble; } for (var j = i; j > last0; j--) { buffer[j] = codeOf0; } last0 = i; return String.fromCharCode.apply(null, buffer); }; } /** * @memberof utils/wasm * @static */ function isWasm(sourceId) { return sourceId in wasmStates; } /** * @memberof utils/wasm * @static */ function lineToWasmOffset(sourceId, number) { var wasmState = wasmStates[sourceId]; if (!wasmState) { return undefined; } var offset = wasmState.offsets[number]; while (offset === undefined && number > 0) { offset = wasmState.offsets[--number]; } return offset; } /** * @memberof utils/wasm * @static */ function wasmOffsetToLine(sourceId, offset) { var wasmState = wasmStates[sourceId]; if (!wasmState) { return undefined; } return wasmState.lines[offset]; } /** * @memberof utils/wasm * @static */ function clearWasmStates() { wasmStates = Object.create(null); } function renderWasmText(sourceId, _ref) { var binary = _ref.binary; // binary does not survive as Uint8Array, converting from string var data = new Uint8Array(binary.length); for (var i = 0; i < data.length; i++) { data[i] = binary.charCodeAt(i); } var _getWasmText = getWasmText(sourceId, data), lines = _getWasmText.lines; var MAX_LINES = 100000; if (lines.length > MAX_LINES) { lines.splice(MAX_LINES, lines.length - MAX_LINES); lines.push(";; .... text is truncated due to the size"); } return lines; } exports.getWasmText = getWasmText; exports.getWasmLineNumberFormatter = getWasmLineNumberFormatter; exports.isWasm = isWasm; exports.lineToWasmOffset = lineToWasmOffset; exports.wasmOffsetToLine = wasmOffsetToLine; exports.clearWasmStates = clearWasmStates; exports.renderWasmText = renderWasmText; /***/ }), /* 24 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getFilenameFromPath = getFilenameFromPath; exports.getURL = getURL; var _url = __webpack_require__(334); var _lodash = __webpack_require__(2); function getFilenameFromPath(pathname) { var filename = ""; if (pathname) { filename = pathname.substring(pathname.lastIndexOf("/") + 1); // This file does not have a name. Default should be (index). if (filename == "" || !filename.includes(".")) { filename = "(index)"; } } return filename; } function getURL(sourceUrl) { var debuggeeUrl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ""; var url = sourceUrl; var def = { path: "", group: "", filename: "" }; if (!url) { return def; } var _parse = (0, _url.parse)(url), pathname = _parse.pathname, protocol = _parse.protocol, host = _parse.host, path = _parse.path; var defaultDomain = (0, _url.parse)(debuggeeUrl).host; var filename = getFilenameFromPath(pathname); switch (protocol) { case "javascript:": // Ignore `javascript:` URLs for now return def; case "webpack:": // A Webpack source is a special case return (0, _lodash.merge)(def, { path: path, group: "Webpack", filename: filename }); case "about:": // An about page is a special case return (0, _lodash.merge)(def, { path: "/", group: url, filename: filename }); case null: if (pathname && pathname.startsWith("/")) { // If it's just a URL like "/foo/bar.js", resolve it to the file // protocol return (0, _lodash.merge)(def, { path: path, group: "file://", filename: filename }); } else if (host === null) { // We don't know what group to put this under, and it's a script // with a weird URL. Just group them all under an anonymous group. return (0, _lodash.merge)(def, { path: url, group: defaultDomain, filename: filename }); } break; case "http:": case "https:": return (0, _lodash.merge)(def, { path: pathname, group: host, filename: filename }); } return (0, _lodash.merge)(def, { path: path, group: protocol ? `${protocol}//` : "", filename: filename }); } /***/ }), /* 25 */, /* 26 */, /* 27 */, /* 28 */, /* 29 */, /* 30 */, /* 31 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.InitialState = InitialState; exports.getTextSearchResults = getTextSearchResults; exports.getTextSearchQuery = getTextSearchQuery; var _immutable = __webpack_require__(146); var I = _interopRequireWildcard(_immutable); var _makeRecord = __webpack_require__(230); var _makeRecord2 = _interopRequireDefault(_makeRecord); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /** * Search reducer * @module reducers/search */ function InitialState() { return (0, _makeRecord2.default)({ query: "", results: I.List() })(); } function update() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : InitialState(); var action = arguments[1]; switch (action.type) { case "ADD_QUERY": return state.update("query", value => action.query); case "CLEAR_QUERY": return state.remove("query"); case "ADD_SEARCH_RESULT": var _results = state.get("results"); return state.merge({ results: _results.push(action.result) }); case "CLEAR_SEARCH_RESULTS": return state.merge({ results: state.get("results").clear() }); } return state; } function getTextSearchResults(state) { return state.projectTextSearch.get("results"); } function getTextSearchQuery(state) { return state.projectTextSearch.get("query"); } exports.default = update; /***/ }), /* 32 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ActionTypes; }); /* harmony export (immutable) */ __webpack_exports__["b"] = createStore; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__ = __webpack_require__(33); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_symbol_observable__ = __webpack_require__(15); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_symbol_observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_symbol_observable__); /** * 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 = { 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} [preloadedState] 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, preloadedState, enhancer) { var _ref2; if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') { enhancer = preloadedState; preloadedState = undefined; } if (typeof enhancer !== 'undefined') { if (typeof enhancer !== 'function') { throw new Error('Expected the enhancer to be a function.'); } return enhancer(createStore)(reducer, preloadedState); } if (typeof reducer !== 'function') { throw new Error('Expected the reducer to be a function.'); } var currentReducer = reducer; var currentState = preloadedState; 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 (!Object(__WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__["a" /* 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++) { var listener = listeners[i]; listener(); } 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/tc39/proposal-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[__WEBPACK_IMPORTED_MODULE_1_symbol_observable___default.a] = 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[__WEBPACK_IMPORTED_MODULE_1_symbol_observable___default.a] = observable, _ref2; } /***/ }), /* 33 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__ = __webpack_require__(123); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getPrototype_js__ = __webpack_require__(129); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isObjectLike_js__ = __webpack_require__(139); /** `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 (!Object(__WEBPACK_IMPORTED_MODULE_2__isObjectLike_js__["a" /* default */])(value) || Object(__WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__["a" /* default */])(value) != objectTag) { return false; } var proto = Object(__WEBPACK_IMPORTED_MODULE_1__getPrototype_js__["a" /* default */])(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; } /* harmony default export */ __webpack_exports__["a"] = (isPlainObject); /***/ }), /* 34 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__root_js__ = __webpack_require__(124); /** Built-in value references. */ var Symbol = __WEBPACK_IMPORTED_MODULE_0__root_js__["a" /* default */].Symbol; /* harmony default export */ __webpack_exports__["a"] = (Symbol); /***/ }), /* 35 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export default */ /** * 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 */ } /***/ }), /* 36 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = 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; }; } if (funcs.length === 1) { return funcs[0]; } return funcs.reduce(function (a, b) { return function () { return a(b.apply(undefined, arguments)); }; }); } /***/ }), /* 37 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.addSearchQuery = addSearchQuery; exports.clearSearchQuery = clearSearchQuery; exports.clearSearchResults = clearSearchResults; exports.searchSources = searchSources; exports.searchSource = searchSource; var _search = __webpack_require__(1115); var _selectors = __webpack_require__(242); var _source = __webpack_require__(233); var _sources = __webpack_require__(254); function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /** * Redux actions for the search state * @module actions/search */ function addSearchQuery(query) { return (_ref) => { var dispatch = _ref.dispatch, getState = _ref.getState; dispatch({ type: "ADD_QUERY", query }); }; } function clearSearchQuery() { return (_ref2) => { var dispatch = _ref2.dispatch, getState = _ref2.getState; dispatch({ type: "CLEAR_QUERY" }); }; } function clearSearchResults() { return (_ref3) => { var dispatch = _ref3.dispatch, getState = _ref3.getState; dispatch({ type: "CLEAR_SEARCH_RESULTS" }); }; } function searchSources(query) { return (() => { var _ref4 = _asyncToGenerator(function* (_ref5) { var dispatch = _ref5.dispatch, getState = _ref5.getState; yield dispatch(clearSearchResults()); yield dispatch(addSearchQuery(query)); yield dispatch((0, _sources.loadAllSources)()); var sources = (0, _selectors.getSources)(getState()); var validSources = sources.valueSeq().filter(function (source) { return (0, _source.isLoaded)(source.toJS()) && !(0, _source.isThirdParty)(source.toJS()); }).toJS(); for (var source of validSources) { yield dispatch(searchSource(source.id, query)); } }); return function (_x) { return _ref4.apply(this, arguments); }; })(); } function searchSource(sourceId, query) { return (() => { var _ref6 = _asyncToGenerator(function* (_ref7) { var dispatch = _ref7.dispatch, getState = _ref7.getState; var sourceRecord = (0, _selectors.getSource)(getState(), sourceId); if (!sourceRecord) { return; } var source = sourceRecord.toJS(); var matches = yield (0, _search.findSourceMatches)(source, query); dispatch({ type: "ADD_SEARCH_RESULT", result: { sourceId: source.id, filepath: source.url, matches } }); }); return function (_x2) { return _ref6.apply(this, arguments); }; })(); } /***/ }), /* 38 */, /* 39 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _formatTree = __webpack_require__(273); Object.defineProperty(exports, "formatTree", { enumerable: true, get: function () { return _formatTree.formatTree; } }); var _addToTree = __webpack_require__(40); Object.defineProperty(exports, "addToTree", { enumerable: true, get: function () { return _addToTree.addToTree; } }); var _sortTree = __webpack_require__(794); Object.defineProperty(exports, "sortTree", { enumerable: true, get: function () { return _sortTree.sortTree; } }); Object.defineProperty(exports, "sortEntireTree", { enumerable: true, get: function () { return _sortTree.sortEntireTree; } }); var _collapseTree = __webpack_require__(41); Object.defineProperty(exports, "collapseTree", { enumerable: true, get: function () { return _collapseTree.collapseTree; } }); var _getDirectories = __webpack_require__(274); Object.defineProperty(exports, "getDirectories", { enumerable: true, get: function () { return _getDirectories.getDirectories; } }); var _createTree = __webpack_require__(275); Object.defineProperty(exports, "createTree", { enumerable: true, get: function () { return _createTree.createTree; } }); var _getURL = __webpack_require__(24); Object.defineProperty(exports, "getURL", { enumerable: true, get: function () { return _getURL.getURL; } }); Object.defineProperty(exports, "getFilenameFromPath", { enumerable: true, get: function () { return _getURL.getFilenameFromPath; } }); var _utils = __webpack_require__(18); Object.defineProperty(exports, "nodeHasChildren", { enumerable: true, get: function () { return _utils.nodeHasChildren; } }); Object.defineProperty(exports, "isExactUrlMatch", { enumerable: true, get: function () { return _utils.isExactUrlMatch; } }); Object.defineProperty(exports, "isDirectory", { enumerable: true, get: function () { return _utils.isDirectory; } }); Object.defineProperty(exports, "createNode", { enumerable: true, get: function () { return _utils.createNode; } }); Object.defineProperty(exports, "createParentMap", { enumerable: true, get: function () { return _utils.createParentMap; } }); Object.defineProperty(exports, "getRelativePath", { enumerable: true, get: function () { return _utils.getRelativePath; } }); Object.defineProperty(exports, "isNotJavaScript", { enumerable: true, get: function () { return _utils.isNotJavaScript; } }); /***/ }), /* 40 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.addToTree = addToTree; var _utils = __webpack_require__(18); var _getURL = __webpack_require__(24); 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); } } function createNodeInTree(part, path, tree) { var node = (0, _utils.createNode)(part, path, []); // we are modifying the tree tree.contents = [].concat(_toConsumableArray(tree.contents), [node]); return node; } /* * Look for the child directory * 1. if it exists return it * 2. if it does not exist create it * 3. if it is a file, replace it with a directory */ function findOrCreateNode(parts, subTree, path, part, index, url) { var child = subTree.contents.find(c => c.name === part); // we create and enter the new node if (!child) { return createNodeInTree(part, path, subTree); } // we found a path with the same name as the part. We need to determine // if this is the correct child, or if we have a naming conflict var addedPartIsFile = (0, _utils.partIsFile)(index, parts, url); var childIsFile = !(0, _utils.nodeHasChildren)(child); // if we have a naming conflict, we'll create a new node if (childIsFile && !addedPartIsFile || !childIsFile && addedPartIsFile) { return createNodeInTree(part, path, subTree); } // if there is no naming conflict, we can traverse into the child return child; } /* * walk the source tree to the final node for a given url, * adding new nodes along the way */ function traverseTree(url, tree) { url.path = decodeURIComponent(url.path); var parts = url.path.split("/").filter(p => p !== ""); parts.unshift(url.group); var path = ""; return parts.reduce((subTree, part, index) => { path = `${path}/${part}`; return findOrCreateNode(parts, subTree, path, part, index, url); }, tree); } /* * Add a source file to a directory node in the tree */ function addSourceToNode(node, url, source) { var isFile = !(0, _utils.isDirectory)(url); // if we have a file, and the subtree has no elements, overwrite the // subtree contents with the source if (isFile) { return source; } var name = (0, _getURL.getFilenameFromPath)(url.path); var existingNode = node.contents.find(childNode => childNode.name === name); // if we are readding an existing file in the node, overwrite the existing // file and return the node's contents if (existingNode) { existingNode.contents = source; return node.contents; } // if this is a new file, add the new file; var newNode = (0, _utils.createNode)(name, source.get("url"), source); return [].concat(_toConsumableArray(node.contents), [newNode]); } /** * @memberof utils/sources-tree * @static */ function addToTree(tree, source, debuggeeUrl) { var url = (0, _getURL.getURL)(source.get("url"), debuggeeUrl); if ((0, _utils.isInvalidUrl)(url, source)) { return; } var finalNode = traverseTree(url, tree); finalNode.contents = addSourceToNode(finalNode, url, source); } /***/ }), /* 41 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.collapseTree = collapseTree; var _utils = __webpack_require__(18); /** * Take an existing source tree, and return a new one with collapsed nodes. */ function collapseTree(node) { var depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; // Node is a folder. if (Array.isArray(node.contents)) { // Node is not a root/domain node, and only contains 1 item. if (depth > 1 && node.contents.length === 1) { var next = node.contents[0]; // Do not collapse if the next node is a leaf node. if ((0, _utils.nodeHasChildren)(next)) { return collapseTree((0, _utils.createNode)(`${node.name}/${next.name}`, next.path, next.contents), depth + 1); } } // Map the contents. return (0, _utils.createNode)(node.name, node.path, node.contents.map(next => collapseTree(next, depth + 1))); } // Node is a leaf, not a folder, do not modify it. return node; } /***/ }), /* 42 */ /***/ (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); } } /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // Dependencies var React = __webpack_require__(0); // Shortcuts var span = React.DOM.span; var _require = __webpack_require__(927), wrapRender = _require.wrapRender; var PropRep = __webpack_require__(937); var _require2 = __webpack_require__(925), MODE = _require2.MODE; /** * Renders an map entry. A map entry is represented by its key, a column and its value. */ GripMapEntry.propTypes = { object: React.PropTypes.object, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), onDOMNodeMouseOver: React.PropTypes.func, onDOMNodeMouseOut: React.PropTypes.func, onInspectIconClick: React.PropTypes.func }; function GripMapEntry(props) { var object = props.object; var _object$preview = object.preview, key = _object$preview.key, value = _object$preview.value; return span.apply(undefined, [{ className: "objectBox objectBox-map-entry" }].concat(_toConsumableArray(PropRep(Object.assign({}, props, { name: key, object: value, equal: " \u2192 ", title: null, suppressQuotes: false }))))); } function supportsObject(grip) { var noGrip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (noGrip === true) { return false; } return grip && grip.type === "mapEntry" && grip.preview; } function createGripMapEntry(key, value) { return { type: "mapEntry", preview: { key, value } }; } // Exports from this module module.exports = { rep: wrapRender(GripMapEntry), createGripMapEntry, supportsObject }; /***/ }), /* 43 */, /* 44 */, /* 45 */, /* 46 */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(1); /***/ }), /* 47 */, /* 48 */, /* 49 */, /* 50 */, /* 51 */, /* 52 */ /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_52__; /***/ }), /* 53 */, /* 54 */, /* 55 */, /* 56 */, /* 57 */, /* 58 */, /* 59 */, /* 60 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /** * Empty shim for "devtools/client/shared/zoom-keys" module * * Based on nsIMarkupDocumentViewer.fullZoom API * https://developer.mozilla.org/en-US/Firefox/Releases/3/Full_page_zoom */ exports.register = function (window) {}; /***/ }), /* 61 */, /* 62 */ /***/ (function(module, exports, __webpack_require__) { /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ const networkRequest = __webpack_require__(63); const workerUtils = __webpack_require__(64); module.exports = { networkRequest, workerUtils }; /***/ }), /* 63 */ /***/ (function(module, exports) { /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ function networkRequest(url, opts) { return new Promise((resolve, reject) => { try { const req = new XMLHttpRequest(); req.addEventListener("readystatechange", () => { if (req.readyState === XMLHttpRequest.DONE) { if (req.status === 200) { resolve({ content: req.responseText }); } else { let text = req.statusText || "invalid URL"; reject(text); } } }); // Not working yet. // if (!opts.loadFromCache) { // req.channel.loadFlags = ( // Components.interfaces.nsIRequest.LOAD_BYPASS_CACHE | // Components.interfaces.nsIRequest.INHIBIT_CACHING | // Components.interfaces.nsIRequest.LOAD_ANONYMOUS // ); // } req.open("GET", url); req.send(); } catch (e) { reject(e.toString()); } }); } module.exports = networkRequest; /***/ }), /* 64 */ /***/ (function(module, exports) { function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } function WorkerDispatcher() { this.msgId = 1; this.worker = null; } /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ WorkerDispatcher.prototype = { start(url) { this.worker = new Worker(url); this.worker.onerror = () => { console.error(`Error in worker ${url}`); }; }, stop() { if (!this.worker) { return; } this.worker.terminate(); this.worker = null; }, task(method) { return (...args) => { return new Promise((resolve, reject) => { const id = this.msgId++; this.worker.postMessage({ id, method, args }); const listener = ({ data: result }) => { if (result.id !== id) { return; } this.worker.removeEventListener("message", listener); if (result.error) { reject(result.error); } else { resolve(result.response); } }; this.worker.addEventListener("message", listener); }); }; } }; function workerHandler(publicInterface) { return function (msg) { const { id, method, args } = msg.data; try { const response = publicInterface[method].apply(undefined, args); if (response instanceof Promise) { response.then(val => self.postMessage({ id, response: val }), err => self.postMessage({ id, error: err })); } else { self.postMessage({ id, response }); } } catch (error) { self.postMessage({ id, error }); } }; } function streamingWorkerHandler(publicInterface, { timeout = 100 } = {}, worker = self) { let streamingWorker = (() => { var _ref = _asyncToGenerator(function* (id, tasks) { let isWorking = true; const intervalId = setTimeout(function () { isWorking = false; }, timeout); const results = []; while (tasks.length !== 0 && isWorking) { const { callback, context, args } = tasks.shift(); const result = yield callback.call(context, args); results.push(result); } worker.postMessage({ id, status: "pending", data: results }); clearInterval(intervalId); if (tasks.length !== 0) { yield streamingWorker(id, tasks); } }); return function streamingWorker(_x, _x2) { return _ref.apply(this, arguments); }; })(); return (() => { var _ref2 = _asyncToGenerator(function* (msg) { const { id, method, args } = msg.data; const workerMethod = publicInterface[method]; if (!workerMethod) { console.error(`Could not find ${method} defined in worker.`); } worker.postMessage({ id, status: "start" }); try { const tasks = workerMethod(args); yield streamingWorker(id, tasks); worker.postMessage({ id, status: "done" }); } catch (error) { worker.postMessage({ id, status: "error", error }); } }); return function (_x3) { return _ref2.apply(this, arguments); }; })(); } module.exports = { WorkerDispatcher, workerHandler, streamingWorkerHandler }; /***/ }), /* 65 */, /* 66 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.decode = exports.parse = __webpack_require__(121); exports.encode = exports.stringify = __webpack_require__(122); /***/ }), /* 67 */ /***/ (function(module, exports, __webpack_require__) { var baseGet = __webpack_require__(68); /** * Gets the value at `path` of `object`. If the resolved value is * `undefined`, the `defaultValue` is returned in its place. * * @static * @memberOf _ * @since 3.7.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @param {*} [defaultValue] The value returned for `undefined` resolved values. * @returns {*} Returns the resolved value. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.get(object, 'a[0].b.c'); * // => 3 * * _.get(object, ['a', '0', 'b', 'c']); * // => 3 * * _.get(object, 'a.b.c', 'default'); * // => 'default' */ function get(object, path, defaultValue) { var result = object == null ? undefined : baseGet(object, path); return result === undefined ? defaultValue : result; } module.exports = get; /***/ }), /* 68 */ /***/ (function(module, exports, __webpack_require__) { var castPath = __webpack_require__(69), toKey = __webpack_require__(111); /** * The base implementation of `_.get` without support for default values. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @returns {*} Returns the resolved value. */ function baseGet(object, path) { path = castPath(path, object); var index = 0, length = path.length; while (object != null && index < length) { object = object[toKey(path[index++])]; } return (index && index == length) ? object : undefined; } module.exports = baseGet; /***/ }), /* 69 */ /***/ (function(module, exports, __webpack_require__) { var isArray = __webpack_require__(70), isKey = __webpack_require__(71), stringToPath = __webpack_require__(73), toString = __webpack_require__(108); /** * Casts `value` to a path array if it's not one. * * @private * @param {*} value The value to inspect. * @param {Object} [object] The object to query keys on. * @returns {Array} Returns the cast property path array. */ function castPath(value, object) { if (isArray(value)) { return value; } return isKey(value, object) ? [value] : stringToPath(toString(value)); } module.exports = castPath; /***/ }), /* 70 */ /***/ (function(module, exports) { /** * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * * _.isArray([1, 2, 3]); * // => true * * _.isArray(document.body.children); * // => false * * _.isArray('abc'); * // => false * * _.isArray(_.noop); * // => false */ var isArray = Array.isArray; module.exports = isArray; /***/ }), /* 71 */ /***/ (function(module, exports, __webpack_require__) { var isArray = __webpack_require__(70), isSymbol = __webpack_require__(72); /** Used to match property names within property paths. */ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/; /** * Checks if `value` is a property name and not a property path. * * @private * @param {*} value The value to check. * @param {Object} [object] The object to query keys on. * @returns {boolean} Returns `true` if `value` is a property name, else `false`. */ function isKey(value, object) { if (isArray(value)) { return false; } var type = typeof value; if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) { return true; } return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || (object != null && value in Object(object)); } module.exports = isKey; /***/ }), /* 72 */ /***/ (function(module, exports, __webpack_require__) { var baseGetTag = __webpack_require__(6), isObjectLike = __webpack_require__(14); /** `Object#toString` result references. */ var symbolTag = '[object Symbol]'; /** * Checks if `value` is classified as a `Symbol` primitive or object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * * _.isSymbol(Symbol.iterator); * // => true * * _.isSymbol('abc'); * // => false */ function isSymbol(value) { return typeof value == 'symbol' || (isObjectLike(value) && baseGetTag(value) == symbolTag); } module.exports = isSymbol; /***/ }), /* 73 */ /***/ (function(module, exports, __webpack_require__) { var memoizeCapped = __webpack_require__(74); /** Used to match property names within property paths. */ var reLeadingDot = /^\./, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; /** Used to match backslashes in property paths. */ var reEscapeChar = /\\(\\)?/g; /** * Converts `string` to a property path array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the property path array. */ var stringToPath = memoizeCapped(function(string) { var result = []; if (reLeadingDot.test(string)) { result.push(''); } string.replace(rePropName, function(match, number, quote, string) { result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); }); return result; }); module.exports = stringToPath; /***/ }), /* 74 */ /***/ (function(module, exports, __webpack_require__) { var memoize = __webpack_require__(75); /** Used as the maximum memoize cache size. */ var MAX_MEMOIZE_SIZE = 500; /** * A specialized version of `_.memoize` which clears the memoized function's * cache when it exceeds `MAX_MEMOIZE_SIZE`. * * @private * @param {Function} func The function to have its output memoized. * @returns {Function} Returns the new memoized function. */ function memoizeCapped(func) { var result = memoize(func, function(key) { if (cache.size === MAX_MEMOIZE_SIZE) { cache.clear(); } return key; }); var cache = result.cache; return result; } module.exports = memoizeCapped; /***/ }), /* 75 */ /***/ (function(module, exports, __webpack_require__) { var MapCache = __webpack_require__(76); /** Error message constants. */ var FUNC_ERROR_TEXT = 'Expected a function'; /** * Creates a function that memoizes the result of `func`. If `resolver` is * provided, it determines the cache key for storing the result based on the * arguments provided to the memoized function. By default, the first argument * provided to the memoized function is used as the map cache key. The `func` * is invoked with the `this` binding of the memoized function. * * **Note:** The cache is exposed as the `cache` property on the memoized * function. Its creation may be customized by replacing the `_.memoize.Cache` * constructor with one whose instances implement the * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) * method interface of `clear`, `delete`, `get`, `has`, and `set`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to have its output memoized. * @param {Function} [resolver] The function to resolve the cache key. * @returns {Function} Returns the new memoized function. * @example * * var object = { 'a': 1, 'b': 2 }; * var other = { 'c': 3, 'd': 4 }; * * var values = _.memoize(_.values); * values(object); * // => [1, 2] * * values(other); * // => [3, 4] * * object.a = 2; * values(object); * // => [1, 2] * * // Modify the result cache. * values.cache.set(object, ['a', 'b']); * values(object); * // => ['a', 'b'] * * // Replace `_.memoize.Cache`. * _.memoize.Cache = WeakMap; */ function memoize(func, resolver) { if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { throw new TypeError(FUNC_ERROR_TEXT); } var memoized = function() { var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache; if (cache.has(key)) { return cache.get(key); } var result = func.apply(this, args); memoized.cache = cache.set(key, result) || cache; return result; }; memoized.cache = new (memoize.Cache || MapCache); return memoized; } // Expose `MapCache`. memoize.Cache = MapCache; module.exports = memoize; /***/ }), /* 76 */ /***/ (function(module, exports, __webpack_require__) { var mapCacheClear = __webpack_require__(77), mapCacheDelete = __webpack_require__(102), mapCacheGet = __webpack_require__(105), mapCacheHas = __webpack_require__(106), mapCacheSet = __webpack_require__(107); /** * Creates a map cache object to store key-value pairs. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function MapCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } // Add methods to `MapCache`. MapCache.prototype.clear = mapCacheClear; MapCache.prototype['delete'] = mapCacheDelete; MapCache.prototype.get = mapCacheGet; MapCache.prototype.has = mapCacheHas; MapCache.prototype.set = mapCacheSet; module.exports = MapCache; /***/ }), /* 77 */ /***/ (function(module, exports, __webpack_require__) { var Hash = __webpack_require__(78), ListCache = __webpack_require__(93), Map = __webpack_require__(101); /** * Removes all key-value entries from the map. * * @private * @name clear * @memberOf MapCache */ function mapCacheClear() { this.size = 0; this.__data__ = { 'hash': new Hash, 'map': new (Map || ListCache), 'string': new Hash }; } module.exports = mapCacheClear; /***/ }), /* 78 */ /***/ (function(module, exports, __webpack_require__) { var hashClear = __webpack_require__(79), hashDelete = __webpack_require__(89), hashGet = __webpack_require__(90), hashHas = __webpack_require__(91), hashSet = __webpack_require__(92); /** * Creates a hash object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function Hash(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } // Add methods to `Hash`. Hash.prototype.clear = hashClear; Hash.prototype['delete'] = hashDelete; Hash.prototype.get = hashGet; Hash.prototype.has = hashHas; Hash.prototype.set = hashSet; module.exports = Hash; /***/ }), /* 79 */ /***/ (function(module, exports, __webpack_require__) { var nativeCreate = __webpack_require__(80); /** * Removes all key-value entries from the hash. * * @private * @name clear * @memberOf Hash */ function hashClear() { this.__data__ = nativeCreate ? nativeCreate(null) : {}; this.size = 0; } module.exports = hashClear; /***/ }), /* 80 */ /***/ (function(module, exports, __webpack_require__) { var getNative = __webpack_require__(81); /* Built-in method references that are verified to be native. */ var nativeCreate = getNative(Object, 'create'); module.exports = nativeCreate; /***/ }), /* 81 */ /***/ (function(module, exports, __webpack_require__) { var baseIsNative = __webpack_require__(82), getValue = __webpack_require__(88); /** * Gets the native function at `key` of `object`. * * @private * @param {Object} object The object to query. * @param {string} key The key of the method to get. * @returns {*} Returns the function if it's native, else `undefined`. */ function getNative(object, key) { var value = getValue(object, key); return baseIsNative(value) ? value : undefined; } module.exports = getNative; /***/ }), /* 82 */ /***/ (function(module, exports, __webpack_require__) { var isFunction = __webpack_require__(83), isMasked = __webpack_require__(85), isObject = __webpack_require__(84), toSource = __webpack_require__(87); /** * Used to match `RegExp` * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; /** Used to detect host constructors (Safari). */ var reIsHostCtor = /^\[object .+?Constructor\]$/; /** 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 detect if a method is native. */ var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' ); /** * The base implementation of `_.isNative` without bad shim checks. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a native function, * else `false`. */ function baseIsNative(value) { if (!isObject(value) || isMasked(value)) { return false; } var pattern = isFunction(value) ? reIsNative : reIsHostCtor; return pattern.test(toSource(value)); } module.exports = baseIsNative; /***/ }), /* 83 */ /***/ (function(module, exports, __webpack_require__) { var baseGetTag = __webpack_require__(6), isObject = __webpack_require__(84); /** `Object#toString` result references. */ var asyncTag = '[object AsyncFunction]', funcTag = '[object Function]', genTag = '[object GeneratorFunction]', proxyTag = '[object Proxy]'; /** * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); * // => true * * _.isFunction(/abc/); * // => false */ function isFunction(value) { if (!isObject(value)) { return false; } // The use of `Object#toString` avoids issues with the `typeof` operator // in Safari 9 which returns 'object' for typed arrays and other constructors. var tag = baseGetTag(value); return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; } module.exports = isFunction; /***/ }), /* 84 */ /***/ (function(module, exports) { /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */ function isObject(value) { var type = typeof value; return value != null && (type == 'object' || type == 'function'); } module.exports = isObject; /***/ }), /* 85 */ /***/ (function(module, exports, __webpack_require__) { var coreJsData = __webpack_require__(86); /** Used to detect methods masquerading as native. */ var maskSrcKey = (function() { var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); return uid ? ('Symbol(src)_1.' + uid) : ''; }()); /** * Checks if `func` has its source masked. * * @private * @param {Function} func The function to check. * @returns {boolean} Returns `true` if `func` is masked, else `false`. */ function isMasked(func) { return !!maskSrcKey && (maskSrcKey in func); } module.exports = isMasked; /***/ }), /* 86 */ /***/ (function(module, exports, __webpack_require__) { var root = __webpack_require__(8); /** Used to detect overreaching core-js shims. */ var coreJsData = root['__core-js_shared__']; module.exports = coreJsData; /***/ }), /* 87 */ /***/ (function(module, exports) { /** Used for built-in method references. */ var funcProto = Function.prototype; /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; /** * Converts `func` to its source code. * * @private * @param {Function} func The function to convert. * @returns {string} Returns the source code. */ function toSource(func) { if (func != null) { try { return funcToString.call(func); } catch (e) {} try { return (func + ''); } catch (e) {} } return ''; } module.exports = toSource; /***/ }), /* 88 */ /***/ (function(module, exports) { /** * Gets the value at `key` of `object`. * * @private * @param {Object} [object] The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function getValue(object, key) { return object == null ? undefined : object[key]; } module.exports = getValue; /***/ }), /* 89 */ /***/ (function(module, exports) { /** * Removes `key` and its value from the hash. * * @private * @name delete * @memberOf Hash * @param {Object} hash The hash to modify. * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function hashDelete(key) { var result = this.has(key) && delete this.__data__[key]; this.size -= result ? 1 : 0; return result; } module.exports = hashDelete; /***/ }), /* 90 */ /***/ (function(module, exports, __webpack_require__) { var nativeCreate = __webpack_require__(80); /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Gets the hash value for `key`. * * @private * @name get * @memberOf Hash * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function hashGet(key) { var data = this.__data__; if (nativeCreate) { var result = data[key]; return result === HASH_UNDEFINED ? undefined : result; } return hasOwnProperty.call(data, key) ? data[key] : undefined; } module.exports = hashGet; /***/ }), /* 91 */ /***/ (function(module, exports, __webpack_require__) { var nativeCreate = __webpack_require__(80); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Checks if a hash value for `key` exists. * * @private * @name has * @memberOf Hash * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function hashHas(key) { var data = this.__data__; return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); } module.exports = hashHas; /***/ }), /* 92 */ /***/ (function(module, exports, __webpack_require__) { var nativeCreate = __webpack_require__(80); /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; /** * Sets the hash `key` to `value`. * * @private * @name set * @memberOf Hash * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the hash instance. */ function hashSet(key, value) { var data = this.__data__; this.size += this.has(key) ? 0 : 1; data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; return this; } module.exports = hashSet; /***/ }), /* 93 */ /***/ (function(module, exports, __webpack_require__) { var listCacheClear = __webpack_require__(94), listCacheDelete = __webpack_require__(95), listCacheGet = __webpack_require__(98), listCacheHas = __webpack_require__(99), listCacheSet = __webpack_require__(100); /** * Creates an list cache object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function ListCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } // Add methods to `ListCache`. ListCache.prototype.clear = listCacheClear; ListCache.prototype['delete'] = listCacheDelete; ListCache.prototype.get = listCacheGet; ListCache.prototype.has = listCacheHas; ListCache.prototype.set = listCacheSet; module.exports = ListCache; /***/ }), /* 94 */ /***/ (function(module, exports) { /** * Removes all key-value entries from the list cache. * * @private * @name clear * @memberOf ListCache */ function listCacheClear() { this.__data__ = []; this.size = 0; } module.exports = listCacheClear; /***/ }), /* 95 */ /***/ (function(module, exports, __webpack_require__) { var assocIndexOf = __webpack_require__(96); /** Used for built-in method references. */ var arrayProto = Array.prototype; /** Built-in value references. */ var splice = arrayProto.splice; /** * Removes `key` and its value from the list cache. * * @private * @name delete * @memberOf ListCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function listCacheDelete(key) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { return false; } var lastIndex = data.length - 1; if (index == lastIndex) { data.pop(); } else { splice.call(data, index, 1); } --this.size; return true; } module.exports = listCacheDelete; /***/ }), /* 96 */ /***/ (function(module, exports, __webpack_require__) { var eq = __webpack_require__(97); /** * Gets the index at which the `key` is found in `array` of key-value pairs. * * @private * @param {Array} array The array to inspect. * @param {*} key The key to search for. * @returns {number} Returns the index of the matched value, else `-1`. */ function assocIndexOf(array, key) { var length = array.length; while (length--) { if (eq(array[length][0], key)) { return length; } } return -1; } module.exports = assocIndexOf; /***/ }), /* 97 */ /***/ (function(module, exports) { /** * Performs a * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * comparison between two values to determine if they are equivalent. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.eq(object, object); * // => true * * _.eq(object, other); * // => false * * _.eq('a', 'a'); * // => true * * _.eq('a', Object('a')); * // => false * * _.eq(NaN, NaN); * // => true */ function eq(value, other) { return value === other || (value !== value && other !== other); } module.exports = eq; /***/ }), /* 98 */ /***/ (function(module, exports, __webpack_require__) { var assocIndexOf = __webpack_require__(96); /** * Gets the list cache value for `key`. * * @private * @name get * @memberOf ListCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function listCacheGet(key) { var data = this.__data__, index = assocIndexOf(data, key); return index < 0 ? undefined : data[index][1]; } module.exports = listCacheGet; /***/ }), /* 99 */ /***/ (function(module, exports, __webpack_require__) { var assocIndexOf = __webpack_require__(96); /** * Checks if a list cache value for `key` exists. * * @private * @name has * @memberOf ListCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function listCacheHas(key) { return assocIndexOf(this.__data__, key) > -1; } module.exports = listCacheHas; /***/ }), /* 100 */ /***/ (function(module, exports, __webpack_require__) { var assocIndexOf = __webpack_require__(96); /** * Sets the list cache `key` to `value`. * * @private * @name set * @memberOf ListCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the list cache instance. */ function listCacheSet(key, value) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { ++this.size; data.push([key, value]); } else { data[index][1] = value; } return this; } module.exports = listCacheSet; /***/ }), /* 101 */ /***/ (function(module, exports, __webpack_require__) { var getNative = __webpack_require__(81), root = __webpack_require__(8); /* Built-in method references that are verified to be native. */ var Map = getNative(root, 'Map'); module.exports = Map; /***/ }), /* 102 */ /***/ (function(module, exports, __webpack_require__) { var getMapData = __webpack_require__(103); /** * Removes `key` and its value from the map. * * @private * @name delete * @memberOf MapCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function mapCacheDelete(key) { var result = getMapData(this, key)['delete'](key); this.size -= result ? 1 : 0; return result; } module.exports = mapCacheDelete; /***/ }), /* 103 */ /***/ (function(module, exports, __webpack_require__) { var isKeyable = __webpack_require__(104); /** * Gets the data for `map`. * * @private * @param {Object} map The map to query. * @param {string} key The reference key. * @returns {*} Returns the map data. */ function getMapData(map, key) { var data = map.__data__; return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map; } module.exports = getMapData; /***/ }), /* 104 */ /***/ (function(module, exports) { /** * Checks if `value` is suitable for use as unique object key. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is suitable, else `false`. */ function isKeyable(value) { var type = typeof value; return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') ? (value !== '__proto__') : (value === null); } module.exports = isKeyable; /***/ }), /* 105 */ /***/ (function(module, exports, __webpack_require__) { var getMapData = __webpack_require__(103); /** * Gets the map value for `key`. * * @private * @name get * @memberOf MapCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function mapCacheGet(key) { return getMapData(this, key).get(key); } module.exports = mapCacheGet; /***/ }), /* 106 */ /***/ (function(module, exports, __webpack_require__) { var getMapData = __webpack_require__(103); /** * Checks if a map value for `key` exists. * * @private * @name has * @memberOf MapCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function mapCacheHas(key) { return getMapData(this, key).has(key); } module.exports = mapCacheHas; /***/ }), /* 107 */ /***/ (function(module, exports, __webpack_require__) { var getMapData = __webpack_require__(103); /** * Sets the map `key` to `value`. * * @private * @name set * @memberOf MapCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the map cache instance. */ function mapCacheSet(key, value) { var data = getMapData(this, key), size = data.size; data.set(key, value); this.size += data.size == size ? 0 : 1; return this; } module.exports = mapCacheSet; /***/ }), /* 108 */ /***/ (function(module, exports, __webpack_require__) { var baseToString = __webpack_require__(109); /** * Converts `value` to a string. An empty string is returned for `null` * and `undefined` values. The sign of `-0` is preserved. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {string} Returns the converted string. * @example * * _.toString(null); * // => '' * * _.toString(-0); * // => '-0' * * _.toString([1, 2, 3]); * // => '1,2,3' */ function toString(value) { return value == null ? '' : baseToString(value); } module.exports = toString; /***/ }), /* 109 */ /***/ (function(module, exports, __webpack_require__) { var Symbol = __webpack_require__(7), arrayMap = __webpack_require__(110), isArray = __webpack_require__(70), isSymbol = __webpack_require__(72); /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0; /** Used to convert symbols to primitives and strings. */ var symbolProto = Symbol ? Symbol.prototype : undefined, symbolToString = symbolProto ? symbolProto.toString : undefined; /** * The base implementation of `_.toString` which doesn't convert nullish * values to empty strings. * * @private * @param {*} value The value to process. * @returns {string} Returns the string. */ function baseToString(value) { // Exit early for strings to avoid a performance hit in some environments. if (typeof value == 'string') { return value; } if (isArray(value)) { // Recursively convert values (susceptible to call stack limits). return arrayMap(value, baseToString) + ''; } if (isSymbol(value)) { return symbolToString ? symbolToString.call(value) : ''; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } module.exports = baseToString; /***/ }), /* 110 */ /***/ (function(module, exports) { /** * A specialized version of `_.map` for arrays without support for iteratee * shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function arrayMap(array, iteratee) { var index = -1, length = array == null ? 0 : array.length, result = Array(length); while (++index < length) { result[index] = iteratee(array[index], index, array); } return result; } module.exports = arrayMap; /***/ }), /* 111 */ /***/ (function(module, exports, __webpack_require__) { var isSymbol = __webpack_require__(72); /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0; /** * Converts `value` to a string key if it's not a string or symbol. * * @private * @param {*} value The value to inspect. * @returns {string|symbol} Returns the key. */ function toKey(value) { if (typeof value == 'string' || isSymbol(value)) { return value; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } module.exports = toKey; /***/ }), /* 112 */ /***/ (function(module, exports, __webpack_require__) { var baseSet = __webpack_require__(113); /** * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, * it's created. Arrays are created for missing index properties while objects * are created for all other missing properties. Use `_.setWith` to customize * `path` creation. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 3.7.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {*} value The value to set. * @returns {Object} Returns `object`. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.set(object, 'a[0].b.c', 4); * console.log(object.a[0].b.c); * // => 4 * * _.set(object, ['x', '0', 'y', 'z'], 5); * console.log(object.x[0].y.z); * // => 5 */ function set(object, path, value) { return object == null ? object : baseSet(object, path, value); } module.exports = set; /***/ }), /* 113 */ /***/ (function(module, exports, __webpack_require__) { var assignValue = __webpack_require__(114), castPath = __webpack_require__(69), isIndex = __webpack_require__(117), isObject = __webpack_require__(84), toKey = __webpack_require__(111); /** * The base implementation of `_.set`. * * @private * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {*} value The value to set. * @param {Function} [customizer] The function to customize path creation. * @returns {Object} Returns `object`. */ function baseSet(object, path, value, customizer) { if (!isObject(object)) { return object; } path = castPath(path, object); var index = -1, length = path.length, lastIndex = length - 1, nested = object; while (nested != null && ++index < length) { var key = toKey(path[index]), newValue = value; if (index != lastIndex) { var objValue = nested[key]; newValue = customizer ? customizer(objValue, key, nested) : undefined; if (newValue === undefined) { newValue = isObject(objValue) ? objValue : (isIndex(path[index + 1]) ? [] : {}); } } assignValue(nested, key, newValue); nested = nested[key]; } return object; } module.exports = baseSet; /***/ }), /* 114 */ /***/ (function(module, exports, __webpack_require__) { var baseAssignValue = __webpack_require__(115), eq = __webpack_require__(97); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Assigns `value` to `key` of `object` if the existing value is not equivalent * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function assignValue(object, key, value) { var objValue = object[key]; if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || (value === undefined && !(key in object))) { baseAssignValue(object, key, value); } } module.exports = assignValue; /***/ }), /* 115 */ /***/ (function(module, exports, __webpack_require__) { var defineProperty = __webpack_require__(116); /** * The base implementation of `assignValue` and `assignMergeValue` without * value checks. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function baseAssignValue(object, key, value) { if (key == '__proto__' && defineProperty) { defineProperty(object, key, { 'configurable': true, 'enumerable': true, 'value': value, 'writable': true }); } else { object[key] = value; } } module.exports = baseAssignValue; /***/ }), /* 116 */ /***/ (function(module, exports, __webpack_require__) { var getNative = __webpack_require__(81); var defineProperty = (function() { try { var func = getNative(Object, 'defineProperty'); func({}, '', {}); return func; } catch (e) {} }()); module.exports = defineProperty; /***/ }), /* 117 */ /***/ (function(module, exports) { /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991; /** Used to detect unsigned integer values. */ var reIsUint = /^(?:0|[1-9]\d*)$/; /** * Checks if `value` is a valid array-like index. * * @private * @param {*} value The value to check. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ function isIndex(value, length) { length = length == null ? MAX_SAFE_INTEGER : length; return !!length && (typeof value == 'number' || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length); } module.exports = isIndex; /***/ }), /* 118 */ /***/ (function(module, exports) { /***/ }), /* 119 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {// Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // resolves . and .. elements in a path array with directory names there // must be no slashes, empty elements, or device names (c:\) in the array // (so also no leading and trailing slashes - it does not distinguish // relative and absolute paths) function normalizeArray(parts, allowAboveRoot) { // if the path tries to go above the root, `up` ends up > 0 var up = 0; for (var i = parts.length - 1; i >= 0; i--) { var last = parts[i]; if (last === '.') { parts.splice(i, 1); } else if (last === '..') { parts.splice(i, 1); up++; } else if (up) { parts.splice(i, 1); up--; } } // if the path is allowed to go above the root, restore leading ..s if (allowAboveRoot) { for (; up--; up) { parts.unshift('..'); } } return parts; } // Split a filename into [root, dir, basename, ext], unix version // 'root' is just a slash, or nothing. var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; var splitPath = function(filename) { return splitPathRe.exec(filename).slice(1); }; // path.resolve([from ...], to) // posix version exports.resolve = function() { var resolvedPath = '', resolvedAbsolute = false; for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { var path = (i >= 0) ? arguments[i] : process.cwd(); // Skip empty and invalid entries if (typeof path !== 'string') { throw new TypeError('Arguments to path.resolve must be strings'); } else if (!path) { continue; } resolvedPath = path + '/' + resolvedPath; resolvedAbsolute = path.charAt(0) === '/'; } // At this point the path should be resolved to a full absolute path, but // handle relative paths to be safe (might happen when process.cwd() fails) // Normalize the path resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) { return !!p; }), !resolvedAbsolute).join('/'); return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; }; // path.normalize(path) // posix version exports.normalize = function(path) { var isAbsolute = exports.isAbsolute(path), trailingSlash = substr(path, -1) === '/'; // Normalize the path path = normalizeArray(filter(path.split('/'), function(p) { return !!p; }), !isAbsolute).join('/'); if (!path && !isAbsolute) { path = '.'; } if (path && trailingSlash) { path += '/'; } return (isAbsolute ? '/' : '') + path; }; // posix version exports.isAbsolute = function(path) { return path.charAt(0) === '/'; }; // posix version exports.join = function() { var paths = Array.prototype.slice.call(arguments, 0); return exports.normalize(filter(paths, function(p, index) { if (typeof p !== 'string') { throw new TypeError('Arguments to path.join must be strings'); } return p; }).join('/')); }; // path.relative(from, to) // posix version exports.relative = function(from, to) { from = exports.resolve(from).substr(1); to = exports.resolve(to).substr(1); function trim(arr) { var start = 0; for (; start < arr.length; start++) { if (arr[start] !== '') break; } var end = arr.length - 1; for (; end >= 0; end--) { if (arr[end] !== '') break; } if (start > end) return []; return arr.slice(start, end - start + 1); } var fromParts = trim(from.split('/')); var toParts = trim(to.split('/')); var length = Math.min(fromParts.length, toParts.length); var samePartsLength = length; for (var i = 0; i < length; i++) { if (fromParts[i] !== toParts[i]) { samePartsLength = i; break; } } var outputParts = []; for (var i = samePartsLength; i < fromParts.length; i++) { outputParts.push('..'); } outputParts = outputParts.concat(toParts.slice(samePartsLength)); return outputParts.join('/'); }; exports.sep = '/'; exports.delimiter = ':'; exports.dirname = function(path) { var result = splitPath(path), root = result[0], dir = result[1]; if (!root && !dir) { // No dirname whatsoever return '.'; } if (dir) { // It has a dirname, strip trailing slash dir = dir.substr(0, dir.length - 1); } return root + dir; }; exports.basename = function(path, ext) { var f = splitPath(path)[2]; // TODO: make this comparison case-insensitive on windows? if (ext && f.substr(-1 * ext.length) === ext) { f = f.substr(0, f.length - ext.length); } return f; }; exports.extname = function(path) { return splitPath(path)[3]; }; function filter (xs, f) { if (xs.filter) return xs.filter(f); var res = []; for (var i = 0; i < xs.length; i++) { if (f(xs[i], i, xs)) res.push(xs[i]); } return res; } // String.prototype.substr - negative index don't work in IE8 var substr = 'ab'.substr(-1) === 'b' ? function (str, start, len) { return str.substr(start, len) } : function (str, start, len) { if (start < 0) start = str.length + start; return str.substr(start, len); } ; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(120))) /***/ }), /* 120 */ /***/ (function(module, exports) { // shim for using process in browser var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it // don't break things. But we need to wrap it in a try catch in case it is // wrapped in strict mode code which doesn't define any globals. It's inside a // function because try/catches deoptimize in certain engines. var cachedSetTimeout; var cachedClearTimeout; function defaultSetTimout() { throw new Error('setTimeout has not been defined'); } function defaultClearTimeout () { throw new Error('clearTimeout has not been defined'); } (function () { try { if (typeof setTimeout === 'function') { cachedSetTimeout = setTimeout; } else { cachedSetTimeout = defaultSetTimout; } } catch (e) { cachedSetTimeout = defaultSetTimout; } try { if (typeof clearTimeout === 'function') { cachedClearTimeout = clearTimeout; } else { cachedClearTimeout = defaultClearTimeout; } } catch (e) { cachedClearTimeout = defaultClearTimeout; } } ()) function runTimeout(fun) { if (cachedSetTimeout === setTimeout) { //normal enviroments in sane situations return setTimeout(fun, 0); } // if setTimeout wasn't available but was latter defined if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { cachedSetTimeout = setTimeout; return setTimeout(fun, 0); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedSetTimeout(fun, 0); } catch(e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedSetTimeout.call(null, fun, 0); } catch(e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) { //normal enviroments in sane situations return clearTimeout(marker); } // if clearTimeout wasn't available but was latter defined if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { cachedClearTimeout = clearTimeout; return clearTimeout(marker); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedClearTimeout(marker); } catch (e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedClearTimeout.call(null, marker); } catch (e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. // Some versions of I.E. have different rules for clearTimeout vs setTimeout return cachedClearTimeout.call(this, marker); } } } var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; while(len) { currentQueue = queue; queue = []; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; runClearTimeout(timeout); } process.nextTick = function (fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { runTimeout(drainQueue); } }; // v8 likes predictible objects function Item(fun, array) { this.fun = fun; this.array = array; } Item.prototype.run = function () { this.fun.apply(null, this.array); }; process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; process.version = ''; // empty string to avoid regexp issues process.versions = {}; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.prependListener = noop; process.prependOnceListener = noop; process.listeners = function (name) { return [] } process.binding = function (name) { throw new Error('process.binding is not supported'); }; process.cwd = function () { return '/' }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; process.umask = function() { return 0; }; /***/ }), /* 121 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // If obj.hasOwnProperty has been overridden, then calling // obj.hasOwnProperty(prop) will break. // See: https://github.com/joyent/node/issues/1707 function hasOwnProperty(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } module.exports = function(qs, sep, eq, options) { sep = sep || '&'; eq = eq || '='; var obj = {}; if (typeof qs !== 'string' || qs.length === 0) { return obj; } var regexp = /\+/g; qs = qs.split(sep); var maxKeys = 1000; if (options && typeof options.maxKeys === 'number') { maxKeys = options.maxKeys; } var len = qs.length; // maxKeys <= 0 means that we should not limit keys count if (maxKeys > 0 && len > maxKeys) { len = maxKeys; } for (var i = 0; i < len; ++i) { var x = qs[i].replace(regexp, '%20'), idx = x.indexOf(eq), kstr, vstr, k, v; if (idx >= 0) { kstr = x.substr(0, idx); vstr = x.substr(idx + 1); } else { kstr = x; vstr = ''; } k = decodeURIComponent(kstr); v = decodeURIComponent(vstr); if (!hasOwnProperty(obj, k)) { obj[k] = v; } else if (isArray(obj[k])) { obj[k].push(v); } else { obj[k] = [obj[k], v]; } } return obj; }; var isArray = Array.isArray || function (xs) { return Object.prototype.toString.call(xs) === '[object Array]'; }; /***/ }), /* 122 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. var stringifyPrimitive = function(v) { switch (typeof v) { case 'string': return v; case 'boolean': return v ? 'true' : 'false'; case 'number': return isFinite(v) ? v : ''; default: return ''; } }; module.exports = function(obj, sep, eq, name) { sep = sep || '&'; eq = eq || '='; if (obj === null) { obj = undefined; } if (typeof obj === 'object') { return map(objectKeys(obj), function(k) { var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; if (isArray(obj[k])) { return map(obj[k], function(v) { return ks + encodeURIComponent(stringifyPrimitive(v)); }).join(sep); } else { return ks + encodeURIComponent(stringifyPrimitive(obj[k])); } }).join(sep); } if (!name) return ''; return encodeURIComponent(stringifyPrimitive(name)) + eq + encodeURIComponent(stringifyPrimitive(obj)); }; var isArray = Array.isArray || function (xs) { return Object.prototype.toString.call(xs) === '[object Array]'; }; function map (xs, f) { if (xs.map) return xs.map(f); var res = []; for (var i = 0; i < xs.length; i++) { res.push(f(xs[i], i)); } return res; } var objectKeys = Object.keys || function (obj) { var res = []; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key); } return res; }; /***/ }), /* 123 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Symbol_js__ = __webpack_require__(34); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getRawTag_js__ = __webpack_require__(127); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__objectToString_js__ = __webpack_require__(128); /** `Object#toString` result references. */ var nullTag = '[object Null]', undefinedTag = '[object Undefined]'; /** Built-in value references. */ var symToStringTag = __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */] ? __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */].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)) ? Object(__WEBPACK_IMPORTED_MODULE_1__getRawTag_js__["a" /* default */])(value) : Object(__WEBPACK_IMPORTED_MODULE_2__objectToString_js__["a" /* default */])(value); } /* harmony default export */ __webpack_exports__["a"] = (baseGetTag); /***/ }), /* 124 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__freeGlobal_js__ = __webpack_require__(125); /** Detect free variable `self`. */ var freeSelf = typeof self == 'object' && self && self.Object === Object && self; /** Used as a reference to the global object. */ var root = __WEBPACK_IMPORTED_MODULE_0__freeGlobal_js__["a" /* default */] || freeSelf || Function('return this')(); /* harmony default export */ __webpack_exports__["a"] = (root); /***/ }), /* 125 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; /* harmony default export */ __webpack_exports__["a"] = (freeGlobal); /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(792))) /***/ }), /* 126 */, /* 127 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Symbol_js__ = __webpack_require__(34); /** 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 = __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */] ? __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */].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; } /* harmony default export */ __webpack_exports__["a"] = (getRawTag); /***/ }), /* 128 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /** 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); } /* harmony default export */ __webpack_exports__["a"] = (objectToString); /***/ }), /* 129 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__overArg_js__ = __webpack_require__(130); /** Built-in value references. */ var getPrototype = Object(__WEBPACK_IMPORTED_MODULE_0__overArg_js__["a" /* default */])(Object.getPrototypeOf, Object); /* harmony default export */ __webpack_exports__["a"] = (getPrototype); /***/ }), /* 130 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /** * 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)); }; } /* harmony default export */ __webpack_exports__["a"] = (overArg); /***/ }), /* 131 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var updateConfig = (() => { var _ref = _asyncToGenerator(function* () { var response = yield fetch("/getconfig", { method: "get" }); var config = yield response.json(); setConfig(config); return config; }); return function updateConfig() { return _ref.apply(this, arguments); }; })(); var initApp = (() => { var _ref2 = _asyncToGenerator(function* () { var configureStore = __webpack_require__(132); var reducers = __webpack_require__(143); var LaunchpadApp = __webpack_require__(149); var createStore = configureStore({ log: getValue("logging.actions"), makeThunkArgs: function (args, state) { return Object.assign({}, args, {}); } }); var store = createStore(combineReducers(reducers)); var actions = bindActionCreators(__webpack_require__(181), store.dispatch); debugGlobal("launchpadStore", store); if (isDevelopment()) { var config = yield updateConfig(); actions.setConfig(config); // AppConstants.DEBUG_JS_MODULES = true; } return { store, actions, LaunchpadApp }; }); return function initApp() { return _ref2.apply(this, arguments); }; })(); var connectClients = (() => { var _ref3 = _asyncToGenerator(function* (actions) { var firefoxTabs = yield firefox.connectClient(); actions.newTabs(firefoxTabs); chrome.connectClient().then(actions.newTabs); chrome.connectNodeClient().then(actions.newTabs); }); return function connectClients(_x) { return _ref3.apply(this, arguments); }; })(); var getTabs = (() => { var _ref4 = _asyncToGenerator(function* (actions) { var firefoxTabs = yield firefox.connectClient(); var chromeTabs = yield chrome.connectClient(); var nodeTabs = yield chrome.connectNodeClient(); actions.clearTabs(); actions.newTabs(firefoxTabs); actions.newTabs(chromeTabs); actions.newTabs(nodeTabs); }); return function getTabs(_x2) { return _ref4.apply(this, arguments); }; })(); var bootstrap = (() => { var _ref5 = _asyncToGenerator(function* (React, ReactDOM) { var connTarget = getTargetFromQuery(); if (connTarget) { var _ref6 = yield startDebugging(connTarget), tab = _ref6.tab, tabConnection = _ref6.tabConnection; yield updateConfig(); return { tab, connTarget, tabConnection }; } var _ref7 = yield initApp(), store = _ref7.store, actions = _ref7.actions, LaunchpadApp = _ref7.LaunchpadApp; renderRoot(React, ReactDOM, LaunchpadApp, store); yield connectClients(actions); setInterval(_asyncToGenerator(function* () { return yield getTabs(actions); }), 3000); return undefined; }); return function bootstrap(_x3, _x4) { return _ref5.apply(this, arguments); }; })(); function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* global window, document, DebuggerConfig */ var _require = __webpack_require__(3), bindActionCreators = _require.bindActionCreators, combineReducers = _require.combineReducers; var _require2 = __webpack_require__(1189), Provider = _require2.Provider; var _require3 = __webpack_require__(137), defer = _require3.defer; var _require4 = __webpack_require__(184), debugGlobal = _require4.debugGlobal; var _require5 = __webpack_require__(828), setConfig = _require5.setConfig, getValue = _require5.getValue, isDevelopment = _require5.isDevelopment; var L10N = __webpack_require__(185); var _require6 = __webpack_require__(1130), showMenu = _require6.showMenu, buildMenu = _require6.buildMenu; setConfig({"environment":"firefox-panel","logging":false,"clientLogging":false,"firefox":{"mcPath":"./firefox"},"workers":{"parserURL":"resource://devtools/client/debugger/new/parser-worker.js","prettyPrintURL":"resource://devtools/client/debugger/new/pretty-print-worker.js","searchURL":"resource://devtools/client/debugger/new/search-worker.js"},"features":{"blackbox":{"enabled":true},"chromeScopes":{"enabled":false},"eventListeners":{"enabled":false},"codeCoverage":{"enabled":false},"codeFolding":{"enabled":false},"searchNav":{"enabled":true},"collapseFrame":{"enabled":true},"outline":{"enabled":true}}}); // Set various flags before requiring app code. if (getValue("logging.client")) { // DevToolsUtils.dumpn.wantLogging = true; } var _require7 = __webpack_require__(885), firefox = _require7.firefox, chrome = _require7.chrome, startDebugging = _require7.startDebugging; var Root = __webpack_require__(186); // Using this static variable allows webpack to know at compile-time // to avoid this require and not include it at all in the output. if (false) { require("devtools-modules/src/themes/light-theme.css"); require("devtools-modules/src/themes/dark-theme.css"); require("devtools-modules/src/themes/firebug-theme.css"); } function updateTheme() { if (false) { var theme = getValue("theme"); var root = document.body.parentNode; var appRoot = document.querySelector(".launchpad-root"); root.className = ""; appRoot.className = "launchpad-root"; root.classList.add(`theme-${theme}`); appRoot.classList.add(`theme-${theme}`); } } function updateDir() { var dir = getValue("dir"); var root = document.body.parentNode; root.dir = dir; } function renderRoot(_React, _ReactDOM, component, _store) { var createElement = _React.createElement; var mount = document.querySelector("#mount"); // bail in test environments that do not have a mount if (!mount) { return; } var root = Root("launchpad-root theme-body"); mount.appendChild(root); if (isDevelopment()) { updateConfig(); updateTheme(); } if (component.props || component.propTypes) { _ReactDOM.render(createElement(Provider, { store: _store }, createElement(component)), root); } else { root.appendChild(component); } } function unmountRoot(_ReactDOM) { var mount = document.querySelector("#mount .launchpad-root"); _ReactDOM.unmountComponentAtNode(mount); } function getTargetFromQuery() { var href = window.location.href; var nodeMatch = href.match(/node-tab=([^&#]*)/); var firefoxMatch = href.match(/firefox-tab=([^&#]*)/); var chromeMatch = href.match(/chrome-tab=([^&#]*)/); if (nodeMatch) { return { type: "node", param: nodeMatch[1] }; } else if (firefoxMatch) { return { type: "firefox", param: firefoxMatch[1] }; } else if (chromeMatch) { return { type: "chrome", param: chromeMatch[1] }; } return null; } module.exports = { bootstrap, buildMenu, debugGlobal, defer, renderRoot, L10N, showMenu, unmountRoot, updateTheme, updateDir }; /***/ }), /* 132 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* global window */ var _require = __webpack_require__(3), createStore = _require.createStore, applyMiddleware = _require.applyMiddleware; var _require2 = __webpack_require__(133), waitUntilService = _require2.waitUntilService; var _require3 = __webpack_require__(134), log = _require3.log; var _require4 = __webpack_require__(135), history = _require4.history; var _require5 = __webpack_require__(136), promise = _require5.promise; var _require6 = __webpack_require__(142), thunk = _require6.thunk; /** * This creates a dispatcher with all the standard middleware in place * that all code requires. It can also be optionally configured in * various ways, such as logging and recording. * * @param {object} opts: * - log: log all dispatched actions to console * - history: an array to store every action in. Should only be * used in tests. * - middleware: array of middleware to be included in the redux store */ var configureStore = function () { var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var middleware = [thunk(opts.makeThunkArgs), promise, // Order is important: services must go last as they always // operate on "already transformed" actions. Actions going through // them shouldn't have any special fields like promises, they // should just be normal JSON objects. waitUntilService]; if (opts.history) { middleware.push(history(opts.history)); } if (opts.middleware) { opts.middleware.forEach(fn => middleware.push(fn)); } if (opts.log) { middleware.push(log); } // Hook in the redux devtools browser extension if it exists var devtoolsExt = typeof window === "object" && window.devToolsExtension ? window.devToolsExtension() : f => f; return applyMiddleware.apply(undefined, middleware)(devtoolsExt(createStore)); }; module.exports = configureStore; /***/ }), /* 133 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /** * A middleware which acts like a service, because it is stateful * and "long-running" in the background. It provides the ability * for actions to install a function to be run once when a specific * condition is met by an action coming through the system. Think of * it as a thunk that blocks until the condition is met. Example: * * ```js * const services = { WAIT_UNTIL: require('wait-service').NAME }; * * { type: services.WAIT_UNTIL, * predicate: action => action.type === constants.ADD_ITEM, * run: (dispatch, getState, action) => { * // Do anything here. You only need to accept the arguments * // if you need them. `action` is the action that satisfied * // the predicate. * } * } * ``` */ var NAME = exports.NAME = "@@service/waitUntil"; function waitUntilService(_ref) { var dispatch = _ref.dispatch, getState = _ref.getState; var pending = []; function checkPending(action) { var readyRequests = []; var stillPending = []; // Find the pending requests whose predicates are satisfied with // this action. Wait to run the requests until after we update the // pending queue because the request handler may synchronously // dispatch again and run this service (that use case is // completely valid). for (var request of pending) { if (request.predicate(action)) { readyRequests.push(request); } else { stillPending.push(request); } } pending = stillPending; for (var _request of readyRequests) { _request.run(dispatch, getState, action); } } return next => action => { if (action.type === NAME) { pending.push(action); return null; } var result = next(action); checkPending(action); return result; }; } exports.waitUntilService = waitUntilService; /***/ }), /* 134 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /** * A middleware that logs all actions coming through the system * to the console. */ function log(_ref) { var dispatch = _ref.dispatch, getState = _ref.getState; return next => action => { var actionText = JSON.stringify(action, null, 2); var truncatedActionText = `${actionText.slice(0, 1000)}...`; console.log(`[DISPATCH ${action.type}]`, action, truncatedActionText); next(action); }; } exports.log = log; /***/ }), /* 135 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var _require = __webpack_require__(828), isDevelopment = _require.isDevelopment; /** * A middleware that stores every action coming through the store in the passed * in logging object. Should only be used for tests, as it collects all * action information, which will cause memory bloat. */ exports.history = function () { var log = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; return (_ref) => { var dispatch = _ref.dispatch, getState = _ref.getState; if (isDevelopment()) { console.warn("Using history middleware stores all actions in state for " + "testing and devtools is not currently running in test " + "mode. Be sure this is intentional."); } return next => action => { log.push(action); next(action); }; }; }; /***/ }), /* 136 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var _require = __webpack_require__(137), defer = _require.defer; var _require2 = __webpack_require__(138), entries = _require2.entries, toObject = _require2.toObject; var _require3 = __webpack_require__(140), executeSoon = _require3.executeSoon; var PROMISE = exports.PROMISE = "@@dispatch/promise"; var seqIdVal = 1; function seqIdGen() { return seqIdVal++; } function promiseMiddleware(_ref) { var dispatch = _ref.dispatch, getState = _ref.getState; return next => action => { if (!(PROMISE in action)) { return next(action); } var promiseInst = action[PROMISE]; var seqId = seqIdGen().toString(); // Create a new action that doesn't have the promise field and has // the `seqId` field that represents the sequence id action = Object.assign(toObject(entries(action).filter(pair => pair[0] !== PROMISE)), { seqId }); dispatch(Object.assign({}, action, { status: "start" })); // Return the promise so action creators can still compose if they // want to. var deferred = defer(); promiseInst.then(value => { executeSoon(() => { dispatch(Object.assign({}, action, { status: "done", value: value })); deferred.resolve(value); }); }, error => { executeSoon(() => { dispatch(Object.assign({}, action, { status: "error", error: error.message || error })); deferred.reject(error); }); }); return deferred.promise; }; } exports.promise = promiseMiddleware; /***/ }), /* 137 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /** * Returns a deferred object, with a resolve and reject property. * https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/Promise.jsm/Deferred */ module.exports = function defer() { var resolve = void 0, reject = void 0; var promise = new Promise(function () { resolve = arguments[0]; reject = arguments[1]; }); return { resolve: resolve, reject: reject, promise: promise }; }; /***/ }), /* 138 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); 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); } } /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ /* vim: set ft=javascript ts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var co = __webpack_require__(965); function asPaused(client, func) { if (client.state != "paused") { return co(function* () { yield client.interrupt(); var result = void 0; try { result = yield func(); } catch (e) { // Try to put the debugger back in a working state by resuming // it yield client.resume(); throw e; } yield client.resume(); return result; }); } return func(); } function handleError(err) { console.log("ERROR: ", err); } function promisify(context, method) { for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { args[_key - 2] = arguments[_key]; } return new Promise((resolve, reject) => { args.push(response => { if (response.error) { reject(response); } else { resolve(response); } }); method.apply(context, args); }); } function truncateStr(str, size) { if (str.length > size) { return `${str.slice(0, size)}...`; } return str; } function endTruncateStr(str, size) { if (str.length > size) { return `...${str.slice(str.length - size)}`; } return str; } var msgId = 1; function workerTask(worker, method) { return function () { for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } return new Promise((resolve, reject) => { var id = msgId++; worker.postMessage({ id, method, args }); var listener = (_ref) => { var result = _ref.data; if (result.id !== id) { return; } worker.removeEventListener("message", listener); if (result.error) { reject(result.error); } else { resolve(result.response); } }; worker.addEventListener("message", listener); }); }; } /** * Interleaves two arrays element by element, returning the combined array, like * a zip. In the case of arrays with different sizes, undefined values will be * interleaved at the end along with the extra values of the larger array. * * @param Array a * @param Array b * @returns Array * The combined array, in the form [a1, b1, a2, b2, ...] */ function zip(a, b) { if (!b) { return a; } if (!a) { return b; } var pairs = []; for (var i = 0, aLength = a.length, bLength = b.length; i < aLength || i < bLength; i++) { pairs.push([a[i], b[i]]); } return pairs; } /** * Converts an object into an array with 2-element arrays as key/value * pairs of the object. `{ foo: 1, bar: 2}` would become * `[[foo, 1], [bar 2]]` (order not guaranteed); * * @param object obj * @returns array */ function entries(obj) { return Object.keys(obj).map(k => [k, obj[k]]); } function mapObject(obj, iteratee) { return toObject(entries(obj).map((_ref2) => { var _ref3 = _slicedToArray(_ref2, 2), key = _ref3[0], value = _ref3[1]; return [key, iteratee(key, value)]; })); } /** * Takes an array of 2-element arrays as key/values pairs and * constructs an object using them. */ function toObject(arr) { var obj = {}; for (var pair of arr) { obj[pair[0]] = pair[1]; } return obj; } /** * Composes the given functions into a single function, which will * apply the results of each function right-to-left, starting with * applying the given arguments to the right-most function. * `compose(foo, bar, baz)` === `args => foo(bar(baz(args)` * * @param ...function funcs * @returns function */ function compose() { for (var _len3 = arguments.length, funcs = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { funcs[_key3] = arguments[_key3]; } return function () { for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { args[_key4] = arguments[_key4]; } var initialValue = funcs[funcs.length - 1].apply(null, args); var leftFuncs = funcs.slice(0, -1); return leftFuncs.reduceRight((composed, f) => f(composed), initialValue); }; } function updateObj(obj, fields) { return Object.assign({}, obj, fields); } function throttle(func, ms) { var timeout = void 0, _this = void 0; return function () { for (var _len5 = arguments.length, args = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { args[_key5] = arguments[_key5]; } _this = this; if (!timeout) { timeout = setTimeout(() => { func.apply.apply(func, [_this].concat(_toConsumableArray(args))); timeout = null; }, ms); } }; } module.exports = { asPaused, handleError, promisify, truncateStr, endTruncateStr, workerTask, zip, entries, toObject, mapObject, compose, updateObj, throttle }; /***/ }), /* 139 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /** * 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'; } /* harmony default export */ __webpack_exports__["a"] = (isObjectLike); /***/ }), /* 140 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var assert = __webpack_require__(141); function reportException(who, exception) { var msg = `${who} threw an exception: `; console.error(msg, exception); } function executeSoon(fn) { setTimeout(fn, 0); } module.exports = { reportException, executeSoon, assert }; /***/ }), /* 141 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ function assert(condition, message) { if (!condition) { throw new Error(`Assertion failure: ${message}`); } } module.exports = assert; /***/ }), /* 142 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /** * A middleware that allows thunks (functions) to be dispatched. If * it's a thunk, it is called with an argument that contains * `dispatch`, `getState`, and any additional args passed in via the * middleware constructure. This allows the action to create multiple * actions (most likely asynchronously). */ function thunk(makeArgs) { return (_ref) => { var dispatch = _ref.dispatch, getState = _ref.getState; var args = { dispatch, getState }; return next => action => { return typeof action === "function" ? action(makeArgs ? makeArgs(args, getState()) : args) : next(action); }; }; } exports.thunk = thunk; /***/ }), /* 143 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var tabs = __webpack_require__(144); var config = __webpack_require__(148); module.exports = { tabs, config }; /***/ }), /* 144 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var constants = __webpack_require__(145); var Immutable = __webpack_require__(146); var fromJS = __webpack_require__(147); var initialState = fromJS({ tabs: {}, selectedTab: null, filterString: "" }); function update() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState; var action = arguments[1]; switch (action.type) { case constants.CLEAR_TABS: return state.setIn(["tabs"], Immutable.Map()).setIn(["selectedTab"], null); case constants.ADD_TABS: var tabs = action.value; if (!tabs) { return state; } return state.mergeIn(["tabs"], Immutable.Map(tabs.map(tab => { tab = Object.assign({}, tab, { id: getTabId(tab) }); return [tab.id, Immutable.Map(tab)]; }))); case constants.SELECT_TAB: var tabToSelect = state.getIn(["tabs", action.id]); return state.setIn(["selectedTab"], tabToSelect); case constants.FILTER_TABS: return state.setIn(["filterString"], action.value); } return state; } function getTabId(tab) { var id = tab.id; var isFirefox = tab.clientType == "firefox"; // NOTE: we're getting the last part of the actor because // we want to ignore the connection id if (isFirefox) { id = tab.id.split(".").pop(); } return id; } module.exports = update; /***/ }), /* 145 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ /* vim: set ft=javascript ts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var sidePanelItems = { Firefox: { name: "Firefox", clientType: "firefox", paramName: "firefox-tab", docsUrlPart: "firefox" }, Chrome: { name: "Chrome", clientType: "chrome", paramName: "chrome-tab", docsUrlPart: "chrome", isUnderConstruction: true }, Node: { name: "Node", clientType: "node", paramName: "node-tab", docsUrlPart: "node", isUnderConstruction: true }, Settings: { name: "Settings", clientType: "settings", paramName: "settings-tab", docsUrlPart: "settings" } }; module.exports = { CLEAR_TABS: "CLEAR_TABS", ADD_TABS: "ADD_TABS", SELECT_TAB: "SELECT_TAB", FILTER_TABS: "FILTER_TABS", SET_VALUE: "SET_VALUE", SET_CONFIG: "SET_CONFIG", sidePanelItems }; /***/ }), /* 146 */ /***/ (function(module, exports, __webpack_require__) { /** * Copyright (c) 2014-2015, 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. */ (function (global, factory) { true ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global.Immutable = factory()); }(this, function () { 'use strict';var SLICE$0 = Array.prototype.slice; function createClass(ctor, superClass) { if (superClass) { ctor.prototype = Object.create(superClass.prototype); } ctor.prototype.constructor = ctor; } function Iterable(value) { return isIterable(value) ? value : Seq(value); } createClass(KeyedIterable, Iterable); function KeyedIterable(value) { return isKeyed(value) ? value : KeyedSeq(value); } createClass(IndexedIterable, Iterable); function IndexedIterable(value) { return isIndexed(value) ? value : IndexedSeq(value); } createClass(SetIterable, Iterable); function SetIterable(value) { return isIterable(value) && !isAssociative(value) ? value : SetSeq(value); } function isIterable(maybeIterable) { return !!(maybeIterable && maybeIterable[IS_ITERABLE_SENTINEL]); } function isKeyed(maybeKeyed) { return !!(maybeKeyed && maybeKeyed[IS_KEYED_SENTINEL]); } function isIndexed(maybeIndexed) { return !!(maybeIndexed && maybeIndexed[IS_INDEXED_SENTINEL]); } function isAssociative(maybeAssociative) { return isKeyed(maybeAssociative) || isIndexed(maybeAssociative); } function isOrdered(maybeOrdered) { return !!(maybeOrdered && maybeOrdered[IS_ORDERED_SENTINEL]); } Iterable.isIterable = isIterable; Iterable.isKeyed = isKeyed; Iterable.isIndexed = isIndexed; Iterable.isAssociative = isAssociative; Iterable.isOrdered = isOrdered; Iterable.Keyed = KeyedIterable; Iterable.Indexed = IndexedIterable; Iterable.Set = SetIterable; var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@'; var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@'; var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@'; var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@'; // Used for setting prototype methods that IE8 chokes on. var DELETE = 'delete'; // Constants describing the size of trie nodes. var SHIFT = 5; // Resulted in best performance after ______? var SIZE = 1 << SHIFT; var MASK = SIZE - 1; // A consistent shared value representing "not set" which equals nothing other // than itself, and nothing that could be provided externally. var NOT_SET = {}; // Boolean references, Rough equivalent of `bool &`. var CHANGE_LENGTH = { value: false }; var DID_ALTER = { value: false }; function MakeRef(ref) { ref.value = false; return ref; } function SetRef(ref) { ref && (ref.value = true); } // A function which returns a value representing an "owner" for transient writes // to tries. The return value will only ever equal itself, and will not equal // the return of any subsequent call of this function. function OwnerID() {} // http://jsperf.com/copy-array-inline function arrCopy(arr, offset) { offset = offset || 0; var len = Math.max(0, arr.length - offset); var newArr = new Array(len); for (var ii = 0; ii < len; ii++) { newArr[ii] = arr[ii + offset]; } return newArr; } function ensureSize(iter) { if (iter.size === undefined) { iter.size = iter.__iterate(returnTrue); } return iter.size; } function wrapIndex(iter, index) { // This implements "is array index" which the ECMAString spec defines as: // // A String property name P is an array index if and only if // ToString(ToUint32(P)) is equal to P and ToUint32(P) is not equal // to 2^32−1. // // http://www.ecma-international.org/ecma-262/6.0/#sec-array-exotic-objects if (typeof index !== 'number') { var uint32Index = index >>> 0; // N >>> 0 is shorthand for ToUint32 if ('' + uint32Index !== index || uint32Index === 4294967295) { return NaN; } index = uint32Index; } return index < 0 ? ensureSize(iter) + index : index; } function returnTrue() { return true; } function wholeSlice(begin, end, size) { return (begin === 0 || (size !== undefined && begin <= -size)) && (end === undefined || (size !== undefined && end >= size)); } function resolveBegin(begin, size) { return resolveIndex(begin, size, 0); } function resolveEnd(end, size) { return resolveIndex(end, size, size); } function resolveIndex(index, size, defaultIndex) { return index === undefined ? defaultIndex : index < 0 ? Math.max(0, size + index) : size === undefined ? index : Math.min(size, index); } /* global Symbol */ var ITERATE_KEYS = 0; var ITERATE_VALUES = 1; var ITERATE_ENTRIES = 2; var REAL_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; var FAUX_ITERATOR_SYMBOL = '@@iterator'; var ITERATOR_SYMBOL = REAL_ITERATOR_SYMBOL || FAUX_ITERATOR_SYMBOL; function Iterator(next) { this.next = next; } Iterator.prototype.toString = function() { return '[Iterator]'; }; Iterator.KEYS = ITERATE_KEYS; Iterator.VALUES = ITERATE_VALUES; Iterator.ENTRIES = ITERATE_ENTRIES; Iterator.prototype.inspect = Iterator.prototype.toSource = function () { return this.toString(); } Iterator.prototype[ITERATOR_SYMBOL] = function () { return this; }; function iteratorValue(type, k, v, iteratorResult) { var value = type === 0 ? k : type === 1 ? v : [k, v]; iteratorResult ? (iteratorResult.value = value) : (iteratorResult = { value: value, done: false }); return iteratorResult; } function iteratorDone() { return { value: undefined, done: true }; } function hasIterator(maybeIterable) { return !!getIteratorFn(maybeIterable); } function isIterator(maybeIterator) { return maybeIterator && typeof maybeIterator.next === 'function'; } function getIterator(iterable) { var iteratorFn = getIteratorFn(iterable); return iteratorFn && iteratorFn.call(iterable); } function getIteratorFn(iterable) { var iteratorFn = iterable && ( (REAL_ITERATOR_SYMBOL && iterable[REAL_ITERATOR_SYMBOL]) || iterable[FAUX_ITERATOR_SYMBOL] ); if (typeof iteratorFn === 'function') { return iteratorFn; } } function isArrayLike(value) { return value && typeof value.length === 'number'; } createClass(Seq, Iterable); function Seq(value) { return value === null || value === undefined ? emptySequence() : isIterable(value) ? value.toSeq() : seqFromValue(value); } Seq.of = function(/*...values*/) { return Seq(arguments); }; Seq.prototype.toSeq = function() { return this; }; Seq.prototype.toString = function() { return this.__toString('Seq {', '}'); }; Seq.prototype.cacheResult = function() { if (!this._cache && this.__iterateUncached) { this._cache = this.entrySeq().toArray(); this.size = this._cache.length; } return this; }; // abstract __iterateUncached(fn, reverse) Seq.prototype.__iterate = function(fn, reverse) { return seqIterate(this, fn, reverse, true); }; // abstract __iteratorUncached(type, reverse) Seq.prototype.__iterator = function(type, reverse) { return seqIterator(this, type, reverse, true); }; createClass(KeyedSeq, Seq); function KeyedSeq(value) { return value === null || value === undefined ? emptySequence().toKeyedSeq() : isIterable(value) ? (isKeyed(value) ? value.toSeq() : value.fromEntrySeq()) : keyedSeqFromValue(value); } KeyedSeq.prototype.toKeyedSeq = function() { return this; }; createClass(IndexedSeq, Seq); function IndexedSeq(value) { return value === null || value === undefined ? emptySequence() : !isIterable(value) ? indexedSeqFromValue(value) : isKeyed(value) ? value.entrySeq() : value.toIndexedSeq(); } IndexedSeq.of = function(/*...values*/) { return IndexedSeq(arguments); }; IndexedSeq.prototype.toIndexedSeq = function() { return this; }; IndexedSeq.prototype.toString = function() { return this.__toString('Seq [', ']'); }; IndexedSeq.prototype.__iterate = function(fn, reverse) { return seqIterate(this, fn, reverse, false); }; IndexedSeq.prototype.__iterator = function(type, reverse) { return seqIterator(this, type, reverse, false); }; createClass(SetSeq, Seq); function SetSeq(value) { return ( value === null || value === undefined ? emptySequence() : !isIterable(value) ? indexedSeqFromValue(value) : isKeyed(value) ? value.entrySeq() : value ).toSetSeq(); } SetSeq.of = function(/*...values*/) { return SetSeq(arguments); }; SetSeq.prototype.toSetSeq = function() { return this; }; Seq.isSeq = isSeq; Seq.Keyed = KeyedSeq; Seq.Set = SetSeq; Seq.Indexed = IndexedSeq; var IS_SEQ_SENTINEL = '@@__IMMUTABLE_SEQ__@@'; Seq.prototype[IS_SEQ_SENTINEL] = true; createClass(ArraySeq, IndexedSeq); function ArraySeq(array) { this._array = array; this.size = array.length; } ArraySeq.prototype.get = function(index, notSetValue) { return this.has(index) ? this._array[wrapIndex(this, index)] : notSetValue; }; ArraySeq.prototype.__iterate = function(fn, reverse) { var array = this._array; var maxIndex = array.length - 1; for (var ii = 0; ii <= maxIndex; ii++) { if (fn(array[reverse ? maxIndex - ii : ii], ii, this) === false) { return ii + 1; } } return ii; }; ArraySeq.prototype.__iterator = function(type, reverse) { var array = this._array; var maxIndex = array.length - 1; var ii = 0; return new Iterator(function() {return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii, array[reverse ? maxIndex - ii++ : ii++])} ); }; createClass(ObjectSeq, KeyedSeq); function ObjectSeq(object) { var keys = Object.keys(object); this._object = object; this._keys = keys; this.size = keys.length; } ObjectSeq.prototype.get = function(key, notSetValue) { if (notSetValue !== undefined && !this.has(key)) { return notSetValue; } return this._object[key]; }; ObjectSeq.prototype.has = function(key) { return this._object.hasOwnProperty(key); }; ObjectSeq.prototype.__iterate = function(fn, reverse) { var object = this._object; var keys = this._keys; var maxIndex = keys.length - 1; for (var ii = 0; ii <= maxIndex; ii++) { var key = keys[reverse ? maxIndex - ii : ii]; if (fn(object[key], key, this) === false) { return ii + 1; } } return ii; }; ObjectSeq.prototype.__iterator = function(type, reverse) { var object = this._object; var keys = this._keys; var maxIndex = keys.length - 1; var ii = 0; return new Iterator(function() { var key = keys[reverse ? maxIndex - ii : ii]; return ii++ > maxIndex ? iteratorDone() : iteratorValue(type, key, object[key]); }); }; ObjectSeq.prototype[IS_ORDERED_SENTINEL] = true; createClass(IterableSeq, IndexedSeq); function IterableSeq(iterable) { this._iterable = iterable; this.size = iterable.length || iterable.size; } IterableSeq.prototype.__iterateUncached = function(fn, reverse) { if (reverse) { return this.cacheResult().__iterate(fn, reverse); } var iterable = this._iterable; var iterator = getIterator(iterable); var iterations = 0; if (isIterator(iterator)) { var step; while (!(step = iterator.next()).done) { if (fn(step.value, iterations++, this) === false) { break; } } } return iterations; }; IterableSeq.prototype.__iteratorUncached = function(type, reverse) { if (reverse) { return this.cacheResult().__iterator(type, reverse); } var iterable = this._iterable; var iterator = getIterator(iterable); if (!isIterator(iterator)) { return new Iterator(iteratorDone); } var iterations = 0; return new Iterator(function() { var step = iterator.next(); return step.done ? step : iteratorValue(type, iterations++, step.value); }); }; createClass(IteratorSeq, IndexedSeq); function IteratorSeq(iterator) { this._iterator = iterator; this._iteratorCache = []; } IteratorSeq.prototype.__iterateUncached = function(fn, reverse) { if (reverse) { return this.cacheResult().__iterate(fn, reverse); } var iterator = this._iterator; var cache = this._iteratorCache; var iterations = 0; while (iterations < cache.length) { if (fn(cache[iterations], iterations++, this) === false) { return iterations; } } var step; while (!(step = iterator.next()).done) { var val = step.value; cache[iterations] = val; if (fn(val, iterations++, this) === false) { break; } } return iterations; }; IteratorSeq.prototype.__iteratorUncached = function(type, reverse) { if (reverse) { return this.cacheResult().__iterator(type, reverse); } var iterator = this._iterator; var cache = this._iteratorCache; var iterations = 0; return new Iterator(function() { if (iterations >= cache.length) { var step = iterator.next(); if (step.done) { return step; } cache[iterations] = step.value; } return iteratorValue(type, iterations, cache[iterations++]); }); }; // # pragma Helper functions function isSeq(maybeSeq) { return !!(maybeSeq && maybeSeq[IS_SEQ_SENTINEL]); } var EMPTY_SEQ; function emptySequence() { return EMPTY_SEQ || (EMPTY_SEQ = new ArraySeq([])); } function keyedSeqFromValue(value) { var seq = Array.isArray(value) ? new ArraySeq(value).fromEntrySeq() : isIterator(value) ? new IteratorSeq(value).fromEntrySeq() : hasIterator(value) ? new IterableSeq(value).fromEntrySeq() : typeof value === 'object' ? new ObjectSeq(value) : undefined; if (!seq) { throw new TypeError( 'Expected Array or iterable object of [k, v] entries, '+ 'or keyed object: ' + value ); } return seq; } function indexedSeqFromValue(value) { var seq = maybeIndexedSeqFromValue(value); if (!seq) { throw new TypeError( 'Expected Array or iterable object of values: ' + value ); } return seq; } function seqFromValue(value) { var seq = maybeIndexedSeqFromValue(value) || (typeof value === 'object' && new ObjectSeq(value)); if (!seq) { throw new TypeError( 'Expected Array or iterable object of values, or keyed object: ' + value ); } return seq; } function maybeIndexedSeqFromValue(value) { return ( isArrayLike(value) ? new ArraySeq(value) : isIterator(value) ? new IteratorSeq(value) : hasIterator(value) ? new IterableSeq(value) : undefined ); } function seqIterate(seq, fn, reverse, useKeys) { var cache = seq._cache; if (cache) { var maxIndex = cache.length - 1; for (var ii = 0; ii <= maxIndex; ii++) { var entry = cache[reverse ? maxIndex - ii : ii]; if (fn(entry[1], useKeys ? entry[0] : ii, seq) === false) { return ii + 1; } } return ii; } return seq.__iterateUncached(fn, reverse); } function seqIterator(seq, type, reverse, useKeys) { var cache = seq._cache; if (cache) { var maxIndex = cache.length - 1; var ii = 0; return new Iterator(function() { var entry = cache[reverse ? maxIndex - ii : ii]; return ii++ > maxIndex ? iteratorDone() : iteratorValue(type, useKeys ? entry[0] : ii - 1, entry[1]); }); } return seq.__iteratorUncached(type, reverse); } function fromJS(json, converter) { return converter ? fromJSWith(converter, json, '', {'': json}) : fromJSDefault(json); } function fromJSWith(converter, json, key, parentJSON) { if (Array.isArray(json)) { return converter.call(parentJSON, key, IndexedSeq(json).map(function(v, k) {return fromJSWith(converter, v, k, json)})); } if (isPlainObj(json)) { return converter.call(parentJSON, key, KeyedSeq(json).map(function(v, k) {return fromJSWith(converter, v, k, json)})); } return json; } function fromJSDefault(json) { if (Array.isArray(json)) { return IndexedSeq(json).map(fromJSDefault).toList(); } if (isPlainObj(json)) { return KeyedSeq(json).map(fromJSDefault).toMap(); } return json; } function isPlainObj(value) { return value && (value.constructor === Object || value.constructor === undefined); } /** * An extension of the "same-value" algorithm as [described for use by ES6 Map * and Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map#Key_equality) * * NaN is considered the same as NaN, however -0 and 0 are considered the same * value, which is different from the algorithm described by * [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). * * This is extended further to allow Objects to describe the values they * represent, by way of `valueOf` or `equals` (and `hashCode`). * * Note: because of this extension, the key equality of Immutable.Map and the * value equality of Immutable.Set will differ from ES6 Map and Set. * * ### Defining custom values * * The easiest way to describe the value an object represents is by implementing * `valueOf`. For example, `Date` represents a value by returning a unix * timestamp for `valueOf`: * * var date1 = new Date(1234567890000); // Fri Feb 13 2009 ... * var date2 = new Date(1234567890000); * date1.valueOf(); // 1234567890000 * assert( date1 !== date2 ); * assert( Immutable.is( date1, date2 ) ); * * Note: overriding `valueOf` may have other implications if you use this object * where JavaScript expects a primitive, such as implicit string coercion. * * For more complex types, especially collections, implementing `valueOf` may * not be performant. An alternative is to implement `equals` and `hashCode`. * * `equals` takes another object, presumably of similar type, and returns true * if the it is equal. Equality is symmetrical, so the same result should be * returned if this and the argument are flipped. * * assert( a.equals(b) === b.equals(a) ); * * `hashCode` returns a 32bit integer number representing the object which will * be used to determine how to store the value object in a Map or Set. You must * provide both or neither methods, one must not exist without the other. * * Also, an important relationship between these methods must be upheld: if two * values are equal, they *must* return the same hashCode. If the values are not * equal, they might have the same hashCode; this is called a hash collision, * and while undesirable for performance reasons, it is acceptable. * * if (a.equals(b)) { * assert( a.hashCode() === b.hashCode() ); * } * * All Immutable collections implement `equals` and `hashCode`. * */ function is(valueA, valueB) { if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) { return true; } if (!valueA || !valueB) { return false; } if (typeof valueA.valueOf === 'function' && typeof valueB.valueOf === 'function') { valueA = valueA.valueOf(); valueB = valueB.valueOf(); if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) { return true; } if (!valueA || !valueB) { return false; } } if (typeof valueA.equals === 'function' && typeof valueB.equals === 'function' && valueA.equals(valueB)) { return true; } return false; } function deepEqual(a, b) { if (a === b) { return true; } if ( !isIterable(b) || a.size !== undefined && b.size !== undefined && a.size !== b.size || a.__hash !== undefined && b.__hash !== undefined && a.__hash !== b.__hash || isKeyed(a) !== isKeyed(b) || isIndexed(a) !== isIndexed(b) || isOrdered(a) !== isOrdered(b) ) { return false; } if (a.size === 0 && b.size === 0) { return true; } var notAssociative = !isAssociative(a); if (isOrdered(a)) { var entries = a.entries(); return b.every(function(v, k) { var entry = entries.next().value; return entry && is(entry[1], v) && (notAssociative || is(entry[0], k)); }) && entries.next().done; } var flipped = false; if (a.size === undefined) { if (b.size === undefined) { if (typeof a.cacheResult === 'function') { a.cacheResult(); } } else { flipped = true; var _ = a; a = b; b = _; } } var allEqual = true; var bSize = b.__iterate(function(v, k) { if (notAssociative ? !a.has(v) : flipped ? !is(v, a.get(k, NOT_SET)) : !is(a.get(k, NOT_SET), v)) { allEqual = false; return false; } }); return allEqual && a.size === bSize; } createClass(Repeat, IndexedSeq); function Repeat(value, times) { if (!(this instanceof Repeat)) { return new Repeat(value, times); } this._value = value; this.size = times === undefined ? Infinity : Math.max(0, times); if (this.size === 0) { if (EMPTY_REPEAT) { return EMPTY_REPEAT; } EMPTY_REPEAT = this; } } Repeat.prototype.toString = function() { if (this.size === 0) { return 'Repeat []'; } return 'Repeat [ ' + this._value + ' ' + this.size + ' times ]'; }; Repeat.prototype.get = function(index, notSetValue) { return this.has(index) ? this._value : notSetValue; }; Repeat.prototype.includes = function(searchValue) { return is(this._value, searchValue); }; Repeat.prototype.slice = function(begin, end) { var size = this.size; return wholeSlice(begin, end, size) ? this : new Repeat(this._value, resolveEnd(end, size) - resolveBegin(begin, size)); }; Repeat.prototype.reverse = function() { return this; }; Repeat.prototype.indexOf = function(searchValue) { if (is(this._value, searchValue)) { return 0; } return -1; }; Repeat.prototype.lastIndexOf = function(searchValue) { if (is(this._value, searchValue)) { return this.size; } return -1; }; Repeat.prototype.__iterate = function(fn, reverse) { for (var ii = 0; ii < this.size; ii++) { if (fn(this._value, ii, this) === false) { return ii + 1; } } return ii; }; Repeat.prototype.__iterator = function(type, reverse) {var this$0 = this; var ii = 0; return new Iterator(function() {return ii < this$0.size ? iteratorValue(type, ii++, this$0._value) : iteratorDone()} ); }; Repeat.prototype.equals = function(other) { return other instanceof Repeat ? is(this._value, other._value) : deepEqual(other); }; var EMPTY_REPEAT; function invariant(condition, error) { if (!condition) throw new Error(error); } createClass(Range, IndexedSeq); function Range(start, end, step) { if (!(this instanceof Range)) { return new Range(start, end, step); } invariant(step !== 0, 'Cannot step a Range by 0'); start = start || 0; if (end === undefined) { end = Infinity; } step = step === undefined ? 1 : Math.abs(step); if (end < start) { step = -step; } this._start = start; this._end = end; this._step = step; this.size = Math.max(0, Math.ceil((end - start) / step - 1) + 1); if (this.size === 0) { if (EMPTY_RANGE) { return EMPTY_RANGE; } EMPTY_RANGE = this; } } Range.prototype.toString = function() { if (this.size === 0) { return 'Range []'; } return 'Range [ ' + this._start + '...' + this._end + (this._step !== 1 ? ' by ' + this._step : '') + ' ]'; }; Range.prototype.get = function(index, notSetValue) { return this.has(index) ? this._start + wrapIndex(this, index) * this._step : notSetValue; }; Range.prototype.includes = function(searchValue) { var possibleIndex = (searchValue - this._start) / this._step; return possibleIndex >= 0 && possibleIndex < this.size && possibleIndex === Math.floor(possibleIndex); }; Range.prototype.slice = function(begin, end) { if (wholeSlice(begin, end, this.size)) { return this; } begin = resolveBegin(begin, this.size); end = resolveEnd(end, this.size); if (end <= begin) { return new Range(0, 0); } return new Range(this.get(begin, this._end), this.get(end, this._end), this._step); }; Range.prototype.indexOf = function(searchValue) { var offsetValue = searchValue - this._start; if (offsetValue % this._step === 0) { var index = offsetValue / this._step; if (index >= 0 && index < this.size) { return index } } return -1; }; Range.prototype.lastIndexOf = function(searchValue) { return this.indexOf(searchValue); }; Range.prototype.__iterate = function(fn, reverse) { var maxIndex = this.size - 1; var step = this._step; var value = reverse ? this._start + maxIndex * step : this._start; for (var ii = 0; ii <= maxIndex; ii++) { if (fn(value, ii, this) === false) { return ii + 1; } value += reverse ? -step : step; } return ii; }; Range.prototype.__iterator = function(type, reverse) { var maxIndex = this.size - 1; var step = this._step; var value = reverse ? this._start + maxIndex * step : this._start; var ii = 0; return new Iterator(function() { var v = value; value += reverse ? -step : step; return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii++, v); }); }; Range.prototype.equals = function(other) { return other instanceof Range ? this._start === other._start && this._end === other._end && this._step === other._step : deepEqual(this, other); }; var EMPTY_RANGE; createClass(Collection, Iterable); function Collection() { throw TypeError('Abstract'); } createClass(KeyedCollection, Collection);function KeyedCollection() {} createClass(IndexedCollection, Collection);function IndexedCollection() {} createClass(SetCollection, Collection);function SetCollection() {} Collection.Keyed = KeyedCollection; Collection.Indexed = IndexedCollection; Collection.Set = SetCollection; var imul = typeof Math.imul === 'function' && Math.imul(0xffffffff, 2) === -2 ? Math.imul : function imul(a, b) { a = a | 0; // int b = b | 0; // int var c = a & 0xffff; var d = b & 0xffff; // Shift by 0 fixes the sign on the high part. return (c * d) + ((((a >>> 16) * d + c * (b >>> 16)) << 16) >>> 0) | 0; // int }; // v8 has an optimization for storing 31-bit signed numbers. // Values which have either 00 or 11 as the high order bits qualify. // This function drops the highest order bit in a signed number, maintaining // the sign bit. function smi(i32) { return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF); } function hash(o) { if (o === false || o === null || o === undefined) { return 0; } if (typeof o.valueOf === 'function') { o = o.valueOf(); if (o === false || o === null || o === undefined) { return 0; } } if (o === true) { return 1; } var type = typeof o; if (type === 'number') { if (o !== o || o === Infinity) { return 0; } var h = o | 0; if (h !== o) { h ^= o * 0xFFFFFFFF; } while (o > 0xFFFFFFFF) { o /= 0xFFFFFFFF; h ^= o; } return smi(h); } if (type === 'string') { return o.length > STRING_HASH_CACHE_MIN_STRLEN ? cachedHashString(o) : hashString(o); } if (typeof o.hashCode === 'function') { return o.hashCode(); } if (type === 'object') { return hashJSObj(o); } if (typeof o.toString === 'function') { return hashString(o.toString()); } throw new Error('Value type ' + type + ' cannot be hashed.'); } function cachedHashString(string) { var hash = stringHashCache[string]; if (hash === undefined) { hash = hashString(string); if (STRING_HASH_CACHE_SIZE === STRING_HASH_CACHE_MAX_SIZE) { STRING_HASH_CACHE_SIZE = 0; stringHashCache = {}; } STRING_HASH_CACHE_SIZE++; stringHashCache[string] = hash; } return hash; } // http://jsperf.com/hashing-strings function hashString(string) { // This is the hash from JVM // The hash code for a string is computed as // s[0] * 31 ^ (n - 1) + s[1] * 31 ^ (n - 2) + ... + s[n - 1], // where s[i] is the ith character of the string and n is the length of // the string. We "mod" the result to make it between 0 (inclusive) and 2^31 // (exclusive) by dropping high bits. var hash = 0; for (var ii = 0; ii < string.length; ii++) { hash = 31 * hash + string.charCodeAt(ii) | 0; } return smi(hash); } function hashJSObj(obj) { var hash; if (usingWeakMap) { hash = weakMap.get(obj); if (hash !== undefined) { return hash; } } hash = obj[UID_HASH_KEY]; if (hash !== undefined) { return hash; } if (!canDefineProperty) { hash = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY]; if (hash !== undefined) { return hash; } hash = getIENodeHash(obj); if (hash !== undefined) { return hash; } } hash = ++objHashUID; if (objHashUID & 0x40000000) { objHashUID = 0; } if (usingWeakMap) { weakMap.set(obj, hash); } else if (isExtensible !== undefined && isExtensible(obj) === false) { throw new Error('Non-extensible objects are not allowed as keys.'); } else if (canDefineProperty) { Object.defineProperty(obj, UID_HASH_KEY, { 'enumerable': false, 'configurable': false, 'writable': false, 'value': hash }); } else if (obj.propertyIsEnumerable !== undefined && obj.propertyIsEnumerable === obj.constructor.prototype.propertyIsEnumerable) { // Since we can't define a non-enumerable property on the object // we'll hijack one of the less-used non-enumerable properties to // save our hash on it. Since this is a function it will not show up in // `JSON.stringify` which is what we want. obj.propertyIsEnumerable = function() { return this.constructor.prototype.propertyIsEnumerable.apply(this, arguments); }; obj.propertyIsEnumerable[UID_HASH_KEY] = hash; } else if (obj.nodeType !== undefined) { // At this point we couldn't get the IE `uniqueID` to use as a hash // and we couldn't use a non-enumerable property to exploit the // dontEnum bug so we simply add the `UID_HASH_KEY` on the node // itself. obj[UID_HASH_KEY] = hash; } else { throw new Error('Unable to set a non-enumerable property on object.'); } return hash; } // Get references to ES5 object methods. var isExtensible = Object.isExtensible; // True if Object.defineProperty works as expected. IE8 fails this test. var canDefineProperty = (function() { try { Object.defineProperty({}, '@', {}); return true; } catch (e) { return false; } }()); // IE has a `uniqueID` property on DOM nodes. We can construct the hash from it // and avoid memory leaks from the IE cloneNode bug. function getIENodeHash(node) { if (node && node.nodeType > 0) { switch (node.nodeType) { case 1: // Element return node.uniqueID; case 9: // Document return node.documentElement && node.documentElement.uniqueID; } } } // If possible, use a WeakMap. var usingWeakMap = typeof WeakMap === 'function'; var weakMap; if (usingWeakMap) { weakMap = new WeakMap(); } var objHashUID = 0; var UID_HASH_KEY = '__immutablehash__'; if (typeof Symbol === 'function') { UID_HASH_KEY = Symbol(UID_HASH_KEY); } var STRING_HASH_CACHE_MIN_STRLEN = 16; var STRING_HASH_CACHE_MAX_SIZE = 255; var STRING_HASH_CACHE_SIZE = 0; var stringHashCache = {}; function assertNotInfinite(size) { invariant( size !== Infinity, 'Cannot perform this action with an infinite size.' ); } createClass(Map, KeyedCollection); // @pragma Construction function Map(value) { return value === null || value === undefined ? emptyMap() : isMap(value) && !isOrdered(value) ? value : emptyMap().withMutations(function(map ) { var iter = KeyedIterable(value); assertNotInfinite(iter.size); iter.forEach(function(v, k) {return map.set(k, v)}); }); } Map.of = function() {var keyValues = SLICE$0.call(arguments, 0); return emptyMap().withMutations(function(map ) { for (var i = 0; i < keyValues.length; i += 2) { if (i + 1 >= keyValues.length) { throw new Error('Missing value for key: ' + keyValues[i]); } map.set(keyValues[i], keyValues[i + 1]); } }); }; Map.prototype.toString = function() { return this.__toString('Map {', '}'); }; // @pragma Access Map.prototype.get = function(k, notSetValue) { return this._root ? this._root.get(0, undefined, k, notSetValue) : notSetValue; }; // @pragma Modification Map.prototype.set = function(k, v) { return updateMap(this, k, v); }; Map.prototype.setIn = function(keyPath, v) { return this.updateIn(keyPath, NOT_SET, function() {return v}); }; Map.prototype.remove = function(k) { return updateMap(this, k, NOT_SET); }; Map.prototype.deleteIn = function(keyPath) { return this.updateIn(keyPath, function() {return NOT_SET}); }; Map.prototype.update = function(k, notSetValue, updater) { return arguments.length === 1 ? k(this) : this.updateIn([k], notSetValue, updater); }; Map.prototype.updateIn = function(keyPath, notSetValue, updater) { if (!updater) { updater = notSetValue; notSetValue = undefined; } var updatedValue = updateInDeepMap( this, forceIterator(keyPath), notSetValue, updater ); return updatedValue === NOT_SET ? undefined : updatedValue; }; Map.prototype.clear = function() { if (this.size === 0) { return this; } if (this.__ownerID) { this.size = 0; this._root = null; this.__hash = undefined; this.__altered = true; return this; } return emptyMap(); }; // @pragma Composition Map.prototype.merge = function(/*...iters*/) { return mergeIntoMapWith(this, undefined, arguments); }; Map.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1); return mergeIntoMapWith(this, merger, iters); }; Map.prototype.mergeIn = function(keyPath) {var iters = SLICE$0.call(arguments, 1); return this.updateIn( keyPath, emptyMap(), function(m ) {return typeof m.merge === 'function' ? m.merge.apply(m, iters) : iters[iters.length - 1]} ); }; Map.prototype.mergeDeep = function(/*...iters*/) { return mergeIntoMapWith(this, deepMerger, arguments); }; Map.prototype.mergeDeepWith = function(merger) {var iters = SLICE$0.call(arguments, 1); return mergeIntoMapWith(this, deepMergerWith(merger), iters); }; Map.prototype.mergeDeepIn = function(keyPath) {var iters = SLICE$0.call(arguments, 1); return this.updateIn( keyPath, emptyMap(), function(m ) {return typeof m.mergeDeep === 'function' ? m.mergeDeep.apply(m, iters) : iters[iters.length - 1]} ); }; Map.prototype.sort = function(comparator) { // Late binding return OrderedMap(sortFactory(this, comparator)); }; Map.prototype.sortBy = function(mapper, comparator) { // Late binding return OrderedMap(sortFactory(this, comparator, mapper)); }; // @pragma Mutability Map.prototype.withMutations = function(fn) { var mutable = this.asMutable(); fn(mutable); return mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this; }; Map.prototype.asMutable = function() { return this.__ownerID ? this : this.__ensureOwner(new OwnerID()); }; Map.prototype.asImmutable = function() { return this.__ensureOwner(); }; Map.prototype.wasAltered = function() { return this.__altered; }; Map.prototype.__iterator = function(type, reverse) { return new MapIterator(this, type, reverse); }; Map.prototype.__iterate = function(fn, reverse) {var this$0 = this; var iterations = 0; this._root && this._root.iterate(function(entry ) { iterations++; return fn(entry[1], entry[0], this$0); }, reverse); return iterations; }; Map.prototype.__ensureOwner = function(ownerID) { if (ownerID === this.__ownerID) { return this; } if (!ownerID) { this.__ownerID = ownerID; this.__altered = false; return this; } return makeMap(this.size, this._root, ownerID, this.__hash); }; function isMap(maybeMap) { return !!(maybeMap && maybeMap[IS_MAP_SENTINEL]); } Map.isMap = isMap; var IS_MAP_SENTINEL = '@@__IMMUTABLE_MAP__@@'; var MapPrototype = Map.prototype; MapPrototype[IS_MAP_SENTINEL] = true; MapPrototype[DELETE] = MapPrototype.remove; MapPrototype.removeIn = MapPrototype.deleteIn; // #pragma Trie Nodes function ArrayMapNode(ownerID, entries) { this.ownerID = ownerID; this.entries = entries; } ArrayMapNode.prototype.get = function(shift, keyHash, key, notSetValue) { var entries = this.entries; for (var ii = 0, len = entries.length; ii < len; ii++) { if (is(key, entries[ii][0])) { return entries[ii][1]; } } return notSetValue; }; ArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { var removed = value === NOT_SET; var entries = this.entries; var idx = 0; for (var len = entries.length; idx < len; idx++) { if (is(key, entries[idx][0])) { break; } } var exists = idx < len; if (exists ? entries[idx][1] === value : removed) { return this; } SetRef(didAlter); (removed || !exists) && SetRef(didChangeSize); if (removed && entries.length === 1) { return; // undefined } if (!exists && !removed && entries.length >= MAX_ARRAY_MAP_SIZE) { return createNodes(ownerID, entries, key, value); } var isEditable = ownerID && ownerID === this.ownerID; var newEntries = isEditable ? entries : arrCopy(entries); if (exists) { if (removed) { idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop()); } else { newEntries[idx] = [key, value]; } } else { newEntries.push([key, value]); } if (isEditable) { this.entries = newEntries; return this; } return new ArrayMapNode(ownerID, newEntries); }; function BitmapIndexedNode(ownerID, bitmap, nodes) { this.ownerID = ownerID; this.bitmap = bitmap; this.nodes = nodes; } BitmapIndexedNode.prototype.get = function(shift, keyHash, key, notSetValue) { if (keyHash === undefined) { keyHash = hash(key); } var bit = (1 << ((shift === 0 ? keyHash : keyHash >>> shift) & MASK)); var bitmap = this.bitmap; return (bitmap & bit) === 0 ? notSetValue : this.nodes[popCount(bitmap & (bit - 1))].get(shift + SHIFT, keyHash, key, notSetValue); }; BitmapIndexedNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { if (keyHash === undefined) { keyHash = hash(key); } var keyHashFrag = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; var bit = 1 << keyHashFrag; var bitmap = this.bitmap; var exists = (bitmap & bit) !== 0; if (!exists && value === NOT_SET) { return this; } var idx = popCount(bitmap & (bit - 1)); var nodes = this.nodes; var node = exists ? nodes[idx] : undefined; var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter); if (newNode === node) { return this; } if (!exists && newNode && nodes.length >= MAX_BITMAP_INDEXED_SIZE) { return expandNodes(ownerID, nodes, bitmap, keyHashFrag, newNode); } if (exists && !newNode && nodes.length === 2 && isLeafNode(nodes[idx ^ 1])) { return nodes[idx ^ 1]; } if (exists && newNode && nodes.length === 1 && isLeafNode(newNode)) { return newNode; } var isEditable = ownerID && ownerID === this.ownerID; var newBitmap = exists ? newNode ? bitmap : bitmap ^ bit : bitmap | bit; var newNodes = exists ? newNode ? setIn(nodes, idx, newNode, isEditable) : spliceOut(nodes, idx, isEditable) : spliceIn(nodes, idx, newNode, isEditable); if (isEditable) { this.bitmap = newBitmap; this.nodes = newNodes; return this; } return new BitmapIndexedNode(ownerID, newBitmap, newNodes); }; function HashArrayMapNode(ownerID, count, nodes) { this.ownerID = ownerID; this.count = count; this.nodes = nodes; } HashArrayMapNode.prototype.get = function(shift, keyHash, key, notSetValue) { if (keyHash === undefined) { keyHash = hash(key); } var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; var node = this.nodes[idx]; return node ? node.get(shift + SHIFT, keyHash, key, notSetValue) : notSetValue; }; HashArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { if (keyHash === undefined) { keyHash = hash(key); } var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; var removed = value === NOT_SET; var nodes = this.nodes; var node = nodes[idx]; if (removed && !node) { return this; } var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter); if (newNode === node) { return this; } var newCount = this.count; if (!node) { newCount++; } else if (!newNode) { newCount--; if (newCount < MIN_HASH_ARRAY_MAP_SIZE) { return packNodes(ownerID, nodes, newCount, idx); } } var isEditable = ownerID && ownerID === this.ownerID; var newNodes = setIn(nodes, idx, newNode, isEditable); if (isEditable) { this.count = newCount; this.nodes = newNodes; return this; } return new HashArrayMapNode(ownerID, newCount, newNodes); }; function HashCollisionNode(ownerID, keyHash, entries) { this.ownerID = ownerID; this.keyHash = keyHash; this.entries = entries; } HashCollisionNode.prototype.get = function(shift, keyHash, key, notSetValue) { var entries = this.entries; for (var ii = 0, len = entries.length; ii < len; ii++) { if (is(key, entries[ii][0])) { return entries[ii][1]; } } return notSetValue; }; HashCollisionNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { if (keyHash === undefined) { keyHash = hash(key); } var removed = value === NOT_SET; if (keyHash !== this.keyHash) { if (removed) { return this; } SetRef(didAlter); SetRef(didChangeSize); return mergeIntoNode(this, ownerID, shift, keyHash, [key, value]); } var entries = this.entries; var idx = 0; for (var len = entries.length; idx < len; idx++) { if (is(key, entries[idx][0])) { break; } } var exists = idx < len; if (exists ? entries[idx][1] === value : removed) { return this; } SetRef(didAlter); (removed || !exists) && SetRef(didChangeSize); if (removed && len === 2) { return new ValueNode(ownerID, this.keyHash, entries[idx ^ 1]); } var isEditable = ownerID && ownerID === this.ownerID; var newEntries = isEditable ? entries : arrCopy(entries); if (exists) { if (removed) { idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop()); } else { newEntries[idx] = [key, value]; } } else { newEntries.push([key, value]); } if (isEditable) { this.entries = newEntries; return this; } return new HashCollisionNode(ownerID, this.keyHash, newEntries); }; function ValueNode(ownerID, keyHash, entry) { this.ownerID = ownerID; this.keyHash = keyHash; this.entry = entry; } ValueNode.prototype.get = function(shift, keyHash, key, notSetValue) { return is(key, this.entry[0]) ? this.entry[1] : notSetValue; }; ValueNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { var removed = value === NOT_SET; var keyMatch = is(key, this.entry[0]); if (keyMatch ? value === this.entry[1] : removed) { return this; } SetRef(didAlter); if (removed) { SetRef(didChangeSize); return; // undefined } if (keyMatch) { if (ownerID && ownerID === this.ownerID) { this.entry[1] = value; return this; } return new ValueNode(ownerID, this.keyHash, [key, value]); } SetRef(didChangeSize); return mergeIntoNode(this, ownerID, shift, hash(key), [key, value]); }; // #pragma Iterators ArrayMapNode.prototype.iterate = HashCollisionNode.prototype.iterate = function (fn, reverse) { var entries = this.entries; for (var ii = 0, maxIndex = entries.length - 1; ii <= maxIndex; ii++) { if (fn(entries[reverse ? maxIndex - ii : ii]) === false) { return false; } } } BitmapIndexedNode.prototype.iterate = HashArrayMapNode.prototype.iterate = function (fn, reverse) { var nodes = this.nodes; for (var ii = 0, maxIndex = nodes.length - 1; ii <= maxIndex; ii++) { var node = nodes[reverse ? maxIndex - ii : ii]; if (node && node.iterate(fn, reverse) === false) { return false; } } } ValueNode.prototype.iterate = function (fn, reverse) { return fn(this.entry); } createClass(MapIterator, Iterator); function MapIterator(map, type, reverse) { this._type = type; this._reverse = reverse; this._stack = map._root && mapIteratorFrame(map._root); } MapIterator.prototype.next = function() { var type = this._type; var stack = this._stack; while (stack) { var node = stack.node; var index = stack.index++; var maxIndex; if (node.entry) { if (index === 0) { return mapIteratorValue(type, node.entry); } } else if (node.entries) { maxIndex = node.entries.length - 1; if (index <= maxIndex) { return mapIteratorValue(type, node.entries[this._reverse ? maxIndex - index : index]); } } else { maxIndex = node.nodes.length - 1; if (index <= maxIndex) { var subNode = node.nodes[this._reverse ? maxIndex - index : index]; if (subNode) { if (subNode.entry) { return mapIteratorValue(type, subNode.entry); } stack = this._stack = mapIteratorFrame(subNode, stack); } continue; } } stack = this._stack = this._stack.__prev; } return iteratorDone(); }; function mapIteratorValue(type, entry) { return iteratorValue(type, entry[0], entry[1]); } function mapIteratorFrame(node, prev) { return { node: node, index: 0, __prev: prev }; } function makeMap(size, root, ownerID, hash) { var map = Object.create(MapPrototype); map.size = size; map._root = root; map.__ownerID = ownerID; map.__hash = hash; map.__altered = false; return map; } var EMPTY_MAP; function emptyMap() { return EMPTY_MAP || (EMPTY_MAP = makeMap(0)); } function updateMap(map, k, v) { var newRoot; var newSize; if (!map._root) { if (v === NOT_SET) { return map; } newSize = 1; newRoot = new ArrayMapNode(map.__ownerID, [[k, v]]); } else { var didChangeSize = MakeRef(CHANGE_LENGTH); var didAlter = MakeRef(DID_ALTER); newRoot = updateNode(map._root, map.__ownerID, 0, undefined, k, v, didChangeSize, didAlter); if (!didAlter.value) { return map; } newSize = map.size + (didChangeSize.value ? v === NOT_SET ? -1 : 1 : 0); } if (map.__ownerID) { map.size = newSize; map._root = newRoot; map.__hash = undefined; map.__altered = true; return map; } return newRoot ? makeMap(newSize, newRoot) : emptyMap(); } function updateNode(node, ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { if (!node) { if (value === NOT_SET) { return node; } SetRef(didAlter); SetRef(didChangeSize); return new ValueNode(ownerID, keyHash, [key, value]); } return node.update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter); } function isLeafNode(node) { return node.constructor === ValueNode || node.constructor === HashCollisionNode; } function mergeIntoNode(node, ownerID, shift, keyHash, entry) { if (node.keyHash === keyHash) { return new HashCollisionNode(ownerID, keyHash, [node.entry, entry]); } var idx1 = (shift === 0 ? node.keyHash : node.keyHash >>> shift) & MASK; var idx2 = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; var newNode; var nodes = idx1 === idx2 ? [mergeIntoNode(node, ownerID, shift + SHIFT, keyHash, entry)] : ((newNode = new ValueNode(ownerID, keyHash, entry)), idx1 < idx2 ? [node, newNode] : [newNode, node]); return new BitmapIndexedNode(ownerID, (1 << idx1) | (1 << idx2), nodes); } function createNodes(ownerID, entries, key, value) { if (!ownerID) { ownerID = new OwnerID(); } var node = new ValueNode(ownerID, hash(key), [key, value]); for (var ii = 0; ii < entries.length; ii++) { var entry = entries[ii]; node = node.update(ownerID, 0, undefined, entry[0], entry[1]); } return node; } function packNodes(ownerID, nodes, count, excluding) { var bitmap = 0; var packedII = 0; var packedNodes = new Array(count); for (var ii = 0, bit = 1, len = nodes.length; ii < len; ii++, bit <<= 1) { var node = nodes[ii]; if (node !== undefined && ii !== excluding) { bitmap |= bit; packedNodes[packedII++] = node; } } return new BitmapIndexedNode(ownerID, bitmap, packedNodes); } function expandNodes(ownerID, nodes, bitmap, including, node) { var count = 0; var expandedNodes = new Array(SIZE); for (var ii = 0; bitmap !== 0; ii++, bitmap >>>= 1) { expandedNodes[ii] = bitmap & 1 ? nodes[count++] : undefined; } expandedNodes[including] = node; return new HashArrayMapNode(ownerID, count + 1, expandedNodes); } function mergeIntoMapWith(map, merger, iterables) { var iters = []; for (var ii = 0; ii < iterables.length; ii++) { var value = iterables[ii]; var iter = KeyedIterable(value); if (!isIterable(value)) { iter = iter.map(function(v ) {return fromJS(v)}); } iters.push(iter); } return mergeIntoCollectionWith(map, merger, iters); } function deepMerger(existing, value, key) { return existing && existing.mergeDeep && isIterable(value) ? existing.mergeDeep(value) : is(existing, value) ? existing : value; } function deepMergerWith(merger) { return function(existing, value, key) { if (existing && existing.mergeDeepWith && isIterable(value)) { return existing.mergeDeepWith(merger, value); } var nextValue = merger(existing, value, key); return is(existing, nextValue) ? existing : nextValue; }; } function mergeIntoCollectionWith(collection, merger, iters) { iters = iters.filter(function(x ) {return x.size !== 0}); if (iters.length === 0) { return collection; } if (collection.size === 0 && !collection.__ownerID && iters.length === 1) { return collection.constructor(iters[0]); } return collection.withMutations(function(collection ) { var mergeIntoMap = merger ? function(value, key) { collection.update(key, NOT_SET, function(existing ) {return existing === NOT_SET ? value : merger(existing, value, key)} ); } : function(value, key) { collection.set(key, value); } for (var ii = 0; ii < iters.length; ii++) { iters[ii].forEach(mergeIntoMap); } }); } function updateInDeepMap(existing, keyPathIter, notSetValue, updater) { var isNotSet = existing === NOT_SET; var step = keyPathIter.next(); if (step.done) { var existingValue = isNotSet ? notSetValue : existing; var newValue = updater(existingValue); return newValue === existingValue ? existing : newValue; } invariant( isNotSet || (existing && existing.set), 'invalid keyPath' ); var key = step.value; var nextExisting = isNotSet ? NOT_SET : existing.get(key, NOT_SET); var nextUpdated = updateInDeepMap( nextExisting, keyPathIter, notSetValue, updater ); return nextUpdated === nextExisting ? existing : nextUpdated === NOT_SET ? existing.remove(key) : (isNotSet ? emptyMap() : existing).set(key, nextUpdated); } function popCount(x) { x = x - ((x >> 1) & 0x55555555); x = (x & 0x33333333) + ((x >> 2) & 0x33333333); x = (x + (x >> 4)) & 0x0f0f0f0f; x = x + (x >> 8); x = x + (x >> 16); return x & 0x7f; } function setIn(array, idx, val, canEdit) { var newArray = canEdit ? array : arrCopy(array); newArray[idx] = val; return newArray; } function spliceIn(array, idx, val, canEdit) { var newLen = array.length + 1; if (canEdit && idx + 1 === newLen) { array[idx] = val; return array; } var newArray = new Array(newLen); var after = 0; for (var ii = 0; ii < newLen; ii++) { if (ii === idx) { newArray[ii] = val; after = -1; } else { newArray[ii] = array[ii + after]; } } return newArray; } function spliceOut(array, idx, canEdit) { var newLen = array.length - 1; if (canEdit && idx === newLen) { array.pop(); return array; } var newArray = new Array(newLen); var after = 0; for (var ii = 0; ii < newLen; ii++) { if (ii === idx) { after = 1; } newArray[ii] = array[ii + after]; } return newArray; } var MAX_ARRAY_MAP_SIZE = SIZE / 4; var MAX_BITMAP_INDEXED_SIZE = SIZE / 2; var MIN_HASH_ARRAY_MAP_SIZE = SIZE / 4; createClass(List, IndexedCollection); // @pragma Construction function List(value) { var empty = emptyList(); if (value === null || value === undefined) { return empty; } if (isList(value)) { return value; } var iter = IndexedIterable(value); var size = iter.size; if (size === 0) { return empty; } assertNotInfinite(size); if (size > 0 && size < SIZE) { return makeList(0, size, SHIFT, null, new VNode(iter.toArray())); } return empty.withMutations(function(list ) { list.setSize(size); iter.forEach(function(v, i) {return list.set(i, v)}); }); } List.of = function(/*...values*/) { return this(arguments); }; List.prototype.toString = function() { return this.__toString('List [', ']'); }; // @pragma Access List.prototype.get = function(index, notSetValue) { index = wrapIndex(this, index); if (index >= 0 && index < this.size) { index += this._origin; var node = listNodeFor(this, index); return node && node.array[index & MASK]; } return notSetValue; }; // @pragma Modification List.prototype.set = function(index, value) { return updateList(this, index, value); }; List.prototype.remove = function(index) { return !this.has(index) ? this : index === 0 ? this.shift() : index === this.size - 1 ? this.pop() : this.splice(index, 1); }; List.prototype.insert = function(index, value) { return this.splice(index, 0, value); }; List.prototype.clear = function() { if (this.size === 0) { return this; } if (this.__ownerID) { this.size = this._origin = this._capacity = 0; this._level = SHIFT; this._root = this._tail = null; this.__hash = undefined; this.__altered = true; return this; } return emptyList(); }; List.prototype.push = function(/*...values*/) { var values = arguments; var oldSize = this.size; return this.withMutations(function(list ) { setListBounds(list, 0, oldSize + values.length); for (var ii = 0; ii < values.length; ii++) { list.set(oldSize + ii, values[ii]); } }); }; List.prototype.pop = function() { return setListBounds(this, 0, -1); }; List.prototype.unshift = function(/*...values*/) { var values = arguments; return this.withMutations(function(list ) { setListBounds(list, -values.length); for (var ii = 0; ii < values.length; ii++) { list.set(ii, values[ii]); } }); }; List.prototype.shift = function() { return setListBounds(this, 1); }; // @pragma Composition List.prototype.merge = function(/*...iters*/) { return mergeIntoListWith(this, undefined, arguments); }; List.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1); return mergeIntoListWith(this, merger, iters); }; List.prototype.mergeDeep = function(/*...iters*/) { return mergeIntoListWith(this, deepMerger, arguments); }; List.prototype.mergeDeepWith = function(merger) {var iters = SLICE$0.call(arguments, 1); return mergeIntoListWith(this, deepMergerWith(merger), iters); }; List.prototype.setSize = function(size) { return setListBounds(this, 0, size); }; // @pragma Iteration List.prototype.slice = function(begin, end) { var size = this.size; if (wholeSlice(begin, end, size)) { return this; } return setListBounds( this, resolveBegin(begin, size), resolveEnd(end, size) ); }; List.prototype.__iterator = function(type, reverse) { var index = 0; var values = iterateList(this, reverse); return new Iterator(function() { var value = values(); return value === DONE ? iteratorDone() : iteratorValue(type, index++, value); }); }; List.prototype.__iterate = function(fn, reverse) { var index = 0; var values = iterateList(this, reverse); var value; while ((value = values()) !== DONE) { if (fn(value, index++, this) === false) { break; } } return index; }; List.prototype.__ensureOwner = function(ownerID) { if (ownerID === this.__ownerID) { return this; } if (!ownerID) { this.__ownerID = ownerID; return this; } return makeList(this._origin, this._capacity, this._level, this._root, this._tail, ownerID, this.__hash); }; function isList(maybeList) { return !!(maybeList && maybeList[IS_LIST_SENTINEL]); } List.isList = isList; var IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@'; var ListPrototype = List.prototype; ListPrototype[IS_LIST_SENTINEL] = true; ListPrototype[DELETE] = ListPrototype.remove; ListPrototype.setIn = MapPrototype.setIn; ListPrototype.deleteIn = ListPrototype.removeIn = MapPrototype.removeIn; ListPrototype.update = MapPrototype.update; ListPrototype.updateIn = MapPrototype.updateIn; ListPrototype.mergeIn = MapPrototype.mergeIn; ListPrototype.mergeDeepIn = MapPrototype.mergeDeepIn; ListPrototype.withMutations = MapPrototype.withMutations; ListPrototype.asMutable = MapPrototype.asMutable; ListPrototype.asImmutable = MapPrototype.asImmutable; ListPrototype.wasAltered = MapPrototype.wasAltered; function VNode(array, ownerID) { this.array = array; this.ownerID = ownerID; } // TODO: seems like these methods are very similar VNode.prototype.removeBefore = function(ownerID, level, index) { if (index === level ? 1 << level : 0 || this.array.length === 0) { return this; } var originIndex = (index >>> level) & MASK; if (originIndex >= this.array.length) { return new VNode([], ownerID); } var removingFirst = originIndex === 0; var newChild; if (level > 0) { var oldChild = this.array[originIndex]; newChild = oldChild && oldChild.removeBefore(ownerID, level - SHIFT, index); if (newChild === oldChild && removingFirst) { return this; } } if (removingFirst && !newChild) { return this; } var editable = editableVNode(this, ownerID); if (!removingFirst) { for (var ii = 0; ii < originIndex; ii++) { editable.array[ii] = undefined; } } if (newChild) { editable.array[originIndex] = newChild; } return editable; }; VNode.prototype.removeAfter = function(ownerID, level, index) { if (index === (level ? 1 << level : 0) || this.array.length === 0) { return this; } var sizeIndex = ((index - 1) >>> level) & MASK; if (sizeIndex >= this.array.length) { return this; } var newChild; if (level > 0) { var oldChild = this.array[sizeIndex]; newChild = oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index); if (newChild === oldChild && sizeIndex === this.array.length - 1) { return this; } } var editable = editableVNode(this, ownerID); editable.array.splice(sizeIndex + 1); if (newChild) { editable.array[sizeIndex] = newChild; } return editable; }; var DONE = {}; function iterateList(list, reverse) { var left = list._origin; var right = list._capacity; var tailPos = getTailOffset(right); var tail = list._tail; return iterateNodeOrLeaf(list._root, list._level, 0); function iterateNodeOrLeaf(node, level, offset) { return level === 0 ? iterateLeaf(node, offset) : iterateNode(node, level, offset); } function iterateLeaf(node, offset) { var array = offset === tailPos ? tail && tail.array : node && node.array; var from = offset > left ? 0 : left - offset; var to = right - offset; if (to > SIZE) { to = SIZE; } return function() { if (from === to) { return DONE; } var idx = reverse ? --to : from++; return array && array[idx]; }; } function iterateNode(node, level, offset) { var values; var array = node && node.array; var from = offset > left ? 0 : (left - offset) >> level; var to = ((right - offset) >> level) + 1; if (to > SIZE) { to = SIZE; } return function() { do { if (values) { var value = values(); if (value !== DONE) { return value; } values = null; } if (from === to) { return DONE; } var idx = reverse ? --to : from++; values = iterateNodeOrLeaf( array && array[idx], level - SHIFT, offset + (idx << level) ); } while (true); }; } } function makeList(origin, capacity, level, root, tail, ownerID, hash) { var list = Object.create(ListPrototype); list.size = capacity - origin; list._origin = origin; list._capacity = capacity; list._level = level; list._root = root; list._tail = tail; list.__ownerID = ownerID; list.__hash = hash; list.__altered = false; return list; } var EMPTY_LIST; function emptyList() { return EMPTY_LIST || (EMPTY_LIST = makeList(0, 0, SHIFT)); } function updateList(list, index, value) { index = wrapIndex(list, index); if (index !== index) { return list; } if (index >= list.size || index < 0) { return list.withMutations(function(list ) { index < 0 ? setListBounds(list, index).set(0, value) : setListBounds(list, 0, index + 1).set(index, value) }); } index += list._origin; var newTail = list._tail; var newRoot = list._root; var didAlter = MakeRef(DID_ALTER); if (index >= getTailOffset(list._capacity)) { newTail = updateVNode(newTail, list.__ownerID, 0, index, value, didAlter); } else { newRoot = updateVNode(newRoot, list.__ownerID, list._level, index, value, didAlter); } if (!didAlter.value) { return list; } if (list.__ownerID) { list._root = newRoot; list._tail = newTail; list.__hash = undefined; list.__altered = true; return list; } return makeList(list._origin, list._capacity, list._level, newRoot, newTail); } function updateVNode(node, ownerID, level, index, value, didAlter) { var idx = (index >>> level) & MASK; var nodeHas = node && idx < node.array.length; if (!nodeHas && value === undefined) { return node; } var newNode; if (level > 0) { var lowerNode = node && node.array[idx]; var newLowerNode = updateVNode(lowerNode, ownerID, level - SHIFT, index, value, didAlter); if (newLowerNode === lowerNode) { return node; } newNode = editableVNode(node, ownerID); newNode.array[idx] = newLowerNode; return newNode; } if (nodeHas && node.array[idx] === value) { return node; } SetRef(didAlter); newNode = editableVNode(node, ownerID); if (value === undefined && idx === newNode.array.length - 1) { newNode.array.pop(); } else { newNode.array[idx] = value; } return newNode; } function editableVNode(node, ownerID) { if (ownerID && node && ownerID === node.ownerID) { return node; } return new VNode(node ? node.array.slice() : [], ownerID); } function listNodeFor(list, rawIndex) { if (rawIndex >= getTailOffset(list._capacity)) { return list._tail; } if (rawIndex < 1 << (list._level + SHIFT)) { var node = list._root; var level = list._level; while (node && level > 0) { node = node.array[(rawIndex >>> level) & MASK]; level -= SHIFT; } return node; } } function setListBounds(list, begin, end) { // Sanitize begin & end using this shorthand for ToInt32(argument) // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32 if (begin !== undefined) { begin = begin | 0; } if (end !== undefined) { end = end | 0; } var owner = list.__ownerID || new OwnerID(); var oldOrigin = list._origin; var oldCapacity = list._capacity; var newOrigin = oldOrigin + begin; var newCapacity = end === undefined ? oldCapacity : end < 0 ? oldCapacity + end : oldOrigin + end; if (newOrigin === oldOrigin && newCapacity === oldCapacity) { return list; } // If it's going to end after it starts, it's empty. if (newOrigin >= newCapacity) { return list.clear(); } var newLevel = list._level; var newRoot = list._root; // New origin might need creating a higher root. var offsetShift = 0; while (newOrigin + offsetShift < 0) { newRoot = new VNode(newRoot && newRoot.array.length ? [undefined, newRoot] : [], owner); newLevel += SHIFT; offsetShift += 1 << newLevel; } if (offsetShift) { newOrigin += offsetShift; oldOrigin += offsetShift; newCapacity += offsetShift; oldCapacity += offsetShift; } var oldTailOffset = getTailOffset(oldCapacity); var newTailOffset = getTailOffset(newCapacity); // New size might need creating a higher root. while (newTailOffset >= 1 << (newLevel + SHIFT)) { newRoot = new VNode(newRoot && newRoot.array.length ? [newRoot] : [], owner); newLevel += SHIFT; } // Locate or create the new tail. var oldTail = list._tail; var newTail = newTailOffset < oldTailOffset ? listNodeFor(list, newCapacity - 1) : newTailOffset > oldTailOffset ? new VNode([], owner) : oldTail; // Merge Tail into tree. if (oldTail && newTailOffset > oldTailOffset && newOrigin < oldCapacity && oldTail.array.length) { newRoot = editableVNode(newRoot, owner); var node = newRoot; for (var level = newLevel; level > SHIFT; level -= SHIFT) { var idx = (oldTailOffset >>> level) & MASK; node = node.array[idx] = editableVNode(node.array[idx], owner); } node.array[(oldTailOffset >>> SHIFT) & MASK] = oldTail; } // If the size has been reduced, there's a chance the tail needs to be trimmed. if (newCapacity < oldCapacity) { newTail = newTail && newTail.removeAfter(owner, 0, newCapacity); } // If the new origin is within the tail, then we do not need a root. if (newOrigin >= newTailOffset) { newOrigin -= newTailOffset; newCapacity -= newTailOffset; newLevel = SHIFT; newRoot = null; newTail = newTail && newTail.removeBefore(owner, 0, newOrigin); // Otherwise, if the root has been trimmed, garbage collect. } else if (newOrigin > oldOrigin || newTailOffset < oldTailOffset) { offsetShift = 0; // Identify the new top root node of the subtree of the old root. while (newRoot) { var beginIndex = (newOrigin >>> newLevel) & MASK; if (beginIndex !== (newTailOffset >>> newLevel) & MASK) { break; } if (beginIndex) { offsetShift += (1 << newLevel) * beginIndex; } newLevel -= SHIFT; newRoot = newRoot.array[beginIndex]; } // Trim the new sides of the new root. if (newRoot && newOrigin > oldOrigin) { newRoot = newRoot.removeBefore(owner, newLevel, newOrigin - offsetShift); } if (newRoot && newTailOffset < oldTailOffset) { newRoot = newRoot.removeAfter(owner, newLevel, newTailOffset - offsetShift); } if (offsetShift) { newOrigin -= offsetShift; newCapacity -= offsetShift; } } if (list.__ownerID) { list.size = newCapacity - newOrigin; list._origin = newOrigin; list._capacity = newCapacity; list._level = newLevel; list._root = newRoot; list._tail = newTail; list.__hash = undefined; list.__altered = true; return list; } return makeList(newOrigin, newCapacity, newLevel, newRoot, newTail); } function mergeIntoListWith(list, merger, iterables) { var iters = []; var maxSize = 0; for (var ii = 0; ii < iterables.length; ii++) { var value = iterables[ii]; var iter = IndexedIterable(value); if (iter.size > maxSize) { maxSize = iter.size; } if (!isIterable(value)) { iter = iter.map(function(v ) {return fromJS(v)}); } iters.push(iter); } if (maxSize > list.size) { list = list.setSize(maxSize); } return mergeIntoCollectionWith(list, merger, iters); } function getTailOffset(size) { return size < SIZE ? 0 : (((size - 1) >>> SHIFT) << SHIFT); } createClass(OrderedMap, Map); // @pragma Construction function OrderedMap(value) { return value === null || value === undefined ? emptyOrderedMap() : isOrderedMap(value) ? value : emptyOrderedMap().withMutations(function(map ) { var iter = KeyedIterable(value); assertNotInfinite(iter.size); iter.forEach(function(v, k) {return map.set(k, v)}); }); } OrderedMap.of = function(/*...values*/) { return this(arguments); }; OrderedMap.prototype.toString = function() { return this.__toString('OrderedMap {', '}'); }; // @pragma Access OrderedMap.prototype.get = function(k, notSetValue) { var index = this._map.get(k); return index !== undefined ? this._list.get(index)[1] : notSetValue; }; // @pragma Modification OrderedMap.prototype.clear = function() { if (this.size === 0) { return this; } if (this.__ownerID) { this.size = 0; this._map.clear(); this._list.clear(); return this; } return emptyOrderedMap(); }; OrderedMap.prototype.set = function(k, v) { return updateOrderedMap(this, k, v); }; OrderedMap.prototype.remove = function(k) { return updateOrderedMap(this, k, NOT_SET); }; OrderedMap.prototype.wasAltered = function() { return this._map.wasAltered() || this._list.wasAltered(); }; OrderedMap.prototype.__iterate = function(fn, reverse) {var this$0 = this; return this._list.__iterate( function(entry ) {return entry && fn(entry[1], entry[0], this$0)}, reverse ); }; OrderedMap.prototype.__iterator = function(type, reverse) { return this._list.fromEntrySeq().__iterator(type, reverse); }; OrderedMap.prototype.__ensureOwner = function(ownerID) { if (ownerID === this.__ownerID) { return this; } var newMap = this._map.__ensureOwner(ownerID); var newList = this._list.__ensureOwner(ownerID); if (!ownerID) { this.__ownerID = ownerID; this._map = newMap; this._list = newList; return this; } return makeOrderedMap(newMap, newList, ownerID, this.__hash); }; function isOrderedMap(maybeOrderedMap) { return isMap(maybeOrderedMap) && isOrdered(maybeOrderedMap); } OrderedMap.isOrderedMap = isOrderedMap; OrderedMap.prototype[IS_ORDERED_SENTINEL] = true; OrderedMap.prototype[DELETE] = OrderedMap.prototype.remove; function makeOrderedMap(map, list, ownerID, hash) { var omap = Object.create(OrderedMap.prototype); omap.size = map ? map.size : 0; omap._map = map; omap._list = list; omap.__ownerID = ownerID; omap.__hash = hash; return omap; } var EMPTY_ORDERED_MAP; function emptyOrderedMap() { return EMPTY_ORDERED_MAP || (EMPTY_ORDERED_MAP = makeOrderedMap(emptyMap(), emptyList())); } function updateOrderedMap(omap, k, v) { var map = omap._map; var list = omap._list; var i = map.get(k); var has = i !== undefined; var newMap; var newList; if (v === NOT_SET) { // removed if (!has) { return omap; } if (list.size >= SIZE && list.size >= map.size * 2) { newList = list.filter(function(entry, idx) {return entry !== undefined && i !== idx}); newMap = newList.toKeyedSeq().map(function(entry ) {return entry[0]}).flip().toMap(); if (omap.__ownerID) { newMap.__ownerID = newList.__ownerID = omap.__ownerID; } } else { newMap = map.remove(k); newList = i === list.size - 1 ? list.pop() : list.set(i, undefined); } } else { if (has) { if (v === list.get(i)[1]) { return omap; } newMap = map; newList = list.set(i, [k, v]); } else { newMap = map.set(k, list.size); newList = list.set(list.size, [k, v]); } } if (omap.__ownerID) { omap.size = newMap.size; omap._map = newMap; omap._list = newList; omap.__hash = undefined; return omap; } return makeOrderedMap(newMap, newList); } createClass(ToKeyedSequence, KeyedSeq); function ToKeyedSequence(indexed, useKeys) { this._iter = indexed; this._useKeys = useKeys; this.size = indexed.size; } ToKeyedSequence.prototype.get = function(key, notSetValue) { return this._iter.get(key, notSetValue); }; ToKeyedSequence.prototype.has = function(key) { return this._iter.has(key); }; ToKeyedSequence.prototype.valueSeq = function() { return this._iter.valueSeq(); }; ToKeyedSequence.prototype.reverse = function() {var this$0 = this; var reversedSequence = reverseFactory(this, true); if (!this._useKeys) { reversedSequence.valueSeq = function() {return this$0._iter.toSeq().reverse()}; } return reversedSequence; }; ToKeyedSequence.prototype.map = function(mapper, context) {var this$0 = this; var mappedSequence = mapFactory(this, mapper, context); if (!this._useKeys) { mappedSequence.valueSeq = function() {return this$0._iter.toSeq().map(mapper, context)}; } return mappedSequence; }; ToKeyedSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this; var ii; return this._iter.__iterate( this._useKeys ? function(v, k) {return fn(v, k, this$0)} : ((ii = reverse ? resolveSize(this) : 0), function(v ) {return fn(v, reverse ? --ii : ii++, this$0)}), reverse ); }; ToKeyedSequence.prototype.__iterator = function(type, reverse) { if (this._useKeys) { return this._iter.__iterator(type, reverse); } var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); var ii = reverse ? resolveSize(this) : 0; return new Iterator(function() { var step = iterator.next(); return step.done ? step : iteratorValue(type, reverse ? --ii : ii++, step.value, step); }); }; ToKeyedSequence.prototype[IS_ORDERED_SENTINEL] = true; createClass(ToIndexedSequence, IndexedSeq); function ToIndexedSequence(iter) { this._iter = iter; this.size = iter.size; } ToIndexedSequence.prototype.includes = function(value) { return this._iter.includes(value); }; ToIndexedSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this; var iterations = 0; return this._iter.__iterate(function(v ) {return fn(v, iterations++, this$0)}, reverse); }; ToIndexedSequence.prototype.__iterator = function(type, reverse) { var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); var iterations = 0; return new Iterator(function() { var step = iterator.next(); return step.done ? step : iteratorValue(type, iterations++, step.value, step) }); }; createClass(ToSetSequence, SetSeq); function ToSetSequence(iter) { this._iter = iter; this.size = iter.size; } ToSetSequence.prototype.has = function(key) { return this._iter.includes(key); }; ToSetSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this; return this._iter.__iterate(function(v ) {return fn(v, v, this$0)}, reverse); }; ToSetSequence.prototype.__iterator = function(type, reverse) { var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); return new Iterator(function() { var step = iterator.next(); return step.done ? step : iteratorValue(type, step.value, step.value, step); }); }; createClass(FromEntriesSequence, KeyedSeq); function FromEntriesSequence(entries) { this._iter = entries; this.size = entries.size; } FromEntriesSequence.prototype.entrySeq = function() { return this._iter.toSeq(); }; FromEntriesSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this; return this._iter.__iterate(function(entry ) { // Check if entry exists first so array access doesn't throw for holes // in the parent iteration. if (entry) { validateEntry(entry); var indexedIterable = isIterable(entry); return fn( indexedIterable ? entry.get(1) : entry[1], indexedIterable ? entry.get(0) : entry[0], this$0 ); } }, reverse); }; FromEntriesSequence.prototype.__iterator = function(type, reverse) { var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); return new Iterator(function() { while (true) { var step = iterator.next(); if (step.done) { return step; } var entry = step.value; // Check if entry exists first so array access doesn't throw for holes // in the parent iteration. if (entry) { validateEntry(entry); var indexedIterable = isIterable(entry); return iteratorValue( type, indexedIterable ? entry.get(0) : entry[0], indexedIterable ? entry.get(1) : entry[1], step ); } } }); }; ToIndexedSequence.prototype.cacheResult = ToKeyedSequence.prototype.cacheResult = ToSetSequence.prototype.cacheResult = FromEntriesSequence.prototype.cacheResult = cacheResultThrough; function flipFactory(iterable) { var flipSequence = makeSequence(iterable); flipSequence._iter = iterable; flipSequence.size = iterable.size; flipSequence.flip = function() {return iterable}; flipSequence.reverse = function () { var reversedSequence = iterable.reverse.apply(this); // super.reverse() reversedSequence.flip = function() {return iterable.reverse()}; return reversedSequence; }; flipSequence.has = function(key ) {return iterable.includes(key)}; flipSequence.includes = function(key ) {return iterable.has(key)}; flipSequence.cacheResult = cacheResultThrough; flipSequence.__iterateUncached = function (fn, reverse) {var this$0 = this; return iterable.__iterate(function(v, k) {return fn(k, v, this$0) !== false}, reverse); } flipSequence.__iteratorUncached = function(type, reverse) { if (type === ITERATE_ENTRIES) { var iterator = iterable.__iterator(type, reverse); return new Iterator(function() { var step = iterator.next(); if (!step.done) { var k = step.value[0]; step.value[0] = step.value[1]; step.value[1] = k; } return step; }); } return iterable.__iterator( type === ITERATE_VALUES ? ITERATE_KEYS : ITERATE_VALUES, reverse ); } return flipSequence; } function mapFactory(iterable, mapper, context) { var mappedSequence = makeSequence(iterable); mappedSequence.size = iterable.size; mappedSequence.has = function(key ) {return iterable.has(key)}; mappedSequence.get = function(key, notSetValue) { var v = iterable.get(key, NOT_SET); return v === NOT_SET ? notSetValue : mapper.call(context, v, key, iterable); }; mappedSequence.__iterateUncached = function (fn, reverse) {var this$0 = this; return iterable.__iterate( function(v, k, c) {return fn(mapper.call(context, v, k, c), k, this$0) !== false}, reverse ); } mappedSequence.__iteratorUncached = function (type, reverse) { var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); return new Iterator(function() { var step = iterator.next(); if (step.done) { return step; } var entry = step.value; var key = entry[0]; return iteratorValue( type, key, mapper.call(context, entry[1], key, iterable), step ); }); } return mappedSequence; } function reverseFactory(iterable, useKeys) { var reversedSequence = makeSequence(iterable); reversedSequence._iter = iterable; reversedSequence.size = iterable.size; reversedSequence.reverse = function() {return iterable}; if (iterable.flip) { reversedSequence.flip = function () { var flipSequence = flipFactory(iterable); flipSequence.reverse = function() {return iterable.flip()}; return flipSequence; }; } reversedSequence.get = function(key, notSetValue) {return iterable.get(useKeys ? key : -1 - key, notSetValue)}; reversedSequence.has = function(key ) {return iterable.has(useKeys ? key : -1 - key)}; reversedSequence.includes = function(value ) {return iterable.includes(value)}; reversedSequence.cacheResult = cacheResultThrough; reversedSequence.__iterate = function (fn, reverse) {var this$0 = this; return iterable.__iterate(function(v, k) {return fn(v, k, this$0)}, !reverse); }; reversedSequence.__iterator = function(type, reverse) {return iterable.__iterator(type, !reverse)}; return reversedSequence; } function filterFactory(iterable, predicate, context, useKeys) { var filterSequence = makeSequence(iterable); if (useKeys) { filterSequence.has = function(key ) { var v = iterable.get(key, NOT_SET); return v !== NOT_SET && !!predicate.call(context, v, key, iterable); }; filterSequence.get = function(key, notSetValue) { var v = iterable.get(key, NOT_SET); return v !== NOT_SET && predicate.call(context, v, key, iterable) ? v : notSetValue; }; } filterSequence.__iterateUncached = function (fn, reverse) {var this$0 = this; var iterations = 0; iterable.__iterate(function(v, k, c) { if (predicate.call(context, v, k, c)) { iterations++; return fn(v, useKeys ? k : iterations - 1, this$0); } }, reverse); return iterations; }; filterSequence.__iteratorUncached = function (type, reverse) { var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); var iterations = 0; return new Iterator(function() { while (true) { var step = iterator.next(); if (step.done) { return step; } var entry = step.value; var key = entry[0]; var value = entry[1]; if (predicate.call(context, value, key, iterable)) { return iteratorValue(type, useKeys ? key : iterations++, value, step); } } }); } return filterSequence; } function countByFactory(iterable, grouper, context) { var groups = Map().asMutable(); iterable.__iterate(function(v, k) { groups.update( grouper.call(context, v, k, iterable), 0, function(a ) {return a + 1} ); }); return groups.asImmutable(); } function groupByFactory(iterable, grouper, context) { var isKeyedIter = isKeyed(iterable); var groups = (isOrdered(iterable) ? OrderedMap() : Map()).asMutable(); iterable.__iterate(function(v, k) { groups.update( grouper.call(context, v, k, iterable), function(a ) {return (a = a || [], a.push(isKeyedIter ? [k, v] : v), a)} ); }); var coerce = iterableClass(iterable); return groups.map(function(arr ) {return reify(iterable, coerce(arr))}); } function sliceFactory(iterable, begin, end, useKeys) { var originalSize = iterable.size; // Sanitize begin & end using this shorthand for ToInt32(argument) // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32 if (begin !== undefined) { begin = begin | 0; } if (end !== undefined) { if (end === Infinity) { end = originalSize; } else { end = end | 0; } } if (wholeSlice(begin, end, originalSize)) { return iterable; } var resolvedBegin = resolveBegin(begin, originalSize); var resolvedEnd = resolveEnd(end, originalSize); // begin or end will be NaN if they were provided as negative numbers and // this iterable's size is unknown. In that case, cache first so there is // a known size and these do not resolve to NaN. if (resolvedBegin !== resolvedBegin || resolvedEnd !== resolvedEnd) { return sliceFactory(iterable.toSeq().cacheResult(), begin, end, useKeys); } // Note: resolvedEnd is undefined when the original sequence's length is // unknown and this slice did not supply an end and should contain all // elements after resolvedBegin. // In that case, resolvedSize will be NaN and sliceSize will remain undefined. var resolvedSize = resolvedEnd - resolvedBegin; var sliceSize; if (resolvedSize === resolvedSize) { sliceSize = resolvedSize < 0 ? 0 : resolvedSize; } var sliceSeq = makeSequence(iterable); // If iterable.size is undefined, the size of the realized sliceSeq is // unknown at this point unless the number of items to slice is 0 sliceSeq.size = sliceSize === 0 ? sliceSize : iterable.size && sliceSize || undefined; if (!useKeys && isSeq(iterable) && sliceSize >= 0) { sliceSeq.get = function (index, notSetValue) { index = wrapIndex(this, index); return index >= 0 && index < sliceSize ? iterable.get(index + resolvedBegin, notSetValue) : notSetValue; } } sliceSeq.__iterateUncached = function(fn, reverse) {var this$0 = this; if (sliceSize === 0) { return 0; } if (reverse) { return this.cacheResult().__iterate(fn, reverse); } var skipped = 0; var isSkipping = true; var iterations = 0; iterable.__iterate(function(v, k) { if (!(isSkipping && (isSkipping = skipped++ < resolvedBegin))) { iterations++; return fn(v, useKeys ? k : iterations - 1, this$0) !== false && iterations !== sliceSize; } }); return iterations; }; sliceSeq.__iteratorUncached = function(type, reverse) { if (sliceSize !== 0 && reverse) { return this.cacheResult().__iterator(type, reverse); } // Don't bother instantiating parent iterator if taking 0. var iterator = sliceSize !== 0 && iterable.__iterator(type, reverse); var skipped = 0; var iterations = 0; return new Iterator(function() { while (skipped++ < resolvedBegin) { iterator.next(); } if (++iterations > sliceSize) { return iteratorDone(); } var step = iterator.next(); if (useKeys || type === ITERATE_VALUES) { return step; } else if (type === ITERATE_KEYS) { return iteratorValue(type, iterations - 1, undefined, step); } else { return iteratorValue(type, iterations - 1, step.value[1], step); } }); } return sliceSeq; } function takeWhileFactory(iterable, predicate, context) { var takeSequence = makeSequence(iterable); takeSequence.__iterateUncached = function(fn, reverse) {var this$0 = this; if (reverse) { return this.cacheResult().__iterate(fn, reverse); } var iterations = 0; iterable.__iterate(function(v, k, c) {return predicate.call(context, v, k, c) && ++iterations && fn(v, k, this$0)} ); return iterations; }; takeSequence.__iteratorUncached = function(type, reverse) {var this$0 = this; if (reverse) { return this.cacheResult().__iterator(type, reverse); } var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); var iterating = true; return new Iterator(function() { if (!iterating) { return iteratorDone(); } var step = iterator.next(); if (step.done) { return step; } var entry = step.value; var k = entry[0]; var v = entry[1]; if (!predicate.call(context, v, k, this$0)) { iterating = false; return iteratorDone(); } return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step); }); }; return takeSequence; } function skipWhileFactory(iterable, predicate, context, useKeys) { var skipSequence = makeSequence(iterable); skipSequence.__iterateUncached = function (fn, reverse) {var this$0 = this; if (reverse) { return this.cacheResult().__iterate(fn, reverse); } var isSkipping = true; var iterations = 0; iterable.__iterate(function(v, k, c) { if (!(isSkipping && (isSkipping = predicate.call(context, v, k, c)))) { iterations++; return fn(v, useKeys ? k : iterations - 1, this$0); } }); return iterations; }; skipSequence.__iteratorUncached = function(type, reverse) {var this$0 = this; if (reverse) { return this.cacheResult().__iterator(type, reverse); } var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); var skipping = true; var iterations = 0; return new Iterator(function() { var step, k, v; do { step = iterator.next(); if (step.done) { if (useKeys || type === ITERATE_VALUES) { return step; } else if (type === ITERATE_KEYS) { return iteratorValue(type, iterations++, undefined, step); } else { return iteratorValue(type, iterations++, step.value[1], step); } } var entry = step.value; k = entry[0]; v = entry[1]; skipping && (skipping = predicate.call(context, v, k, this$0)); } while (skipping); return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step); }); }; return skipSequence; } function concatFactory(iterable, values) { var isKeyedIterable = isKeyed(iterable); var iters = [iterable].concat(values).map(function(v ) { if (!isIterable(v)) { v = isKeyedIterable ? keyedSeqFromValue(v) : indexedSeqFromValue(Array.isArray(v) ? v : [v]); } else if (isKeyedIterable) { v = KeyedIterable(v); } return v; }).filter(function(v ) {return v.size !== 0}); if (iters.length === 0) { return iterable; } if (iters.length === 1) { var singleton = iters[0]; if (singleton === iterable || isKeyedIterable && isKeyed(singleton) || isIndexed(iterable) && isIndexed(singleton)) { return singleton; } } var concatSeq = new ArraySeq(iters); if (isKeyedIterable) { concatSeq = concatSeq.toKeyedSeq(); } else if (!isIndexed(iterable)) { concatSeq = concatSeq.toSetSeq(); } concatSeq = concatSeq.flatten(true); concatSeq.size = iters.reduce( function(sum, seq) { if (sum !== undefined) { var size = seq.size; if (size !== undefined) { return sum + size; } } }, 0 ); return concatSeq; } function flattenFactory(iterable, depth, useKeys) { var flatSequence = makeSequence(iterable); flatSequence.__iterateUncached = function(fn, reverse) { var iterations = 0; var stopped = false; function flatDeep(iter, currentDepth) {var this$0 = this; iter.__iterate(function(v, k) { if ((!depth || currentDepth < depth) && isIterable(v)) { flatDeep(v, currentDepth + 1); } else if (fn(v, useKeys ? k : iterations++, this$0) === false) { stopped = true; } return !stopped; }, reverse); } flatDeep(iterable, 0); return iterations; } flatSequence.__iteratorUncached = function(type, reverse) { var iterator = iterable.__iterator(type, reverse); var stack = []; var iterations = 0; return new Iterator(function() { while (iterator) { var step = iterator.next(); if (step.done !== false) { iterator = stack.pop(); continue; } var v = step.value; if (type === ITERATE_ENTRIES) { v = v[1]; } if ((!depth || stack.length < depth) && isIterable(v)) { stack.push(iterator); iterator = v.__iterator(type, reverse); } else { return useKeys ? step : iteratorValue(type, iterations++, v, step); } } return iteratorDone(); }); } return flatSequence; } function flatMapFactory(iterable, mapper, context) { var coerce = iterableClass(iterable); return iterable.toSeq().map( function(v, k) {return coerce(mapper.call(context, v, k, iterable))} ).flatten(true); } function interposeFactory(iterable, separator) { var interposedSequence = makeSequence(iterable); interposedSequence.size = iterable.size && iterable.size * 2 -1; interposedSequence.__iterateUncached = function(fn, reverse) {var this$0 = this; var iterations = 0; iterable.__iterate(function(v, k) {return (!iterations || fn(separator, iterations++, this$0) !== false) && fn(v, iterations++, this$0) !== false}, reverse ); return iterations; }; interposedSequence.__iteratorUncached = function(type, reverse) { var iterator = iterable.__iterator(ITERATE_VALUES, reverse); var iterations = 0; var step; return new Iterator(function() { if (!step || iterations % 2) { step = iterator.next(); if (step.done) { return step; } } return iterations % 2 ? iteratorValue(type, iterations++, separator) : iteratorValue(type, iterations++, step.value, step); }); }; return interposedSequence; } function sortFactory(iterable, comparator, mapper) { if (!comparator) { comparator = defaultComparator; } var isKeyedIterable = isKeyed(iterable); var index = 0; var entries = iterable.toSeq().map( function(v, k) {return [k, v, index++, mapper ? mapper(v, k, iterable) : v]} ).toArray(); entries.sort(function(a, b) {return comparator(a[3], b[3]) || a[2] - b[2]}).forEach( isKeyedIterable ? function(v, i) { entries[i].length = 2; } : function(v, i) { entries[i] = v[1]; } ); return isKeyedIterable ? KeyedSeq(entries) : isIndexed(iterable) ? IndexedSeq(entries) : SetSeq(entries); } function maxFactory(iterable, comparator, mapper) { if (!comparator) { comparator = defaultComparator; } if (mapper) { var entry = iterable.toSeq() .map(function(v, k) {return [v, mapper(v, k, iterable)]}) .reduce(function(a, b) {return maxCompare(comparator, a[1], b[1]) ? b : a}); return entry && entry[0]; } else { return iterable.reduce(function(a, b) {return maxCompare(comparator, a, b) ? b : a}); } } function maxCompare(comparator, a, b) { var comp = comparator(b, a); // b is considered the new max if the comparator declares them equal, but // they are not equal and b is in fact a nullish value. return (comp === 0 && b !== a && (b === undefined || b === null || b !== b)) || comp > 0; } function zipWithFactory(keyIter, zipper, iters) { var zipSequence = makeSequence(keyIter); zipSequence.size = new ArraySeq(iters).map(function(i ) {return i.size}).min(); // Note: this a generic base implementation of __iterate in terms of // __iterator which may be more generically useful in the future. zipSequence.__iterate = function(fn, reverse) { /* generic: var iterator = this.__iterator(ITERATE_ENTRIES, reverse); var step; var iterations = 0; while (!(step = iterator.next()).done) { iterations++; if (fn(step.value[1], step.value[0], this) === false) { break; } } return iterations; */ // indexed: var iterator = this.__iterator(ITERATE_VALUES, reverse); var step; var iterations = 0; while (!(step = iterator.next()).done) { if (fn(step.value, iterations++, this) === false) { break; } } return iterations; }; zipSequence.__iteratorUncached = function(type, reverse) { var iterators = iters.map(function(i ) {return (i = Iterable(i), getIterator(reverse ? i.reverse() : i))} ); var iterations = 0; var isDone = false; return new Iterator(function() { var steps; if (!isDone) { steps = iterators.map(function(i ) {return i.next()}); isDone = steps.some(function(s ) {return s.done}); } if (isDone) { return iteratorDone(); } return iteratorValue( type, iterations++, zipper.apply(null, steps.map(function(s ) {return s.value})) ); }); }; return zipSequence } // #pragma Helper Functions function reify(iter, seq) { return isSeq(iter) ? seq : iter.constructor(seq); } function validateEntry(entry) { if (entry !== Object(entry)) { throw new TypeError('Expected [K, V] tuple: ' + entry); } } function resolveSize(iter) { assertNotInfinite(iter.size); return ensureSize(iter); } function iterableClass(iterable) { return isKeyed(iterable) ? KeyedIterable : isIndexed(iterable) ? IndexedIterable : SetIterable; } function makeSequence(iterable) { return Object.create( ( isKeyed(iterable) ? KeyedSeq : isIndexed(iterable) ? IndexedSeq : SetSeq ).prototype ); } function cacheResultThrough() { if (this._iter.cacheResult) { this._iter.cacheResult(); this.size = this._iter.size; return this; } else { return Seq.prototype.cacheResult.call(this); } } function defaultComparator(a, b) { return a > b ? 1 : a < b ? -1 : 0; } function forceIterator(keyPath) { var iter = getIterator(keyPath); if (!iter) { // Array might not be iterable in this environment, so we need a fallback // to our wrapped type. if (!isArrayLike(keyPath)) { throw new TypeError('Expected iterable or array-like: ' + keyPath); } iter = getIterator(Iterable(keyPath)); } return iter; } createClass(Record, KeyedCollection); function Record(defaultValues, name) { var hasInitialized; var RecordType = function Record(values) { if (values instanceof RecordType) { return values; } if (!(this instanceof RecordType)) { return new RecordType(values); } if (!hasInitialized) { hasInitialized = true; var keys = Object.keys(defaultValues); setProps(RecordTypePrototype, keys); RecordTypePrototype.size = keys.length; RecordTypePrototype._name = name; RecordTypePrototype._keys = keys; RecordTypePrototype._defaultValues = defaultValues; } this._map = Map(values); }; var RecordTypePrototype = RecordType.prototype = Object.create(RecordPrototype); RecordTypePrototype.constructor = RecordType; return RecordType; } Record.prototype.toString = function() { return this.__toString(recordName(this) + ' {', '}'); }; // @pragma Access Record.prototype.has = function(k) { return this._defaultValues.hasOwnProperty(k); }; Record.prototype.get = function(k, notSetValue) { if (!this.has(k)) { return notSetValue; } var defaultVal = this._defaultValues[k]; return this._map ? this._map.get(k, defaultVal) : defaultVal; }; // @pragma Modification Record.prototype.clear = function() { if (this.__ownerID) { this._map && this._map.clear(); return this; } var RecordType = this.constructor; return RecordType._empty || (RecordType._empty = makeRecord(this, emptyMap())); }; Record.prototype.set = function(k, v) { if (!this.has(k)) { throw new Error('Cannot set unknown key "' + k + '" on ' + recordName(this)); } if (this._map && !this._map.has(k)) { var defaultVal = this._defaultValues[k]; if (v === defaultVal) { return this; } } var newMap = this._map && this._map.set(k, v); if (this.__ownerID || newMap === this._map) { return this; } return makeRecord(this, newMap); }; Record.prototype.remove = function(k) { if (!this.has(k)) { return this; } var newMap = this._map && this._map.remove(k); if (this.__ownerID || newMap === this._map) { return this; } return makeRecord(this, newMap); }; Record.prototype.wasAltered = function() { return this._map.wasAltered(); }; Record.prototype.__iterator = function(type, reverse) {var this$0 = this; return KeyedIterable(this._defaultValues).map(function(_, k) {return this$0.get(k)}).__iterator(type, reverse); }; Record.prototype.__iterate = function(fn, reverse) {var this$0 = this; return KeyedIterable(this._defaultValues).map(function(_, k) {return this$0.get(k)}).__iterate(fn, reverse); }; Record.prototype.__ensureOwner = function(ownerID) { if (ownerID === this.__ownerID) { return this; } var newMap = this._map && this._map.__ensureOwner(ownerID); if (!ownerID) { this.__ownerID = ownerID; this._map = newMap; return this; } return makeRecord(this, newMap, ownerID); }; var RecordPrototype = Record.prototype; RecordPrototype[DELETE] = RecordPrototype.remove; RecordPrototype.deleteIn = RecordPrototype.removeIn = MapPrototype.removeIn; RecordPrototype.merge = MapPrototype.merge; RecordPrototype.mergeWith = MapPrototype.mergeWith; RecordPrototype.mergeIn = MapPrototype.mergeIn; RecordPrototype.mergeDeep = MapPrototype.mergeDeep; RecordPrototype.mergeDeepWith = MapPrototype.mergeDeepWith; RecordPrototype.mergeDeepIn = MapPrototype.mergeDeepIn; RecordPrototype.setIn = MapPrototype.setIn; RecordPrototype.update = MapPrototype.update; RecordPrototype.updateIn = MapPrototype.updateIn; RecordPrototype.withMutations = MapPrototype.withMutations; RecordPrototype.asMutable = MapPrototype.asMutable; RecordPrototype.asImmutable = MapPrototype.asImmutable; function makeRecord(likeRecord, map, ownerID) { var record = Object.create(Object.getPrototypeOf(likeRecord)); record._map = map; record.__ownerID = ownerID; return record; } function recordName(record) { return record._name || record.constructor.name || 'Record'; } function setProps(prototype, names) { try { names.forEach(setProp.bind(undefined, prototype)); } catch (error) { // Object.defineProperty failed. Probably IE8. } } function setProp(prototype, name) { Object.defineProperty(prototype, name, { get: function() { return this.get(name); }, set: function(value) { invariant(this.__ownerID, 'Cannot set on an immutable record.'); this.set(name, value); } }); } createClass(Set, SetCollection); // @pragma Construction function Set(value) { return value === null || value === undefined ? emptySet() : isSet(value) && !isOrdered(value) ? value : emptySet().withMutations(function(set ) { var iter = SetIterable(value); assertNotInfinite(iter.size); iter.forEach(function(v ) {return set.add(v)}); }); } Set.of = function(/*...values*/) { return this(arguments); }; Set.fromKeys = function(value) { return this(KeyedIterable(value).keySeq()); }; Set.prototype.toString = function() { return this.__toString('Set {', '}'); }; // @pragma Access Set.prototype.has = function(value) { return this._map.has(value); }; // @pragma Modification Set.prototype.add = function(value) { return updateSet(this, this._map.set(value, true)); }; Set.prototype.remove = function(value) { return updateSet(this, this._map.remove(value)); }; Set.prototype.clear = function() { return updateSet(this, this._map.clear()); }; // @pragma Composition Set.prototype.union = function() {var iters = SLICE$0.call(arguments, 0); iters = iters.filter(function(x ) {return x.size !== 0}); if (iters.length === 0) { return this; } if (this.size === 0 && !this.__ownerID && iters.length === 1) { return this.constructor(iters[0]); } return this.withMutations(function(set ) { for (var ii = 0; ii < iters.length; ii++) { SetIterable(iters[ii]).forEach(function(value ) {return set.add(value)}); } }); }; Set.prototype.intersect = function() {var iters = SLICE$0.call(arguments, 0); if (iters.length === 0) { return this; } iters = iters.map(function(iter ) {return SetIterable(iter)}); var originalSet = this; return this.withMutations(function(set ) { originalSet.forEach(function(value ) { if (!iters.every(function(iter ) {return iter.includes(value)})) { set.remove(value); } }); }); }; Set.prototype.subtract = function() {var iters = SLICE$0.call(arguments, 0); if (iters.length === 0) { return this; } iters = iters.map(function(iter ) {return SetIterable(iter)}); var originalSet = this; return this.withMutations(function(set ) { originalSet.forEach(function(value ) { if (iters.some(function(iter ) {return iter.includes(value)})) { set.remove(value); } }); }); }; Set.prototype.merge = function() { return this.union.apply(this, arguments); }; Set.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1); return this.union.apply(this, iters); }; Set.prototype.sort = function(comparator) { // Late binding return OrderedSet(sortFactory(this, comparator)); }; Set.prototype.sortBy = function(mapper, comparator) { // Late binding return OrderedSet(sortFactory(this, comparator, mapper)); }; Set.prototype.wasAltered = function() { return this._map.wasAltered(); }; Set.prototype.__iterate = function(fn, reverse) {var this$0 = this; return this._map.__iterate(function(_, k) {return fn(k, k, this$0)}, reverse); }; Set.prototype.__iterator = function(type, reverse) { return this._map.map(function(_, k) {return k}).__iterator(type, reverse); }; Set.prototype.__ensureOwner = function(ownerID) { if (ownerID === this.__ownerID) { return this; } var newMap = this._map.__ensureOwner(ownerID); if (!ownerID) { this.__ownerID = ownerID; this._map = newMap; return this; } return this.__make(newMap, ownerID); }; function isSet(maybeSet) { return !!(maybeSet && maybeSet[IS_SET_SENTINEL]); } Set.isSet = isSet; var IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@'; var SetPrototype = Set.prototype; SetPrototype[IS_SET_SENTINEL] = true; SetPrototype[DELETE] = SetPrototype.remove; SetPrototype.mergeDeep = SetPrototype.merge; SetPrototype.mergeDeepWith = SetPrototype.mergeWith; SetPrototype.withMutations = MapPrototype.withMutations; SetPrototype.asMutable = MapPrototype.asMutable; SetPrototype.asImmutable = MapPrototype.asImmutable; SetPrototype.__empty = emptySet; SetPrototype.__make = makeSet; function updateSet(set, newMap) { if (set.__ownerID) { set.size = newMap.size; set._map = newMap; return set; } return newMap === set._map ? set : newMap.size === 0 ? set.__empty() : set.__make(newMap); } function makeSet(map, ownerID) { var set = Object.create(SetPrototype); set.size = map ? map.size : 0; set._map = map; set.__ownerID = ownerID; return set; } var EMPTY_SET; function emptySet() { return EMPTY_SET || (EMPTY_SET = makeSet(emptyMap())); } createClass(OrderedSet, Set); // @pragma Construction function OrderedSet(value) { return value === null || value === undefined ? emptyOrderedSet() : isOrderedSet(value) ? value : emptyOrderedSet().withMutations(function(set ) { var iter = SetIterable(value); assertNotInfinite(iter.size); iter.forEach(function(v ) {return set.add(v)}); }); } OrderedSet.of = function(/*...values*/) { return this(arguments); }; OrderedSet.fromKeys = function(value) { return this(KeyedIterable(value).keySeq()); }; OrderedSet.prototype.toString = function() { return this.__toString('OrderedSet {', '}'); }; function isOrderedSet(maybeOrderedSet) { return isSet(maybeOrderedSet) && isOrdered(maybeOrderedSet); } OrderedSet.isOrderedSet = isOrderedSet; var OrderedSetPrototype = OrderedSet.prototype; OrderedSetPrototype[IS_ORDERED_SENTINEL] = true; OrderedSetPrototype.__empty = emptyOrderedSet; OrderedSetPrototype.__make = makeOrderedSet; function makeOrderedSet(map, ownerID) { var set = Object.create(OrderedSetPrototype); set.size = map ? map.size : 0; set._map = map; set.__ownerID = ownerID; return set; } var EMPTY_ORDERED_SET; function emptyOrderedSet() { return EMPTY_ORDERED_SET || (EMPTY_ORDERED_SET = makeOrderedSet(emptyOrderedMap())); } createClass(Stack, IndexedCollection); // @pragma Construction function Stack(value) { return value === null || value === undefined ? emptyStack() : isStack(value) ? value : emptyStack().unshiftAll(value); } Stack.of = function(/*...values*/) { return this(arguments); }; Stack.prototype.toString = function() { return this.__toString('Stack [', ']'); }; // @pragma Access Stack.prototype.get = function(index, notSetValue) { var head = this._head; index = wrapIndex(this, index); while (head && index--) { head = head.next; } return head ? head.value : notSetValue; }; Stack.prototype.peek = function() { return this._head && this._head.value; }; // @pragma Modification Stack.prototype.push = function(/*...values*/) { if (arguments.length === 0) { return this; } var newSize = this.size + arguments.length; var head = this._head; for (var ii = arguments.length - 1; ii >= 0; ii--) { head = { value: arguments[ii], next: head }; } if (this.__ownerID) { this.size = newSize; this._head = head; this.__hash = undefined; this.__altered = true; return this; } return makeStack(newSize, head); }; Stack.prototype.pushAll = function(iter) { iter = IndexedIterable(iter); if (iter.size === 0) { return this; } assertNotInfinite(iter.size); var newSize = this.size; var head = this._head; iter.reverse().forEach(function(value ) { newSize++; head = { value: value, next: head }; }); if (this.__ownerID) { this.size = newSize; this._head = head; this.__hash = undefined; this.__altered = true; return this; } return makeStack(newSize, head); }; Stack.prototype.pop = function() { return this.slice(1); }; Stack.prototype.unshift = function(/*...values*/) { return this.push.apply(this, arguments); }; Stack.prototype.unshiftAll = function(iter) { return this.pushAll(iter); }; Stack.prototype.shift = function() { return this.pop.apply(this, arguments); }; Stack.prototype.clear = function() { if (this.size === 0) { return this; } if (this.__ownerID) { this.size = 0; this._head = undefined; this.__hash = undefined; this.__altered = true; return this; } return emptyStack(); }; Stack.prototype.slice = function(begin, end) { if (wholeSlice(begin, end, this.size)) { return this; } var resolvedBegin = resolveBegin(begin, this.size); var resolvedEnd = resolveEnd(end, this.size); if (resolvedEnd !== this.size) { // super.slice(begin, end); return IndexedCollection.prototype.slice.call(this, begin, end); } var newSize = this.size - resolvedBegin; var head = this._head; while (resolvedBegin--) { head = head.next; } if (this.__ownerID) { this.size = newSize; this._head = head; this.__hash = undefined; this.__altered = true; return this; } return makeStack(newSize, head); }; // @pragma Mutability Stack.prototype.__ensureOwner = function(ownerID) { if (ownerID === this.__ownerID) { return this; } if (!ownerID) { this.__ownerID = ownerID; this.__altered = false; return this; } return makeStack(this.size, this._head, ownerID, this.__hash); }; // @pragma Iteration Stack.prototype.__iterate = function(fn, reverse) { if (reverse) { return this.reverse().__iterate(fn); } var iterations = 0; var node = this._head; while (node) { if (fn(node.value, iterations++, this) === false) { break; } node = node.next; } return iterations; }; Stack.prototype.__iterator = function(type, reverse) { if (reverse) { return this.reverse().__iterator(type); } var iterations = 0; var node = this._head; return new Iterator(function() { if (node) { var value = node.value; node = node.next; return iteratorValue(type, iterations++, value); } return iteratorDone(); }); }; function isStack(maybeStack) { return !!(maybeStack && maybeStack[IS_STACK_SENTINEL]); } Stack.isStack = isStack; var IS_STACK_SENTINEL = '@@__IMMUTABLE_STACK__@@'; var StackPrototype = Stack.prototype; StackPrototype[IS_STACK_SENTINEL] = true; StackPrototype.withMutations = MapPrototype.withMutations; StackPrototype.asMutable = MapPrototype.asMutable; StackPrototype.asImmutable = MapPrototype.asImmutable; StackPrototype.wasAltered = MapPrototype.wasAltered; function makeStack(size, head, ownerID, hash) { var map = Object.create(StackPrototype); map.size = size; map._head = head; map.__ownerID = ownerID; map.__hash = hash; map.__altered = false; return map; } var EMPTY_STACK; function emptyStack() { return EMPTY_STACK || (EMPTY_STACK = makeStack(0)); } /** * Contributes additional methods to a constructor */ function mixin(ctor, methods) { var keyCopier = function(key ) { ctor.prototype[key] = methods[key]; }; Object.keys(methods).forEach(keyCopier); Object.getOwnPropertySymbols && Object.getOwnPropertySymbols(methods).forEach(keyCopier); return ctor; } Iterable.Iterator = Iterator; mixin(Iterable, { // ### Conversion to other types toArray: function() { assertNotInfinite(this.size); var array = new Array(this.size || 0); this.valueSeq().__iterate(function(v, i) { array[i] = v; }); return array; }, toIndexedSeq: function() { return new ToIndexedSequence(this); }, toJS: function() { return this.toSeq().map( function(value ) {return value && typeof value.toJS === 'function' ? value.toJS() : value} ).__toJS(); }, toJSON: function() { return this.toSeq().map( function(value ) {return value && typeof value.toJSON === 'function' ? value.toJSON() : value} ).__toJS(); }, toKeyedSeq: function() { return new ToKeyedSequence(this, true); }, toMap: function() { // Use Late Binding here to solve the circular dependency. return Map(this.toKeyedSeq()); }, toObject: function() { assertNotInfinite(this.size); var object = {}; this.__iterate(function(v, k) { object[k] = v; }); return object; }, toOrderedMap: function() { // Use Late Binding here to solve the circular dependency. return OrderedMap(this.toKeyedSeq()); }, toOrderedSet: function() { // Use Late Binding here to solve the circular dependency. return OrderedSet(isKeyed(this) ? this.valueSeq() : this); }, toSet: function() { // Use Late Binding here to solve the circular dependency. return Set(isKeyed(this) ? this.valueSeq() : this); }, toSetSeq: function() { return new ToSetSequence(this); }, toSeq: function() { return isIndexed(this) ? this.toIndexedSeq() : isKeyed(this) ? this.toKeyedSeq() : this.toSetSeq(); }, toStack: function() { // Use Late Binding here to solve the circular dependency. return Stack(isKeyed(this) ? this.valueSeq() : this); }, toList: function() { // Use Late Binding here to solve the circular dependency. return List(isKeyed(this) ? this.valueSeq() : this); }, // ### Common JavaScript methods and properties toString: function() { return '[Iterable]'; }, __toString: function(head, tail) { if (this.size === 0) { return head + tail; } return head + ' ' + this.toSeq().map(this.__toStringMapper).join(', ') + ' ' + tail; }, // ### ES6 Collection methods (ES6 Array and Map) concat: function() {var values = SLICE$0.call(arguments, 0); return reify(this, concatFactory(this, values)); }, includes: function(searchValue) { return this.some(function(value ) {return is(value, searchValue)}); }, entries: function() { return this.__iterator(ITERATE_ENTRIES); }, every: function(predicate, context) { assertNotInfinite(this.size); var returnValue = true; this.__iterate(function(v, k, c) { if (!predicate.call(context, v, k, c)) { returnValue = false; return false; } }); return returnValue; }, filter: function(predicate, context) { return reify(this, filterFactory(this, predicate, context, true)); }, find: function(predicate, context, notSetValue) { var entry = this.findEntry(predicate, context); return entry ? entry[1] : notSetValue; }, forEach: function(sideEffect, context) { assertNotInfinite(this.size); return this.__iterate(context ? sideEffect.bind(context) : sideEffect); }, join: function(separator) { assertNotInfinite(this.size); separator = separator !== undefined ? '' + separator : ','; var joined = ''; var isFirst = true; this.__iterate(function(v ) { isFirst ? (isFirst = false) : (joined += separator); joined += v !== null && v !== undefined ? v.toString() : ''; }); return joined; }, keys: function() { return this.__iterator(ITERATE_KEYS); }, map: function(mapper, context) { return reify(this, mapFactory(this, mapper, context)); }, reduce: function(reducer, initialReduction, context) { assertNotInfinite(this.size); var reduction; var useFirst; if (arguments.length < 2) { useFirst = true; } else { reduction = initialReduction; } this.__iterate(function(v, k, c) { if (useFirst) { useFirst = false; reduction = v; } else { reduction = reducer.call(context, reduction, v, k, c); } }); return reduction; }, reduceRight: function(reducer, initialReduction, context) { var reversed = this.toKeyedSeq().reverse(); return reversed.reduce.apply(reversed, arguments); }, reverse: function() { return reify(this, reverseFactory(this, true)); }, slice: function(begin, end) { return reify(this, sliceFactory(this, begin, end, true)); }, some: function(predicate, context) { return !this.every(not(predicate), context); }, sort: function(comparator) { return reify(this, sortFactory(this, comparator)); }, values: function() { return this.__iterator(ITERATE_VALUES); }, // ### More sequential methods butLast: function() { return this.slice(0, -1); }, isEmpty: function() { return this.size !== undefined ? this.size === 0 : !this.some(function() {return true}); }, count: function(predicate, context) { return ensureSize( predicate ? this.toSeq().filter(predicate, context) : this ); }, countBy: function(grouper, context) { return countByFactory(this, grouper, context); }, equals: function(other) { return deepEqual(this, other); }, entrySeq: function() { var iterable = this; if (iterable._cache) { // We cache as an entries array, so we can just return the cache! return new ArraySeq(iterable._cache); } var entriesSequence = iterable.toSeq().map(entryMapper).toIndexedSeq(); entriesSequence.fromEntrySeq = function() {return iterable.toSeq()}; return entriesSequence; }, filterNot: function(predicate, context) { return this.filter(not(predicate), context); }, findEntry: function(predicate, context, notSetValue) { var found = notSetValue; this.__iterate(function(v, k, c) { if (predicate.call(context, v, k, c)) { found = [k, v]; return false; } }); return found; }, findKey: function(predicate, context) { var entry = this.findEntry(predicate, context); return entry && entry[0]; }, findLast: function(predicate, context, notSetValue) { return this.toKeyedSeq().reverse().find(predicate, context, notSetValue); }, findLastEntry: function(predicate, context, notSetValue) { return this.toKeyedSeq().reverse().findEntry(predicate, context, notSetValue); }, findLastKey: function(predicate, context) { return this.toKeyedSeq().reverse().findKey(predicate, context); }, first: function() { return this.find(returnTrue); }, flatMap: function(mapper, context) { return reify(this, flatMapFactory(this, mapper, context)); }, flatten: function(depth) { return reify(this, flattenFactory(this, depth, true)); }, fromEntrySeq: function() { return new FromEntriesSequence(this); }, get: function(searchKey, notSetValue) { return this.find(function(_, key) {return is(key, searchKey)}, undefined, notSetValue); }, getIn: function(searchKeyPath, notSetValue) { var nested = this; // Note: in an ES6 environment, we would prefer: // for (var key of searchKeyPath) { var iter = forceIterator(searchKeyPath); var step; while (!(step = iter.next()).done) { var key = step.value; nested = nested && nested.get ? nested.get(key, NOT_SET) : NOT_SET; if (nested === NOT_SET) { return notSetValue; } } return nested; }, groupBy: function(grouper, context) { return groupByFactory(this, grouper, context); }, has: function(searchKey) { return this.get(searchKey, NOT_SET) !== NOT_SET; }, hasIn: function(searchKeyPath) { return this.getIn(searchKeyPath, NOT_SET) !== NOT_SET; }, isSubset: function(iter) { iter = typeof iter.includes === 'function' ? iter : Iterable(iter); return this.every(function(value ) {return iter.includes(value)}); }, isSuperset: function(iter) { iter = typeof iter.isSubset === 'function' ? iter : Iterable(iter); return iter.isSubset(this); }, keyOf: function(searchValue) { return this.findKey(function(value ) {return is(value, searchValue)}); }, keySeq: function() { return this.toSeq().map(keyMapper).toIndexedSeq(); }, last: function() { return this.toSeq().reverse().first(); }, lastKeyOf: function(searchValue) { return this.toKeyedSeq().reverse().keyOf(searchValue); }, max: function(comparator) { return maxFactory(this, comparator); }, maxBy: function(mapper, comparator) { return maxFactory(this, comparator, mapper); }, min: function(comparator) { return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator); }, minBy: function(mapper, comparator) { return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator, mapper); }, rest: function() { return this.slice(1); }, skip: function(amount) { return this.slice(Math.max(0, amount)); }, skipLast: function(amount) { return reify(this, this.toSeq().reverse().skip(amount).reverse()); }, skipWhile: function(predicate, context) { return reify(this, skipWhileFactory(this, predicate, context, true)); }, skipUntil: function(predicate, context) { return this.skipWhile(not(predicate), context); }, sortBy: function(mapper, comparator) { return reify(this, sortFactory(this, comparator, mapper)); }, take: function(amount) { return this.slice(0, Math.max(0, amount)); }, takeLast: function(amount) { return reify(this, this.toSeq().reverse().take(amount).reverse()); }, takeWhile: function(predicate, context) { return reify(this, takeWhileFactory(this, predicate, context)); }, takeUntil: function(predicate, context) { return this.takeWhile(not(predicate), context); }, valueSeq: function() { return this.toIndexedSeq(); }, // ### Hashable Object hashCode: function() { return this.__hash || (this.__hash = hashIterable(this)); } // ### Internal // abstract __iterate(fn, reverse) // abstract __iterator(type, reverse) }); // var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@'; // var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@'; // var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@'; // var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@'; var IterablePrototype = Iterable.prototype; IterablePrototype[IS_ITERABLE_SENTINEL] = true; IterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.values; IterablePrototype.__toJS = IterablePrototype.toArray; IterablePrototype.__toStringMapper = quoteString; IterablePrototype.inspect = IterablePrototype.toSource = function() { return this.toString(); }; IterablePrototype.chain = IterablePrototype.flatMap; IterablePrototype.contains = IterablePrototype.includes; mixin(KeyedIterable, { // ### More sequential methods flip: function() { return reify(this, flipFactory(this)); }, mapEntries: function(mapper, context) {var this$0 = this; var iterations = 0; return reify(this, this.toSeq().map( function(v, k) {return mapper.call(context, [k, v], iterations++, this$0)} ).fromEntrySeq() ); }, mapKeys: function(mapper, context) {var this$0 = this; return reify(this, this.toSeq().flip().map( function(k, v) {return mapper.call(context, k, v, this$0)} ).flip() ); } }); var KeyedIterablePrototype = KeyedIterable.prototype; KeyedIterablePrototype[IS_KEYED_SENTINEL] = true; KeyedIterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.entries; KeyedIterablePrototype.__toJS = IterablePrototype.toObject; KeyedIterablePrototype.__toStringMapper = function(v, k) {return JSON.stringify(k) + ': ' + quoteString(v)}; mixin(IndexedIterable, { // ### Conversion to other types toKeyedSeq: function() { return new ToKeyedSequence(this, false); }, // ### ES6 Collection methods (ES6 Array and Map) filter: function(predicate, context) { return reify(this, filterFactory(this, predicate, context, false)); }, findIndex: function(predicate, context) { var entry = this.findEntry(predicate, context); return entry ? entry[0] : -1; }, indexOf: function(searchValue) { var key = this.keyOf(searchValue); return key === undefined ? -1 : key; }, lastIndexOf: function(searchValue) { var key = this.lastKeyOf(searchValue); return key === undefined ? -1 : key; }, reverse: function() { return reify(this, reverseFactory(this, false)); }, slice: function(begin, end) { return reify(this, sliceFactory(this, begin, end, false)); }, splice: function(index, removeNum /*, ...values*/) { var numArgs = arguments.length; removeNum = Math.max(removeNum | 0, 0); if (numArgs === 0 || (numArgs === 2 && !removeNum)) { return this; } // If index is negative, it should resolve relative to the size of the // collection. However size may be expensive to compute if not cached, so // only call count() if the number is in fact negative. index = resolveBegin(index, index < 0 ? this.count() : this.size); var spliced = this.slice(0, index); return reify( this, numArgs === 1 ? spliced : spliced.concat(arrCopy(arguments, 2), this.slice(index + removeNum)) ); }, // ### More collection methods findLastIndex: function(predicate, context) { var entry = this.findLastEntry(predicate, context); return entry ? entry[0] : -1; }, first: function() { return this.get(0); }, flatten: function(depth) { return reify(this, flattenFactory(this, depth, false)); }, get: function(index, notSetValue) { index = wrapIndex(this, index); return (index < 0 || (this.size === Infinity || (this.size !== undefined && index > this.size))) ? notSetValue : this.find(function(_, key) {return key === index}, undefined, notSetValue); }, has: function(index) { index = wrapIndex(this, index); return index >= 0 && (this.size !== undefined ? this.size === Infinity || index < this.size : this.indexOf(index) !== -1 ); }, interpose: function(separator) { return reify(this, interposeFactory(this, separator)); }, interleave: function(/*...iterables*/) { var iterables = [this].concat(arrCopy(arguments)); var zipped = zipWithFactory(this.toSeq(), IndexedSeq.of, iterables); var interleaved = zipped.flatten(true); if (zipped.size) { interleaved.size = zipped.size * iterables.length; } return reify(this, interleaved); }, keySeq: function() { return Range(0, this.size); }, last: function() { return this.get(-1); }, skipWhile: function(predicate, context) { return reify(this, skipWhileFactory(this, predicate, context, false)); }, zip: function(/*, ...iterables */) { var iterables = [this].concat(arrCopy(arguments)); return reify(this, zipWithFactory(this, defaultZipper, iterables)); }, zipWith: function(zipper/*, ...iterables */) { var iterables = arrCopy(arguments); iterables[0] = this; return reify(this, zipWithFactory(this, zipper, iterables)); } }); IndexedIterable.prototype[IS_INDEXED_SENTINEL] = true; IndexedIterable.prototype[IS_ORDERED_SENTINEL] = true; mixin(SetIterable, { // ### ES6 Collection methods (ES6 Array and Map) get: function(value, notSetValue) { return this.has(value) ? value : notSetValue; }, includes: function(value) { return this.has(value); }, // ### More sequential methods keySeq: function() { return this.valueSeq(); } }); SetIterable.prototype.has = IterablePrototype.includes; SetIterable.prototype.contains = SetIterable.prototype.includes; // Mixin subclasses mixin(KeyedSeq, KeyedIterable.prototype); mixin(IndexedSeq, IndexedIterable.prototype); mixin(SetSeq, SetIterable.prototype); mixin(KeyedCollection, KeyedIterable.prototype); mixin(IndexedCollection, IndexedIterable.prototype); mixin(SetCollection, SetIterable.prototype); // #pragma Helper functions function keyMapper(v, k) { return k; } function entryMapper(v, k) { return [k, v]; } function not(predicate) { return function() { return !predicate.apply(this, arguments); } } function neg(predicate) { return function() { return -predicate.apply(this, arguments); } } function quoteString(value) { return typeof value === 'string' ? JSON.stringify(value) : String(value); } function defaultZipper() { return arrCopy(arguments); } function defaultNegComparator(a, b) { return a < b ? 1 : a > b ? -1 : 0; } function hashIterable(iterable) { if (iterable.size === Infinity) { return 0; } var ordered = isOrdered(iterable); var keyed = isKeyed(iterable); var h = ordered ? 1 : 0; var size = iterable.__iterate( keyed ? ordered ? function(v, k) { h = 31 * h + hashMerge(hash(v), hash(k)) | 0; } : function(v, k) { h = h + hashMerge(hash(v), hash(k)) | 0; } : ordered ? function(v ) { h = 31 * h + hash(v) | 0; } : function(v ) { h = h + hash(v) | 0; } ); return murmurHashOfSize(size, h); } function murmurHashOfSize(size, h) { h = imul(h, 0xCC9E2D51); h = imul(h << 15 | h >>> -15, 0x1B873593); h = imul(h << 13 | h >>> -13, 5); h = (h + 0xE6546B64 | 0) ^ size; h = imul(h ^ h >>> 16, 0x85EBCA6B); h = imul(h ^ h >>> 13, 0xC2B2AE35); h = smi(h ^ h >>> 16); return h; } function hashMerge(a, b) { return a ^ b + 0x9E3779B9 + (a << 6) + (a >> 2) | 0; // int } var Immutable = { Iterable: Iterable, Seq: Seq, Collection: Collection, Map: Map, OrderedMap: OrderedMap, List: List, Stack: Stack, Set: Set, OrderedSet: OrderedSet, Record: Record, Range: Range, Repeat: Repeat, is: is, fromJS: fromJS }; return Immutable; })); /***/ }), /* 147 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var Immutable = __webpack_require__(146); // When our app state is fully types, we should be able to get rid of // this function. This is only temporarily necessary to support // converting typed objects to immutable.js, which usually happens in // reducers. function fromJS(value) { if (Array.isArray(value)) { return Immutable.Seq(value).map(fromJS).toList(); } if (value && value.constructor.meta) { // This adds support for tcomb objects which are native JS objects // but are not "plain", so the above checks fail. Since they // behave the same we can use the same constructors, but we need // special checks for them. var kind = value.constructor.meta.kind; if (kind === "struct") { return Immutable.Seq(value).map(fromJS).toMap(); } else if (kind === "list") { return Immutable.Seq(value).map(fromJS).toList(); } } // If it's a primitive type, just return the value. Note `==` check // for null, which is intentionally used to match either `null` or // `undefined`. if (value == null || typeof value !== "object") { return value; } // Otherwise, treat it like an object. We can't reliably detect if // it's a plain object because we might be objects from other JS // contexts so `Object !== Object`. return Immutable.Seq(value).map(fromJS).toMap(); } module.exports = fromJS; /***/ }), /* 148 */ /***/ (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); } } /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var constants = __webpack_require__(145); var fromJS = __webpack_require__(147); var I = __webpack_require__(146); var initialState = fromJS({ config: I.Map() }); function update() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState; var action = arguments[1]; switch (action.type) { case constants.SET_VALUE: return state.setIn(["config"].concat(_toConsumableArray(action.path.split("."))), action.value); case constants.SET_CONFIG: return state.setIn(["config"], fromJS(action.config)); } return state; } module.exports = update; /***/ }), /* 149 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var React = __webpack_require__(0); var PropTypes = React.PropTypes; var ImPropTypes = __webpack_require__(150); var _require = __webpack_require__(1189), connect = _require.connect; var _require2 = __webpack_require__(3), bindActionCreators = _require2.bindActionCreators; var _require3 = __webpack_require__(160), getTabs = _require3.getTabs, getFilterString = _require3.getFilterString, getConfig = _require3.getConfig; var _require4 = __webpack_require__(828), getValue = _require4.getValue; var LandingPage = React.createFactory(__webpack_require__(167)); var LaunchpadApp = React.createClass({ displayName: "LaunchpadApp", propTypes: { tabs: ImPropTypes.map.isRequired, filterString: PropTypes.string, actions: PropTypes.object, config: PropTypes.object }, render() { var _props = this.props, filterString = _props.filterString, _props$actions = _props.actions, setValue = _props$actions.setValue, filterTabs = _props$actions.filterTabs, config = _props.config; return LandingPage({ tabs: this.props.tabs, supportsFirefox: !!getValue("firefox"), supportsChrome: !!getValue("chrome"), title: getValue("title"), filterString, onFilterChange: filterTabs, onTabClick: url => { window.location = url; }, config, setValue }); } }); function mapStateToProps(state) { return { tabs: getTabs(state), filterString: getFilterString(state), config: getConfig(state) }; } function mapDispatchToProps(dispatch) { return { actions: bindActionCreators(__webpack_require__(181), dispatch) }; } module.exports = connect(mapStateToProps, mapDispatchToProps)(LaunchpadApp); /***/ }), /* 150 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * This is a straight rip-off of the React.js ReactPropTypes.js proptype validators, * modified to make it possible to validate Immutable.js data. * ImmutableTypes.listOf is patterned after React.PropTypes.arrayOf, but for Immutable.List * ImmutableTypes.shape is based on React.PropTypes.shape, but for any Immutable.Iterable */ var Immutable = __webpack_require__(146); var ANONYMOUS = "<>"; var ImmutablePropTypes = { listOf: createListOfTypeChecker, mapOf: createMapOfTypeChecker, orderedMapOf: createOrderedMapOfTypeChecker, setOf: createSetOfTypeChecker, orderedSetOf: createOrderedSetOfTypeChecker, stackOf: createStackOfTypeChecker, iterableOf: createIterableOfTypeChecker, recordOf: createRecordOfTypeChecker, shape: createShapeChecker, contains: createShapeChecker, mapContains: createMapContainsChecker, // Primitive Types list: createImmutableTypeChecker("List", Immutable.List.isList), map: createImmutableTypeChecker("Map", Immutable.Map.isMap), orderedMap: createImmutableTypeChecker("OrderedMap", Immutable.OrderedMap.isOrderedMap), set: createImmutableTypeChecker("Set", Immutable.Set.isSet), orderedSet: createImmutableTypeChecker("OrderedSet", Immutable.OrderedSet.isOrderedSet), stack: createImmutableTypeChecker("Stack", Immutable.Stack.isStack), seq: createImmutableTypeChecker("Seq", Immutable.Seq.isSeq), record: createImmutableTypeChecker("Record", function (isRecord) { return isRecord instanceof Immutable.Record; }), iterable: createImmutableTypeChecker("Iterable", Immutable.Iterable.isIterable) }; function getPropType(propValue) { var propType = typeof propValue; if (Array.isArray(propValue)) { return "array"; } if (propValue instanceof RegExp) { // Old webkits (at least until Android 4.0) return 'function' rather than // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ // passes PropTypes.object. return "object"; } if (propValue instanceof Immutable.Iterable) { return "Immutable." + propValue.toSource().split(" ")[0]; } return propType; } function createChainableTypeChecker(validate) { function checkType(isRequired, props, propName, componentName, location, propFullName) { for (var _len = arguments.length, rest = Array(_len > 6 ? _len - 6 : 0), _key = 6; _key < _len; _key++) { rest[_key - 6] = arguments[_key]; } propFullName = propFullName || propName; componentName = componentName || ANONYMOUS; if (props[propName] == null) { var locationName = location; if (isRequired) { return new Error("Required " + locationName + " `" + propFullName + "` was not specified in " + ("`" + componentName + "`.")); } } else { return validate.apply(undefined, [props, propName, componentName, location, propFullName].concat(rest)); } } var chainedCheckType = checkType.bind(null, false); chainedCheckType.isRequired = checkType.bind(null, true); return chainedCheckType; } function createImmutableTypeChecker(immutableClassName, immutableClassTypeValidator) { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; if (!immutableClassTypeValidator(propValue)) { var propType = getPropType(propValue); return new Error("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `" + immutableClassName + "`.")); } return null; } return createChainableTypeChecker(validate); } function createIterableTypeChecker(typeChecker, immutableClassName, immutableClassTypeValidator) { function validate(props, propName, componentName, location, propFullName) { for (var _len = arguments.length, rest = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) { rest[_key - 5] = arguments[_key]; } var propValue = props[propName]; if (!immutableClassTypeValidator(propValue)) { var locationName = location; var propType = getPropType(propValue); return new Error("Invalid " + locationName + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an Immutable.js " + immutableClassName + ".")); } if (typeof typeChecker !== "function") { return new Error("Invalid typeChecker supplied to `" + componentName + "` " + ("for propType `" + propFullName + "`, expected a function.")); } var propValues = propValue.toArray(); for (var i = 0, len = propValues.length; i < len; i++) { var error = typeChecker.apply(undefined, [propValues, i, componentName, location, "" + propFullName + "[" + i + "]"].concat(rest)); if (error instanceof Error) { return error; } } } return createChainableTypeChecker(validate); } function createKeysTypeChecker(typeChecker) { function validate(props, propName, componentName, location, propFullName) { for (var _len = arguments.length, rest = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) { rest[_key - 5] = arguments[_key]; } var propValue = props[propName]; if (typeof typeChecker !== "function") { return new Error("Invalid keysTypeChecker (optional second argument) supplied to `" + componentName + "` " + ("for propType `" + propFullName + "`, expected a function.")); } var keys = propValue.keySeq().toArray(); for (var i = 0, len = keys.length; i < len; i++) { var error = typeChecker.apply(undefined, [keys, i, componentName, location, "" + propFullName + " -> key(" + keys[i] + ")"].concat(rest)); if (error instanceof Error) { return error; } } } return createChainableTypeChecker(validate); } function createListOfTypeChecker(typeChecker) { return createIterableTypeChecker(typeChecker, "List", Immutable.List.isList); } function createMapOfTypeCheckerFactory(valuesTypeChecker, keysTypeChecker, immutableClassName, immutableClassTypeValidator) { function validate() { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return createIterableTypeChecker(valuesTypeChecker, immutableClassName, immutableClassTypeValidator).apply(undefined, args) || keysTypeChecker && createKeysTypeChecker(keysTypeChecker).apply(undefined, args); } return createChainableTypeChecker(validate); } function createMapOfTypeChecker(valuesTypeChecker, keysTypeChecker) { return createMapOfTypeCheckerFactory(valuesTypeChecker, keysTypeChecker, "Map", Immutable.Map.isMap); } function createOrderedMapOfTypeChecker(valuesTypeChecker, keysTypeChecker) { return createMapOfTypeCheckerFactory(valuesTypeChecker, keysTypeChecker, "OrderedMap", Immutable.OrderedMap.isOrderedMap); } function createSetOfTypeChecker(typeChecker) { return createIterableTypeChecker(typeChecker, "Set", Immutable.Set.isSet); } function createOrderedSetOfTypeChecker(typeChecker) { return createIterableTypeChecker(typeChecker, "OrderedSet", Immutable.OrderedSet.isOrderedSet); } function createStackOfTypeChecker(typeChecker) { return createIterableTypeChecker(typeChecker, "Stack", Immutable.Stack.isStack); } function createIterableOfTypeChecker(typeChecker) { return createIterableTypeChecker(typeChecker, "Iterable", Immutable.Iterable.isIterable); } function createRecordOfTypeChecker(recordKeys) { function validate(props, propName, componentName, location, propFullName) { for (var _len = arguments.length, rest = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) { rest[_key - 5] = arguments[_key]; } var propValue = props[propName]; if (!(propValue instanceof Immutable.Record)) { var propType = getPropType(propValue); var locationName = location; return new Error("Invalid " + locationName + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected an Immutable.js Record.")); } for (var key in recordKeys) { var checker = recordKeys[key]; if (!checker) { continue; } var mutablePropValue = propValue.toObject(); var error = checker.apply(undefined, [mutablePropValue, key, componentName, location, "" + propFullName + "." + key].concat(rest)); if (error) { return error; } } } return createChainableTypeChecker(validate); } // there is some irony in the fact that shapeTypes is a standard hash and not an immutable collection function createShapeTypeChecker(shapeTypes) { var immutableClassName = arguments[1] === undefined ? "Iterable" : arguments[1]; var immutableClassTypeValidator = arguments[2] === undefined ? Immutable.Iterable.isIterable : arguments[2]; function validate(props, propName, componentName, location, propFullName) { for (var _len = arguments.length, rest = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) { rest[_key - 5] = arguments[_key]; } var propValue = props[propName]; if (!immutableClassTypeValidator(propValue)) { var propType = getPropType(propValue); var locationName = location; return new Error("Invalid " + locationName + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected an Immutable.js " + immutableClassName + ".")); } var mutablePropValue = propValue.toObject(); for (var key in shapeTypes) { var checker = shapeTypes[key]; if (!checker) { continue; } var error = checker.apply(undefined, [mutablePropValue, key, componentName, location, "" + propFullName + "." + key].concat(rest)); if (error) { return error; } } } return createChainableTypeChecker(validate); } function createShapeChecker(shapeTypes) { return createShapeTypeChecker(shapeTypes); } function createMapContainsChecker(shapeTypes) { return createShapeTypeChecker(shapeTypes, "Map", Immutable.Map.isMap); } module.exports = ImmutablePropTypes; /***/ }), /* 151 */, /* 152 */, /* 153 */, /* 154 */, /* 155 */, /* 156 */, /* 157 */, /* 158 */, /* 159 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright 2013-2015, 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. */ /** * Use invariant() to assert state which your program assumes to be true. * * Provide sprintf-style format (only %s is supported) and arguments * to provide information about what broke and what you were * expecting. * * The invariant message will be stripped in production, but the invariant * will remain to ensure logic does not differ in production. */ var invariant = function(condition, format, a, b, c, d, e, f) { if (false) { if (format === undefined) { throw new Error('invariant requires an error message argument'); } } if (!condition) { var error; if (format === undefined) { error = new Error( 'Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.' ); } else { var args = [a, b, c, d, e, f]; var argIndex = 0; error = new Error( format.replace(/%s/g, function() { return args[argIndex++]; }) ); error.name = 'Invariant Violation'; } error.framesToPop = 1; // we don't care about invariant's own frame throw error; } }; module.exports = invariant; /***/ }), /* 160 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var _require = __webpack_require__(161), score = _require.score; function getTabs(state) { var tabs = state.tabs.get("tabs"); var filterString = getFilterString(state); if (filterString === "") { return tabs; } return tabs.map(tab => { var _overallScore = score(tab.get("title"), filterString) + score(tab.get("url"), filterString); return tab.set("filteredOut", _overallScore === 0); }); } function getSelectedTab(state) { return state.tabs.get("selectedTab"); } function getFilterString(state) { return state.tabs.get("filterString"); } function getConfig(state) { return state.config.get("config").toJS(); } module.exports = { getTabs, getSelectedTab, getFilterString, getConfig }; /***/ }), /* 161 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {(function() { var Query, defaultPathSeparator, filter, matcher, parseOptions, pathScorer, preparedQueryCache, scorer; filter = __webpack_require__(162); matcher = __webpack_require__(166); scorer = __webpack_require__(163); pathScorer = __webpack_require__(164); Query = __webpack_require__(165); preparedQueryCache = null; defaultPathSeparator = (typeof process !== "undefined" && process !== null ? process.platform : void 0) === "win32" ? '\\' : '/'; module.exports = { filter: function(candidates, query, options) { if (options == null) { options = {}; } if (!((query != null ? query.length : void 0) && (candidates != null ? candidates.length : void 0))) { return []; } options = parseOptions(options, query); return filter(candidates, query, options); }, score: function(string, query, options) { if (options == null) { options = {}; } if (!((string != null ? string.length : void 0) && (query != null ? query.length : void 0))) { return 0; } options = parseOptions(options, query); if (options.usePathScoring) { return pathScorer.score(string, query, options); } else { return scorer.score(string, query, options); } }, match: function(string, query, options) { var _i, _ref, _results; if (options == null) { options = {}; } if (!string) { return []; } if (!query) { return []; } if (string === query) { return (function() { _results = []; for (var _i = 0, _ref = string.length; 0 <= _ref ? _i < _ref : _i > _ref; 0 <= _ref ? _i++ : _i--){ _results.push(_i); } return _results; }).apply(this); } options = parseOptions(options, query); return matcher.match(string, query, options); }, wrap: function(string, query, options) { if (options == null) { options = {}; } if (!string) { return []; } if (!query) { return []; } options = parseOptions(options, query); return matcher.wrap(string, query, options); }, prepareQuery: function(query, options) { if (options == null) { options = {}; } options = parseOptions(options, query); return options.preparedQuery; } }; parseOptions = function(options, query) { if (options.allowErrors == null) { options.allowErrors = false; } if (options.usePathScoring == null) { options.usePathScoring = true; } if (options.useExtensionBonus == null) { options.useExtensionBonus = false; } if (options.pathSeparator == null) { options.pathSeparator = defaultPathSeparator; } if (options.optCharRegEx == null) { options.optCharRegEx = null; } if (options.wrap == null) { options.wrap = null; } if (options.preparedQuery == null) { options.preparedQuery = preparedQueryCache && preparedQueryCache.query === query ? preparedQueryCache : (preparedQueryCache = new Query(query, options)); } return options; }; }).call(this); /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(120))) /***/ }), /* 162 */ /***/ (function(module, exports, __webpack_require__) { (function() { var Query, pathScorer, pluckCandidates, scorer, sortCandidates; scorer = __webpack_require__(163); pathScorer = __webpack_require__(164); Query = __webpack_require__(165); pluckCandidates = function(a) { return a.candidate; }; sortCandidates = function(a, b) { return b.score - a.score; }; module.exports = function(candidates, query, options) { var bKey, candidate, key, maxInners, maxResults, score, scoreProvider, scoredCandidates, spotLeft, string, usePathScoring, _i, _len; scoredCandidates = []; key = options.key, maxResults = options.maxResults, maxInners = options.maxInners, usePathScoring = options.usePathScoring; spotLeft = (maxInners != null) && maxInners > 0 ? maxInners : candidates.length + 1; bKey = key != null; scoreProvider = usePathScoring ? pathScorer : scorer; for (_i = 0, _len = candidates.length; _i < _len; _i++) { candidate = candidates[_i]; string = bKey ? candidate[key] : candidate; if (!string) { continue; } score = scoreProvider.score(string, query, options); if (score > 0) { scoredCandidates.push({ candidate: candidate, score: score }); if (!--spotLeft) { break; } } } scoredCandidates.sort(sortCandidates); candidates = scoredCandidates.map(pluckCandidates); if (maxResults != null) { candidates = candidates.slice(0, maxResults); } return candidates; }; }).call(this); /***/ }), /* 163 */ /***/ (function(module, exports) { (function() { var AcronymResult, computeScore, emptyAcronymResult, isAcronymFullWord, isMatch, isSeparator, isWordEnd, isWordStart, miss_coeff, pos_bonus, scoreAcronyms, scoreCharacter, scoreConsecutives, scoreExact, scoreExactMatch, scorePattern, scorePosition, scoreSize, tau_size, wm; wm = 150; pos_bonus = 20; tau_size = 85; miss_coeff = 0.75; exports.score = function(string, query, options) { var allowErrors, preparedQuery, score, string_lw; preparedQuery = options.preparedQuery, allowErrors = options.allowErrors; if (!(allowErrors || isMatch(string, preparedQuery.core_lw, preparedQuery.core_up))) { return 0; } string_lw = string.toLowerCase(); score = computeScore(string, string_lw, preparedQuery); return Math.ceil(score); }; exports.isMatch = isMatch = function(subject, query_lw, query_up) { var i, j, m, n, qj_lw, qj_up, si; m = subject.length; n = query_lw.length; if (!m || n > m) { return false; } i = -1; j = -1; while (++j < n) { qj_lw = query_lw.charCodeAt(j); qj_up = query_up.charCodeAt(j); while (++i < m) { si = subject.charCodeAt(i); if (si === qj_lw || si === qj_up) { break; } } if (i === m) { return false; } } return true; }; exports.computeScore = computeScore = function(subject, subject_lw, preparedQuery) { var acro, acro_score, align, csc_diag, csc_invalid, csc_row, csc_score, i, j, m, miss_budget, miss_left, mm, n, pos, query, query_lw, record_miss, score, score_diag, score_row, score_up, si_lw, start, sz; query = preparedQuery.query; query_lw = preparedQuery.query_lw; m = subject.length; n = query.length; acro = scoreAcronyms(subject, subject_lw, query, query_lw); acro_score = acro.score; if (acro.count === n) { return scoreExact(n, m, acro_score, acro.pos); } pos = subject_lw.indexOf(query_lw); if (pos > -1) { return scoreExactMatch(subject, subject_lw, query, query_lw, pos, n, m); } score_row = new Array(n); csc_row = new Array(n); sz = scoreSize(n, m); miss_budget = Math.ceil(miss_coeff * n) + 5; miss_left = miss_budget; j = -1; while (++j < n) { score_row[j] = 0; csc_row[j] = 0; } i = subject_lw.indexOf(query_lw[0]); if (i > -1) { i--; } mm = subject_lw.lastIndexOf(query_lw[n - 1], m); if (mm > i) { m = mm + 1; } csc_invalid = true; while (++i < m) { si_lw = subject_lw[i]; if (preparedQuery.charCodes[si_lw.charCodeAt(0)] == null) { if (csc_invalid !== true) { j = -1; while (++j < n) { csc_row[j] = 0; } csc_invalid = true; } continue; } score = 0; score_diag = 0; csc_diag = 0; record_miss = true; csc_invalid = false; j = -1; while (++j < n) { score_up = score_row[j]; if (score_up > score) { score = score_up; } csc_score = 0; if (query_lw[j] === si_lw) { start = isWordStart(i, subject, subject_lw); csc_score = csc_diag > 0 ? csc_diag : scoreConsecutives(subject, subject_lw, query, query_lw, i, j, start); align = score_diag + scoreCharacter(i, j, start, acro_score, csc_score); if (align > score) { score = align; miss_left = miss_budget; } else { if (record_miss && --miss_left <= 0) { return score_row[n - 1] * sz; } record_miss = false; } } score_diag = score_up; csc_diag = csc_row[j]; csc_row[j] = csc_score; score_row[j] = score; } } score = score_row[n - 1]; return score * sz; }; exports.isWordStart = isWordStart = function(pos, subject, subject_lw) { var curr_s, prev_s; if (pos === 0) { return true; } curr_s = subject[pos]; prev_s = subject[pos - 1]; return isSeparator(prev_s) || (curr_s !== subject_lw[pos] && prev_s === subject_lw[pos - 1]); }; exports.isWordEnd = isWordEnd = function(pos, subject, subject_lw, len) { var curr_s, next_s; if (pos === len - 1) { return true; } curr_s = subject[pos]; next_s = subject[pos + 1]; return isSeparator(next_s) || (curr_s === subject_lw[pos] && next_s !== subject_lw[pos + 1]); }; isSeparator = function(c) { return c === ' ' || c === '.' || c === '-' || c === '_' || c === '/' || c === '\\'; }; scorePosition = function(pos) { var sc; if (pos < pos_bonus) { sc = pos_bonus - pos; return 100 + sc * sc; } else { return Math.max(100 + pos_bonus - pos, 0); } }; exports.scoreSize = scoreSize = function(n, m) { return tau_size / (tau_size + Math.abs(m - n)); }; scoreExact = function(n, m, quality, pos) { return 2 * n * (wm * quality + scorePosition(pos)) * scoreSize(n, m); }; exports.scorePattern = scorePattern = function(count, len, sameCase, start, end) { var bonus, sz; sz = count; bonus = 6; if (sameCase === count) { bonus += 2; } if (start) { bonus += 3; } if (end) { bonus += 1; } if (count === len) { if (start) { if (sameCase === len) { sz += 2; } else { sz += 1; } } if (end) { bonus += 1; } } return sameCase + sz * (sz + bonus); }; exports.scoreCharacter = scoreCharacter = function(i, j, start, acro_score, csc_score) { var posBonus; posBonus = scorePosition(i); if (start) { return posBonus + wm * ((acro_score > csc_score ? acro_score : csc_score) + 10); } return posBonus + wm * csc_score; }; exports.scoreConsecutives = scoreConsecutives = function(subject, subject_lw, query, query_lw, i, j, startOfWord) { var k, m, mi, n, nj, sameCase, sz; m = subject.length; n = query.length; mi = m - i; nj = n - j; k = mi < nj ? mi : nj; sameCase = 0; sz = 0; if (query[j] === subject[i]) { sameCase++; } while (++sz < k && query_lw[++j] === subject_lw[++i]) { if (query[j] === subject[i]) { sameCase++; } } if (sz === 1) { return 1 + 2 * sameCase; } return scorePattern(sz, n, sameCase, startOfWord, isWordEnd(i, subject, subject_lw, m)); }; exports.scoreExactMatch = scoreExactMatch = function(subject, subject_lw, query, query_lw, pos, n, m) { var end, i, pos2, sameCase, start; start = isWordStart(pos, subject, subject_lw); if (!start) { pos2 = subject_lw.indexOf(query_lw, pos + 1); if (pos2 > -1) { start = isWordStart(pos2, subject, subject_lw); if (start) { pos = pos2; } } } i = -1; sameCase = 0; while (++i < n) { if (query[pos + i] === subject[i]) { sameCase++; } } end = isWordEnd(pos + n - 1, subject, subject_lw, m); return scoreExact(n, m, scorePattern(n, n, sameCase, start, end), pos); }; AcronymResult = (function() { function AcronymResult(score, pos, count) { this.score = score; this.pos = pos; this.count = count; } return AcronymResult; })(); emptyAcronymResult = new AcronymResult(0, 0.1, 0); exports.scoreAcronyms = scoreAcronyms = function(subject, subject_lw, query, query_lw) { var count, fullWord, i, j, m, n, qj_lw, sameCase, score, sepCount, sumPos; m = subject.length; n = query.length; if (!(m > 1 && n > 1)) { return emptyAcronymResult; } count = 0; sepCount = 0; sumPos = 0; sameCase = 0; i = -1; j = -1; while (++j < n) { qj_lw = query_lw[j]; if (isSeparator(qj_lw)) { i = subject_lw.indexOf(qj_lw, i + 1); if (i > -1) { sepCount++; continue; } else { break; } } while (++i < m) { if (qj_lw === subject_lw[i] && isWordStart(i, subject, subject_lw)) { if (query[j] === subject[i]) { sameCase++; } sumPos += i; count++; break; } } if (i === m) { break; } } if (count < 2) { return emptyAcronymResult; } fullWord = count === n ? isAcronymFullWord(subject, subject_lw, query, count) : false; score = scorePattern(count, n, sameCase, true, fullWord); return new AcronymResult(score, sumPos / count, count + sepCount); }; isAcronymFullWord = function(subject, subject_lw, query, nbAcronymInQuery) { var count, i, m, n; m = subject.length; n = query.length; count = 0; if (m > 12 * n) { return false; } i = -1; while (++i < m) { if (isWordStart(i, subject, subject_lw) && ++count > nbAcronymInQuery) { return false; } } return true; }; }).call(this); /***/ }), /* 164 */ /***/ (function(module, exports, __webpack_require__) { (function() { var computeScore, countDir, file_coeff, getExtension, getExtensionScore, isMatch, scorePath, scoreSize, tau_depth, _ref; _ref = __webpack_require__(163), isMatch = _ref.isMatch, computeScore = _ref.computeScore, scoreSize = _ref.scoreSize; tau_depth = 13; file_coeff = 1.2; exports.score = function(string, query, options) { var allowErrors, preparedQuery, score, string_lw; preparedQuery = options.preparedQuery, allowErrors = options.allowErrors; if (!(allowErrors || isMatch(string, preparedQuery.core_lw, preparedQuery.core_up))) { return 0; } string_lw = string.toLowerCase(); score = computeScore(string, string_lw, preparedQuery); score = scorePath(string, string_lw, score, options); return Math.ceil(score); }; scorePath = function(subject, subject_lw, fullPathScore, options) { var alpha, basePathScore, basePos, depth, end, extAdjust, fileLength, pathSeparator, preparedQuery, useExtensionBonus; if (fullPathScore === 0) { return 0; } preparedQuery = options.preparedQuery, useExtensionBonus = options.useExtensionBonus, pathSeparator = options.pathSeparator; end = subject.length - 1; while (subject[end] === pathSeparator) { end--; } basePos = subject.lastIndexOf(pathSeparator, end); fileLength = end - basePos; extAdjust = 1.0; if (useExtensionBonus) { extAdjust += getExtensionScore(subject_lw, preparedQuery.ext, basePos, end, 2); fullPathScore *= extAdjust; } if (basePos === -1) { return fullPathScore; } depth = preparedQuery.depth; while (basePos > -1 && depth-- > 0) { basePos = subject.lastIndexOf(pathSeparator, basePos - 1); } basePathScore = basePos === -1 ? fullPathScore : extAdjust * computeScore(subject.slice(basePos + 1, end + 1), subject_lw.slice(basePos + 1, end + 1), preparedQuery); alpha = 0.5 * tau_depth / (tau_depth + countDir(subject, end + 1, pathSeparator)); return alpha * basePathScore + (1 - alpha) * fullPathScore * scoreSize(0, file_coeff * fileLength); }; exports.countDir = countDir = function(path, end, pathSeparator) { var count, i; if (end < 1) { return 0; } count = 0; i = -1; while (++i < end && path[i] === pathSeparator) { continue; } while (++i < end) { if (path[i] === pathSeparator) { count++; while (++i < end && path[i] === pathSeparator) { continue; } } } return count; }; exports.getExtension = getExtension = function(str) { var pos; pos = str.lastIndexOf("."); if (pos < 0) { return ""; } else { return str.substr(pos + 1); } }; getExtensionScore = function(candidate, ext, startPos, endPos, maxDepth) { var m, matched, n, pos; if (!ext.length) { return 0; } pos = candidate.lastIndexOf(".", endPos); if (!(pos > startPos)) { return 0; } n = ext.length; m = endPos - pos; if (m < n) { n = m; m = ext.length; } pos++; matched = -1; while (++matched < n) { if (candidate[pos + matched] !== ext[matched]) { break; } } if (matched === 0 && maxDepth > 0) { return 0.9 * getExtensionScore(candidate, ext, startPos, pos - 2, maxDepth - 1); } return matched / m; }; }).call(this); /***/ }), /* 165 */ /***/ (function(module, exports, __webpack_require__) { (function() { var Query, coreChars, countDir, getCharCodes, getExtension, opt_char_re, truncatedUpperCase, _ref; _ref = __webpack_require__(164), countDir = _ref.countDir, getExtension = _ref.getExtension; module.exports = Query = (function() { function Query(query, _arg) { var optCharRegEx, pathSeparator, _ref1; _ref1 = _arg != null ? _arg : {}, optCharRegEx = _ref1.optCharRegEx, pathSeparator = _ref1.pathSeparator; if (!(query && query.length)) { return null; } this.query = query; this.query_lw = query.toLowerCase(); this.core = coreChars(query, optCharRegEx); this.core_lw = this.core.toLowerCase(); this.core_up = truncatedUpperCase(this.core); this.depth = countDir(query, query.length, pathSeparator); this.ext = getExtension(this.query_lw); this.charCodes = getCharCodes(this.query_lw); } return Query; })(); opt_char_re = /[ _\-:\/\\]/g; coreChars = function(query, optCharRegEx) { if (optCharRegEx == null) { optCharRegEx = opt_char_re; } return query.replace(optCharRegEx, ''); }; truncatedUpperCase = function(str) { var char, upper, _i, _len; upper = ""; for (_i = 0, _len = str.length; _i < _len; _i++) { char = str[_i]; upper += char.toUpperCase()[0]; } return upper; }; getCharCodes = function(str) { var charCodes, i, len; len = str.length; i = -1; charCodes = []; while (++i < len) { charCodes[str.charCodeAt(i)] = true; } return charCodes; }; }).call(this); /***/ }), /* 166 */ /***/ (function(module, exports, __webpack_require__) { (function() { var basenameMatch, computeMatch, isMatch, isWordStart, match, mergeMatches, scoreAcronyms, scoreCharacter, scoreConsecutives, _ref; _ref = __webpack_require__(163), isMatch = _ref.isMatch, isWordStart = _ref.isWordStart, scoreConsecutives = _ref.scoreConsecutives, scoreCharacter = _ref.scoreCharacter, scoreAcronyms = _ref.scoreAcronyms; exports.match = match = function(string, query, options) { var allowErrors, baseMatches, matches, pathSeparator, preparedQuery, string_lw; allowErrors = options.allowErrors, preparedQuery = options.preparedQuery, pathSeparator = options.pathSeparator; if (!(allowErrors || isMatch(string, preparedQuery.core_lw, preparedQuery.core_up))) { return []; } string_lw = string.toLowerCase(); matches = computeMatch(string, string_lw, preparedQuery); if (matches.length === 0) { return matches; } if (string.indexOf(pathSeparator) > -1) { baseMatches = basenameMatch(string, string_lw, preparedQuery, pathSeparator); matches = mergeMatches(matches, baseMatches); } return matches; }; exports.wrap = function(string, query, options) { var matchIndex, matchPos, matchPositions, output, strPos, tagClass, tagClose, tagOpen, _ref1; if ((options.wrap != null)) { _ref1 = options.wrap, tagClass = _ref1.tagClass, tagOpen = _ref1.tagOpen, tagClose = _ref1.tagClose; } if (tagClass == null) { tagClass = 'highlight'; } if (tagOpen == null) { tagOpen = ''; } if (tagClose == null) { tagClose = ''; } if (string === query) { return tagOpen + string + tagClose; } matchPositions = match(string, query, options); if (matchPositions.length === 0) { return string; } output = ''; matchIndex = -1; strPos = 0; while (++matchIndex < matchPositions.length) { matchPos = matchPositions[matchIndex]; if (matchPos > strPos) { output += string.substring(strPos, matchPos); strPos = matchPos; } while (++matchIndex < matchPositions.length) { if (matchPositions[matchIndex] === matchPos + 1) { matchPos++; } else { matchIndex--; break; } } matchPos++; if (matchPos > strPos) { output += tagOpen; output += string.substring(strPos, matchPos); output += tagClose; strPos = matchPos; } } if (strPos < string.length - 1) { output += string.substring(strPos); } return output; }; basenameMatch = function(subject, subject_lw, preparedQuery, pathSeparator) { var basePos, depth, end; end = subject.length - 1; while (subject[end] === pathSeparator) { end--; } basePos = subject.lastIndexOf(pathSeparator, end); if (basePos === -1) { return []; } depth = preparedQuery.depth; while (depth-- > 0) { basePos = subject.lastIndexOf(pathSeparator, basePos - 1); if (basePos === -1) { return []; } } basePos++; end++; return computeMatch(subject.slice(basePos, end), subject_lw.slice(basePos, end), preparedQuery, basePos); }; mergeMatches = function(a, b) { var ai, bj, i, j, m, n, out; m = a.length; n = b.length; if (n === 0) { return a.slice(); } if (m === 0) { return b.slice(); } i = -1; j = 0; bj = b[j]; out = []; while (++i < m) { ai = a[i]; while (bj <= ai && ++j < n) { if (bj < ai) { out.push(bj); } bj = b[j]; } out.push(ai); } while (j < n) { out.push(b[j++]); } return out; }; computeMatch = function(subject, subject_lw, preparedQuery, offset) { var DIAGONAL, LEFT, STOP, UP, acro_score, align, backtrack, csc_diag, csc_row, csc_score, i, j, m, matches, move, n, pos, query, query_lw, score, score_diag, score_row, score_up, si_lw, start, trace; if (offset == null) { offset = 0; } query = preparedQuery.query; query_lw = preparedQuery.query_lw; m = subject.length; n = query.length; acro_score = scoreAcronyms(subject, subject_lw, query, query_lw).score; score_row = new Array(n); csc_row = new Array(n); STOP = 0; UP = 1; LEFT = 2; DIAGONAL = 3; trace = new Array(m * n); pos = -1; j = -1; while (++j < n) { score_row[j] = 0; csc_row[j] = 0; } i = -1; while (++i < m) { score = 0; score_up = 0; csc_diag = 0; si_lw = subject_lw[i]; j = -1; while (++j < n) { csc_score = 0; align = 0; score_diag = score_up; if (query_lw[j] === si_lw) { start = isWordStart(i, subject, subject_lw); csc_score = csc_diag > 0 ? csc_diag : scoreConsecutives(subject, subject_lw, query, query_lw, i, j, start); align = score_diag + scoreCharacter(i, j, start, acro_score, csc_score); } score_up = score_row[j]; csc_diag = csc_row[j]; if (score > score_up) { move = LEFT; } else { score = score_up; move = UP; } if (align > score) { score = align; move = DIAGONAL; } else { csc_score = 0; } score_row[j] = score; csc_row[j] = csc_score; trace[++pos] = score > 0 ? move : STOP; } } i = m - 1; j = n - 1; pos = i * n + j; backtrack = true; matches = []; while (backtrack && i >= 0 && j >= 0) { switch (trace[pos]) { case UP: i--; pos -= n; break; case LEFT: j--; pos--; break; case DIAGONAL: matches.push(i + offset); j--; i--; pos -= n + 1; break; default: backtrack = false; } } matches.reverse(); return matches; }; }).call(this); /***/ }), /* 167 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var React = __webpack_require__(0); __webpack_require__(851); var dom = React.DOM; var ImPropTypes = __webpack_require__(150); var configMap = __webpack_require__(145).sidePanelItems; var Tabs = React.createFactory(__webpack_require__(172)); var Sidebar = React.createFactory(__webpack_require__(176)); var Settings = React.createFactory(__webpack_require__(179)); var githubUrl = "https://github.com/devtools-html/debugger.html/blob/master"; function getTabsByClientType(tabs, clientType) { return tabs.valueSeq().filter(tab => tab.get("clientType") == clientType); } function firstTimeMessage(title, urlPart) { return dom.div({ className: "footer-note" }, `First time connecting to ${title}? Checkout out the `, dom.a({ href: `${githubUrl}/docs/getting-setup.md#starting-${urlPart}`, target: "_blank" }, "docs"), "."); } var LandingPage = React.createClass({ displayName: "LandingPage", propTypes: { tabs: ImPropTypes.map.isRequired, supportsFirefox: React.PropTypes.bool.isRequired, supportsChrome: React.PropTypes.bool.isRequired, title: React.PropTypes.string.isRequired, filterString: React.PropTypes.string, onFilterChange: React.PropTypes.func.isRequired, onTabClick: React.PropTypes.func.isRequired, config: React.PropTypes.object.isRequired, setValue: React.PropTypes.func.isRequired }, getInitialState() { return { selectedPane: configMap.Firefox.name, firefoxConnected: false, chromeConnected: false }; }, componentDidUpdate() { if (this.refs.filterInput) { this.refs.filterInput.focus(); } }, onFilterChange(newFilterString) { this.props.onFilterChange(newFilterString); }, onSideBarItemClick(itemTitle) { if (itemTitle !== this.state.selectedPane) { this.setState({ selectedPane: itemTitle }); } }, renderLaunchOptions() { var selectedPane = this.state.selectedPane; var _configMap$selectedPa = configMap[selectedPane], name = _configMap$selectedPa.name, isUnderConstruction = _configMap$selectedPa.isUnderConstruction; var isConnected = name === configMap.Firefox.name ? this.state.firefoxConnected : this.state.chromeConnected; var isNodeSelected = name === configMap.Node.name; if (isNodeSelected) { return dom.div({ className: "launch-action-container" }, dom.h3({}, "Run a node script in the terminal with `--inspect`"), isUnderConstruction ? this.renderExperimentalMessage(name) : null); } var connectedStateText = isNodeSelected ? null : `Please open a tab in ${name}`; return isConnected ? connectedStateText : this.renderLaunchButton(name, isUnderConstruction); }, renderLaunchButton(browserName, isUnderConstruction) { return dom.div({ className: "launch-action-container" }, dom.button({ onClick: () => this.launchBrowser(browserName) }, `Launch ${browserName}`), isUnderConstruction ? this.renderExperimentalMessage(browserName) // eslint-disable-line max-len : null); }, renderExperimentalMessage(browserName) { var underConstructionMessage = "Debugging is experimental and certain features won't work (i.e, seeing variables, attaching breakpoints)"; // eslint-disable-line max-len var githubIssuesUrl = "https://github.com/devtools-html/debugger.html/issues?q=is%3Aopen+is%3Aissue+label%3A"; var underConstructionImageSrc = __webpack_require__(855); return dom.div({ className: "under-construction" }, dom.img({ src: underConstructionImageSrc }), dom.div({ className: "under-construction-message" }, underConstructionMessage, // eslint-disable-line max-len dom.a({ className: "github-link", href: `${githubIssuesUrl}${browserName}`, target: "_blank" }, "Help us make it happen"))); }, launchBrowser(browser) { fetch("/launch", { body: JSON.stringify({ browser }), headers: { "Content-Type": "application/json" }, method: "post" }).then(resp => { if (browser === configMap.Firefox.name) { this.setState({ firefoxConnected: true }); } else { this.setState({ chromeConnected: true }); } }).catch(err => { alert(`Error launching ${browser}. ${err.message}`); }); }, renderEmptyPanel() { return dom.div({ className: "hero" }, this.renderLaunchOptions()); }, renderSettings() { var _props = this.props, config = _props.config, setValue = _props.setValue; return dom.div({}, dom.header({}, dom.h1({}, configMap.Settings.name)), Settings({ config, setValue })); }, renderFilter() { var selectedPane = this.state.selectedPane; var _props2 = this.props, tabs = _props2.tabs, _props2$filterString = _props2.filterString, filterString = _props2$filterString === undefined ? "" : _props2$filterString; var _configMap$selectedPa2 = configMap[selectedPane], clientType = _configMap$selectedPa2.clientType, paramName = _configMap$selectedPa2.paramName; var targets = getTabsByClientType(tabs, clientType); return dom.header({}, dom.input({ ref: "filterInput", placeholder: "Filter tabs", value: filterString, autoFocus: true, type: "search", onChange: e => this.onFilterChange(e.target.value), onKeyDown: e => { if (targets.size === 1 && e.keyCode === 13) { this.onTabClick(targets.first(), paramName); } } })); }, renderPanel() { var _props3 = this.props, onTabClick = _props3.onTabClick, tabs = _props3.tabs; var selectedPane = this.state.selectedPane; var _configMap$selectedPa3 = configMap[selectedPane], name = _configMap$selectedPa3.name, clientType = _configMap$selectedPa3.clientType, paramName = _configMap$selectedPa3.paramName; var clientTargets = getTabsByClientType(tabs, clientType); var tabsDetected = clientTargets && clientTargets.count() > 0; var targets = clientTargets.filter(t => !t.get("filteredOut")); var isSettingsPaneSelected = name === configMap.Settings.name; if (isSettingsPaneSelected) { return this.renderSettings(); } if (!tabsDetected) { return this.renderEmptyPanel(); } return dom.div({}, this.renderFilter(), Tabs({ targets, paramName, onTabClick })); }, render() { var _props4 = this.props, supportsFirefox = _props4.supportsFirefox, supportsChrome = _props4.supportsChrome, title = _props4.title; var selectedPane = this.state.selectedPane; var onSideBarItemClick = this.onSideBarItemClick; var _configMap$selectedPa4 = configMap[selectedPane], name = _configMap$selectedPa4.name, docsUrlPart = _configMap$selectedPa4.docsUrlPart; return dom.div({ className: "landing-page" }, Sidebar({ supportsFirefox, supportsChrome, title, selectedPane, onSideBarItemClick }), dom.main({ className: "panel" }, this.renderPanel(), firstTimeMessage(name, docsUrlPart))); } }); module.exports = LandingPage; /***/ }), /* 168 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(global, module) { Object.defineProperty(exports, "__esModule", { value: true }); var _ponyfill = __webpack_require__(169); var _ponyfill2 = _interopRequireDefault(_ponyfill); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var root; /* global window */ if (typeof self !== 'undefined') { root = self; } else if (typeof window !== 'undefined') { root = window; } else if (typeof global !== 'undefined') { root = global; } else if (true) { root = module; } else { root = Function('return this')(); } var result = (0, _ponyfill2['default'])(root); exports['default'] = result; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(792), __webpack_require__(793)(module))) /***/ }), /* 169 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports['default'] = symbolObservablePonyfill; 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; }; /***/ }), /* 170 */, /* 171 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = combineReducers; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createStore__ = __webpack_require__(32); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_es_isPlainObject__ = __webpack_require__(33); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_warning__ = __webpack_require__(35); 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. ' + 'If you want this reducer to hold no value, you can return null instead of undefined.'; } function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) { var reducerKeys = Object.keys(reducers); var argumentName = action && action.type === __WEBPACK_IMPORTED_MODULE_0__createStore__["a" /* ActionTypes */].INIT ? 'preloadedState 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 (!Object(__WEBPACK_IMPORTED_MODULE_1_lodash_es_isPlainObject__["a" /* 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) && !unexpectedKeyCache[key]; }); unexpectedKeys.forEach(function (key) { unexpectedKeyCache[key] = true; }); 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 assertReducerShape(reducers) { Object.keys(reducers).forEach(function (key) { var reducer = reducers[key]; var initialState = reducer(undefined, { type: __WEBPACK_IMPORTED_MODULE_0__createStore__["a" /* 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. If you don\'t want to set a value for this reducer, ' + 'you can use null instead of 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 ' + __WEBPACK_IMPORTED_MODULE_0__createStore__["a" /* 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, but can be null.'); } }); } /** * 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 (false) { if (typeof reducers[key] === 'undefined') { warning('No reducer provided for key "' + key + '"'); } } if (typeof reducers[key] === 'function') { finalReducers[key] = reducers[key]; } } var finalReducerKeys = Object.keys(finalReducers); var unexpectedKeyCache = void 0; if (false) { unexpectedKeyCache = {}; } var shapeAssertionError = void 0; try { assertReducerShape(finalReducers); } catch (e) { shapeAssertionError = e; } return function combination() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var action = arguments[1]; if (shapeAssertionError) { throw shapeAssertionError; } if (false) { var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache); if (warningMessage) { warning(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; }; } /***/ }), /* 172 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var React = __webpack_require__(0); __webpack_require__(852); var dom = React.DOM; var classnames = __webpack_require__(175); function getTabURL(tab, paramName) { var tabID = tab.get("id"); return `/?${paramName}=${tabID}`; } var Tabs = React.createClass({ displayName: "Tabs", propTypes: { targets: React.PropTypes.object.isRequired, paramName: React.PropTypes.string.isRequired, onTabClick: React.PropTypes.func.isRequired }, onTabClick(tab, paramName) { this.props.onTabClick(getTabURL(tab, paramName)); }, render() { var _props = this.props, targets = _props.targets, paramName = _props.paramName; if (!targets || targets.count() == 0) { return dom.div({}, ""); } var tabClassNames = ["tab"]; if (targets.size === 1) { tabClassNames.push("active"); } return dom.div({ className: "tab-group" }, dom.ul({ className: "tab-list" }, targets.valueSeq().map(tab => dom.li({ className: classnames("tab", { active: targets.size === 1 }), key: tab.get("id"), tabIndex: 0, role: "link", onClick: () => this.onTabClick(tab, paramName), onKeyDown: e => { if (e.keyCode === 13) { this.onTabClick(tab, paramName); } } }, dom.div({ className: "tab-title" }, tab.get("title")), dom.div({ className: "tab-url" }, tab.get("url")))))); } }); module.exports = Tabs; /***/ }), /* 173 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = 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; } /***/ }), /* 174 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = applyMiddleware; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__compose__ = __webpack_require__(36); 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; }; /** * 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, preloadedState, enhancer) { var store = createStore(reducer, preloadedState, 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 = __WEBPACK_IMPORTED_MODULE_0__compose__["a" /* default */].apply(undefined, chain)(store.dispatch); return _extends({}, store, { dispatch: _dispatch }); }; }; } /***/ }), /* 175 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! Copyright (c) 2016 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ /* global define */ (function () { 'use strict'; var hasOwn = {}.hasOwnProperty; function classNames () { var classes = []; for (var i = 0; i < arguments.length; i++) { var arg = arguments[i]; if (!arg) continue; var argType = typeof arg; if (argType === 'string' || argType === 'number') { classes.push(arg); } else if (Array.isArray(arg)) { classes.push(classNames.apply(null, arg)); } else if (argType === 'object') { for (var key in arg) { if (hasOwn.call(arg, key) && arg[key]) { classes.push(key); } } } } return classes.join(' '); } if (typeof module !== 'undefined' && module.exports) { module.exports = classNames; } else if (true) { // register as 'classnames', consistent with npm package name !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () { return classNames; }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else { window.classNames = classNames; } }()); /***/ }), /* 176 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var React = __webpack_require__(0); var createElement = React.createElement; __webpack_require__(853); var rocketSvg = __webpack_require__(1126); var InlineSVG = __webpack_require__(1205); var dom = React.DOM; var classnames = __webpack_require__(175); var Sidebar = React.createClass({ displayName: "Sidebar", propTypes: { supportsFirefox: React.PropTypes.bool.isRequired, supportsChrome: React.PropTypes.bool.isRequired, title: React.PropTypes.string.isRequired, selectedPane: React.PropTypes.string.isRequired, onSideBarItemClick: React.PropTypes.func.isRequired }, renderTitle(title) { return dom.div({ className: "title-wrapper" }, dom.h1({}, title), dom.div({ className: "launchpad-container" }, createElement(InlineSVG, { className: "launchpad-container-icon", src: rocketSvg }), dom.h2({ className: "launchpad-container-title" }, "Launchpad"))); }, renderItem(title) { return dom.li({ className: classnames({ selected: title == this.props.selectedPane }), key: title, tabIndex: 0, role: "button", onClick: () => this.props.onSideBarItemClick(title), onKeyDown: e => { if (e.keyCode === 13) { this.props.onSideBarItemClick(title); } } }, dom.a({}, title)); }, render() { var connections = []; if (this.props.supportsFirefox) { connections.push("Firefox"); } if (this.props.supportsChrome) { connections.push("Chrome", "Node"); } return dom.aside({ className: "sidebar" }, this.renderTitle(this.props.title), dom.ul({}, connections.map(title => this.renderItem(title)), this.renderItem("Settings"))); } }); module.exports = Sidebar; /***/ }), /* 177 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var emptyFunction = __webpack_require__(178); var invariant = __webpack_require__(180); var ReactPropTypesSecret = __webpack_require__(187); module.exports = function() { function shim(props, propName, componentName, location, propFullName, secret) { if (secret === ReactPropTypesSecret) { // It is still safe when called from React. return; } invariant( false, 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types' ); }; shim.isRequired = shim; function getShim() { return shim; }; // Important! // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. var ReactPropTypes = { array: shim, bool: shim, func: shim, number: shim, object: shim, string: shim, symbol: shim, any: shim, arrayOf: getShim, element: shim, instanceOf: getShim, node: shim, objectOf: getShim, oneOf: getShim, oneOfType: getShim, shape: getShim, exact: getShim }; ReactPropTypes.checkPropTypes = emptyFunction; ReactPropTypes.PropTypes = ReactPropTypes; return ReactPropTypes; }; /***/ }), /* 178 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * */ function makeEmptyFunction(arg) { return function () { return arg; }; } /** * This function accepts and discards inputs; it has no side effects. This is * primarily useful idiomatically for overridable function endpoints which * always need to be callable, since JS lacks a null-call idiom ala Cocoa. */ var emptyFunction = function emptyFunction() {}; emptyFunction.thatReturns = makeEmptyFunction; emptyFunction.thatReturnsFalse = makeEmptyFunction(false); emptyFunction.thatReturnsTrue = makeEmptyFunction(true); emptyFunction.thatReturnsNull = makeEmptyFunction(null); emptyFunction.thatReturnsThis = function () { return this; }; emptyFunction.thatReturnsArgument = function (arg) { return arg; }; module.exports = emptyFunction; /***/ }), /* 179 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var React = __webpack_require__(0); var dom = React.DOM; var _require = __webpack_require__(1130), showMenu = _require.showMenu, buildMenu = _require.buildMenu; var Settings = React.createClass({ displayName: "Settings", propTypes: { config: React.PropTypes.object.isRequired, setValue: React.PropTypes.func.isRequired }, onConfigContextMenu(event, key) { event.preventDefault(); var _props = this.props, setValue = _props.setValue, config = _props.config; var setConfig = (path, value) => { setValue(path, value); }; var ltrMenuItem = { id: "node-menu-ltr", label: "ltr", disabled: config[key] === "ltr", click: () => setConfig(key, "ltr") }; var rtlMenuItem = { id: "node-menu-rtl", label: "rtl", disabled: config[key] === "rtl", click: () => setConfig(key, "rtl") }; var lightMenuItem = { id: "node-menu-light", label: "light", disabled: config[key] === "light", click: () => setConfig(key, "light") }; var darkMenuItem = { id: "node-menu-dark", label: "dark", disabled: config[key] === "dark", click: () => setConfig(key, "dark") }; var firebugMenuItem = { id: "node-menu-firebug", label: "firebug", disabled: config[key] === "firebug", click: () => setConfig(key, "firebug") }; var items = { "dir": [{ item: ltrMenuItem }, { item: rtlMenuItem }], "theme": [{ item: lightMenuItem }, { item: darkMenuItem }, { item: firebugMenuItem }] }; showMenu(event, buildMenu(items[key])); }, onInputHandler(e, path) { var setValue = this.props.setValue; setValue(path, e.target.checked); }, renderConfig(config) { var configs = [{ name: "dir", label: "direction" }, { name: "theme", label: "theme" // Hiding hotReloading option for now. See Issue #242 // { name: "hotReloading", label: "hot reloading", bool: true } }]; return dom.ul({ className: "tab-list" }, configs.map(c => { return dom.li({ key: c.name, className: "tab tab-sides" }, dom.div({ className: "tab-title" }, c.label), c.bool ? dom.input({ type: "checkbox", defaultChecked: config[c.name], onChange: e => this.onInputHandler(e, c.name) }, null) : dom.div({ className: "tab-value", onClick: e => this.onConfigContextMenu(e, c.name) }, config[c.name])); })); }, renderFeatures(features) { return dom.ul({ className: "tab-list" }, Object.keys(features).map(key => dom.li({ className: "tab tab-sides", key }, dom.div({ className: "tab-title" }, typeof features[key] == "object" ? features[key].label : key), dom.div({ className: "tab-value" }, dom.input({ type: "checkbox", defaultChecked: features[key].enabled, onChange: e => this.onInputHandler(e, `features.${key}.enabled`) }))))); }, render() { var config = this.props.config; return dom.div({ className: "tab-group" }, dom.h3({}, "Configurations"), this.renderConfig(config), config.features ? (dom.h3({}, "Features"), this.renderFeatures(config.features)) : null); } }); module.exports = Settings; /***/ }), /* 180 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * */ /** * Use invariant() to assert state which your program assumes to be true. * * Provide sprintf-style format (only %s is supported) and arguments * to provide information about what broke and what you were * expecting. * * The invariant message will be stripped in production, but the invariant * will remain to ensure logic does not differ in production. */ var validateFormat = function validateFormat(format) {}; if (false) { validateFormat = function validateFormat(format) { if (format === undefined) { throw new Error('invariant requires an error message argument'); } }; } function invariant(condition, format, a, b, c, d, e, f) { validateFormat(format); if (!condition) { var error; if (format === undefined) { error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); } else { var args = [a, b, c, d, e, f]; var argIndex = 0; error = new Error(format.replace(/%s/g, function () { return args[argIndex++]; })); error.name = 'Invariant Violation'; } error.framesToPop = 1; // we don't care about invariant's own frame throw error; } } module.exports = invariant; /***/ }), /* 181 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var tabs = __webpack_require__(182); var config = __webpack_require__(183); module.exports = Object.assign({}, tabs, config); /***/ }), /* 182 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* global window */ /** * Redux actions for the pause state * @module actions/tabs */ var constants = __webpack_require__(145); /** * @typedef {Object} TabAction * @memberof actions/tabs * @static * @property {number} type The type of Action * @property {number} value The payload of the Action */ /** * @memberof actions/tabs * @static * @returns {TabAction} with type constants.CLEAR_TABS and tabs as value */ function clearTabs() { return { type: constants.CLEAR_TABS }; } /** * @memberof actions/tabs * @static * @param {Array} tabs * @returns {TabAction} with type constants.ADD_TABS and tabs as value */ function newTabs(tabs) { return (_ref) => { var getState = _ref.getState, dispatch = _ref.dispatch; return dispatch({ type: constants.ADD_TABS, value: tabs }); }; } /** * @memberof actions/tabs * @static * @param {String} $0.id Unique ID of the tab to select * @returns {TabAction} */ function selectTab(_ref2) { var id = _ref2.id; return { type: constants.SELECT_TAB, id: id }; } /** * @memberof actions/tabs * @static * @param {String} value String which should be used to filter tabs * @returns {TabAction} with type constants.FILTER_TABS * and filter string as value */ function filterTabs(value) { return { type: constants.FILTER_TABS, value }; } module.exports = { newTabs, selectTab, filterTabs, clearTabs }; /***/ }), /* 183 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var _require = __webpack_require__(828), _setConfig = _require.setConfig; var _require2 = __webpack_require__(131), updateTheme = _require2.updateTheme, updateDir = _require2.updateDir; /** * Redux actions for the pause state * @module actions/config */ var constants = __webpack_require__(145); /** * @typedef {Object} ConfigAction * @memberof actions/config * @static * @property {number} type The type of Action * @property {number} value The payload of the Action */ /** * @memberof actions/config * @static * @param {string} path * @param {string} value * @returns {ConfigAction} with type constants.SET_VALUE and value */ function setValue(path, value) { return (() => { var _ref = _asyncToGenerator(function* (_ref2) { var dispatch = _ref2.dispatch; var response = yield fetch("/setconfig", { method: "post", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ path, value }) }); var config = yield response.json(); _setConfig(config); updateTheme(); updateDir(); dispatch({ type: constants.SET_VALUE, path, value }); }); return function (_x) { return _ref.apply(this, arguments); }; })(); } /** * @memberof actions/config * @static * @param {string} config * @returns {ConfigAction} with type constants.SET_CONFIG and config */ function setConfig(config) { return { type: constants.SET_CONFIG, config }; } module.exports = { setValue, setConfig }; /***/ }), /* 184 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var _require = __webpack_require__(828), isDevelopment = _require.isDevelopment, isTesting = _require.isTesting; function debugGlobal(field, value) { if (isDevelopment() || isTesting()) { window[field] = value; } } module.exports = { debugGlobal }; /***/ }), /* 185 */ /***/ (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); } } /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var _require = __webpack_require__(975), sprintf = _require.sprintf; var _require2 = __webpack_require__(883), parse = _require2.parse; var strings = {}; function setBundle(bundle) { bundle = parse(bundle); strings = Object.assign(strings, bundle); } function getStr(key) { if (!strings[key]) { throw new Error(`L10N key ${key} cannot be found.`); } return strings[key]; } function getFormatStr(name) { for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } return sprintf.apply(undefined, [getStr(name)].concat(_toConsumableArray(args))); } function numberWithDecimals(number) { var decimals = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; // If this is an integer, don't do anything special. if (number === (number | 0)) { return number; } // If this isn't a number (and yes, `isNaN(null)` is false), return zero. if (isNaN(number) || number === null) { return "0"; } var localized = number.toLocaleString(); // If no grouping or decimal separators are available, bail out, because // padding with zeros at the end of the string won't make sense anymore. if (!localized.match(/[^\d]/)) { return localized; } return number.toLocaleString(undefined, { maximumFractionDigits: decimals, minimumFractionDigits: decimals }); } module.exports = { setBundle, getStr, getFormatStr, numberWithDecimals }; /***/ }), /* 186 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var classnames = __webpack_require__(175); __webpack_require__(856); module.exports = function (className) { var root = document.createElement("div"); root.className = classnames(className); root.style.setProperty("flex", 1); return root; }; /***/ }), /* 187 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; module.exports = ReactPropTypesSecret; /***/ }), /* 188 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: 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 = remapLocations; function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } function remapLocations(breakpoints, sourceId, sourceMaps) { var sourceBreakpoints = breakpoints.map((() => { var _ref = _asyncToGenerator(function* (breakpoint) { if (breakpoint.location.sourceId !== sourceId) { return breakpoint; } var location = yield sourceMaps.getOriginalLocation(breakpoint.location); return _extends({}, breakpoint, { location }); }); return function (_x) { return _ref.apply(this, arguments); }; })()); return Promise.all(sourceBreakpoints.valueSeq()); } /***/ }), /* 189 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _redux = __webpack_require__(3); var _waitService = __webpack_require__(190); var _log = __webpack_require__(191); var _history = __webpack_require__(192); var _promise = __webpack_require__(193); var _thunk = __webpack_require__(224); var _timing = __webpack_require__(992); /** * This creates a dispatcher with all the standard middleware in place * that all code requires. It can also be optionally configured in * various ways, such as logging and recording. * * @param {object} opts: * - log: log all dispatched actions to console * - history: an array to store every action in. Should only be * used in tests. * - middleware: array of middleware to be included in the redux store * @memberof utils/create-store * @static */ /** * @memberof utils/create-store * @static */ var configureStore = function () { var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var middleware = [(0, _thunk.thunk)(opts.makeThunkArgs), _promise.promise, // Order is important: services must go last as they always // operate on "already transformed" actions. Actions going through // them shouldn't have any special fields like promises, they // should just be normal JSON objects. _waitService.waitUntilService]; if (opts.history) { middleware.push((0, _history.history)(opts.history)); } if (opts.middleware) { opts.middleware.forEach(fn => middleware.push(fn)); } if (opts.log) { middleware.push(_log.log); } if (opts.timing) { middleware.push(_timing.timing); } // Hook in the redux devtools browser extension if it exists var devtoolsExt = typeof window === "object" && window.devToolsExtension ? window.devToolsExtension() : f => f; return _redux.applyMiddleware.apply(undefined, middleware)(devtoolsExt(_redux.createStore)); }; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* global window */ /** * Redux store utils * @module utils/create-store */ exports.default = configureStore; /***/ }), /* 190 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.waitUntilService = waitUntilService; /** * A middleware which acts like a service, because it is stateful * and "long-running" in the background. It provides the ability * for actions to install a function to be run once when a specific * condition is met by an action coming through the system. Think of * it as a thunk that blocks until the condition is met. Example: * * ```js * const services = { WAIT_UNTIL: require('wait-service').NAME }; * * { type: services.WAIT_UNTIL, * predicate: action => action.type === "ADD_ITEM", * run: (dispatch, getState, action) => { * // Do anything here. You only need to accept the arguments * // if you need them. `action` is the action that satisfied * // the predicate. * } * } * ``` */ var NAME = exports.NAME = "@@service/waitUntil"; function waitUntilService(_ref) { var dispatch = _ref.dispatch, getState = _ref.getState; var pending = []; function checkPending(action) { var readyRequests = []; var stillPending = []; // Find the pending requests whose predicates are satisfied with // this action. Wait to run the requests until after we update the // pending queue because the request handler may synchronously // dispatch again and run this service (that use case is // completely valid). for (var request of pending) { if (request.predicate(action)) { readyRequests.push(request); } else { stillPending.push(request); } } pending = stillPending; for (var _request of readyRequests) { _request.run(dispatch, getState, action); } } return next => action => { if (action.type === NAME) { pending.push(action); return null; } var result = next(action); checkPending(action); return result; }; } /***/ }), /* 191 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.log = log; /** * A middleware that logs all actions coming through the system * to the console. */ function log(_ref) { var dispatch = _ref.dispatch, getState = _ref.getState; return next => action => { var actionText = JSON.stringify(action, null, 2); var truncatedActionText = `${actionText.slice(0, 1000)}...`; console.log(`[DISPATCH ${action.type}]`, action, truncatedActionText); next(action); }; } /***/ }), /* 192 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.history = undefined; var _devtoolsConfig = __webpack_require__(828); /** * A middleware that stores every action coming through the store in the passed * in logging object. Should only be used for tests, as it collects all * action information, which will cause memory bloat. */ var history = exports.history = function () { var log = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; return (_ref) => { var dispatch = _ref.dispatch, getState = _ref.getState; return next => action => { if ((0, _devtoolsConfig.isDevelopment)()) { log.push(action); } return next(action); }; }; }; /***/ }), /* 193 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.promise = exports.PROMISE = undefined; var _lodash = __webpack_require__(2); var _DevToolsUtils = __webpack_require__(222); /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var seqIdVal = 1; function seqIdGen() { return seqIdVal++; } function filterAction(action) { return (0, _lodash.fromPairs)((0, _lodash.toPairs)(action).filter(pair => pair[0] !== PROMISE)); } function promiseMiddleware(_ref) { var dispatch = _ref.dispatch, getState = _ref.getState; return next => action => { if (!(PROMISE in action)) { return next(action); } var promiseInst = action[PROMISE]; var seqId = seqIdGen().toString(); // Create a new action that doesn't have the promise field and has // the `seqId` field that represents the sequence id action = Object.assign(filterAction(action), { seqId }); dispatch(Object.assign({}, action, { status: "start" })); // Return the promise so action creators can still compose if they // want to. return new Promise((resolve, reject) => { promiseInst.then(value => { (0, _DevToolsUtils.executeSoon)(() => { dispatch(Object.assign({}, action, { status: "done", value: value })); resolve(value); }); }, error => { (0, _DevToolsUtils.executeSoon)(() => { dispatch(Object.assign({}, action, { status: "error", error: error.message || error })); reject(error); }); }); }); }; } var PROMISE = exports.PROMISE = "@@dispatch/promise"; exports.promise = promiseMiddleware; /***/ }), /* 194 */, /* 195 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createPrettySource = createPrettySource; var _selectors = __webpack_require__(242); var _prettyPrint = __webpack_require__(903); var _pause = __webpack_require__(255); var _source = __webpack_require__(233); function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } function createPrettySource(sourceId) { return (() => { var _ref = _asyncToGenerator(function* (_ref2) { var dispatch = _ref2.dispatch, getState = _ref2.getState, sourceMaps = _ref2.sourceMaps; var source = (0, _selectors.getSource)(getState(), sourceId).toJS(); var url = (0, _source.getPrettySourceURL)(source.url); var id = yield sourceMaps.generatedToOriginalId(sourceId, url); var _ref3 = yield (0, _prettyPrint.prettyPrint)({ source, url }), code = _ref3.code, mappings = _ref3.mappings; yield sourceMaps.applySourceMap(source.id, url, code, mappings); var frames = (0, _selectors.getFrames)(getState()); if (frames) { frames = yield (0, _pause.updateFrameLocations)(frames, sourceMaps); } var prettySource = { url, id, isPrettyPrinted: true, text: code, contentType: "text/javascript", frames, loadedState: "loaded" }; return dispatch({ type: "ADD_SOURCE", source: prettySource }); }); return function (_x) { return _ref.apply(this, arguments); }; })(); } /***/ }), /* 196 */, /* 197 */ /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_197__; /***/ }), /* 198 */, /* 199 */, /* 200 */, /* 201 */, /* 202 */, /* 203 */, /* 204 */, /* 205 */, /* 206 */, /* 207 */, /* 208 */ /***/ (function(module, exports, __webpack_require__) { var baseIsArguments = __webpack_require__(209), isObjectLike = __webpack_require__(14); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** Built-in value references. */ var propertyIsEnumerable = objectProto.propertyIsEnumerable; /** * Checks if `value` is likely an `arguments` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, * else `false`. * @example * * _.isArguments(function() { return arguments; }()); * // => true * * _.isArguments([1, 2, 3]); * // => false */ var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee'); }; module.exports = isArguments; /***/ }), /* 209 */ /***/ (function(module, exports, __webpack_require__) { var baseGetTag = __webpack_require__(6), isObjectLike = __webpack_require__(14); /** `Object#toString` result references. */ var argsTag = '[object Arguments]'; /** * The base implementation of `_.isArguments`. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, */ function baseIsArguments(value) { return isObjectLike(value) && baseGetTag(value) == argsTag; } module.exports = baseIsArguments; /***/ }), /* 210 */, /* 211 */, /* 212 */, /* 213 */, /* 214 */ /***/ (function(module, exports) { /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991; /** * Checks if `value` is a valid array-like length. * * **Note:** This method is loosely based on * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * _.isLength(3); * // => true * * _.isLength(Number.MIN_VALUE); * // => false * * _.isLength(Infinity); * // => false * * _.isLength('3'); * // => false */ function isLength(value) { return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } module.exports = isLength; /***/ }), /* 215 */, /* 216 */, /* 217 */, /* 218 */, /* 219 */, /* 220 */, /* 221 */, /* 222 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.reportException = reportException; exports.executeSoon = executeSoon; var _assert = __webpack_require__(223); var _assert2 = _interopRequireDefault(_assert); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function reportException(who, exception) { var msg = `${who} threw an exception: `; console.error(msg, exception); } function executeSoon(fn) { setTimeout(fn, 0); } exports.default = _assert2.default; /***/ }), /* 223 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = assert; var _devtoolsConfig = __webpack_require__(828); function assert(condition, message) { if ((0, _devtoolsConfig.isDevelopment)() && !condition) { throw new Error(`Assertion failure: ${message}`); } } /***/ }), /* 224 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.thunk = thunk; /** * A middleware that allows thunks (functions) to be dispatched. If * it's a thunk, it is called with an argument that contains * `dispatch`, `getState`, and any additional args passed in via the * middleware constructure. This allows the action to create multiple * actions (most likely asynchronously). */ function thunk(makeArgs) { return (_ref) => { var dispatch = _ref.dispatch, getState = _ref.getState; var args = { dispatch, getState }; return next => action => { return typeof action === "function" ? action(makeArgs ? makeArgs(args, getState()) : args) : next(action); }; }; } /***/ }), /* 225 */, /* 226 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); // @flow const { isDevelopment } = __webpack_require__(828); const { Services, PrefsHelper } = __webpack_require__(830); const prefsSchemaVersion = "1.0.3"; const pref = Services.pref; if (isDevelopment()) { pref("devtools.source-map.client-service.enabled", true); pref("devtools.debugger.pause-on-exceptions", false); pref("devtools.debugger.ignore-caught-exceptions", false); pref("devtools.debugger.call-stack-visible", false); pref("devtools.debugger.scopes-visible", false); pref("devtools.debugger.start-panel-collapsed", false); pref("devtools.debugger.end-panel-collapsed", false); pref("devtools.debugger.tabs", "[]"); pref("devtools.debugger.ui.framework-grouping-on", true); pref("devtools.debugger.pending-selected-location", "{}"); pref("devtools.debugger.pending-breakpoints", "{}"); pref("devtools.debugger.expressions", "[]"); pref("devtools.debugger.file-search-case-sensitive", false); pref("devtools.debugger.file-search-whole-word", false); pref("devtools.debugger.file-search-regex-match", false); pref("devtools.debugger.prefs-schema-version", "1.0.1"); pref("devtools.debugger.features.project-text-search", true); pref("devtools.debugger.features.async-stepping", true); pref("devtools.debugger.features.wasm", true); pref("devtools.debugger.features.shortcuts", true); } const prefs = new PrefsHelper("devtools", { clientSourceMapsEnabled: ["Bool", "source-map.client-service.enabled"], pauseOnExceptions: ["Bool", "debugger.pause-on-exceptions"], ignoreCaughtExceptions: ["Bool", "debugger.ignore-caught-exceptions"], callStackVisible: ["Bool", "debugger.call-stack-visible"], scopesVisible: ["Bool", "debugger.scopes-visible"], startPanelCollapsed: ["Bool", "debugger.start-panel-collapsed"], endPanelCollapsed: ["Bool", "debugger.end-panel-collapsed"], frameworkGroupingOn: ["Bool", "debugger.ui.framework-grouping-on"], tabs: ["Json", "debugger.tabs", []], pendingSelectedLocation: ["Json", "debugger.pending-selected-location", {}], pendingBreakpoints: ["Json", "debugger.pending-breakpoints", {}], expressions: ["Json", "debugger.expressions", []], fileSearchCaseSensitive: ["Bool", "debugger.file-search-case-sensitive"], fileSearchWholeWord: ["Bool", "debugger.file-search-whole-word"], fileSearchRegexMatch: ["Bool", "debugger.file-search-regex-match"], debuggerPrefsSchemaVersion: ["Char", "debugger.prefs-schema-version"] }); /* harmony export (immutable) */ __webpack_exports__["prefs"] = prefs; const features = new PrefsHelper("devtools.debugger.features", { asyncStepping: ["Bool", "async-stepping", false], projectTextSearch: ["Bool", "project-text-search", true], wasm: ["Bool", "wasm", true], shortcuts: ["Bool", "shortcuts", false] }); /* harmony export (immutable) */ __webpack_exports__["features"] = features; if (prefs.debuggerPrefsSchemaVersion !== prefsSchemaVersion) { // clear pending Breakpoints prefs.pendingBreakpoints = {}; prefs.debuggerPrefsSchemaVersion = prefsSchemaVersion; } /***/ }), /* 227 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _expressions = __webpack_require__(228); var _expressions2 = _interopRequireDefault(_expressions); var _eventListeners = __webpack_require__(231); var _eventListeners2 = _interopRequireDefault(_eventListeners); var _sources = __webpack_require__(232); var _sources2 = _interopRequireDefault(_sources); var _breakpoints = __webpack_require__(236); var _breakpoints2 = _interopRequireDefault(_breakpoints); var _pendingBreakpoints = __webpack_require__(1133); var _pendingBreakpoints2 = _interopRequireDefault(_pendingBreakpoints); var _asyncRequests = __webpack_require__(238); var _asyncRequests2 = _interopRequireDefault(_asyncRequests); var _pause = __webpack_require__(239); var _pause2 = _interopRequireDefault(_pause); var _ui = __webpack_require__(240); var _ui2 = _interopRequireDefault(_ui); var _ast = __webpack_require__(1058); var _ast2 = _interopRequireDefault(_ast); var _coverage = __webpack_require__(241); var _coverage2 = _interopRequireDefault(_coverage); var _projectTextSearch = __webpack_require__(31); var _projectTextSearch2 = _interopRequireDefault(_projectTextSearch); var _sourceSearch = __webpack_require__(1132); var _sourceSearch2 = _interopRequireDefault(_sourceSearch); var _sourceTree = __webpack_require__(1176); var _sourceTree2 = _interopRequireDefault(_sourceTree); var _debuggee = __webpack_require__(1175); var _debuggee2 = _interopRequireDefault(_debuggee); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ exports.default = { expressions: _expressions2.default, eventListeners: _eventListeners2.default, sources: _sources2.default, breakpoints: _breakpoints2.default, pendingBreakpoints: _pendingBreakpoints2.default, asyncRequests: _asyncRequests2.default, pause: _pause2.default, ui: _ui2.default, ast: _ast2.default, coverage: _coverage2.default, projectTextSearch: _projectTextSearch2.default, sourceSearch: _sourceSearch2.default, sourceTree: _sourceTree2.default, debuggee: _debuggee2.default }; /***/ }), /* 228 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getExpressions = exports.State = undefined; exports.getExpression = getExpression; var _makeRecord = __webpack_require__(230); var _makeRecord2 = _interopRequireDefault(_makeRecord); var _immutable = __webpack_require__(146); var _lodash = __webpack_require__(2); var _reselect = __webpack_require__(993); var _prefs = __webpack_require__(226); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var State = exports.State = (0, _makeRecord2.default)({ expressions: (0, _immutable.List)(restoreExpressions()) }); function update() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : State(); var action = arguments[1]; switch (action.type) { case "ADD_EXPRESSION": return appendToList(state, ["expressions"], { input: action.input, value: null, updating: true }); case "UPDATE_EXPRESSION": var key = action.expression.input; return updateItemInList(state, ["expressions"], key, { input: action.input, value: null, updating: true }); case "EVALUATE_EXPRESSION": return updateItemInList(state, ["expressions"], action.input, { input: action.input, value: action.value, updating: false }); case "DELETE_EXPRESSION": return deleteExpression(state, action.input); } return state; } function restoreExpressions() { var exprs = _prefs.prefs.expressions; if (exprs.length == 0) { return; } return exprs; } function storeExpressions(state) { var expressions = state.getIn(["expressions"]).map(expression => (0, _lodash.omit)(expression, "value")).toJS(); _prefs.prefs.expressions = expressions; } function appendToList(state, path, value) { var newState = state.updateIn(path, () => { return state.getIn(path).push(value); }); storeExpressions(newState); return newState; } function updateItemInList(state, path, key, value) { var newState = state.updateIn(path, () => { var list = state.getIn(path); var index = list.findIndex(e => e.input == key); return list.update(index, () => value); }); storeExpressions(newState); return newState; } function deleteExpression(state, input) { var index = getExpressions({ expressions: state }).findKey(e => e.input == input); var newState = state.deleteIn(["expressions", index]); storeExpressions(newState); return newState; } var getExpressionsWrapper = state => state.expressions; var getExpressions = exports.getExpressions = (0, _reselect.createSelector)(getExpressionsWrapper, expressions => expressions.get("expressions")); function getExpression(state, input) { return getExpressions(state).find(exp => exp.input == input); } exports.default = update; /***/ }), /* 229 */, /* 230 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _immutable = __webpack_require__(146); var I = _interopRequireWildcard(_immutable); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } /** * Make an immutable record type * * @param spec - the keys and their default values * @return a state record factory function * @memberof utils/makeRecord * @static */ /** * @memberof utils/makeRecord * @static */ function makeRecord(spec) { return I.Record(spec); } /** * When Flow 0.29 is released (very soon), we can use this Record type * instead of the builtin immutable.js Record type. This is better * because all the fields are actually typed, unlike the builtin one. * This depends on a performance fix that will go out in 0.29 though; * @module utils/makeRecord */ exports.default = makeRecord; /***/ }), /* 231 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getEventListeners = getEventListeners; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var initialState = { activeEventNames: [], listeners: [], fetchingListeners: false }; function update() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState; var action = arguments[1]; var emit = arguments[2]; switch (action.type) { case "UPDATE_EVENT_BREAKPOINTS": state.activeEventNames = action.eventNames; // emit("activeEventNames", state.activeEventNames); break; case "FETCH_EVENT_LISTENERS": if (action.status === "begin") { state.fetchingListeners = true; } else if (action.status === "done") { state.fetchingListeners = false; state.listeners = action.listeners; } break; case "NAVIGATE": return initialState; } return state; } function getEventListeners(state) { return state.eventListeners.listeners; } exports.default = update; /***/ }), /* 232 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getSelectedSourceText = exports.getSelectedSource = exports.getSelectedLocation = exports.getSourcesForTabs = exports.getSearchTabs = exports.getSourceTabs = exports.getSources = undefined; exports.initialState = initialState; exports.removeSourceFromTabList = removeSourceFromTabList; exports.removeSourcesFromTabList = removeSourcesFromTabList; exports.getNewSelectedSourceId = getNewSelectedSourceId; exports.getSource = getSource; exports.getSourceByURL = getSourceByURL; exports.getPendingSelectedLocation = getPendingSelectedLocation; exports.getPrettySource = getPrettySource; exports.getSourceInSources = getSourceInSources; var _immutable = __webpack_require__(146); var I = _interopRequireWildcard(_immutable); var _reselect = __webpack_require__(993); var _makeRecord = __webpack_require__(230); var _makeRecord2 = _interopRequireDefault(_makeRecord); var _source2 = __webpack_require__(233); var _prefs = __webpack_require__(226); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function initialState() { return (0, _makeRecord2.default)({ sources: I.Map(), selectedLocation: undefined, pendingSelectedLocation: _prefs.prefs.pendingSelectedLocation, sourcesText: I.Map(), tabs: I.List(restoreTabs()) })(); } /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /** * Sources reducer * @module reducers/sources */ function update() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState(); var action = arguments[1]; var location = null; switch (action.type) { case "ADD_SOURCE": { var _source = action.source; return updateSource(state, _source); } case "ADD_SOURCES": { action.sources.forEach(source => { state = state.mergeIn(["sources", source.id], source); }); return state; } case "SELECT_SOURCE": if (action.status != "start") { return state; } location = { line: action.line, url: action.source.url }; _prefs.prefs.pendingSelectedLocation = location; return state.set("selectedLocation", { sourceId: action.source.id, line: action.line }).set("pendingSelectedLocation", location); case "CLEAR_SELECTED_SOURCE": location = { url: "" }; _prefs.prefs.pendingSelectedLocation = location; return state.set("selectedLocation", { sourceId: "" }).set("pendingSelectedLocation", location); case "SELECT_SOURCE_URL": location = { url: action.url, line: action.line }; _prefs.prefs.pendingSelectedLocation = location; return state.set("pendingSelectedLocation", location); case "ADD_TAB": return state.merge({ tabs: updateTabList({ sources: state }, action.source.url) }); case "MOVE_TAB": return state.merge({ tabs: updateTabList({ sources: state }, action.url, action.tabIndex) }); case "CLOSE_TAB": _prefs.prefs.tabs = action.tabs; return state.merge({ tabs: action.tabs }); case "CLOSE_TABS": _prefs.prefs.tabs = action.tabs; return state.merge({ tabs: action.tabs }); case "LOAD_SOURCE_TEXT": return setSourceTextProps(state, action); case "BLACKBOX": if (action.status === "done") { return state.setIn(["sources", action.source.id, "isBlackBoxed"], action.value.isBlackBoxed); } break; case "TOGGLE_PRETTY_PRINT": return setSourceTextProps(state, action); case "NAVIGATE": var source = getSelectedSource({ sources: state }); var url = source && source.get("url"); if (!url) { return initialState(); } return initialState().set("pendingSelectedLocation", { url }); } return state; } function getTextPropsFromAction(action) { var source = action.source; var value = action.value; if (action.status === "start") { return { id: source.id, loadedState: "loading" }; } else if (action.status === "error") { return { id: source.id, error: action.error, loadedState: "loaded" }; } return { text: value.text, id: source.id, contentType: value.contentType, loadedState: "loaded" }; } // TODO: Action is coerced to `any` unfortunately because how we type // asynchronous actions is wrong. The `value` may be null for the // "start" and "error" states but we don't type it like that. We need // to rethink how we type async actions. function setSourceTextProps(state, action) { var text = getTextPropsFromAction(action); return updateSource(state, text); } function updateSource(state, source) { if (!source.id) { return state; } return state.mergeIn(["sources", source.id], source); } function removeSourceFromTabList(tabs, url) { return tabs.filter(tab => tab != url); } function removeSourcesFromTabList(tabs, urls) { return urls.reduce((t, url) => removeSourceFromTabList(t, url), tabs); } function restoreTabs() { var prefsTabs = _prefs.prefs.tabs || []; if (prefsTabs.length == 0) { return; } return prefsTabs; } /** * Adds the new source to the tab list if it is not already there * @memberof reducers/sources * @static */ function updateTabList(state, url, tabIndex) { var tabs = state.sources.get("tabs"); var urlIndex = tabs.indexOf(url); var includesUrl = !!tabs.find(tab => tab == url); if (includesUrl) { if (tabIndex != undefined) { tabs = tabs.delete(urlIndex).insert(tabIndex, url); } } else { tabs = tabs.insert(0, url); } _prefs.prefs.tabs = tabs.toJS(); return tabs; } /** * Gets the next tab to select when a tab closes. Heuristics: * 1. if the selected tab is available, it remains selected * 2. if it is gone, the next available tab to the left should be active * 3. if the first tab is active and closed, select the second tab * * @memberof reducers/sources * @static */ function getNewSelectedSourceId(state, availableTabs) { var selectedLocation = state.sources.selectedLocation; if (!selectedLocation) { return ""; } var selectedTab = state.sources.sources.get(selectedLocation.sourceId); var selectedTabUrl = selectedTab ? selectedTab.get("url") : ""; if (availableTabs.includes(selectedTabUrl)) { var _sources = state.sources.sources; if (!_sources) { return ""; } var selectedSource = _sources.find(source => source.get("url") == selectedTabUrl); if (selectedSource) { return selectedSource.get("id"); } return ""; } var tabUrls = state.sources.tabs.toJS(); var leftNeighborIndex = Math.max(tabUrls.indexOf(selectedTabUrl) - 1, 0); var lastAvailbleTabIndex = availableTabs.size - 1; var newSelectedTabIndex = Math.min(leftNeighborIndex, lastAvailbleTabIndex); var availableTab = availableTabs.toJS()[newSelectedTabIndex]; var tabSource = getSourceByUrlInSources(state.sources.sources, availableTab); if (tabSource) { return tabSource.get("id"); } return ""; } // Selectors // Unfortunately, it's really hard to make these functions accept just // the state that we care about and still type it with Flow. The // problem is that we want to re-export all selectors from a single // module for the UI, and all of those selectors should take the // top-level app state, so we'd have to "wrap" them to automatically // pick off the piece of state we're interested in. It's impossible // (right now) to type those wrapped functions. var getSourcesState = state => state.sources; function getSource(state, id) { return getSourceInSources(getSources(state), id); } function getSourceByURL(state, url) { return getSourceByUrlInSources(state.sources.sources, url); } function getPendingSelectedLocation(state) { return state.sources.pendingSelectedLocation; } function getPrettySource(state, id) { var source = getSource(state, id); if (!source) { return; } return getSourceByURL(state, (0, _source2.getPrettySourceURL)(source.get("url"))); } function getSourceByUrlInSources(sources, url) { if (!url) { return null; } return sources.find(source => source.get("url") === url); } function getSourceInSources(sources, id) { return sources.get(id); } var getSources = exports.getSources = (0, _reselect.createSelector)(getSourcesState, sources => sources.sources); var getTabs = (0, _reselect.createSelector)(getSourcesState, sources => sources.tabs); var getSourceTabs = exports.getSourceTabs = (0, _reselect.createSelector)(getTabs, getSources, (tabs, sources) => tabs.filter(tab => getSourceByUrlInSources(sources, tab))); var getSearchTabs = exports.getSearchTabs = (0, _reselect.createSelector)(getTabs, getSources, (tabs, sources) => tabs.filter(tab => !getSourceByUrlInSources(sources, tab))); var getSourcesForTabs = exports.getSourcesForTabs = (0, _reselect.createSelector)(getSourceTabs, getSources, (tabs, sources) => { return tabs.map(tab => getSourceByUrlInSources(sources, tab)).filter(source => source); }); var getSelectedLocation = exports.getSelectedLocation = (0, _reselect.createSelector)(getSourcesState, sources => sources.selectedLocation); var getSelectedSource = exports.getSelectedSource = (0, _reselect.createSelector)(getSelectedLocation, getSources, (selectedLocation, sources) => { if (!selectedLocation) { return; } return sources.get(selectedLocation.sourceId); }); var getSelectedSourceText = exports.getSelectedSourceText = (0, _reselect.createSelector)(getSelectedSource, getSourcesState, (selectedSource, sources) => { var id = selectedSource.get("id"); return id ? sources.sourcesText.get(id) : null; }); exports.default = update; /***/ }), /* 233 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isLoaded = exports.getMode = exports.getSourceLineCount = exports.getSourcePath = exports.getFilenameFromURL = exports.getFilename = exports.getRawSourceURL = exports.getPrettySourceURL = exports.shouldPrettyPrint = exports.isThirdParty = exports.isPretty = exports.isJavaScript = undefined; var _devtoolsSourceMap = __webpack_require__(898); var _utils = __webpack_require__(234); var _path = __webpack_require__(235); var _url = __webpack_require__(334); /** * Trims the query part or reference identifier of a url string, if necessary. * * @memberof utils/source * @static */ /** * Utils for working with Source URLs * @module utils/source */ function trimUrlQuery(url) { var length = url.length; var q1 = url.indexOf("?"); var q2 = url.indexOf("&"); var q3 = url.indexOf("#"); var q = Math.min(q1 != -1 ? q1 : length, q2 != -1 ? q2 : length, q3 != -1 ? q3 : length); return url.slice(0, q); } function shouldPrettyPrint(source) { if (!source) { return false; } var _isPretty = isPretty(source); var _isJavaScript = isJavaScript(source); var isOriginal = (0, _devtoolsSourceMap.isOriginalId)(source.id); var hasSourceMap = source.sourceMapURL; if (_isPretty || isOriginal || hasSourceMap || !_isJavaScript) { return false; } return true; } /** * Returns true if the specified url and/or content type are specific to * javascript files. * * @return boolean * True if the source is likely javascript. * * @memberof utils/source * @static */ function isJavaScript(source) { return source.url && /\.(jsm|js)?$/.test(trimUrlQuery(source.url)) || !!(source.contentType && source.contentType.includes("javascript")); } /** * @memberof utils/source * @static */ function isPretty(source) { return source.url ? /formatted$/.test(source.url) : false; } function isThirdParty(source) { if (!source || !source.url) { return false; } return !!source.url.match(/(node_modules|bower_components)/); } /** * @memberof utils/source * @static */ function getPrettySourceURL(url) { if (!url) { url = ""; } return `${url}:formatted`; } /** * @memberof utils/source * @static */ function getRawSourceURL(url) { return url.replace(/:formatted$/, ""); } function getFilenameFromURL(url) { url = getRawSourceURL(url || ""); var name = (0, _path.basename)(url) || "(index)"; return (0, _utils.endTruncateStr)(name, 50); } /** * Show a source url's filename. * If the source does not have a url, use the source id. * * @memberof utils/source * @static */ function getFilename(source) { var url = source.url, id = source.id; if (!url) { var sourceId = id.split("/")[1]; return `SOURCE${sourceId}`; } return getFilenameFromURL(url); } var contentTypeModeMap = { "text/javascript": { name: "javascript" }, "text/typescript": { name: "javascript", typescript: true }, "text/coffeescript": "coffeescript", "text/typescript-jsx": { name: "jsx", base: { name: "javascript", typescript: true } }, "text/jsx": "jsx", "text/x-elm": "elm", "text/x-clojure": "clojure", "text/wasm": { name: "text" }, "text/html": { name: "htmlmixed" } }; function getSourcePath(source) { if (!source.url) { return ""; } var _parseURL = (0, _url.parse)(source.url), path = _parseURL.path, href = _parseURL.href; // for URLs like "about:home" the path is null so we pass the full href return path || href; } /** * Returns amount of lines in the source. If source is a WebAssembly binary, * the function returns amount of bytes. */ function getSourceLineCount(source) { if (source.isWasm) { var _ref = source.text, binary = _ref.binary; return binary.length; } return source.text != undefined ? source.text.split("\n").length : 0; } /** * * Returns Code Mirror mode for source content type * @param contentType * @return String * @memberof utils/source * @static */ function getMode(source) { var contentType = source.contentType, text = source.text, isWasm = source.isWasm, url = source.url; if (!text || isWasm) { return { name: "text" }; } // if the url ends with .marko we set the name to Javascript so // syntax highlighting works for marko too if (url && url.match(/\.marko$/i)) { return { name: "javascript" }; } // Use HTML mode for files in which the first non whitespace // character is `<` regardless of extension. var isHTMLLike = text.match(/^\s* 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { args[_key - 2] = arguments[_key]; } return new Promise((resolve, reject) => { args.push(response => { if (response.error) { reject(response); } else { resolve(response); } }); method.apply(context, args); }); } /** * @memberof utils/utils * @static */ function endTruncateStr(str, size) { if (str.length > size) { return `...${str.slice(str.length - size)}`; } return str; } /** * @memberof utils/utils * @static */ /** * @memberof utils/utils * @static */ function throttle(func, ms) { var timeout = void 0, _this = void 0; return function () { for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } _this = this; if (!timeout) { timeout = setTimeout(() => { func.apply.apply(func, [_this].concat(_toConsumableArray(args))); timeout = null; }, ms); } }; } function waitForMs(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } exports.handleError = handleError; exports.promisify = promisify; exports.endTruncateStr = endTruncateStr; exports.throttle = throttle; exports.waitForMs = waitForMs; /***/ }), /* 235 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function basename(path) { return path.split("/").pop(); } function dirname(path) { var idx = path.lastIndexOf("/"); return path.slice(0, idx); } function isURL(str) { return str.indexOf("://") !== -1; } function isAbsolute(str) { return str[0] === "/"; } function join(base, dir) { return `${base}/${dir}`; } exports.basename = basename; exports.dirname = dirname; exports.isURL = isURL; exports.isAbsolute = isAbsolute; exports.join = join; /***/ }), /* 236 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getHiddenBreakpointLocation = exports.getHiddenBreakpoint = undefined; 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; }; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /** * Breakpoints reducer * @module reducers/breakpoints */ exports.initialState = initialState; exports.getBreakpoints = getBreakpoints; exports.getBreakpoint = getBreakpoint; exports.getBreakpointsDisabled = getBreakpointsDisabled; exports.getBreakpointsLoading = getBreakpointsLoading; exports.getBreakpointsForSource = getBreakpointsForSource; var _immutable = __webpack_require__(146); var I = _interopRequireWildcard(_immutable); var _makeRecord = __webpack_require__(230); var _makeRecord2 = _interopRequireDefault(_makeRecord); var _devtoolsSourceMap = __webpack_require__(898); var _breakpoint = __webpack_require__(1057); var _reselect = __webpack_require__(993); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function initialState() { return (0, _makeRecord2.default)({ breakpoints: I.Map(), breakpointsDisabled: false })(); } function update() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState(); var action = arguments[1]; switch (action.type) { case "ADD_BREAKPOINT": { return addBreakpoint(state, action); } case "SYNC_BREAKPOINT": { return syncBreakpoint(state, action); } case "ENABLE_BREAKPOINT": { return addBreakpoint(state, action); } case "DISABLE_BREAKPOINT": { return updateBreakpoint(state, action); } case "SET_BREAKPOINT_CONDITION": { return updateBreakpoint(state, action); } case "REMOVE_BREAKPOINT": { return removeBreakpoint(state, action); } case "REMAP_BREAKPOINTS": { return remapBreakpoints(state, action); } } return state; } function addBreakpoint(state, action) { if (action.status === "start" && action.breakpoint) { var breakpoint = action.breakpoint; var locationId = (0, _breakpoint.makeLocationId)(breakpoint.location); return state.setIn(["breakpoints", locationId], breakpoint); } // when the action completes, we can commit the breakpoint if (action.status === "done") { return syncBreakpoint(state, action.value); } // Remove the optimistic update if (action.status === "error" && action.breakpoint) { var _locationId = (0, _breakpoint.makeLocationId)(action.breakpoint.location); return state.deleteIn(["breakpoints", _locationId]); } return state; } function syncBreakpoint(state, data) { var breakpoint = data.breakpoint, previousLocation = data.previousLocation; var locationId = (0, _breakpoint.makeLocationId)(breakpoint.location); if (previousLocation) { return state.deleteIn(["breakpoints", (0, _breakpoint.makeLocationId)(previousLocation)]).setIn(["breakpoints", locationId], breakpoint); } return state.setIn(["breakpoints", locationId], breakpoint); } function updateBreakpoint(state, action) { var breakpoint = action.breakpoint; var locationId = (0, _breakpoint.makeLocationId)(breakpoint.location); return state.setIn(["breakpoints", locationId], breakpoint); } function remapBreakpoints(state, action) { var breakpoints = action.breakpoints.reduce((updatedBreakpoints, breakpoint) => { var locationId = (0, _breakpoint.makeLocationId)(breakpoint.location); return _extends({}, updatedBreakpoints, { [locationId]: breakpoint }); }, {}); return state.set("breakpoints", I.Map(breakpoints)); } function removeBreakpoint(state, action) { var breakpoint = action.breakpoint; var id = (0, _breakpoint.makeLocationId)(breakpoint.location); return state.deleteIn(["breakpoints", id]); } // Selectors // TODO: these functions should be moved out of the reducer function getBreakpoints(state) { return state.breakpoints.breakpoints; } function getBreakpoint(state, location) { var breakpoints = getBreakpoints(state); return breakpoints.get((0, _breakpoint.makeLocationId)(location)); } function getBreakpointsDisabled(state) { return state.breakpoints.breakpoints.every(x => x.disabled); } function getBreakpointsLoading(state) { var breakpoints = getBreakpoints(state); var isLoading = !!breakpoints.valueSeq().filter(bp => bp.loading).first(); return breakpoints.size > 0 && isLoading; } function getBreakpointsForSource(state, sourceId) { if (!sourceId) { return I.Map(); } var isGeneratedSource = (0, _devtoolsSourceMap.isGeneratedId)(sourceId); var breakpoints = getBreakpoints(state); return breakpoints.filter(bp => { var location = isGeneratedSource ? bp.generatedLocation || bp.location : bp.location; return location.sourceId === sourceId; }); } var getHiddenBreakpoint = exports.getHiddenBreakpoint = (0, _reselect.createSelector)(getBreakpoints, function (breakpoints) { var hiddenBreakpoints = breakpoints.valueSeq().filter(breakpoint => breakpoint.hidden).first(); return hiddenBreakpoints; }); var getHiddenBreakpointLocation = exports.getHiddenBreakpointLocation = (0, _reselect.createSelector)(getHiddenBreakpoint, function (hiddenBreakpoint) { if (!hiddenBreakpoint) { return null; } return hiddenBreakpoint.location; }); exports.default = update; /***/ }), /* 237 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _immutable = __webpack_require__(146); var I = _interopRequireWildcard(_immutable); var _lodash = __webpack_require__(2); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } // hasOwnProperty is defensive because it is possible that the // object that we're creating a map for has a `hasOwnProperty` field /** * Immutable JS conversion utils * @deprecated * @module utils/fromJS */ function hasOwnProperty(value, key) { if (value.hasOwnProperty && (0, _lodash.isFunction)(value.hasOwnProperty)) { return value.hasOwnProperty(key); } if (value.prototype && value.prototype.hasOwnProperty) { return value.prototype.hasOwnProperty(key); } return false; } /* creates an immutable map, where each of the value's items are transformed into their own map. NOTE: we guard against `length` being a property because length confuses Immutable's internal algorithm. */ function createMap(value) { var hasLength = hasOwnProperty(value, "length"); var length = value.length; if (hasLength) { value.length = `${value.length}`; } var map = I.Seq(value).map(fromJS).toMap(); if (hasLength) { map = map.set("length", length); value.length = length; } return map; } function createList(value) { return I.Seq(value).map(fromJS).toList(); } /** * When our app state is fully typed, we should be able to get rid of * this function. This is only temporarily necessary to support * converting typed objects to immutable.js, which usually happens in * reducers. * * @memberof utils/fromJS * @static */ function fromJS(value) { if (Array.isArray(value)) { return createList(value); } if (value && value.constructor && value.constructor.meta) { // This adds support for tcomb objects which are native JS objects // but are not "plain", so the above checks fail. Since they // behave the same we can use the same constructors, but we need // special checks for them. var kind = value.constructor.meta.kind; if (kind === "struct") { return createMap(value); } else if (kind === "list") { return createList(value); } } // If it's a primitive type, just return the value. Note `==` check // for null, which is intentionally used to match either `null` or // `undefined`. if (value == null || typeof value !== "object") { return value; } // Otherwise, treat it like an object. We can't reliably detect if // it's a plain object because we might be objects from other JS // contexts so `Object !== Object`. return createMap(value); } module.exports = fromJS; /***/ }), /* 238 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); 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); } } /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var initialState = []; function update() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState; var action = arguments[1]; var seqId = action.seqId; if (action.type === "NAVIGATE") { return initialState; } else if (seqId) { var newState = void 0; if (action.status === "start") { newState = [].concat(_toConsumableArray(state), [seqId]); } else if (action.status === "error" || action.status === "done") { newState = state.filter(id => id !== seqId); } return newState; } return state; } exports.default = update; /***/ }), /* 239 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getSelectedFrame = exports.getSelectedFrameId = exports.getLoadedObjects = exports.getPause = exports.State = undefined; 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; }; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ exports.isStepping = isStepping; exports.isPaused = isPaused; exports.isEvaluatingExpression = isEvaluatingExpression; exports.getLoadedObject = getLoadedObject; exports.getObjectProperties = getObjectProperties; exports.getIsWaitingOnBreak = getIsWaitingOnBreak; exports.getShouldPauseOnExceptions = getShouldPauseOnExceptions; exports.getShouldIgnoreCaughtExceptions = getShouldIgnoreCaughtExceptions; exports.getFrames = getFrames; exports.getFrameScopes = getFrameScopes; exports.getDebuggeeUrl = getDebuggeeUrl; exports.getChromeScopes = getChromeScopes; var _reselect = __webpack_require__(993); var _prefs = __webpack_require__(226); var State = exports.State = () => ({ pause: undefined, isWaitingOnBreak: false, frames: undefined, selectedFrameId: undefined, frameScopes: {}, loadedObjects: {}, shouldPauseOnExceptions: _prefs.prefs.pauseOnExceptions, shouldIgnoreCaughtExceptions: _prefs.prefs.ignoreCaughtExceptions, debuggeeUrl: "", command: "" }); function update() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : State(); var action = arguments[1]; switch (action.type) { case "PAUSED": { var _selectedFrameId2 = action.selectedFrameId, _frames = action.frames, _scopes = action.scopes, _loadedObjects = action.loadedObjects, pauseInfo = action.pauseInfo; pauseInfo.isInterrupted = pauseInfo.why.type === "interrupted"; var _frameScopes = { [_selectedFrameId2]: _scopes }; // turn this into an object keyed by object id var objectMap = {}; _loadedObjects.forEach(obj => { objectMap[obj.value.objectId] = obj; }); return Object.assign({}, state, { isWaitingOnBreak: false, pause: pauseInfo, selectedFrameId: _selectedFrameId2, frames: _frames, frameScopes: _frameScopes, loadedObjects: objectMap }); } case "RESUME": return Object.assign({}, state, { pause: null, frames: null, selectedFrameId: null, loadedObjects: {} }); case "TOGGLE_PRETTY_PRINT": if (action.status == "done") { var _frames2 = action.value.frames; var _pause = state.pause; if (_pause) { _pause.frame = _frames2[0]; } return Object.assign({}, state, { pause: _pause, frames: _frames2 }); } break; case "BREAK_ON_NEXT": return Object.assign({}, state, { isWaitingOnBreak: true }); case "SELECT_FRAME": var frame = action.frame, scopes = action.scopes; var _selectedFrameId = frame.id; return _extends({}, state, { frameScopes: _extends({}, state.frameScopes, { [_selectedFrameId]: scopes }), selectedFrameId: _selectedFrameId }); case "LOAD_OBJECT_PROPERTIES": if (action.status === "start") { return _extends({}, state, { loadedObjects: _extends({}, state.loadedObjects, { [action.objectId]: {} }) }); } if (action.status === "done") { if (!action.value) { return Object.assign({}, state); } var ownProperties = action.value.ownProperties; var ownSymbols = action.value.ownSymbols || []; var prototype = action.value.prototype; return _extends({}, state, { loadedObjects: _extends({}, state.loadedObjects, { [action.objectId]: { ownProperties, prototype, ownSymbols } }) }); } break; case "CONNECT": return Object.assign({}, State(), { debuggeeUrl: action.url }); case "PAUSE_ON_EXCEPTIONS": var _shouldPauseOnExceptions = action.shouldPauseOnExceptions, _shouldIgnoreCaughtExceptions = action.shouldIgnoreCaughtExceptions; _prefs.prefs.pauseOnExceptions = _shouldPauseOnExceptions; _prefs.prefs.ignoreCaughtExceptions = _shouldIgnoreCaughtExceptions; return Object.assign({}, state, { shouldPauseOnExceptions: _shouldPauseOnExceptions, shouldIgnoreCaughtExceptions: _shouldIgnoreCaughtExceptions }); case "COMMAND": return _extends({}, state, { command: action.value.type }); case "CLEAR_COMMAND": return _extends({}, state, { command: "" }); case "EVALUATE_EXPRESSION": return _extends({}, state, { command: action.status === "start" ? "expression" : "" }); case "NAVIGATE": return _extends({}, state, { debuggeeUrl: action.url }); } return state; } // Selectors // Unfortunately, it's really hard to make these functions accept just // the state that we care about and still type it with Flow. The // problem is that we want to re-export all selectors from a single // module for the UI, and all of those selectors should take the // top-level app state, so we'd have to "wrap" them to automatically // pick off the piece of state we're interested in. It's impossible // (right now) to type those wrapped functions. var getPauseState = state => state.pause; var getPause = exports.getPause = (0, _reselect.createSelector)(getPauseState, pauseWrapper => pauseWrapper.pause); var getLoadedObjects = exports.getLoadedObjects = (0, _reselect.createSelector)(getPauseState, pauseWrapper => pauseWrapper.loadedObjects); function isStepping(state) { return ["stepIn", "stepOver", "stepOut"].includes(state.pause.command); } function isPaused(state) { return !!getPause(state); } function isEvaluatingExpression(state) { return state.pause.command === "expression"; } function getLoadedObject(state, objectId) { return getLoadedObjects(state)[objectId]; } function getObjectProperties(state, parentId) { return getLoadedObjects(state).filter(obj => obj.parentId == parentId); } function getIsWaitingOnBreak(state) { return state.pause.isWaitingOnBreak; } function getShouldPauseOnExceptions(state) { return state.pause.shouldPauseOnExceptions; } function getShouldIgnoreCaughtExceptions(state) { return state.pause.shouldIgnoreCaughtExceptions; } function getFrames(state) { return state.pause.frames; } function getFrameScopes(state, frameId) { return state.pause.frameScopes[frameId]; } var getSelectedFrameId = exports.getSelectedFrameId = (0, _reselect.createSelector)(getPauseState, pauseWrapper => { return pauseWrapper.selectedFrameId; }); var getSelectedFrame = exports.getSelectedFrame = (0, _reselect.createSelector)(getSelectedFrameId, getFrames, (selectedFrameId, frames) => { if (!frames) { return null; } return frames.find(frame => frame.id == selectedFrameId); }); function getDebuggeeUrl(state) { return state.pause.debuggeeUrl; } // NOTE: currently only used for chrome function getChromeScopes(state) { var frame = getSelectedFrame(state); return frame ? frame.scopeChain : undefined; } exports.default = update; /***/ }), /* 240 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.State = undefined; exports.getActiveSearch = getActiveSearch; exports.getFileSearchQueryState = getFileSearchQueryState; exports.getFileSearchModifierState = getFileSearchModifierState; exports.getSearchResults = getSearchResults; exports.getFrameworkGroupingState = getFrameworkGroupingState; exports.getSymbolSearchType = getSymbolSearchType; exports.getShownSource = getShownSource; exports.getPaneCollapse = getPaneCollapse; exports.getHighlightedLineRange = getHighlightedLineRange; exports.getConditionalBreakpointPanel = getConditionalBreakpointPanel; var _makeRecord = __webpack_require__(230); var _makeRecord2 = _interopRequireDefault(_makeRecord); var _prefs = __webpack_require__(226); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * UI reducer * @module reducers/ui */ var State = exports.State = (0, _makeRecord2.default)({ activeSearch: null, fileSearchQuery: "", fileSearchModifiers: (0, _makeRecord2.default)({ caseSensitive: _prefs.prefs.fileSearchCaseSensitive, wholeWord: _prefs.prefs.fileSearchWholeWord, regexMatch: _prefs.prefs.fileSearchRegexMatch })(), symbolSearchType: "functions", searchResults: { matches: [], matchIndex: -1, index: -1, count: 0 }, shownSource: "", startPanelCollapsed: _prefs.prefs.startPanelCollapsed, endPanelCollapsed: _prefs.prefs.endPanelCollapsed, frameworkGroupingOn: _prefs.prefs.frameworkGroupingOn, highlightedLineRange: undefined, conditionalBreakpointPanel: null }); function update() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : State(); var action = arguments[1]; switch (action.type) { case "TOGGLE_ACTIVE_SEARCH": { return state.set("activeSearch", action.value); } case "TOGGLE_FRAMEWORK_GROUPING": { _prefs.prefs.frameworkGroupingOn = action.value; return state.set("frameworkGroupingOn", action.value); } case "UPDATE_FILE_SEARCH_QUERY": { return state.set("fileSearchQuery", action.query); } case "UPDATE_SEARCH_RESULTS": { return state.set("searchResults", action.results); } case "TOGGLE_FILE_SEARCH_MODIFIER": { var actionVal = !state.getIn(["fileSearchModifiers", action.modifier]); if (action.modifier == "caseSensitive") { _prefs.prefs.fileSearchCaseSensitive = actionVal; } if (action.modifier == "wholeWord") { _prefs.prefs.fileSearchWholeWord = actionVal; } if (action.modifier == "regexMatch") { _prefs.prefs.fileSearchRegexMatch = actionVal; } return state.setIn(["fileSearchModifiers", action.modifier], actionVal); } case "SET_SYMBOL_SEARCH_TYPE": { return state.set("symbolSearchType", action.symbolType); } case "SHOW_SOURCE": { return state.set("shownSource", action.sourceUrl); } case "TOGGLE_PANE": { if (action.position == "start") { _prefs.prefs.startPanelCollapsed = action.paneCollapsed; return state.set("startPanelCollapsed", action.paneCollapsed); } _prefs.prefs.endPanelCollapsed = action.paneCollapsed; return state.set("endPanelCollapsed", action.paneCollapsed); } case "HIGHLIGHT_LINES": var _action$location = action.location, _start = _action$location.start, _end = _action$location.end, _sourceId = _action$location.sourceId; var lineRange = {}; if (_start && _end && _sourceId) { lineRange = { start: _start, end: _end, sourceId: _sourceId }; } return state.set("highlightedLineRange", lineRange); case "CLEAR_HIGHLIGHT_LINES": return state.set("highlightedLineRange", {}); case "TOGGLE_CONDITIONAL_BREAKPOINT_PANEL": return state.set("conditionalBreakpointPanel", action.line); default: { return state; } } } // NOTE: we'd like to have the app state fully typed // https://github.com/devtools-html/debugger.html/blob/master/src/reducers/sources.js#L179-L185 function getActiveSearch(state) { return state.ui.get("activeSearch"); } function getFileSearchQueryState(state) { return state.ui.get("fileSearchQuery"); } function getFileSearchModifierState(state) { return state.ui.get("fileSearchModifiers"); } function getSearchResults(state) { return state.ui.get("searchResults"); } function getFrameworkGroupingState(state) { return state.ui.get("frameworkGroupingOn"); } function getSymbolSearchType(state) { return state.ui.get("symbolSearchType"); } function getShownSource(state) { return state.ui.get("shownSource"); } function getPaneCollapse(state, position) { if (position == "start") { return state.ui.get("startPanelCollapsed"); } return state.ui.get("endPanelCollapsed"); } function getHighlightedLineRange(state) { return state.ui.get("highlightedLineRange"); } function getConditionalBreakpointPanel(state) { return state.ui.get("conditionalBreakpointPanel"); } exports.default = update; /***/ }), /* 241 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.State = undefined; exports.getHitCountForSource = getHitCountForSource; exports.getCoverageEnabled = getCoverageEnabled; var _makeRecord = __webpack_require__(230); var _makeRecord2 = _interopRequireDefault(_makeRecord); var _immutable = __webpack_require__(146); var I = _interopRequireWildcard(_immutable); var _fromJS = __webpack_require__(237); var _fromJS2 = _interopRequireDefault(_fromJS); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var State = exports.State = (0, _makeRecord2.default)({ coverageOn: false, hitCount: I.Map() }); /** * Code Coverage reducer * @module reducers/coverage */ function update() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : State(); var action = arguments[1]; switch (action.type) { case "RECORD_COVERAGE": return state.mergeIn(["hitCount"], (0, _fromJS2.default)(action.value.coverage)).setIn(["coverageOn"], true); default: { return state; } } } // NOTE: we'd like to have the app state fully typed // https://github.com/devtools-html/debugger.html/blob/master/src/reducers/sources.js#L179-L185 function getHitCountForSource(state, sourceId) { var hitCount = state.coverage.get("hitCount"); return hitCount.get(sourceId); } function getCoverageEnabled(state) { return state.coverage.get("coverageOn"); } exports.default = update; /***/ }), /* 242 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _expressions = __webpack_require__(228); var expressions = _interopRequireWildcard(_expressions); var _sources = __webpack_require__(232); var sources = _interopRequireWildcard(_sources); var _pause = __webpack_require__(239); var pause = _interopRequireWildcard(_pause); var _debuggee = __webpack_require__(1175); var debuggee = _interopRequireWildcard(_debuggee); var _breakpoints = __webpack_require__(236); var breakpoints = _interopRequireWildcard(_breakpoints); var _pendingBreakpoints = __webpack_require__(1133); var pendingBreakpoints = _interopRequireWildcard(_pendingBreakpoints); var _eventListeners = __webpack_require__(231); var eventListeners = _interopRequireWildcard(_eventListeners); var _ui = __webpack_require__(240); var ui = _interopRequireWildcard(_ui); var _ast = __webpack_require__(1058); var ast = _interopRequireWildcard(_ast); var _coverage = __webpack_require__(241); var coverage = _interopRequireWildcard(_coverage); var _projectTextSearch = __webpack_require__(31); var projectTextSearch = _interopRequireWildcard(_projectTextSearch); var _sourceSearch = __webpack_require__(1132); var sourceSearch = _interopRequireWildcard(_sourceSearch); var _sourceTree = __webpack_require__(1176); var sourceTree = _interopRequireWildcard(_sourceTree); var _breakpointAtLocation = __webpack_require__(1134); var _breakpointAtLocation2 = _interopRequireDefault(_breakpointAtLocation); var _linesInScope = __webpack_require__(1124); var _linesInScope2 = _interopRequireDefault(_linesInScope); var _visibleBreakpoints = __webpack_require__(1135); var _visibleBreakpoints2 = _interopRequireDefault(_visibleBreakpoints); var _isSelectedFrameVisible = __webpack_require__(805); var _isSelectedFrameVisible2 = _interopRequireDefault(_isSelectedFrameVisible); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } /** * @param object - location */ module.exports = Object.assign({}, expressions, sources, pause, debuggee, breakpoints, pendingBreakpoints, eventListeners, ui, ast, coverage, projectTextSearch, sourceSearch, sourceTree, { getBreakpointAtLocation: _breakpointAtLocation2.default, getInScopeLines: _linesInScope2.default, getVisibleBreakpoints: _visibleBreakpoints2.default, isSelectedFrameVisible: _isSelectedFrameVisible2.default }); /***/ }), /* 243 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactRedux = __webpack_require__(1189); var _redux = __webpack_require__(3); var _prefs = __webpack_require__(226); var _actions = __webpack_require__(244); var _actions2 = _interopRequireDefault(_actions); var _ShortcutsModal = __webpack_require__(1181); var _selectors = __webpack_require__(242); var _ui = __webpack_require__(1128); var _devtoolsModules = __webpack_require__(830); __webpack_require__(857); __webpack_require__(858); __webpack_require__(859); __webpack_require__(860); var _devtoolsSplitter = __webpack_require__(910); var _devtoolsSplitter2 = _interopRequireDefault(_devtoolsSplitter); var _ProjectSearch = __webpack_require__(1139); var _ProjectSearch2 = _interopRequireDefault(_ProjectSearch); var _PrimaryPanes = __webpack_require__(1142); var _PrimaryPanes2 = _interopRequireDefault(_PrimaryPanes); var _Editor = __webpack_require__(426); var _Editor2 = _interopRequireDefault(_Editor); var _SecondaryPanes = __webpack_require__(718); var _SecondaryPanes2 = _interopRequireDefault(_SecondaryPanes); var _WelcomeBox = __webpack_require__(747); var _WelcomeBox2 = _interopRequireDefault(_WelcomeBox); var _Tabs = __webpack_require__(750); var _Tabs2 = _interopRequireDefault(_Tabs); var _SymbolModal = __webpack_require__(1170); var _SymbolModal2 = _interopRequireDefault(_SymbolModal); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var shortcuts = new _devtoolsModules.KeyShortcuts({ window }); var appinfo = _devtoolsModules.Services.appinfo; var isMacOS = appinfo.OS === "Darwin"; var verticalLayoutBreakpoint = window.matchMedia("(min-width: 800px)"); class App extends _react.Component { constructor(props) { super(props); this.state = { shortcutsModalEnabled: false, horizontal: verticalLayoutBreakpoint.matches, startPanelSize: 0, endPanelSize: 0 }; this.getChildContext = this.getChildContext.bind(this); this.onLayoutChange = this.onLayoutChange.bind(this); this.toggleSymbolModal = this.toggleSymbolModal.bind(this); this.renderEditorPane = this.renderEditorPane.bind(this); this.renderVerticalLayout = this.renderVerticalLayout.bind(this); this.onEscape = this.onEscape.bind(this); } getChildContext() { return { shortcuts }; } componentDidMount() { verticalLayoutBreakpoint.addListener(this.onLayoutChange); shortcuts.on(L10N.getStr("symbolSearch.search.key2"), this.toggleSymbolModal); shortcuts.on("Escape", this.onEscape); } componentWillUnmount() { verticalLayoutBreakpoint.removeListener(this.onLayoutChange); shortcuts.off(L10N.getStr("symbolSearch.search.key2"), this.toggleSymbolModal); shortcuts.off("Escape", this.onEscape); } onEscape(_, e) { var _props = this.props, activeSearch = _props.activeSearch, closeActiveSearch = _props.closeActiveSearch; if (activeSearch) { e.preventDefault(); closeActiveSearch(); } } toggleSymbolModal(_, e) { var _props2 = this.props, selectedSource = _props2.selectedSource, activeSearch = _props2.activeSearch, closeActiveSearch = _props2.closeActiveSearch, setActiveSearch = _props2.setActiveSearch; e.preventDefault(); e.stopPropagation(); if (!selectedSource) { return; } if (activeSearch == "symbol") { return closeActiveSearch(); } setActiveSearch("symbol"); } onLayoutChange() { if ((0, _ui.isVisible)()) { this.setState({ horizontal: verticalLayoutBreakpoint.matches }); } } renderEditorPane() { var _props3 = this.props, startPanelCollapsed = _props3.startPanelCollapsed, endPanelCollapsed = _props3.endPanelCollapsed; var _state = this.state, horizontal = _state.horizontal, endPanelSize = _state.endPanelSize, startPanelSize = _state.startPanelSize; return _react2.default.createElement( "div", { className: "editor-pane" }, _react2.default.createElement( "div", { className: "editor-container" }, _react2.default.createElement(_Tabs2.default, { startPanelCollapsed: startPanelCollapsed, endPanelCollapsed: endPanelCollapsed, horizontal: horizontal, startPanelSize: startPanelSize, endPanelSize: endPanelSize }), _react2.default.createElement(_Editor2.default, { horizontal: horizontal, startPanelSize: startPanelSize, endPanelSize: endPanelSize }), !this.props.selectedSource ? _react2.default.createElement(_WelcomeBox2.default, { horizontal: horizontal }) : null, _react2.default.createElement(_ProjectSearch2.default, null) ) ); } toggleShortcutsModal() { this.setState({ shortcutsModalEnabled: !this.state.shortcutsModalEnabled }); } renderHorizontalLayout() { var _props4 = this.props, startPanelCollapsed = _props4.startPanelCollapsed, endPanelCollapsed = _props4.endPanelCollapsed; var horizontal = this.state.horizontal; var overflowX = endPanelCollapsed ? "hidden" : "auto"; return _react2.default.createElement(_devtoolsSplitter2.default, { style: { width: "100vw" }, initialSize: "250px", minSize: 10, maxSize: "50%", splitterSize: 1, onResizeEnd: size => this.setState({ startPanelSize: size }), startPanel: _react2.default.createElement(_PrimaryPanes2.default, { horizontal: horizontal }), startPanelCollapsed: startPanelCollapsed, endPanel: _react2.default.createElement(_devtoolsSplitter2.default, { style: { overflowX }, initialSize: "300px", minSize: 10, maxSize: "80%", splitterSize: 1, onResizeEnd: size => this.setState({ endPanelSize: size }), endPanelControl: true, startPanel: this.renderEditorPane(), endPanel: _react2.default.createElement(_SecondaryPanes2.default, { horizontal: horizontal, toggleShortcutsModal: () => this.toggleShortcutsModal() }), endPanelCollapsed: endPanelCollapsed, vert: horizontal }) }); } renderVerticalLayout() { var _props5 = this.props, startPanelCollapsed = _props5.startPanelCollapsed, endPanelCollapsed = _props5.endPanelCollapsed; var horizontal = this.state.horizontal; return _react2.default.createElement(_devtoolsSplitter2.default, { style: { width: "100vw" }, initialSize: "300px", minSize: 30, maxSize: "99%", splitterSize: 1, vert: horizontal, startPanel: _react2.default.createElement(_devtoolsSplitter2.default, { style: { width: "100vw" }, initialSize: "250px", minSize: 10, maxSize: "40%", splitterSize: 1, startPanelCollapsed: startPanelCollapsed, startPanel: _react2.default.createElement(_PrimaryPanes2.default, { horizontal: horizontal }), endPanel: this.renderEditorPane() }), endPanel: _react2.default.createElement(_SecondaryPanes2.default, { horizontal: horizontal }), endPanelCollapsed: endPanelCollapsed }); } renderSymbolModal() { var _props6 = this.props, selectSource = _props6.selectSource, selectedSource = _props6.selectedSource, activeSearch = _props6.activeSearch; if (activeSearch !== "symbol") { return; } return _react2.default.createElement(_SymbolModal2.default, { selectSource: selectSource, selectedSource: selectedSource }); } renderShortcutsModal() { var additionalClass = isMacOS ? "mac" : ""; if (!_prefs.features.shortcuts) { return; } return _react2.default.createElement(_ShortcutsModal.ShortcutsModal, { additionalClass: additionalClass, enabled: this.state.shortcutsModalEnabled, handleClose: () => this.toggleShortcutsModal() }); } render() { return _react2.default.createElement( "div", { className: "debugger" }, this.state.horizontal ? this.renderHorizontalLayout() : this.renderVerticalLayout(), this.renderSymbolModal(), this.renderShortcutsModal() ); } } App.childContextTypes = { shortcuts: _react.PropTypes.object }; exports.default = (0, _reactRedux.connect)(state => ({ selectedSource: (0, _selectors.getSelectedSource)(state), startPanelCollapsed: (0, _selectors.getPaneCollapse)(state, "start"), endPanelCollapsed: (0, _selectors.getPaneCollapse)(state, "end"), activeSearch: (0, _selectors.getActiveSearch)(state) }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(App); /***/ }), /* 244 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _breakpoints = __webpack_require__(245); var breakpoints = _interopRequireWildcard(_breakpoints); var _expressions = __webpack_require__(252); var expressions = _interopRequireWildcard(_expressions); var _eventListeners = __webpack_require__(253); var eventListeners = _interopRequireWildcard(_eventListeners); var _sources = __webpack_require__(254); var sources = _interopRequireWildcard(_sources); var _pause = __webpack_require__(319); var pause = _interopRequireWildcard(_pause); var _navigation = __webpack_require__(320); var navigation = _interopRequireWildcard(_navigation); var _ui = __webpack_require__(321); var ui = _interopRequireWildcard(_ui); var _ast = __webpack_require__(1059); var ast = _interopRequireWildcard(_ast); var _coverage = __webpack_require__(322); var coverage = _interopRequireWildcard(_coverage); var _projectTextSearch = __webpack_require__(37); var projectTextSearch = _interopRequireWildcard(_projectTextSearch); var _sourceSearch = __webpack_require__(1144); var sourceSearch = _interopRequireWildcard(_sourceSearch); var _sourceTree = __webpack_require__(1178); var sourceTree = _interopRequireWildcard(_sourceTree); var _loadSourceText = __webpack_require__(1143); var loadSourceText = _interopRequireWildcard(_loadSourceText); var _debuggee = __webpack_require__(1179); var debuggee = _interopRequireWildcard(_debuggee); var _toolbox = __webpack_require__(1180); var toolbox = _interopRequireWildcard(_toolbox); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } exports.default = Object.assign({}, navigation, breakpoints, expressions, eventListeners, sources, pause, ui, ast, coverage, projectTextSearch, sourceSearch, sourceTree, loadSourceText, debuggee, toolbox); /***/ }), /* 245 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); 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.syncBreakpoint = syncBreakpoint; exports.addBreakpoint = addBreakpoint; exports.addHiddenBreakpoint = addHiddenBreakpoint; exports.removeBreakpoint = removeBreakpoint; exports.enableBreakpoint = enableBreakpoint; exports.disableBreakpoint = disableBreakpoint; exports.toggleAllBreakpoints = toggleAllBreakpoints; exports.toggleBreakpoints = toggleBreakpoints; exports.removeAllBreakpoints = removeAllBreakpoints; exports.removeBreakpoints = removeBreakpoints; exports.remapBreakpoints = remapBreakpoints; exports.setBreakpointCondition = setBreakpointCondition; exports.toggleBreakpoint = toggleBreakpoint; exports.addOrToggleDisabledBreakpoint = addOrToggleDisabledBreakpoint; exports.toggleDisabledBreakpoint = toggleDisabledBreakpoint; var _promise = __webpack_require__(193); var _selectors = __webpack_require__(242); var _breakpoint = __webpack_require__(1057); var _addBreakpoint = __webpack_require__(1136); var _addBreakpoint2 = _interopRequireDefault(_addBreakpoint); var _remapLocations = __webpack_require__(188); var _remapLocations2 = _interopRequireDefault(_remapLocations); var _syncBreakpoint = __webpack_require__(1137); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /** * Redux actions for breakpoints * @module actions/breakpoints */ // this will need to be changed so that addCLientBreakpoint is removed /** * Syncing a breakpoint add breakpoint information that is stored, and * contact the server for more data. * * @memberof actions/breakpoints * @static * @param {String} $1.sourceId String value * @param {PendingBreakpoint} $1.location PendingBreakpoint value */ function syncBreakpoint(sourceId, pendingBreakpoint) { return (() => { var _ref = _asyncToGenerator(function* (_ref2) { var dispatch = _ref2.dispatch, getState = _ref2.getState, client = _ref2.client, sourceMaps = _ref2.sourceMaps; var _ref3 = yield (0, _syncBreakpoint.syncClientBreakpoint)(getState, client, sourceMaps, sourceId, pendingBreakpoint), breakpoint = _ref3.breakpoint, previousLocation = _ref3.previousLocation; return dispatch({ type: "SYNC_BREAKPOINT", breakpoint, previousLocation }); }); return function (_x) { return _ref.apply(this, arguments); }; })(); } /** * Add a new breakpoint * * @memberof actions/breakpoints * @static * @param {String} $1.condition Conditional breakpoint condition value * @param {Boolean} $1.disabled Disable value for breakpoint value */ function addBreakpoint(location) { var _ref4 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, condition = _ref4.condition, hidden = _ref4.hidden; var breakpoint = (0, _breakpoint.createBreakpoint)(location, { condition, hidden }); return (_ref5) => { var dispatch = _ref5.dispatch, getState = _ref5.getState, sourceMaps = _ref5.sourceMaps, client = _ref5.client; var action = { type: "ADD_BREAKPOINT", breakpoint }; var promise = (0, _addBreakpoint2.default)(getState, client, sourceMaps, action); return dispatch(_extends({}, action, { [_promise.PROMISE]: promise })); }; } /** * Add a new hidden breakpoint * * @memberOf actions/breakpoints * @param location * @return {function(ThunkArgs)} */ function addHiddenBreakpoint(location) { return (_ref6) => { var dispatch = _ref6.dispatch; return dispatch(addBreakpoint(location, { hidden: true })); }; } /** * Remove a single breakpoint * * @memberof actions/breakpoints * @static */ function removeBreakpoint(location) { return (_ref7) => { var dispatch = _ref7.dispatch, getState = _ref7.getState, client = _ref7.client; var bp = (0, _selectors.getBreakpoint)(getState(), location); if (!bp || bp.loading) { return; } // If the breakpoint is already disabled, we don't need to communicate // with the server. We just need to dispatch an action // simulating a successful server request if (bp.disabled) { return dispatch({ type: "REMOVE_BREAKPOINT", breakpoint: bp, status: "done" }); } return dispatch({ type: "REMOVE_BREAKPOINT", breakpoint: bp, [_promise.PROMISE]: client.removeBreakpoint(bp.generatedLocation) }); }; } /** * Enabling a breakpoint * will reuse the existing breakpoint information that is stored. * * @memberof actions/breakpoints * @static * @param {Location} $1.location Location value */ function enableBreakpoint(location) { return (() => { var _ref8 = _asyncToGenerator(function* (_ref9) { var dispatch = _ref9.dispatch, getState = _ref9.getState, client = _ref9.client, sourceMaps = _ref9.sourceMaps; var breakpoint = (0, _selectors.getBreakpoint)(getState(), location); if (!breakpoint || breakpoint.loading) { return; } var action = { type: "ENABLE_BREAKPOINT", breakpoint }; var promise = (0, _addBreakpoint2.default)(getState, client, sourceMaps, action); return dispatch({ type: "ENABLE_BREAKPOINT", breakpoint, [_promise.PROMISE]: promise }); }); return function (_x3) { return _ref8.apply(this, arguments); }; })(); } /** * Disable a single breakpoint * * @memberof actions/breakpoints * @static */ function disableBreakpoint(location) { return (() => { var _ref10 = _asyncToGenerator(function* (_ref11) { var dispatch = _ref11.dispatch, getState = _ref11.getState, client = _ref11.client; var bp = (0, _selectors.getBreakpoint)(getState(), location); if (!bp || bp.loading) { return; } yield client.removeBreakpoint(bp.generatedLocation); var newBreakpoint = _extends({}, bp, { disabled: true }); return dispatch({ type: "DISABLE_BREAKPOINT", breakpoint: newBreakpoint }); }); return function (_x4) { return _ref10.apply(this, arguments); }; })(); } /** * Toggle All Breakpoints * * @memberof actions/breakpoints * @static */ function toggleAllBreakpoints(shouldDisableBreakpoints) { return (() => { var _ref12 = _asyncToGenerator(function* (_ref13) { var dispatch = _ref13.dispatch, getState = _ref13.getState; var breakpoints = (0, _selectors.getBreakpoints)(getState()); for (var _ref14 of breakpoints) { var _ref15 = _slicedToArray(_ref14, 2); var breakpoint = _ref15[1]; if (shouldDisableBreakpoints) { yield dispatch(disableBreakpoint(breakpoint.location)); } else { yield dispatch(enableBreakpoint(breakpoint.location)); } } }); return function (_x5) { return _ref12.apply(this, arguments); }; })(); } /** * Toggle Breakpoints * * @memberof actions/breakpoints * @static */ function toggleBreakpoints(shouldDisableBreakpoints, breakpoints) { return (() => { var _ref16 = _asyncToGenerator(function* (_ref17) { var dispatch = _ref17.dispatch; for (var _ref18 of breakpoints) { var _ref19 = _slicedToArray(_ref18, 2); var breakpoint = _ref19[1]; if (shouldDisableBreakpoints) { yield dispatch(disableBreakpoint(breakpoint.location)); } else { yield dispatch(enableBreakpoint(breakpoint.location)); } } }); return function (_x6) { return _ref16.apply(this, arguments); }; })(); } /** * Removes all breakpoints * * @memberof actions/breakpoints * @static */ function removeAllBreakpoints() { return (() => { var _ref20 = _asyncToGenerator(function* (_ref21) { var dispatch = _ref21.dispatch, getState = _ref21.getState; var breakpoints = (0, _selectors.getBreakpoints)(getState()); for (var _ref22 of breakpoints) { var _ref23 = _slicedToArray(_ref22, 2); var breakpoint = _ref23[1]; yield dispatch(removeBreakpoint(breakpoint.location)); } }); return function (_x7) { return _ref20.apply(this, arguments); }; })(); } /** * Removes breakpoints * * @memberof actions/breakpoints * @static */ function removeBreakpoints(breakpoints) { return (() => { var _ref24 = _asyncToGenerator(function* (_ref25) { var dispatch = _ref25.dispatch; for (var _ref26 of breakpoints) { var _ref27 = _slicedToArray(_ref26, 2); var breakpoint = _ref27[1]; yield dispatch(removeBreakpoint(breakpoint.location)); } }); return function (_x8) { return _ref24.apply(this, arguments); }; })(); } function remapBreakpoints(sourceId) { return (() => { var _ref28 = _asyncToGenerator(function* (_ref29) { var dispatch = _ref29.dispatch, getState = _ref29.getState, sourceMaps = _ref29.sourceMaps; var breakpoints = (0, _selectors.getBreakpoints)(getState()); var newBreakpoints = yield (0, _remapLocations2.default)(breakpoints, sourceId, sourceMaps); return dispatch({ type: "REMAP_BREAKPOINTS", breakpoints: newBreakpoints }); }); return function (_x9) { return _ref28.apply(this, arguments); }; })(); } /** * Update the condition of a breakpoint. * * @throws {Error} "not implemented" * @memberof actions/breakpoints * @static * @param {Location} location * @see DebuggerController.Breakpoints.addBreakpoint * @param {string} condition * The condition to set on the breakpoint * @param {Boolean} $1.disabled Disable value for breakpoint value */ function setBreakpointCondition(location) { var _ref30 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, condition = _ref30.condition; return (() => { var _ref31 = _asyncToGenerator(function* (_ref32) { var dispatch = _ref32.dispatch, getState = _ref32.getState, client = _ref32.client, sourceMaps = _ref32.sourceMaps; var bp = (0, _selectors.getBreakpoint)(getState(), location); if (!bp) { return dispatch(addBreakpoint(location, { condition })); } if (bp.loading) { return; } if (bp.disabled) { yield dispatch(enableBreakpoint(location)); bp.disabled = !bp.disabled; } yield client.setBreakpointCondition(bp.id, location, condition, sourceMaps.isOriginalId(bp.location.sourceId)); var newBreakpoint = _extends({}, bp, { condition }); (0, _breakpoint.assertBreakpoint)(newBreakpoint); return dispatch({ type: "SET_BREAKPOINT_CONDITION", breakpoint: newBreakpoint }); }); return function (_x11) { return _ref31.apply(this, arguments); }; })(); } function toggleBreakpoint(line, column) { return (_ref33) => { var dispatch = _ref33.dispatch, getState = _ref33.getState, client = _ref33.client, sourceMaps = _ref33.sourceMaps; var selectedSource = (0, _selectors.getSelectedSource)(getState()); var bp = (0, _selectors.getBreakpointAtLocation)(getState(), { line, column }); if (bp && bp.loading) { return; } if (bp) { // NOTE: it's possible the breakpoint has slid to a column return dispatch(removeBreakpoint({ sourceId: bp.location.sourceId, sourceUrl: bp.location.sourceUrl, line: bp.location.line, column: column || bp.location.column })); } return dispatch(addBreakpoint({ sourceId: selectedSource.get("id"), sourceUrl: selectedSource.get("url"), line: line, column: column })); }; } function addOrToggleDisabledBreakpoint(line, column) { return (_ref34) => { var dispatch = _ref34.dispatch, getState = _ref34.getState, client = _ref34.client, sourceMaps = _ref34.sourceMaps; var selectedSource = (0, _selectors.getSelectedSource)(getState()); var bp = (0, _selectors.getBreakpointAtLocation)(getState(), { line, column }); if (bp && bp.loading) { return; } if (bp) { // NOTE: it's possible the breakpoint has slid to a column return dispatch(toggleDisabledBreakpoint(line, column || bp.location.column)); } return dispatch(addBreakpoint({ sourceId: selectedSource.get("id"), sourceUrl: selectedSource.get("url"), line: line, column: column })); }; } function toggleDisabledBreakpoint(line, column) { return (_ref35) => { var dispatch = _ref35.dispatch, getState = _ref35.getState, client = _ref35.client, sourceMaps = _ref35.sourceMaps; var bp = (0, _selectors.getBreakpointAtLocation)(getState(), { line, column }); if (!bp || bp.loading) { return; } if (!bp.disabled) { return dispatch(disableBreakpoint(bp.location)); } return dispatch(enableBreakpoint(bp.location)); }; } /***/ }), /* 246 */, /* 247 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 248 */ /***/ (function(module, exports, __webpack_require__) { (function(){ var crypt = __webpack_require__(249), utf8 = __webpack_require__(250).utf8, isBuffer = __webpack_require__(251), bin = __webpack_require__(250).bin, // The core md5 = function (message, options) { // Convert to byte array if (message.constructor == String) if (options && options.encoding === 'binary') message = bin.stringToBytes(message); else message = utf8.stringToBytes(message); else if (isBuffer(message)) message = Array.prototype.slice.call(message, 0); else if (!Array.isArray(message)) message = message.toString(); // else, assume byte array already var m = crypt.bytesToWords(message), l = message.length * 8, a = 1732584193, b = -271733879, c = -1732584194, d = 271733878; // Swap endian for (var i = 0; i < m.length; i++) { m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF | ((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00; } // Padding m[l >>> 5] |= 0x80 << (l % 32); m[(((l + 64) >>> 9) << 4) + 14] = l; // Method shortcuts var FF = md5._ff, GG = md5._gg, HH = md5._hh, II = md5._ii; for (var i = 0; i < m.length; i += 16) { var aa = a, bb = b, cc = c, dd = d; a = FF(a, b, c, d, m[i+ 0], 7, -680876936); d = FF(d, a, b, c, m[i+ 1], 12, -389564586); c = FF(c, d, a, b, m[i+ 2], 17, 606105819); b = FF(b, c, d, a, m[i+ 3], 22, -1044525330); a = FF(a, b, c, d, m[i+ 4], 7, -176418897); d = FF(d, a, b, c, m[i+ 5], 12, 1200080426); c = FF(c, d, a, b, m[i+ 6], 17, -1473231341); b = FF(b, c, d, a, m[i+ 7], 22, -45705983); a = FF(a, b, c, d, m[i+ 8], 7, 1770035416); d = FF(d, a, b, c, m[i+ 9], 12, -1958414417); c = FF(c, d, a, b, m[i+10], 17, -42063); b = FF(b, c, d, a, m[i+11], 22, -1990404162); a = FF(a, b, c, d, m[i+12], 7, 1804603682); d = FF(d, a, b, c, m[i+13], 12, -40341101); c = FF(c, d, a, b, m[i+14], 17, -1502002290); b = FF(b, c, d, a, m[i+15], 22, 1236535329); a = GG(a, b, c, d, m[i+ 1], 5, -165796510); d = GG(d, a, b, c, m[i+ 6], 9, -1069501632); c = GG(c, d, a, b, m[i+11], 14, 643717713); b = GG(b, c, d, a, m[i+ 0], 20, -373897302); a = GG(a, b, c, d, m[i+ 5], 5, -701558691); d = GG(d, a, b, c, m[i+10], 9, 38016083); c = GG(c, d, a, b, m[i+15], 14, -660478335); b = GG(b, c, d, a, m[i+ 4], 20, -405537848); a = GG(a, b, c, d, m[i+ 9], 5, 568446438); d = GG(d, a, b, c, m[i+14], 9, -1019803690); c = GG(c, d, a, b, m[i+ 3], 14, -187363961); b = GG(b, c, d, a, m[i+ 8], 20, 1163531501); a = GG(a, b, c, d, m[i+13], 5, -1444681467); d = GG(d, a, b, c, m[i+ 2], 9, -51403784); c = GG(c, d, a, b, m[i+ 7], 14, 1735328473); b = GG(b, c, d, a, m[i+12], 20, -1926607734); a = HH(a, b, c, d, m[i+ 5], 4, -378558); d = HH(d, a, b, c, m[i+ 8], 11, -2022574463); c = HH(c, d, a, b, m[i+11], 16, 1839030562); b = HH(b, c, d, a, m[i+14], 23, -35309556); a = HH(a, b, c, d, m[i+ 1], 4, -1530992060); d = HH(d, a, b, c, m[i+ 4], 11, 1272893353); c = HH(c, d, a, b, m[i+ 7], 16, -155497632); b = HH(b, c, d, a, m[i+10], 23, -1094730640); a = HH(a, b, c, d, m[i+13], 4, 681279174); d = HH(d, a, b, c, m[i+ 0], 11, -358537222); c = HH(c, d, a, b, m[i+ 3], 16, -722521979); b = HH(b, c, d, a, m[i+ 6], 23, 76029189); a = HH(a, b, c, d, m[i+ 9], 4, -640364487); d = HH(d, a, b, c, m[i+12], 11, -421815835); c = HH(c, d, a, b, m[i+15], 16, 530742520); b = HH(b, c, d, a, m[i+ 2], 23, -995338651); a = II(a, b, c, d, m[i+ 0], 6, -198630844); d = II(d, a, b, c, m[i+ 7], 10, 1126891415); c = II(c, d, a, b, m[i+14], 15, -1416354905); b = II(b, c, d, a, m[i+ 5], 21, -57434055); a = II(a, b, c, d, m[i+12], 6, 1700485571); d = II(d, a, b, c, m[i+ 3], 10, -1894986606); c = II(c, d, a, b, m[i+10], 15, -1051523); b = II(b, c, d, a, m[i+ 1], 21, -2054922799); a = II(a, b, c, d, m[i+ 8], 6, 1873313359); d = II(d, a, b, c, m[i+15], 10, -30611744); c = II(c, d, a, b, m[i+ 6], 15, -1560198380); b = II(b, c, d, a, m[i+13], 21, 1309151649); a = II(a, b, c, d, m[i+ 4], 6, -145523070); d = II(d, a, b, c, m[i+11], 10, -1120210379); c = II(c, d, a, b, m[i+ 2], 15, 718787259); b = II(b, c, d, a, m[i+ 9], 21, -343485551); a = (a + aa) >>> 0; b = (b + bb) >>> 0; c = (c + cc) >>> 0; d = (d + dd) >>> 0; } return crypt.endian([a, b, c, d]); }; // Auxiliary functions md5._ff = function (a, b, c, d, x, s, t) { var n = a + (b & c | ~b & d) + (x >>> 0) + t; return ((n << s) | (n >>> (32 - s))) + b; }; md5._gg = function (a, b, c, d, x, s, t) { var n = a + (b & d | c & ~d) + (x >>> 0) + t; return ((n << s) | (n >>> (32 - s))) + b; }; md5._hh = function (a, b, c, d, x, s, t) { var n = a + (b ^ c ^ d) + (x >>> 0) + t; return ((n << s) | (n >>> (32 - s))) + b; }; md5._ii = function (a, b, c, d, x, s, t) { var n = a + (c ^ (b | ~d)) + (x >>> 0) + t; return ((n << s) | (n >>> (32 - s))) + b; }; // Package private blocksize md5._blocksize = 16; md5._digestsize = 16; module.exports = function (message, options) { if (message === undefined || message === null) throw new Error('Illegal argument ' + message); var digestbytes = crypt.wordsToBytes(md5(message, options)); return options && options.asBytes ? digestbytes : options && options.asString ? bin.bytesToString(digestbytes) : crypt.bytesToHex(digestbytes); }; })(); /***/ }), /* 249 */ /***/ (function(module, exports) { (function() { var base64map = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', crypt = { // Bit-wise rotation left rotl: function(n, b) { return (n << b) | (n >>> (32 - b)); }, // Bit-wise rotation right rotr: function(n, b) { return (n << (32 - b)) | (n >>> b); }, // Swap big-endian to little-endian and vice versa endian: function(n) { // If number given, swap endian if (n.constructor == Number) { return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00; } // Else, assume array and swap all items for (var i = 0; i < n.length; i++) n[i] = crypt.endian(n[i]); return n; }, // Generate an array of any length of random bytes randomBytes: function(n) { for (var bytes = []; n > 0; n--) bytes.push(Math.floor(Math.random() * 256)); return bytes; }, // Convert a byte array to big-endian 32-bit words bytesToWords: function(bytes) { for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8) words[b >>> 5] |= bytes[i] << (24 - b % 32); return words; }, // Convert big-endian 32-bit words to a byte array wordsToBytes: function(words) { for (var bytes = [], b = 0; b < words.length * 32; b += 8) bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF); return bytes; }, // Convert a byte array to a hex string bytesToHex: function(bytes) { for (var hex = [], i = 0; i < bytes.length; i++) { hex.push((bytes[i] >>> 4).toString(16)); hex.push((bytes[i] & 0xF).toString(16)); } return hex.join(''); }, // Convert a hex string to a byte array hexToBytes: function(hex) { for (var bytes = [], c = 0; c < hex.length; c += 2) bytes.push(parseInt(hex.substr(c, 2), 16)); return bytes; }, // Convert a byte array to a base-64 string bytesToBase64: function(bytes) { for (var base64 = [], i = 0; i < bytes.length; i += 3) { var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2]; for (var j = 0; j < 4; j++) if (i * 8 + j * 6 <= bytes.length * 8) base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F)); else base64.push('='); } return base64.join(''); }, // Convert a base-64 string to a byte array base64ToBytes: function(base64) { // Remove non-base-64 characters base64 = base64.replace(/[^A-Z0-9+\/]/ig, ''); for (var bytes = [], i = 0, imod4 = 0; i < base64.length; imod4 = ++i % 4) { if (imod4 == 0) continue; bytes.push(((base64map.indexOf(base64.charAt(i - 1)) & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2)) | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2))); } return bytes; } }; module.exports = crypt; })(); /***/ }), /* 250 */ /***/ (function(module, exports) { var charenc = { // UTF-8 encoding utf8: { // Convert a string to a byte array stringToBytes: function(str) { return charenc.bin.stringToBytes(unescape(encodeURIComponent(str))); }, // Convert a byte array to a string bytesToString: function(bytes) { return decodeURIComponent(escape(charenc.bin.bytesToString(bytes))); } }, // Binary encoding bin: { // Convert a string to a byte array stringToBytes: function(str) { for (var bytes = [], i = 0; i < str.length; i++) bytes.push(str.charCodeAt(i) & 0xFF); return bytes; }, // Convert a byte array to a string bytesToString: function(bytes) { for (var str = [], i = 0; i < bytes.length; i++) str.push(String.fromCharCode(bytes[i])); return str.join(''); } } }; module.exports = charenc; /***/ }), /* 251 */ /***/ (function(module, exports) { /*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh * @license MIT */ // The _isBuffer check is for Safari 5-7 support, because it's missing // Object.prototype.constructor. Remove this eventually module.exports = function (obj) { return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer) } function isBuffer (obj) { return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) } // For Node v0.10 support. Remove this eventually. function isSlowBuffer (obj) { return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) } /***/ }), /* 252 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.addExpression = addExpression; exports.updateExpression = updateExpression; exports.deleteExpression = deleteExpression; exports.evaluateExpressions = evaluateExpressions; var _selectors = __webpack_require__(242); var _expressions = __webpack_require__(1177); var _parser = __webpack_require__(827); var parser = _interopRequireWildcard(_parser); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /** * Add expression for debugger to watch * * @param {object} expression * @param {number} expression.id * @memberof actions/pause * @static */ function addExpression(input) { return (() => { var _ref = _asyncToGenerator(function* (_ref2) { var dispatch = _ref2.dispatch, getState = _ref2.getState; if (!input) { return; } var expression = (0, _selectors.getExpression)(getState(), input); if (expression) { return dispatch(evaluateExpression(expression)); } dispatch({ type: "ADD_EXPRESSION", input }); var newExpression = (0, _selectors.getExpression)(getState(), input); dispatch(evaluateExpression(newExpression)); }); return function (_x) { return _ref.apply(this, arguments); }; })(); } function updateExpression(input, expression) { return (_ref3) => { var dispatch = _ref3.dispatch, getState = _ref3.getState; if (!input || input == expression.input) { return; } dispatch({ type: "UPDATE_EXPRESSION", expression, input: input }); dispatch(evaluateExpressions()); }; } /** * * @param {object} expression * @param {number} expression.id * @memberof actions/pause * @static */ function deleteExpression(expression) { return (_ref4) => { var dispatch = _ref4.dispatch; dispatch({ type: "DELETE_EXPRESSION", input: expression.input }); }; } /** * * @memberof actions/pause * @param {number} selectedFrameId * @static */ function evaluateExpressions() { return (() => { var _ref5 = _asyncToGenerator(function* (_ref6) { var dispatch = _ref6.dispatch, getState = _ref6.getState, client = _ref6.client; var expressions = (0, _selectors.getExpressions)(getState()).toJS(); for (var expression of expressions) { yield dispatch(evaluateExpression(expression)); } }); return function (_x2) { return _ref5.apply(this, arguments); }; })(); } function evaluateExpression(expression) { return (() => { var _ref7 = _asyncToGenerator(function* (_ref8) { var dispatch = _ref8.dispatch, getState = _ref8.getState, client = _ref8.client; if (!expression.input) { console.warn("Expressions should not be empty"); return; } var error = yield parser.hasSyntaxError(expression.input); var frameId = (0, _selectors.getSelectedFrameId)(getState()); var value = error ? { input: expression.input, result: error } : yield client.evaluate((0, _expressions.wrapExpression)(expression.input), { frameId }); return dispatch({ type: "EVALUATE_EXPRESSION", input: expression.input, value }); }); return function (_x3) { return _ref7.apply(this, arguments); }; })(); } /***/ }), /* 253 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * @memberof utils/utils * @static */ var asPaused = (() => { var _ref = _asyncToGenerator(function* (state, client, func) { if (!(0, _selectors.getPause)(state)) { yield client.interrupt(); var result = void 0; try { result = yield func(client); } catch (e) { // Try to put the debugger back in a working state by resuming // it yield client.resume(); throw e; } yield client.resume(); return result; } return func(client); }); return function asPaused(_x, _x2, _x3) { return _ref.apply(this, arguments); }; })(); /** * @memberof actions/event-listeners * @static */ var _getEventListeners = (() => { var _ref3 = _asyncToGenerator(function* (threadClient) { var response = yield threadClient.eventListeners(); // Make sure all the listeners are sorted by the event type, since // they"re not guaranteed to be clustered together. response.listeners.sort(function (a, b) { return a.type > b.type ? 1 : -1; }); // Add all the listeners in the debugger view event linsteners container. var fetchedDefinitions = new Map(); var listeners = []; for (var listener of response.listeners) { var definitionSite = void 0; if (fetchedDefinitions.has(listener.function.actor)) { definitionSite = fetchedDefinitions.get(listener.function.actor); } else if (listener.function.class == "Function") { definitionSite = yield _getDefinitionSite(threadClient, listener.function); if (!definitionSite) { // We don"t know where this listener comes from so don"t show it in // the UI as breaking on it doesn"t work (bug 942899). continue; } fetchedDefinitions.set(listener.function.actor, definitionSite); } listener.function.url = definitionSite; listeners.push(listener); } fetchedDefinitions.clear(); return listeners; }); return function _getEventListeners(_x4) { return _ref3.apply(this, arguments); }; })(); var _getDefinitionSite = (() => { var _ref4 = _asyncToGenerator(function* (threadClient, func) { var grip = threadClient.pauseGrip(func); var response = void 0; try { response = yield grip.getDefinitionSite(); } catch (e) { // Don't make this error fatal, it would break the entire events pane. (0, _DevToolsUtils.reportException)("_getDefinitionSite", e); return null; } return response.source.url; }); return function _getDefinitionSite(_x5, _x6) { return _ref4.apply(this, arguments); }; })(); /** * @memberof actions/event-listeners * @static * @param {string} eventNames */ exports.fetchEventListeners = fetchEventListeners; exports.updateEventBreakpoints = updateEventBreakpoints; var _DevToolsUtils = __webpack_require__(222); var _selectors = __webpack_require__(242); function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* global window gThreadClient setNamedTimeout services EVENTS */ /* eslint no-shadow: 0 */ /** * Redux actions for the event listeners state * @module actions/event-listeners */ // delay is in ms var FETCH_EVENT_LISTENERS_DELAY = 200; var fetchListenersTimerID = void 0;function fetchEventListeners() { return (_ref2) => { var dispatch = _ref2.dispatch, getState = _ref2.getState, client = _ref2.client; // Make sure we"re not sending a batch of closely repeated requests. // This can easily happen whenever new sources are fetched. if (fetchListenersTimerID) { clearTimeout(fetchListenersTimerID); } fetchListenersTimerID = setTimeout(() => { // In case there is still a request of listeners going on (it // takes several RDP round trips right now), make sure we wait // on a currently running request if (getState().eventListeners.fetchingListeners) { dispatch({ type: services.WAIT_UNTIL, predicate: action => action.type === "FETCH_EVENT_LISTENERS" && action.status === "done", run: dispatch => dispatch(fetchEventListeners()) }); return; } dispatch({ type: "FETCH_EVENT_LISTENERS", status: "begin" }); asPaused(getState(), client, _getEventListeners).then(listeners => { dispatch({ type: "FETCH_EVENT_LISTENERS", status: "done", listeners: formatListeners(getState(), listeners) }); }); }, FETCH_EVENT_LISTENERS_DELAY); }; } function formatListeners(state, listeners) { return listeners.map(l => { return { selector: l.node.selector, type: l.type, sourceId: (0, _selectors.getSourceByURL)(state, l.function.location.url).get("id"), line: l.function.location.line }; }); } function updateEventBreakpoints(eventNames) { return dispatch => { setNamedTimeout("event-breakpoints-update", 0, () => { gThreadClient.pauseOnDOMEvents(eventNames, () => { // Notify that event breakpoints were added/removed on the server. window.emit(EVENTS.EVENT_BREAKPOINTS_UPDATED); dispatch({ type: "UPDATE_EVENT_BREAKPOINTS", eventNames: eventNames }); }); }); }; } /***/ }), /* 254 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); // If a request has been made to show this source, go ahead and // select it. var checkSelectedSource = (() => { var _ref = _asyncToGenerator(function* (state, dispatch, source) { var pendingLocation = (0, _selectors.getPendingSelectedLocation)(state); if (pendingLocation && !!source.url && pendingLocation.url === source.url) { yield dispatch(selectSource(source.id, { line: pendingLocation.line })); } }); return function checkSelectedSource(_x, _x2, _x3) { return _ref.apply(this, arguments); }; })(); var checkPendingBreakpoint = (() => { var _ref2 = _asyncToGenerator(function* (state, dispatch, pendingBreakpoint, source) { var sourceUrl = pendingBreakpoint.location.sourceUrl; var sameSource = sourceUrl && sourceUrl === source.url; if (sameSource) { yield dispatch((0, _breakpoints.syncBreakpoint)(source.id, pendingBreakpoint)); } }); return function checkPendingBreakpoint(_x4, _x5, _x6, _x7) { return _ref2.apply(this, arguments); }; })(); var checkPendingBreakpoints = (() => { var _ref3 = _asyncToGenerator(function* (state, dispatch, source) { var pendingBreakpoints = (0, _selectors.getPendingBreakpointsForSource)(state, source.url); if (!pendingBreakpoints.size) { return; } // load the source text if there is a pending breakpoint for it yield dispatch((0, _loadSourceText.loadSourceText)(source)); var pendingBreakpointsArray = pendingBreakpoints.valueSeq().toJS(); for (var pendingBreakpoint of pendingBreakpointsArray) { yield checkPendingBreakpoint(state, dispatch, pendingBreakpoint, source); } }); return function checkPendingBreakpoints(_x8, _x9, _x10) { return _ref3.apply(this, arguments); }; })(); /** * Handler for the debugger client's unsolicited newSource notification. * @memberof actions/sources * @static */ exports.newSource = newSource; exports.newSources = newSources; exports.selectSourceURL = selectSourceURL; exports.selectSource = selectSource; exports.jumpToMappedLocation = jumpToMappedLocation; exports.addTab = addTab; exports.moveTab = moveTab; exports.closeTab = closeTab; exports.closeTabs = closeTabs; exports.togglePrettyPrint = togglePrettyPrint; exports.toggleBlackBox = toggleBlackBox; exports.loadAllSources = loadAllSources; exports.ensureParserHasSourceText = ensureParserHasSourceText; var _promise = __webpack_require__(193); var _assert = __webpack_require__(223); var _assert2 = _interopRequireDefault(_assert); var _breakpoints = __webpack_require__(245); var _ast = __webpack_require__(1059); var _projectTextSearch = __webpack_require__(37); var _ui = __webpack_require__(321); var _source2 = __webpack_require__(233); var _createPrettySource = __webpack_require__(195); var _loadSourceText = __webpack_require__(1143); var _prefs = __webpack_require__(226); var _editor = __webpack_require__(257); var _sourceMaps = __webpack_require__(797); var _parser = __webpack_require__(827); var parser = _interopRequireWildcard(_parser); var _selectors = __webpack_require__(242); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /** * Redux actions for the sources state * @module actions/sources */ function newSource(source) { return (() => { var _ref4 = _asyncToGenerator(function* (_ref5) { var dispatch = _ref5.dispatch, getState = _ref5.getState; var _source = (0, _selectors.getSource)(getState(), source.id); if (_source) { return; } dispatch({ type: "ADD_SOURCE", source }); if (_prefs.prefs.clientSourceMapsEnabled) { yield dispatch(loadSourceMap(source)); } yield checkSelectedSource(getState(), dispatch, source); yield checkPendingBreakpoints(getState(), dispatch, source); }); return function (_x11) { return _ref4.apply(this, arguments); }; })(); } function newSources(sources) { return (() => { var _ref6 = _asyncToGenerator(function* (_ref7) { var dispatch = _ref7.dispatch, getState = _ref7.getState; var filteredSources = sources.filter(function (source) { return !(0, _selectors.getSource)(getState(), source.id); }); for (var source of filteredSources) { yield dispatch(newSource(source)); } }); return function (_x12) { return _ref6.apply(this, arguments); }; })(); } /** * @memberof actions/sources * @static */ function loadSourceMap(generatedSource) { return (() => { var _ref8 = _asyncToGenerator(function* (_ref9) { var dispatch = _ref9.dispatch, getState = _ref9.getState, sourceMaps = _ref9.sourceMaps; var urls = yield sourceMaps.getOriginalURLs(generatedSource); if (!urls) { // If this source doesn't have a sourcemap, do nothing. return; } var state = getState(); var originalSources = urls.map(function (originalUrl) { return { url: originalUrl, id: sourceMaps.generatedToOriginalId(generatedSource.id, originalUrl), isPrettyPrinted: false, isWasm: false, isBlackBoxed: false, loadedState: "unloaded" }; }); dispatch({ type: "ADD_SOURCES", sources: originalSources }); originalSources.forEach(function (source) { checkSelectedSource(state, dispatch, source); checkPendingBreakpoints(state, dispatch, source); }); }); return function (_x13) { return _ref8.apply(this, arguments); }; })(); } /** * Deterministically select a source that has a given URL. This will * work regardless of the connection status or if the source exists * yet. This exists mostly for external things to interact with the * debugger. * * @memberof actions/sources * @static */ function selectSourceURL(url) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; return (() => { var _ref10 = _asyncToGenerator(function* (_ref11) { var dispatch = _ref11.dispatch, getState = _ref11.getState; var source = (0, _selectors.getSourceByURL)(getState(), url); if (source) { yield dispatch(selectSource(source.get("id"), options)); } else { dispatch({ type: "SELECT_SOURCE_URL", url: url, tabIndex: options.tabIndex, line: options.line }); } }); return function (_x15) { return _ref10.apply(this, arguments); }; })(); } /** * @memberof actions/sources * @static */ function selectSource(id) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; return (_ref12) => { var dispatch = _ref12.dispatch, getState = _ref12.getState, client = _ref12.client; if (!client) { // No connection, do nothing. This happens when the debugger is // shut down too fast and it tries to display a default source. return; } var source = (0, _selectors.getSource)(getState(), id); if (!source) { // If there is no source we deselect the current selected source return dispatch({ type: "CLEAR_SELECTED_SOURCE" }); } var activeSearch = (0, _selectors.getActiveSearch)(getState()); if (activeSearch !== "file") { dispatch((0, _ui.closeActiveSearch)()); } dispatch(addTab(source.toJS(), 0)); return dispatch({ type: "SELECT_SOURCE", source: source.toJS(), tabIndex: options.tabIndex, line: options.line, [_promise.PROMISE]: _asyncToGenerator(function* () { yield dispatch((0, _loadSourceText.loadSourceText)(source.toJS())); yield dispatch((0, _ast.setOutOfScopeLocations)()); })() }); }; } /** * @memberof actions/sources * @static */ function jumpToMappedLocation(sourceLocation) { return (() => { var _ref14 = _asyncToGenerator(function* (_ref15) { var dispatch = _ref15.dispatch, getState = _ref15.getState, client = _ref15.client, sourceMaps = _ref15.sourceMaps; if (!client) { return; } var source = (0, _selectors.getSource)(getState(), sourceLocation.sourceId); var pairedLocation = void 0; if (sourceMaps.isOriginalId(sourceLocation.sourceId)) { pairedLocation = yield (0, _sourceMaps.getGeneratedLocation)(getState(), source.toJS(), sourceLocation, sourceMaps); } else { pairedLocation = yield sourceMaps.getOriginalLocation(sourceLocation, source.toJS()); } return dispatch(selectSource(pairedLocation.sourceId, { line: pairedLocation.line })); }); return function (_x17) { return _ref14.apply(this, arguments); }; })(); } function addTab(source, tabIndex) { return { type: "ADD_TAB", source, tabIndex }; } function moveTab(url, tabIndex) { return { type: "MOVE_TAB", url, tabIndex }; } /** * @memberof actions/sources * @static */ function closeTab(url) { return (_ref16) => { var dispatch = _ref16.dispatch, getState = _ref16.getState, client = _ref16.client; (0, _editor.removeDocument)(url); var tabs = (0, _selectors.removeSourceFromTabList)((0, _selectors.getSourceTabs)(getState()), url); var sourceId = (0, _selectors.getNewSelectedSourceId)(getState(), tabs); dispatch({ type: "CLOSE_TAB", url, tabs }); dispatch(selectSource(sourceId)); }; } /** * @memberof actions/sources * @static */ function closeTabs(urls) { return (_ref17) => { var dispatch = _ref17.dispatch, getState = _ref17.getState, client = _ref17.client; urls.forEach(url => { var source = (0, _selectors.getSourceByURL)(getState(), url); if (source) { (0, _editor.removeDocument)(source.get("id")); } }); var tabs = (0, _selectors.removeSourcesFromTabList)((0, _selectors.getSourceTabs)(getState()), urls); var sourceId = (0, _selectors.getNewSelectedSourceId)(getState(), tabs); dispatch({ type: "CLOSE_TABS", urls, tabs }); dispatch(selectSource(sourceId)); }; } /** * Toggle the pretty printing of a source's text. All subsequent calls to * |getText| will return the pretty-toggled text. Nothing will happen for * non-javascript files. * * @memberof actions/sources * @static * @param string id The source form from the RDP. * @returns Promise * A promise that resolves to [aSource, prettyText] or rejects to * [aSource, error]. */ function togglePrettyPrint(sourceId) { return (() => { var _ref18 = _asyncToGenerator(function* (_ref19) { var dispatch = _ref19.dispatch, getState = _ref19.getState, client = _ref19.client, sourceMaps = _ref19.sourceMaps; var source = (0, _selectors.getSource)(getState(), sourceId).toJS(); if (!source || !(0, _source2.isLoaded)(source)) { return {}; } (0, _assert2.default)(sourceMaps.isGeneratedId(sourceId), "Pretty-printing only allowed on generated sources"); var selectedLocation = (0, _selectors.getSelectedLocation)(getState()); var selectedOriginalLocation = selectedLocation ? yield sourceMaps.getOriginalLocation(selectedLocation) : {}; var url = (0, _source2.getPrettySourceURL)(source.url); var prettySource = (0, _selectors.getSourceByURL)(getState(), url); if (prettySource) { return dispatch(selectSource(prettySource.get("id"), { line: selectedOriginalLocation.line })); } var _ref20 = yield dispatch((0, _createPrettySource.createPrettySource)(sourceId)), newPrettySource = _ref20.source; yield dispatch((0, _breakpoints.remapBreakpoints)(sourceId)); yield dispatch((0, _ast.setEmptyLines)(newPrettySource.id)); return dispatch(selectSource(newPrettySource.id, { line: selectedOriginalLocation.line })); }); return function (_x18) { return _ref18.apply(this, arguments); }; })(); } function toggleBlackBox(source) { return (() => { var _ref21 = _asyncToGenerator(function* (_ref22) { var dispatch = _ref22.dispatch, getState = _ref22.getState, client = _ref22.client, sourceMaps = _ref22.sourceMaps; var isBlackBoxed = source.isBlackBoxed, id = source.id; return dispatch({ type: "BLACKBOX", source, [_promise.PROMISE]: client.blackBox(id, isBlackBoxed) }); }); return function (_x19) { return _ref21.apply(this, arguments); }; })(); } /** Load the text for all the available sources * @memberof actions/sources * @static */ function loadAllSources() { return (() => { var _ref23 = _asyncToGenerator(function* (_ref24) { var dispatch = _ref24.dispatch, getState = _ref24.getState; var sources = (0, _selectors.getSources)(getState()); var query = (0, _selectors.getTextSearchQuery)(getState()); for (var _ref25 of sources) { var _ref26 = _slicedToArray(_ref25, 2); var src = _ref26[1]; var source = src.toJS(); if ((0, _source2.isThirdParty)(source)) { continue; } yield dispatch((0, _loadSourceText.loadSourceText)(source)); // If there is a current search query we search // each of the source texts as they get loaded if (query) { yield dispatch((0, _projectTextSearch.searchSource)(source.id, query)); } } }); return function (_x20) { return _ref23.apply(this, arguments); }; })(); } /** * Ensures parser has source text * * @memberof actions/sources * @static */ function ensureParserHasSourceText(sourceId) { return (() => { var _ref27 = _asyncToGenerator(function* (_ref28) { var dispatch = _ref28.dispatch, getState = _ref28.getState; if (!(yield parser.hasSource(sourceId))) { yield dispatch((0, _loadSourceText.loadSourceText)((0, _selectors.getSource)(getState(), sourceId).toJS())); yield parser.setSource((0, _selectors.getSource)(getState(), sourceId).toJS()); } }); return function (_x21) { return _ref27.apply(this, arguments); }; })(); } /***/ }), /* 255 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getPausedPosition = exports.updateScopeBindings = undefined; var updateScopeBindings = exports.updateScopeBindings = (() => { var _ref = _asyncToGenerator(function* (scope, location, sourceMaps) { var astScopes = yield (0, _parser.getScopes)(location); var generatedScopes = yield sourceMaps.getLocationScopes(location, astScopes); if (!generatedScopes) { return scope; } return extendScope(scope, generatedScopes, 0); }); return function updateScopeBindings(_x, _x2, _x3) { return _ref.apply(this, arguments); }; })(); // Map protocol pause "why" reason to a valid L10N key // These are the known unhandled reasons: // "breakpointConditionThrown", "clientEvaluated" // "interrupted", "attached" var getPausedPosition = exports.getPausedPosition = (() => { var _ref2 = _asyncToGenerator(function* (pauseInfo, sourceMaps) { var frames = pauseInfo.frames; frames = yield updateFrameLocations(frames, sourceMaps); var frame = frames[0]; var location = frame.location; return location; }); return function getPausedPosition(_x4, _x5) { return _ref2.apply(this, arguments); }; })(); exports.updateFrameLocations = updateFrameLocations; exports.getPauseReason = getPauseReason; var _lodash = __webpack_require__(2); var _parser = __webpack_require__(827); function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } function updateFrameLocations(frames, sourceMaps) { if (!frames || frames.length == 0) { return Promise.resolve(frames); } return Promise.all(frames.map(frame => { return sourceMaps.getOriginalLocation(frame.location).then(loc => { return Object.assign({}, frame, { location: loc, generatedLocation: frame.location }); }); })); } function extendScope(scope, generatedScopes, index) { if (!scope) { return undefined; } if (index >= generatedScopes.length) { return scope; } return Object.assign({}, scope, { parent: extendScope(scope.parent, generatedScopes, index + 1), sourceBindings: generatedScopes[index].bindings }); } var reasons = { debuggerStatement: "whyPaused.debuggerStatement", breakpoint: "whyPaused.breakpoint", exception: "whyPaused.exception", resumeLimit: "whyPaused.resumeLimit", pauseOnDOMEvents: "whyPaused.pauseOnDOMEvents", breakpointConditionThrown: "whyPaused.breakpointConditionThrown", // V8 DOM: "whyPaused.breakpoint", EventListener: "whyPaused.pauseOnDOMEvents", XHR: "whyPaused.xhr", promiseRejection: "whyPaused.promiseRejection", assert: "whyPaused.assert", debugCommand: "whyPaused.debugCommand", other: "whyPaused.other" }; function getPauseReason(pauseInfo) { if (!pauseInfo) { return null; } var reasonType = (0, _lodash.get)(pauseInfo, "why.type", null); if (!reasons[reasonType]) { console.log("Please file an issue: reasonType=", reasonType); } return reasons[reasonType]; } /***/ }), /* 256 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 257 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _devtoolsConfig = __webpack_require__(828); var _sourceDocuments = __webpack_require__(260); var sourceDocumentUtils = _interopRequireWildcard(_sourceDocuments); var _source = __webpack_require__(233); var _expression = __webpack_require__(904); var expressionUtils = _interopRequireWildcard(_expression); var _sourceSearch = __webpack_require__(261); var sourceSearchUtils = _interopRequireWildcard(_sourceSearch); var _wasm = __webpack_require__(23); var _devtoolsSourceEditor = __webpack_require__(994); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } var findNext = sourceSearchUtils.findNext, findPrev = sourceSearchUtils.findPrev; function shouldShowPrettyPrint(selectedSource) { if (!selectedSource) { return false; } selectedSource = selectedSource.toJS(); return (0, _source.shouldPrettyPrint)(selectedSource); } function shouldShowFooter(selectedSource, horizontal) { if (!horizontal) { return true; } return shouldShowPrettyPrint(selectedSource); } function traverseResults(e, ctx, query, dir, modifiers) { e.stopPropagation(); e.preventDefault(); if (dir == "prev") { findPrev(ctx, query, true, modifiers); } else if (dir == "next") { findNext(ctx, query, true, modifiers); } } function createEditor() { var gutters = ["breakpoints", "hit-markers", "CodeMirror-linenumbers"]; if ((0, _devtoolsConfig.isEnabled)("codeFolding")) { gutters.push("CodeMirror-foldgutter"); } return new _devtoolsSourceEditor.SourceEditor({ mode: "javascript", foldGutter: (0, _devtoolsConfig.isEnabled)("codeFolding"), enableCodeFolding: (0, _devtoolsConfig.isEnabled)("codeFolding"), readOnly: true, lineNumbers: true, theme: "mozilla", styleActiveLine: false, lineWrapping: false, matchBrackets: true, showAnnotationRuler: true, gutters, value: " ", extraKeys: { // Override code mirror keymap to avoid conflicts with split console. Esc: false, "Cmd-F": false, "Cmd-G": false } }); } function toEditorLine(sourceId, lineOrOffset) { return (0, _wasm.isWasm)(sourceId) ? (0, _wasm.wasmOffsetToLine)(sourceId, lineOrOffset) : lineOrOffset - 1; } function toEditorPosition(sourceId, location) { return { line: toEditorLine(sourceId, location.line), column: (0, _wasm.isWasm)(sourceId) ? 0 : location.column }; } function toEditorRange(sourceId, location) { var start = location.start, end = location.end; return { start: toEditorPosition(sourceId, start), end: toEditorPosition(sourceId, end) }; } function toSourceLine(sourceId, line) { return (0, _wasm.isWasm)(sourceId) ? (0, _wasm.lineToWasmOffset)(sourceId, line) : line + 1; } function toSourceLocation(sourceId, location) { return { line: toSourceLine(sourceId, location.line), column: (0, _wasm.isWasm)(sourceId) ? undefined : location.column }; } function markText(editor, className, location) { var start = location.start, end = location.end; return editor.codeMirror.markText({ ch: start.column, line: start.line }, { ch: end.column, line: end.line }, { className }); } function lineAtHeight(editor, sourceId, event) { var editorLine = editor.codeMirror.lineAtHeight(event.clientY); return toSourceLine(sourceId, editorLine); } function getSourceLocationFromMouseEvent(editor, selectedLocation, e) { var _editor$codeMirror$co = editor.codeMirror.coordsChar({ left: e.clientX, top: e.clientY }), line = _editor$codeMirror$co.line, ch = _editor$codeMirror$co.ch; return { sourceId: selectedLocation.sourceId, line: line + 1, column: ch + 1 }; } module.exports = Object.assign({}, expressionUtils, sourceDocumentUtils, sourceSearchUtils, _devtoolsSourceEditor.SourceEditorUtils, { createEditor, isWasm: _wasm.isWasm, toEditorLine, toEditorPosition, toEditorRange, toSourceLine, toSourceLocation, shouldShowPrettyPrint, shouldShowFooter, traverseResults, markText, lineAtHeight, getSourceLocationFromMouseEvent }); /***/ }), /* 258 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 259 */ /***/ (function(module, exports, __webpack_require__) { var toString = __webpack_require__(108); /** * Used to match `RegExp` * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source); /** * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to escape. * @returns {string} Returns the escaped string. * @example * * _.escapeRegExp('[lodash](https://lodash.com/)'); * // => '\[lodash\]\(https://lodash\.com/\)' */ function escapeRegExp(string) { string = toString(string); return (string && reHasRegExpChar.test(string)) ? string.replace(reRegExpChar, '\\$&') : string; } module.exports = escapeRegExp; /***/ }), /* 260 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.showSourceText = exports.updateDocument = exports.updateLineNumberFormat = exports.resetLineNumberFormat = exports.clearDocuments = exports.removeDocument = exports.setDocument = exports.getDocument = undefined; var _source = __webpack_require__(233); var _wasm = __webpack_require__(23); var _devtoolsSourceEditor = __webpack_require__(994); var resizeBreakpointGutter = _devtoolsSourceEditor.SourceEditorUtils.resizeBreakpointGutter; var sourceDocs = {}; function getDocument(key) { return sourceDocs[key]; } function setDocument(key, doc) { sourceDocs[key] = doc; } function removeDocument(key) { delete sourceDocs[key]; } function clearDocuments() { sourceDocs = {}; } function resetLineNumberFormat(editor) { var cm = editor.codeMirror; cm.setOption("lineNumberFormatter", number => number); resizeBreakpointGutter(cm); } function updateLineNumberFormat(editor, sourceId) { if (!(0, _wasm.isWasm)(sourceId)) { return resetLineNumberFormat(editor); } var cm = editor.codeMirror; var lineNumberFormatter = (0, _wasm.getWasmLineNumberFormatter)(sourceId); cm.setOption("lineNumberFormatter", lineNumberFormatter); resizeBreakpointGutter(cm); } function updateDocument(editor, sourceId) { if (!sourceId) { return; } var doc = getDocument(sourceId) || editor.createDocument(); editor.replaceDocument(doc); updateLineNumberFormat(editor, sourceId); } function setEditorText(editor, source) { var text = source.text, sourceId = source.id; if (source.isWasm) { var wasmLines = (0, _wasm.renderWasmText)(sourceId, text); // cm will try to split into lines anyway, saving memory var wasmText = { split: () => wasmLines, match: () => false }; editor.setText(wasmText); } else { editor.setText(text); } } /** * Handle getting the source document or creating a new * document with the correct mode and text. */ function showSourceText(editor, source) { if (!source) { return; } var doc = getDocument(source.id); if (editor.codeMirror.doc === doc) { return; } if (doc) { editor.replaceDocument(doc); updateLineNumberFormat(editor, source.id); return doc; } doc = editor.createDocument(); setDocument(source.id, doc); editor.replaceDocument(doc); setEditorText(editor, source); editor.setMode((0, _source.getMode)(source)); updateLineNumberFormat(editor, source.id); } exports.getDocument = getDocument; exports.setDocument = setDocument; exports.removeDocument = removeDocument; exports.clearDocuments = clearDocuments; exports.resetLineNumberFormat = resetLineNumberFormat; exports.updateLineNumberFormat = updateLineNumberFormat; exports.updateDocument = updateDocument; exports.showSourceText = showSourceText; /***/ }), /* 261 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getMatchIndex = exports.removeOverlay = exports.findPrev = exports.findNext = exports.find = exports.buildQuery = undefined; var _buildQuery = __webpack_require__(1138); var _buildQuery2 = _interopRequireDefault(_buildQuery); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * @memberof utils/source-search * @static */ function getSearchCursor(cm, query, pos, modifiers) { var regexQuery = (0, _buildQuery2.default)(query, modifiers, { isGlobal: true }); return cm.getSearchCursor(regexQuery, pos); } /** * @memberof utils/source-search * @static */ function SearchState() { this.posFrom = this.posTo = this.query = null; this.overlay = null; this.results = []; } /** * @memberof utils/source-search * @static */ function getSearchState(cm, query, modifiers) { var state = cm.state.search || (cm.state.search = new SearchState()); return state; } function isWhitespace(query) { return !query.match(/\S/); } /** * This returns a mode object used by CoeMirror's addOverlay function * to parse and style tokens in the file. * The mode object contains a tokenizer function (token) which takes * a character stream as input, advances it a character at a time, * and returns style(s) for that token. For more details see * https://codemirror.net/doc/manual.html#modeapi * * Also the token function code is mainly based of work done * by the chrome devtools team. Thanks guys! :) * * @memberof utils/source-search * @static */ function searchOverlay(query, modifiers) { var regexQuery = (0, _buildQuery2.default)(query, modifiers, { ignoreSpaces: true, // regex must be global for the overlay isGlobal: true }); return { token: function (stream, state) { // set the last index to be the current stream position // this acts as an offset regexQuery.lastIndex = stream.pos; var match = regexQuery.exec(stream.string); if (match && match.index === stream.pos) { // if we have a match at the current stream position // set the class for a match stream.pos += match[0].length || 1; return "highlight highlight-full"; } else if (match) { // if we have a match somewhere in the line, go to that point in the // stream stream.pos = match.index; } else { // if we have no matches in this line, skip to the end of the line stream.skipToEnd(); } } }; } /** * @memberof utils/source-search * @static */ function updateOverlay(cm, state, query, modifiers) { cm.removeOverlay(state.overlay); state.overlay = searchOverlay(query, modifiers); cm.addOverlay(state.overlay, { opaque: false }); } function updateCursor(cm, state, keepSelection) { state.posTo = cm.getCursor("anchor"); state.posFrom = cm.getCursor("head"); if (!keepSelection) { state.posTo = { line: 0, ch: 0 }; state.posFrom = { line: 0, ch: 0 }; } } function getMatchIndex(count, currentIndex, rev) { if (!rev) { if (currentIndex == count - 1) { return 0; } return currentIndex + 1; } if (currentIndex == 0) { return count - 1; } return currentIndex - 1; } /** * If there's a saved search, selects the next results. * Otherwise, creates a new search and selects the first * result. * * @memberof utils/source-search * @static */ function doSearch(ctx, rev, query, keepSelection, modifiers) { var cm = ctx.cm; if (!cm) { return; } var defaultIndex = { line: -1, ch: -1 }; return cm.operation(function () { if (!query || isWhitespace(query)) { clearSearch(cm, query, modifiers); return; } var state = getSearchState(cm, query, modifiers); var isNewQuery = state.query !== query; state.query = query; updateOverlay(cm, state, query, modifiers); updateCursor(cm, state, keepSelection); var searchLocation = searchNext(ctx, rev, query, isNewQuery, modifiers); return searchLocation ? searchLocation.from : defaultIndex; }); } function getCursorPos(newQuery, rev, state) { if (newQuery) { return rev ? state.posFrom : state.posTo; } return rev ? state.posTo : state.posFrom; } /** * Selects the next result of a saved search. * * @memberof utils/source-search * @static */ function searchNext(ctx, rev, query, newQuery, modifiers) { var cm = ctx.cm, ed = ctx.ed; var nextMatch = void 0; cm.operation(function () { var state = getSearchState(cm, query, modifiers); var pos = getCursorPos(newQuery, rev, state); if (!state.query) { return; } var cursor = getSearchCursor(cm, state.query, pos, modifiers); var location = rev ? { line: cm.lastLine(), ch: null } : { line: cm.firstLine(), ch: 0 }; if (!cursor.find(rev) && state.query) { cursor = getSearchCursor(cm, state.query, location, modifiers); if (!cursor.find(rev)) { return; } } // We don't want to jump the editor // when we're selecting text if (!cm.state.selectingText) { ed.alignLine(cursor.from().line, "center"); cm.setSelection(cursor.from(), cursor.to()); } nextMatch = { from: cursor.from(), to: cursor.to() }; }); return nextMatch; } /** * Remove overlay. * * @memberof utils/source-search * @static */ function removeOverlay(ctx, query, modifiers) { var state = getSearchState(ctx.cm, query, modifiers); ctx.cm.removeOverlay(state.overlay); var _ctx$cm$getCursor = ctx.cm.getCursor(), line = _ctx$cm$getCursor.line, ch = _ctx$cm$getCursor.ch; ctx.cm.doc.setSelection({ line, ch }, { line, ch }, { scroll: false }); } /** * Clears the currently saved search. * * @memberof utils/source-search * @static */ function clearSearch(cm, query, modifiers) { var state = getSearchState(cm, query, modifiers); state.results = []; if (!state.query) { return; } cm.removeOverlay(state.overlay); state.query = null; } /** * Starts a new search. * * @memberof utils/source-search * @static */ function find(ctx, query, keepSelection, modifiers) { clearSearch(ctx.cm, query, modifiers); return doSearch(ctx, false, query, keepSelection, modifiers); } /** * Finds the next item based on the currently saved search. * * @memberof utils/source-search * @static */ function findNext(ctx, query, keepSelection, modifiers) { return doSearch(ctx, false, query, keepSelection, modifiers); } /** * Finds the previous item based on the currently saved search. * * @memberof utils/source-search * @static */ function findPrev(ctx, query, keepSelection, modifiers) { return doSearch(ctx, true, query, keepSelection, modifiers); } exports.buildQuery = _buildQuery2.default; exports.find = find; exports.findNext = findNext; exports.findPrev = findPrev; exports.removeOverlay = removeOverlay; exports.getMatchIndex = getMatchIndex; /***/ }), /* 262 */, /* 263 */, /* 264 */, /* 265 */, /* 266 */, /* 267 */, /* 268 */, /* 269 */, /* 270 */, /* 271 */, /* 272 */, /* 273 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.formatTree = formatTree; function formatTree(tree) { var depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; var str = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ""; var whitespace = new Array(depth * 2).join(" "); if (Array.isArray(tree.contents)) { str += `${whitespace} - ${tree.name} path=${tree.path} \n`; tree.contents.forEach(t => { str = formatTree(t, depth + 1, str); }); } else { var id = tree.contents.get("id"); str += `${whitespace} - ${tree.name} path=${tree.path} source_id=${id} \n`; } return str; } /***/ }), /* 274 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getDirectories = getDirectories; var _utils = __webpack_require__(18); var _getURL = __webpack_require__(24); function findSource(sourceTree, sourceUrl) { var returnTarget = null; function _traverse(subtree) { if ((0, _utils.nodeHasChildren)(subtree)) { for (var child of subtree.contents) { _traverse(child); } } else if (!returnTarget) { if (subtree.path.replace(/http(s)?:\//, "") == sourceUrl) { returnTarget = subtree; return; } } } sourceTree.contents.forEach(_traverse); if (!returnTarget) { return sourceTree; } return returnTarget; } function getDirectories(sourceUrl, sourceTree) { var url = (0, _getURL.getURL)(sourceUrl); var fullUrl = `/${url.group}${url.path}`; var parentMap = (0, _utils.createParentMap)(sourceTree); var source = findSource(sourceTree, fullUrl); if (!source) { return []; } var node = source; var directories = []; directories.push(source); while (true) { node = parentMap.get(node); if (!node) { return directories; } directories.push(node); } } /***/ }), /* 275 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createTree = createTree; var _utils = __webpack_require__(18); var _collapseTree = __webpack_require__(41); var _sortTree = __webpack_require__(794); var _addToTree = __webpack_require__(40); function createTree(sources, debuggeeUrl) { var uncollapsedTree = (0, _utils.createNode)("root", "", []); for (var source of sources.valueSeq()) { (0, _addToTree.addToTree)(uncollapsedTree, source, debuggeeUrl); } var sourceTree = (0, _sortTree.sortEntireTree)((0, _collapseTree.collapseTree)(uncollapsedTree), debuggeeUrl); return { uncollapsedTree, sourceTree, parentMap: (0, _utils.createParentMap)(sourceTree), focusedItem: null }; } /***/ }), /* 276 */, /* 277 */, /* 278 */, /* 279 */, /* 280 */, /* 281 */, /* 282 */, /* 283 */, /* 284 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class ToggleSearch extends _react.Component { render() { var _props = this.props, kind = _props.kind, toggle = _props.toggle; var isSourcesActive = kind === "sources"; return _react2.default.createElement( "div", { className: "toggle-search" }, _react2.default.createElement( "span", { className: (0, _classnames2.default)("text", { active: isSourcesActive }), onClick: toggle }, L10N.getStr("sourceSearch.search") ), _react2.default.createElement( "span", { className: (0, _classnames2.default)("text", { active: !isSourcesActive }), onClick: toggle }, L10N.getStr("projectTextSearch.placeholder") ) ); } } exports.default = ToggleSearch; ToggleSearch.propTypes = { kind: _react.PropTypes.string.isRequired, toggle: _react.PropTypes.func.isRequired }; /***/ }), /* 285 */, /* 286 */, /* 287 */, /* 288 */, /* 289 */, /* 290 */, /* 291 */, /* 292 */, /* 293 */, /* 294 */, /* 295 */, /* 296 */, /* 297 */ /***/ (function(module, exports, __webpack_require__) { var castPath = __webpack_require__(69), isArguments = __webpack_require__(208), isArray = __webpack_require__(70), isIndex = __webpack_require__(117), isLength = __webpack_require__(214), toKey = __webpack_require__(111); /** * Checks if `path` exists on `object`. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @param {Function} hasFunc The function to check properties. * @returns {boolean} Returns `true` if `path` exists, else `false`. */ function hasPath(object, path, hasFunc) { path = castPath(path, object); var index = -1, length = path.length, result = false; while (++index < length) { var key = toKey(path[index]); if (!(result = object != null && hasFunc(object, key))) { break; } object = object[key]; } if (result || ++index != length) { return result; } length = object == null ? 0 : object.length; return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object)); } module.exports = hasPath; /***/ }), /* 298 */, /* 299 */, /* 300 */, /* 301 */, /* 302 */, /* 303 */, /* 304 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(84), isSymbol = __webpack_require__(72); /** Used as references for various `Number` constants. */ var NAN = 0 / 0; /** Used to match leading and trailing whitespace. */ var reTrim = /^\s+|\s+$/g; /** Used to detect bad signed hexadecimal string values. */ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; /** Used to detect binary string values. */ var reIsBinary = /^0b[01]+$/i; /** Used to detect octal string values. */ var reIsOctal = /^0o[0-7]+$/i; /** Built-in method references without a dependency on `root`. */ var freeParseInt = parseInt; /** * Converts `value` to a number. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to process. * @returns {number} Returns the number. * @example * * _.toNumber(3.2); * // => 3.2 * * _.toNumber(Number.MIN_VALUE); * // => 5e-324 * * _.toNumber(Infinity); * // => Infinity * * _.toNumber('3.2'); * // => 3.2 */ function toNumber(value) { if (typeof value == 'number') { return value; } if (isSymbol(value)) { return NAN; } if (isObject(value)) { var other = typeof value.valueOf == 'function' ? value.valueOf() : value; value = isObject(other) ? (other + '') : other; } if (typeof value != 'string') { return value === 0 ? value : +value; } value = value.replace(reTrim, ''); var isBinary = reIsBinary.test(value); return (isBinary || reIsOctal.test(value)) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : (reIsBadHex.test(value) ? NAN : +value); } module.exports = toNumber; /***/ }), /* 305 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // Dependencies var React = __webpack_require__(0); var _require = __webpack_require__(927), wrapRender = _require.wrapRender; var _require2 = __webpack_require__(925), MODE = _require2.MODE; // Shortcuts var span = React.DOM.span; /** * Renders an object. An object is represented by a list of its * properties enclosed in curly brackets. */ Accessor.propTypes = { object: React.PropTypes.object.isRequired, mode: React.PropTypes.oneOf(Object.values(MODE)) }; function Accessor(props) { var object = props.object; var accessors = []; if (hasGetter(object)) { accessors.push("Getter"); } if (hasSetter(object)) { accessors.push("Setter"); } var title = accessors.join(" & "); return span({ className: "objectBox objectBox-accessor" }, span({ className: "objectTitle" }, title)); } function hasGetter(object) { return object && object.get && object.get.type !== "undefined"; } function hasSetter(object) { return object && object.set && object.set.type !== "undefined"; } function supportsObject(object) { var noGrip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (noGrip !== true && (hasGetter(object) || hasSetter(object))) { return true; } return false; } // Exports from this module module.exports = { rep: wrapRender(Accessor), supportsObject }; /***/ }), /* 306 */, /* 307 */ /***/ (function(module, exports, __webpack_require__) { var baseHas = __webpack_require__(308), hasPath = __webpack_require__(297); /** * Checks if `path` is a direct property of `object`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * * var object = { 'a': { 'b': 2 } }; * var other = _.create({ 'a': _.create({ 'b': 2 }) }); * * _.has(object, 'a'); * // => true * * _.has(object, 'a.b'); * // => true * * _.has(object, ['a', 'b']); * // => true * * _.has(other, 'a'); * // => false */ function has(object, path) { return object != null && hasPath(object, path, baseHas); } module.exports = has; /***/ }), /* 308 */ /***/ (function(module, exports) { /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * The base implementation of `_.has` without support for deep paths. * * @private * @param {Object} [object] The object to query. * @param {Array|string} key The key to check. * @returns {boolean} Returns `true` if `key` exists, else `false`. */ function baseHas(object, key) { return object != null && hasOwnProperty.call(object, key); } module.exports = baseHas; /***/ }), /* 309 */, /* 310 */, /* 311 */, /* 312 */, /* 313 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _editor = __webpack_require__(257); var _sourceDocuments = __webpack_require__(260); class DebugLine extends _react.Component { constructor() { super(); this.state = { debugExpression: { clear: () => {} } }; } componentWillMount() { this.setDebugLine(this.props.selectedFrame, this.props.selectedLocation, this.props.editor); } componentWillReceiveProps(nextProps) { this.clearDebugLine(this.props.selectedFrame, this.props.editor); this.setDebugLine(nextProps.selectedFrame, nextProps.selectedLocation, nextProps.editor); } componentWillUnmount() { this.clearDebugLine(this.props.selectedFrame, this.props.editor); } setDebugLine(selectedFrame, selectedLocation, editor) { var location = selectedFrame.location, sourceId = selectedFrame.location.sourceId; var _toEditorPosition = (0, _editor.toEditorPosition)(sourceId, location), line = _toEditorPosition.line, column = _toEditorPosition.column; var doc = (0, _sourceDocuments.getDocument)(sourceId); if (!doc) { return; } doc.addLineClass(line, "line", "new-debug-line"); var debugExpression = (0, _editor.markText)(editor, "debug-expression", { start: { line, column }, end: { line, column: null } }); this.setState({ debugExpression }); } clearDebugLine(selectedFrame, editor) { var _selectedFrame$locati = selectedFrame.location, line = _selectedFrame$locati.line, sourceId = _selectedFrame$locati.sourceId; var debugExpression = this.state.debugExpression; if (debugExpression) { debugExpression.clear(); } var editorLine = line - 1; var doc = (0, _sourceDocuments.getDocument)(sourceId); if (!doc) { return; } doc.removeLineClass(editorLine, "line", "new-debug-line"); } render() { return null; } } exports.default = DebugLine; /***/ }), /* 314 */, /* 315 */, /* 316 */, /* 317 */, /* 318 */, /* 319 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _getScopeBindings = (() => { var _ref = _asyncToGenerator(function* (_ref2, generatedLocation, scopes) { var dispatch = _ref2.dispatch, getState = _ref2.getState, sourceMaps = _ref2.sourceMaps; var sourceId = generatedLocation.sourceId; yield dispatch((0, _sources.ensureParserHasSourceText)(sourceId)); return yield (0, _pause.updateScopeBindings)(scopes, generatedLocation, sourceMaps); }); return function _getScopeBindings(_x, _x2, _x3) { return _ref.apply(this, arguments); }; })(); /** * Redux actions for the pause state * @module actions/pause */ /** * Debugger has just resumed * * @memberof actions/pause * @static */ exports.resumed = resumed; exports.continueToHere = continueToHere; exports.paused = paused; exports.pauseOnExceptions = pauseOnExceptions; exports.command = command; exports.stepIn = stepIn; exports.stepOver = stepOver; exports.stepOut = stepOut; exports.resume = resume; exports.breakOnNext = breakOnNext; exports.selectFrame = selectFrame; exports.loadObjectProperties = loadObjectProperties; exports.astCommand = astCommand; var _sources = __webpack_require__(254); var _promise = __webpack_require__(193); var _selectors = __webpack_require__(242); var _pause = __webpack_require__(255); var _expressions = __webpack_require__(252); var _breakpoints = __webpack_require__(245); var _breakpoints2 = __webpack_require__(236); var _parser = __webpack_require__(827); var parser = _interopRequireWildcard(_parser); var _prefs = __webpack_require__(226); var _devtoolsSourceMap = __webpack_require__(898); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } function resumed() { return (_ref3) => { var dispatch = _ref3.dispatch, client = _ref3.client, getState = _ref3.getState; if (!(0, _selectors.isPaused)(getState())) { return; } dispatch({ type: "RESUME", value: undefined }); if (!(0, _selectors.isStepping)(getState())) { dispatch((0, _expressions.evaluateExpressions)()); } }; } function continueToHere(line) { return (() => { var _ref4 = _asyncToGenerator(function* (_ref5) { var dispatch = _ref5.dispatch, getState = _ref5.getState, client = _ref5.client, sourceMaps = _ref5.sourceMaps; var source = (0, _selectors.getSelectedSource)(getState()).toJS(); yield dispatch((0, _breakpoints.addHiddenBreakpoint)({ line, column: undefined, sourceId: source.id })); dispatch(command("resume")); }); return function (_x4) { return _ref4.apply(this, arguments); }; })(); } /** * Debugger has just paused * * @param {object} pauseInfo * @memberof actions/pause * @static */ function paused(pauseInfo) { return (() => { var _ref6 = _asyncToGenerator(function* (_ref7) { var dispatch = _ref7.dispatch, getState = _ref7.getState, client = _ref7.client, sourceMaps = _ref7.sourceMaps; var frames = pauseInfo.frames, why = pauseInfo.why, loadedObjects = pauseInfo.loadedObjects; frames = yield (0, _pause.updateFrameLocations)(frames, sourceMaps); var frame = frames[0]; var frameScopes = yield client.getFrameScopes(frame); var scopes = !(0, _devtoolsSourceMap.isGeneratedId)(frame.location.sourceId) ? yield _getScopeBindings({ dispatch, getState, sourceMaps }, frame.generatedLocation, frameScopes) : frameScopes; dispatch({ type: "PAUSED", pauseInfo: { why, frame, frames }, frames: frames, scopes, selectedFrameId: frame.id, loadedObjects: loadedObjects || [] }); var hiddenBreakpointLocation = (0, _breakpoints2.getHiddenBreakpointLocation)(getState()); if (hiddenBreakpointLocation) { dispatch((0, _breakpoints.removeBreakpoint)(hiddenBreakpointLocation)); } dispatch((0, _expressions.evaluateExpressions)()); dispatch((0, _sources.selectSource)(frame.location.sourceId, { line: frame.location.line })); }); return function (_x5) { return _ref6.apply(this, arguments); }; })(); } /** * * @memberof actions/pause * @static */ function pauseOnExceptions(shouldPauseOnExceptions, shouldIgnoreCaughtExceptions) { return (_ref8) => { var dispatch = _ref8.dispatch, client = _ref8.client; dispatch({ type: "PAUSE_ON_EXCEPTIONS", shouldPauseOnExceptions, shouldIgnoreCaughtExceptions, [_promise.PROMISE]: client.pauseOnExceptions(shouldPauseOnExceptions, shouldIgnoreCaughtExceptions) }); }; } /** * Debugger commands like stepOver, stepIn, stepUp * * @param string $0.type * @memberof actions/pause * @static */ function command(type) { return (() => { var _ref9 = _asyncToGenerator(function* (_ref10) { var dispatch = _ref10.dispatch, client = _ref10.client; // execute debugger thread command e.g. stepIn, stepOver dispatch({ type: "COMMAND", value: { type } }); yield client[type](); dispatch({ type: "CLEAR_COMMAND" }); }); return function (_x6) { return _ref9.apply(this, arguments); }; })(); } /** * StepIn * @memberof actions/pause * @static * @returns {Function} {@link command} */ function stepIn() { return (_ref11) => { var dispatch = _ref11.dispatch, getState = _ref11.getState; if ((0, _selectors.getPause)(getState())) { return dispatch(command("stepIn")); } }; } /** * stepOver * @memberof actions/pause * @static * @returns {Function} {@link command} */ function stepOver() { return (_ref12) => { var dispatch = _ref12.dispatch, getState = _ref12.getState; if ((0, _selectors.getPause)(getState())) { return dispatch(astCommand("stepOver")); } }; } /** * stepOut * @memberof actions/pause * @static * @returns {Function} {@link command} */ function stepOut() { return (_ref13) => { var dispatch = _ref13.dispatch, getState = _ref13.getState; if ((0, _selectors.getPause)(getState())) { return dispatch(command("stepOut")); } }; } /** * resume * @memberof actions/pause * @static * @returns {Function} {@link command} */ function resume() { return (_ref14) => { var dispatch = _ref14.dispatch, getState = _ref14.getState; if ((0, _selectors.getPause)(getState())) { return dispatch(command("resume")); } }; } /** * Debugger breakOnNext command. * It's different from the comand action because we also want to * highlight the pause icon. * * @memberof actions/pause * @static */ function breakOnNext() { return (_ref15) => { var dispatch = _ref15.dispatch, client = _ref15.client; client.breakOnNext(); return dispatch({ type: "BREAK_ON_NEXT", value: true }); }; } /** * @memberof actions/pause * @static */ function selectFrame(frame) { return (() => { var _ref16 = _asyncToGenerator(function* (_ref17) { var dispatch = _ref17.dispatch, client = _ref17.client, getState = _ref17.getState, sourceMaps = _ref17.sourceMaps; var frameScopes = yield client.getFrameScopes(frame); var scopes = !(0, _devtoolsSourceMap.isGeneratedId)(frame.location.sourceId) ? yield _getScopeBindings({ dispatch, getState, sourceMaps }, frame.generatedLocation, frameScopes) : frameScopes; dispatch({ type: "SELECT_FRAME", frame, scopes }); dispatch((0, _sources.selectSource)(frame.location.sourceId, { line: frame.location.line })); dispatch((0, _expressions.evaluateExpressions)()); }); return function (_x7) { return _ref16.apply(this, arguments); }; })(); } /** * @memberof actions/pause * @static */ function loadObjectProperties(object) { return (_ref18) => { var dispatch = _ref18.dispatch, client = _ref18.client, getState = _ref18.getState; var objectId = object.actor || object.objectId; if ((0, _selectors.getLoadedObject)(getState(), objectId)) { return; } dispatch({ type: "LOAD_OBJECT_PROPERTIES", objectId, [_promise.PROMISE]: client.getProperties(object) }); }; } /** * @memberOf actions/pause * @static * @param stepType * @returns {function(ThunkArgs)} */ function astCommand(stepType) { return (() => { var _ref19 = _asyncToGenerator(function* (_ref20) { var dispatch = _ref20.dispatch, getState = _ref20.getState, sourceMaps = _ref20.sourceMaps; if (!_prefs.features.asyncStepping) { return dispatch(command(stepType)); } var pauseInfo = (0, _selectors.getPause)(getState()); var source = (0, _selectors.getSelectedSource)(getState()).toJS(); var pausedPosition = yield (0, _pause.getPausedPosition)(pauseInfo, sourceMaps); if (stepType == "stepOver") { var nextLocation = yield parser.getNextStep(source, pausedPosition); if (nextLocation) { yield dispatch((0, _breakpoints.addHiddenBreakpoint)(nextLocation)); return dispatch(command("resume")); } } return dispatch(command(stepType)); }); return function (_x8) { return _ref19.apply(this, arguments); }; })(); } /***/ }), /* 320 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.willNavigate = willNavigate; exports.navigate = navigate; exports.connect = connect; exports.navigated = navigated; var _editor = __webpack_require__(257); var _sources = __webpack_require__(232); var _utils = __webpack_require__(234); var _sources2 = __webpack_require__(254); var _parser = __webpack_require__(827); var _wasm = __webpack_require__(23); function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /** * Redux actions for the navigation state * @module actions/navigation */ /** * @memberof actions/navigation * @static */ function willNavigate(_, event) { return (() => { var _ref = _asyncToGenerator(function* (_ref2) { var dispatch = _ref2.dispatch, getState = _ref2.getState, client = _ref2.client, sourceMaps = _ref2.sourceMaps; yield sourceMaps.clearSourceMaps(); (0, _wasm.clearWasmStates)(); (0, _editor.clearDocuments)(); (0, _parser.clearSymbols)(); (0, _parser.clearASTs)(); (0, _parser.clearScopes)(); (0, _parser.clearSources)(); dispatch(navigate(event.url)); }); return function (_x) { return _ref.apply(this, arguments); }; })(); } function navigate(url) { return { type: "NAVIGATE", url }; } function connect(url) { return { type: "CONNECT", url }; } /** * @memberof actions/navigation * @static */ function navigated() { return (() => { var _ref3 = _asyncToGenerator(function* (_ref4) { var dispatch = _ref4.dispatch, getState = _ref4.getState, client = _ref4.client; yield (0, _utils.waitForMs)(100); if ((0, _sources.getSources)(getState()).size == 0) { var sources = yield client.fetchSources(); dispatch((0, _sources2.newSources)(sources)); } }); return function (_x2) { return _ref3.apply(this, arguments); }; })(); } /***/ }), /* 321 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.closeActiveSearch = closeActiveSearch; exports.setActiveSearch = setActiveSearch; exports.toggleFrameworkGrouping = toggleFrameworkGrouping; exports.setSelectedSymbolType = setSelectedSymbolType; exports.setFileSearchQuery = setFileSearchQuery; exports.updateSearchResults = updateSearchResults; exports.toggleFileSearchModifier = toggleFileSearchModifier; exports.showSource = showSource; exports.togglePaneCollapse = togglePaneCollapse; exports.highlightLineRange = highlightLineRange; exports.clearHighlightLineRange = clearHighlightLineRange; exports.toggleConditionalBreakpointPanel = toggleConditionalBreakpointPanel; var _selectors = __webpack_require__(242); var _sourceSearch = __webpack_require__(1144); function closeActiveSearch() { return (_ref) => { var getState = _ref.getState, dispatch = _ref.dispatch; var activeSearch = (0, _selectors.getActiveSearch)(getState()); if (activeSearch == "source") { dispatch((0, _sourceSearch.clearSourceSearchQuery)()); } dispatch({ type: "TOGGLE_ACTIVE_SEARCH", value: null }); }; } function setActiveSearch(activeSearch) { return (_ref2) => { var dispatch = _ref2.dispatch, getState = _ref2.getState; var activeSearchState = (0, _selectors.getActiveSearch)(getState()); if (activeSearchState === activeSearch) { return; } dispatch({ type: "TOGGLE_ACTIVE_SEARCH", value: activeSearch }); }; } function toggleFrameworkGrouping(toggleValue) { return (_ref3) => { var dispatch = _ref3.dispatch, getState = _ref3.getState; dispatch({ type: "TOGGLE_FRAMEWORK_GROUPING", value: toggleValue }); }; } function setSelectedSymbolType(symbolType) { return (_ref4) => { var dispatch = _ref4.dispatch, getState = _ref4.getState; dispatch({ type: "SET_SYMBOL_SEARCH_TYPE", symbolType }); }; } function setFileSearchQuery(query) { return { type: "UPDATE_FILE_SEARCH_QUERY", query }; } function updateSearchResults(results) { return { type: "UPDATE_SEARCH_RESULTS", results }; } function toggleFileSearchModifier(modifier) { return { type: "TOGGLE_FILE_SEARCH_MODIFIER", modifier }; } function showSource(sourceId) { return (_ref5) => { var dispatch = _ref5.dispatch, getState = _ref5.getState; var source = (0, _selectors.getSource)(getState(), sourceId); dispatch({ type: "SHOW_SOURCE", sourceUrl: "" }); dispatch({ type: "SHOW_SOURCE", sourceUrl: source.get("url") }); }; } function togglePaneCollapse(position, paneCollapsed) { return { type: "TOGGLE_PANE", position, paneCollapsed }; } /** * @memberof actions/sources * @static */ function highlightLineRange(location) { return { type: "HIGHLIGHT_LINES", location }; } /** * @memberof actions/sources * @static */ function clearHighlightLineRange() { return { type: "CLEAR_HIGHLIGHT_LINES" }; } function toggleConditionalBreakpointPanel(line) { return { type: "TOGGLE_CONDITIONAL_BREAKPOINT_PANEL", line: line }; } /***/ }), /* 322 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.recordCoverage = recordCoverage; function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } function recordCoverage() { return (() => { var _ref = _asyncToGenerator(function* (_ref2) { var dispatch = _ref2.dispatch, getState = _ref2.getState, client = _ref2.client; var _ref3 = yield client.recordCoverage(), coverage = _ref3.coverage; return dispatch({ type: "RECORD_COVERAGE", value: { coverage } }); }); return function (_x) { return _ref.apply(this, arguments); }; })(); } /***/ }), /* 323 */, /* 324 */, /* 325 */, /* 326 */, /* 327 */, /* 328 */, /* 329 */, /* 330 */, /* 331 */, /* 332 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Modal = undefined; exports.default = Slide; var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _Transition = __webpack_require__(333); var _Transition2 = _interopRequireDefault(_Transition); __webpack_require__(952); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class Modal extends _react.Component { constructor(props) { super(props); var self = this; self.onClick = this.onClick.bind(this); } onClick(e) { e.stopPropagation(); } render() { var status = this.props.status; return _react2.default.createElement( "div", { className: "modal-wrapper", onClick: this.props.handleClose }, _react2.default.createElement( "div", { className: (0, _classnames2.default)("modal", this.props.additionalClass, status), onClick: this.onClick }, this.props.children ) ); } } exports.Modal = Modal; Modal.contextTypes = { shortcuts: _react.PropTypes.object }; function Slide(_ref) { var inProp = _ref.in, children = _ref.children, additionalClass = _ref.additionalClass, handleClose = _ref.handleClose; return _react2.default.createElement( _Transition2.default, { "in": inProp, timeout: 175, appear: true }, status => _react2.default.createElement( Modal, { status: status, additionalClass: additionalClass, handleClose: handleClose }, children ) ); } /***/ }), /* 333 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.EXITING = exports.ENTERED = exports.ENTERING = exports.EXITED = exports.UNMOUNTED = undefined; var _propTypes = __webpack_require__(20); var PropTypes = _interopRequireWildcard(_propTypes); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactDom = __webpack_require__(4); var _reactDom2 = _interopRequireDefault(_reactDom); var _PropTypes = __webpack_require__(335); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var UNMOUNTED = exports.UNMOUNTED = 'unmounted'; var EXITED = exports.EXITED = 'exited'; var ENTERING = exports.ENTERING = 'entering'; var ENTERED = exports.ENTERED = 'entered'; var EXITING = exports.EXITING = 'exiting'; /** * The Transition component lets you describe a transition from one component * state to another _over time_ with a simple declarative API. Most commonly * it's used to animate the mounting and unmounting of a component, but can also * be used to describe in-place transition states as well. * * By default the `Transition` component does not alter the behavior of the * component it renders, it only tracks "enter" and "exit" states for the components. * It's up to you to give meaning and effect to those states. For example we can * add styles to a component when it enters or exits: * * ```jsx * import Transition from 'react-transition-group/Transition'; * * const duration = 300; * * const defaultStyle = { * transition: `opacity ${duration}ms ease-in-out`, * opacity: 0, * } * * const transitionStyles = { * entering: { opacity: 0 }, * entered: { opacity: 1 }, * }; * * const Fade = ({ in: inProp }) => ( * * {(state) => ( *
* I'm A fade Transition! *
* )} *
* ); * ``` * * As noted the `Transition` component doesn't _do_ anything by itself to its child component. * What it does do is track transition states over time so you can update the * component (such as by adding styles or classes) when it changes states. * * There are 4 main states a Transition can be in: * - `ENTERING` * - `ENTERED` * - `EXITING` * - `EXITED` * * Transition state is toggled via the `in` prop. When `true` the component begins the * "Enter" stage. During this stage, the component will shift from its current transition state, * to `'entering'` for the duration of the transition and then to the `'entered'` stage once * it's complete. Let's take the following example: * * ```jsx * state= { in: false }; * * toggleEnterState = () => { * this.setState({ in: true }); * } * * render() { * return ( *
* * *
* ); * } * ``` * * When the button is clicked the component will shift to the `'entering'` state and * stay there for 500ms (the value of `timeout`) when finally switches to `'entered'`. * * When `in` is `false` the same thing happens except the state moves from `'exiting'` to `'exited'`. */ var Transition = function (_React$Component) { _inherits(Transition, _React$Component); function Transition(props, context) { _classCallCheck(this, Transition); var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context)); var parentGroup = context.transitionGroup; // In the context of a TransitionGroup all enters are really appears var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear; var initialStatus = void 0; _this.nextStatus = null; if (props.in) { if (appear) { initialStatus = EXITED; _this.nextStatus = ENTERING; } else { initialStatus = ENTERED; } } else { if (props.unmountOnExit || props.mountOnEnter) { initialStatus = UNMOUNTED; } else { initialStatus = EXITED; } } _this.state = { status: initialStatus }; _this.nextCallback = null; return _this; } Transition.prototype.getChildContext = function getChildContext() { return { transitionGroup: null }; // allows for nested Transitions }; Transition.prototype.componentDidMount = function componentDidMount() { this.updateStatus(true); }; Transition.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { var _ref = this.pendingState || this.state, status = _ref.status; if (nextProps.in) { if (status === UNMOUNTED) { this.setState({ status: EXITED }); } if (status !== ENTERING && status !== ENTERED) { this.nextStatus = ENTERING; } } else { if (status === ENTERING || status === ENTERED) { this.nextStatus = EXITING; } } }; Transition.prototype.componentDidUpdate = function componentDidUpdate() { this.updateStatus(); }; Transition.prototype.componentWillUnmount = function componentWillUnmount() { this.cancelNextCallback(); }; Transition.prototype.getTimeouts = function getTimeouts() { var timeout = this.props.timeout; var exit = void 0, enter = void 0, appear = void 0; exit = enter = appear = timeout; if (timeout != null && typeof timeout !== 'number') { exit = timeout.exit; enter = timeout.enter; appear = timeout.appear; } return { exit: exit, enter: enter, appear: appear }; }; Transition.prototype.updateStatus = function updateStatus() { var mounting = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; var nextStatus = this.nextStatus; if (nextStatus !== null) { this.nextStatus = null; // nextStatus will always be ENTERING or EXITING. this.cancelNextCallback(); var node = _reactDom2.default.findDOMNode(this); if (nextStatus === ENTERING) { this.performEnter(node, mounting); } else { this.performExit(node); } } else if (this.props.unmountOnExit && this.state.status === EXITED) { this.setState({ status: UNMOUNTED }); } }; Transition.prototype.performEnter = function performEnter(node, mounting) { var _this2 = this; var enter = this.props.enter; var appearing = this.context.transitionGroup ? this.context.transitionGroup.isMounting : mounting; var timeouts = this.getTimeouts(); // no enter animation skip right to ENTERED // if we are mounting and running this it means appear _must_ be set if (!mounting && !enter) { this.safeSetState({ status: ENTERED }, function () { _this2.props.onEntered(node); }); return; } this.props.onEnter(node, appearing); this.safeSetState({ status: ENTERING }, function () { _this2.props.onEntering(node, appearing); // FIXME: appear timeout? _this2.onTransitionEnd(node, timeouts.enter, function () { _this2.safeSetState({ status: ENTERED }, function () { _this2.props.onEntered(node, appearing); }); }); }); }; Transition.prototype.performExit = function performExit(node) { var _this3 = this; var exit = this.props.exit; var timeouts = this.getTimeouts(); // no exit animation skip right to EXITED if (!exit) { this.safeSetState({ status: EXITED }, function () { _this3.props.onExited(node); }); return; } this.props.onExit(node); this.safeSetState({ status: EXITING }, function () { _this3.props.onExiting(node); _this3.onTransitionEnd(node, timeouts.exit, function () { _this3.safeSetState({ status: EXITED }, function () { _this3.props.onExited(node); }); }); }); }; Transition.prototype.cancelNextCallback = function cancelNextCallback() { if (this.nextCallback !== null) { this.nextCallback.cancel(); this.nextCallback = null; } }; Transition.prototype.safeSetState = function safeSetState(nextState, callback) { var _this4 = this; // We need to track pending updates for instances where a cWRP fires quickly // after cDM and before the state flushes, which would double trigger a // transition this.pendingState = nextState; // This shouldn't be necessary, but there are weird race conditions with // setState callbacks and unmounting in testing, so always make sure that // we can cancel any pending setState callbacks after we unmount. callback = this.setNextCallback(callback); this.setState(nextState, function () { _this4.pendingState = null; callback(); }); }; Transition.prototype.setNextCallback = function setNextCallback(callback) { var _this5 = this; var active = true; this.nextCallback = function (event) { if (active) { active = false; _this5.nextCallback = null; callback(event); } }; this.nextCallback.cancel = function () { active = false; }; return this.nextCallback; }; Transition.prototype.onTransitionEnd = function onTransitionEnd(node, timeout, handler) { this.setNextCallback(handler); if (node) { if (this.props.addEndListener) { this.props.addEndListener(node, this.nextCallback); } if (timeout != null) { setTimeout(this.nextCallback, timeout); } } else { setTimeout(this.nextCallback, 0); } }; Transition.prototype.render = function render() { var status = this.state.status; if (status === UNMOUNTED) { return null; } var _props = this.props, children = _props.children, childProps = _objectWithoutProperties(_props, ['children']); // filter props for Transtition delete childProps.in; delete childProps.mountOnEnter; delete childProps.unmountOnExit; delete childProps.appear; delete childProps.enter; delete childProps.exit; delete childProps.timeout; delete childProps.addEndListener; delete childProps.onEnter; delete childProps.onEntering; delete childProps.onEntered; delete childProps.onExit; delete childProps.onExiting; delete childProps.onExited; if (typeof children === 'function') { return children(status, childProps); } var child = _react2.default.Children.only(children); return _react2.default.cloneElement(child, childProps); }; return Transition; }(_react2.default.Component); Transition.contextTypes = { transitionGroup: PropTypes.object }; Transition.childContextTypes = { transitionGroup: function transitionGroup() {} }; Transition.propTypes = false ? { /** * A `function` child can be used instead of a React element. * This function is called with the current transition status * ('entering', 'entered', 'exiting', 'exited', 'unmounted'), which can used * to apply context specific props to a component. * * ```jsx * * {(status) => ( * * )} * * ``` */ children: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired, /** * Show the component; triggers the enter or exit states */ in: PropTypes.bool, /** * By default the child component is mounted immediately along with * the parent `Transition` component. If you want to "lazy mount" the component on the * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay * mounted, even on "exited", unless you also specify `unmountOnExit`. */ mountOnEnter: PropTypes.bool, /** * By default the child component stays mounted after it reaches the `'exited'` state. * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting. */ unmountOnExit: PropTypes.bool, /** * Normally a component is not transitioned if it is shown when the `` component mounts. * If you want to transition on the first mount set `appear` to `true`, and the * component will transition in as soon as the `` mounts. * * > Note: there are no specific "appear" states. `appear` only adds an additional `enter` transition. */ appear: PropTypes.bool, /** * Enable or disable enter transitions. */ enter: PropTypes.bool, /** * Enable or disable exit transitions. */ exit: PropTypes.bool, /** * The duration of the transition, in milliseconds. * Required unless `addEventListener` is provided * * You may specify a single timeout for all transitions like: `timeout={500}`, * or individually like: * * ```jsx * timeout={{ * enter: 300, * exit: 500, * }} * ``` * * @type {number | { enter?: number, exit?: number }} */ timeout: function timeout(props) { for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } var pt = _PropTypes.timeoutsShape; if (!props.addEndListener) pt = pt.isRequired; return pt.apply(undefined, [props].concat(args)); }, /** * Add a custom transition end trigger. Called with the transitioning * DOM node and a `done` callback. Allows for more fine grained transition end * logic. **Note:** Timeouts are still used as a fallback if provided. * * ```jsx * addEndListener={(node, done) => { * // use the css transitionend event to mark the finish of a transition * node.addEventListener('transitionend', done, false); * }} * ``` */ addEndListener: PropTypes.func, /** * Callback fired before the "entering" status is applied. An extra parameter * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount * * @type Function(node: HtmlElement, isAppearing: bool) -> void */ onEnter: PropTypes.func, /** * Callback fired after the "entering" status is applied. An extra parameter * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount * * @type Function(node: HtmlElement, isAppearing: bool) */ onEntering: PropTypes.func, /** * Callback fired after the "entered" status is applied. An extra parameter * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount * * @type Function(node: HtmlElement, isAppearing: bool) -> void */ onEntered: PropTypes.func, /** * Callback fired before the "exiting" status is applied. * * @type Function(node: HtmlElement) -> void */ onExit: PropTypes.func, /** * Callback fired after the "exiting" status is applied. * * @type Function(node: HtmlElement) -> void */ onExiting: PropTypes.func, /** * Callback fired after the "exited" status is applied. * * @type Function(node: HtmlElement) -> void */ onExited: PropTypes.func } : {}; // Name the function so it is clearer in the documentation function noop() {} Transition.defaultProps = { in: false, mountOnEnter: false, unmountOnExit: false, appear: false, enter: true, exit: true, onEnter: noop, onEntering: noop, onEntered: noop, onExit: noop, onExiting: noop, onExited: noop }; Transition.UNMOUNTED = 0; Transition.EXITED = 1; Transition.ENTERING = 2; Transition.ENTERED = 3; Transition.EXITING = 4; exports.default = Transition; /***/ }), /* 334 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. var punycode = __webpack_require__(916); var util = __webpack_require__(336); exports.parse = urlParse; exports.resolve = urlResolve; exports.resolveObject = urlResolveObject; exports.format = urlFormat; exports.Url = Url; function Url() { this.protocol = null; this.slashes = null; this.auth = null; this.host = null; this.port = null; this.hostname = null; this.hash = null; this.search = null; this.query = null; this.pathname = null; this.path = null; this.href = null; } // Reference: RFC 3986, RFC 1808, RFC 2396 // define these here so at least they only have to be // compiled once on the first module load. var protocolPattern = /^([a-z0-9.+-]+:)/i, portPattern = /:[0-9]*$/, // Special case for a simple path URL simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, // RFC 2396: characters reserved for delimiting URLs. // We actually just auto-escape these. delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'], // RFC 2396: characters not allowed for various reasons. unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims), // Allowed by RFCs, but cause of XSS attacks. Always escape these. autoEscape = ['\''].concat(unwise), // Characters that are never ever allowed in a hostname. // Note that any invalid chars are also handled, but these // are the ones that are *expected* to be seen, so we fast-path // them. nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape), hostEndingChars = ['/', '?', '#'], hostnameMaxLen = 255, hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, // protocols that can allow "unsafe" and "unwise" chars. unsafeProtocol = { 'javascript': true, 'javascript:': true }, // protocols that never have a hostname. hostlessProtocol = { 'javascript': true, 'javascript:': true }, // protocols that always contain a // bit. slashedProtocol = { 'http': true, 'https': true, 'ftp': true, 'gopher': true, 'file': true, 'http:': true, 'https:': true, 'ftp:': true, 'gopher:': true, 'file:': true }, querystring = __webpack_require__(66); function urlParse(url, parseQueryString, slashesDenoteHost) { if (url && util.isObject(url) && url instanceof Url) return url; var u = new Url; u.parse(url, parseQueryString, slashesDenoteHost); return u; } Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { if (!util.isString(url)) { throw new TypeError("Parameter 'url' must be a string, not " + typeof url); } // Copy chrome, IE, opera backslash-handling behavior. // Back slashes before the query string get converted to forward slashes // See: https://code.google.com/p/chromium/issues/detail?id=25916 var queryIndex = url.indexOf('?'), splitter = (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#', uSplit = url.split(splitter), slashRegex = /\\/g; uSplit[0] = uSplit[0].replace(slashRegex, '/'); url = uSplit.join(splitter); var rest = url; // trim before proceeding. // This is to support parse stuff like " http://foo.com \n" rest = rest.trim(); if (!slashesDenoteHost && url.split('#').length === 1) { // Try fast path regexp var simplePath = simplePathPattern.exec(rest); if (simplePath) { this.path = rest; this.href = rest; this.pathname = simplePath[1]; if (simplePath[2]) { this.search = simplePath[2]; if (parseQueryString) { this.query = querystring.parse(this.search.substr(1)); } else { this.query = this.search.substr(1); } } else if (parseQueryString) { this.search = ''; this.query = {}; } return this; } } var proto = protocolPattern.exec(rest); if (proto) { proto = proto[0]; var lowerProto = proto.toLowerCase(); this.protocol = lowerProto; rest = rest.substr(proto.length); } // figure out if it's got a host // user@server is *always* interpreted as a hostname, and url // resolution will treat //foo/bar as host=foo,path=bar because that's // how the browser resolves relative URLs. if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { var slashes = rest.substr(0, 2) === '//'; if (slashes && !(proto && hostlessProtocol[proto])) { rest = rest.substr(2); this.slashes = true; } } if (!hostlessProtocol[proto] && (slashes || (proto && !slashedProtocol[proto]))) { // there's a hostname. // the first instance of /, ?, ;, or # ends the host. // // If there is an @ in the hostname, then non-host chars *are* allowed // to the left of the last @ sign, unless some host-ending character // comes *before* the @-sign. // URLs are obnoxious. // // ex: // http://a@b@c/ => user:a@b host:c // http://a@b?@c => user:a host:c path:/?@c // v0.12 TODO(isaacs): This is not quite how Chrome does things. // Review our test case against browsers more comprehensively. // find the first instance of any hostEndingChars var hostEnd = -1; for (var i = 0; i < hostEndingChars.length; i++) { var hec = rest.indexOf(hostEndingChars[i]); if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) hostEnd = hec; } // at this point, either we have an explicit point where the // auth portion cannot go past, or the last @ char is the decider. var auth, atSign; if (hostEnd === -1) { // atSign can be anywhere. atSign = rest.lastIndexOf('@'); } else { // atSign must be in auth portion. // http://a@b/c@d => host:b auth:a path:/c@d atSign = rest.lastIndexOf('@', hostEnd); } // Now we have a portion which is definitely the auth. // Pull that off. if (atSign !== -1) { auth = rest.slice(0, atSign); rest = rest.slice(atSign + 1); this.auth = decodeURIComponent(auth); } // the host is the remaining to the left of the first non-host char hostEnd = -1; for (var i = 0; i < nonHostChars.length; i++) { var hec = rest.indexOf(nonHostChars[i]); if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) hostEnd = hec; } // if we still have not hit it, then the entire thing is a host. if (hostEnd === -1) hostEnd = rest.length; this.host = rest.slice(0, hostEnd); rest = rest.slice(hostEnd); // pull out port. this.parseHost(); // we've indicated that there is a hostname, // so even if it's empty, it has to be present. this.hostname = this.hostname || ''; // if hostname begins with [ and ends with ] // assume that it's an IPv6 address. var ipv6Hostname = this.hostname[0] === '[' && this.hostname[this.hostname.length - 1] === ']'; // validate a little. if (!ipv6Hostname) { var hostparts = this.hostname.split(/\./); for (var i = 0, l = hostparts.length; i < l; i++) { var part = hostparts[i]; if (!part) continue; if (!part.match(hostnamePartPattern)) { var newpart = ''; for (var j = 0, k = part.length; j < k; j++) { if (part.charCodeAt(j) > 127) { // we replace non-ASCII char with a temporary placeholder // we need this to make sure size of hostname is not // broken by replacing non-ASCII by nothing newpart += 'x'; } else { newpart += part[j]; } } // we test again with ASCII char only if (!newpart.match(hostnamePartPattern)) { var validParts = hostparts.slice(0, i); var notHost = hostparts.slice(i + 1); var bit = part.match(hostnamePartStart); if (bit) { validParts.push(bit[1]); notHost.unshift(bit[2]); } if (notHost.length) { rest = '/' + notHost.join('.') + rest; } this.hostname = validParts.join('.'); break; } } } } if (this.hostname.length > hostnameMaxLen) { this.hostname = ''; } else { // hostnames are always lower case. this.hostname = this.hostname.toLowerCase(); } if (!ipv6Hostname) { // IDNA Support: Returns a punycoded representation of "domain". // It only converts parts of the domain name that // have non-ASCII characters, i.e. it doesn't matter if // you call it with a domain that already is ASCII-only. this.hostname = punycode.toASCII(this.hostname); } var p = this.port ? ':' + this.port : ''; var h = this.hostname || ''; this.host = h + p; this.href += this.host; // strip [ and ] from the hostname // the host field still retains them, though if (ipv6Hostname) { this.hostname = this.hostname.substr(1, this.hostname.length - 2); if (rest[0] !== '/') { rest = '/' + rest; } } } // now rest is set to the post-host stuff. // chop off any delim chars. if (!unsafeProtocol[lowerProto]) { // First, make 100% sure that any "autoEscape" chars get // escaped, even if encodeURIComponent doesn't think they // need to be. for (var i = 0, l = autoEscape.length; i < l; i++) { var ae = autoEscape[i]; if (rest.indexOf(ae) === -1) continue; var esc = encodeURIComponent(ae); if (esc === ae) { esc = escape(ae); } rest = rest.split(ae).join(esc); } } // chop off from the tail first. var hash = rest.indexOf('#'); if (hash !== -1) { // got a fragment string. this.hash = rest.substr(hash); rest = rest.slice(0, hash); } var qm = rest.indexOf('?'); if (qm !== -1) { this.search = rest.substr(qm); this.query = rest.substr(qm + 1); if (parseQueryString) { this.query = querystring.parse(this.query); } rest = rest.slice(0, qm); } else if (parseQueryString) { // no query string, but parseQueryString still requested this.search = ''; this.query = {}; } if (rest) this.pathname = rest; if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) { this.pathname = '/'; } //to support http.request if (this.pathname || this.search) { var p = this.pathname || ''; var s = this.search || ''; this.path = p + s; } // finally, reconstruct the href based on what has been validated. this.href = this.format(); return this; }; // format a parsed object into a url string function urlFormat(obj) { // ensure it's an object, and not a string url. // If it's an obj, this is a no-op. // this way, you can call url_format() on strings // to clean up potentially wonky urls. if (util.isString(obj)) obj = urlParse(obj); if (!(obj instanceof Url)) return Url.prototype.format.call(obj); return obj.format(); } Url.prototype.format = function() { var auth = this.auth || ''; if (auth) { auth = encodeURIComponent(auth); auth = auth.replace(/%3A/i, ':'); auth += '@'; } var protocol = this.protocol || '', pathname = this.pathname || '', hash = this.hash || '', host = false, query = ''; if (this.host) { host = auth + this.host; } else if (this.hostname) { host = auth + (this.hostname.indexOf(':') === -1 ? this.hostname : '[' + this.hostname + ']'); if (this.port) { host += ':' + this.port; } } if (this.query && util.isObject(this.query) && Object.keys(this.query).length) { query = querystring.stringify(this.query); } var search = this.search || (query && ('?' + query)) || ''; if (protocol && protocol.substr(-1) !== ':') protocol += ':'; // only the slashedProtocols get the //. Not mailto:, xmpp:, etc. // unless they had them to begin with. if (this.slashes || (!protocol || slashedProtocol[protocol]) && host !== false) { host = '//' + (host || ''); if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname; } else if (!host) { host = ''; } if (hash && hash.charAt(0) !== '#') hash = '#' + hash; if (search && search.charAt(0) !== '?') search = '?' + search; pathname = pathname.replace(/[?#]/g, function(match) { return encodeURIComponent(match); }); search = search.replace('#', '%23'); return protocol + host + pathname + search + hash; }; function urlResolve(source, relative) { return urlParse(source, false, true).resolve(relative); } Url.prototype.resolve = function(relative) { return this.resolveObject(urlParse(relative, false, true)).format(); }; function urlResolveObject(source, relative) { if (!source) return relative; return urlParse(source, false, true).resolveObject(relative); } Url.prototype.resolveObject = function(relative) { if (util.isString(relative)) { var rel = new Url(); rel.parse(relative, false, true); relative = rel; } var result = new Url(); var tkeys = Object.keys(this); for (var tk = 0; tk < tkeys.length; tk++) { var tkey = tkeys[tk]; result[tkey] = this[tkey]; } // hash is always overridden, no matter what. // even href="" will remove it. result.hash = relative.hash; // if the relative url is empty, then there's nothing left to do here. if (relative.href === '') { result.href = result.format(); return result; } // hrefs like //foo/bar always cut to the protocol. if (relative.slashes && !relative.protocol) { // take everything except the protocol from relative var rkeys = Object.keys(relative); for (var rk = 0; rk < rkeys.length; rk++) { var rkey = rkeys[rk]; if (rkey !== 'protocol') result[rkey] = relative[rkey]; } //urlParse appends trailing / to urls like http://www.example.com if (slashedProtocol[result.protocol] && result.hostname && !result.pathname) { result.path = result.pathname = '/'; } result.href = result.format(); return result; } if (relative.protocol && relative.protocol !== result.protocol) { // if it's a known url protocol, then changing // the protocol does weird things // first, if it's not file:, then we MUST have a host, // and if there was a path // to begin with, then we MUST have a path. // if it is file:, then the host is dropped, // because that's known to be hostless. // anything else is assumed to be absolute. if (!slashedProtocol[relative.protocol]) { var keys = Object.keys(relative); for (var v = 0; v < keys.length; v++) { var k = keys[v]; result[k] = relative[k]; } result.href = result.format(); return result; } result.protocol = relative.protocol; if (!relative.host && !hostlessProtocol[relative.protocol]) { var relPath = (relative.pathname || '').split('/'); while (relPath.length && !(relative.host = relPath.shift())); if (!relative.host) relative.host = ''; if (!relative.hostname) relative.hostname = ''; if (relPath[0] !== '') relPath.unshift(''); if (relPath.length < 2) relPath.unshift(''); result.pathname = relPath.join('/'); } else { result.pathname = relative.pathname; } result.search = relative.search; result.query = relative.query; result.host = relative.host || ''; result.auth = relative.auth; result.hostname = relative.hostname || relative.host; result.port = relative.port; // to support http.request if (result.pathname || result.search) { var p = result.pathname || ''; var s = result.search || ''; result.path = p + s; } result.slashes = result.slashes || relative.slashes; result.href = result.format(); return result; } var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'), isRelAbs = ( relative.host || relative.pathname && relative.pathname.charAt(0) === '/' ), mustEndAbs = (isRelAbs || isSourceAbs || (result.host && relative.pathname)), removeAllDots = mustEndAbs, srcPath = result.pathname && result.pathname.split('/') || [], relPath = relative.pathname && relative.pathname.split('/') || [], psychotic = result.protocol && !slashedProtocol[result.protocol]; // if the url is a non-slashed url, then relative // links like ../.. should be able // to crawl up to the hostname, as well. This is strange. // result.protocol has already been set by now. // Later on, put the first path part into the host field. if (psychotic) { result.hostname = ''; result.port = null; if (result.host) { if (srcPath[0] === '') srcPath[0] = result.host; else srcPath.unshift(result.host); } result.host = ''; if (relative.protocol) { relative.hostname = null; relative.port = null; if (relative.host) { if (relPath[0] === '') relPath[0] = relative.host; else relPath.unshift(relative.host); } relative.host = null; } mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === ''); } if (isRelAbs) { // it's absolute. result.host = (relative.host || relative.host === '') ? relative.host : result.host; result.hostname = (relative.hostname || relative.hostname === '') ? relative.hostname : result.hostname; result.search = relative.search; result.query = relative.query; srcPath = relPath; // fall through to the dot-handling below. } else if (relPath.length) { // it's relative // throw away the existing file, and take the new path instead. if (!srcPath) srcPath = []; srcPath.pop(); srcPath = srcPath.concat(relPath); result.search = relative.search; result.query = relative.query; } else if (!util.isNullOrUndefined(relative.search)) { // just pull out the search. // like href='?foo'. // Put this after the other two cases because it simplifies the booleans if (psychotic) { result.hostname = result.host = srcPath.shift(); //occationaly the auth can get stuck only in host //this especially happens in cases like //url.resolveObject('mailto:local1@domain1', 'local2@domain2') var authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false; if (authInHost) { result.auth = authInHost.shift(); result.host = result.hostname = authInHost.shift(); } } result.search = relative.search; result.query = relative.query; //to support http.request if (!util.isNull(result.pathname) || !util.isNull(result.search)) { result.path = (result.pathname ? result.pathname : '') + (result.search ? result.search : ''); } result.href = result.format(); return result; } if (!srcPath.length) { // no path at all. easy. // we've already handled the other stuff above. result.pathname = null; //to support http.request if (result.search) { result.path = '/' + result.search; } else { result.path = null; } result.href = result.format(); return result; } // if a url ENDs in . or .., then it must get a trailing slash. // however, if it ends in anything else non-slashy, // then it must NOT get a trailing slash. var last = srcPath.slice(-1)[0]; var hasTrailingSlash = ( (result.host || relative.host || srcPath.length > 1) && (last === '.' || last === '..') || last === ''); // strip single dots, resolve double dots to parent dir // if the path tries to go above the root, `up` ends up > 0 var up = 0; for (var i = srcPath.length; i >= 0; i--) { last = srcPath[i]; if (last === '.') { srcPath.splice(i, 1); } else if (last === '..') { srcPath.splice(i, 1); up++; } else if (up) { srcPath.splice(i, 1); up--; } } // if the path is allowed to go above the root, restore leading ..s if (!mustEndAbs && !removeAllDots) { for (; up--; up) { srcPath.unshift('..'); } } if (mustEndAbs && srcPath[0] !== '' && (!srcPath[0] || srcPath[0].charAt(0) !== '/')) { srcPath.unshift(''); } if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) { srcPath.push(''); } var isAbsolute = srcPath[0] === '' || (srcPath[0] && srcPath[0].charAt(0) === '/'); // put the host back if (psychotic) { result.hostname = result.host = isAbsolute ? '' : srcPath.length ? srcPath.shift() : ''; //occationaly the auth can get stuck only in host //this especially happens in cases like //url.resolveObject('mailto:local1@domain1', 'local2@domain2') var authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false; if (authInHost) { result.auth = authInHost.shift(); result.host = result.hostname = authInHost.shift(); } } mustEndAbs = mustEndAbs || (result.host && srcPath.length); if (mustEndAbs && !isAbsolute) { srcPath.unshift(''); } if (!srcPath.length) { result.pathname = null; result.path = null; } else { result.pathname = srcPath.join('/'); } //to support request.http if (!util.isNull(result.pathname) || !util.isNull(result.search)) { result.path = (result.pathname ? result.pathname : '') + (result.search ? result.search : ''); } result.auth = relative.auth || result.auth; result.slashes = result.slashes || relative.slashes; result.href = result.format(); return result; }; Url.prototype.parseHost = function() { var host = this.host; var port = portPattern.exec(host); if (port) { port = port[0]; if (port !== ':') { this.port = port.substr(1); } host = host.substr(0, host.length - port.length); } if (host) this.hostname = host; }; /***/ }), /* 335 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.classNamesShape = exports.timeoutsShape = undefined; exports.transitionTimeout = transitionTimeout; var _propTypes = __webpack_require__(20); var _propTypes2 = _interopRequireDefault(_propTypes); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function transitionTimeout(transitionType) { var timeoutPropName = 'transition' + transitionType + 'Timeout'; var enabledPropName = 'transition' + transitionType; return function (props) { // If the transition is enabled if (props[enabledPropName]) { // If no timeout duration is provided if (props[timeoutPropName] == null) { return new Error(timeoutPropName + ' wasn\'t supplied to CSSTransitionGroup: ' + 'this can cause unreliable animations and won\'t be supported in ' + 'a future version of React. See ' + 'https://fb.me/react-animation-transition-group-timeout for more ' + 'information.'); // If the duration isn't a number } else if (typeof props[timeoutPropName] !== 'number') { return new Error(timeoutPropName + ' must be a number (in milliseconds)'); } } return null; }; } var timeoutsShape = exports.timeoutsShape = _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.shape({ enter: _propTypes2.default.number, exit: _propTypes2.default.number }).isRequired]); var classNamesShape = exports.classNamesShape = _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({ enter: _propTypes2.default.string, exit: _propTypes2.default.string, active: _propTypes2.default.string }), _propTypes2.default.shape({ enter: _propTypes2.default.string, enterActive: _propTypes2.default.string, exit: _propTypes2.default.string, exitActive: _propTypes2.default.string })]); /***/ }), /* 336 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = { isString: function(arg) { return typeof(arg) === 'string'; }, isObject: function(arg) { return typeof(arg) === 'object' && arg !== null; }, isNull: function(arg) { return arg === null; }, isNullOrUndefined: function(arg) { return arg == null; } }; /***/ }), /* 337 */, /* 338 */, /* 339 */, /* 340 */, /* 341 */, /* 342 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _fuzzaldrinPlus = __webpack_require__(161); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _resultList = __webpack_require__(343); __webpack_require__(867); var _SearchInput = __webpack_require__(377); var _SearchInput2 = _interopRequireDefault(_SearchInput); var _ResultList = __webpack_require__(383); var _ResultList2 = _interopRequireDefault(_ResultList); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class Autocomplete extends _react.Component { constructor(props) { super(props); this.onKeyDown = this.onKeyDown.bind(this); this.state = { selectedIndex: 0, focused: false }; } componentDidUpdate() { if (this.refs.resultList && this.refs.resultList.refs) { (0, _resultList.scrollList)(this.refs.resultList.refs, this.state.selectedIndex); } } getSearchResults() { var inputValue = this.props.inputValue; if (inputValue == "") { return []; } return (0, _fuzzaldrinPlus.filter)(this.props.items, inputValue, { key: "value" }); } onKeyDown(e) { var searchResults = this.getSearchResults(), resultCount = searchResults.length; if (e.key === "ArrowUp") { var _selectedIndex = Math.max(0, this.state.selectedIndex - 1); this.setState({ selectedIndex: _selectedIndex }); if (this.props.onSelectedItem) { this.props.onSelectedItem(searchResults[_selectedIndex]); } e.preventDefault(); } else if (e.key === "ArrowDown") { var _selectedIndex2 = Math.min(resultCount - 1, this.state.selectedIndex + 1); this.setState({ selectedIndex: _selectedIndex2 }); if (this.props.onSelectedItem) { this.props.onSelectedItem(searchResults[_selectedIndex2]); } e.preventDefault(); } else if (e.key === "Enter") { if (searchResults.length) { this.props.selectItem(e, searchResults[this.state.selectedIndex]); } else { this.props.close(this.props.inputValue); } e.preventDefault(); } else if (e.key === "Tab") { this.props.close(this.props.inputValue); e.preventDefault(); } } renderResults(results) { var size = this.props.size; if (results.length) { var props = { items: results, selected: this.state.selectedIndex, selectItem: this.props.selectItem, close: this.props.close, size, ref: "resultList" }; return _react2.default.createElement(_ResultList2.default, props); } else if (this.props.inputValue && !results.length) { return _react2.default.createElement( "div", { className: "no-result-msg absolute-center" }, L10N.getStr("sourceSearch.noResults2") ); } } render() { var focused = this.state.focused; var _props = this.props, size = _props.size, children = _props.children; var searchResults = this.getSearchResults(); var summaryMsg = L10N.getFormatStr("sourceSearch.resultsSummary1", searchResults.length); var searchProps = { query: this.props.inputValue, count: searchResults.length, placeholder: this.props.placeholder, size, showErrorEmoji: true, summaryMsg, onChange: e => { this.props.onChangeHandler(e.target.value); this.setState({ selectedIndex: 0 }); }, onFocus: () => this.setState({ focused: true }), onBlur: () => this.setState({ focused: false }), onKeyDown: this.onKeyDown, handleClose: this.props.close }; return _react2.default.createElement( "div", { className: (0, _classnames2.default)("autocomplete", { focused }) }, _react2.default.createElement(_SearchInput2.default, searchProps), children, this.renderResults(searchResults) ); } } exports.default = Autocomplete; Autocomplete.defaultProps = { size: "" }; /***/ }), /* 343 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.handleKeyDown = exports.scrollList = undefined; var _devtoolsConfig = __webpack_require__(828); function scrollList(resultList, index) { if (!resultList.hasOwnProperty(index)) { return; } var resultEl = resultList[index]; if ((0, _devtoolsConfig.isFirefox)()) { resultEl.scrollIntoView({ block: "end", behavior: "smooth" }); } else { chromeScrollList(resultEl, index); } } function chromeScrollList(elem, index) { var resultsEl = elem.parentNode; if (!resultsEl || resultsEl.children.length === 0) { return; } var resultsHeight = resultsEl.clientHeight; var itemHeight = resultsEl.children[0].clientHeight; var numVisible = resultsHeight / itemHeight; var positionsToScroll = index - numVisible + 1; var itemOffset = resultsHeight % itemHeight; var scroll = positionsToScroll * (itemHeight + 2) + itemOffset; resultsEl.scrollTop = Math.max(0, scroll); } function handleKeyDown(e) { var searchResults = this.getSearchResults(), resultCount = searchResults.length; if (e.key === "ArrowUp") { var selectedIndex = Math.max(0, this.state.selectedIndex - 1); this.setState({ selectedIndex }); if (this.props.onSelectedItem) { this.props.onSelectedItem(searchResults[selectedIndex]); } e.preventDefault(); } else if (e.key === "ArrowDown") { var _selectedIndex = Math.min(resultCount - 1, this.state.selectedIndex + 1); this.setState({ selectedIndex: _selectedIndex }); if (this.props.onSelectedItem) { this.props.onSelectedItem(searchResults[_selectedIndex]); } e.preventDefault(); } else if (e.key === "Enter") { if (searchResults.length) { this.props.selectItem(searchResults[this.state.selectedIndex]); } else { this.props.close(this.state.inputValue); } e.preventDefault(); } else if (e.key === "Tab") { this.props.close(this.state.inputValue); e.preventDefault(); } } exports.scrollList = scrollList; exports.handleKeyDown = handleKeyDown; /***/ }), /* 344 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _Svg = __webpack_require__(345); var _Svg2 = _interopRequireDefault(_Svg); __webpack_require__(862); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * This file maps the SVG React Components in the assets/images directory. */ exports.default = _Svg2.default; /***/ }), /* 345 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var React = __webpack_require__(0); var InlineSVG = __webpack_require__(346); var _require = __webpack_require__(828), isDevelopment = _require.isDevelopment; var svg = { "angle-brackets": __webpack_require__(347), angular: __webpack_require__(247), arrow: __webpack_require__(348), backbone: __webpack_require__(997), blackBox: __webpack_require__(349), breakpoint: __webpack_require__(350), "column-breakpoint": __webpack_require__(998), "case-match": __webpack_require__(351), close: __webpack_require__(352), dojo: __webpack_require__(806), domain: __webpack_require__(353), file: __webpack_require__(354), folder: __webpack_require__(355), globe: __webpack_require__(356), jquery: __webpack_require__(999), underscore: __webpack_require__(1117), lodash: __webpack_require__(1118), ember: __webpack_require__(1119), vuejs: __webpack_require__(1174), "magnifying-glass": __webpack_require__(357), "arrow-up": __webpack_require__(919), "arrow-down": __webpack_require__(920), pause: __webpack_require__(358), "pause-exceptions": __webpack_require__(359), plus: __webpack_require__(360), prettyPrint: __webpack_require__(361), react: __webpack_require__(1000), "regex-match": __webpack_require__(362), redux: __webpack_require__(256), immutable: __webpack_require__(258), resume: __webpack_require__(363), settings: __webpack_require__(364), stepIn: __webpack_require__(365), stepOut: __webpack_require__(366), stepOver: __webpack_require__(367), subSettings: __webpack_require__(368), toggleBreakpoints: __webpack_require__(369), togglePanes: __webpack_require__(370), "whole-word-match": __webpack_require__(371), worker: __webpack_require__(372), "sad-face": __webpack_require__(373), refresh: __webpack_require__(374), webpack: __webpack_require__(1001), node: __webpack_require__(1002), express: __webpack_require__(1003), pug: __webpack_require__(1004), extjs: __webpack_require__(1043), showSources: __webpack_require__(1044), showOutline: __webpack_require__(1045), shortcut: __webpack_require__(1183) }; function Svg(_ref) { var name = _ref.name, className = _ref.className, onClick = _ref.onClick, ariaLabel = _ref["aria-label"]; if (!svg[name]) { var error = `Unknown SVG: ${name}`; if (isDevelopment()) { throw new Error(error); } console.warn(error); return; } className = `${name} ${className || ""}`; if (name === "subSettings") { className = ""; } var props = { className, onClick, ["aria-label"]: ariaLabel, src: svg[name] }; return React.createElement(InlineSVG, props); } Svg.displayName = "Svg"; module.exports = Svg; /***/ }), /* 346 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, '__esModule', { value: 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; }; var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var DOMParser = typeof window !== 'undefined' && window.DOMParser; var process = process || {}; process.env = process.env || {}; var parserAvailable = typeof DOMParser !== 'undefined' && DOMParser.prototype != null && DOMParser.prototype.parseFromString != null; function isParsable(src) { // kinda naive but meh, ain't gonna use full-blown parser for this return parserAvailable && typeof src === 'string' && src.trim().substr(0, 4) === '` element but react-limited function switchSVGAttrToReactProp(propName) { switch (propName) { case 'class': return 'className'; default: return propName; } } var InlineSVG = (function (_React$Component) { _inherits(InlineSVG, _React$Component); _createClass(InlineSVG, null, [{ key: 'defaultProps', value: { element: 'i', raw: false, src: '' }, enumerable: true }, { key: 'propTypes', value: { src: _react2['default'].PropTypes.string.isRequired, element: _react2['default'].PropTypes.string, raw: _react2['default'].PropTypes.bool }, enumerable: true }]); function InlineSVG(props) { _classCallCheck(this, InlineSVG); _get(Object.getPrototypeOf(InlineSVG.prototype), 'constructor', this).call(this, props); this._extractSVGProps = this._extractSVGProps.bind(this); } // Serialize `Attr` objects in `NamedNodeMap` _createClass(InlineSVG, [{ key: '_serializeAttrs', value: function _serializeAttrs(map) { var ret = {}; var prop = undefined; for (var i = 0; i < map.length; i++) { prop = switchSVGAttrToReactProp(map[i].name); ret[prop] = map[i].value; } return ret; } // get element props }, { key: '_extractSVGProps', value: function _extractSVGProps(src) { var map = parseFromSVGString(src).documentElement.attributes; return map.length > 0 ? this._serializeAttrs(map) : null; } // get content inside element. }, { key: '_stripSVG', value: function _stripSVG(src) { return parseFromSVGString(src).documentElement.innerHTML; } }, { key: 'componentWillReceiveProps', value: function componentWillReceiveProps(_ref) { var children = _ref.children; if ("production" !== process.env.NODE_ENV && children != null) { console.info(': `children` prop will be ignored.'); } } }, { key: 'render', value: function render() { var Element = undefined, __html = undefined, svgProps = undefined; var _props = this.props; var element = _props.element; var raw = _props.raw; var src = _props.src; var otherProps = _objectWithoutProperties(_props, ['element', 'raw', 'src']); if (raw === true && isParsable(src)) { Element = 'svg'; svgProps = this._extractSVGProps(src); __html = this._stripSVG(src); } __html = __html || src; Element = Element || element; svgProps = svgProps || {}; return _react2['default'].createElement(Element, _extends({}, svgProps, otherProps, { src: null, children: null, dangerouslySetInnerHTML: { __html: __html } })); } }]); return InlineSVG; })(_react2['default'].Component); exports['default'] = InlineSVG; module.exports = exports['default']; /***/ }), /* 347 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 348 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 349 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 350 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 351 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 352 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 353 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 354 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 355 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 356 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 357 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 358 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 359 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 360 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 361 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 362 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 363 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 364 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 365 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 366 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 367 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 368 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 369 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 370 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 371 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 372 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 373 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 374 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 375 */, /* 376 */, /* 377 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _devtoolsConfig = __webpack_require__(828); var _Svg = __webpack_require__(344); var _Svg2 = _interopRequireDefault(_Svg); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _Close = __webpack_require__(378); var _Close2 = _interopRequireDefault(_Close); __webpack_require__(865); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var arrowBtn = (onClick, type, className, tooltip) => { var props = { onClick, type, className, title: tooltip, key: type }; return _react2.default.createElement( "button", props, _react2.default.createElement(_Svg2.default, { name: type }) ); }; class SearchInput extends _react.Component { componentDidMount() { this.$input.focus(); } shouldShowErrorEmoji() { var _props = this.props, count = _props.count, query = _props.query, showErrorEmoji = _props.showErrorEmoji; return count === 0 && query.trim() !== "" && !showErrorEmoji; } renderSvg() { if (this.shouldShowErrorEmoji()) { return _react2.default.createElement(_Svg2.default, { name: "sad-face" }); } return _react2.default.createElement(_Svg2.default, { name: "magnifying-glass" }); } renderArrowButtons() { var _props2 = this.props, handleNext = _props2.handleNext, handlePrev = _props2.handlePrev; return [arrowBtn(handleNext, "arrow-down", (0, _classnames2.default)("nav-btn", "next"), L10N.getFormatStr("editor.searchResults.nextResult")), arrowBtn(handlePrev, "arrow-up", (0, _classnames2.default)("nav-btn", "prev"), L10N.getFormatStr("editor.searchResults.prevResult"))]; } renderNav() { if (!(0, _devtoolsConfig.isEnabled)("searchNav")) { return; } var _props3 = this.props, count = _props3.count, handleNext = _props3.handleNext, handlePrev = _props3.handlePrev; if (!handleNext && !handlePrev || !count || count == 1) { return; } return _react2.default.createElement( "div", { className: "search-nav-buttons" }, this.renderArrowButtons() ); } render() { var _props4 = this.props, query = _props4.query, placeholder = _props4.placeholder, summaryMsg = _props4.summaryMsg, onChange = _props4.onChange, onKeyDown = _props4.onKeyDown, onKeyUp = _props4.onKeyUp, onFocus = _props4.onFocus, onBlur = _props4.onBlur, handleClose = _props4.handleClose, size = _props4.size; var inputProps = { className: (0, _classnames2.default)({ empty: this.shouldShowErrorEmoji() }), onChange, onKeyDown, onKeyUp, onFocus, onBlur, placeholder, value: query, spellCheck: false, ref: c => this.$input = c }; return _react2.default.createElement( "div", { className: (0, _classnames2.default)("search-field", size) }, this.renderSvg(), _react2.default.createElement("input", inputProps), _react2.default.createElement( "div", { className: "summary" }, summaryMsg || "" ), this.renderNav(), _react2.default.createElement(_Close2.default, { handleClick: handleClose, buttonClass: size }) ); } } SearchInput.defaultProps = { size: "", showErrorEmoji: true }; exports.default = SearchInput; /***/ }), /* 378 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _Svg = __webpack_require__(344); var _Svg2 = _interopRequireDefault(_Svg); __webpack_require__(864); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function CloseButton(_ref) { var handleClick = _ref.handleClick, buttonClass = _ref.buttonClass, tooltip = _ref.tooltip; return _react2.default.createElement( "div", { className: buttonClass ? `close-btn ${buttonClass}` : "close-btn", onClick: handleClick, title: tooltip }, _react2.default.createElement(_Svg2.default, { name: "close" }) ); } exports.default = CloseButton; /***/ }), /* 379 */, /* 380 */, /* 381 */, /* 382 */, /* 383 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); __webpack_require__(868); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class ResultList extends _react.Component { constructor(props) { super(props); this.renderListItem = this.renderListItem.bind(this); } renderListItem(item, index) { var _props = this.props, selectItem = _props.selectItem, selected = _props.selected; var props = { onClick: event => selectItem(event, item, index), key: `${item.id}${item.value}${index}`, ref: index, title: item.value, className: (0, _classnames2.default)("result-item", { selected: index === selected }) }; return _react2.default.createElement( "li", props, _react2.default.createElement( "div", { className: "title" }, item.title ), _react2.default.createElement( "div", { className: "subtitle" }, item.subtitle ) ); } render() { var _props2 = this.props, size = _props2.size, items = _props2.items; return _react2.default.createElement( "ul", { className: (0, _classnames2.default)("result-list", size) }, items.map(this.renderListItem) ); } } exports.default = ResultList; ResultList.defaultProps = { size: "small" }; /***/ }), /* 384 */, /* 385 */, /* 386 */, /* 387 */, /* 388 */, /* 389 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.formatKeyShortcut = undefined; var _devtoolsModules = __webpack_require__(830); var appinfo = _devtoolsModules.Services.appinfo; /** * Utils for keyboard command strings * @module utils/text */ var isMacOS = appinfo.OS === "Darwin"; /** * Formats key for use in tooltips * For macOS we use the following unicode * * cmd ⌘ = \u2318 * shift ⇧ – \u21E7 * option (alt) ⌥ \u2325 * * For Win/Lin this replaces CommandOrControl or CmdOrCtrl with Ctrl * * @memberof utils/text * @static */ function formatKeyShortcut(shortcut) { if (isMacOS) { return shortcut.replace(/Shift\+/g, "\u21E7 ").replace(/Command\+|Cmd\+/g, "\u2318 ").replace(/CommandOrControl\+|CmdOrCtrl\+/g, "\u2318 ").replace(/Alt\+/g, "\u2325 "); } return shortcut.replace(/CommandOrControl\+|CmdOrCtrl\+/g, `${L10N.getStr("ctrl")} `).replace(/Shift\+/g, "Shift "); } exports.formatKeyShortcut = formatKeyShortcut; /***/ }), /* 390 */, /* 391 */, /* 392 */, /* 393 */, /* 394 */, /* 395 */, /* 396 */, /* 397 */, /* 398 */, /* 399 */, /* 400 */, /* 401 */, /* 402 */, /* 403 */, /* 404 */, /* 405 */, /* 406 */, /* 407 */, /* 408 */, /* 409 */, /* 410 */, /* 411 */, /* 412 */, /* 413 */, /* 414 */, /* 415 */, /* 416 */, /* 417 */, /* 418 */, /* 419 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: 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; }; var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); __webpack_require__(863); var _devtoolsComponents = __webpack_require__(1007); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var Tree = (0, _react.createFactory)(_devtoolsComponents.Tree); class ManagedTree extends _react.Component { constructor(props) { super(); this.state = { expanded: props.expanded || new Set(), focusedItem: null }; var self = this; self.setExpanded = this.setExpanded.bind(this); self.focusItem = this.focusItem.bind(this); } componentWillReceiveProps(nextProps) { var listItems = nextProps.listItems; if (listItems && listItems != this.props.listItems && listItems.length) { this.expandListItems(listItems); } var highlightItems = nextProps.highlightItems; if (highlightItems && highlightItems != this.props.highlightItems && highlightItems.length) { this.highlightItem(highlightItems); } if (nextProps.focused && nextProps.focused !== this.props.focused) { this.focusItem(nextProps.focused); } } setExpanded(item, isExpanded) { var expanded = this.state.expanded; var itemPath = this.props.getPath(item); if (isExpanded) { expanded.add(itemPath); } else { expanded.delete(itemPath); } this.setState({ expanded }); if (isExpanded && this.props.onExpand) { this.props.onExpand(item, expanded); } else if (!isExpanded && this.props.onCollapse) { this.props.onCollapse(item, expanded); } } expandListItems(listItems) { var expanded = this.state.expanded; listItems.forEach(item => expanded.add(this.props.getPath(item))); this.focusItem(listItems[0]); this.setState({ expanded }); } highlightItem(highlightItems) { var expanded = this.state.expanded; // This file is visible, so we highlight it. if (expanded.has(this.props.getPath(highlightItems[0]))) { this.focusItem(highlightItems[0]); } else { // Look at folders starting from the top-level until finds a // closed folder and highlights this folder var index = highlightItems.reverse().findIndex(item => !expanded.has(this.props.getPath(item))); this.focusItem(highlightItems[index]); } } focusItem(item) { if (!this.props.disabledFocus && this.state.focusedItem !== item) { this.setState({ focusedItem: item }); if (this.props.onFocus) { this.props.onFocus(item); } } } render() { var _this = this; var _state = this.state, expanded = _state.expanded, focusedItem = _state.focusedItem; var overrides = { isExpanded: item => expanded.has(this.props.getPath(item)), focused: focusedItem, getKey: this.props.getPath, onExpand: item => this.setExpanded(item, true), onCollapse: item => this.setExpanded(item, false), onFocus: this.focusItem, renderItem: function () { var _props; for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return (_props = _this.props).renderItem.apply(_props, args.concat([{ setExpanded: _this.setExpanded }])); } }; var props = _extends({}, this.props, overrides); return _react2.default.createElement( "div", { className: "managed-tree" }, _react2.default.createElement(Tree, props) ); } } ManagedTree.propTypes = Object.assign({}, Tree.propTypes); exports.default = ManagedTree; /***/ }), /* 420 */, /* 421 */, /* 422 */, /* 423 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Clipboard function taken from * https://dxr.mozilla.org/mozilla-central/source/devtools/shared/platform/content/clipboard.js */ function copyToTheClipboard(string) { var doCopy = function (e) { e.clipboardData.setData("text/plain", string); e.preventDefault(); }; document.addEventListener("copy", doCopy); document.execCommand("copy", false, null); document.removeEventListener("copy", doCopy); } exports.copyToTheClipboard = copyToTheClipboard; /***/ }), /* 424 */, /* 425 */, /* 426 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactDom = __webpack_require__(4); var _reactDom2 = _interopRequireDefault(_reactDom); var _reactImmutableProptypes = __webpack_require__(150); var _reactImmutableProptypes2 = _interopRequireDefault(_reactImmutableProptypes); var _redux = __webpack_require__(3); var _reactRedux = __webpack_require__(1189); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _devtoolsConfig = __webpack_require__(828); var _GutterMenu = __webpack_require__(655); var _GutterMenu2 = _interopRequireDefault(_GutterMenu); var _EditorMenu = __webpack_require__(656); var _EditorMenu2 = _interopRequireDefault(_EditorMenu); var _ConditionalPanel = __webpack_require__(711); var _devtoolsLaunchpad = __webpack_require__(131); var _source = __webpack_require__(233); var _function = __webpack_require__(1169); var _ast = __webpack_require__(1058); var _selectors = __webpack_require__(242); var _actions = __webpack_require__(244); var _actions2 = _interopRequireDefault(_actions); var _Footer = __webpack_require__(427); var _Footer2 = _interopRequireDefault(_Footer); var _SearchBar = __webpack_require__(433); var _SearchBar2 = _interopRequireDefault(_SearchBar); var _HighlightLines = __webpack_require__(1025); var _HighlightLines2 = _interopRequireDefault(_HighlightLines); var _Preview = __webpack_require__(809); var _Preview2 = _interopRequireDefault(_Preview); var _Breakpoints = __webpack_require__(1158); var _Breakpoints2 = _interopRequireDefault(_Breakpoints); var _HitMarker = __webpack_require__(715); var _HitMarker2 = _interopRequireDefault(_HitMarker); var _CallSites = __webpack_require__(1159); var _CallSites2 = _interopRequireDefault(_CallSites); var _DebugLine = __webpack_require__(313); var _DebugLine2 = _interopRequireDefault(_DebugLine); var _EmptyLines = __webpack_require__(1146); var _EmptyLines2 = _interopRequireDefault(_EmptyLines); var _editor = __webpack_require__(257); __webpack_require__(905); __webpack_require__(906); var _devtoolsSourceEditor = __webpack_require__(994); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var cssVars = { searchbarHeight: "var(--editor-searchbar-height)", secondSearchbarHeight: "var(--editor-second-searchbar-height)", footerHeight: "var(--editor-footer-height)" }; class Editor extends _react.PureComponent { constructor() { super(); this.cbPanel = null; this.pendingJumpLocation = null; this.lastJumpLine = null; this.state = { highlightedLineRange: null, editor: null }; var self = this; self.closeConditionalPanel = this.closeConditionalPanel.bind(this); self.onEscape = this.onEscape.bind(this); self.onGutterClick = this.onGutterClick.bind(this); self.onGutterContextMenu = this.onGutterContextMenu.bind(this); self.onSearchAgain = this.onSearchAgain.bind(this); self.onToggleBreakpoint = this.onToggleBreakpoint.bind(this); self.toggleConditionalPanel = this.toggleConditionalPanel.bind(this); } componentWillReceiveProps(nextProps) { if (!this.state.editor) { return; } this.setSize(nextProps); this.setText(nextProps); (0, _editor.resizeBreakpointGutter)(this.state.editor.codeMirror); } setupEditor() { var editor = (0, _editor.createEditor)(); // disables the default search shortcuts editor._initShortcuts = () => {}; var node = _reactDom2.default.findDOMNode(this); if (node instanceof HTMLElement) { editor.appendToLocalElement(node.querySelector(".editor-mount")); } var codeMirror = editor.codeMirror; var codeMirrorWrapper = codeMirror.getWrapperElement(); (0, _editor.resizeBreakpointGutter)(codeMirror); (0, _devtoolsLaunchpad.debugGlobal)("cm", codeMirror); codeMirror.on("gutterClick", this.onGutterClick); // Set code editor wrapper to be focusable codeMirrorWrapper.tabIndex = 0; codeMirrorWrapper.addEventListener("keydown", e => this.onKeyDown(e)); codeMirrorWrapper.addEventListener("click", e => this.onClick(e)); var toggleFoldMarkerVisibility = e => { if (node instanceof HTMLElement) { node.querySelectorAll(".CodeMirror-guttermarker-subtle").forEach(elem => { elem.classList.toggle("visible"); }); } }; var codeMirrorGutter = codeMirror.getGutterElement(); codeMirrorGutter.addEventListener("mouseleave", toggleFoldMarkerVisibility); codeMirrorGutter.addEventListener("mouseenter", toggleFoldMarkerVisibility); if (!(0, _devtoolsConfig.isFirefox)()) { codeMirror.on("gutterContextMenu", (cm, line, eventName, event) => this.onGutterContextMenu(event)); codeMirror.on("contextmenu", (cm, event) => this.openMenu(event, editor)); } else { codeMirrorWrapper.addEventListener("contextmenu", event => this.openMenu(event, editor)); } this.setState({ editor }); return editor; } componentDidMount() { this.cbPanel = null; var editor = this.setupEditor(); var _props = this.props, selectedSource = _props.selectedSource, selectedLocation = _props.selectedLocation; var shortcuts = this.context.shortcuts; var searchAgainKey = L10N.getStr("sourceSearch.search.again.key2"); var searchAgainPrevKey = L10N.getStr("sourceSearch.search.againPrev.key2"); shortcuts.on(L10N.getStr("toggleBreakpoint.key"), this.onToggleBreakpoint); shortcuts.on(L10N.getStr("toggleCondPanel.key"), this.onToggleBreakpoint); shortcuts.on("Esc", this.onEscape); shortcuts.on(searchAgainPrevKey, this.onSearchAgain); shortcuts.on(searchAgainKey, this.onSearchAgain); if (selectedLocation && !!selectedLocation.line) { this.pendingJumpLocation = selectedLocation; } var sourceId = selectedSource ? selectedSource.get("id") : undefined; (0, _editor.updateDocument)(editor, sourceId); } componentWillUnmount() { this.state.editor.destroy(); this.setState({ editor: null }); var searchAgainKey = L10N.getStr("sourceSearch.search.again.key2"); var searchAgainPrevKey = L10N.getStr("sourceSearch.search.againPrev.key2"); var shortcuts = this.context.shortcuts; shortcuts.off(L10N.getStr("toggleBreakpoint.key")); shortcuts.off(L10N.getStr("toggleCondPanel.key")); shortcuts.off(searchAgainPrevKey); shortcuts.off(searchAgainKey); } componentDidUpdate(prevProps) { // This is in `componentDidUpdate` so helper functions can expect // `this.props` to be the current props. This lifecycle method is // responsible for updating the editor annotations. var _props2 = this.props, selectedLocation = _props2.selectedLocation, selectedSource = _props2.selectedSource; // If the location is different and a new line is requested, // update the pending jump line. Note that if jumping to a line in // a source where the text hasn't been loaded yet, we will set the // line here but not jump until rendering the actual source. if (prevProps.selectedLocation !== selectedLocation) { if (selectedLocation && selectedLocation.line != undefined) { this.pendingJumpLocation = selectedLocation; } else { this.pendingJumpLocation = null; } } // Only update and jump around in real source texts. This will // keep the jump state around until the real source text is // loaded. if (selectedSource && selectedSource.has("text")) { this.highlightLine(); } if (this.props.conditionalBreakpointPanel !== null && this.cbPanel == null) { this.toggleConditionalPanel(this.props.conditionalBreakpointPanel); } } onToggleBreakpoint(key, e) { e.preventDefault(); var codeMirror = this.state.editor.codeMirror; var selectedSource = this.props.selectedSource; var line = (0, _editor.getCursorLine)(codeMirror); if (!selectedSource) { return; } var sourceLine = (0, _editor.toSourceLine)(selectedSource.get("id"), line); if (e.shiftKey) { this.toggleConditionalPanel(sourceLine); } else { this.props.toggleBreakpoint(sourceLine); } } onKeyDown(e) { var codeMirror = this.state.editor.codeMirror; var key = e.key, target = e.target; var codeWrapper = codeMirror.getWrapperElement(); var textArea = codeWrapper.querySelector("textArea"); if (key === "Escape" && target == textArea) { e.stopPropagation(); e.preventDefault(); codeWrapper.focus(); } else if (key === "Enter" && target == codeWrapper) { e.preventDefault(); // Focus into editor's text area textArea.focus(); } } /* * The default Esc command is overridden in the CodeMirror keymap to allow * the Esc keypress event to be catched by the toolbox and trigger the * split console. Restore it here, but preventDefault if and only if there * is a multiselection. */ onEscape(key, e) { if (!this.state.editor) { return; } var codeMirror = this.state.editor.codeMirror; if (codeMirror.listSelections().length > 1) { codeMirror.execCommand("singleSelection"); e.preventDefault(); } } onSearchAgain(_, e) { var _props3 = this.props, query = _props3.query, searchModifiers = _props3.searchModifiers; var codeMirror = this.state.editor.editor.codeMirror; var ctx = { ed: this.state.editor, cm: codeMirror }; var direction = e.shiftKey ? "prev" : "next"; (0, _editor.traverseResults)(e, ctx, query, direction, searchModifiers.toJS()); } inSelectedFrameSource() { var _props4 = this.props, selectedLocation = _props4.selectedLocation, selectedFrame = _props4.selectedFrame; return selectedFrame && selectedLocation && selectedFrame.location.sourceId == selectedLocation.sourceId; } openMenu(event, editor) { var _props5 = this.props, selectedSource = _props5.selectedSource, selectedLocation = _props5.selectedLocation, showSource = _props5.showSource, jumpToMappedLocation = _props5.jumpToMappedLocation, addExpression = _props5.addExpression, toggleBlackBox = _props5.toggleBlackBox, getFunctionText = _props5.getFunctionText; return (0, _EditorMenu2.default)({ editor, event, selectedLocation, selectedSource, showSource, jumpToMappedLocation, addExpression, toggleBlackBox, getFunctionText, onGutterContextMenu: this.onGutterContextMenu }); } onGutterClick(cm, line, gutter, ev) { var _props6 = this.props, selectedSource = _props6.selectedSource, toggleBreakpoint = _props6.toggleBreakpoint, addOrToggleDisabledBreakpoint = _props6.addOrToggleDisabledBreakpoint, isEmptyLine = _props6.isEmptyLine, continueToHere = _props6.continueToHere; // ignore right clicks in the gutter if (ev.ctrlKey && ev.button === 0 || ev.which === 3 || selectedSource && selectedSource.get("isBlackBoxed")) { return; } if (isEmptyLine(line)) { return; } if (this.isCbPanelOpen()) { return this.closeConditionalPanel(); } if (!selectedSource) { return; } if (gutter !== "CodeMirror-foldgutter") { if (ev.altKey) { continueToHere((0, _editor.toSourceLine)(selectedSource.get("id"), line)); } else if (ev.shiftKey) { addOrToggleDisabledBreakpoint((0, _editor.toSourceLine)(selectedSource.get("id"), line)); } else { toggleBreakpoint((0, _editor.toSourceLine)(selectedSource.get("id"), line)); } } } onGutterContextMenu(event) { var _props7 = this.props, selectedSource = _props7.selectedSource, breakpoints = _props7.breakpoints, toggleBreakpoint = _props7.toggleBreakpoint, toggleDisabledBreakpoint = _props7.toggleDisabledBreakpoint, isEmptyLine = _props7.isEmptyLine, pauseData = _props7.pauseData, continueToHere = _props7.continueToHere; if (selectedSource && selectedSource.get("isBlackBoxed")) { event.preventDefault(); return; } var sourceId = selectedSource ? selectedSource.get("id") : ""; var line = (0, _editor.lineAtHeight)(this.state.editor, sourceId, event); var breakpoint = breakpoints.find(bp => bp.location.line === line); if (isEmptyLine(line - 1)) { return; } (0, _GutterMenu2.default)({ event, line, breakpoint, toggleBreakpoint, toggleDisabledBreakpoint, pauseData, continueToHere, showConditionalPanel: this.toggleConditionalPanel, isCbPanelOpen: this.isCbPanelOpen(), closeConditionalPanel: this.closeConditionalPanel }); } onClick(e) { var _props8 = this.props, selectedLocation = _props8.selectedLocation, jumpToMappedLocation = _props8.jumpToMappedLocation; if (e.metaKey && e.altKey) { var sourceLocation = (0, _editor.getSourceLocationFromMouseEvent)(this.state.editor, selectedLocation, e); jumpToMappedLocation(sourceLocation); } } toggleConditionalPanel(line) { if (this.isCbPanelOpen()) { return this.closeConditionalPanel(); } var _props9 = this.props, selectedLocation = _props9.selectedLocation, setBreakpointCondition = _props9.setBreakpointCondition, breakpoints = _props9.breakpoints; var sourceId = selectedLocation ? selectedLocation.sourceId : ""; var breakpoint = breakpoints.find(bp => bp.location.line === line); var location = { sourceId, line }; var condition = breakpoint ? breakpoint.condition : ""; var panel = (0, _ConditionalPanel.renderConditionalPanel)({ condition, setBreakpoint: value => setBreakpointCondition(location, { condition: value }), closePanel: this.closeConditionalPanel }); var editorLine = (0, _editor.toEditorLine)(sourceId, line); this.cbPanel = this.state.editor.codeMirror.addLineWidget(editorLine, panel, { coverGutter: true, noHScroll: false }); this.cbPanel.node.querySelector("input").focus(); } closeConditionalPanel() { this.props.toggleConditionalBreakpointPanel(null); this.cbPanel.clear(); this.cbPanel = null; } isCbPanelOpen() { return !!this.cbPanel; } // If the location has changed and a specific line is requested, // move to that line and flash it. highlightLine() { if (!this.pendingJumpLocation) { return; } // Make sure to clean up after ourselves. Not only does this // cancel any existing animation, but it avoids it from // happening ever again (in case CodeMirror re-applies the // class, etc). if (this.lastJumpLine) { (0, _editor.clearLineClass)(this.state.editor.codeMirror, "highlight-line"); } var _pendingJumpLocation = this.pendingJumpLocation, sourceId = _pendingJumpLocation.sourceId, sourceLine = _pendingJumpLocation.line; var line = (0, _editor.toEditorLine)(sourceId, sourceLine); this.state.editor.alignLine(line); // We only want to do the flashing animation if it's not a debug // line, which has it's own styling. // Also, if it the first time the debugger is being loaded, we don't want // to flash the previously saved selected line. if (this.lastJumpLine && (!this.props.selectedFrame || this.props.selectedFrame.location.line !== line)) { this.state.editor.codeMirror.addLineClass(line, "line", "highlight-line"); } this.lastJumpLine = line; this.pendingJumpLocation = null; } setSize(nextProps) { if (!this.state.editor) { return; } if (nextProps.startPanelSize !== this.props.startPanelSize || nextProps.endPanelSize !== this.props.endPanelSize) { this.state.editor.codeMirror.setSize(); } } setText(nextProps) { if (!this.state.editor) { return; } if (!nextProps.selectedSource) { if (this.props.selectedSource) { return this.showMessage(""); } return; } if (!(0, _source.isLoaded)(nextProps.selectedSource.toJS())) { return this.showMessage(L10N.getStr("loadingText")); } if (nextProps.selectedSource.get("error")) { return this.showMessage(nextProps.selectedSource.get("error")); } if (nextProps.selectedSource !== this.props.selectedSource) { return (0, _editor.showSourceText)(this.state.editor, nextProps.selectedSource.toJS()); } } showMessage(msg) { if (!this.state.editor) { return; } this.state.editor.replaceDocument(this.state.editor.createDocument()); this.state.editor.setText(msg); this.state.editor.setMode({ name: "text" }); (0, _editor.resetLineNumberFormat)(this.state.editor); } getInlineEditorStyles() { var _props10 = this.props, selectedSource = _props10.selectedSource, horizontal = _props10.horizontal, searchOn = _props10.searchOn; var subtractions = []; if ((0, _editor.shouldShowFooter)(selectedSource, horizontal)) { subtractions.push(cssVars.footerHeight); } if (searchOn) { subtractions.push(cssVars.searchbarHeight); subtractions.push(cssVars.secondSearchbarHeight); } return { height: subtractions.length === 0 ? "100%" : `calc(100% - ${subtractions.join(" - ")})` }; } renderHighlightLines() { var highlightedLineRange = this.props.highlightedLineRange; if (!highlightedLineRange || !this.state.editor) { return; } return _react2.default.createElement(_HighlightLines2.default, { editor: this.state.editor, highlightedLineRange: highlightedLineRange }); } renderHitCounts() { var _props11 = this.props, hitCount = _props11.hitCount, selectedSource = _props11.selectedSource; if (!selectedSource || !(0, _source.isLoaded)(selectedSource.toJS()) || !hitCount || !this.state.editor) { return; } return hitCount.filter(marker => marker.get("count") > 0).map(marker => _react2.default.createElement(_HitMarker2.default, { key: marker.get("line"), hitData: marker.toJS(), editor: this.state.editor.codeMirror })); } renderPreview() { var selectedSource = this.props.selectedSource; if (!this.state.editor || !selectedSource) { return null; } return _react2.default.createElement(_Preview2.default, { editor: this.state.editor }); } renderCallSites() { var editor = this.state.editor; if (!editor || !(0, _devtoolsConfig.isEnabled)("columnBreakpoints")) { return null; } return _react2.default.createElement(_CallSites2.default, { editor: editor }); } renderSearchBar() { var _props12 = this.props, selectSource = _props12.selectSource, selectedSource = _props12.selectedSource, highlightLineRange = _props12.highlightLineRange, clearHighlightLineRange = _props12.clearHighlightLineRange; if (!this.state.editor) { return null; } return _react2.default.createElement(_SearchBar2.default, { editor: this.state.editor, selectSource: selectSource, selectedSource: selectedSource, highlightLineRange: highlightLineRange, clearHighlightLineRange: clearHighlightLineRange }); } renderFooter() { var horizontal = this.props.horizontal; if (!this.state.editor) { return null; } return _react2.default.createElement(_Footer2.default, { editor: this.state.editor, horizontal: horizontal }); } renderBreakpoints() { if (!this.state.editor) { return null; } return _react2.default.createElement(_Breakpoints2.default, { editor: this.state.editor }); } renderEmptyLines() { if (!this.state.editor) { return null; } return _react2.default.createElement(_EmptyLines2.default, { editor: this.state.editor }); } renderDebugLine() { var editor = this.state.editor; var _props13 = this.props, selectedLocation = _props13.selectedLocation, selectedFrame = _props13.selectedFrame; if (!editor || !selectedLocation || !selectedFrame || !selectedLocation.line || selectedFrame.location.sourceId !== selectedLocation.sourceId) { return null; } return _react2.default.createElement(_DebugLine2.default, { editor: editor, selectedFrame: selectedFrame, selectedLocation: selectedLocation }); } render() { var _props14 = this.props, coverageOn = _props14.coverageOn, pauseData = _props14.pauseData; return _react2.default.createElement( "div", { className: (0, _classnames2.default)("editor-wrapper", { "coverage-on": coverageOn, paused: !!pauseData && (0, _devtoolsConfig.isEnabled)("highlightScopeLines") }) }, this.renderSearchBar(), _react2.default.createElement("div", { className: "editor-mount devtools-monospace", style: this.getInlineEditorStyles() }), this.renderHighlightLines(), this.renderHitCounts(), this.renderFooter(), this.renderPreview(), this.renderCallSites(), this.renderDebugLine(), this.renderBreakpoints(), this.renderEmptyLines() ); } } Editor.propTypes = { breakpoints: _reactImmutableProptypes2.default.map, hitCount: _react.PropTypes.object, selectedLocation: _react.PropTypes.object, selectedSource: _reactImmutableProptypes2.default.map, highlightLineRange: _react.PropTypes.func, clearHighlightLineRange: _react.PropTypes.func, highlightedLineRange: _react.PropTypes.object, searchOn: _react.PropTypes.bool, addBreakpoint: _react.PropTypes.func.isRequired, disableBreakpoint: _react.PropTypes.func.isRequired, enableBreakpoint: _react.PropTypes.func.isRequired, removeBreakpoint: _react.PropTypes.func.isRequired, setBreakpointCondition: _react.PropTypes.func.isRequired, selectSource: _react.PropTypes.func, jumpToMappedLocation: _react.PropTypes.func, toggleBlackBox: _react.PropTypes.func, showSource: _react.PropTypes.func, coverageOn: _react.PropTypes.bool, pauseData: _react.PropTypes.object, selectedFrame: _react.PropTypes.object, addExpression: _react.PropTypes.func.isRequired, horizontal: _react.PropTypes.bool, query: _react.PropTypes.string.isRequired, searchModifiers: _reactImmutableProptypes2.default.recordOf({ caseSensitive: _react.PropTypes.bool.isRequired, regexMatch: _react.PropTypes.bool.isRequired, wholeWord: _react.PropTypes.bool.isRequired }).isRequired, startPanelSize: _react.PropTypes.number, endPanelSize: _react.PropTypes.number, linesInScope: _react.PropTypes.array, toggleBreakpoint: _react.PropTypes.func.isRequired, addOrToggleDisabledBreakpoint: _react.PropTypes.func.isRequired, toggleDisabledBreakpoint: _react.PropTypes.func.isRequired, conditionalBreakpointPanel: _react.PropTypes.number, toggleConditionalBreakpointPanel: _react.PropTypes.func.isRequired, isEmptyLine: _react.PropTypes.func, continueToHere: _react.PropTypes.func, getFunctionText: _react.PropTypes.func }; Editor.contextTypes = { shortcuts: _react.PropTypes.object }; exports.default = (0, _reactRedux.connect)(state => { var selectedLocation = (0, _selectors.getSelectedLocation)(state); var sourceId = selectedLocation && selectedLocation.sourceId; var selectedSource = (0, _selectors.getSelectedSource)(state); return { selectedLocation, selectedSource, highlightedLineRange: (0, _selectors.getHighlightedLineRange)(state), searchOn: (0, _selectors.getActiveSearch)(state) === "file", loadedObjects: (0, _selectors.getLoadedObjects)(state), breakpoints: (0, _selectors.getVisibleBreakpoints)(state), hitCount: (0, _selectors.getHitCountForSource)(state, sourceId), selectedFrame: (0, _selectors.getSelectedFrame)(state), pauseData: (0, _selectors.getPause)(state), coverageOn: (0, _selectors.getCoverageEnabled)(state), query: (0, _selectors.getFileSearchQueryState)(state), searchModifiers: (0, _selectors.getFileSearchModifierState)(state), linesInScope: (0, _selectors.getInScopeLines)(state), getFunctionText: line => (0, _function.findFunctionText)(line, selectedSource.toJS(), (0, _selectors.getSymbols)(state, selectedSource.toJS())), isEmptyLine: line => (0, _ast.isEmptyLineInSource)(state, line, selectedSource.toJS()), conditionalBreakpointPanel: (0, _selectors.getConditionalBreakpointPanel)(state) }; }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Editor); /***/ }), /* 427 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactRedux = __webpack_require__(1189); var _redux = __webpack_require__(3); var _actions = __webpack_require__(244); var _actions2 = _interopRequireDefault(_actions); var _selectors = __webpack_require__(242); var _Svg = __webpack_require__(344); var _Svg2 = _interopRequireDefault(_Svg); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _devtoolsConfig = __webpack_require__(828); var _source = __webpack_require__(233); var _editor = __webpack_require__(257); var _PaneToggle = __webpack_require__(428); var _PaneToggle2 = _interopRequireDefault(_PaneToggle); __webpack_require__(875); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class SourceFooter extends _react.PureComponent { prettyPrintButton() { var _props = this.props, selectedSource = _props.selectedSource, togglePrettyPrint = _props.togglePrettyPrint; var sourceLoaded = selectedSource && (0, _source.isLoaded)(selectedSource.toJS()); if (!(0, _editor.shouldShowPrettyPrint)(selectedSource)) { return; } var tooltip = L10N.getStr("sourceTabs.prettyPrint"); var type = "prettyPrint"; return _react2.default.createElement( "button", { onClick: () => togglePrettyPrint(selectedSource.get("id")), className: (0, _classnames2.default)("action", type, { active: sourceLoaded, pretty: (0, _source.isPretty)(selectedSource.toJS()) }), key: type, title: tooltip, "aria-label": tooltip }, _react2.default.createElement(_Svg2.default, { name: type }) ); } blackBoxButton() { var _props2 = this.props, selectedSource = _props2.selectedSource, toggleBlackBox = _props2.toggleBlackBox; var sourceLoaded = selectedSource && (0, _source.isLoaded)(selectedSource.toJS()); if (!(0, _devtoolsConfig.isEnabled)("blackbox") || !sourceLoaded) { return; } var blackboxed = selectedSource.get("isBlackBoxed"); var tooltip = L10N.getStr("sourceFooter.blackbox"); var type = "black-box"; return _react2.default.createElement( "button", { onClick: () => toggleBlackBox(selectedSource.toJS()), className: (0, _classnames2.default)("action", type, { active: sourceLoaded, blackboxed: blackboxed }), key: type, title: tooltip, "aria-label": tooltip }, _react2.default.createElement(_Svg2.default, { name: "blackBox" }) ); } blackBoxSummary() { var selectedSource = this.props.selectedSource; if (!selectedSource || !selectedSource.get("isBlackBoxed")) { return; } return _react2.default.createElement( "span", { className: "blackbox-summary" }, L10N.getStr("sourceFooter.blackboxed") ); } coverageButton() { var recordCoverage = this.props.recordCoverage; if (!(0, _devtoolsConfig.isEnabled)("codeCoverage")) { return; } return _react2.default.createElement( "button", { className: "coverage action", title: L10N.getStr("sourceFooter.codeCoverage"), onClick: () => recordCoverage(), "aria-label": L10N.getStr("sourceFooter.codeCoverage") }, "C" ); } renderToggleButton() { if (this.props.horizontal) { return; } return _react2.default.createElement(_PaneToggle2.default, { position: "end", collapsed: !this.props.endPanelCollapsed, horizontal: this.props.horizontal, handleClick: this.props.togglePaneCollapse }); } renderCommands() { return _react2.default.createElement( "div", { className: "commands" }, this.prettyPrintButton(), this.blackBoxButton(), this.blackBoxSummary(), this.coverageButton() ); } render() { var _props3 = this.props, selectedSource = _props3.selectedSource, horizontal = _props3.horizontal; if (!(0, _editor.shouldShowFooter)(selectedSource, horizontal)) { return null; } return _react2.default.createElement( "div", { className: "source-footer" }, this.renderCommands(), this.renderToggleButton() ); } } exports.default = (0, _reactRedux.connect)(state => { var selectedSource = (0, _selectors.getSelectedSource)(state); var selectedId = selectedSource && selectedSource.get("id"); return { selectedSource, prettySource: (0, _selectors.getPrettySource)(state, selectedId), endPanelCollapsed: (0, _selectors.getPaneCollapse)(state, "end") }; }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(SourceFooter); /***/ }), /* 428 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _Svg = __webpack_require__(344); var _Svg2 = _interopRequireDefault(_Svg); __webpack_require__(874); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class PaneToggleButton extends _react.Component { shouldComponentUpdate(nextProps) { var _props = this.props, collapsed = _props.collapsed, horizontal = _props.horizontal; return horizontal !== nextProps.horizontal || collapsed !== nextProps.collapsed; } render() { var _props2 = this.props, position = _props2.position, collapsed = _props2.collapsed, horizontal = _props2.horizontal, handleClick = _props2.handleClick; var title = !collapsed ? L10N.getStr("expandPanes") : L10N.getStr("collapsePanes"); return _react2.default.createElement( "button", { className: (0, _classnames2.default)(`toggle-button-${position}`, { collapsed, vertical: horizontal != null ? !horizontal : false }), onClick: () => handleClick(position, collapsed), title: title }, _react2.default.createElement(_Svg2.default, { name: "togglePanes" }) ); } } exports.default = PaneToggleButton; /***/ }), /* 429 */, /* 430 */, /* 431 */, /* 432 */, /* 433 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactDom = __webpack_require__(4); var _reactRedux = __webpack_require__(1189); var _redux = __webpack_require__(3); var _Svg = __webpack_require__(344); var _Svg2 = _interopRequireDefault(_Svg); var _actions = __webpack_require__(244); var _actions2 = _interopRequireDefault(_actions); var _selectors = __webpack_require__(242); var _editor = __webpack_require__(257); var _search = __webpack_require__(1115); var _resultList = __webpack_require__(343); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _lodash = __webpack_require__(2); var _devtoolsSourceEditor = __webpack_require__(994); var _SearchInput = __webpack_require__(377); var _SearchInput2 = _interopRequireDefault(_SearchInput); __webpack_require__(876); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } function getShortcuts() { var searchAgainKey = L10N.getStr("sourceSearch.search.again.key2"); var searchAgainPrevKey = L10N.getStr("sourceSearch.search.againPrev.key2"); var searchKey = L10N.getStr("sourceSearch.search.key2"); return { shiftSearchAgainShortcut: searchAgainPrevKey, searchAgainShortcut: searchAgainKey, searchShortcut: searchKey }; } class SearchBar extends _react.Component { constructor(props) { super(props); this.state = { selectedResultIndex: 0, count: 0, index: -1 }; var self = this; self.onEscape = this.onEscape.bind(this); self.clearSearch = this.clearSearch.bind(this); self.closeSearch = this.closeSearch.bind(this); self.toggleSearch = this.toggleSearch.bind(this); self.setSearchValue = this.setSearchValue.bind(this); self.selectSearchInput = this.selectSearchInput.bind(this); self.searchInput = this.searchInput.bind(this); self.doSearch = this.doSearch.bind(this); self.searchContents = this.searchContents.bind(this); self.traverseResults = this.traverseResults.bind(this); self.onChange = this.onChange.bind(this); self.onKeyUp = this.onKeyUp.bind(this); self.buildSummaryMsg = this.buildSummaryMsg.bind(this); self.renderSearchModifiers = this.renderSearchModifiers.bind(this); } componentWillUnmount() { var shortcuts = this.context.shortcuts; var _getShortcuts = getShortcuts(), searchShortcut = _getShortcuts.searchShortcut, searchAgainShortcut = _getShortcuts.searchAgainShortcut, shiftSearchAgainShortcut = _getShortcuts.shiftSearchAgainShortcut; shortcuts.off(searchShortcut); shortcuts.off("Escape"); shortcuts.off(searchAgainShortcut); shortcuts.off(shiftSearchAgainShortcut); } componentDidMount() { // overwrite searchContents with a debounced version to reduce the // frequency of queries which improves perf on large files // $FlowIgnore this.searchContents = (0, _lodash.debounce)(this.searchContents, 100); var shortcuts = this.context.shortcuts; var _getShortcuts2 = getShortcuts(), searchShortcut = _getShortcuts2.searchShortcut, searchAgainShortcut = _getShortcuts2.searchAgainShortcut, shiftSearchAgainShortcut = _getShortcuts2.shiftSearchAgainShortcut; shortcuts.on(searchShortcut, (_, e) => this.toggleSearch(e)); shortcuts.on("Escape", (_, e) => this.onEscape(e)); shortcuts.on(shiftSearchAgainShortcut, (_, e) => this.traverseResults(e, true)); shortcuts.on(searchAgainShortcut, (_, e) => this.traverseResults(e, false)); } componentDidUpdate(prevProps, prevState) { var searchInput = this.searchInput(); if (searchInput) { searchInput.focus(); } if (this.refs.resultList && this.refs.resultList.refs) { (0, _resultList.scrollList)(this.refs.resultList.refs, this.state.selectedResultIndex); } } onEscape(e) { this.closeSearch(e); } clearSearch() { var _props = this.props, ed = _props.editor, query = _props.query, modifiers = _props.modifiers; if (ed && modifiers) { var ctx = { ed, cm: ed.codeMirror }; (0, _editor.removeOverlay)(ctx, query, modifiers.toJS()); } } closeSearch(e) { var _props2 = this.props, editor = _props2.editor, setFileSearchQuery = _props2.setFileSearchQuery, searchOn = _props2.searchOn; if (editor && searchOn) { setFileSearchQuery(""); this.clearSearch(); this.props.setActiveSearch(); this.props.clearHighlightLineRange(); e.stopPropagation(); e.preventDefault(); } } toggleSearch(e) { e.stopPropagation(); e.preventDefault(); var editor = this.props.editor; if (!this.props.searchOn) { this.props.setActiveSearch("file"); } if (this.props.searchOn && editor) { var selection = editor.codeMirror.getSelection(); this.setSearchValue(selection); if (selection !== "") { this.doSearch(selection); } this.selectSearchInput(); } } setSearchValue(value) { var searchInput = this.searchInput(); if (value == "" || !searchInput) { return; } searchInput.value = value; } selectSearchInput() { var searchInput = this.searchInput(); if (searchInput) { searchInput.setSelectionRange(0, searchInput.value.length); searchInput.focus(); } } searchInput() { var node = (0, _reactDom.findDOMNode)(this); if (node instanceof HTMLElement) { var input = node.querySelector("input"); if (input instanceof HTMLInputElement) { return input; } } return null; } doSearch(query) { var _props3 = this.props, selectedSource = _props3.selectedSource, setFileSearchQuery = _props3.setFileSearchQuery; if (!selectedSource || !selectedSource.get("text")) { return; } setFileSearchQuery(query); this.searchContents(query); } updateSearchResults(characterIndex, line, matches) { var matchIndex = matches.findIndex(elm => elm.line === line && elm.ch === characterIndex); this.props.updateSearchResults({ matches, matchIndex, count: matches.length, index: characterIndex }); } searchContents(query) { var _this = this; return _asyncToGenerator(function* () { var _props4 = _this.props, selectedSource = _props4.selectedSource, modifiers = _props4.modifiers, ed = _props4.editor; if (!query || !ed || !selectedSource || !selectedSource.get("text") || !modifiers) { return; } var ctx = { ed, cm: ed.codeMirror }; var _modifiers = modifiers.toJS(); var matches = yield (0, _search.getMatches)(query, selectedSource.get("text"), _modifiers); var _find = (0, _editor.find)(ctx, query, true, _modifiers), ch = _find.ch, line = _find.line; _this.updateSearchResults(ch, line, matches); })(); } traverseResults(e, rev) { e.stopPropagation(); e.preventDefault(); var ed = this.props.editor; if (!ed) { return; } var ctx = { ed, cm: ed.codeMirror }; var _props5 = this.props, query = _props5.query, modifiers = _props5.modifiers, matches = _props5.searchResults.matches; if (query === "") { this.props.setActiveSearch("file"); } if (modifiers) { var matchedLocations = matches || []; var _ref = rev ? (0, _editor.findPrev)(ctx, query, true, modifiers.toJS()) : (0, _editor.findNext)(ctx, query, true, modifiers.toJS()), ch = _ref.ch, line = _ref.line; this.updateSearchResults(ch, line, matchedLocations); } } // Handlers onChange(e) { return this.doSearch(e.target.value); } onKeyUp(e) { if (e.key !== "Enter" && e.key !== "F3") { return; } this.traverseResults(e, e.shiftKey); e.preventDefault(); } // Renderers buildSummaryMsg() { var _props6 = this.props, _props6$searchResults = _props6.searchResults, matchIndex = _props6$searchResults.matchIndex, count = _props6$searchResults.count, index = _props6$searchResults.index, query = _props6.query; if (query.trim() == "") { return ""; } if (count == 0) { return L10N.getStr("editor.noResults"); } if (index == -1) { return L10N.getFormatStr("sourceSearch.resultsSummary1", count); } return L10N.getFormatStr("editor.searchResults", matchIndex + 1, count); } renderSearchModifiers() { var _props7 = this.props, modifiers = _props7.modifiers, toggleFileSearchModifier = _props7.toggleFileSearchModifier; function SearchModBtn(_ref2) { var modVal = _ref2.modVal, className = _ref2.className, svgName = _ref2.svgName, tooltip = _ref2.tooltip; var preppedClass = (0, _classnames2.default)(className, { active: modifiers && modifiers.get(modVal) }); return _react2.default.createElement( "button", { className: preppedClass, onClick: () => toggleFileSearchModifier(modVal), title: tooltip }, _react2.default.createElement(_Svg2.default, { name: svgName }) ); } return _react2.default.createElement( "div", { className: "search-modifiers" }, _react2.default.createElement( "span", { className: "search-type-name" }, L10N.getStr("symbolSearch.searchModifier.modifiersLabel") ), _react2.default.createElement(SearchModBtn, { modVal: "regexMatch", className: "regex-match-btn", svgName: "regex-match", tooltip: L10N.getStr("symbolSearch.searchModifier.regex") }), _react2.default.createElement(SearchModBtn, { modVal: "caseSensitive", className: "case-sensitive-btn", svgName: "case-match", tooltip: L10N.getStr("symbolSearch.searchModifier.caseSensitive") }), _react2.default.createElement(SearchModBtn, { modVal: "wholeWord", className: "whole-word-btn", svgName: "whole-word-match", tooltip: L10N.getStr("symbolSearch.searchModifier.wholeWord") }) ); } renderSearchType() { return _react2.default.createElement( "div", { className: "search-type-toggles" }, _react2.default.createElement( "span", { className: "search-type-name", onClick: () => this.props.setActiveSearch("symbol") }, L10N.getStr("symbolSearch.search.functionsPlaceholder") ) ); } render() { var _props8 = this.props, count = _props8.searchResults.count, query = _props8.query, searchOn = _props8.searchOn; if (!searchOn) { return _react2.default.createElement("div", null); } return _react2.default.createElement( "div", { className: "search-bar" }, _react2.default.createElement(_SearchInput2.default, { query: query, count: count, placeholder: L10N.getStr("sourceSearch.search.placeholder"), summaryMsg: this.buildSummaryMsg(), onChange: this.onChange, onKeyUp: this.onKeyUp, handleNext: e => this.traverseResults(e, false), handlePrev: e => this.traverseResults(e, true), handleClose: this.closeSearch }), _react2.default.createElement( "div", { className: "search-bottom-bar" }, this.renderSearchType(), this.renderSearchModifiers() ) ); } } SearchBar.contextTypes = { shortcuts: _react.PropTypes.object }; exports.default = (0, _reactRedux.connect)(state => { return { searchOn: (0, _selectors.getActiveSearch)(state) === "file", query: (0, _selectors.getFileSearchQueryState)(state), modifiers: (0, _selectors.getFileSearchModifierState)(state), searchResults: (0, _selectors.getSearchResults)(state) }; }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(SearchBar); /***/ }), /* 434 */, /* 435 */, /* 436 */, /* 437 */, /* 438 */, /* 439 */, /* 440 */, /* 441 */, /* 442 */, /* 443 */, /* 444 */, /* 445 */, /* 446 */, /* 447 */, /* 448 */, /* 449 */, /* 450 */, /* 451 */, /* 452 */, /* 453 */, /* 454 */, /* 455 */, /* 456 */, /* 457 */, /* 458 */, /* 459 */, /* 460 */, /* 461 */, /* 462 */, /* 463 */, /* 464 */, /* 465 */, /* 466 */, /* 467 */, /* 468 */, /* 469 */, /* 470 */, /* 471 */, /* 472 */, /* 473 */, /* 474 */, /* 475 */, /* 476 */, /* 477 */, /* 478 */, /* 479 */, /* 480 */, /* 481 */, /* 482 */, /* 483 */, /* 484 */, /* 485 */, /* 486 */, /* 487 */, /* 488 */, /* 489 */, /* 490 */, /* 491 */, /* 492 */, /* 493 */, /* 494 */, /* 495 */, /* 496 */, /* 497 */, /* 498 */, /* 499 */, /* 500 */, /* 501 */, /* 502 */, /* 503 */, /* 504 */, /* 505 */, /* 506 */, /* 507 */, /* 508 */, /* 509 */, /* 510 */, /* 511 */, /* 512 */, /* 513 */, /* 514 */, /* 515 */, /* 516 */, /* 517 */, /* 518 */, /* 519 */, /* 520 */, /* 521 */, /* 522 */, /* 523 */, /* 524 */, /* 525 */, /* 526 */, /* 527 */, /* 528 */, /* 529 */, /* 530 */, /* 531 */, /* 532 */, /* 533 */, /* 534 */, /* 535 */, /* 536 */, /* 537 */, /* 538 */, /* 539 */, /* 540 */, /* 541 */, /* 542 */, /* 543 */, /* 544 */, /* 545 */, /* 546 */, /* 547 */, /* 548 */, /* 549 */, /* 550 */, /* 551 */, /* 552 */, /* 553 */, /* 554 */, /* 555 */, /* 556 */, /* 557 */, /* 558 */, /* 559 */, /* 560 */, /* 561 */, /* 562 */, /* 563 */, /* 564 */, /* 565 */, /* 566 */, /* 567 */, /* 568 */, /* 569 */, /* 570 */, /* 571 */, /* 572 */, /* 573 */, /* 574 */, /* 575 */, /* 576 */, /* 577 */, /* 578 */, /* 579 */, /* 580 */, /* 581 */, /* 582 */, /* 583 */, /* 584 */, /* 585 */, /* 586 */, /* 587 */, /* 588 */, /* 589 */, /* 590 */, /* 591 */, /* 592 */, /* 593 */, /* 594 */, /* 595 */, /* 596 */, /* 597 */, /* 598 */, /* 599 */, /* 600 */, /* 601 */, /* 602 */, /* 603 */, /* 604 */, /* 605 */, /* 606 */, /* 607 */, /* 608 */, /* 609 */, /* 610 */, /* 611 */, /* 612 */, /* 613 */, /* 614 */, /* 615 */, /* 616 */, /* 617 */, /* 618 */, /* 619 */, /* 620 */, /* 621 */, /* 622 */, /* 623 */, /* 624 */, /* 625 */, /* 626 */, /* 627 */, /* 628 */, /* 629 */, /* 630 */, /* 631 */, /* 632 */, /* 633 */, /* 634 */, /* 635 */, /* 636 */, /* 637 */, /* 638 */, /* 639 */, /* 640 */, /* 641 */, /* 642 */, /* 643 */, /* 644 */, /* 645 */, /* 646 */, /* 647 */, /* 648 */, /* 649 */, /* 650 */, /* 651 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(84), now = __webpack_require__(652), toNumber = __webpack_require__(304); /** Error message constants. */ var FUNC_ERROR_TEXT = 'Expected a function'; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max, nativeMin = Math.min; /** * Creates a debounced function that delays invoking `func` until after `wait` * milliseconds have elapsed since the last time the debounced function was * invoked. The debounced function comes with a `cancel` method to cancel * delayed `func` invocations and a `flush` method to immediately invoke them. * Provide `options` to indicate whether `func` should be invoked on the * leading and/or trailing edge of the `wait` timeout. The `func` is invoked * with the last arguments provided to the debounced function. Subsequent * calls to the debounced function return the result of the last `func` * invocation. * * **Note:** If `leading` and `trailing` options are `true`, `func` is * invoked on the trailing edge of the timeout only if the debounced function * is invoked more than once during the `wait` timeout. * * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred * until to the next tick, similar to `setTimeout` with a timeout of `0`. * * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) * for details over the differences between `_.debounce` and `_.throttle`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to debounce. * @param {number} [wait=0] The number of milliseconds to delay. * @param {Object} [options={}] The options object. * @param {boolean} [options.leading=false] * Specify invoking on the leading edge of the timeout. * @param {number} [options.maxWait] * The maximum time `func` is allowed to be delayed before it's invoked. * @param {boolean} [options.trailing=true] * Specify invoking on the trailing edge of the timeout. * @returns {Function} Returns the new debounced function. * @example * * // Avoid costly calculations while the window size is in flux. * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); * * // Invoke `sendMail` when clicked, debouncing subsequent calls. * jQuery(element).on('click', _.debounce(sendMail, 300, { * 'leading': true, * 'trailing': false * })); * * // Ensure `batchLog` is invoked once after 1 second of debounced calls. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); * var source = new EventSource('/stream'); * jQuery(source).on('message', debounced); * * // Cancel the trailing debounced invocation. * jQuery(window).on('popstate', debounced.cancel); */ function debounce(func, wait, options) { var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } wait = toNumber(wait) || 0; if (isObject(options)) { leading = !!options.leading; maxing = 'maxWait' in options; maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; trailing = 'trailing' in options ? !!options.trailing : trailing; } function invokeFunc(time) { var args = lastArgs, thisArg = lastThis; lastArgs = lastThis = undefined; lastInvokeTime = time; result = func.apply(thisArg, args); return result; } function leadingEdge(time) { // Reset any `maxWait` timer. lastInvokeTime = time; // Start the timer for the trailing edge. timerId = setTimeout(timerExpired, wait); // Invoke the leading edge. return leading ? invokeFunc(time) : result; } function remainingWait(time) { var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, result = wait - timeSinceLastCall; return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result; } function shouldInvoke(time) { var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime; // Either this is the first call, activity has stopped and we're at the // trailing edge, the system time has gone backwards and we're treating // it as the trailing edge, or we've hit the `maxWait` limit. return (lastCallTime === undefined || (timeSinceLastCall >= wait) || (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); } function timerExpired() { var time = now(); if (shouldInvoke(time)) { return trailingEdge(time); } // Restart the timer. timerId = setTimeout(timerExpired, remainingWait(time)); } function trailingEdge(time) { timerId = undefined; // Only invoke if we have `lastArgs` which means `func` has been // debounced at least once. if (trailing && lastArgs) { return invokeFunc(time); } lastArgs = lastThis = undefined; return result; } function cancel() { if (timerId !== undefined) { clearTimeout(timerId); } lastInvokeTime = 0; lastArgs = lastCallTime = lastThis = timerId = undefined; } function flush() { return timerId === undefined ? result : trailingEdge(now()); } function debounced() { var time = now(), isInvoking = shouldInvoke(time); lastArgs = arguments; lastThis = this; lastCallTime = time; if (isInvoking) { if (timerId === undefined) { return leadingEdge(lastCallTime); } if (maxing) { // Handle invocations in a tight loop. timerId = setTimeout(timerExpired, wait); return invokeFunc(lastCallTime); } } if (timerId === undefined) { timerId = setTimeout(timerExpired, wait); } return result; } debounced.cancel = cancel; debounced.flush = flush; return debounced; } module.exports = debounce; /***/ }), /* 652 */ /***/ (function(module, exports, __webpack_require__) { var root = __webpack_require__(8); /** * Gets the timestamp of the number of milliseconds that have elapsed since * the Unix epoch (1 January 1970 00:00:00 UTC). * * @static * @memberOf _ * @since 2.4.0 * @category Date * @returns {number} Returns the timestamp. * @example * * _.defer(function(stamp) { * console.log(_.now() - stamp); * }, _.now()); * // => Logs the number of milliseconds it took for the deferred invocation. */ var now = function() { return root.Date.now(); }; module.exports = now; /***/ }), /* 653 */, /* 654 */, /* 655 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: 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 = GutterMenu; var _devtoolsLaunchpad = __webpack_require__(131); function GutterMenu(_ref) { var breakpoint = _ref.breakpoint, line = _ref.line, event = _ref.event, pauseData = _ref.pauseData, toggleBreakpoint = _ref.toggleBreakpoint, showConditionalPanel = _ref.showConditionalPanel, toggleDisabledBreakpoint = _ref.toggleDisabledBreakpoint, isCbPanelOpen = _ref.isCbPanelOpen, closeConditionalPanel = _ref.closeConditionalPanel, continueToHere = _ref.continueToHere; event.stopPropagation(); event.preventDefault(); var gutterItems = { addBreakpoint: { id: "node-menu-add-breakpoint", label: L10N.getStr("editor.addBreakpoint") }, addConditional: { id: "node-menu-add-conditional-breakpoint", label: L10N.getStr("editor.addConditionalBreakpoint") }, removeBreakpoint: { id: "node-menu-remove-breakpoint", label: L10N.getStr("editor.removeBreakpoint") }, editConditional: { id: "node-menu-edit-conditional-breakpoint", label: L10N.getStr("editor.editBreakpoint") }, enableBreakpoint: { id: "node-menu-enable-breakpoint", label: L10N.getStr("editor.enableBreakpoint") }, disableBreakpoint: { id: "node-menu-disable-breakpoint", label: L10N.getStr("editor.disableBreakpoint") }, continueToHere: { id: "node-menu-continue-to-here", label: L10N.getStr("editor.continueToHere.label") } }; var toggleBreakpointItem = Object.assign({ accesskey: "B", disabled: false, click: () => { toggleBreakpoint(line); if (isCbPanelOpen) { closeConditionalPanel(); } } }, breakpoint ? gutterItems.removeBreakpoint : gutterItems.addBreakpoint); var conditionalBreakpoint = Object.assign({ accesskey: "C", disabled: false, click: () => showConditionalPanel(line) }, breakpoint && breakpoint.condition ? gutterItems.editConditional : gutterItems.addConditional); var items = [toggleBreakpointItem, conditionalBreakpoint]; if (pauseData) { var continueToHereItem = _extends({ accesskey: L10N.getStr("editor.continueToHere.accesskey"), disabled: false, click: () => continueToHere(line) }, gutterItems.continueToHere); items.push(continueToHereItem); } if (breakpoint) { var disableBreakpoint = Object.assign({ accesskey: "D", disabled: false, click: () => toggleDisabledBreakpoint(line) }, breakpoint.disabled ? gutterItems.enableBreakpoint : gutterItems.disableBreakpoint); items.push(disableBreakpoint); } (0, _devtoolsLaunchpad.showMenu)(event, items); } /***/ }), /* 656 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var EditorMenu = (() => { var _ref2 = _asyncToGenerator(function* (options) { var event = options.event, onGutterContextMenu = options.onGutterContextMenu; if (event.target.classList.contains("CodeMirror-linenumber")) { return onGutterContextMenu(event); } event.stopPropagation(); event.preventDefault(); (0, _devtoolsLaunchpad.showMenu)(event, getMenuItems(event, options)); }); return function EditorMenu(_x) { return _ref2.apply(this, arguments); }; })(); var _devtoolsLaunchpad = __webpack_require__(131); var _devtoolsSourceMap = __webpack_require__(898); var _clipboard = __webpack_require__(423); var _editor = __webpack_require__(257); function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } function getMenuItems(event, _ref) { var editor = _ref.editor, selectedLocation = _ref.selectedLocation, selectedSource = _ref.selectedSource, showSource = _ref.showSource, onGutterContextMenu = _ref.onGutterContextMenu, jumpToMappedLocation = _ref.jumpToMappedLocation, toggleBlackBox = _ref.toggleBlackBox, addExpression = _ref.addExpression, getFunctionText = _ref.getFunctionText; var copySourceLabel = L10N.getStr("copySource"); var copySourceKey = L10N.getStr("copySource.accesskey"); var copyFunctionLabel = L10N.getStr("copyFunction.label"); var copyFunctionKey = L10N.getStr("copyFunction.accesskey"); var copySourceUri2Label = L10N.getStr("copySourceUri2"); var copySourceUri2Key = L10N.getStr("copySourceUri2.accesskey"); var revealInTreeLabel = L10N.getStr("sourceTabs.revealInTree"); var revealInTreeKey = L10N.getStr("sourceTabs.revealInTree.accesskey"); var blackboxLabel = L10N.getStr("sourceFooter.blackbox"); var unblackboxLabel = L10N.getStr("sourceFooter.unblackbox"); var blackboxKey = L10N.getStr("sourceFooter.blackbox.accesskey"); var toggleBlackBoxLabel = selectedSource.get("isBlackBoxed") ? unblackboxLabel : blackboxLabel; var copySourceUri2 = { id: "node-menu-copy-source-url", label: copySourceUri2Label, accesskey: copySourceUri2Key, disabled: false, click: () => (0, _clipboard.copyToTheClipboard)(selectedSource.get("url")) }; var selectionText = editor.codeMirror.getSelection().trim(); var copySource = { id: "node-menu-copy-source", label: copySourceLabel, accesskey: copySourceKey, disabled: selectionText.length === 0, click: () => (0, _clipboard.copyToTheClipboard)(selectionText) }; var _editor$codeMirror$co = editor.codeMirror.coordsChar({ left: event.clientX }), line = _editor$codeMirror$co.line; var sourceLocation = (0, _editor.getSourceLocationFromMouseEvent)(editor, selectedLocation, event); var pairedType = (0, _devtoolsSourceMap.isOriginalId)(selectedLocation.sourceId) ? L10N.getStr("generated") : L10N.getStr("original"); var jumpLabel = { accesskey: "C", disabled: false, label: L10N.getFormatStr("editor.jumpToMappedLocation1", pairedType), click: () => jumpToMappedLocation(sourceLocation) }; var watchExpressionLabel = { accesskey: "E", label: L10N.getStr("expressions.placeholder"), click: () => addExpression(editor.codeMirror.getSelection()) }; var blackBoxMenuItem = { id: "node-menu-blackbox", label: toggleBlackBoxLabel, accesskey: blackboxKey, disabled: false, click: () => toggleBlackBox(selectedSource.toJS()) }; // TODO: Find a new way to only add this for mapped sources? var textSelected = editor.codeMirror.somethingSelected(); var showSourceMenuItem = { id: "node-menu-show-source", label: revealInTreeLabel, accesskey: revealInTreeKey, disabled: false, click: () => showSource(selectedSource.get("id")) }; var functionText = getFunctionText(line + 1); var copyFunction = { id: "node-menu-copy-function", label: copyFunctionLabel, accesskey: copyFunctionKey, disabled: !functionText, click: () => (0, _clipboard.copyToTheClipboard)(functionText) }; var menuItems = [copySource, copySourceUri2, copyFunction, { type: "separator" }, jumpLabel, showSourceMenuItem, blackBoxMenuItem]; if (textSelected) { menuItems.push(watchExpressionLabel); } return menuItems; } exports.default = EditorMenu; /***/ }), /* 657 */, /* 658 */, /* 659 */, /* 660 */, /* 661 */, /* 662 */, /* 663 */, /* 664 */, /* 665 */, /* 666 */, /* 667 */, /* 668 */, /* 669 */, /* 670 */, /* 671 */, /* 672 */, /* 673 */, /* 674 */, /* 675 */, /* 676 */, /* 677 */ /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_677__; /***/ }), /* 678 */ /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_678__; /***/ }), /* 679 */, /* 680 */, /* 681 */, /* 682 */, /* 683 */, /* 684 */, /* 685 */, /* 686 */, /* 687 */, /* 688 */, /* 689 */, /* 690 */, /* 691 */, /* 692 */, /* 693 */, /* 694 */, /* 695 */, /* 696 */, /* 697 */, /* 698 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactDom = __webpack_require__(4); var _reactDom2 = _interopRequireDefault(_reactDom); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _BracketArrow = __webpack_require__(1029); var _BracketArrow2 = _interopRequireDefault(_BracketArrow); __webpack_require__(880); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class Popover extends _react.Component { constructor() { super(); this.onMouseLeave = this.onMouseLeave.bind(this); this.state = { left: 0, top: 0 }; } componentDidMount() { var type = this.props.type; var _ref = type == "popover" ? this.getPopoverCoords() : this.getTooltipCoords(), left = _ref.left, top = _ref.top, orientation = _ref.orientation, targetMid = _ref.targetMid; // eslint-disable-next-line react/no-did-mount-set-state this.setState({ left, top, orientation, targetMid }); } calculateLeft(target, editor, popover) { var leftOffset = target.width / 2 - popover.width / 5; var estimatedLeft = target.left + leftOffset; var estimatedRight = estimatedLeft + popover.width; var isOverflowingRight = estimatedRight > editor.right; if (isOverflowingRight) { var adjustedLeft = editor.right - popover.width - 8; return adjustedLeft; } return estimatedLeft; } calculateVerticalOrientation(target, editor, popover) { var estimatedBottom = target.bottom + popover.height; return estimatedBottom > editor.bottom ? "up" : "down"; } getPopoverCoords() { var popover = _reactDom2.default.findDOMNode(this); var popoverRect = popover.getBoundingClientRect(); var editor = document.querySelector(".editor-wrapper"); var editorRect = editor.getBoundingClientRect(); var targetRect = this.props.targetPosition; var popoverLeft = this.calculateLeft(targetRect, editorRect, popoverRect); var orientation = this.calculateVerticalOrientation(targetRect, editorRect, popoverRect); var top = orientation == "down" ? targetRect.bottom : targetRect.top - popoverRect.height; var targetMid = targetRect.left - popoverLeft + targetRect.width / 2 - 8; return { left: popoverLeft, top, orientation, targetMid }; } getTooltipCoords() { var tooltip = _reactDom2.default.findDOMNode(this); var tooltipRect = tooltip.getBoundingClientRect(); var targetRect = this.props.targetPosition; var editor = document.querySelector(".editor-wrapper"); var editorRect = editor.getBoundingClientRect(); var left = this.calculateLeft(targetRect, editorRect, tooltipRect); var top = targetRect.top - tooltipRect.height; return { left, top, orientation: "up", targetMid: 0 }; } getChildren() { var children = this.props.children; var orientation = this.state.orientation; var gap = _react2.default.createElement("div", { className: "gap", key: "gap" }); return orientation === "up" ? [children, gap] : [gap, children]; } getPopoverArrow(orientation, left) { var arrowOrientation = orientation === "up" ? "down" : "up"; var arrowProp = arrowOrientation === "up" ? "top" : "bottom"; var arrowPropValue = arrowOrientation === "up" ? -7 : 5; var arrowProps = { orientation: arrowOrientation, left, [arrowProp]: arrowPropValue }; return _react2.default.createElement(_BracketArrow2.default, arrowProps); } onMouseLeave(e) { var onMouseLeave = this.props.onMouseLeave; if (e.target.className.match(/(bracket-arrow|gap)/)) { return; } onMouseLeave(); } renderPopover() { var _state = this.state, top = _state.top, left = _state.left, orientation = _state.orientation, targetMid = _state.targetMid; var arrow = this.getPopoverArrow(orientation, targetMid); return _react2.default.createElement( "div", { className: (0, _classnames2.default)("popover", { up: orientation === "up" }), onMouseLeave: this.onMouseLeave, style: { top, left } }, arrow, this.getChildren() ); } renderTooltip() { var onMouseLeave = this.props.onMouseLeave; var _state2 = this.state, top = _state2.top, left = _state2.left; return _react2.default.createElement( "div", { className: "tooltip", onMouseLeave: onMouseLeave, style: { top, left } }, this.getChildren() ); } render() { var type = this.props.type; if (type === "tooltip") { return this.renderTooltip(); } return this.renderPopover(); } } Popover.propTypes = { target: _react.PropTypes.object, targetPosition: _react.PropTypes.object, children: _react.PropTypes.object, onMouseLeave: _react.PropTypes.func, type: _react.PropTypes.string }; Popover.defaultProps = { onMouseLeave: () => {}, type: "popover" }; exports.default = Popover; /***/ }), /* 699 */, /* 700 */, /* 701 */, /* 702 */, /* 703 */, /* 704 */, /* 705 */, /* 706 */, /* 707 */, /* 708 */, /* 709 */, /* 710 */, /* 711 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.renderConditionalPanel = undefined; var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactDom = __webpack_require__(4); var _reactDom2 = _interopRequireDefault(_reactDom); var _Close = __webpack_require__(378); var _Close2 = _interopRequireDefault(_Close); __webpack_require__(873); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function renderConditionalPanel(_ref) { var condition = _ref.condition, closePanel = _ref.closePanel, setBreakpoint = _ref.setBreakpoint; var panel = document.createElement("div"); var input = null; function setInput(node) { input = node; } function saveAndClose() { if (input) { setBreakpoint(input.value); } closePanel(); } function onKey(e) { if (e.key === "Enter") { saveAndClose(); } else if (e.key === "Escape") { closePanel(); } } _reactDom2.default.render(_react2.default.createElement( "div", { className: "conditional-breakpoint-panel" }, _react2.default.createElement( "div", { className: "prompt" }, "\xBB" ), _react2.default.createElement("input", { defaultValue: condition, placeholder: L10N.getStr("editor.conditionalPanel.placeholder"), onKeyDown: onKey, ref: setInput }), _react2.default.createElement(_Close2.default, { handleClick: closePanel, buttonClass: "big", tooltip: L10N.getStr("editor.conditionalPanel.close") }) ), panel); return panel; } exports.renderConditionalPanel = renderConditionalPanel; /***/ }), /* 712 */, /* 713 */, /* 714 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _devtoolsConfig = __webpack_require__(828); var _reactDom = __webpack_require__(4); var _reactDom2 = _interopRequireDefault(_reactDom); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _Svg = __webpack_require__(344); var _Svg2 = _interopRequireDefault(_Svg); var _editor = __webpack_require__(257); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var breakpointSvg = document.createElement("div"); _reactDom2.default.render(_react2.default.createElement(_Svg2.default, { name: "breakpoint" }), breakpointSvg); function makeMarker(isDisabled) { var bp = breakpointSvg.cloneNode(true); bp.className = (0, _classnames2.default)("editor new-breakpoint", { "breakpoint-disabled": isDisabled, "folding-enabled": (0, _devtoolsConfig.isEnabled)("codeFolding") }); return bp; } class Breakpoint extends _react.Component { constructor() { super(); this.addBreakpoint = this.addBreakpoint.bind(this); } addBreakpoint() { var _props = this.props, breakpoint = _props.breakpoint, editor = _props.editor, selectedSource = _props.selectedSource; // Hidden Breakpoints are never rendered on the client if (breakpoint.hidden) { return; } // NOTE: we need to wait for the breakpoint to be loaded // to get the generated location if (!selectedSource || breakpoint.loading) { return; } var sourceId = selectedSource.get("id"); var line = (0, _editor.toEditorLine)(sourceId, breakpoint.location.line); (0, _editor.showSourceText)(editor, selectedSource.toJS()); editor.codeMirror.setGutterMarker(line, "breakpoints", makeMarker(breakpoint.disabled)); editor.codeMirror.addLineClass(line, "line", "new-breakpoint"); if (breakpoint.condition) { editor.codeMirror.addLineClass(line, "line", "has-condition"); } else { editor.codeMirror.removeLineClass(line, "line", "has-condition"); } } shouldComponentUpdate(nextProps) { var _props2 = this.props, editor = _props2.editor, breakpoint = _props2.breakpoint, selectedSource = _props2.selectedSource; return editor !== nextProps.editor || breakpoint.disabled !== nextProps.breakpoint.disabled || breakpoint.hidden !== nextProps.breakpoint.hidden || breakpoint.condition !== nextProps.breakpoint.condition || breakpoint.loading !== nextProps.breakpoint.loading || selectedSource !== nextProps.selectedSource; } componentDidMount() { this.addBreakpoint(); } componentDidUpdate() { this.addBreakpoint(); } componentWillUnmount() { var _props3 = this.props, editor = _props3.editor, breakpoint = _props3.breakpoint, selectedSource = _props3.selectedSource; if (!selectedSource) { return; } if (breakpoint.loading) { return; } var sourceId = selectedSource.get("id"); var doc = (0, _editor.getDocument)(sourceId); if (!doc) { return; } var line = (0, _editor.toEditorLine)(sourceId, breakpoint.location.line); // NOTE: when we upgrade codemirror we can use `doc.setGutterMarker` if (doc.setGutterMarker) { doc.setGutterMarker(line, "breakpoints", null); } else { editor.codeMirror.setGutterMarker(line, "breakpoints", null); } doc.removeLineClass(line, "line", "new-breakpoint"); doc.removeLineClass(line, "line", "has-condition"); } render() { return null; } } exports.default = Breakpoint; /***/ }), /* 715 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var markerEl = document.createElement("div"); function makeMarker() { var marker = markerEl.cloneNode(true); marker.className = "editor hit-marker"; return marker; } class HitMarker extends _react.Component { addMarker() { var hitData = this.props.hitData; var line = hitData.line - 1; this.props.editor.setGutterMarker(line, "hit-markers", makeMarker()); this.props.editor.addLineClass(line, "line", "hit-marker"); } shouldComponentUpdate(nextProps) { return this.props.editor !== nextProps.editor || this.props.hitData !== nextProps.hitData; } componentDidMount() { this.addMarker(); } componentDidUpdate() { this.addMarker(); } componentWillUnmount() { var hitData = this.props.hitData; var line = hitData.line - 1; this.props.editor.setGutterMarker(line, "hit-markers", null); this.props.editor.removeLineClass(line, "line", "hit-marker"); } render() { return null; } } exports.default = HitMarker; /***/ }), /* 716 */, /* 717 */, /* 718 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactRedux = __webpack_require__(1189); var _redux = __webpack_require__(3); var _prefs = __webpack_require__(226); var _reactImmutableProptypes = __webpack_require__(150); var _reactImmutableProptypes2 = _interopRequireDefault(_reactImmutableProptypes); var _actions = __webpack_require__(244); var _actions2 = _interopRequireDefault(_actions); var _selectors = __webpack_require__(242); var _devtoolsConfig = __webpack_require__(828); var _Svg = __webpack_require__(344); var _Svg2 = _interopRequireDefault(_Svg); var _Breakpoints = __webpack_require__(725); var _Breakpoints2 = _interopRequireDefault(_Breakpoints); var _Expressions = __webpack_require__(719); var _Expressions2 = _interopRequireDefault(_Expressions); var _devtoolsSplitter = __webpack_require__(910); var _devtoolsSplitter2 = _interopRequireDefault(_devtoolsSplitter); var _Frames = __webpack_require__(1012); var _Frames2 = _interopRequireDefault(_Frames); var _EventListeners = __webpack_require__(736); var _EventListeners2 = _interopRequireDefault(_EventListeners); var _Workers = __webpack_require__(1149); var _Workers2 = _interopRequireDefault(_Workers); var _Accordion = __webpack_require__(739); var _Accordion2 = _interopRequireDefault(_Accordion); var _CommandBar = __webpack_require__(742); var _CommandBar2 = _interopRequireDefault(_CommandBar); var _UtilsBar = __webpack_require__(1185); var _UtilsBar2 = _interopRequireDefault(_UtilsBar); var _ChromeScopes = __webpack_require__(728); var _ChromeScopes2 = _interopRequireDefault(_ChromeScopes); var _Scopes2 = __webpack_require__(731); var _Scopes3 = _interopRequireDefault(_Scopes2); __webpack_require__(921); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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 Scopes = (0, _devtoolsConfig.isEnabled)("chromeScopes") ? _ChromeScopes2.default : _Scopes3.default; function debugBtn(onClick, type, className, tooltip) { return _react2.default.createElement( "button", { onClick: onClick, className: `${type} ${className}`, key: type, title: tooltip }, _react2.default.createElement(_Svg2.default, { name: type, title: tooltip, "aria-label": tooltip }) ); } class SecondaryPanes extends _react.Component { renderBreakpointsToggle() { var _props = this.props, toggleAllBreakpoints = _props.toggleAllBreakpoints, breakpoints = _props.breakpoints, breakpointsDisabled = _props.breakpointsDisabled, breakpointsLoading = _props.breakpointsLoading; var boxClassName = "breakpoints-toggle"; var isIndeterminate = !breakpointsDisabled && breakpoints.some(x => x.disabled); if (breakpoints.size == 0) { return null; } var inputProps = { type: "checkbox", "aria-label": breakpointsDisabled ? L10N.getStr("breakpoints.enable") : L10N.getStr("breakpoints.disable"), className: boxClassName, disabled: breakpointsLoading, onChange: e => { e.stopPropagation(); toggleAllBreakpoints(!breakpointsDisabled); }, onClick: e => e.stopPropagation(), checked: !breakpointsDisabled && !isIndeterminate, ref: input => { if (input) { input.indeterminate = isIndeterminate; } }, title: breakpointsDisabled ? L10N.getStr("breakpoints.enable") : L10N.getStr("breakpoints.disable") }; return _react2.default.createElement("input", inputProps); } watchExpressionHeaderButtons() { return [debugBtn(evt => { evt.stopPropagation(); this.props.evaluateExpressions(); }, "refresh", "refresh", L10N.getStr("watchExpressions.refreshButton"))]; } getScopeItem() { var isPaused = () => !!this.props.pauseData; return { header: L10N.getStr("scopes.header"), component: Scopes, opened: _prefs.prefs.scopesVisible, onToggle: opened => { _prefs.prefs.scopesVisible = opened; }, shouldOpen: isPaused }; } getWatchItem() { return { header: L10N.getStr("watchExpressions.header"), buttons: this.watchExpressionHeaderButtons(), component: _Expressions2.default, opened: true }; } getStartItems() { var scopesContent = this.props.horizontal ? this.getScopeItem() : null; var isPaused = () => !!this.props.pauseData; var items = [{ header: L10N.getStr("breakpoints.header"), buttons: this.renderBreakpointsToggle(), component: _Breakpoints2.default, opened: true }, { header: L10N.getStr("callStack.header"), component: _Frames2.default, opened: _prefs.prefs.callStackVisible, onToggle: opened => { _prefs.prefs.callStackVisible = opened; }, shouldOpen: isPaused }, scopesContent]; if ((0, _devtoolsConfig.isEnabled)("eventListeners")) { items.push({ header: L10N.getStr("eventListenersHeader"), component: _EventListeners2.default }); } if ((0, _devtoolsConfig.isEnabled)("workers")) { items.push({ header: L10N.getStr("workersHeader"), component: _Workers2.default }); } if (this.props.horizontal) { items.unshift(this.getWatchItem()); } return items.filter(item => item); } renderHorizontalLayout() { return _react2.default.createElement(_Accordion2.default, { items: this.getItems() }); } getEndItems() { var items = []; if (!this.props.horizontal) { items.unshift(this.getScopeItem()); } if (!this.props.horizontal) { items.unshift(this.getWatchItem()); } return items; } getItems() { return [].concat(_toConsumableArray(this.getStartItems()), _toConsumableArray(this.getEndItems())); } renderVerticalLayout() { return _react2.default.createElement(_devtoolsSplitter2.default, { initialSize: "300px", minSize: 10, maxSize: "50%", splitterSize: 1, startPanel: _react2.default.createElement(_Accordion2.default, { items: this.getStartItems() }), endPanel: _react2.default.createElement(_Accordion2.default, { items: this.getEndItems() }) }); } renderUtilsBar() { if (!_prefs.features.shortcuts) { return; } return _react2.default.createElement(_UtilsBar2.default, { horizontal: this.props.horizontal, toggleShortcutsModal: this.props.toggleShortcutsModal }); } render() { return _react2.default.createElement( "div", { className: "secondary-panes secondary-panes--sticky-commandbar" }, _react2.default.createElement(_CommandBar2.default, { horizontal: this.props.horizontal }), this.props.horizontal ? this.renderHorizontalLayout() : this.renderVerticalLayout(), this.renderUtilsBar() ); } } SecondaryPanes.propTypes = { evaluateExpressions: _react.PropTypes.func.isRequired, pauseData: _react.PropTypes.object, horizontal: _react.PropTypes.bool, breakpoints: _reactImmutableProptypes2.default.map.isRequired, breakpointsDisabled: _react.PropTypes.bool, breakpointsLoading: _react.PropTypes.bool, toggleAllBreakpoints: _react.PropTypes.func.isRequired, toggleShortcutsModal: _react.PropTypes.func }; SecondaryPanes.contextTypes = { shortcuts: _react.PropTypes.object }; exports.default = (0, _reactRedux.connect)(state => ({ pauseData: (0, _selectors.getPause)(state), breakpoints: (0, _selectors.getBreakpoints)(state), breakpointsDisabled: (0, _selectors.getBreakpointsDisabled)(state), breakpointsLoading: (0, _selectors.getBreakpointsLoading)(state) }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(SecondaryPanes); /***/ }), /* 719 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactRedux = __webpack_require__(1189); var _redux = __webpack_require__(3); var _actions = __webpack_require__(244); var _actions2 = _interopRequireDefault(_actions); var _selectors = __webpack_require__(242); var _expressions = __webpack_require__(1177); var _Close = __webpack_require__(378); var _Close2 = _interopRequireDefault(_Close); var _devtoolsReps = __webpack_require__(924); __webpack_require__(908); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class Expressions extends _react.PureComponent { constructor() { super(...arguments); this.state = { editing: null }; this.renderExpression = this.renderExpression.bind(this); } componentDidMount() { var _props = this.props, expressions = _props.expressions, evaluateExpressions = _props.evaluateExpressions; if (expressions.size > 0) { evaluateExpressions(); } } shouldComponentUpdate(nextProps, nextState) { var editing = this.state.editing; var _props2 = this.props, expressions = _props2.expressions, loadedObjects = _props2.loadedObjects; return expressions !== nextProps.expressions || loadedObjects !== nextProps.loadedObjects || editing !== nextState.editing; } editExpression(expression, _ref) { var depth = _ref.depth; if (depth > 0) { return; } this.setState({ editing: expression.input }); } deleteExpression(e, expression) { e.stopPropagation(); var deleteExpression = this.props.deleteExpression; deleteExpression(expression); } inputKeyPress(e, expression) { if (e.key !== "Enter") { return; } var value = e.target.value; if (value == "") { return; } this.setState({ editing: null }); e.target.value = ""; this.props.updateExpression(value, expression); } renderExpressionEditInput(expression) { return _react2.default.createElement( "span", { className: "expression-input-container", key: expression.input }, _react2.default.createElement("input", { className: "input-expression", type: "text", onKeyPress: e => this.inputKeyPress(e, expression), onBlur: () => this.setState({ editing: null }), defaultValue: expression.input, ref: c => this._input = c }) ); } renderExpression(expression) { var _props3 = this.props, loadObjectProperties = _props3.loadObjectProperties, loadedObjects = _props3.loadedObjects, openLink = _props3.openLink; var editing = this.state.editing; var input = expression.input, updating = expression.updating; if (editing == input) { return this.renderExpressionEditInput(expression); } if (updating) { return; } var _getValue = (0, _expressions.getValue)(expression), value = _getValue.value; var root = { name: expression.input, path: input, contents: { value } }; return _react2.default.createElement( "li", { className: "expression-container", key: input }, _react2.default.createElement( "div", { className: "expression-content" }, _react2.default.createElement(_devtoolsReps.ObjectInspector, { roots: [root], autoExpandDepth: 0, disableWrap: true, disabledFocus: true, onDoubleClick: (items, options) => this.editExpression(expression, options), openLink: openLink, getObjectProperties: id => loadedObjects[id], loadObjectProperties: loadObjectProperties // TODO: See https://github.com/devtools-html/debugger.html/issues/3555. , getObjectEntries: actor => {}, loadObjectEntries: grip => {} }), _react2.default.createElement( "div", { className: "expression-container__close-btn" }, _react2.default.createElement(_Close2.default, { handleClick: e => this.deleteExpression(e, expression) }) ) ) ); } componentDidUpdate() { if (this._input) { this._input.focus(); } } renderNewExpressionInput() { var onKeyPress = e => { if (e.key !== "Enter") { return; } var value = e.target.value; if (value == "") { return; } e.stopPropagation(); e.target.value = ""; this.props.addExpression(value); }; return _react2.default.createElement( "li", { className: "expression-input-container" }, _react2.default.createElement("input", { className: "input-expression", type: "text", placeholder: L10N.getStr("expressions.placeholder"), onBlur: e => e.target.value = "", onKeyPress: onKeyPress }) ); } render() { var expressions = this.props.expressions; return _react2.default.createElement( "ul", { className: "pane expressions-list" }, expressions.map(this.renderExpression), this.renderNewExpressionInput() ); } } exports.default = (0, _reactRedux.connect)(state => ({ pauseInfo: (0, _selectors.getPause)(state), expressions: (0, _selectors.getExpressions)(state), loadedObjects: (0, _selectors.getLoadedObjects)(state) }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Expressions); /***/ }), /* 720 */, /* 721 */, /* 722 */, /* 723 */, /* 724 */, /* 725 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _immutable = __webpack_require__(146); var I = _interopRequireWildcard(_immutable); var _reactRedux = __webpack_require__(1189); var _reselect = __webpack_require__(993); var _redux = __webpack_require__(3); var _devtoolsConfig = __webpack_require__(828); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _actions = __webpack_require__(244); var _actions2 = _interopRequireDefault(_actions); var _selectors = __webpack_require__(242); var _breakpoint = __webpack_require__(1057); var _utils = __webpack_require__(234); var _source = __webpack_require__(233); var _devtoolsLaunchpad = __webpack_require__(131); var _Close = __webpack_require__(378); var _Close2 = _interopRequireDefault(_Close); __webpack_require__(907); var _lodash = __webpack_require__(2); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function isCurrentlyPausedAtBreakpoint(pause, breakpoint) { if (!pause || pause.isInterrupted) { return false; } var bpId = (0, _breakpoint.makeLocationId)(breakpoint.location); var pausedId = (0, _breakpoint.makeLocationId)((0, _lodash.get)(pause, "frame.location")); return bpId === pausedId; } function renderSourceLocation(source, line, column) { var filename = source ? (0, _source.getFilename)(source.toJS()) : null; var isWasm = source && source.get("isWasm"); var columnVal = (0, _devtoolsConfig.isEnabled)("columnBreakpoints") && column ? `:${column}` : ""; var bpLocation = isWasm ? `0x${line.toString(16).toUpperCase()}` : `${line}${columnVal}`; if (!filename) { return null; } return _react2.default.createElement( "div", { className: "location" }, `${(0, _utils.endTruncateStr)(filename, 30)}: ${bpLocation}` ); } class Breakpoints extends _react.PureComponent { shouldComponentUpdate(nextProps, nextState) { var breakpoints = this.props.breakpoints; return breakpoints !== nextProps.breakpoints; } handleCheckbox(breakpoint) { if (breakpoint.loading) { return; } if (breakpoint.disabled) { this.props.enableBreakpoint(breakpoint.location); } else { this.props.disableBreakpoint(breakpoint.location); } } showContextMenu(e, breakpoint) { var _props = this.props, removeBreakpoint = _props.removeBreakpoint, removeBreakpoints = _props.removeBreakpoints, removeAllBreakpoints = _props.removeAllBreakpoints, toggleBreakpoints = _props.toggleBreakpoints, toggleAllBreakpoints = _props.toggleAllBreakpoints, toggleDisabledBreakpoint = _props.toggleDisabledBreakpoint, setBreakpointCondition = _props.setBreakpointCondition, toggleConditionalBreakpointPanel = _props.toggleConditionalBreakpointPanel, breakpoints = _props.breakpoints; e.preventDefault(); var deleteSelfLabel = L10N.getStr("breakpointMenuItem.deleteSelf2.label"); var deleteAllLabel = L10N.getStr("breakpointMenuItem.deleteAll2.label"); var deleteOthersLabel = L10N.getStr("breakpointMenuItem.deleteOthers2.label"); var enableSelfLabel = L10N.getStr("breakpointMenuItem.enableSelf2.label"); var enableAllLabel = L10N.getStr("breakpointMenuItem.enableAll2.label"); var enableOthersLabel = L10N.getStr("breakpointMenuItem.enableOthers2.label"); var disableSelfLabel = L10N.getStr("breakpointMenuItem.disableSelf2.label"); var disableAllLabel = L10N.getStr("breakpointMenuItem.disableAll2.label"); var disableOthersLabel = L10N.getStr("breakpointMenuItem.disableOthers2.label"); var removeConditionLabel = L10N.getStr("breakpointMenuItem.removeCondition2.label"); var addConditionLabel = L10N.getStr("breakpointMenuItem.addCondition2.label"); var editConditionLabel = L10N.getStr("breakpointMenuItem.editCondition2.label"); var deleteSelfKey = L10N.getStr("breakpointMenuItem.deleteSelf2.accesskey"); var deleteAllKey = L10N.getStr("breakpointMenuItem.deleteAll2.accesskey"); var deleteOthersKey = L10N.getStr("breakpointMenuItem.deleteOthers2.accesskey"); var enableSelfKey = L10N.getStr("breakpointMenuItem.enableSelf2.accesskey"); var enableAllKey = L10N.getStr("breakpointMenuItem.enableAll2.accesskey"); var enableOthersKey = L10N.getStr("breakpointMenuItem.enableOthers2.accesskey"); var disableSelfKey = L10N.getStr("breakpointMenuItem.disableSelf2.accesskey"); var disableAllKey = L10N.getStr("breakpointMenuItem.disableAll2.accesskey"); var disableOthersKey = L10N.getStr("breakpointMenuItem.disableOthers2.accesskey"); var removeConditionKey = L10N.getStr("breakpointMenuItem.removeCondition2.accesskey"); var editConditionKey = L10N.getStr("breakpointMenuItem.editCondition2.accesskey"); var addConditionKey = L10N.getStr("breakpointMenuItem.addCondition2.accesskey"); var otherBreakpoints = breakpoints.filter(b => b !== breakpoint); var enabledBreakpoints = breakpoints.filter(b => !b.disabled); var disabledBreakpoints = breakpoints.filter(b => b.disabled); var otherEnabledBreakpoints = breakpoints.filter(b => !b.disabled && b !== breakpoint); var otherDisabledBreakpoints = breakpoints.filter(b => b.disabled && b !== breakpoint); var deleteSelf = { id: "node-menu-delete-self", label: deleteSelfLabel, accesskey: deleteSelfKey, disabled: false, click: () => removeBreakpoint(breakpoint.location) }; var deleteAll = { id: "node-menu-delete-all", label: deleteAllLabel, accesskey: deleteAllKey, disabled: false, click: () => removeAllBreakpoints() }; var deleteOthers = { id: "node-menu-delete-other", label: deleteOthersLabel, accesskey: deleteOthersKey, disabled: false, click: () => removeBreakpoints(otherBreakpoints) }; var enableSelf = { id: "node-menu-enable-self", label: enableSelfLabel, accesskey: enableSelfKey, disabled: false, click: () => toggleDisabledBreakpoint(breakpoint.location.line) }; var enableAll = { id: "node-menu-enable-all", label: enableAllLabel, accesskey: enableAllKey, disabled: false, click: () => toggleAllBreakpoints(false) }; var enableOthers = { id: "node-menu-enable-others", label: enableOthersLabel, accesskey: enableOthersKey, disabled: false, click: () => toggleBreakpoints(false, otherDisabledBreakpoints) }; var disableSelf = { id: "node-menu-disable-self", label: disableSelfLabel, accesskey: disableSelfKey, disabled: false, click: () => toggleDisabledBreakpoint(breakpoint.location.line) }; var disableAll = { id: "node-menu-disable-all", label: disableAllLabel, accesskey: disableAllKey, disabled: false, click: () => toggleAllBreakpoints(true) }; var disableOthers = { id: "node-menu-disable-others", label: disableOthersLabel, accesskey: disableOthersKey, click: () => toggleBreakpoints(true, otherEnabledBreakpoints) }; var removeCondition = { id: "node-menu-remove-condition", label: removeConditionLabel, accesskey: removeConditionKey, disabled: false, click: () => setBreakpointCondition(breakpoint.location) }; var addCondition = { id: "node-menu-add-condition", label: addConditionLabel, accesskey: addConditionKey, click: () => { this.selectBreakpoint(breakpoint); toggleConditionalBreakpointPanel(breakpoint.location.line); } }; var editCondition = { id: "node-menu-edit-condition", label: editConditionLabel, accesskey: editConditionKey, click: () => { this.selectBreakpoint(breakpoint); toggleConditionalBreakpointPanel(breakpoint.location.line); } }; var hideEnableSelf = !breakpoint.disabled; var hideEnableAll = disabledBreakpoints.size === 0; var hideEnableOthers = otherDisabledBreakpoints.size === 0; var hideDisableAll = enabledBreakpoints.size === 0; var hideDisableOthers = otherEnabledBreakpoints.size === 0; var hideDisableSelf = breakpoint.disabled; var items = [{ item: enableSelf, hidden: () => hideEnableSelf }, { item: enableAll, hidden: () => hideEnableAll }, { item: enableOthers, hidden: () => hideEnableOthers }, { item: { type: "separator" }, hidden: () => hideEnableSelf && hideEnableAll && hideEnableOthers }, { item: deleteSelf }, { item: deleteAll }, { item: deleteOthers, hidden: () => breakpoints.size === 1 }, { item: { type: "separator" }, hidden: () => hideDisableSelf && hideDisableAll && hideDisableOthers }, { item: disableSelf, hidden: () => hideDisableSelf }, { item: disableAll, hidden: () => hideDisableAll }, { item: disableOthers, hidden: () => hideDisableOthers }, { item: { type: "separator" } }, { item: addCondition, hidden: () => breakpoint.condition }, { item: editCondition, hidden: () => !breakpoint.condition }, { item: removeCondition, hidden: () => !breakpoint.condition }]; (0, _devtoolsLaunchpad.showMenu)(e, (0, _devtoolsLaunchpad.buildMenu)(items)); } selectBreakpoint(breakpoint) { var sourceId = breakpoint.location.sourceId; var line = breakpoint.location.line; this.props.selectSource(sourceId, { line }); } removeBreakpoint(event, breakpoint) { event.stopPropagation(); this.props.removeBreakpoint(breakpoint.location); } toggleConditionalBreakpointPanel(line) { this.props.toggleConditionalBreakpointPanel(line); } renderBreakpoint(breakpoint) { var snippet = breakpoint.text || ""; var locationId = breakpoint.locationId; var line = breakpoint.location.line; var column = breakpoint.location.column; var isCurrentlyPaused = breakpoint.isCurrentlyPaused; var isDisabled = breakpoint.disabled; var isConditional = !!breakpoint.condition; var isHidden = breakpoint.hidden; if (isHidden) { return; } return _react2.default.createElement( "div", { className: (0, _classnames2.default)({ breakpoint, paused: isCurrentlyPaused, disabled: isDisabled, "is-conditional": isConditional }), key: locationId, onClick: () => this.selectBreakpoint(breakpoint), onContextMenu: e => this.showContextMenu(e, breakpoint) }, _react2.default.createElement( "label", { className: "breakpoint-label", title: breakpoint.text }, _react2.default.createElement("input", { type: "checkbox", className: "breakpoint-checkbox", checked: !isDisabled, onChange: () => this.handleCheckbox(breakpoint), onClick: ev => ev.stopPropagation() }), renderSourceLocation(breakpoint.location.source, line, column) ), _react2.default.createElement( "div", { className: "breakpoint-snippet" }, snippet ), _react2.default.createElement(_Close2.default, { handleClick: ev => this.removeBreakpoint(ev, breakpoint), tooltip: L10N.getStr("breakpoints.removeBreakpointTooltip") }) ); } render() { var breakpoints = this.props.breakpoints; var children = breakpoints.size === 0 ? _react2.default.createElement( "div", { className: "pane-info" }, L10N.getStr("breakpoints.none") ) : breakpoints.valueSeq().map(bp => this.renderBreakpoint(bp)); return _react2.default.createElement( "div", { className: "pane breakpoints-list" }, children ); } } function updateLocation(sources, pause, bp) { var source = (0, _selectors.getSourceInSources)(sources, bp.location.sourceId); var isCurrentlyPaused = isCurrentlyPausedAtBreakpoint(pause, bp); var locationId = (0, _breakpoint.makeLocationId)(bp.location); var location = Object.assign({}, bp.location, { source }); var localBP = Object.assign({}, bp, { location, locationId, isCurrentlyPaused }); return localBP; } var _getBreakpoints = (0, _reselect.createSelector)(_selectors.getBreakpoints, _selectors.getSources, _selectors.getPause, (breakpoints, sources, pause) => breakpoints.map(bp => updateLocation(sources, pause, bp)).filter(bp => bp.location.source && !bp.location.source.get("isBlackBoxed"))); exports.default = (0, _reactRedux.connect)((state, props) => ({ breakpoints: _getBreakpoints(state) }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Breakpoints); /***/ }), /* 726 */, /* 727 */, /* 728 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _redux = __webpack_require__(3); var _reactRedux = __webpack_require__(1189); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _actions = __webpack_require__(244); var _actions2 = _interopRequireDefault(_actions); var _selectors = __webpack_require__(242); var _Svg = __webpack_require__(344); var _Svg2 = _interopRequireDefault(_Svg); var _ManagedTree = __webpack_require__(419); var _ManagedTree2 = _interopRequireDefault(_ManagedTree); __webpack_require__(850); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // check to see if its an object with propertie function nodeHasProperties(item) { return !nodeHasChildren(item) && item.contents.value.type === "object"; } function nodeIsPrimitive(item) {} function nodeHasChildren(item) { return Array.isArray(item.contents); } function createNode(name, path, contents) { // The path is important to uniquely identify the item in the entire // tree. This helps debugging & optimizes React's rendering of large // lists. The path will be separated by property name, // i.e. `{ foo: { bar: { baz: 5 }}}` will have a path of `foo/bar/baz` // for the inner object. return { name, path, contents }; } class Scopes extends _react.Component { constructor() { super(...arguments); // Cache of dynamically built nodes. We shouldn't need to clear // this out ever, since we don't ever "switch out" the object // being inspected. this.objectCache = {}; this.getChildren = this.getChildren.bind(this); this.onExpand = this.onExpand.bind(this); this.renderItem = this.renderItem.bind(this); } makeNodesForProperties(objProps, parentPath) { var ownProperties = objProps.ownProperties, prototype = objProps.prototype; var nodes = Object.keys(ownProperties).sort() // Ignore non-concrete values like getters and setters // for now by making sure we have a value. .filter(name => "value" in ownProperties[name]).map(name => createNode(name, `${parentPath}/${name}`, ownProperties[name])); // Add the prototype if it exists and is not null if (prototype && prototype.type !== "null") { nodes.push(createNode("__proto__", `${parentPath}/__proto__`, { value: prototype })); } return nodes; } renderItem(item, depth, focused, _, expanded, _ref) { var setExpanded = _ref.setExpanded; var notEnumberable = false; var objectValue = ""; return _react2.default.createElement( "div", { className: (0, _classnames2.default)("node object-node", { focused: false, "not-enumerable": notEnumberable }), style: { marginLeft: depth * 15 }, key: item.path, onClick: e => { e.stopPropagation(); setExpanded(item, !expanded); } }, _react2.default.createElement(_Svg2.default, { name: "arrow", className: (0, _classnames2.default)({ expanded, hidden: nodeIsPrimitive(item) }) }), _react2.default.createElement( "span", { className: "object-label" }, item.name ), _react2.default.createElement( "span", { className: "object-delimiter" }, objectValue ? ": " : "" ), _react2.default.createElement( "span", { className: "object-value" }, objectValue || "" ) ); } getObjectProperties(item) { this.props.loadedObjects[item.contents.value.objectId]; } getChildren(item) { var obj = item.contents; // Nodes can either have children already, or be an object with // properties that we need to go and fetch. if (nodeHasChildren(item)) { return item.contents; } else if (nodeHasProperties(item)) { var objectId = obj.value.objectId; // Because we are dynamically creating the tree as the user // expands it (not precalcuated tree structure), we cache child // arrays. This not only helps performance, but is necessary // because the expanded state depends on instances of nodes // being the same across renders. If we didn't do this, each // node would be a new instance every render. var key = item.path; if (this.objectCache[key]) { return this.objectCache[key]; } var loadedProps = this.getObjectProperties(item); if (loadedProps) { var children = this.makeNodesForProperties(loadedProps, item.path); this.objectCache[objectId] = children; return children; } return []; } return []; } onExpand(item) { var loadObjectProperties = this.props.loadObjectProperties; if (nodeHasProperties(item)) { loadObjectProperties(item.contents.value); } } getRoots() { return this.props.scopes.map(scope => { var name = scope.name || (scope.type == "global" ? "Window" : ""); return { name: name, path: name, contents: { value: scope.object } }; }); } render() { var pauseInfo = this.props.pauseInfo; if (!pauseInfo) { return _react2.default.createElement( "div", { className: (0, _classnames2.default)("pane", "scopes-list") }, _react2.default.createElement( "div", { className: "pane-info" }, L10N.getStr("scopes.notPaused") ) ); } var roots = this.getRoots(); return _react2.default.createElement( "div", { className: (0, _classnames2.default)("pane", "scopes-list") }, _react2.default.createElement(_ManagedTree2.default, { itemHeight: 20, getParent: item => null, getChildren: this.getChildren, getRoots: () => roots, getPath: item => item.path, autoExpand: 0, autoExpandDepth: 1, autoExpandAll: false, disabledFocus: true, onExpand: this.onExpand, renderItem: this.renderItem }) ); } } exports.default = (0, _reactRedux.connect)(state => ({ pauseInfo: (0, _selectors.getPause)(state), loadedObjects: (0, _selectors.getLoadedObjects)(state), scopes: (0, _selectors.getChromeScopes)(state) }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Scopes); /***/ }), /* 729 */, /* 730 */, /* 731 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _redux = __webpack_require__(3); var _reactRedux = __webpack_require__(1189); var _actions = __webpack_require__(244); var _actions2 = _interopRequireDefault(_actions); var _selectors = __webpack_require__(242); var _scopes = __webpack_require__(732); var _devtoolsReps = __webpack_require__(924); __webpack_require__(850); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class Scopes extends _react.PureComponent { constructor(props) { var pauseInfo = props.pauseInfo, selectedFrame = props.selectedFrame, frameScopes = props.frameScopes; for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } super(props, ...args); this.state = { scopes: (0, _scopes.getScopes)(pauseInfo, selectedFrame, frameScopes) }; } componentWillReceiveProps(nextProps) { var _props = this.props, pauseInfo = _props.pauseInfo, selectedFrame = _props.selectedFrame; var pauseInfoChanged = pauseInfo !== nextProps.pauseInfo; var selectedFrameChange = selectedFrame !== nextProps.selectedFrame; if (pauseInfoChanged || selectedFrameChange) { this.setState({ scopes: (0, _scopes.getScopes)(nextProps.pauseInfo, nextProps.selectedFrame, nextProps.frameScopes) }); } } render() { var _props2 = this.props, pauseInfo = _props2.pauseInfo, loadObjectProperties = _props2.loadObjectProperties, loadedObjects = _props2.loadedObjects; var scopes = this.state.scopes; if (scopes) { return _react2.default.createElement( "div", { className: "pane scopes-list" }, _react2.default.createElement(_devtoolsReps.ObjectInspector, { roots: scopes, autoExpandDepth: 1, getObjectProperties: id => loadedObjects[id], loadObjectProperties: loadObjectProperties, disableWrap: true, disabledFocus: true, dimTopLevelWindow: true // TODO: See https://github.com/devtools-html/debugger.html/issues/3555. , getObjectEntries: actor => {}, loadObjectEntries: grip => {} }) ); } return _react2.default.createElement( "div", { className: "pane scopes-list" }, _react2.default.createElement( "div", { className: "pane-info" }, pauseInfo ? L10N.getStr("scopes.notAvailable") : L10N.getStr("scopes.notPaused") ) ); } } exports.default = (0, _reactRedux.connect)(state => { var selectedFrame = (0, _selectors.getSelectedFrame)(state); var frameScopes = selectedFrame ? (0, _selectors.getFrameScopes)(state, selectedFrame.id) : null; return { selectedFrame, pauseInfo: (0, _selectors.getPause)(state), frameScopes: frameScopes, loadedObjects: (0, _selectors.getLoadedObjects)(state) }; }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Scopes); /***/ }), /* 732 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getSpecialVariables = getSpecialVariables; exports.getScopes = getScopes; var _lodash = __webpack_require__(2); var _frame = __webpack_require__(1014); // Create the tree nodes representing all the variables and arguments // for the bindings from a scope. function getBindingVariables(bindings, parentName) { var args = bindings.arguments.map(arg => (0, _lodash.toPairs)(arg)[0]); var variables = (0, _lodash.toPairs)(bindings.variables); return args.concat(variables).map(binding => ({ name: binding[0], path: `${parentName}/${binding[0]}`, contents: binding[1] })); } function getSourceBindingVariables(bindings, sourceBindings, parentName) { var result = getBindingVariables(bindings, parentName); var index = Object.create(null); result.forEach(entry => { index[entry.name] = { used: false, entry }; }); // Find and replace variables that is present in sourceBindings. var bound = Object.keys(sourceBindings).map(name => { var generatedName = sourceBindings[name]; var foundMap = index[generatedName]; var contents = void 0; if (foundMap) { foundMap.used = true; contents = foundMap.entry.contents; } else { contents = { value: { type: "undefined" } }; } return { name, generatedName, path: `${parentName}/${generatedName}`, contents }; }); // Use rest of them (not found in the sourceBindings) as is. var unused = result.filter(entry => !index[entry.name].used); return bound.concat(unused); } function getSpecialVariables(pauseInfo, path) { var thrown = (0, _lodash.get)(pauseInfo, "why.frameFinished.throw", undefined); var returned = (0, _lodash.get)(pauseInfo, "why.frameFinished.return", undefined); var vars = []; if (thrown !== undefined) { vars.push({ name: "", path: `${path}/`, contents: { value: thrown } }); } if (returned !== undefined) { // Do not display a return value of "undefined", if (!returned || !returned.type || returned.type !== "undefined") { vars.push({ name: "", path: `${path}/`, contents: { value: returned } }); } } return vars; } function getThisVariable(frame, path) { var this_ = frame.this; if (!this_) { return null; } return { name: "", path: `${path}/`, contents: { value: this_ } }; } function getScopes(pauseInfo, selectedFrame, selectedScope) { if (!pauseInfo || !selectedFrame) { return null; } // NOTE: it's possible that we're inspecting an old server // that does not support getting frame scopes directly selectedScope = selectedScope || selectedFrame.scope; if (!selectedScope) { return null; } var scopes = []; var scope = selectedScope; var pausedScopeActor = (0, _lodash.get)(pauseInfo, "frame.scope.actor"); var scopeIndex = 1; do { var _scope = scope, type = _scope.type, actor = _scope.actor; var key = `${actor}-${scopeIndex}`; if (type === "function" || type === "block") { var bindings = scope.bindings; var sourceBindings = scope.sourceBindings; var title = void 0; if (type === "function") { title = scope.function.displayName ? (0, _frame.simplifyDisplayName)(scope.function.displayName) : L10N.getStr("anonymous"); } else { title = L10N.getStr("scopes.block"); } var vars = sourceBindings ? getSourceBindingVariables(bindings, sourceBindings, key) : getBindingVariables(bindings, key); // show exception, return, and this variables in innermost scope if (scope.actor === pausedScopeActor) { vars = vars.concat(getSpecialVariables(pauseInfo, key)); } if (scope.actor === selectedScope.actor) { var this_ = getThisVariable(selectedFrame, key); if (this_) { vars.push(this_); } } if (vars && vars.length) { vars.sort((a, b) => a.name.localeCompare(b.name)); scopes.push({ name: title, path: key, contents: vars }); } } else if (type === "object") { var value = scope.object; // If this is the global window scope, mark it as such so that it will // preview Window: Global instead of Window: Window if (value.class === "Window") { value = Object.assign({}, scope.object, { displayClass: "Global" }); } scopes.push({ name: scope.object.class, path: key, contents: { value } }); } scopeIndex++; } while (scope = scope.parent); // eslint-disable-line no-cond-assign return scopes; } /***/ }), /* 733 */, /* 734 */, /* 735 */, /* 736 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _redux = __webpack_require__(3); var _reactRedux = __webpack_require__(1189); var _actions = __webpack_require__(244); var _actions2 = _interopRequireDefault(_actions); var _selectors = __webpack_require__(242); var _Close = __webpack_require__(378); var _Close2 = _interopRequireDefault(_Close); __webpack_require__(915); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class EventListeners extends _react.Component { constructor() { super(...arguments); this.renderListener = this.renderListener.bind(this); } renderListener(_ref) { var type = _ref.type, selector = _ref.selector, line = _ref.line, sourceId = _ref.sourceId, breakpoint = _ref.breakpoint; var checked = breakpoint && !breakpoint.disabled; var location = { sourceId, line }; return _react2.default.createElement( "div", { className: "listener", onClick: () => this.props.selectSource(sourceId, { line }), key: `${type}.${selector}.${sourceId}.${line}` }, _react2.default.createElement("input", { type: "checkbox", className: "listener-checkbox", checked: checked, onChange: () => this.handleCheckbox(breakpoint, location) }), _react2.default.createElement( "span", { className: "type" }, type ), _react2.default.createElement( "span", { className: "selector" }, selector ), breakpoint ? _react2.default.createElement(_Close2.default, { handleClick: ev => this.removeBreakpoint(ev, breakpoint) }) : "" ); } handleCheckbox(breakpoint, location) { if (!breakpoint) { return this.props.addBreakpoint(location); } if (breakpoint.loading) { return; } if (breakpoint.disabled) { this.props.enableBreakpoint(breakpoint.location); } else { this.props.disableBreakpoint(breakpoint.location); } } removeBreakpoint(event, breakpoint) { event.stopPropagation(); this.props.removeBreakpoint(breakpoint.location); } render() { var listeners = this.props.listeners; return _react2.default.createElement( "div", { className: "pane event-listeners" }, listeners.map(this.renderListener) ); } } exports.default = (0, _reactRedux.connect)(state => { var listeners = (0, _selectors.getEventListeners)(state).map(l => Object.assign({}, l, { breakpoint: (0, _selectors.getBreakpoint)(state, { sourceId: l.sourceId, line: l.line }) })); return { listeners }; }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(EventListeners); /***/ }), /* 737 */, /* 738 */, /* 739 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _Svg = __webpack_require__(344); var _Svg2 = _interopRequireDefault(_Svg); __webpack_require__(917); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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); } } class Accordion extends _react.Component { constructor(props) { super(); this.state = { opened: props.items.map(item => item.opened), created: [] }; var self = this; self.renderContainer = this.renderContainer.bind(this); } componentWillReceiveProps(nextProps) { var newOpened = this.state.opened.map((isOpen, i) => { var shouldOpen = nextProps.items[i].shouldOpen; return isOpen || shouldOpen && shouldOpen(); }); this.setState({ opened: newOpened }); } handleHeaderClick(i) { var opened = [].concat(_toConsumableArray(this.state.opened)); var created = [].concat(_toConsumableArray(this.state.created)); var item = this.props.items[i]; opened[i] = !opened[i]; created[i] = true; if (opened[i] && item.onOpened) { item.onOpened(); } if (item.onToggle) { item.onToggle(opened[i]); } this.setState({ opened, created }); } renderContainer(item, i) { var _state = this.state, opened = _state.opened, created = _state.created; var containerClassName = `${item.header.toLowerCase().replace(/\s/g, "-")}-pane`; return _react2.default.createElement( "div", { className: containerClassName, key: i }, _react2.default.createElement( "div", { className: "_header", onClick: () => this.handleHeaderClick(i) }, _react2.default.createElement(_Svg2.default, { name: "arrow", className: opened[i] ? "expanded" : "" }), item.header, item.buttons ? _react2.default.createElement( "div", { className: "header-buttons" }, item.buttons ) : null ), created[i] || opened[i] ? _react2.default.createElement( "div", { className: "_content", style: { display: opened[i] ? "block" : "none" } }, (0, _react.createElement)(item.component, item.componentProps || {}) ) : null ); } render() { return _react2.default.createElement( "div", { className: "accordion" }, this.props.items.map(this.renderContainer) ); } } exports.default = Accordion; /***/ }), /* 740 */, /* 741 */, /* 742 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: 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; }; var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactRedux = __webpack_require__(1189); var _redux = __webpack_require__(3); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _selectors = __webpack_require__(242); var _Svg = __webpack_require__(344); var _Svg2 = _interopRequireDefault(_Svg); var _text = __webpack_require__(389); var _actions = __webpack_require__(244); var _actions2 = _interopRequireDefault(_actions); __webpack_require__(918); var _devtoolsModules = __webpack_require__(830); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var appinfo = _devtoolsModules.Services.appinfo; var isMacOS = appinfo.OS === "Darwin"; var COMMANDS = ["resume", "stepOver", "stepIn", "stepOut"]; var KEYS = { WINNT: { resume: "F8", pause: "F8", stepOver: "F10", stepIn: "F11", stepOut: "Shift+F11" }, Darwin: { resume: "Cmd+\\", pause: "Cmd+\\", stepOver: "Cmd+'", stepIn: "Cmd+;", stepOut: "Cmd+Shift+:", stepOutDisplay: "Cmd+Shift+;" }, Linux: { resume: "F8", pause: "F8", stepOver: "F10", stepIn: "Ctrl+F11", stepOut: "Ctrl+Shift+F11" } }; function getKey(action) { return getKeyForOS(appinfo.OS, action); } function getKeyForOS(os, action) { var osActions = KEYS[os] || KEYS.Linux; return osActions[action]; } function formatKey(action) { var key = getKey(`${action}Display`) || getKey(action); if (isMacOS) { var winKey = getKeyForOS("WINNT", `${action}Display`) || getKeyForOS("WINNT", action); // display both Windows type and Mac specific keys return (0, _text.formatKeyShortcut)([key, winKey].join(" ")); } return (0, _text.formatKeyShortcut)(key); } function debugBtn(onClick, type, className, tooltip) { var disabled = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; var props = { onClick, key: type, "aria-label": tooltip, title: tooltip, disabled }; return _react2.default.createElement( "button", _extends({ className: (0, _classnames2.default)(type, className) }, props), _react2.default.createElement(_Svg2.default, { name: type }) ); } class CommandBar extends _react.Component { componentWillUnmount() { var shortcuts = this.context.shortcuts; COMMANDS.forEach(action => shortcuts.off(getKey(action))); if (isMacOS) { COMMANDS.forEach(action => shortcuts.off(getKeyForOS("WINNT", action))); } } componentDidMount() { var shortcuts = this.context.shortcuts; COMMANDS.forEach(action => shortcuts.on(getKey(action), (_, e) => this.handleEvent(e, action))); if (isMacOS) { // The Mac supports both the Windows Function keys // as well as the Mac non-Function keys COMMANDS.forEach(action => shortcuts.on(getKeyForOS("WINNT", action), (_, e) => this.handleEvent(e, action))); } } handleEvent(e, action) { e.preventDefault(); e.stopPropagation(); this.props[action](); } renderStepButtons() { var isPaused = this.props.pause; var className = isPaused ? "active" : "disabled"; var isDisabled = !this.props.pause; return [debugBtn(this.props.stepOver, "stepOver", className, L10N.getFormatStr("stepOverTooltip", formatKey("stepOver")), isDisabled), debugBtn(this.props.stepIn, "stepIn", className, L10N.getFormatStr("stepInTooltip", formatKey("stepIn")), isDisabled), debugBtn(this.props.stepOut, "stepOut", className, L10N.getFormatStr("stepOutTooltip", formatKey("stepOut")), isDisabled)]; } renderPauseButton() { var _props = this.props, pause = _props.pause, breakOnNext = _props.breakOnNext, isWaitingOnBreak = _props.isWaitingOnBreak; if (pause) { return debugBtn(this.props.resume, "resume", "active", L10N.getFormatStr("resumeButtonTooltip", formatKey("resume"))); } if (isWaitingOnBreak) { return debugBtn(null, "pause", "disabled", L10N.getStr("pausePendingButtonTooltip"), true); } return debugBtn(breakOnNext, "pause", "active", L10N.getFormatStr("pauseButtonTooltip", formatKey("pause"))); } /* * The pause on exception button has three states in this order: * 1. don't pause on exceptions [false, false] * 2. pause on uncaught exceptions [true, true] * 3. pause on all exceptions [true, false] */ renderPauseOnExceptions() { var _props2 = this.props, shouldPauseOnExceptions = _props2.shouldPauseOnExceptions, shouldIgnoreCaughtExceptions = _props2.shouldIgnoreCaughtExceptions, pauseOnExceptions = _props2.pauseOnExceptions; if (!shouldPauseOnExceptions && !shouldIgnoreCaughtExceptions) { return debugBtn(() => pauseOnExceptions(true, true), "pause-exceptions", "enabled", L10N.getStr("ignoreExceptions")); } if (shouldPauseOnExceptions && shouldIgnoreCaughtExceptions) { return debugBtn(() => pauseOnExceptions(true, false), "pause-exceptions", "uncaught enabled", L10N.getStr("pauseOnUncaughtExceptions")); } return debugBtn(() => pauseOnExceptions(false, false), "pause-exceptions", "all enabled", L10N.getStr("pauseOnExceptions")); } render() { return _react2.default.createElement( "div", { className: (0, _classnames2.default)("command-bar", { vertical: !this.props.horizontal }) }, this.renderPauseButton(), this.renderStepButtons(), this.renderPauseOnExceptions() ); } } CommandBar.contextTypes = { shortcuts: _react.PropTypes.object }; exports.default = (0, _reactRedux.connect)(state => { return { pause: (0, _selectors.getPause)(state), isWaitingOnBreak: (0, _selectors.getIsWaitingOnBreak)(state), shouldPauseOnExceptions: (0, _selectors.getShouldPauseOnExceptions)(state), shouldIgnoreCaughtExceptions: (0, _selectors.getShouldIgnoreCaughtExceptions)(state) }; }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(CommandBar); /***/ }), /* 743 */, /* 744 */, /* 745 */, /* 746 */, /* 747 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactRedux = __webpack_require__(1189); var _redux = __webpack_require__(3); var _actions = __webpack_require__(244); var _actions2 = _interopRequireDefault(_actions); var _selectors = __webpack_require__(242); var _text = __webpack_require__(389); var _PaneToggle = __webpack_require__(428); var _PaneToggle2 = _interopRequireDefault(_PaneToggle); __webpack_require__(922); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class WelcomeBox extends _react.Component { renderToggleButton() { var _props = this.props, horizontal = _props.horizontal, endPanelCollapsed = _props.endPanelCollapsed, togglePaneCollapse = _props.togglePaneCollapse; if (horizontal) { return; } return _react2.default.createElement(_PaneToggle2.default, { position: "end", collapsed: !endPanelCollapsed, horizontal: horizontal, handleClick: togglePaneCollapse }); } render() { var searchSourcesShortcut = (0, _text.formatKeyShortcut)(L10N.getStr("sources.search.key2")); var searchProjectShortcut = (0, _text.formatKeyShortcut)(L10N.getStr("projectTextSearch.key")); var searchSourcesLabel = L10N.getStr("welcome.search").substring(2); var searchProjectLabel = L10N.getStr("welcome.findInFiles").substring(2); var setActiveSearch = this.props.setActiveSearch; return _react2.default.createElement( "div", { className: "welcomebox" }, _react2.default.createElement( "div", { className: "alignlabel" }, _react2.default.createElement( "div", { className: "shortcutKeys" }, _react2.default.createElement( "p", { onClick: setActiveSearch.bind(null, "source") }, searchSourcesShortcut ), _react2.default.createElement( "p", { onClick: setActiveSearch.bind(null, "project") }, searchProjectShortcut ) ), _react2.default.createElement( "div", { className: "shortcutFunction" }, _react2.default.createElement( "p", { onClick: setActiveSearch.bind(null, "source") }, searchSourcesLabel ), _react2.default.createElement( "p", { onClick: setActiveSearch.bind(null, "project") }, searchProjectLabel ) ), this.renderToggleButton() ) ); } } exports.default = (0, _reactRedux.connect)(state => ({ endPanelCollapsed: (0, _selectors.getPaneCollapse)(state, "end") }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(WelcomeBox); /***/ }), /* 748 */, /* 749 */, /* 750 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactRedux = __webpack_require__(1189); var _redux = __webpack_require__(3); var _immutable = __webpack_require__(146); var I = _interopRequireWildcard(_immutable); var _selectors = __webpack_require__(242); var _ui = __webpack_require__(1128); var _source = __webpack_require__(233); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _actions = __webpack_require__(244); var _actions2 = _interopRequireDefault(_actions); var _Close = __webpack_require__(378); var _Close2 = _interopRequireDefault(_Close); var _Svg = __webpack_require__(344); var _Svg2 = _interopRequireDefault(_Svg); var _devtoolsLaunchpad = __webpack_require__(131); var _lodash = __webpack_require__(2); var _text = __webpack_require__(389); __webpack_require__(923); var _PaneToggle = __webpack_require__(428); var _PaneToggle2 = _interopRequireDefault(_PaneToggle); var _Dropdown = __webpack_require__(751); var _Dropdown2 = _interopRequireDefault(_Dropdown); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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); } } /* * Finds the hidden tabs by comparing the tabs' top offset. * hidden tabs will have a great top offset. * * @param sourceTabs Immutable.list * @param sourceTabEls HTMLCollection * * @returns Immutable.list */ function getHiddenTabs(sourceTabs, sourceTabEls) { sourceTabEls = [].slice.call(sourceTabEls); function getTopOffset() { var topOffsets = sourceTabEls.map(t => t.getBoundingClientRect().top); return Math.min.apply(Math, _toConsumableArray(topOffsets)); } function hasTopOffset(el) { // adding 10px helps account for cases where the tab might be offset by // styling such as selected tabs which don't have a border. var tabTopOffset = getTopOffset(); return el.getBoundingClientRect().top > tabTopOffset + 10; } return sourceTabs.filter((tab, index) => { var element = sourceTabEls[index]; return element && hasTopOffset(element); }); } /** * Clipboard function taken from * https://dxr.mozilla.org/mozilla-central/source/devtools/shared/platform/content/clipboard.js */ function copyToTheClipboard(string) { var doCopy = function (e) { e.clipboardData.setData("text/plain", string); e.preventDefault(); }; document.addEventListener("copy", doCopy); document.execCommand("copy", false, null); document.removeEventListener("copy", doCopy); } class SourceTabs extends _react.PureComponent { constructor(props) { super(props); this.state = { dropdownShown: false, hiddenSourceTabs: I.List() }; this.onTabContextMenu = this.onTabContextMenu.bind(this); this.showContextMenu = this.showContextMenu.bind(this); this.updateHiddenSourceTabs = this.updateHiddenSourceTabs.bind(this); this.toggleSourcesDropdown = this.toggleSourcesDropdown.bind(this); this.renderDropdownSource = this.renderDropdownSource.bind(this); this.renderTabs = this.renderTabs.bind(this); this.renderSourceTab = this.renderSourceTab.bind(this); this.renderSearchTab = this.renderSearchTab.bind(this); this.renderNewButton = this.renderNewButton.bind(this); this.renderDropDown = this.renderDropdown.bind(this); this.renderStartPanelToggleButton = this.renderStartPanelToggleButton.bind(this); this.renderEndPanelToggleButton = this.renderEndPanelToggleButton.bind(this); this.onResize = (0, _lodash.debounce)(() => { this.updateHiddenSourceTabs(); }); } componentDidUpdate(prevProps) { if (!(prevProps === this.props)) { this.updateHiddenSourceTabs(); } } componentDidMount() { this.updateHiddenSourceTabs(); window.addEventListener("resize", this.onResize); } componentWillUnmount() { window.removeEventListener("resize", this.onResize); } onTabContextMenu(event, tab) { event.preventDefault(); this.showContextMenu(event, tab); } showContextMenu(e, tab) { var _props = this.props, closeTab = _props.closeTab, closeTabs = _props.closeTabs, sourceTabs = _props.sourceTabs, showSource = _props.showSource, togglePrettyPrint = _props.togglePrettyPrint; var closeTabLabel = L10N.getStr("sourceTabs.closeTab"); var closeOtherTabsLabel = L10N.getStr("sourceTabs.closeOtherTabs"); var closeTabsToEndLabel = L10N.getStr("sourceTabs.closeTabsToEnd"); var closeAllTabsLabel = L10N.getStr("sourceTabs.closeAllTabs"); var revealInTreeLabel = L10N.getStr("sourceTabs.revealInTree"); var copyLinkLabel = L10N.getStr("sourceTabs.copyLink"); var prettyPrintLabel = L10N.getStr("sourceTabs.prettyPrint"); var closeTabKey = L10N.getStr("sourceTabs.closeTab.accesskey"); var closeOtherTabsKey = L10N.getStr("sourceTabs.closeOtherTabs.accesskey"); var closeTabsToEndKey = L10N.getStr("sourceTabs.closeTabsToEnd.accesskey"); var closeAllTabsKey = L10N.getStr("sourceTabs.closeAllTabs.accesskey"); var revealInTreeKey = L10N.getStr("sourceTabs.revealInTree.accesskey"); var copyLinkKey = L10N.getStr("sourceTabs.copyLink.accesskey"); var prettyPrintKey = L10N.getStr("sourceTabs.prettyPrint.accesskey"); var tabs = sourceTabs.map(t => t.get("id")); var otherTabs = sourceTabs.filter(t => t.get("id") !== tab); var sourceTab = sourceTabs.find(t => t.get("id") == tab); var tabURLs = sourceTabs.map(thisTab => thisTab.get("url")); var otherTabURLs = otherTabs.map(thisTab => thisTab.get("url")); if (!sourceTab) { return; } var isPrettySource = (0, _source.isPretty)(sourceTab.toJS()); var closeTabMenuItem = { id: "node-menu-close-tab", label: closeTabLabel, accesskey: closeTabKey, disabled: false, click: () => closeTab(sourceTab.get("url")) }; var closeOtherTabsMenuItem = { id: "node-menu-close-other-tabs", label: closeOtherTabsLabel, accesskey: closeOtherTabsKey, disabled: false, click: () => closeTabs(otherTabURLs) }; var closeTabsToEndMenuItem = { id: "node-menu-close-tabs-to-end", label: closeTabsToEndLabel, accesskey: closeTabsToEndKey, disabled: false, click: () => { var tabIndex = tabs.findIndex(t => t == tab); closeTabs(tabURLs.filter((t, i) => i > tabIndex)); } }; var closeAllTabsMenuItem = { id: "node-menu-close-all-tabs", label: closeAllTabsLabel, accesskey: closeAllTabsKey, disabled: false, click: () => closeTabs(tabURLs) }; var showSourceMenuItem = { id: "node-menu-show-source", label: revealInTreeLabel, accesskey: revealInTreeKey, disabled: false, click: () => showSource(tab) }; var copySourceUri2 = { id: "node-menu-copy-source-url", label: copyLinkLabel, accesskey: copyLinkKey, disabled: false, click: () => copyToTheClipboard(sourceTab.get("url")) }; var prettyPrint = { id: "node-menu-pretty-print", label: prettyPrintLabel, accesskey: prettyPrintKey, disabled: false, click: () => togglePrettyPrint(sourceTab.get("id")) }; var items = [{ item: closeTabMenuItem }, { item: closeOtherTabsMenuItem, hidden: () => tabs.size === 1 }, { item: closeTabsToEndMenuItem, hidden: () => tabs.some((t, i) => t === tab && tabs.size - 1 === i) }, { item: closeAllTabsMenuItem }, { item: { type: "separator" } }, { item: copySourceUri2 }]; if (!isPrettySource) { items.push({ item: showSourceMenuItem }); items.push({ item: prettyPrint }); } (0, _devtoolsLaunchpad.showMenu)(e, (0, _devtoolsLaunchpad.buildMenu)(items)); } /* * Updates the hiddenSourceTabs state, by * finding the source tabs which are wrapped and are not on the top row. */ updateHiddenSourceTabs() { if (!this.refs.sourceTabs) { return; } var _props2 = this.props, selectedSource = _props2.selectedSource, sourceTabs = _props2.sourceTabs, moveTab = _props2.moveTab; var sourceTabEls = this.refs.sourceTabs.children; var hiddenSourceTabs = getHiddenTabs(sourceTabs, sourceTabEls); if ((0, _ui.isVisible)() && hiddenSourceTabs.indexOf(selectedSource) !== -1) { return moveTab(selectedSource.get("url"), 0); } this.setState({ hiddenSourceTabs }); } toggleSourcesDropdown(e) { this.setState({ dropdownShown: !this.state.dropdownShown }); } renderDropdownSource(source) { var selectSource = this.props.selectSource; var filename = (0, _source.getFilename)(source.toJS()); var onClick = () => selectSource(source.get("id")); return _react2.default.createElement( "li", { key: source.get("id"), onClick: onClick }, filename ); } renderTabs() { var sourceTabs = this.props.sourceTabs; if (!sourceTabs) { return; } return _react2.default.createElement( "div", { className: "source-tabs", ref: "sourceTabs" }, sourceTabs.map(this.renderSourceTab) ); } isProjectSearchEnabled() { return this.props.activeSearch === "project"; } isSourceSearchEnabled() { return this.props.activeSearch === "source"; } renderSearchTab(source) { var _props3 = this.props, closeTab = _props3.closeTab, closeActiveSearch = _props3.closeActiveSearch, setActiveSearch = _props3.setActiveSearch; function tabName(tab) { return `${tab} search results`; } function onClickClose(ev) { ev.stopPropagation(); closeActiveSearch(); closeTab(source); } var className = (0, _classnames2.default)("source-tab", { active: this.isProjectSearchEnabled() || this.isSourceSearchEnabled(), pretty: false }); return _react2.default.createElement( "div", { className: className, key: source, onClick: () => setActiveSearch(source), onContextMenu: e => this.onTabContextMenu(e, source), title: tabName(source) }, _react2.default.createElement( "div", { className: "filename" }, tabName(source) ), _react2.default.createElement(_Close2.default, { handleClick: onClickClose, tooltip: L10N.getStr("sourceTabs.closeTabButtonTooltip") }) ); } renderSourceTab(source) { var _props4 = this.props, selectedSource = _props4.selectedSource, selectSource = _props4.selectSource, closeTab = _props4.closeTab; var filename = (0, _source.getFilename)(source.toJS()); var active = selectedSource && source.get("id") == selectedSource.get("id") && !this.isProjectSearchEnabled() && !this.isSourceSearchEnabled(); var isPrettyCode = (0, _source.isPretty)(source.toJS()); var sourceAnnotation = this.getSourceAnnotation(source); function onClickClose(ev) { ev.stopPropagation(); closeTab(source.get("url")); } var className = (0, _classnames2.default)("source-tab", { active, pretty: isPrettyCode }); return _react2.default.createElement( "div", { className: className, key: source.get("id"), onClick: () => selectSource(source.get("id")), onContextMenu: e => this.onTabContextMenu(e, source.get("id")), title: (0, _source.getFilename)(source.toJS()) }, sourceAnnotation, _react2.default.createElement( "div", { className: "filename" }, filename ), _react2.default.createElement(_Close2.default, { handleClick: onClickClose, tooltip: L10N.getStr("sourceTabs.closeTabButtonTooltip") }) ); } renderNewButton() { var newTabTooltip = L10N.getFormatStr("sourceTabs.newTabButtonTooltip", (0, _text.formatKeyShortcut)(L10N.getStr("sources.search.key2"))); var onButtonClick = () => { if (this.props.searchOn) { return this.props.closeActiveSearch(); } this.props.setActiveSearch("source"); }; return _react2.default.createElement( "div", { className: "new-tab-btn", onClick: onButtonClick, title: newTabTooltip }, _react2.default.createElement(_Svg2.default, { name: "plus" }) ); } renderDropdown() { var hiddenSourceTabs = this.state.hiddenSourceTabs; if (!hiddenSourceTabs || hiddenSourceTabs.size == 0) { return null; } var Panel = _react2.default.createElement( "ul", null, hiddenSourceTabs.map(this.renderDropdownSource) ); return _react2.default.createElement(_Dropdown2.default, { panel: Panel }); } renderStartPanelToggleButton() { return _react2.default.createElement(_PaneToggle2.default, { position: "start", collapsed: !this.props.startPanelCollapsed, handleClick: this.props.togglePaneCollapse }); } renderEndPanelToggleButton() { if (!this.props.horizontal) { return; } return _react2.default.createElement(_PaneToggle2.default, { position: "end", collapsed: !this.props.endPanelCollapsed, handleClick: this.props.togglePaneCollapse, horizontal: this.props.horizontal }); } getSourceAnnotation(source) { var sourceObj = source.toJS(); if ((0, _source.isPretty)(sourceObj)) { return _react2.default.createElement(_Svg2.default, { name: "prettyPrint" }); } if (sourceObj.isBlackBoxed) { return _react2.default.createElement(_Svg2.default, { name: "blackBox" }); } } render() { return _react2.default.createElement( "div", { className: "source-header" }, this.renderStartPanelToggleButton(), this.renderTabs(), this.renderNewButton(), this.renderDropdown(), this.renderEndPanelToggleButton() ); } } exports.default = (0, _reactRedux.connect)(state => { return { selectedSource: (0, _selectors.getSelectedSource)(state), searchTabs: (0, _selectors.getSearchTabs)(state), sourceTabs: (0, _selectors.getSourcesForTabs)(state), activeSearch: (0, _selectors.getActiveSearch)(state), searchOn: (0, _selectors.getActiveSearch)(state) === "source" }; }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(SourceTabs); /***/ }), /* 751 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); __webpack_require__(935); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class Dropdown extends _react.Component { constructor(props) { super(props); this.state = { dropdownShown: false }; this.toggleDropdown = this.toggleDropdown.bind(this); this.renderPanel = this.renderPanel.bind(this); this.renderButton = this.renderButton.bind(this); this.renderMask = this.renderMask.bind(this); } toggleDropdown(e) { this.setState({ dropdownShown: !this.state.dropdownShown }); } renderPanel() { return _react2.default.createElement( "div", { className: "dropdown", onClick: this.toggleDropdown, style: { display: this.state.dropdownShown ? "block" : "none" } }, this.props.panel ); } renderButton() { return _react2.default.createElement( "button", { className: "dropdown-button", onClick: this.toggleDropdown }, "\xBB" ); } renderMask() { return _react2.default.createElement("div", { className: "dropdown-mask", onClick: this.toggleDropdown, style: { display: this.state.dropdownShown ? "block" : "none" } }); } render() { return _react2.default.createElement( "div", { className: "dropdown-block" }, this.renderPanel(), this.renderButton(), this.renderMask() ); } } exports.default = Dropdown; /***/ }), /* 752 */, /* 753 */, /* 754 */, /* 755 */, /* 756 */, /* 757 */, /* 758 */, /* 759 */, /* 760 */, /* 761 */, /* 762 */, /* 763 */, /* 764 */, /* 765 */, /* 766 */, /* 767 */, /* 768 */, /* 769 */, /* 770 */, /* 771 */, /* 772 */, /* 773 */, /* 774 */, /* 775 */, /* 776 */, /* 777 */, /* 778 */, /* 779 */, /* 780 */, /* 781 */, /* 782 */, /* 783 */, /* 784 */, /* 785 */, /* 786 */, /* 787 */, /* 788 */, /* 789 */, /* 790 */, /* 791 */, /* 792 */ /***/ (function(module, exports) { var g; // This works in non-strict mode g = (function() { return this; })(); try { // This works if eval is allowed (see CSP) g = g || Function("return this")() || (1,eval)("this"); } catch(e) { // This works if the window reference is available if(typeof window === "object") g = window; } // g can still be undefined, but nothing to do about it... // We return undefined, instead of nothing here, so it's // easier to handle this case. if(!global) { ...} module.exports = g; /***/ }), /* 793 */ /***/ (function(module, exports) { module.exports = function(module) { if(!module.webpackPolyfill) { module.deprecate = function() {}; module.paths = []; // module.parent = undefined by default if(!module.children) module.children = []; Object.defineProperty(module, "loaded", { enumerable: true, get: function() { return module.l; } }); Object.defineProperty(module, "id", { enumerable: true, get: function() { return module.i; } }); module.webpackPolyfill = 1; } return module; }; /***/ }), /* 794 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: 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.sortEntireTree = sortEntireTree; exports.sortTree = sortTree; var _utils = __webpack_require__(18); /** * Look at the nodes in the source tree, and determine the index of where to * insert a new node. The ordering is index -> folder -> file. * @memberof utils/sources-tree * @static */ function sortEntireTree(tree) { var debuggeeUrl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ""; if ((0, _utils.nodeHasChildren)(tree)) { var contents = sortTree(tree, debuggeeUrl).map(subtree => sortEntireTree(subtree)); return _extends({}, tree, { contents }); } return tree; } /** * Look at the nodes in the source tree, and determine the index of where to * insert a new node. The ordering is index -> folder -> file. * @memberof utils/sources-tree * @static */ function sortTree(tree) { var debuggeeUrl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ""; return tree.contents.sort((previousNode, currentNode) => { var currentNodeIsDir = (0, _utils.nodeHasChildren)(currentNode); var previousNodeIsDir = (0, _utils.nodeHasChildren)(previousNode); if (currentNode.name === "(index)") { return 1; } else if (previousNode.name === "(index)") { return -1; } else if ((0, _utils.isExactUrlMatch)(currentNode.name, debuggeeUrl)) { return 1; } else if ((0, _utils.isExactUrlMatch)(previousNode.name, debuggeeUrl)) { return -1; // If neither is the case, continue to compare alphabetically } else if (previousNodeIsDir && !currentNodeIsDir) { return -1; } else if (!previousNodeIsDir && currentNodeIsDir) { return 1; } return previousNode.name.localeCompare(currentNode.name); }); } /***/ }), /* 795 */, /* 796 */, /* 797 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getGeneratedLocation = undefined; var getGeneratedLocation = exports.getGeneratedLocation = (() => { var _ref = _asyncToGenerator(function* (state, source, location, sourceMaps) { if (!sourceMaps.isOriginalId(location.sourceId)) { return location; } var _ref2 = yield sourceMaps.getGeneratedLocation(location, source), line = _ref2.line, sourceId = _ref2.sourceId, column = _ref2.column; var generatedSource = (0, _selectors.getSource)(state, sourceId); var sourceUrl = generatedSource.get("url"); return { line, sourceId, column: column === 0 ? undefined : column, sourceUrl }; }); return function getGeneratedLocation(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); }; })(); var _selectors = __webpack_require__(242); function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /***/ }), /* 798 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _lodash = __webpack_require__(2); var _frame = __webpack_require__(1014); __webpack_require__(872); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function getFunctionName(func) { var name = func.userDisplayName || func.displayName || func.name; return (0, _frame.simplifyDisplayName)(name); } class PreviewFunction extends _react.Component { renderFunctionName(func) { var name = getFunctionName(func); return _react2.default.createElement( "span", { className: "function-name" }, name ); } renderParams(func) { var _func$parameterNames = func.parameterNames, parameterNames = _func$parameterNames === undefined ? [] : _func$parameterNames; var params = parameterNames.filter(i => i).map(param => _react2.default.createElement( "span", { className: "param", key: param }, param )); var commas = (0, _lodash.times)(params.length - 1).map((_, i) => _react2.default.createElement( "span", { className: "delimiter", key: i }, ", " )); return (0, _lodash.flatten)((0, _lodash.zip)(params, commas)); } render() { return _react2.default.createElement( "span", { className: "function-signature" }, this.renderFunctionName(this.props.func), _react2.default.createElement( "span", { className: "paren" }, "(" ), this.renderParams(this.props.func), _react2.default.createElement( "span", { className: "paren" }, ")" ) ); } } exports.default = PreviewFunction; /***/ }), /* 799 */, /* 800 */, /* 801 */, /* 802 */, /* 803 */, /* 804 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.findScopeByName = exports.getASTLocation = undefined; var getASTLocation = exports.getASTLocation = (() => { var _ref = _asyncToGenerator(function* (source, location) { var symbols = yield (0, _parser.getSymbols)(source); var functions = [].concat(_toConsumableArray(symbols.functions)); var scope = findClosestScope(functions, location); if (scope) { // we only record the line, but at some point we may // also do column offsets var line = location.line - scope.location.start.line; return { name: scope.name, offset: { line } }; } return { name: undefined, offset: location }; }); return function getASTLocation(_x, _x2) { return _ref.apply(this, arguments); }; })(); var findScopeByName = exports.findScopeByName = (() => { var _ref2 = _asyncToGenerator(function* (source, name) { var symbols = yield (0, _parser.getSymbols)(source); var functions = symbols.functions; return functions.find(function (node) { return node.name === name; }); }); return function findScopeByName(_x3, _x4) { return _ref2.apply(this, arguments); }; })(); exports.findClosestScope = findClosestScope; var _parser = __webpack_require__(827); var _contains = __webpack_require__(1127); 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); } } function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } function findClosestScope(functions, location) { return functions.reduce((found, currNode) => { if (currNode.name === "anonymous" || !(0, _contains.containsPosition)(currNode.location, location)) { return found; } if (!found) { return currNode; } if (found.location.start.line > currNode.location.start.line) { return found; } if (found.location.start.line === currNode.location.start.line && found.location.start.column > currNode.location.start.column) { return found; } return currNode; }, null); } /***/ }), /* 805 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = isSelectedFrameVisible; var _pause = __webpack_require__(239); var _sources = __webpack_require__(232); /* * Checks to if the selected frame's source is currently * selected. */ function isSelectedFrameVisible(state) { var selectedLocation = (0, _sources.getSelectedLocation)(state); var selectedFrame = (0, _pause.getSelectedFrame)(state); return selectedFrame && selectedLocation && selectedFrame.location.sourceId == selectedLocation.sourceId; } /***/ }), /* 806 */ /***/ (function(module, exports) { module.exports = "dojo_square" /***/ }), /* 807 */, /* 808 */, /* 809 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _redux = __webpack_require__(3); var _reactRedux = __webpack_require__(1189); var _debounce = __webpack_require__(651); var _debounce2 = _interopRequireDefault(_debounce); var _Popup = __webpack_require__(810); var _Popup2 = _interopRequireDefault(_Popup); var _selectors = __webpack_require__(242); var _actions = __webpack_require__(244); var _actions2 = _interopRequireDefault(_actions); var _editor = __webpack_require__(257); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class Preview extends _react.PureComponent { constructor() { super(); var self = this; self.onScroll = this.onScroll.bind(this); self.onMouseOver = (0, _debounce2.default)(this.onMouseOver, 40); } componentDidMount() { var codeMirror = this.props.editor.codeMirror; var codeMirrorWrapper = codeMirror.getWrapperElement(); codeMirror.on("scroll", this.onScroll); codeMirrorWrapper.addEventListener("mouseover", e => this.onMouseOver(e)); codeMirrorWrapper.addEventListener("mouseup", e => this.onMouseUp(e)); codeMirrorWrapper.addEventListener("mousedown", e => this.onMouseDown(e)); } onMouseOver(e) { var target = e.target; if (this.props.selectedFrameVisible) { (0, _editor.updatePreview)(target, this.props.editor, this.props); } } onMouseUp() { this.currentlySelecting = false; } onMouseDown() { this.currentlySelecting = true; } onScroll() { this.props.clearPreview(); } onClose(e) { this.props.clearPreview(); } render() { var _props = this.props, selectedSource = _props.selectedSource, preview = _props.preview; if (!this.props.editor || !selectedSource || this.currentlySelecting) { return null; } if (!preview || preview.updating) { return null; } var result = preview.result, expression = preview.expression, location = preview.location, cursorPos = preview.cursorPos; var value = result; if (typeof value == "undefined" || value.optimizedOut) { return null; } var editorRange = (0, _editor.toEditorRange)(selectedSource.get("id"), location); return _react2.default.createElement(_Popup2.default, { value: value, editor: this.props.editor, range: editorRange, expression: expression, popoverPos: cursorPos, onClose: e => this.onClose(e) }); } } exports.default = (0, _reactRedux.connect)(state => ({ preview: (0, _selectors.getPreview)(state), selectedSource: (0, _selectors.getSelectedSource)(state), linesInScope: (0, _selectors.getInScopeLines)(state), selectedFrameVisible: (0, _selectors.isSelectedFrameVisible)(state) }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Preview); /***/ }), /* 810 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Popup = undefined; var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactRedux = __webpack_require__(1189); var _redux = __webpack_require__(3); var _devtoolsConfig = __webpack_require__(828); var _devtoolsReps = __webpack_require__(924); var _devtoolsReps2 = _interopRequireDefault(_devtoolsReps); var _actions = __webpack_require__(244); var _actions2 = _interopRequireDefault(_actions); var _selectors = __webpack_require__(242); var _Popover = __webpack_require__(698); var _Popover2 = _interopRequireDefault(_Popover); var _PreviewFunction = __webpack_require__(798); var _PreviewFunction2 = _interopRequireDefault(_PreviewFunction); var _editor = __webpack_require__(257); __webpack_require__(881); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var Rep = _devtoolsReps2.default.REPS.Rep, MODE = _devtoolsReps2.default.MODE, ObjectInspectorUtils = _devtoolsReps2.default.ObjectInspectorUtils; var ObjectInspector = _devtoolsReps2.default.ObjectInspector; var getChildren = ObjectInspectorUtils.getChildren; class Popup extends _react.Component { componentDidMount() { var _props = this.props, loadObjectProperties = _props.loadObjectProperties, loadedObjects = _props.loadedObjects, value = _props.value, editor = _props.editor, range = _props.range; this.marker = (0, _editor.markText)(editor, "preview-selection", range); if (!value || !value.type == "object") { return; } if (value.actor && !loadedObjects[value.actor]) { loadObjectProperties(value); } } componentWillUnmount() { if (this.marker) { this.marker.clear(); } } getChildren(root, getObjectProperties) { var actors = {}; var children = getChildren({ getObjectProperties, actors, item: root }); if (children.length > 0) { return children; } return null; } renderFunctionPreview(value, root) { var selectSourceURL = this.props.selectSourceURL; var location = value.location; return _react2.default.createElement( "div", { className: "preview-popup", onClick: () => selectSourceURL(location.url, { line: location.line }) }, _react2.default.createElement(_PreviewFunction2.default, { func: value }) ); } renderObjectPreview(expression, root) { return _react2.default.createElement( "div", { className: "preview-popup" }, this.renderObjectInspector(root) ); } renderSimplePreview(value) { var openLink = this.props.openLink; return _react2.default.createElement( "div", { className: "preview-popup" }, Rep({ object: value, mode: MODE.LONG, openLink }) ); } renderObjectInspector(root) { var _props2 = this.props, loadObjectProperties = _props2.loadObjectProperties, loadedObjects = _props2.loadedObjects, openLink = _props2.openLink; var getObjectProperties = id => loadedObjects[id]; var roots = this.getChildren(root, getObjectProperties); if (!roots) { return null; } return _react2.default.createElement(ObjectInspector, { roots: roots, autoExpandDepth: 0, disableWrap: true, disabledFocus: true, openLink: openLink, getObjectProperties: getObjectProperties, loadObjectProperties: loadObjectProperties // TODO: See https://github.com/devtools-html/debugger.html/issues/3555. , getObjectEntries: actor => {}, loadObjectEntries: grip => {} }); } renderAddToExpressionBar(expression) { if (!(0, _devtoolsConfig.isEnabled)("previewWatch")) { return null; } var addExpression = this.props.addExpression; return _react2.default.createElement( "div", { className: "add-to-expression-bar" }, _react2.default.createElement( "div", { className: "prompt" }, "\xBB" ), _react2.default.createElement( "div", { className: "expression-to-save-label" }, expression ), _react2.default.createElement( "div", { className: "expression-to-save-button", onClick: event => addExpression(event) }, L10N.getStr("addWatchExpressionButton") ) ); } renderPreview(expression, value) { var root = { name: expression, path: expression, contents: { value } }; if (value.class === "Function") { return this.renderFunctionPreview(value, root); } if (value.type === "object") { return _react2.default.createElement( "div", null, this.renderObjectPreview(expression, root), this.renderAddToExpressionBar(expression) ); } return this.renderSimplePreview(value); } getPreviewType(value) { if (typeof value == "number" || typeof value == "boolean" || value.type == "null" || value.type == "undefined" || value.class === "Function") { return "tooltip"; } return "popover"; } render() { var _props3 = this.props, popoverPos = _props3.popoverPos, onClose = _props3.onClose, value = _props3.value, expression = _props3.expression; var type = this.getPreviewType(value); return _react2.default.createElement( _Popover2.default, { targetPosition: popoverPos, onMouseLeave: onClose, type: type }, this.renderPreview(expression, value) ); } } exports.Popup = Popup; exports.default = (0, _reactRedux.connect)(state => ({ loadedObjects: (0, _selectors.getLoadedObjects)(state) }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Popup); /***/ }), /* 811 */, /* 812 */, /* 813 */, /* 814 */, /* 815 */, /* 816 */, /* 817 */, /* 818 */, /* 819 */, /* 820 */, /* 821 */, /* 822 */, /* 823 */, /* 824 */, /* 825 */, /* 826 */, /* 827 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.hasSyntaxError = exports.clearSources = exports.setSource = exports.hasSource = exports.getEmptyLines = exports.getNextStep = exports.clearASTs = exports.clearScopes = exports.clearSymbols = exports.getOutOfScopeLocations = exports.getVariablesInScope = exports.getScopes = exports.getSymbols = exports.getClosestExpression = exports.stopParserWorker = exports.startParserWorker = undefined; var _devtoolsUtils = __webpack_require__(900); var WorkerDispatcher = _devtoolsUtils.workerUtils.WorkerDispatcher; var dispatcher = new WorkerDispatcher(); var startParserWorker = exports.startParserWorker = dispatcher.start.bind(dispatcher); var stopParserWorker = exports.stopParserWorker = dispatcher.stop.bind(dispatcher); var getClosestExpression = exports.getClosestExpression = dispatcher.task("getClosestExpression"); var getSymbols = exports.getSymbols = dispatcher.task("getSymbols"); var getScopes = exports.getScopes = dispatcher.task("getScopes"); var getVariablesInScope = exports.getVariablesInScope = dispatcher.task("getVariablesInScope"); var getOutOfScopeLocations = exports.getOutOfScopeLocations = dispatcher.task("getOutOfScopeLocations"); var clearSymbols = exports.clearSymbols = dispatcher.task("clearSymbols"); var clearScopes = exports.clearScopes = dispatcher.task("clearScopes"); var clearASTs = exports.clearASTs = dispatcher.task("clearASTs"); var getNextStep = exports.getNextStep = dispatcher.task("getNextStep"); var getEmptyLines = exports.getEmptyLines = dispatcher.task("getEmptyLines"); var hasSource = exports.hasSource = dispatcher.task("hasSource"); var setSource = exports.setSource = dispatcher.task("setSource"); var clearSources = exports.clearSources = dispatcher.task("clearSources"); var hasSyntaxError = exports.hasSyntaxError = dispatcher.task("hasSyntaxError"); /***/ }), /* 828 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var feature = __webpack_require__(829); module.exports = feature; /***/ }), /* 829 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var pick = __webpack_require__(67); var put = __webpack_require__(112); var fs = __webpack_require__(118); var path = __webpack_require__(119); var config = void 0; var flag = __webpack_require__(52); function isBrowser() { return typeof window == "object" && typeof module == "undefined"; } /** * Gets a config value for a given key * e.g "chrome.webSocketPort" */ function getValue(key) { return pick(config, key); } function setValue(key, value) { return put(config, key, value); } function isEnabled(key) { return config.features && typeof config.features[key] == "object" ? config.features[key].enabled : config.features[key]; } function isDevelopment() { if (isBrowser()) { if (true) { return false; } var href = window.location ? window.location.href : ""; return href.match(/^file:/) || href.match(/localhost:/); } if (isFirefoxPanel()) { // Default to production if compiling for the Firefox panel return "production" === "development"; } return "production" !== "production"; } function isTesting() { return flag.testing; } function isFirefoxPanel() { return "firefox-panel" == "firefox-panel"; } function isApplication() { return "firefox-panel" == "application"; } function isFirefox() { return (/firefox/i.test(navigator.userAgent) ); } function setConfig(value) { config = value; } function getConfig() { return config; } function updateLocalConfig(relativePath) { var localConfigPath = path.resolve(relativePath, "../configs/local.json"); var output = JSON.stringify(config, null, 2); fs.writeFileSync(localConfigPath, output, { flag: "w" }); return output; } module.exports = { isEnabled, getValue, setValue, isDevelopment, isTesting, isFirefoxPanel, isApplication, isFirefox, getConfig, setConfig, updateLocalConfig }; /***/ }), /* 830 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var Menu = __webpack_require__(967); var MenuItem = __webpack_require__(970); var _require = __webpack_require__(971), PrefsHelper = _require.PrefsHelper; var Services = __webpack_require__(22); var KeyShortcuts = __webpack_require__(972); var _require2 = __webpack_require__(60), ZoomKeys = _require2.ZoomKeys; var EventEmitter = __webpack_require__(968); module.exports = { KeyShortcuts, Menu, MenuItem, PrefsHelper, Services, ZoomKeys, EventEmitter }; /***/ }), /* 831 */, /* 832 */, /* 833 */, /* 834 */, /* 835 */, /* 836 */, /* 837 */, /* 838 */, /* 839 */, /* 840 */, /* 841 */, /* 842 */, /* 843 */, /* 844 */, /* 845 */, /* 846 */, /* 847 */, /* 848 */, /* 849 */, /* 850 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 851 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 852 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 853 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 854 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 855 */ /***/ (function(module, exports) { module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF4AAABqCAMAAAAC5xbnAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAFZaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJYTVAgQ29yZSA1LjQuMCI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOnRpZmY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vdGlmZi8xLjAvIj4KICAgICAgICAgPHRpZmY6T3JpZW50YXRpb24+MTwvdGlmZjpPcmllbnRhdGlvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+CkzCJ1kAAAMAUExURUxpcf/fQOF4Wf6qob2GSbyGTP61q++hVlpCNO+ATLuESaZzPYdWLZ1uN/KOQywvJ/OGDfeTGWRSMlpFNvqrQ/yNkPipLfeTGviRGyobJAYCC5BgL/y2MKJrRg0gKH5ULfSTIWhnYyIeJv5/g7K1tfiSGviWIIZgPP+jn6KnqJxqNvmWH/qdTJNkM/6GjPmdKX5JIKiIafeVHTcuLK9uHvTn0/iUH5NiKQUbM/eTH0ExL/6hmv/TStTCqvidK/6Oi/uTkOnZv/mgNLaHbZppFu6ooPeMGYJVJOzbu5pqOap2RY+WnZaOgv+cmahkY/LjzvaEE+vew/2blzs+Ov6enQohIsVvb/+QkP6Bg4+YntB4de7Ru7yfg6KEaf+movj07s7Husx9atqYPJVKKLqESf/47v22GuJOM/3LLf/////ZY//37fyzGP3y4v2rFv3JLP3z5fuiEt9HM/3CKAAAAN1BL//+9f7NLtk7KP726NY0ILB4P/7XYvukH95HLf/88v65Gvy6J/7IKPPizLZ7QPqPEPru3N1AJ7+ITP+vprqAQ+p5IPiZGbV/Rfz8/PyzJv+lmP7VOfitIvqzT/zozeTMtf/RLvycCcSKTP29Hv/ocf/Btv3LOOdpHQQaI/7RY+JcJaltNP66r/3AM6OEMPCMH+nq6/Lz9JpiLzk3M/nYxE40H7WTMcgvHk9AMsLEwyQsL/u8ANrEqurWwJp2Jtrc3WRNR//76fzPsmJHI+FZHvfo1+WiHf3BV/p4dHVdMwABKfDALbV6Kt9PJ91+YHY/L6OVhJksJyIdGcUjB4VrMLd9OMqiL7EqIEJAP/3LXtu5maAFBP7OQ/yWj5GXl7w7K8GLHH1RLNyuLXklJ83Q0WYzLs2THIJJC/+PeXp4cIoABOe4LTUlJ//hbMWXYISKivqqA8udeemXhXtaHOiHc9YLAM1AKI+Ec7ideFVgYNs0BrgSAJh3YcRwII1ZGMCsj2QCAteBEXqDgviWNfW4esd1S8e4ofbDnNVeSrxWUew/xBkAAABkdFJOUwD+EP7//v4CAwX8/mb9HhH/MP3+/TT9TdYm/oP90bA4bPtYefztff7J+buL991SyUn+Y9v62T+cfp3S9P5co9TrkLj++vmqnHCp90X+nf3EvKx27ZH14bSWoqznwX6h/sly7fPC0KykAAAQBUlEQVRo3tyYe0xTWR7Hb+nwKKs4IK9UnAED+CIiLMvE9ZH1Oc64Pnc0O7O7/0nDo8/0BtKUptQ+VgzSUqCVR0oKXWhpAx0oQsOrGDWkQ8AVFggBFBWVSZTERxzHcXZ/59wWWakOGdl/9isgve39nO/9nd/5/c6BIP6/Fcj4X4EDA+Eb/4+00nTkPJAICcW/en6sJB2FJTQmJgp+i00lVtQ/wLYmJ0bFRpfQEnYk7tPx0vGzrNyEhtbR1BKuurpEreaqS0qi4SGIFZpmwIRG19FiWGxZdYlMxpJVVxcpD6UTKxIhYDASi7iyEhmFxz8lXIHyUOgKzDDQ05PrhDKMV9ct4LkCQULsB/Ph9tTIEhpNpi6pk7FldTRZhQfPZXMlWz+QD95jY2ggoZomZHO16jqtlqsVYjyL9cF8BhGlRvQSobYuMjy8lFJ4JODZLDbwUz8EzyBCIhE8kyeMLO0eqqnJR6qp6Q4XAB7xE0KAH8hgMH5d4PdA3Et4vDx1aU12dr5H2fmlAqADnsXdQfzq9QWrKQbRMzMBn79I2d0YD3x2AqSn3+5TET5X4/tGDoIH3lqC6bw82X/h73rwMIAkkTj8l4Ba+qkl3hjvK334OiOZRuN58DWL8JVDXvcsffJJToAmoDZg2+IigStSYOg7Fx5c/XTd51siaTqgv42/Wzkk8eDVyiRR7TCdHlC1aQFFtYOQ2H3h4e9I3EAi6JurPVevqkuw+UweK3wBn323ksKzIfQS/UvNMF2D8H7YPlVJ/aL2JHXDHaVRvgoffOLP06Akdh4Puxe+wQO8srJGgtKexRYIJMokOoVn4BRFt4cmJpcO1UCCZQ/t8Z0yERrNTo1m+j4PWT8nRPhsr3WEj2QVQFYK9Hrlxy81dE1hQNVRz2yGpO4LR8bxx2uSQnzYZxDbAgI0GA8SgioQ3sOuvAt4rqRIiVUE/MKAgMJtuKVF7YCgLCyR7PzuWJ/4CHpt4cOHSXqJRKvVqtVqbThatDVDQ90gKAuIXQRvqiH4SRpqZqmg5NekxN3btWvXTdCu/Jp9PiYXSvymqoOXX9TdrNMWUZJERkokEgEWlLaYOpCMfV9f9PTL/RvXHoS8REEZGtq1yzbY1NQ3PnMOKfNmeKjv6NQetL6IjLlJo1XfrPaKl5kH0unOfYt0X69/+Y9nrvl5O/PBV4zkGLBbzTvXZxkYcJtclnH4JEQ2JtF3UztaldJvvfbiPgJVfEsJHMeAIsNLf/zx9euOxk5V24h98PJpw3oiNaY6D+zydLawTN2AxdZks5n6YARhtJ+P1A8k/DZV7Tcw48obGzs6Hr7uQLqRlvb06VPz1HV+hrQ4Kwu+srIaNpPMy2dCiER1Jg+nWa9jfMbkmAmzNbl6+/ryzhVF+VpZDOAXriVnGwBRb59ApKwJst8sNjrJWQxui6tHIzSTd85AQQstEiK+LtPhOu0IGze5HW6bZSDMMS7Y4TM6ML1Hn5A/FAOimYzH+M3kmOKiwsycBy51FeN/j3N7nwxqx8yArs80MGC3rbWFjdvcpqbT9iLcEnzuP1aRcQ0Y34x4DXGk+YJCYbSSE+hlGzmCxownNxBowcZKhJk6k3t8QKfrC3OZTO4ZGMI9OaoVpPreETGINX9itgG+fnMDZddqVIjF4jEUHfg324zcz5J/I4JQX0tg5fF6bb0mGzzBTN9a+1q3ze4arWBxT7yrrh1+To7gOCPVz5PXxK9eKRTmfngar9qYU+sDcZHcIxGOh7mbIGdMjj7duLt3IOzAZBcLdxyfdc3vd3IrM76+obi4oaF+4hZ559nVnp6eV0Yr83IzXIXcaWi7Rf5GvB1uh6ZfVDBqt/eGmUx2l6lvJk83bjA4cN1L9I3fm6V60M+c/2F29lbcIEnap4wYL3522kAOxs2OjIzMzpNjwZe2UGaiuXOuXnvvQNO422RymYQFXQfmtAXQ76MZS6MDdUeVm9N6z0lSsjqnzGKx8WcjTO6U9Y7nKukU+5//8lM8uVslcw63axwnfa/bNTnZVUE1zKL0JfahoRwvzskQNd54nPLkScqTKbPRKEYTi2Q0ms0bx65Zr21crfjobPD5dajUQ+pztc8cWsuAyW1yTjpHnaOjk97txNv2YV6l0pycDKmqDCRvfZCWRqEVlIzmMeuY+IK/v//Z4Evr1xBBcH8yt0DL7rIarKNOg8uRZp1zjVI9Lfrt1EfzCuYz4Isjb5XDCC33FIoLFxUKsdG82jzmtPYbmAeuXElL+84/GEUnCKc+G5rM5NykY+7ZXJfT5ewqADirgpuwFH84F7FBIlX54+vPf2q5sd/8bAo0t9pJMg12i+HxjfLW8hv3rpz1P7sKRyckAbXIgoKCtEmHY9RlmKyAVyzY6u55Kzhe86AcPoff+Ueyv99iSXn8+Dkg5U9Ii2WQvCUv44hEfFXLd8GX1lEN+pAAB4PFKhh1OA84RyvYbDgIRCf6LTG/my+l8Bl8DkfEeURa7OTjMg6H097efp0ctNj7W8rk8JKTkVsefOkLXKOIKKV3e1XQNdplvcLVKxN2RDF8TOze3IyMBbyqvdViHyQfcdo5ZRw+5zoJ5h/J5Sp4iyPKyG25soXA0fGL1gu4XgmevlCeiA0hfB6Sjhd78SLkUQSODU1ywKva2x/+s8lwx2Oen5Mj7aTco9RXCjzSK5XRW0MXNj5L8ibXExsUfMC3kBbDvzra28vK2jume3puPyrzms+Rqu595jn6pn+sx2wIyqEoP7zTDPRdbhbwlP3Wy8x/90x3lEHv0tALNT3lco95jF+HowvxOaHHex8qKEGMd+0wg46/wUP0+Sr5rdtQb6Y1AYWwqYFtTaPXPOA7L26HvMeFJFaJgpJO/Y3gPdvvk960R+EBfNlPP08P02sDKNFr5Z0eOuAbD6zB+CAi6JOxNE9Q3n8u2d0ufWMfwqNqHB4upESn0wsbVRwvPUfa8jllPYjYMGjYQPzyHwQWLauF8Hc2VtUiVXU0NnZyvN7BPH//dk9FXPPbwU+I5ZyGFq8rD58v4nNUWBw+n5pVCp/xV5w3EQxiQxNzAzULv6y9uYv5OD35lHDKiLxv5PIjUKhDdh6N+AP9m2WfCoNOSqUZix8AY7H4b+Bgfu8RtBMJKaw9M4wOEYHLPBYSezszUMl/8wQibF60cA33g+b45t2QNat2Hjw2XPjVMo/p8KEjX8fL+ainLBrhzVBI0lyRfGKieGL9Z1+sN35/7Bi96uDy3EPqfB3fVh+f0sqBEGHYIix+JZVKOY0P4toaiidSLp0//5HxzrHhnaeWeTw/srkNth8jt//+fXnnfzq1vpC2rjAe9F4bc80MhhZCpqIWnDJLhw8V+2BhD4Wtb13pnvZ0axzahN6QeU0w/ol6r0muFldbRSK2I7F/Fh2KsqogGmOUzGGpobMOdFKmqN10o66Ubuw79yaptrGc5PeQnHvP+X7fd77z7zvnnpq6iApJRx1CTcv9f2d2t/cLPG0jswSsiQ/XN3uSk3DOqI7JPj/paWvzjIzOm7Z3P371o62lRuQET4H/r47bOhdffXtLtWtm5tVP2zyzdppX/tCb+dUXSXieKYAoqd9TsMZYGZ/qlsoxs7nY2Tk8PGwDDP31n297W/W70+0yWZm1l/39BTQhPOwt1uA5Ri7LvjAoGc/omL4T39W6tre3d3e5efXwuK3lwtqu2WRyfNiud/oYHbs/+PXgJ/a7vXO5YriAwa4pCs4+7fcsgfE6k8NYXeVgdDrGxDFrS5XfjKh3dAx6bSjXu0w63d6fnpFZYaA3S4Y1YGFAFXYR5NLI4IMdE/C4DQaRRsT+YOXLRyjB9HVUdOvdVkitLXlOrs7NYU4HctlpC6Gwf1qQs2ey6hhfbYXB2ceI5IzOO7oakBSZ3GD+tT7Q61WfLPh5DtN4sF5LkDTN5yxzyHhXA+yPfEzYet3CfjhhcrVXG/UOoGcWLubMzWkw5zK5TAuBEU892OGsopHVRuSDMEL+SMpXa6joRvViTP5L61m4M6XkHDojYEWOtQKJ0c2aIgj5GcbEILBu2Kx1IPN1oXuXcI1Hc0Yh35W/bDazJisHLQj0LkcEf/v7wrA6GlAWC6rZALbxYsdUCgMhl8vhdjtrgcPQADCKaJx4cqK9o70DQcyqdTscrr6d4vR4+LMv3u5oB0bxNKdC3OoDIHXzl8mpmxWRJ/Gox9jQ3l57uyQu89VTYXHEAGg0RqyfnKo2iK8MYo6ovaJxIh7zZVk/3ZTEgbYbUF9eHglNn/zWaKg4BIOxobzqbi5+19FkgPFQ7W4IzlEw+gZ695OJ+vLublQRBHSShILu+l9xhxV0nZLvq43l+mvOZpUKGs7lGovCNeb/B96qmpudTlCmr6qSIu76jgwN7qSQXjqhd6ugQ/isVqm3M1HsrOzAW6vP5xvrg77lULmdSEt5/XQJLn2uHzEj0uhgZaxh7KyEoqpAL8tyvjGXQ9Wsn8D0jlxWEmCjzCKvVAWOY1nWuxIyA9iDgGduzIHrHVnWAhfl5oAUxL3zYeythLiDxPCDikDKj9V3IMwt9cJ0gJhZs9e7EAgs7y/7/aMS1OuP9h6FsbfnNYerwsHEUIJHn14sSQHz8opanZH/4vXroaFOCUOro6vPL8wCnj9fzVlZDgQWxNIsF8rC7ThexA3Uk/lKCrbhGzcgPKgJY3wcYu+WlvEbNlvnH3fzJzPUoANUcKFSvJYF55gXlgcmlZYmu91O03Rww3al7ko4yqkTgx74rxzegGzYpivzkYqFUCnWvHAMmjZwL59qEqkRyCA/BOGmqKGyBoWYEPDYFsmglA06LMpJ9co9DZ7zc9cHlE0RbpHfPv1syHZVCs9QhDY+vMhP28loAYIghPySdMwpp5iyC/RBkGTTNL+BNvw223Dn0ItnQSAnD5YQD40wh22acEhUUmAPTgftBI/+p4M0+VYJBX8GM/aG1YTiFfS7CkjkZ2gRkiTfzRXSsEOF9Myud+nf6IgBBU9l4y/mWuII+qMArpfjrycxvfM+4PtG7ACF8dEr+KI41tpU2en4zCcFbRwrOXj/DB2rDRUIsYzPlMfzZRU6TxFBvsVLkoQEkjysRMErs+MxXgw0lQIflSf5ri6eoAVBsAgCbKR4eIoqIGkqLT52VNPzSguaSwiQJ2gqs/CMVpsmQQvb2M8EqJ1YF1qgzsf9TRu5x0JRYKygIJTa7Lemq3RNWhGtgMpAGSqeXnNg5rEIlBJAFWVLNZKnSpC4NEWQd5uiBEtaAhcuYIuVOYPQZQdx+eFNn1wuT5WlzWxtbm5tbWUmYDzQHz93J6U1+fHZx3mxB8flnp6UO9eTW88dT+Bzf6osr+d+T0pKMsgnxTzeb0XZ6NguLwHnpMpOtYJ4a2tya1ls+rOIHZ2s5SV22SXv8kdlZWWXvzwe+/5F3rnrwH39cVkizhFFUpOSUo/O/uBUHuBUkiwxRD+tH3V/5HC5hO5zvUcWhsCx9991OIT/AVwXLXUhLDYVAAAAAElFTkSuQmCC" /***/ }), /* 856 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 857 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 858 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 859 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 860 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 861 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 862 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 863 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 864 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 865 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 866 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 867 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 868 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 869 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 870 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 871 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 872 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 873 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 874 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 875 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 876 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 877 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 878 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 879 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 880 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 881 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 882 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 883 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(884); var fs = __webpack_require__(118); function Iterator(text) { var pos = 0, length = text.length; this.peek = function(num) { num = num || 0; if(pos + num >= length) { return null; } return text.charAt(pos + num); }; this.next = function(inc) { inc = inc || 1; if(pos >= length) { return null; } return text.charAt((pos += inc) - inc); }; this.pos = function() { return pos; }; } var rWhitespace = /\s/; function isWhitespace(chr) { return rWhitespace.test(chr); } function consumeWhiteSpace(iter) { var start = iter.pos(); while(isWhitespace(iter.peek())) { iter.next(); } return { type: "whitespace", start: start, end: iter.pos() }; } function startsComment(chr) { return chr === "!" || chr === "#"; } function isEOL(chr) { return chr == null || chr === "\n" || chr === "\r"; } function consumeComment(iter) { var start = iter.pos(); while(!isEOL(iter.peek())) { iter.next(); } return { type: "comment", start: start, end: iter.pos() }; } function startsKeyVal(chr) { return !isWhitespace(chr) && !startsComment(chr); } function startsSeparator(chr) { return chr === "=" || chr === ":" || isWhitespace(chr); } function startsEscapedVal(chr) { return chr === "\\"; } function consumeEscapedVal(iter) { var start = iter.pos(); iter.next(); // move past "\" var curChar = iter.next(); if(curChar === "u") { // encoded unicode char iter.next(4); // Read in the 4 hex values } return { type: "escaped-value", start: start, end: iter.pos() }; } function consumeKey(iter) { var start = iter.pos(), children = []; var curChar; while((curChar = iter.peek()) !== null) { if(startsSeparator(curChar)) { break; } if(startsEscapedVal(curChar)) { children.push(consumeEscapedVal(iter)); continue; } iter.next(); } return { type: "key", start: start, end: iter.pos(), children: children }; } function consumeKeyValSeparator(iter) { var start = iter.pos(); var seenHardSep = false, curChar; while((curChar = iter.peek()) !== null) { if(isEOL(curChar)) { break; } if(isWhitespace(curChar)) { iter.next(); continue; } if(seenHardSep) { break; } seenHardSep = (curChar === ":" || curChar === "="); if(seenHardSep) { iter.next(); continue; } break; // curChar is a non-separtor char } return { type: "key-value-separator", start: start, end: iter.pos() }; } function startsLineBreak(iter) { return iter.peek() === "\\" && isEOL(iter.peek(1)); } function consumeLineBreak(iter) { var start = iter.pos(); iter.next(); // consume \ if(iter.peek() === "\r") { iter.next(); } iter.next(); // consume \n var curChar; while((curChar = iter.peek()) !== null) { if(isEOL(curChar)) { break; } if(!isWhitespace(curChar)) { break; } iter.next(); } return { type: "line-break", start: start, end: iter.pos() }; } function consumeVal(iter) { var start = iter.pos(), children = []; var curChar; while((curChar = iter.peek()) !== null) { if(startsLineBreak(iter)) { children.push(consumeLineBreak(iter)); continue; } if(startsEscapedVal(curChar)) { children.push(consumeEscapedVal(iter)); continue; } if(isEOL(curChar)) { break; } iter.next(); } return { type: "value", start: start, end: iter.pos(), children: children }; } function consumeKeyVal(iter) { return { type: "key-value", start: iter.pos(), children: [ consumeKey(iter), consumeKeyValSeparator(iter), consumeVal(iter) ], end: iter.pos() }; } var renderChild = { "escaped-value": function(child, text) { var type = text.charAt(child.start + 1); if(type === "t") { return "\t"; } if(type === "r") { return "\r"; } if(type === "n") { return "\n"; } if(type === "f") { return "\f"; } if(type !== "u") { return type; } return String.fromCharCode(parseInt(text.substr(child.start + 2, 4), 16)); }, "line-break": function (child, text) { return ""; } }; function rangeToBuffer(range, text) { var start = range.start, buffer = []; for(var i = 0; i < range.children.length; i++) { var child = range.children[i]; buffer.push(text.substring(start, child.start)); buffer.push(renderChild[child.type](child, text)); start = child.end; } buffer.push(text.substring(start, range.end)); return buffer; } function rangesToObject(ranges, text) { var obj = Object.create(null); // Creates to a true hash map for(var i = 0; i < ranges.length; i++) { var range = ranges[i]; if(range.type !== "key-value") { continue; } var key = rangeToBuffer(range.children[0], text).join(""); var val = rangeToBuffer(range.children[2], text).join(""); obj[key] = val; } return obj; } function stringToRanges(text) { var iter = new Iterator(text), ranges = []; var curChar; while((curChar = iter.peek()) !== null) { if(isWhitespace(curChar)) { ranges.push(consumeWhiteSpace(iter)); continue; } if(startsComment(curChar)) { ranges.push(consumeComment(iter)); continue; } if(startsKeyVal(curChar)) { ranges.push(consumeKeyVal(iter)); continue; } throw Error("Something crazy happened. text: '" + text + "'; curChar: '" + curChar + "'"); } return ranges; } function isNewLineRange(range) { if(!range) { return false; } if(range.type === "whitespace") { return true; } if(range.type === "literal") { return isWhitespace(range.text) && range.text.indexOf("\n") > -1; } return false; } function escapeMaker(escapes) { return function escapeKey(key) { var zeros = [ "", "0", "00", "000" ]; var buf = []; for(var i = 0; i < key.length; i++) { var chr = key.charAt(i); if(escapes[chr]) { buf.push(escapes[chr]); continue; } var code = chr.codePointAt(0); if(code <= 0x7F) { buf.push(chr); continue; } var hex = code.toString(16); buf.push("\\u"); buf.push(zeros[4 - hex.length]); buf.push(hex); } return buf.join(""); }; } var escapeKey = escapeMaker({ " ": "\\ ", "\n": "\\n", ":": "\\:", "=": "\\=" }); var escapeVal = escapeMaker({ "\n": "\\n" }); function Editor(text, options) { if (typeof text === 'object') { options = text; text = null; } text = text || ""; var path = options.path; var separator = options.separator || '='; var ranges = stringToRanges(text); var obj = rangesToObject(ranges, text); var keyRange = Object.create(null); // Creates to a true hash map for(var i = 0; i < ranges.length; i++) { var range = ranges[i]; if(range.type !== "key-value") { continue; } var key = rangeToBuffer(range.children[0], text).join(""); keyRange[key] = range; } this.addHeadComment = function(comment) { if(comment == null) { return; } ranges.unshift({ type: "literal", text: "# " + comment.replace(/\n/g, "\n# ") + "\n" }); }; this.get = function(key) { return obj[key]; }; this.set = function(key, val, comment) { if(val == null) { this.unset(key); return; } obj[key] = val; var escapedKey = escapeKey(key); var escapedVal = escapeVal(val); var range = keyRange[key]; if(!range) { keyRange[key] = range = { type: "literal", text: escapedKey + separator + escapedVal }; var prevRange = ranges[ranges.length - 1]; if(prevRange != null && !isNewLineRange(prevRange)) { ranges.push({ type: "literal", text: "\n" }); } ranges.push(range); } // comment === null deletes comment. if comment === undefined, it's left alone if(comment !== undefined) { range.comment = comment && "# " + comment.replace(/\n/g, "\n# ") + "\n"; } if(range.type === "literal") { range.text = escapedKey + separator + escapedVal; if(range.comment != null) { range.text = range.comment + range.text; } } else if(range.type === "key-value") { range.children[2] = { type: "literal", text: escapedVal }; } else { throw "Unknown node type: " + range.type; } }; this.unset = function(key) { if(!(key in obj)) { return; } var range = keyRange[key]; var idx = ranges.indexOf(range); ranges.splice(idx, (isNewLineRange(ranges[idx + 1]) ? 2 : 1)); delete keyRange[key]; delete obj[key]; }; this.valueOf = this.toString = function() { var buffer = [], stack = [].concat(ranges); var node; while((node = stack.shift()) != null) { switch(node.type) { case "literal": buffer.push(node.text); break; case "key": case "value": case "comment": case "whitespace": case "key-value-separator": case "escaped-value": case "line-break": buffer.push(text.substring(node.start, node.end)); break; case "key-value": Array.prototype.unshift.apply(stack, node.children); if(node.comment) { stack.unshift({ type: "literal", text: node.comment }); } break; } } return buffer.join(""); }; this.save = function(newPath, callback) { if(typeof newPath === 'function') { callback = newPath; newPath = path; } newPath = newPath || path; if(!newPath) { if (callback) { return callback("Unknown path"); } throw new Error("Unknown path"); } if (callback) { fs.writeFile(newPath, this.toString(), callback); } else { fs.writeFileSync(newPath, this.toString()); } }; } function createEditor(/*path, options, callback*/) { var path, options, callback; var args = Array.prototype.slice.call(arguments); for (var i = 0; i < args.length; i ++) { var arg = args[i]; if (!path && typeof arg === 'string') { path = arg; } else if (!options && typeof arg === 'object') { options = arg; } else if (!callback && typeof arg === 'function') { callback = arg; } } options = options || {}; path = path || options.path; callback = callback || options.callback; options.path = path; if(!path) { return new Editor(options); } if(!callback) { return new Editor(fs.readFileSync(path).toString(), options); } return fs.readFile(path, function(err, text) { if(err) { return callback(err, null); } text = text.toString(); return callback(null, new Editor(text, options)); }); } function parse(text) { text = text.toString(); var ranges = stringToRanges(text); return rangesToObject(ranges, text); } function read(path, callback) { if(!callback) { return parse(fs.readFileSync(path)); } return fs.readFile(path, function(err, data) { if(err) { return callback(err, null); } return callback(null, parse(data)); }); } module.exports = { parse: parse, read: read, createEditor: createEditor }; /***/ }), /* 884 */ /***/ (function(module, exports) { /*! http://mths.be/codepointat v0.2.0 by @mathias */ if (!String.prototype.codePointAt) { (function() { 'use strict'; // needed to support `apply`/`call` with `undefined`/`null` var defineProperty = (function() { // IE 8 only supports `Object.defineProperty` on DOM elements try { var object = {}; var $defineProperty = Object.defineProperty; var result = $defineProperty(object, object, object) && $defineProperty; } catch(error) {} return result; }()); var codePointAt = function(position) { if (this == null) { throw TypeError(); } var string = String(this); var size = string.length; // `ToInteger` var index = position ? Number(position) : 0; if (index != index) { // better `isNaN` index = 0; } // Account for out-of-bounds indices: if (index < 0 || index >= size) { return undefined; } // Get the first code unit var first = string.charCodeAt(index); var second; if ( // check if it’s the start of a surrogate pair first >= 0xD800 && first <= 0xDBFF && // high surrogate size > index + 1 // there is a next code unit ) { second = string.charCodeAt(index + 1); if (second >= 0xDC00 && second <= 0xDFFF) { // low surrogate // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; } } return first; }; if (defineProperty) { defineProperty(String.prototype, 'codePointAt', { 'value': codePointAt, 'configurable': true, 'writable': true }); } else { String.prototype.codePointAt = codePointAt; } }()); } /***/ }), /* 885 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var startDebuggingNode = (() => { var _ref = _asyncToGenerator(function* (tabId) { var clientType = "node"; var tabs = yield chrome.connectNodeClient(); if (!tabs) { return {}; } var tab = tabs.find(function (t) { return t.id.indexOf(tabId) !== -1; }); if (!tab) { return {}; } var tabConnection = yield chrome.connectNode(tab.tab); chrome.initPage({ clientType, tabConnection }); return { tabs, tab, clientType, client: chrome, tabConnection }; }); return function startDebuggingNode(_x) { return _ref.apply(this, arguments); }; })(); var startDebuggingTab = (() => { var _ref2 = _asyncToGenerator(function* (connTarget) { var clientType = connTarget.type; var client = clientType === "chrome" ? chrome : firefox; var tabs = yield client.connectClient(); if (!tabs) { return undefined; } var tab = tabs.find(function (t) { return t.id.indexOf(connTarget.param) !== -1; }); if (!tab) { return undefined; } var tabConnection = yield client.connectTab(tab.tab); client.initPage({ tab, clientType, tabConnection }); return { tab, tabConnection }; }); return function startDebuggingTab(_x2) { return _ref2.apply(this, arguments); }; })(); function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var firefox = __webpack_require__(886); var chrome = __webpack_require__(887); function startDebugging(connTarget) { if (connTarget.type === "node") { return startDebuggingNode(connTarget.param); } return startDebuggingTab(connTarget); } module.exports = { startDebugging, firefox, chrome }; /***/ }), /* 886 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); var connectClient = (() => { var _ref = _asyncToGenerator(function* () { var useWebSocket = getValue("firefox.webSocketConnection"); var firefoxHost = useWebSocket ? getValue("firefox.host") : "localhost"; var firefoxPort = getValue("firefox.webSocketPort"); var socket = new WebSocket(`ws://${firefoxHost}:${firefoxPort}`); var transport = useWebSocket ? new WebsocketTransport(socket) : new DebuggerTransport(socket); debuggerClient = new DebuggerClient(transport); if (!debuggerClient) { return []; } try { yield debuggerClient.connect(); return yield getTabs(); } catch (err) { console.log(err); return []; } }); return function connectClient() { return _ref.apply(this, arguments); }; })(); var connectTab = (() => { var _ref2 = _asyncToGenerator(function* (tab) { window.addEventListener("beforeunload", function () { if (tabTarget !== null) { tabTarget.destroy(); } }); var tabTarget = yield lookupTabTarget(tab); var _ref3 = yield tabTarget.activeTab.attachThread({ ignoreFrameEnvironment: true }), _ref4 = _slicedToArray(_ref3, 2), threadClient = _ref4[1]; threadClient.resume(); return { debuggerClient, threadClient, tabTarget }; }); return function connectTab(_x) { return _ref2.apply(this, arguments); }; })(); var getTabs = (() => { var _ref5 = _asyncToGenerator(function* () { if (!debuggerClient || !debuggerClient.mainRoot) { return undefined; } var response = yield debuggerClient.listTabs(); return createTabs(response.tabs); }); return function getTabs() { return _ref5.apply(this, arguments); }; })(); function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var _require = __webpack_require__(52), DebuggerClient = _require.DebuggerClient, DebuggerTransport = _require.DebuggerTransport, TargetFactory = _require.TargetFactory, WebsocketTransport = _require.WebsocketTransport; var _require2 = __webpack_require__(828), getValue = _require2.getValue; var debuggerClient = null; function lookupTabTarget(tab) { var options = { client: debuggerClient, form: tab, chrome: false }; return TargetFactory.forRemoteTab(options); } function createTabs(tabs) { return tabs.map(tab => { return { title: tab.title, url: tab.url, id: tab.actor, tab, clientType: "firefox" }; }); } function initPage(options) {} module.exports = { connectClient, connectTab, initPage, getTabs }; /***/ }), /* 887 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var connectClient = (() => { var _ref2 = _asyncToGenerator(function* () { if (!getValue("chrome.debug")) { return createTabs([]); } try { var tabs = yield CDP.List({ port: getValue("chrome.port"), host: getValue("chrome.host") }); return createTabs(tabs, { clientType: "chrome", type: "page" }); } catch (e) { return []; } }); return function connectClient() { return _ref2.apply(this, arguments); }; })(); var connectNodeClient = (() => { var _ref3 = _asyncToGenerator(function* () { if (!getValue("node.debug")) { return createTabs([]); } var tabs = void 0; try { tabs = yield CDP.List({ port: getValue("node.port"), host: getValue("node.host") }); } catch (e) { return undefined; } return createTabs(tabs, { clientType: "node", type: "node" }); }); return function connectNodeClient() { return _ref3.apply(this, arguments); }; })(); var connectTab = (() => { var _ref4 = _asyncToGenerator(function* (tab) { var tabConnection = yield CDP({ tab: tab.webSocketDebuggerUrl }); return tabConnection; }); return function connectTab(_x2) { return _ref4.apply(this, arguments); }; })(); var connectNode = (() => { var _ref5 = _asyncToGenerator(function* (tab) { var tabConnection = yield CDP({ tab: tab.webSocketDebuggerUrl }); window.addEventListener("beforeunload", function () { tabConnection.onclose = function disable() {}; tabConnection.close(); }); return tabConnection; }); return function connectNode(_x3) { return _ref5.apply(this, arguments); }; })(); function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var CDP = __webpack_require__(52); var _require = __webpack_require__(828), getValue = _require.getValue; var _require2 = __webpack_require__(62), networkRequest = _require2.networkRequest; var connection = void 0; function createTabs(tabs) { var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, type = _ref.type, clientType = _ref.clientType; return tabs.filter(tab => { return tab.type == type; }).map(tab => { return { title: tab.title, url: tab.url, id: tab.id, tab, clientType }; }); } window.criRequest = function (options, callback) { var host = options.host, port = options.port, path = options.path; var url = `http://${host}:${port}${path}`; networkRequest(url).then(res => callback(null, res.content)).catch(err => callback(err)); }; function initPage(_ref6) { var tab = _ref6.tab, clientType = _ref6.clientType, tabConnection = _ref6.tabConnection; var Runtime = tabConnection.Runtime, Page = tabConnection.Page; Runtime.enable(); if (clientType == "node") { Runtime.runIfWaitingForDebugger(); } if (clientType == "chrome") { Page.enable(); } return connection; } module.exports = { connectClient, connectNodeClient, connectNode, connectTab, initPage }; /***/ }), /* 888 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.onConnect = undefined; var onConnect = (() => { var _ref = _asyncToGenerator(function* (connection, _ref2) { var services = _ref2.services, toolboxActions = _ref2.toolboxActions; // NOTE: the landing page does not connect to a JS process if (!connection) { return; } var client = getClient(connection); var commands = client.clientCommands; var _bootstrapStore = (0, _bootstrap.bootstrapStore)(commands, { services, toolboxActions }), store = _bootstrapStore.store, actions = _bootstrapStore.actions, selectors = _bootstrapStore.selectors; (0, _bootstrap.bootstrapWorkers)(); var _ref3 = yield client.onConnect(connection, actions), bpClients = _ref3.bpClients; yield loadFromPrefs(actions); window.getGlobalsForTesting = function () { return { store, actions, selectors, client: client.clientCommands, prefs: _prefs.prefs, features: _prefs.features, connection, bpClients, services }; }; if (!(0, _devtoolsConfig.isFirefoxPanel)()) { console.group("Development Notes"); var baseUrl = "https://devtools-html.github.io/debugger.html"; var localDevelopmentUrl = `${baseUrl}/docs/local-development.html`; console.log("Debugging Tips", localDevelopmentUrl); console.log("getGlobalsForTesting", window.getGlobalsForTesting()); console.groupEnd(); } (0, _bootstrap.bootstrapApp)(connection, { store, actions }); return { store, actions, selectors, client: commands }; }); return function onConnect(_x, _x2) { return _ref.apply(this, arguments); }; })(); var _firefox = __webpack_require__(889); var firefox = _interopRequireWildcard(_firefox); var _chrome = __webpack_require__(893); var chrome = _interopRequireWildcard(_chrome); var _prefs = __webpack_require__(226); var _devtoolsConfig = __webpack_require__(828); var _bootstrap = __webpack_require__(897); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } function loadFromPrefs(actions) { var pauseOnExceptions = _prefs.prefs.pauseOnExceptions, ignoreCaughtExceptions = _prefs.prefs.ignoreCaughtExceptions; if (pauseOnExceptions || ignoreCaughtExceptions) { return actions.pauseOnExceptions(pauseOnExceptions, ignoreCaughtExceptions); } } function getClient(connection) { var clientType = connection.tab.clientType; return clientType == "firefox" ? firefox : chrome; } exports.onConnect = onConnect; /***/ }), /* 889 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.clientEvents = exports.clientCommands = exports.onConnect = undefined; var onConnect = exports.onConnect = (() => { var _ref = _asyncToGenerator(function* (connection, actions) { var _connection$tabConnec = connection.tabConnection, tabTarget = _connection$tabConnec.tabTarget, threadClient = _connection$tabConnec.threadClient, debuggerClient = _connection$tabConnec.debuggerClient; if (!tabTarget || !threadClient || !debuggerClient) { return { bpClients: {} }; } var supportsWasm = _prefs.features.wasm && !!debuggerClient.mainRoot.traits.wasmBinarySource; var _setupCommands = (0, _commands.setupCommands)({ threadClient, tabTarget, debuggerClient, supportsWasm }), bpClients = _setupCommands.bpClients; if (actions) { (0, _events.setupEvents)({ threadClient, actions, supportsWasm }); } tabTarget.on("will-navigate", actions.willNavigate); tabTarget.on("navigate", actions.navigated); yield threadClient.reconfigure({ observeAsmJS: true, wasmBinarySource: supportsWasm }); threadClient._parent.listWorkers().then(function (workers) { return actions.setWorkers(workers); }); // In Firefox, we need to initially request all of the sources. This // usually fires off individual `newSource` notifications as the // debugger finds them, but there may be existing sources already in // the debugger (if it's paused already, or if loading the page from // bfcache) so explicity fire `newSource` events for all returned // sources. var sources = yield _commands.clientCommands.fetchSources(); actions.connect(tabTarget.url); yield actions.newSources(sources); // If the threadClient is already paused, make sure to show a // paused state. var pausedPacket = threadClient.getLastPausePacket(); if (pausedPacket) { _events.clientEvents.paused("paused", pausedPacket); } return { bpClients }; }); return function onConnect(_x, _x2) { return _ref.apply(this, arguments); }; })(); var _commands = __webpack_require__(890); var _events = __webpack_require__(892); var _prefs = __webpack_require__(226); function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } exports.clientCommands = _commands.clientCommands; exports.clientEvents = _events.clientEvents; /***/ }), /* 890 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.clientCommands = exports.setupCommands = undefined; var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); var getFrameScopes = (() => { var _ref4 = _asyncToGenerator(function* (frame) { if (frame.scope) { return frame.scope; } return threadClient.getEnvironment(frame.id); }); return function getFrameScopes(_x) { return _ref4.apply(this, arguments); }; })(); var blackBox = (() => { var _ref5 = _asyncToGenerator(function* (sourceId, isBlackBoxed) { var sourceClient = threadClient.source({ actor: sourceId }); if (isBlackBoxed) { yield sourceClient.unblackBox(); } else { yield sourceClient.blackBox(); } return { isBlackBoxed: !isBlackBoxed }; }); return function blackBox(_x2, _x3) { return _ref5.apply(this, arguments); }; })(); var fetchSources = (() => { var _ref6 = _asyncToGenerator(function* () { var _ref7 = yield threadClient.getSources(), sources = _ref7.sources; return sources.map(function (source) { return (0, _create.createSource)(source, { supportsWasm }); }); }); return function fetchSources() { return _ref6.apply(this, arguments); }; })(); var _breakpoint = __webpack_require__(1057); var _create = __webpack_require__(891); function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } var bpClients = void 0; var threadClient = void 0; var tabTarget = void 0; var debuggerClient = void 0; var supportsWasm = void 0; function setupCommands(dependencies) { threadClient = dependencies.threadClient; tabTarget = dependencies.tabTarget; debuggerClient = dependencies.debuggerClient; supportsWasm = dependencies.supportsWasm; bpClients = {}; return { bpClients }; } function resume() { return new Promise(resolve => { threadClient.resume(resolve); }); } function stepIn() { return new Promise(resolve => { threadClient.stepIn(resolve); }); } function stepOver() { return new Promise(resolve => { threadClient.stepOver(resolve); }); } function stepOut() { return new Promise(resolve => { threadClient.stepOut(resolve); }); } function breakOnNext() { return threadClient.breakOnNext(); } function sourceContents(sourceId) { var sourceClient = threadClient.source({ actor: sourceId }); return sourceClient.source(); } function getBreakpointByLocation(location) { var id = (0, _breakpoint.makeLocationId)(location); var bpClient = bpClients[id]; if (bpClient) { var _bpClient$location = bpClient.location, actor = _bpClient$location.actor, url = _bpClient$location.url, line = _bpClient$location.line, column = _bpClient$location.column, condition = _bpClient$location.condition; return { id: bpClient.actor, condition, actualLocation: { line, column, sourceId: actor, sourceUrl: url } }; } return null; } function setBreakpoint(location, condition, noSliding) { var sourceClient = threadClient.source({ actor: location.sourceId }); return sourceClient.setBreakpoint({ line: location.line, column: location.column, condition, noSliding }).then((_ref) => { var _ref2 = _slicedToArray(_ref, 2), actualLocation = _ref2[0].actualLocation, bpClient = _ref2[1]; actualLocation = (0, _create.createBreakpointLocation)(location, actualLocation); var id = (0, _breakpoint.makeLocationId)(actualLocation); bpClients[id] = bpClient; bpClient.location.line = actualLocation.line; bpClient.location.column = actualLocation.column; bpClient.location.url = actualLocation.sourceUrl || ""; return { id, actualLocation }; }); } function removeBreakpoint(generatedLocation) { try { var id = (0, _breakpoint.makeLocationId)(generatedLocation); var bpClient = bpClients[id]; if (!bpClient) { console.warn("No breakpoint to delete on server"); return Promise.resolve(); } delete bpClients[id]; return bpClient.remove(); } catch (_error) { console.warn("No breakpoint to delete on server"); } } function setBreakpointCondition(breakpointId, location, condition, noSliding) { var bpClient = bpClients[breakpointId]; delete bpClients[breakpointId]; return bpClient.setCondition(threadClient, condition, noSliding).then(_bpClient => { bpClients[breakpointId] = _bpClient; return { id: breakpointId }; }); } function evaluate(script, _ref3) { var frameId = _ref3.frameId; var params = frameId ? { frameActor: frameId } : {}; if (!tabTarget || !tabTarget.activeConsole) { return Promise.resolve(); } return new Promise(resolve => { tabTarget.activeConsole.evaluateJS(script, result => resolve(result), params); }); } function debuggeeCommand(script) { tabTarget.activeConsole.evaluateJS(script, () => {}, {}); if (!debuggerClient) { return; } var consoleActor = tabTarget.form.consoleActor; var request = debuggerClient._activeRequests.get(consoleActor); request.emit("json-reply", {}); debuggerClient._activeRequests.delete(consoleActor); return Promise.resolve(); } function navigate(url) { return tabTarget.activeTab.navigateTo(url); } function reload() { return tabTarget.activeTab.reload(); } function getProperties(grip) { var objClient = threadClient.pauseGrip(grip); return objClient.getPrototypeAndProperties().then(resp => { var ownProperties = resp.ownProperties, safeGetterValues = resp.safeGetterValues; for (var name in safeGetterValues) { var _safeGetterValues$nam = safeGetterValues[name], enumerable = _safeGetterValues$nam.enumerable, writable = _safeGetterValues$nam.writable, getterValue = _safeGetterValues$nam.getterValue; ownProperties[name] = { enumerable, writable, value: getterValue }; } return resp; }); } function pauseOnExceptions(shouldPauseOnExceptions, shouldIgnoreCaughtExceptions) { return threadClient.pauseOnExceptions(shouldPauseOnExceptions, shouldIgnoreCaughtExceptions); } function prettyPrint(sourceId, indentSize) { var sourceClient = threadClient.source({ actor: sourceId }); return sourceClient.prettyPrint(indentSize); } function disablePrettyPrint(sourceId) { var sourceClient = threadClient.source({ actor: sourceId }); return sourceClient.disablePrettyPrint(); } function interrupt() { return threadClient.interrupt(); } function eventListeners() { return threadClient.eventListeners(); } function pauseGrip(func) { return threadClient.pauseGrip(func); } var clientCommands = { blackBox, interrupt, eventListeners, pauseGrip, resume, stepIn, stepOut, stepOver, breakOnNext, sourceContents, getBreakpointByLocation, setBreakpoint, removeBreakpoint, setBreakpointCondition, evaluate, debuggeeCommand, navigate, reload, getProperties, getFrameScopes, pauseOnExceptions, prettyPrint, disablePrettyPrint, fetchSources }; exports.setupCommands = setupCommands; exports.clientCommands = clientCommands; /***/ }), /* 891 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createFrame = createFrame; exports.createSource = createSource; exports.createPause = createPause; exports.createBreakpointLocation = createBreakpointLocation; // This module converts Firefox specific types to the generic types function createFrame(frame) { var title = void 0; if (frame.type == "call") { var c = frame.callee; title = c.name || c.userDisplayName || c.displayName || L10N.getStr("anonymous"); } else { title = `(${frame.type})`; } var location = { sourceId: frame.where.source.actor, line: frame.where.line, column: frame.where.column }; return { id: frame.actor, displayName: title, location, generatedLocation: location, this: frame.this, scope: frame.environment }; } function createSource(source, _ref) { var supportsWasm = _ref.supportsWasm; return { id: source.actor, url: source.url, isPrettyPrinted: false, isWasm: supportsWasm && source.introductionType === "wasm", sourceMapURL: source.sourceMapURL, isBlackBoxed: false, loadedState: "unloaded" }; } function createPause(packet, response) { // NOTE: useful when the debugger is already paused var frame = packet.frame || response.frames[0]; return Object.assign({}, packet, { frame: createFrame(frame), frames: response.frames.map(createFrame) }); } // Firefox only returns `actualLocation` if it actually changed, // but we want it always to exist. Format `actualLocation` if it // exists, otherwise use `location`. function createBreakpointLocation(location, actualLocation) { if (!actualLocation) { return location; } return { sourceId: actualLocation.source.actor, sourceUrl: actualLocation.source.url, line: actualLocation.line, column: actualLocation.column }; } /***/ }), /* 892 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.clientEvents = exports.setupEvents = undefined; var paused = (() => { var _ref = _asyncToGenerator(function* (_, packet) { // If paused by an explicit interrupt, which are generated by the // slow script dialog and internal events such as setting // breakpoints, ignore the event. var why = packet.why; if (why.type === "interrupted" && !packet.why.onNext) { return; } // Eagerly fetch the frames var response = yield threadClient.getFrames(0, CALL_STACK_PAGE_SIZE); if (why.type != "alreadyPaused") { var pause = (0, _create.createPause)(packet, response); actions.paused(pause); } }); return function paused(_x, _x2) { return _ref.apply(this, arguments); }; })(); var _create = __webpack_require__(891); var _devtoolsConfig = __webpack_require__(828); function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } var CALL_STACK_PAGE_SIZE = 1000; var threadClient = void 0; var actions = void 0; var supportsWasm = void 0; function setupEvents(dependencies) { threadClient = dependencies.threadClient; actions = dependencies.actions; supportsWasm = dependencies.supportsWasm; if (threadClient) { Object.keys(clientEvents).forEach(eventName => { threadClient.addListener(eventName, clientEvents[eventName]); }); } } function resumed(_, packet) { actions.resumed(packet); } function newSource(_, _ref2) { var source = _ref2.source; actions.newSource((0, _create.createSource)(source, { supportsWasm })); if ((0, _devtoolsConfig.isEnabled)("eventListeners")) { actions.fetchEventListeners(); } } var clientEvents = { paused, resumed, newSource }; exports.setupEvents = setupEvents; exports.clientEvents = clientEvents; /***/ }), /* 893 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.clientEvents = exports.clientCommands = exports.onConnect = undefined; var onConnect = exports.onConnect = (() => { var _ref = _asyncToGenerator(function* (connection, actions) { var tabConnection = connection.tabConnection, type = connection.connTarget.type; var Debugger = tabConnection.Debugger, Runtime = tabConnection.Runtime, Page = tabConnection.Page; Debugger.enable(); Debugger.setPauseOnExceptions({ state: "none" }); Debugger.setAsyncCallStackDepth({ maxDepth: 0 }); if (type == "chrome") { Page.frameNavigated(_events.pageEvents.frameNavigated); Page.frameStartedLoading(_events.pageEvents.frameStartedLoading); Page.frameStoppedLoading(_events.pageEvents.frameStoppedLoading); } Debugger.scriptParsed(_events.clientEvents.scriptParsed); Debugger.scriptFailedToParse(_events.clientEvents.scriptFailedToParse); Debugger.paused(_events.clientEvents.paused); Debugger.resumed(_events.clientEvents.resumed); (0, _commands.setupCommands)({ Debugger, Runtime, Page }); (0, _events.setupEvents)({ actions, Page, type, Runtime }); return {}; }); return function onConnect(_x, _x2) { return _ref.apply(this, arguments); }; })(); var _commands = __webpack_require__(894); var _events = __webpack_require__(896); function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } exports.clientCommands = _commands.clientCommands; exports.clientEvents = _events.clientEvents; /***/ }), /* 894 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.clientCommands = exports.setupCommands = undefined; var setBreakpoint = (() => { var _ref3 = _asyncToGenerator(function* (location, condition) { var _ref4 = yield debuggerAgent.setBreakpoint({ location: (0, _create.toServerLocation)(location), columnNumber: location.column }), breakpointId = _ref4.breakpointId, serverLocation = _ref4.serverLocation; var actualLocation = (0, _create.fromServerLocation)(serverLocation) || location; return { id: breakpointId, actualLocation: actualLocation }; }); return function setBreakpoint(_x, _x2) { return _ref3.apply(this, arguments); }; })(); var getProperties = (() => { var _ref5 = _asyncToGenerator(function* (object) { var _ref6 = yield runtimeAgent.getProperties({ objectId: object.objectId }), result = _ref6.result; var loadedObjects = result.map(_create.createLoadedObject); return { loadedObjects }; }); return function getProperties(_x3) { return _ref5.apply(this, arguments); }; })(); var _create = __webpack_require__(895); function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } var debuggerAgent = void 0; var runtimeAgent = void 0; var pageAgent = void 0; function setupCommands(_ref) { var Debugger = _ref.Debugger, Runtime = _ref.Runtime, Page = _ref.Page; debuggerAgent = Debugger; runtimeAgent = Runtime; pageAgent = Page; } function resume() { return debuggerAgent.resume(); } function stepIn() { return debuggerAgent.stepInto(); } function stepOver() { return debuggerAgent.stepOver(); } function stepOut() { return debuggerAgent.stepOut(); } function pauseOnExceptions(shouldPauseOnExceptions, shouldIgnoreCaughtExceptions) { if (!shouldPauseOnExceptions) { return debuggerAgent.setPauseOnExceptions({ state: "none" }); } var state = shouldIgnoreCaughtExceptions ? "uncaught" : "all"; return debuggerAgent.setPauseOnExceptions({ state }); } function breakOnNext() { return debuggerAgent.pause(); } function sourceContents(sourceId) { return debuggerAgent.getScriptSource({ scriptId: sourceId }).then((_ref2) => { var scriptSource = _ref2.scriptSource; return { source: scriptSource, contentType: null }; }); } function removeBreakpoint(breakpointId) { return debuggerAgent.removeBreakpoint({ breakpointId }); } function evaluate(script) { return runtimeAgent.evaluate({ expression: script }); } function debuggeeCommand(script) { evaluate(script); return Promise.resolve(); } function navigate(url) { return pageAgent.navigate({ url }); } var clientCommands = { resume, stepIn, stepOut, stepOver, pauseOnExceptions, breakOnNext, sourceContents, setBreakpoint, removeBreakpoint, evaluate, debuggeeCommand, navigate, getProperties }; exports.setupCommands = setupCommands; exports.clientCommands = clientCommands; /***/ }), /* 895 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.fromServerLocation = fromServerLocation; exports.toServerLocation = toServerLocation; exports.createFrame = createFrame; exports.createLoadedObject = createLoadedObject; function fromServerLocation(serverLocation) { if (serverLocation) { return { sourceId: serverLocation.scriptId, line: serverLocation.lineNumber + 1, column: serverLocation.columnNumber, sourceUrl: "" }; } } function toServerLocation(location) { return { scriptId: location.sourceId, lineNumber: location.line - 1 }; } function createFrame(frame) { return { id: frame.callFrameId, displayName: frame.functionName, scopeChain: frame.scopeChain, generatedLocation: frame.location, location: fromServerLocation(frame.location) }; } function createLoadedObject(serverObject, parentId) { var value = serverObject.value, name = serverObject.name; return { objectId: value.objectId, parentId, name, value }; } /***/ }), /* 896 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.clientEvents = exports.pageEvents = exports.setupEvents = undefined; var paused = (() => { var _ref2 = _asyncToGenerator(function* (_ref3) { var callFrames = _ref3.callFrames, reason = _ref3.reason, data = _ref3.data, hitBreakpoints = _ref3.hitBreakpoints, asyncStackTrace = _ref3.asyncStackTrace; var frames = callFrames.map(_create.createFrame); var frame = frames[0]; var why = Object.assign({}, { type: reason }, data); var objectId = frame.scopeChain[0].object.objectId; var _ref4 = yield runtimeAgent.getProperties({ objectId }), result = _ref4.result; var loadedObjects = result.map(_create.createLoadedObject); if (clientType == "chrome") { pageAgent.configureOverlay({ message: "Paused in debugger.html" }); } yield actions.paused({ frame, why, frames, loadedObjects }); }); return function paused(_x) { return _ref2.apply(this, arguments); }; })(); var _create = __webpack_require__(895); function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } var actions = void 0; var pageAgent = void 0; var clientType = void 0; var runtimeAgent = void 0; function setupEvents(dependencies) { actions = dependencies.actions; pageAgent = dependencies.Page; clientType = dependencies.clientType; runtimeAgent = dependencies.Runtime; } // Debugger Events function scriptParsed(_ref) { var scriptId = _ref.scriptId, url = _ref.url, startLine = _ref.startLine, startColumn = _ref.startColumn, endLine = _ref.endLine, endColumn = _ref.endColumn, executionContextId = _ref.executionContextId, hash = _ref.hash, isContentScript = _ref.isContentScript, isInternalScript = _ref.isInternalScript, isLiveEdit = _ref.isLiveEdit, sourceMapURL = _ref.sourceMapURL, hasSourceURL = _ref.hasSourceURL, deprecatedCommentWasUsed = _ref.deprecatedCommentWasUsed; if (isContentScript) { return; } if (clientType == "node") { sourceMapURL = undefined; } actions.newSource({ id: scriptId, url, sourceMapURL, isPrettyPrinted: false }); } function scriptFailedToParse() {} function resumed() { if (clientType == "chrome") { pageAgent.configureOverlay({ suspended: false }); } actions.resumed(); } function globalObjectCleared() {} // Page Events function frameNavigated(frame) { actions.navigated(); } function frameStartedLoading() { actions.willNavigate(); } function domContentEventFired() {} function loadEventFired() {} function frameStoppedLoading() {} var clientEvents = { scriptParsed, scriptFailedToParse, paused, resumed, globalObjectCleared }; var pageEvents = { frameNavigated, frameStartedLoading, domContentEventFired, loadEventFired, frameStoppedLoading }; exports.setupEvents = setupEvents; exports.pageEvents = pageEvents; exports.clientEvents = clientEvents; /***/ }), /* 897 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.bootstrapStore = bootstrapStore; exports.bootstrapApp = bootstrapApp; exports.bootstrapWorkers = bootstrapWorkers; exports.teardownWorkers = teardownWorkers; var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _redux = __webpack_require__(3); var _reactDom = __webpack_require__(4); var _reactDom2 = _interopRequireDefault(_reactDom); var _devtoolsConfig = __webpack_require__(828); var _devtoolsLaunchpad = __webpack_require__(131); var _devtoolsSourceMap = __webpack_require__(898); var _search = __webpack_require__(1115); var _prettyPrint = __webpack_require__(903); var _parser = __webpack_require__(827); var _createStore = __webpack_require__(189); var _createStore2 = _interopRequireDefault(_createStore); var _reducers = __webpack_require__(227); var _reducers2 = _interopRequireDefault(_reducers); var _selectors = __webpack_require__(242); var _selectors2 = _interopRequireDefault(_selectors); var _App = __webpack_require__(243); var _App2 = _interopRequireDefault(_App); var _prefs = __webpack_require__(226); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function bootstrapStore(client, _ref) { var services = _ref.services, toolboxActions = _ref.toolboxActions; var createStore = (0, _createStore2.default)({ log: (0, _devtoolsConfig.getValue)("logging.actions"), timing: (0, _devtoolsConfig.getValue)("performance.actions"), makeThunkArgs: (args, state) => { return Object.assign({}, args, { client }, services, toolboxActions); } }); var store = createStore((0, _redux.combineReducers)(_reducers2.default)); store.subscribe(() => updatePrefs(store.getState())); var actions = (0, _redux.bindActionCreators)(__webpack_require__(244).default, store.dispatch); return { store, actions, selectors: _selectors2.default }; } function bootstrapApp(connection, _ref2) { var store = _ref2.store, actions = _ref2.actions; window.appStore = store; // Expose the bound actions so external things can do things like // selecting a source. window.actions = { selectSource: actions.selectSource, selectSourceURL: actions.selectSourceURL }; (0, _devtoolsLaunchpad.renderRoot)(_react2.default, _reactDom2.default, _App2.default, store); } function bootstrapWorkers() { if (!(0, _devtoolsConfig.isFirefoxPanel)()) { // When used in Firefox, the toolbox manages the source map worker. (0, _devtoolsSourceMap.startSourceMapWorker)((0, _devtoolsConfig.getValue)("workers.sourceMapURL")); } (0, _prettyPrint.startPrettyPrintWorker)((0, _devtoolsConfig.getValue)("workers.prettyPrintURL")); (0, _parser.startParserWorker)((0, _devtoolsConfig.getValue)("workers.parserURL")); (0, _search.startSearchWorker)((0, _devtoolsConfig.getValue)("workers.searchURL")); } function teardownWorkers() { if (!(0, _devtoolsConfig.isFirefoxPanel)()) { // When used in Firefox, the toolbox manages the source map worker. (0, _devtoolsSourceMap.stopSourceMapWorker)(); } (0, _prettyPrint.stopPrettyPrintWorker)(); (0, _parser.stopParserWorker)(); (0, _search.stopSearchWorker)(); } function updatePrefs(state) { var pendingBreakpoints = _selectors2.default.getPendingBreakpoints(state); if (_prefs.prefs.pendingBreakpoints !== pendingBreakpoints) { _prefs.prefs.pendingBreakpoints = pendingBreakpoints; } } /***/ }), /* 898 */ /***/ (function(module, exports, __webpack_require__) { /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ const { originalToGeneratedId, generatedToOriginalId, isGeneratedId, isOriginalId } = __webpack_require__(1172); const { workerUtils: { WorkerDispatcher } } = __webpack_require__(1165); const dispatcher = new WorkerDispatcher(); const getOriginalURLs = dispatcher.task("getOriginalURLs"); const getGeneratedLocation = dispatcher.task("getGeneratedLocation"); const getOriginalLocation = dispatcher.task("getOriginalLocation"); const getLocationScopes = dispatcher.task("getLocationScopes"); const getOriginalSourceText = dispatcher.task("getOriginalSourceText"); const applySourceMap = dispatcher.task("applySourceMap"); const clearSourceMaps = dispatcher.task("clearSourceMaps"); const hasMappedSource = dispatcher.task("hasMappedSource"); module.exports = { originalToGeneratedId, generatedToOriginalId, isGeneratedId, isOriginalId, hasMappedSource, getOriginalURLs, getGeneratedLocation, getOriginalLocation, getLocationScopes, getOriginalSourceText, applySourceMap, clearSourceMaps, startSourceMapWorker: dispatcher.start.bind(dispatcher), stopSourceMapWorker: dispatcher.stop.bind(dispatcher) }; /***/ }), /* 899 */, /* 900 */ /***/ (function(module, exports, __webpack_require__) { /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ const networkRequest = __webpack_require__(901); const workerUtils = __webpack_require__(902); module.exports = { networkRequest, workerUtils }; /***/ }), /* 901 */ /***/ (function(module, exports) { /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ function networkRequest(url, opts) { return fetch(url, { cache: opts.loadFromCache ? "default" : "no-cache" }).then(res => { if (res.status >= 200 && res.status < 300) { return res.text().then(text => ({ content: text })); } return Promise.reject(`request failed with status ${res.status}`); }); } module.exports = networkRequest; /***/ }), /* 902 */ /***/ (function(module, exports) { function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } function WorkerDispatcher() { this.msgId = 1; this.worker = null; } /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ WorkerDispatcher.prototype = { start(url) { this.worker = new Worker(url); this.worker.onerror = () => { console.error(`Error in worker ${url}`); }; }, stop() { if (!this.worker) { return; } this.worker.terminate(); this.worker = null; }, task(method) { return (...args) => { return new Promise((resolve, reject) => { const id = this.msgId++; this.worker.postMessage({ id, method, args }); const listener = ({ data: result }) => { if (result.id !== id) { return; } if (!this.worker) { reject("Oops, The worker has shutdown!"); return; } this.worker.removeEventListener("message", listener); if (result.error) { reject(result.error); } else { resolve(result.response); } }; this.worker.addEventListener("message", listener); }); }; } }; function workerHandler(publicInterface) { return function (msg) { const { id, method, args } = msg.data; try { const response = publicInterface[method].apply(undefined, args); if (response instanceof Promise) { response.then(val => self.postMessage({ id, response: val }), // Error can't be sent via postMessage, so be sure to // convert to string. err => self.postMessage({ id, error: err.toString() })); } else { self.postMessage({ id, response }); } } catch (error) { // Error can't be sent via postMessage, so be sure to convert to // string. self.postMessage({ id, error: error.toString() }); } }; } function streamingWorkerHandler(publicInterface, { timeout = 100 } = {}, worker = self) { let streamingWorker = (() => { var _ref = _asyncToGenerator(function* (id, tasks) { let isWorking = true; const intervalId = setTimeout(function () { isWorking = false; }, timeout); const results = []; while (tasks.length !== 0 && isWorking) { const { callback, context, args } = tasks.shift(); const result = yield callback.call(context, args); results.push(result); } worker.postMessage({ id, status: "pending", data: results }); clearInterval(intervalId); if (tasks.length !== 0) { yield streamingWorker(id, tasks); } }); return function streamingWorker(_x, _x2) { return _ref.apply(this, arguments); }; })(); return (() => { var _ref2 = _asyncToGenerator(function* (msg) { const { id, method, args } = msg.data; const workerMethod = publicInterface[method]; if (!workerMethod) { console.error(`Could not find ${method} defined in worker.`); } worker.postMessage({ id, status: "start" }); try { const tasks = workerMethod(args); yield streamingWorker(id, tasks); worker.postMessage({ id, status: "done" }); } catch (error) { worker.postMessage({ id, status: "error", error }); } }); return function (_x3) { return _ref2.apply(this, arguments); }; })(); } module.exports = { WorkerDispatcher, workerHandler, streamingWorkerHandler }; /***/ }), /* 903 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.prettyPrint = exports.stopPrettyPrintWorker = exports.startPrettyPrintWorker = undefined; var prettyPrint = exports.prettyPrint = (() => { var _ref = _asyncToGenerator(function* (_ref2) { var source = _ref2.source, url = _ref2.url; var indent = 2; (0, _assert2.default)((0, _source.isJavaScript)(source), "Can't prettify non-javascript files."); return yield _prettyPrint({ url, indent, source: source.text }); }); return function prettyPrint(_x) { return _ref.apply(this, arguments); }; })(); var _devtoolsUtils = __webpack_require__(900); var _source = __webpack_require__(233); var _assert = __webpack_require__(223); var _assert2 = _interopRequireDefault(_assert); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } var WorkerDispatcher = _devtoolsUtils.workerUtils.WorkerDispatcher; var dispatcher = new WorkerDispatcher(); var startPrettyPrintWorker = exports.startPrettyPrintWorker = dispatcher.start.bind(dispatcher); var stopPrettyPrintWorker = exports.stopPrettyPrintWorker = dispatcher.stop.bind(dispatcher); var _prettyPrint = dispatcher.task("prettyPrint"); /***/ }), /* 904 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getTokenLocation = getTokenLocation; exports.updatePreview = updatePreview; var _lodash = __webpack_require__(2); function getTokenLocation(codeMirror, tokenEl) { var _tokenEl$getBoundingC = tokenEl.getBoundingClientRect(), left = _tokenEl$getBoundingC.left, top = _tokenEl$getBoundingC.top, width = _tokenEl$getBoundingC.width, height = _tokenEl$getBoundingC.height; var _codeMirror$coordsCha = codeMirror.coordsChar({ left: left + width / 2, top: top + height / 2 }), line = _codeMirror$coordsCha.line, ch = _codeMirror$coordsCha.ch; return { line: line + 1, column: ch }; } function updatePreview(target, editor, _ref) { var linesInScope = _ref.linesInScope, preview = _ref.preview, setPreview = _ref.setPreview, clearPreview = _ref.clearPreview; var location = getTokenLocation(editor.codeMirror, target); var tokenText = target.innerText ? target.innerText.trim() : ""; var cursorPos = target.getBoundingClientRect(); if (preview) { // We are mousing over the same token as before if ((0, _lodash.isEqual)(preview.tokenPos, location)) { return; } // We are mousing over a new token that is not in the preview if (!target.classList.contains("debug-expression")) { clearPreview(); } } var invalidToken = tokenText === "" || tokenText.match(/[(){}\|&%,.;=<>\+-/\*\s]/); var invalidTarget = target.parentElement && !target.parentElement.closest(".CodeMirror-line") || cursorPos.top == 0; var isUpdating = preview && preview.updating; var inScope = linesInScope && linesInScope.includes(location.line); if (invalidTarget || !inScope || isUpdating || invalidToken) { return; } setPreview(tokenText, location, cursorPos); } /***/ }), /* 905 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 906 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 907 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 908 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 909 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 910 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var SplitBox = __webpack_require__(911); module.exports = SplitBox; /***/ }), /* 911 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var React = __webpack_require__(0); var ReactDOM = __webpack_require__(4); var Draggable = React.createFactory(__webpack_require__(912)); var dom = React.DOM, PropTypes = React.PropTypes; __webpack_require__(861); /** * This component represents a Splitter. The splitter supports vertical * as well as horizontal mode. */ var SplitBox = React.createClass({ propTypes: { // Custom class name. You can use more names separated by a space. className: PropTypes.string, // Initial size of controlled panel. initialSize: PropTypes.any, // Optional initial width of controlled panel. initialWidth: PropTypes.number, // Optional initial height of controlled panel. initialHeight: PropTypes.number, // Left/top panel startPanel: PropTypes.any, // Left/top panel collapse state. startPanelCollapsed: PropTypes.bool, // Min panel size. minSize: PropTypes.any, // Max panel size. maxSize: PropTypes.any, // Right/bottom panel endPanel: PropTypes.any, // Right/bottom panel collapse state. endPanelCollapsed: PropTypes.bool, // True if the right/bottom panel should be controlled. endPanelControl: PropTypes.bool, // Size of the splitter handle bar. splitterSize: PropTypes.number, // True if the splitter bar is vertical (default is vertical). vert: PropTypes.bool, // Optional style properties passed into the splitbox style: PropTypes.object, // Optional callback when splitbox resize stops onResizeEnd: PropTypes.func }, displayName: "SplitBox", getDefaultProps() { return { splitterSize: 5, vert: true, endPanelControl: false, endPanelCollapsed: false, startPanelCollapsed: false }; }, /** * The state stores the current orientation (vertical or horizontal) * and the current size (width/height). All these values can change * during the component's life time. */ getInitialState() { return { vert: this.props.vert, // We use integers for these properties width: parseInt(this.props.initialWidth || this.props.initialSize), height: parseInt(this.props.initialHeight || this.props.initialSize) }; }, componentWillReceiveProps(nextProps) { if (this.props.vert !== nextProps.vert) { this.setState({ vert: nextProps.vert }); } }, // Dragging Events /** * Set 'resizing' cursor on entire document during splitter dragging. * This avoids cursor-flickering that happens when the mouse leaves * the splitter bar area (happens frequently). */ onStartMove() { var splitBox = ReactDOM.findDOMNode(this); var doc = splitBox.ownerDocument; var defaultCursor = doc.documentElement.style.cursor; doc.documentElement.style.cursor = this.state.vert ? "ew-resize" : "ns-resize"; splitBox.classList.add("dragging"); this.setState({ defaultCursor: defaultCursor }); }, onStopMove() { var splitBox = ReactDOM.findDOMNode(this); var doc = splitBox.ownerDocument; doc.documentElement.style.cursor = this.state.defaultCursor; splitBox.classList.remove("dragging"); if (this.props.onResizeEnd) { this.props.onResizeEnd(this.state.vert ? this.state.width : this.state.height); } }, /** * Adjust size of the controlled panel. Depending on the current * orientation we either remember the width or height of * the splitter box. */ onMove(_ref) { var movementX = _ref.movementX, movementY = _ref.movementY; var node = ReactDOM.findDOMNode(this); var doc = node.ownerDocument; if (this.props.endPanelControl) { // For the end panel we need to increase the width/height when the // movement is towards the left/top. movementX = -movementX; movementY = -movementY; } if (this.state.vert) { var isRtl = doc.dir === "rtl"; if (isRtl) { // In RTL we need to reverse the movement again -- but only for vertical // splitters movementX = -movementX; } this.setState((state, props) => ({ width: state.width + movementX })); } else { this.setState((state, props) => ({ height: state.height + movementY })); } }, // Rendering preparePanelStyles() { var vert = this.state.vert; var _props = this.props, minSize = _props.minSize, maxSize = _props.maxSize, startPanelCollapsed = _props.startPanelCollapsed, endPanelControl = _props.endPanelControl, endPanelCollapsed = _props.endPanelCollapsed; var leftPanelStyle = void 0, rightPanelStyle = void 0; // Set proper size for panels depending on the current state. if (vert) { var startWidth = endPanelControl ? null : this.state.width, endWidth = endPanelControl ? this.state.width : null; leftPanelStyle = { maxWidth: endPanelControl ? null : maxSize, minWidth: endPanelControl ? null : minSize, width: startPanelCollapsed ? 0 : startWidth }; rightPanelStyle = { maxWidth: endPanelControl ? maxSize : null, minWidth: endPanelControl ? minSize : null, width: endPanelCollapsed ? 0 : endWidth }; } else { var startHeight = endPanelControl ? null : this.state.height, endHeight = endPanelControl ? this.state.height : null; leftPanelStyle = { maxHeight: endPanelControl ? null : maxSize, minHeight: endPanelControl ? null : minSize, height: endPanelCollapsed ? maxSize : startHeight }; rightPanelStyle = { maxHeight: endPanelControl ? maxSize : null, minHeight: endPanelControl ? minSize : null, height: startPanelCollapsed ? maxSize : endHeight }; } return { leftPanelStyle, rightPanelStyle }; }, render() { var vert = this.state.vert; var _props2 = this.props, startPanelCollapsed = _props2.startPanelCollapsed, startPanel = _props2.startPanel, endPanel = _props2.endPanel, endPanelControl = _props2.endPanelControl, splitterSize = _props2.splitterSize, endPanelCollapsed = _props2.endPanelCollapsed; var style = Object.assign({}, this.props.style); // Calculate class names list. var classNames = ["split-box"]; classNames.push(vert ? "vert" : "horz"); if (this.props.className) { classNames = classNames.concat(this.props.className.split(" ")); } var _preparePanelStyles = this.preparePanelStyles(), leftPanelStyle = _preparePanelStyles.leftPanelStyle, rightPanelStyle = _preparePanelStyles.rightPanelStyle; // Calculate splitter size var splitterStyle = { flex: `0 0 ${splitterSize}px` }; return dom.div({ className: classNames.join(" "), style: style }, !startPanelCollapsed ? dom.div({ className: endPanelControl ? "uncontrolled" : "controlled", style: leftPanelStyle }, startPanel) : null, Draggable({ className: "splitter", style: splitterStyle, onStart: this.onStartMove, onStop: this.onStopMove, onMove: this.onMove }), !endPanelCollapsed ? dom.div({ className: endPanelControl ? "controlled" : "uncontrolled", style: rightPanelStyle }, endPanel) : null); } }); module.exports = SplitBox; /***/ }), /* 912 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ var React = __webpack_require__(0); var ReactDOM = __webpack_require__(4); var dom = React.DOM, PropTypes = React.PropTypes; var Draggable = React.createClass({ displayName: "Draggable", propTypes: { onMove: PropTypes.func.isRequired, onStart: PropTypes.func, onStop: PropTypes.func, style: PropTypes.object, className: PropTypes.string }, startDragging(ev) { ev.preventDefault(); var doc = ReactDOM.findDOMNode(this).ownerDocument; doc.addEventListener("mousemove", this.onMove); doc.addEventListener("mouseup", this.onUp); this.props.onStart && this.props.onStart(); }, onMove(ev) { ev.preventDefault(); // We pass the whole event because we don't know which properties // the callee needs. this.props.onMove(ev); }, onUp(ev) { ev.preventDefault(); var doc = ReactDOM.findDOMNode(this).ownerDocument; doc.removeEventListener("mousemove", this.onMove); doc.removeEventListener("mouseup", this.onUp); this.props.onStop && this.props.onStop(); }, render() { return dom.div({ style: this.props.style, className: this.props.className, onMouseDown: this.startDragging }); } }); module.exports = Draggable; /***/ }), /* 913 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 914 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 915 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 916 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(module, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/*! https://mths.be/punycode v1.4.1 by @mathias */ ;(function(root) { /** Detect free variables */ var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; var freeModule = typeof module == 'object' && module && !module.nodeType && module; var freeGlobal = typeof global == 'object' && global; if ( freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal ) { root = freeGlobal; } /** * The `punycode` object. * @name punycode * @type Object */ var punycode, /** Highest positive signed 32-bit float value */ maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1 /** Bootstring parameters */ base = 36, tMin = 1, tMax = 26, skew = 38, damp = 700, initialBias = 72, initialN = 128, // 0x80 delimiter = '-', // '\x2D' /** Regular expressions */ regexPunycode = /^xn--/, regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators /** Error messages */ errors = { 'overflow': 'Overflow: input needs wider integers to process', 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', 'invalid-input': 'Invalid input' }, /** Convenience shortcuts */ baseMinusTMin = base - tMin, floor = Math.floor, stringFromCharCode = String.fromCharCode, /** Temporary variable */ key; /*--------------------------------------------------------------------------*/ /** * A generic error utility function. * @private * @param {String} type The error type. * @returns {Error} Throws a `RangeError` with the applicable error message. */ function error(type) { throw new RangeError(errors[type]); } /** * A generic `Array#map` utility function. * @private * @param {Array} array The array to iterate over. * @param {Function} callback The function that gets called for every array * item. * @returns {Array} A new array of values returned by the callback function. */ function map(array, fn) { var length = array.length; var result = []; while (length--) { result[length] = fn(array[length]); } return result; } /** * A simple `Array#map`-like wrapper to work with domain name strings or email * addresses. * @private * @param {String} domain The domain name or email address. * @param {Function} callback The function that gets called for every * character. * @returns {Array} A new string of characters returned by the callback * function. */ function mapDomain(string, fn) { var parts = string.split('@'); var result = ''; if (parts.length > 1) { // In email addresses, only the domain name should be punycoded. Leave // the local part (i.e. everything up to `@`) intact. result = parts[0] + '@'; string = parts[1]; } // Avoid `split(regex)` for IE8 compatibility. See #17. string = string.replace(regexSeparators, '\x2E'); var labels = string.split('.'); var encoded = map(labels, fn).join('.'); return result + encoded; } /** * Creates an array containing the numeric code points of each Unicode * character in the string. While JavaScript uses UCS-2 internally, * this function will convert a pair of surrogate halves (each of which * UCS-2 exposes as separate characters) into a single code point, * matching UTF-16. * @see `punycode.ucs2.encode` * @see * @memberOf punycode.ucs2 * @name decode * @param {String} string The Unicode input string (UCS-2). * @returns {Array} The new array of code points. */ function ucs2decode(string) { var output = [], counter = 0, length = string.length, value, extra; while (counter < length) { value = string.charCodeAt(counter++); if (value >= 0xD800 && value <= 0xDBFF && counter < length) { // high surrogate, and there is a next character extra = string.charCodeAt(counter++); if ((extra & 0xFC00) == 0xDC00) { // low surrogate output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); } else { // unmatched surrogate; only append this code unit, in case the next // code unit is the high surrogate of a surrogate pair output.push(value); counter--; } } else { output.push(value); } } return output; } /** * Creates a string based on an array of numeric code points. * @see `punycode.ucs2.decode` * @memberOf punycode.ucs2 * @name encode * @param {Array} codePoints The array of numeric code points. * @returns {String} The new Unicode string (UCS-2). */ function ucs2encode(array) { return map(array, function(value) { var output = ''; if (value > 0xFFFF) { value -= 0x10000; output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); value = 0xDC00 | value & 0x3FF; } output += stringFromCharCode(value); return output; }).join(''); } /** * Converts a basic code point into a digit/integer. * @see `digitToBasic()` * @private * @param {Number} codePoint The basic numeric code point value. * @returns {Number} The numeric value of a basic code point (for use in * representing integers) in the range `0` to `base - 1`, or `base` if * the code point does not represent a value. */ function basicToDigit(codePoint) { if (codePoint - 48 < 10) { return codePoint - 22; } if (codePoint - 65 < 26) { return codePoint - 65; } if (codePoint - 97 < 26) { return codePoint - 97; } return base; } /** * Converts a digit/integer into a basic code point. * @see `basicToDigit()` * @private * @param {Number} digit The numeric value of a basic code point. * @returns {Number} The basic code point whose value (when used for * representing integers) is `digit`, which needs to be in the range * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is * used; else, the lowercase form is used. The behavior is undefined * if `flag` is non-zero and `digit` has no uppercase form. */ function digitToBasic(digit, flag) { // 0..25 map to ASCII a..z or A..Z // 26..35 map to ASCII 0..9 return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); } /** * Bias adaptation function as per section 3.4 of RFC 3492. * https://tools.ietf.org/html/rfc3492#section-3.4 * @private */ function adapt(delta, numPoints, firstTime) { var k = 0; delta = firstTime ? floor(delta / damp) : delta >> 1; delta += floor(delta / numPoints); for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { delta = floor(delta / baseMinusTMin); } return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); } /** * Converts a Punycode string of ASCII-only symbols to a string of Unicode * symbols. * @memberOf punycode * @param {String} input The Punycode string of ASCII-only symbols. * @returns {String} The resulting string of Unicode symbols. */ function decode(input) { // Don't use UCS-2 var output = [], inputLength = input.length, out, i = 0, n = initialN, bias = initialBias, basic, j, index, oldi, w, k, digit, t, /** Cached calculation results */ baseMinusT; // Handle the basic code points: let `basic` be the number of input code // points before the last delimiter, or `0` if there is none, then copy // the first basic code points to the output. basic = input.lastIndexOf(delimiter); if (basic < 0) { basic = 0; } for (j = 0; j < basic; ++j) { // if it's not a basic code point if (input.charCodeAt(j) >= 0x80) { error('not-basic'); } output.push(input.charCodeAt(j)); } // Main decoding loop: start just after the last delimiter if any basic code // points were copied; start at the beginning otherwise. for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { // `index` is the index of the next character to be consumed. // Decode a generalized variable-length integer into `delta`, // which gets added to `i`. The overflow checking is easier // if we increase `i` as we go, then subtract off its starting // value at the end to obtain `delta`. for (oldi = i, w = 1, k = base; /* no condition */; k += base) { if (index >= inputLength) { error('invalid-input'); } digit = basicToDigit(input.charCodeAt(index++)); if (digit >= base || digit > floor((maxInt - i) / w)) { error('overflow'); } i += digit * w; t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); if (digit < t) { break; } baseMinusT = base - t; if (w > floor(maxInt / baseMinusT)) { error('overflow'); } w *= baseMinusT; } out = output.length + 1; bias = adapt(i - oldi, out, oldi == 0); // `i` was supposed to wrap around from `out` to `0`, // incrementing `n` each time, so we'll fix that now: if (floor(i / out) > maxInt - n) { error('overflow'); } n += floor(i / out); i %= out; // Insert `n` at position `i` of the output output.splice(i++, 0, n); } return ucs2encode(output); } /** * Converts a string of Unicode symbols (e.g. a domain name label) to a * Punycode string of ASCII-only symbols. * @memberOf punycode * @param {String} input The string of Unicode symbols. * @returns {String} The resulting Punycode string of ASCII-only symbols. */ function encode(input) { var n, delta, handledCPCount, basicLength, bias, j, m, q, k, t, currentValue, output = [], /** `inputLength` will hold the number of code points in `input`. */ inputLength, /** Cached calculation results */ handledCPCountPlusOne, baseMinusT, qMinusT; // Convert the input in UCS-2 to Unicode input = ucs2decode(input); // Cache the length inputLength = input.length; // Initialize the state n = initialN; delta = 0; bias = initialBias; // Handle the basic code points for (j = 0; j < inputLength; ++j) { currentValue = input[j]; if (currentValue < 0x80) { output.push(stringFromCharCode(currentValue)); } } handledCPCount = basicLength = output.length; // `handledCPCount` is the number of code points that have been handled; // `basicLength` is the number of basic code points. // Finish the basic string - if it is not empty - with a delimiter if (basicLength) { output.push(delimiter); } // Main encoding loop: while (handledCPCount < inputLength) { // All non-basic code points < n have been handled already. Find the next // larger one: for (m = maxInt, j = 0; j < inputLength; ++j) { currentValue = input[j]; if (currentValue >= n && currentValue < m) { m = currentValue; } } // Increase `delta` enough to advance the decoder's state to , // but guard against overflow handledCPCountPlusOne = handledCPCount + 1; if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { error('overflow'); } delta += (m - n) * handledCPCountPlusOne; n = m; for (j = 0; j < inputLength; ++j) { currentValue = input[j]; if (currentValue < n && ++delta > maxInt) { error('overflow'); } if (currentValue == n) { // Represent delta as a generalized variable-length integer for (q = delta, k = base; /* no condition */; k += base) { t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); if (q < t) { break; } qMinusT = q - t; baseMinusT = base - t; output.push( stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) ); q = floor(qMinusT / baseMinusT); } output.push(stringFromCharCode(digitToBasic(q, 0))); bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); delta = 0; ++handledCPCount; } } ++delta; ++n; } return output.join(''); } /** * Converts a Punycode string representing a domain name or an email address * to Unicode. Only the Punycoded parts of the input will be converted, i.e. * it doesn't matter if you call it on a string that has already been * converted to Unicode. * @memberOf punycode * @param {String} input The Punycoded domain name or email address to * convert to Unicode. * @returns {String} The Unicode representation of the given Punycode * string. */ function toUnicode(input) { return mapDomain(input, function(string) { return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string; }); } /** * Converts a Unicode string representing a domain name or an email address to * Punycode. Only the non-ASCII parts of the domain name will be converted, * i.e. it doesn't matter if you call it with a domain that's already in * ASCII. * @memberOf punycode * @param {String} input The domain name or email address to convert, as a * Unicode string. * @returns {String} The Punycode representation of the given domain name or * email address. */ function toASCII(input) { return mapDomain(input, function(string) { return regexNonASCII.test(string) ? 'xn--' + encode(string) : string; }); } /*--------------------------------------------------------------------------*/ /** Define the public API */ punycode = { /** * A string representing the current Punycode.js version number. * @memberOf punycode * @type String */ 'version': '1.4.1', /** * An object of methods to convert from JavaScript's internal character * representation (UCS-2) to Unicode code points, and back. * @see * @memberOf punycode * @type Object */ 'ucs2': { 'decode': ucs2decode, 'encode': ucs2encode }, 'decode': decode, 'encode': encode, 'toASCII': toASCII, 'toUnicode': toUnicode }; /** Expose `punycode` */ // Some AMD build optimizers, like r.js, check for specific condition patterns // like the following: if ( true ) { !(__WEBPACK_AMD_DEFINE_RESULT__ = function() { return punycode; }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else if (freeExports && freeModule) { if (module.exports == freeExports) { // in Node.js, io.js, or RingoJS v0.8.0+ freeModule.exports = punycode; } else { // in Narwhal or RingoJS v0.7.0- for (key in punycode) { punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); } } } else { // in Rhino or a web browser root.punycode = punycode; } }(this)); /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(793)(module), __webpack_require__(792))) /***/ }), /* 917 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 918 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 919 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 920 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 921 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 922 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 923 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 924 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var _require = __webpack_require__(925), MODE = _require.MODE; var _require2 = __webpack_require__(926), REPS = _require2.REPS, getRep = _require2.getRep; var ObjectInspector = __webpack_require__(1154); var ObjectInspectorUtils = __webpack_require__(1157); var _require3 = __webpack_require__(927), parseURLEncodedText = _require3.parseURLEncodedText, parseURLParams = _require3.parseURLParams, maybeEscapePropertyName = _require3.maybeEscapePropertyName, getGripPreviewItems = _require3.getGripPreviewItems; module.exports = { REPS, getRep, MODE, maybeEscapePropertyName, parseURLEncodedText, parseURLParams, getGripPreviewItems, ObjectInspector, ObjectInspectorUtils }; /***/ }), /* 925 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ module.exports = { MODE: { TINY: Symbol("TINY"), SHORT: Symbol("SHORT"), LONG: Symbol("LONG") } }; /***/ }), /* 926 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ __webpack_require__(877); // Load all existing rep templates var Undefined = __webpack_require__(929); var Null = __webpack_require__(930); var StringRep = __webpack_require__(931); var LongStringRep = __webpack_require__(932); var Number = __webpack_require__(933); var ArrayRep = __webpack_require__(934); var Obj = __webpack_require__(936); var SymbolRep = __webpack_require__(939); var InfinityRep = __webpack_require__(940); var NaNRep = __webpack_require__(941); var Accessor = __webpack_require__(305); // DOM types (grips) var Attribute = __webpack_require__(942); var DateTime = __webpack_require__(943); var Document = __webpack_require__(944); var Event = __webpack_require__(945); var Func = __webpack_require__(946); var PromiseRep = __webpack_require__(947); var RegExp = __webpack_require__(948); var StyleSheet = __webpack_require__(949); var CommentNode = __webpack_require__(950); var ElementNode = __webpack_require__(951); var TextNode = __webpack_require__(953); var ErrorRep = __webpack_require__(954); var Window = __webpack_require__(955); var ObjectWithText = __webpack_require__(956); var ObjectWithURL = __webpack_require__(957); var GripArray = __webpack_require__(958); var GripMap = __webpack_require__(959); var GripMapEntry = __webpack_require__(42); var Grip = __webpack_require__(938); // List of all registered template. // XXX there should be a way for extensions to register a new // or modify an existing rep. var reps = [RegExp, StyleSheet, Event, DateTime, CommentNode, ElementNode, TextNode, Attribute, LongStringRep, Func, PromiseRep, ArrayRep, Document, Window, ObjectWithText, ObjectWithURL, ErrorRep, GripArray, GripMap, GripMapEntry, Grip, Undefined, Null, StringRep, Number, SymbolRep, InfinityRep, NaNRep, Accessor]; /** * Generic rep that is using for rendering native JS types or an object. * The right template used for rendering is picked automatically according * to the current value type. The value must be passed is as 'object' * property. */ var Rep = function (props) { var object = props.object, defaultRep = props.defaultRep; var rep = getRep(object, defaultRep, props.noGrip); return rep(props); }; // Helpers /** * Return a rep object that is responsible for rendering given * object. * * @param object {Object} Object to be rendered in the UI. This * can be generic JS object as well as a grip (handle to a remote * debuggee object). * * @param defaultObject {React.Component} The default template * that should be used to render given object if none is found. * * @param noGrip {Boolean} If true, will only check reps not made for remote objects. */ function getRep(object) { var defaultRep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Obj; var noGrip = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; for (var i = 0; i < reps.length; i++) { var rep = reps[i]; try { // supportsObject could return weight (not only true/false // but a number), which would allow to priorities templates and // support better extensibility. if (rep.supportsObject(object, noGrip)) { return rep.rep; } } catch (err) { console.error(err); } } return defaultRep.rep; } module.exports = { Rep, REPS: { Accessor, ArrayRep, Attribute, CommentNode, DateTime, Document, ElementNode, ErrorRep, Event, Func, Grip, GripArray, GripMap, GripMapEntry, InfinityRep, LongStringRep, NaNRep, Null, Number, Obj, ObjectWithText, ObjectWithURL, PromiseRep, RegExp, Rep, StringRep, StyleSheet, SymbolRep, TextNode, Undefined, Window }, // Exporting for tests getRep }; /***/ }), /* 927 */ /***/ (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); } } /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // Dependencies var React = __webpack_require__(0); var validProtocols = /^(http|https|ftp|data|javascript|resource|chrome):/i; var tokenSplitRegex = /(\s|\'|\"|\\)+/; /** * Returns true if the given object is a grip (see RDP protocol) */ function isGrip(object) { return object && object.actor; } function escapeNewLines(value) { return value.replace(/\r/gm, "\\r").replace(/\n/gm, "\\n"); } // Map from character code to the corresponding escape sequence. \0 // isn't here because it would require special treatment in some // situations. \b, \f, and \v aren't here because they aren't very // common. \' isn't here because there's no need, we only // double-quote strings. var escapeMap = { // Tab. 9: "\\t", // Newline. 0xa: "\\n", // Carriage return. 0xd: "\\r", // Quote. 0x22: "\\\"", // Backslash. 0x5c: "\\\\" }; // Regexp that matches any character we might possibly want to escape. // Note that we over-match here, because it's difficult to, say, match // an unpaired surrogate with a regexp. The details are worked out by // the replacement function; see |escapeString|. var escapeRegexp = new RegExp("[" + // Quote and backslash. "\"\\\\" + // Controls. "\x00-\x1f" + // More controls. "\x7f-\x9f" + // BOM "\ufeff" + // Replacement characters and non-characters. "\ufffc-\uffff" + // Surrogates. "\ud800-\udfff" + // Mathematical invisibles. "\u2061-\u2064" + // Line and paragraph separators. "\u2028-\u2029" + // Private use area. "\ue000-\uf8ff" + "]", "g"); /** * Escape a string so that the result is viewable and valid JS. * Control characters, other invisibles, invalid characters, * backslash, and double quotes are escaped. The resulting string is * surrounded by double quotes. * * @param {String} str * the input * @param {Boolean} escapeWhitespace * if true, TAB, CR, and NL characters will be escaped * @return {String} the escaped string */ function escapeString(str, escapeWhitespace) { return "\"" + str.replace(escapeRegexp, (match, offset) => { var c = match.charCodeAt(0); if (c in escapeMap) { if (!escapeWhitespace && (c === 9 || c === 0xa || c === 0xd)) { return match[0]; } return escapeMap[c]; } if (c >= 0xd800 && c <= 0xdfff) { // Find the full code point containing the surrogate, with a // special case for a trailing surrogate at the start of the // string. if (c >= 0xdc00 && offset > 0) { --offset; } var codePoint = str.codePointAt(offset); if (codePoint >= 0xd800 && codePoint <= 0xdfff) { // Unpaired surrogate. return "\\u" + codePoint.toString(16); } else if (codePoint >= 0xf0000 && codePoint <= 0x10fffd) { // Private use area. Because we visit each pair of a such a // character, return the empty string for one half and the // real result for the other, to avoid duplication. if (c <= 0xdbff) { return "\\u{" + codePoint.toString(16) + "}"; } return ""; } // Other surrogate characters are passed through. return match; } return "\\u" + ("0000" + c.toString(16)).substr(-4); }) + "\""; } /** * Escape a property name, if needed. "Escaping" in this context * means surrounding the property name with quotes. * * @param {String} * name the property name * @return {String} either the input, or the input surrounded by * quotes, properly quoted in JS syntax. */ function maybeEscapePropertyName(name) { // Quote the property name if it needs quoting. This particular // test is an approximation; see // https://mathiasbynens.be/notes/javascript-properties. However, // the full solution requires a fair amount of Unicode data, and so // let's defer that until either it's important, or the \p regexp // syntax lands, see // https://github.com/tc39/proposal-regexp-unicode-property-escapes. if (!/^\w+$/.test(name)) { name = escapeString(name); } return name; } function cropMultipleLines(text, limit) { return escapeNewLines(cropString(text, limit)); } function rawCropString(text, limit, alternativeText) { if (!alternativeText) { alternativeText = "\u2026"; } // Crop the string only if a limit is actually specified. if (!limit || limit <= 0) { return text; } // Set the limit at least to the length of the alternative text // plus one character of the original text. if (limit <= alternativeText.length) { limit = alternativeText.length + 1; } var halfLimit = (limit - alternativeText.length) / 2; if (text.length > limit) { return text.substr(0, Math.ceil(halfLimit)) + alternativeText + text.substr(text.length - Math.floor(halfLimit)); } return text; } function cropString(text, limit, alternativeText) { return rawCropString(sanitizeString(text + ""), limit, alternativeText); } function sanitizeString(text) { // Replace all non-printable characters, except of // (horizontal) tab (HT: \x09) and newline (LF: \x0A, CR: \x0D), // with unicode replacement character (u+fffd). // eslint-disable-next-line no-control-regex var re = new RegExp("[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x9F]", "g"); return text.replace(re, "\ufffd"); } function parseURLParams(url) { url = new URL(url); return parseURLEncodedText(url.searchParams); } function parseURLEncodedText(text) { var params = []; // In case the text is empty just return the empty parameters if (text == "") { return params; } var searchParams = new URLSearchParams(text); var entries = [].concat(_toConsumableArray(searchParams.entries())); return entries.map(entry => { return { name: entry[0], value: entry[1] }; }); } function getFileName(url) { var split = splitURLBase(url); return split.name; } function splitURLBase(url) { if (!isDataURL(url)) { return splitURLTrue(url); } return {}; } function getURLDisplayString(url) { return cropString(url); } function isDataURL(url) { return url && url.substr(0, 5) == "data:"; } function splitURLTrue(url) { var reSplitFile = /(.*?):\/{2,3}([^\/]*)(.*?)([^\/]*?)($|\?.*)/; var m = reSplitFile.exec(url); if (!m) { return { name: url, path: url }; } else if (m[4] == "" && m[5] == "") { return { protocol: m[1], domain: m[2], path: m[3], name: m[3] != "/" ? m[3] : m[2] }; } return { protocol: m[1], domain: m[2], path: m[2] + m[3], name: m[4] + m[5] }; } /** * Wrap the provided render() method of a rep in a try/catch block that will render a * fallback rep if the render fails. */ function wrapRender(renderMethod) { var wrappedFunction = function (props) { try { return renderMethod.call(this, props); } catch (e) { console.error(e); return React.DOM.span({ className: "objectBox objectBox-failure", title: "This object could not be rendered, " + "please file a bug on bugzilla.mozilla.org" }, /* Labels have to be hardcoded for reps, see Bug 1317038. */ "Invalid object"); } }; wrappedFunction.propTypes = renderMethod.propTypes; return wrappedFunction; } /** * Get preview items from a Grip. * * @param {Object} Grip from which we want the preview items * @return {Array} Array of the preview items of the grip, or an empty array * if the grip does not have preview items */ function getGripPreviewItems(grip) { if (!grip) { return []; } // Promise resolved value Grip if (grip.promiseState && grip.promiseState.value) { return [grip.promiseState.value]; } // Array Grip if (grip.preview && grip.preview.items) { return grip.preview.items; } // Node Grip if (grip.preview && grip.preview.childNodes) { return grip.preview.childNodes; } // Set or Map Grip if (grip.preview && grip.preview.entries) { return grip.preview.entries.reduce((res, entry) => res.concat(entry), []); } // Event Grip if (grip.preview && grip.preview.target) { var keys = Object.keys(grip.preview.properties); var values = Object.values(grip.preview.properties); return [grip.preview.target].concat(_toConsumableArray(keys), _toConsumableArray(values)); } // RegEx Grip if (grip.displayString) { return [grip.displayString]; } // Generic Grip if (grip.preview && grip.preview.ownProperties) { var propertiesValues = Object.values(grip.preview.ownProperties).map(property => property.value || property); var propertyKeys = Object.keys(grip.preview.ownProperties); propertiesValues = propertiesValues.concat(propertyKeys); // ArrayBuffer Grip if (grip.preview.safeGetterValues) { propertiesValues = propertiesValues.concat(Object.values(grip.preview.safeGetterValues).map(property => property.getterValue || property)); } return propertiesValues; } return []; } /** * Get the type of an object. * * @param {Object} Grip from which we want the type. * @param {boolean} noGrip true if the object is not a grip. * @return {boolean} */ function getGripType(object, noGrip) { var type = typeof object; if (type == "object" && object instanceof String) { type = "string"; } else if (object && type == "object" && object.type && noGrip !== true) { type = object.type; } if (isGrip(object)) { type = object.class; } return type; } /** * Determines whether a grip is a string containing a URL. * * @param string grip * The grip, which may contain a URL. * @return boolean * Whether the grip is a string containing a URL. */ function containsURL(grip) { if (typeof grip !== "string") { return false; } var tokens = grip.split(tokenSplitRegex); return tokens.some(isURL); } /** * Determines whether a string token is a valid URL. * * @param string token * The token. * @return boolean * Whenther the token is a URL. */ function isURL(token) { try { if (!validProtocols.test(token)) { return false; } new URL(token); return true; } catch (e) { return false; } } module.exports = { isGrip, isURL, cropString, containsURL, rawCropString, sanitizeString, escapeString, wrapRender, cropMultipleLines, parseURLParams, parseURLEncodedText, getFileName, getURLDisplayString, maybeEscapePropertyName, getGripPreviewItems, getGripType, tokenSplitRegex }; /***/ }), /* 928 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ module.exports = { ELEMENT_NODE: 1, ATTRIBUTE_NODE: 2, TEXT_NODE: 3, CDATA_SECTION_NODE: 4, ENTITY_REFERENCE_NODE: 5, ENTITY_NODE: 6, PROCESSING_INSTRUCTION_NODE: 7, COMMENT_NODE: 8, DOCUMENT_NODE: 9, DOCUMENT_TYPE_NODE: 10, DOCUMENT_FRAGMENT_NODE: 11, NOTATION_NODE: 12, // DocumentPosition DOCUMENT_POSITION_DISCONNECTED: 0x01, DOCUMENT_POSITION_PRECEDING: 0x02, DOCUMENT_POSITION_FOLLOWING: 0x04, DOCUMENT_POSITION_CONTAINS: 0x08, DOCUMENT_POSITION_CONTAINED_BY: 0x10, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 0x20 }; /***/ }), /* 929 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // Dependencies var React = __webpack_require__(0); var _require = __webpack_require__(927), getGripType = _require.getGripType, wrapRender = _require.wrapRender; // Shortcuts var span = React.DOM.span; /** * Renders undefined value */ var Undefined = function () { return span({ className: "objectBox objectBox-undefined" }, "undefined"); }; function supportsObject(object) { var noGrip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (noGrip === true) { return false; } return object && object.type && object.type == "undefined" || getGripType(object, noGrip) == "undefined"; } // Exports from this module module.exports = { rep: wrapRender(Undefined), supportsObject }; /***/ }), /* 930 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // Dependencies var React = __webpack_require__(0); var _require = __webpack_require__(927), wrapRender = _require.wrapRender; // Shortcuts var span = React.DOM.span; /** * Renders null value */ function Null(props) { return span({ className: "objectBox objectBox-null" }, "null"); } function supportsObject(object) { var noGrip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (noGrip === true) { return false; } if (object && object.type && object.type == "null") { return true; } return object == null; } // Exports from this module module.exports = { rep: wrapRender(Null), supportsObject }; /***/ }), /* 931 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // Dependencies var React = __webpack_require__(0); var _require = __webpack_require__(927), containsURL = _require.containsURL, isURL = _require.isURL, escapeString = _require.escapeString, getGripType = _require.getGripType, rawCropString = _require.rawCropString, sanitizeString = _require.sanitizeString, wrapRender = _require.wrapRender, tokenSplitRegex = _require.tokenSplitRegex; // Shortcuts var _React$DOM = React.DOM, a = _React$DOM.a, span = _React$DOM.span; /** * Renders a string. String value is enclosed within quotes. */ StringRep.propTypes = { useQuotes: React.PropTypes.bool, escapeWhitespace: React.PropTypes.bool, style: React.PropTypes.object, object: React.PropTypes.string.isRequired, member: React.PropTypes.any, cropLimit: React.PropTypes.number, openLink: React.PropTypes.func }; function StringRep(props) { var cropLimit = props.cropLimit, text = props.object, member = props.member, style = props.style, _props$useQuotes = props.useQuotes, useQuotes = _props$useQuotes === undefined ? true : _props$useQuotes, _props$escapeWhitespa = props.escapeWhitespace, escapeWhitespace = _props$escapeWhitespa === undefined ? true : _props$escapeWhitespa, openLink = props.openLink; var config = { className: "objectBox objectBox-string" }; if (style) { config.style = style; } if (useQuotes) { text = escapeString(text, escapeWhitespace); } else { text = sanitizeString(text); } if ((!member || !member.open) && cropLimit) { text = rawCropString(text, cropLimit); } if (!containsURL(text)) { return span(config, text); } var items = []; // As we walk through the tokens of the source string, we make sure to preserve // the original whitespace that separated the tokens. var tokens = text.split(tokenSplitRegex); var textIndex = 0; var tokenStart = void 0; tokens.forEach((token, i) => { tokenStart = text.indexOf(token, textIndex); if (isURL(token)) { items.push(text.slice(textIndex, tokenStart)); textIndex = tokenStart + token.length; items.push(a({ className: "url", title: token, href: token, draggable: false, onClick: openLink ? e => { e.preventDefault(); openLink(token); } : null }, token)); } }); // Clean up any non-URL text at the end of the source string. items.push(text.slice(textIndex, text.length)); return span.apply(undefined, [config].concat(items)); } function supportsObject(object) { var noGrip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; return getGripType(object, noGrip) == "string"; } // Exports from this module module.exports = { rep: wrapRender(StringRep), supportsObject }; /***/ }), /* 932 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // Dependencies var React = __webpack_require__(0); var _require = __webpack_require__(927), escapeString = _require.escapeString, sanitizeString = _require.sanitizeString, isGrip = _require.isGrip, wrapRender = _require.wrapRender; // Shortcuts var span = React.DOM.span; /** * Renders a long string grip. */ LongStringRep.propTypes = { useQuotes: React.PropTypes.bool, escapeWhitespace: React.PropTypes.bool, style: React.PropTypes.object, cropLimit: React.PropTypes.number.isRequired, member: React.PropTypes.string, object: React.PropTypes.object.isRequired }; function LongStringRep(props) { var cropLimit = props.cropLimit, member = props.member, object = props.object, style = props.style, _props$useQuotes = props.useQuotes, useQuotes = _props$useQuotes === undefined ? true : _props$useQuotes, _props$escapeWhitespa = props.escapeWhitespace, escapeWhitespace = _props$escapeWhitespa === undefined ? true : _props$escapeWhitespa; var fullText = object.fullText, initial = object.initial, length = object.length; var config = { "data-link-actor-id": object.actor, className: "objectBox objectBox-string" }; if (style) { config.style = style; } var string = member && member.open ? fullText || initial : initial.substring(0, cropLimit); if (string.length < length) { string += "\u2026"; } var formattedString = useQuotes ? escapeString(string, escapeWhitespace) : sanitizeString(string); return span(config, formattedString); } function supportsObject(object) { var noGrip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (noGrip === true || !isGrip(object)) { return false; } return object.type === "longString"; } // Exports from this module module.exports = { rep: wrapRender(LongStringRep), supportsObject }; /***/ }), /* 933 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // Dependencies var React = __webpack_require__(0); var _require = __webpack_require__(927), getGripType = _require.getGripType, wrapRender = _require.wrapRender; // Shortcuts var span = React.DOM.span; /** * Renders a number */ Number.propTypes = { object: React.PropTypes.oneOfType([React.PropTypes.object, React.PropTypes.number, React.PropTypes.bool]).isRequired }; function Number(props) { var value = props.object; return span({ className: "objectBox objectBox-number" }, stringify(value)); } function stringify(object) { var isNegativeZero = Object.is(object, -0) || object.type && object.type == "-0"; return isNegativeZero ? "-0" : String(object); } function supportsObject(object) { var noGrip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; return ["boolean", "number", "-0"].includes(getGripType(object, noGrip)); } // Exports from this module module.exports = { rep: wrapRender(Number), supportsObject }; /***/ }), /* 934 */ /***/ (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); } } /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // Dependencies var React = __webpack_require__(0); var _require = __webpack_require__(927), wrapRender = _require.wrapRender; var _require2 = __webpack_require__(925), MODE = _require2.MODE; var ModePropType = React.PropTypes.oneOf( // @TODO Change this to Object.values once it's supported in Node's version of V8 Object.keys(MODE).map(key => MODE[key])); // Shortcuts var DOM = React.DOM; /** * Renders an array. The array is enclosed by left and right bracket * and the max number of rendered items depends on the current mode. */ ArrayRep.propTypes = { mode: ModePropType, object: React.PropTypes.array.isRequired }; function ArrayRep(props) { var object = props.object, _props$mode = props.mode, mode = _props$mode === undefined ? MODE.SHORT : _props$mode; var items = void 0; var brackets = void 0; var needSpace = function (space) { return space ? { left: "[ ", right: " ]" } : { left: "[", right: "]" }; }; if (mode === MODE.TINY) { var isEmpty = object.length === 0; if (isEmpty) { items = []; } else { items = [DOM.span({ className: "more-ellipsis", title: "more…" }, "…")]; } brackets = needSpace(false); } else { items = arrayIterator(props, object, maxLengthMap.get(mode)); brackets = needSpace(items.length > 0); } return DOM.span.apply(DOM, [{ className: "objectBox objectBox-array" }, DOM.span({ className: "arrayLeftBracket" }, brackets.left)].concat(_toConsumableArray(items), [DOM.span({ className: "arrayRightBracket" }, brackets.right), DOM.span({ className: "arrayProperties", role: "group" })])); } function arrayIterator(props, array, max) { var items = []; for (var i = 0; i < array.length && i < max; i++) { var config = { mode: MODE.TINY, delim: i == array.length - 1 ? "" : ", " }; var item = void 0; try { item = ItemRep(Object.assign({}, props, config, { object: array[i] })); } catch (exc) { item = ItemRep(Object.assign({}, props, config, { object: exc })); } items.push(item); } if (array.length > max) { items.push(DOM.span({ className: "more-ellipsis", title: "more…" }, "…")); } return items; } /** * Renders array item. Individual values are separated by a comma. */ ItemRep.propTypes = { object: React.PropTypes.any.isRequired, delim: React.PropTypes.string.isRequired, mode: ModePropType }; function ItemRep(props) { var _require3 = __webpack_require__(926), Rep = _require3.Rep; var object = props.object, delim = props.delim, mode = props.mode; return DOM.span({}, Rep(Object.assign({}, props, { object: object, mode: mode })), delim); } function supportsObject(object) { return Array.isArray(object) || Object.prototype.toString.call(object) === "[object Arguments]"; } var maxLengthMap = new Map(); maxLengthMap.set(MODE.SHORT, 3); maxLengthMap.set(MODE.LONG, 10); // Exports from this module module.exports = { rep: wrapRender(ArrayRep), supportsObject, maxLengthMap }; /***/ }), /* 935 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 936 */ /***/ (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); } } /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // Dependencies var React = __webpack_require__(0); var _require = __webpack_require__(927), wrapRender = _require.wrapRender; var PropRep = __webpack_require__(937); var _require2 = __webpack_require__(925), MODE = _require2.MODE; // Shortcuts var span = React.DOM.span; var DEFAULT_TITLE = "Object"; /** * Renders an object. An object is represented by a list of its * properties enclosed in curly brackets. */ ObjectRep.propTypes = { object: React.PropTypes.object.isRequired, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), title: React.PropTypes.string }; function ObjectRep(props) { var object = props.object; var propsArray = safePropIterator(props, object); if (props.mode === MODE.TINY) { var tinyModeItems = []; if (getTitle(props, object) !== DEFAULT_TITLE) { tinyModeItems.push(getTitleElement(props, object)); } else { tinyModeItems.push(span({ className: "objectLeftBrace" }, "{"), propsArray.length > 0 ? span({ key: "more", className: "more-ellipsis", title: "more…" }, "…") : null, span({ className: "objectRightBrace" }, "}")); } return span.apply(undefined, [{ className: "objectBox objectBox-object" }].concat(tinyModeItems)); } return span.apply(undefined, [{ className: "objectBox objectBox-object" }, getTitleElement(props, object), span({ className: "objectLeftBrace" }, " { ")].concat(_toConsumableArray(propsArray), [span({ className: "objectRightBrace" }, " }")])); } function getTitleElement(props, object) { return span({ className: "objectTitle" }, getTitle(props, object)); } function getTitle(props, object) { return props.title || object.class || DEFAULT_TITLE; } function safePropIterator(props, object, max) { max = typeof max === "undefined" ? 3 : max; try { return propIterator(props, object, max); } catch (err) { console.error(err); } return []; } function propIterator(props, object, max) { var isInterestingProp = (type, value) => { // Do not pick objects, it could cause recursion. return type == "boolean" || type == "number" || type == "string" && value; }; // Work around https://bugzilla.mozilla.org/show_bug.cgi?id=945377 if (Object.prototype.toString.call(object) === "[object Generator]") { object = Object.getPrototypeOf(object); } // Object members with non-empty values are preferred since it gives the // user a better overview of the object. var interestingObject = getFilteredObject(object, max, isInterestingProp); if (Object.keys(interestingObject).length < max) { // There are not enough props yet (or at least, not enough props to // be able to know whether we should print "more…" or not). // Let's display also empty members and functions. interestingObject = Object.assign({}, interestingObject, getFilteredObject(object, max - Object.keys(interestingObject).length, (type, value) => !isInterestingProp(type, value))); } var propsArray = getPropsArray(interestingObject, props); if (Object.keys(object).length > max) { propsArray.push(span({ className: "more-ellipsis", title: "more…" }, "…")); } return unfoldProps(propsArray); } function unfoldProps(items) { return items.reduce((res, item, index) => { if (Array.isArray(item)) { res = res.concat(item); } else { res.push(item); } // Interleave commas between elements if (index !== items.length - 1) { res.push(", "); } return res; }, []); } /** * Get an array of components representing the properties of the object * * @param {Object} object * @param {Object} props * @return {Array} Array of PropRep. */ function getPropsArray(object, props) { var propsArray = []; if (!object) { return propsArray; } // Hardcode tiny mode to avoid recursive handling. var mode = MODE.TINY; var objectKeys = Object.keys(object); return objectKeys.map((name, i) => PropRep(Object.assign({}, props, { mode, name, object: object[name], equal: ": " }))); } /** * Get a copy of the object filtered by a given predicate. * * @param {Object} object. * @param {Number} max The maximum length of keys array. * @param {Function} filter Filter the props you want. * @return {Object} the filtered object. */ function getFilteredObject(object, max, filter) { var filteredObject = {}; try { for (var name in object) { if (Object.keys(filteredObject).length >= max) { return filteredObject; } var value = void 0; try { value = object[name]; } catch (exc) { continue; } var t = typeof value; if (filter(t, value)) { filteredObject[name] = value; } } } catch (err) { console.error(err); } return filteredObject; } function supportsObject(object) { return true; } // Exports from this module module.exports = { rep: wrapRender(ObjectRep), supportsObject }; /***/ }), /* 937 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // Dependencies var React = __webpack_require__(0); var _require = __webpack_require__(927), maybeEscapePropertyName = _require.maybeEscapePropertyName, wrapRender = _require.wrapRender; var _require2 = __webpack_require__(925), MODE = _require2.MODE; // Shortcuts var span = React.DOM.span; /** * Property for Obj (local JS objects), Grip (remote JS objects) * and GripMap (remote JS maps and weakmaps) reps. * It's used to render object properties. */ PropRep.propTypes = { // Property name. name: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.object]).isRequired, // Equal character rendered between property name and value. equal: React.PropTypes.string, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), onDOMNodeMouseOver: React.PropTypes.func, onDOMNodeMouseOut: React.PropTypes.func, onInspectIconClick: React.PropTypes.func, // Normally a PropRep will quote a property name that isn't valid // when unquoted; but this flag can be used to suppress the // quoting. suppressQuotes: React.PropTypes.bool }; /** * Function that given a name, a delimiter and an object returns an array * of React elements representing an object property (e.g. `name: value`) * * @param {Object} props * @return {Array} Array of React elements. */ function PropRep(props) { var Grip = __webpack_require__(938); var _require3 = __webpack_require__(926), Rep = _require3.Rep; var name = props.name, mode = props.mode, equal = props.equal, suppressQuotes = props.suppressQuotes; var key = void 0; // The key can be a simple string, for plain objects, // or another object for maps and weakmaps. if (typeof name === "string") { if (!suppressQuotes) { name = maybeEscapePropertyName(name); } key = span({ "className": "nodeName" }, name); } else { key = Rep(Object.assign({}, props, { className: "nodeName", object: name, mode: mode || MODE.TINY, defaultRep: Grip })); } return [key, span({ "className": "objectEqual" }, equal), Rep(Object.assign({}, props))]; } // Exports from this module module.exports = wrapRender(PropRep); /***/ }), /* 938 */ /***/ (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); } } /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // ReactJS var React = __webpack_require__(0); // Dependencies var _require = __webpack_require__(927), isGrip = _require.isGrip, wrapRender = _require.wrapRender; var PropRep = __webpack_require__(937); var _require2 = __webpack_require__(925), MODE = _require2.MODE; // Shortcuts var span = React.DOM.span; /** * Renders generic grip. Grip is client representation * of remote JS object and is used as an input object * for this rep component. */ GripRep.propTypes = { object: React.PropTypes.object.isRequired, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), isInterestingProp: React.PropTypes.func, title: React.PropTypes.string, onDOMNodeMouseOver: React.PropTypes.func, onDOMNodeMouseOut: React.PropTypes.func, onInspectIconClick: React.PropTypes.func, noGrip: React.PropTypes.bool }; var DEFAULT_TITLE = "Object"; function GripRep(props) { var _props$mode = props.mode, mode = _props$mode === undefined ? MODE.SHORT : _props$mode, object = props.object; var config = { "data-link-actor-id": object.actor, className: "objectBox objectBox-object" }; if (mode === MODE.TINY) { var propertiesLength = getPropertiesLength(object); var tinyModeItems = []; if (getTitle(props, object) !== DEFAULT_TITLE) { tinyModeItems.push(getTitleElement(props, object)); } else { tinyModeItems.push(span({ className: "objectLeftBrace" }, "{"), propertiesLength > 0 ? span({ key: "more", className: "more-ellipsis", title: "more…" }, "…") : null, span({ className: "objectRightBrace" }, "}")); } return span.apply(undefined, [config].concat(tinyModeItems)); } var propsArray = safePropIterator(props, object, maxLengthMap.get(mode)); return span.apply(undefined, [config, getTitleElement(props, object), span({ className: "objectLeftBrace" }, " { ")].concat(_toConsumableArray(propsArray), [span({ className: "objectRightBrace" }, " }")])); } function getTitleElement(props, object) { return span({ className: "objectTitle" }, getTitle(props, object)); } function getTitle(props, object) { return props.title || object.class || DEFAULT_TITLE; } function getPropertiesLength(object) { var propertiesLength = object.preview && object.preview.ownPropertiesLength ? object.preview.ownPropertiesLength : object.ownPropertyLength; if (object.preview && object.preview.safeGetterValues) { propertiesLength += Object.keys(object.preview.safeGetterValues).length; } if (object.preview && object.preview.ownSymbols) { propertiesLength += object.preview.ownSymbolsLength; } return propertiesLength; } function safePropIterator(props, object, max) { max = typeof max === "undefined" ? maxLengthMap.get(MODE.SHORT) : max; try { return propIterator(props, object, max); } catch (err) { console.error(err); } return []; } function propIterator(props, object, max) { if (object.preview && Object.keys(object.preview).includes("wrappedValue")) { var _require3 = __webpack_require__(926), Rep = _require3.Rep; return [Rep({ object: object.preview.wrappedValue, mode: props.mode || MODE.TINY, defaultRep: Grip })]; } // Property filter. Show only interesting properties to the user. var isInterestingProp = props.isInterestingProp || ((type, value) => { return type == "boolean" || type == "number" || type == "string" && value.length != 0; }); var properties = object.preview ? object.preview.ownProperties : {}; var propertiesLength = getPropertiesLength(object); if (object.preview && object.preview.safeGetterValues) { properties = Object.assign({}, properties, object.preview.safeGetterValues); } var indexes = getPropIndexes(properties, max, isInterestingProp); if (indexes.length < max && indexes.length < propertiesLength) { // There are not enough props yet. Then add uninteresting props to display them. indexes = indexes.concat(getPropIndexes(properties, max - indexes.length, (t, value, name) => { return !isInterestingProp(t, value, name); })); } // The server synthesizes some property names for a Proxy, like // and ; we don't want to quote these because, // as synthetic properties, they appear more natural when // unquoted. var suppressQuotes = object.class === "Proxy"; var propsArray = getProps(props, properties, indexes, suppressQuotes); // Show symbols. if (object.preview && object.preview.ownSymbols) { var ownSymbols = object.preview.ownSymbols; var length = max - indexes.length; var symbolsProps = ownSymbols.slice(0, length).map(symbolItem => { return PropRep(Object.assign({}, props, { mode: MODE.TINY, name: symbolItem, object: symbolItem.descriptor.value, equal: ": ", defaultRep: Grip, title: null, suppressQuotes })); }); propsArray.push.apply(propsArray, _toConsumableArray(symbolsProps)); } if (Object.keys(properties).length > max || propertiesLength > max // When the object has non-enumerable properties, we don't have them in the packet, // but we might want to show there's something in the object. || propertiesLength > propsArray.length) { // There are some undisplayed props. Then display "more...". propsArray.push(span({ key: "more", className: "more-ellipsis", title: "more…" }, "…")); } return unfoldProps(propsArray); } function unfoldProps(items) { return items.reduce((res, item, index) => { if (Array.isArray(item)) { res = res.concat(item); } else { res.push(item); } // Interleave commas between elements if (index !== items.length - 1) { res.push(", "); } return res; }, []); } /** * Get props ordered by index. * * @param {Object} componentProps Grip Component props. * @param {Object} properties Properties of the object the Grip describes. * @param {Array} indexes Indexes of properties. * @param {Boolean} suppressQuotes true if we should suppress quotes * on property names. * @return {Array} Props. */ function getProps(componentProps, properties, indexes, suppressQuotes) { // Make indexes ordered by ascending. indexes.sort(function (a, b) { return a - b; }); var propertiesKeys = Object.keys(properties); return indexes.map(i => { var name = propertiesKeys[i]; var value = getPropValue(properties[name]); return PropRep(Object.assign({}, componentProps, { mode: MODE.TINY, name, object: value, equal: ": ", defaultRep: Grip, title: null, suppressQuotes })); }); } /** * Get the indexes of props in the object. * * @param {Object} properties Props object. * @param {Number} max The maximum length of indexes array. * @param {Function} filter Filter the props you want. * @return {Array} Indexes of interesting props in the object. */ function getPropIndexes(properties, max, filter) { var indexes = []; try { var i = 0; for (var name in properties) { if (indexes.length >= max) { return indexes; } // Type is specified in grip's "class" field and for primitive // values use typeof. var value = getPropValue(properties[name]); var type = value.class || typeof value; type = type.toLowerCase(); if (filter(type, value, name)) { indexes.push(i); } i++; } } catch (err) { console.error(err); } return indexes; } /** * Get the actual value of a property. * * @param {Object} property * @return {Object} Value of the property. */ function getPropValue(property) { var value = property; if (typeof property === "object") { var keys = Object.keys(property); if (keys.includes("value")) { value = property.value; } else if (keys.includes("getterValue")) { value = property.getterValue; } } return value; } // Registration function supportsObject(object) { var noGrip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (noGrip === true || !isGrip(object)) { return false; } return object.preview ? typeof object.preview.ownProperties !== "undefined" : typeof object.ownPropertyLength !== "undefined"; } var maxLengthMap = new Map(); maxLengthMap.set(MODE.SHORT, 3); maxLengthMap.set(MODE.LONG, 10); // Grip is used in propIterator and has to be defined here. var Grip = { rep: wrapRender(GripRep), supportsObject, maxLengthMap }; // Exports from this module module.exports = Grip; /***/ }), /* 939 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // Dependencies var React = __webpack_require__(0); var _require = __webpack_require__(927), getGripType = _require.getGripType, wrapRender = _require.wrapRender; // Shortcuts var span = React.DOM.span; /** * Renders a symbol. */ SymbolRep.propTypes = { object: React.PropTypes.object.isRequired }; function SymbolRep(props) { var _props$className = props.className, className = _props$className === undefined ? "objectBox objectBox-symbol" : _props$className, object = props.object; var name = object.name; return span({ className }, `Symbol(${name || ""})`); } function supportsObject(object) { var noGrip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; return getGripType(object, noGrip) == "symbol"; } // Exports from this module module.exports = { rep: wrapRender(SymbolRep), supportsObject }; /***/ }), /* 940 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // Dependencies var React = __webpack_require__(0); var _require = __webpack_require__(927), getGripType = _require.getGripType, wrapRender = _require.wrapRender; // Shortcuts var span = React.DOM.span; /** * Renders a Infinity object */ InfinityRep.propTypes = { object: React.PropTypes.object.isRequired }; function InfinityRep(props) { var object = props.object; return span({ className: "objectBox objectBox-number" }, object.type); } function supportsObject(object) { var noGrip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var type = getGripType(object, noGrip); return type == "Infinity" || type == "-Infinity"; } // Exports from this module module.exports = { rep: wrapRender(InfinityRep), supportsObject }; /***/ }), /* 941 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // Dependencies var React = __webpack_require__(0); var _require = __webpack_require__(927), getGripType = _require.getGripType, wrapRender = _require.wrapRender; // Shortcuts var span = React.DOM.span; /** * Renders a NaN object */ function NaNRep(props) { return span({ className: "objectBox objectBox-nan" }, "NaN"); } function supportsObject(object) { var noGrip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; return getGripType(object, noGrip) == "NaN"; } // Exports from this module module.exports = { rep: wrapRender(NaNRep), supportsObject }; /***/ }), /* 942 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // ReactJS var React = __webpack_require__(0); // Reps var _require = __webpack_require__(927), getGripType = _require.getGripType, isGrip = _require.isGrip, wrapRender = _require.wrapRender; var _require2 = __webpack_require__(931), StringRep = _require2.rep; // Shortcuts var span = React.DOM.span; /** * Renders DOM attribute */ Attribute.propTypes = { object: React.PropTypes.object.isRequired }; function Attribute(props) { var object = props.object; var value = object.preview.value; return span({ "data-link-actor-id": object.actor, className: "objectLink-Attr" }, span({ className: "attrTitle" }, getTitle(object)), span({ className: "attrEqual" }, "="), StringRep({ object: value })); } function getTitle(grip) { return grip.preview.nodeName; } // Registration function supportsObject(grip) { var noGrip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (noGrip === true || !isGrip(grip)) { return false; } return getGripType(grip, noGrip) == "Attr" && grip.preview; } module.exports = { rep: wrapRender(Attribute), supportsObject }; /***/ }), /* 943 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // ReactJS var React = __webpack_require__(0); // Reps var _require = __webpack_require__(927), getGripType = _require.getGripType, isGrip = _require.isGrip, wrapRender = _require.wrapRender; // Shortcuts var span = React.DOM.span; /** * Used to render JS built-in Date() object. */ DateTime.propTypes = { object: React.PropTypes.object.isRequired }; function DateTime(props) { var grip = props.object; var date = void 0; try { date = span({ "data-link-actor-id": grip.actor, className: "objectBox" }, getTitle(grip), span({ className: "Date" }, new Date(grip.preview.timestamp).toISOString())); } catch (e) { date = span({ className: "objectBox" }, "Invalid Date"); } return date; } function getTitle(grip) { return span({ className: "objectTitle" }, grip.class + " "); } // Registration function supportsObject(grip) { var noGrip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (noGrip === true || !isGrip(grip)) { return false; } return getGripType(grip, noGrip) == "Date" && grip.preview; } // Exports from this module module.exports = { rep: wrapRender(DateTime), supportsObject }; /***/ }), /* 944 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // ReactJS var React = __webpack_require__(0); // Reps var _require = __webpack_require__(927), getGripType = _require.getGripType, isGrip = _require.isGrip, getURLDisplayString = _require.getURLDisplayString, wrapRender = _require.wrapRender; // Shortcuts var span = React.DOM.span; /** * Renders DOM document object. */ Document.propTypes = { object: React.PropTypes.object.isRequired }; function Document(props) { var grip = props.object; return span({ "data-link-actor-id": grip.actor, className: "objectBox objectBox-object" }, getTitle(grip), span({ className: "objectPropValue" }, getLocation(grip))); } function getLocation(grip) { var location = grip.preview.location; return location ? getURLDisplayString(location) : ""; } function getTitle(grip) { return span({ className: "objectTitle" }, grip.class + " "); } // Registration function supportsObject(object) { var noGrip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (noGrip === true || !isGrip(object)) { return false; } return object.preview && getGripType(object, noGrip) == "HTMLDocument"; } // Exports from this module module.exports = { rep: wrapRender(Document), supportsObject }; /***/ }), /* 945 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // ReactJS var React = __webpack_require__(0); // Reps var _require = __webpack_require__(927), isGrip = _require.isGrip, wrapRender = _require.wrapRender; var _require2 = __webpack_require__(925), MODE = _require2.MODE; var _require3 = __webpack_require__(938), rep = _require3.rep; /** * Renders DOM event objects. */ Event.propTypes = { object: React.PropTypes.object.isRequired, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), onDOMNodeMouseOver: React.PropTypes.func, onDOMNodeMouseOut: React.PropTypes.func, onInspectIconClick: React.PropTypes.func }; function Event(props) { // Use `Object.assign` to keep `props` without changes because: // 1. JSON.stringify/JSON.parse is slow. // 2. Immutable.js is planned for the future. var gripProps = Object.assign({}, props, { title: getTitle(props) }); gripProps.object = Object.assign({}, props.object); gripProps.object.preview = Object.assign({}, props.object.preview); gripProps.object.preview.ownProperties = {}; if (gripProps.object.preview.target) { Object.assign(gripProps.object.preview.ownProperties, { target: gripProps.object.preview.target }); } Object.assign(gripProps.object.preview.ownProperties, gripProps.object.preview.properties); delete gripProps.object.preview.properties; gripProps.object.ownPropertyLength = Object.keys(gripProps.object.preview.ownProperties).length; switch (gripProps.object.class) { case "MouseEvent": gripProps.isInterestingProp = (type, value, name) => { return ["target", "clientX", "clientY", "layerX", "layerY"].includes(name); }; break; case "KeyboardEvent": gripProps.isInterestingProp = (type, value, name) => { return ["target", "key", "charCode", "keyCode"].includes(name); }; break; case "MessageEvent": gripProps.isInterestingProp = (type, value, name) => { return ["target", "isTrusted", "data"].includes(name); }; break; default: gripProps.isInterestingProp = (type, value, name) => { // We want to show the properties in the order they are declared. return Object.keys(gripProps.object.preview.ownProperties).includes(name); }; } return rep(gripProps); } function getTitle(props) { var preview = props.object.preview; var title = preview.type; if (preview.eventKind == "key" && preview.modifiers && preview.modifiers.length) { title = `${title} ${preview.modifiers.join("-")}`; } return title; } // Registration function supportsObject(grip) { var noGrip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (noGrip === true || !isGrip(grip)) { return false; } return grip.preview && grip.preview.kind == "DOMEvent"; } // Exports from this module module.exports = { rep: wrapRender(Event), supportsObject }; /***/ }), /* 946 */ /***/ (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); } } /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // ReactJS var React = __webpack_require__(0); // Reps var _require = __webpack_require__(927), getGripType = _require.getGripType, isGrip = _require.isGrip, cropString = _require.cropString, wrapRender = _require.wrapRender; var _require2 = __webpack_require__(925), MODE = _require2.MODE; // Shortcuts var span = React.DOM.span; /** * This component represents a template for Function objects. */ FunctionRep.propTypes = { object: React.PropTypes.object.isRequired, parameterNames: React.PropTypes.array }; function FunctionRep(props) { var grip = props.object; return span.apply(undefined, [{ "data-link-actor-id": grip.actor, className: "objectBox objectBox-function", // Set dir="ltr" to prevent function parentheses from // appearing in the wrong direction dir: "ltr" }, getTitle(grip, props), getFunctionName(grip, props), "("].concat(_toConsumableArray(renderParams(props)), [")"])); } function getTitle(grip, props) { var mode = props.mode; if (mode === MODE.TINY && !grip.isGenerator && !grip.isAsync) { return null; } var title = mode === MODE.TINY ? "" : "function "; if (grip.isGenerator) { title = mode === MODE.TINY ? "* " : "function* "; } if (grip.isAsync) { title = "async" + " " + title; } return span({ className: "objectTitle" }, title); } function getFunctionName(grip, props) { var name = grip.userDisplayName || grip.displayName || grip.name || props.functionName || ""; return cropString(name, 100); } function renderParams(props) { var _props$parameterNames = props.parameterNames, parameterNames = _props$parameterNames === undefined ? [] : _props$parameterNames; return parameterNames.filter(param => param).reduce((res, param, index, arr) => { res.push(span({ className: "param" }, param)); if (index < arr.length - 1) { res.push(span({ className: "delimiter" }, ", ")); } return res; }, []); } // Registration function supportsObject(grip) { var noGrip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var type = getGripType(grip, noGrip); if (noGrip === true || !isGrip(grip)) { return type == "function"; } return type == "Function"; } // Exports from this module module.exports = { rep: wrapRender(FunctionRep), supportsObject }; /***/ }), /* 947 */ /***/ (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); } } /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // ReactJS var React = __webpack_require__(0); // Dependencies var _require = __webpack_require__(927), getGripType = _require.getGripType, isGrip = _require.isGrip, wrapRender = _require.wrapRender; var PropRep = __webpack_require__(937); var _require2 = __webpack_require__(925), MODE = _require2.MODE; // Shortcuts var span = React.DOM.span; /** * Renders a DOM Promise object. */ PromiseRep.propTypes = { object: React.PropTypes.object.isRequired, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), onDOMNodeMouseOver: React.PropTypes.func, onDOMNodeMouseOut: React.PropTypes.func, onInspectIconClick: React.PropTypes.func }; function PromiseRep(props) { var object = props.object; var promiseState = object.promiseState; var config = { "data-link-actor-id": object.actor, className: "objectBox objectBox-object" }; if (props.mode === MODE.TINY) { var _require3 = __webpack_require__(926), Rep = _require3.Rep; return span(config, getTitle(object), span({ className: "objectLeftBrace" }, " { "), Rep({ object: promiseState.state }), span({ className: "objectRightBrace" }, " }")); } var propsArray = getProps(props, promiseState); return span.apply(undefined, [config, getTitle(object), span({ className: "objectLeftBrace" }, " { ")].concat(_toConsumableArray(propsArray), [span({ className: "objectRightBrace" }, " }")])); } function getTitle(object) { return span({ className: "objectTitle" }, object.class); } function getProps(props, promiseState) { var keys = ["state"]; if (Object.keys(promiseState).includes("value")) { keys.push("value"); } return keys.reduce((res, key, i) => { var object = promiseState[key]; res = res.concat(PropRep(Object.assign({}, props, { mode: MODE.TINY, name: `<${key}>`, object, equal: ": ", suppressQuotes: true }))); // Interleave commas between elements if (i !== keys.length - 1) { res.push(", "); } return res; }, []); } // Registration function supportsObject(object) { var noGrip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (noGrip === true || !isGrip(object)) { return false; } return getGripType(object, noGrip) == "Promise"; } // Exports from this module module.exports = { rep: wrapRender(PromiseRep), supportsObject }; /***/ }), /* 948 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // ReactJS var React = __webpack_require__(0); // Reps var _require = __webpack_require__(927), getGripType = _require.getGripType, isGrip = _require.isGrip, wrapRender = _require.wrapRender; /** * Renders a grip object with regular expression. */ RegExp.propTypes = { object: React.PropTypes.object.isRequired }; function RegExp(props) { var object = props.object; return React.DOM.span({ "data-link-actor-id": object.actor, className: "objectBox objectBox-regexp regexpSource" }, getSource(object)); } function getSource(grip) { return grip.displayString; } // Registration function supportsObject(object) { var noGrip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (noGrip === true || !isGrip(object)) { return false; } return getGripType(object, noGrip) == "RegExp"; } // Exports from this module module.exports = { rep: wrapRender(RegExp), supportsObject }; /***/ }), /* 949 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // ReactJS var React = __webpack_require__(0); // Reps var _require = __webpack_require__(927), getGripType = _require.getGripType, isGrip = _require.isGrip, getURLDisplayString = _require.getURLDisplayString, wrapRender = _require.wrapRender; // Shortcuts var span = React.DOM.span; /** * Renders a grip representing CSSStyleSheet */ StyleSheet.propTypes = { object: React.PropTypes.object.isRequired }; function StyleSheet(props) { var grip = props.object; return span({ "data-link-actor-id": grip.actor, className: "objectBox objectBox-object" }, getTitle(grip), span({ className: "objectPropValue" }, getLocation(grip))); } function getTitle(grip) { var title = "StyleSheet "; return span({ className: "objectBoxTitle" }, title); } function getLocation(grip) { // Embedded stylesheets don't have URL and so, no preview. var url = grip.preview ? grip.preview.url : ""; return url ? getURLDisplayString(url) : ""; } // Registration function supportsObject(object) { var noGrip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (noGrip === true || !isGrip(object)) { return false; } return getGripType(object, noGrip) == "CSSStyleSheet"; } // Exports from this module module.exports = { rep: wrapRender(StyleSheet), supportsObject }; /***/ }), /* 950 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // Dependencies var React = __webpack_require__(0); var _require = __webpack_require__(927), isGrip = _require.isGrip, cropString = _require.cropString, cropMultipleLines = _require.cropMultipleLines, wrapRender = _require.wrapRender; var _require2 = __webpack_require__(925), MODE = _require2.MODE; var nodeConstants = __webpack_require__(928); // Shortcuts var span = React.DOM.span; /** * Renders DOM comment node. */ CommentNode.propTypes = { object: React.PropTypes.object.isRequired, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])) }; function CommentNode(props) { var object = props.object, _props$mode = props.mode, mode = _props$mode === undefined ? MODE.SHORT : _props$mode; var textContent = object.preview.textContent; if (mode === MODE.TINY) { textContent = cropMultipleLines(textContent, 30); } else if (mode === MODE.SHORT) { textContent = cropString(textContent, 50); } return span({ className: "objectBox theme-comment", "data-link-actor-id": object.actor }, ``); } // Registration function supportsObject(object) { var noGrip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (noGrip === true || !isGrip(object)) { return false; } return object.preview && object.preview.nodeType === nodeConstants.COMMENT_NODE; } // Exports from this module module.exports = { rep: wrapRender(CommentNode), supportsObject }; /***/ }), /* 951 */ /***/ (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); } } /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // ReactJS var React = __webpack_require__(0); // Utils var _require = __webpack_require__(927), isGrip = _require.isGrip, wrapRender = _require.wrapRender; var _require2 = __webpack_require__(925), MODE = _require2.MODE; var nodeConstants = __webpack_require__(928); var Svg = __webpack_require__(1151); // Shortcuts var span = React.DOM.span; /** * Renders DOM element node. */ ElementNode.propTypes = { object: React.PropTypes.object.isRequired, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), onDOMNodeMouseOver: React.PropTypes.func, onDOMNodeMouseOut: React.PropTypes.func, onInspectIconClick: React.PropTypes.func }; function ElementNode(props) { var object = props.object, mode = props.mode, onDOMNodeMouseOver = props.onDOMNodeMouseOver, onDOMNodeMouseOut = props.onDOMNodeMouseOut, onInspectIconClick = props.onInspectIconClick; var elements = getElements(object, mode); var isInTree = object.preview && object.preview.isConnected === true; var baseConfig = { "data-link-actor-id": object.actor, className: "objectBox objectBox-node" }; var inspectIcon = void 0; if (isInTree) { if (onDOMNodeMouseOver) { Object.assign(baseConfig, { onMouseOver: _ => onDOMNodeMouseOver(object) }); } if (onDOMNodeMouseOut) { Object.assign(baseConfig, { onMouseOut: onDOMNodeMouseOut }); } if (onInspectIconClick) { inspectIcon = Svg("open-inspector", { element: "a", draggable: false, // TODO: Localize this with "openNodeInInspector" when Bug 1317038 lands title: "Click to select the node in the inspector", onClick: e => onInspectIconClick(object, e) }); } } return span.apply(undefined, [baseConfig].concat(_toConsumableArray(elements), [inspectIcon])); } function getElements(grip, mode) { var _grip$preview = grip.preview, attributes = _grip$preview.attributes, nodeName = _grip$preview.nodeName; var nodeNameElement = span({ className: "tag-name theme-fg-color3" }, nodeName); if (mode === MODE.TINY) { var elements = [nodeNameElement]; if (attributes.id) { elements.push(span({ className: "attr-name theme-fg-color2" }, `#${attributes.id}`)); } if (attributes.class) { elements.push(span({ className: "attr-name theme-fg-color2" }, attributes.class.replace(/(^\s+)|(\s+$)/g, "").split(" ").map(cls => `.${cls}`).join(""))); } return elements; } var attributeKeys = Object.keys(attributes); if (attributeKeys.includes("class")) { attributeKeys.splice(attributeKeys.indexOf("class"), 1); attributeKeys.unshift("class"); } if (attributeKeys.includes("id")) { attributeKeys.splice(attributeKeys.indexOf("id"), 1); attributeKeys.unshift("id"); } var attributeElements = attributeKeys.reduce((arr, name, i, keys) => { var value = attributes[name]; var attribute = span({}, span({ className: "attr-name theme-fg-color2" }, `${name}`), `="`, span({ className: "attr-value theme-fg-color6" }, `${value}`), `"`); return arr.concat([" ", attribute]); }, []); return ["<", nodeNameElement].concat(_toConsumableArray(attributeElements), [">"]); } // Registration function supportsObject(object) { var noGrip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (noGrip === true || !isGrip(object)) { return false; } return object.preview && object.preview.nodeType === nodeConstants.ELEMENT_NODE; } // Exports from this module module.exports = { rep: wrapRender(ElementNode), supportsObject }; /***/ }), /* 952 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 953 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // ReactJS var React = __webpack_require__(0); // Reps var _require = __webpack_require__(927), isGrip = _require.isGrip, cropString = _require.cropString, wrapRender = _require.wrapRender; var _require2 = __webpack_require__(925), MODE = _require2.MODE; var Svg = __webpack_require__(1151); // Shortcuts var DOM = React.DOM; /** * Renders DOM #text node. */ TextNode.propTypes = { object: React.PropTypes.object.isRequired, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), onDOMNodeMouseOver: React.PropTypes.func, onDOMNodeMouseOut: React.PropTypes.func, onInspectIconClick: React.PropTypes.func }; function TextNode(props) { var grip = props.object, _props$mode = props.mode, mode = _props$mode === undefined ? MODE.SHORT : _props$mode, onDOMNodeMouseOver = props.onDOMNodeMouseOver, onDOMNodeMouseOut = props.onDOMNodeMouseOut, onInspectIconClick = props.onInspectIconClick; var baseConfig = { "data-link-actor-id": grip.actor, className: "objectBox objectBox-textNode" }; var inspectIcon = void 0; var isInTree = grip.preview && grip.preview.isConnected === true; if (isInTree) { if (onDOMNodeMouseOver) { Object.assign(baseConfig, { onMouseOver: _ => onDOMNodeMouseOver(grip) }); } if (onDOMNodeMouseOut) { Object.assign(baseConfig, { onMouseOut: onDOMNodeMouseOut }); } if (onInspectIconClick) { inspectIcon = Svg("open-inspector", { element: "a", draggable: false, // TODO: Localize this with "openNodeInInspector" when Bug 1317038 lands title: "Click to select the node in the inspector", onClick: e => onInspectIconClick(grip, e) }); } } if (mode === MODE.TINY) { return DOM.span(baseConfig, getTitle(grip), inspectIcon); } return DOM.span(baseConfig, getTitle(grip), DOM.span({ className: "nodeValue" }, " ", `"${getTextContent(grip)}"`), inspectIcon); } function getTextContent(grip) { return cropString(grip.preview.textContent); } function getTitle(grip) { var title = "#text"; return DOM.span({}, title); } // Registration function supportsObject(grip) { var noGrip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (noGrip === true || !isGrip(grip)) { return false; } return grip.preview && grip.class == "Text"; } // Exports from this module module.exports = { rep: wrapRender(TextNode), supportsObject }; /***/ }), /* 954 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // ReactJS var React = __webpack_require__(0); // Utils var _require = __webpack_require__(927), getGripType = _require.getGripType, isGrip = _require.isGrip, wrapRender = _require.wrapRender; var _require2 = __webpack_require__(925), MODE = _require2.MODE; // Shortcuts var span = React.DOM.span; /** * Renders Error objects. */ ErrorRep.propTypes = { object: React.PropTypes.object.isRequired, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])) }; function ErrorRep(props) { var object = props.object; var preview = object.preview; var name = preview && preview.name ? preview.name : "Error"; var content = props.mode === MODE.TINY ? name : `${name}: ${preview.message}`; if (preview.stack && props.mode !== MODE.TINY) { /* * Since Reps are used in the JSON Viewer, we can't localize * the "Stack trace" label (defined in debugger.properties as * "variablesViewErrorStacktrace" property), until Bug 1317038 lands. */ content = `${content}\nStack trace:\n${preview.stack}`; } return span({ "data-link-actor-id": object.actor, className: "objectBox-stackTrace" }, content); } // Registration function supportsObject(object) { var noGrip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (noGrip === true || !isGrip(object)) { return false; } return object.preview && getGripType(object, noGrip) === "Error"; } // Exports from this module module.exports = { rep: wrapRender(ErrorRep), supportsObject }; /***/ }), /* 955 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // ReactJS var React = __webpack_require__(0); // Reps var _require = __webpack_require__(927), getGripType = _require.getGripType, isGrip = _require.isGrip, getURLDisplayString = _require.getURLDisplayString, wrapRender = _require.wrapRender; var _require2 = __webpack_require__(925), MODE = _require2.MODE; // Shortcuts var span = React.DOM.span; /** * Renders a grip representing a window. */ WindowRep.propTypes = { // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), object: React.PropTypes.object.isRequired }; function WindowRep(props) { var mode = props.mode, object = props.object; var config = { "data-link-actor-id": object.actor, className: "objectBox objectBox-Window" }; if (mode === MODE.TINY) { return span(config, getTitle(object)); } return span(config, getTitle(object), " ", span({ className: "objectPropValue" }, getLocation(object))); } function getTitle(object) { var title = object.displayClass || object.class || "Window"; return span({ className: "objectBoxTitle" }, title); } function getLocation(object) { return getURLDisplayString(object.preview.url); } // Registration function supportsObject(object) { var noGrip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (noGrip === true || !isGrip(object)) { return false; } return object.preview && getGripType(object, noGrip) == "Window"; } // Exports from this module module.exports = { rep: wrapRender(WindowRep), supportsObject }; /***/ }), /* 956 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // ReactJS var React = __webpack_require__(0); // Reps var _require = __webpack_require__(927), isGrip = _require.isGrip, wrapRender = _require.wrapRender; // Shortcuts var span = React.DOM.span; /** * Renders a grip object with textual data. */ ObjectWithText.propTypes = { object: React.PropTypes.object.isRequired }; function ObjectWithText(props) { var grip = props.object; return span({ "data-link-actor-id": grip.actor, className: "objectBox objectBox-" + getType(grip) }, span({ className: "objectPropValue" }, getDescription(grip))); } function getType(grip) { return grip.class; } function getDescription(grip) { return "\"" + grip.preview.text + "\""; } // Registration function supportsObject(grip) { var noGrip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (noGrip === true || !isGrip(grip)) { return false; } return grip.preview && grip.preview.kind == "ObjectWithText"; } // Exports from this module module.exports = { rep: wrapRender(ObjectWithText), supportsObject }; /***/ }), /* 957 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // ReactJS var React = __webpack_require__(0); // Reps var _require = __webpack_require__(927), isGrip = _require.isGrip, getURLDisplayString = _require.getURLDisplayString, wrapRender = _require.wrapRender; // Shortcuts var span = React.DOM.span; /** * Renders a grip object with URL data. */ ObjectWithURL.propTypes = { object: React.PropTypes.object.isRequired }; function ObjectWithURL(props) { var grip = props.object; return span({ "data-link-actor-id": grip.actor, className: "objectBox objectBox-" + getType(grip) }, getTitle(grip), span({ className: "objectPropValue" }, getDescription(grip))); } function getTitle(grip) { return span({ className: "objectTitle" }, getType(grip) + " "); } function getType(grip) { return grip.class; } function getDescription(grip) { return getURLDisplayString(grip.preview.url); } // Registration function supportsObject(grip) { var noGrip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (noGrip === true || !isGrip(grip)) { return false; } return grip.preview && grip.preview.kind == "ObjectWithURL"; } // Exports from this module module.exports = { rep: wrapRender(ObjectWithURL), supportsObject }; /***/ }), /* 958 */ /***/ (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); } } /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // Dependencies var React = __webpack_require__(0); var _require = __webpack_require__(927), getGripType = _require.getGripType, isGrip = _require.isGrip, wrapRender = _require.wrapRender; var _require2 = __webpack_require__(925), MODE = _require2.MODE; // Shortcuts var span = React.DOM.span; /** * Renders an array. The array is enclosed by left and right bracket * and the max number of rendered items depends on the current mode. */ GripArray.propTypes = { object: React.PropTypes.object.isRequired, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), provider: React.PropTypes.object, onDOMNodeMouseOver: React.PropTypes.func, onDOMNodeMouseOut: React.PropTypes.func, onInspectIconClick: React.PropTypes.func }; function GripArray(props) { var object = props.object, _props$mode = props.mode, mode = _props$mode === undefined ? MODE.SHORT : _props$mode; var items = void 0; var brackets = void 0; var needSpace = function (space) { return space ? { left: "[ ", right: " ]" } : { left: "[", right: "]" }; }; if (mode === MODE.TINY) { var objectLength = getLength(object); var isEmpty = objectLength === 0; if (isEmpty) { items = []; } else { items = [span({ className: "more-ellipsis", title: "more…" }, "…")]; } brackets = needSpace(false); } else { var max = maxLengthMap.get(mode); items = arrayIterator(props, object, max); brackets = needSpace(items.length > 0); } var title = getTitle(props, object); return span.apply(undefined, [{ "data-link-actor-id": object.actor, className: "objectBox objectBox-array" }, title, span({ className: "arrayLeftBracket" }, brackets.left)].concat(_toConsumableArray(interleaveCommas(items)), [span({ className: "arrayRightBracket" }, brackets.right), span({ className: "arrayProperties", role: "group" })])); } function interleaveCommas(items) { return items.reduce((res, item, index) => { if (index !== items.length - 1) { return res.concat(item, ", "); } return res.concat(item); }, []); } function getLength(grip) { if (!grip.preview) { return 0; } return grip.preview.length || grip.preview.childNodesLength || 0; } function getTitle(props, object) { if (props.mode === MODE.TINY) { return ""; } var title = props.title || object.class || "Array"; return span({ className: "objectTitle" }, title + " "); } function getPreviewItems(grip) { if (!grip.preview) { return null; } return grip.preview.items || grip.preview.childNodes || []; } function arrayIterator(props, grip, max) { var _require3 = __webpack_require__(926), Rep = _require3.Rep; var items = []; var gripLength = getLength(grip); if (!gripLength) { return items; } var previewItems = getPreviewItems(grip); var provider = props.provider; var emptySlots = 0; var foldedEmptySlots = 0; items = previewItems.reduce((res, itemGrip) => { if (res.length >= max) { return res; } var object = void 0; try { if (!provider && itemGrip === null) { emptySlots++; return res; } object = provider ? provider.getValue(itemGrip) : itemGrip; } catch (exc) { object = exc; } if (emptySlots > 0) { res.push(getEmptySlotsElement(emptySlots)); foldedEmptySlots = foldedEmptySlots + emptySlots - 1; emptySlots = 0; } if (res.length < max) { res.push(Rep(Object.assign({}, props, { object, mode: MODE.TINY, // Do not propagate title to array items reps title: undefined }))); } return res; }, []); // Handle trailing empty slots if there are some. if (items.length < max && emptySlots > 0) { items.push(getEmptySlotsElement(emptySlots)); foldedEmptySlots = foldedEmptySlots + emptySlots - 1; } var itemsShown = items.length + foldedEmptySlots; if (gripLength > itemsShown) { items.push(span({ className: "more-ellipsis", title: "more…" }, "…")); } return items; } function getEmptySlotsElement(number) { // TODO: Use l10N - See https://github.com/devtools-html/reps/issues/141 return `<${number} empty slot${number > 1 ? "s" : ""}>`; } function supportsObject(grip) { var noGrip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (noGrip === true || !isGrip(grip)) { return false; } return grip.preview && (grip.preview.kind == "ArrayLike" || getGripType(grip, noGrip) === "DocumentFragment"); } var maxLengthMap = new Map(); maxLengthMap.set(MODE.SHORT, 3); maxLengthMap.set(MODE.LONG, 10); // Exports from this module module.exports = { rep: wrapRender(GripArray), supportsObject, maxLengthMap }; /***/ }), /* 959 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); 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); } } /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // Dependencies var React = __webpack_require__(0); var _require = __webpack_require__(927), isGrip = _require.isGrip, wrapRender = _require.wrapRender; var PropRep = __webpack_require__(937); var _require2 = __webpack_require__(925), MODE = _require2.MODE; // Shortcuts var span = React.DOM.span; /** * Renders an map. A map is represented by a list of its * entries enclosed in curly brackets. */ GripMap.propTypes = { object: React.PropTypes.object, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), isInterestingEntry: React.PropTypes.func, onDOMNodeMouseOver: React.PropTypes.func, onDOMNodeMouseOut: React.PropTypes.func, onInspectIconClick: React.PropTypes.func, title: React.PropTypes.string }; function GripMap(props) { var mode = props.mode, object = props.object; var config = { "data-link-actor-id": object.actor, className: "objectBox objectBox-object" }; if (mode === MODE.TINY) { return span(config, getTitle(props, object)); } var propsArray = safeEntriesIterator(props, object, maxLengthMap.get(mode)); return span.apply(undefined, [config, getTitle(props, object), span({ className: "objectLeftBrace" }, " { ")].concat(_toConsumableArray(propsArray), [span({ className: "objectRightBrace" }, " }")])); } function getTitle(props, object) { var title = props.title || (object && object.class ? object.class : "Map"); return span({ className: "objectTitle" }, title); } function safeEntriesIterator(props, object, max) { max = typeof max === "undefined" ? 3 : max; try { return entriesIterator(props, object, max); } catch (err) { console.error(err); } return []; } function entriesIterator(props, object, max) { // Entry filter. Show only interesting entries to the user. var isInterestingEntry = props.isInterestingEntry || ((type, value) => { return type == "boolean" || type == "number" || type == "string" && value.length != 0; }); var mapEntries = object.preview && object.preview.entries ? object.preview.entries : []; var indexes = getEntriesIndexes(mapEntries, max, isInterestingEntry); if (indexes.length < max && indexes.length < mapEntries.length) { // There are not enough entries yet, so we add uninteresting entries. indexes = indexes.concat(getEntriesIndexes(mapEntries, max - indexes.length, (t, value, name) => { return !isInterestingEntry(t, value, name); })); } var entries = getEntries(props, mapEntries, indexes); if (entries.length < object.preview.size) { // There are some undisplayed entries. Then display "…". entries.push(span({ key: "more", className: "more-ellipsis", title: "more…" }, "…")); } return unfoldEntries(entries); } function unfoldEntries(items) { return items.reduce((res, item, index) => { if (Array.isArray(item)) { res = res.concat(item); } else { res.push(item); } // Interleave commas between elements if (index !== items.length - 1) { res.push(", "); } return res; }, []); } /** * Get entries ordered by index. * * @param {Object} props Component props. * @param {Array} entries Entries array. * @param {Array} indexes Indexes of entries. * @return {Array} Array of PropRep. */ function getEntries(props, entries, indexes) { var onDOMNodeMouseOver = props.onDOMNodeMouseOver, onDOMNodeMouseOut = props.onDOMNodeMouseOut, onInspectIconClick = props.onInspectIconClick; // Make indexes ordered by ascending. indexes.sort(function (a, b) { return a - b; }); return indexes.map((index, i) => { var _entries$index = _slicedToArray(entries[index], 2), key = _entries$index[0], entryValue = _entries$index[1]; var value = entryValue.value !== undefined ? entryValue.value : entryValue; return PropRep({ name: key, equal: " \u2192 ", object: value, mode: MODE.TINY, onDOMNodeMouseOver, onDOMNodeMouseOut, onInspectIconClick }); }); } /** * Get the indexes of entries in the map. * * @param {Array} entries Entries array. * @param {Number} max The maximum length of indexes array. * @param {Function} filter Filter the entry you want. * @return {Array} Indexes of filtered entries in the map. */ function getEntriesIndexes(entries, max, filter) { return entries.reduce((indexes, _ref, i) => { var _ref2 = _slicedToArray(_ref, 2), key = _ref2[0], entry = _ref2[1]; if (indexes.length < max) { var value = entry && entry.value !== undefined ? entry.value : entry; // Type is specified in grip's "class" field and for primitive // values use typeof. var type = (value && value.class ? value.class : typeof value).toLowerCase(); if (filter(type, value, key)) { indexes.push(i); } } return indexes; }, []); } function supportsObject(grip) { var noGrip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (noGrip === true || !isGrip(grip)) { return false; } return grip.preview && grip.preview.kind == "MapLike"; } var maxLengthMap = new Map(); maxLengthMap.set(MODE.SHORT, 3); maxLengthMap.set(MODE.LONG, 10); // Exports from this module module.exports = { rep: wrapRender(GripMap), supportsObject, maxLengthMap }; /***/ }), /* 960 */ /***/ (function(module, exports) { module.exports = "# This Source Code Form is subject to the terms of the Mozilla Public\n# License, v. 2.0. If a copy of the MPL was not distributed with this\n# file, You can obtain one at http://mozilla.org/MPL/2.0/.\n\n# LOCALIZATION NOTE These strings are used inside the Debugger\n# which is available from the Web Developer sub-menu -> 'Debugger'.\n# The correct localization of this file might be to keep it in\n# English, or another language commonly spoken among web developers.\n# You want to make that choice consistent across the developer tools.\n# A good criteria is the language in which you'd find the best\n# documentation on web development on the web.\n\n# LOCALIZATION NOTE (collapsePanes): This is the tooltip for the button\n# that collapses the left and right panes in the debugger UI.\ncollapsePanes=Collapse panes\n\n# LOCALIZATION NOTE (copySource): This is the text that appears in the\n# context menu to copy the selected source of file open.\ncopySource=Copy\ncopySource.accesskey=y\n\n# LOCALIZATION NOTE (copySourceUri2): This is the text that appears in the\n# context menu to copy the source URI of file open.\ncopySourceUri2=Copy source URI\ncopySourceUri2.accesskey=u\n\n# LOCALIZATION NOTE (copyFunction): This is the text that appears in the\n# context menu to copy the function the user selected\ncopyFunction.label=Copy function\ncopyFunction.accesskey=F\n\n# LOCALIZATION NOTE (copyStackTrace): This is the text that appears in the\n# context menu to copy the stack trace methods, file names and row number.\ncopyStackTrace=Copy stack trace\ncopyStackTrace.accesskey=c\n\n# LOCALIZATION NOTE (expandPanes): This is the tooltip for the button\n# that expands the left and right panes in the debugger UI.\nexpandPanes=Expand panes\n\n# LOCALIZATION NOTE (pauseButtonTooltip): The tooltip that is displayed for the pause\n# button when the debugger is in a running state.\npauseButtonTooltip=Pause %S\n\n# LOCALIZATION NOTE (pausePendingButtonTooltip): The tooltip that is displayed for\n# the pause button after it's been clicked but before the next JavaScript to run.\npausePendingButtonTooltip=Waiting for next execution\n\n# LOCALIZATION NOTE (resumeButtonTooltip): The label that is displayed on the pause\n# button when the debugger is in a paused state.\nresumeButtonTooltip=Resume %S\n\n# LOCALIZATION NOTE (stepOverTooltip): The label that is displayed on the\n# button that steps over a function call.\nstepOverTooltip=Step over %S\n\n# LOCALIZATION NOTE (stepInTooltip): The label that is displayed on the\n# button that steps into a function call.\nstepInTooltip=Step in %S\n\n# LOCALIZATION NOTE (stepOutTooltip): The label that is displayed on the\n# button that steps out of a function call.\nstepOutTooltip=Step out %S\n\n# LOCALIZATION NOTE (workersHeader): The text to display in the events\n# header.\nworkersHeader=Workers\n\n# LOCALIZATION NOTE (noWorkersText): The text to display in the workers list\n# when there are no workers.\nnoWorkersText=This page has no workers.\n\n# LOCALIZATION NOTE (noSourcesText): The text to display in the sources list\n# when there are no sources.\nnoSourcesText=This page has no sources.\n\n# LOCALIZATION NOTE (noEventListenersText): The text to display in the events tab\n# when there are no events.\nnoEventListenersText=No event listeners to display.\n\n# LOCALIZATION NOTE (eventListenersHeader): The text to display in the events\n# header.\neventListenersHeader=Event listeners\n\n# LOCALIZATION NOTE (noStackFramesText): The text to display in the call stack tab\n# when there are no stack frames.\nnoStackFramesText=No stack frames to display\n\n# LOCALIZATION NOTE (eventCheckboxTooltip): The tooltip text to display when\n# the user hovers over the checkbox used to toggle an event breakpoint.\neventCheckboxTooltip=Toggle breaking on this event\n\n# LOCALIZATION NOTE (eventOnSelector): The text to display in the events tab\n# for every event item, between the event type and event selector.\neventOnSelector=on\n\n# LOCALIZATION NOTE (eventInSource): The text to display in the events tab\n# for every event item, between the event selector and listener's owner source.\neventInSource=in\n\n# LOCALIZATION NOTE (eventNodes): The text to display in the events tab when\n# an event is listened on more than one target node.\neventNodes=%S nodes\n\n# LOCALIZATION NOTE (eventNative): The text to display in the events tab when\n# a listener is added from plugins, thus getting translated to native code.\neventNative=[native code]\n\n# LOCALIZATION NOTE (*Events): The text to display in the events tab for\n# each group of sub-level event entries.\nanimationEvents=Animation\naudioEvents=Audio\nbatteryEvents=Battery\nclipboardEvents=Clipboard\ncompositionEvents=Composition\ndeviceEvents=Device\ndisplayEvents=Display\ndragAndDropEvents=Drag and Drop\ngamepadEvents=Gamepad\nindexedDBEvents=IndexedDB\ninteractionEvents=Interaction\nkeyboardEvents=Keyboard\nmediaEvents=HTML5 Media\nmouseEvents=Mouse\nmutationEvents=Mutation\nnavigationEvents=Navigation\npointerLockEvents=Pointer Lock\nsensorEvents=Sensor\nstorageEvents=Storage\ntimeEvents=Time\ntouchEvents=Touch\notherEvents=Other\n\n# LOCALIZATION NOTE (blackboxCheckboxTooltip2): The tooltip text to display when\n# the user hovers over the checkbox used to toggle blackboxing its associated\n# source.\nblackboxCheckboxTooltip2=Toggle blackboxing\n\n# LOCALIZATION NOTE (sources.search.key2): Key shortcut to open the search for\n# searching all the source files the debugger has seen.\nsources.search.key2=CmdOrCtrl+P\n\n# LOCALIZATION NOTE (sources.search.alt.key): A second key shortcut to open the\n# search for searching all the source files the debugger has seen.\nsources.search.alt.key=CmdOrCtrl+O\n\n# LOCALIZATION NOTE (projectTextSearch.key): A key shortcut to open the\n# full project text search for searching all the files the debugger has seen.\nprojectTextSearch.key=CmdOrCtrl+Shift+F\n\n# LOCALIZATION NOTE (functionSearch.key): A key shortcut to open the\n# modal for searching functions in a file.\nfunctionSearch.key=CmdOrCtrl+Shift+O\n\n# LOCALIZATION NOTE (toggleBreakpoint.key): A key shortcut to toggle\n# breakpoints.\ntoggleBreakpoint.key=CmdOrCtrl+B\n\n# LOCALIZATION NOTE (toggleCondPanel.key): A key shortcut to toggle\n# the conditional breakpoint panel.\ntoggleCondPanel.key=CmdOrCtrl+Shift+B\n\n# LOCALIZATION NOTE (stepOut.key): A key shortcut to\n# step out.\nstepOut.key=Shift+F11\n\n# LOCALIZATION NOTE (shortcuts.header.editor): Sections header in\n# the shortcuts modal for keyboard shortcuts related to editing.\nshortcuts.header.editor=Editor\n\n# LOCALIZATION NOTE (shortcuts.header.stepping): Sections header in\n# the shortcuts modal for keyboard shortcuts related to stepping.\nshortcuts.header.stepping=Stepping\n\n# LOCALIZATION NOTE (shortcuts.header.search): Sections header in\n# the shortcuts modal for keyboard shortcuts related to search.\nshortcuts.header.search=Search\n\n# LOCALIZATION NOTE (projectTextSearch.placeholder): A placeholder shown\n# when searching across all of the files in a project.\nprojectTextSearch.placeholder=Find in files…\n\n# LOCALIZATION NOTE (projectTextSearch.noResults): The center pane Text Search\n# message when the query did not match any text of all files in a project.\nprojectTextSearch.noResults=No results found\n\n# LOCALIZATION NOTE (sources.noSourcesAvailable): Text shown when the debugger\n# does not have any sources.\nsources.noSourcesAvailable=This page has no sources\n\n# LOCALIZATION NOTE (sourceSearch.search.key2): Key shortcut to open the search\n# for searching within a the currently opened files in the editor\nsourceSearch.search.key2=CmdOrCtrl+F\n\n# LOCALIZATION NOTE (sourceSearch.search.placeholder): placeholder text in\n# the source search input bar\nsourceSearch.search.placeholder=Search in file…\n\n# LOCALIZATION NOTE (sourceSearch.search.again.key2): Key shortcut to highlight\n# the next occurrence of the last search triggered from a source search\nsourceSearch.search.again.key2=CmdOrCtrl+G\n\n# LOCALIZATION NOTE (sourceSearch.search.againPrev.key2): Key shortcut to highlight\n# the previous occurrence of the last search triggered from a source search\nsourceSearch.search.againPrev.key2=CmdOrCtrl+Shift+G\n\n# LOCALIZATION NOTE (sourceSearch.resultsSummary1): Shows a summary of\n# the number of matches for autocomplete\nsourceSearch.resultsSummary1=%d results\n\n# LOCALIZATION NOTE (noMatchingStringsText): The text to display in the\n# global search results when there are no matching strings after filtering.\nnoMatchingStringsText=No matches found\n\n# LOCALIZATION NOTE (emptySearchText): This is the text that appears in the\n# filter text box when it is empty and the scripts container is selected.\nemptySearchText=Search scripts (%S)\n\n# LOCALIZATION NOTE (emptyVariablesFilterText): This is the text that\n# appears in the filter text box for the variables view container.\nemptyVariablesFilterText=Filter variables\n\n# LOCALIZATION NOTE (emptyPropertiesFilterText): This is the text that\n# appears in the filter text box for the editor's variables view bubble.\nemptyPropertiesFilterText=Filter properties\n\n# LOCALIZATION NOTE (searchPanelFilter): This is the text that appears in the\n# filter panel popup for the filter scripts operation.\nsearchPanelFilter=Filter scripts (%S)\n\n# LOCALIZATION NOTE (searchPanelGlobal): This is the text that appears in the\n# filter panel popup for the global search operation.\nsearchPanelGlobal=Search in all files (%S)\n\n# LOCALIZATION NOTE (searchPanelFunction): This is the text that appears in the\n# filter panel popup for the function search operation.\nsearchPanelFunction=Search for function definition (%S)\n\n# LOCALIZATION NOTE (searchPanelToken): This is the text that appears in the\n# filter panel popup for the token search operation.\nsearchPanelToken=Find in this file (%S)\n\n# LOCALIZATION NOTE (searchPanelGoToLine): This is the text that appears in the\n# filter panel popup for the line search operation.\nsearchPanelGoToLine=Go to line (%S)\n\n# LOCALIZATION NOTE (searchPanelVariable): This is the text that appears in the\n# filter panel popup for the variables search operation.\nsearchPanelVariable=Filter variables (%S)\n\n# LOCALIZATION NOTE (breakpointMenuItem): The text for all the elements that\n# are displayed in the breakpoints menu item popup.\nbreakpointMenuItem.setConditional=Configure conditional breakpoint\nbreakpointMenuItem.enableSelf2.label=Enable\nbreakpointMenuItem.enableSelf2.accesskey=E\nbreakpointMenuItem.disableSelf2.label=Disable\nbreakpointMenuItem.disableSelf2.accesskey=D\nbreakpointMenuItem.deleteSelf2.label=Remove\nbreakpointMenuItem.deleteSelf2.accesskey=R\nbreakpointMenuItem.enableOthers2.label=Enable others\nbreakpointMenuItem.enableOthers2.accesskey=o\nbreakpointMenuItem.disableOthers2.label=Disable others\nbreakpointMenuItem.disableOthers2.accesskey=s\nbreakpointMenuItem.deleteOthers2.label=Remove others\nbreakpointMenuItem.deleteOthers2.accesskey=h\nbreakpointMenuItem.enableAll2.label=Enable all\nbreakpointMenuItem.enableAll2.accesskey=b\nbreakpointMenuItem.disableAll2.label=Disable all\nbreakpointMenuItem.disableAll2.accesskey=k\nbreakpointMenuItem.deleteAll2.label=Remove all\nbreakpointMenuItem.deleteAll2.accesskey=a\nbreakpointMenuItem.removeCondition2.label=Remove condition\nbreakpointMenuItem.removeCondition2.accesskey=c\nbreakpointMenuItem.addCondition2.label=Add condition\nbreakpointMenuItem.addCondition2.accesskey=A\nbreakpointMenuItem.editCondition2.label=Edit condition\nbreakpointMenuItem.editCondition2.accesskey=n\nbreakpointMenuItem.enableSelf=Enable breakpoint\nbreakpointMenuItem.enableSelf.accesskey=E\nbreakpointMenuItem.disableSelf=Disable breakpoint\nbreakpointMenuItem.disableSelf.accesskey=D\nbreakpointMenuItem.deleteSelf=Remove breakpoint\nbreakpointMenuItem.deleteSelf.accesskey=R\nbreakpointMenuItem.enableOthers=Enable others\nbreakpointMenuItem.enableOthers.accesskey=o\nbreakpointMenuItem.disableOthers=Disable others\nbreakpointMenuItem.disableOthers.accesskey=s\nbreakpointMenuItem.deleteOthers=Remove others\nbreakpointMenuItem.deleteOthers.accesskey=h\nbreakpointMenuItem.enableAll=Enable all breakpoints\nbreakpointMenuItem.enableAll.accesskey=b\nbreakpointMenuItem.disableAll=Disable all breakpoints\nbreakpointMenuItem.disableAll.accesskey=k\nbreakpointMenuItem.deleteAll=Remove all breakpoints\nbreakpointMenuItem.deleteAll.accesskey=a\nbreakpointMenuItem.removeCondition.label=Remove breakpoint condition\nbreakpointMenuItem.removeCondition.accesskey=c\nbreakpointMenuItem.editCondition.label=Edit breakpoint condition\nbreakpointMenuItem.editCondition.accesskey=n\n\n# LOCALIZATION NOTE (breakpoints.header): Breakpoints right sidebar pane header.\nbreakpoints.header=Breakpoints\n\n# LOCALIZATION NOTE (breakpoints.none): The text that appears when there are\n# no breakpoints present\nbreakpoints.none=No breakpoints\n\n# LOCALIZATION NOTE (breakpoints.enable): The text that may appear as a tooltip\n# when hovering over the 'disable breakpoints' switch button in right sidebar\nbreakpoints.enable=Enable breakpoints\n\n# LOCALIZATION NOTE (breakpoints.disable): The text that may appear as a tooltip\n# when hovering over the 'disable breakpoints' switch button in right sidebar\nbreakpoints.disable=Disable breakpoints\n\n# LOCALIZATION NOTE (breakpoints.removeBreakpointTooltip): The tooltip that is displayed\n# for remove breakpoint button in right sidebar\nbreakpoints.removeBreakpointTooltip=Remove breakpoint\n\n# LOCALIZATION NOTE (callStack.header): Call Stack right sidebar pane header.\ncallStack.header=Call stack\n\n# LOCALIZATION NOTE (callStack.notPaused): Call Stack right sidebar pane\n# message when not paused.\ncallStack.notPaused=Not paused\n\n# LOCALIZATION NOTE (callStack.collapse): Call Stack right sidebar pane\n# message to hide some of the frames that are shown.\ncallStack.collapse=Collapse rows\n\n# LOCALIZATION NOTE (callStack.expand): Call Stack right sidebar pane\n# message to show more of the frames.\ncallStack.expand=Expand rows\n\n# LOCALIZATION NOTE (editor.searchResults): Editor Search bar message\n# for the summarizing the selected search result. e.g. 5 of 10 results.\neditor.searchResults=%d of %d results\n\n# LOCALIZATION NOTE (sourceSearch.singleResult): Copy shown when there is one result.\neditor.singleResult=1 result\n\n# LOCALIZATION NOTE (editor.noResults): Editor Search bar message\n# for when no results found.\neditor.noResults=No results\n\n# LOCALIZATION NOTE (editor.searchResults.nextResult): Editor Search bar\n# tooltip for traversing to the Next Result\neditor.searchResults.nextResult=Next result\n\n# LOCALIZATION NOTE (editor.searchResults.prevResult): Editor Search bar\n# tooltip for traversing to the Previous Result\neditor.searchResults.prevResult=Previous result\n\n# LOCALIZATION NOTE (editor.searchTypeToggleTitle): Search bar title for\n# toggling search type buttons(function search, variable search)\neditor.searchTypeToggleTitle=Search for:\n\n# LOCALIZATION NOTE (editor.continueToHere.label): Editor gutter context\n# menu item for jumping to a new paused location\neditor.continueToHere.label=Continue to here\neditor.continueToHere.accesskey=H\n\n# LOCALIZATION NOTE (editor.addBreakpoint): Editor gutter context menu item\n# for adding a breakpoint on a line.\neditor.addBreakpoint=Add breakpoint\n\n# LOCALIZATION NOTE (editor.disableBreakpoint): Editor gutter context menu item\n# for disabling a breakpoint on a line.\neditor.disableBreakpoint=Disable breakpoint\n\n# LOCALIZATION NOTE (editor.enableBreakpoint): Editor gutter context menu item\n# for enabling a breakpoint on a line.\neditor.enableBreakpoint=Enable breakpoint\n\n# LOCALIZATION NOTE (editor.removeBreakpoint): Editor gutter context menu item\n# for removing a breakpoint on a line.\neditor.removeBreakpoint=Remove breakpoint\n\n# LOCALIZATION NOTE (editor.editBreakpoint): Editor gutter context menu item\n# for setting a breakpoint condition on a line.\neditor.editBreakpoint=Edit breakpoint\n\n# LOCALIZATION NOTE (editor.addConditionalBreakpoint): Editor gutter context\n# menu item for adding a breakpoint condition on a line.\neditor.addConditionalBreakpoint=Add conditional breakpoint\n\n# LOCALIZATION NOTE (editor.conditionalPanel.placeholder): Placeholder text for\n# input element inside ConditionalPanel component\neditor.conditionalPanel.placeholder=This breakpoint will pause when the expression is true\n\n# LOCALIZATION NOTE (editor.conditionalPanel.placeholder): Tooltip text for\n# close button inside ConditionalPanel component\neditor.conditionalPanel.close=Cancel edit breakpoint and close\n\n# LOCALIZATION NOTE (editor.jumpToMappedLocation1): Context menu item\n# for navigating to a source mapped location\neditor.jumpToMappedLocation1=Jump to %S location\n\n# LOCALIZATION NOTE (framework.disableGrouping): This is the text that appears in the\n# context menu to disable framework grouping.\nframework.disableGrouping=Disable framework grouping\nframework.disableGrouping.accesskey=u\n\n# LOCALIZATION NOTE (framework.enableGrouping): This is the text that appears in the\n# context menu to enable framework grouping.\nframework.enableGrouping=Enable framework grouping\nframework.enableGrouping.accesskey=u\n\n# LOCALIZATION NOTE (generated): Source Map term for a server source location\ngenerated=Generated\n\n# LOCALIZATION NOTE (original): Source Map term for a debugger UI source location\noriginal=original\n\n# LOCALIZATION NOTE (expressions.placeholder): Placeholder text for expression\n# input element\nexpressions.placeholder=Add watch expression\n\n# LOCALIZATION NOTE (sourceTabs.closeTab): Editor source tab context menu item\n# for closing the selected tab below the mouse.\nsourceTabs.closeTab=Close tab\nsourceTabs.closeTab.accesskey=c\n\n# LOCALIZATION NOTE (sourceTabs.closeOtherTabs): Editor source tab context menu item\n# for closing the other tabs.\nsourceTabs.closeOtherTabs=Close other tabs\nsourceTabs.closeOtherTabs.accesskey=o\n\n# LOCALIZATION NOTE (sourceTabs.closeTabsToEnd): Editor source tab context menu item\n# for closing the tabs to the end (the right for LTR languages) of the selected tab.\nsourceTabs.closeTabsToEnd=Close tabs to the right\nsourceTabs.closeTabsToEnd.accesskey=e\n\n# LOCALIZATION NOTE (sourceTabs.closeAllTabs): Editor source tab context menu item\n# for closing all tabs.\nsourceTabs.closeAllTabs=Close all tabs\nsourceTabs.closeAllTabs.accesskey=a\n\n# LOCALIZATION NOTE (sourceTabs.revealInTree): Editor source tab context menu item\n# for revealing source in tree.\nsourceTabs.revealInTree=Reveal in tree\nsourceTabs.revealInTree.accesskey=r\n\n# LOCALIZATION NOTE (sourceTabs.copyLink): Editor source tab context menu item\n# for copying a link address.\nsourceTabs.copyLink=Copy link address\nsourceTabs.copyLink.accesskey=l\n\n# LOCALIZATION NOTE (sourceTabs.prettyPrint): Editor source tab context menu item\n# for pretty printing the source.\nsourceTabs.prettyPrint=Pretty print source\nsourceTabs.prettyPrint.accesskey=p\n\n# LOCALIZATION NOTE (sourceFooter.blackbox): Tooltip text associated\n# with the blackbox button\nsourceFooter.blackbox=Blackbox source\nsourceFooter.blackbox.accesskey=B\n\n# LOCALIZATION NOTE (sourceFooter.unblackbox): Tooltip text associated\n# with the blackbox button\nsourceFooter.unblackbox=Unblackbox source\nsourceFooter.unblackbox.accesskey=b\n\n# LOCALIZATION NOTE (sourceFooter.blackboxed): Text associated\n# with a blackboxed source\nsourceFooter.blackboxed=Blackboxed source\n\n# LOCALIZATION NOTE (sourceFooter.codeCoverage): Text associated\n# with a code coverage button\nsourceFooter.codeCoverage=Code coverage\n\n# LOCALIZATION NOTE (sourceTabs.closeTabButtonTooltip): The tooltip that is displayed\n# for close tab button in source tabs.\nsourceTabs.closeTabButtonTooltip=Close tab\n\n# LOCALIZATION NOTE (sourceTabs.newTabButtonTooltip): The tooltip that is displayed for\n# new tab button in source tabs.\nsourceTabs.newTabButtonTooltip=Search for sources (%S)\n\n# LOCALIZATION NOTE (scopes.header): Scopes right sidebar pane header.\nscopes.header=Scopes\n\n# LOCALIZATION NOTE (scopes.notAvailable): Scopes right sidebar pane message\n# for when the debugger is paused, but there isn't pause data.\nscopes.notAvailable=Scopes unavailable\n\n# LOCALIZATION NOTE (scopes.notPaused): Scopes right sidebar pane message\n# for when the debugger is not paused.\nscopes.notPaused=Not paused\n\n# LOCALIZATION NOTE (scopes.block): Refers to a block of code in\n# the scopes pane when the debugger is paused.\nscopes.block=Block\n\n# LOCALIZATION NOTE (sources.header): Sources left sidebar header\nsources.header=Sources\n\n# LOCALIZATION NOTE (outline.header): Outline left sidebar header\noutline.header=Outline\n\n# LOCALIZATION NOTE (outline.noFunctions): Outline text when there are no functions to display\noutline.noFunctions=No functions\n\n# LOCALIZATION NOTE (sources.search): Sources left sidebar prompt\n# e.g. Cmd+P to search. On a mac, we use the command unicode character.\n# On windows, it's ctrl.\nsources.search=%S to search\n\n# LOCALIZATION NOTE (watchExpressions.header): Watch Expressions right sidebar\n# pane header.\nwatchExpressions.header=Watch expressions\n\n# LOCALIZATION NOTE (watchExpressions.refreshButton): Watch Expressions header\n# button for refreshing the expressions.\nwatchExpressions.refreshButton=Refresh\n\n# LOCALIZATION NOTE (welcome.search): The center pane welcome panel's\n# search prompt. e.g. cmd+p to search for files. On windows, it's ctrl, on\n# a mac we use the unicode character.\nwelcome.search=%S to search for sources\n\n# LOCALIZATION NOTE (welcome.findInFiles): The center pane welcome panel's\n# search prompt. e.g. cmd+f to search for files. On windows, it's ctrl+shift+f, on\n# a mac we use the unicode character.\nwelcome.findInFiles=%S to find in files\n\n# LOCALIZATION NOTE (welcome.searchFunction): Label displayed in the welcome\n# panel. %S is replaced by the keyboard shortcut to search for functions.\nwelcome.searchFunction=%S to search for functions in file\n\n# LOCALIZATION NOTE (sourceSearch.search): The center pane Source Search\n# prompt for searching for files.\nsourceSearch.search=Search sources…\n\n# LOCALIZATION NOTE (sourceSearch.noResults): The center pane Source Search\n# message when the query did not match any of the sources.\nsourceSearch.noResults2=No results found\n\n# LOCALIZATION NOTE (ignoreExceptions): The pause on exceptions button tooltip\n# when the debugger will not pause on exceptions.\nignoreExceptions=Ignore exceptions. Click to pause on uncaught exceptions\n\n# LOCALIZATION NOTE (pauseOnUncaughtExceptions): The pause on exceptions button\n# tooltip when the debugger will pause on uncaught exceptions.\npauseOnUncaughtExceptions=Pause on uncaught exceptions. Click to pause on all exceptions\n\n# LOCALIZATION NOTE (pauseOnExceptions): The pause on exceptions button tooltip\n# when the debugger will pause on all exceptions.\npauseOnExceptions=Pause on all exceptions. Click to ignore exceptions\n\n# LOCALIZATION NOTE (loadingText): The text that is displayed in the script\n# editor when the loading process has started but there is no file to display\n# yet.\nloadingText=Loading\\u2026\n\n# LOCALIZATION NOTE (errorLoadingText3): The text that is displayed in the debugger\n# viewer when there is an error loading a file\nerrorLoadingText3=Error loading this URI: %S\n\n# LOCALIZATION NOTE (addWatchExpressionText): The text that is displayed in the\n# watch expressions list to add a new item.\naddWatchExpressionText=Add watch expression\n\n# LOCALIZATION NOTE (addWatchExpressionButton): The button that is displayed in the\n# variables view popup.\naddWatchExpressionButton=Watch\n\n# LOCALIZATION NOTE (emptyVariablesText): The text that is displayed in the\n# variables pane when there are no variables to display.\nemptyVariablesText=No variables to display\n\n# LOCALIZATION NOTE (scopeLabel): The text that is displayed in the variables\n# pane as a header for each variable scope (e.g. \"Global scope, \"With scope\",\n# etc.).\nscopeLabel=%S scope\n\n# LOCALIZATION NOTE (watchExpressionsScopeLabel): The name of the watch\n# expressions scope. This text is displayed in the variables pane as a header for\n# the watch expressions scope.\nwatchExpressionsScopeLabel=Watch expressions\n\n# LOCALIZATION NOTE (globalScopeLabel): The name of the global scope. This text\n# is added to scopeLabel and displayed in the variables pane as a header for\n# the global scope.\nglobalScopeLabel=Global\n\n# LOCALIZATION NOTE (variablesViewErrorStacktrace): This is the text that is\n# shown before the stack trace in an error.\nvariablesViewErrorStacktrace=Stack trace:\n\n# LOCALIZATION NOTE (variablesViewMoreObjects): the text that is displayed\n# when you have an object preview that does not show all of the elements. At the end of the list\n# you see \"N more...\" in the web console output.\n# This is a semi-colon list of plural forms.\n# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals\n# #1 number of remaining items in the object\n# example: 3 more…\nvariablesViewMoreObjects=#1 more…;#1 more…\n\n# LOCALIZATION NOTE (variablesEditableNameTooltip): The text that is displayed\n# in the variables list on an item with an editable name.\nvariablesEditableNameTooltip=Double click to edit\n\n# LOCALIZATION NOTE (variablesEditableValueTooltip): The text that is displayed\n# in the variables list on an item with an editable value.\nvariablesEditableValueTooltip=Click to change value\n\n# LOCALIZATION NOTE (variablesCloseButtonTooltip): The text that is displayed\n# in the variables list on an item which can be removed.\nvariablesCloseButtonTooltip=Click to remove\n\n# LOCALIZATION NOTE (variablesEditButtonTooltip): The text that is displayed\n# in the variables list on a getter or setter which can be edited.\nvariablesEditButtonTooltip=Click to set value\n\n# LOCALIZATION NOTE (variablesEditableValueTooltip): The text that is displayed\n# in a tooltip on the \"open in inspector\" button in the the variables list for a\n# DOMNode item.\nvariablesDomNodeValueTooltip=Click to select the node in the inspector\n\n# LOCALIZATION NOTE (configurable|...|Tooltip): The text that is displayed\n# in the variables list on certain variables or properties as tooltips.\n# Expanations of what these represent can be found at the following links:\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/isSealed\n# It's probably best to keep these in English.\nconfigurableTooltip=configurable\nenumerableTooltip=enumerable\nwritableTooltip=writable\nfrozenTooltip=frozen\nsealedTooltip=sealed\nextensibleTooltip=extensible\noverriddenTooltip=overridden\nWebIDLTooltip=WebIDL\n\n# LOCALIZATION NOTE (variablesSeparatorLabel): The text that is displayed\n# in the variables list as a separator between the name and value.\nvariablesSeparatorLabel=:\n\n# LOCALIZATION NOTE (watchExpressionsSeparatorLabel2): The text that is displayed\n# in the watch expressions list as a separator between the code and evaluation.\nwatchExpressionsSeparatorLabel2=\\u0020→\n\n# LOCALIZATION NOTE (functionSearchSeparatorLabel): The text that is displayed\n# in the functions search panel as a separator between function's inferred name\n# and its real name (if available).\nfunctionSearchSeparatorLabel=←\n\n# LOCALIZATION NOTE(symbolSearch.search.functionsPlaceholder): The placeholder\n# text displayed when the user searches for functions in a file\nsymbolSearch.search.functionsPlaceholder=Search functions…\n\n# LOCALIZATION NOTE(symbolSearch.search.variablesPlaceholder): The placeholder\n# text displayed when the user searches for variables in a file\nsymbolSearch.search.variablesPlaceholder=Search variables…\n\n# LOCALIZATION NOTE(symbolSearch.search.key2): The Key Shortcut for\n# searching for a function or variable\nsymbolSearch.search.key2=CmdOrCtrl+Shift+O\n\n# LOCALIZATION NOTE(symbolSearch.searchModifier.modifiersLabel): A label\n# preceding the group of modifiers\nsymbolSearch.searchModifier.modifiersLabel=Modifiers:\n\n# LOCALIZATION NOTE(symbolSearch.searchModifier.regex): A search option\n# when searching text in a file\nsymbolSearch.searchModifier.regex=Regex\n\n# LOCALIZATION NOTE(symbolSearch.searchModifier.caseSensitive): A search option\n# when searching text in a file\nsymbolSearch.searchModifier.caseSensitive=Case sensitive\n\n# LOCALIZATION NOTE(symbolSearch.searchModifier.wholeWord): A search option\n# when searching text in a file\nsymbolSearch.searchModifier.wholeWord=Whole word\n\n# LOCALIZATION NOTE (resumptionOrderPanelTitle): This is the text that appears\n# as a description in the notification panel popup, when multiple debuggers are\n# open in separate tabs and the user tries to resume them in the wrong order.\n# The substitution parameter is the URL of the last paused window that must be\n# resumed first.\nresumptionOrderPanelTitle=There are one or more paused debuggers. Please resume the most-recently paused debugger first at: %S\n\nvariablesViewOptimizedOut=(optimized away)\nvariablesViewUninitialized=(uninitialized)\nvariablesViewMissingArgs=(unavailable)\n\nanonymousSourcesLabel=Anonymous sources\n\nexperimental=This is an experimental feature\n\n# LOCALIZATION NOTE (whyPaused.debuggerStatement): The text that is displayed\n# in a info block explaining how the debugger is currently paused due to a `debugger`\n# statement in the code\nwhyPaused.debuggerStatement=Paused on debugger statement\n\n# LOCALIZATION NOTE (whyPaused.breakpoint): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a breakpoint\nwhyPaused.breakpoint=Paused on breakpoint\n\n# LOCALIZATION NOTE (whyPaused.exception): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an exception\nwhyPaused.exception=Paused on exception\n\n# LOCALIZATION NOTE (whyPaused.resumeLimit): The text that is displayed\n# in a info block explaining how the debugger is currently paused while stepping\n# in or out of the stack\nwhyPaused.resumeLimit=Paused while stepping\n\n# LOCALIZATION NOTE (whyPaused.pauseOnDOMEvents): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a\n# dom event\nwhyPaused.pauseOnDOMEvents=Paused on event listener\n\n# LOCALIZATION NOTE (whyPaused.breakpointConditionThrown): The text that is displayed\n# in an info block when evaluating a conditional breakpoint throws an error\nwhyPaused.breakpointConditionThrown=Error with conditional breakpoint\n\n# LOCALIZATION NOTE (whyPaused.xhr): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an\n# xml http request\nwhyPaused.xhr=Paused on XMLHttpRequest\n\n# LOCALIZATION NOTE (whyPaused.promiseRejection): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a\n# promise rejection\nwhyPaused.promiseRejection=Paused on promise rejection\n\n# LOCALIZATION NOTE (whyPaused.assert): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an\n# assert\nwhyPaused.assert=Paused on assertion\n\n# LOCALIZATION NOTE (whyPaused.debugCommand): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a\n# debugger statement\nwhyPaused.debugCommand=Paused on debugged function\n\n# LOCALIZATION NOTE (whyPaused.other): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an event\n# listener breakpoint set\nwhyPaused.other=Debugger paused\n\n# LOCALIZATION NOTE (ctrl): The text that is used for documenting\n# keyboard shortcuts that use the control key\nctrl=Ctrl\n\n# LOCALIZATION NOTE (anonymous): The text that is displayed when the\n# display name is null.\nanonymous=(anonymous)\n\n# LOCALIZATION NOTE (shortcuts.toggleBreakpoint): text describing\n# keyboard shortcut action for toggling breakpoint\nshortcuts.toggleBreakpoint=Toggle Breakpoint\n\n# LOCALIZATION NOTE (shortcuts.toggleCondPanel): text describing\n# keyboard shortcut action for toggling conditional panel keyboard\nshortcuts.toggleCondPanel=Toggle Conditional Panel\n\n# LOCALIZATION NOTE (shortcuts.pauseOrResume): text describing\n# keyboard shortcut action for pause of resume\nshortcuts.pauseOrResume=Pause/Resume\n\n# LOCALIZATION NOTE (shortcuts.stepOver): text describing\n# keyboard shortcut action for stepping over\nshortcuts.stepOver=Step Over\n\n# LOCALIZATION NOTE (shortcuts.stepIn): text describing\n# keyboard shortcut action for stepping in\nshortcuts.stepIn=Step In\n\n# LOCALIZATION NOTE (shortcuts.stepOut): text describing\n# keyboard shortcut action for stepping out\nshortcuts.stepOut=Step Out\n\n# LOCALIZATION NOTE (shortcuts.fileSearch): text describing\n# keyboard shortcut action for source file search\nshortcuts.fileSearch=Source File Search\n\n# LOCALIZATION NOTE (shortcuts.searchAgain): text describing\n# keyboard shortcut action for searching again\nshortcuts.searchAgain=Search Again\n\n# LOCALIZATION NOTE (shortcuts.projectSearch): text describing\n# keyboard shortcut action for full project search\nshortcuts.projectSearch=Full Project Search\n\n# LOCALIZATION NOTE (shortcuts.functionSearch): text describing\n# keyboard shortcut action for function search\nshortcuts.functionSearch=Function Search\n" /***/ }), /* 961 */, /* 962 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 963 */, /* 964 */, /* 965 */ /***/ (function(module, exports) { /** * slice() reference. */ var slice = Array.prototype.slice; /** * Expose `co`. */ module.exports = co['default'] = co.co = co; /** * Wrap the given generator `fn` into a * function that returns a promise. * This is a separate function so that * every `co()` call doesn't create a new, * unnecessary closure. * * @param {GeneratorFunction} fn * @return {Function} * @api public */ co.wrap = function (fn) { createPromise.__generatorFunction__ = fn; return createPromise; function createPromise() { return co.call(this, fn.apply(this, arguments)); } }; /** * Execute the generator function or a generator * and return a promise. * * @param {Function} fn * @return {Promise} * @api public */ function co(gen) { var ctx = this; var args = slice.call(arguments, 1) // we wrap everything in a promise to avoid promise chaining, // which leads to memory leak errors. // see https://github.com/tj/co/issues/180 return new Promise(function(resolve, reject) { if (typeof gen === 'function') gen = gen.apply(ctx, args); if (!gen || typeof gen.next !== 'function') return resolve(gen); onFulfilled(); /** * @param {Mixed} res * @return {Promise} * @api private */ function onFulfilled(res) { var ret; try { ret = gen.next(res); } catch (e) { return reject(e); } next(ret); } /** * @param {Error} err * @return {Promise} * @api private */ function onRejected(err) { var ret; try { ret = gen.throw(err); } catch (e) { return reject(e); } next(ret); } /** * Get the next value in the generator, * return a promise. * * @param {Object} ret * @return {Promise} * @api private */ function next(ret) { if (ret.done) return resolve(ret.value); var value = toPromise.call(ctx, ret.value); if (value && isPromise(value)) return value.then(onFulfilled, onRejected); return onRejected(new TypeError('You may only yield a function, promise, generator, array, or object, ' + 'but the following object was passed: "' + String(ret.value) + '"')); } }); } /** * Convert a `yield`ed value into a promise. * * @param {Mixed} obj * @return {Promise} * @api private */ function toPromise(obj) { if (!obj) return obj; if (isPromise(obj)) return obj; if (isGeneratorFunction(obj) || isGenerator(obj)) return co.call(this, obj); if ('function' == typeof obj) return thunkToPromise.call(this, obj); if (Array.isArray(obj)) return arrayToPromise.call(this, obj); if (isObject(obj)) return objectToPromise.call(this, obj); return obj; } /** * Convert a thunk to a promise. * * @param {Function} * @return {Promise} * @api private */ function thunkToPromise(fn) { var ctx = this; return new Promise(function (resolve, reject) { fn.call(ctx, function (err, res) { if (err) return reject(err); if (arguments.length > 2) res = slice.call(arguments, 1); resolve(res); }); }); } /** * Convert an array of "yieldables" to a promise. * Uses `Promise.all()` internally. * * @param {Array} obj * @return {Promise} * @api private */ function arrayToPromise(obj) { return Promise.all(obj.map(toPromise, this)); } /** * Convert an object of "yieldables" to a promise. * Uses `Promise.all()` internally. * * @param {Object} obj * @return {Promise} * @api private */ function objectToPromise(obj){ var results = new obj.constructor(); var keys = Object.keys(obj); var promises = []; for (var i = 0; i < keys.length; i++) { var key = keys[i]; var promise = toPromise.call(this, obj[key]); if (promise && isPromise(promise)) defer(promise, key); else results[key] = obj[key]; } return Promise.all(promises).then(function () { return results; }); function defer(promise, key) { // predefine the key in the result results[key] = undefined; promises.push(promise.then(function (res) { results[key] = res; })); } } /** * Check if `obj` is a promise. * * @param {Object} obj * @return {Boolean} * @api private */ function isPromise(obj) { return 'function' == typeof obj.then; } /** * Check if `obj` is a generator. * * @param {Mixed} obj * @return {Boolean} * @api private */ function isGenerator(obj) { return 'function' == typeof obj.next && 'function' == typeof obj.throw; } /** * Check if `obj` is a generator function. * * @param {Mixed} obj * @return {Boolean} * @api private */ function isGeneratorFunction(obj) { var constructor = obj.constructor; if (!constructor) return false; if ('GeneratorFunction' === constructor.name || 'GeneratorFunction' === constructor.displayName) return true; return isGenerator(constructor.prototype); } /** * Check for plain object. * * @param {Mixed} val * @return {Boolean} * @api private */ function isObject(val) { return Object == val.constructor; } /***/ }), /* 966 */, /* 967 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var EventEmitter = __webpack_require__(968); function inToolbox() { return window.parent.document.documentURI == "about:devtools-toolbox"; } /** * A partial implementation of the Menu API provided by electron: * https://github.com/electron/electron/blob/master/docs/api/menu.md. * * Extra features: * - Emits an 'open' and 'close' event when the menu is opened/closed * @param String id (non standard) * Needed so tests can confirm the XUL implementation is working */ function Menu() { var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, _ref$id = _ref.id, id = _ref$id === undefined ? null : _ref$id; this.menuitems = []; this.id = id; Object.defineProperty(this, "items", { get() { return this.menuitems; } }); EventEmitter.decorate(this); } /** * Add an item to the end of the Menu * * @param {MenuItem} menuItem */ Menu.prototype.append = function (menuItem) { this.menuitems.push(menuItem); }; /** * Add an item to a specified position in the menu * * @param {int} pos * @param {MenuItem} menuItem */ Menu.prototype.insert = function (pos, menuItem) { throw Error("Not implemented"); }; /** * Show the Menu at a specified location on the screen * * Missing features: * - browserWindow - BrowserWindow (optional) - Default is null. * - positioningItem Number - (optional) OS X * * @param {int} screenX * @param {int} screenY * @param Toolbox toolbox (non standard) * Needed so we in which window to inject XUL */ Menu.prototype.popup = function (screenX, screenY, toolbox) { var doc = toolbox.doc; var popupset = doc.querySelector("popupset"); // See bug 1285229, on Windows, opening the same popup multiple times in a // row ends up duplicating the popup. The newly inserted popup doesn't // dismiss the old one. So remove any previously displayed popup before // opening a new one. var popup = popupset.querySelector("menupopup[menu-api=\"true\"]"); if (popup) { popup.hidePopup(); } popup = this.createPopup(doc); popup.setAttribute("menu-api", "true"); if (this.id) { popup.id = this.id; } this._createMenuItems(popup); // Remove the menu from the DOM once it's hidden. popup.addEventListener("popuphidden", e => { if (e.target === popup) { popup.remove(); this.emit("close", popup); } }); popup.addEventListener("popupshown", e => { if (e.target === popup) { this.emit("open", popup); } }); popupset.appendChild(popup); popup.openPopupAtScreen(screenX, screenY, true); }; Menu.prototype.createPopup = function (doc) { return doc.createElement("menupopup"); }; Menu.prototype._createMenuItems = function (parent) { var doc = parent.ownerDocument; this.menuitems.forEach(item => { if (!item.visible) { return; } if (item.submenu) { var menupopup = doc.createElement("menupopup"); item.submenu._createMenuItems(menupopup); var menuitem = doc.createElement("menuitem"); menuitem.setAttribute("label", item.label); if (!inToolbox()) { menuitem.textContent = item.label; } var menu = doc.createElement("menu"); menu.appendChild(menuitem); menu.appendChild(menupopup); if (item.disabled) { menu.setAttribute("disabled", "true"); } if (item.accesskey) { menu.setAttribute("accesskey", item.accesskey); } if (item.id) { menu.id = item.id; } parent.appendChild(menu); } else if (item.type === "separator") { var menusep = doc.createElement("menuseparator"); parent.appendChild(menusep); } else { var _menuitem = doc.createElement("menuitem"); _menuitem.setAttribute("label", item.label); if (!inToolbox()) { _menuitem.textContent = item.label; } _menuitem.addEventListener("command", () => item.click()); if (item.type === "checkbox") { _menuitem.setAttribute("type", "checkbox"); } if (item.type === "radio") { _menuitem.setAttribute("type", "radio"); } if (item.disabled) { _menuitem.setAttribute("disabled", "true"); } if (item.checked) { _menuitem.setAttribute("checked", "true"); } if (item.accesskey) { _menuitem.setAttribute("accesskey", item.accesskey); } if (item.id) { _menuitem.id = item.id; } parent.appendChild(_menuitem); } }); }; Menu.setApplicationMenu = () => { throw Error("Not implemented"); }; Menu.sendActionToFirstResponder = () => { throw Error("Not implemented"); }; Menu.buildFromTemplate = () => { throw Error("Not implemented"); }; module.exports = Menu; /***/ }), /* 968 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var EventEmitter = function EventEmitter() {}; module.exports = EventEmitter; var promise = __webpack_require__(969); /** * Decorate an object with event emitter functionality. * * @param Object aObjectToDecorate * Bind all public methods of EventEmitter to * the aObjectToDecorate object. */ EventEmitter.decorate = function EventEmitter_decorate(aObjectToDecorate) { var emitter = new EventEmitter(); aObjectToDecorate.on = emitter.on.bind(emitter); aObjectToDecorate.off = emitter.off.bind(emitter); aObjectToDecorate.once = emitter.once.bind(emitter); aObjectToDecorate.emit = emitter.emit.bind(emitter); }; EventEmitter.prototype = { /** * Connect a listener. * * @param string aEvent * The event name to which we're connecting. * @param function aListener * Called when the event is fired. */ on: function EventEmitter_on(aEvent, aListener) { if (!this._eventEmitterListeners) this._eventEmitterListeners = new Map(); if (!this._eventEmitterListeners.has(aEvent)) { this._eventEmitterListeners.set(aEvent, []); } this._eventEmitterListeners.get(aEvent).push(aListener); }, /** * Listen for the next time an event is fired. * * @param string aEvent * The event name to which we're connecting. * @param function aListener * (Optional) Called when the event is fired. Will be called at most * one time. * @return promise * A promise which is resolved when the event next happens. The * resolution value of the promise is the first event argument. If * you need access to second or subsequent event arguments (it's rare * that this is needed) then use aListener */ once: function EventEmitter_once(aEvent, aListener) { var _this = this; var deferred = promise.defer(); var handler = function (aEvent, aFirstArg) { for (var _len = arguments.length, aRest = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { aRest[_key - 2] = arguments[_key]; } _this.off(aEvent, handler); if (aListener) { aListener.apply(null, [aEvent, aFirstArg].concat(aRest)); } deferred.resolve(aFirstArg); }; handler._originalListener = aListener; this.on(aEvent, handler); return deferred.promise; }, /** * Remove a previously-registered event listener. Works for events * registered with either on or once. * * @param string aEvent * The event name whose listener we're disconnecting. * @param function aListener * The listener to remove. */ off: function EventEmitter_off(aEvent, aListener) { if (!this._eventEmitterListeners) return; var listeners = this._eventEmitterListeners.get(aEvent); if (listeners) { this._eventEmitterListeners.set(aEvent, listeners.filter(l => { return l !== aListener && l._originalListener !== aListener; })); } }, /** * Emit an event. All arguments to this method will * be sent to listener functions. */ emit: function EventEmitter_emit(aEvent) { var _this2 = this, _arguments = arguments; if (!this._eventEmitterListeners || !this._eventEmitterListeners.has(aEvent)) { return; } var originalListeners = this._eventEmitterListeners.get(aEvent); var _loop = function (listener) { // If the object was destroyed during event emission, stop // emitting. if (!_this2._eventEmitterListeners) { return "break"; } // If listeners were removed during emission, make sure the // event handler we're going to fire wasn't removed. if (originalListeners === _this2._eventEmitterListeners.get(aEvent) || _this2._eventEmitterListeners.get(aEvent).some(l => l === listener)) { try { listener.apply(null, _arguments); } catch (ex) { // Prevent a bad listener from interfering with the others. var msg = ex + ": " + ex.stack; //console.error(msg); console.log(msg); } } }; for (var listener of this._eventEmitterListeners.get(aEvent)) { var _ret = _loop(listener); if (_ret === "break") break; } } }; /***/ }), /* 969 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* * A sham for https://dxr.mozilla.org/mozilla-central/source/toolkit/modules/Promise.jsm */ /** * Promise.jsm is mostly the Promise web API with a `defer` method. Just drop this in here, * and use the native web API (although building with webpack/babel, it may replace this * with it's own version if we want to target environments that do not have `Promise`. */ var p = typeof window != "undefined" ? window.Promise : Promise; p.defer = function defer() { var resolve, reject; var promise = new Promise(function () { resolve = arguments[0]; reject = arguments[1]; }); return { resolve: resolve, reject: reject, promise: promise }; }; module.exports = p; /***/ }), /* 970 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /** * A partial implementation of the MenuItem API provided by electron: * https://github.com/electron/electron/blob/master/docs/api/menu-item.md. * * Missing features: * - id String - Unique within a single menu. If defined then it can be used * as a reference to this item by the position attribute. * - role String - Define the action of the menu item; when specified the * click property will be ignored * - sublabel String * - accelerator Accelerator * - icon NativeImage * - position String - This field allows fine-grained definition of the * specific location within a given menu. * * Implemented features: * @param Object options * Function click * Will be called with click(menuItem, browserWindow) when the menu item * is clicked * String type * Can be normal, separator, submenu, checkbox or radio * String label * Boolean enabled * If false, the menu item will be greyed out and unclickable. * Boolean checked * Should only be specified for checkbox or radio type menu items. * Menu submenu * Should be specified for submenu type menu items. If submenu is specified, * the type: 'submenu' can be omitted. If the value is not a Menu then it * will be automatically converted to one using Menu.buildFromTemplate. * Boolean visible * If false, the menu item will be entirely hidden. */ function MenuItem() { var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, _ref$accesskey = _ref.accesskey, accesskey = _ref$accesskey === undefined ? null : _ref$accesskey, _ref$checked = _ref.checked, checked = _ref$checked === undefined ? false : _ref$checked, _ref$click = _ref.click, click = _ref$click === undefined ? () => {} : _ref$click, _ref$disabled = _ref.disabled, disabled = _ref$disabled === undefined ? false : _ref$disabled, _ref$label = _ref.label, label = _ref$label === undefined ? "" : _ref$label, _ref$id = _ref.id, id = _ref$id === undefined ? null : _ref$id, _ref$submenu = _ref.submenu, submenu = _ref$submenu === undefined ? null : _ref$submenu, _ref$type = _ref.type, type = _ref$type === undefined ? "normal" : _ref$type, _ref$visible = _ref.visible, visible = _ref$visible === undefined ? true : _ref$visible; this.accesskey = accesskey; this.checked = checked; this.click = click; this.disabled = disabled; this.id = id; this.label = label; this.submenu = submenu; this.type = type; this.visible = visible; } module.exports = MenuItem; /***/ }), /* 971 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var Services = __webpack_require__(22); var EventEmitter = __webpack_require__(968); /** * Shortcuts for lazily accessing and setting various preferences. * Usage: * let prefs = new Prefs("root.path.to.branch", { * myIntPref: ["Int", "leaf.path.to.my-int-pref"], * myCharPref: ["Char", "leaf.path.to.my-char-pref"], * myJsonPref: ["Json", "leaf.path.to.my-json-pref"], * myFloatPref: ["Float", "leaf.path.to.my-float-pref"] * ... * }); * * Get/set: * prefs.myCharPref = "foo"; * let aux = prefs.myCharPref; * * Observe: * prefs.registerObserver(); * prefs.on("pref-changed", (prefName, prefValue) => { * ... * }); * * @param string prefsRoot * The root path to the required preferences branch. * @param object prefsBlueprint * An object containing { accessorName: [prefType, prefName, prefDefault] } keys. */ function PrefsHelper() { var prefsRoot = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ""; var prefsBlueprint = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; EventEmitter.decorate(this); var cache = new Map(); for (var accessorName in prefsBlueprint) { var _prefsBlueprint$acces = _slicedToArray(prefsBlueprint[accessorName], 3), prefType = _prefsBlueprint$acces[0], prefName = _prefsBlueprint$acces[1], prefDefault = _prefsBlueprint$acces[2]; map(this, cache, accessorName, prefType, prefsRoot, prefName, prefDefault); } var observer = makeObserver(this, cache, prefsRoot, prefsBlueprint); this.registerObserver = () => observer.register(); this.unregisterObserver = () => observer.unregister(); } /** * Helper method for getting a pref value. * * @param Map cache * @param string prefType * @param string prefsRoot * @param string prefName * @return any */ function get(cache, prefType, prefsRoot, prefName) { var cachedPref = cache.get(prefName); if (cachedPref !== undefined) { return cachedPref; } var value = Services.prefs["get" + prefType + "Pref"]([prefsRoot, prefName].join(".")); cache.set(prefName, value); return value; } /** * Helper method for setting a pref value. * * @param Map cache * @param string prefType * @param string prefsRoot * @param string prefName * @param any value */ function set(cache, prefType, prefsRoot, prefName, value) { Services.prefs["set" + prefType + "Pref"]([prefsRoot, prefName].join("."), value); cache.set(prefName, value); } /** * Maps a property name to a pref, defining lazy getters and setters. * Supported types are "Bool", "Char", "Int", "Float" (sugar around "Char" * type and casting), and "Json" (which is basically just sugar for "Char" * using the standard JSON serializer). * * @param PrefsHelper self * @param Map cache * @param string accessorName * @param string prefType * @param string prefsRoot * @param string prefName * @param string prefDefault * @param array serializer [optional] */ function map(self, cache, accessorName, prefType, prefsRoot, prefName, prefDefault) { var serializer = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : { in: e => e, out: e => e }; if (prefName in self) { throw new Error(`Can't use ${prefName} because it overrides a property` + "on the instance."); } if (prefType == "Json") { map(self, cache, accessorName, "String", prefsRoot, prefName, prefDefault, { in: JSON.parse, out: JSON.stringify }); return; } if (prefType == "Float") { map(self, cache, accessorName, "Char", prefsRoot, prefName, prefDefault, { in: Number.parseFloat, out: n => n + "" }); return; } Object.defineProperty(self, accessorName, { get: () => { try { return serializer.in(get(cache, prefType, prefsRoot, prefName)); } catch (e) { if (typeof prefDefault !== 'undefined') { return prefDefault; } throw e; } }, set: e => set(cache, prefType, prefsRoot, prefName, serializer.out(e)) }); } /** * Finds the accessor for the provided pref, based on the blueprint object * used in the constructor. * * @param PrefsHelper self * @param object prefsBlueprint * @return string */ function accessorNameForPref(somePrefName, prefsBlueprint) { for (var accessorName in prefsBlueprint) { var _prefsBlueprint$acces2 = _slicedToArray(prefsBlueprint[accessorName], 2), prefName = _prefsBlueprint$acces2[1]; if (somePrefName == prefName) { return accessorName; } } return ""; } /** * Creates a pref observer for `self`. * * @param PrefsHelper self * @param Map cache * @param string prefsRoot * @param object prefsBlueprint * @return object */ function makeObserver(self, cache, prefsRoot, prefsBlueprint) { return { register: function () { this._branch = Services.prefs.getBranch(prefsRoot + "."); this._branch.addObserver("", this); }, unregister: function () { this._branch.removeObserver("", this); }, observe: function (subject, topic, prefName) { // If this particular pref isn't handled by the blueprint object, // even though it's in the specified branch, ignore it. var accessorName = accessorNameForPref(prefName, prefsBlueprint); if (!(accessorName in self)) { return; } cache.delete(prefName); self.emit("pref-changed", accessorName, self[accessorName]); } }; } exports.PrefsHelper = PrefsHelper; /***/ }), /* 972 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var _require = __webpack_require__(22), appinfo = _require.appinfo; var EventEmitter = __webpack_require__(968); var isOSX = appinfo.OS === "Darwin"; // List of electron keys mapped to DOM API (DOM_VK_*) key code var ElectronKeysMapping = { "F1": "DOM_VK_F1", "F2": "DOM_VK_F2", "F3": "DOM_VK_F3", "F4": "DOM_VK_F4", "F5": "DOM_VK_F5", "F6": "DOM_VK_F6", "F7": "DOM_VK_F7", "F8": "DOM_VK_F8", "F9": "DOM_VK_F9", "F10": "DOM_VK_F10", "F11": "DOM_VK_F11", "F12": "DOM_VK_F12", "F13": "DOM_VK_F13", "F14": "DOM_VK_F14", "F15": "DOM_VK_F15", "F16": "DOM_VK_F16", "F17": "DOM_VK_F17", "F18": "DOM_VK_F18", "F19": "DOM_VK_F19", "F20": "DOM_VK_F20", "F21": "DOM_VK_F21", "F22": "DOM_VK_F22", "F23": "DOM_VK_F23", "F24": "DOM_VK_F24", "Space": "DOM_VK_SPACE", "Backspace": "DOM_VK_BACK_SPACE", "Delete": "DOM_VK_DELETE", "Insert": "DOM_VK_INSERT", "Return": "DOM_VK_RETURN", "Enter": "DOM_VK_RETURN", "Up": "DOM_VK_UP", "Down": "DOM_VK_DOWN", "Left": "DOM_VK_LEFT", "Right": "DOM_VK_RIGHT", "Home": "DOM_VK_HOME", "End": "DOM_VK_END", "PageUp": "DOM_VK_PAGE_UP", "PageDown": "DOM_VK_PAGE_DOWN", "Escape": "DOM_VK_ESCAPE", "Esc": "DOM_VK_ESCAPE", "Tab": "DOM_VK_TAB", "VolumeUp": "DOM_VK_VOLUME_UP", "VolumeDown": "DOM_VK_VOLUME_DOWN", "VolumeMute": "DOM_VK_VOLUME_MUTE", "PrintScreen": "DOM_VK_PRINTSCREEN" }; /** * Helper to listen for keyboard events decribed in .properties file. * * let shortcuts = new KeyShortcuts({ * window * }); * shortcuts.on("Ctrl+F", event => { * // `event` is the KeyboardEvent which relates to the key shortcuts * }); * * @param DOMWindow window * The window object of the document to listen events from. * @param DOMElement target * Optional DOM Element on which we should listen events from. * If omitted, we listen for all events fired on `window`. */ function KeyShortcuts(_ref) { var window = _ref.window, target = _ref.target; this.window = window; this.target = target || window; this.keys = new Map(); this.eventEmitter = new EventEmitter(); this.target.addEventListener("keydown", this); } /* * Parse an electron-like key string and return a normalized object which * allow efficient match on DOM key event. The normalized object matches DOM * API. * * @param DOMWindow window * Any DOM Window object, just to fetch its `KeyboardEvent` object * @param String str * The shortcut string to parse, following this document: * https://github.com/electron/electron/blob/master/docs/api/accelerator.md */ KeyShortcuts.parseElectronKey = function (window, str) { var modifiers = str.split("+"); var key = modifiers.pop(); var shortcut = { ctrl: false, meta: false, alt: false, shift: false, // Set for character keys key: undefined, // Set for non-character keys keyCode: undefined }; for (var mod of modifiers) { if (mod === "Alt") { shortcut.alt = true; } else if (["Command", "Cmd"].includes(mod)) { shortcut.meta = true; } else if (["CommandOrControl", "CmdOrCtrl"].includes(mod)) { if (isOSX) { shortcut.meta = true; } else { shortcut.ctrl = true; } } else if (["Control", "Ctrl"].includes(mod)) { shortcut.ctrl = true; } else if (mod === "Shift") { shortcut.shift = true; } else { console.error("Unsupported modifier:", mod, "from key:", str); return null; } } // Plus is a special case. It's a character key and shouldn't be matched // against a keycode as it is only accessible via Shift/Capslock if (key === "Plus") { key = "+"; } if (typeof key === "string" && key.length === 1) { // Match any single character shortcut.key = key.toLowerCase(); } else if (key in ElectronKeysMapping) { // Maps the others manually to DOM API DOM_VK_* key = ElectronKeysMapping[key]; shortcut.keyCode = window.KeyboardEvent[key]; // Used only to stringify the shortcut shortcut.keyCodeString = key; shortcut.key = key; } else { console.error("Unsupported key:", key); return null; } return shortcut; }; KeyShortcuts.stringify = function (shortcut) { var list = []; if (shortcut.alt) { list.push("Alt"); } if (shortcut.ctrl) { list.push("Ctrl"); } if (shortcut.meta) { list.push("Cmd"); } if (shortcut.shift) { list.push("Shift"); } var key = void 0; if (shortcut.key) { key = shortcut.key.toUpperCase(); } else { key = shortcut.keyCodeString; } list.push(key); return list.join("+"); }; KeyShortcuts.prototype = { destroy() { this.target.removeEventListener("keydown", this); this.keys.clear(); }, doesEventMatchShortcut(event, shortcut) { if (shortcut.meta != event.metaKey) { return false; } if (shortcut.ctrl != event.ctrlKey) { return false; } if (shortcut.alt != event.altKey) { return false; } // Shift is a special modifier, it may implicitely be required if the // expected key is a special character accessible via shift. if (shortcut.shift != event.shiftKey && event.key && event.key.match(/[a-zA-Z]/)) { return false; } if (shortcut.keyCode) { return event.keyCode == shortcut.keyCode; } else if (event.key in ElectronKeysMapping) { return ElectronKeysMapping[event.key] === shortcut.key; } // get the key from the keyCode if key is not provided. var key = event.key || String.fromCharCode(event.keyCode); // For character keys, we match if the final character is the expected one. // But for digits we also accept indirect match to please azerty keyboard, // which requires Shift to be pressed to get digits. return key.toLowerCase() == shortcut.key || shortcut.key.match(/^[0-9]$/) && event.keyCode == shortcut.key.charCodeAt(0); }, handleEvent(event) { for (var _ref2 of this.keys) { var _ref3 = _slicedToArray(_ref2, 2); var key = _ref3[0]; var shortcut = _ref3[1]; if (this.doesEventMatchShortcut(event, shortcut)) { this.eventEmitter.emit(key, event); } } }, on(key, listener) { if (typeof listener !== "function") { throw new Error("KeyShortcuts.on() expects a function as " + "second argument"); } if (!this.keys.has(key)) { var shortcut = KeyShortcuts.parseElectronKey(this.window, key); // The key string is wrong and we were unable to compute the key shortcut if (!shortcut) { return; } this.keys.set(key, shortcut); } this.eventEmitter.on(key, listener); }, off(key, listener) { this.eventEmitter.off(key, listener); } }; module.exports = KeyShortcuts; /***/ }), /* 973 */, /* 974 */, /* 975 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __WEBPACK_AMD_DEFINE_RESULT__; /* globals window, exports, define */ (function (window) { 'use strict'; var re = { not_string: /[^s]/, not_bool: /[^t]/, not_type: /[^T]/, not_primitive: /[^v]/, number: /[diefg]/, numeric_arg: /bcdiefguxX/, json: /[j]/, not_json: /[^j]/, text: /^[^\x25]+/, modulo: /^\x25{2}/, placeholder: /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosStTuvxX])/, key: /^([a-z_][a-z_\d]*)/i, key_access: /^\.([a-z_][a-z_\d]*)/i, index_access: /^\[(\d+)\]/, sign: /^[\+\-]/ }; function sprintf() { var key = arguments[0], cache = sprintf.cache; if (!(cache[key] && cache.hasOwnProperty(key))) { cache[key] = sprintf.parse(key); } return sprintf.format.call(null, cache[key], arguments); } sprintf.format = function (parse_tree, argv) { var cursor = 1, tree_length = parse_tree.length, node_type = '', arg, output = [], i, k, match, pad, pad_character, pad_length, is_positive = true, sign = ''; for (i = 0; i < tree_length; i++) { node_type = get_type(parse_tree[i]); if (node_type === 'string') { output[output.length] = parse_tree[i]; } else if (node_type === 'array') { match = parse_tree[i]; // convenience purposes only if (match[2]) { // keyword argument arg = argv[cursor]; for (k = 0; k < match[2].length; k++) { if (!arg.hasOwnProperty(match[2][k])) { throw new Error(sprintf('[sprintf] property "%s" does not exist', match[2][k])); } arg = arg[match[2][k]]; } } else if (match[1]) { // positional argument (explicit) arg = argv[match[1]]; } else { // positional argument (implicit) arg = argv[cursor++]; } if (re.not_type.test(match[8]) && re.not_primitive.test(match[8]) && get_type(arg) == 'function') { arg = arg(); } if (re.numeric_arg.test(match[8]) && get_type(arg) != 'number' && isNaN(arg)) { throw new TypeError(sprintf("[sprintf] expecting number but found %s", get_type(arg))); } if (re.number.test(match[8])) { is_positive = arg >= 0; } switch (match[8]) { case 'b': arg = parseInt(arg, 10).toString(2); break; case 'c': arg = String.fromCharCode(parseInt(arg, 10)); break; case 'd': case 'i': arg = parseInt(arg, 10); break; case 'j': arg = JSON.stringify(arg, null, match[6] ? parseInt(match[6]) : 0); break; case 'e': arg = match[7] ? parseFloat(arg).toExponential(match[7]) : parseFloat(arg).toExponential(); break; case 'f': arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg); break; case 'g': arg = match[7] ? parseFloat(arg).toPrecision(match[7]) : parseFloat(arg); break; case 'o': arg = arg.toString(8); break; case 's': case 'S': arg = String(arg); arg = match[7] ? arg.substring(0, match[7]) : arg; break; case 't': arg = String(!!arg); arg = match[7] ? arg.substring(0, match[7]) : arg; break; case 'T': arg = get_type(arg); arg = match[7] ? arg.substring(0, match[7]) : arg; break; case 'u': arg = parseInt(arg, 10) >>> 0; break; case 'v': arg = arg.valueOf(); arg = match[7] ? arg.substring(0, match[7]) : arg; break; case 'x': arg = parseInt(arg, 10).toString(16); break; case 'X': arg = parseInt(arg, 10).toString(16).toUpperCase(); break; } if (re.json.test(match[8])) { output[output.length] = arg; } else { if (re.number.test(match[8]) && (!is_positive || match[3])) { sign = is_positive ? '+' : '-'; arg = arg.toString().replace(re.sign, ''); } else { sign = ''; } pad_character = match[4] ? match[4] === '0' ? '0' : match[4].charAt(1) : ' '; pad_length = match[6] - (sign + arg).length; pad = match[6] ? pad_length > 0 ? str_repeat(pad_character, pad_length) : '' : ''; output[output.length] = match[5] ? sign + arg + pad : pad_character === '0' ? sign + pad + arg : pad + sign + arg; } } } return output.join(''); }; sprintf.cache = {}; sprintf.parse = function (fmt) { var _fmt = fmt, match = [], parse_tree = [], arg_names = 0; while (_fmt) { if ((match = re.text.exec(_fmt)) !== null) { parse_tree[parse_tree.length] = match[0]; } else if ((match = re.modulo.exec(_fmt)) !== null) { parse_tree[parse_tree.length] = '%'; } else if ((match = re.placeholder.exec(_fmt)) !== null) { if (match[2]) { arg_names |= 1; var field_list = [], replacement_field = match[2], field_match = []; if ((field_match = re.key.exec(replacement_field)) !== null) { field_list[field_list.length] = field_match[1]; while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') { if ((field_match = re.key_access.exec(replacement_field)) !== null) { field_list[field_list.length] = field_match[1]; } else if ((field_match = re.index_access.exec(replacement_field)) !== null) { field_list[field_list.length] = field_match[1]; } else { throw new SyntaxError("[sprintf] failed to parse named argument key"); } } } else { throw new SyntaxError("[sprintf] failed to parse named argument key"); } match[2] = field_list; } else { arg_names |= 2; } if (arg_names === 3) { throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported"); } parse_tree[parse_tree.length] = match; } else { throw new SyntaxError("[sprintf] unexpected placeholder"); } _fmt = _fmt.substring(match[0].length); } return parse_tree; }; var vsprintf = function (fmt, argv, _argv) { _argv = (argv || []).slice(0); _argv.splice(0, 0, fmt); return sprintf.apply(null, _argv); }; /** * helpers */ function get_type(variable) { if (typeof variable === 'number') { return 'number'; } else if (typeof variable === 'string') { return 'string'; } else { return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase(); } } var preformattedPadding = { '0': ['', '0', '00', '000', '0000', '00000', '000000', '0000000'], ' ': ['', ' ', ' ', ' ', ' ', ' ', ' ', ' '], '_': ['', '_', '__', '___', '____', '_____', '______', '_______'] }; function str_repeat(input, multiplier) { if (multiplier >= 0 && multiplier <= 7 && preformattedPadding[input]) { return preformattedPadding[input][multiplier]; } return Array(multiplier + 1).join(input); } /** * export to either browser or node.js */ if (true) { exports.sprintf = sprintf; exports.vsprintf = vsprintf; } if (typeof window !== 'undefined') { window.sprintf = sprintf; window.vsprintf = vsprintf; if (true) { !(__WEBPACK_AMD_DEFINE_RESULT__ = function () { return { sprintf: sprintf, vsprintf: vsprintf }; }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } } })(typeof window === 'undefined' ? undefined : window); /***/ }), /* 976 */, /* 977 */, /* 978 */, /* 979 */, /* 980 */, /* 981 */, /* 982 */, /* 983 */, /* 984 */, /* 985 */, /* 986 */, /* 987 */, /* 988 */, /* 989 */, /* 990 */, /* 991 */, /* 992 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.timing = timing; /** * Redux middleware that sets performance markers for all actions such that they * will appear in performance tooling under the User Timing API */ var mark = window.performance && window.performance.mark ? window.performance.mark.bind(window.performance) : () => {}; var measure = window.performance && window.performance.measure ? window.performance.measure.bind(window.performance) : () => {}; function timing(store) { return next => action => { mark(`${action.type}_start`); var result = next(action); mark(`${action.type}_end`); measure(`${action.type}`, `${action.type}_start`, `${action.type}_end`); return result; }; } /***/ }), /* 993 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.defaultMemoize = defaultMemoize; exports.createSelectorCreator = createSelectorCreator; exports.createStructuredSelector = createStructuredSelector; function defaultEqualityCheck(a, b) { return a === b; } function areArgumentsShallowlyEqual(equalityCheck, prev, next) { if (prev === null || next === null || prev.length !== next.length) { return false; } // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible. var length = prev.length; for (var i = 0; i < length; i++) { if (!equalityCheck(prev[i], next[i])) { return false; } } return true; } function defaultMemoize(func) { var equalityCheck = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultEqualityCheck; var lastArgs = null; var lastResult = null; // we reference arguments instead of spreading them for performance reasons return function () { if (!areArgumentsShallowlyEqual(equalityCheck, lastArgs, arguments)) { // apply arguments instead of spreading for performance. lastResult = func.apply(null, arguments); } lastArgs = arguments; return lastResult; }; } function getDependencies(funcs) { var dependencies = Array.isArray(funcs[0]) ? funcs[0] : funcs; if (!dependencies.every(function (dep) { return typeof dep === 'function'; })) { var dependencyTypes = dependencies.map(function (dep) { return typeof dep; }).join(', '); throw new Error('Selector creators expect all input-selectors to be functions, ' + ('instead received the following types: [' + dependencyTypes + ']')); } return dependencies; } function createSelectorCreator(memoize) { for (var _len = arguments.length, memoizeOptions = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { memoizeOptions[_key - 1] = arguments[_key]; } return function () { for (var _len2 = arguments.length, funcs = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { funcs[_key2] = arguments[_key2]; } var recomputations = 0; var resultFunc = funcs.pop(); var dependencies = getDependencies(funcs); var memoizedResultFunc = memoize.apply(undefined, [function () { recomputations++; // apply arguments instead of spreading for performance. return resultFunc.apply(null, arguments); }].concat(memoizeOptions)); // If a selector is called with the exact same arguments we don't need to traverse our dependencies again. var selector = defaultMemoize(function () { var params = []; var length = dependencies.length; for (var i = 0; i < length; i++) { // apply arguments instead of spreading and mutate a local list of params for performance. params.push(dependencies[i].apply(null, arguments)); } // apply arguments instead of spreading for performance. return memoizedResultFunc.apply(null, params); }); selector.resultFunc = resultFunc; selector.recomputations = function () { return recomputations; }; selector.resetRecomputations = function () { return recomputations = 0; }; return selector; }; } var createSelector = exports.createSelector = createSelectorCreator(defaultMemoize); function createStructuredSelector(selectors) { var selectorCreator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : createSelector; if (typeof selectors !== 'object') { throw new Error('createStructuredSelector expects first argument to be an object ' + ('where each property is a selector, instead received a ' + typeof selectors)); } var objectKeys = Object.keys(selectors); return selectorCreator(objectKeys.map(function (key) { return selectors[key]; }), function () { for (var _len3 = arguments.length, values = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { values[_key3] = arguments[_key3]; } return values.reduce(function (composition, value, index) { composition[objectKeys[index]] = value; return composition; }, {}); }); } /***/ }), /* 994 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var SourceEditor = __webpack_require__(197); var SourceEditorUtils = __webpack_require__(996); module.exports = { SourceEditor, SourceEditorUtils }; /***/ }), /* 995 */, /* 996 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ function forEachLine(codeMirror, iter) { codeMirror.operation(() => { codeMirror.doc.iter(0, codeMirror.lineCount(), iter); }); } function removeLineClass(codeMirror, line, className) { codeMirror.removeLineClass(line, "line", className); } function clearLineClass(codeMirror, className) { forEachLine(codeMirror, line => { removeLineClass(codeMirror, line, className); }); } function getTextForLine(codeMirror, line) { return codeMirror.getLine(line - 1).trim(); } function getCursorLine(codeMirror) { return codeMirror.getCursor().line; } function getTokenLocation(codeMirror, tokenEl) { var lineOffset = 1; var _tokenEl$getBoundingC = tokenEl.getBoundingClientRect(), left = _tokenEl$getBoundingC.left, top = _tokenEl$getBoundingC.top; var _codeMirror$coordsCha = codeMirror.coordsChar({ left, top }), line = _codeMirror$coordsCha.line, ch = _codeMirror$coordsCha.ch; return { line: line + lineOffset, column: ch }; } /** * Forces the breakpoint gutter to be the same size as the line * numbers gutter. Editor CSS will absolutely position the gutter * beneath the line numbers. This makes it easy to be flexible with * how we overlay breakpoints. */ function resizeBreakpointGutter(editor) { var gutters = editor.display.gutters; var lineNumbers = gutters.querySelector(".CodeMirror-linenumbers"); var breakpoints = gutters.querySelector(".breakpoints"); breakpoints.style.width = `${lineNumbers.clientWidth}px`; } module.exports = { removeLineClass, clearLineClass, getTextForLine, getCursorLine, getTokenLocation, resizeBreakpointGutter }; /***/ }), /* 997 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 998 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 999 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 1000 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 1001 */ /***/ (function(module, exports) { module.exports = "icon" /***/ }), /* 1002 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 1003 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 1004 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 1005 */, /* 1006 */, /* 1007 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var Tree = __webpack_require__(1008); module.exports = { Tree }; /***/ }), /* 1008 */ /***/ (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); } } /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var _require = __webpack_require__(0), 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 ${this.props.className ? this.props.className : ""}`, 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); }) }); /***/ }), /* 1009 */, /* 1010 */, /* 1011 */, /* 1012 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getAndProcessFrames = getAndProcessFrames; var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _redux = __webpack_require__(3); var _reactRedux = __webpack_require__(1189); var _reselect = __webpack_require__(993); var _lodash = __webpack_require__(2); var _Frame = __webpack_require__(1013); var _Frame2 = _interopRequireDefault(_Frame); var _Group2 = __webpack_require__(1015); var _Group3 = _interopRequireDefault(_Group2); var _WhyPaused = __webpack_require__(1120); var _WhyPaused2 = _interopRequireDefault(_WhyPaused); var _actions = __webpack_require__(244); var _actions2 = _interopRequireDefault(_actions); var _frame = __webpack_require__(1014); var _clipboard = __webpack_require__(423); var _selectors = __webpack_require__(242); __webpack_require__(914); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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); this.copyStackTrace = this.copyStackTrace.bind(this); this.toggleFrameworkGrouping = this.toggleFrameworkGrouping.bind(this); } shouldComponentUpdate(nextProps, nextState) { var _props = this.props, frames = _props.frames, selectedFrame = _props.selectedFrame, frameworkGroupingOn = _props.frameworkGroupingOn; var showAllFrames = this.state.showAllFrames; return frames !== nextProps.frames || selectedFrame !== nextProps.selectedFrame || showAllFrames !== nextState.showAllFrames || frameworkGroupingOn !== nextProps.frameworkGroupingOn; } toggleFramesDisplay() { this.setState({ showAllFrames: !this.state.showAllFrames }); } collapseFrames(frames) { var frameworkGroupingOn = this.props.frameworkGroupingOn; if (!frameworkGroupingOn) { return frames; } return (0, _frame.collapseFrames)(frames); } truncateFrames(frames) { var numFramesToShow = this.state.showAllFrames ? frames.length : NUM_FRAMES_SHOWN; return frames.slice(0, numFramesToShow); } copyStackTrace() { var frames = this.props.frames; var framesToCopy = frames.map(f => (0, _frame.formatCopyName)(f)).join("\n"); (0, _clipboard.copyToTheClipboard)(framesToCopy); } toggleFrameworkGrouping() { var _props2 = this.props, toggleFrameworkGrouping = _props2.toggleFrameworkGrouping, frameworkGroupingOn = _props2.frameworkGroupingOn; toggleFrameworkGrouping(!frameworkGroupingOn); } renderFrames(frames) { var _props3 = this.props, selectFrame = _props3.selectFrame, selectedFrame = _props3.selectedFrame, toggleBlackBox = _props3.toggleBlackBox, frameworkGroupingOn = _props3.frameworkGroupingOn; var framesOrGroups = this.truncateFrames(this.collapseFrames(frames)); return _react2.default.createElement( "ul", null, framesOrGroups.map(frameOrGroup => frameOrGroup.id ? FrameComponent({ frame: frameOrGroup, toggleFrameworkGrouping: this.toggleFrameworkGrouping, copyStackTrace: this.copyStackTrace, frameworkGroupingOn, selectFrame, selectedFrame, toggleBlackBox, key: frameOrGroup.id }) : Group({ group: frameOrGroup, toggleFrameworkGrouping: this.toggleFrameworkGrouping, copyStackTrace: this.copyStackTrace, frameworkGroupingOn, selectFrame, selectedFrame, toggleBlackBox, key: frameOrGroup[0].id })) ); } renderToggleButton(frames) { var buttonMessage = this.state.showAllFrames ? L10N.getStr("callStack.collapse") : L10N.getStr("callStack.expand"); frames = this.collapseFrames(frames); if (frames.length <= NUM_FRAMES_SHOWN) { return null; } return _react2.default.createElement( "div", { className: "show-more", onClick: this.toggleFramesDisplay }, buttonMessage ); } render() { var _props4 = this.props, frames = _props4.frames, pause = _props4.pause; if (!frames) { return _react2.default.createElement( "div", { className: "pane frames" }, _react2.default.createElement( "div", { className: "pane-info empty" }, L10N.getStr("callStack.notPaused") ) ); } return _react2.default.createElement( "div", { className: "pane frames" }, this.renderFrames(frames), (0, _WhyPaused2.default)({ pause }), this.renderToggleButton(frames) ); } } Frames.propTypes = { frames: _react.PropTypes.array, frameworkGroupingOn: _react.PropTypes.bool.isRequired, toggleFrameworkGrouping: _react.PropTypes.func.isRequired, selectedFrame: _react.PropTypes.object, selectFrame: _react.PropTypes.func.isRequired, toggleBlackBox: _react.PropTypes.func, pause: _react.PropTypes.object }; function getSourceForFrame(sources, frame) { return (0, _selectors.getSourceInSources)(sources, frame.location.sourceId); } function appendSource(sources, frame) { return Object.assign({}, frame, { source: getSourceForFrame(sources, frame).toJS() }); } function getAndProcessFrames(frames, sources) { if (!frames) { return null; } var processedFrames = frames.filter(frame => getSourceForFrame(sources, frame)).map(frame => appendSource(sources, frame)).filter(frame => !(0, _lodash.get)(frame, "source.isBlackBoxed")).map(_frame.annotateFrame); return processedFrames; } var getAndProcessFramesSelector = (0, _reselect.createSelector)(_selectors.getFrames, _selectors.getSources, getAndProcessFrames); exports.default = (0, _reactRedux.connect)(state => ({ frames: getAndProcessFramesSelector(state), frameworkGroupingOn: (0, _selectors.getFrameworkGroupingState)(state), selectedFrame: (0, _selectors.getSelectedFrame)(state), pause: (0, _selectors.getPause)(state) }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Frames); /***/ }), /* 1013 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _Svg = __webpack_require__(344); var _Svg2 = _interopRequireDefault(_Svg); var _frame = __webpack_require__(1014); var _source = __webpack_require__(233); var _FrameMenu = __webpack_require__(1032); var _FrameMenu2 = _interopRequireDefault(_FrameMenu); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function FrameTitle(_ref) { var frame = _ref.frame, options = _ref.options; var displayName = (0, _frame.formatDisplayName)(frame, options); return _react2.default.createElement( "div", { className: "title" }, displayName ); } function FrameLocation(_ref2) { var frame = _ref2.frame; if (!frame.source) { return; } if (frame.library) { return _react2.default.createElement( "div", { className: "location" }, frame.library, _react2.default.createElement(_Svg2.default, { name: frame.library.toLowerCase(), className: "annotation-logo" }) ); } var filename = (0, _source.getFilename)(frame.source); return _react2.default.createElement( "div", { className: "location" }, `${filename}: ${frame.location.line}` ); } FrameLocation.displayName = "FrameLocation"; class FrameComponent extends _react.Component { constructor() { super(); } onContextMenu(event) { var _props = this.props, frame = _props.frame, copyStackTrace = _props.copyStackTrace, toggleFrameworkGrouping = _props.toggleFrameworkGrouping, toggleBlackBox = _props.toggleBlackBox, frameworkGroupingOn = _props.frameworkGroupingOn; (0, _FrameMenu2.default)(frame, frameworkGroupingOn, { copyStackTrace, toggleFrameworkGrouping, toggleBlackBox }, event); } 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 _props2 = this.props, frame = _props2.frame, selectedFrame = _props2.selectedFrame, hideLocation = _props2.hideLocation, shouldMapDisplayName = _props2.shouldMapDisplayName; var className = (0, _classnames2.default)("frame", { selected: selectedFrame && selectedFrame.id === frame.id }); return _react2.default.createElement( "li", { key: frame.id, className: className, onMouseDown: e => this.onMouseDown(e, frame, selectedFrame), onKeyUp: e => this.onKeyUp(e, frame, selectedFrame), onContextMenu: e => this.onContextMenu(e), tabIndex: 0 }, _react2.default.createElement(FrameTitle, { frame: frame, options: { shouldMapDisplayName } }), !hideLocation && _react2.default.createElement(FrameLocation, { frame: frame }) ); } } exports.default = FrameComponent; FrameComponent.defaultProps = { hideLocation: false, shouldMapDisplayName: true }; FrameComponent.displayName = "Frame"; /***/ }), /* 1014 */ /***/ (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 _lodash = __webpack_require__(2); var _devtoolsConfig = __webpack_require__(828); var _utils = __webpack_require__(234); var _source = __webpack_require__(233); function getFrameUrl(frame) { return (0, _lodash.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 isImmutable(frame) { return getFrameUrl(frame).match(/immutable/i); } function isWebpack(frame) { return getFrameUrl(frame).match(/webpack\/bootstrap/i); } function isNodeInternal(frame) { // starts with "internal/" OR no path, just "timers.js", "url.js" etc // (normally frameUrl will be a FQ pathname) return (/(^internal\/|^[^.\/]+\.js)/.test(getFrameUrl(frame)) ); } function isExpress(frame) { return (/node_modules\/express/.test(getFrameUrl(frame)) ); } function isPug(frame) { return (/node_modules\/pug/.test(getFrameUrl(frame)) ); } function isExtJs(frame) { return (/\/ext-all[\.\-]/.test(getFrameUrl(frame)) ); } function isUnderscore(frame) { return getFrameUrl(frame).match(/underscore/i); } function isLodash(frame) { return getFrameUrl(frame).match(/lodash/i); } function isEmber(frame) { return getFrameUrl(frame).match(/ember/i); } function isVueJS(frame) { return getFrameUrl(frame).match(/vue\.js/i); } function isRxJs(frame) { return getFrameUrl(frame).match(/rxjs/i); } function isAngular(frame) { return getFrameUrl(frame).match(/angular/i); } function isRedux(frame) { return getFrameUrl(frame).match(/redux/i); } function isDojo(frame) { return getFrameUrl(frame).match(/dojo/i); } function getLibraryFromUrl(frame) { // @TODO each of these fns calls getFrameUrl, just call it once // (assuming there's not more complex logic to identify a lib) if (isBackbone(frame)) { return "Backbone"; } if (isJQuery(frame)) { return "jQuery"; } if (isReact(frame)) { return "React"; } if (isWebpack(frame)) { return "Webpack"; } if (isNodeInternal(frame)) { return "Node"; } if (isExpress(frame)) { return "Express"; } if (isPug(frame)) { return "Pug"; } if (isExtJs(frame)) { return "ExtJS"; } if (isUnderscore(frame)) { return "Underscore"; } if (isLodash(frame)) { return "Lodash"; } if (isEmber(frame)) { return "Ember"; } if (isVueJS(frame)) { return "VueJS"; } if (isRxJs(frame)) { return "RxJS"; } if (isAngular(frame)) { return "Angular"; } if (isRedux(frame)) { return "Redux"; } if (isDojo(frame)) { return "Dojo"; } if (isImmutable(frame)) { return "Immutable"; } } 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", _renderValidatedComponentWithoutOwnerOrContext: "Render" }, VueJS: { "renderMixin/Vue.prototype._render": "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 = (0, _lodash.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, _lodash.findIndex)(frames, isWebpack); if (index == -1) { return { newFrames: frames, lastGroup: [] }; } var newFrames = frames.slice(0, index); var lastGroup = frames.slice(index); return { newFrames, lastGroup }; } /***/ }), /* 1015 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _Svg = __webpack_require__(344); var _Svg2 = _interopRequireDefault(_Svg); var _frame = __webpack_require__(1014); var _FrameMenu = __webpack_require__(1032); var _FrameMenu2 = _interopRequireDefault(_FrameMenu); __webpack_require__(909); var _Frame = __webpack_require__(1013); var _Frame2 = _interopRequireDefault(_Frame); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var FrameComponent = (0, _react.createFactory)(_Frame2.default); function FrameLocation(_ref) { var frame = _ref.frame; var library = (0, _frame.getLibraryFromUrl)(frame); if (!library) { return null; } return _react2.default.createElement( "div", { className: "location" }, library, _react2.default.createElement(_Svg2.default, { name: library.toLowerCase(), className: "annotation-logo" }) ); } FrameLocation.displayName = "FrameLocation"; class Group extends _react.Component { constructor() { super(...arguments); this.state = { expanded: false }; var self = this; self.toggleFrames = this.toggleFrames.bind(this); } onContextMenu(event) { var _props = this.props, group = _props.group, copyStackTrace = _props.copyStackTrace, toggleFrameworkGrouping = _props.toggleFrameworkGrouping, toggleBlackBox = _props.toggleBlackBox, frameworkGroupingOn = _props.frameworkGroupingOn; var frame = group[0]; (0, _FrameMenu2.default)(frame, frameworkGroupingOn, { copyStackTrace, toggleFrameworkGrouping, toggleBlackBox }, event); } toggleFrames() { this.setState({ expanded: !this.state.expanded }); } renderFrames() { var _props2 = this.props, group = _props2.group, selectFrame = _props2.selectFrame, selectedFrame = _props2.selectedFrame, toggleFrameworkGrouping = _props2.toggleFrameworkGrouping, frameworkGroupingOn = _props2.frameworkGroupingOn, toggleBlackBox = _props2.toggleBlackBox, copyStackTrace = _props2.copyStackTrace; var expanded = this.state.expanded; if (!expanded) { return null; } return _react2.default.createElement( "div", { className: "frames-list" }, group.map(frame => FrameComponent({ frame, copyStackTrace, toggleFrameworkGrouping, frameworkGroupingOn, selectFrame, selectedFrame, toggleBlackBox, key: frame.id, hideLocation: true, shouldMapDisplayName: false })) ); } renderDescription() { var frame = this.props.group[0]; var displayName = (0, _frame.formatDisplayName)(frame); return _react2.default.createElement( "li", { key: frame.id, className: (0, _classnames2.default)("group"), onClick: this.toggleFrames, tabIndex: 0 }, _react2.default.createElement( "div", { className: "title" }, displayName ), _react2.default.createElement(FrameLocation, { frame: frame }) ); } render() { var expanded = this.state.expanded; return _react2.default.createElement( "div", { className: (0, _classnames2.default)("frames-group", { expanded }), onContextMenu: e => this.onContextMenu(e) }, this.renderDescription(), this.renderFrames() ); } } exports.default = Group; Group.displayName = "Group"; /***/ }), /* 1016 */, /* 1017 */, /* 1018 */, /* 1019 */, /* 1020 */, /* 1021 */, /* 1022 */, /* 1023 */, /* 1024 */, /* 1025 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _lodash = __webpack_require__(2); class HighlightLines extends _react.Component { constructor() { super(); this.highlightLineRange = this.highlightLineRange.bind(this); } componentDidMount() { this.highlightLineRange(); } componentWillUpdate() { this.clearHighlightRange(); } componentDidUpdate() { this.highlightLineRange(); } componentWillUnmount() { this.clearHighlightRange(); } clearHighlightRange() { var _props = this.props, highlightedLineRange = _props.highlightedLineRange, editor = _props.editor; var codeMirror = editor.codeMirror; if ((0, _lodash.isEmpty)(highlightedLineRange) || !codeMirror) { return; } var start = highlightedLineRange.start, end = highlightedLineRange.end; codeMirror.operation(() => { (0, _lodash.range)(start - 1, end).forEach(line => { codeMirror.removeLineClass(line, "line", "highlight-lines"); }); }); } highlightLineRange() { var _props2 = this.props, highlightedLineRange = _props2.highlightedLineRange, editor = _props2.editor; var codeMirror = editor.codeMirror; if ((0, _lodash.isEmpty)(highlightedLineRange) || !codeMirror) { return; } var start = highlightedLineRange.start, end = highlightedLineRange.end; codeMirror.operation(() => { editor.alignLine(start); (0, _lodash.range)(start - 1, end).forEach(line => { codeMirror.addLineClass(line, "line", "highlight-lines"); }); }); } render() { return null; } } exports.default = HighlightLines; /***/ }), /* 1026 */, /* 1027 */, /* 1028 */, /* 1029 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); __webpack_require__(879); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var BracketArrow = (_ref) => { var orientation = _ref.orientation, left = _ref.left, top = _ref.top, bottom = _ref.bottom; return _react2.default.createElement("div", { className: (0, _classnames2.default)("bracket-arrow", orientation || "up"), style: { left, top, bottom } }); }; exports.default = BracketArrow; /***/ }), /* 1030 */, /* 1031 */, /* 1032 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = FrameMenu; var _devtoolsLaunchpad = __webpack_require__(131); var _clipboard = __webpack_require__(423); var _lodash = __webpack_require__(2); var blackboxString = "sourceFooter.blackbox"; var unblackboxString = "sourceFooter.unblackbox"; function formatMenuElement(labelString, click) { var disabled = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var label = L10N.getStr(labelString); var accesskey = L10N.getStr(`${labelString}.accesskey`); var id = `node-menu-${(0, _lodash.kebabCase)(label)}`; return { id, label, accesskey, disabled, click }; } function copySourceElement(url) { return formatMenuElement("copySourceUri2", () => (0, _clipboard.copyToTheClipboard)(url)); } function copyStackTraceElement(copyStackTrace) { return formatMenuElement("copyStackTrace", () => copyStackTrace()); } function toggleFrameworkGroupingElement(toggleFrameworkGrouping, frameworkGroupingOn) { var actionType = frameworkGroupingOn ? "framework.disableGrouping" : "framework.enableGrouping"; return formatMenuElement(actionType, () => toggleFrameworkGrouping()); } function blackBoxSource(source, toggleBlackBox) { var toggleBlackBoxString = source.isBlackBoxed ? unblackboxString : blackboxString; return formatMenuElement(toggleBlackBoxString, () => toggleBlackBox(source)); } function FrameMenu(frame, frameworkGroupingOn, callbacks, event) { event.stopPropagation(); event.preventDefault(); var menuOptions = []; var source = frame.source; var toggleFrameworkElement = toggleFrameworkGroupingElement(callbacks.toggleFrameworkGrouping, frameworkGroupingOn); menuOptions.push(toggleFrameworkElement); if (source) { var copySourceUri2 = copySourceElement(source.url); menuOptions.push(copySourceUri2); menuOptions.push(blackBoxSource(source, callbacks.toggleBlackBox)); } var copyStackTraceItem = copyStackTraceElement(callbacks.copyStackTrace); menuOptions.push(copyStackTraceItem); (0, _devtoolsLaunchpad.showMenu)(event, menuOptions); } /***/ }), /* 1033 */, /* 1034 */, /* 1035 */, /* 1036 */, /* 1037 */, /* 1038 */, /* 1039 */, /* 1040 */, /* 1041 */, /* 1042 */, /* 1043 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 1044 */ /***/ (function(module, exports) { module.exports = "Created with Sketch." /***/ }), /* 1045 */ /***/ (function(module, exports) { module.exports = "Created with Sketch." /***/ }), /* 1046 */, /* 1047 */, /* 1048 */, /* 1049 */, /* 1050 */, /* 1051 */, /* 1052 */, /* 1053 */, /* 1054 */, /* 1055 */, /* 1056 */, /* 1057 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.findScopeByName = exports.getASTLocation = undefined; var _astBreakpointLocation = __webpack_require__(804); Object.defineProperty(exports, "getASTLocation", { enumerable: true, get: function () { return _astBreakpointLocation.getASTLocation; } }); Object.defineProperty(exports, "findScopeByName", { enumerable: true, get: function () { return _astBreakpointLocation.findScopeByName; } }); exports.firstString = firstString; exports.locationMoved = locationMoved; exports.makeLocationId = makeLocationId; exports.makePendingLocationId = makePendingLocationId; exports.assertBreakpoint = assertBreakpoint; exports.assertPendingBreakpoint = assertPendingBreakpoint; exports.assertLocation = assertLocation; exports.assertPendingLocation = assertPendingLocation; exports.breakpointAtLocation = breakpointAtLocation; exports.breakpointExists = breakpointExists; exports.createBreakpoint = createBreakpoint; exports.createPendingBreakpoint = createPendingBreakpoint; var _devtoolsConfig = __webpack_require__(828); var _selectors = __webpack_require__(242); var _assert = __webpack_require__(223); var _assert2 = _interopRequireDefault(_assert); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // Return the first argument that is a string, or null if nothing is a // string. function firstString() { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } for (var arg of args) { if (typeof arg === "string") { return arg; } } return null; } function locationMoved(location, newLocation) { return location.line !== newLocation.line || location.column !== newLocation.column; } function makeLocationId(location) { var sourceId = location.sourceId, line = location.line, column = location.column; var columnString = column || ""; return `${sourceId}:${line}:${columnString}`; } function makePendingLocationId(location) { assertPendingLocation(location); var sourceUrl = location.sourceUrl, line = location.line, column = location.column; var sourceUrlString = sourceUrl || ""; var columnString = column || ""; return `${sourceUrlString}:${line}:${columnString}`; } function assertBreakpoint(breakpoint) { assertLocation(breakpoint.location); assertLocation(breakpoint.generatedLocation); } function assertPendingBreakpoint(pendingBreakpoint) { assertPendingLocation(pendingBreakpoint.location); assertPendingLocation(pendingBreakpoint.generatedLocation); } function assertLocation(location) { assertPendingLocation(location); var sourceId = location.sourceId; (0, _assert2.default)(!!sourceId, "location must have a source id"); } function assertPendingLocation(location) { (0, _assert2.default)(!!location, "location must exist"); var sourceUrl = location.sourceUrl; // sourceUrl is null when the source does not have a url (0, _assert2.default)(sourceUrl !== undefined, "location must have a source url"); (0, _assert2.default)(location.hasOwnProperty("line"), "location must have a line"); (0, _assert2.default)(location.hasOwnProperty("column") != null, "location must have a column"); } // syncing function breakpointAtLocation(breakpoints, _ref) { var line = _ref.line, column = _ref.column; return breakpoints.find(breakpoint => { var sameLine = breakpoint.location.line === line; if (!sameLine) { return false; } // NOTE: when column breakpoints are disabled we want to find // the first breakpoint if (!(0, _devtoolsConfig.isEnabled)("columnBreakpoints")) { return true; } return breakpoint.location.column === column; }); } function breakpointExists(state, location) { var currentBp = (0, _selectors.getBreakpoint)(state, location); return currentBp && !currentBp.disabled; } function createBreakpoint(location) { var overrides = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var condition = overrides.condition, disabled = overrides.disabled, hidden = overrides.hidden, generatedLocation = overrides.generatedLocation, astLocation = overrides.astLocation; var properties = { condition: condition || null, disabled: disabled || false, hidden: hidden || false, astLocation: astLocation || { offset: location }, generatedLocation: generatedLocation || location, location }; return properties; } function createPendingLocation(location) { var sourceUrl = location.sourceUrl, line = location.line, column = location.column; return { sourceUrl, line, column }; } function createPendingBreakpoint(bp) { var pendingLocation = createPendingLocation(bp.location); var pendingGeneratedLocation = createPendingLocation(bp.generatedLocation); assertPendingLocation(pendingLocation); return { condition: bp.condition, disabled: bp.disabled, location: pendingLocation, astLocation: bp.astLocation, generatedLocation: pendingGeneratedLocation }; } /***/ }), /* 1058 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.initialState = initialState; exports.getSymbols = getSymbols; exports.hasSymbols = hasSymbols; exports.isEmptyLineInSource = isEmptyLineInSource; exports.getEmptyLines = getEmptyLines; exports.getOutOfScopeLocations = getOutOfScopeLocations; exports.getPreview = getPreview; var _immutable = __webpack_require__(146); var I = _interopRequireWildcard(_immutable); var _makeRecord = __webpack_require__(230); var _makeRecord2 = _interopRequireDefault(_makeRecord); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } /** * UI reducer * @module reducers/ui */ function initialState() { return (0, _makeRecord2.default)({ symbols: I.Map(), emptyLines: I.Map(), outOfScopeLocations: null, preview: null })(); } function update() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState(); var action = arguments[1]; switch (action.type) { case "SET_SYMBOLS": { var source = action.source, _symbols = action.symbols; return state.setIn(["symbols", source.id], _symbols); } case "SET_EMPTY_LINES": { var _source = action.source, _emptyLines = action.emptyLines; return state.setIn(["emptyLines", _source.id], _emptyLines); } case "OUT_OF_SCOPE_LOCATIONS": { return state.set("outOfScopeLocations", action.locations); } case "CLEAR_SELECTION": { return state.set("preview", null); } case "SET_PREVIEW": { if (action.status == "start") { return state.set("preview", { updating: true }); } if (!action.value) { return state.set("preview", null); } var _action$value = action.value, _expression = _action$value.expression, _location = _action$value.location, _result = _action$value.result, _tokenPos = _action$value.tokenPos, _cursorPos = _action$value.cursorPos; return state.set("preview", { updating: false, expression: _expression, location: _location, result: _result, tokenPos: _tokenPos, cursorPos: _cursorPos }); } case "RESUMED": { return state.set("outOfScopeLocations", null); } default: { return state; } } } // NOTE: we'd like to have the app state fully typed // https://github.com/devtools-html/debugger.html/blob/master/src/reducers/sources.js#L179-L185 function getSymbols(state, source) { var emptySet = { variables: [], functions: [] }; if (!source) { return emptySet; } var symbols = state.ast.getIn(["symbols", source.id]); return symbols || emptySet; } function hasSymbols(state, source) { if (!source) { return false; } return !!state.ast.getIn(["symbols", source.id]); } function isEmptyLineInSource(state, line, selectedSource) { var emptyLines = getEmptyLines(state, selectedSource); return emptyLines.includes(line); } function getEmptyLines(state, source) { if (!source) { return []; } return state.ast.getIn(["emptyLines", source.id]) || []; } function getOutOfScopeLocations(state) { return state.ast.get("outOfScopeLocations"); } function getPreview(state) { return state.ast.get("preview"); } exports.default = update; /***/ }), /* 1059 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: 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; }; /** * Gets information about original variable names from the source map * and replaces all posible generated names. */ var getSourcemapedExpression = (() => { var _ref = _asyncToGenerator(function* (_ref2, generatedLocation, expression) { var sourceMaps = _ref2.sourceMaps; var astScopes = yield (0, _parser.getScopes)(generatedLocation); var generatedScopes = yield sourceMaps.getLocationScopes(generatedLocation, astScopes); if (!generatedScopes) { return expression; } return (0, _utils.replaceOriginalVariableName)(expression, generatedScopes); }); return function getSourcemapedExpression(_x, _x2, _x3) { return _ref.apply(this, arguments); }; })(); exports.setSymbols = setSymbols; exports.setEmptyLines = setEmptyLines; exports.setOutOfScopeLocations = setOutOfScopeLocations; exports.clearPreview = clearPreview; exports.setPreview = setPreview; var _selectors = __webpack_require__(242); var _sources = __webpack_require__(254); var _promise = __webpack_require__(193); var _parser = __webpack_require__(827); var _devtoolsSourceMap = __webpack_require__(898); var _utils = __webpack_require__(1206); function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } function setSymbols(sourceId) { return (() => { var _ref3 = _asyncToGenerator(function* (_ref4) { var dispatch = _ref4.dispatch, getState = _ref4.getState; var sourceRecord = (0, _selectors.getSource)(getState(), sourceId); if (!sourceRecord) { return; } var source = sourceRecord.toJS(); if (!source.text || (0, _selectors.hasSymbols)(getState(), source)) { return; } var symbols = yield (0, _parser.getSymbols)(source); dispatch({ type: "SET_SYMBOLS", source, symbols }); }); return function (_x4) { return _ref3.apply(this, arguments); }; })(); } function setEmptyLines(sourceId) { return (() => { var _ref5 = _asyncToGenerator(function* (_ref6) { var dispatch = _ref6.dispatch, getState = _ref6.getState; var sourceRecord = (0, _selectors.getSource)(getState(), sourceId); if (!sourceRecord) { return; } var source = sourceRecord.toJS(); if (!source.text) { return; } var emptyLines = yield (0, _parser.getEmptyLines)(source); dispatch({ type: "SET_EMPTY_LINES", source, emptyLines }); }); return function (_x5) { return _ref5.apply(this, arguments); }; })(); } function setOutOfScopeLocations() { return (() => { var _ref7 = _asyncToGenerator(function* (_ref8) { var dispatch = _ref8.dispatch, getState = _ref8.getState; var location = (0, _selectors.getSelectedLocation)(getState()); if (!location) { return; } var source = (0, _selectors.getSource)(getState(), location.sourceId); if (!location.line || !source) { return dispatch({ type: "OUT_OF_SCOPE_LOCATIONS", locations: null }); } var locations = yield (0, _parser.getOutOfScopeLocations)(source.toJS(), location); return dispatch({ type: "OUT_OF_SCOPE_LOCATIONS", locations }); }); return function (_x6) { return _ref7.apply(this, arguments); }; })(); } function clearPreview() { return (_ref9) => { var dispatch = _ref9.dispatch, getState = _ref9.getState, client = _ref9.client; var currentSelection = (0, _selectors.getPreview)(getState()); if (!currentSelection) { return; } return dispatch({ type: "CLEAR_SELECTION" }); }; } function findBestMatch(symbols, tokenPos, token) { var memberExpressions = symbols.memberExpressions, identifiers = symbols.identifiers; var line = tokenPos.line, column = tokenPos.column; return identifiers.concat(memberExpressions).reduce((found, expression) => { var overlaps = expression.location.start.line == line && expression.location.start.column <= column && expression.location.end.column >= column; if (overlaps) { return expression; } return found; }, {}); } function setPreview(token, tokenPos, cursorPos) { return (() => { var _ref10 = _asyncToGenerator(function* (_ref11) { var dispatch = _ref11.dispatch, getState = _ref11.getState, client = _ref11.client, sourceMaps = _ref11.sourceMaps; var currentSelection = (0, _selectors.getPreview)(getState()); if (currentSelection && currentSelection.updating) { return; } yield dispatch({ type: "SET_PREVIEW", [_promise.PROMISE]: _asyncToGenerator(function* () { var source = (0, _selectors.getSelectedSource)(getState()); var _symbols = yield (0, _parser.getSymbols)(source.toJS()); var found = findBestMatch(_symbols, tokenPos, token); if (!found) { return; } var expression = found.expression, location = found.location; if (!expression) { return; } var sourceId = source.get("id"); if (location && !(0, _devtoolsSourceMap.isGeneratedId)(sourceId)) { var generatedLocation = yield sourceMaps.getGeneratedLocation(_extends({}, location.start, { sourceId }), source.toJS()); var generatedSourceId = generatedLocation.sourceId; yield dispatch((0, _sources.ensureParserHasSourceText)(generatedSourceId)); expression = yield getSourcemapedExpression({ dispatch, sourceMaps }, generatedLocation, expression); } var selectedFrame = (0, _selectors.getSelectedFrame)(getState()); var _ref13 = yield client.evaluate(expression, { frameId: selectedFrame.id }), result = _ref13.result; if (result === undefined) { return; } return { expression, result, location, tokenPos, cursorPos }; })() }); }); return function (_x7) { return _ref10.apply(this, arguments); }; })(); } /***/ }), /* 1060 */, /* 1061 */, /* 1062 */, /* 1063 */, /* 1064 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _Svg = __webpack_require__(344); var _Svg2 = _interopRequireDefault(_Svg); var _ManagedTree = __webpack_require__(419); var _ManagedTree2 = _interopRequireDefault(_ManagedTree); var _SearchInput = __webpack_require__(377); var _SearchInput2 = _interopRequireDefault(_SearchInput); __webpack_require__(866); var _sourcesTree = __webpack_require__(39); var _highlight = __webpack_require__(1184); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class TextSearch extends _react.Component { constructor(props) { super(props); this.state = { inputValue: this.props.query || "" }; this.focusedItem = null; this.inputFocused = false; this.inputOnChange = this.inputOnChange.bind(this); this.onKeyDown = this.onKeyDown.bind(this); this.onEnterPress = this.onEnterPress.bind(this); this.selectMatchItem = this.selectMatchItem.bind(this); } componentDidMount() { var shortcuts = this.context.shortcuts; shortcuts.on("Enter", this.onEnterPress); } componentWillUnmount() { var shortcuts = this.context.shortcuts; shortcuts.off("Enter", this.onEnterPress); } selectMatchItem(matchItem) { this.props.selectSource(matchItem.sourceId, { line: matchItem.line }); } getResults() { var results = this.props.results; return results.filter(result => result.filepath && result.matches.length > 0); } getResultCount() { var results = this.getResults(); return results.reduce((count, file) => count + (file.matches ? file.matches.length : 0), 0); } onKeyDown(e) { if (e.key === "Escape") { return; } e.stopPropagation(); if (e.key !== "Enter") { return; } this.focusedItem = null; this.props.searchSources(this.state.inputValue); } onEnterPress() { if (this.focusedItem && !this.inputFocused) { var _focusedItem = this.focusedItem, setExpanded = _focusedItem.setExpanded, file = _focusedItem.file, expanded = _focusedItem.expanded, match = _focusedItem.match; if (setExpanded) { setExpanded(file, !expanded); } else { this.selectMatchItem(match); } } } inputOnChange(e) { var inputValue = e.target.value; this.setState({ inputValue }); } renderFile(file, focused, expanded, setExpanded) { if (focused) { this.focusedItem = { setExpanded, file, expanded }; } var matchesLength = file.matches.length; var matches = ` (${matchesLength} match${matchesLength > 1 ? "es" : ""})`; return _react2.default.createElement( "div", { className: (0, _classnames2.default)("file-result", { focused }), key: file.sourceId, onClick: e => setExpanded(file, !expanded) }, _react2.default.createElement(_Svg2.default, { name: "arrow", className: (0, _classnames2.default)({ expanded }) }), _react2.default.createElement(_Svg2.default, { name: "file" }), _react2.default.createElement( "span", { className: "file-path" }, (0, _sourcesTree.getRelativePath)(file.filepath) ), _react2.default.createElement( "span", { className: "matches-summary" }, matches ) ); } renderMatch(match, focused) { if (focused) { this.focusedItem = { match }; } return _react2.default.createElement( "div", { className: (0, _classnames2.default)("result", { focused }), onClick: () => setTimeout(() => this.selectMatchItem(match), 50) }, _react2.default.createElement( "span", { className: "line-number", key: match.line }, match.line ), this.renderMatchValue(match) ); } renderMatchValue(lineMatch) { return (0, _highlight.highlightMatches)(lineMatch); } renderResults() { var results = this.getResults(); results = results.filter(result => result.matches.length > 0); function getFilePath(item, index) { return item.filepath ? `${item.sourceId}-${index}` : `${item.sourceId}-${item.line}-${item.column}-${index}`; } var renderItem = (item, depth, focused, _, expanded, _ref) => { var setExpanded = _ref.setExpanded; return item.filepath ? this.renderFile(item, focused, expanded, setExpanded) : this.renderMatch(item, focused); }; if (results.length) { return _react2.default.createElement(_ManagedTree2.default, { getRoots: () => results, getChildren: file => file.matches || [], itemHeight: 24, autoExpand: 1, autoExpandDepth: 1, getParent: item => null, getPath: getFilePath, renderItem: renderItem }); } else if (this.props.query && !results.length) { return _react2.default.createElement( "div", { className: "no-result-msg absolute-center" }, L10N.getStr("projectTextSearch.noResults") ); } } renderInput() { var resultCount = this.getResultCount(); var summaryMsg = L10N.getFormatStr("sourceSearch.resultsSummary1", resultCount); return _react2.default.createElement(_SearchInput2.default, { query: this.state.inputValue, count: resultCount, placeholder: L10N.getStr("projectTextSearch.placeholder"), size: "big", summaryMsg: summaryMsg, onChange: e => this.inputOnChange(e), onFocus: () => this.inputFocused = true, onBlur: () => this.inputFocused = false, onKeyDown: e => this.onKeyDown(e), handleClose: this.props.closeActiveSearch, ref: "searchInput" }); } render() { var searchBottomBar = this.props.searchBottomBar; return _react2.default.createElement( "div", { className: "project-text-search" }, _react2.default.createElement( "div", { className: "header" }, this.renderInput(), searchBottomBar ), this.renderResults() ); } } exports.default = TextSearch; TextSearch.propTypes = { sources: _react.PropTypes.object, results: _react.PropTypes.array, query: _react.PropTypes.string, closeActiveSearch: _react.PropTypes.func, searchSources: _react.PropTypes.func, selectSource: _react.PropTypes.func, searchBottomBar: _react.PropTypes.object }; TextSearch.contextTypes = { shortcuts: _react.PropTypes.object }; /***/ }), /* 1065 */, /* 1066 */, /* 1067 */, /* 1068 */, /* 1069 */, /* 1070 */, /* 1071 */, /* 1072 */, /* 1073 */, /* 1074 */, /* 1075 */, /* 1076 */, /* 1077 */, /* 1078 */, /* 1079 */, /* 1080 */, /* 1081 */, /* 1082 */, /* 1083 */, /* 1084 */, /* 1085 */, /* 1086 */, /* 1087 */, /* 1088 */, /* 1089 */, /* 1090 */, /* 1091 */, /* 1092 */, /* 1093 */, /* 1094 */, /* 1095 */, /* 1096 */, /* 1097 */, /* 1098 */, /* 1099 */, /* 1100 */, /* 1101 */, /* 1102 */, /* 1103 */, /* 1104 */, /* 1105 */, /* 1106 */, /* 1107 */, /* 1108 */, /* 1109 */, /* 1110 */, /* 1111 */, /* 1112 */, /* 1113 */, /* 1114 */, /* 1115 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.findSourceMatches = exports.searchSources = exports.getMatches = exports.stopSearchWorker = exports.startSearchWorker = undefined; var _devtoolsUtils = __webpack_require__(900); var WorkerDispatcher = _devtoolsUtils.workerUtils.WorkerDispatcher; var dispatcher = new WorkerDispatcher(); var startSearchWorker = exports.startSearchWorker = dispatcher.start.bind(dispatcher); var stopSearchWorker = exports.stopSearchWorker = dispatcher.stop.bind(dispatcher); var getMatches = exports.getMatches = dispatcher.task("getMatches"); var searchSources = exports.searchSources = dispatcher.task("searchSources"); var findSourceMatches = exports.findSourceMatches = dispatcher.task("findSourceMatches"); /***/ }), /* 1116 */, /* 1117 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 1118 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 1119 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 1120 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = renderWhyPaused; var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _lodash = __webpack_require__(2); var _pause = __webpack_require__(255); __webpack_require__(913); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function renderExceptionSummary(exception) { if ((0, _lodash.isString)(exception)) { return exception; } var message = (0, _lodash.get)(exception, "preview.message"); var name = (0, _lodash.get)(exception, "preview.name"); return `${name}: ${message}`; } function renderMessage(pauseInfo) { if (!pauseInfo) { return null; } var message = (0, _lodash.get)(pauseInfo, "why.message"); if (message) { return _react2.default.createElement( "div", { className: "message" }, message ); } var exception = (0, _lodash.get)(pauseInfo, "why.exception"); if (exception) { return _react2.default.createElement( "div", { className: "message warning" }, renderExceptionSummary(exception) ); } return null; } function renderWhyPaused(_ref) { var pause = _ref.pause; var reason = (0, _pause.getPauseReason)(pause); if (!reason) { return null; } return _react2.default.createElement( "div", { className: "pane why-paused" }, _react2.default.createElement( "div", null, L10N.getStr(reason) ), renderMessage(pause) ); } renderWhyPaused.displayName = "whyPaused"; /***/ }), /* 1121 */, /* 1122 */, /* 1123 */, /* 1124 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = getInScopeLines; var _ast = __webpack_require__(1058); var _sources = __webpack_require__(232); var _source = __webpack_require__(233); var _lodash = __webpack_require__(2); 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); } } function getOutOfScopeLines(outOfScopeLocations) { if (!outOfScopeLocations) { return null; } return (0, _lodash.uniq)((0, _lodash.flatMap)(outOfScopeLocations, location => (0, _lodash.range)(location.start.line, location.end.line))); } function getInScopeLines(state) { var source = (0, _sources.getSelectedSource)(state); var outOfScopeLocations = (0, _ast.getOutOfScopeLocations)(state); if (!source || !source.get("text")) { return; } var linesOutOfScope = getOutOfScopeLines(outOfScopeLocations, source.toJS()); var sourceNumLines = (0, _source.getSourceLineCount)(source.toJS()); var sourceLines = (0, _lodash.range)(1, sourceNumLines + 1); if (!linesOutOfScope) { return sourceLines; } return _lodash.without.apply(undefined, [sourceLines].concat(_toConsumableArray(linesOutOfScope))); } /***/ }), /* 1125 */, /* 1126 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 1127 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.containsPosition = containsPosition; exports.containsLocation = containsLocation; exports.nodeContainsPosition = nodeContainsPosition; function containsPosition(a, b) { var startsBefore = a.start.line < b.line || a.start.line === b.line && a.start.column <= b.column; var endsAfter = a.end.line > b.line || a.end.line === b.line && a.end.column >= b.column; return startsBefore && endsAfter; } function containsLocation(a, b) { return containsPosition(a, b.start) && containsPosition(a, b.end); } function nodeContainsPosition(node, position) { return containsPosition(node.loc, position); } /***/ }), /* 1128 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isVisible = isVisible; /* Checks to see if the root element is available and * if the element is visible. We check the width of the element * because it is more reliable than either checking a focus state or * the visibleState or hidden property. */ function isVisible() { var el = document.querySelector("#mount"); return el && el.getBoundingClientRect().width; } /***/ }), /* 1129 */, /* 1130 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var _require = __webpack_require__(830), Menu = _require.Menu, MenuItem = _require.MenuItem; function inToolbox() { return window.parent.document.documentURI == "about:devtools-toolbox"; } if (!inToolbox()) { __webpack_require__(854); } function createPopup(doc) { var popup = doc.createElement("menupopup"); popup.className = "landing-popup"; if (popup.openPopupAtScreen) { return popup; } function preventDefault(e) { e.preventDefault(); e.returnValue = false; } var mask = document.querySelector("#contextmenu-mask"); if (!mask) { mask = doc.createElement("div"); mask.id = "contextmenu-mask"; document.body.appendChild(mask); } mask.onclick = () => popup.hidePopup(); popup.openPopupAtScreen = function (clientX, clientY) { this.style.setProperty("left", `${clientX}px`); this.style.setProperty("top", `${clientY}px`); mask = document.querySelector("#contextmenu-mask"); window.onwheel = preventDefault; mask.classList.add("show"); this.dispatchEvent(new Event("popupshown")); this.popupshown; }; popup.hidePopup = function () { this.remove(); mask = document.querySelector("#contextmenu-mask"); mask.classList.remove("show"); window.onwheel = null; }; return popup; } if (!inToolbox()) { Menu.prototype.createPopup = createPopup; } function onShown(menu, popup) { popup.childNodes.forEach((menuItemNode, i) => { var item = menu.items[i]; if (!item.disabled && item.visible) { menuItemNode.onclick = () => { item.click(); popup.hidePopup(); }; showSubMenu(item.submenu, menuItemNode, popup); } }); } function showMenu(evt, items) { if (items.length === 0) { return; } var menu = new Menu(); items.filter(item => item.visible === undefined || item.visible === true).forEach(item => { var menuItem = new MenuItem(item); menuItem.submenu = createSubMenu(item.submenu); menu.append(menuItem); }); if (inToolbox()) { menu.popup(evt.screenX, evt.screenY, { doc: window.parent.document }); return; } menu.on("open", (_, popup) => onShown(menu, popup)); menu.popup(evt.clientX, evt.clientY, { doc: document }); } function createSubMenu(subItems) { if (subItems) { var subMenu = new Menu(); subItems.forEach(subItem => { subMenu.append(new MenuItem(subItem)); }); return subMenu; } return null; } function showSubMenu(subMenu, menuItemNode, popup) { if (subMenu) { var subMenuNode = menuItemNode.querySelector("menupopup"); var _menuItemNode$getBoun = menuItemNode.getBoundingClientRect(), top = _menuItemNode$getBoun.top; var _popup$getBoundingCli = popup.getBoundingClientRect(), left = _popup$getBoundingCli.left, width = _popup$getBoundingCli.width; subMenuNode.style.setProperty("left", `${left + width - 1}px`); subMenuNode.style.setProperty("top", `${top}px`); var subMenuItemNodes = menuItemNode.querySelector("menupopup:not(.landing-popup)").childNodes; subMenuItemNodes.forEach((subMenuItemNode, j) => { var subMenuItem = subMenu.items.filter(item => item.visible === undefined || item.visible === true)[j]; if (!subMenuItem.disabled && subMenuItem.visible) { subMenuItemNode.onclick = () => { subMenuItem.click(); popup.hidePopup(); }; } }); } } function buildMenu(items) { return items.map(itm => { var hide = typeof itm.hidden === "function" ? itm.hidden() : itm.hidden; return hide ? null : itm.item; }).filter(itm => itm !== null); } module.exports = { showMenu, buildMenu }; /***/ }), /* 1131 */, /* 1132 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = update; exports.getSourceSearchQuery = getSourceSearchQuery; var _makeRecord = __webpack_require__(230); var _makeRecord2 = _interopRequireDefault(_makeRecord); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function InitialState() { return (0, _makeRecord2.default)({ queryString: "" })(); } function update() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : InitialState(); var action = arguments[1]; switch (action.type) { case "SET_QUERY_STRING": return state.update("queryString", value => action.queryString); case "CLEAR_QUERY_STRING": return state.update("queryString", value => ""); default: return state; } } function getSourceSearchQuery(state) { return state.sourceSearch.get("queryString"); } /***/ }), /* 1133 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.initialState = initialState; exports.getPendingBreakpoints = getPendingBreakpoints; exports.getPendingBreakpointsForSource = getPendingBreakpointsForSource; var _immutable = __webpack_require__(146); var I = _interopRequireWildcard(_immutable); var _makeRecord = __webpack_require__(230); var _makeRecord2 = _interopRequireDefault(_makeRecord); var _breakpoint = __webpack_require__(1057); var _prefs = __webpack_require__(226); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /** * Breakpoints reducer * @module reducers/breakpoints */ function initialState() { return (0, _makeRecord2.default)({ pendingBreakpoints: restorePendingBreakpoints() })(); } function update() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState(); var action = arguments[1]; switch (action.type) { case "ADD_BREAKPOINT": { if (action.breakpoint.hidden) { return state; } return addBreakpoint(state, action); } case "SYNC_BREAKPOINT": { return syncBreakpoint(state, action); } case "ENABLE_BREAKPOINT": { return addBreakpoint(state, action); } case "DISABLE_BREAKPOINT": { return updateBreakpoint(state, action); } case "SET_BREAKPOINT_CONDITION": { return updateBreakpoint(state, action); } case "REMOVE_BREAKPOINT": { if (action.breakpoint.hidden) { return state; } return removeBreakpoint(state, action); } } return state; } function addBreakpoint(state, action) { if (action.status !== "done") { return state; } // when the action completes, we can commit the breakpoint var breakpoint = action.value.breakpoint; var locationId = (0, _breakpoint.makePendingLocationId)(breakpoint.location); var pendingBreakpoint = (0, _breakpoint.createPendingBreakpoint)(breakpoint); return state.setIn(["pendingBreakpoints", locationId], pendingBreakpoint); } function syncBreakpoint(state, action) { var breakpoint = action.breakpoint, previousLocation = action.previousLocation; var locationId = (0, _breakpoint.makePendingLocationId)(breakpoint.location); var pendingBreakpoint = (0, _breakpoint.createPendingBreakpoint)(breakpoint); if (previousLocation) { return state.deleteIn(["pendingBreakpoints", (0, _breakpoint.makePendingLocationId)(previousLocation)]).setIn(["pendingBreakpoints", locationId], pendingBreakpoint); } return state.setIn(["pendingBreakpoints", locationId], pendingBreakpoint); } function updateBreakpoint(state, action) { var breakpoint = action.breakpoint; var locationId = (0, _breakpoint.makePendingLocationId)(breakpoint.location); var pendingBreakpoint = (0, _breakpoint.createPendingBreakpoint)(breakpoint); return state.setIn(["pendingBreakpoints", locationId], pendingBreakpoint); } function removeBreakpoint(state, action) { var breakpoint = action.breakpoint; var locationId = (0, _breakpoint.makePendingLocationId)(breakpoint.location); var pendingBp = state.getIn(["pendingBreakpoints", locationId]); if (!pendingBp && action.status == "start") { return state.set("pendingBreakpoints", I.Map()); } return state.deleteIn(["pendingBreakpoints", locationId]); } // Selectors // TODO: these functions should be moved out of the reducer function getPendingBreakpoints(state) { return state.pendingBreakpoints.pendingBreakpoints; } function getPendingBreakpointsForSource(state, sourceUrl) { var pendingBreakpoints = state.pendingBreakpoints.pendingBreakpoints || []; return pendingBreakpoints.filter(pendingBreakpoint => pendingBreakpoint.location.sourceUrl === sourceUrl); } function restorePendingBreakpoints() { return I.Map(_prefs.prefs.pendingBreakpoints); } exports.default = update; /***/ }), /* 1134 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = getBreakpointAtLocation; var _sources = __webpack_require__(232); var _breakpoints = __webpack_require__(236); var _devtoolsSourceMap = __webpack_require__(898); function isGenerated(selectedSource) { var sourceId = selectedSource.get("id"); return (0, _devtoolsSourceMap.isGeneratedId)(sourceId); } function getColumn(column, selectedSource) { if (column) { return column; } return isGenerated(selectedSource) ? undefined : 0; } function getLocation(bp, selectedSource) { return isGenerated(selectedSource) ? bp.generatedLocation || bp.location : bp.location; } function getBreakpointsForSource(state, selectedSource) { var breakpoints = (0, _breakpoints.getBreakpoints)(state); return breakpoints.filter(bp => { var location = getLocation(bp, selectedSource); return location.sourceId === selectedSource.get("id"); }); } function findBreakpointAtLocation(breakpoints, selectedSource, _ref) { var line = _ref.line, column = _ref.column; return breakpoints.find(breakpoint => { var location = getLocation(breakpoint, selectedSource); var sameLine = location.line === line; if (!sameLine) { return false; } if (column === undefined) { return true; } return location.column === getColumn(column, selectedSource); }); } /* * Finds a breakpoint at a location (line, column) of the * selected source. * * This is useful for finding a breakpoint when the * user clicks in the gutter or on a token. */ function getBreakpointAtLocation(state, location) { var selectedSource = (0, _sources.getSelectedSource)(state); var breakpoints = getBreakpointsForSource(state, selectedSource); return findBreakpointAtLocation(breakpoints, selectedSource, location); } /***/ }), /* 1135 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = getVisibleBreakpoints; var _breakpoints = __webpack_require__(236); var _sources = __webpack_require__(232); var _devtoolsSourceMap = __webpack_require__(898); function getLocation(breakpoint, isGeneratedSource) { return isGeneratedSource ? breakpoint.generatedLocation || breakpoint.location : breakpoint.location; } function formatBreakpoint(breakpoint, selectedSource) { var condition = breakpoint.condition, loading = breakpoint.loading, disabled = breakpoint.disabled, hidden = breakpoint.hidden; var sourceId = selectedSource.get("id"); var isGeneratedSource = (0, _devtoolsSourceMap.isGeneratedId)(sourceId); return { location: getLocation(breakpoint, isGeneratedSource), condition, loading, disabled, hidden }; } function isVisible(breakpoint, selectedSource) { var sourceId = selectedSource.get("id"); var isGeneratedSource = (0, _devtoolsSourceMap.isGeneratedId)(sourceId); var location = getLocation(breakpoint, isGeneratedSource); return location.sourceId === sourceId; } /* * Finds the breakpoints, which appear in the selected source. * * This */ function getVisibleBreakpoints(state) { var selectedSource = (0, _sources.getSelectedSource)(state); if (!selectedSource) { return null; } return (0, _breakpoints.getBreakpoints)(state).filter(bp => isVisible(bp, selectedSource)).map(bp => formatBreakpoint(bp, selectedSource)); } /***/ }), /* 1136 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: 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; }; var _breakpoint = __webpack_require__(1057); var _selectors = __webpack_require__(242); var _sourceMaps = __webpack_require__(797); function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } exports.default = (() => { var _ref = _asyncToGenerator(function* (getState, client, sourceMaps, _ref2) { var breakpoint = _ref2.breakpoint; var state = getState(); var source = (0, _selectors.getSource)(state, breakpoint.location.sourceId); var sourceRecord = source.toJS(); var location = _extends({}, breakpoint.location, { sourceUrl: source.get("url") }); var generatedLocation = yield (0, _sourceMaps.getGeneratedLocation)(state, sourceRecord, location, sourceMaps); (0, _breakpoint.assertLocation)(location); (0, _breakpoint.assertLocation)(generatedLocation); if ((0, _breakpoint.breakpointExists)(state, location)) { var _newBreakpoint = _extends({}, breakpoint, { location, generatedLocation }); (0, _breakpoint.assertBreakpoint)(_newBreakpoint); return { breakpoint: _newBreakpoint }; } var _ref3 = yield client.setBreakpoint(generatedLocation, breakpoint.condition, sourceMaps.isOriginalId(location.sourceId)), id = _ref3.id, hitCount = _ref3.hitCount, actualLocation = _ref3.actualLocation; var newGeneratedLocation = actualLocation || generatedLocation; var newLocation = yield sourceMaps.getOriginalLocation(newGeneratedLocation); var astLocation = yield (0, _breakpoint.getASTLocation)(sourceRecord, location); var newBreakpoint = { id, disabled: false, hidden: breakpoint.hidden, loading: false, condition: breakpoint.condition, location: newLocation, astLocation, hitCount, generatedLocation: newGeneratedLocation }; (0, _breakpoint.assertBreakpoint)(newBreakpoint); var previousLocation = (0, _breakpoint.locationMoved)(location, newLocation) ? location : null; return { breakpoint: newBreakpoint, previousLocation }; }); function addBreakpoint(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); } return addBreakpoint; })(); /***/ }), /* 1137 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.syncClientBreakpoint = undefined; 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; }; var makeScopedLocation = (() => { var _ref = _asyncToGenerator(function* (_ref2, location, source) { var name = _ref2.name, offset = _ref2.offset; var scope = yield (0, _breakpoint.findScopeByName)(source, name); // fallback onto the location line, if the scope is not found // note: we may at some point want to delete the breakpoint if the scope // disappears var line = scope ? scope.location.start.line + offset.line : location.line; return { line, column: location.column, sourceUrl: source.url, sourceId: source.id }; }); return function makeScopedLocation(_x, _x2, _x3) { return _ref.apply(this, arguments); }; })(); // we have three forms of syncing: disabled syncing, existing server syncing // and adding a new breakpoint var syncClientBreakpoint = exports.syncClientBreakpoint = (() => { var _ref3 = _asyncToGenerator(function* (getState, client, sourceMaps, sourceId, pendingBreakpoint) { (0, _breakpoint.assertPendingBreakpoint)(pendingBreakpoint); var source = (0, _selectors.getSource)(getState(), sourceId).toJS(); var generatedSourceId = sourceMaps.isOriginalId(sourceId) ? (0, _devtoolsSourceMap.originalToGeneratedId)(sourceId) : sourceId; var location = pendingBreakpoint.location, astLocation = pendingBreakpoint.astLocation; var previousLocation = _extends({}, location, { sourceId }); var scopedLocation = yield makeScopedLocation(astLocation, previousLocation, source); var scopedGeneratedLocation = yield (0, _sourceMaps.getGeneratedLocation)(getState(), source, scopedLocation, sourceMaps); // this is the generatedLocation of the pending breakpoint, with // the source id updated to reflect the new connection var generatedLocation = _extends({}, pendingBreakpoint.generatedLocation, { sourceId: generatedSourceId }); var isSameLocation = !(0, _breakpoint.locationMoved)(generatedLocation, scopedGeneratedLocation); var existingClient = client.getBreakpointByLocation(generatedLocation); /** ******* CASE 1: No server change ***********/ // early return if breakpoint is disabled or we are in the sameLocation // send update only to redux if (pendingBreakpoint.disabled || existingClient && isSameLocation) { return createSyncData(pendingBreakpoint, scopedLocation, scopedGeneratedLocation); } // clear server breakpoints if they exist and we have moved if (existingClient) { yield client.removeBreakpoint(generatedLocation); } /** ******* Case 2: Add New Breakpoint ***********/ // If we are not disabled, set the breakpoint on the server and get // that info so we can set it on our breakpoints. var clientBreakpoint = yield client.setBreakpoint(scopedGeneratedLocation, pendingBreakpoint.condition, sourceMaps.isOriginalId(sourceId)); // the breakpoint might have slid server side, so we want to get the location // based on the server's return value var newGeneratedLocation = clientBreakpoint.actualLocation; var newLocation = yield sourceMaps.getOriginalLocation(newGeneratedLocation); return createSyncData(pendingBreakpoint, newLocation, newGeneratedLocation, previousLocation); }); return function syncClientBreakpoint(_x5, _x6, _x7, _x8, _x9) { return _ref3.apply(this, arguments); }; })(); var _breakpoint = __webpack_require__(1057); var _sourceMaps = __webpack_require__(797); var _devtoolsSourceMap = __webpack_require__(898); var _selectors = __webpack_require__(242); function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } function createSyncData(pendingBreakpoint, location, generatedLocation) { var previousLocation = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; var overrides = _extends({}, pendingBreakpoint, { generatedLocation }); var breakpoint = (0, _breakpoint.createBreakpoint)(location, overrides); (0, _breakpoint.assertBreakpoint)(breakpoint); return { breakpoint, previousLocation }; } /***/ }), /* 1138 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = buildQuery; var _escapeRegExp = __webpack_require__(259); var _escapeRegExp2 = _interopRequireDefault(_escapeRegExp); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Ignore doing outline matches for less than 3 whitespaces * * @memberof utils/source-search * @static */ function ignoreWhiteSpace(str) { return (/^\s{0,2}$/.test(str) ? "(?!\\s*.*)" : str ); } function wholeMatch(query, wholeWord) { if (query === "" || !wholeWord) { return query; } return `\\b${query}\\b`; } function buildFlags(caseSensitive, isGlobal) { if (caseSensitive && isGlobal) { return "g"; } if (!caseSensitive && isGlobal) { return "gi"; } if (!caseSensitive && !isGlobal) { return "i"; } return; } function buildQuery(originalQuery, modifiers, _ref) { var _ref$isGlobal = _ref.isGlobal, isGlobal = _ref$isGlobal === undefined ? false : _ref$isGlobal, _ref$ignoreSpaces = _ref.ignoreSpaces, ignoreSpaces = _ref$ignoreSpaces === undefined ? false : _ref$ignoreSpaces; var caseSensitive = modifiers.caseSensitive, regexMatch = modifiers.regexMatch, wholeWord = modifiers.wholeWord; if (originalQuery === "") { return new RegExp(originalQuery); } var query = originalQuery; if (ignoreSpaces) { query = ignoreWhiteSpace(query); } if (!regexMatch) { query = (0, _escapeRegExp2.default)(query); } query = wholeMatch(query, wholeWord); var flags = buildFlags(caseSensitive, isGlobal); if (flags) { return new RegExp(query, flags); } return new RegExp(query); } /***/ }), /* 1139 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactRedux = __webpack_require__(1189); var _redux = __webpack_require__(3); var _actions = __webpack_require__(244); var _actions2 = _interopRequireDefault(_actions); var _TextSearch = __webpack_require__(1064); var _TextSearch2 = _interopRequireDefault(_TextSearch); var _SourceSearch = __webpack_require__(1141); var _SourceSearch2 = _interopRequireDefault(_SourceSearch); var _ToggleSearch = __webpack_require__(284); var _ToggleSearch2 = _interopRequireDefault(_ToggleSearch); var _prefs = __webpack_require__(226); var _selectors = __webpack_require__(242); __webpack_require__(869); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class ProjectSearch extends _react.Component { constructor(props) { super(props); this.toggleSourceSearch = this.toggleSourceSearch.bind(this); this.toggleProjectTextSearch = this.toggleProjectTextSearch.bind(this); } componentDidMount() { var shortcuts = this.context.shortcuts; shortcuts.on(L10N.getStr("projectTextSearch.key"), this.toggleProjectTextSearch); var searchKeys = [L10N.getStr("sources.search.key2"), L10N.getStr("sources.search.alt.key")]; searchKeys.forEach(key => shortcuts.on(key, this.toggleSourceSearch)); } componentWillUnmount() { var shortcuts = this.context.shortcuts; shortcuts.off(L10N.getStr("projectTextSearch.key"), this.toggleProjectTextSearch); var searchKeys = [L10N.getStr("sources.search.key2"), L10N.getStr("sources.search.alt.key")]; searchKeys.forEach(key => shortcuts.off(key, this.toggleSourceSearch)); } toggleProjectTextSearch(key, e) { var _props = this.props, closeActiveSearch = _props.closeActiveSearch, setActiveSearch = _props.setActiveSearch; if (e) { e.preventDefault(); } if (!_prefs.features.projectTextSearch) { return; } if (this.isProjectSearchEnabled()) { return closeActiveSearch(); } return setActiveSearch("project"); } toggleSourceSearch(key, e) { var _props2 = this.props, closeActiveSearch = _props2.closeActiveSearch, setActiveSearch = _props2.setActiveSearch; if (e) { e.preventDefault(); } if (this.isSourceSearchEnabled()) { return closeActiveSearch(); } return setActiveSearch("source"); } isProjectSearchEnabled() { return this.props.activeSearch === "project"; } isSourceSearchEnabled() { return this.props.activeSearch === "source"; } renderSourceSearch() { var _props3 = this.props, sources = _props3.sources, selectSource = _props3.selectSource, closeActiveSearch = _props3.closeActiveSearch, sourceSearchQuery = _props3.sourceSearchQuery, setSourceSearchQuery = _props3.setSourceSearchQuery, clearSourceSearchQuery = _props3.clearSourceSearchQuery; return _react2.default.createElement(_SourceSearch2.default, { sources: sources, selectSource: selectSource, closeActiveSearch: closeActiveSearch, searchBottomBar: _react2.default.createElement(_ToggleSearch2.default, { kind: "sources", toggle: this.toggleProjectTextSearch }), query: sourceSearchQuery, setQuery: setSourceSearchQuery, clearQuery: clearSourceSearchQuery }); } renderTextSearch() { var _props4 = this.props, sources = _props4.sources, results = _props4.results, searchSources = _props4.searchSources, closeActiveSearch = _props4.closeActiveSearch, selectSource = _props4.selectSource, textSearchQuery = _props4.textSearchQuery; return _react2.default.createElement(_TextSearch2.default, { sources: sources, results: results.toJS(), searchSources: searchSources, closeActiveSearch: closeActiveSearch, selectSource: selectSource, query: textSearchQuery, searchBottomBar: _react2.default.createElement(_ToggleSearch2.default, { kind: "project", toggle: this.toggleSourceSearch }) }); } render() { if (!(this.isProjectSearchEnabled() || this.isSourceSearchEnabled())) { return null; } return _react2.default.createElement( "div", { className: "search-container" }, this.isProjectSearchEnabled() ? this.renderTextSearch() : this.renderSourceSearch() ); } } ProjectSearch.propTypes = { sources: _react.PropTypes.object.isRequired, results: _react.PropTypes.object, textSearchQuery: _react.PropTypes.string, setActiveSearch: _react.PropTypes.func.isRequired, closeActiveSearch: _react.PropTypes.func.isRequired, searchSources: _react.PropTypes.func, activeSearch: _react.PropTypes.string, selectSource: _react.PropTypes.func.isRequired, sourceSearchQuery: _react.PropTypes.string, setSourceSearchQuery: _react.PropTypes.func, clearSourceSearchQuery: _react.PropTypes.func }; ProjectSearch.contextTypes = { shortcuts: _react.PropTypes.object }; exports.default = (0, _reactRedux.connect)(state => ({ sources: (0, _selectors.getSources)(state), activeSearch: (0, _selectors.getActiveSearch)(state), results: (0, _selectors.getTextSearchResults)(state), textSearchQuery: (0, _selectors.getTextSearchQuery)(state), sourceSearchQuery: (0, _selectors.getSourceSearchQuery)(state) }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(ProjectSearch); /***/ }), /* 1140 */, /* 1141 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _source = __webpack_require__(233); var _utils = __webpack_require__(234); var _Autocomplete = __webpack_require__(342); var _Autocomplete2 = _interopRequireDefault(_Autocomplete); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class SourceSearch extends _react.Component { searchResults(sources) { return sources.valueSeq().toJS().filter(source => !(0, _source.isPretty)(source) && !(0, _source.isThirdParty)(source)).map(source => ({ value: (0, _source.getSourcePath)(source), title: (0, _source.getSourcePath)(source).split("/").pop(), subtitle: (0, _utils.endTruncateStr)((0, _source.getSourcePath)(source), 100), id: source.id })); } render() { var _props = this.props, sources = _props.sources, searchBottomBar = _props.searchBottomBar, selectSource = _props.selectSource, query = _props.query, setQuery = _props.setQuery; return _react2.default.createElement( _Autocomplete2.default, { selectItem: (e, result) => selectSource(result.id), close: this.props.closeActiveSearch, items: this.searchResults(sources), inputValue: query, placeholder: L10N.getStr("sourceSearch.search"), onChangeHandler: setQuery, size: "big" }, searchBottomBar ); } } exports.default = SourceSearch; SourceSearch.contextTypes = { shortcuts: _react.PropTypes.object }; /***/ }), /* 1142 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _redux = __webpack_require__(3); var _reactRedux = __webpack_require__(1189); var _text = __webpack_require__(389); var _actions = __webpack_require__(244); var _actions2 = _interopRequireDefault(_actions); var _selectors = __webpack_require__(242); var _devtoolsConfig = __webpack_require__(828); __webpack_require__(870); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _Outline = __webpack_require__(1145); var _Outline2 = _interopRequireDefault(_Outline); var _SourcesTree = __webpack_require__(1148); var _SourcesTree2 = _interopRequireDefault(_SourcesTree); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class PrimaryPanes extends _react.Component { constructor(props) { super(props); this.state = { selectedPane: "sources" }; this.renderShortcut = this.renderShortcut.bind(this); this.showPane = this.showPane.bind(this); this.renderTabs = this.renderTabs.bind(this); } showPane(selectedPane) { this.setState({ selectedPane }); } renderOutlineTabs() { if (!(0, _devtoolsConfig.isEnabled)("outline")) { return; } var sources = (0, _text.formatKeyShortcut)(L10N.getStr("sources.header")); var outline = (0, _text.formatKeyShortcut)(L10N.getStr("outline.header")); return [_react2.default.createElement( "div", { className: (0, _classnames2.default)("tab", { active: this.state.selectedPane === "sources" }), onClick: () => this.showPane("sources"), key: "sources-tab" }, sources ), _react2.default.createElement( "div", { className: (0, _classnames2.default)("tab", { active: this.state.selectedPane === "outline" }), onClick: () => this.showPane("outline"), key: "outline-tab" }, outline )]; } renderTabs() { return _react2.default.createElement( "div", { className: "source-outline-tabs" }, this.renderOutlineTabs() ); } renderShortcut() { if (this.props.horizontal) { var onClick = () => { if (this.props.sourceSearchOn) { return this.props.closeActiveSearch(); } this.props.setActiveSearch("source"); }; return _react2.default.createElement( "span", { className: "sources-header-info", dir: "ltr", onClick: onClick }, L10N.getFormatStr("sources.search", (0, _text.formatKeyShortcut)(L10N.getStr("sources.search.key2"))) ); } } renderOutline() { var selectSource = this.props.selectSource; var outlineComp = (0, _devtoolsConfig.isEnabled)("outline") ? _react2.default.createElement(_Outline2.default, { selectSource: selectSource }) : null; return outlineComp; } renderSources() { var _props = this.props, sources = _props.sources, selectSource = _props.selectSource; return _react2.default.createElement(_SourcesTree2.default, { sources: sources, selectSource: selectSource }); } render() { var selectedPane = this.state.selectedPane; return _react2.default.createElement( "div", { className: "sources-panel" }, this.renderTabs(), selectedPane === "sources" ? this.renderSources() : this.renderOutline() ); } } exports.default = (0, _reactRedux.connect)(state => ({ sources: (0, _selectors.getSources)(state), sourceSearchOn: (0, _selectors.getActiveSearch)(state) === "source" }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(PrimaryPanes); /***/ }), /* 1143 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.loadSourceText = loadSourceText; var _promise = __webpack_require__(193); var _ast = __webpack_require__(1059); function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /** * @memberof actions/sources * @static */ function loadSourceText(source) { return (() => { var _ref = _asyncToGenerator(function* (_ref2) { var dispatch = _ref2.dispatch, getState = _ref2.getState, client = _ref2.client, sourceMaps = _ref2.sourceMaps; // Fetch the source text only once. if (source.text) { return Promise.resolve(source); } yield dispatch({ type: "LOAD_SOURCE_TEXT", source: source, [_promise.PROMISE]: _asyncToGenerator(function* () { if (sourceMaps.isOriginalId(source.id)) { return yield sourceMaps.getOriginalSourceText(source); } var response = yield client.sourceContents(source.id); return { id: source.id, text: response.source, contentType: response.contentType || "text/javascript" }; })() }); yield dispatch((0, _ast.setSymbols)(source.id)); yield dispatch((0, _ast.setEmptyLines)(source.id)); }); return function (_x) { return _ref.apply(this, arguments); }; })(); } /***/ }), /* 1144 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.setSourceSearchQuery = setSourceSearchQuery; exports.clearSourceSearchQuery = clearSourceSearchQuery; function setSourceSearchQuery(queryString) { return (_ref) => { var dispatch = _ref.dispatch, getState = _ref.getState; dispatch({ type: "SET_QUERY_STRING", queryString }); }; } function clearSourceSearchQuery() { return (_ref2) => { var dispatch = _ref2.dispatch, getState = _ref2.getState; dispatch({ type: "CLEAR_QUERY_STRING" }); }; } /***/ }), /* 1145 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Outline = undefined; var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _redux = __webpack_require__(3); var _reactRedux = __webpack_require__(1189); var _actions = __webpack_require__(244); var _actions2 = _interopRequireDefault(_actions); var _selectors = __webpack_require__(242); __webpack_require__(871); var _PreviewFunction = __webpack_require__(798); var _PreviewFunction2 = _interopRequireDefault(_PreviewFunction); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class Outline extends _react.Component { selectItem(location) { var _props = this.props, selectedSource = _props.selectedSource, selectSource = _props.selectSource; if (!selectedSource) { return; } var selectedSourceId = selectedSource.get("id"); var startLine = location.start.line; selectSource(selectedSourceId, { line: startLine }); } renderPlaceholder() { return _react2.default.createElement( "div", { className: "outline-pane-info" }, L10N.getStr("outline.noFunctions") ); } renderFunction(func) { var name = func.name, location = func.location, parameterNames = func.parameterNames; return _react2.default.createElement( "li", { key: `${name}:${location.start.line}:${location.start.column}`, className: "outline-list__element", onClick: () => this.selectItem(location) }, _react2.default.createElement(_PreviewFunction2.default, { func: { name, parameterNames } }) ); } renderFunctions(symbols) { return _react2.default.createElement( "ul", { className: "outline-list" }, symbols.map(func => this.renderFunction(func)) ); } render() { var symbols = this.props.symbols; var symbolsToDisplay = symbols.functions.filter(func => func.name != "anonymous"); return _react2.default.createElement( "div", { className: "outline" }, symbolsToDisplay.length > 0 ? this.renderFunctions(symbolsToDisplay) : this.renderPlaceholder() ); } } exports.Outline = Outline; exports.default = (0, _reactRedux.connect)(state => { var selectedSource = (0, _selectors.getSelectedSource)(state); return { symbols: (0, _selectors.getSymbols)(state, selectedSource && selectedSource.toJS()), selectedSource }; }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Outline); /***/ }), /* 1146 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _reactRedux = __webpack_require__(1189); var _redux = __webpack_require__(3); var _react = __webpack_require__(0); var _actions = __webpack_require__(244); var _actions2 = _interopRequireDefault(_actions); var _selectors = __webpack_require__(242); __webpack_require__(1161); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class EmptyLines extends _react.Component { componentDidMount() { this.disableEmptyLines(); } componentDidUpdate() { this.disableEmptyLines(); } componentWillUnmount() { var _props = this.props, emptyLines = _props.emptyLines, editor = _props.editor; if (!emptyLines) { return; } editor.codeMirror.operation(() => { emptyLines.forEach(line => editor.codeMirror.removeLineClass(line, "line", "empty-line")); }); } disableEmptyLines() { var _props2 = this.props, emptyLines = _props2.emptyLines, editor = _props2.editor; if (!emptyLines) { return; } editor.codeMirror.operation(() => { emptyLines.forEach(line => editor.codeMirror.addLineClass(line, "line", "empty-line")); }); } render() { return null; } } exports.default = (0, _reactRedux.connect)(state => { var selectedSource = (0, _selectors.getSelectedSource)(state); return { selectedSource, emptyLines: selectedSource ? (0, _selectors.getEmptyLines)(state, selectedSource.toJS()) : [] }; }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(EmptyLines); /***/ }), /* 1147 */, /* 1148 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _redux = __webpack_require__(3); var _reactRedux = __webpack_require__(1189); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _reactImmutableProptypes = __webpack_require__(150); var _reactImmutableProptypes2 = _interopRequireDefault(_reactImmutableProptypes); var _immutable = __webpack_require__(146); var _selectors = __webpack_require__(242); var _sourcesTree = __webpack_require__(39); var _ManagedTree = __webpack_require__(419); var _ManagedTree2 = _interopRequireDefault(_ManagedTree); var _actions = __webpack_require__(244); var _actions2 = _interopRequireDefault(_actions); var _Svg = __webpack_require__(344); var _Svg2 = _interopRequireDefault(_Svg); var _devtoolsLaunchpad = __webpack_require__(131); var _clipboard = __webpack_require__(423); var _utils = __webpack_require__(234); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class SourcesTree extends _react.Component { constructor(props) { super(props); this.state = (0, _sourcesTree.createTree)(this.props.sources, this.props.debuggeeUrl); this.focusItem = this.focusItem.bind(this); this.selectItem = this.selectItem.bind(this); this.getIcon = this.getIcon.bind(this); this.onContextMenu = this.onContextMenu.bind(this); this.renderItem = this.renderItem.bind(this); this.queueUpdate = (0, _utils.throttle)(function () { if (!this.mounted) { return; } this.forceUpdate(); }, 50); } componentDidMount() { this.mounted = true; } componentWillUnMount() { this.mounted = false; } shouldComponentUpdate() { this.queueUpdate(); return false; } componentWillReceiveProps(nextProps) { if (this.props.debuggeeUrl !== nextProps.debuggeeUrl) { // Recreate tree because the sort order changed this.setState((0, _sourcesTree.createTree)(nextProps.sources, nextProps.debuggeeUrl)); return; } var selectedSource = this.props.selectedSource; if (nextProps.shownSource && nextProps.shownSource != this.props.shownSource) { var _listItems = (0, _sourcesTree.getDirectories)(nextProps.shownSource, this.state.sourceTree); if (_listItems && _listItems[0]) { this.selectItem(_listItems[0]); } return this.setState({ listItems: _listItems }); } if (nextProps.selectedSource && nextProps.selectedSource != selectedSource) { var _highlightItems = (0, _sourcesTree.getDirectories)(nextProps.selectedSource.get("url"), this.state.sourceTree); return this.setState({ highlightItems: _highlightItems }); } if (nextProps.sources === this.props.sources) { return; } if (nextProps.sources.size === 0) { // remove all sources this.setState((0, _sourcesTree.createTree)(nextProps.sources, this.props.debuggeeUrl)); return; } // TODO: do not run this every time a source is clicked, // only when a new source is added var next = (0, _immutable.Set)(nextProps.sources.valueSeq()); var prev = (0, _immutable.Set)(this.props.sources.valueSeq()); var newSet = next.subtract(prev); var uncollapsedTree = this.state.uncollapsedTree; // TODO: recreating the tree every time messes with the expanded // state of ManagedTree, because it depends on item instances // being the same. The result is that if a source is added at a // later time, all expanded state is lost. var sourceTree = this.state.sourceTree; if (newSet.size > 0) { for (var source of newSet) { (0, _sourcesTree.addToTree)(uncollapsedTree, source, this.props.debuggeeUrl); } var unsortedTree = (0, _sourcesTree.collapseTree)(uncollapsedTree); sourceTree = (0, _sourcesTree.sortEntireTree)(unsortedTree, nextProps.debuggeeUrl); } this.setState({ uncollapsedTree, sourceTree, parentMap: (0, _sourcesTree.createParentMap)(sourceTree) }); } focusItem(item) { this.setState({ focusedItem: item }); } selectItem(item) { if (!(0, _sourcesTree.nodeHasChildren)(item)) { this.props.selectSource(item.contents.get("id")); } } getIcon(item, depth) { if (item.path === "/webpack://") { return _react2.default.createElement(_Svg2.default, { name: "webpack" }); } if (depth === 0) { return _react2.default.createElement(_Svg2.default, { name: "domain" }); } if (!(0, _sourcesTree.nodeHasChildren)(item)) { return _react2.default.createElement(_Svg2.default, { name: "file" }); } return _react2.default.createElement(_Svg2.default, { name: "folder" }); } onContextMenu(event, item) { var copySourceUri2Label = L10N.getStr("copySourceUri2"); var copySourceUri2Key = L10N.getStr("copySourceUri2.accesskey"); event.stopPropagation(); event.preventDefault(); var menuOptions = []; if (!(0, _sourcesTree.isDirectory)(item)) { var source = item.contents.get("url"); var copySourceUri2 = { id: "node-menu-copy-source", label: copySourceUri2Label, accesskey: copySourceUri2Key, disabled: false, click: () => (0, _clipboard.copyToTheClipboard)(source) }; menuOptions.push(copySourceUri2); } (0, _devtoolsLaunchpad.showMenu)(event, menuOptions); } renderItem(item, depth, focused, _, expanded, _ref) { var setExpanded = _ref.setExpanded; var arrow = _react2.default.createElement(_Svg2.default, { name: "arrow", className: (0, _classnames2.default)({ expanded: expanded, hidden: !(0, _sourcesTree.nodeHasChildren)(item) }), onClick: e => { e.stopPropagation(); setExpanded(item, !expanded); } }); var icon = this.getIcon(item, depth); var paddingDir = "paddingRight"; if (document.body && document.body.parentElement) { paddingDir = document.body.parentElement.dir == "ltr" ? "paddingLeft" : "paddingRight"; } return _react2.default.createElement( "div", { className: (0, _classnames2.default)("node", { focused }), style: { [paddingDir]: `${depth * 15}px` }, key: item.path, onClick: () => { this.selectItem(item); setExpanded(item, !expanded); }, onContextMenu: e => this.onContextMenu(e, item) }, arrow, icon, _react2.default.createElement( "span", { className: "label" }, " ", item.name, " " ) ); } render() { var _props = this.props, setExpandedState = _props.setExpandedState, expanded = _props.expanded; var _state = this.state, focusedItem = _state.focusedItem, sourceTree = _state.sourceTree, parentMap = _state.parentMap, listItems = _state.listItems, highlightItems = _state.highlightItems; var isEmpty = sourceTree.contents.length === 0; var treeProps = { key: isEmpty ? "empty" : "full", getParent: item => parentMap.get(item), getChildren: item => (0, _sourcesTree.nodeHasChildren)(item) ? item.contents : [], getRoots: () => sourceTree.contents, getPath: item => `${item.path}/${item.name}`, itemHeight: 21, autoExpandDepth: expanded ? 0 : 1, autoExpandAll: false, onFocus: this.focusItem, listItems, highlightItems, expanded, onExpand: (item, expandedState) => setExpandedState(expandedState), onCollapse: (item, expandedState) => setExpandedState(expandedState), renderItem: this.renderItem }; var tree = _react2.default.createElement(_ManagedTree2.default, treeProps); if (isEmpty) { return _react2.default.createElement( "div", { className: "no-sources-message" }, L10N.getStr("sources.noSourcesAvailable") ); } var onKeyDown = e => { if (e.keyCode === 13 && focusedItem) { this.selectItem(focusedItem); } }; return _react2.default.createElement( "div", { className: "sources-list", onKeyDown: onKeyDown }, tree ); } } SourcesTree.propTypes = { sources: _reactImmutableProptypes2.default.map.isRequired, selectSource: _react.PropTypes.func.isRequired, shownSource: _react.PropTypes.string, selectedSource: _reactImmutableProptypes2.default.map, debuggeeUrl: _react.PropTypes.string.isRequired, setExpandedState: _react.PropTypes.func, expanded: _react.PropTypes.any }; exports.default = (0, _reactRedux.connect)(state => { return { shownSource: (0, _selectors.getShownSource)(state), selectedSource: (0, _selectors.getSelectedSource)(state), debuggeeUrl: (0, _selectors.getDebuggeeUrl)(state), expanded: (0, _selectors.getExpandedState)(state) }; }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(SourcesTree); /***/ }), /* 1149 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Workers = undefined; var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); __webpack_require__(1162); var _reactRedux = __webpack_require__(1189); var _selectors = __webpack_require__(242); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class Workers extends _react.PureComponent { renderWorkers(workers) { return workers.map(w => _react2.default.createElement( "div", { className: "worker", key: w.url }, w.url )); } renderNoWorkersPlaceholder() { return _react2.default.createElement( "div", { className: "pane-info" }, L10N.getStr("noWorkersText") ); } render() { var workers = this.props.workers; return _react2.default.createElement( "div", { className: "pane workers-list" }, workers && workers.size > 0 ? this.renderWorkers(workers) : this.renderNoWorkersPlaceholder() ); } } exports.Workers = Workers; function mapStateToProps(state) { return { workers: (0, _selectors.getWorkers)(state) }; } exports.default = (0, _reactRedux.connect)(mapStateToProps)(Workers); /***/ }), /* 1150 */, /* 1151 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var React = __webpack_require__(0); var InlineSVG = __webpack_require__(346); var svg = { "arrow": __webpack_require__(1152), "open-inspector": __webpack_require__(1153) }; Svg.propTypes = { className: React.PropTypes.string }; function Svg(name, props) { if (!svg[name]) { throw new Error("Unknown SVG: " + name); } var className = name; if (props && props.className) { className = `${name} ${props.className}`; } if (name === "subSettings") { className = ""; } props = Object.assign({}, props, { className, src: svg[name] }); return React.createElement(InlineSVG, props); } module.exports = Svg; /***/ }), /* 1152 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 1153 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 1154 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var _require = __webpack_require__(0), Component = _require.Component, createFactory = _require.createFactory, dom = _require.DOM, PropTypes = _require.PropTypes; var Tree = createFactory(__webpack_require__(1007).Tree); __webpack_require__(878); var classnames = __webpack_require__(175); var Svg = __webpack_require__(1151); var _require2 = __webpack_require__(926), _require2$REPS = _require2.REPS, Rep = _require2$REPS.Rep, Grip = _require2$REPS.Grip; var _require3 = __webpack_require__(925), MODE = _require3.MODE; var _require4 = __webpack_require__(1157), getChildren = _require4.getChildren, getParent = _require4.getParent, getValue = _require4.getValue, nodeHasAccessors = _require4.nodeHasAccessors, nodeHasAllEntriesInPreview = _require4.nodeHasAllEntriesInPreview, nodeHasProperties = _require4.nodeHasProperties, nodeIsDefaultProperties = _require4.nodeIsDefaultProperties, nodeIsEntries = _require4.nodeIsEntries, nodeIsGetter = _require4.nodeIsGetter, nodeIsMapEntry = _require4.nodeIsMapEntry, nodeIsFunction = _require4.nodeIsFunction, nodeIsMissingArguments = _require4.nodeIsMissingArguments, nodeIsOptimizedOut = _require4.nodeIsOptimizedOut, nodeIsPrimitive = _require4.nodeIsPrimitive, nodeIsPrototype = _require4.nodeIsPrototype, nodeIsSetter = _require4.nodeIsSetter, nodeIsWindow = _require4.nodeIsWindow; // This implements a component that renders an interactive inspector // for looking at JavaScript objects. It expects descriptions of // objects from the protocol, and will dynamically fetch child // properties as objects are expanded. // // If you want to inspect a single object, pass the name and the // protocol descriptor of it: // // ObjectInspector({ // name: "foo", // desc: { writable: true, ..., { value: { actor: "1", ... }}}, // ... // }) // // If you want multiple top-level objects (like scopes), you can pass // an array of manually constructed nodes as `roots`: // // ObjectInspector({ // roots: [{ name: ... }, ...], // ... // }); // There are 3 types of nodes: a simple node with a children array, an // object that has properties that should be children when they are // fetched, and a primitive value that should be displayed with no // children. class ObjectInspector extends Component { constructor() { super(); this.actors = {}; this.state = { expandedKeys: new Set(), focusedItem: null }; var self = this; self.getChildren = this.getChildren.bind(this); self.renderTreeItem = this.renderTreeItem.bind(this); self.setExpanded = this.setExpanded.bind(this); self.focusItem = this.focusItem.bind(this); self.getRoots = this.getRoots.bind(this); } getChildren(item) { var _props = this.props, getObjectEntries = _props.getObjectEntries, getObjectProperties = _props.getObjectProperties; var actors = this.actors; return getChildren({ getObjectEntries, getObjectProperties, actors, item }); } getRoots() { return this.props.roots; } getKey(item) { return item.path; } setExpanded(item, expand) { var expandedKeys = this.state.expandedKeys; var key = this.getKey(item); if (expand === true) { expandedKeys.add(key); } else { expandedKeys.delete(key); } this.setState({ expandedKeys }); if (expand === true) { var _props2 = this.props, _getObjectProperties = _props2.getObjectProperties, _getObjectEntries = _props2.getObjectEntries, _loadObjectProperties = _props2.loadObjectProperties, _loadObjectEntries = _props2.loadObjectEntries; var _value = getValue(item); var parent = getParent(item); var parentValue = getValue(parent); var parentActor = parentValue ? parentValue.actor : null; if (nodeHasProperties(item) && _value && !_getObjectProperties(_value.actor)) { _loadObjectProperties(_value); } if (nodeIsEntries(item) && !nodeHasAllEntriesInPreview(parent) && parentActor && !_getObjectEntries(parentActor)) { _loadObjectEntries(parentValue); } } } focusItem(item) { if (!this.props.disabledFocus && this.state.focusedItem !== item) { this.setState({ focusedItem: item }); if (this.props.onFocus) { this.props.onFocus(item); } } } renderTreeItem(item, depth, focused, arrow, expanded) { var objectValue = void 0; var label = item.name; var itemValue = getValue(item); var isPrimitive = nodeIsPrimitive(item); var unavailable = isPrimitive && itemValue && itemValue.hasOwnProperty && itemValue.hasOwnProperty("unavailable"); if (nodeIsOptimizedOut(item)) { objectValue = dom.span({ className: "unavailable" }, "(optimized away)"); } else if (nodeIsMissingArguments(item) || unavailable) { objectValue = dom.span({ className: "unavailable" }, "(unavailable)"); } else if (nodeIsFunction(item) && !nodeIsGetter(item) && !nodeIsSetter(item) && (this.props.mode === MODE.TINY || !this.props.mode)) { objectValue = undefined; label = this.renderGrip(item, Object.assign({}, this.props, { functionName: label })); } else if (nodeHasProperties(item) || nodeHasAccessors(item) || nodeIsMapEntry(item) || isPrimitive) { var repsProp = Object.assign({}, this.props); if (depth > 0) { repsProp.mode = this.props.mode === MODE.LONG ? MODE.SHORT : MODE.TINY; } objectValue = this.renderGrip(item, repsProp); } var hasLabel = label !== null && typeof label !== "undefined"; var hasValue = typeof objectValue !== "undefined"; var SINGLE_INDENT_WIDTH = 15; var indentWidth = (depth + (isPrimitive ? 1 : 0)) * SINGLE_INDENT_WIDTH; var _props3 = this.props, onDoubleClick = _props3.onDoubleClick, onLabelClick = _props3.onLabelClick, dimTopLevelWindow = _props3.dimTopLevelWindow; return dom.div({ className: classnames("node object-node", { focused, lessen: !expanded && (nodeIsDefaultProperties(item) || nodeIsPrototype(item) || dimTopLevelWindow === true && nodeIsWindow(item) && depth === 0) }), style: { marginLeft: indentWidth }, onClick: isPrimitive === false ? e => { e.stopPropagation(); this.setExpanded(item, !expanded); } : null, onDoubleClick: onDoubleClick ? e => { e.stopPropagation(); onDoubleClick(item, { depth, focused, expanded }); } : null }, isPrimitive === false ? Svg("arrow", { className: classnames({ expanded: expanded }) }) : null, hasLabel ? dom.span({ className: "object-label", onClick: onLabelClick ? event => { event.stopPropagation(); onLabelClick(item, { depth, focused, expanded, setExpanded: this.setExpanded }); } : null }, label) : null, hasLabel && hasValue ? dom.span({ className: "object-delimiter" }, " : ") : null, hasValue ? objectValue : null); } renderGrip(item, props) { var object = getValue(item); return Rep(Object.assign({}, props, { object, mode: props.mode || MODE.TINY, defaultRep: Grip })); } render() { var _props4 = this.props, _props4$autoExpandDep = _props4.autoExpandDepth, autoExpandDepth = _props4$autoExpandDep === undefined ? 1 : _props4$autoExpandDep, _props4$autoExpandAll = _props4.autoExpandAll, autoExpandAll = _props4$autoExpandAll === undefined ? true : _props4$autoExpandAll, disabledFocus = _props4.disabledFocus, inline = _props4.inline, _props4$itemHeight = _props4.itemHeight, itemHeight = _props4$itemHeight === undefined ? 20 : _props4$itemHeight, _props4$disableWrap = _props4.disableWrap, disableWrap = _props4$disableWrap === undefined ? false : _props4$disableWrap; var _state = this.state, expandedKeys = _state.expandedKeys, focusedItem = _state.focusedItem; var roots = this.getRoots(); if (roots.length === 1) { var root = roots[0]; var name = root && root.name; if (nodeIsPrimitive(root) && (name === null || typeof name === "undefined")) { return this.renderGrip(root, this.props); } } return Tree({ className: classnames({ inline, nowrap: disableWrap }), autoExpandAll, autoExpandDepth, disabledFocus, itemHeight, isExpanded: item => expandedKeys.has(this.getKey(item)), focused: focusedItem, getRoots: this.getRoots, getParent, getChildren: this.getChildren, getKey: this.getKey, onExpand: item => this.setExpanded(item, true), onCollapse: item => this.setExpanded(item, false), onFocus: this.focusItem, renderItem: this.renderTreeItem }); } } ObjectInspector.displayName = "ObjectInspector"; ObjectInspector.propTypes = { autoExpandAll: PropTypes.bool, autoExpandDepth: PropTypes.number, disabledFocus: PropTypes.bool, disableWrap: PropTypes.bool, inline: PropTypes.bool, roots: PropTypes.array, getObjectProperties: PropTypes.func.isRequired, loadObjectProperties: PropTypes.func.isRequired, itemHeight: PropTypes.number, mode: PropTypes.oneOf(Object.values(MODE)), onFocus: PropTypes.func, onDoubleClick: PropTypes.func, onLabelClick: PropTypes.func }; module.exports = ObjectInspector; /***/ }), /* 1155 */, /* 1156 */, /* 1157 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); 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); } } /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var get = __webpack_require__(67); var has = __webpack_require__(307); var _require = __webpack_require__(927), maybeEscapePropertyName = _require.maybeEscapePropertyName; var ArrayRep = __webpack_require__(934); var GripArrayRep = __webpack_require__(958); var GripMapEntryRep = __webpack_require__(42); var NODE_TYPES = { BUCKET: Symbol("[n…n]"), DEFAULT_PROPERTIES: Symbol("[default properties]"), ENTRIES: Symbol(""), GET: Symbol(""), GRIP: Symbol("GRIP"), MAP_ENTRY_KEY: Symbol(""), MAP_ENTRY_VALUE: Symbol(""), PROMISE_REASON: Symbol(""), PROMISE_STATE: Symbol(""), PROMISE_VALUE: Symbol(""), SET: Symbol(""), PROTOTYPE: Symbol("__proto__") }; var WINDOW_PROPERTIES = {}; if (typeof window === "object") { WINDOW_PROPERTIES = Object.getOwnPropertyNames(window); } var SAFE_PATH_PREFIX = "##-"; function getType(item) { return item.type; } function getValue(item) { if (has(item, "contents.value")) { return get(item, "contents.value"); } if (has(item, "contents.getterValue")) { return get(item, "contents.getterValue", undefined); } if (nodeHasAccessors(item)) { return item.contents; } return undefined; } function nodeIsBucket(item) { return getType(item) === NODE_TYPES.BUCKET; } function nodeIsEntries(item) { return getType(item) === NODE_TYPES.ENTRIES; } function nodeIsMapEntry(item) { return GripMapEntryRep.supportsObject(getValue(item)); } function nodeHasChildren(item) { return Array.isArray(item.contents) || nodeIsBucket(item); } function nodeIsObject(item) { var value = getValue(item); return value && value.type === "object"; } function nodeIsArrayLike(item) { var value = getValue(item); return GripArrayRep.supportsObject(value) || ArrayRep.supportsObject(value); } function nodeIsFunction(item) { var value = getValue(item); return value && value.class === "Function"; } function nodeIsOptimizedOut(item) { var value = getValue(item); return !nodeHasChildren(item) && value && value.optimizedOut; } function nodeIsMissingArguments(item) { var value = getValue(item); return !nodeHasChildren(item) && value && value.missingArguments; } function nodeHasProperties(item) { return !nodeHasChildren(item) && nodeIsObject(item); } function nodeIsPrimitive(item) { return !nodeHasChildren(item) && !nodeHasProperties(item) && !nodeIsEntries(item) && !nodeIsMapEntry(item) && !nodeHasAccessors(item); } function nodeIsDefaultProperties(item) { return getType(item) === NODE_TYPES.DEFAULT_PROPERTIES; } function isDefaultWindowProperty(name) { return WINDOW_PROPERTIES.includes(name); } function nodeIsPromise(item) { var value = getValue(item); if (!value) { return false; } return value.class == "Promise"; } function nodeIsPrototype(item) { return getType(item) === NODE_TYPES.PROTOTYPE; } function nodeIsWindow(item) { var value = getValue(item); if (!value) { return false; } return value.class == "Window"; } function nodeIsGetter(item) { return getType(item) === NODE_TYPES.GET; } function nodeIsSetter(item) { return getType(item) === NODE_TYPES.SET; } function nodeHasAccessors(item) { return !!getNodeGetter(item) || !!getNodeSetter(item); } function nodeSupportsBucketing(item) { return nodeIsArrayLike(item) || nodeIsEntries(item); } function nodeHasEntries(item) { var value = getValue(item); if (!value) { return false; } return value.class === "Map" || value.class === "Set" || value.class === "WeakMap" || value.class === "WeakSet"; } function nodeHasAllEntriesInPreview(item) { var _ref = getValue(item) || {}, preview = _ref.preview; if (!preview) { return false; } var entries = preview.entries, items = preview.items, length = preview.length, size = preview.size; return entries ? entries.length === size : items.length === length; } function makeNodesForPromiseProperties(item) { var _getValue = getValue(item), _getValue$promiseStat = _getValue.promiseState, reason = _getValue$promiseStat.reason, value = _getValue$promiseStat.value, state = _getValue$promiseStat.state; var properties = []; if (state) { properties.push(createNode(item, "", `${item.path}/${SAFE_PATH_PREFIX}state`, { value: state }, NODE_TYPES.PROMISE_STATE)); } if (reason) { properties.push(createNode(item, "", `${item.path}/${SAFE_PATH_PREFIX}reason`, { value: reason }, NODE_TYPES.PROMISE_REASON)); } if (value) { properties.push(createNode(item, "", `${item.path}/${SAFE_PATH_PREFIX}value`, { value: value }, NODE_TYPES.PROMISE_VALUE)); } return properties; } function makeNodesForEntries(item) { var path = item.path; var _getValue2 = getValue(item), preview = _getValue2.preview; var nodeName = ""; var entriesPath = `${path}/${SAFE_PATH_PREFIX}entries`; if (nodeHasAllEntriesInPreview(item)) { var entriesNodes = []; if (preview.entries) { entriesNodes = preview.entries.map((_ref2, index) => { var _ref3 = _slicedToArray(_ref2, 2), key = _ref3[0], value = _ref3[1]; return createNode(item, index, `${entriesPath}/${index}`, { value: GripMapEntryRep.createGripMapEntry(key, value) }); }); } else if (preview.items) { entriesNodes = preview.items.map((value, index) => { return createNode(item, index, `${entriesPath}/${index}`, { value }); }); } return createNode(item, nodeName, entriesPath, entriesNodes, NODE_TYPES.ENTRIES); } return createNode(item, nodeName, entriesPath, null, NODE_TYPES.ENTRIES); } function makeNodesForMapEntry(item) { var nodeValue = getValue(item); if (!nodeValue || !nodeValue.preview) { return []; } var _nodeValue$preview = nodeValue.preview, key = _nodeValue$preview.key, value = _nodeValue$preview.value; var path = item.path; return [createNode(item, "", `${path}/##key`, { value: key }, NODE_TYPES.MAP_ENTRY_KEY), createNode(item, "", `${path}/##value`, { value }, NODE_TYPES.MAP_ENTRY_VALUE)]; } function getNodeGetter(item) { return get(item, "contents.get", undefined); } function getNodeSetter(item) { return get(item, "contents.set", undefined); } function makeNodesForAccessors(item) { var accessors = []; var getter = getNodeGetter(item); if (getter && getter.type !== "undefined") { accessors.push(createNode(item, "", `${item.path}/${SAFE_PATH_PREFIX}get`, { value: getter }, NODE_TYPES.GET)); } var setter = getNodeSetter(item); if (setter && setter.type !== "undefined") { accessors.push(createNode(item, "", `${item.path}/${SAFE_PATH_PREFIX}set`, { value: setter }, NODE_TYPES.SET)); } return accessors; } function sortProperties(properties) { return properties.sort((a, b) => { // Sort numbers in ascending order and sort strings lexicographically var aInt = parseInt(a, 10); var bInt = parseInt(b, 10); if (isNaN(aInt) || isNaN(bInt)) { return a > b ? 1 : -1; } return aInt - bInt; }); } function makeNumericalBuckets(propertiesNames, parent, ownProperties) { var startIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; var parentPath = parent.path; var numProperties = propertiesNames.length; // We want to have at most a hundred slices. var bucketSize = 10 ** Math.max(2, Math.ceil(Math.log10(numProperties)) - 2); var numBuckets = Math.ceil(numProperties / bucketSize); var buckets = []; for (var i = 1; i <= numBuckets; i++) { var minKey = (i - 1) * bucketSize; var maxKey = Math.min(i * bucketSize - 1, numProperties - 1); if (maxKey === minKey) { var name = propertiesNames[maxKey]; buckets.push(createNode(parent, name, `${parentPath}/${name}`, ownProperties[name])); } else { (function () { var minIndex = startIndex + minKey; var maxIndex = startIndex + maxKey; var bucketKey = `${SAFE_PATH_PREFIX}bucket_${minIndex}-${maxIndex}`; var bucketName = `[${minIndex}…${maxIndex}]`; var bucketRoot = createNode(parent, bucketName, `${parentPath}/${bucketKey}`, [], NODE_TYPES.BUCKET); var bucketProperties = propertiesNames.slice(minKey, maxKey + 1); var bucketNodes = void 0; if (bucketProperties.length <= 100) { bucketNodes = bucketProperties.map(name => createNode(bucketRoot, name, `${parentPath}/${bucketKey}/${name}`, ownProperties[name])); } else { bucketNodes = makeNumericalBuckets(bucketProperties, bucketRoot, ownProperties, minIndex); } setNodeChildren(bucketRoot, bucketNodes); buckets.push(bucketRoot); })(); } } return buckets; } function makeDefaultPropsBucket(propertiesNames, parent, ownProperties) { var parentPath = parent.path; var userPropertiesNames = []; var defaultProperties = []; propertiesNames.forEach(name => { if (isDefaultWindowProperty(name)) { defaultProperties.push(name); } else { userPropertiesNames.push(name); } }); var nodes = makeNodesForOwnProps(userPropertiesNames, parent, ownProperties); if (defaultProperties.length > 0) { var defaultPropertiesNode = createNode(parent, "[default properties]", `${parentPath}/${SAFE_PATH_PREFIX}default`, null, NODE_TYPES.DEFAULT_PROPERTIES); var defaultNodes = defaultProperties.map((name, index) => createNode(defaultPropertiesNode, maybeEscapePropertyName(name), `${parentPath}/${SAFE_PATH_PREFIX}bucket${index}/${name}`, ownProperties[name])); nodes.push(setNodeChildren(defaultPropertiesNode, defaultNodes)); } return nodes; } function makeNodesForOwnProps(propertiesNames, parent, ownProperties) { var parentPath = parent.path; return propertiesNames.map(name => createNode(parent, maybeEscapePropertyName(name), `${parentPath}/${name}`, ownProperties[name])); } function makeNodesForProperties(objProps, parent) { var _objProps$ownProperti = objProps.ownProperties, ownProperties = _objProps$ownProperti === undefined ? {} : _objProps$ownProperti, ownSymbols = objProps.ownSymbols, prototype = objProps.prototype, safeGetterValues = objProps.safeGetterValues; var parentPath = parent.path; var parentValue = getValue(parent); var allProperties = Object.assign({}, ownProperties, safeGetterValues); // Ignore properties that are neither non-concrete nor getters/setters. var propertiesNames = sortProperties(Object.keys(allProperties)).filter(name => allProperties[name].hasOwnProperty("value") || allProperties[name].hasOwnProperty("getterValue") || allProperties[name].hasOwnProperty("get") || allProperties[name].hasOwnProperty("set")); var numProperties = propertiesNames.length; var nodes = []; if (nodeSupportsBucketing(parent) && numProperties > 100) { nodes = makeNumericalBuckets(propertiesNames, parent, allProperties); } else if (parentValue && parentValue.class == "Window") { nodes = makeDefaultPropsBucket(propertiesNames, parent, allProperties); } else { nodes = makeNodesForOwnProps(propertiesNames, parent, allProperties); } if (Array.isArray(ownSymbols)) { ownSymbols.forEach((ownSymbol, index) => { nodes.push(createNode(parent, ownSymbol.name, `${parentPath}/${SAFE_PATH_PREFIX}symbol-${index}`, ownSymbol.descriptor)); }, this); } if (nodeIsPromise(parent)) { var _nodes; (_nodes = nodes).push.apply(_nodes, _toConsumableArray(makeNodesForPromiseProperties(parent))); } if (nodeHasEntries(parent)) { nodes.push(makeNodesForEntries(parent)); } // Add the prototype if it exists and is not null if (prototype && prototype.type !== "null") { nodes.push(createNode(parent, "__proto__", `${parentPath}/__proto__`, { value: prototype }, NODE_TYPES.PROTOTYPE)); } return nodes; } function createNode(parent, name, path, contents) { var type = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : NODE_TYPES.GRIP; if (contents === undefined) { return null; } // The path is important to uniquely identify the item in the entire // tree. This helps debugging & optimizes React's rendering of large // lists. The path will be separated by property name, // i.e. `{ foo: { bar: { baz: 5 }}}` will have a path of `foo/bar/baz` // for the inner object. return { parent, name, path, contents, type }; } function setNodeChildren(node, children) { node.contents = children; return node; } function getChildren(options) { var _options$actors = options.actors, actors = _options$actors === undefined ? {} : _options$actors, getObjectEntries = options.getObjectEntries, getObjectProperties = options.getObjectProperties, item = options.item; // Nodes can either have children already, or be an object with // properties that we need to go and fetch. if (nodeHasAccessors(item)) { return makeNodesForAccessors(item); } if (nodeIsMapEntry(item)) { return makeNodesForMapEntry(item); } if (nodeHasChildren(item)) { return item.contents; } if (!nodeHasProperties(item) && !nodeIsEntries(item)) { return []; } // Because we are dynamically creating the tree as the user // expands it (not precalculated tree structure), we cache child // arrays. This not only helps performance, but is necessary // because the expanded state depends on instances of nodes // being the same across renders. If we didn't do this, each // node would be a new instance every render. var key = item.path; if (actors && actors[key]) { return actors[key]; } if (nodeIsBucket(item)) { return item.contents.children; } var loadedProps = void 0; if (nodeIsEntries(item)) { // If `item` is an node, we need to get the entries // matching the parent node actor. var parent = getParent(item); loadedProps = getObjectEntries(get(getValue(parent), "actor", undefined)); } else { loadedProps = getObjectProperties(get(getValue(item), "actor", undefined)); } var _ref4 = loadedProps || {}, ownProperties = _ref4.ownProperties, ownSymbols = _ref4.ownSymbols, safeGetterValues = _ref4.safeGetterValues, prototype = _ref4.prototype; if (!ownProperties && !ownSymbols && !safeGetterValues && !prototype) { return []; } var children = makeNodesForProperties(loadedProps, item); actors[key] = children; return children; } function getParent(item) { return item.parent; } module.exports = { createNode, getChildren, getParent, getValue, makeNodesForEntries, makeNodesForPromiseProperties, makeNodesForProperties, nodeHasAccessors, nodeHasAllEntriesInPreview, nodeHasChildren, nodeHasEntries, nodeHasProperties, nodeIsDefaultProperties, nodeIsEntries, nodeIsFunction, nodeIsGetter, nodeIsMapEntry, nodeIsMissingArguments, nodeIsObject, nodeIsOptimizedOut, nodeIsPrimitive, nodeIsPromise, nodeIsPrototype, nodeIsSetter, nodeIsWindow, nodeSupportsBucketing, setNodeChildren, sortProperties, NODE_TYPES, // Export for testing purpose. SAFE_PATH_PREFIX }; /***/ }), /* 1158 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _reactRedux = __webpack_require__(1189); var _redux = __webpack_require__(3); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _Breakpoint = __webpack_require__(714); var _Breakpoint2 = _interopRequireDefault(_Breakpoint); var _actions = __webpack_require__(244); var _actions2 = _interopRequireDefault(_actions); var _selectors = __webpack_require__(242); var _visibleBreakpoints = __webpack_require__(1135); var _visibleBreakpoints2 = _interopRequireDefault(_visibleBreakpoints); var _breakpoint = __webpack_require__(1057); var _source = __webpack_require__(233); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class Breakpoints extends _react.Component { shouldComponentUpdate(nextProps) { if (nextProps.selectedSource && !(0, _source.isLoaded)(nextProps.selectedSource.toJS())) { return false; } return true; } render() { var _props = this.props, breakpoints = _props.breakpoints, selectedSource = _props.selectedSource, editor = _props.editor; if (!selectedSource || !breakpoints || selectedSource.get("isBlackBoxed")) { return null; } return _react2.default.createElement( "div", null, breakpoints.valueSeq().map(bp => { return _react2.default.createElement(_Breakpoint2.default, { key: (0, _breakpoint.makeLocationId)(bp.location), breakpoint: bp, selectedSource: selectedSource, editor: editor }); }) ); } } exports.default = (0, _reactRedux.connect)(state => ({ breakpoints: (0, _visibleBreakpoints2.default)(state), selectedSource: (0, _selectors.getSelectedSource)(state) }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Breakpoints); /***/ }), /* 1159 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: 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; }; var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactRedux = __webpack_require__(1189); var _redux = __webpack_require__(3); var _devtoolsConfig = __webpack_require__(828); var _lodash = __webpack_require__(2); var _CallSite = __webpack_require__(1167); var _CallSite2 = _interopRequireDefault(_CallSite); var _selectors = __webpack_require__(242); var _editor = __webpack_require__(257); var _actions = __webpack_require__(244); var _actions2 = _interopRequireDefault(_actions); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function getCallSiteAtLocation(callSites, location) { return (0, _lodash.find)(callSites, callSite => (0, _lodash.isEqualWith)(callSite.location, location, (cloc, loc) => { return loc.line === cloc.start.line && loc.column >= cloc.start.column && loc.column <= cloc.end.column; })); } class CallSites extends _react.Component { constructor(props) { super(props); this.onKeyDown = this.onKeyDown.bind(this); this.onKeyUp = this.onKeyUp.bind(this); this.state = { showCallSites: false }; } componentDidMount() { var editor = this.props.editor; var codeMirrorWrapper = editor.codeMirror.getWrapperElement(); codeMirrorWrapper.addEventListener("click", e => this.onTokenClick(e)); document.body.addEventListener("keydown", this.onKeyDown); document.body.addEventListener("keyup", this.onKeyUp); } componentDidUnMount() { var editor = this.props.editor; var codeMirrorWrapper = editor.codeMirror.getWrapperElement(); codeMirrorWrapper.addEventListener("click", e => this.onTokenClick(e)); document.body.removeEventListener("keydown", e => this.onKeyDown); document.body.removeEventListener("keyup", this.onKeyUp); } onKeyUp(e) { if (e.key === "Alt") { e.preventDefault(); this.setState({ showCallSites: false }); } } onKeyDown(e) { if (e.key === "Alt") { e.preventDefault(); this.setState({ showCallSites: true }); } } onTokenClick(e) { var target = e.target; var _props = this.props, editor = _props.editor, selectedLocation = _props.selectedLocation; if (!(0, _devtoolsConfig.isEnabled)("columnBreakpoints") || !e.altKey && !target.classList.contains("call-site-bp") || !target.classList.contains("call-site") && !target.classList.contains("call-site-bp")) { return; } var sourceId = selectedLocation.sourceId; var _getTokenLocation = (0, _editor.getTokenLocation)(editor.codeMirror, target), line = _getTokenLocation.line, column = _getTokenLocation.column; this.toggleBreakpoint(line, (0, _editor.isWasm)(sourceId) ? undefined : column); } toggleBreakpoint(line) { var column = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; var _props2 = this.props, selectedSource = _props2.selectedSource, selectedLocation = _props2.selectedLocation, addBreakpoint = _props2.addBreakpoint, removeBreakpoint = _props2.removeBreakpoint, callSites = _props2.callSites; var callSite = getCallSiteAtLocation(callSites, { line, column }); if (!callSite) { return; } var bp = callSite.breakpoint; if (bp && bp.loading || !selectedLocation || !selectedSource) { return; } var sourceId = selectedLocation.sourceId; if (bp) { // NOTE: it's possible the breakpoint has slid to a column column = column || bp.location.column; removeBreakpoint({ sourceId: sourceId, line: line, column }); } else { addBreakpoint({ sourceId: sourceId, sourceUrl: selectedSource.get("url"), line: line, column: column }); } } render() { var _props3 = this.props, editor = _props3.editor, callSites = _props3.callSites, selectedSource = _props3.selectedSource; var showCallSites = this.state.showCallSites; var sites = void 0; if (!callSites) { return null; } editor.codeMirror.operation(() => { var childCallSites = callSites.map((callSite, index) => { var props = { key: index, callSite, editor, source: selectedSource, breakpoint: callSite.breakpoint, showCallSite: showCallSites }; return _react2.default.createElement(_CallSite2.default, props); }); sites = _react2.default.createElement( "div", null, childCallSites ); }); return sites; } } function getCallSites(symbols, breakpoints) { if (!symbols || !symbols.callExpressions) { return; } var callSites = symbols.callExpressions; // NOTE: we create a breakpoint map keyed on location // to speed up the lookups. Hopefully we'll fix the // inconsistency with column offsets so that we can expect // a breakpoint to be added at the beginning of a call expression. var bpLocationMap = (0, _lodash.keyBy)(breakpoints.valueSeq().toJS(), (_ref) => { var location = _ref.location; return locationKey(location); }); function locationKey(_ref2) { var line = _ref2.line, column = _ref2.column; return `${line}/${column}`; } function findBreakpoint(callSite) { var _callSite$location = callSite.location, start = _callSite$location.start, end = _callSite$location.end; var breakpointId = (0, _lodash.range)(start.column - 1, end.column).map(column => locationKey({ line: start.line, column })).find(key => bpLocationMap[key]); if (breakpointId) { return bpLocationMap[breakpointId]; } } return callSites.filter((_ref3) => { var location = _ref3.location; return location.start.line === location.end.line; }).map(callSite => _extends({}, callSite, { breakpoint: findBreakpoint(callSite) })); } exports.default = (0, _reactRedux.connect)(state => { var selectedLocation = (0, _selectors.getSelectedLocation)(state); var selectedSource = (0, _selectors.getSelectedSource)(state); var sourceId = selectedLocation && selectedLocation.sourceId; var source = selectedSource && selectedSource.toJS(); var symbols = (0, _selectors.getSymbols)(state, source); var breakpoints = (0, _selectors.getBreakpointsForSource)(state, sourceId); return { selectedLocation, selectedSource, callSites: getCallSites(symbols, breakpoints), breakpoints: breakpoints }; }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(CallSites); /***/ }), /* 1160 */, /* 1161 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1162 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1163 */, /* 1164 */, /* 1165 */ /***/ (function(module, exports, __webpack_require__) { /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ const networkRequest = __webpack_require__(1166); const workerUtils = __webpack_require__(1168); module.exports = { networkRequest, workerUtils }; /***/ }), /* 1166 */ /***/ (function(module, exports) { /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ function networkRequest(url, opts) { return fetch(url, { cache: opts.loadFromCache ? "default" : "no-cache" }).then(res => { if (res.status >= 200 && res.status < 300) { return res.text().then(text => ({ content: text })); } return Promise.reject(`request failed with status ${res.status}`); }); } module.exports = networkRequest; /***/ }), /* 1167 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _editor = __webpack_require__(257); __webpack_require__(882); class CallSite extends _react.Component { constructor() { super(); this.marker = undefined; var self = this; self.addCallSite = this.addCallSite.bind(this); self.clearCallSite = this.clearCallSite.bind(this); } addCallSite(nextProps) { var _ref = nextProps || this.props, editor = _ref.editor, callSite = _ref.callSite, breakpoint = _ref.breakpoint, source = _ref.source; var className = !breakpoint ? "call-site" : "call-site-bp"; var sourceId = source.get("id"); var editorRange = (0, _editor.toEditorRange)(sourceId, callSite.location); this.marker = (0, _editor.markText)(editor, className, editorRange); } clearCallSite() { if (this.marker) { this.marker.clear(); this.marker = null; } } shouldComponentUpdate(nextProps) { return this.props.editor !== nextProps.editor; } componentDidMount() { var _props = this.props, breakpoint = _props.breakpoint, showCallSite = _props.showCallSite; if (!breakpoint && !showCallSite) { return; } this.addCallSite(); } componentWillReceiveProps(nextProps) { var _props2 = this.props, breakpoint = _props2.breakpoint, showCallSite = _props2.showCallSite; if (nextProps.breakpoint !== breakpoint) { if (this.marker) { this.clearCallSite(); } if (nextProps.showCallSite) { this.addCallSite(nextProps); } } if (nextProps.showCallSite !== showCallSite) { if (nextProps.showCallSite) { if (!this.marker) { this.addCallSite(); } } else if (!nextProps.breakpoint) { this.clearCallSite(); } } } componentWillUnmount() { if (!this.marker) { return; } this.marker.clear(); } render() { return null; } } exports.default = CallSite; /***/ }), /* 1168 */ /***/ (function(module, exports) { function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } function WorkerDispatcher() { this.msgId = 1; this.worker = null; } /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ WorkerDispatcher.prototype = { start(url) { this.worker = new Worker(url); this.worker.onerror = () => { console.error(`Error in worker ${url}`); }; }, stop() { if (!this.worker) { return; } this.worker.terminate(); this.worker = null; }, task(method) { return (...args) => { return new Promise((resolve, reject) => { const id = this.msgId++; this.worker.postMessage({ id, method, args }); const listener = ({ data: result }) => { if (result.id !== id) { return; } this.worker.removeEventListener("message", listener); if (result.error) { reject(result.error); } else { resolve(result.response); } }; this.worker.addEventListener("message", listener); }); }; } }; function workerHandler(publicInterface) { return function (msg) { const { id, method, args } = msg.data; try { const response = publicInterface[method].apply(undefined, args); if (response instanceof Promise) { response.then(val => self.postMessage({ id, response: val }), // Error can't be sent via postMessage, so be sure to // convert to string. err => self.postMessage({ id, error: err.toString() })); } else { self.postMessage({ id, response }); } } catch (error) { // Error can't be sent via postMessage, so be sure to convert to // string. self.postMessage({ id, error: error.toString() }); } }; } function streamingWorkerHandler(publicInterface, { timeout = 100 } = {}, worker = self) { let streamingWorker = (() => { var _ref = _asyncToGenerator(function* (id, tasks) { let isWorking = true; const intervalId = setTimeout(function () { isWorking = false; }, timeout); const results = []; while (tasks.length !== 0 && isWorking) { const { callback, context, args } = tasks.shift(); const result = yield callback.call(context, args); results.push(result); } worker.postMessage({ id, status: "pending", data: results }); clearInterval(intervalId); if (tasks.length !== 0) { yield streamingWorker(id, tasks); } }); return function streamingWorker(_x, _x2) { return _ref.apply(this, arguments); }; })(); return (() => { var _ref2 = _asyncToGenerator(function* (msg) { const { id, method, args } = msg.data; const workerMethod = publicInterface[method]; if (!workerMethod) { console.error(`Could not find ${method} defined in worker.`); } worker.postMessage({ id, status: "start" }); try { const tasks = workerMethod(args); yield streamingWorker(id, tasks); worker.postMessage({ id, status: "done" }); } catch (error) { worker.postMessage({ id, status: "error", error }); } }); return function (_x3) { return _ref2.apply(this, arguments); }; })(); } module.exports = { WorkerDispatcher, workerHandler, streamingWorkerHandler }; /***/ }), /* 1169 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.findFunctionText = findFunctionText; var _astBreakpointLocation = __webpack_require__(804); 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); } } function getIndentation(lines) { var firstLine = lines[0]; var secondLine = lines[1]; var lastLine = lines[lines.length - 1]; var _getIndentation = line => line && line.match(/^\s*/)[0].length; var indentations = [_getIndentation(firstLine), _getIndentation(secondLine), _getIndentation(lastLine)]; return Math.max.apply(Math, indentations.concat([0])); } function findFunctionText(line, source, symbols) { var func = (0, _astBreakpointLocation.findClosestScope)(symbols.functions, { line, column: Infinity }); if (!func) { return null; } var _func$location = func.location, start = _func$location.start, end = _func$location.end; var lines = source.text.split("\n"); var firstLine = lines[start.line - 1].slice(start.column); var lastLine = lines[end.line - 1].slice(0, end.column); var middle = lines.slice(start.line, end.line - 1); var functionLines = [firstLine].concat(_toConsumableArray(middle), [lastLine]); var indentation = getIndentation(functionLines); var formattedLines = functionLines.map(_line => _line.replace(new RegExp(`^\\s{0,${indentation - 1}}`), "")); return formattedLines.join("\n").trim(); } /***/ }), /* 1170 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactRedux = __webpack_require__(1189); var _redux = __webpack_require__(3); var _fuzzaldrinPlus = __webpack_require__(161); var _selectors = __webpack_require__(242); var _actions = __webpack_require__(244); var _actions2 = _interopRequireDefault(_actions); var _resultList = __webpack_require__(343); var _Modal = __webpack_require__(332); var _Modal2 = _interopRequireDefault(_Modal); var _SearchInput = __webpack_require__(377); var _SearchInput2 = _interopRequireDefault(_SearchInput); var _ResultList = __webpack_require__(383); var _ResultList2 = _interopRequireDefault(_ResultList); __webpack_require__(962); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function formatSymbol(symbol) { return { id: `${symbol.name}:${symbol.location.start.line}`, title: symbol.name, subtitle: `:${symbol.location.start.line}`, value: symbol.name, location: symbol.location }; } class SymbolModal extends _react.Component { constructor(props) { super(props); this.state = { results: null, query: "", resultsIndex: 0 }; var self = this; self.onClick = this.onClick.bind(this); self.closeModal = this.closeModal.bind(this); self.onChange = this.onChange.bind(this); self.onKeyUp = this.onKeyUp.bind(this); self.updateResults = this.updateResults.bind(this); self.traverseResults = this.traverseResults.bind(this); self.renderResults = this.renderResults.bind(this); self.buildSummaryMsg = this.buildSummaryMsg.bind(this); self.buildPlaceHolder = this.buildPlaceHolder.bind(this); self.selectResultItem = this.selectResultItem.bind(this); } componentDidMount() { this.updateResults(this.state.query); } componentDidUpdate(prevProps, prevState) { if (this.refs.resultList && this.refs.resultList.refs) { (0, _resultList.scrollList)(this.refs.resultList.refs, this.state.resultsIndex); } if (!prevProps.enabled && this.props.enabled) { this.updateResults(this.state.query); } } onClick(e) { e.stopPropagation(); } onChange(e) { var selectedSource = this.props.selectedSource; if (!selectedSource || !selectedSource.get("text")) { return; } this.setState({ query: e.target.value }); return this.updateResults(e.target.value); } closeModal() { this.props.closeActiveSearch(); this.props.clearHighlightLineRange(); } selectResultItem(e, item) { var _props = this.props, selectSource = _props.selectSource, selectedSource = _props.selectedSource; if (!selectedSource || !item) { return; } selectSource(selectedSource.get("id"), { line: item.location.start.line }); this.closeModal(); } updateResults(query) { var _props2 = this.props, symbolType = _props2.symbolType, symbols = _props2.symbols; var symbolSearchResults = symbols[symbolType]; if (query == "") { this.setState({ results: symbolSearchResults }); return; } symbolSearchResults = (0, _fuzzaldrinPlus.filter)(symbolSearchResults, query, { key: "value" }); this.setState({ results: symbolSearchResults }); } traverseResults(direction) { var _state = this.state, resultsIndex = _state.resultsIndex, results = _state.results; var resultCount = this.resultsCount(); var index = resultsIndex + direction; var nextIndex = (index + resultCount) % resultCount; this.setState({ resultsIndex: nextIndex }); if (results) { this.onSelectResultItem(results[nextIndex]); } } onSelectResultItem(item) { var _props3 = this.props, selectSource = _props3.selectSource, selectedSource = _props3.selectedSource, symbolType = _props3.symbolType, highlightLineRange = _props3.highlightLineRange; if (selectedSource && symbolType !== "functions") { selectSource(selectedSource.get("id"), { line: item.location.start.line }); } if (selectedSource && symbolType === "functions") { highlightLineRange({ start: item.location.start.line, end: item.location.end.line, sourceId: selectedSource.get("id") }); } } onKeyUp(e) { e.preventDefault(); var enabled = this.props.enabled; var _state2 = this.state, results = _state2.results, resultsIndex = _state2.resultsIndex; if (!enabled || !results) { return; } if (e.key === "ArrowUp") { this.traverseResults(-1); } else if (e.key === "ArrowDown") { this.traverseResults(1); } else if (e.key === "Enter") { this.selectResultItem(e, results[resultsIndex]); this.closeModal(); } else if (e.key === "Tab") { this.closeModal(); } } renderResults() { var _state3 = this.state, resultsIndex = _state3.resultsIndex, results = _state3.results; var enabled = this.props.enabled; if (!enabled || !results) { return null; } return _react2.default.createElement(_ResultList2.default, { key: "results", items: results, selected: resultsIndex, selectItem: this.selectResultItem, ref: "resultList" }); } renderInput() { var query = this.state.query; return _react2.default.createElement( "div", { key: "input", className: "input-wrapper" }, _react2.default.createElement(_SearchInput2.default, { query: query, count: this.resultsCount(), placeholder: this.buildPlaceHolder(), summaryMsg: this.buildSummaryMsg(), onChange: this.onChange, onKeyUp: this.onKeyUp, handleNext: () => this.traverseResults(1), handlePrev: () => this.traverseResults(-1), handleClose: this.closeModal }) ); } buildSummaryMsg() { var resultsIndex = this.state.resultsIndex; var count = this.resultsCount(); if (count > 1) { return L10N.getFormatStr("editor.searchResults", resultsIndex + 1, count); } else if (count === 1) { return L10N.getFormatStr("editor.singleResult"); } } resultsCount() { return this.state.results ? this.state.results.length : 0; } buildPlaceHolder() { var symbolType = this.props.symbolType; return L10N.getFormatStr(`symbolSearch.search.${symbolType}Placeholder`); } render() { var enabled = this.props.enabled; if (!enabled) { return null; } return _react2.default.createElement( _Modal2.default, { "in": enabled, handleClose: this.closeModal }, this.renderInput(), this.renderResults() ); } } SymbolModal.contextTypes = { shortcuts: _react.PropTypes.object }; function _getFormattedSymbols(state, source) { if (!source) { return { variables: [], functions: [] }; } var _getSymbols = (0, _selectors.getSymbols)(state, source.toJS()), variables = _getSymbols.variables, functions = _getSymbols.functions; return { variables: variables.map(formatSymbol), functions: functions.map(formatSymbol) }; } exports.default = (0, _reactRedux.connect)(state => { var source = (0, _selectors.getSelectedSource)(state); return { enabled: Boolean((0, _selectors.getActiveSearch)(state) === "symbol" && source), symbolType: (0, _selectors.getSymbolSearchType)(state), symbols: _getFormattedSymbols(state, source) }; }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(SymbolModal); /***/ }), /* 1171 */, /* 1172 */ /***/ (function(module, exports, __webpack_require__) { /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ const md5 = __webpack_require__(248); function originalToGeneratedId(originalId) { const match = originalId.match(/(.*)\/originalSource/); return match ? match[1] : ""; } function generatedToOriginalId(generatedId, url) { return `${generatedId}/originalSource-${md5(url)}`; } function isOriginalId(id) { return !!id.match(/\/originalSource/); } function isGeneratedId(id) { return !isOriginalId(id); } /** * Trims the query part or reference identifier of a URL string, if necessary. */ function trimUrlQuery(url) { let length = url.length; let q1 = url.indexOf("?"); let q2 = url.indexOf("&"); let q3 = url.indexOf("#"); let q = Math.min(q1 != -1 ? q1 : length, q2 != -1 ? q2 : length, q3 != -1 ? q3 : length); return url.slice(0, q); } // Map suffix to content type. const contentMap = { "js": "text/javascript", "jsm": "text/javascript", "ts": "text/typescript", "tsx": "text/typescript-jsx", "jsx": "text/jsx", "coffee": "text/coffeescript", "elm": "text/elm", "cljs": "text/x-clojure" }; /** * Returns the content type for the specified URL. If no specific * content type can be determined, "text/plain" is returned. * * @return String * The content type. */ function getContentType(url) { url = trimUrlQuery(url); let dot = url.lastIndexOf("."); if (dot >= 0) { let name = url.substring(dot + 1); if (name in contentMap) { return contentMap[name]; } } return "text/plain"; } module.exports = { originalToGeneratedId, generatedToOriginalId, isOriginalId, isGeneratedId, getContentType, contentMapForTesting: contentMap }; /***/ }), /* 1173 */, /* 1174 */ /***/ (function(module, exports) { module.exports = "image/svg+xml" /***/ }), /* 1175 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getWorkers = exports.State = undefined; exports.default = debuggee; var _reselect = __webpack_require__(993); var _immutable = __webpack_require__(146); var _makeRecord = __webpack_require__(230); var _makeRecord2 = _interopRequireDefault(_makeRecord); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var State = exports.State = (0, _makeRecord2.default)({ workers: (0, _immutable.List)() }); function debuggee() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : State(); var action = arguments[1]; switch (action.type) { case "SET_WORKERS": return state.set("workers", (0, _immutable.List)(action.workers.workers)); default: return state; } } var getDebuggeeWrapper = state => state.debuggee; var getWorkers = exports.getWorkers = (0, _reselect.createSelector)(getDebuggeeWrapper, debuggeeState => debuggeeState.get("workers")); /***/ }), /* 1176 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.InitialState = InitialState; exports.default = update; exports.getExpandedState = getExpandedState; var _makeRecord = __webpack_require__(230); var _makeRecord2 = _interopRequireDefault(_makeRecord); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function InitialState() { return (0, _makeRecord2.default)({ expanded: null })(); } /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /** * Source tree reducer * @module reducers/source-tree */ function update() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : InitialState(); var action = arguments[1]; switch (action.type) { case "SET_EXPANDED_STATE": return state.set("expanded", action.expanded); } return state; } function getExpandedState(state) { return state.sourceTree.get("expanded"); } /***/ }), /* 1177 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.sanitizeInput = sanitizeInput; exports.wrapExpression = wrapExpression; exports.getValue = getValue; // replace quotes and slashes that could interfere with the evaluation. function sanitizeInput(input) { return input.replace(/\\/g, "\\\\").replace(/"/g, "\\$&"); } /* * wrap the expression input in a try/catch so that it can be safely * evaluated. * * NOTE: we add line after the expression to protect against comments. */ function wrapExpression(input) { return `eval(\` try { ${sanitizeInput(input)} } catch (e) { e } \`)`.trim(); } function getValue(expression) { var value = expression.value; if (!value) { return { path: expression.from, value: { unavailable: true } }; } if (value.exception) { return { path: value.from, value: value.exception }; } if (value.error) { return { path: value.from, value: value.error }; } if (value.result && value.result.class == "Error") { var _value$result$preview = value.result.preview, name = _value$result$preview.name, message = _value$result$preview.message; var newValue = name === "ReferenceError" ? { unavailable: true } : `${name}: ${message}`; return { path: value.input, value: newValue }; } if (typeof value.result == "object") { return { path: value.result.actor, value: value.result }; } return { path: value.input, value: value.result }; } /***/ }), /* 1178 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.setExpandedState = setExpandedState; function setExpandedState(expanded) { return (_ref) => { var dispatch = _ref.dispatch, getState = _ref.getState; dispatch({ type: "SET_EXPANDED_STATE", expanded }); }; } /***/ }), /* 1179 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.setWorkers = setWorkers; function setWorkers(workers) { return { type: "SET_WORKERS", workers }; } /***/ }), /* 1180 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.openLink = openLink; function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var _require = __webpack_require__(828), isDevelopment = _require.isDevelopment; /** * @memberof actions/toolbox * @static */ function openLink(url) { return (() => { var _ref = _asyncToGenerator(function* (_ref2) { var openLinkCommand = _ref2.openLink; if (isDevelopment()) { var win = window.open(url, "_blank"); win.focus(); } else { openLinkCommand(url); } }); return function (_x) { return _ref.apply(this, arguments); }; })(); } /***/ }), /* 1181 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ShortcutsModal = undefined; var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _Modal = __webpack_require__(332); var _Modal2 = _interopRequireDefault(_Modal); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _text = __webpack_require__(389); __webpack_require__(1182); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class ShortcutsModal extends _react.Component { renderPrettyCombos(combo) { return combo.split(" ").map(c => _react2.default.createElement( "span", { key: c, className: "keystroke" }, c )).reduce((prev, curr) => [prev, " + ", curr]); } renderShorcutItem(title, combo) { return _react2.default.createElement( "li", null, _react2.default.createElement( "span", null, title ), _react2.default.createElement( "span", null, this.renderPrettyCombos(combo) ) ); } renderEditorShortcuts() { return _react2.default.createElement( "ul", { className: "shortcuts-list" }, this.renderShorcutItem(L10N.getStr("shortcuts.toggleBreakpoint"), (0, _text.formatKeyShortcut)(L10N.getStr("toggleBreakpoint.key"))), this.renderShorcutItem(L10N.getStr("shortcuts.toggleCondPanel"), (0, _text.formatKeyShortcut)(L10N.getStr("toggleCondPanel.key"))) ); } renderSteppingShortcuts() { return _react2.default.createElement( "ul", { className: "shortcuts-list" }, this.renderShorcutItem(L10N.getStr("shortcuts.pauseOrResume"), "F8"), this.renderShorcutItem(L10N.getStr("shortcuts.stepOver"), "F10"), this.renderShorcutItem(L10N.getStr("shortcuts.stepIn"), "F11"), this.renderShorcutItem(L10N.getStr("shortcuts.stepOut"), (0, _text.formatKeyShortcut)(L10N.getStr("stepOut.key"))) ); } renderSearchShortcuts() { return _react2.default.createElement( "ul", { className: "shortcuts-list" }, this.renderShorcutItem(L10N.getStr("shortcuts.fileSearch"), (0, _text.formatKeyShortcut)(L10N.getStr("sources.search.key2"))), this.renderShorcutItem(L10N.getStr("shortcuts.searchAgain"), (0, _text.formatKeyShortcut)(L10N.getStr("sourceSearch.search.again.key2"))), this.renderShorcutItem(L10N.getStr("shortcuts.projectSearch"), (0, _text.formatKeyShortcut)(L10N.getStr("projectTextSearch.key"))), this.renderShorcutItem(L10N.getStr("shortcuts.functionSearch"), (0, _text.formatKeyShortcut)(L10N.getStr("functionSearch.key"))) ); } renderShortcutsContent() { return _react2.default.createElement( "div", { className: (0, _classnames2.default)("shortcuts-content", this.props.additionalClass) }, _react2.default.createElement( "div", { className: "shortcuts-section" }, _react2.default.createElement( "h2", null, L10N.getStr("shortcuts.header.editor") ), this.renderEditorShortcuts() ), _react2.default.createElement( "div", { className: "shortcuts-section" }, _react2.default.createElement( "h2", null, L10N.getStr("shortcuts.header.stepping") ), this.renderSteppingShortcuts() ), _react2.default.createElement( "div", { className: "shortcuts-section" }, _react2.default.createElement( "h2", null, L10N.getStr("shortcuts.header.search") ), this.renderSearchShortcuts() ) ); } render() { var enabled = this.props.enabled; if (!enabled) { return null; } return _react2.default.createElement( _Modal2.default, { "in": enabled, additionalClass: "shortcuts-modal", handleClose: this.props.handleClose }, this.renderShortcutsContent() ); } } exports.ShortcutsModal = ShortcutsModal; ShortcutsModal.displayName = "ShortcutsModal"; /***/ }), /* 1182 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1183 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 1184 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.highlightMatches = highlightMatches; var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function highlightMatches(lineMatch) { var value = lineMatch.value, column = lineMatch.column, match = lineMatch.match; var len = match.length; return _react2.default.createElement( "span", { className: "line-value" }, _react2.default.createElement( "span", { className: "line-match", key: 0 }, value.slice(0, column) ), _react2.default.createElement( "span", { className: "query-match", key: 1 }, value.substr(column, len) ), _react2.default.createElement( "span", { className: "line-match", key: 2 }, value.slice(column + len, value.length) ) ); } // Maybe reuse file search's functions? /***/ }), /* 1185 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: 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; }; var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _Svg = __webpack_require__(344); var _Svg2 = _interopRequireDefault(_Svg); __webpack_require__(918); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function debugBtn(onClick, type, className, tooltip) { var disabled = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; var props = { onClick, key: type, "aria-label": tooltip, title: tooltip, disabled }; return _react2.default.createElement( "button", _extends({ className: (0, _classnames2.default)(type, className) }, props), _react2.default.createElement(_Svg2.default, { name: type }) ); } class UtilsBar extends _react.Component { renderUtilButtons() { return [debugBtn(this.props.toggleShortcutsModal, "shortcut", "active", "shortcuts", false)]; } render() { return _react2.default.createElement( "div", { className: (0, _classnames2.default)("command-bar bottom", { vertical: !this.props.horizontal }) }, this.renderUtilButtons() ); } } exports.default = UtilsBar; /***/ }), /* 1186 */, /* 1187 */, /* 1188 */, /* 1189 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_Provider__ = __webpack_require__(1195); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__components_connectAdvanced__ = __webpack_require__(1192); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__connect_connect__ = __webpack_require__(1198); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Provider", function() { return __WEBPACK_IMPORTED_MODULE_0__components_Provider__["b"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "createProvider", function() { return __WEBPACK_IMPORTED_MODULE_0__components_Provider__["a"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "connectAdvanced", function() { return __WEBPACK_IMPORTED_MODULE_1__components_connectAdvanced__["a"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "connect", function() { return __WEBPACK_IMPORTED_MODULE_2__connect_connect__["a"]; }); /***/ }), /* 1190 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = 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 */ } /***/ }), /* 1191 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return subscriptionShape; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return storeShape; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_prop_types__ = __webpack_require__(20); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_prop_types__); var subscriptionShape = __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.shape({ trySubscribe: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired, tryUnsubscribe: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired, notifyNestedSubs: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired, isSubscribed: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired }); var storeShape = __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.shape({ subscribe: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired, dispatch: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired, getState: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired }); /***/ }), /* 1192 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = connectAdvanced; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics__ = __webpack_require__(1196); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant__ = __webpack_require__(159); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_invariant__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils_Subscription__ = __webpack_require__(1197); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__ = __webpack_require__(1191); 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; }; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } var hotReloadingVersion = 0; var dummyState = {}; function noop() {} function makeSelectorStateful(sourceSelector, store) { // wrap the selector in an object that tracks its results between runs. var selector = { run: function runComponentSelector(props) { try { var nextProps = sourceSelector(store.getState(), props); if (nextProps !== selector.props || selector.error) { selector.shouldComponentUpdate = true; selector.props = nextProps; selector.error = null; } } catch (error) { selector.shouldComponentUpdate = true; selector.error = error; } } }; return selector; } function connectAdvanced( /* selectorFactory is a func that is responsible for returning the selector function used to compute new props from state, props, and dispatch. For example: export default connectAdvanced((dispatch, options) => (state, props) => ({ thing: state.things[props.thingId], saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)), }))(YourComponent) Access to dispatch is provided to the factory so selectorFactories can bind actionCreators outside of their selector as an optimization. Options passed to connectAdvanced are passed to the selectorFactory, along with displayName and WrappedComponent, as the second argument. Note that selectorFactory is responsible for all caching/memoization of inbound and outbound props. Do not use connectAdvanced directly without memoizing results between calls to your selector, otherwise the Connect component will re-render on every state or props change. */ selectorFactory) { var _contextTypes, _childContextTypes; var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref$getDisplayName = _ref.getDisplayName, getDisplayName = _ref$getDisplayName === undefined ? function (name) { return 'ConnectAdvanced(' + name + ')'; } : _ref$getDisplayName, _ref$methodName = _ref.methodName, methodName = _ref$methodName === undefined ? 'connectAdvanced' : _ref$methodName, _ref$renderCountProp = _ref.renderCountProp, renderCountProp = _ref$renderCountProp === undefined ? undefined : _ref$renderCountProp, _ref$shouldHandleStat = _ref.shouldHandleStateChanges, shouldHandleStateChanges = _ref$shouldHandleStat === undefined ? true : _ref$shouldHandleStat, _ref$storeKey = _ref.storeKey, storeKey = _ref$storeKey === undefined ? 'store' : _ref$storeKey, _ref$withRef = _ref.withRef, withRef = _ref$withRef === undefined ? false : _ref$withRef, connectOptions = _objectWithoutProperties(_ref, ['getDisplayName', 'methodName', 'renderCountProp', 'shouldHandleStateChanges', 'storeKey', 'withRef']); var subscriptionKey = storeKey + 'Subscription'; var version = hotReloadingVersion++; var contextTypes = (_contextTypes = {}, _contextTypes[storeKey] = __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__["a" /* storeShape */], _contextTypes[subscriptionKey] = __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__["b" /* subscriptionShape */], _contextTypes); var childContextTypes = (_childContextTypes = {}, _childContextTypes[subscriptionKey] = __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__["b" /* subscriptionShape */], _childContextTypes); return function wrapWithConnect(WrappedComponent) { __WEBPACK_IMPORTED_MODULE_1_invariant___default()(typeof WrappedComponent == 'function', 'You must pass a component to the function returned by ' + ('connect. Instead received ' + JSON.stringify(WrappedComponent))); var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component'; var displayName = getDisplayName(wrappedComponentName); var selectorFactoryOptions = _extends({}, connectOptions, { getDisplayName: getDisplayName, methodName: methodName, renderCountProp: renderCountProp, shouldHandleStateChanges: shouldHandleStateChanges, storeKey: storeKey, withRef: withRef, displayName: displayName, wrappedComponentName: wrappedComponentName, WrappedComponent: WrappedComponent }); var Connect = function (_Component) { _inherits(Connect, _Component); function Connect(props, context) { _classCallCheck(this, Connect); var _this = _possibleConstructorReturn(this, _Component.call(this, props, context)); _this.version = version; _this.state = {}; _this.renderCount = 0; _this.store = props[storeKey] || context[storeKey]; _this.propsMode = Boolean(props[storeKey]); _this.setWrappedInstance = _this.setWrappedInstance.bind(_this); __WEBPACK_IMPORTED_MODULE_1_invariant___default()(_this.store, 'Could not find "' + storeKey + '" in either the context or props of ' + ('"' + displayName + '". Either wrap the root component in a , ') + ('or explicitly pass "' + storeKey + '" as a prop to "' + displayName + '".')); _this.initSelector(); _this.initSubscription(); return _this; } Connect.prototype.getChildContext = function getChildContext() { var _ref2; // If this component received store from props, its subscription should be transparent // to any descendants receiving store+subscription from context; it passes along // subscription passed to it. Otherwise, it shadows the parent subscription, which allows // Connect to control ordering of notifications to flow top-down. var subscription = this.propsMode ? null : this.subscription; return _ref2 = {}, _ref2[subscriptionKey] = subscription || this.context[subscriptionKey], _ref2; }; Connect.prototype.componentDidMount = function componentDidMount() { if (!shouldHandleStateChanges) return; // componentWillMount fires during server side rendering, but componentDidMount and // componentWillUnmount do not. Because of this, trySubscribe happens during ...didMount. // Otherwise, unsubscription would never take place during SSR, causing a memory leak. // To handle the case where a child component may have triggered a state change by // dispatching an action in its componentWillMount, we have to re-run the select and maybe // re-render. this.subscription.trySubscribe(); this.selector.run(this.props); if (this.selector.shouldComponentUpdate) this.forceUpdate(); }; Connect.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { this.selector.run(nextProps); }; Connect.prototype.shouldComponentUpdate = function shouldComponentUpdate() { return this.selector.shouldComponentUpdate; }; Connect.prototype.componentWillUnmount = function componentWillUnmount() { if (this.subscription) this.subscription.tryUnsubscribe(); this.subscription = null; this.notifyNestedSubs = noop; this.store = null; this.selector.run = noop; this.selector.shouldComponentUpdate = false; }; Connect.prototype.getWrappedInstance = function getWrappedInstance() { __WEBPACK_IMPORTED_MODULE_1_invariant___default()(withRef, 'To access the wrapped instance, you need to specify ' + ('{ withRef: true } in the options argument of the ' + methodName + '() call.')); return this.wrappedInstance; }; Connect.prototype.setWrappedInstance = function setWrappedInstance(ref) { this.wrappedInstance = ref; }; Connect.prototype.initSelector = function initSelector() { var sourceSelector = selectorFactory(this.store.dispatch, selectorFactoryOptions); this.selector = makeSelectorStateful(sourceSelector, this.store); this.selector.run(this.props); }; Connect.prototype.initSubscription = function initSubscription() { if (!shouldHandleStateChanges) return; // parentSub's source should match where store came from: props vs. context. A component // connected to the store via props shouldn't use subscription from context, or vice versa. var parentSub = (this.propsMode ? this.props : this.context)[subscriptionKey]; this.subscription = new __WEBPACK_IMPORTED_MODULE_3__utils_Subscription__["a" /* default */](this.store, parentSub, this.onStateChange.bind(this)); // `notifyNestedSubs` is duplicated to handle the case where the component is unmounted in // the middle of the notification loop, where `this.subscription` will then be null. An // extra null check every change can be avoided by copying the method onto `this` and then // replacing it with a no-op on unmount. This can probably be avoided if Subscription's // listeners logic is changed to not call listeners that have been unsubscribed in the // middle of the notification loop. this.notifyNestedSubs = this.subscription.notifyNestedSubs.bind(this.subscription); }; Connect.prototype.onStateChange = function onStateChange() { this.selector.run(this.props); if (!this.selector.shouldComponentUpdate) { this.notifyNestedSubs(); } else { this.componentDidUpdate = this.notifyNestedSubsOnComponentDidUpdate; this.setState(dummyState); } }; Connect.prototype.notifyNestedSubsOnComponentDidUpdate = function notifyNestedSubsOnComponentDidUpdate() { // `componentDidUpdate` is conditionally implemented when `onStateChange` determines it // needs to notify nested subs. Once called, it unimplements itself until further state // changes occur. Doing it this way vs having a permanent `componentDidUpdate` that does // a boolean check every time avoids an extra method call most of the time, resulting // in some perf boost. this.componentDidUpdate = undefined; this.notifyNestedSubs(); }; Connect.prototype.isSubscribed = function isSubscribed() { return Boolean(this.subscription) && this.subscription.isSubscribed(); }; Connect.prototype.addExtraProps = function addExtraProps(props) { if (!withRef && !renderCountProp && !(this.propsMode && this.subscription)) return props; // make a shallow copy so that fields added don't leak to the original selector. // this is especially important for 'ref' since that's a reference back to the component // instance. a singleton memoized selector would then be holding a reference to the // instance, preventing the instance from being garbage collected, and that would be bad var withExtras = _extends({}, props); if (withRef) withExtras.ref = this.setWrappedInstance; if (renderCountProp) withExtras[renderCountProp] = this.renderCount++; if (this.propsMode && this.subscription) withExtras[subscriptionKey] = this.subscription; return withExtras; }; Connect.prototype.render = function render() { var selector = this.selector; selector.shouldComponentUpdate = false; if (selector.error) { throw selector.error; } else { return Object(__WEBPACK_IMPORTED_MODULE_2_react__["createElement"])(WrappedComponent, this.addExtraProps(selector.props)); } }; return Connect; }(__WEBPACK_IMPORTED_MODULE_2_react__["Component"]); Connect.WrappedComponent = WrappedComponent; Connect.displayName = displayName; Connect.childContextTypes = childContextTypes; Connect.contextTypes = contextTypes; Connect.propTypes = contextTypes; if (false) { Connect.prototype.componentWillUpdate = function componentWillUpdate() { var _this2 = this; // We are hot reloading! if (this.version !== version) { this.version = version; this.initSelector(); // If any connected descendants don't hot reload (and resubscribe in the process), their // listeners will be lost when we unsubscribe. Unfortunately, by copying over all // listeners, this does mean that the old versions of connected descendants will still be // notified of state changes; however, their onStateChange function is a no-op so this // isn't a huge deal. var oldListeners = []; if (this.subscription) { oldListeners = this.subscription.listeners.get(); this.subscription.tryUnsubscribe(); } this.initSubscription(); if (shouldHandleStateChanges) { this.subscription.trySubscribe(); oldListeners.forEach(function (listener) { return _this2.subscription.listeners.subscribe(listener); }); } } }; } return __WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics___default()(Connect, WrappedComponent); }; } /***/ }), /* 1193 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = wrapMapToPropsConstant; /* unused harmony export getDependsOnOwnProps */ /* harmony export (immutable) */ __webpack_exports__["b"] = wrapMapToPropsFunc; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__ = __webpack_require__(1194); function wrapMapToPropsConstant(getConstant) { return function initConstantSelector(dispatch, options) { var constant = getConstant(dispatch, options); function constantSelector() { return constant; } constantSelector.dependsOnOwnProps = false; return constantSelector; }; } // dependsOnOwnProps is used by createMapToPropsProxy to determine whether to pass props as args // to the mapToProps function being wrapped. It is also used by makePurePropsSelector to determine // whether mapToProps needs to be invoked when props have changed. // // A length of one signals that mapToProps does not depend on props from the parent component. // A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and // therefore not reporting its length accurately.. function getDependsOnOwnProps(mapToProps) { return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1; } // Used by whenMapStateToPropsIsFunction and whenMapDispatchToPropsIsFunction, // this function wraps mapToProps in a proxy function which does several things: // // * Detects whether the mapToProps function being called depends on props, which // is used by selectorFactory to decide if it should reinvoke on props changes. // // * On first call, handles mapToProps if returns another function, and treats that // new function as the true mapToProps for subsequent calls. // // * On first call, verifies the first result is a plain object, in order to warn // the developer that their mapToProps function is not returning a valid result. // function wrapMapToPropsFunc(mapToProps, methodName) { return function initProxySelector(dispatch, _ref) { var displayName = _ref.displayName; var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) { return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch); }; // allow detectFactoryAndVerify to get ownProps proxy.dependsOnOwnProps = true; proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) { proxy.mapToProps = mapToProps; proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps); var props = proxy(stateOrDispatch, ownProps); if (typeof props === 'function') { proxy.mapToProps = props; proxy.dependsOnOwnProps = getDependsOnOwnProps(props); props = proxy(stateOrDispatch, ownProps); } if (false) verifyPlainObject(props, displayName, methodName); return props; }; return proxy; }; } /***/ }), /* 1194 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export default */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__ = __webpack_require__(33); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__warning__ = __webpack_require__(1190); function verifyPlainObject(value, displayName, methodName) { if (!Object(__WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__["a" /* default */])(value)) { Object(__WEBPACK_IMPORTED_MODULE_1__warning__["a" /* default */])(methodName + '() in ' + displayName + ' must return a plain object. Instead received ' + value + '.'); } } /***/ }), /* 1195 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = createProvider; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(20); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_PropTypes__ = __webpack_require__(1191); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils_warning__ = __webpack_require__(1190); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var didWarnAboutReceivingStore = false; function warnAboutReceivingStore() { if (didWarnAboutReceivingStore) { return; } didWarnAboutReceivingStore = true; Object(__WEBPACK_IMPORTED_MODULE_3__utils_warning__["a" /* default */])(' does not support changing `store` on the fly. ' + 'It is most likely that you see this error because you updated to ' + 'Redux 2.x and React Redux 2.x which no longer hot reload reducers ' + 'automatically. See https://github.com/reactjs/react-redux/releases/' + 'tag/v2.0.0 for the migration instructions.'); } function createProvider() { var _Provider$childContex; var storeKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'store'; var subKey = arguments[1]; var subscriptionKey = subKey || storeKey + 'Subscription'; var Provider = function (_Component) { _inherits(Provider, _Component); Provider.prototype.getChildContext = function getChildContext() { var _ref; return _ref = {}, _ref[storeKey] = this[storeKey], _ref[subscriptionKey] = null, _ref; }; function Provider(props, context) { _classCallCheck(this, Provider); var _this = _possibleConstructorReturn(this, _Component.call(this, props, context)); _this[storeKey] = props.store; return _this; } Provider.prototype.render = function render() { return __WEBPACK_IMPORTED_MODULE_0_react__["Children"].only(this.props.children); }; return Provider; }(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]); if (false) { Provider.prototype.componentWillReceiveProps = function (nextProps) { if (this[storeKey] !== nextProps.store) { warnAboutReceivingStore(); } }; } Provider.propTypes = { store: __WEBPACK_IMPORTED_MODULE_2__utils_PropTypes__["a" /* storeShape */].isRequired, children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.element.isRequired }; Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[storeKey] = __WEBPACK_IMPORTED_MODULE_2__utils_PropTypes__["a" /* storeShape */].isRequired, _Provider$childContex[subscriptionKey] = __WEBPACK_IMPORTED_MODULE_2__utils_PropTypes__["b" /* subscriptionShape */], _Provider$childContex); return Provider; } /* harmony default export */ __webpack_exports__["b"] = (createProvider()); /***/ }), /* 1196 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright 2015, Yahoo! Inc. * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. */ var REACT_STATICS = { childContextTypes: true, contextTypes: true, defaultProps: true, displayName: true, getDefaultProps: true, mixins: true, propTypes: true, type: true }; var KNOWN_STATICS = { name: true, length: true, prototype: true, caller: true, callee: true, arguments: true, arity: true }; var defineProperty = Object.defineProperty; var getOwnPropertyNames = Object.getOwnPropertyNames; var getOwnPropertySymbols = Object.getOwnPropertySymbols; var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; var getPrototypeOf = Object.getPrototypeOf; var objectPrototype = getPrototypeOf && getPrototypeOf(Object); module.exports = function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) { if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components if (objectPrototype) { var inheritedComponent = getPrototypeOf(sourceComponent); if (inheritedComponent && inheritedComponent !== objectPrototype) { hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); } } var keys = getOwnPropertyNames(sourceComponent); if (getOwnPropertySymbols) { keys = keys.concat(getOwnPropertySymbols(sourceComponent)); } for (var i = 0; i < keys.length; ++i) { var key = keys[i]; if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) { var descriptor = getOwnPropertyDescriptor(sourceComponent, key); try { // Avoid failures from read-only properties defineProperty(targetComponent, key, descriptor); } catch (e) {} } } return targetComponent; } return targetComponent; }; /***/ }), /* 1197 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Subscription; }); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } // encapsulates the subscription logic for connecting a component to the redux store, as // well as nesting subscriptions of descendant components, so that we can ensure the // ancestor components re-render before descendants var CLEARED = null; var nullListeners = { notify: function notify() {} }; function createListenerCollection() { // the current/next pattern is copied from redux's createStore code. // TODO: refactor+expose that code to be reusable here? var current = []; var next = []; return { clear: function clear() { next = CLEARED; current = CLEARED; }, notify: function notify() { var listeners = current = next; for (var i = 0; i < listeners.length; i++) { listeners[i](); } }, get: function get() { return next; }, subscribe: function subscribe(listener) { var isSubscribed = true; if (next === current) next = current.slice(); next.push(listener); return function unsubscribe() { if (!isSubscribed || current === CLEARED) return; isSubscribed = false; if (next === current) next = current.slice(); next.splice(next.indexOf(listener), 1); }; } }; } var Subscription = function () { function Subscription(store, parentSub, onStateChange) { _classCallCheck(this, Subscription); this.store = store; this.parentSub = parentSub; this.onStateChange = onStateChange; this.unsubscribe = null; this.listeners = nullListeners; } Subscription.prototype.addNestedSub = function addNestedSub(listener) { this.trySubscribe(); return this.listeners.subscribe(listener); }; Subscription.prototype.notifyNestedSubs = function notifyNestedSubs() { this.listeners.notify(); }; Subscription.prototype.isSubscribed = function isSubscribed() { return Boolean(this.unsubscribe); }; Subscription.prototype.trySubscribe = function trySubscribe() { if (!this.unsubscribe) { this.unsubscribe = this.parentSub ? this.parentSub.addNestedSub(this.onStateChange) : this.store.subscribe(this.onStateChange); this.listeners = createListenerCollection(); } }; Subscription.prototype.tryUnsubscribe = function tryUnsubscribe() { if (this.unsubscribe) { this.unsubscribe(); this.unsubscribe = null; this.listeners.clear(); this.listeners = nullListeners; } }; return Subscription; }(); /***/ }), /* 1198 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export createConnect */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__ = __webpack_require__(1192); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__ = __webpack_require__(1199); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__ = __webpack_require__(1200); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__ = __webpack_require__(1201); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__mergeProps__ = __webpack_require__(1202); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__selectorFactory__ = __webpack_require__(1203); 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; }; function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } /* connect is a facade over connectAdvanced. It turns its args into a compatible selectorFactory, which has the signature: (dispatch, options) => (nextState, nextOwnProps) => nextFinalProps connect passes its args to connectAdvanced as options, which will in turn pass them to selectorFactory each time a Connect component instance is instantiated or hot reloaded. selectorFactory returns a final props selector from its mapStateToProps, mapStateToPropsFactories, mapDispatchToProps, mapDispatchToPropsFactories, mergeProps, mergePropsFactories, and pure args. The resulting final props selector is called by the Connect component instance whenever it receives new props or store state. */ function match(arg, factories, name) { for (var i = factories.length - 1; i >= 0; i--) { var result = factories[i](arg); if (result) return result; } return function (dispatch, options) { throw new Error('Invalid value of type ' + typeof arg + ' for ' + name + ' argument when connecting component ' + options.wrappedComponentName + '.'); }; } function strictEqual(a, b) { return a === b; } // createConnect with default args builds the 'official' connect behavior. Calling it with // different options opens up some testing and extensibility scenarios function createConnect() { var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, _ref$connectHOC = _ref.connectHOC, connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__["a" /* default */] : _ref$connectHOC, _ref$mapStateToPropsF = _ref.mapStateToPropsFactories, mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__["a" /* default */] : _ref$mapStateToPropsF, _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories, mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__["a" /* default */] : _ref$mapDispatchToPro, _ref$mergePropsFactor = _ref.mergePropsFactories, mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__["a" /* default */] : _ref$mergePropsFactor, _ref$selectorFactory = _ref.selectorFactory, selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__["a" /* default */] : _ref$selectorFactory; return function connect(mapStateToProps, mapDispatchToProps, mergeProps) { var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}, _ref2$pure = _ref2.pure, pure = _ref2$pure === undefined ? true : _ref2$pure, _ref2$areStatesEqual = _ref2.areStatesEqual, areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual, _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual, areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__["a" /* default */] : _ref2$areOwnPropsEqua, _ref2$areStatePropsEq = _ref2.areStatePropsEqual, areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__["a" /* default */] : _ref2$areStatePropsEq, _ref2$areMergedPropsE = _ref2.areMergedPropsEqual, areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__["a" /* default */] : _ref2$areMergedPropsE, extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']); var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps'); var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps'); var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps'); return connectHOC(selectorFactory, _extends({ // used in error messages methodName: 'connect', // used to compute Connect's displayName from the wrapped component's displayName. getDisplayName: function getDisplayName(name) { return 'Connect(' + name + ')'; }, // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes shouldHandleStateChanges: Boolean(mapStateToProps), // passed through to selectorFactory initMapStateToProps: initMapStateToProps, initMapDispatchToProps: initMapDispatchToProps, initMergeProps: initMergeProps, pure: pure, areStatesEqual: areStatesEqual, areOwnPropsEqual: areOwnPropsEqual, areStatePropsEqual: areStatePropsEqual, areMergedPropsEqual: areMergedPropsEqual }, extraOptions)); }; } /* harmony default export */ __webpack_exports__["a"] = (createConnect()); /***/ }), /* 1199 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = shallowEqual; var hasOwn = Object.prototype.hasOwnProperty; function is(x, y) { if (x === y) { return x !== 0 || y !== 0 || 1 / x === 1 / y; } else { return x !== x && y !== y; } } function shallowEqual(objA, objB) { if (is(objA, objB)) return true; if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { return false; } var keysA = Object.keys(objA); var keysB = Object.keys(objB); if (keysA.length !== keysB.length) return false; for (var i = 0; i < keysA.length; i++) { if (!hasOwn.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) { return false; } } return true; } /***/ }), /* 1200 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export whenMapDispatchToPropsIsFunction */ /* unused harmony export whenMapDispatchToPropsIsMissing */ /* unused harmony export whenMapDispatchToPropsIsObject */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_redux__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__ = __webpack_require__(1193); function whenMapDispatchToPropsIsFunction(mapDispatchToProps) { return typeof mapDispatchToProps === 'function' ? Object(__WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__["b" /* wrapMapToPropsFunc */])(mapDispatchToProps, 'mapDispatchToProps') : undefined; } function whenMapDispatchToPropsIsMissing(mapDispatchToProps) { return !mapDispatchToProps ? Object(__WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__["a" /* wrapMapToPropsConstant */])(function (dispatch) { return { dispatch: dispatch }; }) : undefined; } function whenMapDispatchToPropsIsObject(mapDispatchToProps) { return mapDispatchToProps && typeof mapDispatchToProps === 'object' ? Object(__WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__["a" /* wrapMapToPropsConstant */])(function (dispatch) { return Object(__WEBPACK_IMPORTED_MODULE_0_redux__["bindActionCreators"])(mapDispatchToProps, dispatch); }) : undefined; } /* harmony default export */ __webpack_exports__["a"] = ([whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject]); /***/ }), /* 1201 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export whenMapStateToPropsIsFunction */ /* unused harmony export whenMapStateToPropsIsMissing */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wrapMapToProps__ = __webpack_require__(1193); function whenMapStateToPropsIsFunction(mapStateToProps) { return typeof mapStateToProps === 'function' ? Object(__WEBPACK_IMPORTED_MODULE_0__wrapMapToProps__["b" /* wrapMapToPropsFunc */])(mapStateToProps, 'mapStateToProps') : undefined; } function whenMapStateToPropsIsMissing(mapStateToProps) { return !mapStateToProps ? Object(__WEBPACK_IMPORTED_MODULE_0__wrapMapToProps__["a" /* wrapMapToPropsConstant */])(function () { return {}; }) : undefined; } /* harmony default export */ __webpack_exports__["a"] = ([whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing]); /***/ }), /* 1202 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export defaultMergeProps */ /* unused harmony export wrapMergePropsFunc */ /* unused harmony export whenMergePropsIsFunction */ /* unused harmony export whenMergePropsIsOmitted */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__ = __webpack_require__(1194); 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; }; function defaultMergeProps(stateProps, dispatchProps, ownProps) { return _extends({}, ownProps, stateProps, dispatchProps); } function wrapMergePropsFunc(mergeProps) { return function initMergePropsProxy(dispatch, _ref) { var displayName = _ref.displayName, pure = _ref.pure, areMergedPropsEqual = _ref.areMergedPropsEqual; var hasRunOnce = false; var mergedProps = void 0; return function mergePropsProxy(stateProps, dispatchProps, ownProps) { var nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps); if (hasRunOnce) { if (!pure || !areMergedPropsEqual(nextMergedProps, mergedProps)) mergedProps = nextMergedProps; } else { hasRunOnce = true; mergedProps = nextMergedProps; if (false) verifyPlainObject(mergedProps, displayName, 'mergeProps'); } return mergedProps; }; }; } function whenMergePropsIsFunction(mergeProps) { return typeof mergeProps === 'function' ? wrapMergePropsFunc(mergeProps) : undefined; } function whenMergePropsIsOmitted(mergeProps) { return !mergeProps ? function () { return defaultMergeProps; } : undefined; } /* harmony default export */ __webpack_exports__["a"] = ([whenMergePropsIsFunction, whenMergePropsIsOmitted]); /***/ }), /* 1203 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export impureFinalPropsSelectorFactory */ /* unused harmony export pureFinalPropsSelectorFactory */ /* harmony export (immutable) */ __webpack_exports__["a"] = finalPropsSelectorFactory; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__verifySubselectors__ = __webpack_require__(1204); function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } function impureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch) { return function impureFinalPropsSelector(state, ownProps) { return mergeProps(mapStateToProps(state, ownProps), mapDispatchToProps(dispatch, ownProps), ownProps); }; } function pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, _ref) { var areStatesEqual = _ref.areStatesEqual, areOwnPropsEqual = _ref.areOwnPropsEqual, areStatePropsEqual = _ref.areStatePropsEqual; var hasRunAtLeastOnce = false; var state = void 0; var ownProps = void 0; var stateProps = void 0; var dispatchProps = void 0; var mergedProps = void 0; function handleFirstCall(firstState, firstOwnProps) { state = firstState; ownProps = firstOwnProps; stateProps = mapStateToProps(state, ownProps); dispatchProps = mapDispatchToProps(dispatch, ownProps); mergedProps = mergeProps(stateProps, dispatchProps, ownProps); hasRunAtLeastOnce = true; return mergedProps; } function handleNewPropsAndNewState() { stateProps = mapStateToProps(state, ownProps); if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps); mergedProps = mergeProps(stateProps, dispatchProps, ownProps); return mergedProps; } function handleNewProps() { if (mapStateToProps.dependsOnOwnProps) stateProps = mapStateToProps(state, ownProps); if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps); mergedProps = mergeProps(stateProps, dispatchProps, ownProps); return mergedProps; } function handleNewState() { var nextStateProps = mapStateToProps(state, ownProps); var statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps); stateProps = nextStateProps; if (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps); return mergedProps; } function handleSubsequentCalls(nextState, nextOwnProps) { var propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps); var stateChanged = !areStatesEqual(nextState, state); state = nextState; ownProps = nextOwnProps; if (propsChanged && stateChanged) return handleNewPropsAndNewState(); if (propsChanged) return handleNewProps(); if (stateChanged) return handleNewState(); return mergedProps; } return function pureFinalPropsSelector(nextState, nextOwnProps) { return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps); }; } // TODO: Add more comments // If pure is true, the selector returned by selectorFactory will memoize its results, // allowing connectAdvanced's shouldComponentUpdate to return false if final // props have not changed. If false, the selector will always return a new // object and shouldComponentUpdate will always return true. function finalPropsSelectorFactory(dispatch, _ref2) { var initMapStateToProps = _ref2.initMapStateToProps, initMapDispatchToProps = _ref2.initMapDispatchToProps, initMergeProps = _ref2.initMergeProps, options = _objectWithoutProperties(_ref2, ['initMapStateToProps', 'initMapDispatchToProps', 'initMergeProps']); var mapStateToProps = initMapStateToProps(dispatch, options); var mapDispatchToProps = initMapDispatchToProps(dispatch, options); var mergeProps = initMergeProps(dispatch, options); if (false) { verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, options.displayName); } var selectorFactory = options.pure ? pureFinalPropsSelectorFactory : impureFinalPropsSelectorFactory; return selectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options); } /***/ }), /* 1204 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export default */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_warning__ = __webpack_require__(1190); function verify(selector, methodName, displayName) { if (!selector) { throw new Error('Unexpected value for ' + methodName + ' in ' + displayName + '.'); } else if (methodName === 'mapStateToProps' || methodName === 'mapDispatchToProps') { if (!selector.hasOwnProperty('dependsOnOwnProps')) { Object(__WEBPACK_IMPORTED_MODULE_0__utils_warning__["a" /* default */])('The selector for ' + methodName + ' of ' + displayName + ' did not specify a value for dependsOnOwnProps.'); } } } function verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, displayName) { verify(mapStateToProps, 'mapStateToProps', displayName); verify(mapDispatchToProps, 'mapDispatchToProps', displayName); verify(mergeProps, 'mergeProps', displayName); } /***/ }), /* 1205 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, '__esModule', { value: 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; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ('value' in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); var _get = function get(_x, _x2, _x3) { var _again = true;_function: while (_again) { var object = _x, property = _x2, receiver = _x3;_again = false;if (object === null) object = Function.prototype;var desc = Object.getOwnPropertyDescriptor(object, property);if (desc === undefined) { var parent = Object.getPrototypeOf(object);if (parent === null) { return undefined; } else { _x = parent;_x2 = property;_x3 = receiver;_again = true;desc = parent = undefined;continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get;if (getter === undefined) { return undefined; }return getter.call(receiver); } } }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _objectWithoutProperties(obj, keys) { var target = {};for (var i in obj) { if (keys.indexOf(i) >= 0) continue;if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;target[i] = obj[i]; }return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var DOMParser = typeof window !== 'undefined' && window.DOMParser; var process = process || {}; process.env = process.env || {}; var parserAvailable = typeof DOMParser !== 'undefined' && DOMParser.prototype != null && DOMParser.prototype.parseFromString != null; if ("production" !== process.env.NODE_ENV && !parserAvailable) { console.info(': `raw` prop works only when `window.DOMParser` exists.'); } function isParsable(src) { // kinda naive but meh, ain't gonna use full-blown parser for this return parserAvailable && typeof src === 'string' && src.trim().substr(0, 4) === '` element but react-limited function switchSVGAttrToReactProp(propName) { switch (propName) { case 'class': return 'className'; default: return propName; } } var InlineSVG = function (_React$Component) { _inherits(InlineSVG, _React$Component); _createClass(InlineSVG, null, [{ key: 'defaultProps', value: { element: 'i', raw: false, src: '' }, enumerable: true }, { key: 'propTypes', value: { src: _react2['default'].PropTypes.string.isRequired, element: _react2['default'].PropTypes.string, raw: _react2['default'].PropTypes.bool }, enumerable: true }]); function InlineSVG(props) { _classCallCheck(this, InlineSVG); _get(Object.getPrototypeOf(InlineSVG.prototype), 'constructor', this).call(this, props); this._extractSVGProps = this._extractSVGProps.bind(this); } // Serialize `Attr` objects in `NamedNodeMap` _createClass(InlineSVG, [{ key: '_serializeAttrs', value: function _serializeAttrs(map) { var ret = {}; var prop = undefined; for (var i = 0; i < map.length; i++) { prop = switchSVGAttrToReactProp(map[i].name); ret[prop] = map[i].value; } return ret; } // get element props }, { key: '_extractSVGProps', value: function _extractSVGProps(src) { var map = parseFromSVGString(src).documentElement.attributes; return map.length > 0 ? this._serializeAttrs(map) : null; } // get content inside element. }, { key: '_stripSVG', value: function _stripSVG(src) { return parseFromSVGString(src).documentElement.innerHTML; } }, { key: 'componentWillReceiveProps', value: function componentWillReceiveProps(_ref) { var children = _ref.children; if ("production" !== process.env.NODE_ENV && children != null) { console.info(': `children` prop will be ignored.'); } } }, { key: 'render', value: function render() { var Element = undefined, __html = undefined, svgProps = undefined; var _props = this.props; var element = _props.element; var raw = _props.raw; var src = _props.src; var otherProps = _objectWithoutProperties(_props, ['element', 'raw', 'src']); if (raw === true && isParsable(src)) { Element = 'svg'; svgProps = this._extractSVGProps(src); __html = this._stripSVG(src); } __html = __html || src; Element = Element || element; svgProps = svgProps || {}; return _react2['default'].createElement(Element, _extends({}, svgProps, otherProps, { src: null, children: null, dangerouslySetInnerHTML: { __html: __html } })); } }]); return InlineSVG; }(_react2['default'].Component); exports['default'] = InlineSVG; module.exports = exports['default']; /***/ }), /* 1206 */ /***/ (function(module, exports) { function replaceOriginalVariableName(expression, generatedScopes) { // JavaScript indetifier is a complex thing: it can contain '$', '\', ZWJ, any // unicode letter or number. Simplifing that to latin character set for now. // For simplicity, search only first characters of the expression to find an // identifier/variable name. const possibleVarNameRegex = /^([$\w]+)/; const matchedVarName = possibleVarNameRegex.exec(expression); if (!matchedVarName) { return expression; } const originalName = matchedVarName[1]; // The generatedScopes sorted in inner-to-outer scope order, finding first. const foundScope = generatedScopes.find(({ bindings }) => originalName in bindings); if (!foundScope) { return expression; } // Replace original name (which will be at the beginning of the expression) // with found generated name. const generatedName = foundScope.bindings[originalName]; const expressionWoOriginalName = expression.substring(originalName.length); return `${generatedName}${expressionWoOriginalName}`; } module.exports = { replaceOriginalVariableName }; /***/ }) /******/ ]); });