diff --git a/devtools/client/debugger/new/debugger.css b/devtools/client/debugger/new/debugger.css index 84171bea14c5..f2a611f34192 100644 --- a/devtools/client/debugger/new/debugger.css +++ b/devtools/client/debugger/new/debugger.css @@ -12,7 +12,7 @@ /* Customs properties */ --title-font-size: 24px; --ui-element-font-size: 16px; - --primary-line-height: 30px; + --primary-line-height: 22px; --secondary-line-height: 25px; --base-spacing: 20px; --base-transition: all 0.25s ease; @@ -55,7 +55,7 @@ justify-content: center; } -.landing-page .panel input[type=button] { +.landing-page button { background-color: var(--theme-tab-toolbar-background); color: var(--theme-comment); font-size: var(--ui-element-font-size); @@ -63,6 +63,7 @@ padding: calc(var(--base-spacing) / 2); margin: 0 var(--base-spacing); transition: var(--base-transition); + cursor: pointer; } .landing-page .panel header h1 { @@ -103,6 +104,27 @@ font-size: 14px; color: var(--theme-comment); } + +.landing-page .panel .launch-action-container { + text-align: center; +} + +.landing-page .panel .under-construction { + display: flex; + width: 417px; + color: var(--theme-comment); + font-size: calc(var(--ui-element-font-size) / 1); + margin: var(--base-spacing) auto; + line-height: 1.4em; +} + +.landing-page .panel .under-construction .under-construction-message { + max-width: 350px; +} + +.landing-page .panel .under-construction .github-link { + display: block; +} /* This Source Code Form is subject to the terms of 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/. */ @@ -170,9 +192,10 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ .landing-page .sidebar { + --sidebar-width: 200px; display: flex; background-color: var(--theme-tab-toolbar-background); - width: 200px; + width: var(--sidebar-width); flex-direction: column; border-right: 1px solid var(--theme-splitter-color); } @@ -182,8 +205,8 @@ font-size: var(--title-font-size); margin: 0; line-height: var(--primary-line-height); - font-weight: normal; - padding: calc(2 * var(--base-spacing)) var(--base-spacing); + font-weight: bold; + padding: var(--base-spacing) var(--base-spacing); } .landing-page .sidebar ul { @@ -222,6 +245,35 @@ .landing-page .sidebar li:focus a { color: inherit; } + +.landing-page .sidebar li:last-child { + border-top: 2px solid var(--theme-splitter-color); + margin: 2px; +} + +.landing-page .sidebar .title-wrapper .launchpad-container { + padding-left: var(--base-spacing); +} + +.landing-page .sidebar .title-wrapper .launchpad-container .launchpad-container-icon { + display: inline-block; +} + +.landing-page .sidebar .title-wrapper .launchpad-container svg { + width: 24px; + height: 24px; +} + +.landing-page .sidebar .title-wrapper .launchpad-container svg path { + width: 24px; + height: 24px; + fill: var(--theme-body-color); +} + +.landing-page .sidebar .title-wrapper .launchpad-container .launchpad-container-title { + display: inline; + padding-left: 3px; +} /* This Source Code Form is subject to the terms of 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/. */ @@ -439,11 +491,11 @@ menuitem:hover { color: white; } -menuitem[disabled=true] { +menuitem[disabled="true"] { color: #cccccc; } -menuitem[disabled=true]:hover { +menuitem[disabled="true"]:hover { background-color: transparent; cursor: default; } @@ -1006,13 +1058,14 @@ html[dir="rtl"] .managed-tree .tree .node > div { display: flex; flex-direction: column; overflow-y: hidden; + height: 100%; } .project-text-search .result { display: flex; cursor: default; - margin-bottom: 1px; padding: 4px 0 4px 30px; + line-height: 16px; font-size: 10px; } @@ -1049,8 +1102,7 @@ html[dir="rtl"] .managed-tree .tree .node > div { font-weight: bold; line-height: 20px; cursor: default; - margin: 2px 0; - padding: 3px 0 3px 5px; + padding: 2px 0 2px 5px; font-size: 12px; } @@ -1075,6 +1127,11 @@ html[dir="rtl"] .managed-tree .tree .node > div { .project-text-search .managed-tree { overflow-y: auto; + height: calc(100% - 81px); +} + +.project-text-search .managed-tree .tree { + height: 100%; } .autocomplete { position: relative; @@ -1132,7 +1189,7 @@ html[dir="rtl"] .managed-tree .tree .node > div { color: white; } -.theme-dark .result-list.small li.selected { +.theme-dark .result-list.small li.selected { background-color: var(--theme-body-background); } @@ -1324,7 +1381,7 @@ html[dir="rtl"] .managed-tree .tree .node > div { transition: all 0.25s ease; overflow: hidden; padding: 5px; - margin-bottom: 4px; + margin-bottom: 0px; margin-top: -1px; } @@ -1925,7 +1982,7 @@ html[dir="rtl"] .arrow svg, .bracket-arrow::before, .bracket-arrow::after { - content: ''; + content: ""; height: 0; width: 0; position: absolute; @@ -1970,7 +2027,7 @@ html[dir="rtl"] .arrow svg, height: 5px; padding-top: 5px; } -.popover .preview { +.popover .preview-popup { background: var(--theme-body-background); width: 350px; min-height: 80px; @@ -1983,11 +2040,11 @@ html[dir="rtl"] .arrow svg, box-shadow: 1px 2px 3px var(--popup-shadow-color); } -.theme-dark .popover .preview { +.theme-dark .popover .preview-popup { box-shadow: 1px 2px 3px var(--popup-shadow-color); } -.popover .preview .header { +.popover .preview-popup .header { width: 100%; line-height: 20px; border-bottom: 1px solid #cccccc; @@ -1995,36 +2052,40 @@ html[dir="rtl"] .arrow svg, flex-direction: column; } -.popover .preview .header .link { +.popover .preview-popup .header .link { align-self: flex-end; color: var(--theme-highlight-blue); text-decoration: underline; } -.selection, -.debug-expression.selection { +.preview-selection:hover { + cursor: default; +} + +.preview-selection, +.debug-expression.preview-selection { background-color: var(--theme-highlight-yellow); } -.theme-dark .selection, -.theme-dark .debug-expression.selection { +.theme-dark .preview-selection, +.theme-dark .debug-expression.preview-selection { background-color: #743884; } -.theme-dark .cm-s-mozilla .selection, -.theme-dark .cm-s-mozilla .debug-expression.selection { +.theme-dark .cm-s-mozilla .preview-selection, +.theme-dark .cm-s-mozilla .debug-expression.preview-selection { color: #e7ebee; } -.popover .preview .function-signature { +.popover .preview-popup .function-signature { padding-top: 10px; } -.theme-dark .popover .preview { +.theme-dark .popover .preview-popup { border-color: var(--theme-body-color); } -.theme-dark .popover .preview .arrow svg { +.theme-dark .popover .preview-popup .arrow svg { fill: var(--theme-content-color3); } @@ -2033,7 +2094,7 @@ html[dir="rtl"] .arrow svg, z-index: 100; } -.tooltip .preview { +.tooltip .preview-popup { background: var(--theme-toolbar-background); max-width: inherit; min-height: 80px; @@ -2046,7 +2107,7 @@ html[dir="rtl"] .arrow svg, overflow: auto; } -.theme-dark .tooltip .preview { +.theme-dark .tooltip .preview-popup { border-color: var(--theme-body-color); } @@ -2128,6 +2189,9 @@ html[dir="rtl"] .arrow svg, .theme-dark .call-site-bp::before { border-bottom-color: #dd4d4d; } +.empty-line .CodeMirror-linenumber { + opacity: 0.5; +} .editor-wrapper { --debug-line-border: rgb(145, 188, 219); --debug-expression-background: rgba(202, 227, 255, 0.5); @@ -2827,6 +2891,10 @@ html .breakpoints-list .breakpoint.paused { font-size: 12px; } +.accordion div:last-child ._content { + border-bottom: none; +} + .accordion ._header .header-buttons { display: flex; margin-left: auto; @@ -2864,6 +2932,10 @@ html .breakpoints-list .breakpoint.paused { background-color: var(--theme-body-background); } +.command-bar.vertical { + width: 100vw; +} + html[dir="rtl"] .command-bar { border-right: 1px solid var(--theme-splitter-color); } @@ -3016,6 +3088,11 @@ html .command-bar > button:disabled { z-index: 100; } +.alignlabel { + display: inline-block; + text-align: left; +} + .welcomebox .toggle-button-end { position: absolute; top: auto; @@ -3041,15 +3118,21 @@ html .welcomebox .toggle-button-end.collapsed { } .source-header .new-tab-btn { - padding: 0px 4px; + padding: 4px; margin-top: 4px; + margin-left: 2px; fill: var(--theme-content-color3); transition: 0.1s ease; align-self: center; } +.source-header .new-tab-btn:hover { + background-color: var(--theme-toolbar-background-hover); +} + .source-header .new-tab-btn svg { width: 12px; + display: block; } .source-tabs { diff --git a/devtools/client/debugger/new/debugger.js b/devtools/client/debugger/new/debugger.js index 2bfeac5341ee..f37e5451c94a 100644 --- a/devtools/client/debugger/new/debugger.js +++ b/devtools/client/debugger/new/debugger.js @@ -540,7 +540,7 @@ function isDirectory(url) { } function isInvalidUrl(url, source) { - return IGNORED_URLS.indexOf(url) != -1 || !source.get("url") || source.get("loading") || !url.group || (0, _source.isPretty)(source.toJS()); + return IGNORED_URLS.indexOf(url) != -1 || !source.get("url") || source.get("loadedState") === "loading" || !url.group || (0, _source.isPretty)(source.toJS()); } function partIsFile(index, parts, url) { @@ -710,8 +710,8 @@ function getWasmText(sourceId, data) { result = { lines: ["No luck with wast conversion"], offsets: [0], done }; } - var offsets = result.offsets, - lines = []; + var offsets = result.offsets; + var lines = []; for (var i = 0; i < offsets.length; i++) { lines[offsets[i]] = i; } @@ -5906,7 +5906,7 @@ var _require6 = __webpack_require__(1130), showMenu = _require6.showMenu, buildMenu = _require6.buildMenu; -setConfig({"environment":"firefox-panel","logging":false,"clientLogging":false,"firefox":{"mcPath":"./firefox"},"workers":{"parserURL":"resource://devtools/client/debugger/new/parser-worker.js","prettyPrintURL":"resource://devtools/client/debugger/new/pretty-print-worker.js","searchURL":"resource://devtools/client/debugger/new/search-worker.js"},"features":{"blackbox":{"enabled":true},"chromeScopes":{"enabled":false},"eventListeners":{"enabled":false},"codeCoverage":{"enabled":false},"codeFolding":{"enabled":false},"searchNav":{"enabled":true},"collapseFrame":{"enabled":true},"outline":{"enabled":true}}}); +setConfig({"environment":"firefox-panel","logging":false,"clientLogging":false,"firefox":{"mcPath":"./firefox"},"workers":{"parserURL":"resource://devtools/client/debugger/new/parser-worker.js","prettyPrintURL":"resource://devtools/client/debugger/new/pretty-print-worker.js","searchURL":"resource://devtools/client/debugger/new/search-worker.js"},"features":{"blackbox":{"enabled":true},"chromeScopes":{"enabled":false},"eventListeners":{"enabled":false},"codeCoverage":{"enabled":false},"codeFolding":{"enabled":false},"searchNav":{"enabled":true},"collapseFrame":{"enabled":true},"outline":{"enabled":true},"wasm":{"enabled":true}}}); // Set various flags before requiring app code. if (getValue("logging.client")) { @@ -6773,13 +6773,15 @@ var sidePanelItems = { name: "Chrome", clientType: "chrome", paramName: "chrome-tab", - docsUrlPart: "chrome" + docsUrlPart: "chrome", + isUnderConstruction: true }, Node: { name: "Node", clientType: "node", paramName: "node-tab", - docsUrlPart: "node" + docsUrlPart: "node", + isUnderConstruction: true }, Settings: { name: "Settings", @@ -13909,7 +13911,7 @@ module.exports = { var React = __webpack_require__(0); -__webpack_require__(680); +__webpack_require__(851); var dom = React.DOM; var ImPropTypes = __webpack_require__(150); @@ -13926,7 +13928,8 @@ function getTabsByClientType(tabs, 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}` + href: `${githubUrl}/docs/getting-setup.md#starting-${urlPart}`, + target: "_blank" }, "docs"), "."); } @@ -13969,25 +13972,38 @@ var LandingPage = React.createClass({ } }, - renderLaunchButton() { + renderLaunchOptions() { var selectedPane = this.state.selectedPane; - var name = configMap[selectedPane].name; + var _configMap$selectedPa = configMap[selectedPane], + name = _configMap$selectedPa.name, + isUnderConstruction = _configMap$selectedPa.isUnderConstruction; var isConnected = name === configMap.Firefox.name ? this.state.firefoxConnected : this.state.chromeConnected; var isNodeSelected = name === configMap.Node.name; if (isNodeSelected) { - return dom.h3({}, "Run a node script in the terminal with `--inspect`"); + return dom.div({ className: "launch-action-container" }, dom.h3({}, "Run a node script in the terminal with `--inspect`"), isUnderConstruction ? this.renderExperimentalMessage(name) : null); } var connectedStateText = isNodeSelected ? null : `Please open a tab in ${name}`; - return isConnected ? connectedStateText : dom.input({ - type: "button", - value: `Launch ${configMap[selectedPane].name}`, - onClick: () => this.launchBrowser(configMap[selectedPane].name) - }); + return isConnected ? connectedStateText : this.renderLaunchButton(name, isUnderConstruction); + }, + + renderLaunchButton(browserName, isUnderConstruction) { + return dom.div({ className: "launch-action-container" }, dom.button({ onClick: () => this.launchBrowser(browserName) }, `Launch ${browserName}`), isUnderConstruction ? this.renderExperimentalMessage(browserName) // eslint-disable-line max-len + : null); + }, + + renderExperimentalMessage(browserName) { + var underConstructionMessage = "Debugging is experimental and certain features won't work (i.e, seeing variables, attaching breakpoints)"; // eslint-disable-line max-len + var githubIssuesUrl = "https://github.com/devtools-html/debugger.html/issues?q=is%3Aopen+is%3Aissue+label%3A"; + var underConstructionImageSrc = __webpack_require__(855); + return dom.div({ className: "under-construction" }, dom.img({ src: underConstructionImageSrc }), dom.div({ className: "under-construction-message" }, underConstructionMessage, // eslint-disable-line max-len + dom.a({ className: "github-link", + href: `${githubIssuesUrl}${browserName}`, + target: "_blank" }, "Help us make it happen"))); }, launchBrowser(browser) { @@ -14009,7 +14025,7 @@ var LandingPage = React.createClass({ }, renderEmptyPanel() { - return dom.div({ className: "hero" }, this.renderLaunchButton()); + return dom.div({ className: "hero" }, this.renderLaunchOptions()); }, renderSettings() { @@ -14027,9 +14043,9 @@ var LandingPage = React.createClass({ tabs = _props2.tabs, _props2$filterString = _props2.filterString, filterString = _props2$filterString === undefined ? "" : _props2$filterString; - var _configMap$selectedPa = configMap[selectedPane], - clientType = _configMap$selectedPa.clientType, - paramName = _configMap$selectedPa.paramName; + var _configMap$selectedPa2 = configMap[selectedPane], + clientType = _configMap$selectedPa2.clientType, + paramName = _configMap$selectedPa2.paramName; var targets = getTabsByClientType(tabs, clientType); @@ -14054,10 +14070,10 @@ var LandingPage = React.createClass({ onTabClick = _props3.onTabClick, tabs = _props3.tabs; var selectedPane = this.state.selectedPane; - var _configMap$selectedPa2 = configMap[selectedPane], - name = _configMap$selectedPa2.name, - clientType = _configMap$selectedPa2.clientType, - paramName = _configMap$selectedPa2.paramName; + var _configMap$selectedPa3 = configMap[selectedPane], + name = _configMap$selectedPa3.name, + clientType = _configMap$selectedPa3.clientType, + paramName = _configMap$selectedPa3.paramName; var clientTargets = getTabsByClientType(tabs, clientType); @@ -14084,9 +14100,9 @@ var LandingPage = React.createClass({ title = _props4.title; var selectedPane = this.state.selectedPane; var onSideBarItemClick = this.onSideBarItemClick; - var _configMap$selectedPa3 = configMap[selectedPane], - name = _configMap$selectedPa3.name, - docsUrlPart = _configMap$selectedPa3.docsUrlPart; + var _configMap$selectedPa4 = configMap[selectedPane], + name = _configMap$selectedPa4.name, + docsUrlPart = _configMap$selectedPa4.docsUrlPart; return dom.div({ @@ -14322,7 +14338,7 @@ function combineReducers(reducers) { var React = __webpack_require__(0); -__webpack_require__(681); +__webpack_require__(852); var dom = React.DOM; var classnames = __webpack_require__(175); @@ -14558,7 +14574,9 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! var React = __webpack_require__(0); -__webpack_require__(682); +__webpack_require__(853); +var rocketSvg = __webpack_require__(1126); + var dom = React.DOM; var classnames = __webpack_require__(175); @@ -14574,22 +14592,15 @@ var Sidebar = React.createClass({ onSideBarItemClick: React.PropTypes.func.isRequired }, - render() { - var connections = []; + renderTitle(title) { + return dom.div({ className: "title-wrapper" }, dom.h1({}, title), dom.div({ className: "launchpad-container" }, dom.div({ + className: "launchpad-container-icon", + dangerouslySetInnerHTML: { __html: rocketSvg } + }), dom.h2({ className: "launchpad-container-title" }, "Launchpad"))); + }, - if (this.props.supportsFirefox) { - connections.push("Firefox"); - } - - if (this.props.supportsChrome) { - connections.push("Chrome", "Node"); - } - - connections.push("Settings"); - - return dom.aside({ - className: "sidebar" - }, dom.h1({}, this.props.title), dom.ul({}, connections.map(title => dom.li({ + renderItem(title) { + return dom.li({ className: classnames({ selected: title == this.props.selectedPane }), @@ -14602,9 +14613,24 @@ var Sidebar = React.createClass({ this.props.onSideBarItemClick(title); } } - }, dom.a({}, title))))); - } -}); + }, dom.a({}, title)); + }, + + render() { + var connections = []; + + if (this.props.supportsFirefox) { + connections.push("Firefox"); + } + + if (this.props.supportsChrome) { + connections.push("Chrome", "Node"); + } + + return dom.aside({ + className: "sidebar" + }, this.renderTitle(this.props.title), dom.ul({}, connections.map(title => this.renderItem(title)), this.renderItem("Settings"))); + } }); module.exports = Sidebar; @@ -15213,7 +15239,7 @@ module.exports = { * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var classnames = __webpack_require__(175); -__webpack_require__(684); +__webpack_require__(856); module.exports = function (className) { var root = document.createElement("div"); @@ -15641,7 +15667,7 @@ function createPrettySource(sourceId) { var source = (0, _selectors.getSource)(getState(), sourceId).toJS(); var url = (0, _source.getPrettySourceURL)(source.url); - var id = sourceMaps.generatedToOriginalId(sourceId, url); + var id = yield sourceMaps.generatedToOriginalId(sourceId, url); var _ref3 = yield (0, _prettyPrint.prettyPrint)({ source, @@ -15664,7 +15690,7 @@ function createPrettySource(sourceId) { text: code, contentType: "text/javascript", frames, - loading: false + loadedState: "loaded" }; return dispatch({ @@ -15900,8 +15926,10 @@ function thunk(makeArgs) { /***/ }), /* 225 */, /* 226 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { +"use strict"; +Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); // @flow const { isDevelopment } = __webpack_require__(828); @@ -15929,6 +15957,7 @@ if (isDevelopment()) { pref("devtools.debugger.file-search-regex-match", false); pref("devtools.debugger.prefs-schema-version", "1.0.1"); pref("devtools.debugger.project-text-search-enabled", true); + pref("devtools.debugger.features.async-stepping", false); } const prefs = new PrefsHelper("devtools", { @@ -15954,6 +15983,16 @@ const prefs = new PrefsHelper("devtools", { false ] }); +/* harmony export (immutable) */ __webpack_exports__["prefs"] = prefs; + + +const features = new PrefsHelper("devtools.debugger.features", { + asyncStepping: ["Bool", "async-stepping", false] +}); +/* harmony export (immutable) */ __webpack_exports__["features"] = features; + + +debugger; if (prefs.debuggerPrefsSchemaVersion !== prefsSchemaVersion) { // clear pending Breakpoints @@ -15961,8 +16000,6 @@ if (prefs.debuggerPrefsSchemaVersion !== prefsSchemaVersion) { prefs.debuggerPrefsSchemaVersion = prefsSchemaVersion; } -module.exports = { prefs }; - /***/ }), /* 227 */ @@ -16019,8 +16056,16 @@ var _projectTextSearch = __webpack_require__(31); var _projectTextSearch2 = _interopRequireDefault(_projectTextSearch); +var _sourceSearch = __webpack_require__(1132); + +var _sourceSearch2 = _interopRequireDefault(_sourceSearch); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + exports.default = { expressions: _expressions2.default, eventListeners: _eventListeners2.default, @@ -16032,10 +16077,9 @@ exports.default = { ui: _ui2.default, ast: _ast2.default, coverage: _coverage2.default, - projectTextSearch: _projectTextSearch2.default -}; /* This Source Code Form is subject to the terms of 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/. */ + projectTextSearch: _projectTextSearch2.default, + sourceSearch: _sourceSearch2.default +}; /***/ }), /* 228 */ @@ -16047,7 +16091,7 @@ exports.default = { Object.defineProperty(exports, "__esModule", { value: true }); -exports.getVisibleExpressions = exports.getExpressions = exports.State = undefined; +exports.getExpressions = exports.State = undefined; exports.getExpression = getExpression; var _makeRecord = __webpack_require__(230); @@ -16056,6 +16100,8 @@ var _makeRecord2 = _interopRequireDefault(_makeRecord); var _immutable = __webpack_require__(146); +var _lodash = __webpack_require__(2); + var _reselect = __webpack_require__(993); var _prefs = __webpack_require__(226); @@ -16075,24 +16121,21 @@ function update() { return appendToList(state, ["expressions"], { input: action.input, value: null, - updating: true, - visible: action.visible + updating: true }); case "UPDATE_EXPRESSION": var key = action.expression.input; return updateItemInList(state, ["expressions"], key, { input: action.input, value: null, - updating: true, - visible: action.visible + updating: true }); case "EVALUATE_EXPRESSION": if (action.status === "done") { return updateItemInList(state, ["expressions"], action.input, { input: action.input, value: action.value, - updating: false, - visible: action.visible + updating: false }); } break; @@ -16112,7 +16155,9 @@ function restoreExpressions() { } function storeExpressions(state) { - _prefs.prefs.expressions = state.getIn(["expressions"]).filter(e => e.visible).toJS(); + var expressions = state.getIn(["expressions"]).map(expression => (0, _lodash.omit)(expression, "value")).toJS(); + + _prefs.prefs.expressions = expressions; } function appendToList(state, path, value) { @@ -16144,8 +16189,6 @@ var getExpressionsWrapper = state => state.expressions; var getExpressions = exports.getExpressions = (0, _reselect.createSelector)(getExpressionsWrapper, expressions => expressions.get("expressions")); -var getVisibleExpressions = exports.getVisibleExpressions = (0, _reselect.createSelector)(getExpressions, expressions => expressions.filter(e => e.visible)); - function getExpression(state, input) { return getExpressions(state).find(exp => exp.input == input); } @@ -16392,13 +16435,13 @@ function update() { case "NAVIGATE": var source = getSelectedSource({ sources: state }); - var _url = source && source.get("url"); + var url = source && source.get("url"); - if (!_url) { + if (!url) { return initialState(); } - return initialState().set("pendingSelectedLocation", { url: _url }); + return initialState().set("pendingSelectedLocation", { url }); } return state; @@ -16410,15 +16453,15 @@ function getTextPropsFromAction(action) { if (action.status === "start") { - return { id: source.id, loading: true }; + return { id: source.id, loadedState: "loading" }; } else if (action.status === "error") { - return { id: source.id, error: action.error, loading: false }; + return { id: source.id, error: action.error, loadedState: "loaded" }; } return { text: value.text, id: source.id, contentType: value.contentType, - loading: false + loadedState: "loaded" }; } @@ -16612,7 +16655,7 @@ exports.default = update; Object.defineProperty(exports, "__esModule", { value: true }); -exports.getMode = exports.getSourceLineCount = exports.getSourcePath = exports.getFilenameFromURL = exports.getFilename = exports.getRawSourceURL = exports.getPrettySourceURL = exports.shouldPrettyPrint = exports.isPretty = exports.isJavaScript = undefined; +exports.isLoaded = exports.getMode = exports.getSourceLineCount = exports.getSourcePath = exports.getFilenameFromURL = exports.getFilename = exports.getRawSourceURL = exports.getPrettySourceURL = exports.shouldPrettyPrint = exports.isPretty = exports.isJavaScript = undefined; var _devtoolsSourceMap = __webpack_require__(898); @@ -16822,6 +16865,10 @@ function getMode(source) { return { name: "text" }; } +function isLoaded(source) { + return source.loadedState === "loaded"; +} + exports.isJavaScript = isJavaScript; exports.isPretty = isPretty; exports.shouldPrettyPrint = shouldPrettyPrint; @@ -16832,6 +16879,7 @@ exports.getFilenameFromURL = getFilenameFromURL; exports.getSourcePath = getSourcePath; exports.getSourceLineCount = getSourceLineCount; exports.getMode = getMode; +exports.isLoaded = isLoaded; /***/ }), /* 234 */ @@ -16974,6 +17022,7 @@ exports.join = join; Object.defineProperty(exports, "__esModule", { value: true }); +exports.getHiddenBreakpointLocation = exports.getHiddenBreakpoint = undefined; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* This Source Code Form is subject to the terms of the Mozilla Public @@ -17004,6 +17053,8 @@ var _devtoolsSourceMap = __webpack_require__(898); var _breakpoint2 = __webpack_require__(1057); +var _reselect = __webpack_require__(993); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -17151,6 +17202,18 @@ function getBreakpointsForSource(state, sourceId) { }); } +var getHiddenBreakpoint = exports.getHiddenBreakpoint = (0, _reselect.createSelector)(getBreakpoints, function (breakpoints) { + var hiddenBreakpoints = breakpoints.valueSeq().filter(breakpoint => breakpoint.hidden).first(); + return hiddenBreakpoints; +}); + +var getHiddenBreakpointLocation = exports.getHiddenBreakpointLocation = (0, _reselect.createSelector)(getHiddenBreakpoint, function (hiddenBreakpoint) { + if (!hiddenBreakpoint) { + return null; + } + return hiddenBreakpoint.location; +}); + exports.default = update; /***/ }), @@ -17844,6 +17907,10 @@ var _projectTextSearch = __webpack_require__(31); var projectTextSearch = _interopRequireWildcard(_projectTextSearch); +var _sourceSearch = __webpack_require__(1132); + +var sourceSearch = _interopRequireWildcard(_sourceSearch); + var _breakpointAtLocation = __webpack_require__(1134); var _breakpointAtLocation2 = _interopRequireDefault(_breakpointAtLocation); @@ -17856,6 +17923,10 @@ var _visibleBreakpoints = __webpack_require__(1135); var _visibleBreakpoints2 = _interopRequireDefault(_visibleBreakpoints); +var _isSelectedFrameVisible = __webpack_require__(805); + +var _isSelectedFrameVisible2 = _interopRequireDefault(_isSelectedFrameVisible); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -17864,7 +17935,12 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; * @param object - location */ -module.exports = Object.assign({}, expressions, sources, pause, breakpoints, pendingBreakpoints, eventListeners, ui, ast, coverage, projectTextSearch, { getBreakpointAtLocation: _breakpointAtLocation2.default, getInScopeLines: _linesInScope2.default, getVisibleBreakpoints: _visibleBreakpoints2.default }); +module.exports = Object.assign({}, expressions, sources, pause, breakpoints, pendingBreakpoints, eventListeners, ui, ast, coverage, projectTextSearch, sourceSearch, { + getBreakpointAtLocation: _breakpointAtLocation2.default, + getInScopeLines: _linesInScope2.default, + getVisibleBreakpoints: _visibleBreakpoints2.default, + isSelectedFrameVisible: _isSelectedFrameVisible2.default +}); /***/ }), /* 243 */ @@ -17895,13 +17971,13 @@ var _ui = __webpack_require__(1128); var _devtoolsModules = __webpack_require__(830); -__webpack_require__(685); +__webpack_require__(857); -__webpack_require__(686); +__webpack_require__(858); -__webpack_require__(687); +__webpack_require__(859); -__webpack_require__(688); +__webpack_require__(860); var _devtoolsSplitter = __webpack_require__(910); @@ -18151,9 +18227,13 @@ var _projectTextSearch = __webpack_require__(37); var projectTextSearch = _interopRequireWildcard(_projectTextSearch); +var _sourceSearch = __webpack_require__(1143); + +var sourceSearch = _interopRequireWildcard(_sourceSearch); + function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } -exports.default = Object.assign({}, navigation, breakpoints, expressions, eventListeners, sources, pause, ui, ast, coverage, projectTextSearch); +exports.default = Object.assign({}, navigation, breakpoints, expressions, eventListeners, sources, pause, ui, ast, coverage, projectTextSearch, sourceSearch); /***/ }), /* 245 */ @@ -18183,6 +18263,7 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument exports.syncBreakpoint = syncBreakpoint; exports.addBreakpoint = addBreakpoint; +exports.addHiddenBreakpoint = addHiddenBreakpoint; exports.removeBreakpoint = removeBreakpoint; exports.enableBreakpoint = enableBreakpoint; exports.disableBreakpoint = disableBreakpoint; @@ -18193,6 +18274,7 @@ exports.removeBreakpoints = removeBreakpoints; exports.remapBreakpoints = remapBreakpoints; exports.setBreakpointCondition = setBreakpointCondition; exports.toggleBreakpoint = toggleBreakpoint; +exports.addOrToggleDisabledBreakpoint = addOrToggleDisabledBreakpoint; exports.toggleDisabledBreakpoint = toggleDisabledBreakpoint; var _promise = __webpack_require__(193); @@ -18221,7 +18303,7 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a * * @memberof actions/breakpoints * @static - * @param {String} $1.source Source value + * @param {String} $1.sourceId String value * @param {PendingBreakpoint} $1.location PendingBreakpoint value */ function syncBreakpoint(source, pendingBreakpoint) { @@ -18231,8 +18313,8 @@ function syncBreakpoint(source, pendingBreakpoint) { client = _ref.client, sourceMaps = _ref.sourceMaps; - var sourceId = source.id; - var _pendingBreakpoint$lo = pendingBreakpoint.location, + var sourceId = source.id; + var _pendingBreakpoint$lo = pendingBreakpoint.location, line = _pendingBreakpoint$lo.line, sourceUrl = _pendingBreakpoint$lo.sourceUrl, column = _pendingBreakpoint$lo.column; @@ -18259,8 +18341,8 @@ function syncBreakpoint(source, pendingBreakpoint) { * @param {Boolean} $1.disabled Disable value for breakpoint value */ -function addBreakpoint(location, condition) { - var breakpoint = (0, _breakpoint.createBreakpoint)(location, { condition }); +function addBreakpoint(location, condition, hidden) { + var breakpoint = (0, _breakpoint.createBreakpoint)(location, { condition, hidden }); return (_ref2) => { var dispatch = _ref2.dispatch, getState = _ref2.getState, @@ -18273,6 +18355,21 @@ function addBreakpoint(location, condition) { }; } +/** + * Add a new hidden breakpoint + * + * @memberOf actions/breakpoints + * @param location + * @return {function(ThunkArgs)} + */ +function addHiddenBreakpoint(location) { + return (_ref3) => { + var dispatch = _ref3.dispatch; + + return dispatch(addBreakpoint(location, "", true)); + }; +} + /** * Remove a single breakpoint * @@ -18280,10 +18377,10 @@ function addBreakpoint(location, condition) { * @static */ function removeBreakpoint(location) { - return (_ref3) => { - var dispatch = _ref3.dispatch, - getState = _ref3.getState, - client = _ref3.client; + return (_ref4) => { + var dispatch = _ref4.dispatch, + getState = _ref4.getState, + client = _ref4.client; var bp = (0, _selectors.getBreakpoint)(getState(), location); if (!bp) { @@ -18325,11 +18422,11 @@ function removeBreakpoint(location) { */ function enableBreakpoint(location) { return (() => { - var _ref4 = _asyncToGenerator(function* (_ref5) { - var dispatch = _ref5.dispatch, - getState = _ref5.getState, - client = _ref5.client, - sourceMaps = _ref5.sourceMaps; + var _ref5 = _asyncToGenerator(function* (_ref6) { + var dispatch = _ref6.dispatch, + getState = _ref6.getState, + client = _ref6.client, + sourceMaps = _ref6.sourceMaps; var breakpoint = (0, _selectors.getBreakpoint)(getState(), location); if (!breakpoint) { @@ -18346,7 +18443,7 @@ function enableBreakpoint(location) { }); return function (_x) { - return _ref4.apply(this, arguments); + return _ref5.apply(this, arguments); }; })(); } @@ -18359,10 +18456,10 @@ function enableBreakpoint(location) { */ function disableBreakpoint(location) { return (() => { - var _ref6 = _asyncToGenerator(function* (_ref7) { - var dispatch = _ref7.dispatch, - getState = _ref7.getState, - client = _ref7.client; + var _ref7 = _asyncToGenerator(function* (_ref8) { + var dispatch = _ref8.dispatch, + getState = _ref8.getState, + client = _ref8.client; var bp = (0, _selectors.getBreakpoint)(getState(), location); @@ -18386,7 +18483,7 @@ function disableBreakpoint(location) { }); return function (_x2) { - return _ref6.apply(this, arguments); + return _ref7.apply(this, arguments); }; })(); } @@ -18399,15 +18496,15 @@ function disableBreakpoint(location) { */ function toggleAllBreakpoints(shouldDisableBreakpoints) { return (() => { - var _ref8 = _asyncToGenerator(function* (_ref9) { - var dispatch = _ref9.dispatch, - getState = _ref9.getState; + var _ref9 = _asyncToGenerator(function* (_ref10) { + var dispatch = _ref10.dispatch, + getState = _ref10.getState; var breakpoints = (0, _selectors.getBreakpoints)(getState()); - for (var _ref10 of breakpoints) { - var _ref11 = _slicedToArray(_ref10, 2); + for (var _ref11 of breakpoints) { + var _ref12 = _slicedToArray(_ref11, 2); - var breakpoint = _ref11[1]; + var breakpoint = _ref12[1]; if (shouldDisableBreakpoints) { yield dispatch(disableBreakpoint(breakpoint.location)); @@ -18418,7 +18515,7 @@ function toggleAllBreakpoints(shouldDisableBreakpoints) { }); return function (_x3) { - return _ref8.apply(this, arguments); + return _ref9.apply(this, arguments); }; })(); } @@ -18431,13 +18528,13 @@ function toggleAllBreakpoints(shouldDisableBreakpoints) { */ function toggleBreakpoints(shouldDisableBreakpoints, breakpoints) { return (() => { - var _ref12 = _asyncToGenerator(function* (_ref13) { - var dispatch = _ref13.dispatch; + var _ref13 = _asyncToGenerator(function* (_ref14) { + var dispatch = _ref14.dispatch; - for (var _ref14 of breakpoints) { - var _ref15 = _slicedToArray(_ref14, 2); + for (var _ref15 of breakpoints) { + var _ref16 = _slicedToArray(_ref15, 2); - var breakpoint = _ref15[1]; + var breakpoint = _ref16[1]; if (shouldDisableBreakpoints) { yield dispatch(disableBreakpoint(breakpoint.location)); @@ -18448,7 +18545,7 @@ function toggleBreakpoints(shouldDisableBreakpoints, breakpoints) { }); return function (_x4) { - return _ref12.apply(this, arguments); + return _ref13.apply(this, arguments); }; })(); } @@ -18461,22 +18558,22 @@ function toggleBreakpoints(shouldDisableBreakpoints, breakpoints) { */ function removeAllBreakpoints() { return (() => { - var _ref16 = _asyncToGenerator(function* (_ref17) { - var dispatch = _ref17.dispatch, - getState = _ref17.getState; + var _ref17 = _asyncToGenerator(function* (_ref18) { + var dispatch = _ref18.dispatch, + getState = _ref18.getState; var breakpoints = (0, _selectors.getBreakpoints)(getState()); - for (var _ref18 of breakpoints) { - var _ref19 = _slicedToArray(_ref18, 2); + for (var _ref19 of breakpoints) { + var _ref20 = _slicedToArray(_ref19, 2); - var breakpoint = _ref19[1]; + var breakpoint = _ref20[1]; yield dispatch(removeBreakpoint(breakpoint.location)); } }); return function (_x5) { - return _ref16.apply(this, arguments); + return _ref17.apply(this, arguments); }; })(); } @@ -18489,30 +18586,30 @@ function removeAllBreakpoints() { */ function removeBreakpoints(breakpoints) { return (() => { - var _ref20 = _asyncToGenerator(function* (_ref21) { - var dispatch = _ref21.dispatch; + var _ref21 = _asyncToGenerator(function* (_ref22) { + var dispatch = _ref22.dispatch; - for (var _ref22 of breakpoints) { - var _ref23 = _slicedToArray(_ref22, 2); + for (var _ref23 of breakpoints) { + var _ref24 = _slicedToArray(_ref23, 2); - var breakpoint = _ref23[1]; + var breakpoint = _ref24[1]; yield dispatch(removeBreakpoint(breakpoint.location)); } }); return function (_x6) { - return _ref20.apply(this, arguments); + return _ref21.apply(this, arguments); }; })(); } function remapBreakpoints(sourceId) { return (() => { - var _ref24 = _asyncToGenerator(function* (_ref25) { - var dispatch = _ref25.dispatch, - getState = _ref25.getState, - sourceMaps = _ref25.sourceMaps; + var _ref25 = _asyncToGenerator(function* (_ref26) { + var dispatch = _ref26.dispatch, + getState = _ref26.getState, + sourceMaps = _ref26.sourceMaps; var breakpoints = (0, _selectors.getBreakpoints)(getState()); var newBreakpoints = yield (0, _remapLocations2.default)(breakpoints, sourceId, sourceMaps); @@ -18524,7 +18621,7 @@ function remapBreakpoints(sourceId) { }); return function (_x7) { - return _ref24.apply(this, arguments); + return _ref25.apply(this, arguments); }; })(); } @@ -18542,15 +18639,15 @@ function remapBreakpoints(sourceId) { * @param {Boolean} $1.disabled Disable value for breakpoint value */ function setBreakpointCondition(location) { - var _ref26 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, - condition = _ref26.condition; + var _ref27 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + condition = _ref27.condition; return (() => { - var _ref27 = _asyncToGenerator(function* (_ref28) { - var dispatch = _ref28.dispatch, - getState = _ref28.getState, - client = _ref28.client, - sourceMaps = _ref28.sourceMaps; + var _ref28 = _asyncToGenerator(function* (_ref29) { + var dispatch = _ref29.dispatch, + getState = _ref29.getState, + client = _ref29.client, + sourceMaps = _ref29.sourceMaps; var bp = (0, _selectors.getBreakpoint)(getState(), location); if (!bp) { @@ -18563,6 +18660,11 @@ function setBreakpointCondition(location) { throw new Error("breakpoint must be saved"); } + if (bp.disabled) { + yield dispatch(enableBreakpoint(location)); + bp.disabled = !bp.disabled; + } + yield client.setBreakpointCondition(bp.id, location, condition, sourceMaps.isOriginalId(bp.location.sourceId)); var newBreakpoint = _extends({}, bp, { condition }); @@ -18576,17 +18678,17 @@ function setBreakpointCondition(location) { }); return function (_x9) { - return _ref27.apply(this, arguments); + return _ref28.apply(this, arguments); }; })(); } function toggleBreakpoint(line, column) { - return (_ref29) => { - var dispatch = _ref29.dispatch, - getState = _ref29.getState, - client = _ref29.client, - sourceMaps = _ref29.sourceMaps; + return (_ref30) => { + var dispatch = _ref30.dispatch, + getState = _ref30.getState, + client = _ref30.client, + sourceMaps = _ref30.sourceMaps; var selectedSource = (0, _selectors.getSelectedSource)(getState()); var bp = (0, _selectors.getBreakpointAtLocation)(getState(), { line, column }); @@ -18614,12 +18716,40 @@ function toggleBreakpoint(line, column) { }; } +function addOrToggleDisabledBreakpoint(line, column) { + return (_ref31) => { + var dispatch = _ref31.dispatch, + getState = _ref31.getState, + client = _ref31.client, + sourceMaps = _ref31.sourceMaps; + + var selectedSource = (0, _selectors.getSelectedSource)(getState()); + var bp = (0, _selectors.getBreakpointAtLocation)(getState(), { line, column }); + + if (bp && bp.loading) { + return; + } + + if (bp) { + // NOTE: it's possible the breakpoint has slid to a column + return dispatch(toggleDisabledBreakpoint(line, column || bp.location.column)); + } + + return dispatch(addBreakpoint({ + sourceId: selectedSource.get("id"), + sourceUrl: selectedSource.get("url"), + line: line, + column: column + })); + }; +} + function toggleDisabledBreakpoint(line, column) { - return (_ref30) => { - var dispatch = _ref30.dispatch, - getState = _ref30.getState, - client = _ref30.client, - sourceMaps = _ref30.sourceMaps; + return (_ref32) => { + var dispatch = _ref32.dispatch, + getState = _ref32.getState, + client = _ref32.client, + sourceMaps = _ref32.sourceMaps; var bp = (0, _selectors.getBreakpointAtLocation)(getState(), { line, column }); if (bp && bp.loading) { @@ -19008,55 +19138,44 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a * @static */ function addExpression(input) { - var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, - _ref$visible = _ref.visible, - visible = _ref$visible === undefined ? true : _ref$visible; - return (() => { - var _ref2 = _asyncToGenerator(function* (_ref3) { - var dispatch = _ref3.dispatch, - getState = _ref3.getState; + var _ref = _asyncToGenerator(function* (_ref2) { + var dispatch = _ref2.dispatch, + getState = _ref2.getState; if (!input) { return; } var expression = (0, _selectors.getExpression)(getState(), input); - if (expression && expression.visible) { - return; - } - - // Lets make the expression visible if (expression) { return dispatch({ type: "UPDATE_EXPRESSION", expression, - input, - visible: true + input }); } dispatch({ type: "ADD_EXPRESSION", - input, - visible + input }); var selectedFrame = (0, _selectors.getSelectedFrame)(getState()); var selectedFrameId = selectedFrame ? selectedFrame.id : null; - dispatch(evaluateExpression({ input, visible }, selectedFrameId)); + dispatch(evaluateExpression({ input }, selectedFrameId)); }); - return function (_x2) { - return _ref2.apply(this, arguments); + return function (_x) { + return _ref.apply(this, arguments); }; })(); } function updateExpression(input, expression) { - return (_ref4) => { - var dispatch = _ref4.dispatch, - getState = _ref4.getState; + return (_ref3) => { + var dispatch = _ref3.dispatch, + getState = _ref3.getState; if (!input || input == expression.input) { return; @@ -19065,8 +19184,7 @@ function updateExpression(input, expression) { dispatch({ type: "UPDATE_EXPRESSION", expression, - input: input, - visible: expression.visible + input: input }); var selectedFrame = (0, _selectors.getSelectedFrame)(getState()); @@ -19083,8 +19201,8 @@ function updateExpression(input, expression) { * @static */ function deleteExpression(expression) { - return (_ref5) => { - var dispatch = _ref5.dispatch; + return (_ref4) => { + var dispatch = _ref4.dispatch; dispatch({ type: "DELETE_EXPRESSION", @@ -19101,10 +19219,10 @@ function deleteExpression(expression) { */ function evaluateExpressions(frameId) { return (() => { - var _ref6 = _asyncToGenerator(function* (_ref7) { - var dispatch = _ref7.dispatch, - getState = _ref7.getState, - client = _ref7.client; + var _ref5 = _asyncToGenerator(function* (_ref6) { + var dispatch = _ref6.dispatch, + getState = _ref6.getState, + client = _ref6.client; var expressions = (0, _selectors.getExpressions)(getState()).toJS(); if (!frameId) { @@ -19116,17 +19234,17 @@ function evaluateExpressions(frameId) { } }); - return function (_x3) { - return _ref6.apply(this, arguments); + return function (_x2) { + return _ref5.apply(this, arguments); }; })(); } function evaluateExpression(expression, frameId) { - return function (_ref8) { - var dispatch = _ref8.dispatch, - getState = _ref8.getState, - client = _ref8.client; + return function (_ref7) { + var dispatch = _ref7.dispatch, + getState = _ref7.getState, + client = _ref7.client; if (!expression.input) { console.warn("Expressions should not be empty"); @@ -19136,7 +19254,6 @@ function evaluateExpression(expression, frameId) { return dispatch({ type: "EVALUATE_EXPRESSION", input: expression.input, - visible: expression.visible, [_promise.PROMISE]: client.evaluate(expression.input, { frameId }) }); }; @@ -19359,8 +19476,24 @@ Object.defineProperty(exports, "__esModule", { var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); +// If a request has been made to show this source, go ahead and +// select it. +var checkSelectedSource = (() => { + var _ref = _asyncToGenerator(function* (state, dispatch, source) { + var pendingLocation = (0, _selectors.getPendingSelectedLocation)(state); + + if (pendingLocation && !!source.url && pendingLocation.url === source.url) { + yield dispatch(selectSource(source.id, { line: pendingLocation.line })); + } + }); + + return function checkSelectedSource(_x, _x2, _x3) { + return _ref.apply(this, arguments); + }; +})(); + var checkPendingBreakpoint = (() => { - var _ref = _asyncToGenerator(function* (state, dispatch, pendingBreakpoint, source) { + var _ref2 = _asyncToGenerator(function* (state, dispatch, pendingBreakpoint, source) { var sourceUrl = pendingBreakpoint.location.sourceUrl; var sameSource = sourceUrl && sourceUrl === source.url; @@ -19370,13 +19503,13 @@ var checkPendingBreakpoint = (() => { } }); - return function checkPendingBreakpoint(_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); + return function checkPendingBreakpoint(_x4, _x5, _x6, _x7) { + return _ref2.apply(this, arguments); }; })(); var checkPendingBreakpoints = (() => { - var _ref2 = _asyncToGenerator(function* (state, dispatch, source) { + var _ref3 = _asyncToGenerator(function* (state, dispatch, source) { var pendingBreakpoints = (0, _selectors.getPendingBreakpoints)(state); if (!pendingBreakpoints) { return; @@ -19388,8 +19521,8 @@ var checkPendingBreakpoints = (() => { } }); - return function checkPendingBreakpoints(_x5, _x6, _x7) { - return _ref2.apply(this, arguments); + return function checkPendingBreakpoints(_x8, _x9, _x10) { + return _ref3.apply(this, arguments); }; })(); @@ -19449,42 +19582,33 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a * @module actions/sources */ -// If a request has been made to show this source, go ahead and -// select it. -function checkSelectedSource(state, dispatch, source) { - var pendingLocation = (0, _selectors.getPendingSelectedLocation)(state); - - if (pendingLocation && !!source.url && pendingLocation.url === source.url) { - dispatch(selectSource(source.id, { line: pendingLocation.line })); - } -} - function newSource(source) { return (() => { - var _ref3 = _asyncToGenerator(function* (_ref4) { - var dispatch = _ref4.dispatch, - getState = _ref4.getState; + var _ref4 = _asyncToGenerator(function* (_ref5) { + var dispatch = _ref5.dispatch, + getState = _ref5.getState; dispatch({ type: "ADD_SOURCE", source }); + if (_prefs.prefs.clientSourceMapsEnabled) { yield dispatch(loadSourceMap(source)); } - checkSelectedSource(getState(), dispatch, source); + yield checkSelectedSource(getState(), dispatch, source); yield checkPendingBreakpoints(getState(), dispatch, source); }); - return function (_x8) { - return _ref3.apply(this, arguments); + return function (_x11) { + return _ref4.apply(this, arguments); }; })(); } function newSources(sources) { return (() => { - var _ref5 = _asyncToGenerator(function* (_ref6) { - var dispatch = _ref6.dispatch, - getState = _ref6.getState; + var _ref6 = _asyncToGenerator(function* (_ref7) { + var dispatch = _ref7.dispatch, + getState = _ref7.getState; var filteredSources = sources.filter(function (source) { return !(0, _selectors.getSource)(getState(), source.id); @@ -19495,8 +19619,8 @@ function newSources(sources) { } }); - return function (_x9) { - return _ref5.apply(this, arguments); + return function (_x12) { + return _ref6.apply(this, arguments); }; })(); } @@ -19507,10 +19631,10 @@ function newSources(sources) { */ function loadSourceMap(generatedSource) { return (() => { - var _ref7 = _asyncToGenerator(function* (_ref8) { - var dispatch = _ref8.dispatch, - getState = _ref8.getState, - sourceMaps = _ref8.sourceMaps; + var _ref8 = _asyncToGenerator(function* (_ref9) { + var dispatch = _ref9.dispatch, + getState = _ref9.getState, + sourceMaps = _ref9.sourceMaps; var urls = yield sourceMaps.getOriginalURLs(generatedSource); if (!urls) { @@ -19535,8 +19659,8 @@ function loadSourceMap(generatedSource) { }); }); - return function (_x10) { - return _ref7.apply(this, arguments); + return function (_x13) { + return _ref8.apply(this, arguments); }; })(); } @@ -19553,22 +19677,28 @@ function loadSourceMap(generatedSource) { function selectSourceURL(url) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - return (_ref9) => { - var dispatch = _ref9.dispatch, - getState = _ref9.getState; + return (() => { + var _ref10 = _asyncToGenerator(function* (_ref11) { + var dispatch = _ref11.dispatch, + getState = _ref11.getState; - var source = (0, _selectors.getSourceByURL)(getState(), url); - if (source) { - dispatch(selectSource(source.get("id"), options)); - } else { - dispatch({ - type: "SELECT_SOURCE_URL", - url: url, - tabIndex: options.tabIndex, - line: options.line - }); - } - }; + var source = (0, _selectors.getSourceByURL)(getState(), url); + if (source) { + yield dispatch(selectSource(source.get("id"), options)); + } else { + dispatch({ + type: "SELECT_SOURCE_URL", + url: url, + tabIndex: options.tabIndex, + line: options.line + }); + } + }); + + return function (_x15) { + return _ref10.apply(this, arguments); + }; + })(); } /** @@ -19578,10 +19708,10 @@ function selectSourceURL(url) { function selectSource(id) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - return (_ref10) => { - var dispatch = _ref10.dispatch, - getState = _ref10.getState, - client = _ref10.client; + return (_ref12) => { + var dispatch = _ref12.dispatch, + getState = _ref12.getState, + client = _ref12.client; if (!client) { // No connection, do nothing. This happens when the debugger is @@ -19621,11 +19751,11 @@ function selectSource(id) { */ function jumpToMappedLocation(sourceLocation) { return (() => { - var _ref12 = _asyncToGenerator(function* (_ref13) { - var dispatch = _ref13.dispatch, - getState = _ref13.getState, - client = _ref13.client, - sourceMaps = _ref13.sourceMaps; + var _ref14 = _asyncToGenerator(function* (_ref15) { + var dispatch = _ref15.dispatch, + getState = _ref15.getState, + client = _ref15.client, + sourceMaps = _ref15.sourceMaps; if (!client) { return; @@ -19642,8 +19772,8 @@ function jumpToMappedLocation(sourceLocation) { return dispatch(selectSource(pairedLocation.sourceId, { line: pairedLocation.line })); }); - return function (_x13) { - return _ref12.apply(this, arguments); + return function (_x17) { + return _ref14.apply(this, arguments); }; })(); } @@ -19669,10 +19799,10 @@ function moveTab(url, tabIndex) { * @static */ function closeTab(url) { - return (_ref14) => { - var dispatch = _ref14.dispatch, - getState = _ref14.getState, - client = _ref14.client; + return (_ref16) => { + var dispatch = _ref16.dispatch, + getState = _ref16.getState, + client = _ref16.client; (0, _editor.removeDocument)(url); var tabs = (0, _selectors.removeSourceFromTabList)((0, _selectors.getSourceTabs)(getState()), url); @@ -19688,10 +19818,10 @@ function closeTab(url) { * @static */ function closeTabs(urls) { - return (_ref15) => { - var dispatch = _ref15.dispatch, - getState = _ref15.getState, - client = _ref15.client; + return (_ref17) => { + var dispatch = _ref17.dispatch, + getState = _ref17.getState, + client = _ref17.client; urls.forEach(url => { var source = (0, _selectors.getSourceByURL)(getState(), url); @@ -19722,15 +19852,15 @@ function closeTabs(urls) { */ function togglePrettyPrint(sourceId) { return (() => { - var _ref16 = _asyncToGenerator(function* (_ref17) { - var dispatch = _ref17.dispatch, - getState = _ref17.getState, - client = _ref17.client, - sourceMaps = _ref17.sourceMaps; + var _ref18 = _asyncToGenerator(function* (_ref19) { + var dispatch = _ref19.dispatch, + getState = _ref19.getState, + client = _ref19.client, + sourceMaps = _ref19.sourceMaps; var source = (0, _selectors.getSource)(getState(), sourceId).toJS(); - if (source && source.loading) { + if (source && !(0, _source.isLoaded)(source)) { return {}; } @@ -19748,29 +19878,30 @@ function togglePrettyPrint(sourceId) { })); } - var _ref18 = yield dispatch((0, _createPrettySource.createPrettySource)(sourceId)), - newPrettySource = _ref18.source; + var _ref20 = yield dispatch((0, _createPrettySource.createPrettySource)(sourceId)), + newPrettySource = _ref20.source; yield dispatch((0, _breakpoints.remapBreakpoints)(sourceId)); + yield dispatch((0, _ast.setEmptyLines)(newPrettySource.id)); return dispatch(selectSource(newPrettySource.id, { line: selectedOriginalLocation.line })); }); - return function (_x14) { - return _ref16.apply(this, arguments); + return function (_x18) { + return _ref18.apply(this, arguments); }; })(); } function toggleBlackBox(source) { return (() => { - var _ref19 = _asyncToGenerator(function* (_ref20) { - var dispatch = _ref20.dispatch, - getState = _ref20.getState, - client = _ref20.client, - sourceMaps = _ref20.sourceMaps; + var _ref21 = _asyncToGenerator(function* (_ref22) { + var dispatch = _ref22.dispatch, + getState = _ref22.getState, + client = _ref22.client, + sourceMaps = _ref22.sourceMaps; var isBlackBoxed = source.isBlackBoxed, id = source.id; @@ -19782,8 +19913,8 @@ function toggleBlackBox(source) { }); }); - return function (_x15) { - return _ref19.apply(this, arguments); + return function (_x19) { + return _ref21.apply(this, arguments); }; })(); } @@ -19794,11 +19925,11 @@ function toggleBlackBox(source) { */ function loadSourceText(source) { return (() => { - var _ref21 = _asyncToGenerator(function* (_ref22) { - var dispatch = _ref22.dispatch, - getState = _ref22.getState, - client = _ref22.client, - sourceMaps = _ref22.sourceMaps; + var _ref23 = _asyncToGenerator(function* (_ref24) { + var dispatch = _ref24.dispatch, + getState = _ref24.getState, + client = _ref24.client, + sourceMaps = _ref24.sourceMaps; // Fetch the source text only once. if (source.text) { @@ -19824,10 +19955,11 @@ function loadSourceText(source) { }); yield dispatch((0, _ast.setSymbols)(source.id)); + yield dispatch((0, _ast.setEmptyLines)(source.id)); }); - return function (_x16) { - return _ref21.apply(this, arguments); + return function (_x20) { + return _ref23.apply(this, arguments); }; })(); } @@ -19839,16 +19971,16 @@ function loadSourceText(source) { */ function loadAllSources() { return (() => { - var _ref24 = _asyncToGenerator(function* (_ref25) { - var dispatch = _ref25.dispatch, - getState = _ref25.getState; + var _ref26 = _asyncToGenerator(function* (_ref27) { + var dispatch = _ref27.dispatch, + getState = _ref27.getState; var sources = (0, _selectors.getSources)(getState()); var query = (0, _selectors.getTextSearchQuery)(getState()); - for (var _ref26 of sources) { - var _ref27 = _slicedToArray(_ref26, 2); + for (var _ref28 of sources) { + var _ref29 = _slicedToArray(_ref28, 2); - var src = _ref27[1]; + var src = _ref29[1]; var source = src.toJS(); yield dispatch(loadSourceText(source)); @@ -19860,8 +19992,8 @@ function loadAllSources() { } }); - return function (_x17) { - return _ref24.apply(this, arguments); + return function (_x21) { + return _ref26.apply(this, arguments); }; })(); } @@ -19876,11 +20008,31 @@ function loadAllSources() { Object.defineProperty(exports, "__esModule", { value: true }); +exports.getPausedPosition = undefined; + +var getPausedPosition = exports.getPausedPosition = (() => { + var _ref = _asyncToGenerator(function* (pauseInfo, sourceMaps) { + var frames = pauseInfo.frames; + + frames = yield updateFrameLocations(frames, sourceMaps); + var frame = frames[0]; + var location = frame.location; + + return location; + }); + + return function getPausedPosition(_x, _x2) { + return _ref.apply(this, arguments); + }; +})(); + exports.updateFrameLocations = updateFrameLocations; exports.getPauseReason = getPauseReason; var _lodash = __webpack_require__(2); +function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } + function updateFrameLocations(frames, sourceMaps) { if (!frames || frames.length == 0) { return Promise.resolve(frames); @@ -20145,6 +20297,11 @@ var _source = __webpack_require__(233); var _wasm = __webpack_require__(23); +var _devtoolsSourceEditor = __webpack_require__(994); + +var resizeBreakpointGutter = _devtoolsSourceEditor.SourceEditorUtils.resizeBreakpointGutter; + + var sourceDocs = {}; function getDocument(key) { @@ -20166,16 +20323,17 @@ function clearDocuments() { function resetLineNumberFormat(editor) { var cm = editor.codeMirror; cm.setOption("lineNumberFormatter", number => number); + resizeBreakpointGutter(cm); } function updateLineNumberFormat(editor, sourceId) { if (!(0, _wasm.isWasm)(sourceId)) { - resetLineNumberFormat(editor); - return; + return resetLineNumberFormat(editor); } var cm = editor.codeMirror; var lineNumberFormatter = (0, _wasm.getWasmLineNumberFormatter)(sourceId); cm.setOption("lineNumberFormatter", lineNumberFormatter); + resizeBreakpointGutter(cm); } function updateDocument(editor, sourceId) { @@ -20810,7 +20968,78 @@ module.exports = hasPath; /* 301 */, /* 302 */, /* 303 */, -/* 304 */, +/* 304 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(84), + isSymbol = __webpack_require__(72); + +/** Used as references for various `Number` constants. */ +var NAN = 0 / 0; + +/** Used to match leading and trailing whitespace. */ +var reTrim = /^\s+|\s+$/g; + +/** Used to detect bad signed hexadecimal string values. */ +var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + +/** Used to detect binary string values. */ +var reIsBinary = /^0b[01]+$/i; + +/** Used to detect octal string values. */ +var reIsOctal = /^0o[0-7]+$/i; + +/** Built-in method references without a dependency on `root`. */ +var freeParseInt = parseInt; + +/** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ +function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); +} + +module.exports = toNumber; + + +/***/ }), /* 305 */ /***/ (function(module, exports, __webpack_require__) { @@ -21067,6 +21296,7 @@ exports.resume = resume; exports.breakOnNext = breakOnNext; exports.selectFrame = selectFrame; exports.loadObjectProperties = loadObjectProperties; +exports.astCommand = astCommand; var _sources = __webpack_require__(254); @@ -21078,6 +21308,18 @@ var _pause = __webpack_require__(255); var _expressions = __webpack_require__(252); +var _breakpoints = __webpack_require__(245); + +var _breakpoints2 = __webpack_require__(236); + +var _parser = __webpack_require__(827); + +var parser = _interopRequireWildcard(_parser); + +var _prefs = __webpack_require__(226); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /** @@ -21207,7 +21449,7 @@ function stepIn() { getState = _ref7.getState; if ((0, _selectors.getPause)(getState())) { - return dispatch(command({ type: "stepIn" })); + return dispatch(astCommand("stepIn")); } }; } @@ -21224,7 +21466,7 @@ function stepOver() { getState = _ref8.getState; if ((0, _selectors.getPause)(getState())) { - return dispatch(command({ type: "stepOver" })); + return dispatch(astCommand("stepOver")); } }; } @@ -21241,7 +21483,7 @@ function stepOut() { getState = _ref9.getState; if ((0, _selectors.getPause)(getState())) { - return dispatch(command({ type: "stepOut" })); + return dispatch(astCommand("stepOut")); } }; } @@ -21337,6 +21579,47 @@ function loadObjectProperties(object) { }; } +/** + * @memberOf actions/pause + * @static + * @param stepType + * @returns {function(ThunkArgs)} + */ +function astCommand(stepType) { + return (() => { + var _ref15 = _asyncToGenerator(function* (_ref16) { + var dispatch = _ref16.dispatch, + getState = _ref16.getState, + sourceMaps = _ref16.sourceMaps; + + if (!_prefs.features.asyncStepping) { + return dispatch(command({ type: stepType })); + } + + var pauseInfo = (0, _selectors.getPause)(getState()); + var source = (0, _selectors.getSelectedSource)(getState()).toJS(); + var currentHiddenBreakpointLocation = (0, _breakpoints2.getHiddenBreakpointLocation)(getState()); + if (currentHiddenBreakpointLocation) { + dispatch((0, _breakpoints.removeBreakpoint)(currentHiddenBreakpointLocation)); + } + var pausedPosition = yield (0, _pause.getPausedPosition)(pauseInfo, sourceMaps); + + var _ref17 = yield parser.getNextStep(source, stepType, pausedPosition), + nextStepType = _ref17.nextStepType, + nextHiddenBreakpointLocation = _ref17.nextHiddenBreakpointLocation; + + if (nextHiddenBreakpointLocation) { + yield dispatch((0, _breakpoints.addHiddenBreakpoint)(nextHiddenBreakpointLocation)); + } + return dispatch(command({ type: nextStepType })); + }); + + return function (_x3) { + return _ref15.apply(this, arguments); + }; + })(); +} + /***/ }), /* 320 */ /***/ (function(module, exports, __webpack_require__) { @@ -21530,6 +21813,12 @@ function showSource(sourceId) { getState = _ref4.getState; var source = (0, _selectors.getSource)(getState(), sourceId); + + dispatch({ + type: "SHOW_SOURCE", + sourceUrl: "" + }); + dispatch({ type: "SHOW_SOURCE", sourceUrl: source.get("url") @@ -21636,7 +21925,7 @@ var _Transition = __webpack_require__(333); var _Transition2 = _interopRequireDefault(_Transition); -__webpack_require__(737); +__webpack_require__(952); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -23088,7 +23377,7 @@ var _classnames2 = _interopRequireDefault(_classnames); var _resultList = __webpack_require__(343); -__webpack_require__(695); +__webpack_require__(867); var _SearchInput = __webpack_require__(377); @@ -23107,7 +23396,6 @@ class Autocomplete extends _react.Component { this.onKeyDown = this.onKeyDown.bind(this); this.state = { - inputValue: props.inputValue, selectedIndex: 0, focused: false }; @@ -23120,13 +23408,12 @@ class Autocomplete extends _react.Component { } getSearchResults() { - var inputValue = this.state.inputValue; - + var inputValue = this.props.inputValue; if (inputValue == "") { return []; } - return (0, _fuzzaldrinPlus.filter)(this.props.items, this.state.inputValue, { + return (0, _fuzzaldrinPlus.filter)(this.props.items, inputValue, { key: "value" }); } @@ -23153,11 +23440,11 @@ class Autocomplete extends _react.Component { if (searchResults.length) { this.props.selectItem(e, searchResults[this.state.selectedIndex]); } else { - this.props.close(this.state.inputValue); + this.props.close(this.props.inputValue); } e.preventDefault(); } else if (e.key === "Tab") { - this.props.close(this.state.inputValue); + this.props.close(this.props.inputValue); e.preventDefault(); } } @@ -23177,7 +23464,7 @@ class Autocomplete extends _react.Component { }; return _react2.default.createElement(_ResultList2.default, props); - } else if (this.state.inputValue && !results.length) { + } else if (this.props.inputValue && !results.length) { return _react2.default.createElement( "div", { className: "no-result-msg absolute-center" }, @@ -23196,16 +23483,18 @@ class Autocomplete extends _react.Component { var summaryMsg = L10N.getFormatStr("sourceSearch.resultsSummary1", searchResults.length); var searchProps = { - query: this.state.inputValue, + query: this.props.inputValue, count: searchResults.length, placeholder: this.props.placeholder, size, showErrorEmoji: true, summaryMsg, - onChange: e => this.setState({ - inputValue: e.target.value, - selectedIndex: 0 - }), + onChange: e => { + this.props.onChangeHandler(e.target.value); + this.setState({ + selectedIndex: 0 + }); + }, onFocus: () => this.setState({ focused: true }), onBlur: () => this.setState({ focused: false }), onKeyDown: this.onKeyDown, @@ -23321,7 +23610,7 @@ var _Svg = __webpack_require__(345); var _Svg2 = _interopRequireDefault(_Svg); -__webpack_require__(690); +__webpack_require__(862); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -23354,6 +23643,7 @@ var svg = { "column-breakpoint": __webpack_require__(998), "case-match": __webpack_require__(351), close: __webpack_require__(352), + dojo: __webpack_require__(806), domain: __webpack_require__(353), file: __webpack_require__(354), folder: __webpack_require__(355), @@ -23395,10 +23685,14 @@ var svg = { showOutline: __webpack_require__(1045) }; -module.exports = function (name, props) { - // eslint-disable-line +function Svg(_ref) { + var name = _ref.name, + className = _ref.className, + onClick = _ref.onClick, + ariaLabel = _ref["aria-label"]; + if (!svg[name]) { - var error = "Unknown SVG: " + name; + var error = `Unknown SVG: ${name}`; if (isDevelopment()) { throw new Error(error); } @@ -23407,16 +23701,22 @@ module.exports = function (name, props) { return; } - var className = name; - if (props && props.className) { - className = `${name} ${props.className}`; - } + className = `${name} ${className || ""}`; if (name === "subSettings") { className = ""; } - props = Object.assign({}, props, { className, src: svg[name] }); + var props = { + className, + onClick, + ["aria-label"]: ariaLabel, + src: svg[name] + }; return React.createElement(InlineSVG, props); -}; +} + +Svg.displayName = "Svg"; + +module.exports = Svg; /***/ }), /* 346 */ @@ -23770,7 +24070,7 @@ var _Close = __webpack_require__(378); var _Close2 = _interopRequireDefault(_Close); -__webpack_require__(693); +__webpack_require__(865); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -23786,7 +24086,7 @@ var arrowBtn = (onClick, type, className, tooltip) => { return _react2.default.createElement( "button", props, - (0, _Svg2.default)(type) + _react2.default.createElement(_Svg2.default, { name: type }) ); }; @@ -23809,10 +24109,10 @@ class SearchInput extends _react.Component { renderSvg() { if (this.shouldShowErrorEmoji()) { - return (0, _Svg2.default)("sad-face"); + return _react2.default.createElement(_Svg2.default, { name: "sad-face" }); } - return (0, _Svg2.default)("magnifying-glass"); + return _react2.default.createElement(_Svg2.default, { name: "magnifying-glass" }); } renderArrowButtons() { @@ -23916,7 +24216,7 @@ var _Svg = __webpack_require__(344); var _Svg2 = _interopRequireDefault(_Svg); -__webpack_require__(692); +__webpack_require__(864); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -23932,7 +24232,7 @@ function CloseButton(_ref) { onClick: handleClick, title: tooltip }, - (0, _Svg2.default)("close") + _react2.default.createElement(_Svg2.default, { name: "close" }) ); } @@ -23967,7 +24267,7 @@ var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); -__webpack_require__(696); +__webpack_require__(868); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -24124,7 +24424,7 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -__webpack_require__(691); +__webpack_require__(863); var _devtoolsComponents = __webpack_require__(1007); @@ -24315,8 +24615,6 @@ var _classnames2 = _interopRequireDefault(_classnames); var _devtoolsConfig = __webpack_require__(828); -var _lodash = __webpack_require__(2); - var _GutterMenu = __webpack_require__(655); var _GutterMenu2 = _interopRequireDefault(_GutterMenu); @@ -24329,6 +24627,10 @@ var _ConditionalPanel = __webpack_require__(711); var _devtoolsLaunchpad = __webpack_require__(131); +var _source = __webpack_require__(233); + +var _ast = __webpack_require__(1058); + var _selectors = __webpack_require__(242); var _actions = __webpack_require__(244); @@ -24347,7 +24649,7 @@ var _HighlightLines = __webpack_require__(1025); var _HighlightLines2 = _interopRequireDefault(_HighlightLines); -var _Preview = __webpack_require__(657); +var _Preview = __webpack_require__(809); var _Preview2 = _interopRequireDefault(_Preview); @@ -24367,11 +24669,15 @@ var _DebugLine = __webpack_require__(313); var _DebugLine2 = _interopRequireDefault(_DebugLine); +var _EmptyLines = __webpack_require__(1144); + +var _EmptyLines2 = _interopRequireDefault(_EmptyLines); + var _editor = __webpack_require__(257); -__webpack_require__(716); +__webpack_require__(905); -__webpack_require__(717); +__webpack_require__(906); var _devtoolsSourceEditor = __webpack_require__(994); @@ -24403,10 +24709,8 @@ class Editor extends _react.PureComponent { self.onEscape = this.onEscape.bind(this); self.onGutterClick = this.onGutterClick.bind(this); self.onGutterContextMenu = this.onGutterContextMenu.bind(this); - self.onScroll = this.onScroll.bind(this); self.onSearchAgain = this.onSearchAgain.bind(this); self.onToggleBreakpoint = this.onToggleBreakpoint.bind(this); - self.onMouseOver = (0, _lodash.debounce)(this.onMouseOver, 40); self.toggleConditionalPanel = this.toggleConditionalPanel.bind(this); } @@ -24424,7 +24728,7 @@ class Editor extends _react.PureComponent { if (this.props.selectedSource) { this.showMessage(""); } - } else if (selectedSource.get("loading")) { + } else if (!(0, _source.isLoaded)(selectedSource.toJS())) { this.showMessage(L10N.getStr("loadingText")); } else if (selectedSource.get("error")) { this.showMessage(selectedSource.get("error")); @@ -24464,7 +24768,6 @@ class Editor extends _react.PureComponent { // Set code editor wrapper to be focusable codeMirrorWrapper.tabIndex = 0; codeMirrorWrapper.addEventListener("keydown", e => this.onKeyDown(e)); - codeMirrorWrapper.addEventListener("mouseover", e => this.onMouseOver(e)); var toggleFoldMarkerVisibility = e => { if (node instanceof HTMLElement) { @@ -24486,8 +24789,6 @@ class Editor extends _react.PureComponent { codeMirrorWrapper.addEventListener("contextmenu", event => this.openMenu(event, codeMirror)); } - codeMirror.on("scroll", this.onScroll); - this.setState({ editor }); return editor; } @@ -24619,10 +24920,6 @@ class Editor extends _react.PureComponent { } } - onScroll() { - this.clearPreviewSelection(); - } - onSearchAgain(_, e) { var _props3 = this.props, query = _props3.query, @@ -24635,10 +24932,6 @@ class Editor extends _react.PureComponent { (0, _editor.traverseResults)(e, ctx, query, direction, searchModifiers.toJS()); } - clearPreviewSelection() { - this.props.clearSelection(); - } - inSelectedFrameSource() { var _props4 = this.props, selectedLocation = _props4.selectedLocation, @@ -24673,7 +24966,9 @@ class Editor extends _react.PureComponent { onGutterClick(cm, line, gutter, ev) { var _props6 = this.props, selectedSource = _props6.selectedSource, - toggleBreakpoint = _props6.toggleBreakpoint; + toggleBreakpoint = _props6.toggleBreakpoint, + addOrToggleDisabledBreakpoint = _props6.addOrToggleDisabledBreakpoint, + isEmptyLine = _props6.isEmptyLine; // ignore right clicks in the gutter @@ -24681,6 +24976,10 @@ class Editor extends _react.PureComponent { return; } + if (isEmptyLine(line)) { + return; + } + if (this.isCbPanelOpen()) { return this.closeConditionalPanel(); } @@ -24690,7 +24989,11 @@ class Editor extends _react.PureComponent { } if (gutter !== "CodeMirror-foldgutter") { - toggleBreakpoint((0, _editor.toSourceLine)(selectedSource.get("id"), line)); + if (ev.shiftKey) { + addOrToggleDisabledBreakpoint((0, _editor.toSourceLine)(selectedSource.get("id"), line)); + } else { + toggleBreakpoint((0, _editor.toSourceLine)(selectedSource.get("id"), line)); + } } } @@ -24699,7 +25002,8 @@ class Editor extends _react.PureComponent { selectedSource = _props7.selectedSource, breakpoints = _props7.breakpoints, toggleBreakpoint = _props7.toggleBreakpoint, - toggleDisabledBreakpoint = _props7.toggleDisabledBreakpoint; + toggleDisabledBreakpoint = _props7.toggleDisabledBreakpoint, + isEmptyLine = _props7.isEmptyLine; if (selectedSource && selectedSource.get("isBlackBoxed")) { @@ -24711,6 +25015,10 @@ class Editor extends _react.PureComponent { var line = (0, _editor.lineAtHeight)(this.state.editor, sourceId, event); var breakpoint = breakpoints.find(bp => bp.location.line === line); + if (isEmptyLine(line - 1)) { + return; + } + (0, _GutterMenu2.default)({ event, line, @@ -24724,14 +25032,6 @@ class Editor extends _react.PureComponent { }); } - onMouseOver(e) { - var target = e.target; - - if (this.inSelectedFrameSource()) { - (0, _editor.updateSelection)(target, this.state.editor, this.props); - } - } - toggleConditionalPanel(line) { if (this.isCbPanelOpen()) { return this.closeConditionalPanel(); @@ -24855,7 +25155,7 @@ class Editor extends _react.PureComponent { selectedSource = _props10.selectedSource; - if (!selectedSource || selectedSource.get("loading") || !hitCount || !this.state.editor) { + if (!selectedSource || !(0, _source.isLoaded)(selectedSource.toJS()) || !hitCount || !this.state.editor) { return; } @@ -24867,38 +25167,13 @@ class Editor extends _react.PureComponent { } renderPreview() { - var _props11 = this.props, - selectedSource = _props11.selectedSource, - selection = _props11.selection; + var selectedSource = this.props.selectedSource; if (!this.state.editor || !selectedSource) { return null; } - if (!selection || selection.updating) { - return; - } - - var result = selection.result, - expression = selection.expression, - location = selection.location, - cursorPos = selection.cursorPos; - - var value = result; - if (typeof value == "undefined" || value.optimizedOut) { - return; - } - - var editorRange = (0, _editor.toEditorRange)(selectedSource.get("id"), location); - - return _react2.default.createElement(_Preview2.default, { - value: value, - editor: this.state.editor, - range: editorRange, - expression: expression, - popoverPos: cursorPos, - onClose: () => this.clearPreviewSelection() - }); + return _react2.default.createElement(_Preview2.default, { editor: this.state.editor }); } renderInScopeLines() { @@ -24925,11 +25200,11 @@ class Editor extends _react.PureComponent { } renderSearchBar() { - var _props12 = this.props, - selectSource = _props12.selectSource, - selectedSource = _props12.selectedSource, - highlightLineRange = _props12.highlightLineRange, - clearHighlightLineRange = _props12.clearHighlightLineRange; + var _props11 = this.props, + selectSource = _props11.selectSource, + selectedSource = _props11.selectedSource, + highlightLineRange = _props11.highlightLineRange, + clearHighlightLineRange = _props11.clearHighlightLineRange; if (!this.state.editor) { @@ -24963,11 +25238,19 @@ class Editor extends _react.PureComponent { return _react2.default.createElement(_Breakpoints2.default, { editor: this.state.editor }); } + renderEmptyLines() { + if (!this.state.editor) { + return null; + } + + return _react2.default.createElement(_EmptyLines2.default, { editor: this.state.editor }); + } + renderDebugLine() { var editor = this.state.editor; - var _props13 = this.props, - selectedLocation = _props13.selectedLocation, - selectedFrame = _props13.selectedFrame; + var _props12 = this.props, + selectedLocation = _props12.selectedLocation, + selectedFrame = _props12.selectedFrame; if (!editor || !selectedLocation || !selectedFrame || !selectedLocation.line || selectedFrame.location.sourceId !== selectedLocation.sourceId) { return null; @@ -24981,9 +25264,9 @@ class Editor extends _react.PureComponent { } render() { - var _props14 = this.props, - coverageOn = _props14.coverageOn, - pauseData = _props14.pauseData; + var _props13 = this.props, + coverageOn = _props13.coverageOn, + pauseData = _props13.pauseData; return _react2.default.createElement( @@ -25006,7 +25289,8 @@ class Editor extends _react.PureComponent { this.renderPreview(), this.renderCallSites(), this.renderDebugLine(), - this.renderBreakpoints() + this.renderBreakpoints(), + this.renderEmptyLines() ); } } @@ -25042,13 +25326,13 @@ Editor.propTypes = { regexMatch: _react.PropTypes.bool.isRequired, wholeWord: _react.PropTypes.bool.isRequired }).isRequired, - selection: _react.PropTypes.object, startPanelSize: _react.PropTypes.number, endPanelSize: _react.PropTypes.number, - clearSelection: _react.PropTypes.func.isRequired, linesInScope: _react.PropTypes.array, toggleBreakpoint: _react.PropTypes.func.isRequired, - toggleDisabledBreakpoint: _react.PropTypes.func.isRequired + addOrToggleDisabledBreakpoint: _react.PropTypes.func.isRequired, + toggleDisabledBreakpoint: _react.PropTypes.func.isRequired, + isEmptyLine: _react.PropTypes.func }; Editor.contextTypes = { @@ -25074,7 +25358,7 @@ exports.default = (0, _reactRedux.connect)(state => { query: (0, _selectors.getFileSearchQueryState)(state), searchModifiers: (0, _selectors.getFileSearchModifierState)(state), linesInScope: (0, _selectors.getInScopeLines)(state), - selection: (0, _selectors.getSelection)(state) + isEmptyLine: line => (0, _ast.isEmptyLineInSource)(state, line, selectedSource.toJS()) }; }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Editor); @@ -25121,7 +25405,7 @@ var _PaneToggle = __webpack_require__(428); var _PaneToggle2 = _interopRequireDefault(_PaneToggle); -__webpack_require__(705); +__webpack_require__(875); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -25132,7 +25416,7 @@ class SourceFooter extends _react.PureComponent { selectedSource = _props.selectedSource, togglePrettyPrint = _props.togglePrettyPrint; - var sourceLoaded = selectedSource && !selectedSource.get("loading"); + var sourceLoaded = selectedSource && (0, _source.isLoaded)(selectedSource.toJS()); if (!(0, _editor.shouldShowPrettyPrint)(selectedSource)) { return; @@ -25153,7 +25437,7 @@ class SourceFooter extends _react.PureComponent { title: tooltip, "aria-label": tooltip }, - (0, _Svg2.default)(type) + _react2.default.createElement(_Svg2.default, { name: type }) ); } @@ -25162,7 +25446,7 @@ class SourceFooter extends _react.PureComponent { selectedSource = _props2.selectedSource, toggleBlackBox = _props2.toggleBlackBox; - var sourceLoaded = selectedSource && !selectedSource.get("loading"); + var sourceLoaded = selectedSource && (0, _source.isLoaded)(selectedSource.toJS()); var blackboxed = selectedSource.get("isBlackBoxed"); @@ -25185,7 +25469,7 @@ class SourceFooter extends _react.PureComponent { title: tooltip, "aria-label": tooltip }, - (0, _Svg2.default)("blackBox") + _react2.default.createElement(_Svg2.default, { name: "blackBox" }) ); } @@ -25309,7 +25593,7 @@ var _Svg = __webpack_require__(344); var _Svg2 = _interopRequireDefault(_Svg); -__webpack_require__(704); +__webpack_require__(874); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -25343,7 +25627,7 @@ class PaneToggleButton extends _react.Component { onClick: () => handleClick(position, collapsed), title: title }, - (0, _Svg2.default)("togglePanes") + _react2.default.createElement(_Svg2.default, { name: "togglePanes" }) ); } } @@ -25391,6 +25675,8 @@ var _editor = __webpack_require__(257); var _search = __webpack_require__(1115); +var _source = __webpack_require__(233); + var _resultList = __webpack_require__(343); var _classnames = __webpack_require__(175); @@ -25405,7 +25691,7 @@ var _SearchInput = __webpack_require__(377); var _SearchInput2 = _interopRequireDefault(_SearchInput); -__webpack_require__(706); +__webpack_require__(876); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -25502,8 +25788,8 @@ class SearchBar extends _react.Component { (0, _resultList.scrollList)(this.refs.resultList.refs, this.state.selectedResultIndex); } - var hasLoaded = selectedSource && !selectedSource.get("loading"); - var wasLoading = prevProps.selectedSource && prevProps.selectedSource.get("loading"); + var hasLoaded = selectedSource && (0, _source.isLoaded)(selectedSource.toJS()); + var wasLoading = prevProps.selectedSource && (0, _source.isLoaded)(prevProps.selectedSource.toJS()); var doneLoading = wasLoading && hasLoaded; var changedFiles = selectedSource != prevProps.selectedSource && hasLoaded; @@ -25739,7 +26025,7 @@ class SearchBar extends _react.Component { onClick: () => toggleFileSearchModifier(modVal), title: tooltip }, - (0, _Svg2.default)(svgName) + _react2.default.createElement(_Svg2.default, { name: svgName }) ); } @@ -26054,8 +26340,229 @@ exports.default = (0, _reactRedux.connect)(state => { /* 648 */, /* 649 */, /* 650 */, -/* 651 */, -/* 652 */, +/* 651 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(84), + now = __webpack_require__(652), + toNumber = __webpack_require__(304); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max, + nativeMin = Math.min; + +/** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed `func` invocations and a `flush` method to immediately invoke them. + * Provide `options` to indicate whether `func` should be invoked on the + * leading and/or trailing edge of the `wait` timeout. The `func` is invoked + * with the last arguments provided to the debounced function. Subsequent + * calls to the debounced function return the result of the last `func` + * invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the debounced function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.debounce` and `_.throttle`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); + * + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); + * var source = new EventSource('/stream'); + * jQuery(source).on('message', debounced); + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel); + */ +function debounce(func, wait, options) { + var lastArgs, + lastThis, + maxWait, + result, + timerId, + lastCallTime, + lastInvokeTime = 0, + leading = false, + maxing = false, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + wait = toNumber(wait) || 0; + if (isObject(options)) { + leading = !!options.leading; + maxing = 'maxWait' in options; + maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + + function invokeFunc(time) { + var args = lastArgs, + thisArg = lastThis; + + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; + } + + function leadingEdge(time) { + // Reset any `maxWait` timer. + lastInvokeTime = time; + // Start the timer for the trailing edge. + timerId = setTimeout(timerExpired, wait); + // Invoke the leading edge. + return leading ? invokeFunc(time) : result; + } + + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime, + result = wait - timeSinceLastCall; + + return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result; + } + + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime; + + // Either this is the first call, activity has stopped and we're at the + // trailing edge, the system time has gone backwards and we're treating + // it as the trailing edge, or we've hit the `maxWait` limit. + return (lastCallTime === undefined || (timeSinceLastCall >= wait) || + (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); + } + + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); + } + // Restart the timer. + timerId = setTimeout(timerExpired, remainingWait(time)); + } + + function trailingEdge(time) { + timerId = undefined; + + // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + if (trailing && lastArgs) { + return invokeFunc(time); + } + lastArgs = lastThis = undefined; + return result; + } + + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = undefined; + } + + function flush() { + return timerId === undefined ? result : trailingEdge(now()); + } + + function debounced() { + var time = now(), + isInvoking = shouldInvoke(time); + + lastArgs = arguments; + lastThis = this; + lastCallTime = time; + + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); + } + if (maxing) { + // Handle invocations in a tight loop. + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } + } + if (timerId === undefined) { + timerId = setTimeout(timerExpired, wait); + } + return result; + } + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; +} + +module.exports = debounce; + + +/***/ }), +/* 652 */ +/***/ (function(module, exports, __webpack_require__) { + +var root = __webpack_require__(8); + +/** + * Gets the timestamp of the number of milliseconds that have elapsed since + * the Unix epoch (1 January 1970 00:00:00 UTC). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Date + * @returns {number} Returns the timestamp. + * @example + * + * _.defer(function(stamp) { + * console.log(_.now() - stamp); + * }, _.now()); + * // => Logs the number of milliseconds it took for the deferred invocation. + */ +var now = function() { + return root.Date.now(); +}; + +module.exports = now; + + +/***/ }), /* 653 */, /* 654 */, /* 655 */ @@ -26192,6 +26699,8 @@ function getMenuItems(event, _ref) { toggleBlackBox = _ref.toggleBlackBox, addExpression = _ref.addExpression; + var copySourceLabel = L10N.getStr("copySource"); + var copySourceKey = L10N.getStr("copySource.accesskey"); var copySourceUrlLabel = L10N.getStr("copySourceUrl"); var copySourceUrlKey = L10N.getStr("copySourceUrl.accesskey"); var revealInTreeLabel = L10N.getStr("sourceTabs.revealInTree"); @@ -26202,13 +26711,21 @@ function getMenuItems(event, _ref) { var toggleBlackBoxLabel = selectedSource.get("isBlackBoxed") ? unblackboxLabel : blackboxLabel; var copySourceUrl = { - id: "node-menu-copy-source", + id: "node-menu-copy-source-url", label: copySourceUrlLabel, accesskey: copySourceUrlKey, disabled: false, click: () => (0, _clipboard.copyToTheClipboard)(selectedSource.get("url")) }; + var copySource = { + id: "node-menu-copy-source", + label: copySourceLabel, + accesskey: copySourceKey, + disabled: false, + click: () => (0, _clipboard.copyToTheClipboard)(codeMirror.getSelection()) + }; + var _codeMirror$coordsCha = codeMirror.coordsChar({ left: event.clientX, top: event.clientY @@ -26260,7 +26777,7 @@ function getMenuItems(event, _ref) { return [blackBoxMenuItem]; } - var menuItems = [copySourceUrl, jumpLabel, showSourceMenuItem, blackBoxMenuItem]; + var menuItems = [copySource, copySourceUrl, jumpLabel, showSourceMenuItem, blackBoxMenuItem]; if (textSelected) { menuItems.push(watchExpressionLabel); @@ -26272,241 +26789,7 @@ function getMenuItems(event, _ref) { exports.default = EditorMenu; /***/ }), -/* 657 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Preview = undefined; - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _reactRedux = __webpack_require__(151); - -var _redux = __webpack_require__(3); - -var _devtoolsConfig = __webpack_require__(828); - -var _devtoolsReps = __webpack_require__(924); - -var _devtoolsReps2 = _interopRequireDefault(_devtoolsReps); - -var _Popover = __webpack_require__(698); - -var _Popover2 = _interopRequireDefault(_Popover); - -var _previewFunction = __webpack_require__(701); - -var _previewFunction2 = _interopRequireDefault(_previewFunction); - -var _selectors = __webpack_require__(242); - -var _actions = __webpack_require__(244); - -var _actions2 = _interopRequireDefault(_actions); - -var _editor = __webpack_require__(257); - -__webpack_require__(712); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var Rep = _devtoolsReps2.default.REPS.Rep, - MODE = _devtoolsReps2.default.MODE, - ObjectInspectorUtils = _devtoolsReps2.default.ObjectInspectorUtils; -var ObjectInspector = _devtoolsReps2.default.ObjectInspector; -var getChildren = ObjectInspectorUtils.getChildren; -class Preview extends _react.Component { - - componentDidMount() { - var _props = this.props, - loadObjectProperties = _props.loadObjectProperties, - loadedObjects = _props.loadedObjects, - value = _props.value, - editor = _props.editor, - range = _props.range; - - - this.marker = (0, _editor.markText)(editor, "selection", range); - - if (!value || !value.type == "object") { - return; - } - - if (value.actor && !loadedObjects[value.actor]) { - loadObjectProperties(value); - } - } - - componentWillUnmount() { - if (this.marker) { - this.marker.clear(); - } - } - - getChildren(root, getObjectProperties) { - var actors = {}; - - var children = getChildren({ - getObjectProperties, - actors, - item: root - }); - - if (children.length > 0) { - return children; - } - - return [root]; - } - - renderFunctionPreview(value, root) { - var selectSourceURL = this.props.selectSourceURL; - var location = value.location; - - - return _react2.default.createElement( - "div", - { - className: "preview", - onClick: () => selectSourceURL(location.url, { line: location.line }) - }, - (0, _previewFunction2.default)(value) - ); - } - - renderObjectPreview(expression, root) { - return _react2.default.createElement( - "div", - { className: "preview" }, - this.renderObjectInspector(root) - ); - } - - renderSimplePreview(value) { - return _react2.default.createElement( - "div", - { className: "preview" }, - Rep({ object: value, mode: MODE.LONG }) - ); - } - - renderObjectInspector(root) { - var _props2 = this.props, - loadObjectProperties = _props2.loadObjectProperties, - loadedObjects = _props2.loadedObjects; - - - var getObjectProperties = id => loadedObjects[id]; - var roots = this.getChildren(root, getObjectProperties); - - return _react2.default.createElement(ObjectInspector, { - roots: roots, - autoExpandDepth: 0, - disableWrap: true, - disabledFocus: true, - getObjectProperties: getObjectProperties, - loadObjectProperties: loadObjectProperties - // TODO: See https://github.com/devtools-html/debugger.html/issues/3555. - , getObjectEntries: actor => {}, - loadObjectEntries: grip => {} - }); - } - - renderAddToExpressionBar(expression) { - if (!(0, _devtoolsConfig.isEnabled)("previewWatch")) { - return null; - } - - var addExpression = this.props.addExpression; - - return _react2.default.createElement( - "div", - { className: "add-to-expression-bar" }, - _react2.default.createElement( - "div", - { className: "prompt" }, - "\xBB" - ), - _react2.default.createElement( - "div", - { className: "expression-to-save-label" }, - expression - ), - _react2.default.createElement( - "div", - { - className: "expression-to-save-button", - onClick: event => addExpression(event) - }, - L10N.getStr("addWatchExpressionButton") - ) - ); - } - - renderPreview(expression, value) { - var root = { - name: expression, - path: expression, - contents: { value } - }; - - if (value.class === "Function") { - return this.renderFunctionPreview(value, root); - } - - if (value.type === "object") { - return _react2.default.createElement( - "div", - null, - this.renderObjectPreview(expression, root), - this.renderAddToExpressionBar(expression) - ); - } - - return this.renderSimplePreview(value); - } - - getPreviewType(value) { - if (typeof value == "boolean" || value.type == "null" || value.type == "undefined" || value.class === "Function") { - return "tooltip"; - } - - return "popover"; - } - - render() { - var _props3 = this.props, - popoverPos = _props3.popoverPos, - onClose = _props3.onClose, - value = _props3.value, - expression = _props3.expression; - - - var type = this.getPreviewType(value); - - return _react2.default.createElement( - _Popover2.default, - { targetPosition: popoverPos, onMouseLeave: onClose, type: type }, - this.renderPreview(expression, value) - ); - } -} - -exports.Preview = Preview; -Preview.displayName = "Preview"; - -exports.default = (0, _reactRedux.connect)(state => ({ - loadedObjects: (0, _selectors.getLoadedObjects)(state) -}), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Preview); - -/***/ }), +/* 657 */, /* 658 */, /* 659 */, /* 660 */, @@ -26538,120 +26821,25 @@ module.exports = __WEBPACK_EXTERNAL_MODULE_677__; module.exports = __WEBPACK_EXTERNAL_MODULE_678__; /***/ }), -/* 679 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 680 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 681 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 682 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 683 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 684 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 685 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 686 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 687 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 688 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 689 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 690 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 691 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 692 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 693 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 694 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 695 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 696 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 697 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), +/* 679 */, +/* 680 */, +/* 681 */, +/* 682 */, +/* 683 */, +/* 684 */, +/* 685 */, +/* 686 */, +/* 687 */, +/* 688 */, +/* 689 */, +/* 690 */, +/* 691 */, +/* 692 */, +/* 693 */, +/* 694 */, +/* 695 */, +/* 696 */, +/* 697 */, /* 698 */ /***/ (function(module, exports, __webpack_require__) { @@ -26678,13 +26866,14 @@ var _BracketArrow = __webpack_require__(1029); var _BracketArrow2 = _interopRequireDefault(_BracketArrow); -__webpack_require__(710); +__webpack_require__(880); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class Popover extends _react.Component { constructor() { super(); + this.onMouseLeave = this.onMouseLeave.bind(this); this.state = { left: 0, top: 0 @@ -26779,8 +26968,18 @@ class Popover extends _react.Component { return _react2.default.createElement(_BracketArrow2.default, arrowProps); } - renderPopover() { + onMouseLeave(e) { var onMouseLeave = this.props.onMouseLeave; + + + if (e.target.className.match(/(bracket-arrow|gap)/)) { + return; + } + + onMouseLeave(); + } + + renderPopover() { var _state = this.state, top = _state.top, left = _state.left, @@ -26794,7 +26993,7 @@ class Popover extends _react.Component { "div", { className: (0, _classnames2.default)("popover", { up: orientation === "up" }), - onMouseLeave: onMouseLeave, + onMouseLeave: this.onMouseLeave, style: { top, left } }, arrow, @@ -26850,124 +27049,18 @@ Popover.displayName = "Popover"; exports.default = Popover; /***/ }), -/* 699 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 700 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 701 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _react = __webpack_require__(0); - -var _lodash = __webpack_require__(2); - -var _frame = __webpack_require__(1014); - -__webpack_require__(702); - -function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - -function getFunctionName(func) { - var name = func.userDisplayName || func.displayName || func.name; - return (0, _frame.simplifyDisplayName)(name); -} - -function renderFunctionName(func) { - var name = getFunctionName(func); - return _react.DOM.span({ className: "function-name" }, name); -} - -function renderParams(func) { - var _func$parameterNames = func.parameterNames, - parameterNames = _func$parameterNames === undefined ? [] : _func$parameterNames; - - var params = parameterNames.filter(i => i).map(param => _react.DOM.span({ className: "param" }, param)); - - var commas = (0, _lodash.times)(params.length - 1).map(() => _react.DOM.span({ className: "delimiter" }, ", ")); - - return (0, _lodash.flatten)((0, _lodash.zip)(params, commas)); -} - -function renderParen(paren) { - return _react.DOM.span({ className: "paren" }, paren); -} - -function previewFunction(func) { - return _react.DOM.span.apply(_react.DOM, [{ className: "function-signature" }, renderFunctionName(func), renderParen("(")].concat(_toConsumableArray(renderParams(func)), [renderParen(")")])); -} - -exports.default = previewFunction; - -/***/ }), -/* 702 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 703 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 704 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 705 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 706 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 707 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 708 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 709 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 710 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), +/* 699 */, +/* 700 */, +/* 701 */, +/* 702 */, +/* 703 */, +/* 704 */, +/* 705 */, +/* 706 */, +/* 707 */, +/* 708 */, +/* 709 */, +/* 710 */, /* 711 */ /***/ (function(module, exports, __webpack_require__) { @@ -26981,6 +27074,8 @@ exports.renderConditionalPanel = undefined; var _react = __webpack_require__(0); +var _react2 = _interopRequireDefault(_react); + var _reactDom = __webpack_require__(4); var _reactDom2 = _interopRequireDefault(_reactDom); @@ -26989,7 +27084,7 @@ var _Close = __webpack_require__(378); var _Close2 = _interopRequireDefault(_Close); -__webpack_require__(703); +__webpack_require__(873); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -27021,16 +27116,26 @@ function renderConditionalPanel(_ref) { } } - _reactDom2.default.render(_react.DOM.div({ className: "conditional-breakpoint-panel" }, _react.DOM.div({ className: "prompt" }, "»"), _react.DOM.input({ - defaultValue: condition, - placeholder: L10N.getStr("editor.conditionalPanel.placeholder"), - onKeyDown: onKey, - ref: setInput - }), (0, _Close2.default)({ - handleClick: closePanel, - buttonClass: "big", - tooltip: L10N.getStr("editor.conditionalPanel.close") - })), panel); + _reactDom2.default.render(_react2.default.createElement( + "div", + { className: "conditional-breakpoint-panel" }, + _react2.default.createElement( + "div", + { className: "prompt" }, + "\xBB" + ), + _react2.default.createElement("input", { + defaultValue: condition, + placeholder: L10N.getStr("editor.conditionalPanel.placeholder"), + onKeyDown: onKey, + ref: setInput + }), + _react2.default.createElement(_Close2.default, { + handleClick: closePanel, + buttonClass: "big", + tooltip: L10N.getStr("editor.conditionalPanel.close") + }) + ), panel); return panel; } @@ -27038,18 +27143,8 @@ function renderConditionalPanel(_ref) { exports.renderConditionalPanel = renderConditionalPanel; /***/ }), -/* 712 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 713 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), +/* 712 */, +/* 713 */, /* 714 */ /***/ (function(module, exports, __webpack_require__) { @@ -27062,6 +27157,8 @@ Object.defineProperty(exports, "__esModule", { var _react = __webpack_require__(0); +var _react2 = _interopRequireDefault(_react); + var _devtoolsConfig = __webpack_require__(828); var _reactDom = __webpack_require__(4); @@ -27081,7 +27178,7 @@ var _editor = __webpack_require__(257); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var breakpointSvg = document.createElement("div"); -_reactDom2.default.render((0, _Svg2.default)("breakpoint"), breakpointSvg); +_reactDom2.default.render(_react2.default.createElement(_Svg2.default, { name: "breakpoint" }), breakpointSvg); function makeMarker(isDisabled) { var bp = breakpointSvg.cloneNode(true); @@ -27106,9 +27203,14 @@ class Breakpoint extends _react.Component { editor = _props.editor, selectedSource = _props.selectedSource; + // Hidden Breakpoints are never rendered on the client + + if (breakpoint.hidden) { + return; + } + // NOTE: we need to wait for the breakpoint to be loaded // to get the generated location - if (!selectedSource || breakpoint.loading) { return; } @@ -27134,7 +27236,7 @@ class Breakpoint extends _react.Component { breakpoint = _props2.breakpoint, selectedSource = _props2.selectedSource; - return editor !== nextProps.editor || breakpoint.disabled !== nextProps.breakpoint.disabled || breakpoint.condition !== nextProps.breakpoint.condition || breakpoint.loading !== nextProps.breakpoint.loading || selectedSource !== nextProps.selectedSource; + return editor !== nextProps.editor || breakpoint.disabled !== nextProps.breakpoint.disabled || breakpoint.hidden !== nextProps.breakpoint.hidden || breakpoint.condition !== nextProps.breakpoint.condition || breakpoint.loading !== nextProps.breakpoint.loading || selectedSource !== nextProps.selectedSource; } componentDidMount() { @@ -27251,18 +27353,8 @@ HitMarker.displayName = "HitMarker"; exports.default = HitMarker; /***/ }), -/* 716 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 717 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), +/* 716 */, +/* 717 */, /* 718 */ /***/ (function(module, exports, __webpack_require__) { @@ -27275,6 +27367,8 @@ Object.defineProperty(exports, "__esModule", { var _react = __webpack_require__(0); +var _react2 = _interopRequireDefault(_react); + var _reactRedux = __webpack_require__(151); var _redux = __webpack_require__(3); @@ -27297,33 +27391,37 @@ var _Svg2 = _interopRequireDefault(_Svg); var _prefs = __webpack_require__(226); -var _Breakpoints2 = __webpack_require__(725); +var _Breakpoints = __webpack_require__(725); -var _Breakpoints3 = _interopRequireDefault(_Breakpoints2); +var _Breakpoints2 = _interopRequireDefault(_Breakpoints); -var _Expressions2 = __webpack_require__(719); +var _Expressions = __webpack_require__(719); -var _Expressions3 = _interopRequireDefault(_Expressions2); +var _Expressions2 = _interopRequireDefault(_Expressions); var _devtoolsSplitter = __webpack_require__(910); var _devtoolsSplitter2 = _interopRequireDefault(_devtoolsSplitter); -var _Frames2 = __webpack_require__(1012); +var _Frames = __webpack_require__(1012); -var _Frames3 = _interopRequireDefault(_Frames2); +var _Frames2 = _interopRequireDefault(_Frames); -var _EventListeners2 = __webpack_require__(736); +var _EventListeners = __webpack_require__(736); -var _EventListeners3 = _interopRequireDefault(_EventListeners2); +var _EventListeners2 = _interopRequireDefault(_EventListeners); -var _Accordion2 = __webpack_require__(739); +var _Workers = __webpack_require__(1147); -var _Accordion3 = _interopRequireDefault(_Accordion2); +var _Workers2 = _interopRequireDefault(_Workers); -var _CommandBar2 = __webpack_require__(742); +var _Accordion = __webpack_require__(739); -var _CommandBar3 = _interopRequireDefault(_CommandBar2); +var _Accordion2 = _interopRequireDefault(_Accordion); + +var _CommandBar = __webpack_require__(742); + +var _CommandBar2 = _interopRequireDefault(_CommandBar); var _ChromeScopes = __webpack_require__(728); @@ -27333,32 +27431,27 @@ var _Scopes2 = __webpack_require__(731); var _Scopes3 = _interopRequireDefault(_Scopes2); -__webpack_require__(730); +__webpack_require__(921); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } -var Breakpoints = (0, _react.createFactory)(_Breakpoints3.default); - -var Expressions = (0, _react.createFactory)(_Expressions3.default); - -var SplitBox = (0, _react.createFactory)(_devtoolsSplitter2.default); - -var Frames = (0, _react.createFactory)(_Frames3.default); - -var EventListeners = (0, _react.createFactory)(_EventListeners3.default); - -var Accordion = (0, _react.createFactory)(_Accordion3.default); - -var CommandBar = (0, _react.createFactory)(_CommandBar3.default); - -var Scopes = (0, _devtoolsConfig.isEnabled)("chromeScopes") ? (0, _react.createFactory)(_ChromeScopes2.default) : (0, _react.createFactory)(_Scopes3.default); +var Scopes = (0, _devtoolsConfig.isEnabled)("chromeScopes") ? _ChromeScopes2.default : _Scopes3.default; function debugBtn(onClick, type, className, tooltip) { - className = `${type} ${className}`; - return _react.DOM.button({ onClick, className, key: type, title: tooltip }, (0, _Svg2.default)(type, { title: tooltip, "aria-label": tooltip })); + return _react2.default.createElement( + "button", + { + onClick: onClick, + className: `${type} ${className}`, + key: type, + title: tooltip + }, + _react2.default.createElement(_Svg2.default, { name: type, title: tooltip, "aria-label": tooltip }) + ); } +debugBtn.displayName = "DebugButton"; class SecondaryPanes extends _react.Component { renderBreakpointsToggle() { @@ -27375,7 +27468,7 @@ class SecondaryPanes extends _react.Component { return null; } - return _react.DOM.input({ + var inputProps = { type: "checkbox", "aria-label": breakpointsDisabled ? L10N.getStr("breakpoints.enable") : L10N.getStr("breakpoints.disable"), className: boxClassName, @@ -27392,7 +27485,9 @@ class SecondaryPanes extends _react.Component { } }, title: breakpointsDisabled ? L10N.getStr("breakpoints.enable") : L10N.getStr("breakpoints.disable") - }); + }; + + return _react2.default.createElement("input", inputProps); } watchExpressionHeaderButtons() { @@ -27420,7 +27515,7 @@ class SecondaryPanes extends _react.Component { return { header: L10N.getStr("watchExpressions.header"), buttons: this.watchExpressionHeaderButtons(), - component: Expressions, + component: _Expressions2.default, opened: true }; } @@ -27432,11 +27527,11 @@ class SecondaryPanes extends _react.Component { var items = [{ header: L10N.getStr("breakpoints.header"), buttons: this.renderBreakpointsToggle(), - component: Breakpoints, + component: _Breakpoints2.default, opened: true }, { header: L10N.getStr("callStack.header"), - component: Frames, + component: _Frames2.default, opened: _prefs.prefs.callStackVisible, onToggle: opened => { _prefs.prefs.callStackVisible = opened; @@ -27447,7 +27542,14 @@ class SecondaryPanes extends _react.Component { if ((0, _devtoolsConfig.isEnabled)("eventListeners")) { items.push({ header: L10N.getStr("eventListenersHeader"), - component: EventListeners + component: _EventListeners2.default + }); + } + + if ((0, _devtoolsConfig.isEnabled)("workers")) { + items.push({ + header: L10N.getStr("workersHeader"), + component: _Workers2.default }); } @@ -27459,9 +27561,7 @@ class SecondaryPanes extends _react.Component { } renderHorizontalLayout() { - return Accordion({ - items: this.getItems() - }); + return _react2.default.createElement(_Accordion2.default, { items: this.getItems() }); } getEndItems() { @@ -27483,21 +27583,24 @@ class SecondaryPanes extends _react.Component { } renderVerticalLayout() { - return SplitBox({ + return _react2.default.createElement(_devtoolsSplitter2.default, { style: { width: "100vw" }, initialSize: "300px", minSize: 10, maxSize: "50%", splitterSize: 1, - startPanel: Accordion({ items: this.getStartItems() }), - endPanel: Accordion({ items: this.getEndItems() }) + startPanel: _react2.default.createElement(_Accordion2.default, { items: this.getStartItems() }), + endPanel: _react2.default.createElement(_Accordion2.default, { items: this.getEndItems() }) }); } render() { - return _react.DOM.div({ - className: "secondary-panes secondary-panes--sticky-commandbar" - }, CommandBar(), this.props.horizontal ? this.renderHorizontalLayout() : this.renderVerticalLayout()); + return _react2.default.createElement( + "div", + { className: "secondary-panes secondary-panes--sticky-commandbar" }, + _react2.default.createElement(_CommandBar2.default, { horizontal: this.props.horizontal }), + this.props.horizontal ? this.renderHorizontalLayout() : this.renderVerticalLayout() + ); } } @@ -27555,7 +27658,7 @@ var _Close2 = _interopRequireDefault(_Close); var _devtoolsReps = __webpack_require__(924); -__webpack_require__(721); +__webpack_require__(908); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -27784,41 +27887,16 @@ Expressions.displayName = "Expressions"; exports.default = (0, _reactRedux.connect)(state => ({ pauseInfo: (0, _selectors.getPause)(state), - expressions: (0, _selectors.getVisibleExpressions)(state), + expressions: (0, _selectors.getExpressions)(state), loadedObjects: (0, _selectors.getLoadedObjects)(state) }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Expressions); /***/ }), -/* 720 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 721 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 722 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 723 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 724 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), +/* 720 */, +/* 721 */, +/* 722 */, +/* 723 */, +/* 724 */, /* 725 */ /***/ (function(module, exports, __webpack_require__) { @@ -27831,6 +27909,8 @@ Object.defineProperty(exports, "__esModule", { var _react = __webpack_require__(0); +var _react2 = _interopRequireDefault(_react); + var _immutable = __webpack_require__(146); var I = _interopRequireWildcard(_immutable); @@ -27865,14 +27945,14 @@ var _Close = __webpack_require__(378); var _Close2 = _interopRequireDefault(_Close); -__webpack_require__(720); +__webpack_require__(907); var _lodash = __webpack_require__(2); -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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + function isCurrentlyPausedAtBreakpoint(pause, breakpoint) { if (!pause || pause.isInterrupted) { return false; @@ -27889,8 +27969,17 @@ function renderSourceLocation(source, line, column) { var columnVal = (0, _devtoolsConfig.isEnabled)("columnBreakpoints") && column ? `:${column}` : ""; var bpLocation = isWasm ? `0x${line.toString(16).toUpperCase()}` : `${line}${columnVal}`; - return filename ? _react.DOM.div({ className: "location" }, `${(0, _utils.endTruncateStr)(filename, 30)}: ${bpLocation}`) : null; + if (!filename) { + return null; + } + + return _react2.default.createElement( + "div", + { className: "location" }, + `${(0, _utils.endTruncateStr)(filename, 30)}: ${bpLocation}` + ); } +renderSourceLocation.displayName = "SourceLocation"; class Breakpoints extends _react.PureComponent { @@ -28058,37 +28147,67 @@ class Breakpoints extends _react.PureComponent { var isCurrentlyPaused = breakpoint.isCurrentlyPaused; var isDisabled = breakpoint.disabled; var isConditional = !!breakpoint.condition; + var isHidden = breakpoint.hidden; - return _react.DOM.div({ - className: (0, _classnames2.default)({ - breakpoint, - paused: isCurrentlyPaused, - disabled: isDisabled, - "is-conditional": isConditional + if (isHidden) { + return; + } + + return _react2.default.createElement( + "div", + { + className: (0, _classnames2.default)({ + breakpoint, + paused: isCurrentlyPaused, + disabled: isDisabled, + "is-conditional": isConditional + }), + key: locationId, + onClick: () => this.selectBreakpoint(breakpoint), + onContextMenu: e => this.showContextMenu(e, breakpoint) + }, + _react2.default.createElement("input", { + type: "checkbox", + className: "breakpoint-checkbox", + checked: !isDisabled, + onChange: () => this.handleCheckbox(breakpoint), + onClick: ev => ev.stopPropagation() }), - key: locationId, - onClick: () => this.selectBreakpoint(breakpoint), - onContextMenu: e => this.showContextMenu(e, breakpoint) - }, _react.DOM.input({ - type: "checkbox", - className: "breakpoint-checkbox", - checked: !isDisabled, - onChange: () => this.handleCheckbox(breakpoint), - // Prevent clicking on the checkbox from triggering the onClick of - // the surrounding div - onClick: ev => ev.stopPropagation() - }), _react.DOM.div({ className: "breakpoint-label", title: breakpoint.text }, _react.DOM.div({}, renderSourceLocation(breakpoint.location.source, line, column))), _react.DOM.div({ className: "breakpoint-snippet" }, snippet), (0, _Close2.default)({ - handleClick: ev => this.removeBreakpoint(ev, breakpoint), - tooltip: L10N.getStr("breakpoints.removeBreakpointTooltip") - })); + _react2.default.createElement( + "div", + { className: "breakpoint-label", title: breakpoint.text }, + _react2.default.createElement( + "div", + null, + renderSourceLocation(breakpoint.location.source, line, column) + ) + ), + _react2.default.createElement( + "div", + { className: "breakpoint-snippet" }, + snippet + ), + _react2.default.createElement(_Close2.default, { + handleClick: ev => this.removeBreakpoint(ev, breakpoint), + tooltip: L10N.getStr("breakpoints.removeBreakpointTooltip") + }) + ); } render() { var breakpoints = this.props.breakpoints; - return _react.DOM.div({ className: "pane breakpoints-list" }, breakpoints.size === 0 ? _react.DOM.div({ className: "pane-info" }, L10N.getStr("breakpoints.none")) : breakpoints.valueSeq().map(bp => { - return this.renderBreakpoint(bp); - })); + var children = breakpoints.size === 0 ? _react2.default.createElement( + "div", + { className: "pane-info" }, + L10N.getStr("breakpoints.none") + ) : breakpoints.valueSeq().map(bp => this.renderBreakpoint(bp)); + + return _react2.default.createElement( + "div", + { className: "pane breakpoints-list" }, + children + ); } } @@ -28114,18 +28233,8 @@ var _getBreakpoints = (0, _reselect.createSelector)(_selectors.getBreakpoints, _ exports.default = (0, _reactRedux.connect)((state, props) => ({ breakpoints: _getBreakpoints(state) }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Breakpoints); /***/ }), -/* 726 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 727 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), +/* 726 */, +/* 727 */, /* 728 */ /***/ (function(module, exports, __webpack_require__) { @@ -28160,20 +28269,14 @@ var _Svg = __webpack_require__(344); var _Svg2 = _interopRequireDefault(_Svg); -__webpack_require__(679); +var _ManagedTree = __webpack_require__(419); -var _ManagedTree2 = __webpack_require__(419); +var _ManagedTree2 = _interopRequireDefault(_ManagedTree); -var _ManagedTree3 = _interopRequireDefault(_ManagedTree2); +__webpack_require__(850); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var ManagedTree = (0, _react.createFactory)(_ManagedTree3.default); - -function info(text) { - return _react.DOM.div({ className: "pane-info" }, text); -} - // check to see if its an object with propertie function nodeHasProperties(item) { return !nodeHasChildren(item) && item.contents.value.type === "object"; @@ -28238,23 +28341,43 @@ class Scopes extends _react.Component { var notEnumberable = false; var objectValue = ""; - return _react.DOM.div({ - className: (0, _classnames2.default)("node object-node", { - focused: false, - "not-enumerable": notEnumberable + return React.createElement( + "div", + { + className: (0, _classnames2.default)("node object-node", { + focused: false, + "not-enumerable": notEnumberable + }), + style: { marginLeft: depth * 15 }, + key: item.path, + onClick: e => { + e.stopPropagation(); + setExpanded(item, !expanded); + } + }, + React.createElement(_Svg2.default, { + name: "arrow", + className: (0, _classnames2.default)({ + expanded, + hidden: nodeIsPrimitive(item) + }) }), - style: { marginLeft: depth * 15 }, - key: item.path, - onClick: e => { - e.stopPropagation(); - setExpanded(item, !expanded); - } - }, (0, _Svg2.default)("arrow", { - className: (0, _classnames2.default)({ - expanded: expanded, - hidden: nodeIsPrimitive(item) - }) - }), _react.DOM.span({ className: "object-label" }, item.name), _react.DOM.span({ className: "object-delimiter" }, objectValue ? ": " : ""), _react.DOM.span({ className: "object-value" }, objectValue || "")); + React.createElement( + "span", + { className: "object-label" }, + item.name + ), + React.createElement( + "span", + { className: "object-delimiter" }, + objectValue ? ": " : "" + ), + React.createElement( + "span", + { className: "object-value" }, + objectValue || "" + ) + ); } getObjectProperties(item) { @@ -28319,24 +28442,36 @@ class Scopes extends _react.Component { if (!pauseInfo) { - return _react.DOM.div({ className: "pane scopes-list" }, info(L10N.getStr("scopes.notPaused"))); + return React.createElement( + "div", + { className: (0, _classnames2.default)("pane", "scopes-list") }, + React.createElement( + "div", + { className: "pane-info" }, + L10N.getStr("scopes.notPaused") + ) + ); } var roots = this.getRoots(); - return _react.DOM.div({ className: "pane scopes-list" }, ManagedTree({ - itemHeight: 20, - getParent: item => null, - getChildren: this.getChildren, - getRoots: () => roots, - getPath: item => item.path, - autoExpand: 0, - autoExpandDepth: 1, - autoExpandAll: false, - disabledFocus: true, - onExpand: this.onExpand, - renderItem: this.renderItem - })); + return React.createElement( + "div", + { className: (0, _classnames2.default)("pane", "scopes-list") }, + React.createElement(_ManagedTree2.default, { + itemHeight: 20, + getParent: item => null, + getChildren: this.getChildren, + getRoots: () => roots, + getPath: item => item.path, + autoExpand: 0, + autoExpandDepth: 1, + autoExpandAll: false, + disabledFocus: true, + onExpand: this.onExpand, + renderItem: this.renderItem + }) + ); } } @@ -28356,18 +28491,8 @@ exports.default = (0, _reactRedux.connect)(state => ({ }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Scopes); /***/ }), -/* 729 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 730 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), +/* 729 */, +/* 730 */, /* 731 */ /***/ (function(module, exports, __webpack_require__) { @@ -28396,7 +28521,7 @@ var _scopes = __webpack_require__(732); var _devtoolsReps = __webpack_require__(924); -__webpack_require__(679); +__webpack_require__(850); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -28640,24 +28765,9 @@ function getScopes(pauseInfo, selectedFrame, selectedScope) { } /***/ }), -/* 733 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 734 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 735 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), +/* 733 */, +/* 734 */, +/* 735 */, /* 736 */ /***/ (function(module, exports, __webpack_require__) { @@ -28686,7 +28796,7 @@ var _Close = __webpack_require__(378); var _Close2 = _interopRequireDefault(_Close); -__webpack_require__(726); +__webpack_require__(915); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -28784,18 +28894,8 @@ exports.default = (0, _reactRedux.connect)(state => { }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(EventListeners); /***/ }), -/* 737 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 738 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), +/* 737 */, +/* 738 */, /* 739 */ /***/ (function(module, exports, __webpack_require__) { @@ -28814,7 +28914,7 @@ var _Svg = __webpack_require__(344); var _Svg2 = _interopRequireDefault(_Svg); -__webpack_require__(727); +__webpack_require__(917); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -28877,7 +28977,7 @@ class Accordion extends _react.Component { _react2.default.createElement( "div", { className: "_header", onClick: () => this.handleHeaderClick(i) }, - (0, _Svg2.default)("arrow", { className: opened[i] ? "expanded" : "" }), + _react2.default.createElement(_Svg2.default, { name: "arrow", className: opened[i] ? "expanded" : "" }), item.header, item.buttons ? _react2.default.createElement( "div", @@ -28948,7 +29048,7 @@ var _actions = __webpack_require__(244); var _actions2 = _interopRequireDefault(_actions); -__webpack_require__(729); +__webpack_require__(918); var _devtoolsModules = __webpack_require__(830); @@ -29018,7 +29118,7 @@ function debugBtn(onClick, type, className, tooltip) { return _react2.default.createElement( "button", _extends({ className: (0, _classnames2.default)(type, className) }, props), - (0, _Svg2.default)(type) + _react2.default.createElement(_Svg2.default, { name: type }) ); } @@ -29106,7 +29206,11 @@ class CommandBar extends _react.Component { render() { return _react2.default.createElement( "div", - { className: "command-bar" }, + { + className: (0, _classnames2.default)("command-bar", { + vertical: !this.props.horizontal + }) + }, this.renderPauseButton(), this.renderStepButtons(), this.renderPauseOnExceptions() @@ -29164,10 +29268,13 @@ var _PaneToggle = __webpack_require__(428); var _PaneToggle2 = _interopRequireDefault(_PaneToggle); -__webpack_require__(733); +__webpack_require__(922); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _require = __webpack_require__(828), + isEnabled = _require.isEnabled; + class WelcomeBox extends _react.Component { renderToggleButton() { @@ -29189,13 +29296,45 @@ class WelcomeBox extends _react.Component { } render() { - var searchLabel = L10N.getFormatStr("welcome.search", (0, _text.formatKeyShortcut)(L10N.getStr("sources.search.key2"))); + var keyCombinationOne = (0, _text.formatKeyShortcut)(L10N.getStr("sources.search.key2")); + + var keyCombinationTwo = (0, _text.formatKeyShortcut)(L10N.getStr("projectTextSearch.key")); + + var searchSourcesLabel = L10N.getStr("welcome.search").substring(2); + var searchProjectLabel = L10N.getStr("welcome.findInFiles").substring(2); + + var searchProjectLabelComp = _react2.default.createElement( + "div", + null, + _react2.default.createElement( + "b", + null, + keyCombinationTwo + ), + searchProjectLabel + ); + + var searchSourcesLabelComp = _react2.default.createElement( + "div", + null, + _react2.default.createElement( + "b", + null, + keyCombinationOne + ), + searchSourcesLabel + ); return _react2.default.createElement( "div", { className: "welcomebox" }, - searchLabel, - this.renderToggleButton() + _react2.default.createElement( + "div", + { className: "alignlabel" }, + searchSourcesLabelComp, + isEnabled("searchNav") ? searchProjectLabelComp : null, + this.renderToggleButton() + ) ); } } @@ -29259,7 +29398,7 @@ var _lodash = __webpack_require__(2); var _text = __webpack_require__(389); -__webpack_require__(734); +__webpack_require__(923); var _PaneToggle = __webpack_require__(428); @@ -29644,7 +29783,7 @@ class SourceTabs extends _react.PureComponent { onClick: onButtonClick, title: newTabTooltip }, - (0, _Svg2.default)("plus") + _react2.default.createElement(_Svg2.default, { name: "plus" }) ); } @@ -29688,10 +29827,10 @@ class SourceTabs extends _react.PureComponent { var sourceObj = source.toJS(); if ((0, _source.isPretty)(sourceObj)) { - return (0, _Svg2.default)("prettyPrint"); + return _react2.default.createElement(_Svg2.default, { name: "prettyPrint" }); } if (sourceObj.isBlackBoxed) { - return (0, _Svg2.default)("blackBox"); + return _react2.default.createElement(_Svg2.default, { name: "blackBox" }); } } @@ -29735,7 +29874,7 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -__webpack_require__(735); +__webpack_require__(935); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -29964,20 +30103,600 @@ function sortTree(tree) { /***/ }), /* 795 */, /* 796 */, -/* 797 */, -/* 798 */, +/* 797 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getGeneratedLocation = undefined; + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var getGeneratedLocation = exports.getGeneratedLocation = (() => { + var _ref = _asyncToGenerator(function* (state, source, location, sourceMaps) { + if (!sourceMaps.isOriginalId(location.sourceId)) { + return location; + } + + var generatedLocation = yield sourceMaps.getGeneratedLocation(location, source); + var generatedSource = (0, _selectors.getSource)(state, generatedLocation.sourceId); + var sourceUrl = generatedSource.get("url"); + return _extends({}, generatedLocation, { sourceUrl }); + }); + + return function getGeneratedLocation(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); + }; +})(); + +var _selectors = __webpack_require__(242); + +function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } + +/***/ }), +/* 798 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _react = __webpack_require__(0); + +var _react2 = _interopRequireDefault(_react); + +var _lodash = __webpack_require__(2); + +var _frame = __webpack_require__(1014); + +__webpack_require__(872); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function getFunctionName(func) { + var name = func.userDisplayName || func.displayName || func.name; + return (0, _frame.simplifyDisplayName)(name); +} + +class PreviewFunction extends _react.Component { + renderFunctionName(func) { + var name = getFunctionName(func); + return _react2.default.createElement( + "span", + { className: "function-name" }, + name + ); + } + + renderParams(func) { + var _func$parameterNames = func.parameterNames, + parameterNames = _func$parameterNames === undefined ? [] : _func$parameterNames; + + var params = parameterNames.filter(i => i).map(param => _react2.default.createElement( + "span", + { className: "param", key: param }, + param + )); + + var commas = (0, _lodash.times)(params.length - 1).map((_, i) => _react2.default.createElement( + "span", + { className: "delimiter", key: i }, + ", " + )); + + return (0, _lodash.flatten)((0, _lodash.zip)(params, commas)); + } + + render() { + return _react2.default.createElement( + "span", + { className: "function-signature" }, + this.renderFunctionName(this.props.func), + _react2.default.createElement( + "span", + { className: "paren" }, + "(" + ), + this.renderParams(this.props.func), + _react2.default.createElement( + "span", + { className: "paren" }, + ")" + ) + ); + } +} + +exports.default = PreviewFunction; +PreviewFunction.displayName = "PreviewFunction"; + +/***/ }), /* 799 */, /* 800 */, /* 801 */, /* 802 */, /* 803 */, -/* 804 */, -/* 805 */, -/* 806 */, +/* 804 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.findScopeByName = exports.getASTLocation = undefined; + +var getASTLocation = exports.getASTLocation = (() => { + var _ref = _asyncToGenerator(function* (source, location) { + var symbols = yield (0, _parser.getSymbols)(source); + var functions = [].concat(_toConsumableArray(symbols.functions), _toConsumableArray(symbols.memberExpressions)); + + var scope = findClosestScope(functions, location); + if (scope) { + var line = location.line - scope.location.start.line; + var column = location.column; + return { name: scope.name, offset: { line, column } }; + } + return { name: undefined, offset: location }; + }); + + return function getASTLocation(_x, _x2) { + return _ref.apply(this, arguments); + }; +})(); + +var findScopeByName = exports.findScopeByName = (() => { + var _ref2 = _asyncToGenerator(function* (source, name) { + var symbols = yield (0, _parser.getSymbols)(source); + var functions = symbols.functions; + + return functions.find(function (node) { + return node.name === name; + }); + }); + + return function findScopeByName(_x3, _x4) { + return _ref2.apply(this, arguments); + }; +})(); + +var _parser = __webpack_require__(827); + +var _contains = __webpack_require__(1127); + +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } + +function findClosestScope(functions, location) { + return functions.reduce((found, currNode) => { + if (currNode.name === "anonymous" || !(0, _contains.containsPosition)(currNode.location, location)) { + return found; + } + + if (!found) { + return currNode; + } + + if (found.location.start.line > currNode.location.start.line || found.location.start.column > currNode.location.start.column) { + return found; + } + + return currNode; + }, null); +} + +/***/ }), +/* 805 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = isSelectedFrameVisible; + +var _pause = __webpack_require__(239); + +var _sources = __webpack_require__(232); + +/* + * Checks to if the selected frame's source is currently + * selected. + */ +function isSelectedFrameVisible(state) { + var selectedLocation = (0, _sources.getSelectedLocation)(state); + var selectedFrame = (0, _pause.getSelectedFrame)(state); + + return selectedFrame && selectedLocation && selectedFrame.location.sourceId == selectedLocation.sourceId; +} + +/***/ }), +/* 806 */ +/***/ (function(module, exports) { + +module.exports = "dojo_square" + +/***/ }), /* 807 */, /* 808 */, -/* 809 */, -/* 810 */, +/* 809 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _react = __webpack_require__(0); + +var _react2 = _interopRequireDefault(_react); + +var _redux = __webpack_require__(3); + +var _reactRedux = __webpack_require__(151); + +var _debounce = __webpack_require__(651); + +var _debounce2 = _interopRequireDefault(_debounce); + +var _Popup = __webpack_require__(810); + +var _Popup2 = _interopRequireDefault(_Popup); + +var _selectors = __webpack_require__(242); + +var _actions = __webpack_require__(244); + +var _actions2 = _interopRequireDefault(_actions); + +var _editor = __webpack_require__(257); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +class Preview extends _react.PureComponent { + + constructor() { + super(); + + var self = this; + self.onScroll = this.onScroll.bind(this); + self.onMouseOver = (0, _debounce2.default)(this.onMouseOver, 40); + } + + componentDidMount() { + var codeMirror = this.props.editor.codeMirror; + + var codeMirrorWrapper = codeMirror.getWrapperElement(); + + codeMirror.on("scroll", this.onScroll); + codeMirrorWrapper.addEventListener("mouseover", e => this.onMouseOver(e)); + codeMirrorWrapper.addEventListener("mouseup", e => this.onMouseUp(e)); + codeMirrorWrapper.addEventListener("mousedown", e => this.onMouseDown(e)); + } + + onMouseOver(e) { + var target = e.target; + + if (this.props.selectedFrameVisible) { + (0, _editor.updatePreview)(target, this.props.editor, this.props); + } + } + + onMouseUp() { + this.currentlySelecting = false; + } + + onMouseDown() { + this.currentlySelecting = true; + } + + onScroll() { + this.props.clearPreview(); + } + + onClose(e) { + this.props.clearPreview(); + } + + render() { + var _props = this.props, + selectedSource = _props.selectedSource, + preview = _props.preview; + + + if (!this.props.editor || !selectedSource || this.currentlySelecting) { + return null; + } + + if (!preview || preview.updating) { + return null; + } + + var result = preview.result, + expression = preview.expression, + location = preview.location, + cursorPos = preview.cursorPos; + + var value = result; + if (typeof value == "undefined" || value.optimizedOut) { + return null; + } + + var editorRange = (0, _editor.toEditorRange)(selectedSource.get("id"), location); + + return _react2.default.createElement(_Popup2.default, { + value: value, + editor: this.props.editor, + range: editorRange, + expression: expression, + popoverPos: cursorPos, + onClose: e => this.onClose(e) + }); + } +} + +Preview.displayName = "Preview"; + +exports.default = (0, _reactRedux.connect)(state => ({ + preview: (0, _selectors.getPreview)(state), + selectedSource: (0, _selectors.getSelectedSource)(state), + linesInScope: (0, _selectors.getInScopeLines)(state), + selectedFrameVisible: (0, _selectors.isSelectedFrameVisible)(state) +}), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Preview); + +/***/ }), +/* 810 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Popup = undefined; + +var _react = __webpack_require__(0); + +var _react2 = _interopRequireDefault(_react); + +var _reactRedux = __webpack_require__(151); + +var _redux = __webpack_require__(3); + +var _devtoolsConfig = __webpack_require__(828); + +var _devtoolsReps = __webpack_require__(924); + +var _devtoolsReps2 = _interopRequireDefault(_devtoolsReps); + +var _actions = __webpack_require__(244); + +var _actions2 = _interopRequireDefault(_actions); + +var _selectors = __webpack_require__(242); + +var _Popover = __webpack_require__(698); + +var _Popover2 = _interopRequireDefault(_Popover); + +var _PreviewFunction = __webpack_require__(798); + +var _PreviewFunction2 = _interopRequireDefault(_PreviewFunction); + +var _editor = __webpack_require__(257); + +__webpack_require__(881); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var Rep = _devtoolsReps2.default.REPS.Rep, + MODE = _devtoolsReps2.default.MODE, + ObjectInspectorUtils = _devtoolsReps2.default.ObjectInspectorUtils; +var ObjectInspector = _devtoolsReps2.default.ObjectInspector; +var getChildren = ObjectInspectorUtils.getChildren; +class Popup extends _react.Component { + + componentDidMount() { + var _props = this.props, + loadObjectProperties = _props.loadObjectProperties, + loadedObjects = _props.loadedObjects, + value = _props.value, + editor = _props.editor, + range = _props.range; + + + this.marker = (0, _editor.markText)(editor, "preview-selection", range); + + if (!value || !value.type == "object") { + return; + } + + if (value.actor && !loadedObjects[value.actor]) { + loadObjectProperties(value); + } + } + + componentWillUnmount() { + if (this.marker) { + this.marker.clear(); + } + } + + getChildren(root, getObjectProperties) { + var actors = {}; + + var children = getChildren({ + getObjectProperties, + actors, + item: root + }); + + if (children.length > 0) { + return children; + } + + return null; + } + + renderFunctionPreview(value, root) { + var selectSourceURL = this.props.selectSourceURL; + var location = value.location; + + + return _react2.default.createElement( + "div", + { + className: "preview-popup", + onClick: () => selectSourceURL(location.url, { line: location.line }) + }, + _react2.default.createElement(_PreviewFunction2.default, { func: value }) + ); + } + + renderObjectPreview(expression, root) { + return _react2.default.createElement( + "div", + { className: "preview-popup" }, + this.renderObjectInspector(root) + ); + } + + renderSimplePreview(value) { + return _react2.default.createElement( + "div", + { className: "preview-popup" }, + Rep({ object: value, mode: MODE.LONG }) + ); + } + + renderObjectInspector(root) { + var _props2 = this.props, + loadObjectProperties = _props2.loadObjectProperties, + loadedObjects = _props2.loadedObjects; + + + var getObjectProperties = id => loadedObjects[id]; + var roots = this.getChildren(root, getObjectProperties); + + if (!roots) { + return null; + } + + return _react2.default.createElement(ObjectInspector, { + roots: roots, + autoExpandDepth: 0, + disableWrap: true, + disabledFocus: true, + getObjectProperties: getObjectProperties, + loadObjectProperties: loadObjectProperties + // TODO: See https://github.com/devtools-html/debugger.html/issues/3555. + , getObjectEntries: actor => {}, + loadObjectEntries: grip => {} + }); + } + + renderAddToExpressionBar(expression) { + if (!(0, _devtoolsConfig.isEnabled)("previewWatch")) { + return null; + } + + var addExpression = this.props.addExpression; + + return _react2.default.createElement( + "div", + { className: "add-to-expression-bar" }, + _react2.default.createElement( + "div", + { className: "prompt" }, + "\xBB" + ), + _react2.default.createElement( + "div", + { className: "expression-to-save-label" }, + expression + ), + _react2.default.createElement( + "div", + { + className: "expression-to-save-button", + onClick: event => addExpression(event) + }, + L10N.getStr("addWatchExpressionButton") + ) + ); + } + + renderPreview(expression, value) { + var root = { + name: expression, + path: expression, + contents: { value } + }; + + if (value.class === "Function") { + return this.renderFunctionPreview(value, root); + } + + if (value.type === "object") { + return _react2.default.createElement( + "div", + null, + this.renderObjectPreview(expression, root), + this.renderAddToExpressionBar(expression) + ); + } + + return this.renderSimplePreview(value); + } + + getPreviewType(value) { + if (typeof value == "boolean" || value.type == "null" || value.type == "undefined" || value.class === "Function") { + return "tooltip"; + } + + return "popover"; + } + + render() { + var _props3 = this.props, + popoverPos = _props3.popoverPos, + onClose = _props3.onClose, + value = _props3.value, + expression = _props3.expression; + + + var type = this.getPreviewType(value); + + return _react2.default.createElement( + _Popover2.default, + { targetPosition: popoverPos, onMouseLeave: onClose, type: type }, + this.renderPreview(expression, value) + ); + } +} + +exports.Popup = Popup; +Popup.displayName = "Popup"; + +exports.default = (0, _reactRedux.connect)(state => ({ + loadedObjects: (0, _selectors.getLoadedObjects)(state) +}), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Popup); + +/***/ }), /* 811 */, /* 812 */, /* 813 */, @@ -30003,7 +30722,7 @@ function sortTree(tree) { Object.defineProperty(exports, "__esModule", { value: true }); -exports.clearSymbols = exports.getOutOfScopeLocations = exports.getVariablesInScope = exports.getSymbols = exports.getClosestExpression = exports.stopParserWorker = exports.startParserWorker = undefined; +exports.getEmptyLines = exports.getNextStep = exports.clearSymbols = exports.getOutOfScopeLocations = exports.getVariablesInScope = exports.getSymbols = exports.getClosestExpression = exports.stopParserWorker = exports.startParserWorker = undefined; var _devtoolsUtils = __webpack_require__(900); @@ -30019,6 +30738,8 @@ var getSymbols = exports.getSymbols = dispatcher.task("getSymbols"); var getVariablesInScope = exports.getVariablesInScope = dispatcher.task("getVariablesInScope"); var getOutOfScopeLocations = exports.getOutOfScopeLocations = dispatcher.task("getOutOfScopeLocations"); var clearSymbols = exports.clearSymbols = dispatcher.task("clearSymbols"); +var getNextStep = exports.getNextStep = dispatcher.task("getNextStep"); +var getEmptyLines = exports.getEmptyLines = dispatcher.task("getEmptyLines"); /***/ }), /* 828 */ @@ -30184,39 +30905,204 @@ module.exports = { /* 847 */, /* 848 */, /* 849 */, -/* 850 */, -/* 851 */, -/* 852 */, -/* 853 */, -/* 854 */, -/* 855 */, -/* 856 */, -/* 857 */, -/* 858 */, -/* 859 */, -/* 860 */, -/* 861 */, -/* 862 */, -/* 863 */, -/* 864 */, -/* 865 */, -/* 866 */, -/* 867 */, -/* 868 */, -/* 869 */, -/* 870 */, -/* 871 */, -/* 872 */, -/* 873 */, -/* 874 */, -/* 875 */, -/* 876 */, -/* 877 */, -/* 878 */, -/* 879 */, -/* 880 */, -/* 881 */, -/* 882 */, +/* 850 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 851 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 852 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 853 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 854 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 855 */ +/***/ (function(module, exports) { + +module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF4AAABqCAMAAAAC5xbnAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAFZaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJYTVAgQ29yZSA1LjQuMCI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOnRpZmY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vdGlmZi8xLjAvIj4KICAgICAgICAgPHRpZmY6T3JpZW50YXRpb24+MTwvdGlmZjpPcmllbnRhdGlvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+CkzCJ1kAAAMAUExURUxpcf/fQOF4Wf6qob2GSbyGTP61q++hVlpCNO+ATLuESaZzPYdWLZ1uN/KOQywvJ/OGDfeTGWRSMlpFNvqrQ/yNkPipLfeTGviRGyobJAYCC5BgL/y2MKJrRg0gKH5ULfSTIWhnYyIeJv5/g7K1tfiSGviWIIZgPP+jn6KnqJxqNvmWH/qdTJNkM/6GjPmdKX5JIKiIafeVHTcuLK9uHvTn0/iUH5NiKQUbM/eTH0ExL/6hmv/TStTCqvidK/6Oi/uTkOnZv/mgNLaHbZppFu6ooPeMGYJVJOzbu5pqOap2RY+WnZaOgv+cmahkY/LjzvaEE+vew/2blzs+Ov6enQohIsVvb/+QkP6Bg4+YntB4de7Ru7yfg6KEaf+movj07s7Husx9atqYPJVKKLqESf/47v22GuJOM/3LLf/////ZY//37fyzGP3y4v2rFv3JLP3z5fuiEt9HM/3CKAAAAN1BL//+9f7NLtk7KP726NY0ILB4P/7XYvukH95HLf/88v65Gvy6J/7IKPPizLZ7QPqPEPru3N1AJ7+ITP+vprqAQ+p5IPiZGbV/Rfz8/PyzJv+lmP7VOfitIvqzT/zozeTMtf/RLvycCcSKTP29Hv/ocf/Btv3LOOdpHQQaI/7RY+JcJaltNP66r/3AM6OEMPCMH+nq6/Lz9JpiLzk3M/nYxE40H7WTMcgvHk9AMsLEwyQsL/u8ANrEqurWwJp2Jtrc3WRNR//76fzPsmJHI+FZHvfo1+WiHf3BV/p4dHVdMwABKfDALbV6Kt9PJ91+YHY/L6OVhJksJyIdGcUjB4VrMLd9OMqiL7EqIEJAP/3LXtu5maAFBP7OQ/yWj5GXl7w7K8GLHH1RLNyuLXklJ83Q0WYzLs2THIJJC/+PeXp4cIoABOe4LTUlJ//hbMWXYISKivqqA8udeemXhXtaHOiHc9YLAM1AKI+Ec7ideFVgYNs0BrgSAJh3YcRwII1ZGMCsj2QCAteBEXqDgviWNfW4esd1S8e4ofbDnNVeSrxWUew/xBkAAABkdFJOUwD+EP7//v4CAwX8/mb9HhH/MP3+/TT9TdYm/oP90bA4bPtYefztff7J+buL991SyUn+Y9v62T+cfp3S9P5co9TrkLj++vmqnHCp90X+nf3EvKx27ZH14bSWoqznwX6h/sly7fPC0KykAAAQBUlEQVRo3tyYe0xTWR7Hb+nwKKs4IK9UnAED+CIiLMvE9ZH1Oc64Pnc0O7O7/0nDo8/0BtKUptQ+VgzSUqCVR0oKXWhpAx0oQsOrGDWkQ8AVFggBFBWVSZTERxzHcXZ/59wWWakOGdl/9isgve39nO/9nd/5/c6BIP6/Fcj4X4EDA+Eb/4+00nTkPJAICcW/en6sJB2FJTQmJgp+i00lVtQ/wLYmJ0bFRpfQEnYk7tPx0vGzrNyEhtbR1BKuurpEreaqS0qi4SGIFZpmwIRG19FiWGxZdYlMxpJVVxcpD6UTKxIhYDASi7iyEhmFxz8lXIHyUOgKzDDQ05PrhDKMV9ct4LkCQULsB/Ph9tTIEhpNpi6pk7FldTRZhQfPZXMlWz+QD95jY2ggoZomZHO16jqtlqsVYjyL9cF8BhGlRvQSobYuMjy8lFJ4JODZLDbwUz8EzyBCIhE8kyeMLO0eqqnJR6qp6Q4XAB7xE0KAH8hgMH5d4PdA3Et4vDx1aU12dr5H2fmlAqADnsXdQfzq9QWrKQbRMzMBn79I2d0YD3x2AqSn3+5TET5X4/tGDoIH3lqC6bw82X/h73rwMIAkkTj8l4Ba+qkl3hjvK334OiOZRuN58DWL8JVDXvcsffJJToAmoDZg2+IigStSYOg7Fx5c/XTd51siaTqgv42/Wzkk8eDVyiRR7TCdHlC1aQFFtYOQ2H3h4e9I3EAi6JurPVevqkuw+UweK3wBn323ksKzIfQS/UvNMF2D8H7YPlVJ/aL2JHXDHaVRvgoffOLP06Akdh4Puxe+wQO8srJGgtKexRYIJMokOoVn4BRFt4cmJpcO1UCCZQ/t8Z0yERrNTo1m+j4PWT8nRPhsr3WEj2QVQFYK9Hrlxy81dE1hQNVRz2yGpO4LR8bxx2uSQnzYZxDbAgI0GA8SgioQ3sOuvAt4rqRIiVUE/MKAgMJtuKVF7YCgLCyR7PzuWJ/4CHpt4cOHSXqJRKvVqtVqbThatDVDQ90gKAuIXQRvqiH4SRpqZqmg5NekxN3btWvXTdCu/Jp9PiYXSvymqoOXX9TdrNMWUZJERkokEgEWlLaYOpCMfV9f9PTL/RvXHoS8REEZGtq1yzbY1NQ3PnMOKfNmeKjv6NQetL6IjLlJo1XfrPaKl5kH0unOfYt0X69/+Y9nrvl5O/PBV4zkGLBbzTvXZxkYcJtclnH4JEQ2JtF3UztaldJvvfbiPgJVfEsJHMeAIsNLf/zx9euOxk5V24h98PJpw3oiNaY6D+zydLawTN2AxdZks5n6YARhtJ+P1A8k/DZV7Tcw48obGzs6Hr7uQLqRlvb06VPz1HV+hrQ4Kwu+srIaNpPMy2dCiER1Jg+nWa9jfMbkmAmzNbl6+/ryzhVF+VpZDOAXriVnGwBRb59ApKwJst8sNjrJWQxui6tHIzSTd85AQQstEiK+LtPhOu0IGze5HW6bZSDMMS7Y4TM6ML1Hn5A/FAOimYzH+M3kmOKiwsycBy51FeN/j3N7nwxqx8yArs80MGC3rbWFjdvcpqbT9iLcEnzuP1aRcQ0Y34x4DXGk+YJCYbSSE+hlGzmCxownNxBowcZKhJk6k3t8QKfrC3OZTO4ZGMI9OaoVpPreETGINX9itgG+fnMDZddqVIjF4jEUHfg324zcz5J/I4JQX0tg5fF6bb0mGzzBTN9a+1q3ze4arWBxT7yrrh1+To7gOCPVz5PXxK9eKRTmfngar9qYU+sDcZHcIxGOh7mbIGdMjj7duLt3IOzAZBcLdxyfdc3vd3IrM76+obi4oaF+4hZ559nVnp6eV0Yr83IzXIXcaWi7Rf5GvB1uh6ZfVDBqt/eGmUx2l6lvJk83bjA4cN1L9I3fm6V60M+c/2F29lbcIEnap4wYL3522kAOxs2OjIzMzpNjwZe2UGaiuXOuXnvvQNO422RymYQFXQfmtAXQ76MZS6MDdUeVm9N6z0lSsjqnzGKx8WcjTO6U9Y7nKukU+5//8lM8uVslcw63axwnfa/bNTnZVUE1zKL0JfahoRwvzskQNd54nPLkScqTKbPRKEYTi2Q0ms0bx65Zr21crfjobPD5dajUQ+pztc8cWsuAyW1yTjpHnaOjk97txNv2YV6l0pycDKmqDCRvfZCWRqEVlIzmMeuY+IK/v//Z4Evr1xBBcH8yt0DL7rIarKNOg8uRZp1zjVI9Lfrt1EfzCuYz4Isjb5XDCC33FIoLFxUKsdG82jzmtPYbmAeuXElL+84/GEUnCKc+G5rM5NykY+7ZXJfT5ewqADirgpuwFH84F7FBIlX54+vPf2q5sd/8bAo0t9pJMg12i+HxjfLW8hv3rpz1P7sKRyckAbXIgoKCtEmHY9RlmKyAVyzY6u55Kzhe86AcPoff+Ueyv99iSXn8+Dkg5U9Ii2WQvCUv44hEfFXLd8GX1lEN+pAAB4PFKhh1OA84RyvYbDgIRCf6LTG/my+l8Bl8DkfEeURa7OTjMg6H097efp0ctNj7W8rk8JKTkVsefOkLXKOIKKV3e1XQNdplvcLVKxN2RDF8TOze3IyMBbyqvdViHyQfcdo5ZRw+5zoJ5h/J5Sp4iyPKyG25soXA0fGL1gu4XgmevlCeiA0hfB6Sjhd78SLkUQSODU1ywKva2x/+s8lwx2Oen5Mj7aTco9RXCjzSK5XRW0MXNj5L8ibXExsUfMC3kBbDvzra28vK2jume3puPyrzms+Rqu595jn6pn+sx2wIyqEoP7zTDPRdbhbwlP3Wy8x/90x3lEHv0tALNT3lco95jF+HowvxOaHHex8qKEGMd+0wg46/wUP0+Sr5rdtQb6Y1AYWwqYFtTaPXPOA7L26HvMeFJFaJgpJO/Y3gPdvvk960R+EBfNlPP08P02sDKNFr5Z0eOuAbD6zB+CAi6JOxNE9Q3n8u2d0ufWMfwqNqHB4upESn0wsbVRwvPUfa8jllPYjYMGjYQPzyHwQWLauF8Hc2VtUiVXU0NnZyvN7BPH//dk9FXPPbwU+I5ZyGFq8rD58v4nNUWBw+n5pVCp/xV5w3EQxiQxNzAzULv6y9uYv5OD35lHDKiLxv5PIjUKhDdh6N+AP9m2WfCoNOSqUZix8AY7H4b+Bgfu8RtBMJKaw9M4wOEYHLPBYSezszUMl/8wQibF60cA33g+b45t2QNat2Hjw2XPjVMo/p8KEjX8fL+ainLBrhzVBI0lyRfGKieGL9Z1+sN35/7Bi96uDy3EPqfB3fVh+f0sqBEGHYIix+JZVKOY0P4toaiidSLp0//5HxzrHhnaeWeTw/srkNth8jt//+fXnnfzq1vpC2rjAe9F4bc80MhhZCpqIWnDJLhw8V+2BhD4Wtb13pnvZ0axzahN6QeU0w/ol6r0muFldbRSK2I7F/Fh2KsqogGmOUzGGpobMOdFKmqN10o66Ubuw79yaptrGc5PeQnHvP+X7fd77z7zvnnpq6iApJRx1CTcv9f2d2t/cLPG0jswSsiQ/XN3uSk3DOqI7JPj/paWvzjIzOm7Z3P371o62lRuQET4H/r47bOhdffXtLtWtm5tVP2zyzdppX/tCb+dUXSXieKYAoqd9TsMZYGZ/qlsoxs7nY2Tk8PGwDDP31n297W/W70+0yWZm1l/39BTQhPOwt1uA5Ri7LvjAoGc/omL4T39W6tre3d3e5efXwuK3lwtqu2WRyfNiud/oYHbs/+PXgJ/a7vXO5YriAwa4pCs4+7fcsgfE6k8NYXeVgdDrGxDFrS5XfjKh3dAx6bSjXu0w63d6fnpFZYaA3S4Y1YGFAFXYR5NLI4IMdE/C4DQaRRsT+YOXLRyjB9HVUdOvdVkitLXlOrs7NYU4HctlpC6Gwf1qQs2ey6hhfbYXB2ceI5IzOO7oakBSZ3GD+tT7Q61WfLPh5DtN4sF5LkDTN5yxzyHhXA+yPfEzYet3CfjhhcrVXG/UOoGcWLubMzWkw5zK5TAuBEU892OGsopHVRuSDMEL+SMpXa6joRvViTP5L61m4M6XkHDojYEWOtQKJ0c2aIgj5GcbEILBu2Kx1IPN1oXuXcI1Hc0Yh35W/bDazJisHLQj0LkcEf/v7wrA6GlAWC6rZALbxYsdUCgMhl8vhdjtrgcPQADCKaJx4cqK9o70DQcyqdTscrr6d4vR4+LMv3u5oB0bxNKdC3OoDIHXzl8mpmxWRJ/Gox9jQ3l57uyQu89VTYXHEAGg0RqyfnKo2iK8MYo6ovaJxIh7zZVk/3ZTEgbYbUF9eHglNn/zWaKg4BIOxobzqbi5+19FkgPFQ7W4IzlEw+gZ695OJ+vLublQRBHSShILu+l9xhxV0nZLvq43l+mvOZpUKGs7lGovCNeb/B96qmpudTlCmr6qSIu76jgwN7qSQXjqhd6ugQ/isVqm3M1HsrOzAW6vP5xvrg77lULmdSEt5/XQJLn2uHzEj0uhgZaxh7KyEoqpAL8tyvjGXQ9Wsn8D0jlxWEmCjzCKvVAWOY1nWuxIyA9iDgGduzIHrHVnWAhfl5oAUxL3zYeythLiDxPCDikDKj9V3IMwt9cJ0gJhZs9e7EAgs7y/7/aMS1OuP9h6FsbfnNYerwsHEUIJHn14sSQHz8opanZH/4vXroaFOCUOro6vPL8wCnj9fzVlZDgQWxNIsF8rC7ThexA3Uk/lKCrbhGzcgPKgJY3wcYu+WlvEbNlvnH3fzJzPUoANUcKFSvJYF55gXlgcmlZYmu91O03Rww3al7ko4yqkTgx74rxzegGzYpivzkYqFUCnWvHAMmjZwL59qEqkRyCA/BOGmqKGyBoWYEPDYFsmglA06LMpJ9co9DZ7zc9cHlE0RbpHfPv1syHZVCs9QhDY+vMhP28loAYIghPySdMwpp5iyC/RBkGTTNL+BNvw223Dn0ItnQSAnD5YQD40wh22acEhUUmAPTgftBI/+p4M0+VYJBX8GM/aG1YTiFfS7CkjkZ2gRkiTfzRXSsEOF9Myud+nf6IgBBU9l4y/mWuII+qMArpfjrycxvfM+4PtG7ACF8dEr+KI41tpU2en4zCcFbRwrOXj/DB2rDRUIsYzPlMfzZRU6TxFBvsVLkoQEkjysRMErs+MxXgw0lQIflSf5ri6eoAVBsAgCbKR4eIoqIGkqLT52VNPzSguaSwiQJ2gqs/CMVpsmQQvb2M8EqJ1YF1qgzsf9TRu5x0JRYKygIJTa7Lemq3RNWhGtgMpAGSqeXnNg5rEIlBJAFWVLNZKnSpC4NEWQd5uiBEtaAhcuYIuVOYPQZQdx+eFNn1wuT5WlzWxtbm5tbWUmYDzQHz93J6U1+fHZx3mxB8flnp6UO9eTW88dT+Bzf6osr+d+T0pKMsgnxTzeb0XZ6NguLwHnpMpOtYJ4a2tya1ls+rOIHZ2s5SV22SXv8kdlZWWXvzwe+/5F3rnrwH39cVkizhFFUpOSUo/O/uBUHuBUkiwxRD+tH3V/5HC5hO5zvUcWhsCx9991OIT/AVwXLXUhLDYVAAAAAElFTkSuQmCC" + +/***/ }), +/* 856 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 857 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 858 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 859 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 860 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 861 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 862 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 863 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 864 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 865 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 866 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 867 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 868 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 869 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 870 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 871 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 872 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 873 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 874 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 875 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 876 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 877 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 878 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 879 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 880 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 881 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 882 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), /* 883 */ /***/ (function(module, exports, __webpack_require__) { @@ -31109,6 +31995,7 @@ var onConnect = (() => { selectors, client: client.clientCommands, prefs: _prefs.prefs, + features: _prefs.features, connection }; }; @@ -31593,7 +32480,8 @@ function createSource(source, _ref) { isPrettyPrinted: false, isWasm: supportsWasm && source.introductionType === "wasm", sourceMapURL: source.sourceMapURL, - isBlackBoxed: false + isBlackBoxed: false, + loadedState: "unloaded" }; } @@ -32441,12 +33329,17 @@ function workerHandler(publicInterface) { try { const response = publicInterface[method].apply(undefined, args); if (response instanceof Promise) { - response.then(val => self.postMessage({ id, response: val }), err => self.postMessage({ id, error: err })); + 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) { - self.postMessage({ id, error }); + // Error can't be sent via postMessage, so be sure to convert to + // string. + self.postMessage({ id, error: error.toString() }); } }; } @@ -32574,7 +33467,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.getTokenLocation = getTokenLocation; -exports.updateSelection = updateSelection; +exports.updatePreview = updatePreview; var _lodash = __webpack_require__(2); @@ -32598,46 +33491,71 @@ function getTokenLocation(codeMirror, tokenEl) { }; } -function updateSelection(target, editor, _ref) { +function updatePreview(target, editor, _ref) { var linesInScope = _ref.linesInScope, - selection = _ref.selection, - setSelection = _ref.setSelection, - clearSelection = _ref.clearSelection; + preview = _ref.preview, + setPreview = _ref.setPreview, + clearPreview = _ref.clearPreview; var location = getTokenLocation(editor.codeMirror, target); var tokenText = target.innerText ? target.innerText.trim() : ""; var cursorPos = target.getBoundingClientRect(); - if (selection) { + if (preview) { // We are mousing over the same token as before - if ((0, _lodash.isEqual)(selection.tokenPos, location)) { + if ((0, _lodash.isEqual)(preview.tokenPos, location)) { return; } - // We are mousing over a new token that is not in the selection + // We are mousing over a new token that is not in the preview if (!target.classList.contains("debug-expression")) { - clearSelection(); + clearPreview(); } } var invalidToken = tokenText === "" || tokenText.match(/[(){},.;\s]/); var invalidTarget = target.parentElement && !target.parentElement.closest(".CodeMirror-line") || cursorPos.top == 0; - var isUpdating = selection && selection.updating; + var isUpdating = preview && preview.updating; var inScope = linesInScope && linesInScope.includes(location.line); if (invalidTarget || !inScope || isUpdating || invalidToken) { return; } - setSelection(tokenText, location, cursorPos); + setPreview(tokenText, location, cursorPos); } /***/ }), -/* 905 */, -/* 906 */, -/* 907 */, -/* 908 */, -/* 909 */, +/* 905 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 906 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 907 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 908 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 909 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), /* 910 */ /***/ (function(module, exports, __webpack_require__) { @@ -32662,7 +33580,7 @@ var dom = React.DOM, PropTypes = React.PropTypes; -__webpack_require__(689); +__webpack_require__(861); /** * This component represents a Splitter. The splitter supports vertical @@ -32965,9 +33883,24 @@ var Draggable = React.createClass({ module.exports = Draggable; /***/ }), -/* 913 */, -/* 914 */, -/* 915 */, +/* 913 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 914 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 915 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), /* 916 */ /***/ (function(module, exports, __webpack_require__) { @@ -33507,8 +34440,18 @@ module.exports = Draggable; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(793)(module), __webpack_require__(792))) /***/ }), -/* 917 */, -/* 918 */, +/* 917 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 918 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), /* 919 */ /***/ (function(module, exports) { @@ -33521,9 +34464,24 @@ module.exports = "" /***/ }), -/* 921 */, -/* 922 */, -/* 923 */, +/* 921 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 922 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 923 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), /* 924 */ /***/ (function(module, exports, __webpack_require__) { @@ -33592,7 +34550,7 @@ 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__(707); +__webpack_require__(877); // Load all existing rep templates var Undefined = __webpack_require__(929); @@ -34677,7 +35635,12 @@ module.exports = { }; /***/ }), -/* 935 */, +/* 935 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), /* 936 */ /***/ (function(module, exports, __webpack_require__) { @@ -36360,7 +37323,12 @@ module.exports = { }; /***/ }), -/* 952 */, +/* 952 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), /* 953 */ /***/ (function(module, exports, __webpack_require__) { @@ -37210,11 +38178,16 @@ module.exports = { /* 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 (copySourceUrl): This is the text that appears in the\n# context menu to copy the source URL of file open.\ncopySourceUrl=Copy Source Url\n\n# LOCALIZATION NOTE (copySourceUrl.accesskey): Access key to copy the source URL of a file from\n# the context menu.\ncopySourceUrl.accesskey=u\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\n\n# LOCALIZATION NOTE (copyStackTrace.accesskey): Access key to copy the stack trace data from\n# the context menu.\ncopyStackTrace.accesskey=c\n\n# LOCALIZATION NOTE (expandPanes): This is the tooltip for the button\n# that expands the left and right panes in the debugger UI.\nexpandPanes=Expand panes\n\n# LOCALIZATION NOTE (pauseButtonTooltip): The tooltip that is displayed for the pause\n# button when the debugger is in a running state.\npauseButtonTooltip=Pause %S\n\n# LOCALIZATION NOTE (pausePendingButtonTooltip): The tooltip that is displayed for\n# the pause button after it's been clicked but before the next JavaScript to run.\npausePendingButtonTooltip=Waiting for next execution\n\n# LOCALIZATION NOTE (resumeButtonTooltip): The label that is displayed on the pause\n# button when the debugger is in a paused state.\nresumeButtonTooltip=Resume %S\n\n# LOCALIZATION NOTE (stepOverTooltip): The label that is displayed on the\n# button that steps over a function call.\nstepOverTooltip=Step Over %S\n\n# LOCALIZATION NOTE (stepInTooltip): The label that is displayed on the\n# button that steps into a function call.\nstepInTooltip=Step In %S\n\n# LOCALIZATION NOTE (stepOutTooltip): The label that is displayed on the\n# button that steps out of a function call.\nstepOutTooltip=Step Out %S\n\n# LOCALIZATION NOTE (noWorkersText): The text to display in the workers list\n# when there are no workers.\nnoWorkersText=This page has no workers.\n\n# LOCALIZATION NOTE (noSourcesText): The text to display in the sources list\n# when there are no sources.\nnoSourcesText=This page has no sources.\n\n# LOCALIZATION NOTE (noEventListenersText): The text to display in the events tab\n# when there are no events.\nnoEventListenersText=No event listeners to display\n\n# LOCALIZATION NOTE (eventListenersHeader): The text to display in the events\n# header.\neventListenersHeader=Event Listeners\n\n# LOCALIZATION NOTE (noStackFramesText): The text to display in the call stack tab\n# when there are no stack frames.\nnoStackFramesText=No stack frames to display\n\n# LOCALIZATION NOTE (eventCheckboxTooltip): The tooltip text to display when\n# the user hovers over the checkbox used to toggle an event breakpoint.\neventCheckboxTooltip=Toggle breaking on this event\n\n# LOCALIZATION NOTE (eventOnSelector): The text to display in the events tab\n# for every event item, between the event type and event selector.\neventOnSelector=on\n\n# LOCALIZATION NOTE (eventInSource): The text to display in the events tab\n# for every event item, between the event selector and listener's owner source.\neventInSource=in\n\n# LOCALIZATION NOTE (eventNodes): The text to display in the events tab when\n# an event is listened on more than one target node.\neventNodes=%S nodes\n\n# LOCALIZATION NOTE (eventNative): The text to display in the events tab when\n# a listener is added from plugins, thus getting translated to native code.\neventNative=[native code]\n\n# LOCALIZATION NOTE (*Events): The text to display in the events tab for\n# each group of sub-level event entries.\nanimationEvents=Animation\naudioEvents=Audio\nbatteryEvents=Battery\nclipboardEvents=Clipboard\ncompositionEvents=Composition\ndeviceEvents=Device\ndisplayEvents=Display\ndragAndDropEvents=Drag and Drop\ngamepadEvents=Gamepad\nindexedDBEvents=IndexedDB\ninteractionEvents=Interaction\nkeyboardEvents=Keyboard\nmediaEvents=HTML5 Media\nmouseEvents=Mouse\nmutationEvents=Mutation\nnavigationEvents=Navigation\npointerLockEvents=Pointer Lock\nsensorEvents=Sensor\nstorageEvents=Storage\ntimeEvents=Time\ntouchEvents=Touch\notherEvents=Other\n\n# LOCALIZATION NOTE (blackboxCheckboxTooltip2): The tooltip text to display when\n# the user hovers over the checkbox used to toggle blackboxing its associated\n# source.\nblackboxCheckboxTooltip2=Toggle blackboxing\n\n# LOCALIZATION NOTE (sources.search.key2): Key shortcut to open the search for\n# searching all the source files the debugger has seen.\nsources.search.key2=CmdOrCtrl+P\n\n# LOCALIZATION NOTE (sources.search.alt.key): A second key shortcut to open the\n# search for searching all the source files the debugger has seen.\nsources.search.alt.key=CmdOrCtrl+O\n\n# LOCALIZATION NOTE (projectTextSearch.key): A key shortcut to open the\n# full project text search for searching all the files the debugger has seen.\nprojectTextSearch.key=CmdOrCtrl+Shift+F\n\n# LOCALIZATION NOTE (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 (sources.noSourcesAvailable): Text shown when the debugger\n# does not have any sources.\nsources.noSourcesAvailable=This page has no sources\n\n# LOCALIZATION NOTE (sourceSearch.search.key2): Key shortcut to open the search\n# for searching within a the currently opened files in the editor\nsourceSearch.search.key2=CmdOrCtrl+F\n\n# LOCALIZATION NOTE (sourceSearch.search.placeholder): placeholder text in\n# the source search input bar\nsourceSearch.search.placeholder=Search in file…\n\n# LOCALIZATION NOTE (sourceSearch.search.again.key2): Key shortcut to highlight\n# the next occurrence of the last search triggered from a source search\nsourceSearch.search.again.key2=CmdOrCtrl+G\n\n# LOCALIZATION NOTE (sourceSearch.search.againPrev.key2): Key shortcut to highlight\n# the previous occurrence of the last search triggered from a source search\nsourceSearch.search.againPrev.key2=CmdOrCtrl+Shift+G\n\n# LOCALIZATION NOTE (sourceSearch.resultsSummary1): Shows a summary of\n# the number of matches for autocomplete\nsourceSearch.resultsSummary1=%d results\n\n# LOCALIZATION NOTE (noMatchingStringsText): The text to display in the\n# global search results when there are no matching strings after filtering.\nnoMatchingStringsText=No matches found\n\n# LOCALIZATION NOTE (emptySearchText): This is the text that appears in the\n# filter text box when it is empty and the scripts container is selected.\nemptySearchText=Search scripts (%S)\n\n# LOCALIZATION NOTE (emptyVariablesFilterText): This is the text that\n# appears in the filter text box for the variables view container.\nemptyVariablesFilterText=Filter variables\n\n# LOCALIZATION NOTE (emptyPropertiesFilterText): This is the text that\n# appears in the filter text box for the editor's variables view bubble.\nemptyPropertiesFilterText=Filter properties\n\n# LOCALIZATION NOTE (searchPanelFilter): This is the text that appears in the\n# filter panel popup for the filter scripts operation.\nsearchPanelFilter=Filter scripts (%S)\n\n# LOCALIZATION NOTE (searchPanelGlobal): This is the text that appears in the\n# filter panel popup for the global search operation.\nsearchPanelGlobal=Search in all files (%S)\n\n# LOCALIZATION NOTE (searchPanelFunction): This is the text that appears in the\n# filter panel popup for the function search operation.\nsearchPanelFunction=Search for function definition (%S)\n\n# LOCALIZATION NOTE (searchPanelToken): This is the text that appears in the\n# filter panel popup for the token search operation.\nsearchPanelToken=Find in this file (%S)\n\n# LOCALIZATION NOTE (searchPanelGoToLine): This is the text that appears in the\n# filter panel popup for the line search operation.\nsearchPanelGoToLine=Go to line (%S)\n\n# LOCALIZATION NOTE (searchPanelVariable): This is the text that appears in the\n# filter panel popup for the variables search operation.\nsearchPanelVariable=Filter variables (%S)\n\n# LOCALIZATION NOTE (breakpointMenuItem): The text for all the elements that\n# are displayed in the breakpoints menu item popup.\nbreakpointMenuItem.setConditional=Configure conditional breakpoint\nbreakpointMenuItem.enableSelf=Enable breakpoint\nbreakpointMenuItem.disableSelf=Disable breakpoint\nbreakpointMenuItem.deleteSelf=Remove breakpoint\nbreakpointMenuItem.enableOthers=Enable others\nbreakpointMenuItem.disableOthers=Disable others\nbreakpointMenuItem.deleteOthers=Remove others\nbreakpointMenuItem.enableAll=Enable all breakpoints\nbreakpointMenuItem.disableAll=Disable all breakpoints\nbreakpointMenuItem.deleteAll=Remove all breakpoints\n\n# LOCALIZATION NOTE (breakpointMenuItem.deleteSelf.accesskey): Access key to remove the \n# currently selected breakpoint from the context menu\nbreakpointMenuItem.deleteSelf.accesskey=r\n\n# LOCALIZATION NOTE (breakpointMenuItem.enableSelf.accesskey): Access key to enable the \n# currently selected breakpoint from the context menu\nbreakpointMenuItem.enableSelf.accesskey=e\n\n# LOCALIZATION NOTE (breakpointMenuItem.disableSelf.accesskey): Access key to disable the \n# currently selected breakpoint from the context menu\nbreakpointMenuItem.disableSelf.accesskey=d\n\n# LOCALIZATION NOTE (breakpointMenuItem.deleteAll.accesskey): Access key to remove all \n# the breakpoints from the context menu\nbreakpointMenuItem.deleteAll.accesskey=a\n\n# LOCALIZATION NOTE (breakpointMenuItem.enableAll.accesskey): Access key to enable all \n# the breakpoints from the context menu\nbreakpointMenuItem.enableAll.accesskey=b\n\n# LOCALIZATION NOTE (breakpointMenuItem.disableAll.accesskey): Access key to disable all \n# the breakpoints from the context menu\nbreakpointMenuItem.disableAll.accesskey=c\n\n# LOCALIZATION NOTE (breakpointMenuItem.deleteOthers.accesskey): Access key to remove \n# other breakpoints from the context menu\nbreakpointMenuItem.deleteOthers.accesskey=p\n\n# LOCALIZATION NOTE (breakpointMenuItem.enableOthers.accesskey): Access key to enable \n# other breakpoints from the context menu\nbreakpointMenuItem.enableOthers.accesskey=q\n\n# LOCALIZATION NOTE (breakpointMenuItem.disableOthers.accesskey): Access key to disable \n# other breakpoints from the context menu\nbreakpointMenuItem.disableOthers.accesskey=s\n\n# LOCALIZATION NOTE (breakpoints.header): Breakpoints right sidebar pane header.\nbreakpoints.header=Breakpoints\n\n# LOCALIZATION NOTE (breakpoints.none): The text that appears when there are\n# no breakpoints present\nbreakpoints.none=No Breakpoints\n\n# LOCALIZATION NOTE (breakpoints.enable): The text that may appear as a tooltip\n# when hovering over the 'disable breakpoints' switch button in right sidebar\nbreakpoints.enable=Enable Breakpoints\n\n# LOCALIZATION NOTE (breakpoints.disable): The text that may appear as a tooltip\n# when hovering over the 'disable breakpoints' switch button in right sidebar\nbreakpoints.disable=Disable Breakpoints\n\n# LOCALIZATION NOTE (breakpoints.removeBreakpointTooltip): The tooltip that is displayed\n# for remove breakpoint button in right sidebar\nbreakpoints.removeBreakpointTooltip=Remove Breakpoint\n\n# LOCALIZATION NOTE (callStack.header): Call Stack right sidebar pane header.\ncallStack.header=Call Stack\n\n# LOCALIZATION NOTE (callStack.notPaused): Call Stack right sidebar pane\n# message when not paused.\ncallStack.notPaused=Not Paused\n\n# LOCALIZATION NOTE (callStack.collapse): Call Stack right sidebar pane\n# message to hide some of the frames that are shown.\ncallStack.collapse=Collapse Rows\n\n# LOCALIZATION NOTE (callStack.expand): Call Stack right sidebar pane\n# message to show more of the frames.\ncallStack.expand=Expand Rows\n\n# LOCALIZATION NOTE (editor.searchResults): Editor Search bar message\n# for the summarizing the selected search result. e.g. 5 of 10 results.\neditor.searchResults=%d of %d results\n\n# LOCALIZATION NOTE (sourceSearch.singleResult): Copy shown when there is one result.\neditor.singleResult=1 result\n\n# LOCALIZATION NOTE (editor.noResults): Editor Search bar message\n# for when no results found.\neditor.noResults=no results\n\n# LOCALIZATION NOTE (editor.searchResults.nextResult): Editor Search bar\n# tooltip for traversing to the Next Result\neditor.searchResults.nextResult=Next Result\n\n# LOCALIZATION NOTE (editor.searchResults.prevResult): Editor Search bar\n# tooltip for traversing to the Previous Result\neditor.searchResults.prevResult=Previous Result\n\n# LOCALIZATION NOTE (editor.searchTypeToggleTitle): Search bar title for\n# toggling search type buttons(function search, variable search)\neditor.searchTypeToggleTitle=Search for:\n\n# LOCALIZATION NOTE (editor.addBreakpoint): Editor gutter context menu item\n# for adding a breakpoint on a line.\neditor.addBreakpoint=Add Breakpoint\n\n# LOCALIZATION NOTE (editor.disableBreakpoint): Editor gutter context menu item\n# for disabling a breakpoint on a line.\neditor.disableBreakpoint=Disable Breakpoint\n\n# LOCALIZATION NOTE (editor.enableBreakpoint): Editor gutter context menu item\n# for enabling a breakpoint on a line.\neditor.enableBreakpoint=Enable Breakpoint\n\n# LOCALIZATION NOTE (editor.removeBreakpoint): Editor gutter context menu item\n# for removing a breakpoint on a line.\neditor.removeBreakpoint=Remove Breakpoint\n\n# LOCALIZATION NOTE (editor.editBreakpoint): Editor gutter context menu item\n# for setting a breakpoint condition on a line.\neditor.editBreakpoint=Edit Breakpoint\n\n# LOCALIZATION NOTE (editor.addConditionalBreakpoint): Editor gutter context\n# menu item for adding a breakpoint condition on a line.\neditor.addConditionalBreakpoint=Add Conditional Breakpoint\n\n# LOCALIZATION NOTE (editor.conditionalPanel.placeholder): Placeholder text for\n# input element inside ConditionalPanel component\neditor.conditionalPanel.placeholder=This breakpoint will pause when the expression is true\n\n# LOCALIZATION NOTE (editor.conditionalPanel.placeholder): Tooltip text for\n# close button inside ConditionalPanel component\neditor.conditionalPanel.close=Cancel edit breakpoint and close\n\n# LOCALIZATION NOTE (editor.jumpToMappedLocation1): Context menu item\n# for navigating to a source mapped location\neditor.jumpToMappedLocation1=Jump to %S location\n\n# LOCALIZATION NOTE (framework.disableGrouping): This is the text that appears in the\n# context menu to disable framework grouping.\nframework.disableGrouping=Disable Framework Grouping\n\n# LOCALIZATION NOTE (framework.disableGrouping.accesskey): Access key to toggle\n# framework grouping from the context menu.\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\n\n# LOCALIZATION NOTE (framework.enableGrouping.accesskey): Access key to toggle\n# framework grouping from the context menu.\nframework.enableGrouping.accesskey=u\n\n# LOCALIZATION NOTE (generated): Source Map term for a server source location\ngenerated=generated\n\n# LOCALIZATION NOTE (original): Source Map term for a debugger UI source location\noriginal=original\n\n# LOCALIZATION NOTE (expressions.placeholder): Placeholder text for expression\n# input element\nexpressions.placeholder=Add Watch Expression\n\n# LOCALIZATION NOTE (sourceTabs.closeTab): Editor source tab context menu item\n# for closing the selected tab below the mouse.\nsourceTabs.closeTab=Close tab\n\n# LOCALIZATION NOTE (sourceTabs.closeTab.accesskey): Access key to close the currently select\n# source tab from the editor context menu item.\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 others\n\n# LOCALIZATION NOTE (sourceTabs.closeOtherTabs.accesskey): Access key to close other source tabs\n# from the editor context menu.\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\n\n# LOCALIZATION NOTE (sourceTabs.closeTabsToEnd.accesskey): Access key to close source tabs\n# after the selected tab from the editor context menu.\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\n\n# LOCALIZATION NOTE (sourceTabs.closeAllTabs.accesskey): Access key to close all tabs from the\n# editor context menu.\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\n\n# LOCALIZATION NOTE (sourceTabs.revealInTree.accesskey): Access key to reveal a source in the\n# tree from the context menu.\nsourceTabs.revealInTree.accesskey=r\n\n# LOCALIZATION NOTE (sourceTabs.copyLink): Editor source tab context menu item\n# for copying a link address.\nsourceTabs.copyLink=Copy Link Address\n\n# LOCALIZATION NOTE (sourceTabs.copyLink.accesskey): Access key to copy a link addresss from the\n# editor context menu.\nsourceTabs.copyLink.accesskey=l\n\n# LOCALIZATION NOTE (sourceTabs.prettyPrint): Editor source tab context menu item\n# for pretty printing the source.\nsourceTabs.prettyPrint=Pretty Print Source\n\n# LOCALIZATION NOTE (sourceTabs.prettyPrint.accesskey): Access key to pretty print a source from\n# the editor context menu.\nsourceTabs.prettyPrint.accesskey=p\n\n# LOCALIZATION NOTE (sourceFooter.blackbox): Tooltip text associated\n# with the blackbox button\nsourceFooter.blackbox=Blackbox Source\n\n# LOCALIZATION NOTE (sourceFooter.unblackbox): Tooltip text associated\n# with the blackbox button\nsourceFooter.unblackbox=Unblackbox Source\n\n# LOCALIZATION NOTE (sourceFooter.unblackbox.accesskey): Access key to blackbox\n# an associated source\nsourceFooter.unblackbox.accesskey=b\n\n# LOCALIZATION NOTE (sourceFooter.blackbox.accesskey): Access key to blackbox\n# an associated source\nsourceFooter.blackbox.accesskey=b\n\n# LOCALIZATION NOTE (sourceFooter.blackboxed): Text associated\n# with a blackboxed source\nsourceFooter.blackboxed=Blackboxed Source\n\n# LOCALIZATION NOTE (sourceTabs.closeTabButtonTooltip): The tooltip that is displayed\n# for close tab button in source tabs.\nsourceTabs.closeTabButtonTooltip=Close tab\n\n# LOCALIZATION NOTE (sourceTabs.newTabButtonTooltip): The tooltip that is displayed for\n# new tab button in source tabs.\nsourceTabs.newTabButtonTooltip=Search for sources (%S)\n\n# LOCALIZATION NOTE (scopes.header): Scopes right sidebar pane header.\nscopes.header=Scopes\n\n# LOCALIZATION NOTE (scopes.notAvailable): Scopes right sidebar pane message\n# for when the debugger is paused, but there isn't pause data.\nscopes.notAvailable=Scopes Unavailable\n\n# LOCALIZATION NOTE (scopes.notPaused): Scopes right sidebar pane message\n# for when the debugger is not paused.\nscopes.notPaused=Not Paused\n\n# LOCALIZATION NOTE (scopes.block): Refers to a block of code in\n# the scopes pane when the debugger is paused.\nscopes.block=Block\n\n# LOCALIZATION NOTE (sources.header): Sources left sidebar header\nsources.header=Sources\n\n# LOCALIZATION NOTE (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 (sourceSearch.search): The center pane Source Search\n# prompt for searching for files.\nsourceSearch.search=Search Sources…\n\n# LOCALIZATION NOTE (sourceSearch.noResults): The center pane Source Search\n# message when the query did not match any of the sources.\nsourceSearch.noResults2=No results found\n\n# LOCALIZATION NOTE (ignoreExceptions): The pause on exceptions button tooltip\n# when the debugger will not pause on exceptions.\nignoreExceptions=Ignore exceptions. Click to pause on uncaught exceptions\n\n# LOCALIZATION NOTE (pauseOnUncaughtExceptions): The pause on exceptions button\n# tooltip when the debugger will pause on uncaught exceptions.\npauseOnUncaughtExceptions=Pause on uncaught exceptions. Click to pause on all exceptions\n\n# LOCALIZATION NOTE (pauseOnExceptions): The pause on exceptions button tooltip\n# when the debugger will pause on all exceptions.\npauseOnExceptions=Pause on all exceptions. Click to ignore exceptions\n\n# LOCALIZATION NOTE (loadingText): The text that is displayed in the script\n# editor when the loading process has started but there is no file to display\n# yet.\nloadingText=Loading\\u2026\n\n# LOCALIZATION NOTE (errorLoadingText2): The text that is displayed in the debugger\n# viewer when there is an error loading a file\nerrorLoadingText2=Error loading this URL: %S\n\n# LOCALIZATION NOTE (addWatchExpressionText): The text that is displayed in the\n# watch expressions list to add a new item.\naddWatchExpressionText=Add watch expression\n\n# LOCALIZATION NOTE (addWatchExpressionButton): The button that is displayed in the\n# variables view popup.\naddWatchExpressionButton=Watch\n\n# LOCALIZATION NOTE (emptyVariablesText): The text that is displayed in the\n# variables pane when there are no variables to display.\nemptyVariablesText=No variables to display\n\n# LOCALIZATION NOTE (scopeLabel): The text that is displayed in the variables\n# pane as a header for each variable scope (e.g. \"Global scope, \"With scope\",\n# etc.).\nscopeLabel=%S scope\n\n# LOCALIZATION NOTE (watchExpressionsScopeLabel): The name of the watch\n# expressions scope. This text is displayed in the variables pane as a header for\n# the watch expressions scope.\nwatchExpressionsScopeLabel=Watch expressions\n\n# LOCALIZATION NOTE (globalScopeLabel): The name of the global scope. This text\n# is added to scopeLabel and displayed in the variables pane as a header for\n# the global scope.\nglobalScopeLabel=Global\n\n# LOCALIZATION NOTE (variablesViewErrorStacktrace): This is the text that is\n# shown before the stack trace in an error.\nvariablesViewErrorStacktrace=Stack trace:\n\n# LOCALIZATION NOTE (variablesViewMoreObjects): the text that is displayed\n# when you have an object preview that does not show all of the elements. At the end of the list\n# you see \"N more...\" in the web console output.\n# This is a semi-colon list of plural forms.\n# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals\n# #1 number of remaining items in the object\n# example: 3 more…\nvariablesViewMoreObjects=#1 more…;#1 more…\n\n# LOCALIZATION NOTE (variablesEditableNameTooltip): The text that is displayed\n# in the variables list on an item with an editable name.\nvariablesEditableNameTooltip=Double click to edit\n\n# LOCALIZATION NOTE (variablesEditableValueTooltip): The text that is displayed\n# in the variables list on an item with an editable value.\nvariablesEditableValueTooltip=Click to change value\n\n# LOCALIZATION NOTE (variablesCloseButtonTooltip): The text that is displayed\n# in the variables list on an item which can be removed.\nvariablesCloseButtonTooltip=Click to remove\n\n# LOCALIZATION NOTE (variablesEditButtonTooltip): The text that is displayed\n# in the variables list on a getter or setter which can be edited.\nvariablesEditButtonTooltip=Click to set value\n\n# LOCALIZATION NOTE (variablesEditableValueTooltip): The text that is displayed\n# in a tooltip on the \"open in inspector\" button in the the variables list for a\n# DOMNode item.\nvariablesDomNodeValueTooltip=Click to select the node in the inspector\n\n# LOCALIZATION NOTE (configurable|...|Tooltip): The text that is displayed\n# in the variables list on certain variables or properties as tooltips.\n# Expanations of what these represent can be found at the following links:\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/isSealed\n# It's probably best to keep these in English.\nconfigurableTooltip=configurable\nenumerableTooltip=enumerable\nwritableTooltip=writable\nfrozenTooltip=frozen\nsealedTooltip=sealed\nextensibleTooltip=extensible\noverriddenTooltip=overridden\nWebIDLTooltip=WebIDL\n\n# LOCALIZATION NOTE (variablesSeparatorLabel): The text that is displayed\n# in the variables list as a separator between the name and value.\nvariablesSeparatorLabel=:\n\n# LOCALIZATION NOTE (watchExpressionsSeparatorLabel2): The text that is displayed\n# in the watch expressions list as a separator between the code and evaluation.\nwatchExpressionsSeparatorLabel2=\\u0020→\n\n# LOCALIZATION NOTE (functionSearchSeparatorLabel): The text that is displayed\n# in the functions search panel as a separator between function's inferred name\n# and its real name (if available).\nfunctionSearchSeparatorLabel=←\n\n# LOCALIZATION NOTE(symbolSearch.search.functionsPlaceholder): The placeholder\n# text displayed when the user searches for functions in a file\nsymbolSearch.search.functionsPlaceholder=Search functions…\n\n# LOCALIZATION NOTE(symbolSearch.search.variablesPlaceholder): The placeholder\n# text displayed when the user searches for variables in a file\nsymbolSearch.search.variablesPlaceholder=Search variables…\n\n# LOCALIZATION NOTE(symbolSearch.search.key2): The Key Shortcut for\n# searching for a function or variable\nsymbolSearch.search.key2=CmdOrCtrl+Shift+O\n\n# LOCALIZATION NOTE(symbolSearch.searchModifier.modifiersLabel): A label\n# preceding the group of modifiers\nsymbolSearch.searchModifier.modifiersLabel=Modifiers:\n\n# LOCALIZATION NOTE(symbolSearch.searchModifier.regex): A search option\n# when searching text in a file\nsymbolSearch.searchModifier.regex=Regex\n\n# LOCALIZATION NOTE(symbolSearch.searchModifier.caseSensitive): A search option\n# when searching text in a file\nsymbolSearch.searchModifier.caseSensitive=Case sensitive\n\n# LOCALIZATION NOTE(symbolSearch.searchModifier.wholeWord): A search option\n# when searching text in a file\nsymbolSearch.searchModifier.wholeWord=Whole word\n\n# LOCALIZATION NOTE (resumptionOrderPanelTitle): This is the text that appears\n# as a description in the notification panel popup, when multiple debuggers are\n# open in separate tabs and the user tries to resume them in the wrong order.\n# The substitution parameter is the URL of the last paused window that must be\n# resumed first.\nresumptionOrderPanelTitle=There are one or more paused debuggers. Please resume the most-recently paused debugger first at: %S\n\nvariablesViewOptimizedOut=(optimized away)\nvariablesViewUninitialized=(uninitialized)\nvariablesViewMissingArgs=(unavailable)\n\nanonymousSourcesLabel=Anonymous Sources\n\nexperimental=This is an experimental feature\n\n# LOCALIZATION NOTE (whyPaused.debuggerStatement): The text that is displayed\n# in a info block explaining how the debugger is currently paused due to a `debugger`\n# statement in the code\nwhyPaused.debuggerStatement=Paused on debugger statement\n\n# LOCALIZATION NOTE (whyPaused.breakpoint): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a breakpoint\nwhyPaused.breakpoint=Paused on breakpoint\n\n# LOCALIZATION NOTE (whyPaused.exception): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an exception\nwhyPaused.exception=Paused on exception\n\n# LOCALIZATION NOTE (whyPaused.resumeLimit): The text that is displayed\n# in a info block explaining how the debugger is currently paused while stepping\n# in or out of the stack\nwhyPaused.resumeLimit=Paused while stepping\n\n# LOCALIZATION NOTE (whyPaused.pauseOnDOMEvents): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a\n# dom event\nwhyPaused.pauseOnDOMEvents=Paused on event listener\n\n# LOCALIZATION NOTE (whyPaused.breakpointConditionThrown): The text that is displayed\n# in an info block when evaluating a conditional breakpoint throws an error\nwhyPaused.breakpointConditionThrown=Error with conditional breakpoint\n\n# LOCALIZATION NOTE (whyPaused.xhr): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an\n# xml http request\nwhyPaused.xhr=Paused on XMLHttpRequest\n\n# LOCALIZATION NOTE (whyPaused.promiseRejection): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a\n# promise rejection\nwhyPaused.promiseRejection=Paused on promise rejection\n\n# LOCALIZATION NOTE (whyPaused.assert): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an\n# assert\nwhyPaused.assert=Paused on assertion\n\n# LOCALIZATION NOTE (whyPaused.debugCommand): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a\n# debugger statement\nwhyPaused.debugCommand=Paused on debugged function\n\n# LOCALIZATION NOTE (whyPaused.other): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an event\n# listener breakpoint set\nwhyPaused.other=Debugger paused\n\n# LOCALIZATION NOTE (ctrl): The text that is used for documenting\n# keyboard shortcuts that use the control key\nctrl=Ctrl\n" +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 (copySourceUrl): This is the text that appears in the\n# context menu to copy the source URL of file open.\ncopySourceUrl=Copy Source Url\ncopySourceUrl.accesskey=u\n\n# LOCALIZATION NOTE (copyStackTrace): This is the text that appears in the\n# context menu to copy the stack trace methods, file names and row number.\ncopyStackTrace=Copy Stack Trace\ncopyStackTrace.accesskey=c\n\n# LOCALIZATION NOTE (expandPanes): This is the tooltip for the button\n# that expands the left and right panes in the debugger UI.\nexpandPanes=Expand panes\n\n# LOCALIZATION NOTE (pauseButtonTooltip): The tooltip that is displayed for the pause\n# button when the debugger is in a running state.\npauseButtonTooltip=Pause %S\n\n# LOCALIZATION NOTE (pausePendingButtonTooltip): The tooltip that is displayed for\n# the pause button after it's been clicked but before the next JavaScript to run.\npausePendingButtonTooltip=Waiting for next execution\n\n# LOCALIZATION NOTE (resumeButtonTooltip): The label that is displayed on the pause\n# button when the debugger is in a paused state.\nresumeButtonTooltip=Resume %S\n\n# LOCALIZATION NOTE (stepOverTooltip): The label that is displayed on the\n# button that steps over a function call.\nstepOverTooltip=Step Over %S\n\n# LOCALIZATION NOTE (stepInTooltip): The label that is displayed on the\n# button that steps into a function call.\nstepInTooltip=Step In %S\n\n# LOCALIZATION NOTE (stepOutTooltip): The label that is displayed on the\n# button that steps out of a function call.\nstepOutTooltip=Step Out %S\n\n# LOCALIZATION NOTE (workersHeader): The text to display in the events\n# header.\nworkersHeader=Workers\n\n# LOCALIZATION NOTE (noWorkersText): The text to display in the workers list\n# when there are no workers.\nnoWorkersText=This page has no workers.\n\n# LOCALIZATION NOTE (noSourcesText): The text to display in the sources list\n# when there are no sources.\nnoSourcesText=This page has no sources.\n\n# LOCALIZATION NOTE (noEventListenersText): The text to display in the events tab\n# when there are no events.\nnoEventListenersText=No event listeners to display\n\n# LOCALIZATION NOTE (eventListenersHeader): The text to display in the events\n# header.\neventListenersHeader=Event Listeners\n\n# LOCALIZATION NOTE (noStackFramesText): The text to display in the call stack tab\n# when there are no stack frames.\nnoStackFramesText=No stack frames to display\n\n# LOCALIZATION NOTE (eventCheckboxTooltip): The tooltip text to display when\n# the user hovers over the checkbox used to toggle an event breakpoint.\neventCheckboxTooltip=Toggle breaking on this event\n\n# LOCALIZATION NOTE (eventOnSelector): The text to display in the events tab\n# for every event item, between the event type and event selector.\neventOnSelector=on\n\n# LOCALIZATION NOTE (eventInSource): The text to display in the events tab\n# for every event item, between the event selector and listener's owner source.\neventInSource=in\n\n# LOCALIZATION NOTE (eventNodes): The text to display in the events tab when\n# an event is listened on more than one target node.\neventNodes=%S nodes\n\n# LOCALIZATION NOTE (eventNative): The text to display in the events tab when\n# a listener is added from plugins, thus getting translated to native code.\neventNative=[native code]\n\n# LOCALIZATION NOTE (*Events): The text to display in the events tab for\n# each group of sub-level event entries.\nanimationEvents=Animation\naudioEvents=Audio\nbatteryEvents=Battery\nclipboardEvents=Clipboard\ncompositionEvents=Composition\ndeviceEvents=Device\ndisplayEvents=Display\ndragAndDropEvents=Drag and Drop\ngamepadEvents=Gamepad\nindexedDBEvents=IndexedDB\ninteractionEvents=Interaction\nkeyboardEvents=Keyboard\nmediaEvents=HTML5 Media\nmouseEvents=Mouse\nmutationEvents=Mutation\nnavigationEvents=Navigation\npointerLockEvents=Pointer Lock\nsensorEvents=Sensor\nstorageEvents=Storage\ntimeEvents=Time\ntouchEvents=Touch\notherEvents=Other\n\n# LOCALIZATION NOTE (blackboxCheckboxTooltip2): The tooltip text to display when\n# the user hovers over the checkbox used to toggle blackboxing its associated\n# source.\nblackboxCheckboxTooltip2=Toggle blackboxing\n\n# LOCALIZATION NOTE (sources.search.key2): Key shortcut to open the search for\n# searching all the source files the debugger has seen.\nsources.search.key2=CmdOrCtrl+P\n\n# LOCALIZATION NOTE (sources.search.alt.key): A second key shortcut to open the\n# search for searching all the source files the debugger has seen.\nsources.search.alt.key=CmdOrCtrl+O\n\n# LOCALIZATION NOTE (projectTextSearch.key): A key shortcut to open the\n# full project text search for searching all the files the debugger has seen.\nprojectTextSearch.key=CmdOrCtrl+Shift+F\n\n# LOCALIZATION NOTE (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 (sources.noSourcesAvailable): Text shown when the debugger\n# does not have any sources.\nsources.noSourcesAvailable=This page has no sources\n\n# LOCALIZATION NOTE (sourceSearch.search.key2): Key shortcut to open the search\n# for searching within a the currently opened files in the editor\nsourceSearch.search.key2=CmdOrCtrl+F\n\n# LOCALIZATION NOTE (sourceSearch.search.placeholder): placeholder text in\n# the source search input bar\nsourceSearch.search.placeholder=Search in file…\n\n# LOCALIZATION NOTE (sourceSearch.search.again.key2): Key shortcut to highlight\n# the next occurrence of the last search triggered from a source search\nsourceSearch.search.again.key2=CmdOrCtrl+G\n\n# LOCALIZATION NOTE (sourceSearch.search.againPrev.key2): Key shortcut to highlight\n# the previous occurrence of the last search triggered from a source search\nsourceSearch.search.againPrev.key2=CmdOrCtrl+Shift+G\n\n# LOCALIZATION NOTE (sourceSearch.resultsSummary1): Shows a summary of\n# the number of matches for autocomplete\nsourceSearch.resultsSummary1=%d results\n\n# LOCALIZATION NOTE (noMatchingStringsText): The text to display in the\n# global search results when there are no matching strings after filtering.\nnoMatchingStringsText=No matches found\n\n# LOCALIZATION NOTE (emptySearchText): This is the text that appears in the\n# filter text box when it is empty and the scripts container is selected.\nemptySearchText=Search scripts (%S)\n\n# LOCALIZATION NOTE (emptyVariablesFilterText): This is the text that\n# appears in the filter text box for the variables view container.\nemptyVariablesFilterText=Filter variables\n\n# LOCALIZATION NOTE (emptyPropertiesFilterText): This is the text that\n# appears in the filter text box for the editor's variables view bubble.\nemptyPropertiesFilterText=Filter properties\n\n# LOCALIZATION NOTE (searchPanelFilter): This is the text that appears in the\n# filter panel popup for the filter scripts operation.\nsearchPanelFilter=Filter scripts (%S)\n\n# LOCALIZATION NOTE (searchPanelGlobal): This is the text that appears in the\n# filter panel popup for the global search operation.\nsearchPanelGlobal=Search in all files (%S)\n\n# LOCALIZATION NOTE (searchPanelFunction): This is the text that appears in the\n# filter panel popup for the function search operation.\nsearchPanelFunction=Search for function definition (%S)\n\n# LOCALIZATION NOTE (searchPanelToken): This is the text that appears in the\n# filter panel popup for the token search operation.\nsearchPanelToken=Find in this file (%S)\n\n# LOCALIZATION NOTE (searchPanelGoToLine): This is the text that appears in the\n# filter panel popup for the line search operation.\nsearchPanelGoToLine=Go to line (%S)\n\n# LOCALIZATION NOTE (searchPanelVariable): This is the text that appears in the\n# filter panel popup for the variables search operation.\nsearchPanelVariable=Filter variables (%S)\n\n# LOCALIZATION NOTE (breakpointMenuItem): The text for all the elements that\n# are displayed in the breakpoints menu item popup.\nbreakpointMenuItem.setConditional=Configure conditional breakpoint\nbreakpointMenuItem.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\n\n# LOCALIZATION NOTE (breakpoints.header): Breakpoints right sidebar pane header.\nbreakpoints.header=Breakpoints\n\n# LOCALIZATION NOTE (breakpoints.none): The text that appears when there are\n# no breakpoints present\nbreakpoints.none=No Breakpoints\n\n# LOCALIZATION NOTE (breakpoints.enable): The text that may appear as a tooltip\n# when hovering over the 'disable breakpoints' switch button in right sidebar\nbreakpoints.enable=Enable Breakpoints\n\n# LOCALIZATION NOTE (breakpoints.disable): The text that may appear as a tooltip\n# when hovering over the 'disable breakpoints' switch button in right sidebar\nbreakpoints.disable=Disable Breakpoints\n\n# LOCALIZATION NOTE (breakpoints.removeBreakpointTooltip): The tooltip that is displayed\n# for remove breakpoint button in right sidebar\nbreakpoints.removeBreakpointTooltip=Remove Breakpoint\n\n# LOCALIZATION NOTE (callStack.header): Call Stack right sidebar pane header.\ncallStack.header=Call Stack\n\n# LOCALIZATION NOTE (callStack.notPaused): Call Stack right sidebar pane\n# message when not paused.\ncallStack.notPaused=Not Paused\n\n# LOCALIZATION NOTE (callStack.collapse): Call Stack right sidebar pane\n# message to hide some of the frames that are shown.\ncallStack.collapse=Collapse Rows\n\n# LOCALIZATION NOTE (callStack.expand): Call Stack right sidebar pane\n# message to show more of the frames.\ncallStack.expand=Expand Rows\n\n# LOCALIZATION NOTE (editor.searchResults): Editor Search bar message\n# for the summarizing the selected search result. e.g. 5 of 10 results.\neditor.searchResults=%d of %d results\n\n# LOCALIZATION NOTE (sourceSearch.singleResult): Copy shown when there is one result.\neditor.singleResult=1 result\n\n# LOCALIZATION NOTE (editor.noResults): Editor Search bar message\n# for when no results found.\neditor.noResults=no results\n\n# LOCALIZATION NOTE (editor.searchResults.nextResult): Editor Search bar\n# tooltip for traversing to the Next Result\neditor.searchResults.nextResult=Next Result\n\n# LOCALIZATION NOTE (editor.searchResults.prevResult): Editor Search bar\n# tooltip for traversing to the Previous Result\neditor.searchResults.prevResult=Previous Result\n\n# LOCALIZATION NOTE (editor.searchTypeToggleTitle): Search bar title for\n# toggling search type buttons(function search, variable search)\neditor.searchTypeToggleTitle=Search for:\n\n# LOCALIZATION NOTE (editor.addBreakpoint): Editor gutter context menu item\n# for adding a breakpoint on a line.\neditor.addBreakpoint=Add Breakpoint\n\n# LOCALIZATION NOTE (editor.disableBreakpoint): Editor gutter context menu item\n# for disabling a breakpoint on a line.\neditor.disableBreakpoint=Disable Breakpoint\n\n# LOCALIZATION NOTE (editor.enableBreakpoint): Editor gutter context menu item\n# for enabling a breakpoint on a line.\neditor.enableBreakpoint=Enable Breakpoint\n\n# LOCALIZATION NOTE (editor.removeBreakpoint): Editor gutter context menu item\n# for removing a breakpoint on a line.\neditor.removeBreakpoint=Remove Breakpoint\n\n# LOCALIZATION NOTE (editor.editBreakpoint): Editor gutter context menu item\n# for setting a breakpoint condition on a line.\neditor.editBreakpoint=Edit Breakpoint\n\n# LOCALIZATION NOTE (editor.addConditionalBreakpoint): Editor gutter context\n# menu item for adding a breakpoint condition on a line.\neditor.addConditionalBreakpoint=Add Conditional Breakpoint\n\n# LOCALIZATION NOTE (editor.conditionalPanel.placeholder): Placeholder text for\n# input element inside ConditionalPanel component\neditor.conditionalPanel.placeholder=This breakpoint will pause when the expression is true\n\n# LOCALIZATION NOTE (editor.conditionalPanel.placeholder): Tooltip text for\n# close button inside ConditionalPanel component\neditor.conditionalPanel.close=Cancel edit breakpoint and close\n\n# LOCALIZATION NOTE (editor.jumpToMappedLocation1): Context menu item\n# for navigating to a source mapped location\neditor.jumpToMappedLocation1=Jump to %S location\n\n# LOCALIZATION NOTE (framework.disableGrouping): This is the text that appears in the\n# context menu to disable framework grouping.\nframework.disableGrouping=Disable Framework Grouping\nframework.disableGrouping.accesskey=u\n\n# LOCALIZATION NOTE (framework.enableGrouping): This is the text that appears in the\n# context menu to enable framework grouping.\nframework.enableGrouping=Enable Framework Grouping\nframework.enableGrouping.accesskey=u\n\n# LOCALIZATION NOTE (generated): Source Map term for a server source location\ngenerated=generated\n\n# LOCALIZATION NOTE (original): Source Map term for a debugger UI source location\noriginal=original\n\n# LOCALIZATION NOTE (expressions.placeholder): Placeholder text for expression\n# input element\nexpressions.placeholder=Add Watch Expression\n\n# LOCALIZATION NOTE (sourceTabs.closeTab): Editor source tab context menu item\n# for closing the selected tab below the mouse.\nsourceTabs.closeTab=Close tab\nsourceTabs.closeTab.accesskey=c\n\n# LOCALIZATION NOTE (sourceTabs.closeOtherTabs): Editor source tab context menu item\n# for closing the other tabs.\nsourceTabs.closeOtherTabs=Close others\nsourceTabs.closeOtherTabs.accesskey=o\n\n# LOCALIZATION NOTE (sourceTabs.closeTabsToEnd): Editor source tab context menu item\n# for closing the tabs to the end (the right for LTR languages) of the selected tab.\nsourceTabs.closeTabsToEnd=Close tabs to the right\nsourceTabs.closeTabsToEnd.accesskey=e\n\n# LOCALIZATION NOTE (sourceTabs.closeAllTabs): Editor source tab context menu item\n# for closing all tabs.\nsourceTabs.closeAllTabs=Close all tabs\nsourceTabs.closeAllTabs.accesskey=a\n\n# LOCALIZATION NOTE (sourceTabs.revealInTree): Editor source tab context menu item\n# for revealing source in tree.\nsourceTabs.revealInTree=Reveal in Tree\nsourceTabs.revealInTree.accesskey=r\n\n# LOCALIZATION NOTE (sourceTabs.copyLink): Editor source tab context menu item\n# for copying a link address.\nsourceTabs.copyLink=Copy Link Address\nsourceTabs.copyLink.accesskey=l\n\n# LOCALIZATION NOTE (sourceTabs.prettyPrint): Editor source tab context menu item\n# for pretty printing the source.\nsourceTabs.prettyPrint=Pretty Print Source\nsourceTabs.prettyPrint.accesskey=p\n\n# LOCALIZATION NOTE (sourceFooter.blackbox): Tooltip text associated\n# with the blackbox button\nsourceFooter.blackbox=Blackbox Source\nsourceFooter.blackbox.accesskey=B\n\n# LOCALIZATION NOTE (sourceFooter.unblackbox): Tooltip text associated\n# with the blackbox button\nsourceFooter.unblackbox=Unblackbox Source\nsourceFooter.unblackbox.accesskey=b\n\n# LOCALIZATION NOTE (sourceFooter.blackboxed): Text associated\n# with a blackboxed source\nsourceFooter.blackboxed=Blackboxed Source\n\n# LOCALIZATION NOTE (sourceTabs.closeTabButtonTooltip): The tooltip that is displayed\n# for close tab button in source tabs.\nsourceTabs.closeTabButtonTooltip=Close tab\n\n# LOCALIZATION NOTE (sourceTabs.newTabButtonTooltip): The tooltip that is displayed for\n# new tab button in source tabs.\nsourceTabs.newTabButtonTooltip=Search for sources (%S)\n\n# LOCALIZATION NOTE (scopes.header): Scopes right sidebar pane header.\nscopes.header=Scopes\n\n# LOCALIZATION NOTE (scopes.notAvailable): Scopes right sidebar pane message\n# for when the debugger is paused, but there isn't pause data.\nscopes.notAvailable=Scopes Unavailable\n\n# LOCALIZATION NOTE (scopes.notPaused): Scopes right sidebar pane message\n# for when the debugger is not paused.\nscopes.notPaused=Not Paused\n\n# LOCALIZATION NOTE (scopes.block): Refers to a block of code in\n# the scopes pane when the debugger is paused.\nscopes.block=Block\n\n# LOCALIZATION NOTE (sources.header): Sources left sidebar header\nsources.header=Sources\n\n# LOCALIZATION NOTE (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 (sourceSearch.search): The center pane Source Search\n# prompt for searching for files.\nsourceSearch.search=Search Sources…\n\n# LOCALIZATION NOTE (sourceSearch.noResults): The center pane Source Search\n# message when the query did not match any of the sources.\nsourceSearch.noResults2=No results found\n\n# LOCALIZATION NOTE (ignoreExceptions): The pause on exceptions button tooltip\n# when the debugger will not pause on exceptions.\nignoreExceptions=Ignore exceptions. Click to pause on uncaught exceptions\n\n# LOCALIZATION NOTE (pauseOnUncaughtExceptions): The pause on exceptions button\n# tooltip when the debugger will pause on uncaught exceptions.\npauseOnUncaughtExceptions=Pause on uncaught exceptions. Click to pause on all exceptions\n\n# LOCALIZATION NOTE (pauseOnExceptions): The pause on exceptions button tooltip\n# when the debugger will pause on all exceptions.\npauseOnExceptions=Pause on all exceptions. Click to ignore exceptions\n\n# LOCALIZATION NOTE (loadingText): The text that is displayed in the script\n# editor when the loading process has started but there is no file to display\n# yet.\nloadingText=Loading\\u2026\n\n# LOCALIZATION NOTE (errorLoadingText2): The text that is displayed in the debugger\n# viewer when there is an error loading a file\nerrorLoadingText2=Error loading this URL: %S\n\n# LOCALIZATION NOTE (addWatchExpressionText): The text that is displayed in the\n# watch expressions list to add a new item.\naddWatchExpressionText=Add watch expression\n\n# LOCALIZATION NOTE (addWatchExpressionButton): The button that is displayed in the\n# variables view popup.\naddWatchExpressionButton=Watch\n\n# LOCALIZATION NOTE (emptyVariablesText): The text that is displayed in the\n# variables pane when there are no variables to display.\nemptyVariablesText=No variables to display\n\n# LOCALIZATION NOTE (scopeLabel): The text that is displayed in the variables\n# pane as a header for each variable scope (e.g. \"Global scope, \"With scope\",\n# etc.).\nscopeLabel=%S scope\n\n# LOCALIZATION NOTE (watchExpressionsScopeLabel): The name of the watch\n# expressions scope. This text is displayed in the variables pane as a header for\n# the watch expressions scope.\nwatchExpressionsScopeLabel=Watch expressions\n\n# LOCALIZATION NOTE (globalScopeLabel): The name of the global scope. This text\n# is added to scopeLabel and displayed in the variables pane as a header for\n# the global scope.\nglobalScopeLabel=Global\n\n# LOCALIZATION NOTE (variablesViewErrorStacktrace): This is the text that is\n# shown before the stack trace in an error.\nvariablesViewErrorStacktrace=Stack trace:\n\n# LOCALIZATION NOTE (variablesViewMoreObjects): the text that is displayed\n# when you have an object preview that does not show all of the elements. At the end of the list\n# you see \"N more...\" in the web console output.\n# This is a semi-colon list of plural forms.\n# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals\n# #1 number of remaining items in the object\n# example: 3 more…\nvariablesViewMoreObjects=#1 more…;#1 more…\n\n# LOCALIZATION NOTE (variablesEditableNameTooltip): The text that is displayed\n# in the variables list on an item with an editable name.\nvariablesEditableNameTooltip=Double click to edit\n\n# LOCALIZATION NOTE (variablesEditableValueTooltip): The text that is displayed\n# in the variables list on an item with an editable value.\nvariablesEditableValueTooltip=Click to change value\n\n# LOCALIZATION NOTE (variablesCloseButtonTooltip): The text that is displayed\n# in the variables list on an item which can be removed.\nvariablesCloseButtonTooltip=Click to remove\n\n# LOCALIZATION NOTE (variablesEditButtonTooltip): The text that is displayed\n# in the variables list on a getter or setter which can be edited.\nvariablesEditButtonTooltip=Click to set value\n\n# LOCALIZATION NOTE (variablesEditableValueTooltip): The text that is displayed\n# in a tooltip on the \"open in inspector\" button in the the variables list for a\n# DOMNode item.\nvariablesDomNodeValueTooltip=Click to select the node in the inspector\n\n# LOCALIZATION NOTE (configurable|...|Tooltip): The text that is displayed\n# in the variables list on certain variables or properties as tooltips.\n# Expanations of what these represent can be found at the following links:\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/isSealed\n# It's probably best to keep these in English.\nconfigurableTooltip=configurable\nenumerableTooltip=enumerable\nwritableTooltip=writable\nfrozenTooltip=frozen\nsealedTooltip=sealed\nextensibleTooltip=extensible\noverriddenTooltip=overridden\nWebIDLTooltip=WebIDL\n\n# LOCALIZATION NOTE (variablesSeparatorLabel): The text that is displayed\n# in the variables list as a separator between the name and value.\nvariablesSeparatorLabel=:\n\n# LOCALIZATION NOTE (watchExpressionsSeparatorLabel2): The text that is displayed\n# in the watch expressions list as a separator between the code and evaluation.\nwatchExpressionsSeparatorLabel2=\\u0020→\n\n# LOCALIZATION NOTE (functionSearchSeparatorLabel): The text that is displayed\n# in the functions search panel as a separator between function's inferred name\n# and its real name (if available).\nfunctionSearchSeparatorLabel=←\n\n# LOCALIZATION NOTE(symbolSearch.search.functionsPlaceholder): The placeholder\n# text displayed when the user searches for functions in a file\nsymbolSearch.search.functionsPlaceholder=Search functions…\n\n# LOCALIZATION NOTE(symbolSearch.search.variablesPlaceholder): The placeholder\n# text displayed when the user searches for variables in a file\nsymbolSearch.search.variablesPlaceholder=Search variables…\n\n# LOCALIZATION NOTE(symbolSearch.search.key2): The Key Shortcut for\n# searching for a function or variable\nsymbolSearch.search.key2=CmdOrCtrl+Shift+O\n\n# LOCALIZATION NOTE(symbolSearch.searchModifier.modifiersLabel): A label\n# preceding the group of modifiers\nsymbolSearch.searchModifier.modifiersLabel=Modifiers:\n\n# LOCALIZATION NOTE(symbolSearch.searchModifier.regex): A search option\n# when searching text in a file\nsymbolSearch.searchModifier.regex=Regex\n\n# LOCALIZATION NOTE(symbolSearch.searchModifier.caseSensitive): A search option\n# when searching text in a file\nsymbolSearch.searchModifier.caseSensitive=Case sensitive\n\n# LOCALIZATION NOTE(symbolSearch.searchModifier.wholeWord): A search option\n# when searching text in a file\nsymbolSearch.searchModifier.wholeWord=Whole word\n\n# LOCALIZATION NOTE (resumptionOrderPanelTitle): This is the text that appears\n# as a description in the notification panel popup, when multiple debuggers are\n# open in separate tabs and the user tries to resume them in the wrong order.\n# The substitution parameter is the URL of the last paused window that must be\n# resumed first.\nresumptionOrderPanelTitle=There are one or more paused debuggers. Please resume the most-recently paused debugger first at: %S\n\nvariablesViewOptimizedOut=(optimized away)\nvariablesViewUninitialized=(uninitialized)\nvariablesViewMissingArgs=(unavailable)\n\nanonymousSourcesLabel=Anonymous Sources\n\nexperimental=This is an experimental feature\n\n# LOCALIZATION NOTE (whyPaused.debuggerStatement): The text that is displayed\n# in a info block explaining how the debugger is currently paused due to a `debugger`\n# statement in the code\nwhyPaused.debuggerStatement=Paused on debugger statement\n\n# LOCALIZATION NOTE (whyPaused.breakpoint): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a breakpoint\nwhyPaused.breakpoint=Paused on breakpoint\n\n# LOCALIZATION NOTE (whyPaused.exception): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an exception\nwhyPaused.exception=Paused on exception\n\n# LOCALIZATION NOTE (whyPaused.resumeLimit): The text that is displayed\n# in a info block explaining how the debugger is currently paused while stepping\n# in or out of the stack\nwhyPaused.resumeLimit=Paused while stepping\n\n# LOCALIZATION NOTE (whyPaused.pauseOnDOMEvents): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a\n# dom event\nwhyPaused.pauseOnDOMEvents=Paused on event listener\n\n# LOCALIZATION NOTE (whyPaused.breakpointConditionThrown): The text that is displayed\n# in an info block when evaluating a conditional breakpoint throws an error\nwhyPaused.breakpointConditionThrown=Error with conditional breakpoint\n\n# LOCALIZATION NOTE (whyPaused.xhr): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an\n# xml http request\nwhyPaused.xhr=Paused on XMLHttpRequest\n\n# LOCALIZATION NOTE (whyPaused.promiseRejection): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a\n# promise rejection\nwhyPaused.promiseRejection=Paused on promise rejection\n\n# LOCALIZATION NOTE (whyPaused.assert): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an\n# assert\nwhyPaused.assert=Paused on assertion\n\n# LOCALIZATION NOTE (whyPaused.debugCommand): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a\n# debugger statement\nwhyPaused.debugCommand=Paused on debugged function\n\n# LOCALIZATION NOTE (whyPaused.other): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an event\n# listener breakpoint set\nwhyPaused.other=Debugger paused\n\n# LOCALIZATION NOTE (ctrl): The text that is used for documenting\n# keyboard shortcuts that use the control key\nctrl=Ctrl\n" /***/ }), /* 961 */, -/* 962 */, +/* 962 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), /* 963 */, /* 964 */, /* 965 */ @@ -39568,6 +40541,8 @@ exports.getAndProcessFrames = getAndProcessFrames; var _react = __webpack_require__(0); +var _react2 = _interopRequireDefault(_react); + var _redux = __webpack_require__(3); var _reactRedux = __webpack_require__(151); @@ -39598,7 +40573,7 @@ var _clipboard = __webpack_require__(423); var _selectors = __webpack_require__(242); -__webpack_require__(724); +__webpack_require__(914); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -39680,25 +40655,29 @@ class Frames extends _react.Component { var framesOrGroups = this.truncateFrames(this.collapseFrames(frames)); - return _react.DOM.ul({}, framesOrGroups.map(frameOrGroup => frameOrGroup.id ? FrameComponent({ - frame: frameOrGroup, - toggleFrameworkGrouping: this.toggleFrameworkGrouping, - copyStackTrace: this.copyStackTrace, - frameworkGroupingOn, - selectFrame, - selectedFrame, - toggleBlackBox, - key: frameOrGroup.id - }) : Group({ - group: frameOrGroup, - toggleFrameworkGrouping: this.toggleFrameworkGrouping, - copyStackTrace: this.copyStackTrace, - frameworkGroupingOn, - selectFrame, - selectedFrame, - toggleBlackBox, - key: frameOrGroup[0].id - }))); + return _react2.default.createElement( + "ul", + null, + framesOrGroups.map(frameOrGroup => frameOrGroup.id ? FrameComponent({ + frame: frameOrGroup, + toggleFrameworkGrouping: this.toggleFrameworkGrouping, + copyStackTrace: this.copyStackTrace, + frameworkGroupingOn, + selectFrame, + selectedFrame, + toggleBlackBox, + key: frameOrGroup.id + }) : Group({ + group: frameOrGroup, + toggleFrameworkGrouping: this.toggleFrameworkGrouping, + copyStackTrace: this.copyStackTrace, + frameworkGroupingOn, + selectFrame, + selectedFrame, + toggleBlackBox, + key: frameOrGroup[0].id + })) + ); } renderToggleButton(frames) { @@ -39709,7 +40688,11 @@ class Frames extends _react.Component { return null; } - return _react.DOM.div({ className: "show-more", onClick: this.toggleFramesDisplay }, buttonMessage); + return _react2.default.createElement( + "div", + { className: "show-more", onClick: this.toggleFramesDisplay }, + buttonMessage + ); } render() { @@ -39719,10 +40702,24 @@ class Frames extends _react.Component { if (!frames) { - return _react.DOM.div({ className: "pane frames" }, _react.DOM.div({ className: "pane-info empty" }, L10N.getStr("callStack.notPaused"))); + return _react2.default.createElement( + "div", + { className: "pane frames" }, + _react2.default.createElement( + "div", + { className: "pane-info empty" }, + L10N.getStr("callStack.notPaused") + ) + ); } - return _react.DOM.div({ className: "pane frames" }, this.renderFrames(frames), (0, _WhyPaused2.default)({ pause }), this.renderToggleButton(frames)); + return _react2.default.createElement( + "div", + { className: "pane frames" }, + this.renderFrames(frames), + (0, _WhyPaused2.default)({ pause }), + this.renderToggleButton(frames) + ); } } @@ -39780,6 +40777,8 @@ Object.defineProperty(exports, "__esModule", { var _react = __webpack_require__(0); +var _react2 = _interopRequireDefault(_react); + var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); @@ -39798,28 +40797,46 @@ var _FrameMenu2 = _interopRequireDefault(_FrameMenu); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function renderFrameTitle(frame, options) { +function FrameTitle(_ref) { + var frame = _ref.frame, + options = _ref.options; + var displayName = (0, _frame.formatDisplayName)(frame, options); - return _react.DOM.div({ className: "title" }, displayName); + return _react2.default.createElement( + "div", + { className: "title" }, + displayName + ); } -function renderFrameLocation(_ref) { - var source = _ref.source, - location = _ref.location, - library = _ref.library; +FrameTitle.displayName = "FrameTitle"; - if (!source) { +function FrameLocation(_ref2) { + var frame = _ref2.frame; + + if (!frame.source) { return; } - if (library) { - return _react.DOM.div({ className: "location" }, library, (0, _Svg2.default)(library.toLowerCase(), { className: "annotation-logo" })); + if (frame.library) { + return _react2.default.createElement( + "div", + { className: "location" }, + frame.library, + _react2.default.createElement(_Svg2.default, { name: frame.library.toLowerCase(), className: "annotation-logo" }) + ); } - var filename = (0, _source.getFilename)(source); - return _react.DOM.div({ className: "location" }, `${filename}: ${location.line}`); + var filename = (0, _source.getFilename)(frame.source); + return _react2.default.createElement( + "div", + { className: "location" }, + `${filename}: ${frame.location.line}` + ); } +FrameLocation.displayName = "FrameLocation"; + class FrameComponent extends _react.Component { constructor() { @@ -39859,16 +40876,22 @@ class FrameComponent extends _react.Component { shouldMapDisplayName = _props2.shouldMapDisplayName; - return _react.DOM.li({ - key: frame.id, - className: (0, _classnames2.default)("frame", { - selected: selectedFrame && selectedFrame.id === frame.id - }), - onMouseDown: e => this.onMouseDown(e, frame, selectedFrame), - onKeyUp: e => this.onKeyUp(e, frame, selectedFrame), - onContextMenu: e => this.onContextMenu(e), - tabIndex: 0 - }, renderFrameTitle(frame, { shouldMapDisplayName }), !hideLocation ? renderFrameLocation(frame) : null); + var className = (0, _classnames2.default)("frame", { + selected: selectedFrame && selectedFrame.id === frame.id + }); + return _react2.default.createElement( + "li", + { + key: frame.id, + className: className, + onMouseDown: e => this.onMouseDown(e, frame, selectedFrame), + onKeyUp: e => this.onKeyUp(e, frame, selectedFrame), + onContextMenu: e => this.onContextMenu(e), + tabIndex: 0 + }, + _react2.default.createElement(FrameTitle, { frame: frame, options: { shouldMapDisplayName } }), + !hideLocation && _react2.default.createElement(FrameLocation, { frame: frame }) + ); } } @@ -39979,6 +41002,10 @@ function isRedux(frame) { return getFrameUrl(frame).match(/redux/i); } +function isDojo(frame) { + return getFrameUrl(frame).match(/dojo/i); +} + function getLibraryFromUrl(frame) { // @TODO each of these fns calls getFrameUrl, just call it once // (assuming there's not more complex logic to identify a lib) @@ -40043,6 +41070,10 @@ function getLibraryFromUrl(frame) { return "Redux"; } + if (isDojo(frame)) { + return "Dojo"; + } + if (isImmutable(frame)) { return "Immutable"; } @@ -40210,6 +41241,8 @@ Object.defineProperty(exports, "__esModule", { var _react = __webpack_require__(0); +var _react2 = _interopRequireDefault(_react); + var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); @@ -40224,7 +41257,7 @@ var _FrameMenu = __webpack_require__(1032); var _FrameMenu2 = _interopRequireDefault(_FrameMenu); -__webpack_require__(722); +__webpack_require__(909); var _Frame = __webpack_require__(1013); @@ -40234,16 +41267,24 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de var FrameComponent = (0, _react.createFactory)(_Frame2.default); +function FrameLocation(_ref) { + var frame = _ref.frame; -function renderFrameLocation(frame) { var library = (0, _frame.getLibraryFromUrl)(frame); if (!library) { return null; } - return _react.DOM.div({ className: "location" }, library, (0, _Svg2.default)(library.toLowerCase(), { className: "annotation-logo" })); + return _react2.default.createElement( + "div", + { className: "location" }, + library, + _react2.default.createElement(_Svg2.default, { name: library.toLowerCase(), className: "annotation-logo" }) + ); } +FrameLocation.displayName = "FrameLocation"; + class Group extends _react.Component { constructor() { @@ -40284,38 +41325,57 @@ class Group extends _react.Component { if (!expanded) { return null; } - return _react.DOM.div({ className: "frames-list" }, group.map(frame => FrameComponent({ - frame, - copyStackTrace, - toggleFrameworkGrouping, - frameworkGroupingOn, - selectFrame, - selectedFrame, - toggleBlackBox, - key: frame.id, - hideLocation: true, - shouldMapDisplayName: false - }))); + + return _react2.default.createElement( + "div", + { className: "frames-list" }, + group.map(frame => FrameComponent({ + frame, + copyStackTrace, + toggleFrameworkGrouping, + frameworkGroupingOn, + selectFrame, + selectedFrame, + toggleBlackBox, + key: frame.id, + hideLocation: true, + shouldMapDisplayName: false + })) + ); } renderDescription() { var frame = this.props.group[0]; var displayName = (0, _frame.formatDisplayName)(frame); - return _react.DOM.li({ - key: frame.id, - className: (0, _classnames2.default)("group"), - onClick: this.toggleFrames, - tabIndex: 0 - }, _react.DOM.div({ className: "title" }, displayName), renderFrameLocation(frame)); + return _react2.default.createElement( + "li", + { + key: frame.id, + className: (0, _classnames2.default)("group"), + onClick: this.toggleFrames, + tabIndex: 0 + }, + _react2.default.createElement( + "div", + { className: "title" }, + displayName + ), + _react2.default.createElement(FrameLocation, { frame: frame }) + ); } render() { var expanded = this.state.expanded; - return _react.DOM.div({ - className: (0, _classnames2.default)("frames-group", { expanded }), - onContextMenu: e => this.onContextMenu(e) - }, this.renderDescription(), this.renderFrames()); + return _react2.default.createElement( + "div", + { + className: (0, _classnames2.default)("frames-group", { expanded }), + onContextMenu: e => this.onContextMenu(e) + }, + this.renderDescription(), + this.renderFrames() + ); } } @@ -40446,7 +41506,7 @@ var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); -__webpack_require__(709); +__webpack_require__(879); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -40598,22 +41658,22 @@ module.exports = " { - var _ref2 = _asyncToGenerator(function* (source, sourceMaps, location) { - if (!sourceMaps.isOriginalId(location.sourceId)) { - return location; - } - - return yield sourceMaps.getGeneratedLocation(location, source.toJS()); - }); - - return function getGeneratedLocation(_x2, _x3, _x4) { - return _ref2.apply(this, arguments); - }; -})(); +var _astBreakpointLocation = __webpack_require__(804); +Object.defineProperty(exports, "getASTLocation", { + enumerable: true, + get: function () { + return _astBreakpointLocation.getASTLocation; + } +}); +Object.defineProperty(exports, "findScopeByName", { + enumerable: true, + get: function () { + return _astBreakpointLocation.findScopeByName; + } +}); exports.firstString = firstString; exports.locationMoved = locationMoved; exports.makeLocationId = makeLocationId; @@ -40637,8 +41697,6 @@ var _assert2 = _interopRequireDefault(_assert); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } - // Return the first argument that is a string, or null if nothing is a // string. function firstString() { @@ -40738,11 +41796,13 @@ function createBreakpoint(location) { var overrides = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var condition = overrides.condition, disabled = overrides.disabled, + hidden = overrides.hidden, generatedLocation = overrides.generatedLocation; var properties = { condition: condition || null, disabled: disabled || false, + hidden: hidden || false, generatedLocation: generatedLocation || location, location }; @@ -40755,14 +41815,13 @@ function createPendingLocation(location) { line = location.line, column = location.column; - return { sourceUrl: sourceUrl, line, column }; + return { sourceUrl, line, column }; } function createPendingBreakpoint(bp) { var pendingLocation = createPendingLocation(bp.location); var pendingGeneratedLocation = createPendingLocation(bp.generatedLocation); - assertPendingLocation(pendingLocation); assertPendingLocation(pendingLocation); return { @@ -40786,8 +41845,10 @@ Object.defineProperty(exports, "__esModule", { exports.initialState = initialState; exports.getSymbols = getSymbols; exports.hasSymbols = hasSymbols; +exports.isEmptyLineInSource = isEmptyLineInSource; +exports.getEmptyLines = getEmptyLines; exports.getOutOfScopeLocations = getOutOfScopeLocations; -exports.getSelection = getSelection; +exports.getPreview = getPreview; var _immutable = __webpack_require__(146); @@ -40809,8 +41870,9 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; function initialState() { return (0, _makeRecord2.default)({ symbols: I.Map(), + emptyLines: I.Map(), outOfScopeLocations: null, - selection: null + preview: null })(); } @@ -40827,6 +41889,14 @@ function update() { return state.setIn(["symbols", source.id], _symbols); } + case "SET_EMPTY_LINES": + { + var _source = action.source, + _emptyLines = action.emptyLines; + + return state.setIn(["emptyLines", _source.id], _emptyLines); + } + case "OUT_OF_SCOPE_LOCATIONS": { return state.set("outOfScopeLocations", action.locations); @@ -40834,17 +41904,17 @@ function update() { case "CLEAR_SELECTION": { - return state.set("selection", null); + return state.set("preview", null); } - case "SET_SELECTION": + case "SET_PREVIEW": { if (action.status == "start") { - return state.set("selection", { updating: true }); + return state.set("preview", { updating: true }); } if (!action.value) { - return state.set("selection", null); + return state.set("preview", null); } var _action$value = action.value, @@ -40854,7 +41924,7 @@ function update() { _tokenPos = _action$value.tokenPos, _cursorPos = _action$value.cursorPos; - return state.set("selection", { + return state.set("preview", { updating: false, expression: _expression, location: _location, @@ -40896,12 +41966,25 @@ function hasSymbols(state, source) { return !!state.ast.getIn(["symbols", source.id]); } +function isEmptyLineInSource(state, line, selectedSource) { + var emptyLines = getEmptyLines(state, selectedSource); + return emptyLines.includes(line); +} + +function getEmptyLines(state, source) { + if (!source) { + return []; + } + + return state.ast.getIn(["emptyLines", source.id]) || []; +} + function getOutOfScopeLocations(state) { return state.ast.get("outOfScopeLocations"); } -function getSelection(state) { - return state.ast.get("selection"); +function getPreview(state) { + return state.ast.get("preview"); } exports.default = update; @@ -40917,9 +42000,10 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.setSymbols = setSymbols; +exports.setEmptyLines = setEmptyLines; exports.setOutOfScopeLocations = setOutOfScopeLocations; -exports.clearSelection = clearSelection; -exports.setSelection = setSelection; +exports.clearPreview = clearPreview; +exports.setPreview = setPreview; var _selectors = __webpack_require__(242); @@ -40964,12 +42048,43 @@ function setSymbols(sourceId) { })(); } -function setOutOfScopeLocations() { +function setEmptyLines(sourceId) { return (() => { var _ref3 = _asyncToGenerator(function* (_ref4) { var dispatch = _ref4.dispatch, getState = _ref4.getState; + var sourceRecord = (0, _selectors.getSource)(getState(), sourceId); + if (!sourceRecord) { + return; + } + + var source = sourceRecord.toJS(); + if (!source.text) { + return; + } + + var emptyLines = yield parser.getEmptyLines(source); + + dispatch({ + type: "SET_EMPTY_LINES", + source, + emptyLines + }); + }); + + return function (_x2) { + return _ref3.apply(this, arguments); + }; + })(); +} + +function setOutOfScopeLocations() { + return (() => { + var _ref5 = _asyncToGenerator(function* (_ref6) { + var dispatch = _ref6.dispatch, + getState = _ref6.getState; + var location = (0, _selectors.getSelectedLocation)(getState()); if (!location) { return; @@ -40992,19 +42107,19 @@ function setOutOfScopeLocations() { }); }); - return function (_x2) { - return _ref3.apply(this, arguments); + return function (_x3) { + return _ref5.apply(this, arguments); }; })(); } -function clearSelection() { - return (_ref5) => { - var dispatch = _ref5.dispatch, - getState = _ref5.getState, - client = _ref5.client; +function clearPreview() { + return (_ref7) => { + var dispatch = _ref7.dispatch, + getState = _ref7.getState, + client = _ref7.client; - var currentSelection = (0, _selectors.getSelection)(getState()); + var currentSelection = (0, _selectors.getPreview)(getState()); if (!currentSelection) { return; } @@ -41032,20 +42147,20 @@ function findBestMatch(symbols, tokenPos, token) { }, {}); } -function setSelection(token, tokenPos, cursorPos) { +function setPreview(token, tokenPos, cursorPos) { return (() => { - var _ref6 = _asyncToGenerator(function* (_ref7) { - var dispatch = _ref7.dispatch, - getState = _ref7.getState, - client = _ref7.client; + var _ref8 = _asyncToGenerator(function* (_ref9) { + var dispatch = _ref9.dispatch, + getState = _ref9.getState, + client = _ref9.client; - var currentSelection = (0, _selectors.getSelection)(getState()); + var currentSelection = (0, _selectors.getPreview)(getState()); if (currentSelection && currentSelection.updating) { return; } yield dispatch({ - type: "SET_SELECTION", + type: "SET_PREVIEW", [_promise.PROMISE]: _asyncToGenerator(function* () { var source = (0, _selectors.getSelectedSource)(getState()); var _symbols = yield parser.getSymbols(source.toJS()); @@ -41065,10 +42180,10 @@ function setSelection(token, tokenPos, cursorPos) { var selectedFrame = (0, _selectors.getSelectedFrame)(getState()); - var _ref9 = yield client.evaluate(expression, { + var _ref11 = yield client.evaluate(expression, { frameId: selectedFrame.id }), - result = _ref9.result; + result = _ref11.result; if (!result) { return; @@ -41085,8 +42200,8 @@ function setSelection(token, tokenPos, cursorPos) { }); }); - return function (_x3) { - return _ref6.apply(this, arguments); + return function (_x4) { + return _ref8.apply(this, arguments); }; })(); } @@ -41128,7 +42243,7 @@ var _SearchInput = __webpack_require__(377); var _SearchInput2 = _interopRequireDefault(_SearchInput); -__webpack_require__(694); +__webpack_require__(866); var _sourcesTree = __webpack_require__(39); @@ -41207,14 +42322,6 @@ class TextSearch extends _react.Component { this.focused = { setExpanded, file, expanded }; } - var svgArrow = (0, _Svg2.default)("arrow", { - className: (0, _classnames2.default)({ - expanded - }) - }); - - var svgFile = (0, _Svg2.default)("file"); - var matches = ` (${file.matches.length} match${file.matches.length > 1 ? "es" : ""})`; return _react2.default.createElement( @@ -41224,8 +42331,8 @@ class TextSearch extends _react.Component { key: file.sourceId, onClick: e => setExpanded(file, !expanded) }, - svgArrow, - svgFile, + _react2.default.createElement(_Svg2.default, { name: "arrow", className: (0, _classnames2.default)({ expanded }) }), + _react2.default.createElement(_Svg2.default, { name: "file" }), _react2.default.createElement( "span", { className: "file-path" }, @@ -41274,14 +42381,14 @@ class TextSearch extends _react.Component { if (matchIndex > 0 && index === 0) { matches.push(_react2.default.createElement( "span", - { className: "line-match" }, + { className: "line-match", key: `case1-${index}` }, value.slice(0, matchIndex) )); } if (matchIndex > matchIndexes[index - 1] + len) { matches.push(_react2.default.createElement( "span", - { className: "line-match" }, + { className: "line-match", key: `case2-${index}` }, value.slice(matchIndexes[index - 1] + len, matchIndex) )); } @@ -41293,13 +42400,17 @@ class TextSearch extends _react.Component { if (index === matchIndexes.length - 1) { matches.push(_react2.default.createElement( "span", - { className: "line-match" }, + { className: "line-match", key: `case3-${index}` }, value.slice(matchIndex + len, value.length) )); } }); - return _react.DOM.span.apply(_react.DOM, [{ className: "line-value" }].concat(matches)); + return _react2.default.createElement( + "span", + { className: "line-value" }, + matches + ); } getResults() { @@ -41324,7 +42435,7 @@ class TextSearch extends _react.Component { return _react2.default.createElement(_ManagedTree2.default, { getRoots: () => results, getChildren: file => file.matches || [], - itemHeight: 20, + itemHeight: 24, autoExpand: 1, autoExpandDepth: 1, focused: results[0], @@ -41506,7 +42617,7 @@ var _lodash = __webpack_require__(2); var _pause = __webpack_require__(255); -__webpack_require__(723); +__webpack_require__(913); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -41626,8 +42737,39 @@ function getInScopeLines(state) { /***/ }), /* 1125 */, -/* 1126 */, -/* 1127 */, +/* 1126 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 1127 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.containsPosition = containsPosition; +exports.containsLocation = containsLocation; +exports.nodeContainsPosition = nodeContainsPosition; +function containsPosition(a, b) { + var startsBefore = a.start.line < b.line || a.start.line === b.line && a.start.column <= b.column; + var endsAfter = a.end.line > b.line || a.end.line === b.line && a.end.column >= b.column; + + return startsBefore && endsAfter; +} +function containsLocation(a, b) { + return containsPosition(a, b.start) && containsPosition(a, b.end); +} + +function nodeContainsPosition(node, position) { + return containsPosition(node.loc, position); +} + +/***/ }), /* 1128 */ /***/ (function(module, exports, __webpack_require__) { @@ -41669,7 +42811,7 @@ function inToolbox() { } if (!inToolbox()) { - __webpack_require__(683); + __webpack_require__(854); } function createPopup(doc) { @@ -41805,7 +42947,49 @@ module.exports = { /***/ }), /* 1131 */, -/* 1132 */, +/* 1132 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = update; +exports.getSourceSearchQuery = getSourceSearchQuery; + +var _makeRecord = __webpack_require__(230); + +var _makeRecord2 = _interopRequireDefault(_makeRecord); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function InitialState() { + return (0, _makeRecord2.default)({ + queryString: "" + })(); +} + +function update() { + var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : InitialState(); + var action = arguments[1]; + + switch (action.type) { + case "SET_QUERY_STRING": + return state.update("queryString", value => action.queryString); + case "CLEAR_QUERY_STRING": + return state.update("queryString", value => ""); + default: + return state; + } +} + +function getSourceSearchQuery(state) { + return state.sourceSearch.get("queryString"); +} + +/***/ }), /* 1133 */ /***/ (function(module, exports, __webpack_require__) { @@ -42034,7 +43218,8 @@ function getLocation(breakpoint, isGeneratedSource) { function formatBreakpoint(breakpoint, selectedSource) { var condition = breakpoint.condition, loading = breakpoint.loading, - disabled = breakpoint.disabled; + disabled = breakpoint.disabled, + hidden = breakpoint.hidden; var sourceId = selectedSource.get("id"); var isGeneratedSource = (0, _devtoolsSourceMap.isGeneratedId)(sourceId); @@ -42043,7 +43228,8 @@ function formatBreakpoint(breakpoint, selectedSource) { location: getLocation(breakpoint, isGeneratedSource), condition, loading, - disabled + disabled, + hidden }; } @@ -42081,35 +43267,23 @@ 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 _getGeneratedLocation = (() => { - var _ref = _asyncToGenerator(function* (state, source, sourceMaps, location) { - var generatedLocation = yield (0, _breakpoint.getGeneratedLocation)(source, sourceMaps, location); - - var generatedSource = (0, _selectors.getSource)(state, generatedLocation.sourceId); - var sourceUrl = generatedSource.get("url"); - return _extends({}, generatedLocation, { sourceUrl }); - }); - - return function _getGeneratedLocation(_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); - }; -})(); - var _breakpoint = __webpack_require__(1057); var _selectors = __webpack_require__(242); +var _sourceMaps = __webpack_require__(797); + function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } exports.default = (() => { - var _ref2 = _asyncToGenerator(function* (getState, client, sourceMaps, _ref3) { - var breakpoint = _ref3.breakpoint; + var _ref = _asyncToGenerator(function* (getState, client, sourceMaps, _ref2) { + var breakpoint = _ref2.breakpoint; var state = getState(); var source = (0, _selectors.getSource)(state, breakpoint.location.sourceId); var location = _extends({}, breakpoint.location, { sourceUrl: source.get("url") }); - var generatedLocation = yield _getGeneratedLocation(state, source, sourceMaps, location); + var generatedLocation = yield (0, _sourceMaps.getGeneratedLocation)(state, source.toJS(), location, sourceMaps); (0, _breakpoint.assertLocation)(location); (0, _breakpoint.assertLocation)(generatedLocation); @@ -42120,10 +43294,10 @@ exports.default = (() => { return { breakpoint: _newBreakpoint }; } - var _ref4 = yield client.setBreakpoint(generatedLocation, breakpoint.condition, sourceMaps.isOriginalId(location.sourceId)), - id = _ref4.id, - hitCount = _ref4.hitCount, - actualLocation = _ref4.actualLocation; + var _ref3 = yield client.setBreakpoint(generatedLocation, breakpoint.condition, sourceMaps.isOriginalId(location.sourceId)), + id = _ref3.id, + hitCount = _ref3.hitCount, + actualLocation = _ref3.actualLocation; var newGeneratedLocation = actualLocation || generatedLocation; var newLocation = yield sourceMaps.getOriginalLocation(newGeneratedLocation); @@ -42131,6 +43305,7 @@ exports.default = (() => { var newBreakpoint = { id, disabled: false, + hidden: breakpoint.hidden, loading: false, condition: breakpoint.condition, location: newLocation, @@ -42148,8 +43323,8 @@ exports.default = (() => { }; }); - function addBreakpoint(_x5, _x6, _x7, _x8) { - return _ref2.apply(this, arguments); + function addBreakpoint(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); } return addBreakpoint; @@ -42166,35 +43341,15 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.syncClientBreakpoint = undefined; -var _selectors = __webpack_require__(242); 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; }; -async function getGeneratedLocation( - state, - source, - location, - sourceMaps -) { - if (!sourceMaps.isOriginalId(location.sourceId)) { - return location; - } - - const generatedLocation = await sourceMaps.getGeneratedLocation( - location, - source - ); - const generatedSource = _selectors.getSource(state, generatedLocation.sourceId); - const sourceUrl = generatedSource.get("url"); - return { ...generatedLocation, sourceUrl }; -} - // we have three forms of syncing: disabled syncing, existing server syncing // and adding a new breakpoint var syncClientBreakpoint = exports.syncClientBreakpoint = (() => { var _ref = _asyncToGenerator(function* (getState, client, sourceMaps, source, pendingBreakpoint) { - var sourceId = source.id; - var generatedSourceId = sourceMaps.isOriginalId(sourceId) ? (0, _devtoolsSourceMap.originalToGeneratedId)(sourceId) : sourceId; + var sourceId = source.id; + var generatedSourceId = sourceMaps.isOriginalId(sourceId) ? (0, _devtoolsSourceMap.originalToGeneratedId)(sourceId) : sourceId; // this is the generatedLocation of the pending breakpoint, with // the source id updated to reflect the new connection @@ -42203,7 +43358,7 @@ var syncClientBreakpoint = exports.syncClientBreakpoint = (() => { }); var location = _extends({}, pendingBreakpoint.location, { - sourceId: sourceId + sourceId }); (0, _breakpoint3.assertPendingBreakpoint)(pendingBreakpoint); @@ -42232,32 +43387,21 @@ var syncClientBreakpoint = exports.syncClientBreakpoint = (() => { var existingClient = client.getBreakpointByLocation(generatedLocation); if (existingClient) { - const newGeneratedLocation = yield getGeneratedLocation( - getState(), - source, - location, - sourceMaps - ); + var _newGeneratedLocation = yield (0, _sourceMaps.getGeneratedLocation)(getState(), source, location, sourceMaps); - if ((0, _breakpoint3.locationMoved)(generatedLocation, newGeneratedLocation)) { - yield client.removeBreakpoint(generatedLocation); - yield client.setBreakpoint( - newGeneratedLocation, - pendingBreakpoint.condition, - sourceMaps.isOriginalId(sourceId) - ); - } + if ((0, _breakpoint3.locationMoved)(generatedLocation, _newGeneratedLocation)) { + yield client.removeBreakpoint(generatedLocation); + yield client.setBreakpoint(_newGeneratedLocation, pendingBreakpoint.condition, sourceMaps.isOriginalId(sourceId)); + } - const breakpoint = { - ...pendingBreakpoint, - id: (0, _breakpoint3.makeLocationId)(location), - generatedLocation: newGeneratedLocation, - location: location - }; - - (0, _breakpoint3.assertPendingBreakpoint)(breakpoint); - return { breakpoint, previousLocation: location }; + var _breakpoint2 = _extends({}, pendingBreakpoint, { + id: (0, _breakpoint3.makeLocationId)(location), + generatedLocation: _newGeneratedLocation, + location: location + }); + (0, _breakpoint3.assertBreakpoint)(_breakpoint2); + return { breakpoint: _breakpoint2, previousLocation: location }; } /** ******* CASE 3: Add New Breakpoint ***********/ @@ -42278,13 +43422,15 @@ var syncClientBreakpoint = exports.syncClientBreakpoint = (() => { return { breakpoint, previousLocation: location }; }); - return function syncClientBreakpoint(_x, _x2, _x3, _x4) { + return function syncClientBreakpoint(_x, _x2, _x3, _x4, _x5) { return _ref.apply(this, arguments); }; })(); var _breakpoint3 = __webpack_require__(1057); +var _sourceMaps = __webpack_require__(797); + var _devtoolsSourceMap = __webpack_require__(898); 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"); }); }; } @@ -42415,7 +43561,7 @@ var _prefs = __webpack_require__(226); var _selectors = __webpack_require__(242); -__webpack_require__(697); +__webpack_require__(869); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -42492,13 +43638,19 @@ class ProjectSearch extends _react.Component { var _props3 = this.props, sources = _props3.sources, selectSource = _props3.selectSource, - closeActiveSearch = _props3.closeActiveSearch; + closeActiveSearch = _props3.closeActiveSearch, + sourceSearchQuery = _props3.sourceSearchQuery, + setSourceSearchQuery = _props3.setSourceSearchQuery, + clearSourceSearchQuery = _props3.clearSourceSearchQuery; return _react2.default.createElement(_SourceSearch2.default, { sources: sources, selectSource: selectSource, closeActiveSearch: closeActiveSearch, - searchBottomBar: _react2.default.createElement(_ToggleSearch2.default, { kind: "sources", toggle: this.toggleProjectTextSearch }) + searchBottomBar: _react2.default.createElement(_ToggleSearch2.default, { kind: "sources", toggle: this.toggleProjectTextSearch }), + query: sourceSearchQuery, + setQuery: setSourceSearchQuery, + clearQuery: clearSourceSearchQuery }); } @@ -42509,7 +43661,7 @@ class ProjectSearch extends _react.Component { searchSources = _props4.searchSources, closeActiveSearch = _props4.closeActiveSearch, selectSource = _props4.selectSource, - query = _props4.query; + textSearchQuery = _props4.textSearchQuery; return _react2.default.createElement(_TextSearch2.default, { @@ -42518,7 +43670,7 @@ class ProjectSearch extends _react.Component { searchSources: searchSources, closeActiveSearch: closeActiveSearch, selectSource: selectSource, - query: query, + query: textSearchQuery, searchBottomBar: _react2.default.createElement(_ToggleSearch2.default, { kind: "project", toggle: this.toggleSourceSearch }) }); } @@ -42539,12 +43691,15 @@ class ProjectSearch extends _react.Component { ProjectSearch.propTypes = { sources: _react.PropTypes.object.isRequired, results: _react.PropTypes.object, - query: _react.PropTypes.string, + textSearchQuery: _react.PropTypes.string, setActiveSearch: _react.PropTypes.func.isRequired, closeActiveSearch: _react.PropTypes.func.isRequired, searchSources: _react.PropTypes.func, activeSearch: _react.PropTypes.string, - selectSource: _react.PropTypes.func.isRequired + selectSource: _react.PropTypes.func.isRequired, + sourceSearchQuery: _react.PropTypes.string, + setSourceSearchQuery: _react.PropTypes.func, + clearSourceSearchQuery: _react.PropTypes.func }; ProjectSearch.contextTypes = { @@ -42557,7 +43712,8 @@ exports.default = (0, _reactRedux.connect)(state => ({ sources: (0, _selectors.getSources)(state), activeSearch: (0, _selectors.getActiveSearchState)(state), results: (0, _selectors.getTextSearchResults)(state), - query: (0, _selectors.getTextSearchQuery)(state) + textSearchQuery: (0, _selectors.getTextSearchQuery)(state), + sourceSearchQuery: (0, _selectors.getSourceSearchQuery)(state) }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(ProjectSearch); /***/ }), @@ -42592,10 +43748,6 @@ class SourceSearch extends _react.Component { super(props); this.close = this.close.bind(this); - - this.state = { - inputValue: "" - }; } componentWillUnmount() { @@ -42625,7 +43777,7 @@ class SourceSearch extends _react.Component { } close() { - this.setState({ inputValue: "" }); + this.props.clearQuery(); this.props.closeActiveSearch(); } @@ -42633,7 +43785,9 @@ class SourceSearch extends _react.Component { var _props = this.props, sources = _props.sources, searchBottomBar = _props.searchBottomBar, - selectSource = _props.selectSource; + selectSource = _props.selectSource, + query = _props.query, + setQuery = _props.setQuery; return _react2.default.createElement( _Autocomplete2.default, @@ -42644,8 +43798,9 @@ class SourceSearch extends _react.Component { }, close: this.close, items: this.searchResults(sources), - inputValue: this.state.inputValue, + inputValue: query, placeholder: L10N.getStr("sourceSearch.search"), + onChangeHandler: setQuery, size: "big" }, searchBottomBar @@ -42673,6 +43828,8 @@ Object.defineProperty(exports, "__esModule", { var _react = __webpack_require__(0); +var _react2 = _interopRequireDefault(_react); + var _redux = __webpack_require__(3); var _reactRedux = __webpack_require__(151); @@ -42687,26 +43844,22 @@ var _selectors = __webpack_require__(242); var _devtoolsConfig = __webpack_require__(828); -__webpack_require__(699); +__webpack_require__(870); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); -var _Outline2 = __webpack_require__(1145); +var _Outline = __webpack_require__(1145); -var _Outline3 = _interopRequireDefault(_Outline2); +var _Outline2 = _interopRequireDefault(_Outline); -var _SourcesTree2 = __webpack_require__(1148); +var _SourcesTree = __webpack_require__(1148); -var _SourcesTree3 = _interopRequireDefault(_SourcesTree2); +var _SourcesTree2 = _interopRequireDefault(_SourcesTree); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var Outline = (0, _react.createFactory)(_Outline3.default); - -var SourcesTree = (0, _react.createFactory)(_SourcesTree3.default); - class PrimaryPanes extends _react.Component { constructor(props) { @@ -42727,44 +43880,59 @@ class PrimaryPanes extends _react.Component { return; } - return [_react.DOM.div({ - className: (0, _classnames2.default)("tab", { - active: this.state.selectedPane === "sources" - }), - onClick: () => this.showPane("sources"), - key: "sources-tab" - }, "Sources View"), _react.DOM.div({ - className: (0, _classnames2.default)("tab", { - active: this.state.selectedPane === "outline" - }), - onClick: () => this.showPane("outline"), - key: "outline-tab" - }, "Outline View")]; + return [_react2.default.createElement( + "div", + { + className: (0, _classnames2.default)("tab", { + active: this.state.selectedPane === "sources" + }), + onClick: () => this.showPane("sources"), + key: "sources-tab" + }, + "Sources View" + ), _react2.default.createElement( + "div", + { + className: (0, _classnames2.default)("tab", { + active: this.state.selectedPane === "outline" + }), + onClick: () => this.showPane("outline"), + key: "outline-tab" + }, + "Outline View" + )]; } renderFooter() { - return _react.DOM.div({ - className: "source-footer" - }, this.renderOutlineTabs()); + return _react2.default.createElement( + "div", + { className: "source-footer" }, + this.renderOutlineTabs() + ); } renderShortcut() { if (this.props.horizontal) { - return _react.DOM.span({ - className: "sources-header-info", - dir: "ltr", - onClick: () => { - if (this.props.sourceSearchOn) { - return this.props.closeActiveSearch(); - } - this.props.setActiveSearch("source"); + var onClick = () => { + if (this.props.sourceSearchOn) { + return this.props.closeActiveSearch(); } - }, L10N.getFormatStr("sources.search", (0, _text.formatKeyShortcut)(L10N.getStr("sources.search.key2")))); + this.props.setActiveSearch("source"); + }; + return _react2.default.createElement( + "span", + { className: "sources-header-info", dir: "ltr", onClick: onClick }, + L10N.getFormatStr("sources.search", (0, _text.formatKeyShortcut)(L10N.getStr("sources.search.key2"))) + ); } } renderHeader() { - return _react.DOM.div({ className: "sources-header" }, this.renderShortcut()); + return _react2.default.createElement( + "div", + { className: "sources-header" }, + this.renderShortcut() + ); } render() { @@ -42774,11 +43942,21 @@ class PrimaryPanes extends _react.Component { selectSource = _props.selectSource; - return _react.DOM.div({ className: "sources-panel" }, this.renderHeader(), SourcesTree({ - sources, - selectSource, - isHidden: selectedPane === "outline" - }), Outline({ selectSource, isHidden: selectedPane === "sources" }), this.renderFooter()); + return _react2.default.createElement( + "div", + { className: "sources-panel" }, + this.renderHeader(), + _react2.default.createElement(_SourcesTree2.default, { + sources: sources, + selectSource: selectSource, + isHidden: selectedPane === "outline" + }), + _react2.default.createElement(_Outline2.default, { + selectSource: selectSource, + isHidden: selectedPane === "sources" + }), + this.renderFooter() + ); } } @@ -42790,8 +43968,121 @@ exports.default = (0, _reactRedux.connect)(state => ({ }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(PrimaryPanes); /***/ }), -/* 1143 */, -/* 1144 */, +/* 1143 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.setSourceSearchQuery = setSourceSearchQuery; +exports.clearSourceSearchQuery = clearSourceSearchQuery; +function setSourceSearchQuery(queryString) { + return (_ref) => { + var dispatch = _ref.dispatch, + getState = _ref.getState; + + dispatch({ + type: "SET_QUERY_STRING", + queryString + }); + }; +} + +function clearSourceSearchQuery() { + return (_ref2) => { + var dispatch = _ref2.dispatch, + getState = _ref2.getState; + + dispatch({ + type: "CLEAR_QUERY_STRING" + }); + }; +} + +/***/ }), +/* 1144 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _reactRedux = __webpack_require__(151); + +var _redux = __webpack_require__(3); + +var _react = __webpack_require__(0); + +var _actions = __webpack_require__(244); + +var _actions2 = _interopRequireDefault(_actions); + +var _selectors = __webpack_require__(242); + +__webpack_require__(1146); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +class EmptyLines extends _react.Component { + + componentDidMount() { + this.disableEmptyLines(); + } + + componentDidUpdate() { + this.disableEmptyLines(); + } + + componentWillUnmount() { + var _props = this.props, + emptyLines = _props.emptyLines, + editor = _props.editor; + + + if (!emptyLines) { + return; + } + editor.codeMirror.operation(() => { + emptyLines.forEach(line => editor.codeMirror.removeLineClass(line, "line", "empty-line")); + }); + } + + disableEmptyLines() { + var _props2 = this.props, + emptyLines = _props2.emptyLines, + editor = _props2.editor; + + + if (!emptyLines) { + return; + } + editor.codeMirror.operation(() => { + emptyLines.forEach(line => editor.codeMirror.addLineClass(line, "line", "empty-line")); + }); + } + + render() { + return null; + } +} + +EmptyLines.displayName = "EmptyLines"; + +exports.default = (0, _reactRedux.connect)(state => { + var selectedSource = (0, _selectors.getSelectedSource)(state); + return { + selectedSource, + emptyLines: selectedSource ? (0, _selectors.getEmptyLines)(state, selectedSource.toJS()) : [] + }; +}, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(EmptyLines); + +/***/ }), /* 1145 */ /***/ (function(module, exports, __webpack_require__) { @@ -42801,6 +44092,7 @@ exports.default = (0, _reactRedux.connect)(state => ({ Object.defineProperty(exports, "__esModule", { value: true }); +exports.Outline = undefined; var _react = __webpack_require__(0); @@ -42822,21 +44114,16 @@ var _selectors = __webpack_require__(242); var _devtoolsConfig = __webpack_require__(828); -__webpack_require__(700); +__webpack_require__(871); -var _previewFunction = __webpack_require__(701); +var _PreviewFunction = __webpack_require__(798); -var _previewFunction2 = _interopRequireDefault(_previewFunction); +var _PreviewFunction2 = _interopRequireDefault(_PreviewFunction); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class Outline extends _react.Component { - constructor(props) { - super(props); - this.state = {}; - } - selectItem(location) { var _props = this.props, selectedSource = _props.selectedSource, @@ -42862,7 +44149,7 @@ class Outline extends _react.Component { className: "outline-list__element", onClick: () => this.selectItem(location) }, - (0, _previewFunction2.default)({ name }) + _react2.default.createElement(_PreviewFunction2.default, { func: { name } }) ); } @@ -42892,6 +44179,7 @@ class Outline extends _react.Component { } } +exports.Outline = Outline; Outline.displayName = "Outline"; exports.default = (0, _reactRedux.connect)(state => { @@ -42903,8 +44191,73 @@ exports.default = (0, _reactRedux.connect)(state => { }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Outline); /***/ }), -/* 1146 */, -/* 1147 */, +/* 1146 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 1147 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Workers = undefined; + +var _react = __webpack_require__(0); + +var _react2 = _interopRequireDefault(_react); + +__webpack_require__(1149); + +var _reactRedux = __webpack_require__(151); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +class Workers extends _react.PureComponent { + renderWorkers(workers) { + return workers.map(w => _react2.default.createElement( + "div", + null, + w + )); + } + + renderNoWorkersPlaceholder() { + return L10N.getStr("noWorkersText"); + } + + render() { + var workers = this.props.workers; + + return _react2.default.createElement( + "div", + { className: "pane" }, + _react2.default.createElement( + "div", + { className: "pane-info" }, + workers && workers.length > 0 ? this.renderWorkers(workers) : this.renderNoWorkersPlaceholder() + ) + ); + } +} + +exports.Workers = Workers; +Workers.displayName = "Workers"; +Workers.propTypes = { + workers: _react.PropTypes.array.isRequired +}; + +function mapStateToProps(state) { + return { workers: [] }; +} +exports.default = (0, _reactRedux.connect)(mapStateToProps)(Workers); + +/***/ }), /* 1148 */ /***/ (function(module, exports, __webpack_require__) { @@ -42921,6 +44274,8 @@ var _reactRedux = __webpack_require__(151); var _react = __webpack_require__(0); +var _react2 = _interopRequireDefault(_react); + var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); @@ -42935,9 +44290,9 @@ var _selectors = __webpack_require__(242); var _sourcesTree = __webpack_require__(39); -var _ManagedTree2 = __webpack_require__(419); +var _ManagedTree = __webpack_require__(419); -var _ManagedTree3 = _interopRequireDefault(_ManagedTree2); +var _ManagedTree2 = _interopRequireDefault(_ManagedTree); var _actions = __webpack_require__(244); @@ -42955,8 +44310,6 @@ var _utils = __webpack_require__(234); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var ManagedTree = (0, _react.createFactory)(_ManagedTree3.default); - class SourcesTree extends _react.Component { constructor(props) { @@ -43065,14 +44418,14 @@ class SourcesTree extends _react.Component { getIcon(item, depth) { if (depth === 0) { - return (0, _Svg2.default)("domain"); + return _react2.default.createElement(_Svg2.default, { name: "domain" }); } if (!(0, _sourcesTree.nodeHasChildren)(item)) { - return (0, _Svg2.default)("file"); + return _react2.default.createElement(_Svg2.default, { name: "file" }); } - return (0, _Svg2.default)("folder"); + return _react2.default.createElement(_Svg2.default, { name: "folder" }); } onContextMenu(event, item) { @@ -43103,7 +44456,8 @@ class SourcesTree extends _react.Component { renderItem(item, depth, focused, _, expanded, _ref) { var setExpanded = _ref.setExpanded; - var arrow = (0, _Svg2.default)("arrow", { + var arrow = _react2.default.createElement(_Svg2.default, { + name: "arrow", className: (0, _classnames2.default)({ expanded: expanded, hidden: !(0, _sourcesTree.nodeHasChildren)(item) @@ -43120,16 +44474,26 @@ class SourcesTree extends _react.Component { paddingDir = document.body.parentElement.dir == "ltr" ? "paddingLeft" : "paddingRight"; } - return _react.DOM.div({ - className: (0, _classnames2.default)("node", { focused }), - style: { [paddingDir]: `${depth * 15}px` }, - key: item.path, - onClick: () => { - this.selectItem(item); - setExpanded(item, !expanded); + return _react2.default.createElement( + "div", + { + className: (0, _classnames2.default)("node", { focused }), + style: { [paddingDir]: `${depth * 15}px` }, + key: item.path, + onClick: () => { + this.selectItem(item); + setExpanded(item, !expanded); + }, + onContextMenu: e => this.onContextMenu(e, item) }, - onContextMenu: e => this.onContextMenu(e, item) - }, _react.DOM.div(null, arrow, icon, item.name)); + _react2.default.createElement( + "div", + null, + arrow, + icon, + item.name + ) + ); } render() { @@ -43144,17 +44508,10 @@ class SourcesTree extends _react.Component { var isEmpty = sourceTree.contents.length === 0; - var tree = ManagedTree({ + var treeProps = { key: isEmpty ? "empty" : "full", - getParent: item => { - return parentMap.get(item); - }, - getChildren: item => { - if ((0, _sourcesTree.nodeHasChildren)(item)) { - return item.contents; - } - return []; - }, + getParent: item => parentMap.get(item), + getChildren: item => (0, _sourcesTree.nodeHasChildren)(item) ? item.contents : [], getRoots: () => sourceTree.contents, getPath: item => `${item.path}/${item.name}`, itemHeight: 21, @@ -43164,23 +44521,32 @@ class SourcesTree extends _react.Component { listItems, highlightItems, renderItem: this.renderItem - }); + }; - var noSourcesMessage = _react.DOM.div({ - className: "no-sources-message" - }, L10N.getStr("sources.noSourcesAvailable")); + var tree = _react2.default.createElement(_ManagedTree2.default, treeProps); if (isEmpty) { - return noSourcesMessage; + return _react2.default.createElement( + "div", + { className: "no-sources-message" }, + L10N.getStr("sources.noSourcesAvailable") + ); } - return _react.DOM.div({ - className: (0, _classnames2.default)("sources-list", { hidden: isHidden }), - onKeyDown: e => { - if (e.keyCode === 13 && focusedItem) { - this.selectItem(focusedItem); - } + + var onKeyDown = e => { + if (e.keyCode === 13 && focusedItem) { + this.selectItem(focusedItem); } - }, tree); + }; + + return _react2.default.createElement( + "div", + { + className: (0, _classnames2.default)("sources-list", { hidden: isHidden }), + onKeyDown: onKeyDown + }, + tree + ); } } @@ -43204,7 +44570,12 @@ exports.default = (0, _reactRedux.connect)(state => { }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(SourcesTree); /***/ }), -/* 1149 */, +/* 1149 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), /* 1150 */, /* 1151 */ /***/ (function(module, exports, __webpack_require__) { @@ -43275,7 +44646,7 @@ var _require = __webpack_require__(0), PropTypes = _require.PropTypes; var Tree = createFactory(__webpack_require__(1007).Tree); -__webpack_require__(708); +__webpack_require__(878); var classnames = __webpack_require__(175); var Svg = __webpack_require__(1151); @@ -44169,12 +45540,14 @@ var _visibleBreakpoints2 = _interopRequireDefault(_visibleBreakpoints); var _breakpoint = __webpack_require__(1057); +var _source = __webpack_require__(233); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class Breakpoints extends _react.Component { shouldComponentUpdate(nextProps) { - if (nextProps.selectedSource && nextProps.selectedSource.get("loading")) { + if (nextProps.selectedSource && !(0, _source.isLoaded)(nextProps.selectedSource.toJS())) { return false; } @@ -44229,6 +45602,8 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument var _react = __webpack_require__(0); +var _react2 = _interopRequireDefault(_react); + var _reactRedux = __webpack_require__(151); var _redux = __webpack_require__(3); @@ -44237,9 +45612,9 @@ var _devtoolsConfig = __webpack_require__(828); var _lodash = __webpack_require__(2); -var _CallSite2 = __webpack_require__(1167); +var _CallSite = __webpack_require__(1167); -var _CallSite3 = _interopRequireDefault(_CallSite2); +var _CallSite2 = _interopRequireDefault(_CallSite); var _selectors = __webpack_require__(242); @@ -44251,8 +45626,6 @@ var _actions2 = _interopRequireDefault(_actions); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var CallSite = (0, _react.createFactory)(_CallSite3.default); - function getCallSiteAtLocation(callSites, location) { return (0, _lodash.find)(callSites, callSite => (0, _lodash.isEqualWith)(callSite.location, location, (cloc, loc) => { return loc.line === cloc.start.line && loc.column >= cloc.start.column && loc.column <= cloc.end.column; @@ -44312,7 +45685,7 @@ class CallSites extends _react.Component { selectedLocation = _props.selectedLocation; - if (!(0, _devtoolsConfig.isEnabled)("columnBreakpoints") || !e.altKey || !target.classList.contains("call-site") && !target.classList.contains("call-site-bp")) { + if (!(0, _devtoolsConfig.isEnabled)("columnBreakpoints") || !e.altKey && !target.classList.contains("call-site-bp") || !target.classList.contains("call-site") && !target.classList.contains("call-site-bp")) { return; } @@ -44322,7 +45695,7 @@ class CallSites extends _react.Component { line = _getTokenLocation.line, column = _getTokenLocation.column; - this.toggleBreakpoint((0, _editor.toSourceLine)(sourceId, line), (0, _editor.isWasm)(sourceId) ? undefined : column - 2); + this.toggleBreakpoint(line, (0, _editor.isWasm)(sourceId) ? undefined : column); } toggleBreakpoint(line) { @@ -44381,16 +45754,22 @@ class CallSites extends _react.Component { } editor.codeMirror.operation(() => { - sites = _react.DOM.div({}, callSites.map((callSite, index) => { - return CallSite({ + var childCallSites = callSites.map((callSite, index) => { + var props = { key: index, callSite, editor, source: selectedSource, breakpoint: callSite.breakpoint, showCallSite: showCallSites - }); - })); + }; + return _react2.default.createElement(_CallSite2.default, props); + }); + sites = _react2.default.createElement( + "div", + null, + childCallSites + ); }); return sites; } @@ -44478,7 +45857,7 @@ var _react = __webpack_require__(0); var _editor = __webpack_require__(257); -__webpack_require__(713); +__webpack_require__(882); class CallSite extends _react.Component { @@ -44536,9 +45915,11 @@ class CallSite extends _react.Component { if (nextProps.breakpoint !== breakpoint) { if (this.marker) { - this.marker.clear(); + this.clearCallSite(); + } + if (nextProps.showCallSite) { + this.addCallSite(nextProps); } - this.addCallSite(nextProps); } if (nextProps.showCallSite !== showCallSite) { @@ -44610,7 +45991,7 @@ var _ResultList = __webpack_require__(383); var _ResultList2 = _interopRequireDefault(_ResultList); -__webpack_require__(738); +__webpack_require__(962); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } diff --git a/devtools/client/debugger/new/parser-worker.js b/devtools/client/debugger/new/parser-worker.js index 4e0c997487a6..c1ded35c77bb 100644 --- a/devtools/client/debugger/new/parser-worker.js +++ b/devtools/client/debugger/new/parser-worker.js @@ -2290,42 +2290,7 @@ module.exports = invariant; /* 193 */, /* 194 */, /* 195 */, -/* 196 */ -/***/ (function(module, exports, __webpack_require__) { - -var baseToPairs = __webpack_require__(796), - getTag = __webpack_require__(198), - mapToArray = __webpack_require__(203), - setToPairs = __webpack_require__(204); - -/** `Object#toString` result references. */ -var mapTag = '[object Map]', - setTag = '[object Set]'; - -/** - * Creates a `_.toPairs` or `_.toPairsIn` function. - * - * @private - * @param {Function} keysFunc The function to get the keys of a given object. - * @returns {Function} Returns the new pairs function. - */ -function createToPairs(keysFunc) { - return function(object) { - var tag = getTag(object); - if (tag == mapTag) { - return mapToArray(object); - } - if (tag == setTag) { - return setToPairs(object); - } - return baseToPairs(object, keysFunc(object)); - }; -} - -module.exports = createToPairs; - - -/***/ }), +/* 196 */, /* 197 */, /* 198 */ /***/ (function(module, exports, __webpack_require__) { @@ -2467,30 +2432,7 @@ module.exports = mapToArray; /***/ }), -/* 204 */ -/***/ (function(module, exports) { - -/** - * Converts `set` to its value-value pairs. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the value-value pairs. - */ -function setToPairs(set) { - var index = -1, - result = Array(set.size); - - set.forEach(function(value) { - result[++index] = [value, value]; - }); - return result; -} - -module.exports = setToPairs; - - -/***/ }), +/* 204 */, /* 205 */ /***/ (function(module, exports, __webpack_require__) { @@ -3595,10 +3537,92 @@ module.exports = stubArray; /* 291 */, /* 292 */, /* 293 */, -/* 294 */, +/* 294 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseIsEqual = __webpack_require__(799), + get = __webpack_require__(67), + hasIn = __webpack_require__(837), + isKey = __webpack_require__(71), + isStrictComparable = __webpack_require__(801), + matchesStrictComparable = __webpack_require__(803), + toKey = __webpack_require__(111); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); + }; +} + +module.exports = baseMatchesProperty; + + +/***/ }), /* 295 */, /* 296 */, -/* 297 */, +/* 297 */ +/***/ (function(module, exports, __webpack_require__) { + +var castPath = __webpack_require__(69), + isArguments = __webpack_require__(208), + isArray = __webpack_require__(70), + isIndex = __webpack_require__(117), + isLength = __webpack_require__(214), + toKey = __webpack_require__(111); + +/** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ +function hasPath(object, path, hasFunc) { + path = castPath(path, object); + + var index = -1, + length = path.length, + result = false; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result || ++index != length) { + return result; + } + length = object == null ? 0 : object.length; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); +} + +module.exports = hasPath; + + +/***/ }), /* 298 */ /***/ (function(module, exports) { @@ -4102,7 +4126,45 @@ module.exports = baseCreate; /***/ }), -/* 404 */, +/* 404 */ +/***/ (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; + + +/***/ }), /* 405 */, /* 406 */ /***/ (function(module, exports, __webpack_require__) { @@ -12375,7 +12437,7 @@ if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef /* 452 */ /***/ (function(module, exports) { -var core = module.exports = { version: '2.5.0' }; +var core = module.exports = { version: '2.5.1' }; if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef @@ -14241,7 +14303,6 @@ var uid = __webpack_require__(478); var wks = __webpack_require__(482); var wksExt = __webpack_require__(498); var wksDefine = __webpack_require__(499); -var keyOf = __webpack_require__(500); var enumKeys = __webpack_require__(501); var isArray = __webpack_require__(504); var anObject = __webpack_require__(457); @@ -14405,9 +14466,9 @@ $export($export.S + $export.F * !USE_NATIVE, 'Symbol', { : SymbolRegistry[key] = $Symbol(key); }, // 19.4.2.5 Symbol.keyFor(sym) - keyFor: function keyFor(key) { - if (isSymbol(key)) return keyOf(SymbolRegistry, key); - throw TypeError(key + ' is not a symbol!'); + keyFor: function keyFor(sym) { + if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!'); + for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key; }, useSetter: function () { setter = true; }, useSimple: function () { setter = false; } @@ -14545,22 +14606,7 @@ module.exports = function (name) { /***/ }), -/* 500 */ -/***/ (function(module, exports, __webpack_require__) { - -var getKeys = __webpack_require__(470); -var toIObject = __webpack_require__(444); -module.exports = function (object, el) { - var O = toIObject(object); - var keys = getKeys(O); - var length = keys.length; - var index = 0; - var key; - while (length > index) if (O[key = keys[index++]] === el) return key; -}; - - -/***/ }), +/* 500 */, /* 501 */ /***/ (function(module, exports, __webpack_require__) { @@ -27276,9 +27322,104 @@ function mergePair(dest, src) { /* 703 */, /* 704 */, /* 705 */, -/* 706 */, -/* 707 */, -/* 708 */, +/* 706 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseFlatten = __webpack_require__(707); + +/** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ +function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; +} + +module.exports = flatten; + + +/***/ }), +/* 707 */ +/***/ (function(module, exports, __webpack_require__) { + +var arrayPush = __webpack_require__(287), + isFlattenable = __webpack_require__(708); + +/** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ +function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; +} + +module.exports = baseFlatten; + + +/***/ }), +/* 708 */ +/***/ (function(module, exports, __webpack_require__) { + +var Symbol = __webpack_require__(7), + isArguments = __webpack_require__(208), + isArray = __webpack_require__(70); + +/** Built-in value references. */ +var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; + +/** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ +function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); +} + +module.exports = isFlattenable; + + +/***/ }), /* 709 */, /* 710 */, /* 711 */, @@ -27421,7 +27562,7 @@ module.exports = function(module) { /* 795 */ /***/ (function(module, exports, __webpack_require__) { -var createToPairs = __webpack_require__(196), +var createToPairs = __webpack_require__(812), keys = __webpack_require__(205); /** @@ -27480,11 +27621,177 @@ module.exports = baseToPairs; /***/ }), /* 797 */, /* 798 */, -/* 799 */, -/* 800 */, -/* 801 */, +/* 799 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseIsEqualDeep = __webpack_require__(832), + isObjectLike = __webpack_require__(14); + +/** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ +function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); +} + +module.exports = baseIsEqual; + + +/***/ }), +/* 800 */ +/***/ (function(module, exports, __webpack_require__) { + +var SetCache = __webpack_require__(276), + arraySome = __webpack_require__(833), + cacheHas = __webpack_require__(280); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ +function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(array); + if (stacked && stack.get(other)) { + return stacked == other; + } + var index = -1, + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!cacheHas(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; +} + +module.exports = equalArrays; + + +/***/ }), +/* 801 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(84); + +/** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ +function isStrictComparable(value) { + return value === value && !isObject(value); +} + +module.exports = isStrictComparable; + + +/***/ }), /* 802 */, -/* 803 */, +/* 803 */ +/***/ (function(module, exports) { + +/** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; +} + +module.exports = matchesStrictComparable; + + +/***/ }), /* 804 */, /* 805 */, /* 806 */, @@ -27493,9 +27800,103 @@ module.exports = baseToPairs; /* 809 */, /* 810 */, /* 811 */, -/* 812 */, -/* 813 */, -/* 814 */, +/* 812 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseToPairs = __webpack_require__(796), + getTag = __webpack_require__(198), + mapToArray = __webpack_require__(203), + setToPairs = __webpack_require__(813); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]', + setTag = '[object Set]'; + +/** + * Creates a `_.toPairs` or `_.toPairsIn` function. + * + * @private + * @param {Function} keysFunc The function to get the keys of a given object. + * @returns {Function} Returns the new pairs function. + */ +function createToPairs(keysFunc) { + return function(object) { + var tag = getTag(object); + if (tag == mapTag) { + return mapToArray(object); + } + if (tag == setTag) { + return setToPairs(object); + } + return baseToPairs(object, keysFunc(object)); + }; +} + +module.exports = createToPairs; + + +/***/ }), +/* 813 */ +/***/ (function(module, exports) { + +/** + * Converts `set` to its value-value pairs. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the value-value pairs. + */ +function setToPairs(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = [value, value]; + }); + return result; +} + +module.exports = setToPairs; + + +/***/ }), +/* 814 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseMatches = __webpack_require__(826), + baseMatchesProperty = __webpack_require__(294), + identity = __webpack_require__(298), + isArray = __webpack_require__(70), + property = __webpack_require__(839); + +/** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ +function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); +} + +module.exports = baseIteratee; + + +/***/ }), /* 815 */, /* 816 */, /* 817 */, @@ -27507,26 +27908,738 @@ module.exports = baseToPairs; /* 823 */, /* 824 */, /* 825 */, -/* 826 */, +/* 826 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseIsMatch = __webpack_require__(831), + getMatchData = __webpack_require__(836), + matchesStrictComparable = __webpack_require__(803); + +/** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ +function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; +} + +module.exports = baseMatches; + + +/***/ }), /* 827 */, /* 828 */, /* 829 */, /* 830 */, -/* 831 */, -/* 832 */, -/* 833 */, -/* 834 */, -/* 835 */, -/* 836 */, -/* 837 */, -/* 838 */, -/* 839 */, -/* 840 */, -/* 841 */, -/* 842 */, -/* 843 */, -/* 844 */, -/* 845 */, +/* 831 */ +/***/ (function(module, exports, __webpack_require__) { + +var Stack = __webpack_require__(267), + baseIsEqual = __webpack_require__(799); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ +function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) + : result + )) { + return false; + } + } + } + return true; +} + +module.exports = baseIsMatch; + + +/***/ }), +/* 832 */ +/***/ (function(module, exports, __webpack_require__) { + +var Stack = __webpack_require__(267), + equalArrays = __webpack_require__(800), + equalByTag = __webpack_require__(834), + equalObjects = __webpack_require__(835), + getTag = __webpack_require__(198), + isArray = __webpack_require__(70), + isBuffer = __webpack_require__(210), + isTypedArray = __webpack_require__(212); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + objectTag = '[object Object]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); +} + +module.exports = baseIsEqualDeep; + + +/***/ }), +/* 833 */ +/***/ (function(module, exports) { + +/** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function arraySome(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; +} + +module.exports = arraySome; + + +/***/ }), +/* 834 */ +/***/ (function(module, exports, __webpack_require__) { + +var Symbol = __webpack_require__(7), + Uint8Array = __webpack_require__(282), + eq = __webpack_require__(97), + equalArrays = __webpack_require__(800), + mapToArray = __webpack_require__(203), + setToArray = __webpack_require__(283); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** `Object#toString` result references. */ +var boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + mapTag = '[object Map]', + numberTag = '[object Number]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]'; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; +} + +module.exports = equalByTag; + + +/***/ }), +/* 835 */ +/***/ (function(module, exports, __webpack_require__) { + +var getAllKeys = __webpack_require__(285); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked && stack.get(other)) { + return stacked == other; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; +} + +module.exports = equalObjects; + + +/***/ }), +/* 836 */ +/***/ (function(module, exports, __webpack_require__) { + +var isStrictComparable = __webpack_require__(801), + keys = __webpack_require__(205); + +/** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ +function getMatchData(object) { + var result = keys(object), + length = result.length; + + while (length--) { + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; + } + return result; +} + +module.exports = getMatchData; + + +/***/ }), +/* 837 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseHasIn = __webpack_require__(838), + hasPath = __webpack_require__(297); + +/** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ +function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); +} + +module.exports = hasIn; + + +/***/ }), +/* 838 */ +/***/ (function(module, exports) { + +/** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ +function baseHasIn(object, key) { + return object != null && key in Object(object); +} + +module.exports = baseHasIn; + + +/***/ }), +/* 839 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseProperty = __webpack_require__(840), + basePropertyDeep = __webpack_require__(841), + isKey = __webpack_require__(71), + toKey = __webpack_require__(111); + +/** + * Creates a function that returns the value at `path` of a given object. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + * @example + * + * var objects = [ + * { 'a': { 'b': 2 } }, + * { 'a': { 'b': 1 } } + * ]; + * + * _.map(objects, _.property('a.b')); + * // => [2, 1] + * + * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); + * // => [1, 2] + */ +function property(path) { + return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); +} + +module.exports = property; + + +/***/ }), +/* 840 */ +/***/ (function(module, exports) { + +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +module.exports = baseProperty; + + +/***/ }), +/* 841 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseGet = __webpack_require__(68); + +/** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; +} + +module.exports = basePropertyDeep; + + +/***/ }), +/* 842 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getNextStep = getNextStep; + +var _debuggerHtml = __webpack_require__(843); + +var _types = __webpack_require__(844); + +var _closest = __webpack_require__(1055); + +var _contains = __webpack_require__(1127); + +var _helpers = __webpack_require__(1052); + +function getNextStep(source, stepType, pausedPosition) { + var closestPath = (0, _closest.getClosestPath)(source, pausedPosition); + if (!closestPath) { + return { nextStepType: stepType }; + } + if ((0, _helpers.isAwaitExpression)(closestPath, pausedPosition)) { + var nextHiddenBreakpointLocation = getLocationAfterAwaitExpression(closestPath, pausedPosition); + return { nextStepType: "resume", nextHiddenBreakpointLocation }; + } + return { nextStepType: stepType }; +} + +function getLocationAfterAwaitExpression(path, position) { + var children = getFunctionBodyChildren(path); + if (!children) { + return; + } + for (var i = 0; i !== children.length; i++) { + var child = children[i]; + if ((0, _contains.containsPosition)(child.loc, position)) { + var nextChild = children[++i]; + var nextLocation = nextChild.loc.start; + nextLocation.sourceId = position.sourceId; + return nextLocation; + } + } +} + +function getFunctionBodyChildren(path) { + var blockScope = path.scope.block; + if (!blockScope) { + return; + } + var children = blockScope.body.body; + return children; +} + +/***/ }), +/* 843 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/***/ }), +/* 844 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/***/ }), +/* 845 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = getEmptyLines; + +var _uniq = __webpack_require__(561); + +var _uniq2 = _interopRequireDefault(_uniq); + +var _difference = __webpack_require__(1129); + +var _difference2 = _interopRequireDefault(_difference); + +var _ast = __webpack_require__(1051); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var commentTokens = ["CommentBlock", "CommentLine"]; + +function fillRange(start, end) { + return Array(end - start + 1).fill().map((item, index) => start + index); +} + +// Populates a pre-filled array of every line number, +// then removes lines which were found to be executable +function getLines(ast) { + return fillRange(0, ast.tokens[ast.tokens.length - 1].loc.end.line); +} + +// The following sequence stores lines which have executable code +// (contents other than comments or EOF, regardless of line position) +function getExecutableLines(ast) { + var lines = ast.tokens.filter(token => !commentTokens.includes(token.type) && (!token.type || token.type.label && token.type.label != "eof")).map(token => token.loc.start.line - 1); + + return (0, _uniq2.default)(lines); +} + +function getEmptyLines(sourceToJS) { + if (!sourceToJS) { + return null; + } + + var ast = (0, _ast.getAst)(sourceToJS); + if (!ast || !ast.comments) { + return []; + } + + var executableLines = getExecutableLines(ast); + var lines = getLines(ast); + return (0, _difference2.default)(lines, executableLines); +} + +/***/ }), /* 846 */, /* 847 */, /* 848 */, @@ -27678,12 +28791,17 @@ function workerHandler(publicInterface) { try { const response = publicInterface[method].apply(undefined, args); if (response instanceof Promise) { - response.then(val => self.postMessage({ id, response: val }), err => self.postMessage({ id, error: err })); + 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) { - self.postMessage({ id, error }); + // Error can't be sent via postMessage, so be sure to convert to + // string. + self.postMessage({ id, error: error.toString() }); } }; } @@ -27823,6 +28941,12 @@ var _getOutOfScopeLocations = __webpack_require__(1072); var _getOutOfScopeLocations2 = _interopRequireDefault(_getOutOfScopeLocations); +var _steps = __webpack_require__(842); + +var _getEmptyLines = __webpack_require__(845); + +var _getEmptyLines2 = _interopRequireDefault(_getEmptyLines); + var _devtoolsUtils = __webpack_require__(900); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -27835,7 +28959,9 @@ self.onmessage = workerHandler({ getOutOfScopeLocations: _getOutOfScopeLocations2.default, getSymbols: _getSymbols2.default, clearSymbols: _getSymbols.clearSymbols, - getVariablesInScope: _scopes.getVariablesInScope + getVariablesInScope: _scopes.getVariablesInScope, + getNextStep: _steps.getNextStep, + getEmptyLines: _getEmptyLines2.default }); /***/ }), @@ -28718,11 +29844,9 @@ Object.defineProperty(exports, "__esModule", { }); exports.isLexicalScope = isLexicalScope; exports.isFunction = isFunction; +exports.isAwaitExpression = isAwaitExpression; exports.isVariable = isVariable; exports.getMemberExpression = getMemberExpression; -exports.containsPosition = containsPosition; -exports.containsLocation = containsLocation; -exports.nodeContainsPosition = nodeContainsPosition; var _babelTypes = __webpack_require__(493); @@ -28738,6 +29862,10 @@ function isFunction(path) { return t.isFunction(path) || t.isArrowFunctionExpression(path) || t.isObjectMethod(path) || t.isClassMethod(path); } +function isAwaitExpression(path) { + return t.isAwaitExpression(path) || t.isAwaitExpression(path.container.init) || t.isAwaitExpression(path.parentPath); +} + function isVariable(path) { return t.isVariableDeclaration(path) || isFunction(path) && path.node.params.length || t.isObjectProperty(path) && !isFunction(path.node.value); } @@ -28764,21 +29892,6 @@ function getMemberExpression(root) { return expr.join("."); } -function containsPosition(a, b) { - var startsBefore = a.start.line < b.line || a.start.line === b.line && a.start.column <= b.column; - var endsAfter = a.end.line > b.line || a.end.line === b.line && a.end.column >= b.column; - - return startsBefore && endsAfter; -} - -function containsLocation(a, b) { - return containsPosition(a, b.start) && containsPosition(a, b.end); -} - -function nodeContainsPosition(node, position) { - return containsPosition(node.loc, position); -} - /***/ }), /* 1053 */ /***/ (function(module, exports, __webpack_require__) { @@ -28842,6 +29955,8 @@ var _ast = __webpack_require__(1051); var _helpers = __webpack_require__(1052); +var _contains = __webpack_require__(1127); + 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) { @@ -28858,7 +29973,7 @@ function getClosestMemberExpression(source, token, location) { enter(path) { var node = path.node; - if (!(0, _helpers.nodeContainsPosition)(node, location)) { + if (!(0, _contains.nodeContainsPosition)(node, location)) { return path.skip(); } @@ -28896,7 +30011,7 @@ function getClosestScope(source, location) { (0, _ast.traverseAst)(source, { enter(path) { - if (!(0, _helpers.nodeContainsPosition)(path.node, location)) { + if (!(0, _contains.nodeContainsPosition)(path.node, location)) { return path.skip(); } @@ -28918,7 +30033,7 @@ function getClosestPath(source, location) { (0, _ast.traverseAst)(source, { enter(path) { - if (!(0, _helpers.nodeContainsPosition)(path.node, location)) { + if (!(0, _contains.nodeContainsPosition)(path.node, location)) { return path.skip(); } closestPath = path; @@ -29029,11 +30144,11 @@ 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 _get = __webpack_require__(67); +var _get = __webpack_require__(1073); var _get2 = _interopRequireDefault(_get); -var _helpers = __webpack_require__(1052); +var _contains = __webpack_require__(1127); var _getSymbols2 = __webpack_require__(1050); @@ -29078,7 +30193,7 @@ function removeOverlaps(locations, location) { locations = [locations]; } - var contains = locations.filter(a => (0, _helpers.containsLocation)(a, location)).length > 0; + var contains = locations.filter(a => (0, _contains.containsLocation)(a, location)).length > 0; if (!contains) { locations.push(location); @@ -29111,11 +30226,2744 @@ function getOutOfScopeLocations(source, position) { var commentLocations = comments.map(c => c.location); - return functions.map(getLocation).concat(commentLocations).filter(loc => !(0, _helpers.containsPosition)(loc, position)).reduce(removeOverlaps, []).sort(sortByStart); + return functions.map(getLocation).concat(commentLocations).filter(loc => !(0, _contains.containsPosition)(loc, position)).reduce(removeOverlaps, []).sort(sortByStart); } exports.default = getOutOfScopeLocations; +/***/ }), +/* 1073 */ +/***/ (function(module, exports, __webpack_require__) { + +var convert = __webpack_require__(1074), + func = convert('get', __webpack_require__(67)); + +func.placeholder = __webpack_require__(1077); +module.exports = func; + + +/***/ }), +/* 1074 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseConvert = __webpack_require__(1075), + util = __webpack_require__(1078); + +/** + * Converts `func` of `name` to an immutable auto-curried iteratee-first data-last + * version with conversion `options` applied. If `name` is an object its methods + * will be converted. + * + * @param {string} name The name of the function to wrap. + * @param {Function} [func] The function to wrap. + * @param {Object} [options] The options object. See `baseConvert` for more details. + * @returns {Function|Object} Returns the converted function or object. + */ +function convert(name, func, options) { + return baseConvert(util, name, func, options); +} + +module.exports = convert; + + +/***/ }), +/* 1075 */ +/***/ (function(module, exports, __webpack_require__) { + +var mapping = __webpack_require__(1076), + fallbackHolder = __webpack_require__(1077); + +/** Built-in value reference. */ +var push = Array.prototype.push; + +/** + * Creates a function, with an arity of `n`, that invokes `func` with the + * arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} n The arity of the new function. + * @returns {Function} Returns the new function. + */ +function baseArity(func, n) { + return n == 2 + ? function(a, b) { return func.apply(undefined, arguments); } + : function(a) { return func.apply(undefined, arguments); }; +} + +/** + * Creates a function that invokes `func`, with up to `n` arguments, ignoring + * any additional arguments. + * + * @private + * @param {Function} func The function to cap arguments for. + * @param {number} n The arity cap. + * @returns {Function} Returns the new function. + */ +function baseAry(func, n) { + return n == 2 + ? function(a, b) { return func(a, b); } + : function(a) { return func(a); }; +} + +/** + * Creates a clone of `array`. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the cloned array. + */ +function cloneArray(array) { + var length = array ? array.length : 0, + result = Array(length); + + while (length--) { + result[length] = array[length]; + } + return result; +} + +/** + * Creates a function that clones a given object using the assignment `func`. + * + * @private + * @param {Function} func The assignment function. + * @returns {Function} Returns the new cloner function. + */ +function createCloner(func) { + return function(object) { + return func({}, object); + }; +} + +/** + * A specialized version of `_.spread` which flattens the spread array into + * the arguments of the invoked `func`. + * + * @private + * @param {Function} func The function to spread arguments over. + * @param {number} start The start position of the spread. + * @returns {Function} Returns the new function. + */ +function flatSpread(func, start) { + return function() { + var length = arguments.length, + lastIndex = length - 1, + args = Array(length); + + while (length--) { + args[length] = arguments[length]; + } + var array = args[start], + otherArgs = args.slice(0, start); + + if (array) { + push.apply(otherArgs, array); + } + if (start != lastIndex) { + push.apply(otherArgs, args.slice(start + 1)); + } + return func.apply(this, otherArgs); + }; +} + +/** + * Creates a function that wraps `func` and uses `cloner` to clone the first + * argument it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} cloner The function to clone arguments. + * @returns {Function} Returns the new immutable function. + */ +function wrapImmutable(func, cloner) { + return function() { + var length = arguments.length; + if (!length) { + return; + } + var args = Array(length); + while (length--) { + args[length] = arguments[length]; + } + var result = args[0] = cloner.apply(undefined, args); + func.apply(undefined, args); + return result; + }; +} + +/** + * The base implementation of `convert` which accepts a `util` object of methods + * required to perform conversions. + * + * @param {Object} util The util object. + * @param {string} name The name of the function to convert. + * @param {Function} func The function to convert. + * @param {Object} [options] The options object. + * @param {boolean} [options.cap=true] Specify capping iteratee arguments. + * @param {boolean} [options.curry=true] Specify currying. + * @param {boolean} [options.fixed=true] Specify fixed arity. + * @param {boolean} [options.immutable=true] Specify immutable operations. + * @param {boolean} [options.rearg=true] Specify rearranging arguments. + * @returns {Function|Object} Returns the converted function or object. + */ +function baseConvert(util, name, func, options) { + var setPlaceholder, + isLib = typeof name == 'function', + isObj = name === Object(name); + + if (isObj) { + options = func; + func = name; + name = undefined; + } + if (func == null) { + throw new TypeError; + } + options || (options = {}); + + var config = { + 'cap': 'cap' in options ? options.cap : true, + 'curry': 'curry' in options ? options.curry : true, + 'fixed': 'fixed' in options ? options.fixed : true, + 'immutable': 'immutable' in options ? options.immutable : true, + 'rearg': 'rearg' in options ? options.rearg : true + }; + + var forceCurry = ('curry' in options) && options.curry, + forceFixed = ('fixed' in options) && options.fixed, + forceRearg = ('rearg' in options) && options.rearg, + placeholder = isLib ? func : fallbackHolder, + pristine = isLib ? func.runInContext() : undefined; + + var helpers = isLib ? func : { + 'ary': util.ary, + 'assign': util.assign, + 'clone': util.clone, + 'curry': util.curry, + 'forEach': util.forEach, + 'isArray': util.isArray, + 'isFunction': util.isFunction, + 'iteratee': util.iteratee, + 'keys': util.keys, + 'rearg': util.rearg, + 'toInteger': util.toInteger, + 'toPath': util.toPath + }; + + var ary = helpers.ary, + assign = helpers.assign, + clone = helpers.clone, + curry = helpers.curry, + each = helpers.forEach, + isArray = helpers.isArray, + isFunction = helpers.isFunction, + keys = helpers.keys, + rearg = helpers.rearg, + toInteger = helpers.toInteger, + toPath = helpers.toPath; + + var aryMethodKeys = keys(mapping.aryMethod); + + var wrappers = { + 'castArray': function(castArray) { + return function() { + var value = arguments[0]; + return isArray(value) + ? castArray(cloneArray(value)) + : castArray.apply(undefined, arguments); + }; + }, + 'iteratee': function(iteratee) { + return function() { + var func = arguments[0], + arity = arguments[1], + result = iteratee(func, arity), + length = result.length; + + if (config.cap && typeof arity == 'number') { + arity = arity > 2 ? (arity - 2) : 1; + return (length && length <= arity) ? result : baseAry(result, arity); + } + return result; + }; + }, + 'mixin': function(mixin) { + return function(source) { + var func = this; + if (!isFunction(func)) { + return mixin(func, Object(source)); + } + var pairs = []; + each(keys(source), function(key) { + if (isFunction(source[key])) { + pairs.push([key, func.prototype[key]]); + } + }); + + mixin(func, Object(source)); + + each(pairs, function(pair) { + var value = pair[1]; + if (isFunction(value)) { + func.prototype[pair[0]] = value; + } else { + delete func.prototype[pair[0]]; + } + }); + return func; + }; + }, + 'nthArg': function(nthArg) { + return function(n) { + var arity = n < 0 ? 1 : (toInteger(n) + 1); + return curry(nthArg(n), arity); + }; + }, + 'rearg': function(rearg) { + return function(func, indexes) { + var arity = indexes ? indexes.length : 0; + return curry(rearg(func, indexes), arity); + }; + }, + 'runInContext': function(runInContext) { + return function(context) { + return baseConvert(util, runInContext(context), options); + }; + } + }; + + /*--------------------------------------------------------------------------*/ + + /** + * Casts `func` to a function with an arity capped iteratee if needed. + * + * @private + * @param {string} name The name of the function to inspect. + * @param {Function} func The function to inspect. + * @returns {Function} Returns the cast function. + */ + function castCap(name, func) { + if (config.cap) { + var indexes = mapping.iterateeRearg[name]; + if (indexes) { + return iterateeRearg(func, indexes); + } + var n = !isLib && mapping.iterateeAry[name]; + if (n) { + return iterateeAry(func, n); + } + } + return func; + } + + /** + * Casts `func` to a curried function if needed. + * + * @private + * @param {string} name The name of the function to inspect. + * @param {Function} func The function to inspect. + * @param {number} n The arity of `func`. + * @returns {Function} Returns the cast function. + */ + function castCurry(name, func, n) { + return (forceCurry || (config.curry && n > 1)) + ? curry(func, n) + : func; + } + + /** + * Casts `func` to a fixed arity function if needed. + * + * @private + * @param {string} name The name of the function to inspect. + * @param {Function} func The function to inspect. + * @param {number} n The arity cap. + * @returns {Function} Returns the cast function. + */ + function castFixed(name, func, n) { + if (config.fixed && (forceFixed || !mapping.skipFixed[name])) { + var data = mapping.methodSpread[name], + start = data && data.start; + + return start === undefined ? ary(func, n) : flatSpread(func, start); + } + return func; + } + + /** + * Casts `func` to an rearged function if needed. + * + * @private + * @param {string} name The name of the function to inspect. + * @param {Function} func The function to inspect. + * @param {number} n The arity of `func`. + * @returns {Function} Returns the cast function. + */ + function castRearg(name, func, n) { + return (config.rearg && n > 1 && (forceRearg || !mapping.skipRearg[name])) + ? rearg(func, mapping.methodRearg[name] || mapping.aryRearg[n]) + : func; + } + + /** + * Creates a clone of `object` by `path`. + * + * @private + * @param {Object} object The object to clone. + * @param {Array|string} path The path to clone by. + * @returns {Object} Returns the cloned object. + */ + function cloneByPath(object, path) { + path = toPath(path); + + var index = -1, + length = path.length, + lastIndex = length - 1, + result = clone(Object(object)), + nested = result; + + while (nested != null && ++index < length) { + var key = path[index], + value = nested[key]; + + if (value != null) { + nested[path[index]] = clone(index == lastIndex ? value : Object(value)); + } + nested = nested[key]; + } + return result; + } + + /** + * Converts `lodash` to an immutable auto-curried iteratee-first data-last + * version with conversion `options` applied. + * + * @param {Object} [options] The options object. See `baseConvert` for more details. + * @returns {Function} Returns the converted `lodash`. + */ + function convertLib(options) { + return _.runInContext.convert(options)(undefined); + } + + /** + * Create a converter function for `func` of `name`. + * + * @param {string} name The name of the function to convert. + * @param {Function} func The function to convert. + * @returns {Function} Returns the new converter function. + */ + function createConverter(name, func) { + var realName = mapping.aliasToReal[name] || name, + methodName = mapping.remap[realName] || realName, + oldOptions = options; + + return function(options) { + var newUtil = isLib ? pristine : helpers, + newFunc = isLib ? pristine[methodName] : func, + newOptions = assign(assign({}, oldOptions), options); + + return baseConvert(newUtil, realName, newFunc, newOptions); + }; + } + + /** + * Creates a function that wraps `func` to invoke its iteratee, with up to `n` + * arguments, ignoring any additional arguments. + * + * @private + * @param {Function} func The function to cap iteratee arguments for. + * @param {number} n The arity cap. + * @returns {Function} Returns the new function. + */ + function iterateeAry(func, n) { + return overArg(func, function(func) { + return typeof func == 'function' ? baseAry(func, n) : func; + }); + } + + /** + * Creates a function that wraps `func` to invoke its iteratee with arguments + * arranged according to the specified `indexes` where the argument value at + * the first index is provided as the first argument, the argument value at + * the second index is provided as the second argument, and so on. + * + * @private + * @param {Function} func The function to rearrange iteratee arguments for. + * @param {number[]} indexes The arranged argument indexes. + * @returns {Function} Returns the new function. + */ + function iterateeRearg(func, indexes) { + return overArg(func, function(func) { + var n = indexes.length; + return baseArity(rearg(baseAry(func, n), indexes), n); + }); + } + + /** + * Creates a function that invokes `func` with its first 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() { + var length = arguments.length; + if (!length) { + return func(); + } + var args = Array(length); + while (length--) { + args[length] = arguments[length]; + } + var index = config.rearg ? 0 : (length - 1); + args[index] = transform(args[index]); + return func.apply(undefined, args); + }; + } + + /** + * Creates a function that wraps `func` and applys the conversions + * rules by `name`. + * + * @private + * @param {string} name The name of the function to wrap. + * @param {Function} func The function to wrap. + * @returns {Function} Returns the converted function. + */ + function wrap(name, func) { + var result, + realName = mapping.aliasToReal[name] || name, + wrapped = func, + wrapper = wrappers[realName]; + + if (wrapper) { + wrapped = wrapper(func); + } + else if (config.immutable) { + if (mapping.mutate.array[realName]) { + wrapped = wrapImmutable(func, cloneArray); + } + else if (mapping.mutate.object[realName]) { + wrapped = wrapImmutable(func, createCloner(func)); + } + else if (mapping.mutate.set[realName]) { + wrapped = wrapImmutable(func, cloneByPath); + } + } + each(aryMethodKeys, function(aryKey) { + each(mapping.aryMethod[aryKey], function(otherName) { + if (realName == otherName) { + var data = mapping.methodSpread[realName], + afterRearg = data && data.afterRearg; + + result = afterRearg + ? castFixed(realName, castRearg(realName, wrapped, aryKey), aryKey) + : castRearg(realName, castFixed(realName, wrapped, aryKey), aryKey); + + result = castCap(realName, result); + result = castCurry(realName, result, aryKey); + return false; + } + }); + return !result; + }); + + result || (result = wrapped); + if (result == func) { + result = forceCurry ? curry(result, 1) : function() { + return func.apply(this, arguments); + }; + } + result.convert = createConverter(realName, func); + if (mapping.placeholder[realName]) { + setPlaceholder = true; + result.placeholder = func.placeholder = placeholder; + } + return result; + } + + /*--------------------------------------------------------------------------*/ + + if (!isObj) { + return wrap(name, func); + } + var _ = func; + + // Convert methods by ary cap. + var pairs = []; + each(aryMethodKeys, function(aryKey) { + each(mapping.aryMethod[aryKey], function(key) { + var func = _[mapping.remap[key] || key]; + if (func) { + pairs.push([key, wrap(key, func)]); + } + }); + }); + + // Convert remaining methods. + each(keys(_), function(key) { + var func = _[key]; + if (typeof func == 'function') { + var length = pairs.length; + while (length--) { + if (pairs[length][0] == key) { + return; + } + } + func.convert = createConverter(key, func); + pairs.push([key, func]); + } + }); + + // Assign to `_` leaving `_.prototype` unchanged to allow chaining. + each(pairs, function(pair) { + _[pair[0]] = pair[1]; + }); + + _.convert = convertLib; + if (setPlaceholder) { + _.placeholder = placeholder; + } + // Assign aliases. + each(keys(_), function(key) { + each(mapping.realToAlias[key] || [], function(alias) { + _[alias] = _[key]; + }); + }); + + return _; +} + +module.exports = baseConvert; + + +/***/ }), +/* 1076 */ +/***/ (function(module, exports) { + +/** Used to map aliases to their real names. */ +exports.aliasToReal = { + + // Lodash aliases. + 'each': 'forEach', + 'eachRight': 'forEachRight', + 'entries': 'toPairs', + 'entriesIn': 'toPairsIn', + 'extend': 'assignIn', + 'extendAll': 'assignInAll', + 'extendAllWith': 'assignInAllWith', + 'extendWith': 'assignInWith', + 'first': 'head', + + // Methods that are curried variants of others. + 'conforms': 'conformsTo', + 'matches': 'isMatch', + 'property': 'get', + + // Ramda aliases. + '__': 'placeholder', + 'F': 'stubFalse', + 'T': 'stubTrue', + 'all': 'every', + 'allPass': 'overEvery', + 'always': 'constant', + 'any': 'some', + 'anyPass': 'overSome', + 'apply': 'spread', + 'assoc': 'set', + 'assocPath': 'set', + 'complement': 'negate', + 'compose': 'flowRight', + 'contains': 'includes', + 'dissoc': 'unset', + 'dissocPath': 'unset', + 'dropLast': 'dropRight', + 'dropLastWhile': 'dropRightWhile', + 'equals': 'isEqual', + 'identical': 'eq', + 'indexBy': 'keyBy', + 'init': 'initial', + 'invertObj': 'invert', + 'juxt': 'over', + 'omitAll': 'omit', + 'nAry': 'ary', + 'path': 'get', + 'pathEq': 'matchesProperty', + 'pathOr': 'getOr', + 'paths': 'at', + 'pickAll': 'pick', + 'pipe': 'flow', + 'pluck': 'map', + 'prop': 'get', + 'propEq': 'matchesProperty', + 'propOr': 'getOr', + 'props': 'at', + 'symmetricDifference': 'xor', + 'symmetricDifferenceBy': 'xorBy', + 'symmetricDifferenceWith': 'xorWith', + 'takeLast': 'takeRight', + 'takeLastWhile': 'takeRightWhile', + 'unapply': 'rest', + 'unnest': 'flatten', + 'useWith': 'overArgs', + 'where': 'conformsTo', + 'whereEq': 'isMatch', + 'zipObj': 'zipObject' +}; + +/** Used to map ary to method names. */ +exports.aryMethod = { + '1': [ + 'assignAll', 'assignInAll', 'attempt', 'castArray', 'ceil', 'create', + 'curry', 'curryRight', 'defaultsAll', 'defaultsDeepAll', 'floor', 'flow', + 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method', 'mergeAll', + 'methodOf', 'mixin', 'nthArg', 'over', 'overEvery', 'overSome','rest', 'reverse', + 'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart', + 'uniqueId', 'words', 'zipAll' + ], + '2': [ + 'add', 'after', 'ary', 'assign', 'assignAllWith', 'assignIn', 'assignInAllWith', + 'at', 'before', 'bind', 'bindAll', 'bindKey', 'chunk', 'cloneDeepWith', + 'cloneWith', 'concat', 'conformsTo', 'countBy', 'curryN', 'curryRightN', + 'debounce', 'defaults', 'defaultsDeep', 'defaultTo', 'delay', 'difference', + 'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq', + 'every', 'filter', 'find', 'findIndex', 'findKey', 'findLast', 'findLastIndex', + 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth', 'forEach', + 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'get', + 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'intersection', + 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch', 'join', 'keyBy', + 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'matchesProperty', + 'maxBy', 'meanBy', 'merge', 'mergeAllWith', 'minBy', 'multiply', 'nth', 'omit', + 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', 'partial', + 'partialRight', 'partition', 'pick', 'pickBy', 'propertyOf', 'pull', 'pullAll', + 'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove', + 'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex', + 'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy', + 'split', 'spreadFrom', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight', + 'takeRightWhile', 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars', + 'trimCharsEnd', 'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith', + 'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject', + 'zipObjectDeep' + ], + '3': [ + 'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith', + 'findFrom', 'findIndexFrom', 'findLastFrom', 'findLastIndexFrom', 'getOr', + 'includesFrom', 'indexOfFrom', 'inRange', 'intersectionBy', 'intersectionWith', + 'invokeArgs', 'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth', + 'lastIndexOfFrom', 'mergeWith', 'orderBy', 'padChars', 'padCharsEnd', + 'padCharsStart', 'pullAllBy', 'pullAllWith', 'rangeStep', 'rangeStepRight', + 'reduce', 'reduceRight', 'replace', 'set', 'slice', 'sortedIndexBy', + 'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith', 'update', 'xorBy', + 'xorWith', 'zipWith' + ], + '4': [ + 'fill', 'setWith', 'updateWith' + ] +}; + +/** Used to map ary to rearg configs. */ +exports.aryRearg = { + '2': [1, 0], + '3': [2, 0, 1], + '4': [3, 2, 0, 1] +}; + +/** Used to map method names to their iteratee ary. */ +exports.iterateeAry = { + 'dropRightWhile': 1, + 'dropWhile': 1, + 'every': 1, + 'filter': 1, + 'find': 1, + 'findFrom': 1, + 'findIndex': 1, + 'findIndexFrom': 1, + 'findKey': 1, + 'findLast': 1, + 'findLastFrom': 1, + 'findLastIndex': 1, + 'findLastIndexFrom': 1, + 'findLastKey': 1, + 'flatMap': 1, + 'flatMapDeep': 1, + 'flatMapDepth': 1, + 'forEach': 1, + 'forEachRight': 1, + 'forIn': 1, + 'forInRight': 1, + 'forOwn': 1, + 'forOwnRight': 1, + 'map': 1, + 'mapKeys': 1, + 'mapValues': 1, + 'partition': 1, + 'reduce': 2, + 'reduceRight': 2, + 'reject': 1, + 'remove': 1, + 'some': 1, + 'takeRightWhile': 1, + 'takeWhile': 1, + 'times': 1, + 'transform': 2 +}; + +/** Used to map method names to iteratee rearg configs. */ +exports.iterateeRearg = { + 'mapKeys': [1], + 'reduceRight': [1, 0] +}; + +/** Used to map method names to rearg configs. */ +exports.methodRearg = { + 'assignInAllWith': [1, 0], + 'assignInWith': [1, 2, 0], + 'assignAllWith': [1, 0], + 'assignWith': [1, 2, 0], + 'differenceBy': [1, 2, 0], + 'differenceWith': [1, 2, 0], + 'getOr': [2, 1, 0], + 'intersectionBy': [1, 2, 0], + 'intersectionWith': [1, 2, 0], + 'isEqualWith': [1, 2, 0], + 'isMatchWith': [2, 1, 0], + 'mergeAllWith': [1, 0], + 'mergeWith': [1, 2, 0], + 'padChars': [2, 1, 0], + 'padCharsEnd': [2, 1, 0], + 'padCharsStart': [2, 1, 0], + 'pullAllBy': [2, 1, 0], + 'pullAllWith': [2, 1, 0], + 'rangeStep': [1, 2, 0], + 'rangeStepRight': [1, 2, 0], + 'setWith': [3, 1, 2, 0], + 'sortedIndexBy': [2, 1, 0], + 'sortedLastIndexBy': [2, 1, 0], + 'unionBy': [1, 2, 0], + 'unionWith': [1, 2, 0], + 'updateWith': [3, 1, 2, 0], + 'xorBy': [1, 2, 0], + 'xorWith': [1, 2, 0], + 'zipWith': [1, 2, 0] +}; + +/** Used to map method names to spread configs. */ +exports.methodSpread = { + 'assignAll': { 'start': 0 }, + 'assignAllWith': { 'start': 0 }, + 'assignInAll': { 'start': 0 }, + 'assignInAllWith': { 'start': 0 }, + 'defaultsAll': { 'start': 0 }, + 'defaultsDeepAll': { 'start': 0 }, + 'invokeArgs': { 'start': 2 }, + 'invokeArgsMap': { 'start': 2 }, + 'mergeAll': { 'start': 0 }, + 'mergeAllWith': { 'start': 0 }, + 'partial': { 'start': 1 }, + 'partialRight': { 'start': 1 }, + 'without': { 'start': 1 }, + 'zipAll': { 'start': 0 } +}; + +/** Used to identify methods which mutate arrays or objects. */ +exports.mutate = { + 'array': { + 'fill': true, + 'pull': true, + 'pullAll': true, + 'pullAllBy': true, + 'pullAllWith': true, + 'pullAt': true, + 'remove': true, + 'reverse': true + }, + 'object': { + 'assign': true, + 'assignAll': true, + 'assignAllWith': true, + 'assignIn': true, + 'assignInAll': true, + 'assignInAllWith': true, + 'assignInWith': true, + 'assignWith': true, + 'defaults': true, + 'defaultsAll': true, + 'defaultsDeep': true, + 'defaultsDeepAll': true, + 'merge': true, + 'mergeAll': true, + 'mergeAllWith': true, + 'mergeWith': true, + }, + 'set': { + 'set': true, + 'setWith': true, + 'unset': true, + 'update': true, + 'updateWith': true + } +}; + +/** Used to track methods with placeholder support */ +exports.placeholder = { + 'bind': true, + 'bindKey': true, + 'curry': true, + 'curryRight': true, + 'partial': true, + 'partialRight': true +}; + +/** Used to map real names to their aliases. */ +exports.realToAlias = (function() { + var hasOwnProperty = Object.prototype.hasOwnProperty, + object = exports.aliasToReal, + result = {}; + + for (var key in object) { + var value = object[key]; + if (hasOwnProperty.call(result, value)) { + result[value].push(key); + } else { + result[value] = [key]; + } + } + return result; +}()); + +/** Used to map method names to other names. */ +exports.remap = { + 'assignAll': 'assign', + 'assignAllWith': 'assignWith', + 'assignInAll': 'assignIn', + 'assignInAllWith': 'assignInWith', + 'curryN': 'curry', + 'curryRightN': 'curryRight', + 'defaultsAll': 'defaults', + 'defaultsDeepAll': 'defaultsDeep', + 'findFrom': 'find', + 'findIndexFrom': 'findIndex', + 'findLastFrom': 'findLast', + 'findLastIndexFrom': 'findLastIndex', + 'getOr': 'get', + 'includesFrom': 'includes', + 'indexOfFrom': 'indexOf', + 'invokeArgs': 'invoke', + 'invokeArgsMap': 'invokeMap', + 'lastIndexOfFrom': 'lastIndexOf', + 'mergeAll': 'merge', + 'mergeAllWith': 'mergeWith', + 'padChars': 'pad', + 'padCharsEnd': 'padEnd', + 'padCharsStart': 'padStart', + 'propertyOf': 'get', + 'rangeStep': 'range', + 'rangeStepRight': 'rangeRight', + 'restFrom': 'rest', + 'spreadFrom': 'spread', + 'trimChars': 'trim', + 'trimCharsEnd': 'trimEnd', + 'trimCharsStart': 'trimStart', + 'zipAll': 'zip' +}; + +/** Used to track methods that skip fixing their arity. */ +exports.skipFixed = { + 'castArray': true, + 'flow': true, + 'flowRight': true, + 'iteratee': true, + 'mixin': true, + 'rearg': true, + 'runInContext': true +}; + +/** Used to track methods that skip rearranging arguments. */ +exports.skipRearg = { + 'add': true, + 'assign': true, + 'assignIn': true, + 'bind': true, + 'bindKey': true, + 'concat': true, + 'difference': true, + 'divide': true, + 'eq': true, + 'gt': true, + 'gte': true, + 'isEqual': true, + 'lt': true, + 'lte': true, + 'matchesProperty': true, + 'merge': true, + 'multiply': true, + 'overArgs': true, + 'partial': true, + 'partialRight': true, + 'propertyOf': true, + 'random': true, + 'range': true, + 'rangeRight': true, + 'subtract': true, + 'zip': true, + 'zipObject': true, + 'zipObjectDeep': true +}; + + +/***/ }), +/* 1077 */ +/***/ (function(module, exports) { + +/** + * The default argument placeholder value for methods. + * + * @type {Object} + */ +module.exports = {}; + + +/***/ }), +/* 1078 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { + 'ary': __webpack_require__(1079), + 'assign': __webpack_require__(545), + 'clone': __webpack_require__(542), + 'curry': __webpack_require__(1110), + 'forEach': __webpack_require__(544), + 'isArray': __webpack_require__(70), + 'isFunction': __webpack_require__(83), + 'iteratee': __webpack_require__(1111), + 'keys': __webpack_require__(217), + 'rearg': __webpack_require__(1112), + 'toInteger': __webpack_require__(302), + 'toPath': __webpack_require__(1114) +}; + + +/***/ }), +/* 1079 */ +/***/ (function(module, exports, __webpack_require__) { + +var createWrap = __webpack_require__(1080); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_ARY_FLAG = 128; + +/** + * Creates a function that invokes `func`, with up to `n` arguments, + * ignoring any additional arguments. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @param {number} [n=func.length] The arity cap. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new capped function. + * @example + * + * _.map(['6', '8', '10'], _.ary(parseInt, 1)); + * // => [6, 8, 10] + */ +function ary(func, n, guard) { + n = guard ? undefined : n; + n = (func && n == null) ? func.length : n; + return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); +} + +module.exports = ary; + + +/***/ }), +/* 1080 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseSetData = __webpack_require__(1081), + createBind = __webpack_require__(1083), + createCurry = __webpack_require__(1085), + createHybrid = __webpack_require__(1086), + createPartial = __webpack_require__(1108), + getData = __webpack_require__(1094), + mergeData = __webpack_require__(1109), + setData = __webpack_require__(1100), + setWrapToString = __webpack_require__(1101), + toInteger = __webpack_require__(302); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_FLAG = 8, + WRAP_CURRY_RIGHT_FLAG = 16, + WRAP_PARTIAL_FLAG = 32, + WRAP_PARTIAL_RIGHT_FLAG = 64; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * Creates a function that either curries or invokes `func` with optional + * `this` binding and partially applied arguments. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. + * 1 - `_.bind` + * 2 - `_.bindKey` + * 4 - `_.curry` or `_.curryRight` of a bound function + * 8 - `_.curry` + * 16 - `_.curryRight` + * 32 - `_.partial` + * 64 - `_.partialRight` + * 128 - `_.rearg` + * 256 - `_.ary` + * 512 - `_.flip` + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to be partially applied. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ +function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { + var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; + if (!isBindKey && typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + var length = partials ? partials.length : 0; + if (!length) { + bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); + partials = holders = undefined; + } + ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); + arity = arity === undefined ? arity : toInteger(arity); + length -= holders ? holders.length : 0; + + if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { + var partialsRight = partials, + holdersRight = holders; + + partials = holders = undefined; + } + var data = isBindKey ? undefined : getData(func); + + var newData = [ + func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, + argPos, ary, arity + ]; + + if (data) { + mergeData(newData, data); + } + func = newData[0]; + bitmask = newData[1]; + thisArg = newData[2]; + partials = newData[3]; + holders = newData[4]; + arity = newData[9] = newData[9] === undefined + ? (isBindKey ? 0 : func.length) + : nativeMax(newData[9] - length, 0); + + if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { + bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); + } + if (!bitmask || bitmask == WRAP_BIND_FLAG) { + var result = createBind(func, bitmask, thisArg); + } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { + result = createCurry(func, bitmask, arity); + } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { + result = createPartial(func, bitmask, thisArg, partials); + } else { + result = createHybrid.apply(undefined, newData); + } + var setter = data ? baseSetData : setData; + return setWrapToString(setter(result, newData), func, bitmask); +} + +module.exports = createWrap; + + +/***/ }), +/* 1081 */ +/***/ (function(module, exports, __webpack_require__) { + +var identity = __webpack_require__(298), + metaMap = __webpack_require__(1082); + +/** + * The base implementation of `setData` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ +var baseSetData = !metaMap ? identity : function(func, data) { + metaMap.set(func, data); + return func; +}; + +module.exports = baseSetData; + + +/***/ }), +/* 1082 */ +/***/ (function(module, exports, __webpack_require__) { + +var WeakMap = __webpack_require__(202); + +/** Used to store function metadata. */ +var metaMap = WeakMap && new WeakMap; + +module.exports = metaMap; + + +/***/ }), +/* 1083 */ +/***/ (function(module, exports, __webpack_require__) { + +var createCtor = __webpack_require__(1084), + root = __webpack_require__(8); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1; + +/** + * Creates a function that wraps `func` to invoke it with the optional `this` + * binding of `thisArg`. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @returns {Function} Returns the new wrapped function. + */ +function createBind(func, bitmask, thisArg) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return fn.apply(isBind ? thisArg : this, arguments); + } + return wrapper; +} + +module.exports = createBind; + + +/***/ }), +/* 1084 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseCreate = __webpack_require__(403), + isObject = __webpack_require__(84); + +/** + * Creates a function that produces an instance of `Ctor` regardless of + * whether it was invoked as part of a `new` expression or by `call` or `apply`. + * + * @private + * @param {Function} Ctor The constructor to wrap. + * @returns {Function} Returns the new wrapped function. + */ +function createCtor(Ctor) { + return function() { + // Use a `switch` statement to work with class constructors. See + // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist + // for more details. + var args = arguments; + switch (args.length) { + case 0: return new Ctor; + case 1: return new Ctor(args[0]); + case 2: return new Ctor(args[0], args[1]); + case 3: return new Ctor(args[0], args[1], args[2]); + case 4: return new Ctor(args[0], args[1], args[2], args[3]); + case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); + case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); + case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); + } + var thisBinding = baseCreate(Ctor.prototype), + result = Ctor.apply(thisBinding, args); + + // Mimic the constructor's `return` behavior. + // See https://es5.github.io/#x13.2.2 for more details. + return isObject(result) ? result : thisBinding; + }; +} + +module.exports = createCtor; + + +/***/ }), +/* 1085 */ +/***/ (function(module, exports, __webpack_require__) { + +var apply = __webpack_require__(413), + createCtor = __webpack_require__(1084), + createHybrid = __webpack_require__(1086), + createRecurry = __webpack_require__(1090), + getHolder = __webpack_require__(1105), + replaceHolders = __webpack_require__(1107), + root = __webpack_require__(8); + +/** + * Creates a function that wraps `func` to enable currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {number} arity The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ +function createCurry(func, bitmask, arity) { + var Ctor = createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length, + placeholder = getHolder(wrapper); + + while (index--) { + args[index] = arguments[index]; + } + var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) + ? [] + : replaceHolders(args, placeholder); + + length -= holders.length; + if (length < arity) { + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, undefined, + args, holders, undefined, undefined, arity - length); + } + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return apply(fn, this, args); + } + return wrapper; +} + +module.exports = createCurry; + + +/***/ }), +/* 1086 */ +/***/ (function(module, exports, __webpack_require__) { + +var composeArgs = __webpack_require__(1087), + composeArgsRight = __webpack_require__(1088), + countHolders = __webpack_require__(1089), + createCtor = __webpack_require__(1084), + createRecurry = __webpack_require__(1090), + getHolder = __webpack_require__(1105), + reorder = __webpack_require__(1106), + replaceHolders = __webpack_require__(1107), + root = __webpack_require__(8); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_FLAG = 8, + WRAP_CURRY_RIGHT_FLAG = 16, + WRAP_ARY_FLAG = 128, + WRAP_FLIP_FLAG = 512; + +/** + * Creates a function that wraps `func` to invoke it with optional `this` + * binding of `thisArg`, partial application, and currying. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [partialsRight] The arguments to append to those provided + * to the new function. + * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ +function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { + var isAry = bitmask & WRAP_ARY_FLAG, + isBind = bitmask & WRAP_BIND_FLAG, + isBindKey = bitmask & WRAP_BIND_KEY_FLAG, + isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), + isFlip = bitmask & WRAP_FLIP_FLAG, + Ctor = isBindKey ? undefined : createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length; + + while (index--) { + args[index] = arguments[index]; + } + if (isCurried) { + var placeholder = getHolder(wrapper), + holdersCount = countHolders(args, placeholder); + } + if (partials) { + args = composeArgs(args, partials, holders, isCurried); + } + if (partialsRight) { + args = composeArgsRight(args, partialsRight, holdersRight, isCurried); + } + length -= holdersCount; + if (isCurried && length < arity) { + var newHolders = replaceHolders(args, placeholder); + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, thisArg, + args, newHolders, argPos, ary, arity - length + ); + } + var thisBinding = isBind ? thisArg : this, + fn = isBindKey ? thisBinding[func] : func; + + length = args.length; + if (argPos) { + args = reorder(args, argPos); + } else if (isFlip && length > 1) { + args.reverse(); + } + if (isAry && ary < length) { + args.length = ary; + } + if (this && this !== root && this instanceof wrapper) { + fn = Ctor || createCtor(fn); + } + return fn.apply(thisBinding, args); + } + return wrapper; +} + +module.exports = createHybrid; + + +/***/ }), +/* 1087 */ +/***/ (function(module, exports) { + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * Creates an array that is the composition of partially applied arguments, + * placeholders, and provided arguments into a single array of arguments. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to prepend to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ +function composeArgs(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersLength = holders.length, + leftIndex = -1, + leftLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(leftLength + rangeLength), + isUncurried = !isCurried; + + while (++leftIndex < leftLength) { + result[leftIndex] = partials[leftIndex]; + } + while (++argsIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[holders[argsIndex]] = args[argsIndex]; + } + } + while (rangeLength--) { + result[leftIndex++] = args[argsIndex++]; + } + return result; +} + +module.exports = composeArgs; + + +/***/ }), +/* 1088 */ +/***/ (function(module, exports) { + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * This function is like `composeArgs` except that the arguments composition + * is tailored for `_.partialRight`. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to append to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ +function composeArgsRight(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersIndex = -1, + holdersLength = holders.length, + rightIndex = -1, + rightLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(rangeLength + rightLength), + isUncurried = !isCurried; + + while (++argsIndex < rangeLength) { + result[argsIndex] = args[argsIndex]; + } + var offset = argsIndex; + while (++rightIndex < rightLength) { + result[offset + rightIndex] = partials[rightIndex]; + } + while (++holdersIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[offset + holders[holdersIndex]] = args[argsIndex++]; + } + } + return result; +} + +module.exports = composeArgsRight; + + +/***/ }), +/* 1089 */ +/***/ (function(module, exports) { + +/** + * Gets the number of `placeholder` occurrences in `array`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} placeholder The placeholder to search for. + * @returns {number} Returns the placeholder count. + */ +function countHolders(array, placeholder) { + var length = array.length, + result = 0; + + while (length--) { + if (array[length] === placeholder) { + ++result; + } + } + return result; +} + +module.exports = countHolders; + + +/***/ }), +/* 1090 */ +/***/ (function(module, exports, __webpack_require__) { + +var isLaziable = __webpack_require__(1091), + setData = __webpack_require__(1100), + setWrapToString = __webpack_require__(1101); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_BOUND_FLAG = 4, + WRAP_CURRY_FLAG = 8, + WRAP_PARTIAL_FLAG = 32, + WRAP_PARTIAL_RIGHT_FLAG = 64; + +/** + * Creates a function that wraps `func` to continue currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {Function} wrapFunc The function to create the `func` wrapper. + * @param {*} placeholder The placeholder value. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ +function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { + var isCurry = bitmask & WRAP_CURRY_FLAG, + newHolders = isCurry ? holders : undefined, + newHoldersRight = isCurry ? undefined : holders, + newPartials = isCurry ? partials : undefined, + newPartialsRight = isCurry ? undefined : partials; + + bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); + bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); + + if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { + bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); + } + var newData = [ + func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, + newHoldersRight, argPos, ary, arity + ]; + + var result = wrapFunc.apply(undefined, newData); + if (isLaziable(func)) { + setData(result, newData); + } + result.placeholder = placeholder; + return setWrapToString(result, func, bitmask); +} + +module.exports = createRecurry; + + +/***/ }), +/* 1091 */ +/***/ (function(module, exports, __webpack_require__) { + +var LazyWrapper = __webpack_require__(1092), + getData = __webpack_require__(1094), + getFuncName = __webpack_require__(1095), + lodash = __webpack_require__(1097); + +/** + * Checks if `func` has a lazy counterpart. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` has a lazy counterpart, + * else `false`. + */ +function isLaziable(func) { + var funcName = getFuncName(func), + other = lodash[funcName]; + + if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { + return false; + } + if (func === other) { + return true; + } + var data = getData(other); + return !!data && func === data[0]; +} + +module.exports = isLaziable; + + +/***/ }), +/* 1092 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseCreate = __webpack_require__(403), + baseLodash = __webpack_require__(1093); + +/** Used as references for the maximum length and index of an array. */ +var MAX_ARRAY_LENGTH = 4294967295; + +/** + * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. + * + * @private + * @constructor + * @param {*} value The value to wrap. + */ +function LazyWrapper(value) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__dir__ = 1; + this.__filtered__ = false; + this.__iteratees__ = []; + this.__takeCount__ = MAX_ARRAY_LENGTH; + this.__views__ = []; +} + +// Ensure `LazyWrapper` is an instance of `baseLodash`. +LazyWrapper.prototype = baseCreate(baseLodash.prototype); +LazyWrapper.prototype.constructor = LazyWrapper; + +module.exports = LazyWrapper; + + +/***/ }), +/* 1093 */ +/***/ (function(module, exports) { + +/** + * The function whose prototype chain sequence wrappers inherit from. + * + * @private + */ +function baseLodash() { + // No operation performed. +} + +module.exports = baseLodash; + + +/***/ }), +/* 1094 */ +/***/ (function(module, exports, __webpack_require__) { + +var metaMap = __webpack_require__(1082), + noop = __webpack_require__(569); + +/** + * Gets metadata for `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {*} Returns the metadata for `func`. + */ +var getData = !metaMap ? noop : function(func) { + return metaMap.get(func); +}; + +module.exports = getData; + + +/***/ }), +/* 1095 */ +/***/ (function(module, exports, __webpack_require__) { + +var realNames = __webpack_require__(1096); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Gets the name of `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {string} Returns the function name. + */ +function getFuncName(func) { + var result = (func.name + ''), + array = realNames[result], + length = hasOwnProperty.call(realNames, result) ? array.length : 0; + + while (length--) { + var data = array[length], + otherFunc = data.func; + if (otherFunc == null || otherFunc == func) { + return data.name; + } + } + return result; +} + +module.exports = getFuncName; + + +/***/ }), +/* 1096 */ +/***/ (function(module, exports) { + +/** Used to lookup unminified function names. */ +var realNames = {}; + +module.exports = realNames; + + +/***/ }), +/* 1097 */ +/***/ (function(module, exports, __webpack_require__) { + +var LazyWrapper = __webpack_require__(1092), + LodashWrapper = __webpack_require__(1098), + baseLodash = __webpack_require__(1093), + isArray = __webpack_require__(70), + isObjectLike = __webpack_require__(14), + wrapperClone = __webpack_require__(1099); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Creates a `lodash` object which wraps `value` to enable implicit method + * chain sequences. Methods that operate on and return arrays, collections, + * and functions can be chained together. Methods that retrieve a single value + * or may return a primitive value will automatically end the chain sequence + * and return the unwrapped value. Otherwise, the value must be unwrapped + * with `_#value`. + * + * Explicit chain sequences, which must be unwrapped with `_#value`, may be + * enabled using `_.chain`. + * + * The execution of chained methods is lazy, that is, it's deferred until + * `_#value` is implicitly or explicitly called. + * + * Lazy evaluation allows several methods to support shortcut fusion. + * Shortcut fusion is an optimization to merge iteratee calls; this avoids + * the creation of intermediate arrays and can greatly reduce the number of + * iteratee executions. Sections of a chain sequence qualify for shortcut + * fusion if the section is applied to an array and iteratees accept only + * one argument. The heuristic for whether a section qualifies for shortcut + * fusion is subject to change. + * + * Chaining is supported in custom builds as long as the `_#value` method is + * directly or indirectly included in the build. + * + * In addition to lodash methods, wrappers have `Array` and `String` methods. + * + * The wrapper `Array` methods are: + * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` + * + * The wrapper `String` methods are: + * `replace` and `split` + * + * The wrapper methods that support shortcut fusion are: + * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, + * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, + * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` + * + * The chainable wrapper methods are: + * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, + * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, + * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, + * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, + * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, + * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, + * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, + * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, + * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, + * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, + * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, + * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, + * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, + * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, + * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, + * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, + * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, + * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, + * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, + * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, + * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, + * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, + * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, + * `zipObject`, `zipObjectDeep`, and `zipWith` + * + * The wrapper methods that are **not** chainable by default are: + * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, + * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, + * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, + * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, + * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, + * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, + * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, + * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, + * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, + * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, + * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, + * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, + * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, + * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, + * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, + * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, + * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, + * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, + * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, + * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, + * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, + * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, + * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, + * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, + * `upperFirst`, `value`, and `words` + * + * @name _ + * @constructor + * @category Seq + * @param {*} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2, 3]); + * + * // Returns an unwrapped value. + * wrapped.reduce(_.add); + * // => 6 + * + * // Returns a wrapped value. + * var squares = wrapped.map(square); + * + * _.isArray(squares); + * // => false + * + * _.isArray(squares.value()); + * // => true + */ +function lodash(value) { + if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { + if (value instanceof LodashWrapper) { + return value; + } + if (hasOwnProperty.call(value, '__wrapped__')) { + return wrapperClone(value); + } + } + return new LodashWrapper(value); +} + +// Ensure wrappers are instances of `baseLodash`. +lodash.prototype = baseLodash.prototype; +lodash.prototype.constructor = lodash; + +module.exports = lodash; + + +/***/ }), +/* 1098 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseCreate = __webpack_require__(403), + baseLodash = __webpack_require__(1093); + +/** + * The base constructor for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap. + * @param {boolean} [chainAll] Enable explicit method chain sequences. + */ +function LodashWrapper(value, chainAll) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__chain__ = !!chainAll; + this.__index__ = 0; + this.__values__ = undefined; +} + +LodashWrapper.prototype = baseCreate(baseLodash.prototype); +LodashWrapper.prototype.constructor = LodashWrapper; + +module.exports = LodashWrapper; + + +/***/ }), +/* 1099 */ +/***/ (function(module, exports, __webpack_require__) { + +var LazyWrapper = __webpack_require__(1092), + LodashWrapper = __webpack_require__(1098), + copyArray = __webpack_require__(401); + +/** + * Creates a clone of `wrapper`. + * + * @private + * @param {Object} wrapper The wrapper to clone. + * @returns {Object} Returns the cloned wrapper. + */ +function wrapperClone(wrapper) { + if (wrapper instanceof LazyWrapper) { + return wrapper.clone(); + } + var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); + result.__actions__ = copyArray(wrapper.__actions__); + result.__index__ = wrapper.__index__; + result.__values__ = wrapper.__values__; + return result; +} + +module.exports = wrapperClone; + + +/***/ }), +/* 1100 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseSetData = __webpack_require__(1081), + shortOut = __webpack_require__(417); + +/** + * Sets metadata for `func`. + * + * **Note:** If this function becomes hot, i.e. is invoked a lot in a short + * period of time, it will trip its breaker and transition to an identity + * function to avoid garbage collection pauses in V8. See + * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) + * for more details. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ +var setData = shortOut(baseSetData); + +module.exports = setData; + + +/***/ }), +/* 1101 */ +/***/ (function(module, exports, __webpack_require__) { + +var getWrapDetails = __webpack_require__(1102), + insertWrapDetails = __webpack_require__(1103), + setToString = __webpack_require__(414), + updateWrapDetails = __webpack_require__(1104); + +/** + * Sets the `toString` method of `wrapper` to mimic the source of `reference` + * with wrapper details in a comment at the top of the source body. + * + * @private + * @param {Function} wrapper The function to modify. + * @param {Function} reference The reference function. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Function} Returns `wrapper`. + */ +function setWrapToString(wrapper, reference, bitmask) { + var source = (reference + ''); + return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); +} + +module.exports = setWrapToString; + + +/***/ }), +/* 1102 */ +/***/ (function(module, exports) { + +/** Used to match wrap detail comments. */ +var reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, + reSplitDetails = /,? & /; + +/** + * Extracts wrapper details from the `source` body comment. + * + * @private + * @param {string} source The source to inspect. + * @returns {Array} Returns the wrapper details. + */ +function getWrapDetails(source) { + var match = source.match(reWrapDetails); + return match ? match[1].split(reSplitDetails) : []; +} + +module.exports = getWrapDetails; + + +/***/ }), +/* 1103 */ +/***/ (function(module, exports) { + +/** Used to match wrap detail comments. */ +var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/; + +/** + * Inserts wrapper `details` in a comment at the top of the `source` body. + * + * @private + * @param {string} source The source to modify. + * @returns {Array} details The details to insert. + * @returns {string} Returns the modified source. + */ +function insertWrapDetails(source, details) { + var length = details.length; + if (!length) { + return source; + } + var lastIndex = length - 1; + details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; + details = details.join(length > 2 ? ', ' : ' '); + return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); +} + +module.exports = insertWrapDetails; + + +/***/ }), +/* 1104 */ +/***/ (function(module, exports, __webpack_require__) { + +var arrayEach = __webpack_require__(544), + arrayIncludes = __webpack_require__(563); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_FLAG = 8, + WRAP_CURRY_RIGHT_FLAG = 16, + WRAP_PARTIAL_FLAG = 32, + WRAP_PARTIAL_RIGHT_FLAG = 64, + WRAP_ARY_FLAG = 128, + WRAP_REARG_FLAG = 256, + WRAP_FLIP_FLAG = 512; + +/** Used to associate wrap methods with their bit flags. */ +var wrapFlags = [ + ['ary', WRAP_ARY_FLAG], + ['bind', WRAP_BIND_FLAG], + ['bindKey', WRAP_BIND_KEY_FLAG], + ['curry', WRAP_CURRY_FLAG], + ['curryRight', WRAP_CURRY_RIGHT_FLAG], + ['flip', WRAP_FLIP_FLAG], + ['partial', WRAP_PARTIAL_FLAG], + ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], + ['rearg', WRAP_REARG_FLAG] +]; + +/** + * Updates wrapper `details` based on `bitmask` flags. + * + * @private + * @returns {Array} details The details to modify. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Array} Returns `details`. + */ +function updateWrapDetails(details, bitmask) { + arrayEach(wrapFlags, function(pair) { + var value = '_.' + pair[0]; + if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { + details.push(value); + } + }); + return details.sort(); +} + +module.exports = updateWrapDetails; + + +/***/ }), +/* 1105 */ +/***/ (function(module, exports) { + +/** + * Gets the argument placeholder value for `func`. + * + * @private + * @param {Function} func The function to inspect. + * @returns {*} Returns the placeholder value. + */ +function getHolder(func) { + var object = func; + return object.placeholder; +} + +module.exports = getHolder; + + +/***/ }), +/* 1106 */ +/***/ (function(module, exports, __webpack_require__) { + +var copyArray = __webpack_require__(401), + isIndex = __webpack_require__(117); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; + +/** + * Reorder `array` according to the specified indexes where the element at + * the first index is assigned as the first element, the element at + * the second index is assigned as the second element, and so on. + * + * @private + * @param {Array} array The array to reorder. + * @param {Array} indexes The arranged array indexes. + * @returns {Array} Returns `array`. + */ +function reorder(array, indexes) { + var arrLength = array.length, + length = nativeMin(indexes.length, arrLength), + oldArray = copyArray(array); + + while (length--) { + var index = indexes[length]; + array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; + } + return array; +} + +module.exports = reorder; + + +/***/ }), +/* 1107 */ +/***/ (function(module, exports) { + +/** Used as the internal argument placeholder. */ +var PLACEHOLDER = '__lodash_placeholder__'; + +/** + * Replaces all `placeholder` elements in `array` with an internal placeholder + * and returns an array of their indexes. + * + * @private + * @param {Array} array The array to modify. + * @param {*} placeholder The placeholder to replace. + * @returns {Array} Returns the new array of placeholder indexes. + */ +function replaceHolders(array, placeholder) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value === placeholder || value === PLACEHOLDER) { + array[index] = PLACEHOLDER; + result[resIndex++] = index; + } + } + return result; +} + +module.exports = replaceHolders; + + +/***/ }), +/* 1108 */ +/***/ (function(module, exports, __webpack_require__) { + +var apply = __webpack_require__(413), + createCtor = __webpack_require__(1084), + root = __webpack_require__(8); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1; + +/** + * Creates a function that wraps `func` to invoke it with the `this` binding + * of `thisArg` and `partials` prepended to the arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} partials The arguments to prepend to those provided to + * the new function. + * @returns {Function} Returns the new wrapped function. + */ +function createPartial(func, bitmask, thisArg, partials) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var argsIndex = -1, + argsLength = arguments.length, + leftIndex = -1, + leftLength = partials.length, + args = Array(leftLength + argsLength), + fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + + while (++leftIndex < leftLength) { + args[leftIndex] = partials[leftIndex]; + } + while (argsLength--) { + args[leftIndex++] = arguments[++argsIndex]; + } + return apply(fn, isBind ? thisArg : this, args); + } + return wrapper; +} + +module.exports = createPartial; + + +/***/ }), +/* 1109 */ +/***/ (function(module, exports, __webpack_require__) { + +var composeArgs = __webpack_require__(1087), + composeArgsRight = __webpack_require__(1088), + replaceHolders = __webpack_require__(1107); + +/** Used as the internal argument placeholder. */ +var PLACEHOLDER = '__lodash_placeholder__'; + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_BOUND_FLAG = 4, + WRAP_CURRY_FLAG = 8, + WRAP_ARY_FLAG = 128, + WRAP_REARG_FLAG = 256; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; + +/** + * Merges the function metadata of `source` into `data`. + * + * Merging metadata reduces the number of wrappers used to invoke a function. + * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` + * may be applied regardless of execution order. Methods like `_.ary` and + * `_.rearg` modify function arguments, making the order in which they are + * executed important, preventing the merging of metadata. However, we make + * an exception for a safe combined case where curried functions have `_.ary` + * and or `_.rearg` applied. + * + * @private + * @param {Array} data The destination metadata. + * @param {Array} source The source metadata. + * @returns {Array} Returns `data`. + */ +function mergeData(data, source) { + var bitmask = data[1], + srcBitmask = source[1], + newBitmask = bitmask | srcBitmask, + isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); + + var isCombo = + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || + ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); + + // Exit early if metadata can't be merged. + if (!(isCommon || isCombo)) { + return data; + } + // Use source `thisArg` if available. + if (srcBitmask & WRAP_BIND_FLAG) { + data[2] = source[2]; + // Set when currying a bound function. + newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; + } + // Compose partial arguments. + var value = source[3]; + if (value) { + var partials = data[3]; + data[3] = partials ? composeArgs(partials, value, source[4]) : value; + data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; + } + // Compose partial right arguments. + value = source[5]; + if (value) { + partials = data[5]; + data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; + data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; + } + // Use source `argPos` if available. + value = source[7]; + if (value) { + data[7] = value; + } + // Use source `ary` if it's smaller. + if (srcBitmask & WRAP_ARY_FLAG) { + data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); + } + // Use source `arity` if one is not provided. + if (data[9] == null) { + data[9] = source[9]; + } + // Use source `func` and merge bitmasks. + data[0] = source[0]; + data[1] = newBitmask; + + return data; +} + +module.exports = mergeData; + + +/***/ }), +/* 1110 */ +/***/ (function(module, exports, __webpack_require__) { + +var createWrap = __webpack_require__(1080); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_CURRY_FLAG = 8; + +/** + * Creates a function that accepts arguments of `func` and either invokes + * `func` returning its result, if at least `arity` number of arguments have + * been provided, or returns a function that accepts the remaining `func` + * arguments, and so on. The arity of `func` may be specified if `func.length` + * is not sufficient. + * + * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curry(abc); + * + * curried(1)(2)(3); + * // => [1, 2, 3] + * + * curried(1, 2)(3); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(1)(_, 3)(2); + * // => [1, 2, 3] + */ +function curry(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curry.placeholder; + return result; +} + +// Assign default placeholders. +curry.placeholder = {}; + +module.exports = curry; + + +/***/ }), +/* 1111 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseClone = __webpack_require__(543), + baseIteratee = __webpack_require__(814); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1; + +/** + * Creates a function that invokes `func` with the arguments of the created + * function. If `func` is a property name, the created function returns the + * property value for a given element. If `func` is an array or object, the + * created function returns `true` for elements that contain the equivalent + * source properties, otherwise it returns `false`. + * + * @static + * @since 4.0.0 + * @memberOf _ + * @category Util + * @param {*} [func=_.identity] The value to convert to a callback. + * @returns {Function} Returns the callback. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true })); + * // => [{ 'user': 'barney', 'age': 36, 'active': true }] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, _.iteratee(['user', 'fred'])); + * // => [{ 'user': 'fred', 'age': 40 }] + * + * // The `_.property` iteratee shorthand. + * _.map(users, _.iteratee('user')); + * // => ['barney', 'fred'] + * + * // Create custom iteratee shorthands. + * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) { + * return !_.isRegExp(func) ? iteratee(func) : function(string) { + * return func.test(string); + * }; + * }); + * + * _.filter(['abc', 'def'], /ef/); + * // => ['def'] + */ +function iteratee(func) { + return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG)); +} + +module.exports = iteratee; + + +/***/ }), +/* 1112 */ +/***/ (function(module, exports, __webpack_require__) { + +var createWrap = __webpack_require__(1080), + flatRest = __webpack_require__(1113); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_REARG_FLAG = 256; + +/** + * Creates a function that invokes `func` with arguments arranged according + * to the specified `indexes` where the argument value at the first index is + * provided as the first argument, the argument value at the second index is + * provided as the second argument, and so on. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to rearrange arguments for. + * @param {...(number|number[])} indexes The arranged argument indexes. + * @returns {Function} Returns the new function. + * @example + * + * var rearged = _.rearg(function(a, b, c) { + * return [a, b, c]; + * }, [2, 0, 1]); + * + * rearged('b', 'c', 'a') + * // => ['a', 'b', 'c'] + */ +var rearg = flatRest(function(func, indexes) { + return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); +}); + +module.exports = rearg; + + +/***/ }), +/* 1113 */ +/***/ (function(module, exports, __webpack_require__) { + +var flatten = __webpack_require__(706), + overRest = __webpack_require__(412), + setToString = __webpack_require__(414); + +/** + * A specialized version of `baseRest` which flattens the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ +function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); +} + +module.exports = flatRest; + + +/***/ }), +/* 1114 */ +/***/ (function(module, exports, __webpack_require__) { + +var arrayMap = __webpack_require__(110), + copyArray = __webpack_require__(401), + isArray = __webpack_require__(70), + isSymbol = __webpack_require__(72), + stringToPath = __webpack_require__(73), + toKey = __webpack_require__(111), + toString = __webpack_require__(108); + +/** + * Converts `value` to a property path array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Util + * @param {*} value The value to convert. + * @returns {Array} Returns the new property path array. + * @example + * + * _.toPath('a.b.c'); + * // => ['a', 'b', 'c'] + * + * _.toPath('a[0].b.c'); + * // => ['a', '0', 'b', 'c'] + */ +function toPath(value) { + if (isArray(value)) { + return arrayMap(value, toKey); + } + return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value))); +} + +module.exports = toPath; + + +/***/ }), +/* 1115 */, +/* 1116 */, +/* 1117 */, +/* 1118 */, +/* 1119 */, +/* 1120 */, +/* 1121 */, +/* 1122 */, +/* 1123 */, +/* 1124 */, +/* 1125 */, +/* 1126 */, +/* 1127 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.containsPosition = containsPosition; +exports.containsLocation = containsLocation; +exports.nodeContainsPosition = nodeContainsPosition; +function containsPosition(a, b) { + var startsBefore = a.start.line < b.line || a.start.line === b.line && a.start.column <= b.column; + var endsAfter = a.end.line > b.line || a.end.line === b.line && a.end.column >= b.column; + + return startsBefore && endsAfter; +} +function containsLocation(a, b) { + return containsPosition(a, b.start) && containsPosition(a, b.end); +} + +function nodeContainsPosition(node, position) { + return containsPosition(node.loc, position); +} + +/***/ }), +/* 1128 */, +/* 1129 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseDifference = __webpack_require__(1131), + baseFlatten = __webpack_require__(707), + baseRest = __webpack_require__(411), + isArrayLikeObject = __webpack_require__(404); + +/** + * 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; + + +/***/ }), +/* 1130 */, +/* 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; + + /***/ }) /******/ ]); }); \ No newline at end of file diff --git a/devtools/client/debugger/new/pretty-print-worker.js b/devtools/client/debugger/new/pretty-print-worker.js index e9e2f195a8b1..c65f8f726df4 100644 --- a/devtools/client/debugger/new/pretty-print-worker.js +++ b/devtools/client/debugger/new/pretty-print-worker.js @@ -3779,6 +3779,14 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/* -*- indent- && token.type.label != ".")) { return true; } + + if (lastToken.value == "let") { + return true; + } + + if (lastToken.value == "const") { + return true; + } } if (token.type.isAssign) { @@ -4582,6 +4590,18 @@ SourceMapGenerator.prototype.applySourceMap = SourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) { + // When aOriginal is truthy but has empty values for .line and .column, + // it is most likely a programmer error. In this case we throw a very + // specific error message to try to guide them the right way. + // For example: https://github.com/Polymer/polymer-bundler/pull/519 + if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { + throw new Error( + 'original.line and original.column are not numbers -- you probably meant to omit ' + + 'the original mapping entirely and only map the generated position. If so, pass ' + + 'null for the original mapping instead of an object with empty or null values.' + ); + } + if (aGenerated && 'line' in aGenerated && 'column' in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) { @@ -5386,6 +5406,7 @@ exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflate var util = __webpack_require__(819); var has = Object.prototype.hasOwnProperty; +var hasNativeMap = typeof Map !== "undefined"; /** * A data structure which is a combination of an array and a set. Adding a new @@ -5395,7 +5416,7 @@ var has = Object.prototype.hasOwnProperty; */ function ArraySet() { this._array = []; - this._set = Object.create(null); + this._set = hasNativeMap ? new Map() : Object.create(null); } /** @@ -5416,7 +5437,7 @@ ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { * @returns Number */ ArraySet.prototype.size = function ArraySet_size() { - return Object.getOwnPropertyNames(this._set).length; + return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; }; /** @@ -5425,14 +5446,18 @@ ArraySet.prototype.size = function ArraySet_size() { * @param String aStr */ ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { - var sStr = util.toSetString(aStr); - var isDuplicate = has.call(this._set, sStr); + var sStr = hasNativeMap ? aStr : util.toSetString(aStr); + var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); var idx = this._array.length; if (!isDuplicate || aAllowDuplicates) { this._array.push(aStr); } if (!isDuplicate) { - this._set[sStr] = idx; + if (hasNativeMap) { + this._set.set(aStr, idx); + } else { + this._set[sStr] = idx; + } } }; @@ -5442,8 +5467,12 @@ ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { * @param String aStr */ ArraySet.prototype.has = function ArraySet_has(aStr) { - var sStr = util.toSetString(aStr); - return has.call(this._set, sStr); + if (hasNativeMap) { + return this._set.has(aStr); + } else { + var sStr = util.toSetString(aStr); + return has.call(this._set, sStr); + } }; /** @@ -5452,10 +5481,18 @@ ArraySet.prototype.has = function ArraySet_has(aStr) { * @param String aStr */ ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { - var sStr = util.toSetString(aStr); - if (has.call(this._set, sStr)) { - return this._set[sStr]; + if (hasNativeMap) { + var idx = this._set.get(aStr); + if (idx >= 0) { + return idx; + } + } else { + var sStr = util.toSetString(aStr); + if (has.call(this._set, sStr)) { + return this._set[sStr]; + } } + throw new Error('"' + aStr + '" is not in the set.'); }; @@ -6964,13 +7001,19 @@ SourceNode.fromStringWithSourceMap = // All even indices of this array are one line of the generated code, // while all odd indices are the newlines between two adjacent lines // (since `REGEX_NEWLINE` captures its match). - // Processed fragments are removed from this array, by calling `shiftNextLine`. + // Processed fragments are accessed by calling `shiftNextLine`. var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); + var remainingLinesIndex = 0; var shiftNextLine = function() { - var lineContents = remainingLines.shift(); + var lineContents = getNextLine(); // The last line of a file might not have a newline. - var newLine = remainingLines.shift() || ""; + var newLine = getNextLine() || ""; return lineContents + newLine; + + function getNextLine() { + return remainingLinesIndex < remainingLines.length ? + remainingLines[remainingLinesIndex++] : undefined; + } }; // We need to remember the position of "remainingLines" @@ -6995,10 +7038,10 @@ SourceNode.fromStringWithSourceMap = // There is no new line in between. // Associate the code between "lastGeneratedColumn" and // "mapping.generatedColumn" with "lastMapping" - var nextLine = remainingLines[0]; + var nextLine = remainingLines[remainingLinesIndex]; var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn); - remainingLines[0] = nextLine.substr(mapping.generatedColumn - + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn); lastGeneratedColumn = mapping.generatedColumn; addMappingWithCode(lastMapping, code); @@ -7015,21 +7058,21 @@ SourceNode.fromStringWithSourceMap = lastGeneratedLine++; } if (lastGeneratedColumn < mapping.generatedColumn) { - var nextLine = remainingLines[0]; + var nextLine = remainingLines[remainingLinesIndex]; node.add(nextLine.substr(0, mapping.generatedColumn)); - remainingLines[0] = nextLine.substr(mapping.generatedColumn); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); lastGeneratedColumn = mapping.generatedColumn; } lastMapping = mapping; }, this); // We have processed all mappings. - if (remainingLines.length > 0) { + if (remainingLinesIndex < remainingLines.length) { if (lastMapping) { // Associate the remaining code in the current line with "lastMapping" addMappingWithCode(lastMapping, shiftNextLine()); } // and add the remaining lines without any mapping - node.add(remainingLines.join("")); + node.add(remainingLines.splice(remainingLinesIndex).join("")); } // Copy sourcesContent into SourceNode @@ -7412,12 +7455,17 @@ function workerHandler(publicInterface) { try { const response = publicInterface[method].apply(undefined, args); if (response instanceof Promise) { - response.then(val => self.postMessage({ id, response: val }), err => self.postMessage({ id, error: err })); + 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) { - self.postMessage({ id, error }); + // Error can't be sent via postMessage, so be sure to convert to + // string. + self.postMessage({ id, error: error.toString() }); } }; } diff --git a/devtools/client/debugger/new/search-worker.js b/devtools/client/debugger/new/search-worker.js index 8414bccfb759..669398150128 100644 --- a/devtools/client/debugger/new/search-worker.js +++ b/devtools/client/debugger/new/search-worker.js @@ -386,16 +386,17 @@ Object.defineProperty(exports, "__esModule", { }); exports.findSourceMatches = findSourceMatches; -function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } +var _source = __webpack_require__(233); + +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } // Maybe reuse file search's functions? + -// Maybe reuse file search's functions? function findSourceMatches(source, queryText) { var _ref; - var text = source.text, - loading = source.loading; + var text = source.text; - if (loading || !text || queryText == "") { + if (!(0, _source.isLoaded)(source) || !text || queryText == "") { return []; } @@ -467,6 +468,191 @@ function getMatches(query, text, modifiers) { return matchedLocations; } +/***/ }), + +/***/ 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; +}; + + /***/ }), /***/ 14: @@ -503,6 +689,714 @@ function isObjectLike(value) { module.exports = isObjectLike; +/***/ }), + +/***/ 233: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isLoaded = exports.getMode = exports.getSourceLineCount = exports.getSourcePath = exports.getFilenameFromURL = exports.getFilename = exports.getRawSourceURL = exports.getPrettySourceURL = exports.shouldPrettyPrint = exports.isPretty = exports.isJavaScript = undefined; + +var _devtoolsSourceMap = __webpack_require__(898); + +var _utils = __webpack_require__(234); + +var _path = __webpack_require__(235); + +var _url = __webpack_require__(334); + +/** + * Trims the query part or reference identifier of a url string, if necessary. + * + * @memberof utils/source + * @static + */ + + +/** + * Utils for working with Source URLs + * @module utils/source + */ + +function trimUrlQuery(url) { + var length = url.length; + var q1 = url.indexOf("?"); + var q2 = url.indexOf("&"); + var q3 = url.indexOf("#"); + var q = Math.min(q1 != -1 ? q1 : length, q2 != -1 ? q2 : length, q3 != -1 ? q3 : length); + + return url.slice(0, q); +} + +function shouldPrettyPrint(source) { + if (!source) { + return false; + } + + var _isPretty = isPretty(source); + var _isJavaScript = isJavaScript(source.url); + var isOriginal = (0, _devtoolsSourceMap.isOriginalId)(source.id); + var hasSourceMap = source.sourceMapURL; + + if (_isPretty || isOriginal || hasSourceMap || !_isJavaScript) { + return false; + } + + return true; +} + +/** + * Returns true if the specified url and/or content type are specific to + * javascript files. + * + * @return boolean + * True if the source is likely javascript. + * + * @memberof utils/source + * @static + */ +function isJavaScript(url) { + var contentType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ""; + + return url && /\.(jsm|js)?$/.test(trimUrlQuery(url)) || contentType.includes("javascript"); +} + +/** + * @memberof utils/source + * @static + */ +function isPretty(source) { + return source.url ? /formatted$/.test(source.url) : false; +} + +/** + * @memberof utils/source + * @static + */ +function getPrettySourceURL(url) { + if (!url) { + url = ""; + } + return `${url}:formatted`; +} + +/** + * @memberof utils/source + * @static + */ +function getRawSourceURL(url) { + return url.replace(/:formatted$/, ""); +} + +function getFilenameFromURL(url) { + url = getRawSourceURL(url || ""); + var name = (0, _path.basename)(url) || "(index)"; + return (0, _utils.endTruncateStr)(name, 50); +} + +/** + * Show a source url's filename. + * If the source does not have a url, use the source id. + * + * @memberof utils/source + * @static + */ +function getFilename(source) { + var url = source.url, + id = source.id; + + if (!url) { + var sourceId = id.split("/")[1]; + return `SOURCE${sourceId}`; + } + + return getFilenameFromURL(url); +} + +var contentTypeModeMap = { + "text/javascript": { name: "javascript" }, + "text/typescript": { name: "javascript", typescript: true }, + "text/coffeescript": "coffeescript", + "text/typescript-jsx": { + name: "jsx", + base: { name: "javascript", typescript: true } + }, + "text/jsx": "jsx", + "text/x-elm": "elm", + "text/x-clojure": "clojure", + "text/wasm": { name: "text" }, + "text/html": { name: "htmlmixed" } +}; + +function getSourcePath(source) { + if (!source.url) { + return ""; + } + + var _parseURL = (0, _url.parse)(source.url), + path = _parseURL.path, + href = _parseURL.href; + // for URLs like "about:home" the path is null so we pass the full href + + + return path || href; +} + +/** + * Returns amount of lines in the source. If source is a WebAssembly binary, + * the function returns amount of bytes. + */ +function getSourceLineCount(source) { + if (source.isWasm) { + var _ref = source.text, + binary = _ref.binary; + + return binary.length; + } + return source.text != undefined ? source.text.split("\n").length : 0; +} + +/** + * + * Returns Code Mirror mode for source content type + * @param contentType + * @return String + * @memberof utils/source + * @static + */ + +function getMode(source) { + var contentType = source.contentType, + text = source.text, + isWasm = source.isWasm; + + + if (!text || isWasm) { + return { name: "text" }; + } + + // Use HTML mode for files in which the first non whitespace + // character is `<` regardless of extension. + var isHTMLLike = text.match(/^\s* 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + args[_key - 2] = arguments[_key]; + } + + return new Promise((resolve, reject) => { + args.push(response => { + if (response.error) { + reject(response); + } else { + resolve(response); + } + }); + method.apply(context, args); + }); +} + +/** + * @memberof utils/utils + * @static + */ +function endTruncateStr(str, size) { + if (str.length > size) { + return `...${str.slice(str.length - size)}`; + } + return str; +} + +/** + * @memberof utils/utils + * @static + */ +/** + * @memberof utils/utils + * @static + */ +function throttle(func, ms) { + var timeout = void 0, + _this = void 0; + return function () { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + _this = this; + if (!timeout) { + timeout = setTimeout(() => { + func.apply.apply(func, [_this].concat(_toConsumableArray(args))); + timeout = null; + }, ms); + } + }; +} + +function waitForMs(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); +} + +exports.handleError = handleError; +exports.promisify = promisify; +exports.endTruncateStr = endTruncateStr; +exports.throttle = throttle; +exports.waitForMs = waitForMs; + +/***/ }), + +/***/ 235: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +function basename(path) { + return path.split("/").pop(); +} + +function dirname(path) { + var idx = path.lastIndexOf("/"); + return path.slice(0, idx); +} + +function isURL(str) { + return str.indexOf("://") !== -1; +} + +function isAbsolute(str) { + return str[0] === "/"; +} + +function join(base, dir) { + return `${base}/${dir}`; +} + +exports.basename = basename; +exports.dirname = dirname; +exports.isURL = isURL; +exports.isAbsolute = isAbsolute; +exports.join = join; + +/***/ }), + +/***/ 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)) +} + + /***/ }), /***/ 259: @@ -542,6 +1436,770 @@ function escapeRegExp(string) { module.exports = escapeRegExp; +/***/ }), + +/***/ 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; +}; + + +/***/ }), + +/***/ 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; + } +}; + + /***/ }), /***/ 382: @@ -585,6 +2243,18 @@ function baseGetTag(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); + + /***/ }), /***/ 7: @@ -695,6 +2365,35 @@ try { module.exports = g; +/***/ }), + +/***/ 793: +/***/ (function(module, exports) { + +module.exports = function(module) { + if(!module.webpackPolyfill) { + module.deprecate = function() {}; + module.paths = []; + // module.parent = undefined by default + if(!module.children) module.children = []; + Object.defineProperty(module, "loaded", { + enumerable: true, + get: function() { + return module.l; + } + }); + Object.defineProperty(module, "id", { + enumerable: true, + get: function() { + return module.i; + } + }); + module.webpackPolyfill = 1; + } + return module; +}; + + /***/ }), /***/ 8: @@ -711,6 +2410,131 @@ var root = freeGlobal || freeSelf || Function('return this')(); module.exports = root; +/***/ }), + +/***/ 898: +/***/ (function(module, exports, __webpack_require__) { + +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +const { + originalToGeneratedId, + generatedToOriginalId, + isGeneratedId, + isOriginalId +} = __webpack_require__(899); + +const { workerUtils: { WorkerDispatcher } } = __webpack_require__(900); + +const dispatcher = new WorkerDispatcher(); + +const getOriginalURLs = dispatcher.task("getOriginalURLs"); +const getGeneratedLocation = dispatcher.task("getGeneratedLocation"); +const getOriginalLocation = dispatcher.task("getOriginalLocation"); +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, + getOriginalSourceText, + applySourceMap, + clearSourceMaps, + startSourceMapWorker: dispatcher.start.bind(dispatcher), + stopSourceMapWorker: dispatcher.stop.bind(dispatcher) +}; + +/***/ }), + +/***/ 899: +/***/ (function(module, exports, __webpack_require__) { + +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +const md5 = __webpack_require__(248); + +function originalToGeneratedId(originalId) { + const match = originalId.match(/(.*)\/originalSource/); + return match ? match[1] : ""; +} + +function generatedToOriginalId(generatedId, url) { + return `${generatedId}/originalSource-${md5(url)}`; +} + +function isOriginalId(id) { + return !!id.match(/\/originalSource/); +} + +function isGeneratedId(id) { + return !isOriginalId(id); +} + +/** + * Trims the query part or reference identifier of a URL string, if necessary. + */ +function trimUrlQuery(url) { + let length = url.length; + let q1 = url.indexOf("?"); + let q2 = url.indexOf("&"); + let q3 = url.indexOf("#"); + let q = Math.min(q1 != -1 ? q1 : length, q2 != -1 ? q2 : length, q3 != -1 ? q3 : length); + + return url.slice(0, q); +} + +// Map suffix to content type. +const contentMap = { + "js": "text/javascript", + "jsm": "text/javascript", + "ts": "text/typescript", + "tsx": "text/typescript-jsx", + "jsx": "text/jsx", + "coffee": "text/coffeescript", + "elm": "text/elm", + "cljs": "text/x-clojure" +}; + +/** + * Returns the content type for the specified URL. If no specific + * content type can be determined, "text/plain" is returned. + * + * @return String + * The content type. + */ +function getContentType(url) { + url = trimUrlQuery(url); + let dot = url.lastIndexOf("."); + if (dot >= 0) { + let name = url.substring(dot + 1); + if (name in contentMap) { + return contentMap[name]; + } + } + return "text/plain"; +} + +module.exports = { + originalToGeneratedId, + generatedToOriginalId, + isOriginalId, + isGeneratedId, + getContentType, + contentMapForTesting: contentMap +}; + /***/ }), /***/ 9: @@ -824,12 +2648,17 @@ function workerHandler(publicInterface) { try { const response = publicInterface[method].apply(undefined, args); if (response instanceof Promise) { - response.then(val => self.postMessage({ id, response: val }), err => self.postMessage({ id, error: err })); + 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) { - self.postMessage({ id, error }); + // Error can't be sent via postMessage, so be sure to convert to + // string. + self.postMessage({ id, error: error.toString() }); } }; } @@ -892,6 +2721,546 @@ module.exports = { streamingWorkerHandler }; +/***/ }), + +/***/ 916: +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(module, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/*! https://mths.be/punycode v1.4.1 by @mathias */ +;(function(root) { + + /** Detect free variables */ + var freeExports = typeof exports == 'object' && exports && + !exports.nodeType && exports; + var freeModule = typeof module == 'object' && module && + !module.nodeType && module; + var freeGlobal = typeof global == 'object' && global; + if ( + freeGlobal.global === freeGlobal || + freeGlobal.window === freeGlobal || + freeGlobal.self === freeGlobal + ) { + root = freeGlobal; + } + + /** + * The `punycode` object. + * @name punycode + * @type Object + */ + var punycode, + + /** Highest positive signed 32-bit float value */ + maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1 + + /** Bootstring parameters */ + base = 36, + tMin = 1, + tMax = 26, + skew = 38, + damp = 700, + initialBias = 72, + initialN = 128, // 0x80 + delimiter = '-', // '\x2D' + + /** Regular expressions */ + regexPunycode = /^xn--/, + regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars + regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators + + /** Error messages */ + errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' + }, + + /** Convenience shortcuts */ + baseMinusTMin = base - tMin, + floor = Math.floor, + stringFromCharCode = String.fromCharCode, + + /** Temporary variable */ + key; + + /*--------------------------------------------------------------------------*/ + + /** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ + function error(type) { + throw new RangeError(errors[type]); + } + + /** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ + function map(array, fn) { + var length = array.length; + var result = []; + while (length--) { + result[length] = fn(array[length]); + } + return result; + } + + /** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {Array} A new string of characters returned by the callback + * function. + */ + function mapDomain(string, fn) { + var parts = string.split('@'); + var result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + string = parts[1]; + } + // Avoid `split(regex)` for IE8 compatibility. See #17. + string = string.replace(regexSeparators, '\x2E'); + var labels = string.split('.'); + var encoded = map(labels, fn).join('.'); + return result + encoded; + } + + /** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ + function ucs2decode(string) { + var output = [], + counter = 0, + length = string.length, + value, + extra; + while (counter < length) { + value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // high surrogate, and there is a next character + extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { // low surrogate + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // unmatched surrogate; only append this code unit, in case the next + // code unit is the high surrogate of a surrogate pair + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; + } + + /** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ + function ucs2encode(array) { + return map(array, function(value) { + var output = ''; + if (value > 0xFFFF) { + value -= 0x10000; + output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); + value = 0xDC00 | value & 0x3FF; + } + output += stringFromCharCode(value); + return output; + }).join(''); + } + + /** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ + function basicToDigit(codePoint) { + if (codePoint - 48 < 10) { + return codePoint - 22; + } + if (codePoint - 65 < 26) { + return codePoint - 65; + } + if (codePoint - 97 < 26) { + return codePoint - 97; + } + return base; + } + + /** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ + function digitToBasic(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); + } + + /** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ + function adapt(delta, numPoints, firstTime) { + var k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); + } + + /** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ + function decode(input) { + // Don't use UCS-2 + var output = [], + inputLength = input.length, + out, + i = 0, + n = initialN, + bias = initialBias, + basic, + j, + index, + oldi, + w, + k, + digit, + t, + /** Cached calculation results */ + baseMinusT; + + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + + for (j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error('not-basic'); + } + output.push(input.charCodeAt(j)); + } + + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. + + for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { + + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + for (oldi = i, w = 1, k = base; /* no condition */; k += base) { + + if (index >= inputLength) { + error('invalid-input'); + } + + digit = basicToDigit(input.charCodeAt(index++)); + + if (digit >= base || digit > floor((maxInt - i) / w)) { + error('overflow'); + } + + i += digit * w; + t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + + if (digit < t) { + break; + } + + baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error('overflow'); + } + + w *= baseMinusT; + + } + + out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error('overflow'); + } + + n += floor(i / out); + i %= out; + + // Insert `n` at position `i` of the output + output.splice(i++, 0, n); + + } + + return ucs2encode(output); + } + + /** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ + function encode(input) { + var n, + delta, + handledCPCount, + basicLength, + bias, + j, + m, + q, + k, + t, + currentValue, + output = [], + /** `inputLength` will hold the number of code points in `input`. */ + inputLength, + /** Cached calculation results */ + handledCPCountPlusOne, + baseMinusT, + qMinusT; + + // Convert the input in UCS-2 to Unicode + input = ucs2decode(input); + + // Cache the length + inputLength = input.length; + + // Initialize the state + n = initialN; + delta = 0; + bias = initialBias; + + // Handle the basic code points + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + if (currentValue < 0x80) { + output.push(stringFromCharCode(currentValue)); + } + } + + handledCPCount = basicLength = output.length; + + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + + // Finish the basic string - if it is not empty - with a delimiter + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + + // All non-basic code points < n have been handled already. Find the next + // larger one: + for (m = maxInt, j = 0; j < inputLength; ++j) { + currentValue = input[j]; + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow + handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + + if (currentValue < n && ++delta > maxInt) { + error('overflow'); + } + + if (currentValue == n) { + // Represent delta as a generalized variable-length integer + for (q = delta, k = base; /* no condition */; k += base) { + t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + if (q < t) { + break; + } + qMinusT = q - t; + baseMinusT = base - t; + output.push( + stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) + ); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; + } + } + + ++delta; + ++n; + + } + return output.join(''); + } + + /** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ + function toUnicode(input) { + return mapDomain(input, function(string) { + return regexPunycode.test(string) + ? decode(string.slice(4).toLowerCase()) + : string; + }); + } + + /** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ + function toASCII(input) { + return mapDomain(input, function(string) { + return regexNonASCII.test(string) + ? 'xn--' + encode(string) + : string; + }); + } + + /*--------------------------------------------------------------------------*/ + + /** Define the public API */ + punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '1.4.1', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode + }; + + /** Expose `punycode` */ + // Some AMD build optimizers, like r.js, check for specific condition patterns + // like the following: + if ( + true + ) { + !(__WEBPACK_AMD_DEFINE_RESULT__ = function() { + return punycode; + }.call(exports, __webpack_require__, exports, module), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else if (freeExports && freeModule) { + if (module.exports == freeExports) { + // in Node.js, io.js, or RingoJS v0.8.0+ + freeModule.exports = punycode; + } else { + // in Narwhal or RingoJS v0.7.0- + for (key in punycode) { + punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); + } + } + } else { + // in Rhino or a web browser + root.punycode = punycode; + } + +}(this)); + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(793)(module), __webpack_require__(792))) + /***/ }) /******/ }); diff --git a/devtools/client/debugger/new/test/mochitest/browser.ini b/devtools/client/debugger/new/test/mochitest/browser.ini index 820a481df4f8..fdd4ca27eae8 100644 --- a/devtools/client/debugger/new/test/mochitest/browser.ini +++ b/devtools/client/debugger/new/test/mochitest/browser.ini @@ -11,6 +11,7 @@ support-files = examples/sourcemaps2/main.min.js examples/sourcemaps2/main.js examples/sourcemaps2/main.js.map + examples/doc-async.html examples/doc-asm.html examples/doc-scripts.html examples/doc-script-mutate.html @@ -26,6 +27,7 @@ support-files = examples/doc-sources.html examples/doc-return-values.html examples/asm.js + examples/async.js examples/bogus-map.js examples/entry.js examples/exceptions.js @@ -42,6 +44,7 @@ support-files = examples/script-switching-01.js examples/times2.js +[browser_dbg-async-stepping.js] [browser_dbg-breaking.js] [browser_dbg-breaking-from-console.js] [browser_dbg-breakpoints.js] diff --git a/devtools/client/debugger/new/test/mochitest/browser_dbg-async-stepping.js b/devtools/client/debugger/new/test/mochitest/browser_dbg-async-stepping.js new file mode 100644 index 000000000000..4871fcd8a50c --- /dev/null +++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-async-stepping.js @@ -0,0 +1,30 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +// Tests async stepping will: +// 1. step over await statements +// 2. step into async functions +// 3. step out of async functions +add_task(async function test() { + Services.prefs.setBoolPref("devtools.debugger.features.async-stepping", true); + const dbg = await initDebugger("doc-async.html", "async"); + + await selectSource(dbg, "async"); + await addBreakpoint(dbg, "async", 8); + invokeInTab("main"); + + await waitForPaused(dbg); + assertPausedLocation(dbg); + assertDebugLine(dbg, 8); + + await stepOver(dbg); + assertPausedLocation(dbg); + assertDebugLine(dbg, 9); +}); + +registerCleanupFunction(() => { + Services.prefs.clearUserPref( + "devtools.debugger.features.async-stepping", + false + ); +}); diff --git a/devtools/client/debugger/new/test/mochitest/browser_dbg-breakpoints-reloading.js b/devtools/client/debugger/new/test/mochitest/browser_dbg-breakpoints-reloading.js index bfe767692b95..0eaa0bf78d6a 100644 --- a/devtools/client/debugger/new/test/mochitest/browser_dbg-breakpoints-reloading.js +++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-breakpoints-reloading.js @@ -32,7 +32,7 @@ add_task(function*() { yield selectSource(dbg, source.url); yield addBreakpoint(dbg, 5); - yield addBreakpoint(dbg, 2); + yield addBreakpoint(dbg, 4); const syncedBps = waitForDispatch(dbg, "SYNC_BREAKPOINT", 2); yield reload(dbg, "simple1"); diff --git a/devtools/client/debugger/new/test/mochitest/browser_dbg-editor-gutter.js b/devtools/client/debugger/new/test/mochitest/browser_dbg-editor-gutter.js index 12a771c312b1..80058214f350 100644 --- a/devtools/client/debugger/new/test/mochitest/browser_dbg-editor-gutter.js +++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-editor-gutter.js @@ -16,12 +16,16 @@ function getLineEl(dbg, line) { function assertEditorBreakpoint(dbg, line, shouldExist) { const exists = !!getLineEl(dbg, line).querySelector(".new-breakpoint"); - ok(exists === shouldExist, - "Breakpoint " + (shouldExist ? "exists" : "does not exist") + - " on line " + line); + ok( + exists === shouldExist, + "Breakpoint " + + (shouldExist ? "exists" : "does not exist") + + " on line " + + line + ); } -add_task(function* () { +add_task(function*() { const dbg = yield initDebugger("doc-scripts.html"); const { selectors: { getBreakpoints, getBreakpoint }, getState } = dbg; const source = findSource(dbg, "simple1.js"); @@ -39,26 +43,4 @@ add_task(function* () { yield waitForDispatch(dbg, "REMOVE_BREAKPOINT"); is(getBreakpoints(getState()).size, 0, "No breakpoints exist"); assertEditorBreakpoint(dbg, 4, false); - - // Test that a breakpoint icon slides down to the correct line. - clickGutter(dbg, 2); - yield waitForDispatch(dbg, "ADD_BREAKPOINT"); - is(getBreakpoints(getState()).size, 1, "One breakpoint exists"); - ok(getBreakpoint(getState(), { sourceId: source.id, line: 4 }), - "Breakpoint has correct line"); - assertEditorBreakpoint(dbg, 2, false); - assertEditorBreakpoint(dbg, 4, true); - - // Do the same sliding and make sure it works if there's already a - // breakpoint. - clickGutter(dbg, 2); - yield waitForDispatch(dbg, "ADD_BREAKPOINT"); - is(getBreakpoints(getState()).size, 1, "One breakpoint exists"); - assertEditorBreakpoint(dbg, 2, false); - assertEditorBreakpoint(dbg, 4, true); - - clickGutter(dbg, 4); - yield waitForDispatch(dbg, "REMOVE_BREAKPOINT"); - is(getBreakpoints(getState()).size, 0, "No breakpoints exist"); - assertEditorBreakpoint(dbg, 4, false); }); diff --git a/devtools/client/debugger/new/test/mochitest/browser_dbg-editor-highlight.js b/devtools/client/debugger/new/test/mochitest/browser_dbg-editor-highlight.js index 3aebe21d4162..63f1a9c4900e 100644 --- a/devtools/client/debugger/new/test/mochitest/browser_dbg-editor-highlight.js +++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-editor-highlight.js @@ -44,7 +44,7 @@ add_task(function*() { // Make sure the source is in the loading state, wait for it to be // fully loaded, and check the highlighted line. const simple1 = findSource(dbg, "simple1.js"); - ok(getSource(getState(), simple1.id).get("loading")); + ok(getSource(getState(), simple1.id).get("loadedState")); yield waitForDispatch(dbg, "LOAD_SOURCE_TEXT"); ok(getSource(getState(), simple1.id).get("text")); assertHighlightLocation(dbg, "simple1.js", 6); diff --git a/devtools/client/debugger/new/test/mochitest/browser_dbg-expressions.js b/devtools/client/debugger/new/test/mochitest/browser_dbg-expressions.js index b3c67a92fcf3..055b3793030e 100644 --- a/devtools/client/debugger/new/test/mochitest/browser_dbg-expressions.js +++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-expressions.js @@ -20,6 +20,16 @@ function getValue(dbg, index) { return findElement(dbg, "expressionValue", index).innerText; } +function assertEmptyValue(dbg, index) { + const value = findElement(dbg, "expressionValue", index); + if (value) { + is(value.innerText, ""); + return; + } + + is(value, null); +} + function toggleExpression(dbg, index) { findElement(dbg, "expressionNode", index).click(); } @@ -55,8 +65,9 @@ add_task(function*() { yield editExpression(dbg, "oo"); is(getLabel(dbg, 1), "foo()"); + // There is no "value" element for functions. - is(findElement(dbg, "expressionValue", 1), null); + assertEmptyValue(dbg, 1); yield addExpression(dbg, "location"); is(getLabel(dbg, 2), "location"); @@ -68,5 +79,6 @@ add_task(function*() { yield deleteExpression(dbg, "foo"); yield deleteExpression(dbg, "location"); + is(findAllElements(dbg, "expressionNodes").length, 0); }); diff --git a/devtools/client/debugger/new/test/mochitest/examples/async.js b/devtools/client/debugger/new/test/mochitest/examples/async.js new file mode 100644 index 000000000000..73d1675b862b --- /dev/null +++ b/devtools/client/debugger/new/test/mochitest/examples/async.js @@ -0,0 +1,10 @@ +async function thing(inc) { + return new Promise(resolve => { + setTimeout(resolve, 10); + }); +} + +async function main() { + await thing(1); + await thing(2); +} diff --git a/devtools/client/debugger/new/test/mochitest/examples/doc-async.html b/devtools/client/debugger/new/test/mochitest/examples/doc-async.html new file mode 100644 index 000000000000..e786cdd153dc --- /dev/null +++ b/devtools/client/debugger/new/test/mochitest/examples/doc-async.html @@ -0,0 +1,13 @@ + + + + + + Async + + + + + + diff --git a/devtools/client/debugger/new/test/mochitest/head.js b/devtools/client/debugger/new/test/mochitest/head.js index 221c56f436ad..0821096309ac 100644 --- a/devtools/client/debugger/new/test/mochitest/head.js +++ b/devtools/client/debugger/new/test/mochitest/head.js @@ -38,6 +38,10 @@ Services.scriptloader.loadSubScript( this ); var { Toolbox } = require("devtools/client/framework/toolbox"); +const sourceUtils = { + isLoaded: source => source.get("loadedState") === "loaded" +}; + const EXAMPLE_URL = "http://example.com/browser/devtools/client/debugger/new/test/mochitest/examples/"; @@ -214,7 +218,8 @@ function waitForElement(dbg, selector) { function waitForSelectedSource(dbg, sourceId) { return waitForState(dbg, state => { const source = dbg.selectors.getSelectedSource(state); - const isLoaded = source && source.has("loading") && !source.get("loading"); + const isLoaded = + source && source.has("loadedState") && sourceUtils.isLoaded(source); if (sourceId) { return isLoaded && sourceId == source.get("id"); } @@ -240,9 +245,12 @@ function assertPausedLocation(dbg) { // Check the pause location const pause = getPause(getState()); const pauseLine = pause && pause.frame && pause.frame.location.line; + assertDebugLine(dbg, pauseLine); +} +function assertDebugLine(dbg, line) { // Check the debug line - const lineInfo = getCM(dbg).lineInfo(pauseLine - 1); + const lineInfo = getCM(dbg).lineInfo(line - 1); ok( lineInfo.wrapClass.includes("debug-line"), "Line is highlighted as paused" @@ -331,7 +339,7 @@ function isTopFrameSelected(dbg, state) { return false; } - const isLoaded = source.has("loading") && !source.get("loading"); + const isLoaded = source.has("loadedState") && sourceUtils.isLoaded(source); if (!isLoaded) { return false; } diff --git a/devtools/client/locales/en-US/debugger.properties b/devtools/client/locales/en-US/debugger.properties index 55839f792d80..46faec469ab4 100644 --- a/devtools/client/locales/en-US/debugger.properties +++ b/devtools/client/locales/en-US/debugger.properties @@ -14,6 +14,11 @@ # that collapses the left and right panes in the debugger UI. collapsePanes=Collapse panes +# LOCALIZATION NOTE (copySource): This is the text that appears in the +# context menu to copy the selected source of file open. +copySource=Copy +copySource.accesskey=y + # LOCALIZATION NOTE (copySourceUrl): This is the text that appears in the # context menu to copy the source URL of file open. copySourceUrl=Copy Source Url @@ -52,6 +57,10 @@ stepInTooltip=Step In %S # button that steps out of a function call. stepOutTooltip=Step Out %S +# LOCALIZATION NOTE (workersHeader): The text to display in the events +# header. +workersHeader=Workers + # LOCALIZATION NOTE (noWorkersText): The text to display in the workers list # when there are no workers. noWorkersText=This page has no workers. @@ -430,6 +439,11 @@ watchExpressions.refreshButton=Refresh # a mac we use the unicode character. welcome.search=%S to search for sources +# LOCALIZATION NOTE (welcome.findInFiles): The center pane welcome panel's +# search prompt. e.g. cmd+f to search for files. On windows, it's ctrl+shift+f, on +# a mac we use the unicode character. +welcome.findInFiles=%S to find in files + # LOCALIZATION NOTE (sourceSearch.search): The center pane Source Search # prompt for searching for files. sourceSearch.search=Search Sources… diff --git a/devtools/client/preferences/debugger.js b/devtools/client/preferences/debugger.js index 9b9afcb853e8..489a00986bb5 100644 --- a/devtools/client/preferences/debugger.js +++ b/devtools/client/preferences/debugger.js @@ -38,5 +38,5 @@ 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.features.async-stepping", false); pref("devtools.debugger.project-text-search-enabled", true); - diff --git a/dom/base/test/test_anonymousContent_canvas.html b/dom/base/test/test_anonymousContent_canvas.html index 6498c9f6bb42..1768251a6f84 100644 --- a/dom/base/test/test_anonymousContent_canvas.html +++ b/dom/base/test/test_anonymousContent_canvas.html @@ -43,14 +43,16 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1212477 "Get a context using unexisting id should throw" ); - let webgl = anonymousContent.getCanvasContext("canvas-webgl", "webgl"); + const normalWebGL = document.createElement('canvas').getContext('webgl'); + if (normalWebGL) { + let webgl = anonymousContent.getCanvasContext("canvas-webgl", "webgl"); - is(webgl.toString(), "[object WebGLRenderingContext]", - "WebGL Context is returned properly"); - - is(webgl.canvas, null, - "WebGL context's canvas property is null in anonymous content"); + is(webgl.toString(), "[object WebGLRenderingContext]", + "WebGL Context is returned properly"); + is(webgl.canvas, null, + "WebGL context's canvas property is null in anonymous content"); + } chromeDocument.removeAnonymousContent(anonymousContent); diff --git a/dom/canvas/CanvasRenderingContext2D.cpp b/dom/canvas/CanvasRenderingContext2D.cpp index 284b6c705891..4eca8b77eae6 100644 --- a/dom/canvas/CanvasRenderingContext2D.cpp +++ b/dom/canvas/CanvasRenderingContext2D.cpp @@ -5184,107 +5184,6 @@ CanvasRenderingContext2D::DrawImage(const CanvasImageSource& aImage, nsLayoutUtils::DirectDrawInfo drawInfo; -#ifdef USE_SKIA_GPU - if (mRenderingMode == RenderingMode::OpenGLBackendMode && - mIsSkiaGL && - !srcSurf && - aImage.IsHTMLVideoElement() && - AllowOpenGLCanvas()) { - mozilla::gl::GLContext* gl = gfxPlatform::GetPlatform()->GetSkiaGLGlue()->GetGLContext(); - MOZ_ASSERT(gl); - - HTMLVideoElement* video = &aImage.GetAsHTMLVideoElement(); - if (!video) { - return; - } - - if (video->ContainsRestrictedContent()) { - aError.Throw(NS_ERROR_NOT_AVAILABLE); - return; - } - - uint16_t readyState; - if (NS_SUCCEEDED(video->GetReadyState(&readyState)) && - readyState < nsIDOMHTMLMediaElement::HAVE_CURRENT_DATA) { - // still loading, just return - return; - } - - // If it doesn't have a principal, just bail - nsCOMPtr principal = video->GetCurrentVideoPrincipal(); - if (!principal) { - aError.Throw(NS_ERROR_NOT_AVAILABLE); - return; - } - - mozilla::layers::ImageContainer* container = video->GetImageContainer(); - if (!container) { - aError.Throw(NS_ERROR_NOT_AVAILABLE); - return; - } - - AutoLockImage lockImage(container); - layers::Image* srcImage = lockImage.GetImage(); - if (!srcImage) { - aError.Throw(NS_ERROR_NOT_AVAILABLE); - return; - } - - { - if (!gl->MakeCurrent()) { - aError.Throw(NS_ERROR_NOT_AVAILABLE); - return; - } - GLuint videoTexture = 0; - gl->fGenTextures(1, &videoTexture); - // skiaGL expect upload on drawing, and uses texture 0 for texturing, - // so we must active texture 0 and bind the texture for it. - gl->fActiveTexture(LOCAL_GL_TEXTURE0); - const gl::ScopedBindTexture scopeBindTexture(gl, videoTexture); - - gl->fTexImage2D(LOCAL_GL_TEXTURE_2D, 0, LOCAL_GL_RGB, srcImage->GetSize().width, srcImage->GetSize().height, 0, LOCAL_GL_RGB, LOCAL_GL_UNSIGNED_SHORT_5_6_5, nullptr); - gl->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_WRAP_S, LOCAL_GL_CLAMP_TO_EDGE); - gl->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_WRAP_T, LOCAL_GL_CLAMP_TO_EDGE); - gl->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_MAG_FILTER, LOCAL_GL_LINEAR); - gl->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_MIN_FILTER, LOCAL_GL_LINEAR); - - const gl::OriginPos destOrigin = gl::OriginPos::TopLeft; - bool ok = gl->BlitHelper()->BlitImageToTexture(srcImage, srcImage->GetSize(), - videoTexture, LOCAL_GL_TEXTURE_2D, - destOrigin); - if (ok) { - NativeSurface texSurf; - texSurf.mType = NativeSurfaceType::OPENGL_TEXTURE; - texSurf.mFormat = SurfaceFormat::R5G6B5_UINT16; - texSurf.mSize.width = srcImage->GetSize().width; - texSurf.mSize.height = srcImage->GetSize().height; - texSurf.mSurface = (void*)((uintptr_t)videoTexture); - - srcSurf = mTarget->CreateSourceSurfaceFromNativeSurface(texSurf); - if (!srcSurf) { - gl->fDeleteTextures(1, &videoTexture); - } - imgSize.width = srcImage->GetSize().width; - imgSize.height = srcImage->GetSize().height; - - int32_t displayWidth = video->VideoWidth(); - int32_t displayHeight = video->VideoHeight(); - aSw *= (double)imgSize.width / (double)displayWidth; - aSh *= (double)imgSize.height / (double)displayHeight; - } else { - gl->fDeleteTextures(1, &videoTexture); - } - } - - srcImage = nullptr; - - if (mCanvasElement) { - CanvasUtils::DoDrawImageSecurityCheck(mCanvasElement, - principal, false, - video->GetCORSMode() != CORS_NONE); - } - } -#endif if (!srcSurf) { // The canvas spec says that drawImage should draw the first frame // of animated images. We also don't want to rasterize vector images. diff --git a/dom/canvas/TexUnpackBlob.cpp b/dom/canvas/TexUnpackBlob.cpp index b8672962c77b..4799ffdd3b48 100644 --- a/dom/canvas/TexUnpackBlob.cpp +++ b/dom/canvas/TexUnpackBlob.cpp @@ -639,6 +639,10 @@ TexUnpackImage::TexOrSubImage(bool isSubImage, bool needsRespec, const char* fun fallbackReason = "depth is not 1"; break; } + if (xOffset != 0 || yOffset != 0 || zOffset != 0) { + fallbackReason = "x/y/zOffset is not 0"; + break; + } if (webgl->mPixelStore_UnpackSkipPixels || webgl->mPixelStore_UnpackSkipRows || @@ -701,9 +705,7 @@ TexUnpackImage::TexOrSubImage(bool isSubImage, bool needsRespec, const char* fun const gfx::IntSize destSize(mWidth, mHeight); const auto dstOrigin = (webgl->mPixelStore_FlipY ? gl::OriginPos::TopLeft : gl::OriginPos::BottomLeft); - if (!gl->BlitHelper()->BlitImageToFramebuffer(mImage, destSize, scopedFB.FB(), - dstOrigin)) - { + if (!gl->BlitHelper()->BlitImageToFramebuffer(mImage, destSize, dstOrigin)) { fallbackReason = "likely bug: failed to blit"; break; } diff --git a/dom/canvas/WebGLContextValidate.cpp b/dom/canvas/WebGLContextValidate.cpp index c29f7c7dcb47..54eee217dfd9 100644 --- a/dom/canvas/WebGLContextValidate.cpp +++ b/dom/canvas/WebGLContextValidate.cpp @@ -721,6 +721,12 @@ WebGLContext::InitAndValidateGL(FailureReason* const out_failReason) return false; } + if (!gl->IsSupported(GLFeature::vertex_array_object)) { + *out_failReason = { "FEATURE_FAILURE_WEBGL_VAOS", + "Requires vertex_array_object." }; + return false; + } + mDefaultVertexArray = WebGLVertexArray::Create(this); mDefaultVertexArray->mAttribs.SetLength(mGLMaxVertexAttribs); mBoundVertexArray = mDefaultVertexArray; diff --git a/dom/canvas/WebGLTextureUpload.cpp b/dom/canvas/WebGLTextureUpload.cpp index 4bc5d9a8a0d5..8d0aed176101 100644 --- a/dom/canvas/WebGLTextureUpload.cpp +++ b/dom/canvas/WebGLTextureUpload.cpp @@ -1833,8 +1833,11 @@ ScopedCopyTexImageSource::ScopedCopyTexImageSource(WebGLContext* webgl, // Draw-blit rgbaTex into rgbaFB. const gfx::IntSize srcSize(srcWidth, srcHeight); - gl->BlitHelper()->DrawBlitTextureToFramebuffer(scopedTex.Texture(), rgbaFB, - srcSize, srcSize); + { + const gl::ScopedBindFramebuffer bindFB(gl, rgbaFB); + gl->BlitHelper()->DrawBlitTextureToFramebuffer(scopedTex.Texture(), srcSize, + srcSize); + } // Restore Tex2D binding and destroy the temp tex. scopedBindTex.Unwrap(); diff --git a/dom/canvas/test/reftest/reftest.list b/dom/canvas/test/reftest/reftest.list index 0ea8f1e8aaf6..cdf013442f8d 100644 --- a/dom/canvas/test/reftest/reftest.list +++ b/dom/canvas/test/reftest/reftest.list @@ -176,4 +176,4 @@ include filters/reftest.list == clipped-dash-stroke-rect.html clipped-dash-stroke-rect-ref.html # Bug 1377303 -== visible-occluded.html visible-occluded-ref.html +skip-if(Android) == visible-occluded.html visible-occluded-ref.html diff --git a/dom/canvas/test/webgl-mochitest/mochi-to-testcase.py b/dom/canvas/test/webgl-mochitest/mochi-to-testcase.py index 919ba232804f..a00b3e4da705 100644 --- a/dom/canvas/test/webgl-mochitest/mochi-to-testcase.py +++ b/dom/canvas/test/webgl-mochitest/mochi-to-testcase.py @@ -50,6 +50,10 @@ function todo(val, text) { debug(status + text); } +function addLoadEvent(func) { + window.addEventListener('load', func, false); +} + SimpleTest = { waitForExplicitFinish: function() {}, finish: function() {}, diff --git a/dom/canvas/test/webgl-mochitest/mochitest.ini b/dom/canvas/test/webgl-mochitest/mochitest.ini index 7c204d678d0a..caf45281ea31 100644 --- a/dom/canvas/test/webgl-mochitest/mochitest.ini +++ b/dom/canvas/test/webgl-mochitest/mochitest.ini @@ -99,13 +99,10 @@ skip-if = toolkit == 'android' #bug 865443- seperate suite - the non_conf* tests skip-if = toolkit == 'android' #bug 865443- seperate suite - the non_conf* tests pass except for one on armv6 tests [test_fuzzing_bugs.html] [test_video_fastpath_mp4.html] -fail-if = (os == 'mac') || (os == 'win' && !(e10s && os_version == '6.1')) # no fast path on windows yet (bug 1373165 or 1373770), and mac (bug 1373669) +fail-if = (os == 'win' && os_version == '6.1' && !e10s) [test_video_fastpath_theora.html] -fail-if = (os == 'win' && os_version != '6.1') # no fast path on windows yet (bug 1373192), and mac (bug 1373702) [test_video_fastpath_vp8.html] -fail-if = (os == 'win' && os_version != '6.1') # no fast path on windows yet (bug 1373192), and mac (bug 1373702) [test_video_fastpath_vp9.html] -fail-if = (os == 'win' && os_version != '6.1') # no fast path on windows yet (bug 1373192), and mac (bug 1373702) [test_webglcontextcreationerror.html] [test_webgl_fingerprinting_resistance.html] fail-if = (os == 'mac') || (os == 'win') # on try server, LOCAL_GL_MAX_CUBE_MAP_TEXTURE_SIZE = 512 on mac and LOCAL_GL_ALIASED_LINE_WIDTH_RANGE = [1, 1] on win diff --git a/dom/media/ipc/VideoDecoderManagerParent.cpp b/dom/media/ipc/VideoDecoderManagerParent.cpp index 70707fafdf80..c267383d0838 100644 --- a/dom/media/ipc/VideoDecoderManagerParent.cpp +++ b/dom/media/ipc/VideoDecoderManagerParent.cpp @@ -39,9 +39,12 @@ using namespace gfx; SurfaceDescriptorGPUVideo VideoDecoderManagerParent::StoreImage(Image* aImage, TextureClient* aTexture) { - mImageMap[aTexture->GetSerial()] = aImage; - mTextureMap[aTexture->GetSerial()] = aTexture; - return SurfaceDescriptorGPUVideo(aTexture->GetSerial()); + SurfaceDescriptorGPUVideo ret; + aTexture->GPUVideoDesc(&ret); + + mImageMap[ret.handle()] = aImage; + mTextureMap[ret.handle()] = aTexture; + return Move(ret); } StaticRefPtr sVideoDecoderManagerThread; diff --git a/dom/media/ipc/VideoDecoderParent.cpp b/dom/media/ipc/VideoDecoderParent.cpp index e5c31deb00fc..400b98b8fda2 100644 --- a/dom/media/ipc/VideoDecoderParent.cpp +++ b/dom/media/ipc/VideoDecoderParent.cpp @@ -199,7 +199,7 @@ VideoDecoderParent::ProcessDecodedData( video->mDisplay, texture ? texture->GetSize() : IntSize(), texture ? mParent->StoreImage(video->mImage, texture) - : SurfaceDescriptorGPUVideo(0), + : SurfaceDescriptorGPUVideo(0, null_t()), video->mFrameID); Unused << SendOutput(output); } diff --git a/gfx/2d/MacIOSurface.cpp b/gfx/2d/MacIOSurface.cpp index 013859ae22b4..8f04cfa7d682 100644 --- a/gfx/2d/MacIOSurface.cpp +++ b/gfx/2d/MacIOSurface.cpp @@ -188,7 +188,7 @@ CFStringRef MacIOSurfaceLib::GetIOConst(const char* symbole) { void MacIOSurfaceLib::LoadLibrary() { if (isLoaded) { return; - } + } isLoaded = true; sIOSurfaceFramework = dlopen(IOSURFACE_FRAMEWORK_PATH, RTLD_LAZY | RTLD_LOCAL); @@ -278,7 +278,7 @@ void MacIOSurfaceLib::CloseLibrary() { sCoreVideoFramework = nullptr; } -MacIOSurface::MacIOSurface(const void* aIOSurfacePtr, +MacIOSurface::MacIOSurface(IOSurfacePtr aIOSurfacePtr, double aContentsScaleFactor, bool aHasAlpha) : mIOSurfacePtr(aIOSurfacePtr) , mContentsScaleFactor(aContentsScaleFactor) @@ -322,10 +322,10 @@ already_AddRefed MacIOSurface::CreateIOSurface(int aWidth, int aHe ::CFDictionaryAddValue(props, MacIOSurfaceLib::kPropHeight, cfHeight); ::CFRelease(cfHeight); - ::CFDictionaryAddValue(props, MacIOSurfaceLib::kPropBytesPerElem, + ::CFDictionaryAddValue(props, MacIOSurfaceLib::kPropBytesPerElem, cfBytesPerElem); ::CFRelease(cfBytesPerElem); - ::CFDictionaryAddValue(props, MacIOSurfaceLib::kPropIsGlobal, + ::CFDictionaryAddValue(props, MacIOSurfaceLib::kPropIsGlobal, kCFBooleanTrue); IOSurfacePtr surfaceRef = MacIOSurfaceLib::IOSurfaceCreate(props); @@ -348,7 +348,7 @@ already_AddRefed MacIOSurface::CreateIOSurface(int aWidth, int aHe already_AddRefed MacIOSurface::LookupSurface(IOSurfaceID aIOSurfaceID, double aContentsScaleFactor, - bool aHasAlpha) { + bool aHasAlpha) { if (!MacIOSurfaceLib::isInit() || aContentsScaleFactor <= 0) return nullptr; @@ -368,11 +368,11 @@ already_AddRefed MacIOSurface::LookupSurface(IOSurfaceID aIOSurfac return ioSurface.forget(); } -IOSurfaceID MacIOSurface::GetIOSurfaceID() { +IOSurfaceID MacIOSurface::GetIOSurfaceID() { return MacIOSurfaceLib::IOSurfaceGetID(mIOSurfacePtr); } -void* MacIOSurface::GetBaseAddress() { +void* MacIOSurface::GetBaseAddress() { return MacIOSurfaceLib::IOSurfaceGetBaseAddress(mIOSurfacePtr); } @@ -510,6 +510,18 @@ MacIOSurface::GetReadFormat() } } +CGLError +MacIOSurface::CGLTexImageIOSurface2D(CGLContextObj ctx, + GLenum target, GLenum internalFormat, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + GLuint plane) const +{ + return MacIOSurfaceLib::CGLTexImageIOSurface2D(ctx, target, internalFormat, width, + height, format, type, mIOSurfacePtr, + plane); +} + CGLError MacIOSurface::CGLTexImageIOSurface2D(mozilla::gl::GLContext* aGL, CGLContextObj ctx, @@ -577,15 +589,9 @@ MacIOSurface::CGLTexImageIOSurface2D(mozilla::gl::GLContext* aGL, } } - return MacIOSurfaceLib::CGLTexImageIOSurface2D(ctx, - LOCAL_GL_TEXTURE_RECTANGLE_ARB, - internalFormat, - GetDevicePixelWidth(plane), - GetDevicePixelHeight(plane), - format, - type, - mIOSurfacePtr, - plane); + return CGLTexImageIOSurface2D(ctx, LOCAL_GL_TEXTURE_RECTANGLE_ARB, internalFormat, + GetDevicePixelWidth(plane), GetDevicePixelHeight(plane), + format, type, plane); } static diff --git a/gfx/2d/MacIOSurface.h b/gfx/2d/MacIOSurface.h index f4630ee79605..cf0882c46643 100644 --- a/gfx/2d/MacIOSurface.h +++ b/gfx/2d/MacIOSurface.h @@ -97,7 +97,7 @@ public: double aContentsScaleFactor = 1.0, bool aHasAlpha = true); - explicit MacIOSurface(const void *aIOSurfacePtr, + explicit MacIOSurface(IOSurfacePtr aIOSurfacePtr, double aContentsScaleFactor = 1.0, bool aHasAlpha = true); ~MacIOSurface(); @@ -130,6 +130,11 @@ public: CGLContextObj ctxt, size_t plane, mozilla::gfx::SurfaceFormat* aOutReadFormat = nullptr); + CGLError CGLTexImageIOSurface2D(CGLContextObj ctxt, + GLenum target, GLenum internalFormat, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + GLuint plane) const; already_AddRefed GetAsSurface(); CGContextRef CreateIOSurfaceContext(); @@ -144,7 +149,7 @@ public: private: friend class nsCARenderer; - const void* mIOSurfacePtr; + const IOSurfacePtr mIOSurfacePtr; double mContentsScaleFactor; bool mHasAlpha; }; diff --git a/gfx/angle/src/libANGLE/Stream.cpp b/gfx/angle/src/libANGLE/Stream.cpp index 8cf078c21433..80e0604dfce4 100644 --- a/gfx/angle/src/libANGLE/Stream.cpp +++ b/gfx/angle/src/libANGLE/Stream.cpp @@ -125,7 +125,7 @@ Error Stream::createConsumerGLTextureExternal(const AttributeMap &attributes, gl ASSERT(mPlanes[0].texture != nullptr); mPlanes[0].texture->bindStream(this); mConsumerType = ConsumerType::GLTextureRGB; - mPlaneCount = 1; + mPlaneCount = 1; } else { @@ -163,9 +163,9 @@ Error Stream::createConsumerGLTextureExternal(const AttributeMap &attributes, gl Error Stream::createProducerD3D11TextureNV12(const AttributeMap &attributes) { ASSERT(mState == EGL_STREAM_STATE_CONNECTING_KHR); - ASSERT(mConsumerType == ConsumerType::GLTextureYUV); + ASSERT(mConsumerType == ConsumerType::GLTextureRGB || + mConsumerType == ConsumerType::GLTextureYUV); ASSERT(mProducerType == ProducerType::NoProducer); - ASSERT(mPlaneCount == 2); mProducerImplementation = mDisplay->getImplementation()->createStreamProducerD3DTextureNV12( mConsumerType, attributes); @@ -175,6 +175,7 @@ Error Stream::createProducerD3D11TextureNV12(const AttributeMap &attributes) return Error(EGL_SUCCESS); } + // Called when the consumer of this stream starts using the stream Error Stream::consumerAcquire() { @@ -226,14 +227,14 @@ bool Stream::isConsumerBoundToContext(const gl::Context *context) const return (context == mContext); } -Error Stream::validateD3D11NV12Texture(void *texture) const +Error Stream::validateD3D11NV12Texture(void *texture, const AttributeMap &attributes) const { ASSERT(mConsumerType == ConsumerType::GLTextureRGB || mConsumerType == ConsumerType::GLTextureYUV); ASSERT(mProducerType == ProducerType::D3D11TextureNV12); ASSERT(mProducerImplementation != nullptr); - return mProducerImplementation->validateD3DNV12Texture(texture); + return mProducerImplementation->validateD3DNV12Texture(texture, attributes); } Error Stream::postD3D11NV12Texture(void *texture, const AttributeMap &attributes) diff --git a/gfx/angle/src/libANGLE/Stream.h b/gfx/angle/src/libANGLE/Stream.h index 799e32690663..94c0e9e00061 100644 --- a/gfx/angle/src/libANGLE/Stream.h +++ b/gfx/angle/src/libANGLE/Stream.h @@ -95,7 +95,7 @@ class Stream final : angle::NonCopyable bool isConsumerBoundToContext(const gl::Context *context) const; // Producer methods - Error validateD3D11NV12Texture(void *texture) const; + Error validateD3D11NV12Texture(void *texture, const AttributeMap &attributes) const; Error postD3D11NV12Texture(void *texture, const AttributeMap &attributes); private: diff --git a/gfx/angle/src/libANGLE/renderer/StreamProducerImpl.h b/gfx/angle/src/libANGLE/renderer/StreamProducerImpl.h index 1915bf75d3ea..7773a88d6d6d 100644 --- a/gfx/angle/src/libANGLE/renderer/StreamProducerImpl.h +++ b/gfx/angle/src/libANGLE/renderer/StreamProducerImpl.h @@ -23,7 +23,7 @@ class StreamProducerImpl : angle::NonCopyable // Validates the ability for the producer to accept an arbitrary pointer to a frame. All // pointers should be validated through this function before being used to produce a frame. - virtual egl::Error validateD3DNV12Texture(void *pointer) const = 0; + virtual egl::Error validateD3DNV12Texture(void *pointer, const egl::AttributeMap &attributes) const = 0; // Constructs a frame from an arbitrary external pointer that points to producer specific frame // data. Replaces the internal frame with the new one. diff --git a/gfx/angle/src/libANGLE/renderer/d3d/d3d11/StreamProducerNV12.cpp b/gfx/angle/src/libANGLE/renderer/d3d/d3d11/StreamProducerNV12.cpp index fbbdf552a14a..692664fac16e 100644 --- a/gfx/angle/src/libANGLE/renderer/d3d/d3d11/StreamProducerNV12.cpp +++ b/gfx/angle/src/libANGLE/renderer/d3d/d3d11/StreamProducerNV12.cpp @@ -15,8 +15,83 @@ namespace rx { +static egl::Stream::GLTextureDescription getGLDescFromTex(ID3D11Texture2D* tex, + UINT planeIndex, + const char** const out_error) +{ + *out_error = "Undocumented error"; + + egl::Stream::GLTextureDescription ret = { 0 }; + if (!tex) + { + *out_error = "Texture is null"; + return ret; + } + + D3D11_TEXTURE2D_DESC desc; + tex->GetDesc(&desc); + + if (desc.Width < 1 || desc.Height < 1) + { + *out_error = "Width or height < 1"; + return ret; + } + + ret.width = desc.Width; + ret.height = desc.Height; + ret.mipLevels = 0; + + UINT maxPlaneIndex = 0; + switch (desc.Format) { + case DXGI_FORMAT_NV12: + // The UV plane of NV12 textures has half the width/height of the Y plane + if ((desc.Width % 2) != 0 || (desc.Height % 2) != 0) + { + *out_error = "NV12 tetxures must have even width and height."; + break; // Bad width/height. + } + + maxPlaneIndex = 1; + if (planeIndex == 0) + { + ret.internalFormat = GL_R8; + } + else + { + ret.internalFormat = GL_RG8; + ret.width /= 2; + ret.height /= 2; + } + break; + + case DXGI_FORMAT_R8_UNORM: + ret.internalFormat = GL_R8; + break; + case DXGI_FORMAT_R8G8_UNORM: + ret.internalFormat = GL_RG8; + break; + case DXGI_FORMAT_R8G8B8A8_UNORM: + ret.internalFormat = GL_RGBA8; + break; + + default: + *out_error = "Unsupported format"; + return ret; + } + + if (planeIndex > maxPlaneIndex) + { + // Just kidding, there's no plane out there. + ret.internalFormat = 0; + *out_error = "Plane out of range"; + } + + return ret; +} + + StreamProducerNV12::StreamProducerNV12(Renderer11 *renderer) - : mRenderer(renderer), mTexture(nullptr), mArraySlice(0), mTextureWidth(0), mTextureHeight(0) + : mRenderer(renderer), mTexture(nullptr), mArraySlice(0), mPlaneOffset(0) { } @@ -25,7 +100,7 @@ StreamProducerNV12::~StreamProducerNV12() SafeRelease(mTexture); } -egl::Error StreamProducerNV12::validateD3DNV12Texture(void *pointer) const +egl::Error StreamProducerNV12::validateD3DNV12Texture(void *pointer, const egl::AttributeMap &attributes) const { ID3D11Texture2D *textureD3D = static_cast(pointer); @@ -37,21 +112,14 @@ egl::Error StreamProducerNV12::validateD3DNV12Texture(void *pointer) const return egl::Error(EGL_BAD_PARAMETER, "Texture not created on ANGLE D3D device"); } - // Get the description and validate it - D3D11_TEXTURE2D_DESC desc; - textureD3D->GetDesc(&desc); - if (desc.Format != DXGI_FORMAT_NV12) + const auto planeId = static_cast(attributes.get(EGL_NATIVE_BUFFER_PLANE_OFFSET_IMG, 0)); + const char* errorText; + const auto glDesc = getGLDescFromTex(textureD3D, planeId, &errorText); + if (!glDesc.internalFormat) { - return egl::Error(EGL_BAD_PARAMETER, "Texture format not DXGI_FORMAT_NV12"); - } - if (desc.Width < 1 || desc.Height < 1) - { - return egl::Error(EGL_BAD_PARAMETER, "Texture is of size 0"); - } - if ((desc.Width % 2) != 0 || (desc.Height % 2) != 0) - { - return egl::Error(EGL_BAD_PARAMETER, "Texture dimensions are not even"); + return egl::Error(EGL_BAD_PARAMETER, errorText); } + return egl::Error(EGL_SUCCESS); } @@ -60,33 +128,20 @@ void StreamProducerNV12::postD3DNV12Texture(void *pointer, const egl::AttributeM ASSERT(pointer != nullptr); ID3D11Texture2D *textureD3D = static_cast(pointer); - // Check that the texture originated from our device - ID3D11Device *device; - textureD3D->GetDevice(&device); - - // Get the description - D3D11_TEXTURE2D_DESC desc; - textureD3D->GetDesc(&desc); - // Release the previous texture if there is one SafeRelease(mTexture); mTexture = textureD3D; mTexture->AddRef(); - mTextureWidth = desc.Width; - mTextureHeight = desc.Height; - mArraySlice = static_cast(attributes.get(EGL_D3D_TEXTURE_SUBRESOURCE_ID_ANGLE, 0)); + mPlaneOffset = static_cast(attributes.get(EGL_NATIVE_BUFFER_PLANE_OFFSET_IMG, 0)); + mArraySlice = static_cast(attributes.get(EGL_D3D_TEXTURE_SUBRESOURCE_ID_ANGLE, 0)); } egl::Stream::GLTextureDescription StreamProducerNV12::getGLFrameDescription(int planeIndex) { - // The UV plane of NV12 textures has half the width/height of the Y plane - egl::Stream::GLTextureDescription desc; - desc.width = (planeIndex == 0) ? mTextureWidth : (mTextureWidth / 2); - desc.height = (planeIndex == 0) ? mTextureHeight : (mTextureHeight / 2); - desc.internalFormat = (planeIndex == 0) ? GL_R8 : GL_RG8; - desc.mipLevels = 0; - return desc; + const char* errorText; + return getGLDescFromTex(mTexture, static_cast(planeIndex + mPlaneOffset), + &errorText); } ID3D11Texture2D *StreamProducerNV12::getD3DTexture() diff --git a/gfx/angle/src/libANGLE/renderer/d3d/d3d11/StreamProducerNV12.h b/gfx/angle/src/libANGLE/renderer/d3d/d3d11/StreamProducerNV12.h index 304c9dfe5307..f85c74ab5798 100644 --- a/gfx/angle/src/libANGLE/renderer/d3d/d3d11/StreamProducerNV12.h +++ b/gfx/angle/src/libANGLE/renderer/d3d/d3d11/StreamProducerNV12.h @@ -21,7 +21,7 @@ class StreamProducerNV12 : public StreamProducerImpl StreamProducerNV12(Renderer11 *renderer); ~StreamProducerNV12() override; - egl::Error validateD3DNV12Texture(void *pointer) const override; + egl::Error validateD3DNV12Texture(void *pointer, const egl::AttributeMap &attributes) const override; void postD3DNV12Texture(void *pointer, const egl::AttributeMap &attributes) override; egl::Stream::GLTextureDescription getGLFrameDescription(int planeIndex) override; @@ -36,8 +36,7 @@ class StreamProducerNV12 : public StreamProducerImpl ID3D11Texture2D *mTexture; UINT mArraySlice; - UINT mTextureWidth; - UINT mTextureHeight; + UINT mPlaneOffset; }; } // namespace rx diff --git a/gfx/angle/src/libANGLE/validationEGL.cpp b/gfx/angle/src/libANGLE/validationEGL.cpp index 7ee92e83e69c..6fd23e27a4a9 100644 --- a/gfx/angle/src/libANGLE/validationEGL.cpp +++ b/gfx/angle/src/libANGLE/validationEGL.cpp @@ -1515,9 +1515,22 @@ Error ValidateCreateStreamProducerD3DTextureNV12ANGLE(const Display *display, return Error(EGL_BAD_STATE_KHR, "Stream not in connecting state"); } - if (stream->getConsumerType() != Stream::ConsumerType::GLTextureYUV || - stream->getPlaneCount() != 2) - { + switch (stream->getConsumerType()) { + case Stream::ConsumerType::GLTextureYUV: + if (stream->getPlaneCount() != 2) + { + return Error(EGL_BAD_MATCH, "Incompatible stream consumer type"); + } + break; + + case Stream::ConsumerType::GLTextureRGB: + if (stream->getPlaneCount() != 1) + { + return Error(EGL_BAD_MATCH, "Incompatible stream consumer type"); + } + break; + + default: return Error(EGL_BAD_MATCH, "Incompatible stream consumer type"); } @@ -1552,6 +1565,12 @@ Error ValidateStreamPostD3DTextureNV12ANGLE(const Display *display, return Error(EGL_BAD_PARAMETER, "Invalid subresource index"); } break; + case EGL_NATIVE_BUFFER_PLANE_OFFSET_IMG: + if (value < 0) + { + return Error(EGL_BAD_PARAMETER, "Invalid plane offset"); + } + break; default: return Error(EGL_BAD_ATTRIBUTE, "Invalid attribute"); } @@ -1574,7 +1593,7 @@ Error ValidateStreamPostD3DTextureNV12ANGLE(const Display *display, return egl::Error(EGL_BAD_PARAMETER, "Texture is null"); } - return stream->validateD3D11NV12Texture(texture); + return stream->validateD3D11NV12Texture(texture, attribs); } Error ValidateSwapBuffersWithDamageEXT(const Display *display, diff --git a/gfx/gl/GLBlitHelper.cpp b/gfx/gl/GLBlitHelper.cpp index c504976c8ec0..07711eef2a8a 100644 --- a/gfx/gl/GLBlitHelper.cpp +++ b/gfx/gl/GLBlitHelper.cpp @@ -12,8 +12,11 @@ #include "mozilla/Preferences.h" #include "ImageContainer.h" #include "HeapCopyOfStackArray.h" +#include "mozilla/ArrayUtils.h" +#include "mozilla/gfx/Logging.h" #include "mozilla/gfx/Matrix.h" #include "mozilla/UniquePtr.h" +#include "GPUVideoImage.h" #ifdef MOZ_WIDGET_ANDROID #include "AndroidSurfaceTexture.h" @@ -32,668 +35,607 @@ using mozilla::layers::PlanarYCbCrData; namespace mozilla { namespace gl { -GLBlitHelper::GLBlitHelper(GLContext* gl) - : mGL(gl) - , mTexBlit_Buffer(0) - , mTexBlit_VertShader(0) - , mTex2DBlit_FragShader(0) - , mTex2DRectBlit_FragShader(0) - , mTex2DBlit_Program(0) - , mTex2DRectBlit_Program(0) - , mYFlipLoc(-1) - , mTextureTransformLoc(-1) - , mTexExternalBlit_FragShader(0) - , mTexYUVPlanarBlit_FragShader(0) - , mTexNV12PlanarBlit_FragShader(0) - , mTexExternalBlit_Program(0) - , mTexYUVPlanarBlit_Program(0) - , mTexNV12PlanarBlit_Program(0) - , mFBO(0) - , mSrcTexY(0) - , mSrcTexCb(0) - , mSrcTexCr(0) - , mSrcTexEGL(0) - , mYTexScaleLoc(-1) - , mCbCrTexScaleLoc(-1) - , mYuvColorMatrixLoc(-1) - , mTexWidth(0) - , mTexHeight(0) - , mCurYScale(1.0f) - , mCurCbCrScale(1.0f) +// -- + +const char* const kFragHeader_Tex2D = "\ + #define SAMPLER sampler2D \n\ + #if __VERSION__ >= 130 \n\ + #define TEXTURE texture \n\ + #else \n\ + #define TEXTURE texture2D \n\ + #endif \n\ +"; +const char* const kFragHeader_Tex2DRect = "\ + #define SAMPLER sampler2DRect \n\ + #if __VERSION__ >= 130 \n\ + #define TEXTURE texture \n\ + #else \n\ + #define TEXTURE texture2DRect \n\ + #endif \n\ +"; +const char* const kFragHeader_TexExt = "\ + #extension GL_OES_EGL_image_external : require \n\ + #define SAMPLER samplerExternalOES \n\ + #define TEXTURE texture2D \n\ +"; + +const char* const kFragBody_RGBA = "\ + VARYING vec2 vTexCoord0; \n\ + uniform SAMPLER uTex0; \n\ + \n\ + void main(void) \n\ + { \n\ + FRAG_COLOR = TEXTURE(uTex0, vTexCoord0); \n\ + } \n\ +"; +const char* const kFragBody_CrYCb = "\ + VARYING vec2 vTexCoord0; \n\ + uniform SAMPLER uTex0; \n\ + uniform mat4 uColorMatrix; \n\ + \n\ + void main(void) \n\ + { \n\ + vec4 yuv = vec4(TEXTURE(uTex0, vTexCoord0).gbr, \n\ + 1.0); \n\ + vec4 rgb = uColorMatrix * yuv; \n\ + FRAG_COLOR = vec4(rgb.rgb, 1.0); \n\ + } \n\ +"; +const char* const kFragBody_NV12 = "\ + VARYING vec2 vTexCoord0; \n\ + VARYING vec2 vTexCoord1; \n\ + uniform SAMPLER uTex0; \n\ + uniform SAMPLER uTex1; \n\ + uniform mat4 uColorMatrix; \n\ + \n\ + void main(void) \n\ + { \n\ + vec4 yuv = vec4(TEXTURE(uTex0, vTexCoord0).x, \n\ + TEXTURE(uTex1, vTexCoord1).xy, \n\ + 1.0); \n\ + vec4 rgb = uColorMatrix * yuv; \n\ + FRAG_COLOR = vec4(rgb.rgb, 1.0); \n\ + } \n\ +"; +const char* const kFragBody_PlanarYUV = "\ + VARYING vec2 vTexCoord0; \n\ + VARYING vec2 vTexCoord1; \n\ + uniform SAMPLER uTex0; \n\ + uniform SAMPLER uTex1; \n\ + uniform SAMPLER uTex2; \n\ + uniform mat4 uColorMatrix; \n\ + \n\ + void main(void) \n\ + { \n\ + vec4 yuv = vec4(TEXTURE(uTex0, vTexCoord0).x, \n\ + TEXTURE(uTex1, vTexCoord1).x, \n\ + TEXTURE(uTex2, vTexCoord1).x, \n\ + 1.0); \n\ + vec4 rgb = uColorMatrix * yuv; \n\ + FRAG_COLOR = vec4(rgb.rgb, 1.0); \n\ + } \n\ +"; + +// -- + +ScopedSaveMultiTex::ScopedSaveMultiTex(GLContext* const gl, const uint8_t texCount, + const GLenum texTarget) + : mGL(*gl) + , mTexCount(texCount) + , mTexTarget(texTarget) + , mOldTexUnit(mGL.GetIntAs(LOCAL_GL_ACTIVE_TEXTURE)) { + GLenum texBinding; + switch (mTexTarget) { + case LOCAL_GL_TEXTURE_2D: + texBinding = LOCAL_GL_TEXTURE_BINDING_2D; + break; + case LOCAL_GL_TEXTURE_RECTANGLE: + texBinding = LOCAL_GL_TEXTURE_BINDING_RECTANGLE; + break; + case LOCAL_GL_TEXTURE_EXTERNAL: + texBinding = LOCAL_GL_TEXTURE_BINDING_EXTERNAL; + break; + default: + gfxCriticalError() << "Unhandled texTarget: " << texTarget; + } + + for (uint8_t i = 0; i < mTexCount; i++) { + mGL.fActiveTexture(LOCAL_GL_TEXTURE0 + i); + if (mGL.IsSupported(GLFeature::sampler_objects)) { + mOldTexSampler[i] = mGL.GetIntAs(LOCAL_GL_SAMPLER_BINDING); + mGL.fBindSampler(i, 0); + } + mOldTex[i] = mGL.GetIntAs(texBinding); + } +} + +ScopedSaveMultiTex::~ScopedSaveMultiTex() +{ + for (uint8_t i = 0; i < mTexCount; i++) { + mGL.fActiveTexture(LOCAL_GL_TEXTURE0 + i); + if (mGL.IsSupported(GLFeature::sampler_objects)) { + mGL.fBindSampler(i, mOldTexSampler[i]); + } + mGL.fBindTexture(mTexTarget, mOldTex[i]); + } + mGL.fActiveTexture(mOldTexUnit); +} + +// -- + +class ScopedBindArrayBuffer final +{ + GLContext& mGL; + const GLuint mOldVBO; + +public: + ScopedBindArrayBuffer(GLContext* const gl, const GLuint vbo) + : mGL(*gl) + , mOldVBO(mGL.GetIntAs(LOCAL_GL_ARRAY_BUFFER_BINDING)) + { + mGL.fBindBuffer(LOCAL_GL_ARRAY_BUFFER, vbo); + } + + ~ScopedBindArrayBuffer() + { + mGL.fBindBuffer(LOCAL_GL_ARRAY_BUFFER, mOldVBO); + } +}; + +// -- + +class ScopedBindVAO final +{ + GLContext& mGL; + const GLuint mOldVAO; + +public: + ScopedBindVAO(GLContext* const gl, const GLuint vao) + : mGL(*gl) + , mOldVAO(mGL.GetIntAs(LOCAL_GL_VERTEX_ARRAY_BINDING)) + { + mGL.fBindVertexArray(vao); + } + + ~ScopedBindVAO() + { + mGL.fBindVertexArray(mOldVAO); + } +}; + +// -- + +class ScopedShader final +{ + GLContext& mGL; + const GLuint mName; + +public: + ScopedShader(GLContext* const gl, const GLenum shaderType) + : mGL(*gl) + , mName(mGL.fCreateShader(shaderType)) + { } + + ~ScopedShader() + { + mGL.fDeleteShader(mName); + } + + operator GLuint() const { return mName; } +}; + +// -- + +class SaveRestoreCurrentProgram final +{ + GLContext& mGL; + const GLuint mOld; + +public: + explicit SaveRestoreCurrentProgram(GLContext* const gl) + : mGL(*gl) + , mOld(mGL.GetIntAs(LOCAL_GL_CURRENT_PROGRAM)) + { } + + ~SaveRestoreCurrentProgram() + { + mGL.fUseProgram(mOld); + } +}; + +// -- + +class ScopedDrawBlitState final +{ + GLContext& mGL; + + const bool blend; + const bool cullFace; + const bool depthTest; + const bool dither; + const bool polyOffsFill; + const bool sampleAToC; + const bool sampleCover; + const bool scissor; + const bool stencil; + Maybe rasterizerDiscard; + + realGLboolean colorMask[4]; + GLint viewport[4]; + +public: + ScopedDrawBlitState(GLContext* const gl, const gfx::IntSize& destSize) + : mGL(*gl) + , blend (mGL.PushEnabled(LOCAL_GL_BLEND, false)) + , cullFace (mGL.PushEnabled(LOCAL_GL_CULL_FACE, false)) + , depthTest (mGL.PushEnabled(LOCAL_GL_DEPTH_TEST, false)) + , dither (mGL.PushEnabled(LOCAL_GL_DITHER, true)) + , polyOffsFill(mGL.PushEnabled(LOCAL_GL_POLYGON_OFFSET_FILL, false)) + , sampleAToC (mGL.PushEnabled(LOCAL_GL_SAMPLE_ALPHA_TO_COVERAGE, false)) + , sampleCover (mGL.PushEnabled(LOCAL_GL_SAMPLE_COVERAGE, false)) + , scissor (mGL.PushEnabled(LOCAL_GL_SCISSOR_TEST, false)) + , stencil (mGL.PushEnabled(LOCAL_GL_STENCIL_TEST, false)) + { + if (mGL.IsSupported(GLFeature::transform_feedback2)) { + // Technically transform_feedback2 requires transform_feedback, which actually + // adds RASTERIZER_DISCARD. + rasterizerDiscard = Some(mGL.PushEnabled(LOCAL_GL_RASTERIZER_DISCARD, false)); + } + + mGL.fGetBooleanv(LOCAL_GL_COLOR_WRITEMASK, colorMask); + mGL.fColorMask(true, true, true, true); + + mGL.fGetIntegerv(LOCAL_GL_VIEWPORT, viewport); + mGL.fViewport(0, 0, destSize.width, destSize.height); + } + + ~ScopedDrawBlitState() + { + mGL.SetEnabled(LOCAL_GL_BLEND, blend ); + mGL.SetEnabled(LOCAL_GL_CULL_FACE, cullFace ); + mGL.SetEnabled(LOCAL_GL_DEPTH_TEST, depthTest ); + mGL.SetEnabled(LOCAL_GL_DITHER, dither ); + mGL.SetEnabled(LOCAL_GL_POLYGON_OFFSET_FILL, polyOffsFill); + mGL.SetEnabled(LOCAL_GL_SAMPLE_ALPHA_TO_COVERAGE, sampleAToC ); + mGL.SetEnabled(LOCAL_GL_SAMPLE_COVERAGE, sampleCover ); + mGL.SetEnabled(LOCAL_GL_SCISSOR_TEST, scissor ); + mGL.SetEnabled(LOCAL_GL_STENCIL_TEST, stencil ); + if (rasterizerDiscard) { + mGL.SetEnabled(LOCAL_GL_RASTERIZER_DISCARD, rasterizerDiscard.value()); + } + + mGL.fColorMask(colorMask[0], colorMask[1], colorMask[2], colorMask[3]); + mGL.fViewport(viewport[0], viewport[1], viewport[2], viewport[3]); + } +}; + +// -- + +DrawBlitProg::DrawBlitProg(const GLBlitHelper* const parent, const GLuint prog) + : mParent(*parent) + , mProg(prog) + , mLoc_u1ForYFlip(mParent.mGL->fGetUniformLocation(mProg, "u1ForYFlip")) + , mLoc_uSrcRect(mParent.mGL->fGetUniformLocation(mProg, "uSrcRect")) + , mLoc_uTexSize0(mParent.mGL->fGetUniformLocation(mProg, "uTexSize0")) + , mLoc_uTexSize1(mParent.mGL->fGetUniformLocation(mProg, "uTexSize1")) + , mLoc_uDivisors(mParent.mGL->fGetUniformLocation(mProg, "uDivisors")) + , mLoc_uColorMatrix(mParent.mGL->fGetUniformLocation(mProg, "uColorMatrix")) +{ + MOZ_ASSERT(mLoc_u1ForYFlip != -1); + MOZ_ASSERT(mLoc_uSrcRect != -1); + MOZ_ASSERT(mLoc_uTexSize0 != -1); + if (mLoc_uColorMatrix != -1) { + MOZ_ASSERT(mLoc_uTexSize1 != -1); + MOZ_ASSERT(mLoc_uDivisors != -1); + } +} + +DrawBlitProg::~DrawBlitProg() +{ + const auto& gl = mParent.mGL; + if (!gl->MakeCurrent()) + return; + + gl->fDeleteProgram(mProg); +} + +void +DrawBlitProg::Draw(const BaseArgs& args, const YUVArgs* const argsYUV) const +{ + const auto& gl = mParent.mGL; + + const SaveRestoreCurrentProgram oldProg(gl); + gl->fUseProgram(mProg); + + // -- + + gl->fUniform1f(mLoc_u1ForYFlip, args.yFlip ? 1 : 0); + gl->fUniform4f(mLoc_uSrcRect, + args.srcRect.x, args.srcRect.y, + args.srcRect.width, args.srcRect.height); + gl->fUniform2f(mLoc_uTexSize0, args.texSize0.width, args.texSize0.height); + + MOZ_ASSERT(bool(argsYUV) == (mLoc_uColorMatrix != -1)); + if (argsYUV) { + gl->fUniform2f(mLoc_uTexSize1, argsYUV->texSize1.width, argsYUV->texSize1.height); + gl->fUniform2f(mLoc_uDivisors, argsYUV->divisors.width, argsYUV->divisors.height); + const auto& colorMatrix = gfxUtils::YuvToRgbMatrix4x4ColumnMajor(argsYUV->colorSpace); + gl->fUniformMatrix4fv(mLoc_uColorMatrix, 1, false, colorMatrix); + } + + // -- + + const ScopedDrawBlitState drawState(gl, args.destSize); + const ScopedBindVAO bindVAO(gl, mParent.mQuadVAO); + gl->fDrawArrays(LOCAL_GL_TRIANGLE_STRIP, 0, 4); +} + +// -- + +GLBlitHelper::GLBlitHelper(GLContext* const gl) + : mGL(gl) + , mQuadVAO(0) + , mDrawBlitProg_VertShader(mGL->fCreateShader(LOCAL_GL_VERTEX_SHADER)) + , mYuvUploads{0} + , mYuvUploads_YSize(0, 0) + , mYuvUploads_UVSize(0, 0) +{ + if (!mGL->IsSupported(GLFeature::vertex_array_object)) { + gfxCriticalError() << "GLBlitHelper requires vertex_array_object."; + return; + } + + GLuint vbo = 0; + mGL->fGenBuffers(1, &vbo); + { + const ScopedBindArrayBuffer bindVBO(mGL, vbo); + + const float quadData[] = { + 0, 0, + 1, 0, + 0, 1, + 1, 1 + }; + const HeapCopyOfStackArray heapQuadData(quadData); + mGL->fBufferData(LOCAL_GL_ARRAY_BUFFER, heapQuadData.ByteLength(), + heapQuadData.Data(), LOCAL_GL_STATIC_DRAW); + + mGL->fGenVertexArrays(1, &mQuadVAO); + const ScopedBindVAO bindVAO(mGL, mQuadVAO); + mGL->fEnableVertexAttribArray(0); + mGL->fVertexAttribPointer(0, 2, LOCAL_GL_FLOAT, false, 0, 0); + } + mGL->fDeleteBuffers(1, &vbo); + + // -- + + if (!mGL->IsGLES()) { + const auto glslVersion = mGL->ShadingLanguageVersion(); + if (glslVersion >= 130) { + mDrawBlitProg_VersionLine = nsPrintfCString("#version %u\n", glslVersion); + } + } + + const char kVertSource[] = "\ + #if __VERSION__ >= 130 \n\ + #define ATTRIBUTE in \n\ + #define VARYING out \n\ + #else \n\ + #define ATTRIBUTE attribute \n\ + #define VARYING varying \n\ + #endif \n\ + \n\ + ATTRIBUTE vec2 aVert; \n\ + \n\ + uniform float u1ForYFlip; \n\ + uniform vec4 uSrcRect; \n\ + uniform vec2 uTexSize0; \n\ + uniform vec2 uTexSize1; \n\ + uniform vec2 uDivisors; \n\ + \n\ + VARYING vec2 vTexCoord0; \n\ + VARYING vec2 vTexCoord1; \n\ + \n\ + void main(void) \n\ + { \n\ + vec2 vertPos = aVert * 2.0 - 1.0; \n\ + gl_Position = vec4(vertPos, 0.0, 1.0); \n\ + \n\ + vec2 texCoord = aVert; \n\ + texCoord.y = abs(u1ForYFlip - texCoord.y); \n\ + texCoord = texCoord * uSrcRect.zw + uSrcRect.xy; \n\ + \n\ + vTexCoord0 = texCoord / uTexSize0; \n\ + vTexCoord1 = texCoord / (uTexSize1 * uDivisors); \n\ + } \n\ + "; + + const char* const parts[] = { + mDrawBlitProg_VersionLine.get(), + kVertSource + }; + mGL->fShaderSource(mDrawBlitProg_VertShader, ArrayLength(parts), parts, nullptr); + mGL->fCompileShader(mDrawBlitProg_VertShader); } GLBlitHelper::~GLBlitHelper() { + for (const auto& pair : mDrawBlitProgs) { + const auto& ptr = pair.second; + delete ptr; + } + mDrawBlitProgs.clear(); + if (!mGL->MakeCurrent()) return; - DeleteTexBlitProgram(); + mGL->fDeleteShader(mDrawBlitProg_VertShader); + mGL->fDeleteVertexArrays(1, &mQuadVAO); +} - GLuint tex[] = { - mSrcTexY, - mSrcTexCb, - mSrcTexCr, - mSrcTexEGL, +// -- + +const DrawBlitProg* +GLBlitHelper::GetDrawBlitProg(const DrawBlitProg::Key& key) const +{ + const auto& res = mDrawBlitProgs.insert({key, nullptr}); + auto& pair = *(res.first); + const auto& didInsert = res.second; + if (didInsert) { + pair.second = CreateDrawBlitProg(pair.first); + } + return pair.second; +} + + +const DrawBlitProg* +GLBlitHelper::CreateDrawBlitProg(const DrawBlitProg::Key& key) const +{ + const char kFragHeader_Global[] = "\ + #ifdef GL_ES \n\ + #ifdef GL_FRAGMENT_PRECISION_HIGH \n\ + precision highp float; \n\ + #else \n\ + precision mediump float; \n\ + #endif \n\ + #endif \n\ + \n\ + #if __VERSION__ >= 130 \n\ + #define VARYING in \n\ + #define FRAG_COLOR oFragColor \n\ + \n\ + out vec4 FRAG_COLOR; \n\ + #else \n\ + #define VARYING varying \n\ + #define FRAG_COLOR gl_FragColor \n\ + #endif \n\ + "; + + const ScopedShader fs(mGL, LOCAL_GL_FRAGMENT_SHADER); + const char* const parts[] = { + mDrawBlitProg_VersionLine.get(), + key.fragHeader, + kFragHeader_Global, + key.fragBody }; + mGL->fShaderSource(fs, ArrayLength(parts), parts, nullptr); + mGL->fCompileShader(fs); - mSrcTexY = mSrcTexCb = mSrcTexCr = mSrcTexEGL = 0; - mGL->fDeleteTextures(ArrayLength(tex), tex); + const auto prog = mGL->fCreateProgram(); + mGL->fAttachShader(prog, mDrawBlitProg_VertShader); + mGL->fAttachShader(prog, fs); - if (mFBO) { - mGL->fDeleteFramebuffers(1, &mFBO); + mGL->fBindAttribLocation(prog, 0, "aPosition"); + mGL->fLinkProgram(prog); + + GLenum status = 0; + mGL->fGetProgramiv(prog, LOCAL_GL_LINK_STATUS, (GLint*)&status); + if (status == LOCAL_GL_TRUE) { + const SaveRestoreCurrentProgram oldProg(mGL); + mGL->fUseProgram(prog); + const char* samplerNames[] = { + "uTex0", + "uTex1", + "uTex2" + }; + for (int i = 0; i < 3; i++) { + const auto loc = mGL->fGetUniformLocation(prog, samplerNames[i]); + if (loc == -1) + break; + mGL->fUniform1i(loc, i); + } + + return new DrawBlitProg(this, prog); } - mFBO = 0; + + GLuint progLogLen = 0; + mGL->fGetProgramiv(prog, LOCAL_GL_INFO_LOG_LENGTH, (GLint*)&progLogLen); + const UniquePtr progLog(new char[progLogLen+1]); + mGL->fGetProgramInfoLog(prog, progLogLen, nullptr, progLog.get()); + progLog[progLogLen] = 0; + + const auto& vs = mDrawBlitProg_VertShader; + GLuint vsLogLen = 0; + mGL->fGetShaderiv(vs, LOCAL_GL_INFO_LOG_LENGTH, (GLint*)&vsLogLen); + const UniquePtr vsLog(new char[vsLogLen+1]); + mGL->fGetShaderInfoLog(vs, vsLogLen, nullptr, vsLog.get()); + progLog[progLogLen] = 0; + + GLuint fsLogLen = 0; + mGL->fGetShaderiv(fs, LOCAL_GL_INFO_LOG_LENGTH, (GLint*)&fsLogLen); + const UniquePtr fsLog(new char[fsLogLen+1]); + mGL->fGetShaderInfoLog(fs, fsLogLen, nullptr, fsLog.get()); + progLog[progLogLen] = 0; + + gfxCriticalError() << "DrawBlitProg link failed:\n" + << "progLog: " << progLog.get() << "\n" + << "vsLog: " << vsLog.get() << "\n" + << "fsLog: " << fsLog.get() << "\n"; + return nullptr; } -// Allowed to be destructive of state we restore in functions below. -bool -GLBlitHelper::InitTexQuadProgram(BlitType target) -{ - const char kTexBlit_VertShaderSource[] = "\ - #version 100 \n\ - #ifdef GL_ES \n\ - precision mediump float; \n\ - #endif \n\ - attribute vec2 aPosition; \n\ - \n\ - uniform float uYflip; \n\ - varying vec2 vTexCoord; \n\ - \n\ - void main(void) \n\ - { \n\ - vTexCoord = aPosition; \n\ - vTexCoord.y = abs(vTexCoord.y - uYflip); \n\ - vec2 vertPos = aPosition * 2.0 - 1.0; \n\ - gl_Position = vec4(vertPos, 0.0, 1.0); \n\ - } \n\ - "; - - const char kTex2DBlit_FragShaderSource[] = "\ - #version 100 \n\ - #ifdef GL_ES \n\ - #ifdef GL_FRAGMENT_PRECISION_HIGH \n\ - precision highp float; \n\ - #else \n\ - precision mediump float; \n\ - #endif \n\ - #endif \n\ - uniform sampler2D uTexUnit; \n\ - \n\ - varying vec2 vTexCoord; \n\ - \n\ - void main(void) \n\ - { \n\ - gl_FragColor = texture2D(uTexUnit, vTexCoord); \n\ - } \n\ - "; - - const char kTex2DRectBlit_FragShaderSource[] = "\ - #version 100 \n\ - #ifdef GL_FRAGMENT_PRECISION_HIGH \n\ - precision highp float; \n\ - #else \n\ - precision mediump float; \n\ - #endif \n\ - \n\ - uniform sampler2D uTexUnit; \n\ - uniform vec2 uTexCoordMult; \n\ - \n\ - varying vec2 vTexCoord; \n\ - \n\ - void main(void) \n\ - { \n\ - gl_FragColor = texture2DRect(uTexUnit, \n\ - vTexCoord * uTexCoordMult); \n\ - } \n\ - "; -#ifdef ANDROID /* MOZ_WIDGET_ANDROID */ - const char kTexExternalBlit_FragShaderSource[] = "\ - #version 100 \n\ - #extension GL_OES_EGL_image_external : require \n\ - #ifdef GL_FRAGMENT_PRECISION_HIGH \n\ - precision highp float; \n\ - #else \n\ - precision mediump float; \n\ - #endif \n\ - varying vec2 vTexCoord; \n\ - uniform mat4 uTextureTransform; \n\ - uniform samplerExternalOES uTexUnit; \n\ - \n\ - void main() \n\ - { \n\ - gl_FragColor = texture2D(uTexUnit, \n\ - (uTextureTransform * vec4(vTexCoord, 0.0, 1.0)).xy); \n\ - } \n\ - "; -#endif - /* From Rec601: - [R] [1.1643835616438356, 0.0, 1.5960267857142858] [ Y - 16] - [G] = [1.1643835616438358, -0.3917622900949137, -0.8129676472377708] x [Cb - 128] - [B] [1.1643835616438356, 2.017232142857143, 8.862867620416422e-17] [Cr - 128] - - For [0,1] instead of [0,255], and to 5 places: - [R] [1.16438, 0.00000, 1.59603] [ Y - 0.06275] - [G] = [1.16438, -0.39176, -0.81297] x [Cb - 0.50196] - [B] [1.16438, 2.01723, 0.00000] [Cr - 0.50196] - - From Rec709: - [R] [1.1643835616438356, 4.2781193979771426e-17, 1.7927410714285714] [ Y - 16] - [G] = [1.1643835616438358, -0.21324861427372963, -0.532909328559444] x [Cb - 128] - [B] [1.1643835616438356, 2.1124017857142854, 0.0] [Cr - 128] - - For [0,1] instead of [0,255], and to 5 places: - [R] [1.16438, 0.00000, 1.79274] [ Y - 0.06275] - [G] = [1.16438, -0.21325, -0.53291] x [Cb - 0.50196] - [B] [1.16438, 2.11240, 0.00000] [Cr - 0.50196] - */ - const char kTexYUVPlanarBlit_FragShaderSource[] = "\ - #version 100 \n\ - #ifdef GL_ES \n\ - precision mediump float; \n\ - #endif \n\ - varying vec2 vTexCoord; \n\ - uniform sampler2D uYTexture; \n\ - uniform sampler2D uCbTexture; \n\ - uniform sampler2D uCrTexture; \n\ - uniform vec2 uYTexScale; \n\ - uniform vec2 uCbCrTexScale; \n\ - uniform mat3 uYuvColorMatrix; \n\ - void main() \n\ - { \n\ - float y = texture2D(uYTexture, vTexCoord * uYTexScale).r; \n\ - float cb = texture2D(uCbTexture, vTexCoord * uCbCrTexScale).r; \n\ - float cr = texture2D(uCrTexture, vTexCoord * uCbCrTexScale).r; \n\ - y = y - 0.06275; \n\ - cb = cb - 0.50196; \n\ - cr = cr - 0.50196; \n\ - vec3 yuv = vec3(y, cb, cr); \n\ - gl_FragColor.rgb = uYuvColorMatrix * yuv; \n\ - gl_FragColor.a = 1.0; \n\ - } \n\ - "; - -#ifdef XP_MACOSX - const char kTexNV12PlanarBlit_FragShaderSource[] = "\ - #version 100 \n\ - #extension GL_ARB_texture_rectangle : require \n\ - #ifdef GL_ES \n\ - precision mediump float \n\ - #endif \n\ - varying vec2 vTexCoord; \n\ - uniform sampler2DRect uYTexture; \n\ - uniform sampler2DRect uCbCrTexture; \n\ - uniform vec2 uYTexScale; \n\ - uniform vec2 uCbCrTexScale; \n\ - void main() \n\ - { \n\ - float y = texture2DRect(uYTexture, vTexCoord * uYTexScale).r; \n\ - float cb = texture2DRect(uCbCrTexture, vTexCoord * uCbCrTexScale).r; \n\ - float cr = texture2DRect(uCbCrTexture, vTexCoord * uCbCrTexScale).a; \n\ - y = (y - 0.06275) * 1.16438; \n\ - cb = cb - 0.50196; \n\ - cr = cr - 0.50196; \n\ - gl_FragColor.r = y + cr * 1.59603; \n\ - gl_FragColor.g = y - 0.81297 * cr - 0.39176 * cb; \n\ - gl_FragColor.b = y + cb * 2.01723; \n\ - gl_FragColor.a = 1.0; \n\ - } \n\ - "; -#endif - - bool success = false; - - GLuint* programPtr; - GLuint* fragShaderPtr; - const char* fragShaderSource; - switch (target) { - case ConvertEGLImage: - case BlitTex2D: - programPtr = &mTex2DBlit_Program; - fragShaderPtr = &mTex2DBlit_FragShader; - fragShaderSource = kTex2DBlit_FragShaderSource; - break; - case BlitTexRect: - programPtr = &mTex2DRectBlit_Program; - fragShaderPtr = &mTex2DRectBlit_FragShader; - fragShaderSource = kTex2DRectBlit_FragShaderSource; - break; -#ifdef ANDROID - case ConvertSurfaceTexture: - programPtr = &mTexExternalBlit_Program; - fragShaderPtr = &mTexExternalBlit_FragShader; - fragShaderSource = kTexExternalBlit_FragShaderSource; - break; -#endif - case ConvertPlanarYCbCr: - programPtr = &mTexYUVPlanarBlit_Program; - fragShaderPtr = &mTexYUVPlanarBlit_FragShader; - fragShaderSource = kTexYUVPlanarBlit_FragShaderSource; - break; -#ifdef XP_MACOSX - case ConvertMacIOSurfaceImage: - programPtr = &mTexNV12PlanarBlit_Program; - fragShaderPtr = &mTexNV12PlanarBlit_FragShader; - fragShaderSource = kTexNV12PlanarBlit_FragShaderSource; - break; -#endif - default: - return false; - } - - GLuint& program = *programPtr; - GLuint& fragShader = *fragShaderPtr; - - // Use do-while(false) to let us break on failure - do { - if (program) { - // Already have it... - success = true; - break; - } - - if (!mTexBlit_Buffer) { - - /* CCW tri-strip: - * 2---3 - * | \ | - * 0---1 - */ - GLfloat verts[] = { - 0.0f, 0.0f, - 1.0f, 0.0f, - 0.0f, 1.0f, - 1.0f, 1.0f - }; - HeapCopyOfStackArray vertsOnHeap(verts); - - MOZ_ASSERT(!mTexBlit_Buffer); - mGL->fGenBuffers(1, &mTexBlit_Buffer); - mGL->fBindBuffer(LOCAL_GL_ARRAY_BUFFER, mTexBlit_Buffer); - - // Make sure we have a sane size. - mGL->fBufferData(LOCAL_GL_ARRAY_BUFFER, vertsOnHeap.ByteLength(), vertsOnHeap.Data(), LOCAL_GL_STATIC_DRAW); - } - - if (!mTexBlit_VertShader) { - - const char* vertShaderSource = kTexBlit_VertShaderSource; - - mTexBlit_VertShader = mGL->fCreateShader(LOCAL_GL_VERTEX_SHADER); - mGL->fShaderSource(mTexBlit_VertShader, 1, &vertShaderSource, nullptr); - mGL->fCompileShader(mTexBlit_VertShader); - } - - MOZ_ASSERT(!fragShader); - fragShader = mGL->fCreateShader(LOCAL_GL_FRAGMENT_SHADER); - mGL->fShaderSource(fragShader, 1, &fragShaderSource, nullptr); - mGL->fCompileShader(fragShader); - - program = mGL->fCreateProgram(); - mGL->fAttachShader(program, mTexBlit_VertShader); - mGL->fAttachShader(program, fragShader); - mGL->fBindAttribLocation(program, 0, "aPosition"); - mGL->fLinkProgram(program); - - if (GLContext::ShouldSpew()) { - GLint status = 0; - mGL->fGetShaderiv(mTexBlit_VertShader, LOCAL_GL_COMPILE_STATUS, &status); - if (status != LOCAL_GL_TRUE) { - NS_ERROR("Vert shader compilation failed."); - - GLint length = 0; - mGL->fGetShaderiv(mTexBlit_VertShader, LOCAL_GL_INFO_LOG_LENGTH, &length); - if (!length) { - printf_stderr("No shader info log available.\n"); - break; - } - - auto buffer = MakeUnique(length); - mGL->fGetShaderInfoLog(mTexBlit_VertShader, length, nullptr, buffer.get()); - - printf_stderr("Shader info log (%d bytes): %s\n", length, buffer.get()); - break; - } - - status = 0; - mGL->fGetShaderiv(fragShader, LOCAL_GL_COMPILE_STATUS, &status); - if (status != LOCAL_GL_TRUE) { - NS_ERROR("Frag shader compilation failed."); - - GLint length = 0; - mGL->fGetShaderiv(fragShader, LOCAL_GL_INFO_LOG_LENGTH, &length); - if (!length) { - printf_stderr("No shader info log available.\n"); - break; - } - - auto buffer = MakeUnique(length); - mGL->fGetShaderInfoLog(fragShader, length, nullptr, buffer.get()); - - printf_stderr("Shader info log (%d bytes): %s\n", length, buffer.get()); - break; - } - } - - GLint status = 0; - mGL->fGetProgramiv(program, LOCAL_GL_LINK_STATUS, &status); - if (status != LOCAL_GL_TRUE) { - if (GLContext::ShouldSpew()) { - NS_ERROR("Linking blit program failed."); - GLint length = 0; - mGL->fGetProgramiv(program, LOCAL_GL_INFO_LOG_LENGTH, &length); - if (!length) { - printf_stderr("No program info log available.\n"); - break; - } - - auto buffer = MakeUnique(length); - mGL->fGetProgramInfoLog(program, length, nullptr, buffer.get()); - - printf_stderr("Program info log (%d bytes): %s\n", length, buffer.get()); - } - break; - } - - // Cache and set attribute and uniform - mGL->fUseProgram(program); - switch (target) { -#ifdef ANDROID - case ConvertSurfaceTexture: -#endif - case BlitTex2D: - case BlitTexRect: - case ConvertEGLImage: { - GLint texUnitLoc = mGL->fGetUniformLocation(program, "uTexUnit"); - MOZ_ASSERT(texUnitLoc != -1, "uniform uTexUnit not found"); - mGL->fUniform1i(texUnitLoc, 0); - break; - } - case ConvertPlanarYCbCr: { - GLint texY = mGL->fGetUniformLocation(program, "uYTexture"); - GLint texCb = mGL->fGetUniformLocation(program, "uCbTexture"); - GLint texCr = mGL->fGetUniformLocation(program, "uCrTexture"); - mYTexScaleLoc = mGL->fGetUniformLocation(program, "uYTexScale"); - mCbCrTexScaleLoc = mGL->fGetUniformLocation(program, "uCbCrTexScale"); - mYuvColorMatrixLoc = mGL->fGetUniformLocation(program, "uYuvColorMatrix"); - - DebugOnly hasUniformLocations = texY != -1 && - texCb != -1 && - texCr != -1 && - mYTexScaleLoc != -1 && - mCbCrTexScaleLoc != -1 && - mYuvColorMatrixLoc != -1; - MOZ_ASSERT(hasUniformLocations, "uniforms not found"); - - mGL->fUniform1i(texY, Channel_Y); - mGL->fUniform1i(texCb, Channel_Cb); - mGL->fUniform1i(texCr, Channel_Cr); - break; - } - case ConvertMacIOSurfaceImage: { -#ifdef XP_MACOSX - GLint texY = mGL->fGetUniformLocation(program, "uYTexture"); - GLint texCbCr = mGL->fGetUniformLocation(program, "uCbCrTexture"); - mYTexScaleLoc = mGL->fGetUniformLocation(program, "uYTexScale"); - mCbCrTexScaleLoc= mGL->fGetUniformLocation(program, "uCbCrTexScale"); - - DebugOnly hasUniformLocations = texY != -1 && - texCbCr != -1 && - mYTexScaleLoc != -1 && - mCbCrTexScaleLoc != -1; - MOZ_ASSERT(hasUniformLocations, "uniforms not found"); - - mGL->fUniform1i(texY, Channel_Y); - mGL->fUniform1i(texCbCr, Channel_Cb); -#endif - break; - } - default: - return false; - } - MOZ_ASSERT(mGL->fGetAttribLocation(program, "aPosition") == 0); - mYFlipLoc = mGL->fGetUniformLocation(program, "uYflip"); - MOZ_ASSERT(mYFlipLoc != -1, "uniform: uYflip not found"); - mTextureTransformLoc = mGL->fGetUniformLocation(program, "uTextureTransform"); - if (mTextureTransformLoc >= 0) { - // Set identity matrix as default - gfx::Matrix4x4 identity; - mGL->fUniformMatrix4fv(mTextureTransformLoc, 1, false, &identity._11); - } - success = true; - } while (false); - - if (!success) { - // Clean up: - DeleteTexBlitProgram(); - return false; - } - - mGL->fUseProgram(program); - mGL->fEnableVertexAttribArray(0); - mGL->fBindBuffer(LOCAL_GL_ARRAY_BUFFER, mTexBlit_Buffer); - mGL->fVertexAttribPointer(0, - 2, - LOCAL_GL_FLOAT, - false, - 0, - nullptr); - return true; -} +// ----------------------------------------------------------------------------- bool -GLBlitHelper::UseTexQuadProgram(BlitType target, const gfx::IntSize& srcSize) +GLBlitHelper::BlitImageToFramebuffer(layers::Image* srcImage, + const gfx::IntSize& destSize, + OriginPos destOrigin) { - if (!InitTexQuadProgram(target)) { - return false; - } - - if (target == BlitTexRect) { - GLint texCoordMultLoc = mGL->fGetUniformLocation(mTex2DRectBlit_Program, "uTexCoordMult"); - MOZ_ASSERT(texCoordMultLoc != -1, "uniform not found"); - mGL->fUniform2f(texCoordMultLoc, srcSize.width, srcSize.height); - } - - return true; -} - -void -GLBlitHelper::DeleteTexBlitProgram() -{ - if (mTexBlit_Buffer) { - mGL->fDeleteBuffers(1, &mTexBlit_Buffer); - mTexBlit_Buffer = 0; - } - if (mTexBlit_VertShader) { - mGL->fDeleteShader(mTexBlit_VertShader); - mTexBlit_VertShader = 0; - } - if (mTex2DBlit_FragShader) { - mGL->fDeleteShader(mTex2DBlit_FragShader); - mTex2DBlit_FragShader = 0; - } - if (mTex2DRectBlit_FragShader) { - mGL->fDeleteShader(mTex2DRectBlit_FragShader); - mTex2DRectBlit_FragShader = 0; - } - if (mTex2DBlit_Program) { - mGL->fDeleteProgram(mTex2DBlit_Program); - mTex2DBlit_Program = 0; - } - if (mTex2DRectBlit_Program) { - mGL->fDeleteProgram(mTex2DRectBlit_Program); - mTex2DRectBlit_Program = 0; - } - if (mTexExternalBlit_FragShader) { - mGL->fDeleteShader(mTexExternalBlit_FragShader); - mTexExternalBlit_FragShader = 0; - } - if (mTexYUVPlanarBlit_FragShader) { - mGL->fDeleteShader(mTexYUVPlanarBlit_FragShader); - mTexYUVPlanarBlit_FragShader = 0; - } - if (mTexNV12PlanarBlit_FragShader) { - mGL->fDeleteShader(mTexNV12PlanarBlit_FragShader); - mTexNV12PlanarBlit_FragShader = 0; - } - if (mTexExternalBlit_Program) { - mGL->fDeleteProgram(mTexExternalBlit_Program); - mTexExternalBlit_Program = 0; - } - if (mTexYUVPlanarBlit_Program) { - mGL->fDeleteProgram(mTexYUVPlanarBlit_Program); - mTexYUVPlanarBlit_Program = 0; - } - if (mTexNV12PlanarBlit_Program) { - mGL->fDeleteProgram(mTexNV12PlanarBlit_Program); - mTexNV12PlanarBlit_Program = 0; - } -} - -void -GLBlitHelper::BlitFramebufferToFramebuffer(GLuint srcFB, GLuint destFB, - const gfx::IntSize& srcSize, - const gfx::IntSize& destSize, - bool internalFBs) -{ - MOZ_ASSERT(!srcFB || mGL->fIsFramebuffer(srcFB)); - MOZ_ASSERT(!destFB || mGL->fIsFramebuffer(destFB)); - - MOZ_ASSERT(mGL->IsSupported(GLFeature::framebuffer_blit)); - - ScopedBindFramebuffer boundFB(mGL); - ScopedGLState scissor(mGL, LOCAL_GL_SCISSOR_TEST, false); - - if (internalFBs) { - mGL->Screen()->BindReadFB_Internal(srcFB); - mGL->Screen()->BindDrawFB_Internal(destFB); - } else { - mGL->BindReadFB(srcFB); - mGL->BindDrawFB(destFB); - } - - mGL->fBlitFramebuffer(0, 0, srcSize.width, srcSize.height, - 0, 0, destSize.width, destSize.height, - LOCAL_GL_COLOR_BUFFER_BIT, - LOCAL_GL_NEAREST); -} - -void -GLBlitHelper::BlitFramebufferToFramebuffer(GLuint srcFB, GLuint destFB, - const gfx::IntSize& srcSize, - const gfx::IntSize& destSize, - const GLFormats& srcFormats, - bool internalFBs) -{ - MOZ_ASSERT(!srcFB || mGL->fIsFramebuffer(srcFB)); - MOZ_ASSERT(!destFB || mGL->fIsFramebuffer(destFB)); - - if (mGL->IsSupported(GLFeature::framebuffer_blit)) { - BlitFramebufferToFramebuffer(srcFB, destFB, - srcSize, destSize, - internalFBs); - return; - } - - GLuint tex = CreateTextureForOffscreen(mGL, srcFormats, srcSize); - MOZ_ASSERT(tex); - - BlitFramebufferToTexture(srcFB, tex, srcSize, srcSize, internalFBs); - BlitTextureToFramebuffer(tex, destFB, srcSize, destSize, internalFBs); - - mGL->fDeleteTextures(1, &tex); -} - -void -GLBlitHelper::BindAndUploadYUVTexture(Channel which, - uint32_t width, - uint32_t height, - void* data, - bool needsAllocation) -{ - MOZ_ASSERT(which < Channel_Max, "Invalid channel!"); - GLuint* srcTexArr[3] = {&mSrcTexY, &mSrcTexCb, &mSrcTexCr}; - GLuint& tex = *srcTexArr[which]; - - // RED textures aren't valid in GLES2, and ALPHA textures are not valid in desktop GL Core Profiles. - // So use R8 textures on GL3.0+ and GLES3.0+, but LUMINANCE/LUMINANCE/UNSIGNED_BYTE otherwise. - GLenum format; - GLenum internalFormat; - if (mGL->IsAtLeast(gl::ContextProfile::OpenGLCore, 300) || - mGL->IsAtLeast(gl::ContextProfile::OpenGLES, 300)) { - format = LOCAL_GL_RED; - internalFormat = LOCAL_GL_R8; - } else { - format = LOCAL_GL_LUMINANCE; - internalFormat = LOCAL_GL_LUMINANCE; - } - - if (!tex) { - MOZ_ASSERT(needsAllocation); - tex = CreateTexture(mGL, internalFormat, format, LOCAL_GL_UNSIGNED_BYTE, - gfx::IntSize(width, height), false); - } - mGL->fActiveTexture(LOCAL_GL_TEXTURE0 + which); - - mGL->fBindTexture(LOCAL_GL_TEXTURE_2D, tex); - if (!needsAllocation) { - mGL->fTexSubImage2D(LOCAL_GL_TEXTURE_2D, - 0, - 0, - 0, - width, - height, - format, - LOCAL_GL_UNSIGNED_BYTE, - data); - } else { - mGL->fTexImage2D(LOCAL_GL_TEXTURE_2D, - 0, - internalFormat, - width, - height, - 0, - format, - LOCAL_GL_UNSIGNED_BYTE, - data); - } -} - -void -GLBlitHelper::BindAndUploadEGLImage(EGLImage image, GLuint target) -{ - MOZ_ASSERT(image != EGL_NO_IMAGE, "Bad EGLImage"); - - if (!mSrcTexEGL) { - mGL->fGenTextures(1, &mSrcTexEGL); - mGL->fBindTexture(target, mSrcTexEGL); - mGL->fTexParameteri(target, LOCAL_GL_TEXTURE_WRAP_S, LOCAL_GL_CLAMP_TO_EDGE); - mGL->fTexParameteri(target, LOCAL_GL_TEXTURE_WRAP_T, LOCAL_GL_CLAMP_TO_EDGE); - mGL->fTexParameteri(target, LOCAL_GL_TEXTURE_MAG_FILTER, LOCAL_GL_NEAREST); - mGL->fTexParameteri(target, LOCAL_GL_TEXTURE_MIN_FILTER, LOCAL_GL_NEAREST); - } else { - mGL->fBindTexture(target, mSrcTexEGL); - } - mGL->fEGLImageTargetTexture2D(target, image); -} + switch (srcImage->GetFormat()) { + case ImageFormat::PLANAR_YCBCR: + return BlitImage(static_cast(srcImage), destSize, destOrigin); #ifdef MOZ_WIDGET_ANDROID + case ImageFormat::SURFACE_TEXTURE: + return BlitImage(static_cast(srcImage), destSize, + destOrigin); -#define ATTACH_WAIT_MS 50 + case ImageFormat::EGLIMAGE: + return BlitImage(static_cast(srcImage), destSize, + destOrigin); +#endif +#ifdef XP_MACOSX + case ImageFormat::MAC_IOSURFACE: + return BlitImage(srcImage->AsMacIOSurfaceImage(), destSize, destOrigin); +#endif +#ifdef XP_WIN + case ImageFormat::GPU_VIDEO: + return BlitImage(static_cast(srcImage), destSize, + destOrigin); + case ImageFormat::D3D11_YCBCR_IMAGE: + return BlitImage((layers::D3D11YCbCrImage*)srcImage, destSize, + destOrigin); + case ImageFormat::D3D9_RGB32_TEXTURE: + return false; // todo +#endif + default: + gfxCriticalError() << "Unhandled srcImage->GetFormat(): " + << uint32_t(srcImage->GetFormat()); + return false; + } +} +// ------------------------------------- + +#ifdef MOZ_WIDGET_ANDROID bool -GLBlitHelper::BlitSurfaceTextureImage(layers::SurfaceTextureImage* stImage) +GLBlitHelper::BlitImage(layers::SurfaceTextureImage* srcImage, const gfx::IntSize&, + const OriginPos) const { // FIXME + const auto& srcOrigin = srcImage->GetOriginPos(); + (void)srcOrigin; + gfxCriticalError() << "BlitImage(SurfaceTextureImage) not implemented."; return false; } bool -GLBlitHelper::BlitEGLImageImage(layers::EGLImageImage* image) +GLBlitHelper::BlitImage(layers::EGLImageImage* const srcImage, + const gfx::IntSize& destSize, const OriginPos destOrigin) const { - EGLImage eglImage = image->GetImage(); - EGLSync eglSync = image->GetSync(); - + const EGLImage eglImage = srcImage->GetImage(); + const EGLSync eglSync = srcImage->GetSync(); if (eglSync) { EGLint status = sEGLLibrary.fClientWaitSync(EGL_DISPLAY(), eglSync, 0, LOCAL_EGL_FOREVER); if (status != LOCAL_EGL_CONDITION_SATISFIED) { @@ -701,317 +643,437 @@ GLBlitHelper::BlitEGLImageImage(layers::EGLImageImage* image) } } - ScopedBindTextureUnit boundTU(mGL, LOCAL_GL_TEXTURE0); + GLuint tex = 0; + mGL->fGenTextures(1, &tex); - int oldBinding = 0; - mGL->fGetIntegerv(LOCAL_GL_TEXTURE_BINDING_2D, &oldBinding); + const ScopedSaveMultiTex saveTex(mGL, 1, LOCAL_GL_TEXTURE_2D); + mGL->fBindTexture(LOCAL_GL_TEXTURE_2D, tex); + mGL->TexParams_SetClampNoMips(); + mGL->fEGLImageTargetTexture2D(LOCAL_GL_TEXTURE_2D, eglImage); - BindAndUploadEGLImage(eglImage, LOCAL_GL_TEXTURE_2D); + const auto& srcOrigin = srcImage->GetOriginPos(); + const bool yFlip = destOrigin != srcOrigin; + const gfx::IntRect srcRect(0, 0, 1, 1); + const gfx::IntSize srcSize(1, 1); + const DrawBlitProg::BaseArgs baseArgs = { destSize, yFlip, srcRect, srcSize }; - mGL->fDrawArrays(LOCAL_GL_TRIANGLE_STRIP, 0, 4); + const auto& prog = GetDrawBlitProg({kFragHeader_Tex2D, kFragBody_RGBA}); + MOZ_RELEASE_ASSERT(prog); + prog->Draw(baseArgs); - mGL->fBindTexture(LOCAL_GL_TEXTURE_2D, oldBinding); + mGL->fDeleteTextures(1, &tex); return true; } - #endif +// ------------------------------------- + bool -GLBlitHelper::BlitPlanarYCbCrImage(layers::PlanarYCbCrImage* yuvImage) +GuessDivisors(const gfx::IntSize& ySize, const gfx::IntSize& uvSize, + gfx::IntSize* const out_divisors) { - ScopedBindTextureUnit boundTU(mGL, LOCAL_GL_TEXTURE0); - const PlanarYCbCrData* yuvData = yuvImage->GetData(); - - bool needsAllocation = false; - if (mTexWidth != yuvData->mYStride || mTexHeight != yuvData->mYSize.height) { - mTexWidth = yuvData->mYStride; - mTexHeight = yuvData->mYSize.height; - needsAllocation = true; - } - - GLint oldTex[3]; - for (int i = 0; i < 3; i++) { - mGL->fActiveTexture(LOCAL_GL_TEXTURE0 + i); - mGL->fGetIntegerv(LOCAL_GL_TEXTURE_BINDING_2D, &oldTex[i]); - } - + const gfx::IntSize divisors((ySize.width == uvSize.width ) ? 1 : 2, + (ySize.height == uvSize.height) ? 1 : 2); + if (uvSize.width * divisors.width != ySize.width || + uvSize.height * divisors.height != ySize.height) { - const ResetUnpackState reset(mGL); - BindAndUploadYUVTexture(Channel_Y, yuvData->mYStride, yuvData->mYSize.height, yuvData->mYChannel, needsAllocation); - BindAndUploadYUVTexture(Channel_Cb, yuvData->mCbCrStride, yuvData->mCbCrSize.height, yuvData->mCbChannel, needsAllocation); - BindAndUploadYUVTexture(Channel_Cr, yuvData->mCbCrStride, yuvData->mCbCrSize.height, yuvData->mCrChannel, needsAllocation); - } - - if (needsAllocation) { - mGL->fUniform2f(mYTexScaleLoc, (float)yuvData->mYSize.width/yuvData->mYStride, 1.0f); - mGL->fUniform2f(mCbCrTexScaleLoc, (float)yuvData->mCbCrSize.width/yuvData->mCbCrStride, 1.0f); - } - - const auto& yuvToRgb = gfxUtils::YuvToRgbMatrix3x3ColumnMajor(yuvData->mYUVColorSpace); - mGL->fUniformMatrix3fv(mYuvColorMatrixLoc, 1, 0, yuvToRgb); - - mGL->fDrawArrays(LOCAL_GL_TRIANGLE_STRIP, 0, 4); - for (int i = 0; i < 3; i++) { - mGL->fActiveTexture(LOCAL_GL_TEXTURE0 + i); - mGL->fBindTexture(LOCAL_GL_TEXTURE_2D, oldTex[i]); + return false; } + *out_divisors = divisors; return true; } -#ifdef XP_MACOSX bool -GLBlitHelper::BlitMacIOSurfaceImage(layers::MacIOSurfaceImage* ioImage) +GLBlitHelper::BlitImage(layers::PlanarYCbCrImage* const yuvImage, + const gfx::IntSize& destSize, const OriginPos destOrigin) { - ScopedBindTextureUnit boundTU(mGL, LOCAL_GL_TEXTURE0); - MacIOSurface* surf = ioImage->GetSurface(); + const auto& prog = GetDrawBlitProg({kFragHeader_Tex2D, kFragBody_PlanarYUV}); + MOZ_RELEASE_ASSERT(prog); - GLint oldTex[2]; - for (int i = 0; i < 2; i++) { - mGL->fActiveTexture(LOCAL_GL_TEXTURE0 + i); - mGL->fGetIntegerv(LOCAL_GL_TEXTURE_BINDING_2D, &oldTex[i]); + if (!mYuvUploads[0]) { + mGL->fGenTextures(3, mYuvUploads); + const ScopedBindTexture bindTex(mGL, mYuvUploads[0]); + mGL->TexParams_SetClampNoMips(); + mGL->fBindTexture(LOCAL_GL_TEXTURE_2D, mYuvUploads[1]); + mGL->TexParams_SetClampNoMips(); + mGL->fBindTexture(LOCAL_GL_TEXTURE_2D, mYuvUploads[2]); + mGL->TexParams_SetClampNoMips(); } - GLuint textures[2]; - mGL->fGenTextures(2, textures); + // -- + + const PlanarYCbCrData* const yuvData = yuvImage->GetData(); + + if (yuvData->mYSkip || yuvData->mCbSkip || yuvData->mCrSkip || + yuvData->mYSize.width < 0 || yuvData->mYSize.height < 0 || + yuvData->mCbCrSize.width < 0 || yuvData->mCbCrSize.height < 0 || + yuvData->mYStride < 0 || yuvData->mCbCrStride < 0) + { + gfxCriticalError() << "Unusual PlanarYCbCrData: " + << yuvData->mYSkip << "," + << yuvData->mCbSkip << "," + << yuvData->mCrSkip << ", " + << yuvData->mYSize.width << "," + << yuvData->mYSize.height << ", " + << yuvData->mCbCrSize.width << "," + << yuvData->mCbCrSize.height << ", " + << yuvData->mYStride << "," + << yuvData->mCbCrStride; + return false; + } + + const gfx::IntSize yTexSize(yuvData->mYStride, yuvData->mYSize.height); + const gfx::IntSize uvTexSize(yuvData->mCbCrStride, yuvData->mCbCrSize.height); + gfx::IntSize divisors; + if (!GuessDivisors(yTexSize, uvTexSize, &divisors)) { + gfxCriticalError() << "GuessDivisors failed:" + << yTexSize.width << "," + << yTexSize.height << ", " + << uvTexSize.width << "," + << uvTexSize.height; + return false; + } + + // -- + + // RED textures aren't valid in GLES2, and ALPHA textures are not valid in desktop GL Core Profiles. + // So use R8 textures on GL3.0+ and GLES3.0+, but LUMINANCE/LUMINANCE/UNSIGNED_BYTE otherwise. + GLenum internalFormat; + GLenum unpackFormat; + if (mGL->IsAtLeast(gl::ContextProfile::OpenGLCore, 300) || + mGL->IsAtLeast(gl::ContextProfile::OpenGLES, 300)) + { + internalFormat = LOCAL_GL_R8; + unpackFormat = LOCAL_GL_RED; + } else { + internalFormat = LOCAL_GL_LUMINANCE; + unpackFormat = LOCAL_GL_LUMINANCE; + } + + // -- + + const ScopedSaveMultiTex saveTex(mGL, 3, LOCAL_GL_TEXTURE_2D); + const ResetUnpackState reset(mGL); + + if (yTexSize != mYuvUploads_YSize || + uvTexSize != mYuvUploads_UVSize) + { + mYuvUploads_YSize = yTexSize; + mYuvUploads_UVSize = uvTexSize; + + mGL->fActiveTexture(LOCAL_GL_TEXTURE0); + mGL->fBindTexture(LOCAL_GL_TEXTURE_2D, mYuvUploads[0]); + mGL->fTexImage2D(LOCAL_GL_TEXTURE_2D, 0, internalFormat, + yTexSize.width, yTexSize.height, 0, + unpackFormat, LOCAL_GL_UNSIGNED_BYTE, nullptr); + for (int i = 1; i < 3; i++) { + mGL->fActiveTexture(LOCAL_GL_TEXTURE0 + i); + mGL->fBindTexture(LOCAL_GL_TEXTURE_2D, mYuvUploads[i]); + mGL->fTexImage2D(LOCAL_GL_TEXTURE_2D, 0, internalFormat, + uvTexSize.width, uvTexSize.height, 0, + unpackFormat, LOCAL_GL_UNSIGNED_BYTE, nullptr); + } + } + + // -- mGL->fActiveTexture(LOCAL_GL_TEXTURE0); - mGL->fBindTexture(LOCAL_GL_TEXTURE_RECTANGLE_ARB, textures[0]); - mGL->fTexParameteri(LOCAL_GL_TEXTURE_RECTANGLE_ARB, LOCAL_GL_TEXTURE_WRAP_T, LOCAL_GL_CLAMP_TO_EDGE); - mGL->fTexParameteri(LOCAL_GL_TEXTURE_RECTANGLE_ARB, LOCAL_GL_TEXTURE_WRAP_S, LOCAL_GL_CLAMP_TO_EDGE); - surf->CGLTexImageIOSurface2D(mGL, - gl::GLContextCGL::Cast(mGL)->GetCGLContext(), - 0); - mGL->fUniform2f(mYTexScaleLoc, surf->GetWidth(0), surf->GetHeight(0)); - + mGL->fBindTexture(LOCAL_GL_TEXTURE_2D, mYuvUploads[0]); + mGL->fTexSubImage2D(LOCAL_GL_TEXTURE_2D, 0, 0, 0, + yTexSize.width, yTexSize.height, + unpackFormat, LOCAL_GL_UNSIGNED_BYTE, yuvData->mYChannel); mGL->fActiveTexture(LOCAL_GL_TEXTURE1); - mGL->fBindTexture(LOCAL_GL_TEXTURE_RECTANGLE_ARB, textures[1]); - mGL->fTexParameteri(LOCAL_GL_TEXTURE_RECTANGLE_ARB, LOCAL_GL_TEXTURE_WRAP_T, LOCAL_GL_CLAMP_TO_EDGE); - mGL->fTexParameteri(LOCAL_GL_TEXTURE_RECTANGLE_ARB, LOCAL_GL_TEXTURE_WRAP_S, LOCAL_GL_CLAMP_TO_EDGE); - surf->CGLTexImageIOSurface2D(mGL, - gl::GLContextCGL::Cast(mGL)->GetCGLContext(), - 1); - mGL->fUniform2f(mCbCrTexScaleLoc, surf->GetWidth(1), surf->GetHeight(1)); + mGL->fBindTexture(LOCAL_GL_TEXTURE_2D, mYuvUploads[1]); + mGL->fTexSubImage2D(LOCAL_GL_TEXTURE_2D, 0, 0, 0, + uvTexSize.width, uvTexSize.height, + unpackFormat, LOCAL_GL_UNSIGNED_BYTE, yuvData->mCbChannel); + mGL->fActiveTexture(LOCAL_GL_TEXTURE2); + mGL->fBindTexture(LOCAL_GL_TEXTURE_2D, mYuvUploads[2]); + mGL->fTexSubImage2D(LOCAL_GL_TEXTURE_2D, 0, 0, 0, + uvTexSize.width, uvTexSize.height, + unpackFormat, LOCAL_GL_UNSIGNED_BYTE, yuvData->mCrChannel); - mGL->fDrawArrays(LOCAL_GL_TRIANGLE_STRIP, 0, 4); - for (int i = 0; i < 2; i++) { - mGL->fActiveTexture(LOCAL_GL_TEXTURE0 + i); - mGL->fBindTexture(LOCAL_GL_TEXTURE_2D, oldTex[i]); + // -- + + const auto srcOrigin = OriginPos::BottomLeft; + const bool yFlip = (destOrigin != srcOrigin); + const auto& clipRect = yuvData->GetPictureRect(); + const auto& colorSpace = yuvData->mYUVColorSpace; + + const DrawBlitProg::BaseArgs baseArgs = { destSize, yFlip, clipRect, yTexSize }; + const DrawBlitProg::YUVArgs yuvArgs = { uvTexSize, divisors, colorSpace }; + + prog->Draw(baseArgs, &yuvArgs); + return true; +} + +// ------------------------------------- + +#ifdef XP_MACOSX +bool +GLBlitHelper::BlitImage(layers::MacIOSurfaceImage* const srcImage, + const gfx::IntSize& destSize, const OriginPos destOrigin) const +{ + MacIOSurface* const iosurf = srcImage->GetSurface(); + if (mGL->GetContextType() != GLContextType::CGL) { + MOZ_ASSERT(false); + return false; + } + const auto glCGL = static_cast(mGL); + const auto cglContext = glCGL->GetCGLContext(); + + const auto& srcOrigin = OriginPos::BottomLeft; + const bool yFlip = destOrigin != srcOrigin; + const gfx::IntRect clipRect({0, 0}, srcImage->GetSize()); + const gfx::IntSize texRectNormFactor(1, 1); + + const DrawBlitProg::BaseArgs baseArgs = { destSize, yFlip, clipRect, + texRectNormFactor }; + DrawBlitProg::YUVArgs yuvArgs = { texRectNormFactor, {2,2}, YUVColorSpace::BT601 }; + const DrawBlitProg::YUVArgs* pYuvArgs = nullptr; + + auto planes = iosurf->GetPlaneCount(); + if (!planes) { + planes = 1; // Bad API. No cookie. } - mGL->fDeleteTextures(2, textures); + const GLenum texTarget = LOCAL_GL_TEXTURE_RECTANGLE; + const char* const fragHeader = kFragHeader_Tex2DRect; + + const ScopedSaveMultiTex saveTex(mGL, planes, texTarget); + const ScopedTexture tex0(mGL); + const ScopedTexture tex1(mGL); + const ScopedTexture tex2(mGL); + const GLuint texs[3] = { + tex0, + tex1, + tex2 + }; + + const auto pixelFormat = iosurf->GetPixelFormat(); + const auto formatChars = (const char*)&pixelFormat; + const char formatStr[] = { + formatChars[3], + formatChars[2], + formatChars[1], + formatChars[0], + 0 + }; + if (mGL->ShouldSpew()) { + printf_stderr("iosurf format: %s (0x%08x)\n", formatStr, uint32_t(pixelFormat)); + } + + const char* fragBody; + GLenum internalFormats[3] = {0, 0, 0}; + GLenum unpackFormats[3] = {0, 0, 0}; + GLenum unpackTypes[3] = { LOCAL_GL_UNSIGNED_BYTE, + LOCAL_GL_UNSIGNED_BYTE, + LOCAL_GL_UNSIGNED_BYTE }; + switch (planes) { + case 1: + fragBody = kFragBody_RGBA; + internalFormats[0] = LOCAL_GL_RGBA; + unpackFormats[0] = LOCAL_GL_RGBA; + break; + case 2: + fragBody = kFragBody_NV12; + if (mGL->Version() >= 300) { + internalFormats[0] = LOCAL_GL_R8; + unpackFormats[0] = LOCAL_GL_RED; + internalFormats[1] = LOCAL_GL_RG8; + unpackFormats[1] = LOCAL_GL_RG; + } else { + internalFormats[0] = LOCAL_GL_LUMINANCE; + unpackFormats[0] = LOCAL_GL_LUMINANCE; + internalFormats[1] = LOCAL_GL_LUMINANCE_ALPHA; + unpackFormats[1] = LOCAL_GL_LUMINANCE_ALPHA; + } + pYuvArgs = &yuvArgs; + break; + case 3: + fragBody = kFragBody_PlanarYUV; + if (mGL->Version() >= 300) { + internalFormats[0] = LOCAL_GL_R8; + unpackFormats[0] = LOCAL_GL_RED; + } else { + internalFormats[0] = LOCAL_GL_LUMINANCE; + unpackFormats[0] = LOCAL_GL_LUMINANCE; + } + internalFormats[1] = internalFormats[0]; + internalFormats[2] = internalFormats[0]; + unpackFormats[1] = unpackFormats[0]; + unpackFormats[2] = unpackFormats[0]; + pYuvArgs = &yuvArgs; + break; + default: + gfxCriticalError() << "Unexpected plane count: " << planes; + return false; + } + + if (pixelFormat == '2vuy') { + fragBody = kFragBody_CrYCb; + // APPLE_rgb_422 adds RGB_RAW_422_APPLE for `internalFormat`, but only RGB seems + // to work? + internalFormats[0] = LOCAL_GL_RGB; + unpackFormats[0] = LOCAL_GL_RGB_422_APPLE; + unpackTypes[0] = LOCAL_GL_UNSIGNED_SHORT_8_8_APPLE; + pYuvArgs = &yuvArgs; + } + + for (uint32_t p = 0; p < planes; p++) { + mGL->fActiveTexture(LOCAL_GL_TEXTURE0 + p); + mGL->fBindTexture(texTarget, texs[p]); + mGL->TexParams_SetClampNoMips(texTarget); + + const auto width = iosurf->GetDevicePixelWidth(p); + const auto height = iosurf->GetDevicePixelHeight(p); + auto err = iosurf->CGLTexImageIOSurface2D(cglContext, texTarget, + internalFormats[p], width, height, + unpackFormats[p], unpackTypes[p], p); + if (err) { + const nsPrintfCString errStr("CGLTexImageIOSurface2D(context, target, 0x%04x," + " %u, %u, 0x%04x, 0x%04x, iosurfPtr, %u) -> %i", + internalFormats[p], uint32_t(width), + uint32_t(height), unpackFormats[p], + unpackTypes[p], p, err); + gfxCriticalError() << errStr.get() << " (iosurf format: " << formatStr << ")"; + return false; + } + } + + const auto& prog = GetDrawBlitProg({fragHeader, fragBody}); + if (!prog) + return false; + + prog->Draw(baseArgs, pYuvArgs); return true; } #endif -bool -GLBlitHelper::BlitImageToFramebuffer(layers::Image* srcImage, - const gfx::IntSize& destSize, - GLuint destFB, - OriginPos destOrigin) -{ - ScopedGLDrawState autoStates(mGL); - - BlitType type; - OriginPos srcOrigin; - - switch (srcImage->GetFormat()) { - case ImageFormat::PLANAR_YCBCR: - type = ConvertPlanarYCbCr; -#if defined(MOZ_WIDGET_ANDROID) - srcOrigin = OriginPos::TopLeft; -#else - srcOrigin = OriginPos::BottomLeft; -#endif // defined(MOZ_WIDGET_ANDROID) - break; - -#ifdef MOZ_WIDGET_ANDROID - case ImageFormat::SURFACE_TEXTURE: - type = ConvertSurfaceTexture; - srcOrigin = srcImage->AsSurfaceTextureImage()->GetOriginPos(); - break; - case ImageFormat::EGLIMAGE: - type = ConvertEGLImage; - srcOrigin = srcImage->AsEGLImageImage()->GetOriginPos(); - break; -#endif -#ifdef XP_MACOSX - case ImageFormat::MAC_IOSURFACE: - type = ConvertMacIOSurfaceImage; - srcOrigin = OriginPos::TopLeft; - break; -#endif - - default: - return false; - } - - bool init = InitTexQuadProgram(type); - if (!init) { - return false; - } - - const bool needsYFlip = (srcOrigin != destOrigin); - mGL->fUniform1f(mYFlipLoc, needsYFlip ? (float)1.0 : (float)0.0); - - ScopedBindFramebuffer boundFB(mGL, destFB); - mGL->fColorMask(LOCAL_GL_TRUE, LOCAL_GL_TRUE, LOCAL_GL_TRUE, LOCAL_GL_TRUE); - mGL->fViewport(0, 0, destSize.width, destSize.height); - - switch (type) { - case ConvertPlanarYCbCr: - return BlitPlanarYCbCrImage(static_cast(srcImage)); - -#ifdef MOZ_WIDGET_ANDROID - case ConvertSurfaceTexture: - return BlitSurfaceTextureImage(static_cast(srcImage)); - - case ConvertEGLImage: - return BlitEGLImageImage(static_cast(srcImage)); -#endif - -#ifdef XP_MACOSX - case ConvertMacIOSurfaceImage: - return BlitMacIOSurfaceImage(srcImage->AsMacIOSurfaceImage()); -#endif - - default: - return false; - } -} - -bool -GLBlitHelper::BlitImageToTexture(layers::Image* srcImage, - const gfx::IntSize& destSize, - GLuint destTex, - GLenum destTarget, - OriginPos destOrigin) -{ - ScopedFramebufferForTexture autoFBForTex(mGL, destTex, destTarget); - if (!autoFBForTex.IsComplete()) - return false; - - return BlitImageToFramebuffer(srcImage, destSize, autoFBForTex.FB(), destOrigin); -} +// ----------------------------------------------------------------------------- void -GLBlitHelper::BlitTextureToFramebuffer(GLuint srcTex, GLuint destFB, - const gfx::IntSize& srcSize, - const gfx::IntSize& destSize, - GLenum srcTarget, - bool internalFBs) -{ - MOZ_ASSERT(mGL->fIsTexture(srcTex)); - MOZ_ASSERT(!destFB || mGL->fIsFramebuffer(destFB)); - - if (mGL->IsSupported(GLFeature::framebuffer_blit)) { - ScopedFramebufferForTexture srcWrapper(mGL, srcTex, srcTarget); - MOZ_DIAGNOSTIC_ASSERT(srcWrapper.IsComplete()); - - BlitFramebufferToFramebuffer(srcWrapper.FB(), destFB, - srcSize, destSize, - internalFBs); - return; - } - - DrawBlitTextureToFramebuffer(srcTex, destFB, srcSize, destSize, srcTarget, - internalFBs); -} - - -void -GLBlitHelper::DrawBlitTextureToFramebuffer(GLuint srcTex, GLuint destFB, +GLBlitHelper::DrawBlitTextureToFramebuffer(const GLuint srcTex, const gfx::IntSize& srcSize, const gfx::IntSize& destSize, - GLenum srcTarget, - bool internalFBs) + const GLenum srcTarget) const { - BlitType type; + const gfx::IntRect clipRect(0, 0, srcSize.width, srcSize.height); + + DrawBlitProg::Key key; + gfx::IntSize texSizeDivisor; switch (srcTarget) { case LOCAL_GL_TEXTURE_2D: - type = BlitTex2D; + key = {kFragHeader_Tex2D, kFragBody_RGBA}; + texSizeDivisor = srcSize; break; case LOCAL_GL_TEXTURE_RECTANGLE_ARB: - type = BlitTexRect; + key = {kFragHeader_Tex2DRect, kFragBody_RGBA}; + texSizeDivisor = gfx::IntSize(1, 1); break; default: - MOZ_CRASH("GFX: Fatal Error: Bad `srcTarget`."); - break; - } - - ScopedGLDrawState autoStates(mGL); - const ScopedBindFramebuffer bindFB(mGL); - if (internalFBs) { - mGL->Screen()->BindFB_Internal(destFB); - } else { - mGL->BindFB(destFB); - } - - // Does destructive things to (only!) what we just saved above. - bool good = UseTexQuadProgram(type, srcSize); - if (!good) { - // We're up against the wall, so bail. - MOZ_DIAGNOSTIC_ASSERT(false, - "Error: Failed to prepare to blit texture->framebuffer.\n"); - mGL->fScissor(0, 0, destSize.width, destSize.height); - mGL->fColorMask(1, 1, 1, 1); - mGL->fClear(LOCAL_GL_COLOR_BUFFER_BIT); + gfxCriticalError() << "Unexpected srcTarget: " << srcTarget; return; } + const auto& prog = GetDrawBlitProg(key); + MOZ_ASSERT(prog); - const ScopedBindTexture bindTex(mGL, srcTex, srcTarget); - mGL->fDrawArrays(LOCAL_GL_TRIANGLE_STRIP, 0, 4); + const ScopedSaveMultiTex saveTex(mGL, 1, srcTarget); + mGL->fBindTexture(srcTarget, srcTex); + + const bool yFlip = false; + const DrawBlitProg::BaseArgs baseArgs = { destSize, yFlip, clipRect, texSizeDivisor }; + prog->Draw(baseArgs); +} + +// ----------------------------------------------------------------------------- + +void +GLBlitHelper::BlitFramebuffer(const gfx::IntSize& srcSize, + const gfx::IntSize& destSize) const +{ + MOZ_ASSERT(mGL->IsSupported(GLFeature::framebuffer_blit)); + + const ScopedGLState scissor(mGL, LOCAL_GL_SCISSOR_TEST, false); + mGL->fBlitFramebuffer(0, 0, srcSize.width, srcSize.height, + 0, 0, destSize.width, destSize.height, + LOCAL_GL_COLOR_BUFFER_BIT, + LOCAL_GL_NEAREST); +} + +// -- + +void +GLBlitHelper::BlitFramebufferToFramebuffer(const GLuint srcFB, const GLuint destFB, + const gfx::IntSize& srcSize, + const gfx::IntSize& destSize) const +{ + MOZ_ASSERT(mGL->IsSupported(GLFeature::framebuffer_blit)); + MOZ_ASSERT(!srcFB || mGL->fIsFramebuffer(srcFB)); + MOZ_ASSERT(!destFB || mGL->fIsFramebuffer(destFB)); + + const ScopedBindFramebuffer boundFB(mGL); + mGL->fBindFramebuffer(LOCAL_GL_READ_FRAMEBUFFER, srcFB); + mGL->fBindFramebuffer(LOCAL_GL_DRAW_FRAMEBUFFER, destFB); + + BlitFramebuffer(srcSize, destSize); } void -GLBlitHelper::BlitFramebufferToTexture(GLuint srcFB, GLuint destTex, +GLBlitHelper::BlitTextureToFramebuffer(GLuint srcTex, const gfx::IntSize& srcSize, + const gfx::IntSize& destSize, + GLenum srcTarget) const +{ + MOZ_ASSERT(mGL->fIsTexture(srcTex)); + + if (mGL->IsSupported(GLFeature::framebuffer_blit)) { + const ScopedFramebufferForTexture srcWrapper(mGL, srcTex, srcTarget); + const ScopedBindFramebuffer bindFB(mGL); + mGL->fBindFramebuffer(LOCAL_GL_READ_FRAMEBUFFER, srcWrapper.FB()); + BlitFramebuffer(srcSize, destSize); + return; + } + + DrawBlitTextureToFramebuffer(srcTex, srcSize, destSize, srcTarget); +} + +void +GLBlitHelper::BlitFramebufferToTexture(GLuint destTex, const gfx::IntSize& srcSize, const gfx::IntSize& destSize, - GLenum destTarget, - bool internalFBs) + GLenum destTarget) const { - // On the Android 4.3 emulator, IsFramebuffer may return false incorrectly. - MOZ_ASSERT_IF(mGL->Renderer() != GLRenderer::AndroidEmulator, !srcFB || mGL->fIsFramebuffer(srcFB)); MOZ_ASSERT(mGL->fIsTexture(destTex)); if (mGL->IsSupported(GLFeature::framebuffer_blit)) { - ScopedFramebufferForTexture destWrapper(mGL, destTex, destTarget); - - BlitFramebufferToFramebuffer(srcFB, destWrapper.FB(), - srcSize, destSize, - internalFBs); + const ScopedFramebufferForTexture destWrapper(mGL, destTex, destTarget); + const ScopedBindFramebuffer bindFB(mGL); + mGL->fBindFramebuffer(LOCAL_GL_DRAW_FRAMEBUFFER, destWrapper.FB()); + BlitFramebuffer(srcSize, destSize); return; } ScopedBindTexture autoTex(mGL, destTex, destTarget); - - ScopedBindFramebuffer boundFB(mGL); - if (internalFBs) { - mGL->Screen()->BindFB_Internal(srcFB); - } else { - mGL->BindFB(srcFB); - } - ScopedGLState scissor(mGL, LOCAL_GL_SCISSOR_TEST, false); mGL->fCopyTexSubImage2D(destTarget, 0, - 0, 0, - 0, 0, - srcSize.width, srcSize.height); + 0, 0, + 0, 0, + srcSize.width, srcSize.height); } void GLBlitHelper::BlitTextureToTexture(GLuint srcTex, GLuint destTex, const gfx::IntSize& srcSize, const gfx::IntSize& destSize, - GLenum srcTarget, GLenum destTarget) + GLenum srcTarget, GLenum destTarget) const { MOZ_ASSERT(mGL->fIsTexture(srcTex)); MOZ_ASSERT(mGL->fIsTexture(destTex)); - // Generally, just use the CopyTexSubImage path - ScopedFramebufferForTexture srcWrapper(mGL, srcTex, srcTarget); - - BlitFramebufferToTexture(srcWrapper.FB(), destTex, - srcSize, destSize, destTarget); + // Start down the CopyTexSubImage path, not the DrawBlit path. + const ScopedFramebufferForTexture srcWrapper(mGL, srcTex, srcTarget); + const ScopedBindFramebuffer bindFB(mGL, srcWrapper.FB()); + BlitFramebufferToTexture(destTex, srcSize, destSize, destTarget); } } // namespace gl diff --git a/gfx/gl/GLBlitHelper.h b/gfx/gl/GLBlitHelper.h index 6eef2fd85728..81a1a0462f17 100644 --- a/gfx/gl/GLBlitHelper.h +++ b/gfx/gl/GLBlitHelper.h @@ -10,154 +10,196 @@ #include "GLContextTypes.h" #include "GLConsts.h" #include "nsSize.h" +#include "ipc/IPCMessageUtils.h" #include "mozilla/Attributes.h" #include "mozilla/gfx/Point.h" +#include "../layers/ImageTypes.h" + +#ifdef XP_WIN +#include +#endif namespace mozilla { namespace layers { +class D3D11YCbCrImage; class Image; +class GPUVideoImage; class PlanarYCbCrImage; class SurfaceTextureImage; class MacIOSurfaceImage; class EGLImageImage; +class SurfaceDescriptorD3D10; +class SurfaceDescriptorDXGIYCbCr; } // namespace layers namespace gl { +class BindAnglePlanes; class GLContext; +bool +GuessDivisors(const gfx::IntSize& ySize, const gfx::IntSize& uvSize, + gfx::IntSize* const out_divisors); + +class DrawBlitProg final +{ + const GLBlitHelper& mParent; + const GLuint mProg; + const GLint mLoc_u1ForYFlip; + const GLint mLoc_uSrcRect; + const GLint mLoc_uTexSize0; + const GLint mLoc_uTexSize1; + const GLint mLoc_uDivisors; + const GLint mLoc_uColorMatrix; + +public: + struct Key final { + const char* fragHeader; + const char* fragBody; + + bool operator <(const Key& x) const { + if (fragHeader != x.fragHeader) + return fragHeader < x.fragHeader; + return fragBody < x.fragBody; + } + }; + + DrawBlitProg(const GLBlitHelper* parent, GLuint prog); + ~DrawBlitProg(); + + struct BaseArgs final { + gfx::IntSize destSize; + bool yFlip; + gfx::IntRect srcRect; + gfx::IntSize texSize0; + }; + struct YUVArgs final { + gfx::IntSize texSize1; + gfx::IntSize divisors; + YUVColorSpace colorSpace; + }; + + void Draw(const BaseArgs& args, const YUVArgs* argsYUV = nullptr) const; +}; + +class ScopedSaveMultiTex final +{ + GLContext& mGL; + const uint8_t mTexCount; + const GLenum mTexTarget; + const GLuint mOldTexUnit; + GLuint mOldTexSampler[3]; + GLuint mOldTex[3]; + +public: + ScopedSaveMultiTex(GLContext* gl, uint8_t texCount, GLenum texTarget); + ~ScopedSaveMultiTex(); +}; + /** Buffer blitting helper */ class GLBlitHelper final { - enum Channel - { - Channel_Y = 0, - Channel_Cb, - Channel_Cr, - Channel_Max, - }; + friend class BindAnglePlanes; + friend class DrawBlitProg; + friend class GLContext; - /** - * BlitTex2D is used to copy blit the content of a GL_TEXTURE_2D object, - * BlitTexRect is used to copy blit the content of a GL_TEXTURE_RECT object, - * The difference between BlitTex2D and BlitTexRect is the texture type, which affect - * the fragment shader a bit. - * - * ConvertPlnarYcbCr is used to color convert copy blit the PlanarYCbCrImage - * into a normal RGB texture by create textures of each color channel, and - * convert it in GPU. - * Convert type is created for canvas. - */ - enum BlitType - { - BlitTex2D, - BlitTexRect, - ConvertPlanarYCbCr, - ConvertSurfaceTexture, - ConvertEGLImage, - ConvertMacIOSurfaceImage - }; - // The GLContext is the sole owner of the GLBlitHelper. - GLContext* mGL; + GLContext* const mGL; + mutable std::map mDrawBlitProgs; - GLuint mTexBlit_Buffer; - GLuint mTexBlit_VertShader; - GLuint mTex2DBlit_FragShader; - GLuint mTex2DRectBlit_FragShader; - GLuint mTex2DBlit_Program; - GLuint mTex2DRectBlit_Program; + GLuint mQuadVAO; + nsCString mDrawBlitProg_VersionLine; + const GLuint mDrawBlitProg_VertShader; - GLint mYFlipLoc; + GLuint mYuvUploads[3]; + gfx::IntSize mYuvUploads_YSize; + gfx::IntSize mYuvUploads_UVSize; - GLint mTextureTransformLoc; +#ifdef XP_WIN + mutable RefPtr mD3D11; - // Data for image blit path - GLuint mTexExternalBlit_FragShader; - GLuint mTexYUVPlanarBlit_FragShader; - GLuint mTexNV12PlanarBlit_FragShader; - GLuint mTexExternalBlit_Program; - GLuint mTexYUVPlanarBlit_Program; - GLuint mTexNV12PlanarBlit_Program; - GLuint mFBO; - GLuint mSrcTexY; - GLuint mSrcTexCb; - GLuint mSrcTexCr; - GLuint mSrcTexEGL; - GLint mYTexScaleLoc; - GLint mCbCrTexScaleLoc; - GLint mYuvColorMatrixLoc; - int mTexWidth; - int mTexHeight; + ID3D11Device* GetD3D11() const; +#endif - // Cache some uniform values - float mCurYScale; - float mCurCbCrScale; + const DrawBlitProg* GetDrawBlitProg(const DrawBlitProg::Key& key) const; +private: + const DrawBlitProg* CreateDrawBlitProg(const DrawBlitProg::Key& key) const; +public: - void UseBlitProgram(); - void SetBlitFramebufferForDestTexture(GLuint aTexture); - - bool UseTexQuadProgram(BlitType target, const gfx::IntSize& srcSize); - bool InitTexQuadProgram(BlitType target = BlitTex2D); - void DeleteTexBlitProgram(); - void BindAndUploadYUVTexture(Channel which, uint32_t width, uint32_t height, void* data, bool allocation); - void BindAndUploadEGLImage(EGLImage image, GLuint target); - - bool BlitPlanarYCbCrImage(layers::PlanarYCbCrImage* yuvImage); + bool BlitImage(layers::PlanarYCbCrImage* yuvImage, const gfx::IntSize& destSize, + OriginPos destOrigin); #ifdef MOZ_WIDGET_ANDROID // Blit onto the current FB. - bool BlitSurfaceTextureImage(layers::SurfaceTextureImage* stImage); - bool BlitEGLImageImage(layers::EGLImageImage* eglImage); + bool BlitImage(layers::SurfaceTextureImage* stImage, const gfx::IntSize& destSize, + OriginPos destOrigin) const; + bool BlitImage(layers::EGLImageImage* eglImage, const gfx::IntSize& destSize, + OriginPos destOrigin) const; #endif #ifdef XP_MACOSX - bool BlitMacIOSurfaceImage(layers::MacIOSurfaceImage* ioImage); + bool BlitImage(layers::MacIOSurfaceImage* srcImage, const gfx::IntSize& destSize, + OriginPos destOrigin) const; #endif explicit GLBlitHelper(GLContext* gl); - - friend class GLContext; - public: ~GLBlitHelper(); - // If you don't have |srcFormats| for the 2nd definition, - // then you'll need the framebuffer_blit extensions to use - // the first BlitFramebufferToFramebuffer. + void BlitFramebuffer(const gfx::IntSize& srcSize, + const gfx::IntSize& destSize) const; void BlitFramebufferToFramebuffer(GLuint srcFB, GLuint destFB, const gfx::IntSize& srcSize, - const gfx::IntSize& destSize, - bool internalFBs = false); - void BlitFramebufferToFramebuffer(GLuint srcFB, GLuint destFB, - const gfx::IntSize& srcSize, - const gfx::IntSize& destSize, - const GLFormats& srcFormats, - bool internalFBs = false); - void BlitTextureToFramebuffer(GLuint srcTex, GLuint destFB, - const gfx::IntSize& srcSize, + const gfx::IntSize& destSize) const; + void BlitFramebufferToTexture(GLuint destTex, const gfx::IntSize& srcSize, const gfx::IntSize& destSize, - GLenum srcTarget = LOCAL_GL_TEXTURE_2D, - bool internalFBs = false); - void DrawBlitTextureToFramebuffer(GLuint srcTex, GLuint destFB, - const gfx::IntSize& srcSize, - const gfx::IntSize& destSize, - GLenum srcTarget = LOCAL_GL_TEXTURE_2D, - bool internalFBs = false); - void BlitFramebufferToTexture(GLuint srcFB, GLuint destTex, - const gfx::IntSize& srcSize, + GLenum destTarget = LOCAL_GL_TEXTURE_2D) const; + void BlitTextureToFramebuffer(GLuint srcTex, const gfx::IntSize& srcSize, const gfx::IntSize& destSize, - GLenum destTarget = LOCAL_GL_TEXTURE_2D, - bool internalFBs = false); + GLenum srcTarget = LOCAL_GL_TEXTURE_2D) const; void BlitTextureToTexture(GLuint srcTex, GLuint destTex, const gfx::IntSize& srcSize, const gfx::IntSize& destSize, GLenum srcTarget = LOCAL_GL_TEXTURE_2D, - GLenum destTarget = LOCAL_GL_TEXTURE_2D); + GLenum destTarget = LOCAL_GL_TEXTURE_2D) const; + + + void DrawBlitTextureToFramebuffer(GLuint srcTex, const gfx::IntSize& srcSize, + const gfx::IntSize& destSize, + GLenum srcTarget = LOCAL_GL_TEXTURE_2D) const; + bool BlitImageToFramebuffer(layers::Image* srcImage, const gfx::IntSize& destSize, - GLuint destFB, OriginPos destOrigin); - bool BlitImageToTexture(layers::Image* srcImage, const gfx::IntSize& destSize, - GLuint destTex, GLenum destTarget, OriginPos destOrigin); + OriginPos destOrigin); + +private: +#ifdef XP_WIN + // GLBlitHelperD3D.cpp: + bool BlitImage(layers::GPUVideoImage* srcImage, const gfx::IntSize& destSize, + OriginPos destOrigin) const; + bool BlitImage(layers::D3D11YCbCrImage* srcImage, const gfx::IntSize& destSize, + OriginPos destOrigin) const; + + bool BlitDescriptor(const layers::SurfaceDescriptorD3D10& desc, + const gfx::IntSize& destSize, OriginPos destOrigin) const; + + bool BlitAngleYCbCr(const WindowsHandle (&handleList)[3], + const gfx::IntRect& clipRect, + const gfx::IntSize& ySize, const gfx::IntSize& uvSize, + const YUVColorSpace colorSpace, + const gfx::IntSize& destSize, OriginPos destOrigin) const; + + bool BlitAnglePlanes(uint8_t numPlanes, const RefPtr* texD3DList, + const DrawBlitProg* prog, const DrawBlitProg::BaseArgs& baseArgs, + const DrawBlitProg::YUVArgs* const yuvArgs) const; +#endif }; +extern const char* const kFragHeader_Tex2D; +extern const char* const kFragHeader_Tex2DRect; +extern const char* const kFragHeader_TexExt; +extern const char* const kFragBody_RGBA; +extern const char* const kFragBody_CrYCb; +extern const char* const kFragBody_NV12; +extern const char* const kFragBody_PlanarYUV; + } // namespace gl } // namespace mozilla diff --git a/gfx/gl/GLBlitHelperD3D.cpp b/gfx/gl/GLBlitHelperD3D.cpp new file mode 100644 index 000000000000..35fd0e4911b5 --- /dev/null +++ b/gfx/gl/GLBlitHelperD3D.cpp @@ -0,0 +1,334 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* vim: set ts=8 sts=4 et sw=4 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 "GLBlitHelper.h" + +#include + +#include "GLContext.h" +#include "GLLibraryEGL.h" +#include "GPUVideoImage.h" +#include "ScopedGLHelpers.h" + +#include "mozilla/layers/D3D11YCbCrImage.h" +#include "mozilla/layers/TextureD3D11.h" + +namespace mozilla { +namespace gl { + +static EGLStreamKHR +StreamFromD3DTexture(ID3D11Texture2D* const texD3D, + const EGLAttrib* const postAttribs) +{ + auto& egl = sEGLLibrary; + const auto& display = egl.Display(); + const auto stream = egl.fCreateStreamKHR(display, nullptr); + MOZ_ASSERT(stream); + if (!stream) + return 0; + bool ok = true; + MOZ_ALWAYS_TRUE( ok &= bool(egl.fStreamConsumerGLTextureExternalAttribsNV(display, + stream, + nullptr)) ); + MOZ_ALWAYS_TRUE( ok &= bool(egl.fCreateStreamProducerD3DTextureNV12ANGLE(display, + stream, + nullptr)) ); + MOZ_ALWAYS_TRUE( ok &= bool(egl.fStreamPostD3DTextureNV12ANGLE(display, stream, + texD3D, + postAttribs)) ); + if (ok) + return stream; + + (void)egl.fDestroyStreamKHR(display, stream); + return 0; +} + +static RefPtr +OpenSharedTexture(ID3D11Device* const d3d, const WindowsHandle handle) +{ + RefPtr tex; + auto hr = d3d->OpenSharedResource((HANDLE)handle, __uuidof(ID3D11Texture2D), + (void**)(ID3D11Texture2D**)getter_AddRefs(tex)); + if (FAILED(hr)) { + MOZ_ASSERT(false, "OpenSharedResource should not fail"); + return nullptr; + } + return tex; +} + +// ------------------------------------- + +class BindAnglePlanes final +{ + const GLBlitHelper& mParent; + const uint8_t mNumPlanes; + const ScopedSaveMultiTex mMultiTex; + GLuint mTempTexs[3]; + EGLStreamKHR mStreams[3]; + RefPtr mMutexList[3]; + bool mSuccess; + +public: + BindAnglePlanes(const GLBlitHelper* const parent, const uint8_t numPlanes, + const RefPtr* const texD3DList, + const EGLAttrib* const* postAttribsList = nullptr) + : mParent(*parent) + , mNumPlanes(numPlanes) + , mMultiTex(mParent.mGL, mNumPlanes, LOCAL_GL_TEXTURE_EXTERNAL) + , mTempTexs{0} + , mStreams{0} + , mSuccess(true) + { + MOZ_RELEASE_ASSERT(numPlanes >= 1 && numPlanes <= 3); + + const auto& gl = mParent.mGL; + auto& egl = sEGLLibrary; + const auto& display = egl.Display(); + + gl->fGenTextures(numPlanes, mTempTexs); + + for (uint8_t i = 0; i < mNumPlanes; i++) { + gl->fActiveTexture(LOCAL_GL_TEXTURE0 + i); + gl->fBindTexture(LOCAL_GL_TEXTURE_EXTERNAL, mTempTexs[i]); + const EGLAttrib* postAttribs = nullptr; + if (postAttribsList) { + postAttribs = postAttribsList[i]; + } + mStreams[i] = StreamFromD3DTexture(texD3DList[i], postAttribs); + mSuccess &= bool(mStreams[i]); + } + + if (mSuccess) { + for (uint8_t i = 0; i < mNumPlanes; i++) { + MOZ_ALWAYS_TRUE( egl.fStreamConsumerAcquireKHR(display, mStreams[i]) ); + + auto& mutex = mMutexList[i]; + texD3DList[i]->QueryInterface(_uuidof(IDXGIKeyedMutex), + (void**)getter_AddRefs(mutex)); + if (mutex) { + const auto hr = mutex->AcquireSync(0, 100); + if (FAILED(hr)) { + NS_WARNING("BindAnglePlanes failed to acquire KeyedMutex."); + mSuccess = false; + } + } + } + } + } + + ~BindAnglePlanes() + { + const auto& gl = mParent.mGL; + auto& egl = sEGLLibrary; + const auto& display = egl.Display(); + + if (mSuccess) { + for (uint8_t i = 0; i < mNumPlanes; i++) { + MOZ_ALWAYS_TRUE( egl.fStreamConsumerReleaseKHR(display, mStreams[i]) ); + if (mMutexList[i]) { + mMutexList[i]->ReleaseSync(0); + } + } + } + + for (uint8_t i = 0; i < mNumPlanes; i++) { + (void)egl.fDestroyStreamKHR(display, mStreams[i]); + } + + gl->fDeleteTextures(mNumPlanes, mTempTexs); + } + + const bool& Success() const { return mSuccess; } +}; + +// ------------------------------------- + +ID3D11Device* +GLBlitHelper::GetD3D11() const +{ + if (mD3D11) + return mD3D11; + + if (!mGL->IsANGLE()) + return nullptr; + + auto& egl = sEGLLibrary; + EGLDeviceEXT deviceEGL = 0; + MOZ_ALWAYS_TRUE( egl.fQueryDisplayAttribEXT(egl.Display(), LOCAL_EGL_DEVICE_EXT, + (EGLAttrib*)&deviceEGL) ); + if (!egl.fQueryDeviceAttribEXT(deviceEGL, LOCAL_EGL_D3D11_DEVICE_ANGLE, + (EGLAttrib*)(ID3D11Device**)getter_AddRefs(mD3D11))) + { + MOZ_ASSERT(false, "d3d9?"); + return nullptr; + } + return mD3D11; +} + +// ------------------------------------- + +bool +GLBlitHelper::BlitImage(layers::GPUVideoImage* const srcImage, + const gfx::IntSize& destSize, const OriginPos destOrigin) const +{ + const auto& data = srcImage->GetData(); + if (!data) + return false; + + const auto& desc = data->SD(); + const auto& subdescUnion = desc.subdesc(); + switch (subdescUnion.type()) { + case subdescUnion.TSurfaceDescriptorD3D10: + { + const auto& subdesc = subdescUnion.get_SurfaceDescriptorD3D10(); + return BlitDescriptor(subdesc, destSize, destOrigin); + } + case subdescUnion.TSurfaceDescriptorDXGIYCbCr: + { + const auto& subdesc = subdescUnion.get_SurfaceDescriptorDXGIYCbCr(); + + const auto& clipSize = subdesc.size(); + const auto& ySize = subdesc.sizeY(); + const auto& uvSize = subdesc.sizeCbCr(); + + const gfx::IntRect clipRect(0, 0, clipSize.width, clipSize.height); + const auto colorSpace = YUVColorSpace::BT601; + + const WindowsHandle handles[3] = { + subdesc.handleY(), + subdesc.handleCb(), + subdesc.handleCr() + }; + return BlitAngleYCbCr(handles, clipRect, ySize, uvSize, colorSpace, destSize, + destOrigin); + } + default: + gfxCriticalError() << "Unhandled subdesc type: " << uint32_t(subdescUnion.type()); + return false; + } +} + +// ------------------------------------- + +bool +GLBlitHelper::BlitImage(layers::D3D11YCbCrImage* const srcImage, + const gfx::IntSize& destSize, const OriginPos destOrigin) const +{ + const auto& data = srcImage->GetData(); + if (!data) + return false; + + const auto& clipRect = srcImage->mPictureRect; + const auto& colorSpace = srcImage->mColorSpace; + + const WindowsHandle handles[3] = { + (WindowsHandle)data->mHandles[0], + (WindowsHandle)data->mHandles[1], + (WindowsHandle)data->mHandles[2] + }; + return BlitAngleYCbCr(handles, srcImage->mPictureRect, srcImage->mYSize, + srcImage->mCbCrSize, srcImage->mColorSpace, destSize, + destOrigin); +} + +// ------------------------------------- + +bool +GLBlitHelper::BlitDescriptor(const layers::SurfaceDescriptorD3D10& desc, + const gfx::IntSize& destSize, OriginPos destOrigin) const +{ + const auto& d3d = GetD3D11(); + if (!d3d) + return false; + + const auto& handle = desc.handle(); + const auto& format = desc.format(); + const auto& clipSize = desc.size(); + + const auto srcOrigin = OriginPos::BottomLeft; + const gfx::IntRect clipRect(0, 0, clipSize.width, clipSize.height); + const auto colorSpace = YUVColorSpace::BT601; + + if (format != gfx::SurfaceFormat::NV12) { + gfxCriticalError() << "Non-NV12 format for SurfaceDescriptorD3D10: " + << uint32_t(format); + return nullptr; + } + + const auto tex = OpenSharedTexture(d3d, handle); + const RefPtr texList[2] = { tex, tex }; + const EGLAttrib postAttribs0[] = { + LOCAL_EGL_NATIVE_BUFFER_PLANE_OFFSET_IMG, 0, + LOCAL_EGL_NONE + }; + const EGLAttrib postAttribs1[] = { + LOCAL_EGL_NATIVE_BUFFER_PLANE_OFFSET_IMG, 1, + LOCAL_EGL_NONE + }; + const EGLAttrib* const postAttribsList[2] = { postAttribs0, postAttribs1 }; + // /layers/d3d11/CompositorD3D11.cpp uses bt601 for EffectTypes::NV12. + //return BlitAngleNv12(tex, YUVColorSpace::BT601, destSize, destOrigin); + + const BindAnglePlanes bindPlanes(this, 2, texList, postAttribsList); + + D3D11_TEXTURE2D_DESC texDesc = {0}; + tex->GetDesc(&texDesc); + + const gfx::IntSize ySize(texDesc.Width, texDesc.Height); + const gfx::IntSize divisors(2, 2); + MOZ_ASSERT(ySize.width % divisors.width == 0); + MOZ_ASSERT(ySize.height % divisors.height == 0); + const gfx::IntSize uvSize(ySize.width / divisors.width, + ySize.height / divisors.height); + + const bool yFlip = destOrigin != srcOrigin; + const DrawBlitProg::BaseArgs baseArgs = { destSize, yFlip, clipRect, ySize }; + const DrawBlitProg::YUVArgs yuvArgs = { uvSize, divisors, colorSpace }; + + const auto& prog = GetDrawBlitProg({kFragHeader_TexExt, kFragBody_NV12}); + MOZ_RELEASE_ASSERT(prog); + prog->Draw(baseArgs, &yuvArgs); + return true; +} + +// -- + +bool +GLBlitHelper::BlitAngleYCbCr(const WindowsHandle (&handleList)[3], + const gfx::IntRect& clipRect, + const gfx::IntSize& ySize, const gfx::IntSize& uvSize, + const YUVColorSpace colorSpace, + const gfx::IntSize& destSize, OriginPos destOrigin) const +{ + const auto& d3d = GetD3D11(); + if (!d3d) + return false; + + const auto srcOrigin = OriginPos::BottomLeft; + + gfx::IntSize divisors; + if (!GuessDivisors(ySize, uvSize, &divisors)) + return false; + + const RefPtr texList[3] = { + OpenSharedTexture(d3d, handleList[0]), + OpenSharedTexture(d3d, handleList[1]), + OpenSharedTexture(d3d, handleList[2]) + }; + const BindAnglePlanes bindPlanes(this, 3, texList); + + const bool yFlip = destOrigin != srcOrigin; + const DrawBlitProg::BaseArgs baseArgs = { destSize, yFlip, clipRect, ySize }; + const DrawBlitProg::YUVArgs yuvArgs = { uvSize, divisors, colorSpace }; + + const auto& prog = GetDrawBlitProg({kFragHeader_TexExt, kFragBody_PlanarYUV}); + MOZ_RELEASE_ASSERT(prog); + prog->Draw(baseArgs, &yuvArgs); + return true; +} + +} // namespace gl +} // namespace mozilla diff --git a/gfx/gl/GLContext.h b/gfx/gl/GLContext.h index c4f159614479..60d99b01af60 100644 --- a/gfx/gl/GLContext.h +++ b/gfx/gl/GLContext.h @@ -1417,6 +1417,22 @@ public: return retval; } + void SetEnabled(const GLenum cap, const bool val) { + if (val) { + fEnable(cap); + } else { + fDisable(cap); + } + } + + bool PushEnabled(const GLenum cap, const bool newVal) { + const bool oldVal = fIsEnabled(cap); + if (oldVal != newVal) { + SetEnabled(cap, newVal); + } + return oldVal; + } + realGLboolean fIsProgram(GLuint program) { BEFORE_GL_CALL; realGLboolean retval = mSymbols.fIsProgram(program); diff --git a/gfx/gl/GLContextEGL.h b/gfx/gl/GLContextEGL.h index da3b08795d28..1c24cc56cdfc 100644 --- a/gfx/gl/GLContextEGL.h +++ b/gfx/gl/GLContextEGL.h @@ -114,7 +114,7 @@ protected: friend class GLContextEGLFactory; public: - const EGLConfig mConfig; + const EGLConfig mConfig; protected: EGLSurface mSurface; public: diff --git a/gfx/gl/GLLibraryEGL.cpp b/gfx/gl/GLLibraryEGL.cpp index 6978389a0868..101a44ce05a6 100644 --- a/gfx/gl/GLLibraryEGL.cpp +++ b/gfx/gl/GLLibraryEGL.cpp @@ -610,6 +610,7 @@ GLLibraryEGL::EnsureInitialized(bool forceAccel, nsACString* const out_failureId if (IsExtensionSupported(KHR_stream_consumer_gltexture)) { const GLLibraryLoader::SymLoadStruct streamConsumerSymbols[] = { + SYMBOL(StreamConsumerGLTextureExternalKHR), SYMBOL(StreamConsumerAcquireKHR), SYMBOL(StreamConsumerReleaseKHR), END_OF_SYMBOLS diff --git a/gfx/gl/GLLibraryEGL.h b/gfx/gl/GLLibraryEGL.h index 73823387c160..4fa2f1aaf633 100644 --- a/gfx/gl/GLLibraryEGL.h +++ b/gfx/gl/GLLibraryEGL.h @@ -300,6 +300,9 @@ public: WRAP( fQueryStreamKHR(dpy, stream, attribute, value) ) // KHR_stream_consumer_gltexture + EGLBoolean fStreamConsumerGLTextureExternalKHR(EGLDisplay dpy, EGLStreamKHR stream) const + WRAP( fStreamConsumerGLTextureExternalKHR(dpy, stream) ) + EGLBoolean fStreamConsumerAcquireKHR(EGLDisplay dpy, EGLStreamKHR stream) const WRAP( fStreamConsumerAcquireKHR(dpy, stream) ) @@ -467,6 +470,8 @@ private: EGLenum attribute, EGLint* value); // KHR_stream_consumer_gltexture + EGLBoolean (GLAPIENTRY * fStreamConsumerGLTextureExternalKHR)(EGLDisplay dpy, + EGLStreamKHR stream); EGLBoolean (GLAPIENTRY * fStreamConsumerAcquireKHR)(EGLDisplay dpy, EGLStreamKHR stream); EGLBoolean (GLAPIENTRY * fStreamConsumerReleaseKHR)(EGLDisplay dpy, diff --git a/gfx/gl/HeapCopyOfStackArray.h b/gfx/gl/HeapCopyOfStackArray.h index 2fae79245aa2..f81445a5aee0 100644 --- a/gfx/gl/HeapCopyOfStackArray.h +++ b/gfx/gl/HeapCopyOfStackArray.h @@ -23,7 +23,7 @@ class HeapCopyOfStackArray { public: template - MOZ_IMPLICIT HeapCopyOfStackArray(ElemType (&array)[N]) + MOZ_IMPLICIT HeapCopyOfStackArray(const ElemType (&array)[N]) : mArrayLength(N) , mArrayData(MakeUnique(N)) { diff --git a/gfx/gl/ScopedGLHelpers.cpp b/gfx/gl/ScopedGLHelpers.cpp index e2feb7b0dc3a..69127a0e224e 100644 --- a/gfx/gl/ScopedGLHelpers.cpp +++ b/gfx/gl/ScopedGLHelpers.cpp @@ -423,75 +423,6 @@ ScopedVertexAttribPointer::UnwrapImpl() mGL->fBindBuffer(LOCAL_GL_ARRAY_BUFFER, mBoundBuffer); } -ScopedGLDrawState::ScopedGLDrawState(GLContext* aGL) - : blend (aGL, LOCAL_GL_BLEND, false) - , cullFace (aGL, LOCAL_GL_CULL_FACE, false) - , depthTest (aGL, LOCAL_GL_DEPTH_TEST, false) - , dither (aGL, LOCAL_GL_DITHER, false) - , polyOffsFill(aGL, LOCAL_GL_POLYGON_OFFSET_FILL, false) - , sampleAToC (aGL, LOCAL_GL_SAMPLE_ALPHA_TO_COVERAGE, false) - , sampleCover (aGL, LOCAL_GL_SAMPLE_COVERAGE, false) - , scissor (aGL, LOCAL_GL_SCISSOR_TEST, false) - , stencil (aGL, LOCAL_GL_STENCIL_TEST, false) - , mGL(aGL) -{ - mGL->GetUIntegerv(LOCAL_GL_CURRENT_PROGRAM, &boundProgram); - mGL->GetUIntegerv(LOCAL_GL_ARRAY_BUFFER_BINDING, &boundBuffer); - mGL->GetUIntegerv(LOCAL_GL_MAX_VERTEX_ATTRIBS, &maxAttrib); - attrib_enabled = MakeUnique(maxAttrib); - - for (GLuint i = 0; i < maxAttrib; i++) { - mGL->fGetVertexAttribiv(i, LOCAL_GL_VERTEX_ATTRIB_ARRAY_ENABLED, &attrib_enabled[i]); - mGL->fDisableVertexAttribArray(i); - } - // Only Attrib0's client side state affected - mGL->fGetVertexAttribiv(0, LOCAL_GL_VERTEX_ATTRIB_ARRAY_SIZE, &attrib0_size); - mGL->fGetVertexAttribiv(0, LOCAL_GL_VERTEX_ATTRIB_ARRAY_STRIDE, &attrib0_stride); - mGL->fGetVertexAttribiv(0, LOCAL_GL_VERTEX_ATTRIB_ARRAY_TYPE, &attrib0_type); - mGL->fGetVertexAttribiv(0, LOCAL_GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, &attrib0_normalized); - mGL->fGetVertexAttribiv(0, LOCAL_GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, &attrib0_bufferBinding); - mGL->fGetVertexAttribPointerv(0, LOCAL_GL_VERTEX_ATTRIB_ARRAY_POINTER, &attrib0_pointer); - mGL->fGetBooleanv(LOCAL_GL_COLOR_WRITEMASK, colorMask); - mGL->fGetIntegerv(LOCAL_GL_VIEWPORT, viewport); - mGL->fGetIntegerv(LOCAL_GL_SCISSOR_BOX, scissorBox); -} - -ScopedGLDrawState::~ScopedGLDrawState() -{ - MOZ_ASSERT(mGL->IsCurrent()); - - mGL->fScissor(scissorBox[0], scissorBox[1], - scissorBox[2], scissorBox[3]); - - mGL->fViewport(viewport[0], viewport[1], - viewport[2], viewport[3]); - - mGL->fColorMask(colorMask[0], - colorMask[1], - colorMask[2], - colorMask[3]); - - for (unsigned int i = 0; i < maxAttrib; i++) { - if (attrib_enabled[i]) - mGL->fEnableVertexAttribArray(i); - else - mGL->fDisableVertexAttribArray(i); - } - - - mGL->fBindBuffer(LOCAL_GL_ARRAY_BUFFER, attrib0_bufferBinding); - mGL->fVertexAttribPointer(0, - attrib0_size, - attrib0_type, - attrib0_normalized, - attrib0_stride, - attrib0_pointer); - - mGL->fBindBuffer(LOCAL_GL_ARRAY_BUFFER, boundBuffer); - - mGL->fUseProgram(boundProgram); -} - //////////////////////////////////////////////////////////////////////// // ScopedPackState diff --git a/gfx/gl/ScopedGLHelpers.h b/gfx/gl/ScopedGLHelpers.h index 9ae304706aac..99e4ee824cea 100644 --- a/gfx/gl/ScopedGLHelpers.h +++ b/gfx/gl/ScopedGLHelpers.h @@ -122,7 +122,9 @@ protected: public: explicit ScopedTexture(GLContext* aGL); - GLuint Texture() { return mTexture; } + + GLuint Texture() const { return mTexture; } + operator GLuint() const { return mTexture; } protected: void UnwrapImpl(); @@ -309,39 +311,6 @@ protected: void UnwrapImpl(); }; -struct ScopedGLDrawState -{ - explicit ScopedGLDrawState(GLContext* gl); - ~ScopedGLDrawState(); - - GLuint boundProgram; - GLuint boundBuffer; - - ScopedGLState blend; - ScopedGLState cullFace; - ScopedGLState depthTest; - ScopedGLState dither; - ScopedGLState polyOffsFill; - ScopedGLState sampleAToC; - ScopedGLState sampleCover; - ScopedGLState scissor; - ScopedGLState stencil; - - GLuint maxAttrib; - UniquePtr attrib_enabled; - GLint attrib0_size; - GLint attrib0_stride; - GLint attrib0_type; - GLint attrib0_normalized; - GLint attrib0_bufferBinding; - void* attrib0_pointer; - - realGLboolean colorMask[4]; - GLint viewport[4]; - GLint scissorBox[4]; - GLContext* const mGL; -}; - struct ScopedPackState : public ScopedGLWrapper { diff --git a/gfx/gl/SharedSurface.cpp b/gfx/gl/SharedSurface.cpp index 020dcdbe5914..96648bf36401 100644 --- a/gfx/gl/SharedSurface.cpp +++ b/gfx/gl/SharedSurface.cpp @@ -65,11 +65,12 @@ SharedSurface::ProdCopy(SharedSurface* src, SharedSurface* dest, GLuint destTex = dest->ProdTexture(); GLenum destTarget = dest->ProdTextureTarget(); - gl->BlitHelper()->BlitFramebufferToTexture(0, destTex, + const ScopedBindFramebuffer bindFB(gl, 0); + + gl->BlitHelper()->BlitFramebufferToTexture(destTex, src->mSize, dest->mSize, - destTarget, - true); + destTarget); } else if (dest->mAttachType == AttachmentType::GLRenderbuffer) { GLuint destRB = dest->ProdRenderbuffer(); ScopedFramebufferForRenderbuffer destWrapper(gl, destRB); @@ -77,8 +78,7 @@ SharedSurface::ProdCopy(SharedSurface* src, SharedSurface* dest, gl->BlitHelper()->BlitFramebufferToFramebuffer(0, destWrapper.FB(), src->mSize, - dest->mSize, - true); + dest->mSize); } else { MOZ_CRASH("GFX: Unhandled dest->mAttachType 1."); } @@ -110,11 +110,12 @@ SharedSurface::ProdCopy(SharedSurface* src, SharedSurface* dest, GLuint srcTex = src->ProdTexture(); GLenum srcTarget = src->ProdTextureTarget(); - gl->BlitHelper()->BlitTextureToFramebuffer(srcTex, 0, + const ScopedBindFramebuffer bindFB(gl, 0); + + gl->BlitHelper()->BlitTextureToFramebuffer(srcTex, src->mSize, dest->mSize, - srcTarget, - !!gl->Screen()); + srcTarget); } else if (src->mAttachType == AttachmentType::GLRenderbuffer) { GLuint srcRB = src->ProdRenderbuffer(); ScopedFramebufferForRenderbuffer srcWrapper(gl, srcRB); @@ -122,8 +123,7 @@ SharedSurface::ProdCopy(SharedSurface* src, SharedSurface* dest, gl->BlitHelper()->BlitFramebufferToFramebuffer(srcWrapper.FB(), 0, src->mSize, - dest->mSize, - true); + dest->mSize); } else { MOZ_CRASH("GFX: Unhandled src->mAttachType 2."); } @@ -158,9 +158,9 @@ SharedSurface::ProdCopy(SharedSurface* src, SharedSurface* dest, if (dest->mAttachType == AttachmentType::GLRenderbuffer) { GLuint destRB = dest->ProdRenderbuffer(); ScopedFramebufferForRenderbuffer destWrapper(gl, destRB); - - gl->BlitHelper()->BlitTextureToFramebuffer(srcTex, destWrapper.FB(), - src->mSize, dest->mSize, srcTarget); + const ScopedBindFramebuffer bindFB(gl, destWrapper.FB()); + gl->BlitHelper()->BlitTextureToFramebuffer(srcTex, src->mSize, dest->mSize, + srcTarget); return; } @@ -175,9 +175,10 @@ SharedSurface::ProdCopy(SharedSurface* src, SharedSurface* dest, if (dest->mAttachType == AttachmentType::GLTexture) { GLuint destTex = dest->ProdTexture(); GLenum destTarget = dest->ProdTextureTarget(); + const ScopedBindFramebuffer bindFB(gl, srcWrapper.FB()); - gl->BlitHelper()->BlitFramebufferToTexture(srcWrapper.FB(), destTex, - src->mSize, dest->mSize, destTarget); + gl->BlitHelper()->BlitFramebufferToTexture(destTex, src->mSize, dest->mSize, + destTarget); return; } diff --git a/gfx/gl/SharedSurfaceD3D11Interop.cpp b/gfx/gl/SharedSurfaceD3D11Interop.cpp index 1cbcc24c8337..77a4617f8893 100644 --- a/gfx/gl/SharedSurfaceD3D11Interop.cpp +++ b/gfx/gl/SharedSurfaceD3D11Interop.cpp @@ -471,8 +471,8 @@ SharedSurface_D3D11Interop::ProducerReleaseImpl() MOZ_ASSERT(mLockedForGL); if (mProdTex) { - mGL->BlitHelper()->DrawBlitTextureToFramebuffer(mProdTex, mInteropFB, mSize, - mSize); + const ScopedBindFramebuffer bindFB(mGL, mInteropFB); + mGL->BlitHelper()->DrawBlitTextureToFramebuffer(mProdTex, mSize, mSize); } if (mNeedsFinish) { diff --git a/gfx/gl/moz.build b/gfx/gl/moz.build index 08d8673b0465..8b999a872947 100644 --- a/gfx/gl/moz.build +++ b/gfx/gl/moz.build @@ -69,6 +69,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': 'WGLLibrary.h', ] UNIFIED_SOURCES += [ + 'GLBlitHelperD3D.cpp', 'GLContextProviderWGL.cpp', 'SharedSurfaceANGLE.cpp', 'SharedSurfaceD3D11Interop.cpp', diff --git a/gfx/layers/D3D11YCbCrImage.cpp b/gfx/layers/D3D11YCbCrImage.cpp index fac9aa158638..c87d7a47410e 100644 --- a/gfx/layers/D3D11YCbCrImage.cpp +++ b/gfx/layers/D3D11YCbCrImage.cpp @@ -97,7 +97,7 @@ D3D11YCbCrImage::SetData(KnowsCompositor* aAllocator, aData.mCbCrStride, aData.mCbCrStride * aData.mCbCrSize.height); - + return true; } @@ -113,6 +113,15 @@ D3D11YCbCrImage::GetTextureClient(KnowsCompositor* aForwarder) return mTextureClient; } +const DXGIYCbCrTextureData* +D3D11YCbCrImage::GetData() const +{ + if (!mTextureClient) + return nullptr; + + return static_cast(mTextureClient->GetInternalData()); +} + already_AddRefed D3D11YCbCrImage::GetAsSourceSurface() { diff --git a/gfx/layers/D3D11YCbCrImage.h b/gfx/layers/D3D11YCbCrImage.h index 060b6475018a..33fec380565a 100644 --- a/gfx/layers/D3D11YCbCrImage.h +++ b/gfx/layers/D3D11YCbCrImage.h @@ -12,10 +12,14 @@ #include "ImageContainer.h" namespace mozilla { +namespace gl { +class GLBlitHelper; +} namespace layers { class ImageContainer; class DXGIYCbCrTextureClient; +class DXGIYCbCrTextureData; class D3D11YCbCrRecycleAllocator : public TextureClientRecycleAllocator { @@ -46,6 +50,7 @@ protected: class D3D11YCbCrImage : public Image { + friend class gl::GLBlitHelper; public: D3D11YCbCrImage(); virtual ~D3D11YCbCrImage(); @@ -65,6 +70,8 @@ public: gfx::IntRect GetPictureRect() override { return mPictureRect; } private: + const DXGIYCbCrTextureData* GetData() const; + gfx::IntSize mYSize; gfx::IntSize mCbCrSize; gfx::IntRect mPictureRect; diff --git a/gfx/layers/GLImages.cpp b/gfx/layers/GLImages.cpp index 85760305caa1..142feadc5fed 100644 --- a/gfx/layers/GLImages.cpp +++ b/gfx/layers/GLImages.cpp @@ -78,12 +78,11 @@ GLImage::GetAsSourceSurface() } const gl::OriginPos destOrigin = gl::OriginPos::TopLeft; - - if (!sSnapshotContext->BlitHelper()->BlitImageToFramebuffer(this, size, - autoFBForTex.FB(), - destOrigin)) { - return nullptr; + const ScopedBindFramebuffer bindFB(sSnapshotContext, autoFBForTex.FB()); + if (!sSnapshotContext->BlitHelper()->BlitImageToFramebuffer(this, size, destOrigin)) { + return nullptr; + } } RefPtr source = diff --git a/gfx/layers/GPUVideoImage.h b/gfx/layers/GPUVideoImage.h index 9a661088ba49..950444b1c4fe 100644 --- a/gfx/layers/GPUVideoImage.h +++ b/gfx/layers/GPUVideoImage.h @@ -16,11 +16,15 @@ namespace mozilla { namespace dom { class VideoDecoderManagerChild; } +namespace gl { +class GLBlitHelper; +} namespace layers { // Image class that refers to a decoded video frame within // the GPU process. class GPUVideoImage final : public Image { + friend class gl::GLBlitHelper; public: GPUVideoImage(dom::VideoDecoderManagerChild* aManager, const SurfaceDescriptorGPUVideo& aSD, @@ -45,12 +49,21 @@ public: gfx::IntSize GetSize() override { return mSize; } - virtual already_AddRefed GetAsSourceSurface() override - { +private: + GPUVideoTextureData* GetData() const { if (!mTextureClient) { return nullptr; } - GPUVideoTextureData* data = mTextureClient->GetInternalData()->AsGPUVideoTextureData(); + return mTextureClient->GetInternalData()->AsGPUVideoTextureData(); + } + +public: + virtual already_AddRefed GetAsSourceSurface() override + { + GPUVideoTextureData* data = GetData(); + if (!data) { + return nullptr; + } return data->GetAsSourceSurface(); } diff --git a/gfx/layers/client/GPUVideoTextureClient.h b/gfx/layers/client/GPUVideoTextureClient.h index a445e2a7da0d..15d20f2058fc 100644 --- a/gfx/layers/client/GPUVideoTextureClient.h +++ b/gfx/layers/client/GPUVideoTextureClient.h @@ -48,6 +48,9 @@ protected: RefPtr mManager; SurfaceDescriptorGPUVideo mSD; gfx::IntSize mSize; + +public: + const decltype(mSD)& SD() const { return mSD; } }; } // namespace layers diff --git a/gfx/layers/client/TextureClient.cpp b/gfx/layers/client/TextureClient.cpp index b939f1f6b99e..fd11ce9736f0 100644 --- a/gfx/layers/client/TextureClient.cpp +++ b/gfx/layers/client/TextureClient.cpp @@ -162,7 +162,7 @@ private: // Lock tile A // Lock tile B // Lock tile C - // Apply drawing commands to tiles A, B and C + // Apply drawing commands to tiles A, B and C // Unlock tile A // Unlock tile B // Unlock tile C @@ -1402,6 +1402,18 @@ TextureClient::PrintInfo(std::stringstream& aStream, const char* aPrefix) #endif } +void +TextureClient::GPUVideoDesc(SurfaceDescriptorGPUVideo* const aOutDesc) +{ + const auto handle = GetSerial(); + + GPUVideoSubDescriptor subDesc = null_t(); + MOZ_RELEASE_ASSERT(mData); + mData->GetSubDescriptor(&subDesc); + + *aOutDesc = SurfaceDescriptorGPUVideo(handle, Move(subDesc)); +} + class MemoryTextureReadLock : public NonBlockingTextureReadLock { public: MemoryTextureReadLock(); diff --git a/gfx/layers/client/TextureClient.h b/gfx/layers/client/TextureClient.h index 0f48e02d48d1..df816bbf126c 100644 --- a/gfx/layers/client/TextureClient.h +++ b/gfx/layers/client/TextureClient.h @@ -266,6 +266,7 @@ public: virtual void Forget(LayersIPCChannel* aAllocator) {} virtual bool Serialize(SurfaceDescriptor& aDescriptor) = 0; + virtual void GetSubDescriptor(GPUVideoSubDescriptor* aOutDesc) { } virtual TextureData* CreateSimilar(LayersIPCChannel* aAllocator, @@ -598,12 +599,13 @@ public: const TextureData* GetInternalData() const { return mData; } uint64_t GetSerial() const { return mSerial; } + void GPUVideoDesc(SurfaceDescriptorGPUVideo* aOutDesc); void CancelWaitForRecycle(); /** * Set last transaction id of CompositableForwarder. - * + * * Called when TextureClient has TextureFlags::RECYCLE flag. * When CompositableForwarder forwards the TextureClient with * TextureFlags::RECYCLE, it holds TextureClient's ref until host side @@ -642,7 +644,7 @@ public: private: static void TextureClientRecycleCallback(TextureClient* aClient, void* aClosure); - + // Internal helpers for creating texture clients using the actual forwarder instead // of KnowsCompositor. TextureClientPool uses these to let it cache texture clients // per-process instead of per ShadowLayerForwarder, but everyone else should @@ -657,7 +659,7 @@ private: BackendSelector aSelector, TextureFlags aTextureFlags, TextureAllocationFlags aAllocFlags = ALLOC_DEFAULT); - + static already_AddRefed CreateForRawBufferAccess(LayersIPCChannel* aAllocator, gfx::SurfaceFormat aFormat, diff --git a/gfx/layers/d3d11/TextureD3D11.cpp b/gfx/layers/d3d11/TextureD3D11.cpp index a8f627cb3213..5ff976dffafd 100644 --- a/gfx/layers/d3d11/TextureD3D11.cpp +++ b/gfx/layers/d3d11/TextureD3D11.cpp @@ -373,7 +373,7 @@ D3D11TextureData::SyncWithObject(SyncObjectClient* aSyncObject) } bool -DXGITextureData::Serialize(SurfaceDescriptor& aOutDescriptor) +DXGITextureData::SerializeSpecific(SurfaceDescriptorD3D10* const aOutDesc) { RefPtr resource; GetDXGIResource((IDXGIResource**)getter_AddRefs(resource)); @@ -387,10 +387,31 @@ DXGITextureData::Serialize(SurfaceDescriptor& aOutDescriptor) return false; } - aOutDescriptor = SurfaceDescriptorD3D10((WindowsHandle)sharedHandle, mFormat, mSize); + *aOutDesc = SurfaceDescriptorD3D10((WindowsHandle)sharedHandle, mFormat, mSize); return true; } +bool +DXGITextureData::Serialize(SurfaceDescriptor& aOutDescriptor) +{ + SurfaceDescriptorD3D10 desc; + if (!SerializeSpecific(&desc)) + return false; + + aOutDescriptor = Move(desc); + return true; +} + +void +DXGITextureData::GetSubDescriptor(GPUVideoSubDescriptor* const aOutDesc) +{ + SurfaceDescriptorD3D10 ret; + if (!SerializeSpecific(&ret)) + return; + + *aOutDesc = Move(ret); +} + DXGITextureData* DXGITextureData::Create(IntSize aSize, SurfaceFormat aFormat, TextureAllocationFlags aFlags) { @@ -659,16 +680,34 @@ DXGIYCbCrTextureData::FillInfo(TextureData::Info& aInfo) const aInfo.hasSynchronization = false; } -bool -DXGIYCbCrTextureData::Serialize(SurfaceDescriptor& aOutDescriptor) +void +DXGIYCbCrTextureData::SerializeSpecific(SurfaceDescriptorDXGIYCbCr* const aOutDesc) { - aOutDescriptor = SurfaceDescriptorDXGIYCbCr( + *aOutDesc = SurfaceDescriptorDXGIYCbCr( (WindowsHandle)mHandles[0], (WindowsHandle)mHandles[1], (WindowsHandle)mHandles[2], mSize, mSizeY, mSizeCbCr ); +} + +bool +DXGIYCbCrTextureData::Serialize(SurfaceDescriptor& aOutDescriptor) +{ + SurfaceDescriptorDXGIYCbCr desc; + SerializeSpecific(&desc); + + aOutDescriptor = Move(desc); return true; } +void +DXGIYCbCrTextureData::GetSubDescriptor(GPUVideoSubDescriptor* const aOutDesc) +{ + SurfaceDescriptorDXGIYCbCr desc; + SerializeSpecific(&desc); + + *aOutDesc = Move(desc); +} + void DXGIYCbCrTextureData::Deallocate(LayersIPCChannel*) { diff --git a/gfx/layers/d3d11/TextureD3D11.h b/gfx/layers/d3d11/TextureD3D11.h index 946a9d7e4e3c..5050d37995f4 100644 --- a/gfx/layers/d3d11/TextureD3D11.h +++ b/gfx/layers/d3d11/TextureD3D11.h @@ -18,6 +18,10 @@ #include namespace mozilla { +namespace gl { +class GLBlitHelper; +} + namespace layers { class MOZ_RAII AutoTextureLock @@ -39,7 +43,9 @@ class DXGITextureData : public TextureData public: virtual void FillInfo(TextureData::Info& aInfo) const override; + bool SerializeSpecific(SurfaceDescriptorD3D10* aOutDesc); virtual bool Serialize(SurfaceDescriptor& aOutDescrptor) override; + virtual void GetSubDescriptor(GPUVideoSubDescriptor* aOutDesc) override; static DXGITextureData* Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat, TextureAllocationFlags aFlags); @@ -126,6 +132,7 @@ CreateD3D11extureClientWithDevice(gfx::IntSize aSize, gfx::SurfaceFormat aFormat class DXGIYCbCrTextureData : public TextureData { + friend class gl::GLBlitHelper; public: static DXGIYCbCrTextureData* Create(IDirect3DTexture9* aTextureY, @@ -152,7 +159,9 @@ public: virtual void FillInfo(TextureData::Info& aInfo) const override; + void SerializeSpecific(SurfaceDescriptorDXGIYCbCr* aOutDesc); virtual bool Serialize(SurfaceDescriptor& aOutDescriptor) override; + virtual void GetSubDescriptor(GPUVideoSubDescriptor* aOutDesc) override; virtual already_AddRefed BorrowDrawTarget() override { return nullptr; } diff --git a/gfx/layers/ipc/LayersSurfaces.ipdlh b/gfx/layers/ipc/LayersSurfaces.ipdlh index 9f1d6fd04337..e4d296b32f88 100644 --- a/gfx/layers/ipc/LayersSurfaces.ipdlh +++ b/gfx/layers/ipc/LayersSurfaces.ipdlh @@ -80,8 +80,16 @@ struct SurfaceDescriptorSharedGLTexture { bool hasAlpha; }; + +union GPUVideoSubDescriptor { + SurfaceDescriptorD3D10; + SurfaceDescriptorDXGIYCbCr; + null_t; +}; + struct SurfaceDescriptorGPUVideo { uint64_t handle; + GPUVideoSubDescriptor subdesc; }; struct RGBDescriptor { diff --git a/gfx/thebes/gfxUtils.cpp b/gfx/thebes/gfxUtils.cpp index f0ae126ca05d..f29a90a88ec1 100644 --- a/gfx/thebes/gfxUtils.cpp +++ b/gfx/thebes/gfxUtils.cpp @@ -1111,47 +1111,29 @@ gfxUtils::EncodeSourceSurface(SourceSurface* aSurface, aBinaryOrData, aFile, nullptr); } -/* From Rec601: -[R] [1.1643835616438356, 0.0, 1.5960267857142858] [ Y - 16] -[G] = [1.1643835616438358, -0.3917622900949137, -0.8129676472377708] x [Cb - 128] -[B] [1.1643835616438356, 2.017232142857143, 8.862867620416422e-17] [Cr - 128] - -For [0,1] instead of [0,255], and to 5 places: -[R] [1.16438, 0.00000, 1.59603] [ Y - 0.06275] -[G] = [1.16438, -0.39176, -0.81297] x [Cb - 0.50196] -[B] [1.16438, 2.01723, 0.00000] [Cr - 0.50196] - -From Rec709: -[R] [1.1643835616438356, 4.2781193979771426e-17, 1.7927410714285714] [ Y - 16] -[G] = [1.1643835616438358, -0.21324861427372963, -0.532909328559444] x [Cb - 128] -[B] [1.1643835616438356, 2.1124017857142854, 0.0] [Cr - 128] - -For [0,1] instead of [0,255], and to 5 places: -[R] [1.16438, 0.00000, 1.79274] [ Y - 0.06275] -[G] = [1.16438, -0.21325, -0.53291] x [Cb - 0.50196] -[B] [1.16438, 2.11240, 0.00000] [Cr - 0.50196] -*/ - -static const float kRec601[9] = { - 1.16438f, 0.00000f, 1.59603f, - 1.16438f,-0.39176f,-0.81297f, - 1.16438f, 2.01723f, 0.00000f, +// https://jdashg.github.io/misc/colors/from-coeffs.html +const float kBT601NarrowYCbCrToRGB_RowMajor[16] = { + 1.16438f, 0.00000f, 1.59603f,-0.87420f, + 1.16438f,-0.39176f,-0.81297f, 0.53167f, + 1.16438f, 2.01723f, 0.00000f,-1.08563f, + 0.00000f, 0.00000f, 0.00000f, 1.00000f }; -static const float kRec709[9] = { - 1.16438f, 0.00000f, 1.79274f, - 1.16438f,-0.21325f,-0.53291f, - 1.16438f, 2.11240f, 0.00000f, +const float kBT709NarrowYCbCrToRGB_RowMajor[16] = { + 1.16438f, 0.00000f, 1.79274f,-0.97295f, + 1.16438f,-0.21325f,-0.53291f, 0.30148f, + 1.16438f, 2.11240f, 0.00000f,-1.13340f, + 0.00000f, 0.00000f, 0.00000f, 1.00000f }; /* static */ const float* gfxUtils::YuvToRgbMatrix4x3RowMajor(YUVColorSpace aYUVColorSpace) { - #define X(x) { x[0], x[1], x[2], 0.0f, \ - x[3], x[4], x[5], 0.0f, \ - x[6], x[7], x[8], 0.0f } + #define X(x) { x[0], x[1], x[ 2], 0.0f, \ + x[4], x[5], x[ 6], 0.0f, \ + x[8], x[9], x[10], 0.0f } - static const float rec601[12] = X(kRec601); - static const float rec709[12] = X(kRec709); + static const float rec601[12] = X(kBT601NarrowYCbCrToRGB_RowMajor); + static const float rec709[12] = X(kBT709NarrowYCbCrToRGB_RowMajor); #undef X @@ -1169,12 +1151,36 @@ gfxUtils::YuvToRgbMatrix4x3RowMajor(YUVColorSpace aYUVColorSpace) /* static */ const float* gfxUtils::YuvToRgbMatrix3x3ColumnMajor(YUVColorSpace aYUVColorSpace) { - #define X(x) { x[0], x[3], x[6], \ - x[1], x[4], x[7], \ - x[2], x[5], x[8] } + #define X(x) { x[0], x[4], x[ 8], \ + x[1], x[5], x[ 9], \ + x[2], x[6], x[10] } - static const float rec601[9] = X(kRec601); - static const float rec709[9] = X(kRec709); + static const float rec601[9] = X(kBT601NarrowYCbCrToRGB_RowMajor); + static const float rec709[9] = X(kBT709NarrowYCbCrToRGB_RowMajor); + + #undef X + + switch (aYUVColorSpace) { + case YUVColorSpace::BT601: + return rec601; + case YUVColorSpace::BT709: + return rec709; + default: // YUVColorSpace::UNKNOWN + MOZ_ASSERT(false, "unknown aYUVColorSpace"); + return rec601; + } +} + +/* static */ const float* +gfxUtils::YuvToRgbMatrix4x4ColumnMajor(YUVColorSpace aYUVColorSpace) +{ + #define X(x) { x[0], x[4], x[ 8], x[12], \ + x[1], x[5], x[ 9], x[13], \ + x[2], x[6], x[10], x[14], \ + x[3], x[7], x[11], x[15] } + + static const float rec601[16] = X(kBT601NarrowYCbCrToRGB_RowMajor); + static const float rec709[16] = X(kBT709NarrowYCbCrToRGB_RowMajor); #undef X diff --git a/gfx/thebes/gfxUtils.h b/gfx/thebes/gfxUtils.h index 06f769f6585c..8dccbece9e4b 100644 --- a/gfx/thebes/gfxUtils.h +++ b/gfx/thebes/gfxUtils.h @@ -158,6 +158,7 @@ public: static const float* YuvToRgbMatrix4x3RowMajor(mozilla::YUVColorSpace aYUVColorSpace); static const float* YuvToRgbMatrix3x3ColumnMajor(mozilla::YUVColorSpace aYUVColorSpace); + static const float* YuvToRgbMatrix4x4ColumnMajor(mozilla::YUVColorSpace aYUVColorSpace); /** * Creates a copy of aSurface, but having the SurfaceFormat aFormat.