"use strict";
/*
 * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
(self["webpackChunk_JUPYTERLAB_CORE_OUTPUT"] = self["webpackChunk_JUPYTERLAB_CORE_OUTPUT"] || []).push([["packages_application-extension_lib_index_js-_90450"],{

/***/ "../packages/application-extension/lib/index.js":
/*!******************************************************!*\
  !*** ../packages/application-extension/lib/index.js ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/application */ \"webpack/sharing/consume/default/@jupyterlab/application/@jupyterlab/application\");\n/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/apputils */ \"webpack/sharing/consume/default/@jupyterlab/apputils/@jupyterlab/apputils\");\n/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @jupyterlab/coreutils */ \"webpack/sharing/consume/default/@jupyterlab/coreutils/@jupyterlab/coreutils\");\n/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @jupyterlab/docmanager */ \"webpack/sharing/consume/default/@jupyterlab/docmanager/@jupyterlab/docmanager\");\n/* harmony import */ var _jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _jupyterlab_mainmenu__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @jupyterlab/mainmenu */ \"webpack/sharing/consume/default/@jupyterlab/mainmenu/@jupyterlab/mainmenu\");\n/* harmony import */ var _jupyterlab_mainmenu__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_mainmenu__WEBPACK_IMPORTED_MODULE_4__);\n// Copyright (c) Jupyter Development Team, Spyder Project Contributors.\n// Distributed under the terms of the Modified BSD License.\n// This file is based on the corresponding file in Jupyter Notebook.\n\n\n\n\n\n/**\n * A regular expression to match path to notebooks and documents\n *\n * Adapted to use the URL from Spyder\n */\n// Spyder: Use 'spyder-notebooks' instead of 'notebooks'\nconst TREE_PATTERN = new RegExp('/(spyder-notebooks)/(.*)');\n/**\n * A plugin to open documents in the main area.\n *\n * The code is identical to the code in Jupyter Notebook, but it\n * uses a different value for TREE_PATTERN.\n */\nconst opener = {\n    id: '@spyder-notebook/application-extension:opener',\n    autoStart: true,\n    requires: [_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.IRouter, _jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_3__.IDocumentManager],\n    activate: (app, router, docManager) => {\n        const { commands } = app;\n        const command = 'router:tree';\n        commands.addCommand(command, {\n            execute: (args) => {\n                var _a, _b;\n                const parsed = args;\n                const matches = (_a = parsed.path.match(TREE_PATTERN)) !== null && _a !== void 0 ? _a : [];\n                const [, , path] = matches;\n                if (!path) {\n                    return;\n                }\n                const file = decodeURIComponent(path);\n                const urlParams = new URLSearchParams(parsed.search);\n                const factory = (_b = urlParams.get('factory')) !== null && _b !== void 0 ? _b : 'default';\n                app.started.then(async () => {\n                    docManager.open(file, factory, undefined, {\n                        ref: '_noref'\n                    });\n                });\n            }\n        });\n        router.register({ command, pattern: TREE_PATTERN });\n    }\n};\n/**\n * A plugin to customize menus\n *\n * Compared to the corresponding plugin in Jupyter Notebook, here we\n * always remove the File menu and we leave out the handling of\n * non-notebook pages.\n */\nconst menus = {\n    id: '@spyder-notebook/application-extension:menus',\n    requires: [_jupyterlab_mainmenu__WEBPACK_IMPORTED_MODULE_4__.IMainMenu],\n    autoStart: true,\n    activate: (app, menu) => {\n        menu.fileMenu.dispose();\n        menu.tabsMenu.dispose();\n    }\n};\n/**\n * A plugin to sync the notebook theme with the Spyder preferences\n *\n * On startup, read the `darkTheme` option from `PageConfig` and then set the\n * notebook theme accordingly. This option is set in `SpyderNotebookHandler`.\n */\nconst theme = {\n    id: '@spyder-notebook/application-extension:theme',\n    requires: [_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.IThemeManager],\n    autoStart: true,\n    activate: (app, themeManager) => {\n        const darkTheme = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__.PageConfig.getOption('darkTheme');\n        if (darkTheme == 'true') {\n            themeManager.setTheme('JupyterLab Dark');\n        }\n        else {\n            themeManager.setTheme('JupyterLab Light');\n        }\n    }\n};\n/**\n * Export the plugins as default.\n */\nconst plugins = [\n    menus,\n    opener,\n    theme\n];\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (plugins);\n\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../packages/application-extension/lib/index.js?");

/***/ })

}]);