/*
 * 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([["vendors-node_modules_jupyterlab_launcher_lib_index_js"],{

/***/ "../node_modules/@jupyterlab/launcher/lib/index.js":
/*!*********************************************************!*\
  !*** ../node_modules/@jupyterlab/launcher/lib/index.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"ILauncher\": () => (/* binding */ ILauncher),\n/* harmony export */   \"LauncherModel\": () => (/* binding */ LauncherModel),\n/* harmony export */   \"Launcher\": () => (/* binding */ Launcher)\n/* harmony export */ });\n/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/apputils */ \"webpack/sharing/consume/default/@jupyterlab/apputils/@jupyterlab/apputils\");\n/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/translation */ \"webpack/sharing/consume/default/@jupyterlab/translation/@jupyterlab/translation\");\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @jupyterlab/ui-components */ \"webpack/sharing/consume/default/@jupyterlab/ui-components/@jupyterlab/ui-components\");\n/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @lumino/algorithm */ \"webpack/sharing/consume/default/@lumino/algorithm/@lumino/algorithm\");\n/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_lumino_algorithm__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @lumino/coreutils */ \"webpack/sharing/consume/default/@lumino/coreutils/@lumino/coreutils\");\n/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _lumino_disposable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @lumino/disposable */ \"webpack/sharing/consume/default/@lumino/disposable/@lumino/disposable\");\n/* harmony import */ var _lumino_disposable__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_lumino_disposable__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _lumino_properties__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @lumino/properties */ \"webpack/sharing/consume/default/@lumino/properties/@lumino/properties\");\n/* harmony import */ var _lumino_properties__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_lumino_properties__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @lumino/widgets */ \"webpack/sharing/consume/default/@lumino/widgets/@lumino/widgets\");\n/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_lumino_widgets__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react */ \"webpack/sharing/consume/default/react/react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_8__);\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/**\n * @packageDocumentation\n * @module launcher\n */\n\n\n\n\n\n\n\n\n\n/**\n * The class name added to Launcher instances.\n */\nconst LAUNCHER_CLASS = 'jp-Launcher';\n/* tslint:disable */\n/**\n * The launcher token.\n */\nconst ILauncher = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_4__.Token('@jupyterlab/launcher:ILauncher');\n/**\n * LauncherModel keeps track of the path to working directory and has a list of\n * LauncherItems, which the Launcher will render.\n */\nclass LauncherModel extends _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.VDomModel {\n    constructor() {\n        super(...arguments);\n        this._items = [];\n    }\n    /**\n     * Add a command item to the launcher, and trigger re-render event for parent\n     * widget.\n     *\n     * @param options - The specification options for a launcher item.\n     *\n     * @returns A disposable that will remove the item from Launcher, and trigger\n     * re-render event for parent widget.\n     *\n     */\n    add(options) {\n        // Create a copy of the options to circumvent mutations to the original.\n        const item = Private.createItem(options);\n        this._items.push(item);\n        this.stateChanged.emit(void 0);\n        return new _lumino_disposable__WEBPACK_IMPORTED_MODULE_5__.DisposableDelegate(() => {\n            _lumino_algorithm__WEBPACK_IMPORTED_MODULE_3__.ArrayExt.removeFirstOf(this._items, item);\n            this.stateChanged.emit(void 0);\n        });\n    }\n    /**\n     * Return an iterator of launcher items.\n     */\n    items() {\n        return new _lumino_algorithm__WEBPACK_IMPORTED_MODULE_3__.ArrayIterator(this._items);\n    }\n}\n/**\n * A virtual-DOM-based widget for the Launcher.\n */\nclass Launcher extends _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.VDomRenderer {\n    /**\n     * Construct a new launcher widget.\n     */\n    constructor(options) {\n        super(options.model);\n        this._pending = false;\n        this._cwd = '';\n        this._cwd = options.cwd;\n        this.translator = options.translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__.nullTranslator;\n        this._trans = this.translator.load('jupyterlab');\n        this._callback = options.callback;\n        this._commands = options.commands;\n        this.addClass(LAUNCHER_CLASS);\n    }\n    /**\n     * The cwd of the launcher.\n     */\n    get cwd() {\n        return this._cwd;\n    }\n    set cwd(value) {\n        this._cwd = value;\n        this.update();\n    }\n    /**\n     * Whether there is a pending item being launched.\n     */\n    get pending() {\n        return this._pending;\n    }\n    set pending(value) {\n        this._pending = value;\n    }\n    /**\n     * Render the launcher to virtual DOM nodes.\n     */\n    render() {\n        // Bail if there is no model.\n        if (!this.model) {\n            return null;\n        }\n        const knownCategories = [\n            this._trans.__('Notebook'),\n            this._trans.__('Console'),\n            this._trans.__('Other')\n        ];\n        const kernelCategories = [\n            this._trans.__('Notebook'),\n            this._trans.__('Console')\n        ];\n        // First group-by categories\n        const categories = Object.create(null);\n        (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_3__.each)(this.model.items(), (item, index) => {\n            const cat = item.category || this._trans.__('Other');\n            if (!(cat in categories)) {\n                categories[cat] = [];\n            }\n            categories[cat].push(item);\n        });\n        // Within each category sort by rank\n        for (const cat in categories) {\n            categories[cat] = categories[cat].sort((a, b) => {\n                return Private.sortCmp(a, b, this._cwd, this._commands);\n            });\n        }\n        // Variable to help create sections\n        const sections = [];\n        let section;\n        // Assemble the final ordered list of categories, beginning with\n        // KNOWN_CATEGORIES.\n        const orderedCategories = [];\n        (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_3__.each)(knownCategories, (cat, index) => {\n            orderedCategories.push(cat);\n        });\n        for (const cat in categories) {\n            if (knownCategories.indexOf(cat) === -1) {\n                orderedCategories.push(cat);\n            }\n        }\n        // Now create the sections for each category\n        orderedCategories.forEach(cat => {\n            if (!categories[cat]) {\n                return;\n            }\n            const item = categories[cat][0];\n            const args = Object.assign(Object.assign({}, item.args), { cwd: this.cwd });\n            const kernel = kernelCategories.indexOf(cat) > -1;\n            // DEPRECATED: remove _icon when lumino 2.0 is adopted\n            // if icon is aliasing iconClass, don't use it\n            const iconClass = this._commands.iconClass(item.command, args);\n            const _icon = this._commands.icon(item.command, args);\n            const icon = _icon === iconClass ? undefined : _icon;\n            if (cat in categories) {\n                section = (react__WEBPACK_IMPORTED_MODULE_8__.createElement(\"div\", { className: \"jp-Launcher-section\", key: cat },\n                    react__WEBPACK_IMPORTED_MODULE_8__.createElement(\"div\", { className: \"jp-Launcher-sectionHeader\" },\n                        react__WEBPACK_IMPORTED_MODULE_8__.createElement(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__.LabIcon.resolveReact, { icon: icon, iconClass: (0,_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__.classes)(iconClass, 'jp-Icon-cover'), stylesheet: \"launcherSection\" }),\n                        react__WEBPACK_IMPORTED_MODULE_8__.createElement(\"h2\", { className: \"jp-Launcher-sectionTitle\" }, cat)),\n                    react__WEBPACK_IMPORTED_MODULE_8__.createElement(\"div\", { className: \"jp-Launcher-cardContainer\" }, (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_3__.toArray)((0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_3__.map)(categories[cat], (item) => {\n                        return Card(kernel, item, this, this._commands, this._trans, this._callback);\n                    })))));\n                sections.push(section);\n            }\n        });\n        // Wrap the sections in body and content divs.\n        return (react__WEBPACK_IMPORTED_MODULE_8__.createElement(\"div\", { className: \"jp-Launcher-body\" },\n            react__WEBPACK_IMPORTED_MODULE_8__.createElement(\"div\", { className: \"jp-Launcher-content\" },\n                react__WEBPACK_IMPORTED_MODULE_8__.createElement(\"div\", { className: \"jp-Launcher-cwd\" },\n                    react__WEBPACK_IMPORTED_MODULE_8__.createElement(\"h3\", null, this.cwd)),\n                sections)));\n    }\n}\n/**\n * A pure tsx component for a launcher card.\n *\n * @param kernel - whether the item takes uses a kernel.\n *\n * @param item - the launcher item to render.\n *\n * @param launcher - the Launcher instance to which this is added.\n *\n * @param launcherCallback - a callback to call after an item has been launched.\n *\n * @returns a vdom `VirtualElement` for the launcher card.\n */\nfunction Card(kernel, item, launcher, commands, trans, launcherCallback) {\n    // Get some properties of the command\n    const command = item.command;\n    const args = Object.assign(Object.assign({}, item.args), { cwd: launcher.cwd });\n    const caption = commands.caption(command, args);\n    const label = commands.label(command, args);\n    const title = kernel ? label : caption || label;\n    // Build the onclick handler.\n    const onclick = () => {\n        // If an item has already been launched,\n        // don't try to launch another.\n        if (launcher.pending === true) {\n            return;\n        }\n        launcher.pending = true;\n        void commands\n            .execute(command, Object.assign(Object.assign({}, item.args), { cwd: launcher.cwd }))\n            .then(value => {\n            launcher.pending = false;\n            if (value instanceof _lumino_widgets__WEBPACK_IMPORTED_MODULE_7__.Widget) {\n                launcherCallback(value);\n                launcher.dispose();\n            }\n        })\n            .catch(err => {\n            launcher.pending = false;\n            void (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.showErrorMessage)(trans._p('Error', 'Launcher Error'), err);\n        });\n    };\n    // With tabindex working, you can now pick a kernel by tabbing around and\n    // pressing Enter.\n    const onkeypress = (event) => {\n        if (event.key === 'Enter') {\n            onclick();\n        }\n    };\n    // DEPRECATED: remove _icon when lumino 2.0 is adopted\n    // if icon is aliasing iconClass, don't use it\n    const iconClass = commands.iconClass(command, args);\n    const _icon = commands.icon(command, args);\n    const icon = _icon === iconClass ? undefined : _icon;\n    // Return the VDOM element.\n    return (react__WEBPACK_IMPORTED_MODULE_8__.createElement(\"div\", { className: \"jp-LauncherCard\", title: title, onClick: onclick, onKeyPress: onkeypress, tabIndex: 0, \"data-category\": item.category || trans.__('Other'), key: Private.keyProperty.get(item) },\n        react__WEBPACK_IMPORTED_MODULE_8__.createElement(\"div\", { className: \"jp-LauncherCard-icon\" }, kernel ? (item.kernelIconUrl ? (react__WEBPACK_IMPORTED_MODULE_8__.createElement(\"img\", { src: item.kernelIconUrl, className: \"jp-Launcher-kernelIcon\" })) : (react__WEBPACK_IMPORTED_MODULE_8__.createElement(\"div\", { className: \"jp-LauncherCard-noKernelIcon\" }, label[0].toUpperCase()))) : (react__WEBPACK_IMPORTED_MODULE_8__.createElement(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__.LabIcon.resolveReact, { icon: icon, iconClass: (0,_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__.classes)(iconClass, 'jp-Icon-cover'), stylesheet: \"launcherCard\" }))),\n        react__WEBPACK_IMPORTED_MODULE_8__.createElement(\"div\", { className: \"jp-LauncherCard-label\", title: title },\n            react__WEBPACK_IMPORTED_MODULE_8__.createElement(\"p\", null, label))));\n}\n/**\n * The namespace for module private data.\n */\nvar Private;\n(function (Private) {\n    /**\n     * An incrementing counter for keys.\n     */\n    let id = 0;\n    /**\n     * An attached property for an item's key.\n     */\n    Private.keyProperty = new _lumino_properties__WEBPACK_IMPORTED_MODULE_6__.AttachedProperty({\n        name: 'key',\n        create: () => id++\n    });\n    /**\n     * Create a fully specified item given item options.\n     */\n    function createItem(options) {\n        return Object.assign(Object.assign({}, options), { category: options.category || '', rank: options.rank !== undefined ? options.rank : Infinity });\n    }\n    Private.createItem = createItem;\n    /**\n     * A sort comparison function for a launcher item.\n     */\n    function sortCmp(a, b, cwd, commands) {\n        // First, compare by rank.\n        const r1 = a.rank;\n        const r2 = b.rank;\n        if (r1 !== r2 && r1 !== undefined && r2 !== undefined) {\n            return r1 < r2 ? -1 : 1; // Infinity safe\n        }\n        // Finally, compare by display name.\n        const aLabel = commands.label(a.command, Object.assign(Object.assign({}, a.args), { cwd }));\n        const bLabel = commands.label(b.command, Object.assign(Object.assign({}, b.args), { cwd }));\n        return aLabel.localeCompare(bLabel);\n    }\n    Private.sortCmp = sortCmp;\n})(Private || (Private = {}));\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/launcher/lib/index.js?");

/***/ })

}]);