diff --git a/Cargo.lock b/Cargo.lock index fc77dc6c04e1..bafb25b28a77 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -738,6 +738,7 @@ dependencies = [ "nserror 0.1.0", "nsstring 0.1.0", "prefs_parser 0.0.1", + "rsdparsa_capi 0.1.0", "rust_url_capi 0.0.1", "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", "u2fhid 0.1.0", @@ -1449,6 +1450,20 @@ dependencies = [ "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "rsdparsa" +version = "0.1.0" + +[[package]] +name = "rsdparsa_capi" +version = "0.1.0" +dependencies = [ + "libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "nserror 0.1.0", + "rsdparsa 0.1.0", +] + [[package]] name = "runloop" version = "0.1.0" diff --git a/accessible/base/ARIAMap.cpp b/accessible/base/ARIAMap.cpp index 6a1b599fd227..142d831089fa 100644 --- a/accessible/base/ARIAMap.cpp +++ b/accessible/base/ARIAMap.cpp @@ -725,7 +725,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = states::LINKED }, { // list - &nsGkAtoms::list, + &nsGkAtoms::list_, roles::LIST, kUseMapRole, eNoValue, @@ -1064,7 +1064,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = kNoReqStates }, { // switch - &nsGkAtoms::_switch, + &nsGkAtoms::svgSwitch, roles::SWITCH, kUseMapRole, eNoValue, diff --git a/accessible/base/ARIAStateMap.cpp b/accessible/base/ARIAStateMap.cpp index 4e089ec82946..7956a979b01b 100644 --- a/accessible/base/ARIAStateMap.cpp +++ b/accessible/base/ARIAStateMap.cpp @@ -90,7 +90,7 @@ aria::MapToState(EStateRule aRule, dom::Element* aElement, uint64_t* aState) static const EnumTypeData data = { nsGkAtoms::aria_autocomplete, { &nsGkAtoms::inlinevalue, - &nsGkAtoms::list, + &nsGkAtoms::list_, &nsGkAtoms::both, nullptr }, { states::SUPPORTS_AUTOCOMPLETION, states::HASPOPUP | states::SUPPORTS_AUTOCOMPLETION, diff --git a/accessible/base/Filters.cpp b/accessible/base/Filters.cpp index ea74e3602571..33737260591a 100644 --- a/accessible/base/Filters.cpp +++ b/accessible/base/Filters.cpp @@ -33,11 +33,11 @@ filters::GetSelectable(Accessible* aAccessible) uint32_t filters::GetRow(Accessible* aAccessible) { - a11y::role role = aAccessible->Role(); - if (role == roles::ROW) + if (aAccessible->IsTableRow()) return eMatch | eSkipSubtree; // Look for rows inside rowgroup. + a11y::role role = aAccessible->Role(); if (role == roles::GROUPING) return eSkip; diff --git a/accessible/html/HTMLFormControlAccessible.cpp b/accessible/html/HTMLFormControlAccessible.cpp index ad57436c8590..34124e1aef0b 100644 --- a/accessible/html/HTMLFormControlAccessible.cpp +++ b/accessible/html/HTMLFormControlAccessible.cpp @@ -406,7 +406,7 @@ HTMLTextFieldAccessible::NativeState() } // Expose autocomplete state if it has associated autocomplete list. - if (mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::list)) + if (mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::list_)) return state | states::SUPPORTS_AUTOCOMPLETION | states::HASPOPUP; // Ordinal XUL textboxes don't support autocomplete. diff --git a/browser/components/places/tests/browser/browser.ini b/browser/components/places/tests/browser/browser.ini index cfc8d90adbce..faec7c039c48 100644 --- a/browser/components/places/tests/browser/browser.ini +++ b/browser/components/places/tests/browser/browser.ini @@ -67,6 +67,7 @@ skip-if = (os == 'win' && ccov) # Bug 1423667 subsuite = clipboard [browser_drag_bookmarks_on_toolbar.js] [browser_enable_toolbar_sidebar.js] +skip-if = (os == 'win' && ccov) # Bug 1423667 [browser_forgetthissite_single.js] [browser_history_sidebar_search.js] [browser_library_batch_delete.js] @@ -88,6 +89,8 @@ skip-if = (os == 'win' && ccov) # Bug 1423667 [browser_library_open_leak.js] [browser_library_openFlatContainer.js] skip-if = (os == 'win' && ccov) # Bug 1423667 +[browser_library_open_bookmark.js] +skip-if = (os == 'win' && ccov) # Bug 1423667 [browser_library_panel_leak.js] skip-if = (os == 'win' && ccov) # Bug 1423667 [browser_library_search.js] diff --git a/browser/components/places/tests/browser/browser_library_open_bookmark.js b/browser/components/places/tests/browser/browser_library_open_bookmark.js new file mode 100644 index 000000000000..ec54e8c11fbb --- /dev/null +++ b/browser/components/places/tests/browser/browser_library_open_bookmark.js @@ -0,0 +1,38 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ + */ + +/** + * Test that the a bookmark can be opened from the Library by mouse double click. + */ +"use strict"; + +const TEST_URL = "about:buildconfig"; + +add_task(async function test_open_bookmark_from_library() { + let bm = await PlacesUtils.bookmarks.insert({ + parentGuid: PlacesUtils.bookmarks.unfiledGuid, + url: TEST_URL, + title: TEST_URL, + }); + + let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:blank"); + + let gLibrary = await promiseLibrary("UnfiledBookmarks"); + + registerCleanupFunction(async function() { + await promiseLibraryClosed(gLibrary); + await PlacesUtils.bookmarks.eraseEverything(); + await BrowserTestUtils.removeTab(tab); + }); + + let bmLibrary = gLibrary.ContentTree.view.view.nodeForTreeIndex(0); + Assert.equal(bmLibrary.title, bm.title, "Found bookmark in the right pane"); + + gLibrary.ContentTree.view.selectNode(bmLibrary); + synthesizeClickOnSelectedTreeCell(gLibrary.ContentTree.view, + { clickCount: 2 }); + + await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser, false, TEST_URL); + Assert.ok(true, "Expected tab was loaded"); +}); diff --git a/browser/components/preferences/permissions.js b/browser/components/preferences/permissions.js index 6aa89f6efe9d..7e533165fc92 100644 --- a/browser/components/preferences/permissions.js +++ b/browser/components/preferences/permissions.js @@ -216,10 +216,8 @@ var gPermissionManager = { this._type = aParams.permissionType; this._manageCapability = aParams.manageCapability; - var permissionsText = document.getElementById("permissionsText"); - while (permissionsText.hasChildNodes()) - permissionsText.firstChild.remove(); - permissionsText.appendChild(document.createTextNode(aParams.introText)); + let permissionsText = document.getElementById("permissionsText"); + permissionsText.textContent = aParams.introText; document.title = aParams.windowTitle; diff --git a/devtools/client/debugger/new/README.mozilla b/devtools/client/debugger/new/README.mozilla index a154e473cbee..adcaa7add787 100644 --- a/devtools/client/debugger/new/README.mozilla +++ b/devtools/client/debugger/new/README.mozilla @@ -1,13 +1,12 @@ This is the debugger.html project output. See https://github.com/devtools-html/debugger.html -Version 19.2 - -Comparison: https://github.com/devtools-html/debugger.html/compare/release-19-1...release-19-2 +Version 20.0 +Comparison: https://github.com/devtools-html/debugger.html/compare/release-19-2...release-20 Packages: - babel-plugin-transform-es2015-modules-commonjs @6.26.0 - babel-preset-react @6.24.1 -- react @16.2.0 -- react-dom @16.2.0 -- webpack @3.11.0 +- react @15.6.2 +- react-dom @15.6.2 +- webpack @3.10.0 diff --git a/devtools/client/debugger/new/debugger.js b/devtools/client/debugger/new/debugger.js index 9dc8d9dcfebe..a62c4f601e3b 100644 --- a/devtools/client/debugger/new/debugger.js +++ b/devtools/client/debugger/new/debugger.js @@ -7,7 +7,7 @@ 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]; } -})(typeof self !== 'undefined' ? self : 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__) { +})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_0__, __WEBPACK_EXTERNAL_MODULE_11__, __WEBPACK_EXTERNAL_MODULE_39__, __WEBPACK_EXTERNAL_MODULE_57__, __WEBPACK_EXTERNAL_MODULE_146__, __WEBPACK_EXTERNAL_MODULE_229__, __WEBPACK_EXTERNAL_MODULE_437__, __WEBPACK_EXTERNAL_MODULE_438__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; @@ -70,755 +70,502 @@ return /******/ (function(modules) { // webpackBootstrap /******/ __webpack_require__.p = "/assets/build"; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 46); +/******/ return __webpack_require__(__webpack_require__.s = 304); /******/ }) /************************************************************************/ -/******/ ({ - -/***/ 0: +/******/ ([ +/* 0 */ /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_0__; /***/ }), - -/***/ 10: +/* 1 */ /***/ (function(module, exports, __webpack_require__) { -var Symbol = __webpack_require__(7); +"use strict"; -/** Used for built-in method references. */ -var objectProto = Object.prototype; -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _expressions = __webpack_require__(209); + +Object.keys(_expressions).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _expressions[key]; + } + }); +}); + +var _sources = __webpack_require__(32); + +Object.keys(_sources).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _sources[key]; + } + }); +}); + +var _pause = __webpack_require__(74); + +Object.keys(_pause).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _pause[key]; + } + }); +}); + +var _debuggee = __webpack_require__(210); + +Object.keys(_debuggee).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _debuggee[key]; + } + }); +}); + +var _breakpoints = __webpack_require__(101); + +Object.keys(_breakpoints).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _breakpoints[key]; + } + }); +}); + +var _pendingBreakpoints = __webpack_require__(211); + +Object.keys(_pendingBreakpoints).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _pendingBreakpoints[key]; + } + }); +}); + +var _ui = __webpack_require__(154); + +Object.keys(_ui).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _ui[key]; + } + }); +}); + +var _fileSearch = __webpack_require__(212); + +Object.keys(_fileSearch).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _fileSearch[key]; + } + }); +}); + +var _ast = __webpack_require__(155); + +Object.keys(_ast).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _ast[key]; + } + }); +}); + +var _coverage = __webpack_require__(213); + +Object.keys(_coverage).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _coverage[key]; + } + }); +}); + +var _projectTextSearch = __webpack_require__(102); + +Object.keys(_projectTextSearch).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _projectTextSearch[key]; + } + }); +}); + +var _replay = __webpack_require__(214); + +Object.keys(_replay).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _replay[key]; + } + }); +}); + +var _sourceTree = __webpack_require__(215); + +Object.keys(_sourceTree).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _sourceTree[key]; + } + }); +}); + +var _eventListeners = __webpack_require__(216); + +Object.defineProperty(exports, "getEventListeners", { + enumerable: true, + get: function () { + return _eventListeners.getEventListeners; + } +}); + +var _quickOpen = __webpack_require__(217); + +Object.defineProperty(exports, "getQuickOpenEnabled", { + enumerable: true, + get: function () { + return _quickOpen.getQuickOpenEnabled; + } +}); +Object.defineProperty(exports, "getQuickOpenQuery", { + enumerable: true, + get: function () { + return _quickOpen.getQuickOpenQuery; + } +}); +Object.defineProperty(exports, "getQuickOpenType", { + enumerable: true, + get: function () { + return _quickOpen.getQuickOpenType; + } +}); + +var _breakpointAtLocation = __webpack_require__(405); + +Object.defineProperty(exports, "getBreakpointAtLocation", { + enumerable: true, + get: function () { + return _breakpointAtLocation.getBreakpointAtLocation; + } +}); + +var _visibleBreakpoints = __webpack_require__(406); + +Object.defineProperty(exports, "getVisibleBreakpoints", { + enumerable: true, + get: function () { + return _visibleBreakpoints.getVisibleBreakpoints; + } +}); + +var _isSelectedFrameVisible = __webpack_require__(407); + +Object.defineProperty(exports, "isSelectedFrameVisible", { + enumerable: true, + get: function () { + return _isSelectedFrameVisible.isSelectedFrameVisible; + } +}); + +var _getCallStackFrames = __webpack_require__(408); + +Object.defineProperty(exports, "getCallStackFrames", { + enumerable: true, + get: function () { + return _getCallStackFrames.getCallStackFrames; + } +}); + +var _visibleSelectedFrame = __webpack_require__(409); + +Object.defineProperty(exports, "getVisibleSelectedFrame", { + enumerable: true, + get: function () { + return _visibleSelectedFrame.getVisibleSelectedFrame; + } +}); + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { /** - * 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. + * Copyright (c) 2013-present, Facebook, Inc. * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the raw `toStringTag`. + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. */ -function getRawTag(value) { - var isOwn = hasOwnProperty.call(value, symToStringTag), - tag = value[symToStringTag]; - try { - value[symToStringTag] = undefined; - var unmasked = true; - } catch (e) {} +if (false) { + var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' && + Symbol.for && + Symbol.for('react.element')) || + 0xeac7; - var result = nativeObjectToString.call(value); - if (unmasked) { - if (isOwn) { - value[symToStringTag] = tag; + 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__(321)(); +} + + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Copyright (c) 2015-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(f) { + if (true) { + module.exports = f(__webpack_require__(0)); + /* global define */ + } else if (typeof define === 'function' && define.amd) { + define(['react'], f); + } else { + var g; + if (typeof window !== 'undefined') { + g = window; + } else if (typeof global !== 'undefined') { + g = global; + } else if (typeof self !== 'undefined') { + g = self; } else { - delete value[symToStringTag]; + g = this; } - } - return result; -} -module.exports = getRawTag; - - -/***/ }), - -/***/ 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; - - -/***/ }), - -/***/ 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 = "" - -/***/ }), - -/***/ 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; - - -/***/ }), - -/***/ 1043: -/***/ (function(module, exports) { - -module.exports = "" - -/***/ }), - -/***/ 1044: -/***/ (function(module, exports) { - -module.exports = "Created with Sketch." - -/***/ }), - -/***/ 1045: -/***/ (function(module, exports) { - -module.exports = "Created with Sketch." - -/***/ }), - -/***/ 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; - - -/***/ }), - -/***/ 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; - - -/***/ }), - -/***/ 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; - - -/***/ }), - -/***/ 1117: -/***/ (function(module, exports) { - -module.exports = "" - -/***/ }), - -/***/ 1118: -/***/ (function(module, exports) { - -module.exports = "" - -/***/ }), - -/***/ 1119: -/***/ (function(module, exports) { - -module.exports = "" - -/***/ }), - -/***/ 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; - - -/***/ }), - -/***/ 1126: -/***/ (function(module, exports) { - -module.exports = "" - -/***/ }), - -/***/ 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]) ? [] : {}); - } + if (typeof g.React === 'undefined') { + throw Error('React module should be required before ReactDOMFactories'); } - assignValue(nested, key, newValue); - nested = nested[key]; + + g.ReactDOMFactories = f(g.React); } - return object; -} +})(function(React) { + /** + * Create a factory that creates HTML tag elements. + */ + function createDOMFactory(type) { + var factory = React.createElement.bind(null, type); + // Expose the type on the factory and the prototype so that it can be + // easily accessed on elements. E.g. `.type === Foo`. + // This should not be named `constructor` since this may not be the function + // that created the element, and it may not even be a constructor. + factory.type = type; + return factory; + }; -module.exports = baseSet; + /** + * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes. + */ + var ReactDOMFactories = { + a: createDOMFactory('a'), + abbr: createDOMFactory('abbr'), + address: createDOMFactory('address'), + area: createDOMFactory('area'), + article: createDOMFactory('article'), + aside: createDOMFactory('aside'), + audio: createDOMFactory('audio'), + b: createDOMFactory('b'), + base: createDOMFactory('base'), + bdi: createDOMFactory('bdi'), + bdo: createDOMFactory('bdo'), + big: createDOMFactory('big'), + blockquote: createDOMFactory('blockquote'), + body: createDOMFactory('body'), + br: createDOMFactory('br'), + button: createDOMFactory('button'), + canvas: createDOMFactory('canvas'), + caption: createDOMFactory('caption'), + cite: createDOMFactory('cite'), + code: createDOMFactory('code'), + col: createDOMFactory('col'), + colgroup: createDOMFactory('colgroup'), + data: createDOMFactory('data'), + datalist: createDOMFactory('datalist'), + dd: createDOMFactory('dd'), + del: createDOMFactory('del'), + details: createDOMFactory('details'), + dfn: createDOMFactory('dfn'), + dialog: createDOMFactory('dialog'), + div: createDOMFactory('div'), + dl: createDOMFactory('dl'), + dt: createDOMFactory('dt'), + em: createDOMFactory('em'), + embed: createDOMFactory('embed'), + fieldset: createDOMFactory('fieldset'), + figcaption: createDOMFactory('figcaption'), + figure: createDOMFactory('figure'), + footer: createDOMFactory('footer'), + form: createDOMFactory('form'), + h1: createDOMFactory('h1'), + h2: createDOMFactory('h2'), + h3: createDOMFactory('h3'), + h4: createDOMFactory('h4'), + h5: createDOMFactory('h5'), + h6: createDOMFactory('h6'), + head: createDOMFactory('head'), + header: createDOMFactory('header'), + hgroup: createDOMFactory('hgroup'), + hr: createDOMFactory('hr'), + html: createDOMFactory('html'), + i: createDOMFactory('i'), + iframe: createDOMFactory('iframe'), + img: createDOMFactory('img'), + input: createDOMFactory('input'), + ins: createDOMFactory('ins'), + kbd: createDOMFactory('kbd'), + keygen: createDOMFactory('keygen'), + label: createDOMFactory('label'), + legend: createDOMFactory('legend'), + li: createDOMFactory('li'), + link: createDOMFactory('link'), + main: createDOMFactory('main'), + map: createDOMFactory('map'), + mark: createDOMFactory('mark'), + menu: createDOMFactory('menu'), + menuitem: createDOMFactory('menuitem'), + meta: createDOMFactory('meta'), + meter: createDOMFactory('meter'), + nav: createDOMFactory('nav'), + noscript: createDOMFactory('noscript'), + object: createDOMFactory('object'), + ol: createDOMFactory('ol'), + optgroup: createDOMFactory('optgroup'), + option: createDOMFactory('option'), + output: createDOMFactory('output'), + p: createDOMFactory('p'), + param: createDOMFactory('param'), + picture: createDOMFactory('picture'), + pre: createDOMFactory('pre'), + progress: createDOMFactory('progress'), + q: createDOMFactory('q'), + rp: createDOMFactory('rp'), + rt: createDOMFactory('rt'), + ruby: createDOMFactory('ruby'), + s: createDOMFactory('s'), + samp: createDOMFactory('samp'), + script: createDOMFactory('script'), + section: createDOMFactory('section'), + select: createDOMFactory('select'), + small: createDOMFactory('small'), + source: createDOMFactory('source'), + span: createDOMFactory('span'), + strong: createDOMFactory('strong'), + style: createDOMFactory('style'), + sub: createDOMFactory('sub'), + summary: createDOMFactory('summary'), + sup: createDOMFactory('sup'), + table: createDOMFactory('table'), + tbody: createDOMFactory('tbody'), + td: createDOMFactory('td'), + textarea: createDOMFactory('textarea'), + tfoot: createDOMFactory('tfoot'), + th: createDOMFactory('th'), + thead: createDOMFactory('thead'), + time: createDOMFactory('time'), + title: createDOMFactory('title'), + tr: createDOMFactory('tr'), + track: createDOMFactory('track'), + u: createDOMFactory('u'), + ul: createDOMFactory('ul'), + var: createDOMFactory('var'), + video: createDOMFactory('video'), + wbr: createDOMFactory('wbr'), + // SVG + circle: createDOMFactory('circle'), + clipPath: createDOMFactory('clipPath'), + defs: createDOMFactory('defs'), + ellipse: createDOMFactory('ellipse'), + g: createDOMFactory('g'), + image: createDOMFactory('image'), + line: createDOMFactory('line'), + linearGradient: createDOMFactory('linearGradient'), + mask: createDOMFactory('mask'), + path: createDOMFactory('path'), + pattern: createDOMFactory('pattern'), + polygon: createDOMFactory('polygon'), + polyline: createDOMFactory('polyline'), + radialGradient: createDOMFactory('radialGradient'), + rect: createDOMFactory('rect'), + stop: createDOMFactory('stop'), + svg: createDOMFactory('svg'), + text: createDOMFactory('text'), + tspan: createDOMFactory('tspan'), + }; -/***/ }), - -/***/ 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; - - -/***/ }), - -/***/ 1153: -/***/ (function(module, exports) { - -module.exports = "" - -/***/ }), - -/***/ 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) { - var type = typeof value; - length = length == null ? MAX_SAFE_INTEGER : length; - - return !!length && - (type == 'number' || - (type != 'symbol' && reIsUint.test(value))) && - (value > -1 && value % 1 == 0 && value < length); -} - -module.exports = isIndex; - - -/***/ }), - -/***/ 1174: -/***/ (function(module, exports) { - -module.exports = "image/svg+xml" - -/***/ }), - -/***/ 118: -/***/ (function(module, exports) { + // due to wrapper and conditionals at the top, this will either become + // `module.exports ReactDOMFactories` if that is available, + // otherwise it will be defined via `define(['react'], ReactDOMFactories)` + // if that is available, + // otherwise it will be defined as global variable. + return ReactDOMFactories; +}); /***/ }), - -/***/ 1189: +/* 4 */ /***/ (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 import */ var __WEBPACK_IMPORTED_MODULE_0__components_Provider__ = __webpack_require__(320); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__components_connectAdvanced__ = __webpack_require__(200); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__connect_connect__ = __webpack_require__(328); /* 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"]; }); @@ -830,2036 +577,1385 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /***/ }), - -/***/ 119: +/* 5 */ /***/ (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))) - -/***/ }), - -/***/ 1190: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - "use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = warning; + + +/* 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 +const validProtocols = /^(http|https|ftp|data|javascript|resource|chrome):/i; +const tokenSplitRegex = /(\s|\'|\"|\\)+/; +const ELLIPSIS = "\u2026"; +const dom = __webpack_require__(3); +const { span } = dom; + /** - * Prints a warning in the console if it exists. + * 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. +const 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|. +const escapeRegexp = new RegExp("[" + +// Quote and backslash. +"\"\\\\" + +// Controls. +"\x00-\x1f" + +// More controls. +"\x7f-\x9f" + +// BOM +"\ufeff" + +// Specials, except for the replacement character. +"\ufff0-\ufffc\ufffe\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} message The warning message. - * @returns {void} + * @param {String} str + * the input + * @param {Boolean} escapeWhitespace + * if true, TAB, CR, and NL characters will be escaped + * @return {String} the escaped string */ -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; +function escapeString(str, escapeWhitespace) { + return "\"" + str.replace(escapeRegexp, (match, offset) => { + let c = match.charCodeAt(0); + if (c in escapeMap) { + if (!escapeWhitespace && (c === 9 || c === 0xa || c === 0xd)) { + return match[0]; } + return escapeMap[c]; } - }; - - 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 ' + (methodName + '. 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; + 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; } - - 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); + let 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) + "}"; } - }; - - 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); + return ""; } - - 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; + // Other surrogate characters are passed through. + return match; } - - 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; + return "\\u" + ("0000" + c.toString(16)).substr(-4); + }) + "\""; } -/* harmony default export */ __webpack_exports__["b"] = (createProvider()); - -/***/ }), - -/***/ 1196: -/***/ (function(module, exports, __webpack_require__) { - /** - * Copyright 2015, Yahoo! Inc. - * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. + * 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 (global, factory) { - true ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global.hoistNonReactStatics = factory()); -}(this, (function () { - 'use strict'; - - var REACT_STATICS = { - childContextTypes: true, - contextTypes: true, - defaultProps: true, - displayName: true, - getDefaultProps: true, - getDerivedStateFromProps: true, - mixins: true, - propTypes: true, - type: true +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 = ELLIPSIS) { + // 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; + } + + let 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 + let 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) { + let params = []; + + // In case the text is empty just return the empty parameters + if (text == "") { + return params; + } + + let searchParams = new URLSearchParams(text); + let entries = [...searchParams.entries()]; + return entries.map(entry => { + return { + name: entry[0], + value: entry[1] }; - - var KNOWN_STATICS = { - name: true, - length: true, - prototype: true, - caller: true, - callee: true, - arguments: true, - arity: true + }); +} + +function getFileName(url) { + let 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) { + const reSplitFile = /(.*?):\/{2,3}([^\/]*)(.*?)([^\/]*?)($|\?.*)/; + let m = reSplitFile.exec(url); + + if (!m) { + return { + name: url, + path: url }; - - 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); - - return 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; + } else if (m[4] == "" && m[5] == "") { + return { + protocol: m[1], + domain: m[2], + path: m[3], + name: m[3] != "/" ? m[3] : m[2] }; -}))); - - -/***/ }), - -/***/ 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); - }; - } + protocol: m[1], + domain: m[2], + path: m[2] + m[3], + name: m[4] + m[5] }; } -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. +/** + * Wrap the provided render() method of a rep in a try/catch block that will render a + * fallback rep if the render fails. */ - -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 + ')'; +function wrapRender(renderMethod) { + const wrappedFunction = function (props) { + try { + return renderMethod.call(this, props); + } catch (e) { + console.error(e); + return span({ + className: "objectBox objectBox-failure", + title: "This object could not be rendered, " + "please file a bug on bugzilla.mozilla.org" }, - - // 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)); + /* Labels have to be hardcoded for reps, see Bug 1317038. */ + "Invalid object"); + } }; + wrappedFunction.propTypes = renderMethod.propTypes; + return wrappedFunction; } -/* 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; +/** + * 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) { + let keys = Object.keys(grip.preview.properties); + let values = Object.values(grip.preview.properties); + return [grip.preview.target, ...keys, ...values]; + } + + // RegEx Grip + if (grip.displayString) { + return [grip.displayString]; + } + + // Generic Grip + if (grip.preview && grip.preview.ownProperties) { + let propertiesValues = Object.values(grip.preview.ownProperties).map(property => property.value || property); + + let 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 []; } -function shallowEqual(objA, objB) { - if (is(objA, objB)) return true; +/** + * 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) { + if (noGrip || Object(object) !== object) { + return typeof object; + } + if (object.type === "object") { + return object.class; + } + return object.type; +} - if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { +/** + * 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 keysA = Object.keys(objA); - var keysB = Object.keys(objB); + let tokens = grip.split(tokenSplitRegex); + return tokens.some(isURL); +} - 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]])) { +/** + * 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; + } +} + +const ellipsisElement = span({ + key: "more", + className: "more-ellipsis", + title: `more${ELLIPSIS}` +}, ELLIPSIS); + +module.exports = { + isGrip, + isURL, + cropString, + containsURL, + rawCropString, + sanitizeString, + escapeString, + wrapRender, + cropMultipleLines, + parseURLParams, + parseURLEncodedText, + getFileName, + getURLDisplayString, + maybeEscapePropertyName, + getGripPreviewItems, + getGripType, + tokenSplitRegex, + ellipsisElement, + ELLIPSIS +}; + +/***/ }), +/* 6 */ +/***/ (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; + } +}()); + + +/***/ }), +/* 7 */ +/***/ (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; }; /* 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 . */ + +var _breakpoints = __webpack_require__(59); + +var breakpoints = _interopRequireWildcard(_breakpoints); + +var _expressions = __webpack_require__(75); + +var expressions = _interopRequireWildcard(_expressions); + +var _eventListeners = __webpack_require__(427); + +var eventListeners = _interopRequireWildcard(_eventListeners); + +var _pause = __webpack_require__(159); + +var pause = _interopRequireWildcard(_pause); + +var _navigation = __webpack_require__(451); + +var navigation = _interopRequireWildcard(_navigation); + +var _ui = __webpack_require__(77); + +var ui = _interopRequireWildcard(_ui); + +var _fileSearch = __webpack_require__(452); + +var fileSearch = _interopRequireWildcard(_fileSearch); + +var _ast = __webpack_require__(163); + +var ast = _interopRequireWildcard(_ast); + +var _coverage = __webpack_require__(453); + +var coverage = _interopRequireWildcard(_coverage); + +var _projectTextSearch = __webpack_require__(454); + +var projectTextSearch = _interopRequireWildcard(_projectTextSearch); + +var _replay = __webpack_require__(455); + +var replay = _interopRequireWildcard(_replay); + +var _quickOpen = __webpack_require__(456); + +var quickOpen = _interopRequireWildcard(_quickOpen); + +var _sourceTree = __webpack_require__(232); + +var sourceTree = _interopRequireWildcard(_sourceTree); + +var _sources = __webpack_require__(34); + +var sources = _interopRequireWildcard(_sources); + +var _debuggee = __webpack_require__(231); + +var debuggee = _interopRequireWildcard(_debuggee); + +var _toolbox = __webpack_require__(457); + +var toolbox = _interopRequireWildcard(_toolbox); + +var _preview = __webpack_require__(458); + +var preview = _interopRequireWildcard(_preview); + +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 = _extends({}, navigation, breakpoints, expressions, eventListeners, sources, pause, ui, fileSearch, ast, coverage, projectTextSearch, replay, quickOpen, sourceTree, debuggee, toolbox, preview); + +/***/ }), +/* 8 */ +/***/ (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__(195); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__combineReducers__ = __webpack_require__(317); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__bindActionCreators__ = __webpack_require__(318); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__applyMiddleware__ = __webpack_require__(319); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__compose__ = __webpack_require__(198); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__utils_warning__ = __webpack_require__(197); +/* 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.'); +} + + + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isMinified = undefined; + +var _isMinified = __webpack_require__(398); + +Object.defineProperty(exports, "isMinified", { + enumerable: true, + get: function () { + return _isMinified.isMinified; + } +}); +exports.shouldPrettyPrint = shouldPrettyPrint; +exports.isJavaScript = isJavaScript; +exports.isPretty = isPretty; +exports.isPrettyURL = isPrettyURL; +exports.isThirdParty = isThirdParty; +exports.getPrettySourceURL = getPrettySourceURL; +exports.getRawSourceURL = getRawSourceURL; +exports.getFilenameFromURL = getFilenameFromURL; +exports.getFormattedSourceId = getFormattedSourceId; +exports.getFilename = getFilename; +exports.getFileURL = getFileURL; +exports.getSourcePath = getSourcePath; +exports.getSourceLineCount = getSourceLineCount; +exports.getMode = getMode; +exports.isLoaded = isLoaded; +exports.isLoading = isLoading; + +var _devtoolsSourceMap = __webpack_require__(12); + +var _utils = __webpack_require__(72); + +var _path = __webpack_require__(153); + +var _url = __webpack_require__(100); + +/** + * Trims the query part or reference identifier of a url string, if necessary. + * + * @memberof utils/source + * @static + */ +function trimUrlQuery(url) { + const length = url.length; + const q1 = url.indexOf("?"); + const q2 = url.indexOf("&"); + const q3 = url.indexOf("#"); + const 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; + } + const _isPretty = isPretty(source); + const _isJavaScript = isJavaScript(source); + const isOriginal = (0, _devtoolsSourceMap.isOriginalId)(source.get("id")); + const hasSourceMap = source.get("sourceMapURL"); + + if (_isPretty || isOriginal || hasSourceMap || !_isJavaScript) { + return false; } return true; } -/***/ }), - -/***/ 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'); +/** + * 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) { + const url = source.get("url"); + const contentType = source.get("contentType"); + return url && /\.(jsm|js)?$/.test(trimUrlQuery(url)) || !!(contentType && contentType.includes("javascript")); } -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; }; - - -/***/ }), - -/***/ 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); -} - -/***/ }), - -/***/ 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`. + * @memberof utils/source + * @static */ -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); +function isPretty(source) { + const url = source.get("url"); + return isPrettyURL(url); } -/* harmony default export */ __webpack_exports__["a"] = (baseGetTag); +function isPrettyURL(url) { + return url ? /formatted$/.test(url) : false; +} +function isThirdParty(source) { + const url = source.get("url"); + if (!source || !url) { + return false; + } + + return !!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 ? url.replace(/:formatted$/, "") : url; +} + +function resolveFileURL(url, transformUrl = initialUrl => initialUrl) { + url = getRawSourceURL(url || ""); + const name = transformUrl(url); + return (0, _utils.endTruncateStr)(name, 50); +} + +function getFilenameFromURL(url) { + return resolveFileURL(url, initialUrl => (0, _path.basename)(initialUrl) || "(index)"); +} + +function getFormattedSourceId(id) { + const sourceId = id.split("/")[1]; + return `SOURCE${sourceId}`; +} + +/** + * 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) { + const { url, id } = source; + if (!url) { + return getFormattedSourceId(id); + } + + let filename = getFilenameFromURL(url); + const qMarkIdx = filename.indexOf("?"); + if (qMarkIdx > 0) { + filename = filename.slice(0, qMarkIdx); + } + return filename; +} + +/** + * Show a source url. + * If the source does not have a url, use the source id. + * + * @memberof utils/source + * @static + */ +function getFileURL(source) { + const { url, id } = source; + if (!url) { + return getFormattedSourceId(id); + } + + return resolveFileURL(url); +} + +const contentTypeModeMap = { + "text/javascript": { name: "javascript" }, + "text/typescript": { name: "javascript", typescript: true }, + "text/coffeescript": { name: "coffeescript" }, + "text/typescript-jsx": { + name: "jsx", + base: { name: "javascript", typescript: true } + }, + "text/jsx": { name: "jsx" }, + "text/x-elm": { name: "elm" }, + "text/x-clojure": { name: "clojure" }, + "text/wasm": { name: "text" }, + "text/html": { name: "htmlmixed" } +}; + +function getSourcePath(url) { + if (!url) { + return ""; + } + + const { path, href } = (0, _url.parse)(url); + // 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 && !source.error) { + const { binary } = source.text; + return binary.length; + } + return source.text != undefined ? source.text.split("\n").length : 0; +} + +/** + * + * Checks if a source is minified based on some heuristics + * @param key + * @param text + * @return boolean + * @memberof utils/source + * @static + */ + +/** + * + * Returns Code Mirror mode for source content type + * @param contentType + * @return String + * @memberof utils/source + * @static + */ + +function getMode(source, symbols) { + const { contentType, text, isWasm, url } = source; + + if (!text || isWasm) { + return { name: "text" }; + } + + if (url && url.match(/\.jsx$/i) || symbols && symbols.hasJsx) { + return { name: "jsx" }; + } + + const languageMimeMap = [{ ext: ".c", mode: "text/x-csrc" }, { ext: ".kt", mode: "text/x-kotlin" }, { ext: ".cpp", mode: "text/x-c++src" }, { ext: ".m", mode: "text/x-objectivec" }, { ext: ".rs", mode: "text/x-rustsrc" }]; + + // check for C and other non JS languages + if (url) { + const result = languageMimeMap.find(({ ext }) => url.endsWith(ext)); + + if (result !== undefined) { + return { name: result.mode }; + } + } + + // 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. + const isHTMLLike = text.match(/^\s*" - -/***/ }), - -/***/ 124: +/* 10 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__freeGlobal_js__ = __webpack_require__(125); +Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); +/* 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 . */ +// @flow + +const { isDevelopment } = __webpack_require__(13); +const { Services, PrefsHelper } = __webpack_require__(70); + +const prefsSchemaVersion = "1.0.3"; + +const pref = Services.pref; + +if (isDevelopment()) { + pref("devtools.debugger.auto-pretty-print", true); + 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", true); + pref("devtools.debugger.scopes-visible", true); + pref("devtools.debugger.workers-visible", true); + pref("devtools.debugger.expressions-visible", true); + pref("devtools.debugger.breakpoints-visible", true); + 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.project-directory-root", ""); + pref("devtools.debugger.prefs-schema-version", "1.0.1"); + pref("devtools.debugger.features.workers", true); + pref("devtools.debugger.features.async-stepping", true); + pref("devtools.debugger.features.wasm", true); + pref("devtools.debugger.features.shortcuts", true); + pref("devtools.debugger.features.root", true); + pref("devtools.debugger.features.column-breakpoints", false); + pref("devtools.debugger.features.chrome-scopes", false); + pref("devtools.debugger.features.map-scopes", true); + pref("devtools.debugger.features.breakpoints-dropdown", true); + pref("devtools.debugger.features.remove-command-bar-options", true); + pref("devtools.debugger.features.code-coverage", false); + pref("devtools.debugger.features.event-listeners", false); + pref("devtools.debugger.features.code-folding", false); + pref("devtools.debugger.features.outline", true); + pref("devtools.debugger.features.column-breakpoints", true); + pref("devtools.debugger.features.replay", true); +} + +const prefs = new PrefsHelper("devtools", { + autoPrettyPrint: ["Bool", "debugger.auto-pretty-print"], + 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"], + workersVisible: ["Bool", "debugger.workers-visible"], + breakpointsVisible: ["Bool", "debugger.breakpoints-visible"], + expressionsVisible: ["Bool", "debugger.expressions-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"], + projectDirectoryRoot: ["Char", "debugger.project-directory-root", ""] +}); +/* harmony export (immutable) */ __webpack_exports__["prefs"] = prefs; + + +const features = new PrefsHelper("devtools.debugger.features", { + asyncStepping: ["Bool", "async-stepping"], + wasm: ["Bool", "wasm"], + shortcuts: ["Bool", "shortcuts"], + root: ["Bool", "root"], + columnBreakpoints: ["Bool", "column-breakpoints"], + chromeScopes: ["Bool", "chrome-scopes"], + mapScopes: ["Bool", "map-scopes"], + breakpointsDropdown: ["Bool", "breakpoints-dropdown"], + removeCommandBarOptions: ["Bool", "remove-command-bar-options"], + workers: ["Bool", "workers"], + codeCoverage: ["Bool", "code-coverage"], + eventListeners: ["Bool", "event-listeners"], + outline: ["Bool", "outline"], + codeFolding: ["Bool", "code-folding"], + replay: ["Bool", "replay"] +}); +/* harmony export (immutable) */ __webpack_exports__["features"] = features; + + +if (prefs.debuggerPrefsSchemaVersion !== prefsSchemaVersion) { + // clear pending Breakpoints + prefs.pendingBreakpoints = {}; + prefs.debuggerPrefsSchemaVersion = prefsSchemaVersion; +} + + +/***/ }), +/* 11 */ +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE_11__; + +/***/ }), +/* 12 */ +/***/ (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__(149); + +const { workerUtils: { WorkerDispatcher } } = __webpack_require__(27); + +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) +}; + +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +const feature = __webpack_require__(336); + +module.exports = feature; + +/***/ }), +/* 14 */ +/***/ (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") + } +}; + +/***/ }), +/* 15 */ +/***/ (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; }; /* 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 . */ + +var _sourceDocuments = __webpack_require__(228); + +Object.keys(_sourceDocuments).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _sourceDocuments[key]; + } + }); +}); + +var _getTokenLocation = __webpack_require__(439); + +Object.keys(_getTokenLocation).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _getTokenLocation[key]; + } + }); +}); + +var _sourceSearch = __webpack_require__(440); + +Object.keys(_sourceSearch).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _sourceSearch[key]; + } + }); +}); + +var _ui = __webpack_require__(106); + +Object.keys(_ui).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _ui[key]; + } + }); +}); + +var _createEditor = __webpack_require__(441); + +Object.keys(_createEditor).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _createEditor[key]; + } + }); +}); +exports.shouldShowPrettyPrint = shouldShowPrettyPrint; +exports.shouldShowFooter = shouldShowFooter; +exports.traverseResults = traverseResults; +exports.toEditorLine = toEditorLine; +exports.toEditorPosition = toEditorPosition; +exports.toEditorRange = toEditorRange; +exports.toSourceLine = toSourceLine; +exports.scrollToColumn = scrollToColumn; +exports.toSourceLocation = toSourceLocation; +exports.markText = markText; +exports.lineAtHeight = lineAtHeight; +exports.getSourceLocationFromMouseEvent = getSourceLocationFromMouseEvent; +exports.forEachLine = forEachLine; +exports.removeLineClass = removeLineClass; +exports.clearLineClass = clearLineClass; +exports.getTextForLine = getTextForLine; +exports.getCursorLine = getCursorLine; + +var _source = __webpack_require__(9); + +var _wasm = __webpack_require__(105); + +var _devtoolsSourceMap = __webpack_require__(12); + +function shouldShowPrettyPrint(selectedSource) { + if (!selectedSource) { + return false; + } + + return (0, _source.shouldPrettyPrint)(selectedSource); +} + +function shouldShowFooter(selectedSource, horizontal) { + if (!horizontal) { + return true; + } + if (!selectedSource) { + return false; + } + return shouldShowPrettyPrint(selectedSource) || (0, _devtoolsSourceMap.isOriginalId)(selectedSource.get("id")); +} + +function traverseResults(e, ctx, query, dir, modifiers) { + e.stopPropagation(); + e.preventDefault(); + + if (dir == "prev") { + (0, _sourceSearch.findPrev)(ctx, query, true, modifiers); + } else if (dir == "next") { + (0, _sourceSearch.findNext)(ctx, query, true, modifiers); + } +} + +function toEditorLine(sourceId, lineOrOffset) { + if ((0, _wasm.isWasm)(sourceId)) { + // TODO ensure offset is always "mappable" to edit line. + return (0, _wasm.wasmOffsetToLine)(sourceId, lineOrOffset) || 0; + } + + return lineOrOffset ? lineOrOffset - 1 : 1; +} + +function toEditorPosition(location) { + return { + line: toEditorLine(location.sourceId, location.line), + column: (0, _wasm.isWasm)(location.sourceId) || !location.column ? 0 : location.column + }; +} + +function toEditorRange(sourceId, location) { + const { start, end } = location; + return { + start: toEditorPosition(_extends({}, start, { sourceId })), + end: toEditorPosition(_extends({}, end, { sourceId })) + }; +} + +function toSourceLine(sourceId, line) { + return (0, _wasm.isWasm)(sourceId) ? (0, _wasm.lineToWasmOffset)(sourceId, line) : line + 1; +} + +function scrollToColumn(codeMirror, line, column) { + const { top, left } = codeMirror.charCoords({ line: line, ch: column }, "local"); + + if (!isVisible(codeMirror, top, left)) { + const scroller = codeMirror.getScrollerElement(); + const centeredX = Math.max(left - scroller.offsetWidth / 2, 0); + const centeredY = Math.max(top - scroller.offsetHeight / 2, 0); + + codeMirror.scrollTo(centeredX, centeredY); + } +} + +function isVisible(codeMirror, top, left) { + function withinBounds(x, min, max) { + return x >= min && x <= max; + } + + const scrollArea = codeMirror.getScrollInfo(); + + const charWidth = codeMirror.defaultCharWidth(); + const inXView = withinBounds(left, scrollArea.left, scrollArea.left + (scrollArea.clientWidth - 30) - charWidth); + + const fontHeight = codeMirror.defaultTextHeight(); + const inYView = withinBounds(top, scrollArea.top, scrollArea.top + scrollArea.clientHeight - fontHeight); + + return inXView && inYView; +} + +function toSourceLocation(sourceId, location) { + return { + line: toSourceLine(sourceId, location.line), + column: (0, _wasm.isWasm)(sourceId) ? undefined : location.column + }; +} + +function markText(editor, className, { start, end }) { + return editor.codeMirror.markText({ ch: start.column, line: start.line }, { ch: end.column, line: end.line }, { className }); +} + +function lineAtHeight(editor, sourceId, event) { + const editorLine = editor.codeMirror.lineAtHeight(event.clientY); + return toSourceLine(sourceId, editorLine); +} + +function getSourceLocationFromMouseEvent(editor, selectedLocation, e) { + const { line, ch } = editor.codeMirror.coordsChar({ + left: e.clientX, + top: e.clientY + }); + + return { + sourceId: selectedLocation.sourceId, + line: line + 1, + column: ch + 1 + }; +} + +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; +} + +/***/ }), +/* 16 */ +/***/ (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; + + +/***/ }), +/* 17 */, +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + +var freeGlobal = __webpack_require__(52); /** 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')(); +var root = freeGlobal || freeSelf || Function('return this')(); -/* harmony default export */ __webpack_exports__["a"] = (root); +module.exports = 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__(3208))) - -/***/ }), - -/***/ 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); - - -/***/ }), - -/***/ 1290: -/***/ (function(module, exports) { - -module.exports = "" - -/***/ }), - -/***/ 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); - - -/***/ }), - -/***/ 1347: -/***/ (function(module, exports) { - -module.exports = "" - -/***/ }), - -/***/ 1348: -/***/ (function(module, exports) { - -module.exports = "" - -/***/ }), - -/***/ 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); - - -/***/ }), - -/***/ 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; - - -/***/ }), - -/***/ 146: +/* 19 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -7841,2827 +6937,54 @@ module.exports = isObjectLike; })); /***/ }), - -/***/ 150: +/* 20 */ /***/ (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 root = __webpack_require__(18); +/** Built-in value references. */ +var Symbol = root.Symbol; -var Immutable = __webpack_require__(146); +module.exports = Symbol; -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; /***/ }), - -/***/ 159: -/***/ (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. - */ - - +/* 21 */ +/***/ (function(module, exports) { /** - * 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; - - -/***/ }), - -/***/ 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 = 150; - - 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_row, csc_score, csc_should_rebuild, i, j, m, miss_budget, miss_left, 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; - csc_should_rebuild = true; - j = -1; - while (++j < n) { - score_row[j] = 0; - csc_row[j] = 0; - } - i = -1; - while (++i < m) { - si_lw = subject_lw[i]; - if (!si_lw.charCodeAt(0) in preparedQuery.charCodes) { - if (csc_should_rebuild) { - j = -1; - while (++j < n) { - csc_row[j] = 0; - } - csc_should_rebuild = false; - } - continue; - } - score = 0; - score_diag = 0; - csc_diag = 0; - record_miss = true; - csc_should_rebuild = true; - 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 Math.max(score, 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 < k) { - i--; - } - 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 = 20; - - file_coeff = 2.5; - - 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); - - -/***/ }), - -/***/ 1648: -/***/ (function(module, exports) { - -module.exports = "image/svg+xml" - -/***/ }), - -/***/ 1649: -/***/ (function(module, exports) { - -module.exports = "" - -/***/ }), - -/***/ 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); - - -/***/ }), - -/***/ 1650: -/***/ (function(module, exports) { - -module.exports = "Zeit - Black on white logo" - -/***/ }), - -/***/ 1651: -/***/ (function(module, exports) { - -module.exports = "" - -/***/ }), - -/***/ 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); - - -/***/ }), - -/***/ 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; - }; -} - -/***/ }), - -/***/ 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; -} - -/***/ }), - -/***/ 1733: -/***/ (function(module, exports) { - -module.exports = "" - -/***/ }), - -/***/ 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; - } -}()); - - -/***/ }), - -/***/ 1758: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * Copyright (c) 2015-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(f) { - if (true) { - module.exports = f(__webpack_require__(0)); - /* global define */ - } else if (typeof define === 'function' && define.amd) { - define(['react'], f); - } else { - var g; - if (typeof window !== 'undefined') { - g = window; - } else if (typeof global !== 'undefined') { - g = global; - } else if (typeof self !== 'undefined') { - g = self; - } else { - g = this; - } - - if (typeof g.React === 'undefined') { - throw Error('React module should be required before ReactDOMFactories'); - } - - g.ReactDOMFactories = f(g.React); - } -})(function(React) { - /** - * Create a factory that creates HTML tag elements. - */ - function createDOMFactory(type) { - var factory = React.createElement.bind(null, type); - // Expose the type on the factory and the prototype so that it can be - // easily accessed on elements. E.g. `.type === Foo`. - // This should not be named `constructor` since this may not be the function - // that created the element, and it may not even be a constructor. - factory.type = type; - return factory; - }; - - /** - * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes. - */ - var ReactDOMFactories = { - a: createDOMFactory('a'), - abbr: createDOMFactory('abbr'), - address: createDOMFactory('address'), - area: createDOMFactory('area'), - article: createDOMFactory('article'), - aside: createDOMFactory('aside'), - audio: createDOMFactory('audio'), - b: createDOMFactory('b'), - base: createDOMFactory('base'), - bdi: createDOMFactory('bdi'), - bdo: createDOMFactory('bdo'), - big: createDOMFactory('big'), - blockquote: createDOMFactory('blockquote'), - body: createDOMFactory('body'), - br: createDOMFactory('br'), - button: createDOMFactory('button'), - canvas: createDOMFactory('canvas'), - caption: createDOMFactory('caption'), - cite: createDOMFactory('cite'), - code: createDOMFactory('code'), - col: createDOMFactory('col'), - colgroup: createDOMFactory('colgroup'), - data: createDOMFactory('data'), - datalist: createDOMFactory('datalist'), - dd: createDOMFactory('dd'), - del: createDOMFactory('del'), - details: createDOMFactory('details'), - dfn: createDOMFactory('dfn'), - dialog: createDOMFactory('dialog'), - div: createDOMFactory('div'), - dl: createDOMFactory('dl'), - dt: createDOMFactory('dt'), - em: createDOMFactory('em'), - embed: createDOMFactory('embed'), - fieldset: createDOMFactory('fieldset'), - figcaption: createDOMFactory('figcaption'), - figure: createDOMFactory('figure'), - footer: createDOMFactory('footer'), - form: createDOMFactory('form'), - h1: createDOMFactory('h1'), - h2: createDOMFactory('h2'), - h3: createDOMFactory('h3'), - h4: createDOMFactory('h4'), - h5: createDOMFactory('h5'), - h6: createDOMFactory('h6'), - head: createDOMFactory('head'), - header: createDOMFactory('header'), - hgroup: createDOMFactory('hgroup'), - hr: createDOMFactory('hr'), - html: createDOMFactory('html'), - i: createDOMFactory('i'), - iframe: createDOMFactory('iframe'), - img: createDOMFactory('img'), - input: createDOMFactory('input'), - ins: createDOMFactory('ins'), - kbd: createDOMFactory('kbd'), - keygen: createDOMFactory('keygen'), - label: createDOMFactory('label'), - legend: createDOMFactory('legend'), - li: createDOMFactory('li'), - link: createDOMFactory('link'), - main: createDOMFactory('main'), - map: createDOMFactory('map'), - mark: createDOMFactory('mark'), - menu: createDOMFactory('menu'), - menuitem: createDOMFactory('menuitem'), - meta: createDOMFactory('meta'), - meter: createDOMFactory('meter'), - nav: createDOMFactory('nav'), - noscript: createDOMFactory('noscript'), - object: createDOMFactory('object'), - ol: createDOMFactory('ol'), - optgroup: createDOMFactory('optgroup'), - option: createDOMFactory('option'), - output: createDOMFactory('output'), - p: createDOMFactory('p'), - param: createDOMFactory('param'), - picture: createDOMFactory('picture'), - pre: createDOMFactory('pre'), - progress: createDOMFactory('progress'), - q: createDOMFactory('q'), - rp: createDOMFactory('rp'), - rt: createDOMFactory('rt'), - ruby: createDOMFactory('ruby'), - s: createDOMFactory('s'), - samp: createDOMFactory('samp'), - script: createDOMFactory('script'), - section: createDOMFactory('section'), - select: createDOMFactory('select'), - small: createDOMFactory('small'), - source: createDOMFactory('source'), - span: createDOMFactory('span'), - strong: createDOMFactory('strong'), - style: createDOMFactory('style'), - sub: createDOMFactory('sub'), - summary: createDOMFactory('summary'), - sup: createDOMFactory('sup'), - table: createDOMFactory('table'), - tbody: createDOMFactory('tbody'), - td: createDOMFactory('td'), - textarea: createDOMFactory('textarea'), - tfoot: createDOMFactory('tfoot'), - th: createDOMFactory('th'), - thead: createDOMFactory('thead'), - time: createDOMFactory('time'), - title: createDOMFactory('title'), - tr: createDOMFactory('tr'), - track: createDOMFactory('track'), - u: createDOMFactory('u'), - ul: createDOMFactory('ul'), - var: createDOMFactory('var'), - video: createDOMFactory('video'), - wbr: createDOMFactory('wbr'), - - // SVG - circle: createDOMFactory('circle'), - clipPath: createDOMFactory('clipPath'), - defs: createDOMFactory('defs'), - ellipse: createDOMFactory('ellipse'), - g: createDOMFactory('g'), - image: createDOMFactory('image'), - line: createDOMFactory('line'), - linearGradient: createDOMFactory('linearGradient'), - mask: createDOMFactory('mask'), - path: createDOMFactory('path'), - pattern: createDOMFactory('pattern'), - polygon: createDOMFactory('polygon'), - polyline: createDOMFactory('polyline'), - radialGradient: createDOMFactory('radialGradient'), - rect: createDOMFactory('rect'), - stop: createDOMFactory('stop'), - svg: createDOMFactory('svg'), - text: createDOMFactory('text'), - tspan: createDOMFactory('tspan'), - }; - - // due to wrapper and conditionals at the top, this will either become - // `module.exports ReactDOMFactories` if that is available, - // otherwise it will be defined via `define(['react'], ReactDOMFactories)` - // if that is available, - // otherwise it will be defined as global variable. - return ReactDOMFactories; -}); - - - -/***/ }), - -/***/ 1763: -/***/ (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 _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(3371); - -var _util = __webpack_require__(1777); - -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 _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 process = process || { env: {} }; - -var InlineSVG = function (_React$Component) { - _inherits(InlineSVG, _React$Component); - - function InlineSVG() { - _classCallCheck(this, InlineSVG); - - return _possibleConstructorReturn(this, (InlineSVG.__proto__ || Object.getPrototypeOf(InlineSVG)).apply(this, arguments)); - } - - _createClass(InlineSVG, [{ - 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 = void 0, - __html = void 0, - svgProps = void 0; - - var _props = this.props, - element = _props.element, - raw = _props.raw, - src = _props.src, - otherProps = _objectWithoutProperties(_props, ['element', 'raw', 'src']); - - if (raw === true) { - Element = 'svg'; - svgProps = (0, _util.extractSVGProps)(src); - __html = (0, _util.getSVGFromSource)(src).innerHTML; - } - __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; - - -InlineSVG.defaultProps = { - element: 'i', - raw: false, - src: '' -}; - -InlineSVG.propTypes = { - src: _propTypes.string.isRequired, - element: _propTypes.string, - raw: _propTypes.bool -}; - -/***/ }), - -/***/ 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; -}; - - -/***/ }), - -/***/ 1777: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.convertReactSVGDOMProperty = convertReactSVGDOMProperty; -exports.startsWith = startsWith; -exports.serializeAttrs = serializeAttrs; -exports.getSVGFromSource = getSVGFromSource; -exports.extractSVGProps = extractSVGProps; -// Transform DOM prop/attr names applicable to `` element but react-limited - -function convertReactSVGDOMProperty(str) { - return str.replace(/[-|:]([a-z])/g, function (g) { - return g[1].toUpperCase(); - }); -} - -function startsWith(str, substring) { - return str.indexOf(substring) === 0; -} - -var DataPropPrefix = 'data-'; -// Serialize `Attr` objects in `NamedNodeMap` -function serializeAttrs(map) { - var ret = {}; - for (var prop, i = 0; i < map.length; i++) { - var key = map[i].name; - if (!startsWith(key, DataPropPrefix)) { - prop = convertReactSVGDOMProperty(key); - } - ret[prop] = map[i].value; - } - return ret; -} - -function getSVGFromSource(src) { - var svgContainer = document.createElement('div'); - svgContainer.innerHTML = src; - var svg = svgContainer.firstElementChild; - svg.remove(); // deref from parent element - return svg; -} - -// get element props -function extractSVGProps(src) { - var map = getSVGFromSource(src).attributes; - return map.length > 0 ? serializeAttrs(map) : null; -} - -/***/ }), - -/***/ 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; - -/***/ }), - -/***/ 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; - -/***/ }), - -/***/ 1808: -/***/ (function(module, exports) { - -module.exports = "" - -/***/ }), - -/***/ 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; - - -/***/ }), - -/***/ 197: -/***/ (function(module, exports) { - -module.exports = __WEBPACK_EXTERNAL_MODULE_197__; - -/***/ }), - -/***/ 2: -/***/ (function(module, exports) { - -module.exports = __WEBPACK_EXTERNAL_MODULE_2__; - -/***/ }), - -/***/ 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)(); -} - - -/***/ }), - -/***/ 2012: -/***/ (function(module, exports) { - -module.exports = "" - -/***/ }), - -/***/ 22: -/***/ (function(module, exports) { - -module.exports = __WEBPACK_EXTERNAL_MODULE_22__; - -/***/ }), - -/***/ 2247: -/***/ (function(module, exports) { - -module.exports = "" - -/***/ }), - -/***/ 2250: -/***/ (function(module, exports) { - -module.exports = "" - -/***/ }), - -/***/ 2251: -/***/ (function(module, exports) { - -module.exports = "" - -/***/ }), - -/***/ 2252: -/***/ (function(module, exports) { - -module.exports = "" - -/***/ }), - -/***/ 226: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* 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 . */ - -// @flow - -const { isDevelopment } = __webpack_require__(3198); -const { Services, PrefsHelper } = __webpack_require__(3221); - -const prefsSchemaVersion = "1.0.3"; - -const pref = Services.pref; - -if (isDevelopment()) { - pref("devtools.debugger.auto-pretty-print", true); - 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", true); - pref("devtools.debugger.scopes-visible", true); - pref("devtools.debugger.workers-visible", true); - pref("devtools.debugger.expressions-visible", true); - pref("devtools.debugger.breakpoints-visible", true); - 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.project-directory-root", ""); - pref("devtools.debugger.prefs-schema-version", "1.0.1"); - pref("devtools.debugger.features.workers", true); - pref("devtools.debugger.features.async-stepping", true); - pref("devtools.debugger.features.wasm", true); - pref("devtools.debugger.features.shortcuts", true); - pref("devtools.debugger.features.root", true); - pref("devtools.debugger.features.column-breakpoints", false); - pref("devtools.debugger.features.chrome-scopes", false); - pref("devtools.debugger.features.map-scopes", true); - pref("devtools.debugger.features.breakpoints-dropdown", true); - pref("devtools.debugger.features.remove-command-bar-options", true); - pref("devtools.debugger.features.code-coverage", false); - pref("devtools.debugger.features.event-listeners", false); - pref("devtools.debugger.features.code-folding", false); - pref("devtools.debugger.features.outline", true); - pref("devtools.debugger.features.column-breakpoints", true); - pref("devtools.debugger.features.replay", true); -} - -const prefs = new PrefsHelper("devtools", { - autoPrettyPrint: ["Bool", "debugger.auto-pretty-print"], - 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"], - workersVisible: ["Bool", "debugger.workers-visible"], - breakpointsVisible: ["Bool", "debugger.breakpoints-visible"], - expressionsVisible: ["Bool", "debugger.expressions-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"], - projectDirectoryRoot: ["Char", "debugger.project-directory-root", ""] -}); -/* harmony export (immutable) */ __webpack_exports__["prefs"] = prefs; - - -const features = new PrefsHelper("devtools.debugger.features", { - asyncStepping: ["Bool", "async-stepping"], - wasm: ["Bool", "wasm"], - shortcuts: ["Bool", "shortcuts"], - root: ["Bool", "root"], - columnBreakpoints: ["Bool", "column-breakpoints"], - chromeScopes: ["Bool", "chrome-scopes"], - mapScopes: ["Bool", "map-scopes"], - breakpointsDropdown: ["Bool", "breakpoints-dropdown"], - removeCommandBarOptions: ["Bool", "remove-command-bar-options"], - workers: ["Bool", "workers"], - codeCoverage: ["Bool", "code-coverage"], - eventListeners: ["Bool", "event-listeners"], - outline: ["Bool", "outline"], - codeFolding: ["Bool", "code-folding"], - replay: ["Bool", "replay"] -}); -/* harmony export (immutable) */ __webpack_exports__["features"] = features; - - -if (prefs.debuggerPrefsSchemaVersion !== prefsSchemaVersion) { - // clear pending Breakpoints - prefs.pendingBreakpoints = {}; - prefs.debuggerPrefsSchemaVersion = prefsSchemaVersion; -} - - -/***/ }), - -/***/ 2287: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(global, module) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ponyfill_js__ = __webpack_require__(2289); -/* global window */ - - -var root; - -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 = Object(__WEBPACK_IMPORTED_MODULE_0__ponyfill_js__["a" /* default */])(root); -/* harmony default export */ __webpack_exports__["a"] = (result); - -/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(3208), __webpack_require__(3326)(module))) - -/***/ }), - -/***/ 2289: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = 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; -}; - - -/***/ }), - -/***/ 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)) -} - - -/***/ }), - -/***/ 256: -/***/ (function(module, exports) { - -module.exports = "" - -/***/ }), - -/***/ 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`. + * 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 3.0.0 - * @category String - * @param {string} [string=''] The string to escape. - * @returns {string} Returns the escaped string. + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * - * _.escapeRegExp('[lodash](https://lodash.com/)'); - * // => '\[lodash\]\(https://lodash\.com/\)' + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false */ -function escapeRegExp(string) { - string = toString(string); - return (string && reHasRegExpChar.test(string)) - ? string.replace(reRegExpChar, '\\$&') - : string; +function isObjectLike(value) { + return value != null && typeof value == 'object'; } -module.exports = escapeRegExp; +module.exports = isObjectLike; /***/ }), - -/***/ 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.'); -} - - - -/***/ }), - -/***/ 3193: +/* 22 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -10671,1641 +6994,11 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _expressions = __webpack_require__(3275); - -Object.keys(_expressions).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _expressions[key]; - } - }); -}); - -var _sources = __webpack_require__(3205); - -Object.keys(_sources).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _sources[key]; - } - }); -}); - -var _pause = __webpack_require__(3224); - -Object.keys(_pause).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _pause[key]; - } - }); -}); - -var _debuggee = __webpack_require__(3276); - -Object.keys(_debuggee).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _debuggee[key]; - } - }); -}); - -var _breakpoints = __webpack_require__(3236); - -Object.keys(_breakpoints).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _breakpoints[key]; - } - }); -}); - -var _pendingBreakpoints = __webpack_require__(3277); - -Object.keys(_pendingBreakpoints).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _pendingBreakpoints[key]; - } - }); -}); - -var _ui = __webpack_require__(3248); - -Object.keys(_ui).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _ui[key]; - } - }); -}); - -var _fileSearch = __webpack_require__(3278); - -Object.keys(_fileSearch).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _fileSearch[key]; - } - }); -}); - -var _ast = __webpack_require__(3249); - -Object.keys(_ast).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _ast[key]; - } - }); -}); - -var _coverage = __webpack_require__(3279); - -Object.keys(_coverage).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _coverage[key]; - } - }); -}); - -var _projectTextSearch = __webpack_require__(3237); - -Object.keys(_projectTextSearch).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _projectTextSearch[key]; - } - }); -}); - -var _replay = __webpack_require__(3280); - -Object.keys(_replay).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _replay[key]; - } - }); -}); - -var _sourceTree = __webpack_require__(3281); - -Object.keys(_sourceTree).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _sourceTree[key]; - } - }); -}); - -var _eventListeners = __webpack_require__(3282); - -Object.defineProperty(exports, "getEventListeners", { - enumerable: true, - get: function () { - return _eventListeners.getEventListeners; - } -}); - -var _quickOpen = __webpack_require__(3283); - -Object.defineProperty(exports, "getQuickOpenEnabled", { - enumerable: true, - get: function () { - return _quickOpen.getQuickOpenEnabled; - } -}); -Object.defineProperty(exports, "getQuickOpenQuery", { - enumerable: true, - get: function () { - return _quickOpen.getQuickOpenQuery; - } -}); -Object.defineProperty(exports, "getQuickOpenType", { - enumerable: true, - get: function () { - return _quickOpen.getQuickOpenType; - } -}); - -var _breakpointAtLocation = __webpack_require__(3387); - -Object.defineProperty(exports, "getBreakpointAtLocation", { - enumerable: true, - get: function () { - return _breakpointAtLocation.getBreakpointAtLocation; - } -}); - -var _visibleBreakpoints = __webpack_require__(3388); - -Object.defineProperty(exports, "getVisibleBreakpoints", { - enumerable: true, - get: function () { - return _visibleBreakpoints.getVisibleBreakpoints; - } -}); - -var _isSelectedFrameVisible = __webpack_require__(3389); - -Object.defineProperty(exports, "isSelectedFrameVisible", { - enumerable: true, - get: function () { - return _isSelectedFrameVisible.isSelectedFrameVisible; - } -}); - -var _getCallStackFrames = __webpack_require__(3390); - -Object.defineProperty(exports, "getCallStackFrames", { - enumerable: true, - get: function () { - return _getCallStackFrames.getCallStackFrames; - } -}); - -var _visibleSelectedFrame = __webpack_require__(3391); - -Object.defineProperty(exports, "getVisibleSelectedFrame", { - enumerable: true, - get: function () { - return _visibleSelectedFrame.getVisibleSelectedFrame; - } -}); - -/***/ }), - -/***/ 3194: -/***/ (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 -const validProtocols = /^(http|https|ftp|data|javascript|resource|chrome):/i; -const tokenSplitRegex = /(\s|\'|\"|\\)+/; -const ELLIPSIS = "\u2026"; -const dom = __webpack_require__(1758); -const { span } = dom; - -/** - * 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. -const 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|. -const escapeRegexp = new RegExp("[" + -// Quote and backslash. -"\"\\\\" + -// Controls. -"\x00-\x1f" + -// More controls. -"\x7f-\x9f" + -// BOM -"\ufeff" + -// Specials, except for the replacement character. -"\ufff0-\ufffc\ufffe\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) => { - let 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; - } - let 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 = ELLIPSIS) { - // 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; - } - - let 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 - let 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) { - let params = []; - - // In case the text is empty just return the empty parameters - if (text == "") { - return params; - } - - let searchParams = new URLSearchParams(text); - let entries = [...searchParams.entries()]; - return entries.map(entry => { - return { - name: entry[0], - value: entry[1] - }; - }); -} - -function getFileName(url) { - let 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) { - const reSplitFile = /(.*?):\/{2,3}([^\/]*)(.*?)([^\/]*?)($|\?.*)/; - let 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) { - const wrappedFunction = function (props) { - try { - return renderMethod.call(this, props); - } catch (e) { - console.error(e); - return 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) { - let keys = Object.keys(grip.preview.properties); - let values = Object.values(grip.preview.properties); - return [grip.preview.target, ...keys, ...values]; - } - - // RegEx Grip - if (grip.displayString) { - return [grip.displayString]; - } - - // Generic Grip - if (grip.preview && grip.preview.ownProperties) { - let propertiesValues = Object.values(grip.preview.ownProperties).map(property => property.value || property); - - let 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) { - if (noGrip || Object(object) !== object) { - return typeof object; - } - if (object.type === "object") { - return object.class; - } - return object.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; - } - - let 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; - } -} - -const ellipsisElement = span({ - key: "more", - className: "more-ellipsis", - title: `more${ELLIPSIS}` -}, ELLIPSIS); - -module.exports = { - isGrip, - isURL, - cropString, - containsURL, - rawCropString, - sanitizeString, - escapeString, - wrapRender, - cropMultipleLines, - parseURLParams, - parseURLEncodedText, - getFileName, - getURLDisplayString, - maybeEscapePropertyName, - getGripPreviewItems, - getGripType, - tokenSplitRegex, - ellipsisElement, - ELLIPSIS -}; - -/***/ }), - -/***/ 3195: -/***/ (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; }; /* 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 . */ - -var _breakpoints = __webpack_require__(3217); - -var breakpoints = _interopRequireWildcard(_breakpoints); - -var _expressions = __webpack_require__(3225); - -var expressions = _interopRequireWildcard(_expressions); - -var _eventListeners = __webpack_require__(3409); - -var eventListeners = _interopRequireWildcard(_eventListeners); - -var _pause = __webpack_require__(3253); - -var pause = _interopRequireWildcard(_pause); - -var _navigation = __webpack_require__(3431); - -var navigation = _interopRequireWildcard(_navigation); - -var _ui = __webpack_require__(3227); - -var ui = _interopRequireWildcard(_ui); - -var _fileSearch = __webpack_require__(3432); - -var fileSearch = _interopRequireWildcard(_fileSearch); - -var _ast = __webpack_require__(3257); - -var ast = _interopRequireWildcard(_ast); - -var _coverage = __webpack_require__(3433); - -var coverage = _interopRequireWildcard(_coverage); - -var _projectTextSearch = __webpack_require__(3434); - -var projectTextSearch = _interopRequireWildcard(_projectTextSearch); - -var _replay = __webpack_require__(3435); - -var replay = _interopRequireWildcard(_replay); - -var _quickOpen = __webpack_require__(3436); - -var quickOpen = _interopRequireWildcard(_quickOpen); - -var _sourceTree = __webpack_require__(3297); - -var sourceTree = _interopRequireWildcard(_sourceTree); - -var _sources = __webpack_require__(3207); - -var sources = _interopRequireWildcard(_sources); - -var _debuggee = __webpack_require__(3296); - -var debuggee = _interopRequireWildcard(_debuggee); - -var _toolbox = __webpack_require__(3437); - -var toolbox = _interopRequireWildcard(_toolbox); - -var _preview = __webpack_require__(3438); - -var preview = _interopRequireWildcard(_preview); - -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 = _extends({}, navigation, breakpoints, expressions, eventListeners, sources, pause, ui, fileSearch, ast, coverage, projectTextSearch, replay, quickOpen, sourceTree, debuggee, toolbox, preview); - -/***/ }), - -/***/ 3196: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isMinified = undefined; - -var _isMinified = __webpack_require__(3385); - -Object.defineProperty(exports, "isMinified", { - enumerable: true, - get: function () { - return _isMinified.isMinified; - } -}); -exports.shouldPrettyPrint = shouldPrettyPrint; -exports.isJavaScript = isJavaScript; -exports.isPretty = isPretty; -exports.isPrettyURL = isPrettyURL; -exports.isThirdParty = isThirdParty; -exports.getPrettySourceURL = getPrettySourceURL; -exports.getRawSourceURL = getRawSourceURL; -exports.getFilenameFromURL = getFilenameFromURL; -exports.getFormattedSourceId = getFormattedSourceId; -exports.getFilename = getFilename; -exports.getFileURL = getFileURL; -exports.getSourcePath = getSourcePath; -exports.getSourceLineCount = getSourceLineCount; -exports.getMode = getMode; -exports.isLoaded = isLoaded; -exports.isLoading = isLoading; - -var _devtoolsSourceMap = __webpack_require__(3197); - -var _utils = __webpack_require__(3222); - -var _path = __webpack_require__(3247); - -var _url = __webpack_require__(334); - -/** - * Trims the query part or reference identifier of a url string, if necessary. - * - * @memberof utils/source - * @static - */ -function trimUrlQuery(url) { - const length = url.length; - const q1 = url.indexOf("?"); - const q2 = url.indexOf("&"); - const q3 = url.indexOf("#"); - const 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; - } - const _isPretty = isPretty(source); - const _isJavaScript = isJavaScript(source); - const isOriginal = (0, _devtoolsSourceMap.isOriginalId)(source.get("id")); - const hasSourceMap = source.get("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) { - const url = source.get("url"); - const contentType = source.get("contentType"); - return url && /\.(jsm|js)?$/.test(trimUrlQuery(url)) || !!(contentType && contentType.includes("javascript")); -} - -/** - * @memberof utils/source - * @static - */ -function isPretty(source) { - const url = source.get("url"); - return isPrettyURL(url); -} - -function isPrettyURL(url) { - return url ? /formatted$/.test(url) : false; -} - -function isThirdParty(source) { - const url = source.get("url"); - if (!source || !url) { - return false; - } - - return !!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 resolveFileURL(url, transformUrl = initialUrl => initialUrl) { - url = getRawSourceURL(url || ""); - const name = transformUrl(url); - return (0, _utils.endTruncateStr)(name, 50); -} - -function getFilenameFromURL(url) { - return resolveFileURL(url, initialUrl => (0, _path.basename)(initialUrl) || "(index)"); -} - -function getFormattedSourceId(id) { - const sourceId = id.split("/")[1]; - return `SOURCE${sourceId}`; -} - -/** - * 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) { - const { url, id } = source; - if (!url) { - return getFormattedSourceId(id); - } - - let filename = getFilenameFromURL(url); - const qMarkIdx = filename.indexOf("?"); - if (qMarkIdx > 0) { - filename = filename.slice(0, qMarkIdx); - } - return filename; -} - -/** - * Show a source url. - * If the source does not have a url, use the source id. - * - * @memberof utils/source - * @static - */ -function getFileURL(source) { - const { url, id } = source; - if (!url) { - return getFormattedSourceId(id); - } - - return resolveFileURL(url); -} - -const contentTypeModeMap = { - "text/javascript": { name: "javascript" }, - "text/typescript": { name: "javascript", typescript: true }, - "text/coffeescript": { name: "coffeescript" }, - "text/typescript-jsx": { - name: "jsx", - base: { name: "javascript", typescript: true } - }, - "text/jsx": { name: "jsx" }, - "text/x-elm": { name: "elm" }, - "text/x-clojure": { name: "clojure" }, - "text/wasm": { name: "text" }, - "text/html": { name: "htmlmixed" } -}; - -function getSourcePath(url) { - if (!url) { - return ""; - } - - const { path, href } = (0, _url.parse)(url); - // 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 && !source.error) { - const { binary } = source.text; - return binary.length; - } - return source.text != undefined ? source.text.split("\n").length : 0; -} - -/** - * - * Checks if a source is minified based on some heuristics - * @param key - * @param text - * @return boolean - * @memberof utils/source - * @static - */ - -/** - * - * Returns Code Mirror mode for source content type - * @param contentType - * @return String - * @memberof utils/source - * @static - */ - -function getMode(source, symbols) { - const { contentType, text, isWasm, url } = source; - - if (!text || isWasm) { - return { name: "text" }; - } - - if (url && url.match(/\.jsx$/i) || symbols && symbols.hasJsx) { - return { name: "jsx" }; - } - - const languageMimeMap = [{ ext: ".c", mode: "text/x-csrc" }, { ext: ".kt", mode: "text/x-kotlin" }, { ext: ".cpp", mode: "text/x-c++src" }, { ext: ".m", mode: "text/x-objectivec" }, { ext: ".rs", mode: "text/x-rustsrc" }]; - - // check for C and other non JS languages - if (url) { - const result = languageMimeMap.find(({ ext }) => url.endsWith(ext)); - - if (result !== undefined) { - return { name: result.mode }; - } - } - - // 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. - const isHTMLLike = text.match(/^\s*. */ - -var _sourceDocuments = __webpack_require__(3294); - -Object.keys(_sourceDocuments).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _sourceDocuments[key]; - } - }); -}); - -var _getTokenLocation = __webpack_require__(3419); - -Object.keys(_getTokenLocation).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _getTokenLocation[key]; - } - }); -}); - -var _sourceSearch = __webpack_require__(3420); - -Object.keys(_sourceSearch).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _sourceSearch[key]; - } - }); -}); - -var _ui = __webpack_require__(3241); - -Object.keys(_ui).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _ui[key]; - } - }); -}); - -var _createEditor = __webpack_require__(3421); - -Object.keys(_createEditor).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _createEditor[key]; - } - }); -}); -exports.shouldShowPrettyPrint = shouldShowPrettyPrint; -exports.shouldShowFooter = shouldShowFooter; -exports.traverseResults = traverseResults; -exports.toEditorLine = toEditorLine; -exports.toEditorPosition = toEditorPosition; -exports.toEditorRange = toEditorRange; -exports.toSourceLine = toSourceLine; -exports.scrollToColumn = scrollToColumn; -exports.toSourceLocation = toSourceLocation; -exports.markText = markText; -exports.lineAtHeight = lineAtHeight; -exports.getSourceLocationFromMouseEvent = getSourceLocationFromMouseEvent; -exports.forEachLine = forEachLine; -exports.removeLineClass = removeLineClass; -exports.clearLineClass = clearLineClass; -exports.getTextForLine = getTextForLine; -exports.getCursorLine = getCursorLine; - -var _source = __webpack_require__(3196); - -var _wasm = __webpack_require__(3240); - -var _devtoolsSourceMap = __webpack_require__(3197); - -function shouldShowPrettyPrint(selectedSource) { - if (!selectedSource) { - return false; - } - - return (0, _source.shouldPrettyPrint)(selectedSource); -} - -function shouldShowFooter(selectedSource, horizontal) { - if (!horizontal) { - return true; - } - if (!selectedSource) { - return false; - } - return shouldShowPrettyPrint(selectedSource) || (0, _devtoolsSourceMap.isOriginalId)(selectedSource.get("id")); -} - -function traverseResults(e, ctx, query, dir, modifiers) { - e.stopPropagation(); - e.preventDefault(); - - if (dir == "prev") { - (0, _sourceSearch.findPrev)(ctx, query, true, modifiers); - } else if (dir == "next") { - (0, _sourceSearch.findNext)(ctx, query, true, modifiers); - } -} - -function toEditorLine(sourceId, lineOrOffset) { - if ((0, _wasm.isWasm)(sourceId)) { - // TODO ensure offset is always "mappable" to edit line. - return (0, _wasm.wasmOffsetToLine)(sourceId, lineOrOffset) || 0; - } - - return lineOrOffset ? lineOrOffset - 1 : 1; -} - -function toEditorPosition(location) { - return { - line: toEditorLine(location.sourceId, location.line), - column: (0, _wasm.isWasm)(location.sourceId) || !location.column ? 0 : location.column - }; -} - -function toEditorRange(sourceId, location) { - const { start, end } = location; - return { - start: toEditorPosition(_extends({}, start, { sourceId })), - end: toEditorPosition(_extends({}, end, { sourceId })) - }; -} - -function toSourceLine(sourceId, line) { - return (0, _wasm.isWasm)(sourceId) ? (0, _wasm.lineToWasmOffset)(sourceId, line) : line + 1; -} - -function scrollToColumn(codeMirror, line, column) { - const { top, left } = codeMirror.charCoords({ line: line, ch: column }, "local"); - - if (!isVisible(codeMirror, top, left)) { - const scroller = codeMirror.getScrollerElement(); - const centeredX = Math.max(left - scroller.offsetWidth / 2, 0); - const centeredY = Math.max(top - scroller.offsetHeight / 2, 0); - - codeMirror.scrollTo(centeredX, centeredY); - } -} - -function isVisible(codeMirror, top, left) { - function withinBounds(x, min, max) { - return x >= min && x <= max; - } - - const scrollArea = codeMirror.getScrollInfo(); - - const charWidth = codeMirror.defaultCharWidth(); - const inXView = withinBounds(left, scrollArea.left, scrollArea.left + (scrollArea.clientWidth - 30) - charWidth); - - const fontHeight = codeMirror.defaultTextHeight(); - const inYView = withinBounds(top, scrollArea.top, scrollArea.top + scrollArea.clientHeight - fontHeight); - - return inXView && inYView; -} - -function toSourceLocation(sourceId, location) { - return { - line: toSourceLine(sourceId, location.line), - column: (0, _wasm.isWasm)(sourceId) ? undefined : location.column - }; -} - -function markText(editor, className, { start, end }) { - return editor.codeMirror.markText({ ch: start.column, line: start.line }, { ch: end.column, line: end.line }, { className }); -} - -function lineAtHeight(editor, sourceId, event) { - const editorLine = editor.codeMirror.lineAtHeight(event.clientY); - return toSourceLine(sourceId, editorLine); -} - -function getSourceLocationFromMouseEvent(editor, selectedLocation, e) { - const { line, ch } = editor.codeMirror.coordsChar({ - left: e.clientX, - top: e.clientY - }); - - return { - sourceId: selectedLocation.sourceId, - line: line + 1, - column: ch + 1 - }; -} - -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; -} - -/***/ }), - -/***/ 3201: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _Svg = __webpack_require__(3461); +var _Svg = __webpack_require__(481); var _Svg2 = _interopRequireDefault(_Svg); -__webpack_require__(3462); +__webpack_require__(542); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -12320,8 +7013,41 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de exports.default = _Svg2.default; /***/ }), +/* 23 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ 3202: +var Symbol = __webpack_require__(20), + getRawTag = __webpack_require__(63), + objectToString = __webpack_require__(64); + +/** `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; + + +/***/ }), +/* 24 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12331,7 +7057,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _immutable = __webpack_require__(146); +var _immutable = __webpack_require__(19); var I = _interopRequireWildcard(_immutable); @@ -12368,8 +7094,120 @@ function makeRecord(spec) { exports.default = makeRecord; /***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ 3203: +var baseIsNative = __webpack_require__(127), + getValue = __webpack_require__(130); + +/** + * 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; + + +/***/ }), +/* 26 */ +/***/ (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; + + +/***/ }), +/* 27 */ +/***/ (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__(46); +const workerUtils = __webpack_require__(47); + +module.exports = { + networkRequest, + workerUtils +}; + +/***/ }), +/* 28 */, +/* 29 */, +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseGetTag = __webpack_require__(23), + isObjectLike = __webpack_require__(21); + +/** `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; + + +/***/ }), +/* 31 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12380,7 +7218,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.replaceOriginalVariableName = exports.getFramework = exports.hasSyntaxError = exports.clearSources = exports.setSource = exports.hasSource = exports.getEmptyLines = exports.isInvalidPauseLocation = exports.getNextStep = exports.clearASTs = exports.clearScopes = exports.clearSymbols = exports.findOutOfScopeLocations = exports.getScopes = exports.getSymbols = exports.getClosestExpression = exports.stopParserWorker = exports.startParserWorker = undefined; -var _devtoolsUtils = __webpack_require__(3204); +var _devtoolsUtils = __webpack_require__(27); const { WorkerDispatcher } = _devtoolsUtils.workerUtils; /* 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 @@ -12408,25 +7246,7 @@ const getFramework = exports.getFramework = dispatcher.task("getFramework"); const replaceOriginalVariableName = exports.replaceOriginalVariableName = dispatcher.task("replaceOriginalVariableName"); /***/ }), - -/***/ 3204: -/***/ (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__(3212); -const workerUtils = __webpack_require__(3213); - -module.exports = { - networkRequest, - workerUtils -}; - -/***/ }), - -/***/ 3205: +/* 32 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12458,21 +7278,21 @@ exports.getPrettySource = getPrettySource; exports.hasPrettySource = hasPrettySource; exports.getSourceInSources = getSourceInSources; -var _immutable = __webpack_require__(146); +var _immutable = __webpack_require__(19); var I = _interopRequireWildcard(_immutable); -var _reselect = __webpack_require__(993); +var _reselect = __webpack_require__(48); -var _makeRecord = __webpack_require__(3202); +var _makeRecord = __webpack_require__(24); var _makeRecord2 = _interopRequireDefault(_makeRecord); -var _source = __webpack_require__(3196); +var _source = __webpack_require__(9); -var _devtoolsSourceMap = __webpack_require__(3197); +var _devtoolsSourceMap = __webpack_require__(12); -var _prefs = __webpack_require__(226); +var _prefs = __webpack_require__(10); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -12780,8 +7600,7 @@ const getSelectedSourceText = exports.getSelectedSourceText = (0, _reselect.crea exports.default = update; /***/ }), - -/***/ 3206: +/* 33 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12796,9 +7615,9 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -var _lodash = __webpack_require__(2); +var _lodash = __webpack_require__(11); -var _DevToolsUtils = __webpack_require__(3290); +var _DevToolsUtils = __webpack_require__(224); let seqIdVal = 1; @@ -12853,8 +7672,7 @@ const PROMISE = exports.PROMISE = "@@dispatch/promise"; exports.promise = promiseMiddleware; /***/ }), - -/***/ 3207: +/* 34 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12864,7 +7682,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _loadSourceText = __webpack_require__(3226); +var _loadSourceText = __webpack_require__(76); Object.keys(_loadSourceText).forEach(function (key) { if (key === "default" || key === "__esModule") return; @@ -12876,7 +7694,7 @@ Object.keys(_loadSourceText).forEach(function (key) { }); }); -var _prettyPrint = __webpack_require__(3256); +var _prettyPrint = __webpack_require__(162); Object.keys(_prettyPrint).forEach(function (key) { if (key === "default" || key === "__esModule") return; @@ -12888,7 +7706,7 @@ Object.keys(_prettyPrint).forEach(function (key) { }); }); -var _newSources = __webpack_require__(3416); +var _newSources = __webpack_require__(434); Object.keys(_newSources).forEach(function (key) { if (key === "default" || key === "__esModule") return; @@ -12900,7 +7718,7 @@ Object.keys(_newSources).forEach(function (key) { }); }); -var _blackbox = __webpack_require__(3417); +var _blackbox = __webpack_require__(435); Object.keys(_blackbox).forEach(function (key) { if (key === "default" || key === "__esModule") return; @@ -12912,7 +7730,7 @@ Object.keys(_blackbox).forEach(function (key) { }); }); -var _select = __webpack_require__(3418); +var _select = __webpack_require__(436); Object.keys(_select).forEach(function (key) { if (key === "default" || key === "__esModule") return; @@ -12924,7 +7742,7 @@ Object.keys(_select).forEach(function (key) { }); }); -var _tabs = __webpack_require__(3293); +var _tabs = __webpack_require__(227); Object.keys(_tabs).forEach(function (key) { if (key === "default" || key === "__esModule") return; @@ -12937,37 +7755,104 @@ Object.keys(_tabs).forEach(function (key) { }); /***/ }), - -/***/ 3208: +/* 35 */, +/* 36 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; +var getNative = __webpack_require__(25); +/* Built-in method references that are verified to be native. */ +var nativeCreate = getNative(Object, 'create'); -var g; +module.exports = nativeCreate; -// 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; /***/ }), +/* 37 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ 3209: +var eq = __webpack_require__(54); + +/** + * 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; + + +/***/ }), +/* 38 */ +/***/ (function(module, exports, __webpack_require__) { + +var isKeyable = __webpack_require__(141); + +/** + * 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; + + +/***/ }), +/* 39 */ +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE_39__; + +/***/ }), +/* 40 */ +/***/ (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; + + +/***/ }), +/* 41 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12978,7 +7863,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.findScopeByName = exports.getASTLocation = undefined; -var _astBreakpointLocation = __webpack_require__(3245); +var _astBreakpointLocation = __webpack_require__(148); Object.defineProperty(exports, "getASTLocation", { enumerable: true, @@ -13005,13 +7890,13 @@ exports.breakpointExists = breakpointExists; exports.createBreakpoint = createBreakpoint; exports.createPendingBreakpoint = createPendingBreakpoint; -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -var _assert = __webpack_require__(3238); +var _assert = __webpack_require__(103); var _assert2 = _interopRequireDefault(_assert); -var _prefs = __webpack_require__(226); +var _prefs = __webpack_require__(10); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -13142,8 +8027,7 @@ function createPendingBreakpoint(bp) { } /***/ }), - -/***/ 3210: +/* 42 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -13163,9 +8047,9 @@ exports.createNode = createNode; exports.createParentMap = createParentMap; exports.getRelativePath = getRelativePath; -var _url = __webpack_require__(334); +var _url = __webpack_require__(100); -var _source = __webpack_require__(3196); +var _source = __webpack_require__(9); /* 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 @@ -13252,8 +8136,35 @@ function getRelativePath(url) { } /***/ }), +/* 43 */, +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ 3211: +var isSymbol = __webpack_require__(30); + +/** 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; + + +/***/ }), +/* 45 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -13263,14 +8174,14 @@ function getRelativePath(url) { * 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 { Menu, MenuItem } = __webpack_require__(3331); +const { Menu, MenuItem } = __webpack_require__(344); function inToolbox() { return window.parent.document.documentURI == "about:devtools-toolbox"; } if (!inToolbox()) { - __webpack_require__(3338); + __webpack_require__(351); } function createPopup(doc) { @@ -13399,8 +8310,7 @@ module.exports = { }; /***/ }), - -/***/ 3212: +/* 46 */ /***/ (function(module, exports) { /* This Source Code Form is subject to the terms of the Mozilla Public @@ -13421,8 +8331,7 @@ function networkRequest(url, opts) { module.exports = networkRequest; /***/ }), - -/***/ 3213: +/* 47 */ /***/ (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"); }); }; } @@ -13560,8 +8469,138 @@ module.exports = { }; /***/ }), +/* 48 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ 3214: +"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; + }, {}); + }); +} + +/***/ }), +/* 49 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -13571,40 +8610,40 @@ module.exports = { * 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__(3485); +__webpack_require__(566); // Load all existing rep templates -const Undefined = __webpack_require__(3486); -const Null = __webpack_require__(3487); -const StringRep = __webpack_require__(3243); -const Number = __webpack_require__(3488); -const ArrayRep = __webpack_require__(3231); -const Obj = __webpack_require__(3489); -const SymbolRep = __webpack_require__(3490); -const InfinityRep = __webpack_require__(3491); -const NaNRep = __webpack_require__(3492); -const Accessor = __webpack_require__(3493); +const Undefined = __webpack_require__(567); +const Null = __webpack_require__(568); +const StringRep = __webpack_require__(108); +const Number = __webpack_require__(569); +const ArrayRep = __webpack_require__(81); +const Obj = __webpack_require__(570); +const SymbolRep = __webpack_require__(571); +const InfinityRep = __webpack_require__(572); +const NaNRep = __webpack_require__(573); +const Accessor = __webpack_require__(574); // DOM types (grips) -const Attribute = __webpack_require__(3494); -const DateTime = __webpack_require__(3495); -const Document = __webpack_require__(3496); -const Event = __webpack_require__(3497); -const Func = __webpack_require__(3498); -const PromiseRep = __webpack_require__(3499); -const RegExp = __webpack_require__(3500); -const StyleSheet = __webpack_require__(3501); -const CommentNode = __webpack_require__(3502); -const ElementNode = __webpack_require__(3503); -const TextNode = __webpack_require__(3504); -const ErrorRep = __webpack_require__(3505); -const Window = __webpack_require__(3506); -const ObjectWithText = __webpack_require__(3507); -const ObjectWithURL = __webpack_require__(3508); -const GripArray = __webpack_require__(3307); -const GripMap = __webpack_require__(3309); -const GripMapEntry = __webpack_require__(3310); -const Grip = __webpack_require__(3267); +const Attribute = __webpack_require__(575); +const DateTime = __webpack_require__(576); +const Document = __webpack_require__(577); +const Event = __webpack_require__(578); +const Func = __webpack_require__(579); +const PromiseRep = __webpack_require__(582); +const RegExp = __webpack_require__(583); +const StyleSheet = __webpack_require__(584); +const CommentNode = __webpack_require__(585); +const ElementNode = __webpack_require__(586); +const TextNode = __webpack_require__(587); +const ErrorRep = __webpack_require__(588); +const Window = __webpack_require__(589); +const ObjectWithText = __webpack_require__(590); +const ObjectWithURL = __webpack_require__(591); +const GripArray = __webpack_require__(241); +const GripMap = __webpack_require__(243); +const GripMapEntry = __webpack_require__(244); +const Grip = __webpack_require__(174); // List of all registered template. // XXX there should be a way for extensions to register a new @@ -13698,8 +8737,168 @@ module.exports = { }; /***/ }), +/* 50 */, +/* 51 */, +/* 52 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ 3216: +/* 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__(40))) + +/***/ }), +/* 53 */ +/***/ (function(module, exports, __webpack_require__) { + +var listCacheClear = __webpack_require__(135), + listCacheDelete = __webpack_require__(136), + listCacheGet = __webpack_require__(137), + listCacheHas = __webpack_require__(138), + listCacheSet = __webpack_require__(139); + +/** + * 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; + + +/***/ }), +/* 54 */ +/***/ (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; + + +/***/ }), +/* 55 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseToString = __webpack_require__(67); + +/** + * 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; + + +/***/ }), +/* 56 */ +/***/ (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; + + +/***/ }), +/* 57 */ +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE_57__; + +/***/ }), +/* 58 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -13720,11 +8919,11 @@ exports.formatDisplayName = formatDisplayName; exports.formatCopyName = formatCopyName; exports.collapseFrames = collapseFrames; -var _utils = __webpack_require__(3222); +var _utils = __webpack_require__(72); -var _source = __webpack_require__(3196); +var _source = __webpack_require__(9); -var _lodash = __webpack_require__(2); +var _lodash = __webpack_require__(11); function getFrameUrl(frame) { return (0, _lodash.get)(frame, "source.url", "") || ""; @@ -13947,8 +9146,7 @@ function collapseLastFrames(frames) { } /***/ }), - -/***/ 3217: +/* 59 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -13986,23 +9184,23 @@ exports.toggleBreakpoint = toggleBreakpoint; exports.addOrToggleDisabledBreakpoint = addOrToggleDisabledBreakpoint; exports.toggleDisabledBreakpoint = toggleDisabledBreakpoint; -var _promise = __webpack_require__(3206); +var _promise = __webpack_require__(33); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -var _breakpoint = __webpack_require__(3209); +var _breakpoint = __webpack_require__(41); -var _addBreakpoint = __webpack_require__(3406); +var _addBreakpoint = __webpack_require__(424); var _addBreakpoint2 = _interopRequireDefault(_addBreakpoint); -var _remapLocations = __webpack_require__(3407); +var _remapLocations = __webpack_require__(425); var _remapLocations2 = _interopRequireDefault(_remapLocations); -var _ast = __webpack_require__(3249); +var _ast = __webpack_require__(155); -var _syncBreakpoint = __webpack_require__(3408); +var _syncBreakpoint = __webpack_require__(426); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -14333,8 +9531,7 @@ function toggleDisabledBreakpoint(line, column) { } /***/ }), - -/***/ 3218: +/* 60 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -14346,14 +9543,14 @@ function toggleDisabledBreakpoint(line, column) { /* global window, document, DebuggerConfig */ -const { bindActionCreators, combineReducers } = __webpack_require__(3); -const { Provider } = __webpack_require__(1189); +const { bindActionCreators, combineReducers } = __webpack_require__(8); +const { Provider } = __webpack_require__(4); -const { defer } = __webpack_require__(3271); -const { debugGlobal } = __webpack_require__(3327); -const { setConfig, getValue, isDevelopment } = __webpack_require__(3198); -const L10N = __webpack_require__(3329); -const { showMenu, buildMenu } = __webpack_require__(3211); +const { defer } = __webpack_require__(203); +const { debugGlobal } = __webpack_require__(335); +const { setConfig, getValue, isDevelopment } = __webpack_require__(13); +const L10N = __webpack_require__(340); +const { showMenu, buildMenu } = __webpack_require__(45); 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":{}}); @@ -14362,8 +9559,8 @@ if (getValue("logging.client")) { // DevToolsUtils.dumpn.wantLogging = true; } -const { firefox, chrome, startDebugging } = __webpack_require__(3339); -const Root = __webpack_require__(3345); +const { firefox, chrome, startDebugging } = __webpack_require__(352); +const Root = __webpack_require__(358); // Using this static variable allows webpack to know at compile-time // to avoid this require and not include it at all in the output. @@ -14418,9 +9615,9 @@ async function updateConfig() { } async function initApp() { - const configureStore = __webpack_require__(3347); - const reducers = __webpack_require__(3356); - const LaunchpadApp = __webpack_require__(3359); + const configureStore = __webpack_require__(360); + const reducers = __webpack_require__(370); + const LaunchpadApp = __webpack_require__(373); const createStore = configureStore({ log: getValue("logging.actions"), @@ -14430,7 +9627,7 @@ async function initApp() { }); const store = createStore(combineReducers(reducers)); - const actions = bindActionCreators(__webpack_require__(3274), store.dispatch); + const actions = bindActionCreators(__webpack_require__(208), store.dispatch); debugGlobal("launchpadStore", store); @@ -14515,15 +9712,10 @@ async function getTabs(actions) { async function bootstrap(React, ReactDOM) { const connTarget = getTargetFromQuery(); if (connTarget) { - const debuggedTarget = await startDebugging(connTarget); + const { tab, tabConnection } = await startDebugging(connTarget); - if (debuggedTarget) { - const { tab, tabConnection } = debuggedTarget; - await updateConfig(); - return { tab, connTarget, tabConnection }; - } - - console.info("Tab closed due to missing debugged target window."); + await updateConfig(); + return { tab, connTarget, tabConnection }; } const { store, actions, LaunchpadApp } = await initApp(); @@ -14548,8 +9740,243 @@ module.exports = { }; /***/ }), +/* 61 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ 3219: +var isArray = __webpack_require__(16), + isKey = __webpack_require__(62), + stringToPath = __webpack_require__(121), + toString = __webpack_require__(55); + +/** + * 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; + + +/***/ }), +/* 62 */ +/***/ (function(module, exports, __webpack_require__) { + +var isArray = __webpack_require__(16), + isSymbol = __webpack_require__(30); + +/** 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; + + +/***/ }), +/* 63 */ +/***/ (function(module, exports, __webpack_require__) { + +var Symbol = __webpack_require__(20); + +/** 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; + + +/***/ }), +/* 64 */ +/***/ (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; + + +/***/ }), +/* 65 */ +/***/ (function(module, exports, __webpack_require__) { + +var mapCacheClear = __webpack_require__(124), + mapCacheDelete = __webpack_require__(140), + mapCacheGet = __webpack_require__(142), + mapCacheHas = __webpack_require__(143), + mapCacheSet = __webpack_require__(144); + +/** + * 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; + + +/***/ }), +/* 66 */ +/***/ (function(module, exports, __webpack_require__) { + +var getNative = __webpack_require__(25), + root = __webpack_require__(18); + +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'); + +module.exports = Map; + + +/***/ }), +/* 67 */ +/***/ (function(module, exports, __webpack_require__) { + +var Symbol = __webpack_require__(20), + arrayMap = __webpack_require__(56), + isArray = __webpack_require__(16), + isSymbol = __webpack_require__(30); + +/** 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; + + +/***/ }), +/* 68 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -14600,8 +10027,7 @@ module.exports = { }; /***/ }), - -/***/ 3220: +/* 69 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -14613,11 +10039,11 @@ Object.defineProperty(exports, "__esModule", { exports.clientEvents = exports.clientCommands = exports.createObjectClient = undefined; exports.onConnect = onConnect; -var _commands = __webpack_require__(3378); +var _commands = __webpack_require__(391); -var _events = __webpack_require__(3392); +var _events = __webpack_require__(410); -var _prefs = __webpack_require__(226); +var _prefs = __webpack_require__(10); let DebuggerClient; /* 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 @@ -14685,8 +10111,7 @@ exports.clientCommands = _commands.clientCommands; exports.clientEvents = _events.clientEvents; /***/ }), - -/***/ 3221: +/* 70 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -14696,13 +10121,13 @@ exports.clientEvents = _events.clientEvents; * 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 Menu = __webpack_require__(3379); -const MenuItem = __webpack_require__(3381); -const { PrefsHelper } = __webpack_require__(3382); -const Services = __webpack_require__(22); -const KeyShortcuts = __webpack_require__(3383); -const { ZoomKeys } = __webpack_require__(3384); -const EventEmitter = __webpack_require__(3235); +const Menu = __webpack_require__(392); +const MenuItem = __webpack_require__(394); +const { PrefsHelper } = __webpack_require__(395); +const Services = __webpack_require__(57); +const KeyShortcuts = __webpack_require__(396); +const { ZoomKeys } = __webpack_require__(397); +const EventEmitter = __webpack_require__(99); module.exports = { KeyShortcuts, @@ -14715,8 +10140,46 @@ module.exports = { }; /***/ }), +/* 71 */ +/***/ (function(module, exports) { -/***/ 3222: +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; + + +/***/ }), +/* 72 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -14780,39 +10243,35 @@ exports.endTruncateStr = endTruncateStr; exports.waitForMs = waitForMs; /***/ }), +/* 73 */ +/***/ (function(module, exports) { -/***/ 3223: -/***/ (function(module, exports, __webpack_require__) { +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; +}; -"use strict"; - - -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; -}; /***/ }), - -/***/ 3224: +/* 74 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -14854,13 +10313,13 @@ exports.getTopFrame = getTopFrame; exports.getDebuggeeUrl = getDebuggeeUrl; exports.getChromeScopes = getChromeScopes; -var _reselect = __webpack_require__(993); +var _reselect = __webpack_require__(48); -var _devtoolsSourceMap = __webpack_require__(3197); +var _devtoolsSourceMap = __webpack_require__(12); -var _prefs = __webpack_require__(226); +var _prefs = __webpack_require__(10); -var _sources = __webpack_require__(3205); +var _sources = __webpack_require__(32); const createPauseState = exports.createPauseState = () => ({ why: null, @@ -15159,8 +10618,7 @@ function getChromeScopes(state) { exports.default = update; /***/ }), - -/***/ 3225: +/* 75 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -15176,15 +10634,15 @@ exports.deleteExpression = deleteExpression; exports.evaluateExpressions = evaluateExpressions; exports.getMappedExpression = getMappedExpression; -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -var _promise = __webpack_require__(3206); +var _promise = __webpack_require__(33); -var _devtoolsSourceMap = __webpack_require__(3197); +var _devtoolsSourceMap = __webpack_require__(12); -var _expressions = __webpack_require__(3291); +var _expressions = __webpack_require__(225); -var _parser = __webpack_require__(3203); +var _parser = __webpack_require__(31); var parser = _interopRequireWildcard(_parser); @@ -15313,8 +10771,7 @@ async function getMappedExpression({ sourceMaps }, generatedLocation, expression } /***/ }), - -/***/ 3226: +/* 76 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -15325,23 +10782,23 @@ Object.defineProperty(exports, "__esModule", { }); exports.loadSourceText = loadSourceText; -var _devtoolsSourceMap = __webpack_require__(3197); +var _devtoolsSourceMap = __webpack_require__(12); -var _promise = __webpack_require__(3206); +var _promise = __webpack_require__(33); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -var _parser = __webpack_require__(3203); +var _parser = __webpack_require__(31); var parser = _interopRequireWildcard(_parser); -var _source = __webpack_require__(3196); +var _source = __webpack_require__(9); -var _defer = __webpack_require__(3411); +var _defer = __webpack_require__(429); var _defer2 = _interopRequireDefault(_defer); -var _devtoolsModules = __webpack_require__(3221); +var _devtoolsModules = __webpack_require__(70); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -15424,8 +10881,7 @@ function loadSourceText(source) { } /***/ }), - -/***/ 3227: +/* 77 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -15450,11 +10906,11 @@ exports.clearProjectDirectoryRoot = clearProjectDirectoryRoot; exports.setProjectDirectoryRoot = setProjectDirectoryRoot; exports.setOrientation = setOrientation; -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -var _ui = __webpack_require__(3248); +var _ui = __webpack_require__(154); -var _source = __webpack_require__(3196); +var _source = __webpack_require__(9); function setContextMenu(type, event) { return ({ dispatch }) => { @@ -15607,8 +11063,7 @@ function setOrientation(orientation) { } /***/ }), - -/***/ 3228: +/* 78 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -15618,7 +11073,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _why = __webpack_require__(3423); +var _why = __webpack_require__(443); Object.keys(_why).forEach(function (key) { if (key === "default" || key === "__esModule") return; @@ -15630,7 +11085,7 @@ Object.keys(_why).forEach(function (key) { }); }); -var _stepping = __webpack_require__(3424); +var _stepping = __webpack_require__(444); Object.keys(_stepping).forEach(function (key) { if (key === "default" || key === "__esModule") return; @@ -15643,8 +11098,7 @@ Object.keys(_stepping).forEach(function (key) { }); /***/ }), - -/***/ 3229: +/* 79 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -15658,7 +11112,7 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -__webpack_require__(3466); +__webpack_require__(547); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -15681,8 +11135,7 @@ function CloseButton({ handleClick, buttonClass, tooltip }) { exports.default = CloseButton; /***/ }), - -/***/ 3230: +/* 80 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -15712,8 +11165,7 @@ function copyToTheClipboard(string) { } /***/ }), - -/***/ 3231: +/* 81 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -15724,12 +11176,12 @@ function copyToTheClipboard(string) { * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // Dependencies -const dom = __webpack_require__(1758); -const PropTypes = __webpack_require__(20); +const dom = __webpack_require__(3); +const PropTypes = __webpack_require__(2); const { wrapRender -} = __webpack_require__(3194); -const { MODE } = __webpack_require__(3199); +} = __webpack_require__(5); +const { MODE } = __webpack_require__(14); const { span } = dom; const ModePropType = PropTypes.oneOf( @@ -15825,7 +11277,7 @@ ItemRep.propTypes = { }; function ItemRep(props) { - const { Rep } = __webpack_require__(3214); + const { Rep } = __webpack_require__(49); let { object, @@ -15860,8 +11312,7 @@ module.exports = { }; /***/ }), - -/***/ 3232: +/* 82 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -15872,14 +11323,14 @@ module.exports = { * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // Dependencies -const PropTypes = __webpack_require__(20); +const PropTypes = __webpack_require__(2); const { maybeEscapePropertyName, wrapRender -} = __webpack_require__(3194); -const { MODE } = __webpack_require__(3199); +} = __webpack_require__(5); +const { MODE } = __webpack_require__(14); -const dom = __webpack_require__(1758); +const dom = __webpack_require__(3); const { span } = dom; /** @@ -15911,8 +11362,8 @@ PropRep.propTypes = { * @return {Array} Array of React elements. */ function PropRep(props) { - const Grip = __webpack_require__(3267); - const { Rep } = __webpack_require__(3214); + const Grip = __webpack_require__(174); + const { Rep } = __webpack_require__(49); let { name, @@ -15947,8 +11398,269 @@ function PropRep(props) { module.exports = wrapRender(PropRep); /***/ }), +/* 83 */, +/* 84 */, +/* 85 */, +/* 86 */, +/* 87 */, +/* 88 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ 3233: +var baseGet = __webpack_require__(89); + +/** + * 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; + + +/***/ }), +/* 89 */ +/***/ (function(module, exports, __webpack_require__) { + +var castPath = __webpack_require__(61), + toKey = __webpack_require__(44); + +/** + * 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; + + +/***/ }), +/* 90 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseGetTag = __webpack_require__(23), + isObject = __webpack_require__(26); + +/** `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; + + +/***/ }), +/* 91 */ +/***/ (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; + + +/***/ }), +/* 92 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseAssignValue = __webpack_require__(93), + eq = __webpack_require__(54); + +/** 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; + + +/***/ }), +/* 93 */ +/***/ (function(module, exports, __webpack_require__) { + +var defineProperty = __webpack_require__(94); + +/** + * 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; + + +/***/ }), +/* 94 */ +/***/ (function(module, exports, __webpack_require__) { + +var getNative = __webpack_require__(25); + +var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} +}()); + +module.exports = defineProperty; + + +/***/ }), +/* 95 */ +/***/ (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) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); +} + +module.exports = isIndex; + + +/***/ }), +/* 96 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -15961,7 +11673,7 @@ module.exports = wrapRender(PropRep); var EventEmitter = function EventEmitter() {}; module.exports = EventEmitter; -const promise = __webpack_require__(3333); +const promise = __webpack_require__(346); /** * Decorate an object with event emitter functionality. @@ -16079,8 +11791,7 @@ EventEmitter.prototype = { }; /***/ }), - -/***/ 3234: +/* 97 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -16417,8 +12128,105 @@ EventEmitter.prototype = { }).call(undefined); /***/ }), +/* 98 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ 3235: +"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 _react = __webpack_require__(0); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = __webpack_require__(2); + +var _util = __webpack_require__(385); + +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 _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 process = process || { env: {} }; + +var InlineSVG = function (_React$Component) { + _inherits(InlineSVG, _React$Component); + + function InlineSVG() { + _classCallCheck(this, InlineSVG); + + return _possibleConstructorReturn(this, (InlineSVG.__proto__ || Object.getPrototypeOf(InlineSVG)).apply(this, arguments)); + } + + _createClass(InlineSVG, [{ + 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 = void 0, + __html = void 0, + svgProps = void 0; + + var _props = this.props, + element = _props.element, + raw = _props.raw, + src = _props.src, + otherProps = _objectWithoutProperties(_props, ['element', 'raw', 'src']); + + if (raw === true) { + Element = 'svg'; + svgProps = (0, _util.extractSVGProps)(src); + __html = (0, _util.getSVGFromSource)(src).innerHTML; + } + __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; + + +InlineSVG.defaultProps = { + element: 'i', + raw: false, + src: '' +}; + +InlineSVG.propTypes = { + src: _propTypes.string.isRequired, + element: _propTypes.string, + raw: _propTypes.bool +}; + +/***/ }), +/* 99 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -16431,7 +12239,7 @@ EventEmitter.prototype = { var EventEmitter = function EventEmitter() {}; module.exports = EventEmitter; -const promise = __webpack_require__(3380); +const promise = __webpack_require__(393); /** * Decorate an object with event emitter functionality. @@ -16549,8 +12357,746 @@ EventEmitter.prototype = { }; /***/ }), +/* 100 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ 3236: +"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__(399); +var util = __webpack_require__(400); + +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__(401); + +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; +}; + + +/***/ }), +/* 101 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -16579,17 +13125,17 @@ exports.getBreakpointForLine = getBreakpointForLine; exports.getHiddenBreakpoint = getHiddenBreakpoint; exports.getHiddenBreakpointLocation = getHiddenBreakpointLocation; -var _immutable = __webpack_require__(146); +var _immutable = __webpack_require__(19); var I = _interopRequireWildcard(_immutable); -var _makeRecord = __webpack_require__(3202); +var _makeRecord = __webpack_require__(24); var _makeRecord2 = _interopRequireDefault(_makeRecord); -var _devtoolsSourceMap = __webpack_require__(3197); +var _devtoolsSourceMap = __webpack_require__(12); -var _breakpoint = __webpack_require__(3209); +var _breakpoint = __webpack_require__(41); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -16765,8 +13311,7 @@ function getHiddenBreakpointLocation(state) { exports.default = update; /***/ }), - -/***/ 3237: +/* 102 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -16781,11 +13326,11 @@ exports.getTextSearchResults = getTextSearchResults; exports.getTextSearchStatus = getTextSearchStatus; exports.getTextSearchQuery = getTextSearchQuery; -var _immutable = __webpack_require__(146); +var _immutable = __webpack_require__(19); var I = _interopRequireWildcard(_immutable); -var _makeRecord = __webpack_require__(3202); +var _makeRecord = __webpack_require__(24); var _makeRecord2 = _interopRequireDefault(_makeRecord); @@ -16869,8 +13414,7 @@ function getTextSearchQuery(state) { exports.default = update; /***/ }), - -/***/ 3238: +/* 103 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -16881,7 +13425,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = assert; -var _devtoolsConfig = __webpack_require__(3198); +var _devtoolsConfig = __webpack_require__(13); function assert(condition, message) { if ((0, _devtoolsConfig.isDevelopment)() && !condition) { @@ -16892,8 +13436,7 @@ function assert(condition, message) { * file, You can obtain one at . */ /***/ }), - -/***/ 3239: +/* 104 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -16934,8 +13477,7 @@ function correctIndentation(text) { } /***/ }), - -/***/ 3240: +/* 105 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -16946,9 +13488,9 @@ Object.defineProperty(exports, "__esModule", { }); exports.renderWasmText = exports.clearWasmStates = exports.wasmOffsetToLine = exports.lineToWasmOffset = exports.isWasm = exports.getWasmLineNumberFormatter = exports.getWasmText = undefined; -var _WasmParser = __webpack_require__(677); +var _WasmParser = __webpack_require__(437); -var _WasmDis = __webpack_require__(678); +var _WasmDis = __webpack_require__(438); /* 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 @@ -17077,8 +13619,7 @@ exports.clearWasmStates = clearWasmStates; exports.renderWasmText = renderWasmText; /***/ }), - -/***/ 3241: +/* 106 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -17139,8 +13680,7 @@ function resizeToggleButton(editor) { } /***/ }), - -/***/ 3242: +/* 107 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -17151,7 +13691,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.formatKeyShortcut = undefined; -var _devtoolsModules = __webpack_require__(3221); +var _devtoolsModules = __webpack_require__(70); const { appinfo } = _devtoolsModules.Services; /* 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 @@ -17188,8 +13728,7 @@ function formatKeyShortcut(shortcut) { exports.formatKeyShortcut = formatKeyShortcut; /***/ }), - -/***/ 3243: +/* 108 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -17200,7 +13739,7 @@ exports.formatKeyShortcut = formatKeyShortcut; * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // Dependencies -const PropTypes = __webpack_require__(20); +const PropTypes = __webpack_require__(2); const { containsURL, @@ -17213,9 +13752,9 @@ const { isGrip, tokenSplitRegex, ELLIPSIS -} = __webpack_require__(3194); +} = __webpack_require__(5); -const dom = __webpack_require__(1758); +const dom = __webpack_require__(3); const { a, span } = dom; /** @@ -17476,8 +14015,1358 @@ module.exports = { }; /***/ }), +/* 109 */ +/***/ (function(module, exports) { -/***/ 3244: +(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 = 150; + + 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_row, csc_score, csc_should_rebuild, i, j, m, miss_budget, miss_left, 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; + csc_should_rebuild = true; + j = -1; + while (++j < n) { + score_row[j] = 0; + csc_row[j] = 0; + } + i = -1; + while (++i < m) { + si_lw = subject_lw[i]; + if (!si_lw.charCodeAt(0) in preparedQuery.charCodes) { + if (csc_should_rebuild) { + j = -1; + while (++j < n) { + csc_row[j] = 0; + } + csc_should_rebuild = false; + } + continue; + } + score = 0; + score_diag = 0; + csc_diag = 0; + record_miss = true; + csc_should_rebuild = true; + 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 Math.max(score, 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 < k) { + i--; + } + 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); + + +/***/ }), +/* 110 */, +/* 111 */, +/* 112 */, +/* 113 */, +/* 114 */, +/* 115 */, +/* 116 */, +/* 117 */, +/* 118 */, +/* 119 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__ = __webpack_require__(306); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getPrototype_js__ = __webpack_require__(311); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isObjectLike_js__ = __webpack_require__(313); + + + + +/** `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); + + +/***/ }), +/* 120 */ +/***/ (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 */ +} + +/***/ }), +/* 121 */ +/***/ (function(module, exports, __webpack_require__) { + +var memoizeCapped = __webpack_require__(122); + +/** Used to match property names within property paths. */ +var 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 (string.charCodeAt(0) === 46 /* . */) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, subString) { + result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; +}); + +module.exports = stringToPath; + + +/***/ }), +/* 122 */ +/***/ (function(module, exports, __webpack_require__) { + +var memoize = __webpack_require__(123); + +/** 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; + + +/***/ }), +/* 123 */ +/***/ (function(module, exports, __webpack_require__) { + +var MapCache = __webpack_require__(65); + +/** 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; + + +/***/ }), +/* 124 */ +/***/ (function(module, exports, __webpack_require__) { + +var Hash = __webpack_require__(125), + ListCache = __webpack_require__(53), + Map = __webpack_require__(66); + +/** + * 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; + + +/***/ }), +/* 125 */ +/***/ (function(module, exports, __webpack_require__) { + +var hashClear = __webpack_require__(126), + hashDelete = __webpack_require__(131), + hashGet = __webpack_require__(132), + hashHas = __webpack_require__(133), + hashSet = __webpack_require__(134); + +/** + * 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; + + +/***/ }), +/* 126 */ +/***/ (function(module, exports, __webpack_require__) { + +var nativeCreate = __webpack_require__(36); + +/** + * 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; + + +/***/ }), +/* 127 */ +/***/ (function(module, exports, __webpack_require__) { + +var isFunction = __webpack_require__(90), + isMasked = __webpack_require__(128), + isObject = __webpack_require__(26), + toSource = __webpack_require__(91); + +/** + * 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; + + +/***/ }), +/* 128 */ +/***/ (function(module, exports, __webpack_require__) { + +var coreJsData = __webpack_require__(129); + +/** 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; + + +/***/ }), +/* 129 */ +/***/ (function(module, exports, __webpack_require__) { + +var root = __webpack_require__(18); + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +module.exports = coreJsData; + + +/***/ }), +/* 130 */ +/***/ (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; + + +/***/ }), +/* 131 */ +/***/ (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; + + +/***/ }), +/* 132 */ +/***/ (function(module, exports, __webpack_require__) { + +var nativeCreate = __webpack_require__(36); + +/** 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; + + +/***/ }), +/* 133 */ +/***/ (function(module, exports, __webpack_require__) { + +var nativeCreate = __webpack_require__(36); + +/** 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; + + +/***/ }), +/* 134 */ +/***/ (function(module, exports, __webpack_require__) { + +var nativeCreate = __webpack_require__(36); + +/** 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; + + +/***/ }), +/* 135 */ +/***/ (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; + + +/***/ }), +/* 136 */ +/***/ (function(module, exports, __webpack_require__) { + +var assocIndexOf = __webpack_require__(37); + +/** 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; + + +/***/ }), +/* 137 */ +/***/ (function(module, exports, __webpack_require__) { + +var assocIndexOf = __webpack_require__(37); + +/** + * 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; + + +/***/ }), +/* 138 */ +/***/ (function(module, exports, __webpack_require__) { + +var assocIndexOf = __webpack_require__(37); + +/** + * 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; + + +/***/ }), +/* 139 */ +/***/ (function(module, exports, __webpack_require__) { + +var assocIndexOf = __webpack_require__(37); + +/** + * 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; + + +/***/ }), +/* 140 */ +/***/ (function(module, exports, __webpack_require__) { + +var getMapData = __webpack_require__(38); + +/** + * 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; + + +/***/ }), +/* 141 */ +/***/ (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; + + +/***/ }), +/* 142 */ +/***/ (function(module, exports, __webpack_require__) { + +var getMapData = __webpack_require__(38); + +/** + * 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; + + +/***/ }), +/* 143 */ +/***/ (function(module, exports, __webpack_require__) { + +var getMapData = __webpack_require__(38); + +/** + * 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; + + +/***/ }), +/* 144 */ +/***/ (function(module, exports, __webpack_require__) { + +var getMapData = __webpack_require__(38); + +/** + * 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; + + +/***/ }), +/* 145 */ +/***/ (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; }; + + +/***/ }), +/* 146 */ +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE_146__; + +/***/ }), +/* 147 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -17486,7 +15375,7 @@ module.exports = { (function () { var computeScore, countDir, file_coeff, getExtension, getExtensionScore, isMatch, scorePath, scoreSize, tau_depth, _ref; - _ref = __webpack_require__(3234), isMatch = _ref.isMatch, computeScore = _ref.computeScore, scoreSize = _ref.scoreSize; + _ref = __webpack_require__(97), isMatch = _ref.isMatch, computeScore = _ref.computeScore, scoreSize = _ref.scoreSize; tau_depth = 13; @@ -17594,8 +15483,7 @@ module.exports = { }).call(undefined); /***/ }), - -/***/ 3245: +/* 148 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -17609,7 +15497,7 @@ exports.findClosestScope = findClosestScope; exports.getASTLocation = getASTLocation; exports.findScopeByName = findScopeByName; -var _parser = __webpack_require__(3203); +var _parser = __webpack_require__(31); function containsPosition(a, b) { const startsBefore = a.start.line < b.line || a.start.line === b.line && a.start.column <= b.column; @@ -17669,15 +15557,14 @@ async function findScopeByName(source, name) { } /***/ }), - -/***/ 3246: +/* 149 */ /***/ (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); +const md5 = __webpack_require__(150); function originalToGeneratedId(originalId) { const match = originalId.match(/(.*)\/originalSource/); @@ -17750,8 +15637,302 @@ module.exports = { }; /***/ }), +/* 150 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ 3247: +(function(){ + var crypt = __webpack_require__(151), + utf8 = __webpack_require__(71).utf8, + isBuffer = __webpack_require__(152), + bin = __webpack_require__(71).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); + }; + +})(); + + +/***/ }), +/* 151 */ +/***/ (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; +})(); + + +/***/ }), +/* 152 */ +/***/ (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)) +} + + +/***/ }), +/* 153 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -17792,8 +15973,7 @@ exports.isAbsolute = isAbsolute; exports.join = join; /***/ }), - -/***/ 3248: +/* 154 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -17814,11 +15994,11 @@ exports.getConditionalPanelLine = getConditionalPanelLine; exports.getProjectDirectoryRoot = getProjectDirectoryRoot; exports.getOrientation = getOrientation; -var _makeRecord = __webpack_require__(3202); +var _makeRecord = __webpack_require__(24); var _makeRecord2 = _interopRequireDefault(_makeRecord); -var _prefs = __webpack_require__(226); +var _prefs = __webpack_require__(10); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -17975,8 +16155,7 @@ function getOrientation(state) { exports.default = update; /***/ }), - -/***/ 3249: +/* 155 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -18006,11 +16185,11 @@ exports.getSourceMetaData = getSourceMetaData; exports.getInScopeLines = getInScopeLines; exports.isLineInScope = isLineInScope; -var _immutable = __webpack_require__(146); +var _immutable = __webpack_require__(19); var I = _interopRequireWildcard(_immutable); -var _makeRecord = __webpack_require__(3202); +var _makeRecord = __webpack_require__(24); var _makeRecord2 = _interopRequireDefault(_makeRecord); @@ -18155,8 +16334,7 @@ function isLineInScope(state, line) { exports.default = update; /***/ }), - -/***/ 3250: +/* 156 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -18166,7 +16344,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _lodash = __webpack_require__(2); +var _lodash = __webpack_require__(11); let newSources; let createSource; @@ -18198,8 +16376,7 @@ exports.default = { }; /***/ }), - -/***/ 3251: +/* 157 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -18210,7 +16387,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.findSourceMatches = exports.searchSources = exports.getMatches = exports.stopSearchWorker = exports.startSearchWorker = undefined; -var _devtoolsUtils = __webpack_require__(3204); +var _devtoolsUtils = __webpack_require__(27); const { WorkerDispatcher } = _devtoolsUtils.workerUtils; /* 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 @@ -18225,8 +16402,7 @@ const searchSources = exports.searchSources = dispatcher.task("searchSources"); const findSourceMatches = exports.findSourceMatches = dispatcher.task("findSourceMatches"); /***/ }), - -/***/ 3252: +/* 158 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -18237,7 +16413,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.getGeneratedLocation = getGeneratedLocation; -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); async function getGeneratedLocation(state, source, location, sourceMaps) { if (!sourceMaps.isOriginalId(location.sourceId)) { @@ -18259,8 +16435,7 @@ async function getGeneratedLocation(state, source, location, sourceMaps) { * file, You can obtain one at . */ /***/ }), - -/***/ 3253: +/* 159 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -18270,7 +16445,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _commands = __webpack_require__(3254); +var _commands = __webpack_require__(160); Object.defineProperty(exports, "stepIn", { enumerable: true, @@ -18321,7 +16496,7 @@ Object.defineProperty(exports, "reverseStepOut", { } }); -var _fetchScopes = __webpack_require__(3255); +var _fetchScopes = __webpack_require__(161); Object.defineProperty(exports, "fetchScopes", { enumerable: true, @@ -18330,7 +16505,7 @@ Object.defineProperty(exports, "fetchScopes", { } }); -var _paused = __webpack_require__(3414); +var _paused = __webpack_require__(432); Object.defineProperty(exports, "paused", { enumerable: true, @@ -18339,7 +16514,7 @@ Object.defineProperty(exports, "paused", { } }); -var _resumed = __webpack_require__(3425); +var _resumed = __webpack_require__(445); Object.defineProperty(exports, "resumed", { enumerable: true, @@ -18348,7 +16523,7 @@ Object.defineProperty(exports, "resumed", { } }); -var _continueToHere = __webpack_require__(3426); +var _continueToHere = __webpack_require__(446); Object.defineProperty(exports, "continueToHere", { enumerable: true, @@ -18357,7 +16532,7 @@ Object.defineProperty(exports, "continueToHere", { } }); -var _breakOnNext = __webpack_require__(3427); +var _breakOnNext = __webpack_require__(447); Object.defineProperty(exports, "breakOnNext", { enumerable: true, @@ -18366,7 +16541,7 @@ Object.defineProperty(exports, "breakOnNext", { } }); -var _mapFrames = __webpack_require__(3295); +var _mapFrames = __webpack_require__(230); Object.defineProperty(exports, "mapFrames", { enumerable: true, @@ -18375,7 +16550,7 @@ Object.defineProperty(exports, "mapFrames", { } }); -var _setPopupObjectProperties = __webpack_require__(3428); +var _setPopupObjectProperties = __webpack_require__(448); Object.defineProperty(exports, "setPopupObjectProperties", { enumerable: true, @@ -18384,7 +16559,7 @@ Object.defineProperty(exports, "setPopupObjectProperties", { } }); -var _pauseOnExceptions = __webpack_require__(3429); +var _pauseOnExceptions = __webpack_require__(449); Object.defineProperty(exports, "pauseOnExceptions", { enumerable: true, @@ -18393,7 +16568,7 @@ Object.defineProperty(exports, "pauseOnExceptions", { } }); -var _selectFrame = __webpack_require__(3430); +var _selectFrame = __webpack_require__(450); Object.defineProperty(exports, "selectFrame", { enumerable: true, @@ -18403,8 +16578,7 @@ Object.defineProperty(exports, "selectFrame", { }); /***/ }), - -/***/ 3254: +/* 160 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -18424,15 +16598,15 @@ exports.reverseStepOver = reverseStepOver; exports.reverseStepOut = reverseStepOut; exports.astCommand = astCommand; -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -var _promise = __webpack_require__(3206); +var _promise = __webpack_require__(33); -var _parser = __webpack_require__(3203); +var _parser = __webpack_require__(31); -var _breakpoints = __webpack_require__(3217); +var _breakpoints = __webpack_require__(59); -var _prefs = __webpack_require__(226); +var _prefs = __webpack_require__(10); /** * Debugger commands like stepOver, stepIn, stepUp @@ -18615,8 +16789,7 @@ function astCommand(stepType) { } /***/ }), - -/***/ 3255: +/* 161 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -18627,11 +16800,11 @@ Object.defineProperty(exports, "__esModule", { }); exports.fetchScopes = fetchScopes; -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -var _mapScopes = __webpack_require__(3410); +var _mapScopes = __webpack_require__(428); -var _promise = __webpack_require__(3206); +var _promise = __webpack_require__(33); function fetchScopes() { return async function ({ dispatch, getState, client, sourceMaps }) { @@ -18653,8 +16826,7 @@ function fetchScopes() { * file, You can obtain one at . */ /***/ }), - -/***/ 3256: +/* 162 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -18671,27 +16843,27 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument exports.createPrettySource = createPrettySource; exports.togglePrettyPrint = togglePrettyPrint; -var _assert = __webpack_require__(3238); +var _assert = __webpack_require__(103); var _assert2 = _interopRequireDefault(_assert); -var _breakpoints = __webpack_require__(3217); +var _breakpoints = __webpack_require__(59); -var _ast = __webpack_require__(3257); +var _ast = __webpack_require__(163); -var _prettyPrint = __webpack_require__(3288); +var _prettyPrint = __webpack_require__(222); -var _parser = __webpack_require__(3203); +var _parser = __webpack_require__(31); -var _source = __webpack_require__(3196); +var _source = __webpack_require__(9); -var _loadSourceText = __webpack_require__(3226); +var _loadSourceText = __webpack_require__(76); -var _sources = __webpack_require__(3207); +var _sources = __webpack_require__(34); -var _pause = __webpack_require__(3253); +var _pause = __webpack_require__(159); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -18777,8 +16949,7 @@ function togglePrettyPrint(sourceId) { } /***/ }), - -/***/ 3257: +/* 163 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -18792,11 +16963,11 @@ exports.setSymbols = setSymbols; exports.setEmptyLines = setEmptyLines; exports.setOutOfScopeLocations = setOutOfScopeLocations; -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -var _setInScopeLines = __webpack_require__(3415); +var _setInScopeLines = __webpack_require__(433); -var _parser = __webpack_require__(3203); +var _parser = __webpack_require__(31); function setSourceMetaData(sourceId) { return async ({ dispatch, getState }) => { @@ -18888,8 +17059,7 @@ function setOutOfScopeLocations() { } /***/ }), - -/***/ 3258: +/* 164 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -18900,7 +17070,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = buildQuery; -var _escapeRegExp = __webpack_require__(259); +var _escapeRegExp = __webpack_require__(165); var _escapeRegExp2 = _interopRequireDefault(_escapeRegExp); @@ -18970,8 +17140,45 @@ function buildQuery(originalQuery, modifiers, { isGlobal = false, ignoreSpaces = } /***/ }), +/* 165 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ 3259: +var toString = __webpack_require__(55); + +/** + * 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; + + +/***/ }), +/* 166 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -18983,7 +17190,7 @@ Object.defineProperty(exports, "__esModule", { exports.Modal = exports.transitionTimeout = undefined; exports.default = Slide; -var _propTypes = __webpack_require__(20); +var _propTypes = __webpack_require__(2); var _propTypes2 = _interopRequireDefault(_propTypes); @@ -18991,15 +17198,15 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _classnames = __webpack_require__(175); +var _classnames = __webpack_require__(6); var _classnames2 = _interopRequireDefault(_classnames); -var _Transition = __webpack_require__(333); +var _Transition = __webpack_require__(462); var _Transition2 = _interopRequireDefault(_Transition); -__webpack_require__(3444); +__webpack_require__(464); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -19061,8 +17268,7 @@ function Slide({ } /***/ }), - -/***/ 3260: +/* 167 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -19073,11 +17279,11 @@ Object.defineProperty(exports, "__esModule", { }); exports.addToTree = addToTree; -var _utils = __webpack_require__(3210); +var _utils = __webpack_require__(42); -var _treeOrder = __webpack_require__(3455); +var _treeOrder = __webpack_require__(475); -var _getURL = __webpack_require__(3261); +var _getURL = __webpack_require__(168); function isUnderRoot(url, projectRoot) { if (!projectRoot) { @@ -19203,8 +17409,7 @@ function addToTree(tree, source, debuggeeUrl, projectRoot) { } /***/ }), - -/***/ 3261: +/* 168 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -19216,9 +17421,9 @@ Object.defineProperty(exports, "__esModule", { exports.getFilenameFromPath = getFilenameFromPath; exports.getURL = getURL; -var _url = __webpack_require__(334); +var _url = __webpack_require__(100); -var _lodash = __webpack_require__(2); +var _lodash = __webpack_require__(11); /* 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 @@ -19321,8 +17526,7 @@ function getURL(sourceUrl, debuggeeUrl = "") { } /***/ }), - -/***/ 3262: +/* 169 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -19333,7 +17537,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.collapseTree = collapseTree; -var _utils = __webpack_require__(3210); +var _utils = __webpack_require__(42); /** * Take an existing source tree, and return a new one with collapsed nodes. @@ -19359,8 +17563,7 @@ function collapseTree(node, depth = 0) { * file, You can obtain one at . */ /***/ }), - -/***/ 3263: +/* 170 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -19378,11 +17581,11 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -__webpack_require__(3463); +__webpack_require__(543); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const { Tree } = __webpack_require__(3302); +const { Tree } = __webpack_require__(236); class ManagedTree extends _react.Component { constructor(props) { @@ -19498,8 +17701,7 @@ class ManagedTree extends _react.Component { exports.default = ManagedTree; /***/ }), - -/***/ 3264: +/* 171 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -19513,19 +17715,19 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _Svg = __webpack_require__(3201); +var _Svg = __webpack_require__(22); var _Svg2 = _interopRequireDefault(_Svg); -var _classnames = __webpack_require__(175); +var _classnames = __webpack_require__(6); var _classnames2 = _interopRequireDefault(_classnames); -var _Close = __webpack_require__(3229); +var _Close = __webpack_require__(79); var _Close2 = _interopRequireDefault(_Close); -__webpack_require__(3467); +__webpack_require__(548); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -19658,8 +17860,7 @@ SearchInput.defaultProps = { exports.default = SearchInput; /***/ }), - -/***/ 3265: +/* 172 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -19673,19 +17874,19 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _classnames = __webpack_require__(175); +var _classnames = __webpack_require__(6); var _classnames2 = _interopRequireDefault(_classnames); -var _Svg = __webpack_require__(3201); +var _Svg = __webpack_require__(22); var _Svg2 = _interopRequireDefault(_Svg); -var _CommandBarButton = __webpack_require__(3304); +var _CommandBarButton = __webpack_require__(238); var _CommandBarButton2 = _interopRequireDefault(_CommandBarButton); -__webpack_require__(3478); +__webpack_require__(559); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -19718,8 +17919,7 @@ PaneToggleButton.defaultProps = { exports.default = PaneToggleButton; /***/ }), - -/***/ 3266: +/* 173 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -19729,17 +17929,17 @@ exports.default = PaneToggleButton; * 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 { MODE } = __webpack_require__(3199); -const { REPS, getRep } = __webpack_require__(3214); -const ObjectInspector = __webpack_require__(3509); -const ObjectInspectorUtils = __webpack_require__(3311); +const { MODE } = __webpack_require__(14); +const { REPS, getRep } = __webpack_require__(49); +const ObjectInspector = __webpack_require__(592); +const ObjectInspectorUtils = __webpack_require__(245); const { parseURLEncodedText, parseURLParams, maybeEscapePropertyName, getGripPreviewItems -} = __webpack_require__(3194); +} = __webpack_require__(5); module.exports = { REPS, @@ -19754,8 +17954,7 @@ module.exports = { }; /***/ }), - -/***/ 3267: +/* 174 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -19766,17 +17965,17 @@ module.exports = { * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // ReactJS -const PropTypes = __webpack_require__(20); +const PropTypes = __webpack_require__(2); // Dependencies const { isGrip, wrapRender -} = __webpack_require__(3194); -const PropRep = __webpack_require__(3232); -const { MODE } = __webpack_require__(3199); +} = __webpack_require__(5); +const PropRep = __webpack_require__(82); +const { MODE } = __webpack_require__(14); -const dom = __webpack_require__(1758); +const dom = __webpack_require__(3); const { span } = dom; /** @@ -19875,7 +18074,7 @@ function safePropIterator(props, object, max) { function propIterator(props, object, max) { if (object.preview && Object.keys(object.preview).includes("wrappedValue")) { - const { Rep } = __webpack_require__(3214); + const { Rep } = __webpack_require__(49); return [Rep({ object: object.preview.wrappedValue, @@ -20077,14 +18276,13 @@ let Grip = { module.exports = Grip; /***/ }), - -/***/ 3268: +/* 175 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var _svgInlineReact = __webpack_require__(1763); +var _svgInlineReact = __webpack_require__(98); var _svgInlineReact2 = _interopRequireDefault(_svgInlineReact); @@ -20095,12 +18293,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ const React = __webpack_require__(0); -const PropTypes = __webpack_require__(20); +const PropTypes = __webpack_require__(2); const svg = { - "open-inspector": __webpack_require__(1153), - "jump-definition": __webpack_require__(2012) + "open-inspector": __webpack_require__(580), + "jump-definition": __webpack_require__(581) }; Svg.propTypes = { @@ -20125,8 +18323,902 @@ function Svg(name, props) { module.exports = Svg; /***/ }), +/* 176 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ 3271: +(function() { + var computeScore, countDir, file_coeff, getExtension, getExtensionScore, isMatch, scorePath, scoreSize, tau_depth, _ref; + + _ref = __webpack_require__(109), isMatch = _ref.isMatch, computeScore = _ref.computeScore, scoreSize = _ref.scoreSize; + + tau_depth = 20; + + file_coeff = 2.5; + + 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); + + +/***/ }), +/* 177 */, +/* 178 */, +/* 179 */, +/* 180 */, +/* 181 */, +/* 182 */, +/* 183 */, +/* 184 */, +/* 185 */, +/* 186 */, +/* 187 */, +/* 188 */, +/* 189 */, +/* 190 */, +/* 191 */, +/* 192 */, +/* 193 */, +/* 194 */, +/* 195 */ +/***/ (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__(119); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_symbol_observable__ = __webpack_require__(314); + + + +/** + * 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__["a" /* default */]] = function () { + return this; + }, _ref; + } + + // When a store is created, an "INIT" action is dispatched so that every + // reducer returns their initial state. This effectively populates + // the initial state tree. + dispatch({ type: ActionTypes.INIT }); + + return _ref2 = { + dispatch: dispatch, + subscribe: subscribe, + getState: getState, + replaceReducer: replaceReducer + }, _ref2[__WEBPACK_IMPORTED_MODULE_1_symbol_observable__["a" /* default */]] = observable, _ref2; +} + +/***/ }), +/* 196 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__root_js__ = __webpack_require__(307); + + +/** Built-in value references. */ +var Symbol = __WEBPACK_IMPORTED_MODULE_0__root_js__["a" /* default */].Symbol; + +/* harmony default export */ __webpack_exports__["a"] = (Symbol); + + +/***/ }), +/* 197 */ +/***/ (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 */ +} + +/***/ }), +/* 198 */ +/***/ (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)); + }; + }); +} + +/***/ }), +/* 199 */ +/***/ (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__(2); +/* 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 +}); + +/***/ }), +/* 200 */ +/***/ (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__(325); +/* 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__(326); +/* 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__(327); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__ = __webpack_require__(199); +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); + }; +} + +/***/ }), +/* 201 */ +/***/ (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__(202); + + +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; + }; +} + +/***/ }), +/* 202 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* unused harmony export default */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__ = __webpack_require__(119); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__warning__ = __webpack_require__(120); + + + +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 + '.'); + } +} + +/***/ }), +/* 203 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -20154,8 +19246,13 @@ module.exports = function defer() { }; /***/ }), +/* 204 */ +/***/ (function(module, exports) { -/***/ 3272: + + +/***/ }), +/* 205 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -20165,7 +19262,7 @@ module.exports = function defer() { * 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 Immutable = __webpack_require__(146); +const Immutable = __webpack_require__(19); // When our app state is fully types, we should be able to get rid of // this function. This is only temporarily necessary to support @@ -20204,8 +19301,263 @@ function fromJS(value) { module.exports = fromJS; /***/ }), +/* 206 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ 3273: +"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__(19); + +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; + +/***/ }), +/* 207 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -20214,7 +19566,7 @@ module.exports = fromJS; (function () { var Query, coreChars, countDir, getCharCodes, getExtension, opt_char_re, truncatedUpperCase, _ref; - _ref = __webpack_require__(3244), countDir = _ref.countDir, getExtension = _ref.getExtension; + _ref = __webpack_require__(147), countDir = _ref.countDir, getExtension = _ref.getExtension; module.exports = Query = function () { function Query(query, _arg) { @@ -20268,8 +19620,7 @@ module.exports = fromJS; }).call(undefined); /***/ }), - -/***/ 3274: +/* 208 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -20279,14 +19630,13 @@ module.exports = fromJS; * 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 tabs = __webpack_require__(3375); -const config = __webpack_require__(3376); +const tabs = __webpack_require__(388); +const config = __webpack_require__(389); module.exports = Object.assign({}, tabs, config); /***/ }), - -/***/ 3275: +/* 209 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -20298,17 +19648,17 @@ Object.defineProperty(exports, "__esModule", { exports.getExpressionError = exports.getExpressions = exports.createExpressionState = undefined; exports.getExpression = getExpression; -var _makeRecord = __webpack_require__(3202); +var _makeRecord = __webpack_require__(24); var _makeRecord2 = _interopRequireDefault(_makeRecord); -var _immutable = __webpack_require__(146); +var _immutable = __webpack_require__(19); -var _lodash = __webpack_require__(2); +var _lodash = __webpack_require__(11); -var _reselect = __webpack_require__(993); +var _reselect = __webpack_require__(48); -var _prefs = __webpack_require__(226); +var _prefs = __webpack_require__(10); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -20427,8 +19777,7 @@ const getExpressionError = exports.getExpressionError = (0, _reselect.createSele exports.default = update; /***/ }), - -/***/ 3276: +/* 210 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -20441,11 +19790,11 @@ exports.getWorkers = exports.createDebuggeeState = undefined; exports.default = debuggee; exports.getWorker = getWorker; -var _reselect = __webpack_require__(993); +var _reselect = __webpack_require__(48); -var _immutable = __webpack_require__(146); +var _immutable = __webpack_require__(19); -var _makeRecord = __webpack_require__(3202); +var _makeRecord = __webpack_require__(24); var _makeRecord2 = _interopRequireDefault(_makeRecord); @@ -20480,8 +19829,7 @@ function getWorker(state, url) { } /***/ }), - -/***/ 3277: +/* 211 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -20494,17 +19842,17 @@ exports.initialPendingBreakpointsState = initialPendingBreakpointsState; exports.getPendingBreakpoints = getPendingBreakpoints; exports.getPendingBreakpointsForSource = getPendingBreakpointsForSource; -var _immutable = __webpack_require__(146); +var _immutable = __webpack_require__(19); var I = _interopRequireWildcard(_immutable); -var _makeRecord = __webpack_require__(3202); +var _makeRecord = __webpack_require__(24); var _makeRecord2 = _interopRequireDefault(_makeRecord); -var _breakpoint = __webpack_require__(3209); +var _breakpoint = __webpack_require__(41); -var _prefs = __webpack_require__(226); +var _prefs = __webpack_require__(10); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -20636,8 +19984,7 @@ function restorePendingBreakpoints() { exports.default = update; /***/ }), - -/***/ 3278: +/* 212 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -20651,11 +19998,11 @@ exports.getFileSearchQuery = getFileSearchQuery; exports.getFileSearchModifiers = getFileSearchModifiers; exports.getFileSearchResults = getFileSearchResults; -var _makeRecord = __webpack_require__(3202); +var _makeRecord = __webpack_require__(24); var _makeRecord2 = _interopRequireDefault(_makeRecord); -var _prefs = __webpack_require__(226); +var _prefs = __webpack_require__(10); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -20738,8 +20085,7 @@ function getFileSearchResults(state) { exports.default = update; /***/ }), - -/***/ 3279: +/* 213 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -20752,15 +20098,15 @@ exports.createCoverageState = undefined; exports.getHitCountForSource = getHitCountForSource; exports.getCoverageEnabled = getCoverageEnabled; -var _makeRecord = __webpack_require__(3202); +var _makeRecord = __webpack_require__(24); var _makeRecord2 = _interopRequireDefault(_makeRecord); -var _immutable = __webpack_require__(146); +var _immutable = __webpack_require__(19); var I = _interopRequireWildcard(_immutable); -var _fromJS = __webpack_require__(3386); +var _fromJS = __webpack_require__(404); var _fromJS2 = _interopRequireDefault(_fromJS); @@ -20806,8 +20152,7 @@ function getCoverageEnabled(state) { exports.default = update; /***/ }), - -/***/ 3280: +/* 214 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -20980,8 +20325,7 @@ function getHistoryPosition(state) { exports.default = update; /***/ }), - -/***/ 3281: +/* 215 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -20994,7 +20338,7 @@ exports.InitialState = InitialState; exports.default = update; exports.getExpandedState = getExpandedState; -var _makeRecord = __webpack_require__(3202); +var _makeRecord = __webpack_require__(24); var _makeRecord2 = _interopRequireDefault(_makeRecord); @@ -21026,8 +20370,7 @@ function getExpandedState(state) { } /***/ }), - -/***/ 3282: +/* 216 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -21080,8 +20423,7 @@ function getEventListeners(state) { exports.default = update; /***/ }), - -/***/ 3283: +/* 217 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -21096,11 +20438,11 @@ exports.getQuickOpenEnabled = getQuickOpenEnabled; exports.getQuickOpenQuery = getQuickOpenQuery; exports.getQuickOpenType = getQuickOpenType; -var _makeRecord = __webpack_require__(3202); +var _makeRecord = __webpack_require__(24); var _makeRecord2 = _interopRequireDefault(_makeRecord); -var _quickOpen = __webpack_require__(3284); +var _quickOpen = __webpack_require__(218); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -21155,8 +20497,7 @@ function getQuickOpenType(state) { } /***/ }), - -/***/ 3284: +/* 218 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -21178,9 +20519,9 @@ exports.formatSymbols = formatSymbols; exports.formatShortcutResults = formatShortcutResults; exports.formatSources = formatSources; -var _utils = __webpack_require__(3222); +var _utils = __webpack_require__(72); -var _source = __webpack_require__(3196); +var _source = __webpack_require__(9); const MODIFIERS = exports.MODIFIERS = { "@": "functions", @@ -21271,8 +20612,7 @@ function formatSources(sources) { } /***/ }), - -/***/ 3285: +/* 219 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -21361,8 +20701,7 @@ function createBreakpointLocation(location, actualLocation) { } /***/ }), - -/***/ 3286: +/* 220 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -21419,8 +20758,7 @@ function createLoadedObject(serverObject, parentId) { } /***/ }), - -/***/ 3287: +/* 221 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -21443,41 +20781,41 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _redux = __webpack_require__(3); +var _redux = __webpack_require__(8); -var _reactDom = __webpack_require__(4); +var _reactDom = __webpack_require__(39); var _reactDom2 = _interopRequireDefault(_reactDom); -var _devtoolsConfig = __webpack_require__(3198); +var _devtoolsConfig = __webpack_require__(13); -var _devtoolsLaunchpad = __webpack_require__(3218); +var _devtoolsLaunchpad = __webpack_require__(60); -var _devtoolsSourceMap = __webpack_require__(3197); +var _devtoolsSourceMap = __webpack_require__(12); -var _search = __webpack_require__(3251); +var _search = __webpack_require__(157); -var _prettyPrint = __webpack_require__(3288); +var _prettyPrint = __webpack_require__(222); -var _parser = __webpack_require__(3203); +var _parser = __webpack_require__(31); -var _createStore = __webpack_require__(3398); +var _createStore = __webpack_require__(416); var _createStore2 = _interopRequireDefault(_createStore); -var _reducers = __webpack_require__(3403); +var _reducers = __webpack_require__(421); var _reducers2 = _interopRequireDefault(_reducers); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); var selectors = _interopRequireWildcard(_selectors); -var _App = __webpack_require__(3405); +var _App = __webpack_require__(423); var _App2 = _interopRequireDefault(_App); -var _prefs = __webpack_require__(226); +var _prefs = __webpack_require__(10); 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; } } @@ -21495,7 +20833,7 @@ function bootstrapStore(client, { services, toolboxActions }) { const store = createStore((0, _redux.combineReducers)(_reducers2.default)); store.subscribe(() => updatePrefs(store.getState())); - const actions = (0, _redux.bindActionCreators)(__webpack_require__(3195).default, store.dispatch); + const actions = (0, _redux.bindActionCreators)(__webpack_require__(7).default, store.dispatch); return { store, actions, selectors }; } @@ -21542,8 +20880,7 @@ function updatePrefs(state) { } /***/ }), - -/***/ 3288: +/* 222 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -21555,11 +20892,11 @@ Object.defineProperty(exports, "__esModule", { exports.stopPrettyPrintWorker = exports.startPrettyPrintWorker = undefined; exports.prettyPrint = prettyPrint; -var _devtoolsUtils = __webpack_require__(3204); +var _devtoolsUtils = __webpack_require__(27); -var _source = __webpack_require__(3196); +var _source = __webpack_require__(9); -var _assert = __webpack_require__(3238); +var _assert = __webpack_require__(103); var _assert2 = _interopRequireDefault(_assert); @@ -21587,8 +20924,7 @@ async function prettyPrint({ source, url }) { } /***/ }), - -/***/ 3289: +/* 223 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -21663,8 +20999,7 @@ function waitUntilService({ dispatch, getState }) { } /***/ }), - -/***/ 3290: +/* 224 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -21676,7 +21011,7 @@ Object.defineProperty(exports, "__esModule", { exports.reportException = reportException; exports.executeSoon = executeSoon; -var _assert = __webpack_require__(3238); +var _assert = __webpack_require__(103); var _assert2 = _interopRequireDefault(_assert); @@ -21696,8 +21031,7 @@ function executeSoon(fn) { exports.default = _assert2.default; /***/ }), - -/***/ 3291: +/* 225 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -21710,7 +21044,7 @@ exports.sanitizeInput = sanitizeInput; exports.wrapExpression = wrapExpression; exports.getValue = getValue; -var _indentation = __webpack_require__(3239); +var _indentation = __webpack_require__(104); // replace quotes that could interfere with the evaluation. function sanitizeInput(input) { @@ -21781,8 +21115,7 @@ function getValue(expression) { } /***/ }), - -/***/ 3292: +/* 226 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -21803,8 +21136,7 @@ function locColumn(loc) { } /***/ }), - -/***/ 3293: +/* 227 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -21818,11 +21150,11 @@ exports.moveTab = moveTab; exports.closeTab = closeTab; exports.closeTabs = closeTabs; -var _editor = __webpack_require__(3200); +var _editor = __webpack_require__(15); -var _sources = __webpack_require__(3207); +var _sources = __webpack_require__(34); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); function addTab(source, tabIndex) { return { @@ -21883,8 +21215,7 @@ function closeTabs(urls) { } /***/ }), - -/***/ 3294: +/* 228 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -21895,13 +21226,13 @@ Object.defineProperty(exports, "__esModule", { }); exports.showLoading = exports.showErrorMessage = exports.showSourceText = exports.clearEditor = exports.updateDocument = exports.updateLineNumberFormat = exports.clearDocuments = exports.removeDocument = exports.hasDocument = exports.setDocument = exports.getDocument = undefined; -var _source = __webpack_require__(3196); +var _source = __webpack_require__(9); -var _wasm = __webpack_require__(3240); +var _wasm = __webpack_require__(105); -var _ui = __webpack_require__(3241); +var _ui = __webpack_require__(106); -var _sourceEditor = __webpack_require__(197); +var _sourceEditor = __webpack_require__(229); var _sourceEditor2 = _interopRequireDefault(_sourceEditor); @@ -22058,8 +21389,13 @@ exports.showErrorMessage = showErrorMessage; exports.showLoading = showLoading; /***/ }), +/* 229 */ +/***/ (function(module, exports) { -/***/ 3295: +module.exports = __WEBPACK_EXTERNAL_MODULE_229__; + +/***/ }), +/* 230 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -22074,7 +21410,7 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument exports.updateFrameLocation = updateFrameLocation; exports.mapFrames = mapFrames; -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); function updateFrameLocation(frame, sourceMaps) { return sourceMaps.getOriginalLocation(frame.location).then(loc => _extends({}, frame, { @@ -22117,8 +21453,7 @@ function mapFrames() { } /***/ }), - -/***/ 3296: +/* 231 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -22138,8 +21473,7 @@ function updateWorkers() { * file, You can obtain one at . */ /***/ }), - -/***/ 3297: +/* 232 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -22161,8 +21495,7 @@ function setExpandedState(expanded) { * file, You can obtain one at . */ /***/ }), - -/***/ 3298: +/* 233 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -22206,125 +21539,15 @@ function isReactComponent(result) { } /***/ }), - -/***/ 3299: +/* 234 */ /***/ (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__(3442)(); -} - - -/***/ }), - -/***/ 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); - - -/***/ }), - -/***/ 3300: -/***/ (function(module, exports, __webpack_require__) { - -const SplitBox = __webpack_require__(3450); +const SplitBox = __webpack_require__(470); module.exports = SplitBox; /***/ }), - -/***/ 3301: +/* 235 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -22334,7 +21557,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _addToTree = __webpack_require__(3260); +var _addToTree = __webpack_require__(167); Object.defineProperty(exports, "addToTree", { enumerable: true, @@ -22343,7 +21566,7 @@ Object.defineProperty(exports, "addToTree", { } }); -var _collapseTree = __webpack_require__(3262); +var _collapseTree = __webpack_require__(169); Object.defineProperty(exports, "collapseTree", { enumerable: true, @@ -22352,7 +21575,7 @@ Object.defineProperty(exports, "collapseTree", { } }); -var _createTree = __webpack_require__(3456); +var _createTree = __webpack_require__(476); Object.defineProperty(exports, "createTree", { enumerable: true, @@ -22361,7 +21584,7 @@ Object.defineProperty(exports, "createTree", { } }); -var _formatTree = __webpack_require__(3457); +var _formatTree = __webpack_require__(477); Object.defineProperty(exports, "formatTree", { enumerable: true, @@ -22370,7 +21593,7 @@ Object.defineProperty(exports, "formatTree", { } }); -var _getDirectories = __webpack_require__(3458); +var _getDirectories = __webpack_require__(478); Object.defineProperty(exports, "getDirectories", { enumerable: true, @@ -22379,7 +21602,7 @@ Object.defineProperty(exports, "getDirectories", { } }); -var _getURL = __webpack_require__(3261); +var _getURL = __webpack_require__(168); Object.defineProperty(exports, "getFilenameFromPath", { enumerable: true, @@ -22394,7 +21617,7 @@ Object.defineProperty(exports, "getURL", { } }); -var _sortTree = __webpack_require__(3459); +var _sortTree = __webpack_require__(479); Object.defineProperty(exports, "sortEntireTree", { enumerable: true, @@ -22409,7 +21632,7 @@ Object.defineProperty(exports, "sortTree", { } }); -var _updateTree = __webpack_require__(3460); +var _updateTree = __webpack_require__(480); Object.defineProperty(exports, "updateTree", { enumerable: true, @@ -22418,7 +21641,7 @@ Object.defineProperty(exports, "updateTree", { } }); -var _utils = __webpack_require__(3210); +var _utils = __webpack_require__(42); Object.defineProperty(exports, "createNode", { enumerable: true, @@ -22470,14 +21693,13 @@ Object.defineProperty(exports, "getExtension", { }); /***/ }), - -/***/ 3302: +/* 236 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var _tree = __webpack_require__(3464); +var _tree = __webpack_require__(544); var _tree2 = _interopRequireDefault(_tree); @@ -22490,8 +21712,7 @@ module.exports = { * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /***/ }), - -/***/ 3303: +/* 237 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -22505,11 +21726,11 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _lodash = __webpack_require__(2); +var _lodash = __webpack_require__(11); -var _frame = __webpack_require__(3216); +var _frame = __webpack_require__(58); -__webpack_require__(3473); +__webpack_require__(554); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -22571,8 +21792,7 @@ class PreviewFunction extends _react.Component { exports.default = PreviewFunction; /***/ }), - -/***/ 3304: +/* 238 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -22584,7 +21804,7 @@ Object.defineProperty(exports, "__esModule", { 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 _classnames = __webpack_require__(175); +var _classnames = __webpack_require__(6); var _classnames2 = _interopRequireDefault(_classnames); @@ -22592,7 +21812,7 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -__webpack_require__(3477); +__webpack_require__(558); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -22617,8 +21837,7 @@ const CommandBarButton = props => { exports.default = CommandBarButton; /***/ }), - -/***/ 3305: +/* 239 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -22629,9 +21848,9 @@ Object.defineProperty(exports, "__esModule", { }); exports.scrollList = undefined; -var _devtoolsConfig = __webpack_require__(3198); +var _devtoolsConfig = __webpack_require__(13); -var _Modal = __webpack_require__(3259); +var _Modal = __webpack_require__(166); /* 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 @@ -22680,8 +21899,7 @@ function chromeScrollList(elem, index) { exports.scrollList = scrollList; /***/ }), - -/***/ 3306: +/* 240 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -22715,8 +21933,7 @@ module.exports = { }; /***/ }), - -/***/ 3307: +/* 241 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -22727,20 +21944,20 @@ module.exports = { * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // Dependencies -const PropTypes = __webpack_require__(20); +const PropTypes = __webpack_require__(2); -const { lengthBubble } = __webpack_require__(3308); +const { lengthBubble } = __webpack_require__(242); const { getGripType, isGrip, wrapRender, ellipsisElement -} = __webpack_require__(3194); -const { MODE } = __webpack_require__(3199); +} = __webpack_require__(5); +const { MODE } = __webpack_require__(14); -const dom = __webpack_require__(1758); +const dom = __webpack_require__(3); const { span } = dom; -const { ModePropType } = __webpack_require__(3231); +const { ModePropType } = __webpack_require__(81); /** * Renders an array. The array is enclosed by left and right bracket @@ -22865,7 +22082,7 @@ function getPreviewItems(grip) { } function arrayIterator(props, grip, max) { - let { Rep } = __webpack_require__(3214); + let { Rep } = __webpack_require__(49); let items = []; const gripLength = getLength(grip); @@ -22954,20 +22171,19 @@ module.exports = { }; /***/ }), - -/***/ 3308: +/* 242 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const PropTypes = __webpack_require__(20); +const PropTypes = __webpack_require__(2); -const { wrapRender } = __webpack_require__(3194); -const { MODE } = __webpack_require__(3199); -const { ModePropType } = __webpack_require__(3231); +const { wrapRender } = __webpack_require__(5); +const { MODE } = __webpack_require__(14); +const { ModePropType } = __webpack_require__(81); -const dom = __webpack_require__(1758); +const dom = __webpack_require__(3); const { span } = dom; GripLengthBubble.propTypes = { @@ -23005,8 +22221,7 @@ module.exports = { }; /***/ }), - -/***/ 3309: +/* 243 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -23018,18 +22233,18 @@ module.exports = { // Dependencies -const { lengthBubble } = __webpack_require__(3308); -const PropTypes = __webpack_require__(20); +const { lengthBubble } = __webpack_require__(242); +const PropTypes = __webpack_require__(2); const { isGrip, wrapRender, ellipsisElement -} = __webpack_require__(3194); -const PropRep = __webpack_require__(3232); -const { MODE } = __webpack_require__(3199); -const { ModePropType } = __webpack_require__(3231); +} = __webpack_require__(5); +const PropRep = __webpack_require__(82); +const { MODE } = __webpack_require__(14); +const { ModePropType } = __webpack_require__(81); -const dom = __webpack_require__(1758); +const dom = __webpack_require__(3); const { span } = dom; /** @@ -23222,8 +22437,7 @@ module.exports = { }; /***/ }), - -/***/ 3310: +/* 244 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -23234,15 +22448,15 @@ module.exports = { * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // Dependencies -const PropTypes = __webpack_require__(20); +const PropTypes = __webpack_require__(2); // Shortcuts -const dom = __webpack_require__(1758); +const dom = __webpack_require__(3); const { span } = dom; const { wrapRender -} = __webpack_require__(3194); -const PropRep = __webpack_require__(3232); -const { MODE } = __webpack_require__(3199); +} = __webpack_require__(5); +const PropRep = __webpack_require__(82); +const { MODE } = __webpack_require__(14); /** * Renders an map entry. A map entry is represented by its key, a column and its value. */ @@ -23301,8 +22515,7 @@ module.exports = { }; /***/ }), - -/***/ 3311: +/* 245 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -23312,9 +22525,9 @@ module.exports = { * 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 client = __webpack_require__(3312); -const loadProperties = __webpack_require__(3511); -const node = __webpack_require__(3313); +const client = __webpack_require__(246); +const loadProperties = __webpack_require__(594); +const node = __webpack_require__(247); module.exports = { client, @@ -23323,8 +22536,7 @@ module.exports = { }; /***/ }), - -/***/ 3312: +/* 246 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -23399,8 +22611,7 @@ module.exports = { }; /***/ }), - -/***/ 3313: +/* 247 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -23410,12 +22621,12 @@ module.exports = { * 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 { get, has } = __webpack_require__(2); -const { maybeEscapePropertyName } = __webpack_require__(3194); -const ArrayRep = __webpack_require__(3231); -const GripArrayRep = __webpack_require__(3307); -const GripMap = __webpack_require__(3309); -const GripMapEntryRep = __webpack_require__(3310); +const { get, has } = __webpack_require__(11); +const { maybeEscapePropertyName } = __webpack_require__(5); +const ArrayRep = __webpack_require__(81); +const GripArrayRep = __webpack_require__(241); +const GripMap = __webpack_require__(243); +const GripMapEntryRep = __webpack_require__(244); const MAX_NUMERICAL_PROPERTIES = 100; @@ -24059,8 +23270,7 @@ module.exports = { }; /***/ }), - -/***/ 3314: +/* 248 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -24074,19 +23284,19 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _classnames = __webpack_require__(175); +var _classnames = __webpack_require__(6); var _classnames2 = _interopRequireDefault(_classnames); -var _Svg = __webpack_require__(3201); +var _Svg = __webpack_require__(22); var _Svg2 = _interopRequireDefault(_Svg); -var _frame = __webpack_require__(3216); +var _frame = __webpack_require__(58); -var _source = __webpack_require__(3196); +var _source = __webpack_require__(9); -var _FrameMenu = __webpack_require__(3315); +var _FrameMenu = __webpack_require__(249); var _FrameMenu2 = _interopRequireDefault(_FrameMenu); @@ -24191,8 +23401,7 @@ FrameComponent.defaultProps = { FrameComponent.displayName = "Frame"; /***/ }), - -/***/ 3315: +/* 249 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -24203,11 +23412,11 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = FrameMenu; -var _devtoolsContextmenu = __webpack_require__(3211); +var _devtoolsContextmenu = __webpack_require__(45); -var _clipboard = __webpack_require__(3230); +var _clipboard = __webpack_require__(80); -var _lodash = __webpack_require__(2); +var _lodash = __webpack_require__(11); const blackboxString = "sourceFooter.blackbox"; /* 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 @@ -24273,15 +23482,13 @@ function FrameMenu(frame, frameworkGroupingOn, callbacks, event) { } /***/ }), - -/***/ 3316: +/* 250 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3317: +/* 251 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -24296,7 +23503,7 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -__webpack_require__(3557); +__webpack_require__(640); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -24309,9 +23516,9 @@ class Dropdown extends _react.Component { super(props); this.toggleDropdown = e => { - this.setState({ - dropdownShown: !this.state.dropdownShown - }); + this.setState(prevState => ({ + dropdownShown: !prevState.dropdownShown + })); }; this.state = { @@ -24364,15 +23571,13 @@ exports.Dropdown = Dropdown; exports.default = Dropdown; /***/ }), - -/***/ 3318: +/* 252 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3319: +/* 253 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -24389,7 +23594,7 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _source = __webpack_require__(3196); +var _source = __webpack_require__(9); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -24490,8 +23695,126 @@ function getTabMenuItems() { } /***/ }), +/* 254 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ 3325: +(function() { + var Query, coreChars, countDir, getCharCodes, getExtension, opt_char_re, truncatedUpperCase, _ref; + + _ref = __webpack_require__(176), 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); + + +/***/ }), +/* 255 */, +/* 256 */, +/* 257 */, +/* 258 */, +/* 259 */, +/* 260 */, +/* 261 */, +/* 262 */, +/* 263 */, +/* 264 */, +/* 265 */, +/* 266 */, +/* 267 */, +/* 268 */, +/* 269 */, +/* 270 */, +/* 271 */, +/* 272 */, +/* 273 */, +/* 274 */, +/* 275 */, +/* 276 */, +/* 277 */, +/* 278 */, +/* 279 */, +/* 280 */, +/* 281 */, +/* 282 */, +/* 283 */, +/* 284 */, +/* 285 */, +/* 286 */, +/* 287 */, +/* 288 */, +/* 289 */, +/* 290 */, +/* 291 */, +/* 292 */, +/* 293 */, +/* 294 */, +/* 295 */, +/* 296 */, +/* 297 */, +/* 298 */, +/* 299 */, +/* 300 */, +/* 301 */, +/* 302 */, +/* 303 */, +/* 304 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(305); + + +/***/ }), +/* 305 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -24501,19 +23824,19 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _reactDom = __webpack_require__(4); +var _reactDom = __webpack_require__(39); var _reactDom2 = _interopRequireDefault(_reactDom); -var _devtoolsLaunchpad = __webpack_require__(3218); +var _devtoolsLaunchpad = __webpack_require__(60); -var _devtoolsConfig = __webpack_require__(3198); +var _devtoolsConfig = __webpack_require__(13); -var _client = __webpack_require__(3377); +var _client = __webpack_require__(390); -var _bootstrap = __webpack_require__(3287); +var _bootstrap = __webpack_require__(221); -var _sourceQueue = __webpack_require__(3250); +var _sourceQueue = __webpack_require__(156); var _sourceQueue2 = _interopRequireDefault(_sourceQueue); @@ -24555,52 +23878,1471 @@ if ((0, _devtoolsConfig.isFirefoxPanel)()) { } else { window.L10N = _devtoolsLaunchpad.L10N; // $FlowIgnore: - window.L10N.setBundle(__webpack_require__(960)); + window.L10N.setBundle(__webpack_require__(661)); (0, _devtoolsLaunchpad.bootstrap)(_react2.default, _reactDom2.default).then(connection => { (0, _client.onConnect)(connection, { - services: { sourceMaps: __webpack_require__(3197) }, + services: { sourceMaps: __webpack_require__(12) }, toolboxActions: {} }); }); } /***/ }), +/* 306 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -/***/ 3326: +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Symbol_js__ = __webpack_require__(196); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getRawTag_js__ = __webpack_require__(309); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__objectToString_js__ = __webpack_require__(310); + + + + +/** `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); + + +/***/ }), +/* 307 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__freeGlobal_js__ = __webpack_require__(308); + + +/** 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); + + +/***/ }), +/* 308 */ +/***/ (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__(40))) + +/***/ }), +/* 309 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Symbol_js__ = __webpack_require__(196); + + +/** 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); + + +/***/ }), +/* 310 */ +/***/ (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); + + +/***/ }), +/* 311 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__overArg_js__ = __webpack_require__(312); + + +/** 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); + + +/***/ }), +/* 312 */ +/***/ (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); + + +/***/ }), +/* 313 */ +/***/ (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); + + +/***/ }), +/* 314 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global, module) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ponyfill_js__ = __webpack_require__(316); +/* global window */ + + +var root; + +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 = Object(__WEBPACK_IMPORTED_MODULE_0__ponyfill_js__["a" /* default */])(root); +/* harmony default export */ __webpack_exports__["a"] = (result); + +/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(40), __webpack_require__(315)(module))) + +/***/ }), +/* 315 */ +/***/ (function(module, exports) { + +module.exports = function(originalModule) { + if(!originalModule.webpackPolyfill) { + var module = Object.create(originalModule); + // 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; + } + }); + Object.defineProperty(module, "exports", { + enumerable: true, + }); + module.webpackPolyfill = 1; + } + return module; +}; + + +/***/ }), +/* 316 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = 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; +}; + + +/***/ }), +/* 317 */ +/***/ (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__(195); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_es_isPlainObject__ = __webpack_require__(119); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_warning__ = __webpack_require__(197); + + + + +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; + }; +} + +/***/ }), +/* 318 */ +/***/ (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; +} + +/***/ }), +/* 319 */ +/***/ (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__(198); +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 + }); + }; + }; +} + +/***/ }), +/* 320 */ +/***/ (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__(2); +/* 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__(199); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils_warning__ = __webpack_require__(120); +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()); + +/***/ }), +/* 321 */ +/***/ (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__(322); +var invariant = __webpack_require__(323); +var ReactPropTypesSecret = __webpack_require__(324); + +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; +}; + + +/***/ }), +/* 322 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -module.exports = function (originalModule) { - if (!originalModule.webpackPolyfill) { - var module = Object.create(originalModule); - // 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; - } - }); - Object.defineProperty(module, "exports", { - enumerable: true - }); - module.webpackPolyfill = 1; - } - return module; +/** + * 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; -/***/ 3327: +/***/ }), +/* 323 */ +/***/ (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; + +/***/ }), +/* 324 */ +/***/ (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; + + +/***/ }), +/* 325 */ +/***/ (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; +}; + + +/***/ }), +/* 326 */ +/***/ (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; + + +/***/ }), +/* 327 */ +/***/ (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; +}(); + + + +/***/ }), +/* 328 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* unused harmony export createConnect */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__ = __webpack_require__(200); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__ = __webpack_require__(329); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__ = __webpack_require__(330); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__ = __webpack_require__(331); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__mergeProps__ = __webpack_require__(332); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__selectorFactory__ = __webpack_require__(333); +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()); + +/***/ }), +/* 329 */ +/***/ (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; +} + +/***/ }), +/* 330 */ +/***/ (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__(8); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__ = __webpack_require__(201); + + + +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]); + +/***/ }), +/* 331 */ +/***/ (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__(201); + + +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]); + +/***/ }), +/* 332 */ +/***/ (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__(202); +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]); + +/***/ }), +/* 333 */ +/***/ (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__(334); +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); +} + +/***/ }), +/* 334 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* unused harmony export default */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_warning__ = __webpack_require__(120); + + +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); +} + +/***/ }), +/* 335 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -24610,7 +25352,7 @@ module.exports = function (originalModule) { * 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 { isDevelopment, isTesting } = __webpack_require__(3198); +const { isDevelopment, isTesting } = __webpack_require__(13); function debugGlobal(field, value) { if (isDevelopment() || isTesting()) { @@ -24623,21 +25365,20 @@ module.exports = { }; /***/ }), - -/***/ 3328: +/* 336 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const pick = __webpack_require__(67); -const put = __webpack_require__(112); -const fs = __webpack_require__(118); -const path = __webpack_require__(119); +const pick = __webpack_require__(88); +const put = __webpack_require__(337); +const fs = __webpack_require__(204); +const path = __webpack_require__(339); let config; -const flag = __webpack_require__(52); +const flag = __webpack_require__(146); function isBrowser() { return typeof window == "object" && typeof module == "undefined"; @@ -24722,8 +25463,332 @@ module.exports = { }; /***/ }), +/* 337 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ 3329: +var baseSet = __webpack_require__(338); + +/** + * 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; + + +/***/ }), +/* 338 */ +/***/ (function(module, exports, __webpack_require__) { + +var assignValue = __webpack_require__(92), + castPath = __webpack_require__(61), + isIndex = __webpack_require__(95), + isObject = __webpack_require__(26), + toKey = __webpack_require__(44); + +/** + * 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; + + +/***/ }), +/* 339 */ +/***/ (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__(145))) + +/***/ }), +/* 340 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -24733,8 +25798,8 @@ module.exports = { * 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 { sprintf } = __webpack_require__(3330); -const { parse } = __webpack_require__(883); +const { sprintf } = __webpack_require__(341); +const { parse } = __webpack_require__(342); let strings = {}; @@ -24786,8 +25851,10959 @@ module.exports = { }; /***/ }), +/* 341 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ 333: +"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); + +/***/ }), +/* 342 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(343); +var fs = __webpack_require__(204); + +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 }; + + +/***/ }), +/* 343 */ +/***/ (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; + } + }()); +} + + +/***/ }), +/* 344 */ +/***/ (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/. */ + +const Menu = __webpack_require__(345); +const MenuItem = __webpack_require__(347); +const { PrefsHelper } = __webpack_require__(348); +const Services = __webpack_require__(57); +const KeyShortcuts = __webpack_require__(349); +const { ZoomKeys } = __webpack_require__(350); +const EventEmitter = __webpack_require__(96); + +module.exports = { + KeyShortcuts, + Menu, + MenuItem, + PrefsHelper, + Services, + ZoomKeys, + EventEmitter +}; + +/***/ }), +/* 345 */ +/***/ (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/. */ + +const EventEmitter = __webpack_require__(96); + +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({ id = null } = {}) { + 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) { + let doc = toolbox.doc; + let 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. + let 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) { + let doc = parent.ownerDocument; + this.menuitems.forEach(item => { + if (!item.visible) { + return; + } + + if (item.submenu) { + let menupopup = doc.createElement("menupopup"); + item.submenu._createMenuItems(menupopup); + + let menuitem = doc.createElement("menuitem"); + menuitem.setAttribute("label", item.label); + if (!inToolbox()) { + menuitem.textContent = item.label; + } + + let 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") { + let menusep = doc.createElement("menuseparator"); + parent.appendChild(menusep); + } else { + let 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; + +/***/ }), +/* 346 */ +/***/ (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`. + */ + +let 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; + +/***/ }), +/* 347 */ +/***/ (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({ + accesskey = null, + checked = false, + click = () => {}, + disabled = false, + label = "", + id = null, + submenu = null, + type = "normal", + visible = true +} = {}) { + 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; + +/***/ }), +/* 348 */ +/***/ (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/. */ + +const Services = __webpack_require__(57); +const EventEmitter = __webpack_require__(96); + +/** + * 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(prefsRoot = "", prefsBlueprint = {}) { + EventEmitter.decorate(this); + + let cache = new Map(); + + for (let accessorName in prefsBlueprint) { + let [prefType, prefName, prefDefault] = prefsBlueprint[accessorName]; + map(this, cache, accessorName, prefType, prefsRoot, prefName, prefDefault); + } + + let 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) { + let cachedPref = cache.get(prefName); + if (cachedPref !== undefined) { + return cachedPref; + } + let 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, serializer = { 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 (let accessorName in prefsBlueprint) { + let [, prefName] = prefsBlueprint[accessorName]; + 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. + let accessorName = accessorNameForPref(prefName, prefsBlueprint); + if (!(accessorName in self)) { + return; + } + cache.delete(prefName); + self.emit("pref-changed", accessorName, self[accessorName]); + } + }; +} + +exports.PrefsHelper = PrefsHelper; + +/***/ }), +/* 349 */ +/***/ (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/. */ + +const { appinfo } = __webpack_require__(57); +const EventEmitter = __webpack_require__(96); +const isOSX = appinfo.OS === "Darwin"; + +// List of electron keys mapped to DOM API (DOM_VK_*) key code +const 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({ window, 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) { + let modifiers = str.split("+"); + let key = modifiers.pop(); + + let shortcut = { + ctrl: false, + meta: false, + alt: false, + shift: false, + // Set for character keys + key: undefined, + // Set for non-character keys + keyCode: undefined + }; + for (let 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) { + let 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"); + } + let key; + 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. + let 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 (let [key, shortcut] of this.keys) { + 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)) { + let 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; + +/***/ }), +/* 350 */ +/***/ (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) {}; + +/***/ }), +/* 351 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 352 */ +/***/ (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/. */ + +const firefox = __webpack_require__(353); +const chrome = __webpack_require__(354); + +function startDebugging(connTarget) { + if (connTarget.type === "node") { + return startDebuggingNode(connTarget.param); + } + + return startDebuggingTab(connTarget); +} + +async function startDebuggingNode(tabId) { + const clientType = "node"; + const tabs = await chrome.connectNodeClient(); + if (!tabs) { + return {}; + } + + const tab = tabs.find(t => t.id.indexOf(tabId) !== -1); + + if (!tab) { + return {}; + } + + const tabConnection = await chrome.connectNode(tab.tab); + chrome.initPage({ clientType, tabConnection }); + + return { tabs, tab, clientType, client: chrome, tabConnection }; +} + +async function startDebuggingTab(connTarget) { + let clientType = connTarget.type; + const client = clientType === "chrome" ? chrome : firefox; + + const tabs = await client.connectClient(); + + if (!tabs) { + return undefined; + } + + const tab = tabs.find(t => t.id.indexOf(connTarget.param) !== -1); + if (!tab) { + return undefined; + } + + const tabConnection = await client.connectTab(tab.tab); + + client.initPage({ tab, clientType, tabConnection }); + + return { tab, tabConnection }; +} + +module.exports = { + startDebugging, + firefox, + chrome +}; + +/***/ }), +/* 353 */ +/***/ (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/. */ + +const { + DebuggerClient, + DebuggerTransport, + TargetFactory, + WebsocketTransport +} = __webpack_require__(146); + +const { getValue } = __webpack_require__(13); + + +let debuggerClient = null; + +function lookupTabTarget(tab) { + const 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" + }; + }); +} + +async function connectClient() { + const useWebSocket = getValue("firefox.webSocketConnection"); + const firefoxHost = useWebSocket ? getValue("firefox.host") : "localhost"; + const firefoxPort = getValue("firefox.webSocketPort"); + + const socket = new WebSocket(`ws://${firefoxHost}:${firefoxPort}`); + const transport = useWebSocket ? new WebsocketTransport(socket) : new DebuggerTransport(socket); + + debuggerClient = new DebuggerClient(transport); + if (!debuggerClient) { + return []; + } + + try { + await debuggerClient.connect(); + return await getTabs(); + } catch (err) { + console.log(err); + return []; + } +} + +async function connectTab(tab) { + window.addEventListener("beforeunload", () => { + if (tabTarget !== null) { + tabTarget.destroy(); + } + }); + + const tabTarget = await lookupTabTarget(tab); + + const [, threadClient] = await tabTarget.activeTab.attachThread({ + ignoreFrameEnvironment: true + }); + + threadClient.resume(); + return { debuggerClient, threadClient, tabTarget }; +} + +async function getTabs() { + if (!debuggerClient || !debuggerClient.mainRoot) { + return undefined; + } + + const response = await debuggerClient.listTabs(); + return createTabs(response.tabs); +} + +function initPage(options) {} + +module.exports = { + connectClient, + connectTab, + initPage, + getTabs +}; + +/***/ }), +/* 354 */ +/***/ (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/. */ + +const CDP = __webpack_require__(146); +const { getValue } = __webpack_require__(13); +const { networkRequest } = __webpack_require__(355); + +let connection; + +function createTabs(tabs, { type, 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) { + const { host, port, path } = options; + const url = `http://${host}:${port}${path}`; + + networkRequest(url).then(res => callback(null, res.content)).catch(err => callback(err)); +}; + +async function connectClient() { + if (!getValue("chrome.debug")) { + return createTabs([]); + } + + try { + const tabs = await CDP.List({ + port: getValue("chrome.port"), + host: getValue("chrome.host") + }); + + return createTabs(tabs, { + clientType: "chrome", + type: "page" + }); + } catch (e) { + return []; + } +} + +async function connectNodeClient() { + if (!getValue("node.debug")) { + return createTabs([]); + } + + let tabs; + try { + tabs = await CDP.List({ + port: getValue("node.port"), + host: getValue("node.host") + }); + } catch (e) { + return undefined; + } + + return createTabs(tabs, { + clientType: "node", + type: "node" + }); +} + +async function connectTab(tab) { + const tabConnection = await CDP({ tab: tab.webSocketDebuggerUrl }); + return tabConnection; +} + +async function connectNode(tab) { + const tabConnection = await CDP({ tab: tab.webSocketDebuggerUrl }); + + window.addEventListener("beforeunload", () => { + tabConnection.onclose = function disable() {}; + tabConnection.close(); + }); + + return tabConnection; +} + +function initPage({ tab, clientType, tabConnection }) { + const { Runtime, Page } = tabConnection; + + Runtime.enable(); + + if (clientType == "node") { + Runtime.runIfWaitingForDebugger(); + } + + if (clientType == "chrome") { + Page.enable(); + } + + return connection; +} + +module.exports = { + connectClient, + connectNodeClient, + connectNode, + connectTab, + initPage +}; + +/***/ }), +/* 355 */ +/***/ (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__(356); +const workerUtils = __webpack_require__(357); + +module.exports = { + networkRequest, + workerUtils +}; + +/***/ }), +/* 356 */ +/***/ (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; + +/***/ }), +/* 357 */ +/***/ (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) { + 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 +}; + +/***/ }), +/* 358 */ +/***/ (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/. */ + +const classnames = __webpack_require__(6); +__webpack_require__(359); + +module.exports = function (className) { + const root = document.createElement("div"); + root.className = classnames(className); + root.style.setProperty("flex", 1); + return root; +}; + +/***/ }), +/* 359 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 360 */ +/***/ (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 */ + +const { createStore, applyMiddleware } = __webpack_require__(8); +const { waitUntilService } = __webpack_require__(361); +const { log } = __webpack_require__(362); +const { history } = __webpack_require__(363); +const { promise } = __webpack_require__(364); +const { thunk } = __webpack_require__(369); + +/** + * 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 + */ +const configureStore = (opts = {}) => { + const 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 + const devtoolsExt = typeof window === "object" && window.devToolsExtension ? window.devToolsExtension() : f => f; + + return applyMiddleware(...middleware)(devtoolsExt(createStore)); +}; + +module.exports = configureStore; + +/***/ }), +/* 361 */ +/***/ (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. + * } + * } + * ``` + */ +const NAME = exports.NAME = "@@service/waitUntil"; + +function waitUntilService({ dispatch, getState }) { + let pending = []; + + function checkPending(action) { + let readyRequests = []; + let 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 (let request of pending) { + if (request.predicate(action)) { + readyRequests.push(request); + } else { + stillPending.push(request); + } + } + + pending = stillPending; + for (let request of readyRequests) { + request.run(dispatch, getState, action); + } + } + + return next => action => { + if (action.type === NAME) { + pending.push(action); + return null; + } + let result = next(action); + checkPending(action); + return result; + }; +} +exports.waitUntilService = waitUntilService; + +/***/ }), +/* 362 */ +/***/ (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({ dispatch, getState }) { + return next => action => { + const actionText = JSON.stringify(action, null, 2); + const truncatedActionText = `${actionText.slice(0, 1000)}...`; + console.log(`[DISPATCH ${action.type}]`, action, truncatedActionText); + next(action); + }; +} + +exports.log = log; + +/***/ }), +/* 363 */ +/***/ (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/. */ + +const { isDevelopment } = __webpack_require__(13); + +/** + * 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 = (log = []) => ({ dispatch, 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); + }; +}; + +/***/ }), +/* 364 */ +/***/ (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/. */ + +const { defer } = __webpack_require__(203); +const { entries, toObject } = __webpack_require__(365); +const { executeSoon } = __webpack_require__(367); + +const PROMISE = exports.PROMISE = "@@dispatch/promise"; +let seqIdVal = 1; + +function seqIdGen() { + return seqIdVal++; +} + +function promiseMiddleware({ dispatch, getState }) { + return next => action => { + if (!(PROMISE in action)) { + return next(action); + } + + const promiseInst = action[PROMISE]; + const 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. + const 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; + +/***/ }), +/* 365 */ +/***/ (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/. */ + +const co = __webpack_require__(366); + +function asPaused(client, func) { + if (client.state != "paused") { + return co(function* () { + yield client.interrupt(); + let result; + + 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, ...args) { + 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; +} + +let msgId = 1; +function workerTask(worker, method) { + return function (...args) { + return new Promise((resolve, reject) => { + const id = msgId++; + worker.postMessage({ id, method, args }); + + const listener = ({ data: result }) => { + 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; + } + const pairs = []; + for (let 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(([key, value]) => { + 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) { + const obj = {}; + for (let 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(...funcs) { + return (...args) => { + const initialValue = funcs[funcs.length - 1].apply(null, args); + const 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) { + let timeout, _this; + return function (...args) { + _this = this; + if (!timeout) { + timeout = setTimeout(() => { + func.apply(_this, ...args); + timeout = null; + }, ms); + } + }; +} + +module.exports = { + asPaused, + handleError, + promisify, + truncateStr, + endTruncateStr, + workerTask, + zip, + entries, + toObject, + mapObject, + compose, + updateObj, + throttle +}; + +/***/ }), +/* 366 */ +/***/ (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; +} + + +/***/ }), +/* 367 */ +/***/ (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/. */ + +const assert = __webpack_require__(368); + +function reportException(who, exception) { + let msg = `${who} threw an exception: `; + console.error(msg, exception); +} + +function executeSoon(fn) { + setTimeout(fn, 0); +} + +module.exports = { + reportException, + executeSoon, + assert +}; + +/***/ }), +/* 368 */ +/***/ (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; + +/***/ }), +/* 369 */ +/***/ (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 ({ dispatch, getState }) => { + const args = { dispatch, getState }; + + return next => action => { + return typeof action === "function" ? action(makeArgs ? makeArgs(args, getState()) : args) : next(action); + }; + }; +} +exports.thunk = thunk; + +/***/ }), +/* 370 */ +/***/ (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/. */ + +const tabs = __webpack_require__(371); +const config = __webpack_require__(372); + +module.exports = { + tabs, + config +}; + +/***/ }), +/* 371 */ +/***/ (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/. */ + +const constants = __webpack_require__(68); +const Immutable = __webpack_require__(19); +const fromJS = __webpack_require__(205); + +const initialState = fromJS({ + tabs: {}, + selectedTab: null, + filterString: "" +}); + +function update(state = initialState, action) { + switch (action.type) { + case constants.CLEAR_TABS: + return state.setIn(["tabs"], Immutable.Map()).setIn(["selectedTab"], null); + + case constants.ADD_TABS: + const 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: + const 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) { + let id = tab.id; + const 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; + +/***/ }), +/* 372 */ +/***/ (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/. */ + +const constants = __webpack_require__(68); +const fromJS = __webpack_require__(205); +const I = __webpack_require__(19); + +const initialState = fromJS({ + config: I.Map() +}); + +function update(state = initialState, action) { + switch (action.type) { + case constants.SET_VALUE: + return state.setIn(["config", ...action.path.split(".")], action.value); + + case constants.SET_CONFIG: + return state.setIn(["config"], fromJS(action.config)); + } + + return state; +} + +module.exports = update; + +/***/ }), +/* 373 */ +/***/ (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/. */ + +const React = __webpack_require__(0); +const { Component } = React; +const PropTypes = __webpack_require__(2); +const ImPropTypes = __webpack_require__(206); +const { connect } = __webpack_require__(4); +const { bindActionCreators } = __webpack_require__(8); +const { getTabs, getFilterString, getConfig } = __webpack_require__(374); +const { getValue } = __webpack_require__(13); +const LandingPage = React.createFactory(__webpack_require__(378)); + +class LaunchpadApp extends Component { + static get propTypes() { + return { + tabs: ImPropTypes.map.isRequired, + filterString: PropTypes.string, + actions: PropTypes.object, + config: PropTypes.object + }; + } + + render() { + const { + filterString, + actions: { setValue, filterTabs }, config } = this.props; + + 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__(208), dispatch) + }; +} + +module.exports = connect(mapStateToProps, mapDispatchToProps)(LaunchpadApp); + +/***/ }), +/* 374 */ +/***/ (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/. */ + +const { score } = __webpack_require__(375); + +function getTabs(state) { + let tabs = state.tabs.get("tabs"); + let filterString = getFilterString(state); + + if (filterString === "") { + return tabs; + } + + return tabs.map(tab => { + const _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 +}; + +/***/ }), +/* 375 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) { + +(function () { + var Query, defaultPathSeparator, filter, matcher, parseOptions, pathScorer, preparedQueryCache, scorer; + + filter = __webpack_require__(376); + + matcher = __webpack_require__(377); + + scorer = __webpack_require__(97); + + pathScorer = __webpack_require__(147); + + Query = __webpack_require__(207); + + 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(undefined); +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(145))) + +/***/ }), +/* 376 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +(function () { + var Query, pathScorer, pluckCandidates, scorer, sortCandidates; + + scorer = __webpack_require__(97); + + pathScorer = __webpack_require__(147); + + Query = __webpack_require__(207); + + 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(undefined); + +/***/ }), +/* 377 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +(function () { + var basenameMatch, computeMatch, isMatch, isWordStart, match, mergeMatches, scoreAcronyms, scoreCharacter, scoreConsecutives, _ref; + + _ref = __webpack_require__(97), 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(undefined); + +/***/ }), +/* 378 */ +/***/ (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/. */ + +const React = __webpack_require__(0); + +__webpack_require__(379); +const { Component } = React; +const PropTypes = __webpack_require__(2); +const dom = __webpack_require__(3); +const ImPropTypes = __webpack_require__(206); +const configMap = __webpack_require__(68).sidePanelItems; +const Tabs = React.createFactory(__webpack_require__(380)); +const Sidebar = React.createFactory(__webpack_require__(382)); +const Settings = React.createFactory(__webpack_require__(387)); + +const 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"), "."); +} + +class LandingPage extends Component { + static get propTypes() { + return { + tabs: ImPropTypes.map.isRequired, + supportsFirefox: PropTypes.bool.isRequired, + supportsChrome: PropTypes.bool.isRequired, + title: PropTypes.string.isRequired, + filterString: PropTypes.string, + onFilterChange: PropTypes.func.isRequired, + onTabClick: PropTypes.func.isRequired, + config: PropTypes.object.isRequired, + setValue: PropTypes.func.isRequired + }; + } + + constructor(props) { + super(props); + + this.state = { + selectedPane: configMap.Firefox.name, + firefoxConnected: false, + chromeConnected: false + }; + + this.onFilterChange = this.onFilterChange.bind(this); + this.onSideBarItemClick = this.onSideBarItemClick.bind(this); + this.renderLaunchOptions = this.renderLaunchOptions.bind(this); + this.renderLaunchButton = this.renderLaunchButton.bind(this); + this.renderExperimentalMessage = this.renderExperimentalMessage.bind(this); + this.launchBrowser = this.launchBrowser.bind(this); + this.renderEmptyPanel = this.renderEmptyPanel.bind(this); + this.renderSettings = this.renderSettings.bind(this); + this.renderFilter = this.renderFilter.bind(this); + this.renderPanel = this.renderPanel.bind(this); + } + + 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() { + const { selectedPane } = this.state; + const { name, isUnderConstruction } = configMap[selectedPane]; + + const isConnected = name === configMap.Firefox.name ? this.state.firefoxConnected : this.state.chromeConnected; + const 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); + } + + const 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) : null); + } + + renderExperimentalMessage(browserName) { + const underConstructionMessage = "Debugging is experimental and certain features won't work (i.e, seeing variables, attaching breakpoints)"; // eslint-disable-line max-len + + return dom.div({ className: "under-construction" }, dom.div({ className: "under-construction-message" }, dom.p({}, underConstructionMessage), dom.img({ src: "/assets/under_construction.png" }), dom.a({ + className: "github-link", + 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() { + const { config, setValue } = this.props; + + return dom.div({}, dom.header({}, dom.h1({}, configMap.Settings.name)), Settings({ config, setValue })); + } + + renderFilter() { + const { selectedPane } = this.state; + + const { tabs, filterString = "" } = this.props; + + const { clientType, paramName } = configMap[selectedPane]; + + const 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() { + const { onTabClick, tabs } = this.props; + const { selectedPane } = this.state; + + const { name, clientType, paramName } = configMap[selectedPane]; + + const clientTargets = getTabsByClientType(tabs, clientType); + const tabsDetected = clientTargets && clientTargets.count() > 0; + const targets = clientTargets.filter(t => !t.get("filteredOut")); + + const 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() { + const { supportsFirefox, supportsChrome, title } = this.props; + const { selectedPane } = this.state; + const { onSideBarItemClick } = this; + + const { name, docsUrlPart } = configMap[selectedPane]; + + return dom.div({ + className: "landing-page" + }, Sidebar({ + supportsFirefox, + supportsChrome, + title, + selectedPane, + onSideBarItemClick + }), dom.main({ className: "panel" }, this.renderPanel(), firstTimeMessage(name, docsUrlPart))); + } +} + +module.exports = LandingPage; + +/***/ }), +/* 379 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 380 */ +/***/ (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/. */ + +const React = __webpack_require__(0); + +__webpack_require__(381); +const { Component } = React; +const dom = __webpack_require__(3); +const PropTypes = __webpack_require__(2); +const classnames = __webpack_require__(6); + +function getTabURL(tab, paramName) { + const tabID = tab.get("id"); + return `/?react_perf&${paramName}=${tabID}`; +} + +class Tabs extends Component { + static get propTypes() { + return { + targets: PropTypes.object.isRequired, + paramName: PropTypes.string.isRequired, + onTabClick: PropTypes.func.isRequired + }; + } + + constructor(props) { + super(props); + this.onTabClick = this.onTabClick.bind(this); + } + + onTabClick(tab, paramName) { + this.props.onTabClick(getTabURL(tab, paramName)); + } + + render() { + const { targets, paramName } = this.props; + + if (!targets || targets.count() == 0) { + return dom.div({}, ""); + } + + let 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; + +/***/ }), +/* 381 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 382 */ +/***/ (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/. */ + +const React = __webpack_require__(0); +__webpack_require__(383); +const { Component } = React; +const dom = __webpack_require__(3); +const PropTypes = __webpack_require__(2); +const classnames = __webpack_require__(6); +const Svg = __webpack_require__(384); + +class Sidebar extends Component { + static get propTypes() { + return { + supportsFirefox: PropTypes.bool.isRequired, + supportsChrome: PropTypes.bool.isRequired, + title: PropTypes.string.isRequired, + selectedPane: PropTypes.string.isRequired, + onSideBarItemClick: PropTypes.func.isRequired + }; + } + + constructor(props) { + super(props); + this.renderTitle = this.renderTitle.bind(this); + this.renderItem = this.renderItem.bind(this); + } + + renderTitle(title) { + return dom.div({ className: "title-wrapper" }, dom.h1({}, title), dom.div({ className: "launchpad-container" }, Svg({ name: "rocket" }), 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() { + let 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; + +/***/ }), +/* 383 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 384 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +const React = __webpack_require__(0); +const { default: InlineSVG } = __webpack_require__(98); +const { isDevelopment } = __webpack_require__(13); + +const svg = { + rocket: __webpack_require__(386) +}; + +function Svg({ name, className, onClick, "aria-label": ariaLabel }) { + className = `${name} ${className || ""}`; + + const props = { + className, + onClick, + ["aria-label"]: ariaLabel, + src: svg[name] + }; + + return React.createElement(InlineSVG, props); +} + +Svg.displayName = "Svg"; + +module.exports = Svg; + +/***/ }), +/* 385 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.convertReactSVGDOMProperty = convertReactSVGDOMProperty; +exports.startsWith = startsWith; +exports.serializeAttrs = serializeAttrs; +exports.getSVGFromSource = getSVGFromSource; +exports.extractSVGProps = extractSVGProps; +// Transform DOM prop/attr names applicable to `` element but react-limited + +function convertReactSVGDOMProperty(str) { + return str.replace(/[-|:]([a-z])/g, function (g) { + return g[1].toUpperCase(); + }); +} + +function startsWith(str, substring) { + return str.indexOf(substring) === 0; +} + +var DataPropPrefix = 'data-'; +// Serialize `Attr` objects in `NamedNodeMap` +function serializeAttrs(map) { + var ret = {}; + for (var prop, i = 0; i < map.length; i++) { + var key = map[i].name; + if (!startsWith(key, DataPropPrefix)) { + prop = convertReactSVGDOMProperty(key); + } + ret[prop] = map[i].value; + } + return ret; +} + +function getSVGFromSource(src) { + var svgContainer = document.createElement('div'); + svgContainer.innerHTML = src; + var svg = svgContainer.firstElementChild; + svg.remove(); // deref from parent element + return svg; +} + +// get element props +function extractSVGProps(src) { + var map = getSVGFromSource(src).attributes; + return map.length > 0 ? serializeAttrs(map) : null; +} + +/***/ }), +/* 386 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 387 */ +/***/ (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/. */ + +const React = __webpack_require__(0); +const { Component } = React; +const dom = __webpack_require__(3); +const PropTypes = __webpack_require__(2); +const { showMenu, buildMenu } = __webpack_require__(45); + +class Settings extends Component { + static get propTypes() { + return { + config: PropTypes.object.isRequired, + setValue: PropTypes.func.isRequired + }; + } + + constructor(props) { + super(props); + this.onConfigContextMenu = this.onConfigContextMenu.bind(this); + this.onInputHandler = this.onInputHandler.bind(this); + this.renderConfig = this.renderConfig.bind(this); + this.renderFeatures = this.renderFeatures.bind(this); + } + + onConfigContextMenu(event, key) { + event.preventDefault(); + + const { setValue, config } = this.props; + + const setConfig = (path, value) => { + setValue(path, value); + }; + + const ltrMenuItem = { + id: "node-menu-ltr", + label: "ltr", + disabled: config[key] === "ltr", + click: () => setConfig(key, "ltr") + }; + + const rtlMenuItem = { + id: "node-menu-rtl", + label: "rtl", + disabled: config[key] === "rtl", + click: () => setConfig(key, "rtl") + }; + + const lightMenuItem = { + id: "node-menu-light", + label: "light", + disabled: config[key] === "light", + click: () => setConfig(key, "light") + }; + + const darkMenuItem = { + id: "node-menu-dark", + label: "dark", + disabled: config[key] === "dark", + click: () => setConfig(key, "dark") + }; + + const firebugMenuItem = { + id: "node-menu-firebug", + label: "firebug", + disabled: config[key] === "firebug", + click: () => setConfig(key, "firebug") + }; + + const items = { + "dir": [{ item: ltrMenuItem }, { item: rtlMenuItem }], + "theme": [{ item: lightMenuItem }, { item: darkMenuItem }, { item: firebugMenuItem }] + }; + showMenu(event, buildMenu(items[key])); + } + + onInputHandler(e, path) { + const { setValue } = this.props; + setValue(path, e.target.checked); + } + + renderConfig(config) { + const 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() { + const { config } = this.props; + + 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; + +/***/ }), +/* 388 */ +/***/ (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 + */ + +const constants = __webpack_require__(68); + +/** + * @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 ({ getState, 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({ 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 +}; + +/***/ }), +/* 389 */ +/***/ (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/. */ + +const { setConfig: _setConfig } = __webpack_require__(13); +const { updateTheme, updateDir } = __webpack_require__(60); + +/** + * Redux actions for the pause state + * @module actions/config + */ + +const constants = __webpack_require__(68); + + +/** + * @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 async function ({ dispatch }) { + const response = await fetch("/setconfig", { + method: "post", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ path, value }) + }); + + const config = await response.json(); + _setConfig(config); + updateTheme(); + updateDir(); + + dispatch({ + type: constants.SET_VALUE, + path, + value + }); + }; +} + +/** + * @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 +}; + +/***/ }), +/* 390 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.onConnect = undefined; + +var _firefox = __webpack_require__(69); + +var firefox = _interopRequireWildcard(_firefox); + +var _chrome = __webpack_require__(411); + +var chrome = _interopRequireWildcard(_chrome); + +var _prefs = __webpack_require__(10); + +var _dbg = __webpack_require__(414); + +var _devtoolsConfig = __webpack_require__(13); + +var _bootstrap = __webpack_require__(221); + +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 . */ + +function loadFromPrefs(actions) { + const { pauseOnExceptions, ignoreCaughtExceptions } = _prefs.prefs; + if (pauseOnExceptions || ignoreCaughtExceptions) { + return actions.pauseOnExceptions(pauseOnExceptions, ignoreCaughtExceptions); + } +} + +function getClient(connection) { + const { tab: { clientType } } = connection; + return clientType == "firefox" ? firefox : chrome; +} + +async function onConnect(connection, { services, toolboxActions }) { + // NOTE: the landing page does not connect to a JS process + if (!connection) { + return; + } + + const client = getClient(connection); + const commands = client.clientCommands; + const { store, actions, selectors } = (0, _bootstrap.bootstrapStore)(commands, { + services, + toolboxActions + }); + + (0, _bootstrap.bootstrapWorkers)(); + await client.onConnect(connection, actions); + await loadFromPrefs(actions); + + if (!(0, _devtoolsConfig.isFirefoxPanel)()) { + (0, _dbg.setupHelper)({ + store, + actions, + selectors, + client: client.clientCommands + }); + } + + (0, _bootstrap.bootstrapApp)(connection, { store, actions }); + + return { store, actions, selectors, client: commands }; +} + +exports.onConnect = onConnect; + +/***/ }), +/* 391 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.clientCommands = exports.setupCommands = undefined; + +var _breakpoint = __webpack_require__(41); + +var _create = __webpack_require__(219); + +/* 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 . */ + +let bpClients; +let threadClient; +let tabTarget; +let debuggerClient; +let supportsWasm; + +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 rewind() { + return new Promise(resolve => { + threadClient.rewind(resolve); + }); +} + +function reverseStepIn() { + return new Promise(resolve => { + threadClient.reverseStepIn(resolve); + }); +} + +function reverseStepOver() { + return new Promise(resolve => { + threadClient.reverseStepOver(resolve); + }); +} + +function reverseStepOut() { + return new Promise(resolve => { + threadClient.reverseStepOut(resolve); + }); +} + +function breakOnNext() { + return threadClient.breakOnNext(); +} + +function sourceContents(sourceId) { + const sourceClient = threadClient.source({ actor: sourceId }); + return sourceClient.source(); +} + +function getBreakpointByLocation(location) { + const id = (0, _breakpoint.makePendingLocationId)(location); + const bpClient = bpClients[id]; + + if (bpClient) { + const { actor, url, line, column, condition } = bpClient.location; + return { + id: bpClient.actor, + condition, + actualLocation: { + line, + column, + sourceId: actor, + sourceUrl: url + } + }; + } + return null; +} + +function setBreakpoint(location, condition, noSliding) { + const sourceClient = threadClient.source({ actor: location.sourceId }); + + return sourceClient.setBreakpoint({ + line: location.line, + column: location.column, + condition, + noSliding + }).then(([{ actualLocation }, bpClient]) => { + actualLocation = (0, _create.createBreakpointLocation)(location, actualLocation); + const id = (0, _breakpoint.makePendingLocationId)(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 { + const id = (0, _breakpoint.makePendingLocationId)(generatedLocation); + const 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) { + const bpClient = bpClients[breakpointId]; + delete bpClients[breakpointId]; + + return bpClient.setCondition(threadClient, condition, noSliding).then(_bpClient => { + bpClients[breakpointId] = _bpClient; + return { id: breakpointId }; + }); +} + +function evaluateInFrame(frameId, script) { + return evaluate(script, { frameId }); +} + +function evaluate(script, { frameId } = {}) { + const params = frameId ? { frameActor: frameId } : {}; + if (!tabTarget || !tabTarget.activeConsole || !script) { + 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; + } + + const consoleActor = tabTarget.form.consoleActor; + const 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) { + const objClient = threadClient.pauseGrip(grip); + + return objClient.getPrototypeAndProperties().then(resp => { + const { ownProperties, safeGetterValues } = resp; + for (const name in safeGetterValues) { + const { enumerable, writable, getterValue } = safeGetterValues[name]; + ownProperties[name] = { enumerable, writable, value: getterValue }; + } + return resp; + }); +} + +async function getFrameScopes(frame) { + if (frame.scope) { + return frame.scope; + } + + return threadClient.getEnvironment(frame.id); +} + +function pauseOnExceptions(shouldPauseOnExceptions, shouldIgnoreCaughtExceptions) { + return threadClient.pauseOnExceptions(shouldPauseOnExceptions, shouldIgnoreCaughtExceptions); +} + +function prettyPrint(sourceId, indentSize) { + const sourceClient = threadClient.source({ actor: sourceId }); + return sourceClient.prettyPrint(indentSize); +} + +async function blackBox(sourceId, isBlackBoxed) { + const sourceClient = threadClient.source({ actor: sourceId }); + if (isBlackBoxed) { + await sourceClient.unblackBox(); + } else { + await sourceClient.blackBox(); + } + + return { isBlackBoxed: !isBlackBoxed }; +} + +function disablePrettyPrint(sourceId) { + const 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); +} + +async function fetchSources() { + const { sources } = await threadClient.getSources(); + return sources.map(source => (0, _create.createSource)(source, { supportsWasm })); +} + +async function fetchWorkers() { + // NOTE: The Worker and Browser Content toolboxes do not have a parent + // with a listWorkers function + // TODO: there is a listWorkers property, but it is not a function on the + // parent. Investigate what it is + if (!threadClient._parent || typeof threadClient._parent.listWorkers != "function") { + return Promise.resolve({ workers: [] }); + } + + return threadClient._parent.listWorkers(); +} + +const clientCommands = { + blackBox, + interrupt, + eventListeners, + pauseGrip, + resume, + stepIn, + stepOut, + stepOver, + rewind, + reverseStepIn, + reverseStepOut, + reverseStepOver, + breakOnNext, + sourceContents, + getBreakpointByLocation, + setBreakpoint, + removeBreakpoint, + setBreakpointCondition, + evaluate, + evaluateInFrame, + debuggeeCommand, + navigate, + reload, + getProperties, + getFrameScopes, + pauseOnExceptions, + prettyPrint, + disablePrettyPrint, + fetchSources, + fetchWorkers +}; + +exports.setupCommands = setupCommands; +exports.clientCommands = clientCommands; + +/***/ }), +/* 392 */ +/***/ (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/. */ + +const EventEmitter = __webpack_require__(99); + +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({ id = null } = {}) { + 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) { + let doc = toolbox.doc; + let 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. + let 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) { + let doc = parent.ownerDocument; + this.menuitems.forEach(item => { + if (!item.visible) { + return; + } + + if (item.submenu) { + let menupopup = doc.createElement("menupopup"); + item.submenu._createMenuItems(menupopup); + + let menuitem = doc.createElement("menuitem"); + menuitem.setAttribute("label", item.label); + if (!inToolbox()) { + menuitem.textContent = item.label; + } + + let 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") { + let menusep = doc.createElement("menuseparator"); + parent.appendChild(menusep); + } else { + let 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; + +/***/ }), +/* 393 */ +/***/ (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`. + */ + +let 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; + +/***/ }), +/* 394 */ +/***/ (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({ + accesskey = null, + checked = false, + click = () => {}, + disabled = false, + label = "", + id = null, + submenu = null, + type = "normal", + visible = true +} = {}) { + 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; + +/***/ }), +/* 395 */ +/***/ (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/. */ + +const Services = __webpack_require__(57); +const EventEmitter = __webpack_require__(99); + +/** + * 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(prefsRoot = "", prefsBlueprint = {}) { + EventEmitter.decorate(this); + + let cache = new Map(); + + for (let accessorName in prefsBlueprint) { + let [prefType, prefName, prefDefault] = prefsBlueprint[accessorName]; + map(this, cache, accessorName, prefType, prefsRoot, prefName, prefDefault); + } + + let 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) { + let cachedPref = cache.get(prefName); + if (cachedPref !== undefined) { + return cachedPref; + } + let 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, serializer = { 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 (let accessorName in prefsBlueprint) { + let [, prefName] = prefsBlueprint[accessorName]; + 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. + let accessorName = accessorNameForPref(prefName, prefsBlueprint); + if (!(accessorName in self)) { + return; + } + cache.delete(prefName); + self.emit("pref-changed", accessorName, self[accessorName]); + } + }; +} + +exports.PrefsHelper = PrefsHelper; + +/***/ }), +/* 396 */ +/***/ (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/. */ + +const { appinfo } = __webpack_require__(57); +const EventEmitter = __webpack_require__(99); +const isOSX = appinfo.OS === "Darwin"; + +// List of electron keys mapped to DOM API (DOM_VK_*) key code +const 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({ window, 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) { + let modifiers = str.split("+"); + let key = modifiers.pop(); + + let shortcut = { + ctrl: false, + meta: false, + alt: false, + shift: false, + // Set for character keys + key: undefined, + // Set for non-character keys + keyCode: undefined + }; + for (let 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) { + let 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"); + } + let key; + 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. + let 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 (let [key, shortcut] of this.keys) { + 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)) { + let 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; + +/***/ }), +/* 397 */ +/***/ (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) {}; + +/***/ }), +/* 398 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isMinified = isMinified; + + +// Used to detect minification for automatic pretty printing +const SAMPLE_SIZE = 50; /* 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 . */ + +const INDENT_COUNT_THRESHOLD = 5; +const CHARACTER_LIMIT = 250; +const _minifiedCache = new Map(); + +function isMinified(source) { + if (_minifiedCache.has(source.get("id"))) { + return _minifiedCache.get(source.get("id")); + } + + let text = source.get("text"); + if (!text) { + return false; + } + + let lineEndIndex = 0; + let lineStartIndex = 0; + let lines = 0; + let indentCount = 0; + let overCharLimit = false; + + // Strip comments. + text = text.replace(/\/\*[\S\s]*?\*\/|\/\/(.+|\n)/g, ""); + + while (lines++ < SAMPLE_SIZE) { + lineEndIndex = text.indexOf("\n", lineStartIndex); + if (lineEndIndex == -1) { + break; + } + if (/^\s+/.test(text.slice(lineStartIndex, lineEndIndex))) { + indentCount++; + } + // For files with no indents but are not minified. + if (lineEndIndex - lineStartIndex > CHARACTER_LIMIT) { + overCharLimit = true; + break; + } + lineStartIndex = lineEndIndex + 1; + } + + const minified = indentCount / lines * 100 < INDENT_COUNT_THRESHOLD || overCharLimit; + + _minifiedCache.set(source.id, minified); + return minified; +} + +/***/ }), +/* 399 */ +/***/ (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__(73)(module), __webpack_require__(40))) + +/***/ }), +/* 400 */ +/***/ (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; + } +}; + + +/***/ }), +/* 401 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.decode = exports.parse = __webpack_require__(402); +exports.encode = exports.stringify = __webpack_require__(403); + + +/***/ }), +/* 402 */ +/***/ (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]'; +}; + + +/***/ }), +/* 403 */ +/***/ (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; +}; + + +/***/ }), +/* 404 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _immutable = __webpack_require__(19); + +var I = _interopRequireWildcard(_immutable); + +var _lodash = __webpack_require__(11); + +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 +/* 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 . */ + +/** + * 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) { + const hasLength = hasOwnProperty(value, "length"); + const length = value.length; + + if (hasLength) { + value.length = `${value.length}`; + } + + let 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. + const 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; + +/***/ }), +/* 405 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getBreakpointAtLocation = getBreakpointAtLocation; + +var _sources = __webpack_require__(32); + +var _breakpoints = __webpack_require__(101); + +var _devtoolsSourceMap = __webpack_require__(12); + +function isGenerated(selectedSource) { + const sourceId = selectedSource.get("id"); + return (0, _devtoolsSourceMap.isGeneratedId)(sourceId); +} /* 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 . */ + +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) { + const breakpoints = (0, _breakpoints.getBreakpoints)(state); + + return breakpoints.filter(bp => { + const location = getLocation(bp, selectedSource); + return location.sourceId === selectedSource.get("id"); + }); +} + +function findBreakpointAtLocation(breakpoints, selectedSource, { line, column }) { + return breakpoints.find(breakpoint => { + const location = getLocation(breakpoint, selectedSource); + const 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) { + const selectedSource = (0, _sources.getSelectedSource)(state); + const breakpoints = getBreakpointsForSource(state, selectedSource); + + return findBreakpointAtLocation(breakpoints, selectedSource, location); +} + +/***/ }), +/* 406 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getVisibleBreakpoints = getVisibleBreakpoints; + +var _breakpoints = __webpack_require__(101); + +var _sources = __webpack_require__(32); + +var _devtoolsSourceMap = __webpack_require__(12); + +function getLocation(breakpoint, isGeneratedSource) { + return isGeneratedSource ? breakpoint.generatedLocation || breakpoint.location : breakpoint.location; +} /* 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 . */ + +function formatBreakpoint(breakpoint, selectedSource) { + const { condition, loading, disabled, hidden } = breakpoint; + const sourceId = selectedSource.get("id"); + const isGeneratedSource = (0, _devtoolsSourceMap.isGeneratedId)(sourceId); + + return { + location: getLocation(breakpoint, isGeneratedSource), + condition, + loading, + disabled, + hidden + }; +} + +function isVisible(breakpoint, selectedSource) { + const sourceId = selectedSource.get("id"); + const isGeneratedSource = (0, _devtoolsSourceMap.isGeneratedId)(sourceId); + + const location = getLocation(breakpoint, isGeneratedSource); + return location.sourceId === sourceId; +} +/* + * Finds the breakpoints, which appear in the selected source. + * + * This + */ +function getVisibleBreakpoints(state) { + const selectedSource = (0, _sources.getSelectedSource)(state); + if (!selectedSource) { + return null; + } + + return (0, _breakpoints.getBreakpoints)(state).filter(bp => isVisible(bp, selectedSource)).map(bp => formatBreakpoint(bp, selectedSource)); +} + +/***/ }), +/* 407 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isSelectedFrameVisible = isSelectedFrameVisible; + +var _pause = __webpack_require__(74); + +var _sources = __webpack_require__(32); + +/* + * Checks to if the selected frame's source is currently + * selected. + */ +/* 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 . */ + +function isSelectedFrameVisible(state) { + const selectedLocation = (0, _sources.getSelectedLocation)(state); + const selectedFrame = (0, _pause.getSelectedFrame)(state); + + return selectedFrame && selectedLocation && selectedFrame.location.sourceId == selectedLocation.sourceId; +} + +/***/ }), +/* 408 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getCallStackFrames = 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 . */ + +exports.formatCallStackFrames = formatCallStackFrames; + +var _sources = __webpack_require__(32); + +var _pause = __webpack_require__(74); + +var _frame = __webpack_require__(58); + +var _devtoolsSourceMap = __webpack_require__(12); + +var _lodash = __webpack_require__(11); + +var _reselect = __webpack_require__(48); + +function getLocation(frame, isGeneratedSource) { + return isGeneratedSource ? frame.generatedLocation || frame.location : frame.location; +} + +function getSourceForFrame(sources, frame, isGeneratedSource) { + const sourceId = getLocation(frame, isGeneratedSource).sourceId; + return (0, _sources.getSourceInSources)(sources, sourceId); +} + +function appendSource(sources, frame, selectedSource) { + const isGeneratedSource = selectedSource && !(0, _devtoolsSourceMap.isOriginalId)(selectedSource.get("id")); + return _extends({}, frame, { + location: getLocation(frame, isGeneratedSource), + source: getSourceForFrame(sources, frame, isGeneratedSource).toJS() + }); +} + +function formatCallStackFrames(frames, sources, selectedSource) { + if (!frames) { + return null; + } + + return frames.filter(frame => getSourceForFrame(sources, frame)).map(frame => appendSource(sources, frame, selectedSource)).filter(frame => !(0, _lodash.get)(frame, "source.isBlackBoxed")).map(_frame.annotateFrame); +} + +const getCallStackFrames = exports.getCallStackFrames = (0, _reselect.createSelector)(_sources.getSelectedSource, _sources.getSources, _pause.getFrames, (selectedSource, sources, frames) => formatCallStackFrames(frames, sources, selectedSource)); + +/***/ }), +/* 409 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getVisibleSelectedFrame = undefined; + +var _sources = __webpack_require__(32); + +var _pause = __webpack_require__(74); + +var _devtoolsSourceMap = __webpack_require__(12); + +var _reselect = __webpack_require__(48); + +/* 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 . */ + +function getLocation(frame, location) { + if (!location) { + return frame.location; + } + + return !(0, _devtoolsSourceMap.isOriginalId)(location.sourceId) ? frame.generatedLocation || frame.location : frame.location; +} + +const getVisibleSelectedFrame = exports.getVisibleSelectedFrame = (0, _reselect.createSelector)(_sources.getSelectedLocation, _pause.getSelectedFrame, (selectedLocation, selectedFrame) => { + if (!selectedFrame) { + return null; + } + + const { id } = selectedFrame; + + return { + id, + location: getLocation(selectedFrame, selectedLocation) + }; +}); + +/***/ }), +/* 410 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.clientEvents = exports.setupEvents = undefined; + +var _create = __webpack_require__(219); + +var _sourceQueue = __webpack_require__(156); + +var _sourceQueue2 = _interopRequireDefault(_sourceQueue); + +var _prefs = __webpack_require__(10); + +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 . */ + +const CALL_STACK_PAGE_SIZE = 1000; + +let threadClient; +let actions; +let supportsWasm; +let isInterrupted; + +function setupEvents(dependencies) { + threadClient = dependencies.threadClient; + actions = dependencies.actions; + supportsWasm = dependencies.supportsWasm; + _sourceQueue2.default.initialize({ actions, supportsWasm, createSource: _create.createSource }); + + if (threadClient) { + Object.keys(clientEvents).forEach(eventName => { + threadClient.addListener(eventName, clientEvents[eventName]); + }); + + if (threadClient._parent) { + threadClient._parent.addListener("workerListChanged", workerListChanged); + } + } +} + +async function paused(_, 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. + const { why } = packet; + if (why.type === "interrupted" && !packet.why.onNext) { + isInterrupted = true; + return; + } + + // Eagerly fetch the frames + const response = await threadClient.getFrames(0, CALL_STACK_PAGE_SIZE); + + if (why.type != "alreadyPaused") { + const pause = (0, _create.createPause)(packet, response); + await _sourceQueue2.default.flush(); + actions.paused(pause); + } +} + +function resumed(_, packet) { + // NOTE: the client suppresses resumed events while interrupted + // to prevent unintentional behavior. + // see [client docs](../README.md#interrupted) for more information. + if (isInterrupted) { + isInterrupted = false; + return; + } + + actions.resumed(packet); +} + +function newSource(_, { source }) { + _sourceQueue2.default.queue(source); + + if (_prefs.features.eventListeners) { + actions.fetchEventListeners(); + } +} + +function workerListChanged() { + actions.updateWorkers(); +} + +const clientEvents = { + paused, + resumed, + newSource +}; + +exports.setupEvents = setupEvents; +exports.clientEvents = clientEvents; + +/***/ }), +/* 411 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.clientEvents = exports.clientCommands = undefined; +exports.onConnect = onConnect; + +var _commands = __webpack_require__(412); + +var _events = __webpack_require__(413); + +/* 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 . */ + +async function onConnect(connection, actions) { + const { tabConnection, connTarget: { type } } = connection; + const { Debugger, Runtime, Page } = tabConnection; + + 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 {}; +} + +exports.clientCommands = _commands.clientCommands; +exports.clientEvents = _events.clientEvents; + +/***/ }), +/* 412 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.clientCommands = exports.setupCommands = undefined; + +var _create = __webpack_require__(220); + +let debuggerAgent; /* 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 . */ + +let runtimeAgent; +let pageAgent; + +function setupCommands({ Debugger, Runtime, 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" }); + } + const state = shouldIgnoreCaughtExceptions ? "uncaught" : "all"; + return debuggerAgent.setPauseOnExceptions({ state }); +} + +function breakOnNext() { + return debuggerAgent.pause(); +} + +function sourceContents(sourceId) { + return debuggerAgent.getScriptSource({ scriptId: sourceId }).then(({ scriptSource }) => ({ + source: scriptSource, + contentType: null + })); +} + +async function setBreakpoint(location, condition) { + const { + breakpointId, + serverLocation + } = await debuggerAgent.setBreakpoint({ + location: (0, _create.toServerLocation)(location), + columnNumber: location.column + }); + + const actualLocation = (0, _create.fromServerLocation)(serverLocation) || location; + + return { + id: breakpointId, + actualLocation: actualLocation + }; +} + +function removeBreakpoint(breakpointId) { + return debuggerAgent.removeBreakpoint({ breakpointId }); +} + +async function getProperties(object) { + const { result } = await runtimeAgent.getProperties({ + objectId: object.objectId + }); + + const loadedObjects = result.map(_create.createLoadedObject); + + return { loadedObjects }; +} + +function evaluate(script) { + return runtimeAgent.evaluate({ expression: script }); +} + +function debuggeeCommand(script) { + evaluate(script); + return Promise.resolve(); +} + +function navigate(url) { + return pageAgent.navigate({ url }); +} + +const clientCommands = { + resume, + stepIn, + stepOut, + stepOver, + pauseOnExceptions, + breakOnNext, + sourceContents, + setBreakpoint, + removeBreakpoint, + evaluate, + debuggeeCommand, + navigate, + getProperties +}; + +exports.setupCommands = setupCommands; +exports.clientCommands = clientCommands; + +/***/ }), +/* 413 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.clientEvents = exports.pageEvents = exports.setupEvents = 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 . */ + +var _create = __webpack_require__(220); + +let actions; +let pageAgent; +let clientType; +let runtimeAgent; + +function setupEvents(dependencies) { + actions = dependencies.actions; + pageAgent = dependencies.Page; + clientType = dependencies.clientType; + runtimeAgent = dependencies.Runtime; +} + +// Debugger Events +function scriptParsed({ + scriptId, + url, + startLine, + startColumn, + endLine, + endColumn, + executionContextId, + hash, + isContentScript, + isInternalScript, + isLiveEdit, + sourceMapURL, + hasSourceURL, + deprecatedCommentWasUsed +}) { + if (isContentScript) { + return; + } + + if (clientType == "node") { + sourceMapURL = undefined; + } + + actions.newSource({ + id: scriptId, + url, + sourceMapURL, + isPrettyPrinted: false + }); +} + +function scriptFailedToParse() {} + +async function paused({ + callFrames, + reason, + data, + hitBreakpoints, + asyncStackTrace +}) { + const frames = callFrames.map(_create.createFrame); + const frame = frames[0]; + const why = _extends({ type: reason }, data); + + const objectId = frame.scopeChain[0].object.objectId; + const { result } = await runtimeAgent.getProperties({ + objectId + }); + + const loadedObjects = result.map(_create.createLoadedObject); + + if (clientType == "chrome") { + pageAgent.configureOverlay({ message: "Paused in debugger.html" }); + } + + await actions.paused({ frame, why, frames, loadedObjects }); +} + +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() {} + +const clientEvents = { + scriptParsed, + scriptFailedToParse, + paused, + resumed, + globalObjectCleared +}; + +const pageEvents = { + frameNavigated, + frameStartedLoading, + domContentEventFired, + loadEventFired, + frameStoppedLoading +}; + +exports.setupEvents = setupEvents; +exports.pageEvents = pageEvents; +exports.clientEvents = clientEvents; + +/***/ }), +/* 414 */ +/***/ (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.setupHelper = setupHelper; + +var _redux = __webpack_require__(8); + +var _timings = __webpack_require__(415); + +var timings = _interopRequireWildcard(_timings); + +var _prefs = __webpack_require__(10); + +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 findSource(dbg, url) { + const sources = dbg.selectors.getSources(); + const source = sources.find(s => (s.get("url") || "").includes(url)); + + if (!source) { + return; + } + + return source.toJS(); +} + +function sendPacket(dbg, packet, callback) { + dbg.connection.tabConnection.debuggerClient.request(packet).then(callback || console.log); +} + +function evaluate(dbg, expression, callback) { + dbg.client.evaluate(expression).then(callback || console.log); +} + +function bindSelectors(obj) { + return Object.keys(obj.selectors).reduce((bound, selector) => { + bound[selector] = (a, b, c) => obj.selectors[selector](obj.store.getState(), a, b, c); + return bound; + }, {}); +} + +function getCM() { + const cm = document.querySelector(".CodeMirror"); + return cm && cm.CodeMirror; +} + +function setupHelper(obj) { + const selectors = bindSelectors(obj); + const actions = (0, _redux.bindActionCreators)(obj.actions, obj.store.dispatch); + const dbg = _extends({}, obj, { + selectors, + actions, + prefs: _prefs.prefs, + features: _prefs.features, + timings, + getCM, + helpers: { + findSource: url => findSource(dbg, url), + evaluate: (expression, cbk) => evaluate(dbg, expression, cbk), + sendPacket: (packet, cbk) => sendPacket(dbg, packet, cbk) + } + }); + + window.dbg = dbg; + + console.group("Development Notes"); + const baseUrl = "https://devtools-html.github.io/debugger.html"; + const localDevelopmentUrl = `${baseUrl}/docs/dbg.html`; + console.log("Debugging Tips", localDevelopmentUrl); + console.log("dbg", window.dbg); + console.groupEnd(); +} + +/***/ }), +/* 415 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getAsyncTimes = getAsyncTimes; +exports.steppingTimings = steppingTimings; + +var _lodash = __webpack_require__(11); + +function getAsyncTimes(name) { + return (0, _lodash.zip)(window.performance.getEntriesByName(`${name}_start`), window.performance.getEntriesByName(`${name}_end`)).map(([start, end]) => +(end.startTime - start.startTime).toPrecision(2)); +} /* 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 . */ + +function getTimes(name) { + return window.performance.getEntriesByName(name).map(time => +time.duration.toPrecision(2)); +} + +function getStats(times) { + if (times.length == 0) { + return { times: [], avg: null, median: null }; + } + const avg = times.reduce((sum, time) => time + sum, 0) / times.length; + const sortedtimings = [...times].sort((a, b) => a - b); + const median = sortedtimings[times.length / 2]; + return { + times, + avg: +avg.toPrecision(2), + median: +median.toPrecision(2) + }; +} + +function steppingTimings() { + const commandTimings = getAsyncTimes("COMMAND"); + const pausedTimings = getTimes("PAUSED"); + + return { + commands: getStats(commandTimings), + paused: getStats(pausedTimings) + }; +} + +// console.log("..", asyncTimes("COMMAND")); + +/***/ }), +/* 416 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _redux = __webpack_require__(8); + +var _waitService = __webpack_require__(223); + +var _log = __webpack_require__(417); + +var _history = __webpack_require__(418); + +var _promise = __webpack_require__(33); + +var _thunk = __webpack_require__(419); + +var _timing = __webpack_require__(420); + +/** + * 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 + */ +const configureStore = (opts = {}) => { + const 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 + const devtoolsExt = typeof window === "object" && window.devToolsExtension ? window.devToolsExtension() : f => f; + + return (0, _redux.applyMiddleware)(...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 . */ + +/* global window */ + +/** + * Redux store utils + * @module utils/create-store + */ + +exports.default = configureStore; + +/***/ }), +/* 417 */ +/***/ (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; }; /* 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 */ + +exports.log = log; + +var _devtoolsConfig = __webpack_require__(13); + +const blacklist = ["SET_POPUP_OBJECT_PROPERTIES", "SET_SYMBOLS", "OUT_OF_SCOPE_LOCATIONS"]; + +function cloneAction(action) { + action = action || {}; + action = _extends({}, action); + + // ADD_TAB, ... + if (action.source && action.source.text) { + const source = _extends({}, action.source, { text: "" }); + action.source = source; + } + + if (action.sources) { + const sources = action.sources.slice(0, 30).map(source => { + const url = !source.url || source.url.includes("data:") ? "" : source.url; + return _extends({}, source, { url }); + }); + action.sources = sources; + } + + // LOAD_SOURCE_TEXT + if (action.text) { + action.text = ""; + } + + if (action.value && action.value.text) { + const value = _extends({}, action.value, { text: "" }); + action.value = value; + } + + return action; +} + +function formatFrame(frame) { + const { id, location, displayName } = frame; + return { id, location, displayName }; +} + +function formatPause(pause) { + return _extends({}, pause, { + pauseInfo: { why: pause.why }, + scopes: [], + frames: pause.frames.map(formatFrame), + loadedObjects: [] + }); +} + +function serializeAction(action) { + try { + action = cloneAction(action); + if (blacklist.includes(action.type)) { + action = {}; + } + + if (action.type === "PAUSED") { + action = formatPause(action); + } + + // dump(`> ${action.type}...\n ${JSON.stringify(action)}\n`); + return JSON.stringify(action); + } catch (e) { + console.error(e); + } +} + +/** + * A middleware that logs all actions coming through the system + * to the console. + */ +function log({ dispatch, getState }) { + return next => action => { + const asyncMsg = !action.status ? "" : `[${action.status}]`; + + if ((0, _devtoolsConfig.isTesting)()) { + dump(`[ACTION] ${action.type} ${asyncMsg} - ${serializeAction(action)}\n`); + } else { + console.log(action, asyncMsg); + } + + next(action); + }; +} + +/***/ }), +/* 418 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.history = undefined; + +var _devtoolsConfig = __webpack_require__(13); + +/** + * 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. + */ +const history = exports.history = (log = []) => ({ + dispatch, + getState +}) => { + return next => action => { + if ((0, _devtoolsConfig.isDevelopment)()) { + log.push(action); + } + + return next(action); + }; +}; /* 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 . */ + +/* global window */ + +/***/ }), +/* 419 */ +/***/ (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 ({ dispatch, getState }) => { + const args = { dispatch, getState }; + + return next => action => { + return typeof action === "function" ? action(makeArgs ? makeArgs(args, getState()) : args) : next(action); + }; + }; +} /* 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 . */ + +/* global window */ + +/***/ }), +/* 420 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.timing = timing; +/* 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 middleware that sets performance markers for all actions such that they + * will appear in performance tooling under the User Timing API + */ + +const mark = window.performance && window.performance.mark ? window.performance.mark.bind(window.performance) : () => {}; + +const measure = window.performance && window.performance.measure ? window.performance.measure.bind(window.performance) : () => {}; + +function timing(store) { + return next => action => { + mark(`${action.type}_start`); + const result = next(action); + mark(`${action.type}_end`); + measure(`${action.type}`, `${action.type}_start`, `${action.type}_end`); + return result; + }; +} + +/***/ }), +/* 421 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _expressions = __webpack_require__(209); + +var _expressions2 = _interopRequireDefault(_expressions); + +var _eventListeners = __webpack_require__(216); + +var _eventListeners2 = _interopRequireDefault(_eventListeners); + +var _sources = __webpack_require__(32); + +var _sources2 = _interopRequireDefault(_sources); + +var _breakpoints = __webpack_require__(101); + +var _breakpoints2 = _interopRequireDefault(_breakpoints); + +var _pendingBreakpoints = __webpack_require__(211); + +var _pendingBreakpoints2 = _interopRequireDefault(_pendingBreakpoints); + +var _asyncRequests = __webpack_require__(422); + +var _asyncRequests2 = _interopRequireDefault(_asyncRequests); + +var _pause = __webpack_require__(74); + +var _pause2 = _interopRequireDefault(_pause); + +var _ui = __webpack_require__(154); + +var _ui2 = _interopRequireDefault(_ui); + +var _fileSearch = __webpack_require__(212); + +var _fileSearch2 = _interopRequireDefault(_fileSearch); + +var _ast = __webpack_require__(155); + +var _ast2 = _interopRequireDefault(_ast); + +var _coverage = __webpack_require__(213); + +var _coverage2 = _interopRequireDefault(_coverage); + +var _projectTextSearch = __webpack_require__(102); + +var _projectTextSearch2 = _interopRequireDefault(_projectTextSearch); + +var _replay = __webpack_require__(214); + +var _replay2 = _interopRequireDefault(_replay); + +var _quickOpen = __webpack_require__(217); + +var _quickOpen2 = _interopRequireDefault(_quickOpen); + +var _sourceTree = __webpack_require__(215); + +var _sourceTree2 = _interopRequireDefault(_sourceTree); + +var _debuggee = __webpack_require__(210); + +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/. */ + +/** + * Reducer index + * @module reducers/index + */ + +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, + fileSearch: _fileSearch2.default, + ast: _ast2.default, + coverage: _coverage2.default, + projectTextSearch: _projectTextSearch2.default, + replay: _replay2.default, + quickOpen: _quickOpen2.default, + sourceTree: _sourceTree2.default, + debuggee: _debuggee2.default +}; + +/***/ }), +/* 422 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +/* 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/. */ + +/** + * Async request reducer + * @module reducers/async-request + */ + +const initialAsyncRequestState = []; + +function update(state = initialAsyncRequestState, action) { + const { seqId } = action; + + if (action.type === "NAVIGATE") { + return initialAsyncRequestState; + } else if (seqId) { + let newState; + if (action.status === "start") { + newState = [...state, seqId]; + } else if (action.status === "error" || action.status === "done") { + newState = state.filter(id => id !== seqId); + } + + return newState; + } + + return state; +} + +exports.default = update; + +/***/ }), +/* 423 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _propTypes = __webpack_require__(2); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _react = __webpack_require__(0); + +var _react2 = _interopRequireDefault(_react); + +var _reactRedux = __webpack_require__(4); + +var _redux = __webpack_require__(8); + +var _prefs = __webpack_require__(10); + +var _actions = __webpack_require__(7); + +var _actions2 = _interopRequireDefault(_actions); + +var _ShortcutsModal = __webpack_require__(461); + +var _selectors = __webpack_require__(1); + +var _devtoolsModules = __webpack_require__(70); + +__webpack_require__(466); + +__webpack_require__(467); + +__webpack_require__(468); + +__webpack_require__(469); + +var _devtoolsSplitter = __webpack_require__(234); + +var _devtoolsSplitter2 = _interopRequireDefault(_devtoolsSplitter); + +var _ProjectSearch = __webpack_require__(473); + +var _ProjectSearch2 = _interopRequireDefault(_ProjectSearch); + +var _PrimaryPanes = __webpack_require__(550); + +var _PrimaryPanes2 = _interopRequireDefault(_PrimaryPanes); + +var _Editor = __webpack_require__(556); + +var _Editor2 = _interopRequireDefault(_Editor); + +var _SecondaryPanes = __webpack_require__(617); + +var _SecondaryPanes2 = _interopRequireDefault(_SecondaryPanes); + +var _WelcomeBox = __webpack_require__(649); + +var _WelcomeBox2 = _interopRequireDefault(_WelcomeBox); + +var _Tabs = __webpack_require__(651); + +var _Tabs2 = _interopRequireDefault(_Tabs); + +var _QuickOpenModal = __webpack_require__(654); + +var _QuickOpenModal2 = _interopRequireDefault(_QuickOpenModal); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const shortcuts = new _devtoolsModules.KeyShortcuts({ window }); /* 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 . */ + +const { appinfo } = _devtoolsModules.Services; + +const isMacOS = appinfo.OS === "Darwin"; + +const horizontalLayoutBreakpoint = window.matchMedia("(min-width: 800px)"); +const verticalLayoutBreakpoint = window.matchMedia("(min-width: 10px) and (max-width: 800px)"); + +class App extends _react.Component { + + constructor(props) { + super(props); + this.state = { + shortcutsModalEnabled: false, + startPanelSize: 0, + endPanelSize: 0 + }; + + this.getChildContext = this.getChildContext.bind(this); + this.onLayoutChange = this.onLayoutChange.bind(this); + this.toggleQuickOpenModal = this.toggleQuickOpenModal.bind(this); + this.renderEditorPane = this.renderEditorPane.bind(this); + this.renderLayout = this.renderLayout.bind(this); + this.onEscape = this.onEscape.bind(this); + this.onCommandSlash = this.onCommandSlash.bind(this); + } + + getChildContext() { + return { shortcuts }; + } + + componentDidMount() { + horizontalLayoutBreakpoint.addListener(this.onLayoutChange); + verticalLayoutBreakpoint.addListener(this.onLayoutChange); + this.setOrientation(); + + shortcuts.on(L10N.getStr("symbolSearch.search.key2"), (_, e) => this.toggleQuickOpenModal(_, e, "@")); + + const searchKeys = [L10N.getStr("sources.search.key2"), L10N.getStr("sources.search.alt.key")]; + searchKeys.forEach(key => shortcuts.on(key, this.toggleQuickOpenModal)); + + shortcuts.on(L10N.getStr("gotoLineModal.key2"), (_, e) => this.toggleQuickOpenModal(_, e, ":")); + + shortcuts.on("Escape", this.onEscape); + shortcuts.on("Cmd+/", this.onCommandSlash); + } + + componentWillUnmount() { + horizontalLayoutBreakpoint.removeListener(this.onLayoutChange); + verticalLayoutBreakpoint.removeListener(this.onLayoutChange); + shortcuts.off(L10N.getStr("symbolSearch.search.key2"), this.toggleQuickOpenModal); + + const searchKeys = [L10N.getStr("sources.search.key2"), L10N.getStr("sources.search.alt.key")]; + searchKeys.forEach(key => shortcuts.off(key, this.toggleQuickOpenModal)); + + shortcuts.off(L10N.getStr("gotoLineModal.key2"), this.toggleQuickOpenModal); + + shortcuts.off("Escape", this.onEscape); + } + + onEscape(_, e) { + const { + activeSearch, + quickOpenEnabled, + closeActiveSearch, + closeQuickOpen + } = this.props; + + if (activeSearch) { + e.preventDefault(); + closeActiveSearch(); + } + + if (quickOpenEnabled === true) { + closeQuickOpen(); + } + } + + onCommandSlash() { + this.toggleShortcutsModal(); + } + + isHorizontal() { + return this.props.orientation === "horizontal"; + } + + toggleQuickOpenModal(_, e, query) { + const { quickOpenEnabled, openQuickOpen, closeQuickOpen } = this.props; + + e.preventDefault(); + e.stopPropagation(); + + if (quickOpenEnabled === true) { + closeQuickOpen(); + return; + } + + if (query != null) { + openQuickOpen(query); + return; + } + openQuickOpen(); + return; + } + + onLayoutChange() { + this.setOrientation(); + } + + setOrientation() { + // If the orientation does not match (if it is not visible) it will + // not setOrientation, or if it is the same as before, calling + // setOrientation will not cause a rerender. + if (horizontalLayoutBreakpoint.matches) { + this.props.setOrientation("horizontal"); + } else if (verticalLayoutBreakpoint.matches) { + this.props.setOrientation("vertical"); + } + } + + renderEditorPane() { + const { startPanelCollapsed, endPanelCollapsed } = this.props; + const { endPanelSize, startPanelSize } = this.state; + const horizontal = this.isHorizontal(); + + 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(prevState => ({ + shortcutsModalEnabled: !prevState.shortcutsModalEnabled + })); + } + + renderLayout() { + const { startPanelCollapsed, endPanelCollapsed } = this.props; + const horizontal = this.isHorizontal(); + + const maxSize = horizontal ? "70%" : "95%"; + const primaryInitialSize = horizontal ? "250px" : "150px"; + + return _react2.default.createElement(_devtoolsSplitter2.default, { + style: { width: "100vw" }, + initialHeight: 400, + initialWidth: 300, + minSize: 30, + maxSize: maxSize, + splitterSize: 1, + vert: horizontal, + startPanel: _react2.default.createElement(_devtoolsSplitter2.default, { + style: { width: "100vw" }, + initialSize: primaryInitialSize, + minSize: 30, + maxSize: "85%", + splitterSize: 1, + startPanelCollapsed: startPanelCollapsed, + startPanel: _react2.default.createElement(_PrimaryPanes2.default, { horizontal: horizontal }), + endPanel: this.renderEditorPane() + }), + endPanelControl: true, + endPanel: _react2.default.createElement(_SecondaryPanes2.default, { + horizontal: horizontal, + toggleShortcutsModal: () => this.toggleShortcutsModal() + }), + endPanelCollapsed: endPanelCollapsed + }); + } + + renderShortcutsModal() { + const additionalClass = isMacOS ? "mac" : ""; + + if (!_prefs.features.shortcuts) { + return; + } + + return _react2.default.createElement(_ShortcutsModal.ShortcutsModal, { + additionalClass: additionalClass, + enabled: this.state.shortcutsModalEnabled, + handleClose: () => this.toggleShortcutsModal() + }); + } + + render() { + const { quickOpenEnabled } = this.props; + return _react2.default.createElement( + "div", + { className: "debugger" }, + this.renderLayout(), + quickOpenEnabled === true && _react2.default.createElement(_QuickOpenModal2.default, { + shortcutsModalEnabled: this.state.shortcutsModalEnabled, + toggleShortcutsModal: () => this.toggleShortcutsModal() + }), + this.renderShortcutsModal() + ); + } +} + +App.childContextTypes = { shortcuts: _propTypes2.default.object }; + +function mapStateToProps(state) { + return { + selectedSource: (0, _selectors.getSelectedSource)(state), + startPanelCollapsed: (0, _selectors.getPaneCollapse)(state, "start"), + endPanelCollapsed: (0, _selectors.getPaneCollapse)(state, "end"), + activeSearch: (0, _selectors.getActiveSearch)(state), + quickOpenEnabled: (0, _selectors.getQuickOpenEnabled)(state), + orientation: (0, _selectors.getOrientation)(state) + }; +} + +exports.default = (0, _reactRedux.connect)(mapStateToProps, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(App); + +/***/ }), +/* 424 */ +/***/ (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; }; /* 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 . */ + +var _breakpoint = __webpack_require__(41); + +var _selectors = __webpack_require__(1); + +var _sourceMaps = __webpack_require__(158); + +exports.default = async function addBreakpoint(getState, client, sourceMaps, { breakpoint }) { + const state = getState(); + + const source = (0, _selectors.getSource)(state, breakpoint.location.sourceId); + const sourceRecord = source.toJS(); + const location = _extends({}, breakpoint.location, { sourceUrl: source.get("url") }); + const generatedLocation = await (0, _sourceMaps.getGeneratedLocation)(state, sourceRecord, location, sourceMaps); + + (0, _breakpoint.assertLocation)(location); + (0, _breakpoint.assertLocation)(generatedLocation); + + if ((0, _breakpoint.breakpointExists)(state, location)) { + const newBreakpoint = _extends({}, breakpoint, { location, generatedLocation }); + (0, _breakpoint.assertBreakpoint)(newBreakpoint); + return { breakpoint: newBreakpoint }; + } + + const { id, hitCount, actualLocation } = await client.setBreakpoint(generatedLocation, breakpoint.condition, sourceMaps.isOriginalId(location.sourceId)); + + const newGeneratedLocation = actualLocation || generatedLocation; + const newLocation = await sourceMaps.getOriginalLocation(newGeneratedLocation); + + const symbols = (0, _selectors.getSymbols)(getState(), sourceRecord); + const astLocation = await (0, _breakpoint.getASTLocation)(sourceRecord, symbols, newLocation); + + const newBreakpoint = { + id, + disabled: false, + hidden: breakpoint.hidden, + loading: false, + condition: breakpoint.condition, + location: newLocation, + astLocation, + hitCount, + generatedLocation: newGeneratedLocation + }; + + (0, _breakpoint.assertBreakpoint)(newBreakpoint); + + const previousLocation = (0, _breakpoint.locationMoved)(location, newLocation) ? location : null; + + return { + breakpoint: newBreakpoint, + previousLocation + }; +}; + +/***/ }), +/* 425 */ +/***/ (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; +/* 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 . */ + +function remapLocations(breakpoints, sourceId, sourceMaps) { + const sourceBreakpoints = breakpoints.map(async breakpoint => { + if (breakpoint.location.sourceId !== sourceId) { + return breakpoint; + } + const location = await sourceMaps.getOriginalLocation(breakpoint.location); + return _extends({}, breakpoint, { location }); + }); + + return Promise.all(sourceBreakpoints.valueSeq()); +} + +/***/ }), +/* 426 */ +/***/ (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; }; /* 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 . */ + +exports.syncClientBreakpoint = syncClientBreakpoint; + +var _breakpoint = __webpack_require__(41); + +var _sourceMaps = __webpack_require__(158); + +var _devtoolsSourceMap = __webpack_require__(12); + +var _selectors = __webpack_require__(1); + +async function makeScopedLocation({ name, offset }, location, source) { + const scope = await (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 + const line = scope ? scope.location.start.line + offset.line : location.line; + return { + line, + column: location.column, + sourceUrl: source.url, + sourceId: source.id + }; +} + +function createSyncData(id, pendingBreakpoint, location, generatedLocation, previousLocation) { + const overrides = _extends({}, pendingBreakpoint, { generatedLocation, id }); + const breakpoint = (0, _breakpoint.createBreakpoint)(location, overrides); + + (0, _breakpoint.assertBreakpoint)(breakpoint); + return { breakpoint, previousLocation }; +} + +// we have three forms of syncing: disabled syncing, existing server syncing +// and adding a new breakpoint +async function syncClientBreakpoint(getState, client, sourceMaps, sourceId, pendingBreakpoint) { + (0, _breakpoint.assertPendingBreakpoint)(pendingBreakpoint); + + const source = (0, _selectors.getSource)(getState(), sourceId).toJS(); + const generatedSourceId = sourceMaps.isOriginalId(sourceId) ? (0, _devtoolsSourceMap.originalToGeneratedId)(sourceId) : sourceId; + + const { location, astLocation } = pendingBreakpoint; + const previousLocation = _extends({}, location, { sourceId }); + + const scopedLocation = await makeScopedLocation(astLocation, previousLocation, source); + + const scopedGeneratedLocation = await (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 + const generatedLocation = _extends({}, pendingBreakpoint.generatedLocation, { + sourceId: generatedSourceId + }); + + const isSameLocation = !(0, _breakpoint.locationMoved)(generatedLocation, scopedGeneratedLocation); + + const 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) { + const id = pendingBreakpoint.disabled ? "" : existingClient.id; + return createSyncData(id, pendingBreakpoint, scopedLocation, scopedGeneratedLocation, previousLocation); + } + + // clear server breakpoints if they exist and we have moved + if (existingClient) { + await 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. + + if (!scopedGeneratedLocation.line) { + return { previousLocation, breakpoint: null }; + } + + const { id, actualLocation } = await 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 + const newGeneratedLocation = actualLocation; + const newLocation = await sourceMaps.getOriginalLocation(newGeneratedLocation); + + return createSyncData(id, pendingBreakpoint, newLocation, newGeneratedLocation, previousLocation); +} + +/***/ }), +/* 427 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.fetchEventListeners = fetchEventListeners; +exports.updateEventBreakpoints = updateEventBreakpoints; + +var _DevToolsUtils = __webpack_require__(224); + +var _selectors = __webpack_require__(1); + +var _waitService = __webpack_require__(223); + +// delay is in ms +const FETCH_EVENT_LISTENERS_DELAY = 200; /* 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 EVENTS */ +/* eslint no-shadow: 0 */ + +/** + * Redux actions for the event listeners state + * @module actions/event-listeners + */ + +let fetchListenersTimerID; + +/** + * @memberof utils/utils + * @static + */ +async function asPaused(state, client, func) { + if (!(0, _selectors.isPaused)(state)) { + await client.interrupt(); + let result; + + try { + result = await func(client); + } catch (e) { + // Try to put the debugger back in a working state by resuming + // it + await client.resume(); + throw e; + } + + await client.resume(); + return result; + } + + return func(client); +} + +/** + * @memberof actions/event-listeners + * @static + */ +function fetchEventListeners() { + return ({ dispatch, getState, 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: _waitService.NAME, + 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 + }; + }); +} + +async function _getEventListeners(threadClient) { + const response = await 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((a, b) => a.type > b.type ? 1 : -1); + + // Add all the listeners in the debugger view event linsteners container. + const fetchedDefinitions = new Map(); + const listeners = []; + for (const listener of response.listeners) { + let definitionSite; + if (fetchedDefinitions.has(listener.function.actor)) { + definitionSite = fetchedDefinitions.get(listener.function.actor); + } else if (listener.function.class == "Function") { + definitionSite = await _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; +} + +async function _getDefinitionSite(threadClient, func) { + const grip = threadClient.pauseGrip(func); + let response; + + try { + response = await 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; +} + +/** + * @memberof actions/event-listeners + * @static + * @param {string} eventNames + */ +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 + }); + }); + }); + }; +} + +/***/ }), +/* 428 */ +/***/ (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; }; /* 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 . */ + +// eslint-disable-next-line max-len + + +exports.mapScopes = mapScopes; + +var _selectors = __webpack_require__(1); + +var _loadSourceText = __webpack_require__(76); + +var _parser = __webpack_require__(31); + +var _promise = __webpack_require__(33); + +var _locColumn = __webpack_require__(226); + +var _findGeneratedBindingFromPosition = __webpack_require__(430); + +var _prefs = __webpack_require__(10); + +var _log = __webpack_require__(431); + +var _devtoolsSourceMap = __webpack_require__(12); + +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 mapScopes(scopes, frame) { + return async function ({ dispatch, getState, client, sourceMaps }) { + const generatedSourceRecord = (0, _selectors.getSource)(getState(), frame.generatedLocation.sourceId); + + const sourceRecord = (0, _selectors.getSource)(getState(), frame.location.sourceId); + + const shouldMapScopes = _prefs.features.mapScopes && !generatedSourceRecord.get("isWasm") && !sourceRecord.get("isPrettyPrinted") && !(0, _devtoolsSourceMap.isGeneratedId)(frame.location.sourceId); + + dispatch({ + type: "MAP_SCOPES", + frame, + [_promise.PROMISE]: async function () { + if (!shouldMapScopes) { + return null; + } + + await dispatch((0, _loadSourceText.loadSourceText)(sourceRecord)); + + try { + return await buildMappedScopes(sourceRecord.toJS(), frame, (await scopes), sourceMaps, client); + } catch (e) { + (0, _log.log)(e); + return null; + } + }() + }); + }; +} + +async function buildMappedScopes(source, frame, scopes, sourceMaps, client) { + const originalAstScopes = await (0, _parser.getScopes)(frame.location); + const generatedAstScopes = await (0, _parser.getScopes)(frame.generatedLocation); + + if (!originalAstScopes || !generatedAstScopes) { + return null; + } + + const generatedAstBindings = buildGeneratedBindingList(scopes, generatedAstScopes, frame.this); + + const mappedOriginalScopes = await Promise.all(Array.from(originalAstScopes, async item => { + const generatedBindings = {}; + + await Promise.all(Object.keys(item.bindings).map(async name => { + const binding = item.bindings[name]; + + const result = await findGeneratedBinding(sourceMaps, client, source, name, binding, generatedAstBindings); + + if (result) { + generatedBindings[name] = result; + } + })); + + return _extends({}, item, { + generatedBindings + }); + })); + + return generateClientScope(scopes, mappedOriginalScopes); +} + +function generateClientScope(scopes, originalScopes) { + // Pull the root object scope and root lexical scope to reuse them in + // our mapped scopes. This assumes that file file being processed is + // a CommonJS or ES6 module, which might not be ideal. Potentially + let globalLexicalScope = null; + for (let s = scopes; s.parent; s = s.parent) { + // $FlowIgnore - Flow doesn't like casting 'parent'. + globalLexicalScope = s; + } + if (!globalLexicalScope) { + throw new Error("Assertion failure - there should always be a scope"); + } + + // Build a structure similar to the client's linked scope object using + // the original AST scopes, but pulling in the generated bindings + // linked to each scope. + const result = originalScopes.slice(0, -2).reverse().reduce((acc, orig, i) => { + const _orig$generatedBindin = orig.generatedBindings, + { + // The 'this' binding data we have is handled independently, so + // the binding data is not included here. + // eslint-disable-next-line no-unused-vars + this: _this + } = _orig$generatedBindin, + variables = _objectWithoutProperties(_orig$generatedBindin, ["this"]); + + return _extends({ + // Flow doesn't like casting 'parent'. + parent: acc, + actor: `originalActor${i}`, + type: orig.type, + bindings: { + arguments: [], + variables + } + }, orig.type === "function" ? { + function: { + displayName: orig.displayName + } + } : null, orig.type === "block" ? { + block: { + displayName: orig.displayName + } + } : null); + }, globalLexicalScope); + + // The rendering logic in getScope 'this' bindings only runs on the current + // selected frame scope, so we pluck out the 'this' binding that was mapped, + // and put it in a special location + const thisScope = originalScopes.find(scope => scope.bindings.this); + if (thisScope) { + result.bindings.this = thisScope.generatedBindings.this || null; + } + + return result; +} + +async function findGeneratedBinding(sourceMaps, client, source, name, originalBinding, generatedAstBindings) { + // If there are no references to the implicits, then we have no way to + // even attempt to map it back to the original since there is no location + // data to use. Bail out instead of just showing it as unmapped. + if (originalBinding.type === "implicit" && !originalBinding.refs.some(item => item.type === "ref")) { + return null; + } + + const { refs } = originalBinding; + + const genContent = await refs.reduce(async (acc, pos) => { + const result = await acc; + if (result) { + return result; + } + + return await (0, _findGeneratedBindingFromPosition.findGeneratedBindingFromPosition)(sourceMaps, client, source, pos, name, originalBinding.type, generatedAstBindings); + }, null); + + if (genContent && genContent.desc) { + return genContent.desc; + } else if (genContent) { + // If there is no descriptor for 'this', then this is not the top-level + // 'this' that the server gave us a binding for, and we can just ignore it. + if (name === "this") { + return null; + } + + // If the location is found but the descriptor is not, then it + // means that the server scope information didn't match the scope + // information from the DevTools parsed scopes. + return { + configurable: false, + enumerable: true, + writable: false, + value: { + type: "unscoped", + unscoped: true, + + // HACK: Until support for "unscoped" lands in devtools-reps, + // this will make these show as (unavailable). + missingArguments: true + } + }; + } + + // If no location mapping is found, then the map is bad, or + // the map is okay but it original location is inside + // of some scope, but the generated location is outside, leading + // us to search for bindings that don't technically exist. + return { + configurable: false, + enumerable: true, + writable: false, + value: { + type: "unmapped", + unmapped: true, + + // HACK: Until support for "unmapped" lands in devtools-reps, + // this will make these show as (unavailable). + missingArguments: true + } + }; +} + +function buildGeneratedBindingList(scopes, generatedAstScopes, thisBinding) { + const clientScopes = []; + for (let s = scopes; s; s = s.parent) { + clientScopes.push(s); + } + + // The server's binding data doesn't include general 'this' binding + // information, so we manually inject the one 'this' binding we have into + // the normal binding data we are working with. + const frameThisOwner = generatedAstScopes.find(generated => "this" in generated.bindings); + + const generatedBindings = clientScopes.reverse().map((s, i) => { + const generated = generatedAstScopes[generatedAstScopes.length - 1 - i]; + + const bindings = s.bindings ? Object.assign({}, ...s.bindings.arguments, s.bindings.variables) : {}; + + if (generated === frameThisOwner && thisBinding) { + bindings.this = { + value: thisBinding + }; + } + + return { + generated, + client: _extends({}, s, { + bindings + }) + }; + }).slice(2).reduce((acc, { client: { bindings }, generated }) => { + // If the parser worker's result didn't match the client scopes, + // there might not be a generated scope that matches. + if (generated) { + for (const name of Object.keys(generated.bindings)) { + const { refs } = generated.bindings[name]; + for (const loc of refs) { + acc.push({ + name, + loc, + desc: bindings[name] || null + }); + } + } + } + return acc; + }, []) + // Sort so we can binary-search. + .sort((a, b) => { + const aStart = a.loc.start; + const bStart = a.loc.start; + + if (aStart.line === bStart.line) { + return (0, _locColumn.locColumn)(aStart) - (0, _locColumn.locColumn)(bStart); + } + return aStart.line - bStart.line; + }); + + return generatedBindings; +} + +/***/ }), +/* 429 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = defer; +/* 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 . */ + +function defer() { + let resolve = () => {}; + let reject = () => {}; + const promise = new Promise((_res, _rej) => { + resolve = _res; + reject = _rej; + }); + + return { resolve, reject, promise }; +} + +/***/ }), +/* 430 */ +/***/ (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; }; +// eslint-disable-next-line max-len + + +exports.findGeneratedBindingFromPosition = findGeneratedBindingFromPosition; + +var _lodash = __webpack_require__(11); + +var _locColumn = __webpack_require__(226); + +var _firefox = __webpack_require__(69); + +async function findGeneratedBindingFromPosition(sourceMaps, client, source, pos, name, type, generatedAstBindings) { + const range = await getGeneratedLocationRange(pos, source, sourceMaps); + + if (range) { + const result = await findGeneratedReference(type, generatedAstBindings, _extends({ + type: pos.type + }, range)); + + if (result) { + return result; + } + } + + if (type === "import" && pos.type === "decl") { + let importRange = range; + if (!importRange) { + // If the imported name itself does not map to a useful range, fall back + // to resolving the bindinding using the location of the overall + // import declaration. + importRange = await getGeneratedLocationRange(pos.declaration, source, sourceMaps); + + if (!importRange) { + return null; + } + } + + const importName = pos.importName; + if (typeof importName !== "string") { + // Should never happen, just keeping Flow happy. + return null; + } + + return await findGeneratedImportDeclaration(generatedAstBindings, _extends({ + importName + }, importRange)); + } + + return null; +} + +/** + * Given a mapped range over the generated source, attempt to resolve a real + * binding descriptor that can be used to access the value. + */ +async function findGeneratedReference(type, generatedAstBindings, mapped) { + return generatedAstBindings.reduce(async (acc, val) => { + const accVal = await acc; + if (accVal) { + return accVal; + } + + return type === "import" ? await mapImportReferenceToDescriptor(val, mapped) : await mapBindingReferenceToDescriptor(val, mapped); + }, null); +} + +/** + * Given a mapped range over the generated source and the name of the imported + * value that is referenced, attempt to resolve a binding descriptor for + * the import's value. + */ +async function findGeneratedImportDeclaration(generatedAstBindings, mapped) { + return generatedAstBindings.reduce(async (acc, val) => { + const accVal = await acc; + if (accVal) { + return accVal; + } + + return await mapImportDeclarationToDescriptor(val, mapped); + }, null); +} + +/** + * Given a generated binding, and a range over the generated code, statically + * check if the given binding matches the range. + */ +async function mapBindingReferenceToDescriptor(binding, mapped) { + // Allow the mapping to point anywhere within the generated binding + // location to allow for less than perfect sourcemaps. Since you also + // need at least one character between identifiers, we also give one + // characters of space at the front the generated binding in order + // to increase the probability of finding the right mapping. + if (mapped.start.line === binding.loc.start.line && (0, _locColumn.locColumn)(mapped.start) >= (0, _locColumn.locColumn)(binding.loc.start) - 1 && (0, _locColumn.locColumn)(mapped.start) <= (0, _locColumn.locColumn)(binding.loc.end)) { + return { + name: binding.name, + desc: binding.desc + }; + } + + return null; +} + +/** + * Given an generated binding, and a range over the generated code, statically + * resolve the module namespace object and attempt to access the imported + * property on the namespace. + * + * This is mostly hard-coded to work for Babel 6's imports. + */ +async function mapImportDeclarationToDescriptor(binding, mapped) { + // When trying to map an actual import declaration binding, we can try + // to map it back to the namespace object in the original code. + if (!mappingContains(mapped, binding.loc)) { + return null; + } + + let desc = binding.desc; + if (desc && typeof desc.value === "object") { + if (desc.value.optimizedOut) { + // If the value was optimized out, we skip it entirely because there is + // a good chance that this means that this isn't the right binding. This + // allows us to catch cases like + // + // var _mod = require(...); + // var _mod2 = _interopRequire(_mod); + // + // where "_mod" is optimized out because it is only referenced once, and + // we want to continue searching to try to find "_mod2". + return null; + } + + if (desc.value.type !== "object") { + // If we got a non-primitive descriptor but it isn't an object, then + // it's definitely not the namespace. + return null; + } + + const objectClient = (0, _firefox.createObjectClient)(desc.value); + desc = (await objectClient.getProperty(mapped.importName)).descriptor; + } + + return desc ? { + name: binding.name, + desc + } : null; +} + +/** + * Given an generated binding, and a range over the generated code, statically + * evaluate accessed properties within the mapped range to resolve the actual + * imported value. + */ +async function mapImportReferenceToDescriptor(binding, mapped) { + if (mapped.type !== "ref") { + return null; + } + + // Expression matches require broader searching because sourcemaps usage + // varies in how they map certain things. For instance given + // + // import { bar } from "mod"; + // bar(); + // + // The "bar()" expression is generally expanded into one of two possibly + // forms, both of which map the "bar" identifier in different ways. See + // the "^^" markers below for the ranges. + // + // (0, foo.bar)() // Babel + // ^^^^^^^ // mapping + // ^^^ // binding + // vs + // + // Object(foo.bar)() // Webpack + // ^^^^^^^^^^^^^^^ // mapping + // ^^^ // binding + // + // Unfortunately, Webpack also has a tendancy to over-map past the call + // expression to the start of the next line, at least when there isn't + // anything else on that line that is mapped, e.g. + // + // Object(foo.bar)() + // ^^^^^^^^^^^^^^^^^ + // ^ // wrapped to column 0 of next line + + if (!mappingContains(mapped, binding.loc)) { + return null; + } + + let desc = binding.desc; + + if (binding.loc.type === "ref") { + const { meta } = binding.loc; + + // Limit to 2 simple property or inherits operartions, since it would + // just be more work to search more and it is very unlikely that + // bindings would be mapped to more than a single member + inherits + // wrapper. + for (let op = meta, index = 0; op && mappingContains(mapped, op) && desc && index < 2; index++, op = op && op.parent) { + // Calling could potentially trigger side-effects, which would not + // be ideal for this case. + if (op.type === "call") { + return null; + } + + if (op.type === "inherit") { + continue; + } + + const objectClient = (0, _firefox.createObjectClient)(desc.value); + desc = (await objectClient.getProperty(op.property)).descriptor; + } + } + + return desc ? { + name: binding.name, + desc + } : null; +} + +function mappingContains(mapped, item) { + return (item.start.line > mapped.start.line || item.start.line === mapped.start.line && (0, _locColumn.locColumn)(item.start) >= (0, _locColumn.locColumn)(mapped.start)) && (item.end.line < mapped.end.line || item.end.line === mapped.end.line && (0, _locColumn.locColumn)(item.end) <= (0, _locColumn.locColumn)(mapped.end)); +} + +async function getGeneratedLocationRange(pos, source, sourceMaps) { + const start = await sourceMaps.getGeneratedLocation(pos.start, source); + const end = await sourceMaps.getGeneratedLocation(pos.end, source); + + // Since the map takes the closest location, sometimes mapping a + // binding's location can point at the start of a binding listed after + // it, so we need to make sure it maps to a location that actually has + // a size in order to avoid picking up the wrong descriptor. + if ((0, _lodash.isEqual)(start, end)) { + return null; + } + + return { start, end }; +} + +/***/ }), +/* 431 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.log = log; + +var _devtoolsConfig = __webpack_require__(13); + +/** + * Produces a formatted console log line by imploding args, prefixed by [log] + * + * function input: log(["hello", "world"]) + * console output: [log] hello world + * + * @memberof utils/log + * @static + */ +function log(...args) { + if (!(0, _devtoolsConfig.isDevelopment)()) { + return; + } + + console.log.apply(console, ["[log]", ...args]); +} /* 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 . */ + +/** + * + * Utils for logging to the console + * Suppresses logging in non-development environment + * + * @module utils/log + */ + +/***/ }), +/* 432 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.paused = paused; + +var _devtoolsSourceMap = __webpack_require__(12); + +var _selectors = __webpack_require__(1); + +var _ = __webpack_require__(159); + +var _breakpoints = __webpack_require__(59); + +var _expressions = __webpack_require__(75); + +var _sources = __webpack_require__(34); + +var _ui = __webpack_require__(77); + +var _commands = __webpack_require__(160); + +var _pause = __webpack_require__(78); + +var _mapFrames = __webpack_require__(230); + +var _fetchScopes = __webpack_require__(161); + +async function getOriginalSourceForFrame(state, frame) { + return (0, _selectors.getSources)(state).get(frame.location.sourceId); +} +/** + * Debugger has just paused + * + * @param {object} pauseInfo + * @memberof actions/pause + * @static + */ +/* 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 . */ + +function paused(pauseInfo) { + return async function ({ dispatch, getState, client, sourceMaps }) { + const { frames, why, loadedObjects } = pauseInfo; + const rootFrame = frames.length > 0 ? frames[0] : null; + + if (rootFrame) { + const mappedFrame = await (0, _mapFrames.updateFrameLocation)(rootFrame, sourceMaps); + const source = await getOriginalSourceForFrame(getState(), mappedFrame); + + // Ensure that the original file has loaded if there is one. + await dispatch((0, _sources.loadSourceText)(source)); + + if (await (0, _pause.shouldStep)(mappedFrame, getState(), sourceMaps)) { + dispatch((0, _commands.command)("stepOver")); + return; + } + } + + dispatch({ + type: "PAUSED", + why, + frames, + selectedFrameId: rootFrame ? rootFrame.id : undefined, + loadedObjects: loadedObjects || [] + }); + + const hiddenBreakpointLocation = (0, _selectors.getHiddenBreakpointLocation)(getState()); + if (hiddenBreakpointLocation) { + dispatch((0, _breakpoints.removeBreakpoint)(hiddenBreakpointLocation)); + } + + if (!(0, _selectors.isEvaluatingExpression)(getState())) { + dispatch((0, _expressions.evaluateExpressions)()); + } + + await dispatch((0, _.mapFrames)()); + const selectedFrame = (0, _selectors.getSelectedFrame)(getState()); + + if (selectedFrame) { + const visibleFrame = (0, _selectors.getVisibleSelectedFrame)(getState()); + const location = (0, _devtoolsSourceMap.isGeneratedId)(visibleFrame.location.sourceId) ? selectedFrame.generatedLocation : selectedFrame.location; + await dispatch((0, _sources.selectLocation)(location)); + } + + dispatch((0, _ui.togglePaneCollapse)("end", false)); + dispatch((0, _fetchScopes.fetchScopes)()); + }; +} + +/***/ }), +/* 433 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.setInScopeLines = setInScopeLines; + +var _selectors = __webpack_require__(1); + +var _source = __webpack_require__(9); + +var _lodash = __webpack_require__(11); + +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))); +} /* 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 . */ + +function setInScopeLines() { + return ({ dispatch, getState }) => { + const source = (0, _selectors.getSelectedSource)(getState()); + const outOfScopeLocations = (0, _selectors.getOutOfScopeLocations)(getState()); + + if (!source || !source.get("text")) { + return; + } + + const linesOutOfScope = getOutOfScopeLines(outOfScopeLocations, source.toJS()); + + const sourceNumLines = (0, _source.getSourceLineCount)(source.toJS()); + const sourceLines = (0, _lodash.range)(1, sourceNumLines + 1); + + const inScopeLines = !linesOutOfScope ? sourceLines : (0, _lodash.without)(sourceLines, ...linesOutOfScope); + + dispatch({ + type: "IN_SCOPE_LINES", + lines: inScopeLines + }); + }; +} + +/***/ }), +/* 434 */ +/***/ (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; }; /* 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 . */ + +/** + * Redux actions for the sources state + * @module actions/sources + */ + +exports.loadSourceMap = loadSourceMap; +exports.newSource = newSource; +exports.newSources = newSources; + +var _breakpoints = __webpack_require__(59); + +var _loadSourceText = __webpack_require__(76); + +var _prettyPrint = __webpack_require__(162); + +var _sources = __webpack_require__(34); + +var _source = __webpack_require__(9); + +var _selectors = __webpack_require__(1); + +function createOriginalSource(originalUrl, generatedSource, sourceMaps) { + return { + url: originalUrl, + id: sourceMaps.generatedToOriginalId(generatedSource.id, originalUrl), + isPrettyPrinted: false, + isWasm: false, + isBlackBoxed: false, + loadedState: "unloaded" + }; +} + +/** + * @memberof actions/sources + * @static + */ +function loadSourceMap(generatedSource) { + return async function ({ dispatch, getState, sourceMaps }) { + let urls; + try { + urls = await sourceMaps.getOriginalURLs(generatedSource); + } catch (e) { + console.error(e); + urls = null; + } + if (!urls) { + // If this source doesn't have a sourcemap, enable it for pretty printing + dispatch({ + type: "UPDATE_SOURCE", + source: _extends({}, generatedSource, { sourceMapURL: "" }) + }); + return; + } + + const originalSources = urls.map(url => createOriginalSource(url, generatedSource, sourceMaps)); + + // TODO: check if this line is really needed, it introduces + // a lot of lag to the application. + const generatedSourceRecord = (0, _selectors.getSource)(getState(), generatedSource.id); + await dispatch((0, _loadSourceText.loadSourceText)(generatedSourceRecord)); + dispatch(newSources(originalSources)); + }; +} + +// If a request has been made to show this source, go ahead and +// select it. +function checkSelectedSource(sourceId) { + return async ({ dispatch, getState }) => { + const source = (0, _selectors.getSource)(getState(), sourceId).toJS(); + + const pendingLocation = (0, _selectors.getPendingSelectedLocation)(getState()); + + if (!pendingLocation || !pendingLocation.url || !source.url) { + return; + } + + const pendingUrl = pendingLocation.url; + const rawPendingUrl = (0, _source.getRawSourceURL)(pendingUrl); + + if (rawPendingUrl === source.url) { + if ((0, _source.isPrettyURL)(pendingUrl)) { + return await dispatch((0, _prettyPrint.togglePrettyPrint)(source.id)); + } + + await dispatch((0, _sources.selectLocation)(_extends({}, pendingLocation, { sourceId: source.id }))); + } + }; +} + +function checkPendingBreakpoints(sourceId) { + return async ({ dispatch, getState }) => { + // source may have been modified by selectLocation + const source = (0, _selectors.getSource)(getState(), sourceId); + + const pendingBreakpoints = (0, _selectors.getPendingBreakpointsForSource)(getState(), source.get("url")); + + if (!pendingBreakpoints.size) { + return; + } + + // load the source text if there is a pending breakpoint for it + await dispatch((0, _loadSourceText.loadSourceText)(source)); + + const pendingBreakpointsArray = pendingBreakpoints.valueSeq().toJS(); + for (const pendingBreakpoint of pendingBreakpointsArray) { + await dispatch((0, _breakpoints.syncBreakpoint)(sourceId, pendingBreakpoint)); + } + }; +} + +/** + * Handler for the debugger client's unsolicited newSource notification. + * @memberof actions/sources + * @static + */ +function newSource(source) { + return async ({ dispatch }) => { + await dispatch(newSources([source])); + }; +} + +function newSources(sources) { + return async ({ dispatch, getState }) => { + const filteredSources = sources.filter(source => !(0, _selectors.getSource)(getState(), source.id)); + + if (filteredSources.length == 0) { + return; + } + + dispatch({ + type: "ADD_SOURCES", + sources: filteredSources + }); + + for (const source of filteredSources) { + dispatch(checkSelectedSource(source.id)); + dispatch(checkPendingBreakpoints(source.id)); + } + + return Promise.all(filteredSources.map(source => dispatch(loadSourceMap(source)))); + }; +} + +/***/ }), +/* 435 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.toggleBlackBox = toggleBlackBox; + +var _promise = __webpack_require__(33); + +function toggleBlackBox(source) { + return async ({ dispatch, getState, client, sourceMaps }) => { + const { isBlackBoxed, id } = source; + + return dispatch({ + type: "BLACKBOX", + source, + [_promise.PROMISE]: client.blackBox(id, isBlackBoxed) + }); + }; +} /* 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 . */ + +/** + * Redux actions for the sources state + * @module actions/sources + */ + +/***/ }), +/* 436 */ +/***/ (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; }; /* 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 . */ + +/** + * Redux actions for the sources state + * @module actions/sources + */ + +exports.selectSourceURL = selectSourceURL; +exports.selectSource = selectSource; +exports.selectLocation = selectLocation; +exports.jumpToMappedLocation = jumpToMappedLocation; +exports.jumpToMappedSelectedLocation = jumpToMappedSelectedLocation; + +var _devtoolsSourceMap = __webpack_require__(12); + +var _ast = __webpack_require__(163); + +var _ui = __webpack_require__(77); + +var _prettyPrint = __webpack_require__(162); + +var _tabs = __webpack_require__(227); + +var _loadSourceText = __webpack_require__(76); + +var _prefs = __webpack_require__(10); + +var _source = __webpack_require__(9); + +var _location = __webpack_require__(442); + +var _sourceMaps = __webpack_require__(158); + +var _selectors = __webpack_require__(1); + +/** + * 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, options = {}) { + return async ({ dispatch, getState }) => { + const source = (0, _selectors.getSourceByURL)(getState(), url); + if (source) { + const sourceId = source.get("id"); + const location = (0, _location.createLocation)(_extends({}, options.location, { sourceId })); + // flow is unable to comprehend that if an options.location object + // exists, that we have a valid Location object, and if it doesnt, + // we have a valid { sourceId: string } object. So we are overriding + // the error + // $FlowIgnore + await dispatch(selectLocation(location, options.tabIndex)); + } else { + dispatch({ + type: "SELECT_SOURCE_URL", + url: url, + tabIndex: options.tabIndex, + location: options.location + }); + } + }; +} + +/** + * @memberof actions/sources + * @static + */ +function selectSource(sourceId, tabIndex = "") { + return async ({ dispatch }) => { + const location = (0, _location.createLocation)({ sourceId }); + return await dispatch(selectLocation(location, tabIndex)); + }; +} + +/** + * @memberof actions/sources + * @static + */ +function selectLocation(location, tabIndex = "") { + return async ({ dispatch, getState, 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; + } + + const source = (0, _selectors.getSource)(getState(), location.sourceId); + if (!source) { + // If there is no source we deselect the current selected source + return dispatch({ type: "CLEAR_SELECTED_SOURCE" }); + } + + const activeSearch = (0, _selectors.getActiveSearch)(getState()); + if (activeSearch !== "file") { + dispatch((0, _ui.closeActiveSearch)()); + } + + dispatch((0, _tabs.addTab)(source.toJS(), 0)); + + dispatch({ + type: "SELECT_SOURCE", + source: source.toJS(), + tabIndex, + location + }); + + await dispatch((0, _loadSourceText.loadSourceText)(source)); + const selectedSource = (0, _selectors.getSelectedSource)(getState()); + if (!selectedSource) { + return; + } + + const sourceId = selectedSource.get("id"); + if (_prefs.prefs.autoPrettyPrint && !(0, _selectors.getPrettySource)(getState(), sourceId) && (0, _source.shouldPrettyPrint)(selectedSource) && (0, _source.isMinified)(selectedSource)) { + await dispatch((0, _prettyPrint.togglePrettyPrint)(sourceId)); + dispatch((0, _tabs.closeTab)(source.get("url"))); + } + + dispatch((0, _ast.setSymbols)(sourceId)); + dispatch((0, _ast.setOutOfScopeLocations)()); + }; +} + +/** + * @memberof actions/sources + * @static + */ +function jumpToMappedLocation(location) { + return async function ({ dispatch, getState, client, sourceMaps }) { + if (!client) { + return; + } + + const source = (0, _selectors.getSource)(getState(), location.sourceId); + let pairedLocation; + if ((0, _devtoolsSourceMap.isOriginalId)(location.sourceId)) { + pairedLocation = await (0, _sourceMaps.getGeneratedLocation)(getState(), source.toJS(), location, sourceMaps); + } else { + pairedLocation = await sourceMaps.getOriginalLocation(location, source.toJS()); + } + + return dispatch(selectLocation(_extends({}, pairedLocation))); + }; +} + +function jumpToMappedSelectedLocation() { + return async function ({ dispatch, getState }) { + const location = (0, _selectors.getSelectedLocation)(getState()); + await dispatch(jumpToMappedLocation(location)); + }; +} + +/***/ }), +/* 437 */ +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE_437__; + +/***/ }), +/* 438 */ +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE_438__; + +/***/ }), +/* 439 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getTokenLocation = getTokenLocation; +/* 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 . */ + +function getTokenLocation(codeMirror, tokenEl) { + const { left, top, width, height } = tokenEl.getBoundingClientRect(); + const { line, ch } = codeMirror.coordsChar({ + left: left + width / 2, + top: top + height / 2 + }); + + return { + line: line + 1, + column: ch + }; +} + +/***/ }), +/* 440 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.buildQuery = undefined; +exports.getMatchIndex = getMatchIndex; +exports.removeOverlay = removeOverlay; +exports.find = find; +exports.findNext = findNext; +exports.findPrev = findPrev; + +var _buildQuery = __webpack_require__(164); + +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) { + const regexQuery = (0, _buildQuery2.default)(query, modifiers, { isGlobal: true }); + return cm.getSearchCursor(regexQuery, pos); +} + +/** + * @memberof utils/source-search + * @static + */ +/* 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 . */ + +function SearchState() { + this.posFrom = this.posTo = this.query = null; + this.overlay = null; + this.results = []; +} + +/** + * @memberof utils/source-search + * @static + */ +function getSearchState(cm, query, modifiers) { + const 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) { + const 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; + const 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) { + const { cm } = ctx; + if (!cm) { + return; + } + const defaultIndex = { line: -1, ch: -1 }; + + return cm.operation(function () { + if (!query || isWhitespace(query)) { + clearSearch(cm, query, modifiers); + return; + } + + const state = getSearchState(cm, query, modifiers); + const isNewQuery = state.query !== query; + state.query = query; + + updateOverlay(cm, state, query, modifiers); + updateCursor(cm, state, keepSelection); + const 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) { + const { cm, ed } = ctx; + let nextMatch; + cm.operation(function () { + const state = getSearchState(cm, query, modifiers); + const pos = getCursorPos(newQuery, rev, state); + + if (!state.query) { + return; + } + + let cursor = getSearchCursor(cm, state.query, pos, modifiers); + + const 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) { + const state = getSearchState(ctx.cm, query, modifiers); + ctx.cm.removeOverlay(state.overlay); + const { line, ch } = ctx.cm.getCursor(); + 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) { + const 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; + +/***/ }), +/* 441 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createEditor = createEditor; + +var _sourceEditor = __webpack_require__(229); + +var _sourceEditor2 = _interopRequireDefault(_sourceEditor); + +var _prefs = __webpack_require__(10); + +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 . */ + +function createEditor() { + const gutters = ["breakpoints", "hit-markers", "CodeMirror-linenumbers"]; + + if (_prefs.features.codeFolding) { + gutters.push("CodeMirror-foldgutter"); + } + + return new _sourceEditor2.default({ + mode: "javascript", + foldGutter: _prefs.features.codeFolding, + enableCodeFolding: _prefs.features.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 + } + }); +} + +/***/ }), +/* 442 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createLocation = createLocation; +function createLocation({ + sourceId, + line, + column, + sourceUrl +}) { + return { + sourceId, + line, + column, + sourceUrl: sourceUrl || null + }; +} + +/***/ }), +/* 443 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getPauseReason = getPauseReason; +exports.isException = isException; +exports.isInterrupted = isInterrupted; +exports.inDebuggerEval = inDebuggerEval; + + +// Map protocol pause "why" reason to a valid L10N key +// These are the known unhandled reasons: +// "breakpointConditionThrown", "clientEvaluated" +// "interrupted", "attached" +const 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" +}; /* 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 . */ + +function getPauseReason(why) { + if (!why) { + return null; + } + + const reasonType = why.type; + if (!reasons[reasonType]) { + console.log("Please file an issue: reasonType=", reasonType); + } + return reasons[reasonType]; +} + +function isException(why) { + return why && why.type && why.type === "exception"; +} + +function isInterrupted(why) { + return why && why.type && why.type === "interrupted"; +} + +function inDebuggerEval(why) { + if (why && why.type === "exception" && why.exception && why.exception.preview && why.exception.preview.fileName) { + return why.exception.preview.fileName === "debugger eval code"; + } + + return false; +} + +/***/ }), +/* 444 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.shouldStep = shouldStep; + +var _lodash = __webpack_require__(11); + +var _devtoolsSourceMap = __webpack_require__(12); + +var _selectors = __webpack_require__(1); + +var _parser = __webpack_require__(31); + +/* 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 . */ + +async function shouldStep(rootFrame, state, sourceMaps) { + if (!rootFrame) { + return false; + } + + const selectedSource = (0, _selectors.getSelectedSource)(state); + const previousFrameInfo = (0, _selectors.getPreviousPauseFrameLocation)(state); + + let previousFrameLoc; + let currentFrameLoc; + + if (selectedSource && (0, _devtoolsSourceMap.isOriginalId)(selectedSource.get("id"))) { + currentFrameLoc = rootFrame.location; + previousFrameLoc = previousFrameInfo && previousFrameInfo.location; + } else { + currentFrameLoc = rootFrame.generatedLocation; + previousFrameLoc = previousFrameInfo && previousFrameInfo.generatedLocation; + } + + return (0, _devtoolsSourceMap.isOriginalId)(currentFrameLoc.sourceId) && (previousFrameLoc && (0, _lodash.isEqual)(previousFrameLoc, currentFrameLoc) || (await (0, _parser.isInvalidPauseLocation)(currentFrameLoc))); +} + +/***/ }), +/* 445 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.resumed = resumed; + +var _selectors = __webpack_require__(1); + +var _expressions = __webpack_require__(75); + +var _pause = __webpack_require__(78); + +/** + * Debugger has just resumed + * + * @memberof actions/pause + * @static + */ +function resumed() { + return async ({ dispatch, client, getState }) => { + const why = (0, _selectors.getPauseReason)(getState()); + const wasPausedInEval = (0, _pause.inDebuggerEval)(why); + + if (!(0, _selectors.isStepping)(getState()) && !wasPausedInEval) { + await dispatch((0, _expressions.evaluateExpressions)()); + } + + dispatch({ + type: "RESUME" + }); + }; +} /* 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 . */ + +/***/ }), +/* 446 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.continueToHere = continueToHere; + +var _selectors = __webpack_require__(1); + +var _breakpoints = __webpack_require__(59); + +var _commands = __webpack_require__(160); + +function continueToHere(line) { + return async function ({ dispatch, getState }) { + const source = (0, _selectors.getSelectedSource)(getState()).toJS(); + + await dispatch((0, _breakpoints.addHiddenBreakpoint)({ + line, + column: undefined, + sourceId: source.id + })); + + dispatch((0, _commands.resume)()); + }; +} /* 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 . */ + +/***/ }), +/* 447 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.breakOnNext = breakOnNext; + + +/** + * 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 ({ dispatch, client }) => { + client.breakOnNext(); + + return dispatch({ + type: "BREAK_ON_NEXT", + value: true + }); + }; +} /* 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 . */ + +/***/ }), +/* 448 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.setPopupObjectProperties = setPopupObjectProperties; + +var _selectors = __webpack_require__(1); + +/** + * @memberof actions/pause + * @static + */ +function setPopupObjectProperties(object, properties) { + return ({ dispatch, client, getState }) => { + const objectId = object.actor || object.objectId; + + if ((0, _selectors.getPopupObjectProperties)(getState(), object.actor)) { + return; + } + + dispatch({ + type: "SET_POPUP_OBJECT_PROPERTIES", + objectId, + properties + }); + }; +} /* 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 . */ + +/***/ }), +/* 449 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.pauseOnExceptions = pauseOnExceptions; + +var _promise = __webpack_require__(33); + +/** + * + * @memberof actions/pause + * @static + */ +function pauseOnExceptions(shouldPauseOnExceptions, shouldIgnoreCaughtExceptions) { + return ({ dispatch, client }) => { + dispatch({ + type: "PAUSE_ON_EXCEPTIONS", + shouldPauseOnExceptions, + shouldIgnoreCaughtExceptions, + [_promise.PROMISE]: client.pauseOnExceptions(shouldPauseOnExceptions, shouldIgnoreCaughtExceptions) + }); + }; +} /* 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 . */ + +/***/ }), +/* 450 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.selectFrame = selectFrame; + +var _sources = __webpack_require__(34); + +var _expressions = __webpack_require__(75); + +var _fetchScopes = __webpack_require__(161); + +/** + * @memberof actions/pause + * @static + */ +function selectFrame(frame) { + return async ({ dispatch, client, getState, sourceMaps }) => { + dispatch({ + type: "SELECT_FRAME", + frame + }); + + dispatch((0, _sources.selectLocation)(frame.location)); + + dispatch((0, _expressions.evaluateExpressions)()); + dispatch((0, _fetchScopes.fetchScopes)()); + }; +} /* 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 . */ + +/***/ }), +/* 451 */ +/***/ (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__(15); + +var _sourceQueue = __webpack_require__(156); + +var _sourceQueue2 = _interopRequireDefault(_sourceQueue); + +var _sources = __webpack_require__(32); + +var _utils = __webpack_require__(72); + +var _sources2 = __webpack_require__(34); + +var _debuggee = __webpack_require__(231); + +var _parser = __webpack_require__(31); + +var _wasm = __webpack_require__(105); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Redux actions for the navigation state + * @module actions/navigation + */ + +/** + * @memberof actions/navigation + * @static + */ +/* 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 . */ + +function willNavigate(_, event) { + return async function ({ dispatch, getState, client, sourceMaps }) { + await sourceMaps.clearSourceMaps(); + (0, _wasm.clearWasmStates)(); + (0, _editor.clearDocuments)(); + (0, _parser.clearSymbols)(); + (0, _parser.clearASTs)(); + (0, _parser.clearScopes)(); + (0, _parser.clearSources)(); + dispatch(navigate(event.url)); + }; +} + +function navigate(url) { + _sourceQueue2.default.clear(); + + return { + type: "NAVIGATE", + url + }; +} + +function connect(url, canRewind) { + return async function ({ dispatch }) { + await dispatch((0, _debuggee.updateWorkers)()); + dispatch({ type: "CONNECT", url, canRewind }); + }; +} + +/** + * @memberof actions/navigation + * @static + */ +function navigated() { + return async function ({ dispatch, getState, client }) { + await (0, _utils.waitForMs)(100); + if ((0, _sources.getSources)(getState()).size == 0) { + const sources = await client.fetchSources(); + dispatch((0, _sources2.newSources)(sources)); + } + }; +} + +/***/ }), +/* 452 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.doSearch = doSearch; +exports.setFileSearchQuery = setFileSearchQuery; +exports.toggleFileSearchModifier = toggleFileSearchModifier; +exports.updateSearchResults = updateSearchResults; +exports.searchContents = searchContents; +exports.traverseResults = traverseResults; +exports.closeFileSearch = closeFileSearch; + +var _editor = __webpack_require__(15); + +var _search = __webpack_require__(157); + +var _selectors = __webpack_require__(1); + +var _ui = __webpack_require__(77); + +/* 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 . */ + +function doSearch(query, editor) { + return ({ getState, dispatch }) => { + const selectedSource = (0, _selectors.getSelectedSource)(getState()); + if (!selectedSource || !selectedSource.get("text")) { + return; + } + + dispatch(setFileSearchQuery(query)); + dispatch(searchContents(query, editor)); + }; +} + +function setFileSearchQuery(query) { + return { + type: "UPDATE_FILE_SEARCH_QUERY", + query + }; +} + +function toggleFileSearchModifier(modifier) { + return { type: "TOGGLE_FILE_SEARCH_MODIFIER", modifier }; +} + +function updateSearchResults(characterIndex, line, matches) { + const matchIndex = matches.findIndex(elm => elm.line === line && elm.ch === characterIndex); + + return { + type: "UPDATE_SEARCH_RESULTS", + results: { + matches, + matchIndex, + count: matches.length, + index: characterIndex + } + }; +} + +function searchContents(query, editor) { + return async ({ getState, dispatch }) => { + const modifiers = (0, _selectors.getFileSearchModifiers)(getState()); + const selectedSource = (0, _selectors.getSelectedSource)(getState()); + + if (!query || !editor || !selectedSource || !selectedSource.get("text") || !modifiers) { + return; + } + + const ctx = { ed: editor, cm: editor.codeMirror }; + const _modifiers = modifiers.toJS(); + const matches = await (0, _search.getMatches)(query, selectedSource.get("text"), _modifiers); + + const res = (0, _editor.find)(ctx, query, true, _modifiers); + if (!res) { + return; + } + + const { ch, line } = res; + + dispatch(updateSearchResults(ch, line, matches)); + }; +} + +function traverseResults(rev, editor) { + return async ({ getState, dispatch }) => { + if (!editor) { + return; + } + + const ctx = { ed: editor, cm: editor.codeMirror }; + + const query = (0, _selectors.getFileSearchQuery)(getState()); + const modifiers = (0, _selectors.getFileSearchModifiers)(getState()); + const { matches } = (0, _selectors.getFileSearchResults)(getState()); + + if (query === "") { + dispatch((0, _ui.setActiveSearch)("file")); + } + + if (modifiers) { + const matchedLocations = matches || []; + const results = rev ? (0, _editor.findPrev)(ctx, query, true, modifiers.toJS()) : (0, _editor.findNext)(ctx, query, true, modifiers.toJS()); + + if (!results) { + return; + } + const { ch, line } = results; + dispatch(updateSearchResults(ch, line, matchedLocations)); + } + }; +} + +function closeFileSearch(editor) { + return ({ getState, dispatch }) => { + const modifiers = (0, _selectors.getFileSearchModifiers)(getState()); + const query = (0, _selectors.getFileSearchQuery)(getState()); + + if (editor && modifiers) { + const ctx = { ed: editor, cm: editor.codeMirror }; + (0, _editor.removeOverlay)(ctx, query, modifiers.toJS()); + } + + dispatch(setFileSearchQuery("")); + dispatch((0, _ui.closeActiveSearch)()); + dispatch((0, _ui.clearHighlightLineRange)()); + }; +} + +/***/ }), +/* 453 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.recordCoverage = recordCoverage; +function recordCoverage() { + return async function ({ dispatch, getState, client }) { + const { coverage } = await client.recordCoverage(); + + return dispatch({ + type: "RECORD_COVERAGE", + value: { coverage } + }); + }; +} /* 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 . */ + +/***/ }), +/* 454 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.addSearchQuery = addSearchQuery; +exports.clearSearchQuery = clearSearchQuery; +exports.clearSearchResults = clearSearchResults; +exports.clearSearch = clearSearch; +exports.updateSearchStatus = updateSearchStatus; +exports.closeProjectSearch = closeProjectSearch; +exports.searchSources = searchSources; +exports.searchSource = searchSource; + +var _search = __webpack_require__(157); + +var _selectors = __webpack_require__(1); + +var _source = __webpack_require__(9); + +var _sources = __webpack_require__(34); + +var _projectTextSearch = __webpack_require__(102); + +function addSearchQuery(query) { + return { type: "ADD_QUERY", query }; +} /* 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 . */ + +/** + * Redux actions for the search state + * @module actions/search + */ + +function clearSearchQuery() { + return { type: "CLEAR_QUERY" }; +} + +function clearSearchResults() { + return { type: "CLEAR_SEARCH_RESULTS" }; +} + +function clearSearch() { + return { type: "CLEAR_SEARCH" }; +} + +function updateSearchStatus(status) { + return { type: "UPDATE_STATUS", status }; +} + +function closeProjectSearch() { + return { type: "CLOSE_PROJECT_SEARCH" }; +} + +function searchSources(query) { + return async ({ dispatch, getState }) => { + await dispatch(clearSearchResults()); + await dispatch(addSearchQuery(query)); + dispatch(updateSearchStatus(_projectTextSearch.statusType.fetching)); + const sources = (0, _selectors.getSources)(getState()); + const validSources = sources.valueSeq().filter(source => !(0, _selectors.hasPrettySource)(getState(), source.get("id")) && !(0, _source.isThirdParty)(source)); + for (const source of validSources) { + await dispatch((0, _sources.loadSourceText)(source)); + await dispatch(searchSource(source.get("id"), query)); + } + dispatch(updateSearchStatus(_projectTextSearch.statusType.done)); + }; +} + +function searchSource(sourceId, query) { + return async ({ dispatch, getState }) => { + const sourceRecord = (0, _selectors.getSource)(getState(), sourceId); + if (!sourceRecord) { + return; + } + + const matches = await (0, _search.findSourceMatches)(sourceRecord.toJS(), query); + if (!matches.length) { + return; + } + dispatch({ + type: "ADD_SEARCH_RESULT", + result: { + sourceId: sourceRecord.get("id"), + filepath: sourceRecord.get("url"), + matches + } + }); + }; +} + +/***/ }), +/* 455 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.timeTravelTo = timeTravelTo; +exports.clearHistory = clearHistory; + +var _selectors = __webpack_require__(1); + +var _sources = __webpack_require__(34); + +/* 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 . */ + +/** + * Redux actions for replay + * @module actions/replay + */ + +function timeTravelTo(position) { + return ({ dispatch, getState }) => { + const data = (0, _selectors.getHistoryFrame)(getState(), position); + dispatch({ + type: "TRAVEL_TO", + data, + position + }); + dispatch((0, _sources.selectLocation)(data.paused.frames[0].location)); + }; +} + +function clearHistory() { + return ({ dispatch, getState }) => { + dispatch({ + type: "CLEAR_HISTORY" + }); + }; +} + +/***/ }), +/* 456 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.setQuickOpenQuery = setQuickOpenQuery; +exports.openQuickOpen = openQuickOpen; +exports.closeQuickOpen = closeQuickOpen; +function setQuickOpenQuery(query) { + return { + type: "SET_QUICK_OPEN_QUERY", + query + }; +} /* 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 . */ + +function openQuickOpen(query) { + if (query != null) { + return { type: "OPEN_QUICK_OPEN", query }; + } + return { type: "OPEN_QUICK_OPEN" }; +} + +function closeQuickOpen() { + return { type: "CLOSE_QUICK_OPEN" }; +} + +/***/ }), +/* 457 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.openLink = openLink; +exports.openWorkerToolbox = openWorkerToolbox; +exports.evaluateInConsole = evaluateInConsole; +/* 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 . */ + +const { isDevelopment } = __webpack_require__(13); +const { getSelectedFrameId } = __webpack_require__(1); + +/** + * @memberof actions/toolbox + * @static + */ +function openLink(url) { + return async function ({ openLink: openLinkCommand }) { + if (isDevelopment()) { + const win = window.open(url, "_blank"); + win.focus(); + } else { + openLinkCommand(url); + } + }; +} + +function openWorkerToolbox(worker) { + return async function ({ + getState, + openWorkerToolbox: openWorkerToolboxCommand + }) { + if (isDevelopment()) { + alert(worker.url); + } else { + openWorkerToolboxCommand(worker); + } + }; +} + +function evaluateInConsole(inputString) { + return async ({ client, getState }) => { + const frameId = getSelectedFrameId(getState()); + client.evaluate(`console.log("${inputString}"); console.log(${inputString})`, { frameId }); + }; +} + +/***/ }), +/* 458 */ +/***/ (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; }; /* 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 . */ + +exports.updatePreview = updatePreview; +exports.setPreview = setPreview; +exports.clearPreview = clearPreview; + +var _ast = __webpack_require__(459); + +var _editor = __webpack_require__(15); + +var _preview = __webpack_require__(233); + +var _devtoolsSourceMap = __webpack_require__(12); + +var _promise = __webpack_require__(33); + +var _getExpression = __webpack_require__(460); + +var _selectors = __webpack_require__(1); + +var _expressions = __webpack_require__(75); + +var _lodash = __webpack_require__(11); + +async function getReactProps(evaluate) { + const reactDisplayName = await evaluate("this._reactInternalInstance.getName()"); + + return { + displayName: reactDisplayName.result + }; +} + +async function getImmutableProps(expression, evaluate) { + const immutableEntries = await evaluate((exp => `${exp}.toJS()`)(expression)); + + const immutableType = await evaluate((exp => `${exp}.constructor.name`)(expression)); + + return { + type: immutableType.result, + entries: immutableEntries.result + }; +} + +async function getExtraProps(expression, result, evaluate) { + const props = {}; + if ((0, _preview.isReactComponent)(result)) { + props.react = await getReactProps(evaluate); + } + + if ((0, _preview.isImmutable)(result)) { + props.immutable = await getImmutableProps(expression, evaluate); + } + + return props; +} + +function isInvalidTarget(target) { + if (!target || !target.innerText) { + return true; + } + + const tokenText = target.innerText.trim(); + const cursorPos = target.getBoundingClientRect(); + + // exclude literal tokens where it does not make sense to show a preview + const invaildType = ["cm-string", "cm-number", "cm-atom"].includes(target.className); + + // exclude syntax where the expression would be a syntax error + const invalidToken = tokenText === "" || tokenText.match(/[(){}\|&%,.;=<>\+-/\*\s]/); + + // exclude codemirror elements that are not tokens + const invalidTarget = target.parentElement && !target.parentElement.closest(".CodeMirror-line") || cursorPos.top == 0; + + return invalidTarget || invalidToken || invaildType; +} + +function updatePreview(target, editor) { + return ({ dispatch, getState, client, sourceMaps }) => { + const tokenText = target.innerText ? target.innerText.trim() : ""; + const tokenPos = (0, _editor.getTokenLocation)(editor.codeMirror, target); + const cursorPos = target.getBoundingClientRect(); + const preview = (0, _selectors.getPreview)(getState()); + + if (preview) { + // Return early if we are currently showing another preview or + // if we are mousing over the same token as before + if (preview.updating || (0, _lodash.isEqual)(preview.tokenPos, tokenPos)) { + return; + } + + // We are mousing over a new token that is not in the preview + if (!target.classList.contains("debug-expression")) { + dispatch(clearPreview()); + } + } + + if (isInvalidTarget(target)) { + return; + } + + if (!(0, _selectors.isLineInScope)(getState(), tokenPos.line)) { + return; + } + + const source = (0, _selectors.getSelectedSource)(getState()); + const symbols = (0, _selectors.getSymbols)(getState(), source.toJS()); + + let match; + if (!symbols || symbols.identifiers) { + match = (0, _ast.findBestMatchExpression)(symbols, tokenPos, tokenText); + } else { + match = (0, _getExpression.getExpressionFromCoords)(editor.codeMirror, tokenPos); + } + + if (!match || !match.expression) { + return; + } + + const { expression, location } = match; + dispatch(setPreview(expression, location, tokenPos, cursorPos)); + }; +} + +function setPreview(expression, location, tokenPos, cursorPos) { + return async ({ dispatch, getState, client, sourceMaps }) => { + await dispatch({ + type: "SET_PREVIEW", + [_promise.PROMISE]: async function () { + const source = (0, _selectors.getSelectedSource)(getState()); + + const sourceId = source.get("id"); + if (location && !(0, _devtoolsSourceMap.isGeneratedId)(sourceId)) { + const generatedLocation = await sourceMaps.getGeneratedLocation(_extends({}, location.start, { sourceId }), source.toJS()); + + expression = await (0, _expressions.getMappedExpression)({ sourceMaps }, generatedLocation, expression); + } + + const selectedFrame = (0, _selectors.getSelectedFrame)(getState()); + if (!selectedFrame) { + return; + } + + const { result } = await client.evaluateInFrame(selectedFrame.id, expression); + + if (result === undefined) { + return; + } + + const extra = await getExtraProps(expression, result, expr => client.evaluateInFrame(selectedFrame.id, expr)); + + return { + expression, + result, + location, + tokenPos, + cursorPos, + extra + }; + }() + }); + }; +} + +function clearPreview() { + return ({ dispatch, getState, client }) => { + const currentSelection = (0, _selectors.getPreview)(getState()); + if (!currentSelection) { + return; + } + + return dispatch({ + type: "CLEAR_SELECTION" + }); + }; +} + +/***/ }), +/* 459 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.findBestMatchExpression = findBestMatchExpression; +/* 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 . */ + +function findBestMatchExpression(symbols, tokenPos, token) { + const { memberExpressions, identifiers } = symbols; + const { line, column } = tokenPos; + return identifiers.concat(memberExpressions).reduce((found, expression) => { + const overlaps = expression.location.start.line == line && expression.location.start.column <= column && expression.location.end.column >= column && !expression.computed; + + if (overlaps) { + return expression; + } + + return found; + }, {}); +} + +/***/ }), +/* 460 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.tokenAtTextPosition = tokenAtTextPosition; +exports.getExpressionFromCoords = getExpressionFromCoords; +/* 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 . */ + +function tokenAtTextPosition(cm, { line, column }) { + if (line < 0 || line >= cm.lineCount()) { + return null; + } + + const token = cm.getTokenAt({ line: line - 1, ch: column }); + if (!token) { + return null; + } + + return { startColumn: token.start, endColumn: token.end, type: token.type }; +} + +// The strategy of querying codeMirror tokens was borrowed +// from Chrome's inital implementation in JavaScriptSourceFrame.js#L414 +function getExpressionFromCoords(cm, coord) { + const token = tokenAtTextPosition(cm, coord); + if (!token) { + return null; + } + + let startHighlight = token.startColumn; + const endHighlight = token.endColumn; + const lineNumber = coord.line; + const line = cm.doc.getLine(coord.line - 1); + while (startHighlight > 1 && line.charAt(startHighlight - 1) === ".") { + const tokenBefore = tokenAtTextPosition(cm, { + line: coord.line, + column: startHighlight - 2 + }); + + if (!tokenBefore || !tokenBefore.type) { + return null; + } + + startHighlight = tokenBefore.startColumn; + } + const expression = line.substring(startHighlight, endHighlight); + + if (!expression) { + return null; + } + + const location = { + start: { line: lineNumber, column: startHighlight }, + end: { line: lineNumber, column: endHighlight } + }; + return { expression, location }; +} + +/***/ }), +/* 461 */ +/***/ (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__(166); + +var _Modal2 = _interopRequireDefault(_Modal); + +var _classnames = __webpack_require__(6); + +var _classnames2 = _interopRequireDefault(_classnames); + +var _text = __webpack_require__(107); + +__webpack_require__(465); + +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"))), + this.renderShorcutItem(L10N.getStr("shortcuts.gotoLine"), (0, _text.formatKeyShortcut)(L10N.getStr("gotoLineModal.key2"))) + ); + } + + 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() { + const { enabled } = this.props; + + if (!enabled) { + return null; + } + + return _react2.default.createElement( + _Modal2.default, + { + "in": enabled, + additionalClass: "shortcuts-modal", + handleClose: this.props.handleClose + }, + this.renderShortcutsContent() + ); + } +} +exports.ShortcutsModal = ShortcutsModal; /* 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 . */ + +/***/ }), +/* 462 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -24796,7 +36812,7 @@ module.exports = { exports.__esModule = true; exports.EXITING = exports.ENTERED = exports.ENTERING = exports.EXITED = exports.UNMOUNTED = undefined; -var _propTypes = __webpack_require__(3299); +var _propTypes = __webpack_require__(2); var PropTypes = _interopRequireWildcard(_propTypes); @@ -24804,11 +36820,11 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _reactDom = __webpack_require__(4); +var _reactDom = __webpack_require__(39); var _reactDom2 = _interopRequireDefault(_reactDom); -var _PropTypes = __webpack_require__(335); +var _PropTypes = __webpack_require__(463); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -25350,2463 +37366,7 @@ Transition.EXITING = 4; exports.default = Transition; /***/ }), - -/***/ 3330: -/***/ (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); - -/***/ }), - -/***/ 3331: -/***/ (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/. */ - -const Menu = __webpack_require__(3332); -const MenuItem = __webpack_require__(3334); -const { PrefsHelper } = __webpack_require__(3335); -const Services = __webpack_require__(22); -const KeyShortcuts = __webpack_require__(3336); -const { ZoomKeys } = __webpack_require__(3337); -const EventEmitter = __webpack_require__(3233); - -module.exports = { - KeyShortcuts, - Menu, - MenuItem, - PrefsHelper, - Services, - ZoomKeys, - EventEmitter -}; - -/***/ }), - -/***/ 3332: -/***/ (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/. */ - -const EventEmitter = __webpack_require__(3233); - -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({ id = null } = {}) { - 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) { - let doc = toolbox.doc; - let 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. - let 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) { - let doc = parent.ownerDocument; - this.menuitems.forEach(item => { - if (!item.visible) { - return; - } - - if (item.submenu) { - let menupopup = doc.createElement("menupopup"); - item.submenu._createMenuItems(menupopup); - - let menuitem = doc.createElement("menuitem"); - menuitem.setAttribute("label", item.label); - if (!inToolbox()) { - menuitem.textContent = item.label; - } - - let 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") { - let menusep = doc.createElement("menuseparator"); - parent.appendChild(menusep); - } else { - let 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; - -/***/ }), - -/***/ 3333: -/***/ (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`. - */ - -let 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; - -/***/ }), - -/***/ 3334: -/***/ (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({ - accesskey = null, - checked = false, - click = () => {}, - disabled = false, - label = "", - id = null, - submenu = null, - type = "normal", - visible = true -} = {}) { - 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; - -/***/ }), - -/***/ 3335: -/***/ (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/. */ - -const Services = __webpack_require__(22); -const EventEmitter = __webpack_require__(3233); - -/** - * 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(prefsRoot = "", prefsBlueprint = {}) { - EventEmitter.decorate(this); - - let cache = new Map(); - - for (let accessorName in prefsBlueprint) { - let [prefType, prefName, prefDefault] = prefsBlueprint[accessorName]; - map(this, cache, accessorName, prefType, prefsRoot, prefName, prefDefault); - } - - let 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) { - let cachedPref = cache.get(prefName); - if (cachedPref !== undefined) { - return cachedPref; - } - let 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, serializer = { 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 (let accessorName in prefsBlueprint) { - let [, prefName] = prefsBlueprint[accessorName]; - 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. - let accessorName = accessorNameForPref(prefName, prefsBlueprint); - if (!(accessorName in self)) { - return; - } - cache.delete(prefName); - self.emit("pref-changed", accessorName, self[accessorName]); - } - }; -} - -exports.PrefsHelper = PrefsHelper; - -/***/ }), - -/***/ 3336: -/***/ (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/. */ - -const { appinfo } = __webpack_require__(22); -const EventEmitter = __webpack_require__(3233); -const isOSX = appinfo.OS === "Darwin"; - -// List of electron keys mapped to DOM API (DOM_VK_*) key code -const 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({ window, 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) { - let modifiers = str.split("+"); - let key = modifiers.pop(); - - let shortcut = { - ctrl: false, - meta: false, - alt: false, - shift: false, - // Set for character keys - key: undefined, - // Set for non-character keys - keyCode: undefined - }; - for (let 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) { - let 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"); - } - let key; - 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. - let 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 (let [key, shortcut] of this.keys) { - 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)) { - let 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; - -/***/ }), - -/***/ 3337: -/***/ (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) {}; - -/***/ }), - -/***/ 3338: -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), - -/***/ 3339: -/***/ (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/. */ - -const firefox = __webpack_require__(3340); -const chrome = __webpack_require__(3341); - -function startDebugging(connTarget) { - if (connTarget.type === "node") { - return startDebuggingNode(connTarget.param); - } - - return startDebuggingTab(connTarget); -} - -async function startDebuggingNode(tabId) { - const clientType = "node"; - const tabs = await chrome.connectNodeClient(); - if (!tabs) { - return {}; - } - - const tab = tabs.find(t => t.id.indexOf(tabId) !== -1); - - if (!tab) { - return {}; - } - - const tabConnection = await chrome.connectNode(tab.tab); - chrome.initPage({ clientType, tabConnection }); - - return { tabs, tab, clientType, client: chrome, tabConnection }; -} - -async function startDebuggingTab(connTarget) { - let clientType = connTarget.type; - const client = clientType === "chrome" ? chrome : firefox; - - const tabs = await client.connectClient(); - - if (!tabs) { - return undefined; - } - - const tab = tabs.find(t => t.id.indexOf(connTarget.param) !== -1); - if (!tab) { - return undefined; - } - - const tabConnection = await client.connectTab(tab.tab); - - client.initPage({ tab, clientType, tabConnection }); - - return { tab, tabConnection }; -} - -module.exports = { - startDebugging, - firefox, - chrome -}; - -/***/ }), - -/***/ 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; -}; - - -/***/ }), - -/***/ 3340: -/***/ (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/. */ - -const { - DebuggerClient, - DebuggerTransport, - TargetFactory, - WebsocketTransport -} = __webpack_require__(52); - -const { getValue } = __webpack_require__(3198); - - -let debuggerClient = null; - -function lookupTabTarget(tab) { - const 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" - }; - }); -} - -async function connectClient() { - const useWebSocket = getValue("firefox.webSocketConnection"); - const firefoxHost = useWebSocket ? getValue("firefox.host") : "localhost"; - const firefoxPort = getValue("firefox.webSocketPort"); - - const socket = new WebSocket(`ws://${firefoxHost}:${firefoxPort}`); - const transport = useWebSocket ? new WebsocketTransport(socket) : new DebuggerTransport(socket); - - debuggerClient = new DebuggerClient(transport); - if (!debuggerClient) { - return []; - } - - try { - await debuggerClient.connect(); - return await getTabs(); - } catch (err) { - console.log(err); - return []; - } -} - -async function connectTab(tab) { - window.addEventListener("beforeunload", () => { - if (tabTarget !== null) { - tabTarget.destroy(); - } - }); - - const tabTarget = await lookupTabTarget(tab); - - const [, threadClient] = await tabTarget.activeTab.attachThread({ - ignoreFrameEnvironment: true - }); - - threadClient.resume(); - return { debuggerClient, threadClient, tabTarget }; -} - -async function getTabs() { - if (!debuggerClient || !debuggerClient.mainRoot) { - return undefined; - } - - const response = await debuggerClient.listTabs(); - return createTabs(response.tabs); -} - -function initPage(options) {} - -module.exports = { - connectClient, - connectTab, - initPage, - getTabs -}; - -/***/ }), - -/***/ 3341: -/***/ (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/. */ - -const CDP = __webpack_require__(52); -const { getValue } = __webpack_require__(3198); -const { networkRequest } = __webpack_require__(3342); - -let connection; - -function createTabs(tabs, { type, 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) { - const { host, port, path } = options; - const url = `http://${host}:${port}${path}`; - - networkRequest(url).then(res => callback(null, res.content)).catch(err => callback(err)); -}; - -async function connectClient() { - if (!getValue("chrome.debug")) { - return createTabs([]); - } - - try { - const tabs = await CDP.List({ - port: getValue("chrome.port"), - host: getValue("chrome.host") - }); - - return createTabs(tabs, { - clientType: "chrome", - type: "page" - }); - } catch (e) { - return []; - } -} - -async function connectNodeClient() { - if (!getValue("node.debug")) { - return createTabs([]); - } - - let tabs; - try { - tabs = await CDP.List({ - port: getValue("node.port"), - host: getValue("node.host") - }); - } catch (e) { - return undefined; - } - - return createTabs(tabs, { - clientType: "node", - type: "node" - }); -} - -async function connectTab(tab) { - const tabConnection = await CDP({ tab: tab.webSocketDebuggerUrl }); - return tabConnection; -} - -async function connectNode(tab) { - const tabConnection = await CDP({ tab: tab.webSocketDebuggerUrl }); - - window.addEventListener("beforeunload", () => { - tabConnection.onclose = function disable() {}; - tabConnection.close(); - }); - - return tabConnection; -} - -function initPage({ tab, clientType, tabConnection }) { - const { Runtime, Page } = tabConnection; - - Runtime.enable(); - - if (clientType == "node") { - Runtime.runIfWaitingForDebugger(); - } - - if (clientType == "chrome") { - Page.enable(); - } - - return connection; -} - -module.exports = { - connectClient, - connectNodeClient, - connectNode, - connectTab, - initPage -}; - -/***/ }), - -/***/ 3342: -/***/ (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__(3343); -const workerUtils = __webpack_require__(3344); - -module.exports = { - networkRequest, - workerUtils -}; - -/***/ }), - -/***/ 3343: -/***/ (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; - -/***/ }), - -/***/ 3344: -/***/ (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) { - 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 -}; - -/***/ }), - -/***/ 3345: -/***/ (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/. */ - -const classnames = __webpack_require__(175); -__webpack_require__(3346); - -module.exports = function (className) { - const root = document.createElement("div"); - root.className = classnames(className); - root.style.setProperty("flex", 1); - return root; -}; - -/***/ }), - -/***/ 3346: -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), - -/***/ 3347: -/***/ (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 */ - -const { createStore, applyMiddleware } = __webpack_require__(3); -const { waitUntilService } = __webpack_require__(3348); -const { log } = __webpack_require__(3349); -const { history } = __webpack_require__(3350); -const { promise } = __webpack_require__(3351); -const { thunk } = __webpack_require__(3355); - -/** - * 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 - */ -const configureStore = (opts = {}) => { - const 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 - const devtoolsExt = typeof window === "object" && window.devToolsExtension ? window.devToolsExtension() : f => f; - - return applyMiddleware(...middleware)(devtoolsExt(createStore)); -}; - -module.exports = configureStore; - -/***/ }), - -/***/ 3348: -/***/ (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. - * } - * } - * ``` - */ -const NAME = exports.NAME = "@@service/waitUntil"; - -function waitUntilService({ dispatch, getState }) { - let pending = []; - - function checkPending(action) { - let readyRequests = []; - let 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 (let request of pending) { - if (request.predicate(action)) { - readyRequests.push(request); - } else { - stillPending.push(request); - } - } - - pending = stillPending; - for (let request of readyRequests) { - request.run(dispatch, getState, action); - } - } - - return next => action => { - if (action.type === NAME) { - pending.push(action); - return null; - } - let result = next(action); - checkPending(action); - return result; - }; -} -exports.waitUntilService = waitUntilService; - -/***/ }), - -/***/ 3349: -/***/ (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({ dispatch, getState }) { - return next => action => { - const actionText = JSON.stringify(action, null, 2); - const truncatedActionText = `${actionText.slice(0, 1000)}...`; - console.log(`[DISPATCH ${action.type}]`, action, truncatedActionText); - next(action); - }; -} - -exports.log = log; - -/***/ }), - -/***/ 335: +/* 463 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -27816,7 +37376,7 @@ exports.__esModule = true; exports.classNamesShape = exports.timeoutsShape = undefined; exports.transitionTimeout = transitionTimeout; -var _propTypes = __webpack_require__(3299); +var _propTypes = __webpack_require__(2); var _propTypes2 = _interopRequireDefault(_propTypes); @@ -27860,7985 +37420,57 @@ var classNamesShape = exports.classNamesShape = _propTypes2.default.oneOfType([_ })]); /***/ }), +/* 464 */ +/***/ (function(module, exports) { -/***/ 3350: -/***/ (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/. */ - -const { isDevelopment } = __webpack_require__(3198); - -/** - * 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 = (log = []) => ({ dispatch, 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); - }; -}; +// removed by extract-text-webpack-plugin /***/ }), +/* 465 */ +/***/ (function(module, exports) { -/***/ 3351: -/***/ (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/. */ - -const { defer } = __webpack_require__(3271); -const { entries, toObject } = __webpack_require__(3352); -const { executeSoon } = __webpack_require__(3353); - -const PROMISE = exports.PROMISE = "@@dispatch/promise"; -let seqIdVal = 1; - -function seqIdGen() { - return seqIdVal++; -} - -function promiseMiddleware({ dispatch, getState }) { - return next => action => { - if (!(PROMISE in action)) { - return next(action); - } - - const promiseInst = action[PROMISE]; - const 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. - const 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; +// removed by extract-text-webpack-plugin /***/ }), +/* 466 */ +/***/ (function(module, exports) { -/***/ 3352: -/***/ (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/. */ - -const co = __webpack_require__(965); - -function asPaused(client, func) { - if (client.state != "paused") { - return co(function* () { - yield client.interrupt(); - let result; - - 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, ...args) { - 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; -} - -let msgId = 1; -function workerTask(worker, method) { - return function (...args) { - return new Promise((resolve, reject) => { - const id = msgId++; - worker.postMessage({ id, method, args }); - - const listener = ({ data: result }) => { - 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; - } - const pairs = []; - for (let 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(([key, value]) => { - 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) { - const obj = {}; - for (let 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(...funcs) { - return (...args) => { - const initialValue = funcs[funcs.length - 1].apply(null, args); - const 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) { - let timeout, _this; - return function (...args) { - _this = this; - if (!timeout) { - timeout = setTimeout(() => { - func.apply(_this, ...args); - timeout = null; - }, ms); - } - }; -} - -module.exports = { - asPaused, - handleError, - promisify, - truncateStr, - endTruncateStr, - workerTask, - zip, - entries, - toObject, - mapObject, - compose, - updateObj, - throttle -}; +// removed by extract-text-webpack-plugin /***/ }), +/* 467 */ +/***/ (function(module, exports) { -/***/ 3353: -/***/ (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/. */ - -const assert = __webpack_require__(3354); - -function reportException(who, exception) { - let msg = `${who} threw an exception: `; - console.error(msg, exception); -} - -function executeSoon(fn) { - setTimeout(fn, 0); -} - -module.exports = { - reportException, - executeSoon, - assert -}; +// removed by extract-text-webpack-plugin /***/ }), +/* 468 */ +/***/ (function(module, exports) { -/***/ 3354: -/***/ (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; +// removed by extract-text-webpack-plugin /***/ }), +/* 469 */ +/***/ (function(module, exports) { -/***/ 3355: -/***/ (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 ({ dispatch, getState }) => { - const args = { dispatch, getState }; - - return next => action => { - return typeof action === "function" ? action(makeArgs ? makeArgs(args, getState()) : args) : next(action); - }; - }; -} -exports.thunk = thunk; +// removed by extract-text-webpack-plugin /***/ }), - -/***/ 3356: +/* 470 */ /***/ (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/. */ - -const tabs = __webpack_require__(3357); -const config = __webpack_require__(3358); - -module.exports = { - tabs, - config -}; - -/***/ }), - -/***/ 3357: -/***/ (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/. */ - -const constants = __webpack_require__(3219); -const Immutable = __webpack_require__(146); -const fromJS = __webpack_require__(3272); - -const initialState = fromJS({ - tabs: {}, - selectedTab: null, - filterString: "" -}); - -function update(state = initialState, action) { - switch (action.type) { - case constants.CLEAR_TABS: - return state.setIn(["tabs"], Immutable.Map()).setIn(["selectedTab"], null); - - case constants.ADD_TABS: - const 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: - const 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) { - let id = tab.id; - const 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; - -/***/ }), - -/***/ 3358: -/***/ (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/. */ - -const constants = __webpack_require__(3219); -const fromJS = __webpack_require__(3272); -const I = __webpack_require__(146); - -const initialState = fromJS({ - config: I.Map() -}); - -function update(state = initialState, action) { - switch (action.type) { - case constants.SET_VALUE: - return state.setIn(["config", ...action.path.split(".")], action.value); - - case constants.SET_CONFIG: - return state.setIn(["config"], fromJS(action.config)); - } - - return state; -} - -module.exports = update; - -/***/ }), - -/***/ 3359: -/***/ (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/. */ const React = __webpack_require__(0); +const ReactDOM = __webpack_require__(39); +const Draggable = React.createFactory(__webpack_require__(471)); const { Component } = React; -const PropTypes = __webpack_require__(20); -const ImPropTypes = __webpack_require__(150); -const { connect } = __webpack_require__(1189); -const { bindActionCreators } = __webpack_require__(3); -const { getTabs, getFilterString, getConfig } = __webpack_require__(3360); -const { getValue } = __webpack_require__(3198); -const LandingPage = React.createFactory(__webpack_require__(3364)); +const PropTypes = __webpack_require__(2); +const dom = __webpack_require__(3); -class LaunchpadApp extends Component { - static get propTypes() { - return { - tabs: ImPropTypes.map.isRequired, - filterString: PropTypes.string, - actions: PropTypes.object, - config: PropTypes.object - }; - } - - render() { - const { - filterString, - actions: { setValue, filterTabs }, config } = this.props; - - 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__(3274), dispatch) - }; -} - -module.exports = connect(mapStateToProps, mapDispatchToProps)(LaunchpadApp); - -/***/ }), - -/***/ 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; - } -}; - - -/***/ }), - -/***/ 3360: -/***/ (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/. */ - -const { score } = __webpack_require__(3361); - -function getTabs(state) { - let tabs = state.tabs.get("tabs"); - let filterString = getFilterString(state); - - if (filterString === "") { - return tabs; - } - - return tabs.map(tab => { - const _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 -}; - -/***/ }), - -/***/ 3361: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) { - -(function () { - var Query, defaultPathSeparator, filter, matcher, parseOptions, pathScorer, preparedQueryCache, scorer; - - filter = __webpack_require__(3362); - - matcher = __webpack_require__(3363); - - scorer = __webpack_require__(3234); - - pathScorer = __webpack_require__(3244); - - Query = __webpack_require__(3273); - - 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(undefined); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(120))) - -/***/ }), - -/***/ 3362: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -(function () { - var Query, pathScorer, pluckCandidates, scorer, sortCandidates; - - scorer = __webpack_require__(3234); - - pathScorer = __webpack_require__(3244); - - Query = __webpack_require__(3273); - - 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(undefined); - -/***/ }), - -/***/ 3363: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -(function () { - var basenameMatch, computeMatch, isMatch, isWordStart, match, mergeMatches, scoreAcronyms, scoreCharacter, scoreConsecutives, _ref; - - _ref = __webpack_require__(3234), 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(undefined); - -/***/ }), - -/***/ 3364: -/***/ (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/. */ - -const React = __webpack_require__(0); - -__webpack_require__(3365); -const { Component } = React; -const PropTypes = __webpack_require__(20); -const dom = __webpack_require__(1758); -const ImPropTypes = __webpack_require__(150); -const configMap = __webpack_require__(3219).sidePanelItems; -const Tabs = React.createFactory(__webpack_require__(3366)); -const Sidebar = React.createFactory(__webpack_require__(3368)); -const Settings = React.createFactory(__webpack_require__(3374)); - -const 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"), "."); -} - -class LandingPage extends Component { - static get propTypes() { - return { - tabs: ImPropTypes.map.isRequired, - supportsFirefox: PropTypes.bool.isRequired, - supportsChrome: PropTypes.bool.isRequired, - title: PropTypes.string.isRequired, - filterString: PropTypes.string, - onFilterChange: PropTypes.func.isRequired, - onTabClick: PropTypes.func.isRequired, - config: PropTypes.object.isRequired, - setValue: PropTypes.func.isRequired - }; - } - - constructor(props) { - super(props); - - this.state = { - selectedPane: configMap.Firefox.name, - firefoxConnected: false, - chromeConnected: false - }; - - this.onFilterChange = this.onFilterChange.bind(this); - this.onSideBarItemClick = this.onSideBarItemClick.bind(this); - this.renderLaunchOptions = this.renderLaunchOptions.bind(this); - this.renderLaunchButton = this.renderLaunchButton.bind(this); - this.renderExperimentalMessage = this.renderExperimentalMessage.bind(this); - this.launchBrowser = this.launchBrowser.bind(this); - this.renderEmptyPanel = this.renderEmptyPanel.bind(this); - this.renderSettings = this.renderSettings.bind(this); - this.renderFilter = this.renderFilter.bind(this); - this.renderPanel = this.renderPanel.bind(this); - } - - 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() { - const { selectedPane } = this.state; - const { name, isUnderConstruction } = configMap[selectedPane]; - - const isConnected = name === configMap.Firefox.name ? this.state.firefoxConnected : this.state.chromeConnected; - const 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); - } - - const 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) : null); - } - - renderExperimentalMessage(browserName) { - const underConstructionMessage = "Debugging is experimental and certain features won't work (i.e, seeing variables, attaching breakpoints)"; // eslint-disable-line max-len - - return dom.div({ className: "under-construction" }, dom.div({ className: "under-construction-message" }, dom.p({}, underConstructionMessage), dom.img({ src: "/assets/under_construction.png" }), dom.a({ - className: "github-link", - 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() { - const { config, setValue } = this.props; - - return dom.div({}, dom.header({}, dom.h1({}, configMap.Settings.name)), Settings({ config, setValue })); - } - - renderFilter() { - const { selectedPane } = this.state; - - const { tabs, filterString = "" } = this.props; - - const { clientType, paramName } = configMap[selectedPane]; - - const 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() { - const { onTabClick, tabs } = this.props; - const { selectedPane } = this.state; - - const { name, clientType, paramName } = configMap[selectedPane]; - - const clientTargets = getTabsByClientType(tabs, clientType); - const tabsDetected = clientTargets && clientTargets.count() > 0; - const targets = clientTargets.filter(t => !t.get("filteredOut")); - - const 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() { - const { supportsFirefox, supportsChrome, title } = this.props; - const { selectedPane } = this.state; - const { onSideBarItemClick } = this; - - const { name, docsUrlPart } = configMap[selectedPane]; - - return dom.div({ - className: "landing-page" - }, Sidebar({ - supportsFirefox, - supportsChrome, - title, - selectedPane, - onSideBarItemClick - }), dom.main({ className: "panel" }, this.renderPanel(), firstTimeMessage(name, docsUrlPart))); - } -} - -module.exports = LandingPage; - -/***/ }), - -/***/ 3365: -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), - -/***/ 3366: -/***/ (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/. */ - -const React = __webpack_require__(0); - -__webpack_require__(3367); -const { Component } = React; -const dom = __webpack_require__(1758); -const PropTypes = __webpack_require__(20); -const classnames = __webpack_require__(175); - -function getTabURL(tab, paramName) { - const tabID = tab.get("id"); - return `/?react_perf&${paramName}=${tabID}`; -} - -class Tabs extends Component { - static get propTypes() { - return { - targets: PropTypes.object.isRequired, - paramName: PropTypes.string.isRequired, - onTabClick: PropTypes.func.isRequired - }; - } - - constructor(props) { - super(props); - this.onTabClick = this.onTabClick.bind(this); - } - - onTabClick(tab, paramName) { - this.props.onTabClick(getTabURL(tab, paramName)); - } - - render() { - const { targets, paramName } = this.props; - - if (!targets || targets.count() == 0) { - return dom.div({}, ""); - } - - let 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; - -/***/ }), - -/***/ 3367: -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), - -/***/ 3368: -/***/ (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/. */ - -const React = __webpack_require__(0); -__webpack_require__(3369); -const { Component } = React; -const dom = __webpack_require__(1758); -const PropTypes = __webpack_require__(20); -const classnames = __webpack_require__(175); -const Svg = __webpack_require__(3370); - -class Sidebar extends Component { - static get propTypes() { - return { - supportsFirefox: PropTypes.bool.isRequired, - supportsChrome: PropTypes.bool.isRequired, - title: PropTypes.string.isRequired, - selectedPane: PropTypes.string.isRequired, - onSideBarItemClick: PropTypes.func.isRequired - }; - } - - constructor(props) { - super(props); - this.renderTitle = this.renderTitle.bind(this); - this.renderItem = this.renderItem.bind(this); - } - - renderTitle(title) { - return dom.div({ className: "title-wrapper" }, dom.h1({}, title), dom.div({ className: "launchpad-container" }, Svg({ name: "rocket" }), 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() { - let 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; - -/***/ }), - -/***/ 3369: -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), - -/***/ 3370: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -const React = __webpack_require__(0); -const { default: InlineSVG } = __webpack_require__(1763); -const { isDevelopment } = __webpack_require__(3198); - -const svg = { - rocket: __webpack_require__(1126) -}; - -function Svg({ name, className, onClick, "aria-label": ariaLabel }) { - className = `${name} ${className || ""}`; - - const props = { - className, - onClick, - ["aria-label"]: ariaLabel, - src: svg[name] - }; - - return React.createElement(InlineSVG, props); -} - -Svg.displayName = "Svg"; - -module.exports = Svg; - -/***/ }), - -/***/ 3371: -/***/ (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__(3372)(); -} - - -/***/ }), - -/***/ 3372: -/***/ (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__(3373); - -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; -}; - - -/***/ }), - -/***/ 3373: -/***/ (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; - - -/***/ }), - -/***/ 3374: -/***/ (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/. */ - -const React = __webpack_require__(0); -const { Component } = React; -const dom = __webpack_require__(1758); -const PropTypes = __webpack_require__(20); -const { showMenu, buildMenu } = __webpack_require__(3211); - -class Settings extends Component { - static get propTypes() { - return { - config: PropTypes.object.isRequired, - setValue: PropTypes.func.isRequired - }; - } - - constructor(props) { - super(props); - this.onConfigContextMenu = this.onConfigContextMenu.bind(this); - this.onInputHandler = this.onInputHandler.bind(this); - this.renderConfig = this.renderConfig.bind(this); - this.renderFeatures = this.renderFeatures.bind(this); - } - - onConfigContextMenu(event, key) { - event.preventDefault(); - - const { setValue, config } = this.props; - - const setConfig = (path, value) => { - setValue(path, value); - }; - - const ltrMenuItem = { - id: "node-menu-ltr", - label: "ltr", - disabled: config[key] === "ltr", - click: () => setConfig(key, "ltr") - }; - - const rtlMenuItem = { - id: "node-menu-rtl", - label: "rtl", - disabled: config[key] === "rtl", - click: () => setConfig(key, "rtl") - }; - - const lightMenuItem = { - id: "node-menu-light", - label: "light", - disabled: config[key] === "light", - click: () => setConfig(key, "light") - }; - - const darkMenuItem = { - id: "node-menu-dark", - label: "dark", - disabled: config[key] === "dark", - click: () => setConfig(key, "dark") - }; - - const firebugMenuItem = { - id: "node-menu-firebug", - label: "firebug", - disabled: config[key] === "firebug", - click: () => setConfig(key, "firebug") - }; - - const items = { - "dir": [{ item: ltrMenuItem }, { item: rtlMenuItem }], - "theme": [{ item: lightMenuItem }, { item: darkMenuItem }, { item: firebugMenuItem }] - }; - showMenu(event, buildMenu(items[key])); - } - - onInputHandler(e, path) { - const { setValue } = this.props; - setValue(path, e.target.checked); - } - - renderConfig(config) { - const 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() { - const { config } = this.props; - - 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; - -/***/ }), - -/***/ 3375: -/***/ (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 - */ - -const constants = __webpack_require__(3219); - -/** - * @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 ({ getState, 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({ 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 -}; - -/***/ }), - -/***/ 3376: -/***/ (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/. */ - -const { setConfig: _setConfig } = __webpack_require__(3198); -const { updateTheme, updateDir } = __webpack_require__(3218); - -/** - * Redux actions for the pause state - * @module actions/config - */ - -const constants = __webpack_require__(3219); - - -/** - * @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 async function ({ dispatch }) { - const response = await fetch("/setconfig", { - method: "post", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ path, value }) - }); - - const config = await response.json(); - _setConfig(config); - updateTheme(); - updateDir(); - - dispatch({ - type: constants.SET_VALUE, - path, - value - }); - }; -} - -/** - * @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 -}; - -/***/ }), - -/***/ 3377: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.onConnect = undefined; - -var _firefox = __webpack_require__(3220); - -var firefox = _interopRequireWildcard(_firefox); - -var _chrome = __webpack_require__(3393); - -var chrome = _interopRequireWildcard(_chrome); - -var _prefs = __webpack_require__(226); - -var _dbg = __webpack_require__(3396); - -var _devtoolsConfig = __webpack_require__(3198); - -var _bootstrap = __webpack_require__(3287); - -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 . */ - -function loadFromPrefs(actions) { - const { pauseOnExceptions, ignoreCaughtExceptions } = _prefs.prefs; - if (pauseOnExceptions || ignoreCaughtExceptions) { - return actions.pauseOnExceptions(pauseOnExceptions, ignoreCaughtExceptions); - } -} - -function getClient(connection) { - const { tab: { clientType } } = connection; - return clientType == "firefox" ? firefox : chrome; -} - -async function onConnect(connection, { services, toolboxActions }) { - // NOTE: the landing page does not connect to a JS process - if (!connection) { - return; - } - - const client = getClient(connection); - const commands = client.clientCommands; - const { store, actions, selectors } = (0, _bootstrap.bootstrapStore)(commands, { - services, - toolboxActions - }); - - (0, _bootstrap.bootstrapWorkers)(); - await client.onConnect(connection, actions); - await loadFromPrefs(actions); - - if (!(0, _devtoolsConfig.isFirefoxPanel)()) { - (0, _dbg.setupHelper)({ - store, - actions, - selectors, - client: client.clientCommands - }); - } - - (0, _bootstrap.bootstrapApp)(connection, { store, actions }); - - return { store, actions, selectors, client: commands }; -} - -exports.onConnect = onConnect; - -/***/ }), - -/***/ 3378: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.clientCommands = exports.setupCommands = undefined; - -var _breakpoint = __webpack_require__(3209); - -var _create = __webpack_require__(3285); - -/* 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 . */ - -let bpClients; -let threadClient; -let tabTarget; -let debuggerClient; -let supportsWasm; - -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 rewind() { - return new Promise(resolve => { - threadClient.rewind(resolve); - }); -} - -function reverseStepIn() { - return new Promise(resolve => { - threadClient.reverseStepIn(resolve); - }); -} - -function reverseStepOver() { - return new Promise(resolve => { - threadClient.reverseStepOver(resolve); - }); -} - -function reverseStepOut() { - return new Promise(resolve => { - threadClient.reverseStepOut(resolve); - }); -} - -function breakOnNext() { - return threadClient.breakOnNext(); -} - -function sourceContents(sourceId) { - const sourceClient = threadClient.source({ actor: sourceId }); - return sourceClient.source(); -} - -function getBreakpointByLocation(location) { - const id = (0, _breakpoint.makePendingLocationId)(location); - const bpClient = bpClients[id]; - - if (bpClient) { - const { actor, url, line, column, condition } = bpClient.location; - return { - id: bpClient.actor, - condition, - actualLocation: { - line, - column, - sourceId: actor, - sourceUrl: url - } - }; - } - return null; -} - -function setBreakpoint(location, condition, noSliding) { - const sourceClient = threadClient.source({ actor: location.sourceId }); - - return sourceClient.setBreakpoint({ - line: location.line, - column: location.column, - condition, - noSliding - }).then(([{ actualLocation }, bpClient]) => { - actualLocation = (0, _create.createBreakpointLocation)(location, actualLocation); - const id = (0, _breakpoint.makePendingLocationId)(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 { - const id = (0, _breakpoint.makePendingLocationId)(generatedLocation); - const 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) { - const bpClient = bpClients[breakpointId]; - delete bpClients[breakpointId]; - - return bpClient.setCondition(threadClient, condition, noSliding).then(_bpClient => { - bpClients[breakpointId] = _bpClient; - return { id: breakpointId }; - }); -} - -function evaluateInFrame(frameId, script) { - return evaluate(script, { frameId }); -} - -function evaluate(script, { frameId } = {}) { - const params = frameId ? { frameActor: frameId } : {}; - if (!tabTarget || !tabTarget.activeConsole || !script) { - 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; - } - - const consoleActor = tabTarget.form.consoleActor; - const 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) { - const objClient = threadClient.pauseGrip(grip); - - return objClient.getPrototypeAndProperties().then(resp => { - const { ownProperties, safeGetterValues } = resp; - for (const name in safeGetterValues) { - const { enumerable, writable, getterValue } = safeGetterValues[name]; - ownProperties[name] = { enumerable, writable, value: getterValue }; - } - return resp; - }); -} - -async function getFrameScopes(frame) { - if (frame.scope) { - return frame.scope; - } - - return threadClient.getEnvironment(frame.id); -} - -function pauseOnExceptions(shouldPauseOnExceptions, shouldIgnoreCaughtExceptions) { - return threadClient.pauseOnExceptions(shouldPauseOnExceptions, shouldIgnoreCaughtExceptions); -} - -function prettyPrint(sourceId, indentSize) { - const sourceClient = threadClient.source({ actor: sourceId }); - return sourceClient.prettyPrint(indentSize); -} - -async function blackBox(sourceId, isBlackBoxed) { - const sourceClient = threadClient.source({ actor: sourceId }); - if (isBlackBoxed) { - await sourceClient.unblackBox(); - } else { - await sourceClient.blackBox(); - } - - return { isBlackBoxed: !isBlackBoxed }; -} - -function disablePrettyPrint(sourceId) { - const 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); -} - -async function fetchSources() { - const { sources } = await threadClient.getSources(); - return sources.map(source => (0, _create.createSource)(source, { supportsWasm })); -} - -async function fetchWorkers() { - // NOTE: The Worker and Browser Content toolboxes do not have a parent - // with a listWorkers function - // TODO: there is a listWorkers property, but it is not a function on the - // parent. Investigate what it is - if (!threadClient._parent || typeof threadClient._parent.listWorkers != "function") { - return Promise.resolve({ workers: [] }); - } - - return threadClient._parent.listWorkers(); -} - -const clientCommands = { - blackBox, - interrupt, - eventListeners, - pauseGrip, - resume, - stepIn, - stepOut, - stepOver, - rewind, - reverseStepIn, - reverseStepOut, - reverseStepOver, - breakOnNext, - sourceContents, - getBreakpointByLocation, - setBreakpoint, - removeBreakpoint, - setBreakpointCondition, - evaluate, - evaluateInFrame, - debuggeeCommand, - navigate, - reload, - getProperties, - getFrameScopes, - pauseOnExceptions, - prettyPrint, - disablePrettyPrint, - fetchSources, - fetchWorkers -}; - -exports.setupCommands = setupCommands; -exports.clientCommands = clientCommands; - -/***/ }), - -/***/ 3379: -/***/ (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/. */ - -const EventEmitter = __webpack_require__(3235); - -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({ id = null } = {}) { - 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) { - let doc = toolbox.doc; - let 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. - let 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) { - let doc = parent.ownerDocument; - this.menuitems.forEach(item => { - if (!item.visible) { - return; - } - - if (item.submenu) { - let menupopup = doc.createElement("menupopup"); - item.submenu._createMenuItems(menupopup); - - let menuitem = doc.createElement("menuitem"); - menuitem.setAttribute("label", item.label); - if (!inToolbox()) { - menuitem.textContent = item.label; - } - - let 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") { - let menusep = doc.createElement("menuseparator"); - parent.appendChild(menusep); - } else { - let 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; - -/***/ }), - -/***/ 3380: -/***/ (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`. - */ - -let 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; - -/***/ }), - -/***/ 3381: -/***/ (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({ - accesskey = null, - checked = false, - click = () => {}, - disabled = false, - label = "", - id = null, - submenu = null, - type = "normal", - visible = true -} = {}) { - 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; - -/***/ }), - -/***/ 3382: -/***/ (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/. */ - -const Services = __webpack_require__(22); -const EventEmitter = __webpack_require__(3235); - -/** - * 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(prefsRoot = "", prefsBlueprint = {}) { - EventEmitter.decorate(this); - - let cache = new Map(); - - for (let accessorName in prefsBlueprint) { - let [prefType, prefName, prefDefault] = prefsBlueprint[accessorName]; - map(this, cache, accessorName, prefType, prefsRoot, prefName, prefDefault); - } - - let 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) { - let cachedPref = cache.get(prefName); - if (cachedPref !== undefined) { - return cachedPref; - } - let 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, serializer = { 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 (let accessorName in prefsBlueprint) { - let [, prefName] = prefsBlueprint[accessorName]; - 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. - let accessorName = accessorNameForPref(prefName, prefsBlueprint); - if (!(accessorName in self)) { - return; - } - cache.delete(prefName); - self.emit("pref-changed", accessorName, self[accessorName]); - } - }; -} - -exports.PrefsHelper = PrefsHelper; - -/***/ }), - -/***/ 3383: -/***/ (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/. */ - -const { appinfo } = __webpack_require__(22); -const EventEmitter = __webpack_require__(3235); -const isOSX = appinfo.OS === "Darwin"; - -// List of electron keys mapped to DOM API (DOM_VK_*) key code -const 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({ window, 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) { - let modifiers = str.split("+"); - let key = modifiers.pop(); - - let shortcut = { - ctrl: false, - meta: false, - alt: false, - shift: false, - // Set for character keys - key: undefined, - // Set for non-character keys - keyCode: undefined - }; - for (let 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) { - let 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"); - } - let key; - 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. - let 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 (let [key, shortcut] of this.keys) { - 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)) { - let 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; - -/***/ }), - -/***/ 3384: -/***/ (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) {}; - -/***/ }), - -/***/ 3385: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isMinified = isMinified; - - -// Used to detect minification for automatic pretty printing -const SAMPLE_SIZE = 50; /* 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 . */ - -const INDENT_COUNT_THRESHOLD = 5; -const CHARACTER_LIMIT = 250; -const _minifiedCache = new Map(); - -function isMinified(source) { - if (_minifiedCache.has(source.get("id"))) { - return _minifiedCache.get(source.get("id")); - } - - let text = source.get("text"); - if (!text) { - return false; - } - - let lineEndIndex = 0; - let lineStartIndex = 0; - let lines = 0; - let indentCount = 0; - let overCharLimit = false; - - // Strip comments. - text = text.replace(/\/\*[\S\s]*?\*\/|\/\/(.+|\n)/g, ""); - - while (lines++ < SAMPLE_SIZE) { - lineEndIndex = text.indexOf("\n", lineStartIndex); - if (lineEndIndex == -1) { - break; - } - if (/^\s+/.test(text.slice(lineStartIndex, lineEndIndex))) { - indentCount++; - } - // For files with no indents but are not minified. - if (lineEndIndex - lineStartIndex > CHARACTER_LIMIT) { - overCharLimit = true; - break; - } - lineStartIndex = lineEndIndex + 1; - } - - const minified = indentCount / lines * 100 < INDENT_COUNT_THRESHOLD || overCharLimit; - - _minifiedCache.set(source.id, minified); - return minified; -} - -/***/ }), - -/***/ 3386: -/***/ (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 -/* 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 . */ - -/** - * 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) { - const hasLength = hasOwnProperty(value, "length"); - const length = value.length; - - if (hasLength) { - value.length = `${value.length}`; - } - - let 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. - const 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; - -/***/ }), - -/***/ 3387: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getBreakpointAtLocation = getBreakpointAtLocation; - -var _sources = __webpack_require__(3205); - -var _breakpoints = __webpack_require__(3236); - -var _devtoolsSourceMap = __webpack_require__(3197); - -function isGenerated(selectedSource) { - const sourceId = selectedSource.get("id"); - return (0, _devtoolsSourceMap.isGeneratedId)(sourceId); -} /* 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 . */ - -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) { - const breakpoints = (0, _breakpoints.getBreakpoints)(state); - - return breakpoints.filter(bp => { - const location = getLocation(bp, selectedSource); - return location.sourceId === selectedSource.get("id"); - }); -} - -function findBreakpointAtLocation(breakpoints, selectedSource, { line, column }) { - return breakpoints.find(breakpoint => { - const location = getLocation(breakpoint, selectedSource); - const 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) { - const selectedSource = (0, _sources.getSelectedSource)(state); - const breakpoints = getBreakpointsForSource(state, selectedSource); - - return findBreakpointAtLocation(breakpoints, selectedSource, location); -} - -/***/ }), - -/***/ 3388: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getVisibleBreakpoints = getVisibleBreakpoints; - -var _breakpoints = __webpack_require__(3236); - -var _sources = __webpack_require__(3205); - -var _devtoolsSourceMap = __webpack_require__(3197); - -function getLocation(breakpoint, isGeneratedSource) { - return isGeneratedSource ? breakpoint.generatedLocation || breakpoint.location : breakpoint.location; -} /* 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 . */ - -function formatBreakpoint(breakpoint, selectedSource) { - const { condition, loading, disabled, hidden } = breakpoint; - const sourceId = selectedSource.get("id"); - const isGeneratedSource = (0, _devtoolsSourceMap.isGeneratedId)(sourceId); - - return { - location: getLocation(breakpoint, isGeneratedSource), - condition, - loading, - disabled, - hidden - }; -} - -function isVisible(breakpoint, selectedSource) { - const sourceId = selectedSource.get("id"); - const isGeneratedSource = (0, _devtoolsSourceMap.isGeneratedId)(sourceId); - - const location = getLocation(breakpoint, isGeneratedSource); - return location.sourceId === sourceId; -} -/* - * Finds the breakpoints, which appear in the selected source. - * - * This - */ -function getVisibleBreakpoints(state) { - const selectedSource = (0, _sources.getSelectedSource)(state); - if (!selectedSource) { - return null; - } - - return (0, _breakpoints.getBreakpoints)(state).filter(bp => isVisible(bp, selectedSource)).map(bp => formatBreakpoint(bp, selectedSource)); -} - -/***/ }), - -/***/ 3389: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isSelectedFrameVisible = isSelectedFrameVisible; - -var _pause = __webpack_require__(3224); - -var _sources = __webpack_require__(3205); - -/* - * Checks to if the selected frame's source is currently - * selected. - */ -/* 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 . */ - -function isSelectedFrameVisible(state) { - const selectedLocation = (0, _sources.getSelectedLocation)(state); - const selectedFrame = (0, _pause.getSelectedFrame)(state); - - return selectedFrame && selectedLocation && selectedFrame.location.sourceId == selectedLocation.sourceId; -} - -/***/ }), - -/***/ 3390: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getCallStackFrames = 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 . */ - -exports.formatCallStackFrames = formatCallStackFrames; - -var _sources = __webpack_require__(3205); - -var _pause = __webpack_require__(3224); - -var _frame = __webpack_require__(3216); - -var _devtoolsSourceMap = __webpack_require__(3197); - -var _lodash = __webpack_require__(2); - -var _reselect = __webpack_require__(993); - -function getLocation(frame, isGeneratedSource) { - return isGeneratedSource ? frame.generatedLocation || frame.location : frame.location; -} - -function getSourceForFrame(sources, frame, isGeneratedSource) { - const sourceId = getLocation(frame, isGeneratedSource).sourceId; - return (0, _sources.getSourceInSources)(sources, sourceId); -} - -function appendSource(sources, frame, selectedSource) { - const isGeneratedSource = selectedSource && !(0, _devtoolsSourceMap.isOriginalId)(selectedSource.get("id")); - return _extends({}, frame, { - location: getLocation(frame, isGeneratedSource), - source: getSourceForFrame(sources, frame, isGeneratedSource).toJS() - }); -} - -function formatCallStackFrames(frames, sources, selectedSource) { - if (!frames) { - return null; - } - - return frames.filter(frame => getSourceForFrame(sources, frame)).map(frame => appendSource(sources, frame, selectedSource)).filter(frame => !(0, _lodash.get)(frame, "source.isBlackBoxed")).map(_frame.annotateFrame); -} - -const getCallStackFrames = exports.getCallStackFrames = (0, _reselect.createSelector)(_sources.getSelectedSource, _sources.getSources, _pause.getFrames, (selectedSource, sources, frames) => formatCallStackFrames(frames, sources, selectedSource)); - -/***/ }), - -/***/ 3391: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getVisibleSelectedFrame = undefined; - -var _sources = __webpack_require__(3205); - -var _pause = __webpack_require__(3224); - -var _devtoolsSourceMap = __webpack_require__(3197); - -var _reselect = __webpack_require__(993); - -/* 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 . */ - -function getLocation(frame, location) { - if (!location) { - return frame.location; - } - - return !(0, _devtoolsSourceMap.isOriginalId)(location.sourceId) ? frame.generatedLocation || frame.location : frame.location; -} - -const getVisibleSelectedFrame = exports.getVisibleSelectedFrame = (0, _reselect.createSelector)(_sources.getSelectedLocation, _pause.getSelectedFrame, (selectedLocation, selectedFrame) => { - if (!selectedFrame) { - return null; - } - - const { id } = selectedFrame; - - return { - id, - location: getLocation(selectedFrame, selectedLocation) - }; -}); - -/***/ }), - -/***/ 3392: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.clientEvents = exports.setupEvents = undefined; - -var _create = __webpack_require__(3285); - -var _sourceQueue = __webpack_require__(3250); - -var _sourceQueue2 = _interopRequireDefault(_sourceQueue); - -var _prefs = __webpack_require__(226); - -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 . */ - -const CALL_STACK_PAGE_SIZE = 1000; - -let threadClient; -let actions; -let supportsWasm; -let isInterrupted; - -function setupEvents(dependencies) { - threadClient = dependencies.threadClient; - actions = dependencies.actions; - supportsWasm = dependencies.supportsWasm; - _sourceQueue2.default.initialize({ actions, supportsWasm, createSource: _create.createSource }); - - if (threadClient) { - Object.keys(clientEvents).forEach(eventName => { - threadClient.addListener(eventName, clientEvents[eventName]); - }); - - if (threadClient._parent) { - threadClient._parent.addListener("workerListChanged", workerListChanged); - } - } -} - -async function paused(_, 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. - const { why } = packet; - if (why.type === "interrupted" && !packet.why.onNext) { - isInterrupted = true; - return; - } - - // Eagerly fetch the frames - const response = await threadClient.getFrames(0, CALL_STACK_PAGE_SIZE); - - if (why.type != "alreadyPaused") { - const pause = (0, _create.createPause)(packet, response); - await _sourceQueue2.default.flush(); - actions.paused(pause); - } -} - -function resumed(_, packet) { - // NOTE: the client suppresses resumed events while interrupted - // to prevent unintentional behavior. - // see [client docs](../README.md#interrupted) for more information. - if (isInterrupted) { - isInterrupted = false; - return; - } - - actions.resumed(packet); -} - -function newSource(_, { source }) { - _sourceQueue2.default.queue(source); - - if (_prefs.features.eventListeners) { - actions.fetchEventListeners(); - } -} - -function workerListChanged() { - actions.updateWorkers(); -} - -const clientEvents = { - paused, - resumed, - newSource -}; - -exports.setupEvents = setupEvents; -exports.clientEvents = clientEvents; - -/***/ }), - -/***/ 3393: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.clientEvents = exports.clientCommands = undefined; -exports.onConnect = onConnect; - -var _commands = __webpack_require__(3394); - -var _events = __webpack_require__(3395); - -/* 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 . */ - -async function onConnect(connection, actions) { - const { tabConnection, connTarget: { type } } = connection; - const { Debugger, Runtime, Page } = tabConnection; - - 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 {}; -} - -exports.clientCommands = _commands.clientCommands; -exports.clientEvents = _events.clientEvents; - -/***/ }), - -/***/ 3394: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.clientCommands = exports.setupCommands = undefined; - -var _create = __webpack_require__(3286); - -let debuggerAgent; /* 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 . */ - -let runtimeAgent; -let pageAgent; - -function setupCommands({ Debugger, Runtime, 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" }); - } - const state = shouldIgnoreCaughtExceptions ? "uncaught" : "all"; - return debuggerAgent.setPauseOnExceptions({ state }); -} - -function breakOnNext() { - return debuggerAgent.pause(); -} - -function sourceContents(sourceId) { - return debuggerAgent.getScriptSource({ scriptId: sourceId }).then(({ scriptSource }) => ({ - source: scriptSource, - contentType: null - })); -} - -async function setBreakpoint(location, condition) { - const { - breakpointId, - serverLocation - } = await debuggerAgent.setBreakpoint({ - location: (0, _create.toServerLocation)(location), - columnNumber: location.column - }); - - const actualLocation = (0, _create.fromServerLocation)(serverLocation) || location; - - return { - id: breakpointId, - actualLocation: actualLocation - }; -} - -function removeBreakpoint(breakpointId) { - return debuggerAgent.removeBreakpoint({ breakpointId }); -} - -async function getProperties(object) { - const { result } = await runtimeAgent.getProperties({ - objectId: object.objectId - }); - - const loadedObjects = result.map(_create.createLoadedObject); - - return { loadedObjects }; -} - -function evaluate(script) { - return runtimeAgent.evaluate({ expression: script }); -} - -function debuggeeCommand(script) { - evaluate(script); - return Promise.resolve(); -} - -function navigate(url) { - return pageAgent.navigate({ url }); -} - -const clientCommands = { - resume, - stepIn, - stepOut, - stepOver, - pauseOnExceptions, - breakOnNext, - sourceContents, - setBreakpoint, - removeBreakpoint, - evaluate, - debuggeeCommand, - navigate, - getProperties -}; - -exports.setupCommands = setupCommands; -exports.clientCommands = clientCommands; - -/***/ }), - -/***/ 3395: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.clientEvents = exports.pageEvents = exports.setupEvents = 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 . */ - -var _create = __webpack_require__(3286); - -let actions; -let pageAgent; -let clientType; -let runtimeAgent; - -function setupEvents(dependencies) { - actions = dependencies.actions; - pageAgent = dependencies.Page; - clientType = dependencies.clientType; - runtimeAgent = dependencies.Runtime; -} - -// Debugger Events -function scriptParsed({ - scriptId, - url, - startLine, - startColumn, - endLine, - endColumn, - executionContextId, - hash, - isContentScript, - isInternalScript, - isLiveEdit, - sourceMapURL, - hasSourceURL, - deprecatedCommentWasUsed -}) { - if (isContentScript) { - return; - } - - if (clientType == "node") { - sourceMapURL = undefined; - } - - actions.newSource({ - id: scriptId, - url, - sourceMapURL, - isPrettyPrinted: false - }); -} - -function scriptFailedToParse() {} - -async function paused({ - callFrames, - reason, - data, - hitBreakpoints, - asyncStackTrace -}) { - const frames = callFrames.map(_create.createFrame); - const frame = frames[0]; - const why = _extends({ type: reason }, data); - - const objectId = frame.scopeChain[0].object.objectId; - const { result } = await runtimeAgent.getProperties({ - objectId - }); - - const loadedObjects = result.map(_create.createLoadedObject); - - if (clientType == "chrome") { - pageAgent.configureOverlay({ message: "Paused in debugger.html" }); - } - - await actions.paused({ frame, why, frames, loadedObjects }); -} - -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() {} - -const clientEvents = { - scriptParsed, - scriptFailedToParse, - paused, - resumed, - globalObjectCleared -}; - -const pageEvents = { - frameNavigated, - frameStartedLoading, - domContentEventFired, - loadEventFired, - frameStoppedLoading -}; - -exports.setupEvents = setupEvents; -exports.pageEvents = pageEvents; -exports.clientEvents = clientEvents; - -/***/ }), - -/***/ 3396: -/***/ (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.setupHelper = setupHelper; - -var _redux = __webpack_require__(3); - -var _timings = __webpack_require__(3397); - -var timings = _interopRequireWildcard(_timings); - -var _prefs = __webpack_require__(226); - -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 findSource(dbg, url) { - const sources = dbg.selectors.getSources(); - const source = sources.find(s => (s.get("url") || "").includes(url)); - - if (!source) { - return; - } - - return source.toJS(); -} - -function sendPacket(dbg, packet, callback) { - dbg.connection.tabConnection.debuggerClient.request(packet).then(callback || console.log); -} - -function evaluate(dbg, expression, callback) { - dbg.client.evaluate(expression).then(callback || console.log); -} - -function bindSelectors(obj) { - return Object.keys(obj.selectors).reduce((bound, selector) => { - bound[selector] = (a, b, c) => obj.selectors[selector](obj.store.getState(), a, b, c); - return bound; - }, {}); -} - -function getCM() { - const cm = document.querySelector(".CodeMirror"); - return cm && cm.CodeMirror; -} - -function setupHelper(obj) { - const selectors = bindSelectors(obj); - const actions = (0, _redux.bindActionCreators)(obj.actions, obj.store.dispatch); - const dbg = _extends({}, obj, { - selectors, - actions, - prefs: _prefs.prefs, - features: _prefs.features, - timings, - getCM, - helpers: { - findSource: url => findSource(dbg, url), - evaluate: (expression, cbk) => evaluate(dbg, expression, cbk), - sendPacket: (packet, cbk) => sendPacket(dbg, packet, cbk) - } - }); - - window.dbg = dbg; - - console.group("Development Notes"); - const baseUrl = "https://devtools-html.github.io/debugger.html"; - const localDevelopmentUrl = `${baseUrl}/docs/dbg.html`; - console.log("Debugging Tips", localDevelopmentUrl); - console.log("dbg", window.dbg); - console.groupEnd(); -} - -/***/ }), - -/***/ 3397: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getAsyncTimes = getAsyncTimes; -exports.steppingTimings = steppingTimings; - -var _lodash = __webpack_require__(2); - -function getAsyncTimes(name) { - return (0, _lodash.zip)(window.performance.getEntriesByName(`${name}_start`), window.performance.getEntriesByName(`${name}_end`)).map(([start, end]) => +(end.startTime - start.startTime).toPrecision(2)); -} /* 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 . */ - -function getTimes(name) { - return window.performance.getEntriesByName(name).map(time => +time.duration.toPrecision(2)); -} - -function getStats(times) { - if (times.length == 0) { - return { times: [], avg: null, median: null }; - } - const avg = times.reduce((sum, time) => time + sum, 0) / times.length; - const sortedtimings = [...times].sort((a, b) => a - b); - const median = sortedtimings[times.length / 2]; - return { - times, - avg: +avg.toPrecision(2), - median: +median.toPrecision(2) - }; -} - -function steppingTimings() { - const commandTimings = getAsyncTimes("COMMAND"); - const pausedTimings = getTimes("PAUSED"); - - return { - commands: getStats(commandTimings), - paused: getStats(pausedTimings) - }; -} - -// console.log("..", asyncTimes("COMMAND")); - -/***/ }), - -/***/ 3398: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _redux = __webpack_require__(3); - -var _waitService = __webpack_require__(3289); - -var _log = __webpack_require__(3399); - -var _history = __webpack_require__(3400); - -var _promise = __webpack_require__(3206); - -var _thunk = __webpack_require__(3401); - -var _timing = __webpack_require__(3402); - -/** - * 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 - */ -const configureStore = (opts = {}) => { - const 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 - const devtoolsExt = typeof window === "object" && window.devToolsExtension ? window.devToolsExtension() : f => f; - - return (0, _redux.applyMiddleware)(...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 . */ - -/* global window */ - -/** - * Redux store utils - * @module utils/create-store - */ - -exports.default = configureStore; - -/***/ }), - -/***/ 3399: -/***/ (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; }; /* 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 */ - -exports.log = log; - -var _devtoolsConfig = __webpack_require__(3198); - -const blacklist = ["SET_POPUP_OBJECT_PROPERTIES", "SET_SYMBOLS", "OUT_OF_SCOPE_LOCATIONS"]; - -function cloneAction(action) { - action = action || {}; - action = _extends({}, action); - - // ADD_TAB, ... - if (action.source && action.source.text) { - const source = _extends({}, action.source, { text: "" }); - action.source = source; - } - - if (action.sources) { - const sources = action.sources.slice(0, 30).map(source => { - const url = !source.url || source.url.includes("data:") ? "" : source.url; - return _extends({}, source, { url }); - }); - action.sources = sources; - } - - // LOAD_SOURCE_TEXT - if (action.text) { - action.text = ""; - } - - if (action.value && action.value.text) { - const value = _extends({}, action.value, { text: "" }); - action.value = value; - } - - return action; -} - -function formatFrame(frame) { - const { id, location, displayName } = frame; - return { id, location, displayName }; -} - -function formatPause(pause) { - return _extends({}, pause, { - pauseInfo: { why: pause.why }, - scopes: [], - frames: pause.frames.map(formatFrame), - loadedObjects: [] - }); -} - -function serializeAction(action) { - try { - action = cloneAction(action); - if (blacklist.includes(action.type)) { - action = {}; - } - - if (action.type === "PAUSED") { - action = formatPause(action); - } - - // dump(`> ${action.type}...\n ${JSON.stringify(action)}\n`); - return JSON.stringify(action); - } catch (e) { - console.error(e); - } -} - -/** - * A middleware that logs all actions coming through the system - * to the console. - */ -function log({ dispatch, getState }) { - return next => action => { - const asyncMsg = !action.status ? "" : `[${action.status}]`; - - if ((0, _devtoolsConfig.isTesting)()) { - dump(`[ACTION] ${action.type} ${asyncMsg} - ${serializeAction(action)}\n`); - } else { - console.log(action, asyncMsg); - } - - next(action); - }; -} - -/***/ }), - -/***/ 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); - - -/***/ }), - -/***/ 3400: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.history = undefined; - -var _devtoolsConfig = __webpack_require__(3198); - -/** - * 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. - */ -const history = exports.history = (log = []) => ({ - dispatch, - getState -}) => { - return next => action => { - if ((0, _devtoolsConfig.isDevelopment)()) { - log.push(action); - } - - return next(action); - }; -}; /* 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 . */ - -/* global window */ - -/***/ }), - -/***/ 3401: -/***/ (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 ({ dispatch, getState }) => { - const args = { dispatch, getState }; - - return next => action => { - return typeof action === "function" ? action(makeArgs ? makeArgs(args, getState()) : args) : next(action); - }; - }; -} /* 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 . */ - -/* global window */ - -/***/ }), - -/***/ 3402: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.timing = timing; -/* 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 middleware that sets performance markers for all actions such that they - * will appear in performance tooling under the User Timing API - */ - -const mark = window.performance && window.performance.mark ? window.performance.mark.bind(window.performance) : () => {}; - -const measure = window.performance && window.performance.measure ? window.performance.measure.bind(window.performance) : () => {}; - -function timing(store) { - return next => action => { - mark(`${action.type}_start`); - const result = next(action); - mark(`${action.type}_end`); - measure(`${action.type}`, `${action.type}_start`, `${action.type}_end`); - return result; - }; -} - -/***/ }), - -/***/ 3403: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _expressions = __webpack_require__(3275); - -var _expressions2 = _interopRequireDefault(_expressions); - -var _eventListeners = __webpack_require__(3282); - -var _eventListeners2 = _interopRequireDefault(_eventListeners); - -var _sources = __webpack_require__(3205); - -var _sources2 = _interopRequireDefault(_sources); - -var _breakpoints = __webpack_require__(3236); - -var _breakpoints2 = _interopRequireDefault(_breakpoints); - -var _pendingBreakpoints = __webpack_require__(3277); - -var _pendingBreakpoints2 = _interopRequireDefault(_pendingBreakpoints); - -var _asyncRequests = __webpack_require__(3404); - -var _asyncRequests2 = _interopRequireDefault(_asyncRequests); - -var _pause = __webpack_require__(3224); - -var _pause2 = _interopRequireDefault(_pause); - -var _ui = __webpack_require__(3248); - -var _ui2 = _interopRequireDefault(_ui); - -var _fileSearch = __webpack_require__(3278); - -var _fileSearch2 = _interopRequireDefault(_fileSearch); - -var _ast = __webpack_require__(3249); - -var _ast2 = _interopRequireDefault(_ast); - -var _coverage = __webpack_require__(3279); - -var _coverage2 = _interopRequireDefault(_coverage); - -var _projectTextSearch = __webpack_require__(3237); - -var _projectTextSearch2 = _interopRequireDefault(_projectTextSearch); - -var _replay = __webpack_require__(3280); - -var _replay2 = _interopRequireDefault(_replay); - -var _quickOpen = __webpack_require__(3283); - -var _quickOpen2 = _interopRequireDefault(_quickOpen); - -var _sourceTree = __webpack_require__(3281); - -var _sourceTree2 = _interopRequireDefault(_sourceTree); - -var _debuggee = __webpack_require__(3276); - -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/. */ - -/** - * Reducer index - * @module reducers/index - */ - -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, - fileSearch: _fileSearch2.default, - ast: _ast2.default, - coverage: _coverage2.default, - projectTextSearch: _projectTextSearch2.default, - replay: _replay2.default, - quickOpen: _quickOpen2.default, - sourceTree: _sourceTree2.default, - debuggee: _debuggee2.default -}; - -/***/ }), - -/***/ 3404: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -/* 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/. */ - -/** - * Async request reducer - * @module reducers/async-request - */ - -const initialAsyncRequestState = []; - -function update(state = initialAsyncRequestState, action) { - const { seqId } = action; - - if (action.type === "NAVIGATE") { - return initialAsyncRequestState; - } else if (seqId) { - let newState; - if (action.status === "start") { - newState = [...state, seqId]; - } else if (action.status === "error" || action.status === "done") { - newState = state.filter(id => id !== seqId); - } - - return newState; - } - - return state; -} - -exports.default = update; - -/***/ }), - -/***/ 3405: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _propTypes = __webpack_require__(20); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -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__(3195); - -var _actions2 = _interopRequireDefault(_actions); - -var _ShortcutsModal = __webpack_require__(3441); - -var _selectors = __webpack_require__(3193); - -var _devtoolsModules = __webpack_require__(3221); - -__webpack_require__(3446); - -__webpack_require__(3447); - -__webpack_require__(3448); - -__webpack_require__(3449); - -var _devtoolsSplitter = __webpack_require__(3300); - -var _devtoolsSplitter2 = _interopRequireDefault(_devtoolsSplitter); - -var _ProjectSearch = __webpack_require__(3453); - -var _ProjectSearch2 = _interopRequireDefault(_ProjectSearch); - -var _PrimaryPanes = __webpack_require__(3469); - -var _PrimaryPanes2 = _interopRequireDefault(_PrimaryPanes); - -var _Editor = __webpack_require__(3475); - -var _Editor2 = _interopRequireDefault(_Editor); - -var _SecondaryPanes = __webpack_require__(3534); - -var _SecondaryPanes2 = _interopRequireDefault(_SecondaryPanes); - -var _WelcomeBox = __webpack_require__(3566); - -var _WelcomeBox2 = _interopRequireDefault(_WelcomeBox); - -var _Tabs = __webpack_require__(3568); - -var _Tabs2 = _interopRequireDefault(_Tabs); - -var _QuickOpenModal = __webpack_require__(3571); - -var _QuickOpenModal2 = _interopRequireDefault(_QuickOpenModal); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const shortcuts = new _devtoolsModules.KeyShortcuts({ window }); /* 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 . */ - -const { appinfo } = _devtoolsModules.Services; - -const isMacOS = appinfo.OS === "Darwin"; - -const horizontalLayoutBreakpoint = window.matchMedia("(min-width: 800px)"); -const verticalLayoutBreakpoint = window.matchMedia("(min-width: 10px) and (max-width: 800px)"); - -class App extends _react.Component { - - constructor(props) { - super(props); - this.state = { - shortcutsModalEnabled: false, - startPanelSize: 0, - endPanelSize: 0 - }; - - this.getChildContext = this.getChildContext.bind(this); - this.onLayoutChange = this.onLayoutChange.bind(this); - this.toggleQuickOpenModal = this.toggleQuickOpenModal.bind(this); - this.renderEditorPane = this.renderEditorPane.bind(this); - this.renderLayout = this.renderLayout.bind(this); - this.onEscape = this.onEscape.bind(this); - this.onCommandSlash = this.onCommandSlash.bind(this); - } - - getChildContext() { - return { shortcuts }; - } - - componentDidMount() { - horizontalLayoutBreakpoint.addListener(this.onLayoutChange); - verticalLayoutBreakpoint.addListener(this.onLayoutChange); - this.setOrientation(); - - shortcuts.on(L10N.getStr("symbolSearch.search.key2"), (_, e) => this.toggleQuickOpenModal(_, e, "@")); - - const searchKeys = [L10N.getStr("sources.search.key2"), L10N.getStr("sources.search.alt.key")]; - searchKeys.forEach(key => shortcuts.on(key, this.toggleQuickOpenModal)); - - shortcuts.on(L10N.getStr("gotoLineModal.key2"), (_, e) => this.toggleQuickOpenModal(_, e, ":")); - - shortcuts.on("Escape", this.onEscape); - shortcuts.on("Cmd+/", this.onCommandSlash); - } - - componentWillUnmount() { - horizontalLayoutBreakpoint.removeListener(this.onLayoutChange); - verticalLayoutBreakpoint.removeListener(this.onLayoutChange); - shortcuts.off(L10N.getStr("symbolSearch.search.key2"), this.toggleQuickOpenModal); - - const searchKeys = [L10N.getStr("sources.search.key2"), L10N.getStr("sources.search.alt.key")]; - searchKeys.forEach(key => shortcuts.off(key, this.toggleQuickOpenModal)); - - shortcuts.off(L10N.getStr("gotoLineModal.key2"), this.toggleQuickOpenModal); - - shortcuts.off("Escape", this.onEscape); - } - - onEscape(_, e) { - const { - activeSearch, - quickOpenEnabled, - closeActiveSearch, - closeQuickOpen - } = this.props; - - if (activeSearch) { - e.preventDefault(); - closeActiveSearch(); - } - - if (quickOpenEnabled === true) { - closeQuickOpen(); - } - } - - onCommandSlash() { - this.toggleShortcutsModal(); - } - - isHorizontal() { - return this.props.orientation === "horizontal"; - } - - toggleQuickOpenModal(_, e, query) { - const { quickOpenEnabled, openQuickOpen, closeQuickOpen } = this.props; - - e.preventDefault(); - e.stopPropagation(); - - if (quickOpenEnabled === true) { - closeQuickOpen(); - return; - } - - if (query != null) { - openQuickOpen(query); - return; - } - openQuickOpen(); - return; - } - - onLayoutChange() { - this.setOrientation(); - } - - setOrientation() { - // If the orientation does not match (if it is not visible) it will - // not setOrientation, or if it is the same as before, calling - // setOrientation will not cause a rerender. - if (horizontalLayoutBreakpoint.matches) { - this.props.setOrientation("horizontal"); - } else if (verticalLayoutBreakpoint.matches) { - this.props.setOrientation("vertical"); - } - } - - renderEditorPane() { - const { startPanelCollapsed, endPanelCollapsed } = this.props; - const { endPanelSize, startPanelSize } = this.state; - const horizontal = this.isHorizontal(); - - 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 - }); - } - - renderLayout() { - const { startPanelCollapsed, endPanelCollapsed } = this.props; - const horizontal = this.isHorizontal(); - - const maxSize = horizontal ? "70%" : "95%"; - const primaryInitialSize = horizontal ? "250px" : "150px"; - - return _react2.default.createElement(_devtoolsSplitter2.default, { - style: { width: "100vw" }, - initialHeight: 400, - initialWidth: 300, - minSize: 30, - maxSize: maxSize, - splitterSize: 1, - vert: horizontal, - startPanel: _react2.default.createElement(_devtoolsSplitter2.default, { - style: { width: "100vw" }, - initialSize: primaryInitialSize, - minSize: 30, - maxSize: "85%", - splitterSize: 1, - startPanelCollapsed: startPanelCollapsed, - startPanel: _react2.default.createElement(_PrimaryPanes2.default, { horizontal: horizontal }), - endPanel: this.renderEditorPane() - }), - endPanelControl: true, - endPanel: _react2.default.createElement(_SecondaryPanes2.default, { - horizontal: horizontal, - toggleShortcutsModal: () => this.toggleShortcutsModal() - }), - endPanelCollapsed: endPanelCollapsed - }); - } - - renderShortcutsModal() { - const additionalClass = isMacOS ? "mac" : ""; - - if (!_prefs.features.shortcuts) { - return; - } - - return _react2.default.createElement(_ShortcutsModal.ShortcutsModal, { - additionalClass: additionalClass, - enabled: this.state.shortcutsModalEnabled, - handleClose: () => this.toggleShortcutsModal() - }); - } - - render() { - const { quickOpenEnabled } = this.props; - return _react2.default.createElement( - "div", - { className: "debugger" }, - this.renderLayout(), - quickOpenEnabled === true && _react2.default.createElement(_QuickOpenModal2.default, { - shortcutsModalEnabled: this.state.shortcutsModalEnabled, - toggleShortcutsModal: () => this.toggleShortcutsModal() - }), - this.renderShortcutsModal() - ); - } -} - -App.childContextTypes = { shortcuts: _propTypes2.default.object }; - -function mapStateToProps(state) { - return { - selectedSource: (0, _selectors.getSelectedSource)(state), - startPanelCollapsed: (0, _selectors.getPaneCollapse)(state, "start"), - endPanelCollapsed: (0, _selectors.getPaneCollapse)(state, "end"), - activeSearch: (0, _selectors.getActiveSearch)(state), - quickOpenEnabled: (0, _selectors.getQuickOpenEnabled)(state), - orientation: (0, _selectors.getOrientation)(state) - }; -} - -exports.default = (0, _reactRedux.connect)(mapStateToProps, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(App); - -/***/ }), - -/***/ 3406: -/***/ (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; }; /* 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 . */ - -var _breakpoint = __webpack_require__(3209); - -var _selectors = __webpack_require__(3193); - -var _sourceMaps = __webpack_require__(3252); - -exports.default = async function addBreakpoint(getState, client, sourceMaps, { breakpoint }) { - const state = getState(); - - const source = (0, _selectors.getSource)(state, breakpoint.location.sourceId); - const sourceRecord = source.toJS(); - const location = _extends({}, breakpoint.location, { sourceUrl: source.get("url") }); - const generatedLocation = await (0, _sourceMaps.getGeneratedLocation)(state, sourceRecord, location, sourceMaps); - - (0, _breakpoint.assertLocation)(location); - (0, _breakpoint.assertLocation)(generatedLocation); - - if ((0, _breakpoint.breakpointExists)(state, location)) { - const newBreakpoint = _extends({}, breakpoint, { location, generatedLocation }); - (0, _breakpoint.assertBreakpoint)(newBreakpoint); - return { breakpoint: newBreakpoint }; - } - - const { id, hitCount, actualLocation } = await client.setBreakpoint(generatedLocation, breakpoint.condition, sourceMaps.isOriginalId(location.sourceId)); - - const newGeneratedLocation = actualLocation || generatedLocation; - const newLocation = await sourceMaps.getOriginalLocation(newGeneratedLocation); - - const symbols = (0, _selectors.getSymbols)(getState(), sourceRecord); - const astLocation = await (0, _breakpoint.getASTLocation)(sourceRecord, symbols, newLocation); - - const newBreakpoint = { - id, - disabled: false, - hidden: breakpoint.hidden, - loading: false, - condition: breakpoint.condition, - location: newLocation, - astLocation, - hitCount, - generatedLocation: newGeneratedLocation - }; - - (0, _breakpoint.assertBreakpoint)(newBreakpoint); - - const previousLocation = (0, _breakpoint.locationMoved)(location, newLocation) ? location : null; - - return { - breakpoint: newBreakpoint, - previousLocation - }; -}; - -/***/ }), - -/***/ 3407: -/***/ (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; -/* 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 . */ - -function remapLocations(breakpoints, sourceId, sourceMaps) { - const sourceBreakpoints = breakpoints.map(async breakpoint => { - if (breakpoint.location.sourceId !== sourceId) { - return breakpoint; - } - const location = await sourceMaps.getOriginalLocation(breakpoint.location); - return _extends({}, breakpoint, { location }); - }); - - return Promise.all(sourceBreakpoints.valueSeq()); -} - -/***/ }), - -/***/ 3408: -/***/ (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; }; /* 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 . */ - -exports.syncClientBreakpoint = syncClientBreakpoint; - -var _breakpoint = __webpack_require__(3209); - -var _sourceMaps = __webpack_require__(3252); - -var _devtoolsSourceMap = __webpack_require__(3197); - -var _selectors = __webpack_require__(3193); - -async function makeScopedLocation({ name, offset }, location, source) { - const scope = await (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 - const line = scope ? scope.location.start.line + offset.line : location.line; - return { - line, - column: location.column, - sourceUrl: source.url, - sourceId: source.id - }; -} - -function createSyncData(id, pendingBreakpoint, location, generatedLocation, previousLocation) { - const overrides = _extends({}, pendingBreakpoint, { generatedLocation, id }); - const breakpoint = (0, _breakpoint.createBreakpoint)(location, overrides); - - (0, _breakpoint.assertBreakpoint)(breakpoint); - return { breakpoint, previousLocation }; -} - -// we have three forms of syncing: disabled syncing, existing server syncing -// and adding a new breakpoint -async function syncClientBreakpoint(getState, client, sourceMaps, sourceId, pendingBreakpoint) { - (0, _breakpoint.assertPendingBreakpoint)(pendingBreakpoint); - - const source = (0, _selectors.getSource)(getState(), sourceId).toJS(); - const generatedSourceId = sourceMaps.isOriginalId(sourceId) ? (0, _devtoolsSourceMap.originalToGeneratedId)(sourceId) : sourceId; - - const { location, astLocation } = pendingBreakpoint; - const previousLocation = _extends({}, location, { sourceId }); - - const scopedLocation = await makeScopedLocation(astLocation, previousLocation, source); - - const scopedGeneratedLocation = await (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 - const generatedLocation = _extends({}, pendingBreakpoint.generatedLocation, { - sourceId: generatedSourceId - }); - - const isSameLocation = !(0, _breakpoint.locationMoved)(generatedLocation, scopedGeneratedLocation); - - const 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) { - const id = pendingBreakpoint.disabled ? "" : existingClient.id; - return createSyncData(id, pendingBreakpoint, scopedLocation, scopedGeneratedLocation, previousLocation); - } - - // clear server breakpoints if they exist and we have moved - if (existingClient) { - await 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. - - if (!scopedGeneratedLocation.line) { - return { previousLocation, breakpoint: null }; - } - - const { id, actualLocation } = await 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 - const newGeneratedLocation = actualLocation; - const newLocation = await sourceMaps.getOriginalLocation(newGeneratedLocation); - - return createSyncData(id, pendingBreakpoint, newLocation, newGeneratedLocation, previousLocation); -} - -/***/ }), - -/***/ 3409: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.fetchEventListeners = fetchEventListeners; -exports.updateEventBreakpoints = updateEventBreakpoints; - -var _DevToolsUtils = __webpack_require__(3290); - -var _selectors = __webpack_require__(3193); - -var _waitService = __webpack_require__(3289); - -// delay is in ms -const FETCH_EVENT_LISTENERS_DELAY = 200; /* 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 EVENTS */ -/* eslint no-shadow: 0 */ - -/** - * Redux actions for the event listeners state - * @module actions/event-listeners - */ - -let fetchListenersTimerID; - -/** - * @memberof utils/utils - * @static - */ -async function asPaused(state, client, func) { - if (!(0, _selectors.isPaused)(state)) { - await client.interrupt(); - let result; - - try { - result = await func(client); - } catch (e) { - // Try to put the debugger back in a working state by resuming - // it - await client.resume(); - throw e; - } - - await client.resume(); - return result; - } - - return func(client); -} - -/** - * @memberof actions/event-listeners - * @static - */ -function fetchEventListeners() { - return ({ dispatch, getState, 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: _waitService.NAME, - 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 - }; - }); -} - -async function _getEventListeners(threadClient) { - const response = await 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((a, b) => a.type > b.type ? 1 : -1); - - // Add all the listeners in the debugger view event linsteners container. - const fetchedDefinitions = new Map(); - const listeners = []; - for (const listener of response.listeners) { - let definitionSite; - if (fetchedDefinitions.has(listener.function.actor)) { - definitionSite = fetchedDefinitions.get(listener.function.actor); - } else if (listener.function.class == "Function") { - definitionSite = await _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; -} - -async function _getDefinitionSite(threadClient, func) { - const grip = threadClient.pauseGrip(func); - let response; - - try { - response = await 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; -} - -/** - * @memberof actions/event-listeners - * @static - * @param {string} eventNames - */ -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 - }); - }); - }); - }; -} - -/***/ }), - -/***/ 3410: -/***/ (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; }; /* 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 . */ - -// eslint-disable-next-line max-len - - -exports.mapScopes = mapScopes; - -var _selectors = __webpack_require__(3193); - -var _loadSourceText = __webpack_require__(3226); - -var _parser = __webpack_require__(3203); - -var _promise = __webpack_require__(3206); - -var _locColumn = __webpack_require__(3292); - -var _findGeneratedBindingFromPosition = __webpack_require__(3412); - -var _prefs = __webpack_require__(226); - -var _log = __webpack_require__(3413); - -var _devtoolsSourceMap = __webpack_require__(3197); - -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 mapScopes(scopes, frame) { - return async function ({ dispatch, getState, client, sourceMaps }) { - const generatedSourceRecord = (0, _selectors.getSource)(getState(), frame.generatedLocation.sourceId); - - const sourceRecord = (0, _selectors.getSource)(getState(), frame.location.sourceId); - - const shouldMapScopes = _prefs.features.mapScopes && !generatedSourceRecord.get("isWasm") && !sourceRecord.get("isPrettyPrinted") && !(0, _devtoolsSourceMap.isGeneratedId)(frame.location.sourceId); - - dispatch({ - type: "MAP_SCOPES", - frame, - [_promise.PROMISE]: async function () { - if (!shouldMapScopes) { - return null; - } - - await dispatch((0, _loadSourceText.loadSourceText)(sourceRecord)); - - try { - return await buildMappedScopes(sourceRecord.toJS(), frame, (await scopes), sourceMaps, client); - } catch (e) { - (0, _log.log)(e); - return null; - } - }() - }); - }; -} - -async function buildMappedScopes(source, frame, scopes, sourceMaps, client) { - const originalAstScopes = await (0, _parser.getScopes)(frame.location); - const generatedAstScopes = await (0, _parser.getScopes)(frame.generatedLocation); - - if (!originalAstScopes || !generatedAstScopes) { - return null; - } - - const generatedAstBindings = buildGeneratedBindingList(scopes, generatedAstScopes, frame.this); - - const mappedOriginalScopes = await Promise.all(Array.from(originalAstScopes, async item => { - const generatedBindings = {}; - - await Promise.all(Object.keys(item.bindings).map(async name => { - const binding = item.bindings[name]; - - const result = await findGeneratedBinding(sourceMaps, client, source, name, binding, generatedAstBindings); - - if (result) { - generatedBindings[name] = result; - } - })); - - return _extends({}, item, { - generatedBindings - }); - })); - - return generateClientScope(scopes, mappedOriginalScopes); -} - -function generateClientScope(scopes, originalScopes) { - // Pull the root object scope and root lexical scope to reuse them in - // our mapped scopes. This assumes that file file being processed is - // a CommonJS or ES6 module, which might not be ideal. Potentially - let globalLexicalScope = null; - for (let s = scopes; s.parent; s = s.parent) { - // $FlowIgnore - Flow doesn't like casting 'parent'. - globalLexicalScope = s; - } - if (!globalLexicalScope) { - throw new Error("Assertion failure - there should always be a scope"); - } - - // Build a structure similar to the client's linked scope object using - // the original AST scopes, but pulling in the generated bindings - // linked to each scope. - const result = originalScopes.slice(0, -2).reverse().reduce((acc, orig, i) => { - const _orig$generatedBindin = orig.generatedBindings, - { - // The 'this' binding data we have is handled independently, so - // the binding data is not included here. - // eslint-disable-next-line no-unused-vars - this: _this - } = _orig$generatedBindin, - variables = _objectWithoutProperties(_orig$generatedBindin, ["this"]); - - return _extends({ - // Flow doesn't like casting 'parent'. - parent: acc, - actor: `originalActor${i}`, - type: orig.type, - bindings: { - arguments: [], - variables - } - }, orig.type === "function" ? { - function: { - displayName: orig.displayName - } - } : null, orig.type === "block" ? { - block: { - displayName: orig.displayName - } - } : null); - }, globalLexicalScope); - - // The rendering logic in getScope 'this' bindings only runs on the current - // selected frame scope, so we pluck out the 'this' binding that was mapped, - // and put it in a special location - const thisScope = originalScopes.find(scope => scope.bindings.this); - if (thisScope) { - result.bindings.this = thisScope.generatedBindings.this || null; - } - - return result; -} - -async function findGeneratedBinding(sourceMaps, client, source, name, originalBinding, generatedAstBindings) { - // If there are no references to the implicits, then we have no way to - // even attempt to map it back to the original since there is no location - // data to use. Bail out instead of just showing it as unmapped. - if (originalBinding.type === "implicit" && originalBinding.refs.length === 0) { - return null; - } - - const { declarations, refs } = originalBinding; - - const genContent = await declarations.concat(refs).reduce(async (acc, pos) => { - const result = await acc; - if (result) { - return result; - } - - return await (0, _findGeneratedBindingFromPosition.findGeneratedBindingFromPosition)(sourceMaps, client, source, pos, name, originalBinding.type, generatedAstBindings); - }, null); - - if (genContent && genContent.desc) { - return genContent.desc; - } else if (genContent) { - // If there is no descriptor for 'this', then this is not the top-level - // 'this' that the server gave us a binding for, and we can just ignore it. - if (name === "this") { - return null; - } - - // If the location is found but the descriptor is not, then it - // means that the server scope information didn't match the scope - // information from the DevTools parsed scopes. - return { - configurable: false, - enumerable: true, - writable: false, - value: { - type: "unscoped", - unscoped: true, - - // HACK: Until support for "unscoped" lands in devtools-reps, - // this will make these show as (unavailable). - missingArguments: true - } - }; - } - - // If no location mapping is found, then the map is bad, or - // the map is okay but it original location is inside - // of some scope, but the generated location is outside, leading - // us to search for bindings that don't technically exist. - return { - configurable: false, - enumerable: true, - writable: false, - value: { - type: "unmapped", - unmapped: true, - - // HACK: Until support for "unmapped" lands in devtools-reps, - // this will make these show as (unavailable). - missingArguments: true - } - }; -} - -function buildGeneratedBindingList(scopes, generatedAstScopes, thisBinding) { - const clientScopes = []; - for (let s = scopes; s; s = s.parent) { - clientScopes.push(s); - } - - // The server's binding data doesn't include general 'this' binding - // information, so we manually inject the one 'this' binding we have into - // the normal binding data we are working with. - const frameThisOwner = generatedAstScopes.find(generated => "this" in generated.bindings); - - const generatedBindings = clientScopes.reverse().map((s, i) => { - const generated = generatedAstScopes[generatedAstScopes.length - 1 - i]; - - const bindings = s.bindings ? Object.assign({}, ...s.bindings.arguments, s.bindings.variables) : {}; - - if (generated === frameThisOwner && thisBinding) { - bindings.this = { - value: thisBinding - }; - } - - return { - generated, - client: _extends({}, s, { - bindings - }) - }; - }).slice(2).reduce((acc, { client: { bindings }, generated }) => { - // If the parser worker's result didn't match the client scopes, - // there might not be a generated scope that matches. - if (generated) { - for (const name of Object.keys(generated.bindings)) { - const { declarations, refs } = generated.bindings[name]; - for (const loc of declarations.concat(refs)) { - acc.push({ - name, - loc, - desc: bindings[name] || null - }); - } - } - } - return acc; - }, []) - // Sort so we can binary-search. - .sort((a, b) => { - const aStart = a.loc.start; - const bStart = a.loc.start; - - if (aStart.line === bStart.line) { - return (0, _locColumn.locColumn)(aStart) - (0, _locColumn.locColumn)(bStart); - } - return aStart.line - bStart.line; - }); - - return generatedBindings; -} - -/***/ }), - -/***/ 3411: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = defer; -/* 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 . */ - -function defer() { - let resolve = () => {}; - let reject = () => {}; - const promise = new Promise((_res, _rej) => { - resolve = _res; - reject = _rej; - }); - - return { resolve, reject, promise }; -} - -/***/ }), - -/***/ 3412: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.findGeneratedBindingFromPosition = findGeneratedBindingFromPosition; - -__webpack_require__(3203); - -var _locColumn = __webpack_require__(3292); - -var _firefox = __webpack_require__(3220); - -async function findGeneratedBindingFromPosition(sourceMaps, client, source, pos, name, type, generatedAstBindings) { - const gen = await sourceMaps.getGeneratedLocation(pos.start, source); - const genEnd = await sourceMaps.getGeneratedLocation(pos.end, source); - - // Since the map takes the closest location, sometimes mapping a - // binding's location can point at the start of a binding listed after - // it, so we need to make sure it maps to a location that actually has - // a size in order to avoid picking up the wrong descriptor. - if (gen.line === genEnd.line && gen.column === genEnd.column) { - return null; - } - - return generatedAstBindings.reduce(async (acc, val) => { - const accVal = await acc; - if (accVal) { - return accVal; - } - - if (type === "import") { - const desc = await mapImportBindingToDescriptor(val, { - start: gen, - end: genEnd - }); - - if (desc) { - return { - name: val.name, - desc - }; - } - return null; - } - - // Allow the mapping to point anywhere within the generated binding - // location to allow for less than perfect sourcemaps. Since you also - // need at least one character between identifiers, we also give one - // characters of space at the front the generated binding in order - // to increase the probability of finding the right mapping. - if (gen.line === val.loc.start.line && (0, _locColumn.locColumn)(gen) >= (0, _locColumn.locColumn)(val.loc.start) - 1 && (0, _locColumn.locColumn)(gen) <= (0, _locColumn.locColumn)(val.loc.end)) { - return { - name: val.name, - desc: val.desc - }; - } - - return null; - }, null); -} - -/** - * Given an generated binding, and a range over the generated code, statically - * evaluate accessed properties within the mapped range to resolve the actual - * imported value. - */ - -// eslint-disable-next-line max-len - - -async function mapImportBindingToDescriptor(binding, mapped) { - // Expression matches require broader searching because sourcemaps usage - // varies in how they map certain things. For instance given - // - // import { bar } from "mod"; - // bar(); - // - // The "bar()" expression is generally expanded into one of two possibly - // forms, both of which map the "bar" identifier in different ways. See - // the "^^" markers below for the ranges. - // - // (0, foo.bar)() // Babel - // ^^^^^^^ // mapping - // ^^^ // binding - // vs - // - // Object(foo.bar)() // Webpack - // ^^^^^^^^^^^^^^^ // mapping - // ^^^ // binding - // - // Unfortunately, Webpack also has a tendancy to over-map past the call - // expression to the start of the next line, at least when there isn't - // anything else on that line that is mapped, e.g. - // - // Object(foo.bar)() - // ^^^^^^^^^^^^^^^^^ - // ^ // wrapped to column 0 of next line - - if (!mappingContains(mapped, binding.loc)) { - return null; - } - - const { meta } = binding.loc; - - let desc = binding.desc; - - // Limit to 2 simple property or inherits operartions, since it would - // just be more work to search more and it is very unlikely that - // bindings would be mapped to more than a single member + inherits - // wrapper. - for (let op = meta, index = 0; op && mappingContains(mapped, op) && desc && index < 2; index++, op = op && op.parent) { - // Calling could potentially trigger side-effects, which would not - // be ideal for this case. - if (op.type === "call") { - return null; - } - - if (op.type === "inherit") { - continue; - } - - const objectClient = (0, _firefox.createObjectClient)(desc.value); - desc = (await objectClient.getProperty(op.property)).descriptor; - } - - return desc; -} - -function mappingContains(mapped, item) { - return (item.start.line > mapped.start.line || item.start.line === mapped.start.line && (0, _locColumn.locColumn)(item.start) >= (0, _locColumn.locColumn)(mapped.start)) && (item.end.line < mapped.end.line || item.end.line === mapped.end.line && (0, _locColumn.locColumn)(item.end) <= (0, _locColumn.locColumn)(mapped.end)); -} - -/***/ }), - -/***/ 3413: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.log = log; - -var _devtoolsConfig = __webpack_require__(3198); - -/** - * Produces a formatted console log line by imploding args, prefixed by [log] - * - * function input: log(["hello", "world"]) - * console output: [log] hello world - * - * @memberof utils/log - * @static - */ -function log(...args) { - if (!(0, _devtoolsConfig.isDevelopment)()) { - return; - } - - console.log.apply(console, ["[log]", ...args]); -} /* 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 . */ - -/** - * - * Utils for logging to the console - * Suppresses logging in non-development environment - * - * @module utils/log - */ - -/***/ }), - -/***/ 3414: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.paused = paused; - -var _devtoolsSourceMap = __webpack_require__(3197); - -var _selectors = __webpack_require__(3193); - -var _ = __webpack_require__(3253); - -var _breakpoints = __webpack_require__(3217); - -var _expressions = __webpack_require__(3225); - -var _sources = __webpack_require__(3207); - -var _ui = __webpack_require__(3227); - -var _commands = __webpack_require__(3254); - -var _pause = __webpack_require__(3228); - -var _mapFrames = __webpack_require__(3295); - -var _fetchScopes = __webpack_require__(3255); - -async function getOriginalSourceForFrame(state, frame) { - return (0, _selectors.getSources)(state).get(frame.location.sourceId); -} -/** - * Debugger has just paused - * - * @param {object} pauseInfo - * @memberof actions/pause - * @static - */ -/* 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 . */ - -function paused(pauseInfo) { - return async function ({ dispatch, getState, client, sourceMaps }) { - const { frames, why, loadedObjects } = pauseInfo; - const rootFrame = frames.length > 0 ? frames[0] : null; - - if (rootFrame) { - const mappedFrame = await (0, _mapFrames.updateFrameLocation)(rootFrame, sourceMaps); - const source = await getOriginalSourceForFrame(getState(), mappedFrame); - - // Ensure that the original file has loaded if there is one. - await dispatch((0, _sources.loadSourceText)(source)); - - if (await (0, _pause.shouldStep)(mappedFrame, getState(), sourceMaps)) { - dispatch((0, _commands.command)("stepOver")); - return; - } - } - - dispatch({ - type: "PAUSED", - why, - frames, - selectedFrameId: rootFrame ? rootFrame.id : undefined, - loadedObjects: loadedObjects || [] - }); - - const hiddenBreakpointLocation = (0, _selectors.getHiddenBreakpointLocation)(getState()); - if (hiddenBreakpointLocation) { - dispatch((0, _breakpoints.removeBreakpoint)(hiddenBreakpointLocation)); - } - - if (!(0, _selectors.isEvaluatingExpression)(getState())) { - dispatch((0, _expressions.evaluateExpressions)()); - } - - await dispatch((0, _.mapFrames)()); - const selectedFrame = (0, _selectors.getSelectedFrame)(getState()); - - if (selectedFrame) { - const visibleFrame = (0, _selectors.getVisibleSelectedFrame)(getState()); - const location = (0, _devtoolsSourceMap.isGeneratedId)(visibleFrame.location.sourceId) ? selectedFrame.generatedLocation : selectedFrame.location; - await dispatch((0, _sources.selectLocation)(location)); - } - - dispatch((0, _ui.togglePaneCollapse)("end", false)); - dispatch((0, _fetchScopes.fetchScopes)()); - }; -} - -/***/ }), - -/***/ 3415: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.setInScopeLines = setInScopeLines; - -var _selectors = __webpack_require__(3193); - -var _source = __webpack_require__(3196); - -var _lodash = __webpack_require__(2); - -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))); -} /* 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 . */ - -function setInScopeLines() { - return ({ dispatch, getState }) => { - const source = (0, _selectors.getSelectedSource)(getState()); - const outOfScopeLocations = (0, _selectors.getOutOfScopeLocations)(getState()); - - if (!source || !source.get("text")) { - return; - } - - const linesOutOfScope = getOutOfScopeLines(outOfScopeLocations, source.toJS()); - - const sourceNumLines = (0, _source.getSourceLineCount)(source.toJS()); - const sourceLines = (0, _lodash.range)(1, sourceNumLines + 1); - - const inScopeLines = !linesOutOfScope ? sourceLines : (0, _lodash.without)(sourceLines, ...linesOutOfScope); - - dispatch({ - type: "IN_SCOPE_LINES", - lines: inScopeLines - }); - }; -} - -/***/ }), - -/***/ 3416: -/***/ (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; }; /* 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 . */ - -/** - * Redux actions for the sources state - * @module actions/sources - */ - -exports.loadSourceMap = loadSourceMap; -exports.newSource = newSource; -exports.newSources = newSources; - -var _breakpoints = __webpack_require__(3217); - -var _loadSourceText = __webpack_require__(3226); - -var _prettyPrint = __webpack_require__(3256); - -var _sources = __webpack_require__(3207); - -var _source = __webpack_require__(3196); - -var _selectors = __webpack_require__(3193); - -function createOriginalSource(originalUrl, generatedSource, sourceMaps) { - return { - url: originalUrl, - id: sourceMaps.generatedToOriginalId(generatedSource.id, originalUrl), - isPrettyPrinted: false, - isWasm: false, - isBlackBoxed: false, - loadedState: "unloaded" - }; -} - -/** - * @memberof actions/sources - * @static - */ -function loadSourceMap(generatedSource) { - return async function ({ dispatch, getState, sourceMaps }) { - let urls; - try { - urls = await sourceMaps.getOriginalURLs(generatedSource); - } catch (e) { - console.error(e); - urls = null; - } - if (!urls) { - // If this source doesn't have a sourcemap, enable it for pretty printing - dispatch({ - type: "UPDATE_SOURCE", - source: _extends({}, generatedSource, { sourceMapURL: "" }) - }); - return; - } - - const originalSources = urls.map(url => createOriginalSource(url, generatedSource, sourceMaps)); - - // TODO: check if this line is really needed, it introduces - // a lot of lag to the application. - const generatedSourceRecord = (0, _selectors.getSource)(getState(), generatedSource.id); - await dispatch((0, _loadSourceText.loadSourceText)(generatedSourceRecord)); - dispatch(newSources(originalSources)); - }; -} - -// If a request has been made to show this source, go ahead and -// select it. -function checkSelectedSource(sourceId) { - return async ({ dispatch, getState }) => { - const source = (0, _selectors.getSource)(getState(), sourceId).toJS(); - - const pendingLocation = (0, _selectors.getPendingSelectedLocation)(getState()); - - if (!pendingLocation || !pendingLocation.url || !source.url) { - return; - } - - const pendingUrl = pendingLocation.url; - const rawPendingUrl = (0, _source.getRawSourceURL)(pendingUrl); - - if (rawPendingUrl === source.url) { - if ((0, _source.isPrettyURL)(pendingUrl)) { - return await dispatch((0, _prettyPrint.togglePrettyPrint)(source.id)); - } - - await dispatch((0, _sources.selectLocation)(_extends({}, pendingLocation, { sourceId: source.id }))); - } - }; -} - -function checkPendingBreakpoints(sourceId) { - return async ({ dispatch, getState }) => { - // source may have been modified by selectLocation - const source = (0, _selectors.getSource)(getState(), sourceId); - - const pendingBreakpoints = (0, _selectors.getPendingBreakpointsForSource)(getState(), source.get("url")); - - if (!pendingBreakpoints.size) { - return; - } - - // load the source text if there is a pending breakpoint for it - await dispatch((0, _loadSourceText.loadSourceText)(source)); - - const pendingBreakpointsArray = pendingBreakpoints.valueSeq().toJS(); - for (const pendingBreakpoint of pendingBreakpointsArray) { - await dispatch((0, _breakpoints.syncBreakpoint)(sourceId, pendingBreakpoint)); - } - }; -} - -/** - * Handler for the debugger client's unsolicited newSource notification. - * @memberof actions/sources - * @static - */ -function newSource(source) { - return async ({ dispatch }) => { - await dispatch(newSources([source])); - }; -} - -function newSources(sources) { - return async ({ dispatch, getState }) => { - const filteredSources = sources.filter(source => !(0, _selectors.getSource)(getState(), source.id)); - - if (filteredSources.length == 0) { - return; - } - - dispatch({ - type: "ADD_SOURCES", - sources: filteredSources - }); - - for (const source of filteredSources) { - dispatch(checkSelectedSource(source.id)); - dispatch(checkPendingBreakpoints(source.id)); - } - - return Promise.all(filteredSources.map(source => dispatch(loadSourceMap(source)))); - }; -} - -/***/ }), - -/***/ 3417: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.toggleBlackBox = toggleBlackBox; - -var _promise = __webpack_require__(3206); - -function toggleBlackBox(source) { - return async ({ dispatch, getState, client, sourceMaps }) => { - const { isBlackBoxed, id } = source; - - return dispatch({ - type: "BLACKBOX", - source, - [_promise.PROMISE]: client.blackBox(id, isBlackBoxed) - }); - }; -} /* 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 . */ - -/** - * Redux actions for the sources state - * @module actions/sources - */ - -/***/ }), - -/***/ 3418: -/***/ (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; }; /* 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 . */ - -/** - * Redux actions for the sources state - * @module actions/sources - */ - -exports.selectSourceURL = selectSourceURL; -exports.selectSource = selectSource; -exports.selectLocation = selectLocation; -exports.jumpToMappedLocation = jumpToMappedLocation; -exports.jumpToMappedSelectedLocation = jumpToMappedSelectedLocation; - -var _devtoolsSourceMap = __webpack_require__(3197); - -var _ast = __webpack_require__(3257); - -var _ui = __webpack_require__(3227); - -var _prettyPrint = __webpack_require__(3256); - -var _tabs = __webpack_require__(3293); - -var _loadSourceText = __webpack_require__(3226); - -var _prefs = __webpack_require__(226); - -var _source = __webpack_require__(3196); - -var _location = __webpack_require__(3422); - -var _sourceMaps = __webpack_require__(3252); - -var _selectors = __webpack_require__(3193); - -/** - * 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, options = {}) { - return async ({ dispatch, getState }) => { - const source = (0, _selectors.getSourceByURL)(getState(), url); - if (source) { - const sourceId = source.get("id"); - const location = (0, _location.createLocation)(_extends({}, options.location, { sourceId })); - // flow is unable to comprehend that if an options.location object - // exists, that we have a valid Location object, and if it doesnt, - // we have a valid { sourceId: string } object. So we are overriding - // the error - // $FlowIgnore - await dispatch(selectLocation(location, options.tabIndex)); - } else { - dispatch({ - type: "SELECT_SOURCE_URL", - url: url, - tabIndex: options.tabIndex, - location: options.location - }); - } - }; -} - -/** - * @memberof actions/sources - * @static - */ -function selectSource(sourceId, tabIndex = "") { - return async ({ dispatch }) => { - const location = (0, _location.createLocation)({ sourceId }); - return await dispatch(selectLocation(location, tabIndex)); - }; -} - -/** - * @memberof actions/sources - * @static - */ -function selectLocation(location, tabIndex = "") { - return async ({ dispatch, getState, 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; - } - - const source = (0, _selectors.getSource)(getState(), location.sourceId); - if (!source) { - // If there is no source we deselect the current selected source - return dispatch({ type: "CLEAR_SELECTED_SOURCE" }); - } - - const activeSearch = (0, _selectors.getActiveSearch)(getState()); - if (activeSearch !== "file") { - dispatch((0, _ui.closeActiveSearch)()); - } - - dispatch((0, _tabs.addTab)(source.toJS(), 0)); - - dispatch({ - type: "SELECT_SOURCE", - source: source.toJS(), - tabIndex, - location - }); - - await dispatch((0, _loadSourceText.loadSourceText)(source)); - const selectedSource = (0, _selectors.getSelectedSource)(getState()); - if (!selectedSource) { - return; - } - - const sourceId = selectedSource.get("id"); - if (_prefs.prefs.autoPrettyPrint && !(0, _selectors.getPrettySource)(getState(), sourceId) && (0, _source.shouldPrettyPrint)(selectedSource) && (0, _source.isMinified)(selectedSource)) { - await dispatch((0, _prettyPrint.togglePrettyPrint)(sourceId)); - dispatch((0, _tabs.closeTab)(source.get("url"))); - } - - dispatch((0, _ast.setSymbols)(sourceId)); - dispatch((0, _ast.setOutOfScopeLocations)()); - }; -} - -/** - * @memberof actions/sources - * @static - */ -function jumpToMappedLocation(location) { - return async function ({ dispatch, getState, client, sourceMaps }) { - if (!client) { - return; - } - - const source = (0, _selectors.getSource)(getState(), location.sourceId); - let pairedLocation; - if ((0, _devtoolsSourceMap.isOriginalId)(location.sourceId)) { - pairedLocation = await (0, _sourceMaps.getGeneratedLocation)(getState(), source.toJS(), location, sourceMaps); - } else { - pairedLocation = await sourceMaps.getOriginalLocation(location, source.toJS()); - } - - return dispatch(selectLocation(_extends({}, pairedLocation))); - }; -} - -function jumpToMappedSelectedLocation() { - return async function ({ dispatch, getState }) { - const location = (0, _selectors.getSelectedLocation)(getState()); - await dispatch(jumpToMappedLocation(location)); - }; -} - -/***/ }), - -/***/ 3419: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getTokenLocation = getTokenLocation; -/* 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 . */ - -function getTokenLocation(codeMirror, tokenEl) { - const { left, top, width, height } = tokenEl.getBoundingClientRect(); - const { line, ch } = codeMirror.coordsChar({ - left: left + width / 2, - top: top + height / 2 - }); - - return { - line: line + 1, - column: ch - }; -} - -/***/ }), - -/***/ 3420: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.buildQuery = undefined; -exports.getMatchIndex = getMatchIndex; -exports.removeOverlay = removeOverlay; -exports.find = find; -exports.findNext = findNext; -exports.findPrev = findPrev; - -var _buildQuery = __webpack_require__(3258); - -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) { - const regexQuery = (0, _buildQuery2.default)(query, modifiers, { isGlobal: true }); - return cm.getSearchCursor(regexQuery, pos); -} - -/** - * @memberof utils/source-search - * @static - */ -/* 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 . */ - -function SearchState() { - this.posFrom = this.posTo = this.query = null; - this.overlay = null; - this.results = []; -} - -/** - * @memberof utils/source-search - * @static - */ -function getSearchState(cm, query, modifiers) { - const 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) { - const 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; - const 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) { - const { cm } = ctx; - if (!cm) { - return; - } - const defaultIndex = { line: -1, ch: -1 }; - - return cm.operation(function () { - if (!query || isWhitespace(query)) { - clearSearch(cm, query, modifiers); - return; - } - - const state = getSearchState(cm, query, modifiers); - const isNewQuery = state.query !== query; - state.query = query; - - updateOverlay(cm, state, query, modifiers); - updateCursor(cm, state, keepSelection); - const 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) { - const { cm, ed } = ctx; - let nextMatch; - cm.operation(function () { - const state = getSearchState(cm, query, modifiers); - const pos = getCursorPos(newQuery, rev, state); - - if (!state.query) { - return; - } - - let cursor = getSearchCursor(cm, state.query, pos, modifiers); - - const 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) { - const state = getSearchState(ctx.cm, query, modifiers); - ctx.cm.removeOverlay(state.overlay); - const { line, ch } = ctx.cm.getCursor(); - 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) { - const 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; - -/***/ }), - -/***/ 3421: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.createEditor = createEditor; - -var _sourceEditor = __webpack_require__(197); - -var _sourceEditor2 = _interopRequireDefault(_sourceEditor); - -var _prefs = __webpack_require__(226); - -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 . */ - -function createEditor() { - const gutters = ["breakpoints", "hit-markers", "CodeMirror-linenumbers"]; - - if (_prefs.features.codeFolding) { - gutters.push("CodeMirror-foldgutter"); - } - - return new _sourceEditor2.default({ - mode: "javascript", - foldGutter: _prefs.features.codeFolding, - enableCodeFolding: _prefs.features.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 - } - }); -} - -/***/ }), - -/***/ 3422: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.createLocation = createLocation; -function createLocation({ - sourceId, - line, - column, - sourceUrl -}) { - return { - sourceId, - line, - column, - sourceUrl: sourceUrl || null - }; -} - -/***/ }), - -/***/ 3423: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getPauseReason = getPauseReason; -exports.isException = isException; -exports.isInterrupted = isInterrupted; -exports.inDebuggerEval = inDebuggerEval; - - -// Map protocol pause "why" reason to a valid L10N key -// These are the known unhandled reasons: -// "breakpointConditionThrown", "clientEvaluated" -// "interrupted", "attached" -const 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" -}; /* 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 . */ - -function getPauseReason(why) { - if (!why) { - return null; - } - - const reasonType = why.type; - if (!reasons[reasonType]) { - console.log("Please file an issue: reasonType=", reasonType); - } - return reasons[reasonType]; -} - -function isException(why) { - return why && why.type && why.type === "exception"; -} - -function isInterrupted(why) { - return why && why.type && why.type === "interrupted"; -} - -function inDebuggerEval(why) { - if (why && why.type === "exception" && why.exception && why.exception.preview && why.exception.preview.fileName) { - return why.exception.preview.fileName === "debugger eval code"; - } - - return false; -} - -/***/ }), - -/***/ 3424: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.shouldStep = shouldStep; - -var _lodash = __webpack_require__(2); - -var _devtoolsSourceMap = __webpack_require__(3197); - -var _selectors = __webpack_require__(3193); - -var _parser = __webpack_require__(3203); - -/* 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 . */ - -async function shouldStep(rootFrame, state, sourceMaps) { - if (!rootFrame) { - return false; - } - - const selectedSource = (0, _selectors.getSelectedSource)(state); - const previousFrameInfo = (0, _selectors.getPreviousPauseFrameLocation)(state); - - let previousFrameLoc; - let currentFrameLoc; - - if (selectedSource && (0, _devtoolsSourceMap.isOriginalId)(selectedSource.get("id"))) { - currentFrameLoc = rootFrame.location; - previousFrameLoc = previousFrameInfo && previousFrameInfo.location; - } else { - currentFrameLoc = rootFrame.generatedLocation; - previousFrameLoc = previousFrameInfo && previousFrameInfo.generatedLocation; - } - - return (0, _devtoolsSourceMap.isOriginalId)(currentFrameLoc.sourceId) && (previousFrameLoc && (0, _lodash.isEqual)(previousFrameLoc, currentFrameLoc) || (await (0, _parser.isInvalidPauseLocation)(currentFrameLoc))); -} - -/***/ }), - -/***/ 3425: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.resumed = resumed; - -var _selectors = __webpack_require__(3193); - -var _expressions = __webpack_require__(3225); - -var _pause = __webpack_require__(3228); - -/** - * Debugger has just resumed - * - * @memberof actions/pause - * @static - */ -function resumed() { - return async ({ dispatch, client, getState }) => { - const why = (0, _selectors.getPauseReason)(getState()); - const wasPausedInEval = (0, _pause.inDebuggerEval)(why); - - if (!(0, _selectors.isStepping)(getState()) && !wasPausedInEval) { - await dispatch((0, _expressions.evaluateExpressions)()); - } - - dispatch({ - type: "RESUME" - }); - }; -} /* 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 . */ - -/***/ }), - -/***/ 3426: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.continueToHere = continueToHere; - -var _selectors = __webpack_require__(3193); - -var _breakpoints = __webpack_require__(3217); - -var _commands = __webpack_require__(3254); - -function continueToHere(line) { - return async function ({ dispatch, getState }) { - const source = (0, _selectors.getSelectedSource)(getState()).toJS(); - - await dispatch((0, _breakpoints.addHiddenBreakpoint)({ - line, - column: undefined, - sourceId: source.id - })); - - dispatch((0, _commands.resume)()); - }; -} /* 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 . */ - -/***/ }), - -/***/ 3427: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.breakOnNext = breakOnNext; - - -/** - * 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 ({ dispatch, client }) => { - client.breakOnNext(); - - return dispatch({ - type: "BREAK_ON_NEXT", - value: true - }); - }; -} /* 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 . */ - -/***/ }), - -/***/ 3428: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.setPopupObjectProperties = setPopupObjectProperties; - -var _selectors = __webpack_require__(3193); - -/** - * @memberof actions/pause - * @static - */ -function setPopupObjectProperties(object, properties) { - return ({ dispatch, client, getState }) => { - const objectId = object.actor || object.objectId; - - if ((0, _selectors.getPopupObjectProperties)(getState(), object.actor)) { - return; - } - - dispatch({ - type: "SET_POPUP_OBJECT_PROPERTIES", - objectId, - properties - }); - }; -} /* 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 . */ - -/***/ }), - -/***/ 3429: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.pauseOnExceptions = pauseOnExceptions; - -var _promise = __webpack_require__(3206); - -/** - * - * @memberof actions/pause - * @static - */ -function pauseOnExceptions(shouldPauseOnExceptions, shouldIgnoreCaughtExceptions) { - return ({ dispatch, client }) => { - dispatch({ - type: "PAUSE_ON_EXCEPTIONS", - shouldPauseOnExceptions, - shouldIgnoreCaughtExceptions, - [_promise.PROMISE]: client.pauseOnExceptions(shouldPauseOnExceptions, shouldIgnoreCaughtExceptions) - }); - }; -} /* 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 . */ - -/***/ }), - -/***/ 3430: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.selectFrame = selectFrame; - -var _sources = __webpack_require__(3207); - -var _expressions = __webpack_require__(3225); - -var _fetchScopes = __webpack_require__(3255); - -/** - * @memberof actions/pause - * @static - */ -function selectFrame(frame) { - return async ({ dispatch, client, getState, sourceMaps }) => { - dispatch({ - type: "SELECT_FRAME", - frame - }); - - dispatch((0, _sources.selectLocation)(frame.location)); - - dispatch((0, _expressions.evaluateExpressions)()); - dispatch((0, _fetchScopes.fetchScopes)()); - }; -} /* 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 . */ - -/***/ }), - -/***/ 3431: -/***/ (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__(3200); - -var _sourceQueue = __webpack_require__(3250); - -var _sourceQueue2 = _interopRequireDefault(_sourceQueue); - -var _sources = __webpack_require__(3205); - -var _utils = __webpack_require__(3222); - -var _sources2 = __webpack_require__(3207); - -var _debuggee = __webpack_require__(3296); - -var _parser = __webpack_require__(3203); - -var _wasm = __webpack_require__(3240); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Redux actions for the navigation state - * @module actions/navigation - */ - -/** - * @memberof actions/navigation - * @static - */ -/* 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 . */ - -function willNavigate(_, event) { - return async function ({ dispatch, getState, client, sourceMaps }) { - await sourceMaps.clearSourceMaps(); - (0, _wasm.clearWasmStates)(); - (0, _editor.clearDocuments)(); - (0, _parser.clearSymbols)(); - (0, _parser.clearASTs)(); - (0, _parser.clearScopes)(); - (0, _parser.clearSources)(); - dispatch(navigate(event.url)); - }; -} - -function navigate(url) { - _sourceQueue2.default.clear(); - - return { - type: "NAVIGATE", - url - }; -} - -function connect(url, canRewind) { - return async function ({ dispatch }) { - await dispatch((0, _debuggee.updateWorkers)()); - dispatch({ type: "CONNECT", url, canRewind }); - }; -} - -/** - * @memberof actions/navigation - * @static - */ -function navigated() { - return async function ({ dispatch, getState, client }) { - await (0, _utils.waitForMs)(100); - if ((0, _sources.getSources)(getState()).size == 0) { - const sources = await client.fetchSources(); - dispatch((0, _sources2.newSources)(sources)); - } - }; -} - -/***/ }), - -/***/ 3432: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.doSearch = doSearch; -exports.setFileSearchQuery = setFileSearchQuery; -exports.toggleFileSearchModifier = toggleFileSearchModifier; -exports.updateSearchResults = updateSearchResults; -exports.searchContents = searchContents; -exports.traverseResults = traverseResults; -exports.closeFileSearch = closeFileSearch; - -var _editor = __webpack_require__(3200); - -var _search = __webpack_require__(3251); - -var _selectors = __webpack_require__(3193); - -var _ui = __webpack_require__(3227); - -/* 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 . */ - -function doSearch(query, editor) { - return ({ getState, dispatch }) => { - const selectedSource = (0, _selectors.getSelectedSource)(getState()); - if (!selectedSource || !selectedSource.get("text")) { - return; - } - - dispatch(setFileSearchQuery(query)); - dispatch(searchContents(query, editor)); - }; -} - -function setFileSearchQuery(query) { - return { - type: "UPDATE_FILE_SEARCH_QUERY", - query - }; -} - -function toggleFileSearchModifier(modifier) { - return { type: "TOGGLE_FILE_SEARCH_MODIFIER", modifier }; -} - -function updateSearchResults(characterIndex, line, matches) { - const matchIndex = matches.findIndex(elm => elm.line === line && elm.ch === characterIndex); - - return { - type: "UPDATE_SEARCH_RESULTS", - results: { - matches, - matchIndex, - count: matches.length, - index: characterIndex - } - }; -} - -function searchContents(query, editor) { - return async ({ getState, dispatch }) => { - const modifiers = (0, _selectors.getFileSearchModifiers)(getState()); - const selectedSource = (0, _selectors.getSelectedSource)(getState()); - - if (!query || !editor || !selectedSource || !selectedSource.get("text") || !modifiers) { - return; - } - - const ctx = { ed: editor, cm: editor.codeMirror }; - const _modifiers = modifiers.toJS(); - const matches = await (0, _search.getMatches)(query, selectedSource.get("text"), _modifiers); - - const res = (0, _editor.find)(ctx, query, true, _modifiers); - if (!res) { - return; - } - - const { ch, line } = res; - - dispatch(updateSearchResults(ch, line, matches)); - }; -} - -function traverseResults(rev, editor) { - return async ({ getState, dispatch }) => { - if (!editor) { - return; - } - - const ctx = { ed: editor, cm: editor.codeMirror }; - - const query = (0, _selectors.getFileSearchQuery)(getState()); - const modifiers = (0, _selectors.getFileSearchModifiers)(getState()); - const { matches } = (0, _selectors.getFileSearchResults)(getState()); - - if (query === "") { - dispatch((0, _ui.setActiveSearch)("file")); - } - - if (modifiers) { - const matchedLocations = matches || []; - const results = rev ? (0, _editor.findPrev)(ctx, query, true, modifiers.toJS()) : (0, _editor.findNext)(ctx, query, true, modifiers.toJS()); - - if (!results) { - return; - } - const { ch, line } = results; - dispatch(updateSearchResults(ch, line, matchedLocations)); - } - }; -} - -function closeFileSearch(editor) { - return ({ getState, dispatch }) => { - const modifiers = (0, _selectors.getFileSearchModifiers)(getState()); - const query = (0, _selectors.getFileSearchQuery)(getState()); - - if (editor && modifiers) { - const ctx = { ed: editor, cm: editor.codeMirror }; - (0, _editor.removeOverlay)(ctx, query, modifiers.toJS()); - } - - dispatch(setFileSearchQuery("")); - dispatch((0, _ui.closeActiveSearch)()); - dispatch((0, _ui.clearHighlightLineRange)()); - }; -} - -/***/ }), - -/***/ 3433: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.recordCoverage = recordCoverage; -function recordCoverage() { - return async function ({ dispatch, getState, client }) { - const { coverage } = await client.recordCoverage(); - - return dispatch({ - type: "RECORD_COVERAGE", - value: { coverage } - }); - }; -} /* 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 . */ - -/***/ }), - -/***/ 3434: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.addSearchQuery = addSearchQuery; -exports.clearSearchQuery = clearSearchQuery; -exports.clearSearchResults = clearSearchResults; -exports.clearSearch = clearSearch; -exports.updateSearchStatus = updateSearchStatus; -exports.closeProjectSearch = closeProjectSearch; -exports.searchSources = searchSources; -exports.searchSource = searchSource; - -var _search = __webpack_require__(3251); - -var _selectors = __webpack_require__(3193); - -var _source = __webpack_require__(3196); - -var _sources = __webpack_require__(3207); - -var _projectTextSearch = __webpack_require__(3237); - -function addSearchQuery(query) { - return { type: "ADD_QUERY", query }; -} /* 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 . */ - -/** - * Redux actions for the search state - * @module actions/search - */ - -function clearSearchQuery() { - return { type: "CLEAR_QUERY" }; -} - -function clearSearchResults() { - return { type: "CLEAR_SEARCH_RESULTS" }; -} - -function clearSearch() { - return { type: "CLEAR_SEARCH" }; -} - -function updateSearchStatus(status) { - return { type: "UPDATE_STATUS", status }; -} - -function closeProjectSearch() { - return { type: "CLOSE_PROJECT_SEARCH" }; -} - -function searchSources(query) { - return async ({ dispatch, getState }) => { - await dispatch(clearSearchResults()); - await dispatch(addSearchQuery(query)); - dispatch(updateSearchStatus(_projectTextSearch.statusType.fetching)); - const sources = (0, _selectors.getSources)(getState()); - const validSources = sources.valueSeq().filter(source => !(0, _selectors.hasPrettySource)(getState(), source.get("id")) && !(0, _source.isThirdParty)(source)); - for (const source of validSources) { - await dispatch((0, _sources.loadSourceText)(source)); - await dispatch(searchSource(source.get("id"), query)); - } - dispatch(updateSearchStatus(_projectTextSearch.statusType.done)); - }; -} - -function searchSource(sourceId, query) { - return async ({ dispatch, getState }) => { - const sourceRecord = (0, _selectors.getSource)(getState(), sourceId); - if (!sourceRecord) { - return; - } - - const matches = await (0, _search.findSourceMatches)(sourceRecord.toJS(), query); - if (!matches.length) { - return; - } - dispatch({ - type: "ADD_SEARCH_RESULT", - result: { - sourceId: sourceRecord.get("id"), - filepath: sourceRecord.get("url"), - matches - } - }); - }; -} - -/***/ }), - -/***/ 3435: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.timeTravelTo = timeTravelTo; -exports.clearHistory = clearHistory; - -var _selectors = __webpack_require__(3193); - -var _sources = __webpack_require__(3207); - -/* 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 . */ - -/** - * Redux actions for replay - * @module actions/replay - */ - -function timeTravelTo(position) { - return ({ dispatch, getState }) => { - const data = (0, _selectors.getHistoryFrame)(getState(), position); - dispatch({ - type: "TRAVEL_TO", - data, - position - }); - dispatch((0, _sources.selectLocation)(data.paused.frames[0].location)); - }; -} - -function clearHistory() { - return ({ dispatch, getState }) => { - dispatch({ - type: "CLEAR_HISTORY" - }); - }; -} - -/***/ }), - -/***/ 3436: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.setQuickOpenQuery = setQuickOpenQuery; -exports.openQuickOpen = openQuickOpen; -exports.closeQuickOpen = closeQuickOpen; -function setQuickOpenQuery(query) { - return { - type: "SET_QUICK_OPEN_QUERY", - query - }; -} /* 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 . */ - -function openQuickOpen(query) { - if (query != null) { - return { type: "OPEN_QUICK_OPEN", query }; - } - return { type: "OPEN_QUICK_OPEN" }; -} - -function closeQuickOpen() { - return { type: "CLOSE_QUICK_OPEN" }; -} - -/***/ }), - -/***/ 3437: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.openLink = openLink; -exports.openWorkerToolbox = openWorkerToolbox; -exports.evaluateInConsole = evaluateInConsole; -/* 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 . */ - -const { isDevelopment } = __webpack_require__(3198); -const { getSelectedFrameId } = __webpack_require__(3193); - -/** - * @memberof actions/toolbox - * @static - */ -function openLink(url) { - return async function ({ openLink: openLinkCommand }) { - if (isDevelopment()) { - const win = window.open(url, "_blank"); - win.focus(); - } else { - openLinkCommand(url); - } - }; -} - -function openWorkerToolbox(worker) { - return async function ({ - getState, - openWorkerToolbox: openWorkerToolboxCommand - }) { - if (isDevelopment()) { - alert(worker.url); - } else { - openWorkerToolboxCommand(worker); - } - }; -} - -function evaluateInConsole(inputString) { - return async ({ client, getState }) => { - const frameId = getSelectedFrameId(getState()); - client.evaluate(`console.log("${inputString}"); console.log(${inputString})`, { frameId }); - }; -} - -/***/ }), - -/***/ 3438: -/***/ (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; }; /* 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 . */ - -exports.updatePreview = updatePreview; -exports.setPreview = setPreview; -exports.clearPreview = clearPreview; - -var _ast = __webpack_require__(3439); - -var _editor = __webpack_require__(3200); - -var _preview = __webpack_require__(3298); - -var _devtoolsSourceMap = __webpack_require__(3197); - -var _promise = __webpack_require__(3206); - -var _getExpression = __webpack_require__(3440); - -var _selectors = __webpack_require__(3193); - -var _expressions = __webpack_require__(3225); - -var _lodash = __webpack_require__(2); - -async function getReactProps(evaluate) { - const reactDisplayName = await evaluate("this._reactInternalInstance.getName()"); - - return { - displayName: reactDisplayName.result - }; -} - -async function getImmutableProps(expression, evaluate) { - const immutableEntries = await evaluate((exp => `${exp}.toJS()`)(expression)); - - const immutableType = await evaluate((exp => `${exp}.constructor.name`)(expression)); - - return { - type: immutableType.result, - entries: immutableEntries.result - }; -} - -async function getExtraProps(expression, result, evaluate) { - const props = {}; - if ((0, _preview.isReactComponent)(result)) { - props.react = await getReactProps(evaluate); - } - - if ((0, _preview.isImmutable)(result)) { - props.immutable = await getImmutableProps(expression, evaluate); - } - - return props; -} - -function isInvalidTarget(target) { - if (!target || !target.innerText) { - return true; - } - - const tokenText = target.innerText.trim(); - const cursorPos = target.getBoundingClientRect(); - - // exclude literal tokens where it does not make sense to show a preview - const invaildType = ["cm-string", "cm-number", "cm-atom"].includes(target.className); - - // exclude syntax where the expression would be a syntax error - const invalidToken = tokenText === "" || tokenText.match(/[(){}\|&%,.;=<>\+-/\*\s]/); - - // exclude codemirror elements that are not tokens - const invalidTarget = target.parentElement && !target.parentElement.closest(".CodeMirror-line") || cursorPos.top == 0; - - return invalidTarget || invalidToken || invaildType; -} - -function updatePreview(target, editor) { - return ({ dispatch, getState, client, sourceMaps }) => { - const tokenText = target.innerText ? target.innerText.trim() : ""; - const tokenPos = (0, _editor.getTokenLocation)(editor.codeMirror, target); - const cursorPos = target.getBoundingClientRect(); - const preview = (0, _selectors.getPreview)(getState()); - - if (preview) { - // Return early if we are currently showing another preview or - // if we are mousing over the same token as before - if (preview.updating || (0, _lodash.isEqual)(preview.tokenPos, tokenPos)) { - return; - } - - // We are mousing over a new token that is not in the preview - if (!target.classList.contains("debug-expression")) { - dispatch(clearPreview()); - } - } - - if (isInvalidTarget(target)) { - return; - } - - if (!(0, _selectors.isLineInScope)(getState(), tokenPos.line)) { - return; - } - - const source = (0, _selectors.getSelectedSource)(getState()); - const symbols = (0, _selectors.getSymbols)(getState(), source.toJS()); - - let match; - if (!symbols || symbols.identifiers) { - match = (0, _ast.findBestMatchExpression)(symbols, tokenPos, tokenText); - } else { - match = (0, _getExpression.getExpressionFromCoords)(editor.codeMirror, tokenPos); - } - - if (!match || !match.expression) { - return; - } - - const { expression, location } = match; - dispatch(setPreview(expression, location, tokenPos, cursorPos)); - }; -} - -function setPreview(expression, location, tokenPos, cursorPos) { - return async ({ dispatch, getState, client, sourceMaps }) => { - await dispatch({ - type: "SET_PREVIEW", - [_promise.PROMISE]: async function () { - const source = (0, _selectors.getSelectedSource)(getState()); - - const sourceId = source.get("id"); - if (location && !(0, _devtoolsSourceMap.isGeneratedId)(sourceId)) { - const generatedLocation = await sourceMaps.getGeneratedLocation(_extends({}, location.start, { sourceId }), source.toJS()); - - expression = await (0, _expressions.getMappedExpression)({ sourceMaps }, generatedLocation, expression); - } - - const selectedFrame = (0, _selectors.getSelectedFrame)(getState()); - if (!selectedFrame) { - return; - } - - const { result } = await client.evaluateInFrame(selectedFrame.id, expression); - - if (result === undefined) { - return; - } - - const extra = await getExtraProps(expression, result, expr => client.evaluateInFrame(selectedFrame.id, expr)); - - return { - expression, - result, - location, - tokenPos, - cursorPos, - extra - }; - }() - }); - }; -} - -function clearPreview() { - return ({ dispatch, getState, client }) => { - const currentSelection = (0, _selectors.getPreview)(getState()); - if (!currentSelection) { - return; - } - - return dispatch({ - type: "CLEAR_SELECTION" - }); - }; -} - -/***/ }), - -/***/ 3439: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.findBestMatchExpression = findBestMatchExpression; -/* 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 . */ - -function findBestMatchExpression(symbols, tokenPos, token) { - const { memberExpressions, identifiers } = symbols; - const { line, column } = tokenPos; - return identifiers.concat(memberExpressions).reduce((found, expression) => { - const overlaps = expression.location.start.line == line && expression.location.start.column <= column && expression.location.end.column >= column && !expression.computed; - - if (overlaps) { - return expression; - } - - return found; - }, {}); -} - -/***/ }), - -/***/ 3440: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.tokenAtTextPosition = tokenAtTextPosition; -exports.getExpressionFromCoords = getExpressionFromCoords; -/* 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 . */ - -function tokenAtTextPosition(cm, { line, column }) { - if (line < 0 || line >= cm.lineCount()) { - return null; - } - - const token = cm.getTokenAt({ line: line - 1, ch: column }); - if (!token) { - return null; - } - - return { startColumn: token.start, endColumn: token.end, type: token.type }; -} - -// The strategy of querying codeMirror tokens was borrowed -// from Chrome's inital implementation in JavaScriptSourceFrame.js#L414 -function getExpressionFromCoords(cm, coord) { - const token = tokenAtTextPosition(cm, coord); - if (!token) { - return null; - } - - let startHighlight = token.startColumn; - const endHighlight = token.endColumn; - const lineNumber = coord.line; - const line = cm.doc.getLine(coord.line - 1); - while (startHighlight > 1 && line.charAt(startHighlight - 1) === ".") { - const tokenBefore = tokenAtTextPosition(cm, { - line: coord.line, - column: startHighlight - 2 - }); - - if (!tokenBefore || !tokenBefore.type) { - return null; - } - - startHighlight = tokenBefore.startColumn; - } - const expression = line.substring(startHighlight, endHighlight); - - if (!expression) { - return null; - } - - const location = { - start: { line: lineNumber, column: startHighlight }, - end: { line: lineNumber, column: endHighlight } - }; - return { expression, location }; -} - -/***/ }), - -/***/ 3441: -/***/ (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__(3259); - -var _Modal2 = _interopRequireDefault(_Modal); - -var _classnames = __webpack_require__(175); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _text = __webpack_require__(3242); - -__webpack_require__(3445); - -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"))), - this.renderShorcutItem(L10N.getStr("shortcuts.gotoLine"), (0, _text.formatKeyShortcut)(L10N.getStr("gotoLineModal.key2"))) - ); - } - - 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() { - const { enabled } = this.props; - - if (!enabled) { - return null; - } - - return _react2.default.createElement( - _Modal2.default, - { - "in": enabled, - additionalClass: "shortcuts-modal", - handleClose: this.props.handleClose - }, - this.renderShortcutsContent() - ); - } -} -exports.ShortcutsModal = ShortcutsModal; /* 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 . */ - -/***/ }), - -/***/ 3442: -/***/ (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__(3443); - -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; -}; - - -/***/ }), - -/***/ 3443: -/***/ (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; - - -/***/ }), - -/***/ 3444: -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), - -/***/ 3445: -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), - -/***/ 3446: -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), - -/***/ 3447: -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), - -/***/ 3448: -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), - -/***/ 3449: -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), - -/***/ 3450: -/***/ (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 React = __webpack_require__(0); -const ReactDOM = __webpack_require__(4); -const Draggable = React.createFactory(__webpack_require__(3451)); -const { Component } = React; -const PropTypes = __webpack_require__(20); -const dom = __webpack_require__(1758); - -__webpack_require__(3452); +__webpack_require__(472); /** * This component represents a Splitter. The splitter supports vertical @@ -36073,8 +37705,7 @@ class SplitBox extends Component { module.exports = SplitBox; /***/ }), - -/***/ 3451: +/* 471 */ /***/ (function(module, exports, __webpack_require__) { /* This Source Code Form is subject to the terms of the Mozilla Public @@ -36082,10 +37713,10 @@ module.exports = SplitBox; * You can obtain one at http://mozilla.org/MPL/2.0/. */ const React = __webpack_require__(0); -const ReactDOM = __webpack_require__(4); +const ReactDOM = __webpack_require__(39); const { Component } = React; -const PropTypes = __webpack_require__(20); -const dom = __webpack_require__(1758); +const PropTypes = __webpack_require__(2); +const dom = __webpack_require__(3); class Draggable extends Component { static get propTypes() { @@ -36140,15 +37771,13 @@ class Draggable extends Component { module.exports = Draggable; /***/ }), - -/***/ 3452: +/* 472 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3453: +/* 473 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -36163,7 +37792,7 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -var _propTypes = __webpack_require__(20); +var _propTypes = __webpack_require__(2); var _propTypes2 = _interopRequireDefault(_propTypes); @@ -36171,39 +37800,39 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _reactRedux = __webpack_require__(1189); +var _reactRedux = __webpack_require__(4); -var _classnames = __webpack_require__(175); +var _classnames = __webpack_require__(6); var _classnames2 = _interopRequireDefault(_classnames); -var _redux = __webpack_require__(3); +var _redux = __webpack_require__(8); -var _actions = __webpack_require__(3195); +var _actions = __webpack_require__(7); var _actions2 = _interopRequireDefault(_actions); -var _projectSearch = __webpack_require__(3454); +var _projectSearch = __webpack_require__(474); -var _projectTextSearch = __webpack_require__(3237); +var _projectTextSearch = __webpack_require__(102); -var _sourcesTree = __webpack_require__(3301); +var _sourcesTree = __webpack_require__(235); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -var _Svg = __webpack_require__(3201); +var _Svg = __webpack_require__(22); var _Svg2 = _interopRequireDefault(_Svg); -var _ManagedTree = __webpack_require__(3263); +var _ManagedTree = __webpack_require__(170); var _ManagedTree2 = _interopRequireDefault(_ManagedTree); -var _SearchInput = __webpack_require__(3264); +var _SearchInput = __webpack_require__(171); var _SearchInput2 = _interopRequireDefault(_SearchInput); -__webpack_require__(3468); +__webpack_require__(549); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -36448,8 +38077,7 @@ exports.default = (0, _reactRedux.connect)(state => ({ }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(ProjectSearch); /***/ }), - -/***/ 3454: +/* 474 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -36496,8 +38124,7 @@ function highlightMatches(lineMatch) { // Maybe reuse file search's functions? /***/ }), - -/***/ 3455: +/* 475 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -36510,9 +38137,9 @@ exports.getDomain = getDomain; exports.findNodeInContents = findNodeInContents; exports.createTreeNodeMatcher = createTreeNodeMatcher; -var _url = __webpack_require__(334); +var _url = __webpack_require__(100); -var _utils = __webpack_require__(3210); +var _utils = __webpack_require__(42); /* * Gets domain from url (without www prefix) @@ -36632,8 +38259,7 @@ function createTreeNodeMatcher(part, isDir, debuggeeHost) { } /***/ }), - -/***/ 3456: +/* 476 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -36644,11 +38270,11 @@ Object.defineProperty(exports, "__esModule", { }); exports.createTree = createTree; -var _addToTree = __webpack_require__(3260); +var _addToTree = __webpack_require__(167); -var _collapseTree = __webpack_require__(3262); +var _collapseTree = __webpack_require__(169); -var _utils = __webpack_require__(3210); +var _utils = __webpack_require__(42); function createTree({ sources, debuggeeUrl, projectRoot }) { const uncollapsedTree = (0, _utils.createNode)("root", "", []); @@ -36669,8 +38295,7 @@ function createTree({ sources, debuggeeUrl, projectRoot }) { * file, You can obtain one at . */ /***/ }), - -/***/ 3457: +/* 477 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -36699,8 +38324,7 @@ function formatTree(tree, depth = 0, str = "") { * file, You can obtain one at . */ /***/ }), - -/***/ 3458: +/* 478 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -36711,9 +38335,9 @@ Object.defineProperty(exports, "__esModule", { }); exports.getDirectories = getDirectories; -var _utils = __webpack_require__(3210); +var _utils = __webpack_require__(42); -var _getURL = __webpack_require__(3261); +var _getURL = __webpack_require__(168); /* 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 @@ -36765,8 +38389,7 @@ function getDirectories(sourceUrl, sourceTree) { } /***/ }), - -/***/ 3459: +/* 479 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -36783,7 +38406,7 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument exports.sortEntireTree = sortEntireTree; exports.sortTree = sortTree; -var _utils = __webpack_require__(3210); +var _utils = __webpack_require__(42); /** * Look at the nodes in the source tree, and determine the index of where to @@ -36828,8 +38451,7 @@ function sortTree(tree, debuggeeUrl = "") { } /***/ }), - -/***/ 3460: +/* 480 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -36840,11 +38462,11 @@ Object.defineProperty(exports, "__esModule", { }); exports.updateTree = updateTree; -var _addToTree = __webpack_require__(3260); +var _addToTree = __webpack_require__(167); -var _collapseTree = __webpack_require__(3262); +var _collapseTree = __webpack_require__(169); -var _utils = __webpack_require__(3210); +var _utils = __webpack_require__(42); function newSourcesSet(newSources, prevSources) { const next = newSources.toSet(); @@ -36879,14 +38501,13 @@ function updateTree({ } /***/ }), - -/***/ 3461: +/* 481 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var _svgInlineReact = __webpack_require__(1763); +var _svgInlineReact = __webpack_require__(98); var _svgInlineReact2 = _interopRequireDefault(_svgInlineReact); @@ -36894,69 +38515,69 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de const React = __webpack_require__(0); -const { isDevelopment } = __webpack_require__(3198); +const { isDevelopment } = __webpack_require__(13); const 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), - choo: __webpack_require__(1290), - close: __webpack_require__(352), - coffeescript: __webpack_require__(2250), - dojo: __webpack_require__(806), - domain: __webpack_require__(353), - file: __webpack_require__(354), - folder: __webpack_require__(355), - globe: __webpack_require__(356), - javascript: __webpack_require__(2251), - 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), - preact: __webpack_require__(1233), - aframe: __webpack_require__(1648), - 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), - typescript: __webpack_require__(2252), - "whole-word-match": __webpack_require__(371), - worker: __webpack_require__(372), - "sad-face": __webpack_require__(1347), - refresh: __webpack_require__(1348), - webpack: __webpack_require__(1001), - node: __webpack_require__(1002), - express: __webpack_require__(1003), - pug: __webpack_require__(1004), - extjs: __webpack_require__(1043), - mobx: __webpack_require__(1733), - marko: __webpack_require__(1649), - nextjs: __webpack_require__(1650), - showSources: __webpack_require__(1044), - showOutline: __webpack_require__(1045), - nuxtjs: __webpack_require__(1651), - rxjs: __webpack_require__(1808) + "angle-brackets": __webpack_require__(482), + angular: __webpack_require__(483), + arrow: __webpack_require__(484), + backbone: __webpack_require__(485), + blackBox: __webpack_require__(486), + breakpoint: __webpack_require__(487), + "column-breakpoint": __webpack_require__(488), + "case-match": __webpack_require__(489), + choo: __webpack_require__(490), + close: __webpack_require__(491), + coffeescript: __webpack_require__(492), + dojo: __webpack_require__(493), + domain: __webpack_require__(494), + file: __webpack_require__(495), + folder: __webpack_require__(496), + globe: __webpack_require__(497), + javascript: __webpack_require__(498), + jquery: __webpack_require__(499), + underscore: __webpack_require__(500), + lodash: __webpack_require__(501), + ember: __webpack_require__(502), + vuejs: __webpack_require__(503), + "magnifying-glass": __webpack_require__(504), + "arrow-up": __webpack_require__(505), + "arrow-down": __webpack_require__(506), + pause: __webpack_require__(507), + "pause-exceptions": __webpack_require__(508), + plus: __webpack_require__(509), + preact: __webpack_require__(510), + aframe: __webpack_require__(511), + prettyPrint: __webpack_require__(512), + react: __webpack_require__(513), + "regex-match": __webpack_require__(514), + redux: __webpack_require__(515), + immutable: __webpack_require__(516), + resume: __webpack_require__(517), + settings: __webpack_require__(518), + stepIn: __webpack_require__(519), + stepOut: __webpack_require__(520), + stepOver: __webpack_require__(521), + subSettings: __webpack_require__(522), + toggleBreakpoints: __webpack_require__(523), + togglePanes: __webpack_require__(524), + typescript: __webpack_require__(525), + "whole-word-match": __webpack_require__(526), + worker: __webpack_require__(527), + "sad-face": __webpack_require__(528), + refresh: __webpack_require__(529), + webpack: __webpack_require__(530), + node: __webpack_require__(531), + express: __webpack_require__(532), + pug: __webpack_require__(533), + extjs: __webpack_require__(534), + mobx: __webpack_require__(535), + marko: __webpack_require__(536), + nextjs: __webpack_require__(537), + showSources: __webpack_require__(538), + showOutline: __webpack_require__(539), + nuxtjs: __webpack_require__(540), + rxjs: __webpack_require__(541) }; function Svg({ name, className, onClick, "aria-label": ariaLabel }) { @@ -36990,22 +38611,379 @@ Svg.displayName = "Svg"; module.exports = Svg; /***/ }), +/* 482 */ +/***/ (function(module, exports) { -/***/ 3462: +module.exports = "" + +/***/ }), +/* 483 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 484 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 485 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 486 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 487 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 488 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 489 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 490 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 491 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 492 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 493 */ +/***/ (function(module, exports) { + +module.exports = "dojo_square" + +/***/ }), +/* 494 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 495 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 496 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 497 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 498 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 499 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 500 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 501 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 502 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 503 */ +/***/ (function(module, exports) { + +module.exports = "image/svg+xml" + +/***/ }), +/* 504 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 505 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 506 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 507 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 508 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 509 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 510 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 511 */ +/***/ (function(module, exports) { + +module.exports = "image/svg+xml" + +/***/ }), +/* 512 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 513 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 514 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 515 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 516 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 517 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 518 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 519 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 520 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 521 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 522 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 523 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 524 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 525 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 526 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 527 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 528 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 529 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 530 */ +/***/ (function(module, exports) { + +module.exports = "icon" + +/***/ }), +/* 531 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 532 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 533 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 534 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 535 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 536 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 537 */ +/***/ (function(module, exports) { + +module.exports = "Zeit - Black on white logo" + +/***/ }), +/* 538 */ +/***/ (function(module, exports) { + +module.exports = "Created with Sketch." + +/***/ }), +/* 539 */ +/***/ (function(module, exports) { + +module.exports = "Created with Sketch." + +/***/ }), +/* 540 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 541 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 542 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3463: +/* 543 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3464: +/* 544 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -37019,19 +38997,19 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _reactDomFactories = __webpack_require__(1758); +var _reactDomFactories = __webpack_require__(3); var _reactDomFactories2 = _interopRequireDefault(_reactDomFactories); -var _propTypes = __webpack_require__(20); +var _propTypes = __webpack_require__(2); var _propTypes2 = _interopRequireDefault(_propTypes); -var _svgInlineReact = __webpack_require__(1763); +var _svgInlineReact = __webpack_require__(98); var _svgInlineReact2 = _interopRequireDefault(_svgInlineReact); -var _arrow = __webpack_require__(2247); +var _arrow = __webpack_require__(545); var _arrow2 = _interopRequireDefault(_arrow); @@ -37041,7 +39019,7 @@ const { Component, createFactory, createElement } = _react2.default; /* This Sou * 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__(3465); +__webpack_require__(546); const AUTO_EXPAND_DEPTH = 0; // depth @@ -37799,36 +39777,37 @@ class Tree extends Component { exports.default = Tree; /***/ }), +/* 545 */ +/***/ (function(module, exports) { -/***/ 3465: +module.exports = "" + +/***/ }), +/* 546 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3466: +/* 547 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3467: +/* 548 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3468: +/* 549 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3469: +/* 550 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -37842,31 +39821,31 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _redux = __webpack_require__(3); +var _redux = __webpack_require__(8); -var _reactRedux = __webpack_require__(1189); +var _reactRedux = __webpack_require__(4); -var _text = __webpack_require__(3242); +var _text = __webpack_require__(107); -var _actions = __webpack_require__(3195); +var _actions = __webpack_require__(7); var _actions2 = _interopRequireDefault(_actions); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -var _prefs = __webpack_require__(226); +var _prefs = __webpack_require__(10); -__webpack_require__(3470); +__webpack_require__(551); -var _classnames = __webpack_require__(175); +var _classnames = __webpack_require__(6); var _classnames2 = _interopRequireDefault(_classnames); -var _Outline = __webpack_require__(3471); +var _Outline = __webpack_require__(552); var _Outline2 = _interopRequireDefault(_Outline); -var _SourcesTree = __webpack_require__(3474); +var _SourcesTree = __webpack_require__(555); var _SourcesTree2 = _interopRequireDefault(_SourcesTree); @@ -37963,22 +39942,13 @@ exports.default = (0, _reactRedux.connect)(state => ({ }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(PrimaryPanes); /***/ }), - -/***/ 347: -/***/ (function(module, exports) { - -module.exports = "" - -/***/ }), - -/***/ 3470: +/* 551 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3471: +/* 552 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -37993,23 +39963,23 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _redux = __webpack_require__(3); +var _redux = __webpack_require__(8); -var _reactRedux = __webpack_require__(1189); +var _reactRedux = __webpack_require__(4); -var _actions = __webpack_require__(3195); +var _actions = __webpack_require__(7); var _actions2 = _interopRequireDefault(_actions); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -__webpack_require__(3472); +__webpack_require__(553); -var _PreviewFunction = __webpack_require__(3303); +var _PreviewFunction = __webpack_require__(237); var _PreviewFunction2 = _interopRequireDefault(_PreviewFunction); -var _lodash = __webpack_require__(2); +var _lodash = __webpack_require__(11); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -38029,10 +39999,12 @@ class Outline extends _react.Component { } renderPlaceholder() { + const placeholderMessage = this.props.selectedSource ? L10N.getStr("outline.noFunctions") : L10N.getStr("outline.noFileSelected"); + return _react2.default.createElement( "div", { className: "outline-pane-info" }, - L10N.getStr("outline.noFunctions") + placeholderMessage ); } @@ -38131,22 +40103,19 @@ exports.default = (0, _reactRedux.connect)(state => { }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Outline); /***/ }), - -/***/ 3472: +/* 553 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3473: +/* 554 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3474: +/* 555 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -38160,39 +40129,52 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _classnames = __webpack_require__(175); +var _classnames = __webpack_require__(6); var _classnames2 = _interopRequireDefault(_classnames); -var _devtoolsContextmenu = __webpack_require__(3211); +var _devtoolsContextmenu = __webpack_require__(45); -var _reactRedux = __webpack_require__(1189); +var _reactRedux = __webpack_require__(4); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -var _sourceTree = __webpack_require__(3297); +var _sourceTree = __webpack_require__(232); -var _sources = __webpack_require__(3207); +var _sources = __webpack_require__(34); -var _ui = __webpack_require__(3227); +var _ui = __webpack_require__(77); -var _ManagedTree = __webpack_require__(3263); +var _ManagedTree = __webpack_require__(170); var _ManagedTree2 = _interopRequireDefault(_ManagedTree); -var _Svg = __webpack_require__(3201); +var _Svg = __webpack_require__(22); var _Svg2 = _interopRequireDefault(_Svg); -var _sourcesTree = __webpack_require__(3301); +var _sourcesTree = __webpack_require__(235); -var _clipboard = __webpack_require__(3230); +var _source = __webpack_require__(9); -var _prefs = __webpack_require__(226); +var _clipboard = __webpack_require__(80); + +var _prefs = __webpack_require__(10); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -// Actions +// Utils + + +// Components + + +// Selectors +/* 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 . */ + +// Dependencies class SourcesTree extends _react.Component { constructor(props) { @@ -38240,7 +40222,7 @@ class SourcesTree extends _react.Component { } if (nextProps.selectedSource && nextProps.selectedSource != selectedSource) { - const highlightItems = (0, _sourcesTree.getDirectories)(nextProps.selectedSource.get("url"), sourceTree); + const highlightItems = (0, _sourcesTree.getDirectories)((0, _source.getRawSourceURL)(nextProps.selectedSource.get("url")), sourceTree); return this.setState({ highlightItems }); } @@ -38320,18 +40302,7 @@ class SourcesTree extends _react.Component { } } -// Utils - - -// Components - - -// Selectors -/* 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 . */ - -// Dependencies +// Actions var _initialiseProps = function () { this.focusItem = item => { @@ -38502,8 +40473,7 @@ const actionCreators = { exports.default = (0, _reactRedux.connect)(mapStateToProps, actionCreators)(SourcesTree); /***/ }), - -/***/ 3475: +/* 556 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -38513,7 +40483,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _propTypes = __webpack_require__(20); +var _propTypes = __webpack_require__(2); var _propTypes2 = _interopRequireDefault(_propTypes); @@ -38521,93 +40491,93 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _reactDom = __webpack_require__(4); +var _reactDom = __webpack_require__(39); var _reactDom2 = _interopRequireDefault(_reactDom); -var _reactRedux = __webpack_require__(1189); +var _reactRedux = __webpack_require__(4); -var _classnames = __webpack_require__(175); +var _classnames = __webpack_require__(6); var _classnames2 = _interopRequireDefault(_classnames); -var _devtoolsLaunchpad = __webpack_require__(3218); +var _devtoolsLaunchpad = __webpack_require__(60); -var _source = __webpack_require__(3196); +var _source = __webpack_require__(9); -var _devtoolsConfig = __webpack_require__(3198); +var _devtoolsConfig = __webpack_require__(13); -var _prefs = __webpack_require__(226); +var _prefs = __webpack_require__(10); -var _indentation = __webpack_require__(3239); +var _indentation = __webpack_require__(104); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -var _redux = __webpack_require__(3); +var _redux = __webpack_require__(8); -var _actions = __webpack_require__(3195); +var _actions = __webpack_require__(7); var _actions2 = _interopRequireDefault(_actions); -var _Footer = __webpack_require__(3476); +var _Footer = __webpack_require__(557); var _Footer2 = _interopRequireDefault(_Footer); -var _SearchBar = __webpack_require__(3480); +var _SearchBar = __webpack_require__(561); var _SearchBar2 = _interopRequireDefault(_SearchBar); -var _HighlightLines = __webpack_require__(3482); +var _HighlightLines = __webpack_require__(563); var _HighlightLines2 = _interopRequireDefault(_HighlightLines); -var _Preview = __webpack_require__(3483); +var _Preview = __webpack_require__(564); var _Preview2 = _interopRequireDefault(_Preview); -var _Breakpoints = __webpack_require__(3517); +var _Breakpoints = __webpack_require__(600); var _Breakpoints2 = _interopRequireDefault(_Breakpoints); -var _HitMarker = __webpack_require__(3519); +var _HitMarker = __webpack_require__(602); var _HitMarker2 = _interopRequireDefault(_HitMarker); -var _CallSites = __webpack_require__(3520); +var _CallSites = __webpack_require__(603); var _CallSites2 = _interopRequireDefault(_CallSites); -var _DebugLine = __webpack_require__(3523); +var _DebugLine = __webpack_require__(606); var _DebugLine2 = _interopRequireDefault(_DebugLine); -var _HighlightLine = __webpack_require__(3524); +var _HighlightLine = __webpack_require__(607); var _HighlightLine2 = _interopRequireDefault(_HighlightLine); -var _EmptyLines = __webpack_require__(3525); +var _EmptyLines = __webpack_require__(608); var _EmptyLines2 = _interopRequireDefault(_EmptyLines); -var _GutterMenu = __webpack_require__(3527); +var _GutterMenu = __webpack_require__(610); var _GutterMenu2 = _interopRequireDefault(_GutterMenu); -var _EditorMenu = __webpack_require__(3528); +var _EditorMenu = __webpack_require__(611); var _EditorMenu2 = _interopRequireDefault(_EditorMenu); -var _ConditionalPanel = __webpack_require__(3530); +var _ConditionalPanel = __webpack_require__(613); var _ConditionalPanel2 = _interopRequireDefault(_ConditionalPanel); -var _editor = __webpack_require__(3200); +var _editor = __webpack_require__(15); -var _ui = __webpack_require__(3241); +var _ui = __webpack_require__(106); -__webpack_require__(3532); +__webpack_require__(615); -__webpack_require__(3533); +__webpack_require__(616); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -39100,8 +41070,7 @@ const mapStateToProps = state => { exports.default = (0, _reactRedux.connect)(mapStateToProps, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Editor); /***/ }), - -/***/ 3476: +/* 557 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -39115,33 +41084,33 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _reactRedux = __webpack_require__(1189); +var _reactRedux = __webpack_require__(4); -var _redux = __webpack_require__(3); +var _redux = __webpack_require__(8); -var _actions = __webpack_require__(3195); +var _actions = __webpack_require__(7); var _actions2 = _interopRequireDefault(_actions); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -var _classnames = __webpack_require__(175); +var _classnames = __webpack_require__(6); var _classnames2 = _interopRequireDefault(_classnames); -var _prefs = __webpack_require__(226); +var _prefs = __webpack_require__(10); -var _source = __webpack_require__(3196); +var _source = __webpack_require__(9); -var _sources = __webpack_require__(3205); +var _sources = __webpack_require__(32); -var _editor = __webpack_require__(3200); +var _editor = __webpack_require__(15); -var _PaneToggle = __webpack_require__(3265); +var _PaneToggle = __webpack_require__(172); var _PaneToggle2 = _interopRequireDefault(_PaneToggle); -__webpack_require__(3479); +__webpack_require__(560); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -39322,36 +41291,25 @@ exports.default = (0, _reactRedux.connect)(state => { }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(SourceFooter); /***/ }), - -/***/ 3477: +/* 558 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3478: +/* 559 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3479: +/* 560 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 348: -/***/ (function(module, exports) { - -module.exports = "" - -/***/ }), - -/***/ 3480: +/* 561 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -39361,7 +41319,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _propTypes = __webpack_require__(20); +var _propTypes = __webpack_require__(2); var _propTypes2 = _interopRequireDefault(_propTypes); @@ -39369,35 +41327,35 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _reactRedux = __webpack_require__(1189); +var _reactRedux = __webpack_require__(4); -var _redux = __webpack_require__(3); +var _redux = __webpack_require__(8); -var _Svg = __webpack_require__(3201); +var _Svg = __webpack_require__(22); var _Svg2 = _interopRequireDefault(_Svg); -var _actions = __webpack_require__(3195); +var _actions = __webpack_require__(7); var _actions2 = _interopRequireDefault(_actions); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -var _editor = __webpack_require__(3200); +var _editor = __webpack_require__(15); -var _resultList = __webpack_require__(3305); +var _resultList = __webpack_require__(239); -var _classnames = __webpack_require__(175); +var _classnames = __webpack_require__(6); var _classnames2 = _interopRequireDefault(_classnames); -var _SearchInput = __webpack_require__(3264); +var _SearchInput = __webpack_require__(171); var _SearchInput2 = _interopRequireDefault(_SearchInput); -var _lodash = __webpack_require__(2); +var _lodash = __webpack_require__(11); -__webpack_require__(3481); +__webpack_require__(562); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -39686,15 +41644,13 @@ exports.default = (0, _reactRedux.connect)(state => { }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(SearchBar); /***/ }), - -/***/ 3481: +/* 562 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3482: +/* 563 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -39706,11 +41662,11 @@ Object.defineProperty(exports, "__esModule", { var _react = __webpack_require__(0); -var _lodash = __webpack_require__(2); +var _lodash = __webpack_require__(11); -var _reactRedux = __webpack_require__(1189); +var _reactRedux = __webpack_require__(4); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); /* 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 @@ -39786,8 +41742,7 @@ exports.default = (0, _reactRedux.connect)(state => ({ }))(HighlightLines); /***/ }), - -/***/ 3483: +/* 564 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -39801,21 +41756,21 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _reactRedux = __webpack_require__(1189); +var _reactRedux = __webpack_require__(4); -var _lodash = __webpack_require__(2); +var _lodash = __webpack_require__(11); -var _Popup = __webpack_require__(3484); +var _Popup = __webpack_require__(565); var _Popup2 = _interopRequireDefault(_Popup); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -var _actions = __webpack_require__(3195); +var _actions = __webpack_require__(7); var _actions2 = _interopRequireDefault(_actions); -var _editor = __webpack_require__(3200); +var _editor = __webpack_require__(15); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -39924,8 +41879,7 @@ exports.default = (0, _reactRedux.connect)(state => ({ })(Preview); /***/ }), - -/***/ 3484: +/* 565 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -39940,37 +41894,37 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _reactRedux = __webpack_require__(1189); +var _reactRedux = __webpack_require__(4); -var _devtoolsReps = __webpack_require__(3266); +var _devtoolsReps = __webpack_require__(173); var _devtoolsReps2 = _interopRequireDefault(_devtoolsReps); -var _actions = __webpack_require__(3195); +var _actions = __webpack_require__(7); var _actions2 = _interopRequireDefault(_actions); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -var _Popover = __webpack_require__(3512); +var _Popover = __webpack_require__(595); var _Popover2 = _interopRequireDefault(_Popover); -var _PreviewFunction = __webpack_require__(3303); +var _PreviewFunction = __webpack_require__(237); var _PreviewFunction2 = _interopRequireDefault(_PreviewFunction); -var _editor = __webpack_require__(3200); +var _editor = __webpack_require__(15); -var _preview = __webpack_require__(3298); +var _preview = __webpack_require__(233); -var _Svg = __webpack_require__(3201); +var _Svg = __webpack_require__(22); var _Svg2 = _interopRequireDefault(_Svg); -var _firefox = __webpack_require__(3220); +var _firefox = __webpack_require__(69); -__webpack_require__(3516); +__webpack_require__(599); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -40245,15 +42199,13 @@ exports.default = (0, _reactRedux.connect)(state => ({ })(Popup); /***/ }), - -/***/ 3485: +/* 566 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3486: +/* 567 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -40267,9 +42219,9 @@ exports.default = (0, _reactRedux.connect)(state => ({ const { getGripType, wrapRender -} = __webpack_require__(3194); +} = __webpack_require__(5); -const dom = __webpack_require__(1758); +const dom = __webpack_require__(3); const { span } = dom; /** @@ -40295,8 +42247,7 @@ module.exports = { }; /***/ }), - -/***/ 3487: +/* 568 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -40307,8 +42258,8 @@ module.exports = { * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // Dependencies -const { wrapRender } = __webpack_require__(3194); -const dom = __webpack_require__(1758); +const { wrapRender } = __webpack_require__(5); +const dom = __webpack_require__(3); const { span } = dom; /** @@ -40338,8 +42289,7 @@ module.exports = { }; /***/ }), - -/***/ 3488: +/* 569 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -40350,14 +42300,14 @@ module.exports = { * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // Dependencies -const PropTypes = __webpack_require__(20); +const PropTypes = __webpack_require__(2); const { getGripType, wrapRender -} = __webpack_require__(3194); +} = __webpack_require__(5); -const dom = __webpack_require__(1758); +const dom = __webpack_require__(3); const { span } = dom; /** @@ -40391,8 +42341,7 @@ module.exports = { }; /***/ }), - -/***/ 3489: +/* 570 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -40403,15 +42352,15 @@ module.exports = { * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // Dependencies -const PropTypes = __webpack_require__(20); +const PropTypes = __webpack_require__(2); const { wrapRender, ellipsisElement -} = __webpack_require__(3194); -const PropRep = __webpack_require__(3232); -const { MODE } = __webpack_require__(3199); +} = __webpack_require__(5); +const PropRep = __webpack_require__(82); +const { MODE } = __webpack_require__(14); -const dom = __webpack_require__(1758); +const dom = __webpack_require__(3); const { span } = dom; const DEFAULT_TITLE = "Object"; @@ -40563,15 +42512,7 @@ module.exports = { }; /***/ }), - -/***/ 349: -/***/ (function(module, exports) { - -module.exports = "" - -/***/ }), - -/***/ 3490: +/* 571 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -40582,14 +42523,14 @@ module.exports = "" + +/***/ }), +/* 581 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 582 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -41262,18 +43206,18 @@ module.exports = { * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // ReactJS -const PropTypes = __webpack_require__(20); +const PropTypes = __webpack_require__(2); // Dependencies const { getGripType, isGrip, wrapRender -} = __webpack_require__(3194); +} = __webpack_require__(5); -const PropRep = __webpack_require__(3232); -const { MODE } = __webpack_require__(3199); +const PropRep = __webpack_require__(82); +const { MODE } = __webpack_require__(14); -const dom = __webpack_require__(1758); +const dom = __webpack_require__(3); const { span } = dom; /** @@ -41298,7 +43242,7 @@ function PromiseRep(props) { }; if (props.mode === MODE.TINY) { - let { Rep } = __webpack_require__(3214); + let { Rep } = __webpack_require__(49); return span(config, getTitle(object), span({ className: "objectLeftBrace" @@ -41361,44 +43305,7 @@ module.exports = { }; /***/ }), - -/***/ 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 */ -} - -/***/ }), - -/***/ 350: -/***/ (function(module, exports) { - -module.exports = "" - -/***/ }), - -/***/ 3500: +/* 583 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -41409,16 +43316,16 @@ module.exports = "" - -/***/ }), - -/***/ 3510: +/* 593 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3511: +/* 594 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -42564,7 +44453,7 @@ const { enumNonIndexedProperties, getPrototype, enumSymbols -} = __webpack_require__(3312); +} = __webpack_require__(246); const { getClosestGripNode, @@ -42580,7 +44469,7 @@ const { nodeIsPrimitive, nodeIsProxy, nodeNeedsNumericalBuckets -} = __webpack_require__(3313); +} = __webpack_require__(247); function loadItemProperties(item, createObjectClient, loadedProperties) { const [start, end] = item.meta ? [item.meta.startIndex, item.meta.endIndex] : []; @@ -42685,8 +44574,7 @@ module.exports = { }; /***/ }), - -/***/ 3512: +/* 595 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -42700,15 +44588,15 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _classnames = __webpack_require__(175); +var _classnames = __webpack_require__(6); var _classnames2 = _interopRequireDefault(_classnames); -var _BracketArrow = __webpack_require__(3513); +var _BracketArrow = __webpack_require__(596); var _BracketArrow2 = _interopRequireDefault(_BracketArrow); -__webpack_require__(3515); +__webpack_require__(598); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -42868,8 +44756,7 @@ Popover.defaultProps = { exports.default = Popover; /***/ }), - -/***/ 3513: +/* 596 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -42883,11 +44770,11 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _classnames = __webpack_require__(175); +var _classnames = __webpack_require__(6); var _classnames2 = _interopRequireDefault(_classnames); -__webpack_require__(3514); +__webpack_require__(597); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -42908,29 +44795,25 @@ const BracketArrow = ({ exports.default = BracketArrow; /***/ }), - -/***/ 3514: +/* 597 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3515: +/* 598 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3516: +/* 599 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3517: +/* 600 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -42940,21 +44823,21 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _reactRedux = __webpack_require__(1189); +var _reactRedux = __webpack_require__(4); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _Breakpoint = __webpack_require__(3518); +var _Breakpoint = __webpack_require__(601); var _Breakpoint2 = _interopRequireDefault(_Breakpoint); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -var _breakpoint = __webpack_require__(3209); +var _breakpoint = __webpack_require__(41); -var _source = __webpack_require__(3196); +var _source = __webpack_require__(9); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -42999,8 +44882,7 @@ exports.default = (0, _reactRedux.connect)(state => ({ }))(Breakpoints); /***/ }), - -/***/ 3518: +/* 601 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -43014,21 +44896,21 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _reactDom = __webpack_require__(4); +var _reactDom = __webpack_require__(39); var _reactDom2 = _interopRequireDefault(_reactDom); -var _classnames = __webpack_require__(175); +var _classnames = __webpack_require__(6); var _classnames2 = _interopRequireDefault(_classnames); -var _Svg = __webpack_require__(3201); +var _Svg = __webpack_require__(22); var _Svg2 = _interopRequireDefault(_Svg); -var _editor = __webpack_require__(3200); +var _editor = __webpack_require__(15); -var _prefs = __webpack_require__(226); +var _prefs = __webpack_require__(10); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -43134,8 +45016,7 @@ class Breakpoint extends _react.Component { exports.default = Breakpoint; /***/ }), - -/***/ 3519: +/* 602 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -43195,15 +45076,7 @@ class HitMarker extends _react.Component { exports.default = HitMarker; /***/ }), - -/***/ 352: -/***/ (function(module, exports) { - -module.exports = "" - -/***/ }), - -/***/ 3520: +/* 603 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -43221,21 +45094,21 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _reactRedux = __webpack_require__(1189); +var _reactRedux = __webpack_require__(4); -var _lodash = __webpack_require__(2); +var _lodash = __webpack_require__(11); -var _CallSite = __webpack_require__(3521); +var _CallSite = __webpack_require__(604); var _CallSite2 = _interopRequireDefault(_CallSite); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -var _editor = __webpack_require__(3200); +var _editor = __webpack_require__(15); -var _wasm = __webpack_require__(3240); +var _wasm = __webpack_require__(105); -var _actions = __webpack_require__(3195); +var _actions = __webpack_require__(7); var _actions2 = _interopRequireDefault(_actions); @@ -43429,8 +45302,7 @@ exports.default = (0, _reactRedux.connect)(state => { })(CallSites); /***/ }), - -/***/ 3521: +/* 604 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -43442,13 +45314,13 @@ Object.defineProperty(exports, "__esModule", { var _react = __webpack_require__(0); -var _editor = __webpack_require__(3200); +var _editor = __webpack_require__(15); /* 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 . */ -__webpack_require__(3522); +__webpack_require__(605); class CallSite extends _react.Component { @@ -43524,15 +45396,13 @@ class CallSite extends _react.Component { exports.default = CallSite; /***/ }), - -/***/ 3522: +/* 605 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3523: +/* 606 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -43545,17 +45415,17 @@ exports.DebugLine = undefined; var _react = __webpack_require__(0); -var _editor = __webpack_require__(3200); +var _editor = __webpack_require__(15); -var _source = __webpack_require__(3196); +var _source = __webpack_require__(9); -var _pause = __webpack_require__(3228); +var _pause = __webpack_require__(78); -var _indentation = __webpack_require__(3239); +var _indentation = __webpack_require__(104); -var _reactRedux = __webpack_require__(1189); +var _reactRedux = __webpack_require__(4); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); function isDocumentReady(selectedSource, selectedFrame) { return selectedFrame && (0, _source.isLoaded)(selectedSource) && (0, _editor.hasDocument)(selectedFrame.location.sourceId); @@ -43639,8 +45509,7 @@ exports.default = (0, _reactRedux.connect)(state => { })(DebugLine); /***/ }), - -/***/ 3524: +/* 607 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -43653,15 +45522,15 @@ exports.HighlightLine = undefined; var _react = __webpack_require__(0); -var _editor = __webpack_require__(3200); +var _editor = __webpack_require__(15); -var _sourceDocuments = __webpack_require__(3294); +var _sourceDocuments = __webpack_require__(228); -var _source = __webpack_require__(3196); +var _source = __webpack_require__(9); -var _reactRedux = __webpack_require__(1189); +var _reactRedux = __webpack_require__(4); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); /* 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 @@ -43728,8 +45597,7 @@ exports.default = (0, _reactRedux.connect)(state => ({ }))(HighlightLine); /***/ }), - -/***/ 3525: +/* 608 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -43739,15 +45607,15 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _reactRedux = __webpack_require__(1189); +var _reactRedux = __webpack_require__(4); var _react = __webpack_require__(0); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -var _editor = __webpack_require__(3200); +var _editor = __webpack_require__(15); -__webpack_require__(3526); +__webpack_require__(609); class EmptyLines extends _react.Component { @@ -43803,15 +45671,13 @@ exports.default = (0, _reactRedux.connect)(state => { })(EmptyLines); /***/ }), - -/***/ 3526: +/* 609 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3527: +/* 610 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -43829,17 +45695,17 @@ exports.gutterMenu = gutterMenu; var _react = __webpack_require__(0); -var _devtoolsContextmenu = __webpack_require__(3211); +var _devtoolsContextmenu = __webpack_require__(45); -var _redux = __webpack_require__(3); +var _redux = __webpack_require__(8); -var _reactRedux = __webpack_require__(1189); +var _reactRedux = __webpack_require__(4); -var _editor = __webpack_require__(3200); +var _editor = __webpack_require__(15); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -var _actions = __webpack_require__(3195); +var _actions = __webpack_require__(7); var _actions2 = _interopRequireDefault(_actions); @@ -43982,8 +45848,7 @@ exports.default = (0, _reactRedux.connect)(state => { }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(GutterContextMenuComponent); /***/ }), - -/***/ 3528: +/* 611 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -43995,25 +45860,25 @@ Object.defineProperty(exports, "__esModule", { var _react = __webpack_require__(0); -var _reactRedux = __webpack_require__(1189); +var _reactRedux = __webpack_require__(4); -var _devtoolsLaunchpad = __webpack_require__(3218); +var _devtoolsLaunchpad = __webpack_require__(60); -var _devtoolsSourceMap = __webpack_require__(3197); +var _devtoolsSourceMap = __webpack_require__(12); -var _clipboard = __webpack_require__(3230); +var _clipboard = __webpack_require__(80); -var _function = __webpack_require__(3529); +var _function = __webpack_require__(612); -var _astBreakpointLocation = __webpack_require__(3245); +var _astBreakpointLocation = __webpack_require__(148); -var _editor = __webpack_require__(3200); +var _editor = __webpack_require__(15); -var _source = __webpack_require__(3196); +var _source = __webpack_require__(9); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -var _actions = __webpack_require__(3195); +var _actions = __webpack_require__(7); var _actions2 = _interopRequireDefault(_actions); @@ -44219,8 +46084,7 @@ exports.default = (0, _reactRedux.connect)(state => { })(EditorMenu); /***/ }), - -/***/ 3529: +/* 612 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -44231,9 +46095,9 @@ Object.defineProperty(exports, "__esModule", { }); exports.findFunctionText = findFunctionText; -var _astBreakpointLocation = __webpack_require__(3245); +var _astBreakpointLocation = __webpack_require__(148); -var _indentation = __webpack_require__(3239); +var _indentation = __webpack_require__(104); /* 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 @@ -44257,15 +46121,7 @@ function findFunctionText(line, source, symbols) { } /***/ }), - -/***/ 353: -/***/ (function(module, exports) { - -module.exports = "" - -/***/ }), - -/***/ 3530: +/* 613 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -44280,21 +46136,21 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _reactDom = __webpack_require__(4); +var _reactDom = __webpack_require__(39); var _reactDom2 = _interopRequireDefault(_reactDom); -var _reactRedux = __webpack_require__(1189); +var _reactRedux = __webpack_require__(4); -__webpack_require__(3531); +__webpack_require__(614); -var _editor = __webpack_require__(3200); +var _editor = __webpack_require__(15); -var _actions = __webpack_require__(3195); +var _actions = __webpack_require__(7); var _actions2 = _interopRequireDefault(_actions); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -44464,29 +46320,25 @@ exports.default = (0, _reactRedux.connect)(state => { })(ConditionalPanel); /***/ }), - -/***/ 3531: +/* 614 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3532: +/* 615 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3533: +/* 616 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3534: +/* 617 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -44496,7 +46348,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _propTypes = __webpack_require__(20); +var _propTypes = __webpack_require__(2); var _propTypes2 = _interopRequireDefault(_propTypes); @@ -44504,71 +46356,71 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _reactRedux = __webpack_require__(1189); +var _reactRedux = __webpack_require__(4); -var _redux = __webpack_require__(3); +var _redux = __webpack_require__(8); -var _actions = __webpack_require__(3195); +var _actions = __webpack_require__(7); var _actions2 = _interopRequireDefault(_actions); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -var _Svg = __webpack_require__(3201); +var _Svg = __webpack_require__(22); var _Svg2 = _interopRequireDefault(_Svg); -var _prefs = __webpack_require__(226); +var _prefs = __webpack_require__(10); -var _Breakpoints = __webpack_require__(3535); +var _Breakpoints = __webpack_require__(618); var _Breakpoints2 = _interopRequireDefault(_Breakpoints); -var _Expressions = __webpack_require__(3538); +var _Expressions = __webpack_require__(621); var _Expressions2 = _interopRequireDefault(_Expressions); -var _devtoolsSplitter = __webpack_require__(3300); +var _devtoolsSplitter = __webpack_require__(234); var _devtoolsSplitter2 = _interopRequireDefault(_devtoolsSplitter); -var _Frames = __webpack_require__(3540); +var _Frames = __webpack_require__(623); var _Frames2 = _interopRequireDefault(_Frames); -var _EventListeners = __webpack_require__(3548); +var _EventListeners = __webpack_require__(631); var _EventListeners2 = _interopRequireDefault(_EventListeners); -var _Workers = __webpack_require__(3550); +var _Workers = __webpack_require__(633); var _Workers2 = _interopRequireDefault(_Workers); -var _Accordion = __webpack_require__(3552); +var _Accordion = __webpack_require__(635); var _Accordion2 = _interopRequireDefault(_Accordion); -var _CommandBar = __webpack_require__(3554); +var _CommandBar = __webpack_require__(637); var _CommandBar2 = _interopRequireDefault(_CommandBar); -var _UtilsBar = __webpack_require__(3555); +var _UtilsBar = __webpack_require__(638); var _UtilsBar2 = _interopRequireDefault(_UtilsBar); -var _BreakpointsDropdown = __webpack_require__(3556); +var _BreakpointsDropdown = __webpack_require__(639); var _BreakpointsDropdown2 = _interopRequireDefault(_BreakpointsDropdown); -var _ChromeScopes = __webpack_require__(3559); +var _ChromeScopes = __webpack_require__(642); var _ChromeScopes2 = _interopRequireDefault(_ChromeScopes); -var _Scopes2 = __webpack_require__(3560); +var _Scopes2 = __webpack_require__(643); var _Scopes3 = _interopRequireDefault(_Scopes2); -__webpack_require__(3565); +__webpack_require__(648); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -44727,7 +46579,7 @@ class SecondaryPanes extends _react.Component { items.push(this.getBreakpointsItem()); - if (this.props.isPaused) { + if (this.props.hasFrames) { items.push(this.getCallStackItem()); if (this.props.horizontal) { items.push(this.getScopeItem()); @@ -44764,7 +46616,7 @@ class SecondaryPanes extends _react.Component { items.push(this.getWatchItem()); - if (this.props.isPaused) { + if (this.props.hasFrames) { items = [...items, this.getScopeItem()]; } @@ -44817,7 +46669,7 @@ SecondaryPanes.contextTypes = { }; exports.default = (0, _reactRedux.connect)(state => ({ - isPaused: (0, _selectors.isPaused)(state), + hasFrames: !!(0, _selectors.getTopFrame)(state), breakpoints: (0, _selectors.getBreakpoints)(state), breakpointsDisabled: (0, _selectors.getBreakpointsDisabled)(state), breakpointsLoading: (0, _selectors.getBreakpointsLoading)(state), @@ -44828,8 +46680,7 @@ exports.default = (0, _reactRedux.connect)(state => ({ }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(SecondaryPanes); /***/ }), - -/***/ 3535: +/* 618 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -44847,47 +46698,47 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _redux = __webpack_require__(3); +var _redux = __webpack_require__(8); -var _reactRedux = __webpack_require__(1189); +var _reactRedux = __webpack_require__(4); -var _immutable = __webpack_require__(146); +var _immutable = __webpack_require__(19); var I = _interopRequireWildcard(_immutable); -var _classnames = __webpack_require__(175); +var _classnames = __webpack_require__(6); var _classnames2 = _interopRequireDefault(_classnames); -var _reselect = __webpack_require__(993); +var _reselect = __webpack_require__(48); -var _lodash = __webpack_require__(2); +var _lodash = __webpack_require__(11); -var _actions = __webpack_require__(3195); +var _actions = __webpack_require__(7); var _actions2 = _interopRequireDefault(_actions); -var _Close = __webpack_require__(3229); +var _Close = __webpack_require__(79); var _Close2 = _interopRequireDefault(_Close); -var _utils = __webpack_require__(3222); +var _utils = __webpack_require__(72); -var _prefs = __webpack_require__(226); +var _prefs = __webpack_require__(10); -var _source = __webpack_require__(3196); +var _source = __webpack_require__(9); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -var _pause = __webpack_require__(3228); +var _pause = __webpack_require__(78); -var _breakpoint = __webpack_require__(3209); +var _breakpoint = __webpack_require__(41); -var _BreakpointsContextMenu = __webpack_require__(3536); +var _BreakpointsContextMenu = __webpack_require__(619); var _BreakpointsContextMenu2 = _interopRequireDefault(_BreakpointsContextMenu); -__webpack_require__(3537); +__webpack_require__(620); 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; } } @@ -45034,8 +46885,7 @@ const _getBreakpoints = (0, _reselect.createSelector)(_selectors.getBreakpoints, exports.default = (0, _reactRedux.connect)((state, props) => ({ breakpoints: _getBreakpoints(state) }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Breakpoints); /***/ }), - -/***/ 3536: +/* 619 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45046,7 +46896,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = showContextMenu; -var _devtoolsContextmenu = __webpack_require__(3211); +var _devtoolsContextmenu = __webpack_require__(45); function showContextMenu(props) { const { @@ -45227,15 +47077,13 @@ function showContextMenu(props) { } /***/ }), - -/***/ 3537: +/* 620 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3538: +/* 621 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45249,29 +47097,29 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _reactRedux = __webpack_require__(1189); +var _reactRedux = __webpack_require__(4); -var _classnames = __webpack_require__(175); +var _classnames = __webpack_require__(6); var _classnames2 = _interopRequireDefault(_classnames); -var _devtoolsReps = __webpack_require__(3266); +var _devtoolsReps = __webpack_require__(173); -var _actions = __webpack_require__(3195); +var _actions = __webpack_require__(7); var _actions2 = _interopRequireDefault(_actions); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -var _expressions = __webpack_require__(3291); +var _expressions = __webpack_require__(225); -var _firefox = __webpack_require__(3220); +var _firefox = __webpack_require__(69); -var _Close = __webpack_require__(3229); +var _Close = __webpack_require__(79); var _Close2 = _interopRequireDefault(_Close); -__webpack_require__(3539); +__webpack_require__(622); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -45478,22 +47326,13 @@ exports.default = (0, _reactRedux.connect)(state => ({ }), _actions2.default)(Expressions); /***/ }), - -/***/ 3539: +/* 622 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 354: -/***/ (function(module, exports) { - -module.exports = "" - -/***/ }), - -/***/ 3540: +/* 623 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45507,33 +47346,33 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _redux = __webpack_require__(3); +var _redux = __webpack_require__(8); -var _reactRedux = __webpack_require__(1189); +var _reactRedux = __webpack_require__(4); -var _Frame = __webpack_require__(3314); +var _Frame = __webpack_require__(248); var _Frame2 = _interopRequireDefault(_Frame); -var _Group = __webpack_require__(3541); +var _Group = __webpack_require__(624); var _Group2 = _interopRequireDefault(_Group); -var _WhyPaused = __webpack_require__(3545); +var _WhyPaused = __webpack_require__(628); var _WhyPaused2 = _interopRequireDefault(_WhyPaused); -var _actions = __webpack_require__(3195); +var _actions = __webpack_require__(7); var _actions2 = _interopRequireDefault(_actions); -var _frame = __webpack_require__(3216); +var _frame = __webpack_require__(58); -var _clipboard = __webpack_require__(3230); +var _clipboard = __webpack_require__(80); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -__webpack_require__(3547); +__webpack_require__(630); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -45562,9 +47401,9 @@ class Frames extends _react.Component { } toggleFramesDisplay() { - this.setState({ - showAllFrames: !this.state.showAllFrames - }); + this.setState(prevState => ({ + showAllFrames: !prevState.showAllFrames + })); } collapseFrames(frames) { @@ -45682,8 +47521,7 @@ exports.default = (0, _reactRedux.connect)(state => ({ }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Frames); /***/ }), - -/***/ 3541: +/* 624 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45697,27 +47535,27 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _classnames = __webpack_require__(175); +var _classnames = __webpack_require__(6); var _classnames2 = _interopRequireDefault(_classnames); -var _Svg = __webpack_require__(3201); +var _Svg = __webpack_require__(22); var _Svg2 = _interopRequireDefault(_Svg); -var _frame = __webpack_require__(3216); +var _frame = __webpack_require__(58); -var _FrameMenu = __webpack_require__(3315); +var _FrameMenu = __webpack_require__(249); var _FrameMenu2 = _interopRequireDefault(_FrameMenu); -__webpack_require__(3542); +__webpack_require__(625); -var _Frame = __webpack_require__(3314); +var _Frame = __webpack_require__(248); var _Frame2 = _interopRequireDefault(_Frame); -var _Badge = __webpack_require__(3543); +var _Badge = __webpack_require__(626); var _Badge2 = _interopRequireDefault(_Badge); @@ -45749,7 +47587,7 @@ class Group extends _react.Component { super(...args); this.toggleFrames = () => { - this.setState({ expanded: !this.state.expanded }); + this.setState(prevState => ({ expanded: !prevState.expanded })); }; this.state = { expanded: false }; @@ -45848,15 +47686,13 @@ exports.default = Group; Group.displayName = "Group"; /***/ }), - -/***/ 3542: +/* 625 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3543: +/* 626 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45870,7 +47706,7 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -__webpack_require__(3544); +__webpack_require__(627); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -45883,15 +47719,13 @@ const Badge = ({ children }) => _react2.default.createElement( exports.default = Badge; /***/ }), - -/***/ 3544: +/* 627 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3545: +/* 628 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45906,9 +47740,9 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _pause = __webpack_require__(3228); +var _pause = __webpack_require__(78); -__webpack_require__(3546); +__webpack_require__(629); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -45968,22 +47802,19 @@ function renderWhyPaused(why) { renderWhyPaused.displayName = "whyPaused"; /***/ }), - -/***/ 3546: +/* 629 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3547: +/* 630 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3548: +/* 631 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -46001,21 +47832,21 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _redux = __webpack_require__(3); +var _redux = __webpack_require__(8); -var _reactRedux = __webpack_require__(1189); +var _reactRedux = __webpack_require__(4); -var _actions = __webpack_require__(3195); +var _actions = __webpack_require__(7); var _actions2 = _interopRequireDefault(_actions); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -var _Close = __webpack_require__(3229); +var _Close = __webpack_require__(79); var _Close2 = _interopRequireDefault(_Close); -__webpack_require__(3549); +__webpack_require__(632); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -46106,22 +47937,13 @@ exports.default = (0, _reactRedux.connect)(state => { }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(EventListeners); /***/ }), - -/***/ 3549: +/* 632 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 355: -/***/ (function(module, exports) { - -module.exports = "" - -/***/ }), - -/***/ 3550: +/* 633 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -46136,19 +47958,19 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _redux = __webpack_require__(3); +var _redux = __webpack_require__(8); -var _reactRedux = __webpack_require__(1189); +var _reactRedux = __webpack_require__(4); -__webpack_require__(3551); +__webpack_require__(634); -var _actions = __webpack_require__(3195); +var _actions = __webpack_require__(7); var _actions2 = _interopRequireDefault(_actions); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -var _path = __webpack_require__(3247); +var _path = __webpack_require__(153); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -46195,15 +48017,13 @@ exports.default = (0, _reactRedux.connect)(state => { }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Workers); /***/ }), - -/***/ 3551: +/* 634 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3552: +/* 635 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -46217,11 +48037,11 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _Svg = __webpack_require__(3201); +var _Svg = __webpack_require__(22); var _Svg2 = _interopRequireDefault(_Svg); -__webpack_require__(3553); +__webpack_require__(636); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -46288,15 +48108,13 @@ class Accordion extends _react.Component { exports.default = Accordion; /***/ }), - -/***/ 3553: +/* 636 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3554: +/* 637 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -46306,7 +48124,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _propTypes = __webpack_require__(20); +var _propTypes = __webpack_require__(2); var _propTypes2 = _interopRequireDefault(_propTypes); @@ -46314,31 +48132,31 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _reactRedux = __webpack_require__(1189); +var _reactRedux = __webpack_require__(4); -var _redux = __webpack_require__(3); +var _redux = __webpack_require__(8); -var _classnames = __webpack_require__(175); +var _classnames = __webpack_require__(6); var _classnames2 = _interopRequireDefault(_classnames); -var _prefs = __webpack_require__(226); +var _prefs = __webpack_require__(10); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -var _text = __webpack_require__(3242); +var _text = __webpack_require__(107); -var _actions = __webpack_require__(3195); +var _actions = __webpack_require__(7); var _actions2 = _interopRequireDefault(_actions); -var _CommandBarButton = __webpack_require__(3304); +var _CommandBarButton = __webpack_require__(238); var _CommandBarButton2 = _interopRequireDefault(_CommandBarButton); -__webpack_require__(3316); +__webpack_require__(250); -var _devtoolsModules = __webpack_require__(3221); +var _devtoolsModules = __webpack_require__(70); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -46610,8 +48428,7 @@ exports.default = (0, _reactRedux.connect)(state => { }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(CommandBar); /***/ }), - -/***/ 3555: +/* 638 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -46629,11 +48446,11 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _classnames = __webpack_require__(175); +var _classnames = __webpack_require__(6); var _classnames2 = _interopRequireDefault(_classnames); -__webpack_require__(3316); +__webpack_require__(250); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -46674,8 +48491,7 @@ class UtilsBar extends _react.Component { exports.default = UtilsBar; /***/ }), - -/***/ 3556: +/* 639 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -46690,19 +48506,19 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _Svg = __webpack_require__(3201); +var _Svg = __webpack_require__(22); var _Svg2 = _interopRequireDefault(_Svg); -var _Dropdown = __webpack_require__(3317); +var _Dropdown = __webpack_require__(251); var _Dropdown2 = _interopRequireDefault(_Dropdown); -var _classnames = __webpack_require__(175); +var _classnames = __webpack_require__(6); var _classnames2 = _interopRequireDefault(_classnames); -__webpack_require__(3558); +__webpack_require__(641); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -46836,22 +48652,19 @@ function renderBreakpointsDropdown(breakOnNext, pauseOnExceptions, shouldPauseOn } /***/ }), - -/***/ 3557: +/* 640 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3558: +/* 641 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3559: +/* 642 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -46865,29 +48678,29 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _redux = __webpack_require__(3); +var _redux = __webpack_require__(8); -var _reactRedux = __webpack_require__(1189); +var _reactRedux = __webpack_require__(4); -var _classnames = __webpack_require__(175); +var _classnames = __webpack_require__(6); var _classnames2 = _interopRequireDefault(_classnames); -var _actions = __webpack_require__(3195); +var _actions = __webpack_require__(7); var _actions2 = _interopRequireDefault(_actions); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -var _Svg = __webpack_require__(3201); +var _Svg = __webpack_require__(22); var _Svg2 = _interopRequireDefault(_Svg); -var _ManagedTree = __webpack_require__(3263); +var _ManagedTree = __webpack_require__(170); var _ManagedTree2 = _interopRequireDefault(_ManagedTree); -__webpack_require__(3318); +__webpack_require__(252); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -47091,15 +48904,7 @@ exports.default = (0, _reactRedux.connect)(state => ({ }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Scopes); /***/ }), - -/***/ 356: -/***/ (function(module, exports) { - -module.exports = "" - -/***/ }), - -/***/ 3560: +/* 643 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -47113,23 +48918,23 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _redux = __webpack_require__(3); +var _redux = __webpack_require__(8); -var _reactRedux = __webpack_require__(1189); +var _reactRedux = __webpack_require__(4); -var _actions = __webpack_require__(3195); +var _actions = __webpack_require__(7); var _actions2 = _interopRequireDefault(_actions); -var _firefox = __webpack_require__(3220); +var _firefox = __webpack_require__(69); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -var _scopes = __webpack_require__(3561); +var _scopes = __webpack_require__(644); -var _devtoolsReps = __webpack_require__(3266); +var _devtoolsReps = __webpack_require__(173); -__webpack_require__(3318); +__webpack_require__(252); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -47216,8 +49021,7 @@ exports.default = (0, _reactRedux.connect)(state => { }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Scopes); /***/ }), - -/***/ 3561: +/* 644 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -47228,7 +49032,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.getScopes = getScopes; -var _getScope = __webpack_require__(3562); +var _getScope = __webpack_require__(645); function getScopes(why, selectedFrame, frameScopes) { if (!why || !selectedFrame) { @@ -47260,8 +49064,7 @@ function getScopes(why, selectedFrame, frameScopes) { * file, You can obtain one at . */ /***/ }), - -/***/ 3562: +/* 645 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -47277,11 +49080,11 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument exports.getScope = getScope; -var _getVariables = __webpack_require__(3563); +var _getVariables = __webpack_require__(646); -var _utils = __webpack_require__(3564); +var _utils = __webpack_require__(647); -var _frame = __webpack_require__(3216); +var _frame = __webpack_require__(58); function getScopeTitle(type, scope) { if (type === "block" && scope.block && scope.block.displayName) { @@ -47352,8 +49155,7 @@ function getScope(scope, selectedFrame, frameScopes, why, scopeIndex) { } /***/ }), - -/***/ 3563: +/* 646 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -47364,7 +49166,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.getBindingVariables = getBindingVariables; -var _lodash = __webpack_require__(2); +var _lodash = __webpack_require__(11); // Create the tree nodes representing all the variables and arguments // for the bindings from a scope. @@ -47394,8 +49196,7 @@ function getBindingVariables(bindings, parentName) { * file, You can obtain one at . */ /***/ }), - -/***/ 3564: +/* 647 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -47456,15 +49257,13 @@ function getThisVariable(this_, path) { } /***/ }), - -/***/ 3565: +/* 648 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3566: +/* 649 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -47478,23 +49277,23 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _reactRedux = __webpack_require__(1189); +var _reactRedux = __webpack_require__(4); -var _redux = __webpack_require__(3); +var _redux = __webpack_require__(8); -var _actions = __webpack_require__(3195); +var _actions = __webpack_require__(7); var _actions2 = _interopRequireDefault(_actions); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -var _text = __webpack_require__(3242); +var _text = __webpack_require__(107); -var _PaneToggle = __webpack_require__(3265); +var _PaneToggle = __webpack_require__(172); var _PaneToggle2 = _interopRequireDefault(_PaneToggle); -__webpack_require__(3567); +__webpack_require__(650); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -47575,15 +49374,13 @@ exports.default = (0, _reactRedux.connect)(state => ({ }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(WelcomeBox); /***/ }), - -/***/ 3567: +/* 650 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3568: +/* 651 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -47597,39 +49394,39 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _reactRedux = __webpack_require__(1189); +var _reactRedux = __webpack_require__(4); -var _redux = __webpack_require__(3); +var _redux = __webpack_require__(8); -var _immutable = __webpack_require__(146); +var _immutable = __webpack_require__(19); var I = _interopRequireWildcard(_immutable); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -var _ui = __webpack_require__(3241); +var _ui = __webpack_require__(106); -var _tabs = __webpack_require__(3319); +var _tabs = __webpack_require__(253); -var _source = __webpack_require__(3196); +var _source = __webpack_require__(9); -var _actions = __webpack_require__(3195); +var _actions = __webpack_require__(7); var _actions2 = _interopRequireDefault(_actions); -var _lodash = __webpack_require__(2); +var _lodash = __webpack_require__(11); -__webpack_require__(3569); +__webpack_require__(652); -var _Tab = __webpack_require__(3570); +var _Tab = __webpack_require__(653); var _Tab2 = _interopRequireDefault(_Tab); -var _PaneToggle = __webpack_require__(3265); +var _PaneToggle = __webpack_require__(172); var _PaneToggle2 = _interopRequireDefault(_PaneToggle); -var _Dropdown = __webpack_require__(3317); +var _Dropdown = __webpack_require__(251); var _Dropdown2 = _interopRequireDefault(_Dropdown); @@ -47704,9 +49501,9 @@ class Tabs extends _react.PureComponent { } toggleSourcesDropdown(e) { - this.setState({ - dropdownShown: !this.state.dropdownShown - }); + this.setState(prevState => ({ + dropdownShown: !prevState.dropdownShown + })); } getIconClass(source) { @@ -47789,22 +49586,13 @@ exports.default = (0, _reactRedux.connect)(state => { }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Tabs); /***/ }), - -/***/ 3569: +/* 652 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 357: -/***/ (function(module, exports) { - -module.exports = "" - -/***/ }), - -/***/ 3570: +/* 653 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -47822,29 +49610,29 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _reactRedux = __webpack_require__(1189); +var _reactRedux = __webpack_require__(4); -var _redux = __webpack_require__(3); +var _redux = __webpack_require__(8); -var _devtoolsContextmenu = __webpack_require__(3211); +var _devtoolsContextmenu = __webpack_require__(45); -var _Close = __webpack_require__(3229); +var _Close = __webpack_require__(79); var _Close2 = _interopRequireDefault(_Close); -var _actions = __webpack_require__(3195); +var _actions = __webpack_require__(7); var _actions2 = _interopRequireDefault(_actions); -var _source = __webpack_require__(3196); +var _source = __webpack_require__(9); -var _clipboard = __webpack_require__(3230); +var _clipboard = __webpack_require__(80); -var _tabs = __webpack_require__(3319); +var _tabs = __webpack_require__(253); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -var _classnames = __webpack_require__(175); +var _classnames = __webpack_require__(6); var _classnames2 = _interopRequireDefault(_classnames); @@ -47998,8 +49786,7 @@ exports.default = (0, _reactRedux.connect)(state => { }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Tab); /***/ }), - -/***/ 3571: +/* 654 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -48018,37 +49805,37 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _reactRedux = __webpack_require__(1189); +var _reactRedux = __webpack_require__(4); -var _fuzzaldrinPlus = __webpack_require__(161); +var _fuzzaldrinPlus = __webpack_require__(655); var _fuzzaldrinPlus2 = _interopRequireDefault(_fuzzaldrinPlus); -var _path = __webpack_require__(3247); +var _path = __webpack_require__(153); -var _actions = __webpack_require__(3195); +var _actions = __webpack_require__(7); var _actions2 = _interopRequireDefault(_actions); -var _selectors = __webpack_require__(3193); +var _selectors = __webpack_require__(1); -var _resultList = __webpack_require__(3305); +var _resultList = __webpack_require__(239); -var _quickOpen = __webpack_require__(3284); +var _quickOpen = __webpack_require__(218); -var _Modal = __webpack_require__(3259); +var _Modal = __webpack_require__(166); var _Modal2 = _interopRequireDefault(_Modal); -var _SearchInput = __webpack_require__(3264); +var _SearchInput = __webpack_require__(171); var _SearchInput2 = _interopRequireDefault(_SearchInput); -var _ResultList = __webpack_require__(3572); +var _ResultList = __webpack_require__(658); var _ResultList2 = _interopRequireDefault(_ResultList); -__webpack_require__(3574); +__webpack_require__(660); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -48367,7 +50154,7 @@ class QuickOpenModal extends _react.Component { handleClose: this.closeModal, hasPrefix: this.hasPrefix(), expanded: expanded, - selectedItemId: expanded ? items[selectedIndex].id : "" + selectedItemId: expanded && items[selectedIndex] ? items[selectedIndex].id : "" })), newResults && _react2.default.createElement(_ResultList2.default, _extends({ key: "results", @@ -48405,8 +50192,402 @@ function mapStateToProps(state) { exports.default = (0, _reactRedux.connect)(mapStateToProps, _actions2.default)(QuickOpenModal); /***/ }), +/* 655 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ 3572: +/* WEBPACK VAR INJECTION */(function(process) {(function() { + var Query, defaultPathSeparator, filter, matcher, parseOptions, pathScorer, preparedQueryCache, scorer; + + filter = __webpack_require__(656); + + matcher = __webpack_require__(657); + + scorer = __webpack_require__(109); + + pathScorer = __webpack_require__(176); + + Query = __webpack_require__(254); + + 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__(145))) + +/***/ }), +/* 656 */ +/***/ (function(module, exports, __webpack_require__) { + +(function() { + var Query, pathScorer, pluckCandidates, scorer, sortCandidates; + + scorer = __webpack_require__(109); + + pathScorer = __webpack_require__(176); + + Query = __webpack_require__(254); + + 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); + + +/***/ }), +/* 657 */ +/***/ (function(module, exports, __webpack_require__) { + +(function() { + var basenameMatch, computeMatch, isMatch, isWordStart, match, mergeMatches, scoreAcronyms, scoreCharacter, scoreConsecutives, _ref; + + _ref = __webpack_require__(109), 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); + + +/***/ }), +/* 658 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -48420,11 +50601,11 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _classnames = __webpack_require__(175); +var _classnames = __webpack_require__(6); var _classnames2 = _interopRequireDefault(_classnames); -__webpack_require__(3573); +__webpack_require__(659); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -48491,2831 +50672,23 @@ ResultList.defaultProps = { }; /***/ }), - -/***/ 3573: +/* 659 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 3574: +/* 660 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), - -/***/ 358: +/* 661 */ /***/ (function(module, exports) { -module.exports = "" - -/***/ }), - -/***/ 359: -/***/ (function(module, exports) { - -module.exports = "" - -/***/ }), - -/***/ 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)); - }; - }); -} - -/***/ }), - -/***/ 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 = "" - -/***/ }), - -/***/ 4: -/***/ (function(module, exports) { - -module.exports = __WEBPACK_EXTERNAL_MODULE_4__; - -/***/ }), - -/***/ 46: -/***/ (function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__(3325); - - -/***/ }), - -/***/ 52: -/***/ (function(module, exports) { - -module.exports = __WEBPACK_EXTERNAL_MODULE_52__; - -/***/ }), - -/***/ 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; - - -/***/ }), - -/***/ 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; - - -/***/ }), - -/***/ 677: -/***/ (function(module, exports) { - -module.exports = __WEBPACK_EXTERNAL_MODULE_677__; - -/***/ }), - -/***/ 678: -/***/ (function(module, exports) { - -module.exports = __WEBPACK_EXTERNAL_MODULE_678__; - -/***/ }), - -/***/ 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; - - -/***/ }), - -/***/ 7: -/***/ (function(module, exports, __webpack_require__) { - -var root = __webpack_require__(8); - -/** Built-in value references. */ -var Symbol = root.Symbol; - -module.exports = Symbol; - - -/***/ }), - -/***/ 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 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 (string.charCodeAt(0) === 46 /* . */) { - result.push(''); - } - string.replace(rePropName, function(match, number, quote, subString) { - result.push(quote ? subString.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; - - -/***/ }), - -/***/ 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; - - -/***/ }), - -/***/ 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; - - -/***/ }), - -/***/ 806: -/***/ (function(module, exports) { - -module.exports = "dojo_square" - -/***/ }), - -/***/ 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; - - -/***/ }), - -/***/ 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; - } - }()); -} - - -/***/ }), - -/***/ 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; - - -/***/ }), - -/***/ 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__(3208))) - -/***/ }), - -/***/ 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; - - -/***/ }), - -/***/ 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__(3223)(module), __webpack_require__(3208))) - -/***/ }), - -/***/ 919: -/***/ (function(module, exports) { - -module.exports = "" - -/***/ }), - -/***/ 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; - - -/***/ }), - -/***/ 920: -/***/ (function(module, exports) { - -module.exports = "" - -/***/ }), - -/***/ 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; - - -/***/ }), - -/***/ 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 (setDirectoryRoot.label): This is the text that appears in the\n# context menu to set a directory as root directory\nsetDirectoryRoot.label=Set directory root\nsetDirectoryRoot.accesskey=r\n\n# LOCALIZATION NOTE (removeDirectoryRoot.label): This is the text that appears in the\n# context menu to remove a directory as root directory\nremoveDirectoryRoot.label=Remove directory root\nremoveDirectoryRoot.accesskey=d\n\n# LOCALIZATION NOTE (copyFunction.label): 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 (evaluateInConsole.label): Editor right-click menu item\n# to execute selected text in browser console.\nevaluateInConsole.label=Evaluate in console\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 (pauseButtonItem): The label that is displayed for the dropdown pause\n# list item when the debugger is in a running state.\npauseButtonItem=Pause on Next Statement\n\n# LOCALIZATION NOTE (ignoreExceptionsItem): The pause on exceptions button description\n# when the debugger will not pause on exceptions.\nignoreExceptionsItem=Ignore exceptions\n\n# LOCALIZATION NOTE (pauseOnUncaughtExceptionsItem): The pause on exceptions dropdown\n# item shown when a user is adding a new breakpoint.\npauseOnUncaughtExceptionsItem=Pause on uncaught exceptions\n\n# LOCALIZATION NOTE (pauseOnExceptionsItem): The pause on exceptions button description\n# when the debugger will pause on all exceptions.\npauseOnExceptionsItem=Pause on all exceptions\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.\n# Do not localize \"CmdOrCtrl+P\", or change the format of the string. These are\n# key identifiers, not messages displayed to the user.\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.\n# Do not localize \"CmdOrCtrl+O\", or change the format of the string. These are\n# key identifiers, not messages displayed to the user.\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.\n# Do not localize \"CmdOrCtrl+Shift+F\", or change the format of the string. These are\n# key identifiers, not messages displayed to the user.\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.\n# Do not localize \"CmdOrCtrl+Shift+O\", or change the format of the string. These are\n# key identifiers, not messages displayed to the user.\nfunctionSearch.key=CmdOrCtrl+Shift+O\n\n# LOCALIZATION NOTE (toggleBreakpoint.key): A key shortcut to toggle\n# breakpoints.\n# Do not localize \"CmdOrCtrl+B\", or change the format of the string. These are\n# key identifiers, not messages displayed to the user.\ntoggleBreakpoint.key=CmdOrCtrl+B\n\n# LOCALIZATION NOTE (toggleCondPanel.key): A key shortcut to toggle\n# the conditional breakpoint panel.\n# Do not localize \"CmdOrCtrl+Shift+B\", or change the format of the string. These are\n# key identifiers, not messages displayed to the user.\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\n# Do not localize \"CmdOrCtrl+F\", or change the format of the string. These are\n# key identifiers, not messages displayed to the user.\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\n# Do not localize \"CmdOrCtrl+G\", or change the format of the string. These are\n# key identifiers, not messages displayed to the user.\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\n# Do not localize \"CmdOrCtrl+Shift+G\", or change the format of the string. These are\n# key identifiers, not messages displayed to the user.\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 (editor.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\neditor.disableBreakpoint.accesskey=D\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\neditor.addConditionalBreakpoint.accesskey=c\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.close): 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\neditor.jumpToMappedLocation1.accesskey=m\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# LOCALIZATION NOTE (expressions.errorMsg): Error text for expression\n# input element\nexpressions.errorMsg=Invalid expression…\nexpressions.label=Add watch expression\nexpressions.accesskey=e\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.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.mappedSource): Text associated\n# with a mapped source. %S is replaced by the source map origin.\nsourceFooter.mappedSource=(From %S)\n\n# LOCALIZATION NOTE (sourceFooter.mappedSourceTooltip): Tooltip text associated\n# with a mapped source. %S is replaced by the source map origin.\nsourceFooter.mappedSourceTooltip=(Source mapped from %S)\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 (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.noResults2): 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 (replayPrevious): The replay previous button tooltip\n# when the debugger will go back in stepping history.\nreplayPrevious=Go back one step in history\n\n# LOCALIZATION NOTE (replayNext): The replay next button tooltip\n# when the debugger will go forward in stepping history.\nreplayNext=Go forward one step in history\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 (wasmIsNotAvailable): The text that is displayed in the\n# script editor when the WebAssembly source is not available.\nwasmIsNotAvailable=Please refresh to debug this module\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 (variablesDomNodeValueTooltip): 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(gotoLineModal.placeholder): The placeholder\n# text displayed when the user searches for specific lines in a file\ngotoLineModal.placeholder=Go to line…\n\n# LOCALIZATION NOTE(gotoLineModal.title): The message shown to users\n# to open the go to line modal\ngotoLineModal.title=Go to a line number in a file\n\n# LOCALIZATION NOTE(gotoLineModal.key2): The shortcut for opening the\n# go to line modal\n# Do not localize \"CmdOrCtrl+;\", or change the format of the string. These are\n# key identifiers, not messages displayed to the user.\ngotoLineModal.key2=CmdOrCtrl+;\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…\nsymbolSearch.search.functionsPlaceholder.title=Search for a function in a file\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…\nsymbolSearch.search.variablesPlaceholder.title=Search for a variable in a file\n\n# LOCALIZATION NOTE(symbolSearch.search.key2): The Key Shortcut for\n# searching for a function or variable\n# Do not localize \"CmdOrCtrl+Shift+O\", or change the format of the string. These are\n# key identifiers, not messages displayed to the user.\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\nshortcuts.toggleBreakpoint.accesskey=B\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.gotoLine): text describing\n# keyboard shortcut for jumping to a specific line\nshortcuts.gotoLine=Go to line\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\n# LOCALIZATION NOTE (shortcuts.buttonName): text describing\n# keyboard shortcut button text\nshortcuts.buttonName=Keyboard shortcuts\n" - -/***/ }), - -/***/ 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; -} - - -/***/ }), - -/***/ 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; - - -/***/ }), - -/***/ 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; - }, {}); - }); -} - -/***/ }), - -/***/ 997: -/***/ (function(module, exports) { - -module.exports = "" - -/***/ }), - -/***/ 998: -/***/ (function(module, exports) { - -module.exports = "" - -/***/ }), - -/***/ 999: -/***/ (function(module, exports) { - -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 (setDirectoryRoot.label): This is the text that appears in the\n# context menu to set a directory as root directory\nsetDirectoryRoot.label=Set directory root\nsetDirectoryRoot.accesskey=r\n\n# LOCALIZATION NOTE (removeDirectoryRoot.label): This is the text that appears in the\n# context menu to remove a directory as root directory\nremoveDirectoryRoot.label=Remove directory root\nremoveDirectoryRoot.accesskey=d\n\n# LOCALIZATION NOTE (copyFunction.label): 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 (evaluateInConsole.label): Editor right-click menu item\n# to execute selected text in browser console.\nevaluateInConsole.label=Evaluate in console\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 (pauseButtonItem): The label that is displayed for the dropdown pause\n# list item when the debugger is in a running state.\npauseButtonItem=Pause on Next Statement\n\n# LOCALIZATION NOTE (ignoreExceptionsItem): The pause on exceptions button description\n# when the debugger will not pause on exceptions.\nignoreExceptionsItem=Ignore exceptions\n\n# LOCALIZATION NOTE (pauseOnUncaughtExceptionsItem): The pause on exceptions dropdown\n# item shown when a user is adding a new breakpoint.\npauseOnUncaughtExceptionsItem=Pause on uncaught exceptions\n\n# LOCALIZATION NOTE (pauseOnExceptionsItem): The pause on exceptions button description\n# when the debugger will pause on all exceptions.\npauseOnExceptionsItem=Pause on all exceptions\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.\n# Do not localize \"CmdOrCtrl+P\", or change the format of the string. These are\n# key identifiers, not messages displayed to the user.\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.\n# Do not localize \"CmdOrCtrl+O\", or change the format of the string. These are\n# key identifiers, not messages displayed to the user.\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.\n# Do not localize \"CmdOrCtrl+Shift+F\", or change the format of the string. These are\n# key identifiers, not messages displayed to the user.\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.\n# Do not localize \"CmdOrCtrl+Shift+O\", or change the format of the string. These are\n# key identifiers, not messages displayed to the user.\nfunctionSearch.key=CmdOrCtrl+Shift+O\n\n# LOCALIZATION NOTE (toggleBreakpoint.key): A key shortcut to toggle\n# breakpoints.\n# Do not localize \"CmdOrCtrl+B\", or change the format of the string. These are\n# key identifiers, not messages displayed to the user.\ntoggleBreakpoint.key=CmdOrCtrl+B\n\n# LOCALIZATION NOTE (toggleCondPanel.key): A key shortcut to toggle\n# the conditional breakpoint panel.\n# Do not localize \"CmdOrCtrl+Shift+B\", or change the format of the string. These are\n# key identifiers, not messages displayed to the user.\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\n# Do not localize \"CmdOrCtrl+F\", or change the format of the string. These are\n# key identifiers, not messages displayed to the user.\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\n# Do not localize \"CmdOrCtrl+G\", or change the format of the string. These are\n# key identifiers, not messages displayed to the user.\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\n# Do not localize \"CmdOrCtrl+Shift+G\", or change the format of the string. These are\n# key identifiers, not messages displayed to the user.\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 (editor.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\neditor.disableBreakpoint.accesskey=D\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\neditor.addConditionalBreakpoint.accesskey=c\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.close): 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\neditor.jumpToMappedLocation1.accesskey=m\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# LOCALIZATION NOTE (expressions.errorMsg): Error text for expression\n# input element\nexpressions.errorMsg=Invalid expression…\nexpressions.label=Add watch expression\nexpressions.accesskey=e\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.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.mappedSource): Text associated\n# with a mapped source. %S is replaced by the source map origin.\nsourceFooter.mappedSource=(From %S)\n\n# LOCALIZATION NOTE (sourceFooter.mappedSourceTooltip): Tooltip text associated\n# with a mapped source. %S is replaced by the source map origin.\nsourceFooter.mappedSourceTooltip=(Source mapped from %S)\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 (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 (outline.noFileSelected): Outline text when there are no files selected\noutline.noFileSelected=No file selected\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.noResults2): 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 (replayPrevious): The replay previous button tooltip\n# when the debugger will go back in stepping history.\nreplayPrevious=Go back one step in history\n\n# LOCALIZATION NOTE (replayNext): The replay next button tooltip\n# when the debugger will go forward in stepping history.\nreplayNext=Go forward one step in history\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 (wasmIsNotAvailable): The text that is displayed in the\n# script editor when the WebAssembly source is not available.\nwasmIsNotAvailable=Please refresh to debug this module\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 (variablesDomNodeValueTooltip): 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(gotoLineModal.placeholder): The placeholder\n# text displayed when the user searches for specific lines in a file\ngotoLineModal.placeholder=Go to line…\n\n# LOCALIZATION NOTE(gotoLineModal.title): The message shown to users\n# to open the go to line modal\ngotoLineModal.title=Go to a line number in a file\n\n# LOCALIZATION NOTE(gotoLineModal.key2): The shortcut for opening the\n# go to line modal\n# Do not localize \"CmdOrCtrl+;\", or change the format of the string. These are\n# key identifiers, not messages displayed to the user.\ngotoLineModal.key2=CmdOrCtrl+;\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…\nsymbolSearch.search.functionsPlaceholder.title=Search for a function in a file\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…\nsymbolSearch.search.variablesPlaceholder.title=Search for a variable in a file\n\n# LOCALIZATION NOTE(symbolSearch.search.key2): The Key Shortcut for\n# searching for a function or variable\n# Do not localize \"CmdOrCtrl+Shift+O\", or change the format of the string. These are\n# key identifiers, not messages displayed to the user.\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\nshortcuts.toggleBreakpoint.accesskey=B\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.gotoLine): text describing\n# keyboard shortcut for jumping to a specific line\nshortcuts.gotoLine=Go to line\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\n# LOCALIZATION NOTE (shortcuts.buttonName): text describing\n# keyboard shortcut button text\nshortcuts.buttonName=Keyboard shortcuts\n" /***/ }) - -/******/ }); +/******/ ]); }); \ No newline at end of file diff --git a/devtools/client/debugger/new/parser-worker.js b/devtools/client/debugger/new/parser-worker.js index 1bd56335d806..f79c20c99b84 100644 --- a/devtools/client/debugger/new/parser-worker.js +++ b/devtools/client/debugger/new/parser-worker.js @@ -70,1636 +70,103 @@ return /******/ (function(modules) { // webpackBootstrap /******/ __webpack_require__.p = "/assets/build"; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 1272); +/******/ return __webpack_require__(__webpack_require__.s = 662); /******/ }) /************************************************************************/ -/******/ ({ - -/***/ 10: +/******/ ([ +/* 0 */, +/* 1 */, +/* 2 */, +/* 3 */, +/* 4 */, +/* 5 */, +/* 6 */, +/* 7 */, +/* 8 */, +/* 9 */, +/* 10 */, +/* 11 */, +/* 12 */ /***/ (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; - - -/***/ }), - -/***/ 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; - - -/***/ }), - -/***/ 1023: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.parseScriptTags = exports.parseScripts = exports.parseScript = exports.getCandidateScriptLocations = exports.generateWhitespace = exports.extractScriptTags = undefined; - -var _types = __webpack_require__(2268); - -var types = _interopRequireWildcard(_types); - -var _babylon = __webpack_require__(435); - -var babylon = _interopRequireWildcard(_babylon); - -var _customParse = __webpack_require__(2337); - -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 parseScript(_ref) { - var source = _ref.source, - line = _ref.line; - - // remove empty or only whitespace scripts - if (source.length === 0 || /^\s+$/.test(source)) { - return null; - } - - try { - return babylon.parse(source, { - sourceType: "script", - startLine: line - }); - } catch (e) { - return null; - } -} - -function parseScripts(locations) { - var parser = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : parseScript; - - return (0, _customParse.parseScripts)(locations, parser); -} - -function extractScriptTags(source) { - return parseScripts((0, _customParse.getCandidateScriptLocations)(source), function (loc) { - var ast = parseScript(loc); - - if (ast) { - return loc; - } - - return null; - }).filter(types.isFile); -} - -function parseScriptTags(source) { - var parser = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : parseScript; - - return (0, _customParse.parseScriptTags)(source, parser); -} - -exports.default = parseScriptTags; -exports.extractScriptTags = extractScriptTags; -exports.generateWhitespace = _customParse.generateWhitespace; -exports.getCandidateScriptLocations = _customParse.getCandidateScriptLocations; -exports.parseScript = parseScript; -exports.parseScripts = parseScripts; -exports.parseScriptTags = parseScriptTags; - -/***/ }), - -/***/ 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; - - -/***/ }), - -/***/ 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; - - -/***/ }), - -/***/ 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; - - -/***/ }), - -/***/ 1129: -/***/ (function(module, exports, __webpack_require__) { - -var baseDifference = __webpack_require__(1131), - baseFlatten = __webpack_require__(707), - baseRest = __webpack_require__(411), - isArrayLikeObject = __webpack_require__(1155); - -/** - * Creates an array of `array` values not included in the other given arrays - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. The order and references of result values are - * determined by the first array. - * - * **Note:** Unlike `_.pullAll`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @see _.without, _.xor - * @example - * - * _.difference([2, 1], [2, 3]); - * // => [1] - */ -var difference = baseRest(function(array, values) { - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) - : []; -}); - -module.exports = difference; - - -/***/ }), - -/***/ 1131: -/***/ (function(module, exports, __webpack_require__) { - -var SetCache = __webpack_require__(276), - arrayIncludes = __webpack_require__(563), - arrayIncludesWith = __webpack_require__(567), - arrayMap = __webpack_require__(110), - baseUnary = __webpack_require__(215), - cacheHas = __webpack_require__(280); - -/** Used as the size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; - -/** - * The base implementation of methods like `_.difference` without support - * for excluding multiple arrays or iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Array} values The values to exclude. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of filtered values. - */ -function baseDifference(array, values, iteratee, comparator) { - var index = -1, - includes = arrayIncludes, - isCommon = true, - length = array.length, - result = [], - valuesLength = values.length; - - if (!length) { - return result; - } - if (iteratee) { - values = arrayMap(values, baseUnary(iteratee)); - } - if (comparator) { - includes = arrayIncludesWith; - isCommon = false; - } - else if (values.length >= LARGE_ARRAY_SIZE) { - includes = cacheHas; - isCommon = false; - values = new SetCache(values); - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee == null ? value : iteratee(value); - - value = (comparator || value !== 0) ? value : 0; - if (isCommon && computed === computed) { - var valuesIndex = valuesLength; - while (valuesIndex--) { - if (values[valuesIndex] === computed) { - continue outer; - } - } - result.push(value); - } - else if (!includes(values, computed, comparator)) { - result.push(value); - } - } - return result; -} - -module.exports = baseDifference; - - -/***/ }), - -/***/ 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; - - -/***/ }), - -/***/ 1155: -/***/ (function(module, exports, __webpack_require__) { - -var isArrayLike = __webpack_require__(220), - isObjectLike = __webpack_require__(14); - -/** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, - * else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ -function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); -} - -module.exports = isArrayLikeObject; - - -/***/ }), - -/***/ 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) { - var type = typeof value; - length = length == null ? MAX_SAFE_INTEGER : length; - - return !!length && - (type == 'number' || - (type != 'symbol' && reIsUint.test(value))) && - (value > -1 && value % 1 == 0 && value < length); -} - -module.exports = isIndex; - - -/***/ }), - -/***/ 12: -/***/ (function(module, exports, __webpack_require__) { - -var overArg = __webpack_require__(13); - -/** Built-in value references. */ -var getPrototype = overArg(Object.getPrototypeOf, Object); - -module.exports = getPrototype; - - -/***/ }), - -/***/ 1272: -/***/ (function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__(3575); - - -/***/ }), - -/***/ 13: -/***/ (function(module, exports) { - -/** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ -function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; -} - -module.exports = overArg; - - -/***/ }), - -/***/ 14: -/***/ (function(module, exports) { - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return value != null && typeof value == 'object'; -} - -module.exports = isObjectLike; - - -/***/ }), - -/***/ 1686: -/***/ (function(module, exports, __webpack_require__) { - -var baseFindIndex = __webpack_require__(263), - baseIteratee = __webpack_require__(814), - toInteger = __webpack_require__(302); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max, - nativeMin = Math.min; - -/** - * This method is like `_.findIndex` except that it iterates over elements - * of `collection` from right to left. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=array.length-1] The index to search from. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); - * // => 2 - * - * // The `_.matches` iteratee shorthand. - * _.findLastIndex(users, { 'user': 'barney', 'active': true }); - * // => 0 - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findLastIndex(users, ['active', false]); - * // => 2 - * - * // The `_.property` iteratee shorthand. - * _.findLastIndex(users, 'active'); - * // => 0 - */ -function findLastIndex(array, predicate, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = length - 1; - if (fromIndex !== undefined) { - index = toInteger(fromIndex); - index = fromIndex < 0 - ? nativeMax(length + index, 0) - : nativeMin(index, length - 1); - } - return baseFindIndex(array, baseIteratee(predicate, 3), index, true); -} - -module.exports = findLastIndex; - - -/***/ }), - -/***/ 198: -/***/ (function(module, exports, __webpack_require__) { - -var DataView = __webpack_require__(199), - Map = __webpack_require__(101), - Promise = __webpack_require__(200), - Set = __webpack_require__(201), - WeakMap = __webpack_require__(202), - baseGetTag = __webpack_require__(6), - toSource = __webpack_require__(87); - -/** `Object#toString` result references. */ -var mapTag = '[object Map]', - objectTag = '[object Object]', - promiseTag = '[object Promise]', - setTag = '[object Set]', - weakMapTag = '[object WeakMap]'; - -var dataViewTag = '[object DataView]'; - -/** Used to detect maps, sets, and weakmaps. */ -var dataViewCtorString = toSource(DataView), - mapCtorString = toSource(Map), - promiseCtorString = toSource(Promise), - setCtorString = toSource(Set), - weakMapCtorString = toSource(WeakMap); - -/** - * Gets the `toStringTag` of `value`. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ -var getTag = baseGetTag; - -// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. -if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || - (Map && getTag(new Map) != mapTag) || - (Promise && getTag(Promise.resolve()) != promiseTag) || - (Set && getTag(new Set) != setTag) || - (WeakMap && getTag(new WeakMap) != weakMapTag)) { - getTag = function(value) { - var result = baseGetTag(value), - Ctor = result == objectTag ? value.constructor : undefined, - ctorString = Ctor ? toSource(Ctor) : ''; - - if (ctorString) { - switch (ctorString) { - case dataViewCtorString: return dataViewTag; - case mapCtorString: return mapTag; - case promiseCtorString: return promiseTag; - case setCtorString: return setTag; - case weakMapCtorString: return weakMapTag; - } - } - return result; - }; -} - -module.exports = getTag; - - -/***/ }), - -/***/ 199: -/***/ (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 DataView = getNative(root, 'DataView'); - -module.exports = DataView; - - -/***/ }), - -/***/ 200: -/***/ (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 Promise = getNative(root, 'Promise'); - -module.exports = Promise; - - -/***/ }), - -/***/ 201: -/***/ (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 Set = getNative(root, 'Set'); - -module.exports = Set; - - -/***/ }), - -/***/ 202: -/***/ (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 WeakMap = getNative(root, 'WeakMap'); - -module.exports = WeakMap; - - -/***/ }), - -/***/ 203: -/***/ (function(module, exports) { - -/** - * Converts `map` to its key-value pairs. - * - * @private - * @param {Object} map The map to convert. - * @returns {Array} Returns the key-value pairs. - */ -function mapToArray(map) { - var index = -1, - result = Array(map.size); - - map.forEach(function(value, key) { - result[++index] = [key, value]; - }); - return result; -} - -module.exports = mapToArray; - - -/***/ }), - -/***/ 205: -/***/ (function(module, exports, __webpack_require__) { - -var arrayLikeKeys = __webpack_require__(206), - baseKeys = __webpack_require__(217), - isArrayLike = __webpack_require__(220); - -/** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * for more details. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ -function keys(object) { - return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); -} - -module.exports = keys; - - -/***/ }), - -/***/ 206: -/***/ (function(module, exports, __webpack_require__) { - -var baseTimes = __webpack_require__(207), - isArguments = __webpack_require__(208), - isArray = __webpack_require__(70), - isBuffer = __webpack_require__(210), - isIndex = __webpack_require__(117), - isTypedArray = __webpack_require__(212); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Creates an array of the enumerable property names of the array-like `value`. - * - * @private - * @param {*} value The value to query. - * @param {boolean} inherited Specify returning inherited property names. - * @returns {Array} Returns the array of property names. - */ -function arrayLikeKeys(value, inherited) { - var isArr = isArray(value), - isArg = !isArr && isArguments(value), - isBuff = !isArr && !isArg && isBuffer(value), - isType = !isArr && !isArg && !isBuff && isTypedArray(value), - skipIndexes = isArr || isArg || isBuff || isType, - result = skipIndexes ? baseTimes(value.length, String) : [], - length = result.length; - - for (var key in value) { - if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && ( - // Safari 9 has enumerable `arguments.length` in strict mode. - key == 'length' || - // Node.js 0.10 has enumerable non-index properties on buffers. - (isBuff && (key == 'offset' || key == 'parent')) || - // PhantomJS 2 has enumerable non-index properties on typed arrays. - (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || - // Skip index properties. - isIndex(key, length) - ))) { - result.push(key); - } - } - return result; -} - -module.exports = arrayLikeKeys; - - -/***/ }), - -/***/ 207: -/***/ (function(module, exports) { - -/** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. - * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. - */ -function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); - - while (++index < n) { - result[index] = iteratee(index); - } - return result; -} - -module.exports = baseTimes; - - -/***/ }), - -/***/ 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'); +/* 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__(149); + +const { workerUtils: { WorkerDispatcher } } = __webpack_require__(27); + +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) }; -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: -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(8), - stubFalse = __webpack_require__(211); - -/** Detect free variable `exports`. */ -var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; - -/** Detect free variable `module`. */ -var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; - -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = freeModule && freeModule.exports === freeExports; - -/** Built-in value references. */ -var Buffer = moduleExports ? root.Buffer : undefined; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; - -/** - * Checks if `value` is a buffer. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. - * @example - * - * _.isBuffer(new Buffer(2)); - * // => true - * - * _.isBuffer(new Uint8Array(2)); - * // => false - */ -var isBuffer = nativeIsBuffer || stubFalse; - -module.exports = isBuffer; - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3223)(module))) - -/***/ }), - -/***/ 211: +/* 13 */, +/* 14 */, +/* 15 */, +/* 16 */ /***/ (function(module, exports) { /** - * This method returns `false`. + * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ - * @since 4.13.0 - * @category Util - * @returns {boolean} Returns `false`. - * @example - * - * _.times(2, _.stubFalse); - * // => [false, false] - */ -function stubFalse() { - return false; -} - -module.exports = stubFalse; - - -/***/ }), - -/***/ 212: -/***/ (function(module, exports, __webpack_require__) { - -var baseIsTypedArray = __webpack_require__(213), - baseUnary = __webpack_require__(215), - nodeUtil = __webpack_require__(216); - -/* Node.js helper references. */ -var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; - -/** - * Checks if `value` is classified as a typed array. - * - * @static - * @memberOf _ - * @since 3.0.0 + * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * - * _.isTypedArray(new Uint8Array); + * _.isArray([1, 2, 3]); * // => true * - * _.isTypedArray([]); - * // => false - */ -var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; - -module.exports = isTypedArray; - - -/***/ }), - -/***/ 213: -/***/ (function(module, exports, __webpack_require__) { - -var baseGetTag = __webpack_require__(6), - isLength = __webpack_require__(214), - isObjectLike = __webpack_require__(14); - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - weakMapTag = '[object WeakMap]'; - -var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - -/** Used to identify `toStringTag` values of typed arrays. */ -var typedArrayTags = {}; -typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = -typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = -typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = -typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = -typedArrayTags[uint32Tag] = true; -typedArrayTags[argsTag] = typedArrayTags[arrayTag] = -typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = -typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = -typedArrayTags[errorTag] = typedArrayTags[funcTag] = -typedArrayTags[mapTag] = typedArrayTags[numberTag] = -typedArrayTags[objectTag] = typedArrayTags[regexpTag] = -typedArrayTags[setTag] = typedArrayTags[stringTag] = -typedArrayTags[weakMapTag] = false; - -/** - * The base implementation of `_.isTypedArray` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - */ -function baseIsTypedArray(value) { - return isObjectLike(value) && - isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; -} - -module.exports = baseIsTypedArray; - - -/***/ }), - -/***/ 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); + * _.isArray(document.body.children); * // => false * - * _.isLength(Infinity); + * _.isArray('abc'); * // => false * - * _.isLength('3'); + * _.isArray(_.noop); * // => false */ -function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} +var isArray = Array.isArray; -module.exports = isLength; +module.exports = isArray; /***/ }), - -/***/ 215: -/***/ (function(module, exports) { - -/** - * The base implementation of `_.unary` without support for storing metadata. - * - * @private - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. - */ -function baseUnary(func) { - return function(value) { - return func(value); - }; -} - -module.exports = baseUnary; - - -/***/ }), - -/***/ 216: -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(module) {var freeGlobal = __webpack_require__(9); - -/** Detect free variable `exports`. */ -var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; - -/** Detect free variable `module`. */ -var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; - -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = freeModule && freeModule.exports === freeExports; - -/** Detect free variable `process` from Node.js. */ -var freeProcess = moduleExports && freeGlobal.process; - -/** Used to access faster Node.js helpers. */ -var nodeUtil = (function() { - try { - return freeProcess && freeProcess.binding && freeProcess.binding('util'); - } catch (e) {} -}()); - -module.exports = nodeUtil; - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3223)(module))) - -/***/ }), - -/***/ 217: -/***/ (function(module, exports, __webpack_require__) { - -var isPrototype = __webpack_require__(218), - nativeKeys = __webpack_require__(219); - -/** 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 `_.keys` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function baseKeys(object) { - if (!isPrototype(object)) { - return nativeKeys(object); - } - var result = []; - for (var key in Object(object)) { - if (hasOwnProperty.call(object, key) && key != 'constructor') { - result.push(key); - } - } - return result; -} - -module.exports = baseKeys; - - -/***/ }), - -/***/ 218: -/***/ (function(module, exports) { - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Checks if `value` is likely a prototype object. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. - */ -function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; - - return value === proto; -} - -module.exports = isPrototype; - - -/***/ }), - -/***/ 219: -/***/ (function(module, exports, __webpack_require__) { - -var overArg = __webpack_require__(13); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeKeys = overArg(Object.keys, Object); - -module.exports = nativeKeys; - - -/***/ }), - -/***/ 220: -/***/ (function(module, exports, __webpack_require__) { - -var isFunction = __webpack_require__(83), - isLength = __webpack_require__(214); - -/** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ -function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); -} - -module.exports = isArrayLike; - - -/***/ }), - -/***/ 2255: +/* 17 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1850,8 +317,6 @@ exports.isParenthesizedExpression = isParenthesizedExpression; exports.isAwaitExpression = isAwaitExpression; exports.isBindExpression = isBindExpression; exports.isClassProperty = isClassProperty; -exports.isOptionalMemberExpression = isOptionalMemberExpression; -exports.isOptionalCallExpression = isOptionalCallExpression; exports.isImport = isImport; exports.isDecorator = isDecorator; exports.isDoExpression = isDoExpression; @@ -1957,7 +422,7 @@ exports.isRegexLiteral = isRegexLiteral; exports.isRestProperty = isRestProperty; exports.isSpreadProperty = isSpreadProperty; -var _is = _interopRequireDefault(__webpack_require__(2262)); +var _is = _interopRequireDefault(__webpack_require__(110)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -2537,14 +1002,6 @@ function isClassProperty(node, opts) { return (0, _is.default)("ClassProperty", node, opts); } -function isOptionalMemberExpression(node, opts) { - return (0, _is.default)("OptionalMemberExpression", node, opts); -} - -function isOptionalCallExpression(node, opts) { - return (0, _is.default)("OptionalCallExpression", node, opts); -} - function isImport(node, opts) { return (0, _is.default)("Import", node, opts); } @@ -2966,8 +1423,518 @@ function isSpreadProperty(node, opts) { } /***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ 2256: +var freeGlobal = __webpack_require__(52); + +/** 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; + + +/***/ }), +/* 19 */, +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + +var root = __webpack_require__(18); + +/** Built-in value references. */ +var Symbol = root.Symbol; + +module.exports = Symbol; + + +/***/ }), +/* 21 */ +/***/ (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; + + +/***/ }), +/* 22 */, +/* 23 */ +/***/ (function(module, exports, __webpack_require__) { + +var Symbol = __webpack_require__(20), + getRawTag = __webpack_require__(63), + objectToString = __webpack_require__(64); + +/** `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; + + +/***/ }), +/* 24 */, +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseIsNative = __webpack_require__(127), + getValue = __webpack_require__(130); + +/** + * 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; + + +/***/ }), +/* 26 */ +/***/ (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; + + +/***/ }), +/* 27 */ +/***/ (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__(46); +const workerUtils = __webpack_require__(47); + +module.exports = { + networkRequest, + workerUtils +}; + +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +var _exportNames = { + assertNode: true, + createTypeAnnotationBasedOnTypeof: true, + createUnionTypeAnnotation: true, + cloneNode: true, + clone: true, + cloneDeep: true, + cloneWithoutLoc: true, + addComment: true, + addComments: true, + inheritInnerComments: true, + inheritLeadingComments: true, + inheritsComments: true, + inheritTrailingComments: true, + removeComments: true, + ensureBlock: true, + toBindingIdentifierName: true, + toBlock: true, + toComputedKey: true, + toExpression: true, + toIdentifier: true, + toKeyAlias: true, + toSequenceExpression: true, + toStatement: true, + valueToNode: true, + appendToMemberExpression: true, + inherits: true, + prependToMemberExpression: true, + removeProperties: true, + removePropertiesDeep: true, + removeTypeDuplicates: true, + getBindingIdentifiers: true, + getOuterBindingIdentifiers: true, + traverse: true, + traverseFast: true, + shallowEqual: true, + is: true, + isBinding: true, + isBlockScoped: true, + isImmutable: true, + isLet: true, + isNode: true, + isNodesEquivalent: true, + isReferenced: true, + isScope: true, + isSpecifierDefault: true, + isType: true, + isValidES3Identifier: true, + isValidIdentifier: true, + isVar: true, + matchesPattern: true, + validate: true, + buildMatchMemberExpression: true, + react: true +}; +exports.react = exports.buildMatchMemberExpression = exports.validate = exports.matchesPattern = exports.isVar = exports.isValidIdentifier = exports.isValidES3Identifier = exports.isType = exports.isSpecifierDefault = exports.isScope = exports.isReferenced = exports.isNodesEquivalent = exports.isNode = exports.isLet = exports.isImmutable = exports.isBlockScoped = exports.isBinding = exports.is = exports.shallowEqual = exports.traverseFast = exports.traverse = exports.getOuterBindingIdentifiers = exports.getBindingIdentifiers = exports.removeTypeDuplicates = exports.removePropertiesDeep = exports.removeProperties = exports.prependToMemberExpression = exports.inherits = exports.appendToMemberExpression = exports.valueToNode = exports.toStatement = exports.toSequenceExpression = exports.toKeyAlias = exports.toIdentifier = exports.toExpression = exports.toComputedKey = exports.toBlock = exports.toBindingIdentifierName = exports.ensureBlock = exports.removeComments = exports.inheritTrailingComments = exports.inheritsComments = exports.inheritLeadingComments = exports.inheritInnerComments = exports.addComments = exports.addComment = exports.cloneWithoutLoc = exports.cloneDeep = exports.clone = exports.cloneNode = exports.createUnionTypeAnnotation = exports.createTypeAnnotationBasedOnTypeof = exports.assertNode = void 0; + +var _isReactComponent = _interopRequireDefault(__webpack_require__(664)); + +var _isCompatTag = _interopRequireDefault(__webpack_require__(674)); + +var _buildChildren = _interopRequireDefault(__webpack_require__(675)); + +var _assertNode = _interopRequireDefault(__webpack_require__(716)); + +exports.assertNode = _assertNode.default; + +var _generated = __webpack_require__(717); + +Object.keys(_generated).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + exports[key] = _generated[key]; +}); + +var _createTypeAnnotationBasedOnTypeof = _interopRequireDefault(__webpack_require__(718)); + +exports.createTypeAnnotationBasedOnTypeof = _createTypeAnnotationBasedOnTypeof.default; + +var _createUnionTypeAnnotation = _interopRequireDefault(__webpack_require__(719)); + +exports.createUnionTypeAnnotation = _createUnionTypeAnnotation.default; + +var _generated2 = __webpack_require__(29); + +Object.keys(_generated2).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + exports[key] = _generated2[key]; +}); + +var _cloneNode = _interopRequireDefault(__webpack_require__(86)); + +exports.cloneNode = _cloneNode.default; + +var _clone = _interopRequireDefault(__webpack_require__(273)); + +exports.clone = _clone.default; + +var _cloneDeep = _interopRequireDefault(__webpack_require__(720)); + +exports.cloneDeep = _cloneDeep.default; + +var _cloneWithoutLoc = _interopRequireDefault(__webpack_require__(721)); + +exports.cloneWithoutLoc = _cloneWithoutLoc.default; + +var _addComment = _interopRequireDefault(__webpack_require__(722)); + +exports.addComment = _addComment.default; + +var _addComments = _interopRequireDefault(__webpack_require__(274)); + +exports.addComments = _addComments.default; + +var _inheritInnerComments = _interopRequireDefault(__webpack_require__(275)); + +exports.inheritInnerComments = _inheritInnerComments.default; + +var _inheritLeadingComments = _interopRequireDefault(__webpack_require__(279)); + +exports.inheritLeadingComments = _inheritLeadingComments.default; + +var _inheritsComments = _interopRequireDefault(__webpack_require__(280)); + +exports.inheritsComments = _inheritsComments.default; + +var _inheritTrailingComments = _interopRequireDefault(__webpack_require__(281)); + +exports.inheritTrailingComments = _inheritTrailingComments.default; + +var _removeComments = _interopRequireDefault(__webpack_require__(731)); + +exports.removeComments = _removeComments.default; + +var _generated3 = __webpack_require__(732); + +Object.keys(_generated3).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + exports[key] = _generated3[key]; +}); + +var _constants = __webpack_require__(50); + +Object.keys(_constants).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + exports[key] = _constants[key]; +}); + +var _ensureBlock = _interopRequireDefault(__webpack_require__(733)); + +exports.ensureBlock = _ensureBlock.default; + +var _toBindingIdentifierName = _interopRequireDefault(__webpack_require__(734)); + +exports.toBindingIdentifierName = _toBindingIdentifierName.default; + +var _toBlock = _interopRequireDefault(__webpack_require__(282)); + +exports.toBlock = _toBlock.default; + +var _toComputedKey = _interopRequireDefault(__webpack_require__(735)); + +exports.toComputedKey = _toComputedKey.default; + +var _toExpression = _interopRequireDefault(__webpack_require__(736)); + +exports.toExpression = _toExpression.default; + +var _toIdentifier = _interopRequireDefault(__webpack_require__(283)); + +exports.toIdentifier = _toIdentifier.default; + +var _toKeyAlias = _interopRequireDefault(__webpack_require__(737)); + +exports.toKeyAlias = _toKeyAlias.default; + +var _toSequenceExpression = _interopRequireDefault(__webpack_require__(738)); + +exports.toSequenceExpression = _toSequenceExpression.default; + +var _toStatement = _interopRequireDefault(__webpack_require__(740)); + +exports.toStatement = _toStatement.default; + +var _valueToNode = _interopRequireDefault(__webpack_require__(741)); + +exports.valueToNode = _valueToNode.default; + +var _definitions = __webpack_require__(35); + +Object.keys(_definitions).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + exports[key] = _definitions[key]; +}); + +var _appendToMemberExpression = _interopRequireDefault(__webpack_require__(745)); + +exports.appendToMemberExpression = _appendToMemberExpression.default; + +var _inherits = _interopRequireDefault(__webpack_require__(746)); + +exports.inherits = _inherits.default; + +var _prependToMemberExpression = _interopRequireDefault(__webpack_require__(747)); + +exports.prependToMemberExpression = _prependToMemberExpression.default; + +var _removeProperties = _interopRequireDefault(__webpack_require__(286)); + +exports.removeProperties = _removeProperties.default; + +var _removePropertiesDeep = _interopRequireDefault(__webpack_require__(284)); + +exports.removePropertiesDeep = _removePropertiesDeep.default; + +var _removeTypeDuplicates = _interopRequireDefault(__webpack_require__(272)); + +exports.removeTypeDuplicates = _removeTypeDuplicates.default; + +var _getBindingIdentifiers = _interopRequireDefault(__webpack_require__(118)); + +exports.getBindingIdentifiers = _getBindingIdentifiers.default; + +var _getOuterBindingIdentifiers = _interopRequireDefault(__webpack_require__(748)); + +exports.getOuterBindingIdentifiers = _getOuterBindingIdentifiers.default; + +var _traverse = _interopRequireDefault(__webpack_require__(749)); + +exports.traverse = _traverse.default; + +var _traverseFast = _interopRequireDefault(__webpack_require__(285)); + +exports.traverseFast = _traverseFast.default; + +var _shallowEqual = _interopRequireDefault(__webpack_require__(258)); + +exports.shallowEqual = _shallowEqual.default; + +var _is = _interopRequireDefault(__webpack_require__(110)); + +exports.is = _is.default; + +var _isBinding = _interopRequireDefault(__webpack_require__(750)); + +exports.isBinding = _isBinding.default; + +var _isBlockScoped = _interopRequireDefault(__webpack_require__(751)); + +exports.isBlockScoped = _isBlockScoped.default; + +var _isImmutable = _interopRequireDefault(__webpack_require__(752)); + +exports.isImmutable = _isImmutable.default; + +var _isLet = _interopRequireDefault(__webpack_require__(287)); + +exports.isLet = _isLet.default; + +var _isNode = _interopRequireDefault(__webpack_require__(271)); + +exports.isNode = _isNode.default; + +var _isNodesEquivalent = _interopRequireDefault(__webpack_require__(753)); + +exports.isNodesEquivalent = _isNodesEquivalent.default; + +var _isReferenced = _interopRequireDefault(__webpack_require__(754)); + +exports.isReferenced = _isReferenced.default; + +var _isScope = _interopRequireDefault(__webpack_require__(755)); + +exports.isScope = _isScope.default; + +var _isSpecifierDefault = _interopRequireDefault(__webpack_require__(756)); + +exports.isSpecifierDefault = _isSpecifierDefault.default; + +var _isType = _interopRequireDefault(__webpack_require__(177)); + +exports.isType = _isType.default; + +var _isValidES3Identifier = _interopRequireDefault(__webpack_require__(757)); + +exports.isValidES3Identifier = _isValidES3Identifier.default; + +var _isValidIdentifier = _interopRequireDefault(__webpack_require__(83)); + +exports.isValidIdentifier = _isValidIdentifier.default; + +var _isVar = _interopRequireDefault(__webpack_require__(758)); + +exports.isVar = _isVar.default; + +var _matchesPattern = _interopRequireDefault(__webpack_require__(257)); + +exports.matchesPattern = _matchesPattern.default; + +var _validate = _interopRequireDefault(__webpack_require__(270)); + +exports.validate = _validate.default; + +var _buildMatchMemberExpression = _interopRequireDefault(__webpack_require__(256)); + +exports.buildMatchMemberExpression = _buildMatchMemberExpression.default; + +var _generated4 = __webpack_require__(17); + +Object.keys(_generated4).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + exports[key] = _generated4[key]; +}); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var react = { + isReactComponent: _isReactComponent.default, + isCompatTag: _isCompatTag.default, + buildChildren: _buildChildren.default +}; +exports.react = react; + +/***/ }), +/* 29 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3118,8 +2085,6 @@ exports.parenthesizedExpression = exports.ParenthesizedExpression = Parenthesize exports.awaitExpression = exports.AwaitExpression = AwaitExpression; exports.bindExpression = exports.BindExpression = BindExpression; exports.classProperty = exports.ClassProperty = ClassProperty; -exports.optionalMemberExpression = exports.OptionalMemberExpression = OptionalMemberExpression; -exports.optionalCallExpression = exports.OptionalCallExpression = OptionalCallExpression; exports.import = exports.Import = Import; exports.decorator = exports.Decorator = Decorator; exports.doExpression = exports.DoExpression = DoExpression; @@ -3184,7 +2149,7 @@ exports.regexLiteral = exports.RegexLiteral = RegexLiteral; exports.restProperty = exports.RestProperty = RestProperty; exports.spreadProperty = exports.SpreadProperty = SpreadProperty; -var _builder = _interopRequireDefault(__webpack_require__(2304)); +var _builder = _interopRequireDefault(__webpack_require__(677)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -4340,489 +3305,473 @@ function ClassProperty() { return _builder.default.apply(void 0, ["ClassProperty"].concat(args)); } -function OptionalMemberExpression() { +function Import() { for (var _len145 = arguments.length, args = new Array(_len145), _key145 = 0; _key145 < _len145; _key145++) { args[_key145] = arguments[_key145]; } - return _builder.default.apply(void 0, ["OptionalMemberExpression"].concat(args)); -} - -function OptionalCallExpression() { - for (var _len146 = arguments.length, args = new Array(_len146), _key146 = 0; _key146 < _len146; _key146++) { - args[_key146] = arguments[_key146]; - } - - return _builder.default.apply(void 0, ["OptionalCallExpression"].concat(args)); -} - -function Import() { - for (var _len147 = arguments.length, args = new Array(_len147), _key147 = 0; _key147 < _len147; _key147++) { - args[_key147] = arguments[_key147]; - } - return _builder.default.apply(void 0, ["Import"].concat(args)); } function Decorator() { - for (var _len148 = arguments.length, args = new Array(_len148), _key148 = 0; _key148 < _len148; _key148++) { - args[_key148] = arguments[_key148]; + for (var _len146 = arguments.length, args = new Array(_len146), _key146 = 0; _key146 < _len146; _key146++) { + args[_key146] = arguments[_key146]; } return _builder.default.apply(void 0, ["Decorator"].concat(args)); } function DoExpression() { - for (var _len149 = arguments.length, args = new Array(_len149), _key149 = 0; _key149 < _len149; _key149++) { - args[_key149] = arguments[_key149]; + for (var _len147 = arguments.length, args = new Array(_len147), _key147 = 0; _key147 < _len147; _key147++) { + args[_key147] = arguments[_key147]; } return _builder.default.apply(void 0, ["DoExpression"].concat(args)); } function ExportDefaultSpecifier() { - for (var _len150 = arguments.length, args = new Array(_len150), _key150 = 0; _key150 < _len150; _key150++) { - args[_key150] = arguments[_key150]; + for (var _len148 = arguments.length, args = new Array(_len148), _key148 = 0; _key148 < _len148; _key148++) { + args[_key148] = arguments[_key148]; } return _builder.default.apply(void 0, ["ExportDefaultSpecifier"].concat(args)); } function ExportNamespaceSpecifier() { - for (var _len151 = arguments.length, args = new Array(_len151), _key151 = 0; _key151 < _len151; _key151++) { - args[_key151] = arguments[_key151]; + for (var _len149 = arguments.length, args = new Array(_len149), _key149 = 0; _key149 < _len149; _key149++) { + args[_key149] = arguments[_key149]; } return _builder.default.apply(void 0, ["ExportNamespaceSpecifier"].concat(args)); } function TSParameterProperty() { - for (var _len152 = arguments.length, args = new Array(_len152), _key152 = 0; _key152 < _len152; _key152++) { - args[_key152] = arguments[_key152]; + for (var _len150 = arguments.length, args = new Array(_len150), _key150 = 0; _key150 < _len150; _key150++) { + args[_key150] = arguments[_key150]; } return _builder.default.apply(void 0, ["TSParameterProperty"].concat(args)); } function TSDeclareFunction() { - for (var _len153 = arguments.length, args = new Array(_len153), _key153 = 0; _key153 < _len153; _key153++) { - args[_key153] = arguments[_key153]; + for (var _len151 = arguments.length, args = new Array(_len151), _key151 = 0; _key151 < _len151; _key151++) { + args[_key151] = arguments[_key151]; } return _builder.default.apply(void 0, ["TSDeclareFunction"].concat(args)); } function TSDeclareMethod() { - for (var _len154 = arguments.length, args = new Array(_len154), _key154 = 0; _key154 < _len154; _key154++) { - args[_key154] = arguments[_key154]; + for (var _len152 = arguments.length, args = new Array(_len152), _key152 = 0; _key152 < _len152; _key152++) { + args[_key152] = arguments[_key152]; } return _builder.default.apply(void 0, ["TSDeclareMethod"].concat(args)); } function TSQualifiedName() { - for (var _len155 = arguments.length, args = new Array(_len155), _key155 = 0; _key155 < _len155; _key155++) { - args[_key155] = arguments[_key155]; + for (var _len153 = arguments.length, args = new Array(_len153), _key153 = 0; _key153 < _len153; _key153++) { + args[_key153] = arguments[_key153]; } return _builder.default.apply(void 0, ["TSQualifiedName"].concat(args)); } function TSCallSignatureDeclaration() { - for (var _len156 = arguments.length, args = new Array(_len156), _key156 = 0; _key156 < _len156; _key156++) { - args[_key156] = arguments[_key156]; + for (var _len154 = arguments.length, args = new Array(_len154), _key154 = 0; _key154 < _len154; _key154++) { + args[_key154] = arguments[_key154]; } return _builder.default.apply(void 0, ["TSCallSignatureDeclaration"].concat(args)); } function TSConstructSignatureDeclaration() { - for (var _len157 = arguments.length, args = new Array(_len157), _key157 = 0; _key157 < _len157; _key157++) { - args[_key157] = arguments[_key157]; + for (var _len155 = arguments.length, args = new Array(_len155), _key155 = 0; _key155 < _len155; _key155++) { + args[_key155] = arguments[_key155]; } return _builder.default.apply(void 0, ["TSConstructSignatureDeclaration"].concat(args)); } function TSPropertySignature() { - for (var _len158 = arguments.length, args = new Array(_len158), _key158 = 0; _key158 < _len158; _key158++) { - args[_key158] = arguments[_key158]; + for (var _len156 = arguments.length, args = new Array(_len156), _key156 = 0; _key156 < _len156; _key156++) { + args[_key156] = arguments[_key156]; } return _builder.default.apply(void 0, ["TSPropertySignature"].concat(args)); } function TSMethodSignature() { - for (var _len159 = arguments.length, args = new Array(_len159), _key159 = 0; _key159 < _len159; _key159++) { - args[_key159] = arguments[_key159]; + for (var _len157 = arguments.length, args = new Array(_len157), _key157 = 0; _key157 < _len157; _key157++) { + args[_key157] = arguments[_key157]; } return _builder.default.apply(void 0, ["TSMethodSignature"].concat(args)); } function TSIndexSignature() { - for (var _len160 = arguments.length, args = new Array(_len160), _key160 = 0; _key160 < _len160; _key160++) { - args[_key160] = arguments[_key160]; + for (var _len158 = arguments.length, args = new Array(_len158), _key158 = 0; _key158 < _len158; _key158++) { + args[_key158] = arguments[_key158]; } return _builder.default.apply(void 0, ["TSIndexSignature"].concat(args)); } function TSAnyKeyword() { - for (var _len161 = arguments.length, args = new Array(_len161), _key161 = 0; _key161 < _len161; _key161++) { - args[_key161] = arguments[_key161]; + for (var _len159 = arguments.length, args = new Array(_len159), _key159 = 0; _key159 < _len159; _key159++) { + args[_key159] = arguments[_key159]; } return _builder.default.apply(void 0, ["TSAnyKeyword"].concat(args)); } function TSNumberKeyword() { - for (var _len162 = arguments.length, args = new Array(_len162), _key162 = 0; _key162 < _len162; _key162++) { - args[_key162] = arguments[_key162]; + for (var _len160 = arguments.length, args = new Array(_len160), _key160 = 0; _key160 < _len160; _key160++) { + args[_key160] = arguments[_key160]; } return _builder.default.apply(void 0, ["TSNumberKeyword"].concat(args)); } function TSObjectKeyword() { - for (var _len163 = arguments.length, args = new Array(_len163), _key163 = 0; _key163 < _len163; _key163++) { - args[_key163] = arguments[_key163]; + for (var _len161 = arguments.length, args = new Array(_len161), _key161 = 0; _key161 < _len161; _key161++) { + args[_key161] = arguments[_key161]; } return _builder.default.apply(void 0, ["TSObjectKeyword"].concat(args)); } function TSBooleanKeyword() { - for (var _len164 = arguments.length, args = new Array(_len164), _key164 = 0; _key164 < _len164; _key164++) { - args[_key164] = arguments[_key164]; + for (var _len162 = arguments.length, args = new Array(_len162), _key162 = 0; _key162 < _len162; _key162++) { + args[_key162] = arguments[_key162]; } return _builder.default.apply(void 0, ["TSBooleanKeyword"].concat(args)); } function TSStringKeyword() { - for (var _len165 = arguments.length, args = new Array(_len165), _key165 = 0; _key165 < _len165; _key165++) { - args[_key165] = arguments[_key165]; + for (var _len163 = arguments.length, args = new Array(_len163), _key163 = 0; _key163 < _len163; _key163++) { + args[_key163] = arguments[_key163]; } return _builder.default.apply(void 0, ["TSStringKeyword"].concat(args)); } function TSSymbolKeyword() { - for (var _len166 = arguments.length, args = new Array(_len166), _key166 = 0; _key166 < _len166; _key166++) { - args[_key166] = arguments[_key166]; + for (var _len164 = arguments.length, args = new Array(_len164), _key164 = 0; _key164 < _len164; _key164++) { + args[_key164] = arguments[_key164]; } return _builder.default.apply(void 0, ["TSSymbolKeyword"].concat(args)); } function TSVoidKeyword() { - for (var _len167 = arguments.length, args = new Array(_len167), _key167 = 0; _key167 < _len167; _key167++) { - args[_key167] = arguments[_key167]; + for (var _len165 = arguments.length, args = new Array(_len165), _key165 = 0; _key165 < _len165; _key165++) { + args[_key165] = arguments[_key165]; } return _builder.default.apply(void 0, ["TSVoidKeyword"].concat(args)); } function TSUndefinedKeyword() { - for (var _len168 = arguments.length, args = new Array(_len168), _key168 = 0; _key168 < _len168; _key168++) { - args[_key168] = arguments[_key168]; + for (var _len166 = arguments.length, args = new Array(_len166), _key166 = 0; _key166 < _len166; _key166++) { + args[_key166] = arguments[_key166]; } return _builder.default.apply(void 0, ["TSUndefinedKeyword"].concat(args)); } function TSNullKeyword() { - for (var _len169 = arguments.length, args = new Array(_len169), _key169 = 0; _key169 < _len169; _key169++) { - args[_key169] = arguments[_key169]; + for (var _len167 = arguments.length, args = new Array(_len167), _key167 = 0; _key167 < _len167; _key167++) { + args[_key167] = arguments[_key167]; } return _builder.default.apply(void 0, ["TSNullKeyword"].concat(args)); } function TSNeverKeyword() { - for (var _len170 = arguments.length, args = new Array(_len170), _key170 = 0; _key170 < _len170; _key170++) { - args[_key170] = arguments[_key170]; + for (var _len168 = arguments.length, args = new Array(_len168), _key168 = 0; _key168 < _len168; _key168++) { + args[_key168] = arguments[_key168]; } return _builder.default.apply(void 0, ["TSNeverKeyword"].concat(args)); } function TSThisType() { - for (var _len171 = arguments.length, args = new Array(_len171), _key171 = 0; _key171 < _len171; _key171++) { - args[_key171] = arguments[_key171]; + for (var _len169 = arguments.length, args = new Array(_len169), _key169 = 0; _key169 < _len169; _key169++) { + args[_key169] = arguments[_key169]; } return _builder.default.apply(void 0, ["TSThisType"].concat(args)); } function TSFunctionType() { - for (var _len172 = arguments.length, args = new Array(_len172), _key172 = 0; _key172 < _len172; _key172++) { - args[_key172] = arguments[_key172]; + for (var _len170 = arguments.length, args = new Array(_len170), _key170 = 0; _key170 < _len170; _key170++) { + args[_key170] = arguments[_key170]; } return _builder.default.apply(void 0, ["TSFunctionType"].concat(args)); } function TSConstructorType() { - for (var _len173 = arguments.length, args = new Array(_len173), _key173 = 0; _key173 < _len173; _key173++) { - args[_key173] = arguments[_key173]; + for (var _len171 = arguments.length, args = new Array(_len171), _key171 = 0; _key171 < _len171; _key171++) { + args[_key171] = arguments[_key171]; } return _builder.default.apply(void 0, ["TSConstructorType"].concat(args)); } function TSTypeReference() { - for (var _len174 = arguments.length, args = new Array(_len174), _key174 = 0; _key174 < _len174; _key174++) { - args[_key174] = arguments[_key174]; + for (var _len172 = arguments.length, args = new Array(_len172), _key172 = 0; _key172 < _len172; _key172++) { + args[_key172] = arguments[_key172]; } return _builder.default.apply(void 0, ["TSTypeReference"].concat(args)); } function TSTypePredicate() { - for (var _len175 = arguments.length, args = new Array(_len175), _key175 = 0; _key175 < _len175; _key175++) { - args[_key175] = arguments[_key175]; + for (var _len173 = arguments.length, args = new Array(_len173), _key173 = 0; _key173 < _len173; _key173++) { + args[_key173] = arguments[_key173]; } return _builder.default.apply(void 0, ["TSTypePredicate"].concat(args)); } function TSTypeQuery() { - for (var _len176 = arguments.length, args = new Array(_len176), _key176 = 0; _key176 < _len176; _key176++) { - args[_key176] = arguments[_key176]; + for (var _len174 = arguments.length, args = new Array(_len174), _key174 = 0; _key174 < _len174; _key174++) { + args[_key174] = arguments[_key174]; } return _builder.default.apply(void 0, ["TSTypeQuery"].concat(args)); } function TSTypeLiteral() { - for (var _len177 = arguments.length, args = new Array(_len177), _key177 = 0; _key177 < _len177; _key177++) { - args[_key177] = arguments[_key177]; + for (var _len175 = arguments.length, args = new Array(_len175), _key175 = 0; _key175 < _len175; _key175++) { + args[_key175] = arguments[_key175]; } return _builder.default.apply(void 0, ["TSTypeLiteral"].concat(args)); } function TSArrayType() { - for (var _len178 = arguments.length, args = new Array(_len178), _key178 = 0; _key178 < _len178; _key178++) { - args[_key178] = arguments[_key178]; + for (var _len176 = arguments.length, args = new Array(_len176), _key176 = 0; _key176 < _len176; _key176++) { + args[_key176] = arguments[_key176]; } return _builder.default.apply(void 0, ["TSArrayType"].concat(args)); } function TSTupleType() { - for (var _len179 = arguments.length, args = new Array(_len179), _key179 = 0; _key179 < _len179; _key179++) { - args[_key179] = arguments[_key179]; + for (var _len177 = arguments.length, args = new Array(_len177), _key177 = 0; _key177 < _len177; _key177++) { + args[_key177] = arguments[_key177]; } return _builder.default.apply(void 0, ["TSTupleType"].concat(args)); } function TSUnionType() { - for (var _len180 = arguments.length, args = new Array(_len180), _key180 = 0; _key180 < _len180; _key180++) { - args[_key180] = arguments[_key180]; + for (var _len178 = arguments.length, args = new Array(_len178), _key178 = 0; _key178 < _len178; _key178++) { + args[_key178] = arguments[_key178]; } return _builder.default.apply(void 0, ["TSUnionType"].concat(args)); } function TSIntersectionType() { - for (var _len181 = arguments.length, args = new Array(_len181), _key181 = 0; _key181 < _len181; _key181++) { - args[_key181] = arguments[_key181]; + for (var _len179 = arguments.length, args = new Array(_len179), _key179 = 0; _key179 < _len179; _key179++) { + args[_key179] = arguments[_key179]; } return _builder.default.apply(void 0, ["TSIntersectionType"].concat(args)); } function TSParenthesizedType() { - for (var _len182 = arguments.length, args = new Array(_len182), _key182 = 0; _key182 < _len182; _key182++) { - args[_key182] = arguments[_key182]; + for (var _len180 = arguments.length, args = new Array(_len180), _key180 = 0; _key180 < _len180; _key180++) { + args[_key180] = arguments[_key180]; } return _builder.default.apply(void 0, ["TSParenthesizedType"].concat(args)); } function TSTypeOperator() { - for (var _len183 = arguments.length, args = new Array(_len183), _key183 = 0; _key183 < _len183; _key183++) { - args[_key183] = arguments[_key183]; + for (var _len181 = arguments.length, args = new Array(_len181), _key181 = 0; _key181 < _len181; _key181++) { + args[_key181] = arguments[_key181]; } return _builder.default.apply(void 0, ["TSTypeOperator"].concat(args)); } function TSIndexedAccessType() { - for (var _len184 = arguments.length, args = new Array(_len184), _key184 = 0; _key184 < _len184; _key184++) { - args[_key184] = arguments[_key184]; + for (var _len182 = arguments.length, args = new Array(_len182), _key182 = 0; _key182 < _len182; _key182++) { + args[_key182] = arguments[_key182]; } return _builder.default.apply(void 0, ["TSIndexedAccessType"].concat(args)); } function TSMappedType() { - for (var _len185 = arguments.length, args = new Array(_len185), _key185 = 0; _key185 < _len185; _key185++) { - args[_key185] = arguments[_key185]; + for (var _len183 = arguments.length, args = new Array(_len183), _key183 = 0; _key183 < _len183; _key183++) { + args[_key183] = arguments[_key183]; } return _builder.default.apply(void 0, ["TSMappedType"].concat(args)); } function TSLiteralType() { - for (var _len186 = arguments.length, args = new Array(_len186), _key186 = 0; _key186 < _len186; _key186++) { - args[_key186] = arguments[_key186]; + for (var _len184 = arguments.length, args = new Array(_len184), _key184 = 0; _key184 < _len184; _key184++) { + args[_key184] = arguments[_key184]; } return _builder.default.apply(void 0, ["TSLiteralType"].concat(args)); } function TSExpressionWithTypeArguments() { - for (var _len187 = arguments.length, args = new Array(_len187), _key187 = 0; _key187 < _len187; _key187++) { - args[_key187] = arguments[_key187]; + for (var _len185 = arguments.length, args = new Array(_len185), _key185 = 0; _key185 < _len185; _key185++) { + args[_key185] = arguments[_key185]; } return _builder.default.apply(void 0, ["TSExpressionWithTypeArguments"].concat(args)); } function TSInterfaceDeclaration() { - for (var _len188 = arguments.length, args = new Array(_len188), _key188 = 0; _key188 < _len188; _key188++) { - args[_key188] = arguments[_key188]; + for (var _len186 = arguments.length, args = new Array(_len186), _key186 = 0; _key186 < _len186; _key186++) { + args[_key186] = arguments[_key186]; } return _builder.default.apply(void 0, ["TSInterfaceDeclaration"].concat(args)); } function TSInterfaceBody() { - for (var _len189 = arguments.length, args = new Array(_len189), _key189 = 0; _key189 < _len189; _key189++) { - args[_key189] = arguments[_key189]; + for (var _len187 = arguments.length, args = new Array(_len187), _key187 = 0; _key187 < _len187; _key187++) { + args[_key187] = arguments[_key187]; } return _builder.default.apply(void 0, ["TSInterfaceBody"].concat(args)); } function TSTypeAliasDeclaration() { - for (var _len190 = arguments.length, args = new Array(_len190), _key190 = 0; _key190 < _len190; _key190++) { - args[_key190] = arguments[_key190]; + for (var _len188 = arguments.length, args = new Array(_len188), _key188 = 0; _key188 < _len188; _key188++) { + args[_key188] = arguments[_key188]; } return _builder.default.apply(void 0, ["TSTypeAliasDeclaration"].concat(args)); } function TSAsExpression() { - for (var _len191 = arguments.length, args = new Array(_len191), _key191 = 0; _key191 < _len191; _key191++) { - args[_key191] = arguments[_key191]; + for (var _len189 = arguments.length, args = new Array(_len189), _key189 = 0; _key189 < _len189; _key189++) { + args[_key189] = arguments[_key189]; } return _builder.default.apply(void 0, ["TSAsExpression"].concat(args)); } function TSTypeAssertion() { - for (var _len192 = arguments.length, args = new Array(_len192), _key192 = 0; _key192 < _len192; _key192++) { - args[_key192] = arguments[_key192]; + for (var _len190 = arguments.length, args = new Array(_len190), _key190 = 0; _key190 < _len190; _key190++) { + args[_key190] = arguments[_key190]; } return _builder.default.apply(void 0, ["TSTypeAssertion"].concat(args)); } function TSEnumDeclaration() { - for (var _len193 = arguments.length, args = new Array(_len193), _key193 = 0; _key193 < _len193; _key193++) { - args[_key193] = arguments[_key193]; + for (var _len191 = arguments.length, args = new Array(_len191), _key191 = 0; _key191 < _len191; _key191++) { + args[_key191] = arguments[_key191]; } return _builder.default.apply(void 0, ["TSEnumDeclaration"].concat(args)); } function TSEnumMember() { - for (var _len194 = arguments.length, args = new Array(_len194), _key194 = 0; _key194 < _len194; _key194++) { - args[_key194] = arguments[_key194]; + for (var _len192 = arguments.length, args = new Array(_len192), _key192 = 0; _key192 < _len192; _key192++) { + args[_key192] = arguments[_key192]; } return _builder.default.apply(void 0, ["TSEnumMember"].concat(args)); } function TSModuleDeclaration() { - for (var _len195 = arguments.length, args = new Array(_len195), _key195 = 0; _key195 < _len195; _key195++) { - args[_key195] = arguments[_key195]; + for (var _len193 = arguments.length, args = new Array(_len193), _key193 = 0; _key193 < _len193; _key193++) { + args[_key193] = arguments[_key193]; } return _builder.default.apply(void 0, ["TSModuleDeclaration"].concat(args)); } function TSModuleBlock() { - for (var _len196 = arguments.length, args = new Array(_len196), _key196 = 0; _key196 < _len196; _key196++) { - args[_key196] = arguments[_key196]; + for (var _len194 = arguments.length, args = new Array(_len194), _key194 = 0; _key194 < _len194; _key194++) { + args[_key194] = arguments[_key194]; } return _builder.default.apply(void 0, ["TSModuleBlock"].concat(args)); } function TSImportEqualsDeclaration() { - for (var _len197 = arguments.length, args = new Array(_len197), _key197 = 0; _key197 < _len197; _key197++) { - args[_key197] = arguments[_key197]; + for (var _len195 = arguments.length, args = new Array(_len195), _key195 = 0; _key195 < _len195; _key195++) { + args[_key195] = arguments[_key195]; } return _builder.default.apply(void 0, ["TSImportEqualsDeclaration"].concat(args)); } function TSExternalModuleReference() { - for (var _len198 = arguments.length, args = new Array(_len198), _key198 = 0; _key198 < _len198; _key198++) { - args[_key198] = arguments[_key198]; + for (var _len196 = arguments.length, args = new Array(_len196), _key196 = 0; _key196 < _len196; _key196++) { + args[_key196] = arguments[_key196]; } return _builder.default.apply(void 0, ["TSExternalModuleReference"].concat(args)); } function TSNonNullExpression() { - for (var _len199 = arguments.length, args = new Array(_len199), _key199 = 0; _key199 < _len199; _key199++) { - args[_key199] = arguments[_key199]; + for (var _len197 = arguments.length, args = new Array(_len197), _key197 = 0; _key197 < _len197; _key197++) { + args[_key197] = arguments[_key197]; } return _builder.default.apply(void 0, ["TSNonNullExpression"].concat(args)); } function TSExportAssignment() { - for (var _len200 = arguments.length, args = new Array(_len200), _key200 = 0; _key200 < _len200; _key200++) { - args[_key200] = arguments[_key200]; + for (var _len198 = arguments.length, args = new Array(_len198), _key198 = 0; _key198 < _len198; _key198++) { + args[_key198] = arguments[_key198]; } return _builder.default.apply(void 0, ["TSExportAssignment"].concat(args)); } function TSNamespaceExportDeclaration() { - for (var _len201 = arguments.length, args = new Array(_len201), _key201 = 0; _key201 < _len201; _key201++) { - args[_key201] = arguments[_key201]; + for (var _len199 = arguments.length, args = new Array(_len199), _key199 = 0; _key199 < _len199; _key199++) { + args[_key199] = arguments[_key199]; } return _builder.default.apply(void 0, ["TSNamespaceExportDeclaration"].concat(args)); } function TSTypeAnnotation() { - for (var _len202 = arguments.length, args = new Array(_len202), _key202 = 0; _key202 < _len202; _key202++) { - args[_key202] = arguments[_key202]; + for (var _len200 = arguments.length, args = new Array(_len200), _key200 = 0; _key200 < _len200; _key200++) { + args[_key200] = arguments[_key200]; } return _builder.default.apply(void 0, ["TSTypeAnnotation"].concat(args)); } function TSTypeParameterInstantiation() { - for (var _len203 = arguments.length, args = new Array(_len203), _key203 = 0; _key203 < _len203; _key203++) { - args[_key203] = arguments[_key203]; + for (var _len201 = arguments.length, args = new Array(_len201), _key201 = 0; _key201 < _len201; _key201++) { + args[_key201] = arguments[_key201]; } return _builder.default.apply(void 0, ["TSTypeParameterInstantiation"].concat(args)); } function TSTypeParameterDeclaration() { - for (var _len204 = arguments.length, args = new Array(_len204), _key204 = 0; _key204 < _len204; _key204++) { - args[_key204] = arguments[_key204]; + for (var _len202 = arguments.length, args = new Array(_len202), _key202 = 0; _key202 < _len202; _key202++) { + args[_key202] = arguments[_key202]; } return _builder.default.apply(void 0, ["TSTypeParameterDeclaration"].concat(args)); } function TSTypeParameter() { - for (var _len205 = arguments.length, args = new Array(_len205), _key205 = 0; _key205 < _len205; _key205++) { - args[_key205] = arguments[_key205]; + for (var _len203 = arguments.length, args = new Array(_len203), _key203 = 0; _key203 < _len203; _key203++) { + args[_key203] = arguments[_key203]; } return _builder.default.apply(void 0, ["TSTypeParameter"].concat(args)); @@ -4831,8 +3780,8 @@ function TSTypeParameter() { function NumberLiteral() { console.trace("The node type NumberLiteral has been renamed to NumericLiteral"); - for (var _len206 = arguments.length, args = new Array(_len206), _key206 = 0; _key206 < _len206; _key206++) { - args[_key206] = arguments[_key206]; + for (var _len204 = arguments.length, args = new Array(_len204), _key204 = 0; _key204 < _len204; _key204++) { + args[_key204] = arguments[_key204]; } return NumberLiteral.apply(void 0, ["NumberLiteral"].concat(args)); @@ -4841,8 +3790,8 @@ function NumberLiteral() { function RegexLiteral() { console.trace("The node type RegexLiteral has been renamed to RegExpLiteral"); - for (var _len207 = arguments.length, args = new Array(_len207), _key207 = 0; _key207 < _len207; _key207++) { - args[_key207] = arguments[_key207]; + for (var _len205 = arguments.length, args = new Array(_len205), _key205 = 0; _key205 < _len205; _key205++) { + args[_key205] = arguments[_key205]; } return RegexLiteral.apply(void 0, ["RegexLiteral"].concat(args)); @@ -4851,8 +3800,8 @@ function RegexLiteral() { function RestProperty() { console.trace("The node type RestProperty has been renamed to RestElement"); - for (var _len208 = arguments.length, args = new Array(_len208), _key208 = 0; _key208 < _len208; _key208++) { - args[_key208] = arguments[_key208]; + for (var _len206 = arguments.length, args = new Array(_len206), _key206 = 0; _key206 < _len206; _key206++) { + args[_key206] = arguments[_key206]; } return RestProperty.apply(void 0, ["RestProperty"].concat(args)); @@ -4861,16 +3810,54 @@ function RestProperty() { function SpreadProperty() { console.trace("The node type SpreadProperty has been renamed to SpreadElement"); - for (var _len209 = arguments.length, args = new Array(_len209), _key209 = 0; _key209 < _len209; _key209++) { - args[_key209] = arguments[_key209]; + for (var _len207 = arguments.length, args = new Array(_len207), _key207 = 0; _key207 < _len207; _key207++) { + args[_key207] = arguments[_key207]; } return SpreadProperty.apply(void 0, ["SpreadProperty"].concat(args)); } /***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ 2257: +var baseGetTag = __webpack_require__(23), + isObjectLike = __webpack_require__(21); + +/** `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; + + +/***/ }), +/* 31 */, +/* 32 */, +/* 33 */, +/* 34 */, +/* 35 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4879,23 +3866,23 @@ function SpreadProperty() { exports.__esModule = true; exports.TYPES = void 0; -var _toFastProperties = _interopRequireDefault(__webpack_require__(541)); +var _toFastProperties = _interopRequireDefault(__webpack_require__(665)); -__webpack_require__(2265); +__webpack_require__(178); -__webpack_require__(2266); +__webpack_require__(179); -__webpack_require__(2296); +__webpack_require__(669); -__webpack_require__(2297); +__webpack_require__(670); -__webpack_require__(2298); +__webpack_require__(671); -__webpack_require__(2299); +__webpack_require__(672); -__webpack_require__(2300); +__webpack_require__(673); -var _utils = __webpack_require__(2258); +var _utils = __webpack_require__(43); exports.VISITOR_KEYS = _utils.VISITOR_KEYS; exports.ALIAS_KEYS = _utils.ALIAS_KEYS; @@ -4916,8 +3903,100 @@ var TYPES = Object.keys(_utils.VISITOR_KEYS).concat(Object.keys(_utils.FLIPPED_A exports.TYPES = TYPES; /***/ }), +/* 36 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ 2258: +var getNative = __webpack_require__(25); + +/* Built-in method references that are verified to be native. */ +var nativeCreate = getNative(Object, 'create'); + +module.exports = nativeCreate; + + +/***/ }), +/* 37 */ +/***/ (function(module, exports, __webpack_require__) { + +var eq = __webpack_require__(54); + +/** + * 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; + + +/***/ }), +/* 38 */ +/***/ (function(module, exports, __webpack_require__) { + +var isKeyable = __webpack_require__(141); + +/** + * 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; + + +/***/ }), +/* 39 */, +/* 40 */ +/***/ (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; + + +/***/ }), +/* 41 */, +/* 42 */, +/* 43 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4941,7 +4020,7 @@ exports.chain = chain; exports.default = defineType; exports.DEPRECATED_KEYS = exports.BUILDER_KEYS = exports.NODE_FIELDS = exports.FLIPPED_ALIAS_KEYS = exports.ALIAS_KEYS = exports.VISITOR_KEYS = void 0; -var _is = _interopRequireDefault(__webpack_require__(2262)); +var _is = _interopRequireDefault(__webpack_require__(110)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -5169,8 +4248,196 @@ function defineType(type, opts) { var store = {}; /***/ }), +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ 2259: +var isSymbol = __webpack_require__(30); + +/** 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; + + +/***/ }), +/* 45 */, +/* 46 */ +/***/ (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; + +/***/ }), +/* 47 */ +/***/ (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) { + 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 +}; + +/***/ }), +/* 48 */, +/* 49 */, +/* 50 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5221,8 +4488,602 @@ var NOT_LOCAL_BINDING = Symbol.for("should not be considered a local binding"); exports.NOT_LOCAL_BINDING = NOT_LOCAL_BINDING; /***/ }), +/* 51 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ 2260: +"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; }; /* 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 . */ + +exports.parseScript = parseScript; +exports.getAst = getAst; +exports.clearASTs = clearASTs; +exports.traverseAst = traverseAst; + +var _parseScriptTags = __webpack_require__(759); + +var _parseScriptTags2 = _interopRequireDefault(_parseScriptTags); + +var _babylon = __webpack_require__(289); + +var babylon = _interopRequireWildcard(_babylon); + +var _types = __webpack_require__(28); + +var t = _interopRequireWildcard(_types); + +var _isEmpty = __webpack_require__(290); + +var _isEmpty2 = _interopRequireDefault(_isEmpty); + +var _sources = __webpack_require__(291); + +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 }; } + +let ASTs = new Map(); + +function _parse(code, opts) { + return babylon.parse(code, _extends({}, opts, { + tokens: true + })); +} + +const sourceOptions = { + generated: { + tokens: true + }, + original: { + sourceType: "unambiguous", + tokens: true, + plugins: ["jsx", "flow", "doExpressions", "objectRestSpread", "classProperties", "exportDefaultFrom", "exportNamespaceFrom", "asyncGenerators", "functionBind", "functionSent", "dynamicImport"] + } +}; + +function parse(text, opts) { + let ast; + if (!text) { + return; + } + + try { + ast = _parse(text, opts); + } catch (error) { + ast = {}; + } + + return ast; +} + +// Custom parser for parse-script-tags that adapts its input structure to +// our parser's signature +function htmlParser({ source, line }) { + return parse(source, { startLine: line }); +} + +function parseScript(text, opts) { + return _parse(text, opts); +} + +function getAst(sourceId) { + if (ASTs.has(sourceId)) { + return ASTs.get(sourceId); + } + + const source = (0, _sources.getSource)(sourceId); + + let ast = {}; + const { contentType } = source; + if (contentType == "text/html") { + ast = (0, _parseScriptTags2.default)(source.text, htmlParser) || {}; + } else if (contentType && contentType.match(/(javascript|jsx)/)) { + const type = source.id.includes("original") ? "original" : "generated"; + const options = sourceOptions[type]; + ast = parse(source.text, options); + } + + ASTs.set(source.id, ast); + return ast; +} + +function clearASTs() { + ASTs = new Map(); +} + +function traverseAst(sourceId, visitor, state) { + const ast = getAst(sourceId); + if ((0, _isEmpty2.default)(ast)) { + return null; + } + + t.traverse(ast, visitor, state); + // t.fastTraverse(ast, visitor); + return ast; +} + +/***/ }), +/* 52 */ +/***/ (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__(40))) + +/***/ }), +/* 53 */ +/***/ (function(module, exports, __webpack_require__) { + +var listCacheClear = __webpack_require__(135), + listCacheDelete = __webpack_require__(136), + listCacheGet = __webpack_require__(137), + listCacheHas = __webpack_require__(138), + listCacheSet = __webpack_require__(139); + +/** + * 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; + + +/***/ }), +/* 54 */ +/***/ (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; + + +/***/ }), +/* 55 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseToString = __webpack_require__(67); + +/** + * 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; + + +/***/ }), +/* 56 */ +/***/ (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; + + +/***/ }), +/* 57 */, +/* 58 */, +/* 59 */, +/* 60 */, +/* 61 */ +/***/ (function(module, exports, __webpack_require__) { + +var isArray = __webpack_require__(16), + isKey = __webpack_require__(62), + stringToPath = __webpack_require__(121), + toString = __webpack_require__(55); + +/** + * 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; + + +/***/ }), +/* 62 */ +/***/ (function(module, exports, __webpack_require__) { + +var isArray = __webpack_require__(16), + isSymbol = __webpack_require__(30); + +/** 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; + + +/***/ }), +/* 63 */ +/***/ (function(module, exports, __webpack_require__) { + +var Symbol = __webpack_require__(20); + +/** 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; + + +/***/ }), +/* 64 */ +/***/ (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; + + +/***/ }), +/* 65 */ +/***/ (function(module, exports, __webpack_require__) { + +var mapCacheClear = __webpack_require__(124), + mapCacheDelete = __webpack_require__(140), + mapCacheGet = __webpack_require__(142), + mapCacheHas = __webpack_require__(143), + mapCacheSet = __webpack_require__(144); + +/** + * 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; + + +/***/ }), +/* 66 */ +/***/ (function(module, exports, __webpack_require__) { + +var getNative = __webpack_require__(25), + root = __webpack_require__(18); + +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'); + +module.exports = Map; + + +/***/ }), +/* 67 */ +/***/ (function(module, exports, __webpack_require__) { + +var Symbol = __webpack_require__(20), + arrayMap = __webpack_require__(56), + isArray = __webpack_require__(16), + isSymbol = __webpack_require__(30); + +/** 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; + + +/***/ }), +/* 68 */, +/* 69 */, +/* 70 */, +/* 71 */ +/***/ (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; + + +/***/ }), +/* 72 */, +/* 73 */ +/***/ (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; +}; + + +/***/ }), +/* 74 */, +/* 75 */, +/* 76 */, +/* 77 */, +/* 78 */, +/* 79 */, +/* 80 */, +/* 81 */, +/* 82 */, +/* 83 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5231,7 +5092,7 @@ exports.NOT_LOCAL_BINDING = NOT_LOCAL_BINDING; exports.__esModule = true; exports.default = isValidIdentifier; -var _esutils = _interopRequireDefault(__webpack_require__(530)); +var _esutils = _interopRequireDefault(__webpack_require__(666)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -5246,8 +5107,91 @@ function isValidIdentifier(name) { } /***/ }), +/* 84 */ +/***/ (function(module, exports) { -/***/ 2261: +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +module.exports = baseUnary; + + +/***/ }), +/* 85 */ +/***/ (function(module, exports, __webpack_require__) { + +var DataView = __webpack_require__(701), + Map = __webpack_require__(66), + Promise = __webpack_require__(702), + Set = __webpack_require__(268), + WeakMap = __webpack_require__(703), + baseGetTag = __webpack_require__(23), + toSource = __webpack_require__(91); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + setTag = '[object Set]', + weakMapTag = '[object WeakMap]'; + +var dataViewTag = '[object DataView]'; + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; + +// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; +} + +module.exports = getTag; + + +/***/ }), +/* 86 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5256,7 +5200,7 @@ function isValidIdentifier(name) { exports.__esModule = true; exports.default = cloneNode; -var _definitions = __webpack_require__(2257); +var _definitions = __webpack_require__(35); var has = Function.call.bind(Object.prototype.hasOwnProperty); @@ -5329,8 +5273,279 @@ function cloneNode(node, deep) { } /***/ }), +/* 87 */, +/* 88 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ 2262: +var baseGet = __webpack_require__(89); + +/** + * 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; + + +/***/ }), +/* 89 */ +/***/ (function(module, exports, __webpack_require__) { + +var castPath = __webpack_require__(61), + toKey = __webpack_require__(44); + +/** + * 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; + + +/***/ }), +/* 90 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseGetTag = __webpack_require__(23), + isObject = __webpack_require__(26); + +/** `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; + + +/***/ }), +/* 91 */ +/***/ (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; + + +/***/ }), +/* 92 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseAssignValue = __webpack_require__(93), + eq = __webpack_require__(54); + +/** 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; + + +/***/ }), +/* 93 */ +/***/ (function(module, exports, __webpack_require__) { + +var defineProperty = __webpack_require__(94); + +/** + * 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; + + +/***/ }), +/* 94 */ +/***/ (function(module, exports, __webpack_require__) { + +var getNative = __webpack_require__(25); + +var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} +}()); + +module.exports = defineProperty; + + +/***/ }), +/* 95 */ +/***/ (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) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); +} + +module.exports = isIndex; + + +/***/ }), +/* 96 */, +/* 97 */, +/* 98 */, +/* 99 */, +/* 100 */, +/* 101 */, +/* 102 */, +/* 103 */, +/* 104 */, +/* 105 */, +/* 106 */, +/* 107 */, +/* 108 */, +/* 109 */, +/* 110 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5339,9 +5554,9 @@ function cloneNode(node, deep) { exports.__esModule = true; exports.default = is; -var _shallowEqual = _interopRequireDefault(__webpack_require__(2271)); +var _shallowEqual = _interopRequireDefault(__webpack_require__(258)); -var _isType = _interopRequireDefault(__webpack_require__(2264)); +var _isType = _interopRequireDefault(__webpack_require__(177)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -5358,8 +5573,275 @@ function is(type, node, opts) { } /***/ }), +/* 111 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ 2263: +var assignValue = __webpack_require__(92), + baseAssignValue = __webpack_require__(93); + +/** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ +function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; +} + +module.exports = copyObject; + + +/***/ }), +/* 112 */ +/***/ (function(module, exports, __webpack_require__) { + +var arrayLikeKeys = __webpack_require__(260), + baseKeys = __webpack_require__(261), + isArrayLike = __webpack_require__(117); + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +module.exports = keys; + + +/***/ }), +/* 113 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseIsArguments = __webpack_require__(688), + isObjectLike = __webpack_require__(21); + +/** 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; + + +/***/ }), +/* 114 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(18), + stubFalse = __webpack_require__(689); + +/** Detect free variable `exports`. */ +var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; + +/** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ +var isBuffer = nativeIsBuffer || stubFalse; + +module.exports = isBuffer; + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(73)(module))) + +/***/ }), +/* 115 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(module) {var freeGlobal = __webpack_require__(52); + +/** Detect free variable `exports`. */ +var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports && freeGlobal.process; + +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function() { + try { + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} +}()); + +module.exports = nodeUtil; + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(73)(module))) + +/***/ }), +/* 116 */ +/***/ (function(module, exports) { + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +module.exports = isPrototype; + + +/***/ }), +/* 117 */ +/***/ (function(module, exports, __webpack_require__) { + +var isFunction = __webpack_require__(90), + isLength = __webpack_require__(182); + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +module.exports = isArrayLike; + + +/***/ }), +/* 118 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5368,7 +5850,7 @@ function is(type, node, opts) { exports.__esModule = true; exports.default = getBindingIdentifiers; -var _generated = __webpack_require__(2255); +var _generated = __webpack_require__(17); function getBindingIdentifiers(node, duplicates, outerOnly) { var search = [].concat(node); @@ -5460,8 +5942,1125 @@ getBindingIdentifiers.keys = { }; /***/ }), +/* 119 */, +/* 120 */, +/* 121 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ 2264: +var memoizeCapped = __webpack_require__(122); + +/** Used to match property names within property paths. */ +var 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 (string.charCodeAt(0) === 46 /* . */) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, subString) { + result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; +}); + +module.exports = stringToPath; + + +/***/ }), +/* 122 */ +/***/ (function(module, exports, __webpack_require__) { + +var memoize = __webpack_require__(123); + +/** 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; + + +/***/ }), +/* 123 */ +/***/ (function(module, exports, __webpack_require__) { + +var MapCache = __webpack_require__(65); + +/** 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; + + +/***/ }), +/* 124 */ +/***/ (function(module, exports, __webpack_require__) { + +var Hash = __webpack_require__(125), + ListCache = __webpack_require__(53), + Map = __webpack_require__(66); + +/** + * 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; + + +/***/ }), +/* 125 */ +/***/ (function(module, exports, __webpack_require__) { + +var hashClear = __webpack_require__(126), + hashDelete = __webpack_require__(131), + hashGet = __webpack_require__(132), + hashHas = __webpack_require__(133), + hashSet = __webpack_require__(134); + +/** + * 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; + + +/***/ }), +/* 126 */ +/***/ (function(module, exports, __webpack_require__) { + +var nativeCreate = __webpack_require__(36); + +/** + * 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; + + +/***/ }), +/* 127 */ +/***/ (function(module, exports, __webpack_require__) { + +var isFunction = __webpack_require__(90), + isMasked = __webpack_require__(128), + isObject = __webpack_require__(26), + toSource = __webpack_require__(91); + +/** + * 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; + + +/***/ }), +/* 128 */ +/***/ (function(module, exports, __webpack_require__) { + +var coreJsData = __webpack_require__(129); + +/** 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; + + +/***/ }), +/* 129 */ +/***/ (function(module, exports, __webpack_require__) { + +var root = __webpack_require__(18); + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +module.exports = coreJsData; + + +/***/ }), +/* 130 */ +/***/ (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; + + +/***/ }), +/* 131 */ +/***/ (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; + + +/***/ }), +/* 132 */ +/***/ (function(module, exports, __webpack_require__) { + +var nativeCreate = __webpack_require__(36); + +/** 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; + + +/***/ }), +/* 133 */ +/***/ (function(module, exports, __webpack_require__) { + +var nativeCreate = __webpack_require__(36); + +/** 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; + + +/***/ }), +/* 134 */ +/***/ (function(module, exports, __webpack_require__) { + +var nativeCreate = __webpack_require__(36); + +/** 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; + + +/***/ }), +/* 135 */ +/***/ (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; + + +/***/ }), +/* 136 */ +/***/ (function(module, exports, __webpack_require__) { + +var assocIndexOf = __webpack_require__(37); + +/** 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; + + +/***/ }), +/* 137 */ +/***/ (function(module, exports, __webpack_require__) { + +var assocIndexOf = __webpack_require__(37); + +/** + * 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; + + +/***/ }), +/* 138 */ +/***/ (function(module, exports, __webpack_require__) { + +var assocIndexOf = __webpack_require__(37); + +/** + * 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; + + +/***/ }), +/* 139 */ +/***/ (function(module, exports, __webpack_require__) { + +var assocIndexOf = __webpack_require__(37); + +/** + * 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; + + +/***/ }), +/* 140 */ +/***/ (function(module, exports, __webpack_require__) { + +var getMapData = __webpack_require__(38); + +/** + * 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; + + +/***/ }), +/* 141 */ +/***/ (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; + + +/***/ }), +/* 142 */ +/***/ (function(module, exports, __webpack_require__) { + +var getMapData = __webpack_require__(38); + +/** + * 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; + + +/***/ }), +/* 143 */ +/***/ (function(module, exports, __webpack_require__) { + +var getMapData = __webpack_require__(38); + +/** + * 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; + + +/***/ }), +/* 144 */ +/***/ (function(module, exports, __webpack_require__) { + +var getMapData = __webpack_require__(38); + +/** + * 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; + + +/***/ }), +/* 145 */, +/* 146 */, +/* 147 */, +/* 148 */, +/* 149 */ +/***/ (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__(150); + +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 +}; + +/***/ }), +/* 150 */ +/***/ (function(module, exports, __webpack_require__) { + +(function(){ + var crypt = __webpack_require__(151), + utf8 = __webpack_require__(71).utf8, + isBuffer = __webpack_require__(152), + bin = __webpack_require__(71).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); + }; + +})(); + + +/***/ }), +/* 151 */ +/***/ (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; +})(); + + +/***/ }), +/* 152 */ +/***/ (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)) +} + + +/***/ }), +/* 153 */, +/* 154 */, +/* 155 */, +/* 156 */, +/* 157 */, +/* 158 */, +/* 159 */, +/* 160 */, +/* 161 */, +/* 162 */, +/* 163 */, +/* 164 */, +/* 165 */, +/* 166 */, +/* 167 */, +/* 168 */, +/* 169 */, +/* 170 */, +/* 171 */, +/* 172 */, +/* 173 */, +/* 174 */, +/* 175 */, +/* 176 */, +/* 177 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5470,7 +7069,7 @@ getBindingIdentifiers.keys = { exports.__esModule = true; exports.default = isType; -var _definitions = __webpack_require__(2257); +var _definitions = __webpack_require__(35); function isType(nodeType, targetType) { if (nodeType === targetType) return true; @@ -5501,8 +7100,7 @@ function isType(nodeType, targetType) { } /***/ }), - -/***/ 2265: +/* 178 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5511,11 +7109,11 @@ function isType(nodeType, targetType) { exports.__esModule = true; exports.patternLikeCommon = exports.functionDeclarationCommon = exports.functionTypeAnnotationCommon = exports.functionCommon = void 0; -var _isValidIdentifier = _interopRequireDefault(__webpack_require__(2260)); +var _isValidIdentifier = _interopRequireDefault(__webpack_require__(83)); -var _constants = __webpack_require__(2259); +var _constants = __webpack_require__(50); -var _utils = _interopRequireWildcard(__webpack_require__(2258)); +var _utils = _interopRequireWildcard(__webpack_require__(43)); 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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } @@ -6201,8 +7799,7 @@ exports.patternLikeCommon = patternLikeCommon; }); /***/ }), - -/***/ 2266: +/* 179 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6211,9 +7808,9 @@ exports.patternLikeCommon = patternLikeCommon; exports.__esModule = true; exports.classMethodOrDeclareMethodCommon = exports.classMethodOrPropertyCommon = void 0; -var _utils = _interopRequireWildcard(__webpack_require__(2258)); +var _utils = _interopRequireWildcard(__webpack_require__(43)); -var _core = __webpack_require__(2265); +var _core = __webpack_require__(178); 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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } @@ -6587,8 +8184,210 @@ exports.classMethodOrDeclareMethodCommon = classMethodOrDeclareMethodCommon; }); /***/ }), +/* 180 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ 2267: +var ListCache = __webpack_require__(53), + stackClear = __webpack_require__(680), + stackDelete = __webpack_require__(681), + stackGet = __webpack_require__(682), + stackHas = __webpack_require__(683), + stackSet = __webpack_require__(684); + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +module.exports = Stack; + + +/***/ }), +/* 181 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseIsTypedArray = __webpack_require__(690), + baseUnary = __webpack_require__(84), + nodeUtil = __webpack_require__(115); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +module.exports = isTypedArray; + + +/***/ }), +/* 182 */ +/***/ (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; + + +/***/ }), +/* 183 */ +/***/ (function(module, exports, __webpack_require__) { + +var arrayFilter = __webpack_require__(698), + stubArray = __webpack_require__(264); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols; + +/** + * Creates an array of the own enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); +}; + +module.exports = getSymbols; + + +/***/ }), +/* 184 */ +/***/ (function(module, exports) { + +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +module.exports = arrayPush; + + +/***/ }), +/* 185 */ +/***/ (function(module, exports, __webpack_require__) { + +var overArg = __webpack_require__(262); + +/** Built-in value references. */ +var getPrototype = overArg(Object.getPrototypeOf, Object); + +module.exports = getPrototype; + + +/***/ }), +/* 186 */ +/***/ (function(module, exports, __webpack_require__) { + +var Uint8Array = __webpack_require__(269); + +/** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ +function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; +} + +module.exports = cloneArrayBuffer; + + +/***/ }), +/* 187 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6597,7 +8396,7 @@ exports.classMethodOrDeclareMethodCommon = classMethodOrDeclareMethodCommon; exports.__esModule = true; exports.default = inherit; -var _uniq = _interopRequireDefault(__webpack_require__(561)); +var _uniq = _interopRequireDefault(__webpack_require__(276)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -6608,345 +8407,808 @@ function inherit(key, child, parent) { } /***/ }), +/* 188 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ 2268: +var MapCache = __webpack_require__(65), + setCacheAdd = __webpack_require__(724), + setCacheHas = __webpack_require__(725); + +/** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } +} + +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +module.exports = SetCache; + + +/***/ }), +/* 189 */ +/***/ (function(module, exports) { + +/** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; +} + +module.exports = baseFindIndex; + + +/***/ }), +/* 190 */ +/***/ (function(module, exports) { + +/** + * Checks if a `cache` value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function cacheHas(cache, key) { + return cache.has(key); +} + +module.exports = cacheHas; + + +/***/ }), +/* 191 */ +/***/ (function(module, exports) { + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +module.exports = setToArray; + + +/***/ }), +/* 192 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -exports.__esModule = true; -var _exportNames = { - assertNode: true, - createTypeAnnotationBasedOnTypeof: true, - createUnionTypeAnnotation: true, - cloneNode: true, - clone: true, - cloneDeep: true, - cloneWithoutLoc: true, - addComment: true, - addComments: true, - inheritInnerComments: true, - inheritLeadingComments: true, - inheritsComments: true, - inheritTrailingComments: true, - removeComments: true, - ensureBlock: true, - toBindingIdentifierName: true, - toBlock: true, - toComputedKey: true, - toExpression: true, - toIdentifier: true, - toKeyAlias: true, - toSequenceExpression: true, - toStatement: true, - valueToNode: true, - appendToMemberExpression: true, - inherits: true, - prependToMemberExpression: true, - removeProperties: true, - removePropertiesDeep: true, - removeTypeDuplicates: true, - getBindingIdentifiers: true, - getOuterBindingIdentifiers: true, - traverse: true, - traverseFast: true, - shallowEqual: true, - is: true, - isBinding: true, - isBlockScoped: true, - isImmutable: true, - isLet: true, - isNode: true, - isNodesEquivalent: true, - isReferenced: true, - isScope: true, - isSpecifierDefault: true, - isType: true, - isValidES3Identifier: true, - isValidIdentifier: true, - isVar: true, - matchesPattern: true, - validate: true, - buildMatchMemberExpression: true, - react: true -}; -exports.react = exports.buildMatchMemberExpression = exports.validate = exports.matchesPattern = exports.isVar = exports.isValidIdentifier = exports.isValidES3Identifier = exports.isType = exports.isSpecifierDefault = exports.isScope = exports.isReferenced = exports.isNodesEquivalent = exports.isNode = exports.isLet = exports.isImmutable = exports.isBlockScoped = exports.isBinding = exports.is = exports.shallowEqual = exports.traverseFast = exports.traverse = exports.getOuterBindingIdentifiers = exports.getBindingIdentifiers = exports.removeTypeDuplicates = exports.removePropertiesDeep = exports.removeProperties = exports.prependToMemberExpression = exports.inherits = exports.appendToMemberExpression = exports.valueToNode = exports.toStatement = exports.toSequenceExpression = exports.toKeyAlias = exports.toIdentifier = exports.toExpression = exports.toComputedKey = exports.toBlock = exports.toBindingIdentifierName = exports.ensureBlock = exports.removeComments = exports.inheritTrailingComments = exports.inheritsComments = exports.inheritLeadingComments = exports.inheritInnerComments = exports.addComments = exports.addComment = exports.cloneWithoutLoc = exports.cloneDeep = exports.clone = exports.cloneNode = exports.createUnionTypeAnnotation = exports.createTypeAnnotationBasedOnTypeof = exports.assertNode = void 0; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isFunction = isFunction; +exports.isAwaitExpression = isAwaitExpression; +exports.isYieldExpression = isYieldExpression; +exports.isVariable = isVariable; +exports.getMemberExpression = getMemberExpression; +exports.getVariables = getVariables; -var _isReactComponent = _interopRequireDefault(__webpack_require__(2295)); +var _types = __webpack_require__(28); -var _isCompatTag = _interopRequireDefault(__webpack_require__(2301)); +var t = _interopRequireWildcard(_types); -var _buildChildren = _interopRequireDefault(__webpack_require__(2302)); +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 _assertNode = _interopRequireDefault(__webpack_require__(2305)); +function isFunction(node) { + return t.isFunction(node) || t.isArrowFunctionExpression(node) || t.isObjectMethod(node) || t.isClassMethod(node); +} /* 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 . */ -exports.assertNode = _assertNode.default; +function isAwaitExpression(path) { + const { node, parent } = path; + return t.isAwaitExpression(node) || t.isAwaitExpression(parent.init) || t.isAwaitExpression(parent); +} -var _generated = __webpack_require__(2306); +function isYieldExpression(path) { + const { node, parent } = path; + return t.isYieldExpression(node) || t.isYieldExpression(parent.init) || t.isYieldExpression(parent); +} -Object.keys(_generated).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - exports[key] = _generated[key]; +function isVariable(path) { + const node = path.node; + return t.isVariableDeclaration(node) || isFunction(path) && path.node.params != null && path.node.params.length || t.isObjectProperty(node) && !isFunction(path.node.value); +} + +function getMemberExpression(root) { + function _getMemberExpression(node, expr) { + if (t.isMemberExpression(node)) { + expr = [node.property.name].concat(expr); + return _getMemberExpression(node.object, expr); + } + + if (t.isCallExpression(node)) { + return []; + } + + if (t.isThisExpression(node)) { + return ["this"].concat(expr); + } + + return [node.name].concat(expr); + } + + const expr = _getMemberExpression(root, []); + return expr.join("."); +} + +function getVariables(dec) { + if (!dec.id) { + return []; + } + + if (t.isArrayPattern(dec.id)) { + if (!dec.id.elements) { + return []; + } + + // NOTE: it's possible that an element is empty + // e.g. const [, a] = arr + return dec.id.elements.filter(element => element).map(element => { + return { + name: t.isAssignmentPattern(element) ? element.left.name : element.name || element.argument.name, + location: element.loc + }; + }); + } + + return [{ + name: dec.id.name, + location: dec.loc + }]; +} + +/***/ }), +/* 193 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true }); -var _createTypeAnnotationBasedOnTypeof = _interopRequireDefault(__webpack_require__(2307)); +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 . */ -exports.createTypeAnnotationBasedOnTypeof = _createTypeAnnotationBasedOnTypeof.default; +exports.clearSymbols = clearSymbols; +exports.default = getSymbols; -var _createUnionTypeAnnotation = _interopRequireDefault(__webpack_require__(2308)); +var _flatten = __webpack_require__(762); -exports.createUnionTypeAnnotation = _createUnionTypeAnnotation.default; +var _flatten2 = _interopRequireDefault(_flatten); -var _generated2 = __webpack_require__(2256); +var _types = __webpack_require__(28); -Object.keys(_generated2).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - exports[key] = _generated2[key]; -}); +var t = _interopRequireWildcard(_types); -var _cloneNode = _interopRequireDefault(__webpack_require__(2261)); +var _simplePath = __webpack_require__(288); -exports.cloneNode = _cloneNode.default; +var _simplePath2 = _interopRequireDefault(_simplePath); -var _clone = _interopRequireDefault(__webpack_require__(2275)); +var _ast = __webpack_require__(51); -exports.clone = _clone.default; +var _helpers = __webpack_require__(192); -var _cloneDeep = _interopRequireDefault(__webpack_require__(2309)); +var _inferClassName = __webpack_require__(764); -exports.cloneDeep = _cloneDeep.default; +var _getFunctionName = __webpack_require__(294); -var _cloneWithoutLoc = _interopRequireDefault(__webpack_require__(2310)); +var _getFunctionName2 = _interopRequireDefault(_getFunctionName); -exports.cloneWithoutLoc = _cloneWithoutLoc.default; - -var _addComment = _interopRequireDefault(__webpack_require__(2311)); - -exports.addComment = _addComment.default; - -var _addComments = _interopRequireDefault(__webpack_require__(2276)); - -exports.addComments = _addComments.default; - -var _inheritInnerComments = _interopRequireDefault(__webpack_require__(2277)); - -exports.inheritInnerComments = _inheritInnerComments.default; - -var _inheritLeadingComments = _interopRequireDefault(__webpack_require__(2278)); - -exports.inheritLeadingComments = _inheritLeadingComments.default; - -var _inheritsComments = _interopRequireDefault(__webpack_require__(2279)); - -exports.inheritsComments = _inheritsComments.default; - -var _inheritTrailingComments = _interopRequireDefault(__webpack_require__(2280)); - -exports.inheritTrailingComments = _inheritTrailingComments.default; - -var _removeComments = _interopRequireDefault(__webpack_require__(2312)); - -exports.removeComments = _removeComments.default; - -var _generated3 = __webpack_require__(2313); - -Object.keys(_generated3).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - exports[key] = _generated3[key]; -}); - -var _constants = __webpack_require__(2259); - -Object.keys(_constants).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - exports[key] = _constants[key]; -}); - -var _ensureBlock = _interopRequireDefault(__webpack_require__(2314)); - -exports.ensureBlock = _ensureBlock.default; - -var _toBindingIdentifierName = _interopRequireDefault(__webpack_require__(2315)); - -exports.toBindingIdentifierName = _toBindingIdentifierName.default; - -var _toBlock = _interopRequireDefault(__webpack_require__(2281)); - -exports.toBlock = _toBlock.default; - -var _toComputedKey = _interopRequireDefault(__webpack_require__(2316)); - -exports.toComputedKey = _toComputedKey.default; - -var _toExpression = _interopRequireDefault(__webpack_require__(2317)); - -exports.toExpression = _toExpression.default; - -var _toIdentifier = _interopRequireDefault(__webpack_require__(2282)); - -exports.toIdentifier = _toIdentifier.default; - -var _toKeyAlias = _interopRequireDefault(__webpack_require__(2318)); - -exports.toKeyAlias = _toKeyAlias.default; - -var _toSequenceExpression = _interopRequireDefault(__webpack_require__(2319)); - -exports.toSequenceExpression = _toSequenceExpression.default; - -var _toStatement = _interopRequireDefault(__webpack_require__(2321)); - -exports.toStatement = _toStatement.default; - -var _valueToNode = _interopRequireDefault(__webpack_require__(2322)); - -exports.valueToNode = _valueToNode.default; - -var _definitions = __webpack_require__(2257); - -Object.keys(_definitions).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - exports[key] = _definitions[key]; -}); - -var _appendToMemberExpression = _interopRequireDefault(__webpack_require__(2323)); - -exports.appendToMemberExpression = _appendToMemberExpression.default; - -var _inherits = _interopRequireDefault(__webpack_require__(2324)); - -exports.inherits = _inherits.default; - -var _prependToMemberExpression = _interopRequireDefault(__webpack_require__(2325)); - -exports.prependToMemberExpression = _prependToMemberExpression.default; - -var _removeProperties = _interopRequireDefault(__webpack_require__(2285)); - -exports.removeProperties = _removeProperties.default; - -var _removePropertiesDeep = _interopRequireDefault(__webpack_require__(2283)); - -exports.removePropertiesDeep = _removePropertiesDeep.default; - -var _removeTypeDuplicates = _interopRequireDefault(__webpack_require__(2274)); - -exports.removeTypeDuplicates = _removeTypeDuplicates.default; - -var _getBindingIdentifiers = _interopRequireDefault(__webpack_require__(2263)); - -exports.getBindingIdentifiers = _getBindingIdentifiers.default; - -var _getOuterBindingIdentifiers = _interopRequireDefault(__webpack_require__(2326)); - -exports.getOuterBindingIdentifiers = _getOuterBindingIdentifiers.default; - -var _traverse = _interopRequireDefault(__webpack_require__(2327)); - -exports.traverse = _traverse.default; - -var _traverseFast = _interopRequireDefault(__webpack_require__(2284)); - -exports.traverseFast = _traverseFast.default; - -var _shallowEqual = _interopRequireDefault(__webpack_require__(2271)); - -exports.shallowEqual = _shallowEqual.default; - -var _is = _interopRequireDefault(__webpack_require__(2262)); - -exports.is = _is.default; - -var _isBinding = _interopRequireDefault(__webpack_require__(2328)); - -exports.isBinding = _isBinding.default; - -var _isBlockScoped = _interopRequireDefault(__webpack_require__(2329)); - -exports.isBlockScoped = _isBlockScoped.default; - -var _isImmutable = _interopRequireDefault(__webpack_require__(2330)); - -exports.isImmutable = _isImmutable.default; - -var _isLet = _interopRequireDefault(__webpack_require__(2286)); - -exports.isLet = _isLet.default; - -var _isNode = _interopRequireDefault(__webpack_require__(2273)); - -exports.isNode = _isNode.default; - -var _isNodesEquivalent = _interopRequireDefault(__webpack_require__(2331)); - -exports.isNodesEquivalent = _isNodesEquivalent.default; - -var _isReferenced = _interopRequireDefault(__webpack_require__(2332)); - -exports.isReferenced = _isReferenced.default; - -var _isScope = _interopRequireDefault(__webpack_require__(2333)); - -exports.isScope = _isScope.default; - -var _isSpecifierDefault = _interopRequireDefault(__webpack_require__(2334)); - -exports.isSpecifierDefault = _isSpecifierDefault.default; - -var _isType = _interopRequireDefault(__webpack_require__(2264)); - -exports.isType = _isType.default; - -var _isValidES3Identifier = _interopRequireDefault(__webpack_require__(2335)); - -exports.isValidES3Identifier = _isValidES3Identifier.default; - -var _isValidIdentifier = _interopRequireDefault(__webpack_require__(2260)); - -exports.isValidIdentifier = _isValidIdentifier.default; - -var _isVar = _interopRequireDefault(__webpack_require__(2336)); - -exports.isVar = _isVar.default; - -var _matchesPattern = _interopRequireDefault(__webpack_require__(2270)); - -exports.matchesPattern = _matchesPattern.default; - -var _validate = _interopRequireDefault(__webpack_require__(2272)); - -exports.validate = _validate.default; - -var _buildMatchMemberExpression = _interopRequireDefault(__webpack_require__(2269)); - -exports.buildMatchMemberExpression = _buildMatchMemberExpression.default; - -var _generated4 = __webpack_require__(2255); - -Object.keys(_generated4).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - exports[key] = _generated4[key]; -}); +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 react = { - isReactComponent: _isReactComponent.default, - isCompatTag: _isCompatTag.default, - buildChildren: _buildChildren.default -}; -exports.react = react; +let symbolDeclarations = new Map(); + +function getFunctionParameterNames(path) { + if (path.node.params != null) { + return path.node.params.map(param => { + if (param.type !== "AssignmentPattern") { + return param.name; + } + + // Parameter with default value + if (param.left.type === "Identifier" && param.right.type === "Identifier") { + return `${param.left.name} = ${param.right.name}`; + } else if (param.left.type === "Identifier" && param.right.type === "StringLiteral") { + return `${param.left.name} = ${param.right.value}`; + } else if (param.left.type === "Identifier" && param.right.type === "ObjectExpression") { + return `${param.left.name} = {}`; + } else if (param.left.type === "Identifier" && param.right.type === "ArrayExpression") { + return `${param.left.name} = []`; + } else if (param.left.type === "Identifier" && param.right.type === "NullLiteral") { + return `${param.left.name} = null`; + } + }); + } + return []; +} + +function getVariableNames(path) { + if (t.isObjectProperty(path.node) && !(0, _helpers.isFunction)(path.node.value)) { + if (path.node.key.type === "StringLiteral") { + return [{ + name: path.node.key.value, + location: path.node.loc + }]; + } else if (path.node.value.type === "Identifier") { + return [{ name: path.node.value.name, location: path.node.loc }]; + } else if (path.node.value.type === "AssignmentPattern") { + return [{ name: path.node.value.left.name, location: path.node.loc }]; + } + + return [{ + name: path.node.key.name, + location: path.node.loc + }]; + } + + if (!path.node.declarations) { + return path.node.params.map(dec => ({ + name: dec.name, + location: dec.loc + })); + } + + const declarations = path.node.declarations.filter(dec => dec.id.type !== "ObjectPattern").map(_helpers.getVariables); + + return (0, _flatten2.default)(declarations); +} + +function getComments(ast) { + if (!ast || !ast.comments) { + return []; + } + return ast.comments.map(comment => ({ + name: comment.location, + location: comment.loc + })); +} + +function getSpecifiers(specifiers) { + if (!specifiers) { + return null; + } + + return specifiers.map(specifier => specifier.local && specifier.local.name); +} + +function extractSymbol(path, symbols) { + if ((0, _helpers.isVariable)(path)) { + symbols.variables.push(...getVariableNames(path)); + } + + if ((0, _helpers.isFunction)(path)) { + symbols.functions.push({ + name: (0, _getFunctionName2.default)(path.node, path.parent), + klass: (0, _inferClassName.inferClassName)(path), + location: path.node.loc, + parameterNames: getFunctionParameterNames(path), + identifier: path.node.id + }); + } + + if (t.isJSXElement(path)) { + symbols.hasJsx = true; + } + + if (t.isClassDeclaration(path)) { + symbols.classes.push({ + name: path.node.id.name, + parent: path.node.superClass, + location: path.node.loc + }); + } + + if (t.isImportDeclaration(path)) { + symbols.imports.push({ + source: path.node.source.value, + location: path.node.loc, + specifiers: getSpecifiers(path.node.specifiers) + }); + } + + if (t.isObjectProperty(path)) { + const { start, end, identifierName } = path.node.key.loc; + symbols.objectProperties.push({ + name: identifierName, + location: { start, end }, + expression: getSnippet(path) + }); + } + + if (t.isMemberExpression(path)) { + const { start, end } = path.node.property.loc; + symbols.memberExpressions.push({ + name: path.node.property.name, + location: { start, end }, + expressionLocation: path.node.loc, + expression: getSnippet(path), + computed: path.node.computed + }); + } + + if (t.isCallExpression(path)) { + const callee = path.node.callee; + const args = path.node.arguments; + if (!t.isMemberExpression(callee)) { + const { start, end, identifierName } = callee.loc; + symbols.callExpressions.push({ + name: identifierName, + values: args.filter(arg => arg.value).map(arg => arg.value), + location: { start, end } + }); + } + } + + if (t.isIdentifier(path) && !t.isGenericTypeAnnotation(path.parent)) { + let { start, end } = path.node.loc; + + // We want to include function params, but exclude the function name + if (t.isClassMethod(path.parent) && !path.inList) { + return; + } + + if (t.isProperty(path.parent)) { + return; + } + + if (path.node.typeAnnotation) { + const column = path.node.typeAnnotation.loc.start.column; + end = _extends({}, end, { column }); + } + + symbols.identifiers.push({ + name: path.node.name, + expression: path.node.name, + location: { start, end } + }); + } + + if (t.isThisExpression(path.node)) { + const { start, end } = path.node.loc; + symbols.identifiers.push({ + name: "this", + location: { start, end }, + expressionLocation: path.node.loc, + expression: "this" + }); + } + + if (t.isVariableDeclarator(path)) { + const node = path.node.id; + const { start, end } = path.node.loc; + if (t.isArrayPattern(node)) { + return; + } + symbols.identifiers.push({ + name: node.name, + expression: node.name, + location: { start, end } + }); + } +} + +function extractSymbols(sourceId) { + const symbols = { + functions: [], + variables: [], + callExpressions: [], + memberExpressions: [], + objectProperties: [], + comments: [], + identifiers: [], + classes: [], + imports: [], + hasJsx: false + }; + + const ast = (0, _ast.traverseAst)(sourceId, { + enter(node, ancestors) { + try { + const path = (0, _simplePath2.default)(ancestors); + if (path) { + extractSymbol(path, symbols); + } + } catch (e) { + console.error(e); + } + } + }); + + // comments are extracted separately from the AST + symbols.comments = getComments(ast); + + return symbols; +} + +function extendSnippet(name, expression, path = null, prevPath = null) { + const computed = path && path.node.computed; + const prevComputed = prevPath && prevPath.node.computed; + const prevArray = t.isArrayExpression(prevPath); + const array = t.isArrayExpression(path); + + if (expression === "") { + if (computed) { + return `[${name}]`; + } + return name; + } + + if (computed || array) { + if (prevComputed || prevArray) { + return `[${name}]${expression}`; + } + return `[${name}].${expression}`; + } + + if (prevComputed || prevArray) { + return `${name}${expression}`; + } + + return `${name}.${expression}`; +} + +function getMemberSnippet(node, expression = "") { + if (t.isMemberExpression(node)) { + const name = node.property.name; + + return getMemberSnippet(node.object, extendSnippet(name, expression)); + } + + if (t.isCallExpression(node)) { + return ""; + } + + if (t.isThisExpression(node)) { + return `this.${expression}`; + } + + if (t.isIdentifier(node)) { + return `${node.name}.${expression}`; + } + + return expression; +} + +function getObjectSnippet(path, prevPath, expression = "") { + if (!path) { + return expression; + } + + const name = path.node.key.name; + + const extendedExpression = extendSnippet(name, expression, path, prevPath); + + const nextPrevPath = path; + const nextPath = path.parentPath && path.parentPath.parentPath; + + return getSnippet(nextPath, nextPrevPath, extendedExpression); +} + +function getArraySnippet(path, prevPath, expression) { + if (!prevPath.parentPath) { + throw new Error("Assertion failure - path should exist"); + } + + const index = `${prevPath.parentPath.containerIndex}`; + const extendedExpression = extendSnippet(index, expression, path, prevPath); + + const nextPrevPath = path; + const nextPath = path.parentPath && path.parentPath.parentPath; + + return getSnippet(nextPath, nextPrevPath, extendedExpression); +} + +function getSnippet(path, prevPath = null, expression = "") { + if (!path) { + return expression; + } + + if (t.isVariableDeclaration(path)) { + const node = path.node.declarations[0]; + const name = node.id.name; + return extendSnippet(name, expression, path, prevPath); + } + + if (t.isVariableDeclarator(path)) { + const node = path.node.id; + if (t.isObjectPattern(node)) { + return expression; + } + + const name = node.name; + const prop = extendSnippet(name, expression, path, prevPath); + return prop; + } + + if (t.isAssignmentExpression(path)) { + const node = path.node.left; + const name = t.isMemberExpression(node) ? getMemberSnippet(node) : node.name; + + const prop = extendSnippet(name, expression, path, prevPath); + return prop; + } + + if ((0, _helpers.isFunction)(path)) { + return expression; + } + + if (t.isIdentifier(path)) { + const node = path.node; + return `${node.name}.${expression}`; + } + + if (t.isObjectProperty(path)) { + return getObjectSnippet(path, prevPath, expression); + } + + if (t.isObjectExpression(path)) { + const parentPath = prevPath && prevPath.parentPath; + return getObjectSnippet(parentPath, prevPath, expression); + } + + if (t.isMemberExpression(path)) { + return getMemberSnippet(path.node, expression); + } + + if (t.isArrayExpression(path)) { + if (!prevPath) { + throw new Error("Assertion failure - path should exist"); + } + + return getArraySnippet(path, prevPath, expression); + } +} + +function clearSymbols() { + symbolDeclarations = new Map(); +} + +function getSymbols(sourceId) { + if (symbolDeclarations.has(sourceId)) { + const symbols = symbolDeclarations.get(sourceId); + if (symbols) { + return symbols; + } + } + + const symbols = extractSymbols(sourceId); + + symbolDeclarations.set(sourceId, symbols); + return symbols; +} /***/ }), +/* 194 */ +/***/ (function(module, exports) { -/***/ 2269: +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ +function identity(value) { + return value; +} + +module.exports = identity; + + +/***/ }), +/* 195 */, +/* 196 */, +/* 197 */, +/* 198 */, +/* 199 */, +/* 200 */, +/* 201 */, +/* 202 */, +/* 203 */, +/* 204 */, +/* 205 */, +/* 206 */, +/* 207 */, +/* 208 */, +/* 209 */, +/* 210 */, +/* 211 */, +/* 212 */, +/* 213 */, +/* 214 */, +/* 215 */, +/* 216 */, +/* 217 */, +/* 218 */, +/* 219 */, +/* 220 */, +/* 221 */, +/* 222 */, +/* 223 */, +/* 224 */, +/* 225 */, +/* 226 */, +/* 227 */, +/* 228 */, +/* 229 */, +/* 230 */, +/* 231 */, +/* 232 */, +/* 233 */, +/* 234 */, +/* 235 */, +/* 236 */, +/* 237 */, +/* 238 */, +/* 239 */, +/* 240 */, +/* 241 */, +/* 242 */, +/* 243 */, +/* 244 */, +/* 245 */, +/* 246 */, +/* 247 */, +/* 248 */, +/* 249 */, +/* 250 */, +/* 251 */, +/* 252 */, +/* 253 */, +/* 254 */, +/* 255 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getClosestExpression = getClosestExpression; +exports.getClosestPath = getClosestPath; + +var _types = __webpack_require__(28); + +var t = _interopRequireWildcard(_types); + +var _simplePath = __webpack_require__(288); + +var _simplePath2 = _interopRequireDefault(_simplePath); + +var _ast = __webpack_require__(51); + +var _helpers = __webpack_require__(192); + +var _contains = __webpack_require__(292); + +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 getNodeValue(node) { + if (t.isThisExpression(node)) { + return "this"; + } + + return node.name; +} /* 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 . */ + +function getClosestMemberExpression(sourceId, token, location) { + const closest = getClosestPath(sourceId, location).find(path => t.isMemberExpression(path.node) && path.node.property.name === token); + + if (closest) { + const memberExpression = (0, _helpers.getMemberExpression)(closest.node); + return { + expression: memberExpression, + location: closest.node.loc + }; + } + return null; +} + +function getClosestExpression(sourceId, token, location) { + const memberExpression = getClosestMemberExpression(sourceId, token, location); + if (memberExpression) { + return memberExpression; + } + + const path = getClosestPath(sourceId, location); + if (!path || !path.node) { + return; + } + + const { node } = path; + return { expression: getNodeValue(node), location: node.loc }; +} + +function getClosestPath(sourceId, location) { + let closestPath = null; + + (0, _ast.traverseAst)(sourceId, { + enter(node, ancestors) { + if ((0, _contains.nodeContainsPosition)(node, location)) { + const path = (0, _simplePath2.default)(ancestors); + + if (path && (!closestPath || path.depth > closestPath.depth)) { + closestPath = path; + } + } + } + }); + + if (!closestPath) { + throw new Error("Assertion failure - This should always fine a path"); + } + + return closestPath; +} + +/***/ }), +/* 256 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6955,7 +9217,7 @@ exports.react = react; exports.__esModule = true; exports.default = buildMatchMemberExpression; -var _matchesPattern = _interopRequireDefault(__webpack_require__(2270)); +var _matchesPattern = _interopRequireDefault(__webpack_require__(257)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -6967,8 +9229,7 @@ function buildMatchMemberExpression(match, allowPartial) { } /***/ }), - -/***/ 2270: +/* 257 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6977,7 +9238,7 @@ function buildMatchMemberExpression(match, allowPartial) { exports.__esModule = true; exports.default = matchesPattern; -var _generated = __webpack_require__(2255); +var _generated = __webpack_require__(17); function matchesPattern(member, match, allowPartial) { if (!(0, _generated.isMemberExpression)(member)) return false; @@ -7012,8 +9273,7 @@ function matchesPattern(member, match, allowPartial) { } /***/ }), - -/***/ 2271: +/* 258 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7038,8 +9298,431 @@ function shallowEqual(actual, expected) { } /***/ }), +/* 259 */ +/***/ (function(module, exports) { -/***/ 2272: +/* + Copyright (C) 2013-2014 Yusuke Suzuki + Copyright (C) 2014 Ivan Nikulin + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +(function () { + 'use strict'; + + var ES6Regex, ES5Regex, NON_ASCII_WHITESPACES, IDENTIFIER_START, IDENTIFIER_PART, ch; + + // See `tools/generate-identifier-regex.js`. + ES5Regex = { + // ECMAScript 5.1/Unicode v7.0.0 NonAsciiIdentifierStart: + NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/, + // ECMAScript 5.1/Unicode v7.0.0 NonAsciiIdentifierPart: + NonAsciiIdentifierPart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/ + }; + + ES6Regex = { + // ECMAScript 6/Unicode v7.0.0 NonAsciiIdentifierStart: + NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDE00-\uDE11\uDE13-\uDE2B\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDE00-\uDE2F\uDE44\uDE80-\uDEAA]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]/, + // ECMAScript 6/Unicode v7.0.0 NonAsciiIdentifierPart: + NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDD0-\uDDDA\uDE00-\uDE11\uDE13-\uDE37\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF01-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ + }; + + function isDecimalDigit(ch) { + return 0x30 <= ch && ch <= 0x39; // 0..9 + } + + function isHexDigit(ch) { + return 0x30 <= ch && ch <= 0x39 || // 0..9 + 0x61 <= ch && ch <= 0x66 || // a..f + 0x41 <= ch && ch <= 0x46; // A..F + } + + function isOctalDigit(ch) { + return ch >= 0x30 && ch <= 0x37; // 0..7 + } + + // 7.2 White Space + + NON_ASCII_WHITESPACES = [ + 0x1680, 0x180E, + 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, + 0x202F, 0x205F, + 0x3000, + 0xFEFF + ]; + + function isWhiteSpace(ch) { + return ch === 0x20 || ch === 0x09 || ch === 0x0B || ch === 0x0C || ch === 0xA0 || + ch >= 0x1680 && NON_ASCII_WHITESPACES.indexOf(ch) >= 0; + } + + // 7.3 Line Terminators + + function isLineTerminator(ch) { + return ch === 0x0A || ch === 0x0D || ch === 0x2028 || ch === 0x2029; + } + + // 7.6 Identifier Names and Identifiers + + function fromCodePoint(cp) { + if (cp <= 0xFFFF) { return String.fromCharCode(cp); } + var cu1 = String.fromCharCode(Math.floor((cp - 0x10000) / 0x400) + 0xD800); + var cu2 = String.fromCharCode(((cp - 0x10000) % 0x400) + 0xDC00); + return cu1 + cu2; + } + + IDENTIFIER_START = new Array(0x80); + for(ch = 0; ch < 0x80; ++ch) { + IDENTIFIER_START[ch] = + ch >= 0x61 && ch <= 0x7A || // a..z + ch >= 0x41 && ch <= 0x5A || // A..Z + ch === 0x24 || ch === 0x5F; // $ (dollar) and _ (underscore) + } + + IDENTIFIER_PART = new Array(0x80); + for(ch = 0; ch < 0x80; ++ch) { + IDENTIFIER_PART[ch] = + ch >= 0x61 && ch <= 0x7A || // a..z + ch >= 0x41 && ch <= 0x5A || // A..Z + ch >= 0x30 && ch <= 0x39 || // 0..9 + ch === 0x24 || ch === 0x5F; // $ (dollar) and _ (underscore) + } + + function isIdentifierStartES5(ch) { + return ch < 0x80 ? IDENTIFIER_START[ch] : ES5Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch)); + } + + function isIdentifierPartES5(ch) { + return ch < 0x80 ? IDENTIFIER_PART[ch] : ES5Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch)); + } + + function isIdentifierStartES6(ch) { + return ch < 0x80 ? IDENTIFIER_START[ch] : ES6Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch)); + } + + function isIdentifierPartES6(ch) { + return ch < 0x80 ? IDENTIFIER_PART[ch] : ES6Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch)); + } + + module.exports = { + isDecimalDigit: isDecimalDigit, + isHexDigit: isHexDigit, + isOctalDigit: isOctalDigit, + isWhiteSpace: isWhiteSpace, + isLineTerminator: isLineTerminator, + isIdentifierStartES5: isIdentifierStartES5, + isIdentifierPartES5: isIdentifierPartES5, + isIdentifierStartES6: isIdentifierStartES6, + isIdentifierPartES6: isIdentifierPartES6 + }; +}()); +/* vim: set sw=4 ts=4 et tw=80 : */ + + +/***/ }), +/* 260 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseTimes = __webpack_require__(687), + isArguments = __webpack_require__(113), + isArray = __webpack_require__(16), + isBuffer = __webpack_require__(114), + isIndex = __webpack_require__(95), + isTypedArray = __webpack_require__(181); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; +} + +module.exports = arrayLikeKeys; + + +/***/ }), +/* 261 */ +/***/ (function(module, exports, __webpack_require__) { + +var isPrototype = __webpack_require__(116), + nativeKeys = __webpack_require__(691); + +/** 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 `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} + +module.exports = baseKeys; + + +/***/ }), +/* 262 */ +/***/ (function(module, exports) { + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +module.exports = overArg; + + +/***/ }), +/* 263 */ +/***/ (function(module, exports, __webpack_require__) { + +var arrayLikeKeys = __webpack_require__(260), + baseKeysIn = __webpack_require__(693), + isArrayLike = __webpack_require__(117); + +/** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ +function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); +} + +module.exports = keysIn; + + +/***/ }), +/* 264 */ +/***/ (function(module, exports) { + +/** + * This method returns a new empty array. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {Array} Returns the new empty array. + * @example + * + * var arrays = _.times(2, _.stubArray); + * + * console.log(arrays); + * // => [[], []] + * + * console.log(arrays[0] === arrays[1]); + * // => false + */ +function stubArray() { + return []; +} + +module.exports = stubArray; + + +/***/ }), +/* 265 */ +/***/ (function(module, exports, __webpack_require__) { + +var arrayPush = __webpack_require__(184), + getPrototype = __webpack_require__(185), + getSymbols = __webpack_require__(183), + stubArray = __webpack_require__(264); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols; + +/** + * Creates an array of the own and inherited enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { + var result = []; + while (object) { + arrayPush(result, getSymbols(object)); + object = getPrototype(object); + } + return result; +}; + +module.exports = getSymbolsIn; + + +/***/ }), +/* 266 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseGetAllKeys = __webpack_require__(267), + getSymbols = __webpack_require__(183), + keys = __webpack_require__(112); + +/** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); +} + +module.exports = getAllKeys; + + +/***/ }), +/* 267 */ +/***/ (function(module, exports, __webpack_require__) { + +var arrayPush = __webpack_require__(184), + isArray = __webpack_require__(16); + +/** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ +function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); +} + +module.exports = baseGetAllKeys; + + +/***/ }), +/* 268 */ +/***/ (function(module, exports, __webpack_require__) { + +var getNative = __webpack_require__(25), + root = __webpack_require__(18); + +/* Built-in method references that are verified to be native. */ +var Set = getNative(root, 'Set'); + +module.exports = Set; + + +/***/ }), +/* 269 */ +/***/ (function(module, exports, __webpack_require__) { + +var root = __webpack_require__(18); + +/** Built-in value references. */ +var Uint8Array = root.Uint8Array; + +module.exports = Uint8Array; + + +/***/ }), +/* 270 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7048,7 +9731,7 @@ function shallowEqual(actual, expected) { exports.__esModule = true; exports.default = validate; -var _definitions = __webpack_require__(2257); +var _definitions = __webpack_require__(35); function validate(node, key, val) { if (!node) return; @@ -7061,8 +9744,7 @@ function validate(node, key, val) { } /***/ }), - -/***/ 2273: +/* 271 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7071,15 +9753,14 @@ function validate(node, key, val) { exports.__esModule = true; exports.default = isNode; -var _definitions = __webpack_require__(2257); +var _definitions = __webpack_require__(35); function isNode(node) { return !!(node && _definitions.VISITOR_KEYS[node.type]); } /***/ }), - -/***/ 2274: +/* 272 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7088,7 +9769,7 @@ function isNode(node) { exports.__esModule = true; exports.default = removeTypeDuplicates; -var _generated = __webpack_require__(2255); +var _generated = __webpack_require__(17); function removeTypeDuplicates(nodes) { var generics = {}; @@ -7157,8 +9838,7 @@ function removeTypeDuplicates(nodes) { } /***/ }), - -/***/ 2275: +/* 273 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7167,7 +9847,7 @@ function removeTypeDuplicates(nodes) { exports.__esModule = true; exports.default = clone; -var _cloneNode = _interopRequireDefault(__webpack_require__(2261)); +var _cloneNode = _interopRequireDefault(__webpack_require__(86)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -7176,8 +9856,7 @@ function clone(node) { } /***/ }), - -/***/ 2276: +/* 274 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7204,8 +9883,7 @@ function addComments(node, type, comments) { } /***/ }), - -/***/ 2277: +/* 275 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7214,7 +9892,7 @@ function addComments(node, type, comments) { exports.__esModule = true; exports.default = inheritInnerComments; -var _inherit = _interopRequireDefault(__webpack_require__(2267)); +var _inherit = _interopRequireDefault(__webpack_require__(187)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -7223,8 +9901,89 @@ function inheritInnerComments(child, parent) { } /***/ }), +/* 276 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ 2278: +var baseUniq = __webpack_require__(723); + +/** + * Creates a duplicate-free version of an array, using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons, in which only the first occurrence of each element + * is kept. The order of result values is determined by the order they occur + * in the array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniq([2, 1, 2]); + * // => [2, 1] + */ +function uniq(array) { + return (array && array.length) ? baseUniq(array) : []; +} + +module.exports = uniq; + + +/***/ }), +/* 277 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseIndexOf = __webpack_require__(726); + +/** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludes(array, value) { + var length = array == null ? 0 : array.length; + return !!length && baseIndexOf(array, value, 0) > -1; +} + +module.exports = arrayIncludes; + + +/***/ }), +/* 278 */ +/***/ (function(module, exports) { + +/** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; +} + +module.exports = arrayIncludesWith; + + +/***/ }), +/* 279 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7233,7 +9992,7 @@ function inheritInnerComments(child, parent) { exports.__esModule = true; exports.default = inheritLeadingComments; -var _inherit = _interopRequireDefault(__webpack_require__(2267)); +var _inherit = _interopRequireDefault(__webpack_require__(187)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -7242,8 +10001,7 @@ function inheritLeadingComments(child, parent) { } /***/ }), - -/***/ 2279: +/* 280 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7252,11 +10010,11 @@ function inheritLeadingComments(child, parent) { exports.__esModule = true; exports.default = inheritsComments; -var _inheritTrailingComments = _interopRequireDefault(__webpack_require__(2280)); +var _inheritTrailingComments = _interopRequireDefault(__webpack_require__(281)); -var _inheritLeadingComments = _interopRequireDefault(__webpack_require__(2278)); +var _inheritLeadingComments = _interopRequireDefault(__webpack_require__(279)); -var _inheritInnerComments = _interopRequireDefault(__webpack_require__(2277)); +var _inheritInnerComments = _interopRequireDefault(__webpack_require__(275)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -7268,8 +10026,7 @@ function inheritsComments(child, parent) { } /***/ }), - -/***/ 2280: +/* 281 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7278,7 +10035,7 @@ function inheritsComments(child, parent) { exports.__esModule = true; exports.default = inheritTrailingComments; -var _inherit = _interopRequireDefault(__webpack_require__(2267)); +var _inherit = _interopRequireDefault(__webpack_require__(187)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -7287,8 +10044,7 @@ function inheritTrailingComments(child, parent) { } /***/ }), - -/***/ 2281: +/* 282 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7297,9 +10053,9 @@ function inheritTrailingComments(child, parent) { exports.__esModule = true; exports.default = toBlock; -var _generated = __webpack_require__(2255); +var _generated = __webpack_require__(17); -var _generated2 = __webpack_require__(2256); +var _generated2 = __webpack_require__(29); function toBlock(node, parent) { if ((0, _generated.isBlockStatement)(node)) { @@ -7326,8 +10082,7 @@ function toBlock(node, parent) { } /***/ }), - -/***/ 2282: +/* 283 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7336,7 +10091,7 @@ function toBlock(node, parent) { exports.__esModule = true; exports.default = toIdentifier; -var _isValidIdentifier = _interopRequireDefault(__webpack_require__(2260)); +var _isValidIdentifier = _interopRequireDefault(__webpack_require__(83)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -7356,8 +10111,7 @@ function toIdentifier(name) { } /***/ }), - -/***/ 2283: +/* 284 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7366,9 +10120,9 @@ function toIdentifier(name) { exports.__esModule = true; exports.default = removePropertiesDeep; -var _traverseFast = _interopRequireDefault(__webpack_require__(2284)); +var _traverseFast = _interopRequireDefault(__webpack_require__(285)); -var _removeProperties = _interopRequireDefault(__webpack_require__(2285)); +var _removeProperties = _interopRequireDefault(__webpack_require__(286)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -7378,8 +10132,7 @@ function removePropertiesDeep(tree, opts) { } /***/ }), - -/***/ 2284: +/* 285 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7388,7 +10141,7 @@ function removePropertiesDeep(tree, opts) { exports.__esModule = true; exports.default = traverseFast; -var _definitions = __webpack_require__(2257); +var _definitions = __webpack_require__(35); function traverseFast(node, enter, opts) { if (!node) return; @@ -7435,8 +10188,7 @@ function traverseFast(node, enter, opts) { } /***/ }), - -/***/ 2285: +/* 286 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7445,7 +10197,7 @@ function traverseFast(node, enter, opts) { exports.__esModule = true; exports.default = removeProperties; -var _constants = __webpack_require__(2259); +var _constants = __webpack_require__(50); var CLEAR_KEYS = ["tokens", "start", "end", "loc", "raw", "rawValue"]; @@ -7498,8 +10250,7 @@ function removeProperties(node, opts) { } /***/ }), - -/***/ 2286: +/* 287 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7508,135 +10259,11931 @@ function removeProperties(node, opts) { exports.__esModule = true; exports.default = isLet; -var _generated = __webpack_require__(2255); +var _generated = __webpack_require__(17); -var _constants = __webpack_require__(2259); +var _constants = __webpack_require__(50); function isLet(node) { return (0, _generated.isVariableDeclaration)(node) && (node.kind !== "var" || node[_constants.BLOCK_SCOPED_SYMBOL]); } /***/ }), - -/***/ 2291: +/* 288 */ /***/ (function(module, exports, __webpack_require__) { -var baseIsMap = __webpack_require__(2292), - baseUnary = __webpack_require__(215), - nodeUtil = __webpack_require__(216); +"use strict"; -/* Node.js helper references. */ -var nodeIsMap = nodeUtil && nodeUtil.isMap; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = createSimplePath; +function createSimplePath(ancestors) { + if (ancestors.length === 0) { + return null; + } + + // Slice the array because babel-types traverse may continue mutating + // the ancestors array in later traversal logic. + return new SimplePath(ancestors.slice()); +} /* 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 . */ /** - * Checks if `value` is classified as a `Map` object. + * Mimics @babel/traverse's NodePath API in a simpler fashion that isn't as + * heavy, but still allows the ease of passing paths around to process nested + * AST structures. + */ +class SimplePath { + + constructor(ancestors, index = ancestors.length - 1) { + if (index < 0 || index >= ancestors.length) { + console.error(ancestors); + throw new Error("Created invalid path"); + } + + this._ancestors = ancestors; + this._ancestor = ancestors[index]; + this._index = index; + } + + get parentPath() { + let path = this._parentPath; + if (path === undefined) { + if (this._index === 0) { + path = null; + } else { + path = new SimplePath(this._ancestors, this._index - 1); + } + this._parentPath = path; + } + + return path; + } + + get parent() { + return this._ancestor.node; + } + + get node() { + const { node, key, index } = this._ancestor; + + if (typeof index === "number") { + return node[key][index]; + } + + return node[key]; + } + + set node(replacement) { + if (this.type !== "Identifier") { + throw new Error("Replacing anything other than leaf nodes is undefined behavior " + "in t.traverse()"); + } + + const { node, key, index } = this._ancestor; + if (typeof index === "number") { + node[key][index] = replacement; + } else { + node[key] = replacement; + } + } + + get type() { + return this.node.type; + } + + get inList() { + return typeof this._ancestor.index === "number"; + } + + get containerIndex() { + const { index } = this._ancestor; + + if (typeof index !== "number") { + throw new Error("Cannot get index of non-array node"); + } + + return index; + } + + get depth() { + return this._index; + } + + replace(node) { + this.node = node; + } + + find(predicate) { + for (let path = this; path; path = path.parentPath) { + if (predicate(path)) { + return path; + } + } + return null; + } + findParent(predicate) { + if (!this.parentPath) { + throw new Error("Cannot use findParent on root path"); + } + + return this.parentPath.find(predicate); + } + + getSibling(offset) { + const { node, key, index } = this._ancestor; + + if (typeof index !== "number") { + throw new Error("Non-array nodes do not have siblings"); + } + + const container = node[key]; + + const siblingIndex = index + offset; + if (siblingIndex < 0 || siblingIndex >= container.length) { + return null; + } + + return new SimplePath(this._ancestors.slice(0, -1).concat([{ node, key, index: siblingIndex }])); + } +} + +/***/ }), +/* 289 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, '__esModule', { value: true }); + +function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + subClass.__proto__ = superClass; +} + +// A second optional argument can be given to further configure +// the parser process. These options are recognized: +var defaultOptions = { + // Source type ("script" or "module") for different semantics + sourceType: "script", + // Source filename. + sourceFilename: undefined, + // Line from which to start counting source. Useful for + // integration with other tools. + startLine: 1, + // When enabled, a return at the top level is not considered an + // error. + allowReturnOutsideFunction: false, + // When enabled, import/export statements are not constrained to + // appearing at the top of the program. + allowImportExportEverywhere: false, + // TODO + allowSuperOutsideMethod: false, + // An array of plugins to enable + plugins: [], + // TODO + strictMode: null, + // Nodes have their start and end characters offsets recorded in + // `start` and `end` properties (directly on the node, rather than + // the `loc` object, which holds line/column data. To also add a + // [semi-standardized][range] `range` property holding a `[start, + // end]` array with the same numbers, set the `ranges` option to + // `true`. + // + // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678 + ranges: false, + // Adds all parsed tokens to a `tokens` property on the `File` node + tokens: false +}; // Interpret and default an options object + +function getOptions(opts) { + var options = {}; + + for (var key in defaultOptions) { + options[key] = opts && opts[key] != null ? opts[key] : defaultOptions[key]; + } + + return options; +} + +// ## Token types +// The assignment of fine-grained, information-carrying type objects +// allows the tokenizer to store the information it has about a +// token in a way that is very cheap for the parser to look up. +// All token type variables start with an underscore, to make them +// easy to recognize. +// The `beforeExpr` property is used to disambiguate between regular +// expressions and divisions. It is set on all token types that can +// be followed by an expression (thus, a slash after them would be a +// regular expression). +// +// `isLoop` marks a keyword as starting a loop, which is important +// to know when parsing a label, in order to allow or disallow +// continue jumps to that label. +var beforeExpr = true; +var startsExpr = true; +var isLoop = true; +var isAssign = true; +var prefix = true; +var postfix = true; +var TokenType = function TokenType(label, conf) { + if (conf === void 0) { + conf = {}; + } + + this.label = label; + this.keyword = conf.keyword; + this.beforeExpr = !!conf.beforeExpr; + this.startsExpr = !!conf.startsExpr; + this.rightAssociative = !!conf.rightAssociative; + this.isLoop = !!conf.isLoop; + this.isAssign = !!conf.isAssign; + this.prefix = !!conf.prefix; + this.postfix = !!conf.postfix; + this.binop = conf.binop === 0 ? 0 : conf.binop || null; + this.updateContext = null; +}; + +var KeywordTokenType = +/*#__PURE__*/ +function (_TokenType) { + _inheritsLoose(KeywordTokenType, _TokenType); + + function KeywordTokenType(name, options) { + if (options === void 0) { + options = {}; + } + + options.keyword = name; + return _TokenType.call(this, name, options) || this; + } + + return KeywordTokenType; +}(TokenType); + +var BinopTokenType = +/*#__PURE__*/ +function (_TokenType2) { + _inheritsLoose(BinopTokenType, _TokenType2); + + function BinopTokenType(name, prec) { + return _TokenType2.call(this, name, { + beforeExpr, + binop: prec + }) || this; + } + + return BinopTokenType; +}(TokenType); +var types = { + num: new TokenType("num", { + startsExpr + }), + bigint: new TokenType("bigint", { + startsExpr + }), + regexp: new TokenType("regexp", { + startsExpr + }), + string: new TokenType("string", { + startsExpr + }), + name: new TokenType("name", { + startsExpr + }), + eof: new TokenType("eof"), + // Punctuation token types. + bracketL: new TokenType("[", { + beforeExpr, + startsExpr + }), + bracketR: new TokenType("]"), + braceL: new TokenType("{", { + beforeExpr, + startsExpr + }), + braceBarL: new TokenType("{|", { + beforeExpr, + startsExpr + }), + braceR: new TokenType("}"), + braceBarR: new TokenType("|}"), + parenL: new TokenType("(", { + beforeExpr, + startsExpr + }), + parenR: new TokenType(")"), + comma: new TokenType(",", { + beforeExpr + }), + semi: new TokenType(";", { + beforeExpr + }), + colon: new TokenType(":", { + beforeExpr + }), + doubleColon: new TokenType("::", { + beforeExpr + }), + dot: new TokenType("."), + question: new TokenType("?", { + beforeExpr + }), + questionDot: new TokenType("?."), + arrow: new TokenType("=>", { + beforeExpr + }), + template: new TokenType("template"), + ellipsis: new TokenType("...", { + beforeExpr + }), + backQuote: new TokenType("`", { + startsExpr + }), + dollarBraceL: new TokenType("${", { + beforeExpr, + startsExpr + }), + at: new TokenType("@"), + hash: new TokenType("#"), + // Operators. These carry several kinds of properties to help the + // parser use them properly (the presence of these properties is + // what categorizes them as operators). + // + // `binop`, when present, specifies that this operator is a binary + // operator, and will refer to its precedence. + // + // `prefix` and `postfix` mark the operator as a prefix or postfix + // unary operator. + // + // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as + // binary operators with a very low precedence, that should result + // in AssignmentExpression nodes. + eq: new TokenType("=", { + beforeExpr, + isAssign + }), + assign: new TokenType("_=", { + beforeExpr, + isAssign + }), + incDec: new TokenType("++/--", { + prefix, + postfix, + startsExpr + }), + bang: new TokenType("!", { + beforeExpr, + prefix, + startsExpr + }), + tilde: new TokenType("~", { + beforeExpr, + prefix, + startsExpr + }), + pipeline: new BinopTokenType("|>", 0), + nullishCoalescing: new BinopTokenType("??", 1), + logicalOR: new BinopTokenType("||", 1), + logicalAND: new BinopTokenType("&&", 2), + bitwiseOR: new BinopTokenType("|", 3), + bitwiseXOR: new BinopTokenType("^", 4), + bitwiseAND: new BinopTokenType("&", 5), + equality: new BinopTokenType("==/!=", 6), + relational: new BinopTokenType("", 7), + bitShift: new BinopTokenType("<>", 8), + plusMin: new TokenType("+/-", { + beforeExpr, + binop: 9, + prefix, + startsExpr + }), + modulo: new BinopTokenType("%", 10), + star: new BinopTokenType("*", 10), + slash: new BinopTokenType("/", 10), + exponent: new TokenType("**", { + beforeExpr, + binop: 11, + rightAssociative: true + }) +}; +var keywords = { + break: new KeywordTokenType("break"), + case: new KeywordTokenType("case", { + beforeExpr + }), + catch: new KeywordTokenType("catch"), + continue: new KeywordTokenType("continue"), + debugger: new KeywordTokenType("debugger"), + default: new KeywordTokenType("default", { + beforeExpr + }), + do: new KeywordTokenType("do", { + isLoop, + beforeExpr + }), + else: new KeywordTokenType("else", { + beforeExpr + }), + finally: new KeywordTokenType("finally"), + for: new KeywordTokenType("for", { + isLoop + }), + function: new KeywordTokenType("function", { + startsExpr + }), + if: new KeywordTokenType("if"), + return: new KeywordTokenType("return", { + beforeExpr + }), + switch: new KeywordTokenType("switch"), + throw: new KeywordTokenType("throw", { + beforeExpr, + prefix, + startsExpr + }), + try: new KeywordTokenType("try"), + var: new KeywordTokenType("var"), + let: new KeywordTokenType("let"), + const: new KeywordTokenType("const"), + while: new KeywordTokenType("while", { + isLoop + }), + with: new KeywordTokenType("with"), + new: new KeywordTokenType("new", { + beforeExpr, + startsExpr + }), + this: new KeywordTokenType("this", { + startsExpr + }), + super: new KeywordTokenType("super", { + startsExpr + }), + class: new KeywordTokenType("class"), + extends: new KeywordTokenType("extends", { + beforeExpr + }), + export: new KeywordTokenType("export"), + import: new KeywordTokenType("import", { + startsExpr + }), + yield: new KeywordTokenType("yield", { + beforeExpr, + startsExpr + }), + null: new KeywordTokenType("null", { + startsExpr + }), + true: new KeywordTokenType("true", { + startsExpr + }), + false: new KeywordTokenType("false", { + startsExpr + }), + in: new KeywordTokenType("in", { + beforeExpr, + binop: 7 + }), + instanceof: new KeywordTokenType("instanceof", { + beforeExpr, + binop: 7 + }), + typeof: new KeywordTokenType("typeof", { + beforeExpr, + prefix, + startsExpr + }), + void: new KeywordTokenType("void", { + beforeExpr, + prefix, + startsExpr + }), + delete: new KeywordTokenType("delete", { + beforeExpr, + prefix, + startsExpr + }) +}; // Map keyword names to token types. + +Object.keys(keywords).forEach(function (name) { + types["_" + name] = keywords[name]; +}); + +/* eslint max-len: 0 */ +function makePredicate(words) { + var wordsArr = words.split(" "); + return function (str) { + return wordsArr.indexOf(str) >= 0; + }; +} // Reserved word lists for various dialects of the language + + +var reservedWords = { + "6": makePredicate("enum await"), + strict: makePredicate("implements interface let package private protected public static yield"), + strictBind: makePredicate("eval arguments") +}; // And the keywords + +var isKeyword = makePredicate("break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this let const class extends export import yield super"); // ## Character categories +// Big ugly regular expressions that match characters in the +// whitespace, identifier, and identifier-start categories. These +// are only applied when a character is found to actually have a +// code point above 128. +// Generated by `bin/generate-identifier-regex.js`. + +/* prettier-ignore */ + +var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08bd\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312e\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fea\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ae\ua7b0-\ua7b7\ua7f7-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab65\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; +/* prettier-ignore */ + +var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d4-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; +var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); +var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); +nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; // These are a run-length and offset encoded representation of the +// >0xffff code points that are a valid part of identifiers. The +// offset starts at 0x10000, and each pair of numbers represents an +// offset to the next range, and then a size of the range. They were +// generated by `bin/generate-identifier-regex.js`. + +/* prettier-ignore */ + +var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 157, 310, 10, 21, 11, 7, 153, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 26, 45, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 785, 52, 76, 44, 33, 24, 27, 35, 42, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 54, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 86, 25, 391, 63, 32, 0, 257, 0, 11, 39, 8, 0, 22, 0, 12, 39, 3, 3, 55, 56, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 698, 921, 103, 110, 18, 195, 2749, 1070, 4050, 582, 8634, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 881, 68, 12, 0, 67, 12, 65, 1, 31, 6124, 20, 754, 9486, 286, 82, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 4149, 196, 60, 67, 1213, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42710, 42, 4148, 12, 221, 3, 5761, 15, 7472, 3104, 541]; +/* prettier-ignore */ + +var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 1306, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 52, 0, 13, 2, 49, 13, 10, 2, 4, 9, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 57, 0, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 87, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 423, 9, 280, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 19719, 9, 135, 4, 60, 6, 26, 9, 1016, 45, 17, 3, 19723, 1, 5319, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 2214, 6, 110, 6, 6, 9, 792487, 239]; // This has a complexity linear to the value of the code. The +// assumption is that looking up astral identifier characters is +// rare. + +function isInAstralSet(code, set) { + var pos = 0x10000; + + for (var i = 0; i < set.length; i += 2) { + pos += set[i]; + if (pos > code) return false; + pos += set[i + 1]; + if (pos >= code) return true; + } + + return false; +} // Test whether a given character code starts an identifier. + + +function isIdentifierStart(code) { + if (code < 65) return code === 36; + if (code < 91) return true; + if (code < 97) return code === 95; + if (code < 123) return true; + + if (code <= 0xffff) { + return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); + } + + return isInAstralSet(code, astralIdentifierStartCodes); +} // Test whether a current state character code and next character code is @ + +function isIteratorStart(current, next) { + return current === 64 && next === 64; +} // Test whether a given character is part of an identifier. + +function isIdentifierChar(code) { + if (code < 48) return code === 36; + if (code < 58) return true; + if (code < 65) return false; + if (code < 91) return true; + if (code < 97) return code === 95; + if (code < 123) return true; + + if (code <= 0xffff) { + return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); + } + + return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); +} + +// Matches a whole line break (where CRLF is considered a single +// line break). Used to count lines. +var lineBreak = /\r\n?|\n|\u2028|\u2029/; +var lineBreakG = new RegExp(lineBreak.source, "g"); +function isNewLine(code) { + return code === 10 || code === 13 || code === 0x2028 || code === 0x2029; +} +var nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/; + +// The algorithm used to determine whether a regexp can appear at a +// given point in the program is loosely based on sweet.js' approach. +// See https://github.com/mozilla/sweet.js/wiki/design +var TokContext = function TokContext(token, isExpr, preserveSpace, override) // Takes a Tokenizer as a this-parameter, and returns void. +{ + this.token = token; + this.isExpr = !!isExpr; + this.preserveSpace = !!preserveSpace; + this.override = override; +}; +var types$1 = { + braceStatement: new TokContext("{", false), + braceExpression: new TokContext("{", true), + templateQuasi: new TokContext("${", true), + parenStatement: new TokContext("(", false), + parenExpression: new TokContext("(", true), + template: new TokContext("`", true, true, function (p) { + return p.readTmplToken(); + }), + functionExpression: new TokContext("function", true) +}; // Token-specific context update code + +types.parenR.updateContext = types.braceR.updateContext = function () { + if (this.state.context.length === 1) { + this.state.exprAllowed = true; + return; + } + + var out = this.state.context.pop(); + + if (out === types$1.braceStatement && this.curContext() === types$1.functionExpression) { + this.state.context.pop(); + this.state.exprAllowed = false; + } else if (out === types$1.templateQuasi) { + this.state.exprAllowed = true; + } else { + this.state.exprAllowed = !out.isExpr; + } +}; + +types.name.updateContext = function (prevType) { + if (this.state.value === "of" && this.curContext() === types$1.parenStatement) { + this.state.exprAllowed = !prevType.beforeExpr; + return; + } + + this.state.exprAllowed = false; + + if (prevType === types._let || prevType === types._const || prevType === types._var) { + if (lineBreak.test(this.input.slice(this.state.end))) { + this.state.exprAllowed = true; + } + } + + if (this.state.isIterator) { + this.state.isIterator = false; + } +}; + +types.braceL.updateContext = function (prevType) { + this.state.context.push(this.braceIsBlock(prevType) ? types$1.braceStatement : types$1.braceExpression); + this.state.exprAllowed = true; +}; + +types.dollarBraceL.updateContext = function () { + this.state.context.push(types$1.templateQuasi); + this.state.exprAllowed = true; +}; + +types.parenL.updateContext = function (prevType) { + var statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while; + this.state.context.push(statementParens ? types$1.parenStatement : types$1.parenExpression); + this.state.exprAllowed = true; +}; + +types.incDec.updateContext = function () {// tokExprAllowed stays unchanged +}; + +types._function.updateContext = function (prevType) { + if (this.state.exprAllowed && !this.braceIsBlock(prevType)) { + this.state.context.push(types$1.functionExpression); + } + + this.state.exprAllowed = false; +}; + +types.backQuote.updateContext = function () { + if (this.curContext() === types$1.template) { + this.state.context.pop(); + } else { + this.state.context.push(types$1.template); + } + + this.state.exprAllowed = false; +}; + +// These are used when `options.locations` is on, for the +// `startLoc` and `endLoc` properties. +var Position = function Position(line, col) { + this.line = line; + this.column = col; +}; +var SourceLocation = function SourceLocation(start, end) { + this.start = start; // $FlowIgnore (may start as null, but initialized later) + + this.end = end; +}; // The `getLineInfo` function is mostly useful when the +// `locations` option is off (for performance reasons) and you +// want to find the line/column position for a given character +// offset. `input` should be the code string that the offset refers +// into. + +function getLineInfo(input, offset) { + for (var line = 1, cur = 0;;) { + lineBreakG.lastIndex = cur; + var match = lineBreakG.exec(input); + + if (match && match.index < offset) { + ++line; + cur = match.index + match[0].length; + } else { + return new Position(line, offset - cur); + } + } // istanbul ignore next + + + throw new Error("Unreachable"); +} + +var BaseParser = +/*#__PURE__*/ +function () { + function BaseParser() {} + + var _proto = BaseParser.prototype; + + // Properties set by constructor in index.js + // Initialized by Tokenizer + _proto.isReservedWord = function isReservedWord(word) { + if (word === "await") { + return this.inModule; + } else { + return reservedWords[6](word); + } + }; + + _proto.hasPlugin = function hasPlugin(name) { + return !!this.plugins[name]; + }; + + return BaseParser; +}(); + +/* eslint max-len: 0 */ + +/** + * Based on the comment attachment algorithm used in espree and estraverse. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +function last(stack) { + return stack[stack.length - 1]; +} + +var CommentsParser = +/*#__PURE__*/ +function (_BaseParser) { + _inheritsLoose(CommentsParser, _BaseParser); + + function CommentsParser() { + return _BaseParser.apply(this, arguments) || this; + } + + var _proto = CommentsParser.prototype; + + _proto.addComment = function addComment(comment) { + if (this.filename) comment.loc.filename = this.filename; + this.state.trailingComments.push(comment); + this.state.leadingComments.push(comment); + }; + + _proto.processComment = function processComment(node) { + if (node.type === "Program" && node.body.length > 0) return; + var stack = this.state.commentStack; + var firstChild, lastChild, trailingComments, i, j; + + if (this.state.trailingComments.length > 0) { + // If the first comment in trailingComments comes after the + // current node, then we're good - all comments in the array will + // come after the node and so it's safe to add them as official + // trailingComments. + if (this.state.trailingComments[0].start >= node.end) { + trailingComments = this.state.trailingComments; + this.state.trailingComments = []; + } else { + // Otherwise, if the first comment doesn't come after the + // current node, that means we have a mix of leading and trailing + // comments in the array and that leadingComments contains the + // same items as trailingComments. Reset trailingComments to + // zero items and we'll handle this by evaluating leadingComments + // later. + this.state.trailingComments.length = 0; + } + } else if (stack.length > 0) { + var lastInStack = last(stack); + + if (lastInStack.trailingComments && lastInStack.trailingComments[0].start >= node.end) { + trailingComments = lastInStack.trailingComments; + delete lastInStack.trailingComments; + } + } // Eating the stack. + + + if (stack.length > 0 && last(stack).start >= node.start) { + firstChild = stack.pop(); + } + + while (stack.length > 0 && last(stack).start >= node.start) { + lastChild = stack.pop(); + } + + if (!lastChild && firstChild) lastChild = firstChild; // Attach comments that follow a trailing comma on the last + // property in an object literal or a trailing comma in function arguments + // as trailing comments + + if (firstChild && this.state.leadingComments.length > 0) { + var lastComment = last(this.state.leadingComments); + + if (firstChild.type === "ObjectProperty") { + if (lastComment.start >= node.start) { + if (this.state.commentPreviousNode) { + for (j = 0; j < this.state.leadingComments.length; j++) { + if (this.state.leadingComments[j].end < this.state.commentPreviousNode.end) { + this.state.leadingComments.splice(j, 1); + j--; + } + } + + if (this.state.leadingComments.length > 0) { + firstChild.trailingComments = this.state.leadingComments; + this.state.leadingComments = []; + } + } + } + } else if (node.type === "CallExpression" && node.arguments && node.arguments.length) { + var lastArg = last(node.arguments); + + if (lastArg && lastComment.start >= lastArg.start && lastComment.end <= node.end) { + if (this.state.commentPreviousNode) { + if (this.state.leadingComments.length > 0) { + lastArg.trailingComments = this.state.leadingComments; + this.state.leadingComments = []; + } + } + } + } + } + + if (lastChild) { + if (lastChild.leadingComments) { + if (lastChild !== node && lastChild.leadingComments.length > 0 && last(lastChild.leadingComments).end <= node.start) { + node.leadingComments = lastChild.leadingComments; + delete lastChild.leadingComments; + } else { + // A leading comment for an anonymous class had been stolen by its first ClassMethod, + // so this takes back the leading comment. + // See also: https://github.com/eslint/espree/issues/158 + for (i = lastChild.leadingComments.length - 2; i >= 0; --i) { + if (lastChild.leadingComments[i].end <= node.start) { + node.leadingComments = lastChild.leadingComments.splice(0, i + 1); + break; + } + } + } + } + } else if (this.state.leadingComments.length > 0) { + if (last(this.state.leadingComments).end <= node.start) { + if (this.state.commentPreviousNode) { + for (j = 0; j < this.state.leadingComments.length; j++) { + if (this.state.leadingComments[j].end < this.state.commentPreviousNode.end) { + this.state.leadingComments.splice(j, 1); + j--; + } + } + } + + if (this.state.leadingComments.length > 0) { + node.leadingComments = this.state.leadingComments; + this.state.leadingComments = []; + } + } else { + // https://github.com/eslint/espree/issues/2 + // + // In special cases, such as return (without a value) and + // debugger, all comments will end up as leadingComments and + // will otherwise be eliminated. This step runs when the + // commentStack is empty and there are comments left + // in leadingComments. + // + // This loop figures out the stopping point between the actual + // leading and trailing comments by finding the location of the + // first comment that comes after the given node. + for (i = 0; i < this.state.leadingComments.length; i++) { + if (this.state.leadingComments[i].end > node.start) { + break; + } + } // Split the array based on the location of the first comment + // that comes after the node. Keep in mind that this could + // result in an empty array, and if so, the array must be + // deleted. + + + var leadingComments = this.state.leadingComments.slice(0, i); + + if (leadingComments.length) { + node.leadingComments = leadingComments; + } // Similarly, trailing comments are attached later. The variable + // must be reset to null if there are no trailing comments. + + + trailingComments = this.state.leadingComments.slice(i); + + if (trailingComments.length === 0) { + trailingComments = null; + } + } + } + + this.state.commentPreviousNode = node; + + if (trailingComments) { + if (trailingComments.length && trailingComments[0].start >= node.start && last(trailingComments).end <= node.end) { + node.innerComments = trailingComments; + } else { + node.trailingComments = trailingComments; + } + } + + stack.push(node); + }; + + return CommentsParser; +}(BaseParser); + +// takes an offset integer (into the current `input`) to indicate +// the location of the error, attaches the position to the end +// of the error message, and then raises a `SyntaxError` with that +// message. + +var LocationParser = +/*#__PURE__*/ +function (_CommentsParser) { + _inheritsLoose(LocationParser, _CommentsParser); + + function LocationParser() { + return _CommentsParser.apply(this, arguments) || this; + } + + var _proto = LocationParser.prototype; + + _proto.raise = function raise(pos, message, missingPluginNames) { + var loc = getLineInfo(this.input, pos); + message += ` (${loc.line}:${loc.column})`; // $FlowIgnore + + var err = new SyntaxError(message); + err.pos = pos; + err.loc = loc; + + if (missingPluginNames) { + err.missingPlugin = missingPluginNames; + } + + throw err; + }; + + return LocationParser; +}(CommentsParser); + +var State = +/*#__PURE__*/ +function () { + function State() {} + + var _proto = State.prototype; + + _proto.init = function init(options, input) { + this.strict = options.strictMode === false ? false : options.sourceType === "module"; + this.input = input; + this.potentialArrowAt = -1; + this.noArrowAt = []; + this.noArrowParamsConversionAt = []; // eslint-disable-next-line max-len + + this.inMethod = this.inFunction = this.inParameters = this.maybeInArrowParameters = this.inGenerator = this.inAsync = this.inPropertyName = this.inType = this.inClassProperty = this.noAnonFunctionType = false; + this.classLevel = 0; + this.labels = []; + this.decoratorStack = [[]]; + this.yieldInPossibleArrowParameters = null; + this.tokens = []; + this.comments = []; + this.trailingComments = []; + this.leadingComments = []; + this.commentStack = []; // $FlowIgnore + + this.commentPreviousNode = null; + this.pos = this.lineStart = 0; + this.curLine = options.startLine; + this.type = types.eof; + this.value = null; + this.start = this.end = this.pos; + this.startLoc = this.endLoc = this.curPosition(); // $FlowIgnore + + this.lastTokEndLoc = this.lastTokStartLoc = null; + this.lastTokStart = this.lastTokEnd = this.pos; + this.context = [types$1.braceStatement]; + this.exprAllowed = true; + this.containsEsc = this.containsOctal = false; + this.octalPosition = null; + this.invalidTemplateEscapePosition = null; + this.exportedIdentifiers = []; + }; // TODO + + + _proto.curPosition = function curPosition() { + return new Position(this.curLine, this.pos - this.lineStart); + }; + + _proto.clone = function clone(skipArrays) { + var _this = this; + + var state = new State(); + Object.keys(this).forEach(function (key) { + // $FlowIgnore + var val = _this[key]; + + if ((!skipArrays || key === "context") && Array.isArray(val)) { + val = val.slice(); + } // $FlowIgnore + + + state[key] = val; + }); + return state; + }; + + return State; +}(); + +var _isDigit = function isDigit(code) { + return code >= 48 && code <= 57; +}; + +/* eslint max-len: 0 */ +// an immediate sibling of NumericLiteralSeparator _ + +var forbiddenNumericSeparatorSiblings = { + decBinOct: [46, 66, 69, 79, 95, // multiple separators are not allowed + 98, 101, 111], + hex: [46, 88, 95, // multiple separators are not allowed + 120] +}; +var allowedNumericSeparatorSiblings = {}; +allowedNumericSeparatorSiblings.bin = [// 0 - 1 +48, 49]; +allowedNumericSeparatorSiblings.oct = allowedNumericSeparatorSiblings.bin.concat([50, 51, 52, 53, 54, 55]); +allowedNumericSeparatorSiblings.dec = allowedNumericSeparatorSiblings.oct.concat([56, 57]); +allowedNumericSeparatorSiblings.hex = allowedNumericSeparatorSiblings.dec.concat([65, 66, 67, 68, 69, 70, 97, 98, 99, 100, 101, 102]); // Object type used to represent tokens. Note that normally, tokens +// simply exist as properties on the parser object. This is only +// used for the onToken callback and the external tokenizer. + +var Token = function Token(state) { + this.type = state.type; + this.value = state.value; + this.start = state.start; + this.end = state.end; + this.loc = new SourceLocation(state.startLoc, state.endLoc); +}; // ## Tokenizer + +function codePointToString(code) { + // UTF-16 Decoding + if (code <= 0xffff) { + return String.fromCharCode(code); + } else { + return String.fromCharCode((code - 0x10000 >> 10) + 0xd800, (code - 0x10000 & 1023) + 0xdc00); + } +} + +var Tokenizer = +/*#__PURE__*/ +function (_LocationParser) { + _inheritsLoose(Tokenizer, _LocationParser); + + // Forward-declarations + // parser/util.js + function Tokenizer(options, input) { + var _this; + + _this = _LocationParser.call(this) || this; + _this.state = new State(); + + _this.state.init(options, input); + + _this.isLookahead = false; + return _this; + } // Move to the next token + + + var _proto = Tokenizer.prototype; + + _proto.next = function next() { + if (this.options.tokens && !this.isLookahead) { + this.state.tokens.push(new Token(this.state)); + } + + this.state.lastTokEnd = this.state.end; + this.state.lastTokStart = this.state.start; + this.state.lastTokEndLoc = this.state.endLoc; + this.state.lastTokStartLoc = this.state.startLoc; + this.nextToken(); + }; // TODO + + + _proto.eat = function eat(type) { + if (this.match(type)) { + this.next(); + return true; + } else { + return false; + } + }; // TODO + + + _proto.match = function match(type) { + return this.state.type === type; + }; // TODO + + + _proto.isKeyword = function isKeyword$$1(word) { + return isKeyword(word); + }; // TODO + + + _proto.lookahead = function lookahead() { + var old = this.state; + this.state = old.clone(true); + this.isLookahead = true; + this.next(); + this.isLookahead = false; + var curr = this.state; + this.state = old; + return curr; + }; // Toggle strict mode. Re-reads the next number or string to please + // pedantic tests (`"use strict"; 010;` should fail). + + + _proto.setStrict = function setStrict(strict) { + this.state.strict = strict; + if (!this.match(types.num) && !this.match(types.string)) return; + this.state.pos = this.state.start; + + while (this.state.pos < this.state.lineStart) { + this.state.lineStart = this.input.lastIndexOf("\n", this.state.lineStart - 2) + 1; + --this.state.curLine; + } + + this.nextToken(); + }; + + _proto.curContext = function curContext() { + return this.state.context[this.state.context.length - 1]; + }; // Read a single token, updating the parser object's token-related + // properties. + + + _proto.nextToken = function nextToken() { + var curContext = this.curContext(); + if (!curContext || !curContext.preserveSpace) this.skipSpace(); + this.state.containsOctal = false; + this.state.octalPosition = null; + this.state.start = this.state.pos; + this.state.startLoc = this.state.curPosition(); + + if (this.state.pos >= this.input.length) { + this.finishToken(types.eof); + return; + } + + if (curContext.override) { + curContext.override(this); + } else { + this.readToken(this.fullCharCodeAtPos()); + } + }; + + _proto.readToken = function readToken(code) { + // Identifier or keyword. '\uXXXX' sequences are allowed in + // identifiers, so '\' also dispatches to that. + if (isIdentifierStart(code) || code === 92) { + this.readWord(); + } else { + this.getTokenFromCode(code); + } + }; + + _proto.fullCharCodeAtPos = function fullCharCodeAtPos() { + var code = this.input.charCodeAt(this.state.pos); + if (code <= 0xd7ff || code >= 0xe000) return code; + var next = this.input.charCodeAt(this.state.pos + 1); + return (code << 10) + next - 0x35fdc00; + }; + + _proto.pushComment = function pushComment(block, text, start, end, startLoc, endLoc) { + var comment = { + type: block ? "CommentBlock" : "CommentLine", + value: text, + start: start, + end: end, + loc: new SourceLocation(startLoc, endLoc) + }; + + if (!this.isLookahead) { + if (this.options.tokens) this.state.tokens.push(comment); + this.state.comments.push(comment); + this.addComment(comment); + } + }; + + _proto.skipBlockComment = function skipBlockComment() { + var startLoc = this.state.curPosition(); + var start = this.state.pos; + var end = this.input.indexOf("*/", this.state.pos += 2); + if (end === -1) this.raise(this.state.pos - 2, "Unterminated comment"); + this.state.pos = end + 2; + lineBreakG.lastIndex = start; + var match; + + while ((match = lineBreakG.exec(this.input)) && match.index < this.state.pos) { + ++this.state.curLine; + this.state.lineStart = match.index + match[0].length; + } + + this.pushComment(true, this.input.slice(start + 2, end), start, this.state.pos, startLoc, this.state.curPosition()); + }; + + _proto.skipLineComment = function skipLineComment(startSkip) { + var start = this.state.pos; + var startLoc = this.state.curPosition(); + var ch = this.input.charCodeAt(this.state.pos += startSkip); + + if (this.state.pos < this.input.length) { + while (ch !== 10 && ch !== 13 && ch !== 8232 && ch !== 8233 && ++this.state.pos < this.input.length) { + ch = this.input.charCodeAt(this.state.pos); + } + } + + this.pushComment(false, this.input.slice(start + startSkip, this.state.pos), start, this.state.pos, startLoc, this.state.curPosition()); + }; // Called at the start of the parse and after every token. Skips + // whitespace and comments, and. + + + _proto.skipSpace = function skipSpace() { + loop: while (this.state.pos < this.input.length) { + var ch = this.input.charCodeAt(this.state.pos); + + switch (ch) { + case 32: + case 160: + ++this.state.pos; + break; + + case 13: + if (this.input.charCodeAt(this.state.pos + 1) === 10) { + ++this.state.pos; + } + + case 10: + case 8232: + case 8233: + ++this.state.pos; + ++this.state.curLine; + this.state.lineStart = this.state.pos; + break; + + case 47: + switch (this.input.charCodeAt(this.state.pos + 1)) { + case 42: + this.skipBlockComment(); + break; + + case 47: + this.skipLineComment(2); + break; + + default: + break loop; + } + + break; + + default: + if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { + ++this.state.pos; + } else { + break loop; + } + + } + } + }; // Called at the end of every token. Sets `end`, `val`, and + // maintains `context` and `exprAllowed`, and skips the space after + // the token, so that the next one's `start` will point at the + // right position. + + + _proto.finishToken = function finishToken(type, val) { + this.state.end = this.state.pos; + this.state.endLoc = this.state.curPosition(); + var prevType = this.state.type; + this.state.type = type; + this.state.value = val; + this.updateContext(prevType); + }; // ### Token reading + // This is the function that is called to fetch the next token. It + // is somewhat obscure, because it works in character codes rather + // than characters, and because operator parsing has been inlined + // into it. + // + // All in the name of speed. + // + + + _proto.readToken_dot = function readToken_dot() { + var next = this.input.charCodeAt(this.state.pos + 1); + + if (next >= 48 && next <= 57) { + this.readNumber(true); + return; + } + + var next2 = this.input.charCodeAt(this.state.pos + 2); + + if (next === 46 && next2 === 46) { + this.state.pos += 3; + this.finishToken(types.ellipsis); + } else { + ++this.state.pos; + this.finishToken(types.dot); + } + }; + + _proto.readToken_slash = function readToken_slash() { + // '/' + if (this.state.exprAllowed) { + ++this.state.pos; + this.readRegexp(); + return; + } + + var next = this.input.charCodeAt(this.state.pos + 1); + + if (next === 61) { + this.finishOp(types.assign, 2); + } else { + this.finishOp(types.slash, 1); + } + }; + + _proto.readToken_mult_modulo = function readToken_mult_modulo(code) { + // '%*' + var type = code === 42 ? types.star : types.modulo; + var width = 1; + var next = this.input.charCodeAt(this.state.pos + 1); + var exprAllowed = this.state.exprAllowed; // Exponentiation operator ** + + if (code === 42 && next === 42) { + width++; + next = this.input.charCodeAt(this.state.pos + 2); + type = types.exponent; + } + + if (next === 61 && !exprAllowed) { + width++; + type = types.assign; + } + + this.finishOp(type, width); + }; + + _proto.readToken_pipe_amp = function readToken_pipe_amp(code) { + // '|&' + var next = this.input.charCodeAt(this.state.pos + 1); + + if (next === code) { + this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2); + return; + } + + if (code === 124) { + // '|>' + if (next === 62) { + this.finishOp(types.pipeline, 2); + return; + } else if (next === 125 && this.hasPlugin("flow")) { + // '|}' + this.finishOp(types.braceBarR, 2); + return; + } + } + + if (next === 61) { + this.finishOp(types.assign, 2); + return; + } + + this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1); + }; + + _proto.readToken_caret = function readToken_caret() { + // '^' + var next = this.input.charCodeAt(this.state.pos + 1); + + if (next === 61) { + this.finishOp(types.assign, 2); + } else { + this.finishOp(types.bitwiseXOR, 1); + } + }; + + _proto.readToken_plus_min = function readToken_plus_min(code) { + // '+-' + var next = this.input.charCodeAt(this.state.pos + 1); + + if (next === code) { + if (next === 45 && !this.inModule && this.input.charCodeAt(this.state.pos + 2) === 62 && lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.pos))) { + // A `-->` line comment + this.skipLineComment(3); + this.skipSpace(); + this.nextToken(); + return; + } + + this.finishOp(types.incDec, 2); + return; + } + + if (next === 61) { + this.finishOp(types.assign, 2); + } else { + this.finishOp(types.plusMin, 1); + } + }; + + _proto.readToken_lt_gt = function readToken_lt_gt(code) { + // '<>' + var next = this.input.charCodeAt(this.state.pos + 1); + var size = 1; + + if (next === code) { + size = code === 62 && this.input.charCodeAt(this.state.pos + 2) === 62 ? 3 : 2; + + if (this.input.charCodeAt(this.state.pos + size) === 61) { + this.finishOp(types.assign, size + 1); + return; + } + + this.finishOp(types.bitShift, size); + return; + } + + if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.state.pos + 2) === 45 && this.input.charCodeAt(this.state.pos + 3) === 45) { + // ` + + Reference to check that textPath can point to a line + + + + + + + Should see this + + + diff --git a/layout/reftests/svg/textPath-line-01.svg b/layout/reftests/svg/textPath-line-01.svg new file mode 100644 index 000000000000..9fc857157677 --- /dev/null +++ b/layout/reftests/svg/textPath-line-01.svg @@ -0,0 +1,16 @@ + + + Testcase to check that textPath can point to a line + + + + + + + Should see this + + + diff --git a/layout/svg/SVGTextFrame.cpp b/layout/svg/SVGTextFrame.cpp index 9c44ce595654..0c415eff7a64 100644 --- a/layout/svg/SVGTextFrame.cpp +++ b/layout/svg/SVGTextFrame.cpp @@ -42,7 +42,7 @@ #include "SVGContextPaint.h" #include "SVGLengthList.h" #include "SVGNumberList.h" -#include "SVGPathElement.h" +#include "SVGGeometryElement.h" #include "SVGTextPathElement.h" #include "nsLayoutUtils.h" #include "nsFrameSelection.h" @@ -4987,8 +4987,8 @@ SVGTextFrame::AdjustPositionsForClusters() } } -SVGPathElement* -SVGTextFrame::GetTextPathPathElement(nsIFrame* aTextPathFrame) +SVGGeometryElement* +SVGTextFrame::GetTextPathGeometryElement(nsIFrame* aTextPathFrame) { nsSVGTextPathProperty *property = aTextPathFrame->GetProperty(SVGObserverUtils::HrefAsTextPathProperty()); @@ -5023,14 +5023,14 @@ SVGTextFrame::GetTextPathPathElement(nsIFrame* aTextPathFrame) } Element* element = property->GetReferencedElement(); - return (element && element->IsSVGElement(nsGkAtoms::path)) ? - static_cast(element) : nullptr; + return (element && element->IsNodeOfType(nsINode::eSHAPE)) ? + static_cast(element) : nullptr; } already_AddRefed SVGTextFrame::GetTextPath(nsIFrame* aTextPathFrame) { - SVGPathElement* element = GetTextPathPathElement(aTextPathFrame); + SVGGeometryElement* element = GetTextPathGeometryElement(aTextPathFrame); if (!element) { return nullptr; } @@ -5053,11 +5053,11 @@ SVGTextFrame::GetTextPath(nsIFrame* aTextPathFrame) gfxFloat SVGTextFrame::GetOffsetScale(nsIFrame* aTextPathFrame) { - SVGPathElement* pathElement = GetTextPathPathElement(aTextPathFrame); - if (!pathElement) + SVGGeometryElement* element = GetTextPathGeometryElement(aTextPathFrame); + if (!element) return 1.0; - return pathElement->GetPathLengthScale(dom::SVGPathElement::eForTextPath); + return element->GetPathLengthScale(dom::SVGGeometryElement::eForTextPath); } gfxFloat diff --git a/layout/svg/SVGTextFrame.h b/layout/svg/SVGTextFrame.h index e2044e999093..003b325da1d4 100644 --- a/layout/svg/SVGTextFrame.h +++ b/layout/svg/SVGTextFrame.h @@ -34,7 +34,7 @@ class TextRenderedRunIterator; namespace dom { class SVGIRect; -class SVGPathElement; +class SVGGeometryElement; } // namespace dom /** @@ -538,8 +538,8 @@ private: bool ShouldRenderAsPath(nsTextFrame* aFrame, bool& aShouldPaintSVGGlyphs); // Methods to get information for a frame. - mozilla::dom::SVGPathElement* - GetTextPathPathElement(nsIFrame* aTextPathFrame); + mozilla::dom::SVGGeometryElement* + GetTextPathGeometryElement(nsIFrame* aTextPathFrame); already_AddRefed GetTextPath(nsIFrame* aTextPathFrame); gfxFloat GetOffsetScale(nsIFrame* aTextPathFrame); gfxFloat GetStartOffset(nsIFrame* aTextPathFrame); diff --git a/layout/xul/tree/nsITreeView.idl b/layout/xul/tree/nsITreeView.idl index 58f94c50e366..09d23bb79c60 100644 --- a/layout/xul/tree/nsITreeView.idl +++ b/layout/xul/tree/nsITreeView.idl @@ -8,7 +8,6 @@ interface nsITreeBoxObject; interface nsITreeSelection; interface nsITreeColumn; -interface nsIDOMDataTransfer; [scriptable, uuid(091116f0-0bdc-4b32-b9c8-c8d5a37cb088)] interface nsITreeView : nsISupports @@ -76,14 +75,18 @@ interface nsITreeView : nsISupports * the current location. To get the behavior where drops are only allowed on * items, such as the mailNews folder pane, always return false when * the orientation is not DROP_ON. + * + * @param dataTransfer should be a DataTransfer once bug 1444991 is fixed. */ - boolean canDrop(in long index, in long orientation, in nsIDOMDataTransfer dataTransfer); + boolean canDrop(in long index, in long orientation, in nsISupports dataTransfer); /** * Called when the user drops something on this view. The |orientation| param * specifies before/on/after the given |row|. + * + * @param dataTransfer should be a DataTransfer once bug 1444991 is fixed. */ - void drop(in long row, in long orientation, in nsIDOMDataTransfer dataTransfer); + void drop(in long row, in long orientation, in nsISupports dataTransfer); /** * Methods used by the tree to draw thread lines in the tree. diff --git a/layout/xul/tree/nsTreeBodyFrame.cpp b/layout/xul/tree/nsTreeBodyFrame.cpp index 9caf362db142..481c72e094df 100644 --- a/layout/xul/tree/nsTreeBodyFrame.cpp +++ b/layout/xul/tree/nsTreeBodyFrame.cpp @@ -2550,7 +2550,7 @@ static uint32_t GetDropEffect(WidgetGUIEvent* aEvent) uint32_t action = 0; if (dragEvent->mDataTransfer) { - dragEvent->mDataTransfer->GetDropEffectInt(&action); + action = dragEvent->mDataTransfer->DropEffectInt(); } return action; } diff --git a/layout/xul/tree/nsTreeContentView.cpp b/layout/xul/tree/nsTreeContentView.cpp index 2d6b1536b23e..f5096ead5009 100644 --- a/layout/xul/tree/nsTreeContentView.cpp +++ b/layout/xul/tree/nsTreeContentView.cpp @@ -351,7 +351,7 @@ nsTreeContentView::IsSorted(bool *_retval) bool nsTreeContentView::CanDrop(int32_t aRow, int32_t aOrientation, - DataTransfer* aDataTransfer, ErrorResult& aError) + ErrorResult& aError) { if (!IsValidRowIndex(aRow)) { aError.Throw(NS_ERROR_INVALID_ARG); @@ -359,30 +359,43 @@ nsTreeContentView::CanDrop(int32_t aRow, int32_t aOrientation, return false; } +bool +nsTreeContentView::CanDrop(int32_t aRow, int32_t aOrientation, + DataTransfer* aDataTransfer, ErrorResult& aError) +{ + return CanDrop(aRow, aOrientation, aError); +} + NS_IMETHODIMP nsTreeContentView::CanDrop(int32_t aIndex, int32_t aOrientation, - nsIDOMDataTransfer* aDataTransfer, bool *_retval) + nsISupports* aDataTransfer, bool *_retval) { ErrorResult rv; - *_retval = CanDrop(aIndex, aOrientation, DataTransfer::Cast(aDataTransfer), - rv); + *_retval = CanDrop(aIndex, aOrientation, rv); return rv.StealNSResult(); } void -nsTreeContentView::Drop(int32_t aRow, int32_t aOrientation, - DataTransfer* aDataTransfer, ErrorResult& aError) +nsTreeContentView::Drop(int32_t aRow, int32_t aOrientation, ErrorResult& aError) { if (!IsValidRowIndex(aRow)) { aError.Throw(NS_ERROR_INVALID_ARG); } } +void +nsTreeContentView::Drop(int32_t aRow, int32_t aOrientation, + DataTransfer* aDataTransfer, ErrorResult& aError) +{ + Drop(aRow, aOrientation, aError); +} + NS_IMETHODIMP -nsTreeContentView::Drop(int32_t aRow, int32_t aOrientation, nsIDOMDataTransfer* aDataTransfer) +nsTreeContentView::Drop(int32_t aRow, int32_t aOrientation, + nsISupports* aDataTransfer) { ErrorResult rv; - Drop(aRow, aOrientation, DataTransfer::Cast(aDataTransfer), rv); + Drop(aRow, aOrientation, rv); return rv.StealNSResult(); } diff --git a/layout/xul/tree/nsTreeContentView.h b/layout/xul/tree/nsTreeContentView.h index 7b655f9a8e4a..b094493af5a0 100644 --- a/layout/xul/tree/nsTreeContentView.h +++ b/layout/xul/tree/nsTreeContentView.h @@ -167,6 +167,10 @@ class nsTreeContentView final : public nsITreeView, void UpdateParentIndexes(int32_t aIndex, int32_t aSkip, int32_t aCount); + bool CanDrop(int32_t aRow, int32_t aOrientation, + mozilla::ErrorResult& aError); + void Drop(int32_t aRow, int32_t aOrientation, mozilla::ErrorResult& aError); + // Content helpers. mozilla::dom::Element* GetCell(nsIContent* aContainer, nsTreeColumn& aCol); diff --git a/media/webrtc/signaling/gtest/sdp_unittests.cpp b/media/webrtc/signaling/gtest/sdp_unittests.cpp index 6404b3c392ed..eafdbc573fac 100644 --- a/media/webrtc/signaling/gtest/sdp_unittests.cpp +++ b/media/webrtc/signaling/gtest/sdp_unittests.cpp @@ -18,6 +18,7 @@ #include "nsThreadUtils.h" +#include "signaling/src/sdp/RsdparsaSdpParser.h" #include "signaling/src/sdp/SipccSdpParser.h" #include "signaling/src/sdp/SdpMediaSection.h" #include "signaling/src/sdp/SdpAttribute.h" @@ -32,6 +33,8 @@ extern "C" { #endif #define CRLF "\r\n" +#define SKIP_TEST_WITH_RUST_PARSER if (!::testing::get<1>(GetParam())) {return;} + using namespace mozilla; namespace test { @@ -1500,16 +1503,23 @@ TEST_F(SdpTest, parseIceLite) { } class NewSdpTest : public ::testing::Test, - public ::testing::WithParamInterface { + public ::testing::WithParamInterface< + ::testing::tuple > { public: NewSdpTest() {} void ParseSdp(const std::string &sdp, bool expectSuccess = true) { - mSdp = mozilla::Move(mParser.Parse(sdp)); + if (::testing::get<1>(GetParam())) { + mSdpErrorHolder = &mSipccParser; + mSdp = mozilla::Move(mSipccParser.Parse(sdp)); + } else { + mSdpErrorHolder = &mRustParser; + mSdp = mozilla::Move(mRustParser.Parse(sdp)); + } // Are we configured to do a parse and serialize before actually // running the test? - if (GetParam()) { + if (::testing::get<0>(GetParam())) { std::stringstream os; if (expectSuccess) { @@ -1520,7 +1530,11 @@ class NewSdpTest : public ::testing::Test, if (mSdp) { // Serialize and re-parse mSdp->Serialize(os); - mSdp = mozilla::Move(mParser.Parse(os.str())); + if (::testing::get<1>(GetParam())) { + mSdp = mozilla::Move(mSipccParser.Parse(os.str())); + } else { + mSdp = mozilla::Move(mRustParser.Parse(os.str())); + } // Whether we expected the parse to work or not, it should // succeed the second time if it succeeded the first. @@ -1537,7 +1551,7 @@ class NewSdpTest : public ::testing::Test, if (expectSuccess) { ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors(); - ASSERT_EQ(0U, mParser.GetParseErrors().size()) + ASSERT_EQ(0U, mSdpErrorHolder->GetParseErrors().size()) << "Got unexpected parse errors/warnings: " << GetParseErrors(); } @@ -1546,10 +1560,8 @@ class NewSdpTest : public ::testing::Test, // For streaming parse errors std::string GetParseErrors() const { std::stringstream output; - for (auto e = mParser.GetParseErrors().begin(); - e != mParser.GetParseErrors().end(); - ++e) { - output << e->first << ": " << e->second << std::endl; + for (auto e: mSdpErrorHolder->GetParseErrors()) { + output << e.first << ": " << e.second << std::endl; } return output.str(); } @@ -1617,7 +1629,9 @@ class NewSdpTest : public ::testing::Test, ASSERT_EQ(expected, str.str()); } - SipccSdpParser mParser; + SdpErrorHolder* mSdpErrorHolder; + SipccSdpParser mSipccParser; + RsdparsaSdpParser mRustParser; mozilla::UniquePtr mSdp; }; // class NewSdpTest @@ -1627,7 +1641,7 @@ TEST_P(NewSdpTest, CreateDestroy) { TEST_P(NewSdpTest, ParseEmpty) { ParseSdp("", false); ASSERT_FALSE(mSdp); - ASSERT_NE(0U, mParser.GetParseErrors().size()) + ASSERT_NE(0U, mSdpErrorHolder->GetParseErrors().size()) << "Expected at least one parse error."; } @@ -1636,25 +1650,25 @@ const std::string kBadSdp = "This is SDPARTA!!!!"; TEST_P(NewSdpTest, ParseGarbage) { ParseSdp(kBadSdp, false); ASSERT_FALSE(mSdp); - ASSERT_NE(0U, mParser.GetParseErrors().size()) + ASSERT_NE(0U, mSdpErrorHolder->GetParseErrors().size()) << "Expected at least one parse error."; } TEST_P(NewSdpTest, ParseGarbageTwice) { ParseSdp(kBadSdp, false); ASSERT_FALSE(mSdp); - size_t errorCount = mParser.GetParseErrors().size(); + size_t errorCount = mSdpErrorHolder->GetParseErrors().size(); ASSERT_NE(0U, errorCount) << "Expected at least one parse error."; ParseSdp(kBadSdp, false); ASSERT_FALSE(mSdp); - ASSERT_EQ(errorCount, mParser.GetParseErrors().size()) + ASSERT_EQ(errorCount, mSdpErrorHolder->GetParseErrors().size()) << "Expected same error count for same SDP."; } TEST_P(NewSdpTest, ParseMinimal) { ParseSdp(kVideoSdp); - ASSERT_EQ(0U, mParser.GetParseErrors().size()) << + ASSERT_EQ(0U, mSdpErrorHolder->GetParseErrors().size()) << "Got parse errors: " << GetParseErrors(); } @@ -1771,6 +1785,7 @@ TEST_P(NewSdpTest, CheckMediaSectionGetMissingBandwidth) { TEST_P(NewSdpTest, CheckMediaSectionGetBandwidth) { ParseSdp("v=0\r\n" "o=- 4294967296 2 IN IP4 127.0.0.1\r\n" + "s=SIP Call\r\n" "c=IN IP4 198.51.100.7\r\n" "t=0 0\r\n" "m=video 56436 RTP/SAVPF 120\r\n" @@ -1880,7 +1895,6 @@ const std::string kBasicAudioVideoOffer = "m=audio 9 RTP/SAVPF 0" CRLF "a=mid:third" CRLF "a=rtpmap:0 PCMU/8000" CRLF -"a=ice-lite" CRLF "a=ice-options:foo bar" CRLF "a=msid:noappdata" CRLF "a=bundle-only" CRLF; @@ -1890,6 +1904,7 @@ TEST_P(NewSdpTest, BasicAudioVideoSdpParse) { } TEST_P(NewSdpTest, CheckRemoveFmtp) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918 ParseSdp(kBasicAudioVideoOffer); ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors(); ASSERT_EQ(3U, mSdp->GetMediaSectionCount()) @@ -2042,6 +2057,7 @@ TEST_P(NewSdpTest, CheckIdentity) { } TEST_P(NewSdpTest, CheckDtlsMessage) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432920 ParseSdp(kBasicAudioVideoOffer); ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors(); ASSERT_TRUE(mSdp->GetAttributeList().HasAttribute( @@ -2242,6 +2258,7 @@ static const std::string kAudioWithTelephoneEvent = "a=rtpmap:101 telephone-event/8000" CRLF; TEST_P(NewSdpTest, CheckTelephoneEventNoFmtp) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918 ParseSdp(kAudioWithTelephoneEvent); ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors(); ASSERT_EQ(1U, mSdp->GetMediaSectionCount()) @@ -2260,6 +2277,7 @@ TEST_P(NewSdpTest, CheckTelephoneEventNoFmtp) { } TEST_P(NewSdpTest, CheckTelephoneEventWithDefaultEvents) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918 ParseSdp(kAudioWithTelephoneEvent + "a=fmtp:101 0-15" CRLF); ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors(); @@ -2270,6 +2288,7 @@ TEST_P(NewSdpTest, CheckTelephoneEventWithDefaultEvents) { } TEST_P(NewSdpTest, CheckTelephoneEventWithBadCharacter) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918 ParseSdp(kAudioWithTelephoneEvent + "a=fmtp:101 0-5." CRLF); ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors(); @@ -2280,6 +2299,7 @@ TEST_P(NewSdpTest, CheckTelephoneEventWithBadCharacter) { } TEST_P(NewSdpTest, CheckTelephoneEventIncludingCommas) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918 ParseSdp(kAudioWithTelephoneEvent + "a=fmtp:101 0-15,66,67" CRLF); ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors(); @@ -2290,6 +2310,7 @@ TEST_P(NewSdpTest, CheckTelephoneEventIncludingCommas) { } TEST_P(NewSdpTest, CheckTelephoneEventComplexEvents) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918 ParseSdp(kAudioWithTelephoneEvent + "a=fmtp:101 0,1,2-4,5-15,66,67" CRLF); ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors(); @@ -2300,6 +2321,7 @@ TEST_P(NewSdpTest, CheckTelephoneEventComplexEvents) { } TEST_P(NewSdpTest, CheckTelephoneEventNoHyphen) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918 ParseSdp(kAudioWithTelephoneEvent + "a=fmtp:101 5,6,7" CRLF); ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors(); @@ -2310,6 +2332,7 @@ TEST_P(NewSdpTest, CheckTelephoneEventNoHyphen) { } TEST_P(NewSdpTest, CheckTelephoneEventOnlyZero) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918 ParseSdp(kAudioWithTelephoneEvent + "a=fmtp:101 0" CRLF); ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors(); @@ -2320,6 +2343,7 @@ TEST_P(NewSdpTest, CheckTelephoneEventOnlyZero) { } TEST_P(NewSdpTest, CheckTelephoneEventOnlyOne) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918 ParseSdp(kAudioWithTelephoneEvent + "a=fmtp:101 1" CRLF); ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors(); @@ -2330,6 +2354,7 @@ TEST_P(NewSdpTest, CheckTelephoneEventOnlyOne) { } TEST_P(NewSdpTest, CheckTelephoneEventBadThreeDigit) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918 ParseSdp(kAudioWithTelephoneEvent + "a=fmtp:101 123" CRLF); ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors(); @@ -2341,6 +2366,7 @@ TEST_P(NewSdpTest, CheckTelephoneEventBadThreeDigit) { } TEST_P(NewSdpTest, CheckTelephoneEventBadThreeDigitWithHyphen) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918 ParseSdp(kAudioWithTelephoneEvent + "a=fmtp:101 0-123" CRLF); ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors(); @@ -2352,6 +2378,7 @@ TEST_P(NewSdpTest, CheckTelephoneEventBadThreeDigitWithHyphen) { } TEST_P(NewSdpTest, CheckTelephoneEventBadLeadingHyphen) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918 ParseSdp(kAudioWithTelephoneEvent + "a=fmtp:101 -12" CRLF); ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors(); @@ -2373,6 +2400,7 @@ TEST_P(NewSdpTest, CheckTelephoneEventBadTrailingHyphenInMiddle) { } TEST_P(NewSdpTest, CheckTelephoneEventBadLeadingComma) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918 ParseSdp(kAudioWithTelephoneEvent + "a=fmtp:101 ,2,3" CRLF); ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors(); @@ -2384,6 +2412,7 @@ TEST_P(NewSdpTest, CheckTelephoneEventBadLeadingComma) { } TEST_P(NewSdpTest, CheckTelephoneEventBadMultipleLeadingComma) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918 ParseSdp(kAudioWithTelephoneEvent + "a=fmtp:101 ,,,2,3" CRLF); ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors(); @@ -2395,6 +2424,7 @@ TEST_P(NewSdpTest, CheckTelephoneEventBadMultipleLeadingComma) { } TEST_P(NewSdpTest, CheckTelephoneEventBadConsecutiveCommas) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918 ParseSdp(kAudioWithTelephoneEvent + "a=fmtp:101 1,,,,,,,,3" CRLF); ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors(); @@ -2406,6 +2436,7 @@ TEST_P(NewSdpTest, CheckTelephoneEventBadConsecutiveCommas) { } TEST_P(NewSdpTest, CheckTelephoneEventBadTrailingComma) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918 ParseSdp(kAudioWithTelephoneEvent + "a=fmtp:101 1,2,3," CRLF); ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors(); @@ -2417,6 +2448,7 @@ TEST_P(NewSdpTest, CheckTelephoneEventBadTrailingComma) { } TEST_P(NewSdpTest, CheckTelephoneEventBadTwoHyphens) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918 ParseSdp(kAudioWithTelephoneEvent + "a=fmtp:101 1-2-3" CRLF); ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors(); @@ -2428,6 +2460,7 @@ TEST_P(NewSdpTest, CheckTelephoneEventBadTwoHyphens) { } TEST_P(NewSdpTest, CheckTelephoneEventBadSixDigit) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918 ParseSdp(kAudioWithTelephoneEvent + "a=fmtp:101 112233" CRLF); ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors(); @@ -2439,6 +2472,7 @@ TEST_P(NewSdpTest, CheckTelephoneEventBadSixDigit) { } TEST_P(NewSdpTest, CheckTelephoneEventBadRangeReversed) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918 ParseSdp(kAudioWithTelephoneEvent + "a=fmtp:101 33-2" CRLF); ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors(); @@ -2468,6 +2502,7 @@ static const std::string kVideoWithRedAndUlpfecSdp = "a=rtpmap:123 ulpfec/90000" CRLF; TEST_P(NewSdpTest, CheckRedNoFmtp) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918 ParseSdp(kVideoWithRedAndUlpfecSdp); ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors(); ASSERT_EQ(1U, mSdp->GetMediaSectionCount()) @@ -2486,8 +2521,9 @@ TEST_P(NewSdpTest, CheckRedNoFmtp) { } TEST_P(NewSdpTest, CheckRedEmptyFmtp) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918 // if serializing and re-parsing, we expect errors - if (GetParam()) { + if (::testing::get<0>(GetParam())) { ParseSdp(kVideoWithRedAndUlpfecSdp + "a=fmtp:122" CRLF); } else { ParseSdp(kVideoWithRedAndUlpfecSdp + "a=fmtp:122" CRLF, false); @@ -2511,6 +2547,7 @@ TEST_P(NewSdpTest, CheckRedEmptyFmtp) { } TEST_P(NewSdpTest, CheckRedFmtpWith2Codecs) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918 ParseSdp(kVideoWithRedAndUlpfecSdp + "a=fmtp:122 120/121" CRLF); ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors(); ASSERT_EQ(1U, mSdp->GetMediaSectionCount()) @@ -2535,6 +2572,7 @@ TEST_P(NewSdpTest, CheckRedFmtpWith2Codecs) { } TEST_P(NewSdpTest, CheckRedFmtpWith3Codecs) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918 ParseSdp(kVideoWithRedAndUlpfecSdp + "a=fmtp:122 120/121/123" CRLF); ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors(); ASSERT_EQ(1U, mSdp->GetMediaSectionCount()) @@ -2625,10 +2663,10 @@ const std::string kH264AudioVideoOffer = "m=audio 9 RTP/SAVPF 0" CRLF "a=mid:third" CRLF "a=rtpmap:0 PCMU/8000" CRLF -"a=ice-lite" CRLF "a=msid:noappdata" CRLF; TEST_P(NewSdpTest, CheckFormatParameters) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918 ParseSdp(kH264AudioVideoOffer); ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors(); ASSERT_EQ(3U, mSdp->GetMediaSectionCount()) @@ -2781,6 +2819,7 @@ TEST_P(NewSdpTest, CheckDirections) { } TEST_P(NewSdpTest, CheckCandidates) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432920 ParseSdp(kBasicAudioVideoOffer); ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors(); ASSERT_EQ(3U, mSdp->GetMediaSectionCount()) << "Wrong number of media sections"; @@ -2921,6 +2960,8 @@ TEST_P(NewSdpTest, CheckMediaLevelIcePwd) { } TEST_P(NewSdpTest, CheckGroups) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1444354 + ParseSdp(kBasicAudioVideoOffer); const SdpGroupAttributeList& group = mSdp->GetAttributeList().GetGroup(); const SdpGroupAttributeList::Group& group1 = group.mGroups[0]; @@ -3008,12 +3049,14 @@ const std::string kBasicAudioVideoDataOffer = "a=setup:actpass" CRLF; TEST_P(NewSdpTest, BasicAudioVideoDataSdpParse) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432922 ParseSdp(kBasicAudioVideoDataOffer); - ASSERT_EQ(0U, mParser.GetParseErrors().size()) << + ASSERT_EQ(0U, mSdpErrorHolder->GetParseErrors().size()) << "Got parse errors: " << GetParseErrors(); } TEST_P(NewSdpTest, CheckApplicationParameters) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432922 ParseSdp(kBasicAudioVideoDataOffer); ASSERT_TRUE(!!mSdp); ASSERT_EQ(3U, mSdp->GetMediaSectionCount()) << "Wrong number of media sections"; @@ -3044,6 +3087,7 @@ TEST_P(NewSdpTest, CheckApplicationParameters) { } TEST_P(NewSdpTest, CheckExtmap) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432922 ParseSdp(kBasicAudioVideoDataOffer); ASSERT_TRUE(!!mSdp); ASSERT_EQ(3U, mSdp->GetMediaSectionCount()) << "Wrong number of media sections"; @@ -3079,6 +3123,7 @@ TEST_P(NewSdpTest, CheckExtmap) { } TEST_P(NewSdpTest, CheckRtcpFb) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432922 ParseSdp(kBasicAudioVideoDataOffer); ASSERT_TRUE(!!mSdp); ASSERT_EQ(3U, mSdp->GetMediaSectionCount()) << "Wrong number of media sections"; @@ -3180,6 +3225,7 @@ TEST_P(NewSdpTest, CheckImageattr) TEST_P(NewSdpTest, CheckSimulcast) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432920 ParseSdp(kBasicAudioVideoOffer); ASSERT_TRUE(!!mSdp); ASSERT_EQ(3U, mSdp->GetMediaSectionCount()) << "Wrong number of media sections"; @@ -3207,6 +3253,7 @@ TEST_P(NewSdpTest, CheckSimulcast) } TEST_P(NewSdpTest, CheckSctpmap) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432922 ParseSdp(kBasicAudioVideoDataOffer); ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors(); ASSERT_EQ(3U, mSdp->GetMediaSectionCount()) @@ -3250,7 +3297,8 @@ TEST_P(NewSdpTest, NewSctpportSdpParse) { INSTANTIATE_TEST_CASE_P(RoundTripSerialize, NewSdpTest, - ::testing::Values(false, true)); + ::testing::Combine(::testing::Bool(), + ::testing::Bool())); const std::string kCandidateInSessionSDP = "v=0" CRLF @@ -3701,7 +3749,8 @@ const std::string kMalformedImageattr = TEST_P(NewSdpTest, CheckMalformedImageattr) { - if (GetParam()) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432930 + if (::testing::get<0>(GetParam())) { // Don't do a parse/serialize before running this test return; } @@ -3711,6 +3760,7 @@ TEST_P(NewSdpTest, CheckMalformedImageattr) } TEST_P(NewSdpTest, ParseInvalidSimulcastNoSuchSendRid) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432931 ParseSdp("v=0" CRLF "o=- 4294967296 2 IN IP4 127.0.0.1" CRLF "s=SIP Call" CRLF @@ -3726,6 +3776,7 @@ TEST_P(NewSdpTest, ParseInvalidSimulcastNoSuchSendRid) { } TEST_P(NewSdpTest, ParseInvalidSimulcastNoSuchRecvRid) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432932 ParseSdp("v=0" CRLF "o=- 4294967296 2 IN IP4 127.0.0.1" CRLF "s=SIP Call" CRLF @@ -3741,6 +3792,7 @@ TEST_P(NewSdpTest, ParseInvalidSimulcastNoSuchRecvRid) { } TEST_P(NewSdpTest, ParseInvalidSimulcastNoSuchPt) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432933 ParseSdp("v=0" CRLF "o=- 4294967296 2 IN IP4 127.0.0.1" CRLF "s=SIP Call" CRLF @@ -3756,6 +3808,7 @@ TEST_P(NewSdpTest, ParseInvalidSimulcastNoSuchPt) { } TEST_P(NewSdpTest, ParseInvalidSimulcastNotSending) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432934 ParseSdp("v=0" CRLF "o=- 4294967296 2 IN IP4 127.0.0.1" CRLF "s=SIP Call" CRLF @@ -3771,6 +3824,7 @@ TEST_P(NewSdpTest, ParseInvalidSimulcastNotSending) { } TEST_P(NewSdpTest, ParseInvalidSimulcastNotReceiving) { + SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432936 ParseSdp("v=0" CRLF "o=- 4294967296 2 IN IP4 127.0.0.1" CRLF "s=SIP Call" CRLF diff --git a/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp b/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp index cca6a113e7ad..57b120e4bbb2 100644 --- a/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp +++ b/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp @@ -18,12 +18,14 @@ #include "mozilla/Move.h" #include "mozilla/UniquePtr.h" +#include "mozilla/Preferences.h" #include "mozilla/Telemetry.h" #include "webrtc/config.h" #include "signaling/src/jsep/JsepTrack.h" #include "signaling/src/jsep/JsepTransport.h" +#include "signaling/src/sdp/RsdparsaSdpParser.h" #include "signaling/src/sdp/Sdp.h" #include "signaling/src/sdp/SipccSdp.h" #include "signaling/src/sdp/SipccSdpParser.h" @@ -65,6 +67,8 @@ JsepSessionImpl::Init() SetupDefaultCodecs(); SetupDefaultRtpExtensions(); + mRunRustParser = Preferences::GetBool("media.webrtc.rsdparsa_enabled", false); + return NS_OK; } @@ -1259,10 +1263,13 @@ JsepSessionImpl::CopyPreviousMsid(const Sdp& oldLocal, Sdp* newLocal) nsresult JsepSessionImpl::ParseSdp(const std::string& sdp, UniquePtr* parsedp) { - UniquePtr parsed = mParser.Parse(sdp); + UniquePtr parsed = mSipccParser.Parse(sdp); + if (mRunRustParser) { + UniquePtr rustParsed = mRsdparsaParser.Parse(sdp); + } if (!parsed) { std::string error = "Failed to parse SDP: "; - mSdpHelper.appendSdpParseErrors(mParser.GetParseErrors(), &error); + mSdpHelper.appendSdpParseErrors(mSipccParser.GetParseErrors(), &error); JSEP_SET_ERROR(error); return NS_ERROR_INVALID_ARG; } diff --git a/media/webrtc/signaling/src/jsep/JsepSessionImpl.h b/media/webrtc/signaling/src/jsep/JsepSessionImpl.h index 15fcbde09769..d9148d66c873 100644 --- a/media/webrtc/signaling/src/jsep/JsepSessionImpl.h +++ b/media/webrtc/signaling/src/jsep/JsepSessionImpl.h @@ -14,6 +14,7 @@ #include "signaling/src/jsep/JsepTrack.h" #include "signaling/src/jsep/JsepTransceiver.h" #include "signaling/src/jsep/SsrcGenerator.h" +#include "signaling/src/sdp/RsdparsaSdpParser.h" #include "signaling/src/sdp/SipccSdpParser.h" #include "signaling/src/sdp/SdpHelper.h" #include "signaling/src/common/PtrVector.h" @@ -283,9 +284,11 @@ private: UniquePtr mPendingRemoteDescription; PtrVector mSupportedCodecs; std::string mLastError; - SipccSdpParser mParser; + SipccSdpParser mSipccParser; SdpHelper mSdpHelper; SsrcGenerator mSsrcGenerator; + bool mRunRustParser; + RsdparsaSdpParser mRsdparsaParser; }; } // namespace mozilla diff --git a/media/webrtc/signaling/src/sdp/RsdparsaSdp.cpp b/media/webrtc/signaling/src/sdp/RsdparsaSdp.cpp new file mode 100644 index 000000000000..c3eb0768e202 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/RsdparsaSdp.cpp @@ -0,0 +1,120 @@ +/* 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/. */ + +#include "signaling/src/sdp/RsdparsaSdp.h" + +#include +#include "mozilla/UniquePtr.h" +#include "mozilla/Assertions.h" +#include "nsError.h" + + +#include "signaling/src/sdp/SdpErrorHolder.h" +#include "signaling/src/sdp/RsdparsaSdpInc.h" +#include "signaling/src/sdp/RsdparsaSdpMediaSection.h" + +#ifdef CRLF +#undef CRLF +#endif +#define CRLF "\r\n" + +namespace mozilla +{ + +RsdparsaSdp::RsdparsaSdp(RsdparsaSessionHandle session, const SdpOrigin& origin) + : mSession(Move(session)) + , mOrigin(origin) +{ + RsdparsaSessionHandle attributeSession(sdp_new_reference(mSession.get())); + mAttributeList.reset(new RsdparsaSdpAttributeList(Move(attributeSession))); + + size_t section_count = sdp_media_section_count(mSession.get()); + for (size_t level = 0; level < section_count; level++) { + RustMediaSection* mediaSection = sdp_get_media_section(mSession.get(), + level); + if (!mediaSection) { + MOZ_ASSERT(false, "sdp_get_media_section failed because level was out of" + " bounds, but we did a bounds check!"); + break; + } + RsdparsaSessionHandle newSession(sdp_new_reference(mSession.get())); + RsdparsaSdpMediaSection* sdpMediaSection; + sdpMediaSection = new RsdparsaSdpMediaSection(level, + Move(newSession), + mediaSection, + mAttributeList.get()); + mMediaSections.values.push_back(sdpMediaSection); + } +} + +const SdpOrigin& +RsdparsaSdp::GetOrigin() const +{ + return mOrigin; +} + +uint32_t +RsdparsaSdp::GetBandwidth(const std::string& type) const +{ + return get_sdp_bandwidth(mSession.get(), type.c_str()); +} + +const SdpMediaSection& +RsdparsaSdp::GetMediaSection(size_t level) const +{ + if (level > mMediaSections.values.size()) { + MOZ_CRASH(); + } + return *mMediaSections.values[level]; +} + +SdpMediaSection& +RsdparsaSdp::GetMediaSection(size_t level) +{ + if (level > mMediaSections.values.size()) { + MOZ_CRASH(); + } + return *mMediaSections.values[level]; +} + +SdpMediaSection& +RsdparsaSdp::AddMediaSection(SdpMediaSection::MediaType mediaType, + SdpDirectionAttribute::Direction dir, + uint16_t port, + SdpMediaSection::Protocol protocol, + sdp::AddrType addrType, const std::string& addr) +{ + //TODO: See Bug 1436080 + MOZ_CRASH("Method not implemented"); +} + +void +RsdparsaSdp::Serialize(std::ostream& os) const +{ + os << "v=0" << CRLF << mOrigin << "s=-" << CRLF; + + // We don't support creating i=, u=, e=, p= + // We don't generate c= at the session level (only in media) + + BandwidthVec* bwVec = sdp_get_session_bandwidth_vec(mSession.get()); + char *bwString = sdp_serialize_bandwidth(bwVec); + if (bwString) { + os << bwString; + sdp_free_string(bwString); + } + + os << "t=0 0" << CRLF; + + // We don't support r= or z= + + // attributes + os << *mAttributeList; + + // media sections + for (const SdpMediaSection* msection : mMediaSections.values) { + os << *msection; + } +} + +} // namespace mozilla diff --git a/media/webrtc/signaling/src/sdp/RsdparsaSdp.h b/media/webrtc/signaling/src/sdp/RsdparsaSdp.h new file mode 100644 index 000000000000..7fa7cd0992b0 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/RsdparsaSdp.h @@ -0,0 +1,82 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set 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/. */ + +#ifndef _RSDPARSA_SDP_H_ +#define _RSDPARSA_SDP_H_ + +#include "mozilla/UniquePtr.h" +#include "mozilla/Attributes.h" + +#include "signaling/src/common/PtrVector.h" + +#include "signaling/src/sdp/Sdp.h" + +#include "signaling/src/sdp/RsdparsaSdpMediaSection.h" +#include "signaling/src/sdp/RsdparsaSdpAttributeList.h" +#include "signaling/src/sdp/RsdparsaSdpInc.h" +#include "signaling/src/sdp/RsdparsaSdpGlue.h" + + +namespace mozilla +{ + +class RsdparsaSdpParser; +class SdpErrorHolder; + +class RsdparsaSdp final : public Sdp +{ + friend class RsdparsaSdpParser; + +public: + explicit RsdparsaSdp(RsdparsaSessionHandle session, const SdpOrigin& origin); + + const SdpOrigin& GetOrigin() const override; + + // Note: connection information is always retrieved from media sections + uint32_t GetBandwidth(const std::string& type) const override; + + size_t + GetMediaSectionCount() const override + { + return sdp_media_section_count(mSession.get()); + } + + const SdpAttributeList& + GetAttributeList() const override + { + return *mAttributeList; + } + + SdpAttributeList& + GetAttributeList() override + { + return *mAttributeList; + } + + const SdpMediaSection& GetMediaSection(size_t level) const + override; + + SdpMediaSection& GetMediaSection(size_t level) override; + + SdpMediaSection& AddMediaSection( + SdpMediaSection::MediaType media, SdpDirectionAttribute::Direction dir, + uint16_t port, SdpMediaSection::Protocol proto, sdp::AddrType addrType, + const std::string& addr) override; + + void Serialize(std::ostream&) const override; + +private: + RsdparsaSdp() : mOrigin("", 0, 0, sdp::kIPv4, "") {} + + RsdparsaSessionHandle mSession; + SdpOrigin mOrigin; + UniquePtr mAttributeList; + PtrVector mMediaSections; +}; + +} // namespace mozilla + +#endif diff --git a/media/webrtc/signaling/src/sdp/RsdparsaSdpAttributeList.cpp b/media/webrtc/signaling/src/sdp/RsdparsaSdpAttributeList.cpp new file mode 100644 index 000000000000..aa5f4bb9544c --- /dev/null +++ b/media/webrtc/signaling/src/sdp/RsdparsaSdpAttributeList.cpp @@ -0,0 +1,1023 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set 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/. */ + +#include "nsCRT.h" + +#include "signaling/src/sdp/RsdparsaSdpAttributeList.h" +#include "signaling/src/sdp/RsdparsaSdpInc.h" +#include "signaling/src/sdp/RsdparsaSdpGlue.h" + +#include +#include "mozilla/Assertions.h" + +namespace mozilla +{ + +const std::string RsdparsaSdpAttributeList::kEmptyString = ""; + +RsdparsaSdpAttributeList::~RsdparsaSdpAttributeList() +{ + for (size_t i = 0; i < kNumAttributeTypes; ++i) { + delete mAttributes[i]; + } +} + +bool +RsdparsaSdpAttributeList::HasAttribute(AttributeType type, + bool sessionFallback) const +{ + return !!GetAttribute(type, sessionFallback); +} + +const SdpAttribute* +RsdparsaSdpAttributeList::GetAttribute(AttributeType type, + bool sessionFallback) const +{ + const SdpAttribute* value = mAttributes[static_cast(type)]; + // Only do fallback when the attribute can appear at both the media and + // session level + if (!value && !AtSessionLevel() && sessionFallback && + SdpAttribute::IsAllowedAtSessionLevel(type) && + SdpAttribute::IsAllowedAtMediaLevel(type)) { + return mSessionAttributes->GetAttribute(type, false); + } + return value; +} + +void +RsdparsaSdpAttributeList::RemoveAttribute(AttributeType type) +{ + delete mAttributes[static_cast(type)]; + mAttributes[static_cast(type)] = nullptr; +} + +void +RsdparsaSdpAttributeList::Clear() +{ + for (size_t i = 0; i < kNumAttributeTypes; ++i) { + RemoveAttribute(static_cast(i)); + } +} + +uint32_t +RsdparsaSdpAttributeList::Count() const +{ + uint32_t count = 0; + for (size_t i = 0; i < kNumAttributeTypes; ++i) { + if (mAttributes[i]) { + count++; + } + } + return count; +} + +void +RsdparsaSdpAttributeList::SetAttribute(SdpAttribute* attr) +{ + if (!IsAllowedHere(attr->GetType())) { + MOZ_ASSERT(false, "This type of attribute is not allowed here"); + delete attr; + return; + } + RemoveAttribute(attr->GetType()); + mAttributes[attr->GetType()] = attr; +} + +const std::vector& +RsdparsaSdpAttributeList::GetCandidate() const +{ + if (!HasAttribute(SdpAttribute::kCandidateAttribute)) { + MOZ_CRASH(); + } + + return static_cast( + GetAttribute(SdpAttribute::kCandidateAttribute))->mValues; +} + +const SdpConnectionAttribute& +RsdparsaSdpAttributeList::GetConnection() const +{ + if (!HasAttribute(SdpAttribute::kConnectionAttribute)) { + MOZ_CRASH(); + } + + return *static_cast( + GetAttribute(SdpAttribute::kConnectionAttribute)); +} + +SdpDirectionAttribute::Direction +RsdparsaSdpAttributeList::GetDirection() const +{ + if (!HasAttribute(SdpAttribute::kDirectionAttribute)) { + MOZ_CRASH(); + } + + const SdpAttribute* attr = GetAttribute(SdpAttribute::kDirectionAttribute); + return static_cast(attr)->mValue; +} + +const SdpDtlsMessageAttribute& +RsdparsaSdpAttributeList::GetDtlsMessage() const +{ + if (!HasAttribute(SdpAttribute::kDtlsMessageAttribute)) { + MOZ_CRASH(); + } + const SdpAttribute* attr = GetAttribute(SdpAttribute::kDtlsMessageAttribute); + return *static_cast(attr); +} + +const SdpExtmapAttributeList& +RsdparsaSdpAttributeList::GetExtmap() const +{ + if (!HasAttribute(SdpAttribute::kExtmapAttribute)) { + MOZ_CRASH(); + } + + return *static_cast( + GetAttribute(SdpAttribute::kExtmapAttribute)); +} + +const SdpFingerprintAttributeList& +RsdparsaSdpAttributeList::GetFingerprint() const +{ + if (!HasAttribute(SdpAttribute::kFingerprintAttribute)) { + MOZ_CRASH(); + } + const SdpAttribute* attr = GetAttribute(SdpAttribute::kFingerprintAttribute); + return *static_cast(attr); +} + +const SdpFmtpAttributeList& +RsdparsaSdpAttributeList::GetFmtp() const +{ + if (!HasAttribute(SdpAttribute::kFmtpAttribute)) { + MOZ_CRASH(); + } + + return *static_cast( + GetAttribute(SdpAttribute::kFmtpAttribute)); +} + +const SdpGroupAttributeList& +RsdparsaSdpAttributeList::GetGroup() const +{ + if (!HasAttribute(SdpAttribute::kGroupAttribute)) { + MOZ_CRASH(); + } + + return *static_cast( + GetAttribute(SdpAttribute::kGroupAttribute)); +} + +const SdpOptionsAttribute& +RsdparsaSdpAttributeList::GetIceOptions() const +{ + if (!HasAttribute(SdpAttribute::kIceOptionsAttribute)) { + MOZ_CRASH(); + } + + const SdpAttribute* attr = GetAttribute(SdpAttribute::kIceOptionsAttribute); + return *static_cast(attr); +} + +const std::string& +RsdparsaSdpAttributeList::GetIcePwd() const +{ + if (!HasAttribute(SdpAttribute::kIcePwdAttribute)) { + return kEmptyString; + } + const SdpAttribute* attr = GetAttribute(SdpAttribute::kIcePwdAttribute); + return static_cast(attr)->mValue; +} + +const std::string& +RsdparsaSdpAttributeList::GetIceUfrag() const +{ + if (!HasAttribute(SdpAttribute::kIceUfragAttribute)) { + return kEmptyString; + } + const SdpAttribute* attr = GetAttribute(SdpAttribute::kIceUfragAttribute); + return static_cast(attr)->mValue; +} + +const std::string& +RsdparsaSdpAttributeList::GetIdentity() const +{ + if (!HasAttribute(SdpAttribute::kIdentityAttribute)) { + return kEmptyString; + } + const SdpAttribute* attr = GetAttribute(SdpAttribute::kIdentityAttribute); + return static_cast(attr)->mValue; +} + +const SdpImageattrAttributeList& +RsdparsaSdpAttributeList::GetImageattr() const +{ + if (!HasAttribute(SdpAttribute::kImageattrAttribute)) { + MOZ_CRASH(); + } + const SdpAttribute* attr = GetAttribute(SdpAttribute::kImageattrAttribute); + return *static_cast(attr); +} + +const SdpSimulcastAttribute& +RsdparsaSdpAttributeList::GetSimulcast() const +{ + if (!HasAttribute(SdpAttribute::kSimulcastAttribute)) { + MOZ_CRASH(); + } + const SdpAttribute* attr = GetAttribute(SdpAttribute::kSimulcastAttribute); + return *static_cast(attr); +} + +const std::string& +RsdparsaSdpAttributeList::GetLabel() const +{ + if (!HasAttribute(SdpAttribute::kLabelAttribute)) { + return kEmptyString; + } + const SdpAttribute* attr = GetAttribute(SdpAttribute::kLabelAttribute); + return static_cast(attr)->mValue; +} + +uint32_t +RsdparsaSdpAttributeList::GetMaxptime() const +{ + if (!HasAttribute(SdpAttribute::kMaxptimeAttribute)) { + MOZ_CRASH(); + } + const SdpAttribute* attr = GetAttribute(SdpAttribute::kMaxptimeAttribute); + return static_cast(attr)->mValue; +} + +const std::string& +RsdparsaSdpAttributeList::GetMid() const +{ + if (!HasAttribute(SdpAttribute::kMidAttribute)) { + return kEmptyString; + } + const SdpAttribute* attr = GetAttribute(SdpAttribute::kMidAttribute); + return static_cast(attr)->mValue; +} + +const SdpMsidAttributeList& +RsdparsaSdpAttributeList::GetMsid() const +{ + if (!HasAttribute(SdpAttribute::kMsidAttribute)) { + MOZ_CRASH(); + } + const SdpAttribute* attr = GetAttribute(SdpAttribute::kMsidAttribute); + return *static_cast(attr); +} + +const SdpMsidSemanticAttributeList& +RsdparsaSdpAttributeList::GetMsidSemantic() const +{ + if (!HasAttribute(SdpAttribute::kMsidSemanticAttribute)) { + MOZ_CRASH(); + } + const SdpAttribute* attr = GetAttribute(SdpAttribute::kMsidSemanticAttribute); + return *static_cast(attr); +} + +const SdpRidAttributeList& +RsdparsaSdpAttributeList::GetRid() const +{ + if (!HasAttribute(SdpAttribute::kRidAttribute)) { + MOZ_CRASH(); + } + const SdpAttribute* attr = GetAttribute(SdpAttribute::kRidAttribute); + return *static_cast(attr); +} + +uint32_t +RsdparsaSdpAttributeList::GetPtime() const +{ + if (!HasAttribute(SdpAttribute::kPtimeAttribute)) { + MOZ_CRASH(); + } + const SdpAttribute* attr = GetAttribute(SdpAttribute::kPtimeAttribute); + return static_cast(attr)->mValue; +} + +const SdpRtcpAttribute& +RsdparsaSdpAttributeList::GetRtcp() const +{ + if (!HasAttribute(SdpAttribute::kRtcpAttribute)) { + MOZ_CRASH(); + } + const SdpAttribute* attr = GetAttribute(SdpAttribute::kRtcpAttribute); + return *static_cast(attr); +} + +const SdpRtcpFbAttributeList& +RsdparsaSdpAttributeList::GetRtcpFb() const +{ + if (!HasAttribute(SdpAttribute::kRtcpFbAttribute)) { + MOZ_CRASH(); + } + const SdpAttribute* attr = GetAttribute(SdpAttribute::kRtcpFbAttribute); + return *static_cast(attr); +} + +const SdpRemoteCandidatesAttribute& +RsdparsaSdpAttributeList::GetRemoteCandidates() const +{ + MOZ_CRASH("Not yet implemented"); +} + +const SdpRtpmapAttributeList& +RsdparsaSdpAttributeList::GetRtpmap() const +{ + if (!HasAttribute(SdpAttribute::kRtpmapAttribute)) { + MOZ_CRASH(); + } + const SdpAttribute* attr = GetAttribute(SdpAttribute::kRtpmapAttribute); + return *static_cast(attr); +} + +const SdpSctpmapAttributeList& +RsdparsaSdpAttributeList::GetSctpmap() const +{ + if (!HasAttribute(SdpAttribute::kSctpmapAttribute)) { + MOZ_CRASH(); + } + const SdpAttribute* attr = GetAttribute(SdpAttribute::kSctpmapAttribute); + return *static_cast(attr); +} + +uint32_t +RsdparsaSdpAttributeList::GetSctpPort() const +{ + if (!HasAttribute(SdpAttribute::kSctpPortAttribute)) { + MOZ_CRASH(); + } + + const SdpAttribute* attr = GetAttribute(SdpAttribute::kSctpPortAttribute); + return static_cast(attr)->mValue; +} + +uint32_t +RsdparsaSdpAttributeList::GetMaxMessageSize() const +{ + if (!HasAttribute(SdpAttribute::kMaxMessageSizeAttribute)) { + MOZ_CRASH(); + } + + const SdpAttribute* attr = GetAttribute(SdpAttribute::kMaxMessageSizeAttribute); + return static_cast(attr)->mValue; +} + +const SdpSetupAttribute& +RsdparsaSdpAttributeList::GetSetup() const +{ + if (!HasAttribute(SdpAttribute::kSetupAttribute)) { + MOZ_CRASH(); + } + const SdpAttribute* attr = GetAttribute(SdpAttribute::kSetupAttribute); + return *static_cast(attr); +} + +const SdpSsrcAttributeList& +RsdparsaSdpAttributeList::GetSsrc() const +{ + if (!HasAttribute(SdpAttribute::kSsrcAttribute)) { + MOZ_CRASH(); + } + const SdpAttribute* attr = GetAttribute(SdpAttribute::kSsrcAttribute); + return *static_cast(attr); +} + +const SdpSsrcGroupAttributeList& +RsdparsaSdpAttributeList::GetSsrcGroup() const +{ + // TODO: See Bug 1437166. + MOZ_CRASH("Not yet implemented"); +} + +void +RsdparsaSdpAttributeList::LoadAttribute(RustAttributeList *attributeList, + AttributeType type) +{ + if(!mAttributes[type]) { + switch(type) { + case SdpAttribute::kIceUfragAttribute: + LoadIceUfrag(attributeList); + return; + case SdpAttribute::kIcePwdAttribute: + LoadIcePwd(attributeList); + return; + case SdpAttribute::kIceOptionsAttribute: + LoadIceOptions(attributeList); + return; + case SdpAttribute::kFingerprintAttribute: + LoadFingerprint(attributeList); + return; + case SdpAttribute::kIdentityAttribute: + LoadIdentity(attributeList); + return; + case SdpAttribute::kSetupAttribute: + LoadSetup(attributeList); + return; + case SdpAttribute::kSsrcAttribute: + LoadSsrc(attributeList); + return; + case SdpAttribute::kRtpmapAttribute: + LoadRtpmap(attributeList); + return; + case SdpAttribute::kFmtpAttribute: + LoadFmtp(attributeList); + return; + case SdpAttribute::kPtimeAttribute: + LoadPtime(attributeList); + return; + case SdpAttribute::kIceLiteAttribute: + case SdpAttribute::kRtcpMuxAttribute: + case SdpAttribute::kBundleOnlyAttribute: + case SdpAttribute::kEndOfCandidatesAttribute: + LoadFlags(attributeList); + return; + case SdpAttribute::kMidAttribute: + LoadMid(attributeList); + return; + case SdpAttribute::kMsidAttribute: + LoadMsid(attributeList); + return; + case SdpAttribute::kMsidSemanticAttribute: + LoadMsidSemantics(attributeList); + return; + case SdpAttribute::kGroupAttribute: + LoadGroup(attributeList); + return; + case SdpAttribute::kRtcpAttribute: + LoadRtcp(attributeList); + return; + case SdpAttribute::kImageattrAttribute: + LoadImageattr(attributeList); + return; + case SdpAttribute::kSctpmapAttribute: + LoadSctpmaps(attributeList); + return; + case SdpAttribute::kDirectionAttribute: + LoadDirection(attributeList); + return; + case SdpAttribute::kRemoteCandidatesAttribute: + LoadRemoteCandidates(attributeList); + return; + case SdpAttribute::kRidAttribute: + LoadRids(attributeList); + return; + case SdpAttribute::kExtmapAttribute: + LoadExtmap(attributeList); + return; + case SdpAttribute::kDtlsMessageAttribute: + case SdpAttribute::kLabelAttribute: + case SdpAttribute::kMaxptimeAttribute: + case SdpAttribute::kSsrcGroupAttribute: + case SdpAttribute::kMaxMessageSizeAttribute: + case SdpAttribute::kRtcpFbAttribute: + case SdpAttribute::kRtcpRsizeAttribute: + case SdpAttribute::kSctpPortAttribute: + case SdpAttribute::kCandidateAttribute: + case SdpAttribute::kSimulcastAttribute: + case SdpAttribute::kConnectionAttribute: + case SdpAttribute::kIceMismatchAttribute: + // TODO: Not implemented, or not applicable. + // Sort this out in Bug 1437165. + return; + } + } +} + +void +RsdparsaSdpAttributeList::LoadAll(RustAttributeList *attributeList) +{ + for (int i = SdpAttribute::kFirstAttribute; i <= SdpAttribute::kLastAttribute; i++) { + LoadAttribute(attributeList, static_cast(i)); + } +} + +void +RsdparsaSdpAttributeList::LoadIceUfrag(RustAttributeList* attributeList) +{ + StringView ufragStr; + nsresult nr = sdp_get_iceufrag(attributeList, &ufragStr); + if (NS_SUCCEEDED(nr)) { + std::string iceufrag = convertStringView(ufragStr); + SetAttribute(new SdpStringAttribute(SdpAttribute::kIceUfragAttribute, + iceufrag)); + } +} + +void +RsdparsaSdpAttributeList::LoadIcePwd(RustAttributeList* attributeList) +{ + StringView pwdStr; + nsresult nr = sdp_get_icepwd(attributeList, &pwdStr); + if (NS_SUCCEEDED(nr)) { + std::string icePwd = convertStringView(pwdStr); + SetAttribute(new SdpStringAttribute(SdpAttribute::kIcePwdAttribute, + icePwd)); + } +} + +void +RsdparsaSdpAttributeList::LoadIdentity(RustAttributeList* attributeList) +{ + StringView identityStr; + nsresult nr = sdp_get_identity(attributeList, &identityStr); + if (NS_SUCCEEDED(nr)) { + std::string identity = convertStringView(identityStr); + SetAttribute(new SdpStringAttribute(SdpAttribute::kIdentityAttribute, + identity)); + } +} + +void +RsdparsaSdpAttributeList::LoadIceOptions(RustAttributeList* attributeList) +{ + StringVec* options; + nsresult nr = sdp_get_iceoptions(attributeList, &options); + if (NS_SUCCEEDED(nr)) { + std::vector optionsVec; + auto optionsAttr = MakeUnique( + SdpAttribute::kIceOptionsAttribute); + for (size_t i = 0; i < string_vec_len(options); i++) { + StringView optionStr; + string_vec_get_view(options, i, &optionStr); + optionsAttr->PushEntry(convertStringView(optionStr)); + } + SetAttribute(optionsAttr.release()); + } +} + +void +RsdparsaSdpAttributeList::LoadFingerprint(RustAttributeList* attributeList) +{ + size_t nFp = sdp_get_fingerprint_count(attributeList); + if (nFp == 0) { + return; + } + auto rustFingerprints = MakeUnique(nFp); + sdp_get_fingerprints(attributeList, nFp, rustFingerprints.get()); + auto fingerprints = MakeUnique(); + for(size_t i = 0; i < nFp; i++) { + RustSdpAttributeFingerprint& fingerprint = rustFingerprints[i]; + std::string algorithm = convertStringView(fingerprint.hashAlgorithm); + std::string fingerprintToken = convertStringView(fingerprint.fingerprint); + std::vector fingerprintBytes = + SdpFingerprintAttributeList::ParseFingerprint(fingerprintToken); + if (fingerprintBytes.size() == 0) { + // TODO: Should we load fingerprint earlier to detect if it is malformed + // and throw a proper error? + // TODO: We should improve our error checking. See Bug 1437169. + continue; + } + fingerprints->PushEntry(algorithm, fingerprintBytes); + } + SetAttribute(fingerprints.release()); +} + +void +RsdparsaSdpAttributeList::LoadSetup(RustAttributeList* attributeList) +{ + RustSdpSetup rustSetup; + nsresult nr = sdp_get_setup(attributeList, &rustSetup); + if (NS_SUCCEEDED(nr)) { + SdpSetupAttribute::Role setupEnum; + switch(rustSetup) { + case RustSdpSetup::kRustActive: + setupEnum = SdpSetupAttribute::kActive; + break; + case RustSdpSetup::kRustActpass: + setupEnum = SdpSetupAttribute::kActpass; + break; + case RustSdpSetup::kRustHoldconn: + setupEnum = SdpSetupAttribute::kHoldconn; + break; + case RustSdpSetup::kRustPassive: + setupEnum = SdpSetupAttribute::kPassive; + break; + } + SetAttribute(new SdpSetupAttribute(setupEnum)); + } +} + +void +RsdparsaSdpAttributeList::LoadSsrc(RustAttributeList* attributeList) +{ + size_t numSsrc = sdp_get_ssrc_count(attributeList); + if (numSsrc == 0) { + return; + } + auto rustSsrcs = MakeUnique(numSsrc); + sdp_get_ssrcs(attributeList, numSsrc, rustSsrcs.get()); + auto ssrcs = MakeUnique(); + for(size_t i = 0; i < numSsrc; i++) { + RustSdpAttributeSsrc& ssrc = rustSsrcs[i]; + std::string attribute = convertStringView(ssrc.attribute); + std::string value = convertStringView(ssrc.value); + if (value.length() == 0) { + ssrcs->PushEntry(ssrc.id, attribute); + } else { + ssrcs->PushEntry(ssrc.id, attribute + ":" + value); + } + } + SetAttribute(ssrcs.release()); +} + +SdpRtpmapAttributeList::CodecType +strToCodecType(const std::string &name) +{ + auto codec = SdpRtpmapAttributeList::kOtherCodec; + if (!nsCRT::strcasecmp(name.c_str(), "opus")) { + codec = SdpRtpmapAttributeList::kOpus; + } else if (!nsCRT::strcasecmp(name.c_str(), "G722")) { + codec = SdpRtpmapAttributeList::kG722; + } else if (!nsCRT::strcasecmp(name.c_str(), "PCMU")) { + codec = SdpRtpmapAttributeList::kPCMU; + } else if (!nsCRT::strcasecmp(name.c_str(), "PCMA")) { + codec = SdpRtpmapAttributeList::kPCMA; + } else if (!nsCRT::strcasecmp(name.c_str(), "VP8")) { + codec = SdpRtpmapAttributeList::kVP8; + } else if (!nsCRT::strcasecmp(name.c_str(), "VP9")) { + codec = SdpRtpmapAttributeList::kVP9; + } else if (!nsCRT::strcasecmp(name.c_str(), "iLBC")) { + codec = SdpRtpmapAttributeList::kiLBC; + } else if(!nsCRT::strcasecmp(name.c_str(), "iSAC")) { + codec = SdpRtpmapAttributeList::kiSAC; + } else if (!nsCRT::strcasecmp(name.c_str(), "H264")) { + codec = SdpRtpmapAttributeList::kH264; + } else if (!nsCRT::strcasecmp(name.c_str(), "red")) { + codec = SdpRtpmapAttributeList::kRed; + } else if (!nsCRT::strcasecmp(name.c_str(), "ulpfec")) { + codec = SdpRtpmapAttributeList::kUlpfec; + } else if (!nsCRT::strcasecmp(name.c_str(), "telephone-event")) { + codec = SdpRtpmapAttributeList::kTelephoneEvent; + } + return codec; +} + +void +RsdparsaSdpAttributeList::LoadRtpmap(RustAttributeList* attributeList) +{ + size_t numRtpmap = sdp_get_rtpmap_count(attributeList); + if (numRtpmap == 0) { + return; + } + auto rustRtpmaps = MakeUnique(numRtpmap); + sdp_get_rtpmaps(attributeList, numRtpmap, rustRtpmaps.get()); + auto rtpmapList = MakeUnique(); + for(size_t i = 0; i < numRtpmap; i++) { + RustSdpAttributeRtpmap& rtpmap = rustRtpmaps[i]; + std::string payloadType = std::to_string(rtpmap.payloadType); + std::string name = convertStringView(rtpmap.codecName); + auto codec = strToCodecType(name); + uint32_t channels = rtpmap.channels; + if (mIsVideo) { + // channels is expected to be 0 for video in higher level code, + // channels don't make sense, so the value is arbitrary. 1 is + // the arbitrary value for that code. + // TODO: handle this in Rust parser, see Bug 1436403 + channels = 0; + } + rtpmapList->PushEntry(payloadType, codec, name, + rtpmap.frequency, channels); + } + SetAttribute(rtpmapList.release()); +} + +void +RsdparsaSdpAttributeList::LoadFmtp(RustAttributeList* attributeList) +{ + // TODO: Not implemented, see Bug 1432918 +#if 0 + size_t numFmtp = sdp_get_fmtp_count(attributeList); + if (numFmtp == 0) { + return; + } + auto rustFmtps = MakeUnique(numFmtp); + size_t numValidFmtp = sdp_get_fmtp(attributeList, numFmtp, + rustFmtps.get()); + for(size_t i = 0; i < numValidFmtp; i++) { + RustSdpAttributeFmtp& fmtp = rustFmtps[i]; + } +#endif +} + +void +RsdparsaSdpAttributeList::LoadPtime(RustAttributeList* attributeList) +{ + int64_t ptime = sdp_get_ptime(attributeList); + if (ptime >= 0) { + SetAttribute(new SdpNumberAttribute(SdpAttribute::kPtimeAttribute, + static_cast(ptime))); + } +} + +void +RsdparsaSdpAttributeList::LoadFlags(RustAttributeList* attributeList) +{ + RustSdpAttributeFlags flags = sdp_get_attribute_flags(attributeList); + if (flags.iceLite) { + SetAttribute(new SdpFlagAttribute(SdpAttribute::kIceLiteAttribute)); + } + if (flags.rtcpMux) { + SetAttribute(new SdpFlagAttribute(SdpAttribute::kRtcpMuxAttribute)); + } + if (flags.bundleOnly) { + SetAttribute(new SdpFlagAttribute(SdpAttribute::kBundleOnlyAttribute)); + } + if (flags.endOfCandidates) { + SetAttribute(new SdpFlagAttribute(SdpAttribute::kEndOfCandidatesAttribute)); + } +} + +void +RsdparsaSdpAttributeList::LoadMid(RustAttributeList* attributeList) +{ + StringView rustMid; + if (NS_SUCCEEDED(sdp_get_mid(attributeList, &rustMid))) { + std::string mid = convertStringView(rustMid); + SetAttribute(new SdpStringAttribute(SdpAttribute::kMidAttribute, mid)); + } +} + +void +RsdparsaSdpAttributeList::LoadMsid(RustAttributeList* attributeList) +{ + size_t numMsid = sdp_get_msid_count(attributeList); + if (numMsid == 0) { + return; + } + auto rustMsid = MakeUnique(numMsid); + sdp_get_msids(attributeList, numMsid, rustMsid.get()); + auto msids = MakeUnique(); + for(size_t i = 0; i < numMsid; i++) { + RustSdpAttributeMsid& msid = rustMsid[i]; + std::string id = convertStringView(msid.id); + std::string appdata = convertStringView(msid.appdata); + msids->PushEntry(id, appdata); + } + SetAttribute(msids.release()); +} + +void +RsdparsaSdpAttributeList::LoadMsidSemantics(RustAttributeList* attributeList) +{ + size_t numMsidSemantic = sdp_get_msid_semantic_count(attributeList); + if (numMsidSemantic == 0) { + return; + } + auto rustMsidSemantics = MakeUnique(numMsidSemantic); + sdp_get_msid_semantics(attributeList, numMsidSemantic, + rustMsidSemantics.get()); + auto msidSemantics = MakeUnique(); + for(size_t i = 0; i < numMsidSemantic; i++) { + RustSdpAttributeMsidSemantic& rustMsidSemantic = rustMsidSemantics[i]; + std::string semantic = convertStringView(rustMsidSemantic.semantic); + std::vector msids = convertStringVec(rustMsidSemantic.msids); + msidSemantics->PushEntry(semantic, msids); + } + SetAttribute(msidSemantics.release()); +} + +void +RsdparsaSdpAttributeList::LoadGroup(RustAttributeList* attributeList) +{ + size_t numGroup = sdp_get_group_count(attributeList); + if (numGroup == 0) { + return; + } + auto rustGroups = MakeUnique(numGroup); + nsresult nr = sdp_get_groups(attributeList, numGroup, rustGroups.get()); + if (NS_FAILED(nr)) { + return; + } + auto groups = MakeUnique(); + for(size_t i = 0; i < numGroup; i++) { + RustSdpAttributeGroup& group = rustGroups[i]; + SdpGroupAttributeList::Semantics semantic; + switch(group.semantic) { + case RustSdpAttributeGroupSemantic ::kRustLipSynchronization: + semantic = SdpGroupAttributeList::kLs; + break; + case RustSdpAttributeGroupSemantic ::kRustFlowIdentification: + semantic = SdpGroupAttributeList::kFid; + break; + case RustSdpAttributeGroupSemantic ::kRustSingleReservationFlow: + semantic = SdpGroupAttributeList::kSrf; + break; + case RustSdpAttributeGroupSemantic ::kRustAlternateNetworkAddressType: + semantic = SdpGroupAttributeList::kAnat; + break; + case RustSdpAttributeGroupSemantic ::kRustForwardErrorCorrection: + semantic = SdpGroupAttributeList::kFec; + break; + case RustSdpAttributeGroupSemantic ::kRustDecodingDependency: + semantic = SdpGroupAttributeList::kDdp; + break; + case RustSdpAttributeGroupSemantic ::kRustBundle: + semantic = SdpGroupAttributeList::kBundle; + break; + } + std::vector tags = convertStringVec(group.tags); + groups->PushEntry(semantic, tags); + } + SetAttribute(groups.release()); +} + +void +RsdparsaSdpAttributeList::LoadRtcp(RustAttributeList* attributeList) +{ + RustSdpAttributeRtcp rtcp; + if (NS_SUCCEEDED(sdp_get_rtcp(attributeList, &rtcp))) { + sdp::AddrType addrType = convertAddressType(rtcp.unicastAddr.addrType); + if (sdp::kAddrTypeNone == addrType) { + SetAttribute(new SdpRtcpAttribute(rtcp.port)); + } else { + std::string addr(rtcp.unicastAddr.unicastAddr); + SetAttribute(new SdpRtcpAttribute(rtcp.port, sdp::kInternet, + addrType, addr)); + } + } +} + +void +RsdparsaSdpAttributeList::LoadImageattr(RustAttributeList* attributeList) +{ + size_t numImageattrs = sdp_get_imageattr_count(attributeList); + if (numImageattrs == 0) { + return; + } + auto rustImageattrs = MakeUnique(numImageattrs); + sdp_get_imageattrs(attributeList, numImageattrs, rustImageattrs.get()); + auto imageattrList = MakeUnique(); + for(size_t i = 0; i < numImageattrs; i++) { + StringView& imageAttr = rustImageattrs[i]; + std::string image = convertStringView(imageAttr); + std::string error; + size_t errorPos; + if (!imageattrList->PushEntry(image, &error, &errorPos)) { + // TODO: handle error, see Bug 1438237 + } + } + SetAttribute(imageattrList.release()); +} + +void +RsdparsaSdpAttributeList::LoadSctpmaps(RustAttributeList* attributeList) +{ + size_t numSctpmaps = sdp_get_sctpmap_count(attributeList); + if (numSctpmaps == 0) { + return; + } + auto rustSctpmaps = MakeUnique(numSctpmaps); + sdp_get_sctpmaps(attributeList, numSctpmaps, rustSctpmaps.get()); + auto sctpmapList = MakeUnique(); + for(size_t i = 0; i < numSctpmaps; i++) { + RustSdpAttributeSctpmap& sctpmap = rustSctpmaps[i]; + sctpmapList->PushEntry(std::to_string(sctpmap.port), + "webrtc-datachannel", + sctpmap.channels); + } + SetAttribute(sctpmapList.release()); +} + +void +RsdparsaSdpAttributeList::LoadDirection(RustAttributeList* attributeList) +{ + SdpDirectionAttribute::Direction dir; + RustDirection rustDir = sdp_get_direction(attributeList); + switch(rustDir) { + case RustDirection::kRustRecvonly: + dir = SdpDirectionAttribute::kRecvonly; + break; + case RustDirection::kRustSendonly: + dir = SdpDirectionAttribute::kSendonly; + break; + case RustDirection::kRustSendrecv: + dir = SdpDirectionAttribute::kSendrecv; + break; + case RustDirection::kRustInactive: + dir = SdpDirectionAttribute::kInactive; + break; + } + SetAttribute(new SdpDirectionAttribute(dir)); +} + +void +RsdparsaSdpAttributeList::LoadRemoteCandidates(RustAttributeList* attributeList) +{ + size_t nC = sdp_get_remote_candidate_count(attributeList); + if (nC == 0) { + return; + } + auto rustCandidates = MakeUnique(nC); + sdp_get_remote_candidates(attributeList, nC, + rustCandidates.get()); + std::vector candidates; + for(size_t i = 0; i < nC; i++) { + RustSdpAttributeRemoteCandidate& rustCandidate = rustCandidates[i]; + SdpRemoteCandidatesAttribute::Candidate candidate; + candidate.port = rustCandidate.port; + candidate.id = std::to_string(rustCandidate.component); + candidate.address = std::string(rustCandidate.address.unicastAddr); + candidates.push_back(candidate); + } + SdpRemoteCandidatesAttribute* candidatesList; + candidatesList = new SdpRemoteCandidatesAttribute(candidates); + SetAttribute(candidatesList); +} + +void +RsdparsaSdpAttributeList::LoadRids(RustAttributeList* attributeList) +{ + size_t numRids = sdp_get_rid_count(attributeList); + if (numRids == 0) { + return; + } + auto rustRids = MakeUnique(numRids); + sdp_get_rids(attributeList, numRids, + rustRids.get()); + auto rids = MakeUnique(); + for(size_t i = 0; i < numRids; i++) { + std::string rid = convertStringView(rustRids[i]); + std::string error; + size_t errorPos; + if (!rids->PushEntry(rid, &error, &errorPos)) { + // TODO: handle error, see Bug 1438237 + } + } + SetAttribute(rids.release()); +} + +void +RsdparsaSdpAttributeList::LoadExtmap(RustAttributeList* attributeList) +{ + size_t numExtmap = sdp_get_extmap_count(attributeList); + if (numExtmap == 0) { + return; + } + auto rustExtmaps = MakeUnique(numExtmap); + sdp_get_extmaps(attributeList, numExtmap, + rustExtmaps.get()); + auto extmaps = MakeUnique(); + for(size_t i = 0; i < numExtmap; i++) { + RustSdpAttributeExtmap& rustExtmap = rustExtmaps[i]; + std::string name = convertStringView(rustExtmap.url); + SdpDirectionAttribute::Direction direction; + bool directionSpecified = true; + switch(rustExtmap.direction) { + case RustDirection::kRustRecvonly: + direction = SdpDirectionAttribute::kRecvonly; + break; + case RustDirection::kRustSendonly: + direction = SdpDirectionAttribute::kSendonly; + break; + case RustDirection::kRustSendrecv: + direction = SdpDirectionAttribute::kSendrecv; + break; + case RustDirection::kRustInactive: + // TODO: Fix this, see Bug 1438544 + direction = SdpDirectionAttribute::kSendrecv; + directionSpecified = false; + break; + } + std::string extensionAttributes; + extensionAttributes = convertStringView(rustExtmap.extensionAttributes); + extmaps->PushEntry((uint16_t) rustExtmap.id, direction, + directionSpecified, name, extensionAttributes); + } + SetAttribute(extmaps.release()); +} + + +bool +RsdparsaSdpAttributeList::IsAllowedHere(SdpAttribute::AttributeType type) +{ + if (AtSessionLevel() && !SdpAttribute::IsAllowedAtSessionLevel(type)) { + return false; + } + + if (!AtSessionLevel() && !SdpAttribute::IsAllowedAtMediaLevel(type)) { + return false; + } + + return true; +} + +void +RsdparsaSdpAttributeList::Serialize(std::ostream& os) const +{ + for (size_t i = 0; i < kNumAttributeTypes; ++i) { + if (mAttributes[i]) { + os << *mAttributes[i]; + } + } +} + +} // namespace mozilla diff --git a/media/webrtc/signaling/src/sdp/RsdparsaSdpAttributeList.h b/media/webrtc/signaling/src/sdp/RsdparsaSdpAttributeList.h new file mode 100644 index 000000000000..c20fd543c7d3 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/RsdparsaSdpAttributeList.h @@ -0,0 +1,158 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set 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/. */ + +#ifndef _RSDPARSA_SDP_ATTRIBUTE_LIST_H_ +#define _RSDPARSA_SDP_ATTRIBUTE_LIST_H_ + +#include "signaling/src/sdp/RsdparsaSdpGlue.h" +#include "signaling/src/sdp/RsdparsaSdpInc.h" +#include "signaling/src/sdp/SdpAttributeList.h" + +namespace mozilla +{ + +class RsdparsaSdp; +class RsdparsaSdpMediaSection; +class SdpErrorHolder; + +class RsdparsaSdpAttributeList : public SdpAttributeList +{ + friend class RsdparsaSdpMediaSection; + friend class RsdparsaSdp; + +public: + // Make sure we don't hide the default arg thunks + using SdpAttributeList::HasAttribute; + using SdpAttributeList::GetAttribute; + + bool HasAttribute(AttributeType type, + bool sessionFallback) const override; + const SdpAttribute* GetAttribute(AttributeType type, + bool sessionFallback) const override; + void SetAttribute(SdpAttribute* attr) override; + void RemoveAttribute(AttributeType type) override; + void Clear() override; + uint32_t Count() const override; + + const SdpConnectionAttribute& GetConnection() const override; + const SdpFingerprintAttributeList& GetFingerprint() const override; + const SdpGroupAttributeList& GetGroup() const override; + const SdpOptionsAttribute& GetIceOptions() const override; + const SdpRtcpAttribute& GetRtcp() const override; + const SdpRemoteCandidatesAttribute& GetRemoteCandidates() const override; + const SdpSetupAttribute& GetSetup() const override; + const SdpSsrcAttributeList& GetSsrc() const override; + const SdpSsrcGroupAttributeList& GetSsrcGroup() const override; + const SdpDtlsMessageAttribute& GetDtlsMessage() const override; + + // These attributes can appear multiple times, so the returned + // classes actually represent a collection of values. + const std::vector& GetCandidate() const override; + const SdpExtmapAttributeList& GetExtmap() const override; + const SdpFmtpAttributeList& GetFmtp() const override; + const SdpImageattrAttributeList& GetImageattr() const override; + const SdpSimulcastAttribute& GetSimulcast() const override; + const SdpMsidAttributeList& GetMsid() const override; + const SdpMsidSemanticAttributeList& GetMsidSemantic() const override; + const SdpRidAttributeList& GetRid() const override; + const SdpRtcpFbAttributeList& GetRtcpFb() const override; + const SdpRtpmapAttributeList& GetRtpmap() const override; + const SdpSctpmapAttributeList& GetSctpmap() const override; + + // These attributes are effectively simple types, so we'll make life + // easy by just returning their value. + uint32_t GetSctpPort() const override; + uint32_t GetMaxMessageSize() const override; + const std::string& GetIcePwd() const override; + const std::string& GetIceUfrag() const override; + const std::string& GetIdentity() const override; + const std::string& GetLabel() const override; + unsigned int GetMaxptime() const override; + const std::string& GetMid() const override; + unsigned int GetPtime() const override; + + SdpDirectionAttribute::Direction GetDirection() const override; + + void Serialize(std::ostream&) const override; + + virtual ~RsdparsaSdpAttributeList(); + +private: + explicit RsdparsaSdpAttributeList(RsdparsaSessionHandle session) + : mSession(Move(session)) + , mSessionAttributes(nullptr) + , mIsVideo(false) + , mAttributes() + { + RustAttributeList* attributes = get_sdp_session_attributes(mSession.get()); + LoadAll(attributes); + } + + RsdparsaSdpAttributeList(RsdparsaSessionHandle session, + const RustMediaSection* const msection, + const RsdparsaSdpAttributeList* sessionAttributes) + : mSession(Move(session)) + , mSessionAttributes(sessionAttributes) + , mAttributes() + { + mIsVideo = sdp_rust_get_media_type(msection) == RustSdpMediaValue::kRustVideo; + RustAttributeList* attributes = sdp_get_media_attribute_list(msection); + LoadAll(attributes); + } + + static const std::string kEmptyString; + static const size_t kNumAttributeTypes = SdpAttribute::kLastAttribute + 1; + + const RsdparsaSessionHandle mSession; + const RsdparsaSdpAttributeList* mSessionAttributes; + bool mIsVideo; + + bool + AtSessionLevel() const + { + return !mSessionAttributes; + } + + bool IsAllowedHere(SdpAttribute::AttributeType type); + void LoadAll(RustAttributeList* attributeList); + void LoadAttribute(RustAttributeList* attributeList, AttributeType type); + void LoadIceUfrag(RustAttributeList* attributeList); + void LoadIcePwd(RustAttributeList* attributeList); + void LoadIdentity(RustAttributeList* attributeList); + void LoadIceOptions(RustAttributeList* attributeList); + void LoadFingerprint(RustAttributeList* attributeList); + void LoadSetup(RustAttributeList* attributeList); + void LoadSsrc(RustAttributeList* attributeList); + void LoadRtpmap(RustAttributeList* attributeList); + void LoadFmtp(RustAttributeList* attributeList); + void LoadPtime(RustAttributeList* attributeList); + void LoadFlags(RustAttributeList* attributeList); + void LoadMid(RustAttributeList* attributeList); + void LoadMsid(RustAttributeList* attributeList); + void LoadMsidSemantics(RustAttributeList* attributeList); + void LoadGroup(RustAttributeList* attributeList); + void LoadRtcp(RustAttributeList* attributeList); + void LoadImageattr(RustAttributeList* attributeList); + void LoadSctpmaps(RustAttributeList* attributeList); + void LoadDirection(RustAttributeList* attributeList); + void LoadRemoteCandidates(RustAttributeList* attributeList); + void LoadRids(RustAttributeList* attributeList); + void LoadExtmap(RustAttributeList* attributeList); + + void WarnAboutMisplacedAttribute(SdpAttribute::AttributeType type, + uint32_t lineNumber, + SdpErrorHolder& errorHolder); + + + SdpAttribute* mAttributes[kNumAttributeTypes]; + + RsdparsaSdpAttributeList(const RsdparsaSdpAttributeList& orig) = delete; + RsdparsaSdpAttributeList& operator=(const RsdparsaSdpAttributeList& rhs) = delete; +}; + +} // namespace mozilla + +#endif diff --git a/media/webrtc/signaling/src/sdp/RsdparsaSdpGlue.cpp b/media/webrtc/signaling/src/sdp/RsdparsaSdpGlue.cpp new file mode 100644 index 000000000000..6e3b0951d500 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/RsdparsaSdpGlue.cpp @@ -0,0 +1,48 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set 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/. */ +#include + +#include "signaling/src/sdp/RsdparsaSdpInc.h" +#include "signaling/src/sdp/RsdparsaSdpGlue.h" +namespace mozilla +{ + +std::string convertStringView(StringView str) +{ + if (nullptr == str.buf) { + return std::string(); + } else { + return std::string(str.buf, str.len); + } +} + +std::vector convertStringVec(StringVec* vec) +{ + std::vector ret; + size_t len = string_vec_len(vec); + for (size_t i = 0; i < len; i++) { + StringView view; + string_vec_get_view(vec, i, &view); + ret.push_back(convertStringView(view)); + } + return ret; +} + +sdp::AddrType convertAddressType(RustSdpAddrType addrType) +{ + switch(addrType) { + case RustSdpAddrType::kRustAddrNone: + return sdp::kAddrTypeNone; + case RustSdpAddrType::kRustAddrIp4: + return sdp::kIPv4; + case RustSdpAddrType::kRustAddrIp6: + return sdp::kIPv6; + } + + MOZ_CRASH("unknown address type"); +} + +} diff --git a/media/webrtc/signaling/src/sdp/RsdparsaSdpGlue.h b/media/webrtc/signaling/src/sdp/RsdparsaSdpGlue.h new file mode 100644 index 000000000000..4e41722cbbd1 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/RsdparsaSdpGlue.h @@ -0,0 +1,31 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set 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/. */ +#ifndef _RUSTSDPGLUE_H_ +#define _RUSTSDPGLUE_H_ + +#include +#include + +#include "signaling/src/sdp/Sdp.h" +#include "signaling/src/sdp/RsdparsaSdpInc.h" + +namespace mozilla +{ + +struct FreeRustSdpSession { + void operator()(RustSdpSession* aSess) { sdp_free_session(aSess); } +}; + +typedef UniquePtr RsdparsaSessionHandle; + +std::string convertStringView(StringView str); +std::vector convertStringVec(StringVec* vec); +sdp::AddrType convertAddressType(RustSdpAddrType addr); + +} + + +#endif diff --git a/media/webrtc/signaling/src/sdp/RsdparsaSdpInc.h b/media/webrtc/signaling/src/sdp/RsdparsaSdpInc.h new file mode 100644 index 000000000000..4de408bc8599 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/RsdparsaSdpInc.h @@ -0,0 +1,289 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set 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/. */ +#ifndef _RUSTSDPINC_H_ +#define _RUSTSDPINC_H_ + +#include "nsError.h" + +#include +#include + +struct BandwidthVec; +struct RustSdpSession; +struct RustSdpError; +struct RustMediaSection; +struct RustAttributeList; +struct StringVec; +struct U32Vec; +struct RustHeapString; + +enum class RustSdpAddrType { + kRustAddrNone, + kRustAddrIp4, + kRustAddrIp6 +}; + +struct RustIpAddr { + RustSdpAddrType addrType; + char unicastAddr[50]; +}; + +struct StringView { + char* buf; + size_t len; +}; + +struct RustSdpConnection { + RustIpAddr addr; + uint8_t ttl; + uint64_t amount; +}; + +struct RustSdpOrigin { + StringView username; + uint64_t sessionId; + uint64_t sessionVersion; + RustIpAddr addr; +}; + +enum class RustSdpMediaValue { + kRustAudio, + kRustVideo, + kRustApplication +}; + +enum class RustSdpProtocolValue { + kRustRtpSavpf, + kRustUdpTlsRtpSavpf, + kRustTcpTlsRtpSavpf, + kRustDtlsSctp, + kRustUdpDtlsSctp, + kRustTcpDtlsSctp, +}; + +enum class RustSdpFormatType { + kRustIntegers, + kRustStrings +}; + +struct RustSdpAttributeFingerprint { + StringView hashAlgorithm; + StringView fingerprint; +}; + +enum class RustSdpSetup { + kRustActive, + kRustActpass, + kRustHoldconn, + kRustPassive +}; + +struct RustSdpAttributeSsrc { + uint32_t id; + StringView attribute; + StringView value; +}; + +struct RustSdpAttributeRtpmap { + uint8_t payloadType; + StringView codecName; + uint32_t frequency; + uint32_t channels; +}; + +struct RustSdpAttributeFmtp { + uint8_t payloadType; + StringView codecName; + StringVec* tokens; +}; + +struct RustSdpAttributeFlags { + bool iceLite; + bool rtcpMux; + bool bundleOnly; + bool endOfCandidates; +}; + +struct RustSdpAttributeMsid { + StringView id; + StringView appdata; +}; + +struct RustSdpAttributeMsidSemantic { + StringView semantic; + StringVec* msids; +}; + +enum class RustSdpAttributeGroupSemantic { + kRustLipSynchronization, + kRustFlowIdentification, + kRustSingleReservationFlow, + kRustAlternateNetworkAddressType, + kRustForwardErrorCorrection, + kRustDecodingDependency, + kRustBundle, +}; + +struct RustSdpAttributeGroup { + RustSdpAttributeGroupSemantic semantic; + StringVec* tags; +}; + +struct RustSdpAttributeRtcp { + uint32_t port; + RustIpAddr unicastAddr; +}; + +struct RustSdpAttributeSctpmap { + uint32_t port; + uint32_t channels; +}; + +enum class RustDirection { + kRustRecvonly, + kRustSendonly, + kRustSendrecv, + kRustInactive +}; + +struct RustSdpAttributeRemoteCandidate { + uint32_t component; + RustIpAddr address; + uint32_t port; +}; + +// TODO: Add field indicating whether direction was specified +// See Bug 1438536. +struct RustSdpAttributeExtmap { + uint16_t id; + RustDirection direction; + StringView url; + StringView extensionAttributes; +}; + +extern "C" { + +size_t string_vec_len(const StringVec* vec); +nsresult string_vec_get_view(const StringVec* vec, size_t index, + StringView* str); + +size_t u32_vec_len(const U32Vec* vec); +nsresult u32_vec_get(const U32Vec* vec, size_t index, uint32_t* ret); + +void sdp_free_string(char* string); + +nsresult parse_sdp(const char* sdp, uint32_t length, bool fail_on_warning, + RustSdpSession** ret, RustSdpError** err); +RustSdpSession* sdp_new_reference(RustSdpSession* aSess); +void sdp_free_session(RustSdpSession* ret); +size_t sdp_get_error_line_num(const RustSdpError* err); +StringView sdp_get_error_message(const RustSdpError* err); +void sdp_free_error(RustSdpError* err); + +RustSdpOrigin sdp_get_origin(const RustSdpSession* aSess); + +uint32_t get_sdp_bandwidth(const RustSdpSession* aSess, + const char* aBandwidthType); +BandwidthVec* sdp_get_session_bandwidth_vec(const RustSdpSession* aSess); +BandwidthVec* sdp_get_media_bandwidth_vec(const RustMediaSection* aMediaSec); +char* sdp_serialize_bandwidth(const BandwidthVec* bandwidths); +bool sdp_session_has_connection(const RustSdpSession* aSess); +nsresult sdp_get_session_connection(const RustSdpSession* aSess, + RustSdpConnection* ret); +RustAttributeList* get_sdp_session_attributes(const RustSdpSession* aSess); + +size_t sdp_media_section_count(const RustSdpSession* aSess); +RustMediaSection* sdp_get_media_section(const RustSdpSession* aSess, + size_t aLevel); +RustSdpMediaValue sdp_rust_get_media_type(const RustMediaSection* aMediaSec); +RustSdpProtocolValue +sdp_get_media_protocol(const RustMediaSection* aMediaSec); +RustSdpFormatType sdp_get_format_type(const RustMediaSection* aMediaSec); +StringVec* sdp_get_format_string_vec(const RustMediaSection* aMediaSec); +U32Vec* sdp_get_format_u32_vec(const RustMediaSection* aMediaSec); +uint32_t sdp_get_media_port(const RustMediaSection* aMediaSec); +uint32_t sdp_get_media_port_count(const RustMediaSection* aMediaSec); +uint32_t sdp_get_media_bandwidth(const RustMediaSection* aMediaSec, + const char* aBandwidthType); +bool sdp_media_has_connection(const RustMediaSection* aMediaSec); +nsresult sdp_get_media_connection(const RustMediaSection* aMediaSec, + RustSdpConnection* ret); + +RustAttributeList* +sdp_get_media_attribute_list(const RustMediaSection* aMediaSec); + +nsresult sdp_get_iceufrag(const RustAttributeList* aList, StringView* ret); +nsresult sdp_get_icepwd(const RustAttributeList* aList, StringView* ret); +nsresult sdp_get_identity(const RustAttributeList* aList, StringView* ret); +nsresult sdp_get_iceoptions(const RustAttributeList* aList, StringVec** ret); + +size_t sdp_get_fingerprint_count(const RustAttributeList* aList); +void sdp_get_fingerprints(const RustAttributeList* aList, size_t listSize, + RustSdpAttributeFingerprint* ret); + +nsresult sdp_get_setup(const RustAttributeList* aList, RustSdpSetup* ret); + +size_t sdp_get_ssrc_count(const RustAttributeList* aList); +void sdp_get_ssrcs(const RustAttributeList* aList, + size_t listSize, RustSdpAttributeSsrc* ret); + +size_t sdp_get_rtpmap_count(const RustAttributeList* aList); +void sdp_get_rtpmaps(const RustAttributeList* aList, size_t listSize, + RustSdpAttributeRtpmap* ret); + +size_t sdp_get_fmtp_count(const RustAttributeList* aList); +size_t sdp_get_fmtp(const RustAttributeList* aList, size_t listSize, + RustSdpAttributeFmtp* ret); + +int64_t sdp_get_ptime(const RustAttributeList* aList); + +RustSdpAttributeFlags sdp_get_attribute_flags(const RustAttributeList* aList); + +nsresult sdp_get_mid(const RustAttributeList* aList, StringView* ret); + +size_t sdp_get_msid_count(const RustAttributeList* aList); +void sdp_get_msids(const RustAttributeList* aList, size_t listSize, + RustSdpAttributeMsid* ret); + +size_t sdp_get_msid_semantic_count(RustAttributeList* aList); +void sdp_get_msid_semantics(const RustAttributeList* aList, size_t listSize, + RustSdpAttributeMsidSemantic* ret); + +size_t sdp_get_group_count(const RustAttributeList* aList); +nsresult sdp_get_groups(const RustAttributeList* aList, size_t listSize, + RustSdpAttributeGroup* ret); + +nsresult sdp_get_rtcp(const RustAttributeList* aList, + RustSdpAttributeRtcp* ret); + +size_t sdp_get_imageattr_count(const RustAttributeList* aList); +void sdp_get_imageattrs(const RustAttributeList* aList, size_t listSize, + StringView* ret); + +size_t sdp_get_sctpmap_count(const RustAttributeList* aList); +void sdp_get_sctpmaps(const RustAttributeList* aList, size_t listSize, + RustSdpAttributeSctpmap* ret); + +RustDirection sdp_get_direction(const RustAttributeList* aList); + + +size_t sdp_get_remote_candidate_count(const RustAttributeList* aList); +void sdp_get_remote_candidates(const RustAttributeList* aList, + size_t listSize, + RustSdpAttributeRemoteCandidate* ret); + +size_t sdp_get_rid_count(const RustAttributeList* aList); +void sdp_get_rids(const RustAttributeList* aList, size_t listSize, + StringView* ret); + + +size_t sdp_get_extmap_count(const RustAttributeList* aList); +void sdp_get_extmaps(const RustAttributeList* aList, size_t listSize, + RustSdpAttributeExtmap* ret); + +} //extern "C" + +#endif diff --git a/media/webrtc/signaling/src/sdp/RsdparsaSdpMediaSection.cpp b/media/webrtc/signaling/src/sdp/RsdparsaSdpMediaSection.cpp new file mode 100644 index 000000000000..0dc3618e9e44 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/RsdparsaSdpMediaSection.cpp @@ -0,0 +1,235 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set 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/. */ + +// Bug 1433534 tracks cleaning up the TODOs in the file + +#include "signaling/src/sdp/SdpMediaSection.h" +#include "signaling/src/sdp/RsdparsaSdpMediaSection.h" + +#include "signaling/src/sdp/RsdparsaSdpGlue.h" +#include "signaling/src/sdp/RsdparsaSdpInc.h" + +#include +#include "signaling/src/sdp/SdpErrorHolder.h" + +#ifdef CRLF +#undef CRLF +#endif +#define CRLF "\r\n" + +namespace mozilla +{ + +RsdparsaSdpMediaSection::RsdparsaSdpMediaSection(size_t level, + RsdparsaSessionHandle session, const RustMediaSection* const section, + const RsdparsaSdpAttributeList* sessionLevel) + : SdpMediaSection(level), mSession(Move(session)), + mSection(section) +{ + switch(sdp_rust_get_media_type(section)) { + case RustSdpMediaValue::kRustAudio: + mMediaType = kAudio; + break; + case RustSdpMediaValue::kRustVideo: + mMediaType = kVideo; + break; + case RustSdpMediaValue::kRustApplication: + mMediaType = kApplication; + break; + } + + RsdparsaSessionHandle attributeSession(sdp_new_reference(mSession.get())); + mAttributeList.reset(new RsdparsaSdpAttributeList(Move(attributeSession), + section, + sessionLevel)); + + LoadFormats(); + LoadConnection(); +} + +unsigned int +RsdparsaSdpMediaSection::GetPort() const +{ + return sdp_get_media_port(mSection); +} + +void +RsdparsaSdpMediaSection::SetPort(unsigned int port) +{ + // TODO, see Bug 1433093 +} + +unsigned int +RsdparsaSdpMediaSection::GetPortCount() const +{ + return sdp_get_media_port_count(mSection); +} + +SdpMediaSection::Protocol +RsdparsaSdpMediaSection::GetProtocol() const +{ + switch(sdp_get_media_protocol(mSection)) { + case RustSdpProtocolValue::kRustRtpSavpf: + return kRtpSavpf; + case RustSdpProtocolValue::kRustUdpTlsRtpSavpf: + return kUdpTlsRtpSavpf; + case RustSdpProtocolValue::kRustTcpTlsRtpSavpf: + return kTcpTlsRtpSavpf; + case RustSdpProtocolValue::kRustDtlsSctp: + return kDtlsSctp; + case RustSdpProtocolValue::kRustUdpDtlsSctp: + return kUdpDtlsSctp; + case RustSdpProtocolValue::kRustTcpDtlsSctp: + return kTcpDtlsSctp; + } + + MOZ_CRASH("invalid media protocol"); +} + +const SdpConnection& +RsdparsaSdpMediaSection::GetConnection() const +{ + MOZ_ASSERT(mConnection); + return *mConnection; +} + +SdpConnection& +RsdparsaSdpMediaSection::GetConnection() +{ + MOZ_ASSERT(mConnection); + return *mConnection; +} + +uint32_t +RsdparsaSdpMediaSection::GetBandwidth(const std::string& type) const +{ + return sdp_get_media_bandwidth(mSection, type.c_str()); +} + +const std::vector& +RsdparsaSdpMediaSection::GetFormats() const +{ + return mFormats; +} + +const SdpAttributeList& +RsdparsaSdpMediaSection::GetAttributeList() const +{ + return *mAttributeList; +} + +SdpAttributeList& +RsdparsaSdpMediaSection::GetAttributeList() +{ + return *mAttributeList; +} + +SdpDirectionAttribute +RsdparsaSdpMediaSection::GetDirectionAttribute() const +{ + return SdpDirectionAttribute(mAttributeList->GetDirection()); +} + +void +RsdparsaSdpMediaSection::AddCodec(const std::string& pt, + const std::string& name, + uint32_t clockrate, uint16_t channels) +{ + //TODO: see Bug 1438289 +} + +void +RsdparsaSdpMediaSection::ClearCodecs() +{ + + //TODO: see Bug 1438289 +} + +void +RsdparsaSdpMediaSection::AddDataChannel(const std::string& name, uint16_t port, + uint16_t streams, uint32_t message_size) +{ + //TODO: See 1438290 +} + +void +RsdparsaSdpMediaSection::Serialize(std::ostream& os) const +{ + os << "m=" << mMediaType << " " << GetPort(); + if (GetPortCount()) { + os << "/" << GetPortCount(); + } + os << " " << GetProtocol(); + for (auto i = mFormats.begin(); i != mFormats.end(); ++i) { + os << " " << (*i); + } + os << CRLF; + + // We dont do i= + + if (mConnection) { + os << *mConnection; + } + + BandwidthVec* bwVec = sdp_get_media_bandwidth_vec(mSection); + char* bwString = sdp_serialize_bandwidth(bwVec); + if (bwString) { + os << bwString; + sdp_free_string(bwString); + } + + // We dont do k= because they're evil + + os << *mAttributeList; +} + +void +RsdparsaSdpMediaSection::LoadFormats() +{ + RustSdpFormatType formatType = sdp_get_format_type(mSection); + if (formatType == RustSdpFormatType::kRustIntegers) { + U32Vec* vec = sdp_get_format_u32_vec(mSection); + size_t len = u32_vec_len(vec); + for (size_t i = 0; i < len; i++) { + uint32_t val; + u32_vec_get(vec, i, &val); + mFormats.push_back(std::to_string(val)); + } + } else { + StringVec* vec = sdp_get_format_string_vec(mSection); + mFormats = convertStringVec(vec); + } +} + +UniquePtr convertRustConnection(RustSdpConnection conn) +{ + std::string addr(conn.addr.unicastAddr); + sdp::AddrType type = convertAddressType(conn.addr.addrType); + return MakeUnique(type, addr, conn.ttl, conn.amount); +} + +void +RsdparsaSdpMediaSection::LoadConnection() +{ + RustSdpConnection conn; + nsresult nr; + if (sdp_media_has_connection(mSection)) { + nr = sdp_get_media_connection(mSection, &conn); + if (NS_SUCCEEDED(nr)) { + mConnection = convertRustConnection(conn); + } + } else if (sdp_session_has_connection(mSession.get())){ + // TODO: rsdparsa needs to ensure there is a connection at the session level + // if it is missing at a media level. See Bug 1438539. + nr = sdp_get_session_connection(mSession.get(), &conn); + if (NS_SUCCEEDED(nr)) { + mConnection = convertRustConnection(conn); + } + } +} + +} // namespace mozilla + diff --git a/media/webrtc/signaling/src/sdp/RsdparsaSdpMediaSection.h b/media/webrtc/signaling/src/sdp/RsdparsaSdpMediaSection.h new file mode 100644 index 000000000000..57b9834a22fa --- /dev/null +++ b/media/webrtc/signaling/src/sdp/RsdparsaSdpMediaSection.h @@ -0,0 +1,81 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set 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/. */ + +#ifndef _RUSTSDPMEDIASECTION_H_ +#define _RUSTSDPMEDIASECTION_H_ + +#include "mozilla/Attributes.h" +#include "mozilla/UniquePtr.h" +#include "signaling/src/sdp/RsdparsaSdpInc.h" +#include "signaling/src/sdp/RsdparsaSdpGlue.h" +#include "signaling/src/sdp/SdpMediaSection.h" +#include "signaling/src/sdp/RsdparsaSdpAttributeList.h" + +#include + +namespace mozilla +{ + +class RsdparsaSdp; +class SdpErrorHolder; + +class RsdparsaSdpMediaSection final : public SdpMediaSection +{ + friend class RsdparsaSdp; + +public: + ~RsdparsaSdpMediaSection() {} + + MediaType + GetMediaType() const override + { + return mMediaType; + } + + unsigned int GetPort() const override; + void SetPort(unsigned int port) override; + unsigned int GetPortCount() const override; + Protocol GetProtocol() const override; + const SdpConnection& GetConnection() const override; + SdpConnection& GetConnection() override; + uint32_t GetBandwidth(const std::string& type) const override; + const std::vector& GetFormats() const override; + + const SdpAttributeList& GetAttributeList() const override; + SdpAttributeList& GetAttributeList() override; + SdpDirectionAttribute GetDirectionAttribute() const override; + + void AddCodec(const std::string& pt, const std::string& name, + uint32_t clockrate, uint16_t channels) override; + void ClearCodecs() override; + + void AddDataChannel(const std::string& name, uint16_t port, + uint16_t streams, uint32_t message_size) override; + + void Serialize(std::ostream&) const override; + +private: + RsdparsaSdpMediaSection(size_t level, + RsdparsaSessionHandle session, + const RustMediaSection* const section, + const RsdparsaSdpAttributeList* sessionLevel); + + void LoadFormats(); + void LoadConnection(); + + RsdparsaSessionHandle mSession; + const RustMediaSection* mSection; + + MediaType mMediaType; + std::vector mFormats; + + UniquePtr mConnection; + + UniquePtr mAttributeList; +}; +} + +#endif diff --git a/media/webrtc/signaling/src/sdp/RsdparsaSdpParser.cpp b/media/webrtc/signaling/src/sdp/RsdparsaSdpParser.cpp new file mode 100644 index 000000000000..e4d0b27bd20d --- /dev/null +++ b/media/webrtc/signaling/src/sdp/RsdparsaSdpParser.cpp @@ -0,0 +1,53 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set 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/. */ + +#include "nsError.h" + +#include "mozilla/UniquePtr.h" + +#include "signaling/src/sdp/Sdp.h" +#include "signaling/src/sdp/SdpEnum.h" +#include "signaling/src/sdp/RsdparsaSdp.h" +#include "signaling/src/sdp/RsdparsaSdpParser.h" +#include "signaling/src/sdp/RsdparsaSdpInc.h" +#include "signaling/src/sdp/RsdparsaSdpGlue.h" + +namespace mozilla +{ + +UniquePtr +RsdparsaSdpParser::Parse(const std::string &sdpText) +{ + ClearParseErrors(); + const char* rawString = sdpText.c_str(); + RustSdpSession* result; + RustSdpError* err; + nsresult rv = parse_sdp(rawString, sdpText.length() + 1, false, + &result, &err); + if (rv != NS_OK) { + // TODO: err should eventually never be null if rv != NS_OK + // see Bug 1433529 + if (err != nullptr) { + size_t line = sdp_get_error_line_num(err); + std::string errMsg = convertStringView(sdp_get_error_message(err)); + sdp_free_error(err); + AddParseError(line, errMsg); + } else { + AddParseError(0, "Unhandled Rsdparsa parsing error"); + } + return nullptr; + } + RsdparsaSessionHandle uniqueResult; + uniqueResult.reset(result); + RustSdpOrigin rustOrigin = sdp_get_origin(uniqueResult.get()); + sdp::AddrType addrType = convertAddressType(rustOrigin.addr.addrType); + SdpOrigin origin(convertStringView(rustOrigin.username), + rustOrigin.sessionId, rustOrigin.sessionVersion, + addrType, std::string(rustOrigin.addr.unicastAddr)); + return MakeUnique(Move(uniqueResult), origin); +} + +} // namespace mozilla diff --git a/media/webrtc/signaling/src/sdp/RsdparsaSdpParser.h b/media/webrtc/signaling/src/sdp/RsdparsaSdpParser.h new file mode 100644 index 000000000000..d8e97fceb1b7 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/RsdparsaSdpParser.h @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set 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/. */ + +#ifndef _RUSTSDPPARSER_H_ +#define _RUSTSDPPARSER_H_ + +#include + +#include "mozilla/UniquePtr.h" + +#include "signaling/src/sdp/Sdp.h" +#include "signaling/src/sdp/SdpErrorHolder.h" + +namespace mozilla +{ + +class RsdparsaSdpParser final : public SdpErrorHolder +{ +public: + RsdparsaSdpParser() {} + virtual ~RsdparsaSdpParser() {} + + /** + * This parses the provided text into an SDP object. + * This returns a nullptr-valued pointer if things go poorly. + */ + UniquePtr Parse(const std::string& sdpText); +}; + +} // namespace mozilla + +#endif diff --git a/media/webrtc/signaling/src/sdp/SdpHelper.cpp b/media/webrtc/signaling/src/sdp/SdpHelper.cpp index 011dc30c7b98..f9714ff65854 100644 --- a/media/webrtc/signaling/src/sdp/SdpHelper.cpp +++ b/media/webrtc/signaling/src/sdp/SdpHelper.cpp @@ -819,6 +819,66 @@ SdpHelper::GetMsectionBundleType(const Sdp& sdp, return kNoBundle; } +static bool +AttributeListMatch(const SdpAttributeList& list1, const SdpAttributeList& list2) +{ + // TODO: Consider adding telemetry in this function to record which + // attributes don't match. See Bug 1432955. + for (int i = SdpAttribute::kFirstAttribute; i <= SdpAttribute::kLastAttribute; i++) { + auto attributeType = static_cast(i); + // TODO: We should do more thorough checking here, e.g. serialize and + // compare strings. See Bug 1439690. + if (list1.HasAttribute(attributeType, false) != + list2.HasAttribute(attributeType, false)) { + return false; + } + } + return true; +} + +static bool +MediaSectionMatch(const SdpMediaSection& mediaSection1, + const SdpMediaSection& mediaSection2) +{ + // TODO: We should do more thorough checking in this function. + // See Bug 1439690. + if (!AttributeListMatch(mediaSection1.GetAttributeList(), + mediaSection2.GetAttributeList())) { + return false; + } + if (mediaSection1.GetPort() != mediaSection2.GetPort()) { + return false; + } + const std::vector& formats1 = mediaSection1.GetFormats(); + const std::vector& formats2 = mediaSection2.GetFormats(); + auto formats1Set = std::set(formats1.begin(), formats1.end()); + auto formats2Set = std::set(formats2.begin(), formats2.end()); + if (formats1Set != formats2Set) { + return false; + } + return true; +} + +bool +SdpHelper::SdpMatch(const Sdp& sdp1, const Sdp& sdp2) +{ + if (sdp1.GetMediaSectionCount() != sdp2.GetMediaSectionCount()) { + return false; + } + if (!AttributeListMatch(sdp1.GetAttributeList(), sdp2.GetAttributeList())) { + return false; + } + for (size_t i = 0; i < sdp1.GetMediaSectionCount(); i++) { + const SdpMediaSection& mediaSection1 = sdp1.GetMediaSection(i); + const SdpMediaSection& mediaSection2 = sdp2.GetMediaSection(i); + if (!MediaSectionMatch(mediaSection1, mediaSection2)) { + return false; + } + } + + return true; +} + } // namespace mozilla diff --git a/media/webrtc/signaling/src/sdp/SdpHelper.h b/media/webrtc/signaling/src/sdp/SdpHelper.h index 60b1218df9ae..ba5bb20c3b40 100644 --- a/media/webrtc/signaling/src/sdp/SdpHelper.h +++ b/media/webrtc/signaling/src/sdp/SdpHelper.h @@ -120,6 +120,8 @@ class SdpHelper { const std::vector& localExtensions, SdpMediaSection* localMsection); + bool SdpMatch(const Sdp& sdp1, const Sdp& sdp2); + private: std::string& mLastError; diff --git a/media/webrtc/signaling/src/sdp/moz.build b/media/webrtc/signaling/src/sdp/moz.build index 4d19a24bd726..7163a64423e5 100644 --- a/media/webrtc/signaling/src/sdp/moz.build +++ b/media/webrtc/signaling/src/sdp/moz.build @@ -37,8 +37,15 @@ UNIFIED_SOURCES += [ 'SipccSdpParser.cpp', ] -# Multiple definitions of "logTag" mean we can't use unified build here. SOURCES += [ + # Building these as part of the unified build leads to multiply defined + # symbols on windows. + 'RsdparsaSdp.cpp', + 'RsdparsaSdpAttributeList.cpp', + 'RsdparsaSdpGlue.cpp', + 'RsdparsaSdpMediaSection.cpp', + 'RsdparsaSdpParser.cpp', + # Multiple definitions of "logTag" mean we can't use unified build here. 'sipcc/cpr_string.c', 'sipcc/sdp_access.c', 'sipcc/sdp_attr.c', diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/.gitignore b/media/webrtc/signaling/src/sdp/rsdparsa/.gitignore new file mode 100644 index 000000000000..a9d37c560c6a --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/.gitignore @@ -0,0 +1,2 @@ +target +Cargo.lock diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/.travis.yml b/media/webrtc/signaling/src/sdp/rsdparsa/.travis.yml new file mode 100644 index 000000000000..e301aa4b5803 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/.travis.yml @@ -0,0 +1,68 @@ +language: rust +cache: cargo +sudo: true +os: + - linux +# Taken out temporarily because it's to slow +# - osx + +rust: + - nightly + - beta + - stable + # mimimum stable version because we use init shorthand + - 1.17.0 + +matrix: + allow_failures: + - rust: nightly + +before_install: + - sudo apt-get update + +addons: + apt: + packages: + - libcurl4-openssl-dev + - libelf-dev + - libdw-dev + - cmake + - gcc + - binutils-dev + +# Add clippy +before_script: + - export PATH=$PATH:~/.cargo/bin + - | + if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then + cargo install --force clippy; + fi + +script: + - cargo build --verbose --all + - | + if [[ "$TRAVIS_RUST_VERSION" == "nightly" && + -f ~/.cargo/bin/cargo-clippy ]]; then + cargo clippy; + fi + - cargo test --verbose --all + +after_success: + - | + if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_RUST_VERSION" == "stable" ]]; then + wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz && + tar xzf master.tar.gz && + cd kcov-master && + mkdir build && + cd build && + cmake .. && + make && + sudo make install && + cd ../.. && + rm -rf kcov-master && + kcov --version && + for file in target/debug/rsdparsa-*[^\.d]; do echo "$file"; mkdir -p "target/cov/$(basename $file)"; kcov --verify --exclude-pattern=/.cargo,/usr/lib "target/cov/$(basename $file)" "$file"; done && + for file in target/debug/unit_tests-*[^\.d]; do echo "$file"; mkdir -p "target/cov/$(basename $file)"; kcov --verify --exclude-pattern=/.cargo,/usr/lib "target/cov/$(basename $file)" "$file"; done && + bash <(curl -s https://codecov.io/bash) && + echo "Uploaded code coverage" + fi diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/Cargo.toml b/media/webrtc/signaling/src/sdp/rsdparsa/Cargo.toml new file mode 100644 index 000000000000..c1f0790e5c3b --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "rsdparsa" +version = "0.1.0" +authors = ["Nils Ohlmeier "] + +[features] +default = [] diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/LICENSE b/media/webrtc/signaling/src/sdp/rsdparsa/LICENSE new file mode 100644 index 000000000000..a612ad9813b0 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/LICENSE @@ -0,0 +1,373 @@ +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + 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/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/README.md b/media/webrtc/signaling/src/sdp/rsdparsa/README.md new file mode 100644 index 000000000000..824da17b6345 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/README.md @@ -0,0 +1,13 @@ +# rsdparsa + +[![Build Status](https://travis-ci.org/nils-ohlmeier/rsdparsa.svg?branch=master)](https://travis-ci.org/nils-ohlmeier/rsdparsa) +[![Codecov coverage status](https://codecov.io/gh/nils-ohlmeier/rsdparsa/branch/master/graph/badge.svg)](https://codecov.io/gh/nils-ohlmeier/rsdparsa) +[![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](#License) + +A SDP parser written in Rust specifically aimed for WebRTC + +Requires minimum Rust 1.17 + +## License + +Licensed under [MPL](https://www.mozilla.org/MPL/2.0/). diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/attribute_type.rs b/media/webrtc/signaling/src/sdp/rsdparsa/src/attribute_type.rs new file mode 100644 index 000000000000..2cb24098d133 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/attribute_type.rs @@ -0,0 +1,1457 @@ +use std::net::IpAddr; +use std::str::FromStr; +use std::fmt; + +use SdpType; +use error::SdpParserInternalError; +use network::{parse_nettype, parse_addrtype, parse_unicast_addr}; + +#[derive(Clone)] +pub enum SdpAttributeCandidateTransport { + Udp, + Tcp, +} + +#[derive(Clone)] +pub enum SdpAttributeCandidateType { + Host, + Srflx, + Prflx, + Relay, +} + +#[derive(Clone)] +pub enum SdpAttributeCandidateTcpType { + Active, + Passive, + Simultaneous, +} + +#[derive(Clone)] +pub struct SdpAttributeCandidate { + pub foundation: String, + pub component: u32, + pub transport: SdpAttributeCandidateTransport, + pub priority: u64, + pub address: IpAddr, + pub port: u32, + pub c_type: SdpAttributeCandidateType, + pub raddr: Option, + pub rport: Option, + pub tcp_type: Option, + pub generation: Option, + pub ufrag: Option, + pub networkcost: Option, +} + +impl SdpAttributeCandidate { + pub fn new(foundation: String, + component: u32, + transport: SdpAttributeCandidateTransport, + priority: u64, + address: IpAddr, + port: u32, + c_type: SdpAttributeCandidateType) + -> SdpAttributeCandidate { + SdpAttributeCandidate { + foundation, + component, + transport, + priority, + address, + port, + c_type, + raddr: None, + rport: None, + tcp_type: None, + generation: None, + ufrag: None, + networkcost: None, + } + } + + fn set_remote_address(&mut self, ip: IpAddr) { + self.raddr = Some(ip) + } + + fn set_remote_port(&mut self, p: u32) { + self.rport = Some(p) + } + + fn set_tcp_type(&mut self, t: SdpAttributeCandidateTcpType) { + self.tcp_type = Some(t) + } + + fn set_generation(&mut self, g: u32) { + self.generation = Some(g) + } + + fn set_ufrag(&mut self, u: String) { + self.ufrag = Some(u) + } + + fn set_network_cost(&mut self, n: u32) { + self.networkcost = Some(n) + } +} + +#[derive(Clone)] +pub struct SdpAttributeRemoteCandidate { + pub component: u32, + pub address: IpAddr, + pub port: u32, +} + +#[derive(Clone)] +pub struct SdpAttributeSimulcastId { + pub id: String, + pub paused: bool, +} + +impl SdpAttributeSimulcastId { + pub fn new(idstr: String) -> SdpAttributeSimulcastId { + if idstr.starts_with('~') { + SdpAttributeSimulcastId { + id: idstr[1..].to_string(), + paused: true, + } + } else { + SdpAttributeSimulcastId { + id: idstr, + paused: false, + } + } + } +} + +#[derive(Clone)] +pub struct SdpAttributeSimulcastAlternatives { + pub ids: Vec, +} + +impl SdpAttributeSimulcastAlternatives { + pub fn new(idlist: String) -> SdpAttributeSimulcastAlternatives { + SdpAttributeSimulcastAlternatives { + ids: idlist + .split(',') + .map(|x| x.to_string()) + .map(SdpAttributeSimulcastId::new) + .collect(), + } + } +} + +#[derive(Clone)] +pub struct SdpAttributeSimulcast { + pub send: Vec, + pub receive: Vec, +} + +impl SdpAttributeSimulcast { + fn parse_ids(&mut self, direction: SdpAttributeDirection, idlist: String) { + let list = idlist + .split(';') + .map(|x| x.to_string()) + .map(SdpAttributeSimulcastAlternatives::new) + .collect(); + // TODO prevent over-writing existing values + match direction { + SdpAttributeDirection::Recvonly => self.receive = list, + SdpAttributeDirection::Sendonly => self.send = list, + _ => (), + } + } +} + +#[derive(Clone)] +pub struct SdpAttributeRtcp { + pub port: u16, + pub unicast_addr: Option, +} + +impl SdpAttributeRtcp { + pub fn new(port: u16) -> SdpAttributeRtcp { + SdpAttributeRtcp { + port, + unicast_addr: None, + } + } + + fn set_addr(&mut self, addr: IpAddr) { + self.unicast_addr = Some(addr) + } +} + +#[derive(Clone)] +pub struct SdpAttributeRtcpFb { + pub payload_type: u32, + // TODO parse this and use an enum instead? + pub feedback_type: String, +} + +#[derive(Clone)] +pub enum SdpAttributeDirection { + Recvonly, + Sendonly, + Sendrecv, +} + +#[derive(Clone)] +pub struct SdpAttributeExtmap { + pub id: u16, + pub direction: Option, + pub url: String, + pub extension_attributes: Option, +} + +#[derive(Clone)] +pub struct SdpAttributeFmtp { + pub payload_type: u8, + pub tokens: Vec, +} + +#[derive(Clone)] +pub struct SdpAttributeFingerprint { + // TODO turn the supported hash algorithms into an enum? + pub hash_algorithm: String, + pub fingerprint: String, +} + +#[derive(Clone)] +pub struct SdpAttributeSctpmap { + pub port: u16, + pub channels: u32, +} + +#[derive(Clone)] +pub enum SdpAttributeGroupSemantic { + LipSynchronization, + FlowIdentification, + SingleReservationFlow, + AlternateNetworkAddressType, + ForwardErrorCorrection, + DecodingDependency, + Bundle, +} + +#[derive(Clone)] +pub struct SdpAttributeGroup { + pub semantics: SdpAttributeGroupSemantic, + pub tags: Vec, +} + +#[derive(Clone)] +pub struct SdpAttributeMsid { + pub id: String, + pub appdata: Option, +} + +#[derive(Clone, Debug)] +pub struct SdpAttributeMsidSemantic { + pub semantic: String, + pub msids: Vec, +} + +#[derive(Clone)] +pub struct SdpAttributeRtpmap { + pub payload_type: u8, + pub codec_name: String, + pub frequency: u32, + pub channels: Option, +} + +impl SdpAttributeRtpmap { + pub fn new(payload_type: u8, codec_name: String, frequency: u32) -> SdpAttributeRtpmap { + SdpAttributeRtpmap { + payload_type, + codec_name, + frequency, + channels: None, + } + } + + fn set_channels(&mut self, c: u32) { + self.channels = Some(c) + } +} + +#[derive(Clone)] +pub enum SdpAttributeSetup { + Active, + Actpass, + Holdconn, + Passive, +} + +#[derive(Clone)] +pub struct SdpAttributeSsrc { + pub id: u32, + pub attribute: Option, + pub value: Option, +} + +impl SdpAttributeSsrc { + pub fn new(id: u32) -> SdpAttributeSsrc { + SdpAttributeSsrc { + id, + attribute: None, + value: None, + } + } + + fn set_attribute(&mut self, a: &str) { + if a.find(':') == None { + self.attribute = Some(a.to_string()); + } else { + let v: Vec<&str> = a.splitn(2, ':').collect(); + self.attribute = Some(v[0].to_string()); + self.value = Some(v[1].to_string()); + } + } +} + +#[derive(Clone)] +pub enum SdpAttribute { + BundleOnly, + Candidate(SdpAttributeCandidate), + EndOfCandidates, + Extmap(SdpAttributeExtmap), + Fingerprint(SdpAttributeFingerprint), + Fmtp(SdpAttributeFmtp), + Group(SdpAttributeGroup), + IceLite, + IceMismatch, + IceOptions(Vec), + IcePwd(String), + IceUfrag(String), + Identity(String), + ImageAttr(String), + Inactive, + Label(String), + MaxMessageSize(u64), + MaxPtime(u64), + Mid(String), + Msid(SdpAttributeMsid), + MsidSemantic(SdpAttributeMsidSemantic), + Ptime(u64), + Rid(String), + Recvonly, + RemoteCandidate(SdpAttributeRemoteCandidate), + Rtpmap(SdpAttributeRtpmap), + Rtcp(SdpAttributeRtcp), + Rtcpfb(SdpAttributeRtcpFb), + RtcpMux, + RtcpRsize, + Sctpmap(SdpAttributeSctpmap), + SctpPort(u64), + Sendonly, + Sendrecv, + Setup(SdpAttributeSetup), + Simulcast(SdpAttributeSimulcast), + Ssrc(SdpAttributeSsrc), + SsrcGroup(String), +} + +impl SdpAttribute { + pub fn allowed_at_session_level(&self) -> bool { + match *self { + SdpAttribute::BundleOnly | + SdpAttribute::Candidate(..) | + SdpAttribute::Fmtp(..) | + SdpAttribute::IceMismatch | + SdpAttribute::ImageAttr(..) | + SdpAttribute::Label(..) | + SdpAttribute::MaxMessageSize(..) | + SdpAttribute::MaxPtime(..) | + SdpAttribute::Mid(..) | + SdpAttribute::Msid(..) | + SdpAttribute::Ptime(..) | + SdpAttribute::Rid(..) | + SdpAttribute::RemoteCandidate(..) | + SdpAttribute::Rtpmap(..) | + SdpAttribute::Rtcp(..) | + SdpAttribute::Rtcpfb(..) | + SdpAttribute::RtcpMux | + SdpAttribute::RtcpRsize | + SdpAttribute::Sctpmap(..) | + SdpAttribute::SctpPort(..) | + SdpAttribute::Simulcast(..) | + SdpAttribute::Ssrc(..) | + SdpAttribute::SsrcGroup(..) => false, + + SdpAttribute::EndOfCandidates | + SdpAttribute::Extmap(..) | + SdpAttribute::Fingerprint(..) | + SdpAttribute::Group(..) | + SdpAttribute::IceLite | + SdpAttribute::IceOptions(..) | + SdpAttribute::IcePwd(..) | + SdpAttribute::IceUfrag(..) | + SdpAttribute::Identity(..) | + SdpAttribute::Inactive | + SdpAttribute::MsidSemantic(..) | + SdpAttribute::Recvonly | + SdpAttribute::Sendonly | + SdpAttribute::Sendrecv | + SdpAttribute::Setup(..) => true, + } + } + + pub fn allowed_at_media_level(&self) -> bool { + match *self { + SdpAttribute::Group(..) | + SdpAttribute::IceLite | + SdpAttribute::Identity(..) | + SdpAttribute::MsidSemantic(..) => false, + + SdpAttribute::BundleOnly | + SdpAttribute::Candidate(..) | + SdpAttribute::EndOfCandidates | + SdpAttribute::Extmap(..) | + SdpAttribute::Fingerprint(..) | + SdpAttribute::Fmtp(..) | + SdpAttribute::IceMismatch | + SdpAttribute::IceOptions(..) | + SdpAttribute::IcePwd(..) | + SdpAttribute::IceUfrag(..) | + SdpAttribute::ImageAttr(..) | + SdpAttribute::Inactive | + SdpAttribute::Label(..) | + SdpAttribute::MaxMessageSize(..) | + SdpAttribute::MaxPtime(..) | + SdpAttribute::Mid(..) | + SdpAttribute::Msid(..) | + SdpAttribute::Ptime(..) | + SdpAttribute::Rid(..) | + SdpAttribute::Recvonly | + SdpAttribute::RemoteCandidate(..) | + SdpAttribute::Rtpmap(..) | + SdpAttribute::Rtcp(..) | + SdpAttribute::Rtcpfb(..) | + SdpAttribute::RtcpMux | + SdpAttribute::RtcpRsize | + SdpAttribute::Sctpmap(..) | + SdpAttribute::SctpPort(..) | + SdpAttribute::Sendonly | + SdpAttribute::Sendrecv | + SdpAttribute::Setup(..) | + SdpAttribute::Simulcast(..) | + SdpAttribute::Ssrc(..) | + SdpAttribute::SsrcGroup(..) => true, + } + } +} + +impl fmt::Display for SdpAttribute { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let printable = match *self { + SdpAttribute::BundleOnly => "bundle-only", + SdpAttribute::Candidate(..) => "candidate", + SdpAttribute::EndOfCandidates => "end-of-candidates", + SdpAttribute::Extmap(..) => "extmap", + SdpAttribute::Fingerprint(..) => "fingerprint", + SdpAttribute::Fmtp(..) => "fmtp", + SdpAttribute::Group(..) => "group", + SdpAttribute::IceLite => "ice-lite", + SdpAttribute::IceMismatch => "ice-mismatch", + SdpAttribute::IceOptions(..) => "ice-options", + SdpAttribute::IcePwd(..) => "ice-pwd", + SdpAttribute::IceUfrag(..) => "ice-ufrag", + SdpAttribute::Identity(..) => "identity", + SdpAttribute::ImageAttr(..) => "imageattr", + SdpAttribute::Inactive => "inactive", + SdpAttribute::Label(..) => "label", + SdpAttribute::MaxMessageSize(..) => "max-message-size", + SdpAttribute::MaxPtime(..) => "max-ptime", + SdpAttribute::Mid(..) => "mid", + SdpAttribute::Msid(..) => "msid", + SdpAttribute::MsidSemantic(..) => "msid-semantic", + SdpAttribute::Ptime(..) => "ptime", + SdpAttribute::Rid(..) => "rid", + SdpAttribute::Recvonly => "recvonly", + SdpAttribute::RemoteCandidate(..) => "remote-candidate", + SdpAttribute::Rtpmap(..) => "rtpmap", + SdpAttribute::Rtcp(..) => "rtcp", + SdpAttribute::Rtcpfb(..) => "rtcp-fb", + SdpAttribute::RtcpMux => "rtcp-mux", + SdpAttribute::RtcpRsize => "rtcp-rsize", + SdpAttribute::Sctpmap(..) => "sctpmap", + SdpAttribute::SctpPort(..) => "sctp-port", + SdpAttribute::Sendonly => "sendonly", + SdpAttribute::Sendrecv => "sendrecv", + SdpAttribute::Setup(..) => "setup", + SdpAttribute::Simulcast(..) => "simulcast", + SdpAttribute::Ssrc(..) => "ssrc", + SdpAttribute::SsrcGroup(..) => "ssrc-group", + }; + write!(f, "attribute: {}", printable) + } +} +impl FromStr for SdpAttribute { + type Err = SdpParserInternalError; + + fn from_str(line: &str) -> Result { + let tokens: Vec<_> = line.splitn(2, ':').collect(); + let name = tokens[0].to_lowercase(); + let val = match tokens.get(1) { + Some(x) => x.trim(), + None => "", + }; + if tokens.len() > 1 { + match name.as_str() { + "bundle-only" | + "end-of-candidates" | + "ice-lite" | + "ice-mismatch" | + "inactive" | + "recvonly" | + "rtcp-mux" | + "rtcp-rsize" | + "sendonly" | + "sendrecv" => { + return Err(SdpParserInternalError::Generic(format!("{} attribute is not allowed to have a value", + name))); + } + _ => (), + } + } + match name.as_str() { + "bundle-only" => Ok(SdpAttribute::BundleOnly), + "end-of-candidates" => Ok(SdpAttribute::EndOfCandidates), + "ice-lite" => Ok(SdpAttribute::IceLite), + "ice-mismatch" => Ok(SdpAttribute::IceMismatch), + "ice-pwd" => Ok(SdpAttribute::IcePwd(string_or_empty(val)?)), + "ice-ufrag" => Ok(SdpAttribute::IceUfrag(string_or_empty(val)?)), + "identity" => Ok(SdpAttribute::Identity(string_or_empty(val)?)), + "imageattr" => Ok(SdpAttribute::ImageAttr(string_or_empty(val)?)), + "inactive" => Ok(SdpAttribute::Inactive), + "label" => Ok(SdpAttribute::Label(string_or_empty(val)?)), + "max-message-size" => Ok(SdpAttribute::MaxMessageSize(val.parse()?)), + "maxptime" => Ok(SdpAttribute::MaxPtime(val.parse()?)), + "mid" => Ok(SdpAttribute::Mid(string_or_empty(val)?)), + "msid-semantic" => parse_msid_semantic(val), + "ptime" => Ok(SdpAttribute::Ptime(val.parse()?)), + "rid" => Ok(SdpAttribute::Rid(string_or_empty(val)?)), + "recvonly" => Ok(SdpAttribute::Recvonly), + "rtcp-mux" => Ok(SdpAttribute::RtcpMux), + "rtcp-rsize" => Ok(SdpAttribute::RtcpRsize), + "sendonly" => Ok(SdpAttribute::Sendonly), + "sendrecv" => Ok(SdpAttribute::Sendrecv), + "ssrc-group" => Ok(SdpAttribute::SsrcGroup(string_or_empty(val)?)), + "sctp-port" => parse_sctp_port(val), + "candidate" => parse_candidate(val), + "extmap" => parse_extmap(val), + "fingerprint" => parse_fingerprint(val), + "fmtp" => parse_fmtp(val), + "group" => parse_group(val), + "ice-options" => parse_ice_options(val), + "msid" => parse_msid(val), + "remote-candidates" => parse_remote_candidates(val), + "rtpmap" => parse_rtpmap(val), + "rtcp" => parse_rtcp(val), + "rtcp-fb" => parse_rtcp_fb(val), + "sctpmap" => parse_sctpmap(val), + "setup" => parse_setup(val), + "simulcast" => parse_simulcast(val), + "ssrc" => parse_ssrc(val), + _ => { + Err(SdpParserInternalError::Unsupported(format!("Unknown attribute type {}", name))) + } + } + } +} + +fn string_or_empty(to_parse: &str) -> Result { + if to_parse.is_empty() { + Err(SdpParserInternalError::Generic("This attribute is required to have a value" + .to_string())) + } else { + Ok(to_parse.to_string()) + } +} + +fn parse_sctp_port(to_parse: &str) -> Result { + let port = to_parse.parse()?; + if port > 65535 { + return Err(SdpParserInternalError::Generic(format!("Sctpport port {} can only be a bit 16bit number", + port))); + } + Ok(SdpAttribute::SctpPort(port)) +} + +fn parse_candidate(to_parse: &str) -> Result { + let tokens: Vec<&str> = to_parse.split_whitespace().collect(); + if tokens.len() < 8 { + return Err(SdpParserInternalError::Generic("Candidate needs to have minimum eigth tokens" + .to_string())); + } + let component = tokens[1].parse::()?; + let transport = match tokens[2].to_lowercase().as_ref() { + "udp" => SdpAttributeCandidateTransport::Udp, + "tcp" => SdpAttributeCandidateTransport::Tcp, + _ => { + return Err(SdpParserInternalError::Generic("Unknonw candidate transport value" + .to_string())) + } + }; + let priority = tokens[3].parse::()?; + let address = parse_unicast_addr(tokens[4])?; + let port = tokens[5].parse::()?; + if port > 65535 { + return Err(SdpParserInternalError::Generic("ICE candidate port can only be a bit 16bit number".to_string())); + } + match tokens[6].to_lowercase().as_ref() { + "typ" => (), + _ => { + return Err(SdpParserInternalError::Generic("Candidate attribute token must be 'typ'" + .to_string())) + } + }; + let cand_type = match tokens[7].to_lowercase().as_ref() { + "host" => SdpAttributeCandidateType::Host, + "srflx" => SdpAttributeCandidateType::Srflx, + "prflx" => SdpAttributeCandidateType::Prflx, + "relay" => SdpAttributeCandidateType::Relay, + _ => return Err(SdpParserInternalError::Generic("Unknow candidate type value".to_string())), + }; + let mut cand = SdpAttributeCandidate::new(tokens[0].to_string(), + component, + transport, + priority, + address, + port, + cand_type); + if tokens.len() > 8 { + let mut index = 8; + while tokens.len() > index + 1 { + match tokens[index].to_lowercase().as_ref() { + "generation" => { + let generation = tokens[index + 1].parse::()?; + cand.set_generation(generation); + index += 2; + } + "network-cost" => { + let cost = tokens[index + 1].parse::()?; + cand.set_network_cost(cost); + index += 2; + } + "raddr" => { + let addr = parse_unicast_addr(tokens[index + 1])?; + cand.set_remote_address(addr); + index += 2; + } + "rport" => { + let port = tokens[index + 1].parse::()?; + if port > 65535 { + return Err(SdpParserInternalError::Generic( "ICE candidate rport can only be a bit 16bit number".to_string())); + } + cand.set_remote_port(port); + index += 2; + } + "tcptype" => { + cand.set_tcp_type(match tokens[index + 1].to_lowercase().as_ref() { + "active" => SdpAttributeCandidateTcpType::Active, + "passive" => SdpAttributeCandidateTcpType::Passive, + "so" => SdpAttributeCandidateTcpType::Simultaneous, + _ => { + return Err(SdpParserInternalError::Generic("Unknown tcptype value in candidate line".to_string())) + } + }); + index += 2; + } + "ufrag" => { + let ufrag = tokens[index + 1]; + cand.set_ufrag(ufrag.to_string()); + index += 2; + } + _ => { + return Err(SdpParserInternalError::Unsupported("Uknown candidate extension name" + .to_string())) + } + }; + } + } + Ok(SdpAttribute::Candidate(cand)) +} + +// ABNF for extmap is defined in RFC 5285 +// https://tools.ietf.org/html/rfc5285#section-7 +fn parse_extmap(to_parse: &str) -> Result { + let tokens: Vec<&str> = to_parse.split_whitespace().collect(); + if tokens.len() < 2 { + return Err(SdpParserInternalError::Generic("Extmap needs to have at least two tokens" + .to_string())); + } + let id: u16; + let mut direction: Option = None; + if tokens[0].find('/') == None { + id = tokens[0].parse::()?; + } else { + let id_dir: Vec<&str> = tokens[0].splitn(2, '/').collect(); + id = id_dir[0].parse::()?; + direction = Some(match id_dir[1].to_lowercase().as_ref() { + "recvonly" => SdpAttributeDirection::Recvonly, + "sendonly" => SdpAttributeDirection::Sendonly, + "sendrecv" => SdpAttributeDirection::Sendrecv, + _ => { + return Err(SdpParserInternalError::Generic("Unsupported direction in extmap value".to_string())) + } + }) + } + // Consider replacing to_parse.split_whitespace() above with splitn on space. Would we want the pattern to split on any amout of any kind of whitespace? + let extension_attributes = if tokens.len() == 2 { + None + } else { + let ext_string: String = tokens[2..].join(" "); + if !valid_byte_string(&ext_string) { + return Err(SdpParserInternalError::Generic("Illegal character in extmap extension attributes".to_string())); + } + Some(ext_string) + }; + Ok(SdpAttribute::Extmap(SdpAttributeExtmap { + id, + direction, + url: tokens[1].to_string(), + extension_attributes: extension_attributes, + })) +} + +fn parse_fingerprint(to_parse: &str) -> Result { + let tokens: Vec<&str> = to_parse.split_whitespace().collect(); + if tokens.len() != 2 { + return Err(SdpParserInternalError::Generic("Fingerprint needs to have two tokens" + .to_string())); + } + Ok(SdpAttribute::Fingerprint(SdpAttributeFingerprint { + hash_algorithm: tokens[0].to_string(), + fingerprint: tokens[1].to_string(), + })) +} + +fn parse_fmtp(to_parse: &str) -> Result { + let tokens: Vec<&str> = to_parse.split_whitespace().collect(); + if tokens.len() != 2 { + return Err(SdpParserInternalError::Generic("Fmtp needs to have two tokens".to_string())); + } + Ok(SdpAttribute::Fmtp(SdpAttributeFmtp { + // TODO check for dynamic PT range + payload_type: tokens[0].parse::()?, + // TODO this should probably be slit into known tokens + // plus a list of unknown tokens + tokens: to_parse.split(';').map(|x| x.to_string()).collect(), + })) +} + +fn parse_group(to_parse: &str) -> Result { + let mut tokens = to_parse.split_whitespace(); + let semantics = match tokens.next() { + None => { + return Err(SdpParserInternalError::Generic("Group attribute is missing semantics token" + .to_string())) + } + Some(x) => { + match x.to_uppercase().as_ref() { + "LS" => SdpAttributeGroupSemantic::LipSynchronization, + "FID" => SdpAttributeGroupSemantic::FlowIdentification, + "SRF" => SdpAttributeGroupSemantic::SingleReservationFlow, + "ANAT" => SdpAttributeGroupSemantic::AlternateNetworkAddressType, + "FEC" => SdpAttributeGroupSemantic::ForwardErrorCorrection, + "DDP" => SdpAttributeGroupSemantic::DecodingDependency, + "BUNDLE" => SdpAttributeGroupSemantic::Bundle, + _ => { + return Err(SdpParserInternalError::Generic("Unsupported group semantics" + .to_string())) + } + } + } + }; + Ok(SdpAttribute::Group(SdpAttributeGroup { + semantics, + tags: tokens.map(|x| x.to_string()).collect(), + })) +} + +fn parse_ice_options(to_parse: &str) -> Result { + if to_parse.is_empty() { + return Err(SdpParserInternalError::Generic("ice-options is required to have a value" + .to_string())); + } + Ok(SdpAttribute::IceOptions(to_parse.split_whitespace().map(|x| x.to_string()).collect())) +} + +fn parse_msid(to_parse: &str) -> Result { + let mut tokens = to_parse.split_whitespace(); + let id = match tokens.next() { + None => { + return Err(SdpParserInternalError::Generic("Msid attribute is missing msid-id token" + .to_string())) + } + Some(x) => x.to_string(), + }; + let appdata = match tokens.next() { + None => None, + Some(x) => Some(x.to_string()), + }; + Ok(SdpAttribute::Msid(SdpAttributeMsid { id, appdata })) + +} + +fn parse_msid_semantic(to_parse: &str) -> Result { + let tokens: Vec<_> = to_parse.split_whitespace().collect(); + if tokens.len() < 1 { + return Err(SdpParserInternalError::Generic("Msid-semantic attribute is missing msid-semantic token" + .to_string())); + } + // TODO: Should msids be checked to ensure they are non empty? + let semantic = SdpAttributeMsidSemantic { + semantic: tokens[0].to_string(), + msids: tokens[1..].iter().map(|x| x.to_string()).collect(), + }; + Ok(SdpAttribute::MsidSemantic(semantic)) +} + +fn parse_remote_candidates(to_parse: &str) -> Result { + let mut tokens = to_parse.split_whitespace(); + let component = match tokens.next() { + None => { + return Err(SdpParserInternalError::Generic( + "Remote-candidate attribute is missing component ID" + .to_string(), + )) + } + Some(x) => x.parse::()?, + }; + let address = match tokens.next() { + None => { + return Err(SdpParserInternalError::Generic( + "Remote-candidate attribute is missing connection address" + .to_string(), + )) + } + Some(x) => parse_unicast_addr(x)?, + }; + let port = match tokens.next() { + None => { + return Err(SdpParserInternalError::Generic( + "Remote-candidate attribute is missing port number".to_string(), + )) + } + Some(x) => x.parse::()?, + }; + if port > 65535 { + return Err(SdpParserInternalError::Generic( + "Remote-candidate port can only be a bit 16bit number".to_string(), + )); + }; + Ok(SdpAttribute::RemoteCandidate(SdpAttributeRemoteCandidate { + component, + address, + port, + })) +} + +fn parse_rtpmap(to_parse: &str) -> Result { + let mut tokens = to_parse.split_whitespace(); + let payload_type: u8 = match tokens.next() { + None => { + return Err(SdpParserInternalError::Generic("Rtpmap missing payload type".to_string())) + } + Some(x) => { + let pt = x.parse::()?; + if pt > 127 { + return Err(SdpParserInternalError::Generic("Rtpmap payload type must be less then 127".to_string())); + }; + pt + } + }; + let mut parameters = match tokens.next() { + None => { + return Err(SdpParserInternalError::Generic("Rtpmap missing payload type".to_string())) + } + Some(x) => x.split('/'), + }; + let name = match parameters.next() { + None => { + return Err(SdpParserInternalError::Generic("Rtpmap missing codec name".to_string())) + } + Some(x) => x.to_string(), + }; + let frequency = match parameters.next() { + None => { + return Err(SdpParserInternalError::Generic("Rtpmap missing codec name".to_string())) + } + Some(x) => x.parse::()?, + }; + let mut rtpmap = SdpAttributeRtpmap::new(payload_type, name, frequency); + match parameters.next() { + Some(x) => rtpmap.set_channels(x.parse::()?), + None => (), + }; + Ok(SdpAttribute::Rtpmap(rtpmap)) +} + +fn parse_rtcp(to_parse: &str) -> Result { + let mut tokens = to_parse.split_whitespace(); + let port = match tokens.next() { + None => { + return Err(SdpParserInternalError::Generic("Rtcp attribute is missing port number" + .to_string())) + } + Some(x) => x.parse::()?, + }; + let mut rtcp = SdpAttributeRtcp::new(port); + match tokens.next() { + None => (), + Some(x) => { + parse_nettype(x)?; + match tokens.next() { + None => { + return Err(SdpParserInternalError::Generic( + "Rtcp attribute is missing address type token" + .to_string(), + )) + } + Some(x) => { + let addrtype = parse_addrtype(x)?; + let addr = match tokens.next() { + None => { + return Err(SdpParserInternalError::Generic( + "Rtcp attribute is missing ip address token" + .to_string(), + )) + } + Some(x) => { + let addr = parse_unicast_addr(x)?; + if !addrtype.same_protocol(&addr) { + return Err(SdpParserInternalError::Generic( + "Failed to parse unicast address attribute.\ + addrtype does not match address." + .to_string(), + )); + } + addr + } + }; + rtcp.set_addr(addr); + } + }; + } + }; + Ok(SdpAttribute::Rtcp(rtcp)) +} + +fn parse_rtcp_fb(to_parse: &str) -> Result { + let tokens: Vec<&str> = to_parse.splitn(2, ' ').collect(); + Ok(SdpAttribute::Rtcpfb(SdpAttributeRtcpFb { + // TODO limit this to dymaic PTs + payload_type: tokens[0].parse::()?, + feedback_type: match tokens.get(1) { + Some(x) => x.to_string(), + None => { + return Err(SdpParserInternalError::Generic( + "Error parsing rtcpfb".to_string(), + )) + } + }, + })) +} + +fn parse_sctpmap(to_parse: &str) -> Result { + let tokens: Vec<&str> = to_parse.split_whitespace().collect(); + if tokens.len() != 3 { + return Err(SdpParserInternalError::Generic("Sctpmap needs to have three tokens" + .to_string())); + } + let port = tokens[0].parse::()?; + if tokens[1].to_lowercase() != "webrtc-datachannel" { + return Err(SdpParserInternalError::Generic("Unsupported sctpmap type token".to_string())); + } + Ok(SdpAttribute::Sctpmap(SdpAttributeSctpmap { + port, + channels: tokens[2].parse::()?, + })) +} + +fn parse_setup(to_parse: &str) -> Result { + Ok(SdpAttribute::Setup(match to_parse.to_lowercase().as_ref() { + "active" => SdpAttributeSetup::Active, + "actpass" => SdpAttributeSetup::Actpass, + "holdconn" => SdpAttributeSetup::Holdconn, + "passive" => SdpAttributeSetup::Passive, + _ => { + return Err(SdpParserInternalError::Generic( + "Unsupported setup value".to_string(), + )) + } + })) +} + +fn parse_simulcast(to_parse: &str) -> Result { + let mut tokens = to_parse.split_whitespace(); + let mut token = match tokens.next() { + None => { + return Err(SdpParserInternalError::Generic( + "Simulcast attribute is missing send/recv value".to_string(), + )) + } + Some(x) => x, + }; + let mut sc = SdpAttributeSimulcast { + send: Vec::new(), + receive: Vec::new(), + }; + loop { + let sendrecv = match token.to_lowercase().as_ref() { + "send" => SdpAttributeDirection::Sendonly, + "recv" => SdpAttributeDirection::Recvonly, + _ => { + return Err(SdpParserInternalError::Generic( + "Unsupported send/recv value in simulcast attribute" + .to_string(), + )) + } + }; + match tokens.next() { + None => { + return Err(SdpParserInternalError::Generic("Simulcast attribute is missing id list" + .to_string())) + } + Some(x) => sc.parse_ids(sendrecv, x.to_string()), + }; + token = match tokens.next() { + None => { + break; + } + Some(x) => x, + }; + } + Ok(SdpAttribute::Simulcast(sc)) +} + +fn parse_ssrc(to_parse: &str) -> Result { + let mut tokens = to_parse.split_whitespace(); + let ssrc_id = match tokens.next() { + None => { + return Err(SdpParserInternalError::Generic("Ssrc attribute is missing ssrc-id value" + .to_string())) + } + Some(x) => x.parse::()?, + }; + let mut ssrc = SdpAttributeSsrc::new(ssrc_id); + match tokens.next() { + None => (), + Some(x) => ssrc.set_attribute(x), + }; + Ok(SdpAttribute::Ssrc(ssrc)) +} + +pub fn parse_attribute(value: &str) -> Result { + Ok(SdpType::Attribute(value.trim().parse()?)) +} + +#[test] +fn test_parse_attribute_candidate() { + assert!(parse_attribute("candidate:0 1 UDP 2122252543 172.16.156.106 49760 typ host").is_ok()); + assert!(parse_attribute("candidate:foo 1 UDP 2122252543 172.16.156.106 49760 typ host") + .is_ok()); + assert!(parse_attribute("candidate:0 1 TCP 2122252543 172.16.156.106 49760 typ host").is_ok()); + assert!(parse_attribute("candidate:0 1 TCP 2122252543 ::1 49760 typ host").is_ok()); + assert!(parse_attribute("candidate:0 1 UDP 2122252543 172.16.156.106 49760 typ srflx").is_ok()); + assert!(parse_attribute("candidate:0 1 UDP 2122252543 172.16.156.106 49760 typ prflx").is_ok()); + assert!(parse_attribute("candidate:0 1 UDP 2122252543 172.16.156.106 49760 typ relay").is_ok()); + assert!( + parse_attribute( + "candidate:0 1 TCP 2122252543 172.16.156.106 49760 typ host tcptype active" + ).is_ok() + ); + assert!( + parse_attribute( + "candidate:0 1 TCP 2122252543 172.16.156.106 49760 typ host tcptype passive" + ).is_ok() + ); + assert!( + parse_attribute("candidate:0 1 TCP 2122252543 172.16.156.106 49760 typ host tcptype so") + .is_ok() + ); + assert!( + parse_attribute("candidate:0 1 TCP 2122252543 172.16.156.106 49760 typ host ufrag foobar") + .is_ok() + ); + assert!( + parse_attribute( + "candidate:0 1 TCP 2122252543 172.16.156.106 49760 typ host network-cost 50" + ).is_ok() + ); + assert!(parse_attribute("candidate:1 1 UDP 1685987071 24.23.204.141 54609 typ srflx raddr 192.168.1.4 rport 61665 generation 0").is_ok()); + assert!(parse_attribute("candidate:1 1 UDP 1685987071 24.23.204.141 54609 typ srflx raddr 192.168.1.4 rport 61665").is_ok()); + assert!(parse_attribute("candidate:1 1 TCP 1685987071 24.23.204.141 54609 typ srflx raddr 192.168.1.4 rport 61665 tcptype passive").is_ok()); + assert!(parse_attribute("candidate:1 1 TCP 1685987071 24.23.204.141 54609 typ srflx raddr 192.168.1.4 rport 61665 tcptype passive generation 1").is_ok()); + assert!(parse_attribute("candidate:1 1 TCP 1685987071 24.23.204.141 54609 typ srflx raddr 192.168.1.4 rport 61665 tcptype passive generation 1 ufrag +DGd").is_ok()); + assert!(parse_attribute("candidate:1 1 TCP 1685987071 24.23.204.141 54609 typ srflx raddr 192.168.1.4 rport 61665 tcptype passive generation 1 ufrag +DGd network-cost 1").is_ok()); + + assert!(parse_attribute("candidate:0 1 UDP 2122252543 172.16.156.106 49760 typ").is_err()); + assert!(parse_attribute("candidate:0 foo UDP 2122252543 172.16.156.106 49760 typ host") + .is_err()); + assert!(parse_attribute("candidate:0 1 FOO 2122252543 172.16.156.106 49760 typ host").is_err()); + assert!(parse_attribute("candidate:0 1 UDP foo 172.16.156.106 49760 typ host").is_err()); + assert!(parse_attribute("candidate:0 1 UDP 2122252543 172.16.156 49760 typ host").is_err()); + assert!(parse_attribute("candidate:0 1 UDP 2122252543 172.16.156.106 70000 typ host").is_err()); + assert!(parse_attribute("candidate:0 1 UDP 2122252543 172.16.156.106 49760 type host") + .is_err()); + assert!(parse_attribute("candidate:0 1 UDP 2122252543 172.16.156.106 49760 typ fost").is_err()); + // FIXME this should fail without the extra 'foobar' at the end + assert!( + parse_attribute( + "candidate:0 1 TCP 2122252543 172.16.156.106 49760 typ host unsupported foobar" + ).is_err() + ); + assert!(parse_attribute("candidate:1 1 UDP 1685987071 24.23.204.141 54609 typ srflx raddr 192.168.1.4 rport 61665 generation B").is_err()); + assert!( + parse_attribute( + "candidate:0 1 TCP 2122252543 172.16.156.106 49760 typ host network-cost C" + ).is_err() + ); + assert!( + parse_attribute( + "candidate:1 1 UDP 1685987071 24.23.204.141 54609 typ srflx raddr 192.168.1 rport 61665" + ).is_err() + ); + assert!( + parse_attribute( + "candidate:0 1 TCP 2122252543 172.16.156.106 49760 typ host tcptype foobar" + ).is_err() + ); + assert!( + parse_attribute( + "candidate:1 1 UDP 1685987071 24.23.204.141 54609 typ srflx raddr 192.168.1 rport 61665" + ).is_err() + ); + assert!(parse_attribute("candidate:1 1 UDP 1685987071 24.23.204.141 54609 typ srflx raddr 192.168.1.4 rport 70000").is_err()); +} + +#[test] +fn test_parse_attribute_end_of_candidates() { + assert!(parse_attribute("end-of-candidates").is_ok()); + assert!(parse_attribute("end-of-candidates foobar").is_err()); +} + +#[test] +fn test_parse_attribute_extmap() { + assert!(parse_attribute("extmap:1/sendonly urn:ietf:params:rtp-hdrext:ssrc-audio-level") + .is_ok()); + assert!(parse_attribute("extmap:2/sendrecv urn:ietf:params:rtp-hdrext:ssrc-audio-level") + .is_ok()); + assert!(parse_attribute("extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time") + .is_ok()); + + assert!(parse_attribute("extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time ext_attributes") + .is_ok()); + + assert!(parse_attribute("extmap:a/sendrecv urn:ietf:params:rtp-hdrext:ssrc-audio-level") + .is_err()); + assert!(parse_attribute("extmap:4/unsupported urn:ietf:params:rtp-hdrext:ssrc-audio-level") + .is_err()); + + let mut bad_char = String::from("extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time ",); + bad_char.push(0x00 as char); + assert!(parse_attribute(&bad_char).is_err()); +} + +#[test] +fn test_parse_attribute_fingerprint() { + assert!(parse_attribute("fingerprint:sha-256 CD:34:D1:62:16:95:7B:B7:EB:74:E2:39:27:97:EB:0B:23:73:AC:BC:BF:2F:E3:91:CB:57:A9:9D:4A:A2:0B:40").is_ok()) +} + +#[test] +fn test_parse_attribute_fmtp() { + assert!(parse_attribute("fmtp:109 maxplaybackrate=48000;stereo=1;useinbandfec=1").is_ok()) +} + +#[test] +fn test_parse_attribute_group() { + assert!(parse_attribute("group:LS").is_ok()); + assert!(parse_attribute("group:LS 1 2").is_ok()); + assert!(parse_attribute("group:BUNDLE sdparta_0 sdparta_1 sdparta_2").is_ok()); + + assert!(parse_attribute("group:").is_err()); + assert!(parse_attribute("group:NEVER_SUPPORTED_SEMANTICS").is_err()); +} + +#[test] +fn test_parse_attribute_bundle_only() { + assert!(parse_attribute("bundle-only").is_ok()); + assert!(parse_attribute("bundle-only foobar").is_err()); +} + +#[test] +fn test_parse_attribute_ice_lite() { + assert!(parse_attribute("ice-lite").is_ok()); + + assert!(parse_attribute("ice-lite foobar").is_err()); +} + +#[test] +fn test_parse_attribute_ice_mismatch() { + assert!(parse_attribute("ice-mismatch").is_ok()); + + assert!(parse_attribute("ice-mismatch foobar").is_err()); +} + +#[test] +fn test_parse_attribute_ice_options() { + assert!(parse_attribute("ice-options:trickle").is_ok()); + + assert!(parse_attribute("ice-options:").is_err()); +} + +#[test] +fn test_parse_attribute_ice_pwd() { + assert!(parse_attribute("ice-pwd:e3baa26dd2fa5030d881d385f1e36cce").is_ok()); + + assert!(parse_attribute("ice-pwd:").is_err()); +} + +#[test] +fn test_parse_attribute_ice_ufrag() { + assert!(parse_attribute("ice-ufrag:58b99ead").is_ok()); + + assert!(parse_attribute("ice-ufrag:").is_err()); +} + +#[test] +fn test_parse_attribute_identity() { + assert!(parse_attribute("identity:eyJpZHAiOnsiZG9tYWluIjoiZXhhbXBsZS5vcmciLCJwcm90b2NvbCI6ImJvZ3VzIn0sImFzc2VydGlvbiI6IntcImlkZW50aXR5XCI6XCJib2JAZXhhbXBsZS5vcmdcIixcImNvbnRlbnRzXCI6XCJhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3l6XCIsXCJzaWduYXR1cmVcIjpcIjAxMDIwMzA0MDUwNlwifSJ9").is_ok()); + + assert!(parse_attribute("identity:").is_err()); +} + +#[test] +fn test_parse_attribute_imageattr() { + assert!(parse_attribute("imageattr:120 send * recv *").is_ok()); + assert!( + parse_attribute( + "imageattr:97 send [x=800,y=640,sar=1.1,q=0.6] [x=480,y=320] recv [x=330,y=250]" + ).is_ok() + ); + assert!(parse_attribute("imageattr:97 recv [x=800,y=640,sar=1.1] send [x=330,y=250]").is_ok()); + assert!(parse_attribute("imageattr:97 send [x=[480:16:800],y=[320:16:640],par=[1.2-1.3],q=0.6] [x=[176:8:208],y=[144:8:176],par=[1.2-1.3]] recv *").is_ok()); + + assert!(parse_attribute("imageattr:").is_err()); +} + +#[test] +fn test_parse_attribute_inactive() { + assert!(parse_attribute("inactive").is_ok()); + assert!(parse_attribute("inactive foobar").is_err()); +} + +#[test] +fn test_parse_attribute_label() { + assert!(parse_attribute("label:1").is_ok()); + assert!(parse_attribute("label:foobar").is_ok()); + assert!(parse_attribute("label:foobar barfoo").is_ok()); + + assert!(parse_attribute("label:").is_err()); +} + +#[test] +fn test_parse_attribute_maxptime() { + assert!(parse_attribute("maxptime:60").is_ok()); + + assert!(parse_attribute("maxptime:").is_err()); +} + +#[test] +fn test_parse_attribute_mid() { + assert!(parse_attribute("mid:sdparta_0").is_ok()); + assert!(parse_attribute("mid:sdparta_0 sdparta_1 sdparta_2").is_ok()); + + assert!(parse_attribute("mid:").is_err()); +} + +#[test] +fn test_parse_attribute_msid() { + assert!(parse_attribute("msid:{5a990edd-0568-ac40-8d97-310fc33f3411}").is_ok()); + assert!( + parse_attribute( + "msid:{5a990edd-0568-ac40-8d97-310fc33f3411} {218cfa1c-617d-2249-9997-60929ce4c405}" + ).is_ok() + ); + + assert!(parse_attribute("msid:").is_err()); +} + +#[test] +fn test_parse_attribute_msid_semantics() { + assert!(parse_attribute("msid-semantic:WMS *").is_ok()) +} + +#[test] +fn test_parse_attribute_ptime() { + assert!(parse_attribute("ptime:30").is_ok()); + + assert!(parse_attribute("ptime:").is_err()); +} + +#[test] +fn test_parse_attribute_rid() { + assert!(parse_attribute("rid:foo send").is_ok()); + assert!(parse_attribute("rid:foo").is_ok()); + + assert!(parse_attribute("rid:").is_err()); +} + +#[test] +fn test_parse_attribute_recvonly() { + assert!(parse_attribute("recvonly").is_ok()); + assert!(parse_attribute("recvonly foobar").is_err()); +} + +#[test] +fn test_parse_attribute_remote_candidate() { + assert!(parse_attribute("remote-candidates:0 10.0.0.1 5555").is_ok()); + assert!(parse_attribute("remote-candidates:12345 ::1 5555").is_ok()); + + assert!(parse_attribute("remote-candidates:abc 10.0.0.1 5555").is_err()); + assert!(parse_attribute("remote-candidates:0 10.a.0.1 5555").is_err()); + assert!(parse_attribute("remote-candidates:0 10.0.0.1 70000").is_err()); + assert!(parse_attribute("remote-candidates:0 10.0.0.1").is_err()); + assert!(parse_attribute("remote-candidates:0").is_err()); + assert!(parse_attribute("remote-candidates:").is_err()); +} + +#[test] +fn test_parse_attribute_sendonly() { + assert!(parse_attribute("sendonly").is_ok()); + assert!(parse_attribute("sendonly foobar").is_err()); +} + +#[test] +fn test_parse_attribute_sendrecv() { + assert!(parse_attribute("sendrecv").is_ok()); + assert!(parse_attribute("sendrecv foobar").is_err()); +} + +#[test] +fn test_parse_attribute_setup() { + assert!(parse_attribute("setup:active").is_ok()); + assert!(parse_attribute("setup:passive").is_ok()); + assert!(parse_attribute("setup:actpass").is_ok()); + assert!(parse_attribute("setup:holdconn").is_ok()); + + assert!(parse_attribute("setup:").is_err()); + assert!(parse_attribute("setup:foobar").is_err()); +} + +#[test] +fn test_parse_attribute_rtcp() { + assert!(parse_attribute("rtcp:5000").is_ok()); + assert!(parse_attribute("rtcp:9 IN IP4 0.0.0.0").is_ok()); + + assert!(parse_attribute("rtcp:").is_err()); + assert!(parse_attribute("rtcp:70000").is_err()); + assert!(parse_attribute("rtcp:9 IN").is_err()); + assert!(parse_attribute("rtcp:9 IN IP4").is_err()); + assert!(parse_attribute("rtcp:9 IN IP4 ::1").is_err()); +} + +#[test] +fn test_parse_attribute_rtcp_fb() { + assert!(parse_attribute("rtcp-fb:101 ccm fir").is_ok()) +} + +#[test] +fn test_parse_attribute_rtcp_mux() { + assert!(parse_attribute("rtcp-mux").is_ok()); + assert!(parse_attribute("rtcp-mux foobar").is_err()); +} + +#[test] +fn test_parse_attribute_rtcp_rsize() { + assert!(parse_attribute("rtcp-rsize").is_ok()); + assert!(parse_attribute("rtcp-rsize foobar").is_err()); +} + +#[test] +fn test_parse_attribute_rtpmap() { + assert!(parse_attribute("rtpmap:109 opus/48000").is_ok()); + assert!(parse_attribute("rtpmap:109 opus/48000/2").is_ok()); + + assert!(parse_attribute("rtpmap:109 ").is_err()); + assert!(parse_attribute("rtpmap:109 opus").is_err()); + assert!(parse_attribute("rtpmap:128 opus/48000").is_err()); +} + +#[test] +fn test_parse_attribute_sctpmap() { + assert!(parse_attribute("sctpmap:5000 webrtc-datachannel 256").is_ok()); + + assert!(parse_attribute("sctpmap:70000 webrtc-datachannel 256").is_err()); + assert!(parse_attribute("sctpmap:5000 unsupported 256").is_err()); + assert!(parse_attribute("sctpmap:5000 webrtc-datachannel 2a").is_err()); +} + +#[test] +fn test_parse_attribute_sctp_port() { + assert!(parse_attribute("sctp-port:5000").is_ok()); + + assert!(parse_attribute("sctp-port:").is_err()); + assert!(parse_attribute("sctp-port:70000").is_err()); +} + +#[test] +fn test_parse_attribute_max_message_size() { + assert!(parse_attribute("max-message-size:1").is_ok()); + assert!(parse_attribute("max-message-size:100000").is_ok()); + assert!(parse_attribute("max-message-size:4294967297").is_ok()); + assert!(parse_attribute("max-message-size:0").is_ok()); + + assert!(parse_attribute("max-message-size:").is_err()); + assert!(parse_attribute("max-message-size:abc").is_err()); +} + +#[test] +fn test_parse_attribute_simulcast() { + assert!(parse_attribute("simulcast:send 1").is_ok()); + assert!(parse_attribute("simulcast:recv test").is_ok()); + assert!(parse_attribute("simulcast:recv ~test").is_ok()); + assert!(parse_attribute("simulcast:recv test;foo").is_ok()); + assert!(parse_attribute("simulcast:recv foo,bar").is_ok()); + assert!(parse_attribute("simulcast:recv foo,bar;test").is_ok()); + assert!(parse_attribute("simulcast:recv 1;4,5 send 6;7").is_ok()); + assert!(parse_attribute("simulcast:send 1,2,3;~4,~5 recv 6;~7,~8").is_ok()); + // old draft 03 notation used by Firefox 55 + assert!(parse_attribute("simulcast: send rid=foo;bar").is_ok()); + + assert!(parse_attribute("simulcast:").is_err()); + assert!(parse_attribute("simulcast:send").is_err()); + assert!(parse_attribute("simulcast:foobar 1").is_err()); + assert!(parse_attribute("simulcast:send 1 foobar 2").is_err()); +} + +#[test] +fn test_parse_attribute_ssrc() { + assert!(parse_attribute("ssrc:2655508255").is_ok()); + assert!(parse_attribute("ssrc:2655508255 foo").is_ok()); + assert!(parse_attribute("ssrc:2655508255 cname:{735484ea-4f6c-f74a-bd66-7425f8476c2e}") + .is_ok()); + + assert!(parse_attribute("ssrc:").is_err()); + assert!(parse_attribute("ssrc:foo").is_err()); +} + +#[test] +fn test_parse_attribute_ssrc_group() { + assert!(parse_attribute("ssrc-group:FID 3156517279 2673335628").is_ok()) +} + +#[test] +fn test_parse_unknown_attribute() { + assert!(parse_attribute("unknown").is_err()) +} + +// Returns true if valid byte-string as defined by RFC 4566 +// https://tools.ietf.org/html/rfc4566 +fn valid_byte_string(input: &str) -> bool { + !(input.contains(0x00 as char) || input.contains(0x0A as char) || input.contains(0x0D as char)) +} diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/file_parser.rs b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/file_parser.rs new file mode 100644 index 000000000000..04ba61c81c9d --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/file_parser.rs @@ -0,0 +1,35 @@ +use std::error::Error; +use std::io::prelude::*; +use std::fs::File; +use std::path::Path; +use std::env; +extern crate rsdparsa; + +fn main() { + let filename = match env::args().nth(1) { + None => { + println!("Missing file name argument!"); + return; + }, + Some(x) => x, + }; + let path = Path::new(filename.as_str()); + let display = path.display(); + + let mut file = match File::open(&path) { + Err(why) => panic!("Failed to open {}: {}", + display, + why.description()), + Ok(file) => file + }; + + let mut s = String::new(); + match file.read_to_string(&mut s) { + Err(why) => panic!("couldn't read {}: {}", + display, + why.description()), + Ok(s) => s + }; + + rsdparsa::parse_sdp(&s, true).is_ok(); +} diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/10.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/10.sdp new file mode 100644 index 000000000000..4b5cadc98667 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/10.sdp @@ -0,0 +1,13 @@ +v=0 +o=- 4294967296 2 IN IP4 127.0.0.1 +s=SIP Call +c=IN IP4 198.51.100.7 +t=0 0 +m=video 9 RTP/SAVPF 97 120 121 122 123 +c=IN IP6 ::1 +a=fingerprint:sha-1 DF:FA:FB:08:3B:3C:54:1D:D7:D4:05:77:A0:72:9B:14:08:6D:0F:4C:2E:AC:8A:FD:0A:8E:99:BF:5D:E8:3C:E7 +a=rtpmap:97 H264/90000 +a=rtpmap:120 VP8/90000 +a=rtpmap:121 VP9/90000 +a=rtpmap:122 red/90000 +a=rtpmap:123 ulpfec/90000 diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/11.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/11.sdp new file mode 100644 index 000000000000..652f613728da --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/11.sdp @@ -0,0 +1,63 @@ +v=0 +o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0 +s=SIP Call +c=IN IP4 224.0.0.1/100/12 +t=0 0 +a=ice-ufrag:4a799b2e +a=ice-pwd:e4cc12a910f106a0a744719425510e17 +a=ice-lite +a=msid-semantic:WMS stream streama +a=fingerprint:sha-256 DF:2E:AC:8A:FD:0A:8E:99:BF:5D:E8:3C:E7:FA:FB:08:3B:3C:54:1D:D7:D4:05:77:A0:72:9B:14:08:6D:0F:4C +a=group:BUNDLE first second +a=group:BUNDLE third +a=group:LS first third +m=audio 9 RTP/SAVPF 109 9 0 8 101 +c=IN IP4 0.0.0.0 +a=mid:first +a=rtpmap:109 opus/48000/2 +a=ptime:20 +a=maxptime:20 +a=rtpmap:9 G722/8000 +a=rtpmap:0 PCMU/8000 +a=rtpmap:8 PCMA/8000 +a=rtpmap:101 telephone-event/8000 +a=fmtp:101 0-15,66,32-34,67 +a=ice-ufrag:00000000 +a=ice-pwd:0000000000000000000000000000000 +a=sendonly +a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level +a=setup:actpass +a=rtcp-mux +a=msid:stream track +a=candidate:0 1 UDP 2130379007 10.0.0.36 62453 typ host +a=candidate:2 1 UDP 1694236671 24.6.134.204 62453 typ srflx raddr 10.0.0.36 rport 62453 +a=candidate:3 1 UDP 100401151 162.222.183.171 49761 typ relay raddr 162.222.183.171 rport 49761 +a=candidate:6 1 UDP 16515071 162.222.183.171 51858 typ relay raddr 162.222.183.171 rport 51858 +a=candidate:3 2 UDP 100401150 162.222.183.171 62454 typ relay raddr 162.222.183.171 rport 62454 +a=candidate:2 2 UDP 1694236670 24.6.134.204 55428 typ srflx raddr 10.0.0.36 rport 55428 +a=candidate:6 2 UDP 16515070 162.222.183.171 50340 typ relay raddr 162.222.183.171 rport 50340 +a=candidate:0 2 UDP 2130379006 10.0.0.36 55428 typ host +m=video 9 RTP/SAVPF 97 98 120 +c=IN IP6 ::1 +a=mid:second +a=rtpmap:97 H264/90000 +a=rtpmap:98 H264/90000 +a=rtpmap:120 VP8/90000 +a=recvonly +a=setup:active +a=rtcp-mux +a=msid:streama tracka +a=msid:streamb trackb +a=candidate:0 1 UDP 2130379007 10.0.0.36 59530 typ host +a=candidate:0 2 UDP 2130379006 10.0.0.36 64378 typ host +a=candidate:2 2 UDP 1694236670 24.6.134.204 64378 typ srflx raddr 10.0.0.36 rport 64378 +a=candidate:6 2 UDP 16515070 162.222.183.171 64941 typ relay raddr 162.222.183.171 rport 64941 +a=candidate:6 1 UDP 16515071 162.222.183.171 64800 typ relay raddr 162.222.183.171 rport 64800 +a=candidate:2 1 UDP 1694236671 24.6.134.204 59530 typ srflx raddr 10.0.0.36 rport 59530 +a=candidate:3 1 UDP 100401151 162.222.183.171 62935 typ relay raddr 162.222.183.171 rport 62935 +a=candidate:3 2 UDP 100401150 162.222.183.171 61026 typ relay raddr 162.222.183.171 rport 61026 +m=audio 9 RTP/SAVPF 0 +a=mid:third +a=rtpmap:0 PCMU/8000 +a=ice-lite +a=msid:noappdata diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/12.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/12.sdp new file mode 100644 index 000000000000..647de5dca83f --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/12.sdp @@ -0,0 +1,58 @@ +v=0 +o=Mozilla-SIPUA-35.0a1 27987 0 IN IP4 0.0.0.0 +s=SIP Call +t=0 0 +a=ice-ufrag:8a39d2ae +a=ice-pwd:601d53aba51a318351b3ecf5ee00048f +a=fingerprint:sha-256 30:FF:8E:2B:AC:9D:ED:70:18:10:67:C8:AE:9E:68:F3:86:53:51:B0:AC:31:B7:BE:6D:CF:A4:2E:D3:6E:B4:28 +m=audio 9 RTP/SAVPF 109 9 0 8 101 +c=IN IP4 0.0.0.0 +a=rtpmap:109 opus/48000/2 +a=ptime:20 +a=rtpmap:9 G722/8000 +a=rtpmap:0 PCMU/8000 +a=rtpmap:8 PCMA/8000 +a=rtpmap:101 telephone-event/8000 +a=fmtp:101 0-15 +a=sendrecv +a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level +a=extmap:2/sendonly some_extension +a=extmap:3 some_other_extension some_params some more params +a=setup:actpass +a=rtcp-mux +m=video 9 RTP/SAVPF 120 126 97 +c=IN IP4 0.0.0.0 +a=rtpmap:120 VP8/90000 +a=rtpmap:126 H264/90000 +a=rtpmap:97 H264/90000 +a=sendrecv +a=rtcp-fb:120 ack rpsi +a=rtcp-fb:120 ack app foo +a=rtcp-fb:120 ack foo +a=rtcp-fb:120 nack +a=rtcp-fb:120 nack sli +a=rtcp-fb:120 nack pli +a=rtcp-fb:120 nack rpsi +a=rtcp-fb:120 nack app foo +a=rtcp-fb:120 nack foo +a=rtcp-fb:120 ccm fir +a=rtcp-fb:120 ccm tmmbr +a=rtcp-fb:120 ccm tstr +a=rtcp-fb:120 ccm vbcm +a=rtcp-fb:120 ccm foo +a=rtcp-fb:120 trr-int 10 +a=rtcp-fb:120 goog-remb +a=rtcp-fb:120 foo +a=rtcp-fb:126 nack +a=rtcp-fb:126 nack pli +a=rtcp-fb:126 ccm fir +a=rtcp-fb:97 nack +a=rtcp-fb:97 nack pli +a=rtcp-fb:97 ccm fir +a=rtcp-fb:* ccm tmmbr +a=setup:actpass +a=rtcp-mux +m=application 9 DTLS/SCTP 5000 +c=IN IP4 0.0.0.0 +a=sctpmap:5000 webrtc-datachannel 16 +a=setup:actpass diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/13.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/13.sdp new file mode 100644 index 000000000000..31c3d8d86bfc --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/13.sdp @@ -0,0 +1,12 @@ +v=0 +o=Mozilla-SIPUA-35.0a1 27987 0 IN IP4 0.0.0.0 +s=SIP Call +t=0 0 +a=ice-ufrag:8a39d2ae +a=ice-pwd:601d53aba51a318351b3ecf5ee00048f +a=fingerprint:sha-256 30:FF:8E:2B:AC:9D:ED:70:18:10:67:C8:AE:9E:68:F3:86:53:51:B0:AC:31:B7:BE:6D:CF:A4:2E:D3:6E:B4:28 +m=application 9 UDP/DTLS/SCTP webrtc-datachannel +c=IN IP4 0.0.0.0 +a=sctp-port:5000 +a=max-message-size:10000 +a=setup:actpass diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/14.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/14.sdp new file mode 100644 index 000000000000..cad2a9a1997d --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/14.sdp @@ -0,0 +1,9 @@ +v=0 +o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0 +s=SIP Call +c=IN IP4 224.0.0.1/100/12 +t=0 0 +a=candidate:0 1 UDP 2130379007 10.0.0.36 62453 typ host +m=audio 9 RTP/SAVPF 109 9 0 8 101 +c=IN IP4 0.0.0.0 +a=rtpmap:109 opus/48000/2 diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/15.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/15.sdp new file mode 100644 index 000000000000..d356ecaf1feb --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/15.sdp @@ -0,0 +1,9 @@ +v=0 +o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0 +s=SIP Call +c=IN IP4 224.0.0.1/100/12 +t=0 0 +a=bundle-only +m=audio 9 RTP/SAVPF 109 9 0 8 101 +c=IN IP4 0.0.0.0 +a=rtpmap:109 opus/48000/2 diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/16.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/16.sdp new file mode 100644 index 000000000000..67326a6e9a27 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/16.sdp @@ -0,0 +1,9 @@ +v=0 +o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0 +s=SIP Call +c=IN IP4 224.0.0.1/100/12 +t=0 0 +a=fmtp:109 0-15 +m=audio 9 RTP/SAVPF 109 9 0 8 101 +c=IN IP4 0.0.0.0 +a=rtpmap:109 opus/48000/2 diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/17.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/17.sdp new file mode 100644 index 000000000000..002322219102 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/17.sdp @@ -0,0 +1,9 @@ +v=0 +o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0 +s=SIP Call +c=IN IP4 224.0.0.1/100/12 +t=0 0 +a=ice-mismatch +m=audio 9 RTP/SAVPF 109 9 0 8 101 +c=IN IP4 0.0.0.0 +a=rtpmap:109 opus/48000/2 diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/18.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/18.sdp new file mode 100644 index 000000000000..3287af64134b --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/18.sdp @@ -0,0 +1,9 @@ +v=0 +o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0 +s=SIP Call +c=IN IP4 224.0.0.1/100/12 +t=0 0 +a=imageattr:120 send * recv * +m=video 9 RTP/SAVPF 120 +c=IN IP4 0.0.0.0 +a=rtpmap:120 VP8/90000 diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/19.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/19.sdp new file mode 100644 index 000000000000..20bb0a8058b7 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/19.sdp @@ -0,0 +1,9 @@ +v=0 +o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0 +s=SIP Call +c=IN IP4 224.0.0.1/100/12 +t=0 0 +a=label:foobar +m=video 9 RTP/SAVPF 120 +c=IN IP4 0.0.0.0 +a=rtpmap:120 VP8/90000 diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/2.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/2.sdp new file mode 100644 index 000000000000..21d383d2f255 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/2.sdp @@ -0,0 +1,7 @@ +v=0 +o=- 4294967296 2 IN IP4 127.0.0.1 +s=SIP Call +c=IN IP4 198.51.100.7 +t=0 0 +m=video 56436 RTP/SAVPF 120 +a=rtpmap:120 VP8/90000 diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/20.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/20.sdp new file mode 100644 index 000000000000..4d28e12a9f8c --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/20.sdp @@ -0,0 +1,9 @@ +v=0 +o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0 +s=SIP Call +c=IN IP4 224.0.0.1/100/12 +t=0 0 +a=maxptime:100 +m=video 9 RTP/SAVPF 120 +c=IN IP4 0.0.0.0 +a=rtpmap:120 VP8/90000 diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/21.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/21.sdp new file mode 100644 index 000000000000..7a2d6fa9dce4 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/21.sdp @@ -0,0 +1,9 @@ +v=0 +o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0 +s=SIP Call +c=IN IP4 224.0.0.1/100/12 +t=0 0 +a=mid:foobar +m=video 9 RTP/SAVPF 120 +c=IN IP4 0.0.0.0 +a=rtpmap:120 VP8/90000 diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/22.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/22.sdp new file mode 100644 index 000000000000..95e5518123a6 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/22.sdp @@ -0,0 +1,9 @@ +v=0 +o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0 +s=SIP Call +c=IN IP4 224.0.0.1/100/12 +t=0 0 +a=msid:foobar +m=video 9 RTP/SAVPF 120 +c=IN IP4 0.0.0.0 +a=rtpmap:120 VP8/90000 diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/23.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/23.sdp new file mode 100644 index 000000000000..7722360f3214 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/23.sdp @@ -0,0 +1,9 @@ +v=0 +o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0 +s=SIP Call +c=IN IP4 224.0.0.1/100/12 +t=0 0 +a=ptime:50 +m=video 9 RTP/SAVPF 120 +c=IN IP4 0.0.0.0 +a=rtpmap:120 VP8/90000 diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/24.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/24.sdp new file mode 100644 index 000000000000..dd13f1e143f8 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/24.sdp @@ -0,0 +1,9 @@ +v=0 +o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0 +s=SIP Call +c=IN IP4 224.0.0.1/100/12 +t=0 0 +a=remote-candidates:0 10.0.0.1 5555 +m=video 9 RTP/SAVPF 120 +c=IN IP4 0.0.0.0 +a=rtpmap:120 VP8/90000 diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/25.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/25.sdp new file mode 100644 index 000000000000..7fd8a006fb71 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/25.sdp @@ -0,0 +1,9 @@ +v=0 +o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0 +s=SIP Call +c=IN IP4 224.0.0.1/100/12 +t=0 0 +a=rtcp:5555 +m=video 9 RTP/SAVPF 120 +c=IN IP4 0.0.0.0 +a=rtpmap:120 VP8/90000 diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/26.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/26.sdp new file mode 100644 index 000000000000..789e0627668b --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/26.sdp @@ -0,0 +1,9 @@ +v=0 +o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0 +s=SIP Call +c=IN IP4 224.0.0.1/100/12 +t=0 0 +a=rtcp-fb:120 nack +m=video 9 RTP/SAVPF 120 +c=IN IP4 0.0.0.0 +a=rtpmap:120 VP8/90000 diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/27.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/27.sdp new file mode 100644 index 000000000000..f8201916e99f --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/27.sdp @@ -0,0 +1,9 @@ +v=0 +o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0 +s=SIP Call +c=IN IP4 224.0.0.1/100/12 +t=0 0 +a=rtcp-mux +m=video 9 RTP/SAVPF 120 +c=IN IP4 0.0.0.0 +a=rtpmap:120 VP8/90000 diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/28.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/28.sdp new file mode 100644 index 000000000000..11d9331b1085 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/28.sdp @@ -0,0 +1,9 @@ +v=0 +o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0 +s=SIP Call +c=IN IP4 224.0.0.1/100/12 +t=0 0 +a=rtcp-rsize +m=video 9 RTP/SAVPF 120 +c=IN IP4 0.0.0.0 +a=rtpmap:120 VP8/90000 diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/29.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/29.sdp new file mode 100644 index 000000000000..f34b97fe5860 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/29.sdp @@ -0,0 +1,8 @@ +v=0 +o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0 +s=SIP Call +c=IN IP4 224.0.0.1/100/12 +t=0 0 +a=rtpmap:120 VP8/90000 +m=video 9 RTP/SAVPF 120 +c=IN IP4 0.0.0.0 diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/3.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/3.sdp new file mode 100644 index 000000000000..f60f31f2da35 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/3.sdp @@ -0,0 +1,34 @@ +v=0 +o=- 4294967296 2 IN IP4 127.0.0.1 +s=SIP Call +c=IN IP4 198.51.100.7 +t=0 0 +m=video 56436 RTP/SAVPF 120 +a=rtpmap:120 VP8/90000 +a=rtpmap:122 red/90000 +a=rtcp-fb:120 ack rpsi +a=rtcp-fb:120 ack app +a=rtcp-fb:120 ack app foo +a=rtcp-fb:120 ack foo bar +a=rtcp-fb:120 ack foo bar baz +a=rtcp-fb:120 nack +a=rtcp-fb:120 nack pli +a=rtcp-fb:120 nack sli +a=rtcp-fb:120 nack rpsi +a=rtcp-fb:120 nack app +a=rtcp-fb:120 nack app foo +a=rtcp-fb:120 nack app foo bar +a=rtcp-fb:120 nack foo bar baz +a=rtcp-fb:120 trr-int 0 +a=rtcp-fb:120 trr-int 123 +a=rtcp-fb:120 goog-remb +a=rtcp-fb:120 ccm fir +a=rtcp-fb:120 ccm tmmbr +a=rtcp-fb:120 ccm tstr +a=rtcp-fb:120 ccm vbcm 123 456 789 +a=rtcp-fb:120 ccm foo +a=rtcp-fb:120 ccm foo bar baz +a=rtcp-fb:120 foo +a=rtcp-fb:120 foo bar +a=rtcp-fb:120 foo bar baz +a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/30.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/30.sdp new file mode 100644 index 000000000000..202ea88c0846 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/30.sdp @@ -0,0 +1,9 @@ +v=0 +o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0 +s=SIP Call +c=IN IP4 224.0.0.1/100/12 +t=0 0 +a=sctpmap:5000 +m=video 9 RTP/SAVPF 120 +c=IN IP4 0.0.0.0 +a=rtpmap:120 VP8/90000 diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/31.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/31.sdp new file mode 100644 index 000000000000..cd510e1d4670 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/31.sdp @@ -0,0 +1,9 @@ +v=0 +o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0 +s=SIP Call +c=IN IP4 224.0.0.1/100/12 +t=0 0 +a=ssrc:5000 +m=video 9 RTP/SAVPF 120 +c=IN IP4 0.0.0.0 +a=rtpmap:120 VP8/90000 diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/32.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/32.sdp new file mode 100644 index 000000000000..45696947686d --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/32.sdp @@ -0,0 +1,9 @@ +v=0 +o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0 +s=SIP Call +c=IN IP4 224.0.0.1/100/12 +t=0 0 +a=ssrc-group:FID 5000 +m=video 9 RTP/SAVPF 120 +c=IN IP4 0.0.0.0 +a=rtpmap:120 VP8/90000 diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/33.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/33.sdp new file mode 100644 index 000000000000..179e048da8e6 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/33.sdp @@ -0,0 +1,9 @@ +v=0 +o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0 +s=SIP Call +c=IN IP4 224.0.0.1/100/12 +t=0 0 +m=video 9 RTP/SAVPF 120 +c=IN IP4 0.0.0.0 +a=rtpmap:120 VP8/90000 +a=imageattr:flob diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/34.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/34.sdp new file mode 100644 index 000000000000..39ef01206ded --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/34.sdp @@ -0,0 +1,9 @@ +v=0 +o=- 4294967296 2 IN IP4 127.0.0.1 +s=SIP Call +c=IN IP4 198.51.100.7 +b=CT:5000 +t=0 0 +m=video 56436 RTP/SAVPF 120 +a=rtpmap:120 VP8/90000 +a=sendrecv diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/35.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/35.sdp new file mode 100644 index 000000000000..39ef01206ded --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/35.sdp @@ -0,0 +1,9 @@ +v=0 +o=- 4294967296 2 IN IP4 127.0.0.1 +s=SIP Call +c=IN IP4 198.51.100.7 +b=CT:5000 +t=0 0 +m=video 56436 RTP/SAVPF 120 +a=rtpmap:120 VP8/90000 +a=sendrecv diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/36.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/36.sdp new file mode 100644 index 000000000000..39ef01206ded --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/36.sdp @@ -0,0 +1,9 @@ +v=0 +o=- 4294967296 2 IN IP4 127.0.0.1 +s=SIP Call +c=IN IP4 198.51.100.7 +b=CT:5000 +t=0 0 +m=video 56436 RTP/SAVPF 120 +a=rtpmap:120 VP8/90000 +a=sendrecv diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/37.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/37.sdp new file mode 100644 index 000000000000..f03bbaa8efde --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/37.sdp @@ -0,0 +1,9 @@ +v=0 +o=- 4294967296 2 IN IP4 127.0.0.1 +s=SIP Call +c=IN IP4 198.51.100.7 +b=CT:5000 +t=0 0 +m=video 56436 RTP/SAVPF 120 +a=rtpmap:120 VP8/90000 +a=recvonly diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/38.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/38.sdp new file mode 100644 index 000000000000..bbe385d9842e --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/38.sdp @@ -0,0 +1,9 @@ +v=0 +o=- 4294967296 2 IN IP4 127.0.0.1 +s=SIP Call +c=IN IP4 198.51.100.7 +b=CT:5000 +t=0 0 +m=video 56436 RTP/SAVPF 120 +a=rtpmap:120 VP8/90000 +a=sendonly diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/39.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/39.sdp new file mode 100644 index 000000000000..723d2abf7f03 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/39.sdp @@ -0,0 +1,8 @@ +v=0 +o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0 +s=SIP Call +c=IN IP4 224.0.0.1/100/12 +t=0 0 +m=video 9 RTP/SAVPF 120 +c=IN IP4 0.0.0.0 +a=rtpmap:120 VP8/90000 diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/4.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/4.sdp new file mode 100644 index 000000000000..0682623c93a4 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/4.sdp @@ -0,0 +1,7 @@ +v=0 +o=- 4294967296 2 IN IP4 127.0.0.1 +s=SIP Call +t=0 0 +m=video 56436 RTP/SAVPF 120 +c=IN IP4 198.51.100.7 +a=rtpmap:120 VP8/90000 diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/40.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/40.sdp new file mode 100644 index 000000000000..723d2abf7f03 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/40.sdp @@ -0,0 +1,8 @@ +v=0 +o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0 +s=SIP Call +c=IN IP4 224.0.0.1/100/12 +t=0 0 +m=video 9 RTP/SAVPF 120 +c=IN IP4 0.0.0.0 +a=rtpmap:120 VP8/90000 diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/41.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/41.sdp new file mode 100644 index 000000000000..753ca5ccb40b --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/41.sdp @@ -0,0 +1,91 @@ +v=0 +o=- 1109973417102828257 2 IN IP4 127.0.0.1 +s=- +t=0 0 +a=group:BUNDLE audio video +a=msid-semantic: WMS 1PBxet5BYh0oYodwsvNM4k6KiO2eWCX40VIP +m=audio 32952 UDP/TLS/RTP/SAVPF 111 103 104 0 8 107 106 105 13 126 +c=IN IP4 128.64.32.16 +a=rtcp:32952 IN IP4 128.64.32.16 +a=candidate:77142221 1 udp 2113937151 192.168.137.1 54081 typ host generation 0 +a=candidate:77142221 2 udp 2113937151 192.168.137.1 54081 typ host generation 0 +a=candidate:983072742 1 udp 2113937151 172.22.0.56 54082 typ host generation 0 +a=candidate:983072742 2 udp 2113937151 172.22.0.56 54082 typ host generation 0 +a=candidate:2245074553 1 udp 1845501695 32.64.128.1 62397 typ srflx raddr 192.168.137.1 rport 54081 generation 0 +a=candidate:2245074553 2 udp 1845501695 32.64.128.1 62397 typ srflx raddr 192.168.137.1 rport 54081 generation 0 +a=candidate:2479353907 1 udp 1845501695 32.64.128.1 54082 typ srflx raddr 172.22.0.56 rport 54082 generation 0 +a=candidate:2479353907 2 udp 1845501695 32.64.128.1 54082 typ srflx raddr 172.22.0.56 rport 54082 generation 0 +a=candidate:1243276349 1 tcp 1509957375 192.168.137.1 0 typ host generation 0 +a=candidate:1243276349 2 tcp 1509957375 192.168.137.1 0 typ host generation 0 +a=candidate:1947960086 1 tcp 1509957375 172.22.0.56 0 typ host generation 0 +a=candidate:1947960086 2 tcp 1509957375 172.22.0.56 0 typ host generation 0 +a=candidate:1808221584 1 udp 33562367 128.64.32.16 32952 typ relay raddr 32.64.128.1 rport 62398 generation 0 +a=candidate:1808221584 2 udp 33562367 128.64.32.16 32952 typ relay raddr 32.64.128.1 rport 62398 generation 0 +a=candidate:507872740 1 udp 33562367 128.64.32.16 40975 typ relay raddr 32.64.128.1 rport 54085 generation 0 +a=candidate:507872740 2 udp 33562367 128.64.32.16 40975 typ relay raddr 32.64.128.1 rport 54085 generation 0 +a=ice-ufrag:xQuJwjX3V3eMA81k +a=ice-pwd:ZUiRmjS2GDhG140p73dAsSVP +a=ice-options:google-ice +a=fingerprint:sha-256 59:4A:8B:73:A7:73:53:71:88:D7:4D:58:28:0C:79:72:31:29:9B:05:37:DD:58:43:C2:D4:85:A2:B3:66:38:7A +a=setup:active +a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level +a=sendrecv +a=mid:audio +a=rtcp-mux +a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:/U44g3ULdtapeiSg+T3n6dDLBKIjpOhb/NXAL/2b +a=rtpmap:111 opus/48000/2 +a=rtpmap:103 ISAC/16000 +a=rtpmap:104 ISAC/32000 +a=rtpmap:0 PCMU/8000 +a=rtpmap:8 PCMA/8000 +a=rtpmap:107 CN/48000 +a=rtpmap:106 CN/32000 +a=rtpmap:105 CN/16000 +a=rtpmap:13 CN/8000 +a=rtpmap:126 telephone-event/8000 +a=maxptime:60 +a=ssrc:2271517329 cname:mKDNt7SQf6pwDlIn +a=ssrc:2271517329 msid:1PBxet5BYh0oYodwsvNM4k6KiO2eWCX40VIP 1PBxet5BYh0oYodwsvNM4k6KiO2eWCX40VIPa0 +a=ssrc:2271517329 mslabel:1PBxet5BYh0oYodwsvNM4k6KiO2eWCX40VIP +a=ssrc:2271517329 label:1PBxet5BYh0oYodwsvNM4k6KiO2eWCX40VIPa0 +m=video 32952 UDP/TLS/RTP/SAVPF 100 116 117 +c=IN IP4 128.64.32.16 +a=rtcp:32952 IN IP4 128.64.32.16 +a=candidate:77142221 1 udp 2113937151 192.168.137.1 54081 typ host generation 0 +a=candidate:77142221 2 udp 2113937151 192.168.137.1 54081 typ host generation 0 +a=candidate:983072742 1 udp 2113937151 172.22.0.56 54082 typ host generation 0 +a=candidate:983072742 2 udp 2113937151 172.22.0.56 54082 typ host generation 0 +a=candidate:2245074553 1 udp 1845501695 32.64.128.1 62397 typ srflx raddr 192.168.137.1 rport 54081 generation 0 +a=candidate:2245074553 2 udp 1845501695 32.64.128.1 62397 typ srflx raddr 192.168.137.1 rport 54081 generation 0 +a=candidate:2479353907 1 udp 1845501695 32.64.128.1 54082 typ srflx raddr 172.22.0.56 rport 54082 generation 0 +a=candidate:2479353907 2 udp 1845501695 32.64.128.1 54082 typ srflx raddr 172.22.0.56 rport 54082 generation 0 +a=candidate:1243276349 1 tcp 1509957375 192.168.137.1 0 typ host generation 0 +a=candidate:1243276349 2 tcp 1509957375 192.168.137.1 0 typ host generation 0 +a=candidate:1947960086 1 tcp 1509957375 172.22.0.56 0 typ host generation 0 +a=candidate:1947960086 2 tcp 1509957375 172.22.0.56 0 typ host generation 0 +a=candidate:1808221584 1 udp 33562367 128.64.32.16 32952 typ relay raddr 32.64.128.1 rport 62398 generation 0 +a=candidate:1808221584 2 udp 33562367 128.64.32.16 32952 typ relay raddr 32.64.128.1 rport 62398 generation 0 +a=candidate:507872740 1 udp 33562367 128.64.32.16 40975 typ relay raddr 32.64.128.1 rport 54085 generation 0 +a=candidate:507872740 2 udp 33562367 128.64.32.16 40975 typ relay raddr 32.64.128.1 rport 54085 generation 0 +a=ice-ufrag:xQuJwjX3V3eMA81k +a=ice-pwd:ZUiRmjS2GDhG140p73dAsSVP +a=ice-options:google-ice +a=fingerprint:sha-256 59:4A:8B:73:A7:73:53:71:88:D7:4D:58:28:0C:79:72:31:29:9B:05:37:DD:58:43:C2:D4:85:A2:B3:66:38:7A +a=setup:active +a=extmap:2 urn:ietf:params:rtp-hdrext:toffset +a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time +a=sendrecv +a=mid:video +a=rtcp-mux +a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:/U44g3ULdtapeiSg+T3n6dDLBKIjpOhb/NXAL/2b +a=rtpmap:100 VP8/90000 +a=rtcp-fb:100 ccm fir +a=rtcp-fb:100 nack +a=rtcp-fb:100 goog-remb +a=rtpmap:116 red/90000 +a=rtpmap:117 ulpfec/90000 +a=ssrc:54724160 cname:mKDNt7SQf6pwDlIn +a=ssrc:54724160 msid:1PBxet5BYh0oYodwsvNM4k6KiO2eWCX40VIP 1PBxet5BYh0oYodwsvNM4k6KiO2eWCX40VIPv0 +a=ssrc:54724160 mslabel:1PBxet5BYh0oYodwsvNM4k6KiO2eWCX40VIP +a=ssrc:54724160 label:1PBxet5BYh0oYodwsvNM4k6KiO2eWCX40VIPv0 + diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/5.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/5.sdp new file mode 100644 index 000000000000..f575af373085 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/5.sdp @@ -0,0 +1,5 @@ +v=0 +o=- 4294967296 2 IN IP4 127.0.0.1 +s=SIP Call +t=0 0 +a=ice-lite diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/6.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/6.sdp new file mode 100644 index 000000000000..d20cb3fc70b7 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/6.sdp @@ -0,0 +1,12 @@ +v=0 +o=- 4294967296 2 IN IP4 127.0.0.1 +s=SIP Call +c=IN IP4 198.51.100.7 +b=CT:5000 +b=FOOBAR:10 +b=AS:4 +t=0 0 +m=video 56436 RTP/SAVPF 120 +a=rtpmap:120 VP8/90000 +m=audio 12345/2 RTP/SAVPF 0 +a=rtpmap:0 PCMU/8000 diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/7.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/7.sdp new file mode 100644 index 000000000000..1fe28e7253c4 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/7.sdp @@ -0,0 +1,7 @@ +v=0 +o=- 4294967296 2 IN IP4 127.0.0.1 +c=IN IP4 198.51.100.7 +t=0 0 +m=video 56436 RTP/SAVPF 120 +b=CT:1000 +a=rtpmap:120 VP8/90000 diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/8.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/8.sdp new file mode 100644 index 000000000000..6eda93cdbf13 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/8.sdp @@ -0,0 +1,84 @@ +v=0 +o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0 +s=SIP Call +c=IN IP4 224.0.0.1/100/12 +t=0 0 +a=ice-ufrag:4a799b2e +a=ice-pwd:e4cc12a910f106a0a744719425510e17 +a=ice-lite +a=ice-options:trickle foo +a=msid-semantic:WMS stream streama +a=msid-semantic:foo stream +a=fingerprint:sha-256 DF:2E:AC:8A:FD:0A:8E:99:BF:5D:E8:3C:E7:FA:FB:08:3B:3C:54:1D:D7:D4:05:77:A0:72:9B:14:08:6D:0F:4C +a=identity:eyJpZHAiOnsiZG9tYWluIjoiZXhhbXBsZS5vcmciLCJwcm90b2NvbCI6ImJvZ3VzIn0sImFzc2VydGlvbiI6IntcImlkZW50aXR5XCI6XCJib2JAZXhhbXBsZS5vcmdcIixcImNvbnRlbnRzXCI6XCJhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3l6XCIsXCJzaWduYXR1cmVcIjpcIjAxMDIwMzA0MDUwNlwifSJ9 +a=group:BUNDLE first second +a=group:BUNDLE third +a=group:LS first third +m=audio 9 RTP/SAVPF 109 9 0 8 101 +c=IN IP4 0.0.0.0 +a=mid:first +a=rtpmap:109 opus/48000/2 +a=ptime:20 +a=maxptime:20 +a=rtpmap:9 G722/8000 +a=rtpmap:0 PCMU/8000 +a=rtpmap:8 PCMA/8000 +a=rtpmap:101 telephone-event/8000 +a=fmtp:101 0-15,66,32-34,67 +a=ice-ufrag:00000000 +a=ice-pwd:0000000000000000000000000000000 +a=sendonly +a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level +a=setup:actpass +a=rtcp-mux +a=msid:stream track +a=candidate:0 1 UDP 2130379007 10.0.0.36 62453 typ host +a=candidate:2 1 UDP 1694236671 24.6.134.204 62453 typ srflx raddr 10.0.0.36 rport 62453 +a=candidate:3 1 UDP 100401151 162.222.183.171 49761 typ relay raddr 162.222.183.171 rport 49761 +a=candidate:6 1 UDP 16515071 162.222.183.171 51858 typ relay raddr 162.222.183.171 rport 51858 +a=candidate:3 2 UDP 100401150 162.222.183.171 62454 typ relay raddr 162.222.183.171 rport 62454 +a=candidate:2 2 UDP 1694236670 24.6.134.204 55428 typ srflx raddr 10.0.0.36 rport 55428 +a=candidate:6 2 UDP 16515070 162.222.183.171 50340 typ relay raddr 162.222.183.171 rport 50340 +a=candidate:0 2 UDP 2130379006 10.0.0.36 55428 typ host +a=rtcp:62454 IN IP4 162.222.183.171 +a=end-of-candidates +a=ssrc:5150 +m=video 9 RTP/SAVPF 120 121 122 123 +c=IN IP6 ::1 +a=fingerprint:sha-1 DF:FA:FB:08:3B:3C:54:1D:D7:D4:05:77:A0:72:9B:14:08:6D:0F:4C:2E:AC:8A:FD:0A:8E:99:BF:5D:E8:3C:E7 +a=mid:second +a=rtpmap:120 VP8/90000 +a=rtpmap:121 VP9/90000 +a=rtpmap:122 red/90000 +a=rtpmap:123 ulpfec/90000 +a=recvonly +a=rtcp-fb:120 nack +a=rtcp-fb:120 nack pli +a=rtcp-fb:120 ccm fir +a=rtcp-fb:121 nack +a=rtcp-fb:121 nack pli +a=rtcp-fb:121 ccm fir +a=setup:active +a=rtcp-mux +a=msid:streama tracka +a=msid:streamb trackb +a=candidate:0 1 UDP 2130379007 10.0.0.36 59530 typ host +a=candidate:0 2 UDP 2130379006 10.0.0.36 64378 typ host +a=candidate:2 2 UDP 1694236670 24.6.134.204 64378 typ srflx raddr 10.0.0.36 rport 64378 +a=candidate:6 2 UDP 16515070 162.222.183.171 64941 typ relay raddr 162.222.183.171 rport 64941 +a=candidate:6 1 UDP 16515071 162.222.183.171 64800 typ relay raddr 162.222.183.171 rport 64800 +a=candidate:2 1 UDP 1694236671 24.6.134.204 59530 typ srflx raddr 10.0.0.36 rport 59530 +a=candidate:3 1 UDP 100401151 162.222.183.171 62935 typ relay raddr 162.222.183.171 rport 62935 +a=candidate:3 2 UDP 100401150 162.222.183.171 61026 typ relay raddr 162.222.183.171 rport 61026 +a=rtcp:61026 +a=end-of-candidates +a=ssrc:1111 foo +a=ssrc:1111 foo:bar +a=imageattr:120 send * recv * +m=audio 9 RTP/SAVPF 0 +a=mid:third +a=rtpmap:0 PCMU/8000 +a=ice-lite +a=ice-options:foo bar +a=msid:noappdata +a=bundle-only diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/9.sdp b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/9.sdp new file mode 100644 index 000000000000..f5c4acdbd8c6 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/9.sdp @@ -0,0 +1,34 @@ +v=0 +o=- 4294967296 2 IN IP4 127.0.0.1 +s=SIP Call +c=IN IP4 198.51.100.7 +t=0 0 +m=audio 9 RTP/SAVPF 109 9 0 8 101 +c=IN IP4 0.0.0.0 +a=mid:first +a=rtpmap:109 opus/48000/2 +a=ptime:20 +a=maxptime:20 +a=rtpmap:9 G722/8000 +a=rtpmap:0 PCMU/8000 +a=rtpmap:8 PCMA/8000 +a=rtpmap:101 telephone-event/8000 +a=fmtp:101 0-15 +a=fmtp:101 0-5. +a=fmtp:101 0-15,66,67 +a=fmtp:101 0,1,2-4,5-15,66,67 +a=fmtp:101 5,6,7 +a=fmtp:101 0 +a=fmtp:101 1 +a=fmtp:101 123 +a=fmtp:101 0-123 +a=fmtp:101 -12 +a=fmtp:101 12- +a=fmtp:101 1,12-,4 +a=fmtp:101 ,2,3 +a=fmtp:101 ,,,2,3 +a=fmtp:101 1,,,,,,,,3 +a=fmtp:101 1,2,3, +a=fmtp:101 1-2-3 +a=fmtp:101 112233 +a=fmtp:101 33-2 diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/extract.sh b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/extract.sh new file mode 100755 index 000000000000..60f1b1c763d3 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/bin/sdps/extract.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +grep '\"[ a-z]=[^=]*$' sdp_unittests.cpp | grep -v 'ParseSdp(kVideoSdp' | grep -v 'kVideoWithRedAndUlpfec' | grep -v 'ASSERT_NE' | grep -v 'BASE64_DTLS_HELLO' | grep -v '^\/\/' | sed 's/ParseSdp(//g' | sed 's/^[[:space:]]*//' | sed 's/+ //' | sed 's/ \/\/.*$//' | sed 's/\;$//' | sed 's/)$//' | sed 's/, false//' | sed 's/" CRLF//' | sed 's/^\"//' | sed 's/\"$//' | sed 's/\\r\\n//' | gawk -v RS='(^|\n)v=' '/./ { print "v="$0 > NR".sdp" }' diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/error.rs b/media/webrtc/signaling/src/sdp/rsdparsa/src/error.rs new file mode 100644 index 000000000000..5db493375775 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/error.rs @@ -0,0 +1,215 @@ +use std::num::ParseIntError; +use std::net::AddrParseError; +use std::fmt; +use std::error; +use std::error::Error; + +#[derive(Debug)] +pub enum SdpParserInternalError { + Generic(String), + Unsupported(String), + Integer(ParseIntError), + Address(AddrParseError), +} + +impl fmt::Display for SdpParserInternalError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match *self { + SdpParserInternalError::Generic(ref message) => { + write!(f, "Generic parsing error: {}", message) + } + SdpParserInternalError::Unsupported(ref message) => { + write!(f, "Unsupported parsing error: {}", message) + } + SdpParserInternalError::Integer(ref error) => { + write!(f, "Integer parsing error: {}", error.description()) + } + SdpParserInternalError::Address(ref error) => { + write!(f, "IP address parsing error: {}", error.description()) + } + } + } +} + +impl error::Error for SdpParserInternalError { + fn description(&self) -> &str { + match *self { + SdpParserInternalError::Generic(ref message) | + SdpParserInternalError::Unsupported(ref message) => message, + SdpParserInternalError::Integer(ref error) => error.description(), + SdpParserInternalError::Address(ref error) => error.description(), + } + } + + fn cause(&self) -> Option<&error::Error> { + match *self { + SdpParserInternalError::Integer(ref error) => Some(error), + SdpParserInternalError::Address(ref error) => Some(error), + // Can't tell much more about our internal errors + _ => None, + } + } +} + +#[test] +fn test_sdp_parser_internal_error_generic() { + let generic = SdpParserInternalError::Generic("generic message".to_string()); + assert_eq!(format!("{}", generic), + "Generic parsing error: generic message"); + assert_eq!(generic.description(), "generic message"); + assert!(generic.cause().is_none()); +} + +#[test] +fn test_sdp_parser_internal_error_unsupported() { + let unsupported = SdpParserInternalError::Unsupported("unsupported internal message" + .to_string()); + assert_eq!(format!("{}", unsupported), + "Unsupported parsing error: unsupported internal message"); + assert_eq!(unsupported.description(), "unsupported internal message"); + assert!(unsupported.cause().is_none()); +} + +#[test] +fn test_sdp_parser_internal_error_integer() { + let v = "12a"; + let integer = v.parse::(); + assert!(integer.is_err()); + let int_err = SdpParserInternalError::Integer(integer.err().unwrap()); + assert_eq!(format!("{}", int_err), + "Integer parsing error: invalid digit found in string"); + assert_eq!(int_err.description(), "invalid digit found in string"); + assert!(!int_err.cause().is_none()); +} + +#[test] +fn test_sdp_parser_internal_error_address() { + let v = "127.0.0.a"; + use std::str::FromStr; + use std::net::IpAddr; + let addr = IpAddr::from_str(v); + assert!(addr.is_err()); + let addr_err = SdpParserInternalError::Address(addr.err().unwrap()); + assert_eq!(format!("{}", addr_err), + "IP address parsing error: invalid IP address syntax"); + assert_eq!(addr_err.description(), "invalid IP address syntax"); + assert!(!addr_err.cause().is_none()); +} + +#[derive(Debug)] +pub enum SdpParserError { + Line { + error: SdpParserInternalError, + line: String, + line_number: usize, + }, + Unsupported { + error: SdpParserInternalError, + line: String, + line_number: usize, + }, + Sequence { message: String, line_number: usize }, +} + +impl fmt::Display for SdpParserError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match *self { + SdpParserError::Line { + ref error, + ref line, + ref line_number, + } => { + write!(f, + "Line error: {} in line({}): {}", + error.description(), + line_number, + line) + } + SdpParserError::Unsupported { + ref error, + ref line, + ref line_number, + } => { + write!(f, + "Unsupported: {} in line({}): {}", + error.description(), + line_number, + line) + } + SdpParserError::Sequence { + ref message, + ref line_number, + } => write!(f, "Sequence error in line({}): {}", line_number, message), + } + } +} + + +impl error::Error for SdpParserError { + fn description(&self) -> &str { + match *self { + SdpParserError::Line { ref error, .. } | + SdpParserError::Unsupported { ref error, .. } => error.description(), + SdpParserError::Sequence { ref message, .. } => message, + } + } + + fn cause(&self) -> Option<&error::Error> { + match *self { + SdpParserError::Line { ref error, .. } | + SdpParserError::Unsupported { ref error, .. } => Some(error), + // Can't tell much more about our internal errors + _ => None, + } + } +} + +impl From for SdpParserInternalError { + fn from(err: ParseIntError) -> SdpParserInternalError { + SdpParserInternalError::Integer(err) + } +} + +impl From for SdpParserInternalError { + fn from(err: AddrParseError) -> SdpParserInternalError { + SdpParserInternalError::Address(err) + } +} + +#[test] +fn test_sdp_parser_error_line() { + let line1 = SdpParserError::Line { + error: SdpParserInternalError::Generic("test message".to_string()), + line: "test line".to_string(), + line_number: 13, + }; + assert_eq!(format!("{}", line1), + "Line error: test message in line(13): test line"); + assert_eq!(line1.description(), "test message"); + assert!(line1.cause().is_some()); +} + +#[test] +fn test_sdp_parser_error_unsupported() { + let unsupported1 = SdpParserError::Unsupported { + error: SdpParserInternalError::Generic("unsupported value".to_string()), + line: "unsupported line".to_string(), + line_number: 21, + }; + assert_eq!(format!("{}", unsupported1), + "Unsupported: unsupported value in line(21): unsupported line"); + assert_eq!(unsupported1.description(), "unsupported value"); + assert!(unsupported1.cause().is_some()); +} + +#[test] +fn test_sdp_parser_error_sequence() { + let sequence1 = SdpParserError::Sequence { + message: "sequence message".to_string(), + line_number: 42, + }; + assert_eq!(format!("{}", sequence1), + "Sequence error in line(42): sequence message"); + assert_eq!(sequence1.description(), "sequence message"); + assert!(sequence1.cause().is_none()); +} diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/lib.rs b/media/webrtc/signaling/src/sdp/rsdparsa/src/lib.rs new file mode 100644 index 000000000000..e3fb24359e58 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/lib.rs @@ -0,0 +1,974 @@ +#![cfg_attr(feature="clippy", feature(plugin))] + +use std::net::IpAddr; +use std::fmt; + +pub mod attribute_type; +pub mod error; +pub mod media_type; +pub mod network; +pub mod unsupported_types; + +use attribute_type::{SdpAttribute, parse_attribute}; +use error::{SdpParserInternalError, SdpParserError}; +use media_type::{SdpMedia, SdpMediaLine, parse_media, parse_media_vector}; +use network::{parse_addrtype, parse_nettype, parse_unicast_addr}; +use unsupported_types::{parse_email, parse_information, parse_key, parse_phone, parse_repeat, + parse_uri, parse_zone}; + +#[derive(Clone)] +pub enum SdpBandwidth { + As(u32), + Ct(u32), + Tias(u32), + Unknown(String, u32), +} + +#[derive(Clone)] +pub struct SdpConnection { + pub addr: IpAddr, + pub ttl: Option, + pub amount: Option, +} + +#[derive(Clone)] +pub struct SdpOrigin { + pub username: String, + pub session_id: u64, + pub session_version: u64, + pub unicast_addr: IpAddr, +} + +impl fmt::Display for SdpOrigin { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, + "origin: {}, {}, {}, {}", + self.username, + self.session_id, + self.session_version, + self.unicast_addr) + } +} + +#[derive(Clone)] +pub struct SdpTiming { + pub start: u64, + pub stop: u64, +} + +pub enum SdpType { + Attribute(SdpAttribute), + Bandwidth(SdpBandwidth), + Connection(SdpConnection), + Email(String), + Information(String), + Key(String), + Media(SdpMediaLine), + Phone(String), + Origin(SdpOrigin), + Repeat(String), + Session(String), + Timing(SdpTiming), + Uri(String), + Version(u64), + Zone(String), +} + +pub struct SdpLine { + pub line_number: usize, + pub sdp_type: SdpType, +} + +pub struct SdpSession { + pub version: u64, + pub origin: SdpOrigin, + pub session: String, + pub connection: Option, + pub bandwidth: Vec, + pub timing: Option, + pub attribute: Vec, + pub media: Vec, + // unsupported values: + // information: Option, + // uri: Option, + // email: Option, + // phone: Option, + // repeat: Option, + // zone: Option, + // key: Option, +} + +impl SdpSession { + pub fn new(version: u64, origin: SdpOrigin, session: String) -> SdpSession { + SdpSession { + version, + origin, + session, + connection: None, + bandwidth: Vec::new(), + timing: None, + attribute: Vec::new(), + media: Vec::new(), + } + } + + pub fn get_version(&self) -> u64 { + self.version + } + + pub fn get_origin(&self) -> &SdpOrigin { + &self.origin + } + + pub fn get_session(&self) -> &String { + &self.session + } + + pub fn get_connection(&self) -> &Option { + &self.connection + } + + pub fn set_connection(&mut self, c: &SdpConnection) { + self.connection = Some(c.clone()) + } + + pub fn add_bandwidth(&mut self, b: &SdpBandwidth) { + self.bandwidth.push(b.clone()) + } + + pub fn set_timing(&mut self, t: &SdpTiming) { + self.timing = Some(t.clone()) + } + + pub fn add_attribute(&mut self, a: &SdpAttribute) -> Result<(), SdpParserInternalError> { + if !a.allowed_at_session_level() { + return Err(SdpParserInternalError::Generic(format!("{} not allowed at session level", + a))); + }; + Ok(self.attribute.push(a.clone())) + } + + pub fn extend_media(&mut self, v: Vec) { + self.media.extend(v) + } + + pub fn has_timing(&self) -> bool { + self.timing.is_some() + } + + pub fn has_attributes(&self) -> bool { + !self.attribute.is_empty() + } + + // FIXME this is a temporary hack until we re-oranize the SdpAttribute enum + // so that we can build a generic has_attribute(X) function + fn has_extmap_attribute(&self) -> bool { + for attribute in &self.attribute { + if let &SdpAttribute::Extmap(_) = attribute { + return true; + } + } + false + } + + pub fn has_media(&self) -> bool { + !self.media.is_empty() + } +} + +fn parse_session(value: &str) -> Result { + println!("session: {}", value); + Ok(SdpType::Session(String::from(value))) +} + +#[test] +fn test_session_works() { + assert!(parse_session("topic").is_ok()); +} + + +fn parse_version(value: &str) -> Result { + let ver = value.parse::()?; + if ver != 0 { + return Err(SdpParserInternalError::Generic(format!("version type contains unsupported value {}", + ver))); + }; + println!("version: {}", ver); + Ok(SdpType::Version(ver)) +} + +#[test] +fn test_version_works() { + assert!(parse_version("0").is_ok()); +} + +#[test] +fn test_version_unsupported_input() { + assert!(parse_version("1").is_err()); + assert!(parse_version("11").is_err()); + assert!(parse_version("a").is_err()); +} + +fn parse_origin(value: &str) -> Result { + let mut tokens = value.split_whitespace(); + let username = match tokens.next() { + None => { + return Err(SdpParserInternalError::Generic("Origin type is missing username token" + .to_string())) + } + Some(x) => x, + }; + let session_id = match tokens.next() { + None => { + return Err(SdpParserInternalError::Generic("Origin type is missing session ID token" + .to_string())) + } + Some(x) => x.parse::()?, + }; + let session_version = match tokens.next() { + None => { + return Err(SdpParserInternalError::Generic( + "Origin type is missing session version token" + .to_string())) + } + Some(x) => x.parse::()?, + }; + match tokens.next() { + None => { + return Err(SdpParserInternalError::Generic( + "Origin type is missing session version token".to_string(), + )) + } + Some(x) => parse_nettype(x)?, + }; + let addrtype = match tokens.next() { + None => { + return Err(SdpParserInternalError::Generic("Origin type is missing address type token" + .to_string())) + } + Some(x) => parse_addrtype(x)?, + }; + let unicast_addr = match tokens.next() { + None => { + return Err(SdpParserInternalError::Generic("Origin type is missing IP address token" + .to_string())) + } + Some(x) => parse_unicast_addr(x)?, + }; + if !addrtype.same_protocol(&unicast_addr) { + return Err(SdpParserInternalError::Generic("Origin addrtype does not match address." + .to_string())); + } + let o = SdpOrigin { + username: String::from(username), + session_id, + session_version, + unicast_addr, + }; + println!("{}", o); + Ok(SdpType::Origin(o)) +} + +#[test] +fn test_origin_works() { + assert!(parse_origin("mozilla 506705521068071134 0 IN IP4 0.0.0.0").is_ok()); + assert!(parse_origin("mozilla 506705521068071134 0 IN IP6 ::1").is_ok()); +} + +#[test] +fn test_origin_wrong_amount_of_tokens() { + assert!(parse_origin("a b c d e").is_err()); + assert!(parse_origin("a b c d e f g").is_err()); +} + +#[test] +fn test_origin_unsupported_nettype() { + assert!(parse_origin("mozilla 506705521068071134 0 UNSUPPORTED IP4 0.0.0.0").is_err()); +} + +#[test] +fn test_origin_unsupported_addrtpe() { + assert!(parse_origin("mozilla 506705521068071134 0 IN IP1 0.0.0.0").is_err()); +} + +#[test] +fn test_origin_broken_ip_addr() { + assert!(parse_origin("mozilla 506705521068071134 0 IN IP4 1.1.1.256").is_err()); + assert!(parse_origin("mozilla 506705521068071134 0 IN IP6 ::g").is_err()); +} + +#[test] +fn test_origin_addr_type_mismatch() { + assert!(parse_origin("mozilla 506705521068071134 0 IN IP4 ::1").is_err()); +} + +fn parse_connection(value: &str) -> Result { + let cv: Vec<&str> = value.split_whitespace().collect(); + if cv.len() != 3 { + return Err(SdpParserInternalError::Generic("connection attribute must have three tokens" + .to_string())); + } + parse_nettype(cv[0])?; + let addrtype = parse_addrtype(cv[1])?; + let mut ttl = None; + let mut amount = None; + let mut addr_token = cv[2]; + if addr_token.find('/') != None { + let addr_tokens: Vec<&str> = addr_token.split('/').collect(); + if addr_tokens.len() >= 3 { + amount = Some(addr_tokens[2].parse::()?); + } + ttl = Some(addr_tokens[1].parse::()?); + addr_token = addr_tokens[0]; + } + let addr = parse_unicast_addr(addr_token)?; + if !addrtype.same_protocol(&addr) { + return Err(SdpParserInternalError::Generic("connection addrtype does not match address." + .to_string())); + } + let c = SdpConnection { addr, ttl, amount }; + println!("connection: {}", c.addr); + Ok(SdpType::Connection(c)) +} + +#[test] +fn connection_works() { + assert!(parse_connection("IN IP4 127.0.0.1").is_ok()); + assert!(parse_connection("IN IP4 127.0.0.1/10/10").is_ok()); +} + +#[test] +fn connection_lots_of_whitespace() { + assert!(parse_connection("IN IP4 127.0.0.1").is_ok()); +} + +#[test] +fn connection_wrong_amount_of_tokens() { + assert!(parse_connection("IN IP4").is_err()); + assert!(parse_connection("IN IP4 0.0.0.0 foobar").is_err()); +} + +#[test] +fn connection_unsupported_nettype() { + assert!(parse_connection("UNSUPPORTED IP4 0.0.0.0").is_err()); +} + +#[test] +fn connection_unsupported_addrtpe() { + assert!(parse_connection("IN IP1 0.0.0.0").is_err()); +} + +#[test] +fn connection_broken_ip_addr() { + assert!(parse_connection("IN IP4 1.1.1.256").is_err()); + assert!(parse_connection("IN IP6 ::g").is_err()); +} + +#[test] +fn connection_addr_type_mismatch() { + assert!(parse_connection("IN IP4 ::1").is_err()); +} + +fn parse_bandwidth(value: &str) -> Result { + let bv: Vec<&str> = value.split(':').collect(); + if bv.len() != 2 { + return Err(SdpParserInternalError::Generic("bandwidth attribute must have two tokens" + .to_string())); + } + let bandwidth = bv[1].parse::()?; + let bw = match bv[0].to_uppercase().as_ref() { + "AS" => SdpBandwidth::As(bandwidth), + "CT" => SdpBandwidth::Ct(bandwidth), + "TIAS" => SdpBandwidth::Tias(bandwidth), + _ => SdpBandwidth::Unknown(String::from(bv[0]), bandwidth), + }; + println!("bandwidth: {}, {}", bv[0], bandwidth); + Ok(SdpType::Bandwidth(bw)) +} + +#[test] +fn bandwidth_works() { + assert!(parse_bandwidth("AS:1").is_ok()); + assert!(parse_bandwidth("CT:123").is_ok()); + assert!(parse_bandwidth("TIAS:12345").is_ok()); +} + +#[test] +fn bandwidth_wrong_amount_of_tokens() { + assert!(parse_bandwidth("TIAS").is_err()); + assert!(parse_bandwidth("TIAS:12345:xyz").is_err()); +} + +#[test] +fn bandwidth_unsupported_type() { + assert!(parse_bandwidth("UNSUPPORTED:12345").is_ok()); +} + +fn parse_timing(value: &str) -> Result { + let tv: Vec<&str> = value.split_whitespace().collect(); + if tv.len() != 2 { + return Err(SdpParserInternalError::Generic("timing attribute must have two tokens" + .to_string())); + } + let start = tv[0].parse::()?; + let stop = tv[1].parse::()?; + let t = SdpTiming { start, stop }; + println!("timing: {}, {}", t.start, t.stop); + Ok(SdpType::Timing(t)) +} + +#[test] +fn test_timing_works() { + assert!(parse_timing("0 0").is_ok()); +} + +#[test] +fn test_timing_non_numeric_tokens() { + assert!(parse_timing("a 0").is_err()); + assert!(parse_timing("0 a").is_err()); +} + +#[test] +fn test_timing_wrong_amount_of_tokens() { + assert!(parse_timing("0").is_err()); + assert!(parse_timing("0 0 0").is_err()); +} + +fn parse_sdp_line(line: &str, line_number: usize) -> Result { + if line.find('=') == None { + return Err(SdpParserError::Line { + error: SdpParserInternalError::Generic("missing = character in line" + .to_string()), + line: line.to_string(), + line_number: line_number, + }); + } + let mut splitted_line = line.splitn(2, '='); + let line_type = match splitted_line.next() { + None => { + return Err(SdpParserError::Line { + error: SdpParserInternalError::Generic("missing type".to_string()), + line: line.to_string(), + line_number: line_number, + }) + } + Some(t) => { + let trimmed = t.trim(); + if trimmed.len() > 1 { + return Err(SdpParserError::Line { + error: SdpParserInternalError::Generic("type too long".to_string()), + line: line.to_string(), + line_number: line_number, + }); + } + if trimmed.is_empty() { + return Err(SdpParserError::Line { + error: SdpParserInternalError::Generic("type is empty".to_string()), + line: line.to_string(), + line_number: line_number, + }); + } + trimmed + } + }; + let line_value = match splitted_line.next() { + None => { + return Err(SdpParserError::Line { + error: SdpParserInternalError::Generic("missing value".to_string()), + line: line.to_string(), + line_number: line_number, + }) + } + Some(v) => { + let trimmed = v.trim(); + if trimmed.is_empty() { + return Err(SdpParserError::Line { + error: SdpParserInternalError::Generic("value is empty".to_string()), + line: line.to_string(), + line_number: line_number, + }); + } + trimmed + } + }; + match line_type.to_lowercase().as_ref() { + "a" => parse_attribute(line_value), + "b" => parse_bandwidth(line_value), + "c" => parse_connection(line_value), + "e" => parse_email(line_value), + "i" => parse_information(line_value), + "k" => parse_key(line_value), + "m" => parse_media(line_value), + "o" => parse_origin(line_value), + "p" => parse_phone(line_value), + "r" => parse_repeat(line_value), + "s" => parse_session(line_value), + "t" => parse_timing(line_value), + "u" => parse_uri(line_value), + "v" => parse_version(line_value), + "z" => parse_zone(line_value), + _ => Err(SdpParserInternalError::Generic("unknown sdp type".to_string())), + } + .map(|sdp_type| { + SdpLine { + line_number, + sdp_type, + } + }) + .map_err(|e| match e { + SdpParserInternalError::Generic(..) | + SdpParserInternalError::Integer(..) | + SdpParserInternalError::Address(..) => { + SdpParserError::Line { + error: e, + line: line.to_string(), + line_number: line_number, + } + } + SdpParserInternalError::Unsupported(..) => { + SdpParserError::Unsupported { + error: e, + line: line.to_string(), + line_number: line_number, + } + } + }) +} + +#[test] +fn test_parse_sdp_line_works() { + assert!(parse_sdp_line("v=0", 0).is_ok()); + assert!(parse_sdp_line("s=somesession", 0).is_ok()); +} + +#[test] +fn test_parse_sdp_line_empty_line() { + assert!(parse_sdp_line("", 0).is_err()); +} + +#[test] +fn test_parse_sdp_line_unknown_key() { + assert!(parse_sdp_line("y=foobar", 0).is_err()); +} + +#[test] +fn test_parse_sdp_line_too_long_type() { + assert!(parse_sdp_line("ab=foobar", 0).is_err()); +} + +#[test] +fn test_parse_sdp_line_without_equal() { + assert!(parse_sdp_line("abcd", 0).is_err()); + assert!(parse_sdp_line("ab cd", 0).is_err()); +} + +#[test] +fn test_parse_sdp_line_empty_value() { + assert!(parse_sdp_line("v=", 0).is_err()); + assert!(parse_sdp_line("o=", 0).is_err()); + assert!(parse_sdp_line("s=", 0).is_err()); +} + +#[test] +fn test_parse_sdp_line_empty_name() { + assert!(parse_sdp_line("=abc", 0).is_err()); +} + +#[test] +fn test_parse_sdp_line_valid_a_line() { + assert!(parse_sdp_line("a=rtpmap:8 PCMA/8000", 0).is_ok()); +} + +#[test] +fn test_parse_sdp_line_invalid_a_line() { + assert!(parse_sdp_line("a=rtpmap:200 PCMA/8000", 0).is_err()); +} + +fn sanity_check_sdp_session(session: &SdpSession) -> Result<(), SdpParserError> { + if !session.has_timing() { + return Err(SdpParserError::Sequence { + message: "Missing timing type".to_string(), + line_number: 0, + }); + } + + if !session.has_media() { + return Err(SdpParserError::Sequence { + message: "Missing media setion".to_string(), + line_number: 0, + }); + } + + // Check that extmaps are not defined on session and media level + if session.has_extmap_attribute() { + for msection in &session.media { + if msection.has_extmap_attribute() { + return Err(SdpParserError::Sequence { + message: "Extmap can't be define at session and media level" + .to_string(), + line_number: 0, + }); + } + } + } + + Ok(()) +} + +#[cfg(test)] +fn create_dummy_sdp_session() -> SdpSession { + let origin = parse_origin("mozilla 506705521068071134 0 IN IP4 0.0.0.0"); + assert!(origin.is_ok()); + let sdp_session; + if let SdpType::Origin(o) = origin.unwrap() { + sdp_session = SdpSession::new(0, o, "-".to_string()); + } else { + panic!("SdpType is not Origin"); + } + sdp_session +} + +#[cfg(test)] +use media_type::create_dummy_media_section; + +#[test] +fn test_sanity_check_sdp_session_timing() { + let mut sdp_session = create_dummy_sdp_session(); + sdp_session.extend_media(vec![create_dummy_media_section()]); + + assert!(sanity_check_sdp_session(&sdp_session).is_err()); + + let t = SdpTiming { start: 0, stop: 0 }; + sdp_session.set_timing(&t); + + assert!(sanity_check_sdp_session(&sdp_session).is_ok()); +} + +#[test] +fn test_sanity_check_sdp_session_media() { + let mut sdp_session = create_dummy_sdp_session(); + let t = SdpTiming { start: 0, stop: 0 }; + sdp_session.set_timing(&t); + + assert!(sanity_check_sdp_session(&sdp_session).is_err()); + + sdp_session.extend_media(vec![create_dummy_media_section()]); + + assert!(sanity_check_sdp_session(&sdp_session).is_ok()); +} + +#[test] +fn test_sanity_check_sdp_session_extmap() { + let mut sdp_session = create_dummy_sdp_session(); + let t = SdpTiming { start: 0, stop: 0 }; + sdp_session.set_timing(&t); + sdp_session.extend_media(vec![create_dummy_media_section()]); + + let attribute = parse_attribute("extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time",); + assert!(attribute.is_ok()); + let extmap; + if let SdpType::Attribute(a) = attribute.unwrap() { + extmap = a; + } else { + panic!("SdpType is not Attribute"); + } + let ret = sdp_session.add_attribute(&extmap); + assert!(ret.is_ok()); + assert!(sdp_session.has_extmap_attribute()); + + assert!(sanity_check_sdp_session(&sdp_session).is_ok()); + + let mattribute = parse_attribute("extmap:1/sendonly urn:ietf:params:rtp-hdrext:ssrc-audio-level",); + assert!(mattribute.is_ok()); + let mextmap; + if let SdpType::Attribute(ma) = mattribute.unwrap() { + mextmap = ma; + } else { + panic!("SdpType is not Attribute"); + } + let mut second_media = create_dummy_media_section(); + assert!(second_media.add_attribute(&mextmap).is_ok()); + assert!(second_media.has_extmap_attribute()); + + sdp_session.extend_media(vec![second_media]); + assert!(sdp_session.media.len() == 2); + + assert!(sanity_check_sdp_session(&sdp_session).is_err()); + + sdp_session.attribute = Vec::new(); + + assert!(sanity_check_sdp_session(&sdp_session).is_ok()); +} + +#[test] +fn test_sanity_check_sdp_session_simulcast() { + let mut sdp_session = create_dummy_sdp_session(); + let t = SdpTiming { start: 0, stop: 0 }; + sdp_session.set_timing(&t); + sdp_session.extend_media(vec![create_dummy_media_section()]); + + assert!(sanity_check_sdp_session(&sdp_session).is_ok()); +} + +// TODO add unit tests +fn parse_sdp_vector(lines: &[SdpLine]) -> Result { + if lines.len() < 5 { + return Err(SdpParserError::Sequence { + message: "SDP neeeds at least 5 lines".to_string(), + line_number: 0, + }); + } + + // TODO are these mataches really the only way to verify the types? + let version: u64 = match lines[0].sdp_type { + SdpType::Version(v) => v, + _ => { + return Err(SdpParserError::Sequence { + message: "first line needs to be version number".to_string(), + line_number: lines[0].line_number, + }) + } + }; + let origin: SdpOrigin = match lines[1].sdp_type { + SdpType::Origin(ref v) => v.clone(), + _ => { + return Err(SdpParserError::Sequence { + message: "second line needs to be origin".to_string(), + line_number: lines[1].line_number, + }) + } + }; + let session: String = match lines[2].sdp_type { + SdpType::Session(ref v) => v.clone(), + _ => { + return Err(SdpParserError::Sequence { + message: "third line needs to be session".to_string(), + line_number: lines[2].line_number, + }) + } + }; + let mut sdp_session = SdpSession::new(version, origin, session); + for (index, line) in lines.iter().enumerate().skip(3) { + match line.sdp_type { + SdpType::Attribute(ref a) => { + sdp_session + .add_attribute(a) + .map_err(|e: SdpParserInternalError| { + SdpParserError::Sequence { + message: format!("{}", e), + line_number: line.line_number, + } + })? + } + SdpType::Bandwidth(ref b) => sdp_session.add_bandwidth(b), + SdpType::Timing(ref t) => sdp_session.set_timing(t), + SdpType::Connection(ref c) => sdp_session.set_connection(c), + SdpType::Media(_) => sdp_session.extend_media(parse_media_vector(&lines[index..])?), + SdpType::Origin(_) | + SdpType::Session(_) | + SdpType::Version(_) => { + return Err(SdpParserError::Sequence { + message: "version, origin or session at wrong level".to_string(), + line_number: line.line_number, + }) + } + // the line parsers throw unsupported errors for these already + SdpType::Email(_) | + SdpType::Information(_) | + SdpType::Key(_) | + SdpType::Phone(_) | + SdpType::Repeat(_) | + SdpType::Uri(_) | + SdpType::Zone(_) => (), + }; + if sdp_session.has_media() { + break; + }; + } + sanity_check_sdp_session(&sdp_session)?; + Ok(sdp_session) +} + +pub fn parse_sdp(sdp: &str, fail_on_warning: bool) -> Result { + if sdp.is_empty() { + return Err(SdpParserError::Line { + error: SdpParserInternalError::Generic("empty SDP".to_string()), + line: sdp.to_string(), + line_number: 0, + }); + } + if sdp.len() < 62 { + return Err(SdpParserError::Line { + error: SdpParserInternalError::Generic("string to short to be valid SDP" + .to_string()), + line: sdp.to_string(), + line_number: 0, + }); + } + let lines = sdp.lines(); + let mut errors: Vec = Vec::new(); + let mut warnings: Vec = Vec::new(); + let mut sdp_lines: Vec = Vec::new(); + for (line_number, line) in lines.enumerate() { + let stripped_line = line.trim(); + if stripped_line.is_empty() { + continue; + } + match parse_sdp_line(stripped_line, line_number) { + Ok(n) => { + sdp_lines.push(n); + } + Err(e) => { + match e { + // FIXME is this really a good way to accomplish this? + SdpParserError::Line { + error, + line, + line_number, + } => { + errors.push(SdpParserError::Line { + error, + line, + line_number, + }) + } + SdpParserError::Unsupported { + error, + line, + line_number, + } => { + warnings.push(SdpParserError::Unsupported { + error, + line, + line_number, + }); + } + SdpParserError::Sequence { + message, + line_number, + } => { + errors.push(SdpParserError::Sequence { + message, + line_number, + }) + } + } + } + }; + } + for warning in warnings { + if fail_on_warning { + return Err(warning); + } else { + println!("Warning: {}", warning); + }; + } + // We just return the last of the errors here + if let Some(e) = errors.pop() { + return Err(e); + }; + let session = parse_sdp_vector(&sdp_lines)?; + Ok(session) +} + +#[test] +fn test_parse_sdp_zero_length_string_fails() { + assert!(parse_sdp("", true).is_err()); +} + +#[test] +fn test_parse_sdp_to_short_string() { + assert!(parse_sdp("fooooobarrrr", true).is_err()); +} + +#[test] +fn test_parse_sdp_line_error() { + assert!(parse_sdp("v=0\r\n +o=- 0 0 IN IP4 0.0.0.0\r\n +s=-\r\n +t=0 foobar\r\n +m=audio 0 UDP/TLS/RTP/SAVPF 0\r\n", + true) + .is_err()); +} + +#[test] +fn test_parse_sdp_unsupported_error() { + assert!(parse_sdp("v=0\r\n +o=- 0 0 IN IP4 0.0.0.0\r\n +s=-\r\n +t=0 0\r\n +m=foobar 0 UDP/TLS/RTP/SAVPF 0\r\n", + true) + .is_err()); +} + +#[test] +fn test_parse_sdp_unsupported_warning() { + assert!(parse_sdp("v=0\r\n +o=- 0 0 IN IP4 0.0.0.0\r\n +s=-\r\n +t=0 0\r\n +m=audio 0 UDP/TLS/RTP/SAVPF 0\r\n +a=unsupported\r\n", + false) + .is_ok()); +} + +#[test] +fn test_parse_sdp_sequence_error() { + assert!(parse_sdp("v=0\r\n +o=- 0 0 IN IP4 0.0.0.0\r\n +t=0 0\r\n +s=-\r\n +m=audio 0 UDP/TLS/RTP/SAVPF 0\r\n", + true) + .is_err()); +} + +#[test] +fn test_parse_sdp_integer_error() { + assert!(parse_sdp("v=0\r\n +o=- 0 0 IN IP4 0.0.0.0\r\n +s=-\r\n +t=0 0\r\n +m=audio 0 UDP/TLS/RTP/SAVPF 0\r\n +a=rtcp:34er21\r\n", + true) + .is_err()); +} + +#[test] +fn test_parse_sdp_ipaddr_error() { + assert!(parse_sdp("v=0\r\n +o=- 0 0 IN IP4 0.a.b.0\r\n +s=-\r\n +t=0 0\r\n +m=audio 0 UDP/TLS/RTP/SAVPF 0\r\n", + true) + .is_err()); +} + +#[test] +fn test_parse_sdp_invalid_session_attribute() { + assert!(parse_sdp("v=0\r\n +o=- 0 0 IN IP4 0.a.b.0\r\n +s=-\r\n +t=0 0\r\n +a=bundle-only\r\n +m=audio 0 UDP/TLS/RTP/SAVPF 0\r\n", + true) + .is_err()); +} + +#[test] +fn test_parse_sdp_invalid_media_attribute() { + assert!(parse_sdp("v=0\r\n +o=- 0 0 IN IP4 0.a.b.0\r\n +s=-\r\n +t=0 0\r\n +m=audio 0 UDP/TLS/RTP/SAVPF 0\r\n +a=ice-lite\r\n", + true) + .is_err()); +} diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/media_type.rs b/media/webrtc/signaling/src/sdp/rsdparsa/src/media_type.rs new file mode 100644 index 000000000000..a9b116aabe52 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/media_type.rs @@ -0,0 +1,414 @@ +use std::fmt; +use {SdpType, SdpLine, SdpBandwidth, SdpConnection}; +use attribute_type::SdpAttribute; +use error::{SdpParserError, SdpParserInternalError}; + +#[derive(Clone)] +pub struct SdpMediaLine { + pub media: SdpMediaValue, + pub port: u32, + pub port_count: u32, + pub proto: SdpProtocolValue, + pub formats: SdpFormatList, +} + +#[derive(Clone,Debug,PartialEq)] +pub enum SdpMediaValue { + Audio, + Video, + Application, +} + +impl fmt::Display for SdpMediaValue { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let printable = match *self { + SdpMediaValue::Audio => "Audio", + SdpMediaValue::Video => "Video", + SdpMediaValue::Application => "Application", + }; + write!(f, "{}", printable) + } +} + +#[derive(Clone,Debug,PartialEq)] +pub enum SdpProtocolValue { + RtpSavpf, + UdpTlsRtpSavpf, + TcpTlsRtpSavpf, + DtlsSctp, + UdpDtlsSctp, + TcpDtlsSctp, +} + +impl fmt::Display for SdpProtocolValue { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let printable = match *self { + SdpProtocolValue::RtpSavpf => "Rtp/Savpf", + SdpProtocolValue::UdpTlsRtpSavpf => "Udp/Tls/Rtp/Savpf", + SdpProtocolValue::TcpTlsRtpSavpf => "Tcp/Tls/Rtp/Savpf", + SdpProtocolValue::DtlsSctp => "Dtls/Sctp", + SdpProtocolValue::UdpDtlsSctp => "Udp/Dtls/Sctp", + SdpProtocolValue::TcpDtlsSctp => "Tcp/Dtls/Sctp", + }; + write!(f, "{}", printable) + } +} + +#[derive(Clone)] +pub enum SdpFormatList { + Integers(Vec), + Strings(Vec), +} + +impl fmt::Display for SdpFormatList { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match *self { + SdpFormatList::Integers(ref x) => write!(f, "{:?}", x), + SdpFormatList::Strings(ref x) => write!(f, "{:?}", x), + } + } +} + +pub struct SdpMedia { + media: SdpMediaLine, + connection: Option, + bandwidth: Vec, + attribute: Vec, + // unsupported values: + // information: Option, + // key: Option, +} + +impl SdpMedia { + pub fn new(media: SdpMediaLine) -> SdpMedia { + SdpMedia { + media, + connection: None, + bandwidth: Vec::new(), + attribute: Vec::new(), + } + } + + pub fn get_type(&self) -> &SdpMediaValue { + &self.media.media + } + + pub fn get_port(&self) -> u32 { + self.media.port + } + + pub fn get_port_count(&self) -> u32 { + self.media.port_count + } + + pub fn get_proto(&self) -> &SdpProtocolValue { + &self.media.proto + } + + pub fn get_formats(&self) -> &SdpFormatList { + &self.media.formats + } + + pub fn has_bandwidth(&self) -> bool { + !self.bandwidth.is_empty() + } + + pub fn get_bandwidth(&self) -> &Vec { + &self.bandwidth + } + + pub fn add_bandwidth(&mut self, bw: &SdpBandwidth) { + self.bandwidth.push(bw.clone()) + } + + pub fn has_attributes(&self) -> bool { + !self.attribute.is_empty() + } + + pub fn get_attributes(&self) -> &Vec { + &self.attribute + } + + pub fn add_attribute(&mut self, attr: &SdpAttribute) -> Result<(), SdpParserInternalError> { + if !attr.allowed_at_media_level() { + return Err(SdpParserInternalError::Generic(format!("{} not allowed at media level", + attr))); + } + Ok(self.attribute.push(attr.clone())) + } + + // FIXME this is a temporary hack until we re-oranize the SdpAttribute enum + // so that we can build a generic has_attribute(X) function + pub fn has_extmap_attribute(&self) -> bool { + for attribute in &self.attribute { + if let &SdpAttribute::Extmap(_) = attribute { + return true; + } + } + false + } + + pub fn has_connection(&self) -> bool { + self.connection.is_some() + } + + pub fn get_connection(&self) -> &Option { + &self.connection + } + + pub fn set_connection(&mut self, c: &SdpConnection) -> Result<(), SdpParserInternalError> { + if self.connection.is_some() { + return Err(SdpParserInternalError::Generic("connection type already exists at this media level" + .to_string(), + )); + } + Ok(self.connection = Some(c.clone())) + } +} + +#[cfg(test)] +pub fn create_dummy_media_section() -> SdpMedia { + let media_line = SdpMediaLine { + media: SdpMediaValue::Audio, + port: 9, + port_count: 0, + proto: SdpProtocolValue::RtpSavpf, + formats: SdpFormatList::Integers(Vec::new()), + }; + SdpMedia::new(media_line) +} + +fn parse_media_token(value: &str) -> Result { + Ok(match value.to_lowercase().as_ref() { + "audio" => SdpMediaValue::Audio, + "video" => SdpMediaValue::Video, + "application" => SdpMediaValue::Application, + _ => { + return Err(SdpParserInternalError::Unsupported(format!("unsupported media value: {}", + value))) + } + }) +} + +#[test] +fn test_parse_media_token() { + let audio = parse_media_token("audio"); + assert!(audio.is_ok()); + assert_eq!(audio.unwrap(), SdpMediaValue::Audio); + let video = parse_media_token("VIDEO"); + assert!(video.is_ok()); + assert_eq!(video.unwrap(), SdpMediaValue::Video); + let app = parse_media_token("aPplIcatIOn"); + assert!(app.is_ok()); + assert_eq!(app.unwrap(), SdpMediaValue::Application); + + assert!(parse_media_token("").is_err()); + assert!(parse_media_token("foobar").is_err()); +} + + +fn parse_protocol_token(value: &str) -> Result { + Ok(match value.to_uppercase().as_ref() { + "RTP/SAVPF" => SdpProtocolValue::RtpSavpf, + "UDP/TLS/RTP/SAVPF" => SdpProtocolValue::UdpTlsRtpSavpf, + "TCP/TLS/RTP/SAVPF" => SdpProtocolValue::TcpTlsRtpSavpf, + "DTLS/SCTP" => SdpProtocolValue::DtlsSctp, + "UDP/DTLS/SCTP" => SdpProtocolValue::UdpDtlsSctp, + "TCP/DTLS/SCTP" => SdpProtocolValue::TcpDtlsSctp, + _ => { + return Err(SdpParserInternalError::Unsupported(format!("unsupported protocol value: {}", + value))) + } + }) +} + +#[test] +fn test_parse_protocol_token() { + let rtps = parse_protocol_token("rtp/savpf"); + assert!(rtps.is_ok()); + assert_eq!(rtps.unwrap(), SdpProtocolValue::RtpSavpf); + let udps = parse_protocol_token("udp/tls/rtp/savpf"); + assert!(udps.is_ok()); + assert_eq!(udps.unwrap(), SdpProtocolValue::UdpTlsRtpSavpf); + let tcps = parse_protocol_token("TCP/tls/rtp/savpf"); + assert!(tcps.is_ok()); + assert_eq!(tcps.unwrap(), SdpProtocolValue::TcpTlsRtpSavpf); + let dtls = parse_protocol_token("dtLs/ScTP"); + assert!(dtls.is_ok()); + assert_eq!(dtls.unwrap(), SdpProtocolValue::DtlsSctp); + let usctp = parse_protocol_token("udp/DTLS/sctp"); + assert!(usctp.is_ok()); + assert_eq!(usctp.unwrap(), SdpProtocolValue::UdpDtlsSctp); + let tsctp = parse_protocol_token("tcp/dtls/SCTP"); + assert!(tsctp.is_ok()); + assert_eq!(tsctp.unwrap(), SdpProtocolValue::TcpDtlsSctp); + + assert!(parse_protocol_token("").is_err()); + assert!(parse_protocol_token("foobar").is_err()); +} + +pub fn parse_media(value: &str) -> Result { + let mv: Vec<&str> = value.split_whitespace().collect(); + if mv.len() < 4 { + return Err(SdpParserInternalError::Generic("media attribute must have at least four tokens" + .to_string())); + } + let media = parse_media_token(mv[0])?; + let mut ptokens = mv[1].split('/'); + let port = match ptokens.next() { + None => return Err(SdpParserInternalError::Generic("missing port token".to_string())), + Some(p) => p.parse::()?, + }; + if port > 65535 { + return Err(SdpParserInternalError::Generic("media port token is too big".to_string())); + } + let port_count = match ptokens.next() { + None => 0, + Some(c) => c.parse::()?, + }; + let proto = parse_protocol_token(mv[2])?; + let fmt_slice: &[&str] = &mv[3..]; + let formats = match media { + SdpMediaValue::Audio | SdpMediaValue::Video => { + let mut fmt_vec: Vec = vec![]; + for num in fmt_slice { + let fmt_num = num.parse::()?; + match fmt_num { + 0 | // PCMU + 8 | // PCMA + 9 | // G722 + 13 | // Comfort Noise + 96 ... 127 => (), // dynamic range + _ => return Err(SdpParserInternalError::Generic( + "format number in media line is out of range".to_string())) + }; + fmt_vec.push(fmt_num); + } + SdpFormatList::Integers(fmt_vec) + } + SdpMediaValue::Application => { + let mut fmt_vec: Vec = vec![]; + // TODO enforce length == 1 and content 'webrtc-datachannel' only? + for token in fmt_slice { + fmt_vec.push(String::from(*token)); + } + SdpFormatList::Strings(fmt_vec) + } + }; + let m = SdpMediaLine { + media, + port, + port_count, + proto, + formats, + }; + println!("media: {}, {}, {}, {}", m.media, m.port, m.proto, m.formats); + Ok(SdpType::Media(m)) +} + +#[test] +fn test_media_works() { + assert!(parse_media("audio 9 UDP/TLS/RTP/SAVPF 109").is_ok()); + assert!(parse_media("video 9 UDP/TLS/RTP/SAVPF 126").is_ok()); + assert!(parse_media("application 9 DTLS/SCTP 5000").is_ok()); + assert!(parse_media("application 9 UDP/DTLS/SCTP webrtc-datachannel").is_ok()); + + assert!(parse_media("audio 9 UDP/TLS/RTP/SAVPF 109 9 0 8").is_ok()); + assert!(parse_media("audio 0 UDP/TLS/RTP/SAVPF 8").is_ok()); + assert!(parse_media("audio 9/2 UDP/TLS/RTP/SAVPF 8").is_ok()); +} + +#[test] +fn test_media_missing_token() { + assert!(parse_media("video 9 UDP/TLS/RTP/SAVPF").is_err()); +} + +#[test] +fn test_media_invalid_port_number() { + assert!(parse_media("video 75123 UDP/TLS/RTP/SAVPF 8").is_err()); +} + +#[test] +fn test_media_invalid_type() { + assert!(parse_media("invalid 9 UDP/TLS/RTP/SAVPF 8").is_err()); +} + +#[test] +fn test_media_invalid_port() { + assert!(parse_media("audio / UDP/TLS/RTP/SAVPF 8").is_err()); +} + +#[test] +fn test_media_invalid_transport() { + assert!(parse_media("audio 9 invalid/invalid 8").is_err()); +} + +#[test] +fn test_media_invalid_payload() { + assert!(parse_media("audio 9 UDP/TLS/RTP/SAVPF 300").is_err()); +} + +pub fn parse_media_vector(lines: &[SdpLine]) -> Result, SdpParserError> { + let mut media_sections: Vec = Vec::new(); + let mut sdp_media = match lines[0].sdp_type { + SdpType::Media(ref v) => SdpMedia::new(v.clone()), + _ => { + return Err(SdpParserError::Sequence { + message: "first line in media section needs to be a media line" + .to_string(), + line_number: lines[0].line_number, + }) + } + }; + for line in lines.iter().skip(1) { + match line.sdp_type { + SdpType::Connection(ref c) => { + sdp_media + .set_connection(c) + .map_err(|e: SdpParserInternalError| { + SdpParserError::Sequence { + message: format!("{}", e), + line_number: line.line_number, + } + })? + } + SdpType::Bandwidth(ref b) => sdp_media.add_bandwidth(b), + SdpType::Attribute(ref a) => { + sdp_media + .add_attribute(a) + .map_err(|e: SdpParserInternalError| { + SdpParserError::Sequence { + message: format!("{}", e), + line_number: line.line_number, + } + })? + } + SdpType::Media(ref v) => { + media_sections.push(sdp_media); + sdp_media = SdpMedia::new(v.clone()); + } + + SdpType::Email(_) | + SdpType::Phone(_) | + SdpType::Origin(_) | + SdpType::Repeat(_) | + SdpType::Session(_) | + SdpType::Timing(_) | + SdpType::Uri(_) | + SdpType::Version(_) | + SdpType::Zone(_) => { + return Err(SdpParserError::Sequence { + message: "invalid type in media section".to_string(), + line_number: line.line_number, + }) + } + + // the line parsers throw unsupported errors for these already + SdpType::Information(_) | + SdpType::Key(_) => (), + }; + } + media_sections.push(sdp_media); + Ok(media_sections) +} +// TODO add unit tests for parse_media_vector diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/network.rs b/media/webrtc/signaling/src/sdp/rsdparsa/src/network.rs new file mode 100644 index 000000000000..2d768bfc995e --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/network.rs @@ -0,0 +1,80 @@ +use std::str::FromStr; +use std::fmt; +use std::net::IpAddr; + +use error::SdpParserInternalError; + +#[derive(Clone,Copy,Debug,PartialEq)] +pub enum SdpAddrType { + IP4 = 4, + IP6 = 6, +} + +impl SdpAddrType { + pub fn same_protocol(&self, addr: &IpAddr) -> bool { + (addr.is_ipv6() && *self == SdpAddrType::IP6) || + (addr.is_ipv4() && *self == SdpAddrType::IP4) + } +} + +impl fmt::Display for SdpAddrType { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let printable = match *self { + SdpAddrType::IP4 => "Ip4", + SdpAddrType::IP6 => "Ip6", + }; + write!(f, "{}", printable) + } +} + +pub fn parse_nettype(value: &str) -> Result<(), SdpParserInternalError> { + if value.to_uppercase() != "IN" { + return Err(SdpParserInternalError::Generic("nettype needs to be IN".to_string())); + }; + Ok(()) +} + +#[test] +fn test_parse_nettype() { + let internet = parse_nettype("iN"); + assert!(internet.is_ok()); + + assert!(parse_nettype("").is_err()); + assert!(parse_nettype("FOO").is_err()); +} + +pub fn parse_addrtype(value: &str) -> Result { + Ok(match value.to_uppercase().as_ref() { + "IP4" => SdpAddrType::IP4, + "IP6" => SdpAddrType::IP6, + _ => { + return Err(SdpParserInternalError::Generic("address type needs to be IP4 or IP6" + .to_string())) + } + }) +} + +#[test] +fn test_parse_addrtype() { + let ip4 = parse_addrtype("iP4"); + assert!(ip4.is_ok()); + assert_eq!(ip4.unwrap(), SdpAddrType::IP4); + let ip6 = parse_addrtype("Ip6"); + assert!(ip6.is_ok()); + assert_eq!(ip6.unwrap(), SdpAddrType::IP6); + + assert!(parse_addrtype("").is_err()); + assert!(parse_addrtype("IP5").is_err()); +} + +pub fn parse_unicast_addr(value: &str) -> Result { + Ok(IpAddr::from_str(value)?) +} + +#[test] +fn test_parse_unicast_addr() { + let ip4 = parse_unicast_addr("127.0.0.1"); + assert!(ip4.is_ok()); + let ip6 = parse_unicast_addr("::1"); + assert!(ip6.is_ok()); +} diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/src/unsupported_types.rs b/media/webrtc/signaling/src/sdp/rsdparsa/src/unsupported_types.rs new file mode 100644 index 000000000000..272224b6af0c --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/src/unsupported_types.rs @@ -0,0 +1,74 @@ +use error::SdpParserInternalError; +use SdpType; + +pub fn parse_repeat(value: &str) -> Result { + // TODO implement this if it's ever needed + Err(SdpParserInternalError::Unsupported(format!("unsupported type repeat: {} ", value))) +} + +#[test] +fn test_repeat_works() { + // FIXME use a proper r value here + assert!(parse_repeat("0 0").is_err()); +} + +pub fn parse_zone(value: &str) -> Result { + // TODO implement this if it's ever needed + Err(SdpParserInternalError::Unsupported(format!("unsupported type zone: {}", value))) +} + +#[test] +fn test_zone_works() { + // FIXME use a proper z value here + assert!(parse_zone("0 0").is_err()); +} + +pub fn parse_key(value: &str) -> Result { + // TODO implement this if it's ever needed + Err(SdpParserInternalError::Unsupported(format!("unsupported type key: {}", value))) +} + +#[test] +fn test_keys_works() { + // FIXME use a proper k value here + assert!(parse_key("12345").is_err()); +} + +pub fn parse_information(value: &str) -> Result { + Err(SdpParserInternalError::Unsupported(format!("unsupported type information: {}", value))) +} + +#[test] +fn test_information_works() { + assert!(parse_information("foobar").is_err()); +} + +pub fn parse_uri(value: &str) -> Result { + // TODO check if this is really a URI + Err(SdpParserInternalError::Unsupported(format!("unsupported type uri: {}", value))) +} + +#[test] +fn test_uri_works() { + assert!(parse_uri("http://www.mozilla.org").is_err()); +} + +pub fn parse_email(value: &str) -> Result { + // TODO check if this is really an email address + Err(SdpParserInternalError::Unsupported(format!("unsupported type email: {}", value))) +} + +#[test] +fn test_email_works() { + assert!(parse_email("nils@mozilla.com").is_err()); +} + +pub fn parse_phone(value: &str) -> Result { + // TODO check if this is really a phone number + Err(SdpParserInternalError::Unsupported(format!("unsupported type phone: {}", value))) +} + +#[test] +fn test_phone_works() { + assert!(parse_phone("+123456789").is_err()); +} diff --git a/media/webrtc/signaling/src/sdp/rsdparsa/tests/unit_tests.rs b/media/webrtc/signaling/src/sdp/rsdparsa/tests/unit_tests.rs new file mode 100644 index 000000000000..b1a6d65e1941 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa/tests/unit_tests.rs @@ -0,0 +1,423 @@ +extern crate rsdparsa; + +#[test] +fn parse_minimal_sdp() { + let sdp = "v=0\r\n +o=- 0 0 IN IP4 0.0.0.0\r\n +s=-\r\n +t=0 0\r\n +m=audio 0 UDP/TLS/RTP/SAVPF 0\r\n"; + let sdp_res = rsdparsa::parse_sdp(sdp, true); + assert!(sdp_res.is_ok()); + let sdp_opt = sdp_res.ok(); + assert!(sdp_opt.is_some()); + let sdp = sdp_opt.unwrap(); + assert_eq!(sdp.version, 0); + assert_eq!(sdp.session, "-"); + assert!(sdp.connection.is_none()); + assert_eq!(sdp.attribute.len(), 0); + assert_eq!(sdp.media.len(), 1); + + let msection = &(sdp.media[0]); + assert_eq!(*msection.get_type(), + rsdparsa::media_type::SdpMediaValue::Audio); + assert_eq!(msection.get_port(), 0); + assert_eq!(*msection.get_proto(), + rsdparsa::media_type::SdpProtocolValue::UdpTlsRtpSavpf); + assert!(!msection.has_attributes()); + assert!(!msection.has_bandwidth()); + assert!(!msection.has_connection()); + assert!(msection.get_connection().is_none()); +} + +#[test] +fn parse_minimal_sdp_with_emtpy_lines() { + let sdp = "v=0\r\n +\r\n +o=- 0 0 IN IP4 0.0.0.0\r\n + \r\n +s=-\r\n +t=0 0\r\n +m=audio 0 UDP/TLS/RTP/SAVPF 0\r\n"; + let sdp_res = rsdparsa::parse_sdp(sdp, false); + assert!(sdp_res.is_ok()); + let sdp_opt = sdp_res.ok(); + assert!(sdp_opt.is_some()); + let sdp = sdp_opt.unwrap(); + assert_eq!(sdp.version, 0); + assert_eq!(sdp.session, "-"); +} + +#[test] +fn parse_minimal_sdp_with_most_session_types() { + let sdp = "v=0\r\n +o=- 0 0 IN IP4 0.0.0.0\r\n +s=-\r\n +t=0 0\r\n +b=AS:1\r\n +b=CT:123\r\n +b=TIAS:12345\r\n +c=IN IP4 0.0.0.0\r\n +a=ice-options:trickle\r\n +m=audio 0 UDP/TLS/RTP/SAVPF 0\r\n"; + let sdp_res = rsdparsa::parse_sdp(sdp, false); + assert!(sdp_res.is_ok()); + let sdp_opt = sdp_res.ok(); + assert!(sdp_opt.is_some()); + let sdp = sdp_opt.unwrap(); + assert_eq!(sdp.version, 0); + assert_eq!(sdp.session, "-"); + assert!(sdp.get_connection().is_some()); +} + +#[test] +fn parse_firefox_audio_offer() { + let sdp = "v=0\r\n +o=mozilla...THIS_IS_SDPARTA-52.0a1 506705521068071134 0 IN IP4 0.0.0.0\r\n +s=-\r\n +t=0 0\r\n +a=fingerprint:sha-256 CD:34:D1:62:16:95:7B:B7:EB:74:E2:39:27:97:EB:0B:23:73:AC:BC:BF:2F:E3:91:CB:57:A9:9D:4A:A2:0B:40\r\n +a=group:BUNDLE sdparta_0\r\n +a=ice-options:trickle\r\n +a=msid-semantic:WMS *\r\n +m=audio 9 UDP/TLS/RTP/SAVPF 109 9 0 8\r\n +c=IN IP4 0.0.0.0\r\n +a=sendrecv\r\n +a=extmap:1/sendonly urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\n +a=fmtp:109 maxplaybackrate=48000;stereo=1;useinbandfec=1\r\n +a=ice-pwd:e3baa26dd2fa5030d881d385f1e36cce\r\n +a=ice-ufrag:58b99ead\r\n +a=mid:sdparta_0\r\n +a=msid:{5a990edd-0568-ac40-8d97-310fc33f3411} {218cfa1c-617d-2249-9997-60929ce4c405}\r\n +a=rtcp-mux\r\n +a=rtpmap:109 opus/48000/2\r\n +a=rtpmap:9 G722/8000/1\r\n +a=rtpmap:0 PCMU/8000\r\n +a=rtpmap:8 PCMA/8000\r\n +a=setup:actpass\r\n +a=ssrc:2655508255 cname:{735484ea-4f6c-f74a-bd66-7425f8476c2e}\r\n"; + let sdp_res = rsdparsa::parse_sdp(sdp, true); + assert!(sdp_res.is_ok()); + let sdp_opt = sdp_res.ok(); + assert!(sdp_opt.is_some()); + let sdp = sdp_opt.unwrap(); + assert_eq!(sdp.version, 0); + assert_eq!(sdp.media.len(), 1); + + let msection = &(sdp.media[0]); + assert_eq!(*msection.get_type(), + rsdparsa::media_type::SdpMediaValue::Audio); + assert_eq!(msection.get_port(), 9); + assert_eq!(*msection.get_proto(), + rsdparsa::media_type::SdpProtocolValue::UdpTlsRtpSavpf); + assert!(msection.has_attributes()); + assert!(msection.has_connection()); + assert!(msection.get_connection().is_some()); + assert!(!msection.has_bandwidth()); +} + +#[test] +fn parse_firefox_video_offer() { + let sdp = "v=0\r\n +o=mozilla...THIS_IS_SDPARTA-52.0a1 506705521068071134 0 IN IP4 0.0.0.0\r\n +s=-\r\n +t=0 0\r\n +a=fingerprint:sha-256 CD:34:D1:62:16:95:7B:B7:EB:74:E2:39:27:97:EB:0B:23:73:AC:BC:BF:2F:E3:91:CB:57:A9:9D:4A:A2:0B:40\r\n +a=group:BUNDLE sdparta_2\r\n +a=ice-options:trickle\r\n +a=msid-semantic:WMS *\r\n +m=video 9 UDP/TLS/RTP/SAVPF 126 120 97\r\n +c=IN IP4 0.0.0.0\r\n +a=recvonly\r\n +a=fmtp:126 profile-level-id=42e01f;level-asymmetry-allowed=1;packetization-mode=1\r\n +a=fmtp:120 max-fs=12288;max-fr=60\r\n +a=fmtp:97 profile-level-id=42e01f;level-asymmetry-allowed=1\r\n +a=ice-pwd:e3baa26dd2fa5030d881d385f1e36cce\r\n +a=ice-ufrag:58b99ead\r\n +a=mid:sdparta_2\r\n +a=rtcp-fb:126 nack\r\n +a=rtcp-fb:126 nack pli\r\n +a=rtcp-fb:126 ccm fir\r\n +a=rtcp-fb:126 goog-remb\r\n +a=rtcp-fb:120 nack\r\n +a=rtcp-fb:120 nack pli\r\n +a=rtcp-fb:120 ccm fir\r\n +a=rtcp-fb:120 goog-remb\r\n +a=rtcp-fb:97 nack\r\n +a=rtcp-fb:97 nack pli\r\n +a=rtcp-fb:97 ccm fir\r\n +a=rtcp-fb:97 goog-remb\r\n +a=rtcp-mux\r\n +a=rtpmap:126 H264/90000\r\n +a=rtpmap:120 VP8/90000\r\n +a=rtpmap:97 H264/90000\r\n +a=setup:actpass\r\n +a=ssrc:2709871439 cname:{735484ea-4f6c-f74a-bd66-7425f8476c2e}"; + let sdp_res = rsdparsa::parse_sdp(sdp, true); + assert!(sdp_res.is_ok()); + let sdp_opt = sdp_res.ok(); + assert!(sdp_opt.is_some()); + let sdp = sdp_opt.unwrap(); + assert_eq!(sdp.version, 0); + assert_eq!(sdp.media.len(), 1); + + let msection = &(sdp.media[0]); + assert_eq!(*msection.get_type(), + rsdparsa::media_type::SdpMediaValue::Video); + assert_eq!(msection.get_port(), 9); + assert_eq!(*msection.get_proto(), + rsdparsa::media_type::SdpProtocolValue::UdpTlsRtpSavpf); +} + +#[test] +fn parse_firefox_datachannel_offer() { + let sdp = "v=0\r\n +o=mozilla...THIS_IS_SDPARTA-52.0a2 3327975756663609975 0 IN IP4 0.0.0.0\r\n +s=-\r\n +t=0 0\r\n +a=sendrecv\r\n +a=fingerprint:sha-256 AC:72:CB:D6:1E:A3:A3:B0:E7:97:77:25:03:4B:5B:FF:19:6C:02:C6:93:7D:EB:5C:81:6F:36:D9:02:32:F8:23\r\n +a=ice-options:trickle\r\n +a=msid-semantic:WMS *\r\n +m=application 49760 DTLS/SCTP 5000\r\n +c=IN IP4 172.16.156.106\r\n +a=candidate:0 1 UDP 2122252543 172.16.156.106 49760 typ host\r\n +a=sendrecv\r\n +a=end-of-candidates\r\n +a=ice-pwd:24f485c580129b36447b65df77429a82\r\n +a=ice-ufrag:4cba30fe\r\n +a=mid:sdparta_0\r\n +a=sctpmap:5000 webrtc-datachannel 256\r\n +a=setup:active\r\n +a=ssrc:3376683177 cname:{62f78ee0-620f-a043-86ca-b69f189f1aea}\r\n"; + let sdp_res = rsdparsa::parse_sdp(sdp, true); + assert!(sdp_res.is_ok()); + let sdp_opt = sdp_res.ok(); + assert!(sdp_opt.is_some()); + let sdp = sdp_opt.unwrap(); + assert_eq!(sdp.version, 0); + assert_eq!(sdp.media.len(), 1); + + let msection = &(sdp.media[0]); + assert_eq!(*msection.get_type(), + rsdparsa::media_type::SdpMediaValue::Application); + assert_eq!(msection.get_port(), 49760); + assert_eq!(*msection.get_proto(), + rsdparsa::media_type::SdpProtocolValue::DtlsSctp); +} + +#[test] +fn parse_chrome_audio_video_offer() { + let sdp = "v=0\r\n +o=- 3836772544440436510 2 IN IP4 127.0.0.1\r\n +s=-\r\n +t=0 0\r\n +a=group:BUNDLE audio video\r\n +a=msid-semantic: WMS HWpbmTmXleVSnlssQd80bPuw9cxQFroDkkBP\r\n +m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 126\r\n +c=IN IP4 0.0.0.0\r\n +a=rtcp:9 IN IP4 0.0.0.0\r\n +a=ice-ufrag:A4by\r\n +a=ice-pwd:Gfvb2rbYMiW0dZz8ZkEsXICs\r\n +a=fingerprint:sha-256 15:B0:92:1F:C7:40:EE:22:A6:AF:26:EF:EA:FF:37:1D:B3:EF:11:0B:8B:73:4F:01:7D:C9:AE:26:4F:87:E0:95\r\n +a=setup:actpass\r\n +a=mid:audio\r\n +a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\n +a=sendrecv\r\n +a=rtcp-mux\r\n +a=rtpmap:111 opus/48000/2\r\n +a=rtcp-fb:111 transport-cc\r\n +a=fmtp:111 minptime=10;useinbandfec=1\r\n +a=rtpmap:103 ISAC/16000\r\n +a=rtpmap:104 ISAC/32000\r\n +a=rtpmap:9 G722/8000\r\n +a=rtpmap:0 PCMU/8000\r\n +a=rtpmap:8 PCMA/8000\r\n +a=rtpmap:106 CN/32000\r\n +a=rtpmap:105 CN/16000\r\n +a=rtpmap:13 CN/8000\r\n +a=rtpmap:126 telephone-event/8000\r\n +a=ssrc:162559313 cname:qPTZ+BI+42mgbOi+\r\n +a=ssrc:162559313 msid:HWpbmTmXleVSnlssQd80bPuw9cxQFroDkkBP f6188af5-d8d6-462c-9c75-f12bc41fe322\r\n +a=ssrc:162559313 mslabel:HWpbmTmXleVSnlssQd80bPuw9cxQFroDkkBP\r\n +a=ssrc:162559313 label:f6188af5-d8d6-462c-9c75-f12bc41fe322\r\n +m=video 9 UDP/TLS/RTP/SAVPF 100 101 107 116 117 96 97 99 98\r\n +c=IN IP4 0.0.0.0\r\n +a=rtcp:9 IN IP4 0.0.0.0\r\n +a=ice-ufrag:A4by\r\n +a=ice-pwd:Gfvb2rbYMiW0dZz8ZkEsXICs\r\n +a=fingerprint:sha-256 15:B0:92:1F:C7:40:EE:22:A6:AF:26:EF:EA:FF:37:1D:B3:EF:11:0B:8B:73:4F:01:7D:C9:AE:26:4F:87:E0:95\r\n +a=setup:actpass\r\n +a=mid:video\r\n +a=extmap:2 urn:ietf:params:rtp-hdrext:toffset\r\n +a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\n +a=extmap:4 urn:3gpp:video-orientation\r\n +a=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\n +a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay\r\n +a=sendrecv\r\n +a=rtcp-mux\r\n +a=rtcp-rsize\r\n +a=rtpmap:100 VP8/90000\r\n +a=rtcp-fb:100 ccm fir\r\n +a=rtcp-fb:100 nack\r\n +a=rtcp-fb:100 nack pli\r\n +a=rtcp-fb:100 goog-remb\r\n +a=rtcp-fb:100 transport-cc\r\n +a=rtpmap:101 VP9/90000\r\n +a=rtcp-fb:101 ccm fir\r\n +a=rtcp-fb:101 nack\r\n +a=rtcp-fb:101 nack pli\r\n +a=rtcp-fb:101 goog-remb\r\n +a=rtcp-fb:101 transport-cc\r\n +a=rtpmap:107 H264/90000\r\n +a=rtcp-fb:107 ccm fir\r\n +a=rtcp-fb:107 nack\r\n +a=rtcp-fb:107 nack pli\r\n +a=rtcp-fb:107 goog-remb\r\n +a=rtcp-fb:107 transport-cc\r\n +a=fmtp:107 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f\r\n +a=rtpmap:116 red/90000\r\n +a=rtpmap:117 ulpfec/90000\r\n +a=rtpmap:96 rtx/90000\r\n +a=fmtp:96 apt=100\r\n +a=rtpmap:97 rtx/90000\r\n +a=fmtp:97 apt=101\r\n +a=rtpmap:99 rtx/90000\r\n +a=fmtp:99 apt=107\r\n +a=rtpmap:98 rtx/90000\r\n +a=fmtp:98 apt=116\r\n +a=ssrc-group:FID 3156517279 2673335628\r\n +a=ssrc:3156517279 cname:qPTZ+BI+42mgbOi+\r\n +a=ssrc:3156517279 msid:HWpbmTmXleVSnlssQd80bPuw9cxQFroDkkBP b6ec5178-c611-403f-bbec-3833ed547c09\r\n +a=ssrc:3156517279 mslabel:HWpbmTmXleVSnlssQd80bPuw9cxQFroDkkBP\r\n +a=ssrc:3156517279 label:b6ec5178-c611-403f-bbec-3833ed547c09\r\n +a=ssrc:2673335628 cname:qPTZ+BI+42mgbOi+\r\n +a=ssrc:2673335628 msid:HWpbmTmXleVSnlssQd80bPuw9cxQFroDkkBP b6ec5178-c611-403f-bbec-3833ed547c09\r\n +a=ssrc:2673335628 mslabel:HWpbmTmXleVSnlssQd80bPuw9cxQFroDkkBP\r\n +a=ssrc:2673335628 label:b6ec5178-c611-403f-bbec-3833ed547c09\r\n"; + let sdp_res = rsdparsa::parse_sdp(sdp, true); + assert!(sdp_res.is_ok()); + let sdp_opt = sdp_res.ok(); + assert!(sdp_opt.is_some()); + let sdp = sdp_opt.unwrap(); + assert_eq!(sdp.version, 0); + assert_eq!(sdp.media.len(), 2); + + let msection1 = &(sdp.media[0]); + assert_eq!(*msection1.get_type(), + rsdparsa::media_type::SdpMediaValue::Audio); + assert_eq!(msection1.get_port(), 9); + assert_eq!(*msection1.get_proto(), + rsdparsa::media_type::SdpProtocolValue::UdpTlsRtpSavpf); + assert!(msection1.has_attributes()); + assert!(msection1.has_connection()); + assert!(!msection1.has_bandwidth()); + + let msection2 = &(sdp.media[1]); + assert_eq!(*msection2.get_type(), + rsdparsa::media_type::SdpMediaValue::Video); + assert_eq!(msection2.get_port(), 9); + assert_eq!(*msection2.get_proto(), + rsdparsa::media_type::SdpProtocolValue::UdpTlsRtpSavpf); + assert!(msection2.has_attributes()); + assert!(msection2.has_connection()); + assert!(!msection2.has_bandwidth()); +} + +#[test] +fn parse_firefox_simulcast_offer() { + let sdp = "v=0\r\n +o=mozilla...THIS_IS_SDPARTA-55.0a1 983028567300715536 0 IN IP4 0.0.0.0\r\n +s=-\r\n +t=0 0\r\n +a=fingerprint:sha-256 68:42:13:88:B6:C1:7D:18:79:07:8A:C6:DC:28:D6:DC:DD:E3:C9:41:E7:80:A7:FE:02:65:FB:76:A0:CD:58:ED\r\n +a=ice-options:trickle\r\n +a=msid-semantic:WMS *\r\n +m=video 9 UDP/TLS/RTP/SAVPF 120 121 126 97\r\n +c=IN IP4 0.0.0.0\r\n +a=sendrecv\r\n +a=extmap:1 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\n +a=extmap:2 urn:ietf:params:rtp-hdrext:toffset\r\n +a=extmap:3/sendonly urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id\r\n +a=fmtp:126 profile-level-id=42e01f;level-asymmetry-allowed=1;packetization-mode=1\r\n +a=fmtp:97 profile-level-id=42e01f;level-asymmetry-allowed=1\r\n +a=fmtp:120 max-fs=12288;max-fr=60\r\n +a=fmtp:121 max-fs=12288;max-fr=60\r\n +a=ice-pwd:4af388405d558b91f5ba6c2c48f161bf\r\n +a=ice-ufrag:ce1ac488\r\n +a=mid:sdparta_0\r\n +a=msid:{fb6d1fa3-d993-f244-a0fe-d9fb99214c23} {8be9a0f7-9272-6c42-90f3-985d55bd8de5}\r\n +a=rid:foo send\r\n +a=rid:bar send\r\n +a=rtcp-fb:120 nack\r\n +a=rtcp-fb:120 nack pli\r\n +a=rtcp-fb:120 ccm fir\r\n +a=rtcp-fb:120 goog-remb\r\n +a=rtcp-fb:121 nack\r\n +a=rtcp-fb:121 nack pli\r\n +a=rtcp-fb:121 ccm fir\r\n +a=rtcp-fb:121 goog-remb\r\n +a=rtcp-fb:126 nack\r\n +a=rtcp-fb:126 nack pli\r\n +a=rtcp-fb:126 ccm fir\r\n +a=rtcp-fb:126 goog-remb\r\n +a=rtcp-fb:97 nack\r\n +a=rtcp-fb:97 nack pli\r\n +a=rtcp-fb:97 ccm fir\r\n +a=rtcp-fb:97 goog-remb\r\n +a=rtcp-mux\r\n +a=rtpmap:120 VP8/90000\r\n +a=rtpmap:121 VP9/90000\r\n +a=rtpmap:126 H264/90000\r\n +a=rtpmap:97 H264/90000\r\n +a=setup:actpass\r\n +a=simulcast: send rid=foo;bar\r\n +a=ssrc:2988475468 cname:{77067f00-2e8d-8b4c-8992-cfe338f56851}\r\n +a=ssrc:1649784806 cname:{77067f00-2e8d-8b4c-8992-cfe338f56851}\r\n"; + let sdp_res = rsdparsa::parse_sdp(sdp, true); + assert!(sdp_res.is_ok()); + let sdp_opt = sdp_res.ok(); + assert!(sdp_opt.is_some()); + let sdp = sdp_opt.unwrap(); + assert_eq!(sdp.version, 0); + assert_eq!(sdp.media.len(), 1); +} + +#[test] +fn parse_firefox_simulcast_answer() { + let sdp = "v=0\r\n +o=mozilla...THIS_IS_SDPARTA-55.0a1 7548296603161351381 0 IN IP4 0.0.0.0\r\n +s=-\r\n +t=0 0\r\n +a=fingerprint:sha-256 B1:47:49:4F:7D:83:03:BE:E9:FC:73:A3:FB:33:38:40:0B:3B:6A:56:78:EB:EE:D5:6D:2D:D5:3A:B6:13:97:E7\r\n +a=ice-options:trickle\r\n +a=msid-semantic:WMS *\r\n +m=video 9 UDP/TLS/RTP/SAVPF 120\r\n +c=IN IP4 0.0.0.0\r\n +a=recvonly\r\n +a=extmap:1 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\n +a=extmap:2 urn:ietf:params:rtp-hdrext:toffset\r\n +a=fmtp:120 max-fs=12288;max-fr=60\r\n +a=ice-pwd:c886e2caf2ae397446312930cd1afe51\r\n +a=ice-ufrag:f57396c0\r\n +a=mid:sdparta_0\r\n +a=rtcp-fb:120 nack\r\n +a=rtcp-fb:120 nack pli\r\n +a=rtcp-fb:120 ccm fir\r\n +a=rtcp-fb:120 goog-remb\r\n +a=rtcp-mux\r\n +a=rtpmap:120 VP8/90000\r\n +a=setup:active\r\n +a=ssrc:2564157021 cname:{cae1cd32-7433-5b48-8dc8-8e3f8b2f96cd}\r\n +a=simulcast: recv rid=foo;bar\r\n +a=rid:foo recv\r\n +a=rid:bar recv\r\n +a=extmap:3/recvonly urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id\r\n"; + let sdp_res = rsdparsa::parse_sdp(sdp, true); + assert!(sdp_res.is_ok()); + let sdp_opt = sdp_res.ok(); + assert!(sdp_opt.is_some()); + let sdp = sdp_opt.unwrap(); + assert_eq!(sdp.version, 0); + assert_eq!(sdp.media.len(), 1); +} diff --git a/media/webrtc/signaling/src/sdp/rsdparsa_capi/Cargo.toml b/media/webrtc/signaling/src/sdp/rsdparsa_capi/Cargo.toml new file mode 100644 index 000000000000..9e531cc87490 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa_capi/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "rsdparsa_capi" +version = "0.1.0" +authors = ["Paul Ellenbogen ", + "Nils Ohlmeier "] + +[dependencies] +libc = "^0.2.0" +log = "^0.3" +rsdparsa = {version = "0.1.0", path = "../rsdparsa"} +nserror = { path = "../../../../../../xpcom/rust/nserror" } diff --git a/media/webrtc/signaling/src/sdp/rsdparsa_capi/src/attribute.rs b/media/webrtc/signaling/src/sdp/rsdparsa_capi/src/attribute.rs new file mode 100644 index 000000000000..e12912725745 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa_capi/src/attribute.rs @@ -0,0 +1,753 @@ +use std::slice; +use libc::{size_t, uint8_t, uint16_t, uint32_t, int64_t}; + +use rsdparsa::SdpSession; +use rsdparsa::attribute_type::{SdpAttribute, SdpAttributeFingerprint, SdpAttributeSetup, SdpAttributeSsrc, SdpAttributeRtpmap, SdpAttributeMsid, SdpAttributeMsidSemantic, SdpAttributeGroupSemantic, SdpAttributeGroup, SdpAttributeRtcp, SdpAttributeSctpmap, SdpAttributeRemoteCandidate, SdpAttributeExtmap, SdpAttributeDirection}; +use nserror::{nsresult, NS_OK, NS_ERROR_INVALID_ARG}; + +use types::StringView; +use network::RustIpAddr; + +#[repr(C)] +#[derive(Clone, Copy, PartialEq, Eq)] +pub enum RustSdpAttributeType { + BundleOnly, + Candidate, + EndOfCandidates, + Extmap, + Fingerprint, + Fmtp, + Group, + IceLite, + IceMismatch, + IceOptions, + IcePwd, + IceUfrag, + Identity, + ImageAttr, + Inactive, + Label, + MaxMessageSize, + MaxPtime, + Mid, + Msid, + MsidSemantic, + Ptime, + Rid, + Recvonly, + RemoteCandidate, + Rtpmap, + Rtcp, + Rtcpfb, + RtcpMux, + RtcpRsize, + Sctpmap, + SctpPort, + Sendonly, + Sendrecv, + Setup, + Simulcast, + Ssrc, + SsrcGroup, +} + +impl<'a> From<&'a SdpAttribute> for RustSdpAttributeType { + fn from(other: &SdpAttribute) -> Self { + match *other { + SdpAttribute::BundleOnly{..} => RustSdpAttributeType::BundleOnly, + SdpAttribute::Candidate{..} => RustSdpAttributeType::Candidate, + SdpAttribute::EndOfCandidates{..} => RustSdpAttributeType::EndOfCandidates, + SdpAttribute::Extmap{..} => RustSdpAttributeType::Extmap, + SdpAttribute::Fingerprint{..} => RustSdpAttributeType::Fingerprint, + SdpAttribute::Fmtp{..} => RustSdpAttributeType::Fmtp, + SdpAttribute::Group{..} => RustSdpAttributeType::Group, + SdpAttribute::IceLite{..} => RustSdpAttributeType::IceLite, + SdpAttribute::IceMismatch{..} => RustSdpAttributeType::IceMismatch, + SdpAttribute::IceOptions{..} => RustSdpAttributeType::IceOptions, + SdpAttribute::IcePwd{..} => RustSdpAttributeType::IcePwd, + SdpAttribute::IceUfrag{..} => RustSdpAttributeType::IceUfrag, + SdpAttribute::Identity{..} => RustSdpAttributeType::Identity, + SdpAttribute::ImageAttr{..} => RustSdpAttributeType::ImageAttr, + SdpAttribute::Inactive{..} => RustSdpAttributeType::Inactive, + SdpAttribute::Label{..} => RustSdpAttributeType::Label, + SdpAttribute::MaxMessageSize{..} => RustSdpAttributeType::MaxMessageSize, + SdpAttribute::MaxPtime{..} => RustSdpAttributeType::MaxPtime, + SdpAttribute::Mid{..} => RustSdpAttributeType::Mid, + SdpAttribute::Msid{..} => RustSdpAttributeType::Msid, + SdpAttribute::MsidSemantic{..} => RustSdpAttributeType::MsidSemantic, + SdpAttribute::Ptime{..} => RustSdpAttributeType::Ptime, + SdpAttribute::Rid{..} => RustSdpAttributeType::Rid, + SdpAttribute::Recvonly{..} => RustSdpAttributeType::Recvonly, + SdpAttribute::RemoteCandidate{..} => RustSdpAttributeType::RemoteCandidate, + SdpAttribute::Rtcp{..} => RustSdpAttributeType::Rtcp, + SdpAttribute::Rtcpfb{..} => RustSdpAttributeType::Rtcpfb, + SdpAttribute::RtcpMux{..} => RustSdpAttributeType::RtcpMux, + SdpAttribute::RtcpRsize{..} => RustSdpAttributeType::RtcpRsize, + SdpAttribute::Rtpmap{..} => RustSdpAttributeType::Rtpmap, + SdpAttribute::Sctpmap{..} => RustSdpAttributeType::Sctpmap, + SdpAttribute::SctpPort{..} => RustSdpAttributeType::SctpPort, + SdpAttribute::Sendonly{..} => RustSdpAttributeType::Sendonly, + SdpAttribute::Sendrecv{..} => RustSdpAttributeType::Sendrecv, + SdpAttribute::Setup{..} => RustSdpAttributeType::Setup, + SdpAttribute::Simulcast{..} => RustSdpAttributeType::Simulcast, + SdpAttribute::Ssrc{..} => RustSdpAttributeType::Ssrc, + SdpAttribute::SsrcGroup{..} => RustSdpAttributeType::SsrcGroup + } + } +} + +#[no_mangle] +pub unsafe extern "C" fn num_attributes(session: *const SdpSession) -> u32 { + (*session).attribute.len() as u32 +} + +#[no_mangle] +pub unsafe extern "C" fn get_attribute_ptr(session: *const SdpSession, + index: u32, + ret: *mut *const SdpAttribute) -> nsresult { + match (*session).attribute.get(index as usize) { + Some(attribute) => { + *ret = attribute as *const SdpAttribute; + NS_OK + }, + None => NS_ERROR_INVALID_ARG + } +} + +fn count_attribute(attributes: &[SdpAttribute], search: RustSdpAttributeType) -> usize { + let mut count = 0; + for attribute in (*attributes).iter() { + if RustSdpAttributeType::from(attribute) == search { + count += 1; + } + } + count +} + +fn argsearch(attributes: &[SdpAttribute], attribute_type: RustSdpAttributeType) -> Option { + for (i, attribute) in (*attributes).iter().enumerate() { + if RustSdpAttributeType::from(attribute) == attribute_type { + return Some(i); + } + } + None +} + +pub unsafe fn has_attribute(attributes: *const Vec, attribute_type: RustSdpAttributeType) -> bool { + argsearch((*attributes).as_slice(), attribute_type).is_some() +} + +fn get_attribute(attributes: &[SdpAttribute], attribute_type: RustSdpAttributeType) -> Option<&SdpAttribute> { + argsearch(attributes, attribute_type).map(|i| &attributes[i]) +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_iceufrag(attributes: *const Vec, ret: *mut StringView) -> nsresult { + let attr = get_attribute((*attributes).as_slice(), RustSdpAttributeType::IceUfrag); + if let Some(&SdpAttribute::IceUfrag(ref string)) = attr { + *ret = StringView::from(string.as_str()); + return NS_OK; + } + NS_ERROR_INVALID_ARG +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_icepwd(attributes: *const Vec, ret: *mut StringView) -> nsresult { + let attr = get_attribute((*attributes).as_slice(), RustSdpAttributeType::IcePwd); + if let Some(&SdpAttribute::IcePwd(ref string)) = attr { + *ret = StringView::from(string.as_str()); + return NS_OK; + } + NS_ERROR_INVALID_ARG +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_identity(attributes: *const Vec, ret: *mut StringView) -> nsresult { + let attr = get_attribute((*attributes).as_slice(), RustSdpAttributeType::Identity); + if let Some(&SdpAttribute::Identity(ref string)) = attr { + *ret = StringView::from(string.as_str()); + return NS_OK; + } + NS_ERROR_INVALID_ARG +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_iceoptions(attributes: *const Vec, ret: *mut *const Vec) -> nsresult { + let attr = get_attribute((*attributes).as_slice(), RustSdpAttributeType::IceOptions); + if let Some(&SdpAttribute::IceOptions(ref options)) = attr { + *ret = options; + return NS_OK; + } + NS_ERROR_INVALID_ARG +} + +#[repr(C)] +#[derive(Clone, Copy)] +pub struct RustSdpAttributeFingerprint { + hash_algorithm: StringView, + fingerprint: StringView +} + +impl<'a> From<&'a SdpAttributeFingerprint> for RustSdpAttributeFingerprint { + fn from(other: &SdpAttributeFingerprint) -> Self { + RustSdpAttributeFingerprint { + hash_algorithm: StringView::from(other.hash_algorithm.as_str()), + fingerprint: StringView::from(other.fingerprint.as_str()) + } + } +} + + + + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_fingerprint_count(attributes: *const Vec) -> size_t { + count_attribute((*attributes).as_slice(), RustSdpAttributeType::Fingerprint) +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_fingerprints(attributes: *const Vec, ret_size: size_t, ret_fingerprints: *mut RustSdpAttributeFingerprint) { + let attrs: Vec<_> = (*attributes).iter().filter_map(|x| if let SdpAttribute::Fingerprint(ref data) = *x { + Some(RustSdpAttributeFingerprint::from(data)) + } else { + None + }).collect(); + let fingerprints = slice::from_raw_parts_mut(ret_fingerprints, ret_size); + fingerprints.copy_from_slice(attrs.as_slice()); +} + +#[repr(C)] +#[derive(Clone)] +pub enum RustSdpAttributeSetup { + Active, + Actpass, + Holdconn, + Passive, +} + +impl<'a> From<&'a SdpAttributeSetup> for RustSdpAttributeSetup { + fn from(other: &SdpAttributeSetup) -> Self { + match *other { + SdpAttributeSetup::Active => RustSdpAttributeSetup::Active, + SdpAttributeSetup::Actpass => RustSdpAttributeSetup::Actpass, + SdpAttributeSetup::Holdconn => RustSdpAttributeSetup::Holdconn, + SdpAttributeSetup::Passive => RustSdpAttributeSetup::Passive + } + } +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_setup(attributes: *const Vec, ret: *mut RustSdpAttributeSetup) -> nsresult { + let attr = get_attribute((*attributes).as_slice(), RustSdpAttributeType::Setup); + if let Some(&SdpAttribute::Setup(ref setup)) = attr { + *ret = RustSdpAttributeSetup::from(setup); + return NS_OK; + } + NS_ERROR_INVALID_ARG +} + +#[repr(C)] +#[derive(Clone, Copy)] +pub struct RustSdpAttributeSsrc { + pub id: uint32_t, + pub attribute: StringView, + pub value: StringView, +} + +impl<'a> From<&'a SdpAttributeSsrc> for RustSdpAttributeSsrc { + fn from(other: &SdpAttributeSsrc) -> Self { + RustSdpAttributeSsrc { + id: other.id, + attribute: StringView::from(&other.attribute), + value: StringView::from(&other.value) + } + } +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_ssrc_count(attributes: *const Vec) -> size_t { + count_attribute((*attributes).as_slice(), RustSdpAttributeType::Ssrc) +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_ssrcs(attributes: *const Vec, ret_size: size_t, ret_ssrcs: *mut RustSdpAttributeSsrc) { + let attrs: Vec<_> = (*attributes).iter().filter_map(|x| if let SdpAttribute::Ssrc(ref data) = *x { + Some(RustSdpAttributeSsrc::from(data)) + } else { + None + }).collect(); + let ssrcs = slice::from_raw_parts_mut(ret_ssrcs, ret_size); + ssrcs.copy_from_slice(attrs.as_slice()); +} + +#[repr(C)] +#[derive(Clone, Copy)] +pub struct RustSdpAttributeRtpmap { + pub payload_type: uint8_t, + pub codec_name: StringView, + pub frequency: uint32_t, + pub channels: uint32_t, +} + +impl<'a> From<&'a SdpAttributeRtpmap> for RustSdpAttributeRtpmap { + fn from(other: &SdpAttributeRtpmap) -> Self { + RustSdpAttributeRtpmap { + payload_type: other.payload_type as uint8_t, + codec_name: StringView::from(other.codec_name.as_str()), + frequency: other.frequency as uint32_t, + channels: other.channels.unwrap_or(1) + } + } +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_rtpmap_count(attributes: *const Vec) -> size_t { + count_attribute((*attributes).as_slice(), RustSdpAttributeType::Rtpmap) +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_rtpmaps(attributes: *const Vec, ret_size: size_t, ret_rtpmaps: *mut RustSdpAttributeRtpmap) { + let attrs: Vec<_> = (*attributes).iter().filter_map(|x| if let SdpAttribute::Rtpmap(ref data) = *x { + Some(RustSdpAttributeRtpmap::from(data)) + } else { + None + }).collect(); + let rtpmaps = slice::from_raw_parts_mut(ret_rtpmaps, ret_size); + rtpmaps.copy_from_slice(attrs.as_slice()); +} + +#[repr(C)] +#[derive(Clone, Copy)] +pub struct RustSdpAttributeFmtp { + pub payload_type: uint8_t, + pub codec_name: StringView, + pub tokens: *const Vec, +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_fmtp_count(attributes: *const Vec) -> size_t { + count_attribute((*attributes).as_slice(), RustSdpAttributeType::Fmtp) +} + +fn find_payload_type(attributes: &[SdpAttribute], payload_type: u8) -> Option<&SdpAttributeRtpmap> { + attributes.iter().filter_map(|x| if let SdpAttribute::Rtpmap(ref data) = *x { + if data.payload_type == payload_type { + Some(data) + } else { + None + } + } else { + None + }).next() +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_fmtp(attributes: *const Vec, ret_size: size_t, ret_fmtp: *mut RustSdpAttributeFmtp) -> size_t { + let fmtps = (*attributes).iter().filter_map(|x| if let SdpAttribute::Fmtp(ref data) = *x { + Some(data) + } else { + None + }); + let mut rust_fmtps = Vec::new(); + for fmtp in fmtps { + if let Some(rtpmap) = find_payload_type((*attributes).as_slice(), fmtp.payload_type) { + rust_fmtps.push( RustSdpAttributeFmtp{ + payload_type: fmtp.payload_type as u8, + codec_name: StringView::from(rtpmap.codec_name.as_str()), + tokens: &fmtp.tokens + } + ); + } + } + let fmtps = if ret_size <= rust_fmtps.len() { + slice::from_raw_parts_mut(ret_fmtp, ret_size) + } else { + slice::from_raw_parts_mut(ret_fmtp, rust_fmtps.len()) + }; + fmtps.copy_from_slice(rust_fmtps.as_slice()); + fmtps.len() +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_ptime(attributes: *const Vec) -> int64_t { + for attribute in (*attributes).iter() { + if let SdpAttribute::Ptime(time) = *attribute { + return time as int64_t; + } + } + -1 +} + +#[repr(C)] +#[derive(Clone, Copy)] +pub struct RustSdpAttributeFlags { + pub ice_lite: bool, + pub rtcp_mux: bool, + pub bundle_only: bool, + pub end_of_candidates: bool +} + + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_attribute_flags(attributes: *const Vec) -> RustSdpAttributeFlags { + let mut ret = RustSdpAttributeFlags { + ice_lite: false, + rtcp_mux: false, + bundle_only: false, + end_of_candidates: false + }; + for attribute in (*attributes).iter() { + if let SdpAttribute::IceLite = *attribute { + ret.ice_lite = true; + } else if let SdpAttribute::RtcpMux = *attribute { + ret.rtcp_mux = true; + } else if let SdpAttribute::BundleOnly = *attribute { + ret.bundle_only = true; + } else if let SdpAttribute::EndOfCandidates = *attribute { + ret.end_of_candidates = true; + } + } + ret +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_mid(attributes: *const Vec, ret: *mut StringView) -> nsresult { + for attribute in (*attributes).iter(){ + if let SdpAttribute::Mid(ref data) = *attribute { + *ret = StringView::from(data.as_str()); + return NS_OK; + } + } + NS_ERROR_INVALID_ARG +} + +#[repr(C)] +#[derive(Clone, Copy)] +pub struct RustSdpAttributeMsid { + id: StringView, + appdata: StringView +} + +impl<'a> From<&'a SdpAttributeMsid> for RustSdpAttributeMsid { + fn from(other: &SdpAttributeMsid) -> Self { + RustSdpAttributeMsid { + id: StringView::from(other.id.as_str()), + appdata: StringView::from(&other.appdata) + } + } +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_msid_count(attributes: *const Vec) -> size_t { + count_attribute((*attributes).as_slice(), RustSdpAttributeType::Msid) +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_msids(attributes: *const Vec, ret_size: size_t, ret_msids: *mut RustSdpAttributeMsid) { + let attrs: Vec<_> = (*attributes).iter().filter_map(|x| if let SdpAttribute::Msid(ref data) = *x { + Some(RustSdpAttributeMsid::from(data)) + } else { + None + }).collect(); + let msids = slice::from_raw_parts_mut(ret_msids, ret_size); + msids.copy_from_slice(attrs.as_slice()); +} + +// TODO: Finish msid attributes once parsing is changed upstream. +#[repr(C)] +#[derive(Clone, Copy)] +pub struct RustSdpAttributeMsidSemantic { + pub semantic: StringView, + pub msids: *const Vec +} + +impl<'a> From<&'a SdpAttributeMsidSemantic> for RustSdpAttributeMsidSemantic { + fn from(other: &SdpAttributeMsidSemantic) -> Self { + RustSdpAttributeMsidSemantic { + semantic: StringView::from(other.semantic.as_str()), + msids: &other.msids + } + } +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_msid_semantic_count(attributes: *const Vec) -> size_t { + count_attribute((*attributes).as_slice(), RustSdpAttributeType::MsidSemantic) +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_msid_semantics(attributes: *const Vec, ret_size: size_t, ret_msid_semantics: *mut RustSdpAttributeMsidSemantic) { + let attrs: Vec<_> = (*attributes).iter().filter_map(|x| if let SdpAttribute::MsidSemantic(ref data) = *x { + Some(RustSdpAttributeMsidSemantic::from(data)) + } else { + None + }).collect(); + let msid_semantics = slice::from_raw_parts_mut(ret_msid_semantics, ret_size); + msid_semantics.copy_from_slice(attrs.as_slice()); +} + +#[repr(C)] +#[derive(Clone, Copy)] +pub enum RustSdpAttributeGroupSemantic { + LipSynchronization, + FlowIdentification, + SingleReservationFlow, + AlternateNetworkAddressType, + ForwardErrorCorrection, + DecodingDependency, + Bundle, +} + +impl<'a> From<&'a SdpAttributeGroupSemantic> for RustSdpAttributeGroupSemantic { + fn from(other: &SdpAttributeGroupSemantic) -> Self { + match *other { + SdpAttributeGroupSemantic::LipSynchronization => RustSdpAttributeGroupSemantic::LipSynchronization, + SdpAttributeGroupSemantic::FlowIdentification => RustSdpAttributeGroupSemantic::FlowIdentification, + SdpAttributeGroupSemantic::SingleReservationFlow => RustSdpAttributeGroupSemantic::SingleReservationFlow, + SdpAttributeGroupSemantic::AlternateNetworkAddressType => RustSdpAttributeGroupSemantic::AlternateNetworkAddressType, + SdpAttributeGroupSemantic::ForwardErrorCorrection => RustSdpAttributeGroupSemantic::ForwardErrorCorrection, + SdpAttributeGroupSemantic::DecodingDependency => RustSdpAttributeGroupSemantic::DecodingDependency, + SdpAttributeGroupSemantic::Bundle => RustSdpAttributeGroupSemantic::Bundle + } + } +} + + +#[repr(C)] +#[derive(Clone, Copy)] +pub struct RustSdpAttributeGroup { + pub semantic: RustSdpAttributeGroupSemantic, + pub tags: *const Vec +} + +impl<'a> From<&'a SdpAttributeGroup> for RustSdpAttributeGroup { + fn from(other: &SdpAttributeGroup) -> Self { + RustSdpAttributeGroup { + semantic: RustSdpAttributeGroupSemantic::from(&other.semantics), + tags: &other.tags + } + } +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_group_count(attributes: *const Vec) -> size_t { + count_attribute((*attributes).as_slice(), RustSdpAttributeType::Group) +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_groups(attributes: *const Vec, ret_size: size_t, ret_groups: *mut RustSdpAttributeGroup) { + let attrs: Vec<_> = (*attributes).iter().filter_map(|x| if let SdpAttribute::Group(ref data) = *x { + Some(RustSdpAttributeGroup::from(data)) + } else { + None + }).collect(); + let groups = slice::from_raw_parts_mut(ret_groups, ret_size); + groups.copy_from_slice(attrs.as_slice()); +} + +#[repr(C)] +pub struct RustSdpAttributeRtcp { + pub port: uint32_t, + pub unicast_addr: RustIpAddr, +} + +impl<'a> From<&'a SdpAttributeRtcp> for RustSdpAttributeRtcp { + fn from(other: &SdpAttributeRtcp) -> Self { + RustSdpAttributeRtcp { + port: other.port as u32, + unicast_addr: RustIpAddr::from(&other.unicast_addr) + } + } +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_rtcp(attributes: *const Vec, ret: *mut RustSdpAttributeRtcp) -> nsresult { + let attr = get_attribute((*attributes).as_slice(), RustSdpAttributeType::Rtcp); + if let Some(&SdpAttribute::Rtcp(ref data)) = attr { + *ret = RustSdpAttributeRtcp::from(data); + return NS_OK; + } + NS_ERROR_INVALID_ARG +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_imageattr_count(attributes: *const Vec) -> size_t { + count_attribute((*attributes).as_slice(), RustSdpAttributeType::ImageAttr) +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_imageattrs(attributes: *const Vec, ret_size: size_t, ret_groups: *mut StringView) { + let attrs: Vec<_> = (*attributes).iter().filter_map(|x| if let SdpAttribute::ImageAttr(ref string) = *x { + Some(StringView::from(string.as_str())) + } else { + None + }).collect(); + let imageattrs = slice::from_raw_parts_mut(ret_groups, ret_size); + imageattrs.copy_from_slice(attrs.as_slice()); +} + +#[repr(C)] +#[derive(Clone, Copy)] +pub struct RustSdpAttributeSctpmap { + pub port: uint32_t, + pub channels: uint32_t, +} + +impl<'a> From<&'a SdpAttributeSctpmap> for RustSdpAttributeSctpmap { + fn from(other: &SdpAttributeSctpmap) -> Self { + RustSdpAttributeSctpmap { + port: other.port as u32, + channels: other.channels + } + } +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_sctpmap_count(attributes: *const Vec) -> size_t { + count_attribute((*attributes).as_slice(), RustSdpAttributeType::Sctpmap) +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_sctpmaps(attributes: *const Vec, ret_size: size_t, ret_sctpmaps: *mut RustSdpAttributeSctpmap) { + let attrs: Vec<_> = (*attributes).iter().filter_map(|x| if let SdpAttribute::Sctpmap(ref data) = *x { + Some(RustSdpAttributeSctpmap::from(data)) + } else { + None + }).collect(); + let sctpmaps = slice::from_raw_parts_mut(ret_sctpmaps, ret_size); + sctpmaps.copy_from_slice(attrs.as_slice()); +} + +#[repr(C)] +#[derive(Clone, Copy)] +pub enum RustDirection { + Recvonly, + Sendonly, + Sendrecv, + Inactive +} + +impl<'a> From<&'a Option> for RustDirection { + fn from(other: &Option) -> Self { + match *other { + Some(ref direction) => { + match *direction { + SdpAttributeDirection::Recvonly => RustDirection::Recvonly, + SdpAttributeDirection::Sendonly => RustDirection::Sendonly, + SdpAttributeDirection::Sendrecv => RustDirection::Sendrecv + } + }, + None => RustDirection::Inactive + } + } +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_direction(attributes: *const Vec) -> RustDirection { + for attribute in (*attributes).iter() { + match *attribute { + SdpAttribute::Recvonly => { + return RustDirection::Recvonly; + }, + SdpAttribute::Sendonly => { + return RustDirection::Sendonly; + }, + SdpAttribute::Sendrecv => { + return RustDirection::Sendrecv; + }, + SdpAttribute::Inactive => { + return RustDirection::Inactive; + }, + _ => () + } + } + RustDirection::Sendrecv +} + +#[repr(C)] +pub struct RustSdpAttributeRemoteCandidate { + pub component: uint32_t, + pub address: RustIpAddr, + pub port: uint32_t, +} + + +impl<'a> From<&'a SdpAttributeRemoteCandidate> for RustSdpAttributeRemoteCandidate { + fn from(other: &SdpAttributeRemoteCandidate) -> Self { + RustSdpAttributeRemoteCandidate { + component: other.component, + address: RustIpAddr::from(&other.address), + port: other.port + } + } +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_remote_candidate_count(attributes: *const Vec) -> size_t { + count_attribute((*attributes).as_slice(), RustSdpAttributeType::RemoteCandidate) +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_remote_candidates(attributes: *const Vec, ret_size: size_t, ret_candidates: *mut RustSdpAttributeRemoteCandidate) { + let attrs = (*attributes).iter().filter_map(|x| if let SdpAttribute::RemoteCandidate(ref data) = *x { + Some(RustSdpAttributeRemoteCandidate::from(data)) + } else { + None + }); + let candidates = slice::from_raw_parts_mut(ret_candidates, ret_size); + for (source, destination) in attrs.zip(candidates) { + *destination = source + } +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_rid_count(attributes: *const Vec) -> size_t { + count_attribute((*attributes).as_slice(), RustSdpAttributeType::Rid) +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_rids(attributes: *const Vec, ret_size: size_t, ret_rids: *mut StringView) { + let attrs: Vec<_> = (*attributes).iter().filter_map(|x| if let SdpAttribute::Rid(ref string) = *x { + Some(StringView::from(string.as_str())) + } else { + None + }).collect(); + let rids = slice::from_raw_parts_mut(ret_rids, ret_size); + rids.copy_from_slice(attrs.as_slice()); +} + +#[repr(C)] +#[derive(Clone, Copy)] +pub struct RustSdpAttributeExtmap { + pub id: uint16_t, + pub direction: RustDirection, + pub url: StringView, + pub extension_attributes: StringView +} + +impl<'a> From<&'a SdpAttributeExtmap> for RustSdpAttributeExtmap { + fn from(other: &SdpAttributeExtmap) -> Self { + RustSdpAttributeExtmap { + id : other.id as uint16_t, + direction: RustDirection::from(&other.direction), + url: StringView::from(other.url.as_str()), + extension_attributes: StringView::from(&other.extension_attributes) + } + } +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_extmap_count(attributes: *const Vec) -> size_t { + count_attribute((*attributes).as_slice(), RustSdpAttributeType::Extmap) +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_extmaps(attributes: *const Vec, ret_size: size_t, ret_rids: *mut RustSdpAttributeExtmap) { + let attrs: Vec<_> = (*attributes).iter().filter_map(|x| if let SdpAttribute::Extmap(ref data) = *x { + Some(RustSdpAttributeExtmap::from(data)) + } else { + None + }).collect(); + let extmaps = slice::from_raw_parts_mut(ret_rids, ret_size); + extmaps.copy_from_slice(attrs.as_slice()); +} diff --git a/media/webrtc/signaling/src/sdp/rsdparsa_capi/src/lib.rs b/media/webrtc/signaling/src/sdp/rsdparsa_capi/src/lib.rs new file mode 100644 index 000000000000..91a006cfadac --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa_capi/src/lib.rs @@ -0,0 +1,190 @@ +extern crate rsdparsa; +extern crate libc; +#[macro_use] extern crate log; +extern crate nserror; + +use std::ffi::CStr; +use std::{str, slice, ptr}; +use std::os::raw::c_char; +use std::error::Error; + +use libc::size_t; + +use std::rc::Rc; + +use nserror::{nsresult, NS_OK, NS_ERROR_INVALID_ARG}; +use rsdparsa::{SdpTiming, SdpBandwidth, SdpSession}; +use rsdparsa::error::SdpParserError; +use rsdparsa::attribute_type::SdpAttribute; + +pub mod types; +pub mod network; +pub mod attribute; +pub mod media_section; + +pub use types::{StringView, NULL_STRING}; +use network::{RustSdpOrigin, origin_view_helper, RustSdpConnection, + get_bandwidth}; + +#[no_mangle] +pub unsafe extern "C" fn parse_sdp(sdp: *const u8, length: u32, + fail_on_warning: bool, + session: *mut *const SdpSession, + error: *mut *const SdpParserError) -> nsresult { + // Bug 1433529 tracks fixing the TODOs in this function. + // TODO: Do I need to add explicit lifetime here? + // https://gankro.github.io/blah/only-in-rust/#honorable-mention-variance + let sdp_slice: &[u8] = slice::from_raw_parts(sdp, length as usize); + let sdp_c_str = match CStr::from_bytes_with_nul(sdp_slice) { + Ok(string) => string, + Err(_) => { + *session = ptr::null(); + *error = ptr::null(); // TODO: Give more useful return value here + debug!("Error converting string"); + return NS_ERROR_INVALID_ARG; + } + }; + let sdp_buf: &[u8] = sdp_c_str.to_bytes(); + let sdp_str_slice: &str = match str::from_utf8(sdp_buf) { + Ok(string) => string, + Err(_) => { + *session = ptr::null(); + *error = ptr::null(); // TODO: Give more useful return value here + debug!("Error converting string to utf8"); + return NS_ERROR_INVALID_ARG; + } + }; + let parser_result = rsdparsa::parse_sdp(sdp_str_slice, fail_on_warning); + match parser_result { + Ok(parsed) => { + *session = Rc::into_raw(Rc::new(parsed)); + *error = ptr::null(); + NS_OK + }, + Err(e) => { + *session = ptr::null(); + debug!("{:?}", e); + debug!("Error parsing SDP in rust: {}", e.description()); + *error = Box::into_raw(Box::new(e)); + NS_ERROR_INVALID_ARG + } + } +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_free_session(sdp_ptr: *mut SdpSession) { + let sdp = Rc::from_raw(sdp_ptr); + drop(sdp); +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_new_reference(session: *mut SdpSession) -> *const SdpSession { + let original = Rc::from_raw(session); + let ret = Rc::into_raw(Rc::clone(&original)); + Rc::into_raw(original); // So the original reference doesn't get dropped + ret +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_error_line_num(error: *mut SdpParserError) -> size_t { + match *error { + SdpParserError::Line {line_number, ..} | + SdpParserError::Unsupported { line_number, ..} | + SdpParserError::Sequence {line_number, ..} => line_number + } +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_error_message(error: *mut SdpParserError) -> StringView { + StringView::from((*error).description()) +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_free_error(error: *mut SdpParserError) { + let e = Box::from_raw(error); + drop(e); +} + +#[no_mangle] +pub unsafe extern "C" fn get_version(session: *const SdpSession) -> u64 { + (*session).get_version() +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_origin(session: *const SdpSession) -> RustSdpOrigin { + origin_view_helper((*session).get_origin()) +} + +#[no_mangle] +pub unsafe extern "C" fn session_view(session: *const SdpSession) -> StringView { + StringView::from((*session).get_session().as_str()) +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_session_has_connection(session: *const SdpSession) -> bool { + (*session).connection.is_some() +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_session_connection(session: *const SdpSession, + connection: *mut RustSdpConnection) -> nsresult { + match (*session).connection { + Some(ref c) => { + *connection = RustSdpConnection::from(c); + NS_OK + }, + None => NS_ERROR_INVALID_ARG + } +} + +#[repr(C)] +#[derive(Clone)] +pub struct RustSdpTiming { + pub start: u64, + pub stop: u64, +} + +impl<'a> From<&'a SdpTiming> for RustSdpTiming { + fn from(timing: &SdpTiming) -> Self { + RustSdpTiming {start: timing.start, stop: timing.stop} + } +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_session_has_timing(session: *const SdpSession) -> bool { + (*session).timing.is_some() +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_session_timing(session: *const SdpSession, + timing: *mut RustSdpTiming) -> nsresult { + match (*session).timing { + Some(ref t) => { + *timing = RustSdpTiming::from(t); + NS_OK + }, + None => NS_ERROR_INVALID_ARG + } +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_media_section_count(session: *const SdpSession) -> size_t { + (*session).media.len() +} + + +#[no_mangle] +pub unsafe extern "C" fn get_sdp_bandwidth(session: *const SdpSession, + bandwidth_type: *const c_char) -> u32 { + get_bandwidth(&(*session).bandwidth, bandwidth_type) +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_session_bandwidth_vec(session: *const SdpSession) -> *const Vec { + &(*session).bandwidth +} + +#[no_mangle] +pub unsafe extern "C" fn get_sdp_session_attributes(session: *const SdpSession) -> *const Vec { + &(*session).attribute +} diff --git a/media/webrtc/signaling/src/sdp/rsdparsa_capi/src/media_section.rs b/media/webrtc/signaling/src/sdp/rsdparsa_capi/src/media_section.rs new file mode 100644 index 000000000000..adf33e351d7a --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa_capi/src/media_section.rs @@ -0,0 +1,146 @@ +use std::ptr; +use std::os::raw::c_char; + +use libc::{size_t, uint32_t}; + +use nserror::{nsresult, NS_OK, NS_ERROR_INVALID_ARG}; +use rsdparsa::{SdpBandwidth, SdpSession}; +use rsdparsa::media_type::{SdpMedia, SdpMediaValue, SdpProtocolValue, + SdpFormatList}; +use rsdparsa::attribute_type::SdpAttribute; + +use network::{get_bandwidth, RustSdpConnection}; + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_media_section(session: *const SdpSession, + index: size_t) -> *const SdpMedia { + return match (*session).media.get(index) { + Some(m) => m, + None => ptr::null() + }; +} + +#[repr(C)] +#[derive(Clone, Copy)] +pub enum RustSdpMediaValue { + Audio, + Video, + Application, +} + +impl<'a> From<&'a SdpMediaValue> for RustSdpMediaValue { + fn from(val: &SdpMediaValue) -> Self { + match *val { + SdpMediaValue::Audio => RustSdpMediaValue::Audio, + SdpMediaValue::Video => RustSdpMediaValue::Video, + SdpMediaValue::Application => RustSdpMediaValue::Application + } + } +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_rust_get_media_type(sdp_media: *const SdpMedia) -> RustSdpMediaValue { + RustSdpMediaValue::from((*sdp_media).get_type()) +} + +#[repr(C)] +#[derive(Clone, Copy)] +pub enum RustSdpProtocolValue { + RtpSavpf, + UdpTlsRtpSavpf, + TcpTlsRtpSavpf, + DtlsSctp, + UdpDtlsSctp, + TcpDtlsSctp, +} + +impl<'a> From<&'a SdpProtocolValue> for RustSdpProtocolValue { + fn from(val: &SdpProtocolValue) -> Self { + match *val { + SdpProtocolValue::RtpSavpf => RustSdpProtocolValue::RtpSavpf, + SdpProtocolValue::UdpTlsRtpSavpf => RustSdpProtocolValue::UdpTlsRtpSavpf, + SdpProtocolValue::TcpTlsRtpSavpf => RustSdpProtocolValue::TcpTlsRtpSavpf, + SdpProtocolValue::DtlsSctp => RustSdpProtocolValue::DtlsSctp, + SdpProtocolValue::UdpDtlsSctp => RustSdpProtocolValue::UdpDtlsSctp, + SdpProtocolValue::TcpDtlsSctp => RustSdpProtocolValue::TcpDtlsSctp, + } + } +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_media_protocol(sdp_media: *const SdpMedia) -> RustSdpProtocolValue { + RustSdpProtocolValue::from((*sdp_media).get_proto()) +} + +#[repr(C)] +#[derive(Clone, Copy)] +pub enum RustSdpFormatType { + Integers, + Strings +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_format_type(sdp_media: *const SdpMedia) -> RustSdpFormatType { + match *(*sdp_media).get_formats() { + SdpFormatList::Integers(_) => RustSdpFormatType::Integers, + SdpFormatList::Strings(_) => RustSdpFormatType::Strings + } +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_format_string_vec(sdp_media: *const SdpMedia) -> *const Vec { + if let SdpFormatList::Strings(ref formats) = *(*sdp_media).get_formats() { + formats + } else { + ptr::null() + } +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_format_u32_vec(sdp_media: *const SdpMedia) -> *const Vec { + if let SdpFormatList::Integers(ref formats) = *(*sdp_media).get_formats() { + formats + } else { + ptr::null() + } +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_media_port(sdp_media: *const SdpMedia) -> uint32_t { + (*sdp_media).get_port() +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_media_port_count(sdp_media: *const SdpMedia) -> uint32_t { + (*sdp_media).get_port_count() +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_media_bandwidth(sdp_media: *const SdpMedia, + bandwidth_type: *const c_char) -> uint32_t { + get_bandwidth((*sdp_media).get_bandwidth(), bandwidth_type) +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_media_bandwidth_vec(sdp_media: *const SdpMedia) -> *const Vec { + (*sdp_media).get_bandwidth() +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_media_has_connection(sdp_media: *const SdpMedia) -> bool { + (*sdp_media).has_connection() +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_media_connection(sdp_media: *const SdpMedia, ret: *mut RustSdpConnection) -> nsresult { + if let &Some(ref connection) = (*sdp_media).get_connection() { + *ret = RustSdpConnection::from(connection); + return NS_OK; + } + NS_ERROR_INVALID_ARG +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_get_media_attribute_list(sdp_media: *const SdpMedia) -> *const Vec { + (*sdp_media).get_attributes() +} diff --git a/media/webrtc/signaling/src/sdp/rsdparsa_capi/src/network.rs b/media/webrtc/signaling/src/sdp/rsdparsa_capi/src/network.rs new file mode 100644 index 000000000000..a1baf6dc940a --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa_capi/src/network.rs @@ -0,0 +1,180 @@ +use std::net::IpAddr; +use std::os::raw::c_char; +use std::ffi::{CStr, CString}; + +use libc::{uint8_t, uint64_t}; + +use rsdparsa::{SdpOrigin, SdpConnection, SdpBandwidth}; + +use types::StringView; + +#[repr(C)] +#[derive(Clone, Copy, PartialEq)] +pub enum RustSdpAddrType { + None, + IP4, + IP6 +} + +impl<'a> From<&'a IpAddr> for RustSdpAddrType { + fn from(addr: &IpAddr) -> RustSdpAddrType { + match *addr { + IpAddr::V4(_) => RustSdpAddrType::IP4, + IpAddr::V6(_) => RustSdpAddrType::IP6 + } + } +} + +pub fn get_octets(addr: &IpAddr) -> [u8; 16] { + let mut octets = [0; 16]; + match *addr { + IpAddr::V4(v4_addr) => { + let v4_octets = v4_addr.octets(); + (&mut octets[0..4]).copy_from_slice(&v4_octets); + }, + IpAddr::V6(v6_addr) => { + let v6_octets = v6_addr.octets(); + octets.copy_from_slice(&v6_octets); + } + } + octets +} + +#[repr(C)] +pub struct RustIpAddr { + addr_type: RustSdpAddrType, + unicast_addr: [u8; 50] +} + +impl<'a> From<&'a IpAddr> for RustIpAddr { + fn from(addr: &IpAddr) -> Self { + let mut c_addr = [0; 50]; + let str_addr = format!("{}", addr); + let str_bytes = str_addr.as_bytes(); + if str_bytes.len() < 50 { + c_addr[..str_bytes.len()].copy_from_slice(&str_bytes); + } + RustIpAddr {addr_type: RustSdpAddrType::from(addr), + unicast_addr: c_addr } + } +} + +impl<'a> From<&'a Option> for RustIpAddr { + fn from(addr: &Option) -> Self { + match *addr { + Some(ref x) => RustIpAddr::from(x), + None => RustIpAddr { + addr_type: RustSdpAddrType::None, + unicast_addr: [0; 50] + } + } + } +} + +#[repr(C)] +pub struct RustSdpConnection { + pub addr: RustIpAddr, + pub ttl: uint8_t, + pub amount: uint64_t +} + +impl<'a> From<&'a SdpConnection> for RustSdpConnection { + fn from(sdp_connection: &SdpConnection) -> Self { + let ttl = match sdp_connection.ttl { + Some(x) => x as u8, + None => 0 + }; + let amount = match sdp_connection.amount { + Some(x) => x as u64, + None => 0 + }; + RustSdpConnection { addr: RustIpAddr::from(&sdp_connection.addr), + ttl: ttl, amount: amount } + } +} + +#[repr(C)] +pub struct RustSdpOrigin { + username: StringView, + session_id: u64, + session_version: u64, + addr: RustIpAddr, +} + + +fn bandwidth_match(str_bw: &str, enum_bw: &SdpBandwidth) -> bool { + match *enum_bw { + SdpBandwidth::As(_) => str_bw == "AS", + SdpBandwidth::Ct(_) => str_bw == "CT", + SdpBandwidth::Tias(_) => str_bw == "TIAS", + SdpBandwidth::Unknown(ref type_name, _) => str_bw == type_name, + } +} + +fn bandwidth_value(bandwidth: &SdpBandwidth) -> u32 { + match *bandwidth { + SdpBandwidth::As(x) | SdpBandwidth::Ct(x) | + SdpBandwidth::Tias(x) => x, + SdpBandwidth::Unknown(_, _) => 0 + } +} + +pub unsafe fn get_bandwidth(bandwidths: &Vec, + bandwidth_type: *const c_char) -> u32 { + let bw_type = match CStr::from_ptr(bandwidth_type).to_str() { + Ok(string) => string, + Err(_) => return 0 + }; + for bandwidth in bandwidths.iter() { + if bandwidth_match(bw_type, bandwidth) { + return bandwidth_value(bandwidth); + } + } + 0 +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_serialize_bandwidth(bw: *const Vec) -> *mut c_char { + let mut builder = String::new(); + for bandwidth in (*bw).iter() { + match *bandwidth { + SdpBandwidth::As(val) => { + builder.push_str("b=AS:"); + builder.push_str(&val.to_string()); + builder.push_str("\r\n"); + }, + SdpBandwidth::Ct(val) => { + builder.push_str("b=CT:"); + builder.push_str(&val.to_string()); + builder.push_str("\r\n"); + }, + SdpBandwidth::Tias(val) => { + builder.push_str("b=TIAS:"); + builder.push_str(&val.to_string()); + builder.push_str("\r\n"); + }, + SdpBandwidth::Unknown(ref name, val) => { + builder.push_str("b="); + builder.push_str(name.as_str()); + builder.push(':'); + builder.push_str(&val.to_string()); + builder.push_str("\r\n"); + }, + } + } + CString::from_vec_unchecked(builder.into_bytes()).into_raw() +} + +#[no_mangle] +pub unsafe extern "C" fn sdp_free_string(s: *mut c_char) { + drop(CString::from_raw(s)); +} + +pub unsafe fn origin_view_helper(origin: &SdpOrigin) -> RustSdpOrigin { + RustSdpOrigin { + username: StringView::from(origin.username.as_str()), + session_id: origin.session_id, + session_version: origin.session_version, + addr: RustIpAddr::from(&origin.unicast_addr) + } +} diff --git a/media/webrtc/signaling/src/sdp/rsdparsa_capi/src/types.rs b/media/webrtc/signaling/src/sdp/rsdparsa_capi/src/types.rs new file mode 100644 index 000000000000..6dfcde30a191 --- /dev/null +++ b/media/webrtc/signaling/src/sdp/rsdparsa_capi/src/types.rs @@ -0,0 +1,65 @@ +use libc::{size_t, uint32_t}; + +use nserror::{nsresult, NS_OK, NS_ERROR_INVALID_ARG}; + +#[repr(C)] +#[derive(Clone, Copy)] +pub struct StringView { + buffer: *const u8, + len: size_t +} + +pub const NULL_STRING: StringView = StringView { buffer: 0 as *const u8, + len: 0 }; + +impl<'a> From<&'a str> for StringView { + fn from(input: &str) -> StringView { + StringView { buffer: input.as_ptr(), len: input.len()} + } +} + +impl<'a, T: AsRef> From<&'a Option> for StringView { + fn from(input: &Option) -> StringView { + match *input { + Some(ref x) => StringView { buffer: x.as_ref().as_ptr(), + len: x.as_ref().len()}, + None => NULL_STRING + } + } +} + +#[no_mangle] +pub unsafe extern "C" fn string_vec_len(vec: *const Vec) -> size_t { + (*vec).len() as size_t +} + +#[no_mangle] +pub unsafe extern "C" fn string_vec_get_view(vec: *const Vec, + index: size_t, + ret: *mut StringView) -> nsresult { + match (*vec).get(index) { + Some(ref string) => { + *ret = StringView::from(string.as_str()); + NS_OK + }, + None => NS_ERROR_INVALID_ARG + } +} + +#[no_mangle] +pub unsafe extern "C" fn u32_vec_len(vec: *const Vec) -> size_t { + (*vec).len() +} + +#[no_mangle] +pub unsafe extern "C" fn u32_vec_get(vec: *const Vec, + index: size_t, + ret: *mut uint32_t) -> nsresult { + match (*vec).get(index) { + Some(val) => { + *ret = *val; + NS_OK + }, + None => NS_ERROR_INVALID_ARG + } +} diff --git a/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java b/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java index d6ed8f65eb2a..106e08fece38 100644 --- a/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java +++ b/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java @@ -899,7 +899,7 @@ public abstract class GeckoApp extends GeckoActivity @Override public void onContextMenu(final GeckoSession session, final int screenX, final int screenY, final String uri, - final String elementSrc) { + int elementType, final String elementSrc) { } protected void setFullScreen(final boolean fullscreen) { diff --git a/mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java b/mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java index 7a552b51df0d..453362b334c3 100644 --- a/mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java +++ b/mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java @@ -704,7 +704,8 @@ public class CustomTabsActivity extends AppCompatActivity @Override public void onContextMenu(GeckoSession session, int screenX, int screenY, - final String uri, final String elementSrc) { + final String uri, int elementType, + final String elementSrc) { final String content = uri != null ? uri : elementSrc != null ? elementSrc : ""; final Uri validUri = WebApps.getValidURL(content); diff --git a/mobile/android/base/java/org/mozilla/gecko/webapps/WebAppActivity.java b/mobile/android/base/java/org/mozilla/gecko/webapps/WebAppActivity.java index 5ef7d76813f8..47451f67525f 100644 --- a/mobile/android/base/java/org/mozilla/gecko/webapps/WebAppActivity.java +++ b/mobile/android/base/java/org/mozilla/gecko/webapps/WebAppActivity.java @@ -354,7 +354,7 @@ public class WebAppActivity extends AppCompatActivity @Override // GeckoSession.ContentDelegate public void onContextMenu(GeckoSession session, int screenX, int screenY, - String uri, String elementSrc) { + String uri, int elementType, String elementSrc) { final String content = uri != null ? uri : elementSrc != null ? elementSrc : ""; final Uri validUri = WebApps.getValidURL(content); if (validUri == null) { diff --git a/mobile/android/chrome/geckoview/GeckoViewContent.js b/mobile/android/chrome/geckoview/GeckoViewContent.js index 96179935bcda..5600c856d664 100644 --- a/mobile/android/chrome/geckoview/GeckoViewContent.js +++ b/mobile/android/chrome/geckoview/GeckoViewContent.js @@ -136,19 +136,21 @@ class GeckoViewContent extends GeckoViewContentModule { return node && node.href; } - let node = aEvent.target; - let hrefNode = nearestParentHref(node); - let isImageNode = (ChromeUtils.getClassName(node) === "HTMLImageElement"); - let isMediaNode = (ChromeUtils.getClassName(node) === "HTMLVideoElement" || - ChromeUtils.getClassName(node) === "HTMLAudioElement"); + const node = aEvent.target; + const hrefNode = nearestParentHref(node); + const elementType = ChromeUtils.getClassName(node); + const isImage = elementType === "HTMLImageElement"; + const isMedia = elementType === "HTMLVideoElement" || + elementType === "HTMLAudioElement"; - if (hrefNode || isImageNode || isMediaNode) { + if (hrefNode || isImage || isMedia) { this.eventDispatcher.sendRequest({ type: "GeckoView:ContextMenu", screenX: aEvent.screenX, screenY: aEvent.screenY, uri: hrefNode, - elementSrc: isImageNode || isMediaNode + elementType, + elementSrc: (isImage || isMedia) ? node.currentSrc || node.src : null }); diff --git a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java index cd11e659fd48..82b6e6c24c2c 100644 --- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java +++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java @@ -37,6 +37,7 @@ import android.os.IInterface; import android.os.Parcel; import android.os.Parcelable; import android.os.SystemClock; +import android.support.annotation.IntDef; import android.support.annotation.Nullable; import android.support.annotation.NonNull; import android.util.Log; @@ -108,10 +109,14 @@ public class GeckoSession extends LayerSession final EventCallback callback) { if ("GeckoView:ContextMenu".equals(event)) { + final int type = getContentElementType( + message.getString("elementType")); + delegate.onContextMenu(GeckoSession.this, message.getInt("screenX"), message.getInt("screenY"), message.getString("uri"), + type, message.getString("elementSrc")); } else if ("GeckoView:DOMTitleChanged".equals(event)) { delegate.onTitleChange(GeckoSession.this, @@ -1315,10 +1320,15 @@ public class GeckoSession extends LayerSession * Class representing security information for a site. */ public class SecurityInformation { + @IntDef({SECURITY_MODE_UNKNOWN, SECURITY_MODE_IDENTIFIED, + SECURITY_MODE_VERIFIED}) + public @interface SecurityMode {} public static final int SECURITY_MODE_UNKNOWN = 0; public static final int SECURITY_MODE_IDENTIFIED = 1; public static final int SECURITY_MODE_VERIFIED = 2; + @IntDef({CONTENT_UNKNOWN, CONTENT_BLOCKED, CONTENT_LOADED}) + public @interface ContentType {} public static final int CONTENT_UNKNOWN = 0; public static final int CONTENT_BLOCKED = 1; public static final int CONTENT_LOADED = 2; @@ -1359,22 +1369,22 @@ public class GeckoSession extends LayerSession * SECURITY_MODE_IDENTIFIED, and SECURITY_MODE_VERIFIED. SECURITY_MODE_IDENTIFIED * indicates domain validation only, while SECURITY_MODE_VERIFIED indicates extended validation. */ - public final int securityMode; + public final @SecurityMode int securityMode; /** * Indicates the presence of passive mixed content; possible values are * CONTENT_UNKNOWN, CONTENT_BLOCKED, and CONTENT_LOADED. */ - public final int mixedModePassive; + public final @ContentType int mixedModePassive; /** * Indicates the presence of active mixed content; possible values are * CONTENT_UNKNOWN, CONTENT_BLOCKED, and CONTENT_LOADED. */ - public final int mixedModeActive; + public final @ContentType int mixedModeActive; /** * Indicates the status of tracking protection; possible values are * CONTENT_UNKNOWN, CONTENT_BLOCKED, and CONTENT_LOADED. */ - public final int trackingMode; + public final @ContentType int trackingMode; /* package */ SecurityInformation(GeckoBundle identityData) { final GeckoBundle mode = identityData.getBundle("mode"); @@ -1418,7 +1428,26 @@ public class GeckoSession extends LayerSession void onSecurityChange(GeckoSession session, SecurityInformation securityInfo); } + private static int getContentElementType(final String name) { + if ("HTMLImageElement".equals(name)) { + return ContentDelegate.ELEMENT_TYPE_IMAGE; + } else if ("HTMLVideoElement".equals(name)) { + return ContentDelegate.ELEMENT_TYPE_VIDEO; + } else if ("HTMLAudioElement".equals(name)) { + return ContentDelegate.ELEMENT_TYPE_AUDIO; + } + return ContentDelegate.ELEMENT_TYPE_NONE; + } + public interface ContentDelegate { + @IntDef({ELEMENT_TYPE_NONE, ELEMENT_TYPE_IMAGE, ELEMENT_TYPE_VIDEO, + ELEMENT_TYPE_AUDIO}) + public @interface ElementType {} + static final int ELEMENT_TYPE_NONE = 0; + static final int ELEMENT_TYPE_IMAGE = 1; + static final int ELEMENT_TYPE_VIDEO = 2; + static final int ELEMENT_TYPE_AUDIO = 3; + /** * A page title was discovered in the content or updated after the content * loaded. @@ -1461,11 +1490,14 @@ public class GeckoSession extends LayerSession * @param screenY The screen coordinates of the press. * @param uri The URI of the pressed link, set for links and * image-links. + * @param elementType The type of the pressed element. + * One of the {@link ContentDelegate#ELEMENT_TYPE_LINK} flags. * @param elementSrc The source URI of the pressed element, set for * (nested) images and media elements. */ void onContextMenu(GeckoSession session, int screenX, int screenY, - String uri, String elementSrc); + String uri, @ElementType int elementTypes, + String elementSrc); } /** @@ -1500,6 +1532,8 @@ public class GeckoSession extends LayerSession */ void onCanGoForward(GeckoSession session, boolean canGoForward); + @IntDef({TARGET_WINDOW_NONE, TARGET_WINDOW_CURRENT, TARGET_WINDOW_NEW}) + public @interface TargetWindow {} public static final int TARGET_WINDOW_NONE = 0; public static final int TARGET_WINDOW_CURRENT = 1; public static final int TARGET_WINDOW_NEW = 2; @@ -1514,7 +1548,8 @@ public class GeckoSession extends LayerSession * @return Whether or not the load was handled. Returning false will allow Gecko * to continue the load as normal. */ - boolean onLoadRequest(GeckoSession session, String uri, int target); + boolean onLoadRequest(GeckoSession session, String uri, + @TargetWindow int target); /** * A request has been made to open a new session. The URI is provided only for @@ -1672,6 +1707,12 @@ public class GeckoSession extends LayerSession } class AuthOptions { + @IntDef(flag = true, + value = {AUTH_FLAG_HOST, AUTH_FLAG_PROXY, + AUTH_FLAG_ONLY_PASSWORD, AUTH_FLAG_PREVIOUS_FAILED, + AUTH_FLAG_CROSS_ORIGIN_SUB_RESOURCE}) + public @interface AuthFlag {} + /** * The auth prompt is for a network host. */ @@ -1693,6 +1734,8 @@ public class GeckoSession extends LayerSession */ public static final int AUTH_FLAG_CROSS_ORIGIN_SUB_RESOURCE = 32; + @IntDef({AUTH_LEVEL_NONE, AUTH_LEVEL_PW_ENCRYPTED, AUTH_LEVEL_SECURE}) + public @interface AuthLevel {} /** * The auth request is unencrypted or the encryption status is unknown. */ @@ -1709,7 +1752,7 @@ public class GeckoSession extends LayerSession /** * An int bit-field of AUTH_FLAG_* flags. */ - public int flags; + public @AuthFlag int flags; /** * A string containing the URI for the auth request or null if unknown. @@ -1719,7 +1762,7 @@ public class GeckoSession extends LayerSession /** * An int, one of AUTH_LEVEL_*, indicating level of encryption. */ - public int level; + public @AuthLevel int level; /** * A string containing the initial username or null if password-only. @@ -1753,6 +1796,8 @@ public class GeckoSession extends LayerSession AuthOptions options, AuthCallback callback); class Choice { + @IntDef({CHOICE_TYPE_MENU, CHOICE_TYPE_SINGLE, CHOICE_TYPE_MULTIPLE}) + public @interface ChoiceType {} /** * Display choices in a menu that dismisses as soon as an item is chosen. */ @@ -1877,8 +1922,9 @@ public class GeckoSession extends LayerSession * @param choices Array of Choices each representing an item or group. * @param callback Callback interface. */ - void onChoicePrompt(GeckoSession session, String title, String msg, int type, - Choice[] choices, ChoiceCallback callback); + void onChoicePrompt(GeckoSession session, String title, String msg, + @Choice.ChoiceType int type, Choice[] choices, + ChoiceCallback callback); /** * Display a color prompt. @@ -1892,6 +1938,9 @@ public class GeckoSession extends LayerSession void onColorPrompt(GeckoSession session, String title, String value, TextCallback callback); + @IntDef({DATETIME_TYPE_DATE, DATETIME_TYPE_MONTH, DATETIME_TYPE_WEEK, + DATETIME_TYPE_TIME, DATETIME_TYPE_DATETIME_LOCAL}) + public @interface DatetimeType {} /** * Prompt for year, month, and day. */ @@ -1929,8 +1978,9 @@ public class GeckoSession extends LayerSession * @param callback Callback interface; the result passed to confirm() must be in * HTML date/time format. */ - void onDateTimePrompt(GeckoSession session, String title, int type, - String value, String min, String max, TextCallback callback); + void onDateTimePrompt(GeckoSession session, String title, + @DatetimeType int type, String value, String min, + String max, TextCallback callback); /** * Callback interface for notifying the result of file prompts. @@ -1955,6 +2005,8 @@ public class GeckoSession extends LayerSession void confirm(Context context, Uri[] uris); } + @IntDef({FILE_TYPE_SINGLE, FILE_TYPE_MULTIPLE}) + public @interface FileType {} static final int FILE_TYPE_SINGLE = 1; static final int FILE_TYPE_MULTIPLE = 2; @@ -1969,8 +2021,8 @@ public class GeckoSession extends LayerSession * "*" to indicate any value. * @param callback Callback interface. */ - void onFilePrompt(GeckoSession session, String title, int type, - String[] mimeTypes, FileCallback callback); + void onFilePrompt(GeckoSession session, String title, @FileType int type, + String[] mimeTypes, FileCallback callback); } /** @@ -1995,6 +2047,10 @@ public class GeckoSession extends LayerSession * protection events. **/ public interface TrackingProtectionDelegate { + @IntDef(flag = true, + value = {CATEGORY_AD, CATEGORY_ANALYTIC, CATEGORY_SOCIAL, + CATEGORY_CONTENT}) + public @interface Category {} static final int CATEGORY_AD = 1 << 0; static final int CATEGORY_ANALYTIC = 1 << 1; static final int CATEGORY_SOCIAL = 1 << 2; @@ -2009,7 +2065,8 @@ public class GeckoSession extends LayerSession * One or more of the {@link TrackingProtectionDelegate#CATEGORY_AD} * flags. */ - void onTrackerBlocked(GeckoSession session, String uri, int categories); + void onTrackerBlocked(GeckoSession session, String uri, + @Category int categories); } /** @@ -2018,7 +2075,7 @@ public class GeckoSession extends LayerSession * Use one or more of the {@link TrackingProtectionDelegate#CATEGORY_AD} * flags. **/ - public void enableTrackingProtection(int categories) { + public void enableTrackingProtection(@TrackingProtectionDelegate.Category int categories) { mTrackingProtection.enable(categories); } @@ -2039,6 +2096,8 @@ public class GeckoSession extends LayerSession * permission dialog. **/ public interface PermissionDelegate { + @IntDef({PERMISSION_GEOLOCATION, PERMISSION_DESKTOP_NOTIFICATION}) + public @interface Permission {} /** * Permission for using the geolocation API. * See: https://developer.mozilla.org/en-US/docs/Web/API/Geolocation @@ -2080,7 +2139,7 @@ public class GeckoSession extends LayerSession * @param callback Callback interface. */ void onAndroidPermissionsRequest(GeckoSession session, String[] permissions, - Callback callback); + Callback callback); /** * Request content permission. @@ -2093,10 +2152,16 @@ public class GeckoSession extends LayerSession * @param access Not used. * @param callback Callback interface. */ - void onContentPermissionRequest(GeckoSession session, String uri, int type, - String access, Callback callback); + void onContentPermissionRequest(GeckoSession session, String uri, + @Permission int type, + String access, Callback callback); class MediaSource { + @IntDef({SOURCE_CAMERA, SOURCE_SCREEN, SOURCE_APPLICATION, + SOURCE_WINDOW, SOURCE_BROWSER, SOURCE_MICROPHONE, + SOURCE_AUDIOCAPTURE, SOURCE_OTHER}) + public @interface Source {} + /** * The media source is a camera. */ @@ -2137,6 +2202,8 @@ public class GeckoSession extends LayerSession */ public static final int SOURCE_OTHER = 7; + @IntDef({TYPE_VIDEO, TYPE_AUDIO}) + public @interface Type {} /** * The media type is video. */ @@ -2171,14 +2238,14 @@ public class GeckoSession extends LayerSession * Possible values for an audio source are: * SOURCE_MICROPHONE, SOURCE_AUDIOCAPTURE, and SOURCE_OTHER. */ - public final int source; + public final @Source int source; /** * An int giving the type of media, must be either TYPE_VIDEO or TYPE_AUDIO. */ - public final int type; + public final @Type int type; - private static int getSourceFromString(String src) { + private static @Source int getSourceFromString(String src) { // The strings here should match those in MediaSourceEnum in MediaStreamTrack.webidl if ("camera".equals(src)) { return SOURCE_CAMERA; @@ -2201,7 +2268,7 @@ public class GeckoSession extends LayerSession } } - private static int getTypeFromString(String type) { + private static @Type int getTypeFromString(String type) { // The strings here should match the possible types in MediaDevice::MediaDevice in MediaManager.cpp if ("video".equals(type)) { return TYPE_VIDEO; @@ -2268,6 +2335,6 @@ public class GeckoSession extends LayerSession * @param callback Callback interface. */ void onMediaPermissionRequest(GeckoSession session, String uri, MediaSource[] video, - MediaSource[] audio, MediaCallback callback); + MediaSource[] audio, MediaCallback callback); } } diff --git a/mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java b/mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java index bb73706a47f6..99131e8fc167 100644 --- a/mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java +++ b/mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java @@ -190,9 +190,10 @@ public class GeckoViewActivity extends Activity { @Override public void onContextMenu(GeckoSession session, int screenX, int screenY, - String uri, String elementSrc) { + String uri, int elementType, String elementSrc) { Log.d(LOGTAG, "onContextMenu screenX=" + screenX + " screenY=" + screenY + " uri=" + uri + + " elementType=" + elementType + " elementSrc=" + elementSrc); } } diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index b9c35546739a..e0dc4873dc8f 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -4774,8 +4774,8 @@ pref("image.mem.animated.use_heap", false); #endif // Decodes images into shared memory to allow direct use in separate -// rendering processes. -pref("image.mem.shared", 2); +// rendering processes. Only applicable with WebRender. +pref("image.mem.shared", 1); // Allows image locking of decoded image data in content processes. pref("image.mem.allow_locking_in_content_processes", true); @@ -5368,6 +5368,8 @@ pref("dom.vr.enabled", false); pref("dom.vr.autoactivate.enabled", false); // The threshold value of trigger inputs for VR controllers pref("dom.vr.controller_trigger_threshold", "0.1"); +// Enable external XR API integrations +pref("dom.vr.external.enabled", false); // Maximum number of milliseconds the browser will wait for content to call // VRDisplay.requestPresent after emitting vrdisplayactivate during VR // link traversal. This prevents a long running event handler for diff --git a/parser/html/nsHtml5TreeOperation.cpp b/parser/html/nsHtml5TreeOperation.cpp index 59a65191611a..3d7448fa8fdd 100644 --- a/parser/html/nsHtml5TreeOperation.cpp +++ b/parser/html/nsHtml5TreeOperation.cpp @@ -23,7 +23,6 @@ #include "nsIDOMHTMLFormElement.h" #include "nsIFormControl.h" #include "nsIStyleSheetLinkingElement.h" -#include "nsIDOMDocumentType.h" #include "nsIObserverService.h" #include "mozilla/Services.h" #include "nsIMutationObserver.h" @@ -31,6 +30,7 @@ #include "nsIServiceManager.h" #include "nsEscape.h" #include "mozilla/dom/Comment.h" +#include "mozilla/dom/DocumentType.h" #include "mozilla/dom/Element.h" #include "mozilla/dom/HTMLImageElement.h" #include "mozilla/dom/HTMLTemplateElement.h" @@ -736,16 +736,13 @@ nsHtml5TreeOperation::AppendDoctypeToDocument(nsAtom* aName, { // Adapted from nsXMLContentSink // Create a new doctype node - nsCOMPtr docType; - NS_NewDOMDocumentType(getter_AddRefs(docType), - aBuilder->GetNodeInfoManager(), - aName, - aPublicId, - aSystemId, - VoidString()); - NS_ASSERTION(docType, "Doctype creation failed."); - nsCOMPtr asContent = do_QueryInterface(docType); - return AppendToDocument(asContent, aBuilder); + RefPtr docType = + NS_NewDOMDocumentType(aBuilder->GetNodeInfoManager(), + aName, + aPublicId, + aSystemId, + VoidString()); + return AppendToDocument(docType, aBuilder); } nsIContent* diff --git a/parser/htmlparser/nsHTMLTags.cpp b/parser/htmlparser/nsHTMLTags.cpp index 11f8b8f1ea4e..999ffda8932e 100644 --- a/parser/htmlparser/nsHTMLTags.cpp +++ b/parser/htmlparser/nsHTMLTags.cpp @@ -18,7 +18,7 @@ using namespace mozilla; // static array of unicode tag names #define HTML_TAG(_tag, _classname, _interfacename) (u"" #_tag), #define HTML_OTHER(_tag) -const char16_t* const nsHTMLTags::sTagUnicodeTable[] = { +const char16_t* const nsHTMLTags::sTagNames[] = { #include "nsHTMLTagList.h" }; #undef HTML_TAG @@ -30,61 +30,6 @@ nsHTMLTags::TagAtomHash* nsHTMLTags::gTagAtomTable; #define NS_HTMLTAG_NAME_MAX_LENGTH 10 -// This would use NS_STATIC_ATOM_DEFN if it wasn't an array. -nsStaticAtom* nsHTMLTags::sTagAtomTable[eHTMLTag_userdefined - 1]; - -#define HTML_TAG(_tag, _classname, _interfacename) \ - NS_STATIC_ATOM_BUFFER(_tag, #_tag) -#define HTML_OTHER(_tag) -#include "nsHTMLTagList.h" -#undef HTML_TAG -#undef HTML_OTHER - -/* static */ void -nsHTMLTags::RegisterAtoms(void) -{ - // This would use NS_STATIC_ATOM_SETUP if it wasn't an array. - static const nsStaticAtomSetup sTagAtomSetup[] = { - #define HTML_TAG(_tag, _classname, _interfacename) \ - { _tag##_buffer, &nsHTMLTags::sTagAtomTable[eHTMLTag_##_tag - 1] }, - #define HTML_OTHER(_tag) - #include "nsHTMLTagList.h" - #undef HTML_TAG - #undef HTML_OTHER - }; - - NS_RegisterStaticAtoms(sTagAtomSetup); - -#if defined(DEBUG) - { - // let's verify that all names in the the table are lowercase... - for (int32_t i = 0; i < NS_HTML_TAG_MAX; ++i) { - nsAutoString temp1((char16_t*)sTagAtomSetup[i].mString); - nsAutoString temp2((char16_t*)sTagAtomSetup[i].mString); - ToLowerCase(temp1); - NS_ASSERTION(temp1.Equals(temp2), "upper case char in table"); - } - - // let's verify that all names in the unicode strings above are - // correct. - for (int32_t i = 0; i < NS_HTML_TAG_MAX; ++i) { - nsAutoString temp1(sTagUnicodeTable[i]); - nsAutoString temp2((char16_t*)sTagAtomSetup[i].mString); - NS_ASSERTION(temp1.Equals(temp2), "Bad unicode tag name!"); - } - - // let's verify that NS_HTMLTAG_NAME_MAX_LENGTH is correct - uint32_t maxTagNameLength = 0; - for (int32_t i = 0; i < NS_HTML_TAG_MAX; ++i) { - uint32_t len = NS_strlen(sTagUnicodeTable[i]); - maxTagNameLength = std::max(len, maxTagNameLength); - } - NS_ASSERTION(maxTagNameLength == NS_HTMLTAG_NAME_MAX_LENGTH, - "NS_HTMLTAG_NAME_MAX_LENGTH not set correctly!"); - } -#endif -} - // static nsresult nsHTMLTags::AddRefTable(void) @@ -99,17 +44,39 @@ nsHTMLTags::AddRefTable(void) // keys and the value of the corresponding enum as the value in // the table. - int32_t i; - for (i = 0; i < NS_HTML_TAG_MAX; ++i) { - const char16_t* tagName = sTagUnicodeTable[i]; + for (int32_t i = 0; i < NS_HTML_TAG_MAX; ++i) { + const char16_t* tagName = sTagNames[i]; const nsHTMLTag tagValue = static_cast(i + 1); + // We use AssignLiteral here to avoid a string copy. This is okay // because this is truly static data. nsString tmp; tmp.AssignLiteral(tagName, nsString::char_traits::length(tagName)); gTagTable->Put(tmp, tagValue); - gTagAtomTable->Put(sTagAtomTable[i], tagValue); + + // All the HTML tag names are static atoms within nsGkAtoms, and they are + // registered before this code is reached. + nsStaticAtom* atom = NS_GetStaticAtom(tmp); + MOZ_ASSERT(atom); + gTagAtomTable->Put(atom, tagValue); } + +#ifdef DEBUG + // Check all tagNames are lowercase, and that NS_HTMLTAG_NAME_MAX_LENGTH is + // correct. + uint32_t maxTagNameLength = 0; + for (int i = 0; i < NS_HTML_TAG_MAX; ++i) { + const char16_t* tagName = sTagNames[i]; + + nsAutoString lowerTagName(tagName); + ToLowerCase(lowerTagName); + MOZ_ASSERT(lowerTagName.Equals(tagName)); + + maxTagNameLength = std::max(NS_strlen(tagName), maxTagNameLength); + } + + MOZ_ASSERT(maxTagNameLength == NS_HTMLTAG_NAME_MAX_LENGTH); +#endif } return NS_OK; @@ -172,7 +139,7 @@ nsHTMLTags::TestTagTable() nsHTMLTags::AddRefTable(); // Make sure we can find everything we are supposed to for (int i = 0; i < NS_HTML_TAG_MAX; ++i) { - tag = sTagUnicodeTable[i]; + tag = sTagNames[i]; const nsAString& tagString = nsDependentString(tag); id = StringTagToId(tagString); NS_ASSERTION(id != eHTMLTag_userdefined, "can't find tag id"); diff --git a/parser/htmlparser/nsHTMLTags.h b/parser/htmlparser/nsHTMLTags.h index 28e4906cb588..6143fc8b5192 100644 --- a/parser/htmlparser/nsHTMLTags.h +++ b/parser/htmlparser/nsHTMLTags.h @@ -44,7 +44,6 @@ public: using TagStringHash = nsDataHashtable; using TagAtomHash = nsDataHashtable, nsHTMLTag>; - static void RegisterAtoms(void); static nsresult AddRefTable(void); static void ReleaseTable(void); @@ -76,9 +75,7 @@ public: #endif private: - // This would use NS_STATIC_ATOM_DECL if it wasn't an array. - static nsStaticAtom* sTagAtomTable[eHTMLTag_userdefined - 1]; - static const char16_t* const sTagUnicodeTable[]; + static const char16_t* const sTagNames[]; static int32_t gTableRefCount; static TagStringHash* gTagTable; diff --git a/rdf/base/nsIRDFContentSink.h b/rdf/base/nsIRDFContentSink.h index 5abb536dec7e..293e8baadea4 100644 --- a/rdf/base/nsIRDFContentSink.h +++ b/rdf/base/nsIRDFContentSink.h @@ -54,9 +54,4 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIRDFContentSink, NS_IRDFCONTENTSINK_IID) nsresult NS_NewRDFContentSink(nsIRDFContentSink** aResult); -class nsRDFAtoms { -public: - static void RegisterAtoms(); -}; - #endif // nsIRDFContentSink_h___ diff --git a/rdf/base/nsRDFContentSink.cpp b/rdf/base/nsRDFContentSink.cpp index 7dbbd71d3de6..3557e817baff 100644 --- a/rdf/base/nsRDFContentSink.cpp +++ b/rdf/base/nsRDFContentSink.cpp @@ -60,7 +60,7 @@ #include "nsIExpatSink.h" #include "nsCRT.h" #include "nsAtom.h" -#include "nsStaticAtom.h" +#include "nsGkAtoms.h" #include "nsIScriptError.h" #include "nsIDTD.h" @@ -126,10 +126,6 @@ public: static nsIRDFResource* kRDF_Seq; static nsIRDFResource* kRDF_nextVal; - #define RDF_ATOM(name_, value_) NS_STATIC_ATOM_DECL(name_) - #include "nsRDFContentSinkAtomList.h" - #undef RDF_ATOM - typedef struct ContainerInfo { nsIRDFResource** mType; nsContainerTestFn mTestFn; @@ -235,28 +231,6 @@ mozilla::LazyLogModule RDFContentSinkImpl::gLog("nsRDFContentSink"); //////////////////////////////////////////////////////////////////////// -#define RDF_ATOM(name_, value_) NS_STATIC_ATOM_DEFN(RDFContentSinkImpl, name_) -#include "nsRDFContentSinkAtomList.h" -#undef RDF_ATOM - -#define RDF_ATOM(name_, value_) NS_STATIC_ATOM_BUFFER(name_, value_) -#include "nsRDFContentSinkAtomList.h" -#undef RDF_ATOM - -static const nsStaticAtomSetup sRDFContentSinkAtomSetup[] = { - #define RDF_ATOM(name_, value_) \ - NS_STATIC_ATOM_SETUP(RDFContentSinkImpl, name_) - #include "nsRDFContentSinkAtomList.h" - #undef RDF_ATOM -}; - -// static -void -nsRDFAtoms::RegisterAtoms() -{ - NS_RegisterStaticAtoms(sRDFContentSinkAtomSetup); -} - RDFContentSinkImpl::RDFContentSinkImpl() : mText(nullptr), mTextLength(0), @@ -799,7 +773,7 @@ RDFContentSinkImpl::GetIdAboutAttribute(const char16_t** aAttributes, // XXX you can't specify both, but we'll just pick up the // first thing that was specified and ignore the other. - if (localName == kAboutAtom) { + if (localName == nsGkAtoms::about) { if (aIsAnonymous) *aIsAnonymous = false; @@ -815,7 +789,7 @@ RDFContentSinkImpl::GetIdAboutAttribute(const char16_t** aAttributes, return gRDFService->GetResource(NS_ConvertUTF16toUTF8(aAttributes[1]), aResource); } - else if (localName == kIdAtom) { + else if (localName == nsGkAtoms::ID) { if (aIsAnonymous) *aIsAnonymous = false; // In the spirit of leniency, we do not bother trying to @@ -835,10 +809,10 @@ RDFContentSinkImpl::GetIdAboutAttribute(const char16_t** aAttributes, return gRDFService->GetResource(name, aResource); } - else if (localName == kNodeIdAtom) { + else if (localName == nsGkAtoms::nodeID) { nodeID.Assign(aAttributes[1]); } - else if (localName == kAboutEachAtom) { + else if (localName == nsGkAtoms::about) { // XXX we don't deal with aboutEach... //MOZ_LOG(gLog, LogLevel::Warning, // ("rdfxml: ignoring aboutEach at line %d", @@ -890,7 +864,7 @@ RDFContentSinkImpl::GetResourceAttribute(const char16_t** aAttributes, // XXX you can't specify both, but we'll just pick up the // first thing that was specified and ignore the other. - if (localName == kResourceAtom) { + if (localName == nsGkAtoms::resource) { // XXX Take the URI and make it fully qualified by // sticking it into the document's URL. This may not be // appropriate... @@ -907,7 +881,7 @@ RDFContentSinkImpl::GetResourceAttribute(const char16_t** aAttributes, return gRDFService->GetResource(NS_ConvertUTF16toUTF8(aAttributes[1]), aResource); } - else if (localName == kNodeIdAtom) { + else if (localName == nsGkAtoms::nodeID) { nodeID.Assign(aAttributes[1]); } } @@ -952,8 +926,8 @@ RDFContentSinkImpl::AddProperties(const char16_t** aAttributes, // skip `about', `ID', `resource', and 'nodeID' attributes (either with or // without the `rdf:' prefix); these are all "special" and // should've been dealt with by the caller. - if (localName == kAboutAtom || localName == kIdAtom || - localName == kResourceAtom || localName == kNodeIdAtom) { + if (localName == nsGkAtoms::about || localName == nsGkAtoms::ID || + localName == nsGkAtoms::resource || localName == nsGkAtoms::nodeID) { if (nameSpaceURI.IsEmpty() || nameSpaceURI.EqualsLiteral(RDF_NAMESPACE_URI)) continue; @@ -961,7 +935,7 @@ RDFContentSinkImpl::AddProperties(const char16_t** aAttributes, // Skip `parseType', `RDF:parseType', and `NC:parseType'. This // is meta-information that will be handled in SetParseMode. - if (localName == kParseTypeAtom) { + if (localName == nsGkAtoms::parseType) { if (nameSpaceURI.IsEmpty() || nameSpaceURI.EqualsLiteral(RDF_NAMESPACE_URI) || nameSpaceURI.EqualsLiteral(NC_NAMESPACE_URI)) { @@ -993,7 +967,7 @@ RDFContentSinkImpl::SetParseMode(const char16_t **aAttributes) const nsDependentSubstring& nameSpaceURI = SplitExpatName(aAttributes[0], getter_AddRefs(localName)); - if (localName == kParseTypeAtom) { + if (localName == nsGkAtoms::parseType) { nsDependentString v(aAttributes[1]); if (nameSpaceURI.IsEmpty() || @@ -1028,7 +1002,8 @@ RDFContentSinkImpl::OpenRDF(const char16_t* aName) const nsDependentSubstring& nameSpaceURI = SplitExpatName(aName, getter_AddRefs(localName)); - if (!nameSpaceURI.EqualsLiteral(RDF_NAMESPACE_URI) || localName != kRDFAtom) { + if (!nameSpaceURI.EqualsLiteral(RDF_NAMESPACE_URI) || + localName != nsGkAtoms::RDF) { // MOZ_LOG(gLog, LogLevel::Info, // ("rdfxml: expected RDF:RDF at line %d", // aNode.GetSourceLineNumber())); @@ -1071,21 +1046,21 @@ RDFContentSinkImpl::OpenObject(const char16_t* aName, if (nameSpaceURI.EqualsLiteral(RDF_NAMESPACE_URI)) { isaTypedNode = false; - if (localName == kDescriptionAtom) { + if (localName == nsGkAtoms::Description) { // it's a description mState = eRDFContentSinkState_InDescriptionElement; } - else if (localName == kBagAtom) { + else if (localName == nsGkAtoms::Bag) { // it's a bag container InitContainer(kRDF_Bag, source); mState = eRDFContentSinkState_InContainerElement; } - else if (localName == kSeqAtom) { + else if (localName == nsGkAtoms::Seq) { // it's a seq container InitContainer(kRDF_Seq, source); mState = eRDFContentSinkState_InContainerElement; } - else if (localName == kAltAtom) { + else if (localName == nsGkAtoms::Alt) { // it's an alt container InitContainer(kRDF_Alt, source); mState = eRDFContentSinkState_InContainerElement; @@ -1202,7 +1177,7 @@ RDFContentSinkImpl::OpenMember(const char16_t* aName, SplitExpatName(aName, getter_AddRefs(localName)); if (!nameSpaceURI.EqualsLiteral(RDF_NAMESPACE_URI) || - localName != kLiAtom) { + localName != nsGkAtoms::li) { MOZ_LOG(gLog, LogLevel::Error, ("rdfxml: expected RDF:li at line %d", -1)); // XXX pass in line number @@ -1281,7 +1256,7 @@ RDFContentSinkImpl::RegisterNamespaces(const char16_t **aAttributes) } nsDependentSubstring lname(attr, endLocal); RefPtr preferred = NS_Atomize(lname); - if (preferred == kXMLNSAtom) { + if (preferred == nsGkAtoms::xmlns) { preferred = nullptr; } sink->AddNameSpace(preferred, nsDependentString(aAttributes[1])); diff --git a/rdf/base/nsRDFContentSinkAtomList.h b/rdf/base/nsRDFContentSinkAtomList.h deleted file mode 100644 index 5ef4f7b4e9fb..000000000000 --- a/rdf/base/nsRDFContentSinkAtomList.h +++ /dev/null @@ -1,18 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* 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/. */ - -RDF_ATOM(kAboutAtom, "about") -RDF_ATOM(kIdAtom, "ID") -RDF_ATOM(kNodeIdAtom, "nodeID") -RDF_ATOM(kAboutEachAtom, "aboutEach") -RDF_ATOM(kResourceAtom, "resource") -RDF_ATOM(kRDFAtom, "RDF") -RDF_ATOM(kDescriptionAtom, "Description") -RDF_ATOM(kBagAtom, "Bag") -RDF_ATOM(kSeqAtom, "Seq") -RDF_ATOM(kAltAtom, "Alt") -RDF_ATOM(kLiAtom, "li") -RDF_ATOM(kXMLNSAtom, "xmlns") -RDF_ATOM(kParseTypeAtom, "parseType") diff --git a/security/manager/pki/nsASN1Tree.cpp b/security/manager/pki/nsASN1Tree.cpp index 2580f8efeb77..7b95b09e8d2d 100644 --- a/security/manager/pki/nsASN1Tree.cpp +++ b/security/manager/pki/nsASN1Tree.cpp @@ -398,7 +398,7 @@ nsNSSASN1Tree::PerformActionOnCell(const char16_t*, int32_t, nsITreeColumn*) } NS_IMETHODIMP -nsNSSASN1Tree::CanDrop(int32_t, int32_t, nsIDOMDataTransfer*, bool* _retval) +nsNSSASN1Tree::CanDrop(int32_t, int32_t, nsISupports*, bool* _retval) { NS_ENSURE_ARG_POINTER(_retval); *_retval = false; @@ -406,7 +406,7 @@ nsNSSASN1Tree::CanDrop(int32_t, int32_t, nsIDOMDataTransfer*, bool* _retval) } NS_IMETHODIMP -nsNSSASN1Tree::Drop(int32_t, int32_t, nsIDOMDataTransfer*) +nsNSSASN1Tree::Drop(int32_t, int32_t, nsISupports*) { return NS_OK; } diff --git a/security/manager/ssl/nsCertTree.cpp b/security/manager/ssl/nsCertTree.cpp index 3463013f4d09..738285bfa864 100644 --- a/security/manager/ssl/nsCertTree.cpp +++ b/security/manager/ssl/nsCertTree.cpp @@ -1224,7 +1224,7 @@ nsCertTree::dumpMap() // CanDrop // NS_IMETHODIMP nsCertTree::CanDrop(int32_t index, int32_t orientation, - nsIDOMDataTransfer* aDataTransfer, bool *_retval) + nsISupports* aDataTransfer, bool *_retval) { NS_ENSURE_ARG_POINTER(_retval); *_retval = false; @@ -1236,7 +1236,8 @@ NS_IMETHODIMP nsCertTree::CanDrop(int32_t index, int32_t orientation, // // Drop // -NS_IMETHODIMP nsCertTree::Drop(int32_t row, int32_t orient, nsIDOMDataTransfer* aDataTransfer) +NS_IMETHODIMP nsCertTree::Drop(int32_t row, int32_t orient, + nsISupports* aDataTransfer) { return NS_OK; } diff --git a/taskcluster/scripts/misc/build-gcc-sixgill-plugin-linux.sh b/taskcluster/scripts/misc/build-gcc-sixgill-plugin-linux.sh index 98b004cbf632..9f97b3decc49 100755 --- a/taskcluster/scripts/misc/build-gcc-sixgill-plugin-linux.sh +++ b/taskcluster/scripts/misc/build-gcc-sixgill-plugin-linux.sh @@ -18,11 +18,11 @@ data_dir=$HOME_DIR/src/build/unix/build-gcc # Download and unpack upstream toolchain artifacts (ie, the gcc binary). . $(dirname $0)/tooltool-download.sh -gcc_version=4.9.4 -gcc_ext=bz2 +gcc_version=6.4.0 +gcc_ext=xz binutils_version=2.25.1 binutils_ext=bz2 -sixgill_rev=59b74c2e21bd +sixgill_rev=39b87ac48871 sixgill_repo=https://hg.mozilla.org/users/sfink_mozilla.com/sixgill . $data_dir/build-gcc.sh @@ -40,10 +40,9 @@ $GPG --import $data_dir/AD17A21EF8AED8F1CC02DBD9F7D5C9BF765C61E3.key cat > $HOME_DIR/checksums < + + + + diff --git a/testing/web-platform/tests/webmessaging/broadcastchannel/workers.html b/testing/web-platform/tests/webmessaging/broadcastchannel/workers.html index 7ccbd3957788..76d2f10d71fc 100644 --- a/testing/web-platform/tests/webmessaging/broadcastchannel/workers.html +++ b/testing/web-platform/tests/webmessaging/broadcastchannel/workers.html @@ -105,4 +105,20 @@ async_test(t => { }, 'Closing and re-opening a channel works.'); +async_test(t => { + function workerCode() { + close(); + var bc = new BroadcastChannel('worker-test'); + postMessage(true); + } + + var workerBlob = new Blob([workerCode.toSource() + ";workerCode();"], {type:"application/javascript"}); + + var w = new Worker(URL.createObjectURL(workerBlob)); + w.onmessage = function(e) { + assert_true(e.data, "BroadcastChannel created on worker shutdown."); + t.done(); + } +}, 'BroadcastChannel created after a worker self.close()'); + diff --git a/testing/web-platform/tests/webmessaging/message-channels/worker.html b/testing/web-platform/tests/webmessaging/message-channels/worker.html new file mode 100644 index 000000000000..be2155ee4b07 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/message-channels/worker.html @@ -0,0 +1,26 @@ + + + + + + diff --git a/testing/web-platform/tests/websockets/Create-on-worker-shutdown.html b/testing/web-platform/tests/websockets/Create-on-worker-shutdown.html new file mode 100644 index 000000000000..14128ef6f2fc --- /dev/null +++ b/testing/web-platform/tests/websockets/Create-on-worker-shutdown.html @@ -0,0 +1,31 @@ + + + + W3C WebSocket API - Create WebSocket - on a worker after self.close() + + + + + +
+ + + diff --git a/toolkit/components/telemetry/TelemetryEnvironment.jsm b/toolkit/components/telemetry/TelemetryEnvironment.jsm index 5a81c5fc10c8..f0b085171e76 100644 --- a/toolkit/components/telemetry/TelemetryEnvironment.jsm +++ b/toolkit/components/telemetry/TelemetryEnvironment.jsm @@ -247,6 +247,7 @@ const DEFAULT_ENVIRONMENT_PREFS = new Map([ ["layers.prefer-opengl", {what: RECORD_PREF_VALUE}], ["layout.css.devPixelsPerPx", {what: RECORD_PREF_VALUE}], ["layout.css.servo.enabled", {what: RECORD_PREF_VALUE}], + ["marionette.enabled", {what: RECORD_PREF_VALUE}], ["network.proxy.autoconfig_url", {what: RECORD_PREF_STATE}], ["network.proxy.http", {what: RECORD_PREF_STATE}], ["network.proxy.ssl", {what: RECORD_PREF_STATE}], diff --git a/toolkit/components/telemetry/parse_scalars.py b/toolkit/components/telemetry/parse_scalars.py index 23e2049bb83a..911111c8bd35 100755 --- a/toolkit/components/telemetry/parse_scalars.py +++ b/toolkit/components/telemetry/parse_scalars.py @@ -4,9 +4,11 @@ import re import yaml +import atexit import shared_telemetry_utils as utils from shared_telemetry_utils import ParserError +atexit.register(ParserError.exit_func) # The map of containing the allowed scalar types and their mapping to # nsITelemetry::SCALAR_TYPE_* type constants. @@ -55,22 +57,24 @@ class ScalarType: MAX_NAME_LENGTH = 40 for n in [category_name, probe_name]: if len(n) > MAX_NAME_LENGTH: - raise ParserError(("Name '{}' exceeds maximum name length of {} characters.\n" - "See: {}#the-yaml-definition-file") - .format(n, MAX_NAME_LENGTH, BASE_DOC_URL)) + ParserError(("Name '{}' exceeds maximum name length of {} characters.\n" + "See: {}#the-yaml-definition-file") + .format(n, MAX_NAME_LENGTH, BASE_DOC_URL)).handle_later() def check_name(name, error_msg_prefix, allowed_char_regexp): # Check if we only have the allowed characters. chars_regxp = r'^[a-zA-Z0-9' + allowed_char_regexp + r']+$' if not re.search(chars_regxp, name): - raise ParserError((error_msg_prefix + " name must be alpha-numeric. Got: '{}'.\n" - "See: {}#the-yaml-definition-file").format(name, BASE_DOC_URL)) + ParserError((error_msg_prefix + " name must be alpha-numeric. Got: '{}'.\n" + "See: {}#the-yaml-definition-file") + .format(name, BASE_DOC_URL)).handle_later() # Don't allow leading/trailing digits, '.' or '_'. if re.search(r'(^[\d\._])|([\d\._])$', name): - raise ParserError((error_msg_prefix + " name must not have a leading/trailing " - "digit, a dot or underscore. Got: '{}'.\n" - " See: {}#the-yaml-definition-file").format(name, BASE_DOC_URL)) + ParserError((error_msg_prefix + " name must not have a leading/trailing " + "digit, a dot or underscore. Got: '{}'.\n" + " See: {}#the-yaml-definition-file") + .format(name, BASE_DOC_URL)).handle_later() check_name(category_name, 'Category', r'\.') check_name(probe_name, 'Probe', r'_') @@ -118,23 +122,23 @@ class ScalarType: # Checks that all the required fields are available. missing_fields = [f for f in REQUIRED_FIELDS.keys() if f not in definition] if len(missing_fields) > 0: - raise ParserError(self._name + ' - missing required fields: ' + - ', '.join(missing_fields) + - '.\nSee: {}#required-fields'.format(BASE_DOC_URL)) + ParserError(self._name + ' - missing required fields: ' + + ', '.join(missing_fields) + + '.\nSee: {}#required-fields'.format(BASE_DOC_URL)).handle_later() # Do we have any unknown field? unknown_fields = [f for f in definition.keys() if f not in ALL_FIELDS] if len(unknown_fields) > 0: - raise ParserError(self._name + ' - unknown fields: ' + ', '.join(unknown_fields) + - '.\nSee: {}#required-fields'.format(BASE_DOC_URL)) + ParserError(self._name + ' - unknown fields: ' + ', '.join(unknown_fields) + + '.\nSee: {}#required-fields'.format(BASE_DOC_URL)).handle_later() # Checks the type for all the fields. wrong_type_names = ['{} must be {}'.format(f, ALL_FIELDS[f].__name__) for f in definition.keys() if not isinstance(definition[f], ALL_FIELDS[f])] if len(wrong_type_names) > 0: - raise ParserError(self._name + ' - ' + ', '.join(wrong_type_names) + - '.\nSee: {}#required-fields'.format(BASE_DOC_URL)) + ParserError(self._name + ' - ' + ', '.join(wrong_type_names) + + '.\nSee: {}#required-fields'.format(BASE_DOC_URL)).handle_later() # Check that the lists are not empty and that data in the lists # have the correct types. @@ -142,17 +146,17 @@ class ScalarType: for field in list_fields: # Check for empty lists. if len(definition[field]) == 0: - raise ParserError(("Field '{}' for probe '{}' must not be empty" + - ".\nSee: {}#required-fields)") - .format(field, self._name, BASE_DOC_URL)) + ParserError(("Field '{}' for probe '{}' must not be empty" + + ".\nSee: {}#required-fields)") + .format(field, self._name, BASE_DOC_URL)).handle_later() # Check the type of the list content. broken_types =\ [not isinstance(v, LIST_FIELDS_CONTENT[field]) for v in definition[field]] if any(broken_types): - raise ParserError(("Field '{}' for probe '{}' must only contain values of type {}" - ".\nSee: {}#the-yaml-definition-file)") - .format(field, self._name, LIST_FIELDS_CONTENT[field].__name__, - BASE_DOC_URL)) + ParserError(("Field '{}' for probe '{}' must only contain values of type {}" + ".\nSee: {}#the-yaml-definition-file)") + .format(field, self._name, LIST_FIELDS_CONTENT[field].__name__, + BASE_DOC_URL)).handle_later() def validate_values(self, definition): """This function checks that the fields have the correct values. @@ -167,27 +171,27 @@ class ScalarType: # Validate the scalar kind. scalar_kind = definition.get('kind') if scalar_kind not in SCALAR_TYPES_MAP.keys(): - raise ParserError(self._name + ' - unknown scalar kind: ' + scalar_kind + - '.\nSee: {}'.format(BASE_DOC_URL)) + ParserError(self._name + ' - unknown scalar kind: ' + scalar_kind + + '.\nSee: {}'.format(BASE_DOC_URL)).handle_later() # Validate the collection policy. collection_policy = definition.get('release_channel_collection', None) if collection_policy and collection_policy not in ['opt-in', 'opt-out']: - raise ParserError(self._name + ' - unknown collection policy: ' + collection_policy + - '.\nSee: {}#optional-fields'.format(BASE_DOC_URL)) + ParserError(self._name + ' - unknown collection policy: ' + collection_policy + + '.\nSee: {}#optional-fields'.format(BASE_DOC_URL)).handle_later() # Validate the cpp_guard. cpp_guard = definition.get('cpp_guard') if cpp_guard and re.match(r'\W', cpp_guard): - raise ParserError(self._name + ' - invalid cpp_guard: ' + cpp_guard + - '.\nSee: {}#optional-fields'.format(BASE_DOC_URL)) + ParserError(self._name + ' - invalid cpp_guard: ' + cpp_guard + + '.\nSee: {}#optional-fields'.format(BASE_DOC_URL)).handle_later() # Validate record_in_processes. record_in_processes = definition.get('record_in_processes', []) for proc in record_in_processes: if not utils.is_valid_process_name(proc): - raise ParserError(self._name + ' - unknown value in record_in_processes: ' + proc + - '.\nSee: {}'.format(BASE_DOC_URL)) + ParserError(self._name + ' - unknown value in record_in_processes: ' + proc + + '.\nSee: {}'.format(BASE_DOC_URL)).handle_later() # Validate the expiration version. # Historical versions of Scalars.json may contain expiration versions @@ -195,8 +199,8 @@ class ScalarType: # self._strict_type_checks to false. expires = definition.get('expires') if not utils.validate_expiration_version(expires) and self._strict_type_checks: - raise ParserError('{} - invalid expires: {}.\nSee: {}#required-fields' - .format(self._name, expires, BASE_DOC_URL)) + ParserError('{} - invalid expires: {}.\nSee: {}#required-fields' + .format(self._name, expires, BASE_DOC_URL)).handle_later() @property def category(self): @@ -303,10 +307,10 @@ def load_scalars(filename, strict_type_checks=True): with open(filename, 'r') as f: scalars = yaml.safe_load(f) except IOError, e: - raise ParserError('Error opening ' + filename + ': ' + e.message) + ParserError('Error opening ' + filename + ': ' + e.message).handle_now() except ValueError, e: - raise ParserError('Error parsing scalars in {}: {}' - '.\nSee: {}'.format(filename, e.message, BASE_DOC_URL)) + ParserError('Error parsing scalars in {}: {}' + '.\nSee: {}'.format(filename, e.message, BASE_DOC_URL)).handle_now() scalar_list = [] @@ -318,8 +322,8 @@ def load_scalars(filename, strict_type_checks=True): # Make sure that the category has at least one probe in it. if not category or len(category) == 0: - raise ParserError('Category "{}" must have at least one probe in it' + - '.\nSee: {}'.format(category_name, BASE_DOC_URL)) + ParserError('Category "{}" must have at least one probe in it' + '.\nSee: {}'.format(category_name, BASE_DOC_URL)).handle_later() for probe_name in category: # We found a scalar type. Go ahead and parse it. diff --git a/toolkit/library/rust/shared/Cargo.toml b/toolkit/library/rust/shared/Cargo.toml index 4e75f3d39eb8..e02d948a0afe 100644 --- a/toolkit/library/rust/shared/Cargo.toml +++ b/toolkit/library/rust/shared/Cargo.toml @@ -22,6 +22,7 @@ encoding_glue = { path = "../../../../intl/encoding_glue" } audioipc-client = { path = "../../../../media/audioipc/client", optional = true } audioipc-server = { path = "../../../../media/audioipc/server", optional = true } u2fhid = { path = "../../../../dom/webauthn/u2f-hid-rs" } +rsdparsa_capi = { path = "../../../../media/webrtc/signaling/src/sdp/rsdparsa_capi" } # We have these to enforce common feature sets for said crates. log = {version = "0.3", features = ["release_max_level_info"]} syn = { version = "0.11", features = ["full", "visit", "parsing"] } diff --git a/toolkit/library/rust/shared/lib.rs b/toolkit/library/rust/shared/lib.rs index 5152f6f74462..8ea96751471d 100644 --- a/toolkit/library/rust/shared/lib.rs +++ b/toolkit/library/rust/shared/lib.rs @@ -26,6 +26,7 @@ extern crate u2fhid; extern crate log; extern crate syn; extern crate cosec; +extern crate rsdparsa_capi; use std::boxed::Box; use std::ffi::CStr; diff --git a/toolkit/profile/nsIToolkitProfile.idl b/toolkit/profile/nsIToolkitProfile.idl index 9be53e603cec..4409c43c65a0 100644 --- a/toolkit/profile/nsIToolkitProfile.idl +++ b/toolkit/profile/nsIToolkitProfile.idl @@ -77,8 +77,12 @@ interface nsIToolkitProfile : nsISupports /** * Removes the profile from the registry of profiles. * The profile directory is removed in the stream transport thread. + * + * @param removeFiles + * Indicates whether or not the profile directory should be + * removed in addition. */ - void removeInBackground(); + void removeInBackground(in boolean removeFiles); /** * Lock this profile using platform-specific locking methods. diff --git a/toolkit/profile/nsToolkitProfileService.cpp b/toolkit/profile/nsToolkitProfileService.cpp index fcb370a6750b..5b8f880886dc 100644 --- a/toolkit/profile/nsToolkitProfileService.cpp +++ b/toolkit/profile/nsToolkitProfileService.cpp @@ -284,9 +284,9 @@ nsToolkitProfile::Remove(bool removeFiles) } NS_IMETHODIMP -nsToolkitProfile::RemoveInBackground() +nsToolkitProfile::RemoveInBackground(bool removeFiles) { - return RemoveInternal(true /* remove Files */, true /* in background */); + return RemoveInternal(removeFiles, true /* in background */); } NS_IMETHODIMP diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm index fd55ccba3e50..9d8a117dcc85 100644 --- a/widget/cocoa/nsChildView.mm +++ b/widget/cocoa/nsChildView.mm @@ -17,6 +17,7 @@ #include "mozilla/MouseEvents.h" #include "mozilla/TextEvents.h" #include "mozilla/TouchEvents.h" +#include "mozilla/dom/DataTransfer.h" #include "mozilla/dom/SimpleGestureEventBinding.h" #include "nsArrayUtils.h" @@ -6260,10 +6261,10 @@ GetIntegerDeltaForEvent(NSEvent* aEvent) // value for NSDragOperationGeneric that is passed by other applications. // All that said, NSDragOperationNone is still reliable. if (aOperation == NSDragOperationNone) { - nsCOMPtr dataTransfer; - dragService->GetDataTransfer(getter_AddRefs(dataTransfer)); - if (dataTransfer) + RefPtr dataTransfer = dragService->GetDataTransfer(); + if (dataTransfer) { dataTransfer->SetDropEffectInt(nsIDragService::DRAGDROP_ACTION_NONE); + } } mDragService->EndDragSession( diff --git a/widget/nsBaseDragService.cpp b/widget/nsBaseDragService.cpp index 727b975895ef..846662e4ed9e 100644 --- a/widget/nsBaseDragService.cpp +++ b/widget/nsBaseDragService.cpp @@ -23,11 +23,11 @@ #include "nsISelection.h" #include "nsISelectionPrivate.h" #include "nsPresContext.h" -#include "nsIDOMDataTransfer.h" #include "nsIImageLoadingContent.h" #include "imgIContainer.h" #include "imgIRequest.h" #include "ImageRegion.h" +#include "nsQueryObject.h" #include "nsRegion.h" #include "nsXULPopupManager.h" #include "nsMenuPopupFrame.h" @@ -35,6 +35,7 @@ #include "mozilla/MouseEvents.h" #include "mozilla/Preferences.h" #include "mozilla/dom/DataTransferItemList.h" +#include "mozilla/dom/DataTransfer.h" #include "mozilla/gfx/2D.h" #include "mozilla/Unused.h" #include "nsFrameLoader.h" @@ -201,7 +202,7 @@ nsBaseDragService::IsDataFlavorSupported(const char *aDataFlavor, } NS_IMETHODIMP -nsBaseDragService::GetDataTransfer(nsIDOMDataTransfer** aDataTransfer) +nsBaseDragService::GetDataTransferXPCOM(nsISupports** aDataTransfer) { *aDataTransfer = mDataTransfer; NS_IF_ADDREF(*aDataTransfer); @@ -209,10 +210,24 @@ nsBaseDragService::GetDataTransfer(nsIDOMDataTransfer** aDataTransfer) } NS_IMETHODIMP -nsBaseDragService::SetDataTransfer(nsIDOMDataTransfer* aDataTransfer) +nsBaseDragService::SetDataTransferXPCOM(nsISupports* aDataTransfer) +{ + RefPtr dataTransfer = do_QueryObject(aDataTransfer); + NS_ENSURE_STATE(dataTransfer); + mDataTransfer = dataTransfer.forget(); + return NS_OK; +} + +DataTransfer* +nsBaseDragService::GetDataTransfer() +{ + return mDataTransfer; +} + +void +nsBaseDragService::SetDataTransfer(DataTransfer* aDataTransfer) { mDataTransfer = aDataTransfer; - return NS_OK; } //------------------------------------------------------------------------- @@ -265,7 +280,7 @@ nsBaseDragService::InvokeDragSessionWithImage(nsIDOMNode* aDOMNode, nsIDOMNode* aImage, int32_t aImageX, int32_t aImageY, nsIDOMDragEvent* aDragEvent, - nsIDOMDataTransfer* aDataTransfer) + DataTransfer* aDataTransfer) { NS_ENSURE_TRUE(aDragEvent, NS_ERROR_NULL_POINTER); NS_ENSURE_TRUE(aDataTransfer, NS_ERROR_NULL_POINTER); @@ -302,7 +317,7 @@ nsBaseDragService::InvokeDragSessionWithSelection(nsISelection* aSelection, nsIArray* aTransferableArray, uint32_t aActionType, nsIDOMDragEvent* aDragEvent, - nsIDOMDataTransfer* aDataTransfer) + DataTransfer* aDataTransfer) { NS_ENSURE_TRUE(aSelection, NS_ERROR_NULL_POINTER); NS_ENSURE_TRUE(aDragEvent, NS_ERROR_NULL_POINTER); @@ -461,9 +476,9 @@ void nsBaseDragService::DiscardInternalTransferData() { if (mDataTransfer && mSourceNode) { - MOZ_ASSERT(!!DataTransfer::Cast(mDataTransfer)); + MOZ_ASSERT(mDataTransfer); - DataTransferItemList* items = DataTransfer::Cast(mDataTransfer)->Items(); + DataTransferItemList* items = mDataTransfer->Items(); for (size_t i = 0; i < items->Length(); i++) { bool found; DataTransferItem* item = items->IndexedGetter(i, found); diff --git a/widget/nsBaseDragService.h b/widget/nsBaseDragService.h index 3ba847c9be2b..4a578c2ee7d2 100644 --- a/widget/nsBaseDragService.h +++ b/widget/nsBaseDragService.h @@ -10,7 +10,6 @@ #include "nsIDragSession.h" #include "nsITransferable.h" #include "nsIDOMDocument.h" -#include "nsIDOMDataTransfer.h" #include "nsCOMPtr.h" #include "nsRect.h" #include "nsPoint.h" @@ -33,6 +32,10 @@ namespace mozilla { namespace gfx { class SourceSurface; } // namespace gfx + +namespace dom { +class DataTransfer; +} // namespace dom } // namespace mozilla /** @@ -165,7 +168,7 @@ protected: // if it came from outside the app. nsContentPolicyType mContentPolicyType; // the contentpolicy type passed to the channel // when initiating the drag session - nsCOMPtr mDataTransfer; + RefPtr mDataTransfer; // used to determine the image to appear on the cursor while dragging nsCOMPtr mImage; diff --git a/widget/nsIDragService.idl b/widget/nsIDragService.idl index b37f8f165d70..3e5ea8ab9b0f 100644 --- a/widget/nsIDragService.idl +++ b/widget/nsIDragService.idl @@ -12,7 +12,6 @@ interface nsIDOMNode; interface nsIDOMDragEvent; -interface nsIDOMDataTransfer; interface nsISelection; %{C++ @@ -21,11 +20,13 @@ interface nsISelection; namespace mozilla { namespace dom { class ContentParent; +class DataTransfer; } // namespace dom } // namespace mozilla %} [ptr] native ContentParentPtr(mozilla::dom::ContentParent); +[ptr] native DataTransferPtr(mozilla::dom::DataTransfer); native EventMessage(mozilla::EventMessage); [scriptable, uuid(ebd6b3a2-af16-43af-a698-3091a087dd62), builtinclass] @@ -86,6 +87,7 @@ interface nsIDragService : nsISupports * The aDragEvent must be supplied as the current screen coordinates of the * event are needed to calculate the image location. */ + [noscript] void invokeDragSessionWithImage(in nsIDOMNode aDOMNode, in AUTF8String aPrincipalURISpec, in nsIArray aTransferableArray, @@ -95,7 +97,7 @@ interface nsIDragService : nsISupports in long aImageX, in long aImageY, in nsIDOMDragEvent aDragEvent, - in nsIDOMDataTransfer aDataTransfer); + in DataTransferPtr aDataTransfer); /** * Start a modal drag session using the selection as the drag image. @@ -109,12 +111,12 @@ interface nsIDragService : nsISupports in nsIArray aTransferableArray, in unsigned long aActionType, in nsIDOMDragEvent aDragEvent, - in nsIDOMDataTransfer aDataTransfer); + in DataTransferPtr aDataTransfer); /** - * Returns the current Drag Session + * Returns the current Drag Session */ - nsIDragSession getCurrentSession ( ) ; + nsIDragSession getCurrentSession(); /** * Tells the Drag Service to start a drag session. This is called when diff --git a/widget/nsIDragSession.idl b/widget/nsIDragSession.idl index 316736fa4b2e..936b4a764b29 100644 --- a/widget/nsIDragSession.idl +++ b/widget/nsIDragSession.idl @@ -10,16 +10,21 @@ %{ C++ #include "nsSize.h" + +namespace mozilla { +namespace dom { +class DataTransfer; +} // namespace dom +} // namespace mozilla %} native nsSize (nsSize); - +[ptr] native DataTransferPtr(mozilla::dom::DataTransfer); interface nsIDOMDocument; interface nsIDOMNode; -interface nsIDOMDataTransfer; -[scriptable, uuid(25bce737-73f0-43c7-bc20-c71044a73c5a)] +[scriptable, builtinclass, uuid(25bce737-73f0-43c7-bc20-c71044a73c5a)] interface nsIDragSession : nsISupports { /** @@ -70,13 +75,17 @@ interface nsIDragSession : nsISupports attribute AUTF8String triggeringPrincipalURISpec; /** - * The data transfer object for the current drag. + * The data transfer object for the current drag. Should become a + * DataTransfer once bug 1444991 is fixed. */ - attribute nsIDOMDataTransfer dataTransfer; + [binaryname(DataTransferXPCOM)] + attribute nsISupports dataTransfer; + [notxpcom, nostdcall] DataTransferPtr getDataTransfer(); + [notxpcom, nostdcall] void setDataTransfer(in DataTransferPtr aDataTransfer); /** * Get data from a Drag&Drop. Can be called while the drag is in process - * or after the drop has completed. + * or after the drop has completed. * * @param aTransferable the transferable for the data to be put into * @param aItemIndex which of multiple drag items, zero-based diff --git a/widget/windows/nsDragService.cpp b/widget/windows/nsDragService.cpp index a6c4a749183b..3bb1c19638b8 100644 --- a/widget/windows/nsDragService.cpp +++ b/widget/windows/nsDragService.cpp @@ -326,7 +326,7 @@ nsDragService::StartInvokingDragSession(IDataObject * aDataObj, HRESULT res = ::DoDragDrop(aDataObj, nativeDragSrc, effects, &winDropRes); // In cases where the drop operation completed outside the application, update - // the source node's nsIDOMDataTransfer dropEffect value so it is up to date. + // the source node's DataTransfer dropEffect value so it is up to date. if (!mSentLocalDropEvent) { uint32_t dropResult; // Order is important, since multiple flags can be returned. diff --git a/widget/windows/nsNativeDragSource.cpp b/widget/windows/nsNativeDragSource.cpp index 857907076703..380a3077cd91 100644 --- a/widget/windows/nsNativeDragSource.cpp +++ b/widget/windows/nsNativeDragSource.cpp @@ -15,12 +15,12 @@ /* * class nsNativeDragSource */ -nsNativeDragSource::nsNativeDragSource(nsIDOMDataTransfer* aDataTransfer) : +nsNativeDragSource::nsNativeDragSource(mozilla::dom::DataTransfer* aDataTransfer) : m_cRef(0), m_hCursor(nullptr), mUserCancelled(false) { - mDataTransfer = do_QueryInterface(aDataTransfer); + mDataTransfer = aDataTransfer; } nsNativeDragSource::~nsNativeDragSource() diff --git a/widget/windows/nsNativeDragSource.h b/widget/windows/nsNativeDragSource.h index 9172291fb129..e1ccba9b1c69 100644 --- a/widget/windows/nsNativeDragSource.h +++ b/widget/windows/nsNativeDragSource.h @@ -6,11 +6,16 @@ #define _nsNativeDragSource_h_ #include "nscore.h" -#include "nsIDOMDataTransfer.h" -#include "nsCOMPtr.h" #include #include #include "mozilla/Attributes.h" +#include "mozilla/RefPtr.h" + +namespace mozilla { +namespace dom { +class DataTransfer; +} // namespace dom +} // namespace mozilla //class nsIDragSource; @@ -24,7 +29,7 @@ public: // construct an nsNativeDragSource referencing adapter // nsNativeDragSource(nsIDragSource * adapter); - explicit nsNativeDragSource(nsIDOMDataTransfer* aDataTransfer); + explicit nsNativeDragSource(mozilla::dom::DataTransfer* aDataTransfer); ~nsNativeDragSource(); // IUnknown methods - see iunknown.h for documentation @@ -53,7 +58,7 @@ protected: ULONG m_cRef; // Data object, hold information about cursor state - nsCOMPtr mDataTransfer; + RefPtr mDataTransfer; // Custom drag cursor HCURSOR m_hCursor; diff --git a/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp b/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp index 325957dbd025..c74ec26cc947 100644 --- a/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp +++ b/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp @@ -15,13 +15,11 @@ #ifdef MOZ_WEBRTC #include "nsIDOMDataChannel.h" #endif -#include "nsIDOMDataTransfer.h" #include "nsIDOMDOMCursor.h" #include "nsIDOMDOMException.h" #include "nsIDOMDOMRequest.h" #include "nsIDOMDocument.h" #include "nsIDOMDocumentFragment.h" -#include "nsIDOMDocumentType.h" #include "nsIDOMDragEvent.h" #include "nsIDOMElement.h" #include "nsIDOMEvent.h" @@ -66,14 +64,12 @@ #include "mozilla/dom/CSSValueBinding.h" #include "mozilla/dom/CSSValueListBinding.h" #include "mozilla/dom/CustomEventBinding.h" -#include "mozilla/dom/DataTransferBinding.h" #include "mozilla/dom/DOMCursorBinding.h" #include "mozilla/dom/DOMExceptionBinding.h" #include "mozilla/dom/DOMParserBinding.h" #include "mozilla/dom/DOMRequestBinding.h" #include "mozilla/dom/DocumentBinding.h" #include "mozilla/dom/DocumentFragmentBinding.h" -#include "mozilla/dom/DocumentTypeBinding.h" #include "mozilla/dom/DragEventBinding.h" #include "mozilla/dom/ElementBinding.h" #include "mozilla/dom/EventBinding.h" @@ -183,13 +179,11 @@ const ComponentsInterfaceShimEntry kComponentsInterfaceShimMap[] = DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMClientRectList, DOMRectList), DEFINE_SHIM(Comment), DEFINE_SHIM(CustomEvent), - DEFINE_SHIM(DataTransfer), DEFINE_SHIM(DOMCursor), DEFINE_SHIM(DOMException), DEFINE_SHIM(DOMRequest), DEFINE_SHIM(Document), DEFINE_SHIM(DocumentFragment), - DEFINE_SHIM(DocumentType), DEFINE_SHIM(DragEvent), DEFINE_SHIM(Element), DEFINE_SHIM(Event),