"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([["vendors-node_modules_jupyterlab_toc-extension_lib_index_js"],{

/***/ "../node_modules/@jupyterlab/toc-extension/lib/index.js":
/*!**************************************************************!*\
  !*** ../node_modules/@jupyterlab/toc-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_settingregistry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/settingregistry */ \"webpack/sharing/consume/default/@jupyterlab/settingregistry/@jupyterlab/settingregistry\");\n/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _jupyterlab_toc__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @jupyterlab/toc */ \"webpack/sharing/consume/default/@jupyterlab/toc/@jupyterlab/toc\");\n/* harmony import */ var _jupyterlab_toc__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_toc__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @jupyterlab/translation */ \"webpack/sharing/consume/default/@jupyterlab/translation/@jupyterlab/translation\");\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_4__ = __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_4___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_4__);\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/**\n * @packageDocumentation\n * @module toc-extension\n */\n\n\n\n\n\n/**\n * A namespace for command IDs of table of contents plugin.\n */\nvar CommandIDs;\n(function (CommandIDs) {\n    CommandIDs.displayNumbering = 'toc:display-numbering';\n    CommandIDs.displayH1Numbering = 'toc:display-h1-numbering';\n    CommandIDs.displayOutputNumbering = 'toc:display-outputs-numbering';\n    CommandIDs.showPanel = 'toc:show-panel';\n    CommandIDs.toggleCollapse = 'toc:toggle-collapse';\n})(CommandIDs || (CommandIDs = {}));\n/**\n * Activates the ToC extension.\n *\n * @private\n * @param app - Jupyter application\n * @param tocRegistry - Table of contents registry\n * @param translator - translator\n * @param restorer - application layout restorer\n * @param labShell - Jupyter lab shell\n * @param settingRegistry - setting registry\n * @returns table of contents registry\n */\nasync function activateTOC(app, tocRegistry, translator, restorer, labShell, settingRegistry) {\n    const trans = (translator !== null && translator !== void 0 ? translator : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__.nullTranslator).load('jupyterlab');\n    let configuration = { ..._jupyterlab_toc__WEBPACK_IMPORTED_MODULE_2__.TableOfContents.defaultConfig };\n    // Create the ToC widget:\n    const toc = new _jupyterlab_toc__WEBPACK_IMPORTED_MODULE_2__.TableOfContentsPanel(translator !== null && translator !== void 0 ? translator : undefined);\n    toc.title.icon = _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_4__.tocIcon;\n    toc.title.caption = trans.__('Table of Contents');\n    toc.id = 'table-of-contents';\n    toc.node.setAttribute('role', 'region');\n    toc.node.setAttribute('aria-label', trans.__('Table of Contents section'));\n    app.commands.addCommand(CommandIDs.displayH1Numbering, {\n        label: trans.__('Show first-level heading number'),\n        execute: () => {\n            if (toc.model) {\n                toc.model.setConfiguration({\n                    numberingH1: !toc.model.configuration.numberingH1\n                });\n            }\n        },\n        isEnabled: () => { var _a, _b; return (_b = (_a = toc.model) === null || _a === void 0 ? void 0 : _a.supportedOptions.includes('numberingH1')) !== null && _b !== void 0 ? _b : false; },\n        isToggled: () => { var _a, _b; return (_b = (_a = toc.model) === null || _a === void 0 ? void 0 : _a.configuration.numberingH1) !== null && _b !== void 0 ? _b : false; }\n    });\n    app.commands.addCommand(CommandIDs.displayNumbering, {\n        label: trans.__('Show heading number in the document'),\n        icon: args => (args.toolbar ? _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_4__.numberingIcon : undefined),\n        execute: () => {\n            if (toc.model) {\n                toc.model.setConfiguration({\n                    numberHeaders: !toc.model.configuration.numberHeaders\n                });\n                app.commands.notifyCommandChanged(CommandIDs.displayNumbering);\n            }\n        },\n        isEnabled: () => { var _a, _b; return (_b = (_a = toc.model) === null || _a === void 0 ? void 0 : _a.supportedOptions.includes('numberHeaders')) !== null && _b !== void 0 ? _b : false; },\n        isToggled: () => { var _a, _b; return (_b = (_a = toc.model) === null || _a === void 0 ? void 0 : _a.configuration.numberHeaders) !== null && _b !== void 0 ? _b : false; }\n    });\n    app.commands.addCommand(CommandIDs.displayOutputNumbering, {\n        label: trans.__('Show output headings'),\n        execute: () => {\n            if (toc.model) {\n                toc.model.setConfiguration({\n                    includeOutput: !toc.model.configuration.includeOutput\n                });\n            }\n        },\n        isEnabled: () => { var _a, _b; return (_b = (_a = toc.model) === null || _a === void 0 ? void 0 : _a.supportedOptions.includes('includeOutput')) !== null && _b !== void 0 ? _b : false; },\n        isToggled: () => { var _a, _b; return (_b = (_a = toc.model) === null || _a === void 0 ? void 0 : _a.configuration.includeOutput) !== null && _b !== void 0 ? _b : false; }\n    });\n    app.commands.addCommand(CommandIDs.showPanel, {\n        label: trans.__('Table of Contents'),\n        execute: () => {\n            app.shell.activateById(toc.id);\n        }\n    });\n    function someExpanded(model) {\n        return model.headings.some(h => { var _a; return !((_a = h.collapsed) !== null && _a !== void 0 ? _a : false); });\n    }\n    app.commands.addCommand(CommandIDs.toggleCollapse, {\n        label: () => toc.model && !someExpanded(toc.model)\n            ? trans.__('Expand All Headings')\n            : trans.__('Collapse All Headings'),\n        icon: args => args.toolbar\n            ? toc.model && !someExpanded(toc.model)\n                ? _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_4__.expandAllIcon\n                : _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_4__.collapseAllIcon\n            : undefined,\n        execute: () => {\n            if (toc.model) {\n                if (someExpanded(toc.model)) {\n                    toc.model.toggleCollapse({ collapsed: true });\n                }\n                else {\n                    toc.model.toggleCollapse({ collapsed: false });\n                }\n            }\n        },\n        isEnabled: () => toc.model !== null\n    });\n    const tracker = new _jupyterlab_toc__WEBPACK_IMPORTED_MODULE_2__.TableOfContentsTracker();\n    if (restorer) {\n        // Add the ToC widget to the application restorer:\n        restorer.add(toc, '@jupyterlab/toc:plugin');\n    }\n    // Attempt to load plugin settings:\n    let settings;\n    if (settingRegistry) {\n        try {\n            settings = await settingRegistry.load(registry.id);\n            const updateSettings = (plugin) => {\n                const composite = plugin.composite;\n                for (const key of [...Object.keys(configuration)]) {\n                    const value = composite[key];\n                    if (value !== undefined) {\n                        configuration[key] = value;\n                    }\n                }\n                if (labShell) {\n                    for (const widget of labShell.widgets('main')) {\n                        const model = tracker.get(widget);\n                        if (model) {\n                            model.setConfiguration(configuration);\n                        }\n                    }\n                }\n                else {\n                    if (app.shell.currentWidget) {\n                        const model = tracker.get(app.shell.currentWidget);\n                        if (model) {\n                            model.setConfiguration(configuration);\n                        }\n                    }\n                }\n            };\n            if (settings) {\n                settings.changed.connect(updateSettings);\n                updateSettings(settings);\n            }\n        }\n        catch (error) {\n            console.error(`Failed to load settings for the Table of Contents extension.\\n\\n${error}`);\n        }\n    }\n    // Set up the panel toolbar\n    const numbering = new _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_4__.CommandToolbarButton({\n        commands: app.commands,\n        id: CommandIDs.displayNumbering,\n        args: {\n            toolbar: true\n        },\n        label: ''\n    });\n    numbering.addClass('jp-toc-numberingButton');\n    toc.toolbar.addItem('display-numbering', numbering);\n    toc.toolbar.addItem('spacer', _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_4__.Toolbar.createSpacerItem());\n    toc.toolbar.addItem('collapse-all', new _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_4__.CommandToolbarButton({\n        commands: app.commands,\n        id: CommandIDs.toggleCollapse,\n        args: {\n            toolbar: true\n        },\n        label: ''\n    }));\n    const toolbarMenu = new _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_4__.MenuSvg({ commands: app.commands });\n    toolbarMenu.addItem({\n        command: CommandIDs.displayH1Numbering\n    });\n    toolbarMenu.addItem({\n        command: CommandIDs.displayOutputNumbering\n    });\n    const menuButton = new _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_4__.ToolbarButton({\n        tooltip: trans.__('More actions…'),\n        icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_4__.ellipsesIcon,\n        actualOnClick: true,\n        onClick: () => {\n            const bbox = menuButton.node.getBoundingClientRect();\n            toolbarMenu.open(bbox.x, bbox.bottom);\n        }\n    });\n    toc.toolbar.addItem('submenu', menuButton);\n    // Add the ToC to the left area:\n    app.shell.add(toc, 'left', { rank: 400, type: 'Table of Contents' });\n    // Update the ToC when the active widget changes:\n    if (labShell) {\n        labShell.currentChanged.connect(onConnect);\n    }\n    // Connect to current widget\n    void app.restored.then(() => {\n        onConnect();\n    });\n    return tracker;\n    /**\n     * Callback invoked when the active widget changes.\n     *\n     * @private\n     */\n    function onConnect() {\n        var _a;\n        let widget = app.shell.currentWidget;\n        if (!widget) {\n            return;\n        }\n        let model = tracker.get(widget);\n        if (!model) {\n            model = (_a = tocRegistry.getModel(widget, configuration)) !== null && _a !== void 0 ? _a : null;\n            if (model) {\n                tracker.add(widget, model);\n            }\n            widget.disposed.connect(() => {\n                model === null || model === void 0 ? void 0 : model.dispose();\n            });\n        }\n        if (toc.model) {\n            toc.model.headingsChanged.disconnect(onCollapseChange);\n            toc.model.collapseChanged.disconnect(onCollapseChange);\n        }\n        toc.model = model;\n        if (toc.model) {\n            toc.model.headingsChanged.connect(onCollapseChange);\n            toc.model.collapseChanged.connect(onCollapseChange);\n        }\n        setToolbarButtonsState();\n    }\n    function setToolbarButtonsState() {\n        app.commands.notifyCommandChanged(CommandIDs.displayNumbering);\n        app.commands.notifyCommandChanged(CommandIDs.toggleCollapse);\n    }\n    function onCollapseChange() {\n        app.commands.notifyCommandChanged(CommandIDs.toggleCollapse);\n    }\n}\n/**\n * Table of contents registry plugin.\n */\nconst registry = {\n    id: '@jupyterlab/toc-extension:registry',\n    description: 'Provides the table of contents registry.',\n    autoStart: true,\n    provides: _jupyterlab_toc__WEBPACK_IMPORTED_MODULE_2__.ITableOfContentsRegistry,\n    activate: () => {\n        // Create the ToC registry\n        return new _jupyterlab_toc__WEBPACK_IMPORTED_MODULE_2__.TableOfContentsRegistry();\n    }\n};\n/**\n * Table of contents tracker plugin.\n */\nconst tracker = {\n    id: '@jupyterlab/toc-extension:tracker',\n    description: 'Adds the table of content widget and provides its tracker.',\n    autoStart: true,\n    provides: _jupyterlab_toc__WEBPACK_IMPORTED_MODULE_2__.ITableOfContentsTracker,\n    requires: [_jupyterlab_toc__WEBPACK_IMPORTED_MODULE_2__.ITableOfContentsRegistry],\n    optional: [_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__.ITranslator, _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILayoutRestorer, _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILabShell, _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_1__.ISettingRegistry],\n    activate: activateTOC\n};\n/**\n * Exports.\n */\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([registry, tracker]);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/toc-extension/lib/index.js?");

/***/ })

}]);